Compare commits

..

178 Commits

Author SHA1 Message Date
Robert Osfield
d69f2a81f9 Updated ChangeLog for 3.4.1 release 2017-08-28 17:50:49 +01:00
Robert Osfield
35334daae4 Build fix 2017-08-28 17:34:51 +01:00
Robert Osfield
14232cd993 Added back in 3.4.0 release entry 2017-08-28 16:55:52 +01:00
Denys Koch
ec86072533 Fix flawed BoundingSphere inequality operator 2017-08-28 16:53:20 +01:00
Robert Osfield
3f66f1d276 Updates for 3.4.1 stable release 2017-08-28 15:36:31 +01:00
Robert Osfield
c1055fdfbc Updated rc number to 3 or 3.4.1-rc3 2017-08-24 17:49:34 +01:00
Robert Osfield
328632af75 Updated READE and ChangeLog 2017-08-24 17:45:48 +01:00
Robert Osfield
ec89d96114 Fixed underflow issue 2017-08-23 15:26:52 +01:00
Robert Osfield
ea17943a74 Bimped SO version due to changes in Windows exports in osgDB::ifstream + ofstream. 2017-08-22 14:17:45 +01:00
Robert Osfield
07d05840e9 Updated RC number to 2 for 3.4.1-rc2 2017-08-22 12:19:40 +01:00
Robert Osfield
d108bea9eb Updated ChangeLog 2017-08-22 12:18:29 +01:00
Robert Osfield
1bc5ef030f Added name typo fix 2017-08-22 12:00:17 +01:00
Robert Osfield
15e60acfb5 Updated ChangeLog 2017-08-22 09:05:27 +01:00
Robert Osfield
4710b6556d Added catch for controbutors list 2017-08-22 09:04:49 +01:00
OpenSceneGraph git repository
a231483ea6 Merge pull request #310 from OpenMW/merge_internalsizedformats
Applied sizedInternalFormats change to 3.4 branch
2017-08-22 08:03:33 +01:00
Robert Osfield
5e48c51bd7 Reversed the order of some sizedInternalFormats enum entries to sync with the change in serach direction that was checked in as an earlier revision. 2017-08-21 21:16:00 +00:00
Robert Osfield
036c6676c1 Added handling of CPACK and automatically generated package files 2017-08-21 15:24:13 +01:00
Robert Osfield
ed9c28b4ec Removed unneccessary DrawArrays->setCount() that was causing a crash. 2017-08-18 16:26:12 +01:00
Robert Osfield
50e471d900 Merged addition of "" around variablesfrom master. 2017-08-18 16:11:29 +01:00
Raymond de Vries
5b7ef57ad7 Fix for better picking up 3rd party dependencies 2017-08-18 16:01:31 +01:00
Robert Osfield
a3e11f1d50 Fixed iterator comparison. 2017-08-18 08:08:28 +01:00
Robert Osfield
4e67d6deb2 Adopted OSG_GL*_FEATURES usage of 0 and 1 in place of false and true to avoid VisualStudio 2012 build issues 2017-08-17 08:53:58 +01:00
Uwe Woessner
edee9d0946 Extension to the PLY plugin to read files with textures. 2017-08-15 15:42:22 +01:00
OpenSceneGraph git repository
e5cccefafe Merge pull request #291 from eligovision/OpenSceneGraph-3.4_animation
osgAnimation: classes UpdateVec2fUniform and UpdateVec4fUniform added
2017-07-31 16:47:09 +01:00
konstantin.matveyev
2c35b63d38 [*] osgDB::OutputStream fix 2017-07-31 17:50:36 +03:00
konstantin.matveyev
700dd2b9a7 [+] Two classes added: osgAnimation::UpdateVec2fUniform, osgAnimation::UpdateVec4fUniform 2017-07-31 17:50:08 +03:00
OpenSceneGraph git repository
c1585d3c17 Merge pull request #289 from eligovision/OpenSceneGraph-3.4_apple
IMAGEIO plugin tweak
2017-07-31 15:06:57 +01:00
OpenSceneGraph git repository
76a92314cf Merge pull request #290 from eligovision/OpenSceneGraph-3.4_apple_ios
osgViewer::GraphicsWindowIOS fixes
2017-07-31 15:05:26 +01:00
konstantin.matveyev
60eb458c47 [*] imageio changed: more methods of storing image supported; tested on macOS (compatibility profile) and iOS(GLES2/3) 2017-07-31 15:37:55 +03:00
konstantin.matveyev
7e5a9582b3 [*] osgViewer::GraphicsWindowIOS fixes 2017-07-31 15:34:21 +03:00
Robert Osfield
662e76d721 Fixed indectation 2017-07-31 12:44:47 +01:00
OpenSceneGraph git repository
428f4a3804 Merge pull request #288 from eligovision/OpenSceneGraph-3.4_pragmatic
pragma(tic) shader composing fixes in the State
2017-07-31 12:42:15 +01:00
konstantin.matveyev
23edfad1fd [**] pragma(tic) fix: 'defineMap.changed flag' condition changed in State::push/popDefineList 2017-07-31 13:40:00 +03:00
Robert Osfield
0c1fad2c91 Updated AUTHORS and CHangeLog for 3.4.1-rc1 2017-07-28 17:57:02 +01:00
Robert Osfield
1201ac230d Updated 3.4 branch to 3.4.1-rc1 version 2017-07-28 17:43:34 +01:00
James Turner
eabd08ef25 Attempt to fix broken DLL exports from osgDB
Only export the osgDB method implementations, instead of the entire
class, and hence avoid exporting symbols from the base class, which
then conflict with other compilation units when linking.

This avoids the need for /FORCE:MULTIPLE linker option with MSVC.
2017-07-27 16:52:22 +01:00
Robert Osfield
a5bcbc1822 Adopted FindFreetype.cmake from master 2017-07-27 10:43:33 +01:00
Robert Osfield
f822603446 Replaced State::_glExtensions initialization to be consistent with master, enabling sharing of GLExtension data structure. 2017-07-26 11:12:11 +01:00
Robert Osfield
f449bd3730 Moved State::initializeExtensionProcs() nearer top of source file to make the position consistent with change in position in master, making it easier to diff between them. 2017-07-26 11:08:46 +01:00
Robert Osfield
b37b635a7c Merged GLExtension deletion mechanism from master to avoid GLEXtension being deleted when shared contexts are used and osg::State is deleted when a context is deleted. 2017-07-25 15:58:27 +01:00
OpenSceneGraph git repository
224f837e0d Merge pull request #272 from psyinf/msvc_static_build
Msvc static build
2017-07-25 14:45:20 +01:00
Sebastian Messerschmidt
1d7d1dda42 FIX: missing change in ENDIF 2017-07-21 13:12:38 +02:00
Sebastian Messerschmidt
ac36649ed6 FIX: <CMake> attempting to install pdb-files for static targets caused failing INSTALL 2017-07-21 12:58:10 +02:00
Anna Sokol
9c7a474032 Since version 2.5.1 freetype has supported the WOFF extension format.
In the attached ReaderWriterFreeType.cpp file I added the following line:

            supportsExtension("woff","web open font format");
2017-07-17 16:47:22 +01:00
Robert Osfield
06a45ef889 Pulled in .gitignore from master 2017-06-20 09:35:49 +01:00
Robert Osfield
1e4f6f675b Backported GLES compatible shaders into ShaderGen 2017-06-19 17:38:54 +01:00
Robert Osfield
e6ab01c7c6 Backported GL2/3, GLES2/3 compatible Text and StatsHandler shaders to OSG-3.4 2017-06-19 17:38:25 +01:00
Robert Osfield
b2cd4b5836 Added TimeMultiplier and LoopingMode to ImageSequence .osg serializer 2017-05-29 12:25:30 +01:00
Robert Osfield
09b37224ff Improved the DrawElements selction 2017-05-25 13:29:42 +01:00
Robert Osfield
6d4afbbb49 Added handlng of Text with large number of characters 2017-05-25 10:53:00 +01:00
Robert Osfield
8b433f8364 Replaced osg::DrawElementeUInt usage for a more flexible DrawElements base class approach with the default set to DrawElementUShort to ensure compatibility with GLES2 implementes that don't support uint for glDrawElements. 2017-05-25 10:41:12 +01:00
Robert Osfield
10c1fedfca Addded a GLES2 compatible osgmovie shader 2017-05-16 12:32:41 +01:00
OpenSceneGraph git repository
0af180f8b0 Merge pull request #251 from emminizer/OpenSceneGraph-3.4
osgText::Glyph: Explicitly set GL_TEXTURE_MIN_FILTER to address disap…
2017-05-10 11:08:27 +01:00
Daniel Emminizer
b001e8d36d osgText::Glyph: Explicitly set GL_TEXTURE_MIN_FILTER to address disappearing glyphs on some Intel cards. 2017-04-25 07:22:16 -04:00
Alexander Roan
397ab4aa51 GLExtenstions: fix checking of isFrameBufferObjectSupported flag for GLES2 2017-04-24 10:38:02 +01:00
Konstantin S. Matveyev
9eaf03e16e Fixes glyphs's MODELVIEW matrices (positions, scales etc.) if state.getUseModelViewAndProjectionUniforms() is true 2017-04-18 15:53:48 +01:00
OpenSceneGraph git repository
9ba9221ccf Merge pull request #214 from LaurensVoerman/submit-3.4serializerParticle
fix bug in osgb/osgt/osgx readerwriter osgParticle
2017-03-13 14:27:08 +00:00
OpenSceneGraph git repository
16591a310a Merge pull request #210 from scrawl/programfix_backport
Backport state leak fix to 3.4 branch
2017-03-11 11:38:18 +00:00
Nico Kruithof
1b9e1301cf Fixed typo
osg_ModeViewMatrix -> osg_ModelViewMatrix
2017-03-10 17:48:54 +00:00
Laurens Voerman
796b9f0a9b fix bug in osgb/osgt/osgx readerwriter causing the osgParticle-SizeInterpolator and -ColorInterpolator to dissapear 2017-03-06 15:33:22 +01:00
Robert Osfield
232d227170 Changed Program::apply() to Program::compileGLObjects() to avoid the Program::apply() setting of setLastAppliedProgramObjects for affect current state. 2017-02-26 17:25:10 +01:00
OpenSceneGraph git repository
95818b0819 Merge pull request #199 from scrawl/statefix_backport
Backport State fix to 3.4 branch
2017-02-08 14:54:08 +00:00
Julien Valentin
ad0a73273c fix in StateSet.cpp
the State::DefineMap::changed flag is not resetted to false after currentDefines are updated
2017-02-08 00:52:04 +01:00
Robert Osfield
168212f383 Fixed linking bug caused by repeated Program::addShader()/removeShader() operations invalidating the internal attach/dettech lists. 2017-01-24 17:38:33 +00:00
Robert Osfield
320e0ce60c Quitened down verbose debug messages 2017-01-20 17:31:49 +00:00
Robert Osfield
6f1a828b37 Quietened down some verbose debug messages 2017-01-20 17:06:55 +00:00
Robert Osfield
e07f1ff5e9 Fixed indentation of comment 2017-01-19 15:56:17 +00:00
Robert Osfield
b6ec9dc532 Fixed unitialized variable access to premature calling of computeMatrix(). 2017-01-04 12:56:25 +00:00
Robert Osfield
d93d2e0ec1 From Hartwig Wiesmann, "ScalarsToColors returns a wrong color in case a value larger max is passed to getColor" 2016-12-23 17:17:33 +00:00
Robert Osfield
f272089857 From Torben Dannhauer, build updates for NVTT. 2016-12-21 17:03:24 +00:00
Robert Osfield
ad917a5318 From Torben Dannahauer, updates to track changes to Winddows 3rd party package 2016-12-21 16:35:10 +00:00
Robert Osfield
f0056c6d3b From Torben Dannhauer, "When compiling OSG with DCMTK on windows, it throws an compiler error due to a missing ws2_32.lib in the linker settings." 2016-12-21 15:35:43 +00:00
Robert Osfield
fe25b2961b From Andreas Ekstrand, "he attached ESRIShape.cpp contains a small fix in parsing of PointZ features, now correctly comparing with header content length which is defined in 16-bit words.
This should have been fixed in my old submission from 2012 but was probably overlooked due to an alternative way of comparing to a fix number for this feature type.

Without this fix, the plugin will only read one PointZ feature even if multiple features exist."
2016-12-21 11:40:16 +00:00
Robert Osfield
6511347d4b Added StateSet::setGlobalDefaults() to fix bug when osgViewer has stats on but no scene graph assigned 2016-12-21 09:15:48 +00:00
Robert Osfield
192e654cdb Fixed handling of #define's that are used as functions 2016-12-16 16:14:10 +00:00
Robert Osfield
b59c46c3cf Added GL_EXT_texture_border_clamp support for GLES 2016-11-30 17:15:06 +00:00
scrawl
29049ea238 Fix typo in StateSet::compileGLObjects, causing compilation of attributes to not be executed unless checkForGLErrors is true. 2016-11-26 12:17:07 +00:00
Robert Osfield
46df1fd141 Fixed crash in handling of osg::Callback attached as Drawable update callback.
Added handling of osg::Callback as a Drawable cull callback
2016-11-23 19:18:14 +00:00
Robert Osfield
8af48d369c Added Dragger::applyAppropriateFrontFace(StateSet*) to make it easy to handle inverted matrices by toggling the FrontFace to sure the correct face is visible. 2016-11-11 17:16:40 +00:00
Robert Osfield
95d450e026 Merge branch 'OpenSceneGraph-3.4' of https://github.com/openscenegraph/OpenSceneGraph into OpenSceneGraph-3.4 2016-11-11 13:54:54 +00:00
Robert Osfield
b58048e43b Fixed handling of Locator's with negative extents 2016-11-11 13:54:15 +00:00
Robert Osfield
1f1c21772a Added check against binding type of array to decide whether it's appropriate to assign array to VBO. 2016-11-03 11:32:25 +00:00
Robert Osfield
fa27a1f3ed Changed appending of \n to be to the version line. 2016-10-12 17:23:19 +01:00
Robert Osfield
d5d4f7239b From Torben Dannhauer, added freetype27 (2.7) to search list 2016-10-10 11:22:44 +01:00
Laurens Voerman
2a110515c1 remove CMAKE_BUILD_TYPE STREQUAL "Release" (cmake configure time varable) to select pdb install - select CONFIGURATIONS RelWithDebInfo Debug 2016-10-07 17:03:35 +01:00
Laurens Voerman
d2a0315e20 fix bug in SmoothingVisitor tripped by bunny.ply 2016-10-06 14:18:14 +01:00
Robert Osfield
1f9725ea49 Replaced local static usage to avoid threading and mulit-context issues 2016-09-22 14:34:13 +01:00
Anish Thomas
d772304cec GLSL 1.3 support for vertex-attrib aliasing 2016-09-12 08:46:40 +01:00
Robert Osfield
192574958a Fixed handling in osgUtil::IncrementalCompileOperation/CompileSet/StateToCompile when the _markerObject is NULL. 2016-08-15 12:56:57 +01:00
Robert Osfield
7df7eb78ac Merge branch 'OpenSceneGraph-3.4' of https://github.com/openscenegraph/OpenSceneGraph into OpenSceneGraph-3.4 2016-07-31 14:57:11 +01:00
Robert Osfield
e2359890bd Added FT_LOAD_NO_HINTING 2016-07-31 14:02:41 +01:00
Robert Osfield
912e4f8a0c Revert "corrected syntax error in src/osgPlugins/fbx/ReaderWriterFBX.cpp"
This reverts commit 7a1324800f.
2016-07-31 11:27:45 +01:00
Robert Osfield
78300f7d61 Fixed build error reported on gcc 4.6.4/Ubuntu 12.04 32bit, issue #108 2016-07-31 11:27:23 +01:00
Thao Le
2bd81226c3 corrected syntax error in src/osgPlugins/fbx/ReaderWriterFBX.cpp 2016-06-20 06:43:02 +01:00
Robert Osfield
37f6e2b39e Fixed invalidated iterator bug pick up by Coverity. 2016-06-10 12:45:38 +01:00
Robert Osfield
2f4064d757 Copied over .travis.yml file to 3.4 branch to add build testing 2016-06-09 14:33:05 +01:00
Mathieu MARACHE
04f27c370e Build fix for VS. 2016-06-09 14:10:02 +01:00
Robert Osfield
02eb8de191 Rewrote Window::setNextFocusable() to address a bug in the management of the search iterator. Covertiy reported bug "Undefined behavior may result; the program may crash or subtly misbehave.
In osgWidget::​Window::​setNextFocusable(): An invalid or past-the-end iterator is being used."
2016-06-09 12:10:38 +01:00
Robert Osfield
d3f5aef5ef Fixed "Using invalid iterator" bug in getTile() methods, detected by Covertity. 2016-06-09 11:43:28 +01:00
Julien Valentin
ec8cb360c8 Fixed little bug in DrawArraysLength (instancing not supported).
Corrected PrimitiveSet.cpp in order DrawArraysLength can be instanced.
It's the only pr missing code
if (_numInstances>=1)      glDrawXXXInstanced(...,_numInstances);
else glDrawXXX();
2016-06-03 17:58:26 +01:00
Robert Osfield
8c79dccbbc Fixed missing " 2016-06-01 12:49:55 +01:00
Robert Osfield
517728c7d9 Added macosx10.11 to the list of supported OSX SDK's 2016-06-01 11:42:17 +01:00
Robert Osfield
0f7e30a74e Added in extra search paths for FBX 2016-06-01 11:25:31 +01:00
Andreas Cadhalpun
6cacc5a2c2 Replace deprecated FFmpeg API to fix build with ffmpeg-3.0.x 2016-06-01 10:33:19 +01:00
Stephan van Alste
aae4f22163 Do not install non existant pdb file in release build mode 2016-05-31 17:06:48 +01:00
Ralf Habacker
6eaf2f5781 Install msvc debug files along with the binaries 2016-05-31 17:02:11 +01:00
Ralf Habacker
e536d8e601 Fixed bug not detecting unc pathes in osgDB::isAbsolutePath() 2016-05-31 16:17:15 +01:00
Alberto Luaces
af9d8889c8 defines for building on Hurd and BSD kernels 2016-05-31 12:59:48 +01:00
Pjotr Svetachov
a4c9cac2a8 small optimization to the osgb/t serializers. 2016-05-31 11:28:27 +01:00
Jannik Heller
5c46d9de3e Fixed typo of method name 2016-05-30 13:43:09 +01:00
Tony Vasile
8d08b75e19 OpenFlight-plugin with Surface Material Codes. There is one additional field that may be required by an existing application in addition to the IR Code is the IR Material. I have a small fix to include the IR Material as the User Value <UA:IRM> 2016-05-30 12:42:06 +01:00
Robert Osfield
6ec5d80b0d From Wee See, "attached a small submission, which makes the option "readObjectRecordData" of OpenFlight-plugin working like documented in the Knowledge Base of OSG (52-using-the-openflight-plugin).
Actually, if the option "readObjectRecordData" is set, ObjectRecordData will not be read and set.
With this submission, if the option "readObjectRecordData" is set, ObjectRecordData will be read and set."
2016-05-26 18:07:46 +01:00
Robert Osfield
f48b5a3fdb From Philippe Renon and Robert Osfield, osgViewer::Viewer::checkNeedToDoFrame should return true when only the root node has an update callback.
Note, from Robert, I took Philippe modifications to Viewer.cpp and reformated them slightly to avoid a double check against getSceneData()!=0 and then rolled
the changes out to CompositeViewer::checkNeedToDoFrame() to ensure that both implementations work the same.
2016-05-26 17:51:35 +01:00
Robert Osfield
7bcc5d861e Fixed RenderStageCache's handling of Observer functionality that was causing a crashing on exit in osgoit and osgprerender examples. 2016-05-24 20:49:01 +01:00
Robert Osfield
933b8cdbaf Added GLES3 path for setting up with EGL 2016-05-06 19:55:04 +01:00
Robert Osfield
7200e38fce Added 3.4 press release to NEWS.txt 2016-05-06 17:53:27 +01:00
Robert Osfield
4a1f033dbe Added non const releaseGLObjects(osg::State* state) for backwards compatibility 2016-04-27 08:40:35 +01:00
Robert Osfield
ec19ee9655 Fixed copy _readBuffer bug. 2016-04-21 14:08:20 +01:00
Robert Osfield
653af27d02 Fixed ShaderComposer::releaseGLObjects(State*) const method as it's const was missing.
Rewrote the ShaderComposer::releaseGLObjects() const method to pass on the releaseGLObjects() calls to any associated Program or Shader objects.
2016-04-18 20:49:02 +01:00
Robert Osfield
29ce4f616d From Vladimir Chebaev, fixed handling of outline orientiation 2016-04-14 18:08:52 +01:00
Robert Osfield
f39cc7b6f1 From Vladimir Chebaev, fixed handling of outline orientiation 2016-04-14 18:01:58 +01:00
Robert Osfield
879a8bd020 Changed the default value paramter to be consistent with the non templated version of StateSet::setTextureAttributeAndModes(..) 2016-04-01 11:47:02 +01:00
Robert Osfield
ccb06f003a Merge branch 'OpenSceneGraph-3.4' of https://github.com/openscenegraph/OpenSceneGraph into OpenSceneGraph-3.4 2016-03-31 19:26:51 +01:00
Robert Osfield
79fa48c984 added assignment of mipmap levels from source image. 2016-03-31 19:26:08 +01:00
Robert Osfield
47022a1bf0 From Sherman Wilcox, added assignment of mipmap levels from source image. 2016-03-31 18:58:45 +01:00
Robert Osfield
926cffb2ee From Jannik Heller, Wrong function call in setTextureAttributeAndModes
"From I think that this piece of code in StateSet::setTextureAttributeAndModes is a copy&paste mistake:

            OSG_NOTICE<<"Warning: non texture attribute '"<<attribute->className()<<"' passed to setTextureAttributeAndModes(unit,attr,value), "<<std::endl;
            OSG_NOTICE<<"         assuming setAttributeAndModes(attr,value) instead."<<std::endl;
            OSG_NOTICE<<"         please change calling code to use appropriate call."<<std::endl;
            setAttribute(attribute,value);

As per the warning message it should be calling setAttributeAndModes(attribute,value); ."
2016-03-11 16:48:19 +00:00
Robert Osfield
f044bc6b45 From Joe Thompson, "OpenSceneGraph cannot be built with Visual Studio 2008.
The file osg-OpenSceneGraph-3.4.0\include\osg\Types
typedefs int8_t, int16_t, int32_t and int64_t
These are typedefed as signed __intX in several other places.
With VS2008, this causes an error "int8_t redifined, different basic types"
Explicitly declaring them signed fixes the error."
2016-03-02 09:21:15 +00:00
Robert Osfield
ac8bbb9d1e Updated ChangeLog 2016-03-01 20:37:07 +00:00
Robert Osfield
db24f7f09d Removed redundent CMake vars 2016-03-01 20:34:18 +00:00
Robert Osfield
520b6c24f6 Fixed the make tag-run and branch-run 2016-03-01 20:33:21 +00:00
Robert Osfield
244cec821e Updated AUTHORS and ChangeLog 2016-03-01 19:54:36 +00:00
Robert Osfield
ba309bf38b Refactored the make tag-test, tag-run, branch-test, branch-run and ChangeLog features of the CMakeLists build system so it now supports working off git instead of subversion 2016-03-01 19:50:05 +00:00
Robert Osfield
60a7b8ce02 Within the #pragmatic shader composition code added platform specific line endings for WIN32 vs all other platforms to "\r\n" and "\n" respectively. 2016-03-01 11:47:33 +00:00
Robert Osfield
3a15c66290 Merged improved parsing of #pragma from master. 2016-02-29 15:57:01 +00:00
Robert Osfield
577d161303 Fixed debug build 2016-02-24 16:00:12 +00:00
Robert Osfield
6011bc4307 From Jannik Heller, osgParticle freeze on cull fix, ammended by Robert Osfield to make if statements a little more readable. 2016-02-23 10:14:21 +00:00
Robert Osfield
40caedc7cd From Anish Thomas, "Underflow bug in BufferObject pool usage" 2016-02-22 09:22:06 +00:00
Robert Osfield
4371512dd2 From Bjorn Blissing, "I stumbled upon a strange ifdef-case inside Geometry.cpp
Currently the code looks like this:

Code:
    DrawElementsUByte* elems = new DrawElementsUByte(PrimitiveSet::TRIANGLES);
    elems->push_back(0);
    elems->push_back(1);
    elems->push_back(2);

    elems->push_back(2);
    elems->push_back(3);
    elems->push_back(0);
    geom->addPrimitiveSet(elems);
    geom->addPrimitiveSet(new DrawArrays(PrimitiveSet::QUADS,0,4));

The second condition looked really strange (note the ! sign), and results in pretty much all code paths uses the first code. The correct version should probably be that only people with GLES1 or GLES2 should use GL_TRIANGLES to simulate quads. And all others should use the native support for GL_QUADS.
"
2016-02-19 15:04:14 +00:00
Robert Osfield
9132d98785 To the COLLADA_INCLUDE_DIR search paths added the directories:
/usr/local/include/collada-dom2.4
    /usr/local/include/collada-dom2.2
    /opt/local/include/collada-dom2.4
    /opt/local/include/collada-dom2.2
    /usr/include/collada-dom2.4
    /usr/include/collada-dom2.2

To enable recent versions of the DOM to be found in their new install locations.
2016-02-19 12:21:36 +00:00
Robert Osfield
47c531cc37 Updated the AuthenticationDetails::HttpAuthentication enum to reflect current libcurl values 2016-02-18 19:55:58 +00:00
Robert Osfield
4704621c39 Replaced (long int) with more portable (GLint64) 2016-02-18 10:58:26 +00:00
Robert Osfield
0244b234ca From Tony Vasile, "This is a fix for the handling of OpenFlight files with switches whose children have a transformation matrix on them. It may break other things and I have only tested this with one of my models." 2016-02-18 10:07:29 +00:00
Robert Osfield
09fd75dcf4 From Mourad Boufarguine, "This submission fixes typos in Uniform::getTypename() method in Uniform.cpp (missing "r" in usampler names)." 2016-02-18 09:28:33 +00:00
Robert Osfield
c3d45732a1 Renamed zero and one to transparentCount and opaqueCount to avoid confusion in their meaning and usage. 2016-02-18 08:59:26 +00:00
Robert Osfield
89f74b1a56 Fixed warning 2016-02-17 17:36:10 +00:00
Robert Osfield
6089257d3c Commented out unused functions and variable. 2016-02-17 17:08:07 +00:00
Robert Osfield
97336b89ac Introduced a separate GLuint64 one variable to get around a 32bit build timer issue under Windows. 2016-02-17 16:03:26 +00:00
Robert Osfield
229b833a5a Fixed check against Drawable::isCullingActive().
Removed old code intended to check the Geode parent of a Drawable to see if it's CullingActive is true as this was broken by the change osg::Drawable being derived from osg::Node rather than osg::Object.
2016-01-27 10:10:01 +00:00
Robert Osfield
7ae1421864 Added .gitignore to queiten down git status reports 2016-01-25 19:44:58 +00:00
Robert Osfield
bf1aa5088e Revert "From Jannik Heller and Robert Osfield, introduced ReadResult/WriteResult::statusMessage() method that creates a std::string from the stutus value and message string."
as this submission was meant for the master only, not the binary compatible 3.4 branch.

This reverts commit df97a18a5754ed39ac43044ad9557e8409790ff3.
2016-01-25 12:18:32 +00:00
Robert Osfield
e798db04c8 From John Farrier, "Best I can tell, there is an enumeration for NEVER_CHECK_GL_ERRORS in CheckForGLErrors, defined in State. State.cpp does check to see if you want MORE error checking, but there is no way to turn OFF error checking. This change allows disabling of OpenGL error checking." 2016-01-25 10:49:23 +00:00
Robert Osfield
adbadd66be From Patrick Neary, "In ShaderComposer::getOrCreateProgram(), tesselation control and evaluation shaders are processed but not added to the shader program." 2016-01-25 10:26:52 +00:00
Robert Osfield
bd0cf5e47d Changed the prototype from NULL to osg::DummyObject to address a bug in reading .osgt + .osgx where an image is written out but fails to read the file causes subsequent parts of the file to be mis-read 2016-01-22 10:14:35 +00:00
Robert Osfield
7239050c5b Fixed typo View::setImagePager(..) template method 2016-01-21 08:32:57 +00:00
Robert Osfield
55bb474c3b From Jannik Heller, "This submission fixes a bug introduced in commit 5b17e3bc2a "Introduced CMake option OSG_PROVIDE_READFILE option...". The added overload for StateSet::setAttributeAndModes was ignoring the mode setting.
"
2016-01-20 14:24:06 +00:00
Robert Osfield
ff1051a6fd From Jannik Heller and Robert Osfield, introduced ReadResult/WriteResult::statusMessage() method that creates a std::string from the stutus value and message string. 2016-01-19 17:39:03 +00:00
Robert Osfield
845bb6aceb From Ravi Mathur, OSX/Clang 7.0.0 build fix 2016-01-19 15:43:47 +00:00
Robert Osfield
3e23c5b22d From Wojciech Lewandowski, Visual Studio 2008 compatibility fix
Two fixed files:

osgPlugins/osgjs/JSON_Objects
osgPlugins/stl/ReaderWriterSTL.cpp.

They did not compile with VS 2008 (recent master from Github). It looks like they defined stdint types  (missing in VS 2008) but code using them also included <osg/Types> header. Errors were caused by minor differences in signed int definitions. I just removed own definitions and added include<osg/Types> instead. It solves the problem and makes the code clearer now.
2015-12-14 18:47:09 +00:00
Robert Osfield
5675d86c9b From Jordi Torres, Fix for missing header file in distribution
osg/TriangleLinePointIndexFunctor was not being installed because it was not added to the CMakeLists.txt
2015-11-23 13:17:06 +00:00
Robert Osfield
5405d9c465 Added support for copying include/osgViewer/config headers on make install. 2015-11-23 12:29:25 +00:00
Robert Osfield
3b17418031 Fixed warning message
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15179 16af8721-9629-0410-8352-f15c8da7e697
2015-11-09 15:14:07 +00:00
Robert Osfield
9fc6850962 From Jannik Heller, fixed typo of OSG_COMPIlE_CONTEXTS env var
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15175 16af8721-9629-0410-8352-f15c8da7e697
2015-11-08 11:59:23 +00:00
Robert Osfield
46904ff67a From Mathias Froehlich, "Avoid per frame X11 roundtrips"
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15174 16af8721-9629-0410-8352-f15c8da7e697
2015-11-05 14:38:19 +00:00
Robert Osfield
636d595912 From Alberto Luaces, "here are two minimal capitalization fixes for mingw cross-compilation, where case sensitivity matters."
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15172 16af8721-9629-0410-8352-f15c8da7e697
2015-10-26 11:43:28 +00:00
Robert Osfield
5310a96c73 Restructed the setting of the RenderStage ClearColor/ClearMask to make the code more readable and to avoid double setting of the ClearMask.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15170 16af8721-9629-0410-8352-f15c8da7e697
2015-10-26 11:41:44 +00:00
Robert Osfield
5dc251a5c1 From Sebastian Messershmidt, "The uncommented pointer type QTimerEvent */*event*/ leads to a compiler error under visual studio 2010"
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15168 16af8721-9629-0410-8352-f15c8da7e697
2015-10-23 11:07:30 +00:00
Robert Osfield
6a67be2e32 Introduced CMake option OSG_PROVIDE_READFILE option that defaults to ON, but when switched to OFF disables the building of the osgDB::read*File() methods,
forcing users to use osgDB::readRef*File() methods.  The later is preferable as it closes a potential threading bug when using paging databases in conjunction
with the osgDB::Registry Object Cache.  This threading bug occurs when one thread gets an object from the Cache via an osgDB::read*File() call where only
a pointer to the object is passed back, so taking a reference to the object is delayed till it gets reassigned to a ref_ptr<>, but at the same time another
thread calls a flush of the Object Cache deleting this object as it's referenceCount is now zero.  Using osgDB::readREf*File() makes sure the a ref_ptr<> is
passed back and the referenceCount never goes to zero.

To ensure the OSG builds when OSG_PROVIDE_READFILE is to OFF the many cases of osgDB::read*File() usage had to be replaced with a ref_ptr<> osgDB::readRef*File()
usage.  The avoid this change causing lots of other client code to be rewritten to handle the use of ref_ptr<> in place of C pointer I introduced a serious of
templte methods in various class to adapt ref_ptr<> to the underly C pointer to be passed to old OSG API's, example of this is found in include/osg/Group:

    bool addChild(Node* child); // old method which can only be used with a Node*

    tempalte<class T> bool addChild(const osg::ref_ptr<T>& child) { return addChild(child.get()); } // adapter template method

These changes together cover 149 modified files, so it's a large submission. This extent of changes are warrent to make use of the Object Cache
and multi-threaded loaded more robust.



git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15165 16af8721-9629-0410-8352-f15c8da7e697
2015-10-22 14:14:53 +00:00
Robert Osfield
74f1838960 Added osg::flushAllDeletedGLObjects to clean up of graphics context after the existing osg::deleteAllGLObjects() to catch any cases where delete doesn't flush GL objects.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15149 16af8721-9629-0410-8352-f15c8da7e697
2015-10-08 15:58:22 +00:00
Robert Osfield
f4e71bad3a OSG_INIT_SINGLETON_PROXY into DatabasePager::prototype() and Registry::instance(), removing the InitRegistry proxy object in src/osgViewer/ViewerBase.cpp.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15148 16af8721-9629-0410-8352-f15c8da7e697
2015-10-05 11:18:46 +00:00
Robert Osfield
61d317b0b8 From Kristofer Tingdahl, "we had a minor shadow problem with the osg-3.4 that pollutes our continuous integration"
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15144 16af8721-9629-0410-8352-f15c8da7e697
2015-09-25 15:20:32 +00:00
Robert Osfield
05f3e038d8 Added fix for case when Renderer is assigned to a Camera that has now View
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15142 16af8721-9629-0410-8352-f15c8da7e697
2015-09-25 11:15:09 +00:00
Robert Osfield
1a9a74216b Refactored osgViewer::Renderer's handled of FrameStamp to avoid threading conflicts
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15139 16af8721-9629-0410-8352-f15c8da7e697
2015-09-25 10:10:10 +00:00
Robert Osfield
6344d4430d From John Hedström,"Texture2DArray support for the .osg serializer"
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15137 16af8721-9629-0410-8352-f15c8da7e697
2015-09-24 14:14:43 +00:00
Robert Osfield
3c7bf7ec8a Fixed line endings
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15133 16af8721-9629-0410-8352-f15c8da7e697
2015-09-24 09:29:15 +00:00
Robert Osfield
87e5c54ee7 From Jannik Heller, "I've hit what I believe to be a bug (or at the very least, an unintuitive behaviour) in the osg::Geometry copy constructor. I noticed it when using osg::clone on a Geometry with vertex buffer objects, and the copy flags DEEP_COPY_ARRAYS. To be precise, I add a Geometry to an osgUtil::IncrementalCompileOperation, then osg::clone the Geometry. I was getting reports from users of random crashes happening.
I believe the offending lines are in the osg::Geometry copy constructor:

    if ((copyop.getCopyFlags() & osg::CopyOp::DEEP_COPY_ARRAYS))
    {
        if (_useVertexBufferObjects)
        {
            // copying of arrays doesn't set up buffer objects so we'll need to force
            // Geometry to assign these, we'll do this by switching off VBO's then renabling them.
            setUseVertexBufferObjects(false);
            setUseVertexBufferObjects(true);
        }
    }

Toggling the vertex buffer objects off then on again actually touches not only the arrays controlled by DEEP_COPY_ARRAYS, but also the PrimitiveSets which are controlled by DEEP_COPY_PRIMITIVES. This means if the user has copyflags of only DEEP_COPY_ARRAYS, we are modifying arrays that belong to the original const Geometry& we are copying from. I believe this shouldn't be allowed to happen because we are using a const& specifier for the original Geometry.

In my case the osgUtil::IncrementalCompileOperation was trying to compile the geometry, while in the main thread a clone operation toggled the VBO's off and on, a crash ensues.

In the attached patch, you will find a more efficient handling of VBO's in the osg::Geometry copy constructor, so that only the Arrays that were actually deep copied have their VBO assigned, and no changes are made to Arrays that already had a valid VBO assigned. In addition, the DEEP_COPY_PRIMITIVES flag is now honored so that VBO's are set up correctly should a user copy a Geometry with only that flag.
"


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15128 16af8721-9629-0410-8352-f15c8da7e697
2015-09-04 15:35:14 +00:00
Robert Osfield
0567ce316d From Laurens Voerman, "I found that using an ImageSequence with mode PAGE_AND_DISCARD_USED_IMAGES triggers the (3) imageThreads to run and never stop, even when no more work is to be done. This is due to a bug in the stop condition currently setting the thread to stop and wait for a signal only when no work needs to be done AND the databasepager is paused.
It should stop and wait for a signal on either of those two. Due to a few logical inversions it boils down to replacing || with &&

OLD _block->set((!_requestList.empty() || !_pager->_databasePagerThreadPaused));
NEW _block->set((!_requestList.empty() && !_pager->_databasePagerThreadPaused));//release the threads to run IF (work_to_be_done && not_paused)

This bug is present since svn rev 8663 (just before 2.6.0 release)


attached is a zip with the files:

OpenSceneGraph\include\osgDB\ImagePager



This file is valid for svn branch and stable 3.2 and 3.4
branches 2.6 - 3.0 have the same bug, but other differences in the file."


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15126 16af8721-9629-0410-8352-f15c8da7e697
2015-09-04 15:05:06 +00:00
Robert Osfield
5cbd785f78 From Laurens Voerman, "I crashed osgconv while compressing textures:
osgconv --compressed-dxt1 cow.osg cow.ive

due to different handling of the extentions in osg 3.4 and up.

attached is a zip with the files:

OpenSceneGraph\applications\osgconv\osgconv.cpp



This file is valid for svn branch and stable3.4."




git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15123 16af8721-9629-0410-8352-f15c8da7e697
2015-09-04 14:50:27 +00:00
Robert Osfield
4ee38248a2 From Julien Valentin, "Serializing custom geometry i ran into a crash due to a
setVertexAttribArrayList(array) with array containing NULL vertexAttrib.
I added a test in order to avoid it


Code:
void Geometry::setVertexAttribArrayList(const ArrayList& arrayList)
{
    _vertexAttribList = arrayList;

    dirtyDisplayList();

    if (_useVertexBufferObjects)
    {
        for(ArrayList::iterator itr = _vertexAttribList.begin();
            itr != _vertexAttribList.end();
            ++itr)
        {
if(itr->get())//ADDED
            addVertexBufferObjectIfRequired(itr->get());
        }
    }
}
"

and

"The bug i ran into is a crash reading osgt Geometry with null vertexattribs.
The only thing i added is a not nul check on array passed to setVertexAttribArrayList."




git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15122 16af8721-9629-0410-8352-f15c8da7e697
2015-09-04 14:35:03 +00:00
392 changed files with 52921 additions and 71173 deletions

94
.gitignore vendored Normal file
View File

@@ -0,0 +1,94 @@
doc/all_Doxyfile
doc/auto_Doxyfile
doc/core_Doxyfile
doc/openscenegraph.doxyfile
doc/openthreads.doxyfile
doc/OpenSceneGraphReferenceDocs/
doc/OpenThreadsReferenceDocs/
cmake_uninstall.cmake
include/OpenThreads/Config
include/OpenThreads/Version
include/osg/Config
include/osg/GL
include/osg/Version
include/osgQt/Version
src/osgQt/__
lib/
bin/
*.pc
*.conf
CMakeCache.txt
CMakeFiles
CMakeScripts
Makefile
cmake_install.cmake
install_manifest*.txt
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Fortran module files
*.mod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
# Platform Specifics - auto generated files
PlatformSpecifics/Windows/*.rc
# Visual studio - project files
*.sln
*.suo
*.vcxproj
*.vcxproj.filters
*.vcxproj.user
# Visual Studio - Build Results
[Dd]ebug/
[Rr]elease/
[Mm]in[Ss]ize[Rr]el/
[Rr]el[Ww]ith[Dd]eb[Ii]nfo/
# Visual Studio - Browsing Database File
*.sdf
*.opensdf
#osx xcode
DerivedData/
*.DS_Store
*.build
*.xcodeproj
#CPACK related files
CPackConfig-*.cmake
_CPack_Packages/
#packages
*.tar.gz
*.zip

36
.travis.yml Normal file
View File

@@ -0,0 +1,36 @@
matrix:
fast_finish: true
include:
#Linux build
- os: linux
dist: trusty
language: cpp
env:
#- LLVM_VERSION=3.8
sudo: false
cache:
apt: true
directories:
- $HOME/.ccache
compiler:
#- clang
- g++
addons:
apt:
sources:
#- llvm-toolchain-precise-3.8
- ubuntu-toolchain-r-test
packages:
#- clang-3.8
- g++
- cmake
# OSX build
- os: osx
language: cpp
script:
- mkdir build
- cd build
- travis_wait 60 cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../product -DBUILD_OSG_EXAMPLES=ON ..
- make install -j3

View File

@@ -1,11 +1,10 @@
OpenSceneGraph Library 3.4.0 OpenSceneGraph Library 3.4.1
550 Contributors: 562 Contributors:
Firstname Surname Firstname Surname
----------------- -----------------
Robert Osfield Robert Osfield
Don Burns
Stephan Huber Stephan Huber
Paul Martz Paul Martz
Farshid Lashkari Farshid Lashkari
@@ -20,28 +19,29 @@ Eric Wing
Cedric Pinson Cedric Pinson
Brede Johansen Brede Johansen
Bob Kuehne Bob Kuehne
Wojciech Lewandowski
Michael Platings Michael Platings
Geoff Michel Geoff Michel
Wojciech Lewandowski
Eric Sokolowsky Eric Sokolowsky
David Callu
Laurens Voerman Laurens Voerman
David Callu
Colin McDonald Colin McDonald
Trajce Nikolov Trajce Nikolov
Tim Moore Tim Moore
Martin Lavery Martin Lavery
Mattias Helsing Mattias Helsing
Tree
Jason Beverage Jason Beverage
Tree
Pjotr Svetachov Pjotr Svetachov
Luigi Calori Luigi Calori
Alberto Luaces
Mike Wittman Mike Wittman
Jan Peciva Jan Peciva
Chris Hanson Chris Hanson
Alberto Luaces
Roland Smeenk Roland Smeenk
Roger James Roger James
Jeremy Moles Jeremy Moles
Jannik Heller
J.P. Delport J.P. Delport
Andy Skinner Andy Skinner
Magnus Kessler Magnus Kessler
@@ -52,6 +52,7 @@ Luc Frauciel
Aurelien Albert Aurelien Albert
Pavel Moloshtan Pavel Moloshtan
Brad Christiansen Brad Christiansen
Torben Dannhauer
Terry Welsh Terry Welsh
Olaf Flebbe Olaf Flebbe
Mathieu Marache Mathieu Marache
@@ -61,23 +62,21 @@ Art Tevs
Philip Lowman Philip Lowman
Per Fahlberg Per Fahlberg
Norman Vine Norman Vine
Jannik Heller
Chris Denham Chris Denham
Sherman Wilcox
Serge Lages Serge Lages
Romano Jos<6F> Magacho da Silva Romano Jos<6F> Magacho da Silva
Alberto Farre
Torben Dannhauer
Sherman Wilcox
Robert Michael
Mourad Boufarguine Mourad Boufarguine
Alberto Farre
Glenn Waldron Glenn Waldron
Andr<EFBFBD> Garneau Andr<EFBFBD> Garneau
Adrian Egli Adrian Egli
Ruben Lopez
Randall Hopper
Jan Ciger
Sebastian Messerschmidt Sebastian Messerschmidt
Randall Hopper
Kristofer Tingdahl Kristofer Tingdahl
Jan Ciger
Ruben Lopez
Robert Michael
Gideon May Gideon May
Don Tidrow Don Tidrow
Stephane Lamoliatte Stephane Lamoliatte
@@ -87,10 +86,10 @@ Joakim Simonsson
David Spilling David Spilling
Daniel Sj<53>lie Daniel Sj<53>lie
Bryan Thrall Bryan Thrall
Andreas Ekstrand
Rafa Gaitan Rafa Gaitan
Mike Connell Mike Connell
Fabien Lavignotte Fabien Lavignotte
Andreas Ekstrand
Thomas Hogarth Thomas Hogarth
Riccardo Corsi Riccardo Corsi
Melchior Franz Melchior Franz
@@ -99,9 +98,9 @@ Johannes Baeuerle
Neil Hughes Neil Hughes
Martin Beckett Martin Beckett
Marc Helbling Marc Helbling
Jordi Torres
Joran Jessurun Joran Jessurun
Gino van den Bergen Gino van den Bergen
Frederic Marmond
David Guthrie David Guthrie
Csaba Halasz Csaba Halasz
Cory Riddell Cory Riddell
@@ -111,21 +110,21 @@ Yefei He
Sondra Iverson Sondra Iverson
Simon Julier Simon Julier
Rune Schmidt Jensen Rune Schmidt Jensen
Ravi Mathur
Rainer Oder Rainer Oder
Nico Kruithof Nico Kruithof
Martin Aumueller Martin Aumueller
Mario Valle Mario Valle
Lukasz Izdebski Lukasz Izdebski
Jorge Izquierdo Ciges Jorge Izquierdo Ciges
Jordi Torres
Gordon Tomlinson Gordon Tomlinson
Frederic Marmond
Frederic Bouvier Frederic Bouvier
Carlo Camporesi Carlo Camporesi
Ben Discoe Bj<EFBFBD>rn Blissing
Alexander Sinditskiy Alexander Sinditskiy
Thibault Genessay Thibault Genessay
Sasa Bistrovic Sasa Bistrovic
Ravi Mathur
Ralf Habacker Ralf Habacker
Neil Groves Neil Groves
Mikhail Izmestev Mikhail Izmestev
@@ -133,8 +132,10 @@ Markus Trenkwalder
Loic Dachary Loic Dachary
Joseph Steel Joseph Steel
John Shue John Shue
Hartwig Wiesmann
Brad Colbert Brad Colbert
Bj<EFBFBD>rn Blissing Ben Discoe
Vladimir Chebaev
Vivek Rajan Vivek Rajan
Uwe Woessner Uwe Woessner
Tony Horrobin Tony Horrobin
@@ -154,9 +155,9 @@ Martins Innus
Maciej Krol Maciej Krol
Lilin Xiong Lilin Xiong
Leandro Motta Barros Leandro Motta Barros
Julien Valentin
Johan Nouvel Johan Nouvel
Javier Taibo Javier Taibo
Hartwig Wiesmann
Donn Mielcarek Donn Mielcarek
Corbin Holtz Corbin Holtz
Blasius Czink Blasius Czink
@@ -167,7 +168,6 @@ Rudolf Wiedemann
Maria Ten Maria Ten
Liang Aibin Liang Aibin
Katharina Plugge Katharina Plugge
Julien Valentin
John Vidar Larring John Vidar Larring
John Kelso John Kelso
John Ivar John Ivar
@@ -182,10 +182,9 @@ Bradley Anderegg
Andreas Goebel Andreas Goebel
Alok Priyadarshi Alok Priyadarshi
Ali Botorabi Ali Botorabi
Alberto Barbati
Alan Dickinson Alan Dickinson
Wee See
Vladimir Shabanov Vladimir Shabanov
Vladimir Chebaev
Tugkan Calapoglu Tugkan Calapoglu
Tim Daoust Tim Daoust
Sylvain Marie Sylvain Marie
@@ -196,8 +195,10 @@ Ryan Pavlik
Robert Milharcic Robert Milharcic
Rene Molenaar Rene Molenaar
Piotr Domagalski Piotr Domagalski
Philippe Renon
Phil Atkin Phil Atkin
Pawel Ksiezopolski Pawel Ksiezopolski
Patrick Neary
Nathan Monteleone Nathan Monteleone
Miha Rav<61>elj Miha Rav<61>elj
Miguel Escriva Miguel Escriva
@@ -225,6 +226,7 @@ Fabio Mierlo
Doug McCorkle Doug McCorkle
Donald Cipperly Donald Cipperly
Don Leich Don Leich
Don Burns
Dietmar Funck Dietmar Funck
Colin Cochran Colin Cochran
Christian Ruzicka Christian Ruzicka
@@ -239,9 +241,9 @@ Andreas Henne
Anders Backman Anders Backman
Alexander Wiebel Alexander Wiebel
Alessandro Terenzi Alessandro Terenzi
Alberto Barbati
Zach Deedler Zach Deedler
Yuzhong Shen Yuzhong Shen
Wee See
Warren Macchi Warren Macchi
Vincent Bourdier Vincent Bourdier
Terrex Terrex
@@ -256,11 +258,9 @@ Raymond de Vries
Ralf Kern Ralf Kern
Piotr Gwiazdowski Piotr Gwiazdowski
Pierre Haritchabalet Pierre Haritchabalet
Philippe Renon
Perry Miller Perry Miller
Paul Palumbo Paul Palumbo
Paul Obermeier Paul Obermeier
Patrick Neary
Nguyen Van Truong Nguyen Van Truong
Nathan Cournia Nathan Cournia
Morten Haukness Morten Haukness
@@ -268,7 +268,6 @@ Morn
Michael Mc Donnell Michael Mc Donnell
Michael Henheffer Michael Henheffer
Michael Guerrero Michael Guerrero
Maya Leonard
Max Bandazian Max Bandazian
Mathias Fiedler Mathias Fiedler
Mathew May Mathew May
@@ -302,7 +301,6 @@ Giampaolo Vigan
Gerrick Bivins Gerrick Bivins
George Tarantilis George Tarantilis
Ferdi Smit Ferdi Smit
Eric Buehler
Eduardo Poyart Eduardo Poyart
Edgar Ellis Edgar Ellis
Dmitry Marakasov Dmitry Marakasov
@@ -318,6 +316,7 @@ Christian Kehl
Bradley Baker Searles Bradley Baker Searles
Brad Anderegg Brad Anderegg
Aric Aumann Aric Aumann
Anish Thomas
Andrew Sampson Andrew Sampson
Andrew Lorino Andrew Lorino
Alexandre Amalric Alexandre Amalric
@@ -340,6 +339,8 @@ Valeriy Dubov
Vaclav Bilek Vaclav Bilek
Tyge L<>vset Tyge L<>vset
Troy Yee Troy Yee
Torben Dannahauer
Tony Vasile
Tomas Hogarth Tomas Hogarth
Tomas Hnilica Tomas Hnilica
Todd Furlong Todd Furlong
@@ -362,6 +363,7 @@ Shane Arnott
Sergey Kurdakov Sergey Kurdakov
Sebastien Kuntz Sebastien Kuntz
Ruth Lang Ruth Lang
Ruben The
Ruben Smelik Ruben Smelik
Ross Anderson Ross Anderson
Ronny Krueger Ronny Krueger
@@ -403,12 +405,14 @@ Oren Fromberg
Oliver Neumann Oliver Neumann
Ole-Morten Duesund Ole-Morten Duesund
Nicolas Brodu Nicolas Brodu
Nick Thu
Nick Black Nick Black
Mojtaba Fathi Mojtaba Fathi
Mirko Viviani Mirko Viviani
Mikkel Gj<47>l Mikkel Gj<47>l
Mike Krus Mike Krus
Mike Garrity Mike Garrity
Mick Thu
Michal Durkovic Michal Durkovic
Michael Schanne Michael Schanne
Michael Polak Michael Polak
@@ -416,6 +420,8 @@ Michael Morrison
Michael Logan Michael Logan
Michael Kapelko Michael Kapelko
Michael Bach Jensen Michael Bach Jensen
Maya Thu
Maya Leonard
Max Rhiener Max Rhiener
Max Behensky Max Behensky
Mauricio Hofmam Mauricio Hofmam
@@ -432,9 +438,9 @@ Martin Beck
Marius Kintel Marius Kintel
Mario Guimaraes Mario Guimaraes
Marcus Hein Marcus Hein
Marco Thu
Marco Sciabica Marco Sciabica
Marco Lehmann Marco Lehmann
Maik Keller
Lukas Diduch Lukas Diduch
Louis Hamilton Louis Hamilton
Likasz Izebski Likasz Izebski
@@ -456,11 +462,14 @@ Juan Hernando
Josh Portway Josh Portway
Jonathan Greig Jonathan Greig
John Tan John Tan
John Hedström
John Grant John Grant
John Farrier
John Donovan John Donovan
John Davis John Davis
John Cummings John Cummings
John Argentieri John Argentieri
Joe Thompson
Joan Abadie Joan Abadie
Jim Brooks Jim Brooks
Jeroen den Dekker Jeroen den Dekker
@@ -479,8 +488,10 @@ Hartmut Seichter
Gunter Huber Gunter Huber
Gregory Jaegy Gregory Jaegy
Graeme Harkness Graeme Harkness
Github It
Gian Lorenzetto Gian Lorenzetto
George Papagiannakis George Papagiannakis
Geoff Thu
Galen Faidley Galen Faidley
Frida Schlaug Frida Schlaug
Frederic Smith Frederic Smith
@@ -495,6 +506,8 @@ Ferdinand Cornelissen
Fajran Iman Fajran Iman
Fabien Dachicourt Fabien Dachicourt
Erik Johnson Erik Johnson
Eric Thu
Eric Buehler
Eduardo Alberto Eduardo Alberto
Edmond Gheury Edmond Gheury
Ed Ralston Ed Ralston
@@ -526,8 +539,8 @@ Carlos Garcea
Bryce Eldridge Bryce Eldridge
Bruno Herbelin Bruno Herbelin
Brian Keener Brian Keener
Brede Thu
Brandon Hamm Brandon Hamm
Bora Utka
Bill Prendergast Bill Prendergast
Bernardt Duvenhage Bernardt Duvenhage
Benoit Laniel Benoit Laniel
@@ -537,7 +550,6 @@ Bart Gallet
Axel Volley Axel Volley
Arjun Ramamurthy Arjun Ramamurthy
Anthousis Andreadis Anthousis Andreadis
Anish Thomas
Andy Preece Andy Preece
Andrew Reyonolds Andrew Reyonolds
Andreas Roth Andreas Roth

View File

@@ -53,11 +53,11 @@ PROJECT(OpenSceneGraph)
SET(OPENSCENEGRAPH_MAJOR_VERSION 3) SET(OPENSCENEGRAPH_MAJOR_VERSION 3)
SET(OPENSCENEGRAPH_MINOR_VERSION 4) SET(OPENSCENEGRAPH_MINOR_VERSION 4)
SET(OPENSCENEGRAPH_PATCH_VERSION 0) SET(OPENSCENEGRAPH_PATCH_VERSION 1)
SET(OPENSCENEGRAPH_SOVERSION 130) SET(OPENSCENEGRAPH_SOVERSION 131)
# set to 0 when not a release candidate, non zero means that any generated # set to 0 when not a release candidate, non zero means that any generated
# svn tags will be treated as release candidates of given number # git tags will be treated as release candidates of given number
SET(OPENSCENEGRAPH_RELEASE_CANDIDATE 0) SET(OPENSCENEGRAPH_RELEASE_CANDIDATE 0)
SET(OPENSCENEGRAPH_VERSION ${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION}) SET(OPENSCENEGRAPH_VERSION ${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION})
@@ -114,27 +114,15 @@ IF(CMAKE_SYSTEM MATCHES IRIX)
SET(CMAKE_THREAD_LIBS_INIT "" CACHE INTERNAL "") SET(CMAKE_THREAD_LIBS_INIT "" CACHE INTERNAL "")
ENDIF() ENDIF()
OPTION(OSG_MAINTAINER "Enable OpenSceneGraph maintainer build methods, such as making svn branches, tags, updating ChangeLog." OFF) OPTION(OSG_MAINTAINER "Enable OpenSceneGraph maintainer build methods, such as making git branches, tags, updating ChangeLog." OFF)
IF (OSG_MAINTAINER) IF (OSG_MAINTAINER)
#SET(OPENSCENEGRAPH_SVN "trunk")
SET(OPENSCENEGRAPH_SVN "branches")
SET(OPENSCENEGRAPH_BRANCH OpenSceneGraph-${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}) SET(OPENSCENEGRAPH_BRANCH OpenSceneGraph-${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION})
# #
# Provide target for tagging a release # Provide target for tagging a release
# #
SET(SVNCOMMAND svn) SET(GITCOMMAND git)
SET(SVNTRUNKDIR http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk)
SET(SVNTAGDIR http://svn.openscenegraph.org/osg/OpenSceneGraph/tags)
SET(SVNBRANCHDIR http://svn.openscenegraph.org/osg/OpenSceneGraph/branches)
IF (OPENSCENEGRAPH_SVN STREQUAL "trunk")
SET(SVNSOURCEDIR ${SVNTRUNKDIR})
ELSE()
SET(SVNSOURCEDIR ${SVNBRANCHDIR}/${OPENSCENEGRAPH_BRANCH})
ENDIF()
IF (OPENSCENEGRAPH_RELEASE_CANDIDATE EQUAL 0) IF (OPENSCENEGRAPH_RELEASE_CANDIDATE EQUAL 0)
SET(RELEASE_NAME OpenSceneGraph-${OPENSCENEGRAPH_VERSION}) SET(RELEASE_NAME OpenSceneGraph-${OPENSCENEGRAPH_VERSION})
@@ -142,31 +130,38 @@ IF (OSG_MAINTAINER)
SET(RELEASE_NAME OpenSceneGraph-${OPENSCENEGRAPH_VERSION}-rc${OPENSCENEGRAPH_RELEASE_CANDIDATE}) SET(RELEASE_NAME OpenSceneGraph-${OPENSCENEGRAPH_VERSION}-rc${OPENSCENEGRAPH_RELEASE_CANDIDATE})
ENDIF() ENDIF()
SET(RELEASE_MESSAGE "Release ${RELEASE_NAME}")
SET(BRANCH_MESSAGE "Branch ${OPENSCENEGRAPH_BRANCH}")
ADD_CUSTOM_TARGET(tag-test ADD_CUSTOM_TARGET(tag-test
COMMAND echo ${SVNCOMMAND} copy ${SVNSOURCEDIR} ${SVNTAGDIR}/${RELEASE_NAME} -m "Release ${RELEASE_NAME}" COMMAND echo ${GITCOMMAND} tag -a ${RELEASE_NAME} -m ${RELEASE_MESSAGE}
COMMAND echo ${GITCOMMAND} push origin ${RELEASE_NAME}
) )
ADD_CUSTOM_TARGET(tag-run ADD_CUSTOM_TARGET(tag-run
COMMAND ${SVNCOMMAND} copy ${SVNSOURCEDIR} ${SVNTAGDIR}/${RELEASE_NAME} -m "Release ${RELEASE_NAME}" COMMAND ${GITCOMMAND} tag -a ${RELEASE_NAME} -m ${RELEASE_MESSAGE}
COMMAND ${GITCOMMAND} push origin ${RELEASE_NAME}
) )
ADD_CUSTOM_TARGET(branch-test ADD_CUSTOM_TARGET(branch-test
COMMAND echo ${SVNCOMMAND} copy ${SVNSOURCEDIR} ${SVNBRANCHDIR}/${OPENSCENEGRAPH_BRANCH} -m "Branch ${OPENSCENEGRAPH_BRANCH}" COMMAND echo ${GITCOMMAND} branch ${OPENSCENEGRAPH_BRANCH} -m ${BRANCH_MESSAGE}
COMMAND echo ${GITCOMMAND} push origin ${OPENSCENEGRAPH_BRANCH}
) )
ADD_CUSTOM_TARGET(branch-run ADD_CUSTOM_TARGET(branch-run
COMMAND ${SVNCOMMAND} copy ${SVNSOURCEDIR} ${SVNBRANCHDIR}/${OPENSCENEGRAPH_BRANCH} -m "Branch ${OPENSCENEGRAPH_BRANCH}" COMMAND ${GITCOMMAND} branch ${OPENSCENEGRAPH_BRANCH} -m ${BRANCH_MESSAGE}
COMMAND ${GITCOMMAND} push origin ${OPENSCENEGRAPH_BRANCH}
) )
# #
# Provide target for generating ChangeLog # Provide target for generating ChangeLog
# #
SET(GENERATELOGS svn2cl) SET(GITLOGFORMAT "%aD%nChecked in by : %an%n%s%b%n")
SET(GENERATELOGS git log --pretty=format:${GITLOGFORMAT})
ADD_CUSTOM_TARGET(ChangeLog ADD_CUSTOM_TARGET(ChangeLog
COMMAND ${SVNCOMMAND} update COMMAND ${GENERATELOGS} > ChangeLog
COMMAND ${GENERATELOGS} ${SVNSOURCEDIR}
) )
ENDIF(OSG_MAINTAINER) ENDIF(OSG_MAINTAINER)
@@ -398,6 +393,7 @@ ENDIF()
OPTION(OSG_DISABLE_MSVC_WARNINGS "Set to OFF to not disable MSVC warnings generated by OSG headers." ON) OPTION(OSG_DISABLE_MSVC_WARNINGS "Set to OFF to not disable MSVC warnings generated by OSG headers." ON)
MARK_AS_ADVANCED(OSG_DISABLE_MSVC_WARNINGS) MARK_AS_ADVANCED(OSG_DISABLE_MSVC_WARNINGS)
OPTION(OSG_PROVIDE_READFILE "Set to ON for include/osgDB/ReadFile to provide the osgDB::read*File(() methods. " ON)
OPTION(OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION "Set to ON to use the ref_ptr<> T* operator() output conversion. " ON) OPTION(OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION "Set to ON to use the ref_ptr<> T* operator() output conversion. " ON)
@@ -519,39 +515,39 @@ ELSE()
ENDIF() ENDIF()
IF (OSG_GL1_AVAILABLE) IF (OSG_GL1_AVAILABLE)
SET(OSG_GL1_FEATURES "true") SET(OSG_GL1_FEATURES 1)
ELSE() ELSE()
SET(OSG_GL1_FEATURES "false") SET(OSG_GL1_FEATURES 0)
ENDIF() ENDIF()
IF (OSG_GL2_AVAILABLE) IF (OSG_GL2_AVAILABLE)
SET(OSG_GL2_FEATURES "true") SET(OSG_GL2_FEATURES 1)
ELSE() ELSE()
SET(OSG_GL2_FEATURES "false") SET(OSG_GL2_FEATURES 0)
ENDIF() ENDIF()
IF (OSG_GL3_AVAILABLE) IF (OSG_GL3_AVAILABLE)
SET(OSG_GL3_FEATURES "true") SET(OSG_GL3_FEATURES 1)
ELSE() ELSE()
SET(OSG_GL3_FEATURES "false") SET(OSG_GL3_FEATURES 0)
ENDIF() ENDIF()
IF (OSG_GLES1_AVAILABLE) IF (OSG_GLES1_AVAILABLE)
SET(OSG_GLES1_FEATURES "true") SET(OSG_GLES1_FEATURES 1)
ELSE() ELSE()
SET(OSG_GLES1_FEATURES "false") SET(OSG_GLES1_FEATURES 0)
ENDIF() ENDIF()
IF (OSG_GLES2_AVAILABLE) IF (OSG_GLES2_AVAILABLE)
SET(OSG_GLES2_FEATURES "true") SET(OSG_GLES2_FEATURES 1)
ELSE() ELSE()
SET(OSG_GLES2_FEATURES "false") SET(OSG_GLES2_FEATURES 0)
ENDIF() ENDIF()
IF (OSG_GLES3_AVAILABLE) IF (OSG_GLES3_AVAILABLE)
SET(OSG_GLES3_FEATURES "true") SET(OSG_GLES3_FEATURES 1)
ELSE() ELSE()
SET(OSG_GLES3_FEATURES "false") SET(OSG_GLES3_FEATURES 0)
ENDIF() ENDIF()
IF(ANDROID) IF(ANDROID)

View File

@@ -49,7 +49,13 @@ MACRO(FIND_DEPENDENCY DEPNAME INCLUDEFILE LIBRARY_NAMES_BASE SEARCHPATHLIST DEBU
MESSAGE("-- Warning Debug ${DEPNAME} not found, using: ${${DEPNAME}_LIBRARY}") MESSAGE("-- Warning Debug ${DEPNAME} not found, using: ${${DEPNAME}_LIBRARY}")
SET(${DEPNAME}_LIBRARY_DEBUG "${${DEPNAME}_LIBRARY}") SET(${DEPNAME}_LIBRARY_DEBUG "${${DEPNAME}_LIBRARY}")
ENDIF(NOT ${DEPNAME}_LIBRARY_DEBUG) ENDIF(NOT ${DEPNAME}_LIBRARY_DEBUG)
SET(${DEPNAME}_LIBRARIES debug ${${DEPNAME}_LIBRARY_DEBUG} optimized ${${DEPNAME}_LIBRARY} )
ENDIF(${DEPNAME}_INCLUDE_DIR AND ${DEPNAME}_LIBRARY) ENDIF(${DEPNAME}_INCLUDE_DIR AND ${DEPNAME}_LIBRARY)
ENDMACRO(FIND_DEPENDENCY DEPNAME INCLUDEFILE LIBRARY_NAMES_BASE SEARCHPATHLIST DEBUGSUFFIX) ENDMACRO(FIND_DEPENDENCY DEPNAME INCLUDEFILE LIBRARY_NAMES_BASE SEARCHPATHLIST DEBUGSUFFIX)
@@ -58,8 +64,8 @@ ENDMACRO(FIND_DEPENDENCY DEPNAME INCLUDEFILE LIBRARY_NAMES_BASE SEARCHPATHLIST D
################################################################################################ ################################################################################################
MACRO(SEARCH_3RDPARTY OSG_3RDPARTY_BIN) MACRO(SEARCH_3RDPARTY OSG_3RDPARTY_BIN)
FIND_DEPENDENCY(TIFF tiff.h libtiff ${OSG_3RDPARTY_BIN} "D" "_i") FIND_DEPENDENCY(TIFF tiff.h "libtiff;tiff" ${OSG_3RDPARTY_BIN} "D" "")
FIND_DEPENDENCY(FREETYPE ft2build.h "freetype;freetype2311MT;freetype234;freetype234MT;freetype235;freetype237;freetype238;freetype244;freetype250;" ${OSG_3RDPARTY_BIN} "d" "") FIND_DEPENDENCY(FREETYPE ft2build.h "freetype;freetype2311MT;freetype234;freetype234MT;freetype235;freetype237;freetype238;freetype244;freetype250;freetype27;" ${OSG_3RDPARTY_BIN} "d" "")
IF(FREETYPE_FOUND) IF(FREETYPE_FOUND)
#forcing subsequent FindFreeType stuff to not search for other variables.... kind of a hack #forcing subsequent FindFreeType stuff to not search for other variables.... kind of a hack
SET(FREETYPE_INCLUDE_DIR_ft2build ${FREETYPE_INCLUDE_DIR} CACHE PATH "" FORCE) SET(FREETYPE_INCLUDE_DIR_ft2build ${FREETYPE_INCLUDE_DIR} CACHE PATH "" FORCE)
@@ -67,7 +73,7 @@ MACRO(SEARCH_3RDPARTY OSG_3RDPARTY_BIN)
MARK_AS_ADVANCED(FREETYPE_INCLUDE_DIR_ft2build FREETYPE_INCLUDE_DIR_freetype2) MARK_AS_ADVANCED(FREETYPE_INCLUDE_DIR_ft2build FREETYPE_INCLUDE_DIR_freetype2)
SET(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR_ft2build};${FREETYPE_INCLUDE_DIR_freetype2}") SET(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR_ft2build};${FREETYPE_INCLUDE_DIR_freetype2}")
ENDIF(FREETYPE_FOUND) ENDIF(FREETYPE_FOUND)
FIND_DEPENDENCY(CURL curl/curl.h "libcurl;curllib" ${OSG_3RDPARTY_BIN} "D" "") FIND_DEPENDENCY(CURL curl/curl.h "libcurl;curllib;libcurl_imp" ${OSG_3RDPARTY_BIN} "D" "")
FIND_DEPENDENCY(JPEG jpeglib.h "libjpeg;jpeg" ${OSG_3RDPARTY_BIN} "D" "") FIND_DEPENDENCY(JPEG jpeglib.h "libjpeg;jpeg" ${OSG_3RDPARTY_BIN} "D" "")
FIND_DEPENDENCY(GDAL gdal.h "gdal;gdal16" ${OSG_3RDPARTY_BIN} "d" "_i") FIND_DEPENDENCY(GDAL gdal.h "gdal;gdal16" ${OSG_3RDPARTY_BIN} "d" "_i")
FIND_DEPENDENCY(GLUT GL/glut.h glut32 ${OSG_3RDPARTY_BIN} "D" "") FIND_DEPENDENCY(GLUT GL/glut.h glut32 ${OSG_3RDPARTY_BIN} "D" "")
@@ -86,11 +92,13 @@ MACRO(SEARCH_3RDPARTY OSG_3RDPARTY_BIN)
MARK_AS_ADVANCED(PNG_PNG_INCLUDE_DIR) MARK_AS_ADVANCED(PNG_PNG_INCLUDE_DIR)
ENDIF(PNG_FOUND) ENDIF(PNG_FOUND)
ENDIF(ZLIB_FOUND) ENDIF(ZLIB_FOUND)
FIND_DEPENDENCY(LIBXML2 libxml2 "libxml2" ${OSG_3RDPARTY_BIN} "D" "")
# CMakes default module to find libxml2 will not find the in
FIND_DEPENDENCY(LIBXML2 libxml/xpath.h "libxml2" ${OSG_3RDPARTY_BIN} "D" "")
IF(LIBXML2_FOUND) IF(LIBXML2_FOUND)
# The CMAKE find libxml module uses LIBXML2_LIBRARIES -> fill it.... kind of a hack # The CMAKE find libxml module uses LIBXML2_LIBRARIES -> fill it.... kind of a hack
SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARY} CACHE FILEPATH "" FORCE) SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARY} CACHE FILEPATH "LibXML2 library for collada" FORCE)
SET(LIBXML2_XMLLINT_EXECUTABLE ${OSG_3RDPARTY_BIN}/bin/xmllint.exe CACHE FILEPATH "Path to xmllint executable" FORCE) # SET(LIBXML2_XMLLINT_EXECUTABLE ${OSG_3RDPARTY_BIN}/bin/xmllint.exe CACHE FILEPATH "Path to xmllint executable" FORCE)
ENDIF(LIBXML2_FOUND) ENDIF(LIBXML2_FOUND)
#FIND_DEPENDENCY(DEPNAME INCLUDEFILE LIBRARY_NAMES_BASE SEARCHPATHLIST DEBUGSUFFIX EXSUFFIX) #FIND_DEPENDENCY(DEPNAME INCLUDEFILE LIBRARY_NAMES_BASE SEARCHPATHLIST DEBUGSUFFIX EXSUFFIX)
FIND_Package(NVTT) FIND_Package(NVTT)
@@ -104,7 +112,7 @@ ENDMACRO(SEARCH_3RDPARTY OSG_3RDPARTY_BIN)
# this is code for handling optional 3RDPARTY usage # this is code for handling optional 3RDPARTY usage
################################################################################################ ################################################################################################
OPTION(USE_3RDPARTY_BIN "Set to ON to use Mike prebuilt dependencies situated side of OpenSceneGraph source. Use OFF for avoiding." ON) OPTION(USE_3RDPARTY_BIN "Set to ON to use Mike or Torbens prebuilt dependencies situated side of OpenSceneGraph source. Use OFF for avoiding." ON)
IF(USE_3RDPARTY_BIN) IF(USE_3RDPARTY_BIN)
# Check Architecture # Check Architecture

View File

@@ -30,7 +30,7 @@ ELSE()
# AVFoundation exists since 10.7, but only 10.8 has all features necessary for OSG # AVFoundation exists since 10.7, but only 10.8 has all features necessary for OSG
# so check the SDK-setting # so check the SDK-setting
IF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.8" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.9" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.10") IF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.8" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.9" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.10" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.11")
# nothing special here ;-) # nothing special here ;-)
ELSE() ELSE()
MESSAGE("AVFoundation disabled for SDK < 10.8") MESSAGE("AVFoundation disabled for SDK < 10.8")

View File

@@ -28,6 +28,8 @@ IF(APPLE)
SET(COLLADA_BUILDNAME "mac") SET(COLLADA_BUILDNAME "mac")
ELSEIF(MINGW) ELSEIF(MINGW)
SET(COLLADA_BUILDNAME "mingw") SET(COLLADA_BUILDNAME "mingw")
ELSEIF(MSVC14)
SET(COLLADA_BUILDNAME "vc14")
ELSEIF(MSVC12) ELSEIF(MSVC12)
SET(COLLADA_BUILDNAME "vc12") SET(COLLADA_BUILDNAME "vc12")
ELSEIF(MSVC11) ELSEIF(MSVC11)
@@ -53,10 +55,16 @@ FIND_PATH(COLLADA_INCLUDE_DIR dae.h
/usr/local/include /usr/local/include
/usr/local/include/colladadom /usr/local/include/colladadom
/usr/local/include/collada-dom /usr/local/include/collada-dom
/usr/local/include/collada-dom2.4
/usr/local/include/collada-dom2.2
/opt/local/include/collada-dom /opt/local/include/collada-dom
/opt/local/include/collada-dom2.4
/opt/local/include/collada-dom2.2
/usr/include/ /usr/include/
/usr/include/colladadom /usr/include/colladadom
/usr/include/collada-dom /usr/include/collada-dom
/usr/include/collada-dom2.4
/usr/include/collada-dom2.2
/sw/include # Fink /sw/include # Fink
/opt/local/include # DarwinPorts /opt/local/include # DarwinPorts
/opt/csw/include # Blastwave /opt/csw/include # Blastwave
@@ -66,7 +74,7 @@ FIND_PATH(COLLADA_INCLUDE_DIR dae.h
) )
FIND_LIBRARY(COLLADA_DYNAMIC_LIBRARY FIND_LIBRARY(COLLADA_DYNAMIC_LIBRARY
NAMES collada_dom collada14dom Collada14Dom libcollada14dom21 libcollada14dom22 collada-dom2.4-dp NAMES collada_dom collada14dom Collada14Dom libcollada14dom21 libcollada14dom22 collada-dom2.4-dp collada-dom2.4-dp-vc120-mt
PATHS PATHS
${COLLADA_DOM_ROOT}/build/${COLLADA_BUILDNAME}-1.4 ${COLLADA_DOM_ROOT}/build/${COLLADA_BUILDNAME}-1.4
${COLLADA_DOM_ROOT} ${COLLADA_DOM_ROOT}
@@ -90,7 +98,7 @@ FIND_LIBRARY(COLLADA_DYNAMIC_LIBRARY
) )
FIND_LIBRARY(COLLADA_DYNAMIC_LIBRARY_DEBUG FIND_LIBRARY(COLLADA_DYNAMIC_LIBRARY_DEBUG
NAMES collada_dom-d collada14dom-d Collada14Dom-d libcollada14dom21-d libcollada14dom22-d collada-dom2.4-dp-d NAMES collada_dom-d collada14dom-d Collada14Dom-d libcollada14dom21-d libcollada14dom22-d collada-dom2.4-dp-d collada-dom2.4-dp-vc120-mt-d
PATHS PATHS
${COLLADA_DOM_ROOT}/build/${COLLADA_BUILDNAME}-1.4-d ${COLLADA_DOM_ROOT}/build/${COLLADA_BUILDNAME}-1.4-d
${COLLADA_DOM_ROOT} ${COLLADA_DOM_ROOT}
@@ -178,7 +186,16 @@ FIND_LIBRARY(COLLADA_STATIC_LIBRARY_DEBUG
FIND_PACKAGE(ZLIB) FIND_PACKAGE(ZLIB)
IF (ZLIB_FOUND) IF (ZLIB_FOUND)
SET(COLLADA_ZLIB_LIBRARY "${ZLIB_LIBRARY}" CACHE FILEPATH "" FORCE) IF (ZLIB_LIBRARY_RELEASE)
SET(COLLADA_ZLIB_LIBRARY "${ZLIB_LIBRARY_RELEASE}" CACHE FILEPATH "" FORCE)
ELSE(ZLIB_LIBRARY_RELEASE)
SET(COLLADA_ZLIB_LIBRARY "${ZLIB_LIBRARY}" CACHE FILEPATH "" FORCE)
ENDIF(ZLIB_LIBRARY_RELEASE)
IF (ZLIB_LIBRARY_DEBUG)
SET(COLLADA_ZLIB_LIBRARY_DEBUG "${ZLIB_LIBRARY_DEBUG}" CACHE FILEPATH "" FORCE)
ELSE(ZLIB_LIBRARY_DEBUG)
SET(COLLADA_ZLIB_LIBRARY_DEBUG "${COLLADA_ZLIB_LIBRARY}" CACHE FILEPATH "" FORCE)
ENDIF(ZLIB_LIBRARY_DEBUG)
ELSE(ZLIB_FOUND) ELSE(ZLIB_FOUND)
IF(WIN32) IF(WIN32)
FIND_LIBRARY(COLLADA_ZLIB_LIBRARY FIND_LIBRARY(COLLADA_ZLIB_LIBRARY
@@ -244,7 +261,7 @@ FIND_LIBRARY(COLLADA_STATIC_LIBRARY_DEBUG
) )
FIND_LIBRARY(COLLADA_BOOST_FILESYSTEM_LIBRARY FIND_LIBRARY(COLLADA_BOOST_FILESYSTEM_LIBRARY
NAMES libboost_filesystem boost_filesystem boost_filesystem-mt libboost_filesystem-${COLLADA_BUILDNAME}0-mt libboost_filesystem-${COLLADA_BUILDNAME}0-mt-1_54 libboost_filesystem-${COLLADA_BUILDNAME}0-mt-1_55 NAMES libboost_filesystem boost_filesystem boost_filesystem-mt libboost_filesystem-${COLLADA_BUILDNAME}0-mt libboost_filesystem-${COLLADA_BUILDNAME}0-mt-1_54 libboost_filesystem-${COLLADA_BUILDNAME}0-mt-1_55 libboost_filesystem-${COLLADA_BUILDNAME}0-mt-1_58 boost_filesystem-${COLLADA_BUILDNAME}0-mt-1_62
PATHS PATHS
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME} ${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw ${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
@@ -252,7 +269,7 @@ FIND_LIBRARY(COLLADA_STATIC_LIBRARY_DEBUG
) )
FIND_LIBRARY(COLLADA_BOOST_FILESYSTEM_LIBRARY_DEBUG FIND_LIBRARY(COLLADA_BOOST_FILESYSTEM_LIBRARY_DEBUG
NAMES libboost_filesystem-d boost_filesystem-d boost_filesystem-mt-d libboost_filesystem-${COLLADA_BUILDNAME}0-mt-gd libboost_filesystem-${COLLADA_BUILDNAME}0-mt-gd-1_54 libboost_filesystem-${COLLADA_BUILDNAME}0-mt-gd-1_55 NAMES libboost_filesystem-d boost_filesystem-d boost_filesystem-mt-d libboost_filesystem-${COLLADA_BUILDNAME}0-mt-gd libboost_filesystem-${COLLADA_BUILDNAME}0-mt-gd-1_54 libboost_filesystem-${COLLADA_BUILDNAME}0-mt-gd-1_55 libboost_filesystem-${COLLADA_BUILDNAME}0-mt-gd-1_58 boost_filesystem-${COLLADA_BUILDNAME}0-mt-gd-1_62
PATHS PATHS
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME} ${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw ${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
@@ -260,7 +277,7 @@ FIND_LIBRARY(COLLADA_STATIC_LIBRARY_DEBUG
) )
FIND_LIBRARY(COLLADA_BOOST_SYSTEM_LIBRARY FIND_LIBRARY(COLLADA_BOOST_SYSTEM_LIBRARY
NAMES libboost_system boost_system boost_system-mt libboost_system-${COLLADA_BUILDNAME}0-mt libboost_system-${COLLADA_BUILDNAME}0-mt-1_54 libboost_system-${COLLADA_BUILDNAME}0-mt-1_55 NAMES libboost_system boost_system boost_system-mt libboost_system-${COLLADA_BUILDNAME}0-mt libboost_system-${COLLADA_BUILDNAME}0-mt-1_54 libboost_system-${COLLADA_BUILDNAME}0-mt-1_55 libboost_system-${COLLADA_BUILDNAME}0-mt-1_58 boost_system-${COLLADA_BUILDNAME}0-mt-1_62
PATHS PATHS
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME} ${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw ${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
@@ -268,7 +285,7 @@ FIND_LIBRARY(COLLADA_STATIC_LIBRARY_DEBUG
) )
FIND_LIBRARY(COLLADA_BOOST_SYSTEM_LIBRARY_DEBUG FIND_LIBRARY(COLLADA_BOOST_SYSTEM_LIBRARY_DEBUG
NAMES libboost_system-d boost_system-d boost_system-mt-d libboost_system-${COLLADA_BUILDNAME}0-mt-gd libboost_system-${COLLADA_BUILDNAME}0-mt-gd-1_54 libboost_system-${COLLADA_BUILDNAME}0-mt-gd-1_55 NAMES libboost_system-d boost_system-d boost_system-mt-d libboost_system-${COLLADA_BUILDNAME}0-mt-gd libboost_system-${COLLADA_BUILDNAME}0-mt-gd-1_54 libboost_system-${COLLADA_BUILDNAME}0-mt-gd-1_55 libboost_system-${COLLADA_BUILDNAME}0-mt-gd-1_58 boost_system-${COLLADA_BUILDNAME}0-mt-gd-1_62
PATHS PATHS
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME} ${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw ${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw

View File

@@ -50,13 +50,13 @@ SET( FBX_SEARCH_PATHS
$ENV{FBX_DIR} $ENV{FBX_DIR}
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2015.1" "$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2015.1"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2015.1" "$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2015.1"
"/Applications/Autodesk/FBX/FBX SDK/2015.1"
/Applications/Autodesk/FBXSDK20151 /Applications/Autodesk/FBXSDK20151
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2014.2" "$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2014.2"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2014.2" "$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2014.2"
"/Applications/Autodesk/FBX/FBX SDK/2014.2"
/Applications/Autodesk/FBXSDK20142 /Applications/Autodesk/FBXSDK20142
/Applications/Autodesk/FBXSDK20141
) )
#I think the last line in the search path is an old typo, but let's search for 2014.1 anyway - LV
# search for headers & debug/release libraries # search for headers & debug/release libraries
FIND_PATH(FBX_INCLUDE_DIR "fbxsdk.h" FIND_PATH(FBX_INCLUDE_DIR "fbxsdk.h"
@@ -96,8 +96,9 @@ IF(NOT FBX_FOUND)
SET( FBX_SEARCH_PATHS SET( FBX_SEARCH_PATHS
$ENV{FBX_DIR} $ENV{FBX_DIR}
$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2014.1 "$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2014.1"
$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2014.1 "$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2014.1"
"/Applications/Autodesk/FBX/FBX SDK/2014.1"
/Applications/Autodesk/FBXSDK20141 /Applications/Autodesk/FBXSDK20141
) )
@@ -134,8 +135,9 @@ IF(NOT FBX_FOUND)
SET( FBX_SEARCH_PATHS SET( FBX_SEARCH_PATHS
$ENV{FBX_DIR} $ENV{FBX_DIR}
$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2013.3 "$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2013.3"
$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2013.3 "$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2013.3"
"/Applications/Autodesk/FBX/FBX SDK/2013.3"
/Applications/Autodesk/FBXSDK20133 /Applications/Autodesk/FBXSDK20133
) )

View File

@@ -1,25 +1,64 @@
# - Locate FreeType library #.rst:
# This module defines # FindFreetype
# FREETYPE_LIBRARY, the library to link against # ------------
# FREETYPE_FOUND, if false, do not try to link to FREETYPE
# FREETYPE_INCLUDE_DIRS, where to find headers.
# This is the concatenation of the paths:
# FREETYPE_INCLUDE_DIR_ft2build
# FREETYPE_INCLUDE_DIR_freetype2
# #
# $FREETYPE_DIR is an environment variable that would # Locate FreeType library
# correspond to the ./configure --prefix=$FREETYPE_DIR #
# used in building FREETYPE. # This module defines
#
# ::
#
# FREETYPE_LIBRARIES, the library to link against
# FREETYPE_FOUND, if false, do not try to link to FREETYPE
# FREETYPE_INCLUDE_DIRS, where to find headers.
# FREETYPE_VERSION_STRING, the version of freetype found (since CMake 2.8.8)
# This is the concatenation of the paths:
# FREETYPE_INCLUDE_DIR_ft2build
# FREETYPE_INCLUDE_DIR_freetype2
#
#
#
# $FREETYPE_DIR is an environment variable that would correspond to the
# ./configure --prefix=$FREETYPE_DIR used in building FREETYPE.
#=============================================================================
# Copyright 2000-2016 Kitware, Inc.
# Copyright 2000-2011 Insight Software Consortium
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# * Neither the names of Kitware, Inc., the Insight Software Consortium,
# nor the names of their contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#=============================================================================
# Created by Eric Wing. # Created by Eric Wing.
# Modifications by Alexander Neundorf.
# prefer FindFreetype from cmake distribution # This file has been renamed to "FindFreetype.cmake" instead of the correct
if(EXISTS ${CMAKE_ROOT}/Modules/FindFreetype.cmake) # "FindFreeType.cmake" in order to be compatible with the one from KDE4, Alex.
include(${CMAKE_ROOT}/Modules/FindFreetype.cmake)
if(FREETYPE_FOUND)
return()
endif()
endif()
# Ugh, FreeType seems to use some #include trickery which # Ugh, FreeType seems to use some #include trickery which
# makes this harder than it should be. It looks like they # makes this harder than it should be. It looks like they
@@ -29,113 +68,121 @@ endif()
# Then from there, they need to set a bunch of #define's # Then from there, they need to set a bunch of #define's
# so you can do something like: # so you can do something like:
# #include FT_FREETYPE_H # #include FT_FREETYPE_H
# Unfortunately, using CMake's mechanisms like INCLUDE_DIRECTORIES() # Unfortunately, using CMake's mechanisms like include_directories()
# wants explicit full paths and this trickery doesn't work too well. # wants explicit full paths and this trickery doesn't work too well.
# I'm going to attempt to cut out the middleman and hope # I'm going to attempt to cut out the middleman and hope
# everything still works. # everything still works.
FIND_PATH(FREETYPE_INCLUDE_DIR_ft2build ft2build.h # Adapted for OpenSceneGraph until the updates here for finding the debug Windows library freetyped are released with CMake
set(FREETYPE_FIND_ARGS
HINTS
ENV FREETYPE_DIR
PATHS PATHS
$ENV{FREETYPE_DIR} /usr/X11R6
NO_DEFAULT_PATH /usr/local/X11R6
PATH_SUFFIXES include /usr/local/X11
) /usr/freeware
FIND_PATH(FREETYPE_INCLUDE_DIR_ft2build ft2build.h ENV GTKMM_BASEPATH
PATHS ${CMAKE_PREFIX_PATH} # Unofficial: We are proposing this. [HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path]
NO_DEFAULT_PATH [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path]
PATH_SUFFIXES include
)
FIND_PATH(FREETYPE_INCLUDE_DIR_ft2build ft2build.h
PATHS
/usr/local
/usr
/usr/local/X11R6
/usr/local/X11
/usr/X11R6
/usr/X11
/sw
/opt/local
/opt/csw
/opt
/usr/freeware
PATH_SUFFIXES include include/freetype2
) )
FIND_PATH(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h find_path(
$ENV{FREETYPE_DIR}/include/freetype2 FREETYPE_INCLUDE_DIR_ft2build
NO_DEFAULT_PATH ft2build.h
) ${FREETYPE_FIND_ARGS}
FIND_PATH(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h PATH_SUFFIXES
PATHS ${CMAKE_PREFIX_PATH} # Unofficial: We are proposing this. include/freetype2
NO_DEFAULT_PATH include
PATH_SUFFIXES include/freetype2 freetype2
)
FIND_PATH(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h
/usr/local/include/freetype2
/usr/include/freetype2
/usr/local/X11R6/include/freetype2
/usr/local/X11/include/freetype2
/usr/X11R6/include/freetype2
/usr/X11/include/freetype2
/sw/include/freetype2
/opt/local/include/freetype2
/opt/csw/include/freetype2
/opt/include/freetype2
/usr/freeware/include/freetype2
) )
FIND_PATH(FREETYPE_INCLUDE_DIR_freetype2 config/ftheader.h find_path(
/usr/local/include/freetype2 FREETYPE_INCLUDE_DIR_freetype2
/usr/include/freetype2 NAMES
/usr/local/X11R6/include/freetype2 freetype/config/ftheader.h
/usr/local/X11/include/freetype2 config/ftheader.h
/usr/X11R6/include/freetype2 ${FREETYPE_FIND_ARGS}
/usr/X11/include/freetype2 PATH_SUFFIXES
/sw/include/freetype2 include/freetype2
/opt/local/include/freetype2 include
/opt/csw/include/freetype2 freetype2
/opt/include/freetype2
/usr/freeware/include/freetype2
) )
FIND_LIBRARY(FREETYPE_LIBRARY if(NOT FREETYPE_LIBRARY)
NAMES freetype libfreetype freetype219 find_library(FREETYPE_LIBRARY_RELEASE
PATHS NAMES
$ENV{FREETYPE_DIR} freetype
NO_DEFAULT_PATH libfreetype
PATH_SUFFIXES lib64 lib freetype219
) ${FREETYPE_FIND_ARGS}
FIND_LIBRARY(FREETYPE_LIBRARY PATH_SUFFIXES
NAMES freetype libfreetype freetype219 lib
PATHS ${CMAKE_PREFIX_PATH} # Unofficial: We are proposing this. )
NO_DEFAULT_PATH find_library(FREETYPE_LIBRARY_DEBUG
PATH_SUFFIXES lib64 lib NAMES
) freetyped
FIND_LIBRARY(FREETYPE_LIBRARY libfreetyped
NAMES freetype libfreetype freetype219 freetype219d
PATHS ${FREETYPE_FIND_ARGS}
/usr/local PATH_SUFFIXES
/usr lib
/usr/local/X11R6 )
/usr/local/X11 include(SelectLibraryConfigurations) #OSG Look in CMake Modules dir
/usr/X11R6 select_library_configurations(FREETYPE)
/usr/X11 endif()
/sw
/opt/local unset(FREETYPE_FIND_ARGS)
/opt/csw
/opt # set the user variables
/usr/freeware if(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2)
PATH_SUFFIXES lib64 lib set(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR_ft2build};${FREETYPE_INCLUDE_DIR_freetype2}")
list(REMOVE_DUPLICATES FREETYPE_INCLUDE_DIRS)
endif()
set(FREETYPE_LIBRARIES "${FREETYPE_LIBRARY}")
if(EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h")
set(FREETYPE_H "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h")
elseif(EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype.h")
set(FREETYPE_H "${FREETYPE_INCLUDE_DIR_freetype2}/freetype.h")
endif()
if(FREETYPE_INCLUDE_DIR_freetype2 AND FREETYPE_H)
file(STRINGS "${FREETYPE_H}" freetype_version_str
REGEX "^#[\t ]*define[\t ]+FREETYPE_(MAJOR|MINOR|PATCH)[\t ]+[0-9]+$")
unset(FREETYPE_VERSION_STRING)
foreach(VPART MAJOR MINOR PATCH)
foreach(VLINE ${freetype_version_str})
if(VLINE MATCHES "^#[\t ]*define[\t ]+FREETYPE_${VPART}[\t ]+([0-9]+)$")
set(FREETYPE_VERSION_PART "${CMAKE_MATCH_1}")
if(FREETYPE_VERSION_STRING)
set(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_STRING}.${FREETYPE_VERSION_PART}")
else()
set(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_PART}")
endif()
unset(FREETYPE_VERSION_PART)
endif()
endforeach()
endforeach()
endif()
# handle the QUIETLY and REQUIRED arguments and set FREETYPE_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs) #OSG Look in CMake Modules dir
find_package_handle_standard_args(
Freetype
REQUIRED_VARS
FREETYPE_LIBRARY
FREETYPE_INCLUDE_DIRS
VERSION_VAR
FREETYPE_VERSION_STRING
) )
IF(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2) mark_as_advanced(
SET(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR_ft2build};${FREETYPE_INCLUDE_DIR_freetype2}") FREETYPE_INCLUDE_DIR_freetype2
ENDIF(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2) FREETYPE_INCLUDE_DIR_ft2build
)
SET(FREETYPE_FOUND "NO")
IF(FREETYPE_LIBRARY AND FREETYPE_INCLUDE_DIRS)
SET(FREETYPE_FOUND "YES")
ENDIF(FREETYPE_LIBRARY AND FREETYPE_INCLUDE_DIRS)

View File

@@ -98,6 +98,85 @@ FIND_LIBRARY(NVCORE_LIBRARY_DEBUG
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
) )
# NVTHREAD
FIND_LIBRARY(NVTHREAD_LIBRARY
NAMES nvthread
PATHS
/usr/local
/usr
$ENV{NVTT_DIR}
${3rdPartyRoot}
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
)
FIND_LIBRARY(NVTHREAD_LIBRARY_DEBUG
NAMES nvthread_d
PATHS
/usr/local
/usr
$ENV{NVTT_DIR}
${3rdPartyRoot}
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
)
# SQUISH
FIND_LIBRARY(NVSQUISH_LIBRARY
NAMES squish
PATHS
/usr/local
/usr
$ENV{NVTT_DIR}
${3rdPartyRoot}
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
)
FIND_LIBRARY(NVSQUISH_LIBRARY_DEBUG
NAMES squish_d
PATHS
/usr/local
/usr
$ENV{NVTT_DIR}
${3rdPartyRoot}
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
)
# BC6H
FIND_LIBRARY(NVBC6H_LIBRARY
NAMES bc6h
PATHS
/usr/local
/usr
$ENV{NVTT_DIR}
${3rdPartyRoot}
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
)
FIND_LIBRARY(NVBC6H_LIBRARY_DEBUG
NAMES bc6h_d
PATHS
/usr/local
/usr
$ENV{NVTT_DIR}
${3rdPartyRoot}
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
)
# BC7
FIND_LIBRARY(NVBC7_LIBRARY
NAMES bc7
PATHS
/usr/local
/usr
$ENV{NVTT_DIR}
${3rdPartyRoot}
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
)
FIND_LIBRARY(NVBC7_LIBRARY_DEBUG
NAMES bc7_d
PATHS
/usr/local
/usr
$ENV{NVTT_DIR}
${3rdPartyRoot}
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
)

View File

@@ -32,6 +32,12 @@ INSTALL(
ARCHIVE DESTINATION ${INSTALL_ARCHIVEDIR} COMPONENT libopenscenegraph-dev ARCHIVE DESTINATION ${INSTALL_ARCHIVEDIR} COMPONENT libopenscenegraph-dev
) )
IF(MSVC AND DYNAMIC_OPENSCENEGRAPH)
GET_TARGET_PROPERTY(PREFIX ${LIB_NAME} PREFIX)
INSTALL(FILES ${OUTPUT_BINDIR}/${PREFIX}${LIB_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph CONFIGURATIONS RelWithDebInfo)
INSTALL(FILES ${OUTPUT_BINDIR}/${PREFIX}${LIB_NAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph CONFIGURATIONS Debug)
ENDIF(MSVC AND DYNAMIC_OPENSCENEGRAPH)
IF(NOT OSG_COMPILE_FRAMEWORKS) IF(NOT OSG_COMPILE_FRAMEWORKS)
INSTALL ( INSTALL (
FILES ${TARGET_H} FILES ${TARGET_H}

View File

@@ -43,7 +43,11 @@ SET(VALID_BUILDER_VERSION OFF)
MACRO(LINK_WITH_VARIABLES TRGTNAME) MACRO(LINK_WITH_VARIABLES TRGTNAME)
FOREACH(varname ${ARGN}) FOREACH(varname ${ARGN})
IF(${varname}_DEBUG) IF(${varname}_DEBUG)
TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${${varname}}" debug "${${varname}_DEBUG}") IF(${varname}_RELEASE)
TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${${varname}_RELEASE}" debug "${${varname}_DEBUG}")
ELSE(${varname}_RELEASE)
TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${${varname}}" debug "${${varname}_DEBUG}")
ENDIF(${varname}_RELEASE)
ELSE(${varname}_DEBUG) ELSE(${varname}_DEBUG)
TARGET_LINK_LIBRARIES(${TRGTNAME} "${${varname}}" ) TARGET_LINK_LIBRARIES(${TRGTNAME} "${${varname}}" )
ENDIF(${varname}_DEBUG) ENDIF(${varname}_DEBUG)
@@ -123,9 +127,9 @@ MACRO(SETUP_LINK_LIBRARIES)
FOREACH(LINKLIB ${TARGET_ADDED_LIBRARIES}) FOREACH(LINKLIB ${TARGET_ADDED_LIBRARIES})
SET(TO_INSERT TRUE) SET(TO_INSERT TRUE)
FOREACH (value ${TARGET_COMMON_LIBRARIES}) FOREACH (value ${TARGET_COMMON_LIBRARIES})
IF (${value} STREQUAL ${LINKLIB}) IF ("${value}" STREQUAL "${LINKLIB}")
SET(TO_INSERT FALSE) SET(TO_INSERT FALSE)
ENDIF (${value} STREQUAL ${LINKLIB}) ENDIF ("${value}" STREQUAL "${LINKLIB}")
ENDFOREACH (value ${TARGET_COMMON_LIBRARIES}) ENDFOREACH (value ${TARGET_COMMON_LIBRARIES})
IF(TO_INSERT) IF(TO_INSERT)
LIST(APPEND TARGET_LIBRARIES ${LINKLIB}) LIST(APPEND TARGET_LIBRARIES ${LINKLIB})
@@ -326,6 +330,10 @@ MACRO(SETUP_PLUGIN PLUGIN_NAME)
RUNTIME DESTINATION bin COMPONENT ${PACKAGE_COMPONENT} RUNTIME DESTINATION bin COMPONENT ${PACKAGE_COMPONENT}
ARCHIVE DESTINATION lib/${OSG_PLUGINS} COMPONENT libopenscenegraph-dev ARCHIVE DESTINATION lib/${OSG_PLUGINS} COMPONENT libopenscenegraph-dev
LIBRARY DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT}) LIBRARY DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT})
IF(MSVC AND DYNAMIC_OPENSCENEGRAPH)
INSTALL(FILES ${OUTPUT_BINDIR}/${OSG_PLUGINS}/${TARGET_TARGETNAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT} CONFIGURATIONS RelWithDebInfo)
INSTALL(FILES ${OUTPUT_BINDIR}/${OSG_PLUGINS}/${TARGET_TARGETNAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT} CONFIGURATIONS Debug)
ENDIF(MSVC AND DYNAMIC_OPENSCENEGRAPH)
ELSE(WIN32) ELSE(WIN32)
INSTALL(TARGETS ${TARGET_TARGETNAME} INSTALL(TARGETS ${TARGET_TARGETNAME}
RUNTIME DESTINATION bin COMPONENT ${PACKAGE_COMPONENT} RUNTIME DESTINATION bin COMPONENT ${PACKAGE_COMPONENT}
@@ -428,6 +436,10 @@ MACRO(SETUP_APPLICATION APPLICATION_NAME)
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION bin BUNDLE DESTINATION bin) INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION bin BUNDLE DESTINATION bin)
ELSE(APPLE) ELSE(APPLE)
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION bin COMPONENT openscenegraph ) INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION bin COMPONENT openscenegraph )
IF(MSVC)
INSTALL(FILES ${CMAKE_BINARY_DIR}/bin/${TARGET_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION bin COMPONENT openscenegraph CONFIGURATIONS RelWithDebInfo)
INSTALL(FILES ${CMAKE_BINARY_DIR}/bin/${TARGET_NAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION bin COMPONENT openscenegraph CONFIGURATIONS Debug)
ENDIF(MSVC)
ENDIF(APPLE) ENDIF(APPLE)
ENDMACRO(SETUP_APPLICATION) ENDMACRO(SETUP_APPLICATION)
@@ -457,6 +469,10 @@ MACRO(SETUP_EXAMPLE EXAMPLE_NAME)
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION share/OpenSceneGraph/bin BUNDLE DESTINATION share/OpenSceneGraph/bin ) INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION share/OpenSceneGraph/bin BUNDLE DESTINATION share/OpenSceneGraph/bin )
ELSE(APPLE) ELSE(APPLE)
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION share/OpenSceneGraph/bin COMPONENT openscenegraph-examples ) INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION share/OpenSceneGraph/bin COMPONENT openscenegraph-examples )
IF(MSVC)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_TARGETNAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION share/OpenSceneGraph/bin COMPONENT openscenegraph-examples CONFIGURATIONS RelWithDebInfo)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_TARGETNAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION share/OpenSceneGraph/bin COMPONENT openscenegraph-examples CONFIGURATIONS Debug)
ENDIF(MSVC)
ENDIF(APPLE) ENDIF(APPLE)
ENDMACRO(SETUP_EXAMPLE) ENDMACRO(SETUP_EXAMPLE)

115764
ChangeLog

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,77 @@
OSG News OSG News
======== ========
OpenSceneGraph 3.4.1 release is maintaince release that provide build/runtime improvements and better GLES support
PERTHSHIRE, Scotland - 28th August 2017 - OpenSceneGraph Professional Services announces the release of OpenSceneGraph 3.4.1, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. OpenSceneGraph 3.4 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modeling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. OpenSceneGraph 3.4 runs on all Microsoft Windows platforms, Apple OS/X, IOS, GNU/Linux, Android, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems.
Updates include:
* Improves to GLES support across platforms
* Full support for osgText and on screen stats across all platfroms, including GLES2 and core pofile
* Build fixes to allow compilation against recent 3rd party depdendency changes
* Range of runtime fixes
Downloads and Licensing:
OpenSceneGraph is open-source, so full source code is provided, and can be copied, modified and used free of charge for commercial and non-commercial use. Access to the source allows end users greater flexibility in how they develop, debug and deploy their applications. They gain productivity and freedom by being able to leverage the tool chain in accordance with their own release cycles. Downloads of binaries and source can be found in the Downloads section of the openscenegraph.org website.
OpenSceneGraph is released under the OpenSceneGraph Public License, which is based on the Lesser GNU Public License (LGPL), permitting the software to be used free of charge across the full spectrum of commercial and open-source applications. Furthermore, it allows both static and dynamic linking of the OpenSceneGraph libraries without restricting the licensing of the user's software.
Professional support and services
OpenSceneGraph project is backed up with professional services by OpenSceneGraph Professional Services, based in Scotland, and a range of Contractors from around the world. Services available include:
Confidential Professional Support
Bespoke development
Consultancy
Training
Community support and contributions:
The diverse and growing community of over 5000 developers is centred around the public osg-users mailing list/forum, where members discuss how best to use OpenSceneGraph, provide mutual support, and coordinate development of new features and bug fixes. Members of this community come from many different countries with backgrounds ranging from some of the world's largest aerospace companies, game companies, and visual simulation specialists to university researchers, students and hobbyists.
The OpenSceneGraph project owes a great deal to the community for its development and support, in particular we wish to thank the 562 individuals from around the world that have directly contributed to the development and refinement of the OpenSceneGraph code base.
OpenSceneGraph 3.4 release introduces shader composition, new osgUI library, displacement mapping, volume rendering, lua scripting support and much more
PERTHSHIRE, Scotland - 12th August 2015 - OpenSceneGraph Professional Services announces the release of OpenSceneGraph 3.4, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. OpenSceneGraph 3.4 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modeling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. OpenSceneGraph 3.4 runs on all Microsoft Windows platforms, Apple OS/X, IOS, GNU/Linux, Android, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems.
Updates include:
* New #pragma(tic) composition shader functionality built into the core OSG that provides a easy to use yet flexible scheme for controlling and composing shaders at runtime levering GLSL support for #define and #pragma.
* New osgTerrain::DisplacementMappingTechnique to uses vertex, geometry and fragment shader based displacement mapping technique that dramatically lowers the CPU and GPU memory footprint and bandwidth needs for the same visual quality. The new scheme enables paged terrain that work robustly on smaller hardware, or with far higher loads without framedrops. This new technique levels #pragma(tic) shader composition to enable one to toggle on/off features in the shaders at runtime in a way that is as convenient to use as toggle modes in a fixed function pipeline scene graph.
* New osgVolume::MultipassTechique that uses multipass rendering and shaders to enable seamless mixing of traditional 3D geometry and volumes, support for geometry hulls that constrain where the volume should be rendered as well as improving the ray tracing shaders so that they are both faster and have higher visual quality than the previous generation of ray traced shaders supported by OSG-3.2 releases and before.
* New osgDB::Classiterface class that provides an easy to use mechanism for introspection of scene graph classes, allowing one to get, set properties and invoke methods in a generic way, making the task of integrating 3rd prarty tools such as scripting languages straight forward.
* New Lua scripting support via a plugin that integrates Lua 5.2.3 and the OSG via the OSG's native serialization codes.
* New osgUI NodeKit, that enables User Interface elements to be placed directly into 3D scene graph. The classes are fully scriptable so you create create UI and behaviours all within lua scripts.
* Improvements to OpenGL ES 1.1, ES 2.0 and ES3.0 support, including platform specific extensions
* Improvements to OpenGL 4.x support with a range of new extensions support
* Updates to osgQt to support Qt5 and provide better support for Qt4
Downloads and Licensing:
OpenSceneGraph is open-source, so full source code is provided, and can be copied, modified and used free of charge for commercial and non-commercial use. Access to the source allows end users greater flexibility in how they develop, debug and deploy their applications. They gain productivity and freedom by being able to leverage the tool chain in accordance with their own release cycles. Downloads of binaries and source can be found in the Downloads section of the openscenegraph.org website.
OpenSceneGraph is released under the OpenSceneGraph Public License, which is based on the Lesser GNU Public License (LGPL), permitting the software to be used free of charge across the full spectrum of commercial and open-source applications. Furthermore, it allows both static and dynamic linking of the OpenSceneGraph libraries without restricting the licensing of the user's software.
Professional support and services
OpenSceneGraph project is backed up with professional services by OpenSceneGraph Professional Services, based in Scotland, and a range of Contractors from around the world. Services available include:
Confidential Professional Support
Bespoke development
Consultancy
Training
Community support and contributions:
The diverse and growing community of over 5000 developers is centred around the public osg-users mailing list/forum, where members discuss how best to use OpenSceneGraph, provide mutual support, and coordinate development of new features and bug fixes. Members of this community come from many different countries with backgrounds ranging from some of the world's largest aerospace companies, game companies, and visual simulation specialists to university researchers, students and hobbyists.
The OpenSceneGraph project owes a great deal to the community for its development and support, in particular we wish to thank the 550 individuals from around the world that have directly contributed to the development and refinement of the OpenSceneGraph code base.
= !OpenSceneGraph 3.2 release improves support iOS and Android, supports a range of new OpenGL features much more. = !OpenSceneGraph 3.2 release improves support iOS and Android, supports a range of new OpenGL features much more.
PERTHSHIRE, Scotland - 24th July 2013 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 3.2, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 3.2 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modeling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 3.2 runs on all Microsoft Windows platforms, Apple OS/X, IOS, GNU/Linux, Android, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems. PERTHSHIRE, Scotland - 24th July 2013 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 3.2, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 3.2 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modeling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 3.2 runs on all Microsoft Windows platforms, Apple OS/X, IOS, GNU/Linux, Android, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems.

View File

@@ -23,7 +23,7 @@ more indepth instructions.
Robert Osfield. Robert Osfield.
Project Lead. Project Lead.
12th August 2015. 28th August 2017.
-- --

View File

@@ -135,7 +135,7 @@ int main( int argc, char **argv )
++itr) ++itr)
{ {
std::cout<<"reading "<<*itr<<std::endl; std::cout<<"reading "<<*itr<<std::endl;
osg::ref_ptr<osg::Object> obj = osgDB::readObjectFile(*itr); osg::ref_ptr<osg::Object> obj = osgDB::readRefObjectFile(*itr);
if (obj.valid()) if (obj.valid())
{ {
std::cout<<" write to archive "<<*itr<<std::endl; std::cout<<" write to archive "<<*itr<<std::endl;

View File

@@ -157,6 +157,7 @@ public:
} }
osg::ref_ptr<osg::State> state = new osg::State; osg::ref_ptr<osg::State> state = new osg::State;
state->initializeExtensionProcs();
for(TextureSet::iterator itr=_textureSet.begin(); for(TextureSet::iterator itr=_textureSet.begin();
itr!=_textureSet.end(); itr!=_textureSet.end();
@@ -771,7 +772,7 @@ int main( int argc, char **argv )
osg::Timer_t startTick = osg::Timer::instance()->tick(); osg::Timer_t startTick = osg::Timer::instance()->tick();
osg::ref_ptr<osg::Node> root = osgDB::readNodeFiles(fileNames); osg::ref_ptr<osg::Node> root = osgDB::readRefNodeFiles(fileNames);
if (root.valid()) if (root.valid())
{ {

View File

@@ -272,9 +272,9 @@ public:
} }
} }
osg::Node* readNodeFileAndWriteToCache(const std::string& filename) osg::ref_ptr<osg::Node> readNodeFileAndWriteToCache(const std::string& filename)
{ {
osg::Node* node = 0; osg::ref_ptr<osg::Node> node = 0;
if (_fileCache.valid() ) if (_fileCache.valid() )
{ {
if (_fileCache->existsInCache(filename)) if (_fileCache->existsInCache(filename))
@@ -286,7 +286,7 @@ public:
{ {
osg::notify(osg::NOTICE)<<"reading : "<<filename<<std::endl; osg::notify(osg::NOTICE)<<"reading : "<<filename<<std::endl;
node = osgDB::readNodeFile(filename); node = osgDB::readRefNodeFile(filename);
if (node) if (node)
{ {
osg::notify(osg::NOTICE)<<"write to FileCache : "<<filename<<std::endl; osg::notify(osg::NOTICE)<<"write to FileCache : "<<filename<<std::endl;
@@ -298,7 +298,7 @@ public:
else else
{ {
osg::notify(osg::NOTICE)<<"reading : "<<filename<<std::endl; osg::notify(osg::NOTICE)<<"reading : "<<filename<<std::endl;
node = osgDB::readNodeFile(filename); node = osgDB::readRefNodeFile(filename);
} }
return node; return node;
} }

View File

@@ -261,7 +261,21 @@ const char* invalidNames[] =
"RayIntersector", "RayIntersector",
"OpenSceneGraph-Data", "OpenSceneGraph-Data",
"Node", "Node",
"AlphaFunc" "AlphaFunc",
"CompositeViewer",
"OpenSceneGraph-3",
"DisplaySettings::SHADER_NONE",
"CodeDocs",
"Mon",
"Tue",
"Wed",
"Fri",
"Sat",
"Sun",
"I",
"TriangleFunctor",
"PrimitiveFunctor",
"OpenMW"
}; };
@@ -484,7 +498,9 @@ TypoCorrection typoCorrections[] =
{"Janik", "Jannik"}, {"Janik", "Jannik"},
{"Viganò", "Vigan<EFBFBD>"}, {"Viganò", "Vigan<EFBFBD>"},
{"Vigano", "Vigan<EFBFBD>"}, {"Vigano", "Vigan<EFBFBD>"},
{"Frashud", "Farshid"} {"Frashud", "Farshid"},
{"Dannahauer","Dannahauer"},
{"Sando","Sandro"}
}; };
@@ -498,6 +514,16 @@ struct NameCorrection
NameCorrection nameCorrections[] = NameCorrection nameCorrections[] =
{ {
{"LaurensVoerman","Meta_Shape",
"Laurens", "Voerman"},
{"LaurensVoerman","OpenCascade",
"Laurens", "Voerman"},
{"LaurensVoerman","Fri",
"Laurens", "Voerman"},
{"LaurensVoerman","",
"Laurens", "Voerman"},
{"Laurens","Loerman",
"Laurens", "Voerman"},
{"FrancoisTigeot","", {"FrancoisTigeot","",
"Francois", "Tigeot"}, "Francois", "Tigeot"},
{"Juan","Manuel", {"Juan","Manuel",

View File

@@ -87,10 +87,10 @@ int main(int argc, char** argv)
std::string device; std::string device;
while(arguments.read("--device", device)) while(arguments.read("--device", device))
{ {
osg::ref_ptr<osgGA::Device> dev = osgDB::readFile<osgGA::Device>(device); osg::ref_ptr<osgGA::Device> dev = osgDB::readRefFile<osgGA::Device>(device);
if (dev.valid()) if (dev.valid())
{ {
viewer.addDevice(dev.get()); viewer.addDevice(dev);
} }
} }
@@ -152,7 +152,7 @@ int main(int argc, char** argv)
viewer.addEventHandler(new osgViewer::ScreenCaptureHandler); viewer.addEventHandler(new osgViewer::ScreenCaptureHandler);
// load the data // load the data
osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments); osg::ref_ptr<osg::Node> loadedModel = osgDB::readRefNodeFiles(arguments);
if (!loadedModel) if (!loadedModel)
{ {
std::cout << arguments.getApplicationName() <<": No data loaded" << std::endl; std::cout << arguments.getApplicationName() <<": No data loaded" << std::endl;
@@ -172,9 +172,9 @@ int main(int argc, char** argv)
// optimize the scene graph, remove redundant nodes and state etc. // optimize the scene graph, remove redundant nodes and state etc.
osgUtil::Optimizer optimizer; osgUtil::Optimizer optimizer;
optimizer.optimize(loadedModel.get()); optimizer.optimize(loadedModel);
viewer.setSceneData( loadedModel.get() ); viewer.setSceneData(loadedModel);
viewer.realize(); viewer.realize();

View File

@@ -33,7 +33,7 @@
#if defined(__linux) #if defined(__linux)
#include <unistd.h> #include <unistd.h>
#include <linux/sockios.h> #include <linux/sockios.h>
#elif defined(__FreeBSD__) || defined(__DragonFly__) #elif defined(__FreeBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__)
#include <unistd.h> #include <unistd.h>
#include <sys/sockio.h> #include <sys/sockio.h>
#elif defined(__sgi) #elif defined(__sgi)
@@ -41,6 +41,8 @@
#include <net/soioctl.h> #include <net/soioctl.h>
#elif defined(__CYGWIN__) #elif defined(__CYGWIN__)
#include <unistd.h> #include <unistd.h>
#elif defined (__GNU__)
#include <unistd.h>
#elif defined(__sun) #elif defined(__sun)
#include <unistd.h> #include <unistd.h>
#include <sys/sockio.h> #include <sys/sockio.h>
@@ -338,7 +340,7 @@ void Receiver::sync( void )
} }
#if defined(__linux) || defined(__FreeBSD__) || defined( __APPLE__ ) || \ #if defined(__linux) || defined(__FreeBSD__) || defined( __APPLE__ ) || \
defined(__DragonFly__) defined(__DragonFly__) || defined(__FreeBSD_kernel__) || defined(__GNU__)
socklen_t socklen_t
#else #else
int int

View File

@@ -215,24 +215,24 @@ osg::ref_ptr<osg::Node> p3d::readShowFiles(osg::ArgumentParser& arguments,const
std::string filename; std::string filename;
while (arguments.read("--image",filename)) while (arguments.read("--image",filename))
{ {
osg::ref_ptr<osg::Image> image = readImageFile(filename.c_str(), local_options.get()); osg::ref_ptr<osg::Image> image = readRefImageFile(filename.c_str(), local_options.get());
if (image.valid()) nodeList.push_back(osg::createGeodeForImage(image.get())); if (image.valid()) nodeList.push_back(osg::createGeodeForImage(image));
} }
while (arguments.read("--movie",filename)) while (arguments.read("--movie",filename))
{ {
osg::ref_ptr<osg::Image> image = readImageFile(filename.c_str(), local_options.get()); osg::ref_ptr<osg::Image> image = readRefImageFile(filename.c_str(), local_options.get());
osg::ref_ptr<osg::ImageStream> imageStream = dynamic_cast<osg::ImageStream*>(image.get()); osg::ref_ptr<osg::ImageStream> imageStream = dynamic_cast<osg::ImageStream*>(image.get());
if (image.valid()) if (image.valid())
{ {
imageStream->play(); imageStream->play();
nodeList.push_back(osg::createGeodeForImage(imageStream.get())); nodeList.push_back(osg::createGeodeForImage(imageStream));
} }
} }
while (arguments.read("--dem",filename)) while (arguments.read("--dem",filename))
{ {
osg::HeightField* hf = readHeightFieldFile(filename.c_str(), local_options.get()); osg::ref_ptr<osg::HeightField> hf = readRefHeightFieldFile(filename.c_str(), local_options.get());
if (hf) if (hf)
{ {
osg::Geode* geode = new osg::Geode; osg::Geode* geode = new osg::Geode;
@@ -247,7 +247,7 @@ osg::ref_ptr<osg::Node> p3d::readShowFiles(osg::ArgumentParser& arguments,const
if (!arguments.isOption(pos)) if (!arguments.isOption(pos))
{ {
// not an option so assume string is a filename. // not an option so assume string is a filename.
osg::Node *node = osgDB::readNodeFile( arguments[pos], local_options.get()); osg::ref_ptr<osg::Node> node = osgDB::readRefNodeFile( arguments[pos], local_options.get());
if(node) if(node)
{ {

View File

@@ -266,7 +266,7 @@ void processLoadedModel(osg::ref_ptr<osg::Node>& loadedModel, int optimizer_opti
void addDeviceTo(osgViewer::Viewer& viewer, const std::string& device_name, bool forward_mouse_events) void addDeviceTo(osgViewer::Viewer& viewer, const std::string& device_name, bool forward_mouse_events)
{ {
osg::ref_ptr<osgGA::Device> dev = osgDB::readFile<osgGA::Device>(device_name); osg::ref_ptr<osgGA::Device> dev = osgDB::readRefFile<osgGA::Device>(device_name);
if (dev.valid()) if (dev.valid())
{ {
OSG_INFO << "Adding Device : " << device_name << std::endl; OSG_INFO << "Adding Device : " << device_name << std::endl;
@@ -317,7 +317,7 @@ int main( int argc, char **argv )
if (arguments.read("-devices") || arguments.read("--devices")) if (arguments.read("-devices") || arguments.read("--devices"))
{ {
// Force load QuickTime plugin, probe video capability, exit // Force load QuickTime plugin, probe video capability, exit
osgDB::readImageFile("devices.live"); osgDB::readRefImageFile("devices.live");
return 1; return 1;
} }
@@ -451,7 +451,7 @@ int main( int argc, char **argv )
osg::ref_ptr<osgDB::Options> device_options = new osgDB::Options("documentRegisteredHandlers"); osg::ref_ptr<osgDB::Options> device_options = new osgDB::Options("documentRegisteredHandlers");
osg::ref_ptr<osgGA::Device> rest_http_device = osgDB::readFile<osgGA::Device>(server_address+":"+server_port+"/"+document_root+".resthttp", device_options.get()); osg::ref_ptr<osgGA::Device> rest_http_device = osgDB::readRefFile<osgGA::Device>(server_address+":"+server_port+"/"+document_root+".resthttp", device_options.get());
if (rest_http_device.valid()) if (rest_http_device.valid())
{ {
viewer.addDevice(rest_http_device.get()); viewer.addDevice(rest_http_device.get());

View File

@@ -85,7 +85,7 @@ int main( int argc, char **argv )
std::string filename; std::string filename;
if (arguments.read("--shader",filename)) if (arguments.read("--shader",filename))
{ {
osg::ref_ptr<osg::Shader> shader = osgDB::readShaderFile(filename); osg::ref_ptr<osg::Shader> shader = osgDB::readRefShaderFile(filename);
if (shader.valid()) if (shader.valid())
{ {
std::string name = osgDB::getStrippedName(filename); std::string name = osgDB::getStrippedName(filename);

View File

@@ -311,7 +311,7 @@ public:
//set OSG_FILE_PATH for loading axes.osgt //set OSG_FILE_PATH for loading axes.osgt
void ComputeNode::addHelperGeometry() void ComputeNode::addHelperGeometry()
{ {
_helperNode = osgDB::readNodeFile("axes.osgt"); _helperNode = osgDB::readRefNodeFile("axes.osgt");
if (_helperNode.valid()) if (_helperNode.valid())
{ {
@@ -464,8 +464,8 @@ void ComputeNode::addDataMonitor(osg::Vec3 placement, osg::Vec3 relativePlacemen
ss->setMode(GL_LIGHTING, osg::StateAttribute::OFF); ss->setMode(GL_LIGHTING, osg::StateAttribute::OFF);
//add a label //add a label
osgText::Text* text = new osgText::Text; osg::ref_ptr<osgText::Text> text = new osgText::Text;
osgText::Font* font = osgText::readFontFile("fonts/arial.ttf"); osg::ref_ptr<osgText::Font> font = osgText::readRefFontFile("fonts/arial.ttf");
text->setFont(font); text->setFont(font);
text->setColor(osg::Vec4(1, 1, 1, 1)); text->setColor(osg::Vec4(1, 1, 1, 1));
text->setCharacterSize(0.1*scale); text->setCharacterSize(0.1*scale);

View File

@@ -555,7 +555,7 @@ public:
osg::notify(osg::NOTICE)<<"LoadAndCompileOperation "<<_filename<<std::endl; osg::notify(osg::NOTICE)<<"LoadAndCompileOperation "<<_filename<<std::endl;
_modelReadyToMerge = false; _modelReadyToMerge = false;
_loadedModel = osgDB::readNodeFile(_filename); _loadedModel = osgDB::readRefNodeFile(_filename);
if (_loadedModel.valid()) if (_loadedModel.valid())
{ {

View File

@@ -136,9 +136,9 @@ osg::Node* createMovingModel(const osg::Vec3& center, float radius)
osg::AnimationPath* animationPath = createAnimationPath(center,radius,animationLength); osg::AnimationPath* animationPath = createAnimationPath(center,radius,animationLength);
osg::Group* model = new osg::Group; osg::ref_ptr<osg::Group> model = new osg::Group;
osg::Node* glider = osgDB::readNodeFile("glider.osgt"); osg::ref_ptr<osg::Node> glider = osgDB::readRefNodeFile("glider.osgt");
if (glider) if (glider)
{ {
const osg::BoundingSphere& bs = glider->getBound(); const osg::BoundingSphere& bs = glider->getBound();
@@ -159,7 +159,7 @@ osg::Node* createMovingModel(const osg::Vec3& center, float radius)
model->addChild(xform); model->addChild(xform);
} }
osg::Node* cessna = osgDB::readNodeFile("cessna.osgt"); osg::ref_ptr<osg::Node> cessna = osgDB::readRefNodeFile("cessna.osgt");
if (cessna) if (cessna)
{ {
const osg::BoundingSphere& bs = cessna->getBound(); const osg::BoundingSphere& bs = cessna->getBound();
@@ -173,26 +173,26 @@ osg::Node* createMovingModel(const osg::Vec3& center, float radius)
positioned->addChild(cessna); positioned->addChild(cessna);
osg::MatrixTransform* xform = new osg::MatrixTransform; osg::ref_ptr<osg::MatrixTransform> xform = new osg::MatrixTransform;
xform->setUpdateCallback(new osg::AnimationPathCallback(animationPath,0.0f,2.0)); xform->setUpdateCallback(new osg::AnimationPathCallback(animationPath,0.0f,2.0));
xform->addChild(positioned); xform->addChild(positioned);
model->addChild(xform); model->addChild(xform);
} }
return model; return model.release();
} }
osg::Node* createModel(bool overlay, osgSim::OverlayNode::OverlayTechnique technique) osg::ref_ptr<osg::Group> createModel(bool overlay, osgSim::OverlayNode::OverlayTechnique technique)
{ {
osg::Vec3 center(0.0f,0.0f,0.0f); osg::Vec3 center(0.0f,0.0f,0.0f);
float radius = 100.0f; float radius = 100.0f;
osg::Group* root = new osg::Group; osg::ref_ptr<osg::Group> root = new osg::Group;
float baseHeight = center.z()-radius*0.5; float baseHeight = center.z()-radius*0.5;
osg::Node* baseModel = createBase(osg::Vec3(center.x(), center.y(), baseHeight),radius); osg::ref_ptr<osg::Node> baseModel = createBase(osg::Vec3(center.x(), center.y(), baseHeight),radius);
osg::Node* movingModel = createMovingModel(center,radius*0.8f); osg::ref_ptr<osg::Node> movingModel = createMovingModel(center,radius*0.8f);
if (overlay) if (overlay)
{ {
@@ -232,14 +232,14 @@ int main( int argc, char **argv )
osgViewer::Viewer viewer; osgViewer::Viewer viewer;
// load the nodes from the commandline arguments. // load the nodes from the commandline arguments.
osg::Node* model = createModel(overlay, technique); osg::ref_ptr<osg::Group> model = createModel(overlay, technique);
if (!model) if (!model)
{ {
return 1; return 1;
} }
// tilt the scene so the default eye position is looking down on the model. // tilt the scene so the default eye position is looking down on the model.
osg::MatrixTransform* rootnode = new osg::MatrixTransform; osg::ref_ptr<osg::MatrixTransform> rootnode = new osg::MatrixTransform;
rootnode->setMatrix(osg::Matrix::rotate(osg::inDegrees(30.0f),1.0f,0.0f,0.0f)); rootnode->setMatrix(osg::Matrix::rotate(osg::inDegrees(30.0f),1.0f,0.0f,0.0f));
rootnode->addChild(model); rootnode->addChild(model);

View File

@@ -196,8 +196,8 @@ int main (int argc, char* argv[])
while (psr.read("--software")) { hardware = false; } while (psr.read("--software")) { hardware = false; }
while (psr.read("--number", maxChar)) {} while (psr.read("--number", maxChar)) {}
osg::ref_ptr<osg::Node> node = osgDB::readRefNodeFiles(psr);
osg::ref_ptr<osg::Group> root = dynamic_cast<osg::Group*>(osgDB::readNodeFiles(psr)); osg::ref_ptr<osg::Group> root = dynamic_cast<osg::Group*>(node.get());
if (!root) if (!root)
{ {
std::cout << psr.getApplicationName() <<": No data loaded" << std::endl; std::cout << psr.getApplicationName() <<": No data loaded" << std::endl;

View File

@@ -50,7 +50,7 @@ struct GeometryFinder : public osg::NodeVisitor
osg::ref_ptr<osg::Geometry> getShape(const std::string& name) osg::ref_ptr<osg::Geometry> getShape(const std::string& name)
{ {
osg::ref_ptr<osg::Node> shape0 = osgDB::readNodeFile(name); osg::ref_ptr<osg::Node> shape0 = osgDB::readRefNodeFile(name);
if (shape0) if (shape0)
{ {
GeometryFinder finder; GeometryFinder finder;

View File

@@ -163,7 +163,8 @@ int main (int argc, char* argv[])
file = psr[1]; file = psr[1];
// replace the manager // replace the manager
osg::Group* root = dynamic_cast<osg::Group*>(osgDB::readNodeFile(file)); osg::ref_ptr<osg::Node> loadedmodel = osgDB::readRefNodeFile(file);
osg::Group* root = dynamic_cast<osg::Group*>(loadedmodel.get());
if (!root) { if (!root) {
osg::notify(osg::FATAL) << "can't read file " << file << std::endl; osg::notify(osg::FATAL) << "can't read file " << file << std::endl;
return 1; return 1;

View File

@@ -127,7 +127,8 @@ int main(int argc, char** argv)
osgViewer::Viewer viewer(arguments); osgViewer::Viewer viewer(arguments);
osg::ref_ptr<osg::Group> group = new osg::Group(); osg::ref_ptr<osg::Group> group = new osg::Group();
osg::Group* node = dynamic_cast<osg::Group*>(osgDB::readNodeFiles(arguments)); //dynamic_cast<osgAnimation::AnimationManager*>(osgDB::readNodeFile(psr[1])); osg::ref_ptr<osg::Node> loadedmodel = osgDB::readRefNodeFiles(arguments);
osg::Group* node = dynamic_cast<osg::Group*>(loadedmodel.get());
if(!node) if(!node)
{ {
std::cout << arguments.getApplicationName() <<": No data loaded" << std::endl; std::cout << arguments.getApplicationName() <<": No data loaded" << std::endl;

View File

@@ -165,7 +165,7 @@ int main(int argc, char** argv)
viewer.addEventHandler(new osgViewer::ScreenCaptureHandler); viewer.addEventHandler(new osgViewer::ScreenCaptureHandler);
// load the data // load the data
osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments); osg::ref_ptr<osg::Node> loadedModel = osgDB::readRefNodeFiles(arguments);
if (!loadedModel) if (!loadedModel)
{ {
osg::Geometry * quad = osg::createTexturedQuadGeometry(osg::Vec3f(-2.0f, 0.0f, -2.0f), osg::Geometry * quad = osg::createTexturedQuadGeometry(osg::Vec3f(-2.0f, 0.0f, -2.0f),

View File

@@ -287,7 +287,7 @@ int main( int argc, char **argv )
} }
// load the data // load the data
osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments); osg::ref_ptr<osg::Node> loadedModel = osgDB::readRefNodeFiles(arguments);
if (!loadedModel) if (!loadedModel)
{ {
std::cout << arguments.getApplicationName() <<": No data loaded" << std::endl; std::cout << arguments.getApplicationName() <<": No data loaded" << std::endl;

View File

@@ -42,10 +42,10 @@
typedef std::vector< osg::ref_ptr<osg::Image> > ImageList; typedef std::vector< osg::ref_ptr<osg::Image> > ImageList;
/** create quad at specified position. */ /** create quad at specified position. */
osg::Drawable* createSquare(const osg::Vec3& corner,const osg::Vec3& width,const osg::Vec3& height, osg::Image* image=NULL) osg::Drawable* createSquare(const osg::Vec3& corner,const osg::Vec3& width,const osg::Vec3& height, osg::ref_ptr<osg::Image> image)
{ {
// set up the Geometry. // set up the Geometry.
osg::Geometry* geom = new osg::Geometry; osg::ref_ptr<osg::Geometry> geom = new osg::Geometry;
osg::Vec3Array* coords = new osg::Vec3Array(4); osg::Vec3Array* coords = new osg::Vec3Array(4);
(*coords)[0] = corner; (*coords)[0] = corner;
@@ -80,13 +80,13 @@ osg::Drawable* createSquare(const osg::Vec3& corner,const osg::Vec3& width,const
geom->setStateSet(stateset); geom->setStateSet(stateset);
} }
return geom; return geom.release();
} }
osg::Drawable* createAxis(const osg::Vec3& corner,const osg::Vec3& xdir,const osg::Vec3& ydir,const osg::Vec3& zdir) osg::Drawable* createAxis(const osg::Vec3& corner,const osg::Vec3& xdir,const osg::Vec3& ydir,const osg::Vec3& zdir)
{ {
// set up the Geometry. // set up the Geometry.
osg::Geometry* geom = new osg::Geometry; osg::ref_ptr<osg::Geometry> geom = new osg::Geometry;
osg::Vec3Array* coords = new osg::Vec3Array(6); osg::Vec3Array* coords = new osg::Vec3Array(6);
(*coords)[0] = corner; (*coords)[0] = corner;
@@ -121,20 +121,20 @@ osg::Drawable* createAxis(const osg::Vec3& corner,const osg::Vec3& xdir,const os
stateset->setMode(GL_LIGHTING,osg::StateAttribute::OFF); stateset->setMode(GL_LIGHTING,osg::StateAttribute::OFF);
geom->setStateSet(stateset); geom->setStateSet(stateset);
return geom; return geom.release();
} }
osg::Node* createModel() osg::ref_ptr<osg::Node> createModel()
{ {
// create the root node which will hold the model. // create the root node which will hold the model.
osg::Group* root = new osg::Group(); osg::ref_ptr<osg::Group> root = new osg::Group();
// add the drawable into a single geode to be shared... // add the drawable into a single geode to be shared...
osg::Billboard* center = new osg::Billboard(); osg::Billboard* center = new osg::Billboard();
center->setMode(osg::Billboard::POINT_ROT_EYE); center->setMode(osg::Billboard::POINT_ROT_EYE);
center->addDrawable( center->addDrawable(
createSquare(osg::Vec3(-0.5f,0.0f,-0.5f),osg::Vec3(1.0f,0.0f,0.0f),osg::Vec3(0.0f,0.0f,1.0f),osgDB::readImageFile("Images/reflect.rgb")), createSquare(osg::Vec3(-0.5f,0.0f,-0.5f),osg::Vec3(1.0f,0.0f,0.0f),osg::Vec3(0.0f,0.0f,1.0f),osgDB::readRefImageFile("Images/reflect.rgb")),
osg::Vec3(0.0f,0.0f,0.0f)); osg::Vec3(0.0f,0.0f,0.0f));
osg::Billboard* x_arrow = new osg::Billboard(); osg::Billboard* x_arrow = new osg::Billboard();
@@ -142,7 +142,7 @@ osg::Node* createModel()
x_arrow->setAxis(osg::Vec3(1.0f,0.0f,0.0f)); x_arrow->setAxis(osg::Vec3(1.0f,0.0f,0.0f));
x_arrow->setNormal(osg::Vec3(0.0f,-1.0f,0.0f)); x_arrow->setNormal(osg::Vec3(0.0f,-1.0f,0.0f));
x_arrow->addDrawable( x_arrow->addDrawable(
createSquare(osg::Vec3(-0.5f,0.0f,-0.5f),osg::Vec3(1.0f,0.0f,0.0f),osg::Vec3(0.0f,0.0f,1.0f),osgDB::readImageFile("Cubemap_axis/posx.png")), createSquare(osg::Vec3(-0.5f,0.0f,-0.5f),osg::Vec3(1.0f,0.0f,0.0f),osg::Vec3(0.0f,0.0f,1.0f),osgDB::readRefImageFile("Cubemap_axis/posx.png")),
osg::Vec3(5.0f,0.0f,0.0f)); osg::Vec3(5.0f,0.0f,0.0f));
osg::Billboard* y_arrow = new osg::Billboard(); osg::Billboard* y_arrow = new osg::Billboard();
@@ -150,7 +150,7 @@ osg::Node* createModel()
y_arrow->setAxis(osg::Vec3(0.0f,1.0f,0.0f)); y_arrow->setAxis(osg::Vec3(0.0f,1.0f,0.0f));
y_arrow->setNormal(osg::Vec3(1.0f,0.0f,0.0f)); y_arrow->setNormal(osg::Vec3(1.0f,0.0f,0.0f));
y_arrow->addDrawable( y_arrow->addDrawable(
createSquare(osg::Vec3(0.0f,-0.5f,-0.5f),osg::Vec3(0.0f,1.0f,0.0f),osg::Vec3(0.0f,0.0f,1.0f),osgDB::readImageFile("Cubemap_axis/posy.png")), createSquare(osg::Vec3(0.0f,-0.5f,-0.5f),osg::Vec3(0.0f,1.0f,0.0f),osg::Vec3(0.0f,0.0f,1.0f),osgDB::readRefImageFile("Cubemap_axis/posy.png")),
osg::Vec3(0.0f,5.0f,0.0f)); osg::Vec3(0.0f,5.0f,0.0f));
osg::Billboard* z_arrow = new osg::Billboard(); osg::Billboard* z_arrow = new osg::Billboard();
@@ -158,7 +158,7 @@ osg::Node* createModel()
z_arrow->setAxis(osg::Vec3(0.0f,0.0f,1.0f)); z_arrow->setAxis(osg::Vec3(0.0f,0.0f,1.0f));
z_arrow->setNormal(osg::Vec3(0.0f,-1.0f,0.0f)); z_arrow->setNormal(osg::Vec3(0.0f,-1.0f,0.0f));
z_arrow->addDrawable( z_arrow->addDrawable(
createSquare(osg::Vec3(-0.5f,0.0f,-0.5f),osg::Vec3(1.0f,0.0f,0.0f),osg::Vec3(0.0f,0.0f,1.0f),osgDB::readImageFile("Cubemap_axis/posz.png")), createSquare(osg::Vec3(-0.5f,0.0f,-0.5f),osg::Vec3(1.0f,0.0f,0.0f),osg::Vec3(0.0f,0.0f,1.0f),osgDB::readRefImageFile("Cubemap_axis/posz.png")),
osg::Vec3(0.0f,0.0f,5.0f)); osg::Vec3(0.0f,0.0f,5.0f));

View File

@@ -71,9 +71,17 @@ int main( int argc, char **argv )
bool useGlobalBlending = false; bool useGlobalBlending = false;
if ( arguments.read("--no-draw-buffers") ) useGlobalBlending = true; if ( arguments.read("--no-draw-buffers") ) useGlobalBlending = true;
osg::ref_ptr<osg::Node> cessna = osgDB::readRefNodeFile("cessna.osgt");
if (!cessna)
{
OSG_NOTICE<<"Cannot not find model 'cessna.osg' to render"<<std::endl;
return 1;
}
// Create a camera to output multi-rendering-targets (MRT) // Create a camera to output multi-rendering-targets (MRT)
osg::Camera* mrtCam = createMRTCamera( textures ); osg::ref_ptr<osg::Camera> mrtCam = createMRTCamera( textures );
mrtCam->addChild( osgDB::readNodeFile("cessna.osgt") ); mrtCam->addChild( cessna );
// Create shader program to be used // Create shader program to be used
const char* mrtFragmentCode = { const char* mrtFragmentCode = {
@@ -87,8 +95,8 @@ int main( int argc, char **argv )
osg::ref_ptr<osg::Program> program = new osg::Program; osg::ref_ptr<osg::Program> program = new osg::Program;
program->addShader( new osg::Shader(osg::Shader::FRAGMENT, mrtFragmentCode) ); program->addShader( new osg::Shader(osg::Shader::FRAGMENT, mrtFragmentCode) );
osg::StateSet* ss = mrtCam->getOrCreateStateSet(); osg::ref_ptr<osg::StateSet> ss = mrtCam->getOrCreateStateSet();
ss->setAttributeAndModes( program.get() ); ss->setAttributeAndModes( program );
// Apply blending to the original scene in MRT // Apply blending to the original scene in MRT
if ( !useGlobalBlending ) if ( !useGlobalBlending )
@@ -103,8 +111,8 @@ int main( int argc, char **argv )
// Accept different blend/colormask attributes on multiple render targets // Accept different blend/colormask attributes on multiple render targets
osg::ref_ptr<osg::BlendFunci> blend0 = new osg::BlendFunci(0, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); osg::ref_ptr<osg::BlendFunci> blend0 = new osg::BlendFunci(0, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
osg::ref_ptr<osg::ColorMaski> colormask3 = new osg::ColorMaski(3, false, true, false, true); osg::ref_ptr<osg::ColorMaski> colormask3 = new osg::ColorMaski(3, false, true, false, true);
ss->setAttribute( blend0.get() ); ss->setAttribute( blend0 );
ss->setAttributeAndModes( colormask3.get() ); ss->setAttributeAndModes( colormask3 );
} }
else else
{ {

View File

@@ -139,10 +139,10 @@ int main( int argc, char **argv )
osgViewer::Viewer viewer; osgViewer::Viewer viewer;
// load the nodes from the commandline arguments. // load the nodes from the commandline arguments.
osg::Node* loadedModel = osgDB::readNodeFiles(arguments); osg::ref_ptr<osg::Node> loadedModel = osgDB::readRefNodeFiles(arguments);
// if not loaded assume no arguments passed in, try use default mode instead. // if not loaded assume no arguments passed in, try use default mode instead.
if (!loadedModel) loadedModel = osgDB::readNodeFile("cessnafire.osgt"); if (!loadedModel) loadedModel = osgDB::readRefNodeFile("cessnafire.osgt");
if (!loadedModel) if (!loadedModel)
{ {
@@ -150,11 +150,11 @@ int main( int argc, char **argv )
return 1; return 1;
} }
osg::Group* root = new osg::Group; osg::ref_ptr<osg::Group> root = new osg::Group;
root->addChild(loadedModel); root->addChild(loadedModel);
osg::StateSet* stateset = new osg::StateSet; osg::ref_ptr<osg::StateSet> stateset = new osg::StateSet;
stateset->setDataVariance(osg::Object::DYNAMIC); stateset->setDataVariance(osg::Object::DYNAMIC);
osg::BlendEquation* blendEquation = new osg::BlendEquation(osg::BlendEquation::FUNC_ADD); osg::BlendEquation* blendEquation = new osg::BlendEquation(osg::BlendEquation::FUNC_ADD);

View File

@@ -239,10 +239,10 @@ int main( int argc, char **argv )
} }
else else
{ {
rootnode = osgDB::readNodeFiles(arguments); rootnode = osgDB::readRefNodeFiles(arguments);
// if not loaded assume no arguments passed in, try use default mode instead. // if not loaded assume no arguments passed in, try use default mode instead.
if (!rootnode) rootnode = osgDB::readNodeFile("cow.osgt"); if (!rootnode) rootnode = osgDB::readRefNodeFile("cow.osgt");
if (!rootnode) if (!rootnode)
{ {

View File

@@ -51,7 +51,7 @@ public:
{ {
if (ea.getKey()=='l') if (ea.getKey()=='l')
{ {
osg::ref_ptr<osg::Node> model = osgDB::readNodeFile( _filenames[_position] ); osg::ref_ptr<osg::Node> model = osgDB::readRefNodeFile( _filenames[_position] );
++_position; ++_position;
if (_position>=_filenames.size()) _position = 0; if (_position>=_filenames.size()) _position = 0;
@@ -214,7 +214,7 @@ int main( int argc, char **argv )
osg::ref_ptr<osg::Node> model; osg::ref_ptr<osg::Node> model;
if (sharedModel) if (sharedModel)
{ {
model = osgDB::readNodeFiles(arguments); model = osgDB::readRefNodeFiles(arguments);
if (!model) return 0; if (!model) return 0;
if (enableVBO) if (enableVBO)
@@ -242,7 +242,7 @@ int main( int argc, char **argv )
if (sharedModel) viewer.setSceneData(model.get()); if (sharedModel) viewer.setSceneData(model.get());
else else
{ {
osg::ref_ptr<osg::Node> node = osgDB::readNodeFiles(arguments); osg::ref_ptr<osg::Node> node = osgDB::readRefNodeFiles(arguments);
if (!node) return 0; if (!node) return 0;
if (enableVBO) if (enableVBO)
@@ -300,7 +300,7 @@ int main( int argc, char **argv )
while (arguments.read("--config", configfile)) while (arguments.read("--config", configfile))
{ {
osg::notify(osg::NOTICE)<<"Trying to read config file "<<configfile<<std::endl; osg::notify(osg::NOTICE)<<"Trying to read config file "<<configfile<<std::endl;
osg::ref_ptr<osg::Object> object = osgDB::readObjectFile(configfile); osg::ref_ptr<osg::Object> object = osgDB::readRefObjectFile(configfile);
osgViewer::View* view = dynamic_cast<osgViewer::View*>(object.get()); osgViewer::View* view = dynamic_cast<osgViewer::View*>(object.get());
if (view) if (view)
{ {
@@ -329,9 +329,9 @@ int main( int argc, char **argv )
else else
{ {
// load the scene. // load the scene.
osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments); osg::ref_ptr<osg::Node> loadedModel = osgDB::readRefNodeFiles(arguments);
if (!loadedModel) loadedModel = osgDB::readNodeFile("cow.osgt"); if (!loadedModel) loadedModel = osgDB::readRefNodeFile("cow.osgt");
if (!loadedModel) if (!loadedModel)
{ {
@@ -339,7 +339,7 @@ int main( int argc, char **argv )
return 1; return 1;
} }
viewer.setSceneData(loadedModel.get()); viewer.setSceneData(loadedModel);
} }
viewer.realize(); viewer.realize();

View File

@@ -117,7 +117,7 @@ void Character::setCharacter(const std::string& filename, const std::string& nam
float _characterSize = _width.length()*0.2f; float _characterSize = _width.length()*0.2f;
osg::Image* image = osgDB::readImageFile(filename); osg::ref_ptr<osg::Image> image = osgDB::readRefImageFile(filename);
if (image) if (image)
{ {
osg::Vec3 pos(-0.5f*_characterSize,0.0f,0.0f); osg::Vec3 pos(-0.5f*_characterSize,0.0f,0.0f);
@@ -153,7 +153,7 @@ void Character::setLives(const std::string& filename, const osg::Vec3& origin, c
_numLives = numLives; _numLives = numLives;
_livesSwitch = new osg::Switch; _livesSwitch = new osg::Switch;
osg::Image* image = osgDB::readImageFile(filename); osg::ref_ptr<osg::Image> image = osgDB::readRefImageFile(filename);
if (image) if (image)
{ {
osg::StateSet* stateset = _livesSwitch->getOrCreateStateSet(); osg::StateSet* stateset = _livesSwitch->getOrCreateStateSet();
@@ -186,7 +186,7 @@ void Character::setCatches(const std::string& filename, const osg::Vec3& origin,
_numCatches = 0; _numCatches = 0;
_catchSwitch = new osg::Switch; _catchSwitch = new osg::Switch;
osg::Image* image = osgDB::readImageFile(filename); osg::ref_ptr<osg::Image> image = osgDB::readRefImageFile(filename);
if (image) if (image)
{ {
osg::StateSet* stateset = _catchSwitch->getOrCreateStateSet(); osg::StateSet* stateset = _catchSwitch->getOrCreateStateSet();
@@ -349,7 +349,7 @@ class CatchableObject : public osg::Referenced
*/ */
inline void setToGravity(float scale = 1.0f) { _acceleration.set(0, 0, -9.81f*scale); } inline void setToGravity(float scale = 1.0f) { _acceleration.set(0, 0, -9.81f*scale); }
/// Set the fluid parameters as for air (20<EFBFBD>C temperature). /// Set the fluid parameters as for air (20C temperature).
inline void setFluidToAir() inline void setFluidToAir()
{ {
setToGravity(1.0f); setToGravity(1.0f);
@@ -357,7 +357,7 @@ class CatchableObject : public osg::Referenced
setFluidViscosity(1.8e-5f); setFluidViscosity(1.8e-5f);
} }
/// Set the fluid parameters as for pure water (20<EFBFBD>C temperature). /// Set the fluid parameters as for pure water (20C temperature).
inline void setFluidToWater() inline void setFluidToWater()
{ {
setToGravity(1.0f); setToGravity(1.0f);
@@ -395,7 +395,7 @@ void CatchableObject::setUpCatchablesMap(const FileList& fileList)
++itr) ++itr)
{ {
const std::string& filename = *itr; const std::string& filename = *itr;
osg::Image* image = osgDB::readImageFile(filename); osg::ref_ptr<osg::Image> image = osgDB::readRefImageFile(filename);
if (image) if (image)
{ {
osg::ref_ptr<osg::StateSet> stateset = new osg::StateSet(); osg::ref_ptr<osg::StateSet> stateset = new osg::StateSet();
@@ -1045,10 +1045,10 @@ osg::Node* GameEventHandler::createScene()
// set up welcome subgraph // set up welcome subgraph
{ {
osg::Geode* geode = new osg::Geode; osg::ref_ptr<osg::Geode> geode = new osg::Geode;
// set up the background // set up the background
osg::Image* image = osgDB::readImageFile("Catch/Welcome.jpg"); osg::ref_ptr<osg::Image> image = osgDB::readRefImageFile("Catch/Welcome.jpg");
if (image) if (image)
{ {
osg::Geometry* geometry = osg::createTexturedQuadGeometry(_origin,_width,_height); osg::Geometry* geometry = osg::createTexturedQuadGeometry(_origin,_width,_height);
@@ -1121,9 +1121,9 @@ osg::Node* GameEventHandler::createScene()
// set up you've lost subgraph // set up you've lost subgraph
{ {
osg::Geode* geode = new osg::Geode; osg::ref_ptr<osg::Geode> geode = new osg::Geode;
osg::Image* image = osgDB::readImageFile("Catch/YouLost.jpg"); osg::ref_ptr<osg::Image> image = osgDB::readRefImageFile("Catch/YouLost.jpg");
if (image) if (image)
{ {
osg::Geometry* geometry = osg::createTexturedQuadGeometry(_origin,_width,_height); osg::Geometry* geometry = osg::createTexturedQuadGeometry(_origin,_width,_height);
@@ -1184,9 +1184,9 @@ osg::Node* GameEventHandler::createScene()
// set up you've won subgraph // set up you've won subgraph
{ {
osg::Geode* geode = new osg::Geode; osg::ref_ptr<osg::Geode> geode = new osg::Geode;
osg::Image* image = osgDB::readImageFile("Catch/YouWon.jpg"); osg::ref_ptr<osg::Image> image = osgDB::readRefImageFile("Catch/YouWon.jpg");
if (image) if (image)
{ {
osg::Geometry* geometry = osg::createTexturedQuadGeometry(_origin,_width,_height); osg::Geometry* geometry = osg::createTexturedQuadGeometry(_origin,_width,_height);
@@ -1269,7 +1269,7 @@ osg::Node* GameEventHandler::createScene()
++itr) ++itr)
{ {
osg::Image* image = osgDB::readImageFile(*itr); osg::ref_ptr<osg::Image> image = osgDB::readRefImageFile(*itr);
if (image) if (image)
{ {
osg::Geometry* geometry = osg::createTexturedQuadGeometry(_origin,_width,_height); osg::Geometry* geometry = osg::createTexturedQuadGeometry(_origin,_width,_height);

View File

@@ -40,10 +40,9 @@
#include <osgUtil/Optimizer> #include <osgUtil/Optimizer>
osg::Node* decorate_with_clip_node(osg::Node* subgraph) osg::ref_ptr<osg::Node> decorate_with_clip_node(const osg::ref_ptr<osg::Node>& subgraph)
{ {
osg::Group* rootnode = new osg::Group; osg::ref_ptr<osg::Group> rootnode = new osg::Group;
// create wireframe view of the model so the user can see // create wireframe view of the model so the user can see
// what parts are being culled away. // what parts are being culled away.
@@ -117,11 +116,11 @@ int main( int argc, char **argv )
osg::ArgumentParser arguments(&argc,argv); osg::ArgumentParser arguments(&argc,argv);
// load the nodes from the commandline arguments. // load the nodes from the commandline arguments.
osg::Node* loadedModel = osgDB::readNodeFiles(arguments); osg::ref_ptr<osg::Node> loadedModel = osgDB::readRefNodeFiles(arguments);
// if not loaded assume no arguments passed in, try use default mode instead. // if not loaded assume no arguments passed in, try use default mode instead.
if (!loadedModel) loadedModel = osgDB::readNodeFile("cow.osgt"); if (!loadedModel) loadedModel = osgDB::readRefNodeFile("cow.osgt");
if (!loadedModel) if (!loadedModel)
@@ -131,7 +130,7 @@ int main( int argc, char **argv )
} }
// decorate the scenegraph with a clip node. // decorate the scenegraph with a clip node.
osg::Node* rootnode = decorate_with_clip_node(loadedModel); osg::ref_ptr<osg::Node> rootnode = decorate_with_clip_node(loadedModel);
// run optimization over the scene graph // run optimization over the scene graph
osgUtil::Optimizer optimzer; osgUtil::Optimizer optimzer;

View File

@@ -45,6 +45,8 @@
#include <net/soioctl.h> #include <net/soioctl.h>
#elif defined(__CYGWIN__) #elif defined(__CYGWIN__)
#include <unistd.h> #include <unistd.h>
#elif defined (__GNU__)
#include <unistd.h>
#elif defined(__sun) #elif defined(__sun)
#include <unistd.h> #include <unistd.h>
#include <sys/sockio.h> #include <sys/sockio.h>

View File

@@ -505,7 +505,7 @@ int main( int argc, char **argv )
} }
// load model. // load model.
osg::ref_ptr<osg::Node> rootnode = osgDB::readNodeFiles(arguments); osg::ref_ptr<osg::Node> rootnode = osgDB::readRefNodeFiles(arguments);
// set the scene to render // set the scene to render
viewer.setSceneData(rootnode.get()); viewer.setSceneData(rootnode.get());

View File

@@ -122,7 +122,7 @@ void Receiver::sync( void )
return; return;
} }
#if defined(__linux) || defined(__FreeBSD__) || defined( __APPLE__ ) #if defined(__linux) || defined(__FreeBSD__) || defined( __APPLE__ ) || defined(__FreeBSD_kernel__) || defined(__GNU__)
socklen_t size; socklen_t size;
#else #else
int size; int size;

View File

@@ -133,7 +133,7 @@ int main( int argc, char **argv )
osg::ArgumentParser arguments(&argc,argv); osg::ArgumentParser arguments(&argc,argv);
// read the scene from the list of file specified commandline args. // read the scene from the list of file specified commandline args.
osg::ref_ptr<osg::Node> scene = osgDB::readNodeFiles(arguments); osg::ref_ptr<osg::Node> scene = osgDB::readRefNodeFiles(arguments);
if (!scene) if (!scene)
{ {
@@ -149,7 +149,7 @@ int main( int argc, char **argv )
{ {
osgViewer::View* view = new osgViewer::View; osgViewer::View* view = new osgViewer::View;
view->setName("Single view"); view->setName("Single view");
view->setSceneData(osgDB::readNodeFile("fountain.osgt")); view->setSceneData(osgDB::readRefNodeFile("fountain.osgt"));
view->addEventHandler( new osgViewer::StatsHandler ); view->addEventHandler( new osgViewer::StatsHandler );
@@ -283,7 +283,7 @@ int main( int argc, char **argv )
view->setName("View three"); view->setName("View three");
viewer.addView(view); viewer.addView(view);
view->setSceneData(osgDB::readNodeFile("cessnafire.osgt")); view->setSceneData(osgDB::readRefNodeFile("cessnafire.osgt"));
view->getCamera()->setName("Cam three"); view->getCamera()->setName("Cam three");
view->getCamera()->setProjectionMatrixAsPerspective(30.0, double(traits->width) / double(traits->height/2), 1.0, 1000.0); view->getCamera()->setProjectionMatrixAsPerspective(30.0, double(traits->width) / double(traits->height/2), 1.0, 1000.0);

View File

@@ -63,7 +63,7 @@ int main( int argc, char** argv )
// Create a node for outputting to the texture. // Create a node for outputting to the texture.
// It is OK to have just an empty node here, but seems inbuilt uniforms like osg_FrameTime won't work then. // It is OK to have just an empty node here, but seems inbuilt uniforms like osg_FrameTime won't work then.
// TODO: maybe we can have a custom drawable which also will implement glMemoryBarrier? // TODO: maybe we can have a custom drawable which also will implement glMemoryBarrier?
osg::Node* sourceNode = osgDB::readNodeFile("axes.osgt"); osg::ref_ptr<osg::Node> sourceNode = osgDB::readRefNodeFile("axes.osgt");
if ( !sourceNode ) sourceNode = new osg::Node; if ( !sourceNode ) sourceNode = new osg::Node;
sourceNode->setDataVariance( osg::Object::DYNAMIC ); sourceNode->setDataVariance( osg::Object::DYNAMIC );
sourceNode->getOrCreateStateSet()->setAttributeAndModes( computeProg.get() ); sourceNode->getOrCreateStateSet()->setAttributeAndModes( computeProg.get() );

View File

@@ -198,7 +198,7 @@ int main( int argc, char **argv )
osgViewer::Viewer viewer; osgViewer::Viewer viewer;
// load the nodes from the commandline arguments. // load the nodes from the commandline arguments.
osg::Node* rootnode = osgDB::readNodeFiles(arguments); osg::ref_ptr<osg::Node> rootnode = osgDB::readRefNodeFiles(arguments);
if (!rootnode) if (!rootnode)
{ {
osg::notify(osg::NOTICE)<<"Please specify a model filename on the command line."<<std::endl; osg::notify(osg::NOTICE)<<"Please specify a model filename on the command line."<<std::endl;

View File

@@ -95,10 +95,10 @@ int main(int argc, char *argv[])
osgViewer::Viewer viewer; osgViewer::Viewer viewer;
// load the nodes from the commandline arguments. // load the nodes from the commandline arguments.
osg::Node* rootnode = osgDB::readNodeFiles(arguments); osg::ref_ptr<osg::Node> rootnode = osgDB::readRefNodeFiles(arguments);
// if not loaded assume no arguments passed in, try use default mode instead. // if not loaded assume no arguments passed in, try use default mode instead.
if (!rootnode) rootnode = osgDB::readNodeFile("cessna.osgt"); if (!rootnode) rootnode = osgDB::readRefNodeFile("cessna.osgt");
if (!rootnode) if (!rootnode)
{ {
@@ -107,7 +107,7 @@ int main(int argc, char *argv[])
} }
// create specular highlights // create specular highlights
create_specular_highlights(rootnode); create_specular_highlights(rootnode.get());
// run optimization over the scene graph // run optimization over the scene graph
osgUtil::Optimizer optimzer; osgUtil::Optimizer optimzer;

View File

@@ -129,7 +129,7 @@ int main(int argc, char** argv)
// load the data // load the data
osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFile(file); osg::ref_ptr<osg::Node> loadedModel = osgDB::readRefNodeFile(file);
if (!loadedModel) if (!loadedModel)
{ {
std::cout << arguments.getApplicationName() <<": No data loaded" << std::endl; std::cout << arguments.getApplicationName() <<": No data loaded" << std::endl;

View File

@@ -224,7 +224,7 @@ public:
osg::StateSet *dstate= gm->getOrCreateStateSet( ); osg::StateSet *dstate= gm->getOrCreateStateSet( );
dstate->setMode( GL_LIGHTING, osg::StateAttribute::ON ); dstate->setMode( GL_LIGHTING, osg::StateAttribute::ON );
osg::Image* image = osgDB::readImageFile("Images/Brick-Std-Orange.TGA"); osg::ref_ptr<osg::Image> image = osgDB::readRefImageFile("Images/Brick-Std-Orange.TGA");
if (image) if (image)
{ {
osg::Texture2D* txt = new osg::Texture2D; osg::Texture2D* txt = new osg::Texture2D;
@@ -354,7 +354,7 @@ osg::Group *makedelaunay(const int ndcs)
osg::Vec3Array *points=new osg::Vec3Array; osg::Vec3Array *points=new osg::Vec3Array;
osg::Image* image = osgDB::readImageFile("Images/blueFlowers.png"); osg::ref_ptr<osg::Image> image = osgDB::readRefImageFile("Images/blueFlowers.png");
if (image) if (image)
{ {
osg::Texture2D* texture = new osg::Texture2D; osg::Texture2D* texture = new osg::Texture2D;
@@ -817,7 +817,7 @@ osg::Geometry *WallConstraint::makeWallGeometry() const
{ {
osg::ref_ptr<osg::Geometry> gm=new osg::Geometry; // the wall osg::ref_ptr<osg::Geometry> gm=new osg::Geometry; // the wall
if (texture!="") { if (texture!="") {
osg::Image* image = osgDB::readImageFile(texture.c_str()); osg::ref_ptr<osg::Image> image = osgDB::readRefImageFile(texture.c_str());
if (image) if (image)
{ {
osg::Texture2D* txt = new osg::Texture2D; osg::Texture2D* txt = new osg::Texture2D;
@@ -1005,7 +1005,7 @@ deprecated_osg::Geometry *ArealConstraint::makeWallGeometry( osg::Vec3Array *pt)
tscx->retessellatePolygons(*(edges)); // find all edges tscx->retessellatePolygons(*(edges)); // find all edges
if (walltexture!="") { if (walltexture!="") {
osg::Image* image = osgDB::readImageFile(walltexture.c_str()); osg::ref_ptr<osg::Image> image = osgDB::readRefImageFile(walltexture.c_str());
if (image) if (image)
{ {
osg::Texture2D* txt = new osg::Texture2D; osg::Texture2D* txt = new osg::Texture2D;
@@ -1062,7 +1062,7 @@ deprecated_osg::Geometry * ArealConstraint::makeAreal( osg::Vec3Array *points)
gm->setNormalArray(getCanopyNormals(points)); gm->setNormalArray(getCanopyNormals(points));
gm->setNormalBinding(deprecated_osg::Geometry::BIND_PER_PRIMITIVE); gm->setNormalBinding(deprecated_osg::Geometry::BIND_PER_PRIMITIVE);
gm->setTexCoordArray(0,getCanopyTexcoords(points)); gm->setTexCoordArray(0,getCanopyTexcoords(points));
osg::Image* image = osgDB::readImageFile(texture); osg::ref_ptr<osg::Image> image = osgDB::readRefImageFile(texture);
if (image) if (image)
{ {
osg::Texture2D* txt = new osg::Texture2D; osg::Texture2D* txt = new osg::Texture2D;
@@ -1238,7 +1238,7 @@ deprecated_osg::Geometry * LinearConstraint::makeGeometry(const osg::Vec3Array *
if (_midline->size()>0) { if (_midline->size()>0) {
osg::ref_ptr<osg::Vec3Array> locpts=getPoints(points); osg::ref_ptr<osg::Vec3Array> locpts=getPoints(points);
if (texture!="") { if (texture!="") {
osg::Image* image = osgDB::readImageFile(texture.c_str()); osg::ref_ptr<osg::Image> image = osgDB::readRefImageFile(texture.c_str());
if (image) if (image)
{ {
osg::Texture2D* txt = new osg::Texture2D; osg::Texture2D* txt = new osg::Texture2D;

View File

@@ -139,7 +139,7 @@ int main( int argc, char **argv )
bool needToSetHomePosition = false; bool needToSetHomePosition = false;
// read the scene from the list of file specified commandline args. // read the scene from the list of file specified commandline args.
osg::ref_ptr<osg::Node> scene = osgDB::readNodeFiles(arguments); osg::ref_ptr<osg::Node> scene = osgDB::readRefNodeFiles(arguments);
// if one hasn't been loaded create an earth and sun test model. // if one hasn't been loaded create an earth and sun test model.
if (!scene) if (!scene)

View File

@@ -232,7 +232,7 @@ int main( int argc, char **argv )
viewer.getCamera()->setComputeNearFarMode(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR); viewer.getCamera()->setComputeNearFarMode(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR);
// read the model to do depth peeling with // read the model to do depth peeling with
osg::Node* loadedModel = osgDB::readNodeFile(arguments.argv()[1]); osg::ref_ptr<osg::Node> loadedModel = osgDB::readRefNodeFile(arguments.argv()[1]);
if (!loadedModel) if (!loadedModel)
return 1; return 1;

View File

@@ -703,10 +703,10 @@ int main(int argc, char** argv)
osgViewer::Viewer viewer(arguments); osgViewer::Viewer viewer(arguments);
// load the nodes from the commandline arguments. // load the nodes from the commandline arguments.
osg::Node* loadedModel = osgDB::readNodeFiles(arguments); osg::ref_ptr<osg::Node> loadedModel = osgDB::readRefNodeFiles(arguments);
// if not loaded assume no arguments passed in, try use default mode instead. // if not loaded assume no arguments passed in, try use default mode instead.
if (!loadedModel) loadedModel = osgDB::readNodeFile("cow.osgt"); if (!loadedModel) loadedModel = osgDB::readRefNodeFile("cow.osgt");
if (!loadedModel) if (!loadedModel)
{ {
@@ -731,7 +731,7 @@ int main(int argc, char** argv)
} }
else else
{ {
osg::Node* distortionNode = createDistortionSubgraph( options, loadedModel, viewer.getCamera()->getClearColor()); osg::Node* distortionNode = createDistortionSubgraph( options, loadedModel.get(), viewer.getCamera()->getClearColor());
viewer.setSceneData( distortionNode ); viewer.setSceneData( distortionNode );
} }

View File

@@ -97,7 +97,7 @@ createStateSet()
ss->setAttribute( program.get(), ss->setAttribute( program.get(),
osg::StateAttribute::ON | osg::StateAttribute::PROTECTED ); osg::StateAttribute::ON | osg::StateAttribute::PROTECTED );
osg::ref_ptr< osg::Image> iLogo = osgDB::readImageFile( "Images/osg128.png" ); osg::ref_ptr< osg::Image> iLogo = osgDB::readRefImageFile( "Images/osg128.png" );
if( !iLogo.valid() ) if( !iLogo.valid() )
{ {
osg::notify( osg::ALWAYS ) << "Can't open image file osg128.png" << std::endl; osg::notify( osg::ALWAYS ) << "Can't open image file osg128.png" << std::endl;

View File

@@ -51,7 +51,7 @@ osg::Node* createEarth()
geode->addDrawable(sd); geode->addDrawable(sd);
std::string filename = osgDB::findDataFile("Images/land_shallow_topo_2048.jpg"); std::string filename = osgDB::findDataFile("Images/land_shallow_topo_2048.jpg");
geode->getOrCreateStateSet()->setTextureAttributeAndModes(0, new osg::Texture2D(osgDB::readImageFile(filename))); geode->getOrCreateStateSet()->setTextureAttributeAndModes(0, new osg::Texture2D(osgDB::readRefImageFile(filename)));
osg::CoordinateSystemNode* csn = new osg::CoordinateSystemNode; osg::CoordinateSystemNode* csn = new osg::CoordinateSystemNode;
csn->setEllipsoidModel(new osg::EllipsoidModel()); csn->setEllipsoidModel(new osg::EllipsoidModel());

View File

@@ -62,7 +62,7 @@ osgText::Text* createLabel(const std::string& l, const char* f, unsigned int siz
static osg::Vec3 pos(10.0f, 10.0f, 0.0f); static osg::Vec3 pos(10.0f, 10.0f, 0.0f);
osgText::Text* label = new osgText::Text(); osgText::Text* label = new osgText::Text();
osgText::Font* font = osgText::readFontFile(f); osg::ref_ptr<osgText::Font> font = osgText::readRefFontFile(f);
label->setFont(font); label->setFont(font);
label->setCharacterSize(size); label->setCharacterSize(size);

View File

@@ -388,7 +388,7 @@ osg::Geode* ForestTechniqueManager::createTerrain(const osg::Vec3& origin, const
// --------------------------------------- // ---------------------------------------
osg::StateSet* stateset = new osg::StateSet(); osg::StateSet* stateset = new osg::StateSet();
osg::Image* image = osgDB::readImageFile("Images/lz.rgb"); osg::ref_ptr<osg::Image> image = osgDB::readRefImageFile("Images/lz.rgb");
if (image) if (image)
{ {
osg::Texture2D* texture = new osg::Texture2D; osg::Texture2D* texture = new osg::Texture2D;
@@ -1182,7 +1182,7 @@ osg::Node* ForestTechniqueManager::createScene(unsigned int numTreesToCreates, u
osg::Texture2D *tex = new osg::Texture2D; osg::Texture2D *tex = new osg::Texture2D;
tex->setWrap( osg::Texture2D::WRAP_S, osg::Texture2D::CLAMP ); tex->setWrap( osg::Texture2D::WRAP_S, osg::Texture2D::CLAMP );
tex->setWrap( osg::Texture2D::WRAP_T, osg::Texture2D::CLAMP ); tex->setWrap( osg::Texture2D::WRAP_T, osg::Texture2D::CLAMP );
tex->setImage(osgDB::readImageFile("Images/tree0.rgba")); tex->setImage(osgDB::readRefImageFile("Images/tree0.rgba"));
osg::StateSet *dstate = new osg::StateSet; osg::StateSet *dstate = new osg::StateSet;
{ {

View File

@@ -963,7 +963,7 @@ int main(int argc, char **argv)
arguments.getApplicationUsage()->write(std::cout,osg::ApplicationUsage::COMMAND_LINE_OPTION); arguments.getApplicationUsage()->write(std::cout,osg::ApplicationUsage::COMMAND_LINE_OPTION);
return 1; return 1;
} }
ref_ptr<Node> loadedModel = osgDB::readNodeFiles(arguments); ref_ptr<Node> loadedModel = osgDB::readRefNodeFiles(arguments);
if (!loadedModel) { if (!loadedModel) {
cerr << "couldn't load " << argv[1] << "\n"; cerr << "couldn't load " << argv[1] << "\n";
return 1; return 1;

View File

@@ -175,10 +175,10 @@ protected:
float zPos = -0.1; // note from Robert, was 0.1f, but now must be -0.1f to keep text visible??#!? due float zPos = -0.1; // note from Robert, was 0.1f, but now must be -0.1f to keep text visible??#!? due
// to some other change in the OSG not tracked down yet... // to some other change in the OSG not tracked down yet...
osg::ref_ptr<osgText::Font> arial = osgText::readFontFile("fonts/arial.ttf"); osg::ref_ptr<osgText::Font> arial = osgText::readRefFontFile("fonts/arial.ttf");
osg::ref_ptr<osgText::Text> hints = new osgText::Text; osg::ref_ptr<osgText::Text> hints = new osgText::Text;
hints->setFont(arial.get()); hints->setFont(arial);
hints->setColor(_hints_color); hints->setColor(_hints_color);
hints->setAlignment(osgText::Text::CENTER_BOTTOM); hints->setAlignment(osgText::Text::CENTER_BOTTOM);
hints->setCharacterSize(13); hints->setCharacterSize(13);
@@ -336,10 +336,10 @@ int main(int argc, char *argv[])
} }
// read the scene from the list of file specified commandline args. // read the scene from the list of file specified commandline args.
osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments); osg::ref_ptr<osg::Node> loadedModel = osgDB::readRefNodeFiles(arguments);
// if not loaded assume no arguments passed in, try use default mode instead. // if not loaded assume no arguments passed in, try use default mode instead.
if (!loadedModel) loadedModel = osgDB::readNodeFile("dumptruck.osgt"); if (!loadedModel) loadedModel = osgDB::readRefNodeFile("dumptruck.osgt");
if (!loadedModel) if (!loadedModel)
{ {

View File

@@ -117,14 +117,14 @@ int main(int argc, char *argv[])
} }
// load the image // load the image
osg::ref_ptr<osg::Image> startIm = osgDB::readImageFile(startName); osg::ref_ptr<osg::Image> startIm = osgDB::readRefImageFile(startName);
if (!startIm) { if (!startIm) {
std::cout << "Could not load start image.\n"; std::cout << "Could not load start image.\n";
return(1); return(1);
} }
osg::Node* scene = createScene(startIm.get()); osg::ref_ptr<osg::Node> scene = createScene(startIm.get());
// construct the viewer. // construct the viewer.
osgViewer::Viewer viewer; osgViewer::Viewer viewer;

View File

@@ -550,7 +550,7 @@ osg::Node* createBackground()
{ {
// we'll create a texture mapped quad to sit behind the Geometry // we'll create a texture mapped quad to sit behind the Geometry
osg::Image* image = osgDB::readImageFile("Images/primitives.gif"); osg::ref_ptr<osg::Image> image = osgDB::readRefImageFile("Images/primitives.gif");
if (!image) return NULL; if (!image) return NULL;

View File

@@ -434,8 +434,8 @@ int main(int argv, char **argc)
osg::ref_ptr<osg::Group> group = new osg::Group; osg::ref_ptr<osg::Group> group = new osg::Group;
osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments); osg::ref_ptr<osg::Node> loadedModel = osgDB::readRefNodeFiles(arguments);
if (loadedModel.valid()) group->addChild(loadedModel.get()); if (loadedModel.valid()) group->addChild(loadedModel);
for(Tracks::iterator itr = tracks.begin(); for(Tracks::iterator itr = tracks.begin();
itr != tracks.end(); itr != tracks.end();

View File

@@ -52,12 +52,12 @@ int main(int argc, char** argv)
osgViewer::Viewer viewer(arguments); osgViewer::Viewer viewer(arguments);
osg::ref_ptr<osg::Node> node = osgDB::readNodeFiles(arguments); osg::ref_ptr<osg::Node> node = osgDB::readRefNodeFiles(arguments);
if (!node) return 0; if (!node) return 0;
osg::ref_ptr<osg::GraphicsCostEstimator> gce = new osg::GraphicsCostEstimator; osg::ref_ptr<osg::GraphicsCostEstimator> gce = new osg::GraphicsCostEstimator;
viewer.setSceneData(node.get()); viewer.setSceneData(node);
viewer.realize(); viewer.realize();

View File

@@ -67,7 +67,7 @@ Node *makeBase( void )
Texture2D *tex = new Texture2D; Texture2D *tex = new Texture2D;
tex->setImage(osgDB::readImageFile("Images/water.rgb")); tex->setImage(osgDB::readRefImageFile("Images/water.rgb"));
tex->setWrap( Texture2D::WRAP_S, Texture2D::REPEAT ); tex->setWrap( Texture2D::WRAP_S, Texture2D::REPEAT );
tex->setWrap( Texture2D::WRAP_T, Texture2D::REPEAT ); tex->setWrap( Texture2D::WRAP_T, Texture2D::REPEAT );

View File

@@ -112,7 +112,7 @@ Node *makeSky( void )
Texture2D *tex = new Texture2D; Texture2D *tex = new Texture2D;
tex->setImage(osgDB::readImageFile("Images/white.rgb")); tex->setImage(osgDB::readRefImageFile("Images/white.rgb"));
StateSet *dstate = new StateSet; StateSet *dstate = new StateSet;

View File

@@ -171,7 +171,7 @@ Node *makeTank( void )
tex->setWrap( Texture2D::WRAP_S, Texture2D::REPEAT ); tex->setWrap( Texture2D::WRAP_S, Texture2D::REPEAT );
tex->setWrap( Texture2D::WRAP_T, Texture2D::REPEAT ); tex->setWrap( Texture2D::WRAP_T, Texture2D::REPEAT );
tex->setImage(osgDB::readImageFile("Images/tank.rgb")); tex->setImage(osgDB::readRefImageFile("Images/tank.rgb"));
StateSet *dstate = new StateSet; StateSet *dstate = new StateSet;
dstate->setTextureAttributeAndModes(0, tex, StateAttribute::ON ); dstate->setTextureAttributeAndModes(0, tex, StateAttribute::ON );

View File

@@ -131,7 +131,7 @@ Node *makeTerrain( void )
Texture2D *tex = new Texture2D; Texture2D *tex = new Texture2D;
tex->setImage(osgDB::readImageFile("Images/lz.rgb")); tex->setImage(osgDB::readRefImageFile("Images/lz.rgb"));
StateSet *dstate = new StateSet; StateSet *dstate = new StateSet;
dstate->setMode( GL_LIGHTING, StateAttribute::OFF ); dstate->setMode( GL_LIGHTING, StateAttribute::OFF );

View File

@@ -234,7 +234,7 @@ Node *makeTrees( void )
struct _tree *t; struct _tree *t;
Texture2D *tex = new Texture2D; Texture2D *tex = new Texture2D;
tex->setImage(osgDB::readImageFile("Images/tree0.rgba")); tex->setImage(osgDB::readRefImageFile("Images/tree0.rgba"));
StateSet *dstate = new StateSet; StateSet *dstate = new StateSet;

View File

@@ -284,10 +284,10 @@ int main( int argc, char **argv )
// read the scene from the list of file specified commandline args. // read the scene from the list of file specified commandline args.
osg::ref_ptr<osg::Node> scene = osgDB::readNodeFiles(arguments); osg::ref_ptr<osg::Node> scene = osgDB::readRefNodeFiles(arguments);
// if not loaded assume no arguments passed in, try use default model instead. // if not loaded assume no arguments passed in, try use default model instead.
if (!scene) scene = osgDB::readNodeFile("dumptruck.osgt"); if (!scene) scene = osgDB::readRefNodeFile("dumptruck.osgt");
if (!scene) if (!scene)
@@ -320,7 +320,7 @@ int main( int argc, char **argv )
viewer.addSlave(hudCamera, false); viewer.addSlave(hudCamera, false);
// set the scene to render // set the scene to render
viewer.setSceneData(scene.get()); viewer.setSceneData(scene);
return viewer.run(); return viewer.run();
@@ -334,7 +334,7 @@ int main( int argc, char **argv )
osgViewer::View* view = new osgViewer::View; osgViewer::View* view = new osgViewer::View;
viewer.addView(view); viewer.addView(view);
view->setSceneData(scene.get()); view->setSceneData(scene);
view->setUpViewAcrossAllScreens();; view->setUpViewAcrossAllScreens();;
view->setCameraManipulator(new osgGA::TrackballManipulator); view->setCameraManipulator(new osgGA::TrackballManipulator);
@@ -375,11 +375,11 @@ int main( int argc, char **argv )
osg::ref_ptr<osg::Group> group = new osg::Group; osg::ref_ptr<osg::Group> group = new osg::Group;
// add the HUD subgraph. // add the HUD subgraph.
if (scene.valid()) group->addChild(scene.get()); if (scene.valid()) group->addChild(scene);
group->addChild(createHUD()); group->addChild(createHUD());
// set the scene to render // set the scene to render
viewer.setSceneData(group.get()); viewer.setSceneData(group);
return viewer.run(); return viewer.run();
} }

View File

@@ -111,7 +111,7 @@ osg::StateSet* createState(osg::ArgumentParser& arguments)
const std::string& filename = *itr; const std::string& filename = *itr;
if (preLoad) if (preLoad)
{ {
osg::ref_ptr<osg::Image> image = osgDB::readImageFile(filename); osg::ref_ptr<osg::Image> image = osgDB::readRefImageFile(filename);
if (image.valid()) if (image.valid())
{ {
imageSequence->addImage(image.get()); imageSequence->addImage(image.get());
@@ -144,12 +144,12 @@ osg::StateSet* createState(osg::ArgumentParser& arguments)
{ {
imageSequence->setLength(4.0); imageSequence->setLength(4.0);
} }
imageSequence->addImage(osgDB::readImageFile("Cubemap_axis/posx.png")); imageSequence->addImage(osgDB::readRefImageFile("Cubemap_axis/posx.png"));
imageSequence->addImage(osgDB::readImageFile("Cubemap_axis/negx.png")); imageSequence->addImage(osgDB::readRefImageFile("Cubemap_axis/negx.png"));
imageSequence->addImage(osgDB::readImageFile("Cubemap_axis/posy.png")); imageSequence->addImage(osgDB::readRefImageFile("Cubemap_axis/posy.png"));
imageSequence->addImage(osgDB::readImageFile("Cubemap_axis/negy.png")); imageSequence->addImage(osgDB::readRefImageFile("Cubemap_axis/negy.png"));
imageSequence->addImage(osgDB::readImageFile("Cubemap_axis/posz.png")); imageSequence->addImage(osgDB::readRefImageFile("Cubemap_axis/posz.png"));
imageSequence->addImage(osgDB::readImageFile("Cubemap_axis/negz.png")); imageSequence->addImage(osgDB::readRefImageFile("Cubemap_axis/negz.png"));
} }
// start the image sequence playing // start the image sequence playing

View File

@@ -244,7 +244,7 @@ int main( int argc, char **argv )
// load the nodes from the commandline arguments. // load the nodes from the commandline arguments.
osg::ref_ptr<osg::Node> model = osgDB::readNodeFiles(arguments); osg::ref_ptr<osg::Node> model = osgDB::readRefNodeFiles(arguments);
if (model) if (model)
{ {
// the osgSim::InsertImpostorsVisitor used lower down to insert impostors // the osgSim::InsertImpostorsVisitor used lower down to insert impostors
@@ -280,7 +280,7 @@ int main( int argc, char **argv )
// on it right now as it requires a getRoots() method to be added to // on it right now as it requires a getRoots() method to be added to
// osg::Node, and we're about to make a release so no new features! // osg::Node, and we're about to make a release so no new features!
osg::ref_ptr<osg::Group> rootnode = new osg::Group; osg::ref_ptr<osg::Group> rootnode = new osg::Group;
rootnode->addChild(model.get()); rootnode->addChild(model);
// now insert impostors in the model using the InsertImpostorsVisitor. // now insert impostors in the model using the InsertImpostorsVisitor.
@@ -304,7 +304,7 @@ int main( int argc, char **argv )
} }
// add model to viewer. // add model to viewer.
viewer.setSceneData(model.get()); viewer.setSceneData(model);
return viewer.run(); return viewer.run();
} }

View File

@@ -38,7 +38,7 @@ struct MyReadCallback : public osgUtil::IntersectionVisitor::ReadCallback
{ {
virtual osg::Node* readNodeFile(const std::string& filename) virtual osg::Node* readNodeFile(const std::string& filename)
{ {
return osgDB::readNodeFile(filename); return osgDB::readRefNodeFile(filename).release();
} }
}; };
@@ -48,7 +48,7 @@ int main(int argc, char **argv)
// use an ArgumentParser object to manage the program arguments. // use an ArgumentParser object to manage the program arguments.
osg::ArgumentParser arguments(&argc,argv); osg::ArgumentParser arguments(&argc,argv);
osg::ref_ptr<osg::Node> scene = osgDB::readNodeFiles(arguments); osg::ref_ptr<osg::Node> scene = osgDB::readRefNodeFiles(arguments);
if (!scene) if (!scene)
{ {

View File

@@ -56,7 +56,7 @@ int main(int argc, char **argv)
osgDB::Registry::instance()->setBuildKdTreesHint(osgDB::ReaderWriter::Options::BUILD_KDTREES); osgDB::Registry::instance()->setBuildKdTreesHint(osgDB::ReaderWriter::Options::BUILD_KDTREES);
osg::ref_ptr<osg::Node> scene = osgDB::readNodeFiles(arguments); osg::ref_ptr<osg::Node> scene = osgDB::readRefNodeFiles(arguments);
if (!scene) if (!scene)
{ {
@@ -65,6 +65,6 @@ int main(int argc, char **argv)
} }
osgViewer::Viewer viewer; osgViewer::Viewer viewer;
viewer.setSceneData(scene.get()); viewer.setSceneData(scene);
return viewer.run(); return viewer.run();
} }

View File

@@ -341,10 +341,10 @@ int main( int argc, char **argv )
osg::ref_ptr<osg::Node> loadedModel; osg::ref_ptr<osg::Node> loadedModel;
// load the scene. // load the scene.
if (argc>1) loadedModel = osgDB::readNodeFile(argv[1]); if (argc>1) loadedModel = osgDB::readRefNodeFile(argv[1]);
// if not loaded assume no arguments passed in, try use default mode instead. // if not loaded assume no arguments passed in, try use default mode instead.
if (!loadedModel) loadedModel = osgDB::readNodeFile("dumptruck.osgt"); if (!loadedModel) loadedModel = osgDB::readRefNodeFile("dumptruck.osgt");
if (!loadedModel) if (!loadedModel)
{ {
@@ -374,7 +374,7 @@ int main( int argc, char **argv )
osgViewer::Viewer viewer; osgViewer::Viewer viewer;
viewer.getCamera()->setGraphicsContext(gc.get()); viewer.getCamera()->setGraphicsContext(gc.get());
viewer.getCamera()->setViewport(0,0,800,600); viewer.getCamera()->setViewport(0,0,800,600);
viewer.setSceneData(loadedModel.get()); viewer.setSceneData(loadedModel);
// create a tracball manipulator to move the camera around in response to keyboard/mouse events // create a tracball manipulator to move the camera around in response to keyboard/mouse events
viewer.setCameraManipulator( new osgGA::TrackballManipulator ); viewer.setCameraManipulator( new osgGA::TrackballManipulator );

View File

@@ -45,7 +45,7 @@ int main( int argc, char **argv )
osg::DisplaySettings* ds = viewer.getDisplaySettings() ? viewer.getDisplaySettings() : osg::DisplaySettings::instance().get(); osg::DisplaySettings* ds = viewer.getDisplaySettings() ? viewer.getDisplaySettings() : osg::DisplaySettings::instance().get();
ds->readCommandLine(arguments); ds->readCommandLine(arguments);
osg::ref_ptr<osg::Node> model = osgDB::readNodeFiles(arguments); osg::ref_ptr<osg::Node> model = osgDB::readRefNodeFiles(arguments);
if (!model) if (!model)
{ {
@@ -57,7 +57,7 @@ int main( int argc, char **argv )
OSG_NOTICE<<"Stereo "<<ds->getStereo()<<std::endl; OSG_NOTICE<<"Stereo "<<ds->getStereo()<<std::endl;
OSG_NOTICE<<"StereoMode "<<ds->getStereoMode()<<std::endl; OSG_NOTICE<<"StereoMode "<<ds->getStereoMode()<<std::endl;
viewer.setSceneData(model.get()); viewer.setSceneData(model);
// add the state manipulator // add the state manipulator
viewer.addEventHandler( new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()) ); viewer.addEventHandler( new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()) );

View File

@@ -291,7 +291,7 @@ void SetObjectTextureState(osg::Geode *geodeCurrent, std::string texture)
osg::StateSet* stateTexture = geodeCurrent->getOrCreateStateSet(); osg::StateSet* stateTexture = geodeCurrent->getOrCreateStateSet();
// load texture.jpg as an image // load texture.jpg as an image
osg::Image* imgTexture = osgDB::readImageFile( texture ); osg::ref_ptr<osg::Image> imgTexture = osgDB::readRefImageFile( texture );
// if the image is successfully loaded // if the image is successfully loaded
if (imgTexture) if (imgTexture)

View File

@@ -226,7 +226,7 @@ osg::Geometry* createWall(const osg::Vec3& v1,const osg::Vec3& v2,const osg::Vec
} }
osg::Node* createRoom(osg::Node* loadedModel) osg::ref_ptr<osg::Node> createRoom(const osg::ref_ptr<osg::Node>& loadedModel)
{ {
// default scale for this model. // default scale for this model.
osg::BoundingSphere bs(osg::Vec3(0.0f,0.0f,0.0f),1.0f); osg::BoundingSphere bs(osg::Vec3(0.0f,0.0f,0.0f),1.0f);
@@ -323,20 +323,20 @@ int main( int argc, char **argv )
osgViewer::Viewer viewer; osgViewer::Viewer viewer;
// load the nodes from the commandline arguments. // load the nodes from the commandline arguments.
osg::Node* loadedModel = osgDB::readNodeFiles(arguments); osg::ref_ptr<osg::Node> loadedModel = osgDB::readRefNodeFiles(arguments);
// if not loaded assume no arguments passed in, try use default mode instead. // if not loaded assume no arguments passed in, try use default mode instead.
if (!loadedModel) loadedModel = osgDB::readNodeFile("glider.osgt"); if (!loadedModel) loadedModel = osgDB::readRefNodeFile("glider.osgt");
// create a room made of foor walls, a floor, a roof, and swinging light fitting. // create a room made of foor walls, a floor, a roof, and swinging light fitting.
osg::Node* rootnode = createRoom(loadedModel); osg::ref_ptr<osg::Node> rootnode = createRoom(loadedModel);
// run optimization over the scene graph // run optimization over the scene graph
osgUtil::Optimizer optimzer; osgUtil::Optimizer optimzer;
optimzer.optimize(rootnode); optimzer.optimize(rootnode);
// add a viewport to the viewer and attach the scene graph. // add a viewport to the viewer and attach the scene graph.
viewer.setSceneData( rootnode ); viewer.setSceneData(rootnode);
// create the windows and run the threads. // create the windows and run the threads.

View File

@@ -129,7 +129,7 @@ osg::Node* createLightPointsDatabase()
// Set point sprite texture in LightPointNode StateSet. // Set point sprite texture in LightPointNode StateSet.
osg::Texture2D *tex = new osg::Texture2D(); osg::Texture2D *tex = new osg::Texture2D();
tex->setImage(osgDB::readImageFile("Images/particle.rgb")); tex->setImage(osgDB::readRefImageFile("Images/particle.rgb"));
set->setTextureAttributeAndModes(0, tex, osg::StateAttribute::ON); set->setTextureAttributeAndModes(0, tex, osg::StateAttribute::ON);
} }
@@ -232,7 +232,7 @@ int main( int argc, char **argv )
osg::Group* rootnode = new osg::Group; osg::Group* rootnode = new osg::Group;
// load the nodes from the commandline arguments. // load the nodes from the commandline arguments.
rootnode->addChild(osgDB::readNodeFiles(arguments)); rootnode->addChild(osgDB::readRefNodeFiles(arguments));
rootnode->addChild(createLightPointsDatabase()); rootnode->addChild(createLightPointsDatabase());
rootnode->addChild(CreateBlinkSequenceLightNode()); rootnode->addChild(CreateBlinkSequenceLightNode());

View File

@@ -142,10 +142,10 @@ int main( int argc, char **argv )
osg::ArgumentParser arguments(&argc,argv); osg::ArgumentParser arguments(&argc,argv);
// load the nodes from the commandline arguments. // load the nodes from the commandline arguments.
osg::Node* loadedModel = osgDB::readNodeFiles(arguments); osg::ref_ptr<osg::Node> loadedModel = osgDB::readRefNodeFiles(arguments);
// if not loaded assume no arguments passed in, try use default mode instead. // if not loaded assume no arguments passed in, try use default mode instead.
if (!loadedModel) loadedModel = osgDB::readNodeFile("glider.osgt"); if (!loadedModel) loadedModel = osgDB::readRefNodeFile("glider.osgt");
if (!loadedModel) if (!loadedModel)
{ {
@@ -153,11 +153,11 @@ int main( int argc, char **argv )
return 1; return 1;
} }
osg::Group* root = new osg::Group; osg::ref_ptr<osg::Group> root = new osg::Group;
root->addChild(loadedModel); root->addChild(loadedModel);
osg::StateSet* stateset = new osg::StateSet; osg::ref_ptr<osg::StateSet> stateset = new osg::StateSet;
osg::LogicOp* logicOp = new osg::LogicOp(osg::LogicOp::OR_INVERTED); osg::ref_ptr<osg::LogicOp> logicOp = new osg::LogicOp(osg::LogicOp::OR_INVERTED);
stateset->setAttributeAndModes(logicOp,osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON); stateset->setAttributeAndModes(logicOp,osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON);
@@ -170,7 +170,7 @@ int main( int argc, char **argv )
// construct the viewer. // construct the viewer.
osgViewer::Viewer viewer; osgViewer::Viewer viewer;
viewer.addEventHandler(new TechniqueEventHandler(logicOp)); viewer.addEventHandler(new TechniqueEventHandler(logicOp.get()));
// run optimization over the scene graph // run optimization over the scene graph
osgUtil::Optimizer optimzer; osgUtil::Optimizer optimzer;

View File

@@ -234,7 +234,7 @@ osg:: Node* createGlobe(const osg::BoundingBox& bb,float ratio, const std::strin
osg::MatrixTransform* xform = new osg::MatrixTransform; osg::MatrixTransform* xform = new osg::MatrixTransform;
xform->setUpdateCallback(new osg::AnimationPathCallback(bb.center(),osg::Vec3(0.0f,0.0f,1.0f),osg::inDegrees(10.0f))); xform->setUpdateCallback(new osg::AnimationPathCallback(bb.center(),osg::Vec3(0.0f,0.0f,1.0f),osg::inDegrees(10.0f)));
osg::Node* bluemarble = filename.empty() ? 0 : osgDB::readNodeFile(filename.c_str()); osg::ref_ptr<osg::Node> bluemarble = filename.empty() ? 0 : osgDB::readRefNodeFile(filename.c_str());
if (bluemarble) if (bluemarble)
{ {
const osg::BoundingSphere& bs = bluemarble->getBound(); const osg::BoundingSphere& bs = bluemarble->getBound();
@@ -252,7 +252,7 @@ osg:: Node* createGlobe(const osg::BoundingBox& bb,float ratio, const std::strin
osg::StateSet* stateset = geode->getOrCreateStateSet(); osg::StateSet* stateset = geode->getOrCreateStateSet();
osg::Image* image = osgDB::readImageFile("Images/land_shallow_topo_2048.jpg"); osg::ref_ptr<osg::Image> image = osgDB::readRefImageFile("Images/land_shallow_topo_2048.jpg");
if (image) if (image)
{ {
osg::Texture2D* texture = new osg::Texture2D; osg::Texture2D* texture = new osg::Texture2D;

View File

@@ -453,7 +453,7 @@ int main( int argc, char **argv )
osg::Timer_t start_tick = osg::Timer::instance()->tick(); osg::Timer_t start_tick = osg::Timer::instance()->tick();
// read the scene from the list of file specified command line args. // read the scene from the list of file specified command line args.
osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments); osg::ref_ptr<osg::Node> loadedModel = osgDB::readRefNodeFiles(arguments);
// if no model has been successfully loaded report failure. // if no model has been successfully loaded report failure.
bool tragger2Scene(true); bool tragger2Scene(true);
@@ -481,14 +481,14 @@ int main( int argc, char **argv )
// optimize the scene graph, remove redundant nodes and state etc. // optimize the scene graph, remove redundant nodes and state etc.
osgUtil::Optimizer optimizer; osgUtil::Optimizer optimizer;
optimizer.optimize(loadedModel.get()); optimizer.optimize(loadedModel);
// pass the loaded scene graph to the viewer. // pass the loaded scene graph to the viewer.
if ( tragger2Scene ) { if ( tragger2Scene ) {
viewer.setSceneData(addDraggerToScene(loadedModel.get(), dragger_name, fixedSizeInScreen)); viewer.setSceneData(addDraggerToScene(loadedModel.get(), dragger_name, fixedSizeInScreen));
} else { } else {
viewer.setSceneData(loadedModel.get()); viewer.setSceneData(loadedModel);
} }

View File

@@ -96,10 +96,10 @@ int main( int argc, char **argv )
arguments.read("-P", persistence) || arguments.read("--persistence", persistence); arguments.read("-P", persistence) || arguments.read("--persistence", persistence);
// read the scene from the list of file specified commandline args. // read the scene from the list of file specified commandline args.
osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments); osg::ref_ptr<osg::Node> loadedModel = osgDB::readRefNodeFiles(arguments);
// if not loaded assume no arguments passed in, try use default mode instead. // if not loaded assume no arguments passed in, try use default mode instead.
if (!loadedModel) loadedModel = osgDB::readNodeFile("cow.osgt"); if (!loadedModel) loadedModel = osgDB::readRefNodeFile("cow.osgt");
// if no model has been successfully loaded report failure. // if no model has been successfully loaded report failure.
if (!loadedModel) if (!loadedModel)

View File

@@ -469,23 +469,46 @@ int main(int argc, char** argv)
{ {
//useTextureRectangle = false; //useTextureRectangle = false;
static const char *shaderSourceTextureRec = { static const char *shaderSourceTextureVertex = {
"uniform vec4 cutoff_color;\n" "#ifdef GL_ES\n"
"uniform samplerRect movie_texture;\n" " precision highp float;\n"
" precision highp int;\n"
"#endif\n"
"varying vec4 texcoord;\n"
"void main(void)\n" "void main(void)\n"
"{\n" "{\n"
" vec4 texture_color = textureRect(movie_texture, gl_TexCoord[0].st); \n" " texcoord = gl_MultiTexCoord0; \n"
" gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n"
"}\n"
};
static const char *shaderSourceTextureRec = {
"#ifdef GL_ES\n"
" precision highp float;\n"
" precision highp int;\n"
"#endif\n"
"uniform vec4 cutoff_color;\n"
"uniform samplerRect movie_texture;\n"
"varying vec4 texcoord;\n"
"void main(void)\n"
"{\n"
" vec4 texture_color = textureRect(movie_texture, texcoord.st); \n"
" if (all(lessThanEqual(texture_color,cutoff_color))) discard; \n" " if (all(lessThanEqual(texture_color,cutoff_color))) discard; \n"
" gl_FragColor = texture_color;\n" " gl_FragColor = texture_color;\n"
"}\n" "}\n"
}; };
static const char *shaderSourceTexture2D = { static const char *shaderSourceTexture2D = {
"#ifdef GL_ES\n"
" precision highp float;\n"
" precision highp int;\n"
"#endif\n"
"uniform vec4 cutoff_color;\n" "uniform vec4 cutoff_color;\n"
"uniform sampler2D movie_texture;\n" "uniform sampler2D movie_texture;\n"
"varying vec4 texcoord;\n"
"void main(void)\n" "void main(void)\n"
"{\n" "{\n"
" vec4 texture_color = texture2D(movie_texture, gl_TexCoord[0].st); \n" " vec4 texture_color = texture2D(movie_texture, texcoord.st); \n"
" if (all(lessThanEqual(texture_color,cutoff_color))) discard; \n" " if (all(lessThanEqual(texture_color,cutoff_color))) discard; \n"
" gl_FragColor = texture_color;\n" " gl_FragColor = texture_color;\n"
"}\n" "}\n"
@@ -493,6 +516,9 @@ int main(int argc, char** argv)
osg::Program* program = new osg::Program; osg::Program* program = new osg::Program;
program->addShader(new osg::Shader(osg::Shader::VERTEX, shaderSourceTextureVertex));
program->addShader(new osg::Shader(osg::Shader::FRAGMENT, program->addShader(new osg::Shader(osg::Shader::FRAGMENT,
useTextureRectangle ? shaderSourceTextureRec : shaderSourceTexture2D)); useTextureRectangle ? shaderSourceTextureRec : shaderSourceTexture2D));
@@ -520,8 +546,8 @@ int main(int argc, char** argv)
{ {
if (arguments.isString(i)) if (arguments.isString(i))
{ {
osg::Image* image = osgDB::readImageFile(arguments[i]); osg::ref_ptr<osg::Image> image = osgDB::readRefImageFile(arguments[i]);
osg::ImageStream* imagestream = dynamic_cast<osg::ImageStream*>(image); osg::ImageStream* imagestream = dynamic_cast<osg::ImageStream*>(image.get());
if (imagestream) if (imagestream)
{ {
osg::ImageStream::AudioStreams& audioStreams = imagestream->getAudioStreams(); osg::ImageStream::AudioStreams& audioStreams = imagestream->getAudioStreams();
@@ -550,7 +576,7 @@ int main(int argc, char** argv)
float width = image->s() * image->getPixelAspectRatio(); float width = image->s() * image->getPixelAspectRatio();
float height = image->t(); float height = image->t();
osg::ref_ptr<osg::Drawable> drawable = myCreateTexturedQuadGeometry(pos, width, height,image, useTextureRectangle, xyPlane, flip); osg::ref_ptr<osg::Drawable> drawable = myCreateTexturedQuadGeometry(pos, width, height, image.get(), useTextureRectangle, xyPlane, flip);
if (image->isImageTranslucent()) if (image->isImageTranslucent())
{ {

View File

@@ -362,7 +362,7 @@ private:
static osg::Node* readImageStream(const std::string& file_name, osg::Vec3& p, float desired_height, osgDB::Options* options) static osg::Node* readImageStream(const std::string& file_name, osg::Vec3& p, float desired_height, osgDB::Options* options)
{ {
osg::ref_ptr<osg::Object> obj = osgDB::readObjectFile(file_name, options); osg::ref_ptr<osg::Object> obj = osgDB::readRefObjectFile(file_name, options);
osg::ref_ptr<osg::Texture> tex = dynamic_cast<osg::Texture*>(obj.get()); osg::ref_ptr<osg::Texture> tex = dynamic_cast<osg::Texture*>(obj.get());
osg::Geometry* geo(NULL); osg::Geometry* geo(NULL);
float w(0); float w(0);
@@ -374,7 +374,7 @@ static osg::Node* readImageStream(const std::string& file_name, osg::Vec3& p, fl
// try readImageFile if readObjectFile failed // try readImageFile if readObjectFile failed
if (!img_stream) if (!img_stream)
{ {
img_stream = dynamic_cast<osg::ImageStream*>(osgDB::readImageFile(file_name, options)); img_stream = osgDB::readRefFile<osg::ImageStream>(file_name, options);
} }
if (img_stream) if (img_stream)
@@ -531,7 +531,9 @@ private:
if (!tex) { if (!tex) {
osg::ref_ptr<osg::ImageStream> stream = dynamic_cast<osg::ImageStream*>(obj.get()); osg::ref_ptr<osg::ImageStream> stream = dynamic_cast<osg::ImageStream*>(obj.get());
if (!stream) if (!stream)
stream = dynamic_cast<osg::ImageStream*>(osgDB::readImageFile(_files[_currentFile], _options.get())); {
stream = osgDB::readRefFile<osg::ImageStream>(_files[_currentFile], _options.get());
}
if (stream) if (stream)
{ {

View File

@@ -44,10 +44,10 @@ int main( int argc, char **argv )
osgViewer::Viewer viewer; osgViewer::Viewer viewer;
// load the nodes from the commandline arguments. // load the nodes from the commandline arguments.
osg::Node* rootnode = osgDB::readNodeFiles(arguments); osg::ref_ptr<osg::Node> rootnode = osgDB::readRefNodeFiles(arguments);
// if not loaded assume no arguments passed in, try use default mode instead. // if not loaded assume no arguments passed in, try use default mode instead.
if (!rootnode) rootnode = osgDB::readNodeFile("cessnafire.osgt"); if (!rootnode) rootnode = osgDB::readRefNodeFile("cessnafire.osgt");
if (!rootnode) if (!rootnode)
{ {
@@ -55,7 +55,7 @@ int main( int argc, char **argv )
return 1; return 1;
} }
osg::Image* image = osgDB::readImageFile("Images/reflect.rgb"); osg::ref_ptr<osg::Image> image = osgDB::readRefImageFile("Images/reflect.rgb");
if (image) if (image)
{ {
osg::Texture2D* texture = new osg::Texture2D; osg::Texture2D* texture = new osg::Texture2D;

View File

@@ -72,8 +72,8 @@ public:
T* _foundNode; T* _foundNode;
}; };
template<class T> template<class T, class R>
T* findTopMostNodeOfType(osg::Node* node) T* findTopMostNodeOfType(R node)
{ {
if (!node) return 0; if (!node) return 0;
@@ -338,7 +338,7 @@ int main( int argc, char **argv )
// set up the scene graph // set up the scene graph
{ {
// load the nodes from the commandline arguments. // load the nodes from the commandline arguments.
osg::Node* rootnode = osgDB::readNodeFiles(arguments); osg::ref_ptr<osg::Node> rootnode = osgDB::readRefNodeFiles(arguments);
if (!rootnode) if (!rootnode)
{ {

View File

@@ -284,10 +284,10 @@ int main( int argc, char **argv )
} }
// read the scene from the list of file specified commandline args. // read the scene from the list of file specified commandline args.
osg::ref_ptr<osg::Node> scene = osgDB::readNodeFiles(arguments); osg::ref_ptr<osg::Node> scene = osgDB::readRefNodeFiles(arguments);
// if not loaded assume no arguments passed in, try use default model instead. // if not loaded assume no arguments passed in, try use default model instead.
if (!scene) scene = osgDB::readNodeFile("dumptruck.osgt"); if (!scene) scene = osgDB::readRefNodeFile("dumptruck.osgt");
if (!scene) if (!scene)
{ {
@@ -307,10 +307,10 @@ int main( int argc, char **argv )
std::string device; std::string device;
while(arguments.read("--device", device)) while(arguments.read("--device", device))
{ {
osg::ref_ptr<osgGA::Device> dev = osgDB::readFile<osgGA::Device>(device); osg::ref_ptr<osgGA::Device> dev = osgDB::readRefFile<osgGA::Device>(device);
if (dev.valid()) if (dev.valid())
{ {
viewer.addDevice(dev.get()); viewer.addDevice(dev);
} }
} }
@@ -318,7 +318,7 @@ int main( int argc, char **argv )
osg::ref_ptr<osg::Group> group = new osg::Group; osg::ref_ptr<osg::Group> group = new osg::Group;
// add the HUD subgraph. // add the HUD subgraph.
if (scene.valid()) group->addChild(scene.get()); if (scene) group->addChild(scene);
viewer.setCameraManipulator(new osgGA::MultiTouchTrackballManipulator()); viewer.setCameraManipulator(new osgGA::MultiTouchTrackballManipulator());
viewer.realize(); viewer.realize();

View File

@@ -64,11 +64,11 @@ int main( int argc, char **argv )
osg::ArgumentParser arguments(&argc,argv); osg::ArgumentParser arguments(&argc,argv);
// read the scene from the list of file specified commandline args. // read the scene from the list of file specified commandline args.
osg::ref_ptr<osg::Node> scene = osgDB::readNodeFiles(arguments); osg::ref_ptr<osg::Node> scene = osgDB::readRefNodeFiles(arguments);
if (!scene) if (!scene)
{ {
scene = osgDB::readNodeFile("http://www.openscenegraph.org/data/earth_bayarea/earth.ive"); scene = osgDB::readRefNodeFile("http://www.openscenegraph.org/data/earth_bayarea/earth.ive");
} }
if (!scene) if (!scene)
@@ -123,7 +123,7 @@ int main( int argc, char **argv )
view->setName("View one"); view->setName("View one");
viewer.addView(view); viewer.addView(view);
view->setSceneData(scene.get()); view->setSceneData(scene);
view->getCamera()->setName("Cam one"); view->getCamera()->setName("Cam one");
view->getCamera()->setViewport(new osg::Viewport(0,0, traits->width/2, traits->height/2)); view->getCamera()->setViewport(new osg::Viewport(0,0, traits->width/2, traits->height/2));
view->getCamera()->setGraphicsContext(gc.get()); view->getCamera()->setGraphicsContext(gc.get());
@@ -148,7 +148,7 @@ int main( int argc, char **argv )
view->setName("View two"); view->setName("View two");
viewer.addView(view); viewer.addView(view);
view->setSceneData(scene.get()); view->setSceneData(scene);
view->getCamera()->setName("Cam two"); view->getCamera()->setName("Cam two");
view->getCamera()->setViewport(new osg::Viewport(traits->width/2,0, traits->width/2, traits->height/2)); view->getCamera()->setViewport(new osg::Viewport(traits->width/2,0, traits->width/2, traits->height/2));
view->getCamera()->setGraphicsContext(gc.get()); view->getCamera()->setGraphicsContext(gc.get());
@@ -162,7 +162,7 @@ int main( int argc, char **argv )
view->setName("View three"); view->setName("View three");
viewer.addView(view); viewer.addView(view);
view->setSceneData(scene.get()); view->setSceneData(scene);
view->getCamera()->setName("Cam three"); view->getCamera()->setName("Cam three");
view->getCamera()->setProjectionMatrixAsPerspective(30.0, double(traits->width) / double(traits->height/2), 1.0, 1000.0); view->getCamera()->setProjectionMatrixAsPerspective(30.0, double(traits->width) / double(traits->height/2), 1.0, 1000.0);

View File

@@ -311,10 +311,10 @@ int main( int argc, char **argv )
} }
// load the nodes from the commandline arguments. // load the nodes from the commandline arguments.
osg::Node* loadedmodel = osgDB::readNodeFiles(arguments); osg::ref_ptr<osg::Node> loadedmodel = osgDB::readRefNodeFiles(arguments);
// if not loaded assume no arguments passed in, try using default mode instead. // if not loaded assume no arguments passed in, try using default mode instead.
if (!loadedmodel) loadedmodel = osgDB::readNodeFile("glider.osgt"); if (!loadedmodel) loadedmodel = osgDB::readRefNodeFile("glider.osgt");
if (!loadedmodel) if (!loadedmodel)
{ {
@@ -336,12 +336,12 @@ int main( int argc, char **argv )
} }
else else
{ {
rootnode = createOccludersAroundModel(loadedmodel); rootnode = createOccludersAroundModel(loadedmodel.get());
} }
// add a viewport to the viewer and attach the scene graph. // add a viewport to the viewer and attach the scene graph.
viewer.setSceneData( rootnode.get() ); viewer.setSceneData( rootnode );
return viewer.run(); return viewer.run();
} }

View File

@@ -749,8 +749,8 @@ int main(int argc, char** argv)
if (arguments.argc()>1) if (arguments.argc()>1)
{ {
root = osgDB::readNodeFiles( arguments ); root = osgDB::readRefNodeFiles( arguments );
if (root.valid()) if (root)
{ {
// Run a NodeVisitor to insert OcclusionQueryNodes in the scene graph. // Run a NodeVisitor to insert OcclusionQueryNodes in the scene graph.
OcclusionQueryVisitor oqv; OcclusionQueryVisitor oqv;
@@ -787,10 +787,10 @@ int main(int argc, char** argv)
if (optimize) if (optimize)
{ {
osgUtil::Optimizer optimizer; osgUtil::Optimizer optimizer;
optimizer.optimize( root.get() ); optimizer.optimize( root );
} }
viewer.setSceneData( root.get() ); viewer.setSceneData( root );
KeyHandler* kh = new KeyHandler( *root ); KeyHandler* kh = new KeyHandler( *root );
viewer.addEventHandler( kh ); viewer.addEventHandler( kh );

View File

@@ -66,12 +66,12 @@ int main(int argc, char** argv)
arguments.reportRemainingOptionsAsUnrecognized(); arguments.reportRemainingOptionsAsUnrecognized();
// read the dump truck, we will need it twice // read the dump truck, we will need it twice
osg::ref_ptr<osg::Node> dt = osgDB::readNodeFile("dumptruck.osg"); osg::ref_ptr<osg::Node> dt = osgDB::readRefNodeFile("dumptruck.osg");
// display a solid version of the dump truck // display a solid version of the dump truck
osg::ref_ptr<osg::PositionAttitudeTransform> solidModel = new osg::PositionAttitudeTransform; osg::ref_ptr<osg::PositionAttitudeTransform> solidModel = new osg::PositionAttitudeTransform;
solidModel->setPosition(osg::Vec3f(7.0f, -2.0f, 7.0f)); solidModel->setPosition(osg::Vec3f(7.0f, -2.0f, 7.0f));
solidModel->addChild(dt.get()); solidModel->addChild(dt);
// generate the 3D heatmap surface to display // generate the 3D heatmap surface to display
osg::ref_ptr<Heatmap> hm = new Heatmap(30, 30, 10, 30, 30, 1.0, 0.25); osg::ref_ptr<Heatmap> hm = new Heatmap(30, 30, 10, 30, 30, 1.0, 0.25);

View File

@@ -377,7 +377,7 @@ public:
std::ostringstream ss ; std::ostringstream ss ;
ss << host << ":" << port << ".sender.osc"; ss << host << ":" << port << ".sender.osc";
_device = osgDB::readFile<osgGA::Device>(ss.str()); _device = osgDB::readRefFile<osgGA::Device>(ss.str());
osgGA::EventVisitor* ev = dynamic_cast<osgGA::EventVisitor*>(nv); osgGA::EventVisitor* ev = dynamic_cast<osgGA::EventVisitor*>(nv);
osgViewer::View* view = ev ? dynamic_cast<osgViewer::View*>(ev->getActionAdapter()) : NULL; osgViewer::View* view = ev ? dynamic_cast<osgViewer::View*>(ev->getActionAdapter()) : NULL;
@@ -403,7 +403,7 @@ int main( int argc, char **argv )
// read the scene from the list of file specified commandline args. // read the scene from the list of file specified commandline args.
osg::ref_ptr<osg::Node> scene = osgDB::readNodeFiles(arguments); osg::ref_ptr<osg::Node> scene = osgDB::readRefNodeFiles(arguments);
if (!scene) if (!scene)
{ {
@@ -463,15 +463,15 @@ int main( int argc, char **argv )
view->addEventHandler( new osgViewer::StatsHandler ); view->addEventHandler( new osgViewer::StatsHandler );
view->addEventHandler( new UserEventHandler(text) ); view->addEventHandler( new UserEventHandler(text) );
osg::ref_ptr<osgGA::Device> device = osgDB::readFile<osgGA::Device>("0.0.0.0:9000.receiver.osc"); osg::ref_ptr<osgGA::Device> device = osgDB::readRefFile<osgGA::Device>("0.0.0.0:9000.receiver.osc");
if (device.valid() && (device->getCapabilities() & osgGA::Device::RECEIVE_EVENTS)) if (device.valid() && (device->getCapabilities() & osgGA::Device::RECEIVE_EVENTS))
{ {
view->addDevice(device.get()); view->addDevice(device);
// add a zeroconf device, advertising the osc-device // add a zeroconf device, advertising the osc-device
if(use_zeroconf) if(use_zeroconf)
{ {
osgGA::Device* zeroconf_device = osgDB::readFile<osgGA::Device>("_osc._udp:9000.advertise.zeroconf"); osg::ref_ptr<osgGA::Device> zeroconf_device = osgDB::readRefFile<osgGA::Device>("_osc._udp:9000.advertise.zeroconf");
if (zeroconf_device) if (zeroconf_device)
{ {
view->addDevice(zeroconf_device); view->addDevice(zeroconf_device);
@@ -527,7 +527,7 @@ int main( int argc, char **argv )
if (use_zeroconf) if (use_zeroconf)
{ {
osgGA::Device* zeroconf_device = osgDB::readFile<osgGA::Device>("_osc._udp.discover.zeroconf"); osg::ref_ptr<osgGA::Device> zeroconf_device = osgDB::readRefFile<osgGA::Device>("_osc._udp.discover.zeroconf");
if(zeroconf_device) { if(zeroconf_device) {
view->addDevice(zeroconf_device); view->addDevice(zeroconf_device);
view->getEventHandlers().push_front(new OscServiceDiscoveredEventHandler()); view->getEventHandlers().push_front(new OscServiceDiscoveredEventHandler());
@@ -536,7 +536,7 @@ int main( int argc, char **argv )
} }
else else
{ {
osg::ref_ptr<osgGA::Device> device = osgDB::readFile<osgGA::Device>("localhost:9000.sender.osc"); osg::ref_ptr<osgGA::Device> device = osgDB::readRefFile<osgGA::Device>("localhost:9000.sender.osc");
if (device.valid() && (device->getCapabilities() & osgGA::Device::SEND_EVENTS)) if (device.valid() && (device->getCapabilities() & osgGA::Device::SEND_EVENTS))
{ {
// add as first event handler, so it gets ALL events ... // add as first event handler, so it gets ALL events ...

View File

@@ -25,7 +25,7 @@ int main(int argc, char** argv)
// load outlined object // load outlined object
std::string modelFilename = arguments.argc() > 1 ? arguments[1] : "dumptruck.osgt"; std::string modelFilename = arguments.argc() > 1 ? arguments[1] : "dumptruck.osgt";
osg::ref_ptr<osg::Node> outlineModel = osgDB::readNodeFile(modelFilename); osg::ref_ptr<osg::Node> outlineModel = osgDB::readRefNodeFile(modelFilename);
if (!outlineModel) if (!outlineModel)
{ {
osg::notify(osg::FATAL) << "Unable to load model '" << modelFilename << "'\n"; osg::notify(osg::FATAL) << "Unable to load model '" << modelFilename << "'\n";
@@ -38,18 +38,18 @@ int main(int argc, char** argv)
{ {
// create outline effect // create outline effect
osg::ref_ptr<osgFX::Outline> outline = new osgFX::Outline; osg::ref_ptr<osgFX::Outline> outline = new osgFX::Outline;
root->addChild(outline.get()); root->addChild(outline);
outline->setWidth(8); outline->setWidth(8);
outline->setColor(osg::Vec4(1,1,0,1)); outline->setColor(osg::Vec4(1,1,0,1));
outline->addChild(outlineModel.get()); outline->addChild(outlineModel);
} }
if (testOcclusion) if (testOcclusion)
{ {
// load occluder // load occluder
std::string occludedModelFilename = "cow.osgt"; std::string occludedModelFilename = "cow.osgt";
osg::ref_ptr<osg::Node> occludedModel = osgDB::readNodeFile(occludedModelFilename); osg::ref_ptr<osg::Node> occludedModel = osgDB::readRefNodeFile(occludedModelFilename);
if (!occludedModel) if (!occludedModel)
{ {
osg::notify(osg::FATAL) << "Unable to load model '" << occludedModelFilename << "'\n"; osg::notify(osg::FATAL) << "Unable to load model '" << occludedModelFilename << "'\n";
@@ -63,14 +63,14 @@ int main(int argc, char** argv)
// occluder behind outlined model // occluder behind outlined model
osg::ref_ptr<osg::PositionAttitudeTransform> modelTransform0 = new osg::PositionAttitudeTransform; osg::ref_ptr<osg::PositionAttitudeTransform> modelTransform0 = new osg::PositionAttitudeTransform;
modelTransform0->setPosition(bsphere.center() + occluderOffset); modelTransform0->setPosition(bsphere.center() + occluderOffset);
modelTransform0->addChild(occludedModel.get()); modelTransform0->addChild(occludedModel);
root->addChild(modelTransform0.get()); root->addChild(modelTransform0);
// occluder in front of outlined model // occluder in front of outlined model
osg::ref_ptr<osg::PositionAttitudeTransform> modelTransform1 = new osg::PositionAttitudeTransform; osg::ref_ptr<osg::PositionAttitudeTransform> modelTransform1 = new osg::PositionAttitudeTransform;
modelTransform1->setPosition(bsphere.center() - occluderOffset); modelTransform1->setPosition(bsphere.center() - occluderOffset);
modelTransform1->addChild(occludedModel.get()); modelTransform1->addChild(occludedModel);
root->addChild(modelTransform1.get()); root->addChild(modelTransform1);
} }
// must have stencil buffer... // must have stencil buffer...
@@ -78,7 +78,7 @@ int main(int argc, char** argv)
// construct the viewer // construct the viewer
osgViewer::Viewer viewer; osgViewer::Viewer viewer;
viewer.setSceneData(root.get()); viewer.setSceneData(root);
// must clear stencil buffer... // must clear stencil buffer...
unsigned int clearMask = viewer.getCamera()->getClearMask(); unsigned int clearMask = viewer.getCamera()->getClearMask();

View File

@@ -254,7 +254,7 @@ int main( int argc, char **argv )
// } // }
osg::ref_ptr<osg::Node> model = osgDB::readNodeFiles(arguments); osg::ref_ptr<osg::Node> model = osgDB::readRefNodeFiles(arguments);
if (!model) if (!model)
{ {

View File

@@ -163,7 +163,7 @@ osg::Node* createModel(const std::string& shader, const std::string& textureFile
osg::Shader* vertex_shader = new osg::Shader(osg::Shader::VERTEX, vertexShaderSource_texture); osg::Shader* vertex_shader = new osg::Shader(osg::Shader::VERTEX, vertexShaderSource_texture);
program->addShader(vertex_shader); program->addShader(vertex_shader);
osg::Image* image = 0; osg::ref_ptr<osg::Image> image;
if (terrainFileName.empty()) if (terrainFileName.empty())
{ {
@@ -184,7 +184,7 @@ osg::Node* createModel(const std::string& shader, const std::string& textureFile
} }
else else
{ {
image = osgDB::readImageFile(terrainFileName); image = osgDB::readRefImageFile(terrainFileName);
num_x = image->s(); num_x = image->s();
num_y = image->t(); num_y = image->t();
@@ -206,7 +206,7 @@ osg::Node* createModel(const std::string& shader, const std::string& textureFile
osg::Shader* fragment_shader = new osg::Shader(osg::Shader::FRAGMENT, fragmentShaderSource); osg::Shader* fragment_shader = new osg::Shader(osg::Shader::FRAGMENT, fragmentShaderSource);
program->addShader(fragment_shader); program->addShader(fragment_shader);
osg::Texture2D* texture = new osg::Texture2D(osgDB::readImageFile(textureFileName)); osg::Texture2D* texture = new osg::Texture2D(osgDB::readRefImageFile(textureFileName));
stateset->setTextureAttributeAndModes(0,texture); stateset->setTextureAttributeAndModes(0,texture);
osg::Uniform* baseTextureSampler = new osg::Uniform("baseTexture",0); osg::Uniform* baseTextureSampler = new osg::Uniform("baseTexture",0);

View File

@@ -77,9 +77,9 @@ osg::Node* createMovingModel(const osg::Vec3& center, float radius)
osg::AnimationPath* animationPath = createAnimationPath(center,radius,animationLength); osg::AnimationPath* animationPath = createAnimationPath(center,radius,animationLength);
osg::Group* model = new osg::Group; osg::ref_ptr<osg::Group> model = new osg::Group;
osg::Node* glider = osgDB::readNodeFile("glider.osgt"); osg::ref_ptr<osg::Node> glider = osgDB::readRefNodeFile("glider.osgt");
if (glider) if (glider)
{ {
const osg::BoundingSphere& bs = glider->getBound(); const osg::BoundingSphere& bs = glider->getBound();
@@ -102,7 +102,7 @@ osg::Node* createMovingModel(const osg::Vec3& center, float radius)
model->addChild(xform); model->addChild(xform);
} }
osg::Node* cessna = osgDB::readNodeFile("cessna.osgt"); osg::ref_ptr<osg::Node> cessna = osgDB::readRefNodeFile("cessna.osgt");
if (cessna) if (cessna)
{ {
const osg::BoundingSphere& bs = cessna->getBound(); const osg::BoundingSphere& bs = cessna->getBound();
@@ -126,7 +126,7 @@ osg::Node* createMovingModel(const osg::Vec3& center, float radius)
model->addChild(xform); model->addChild(xform);
} }
return model; return model.release();
} }
@@ -162,8 +162,8 @@ void build_world(osg::Group *root)
osg::Geode* terrainGeode = new osg::Geode; osg::Geode* terrainGeode = new osg::Geode;
// create terrain // create terrain
{ {
osg::StateSet* stateset = new osg::StateSet(); osg::ref_ptr<osg::StateSet> stateset = new osg::StateSet();
osg::Image* image = osgDB::readImageFile("Images/lz.rgb"); osg::ref_ptr<osg::Image> image = osgDB::readRefImageFile("Images/lz.rgb");
if (image) if (image)
{ {
osg::Texture2D* texture = new osg::Texture2D; osg::Texture2D* texture = new osg::Texture2D;

View File

@@ -75,21 +75,20 @@ std::string ImageReaderWriter::local_insertReference(const std::string& fileName
return myReference; return myReference;
} }
osg::Image* ImageReaderWriter::readImage_Archive(DataReference& dr, float& s,float& t) osg::ref_ptr<osg::Image> ImageReaderWriter::readImage_Archive(DataReference& dr, float& s,float& t)
{ {
for(PhotoArchiveList::iterator itr=_photoArchiveList.begin(); for(PhotoArchiveList::iterator itr=_photoArchiveList.begin();
itr!=_photoArchiveList.end(); itr!=_photoArchiveList.end();
++itr) ++itr)
{ {
osg::Image* image = (*itr)->readImage(dr._fileName,dr._resolutionX,dr._resolutionY,s,t); osg::ref_ptr<osg::Image> image = (*itr)->readImage(dr._fileName,dr._resolutionX,dr._resolutionY,s,t);
if (image) return image; if (image) return image;
} }
return 0; return 0;
} }
osg::Image* ImageReaderWriter::readImage_DynamicSampling(DataReference& dr, float& s,float& t) osg::ref_ptr<osg::Image> ImageReaderWriter::readImage_DynamicSampling(DataReference& dr, float& s,float& t)
{ {
// record previous options. // record previous options.
osg::ref_ptr<osgDB::ReaderWriter::Options> previousOptions = osgDB::Registry::instance()->getOptions(); osg::ref_ptr<osgDB::ReaderWriter::Options> previousOptions = osgDB::Registry::instance()->getOptions();
@@ -99,7 +98,7 @@ osg::Image* ImageReaderWriter::readImage_DynamicSampling(DataReference& dr, floa
osgDB::Registry::instance()->setOptions(options.get()); osgDB::Registry::instance()->setOptions(options.get());
osg::Image* image = osgDB::readImageFile(dr._fileName); osg::ref_ptr<osg::Image> image = osgDB::readRefImageFile(dr._fileName);
// restore previous options. // restore previous options.
osgDB::Registry::instance()->setOptions(previousOptions.get()); osgDB::Registry::instance()->setOptions(previousOptions.get());
@@ -119,7 +118,7 @@ osgDB::ReaderWriter::ReadResult ImageReaderWriter::local_readNode(const std::str
DataReference& dr = itr->second; DataReference& dr = itr->second;
osg::Image* image = 0; osg::ref_ptr<osg::Image> image;
float s=1.0f,t=1.0f; float s=1.0f,t=1.0f;
// try to load photo from any loaded PhotoArchives // try to load photo from any loaded PhotoArchives

View File

@@ -80,9 +80,9 @@ class ImageReaderWriter : public osgDB::ReaderWriter
bool _backPage; bool _backPage;
}; };
osg::Image* readImage_Archive(DataReference& dr, float& s,float& t); osg::ref_ptr<osg::Image> readImage_Archive(DataReference& dr, float& s,float& t);
osg::Image* readImage_DynamicSampling(DataReference& dr, float& s,float& t); osg::ref_ptr<osg::Image> readImage_DynamicSampling(DataReference& dr, float& s,float& t);
typedef std::map< std::string,DataReference > DataReferenceMap; typedef std::map< std::string,DataReference > DataReferenceMap;
typedef std::vector< osg::ref_ptr<PhotoArchive> > PhotoArchiveList; typedef std::vector< osg::ref_ptr<PhotoArchive> > PhotoArchiveList;

View File

@@ -72,7 +72,7 @@ void PhotoArchive::getImageFileNameList(FileNameList& filenameList)
} }
osg::Image* PhotoArchive::readImage(const std::string& filename, osg::ref_ptr<osg::Image> PhotoArchive::readImage(const std::string& filename,
unsigned int target_s, unsigned target_t, unsigned int target_s, unsigned target_t,
float& original_s, float& original_t) float& original_s, float& original_t)
{ {
@@ -99,7 +99,7 @@ osg::Image* PhotoArchive::readImage(const std::string& filename,
unsigned char* data = new unsigned char[imageHeader.size]; unsigned char* data = new unsigned char[imageHeader.size];
in.read((char*)data,imageHeader.size); in.read((char*)data,imageHeader.size);
osg::Image* image = new osg::Image; osg::ref_ptr<osg::Image> image = new osg::Image;
image->setImage(photoHeader.thumbnail_s,photoHeader.thumbnail_t,1, image->setImage(photoHeader.thumbnail_s,photoHeader.thumbnail_t,1,
imageHeader.pixelFormat,imageHeader.pixelFormat,imageHeader.type, imageHeader.pixelFormat,imageHeader.pixelFormat,imageHeader.type,
data,osg::Image::USE_NEW_DELETE); data,osg::Image::USE_NEW_DELETE);
@@ -125,7 +125,7 @@ osg::Image* PhotoArchive::readImage(const std::string& filename,
unsigned char* data = new unsigned char[imageHeader.size]; unsigned char* data = new unsigned char[imageHeader.size];
in.read((char*)data,imageHeader.size); in.read((char*)data,imageHeader.size);
osg::Image* image = new osg::Image; osg::ref_ptr<osg::Image> image = new osg::Image;
image->setImage(photoHeader.fullsize_s,photoHeader.fullsize_t,1, image->setImage(photoHeader.fullsize_s,photoHeader.fullsize_t,1,
imageHeader.pixelFormat,imageHeader.pixelFormat,imageHeader.type, imageHeader.pixelFormat,imageHeader.pixelFormat,imageHeader.type,
data,osg::Image::USE_NEW_DELETE); data,osg::Image::USE_NEW_DELETE);
@@ -196,7 +196,7 @@ void PhotoArchive::buildArchive(const std::string& filename, const FileNameList&
std::cout<<"Processing image "<<photoCount<<" of "<< photoIndex.size()<<" filename="<< photoHeader.filename << std::endl; std::cout<<"Processing image "<<photoCount<<" of "<< photoIndex.size()<<" filename="<< photoHeader.filename << std::endl;
std::cout<<" reading image...";std::cout.flush(); std::cout<<" reading image...";std::cout.flush();
osg::ref_ptr<osg::Image> image = osgDB::readImageFile(photoHeader.filename); osg::ref_ptr<osg::Image> image = osgDB::readRefImageFile(photoHeader.filename);
std::cout<<"done."<< std::endl; std::cout<<"done."<< std::endl;

View File

@@ -42,7 +42,7 @@ public:
static void buildArchive(const std::string& filename, const FileNameList& imageList, unsigned int thumbnailSize=256, unsigned int maximumSize=1024, bool compressed=true); static void buildArchive(const std::string& filename, const FileNameList& imageList, unsigned int thumbnailSize=256, unsigned int maximumSize=1024, bool compressed=true);
osg::Image* readImage(const std::string& filename, osg::ref_ptr<osg::Image> readImage(const std::string& filename,
unsigned int target_s, unsigned target_t, unsigned int target_s, unsigned target_t,
float& original_s, float& original_t); float& original_s, float& original_t);

View File

@@ -239,7 +239,7 @@ int main( int argc, char **argv )
osg::ArgumentParser arguments(&argc,argv); osg::ArgumentParser arguments(&argc,argv);
// read the scene from the list of file specified commandline args. // read the scene from the list of file specified commandline args.
osg::ref_ptr<osg::Node> scene = osgDB::readNodeFiles(arguments); osg::ref_ptr<osg::Node> scene = osgDB::readRefNodeFiles(arguments);
if (!scene && arguments.read("--relative-camera-scene")) if (!scene && arguments.read("--relative-camera-scene"))
{ {
@@ -271,7 +271,7 @@ int main( int argc, char **argv )
} }
// if not loaded assume no arguments passed in, try use default mode instead. // if not loaded assume no arguments passed in, try use default mode instead.
if (!scene) scene = osgDB::readNodeFile("fountain.osgt"); if (!scene) scene = osgDB::readRefNodeFile("fountain.osgt");
osg::ref_ptr<osg::Group> group = dynamic_cast<osg::Group*>(scene.get()); osg::ref_ptr<osg::Group> group = dynamic_cast<osg::Group*>(scene.get());
if (!group) if (!group)

Some files were not shown because too many files have changed in this diff Show More