Compare commits

..

250 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
Robert Osfield
f4013a68da Updated ChangeLog
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15114 16af8721-9629-0410-8352-f15c8da7e697
2015-08-12 11:13:17 +00:00
Robert Osfield
2ad1e661e0 Added initializer
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15113 16af8721-9629-0410-8352-f15c8da7e697
2015-08-12 10:44:20 +00:00
Robert Osfield
c1d5b6992c Updated ChangeLog
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15112 16af8721-9629-0410-8352-f15c8da7e697
2015-08-12 10:30:18 +00:00
Robert Osfield
b92c3f1455 Merged shaders from svn/trunk that refactor the workaround to the NVidia driver bug
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15111 16af8721-9629-0410-8352-f15c8da7e697
2015-08-12 10:19:15 +00:00
Robert Osfield
9975e15a97 Update ChangeLog
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15108 16af8721-9629-0410-8352-f15c8da7e697
2015-08-12 10:06:58 +00:00
Robert Osfield
5b242d22ff Change RC number to 0 for 3.4.0 stable release.
Updated ChangeLog
Updated the release data in the README


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15099 16af8721-9629-0410-8352-f15c8da7e697
2015-08-12 06:38:59 +00:00
Robert Osfield
814a885a6c Updated ChangeLog and RC nubmer to 13, and added GL1 to the docs on the GL_PROFILE usage
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15098 16af8721-9629-0410-8352-f15c8da7e697
2015-08-11 20:12:02 +00:00
Robert Osfield
471b256d30 Refactored workaround of NVidia nan length bug.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15097 16af8721-9629-0410-8352-f15c8da7e697
2015-08-11 20:08:07 +00:00
Robert Osfield
8f73ddc27d Moved the FIND_PACKAGE(Boost) from the root CMakeLists.txt into the local Find scripts to avoid Boost check when not neccessary.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15094 16af8721-9629-0410-8352-f15c8da7e697
2015-08-11 08:44:46 +00:00
Robert Osfield
0874f126c0 Updated ChangeLog
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15090 16af8721-9629-0410-8352-f15c8da7e697
2015-08-10 19:58:22 +00:00
Robert Osfield
697128a11d From svn/trunk merged support for passing the GL_VENDOR string into the #pragma(tic) shader compositions defines
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15089 16af8721-9629-0410-8352-f15c8da7e697
2015-08-10 19:56:53 +00:00
Robert Osfield
96d247aa7e Update RC number to 12, and updated ChangeLog
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15086 16af8721-9629-0410-8352-f15c8da7e697
2015-08-10 19:46:19 +00:00
Robert Osfield
c0ac503123 Fixed line endings
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15084 16af8721-9629-0410-8352-f15c8da7e697
2015-08-10 19:40:25 +00:00
Robert Osfield
b74924fab4 Updated built-in shaders from OpenSceneGraph-Data vesion that introduce #pragma(tic) shaders that resolve the NVidia loop iteration bug.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15082 16af8721-9629-0410-8352-f15c8da7e697
2015-08-10 19:39:18 +00:00
Robert Osfield
75217a2ed5 Quietened down #pragma(tic) shader composition messages
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15080 16af8721-9629-0410-8352-f15c8da7e697
2015-08-10 19:19:03 +00:00
Robert Osfield
2bed348da1 Build fix for VS and installing TYpes
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15076 16af8721-9629-0410-8352-f15c8da7e697
2015-08-10 05:04:39 +00:00
Robert Osfield
af8b11a391 Update ChangeLog and AUTHORS for rc11
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15074 16af8721-9629-0410-8352-f15c8da7e697
2015-08-09 10:20:51 +00:00
Robert Osfield
27f080159e Updated RC number to 11.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15073 16af8721-9629-0410-8352-f15c8da7e697
2015-08-09 10:16:48 +00:00
Robert Osfield
e8722e76ea Changed GLint64 and GLuint64 to use int64_t and uint64_t (pulled in via include/osg/Types) to avoid conflict with Qt5 definitions
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15072 16af8721-9629-0410-8352-f15c8da7e697
2015-08-09 10:16:03 +00:00
Robert Osfield
8b4ff0f50a Added #idef guards for SGIX usage
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15070 16af8721-9629-0410-8352-f15c8da7e697
2015-08-09 09:40:59 +00:00
Robert Osfield
559da06ffa From Glenn Waldron, fix error in ZIP plugin handling of memory buffer
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15068 16af8721-9629-0410-8352-f15c8da7e697
2015-08-08 08:49:53 +00:00
Robert Osfield
5c40e9bf81 Updated rc number and ChangeLog for 3.4.0-rc10
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15063 16af8721-9629-0410-8352-f15c8da7e697
2015-08-06 15:10:55 +00:00
Robert Osfield
1186143571 Merged workaround for NVidia driver/GPU bug by updating shaders from svn/trunk that change float to int usage.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15062 16af8721-9629-0410-8352-f15c8da7e697
2015-08-06 15:04:36 +00:00
Robert Osfield
732364d49b Added checks for the validity of chached coordinate arrays.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15061 16af8721-9629-0410-8352-f15c8da7e697
2015-08-06 15:03:50 +00:00
Robert Osfield
0153c3e7e2 Updated rc number to 9, and updated ChangeLog and AUTHORS.txt
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15043 16af8721-9629-0410-8352-f15c8da7e697
2015-08-03 19:38:37 +00:00
Robert Osfield
5e8d5b50db From Andy Skinner, "Someone was using our code on a system that does not seem to have the SGIX symbols used in osgViewer.cpp.
I used osgSetGLExtensionsFuncPtr to remove the symbols.  I don't know how to test this path, but it did remove the symbols from libosgViewer.so.  I have also not been able yet to see if that was sufficient for our customer.

 

I did this by looking at other cases, and I tried to follow some of the same practices in PixelBufferX11, like using _useSGIX in a similar way to the previous _useGLX1_3."




git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15042 16af8721-9629-0410-8352-f15c8da7e697
2015-08-03 19:14:11 +00:00
Robert Osfield
e9b75e0ded Update ChangeLog and AUTHORS
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15039 16af8721-9629-0410-8352-f15c8da7e697
2015-07-31 15:12:10 +00:00
Robert Osfield
803677e03c Updated rc number to 8 for 3.4.9-rc8
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15038 16af8721-9629-0410-8352-f15c8da7e697
2015-07-31 15:01:34 +00:00
Robert Osfield
0f97a42e17 From Terry Welsh, "I downloaded the Android 3rdparty deps from here
http://www.openscenegraph.org/index.php/download-section/dependencies
but was not able to use them for a while. Attached are changes to
OsgAndroidMacroUtils.cmake that allow the deps to be found by cmake.

Specifically, all FIND_PATH commands require the
NO_CMAKE_FIND_ROOT_PATH option to actually find paths. This is odd
because if you inspect CMAKE_FIND_ROOT_PATH it appears to be empty. I
would expect it to have no effect at all.

I also needed to remove quotes from this line in order for headers to be found:

set(FREETYPE_INCLUDE_DIRS "${FREETYPE_DIR}/include
${FREETYPE_DIR}/include/freetype/config")

Assuming this script worked in the past, it seems like cmake behavior
may have changed at some point. I'm using cmake version 2.8.12.2."


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15037 16af8721-9629-0410-8352-f15c8da7e697
2015-07-31 13:47:03 +00:00
Robert Osfield
91fd245d7c From Jannik Heller, "Here is a patch for the S3TC capability check.
On a Intel HD graphics Linux system with Mesa 10.1.3, I found that osg's Extensions::isTextureCompressionS3TCSupported() returned false, even though S3TC compressed textures *are* in fact working. I tested this by loading and rendering various DXT1, DXT3 and DXT5 compressed textures in the OSG.

"glxinfo | grep s3tc" gives:
    GL_S3_s3tc

Note, if I install the package "libtxc-dxtn-s2tc0", I get in addition:

glxinfo | grep s3tc
    GL_EXT_texture_compression_s3tc
    GL_S3_s3tc

However, S3TC compressed textures worked correctly within the OSG even without libtxc-dxtn-s2tc0 installed.

I'm not sure what the differences between these extensions are, but based on the description at https://www.opengl.org/registry/specs/S3/s3tc.txt I would assume that both will work for OSG's purposes. The attached patch changes isTextureCompressionS3TCSupported() to accept either extension."



git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15034 16af8721-9629-0410-8352-f15c8da7e697
2015-07-31 13:44:36 +00:00
Robert Osfield
eb90d9aa34 Warning fix
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15033 16af8721-9629-0410-8352-f15c8da7e697
2015-07-31 10:59:23 +00:00
Robert Osfield
8e9f688809 From Kristofer Tingdahl, warning fixes.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15031 16af8721-9629-0410-8352-f15c8da7e697
2015-07-31 10:54:17 +00:00
Robert Osfield
6c1c179c62 Compile fix for Mingw.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15028 16af8721-9629-0410-8352-f15c8da7e697
2015-07-31 10:27:08 +00:00
Robert Osfield
cfe3e621ad Update version and rc number of 3.4.0-rc7.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15026 16af8721-9629-0410-8352-f15c8da7e697
2015-07-23 21:32:17 +00:00
Robert Osfield
761cf52bb7 Added explicit initialization of osg::Referenced(true) to osg::Operation subclasses as it uses virtual inhertiance from osg::Referenced.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15024 16af8721-9629-0410-8352-f15c8da7e697
2015-07-23 15:46:39 +00:00
Robert Osfield
42efcf24fb From Pjotr Svetachov, buid fixes for VS2015.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15022 16af8721-9629-0410-8352-f15c8da7e697
2015-07-23 14:37:24 +00:00
Robert Osfield
0a56f65077 Fixed indentation
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15019 16af8721-9629-0410-8352-f15c8da7e697
2015-07-23 14:30:39 +00:00
Robert Osfield
3339395071 git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15018 16af8721-9629-0410-8352-f15c8da7e697 2015-07-23 14:03:15 +00:00
Robert Osfield
34e53a37e0 Warning fixes for Clang-3.6
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15017 16af8721-9629-0410-8352-f15c8da7e697
2015-07-23 11:14:00 +00:00
Robert Osfield
482fd41d58 Added missing handling of lightnumber and associate lights
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15014 16af8721-9629-0410-8352-f15c8da7e697
2015-07-23 09:23:32 +00:00
Robert Osfield
2eef9d233b Changed the GL_HEADER_HAS_GLINT64 and GL_HEADER_HAS_GLUINT64 to use cmakedefine to improve handling of when cmake doesn't find GLint64 and GLuint64.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15012 16af8721-9629-0410-8352-f15c8da7e697
2015-07-23 07:39:01 +00:00
Robert Osfield
4a886c6e22 Fixed Contributors list
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15008 16af8721-9629-0410-8352-f15c8da7e697
2015-07-22 14:55:26 +00:00
Robert Osfield
717d566713 Updated ChangeLog
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15006 16af8721-9629-0410-8352-f15c8da7e697
2015-07-22 14:51:58 +00:00
Robert Osfield
1d0a265cd4 Update rc to 6.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15005 16af8721-9629-0410-8352-f15c8da7e697
2015-07-22 14:41:55 +00:00
Robert Osfield
3d69d46e3e Moved from svn/trunk, moved GL_ALPHA_TEST from AlphaFunc to GLDefines
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15004 16af8721-9629-0410-8352-f15c8da7e697
2015-07-22 14:30:01 +00:00
Robert Osfield
8e20224828 From svn/trunk merged automatic detection of GLint64 + GLuint64 in GL headers
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15003 16af8721-9629-0410-8352-f15c8da7e697
2015-07-22 14:27:36 +00:00
Robert Osfield
6e65a9955e Added check for validity of OpenFlight shininess value.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@14999 16af8721-9629-0410-8352-f15c8da7e697
2015-07-21 14:22:01 +00:00
Robert Osfield
2264c3b7e2 Fixed typo
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@14996 16af8721-9629-0410-8352-f15c8da7e697
2015-07-21 13:42:22 +00:00
Robert Osfield
8c991c056f Reduced debug message verbosity.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@14994 16af8721-9629-0410-8352-f15c8da7e697
2015-07-20 13:23:50 +00:00
Robert Osfield
34ab8bc048 Updated RC to 5 for 3.4.0-rc5 release
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@14991 16af8721-9629-0410-8352-f15c8da7e697
2015-07-20 07:53:18 +00:00
Robert Osfield
d73e979ea8 Updated ChangeLog for rc
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@14990 16af8721-9629-0410-8352-f15c8da7e697
2015-07-20 07:46:58 +00:00
Robert Osfield
6273495c64 Changed the _MSC_VER check to <= 1700 to support VS2012.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@14988 16af8721-9629-0410-8352-f15c8da7e697
2015-07-20 07:42:00 +00:00
Robert Osfield
8f26396e78 Reinstated the TIFFSetField(image, TIFFTAG_ROWSPERSTRIP, rowsperstrip);
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@14986 16af8721-9629-0410-8352-f15c8da7e697
2015-07-19 09:51:17 +00:00
Robert Osfield
78bf1e8ea4 From KOS, "I've mentioned in the "osg-users" ML about build error with the newest GStreamer 1.5
Please, have a look at the attached patch."

CMakeModules/FindGStreamer.cmake


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@14983 16af8721-9629-0410-8352-f15c8da7e697
2015-07-17 18:31:19 +00:00
Robert Osfield
83a03f3346 Updated release candidate number
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@14980 16af8721-9629-0410-8352-f15c8da7e697
2015-07-17 09:16:06 +00:00
Robert Osfield
4626f6fb6a Updated ChangeLog and AUTHORS
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@14978 16af8721-9629-0410-8352-f15c8da7e697
2015-07-17 09:06:03 +00:00
Robert Osfield
9e581f91db Added cmake version checked for cmake_policy setting
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@14974 16af8721-9629-0410-8352-f15c8da7e697
2015-07-17 08:21:28 +00:00
Robert Osfield
887768b55a From Patrick Neary, "To the tiff plugin, add the capability to write tiff images with unsigned short data"
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@14970 16af8721-9629-0410-8352-f15c8da7e697
2015-07-17 08:12:51 +00:00
Robert Osfield
5b1cfd26ab From Patrick Neary, "Added some lesser used tokens that we use from GL_ARB_texture_rg to computeFormatDataType(), and computeNumComponents() in src/osg/Image.cpp"
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@14966 16af8721-9629-0410-8352-f15c8da7e697
2015-07-16 19:16:54 +00:00
Robert Osfield
f48a4baa4e From Cory Slep and Robert Osfield, "When using Open Scene Graph and Qt on Android, the resulting thread that an application developer’s Q*Application is run on is different than what Qt considers the “main” thread, which can cause subtle problems. This is because Qt loads native libraries in one thread, and later runs the application in a different thread. They delay running in the second thread as long as possible as they have a nontrivial bootstrapping process. The motivation for Qt having this second thread is to allow them to remain responsive to both Java and native events, and capture events that would otherwise be “missed”
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@14964 16af8721-9629-0410-8352-f15c8da7e697
2015-07-16 15:56:40 +00:00
Robert Osfield
49c802153d Added check to catch cases where the backdrop coordinate cache is too small for the number of contexts being computed.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@14962 16af8721-9629-0410-8352-f15c8da7e697
2015-07-16 11:01:50 +00:00
Robert Osfield
13e79d3210 Added initializers and reverted OSX workaround from 2013.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@14960 16af8721-9629-0410-8352-f15c8da7e697
2015-07-15 10:02:31 +00:00
Robert Osfield
236617b6c5 Fixed source of 3.4.0-rc tags to branches so that release candidates are made from the correct 3.4 branch.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@14957 16af8721-9629-0410-8352-f15c8da7e697
2015-07-14 16:55:27 +00:00
Robert Osfield
a0229ee684 Updated ChangeLog and Release Candidate number of 3.4-rc2
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@14955 16af8721-9629-0410-8352-f15c8da7e697
2015-07-14 16:37:31 +00:00
Robert Osfield
5ebfa0a71e Moved the cmake_policy(SET CMP0043 NEW) to work for all script paths that Qt5 usage could pass through.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@14954 16af8721-9629-0410-8352-f15c8da7e697
2015-07-14 13:33:17 +00:00
Robert Osfield
5acad4e07e Added cmake_policy(SET CMP0043 NEW) usage when compiling against Qt5 as it was causing a warning we couldn't fix on the OSG side otherwise.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@14951 16af8721-9629-0410-8352-f15c8da7e697
2015-07-14 13:26:34 +00:00
Robert Osfield
ccae59e98a Added _defineList into the osg::StateSet::compare() implementation to address issues with osgUtil::Optimizer ignoring defines.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@14949 16af8721-9629-0410-8352-f15c8da7e697
2015-07-14 08:25:20 +00:00
Robert Osfield
222871aade Added Text::GlyphQuads::release/resizeGLObjects() and handling of inconsistent contextID sizes to avoid crashes when viewers and scene graphs aren't initialized correctly to the right number of contexts.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@14946 16af8721-9629-0410-8352-f15c8da7e697
2015-07-13 16:09:40 +00:00
Robert Osfield
d221133728 Standardize the call to setUpThreading() in CompositeViewer/Viewer::realize().
Standardize the call to scene->resizeGLObjects().


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@14945 16af8721-9629-0410-8352-f15c8da7e697
2015-07-13 16:04:38 +00:00
Robert Osfield
2eff96d1a4 From Terry Welsh, "fThis fixes problem where new glClipControl feature would not compile for GLES2 profile"
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@14942 16af8721-9629-0410-8352-f15c8da7e697
2015-07-13 08:48:41 +00:00
Robert Osfield
0394ba5453 Updated ChangeLog and AUTHORS for 3.4-rc1
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@14939 16af8721-9629-0410-8352-f15c8da7e697
2015-07-03 06:50:25 +00:00
Robert Osfield
1db8a4e818 Branch OpenSceneGraph-3.4
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@14938 16af8721-9629-0410-8352-f15c8da7e697
2015-07-03 06:30:28 +00:00
1521 changed files with 67396 additions and 76633 deletions

View File

@@ -1,11 +0,0 @@
# CodeDocs.xyz Configuration File
DOXYFILE = doc/Doxyfiles/doxyfile.cmake
PROJECT_NUMBER =
PROJECT_LOGO = examples/osgAndroidExampleGLES1/res/drawable-hdpi/osg.png
INPUT = include
STRIP_FROM_PATH = include/
HTML_FOOTER =
SEARCHENGINE = YES

11
.gitignore vendored
View File

@@ -6,10 +6,6 @@ doc/openthreads.doxyfile
doc/OpenSceneGraphReferenceDocs/
doc/OpenThreadsReferenceDocs/
doc/*.chm
CMakeDoxyfile.in
CMakeDoxygenDefaults.cmake
cmake_uninstall.cmake
@@ -63,10 +59,6 @@ install_manifest*.txt
*.out
*.app
# Automatically generated Package files
packaging/cmake/*
configure/*
# Platform Specifics - auto generated files
PlatformSpecifics/Windows/*.rc
@@ -87,9 +79,6 @@ PlatformSpecifics/Windows/*.rc
*.sdf
*.opensdf
# Visual Studio - Cache/Options Directory
.vs/
#osx xcode
DerivedData/
*.DS_Store

View File

@@ -1,12 +1,3 @@
env:
global:
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
# via the "travis encrypt" command using the project repo's public key
- secure: "0ROQiFbsZo33ce2v5VjBxNljemh/HU70ntSSPygYwaDFymubts/62SixXVkbKNIFdrs3uYD6qeA/eMmpqXxLcs+PXNq5NrH7eSWw9oDIKMhq3NQH/IZLdRfXwihHimZ1qEs/TXyWlT2aC4rpBi1py3cJeTh1aBMlz4V/nm16iRAgc596ThNTuPDHa0F9/gZnwccI/Rr9VpiYn7vEBbuY9lYr43D0G3NuuQyvvlHShroH09fh6KyFOWIY38AQtnuVGNC1fIiAUk7TUqDqSBwhIrUV5saHbP0kca6DP32REkv//h4JwM76UHv+ntVEoK/UiztJHMkrw71gXYTyvIvlDBpT+IDoeIwUW2QFNQ5zJZI7FM8k0+oeK+F7k/mkffDzr1zww/PQoxqFBF0PoxAni/L9qkA4X2o1A6mRDbe9besp2LQG6Vniwj3bHpCId2QiiMrANVg0EAqkcL2mVFEaqZsh90qCkr1UDq4WQoYbXh0Fy3UnQpbuxDvCME8u03lwuv6ds/SBxc5cgKv7oWXgezaDg7/OCR+0lIAGuLqmNRD8Xw7a0WZGmSbYCHIZmeyFja2KuUvMiVCt8+QsyZr3e523DwBwnSj1BIYFRstMaSEJgu9B8rfTRRllOOKJXCQtdFVuGu8VI6PniSAkI6c535yOWzsuS8HwIkN2ll+Wn7E="
language: cpp
cache: ccache
matrix:
fast_finish: true
include:
@@ -15,25 +6,16 @@ matrix:
dist: trusty
language: cpp
env:
# - CMAKECMD_ARGS="-DBUILD_OSG_EXAMPLES=ON -DBUILD_OSG_PLUGINS_BY_DEFAULT=ON -DBUILD_OSG_APPLICATIONS=ON"
- CMAKECMD_ARGS="-DBUILD_OSG_EXAMPLES=OFF -DBUILD_OSG_PLUGINS_BY_DEFAULT=ON -DBUILD_OSG_APPLICATIONS=ON"
#- LLVM_VERSION=3.8
sudo: false
cache:
apt: true
ccache: true
compiler:
#- clang
- gcc
directories:
- $HOME/.ccache
compiler:
#- clang
- g++
addons:
coverity_scan:
project:
name: "openscenegraph/OpenSceneGraph"
description: "OpenSceneGraph build"
notification_email: robert@openscenegraph.com
build_command_prepend: "cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_OSG_DEPRECATED_SERIALIZERS=OFF -DBUILD_OSG_EXAMPLES=OFF ."
build_command: "make -j 4"
branch_pattern: coverity_scan
apt:
sources:
#- llvm-toolchain-precise-3.8
@@ -42,27 +24,13 @@ matrix:
#- clang-3.8
- g++
- cmake
# # OSX build
# - os: osx
# before_install:
# - brew update
# install:
# - brew install ccache
# - export PATH="/usr/local/opt/ccache/libexec:$PATH"
# env:
# - CMAKECMD_ARGS="-DBUILD_OSG_EXAMPLES=OFF -DBUILD_OSG_PLUGINS_BY_DEFAULT=ON -DBUILD_OSG_APPLICATIONS=ON"
#
#
# - os: osx
# before_install:
# - brew update
# install:
# - brew install ccache
# - export PATH="/usr/local/opt/ccache/libexec:$PATH"
# env:
# - CMAKECMD_ARGS="-DBUILD_OSG_EXAMPLES=ON -DBUILD_OSG_PLUGINS_BY_DEFAULT=OFF -DBUILD_OSG_APPLICATIONS=OFF -DBUILD_OSG_DEPRECATED_SERIALIZERS=OFF"
# OSX build
- os: osx
language: cpp
script:
- if [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then mkdir build && cd build && travis_wait 60 cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../product $CMAKECMD_ARGS ../ ; fi
- if [ -f CMakeCache.txt ]; then make -j4 ; fi
- 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,14 +1,12 @@
OpenSceneGraph Library 3.6.4
OpenSceneGraph Library 3.4.1
570 Contributors:
562 Contributors:
Firstname Surname
-----------------
Robert Osfield
Don Burns
Stephan Huber
Paul Martz
Laurens Voerman
Farshid Lashkari
Mathias Fr<46>hlich
Marco Jez
@@ -25,13 +23,13 @@ Wojciech Lewandowski
Michael Platings
Geoff Michel
Eric Sokolowsky
Laurens Voerman
David Callu
Colin McDonald
Trajce Nikolov
Tim Moore
Martin Lavery
Mattias Helsing
Jannik Heller
Jason Beverage
Tree
Pjotr Svetachov
@@ -43,18 +41,18 @@ Chris Hanson
Roland Smeenk
Roger James
Jeremy Moles
Andy Skinner
Jannik Heller
J.P. Delport
Andy Skinner
Magnus Kessler
David Fries
Tom Jolley
Paul Melis
Jordi Torres
Luc Frauciel
Aurelien Albert
Torben Dannhauer
Pavel Moloshtan
Brad Christiansen
Torben Dannhauer
Terry Welsh
Olaf Flebbe
Mathieu Marache
@@ -91,16 +89,16 @@ Bryan Thrall
Andreas Ekstrand
Rafa Gaitan
Mike Connell
Konstantin Matveyev
Fabien Lavignotte
Thomas Hogarth
Riccardo Corsi
Melchior Franz
Konstantin Matveyev
Johannes Baeuerle
Ravi Mathur
Neil Hughes
Martin Beckett
Marc Helbling
Jordi Torres
Joran Jessurun
Gino van den Bergen
David Guthrie
@@ -112,7 +110,7 @@ Yefei He
Sondra Iverson
Simon Julier
Rune Schmidt Jensen
Ralf Habacker
Ravi Mathur
Rainer Oder
Nico Kruithof
Martin Aumueller
@@ -125,10 +123,9 @@ Frederic Bouvier
Carlo Camporesi
Bj<EFBFBD>rn Blissing
Alexander Sinditskiy
Vladimir Chebaev
Thibault Genessay
Sasa Bistrovic
Raymond de Vries
Ralf Habacker
Neil Groves
Mikhail Izmestev
Markus Trenkwalder
@@ -138,6 +135,7 @@ John Shue
Hartwig Wiesmann
Brad Colbert
Ben Discoe
Vladimir Chebaev
Vivek Rajan
Uwe Woessner
Tony Horrobin
@@ -164,7 +162,6 @@ Donn Mielcarek
Corbin Holtz
Blasius Czink
Alexander Irion
Wee See
Toshiyuki Takahei
Sebastien Grignard
Rudolf Wiedemann
@@ -186,6 +183,7 @@ Andreas Goebel
Alok Priyadarshi
Ali Botorabi
Alan Dickinson
Wee See
Vladimir Shabanov
Tugkan Calapoglu
Tim Daoust
@@ -228,11 +226,11 @@ Fabio Mierlo
Doug McCorkle
Donald Cipperly
Don Leich
Don Burns
Dietmar Funck
Colin Cochran
Christian Ruzicka
Christian Buchner
Chris Djali
Charles Cole
Blake Williams
Bj<EFBFBD>rn Hein
@@ -256,6 +254,7 @@ Stephan Eilemann
Stanislav Blinov
Sergey Polischuk
Roni Zanolli
Raymond de Vries
Ralf Kern
Piotr Gwiazdowski
Pierre Haritchabalet
@@ -363,14 +362,12 @@ Shuxing Xiao
Shane Arnott
Sergey Kurdakov
Sebastien Kuntz
Sandro Mani
Ruth Lang
Ruben The
Ruben Smelik
Ross Anderson
Ronny Krueger
Ronald van Maarseveen
Romain Ouabdelkader
Romain Charbit
Rocco Martino
Robert Swain
@@ -407,7 +404,6 @@ Orhun Birsoy
Oren Fromberg
Oliver Neumann
Ole-Morten Duesund
Ognjen Kostic
Nicolas Brodu
Nick Thu
Nick Black
@@ -492,6 +488,7 @@ Hartmut Seichter
Gunter Huber
Gregory Jaegy
Graeme Harkness
Github It
Gian Lorenzetto
George Papagiannakis
Geoff Thu
@@ -526,7 +523,6 @@ Daniel Stien
Dan Minor
C<EFBFBD>sar L. B. Silveira
Cyril Brulebois
Curtis Rubel
Cory Slep
Cl<EFBFBD>ment B<>sch
Clay Fowler
@@ -538,10 +534,8 @@ Christophe Herreman
Christian Noon
Christian Kaser
Christian Ehrlicher
Chris White
Chris McGlone
Carlos Garcea
Capostrophic
Bryce Eldridge
Bruno Herbelin
Brian Keener
@@ -556,7 +550,6 @@ Bart Gallet
Axel Volley
Arjun Ramamurthy
Anthousis Andreadis
Anna Sokol
Andy Preece
Andrew Reyonolds
Andreas Roth
@@ -573,4 +566,3 @@ Alan Harris
Adrien Grandemange
Adrian Clark
Adam Richard
Abhishek Bansal

View File

@@ -1,19 +1,15 @@
#
# OpenSceneGraph CMake build file
#
SET(OPENSCENEGRAPH_MAJOR_VERSION 3)
SET(OPENSCENEGRAPH_MINOR_VERSION 6)
SET(OPENSCENEGRAPH_PATCH_VERSION 5)
SET(OPENSCENEGRAPH_SOVERSION 161)
# set to 0 when not a release candidate, non zero means that any generated
# git tags will be treated as release candidates of given number
SET(OPENSCENEGRAPH_RELEASE_CANDIDATE 0)
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR)
IF(WIN32)
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.6 FATAL_ERROR)
ELSE(WIN32)
IF(APPLE)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0 FATAL_ERROR)
ELSE(APPLE)
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.4 FATAL_ERROR)
ENDIF(APPLE)
ENDIF(WIN32)
if(COMMAND cmake_policy)
# Works around warnings libraries linked against that don't
@@ -26,98 +22,43 @@ if(COMMAND cmake_policy)
# tell CMake to prefer CMake's own CMake modules when available
# only available from cmake-2.8.4
if("${CMAKE_VERSION}" VERSION_GREATER 2.8.3)
if(${CMAKE_MAJOR_VERSION} GREATER 2 OR
(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 8) OR
(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 8 AND ${CMAKE_PATCH_VERSION} GREATER 3))
cmake_policy(SET CMP0017 NEW)
endif()
endif()
# cmake-2.6.1 introduces policy cmp0008 decide how to treat full path libraries that do not appear to be valid library file names
# quote from cvslog "Such libraries worked by accident in the VS IDE and Xcode generators in CMake 2.4 and below."
if(${CMAKE_MAJOR_VERSION} GREATER 2 OR
(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 6) OR
(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 6 AND ${CMAKE_PATCH_VERSION} GREATER 0))
cmake_policy(SET CMP0008 OLD)
endif()
IF(APPLE)
# Get OSX version in MAJOR.MINOR format
EXECUTE_PROCESS(COMMAND sw_vers -productVersion
OUTPUT_VARIABLE OSG_OSX_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
STRING(REGEX REPLACE "^([0-9]+\\.[0-9]+).*$" "\\1"
OSG_OSX_VERSION "${OSG_OSX_VERSION}")
ENDIF()
# disable autolinking to qtmain as we have our own main() functions (new in Qt 5.1)
if(${CMAKE_MAJOR_VERSION} GREATER 2 OR
(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 8) OR
(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 8 AND ${CMAKE_PATCH_VERSION} GREATER 10))
cmake_policy(SET CMP0020 OLD)
endif()
# nicer version check - but needs at least CMake 2.6.2? Worth upgrading the requirements?
#if("${CMAKE_VERSION}" VERSION_GREATER 2.8.10)
# or even easier (available in cmake-2.6)
#if(POLICY CMPxyzw)
endif()
PROJECT(OpenSceneGraph)
# Set OSX architecture flags here, since they must be specified before
# creating the actual OSG project.
# Note that the CMAKE_OSX_* variables are not well documented in
# CMake 2.8, but they do officially exist.
# See https://cmake.org/Bug/view.php?id=14695#c34953
# Additionally, OSG_WINDOWING_SYSTEM is set here for OSX since its
# value is needed to find the correct version of OpenGL (X11 or Cocoa).
IF(ANDROID)
SET(OSG_WINDOWING_SYSTEM "None" CACHE STRING "Windowing system type for graphics window creation; options: None.")
ELSEIF(WIN32 OR MINGW)
SET(OSG_WINDOWING_SYSTEM "Win32" CACHE STRING "Windowing system type for graphics window creation; options: Win32 or None.")
ELSEIF(APPLE)
# custom option to flag an iOS build
OPTION(OSG_BUILD_PLATFORM_IPHONE "Enable IPhoneSDK Device support" OFF)
IF(OSG_BUILD_PLATFORM_IPHONE)
# set sdk and min versions
SET (IPHONE_SDKVER "10.2" CACHE STRING "IOS SDK-Version")
SET (IPHONE_VERSION_MIN "7.0" CACHE STRING "IOS minimum os version, use 7.0 or greater to get 64bit support")
# get full path to sdk from requested versions
SET (IPHONE_DEVROOT "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer")
SET (IPHONE_SDKROOT "${IPHONE_DEVROOT}/SDKs/iPhoneOS${IPHONE_SDKVER}.sdk")
# optionally enable bitcode for the build
SET (IPHONE_ENABLE_BITCODE "NO" CACHE STRING "IOS Enable Bitcode")
# seamless toggle between device and simulator
SET(CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphoneos;-iphonesimulator" CACHE STRING "Xcode effective platforms for iOS")
# set deployment target to min version
SET(CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "${IPHONE_VERSION_MIN}" CACHE STRING "Xcode deployment target for iOS")
# Set standard architectures
SET(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD)" CACHE STRING "Build architectures for iOS")
ELSE()
# OSX >= 10.5 uses Cocoa windowing system, otherwise Carbon
IF(OSG_OSX_VERSION VERSION_LESS 10.5)
SET(OSG_WINDOWING_SYSTEM "Carbon" CACHE STRING "Windowing system type for graphics window creation; options: Carbon, Cocoa, X11 or None.")
SET(OSG_WINDOWING_SYSTEM_CARBON ON INTERNAL "use Carbon (apple; 32 bit only)")
ELSE()
SET(OSG_WINDOWING_SYSTEM "Cocoa" CACHE STRING "Windowing system type for graphics window creation; options: Carbon, Cocoa, X11 or None.")
ENDIF()
# Set defaults for Universal Binaries. We want 32-bit Intel/PPC on 10.4
# and 32/64-bit Intel/PPC on >= 10.5. Anything <= 10.3 doesn't support.
# These are set the first time CMake is run, and can be changed by
# the user at any time.
IF(OSG_OSX_VERSION VERSION_GREATER 10.7)
# 64 Bit Works, i386,ppc is not supported any more
SET(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "Build architectures for OSX")
SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.8" CACHE STRING "Target OSX version")
ELSEIF(OSG_OSX_VERSION VERSION_EQUAL 10.7)
# 64 Bit Works, PPC is not supported any more
SET(CMAKE_OSX_ARCHITECTURES "i386;x86_64" CACHE STRING "Build architectures for OSX")
ELSEIF(OSG_OSX_VERSION VERSION_GREATER 10.4)
# 64-bit compiles are not supported with Carbon.
SET(CMAKE_OSX_ARCHITECTURES "ppc;i386" CACHE STRING "Build architectures for OSX")
SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.5" CACHE STRING "Target OSX version")
ELSEIF(OSG_OSX_VERSION VERSION_EQUAL 10.4)
# 64-bit compiles are not supported with Carbon.
SET(CMAKE_OSX_ARCHITECTURES "ppc;i386" CACHE STRING "Build architectures for OSX")
ELSE()
# No Universal Binary support and SDK detection is too unreliable.
# Warn user and continue at their own peril.
MESSAGE(WARNING "OSX 10.3 and earlier not supported.")
ENDIF()
ENDIF()
ELSE()
SET(OSG_WINDOWING_SYSTEM "X11" CACHE STRING "Windowing system type for graphics window creation; options: X11 or None.")
ENDIF()
SET(OPENSCENEGRAPH_MAJOR_VERSION 3)
SET(OPENSCENEGRAPH_MINOR_VERSION 4)
SET(OPENSCENEGRAPH_PATCH_VERSION 1)
SET(OPENSCENEGRAPH_SOVERSION 131)
# set to 0 when not a release candidate, non zero means that any generated
# git tags will be treated as release candidates of given number
SET(OPENSCENEGRAPH_RELEASE_CANDIDATE 0)
SET(OPENSCENEGRAPH_VERSION ${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION})
@@ -204,19 +145,19 @@ IF (OSG_MAINTAINER)
)
ADD_CUSTOM_TARGET(branch-test
COMMAND echo ${GITCOMMAND} branch ${OPENSCENEGRAPH_BRANCH}
COMMAND echo ${GITCOMMAND} branch ${OPENSCENEGRAPH_BRANCH} -m ${BRANCH_MESSAGE}
COMMAND echo ${GITCOMMAND} push origin ${OPENSCENEGRAPH_BRANCH}
)
ADD_CUSTOM_TARGET(branch-run
COMMAND ${GITCOMMAND} branch ${OPENSCENEGRAPH_BRANCH}
COMMAND ${GITCOMMAND} branch ${OPENSCENEGRAPH_BRANCH} -m ${BRANCH_MESSAGE}
COMMAND ${GITCOMMAND} push origin ${OPENSCENEGRAPH_BRANCH}
)
#
# Provide target for generating ChangeLog
#
SET(GITLOGFORMAT "%aD%nAuthor : %an%n%s%b%n")
SET(GITLOGFORMAT "%aD%nChecked in by : %an%n%s%b%n")
SET(GENERATELOGS git log --pretty=format:${GITLOGFORMAT})
ADD_CUSTOM_TARGET(ChangeLog
@@ -227,45 +168,56 @@ ENDIF(OSG_MAINTAINER)
IF(NOT ANDROID)
IF(APPLE)
# Determine the canonical name of the selected Platform SDK
EXECUTE_PROCESS(COMMAND "/usr/bin/sw_vers" "-productVersion"
OUTPUT_VARIABLE OSG_OSX_SDK_NAME
OUTPUT_STRIP_TRAILING_WHITESPACE)
STRING(REPLACE "." ";" MACOS_VERSION_LIST ${OSG_OSX_SDK_NAME})
LIST(GET MACOS_VERSION_LIST 0 MACOS_VERSION_MAJOR)
LIST(GET MACOS_VERSION_LIST 1 MACOS_VERSION_MINOR)
LIST(GET MACOS_VERSION_LIST 2 MACOS_VERSION_PATCH)
IF(OSG_BUILD_PLATFORM_IPHONE)
SET(OSG_OSX_SDK_NAME "macosx${MACOS_VERSION_MAJOR}.${MACOS_VERSION_MINOR}")
# set the sdk path as our sysroot, if we set this before the project is defined cmake fails to build its test program
SET(CMAKE_OSX_SYSROOT "${IPHONE_SDKROOT}" CACHE STRING "System root for iOS" FORCE)
# Trying to get CMake to generate an XCode IPhone project, current efforts are to get iphoneos sdk 3.1 working
# Added option which needs manually setting to select the IPhone SDK for building. We can only have one of the below
# set to true. Should realy have an OSG_BUILD_PLATFORM variable that we set to our desired platform
OPTION(OSG_BUILD_PLATFORM_IPHONE "Enable IPhoneSDK Device support" OFF)
OPTION(OSG_BUILD_PLATFORM_IPHONE_SIMULATOR "Enable IPhoneSDK Simulator support" OFF)
# Set the path to OpenGL library
SET(OPENGL_gl_LIBRARY "${IPHONE_SDKROOT}/System/Library/Frameworks/OpenGLES.framework")
IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
#you need to manually set the default sdk version here
SET (IPHONE_SDKVER "6.0" CACHE STRING "IOS SDK-Version")
SET (IPHONE_VERSION_MIN "4.2" CACHE STRING "IOS minimum os version, use 7.0 or greater to get 64bit support")
#the below is taken from ogre, it states the gcc stuff needs to happen before PROJECT() is called. I've no clue if we even need it
# Force gcc <= 4.2 on iPhone
IF(IPHONE_VERSION_MIN LESS "6.0")
include(CMakeForceCompiler)
CMAKE_FORCE_C_COMPILER(llvm-gcc-4.2 GNU)
CMAKE_FORCE_CXX_COMPILER(llvm-gcc-4.2 GNU)
SET(GCC_THUMB_SUPPORT NO)
ENDIF()
#set either the device sdk or the simulator sdk. Can't find away to separate these in the same project
IF(OSG_BUILD_PLATFORM_IPHONE)
SET (IPHONE_DEVROOT "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer")
SET (IPHONE_SDKROOT "${IPHONE_DEVROOT}/SDKs/iPhoneOS${IPHONE_SDKVER}.sdk")
ELSE()
SET (IPHONE_DEVROOT "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer")
SET (IPHONE_SDKROOT "${IPHONE_DEVROOT}/SDKs/iPhoneSimulator${IPHONE_SDKVER}.sdk")
ENDIF()
# Apple iOS: Find OpenGLES
FIND_LIBRARY(OPENGLES_LIBRARY OpenGLES)
ELSE ()
FIND_LIBRARY(CARBON_LIBRARY Carbon)
FIND_LIBRARY(COCOA_LIBRARY Cocoa)
# Apple OS X: Find OpenGL and AGL based on OSG_WINDOWING_SYSTEM
# This is the accepted way of finding X11/OpenGL on OSX, as
# documented in CMake's FindOpenGL module.
# Note that without this check, libosg would use Cocoa/OpenGL but
# libosgViewer would use X11/OpenGL, which causes compatibility
# issues for applications using OSG.
UNSET(OPENGL_gl_LIBRARY CACHE)
UNSET(OPENGL_INCLUDE_DIR CACHE)
IF(OSG_WINDOWING_SYSTEM STREQUAL "X11")
FIND_PACKAGE(X11)
IF(NOT X11_FOUND)
MESSAGE(FATAL_ERROR "OSG_WINDOWING_SYSTEM is X11, but no X11 installation was found. Please make sure X11 is properly installed.")
ENDIF()
# Use X11 version of OpenGL as seed for CMake FindOpenGL
GET_FILENAME_COMPONENT(X11LIBDIR ${X11_X11_LIB} DIRECTORY)
FIND_LIBRARY(OPENGL_gl_LIBRARY GL PATHS ${X11LIBDIR} DOC "OpenGL lib for OSX" NO_DEFAULT_PATH)
SET(OPENGL_INCLUDE_DIR ${X11_INCLUDE_DIR} CACHE PATH "Include for OpenGL on OSX" FORCE)
ELSEIF(OSG_WINDOWING_SYSTEM STREQUAL "Carbon")
# AGL needed for Carbon windowing systems
FIND_LIBRARY(AGL_LIBRARY AGL)
ENDIF()
# Apple OS X: Find OpenGL and AGL
FIND_PACKAGE(OpenGL)
FIND_PACKAGE(EGL)
FIND_LIBRARY(AGL_LIBRARY AGL)
ENDIF ()
OPTION(OSG_COMPILE_FRAMEWORKS "compile frameworks instead of dylibs (experimental)" OFF)
@@ -273,7 +225,6 @@ IF(APPLE)
ELSE()
# Non-Apple: Find OpenGL
FIND_PACKAGE(OpenGL)
FIND_PACKAGE(EGL)
ENDIF()
ENDIF()
@@ -299,30 +250,22 @@ IF(UNIX AND NOT ANDROID)
ENDIF()
INCLUDE_DIRECTORIES(
${OpenSceneGraph_SOURCE_DIR}/include
${OPENGL_INCLUDE_DIR}
)
# Make the headers visible to everything
IF(NOT ${PROJECT_BINARY_DIR} EQUAL ${PROJECT_SOURCE_DIR})
INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR}/include)
ENDIF()
INCLUDE_DIRECTORIES(${OpenSceneGraph_SOURCE_DIR}/include/)
INCLUDE_DIRECTORIES(SYSTEM ${OPENGL_INCLUDE_DIR})
# Common global definitions
#ADD_DEFINITIONS(-D)
# Platform specific definitions
IF(WIN32 AND NOT ANDROID)
OPTION(OSG_DETERMINE_WIN_VERSION "Wheter to automatically determine current Windows version" ON)
IF(OSG_DETERMINE_WIN_VERSION)
# Check window version
INCLUDE (OsgDetermineWinVersion)
get_WIN32_WINNT(WIN_VERSION)
ADD_DEFINITIONS(-D_WIN32_WINNT=${WIN_VERSION})
ENDIF(OSG_DETERMINE_WIN_VERSION)
IF(MSVC)
# This option is to enable the /MP switch for Visual Studio 2005 and above compilers
@@ -391,15 +334,21 @@ IF(WIN32 AND NOT ANDROID)
##########################################################################################################
IF(MSVC)
OPTION(OSG_MSVC_VERSIONED_DLL "Set to ON to build OpenSceneGraph with versioned dll names" ON)
MARK_AS_ADVANCED(OSG_MSVC_VERSIONED_DLL)
OPTION(OSG_MSVC_DEBUG_INCREMENTAL_LINK "Set to OFF to build OpenSceneGraph without incremental linking in debug (release is off by default)" ON)
MARK_AS_ADVANCED(OSG_MSVC_DEBUG_INCREMENTAL_LINK)
IF(NOT OSG_MSVC_DEBUG_INCREMENTAL_LINK)
SET(CMAKE_MODULE_LINKER_FLAGS_DEBUG "/debug /INCREMENTAL:NO")
SET(CMAKE_SHARED_LINKER_FLAGS_DEBUG "/debug /INCREMENTAL:NO")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "/debug /INCREMENTAL:NO")
ENDIF(NOT OSG_MSVC_DEBUG_INCREMENTAL_LINK)
IF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4 AND ${CMAKE_PATCH_VERSION} LESS 7)
MESSAGE("Warning: disabling versioned options 2.4.6 exibits inconsintencies in .pdb naming, at least under MSVC, suggested upgrading at least to 2.4.7")
SET(OSG_MSVC_VERSIONED_DLL OFF)
SET(OSG_MSVC_DEBUG_INCREMENTAL_LINK ON)
ELSE()
OPTION(OSG_MSVC_VERSIONED_DLL "Set to ON to build OpenSceneGraph with versioned dll names" ON)
MARK_AS_ADVANCED(OSG_MSVC_VERSIONED_DLL)
OPTION(OSG_MSVC_DEBUG_INCREMENTAL_LINK "Set to OFF to build OpenSceneGraph without incremental linking in debug (release is off by default)" ON)
MARK_AS_ADVANCED(OSG_MSVC_DEBUG_INCREMENTAL_LINK)
IF(NOT OSG_MSVC_DEBUG_INCREMENTAL_LINK)
SET(CMAKE_MODULE_LINKER_FLAGS_DEBUG "/debug /INCREMENTAL:NO")
SET(CMAKE_SHARED_LINKER_FLAGS_DEBUG "/debug /INCREMENTAL:NO")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "/debug /INCREMENTAL:NO")
ENDIF(NOT OSG_MSVC_DEBUG_INCREMENTAL_LINK)
ENDIF()
ENDIF(MSVC)
ENDIF(WIN32 AND NOT ANDROID)
@@ -424,8 +373,6 @@ ENDIF(WIN32 AND NOT ANDROID)
OPTION(OSG_NOTIFY_DISABLED "Set to ON to build OpenSceneGraph with the notify() disabled." OFF)
OPTION(OSG_USE_DEPRECATED_API "Set to ON to build OpenSceneGraph with the OSG_USE_DEPREFATED_API #define enabled to allow access to deprecated APIs ." ON)
OPTION(OSG_USE_FLOAT_MATRIX "Set to ON to build OpenSceneGraph with float Matrix instead of double." OFF)
MARK_AS_ADVANCED(OSG_USE_FLOAT_MATRIX)
@@ -438,9 +385,6 @@ MARK_AS_ADVANCED(OSG_USE_FLOAT_BOUNDINGSPHERE)
OPTION(OSG_USE_FLOAT_BOUNDINGBOX "Set to ON to build OpenSceneGraph with float BoundingBox instead of double." ON)
MARK_AS_ADVANCED(OSG_USE_FLOAT_BOUNDINGBOX)
OPTION(OSG_USE_FLOAT_QUAT "Set to ON to build OpenSceneGraph with float Quat instead of double." OFF)
MARK_AS_ADVANCED(OSG_USE_FLOAT_QUAT)
IF (WIN32)
OPTION(OSG_USE_UTF8_FILENAME "Set to ON to use a UTF8 locale for filenames instead of the default locale." OFF)
MARK_AS_ADVANCED(OSG_USE_UTF8_FILENAME)
@@ -451,10 +395,6 @@ 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_SAFE_DEREFERENCE "Set to ON to throw an exception whenever ref_ptr<> is dereferenced or called. " OFF)
OPTION(OSG_ENVVAR_SUPPORTED "Set to ON to build OpenSceneGraph with the #define OSG_ENVVAR_SUPPORTED, found in include/osg/Config, to enable use of getenv() related functions." ON)
# Map the OPENGL_PROFILE to OSG_GL*_AVAILABLE settings
@@ -474,9 +414,6 @@ ENDIF()
IF ((OPENGL_PROFILE STREQUAL "GL3") OR (OPENGL_PROFILE STREQUAL "GLCORE"))
OPTION(OSG_GL3_AVAILABLE "Set to OFF to disable use of OpenGL 3.x functions library." ON )
if(APPLE)
add_definitions(-DGL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED)
endif()
ELSE()
OPTION(OSG_GL3_AVAILABLE "Set to OFF to disable use of OpenGL 3.x functions library." OFF )
ENDIF()
@@ -490,8 +427,6 @@ ENDIF()
IF ((OPENGL_PROFILE STREQUAL "GLES2"))
OPTION(OSG_GLES2_AVAILABLE "Set to OFF to disable use of OpenGL ES 2.x functions library." ON )
ELSEIF ((OPENGL_PROFILE STREQUAL "GLES3"))
OPTION(OSG_GLES3_AVAILABLE "Set to OFF to disable use of OpenGL ES 3.x functions library." ON )
ELSEIF ((OPENGL_PROFILE STREQUAL "GLES2+GLES3"))
OPTION(OSG_GLES2_AVAILABLE "Set to OFF to disable use of OpenGL ES 2.x functions library." ON )
OPTION(OSG_GLES3_AVAILABLE "Set to OFF to disable use of OpenGL ES 3.x functions library." ON )
ELSE()
@@ -502,14 +437,10 @@ ENDIF()
OPTION(OSG_GL_LIBRARY_STATIC "Set to ON to statically link with OpenGL/GLES library." OFF)
IF (OSG_BUILD_PLATFORM_IPHONE OR ANDROID)
OPTION(OSG_TEXT_USE_FONTCONFIG "Set to ON to enable attempt to use FontConfig in osgText." OFF)
ELSE ()
OPTION(OSG_TEXT_USE_FONTCONFIG "Set to OFF to disable attempt to use FontConfig in osgText." ON)
ENDIF ()
SET(OPENGL_egl_LIBRARY CACHE STRING "Set the OpenGL egl library.")
# Map the OSG_GL*_AVAILABLE settings to OSG_GL_* settings
IF (OSG_GLES2_AVAILABLE OR OSG_GLES3_AVAILABLE OR OSG_GL3_AVAILABLE)
IF (OSG_GLES2_AVAILABLE OR OSG_GL3_AVAILABLE)
OPTION(OSG_GL_DISPLAYLISTS_AVAILABLE "Set to OFF to disable use of OpenGL display lists." OFF)
OPTION(OSG_GL_MATRICES_AVAILABLE "Set to OFF to disable use of OpenGL built-in matrices." OFF)
OPTION(OSG_GL_VERTEX_FUNCS_AVAILABLE "Set to OFF to disable use of OpenGL vertex functions such as glVertex/glColor etc." OFF)
@@ -529,7 +460,7 @@ ELSE()
OPTION(OSG_GL_FIXED_FUNCTION_AVAILABLE "Set to OFF to disable use of OpenGL fixed function pipeline." ON)
ENDIF()
IF (OSG_GLES1_AVAILABLE OR OSG_GLES2_AVAILABLE OR OSG_GLES3_AVAILABLE)
IF (OSG_GLES1_AVAILABLE OR OSG_GLES2_AVAILABLE)
OPTION(OSG_CPP_EXCEPTIONS_AVAILABLE "Set to OFF to disable compile of OSG components that use C++ exceptions." OFF)
ELSE()
OPTION(OSG_CPP_EXCEPTIONS_AVAILABLE "Set to OFF to disable compile of OSG components that use C++ exceptions." ON)
@@ -537,11 +468,7 @@ ENDIF()
# Map the OSG_GL*_AVAILABLE settings to OpenGL header settings
SET(DEFAULT_GL_CONTEXT_VERSION "1.0")
IF (OSG_GL3_AVAILABLE)
SET(DEFAULT_GL_CONTEXT_VERSION "3.3")
IF (APPLE)
SET(OPENGL_HEADER1 "#include <OpenGL/gl.h>" CACHE STRING "#include<> line for OpenGL Header")
SET(OPENGL_HEADER2 "#include <OpenGL/gl3.h>" CACHE STRING "#include<> line for additional OpenGL Headers if required")
@@ -554,7 +481,7 @@ IF (OSG_GL3_AVAILABLE)
SET(OPENGL_HEADER1 "#include <GL/glcorearb.h>" CACHE STRING "#include<> line for OpenGL Header")
SET(OPENGL_HEADER2 "" CACHE STRING "#include<> line for additional OpenGL Headers if required")
ELSE()
SET(OPENGL_HEADER1 "#include <GL/gl.h>" CACHE STRING "#include<> line for OpenGL Header")
SET(OPENGL_HEADER1 "#include <GL3/gl3.h>" CACHE STRING "#include<> line for OpenGL Header")
SET(OPENGL_HEADER2 "" CACHE STRING "#include<> line for additional OpenGL Headers if required")
ENDIF()
@@ -571,17 +498,11 @@ ELSEIF(OSG_GLES2_AVAILABLE)
IF (APPLE AND NOT ANDROID)
SET(OPENGL_HEADER1 "#include \"TargetConditionals.h\"" CACHE STRING "#include<> line for OpenGL Header")
SET(OPENGL_HEADER2 "#include <OpenGLES/ES2/gl.h>" CACHE STRING "#include<> line for additional OpenGL Headers if required")
# TODO: GLES3
ELSE()
SET(OPENGL_HEADER1 "#include <GLES2/gl2.h>" CACHE STRING "#include<> line for OpenGL Header")
SET(OPENGL_HEADER2 "" CACHE STRING "#include<> line for additional OpenGL Headers if required")
ENDIF()
ELSEIF(OSG_GLES3_AVAILABLE)
IF (APPLE AND NOT ANDROID)
SET(OPENGL_HEADER1 "#include \"TargetConditionals.h\"" CACHE STRING "#include<> line for OpenGL Header")
SET(OPENGL_HEADER2 "#include <OpenGLES/ES3/gl.h>" CACHE STRING "#include<> line for additional OpenGL Headers if required")
ELSE()
SET(OPENGL_HEADER1 "#include <GLES3/gl3.h>" CACHE STRING "#include<> line for OpenGL Header")
SET(OPENGL_HEADER2 "" CACHE STRING "#include<> line for additional OpenGL Headers if required")
# TODO: GLES3
ENDIF()
ELSE()
IF (APPLE)
@@ -593,8 +514,6 @@ ELSE()
ENDIF()
ENDIF()
SET(OSG_GL_CONTEXT_VERSION ${DEFAULT_GL_CONTEXT_VERSION} CACHE STRING "GL Context String to pass when creaing graphics contexts")
IF (OSG_GL1_AVAILABLE)
SET(OSG_GL1_FEATURES 1)
ELSE()
@@ -646,13 +565,6 @@ IF(ANDROID)
FIND_LIBRARY(OPENGL_gl_LIBRARY GLESv2
PATHS
${ANDROID_SYSROOT}/usr/lib)
ELSEIF(OSG_GLES3_AVAILABLE)
FIND_PATH(OPENGL_INCLUDE_DIR GLES3/gl3.h
PATHS
${ANDROID_SYSROOT}/usr/include)
FIND_LIBRARY(OPENGL_gl_LIBRARY GLESv3
PATHS
${ANDROID_SYSROOT}/usr/lib)
ENDIF()
ENDIF()
@@ -718,9 +630,6 @@ OPTION(BUILD_OSG_APPLICATIONS "Enable to build OSG Applications (e.g. osgviewer)
# OSG Examples
OPTION(BUILD_OSG_EXAMPLES "Enable to build OSG Examples" OFF)
# OSG Plugins disable option for apple build on travis ci test - full build job runs over time limit of 50 min.
OPTION(BUILD_OSG_PLUGINS "Build OSG Plugins - Disable for compile testing examples on a time limit" ON)
mark_as_advanced(BUILD_OSG_PLUGINS)
################################################################################
# 3rd Party Dependency Stuff
IF(WIN32 AND NOT ANDROID)
@@ -739,19 +648,20 @@ IF(ANDROID)
ELSE()
# Common to all platforms except android:
FIND_PACKAGE(Freetype)
FIND_PACKAGE(ilmbase)
FIND_PACKAGE(Inventor)
FIND_PACKAGE(Jasper)
FIND_PACKAGE(OpenEXR)
FIND_PACKAGE(OpenCascade)
FIND_PACKAGE(COLLADA)
FIND_PACKAGE(FBX)
FIND_PACKAGE(ZLIB)
FIND_PACKAGE(Xine)
FIND_PACKAGE(OpenVRML)
FIND_PACKAGE(Performer)
FIND_PACKAGE(GDAL)
FIND_PACKAGE(GTA)
FIND_PACKAGE(CURL)
FIND_PACKAGE(LibVNCServer)
FIND_PACKAGE(DCMTK)
FIND_PACKAGE(OurDCMTK)
FIND_PACKAGE(FFmpeg)
FIND_PACKAGE(GStreamer COMPONENTS app pbutils)
FIND_PACKAGE(GLIB COMPONENTS gobject)
@@ -782,17 +692,79 @@ ELSE()
# FIND_PACKAGE(PythonLibs)
ENDIF()
IF(CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION LESS 8)
FIND_PACKAGE(ITK)
ENDIF()
# Include macro utilities here
INCLUDE(OsgMacroUtils)
OPTION(OSG_USE_QT "Enable to use Qt (build Qt-dependent libraries, plugins and examples)" ON)
IF(OSG_USE_QT AND NOT ANDROID)
# To select a specific version of QT define DESIRED_QT_VERSION
# via cmake -DDESIRED_QT_VERSION=5
# QUIET option disables messages if the package cannot be found.
IF (DESIRED_QT_VERSION)
IF (DESIRED_QT_VERSION MATCHES 5)
FIND_PACKAGE(Qt5Widgets)
ELSEIF (DESIRED_QT_VERSION MATCHES 4)
FIND_PACKAGE(Qt4)
ELSE()
FIND_PACKAGE(Qt3)
ENDIF()
ELSE()
FIND_PACKAGE(Qt5Widgets QUIET)
IF ( Qt5Widgets_FOUND )
# CMake 2.8.8 or greater required
BUILDER_VERSION_GREATER(2 8 7)
IF(NOT VALID_BUILDER_VERSION)
MESSAGE(
SEND_ERROR
"Qt5 requires CMake version 2.8.8 or greater!\n"
"Update CMake or set DESIRED_QT_VERSION to less than 5
or disable OSG_USE_QT."
)
ENDIF( )
ENDIF( )
IF ( NOT Qt5Widgets_FOUND )
FIND_PACKAGE(Qt4)
IF (NOT QT4_FOUND)
FIND_PACKAGE(Qt3)
ENDIF()
ENDIF()
ENDIF()
#If we have found Qt5, let's try to top off by getting the webkit as well
IF ( Qt5Widgets_FOUND )
FIND_PACKAGE(Qt5WebKitWidgets QUIET)
IF(COMMAND cmake_policy)
IF(${CMAKE_MAJOR_VERSION} GREATER 2)
# Qt5 qt5_use_modules usage was causing "Policy CMP0043 is not set: Ignore COMPILE_DEFINITIONS_<Config> properties." warnings
cmake_policy(SET CMP0043 NEW)
ENDIF()
ENDIF()
ENDIF()
ENDIF()
#optional example related dependencies
IF (BUILD_OSG_EXAMPLES AND NOT ANDROID)
FIND_PACKAGE(FLTK)
FIND_PACKAGE(GLUT)
FIND_PACKAGE(FOX)
FIND_PACKAGE(wxWidgets COMPONENTS base core gl net)
SET(wxWidgets_USE_LIBS base core gl net)
FIND_PACKAGE(wxWidgets)
ENDIF(BUILD_OSG_EXAMPLES AND NOT ANDROID)
@@ -849,17 +821,6 @@ SET(CMAKE_RELEASE_POSTFIX "" CACHE STRING "add a postfix, usually empty on windo
SET(CMAKE_RELWITHDEBINFO_POSTFIX "rd" CACHE STRING "add a postfix, usually empty on windows")
SET(CMAKE_MINSIZEREL_POSTFIX "s" CACHE STRING "add a postfix, usually empty on windows")
# Correct any incorrect case usage in CMAKE_BUILD_TYPE
IF (CMAKE_BUILD_TYPE MATCHES "release" OR CMAKE_BUILD_TYPE MATCHES "RELEASE")
SET(CMAKE_BUILD_TYPE "Release")
ELSEIF (CMAKE_BUILD_TYPE MATCHES "minsizerel" OR CMAKE_BUILD_TYPE MATCHES "MINSIZEREL")
SET(CMAKE_BUILD_TYPE "MinSizeRel")
ELSEIF (CMAKE_BUILD_TYPE MATCHES "relwithdebinfo" OR CMAKE_BUILD_TYPE MATCHES "RELWITHDEBINFO")
SET(CMAKE_BUILD_TYPE "RelWithDebInfo")
ELSEIF (CMAKE_BUILD_TYPE MATCHES "debug" OR CMAKE_BUILD_TYPE MATCHES "DEBUG")
SET(CMAKE_BUILD_TYPE "Debug")
ENDIF()
# Set the build postfix extension according to what configuration is being built.
IF (CMAKE_BUILD_TYPE MATCHES "Release")
SET(CMAKE_BUILD_POSTFIX "${CMAKE_RELEASE_POSTFIX}")
@@ -883,33 +844,17 @@ IF(CYGWIN)
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG")
ENDIF()
# Set OSG_INSTALL_LIBDIR to specify the installation directories of object code libraries
IF(DEFINED LIB_POSTFIX)
# Use LIB_POSTFIX if defined
SET(OSG_INSTALL_LIBDIR lib${LIB_POSTFIX})
ELSE()
IF(CMAKE_VERSION VERSION_LESS "2.8.5")
IF(UNIX AND NOT WIN32 AND NOT APPLE)
IF(CMAKE_SIZEOF_VOID_P MATCHES "8")
SET(LIB_POSTFIX "64" CACHE STRING "suffix for 32/64 dir placement")
MARK_AS_ADVANCED(LIB_POSTFIX)
ENDIF()
ENDIF()
IF(NOT DEFINED LIB_POSTFIX)
SET(LIB_POSTFIX "")
ENDIF()
SET(OSG_INSTALL_LIBDIR lib${LIB_POSTFIX})
ELSE()
# Use the GNU standard installation directories for CMake >= 2.8.5
INCLUDE(GNUInstallDirs)
SET(OSG_INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR})
IF(UNIX AND NOT WIN32 AND NOT APPLE)
IF(CMAKE_SIZEOF_VOID_P MATCHES "8")
SET(LIB_POSTFIX "64" CACHE STRING "suffix for 32/64 dir placement")
MARK_AS_ADVANCED(LIB_POSTFIX)
ENDIF()
ENDIF()
IF(NOT DEFINED LIB_POSTFIX)
SET(LIB_POSTFIX "")
ENDIF()
# Here we apparently do some funky stuff with making the bin/ and lib/
# Here we apparantly do some funky stuff with making the bin/ and lib/
# folders which is probably needed to work around a very old CMake bug?
#SET(OUTPUT_BINDIR ${PROJECT_BINARY_DIR}/bin/${CMAKE_SYSTEM_NAME})
@@ -926,32 +871,45 @@ IF(NOT MSVC OR MSVC_IDE)
MAKE_DIRECTORY(${OUTPUT_LIBDIR}/${OSG_PLUGINS})
ENDIF(NOT MSVC OR MSVC_IDE)
# On CMake 2.4.x use EXECUTABLE_OUTPUT_PATH and LIBRARY_OUTPUT_PATH and later
# we work around the DLL placement by use of the PREFIX target property hack
#
# On CMake 2.6.x use the newly minted CMAKE_LIBRARY_OUTPUT_DIRECTORY,
# CMAKE_ARCHIVE_OUTPUT_DIRECTORY & CMAKE_RUNTIME_OUTPUT_DIRECTORY
#
# CMake >= 2.8.1 changed the output directory algorithm (See doc).
# Here we also set per-configuration directories (CMAKE_*_OUTPUT_DIRECTORY_<CONFIG>), or else binaries are generated in /bin/Debug and /bin/Release, etc. with MSVC and Xcode.
# (Doc reads "multi-configuration generators (VS, Xcode) do NOT append a per-configuration subdirectory to the specified directory").
# The workaround for 2.6.x (adding "../" as an output prefix for each target) seem to have no effect in >=2.8.1, so there is no need to change this.
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_LIBDIR})
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_BINDIR})
IF(WIN32)
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_BINDIR})
ELSE(WIN32)
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_LIBDIR})
ENDIF(WIN32)
IF(CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION LESS 5)
# If CMake < 2.6.0
SET(EXECUTABLE_OUTPUT_PATH ${OUTPUT_BINDIR})
SET(LIBRARY_OUTPUT_PATH ${OUTPUT_LIBDIR})
ELSE()
# If CMake >= 2.6.0
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_LIBDIR})
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_BINDIR})
IF(WIN32)
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_BINDIR})
ELSE(WIN32)
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_LIBDIR})
ENDIF(WIN32)
# Testing CMAKE_VERSION is possible in >= 2.6.4 only
BUILDER_VERSION_GREATER(2 8 0)
IF(VALID_BUILDER_VERSION) # If CMake >= 2.8.1
FOREACH(CONF ${CMAKE_CONFIGURATION_TYPES}) # For each configuration (Debug, Release, MinSizeRel... and/or anything the user chooses)
STRING(TOUPPER "${CONF}" CONF) # Go uppercase (DEBUG, RELEASE...)
SET("CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CONF}" "${OUTPUT_LIBDIR}")
SET("CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CONF}" "${OUTPUT_BINDIR}")
IF(WIN32)
SET("CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CONF}" "${OUTPUT_BINDIR}")
ELSE()
SET("CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CONF}" "${OUTPUT_LIBDIR}")
ENDIF()
ENDFOREACH()
ENDIF(VALID_BUILDER_VERSION)
# Testing CMAKE_VERSION is possible in >= 2.6.4 only
BUILDER_VERSION_GREATER(2 8 0)
IF(VALID_BUILDER_VERSION) # If CMake >= 2.8.1
FOREACH(CONF ${CMAKE_CONFIGURATION_TYPES}) # For each configuration (Debug, Release, MinSizeRel... and/or anything the user chooses)
STRING(TOUPPER "${CONF}" CONF) # Go uppercase (DEBUG, RELEASE...)
SET("CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CONF}" "${OUTPUT_LIBDIR}")
SET("CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CONF}" "${OUTPUT_BINDIR}")
IF(WIN32)
SET("CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CONF}" "${OUTPUT_BINDIR}")
ELSE()
SET("CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CONF}" "${OUTPUT_LIBDIR}")
ENDIF()
ENDFOREACH()
ENDIF(VALID_BUILDER_VERSION)
ENDIF()
#SET(INSTALL_BINDIR OpenSceneGraph/bin)
#SET(INSTALL_INCDIR OpenSceneGraph/include)
@@ -982,7 +940,6 @@ SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} CACHE STRING "You may add additiona
# This is unofficial so this may be removed or changed at anytime.
SET(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} CACHE STRING "(EXPERIMENTAL) You may add additional search paths here. Use ; to separate multiple paths.")
# This is for an advanced option to give aggressive warnings
# under different compilers. If yours is not implemented, this option
# will not be made available.
@@ -999,19 +956,6 @@ IF(CMAKE_COMPILER_IS_GNUCXX)
# to be the workaround.
SET(OSG_AGGRESSIVE_WARNING_FLAGS -Wall -Wparentheses -Wno-long-long -Wno-import -pedantic -Wreturn-type -Wmissing-braces -Wunknown-pragmas -Wunused)
MESSAGE( STATUS "g++ version ${CMAKE_CXX_COMPILER_VERSION} ")
IF(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.6)
SET(OSG_AGGRESSIVE_WARNING_FLAGS ${OSG_AGGRESSIVE_WARNING_FLAGS} -Wmaybe-uninitialized -Wextra)
IF(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.9)
SET(OSG_AGGRESSIVE_WARNING_FLAGS ${OSG_AGGRESSIVE_WARNING_FLAGS} -Wshadow)
IF(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0)
# -Wmisleading-indentation (in -Wall) generates less warnings when interpreting tab as 4 spaces instead of the default of 8
# SET(OSG_AGGRESSIVE_WARNING_FLAGS ${OSG_AGGRESSIVE_WARNING_FLAGS} -ftabstop=4)
SET(OSG_AGGRESSIVE_WARNING_FLAGS ${OSG_AGGRESSIVE_WARNING_FLAGS} -Wno-misleading-indentation)
ENDIF()
ENDIF()
ENDIF()
# Previous included -Wformat=2 in OSG_AGGRESSIVE_WARNING_FLAGS but had to remove it due to standard library errors
@@ -1020,8 +964,7 @@ ELSEIF(MSVC)
#C4100 'identifier' : unreferenced formal parameter
#C4127 Error Message conditional expression is constant
#C4706 assignment within conditional expression
#C4589: Constructor of abstract class 'osgGA::CameraManipulator' ignores initializer for virtual base class 'osg::Object'
SET(OSG_AGGRESSIVE_WARNING_FLAGS /W4 /wd4589 /wd4706 /wd4127 /wd4100)
SET(OSG_AGGRESSIVE_WARNING_FLAGS /W4 /wd4706 /wd4127 /wd4100)
ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
SET(OSG_AGGRESSIVE_WARNING_FLAGS -Wall -Wparentheses -Wno-long-long -Wno-import -pedantic -Wreturn-type -Wmissing-braces -Wunknown-pragmas -Wunused -Wno-overloaded-virtual)
@@ -1064,17 +1007,16 @@ ENDIF()
# This will only be made available if we set values for OSG_AGGRESSIVE_WARNING_FLAGS.
IF(OSG_AGGRESSIVE_WARNING_FLAGS)
SET(OSG_AGGRESSIVE_WARNING_FLAGS ${OSG_AGGRESSIVE_WARNING_FLAGS} CACHE STRING "Compiler flags to use when OSG_AGGRESSIVE_WARNINGS is enabled." FORCE)
IF (APPLE)
SET(DEFAULT_USE_AGGRESSIVE_WARNINGS OFF)
ELSE()
SET(DEFAULT_USE_AGGRESSIVE_WARNINGS ON)
ENDIF()
OPTION(OSG_AGGRESSIVE_WARNINGS "Enable to activate aggressive warnings" ${DEFAULT_USE_AGGRESSIVE_WARNINGS})
OPTION(OSG_USE_AGGRESSIVE_WARNINGS "Enable to activate aggressive warnings" ${DEFAULT_USE_AGGRESSIVE_WARNINGS})
MARK_AS_ADVANCED(OSG_USE_AGGRESSIVE_WARNINGS)
IF(OSG_AGGRESSIVE_WARNINGS)
IF(OSG_USE_AGGRESSIVE_WARNINGS)
# Add flags defined by OSG_AGGRESSIVE_WARNING_FLAGS if they aren't already there
FOREACH(flag ${OSG_AGGRESSIVE_WARNING_FLAGS})
IF(NOT CMAKE_CXX_FLAGS MATCHES "${flag}")
@@ -1082,7 +1024,7 @@ IF(OSG_AGGRESSIVE_WARNING_FLAGS)
ENDIF()
ENDFOREACH()
ELSE()
# Remove all flags considered aggressive
# Remove all flags considered aggresive
FOREACH(flag ${OSG_AGGRESSIVE_WARNING_FLAGS})
STRING(REGEX REPLACE "${flag}" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
ENDFOREACH()
@@ -1113,15 +1055,41 @@ ENDIF()
IF(APPLE AND NOT ANDROID)
IF(OSG_BUILD_PLATFORM_IPHONE)
#Here we check if the user specified IPhone SDK
IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
# set osg window system to iOS
SET(OSG_WINDOWING_SYSTEM "IOS" CACHE STRING "Windowing system type for graphics window creation, options only IOS." FORCE)
#set iphone arch and flags taken from http://sites.google.com/site/michaelsafyan/coding/resources/how-to-guides/cross-compile-for-the-iphone/how-to-cross-compile-for-the-iphone-using-cmake
IF(OSG_BUILD_PLATFORM_IPHONE)
IF(${IPHONE_VERSION_MIN} LESS "7.0")
SET(CMAKE_OSX_ARCHITECTURES "armv6;armv7" CACHE STRING "Build architectures for iOS" FORCE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mno-thumb -pipe -no-cpp-precomp" CACHE STRING "Flags used by the compiler during all build types." FORCE)
ELSE()
SET(CMAKE_OSX_ARCHITECTURES "armv7;armv7s;arm64" CACHE STRING "Build architectures for iOS" FORCE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -no-cpp-precomp" CACHE STRING "Flags used by the compiler during all build types." FORCE)
ENDIF()
# set osg default image plugin
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -miphoneos-version-min=${IPHONE_VERSION_MIN}" FORCE)
ELSE()
#simulator uses i386 architectures
SET(CMAKE_OSX_ARCHITECTURES "i386" CACHE STRING "Build architectures for iOS Simulator" FORCE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mno-thumb -arch i386 -pipe -no-cpp-precomp" CACHE STRING "Flags used by the compiler during all build types." FORCE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mios-simulator-version-min=${IPHONE_VERSION_MIN}" FORCE)
ENDIF()
#here we set the specific iphone sdk version. We can only set either device or simulator sdk. So if you want both you currently have to have two seperate projects
SET(CMAKE_OSX_SYSROOT "${IPHONE_SDKROOT}" CACHE STRING "System root for iOS" FORCE)
#hack, force link to opengles
set(CMAKE_EXE_LINKER_FLAGS "-framework Foundation -framework OpenGLES")
#use the IPhone windowing system
SET(OSG_WINDOWING_SYSTEM "IOS" CACHE STRING "Forced IPhone windowing system on iOS" FORCE)
SET(OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX "imageio" CACHE STRING "Forced imageio default image plugin for iOS" FORCE)
# ensure app bundles for example app
#I think this or similar will be required for IPhone apps
OPTION(OSG_BUILD_APPLICATION_BUNDLES "Enable the building of applications and examples as OSX Bundles" ON)
ELSE()
@@ -1136,19 +1104,30 @@ IF(APPLE AND NOT ANDROID)
# FORCE is used because the options are not reflected in the UI otherwise.
# Seems like a good place to add version specific compiler flags too.
IF(NOT OSG_CONFIG_HAS_BEEN_RUN_BEFORE)
IF(OSG_OSX_VERSION VERSION_GREATER 10.7)
SET(OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX "imageio" CACHE STRING "Forced imageio default image plugin for OSX" FORCE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden" CACHE STRING "Flags used by the compiler during all build types." FORCE)
ELSEIF(OSG_OSX_VERSION VERSION_EQUAL 10.7)
SET(OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX "imageio" CACHE STRING "Forced imageio default image plugin for OSX" FORCE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden" CACHE STRING "Flags used by the compiler during all build types." FORCE)
ELSEIF(OSG_OSX_VERSION VERSION_GREATER 10.4)
SET(OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX "imageio" CACHE STRING "Forced imageio default image plugin for OSX" FORCE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftree-vectorize -fvisibility-inlines-hidden" CACHE STRING "Flags used by the compiler during all build types." FORCE)
ELSEIF(OSG_OSX_VERSION VERSION_EQUAL 10.4)
SET(OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX "quicktime" CACHE STRING "Forced imageio default image plugin for OSX" FORCE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftree-vectorize -fvisibility-inlines-hidden" CACHE STRING "Flags used by the compiler during all build types." FORCE)
ENDIF()
IF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.8" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.9" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.10")
SET(OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX "imageio" CACHE STRING "Forced imageio default image plugin for OSX" FORCE)
# 64 Bit Works, i386,ppc is not supported any more
SET(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "Build architectures for OSX" FORCE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.8 -fvisibility-inlines-hidden" CACHE STRING "Flags used by the compiler during all build types." FORCE)
ELSEIF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.7")
SET(OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX "imageio" CACHE STRING "Forced imageio default image plugin for OSX" FORCE)
# 64 Bit Works, PPC is not supported any more
SET(CMAKE_OSX_ARCHITECTURES "i386;x86_64" CACHE STRING "Build architectures for OSX" FORCE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.7 -fvisibility-inlines-hidden" CACHE STRING "Flags used by the compiler during all build types." FORCE)
ELSEIF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.6" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.5")
SET(OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX "imageio" CACHE STRING "Forced imageio default image plugin for OSX" FORCE)
# 64-bit compiles are not supported with Carbon.
SET(CMAKE_OSX_ARCHITECTURES "ppc;i386" CACHE STRING "Build architectures for OSX" FORCE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.5 -ftree-vectorize -fvisibility-inlines-hidden" CACHE STRING "Flags used by the compiler during all build types." FORCE)
ELSEIF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.4")
SET(OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX "quicktime" CACHE STRING "Forced imageio default image plugin for OSX" FORCE)
SET(CMAKE_OSX_ARCHITECTURES "ppc;i386" CACHE STRING "Build architectures for OSX" FORCE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.4 -ftree-vectorize -fvisibility-inlines-hidden" CACHE STRING "Flags used by the compiler during all build types." FORCE)
ELSE()
# No Universal Binary support
# Should break down further to set the -mmacosx-version-min,
# but the SDK detection is too unreliable here.
ENDIF()
ENDIF()
OPTION(OSG_BUILD_APPLICATION_BUNDLES "Enable the building of applications and examples as OSX Bundles" OFF)
@@ -1287,6 +1266,10 @@ SET(PKGCONFIG_FILES
openscenegraph-osgVolume
)
IF(QT4_FOUND OR Qt5Widgets_FOUND )
SET(PKGCONFIG_FILES ${PKGCONFIG_FILES} openscenegraph-osgQt)
ENDIF()
FOREACH(PKGCONFIG_FILE ${PKGCONFIG_FILES})
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/packaging/pkgconfig/${PKGCONFIG_FILE}.pc.in
${PROJECT_BINARY_DIR}/packaging/pkgconfig/${PKGCONFIG_FILE}.pc
@@ -1347,13 +1330,6 @@ IF(NOT OSG_CONFIG_HAS_BEEN_RUN_BEFORE)
SET(OSG_CONFIG_HAS_BEEN_RUN_BEFORE 1 CACHE INTERNAL "Flag to track whether this is the first time running CMake or if CMake has been configured before")
ENDIF()
#-----------------------------------------------------------------------------
# add clobber build target to clear all the non git registered files/directories
#-----------------------------------------------------------------------------
add_custom_target(clobber
COMMAND git clean -d -f -x
)
#-----------------------------------------------------------------------------
### uninstall target
#-----------------------------------------------------------------------------
@@ -1365,5 +1341,4 @@ ADD_CUSTOM_TARGET(uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
#
include(FeatureSummary)
feature_summary(WHAT ALL)

View File

@@ -65,7 +65,7 @@ ENDMACRO(FIND_DEPENDENCY DEPNAME INCLUDEFILE LIBRARY_NAMES_BASE SEARCHPATHLIST D
MACRO(SEARCH_3RDPARTY OSG_3RDPARTY_BIN)
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;freetype27;freetype271;" ${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)
#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)

View File

@@ -30,9 +30,11 @@ ELSE()
# AVFoundation exists since 10.7, but only 10.8 has all features necessary for OSG
# so check the SDK-setting
IF(OSG_OSX_VERSION VERSION_LESS 10.8)
MESSAGE("AVFoundation disabled for SDK < 10.8")
SET(AV_FOUNDATION_FOUND "NO")
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 ;-)
ELSE()
MESSAGE("AVFoundation disabled for SDK < 10.8")
SET(AV_FOUNDATION_FOUND "NO")
ENDIF()
ENDIF()
ENDIF()

View File

@@ -23,41 +23,26 @@ ELSE ()
ENDIF()
IF(APPLE)
SET(COLLADA_BUILDNAME "mac")
SET(COLLADA_BOOST_BUILDNAME ${COLLADA_BUILDNAME})
ELSEIF(MINGW)
SET(COLLADA_BUILDNAME "mingw")
SET(COLLADA_BOOST_BUILDNAME ${COLLADA_BUILDNAME})
ELSEIF((MSVC_VERSION GREATER 1910) OR (MSVC_VERSION EQUAL 1910))
ELSEIF(MSVC14)
SET(COLLADA_BUILDNAME "vc14")
SET(COLLADA_BOOST_BUILDNAME "vc141")
ELSEIF(MSVC_VERSION EQUAL 1900)
SET(COLLADA_BUILDNAME "vc14")
SET(COLLADA_BOOST_BUILDNAME "vc140")
ELSEIF(MSVC_VERSION EQUAL 1800)
ELSEIF(MSVC12)
SET(COLLADA_BUILDNAME "vc12")
SET(COLLADA_BOOST_BUILDNAME "vc120")
ELSEIF(MSVC_VERSION EQUAL 1700)
ELSEIF(MSVC11)
SET(COLLADA_BUILDNAME "vc11")
SET(COLLADA_BOOST_BUILDNAME "vc110")
ELSEIF(MSVC_VERSION EQUAL 1600)
ELSEIF(MSVC10)
SET(COLLADA_BUILDNAME "vc10")
SET(COLLADA_BOOST_BUILDNAME "vc100")
ELSEIF(MSVC_VERSION EQUAL 1500)
ELSEIF(MSVC90)
SET(COLLADA_BUILDNAME "vc9")
SET(COLLADA_BOOST_BUILDNAME "vc90")
ELSEIF(MSVC_VERSION EQUAL 1400)
ELSEIF(MSVC80)
SET(COLLADA_BUILDNAME "vc8")
SET(COLLADA_BOOST_BUILDNAME "vc80")
ELSE()
ELSE(APPLE)
SET(COLLADA_BUILDNAME "linux")
SET(COLLADA_BOOST_BUILDNAME ${COLLADA_BUILDNAME})
ENDIF()
IF(${CMAKE_VS_PLATFORM_TOOLSET})
string(REPLACE "v" "vc" COLLADA_BOOST_BUILDNAME ${CMAKE_VS_PLATFORM_TOOLSET})
ENDIF()
ENDIF(APPLE)
FIND_PATH(COLLADA_INCLUDE_DIR dae.h
@@ -70,17 +55,14 @@ FIND_PATH(COLLADA_INCLUDE_DIR dae.h
/usr/local/include
/usr/local/include/colladadom
/usr/local/include/collada-dom
/usr/local/include/collada-dom2.5
/usr/local/include/collada-dom2.4
/usr/local/include/collada-dom2.2
/opt/local/include/collada-dom
/opt/local/include/collada-dom2.5
/opt/local/include/collada-dom2.4
/opt/local/include/collada-dom2.2
/usr/include/
/usr/include/colladadom
/usr/include/collada-dom
/usr/include/collada-dom2.5
/usr/include/collada-dom2.4
/usr/include/collada-dom2.2
/sw/include # Fink
@@ -92,7 +74,7 @@ FIND_PATH(COLLADA_INCLUDE_DIR dae.h
)
FIND_LIBRARY(COLLADA_DYNAMIC_LIBRARY
NAMES collada_dom collada14dom Collada14Dom libcollada14dom21 libcollada14dom22 collada-dom2.5-dp collada-dom2.5-dp-${COLLADA_BOOST_BUILDNAME}-mt collada-dom2.4-dp collada-dom2.4-dp-${COLLADA_BOOST_BUILDNAME}-mt
NAMES collada_dom collada14dom Collada14Dom libcollada14dom21 libcollada14dom22 collada-dom2.4-dp collada-dom2.4-dp-vc120-mt
PATHS
${COLLADA_DOM_ROOT}/build/${COLLADA_BUILDNAME}-1.4
${COLLADA_DOM_ROOT}
@@ -116,7 +98,7 @@ FIND_LIBRARY(COLLADA_DYNAMIC_LIBRARY
)
FIND_LIBRARY(COLLADA_DYNAMIC_LIBRARY_DEBUG
NAMES collada_dom-d collada14dom-d Collada14Dom-d libcollada14dom21-d libcollada14dom22-d collada-dom2.5-dp-d collada-dom2.5-dp-${COLLADA_BOOST_BUILDNAME}-mt-d collada-dom2.4-dp-d collada-dom2.4-dp-${COLLADA_BOOST_BUILDNAME}-mt-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
${COLLADA_DOM_ROOT}/build/${COLLADA_BUILDNAME}-1.4-d
${COLLADA_DOM_ROOT}
@@ -279,7 +261,7 @@ FIND_LIBRARY(COLLADA_STATIC_LIBRARY_DEBUG
)
FIND_LIBRARY(COLLADA_BOOST_FILESYSTEM_LIBRARY
NAMES libboost_filesystem boost_filesystem boost_filesystem-mt libboost_filesystem-${COLLADA_BOOST_BUILDNAME}-mt libboost_filesystem-${COLLADA_BOOST_BUILDNAME}-mt-1_54 libboost_filesystem-${COLLADA_BOOST_BUILDNAME}-mt-1_55 libboost_filesystem-${COLLADA_BOOST_BUILDNAME}-mt-1_58 boost_filesystem-${COLLADA_BOOST_BUILDNAME}-mt-1_62 boost_filesystem-${COLLADA_BOOST_BUILDNAME}-mt-1_63
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
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
@@ -287,7 +269,7 @@ FIND_LIBRARY(COLLADA_STATIC_LIBRARY_DEBUG
)
FIND_LIBRARY(COLLADA_BOOST_FILESYSTEM_LIBRARY_DEBUG
NAMES libboost_filesystem-d boost_filesystem-d boost_filesystem-mt-d libboost_filesystem-${COLLADA_BOOST_BUILDNAME}-mt-gd libboost_filesystem-${COLLADA_BOOST_BUILDNAME}-mt-gd-1_54 libboost_filesystem-${COLLADA_BOOST_BUILDNAME}-mt-gd-1_55 libboost_filesystem-${COLLADA_BOOST_BUILDNAME}-mt-gd-1_58 boost_filesystem-${COLLADA_BOOST_BUILDNAME}-mt-gd-1_62 boost_filesystem-${COLLADA_BOOST_BUILDNAME}-mt-gd-1_63
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
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
@@ -295,7 +277,7 @@ FIND_LIBRARY(COLLADA_STATIC_LIBRARY_DEBUG
)
FIND_LIBRARY(COLLADA_BOOST_SYSTEM_LIBRARY
NAMES libboost_system boost_system boost_system-mt libboost_system-${COLLADA_BOOST_BUILDNAME}-mt libboost_system-${COLLADA_BOOST_BUILDNAME}-mt-1_54 libboost_system-${COLLADA_BOOST_BUILDNAME}-mt-1_55 libboost_system-${COLLADA_BOOST_BUILDNAME}-mt-1_58 boost_system-${COLLADA_BOOST_BUILDNAME}-mt-1_62 boost_system-${COLLADA_BOOST_BUILDNAME}-mt-1_63
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
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
@@ -303,7 +285,7 @@ FIND_LIBRARY(COLLADA_STATIC_LIBRARY_DEBUG
)
FIND_LIBRARY(COLLADA_BOOST_SYSTEM_LIBRARY_DEBUG
NAMES libboost_system-d boost_system-d boost_system-mt-d libboost_system-${COLLADA_BOOST_BUILDNAME}-mt-gd libboost_system-${COLLADA_BOOST_BUILDNAME}-mt-gd-1_54 libboost_system-${COLLADA_BOOST_BUILDNAME}-mt-gd-1_55 libboost_system-${COLLADA_BOOST_BUILDNAME}-mt-gd-1_58 boost_system-${COLLADA_BOOST_BUILDNAME}-mt-gd-1_62 boost_system-${COLLADA_BOOST_BUILDNAME}-mt-gd-1_63
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
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw

View File

@@ -1,33 +0,0 @@
# Finds EGL header and library
#
# This script defines the following:
# EGL_FOUND // Set to TRUE if EGL is found
# EGL_INCLUDE_DIR // Parent directory of directory EGL/egl.h header.
#
# EGL_DIR can be set as an environment variable or a CMake variable,
# to the parent directory of the EGL header.
#
FIND_PATH( EGL_INCLUDE_DIR
NAMES EGL/egl.h
HINTS ENV EGL_DIR
)
FIND_LIBRARY(EGL_LIBRARY
NAMES EGL
HINTS ENV EGL_DIR
PATH_SUFFIXES lib
)
# handle the QUIETLY and REQUIRED arguments and set
# EGL_FOUND to TRUE as appropriate
INCLUDE( FindPackageHandleStandardArgs )
FIND_PACKAGE_HANDLE_STANDARD_ARGS(EGL
REQUIRED_VARS EGL_LIBRARY EGL_INCLUDE_DIR)
MARK_AS_ADVANCED(
EGL_INCLUDE_DIR
EGL_LIBRARY
)

View File

@@ -9,12 +9,7 @@
# correspond to the ./configure --prefix=$FBX_DIR
IF(APPLE)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# using regular Clang or AppleClang
SET(FBX_LIBDIR "clang")
else()
SET(FBX_LIBDIR "gcc4/ub")
endif()
ELSEIF(CMAKE_COMPILER_IS_GNUCXX)
SET(FBX_LIBDIR "gcc4")
ELSEIF(MSVC80)
@@ -25,22 +20,15 @@ ELSEIF(MSVC10)
SET(FBX_LIBDIR "vs2010")
ELSEIF(MSVC11)
SET(FBX_LIBDIR "vs2012")
ELSEIF(MSVC_VERSION EQUAL 1800)
ELSEIF(MSVC12 OR MSVC_VERSION>1800)
SET(FBX_LIBDIR "vs2013")
ELSEIF(MSVC_VERSION EQUAL 1900)
SET(FBX_LIBDIR "vs2015")
ELSEIF(MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS 1920)
SET(FBX_LIBDIR "vs2017")
ELSEIF(MSVC_VERSION GREATER_EQUAL 1920 AND MSVC_VERSION LESS 1930)
# SET(FBX_LIBDIR "vs2019") # FBX doesn't have this yet as of version 2020.0.1
SET(FBX_LIBDIR "vs2017") # Binary compatible with vs2019
ENDIF()
IF(APPLE)
# do nothing
ELSEIF(CMAKE_CL_64)
SET(FBX_LIBDIR ${FBX_LIBDIR}/x64)
ELSEIF(CMAKE_SIZEOF_VOID_P EQUAL 8)
ELSEIF(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(FBX_LIBDIR ${FBX_LIBDIR}/x64)
ELSE()
SET(FBX_LIBDIR ${FBX_LIBDIR}/x86)
@@ -49,61 +37,17 @@ ENDIF()
#try to use 2015.1 or 2014.2 version
IF(APPLE)
SET(FBX_LIBNAME "fbxsdk")
SET(FBX_LIBNAME "libfbxsdk")
ELSEIF(CMAKE_COMPILER_IS_GNUCXX)
SET(FBX_LIBNAME "fbxsdk")
ELSE()
OPTION(FBX_SHARED OFF)
IF(FBX_SHARED)
SET(FBX_LIBNAME "libfbxsdk")
ELSE()
SET(FBX_LIBNAME "libfbxsdk-md")
IF(WIN32)
SET(FBX_XML2_LIBNAME "libxml2-md")
SET(FBX_ZLIB_LIBNAME "zlib-md")
ENDIF()
ENDIF()
SET(FBX_LIBNAME "libfbxsdk-md")
ENDIF()
SET(FBX_LIBNAME_DEBUG ${FBX_LIBNAME}d)
SET( FBX_SEARCH_PATHS
$ENV{FBX_DIR}
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2020.0.1"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2020.0.1"
"/Applications/Autodesk/FBX SDK/2020.0.1"
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2020.0"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2020.0"
"/Applications/Autodesk/FBX SDK/2020.0"
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2019.5"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2019.5"
"/Applications/Autodesk/FBX SDK/2019.5"
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2019.2"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2019.2"
"/Applications/Autodesk/FBX SDK/2019.2"
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2019.0"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2019.0"
"/Applications/Autodesk/FBX SDK/2019.0"
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2018.1.1"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2018.1.1"
"/Applications/Autodesk/FBX SDK/2018.1.1"
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2018.0"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2018.0"
"/Applications/Autodesk/FBX SDK/2018.0"
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2017.1"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2017.1"
"/Applications/Autodesk/FBX SDK/2017.1"
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2017.0"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2017.0"
"/Applications/Autodesk/FBX SDK/2017.0"
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2016.1.2"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2016.1.2"
"/Applications/Autodesk/FBX/FBX SDK/2016.1.2"
/Applications/Autodesk/FBXSDK201612
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2016.1.1"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2016.1.1"
"/Applications/Autodesk/FBX/FBX SDK/2016.1.1"
/Applications/Autodesk/FBXSDK201611
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2015.1"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2015.1"
"/Applications/Autodesk/FBX/FBX SDK/2015.1"
@@ -132,21 +76,6 @@ FIND_LIBRARY( FBX_LIBRARY_DEBUG ${FBX_LIBNAME_DEBUG}
PATHS ${FBX_SEARCH_PATHS}
PATH_SUFFIXES "lib/${FBX_LIBDIR}")
IF(WIN32)
FIND_LIBRARY( FBX_XML2_LIBRARY ${FBX_XML2_LIBNAME}
PATHS ${FBX_SEARCH_PATHS}
PATH_SUFFIXES "lib/${FBX_LIBDIR}/release" "lib/${FBX_LIBDIR}")
FIND_LIBRARY( FBX_ZLIB_LIBRARY ${FBX_ZLIB_LIBNAME}
PATHS ${FBX_SEARCH_PATHS}
PATH_SUFFIXES "lib/${FBX_LIBDIR}/release" "lib/${FBX_LIBDIR}")
FIND_LIBRARY( FBX_XML2_LIBRARY_DEBUG ${FBX_XML2_LIBNAME}
PATHS ${FBX_SEARCH_PATHS}
PATH_SUFFIXES "lib/${FBX_LIBDIR}/debug")
FIND_LIBRARY( FBX_ZLIB_LIBRARY_DEBUG ${FBX_ZLIB_LIBNAME}
PATHS ${FBX_SEARCH_PATHS}
PATH_SUFFIXES "lib/${FBX_LIBDIR}/debug")
ENDIF()
IF(FBX_LIBRARY AND FBX_LIBRARY_DEBUG AND FBX_INCLUDE_DIR)
SET(FBX_FOUND "YES")
ELSE()

View File

@@ -12,7 +12,7 @@
#In ffmpeg code, old version use "#include <header.h>" and newer use "#include <libname/header.h>"
#In OSG ffmpeg plugin, we used "#include <header.h>" for compatibility with old version of ffmpeg
#With the new version of FFmpeg, a file named "time.h" was added that breaks compatibility with the old version of ffmpeg.
#With the new version of FFmpeg, a file named "time.h" was added that breaks compatability with the old version of ffmpeg.
#We have to search the path which contain the header.h (useful for old version)
#and search the path which contain the libname/header.h (useful for new version)
@@ -96,7 +96,7 @@ ENDMACRO(FFMPEG_FIND)
SET(FFMPEG_ROOT "$ENV{FFMPEG_DIR}" CACHE PATH "Location of FFMPEG")
# find stdint.h
IF(MSVC)
IF(WIN32)
FIND_PATH(FFMPEG_STDINT_INCLUDE_DIR stdint.h
PATHS

View File

@@ -1,98 +0,0 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#[[=======================================================================.rst:
FindFontconfig
--------------
Find Fontconfig headers and library.
Imported Targets
^^^^^^^^^^^^^^^^
``Fontconfig::Fontconfig``
The Fontconfig library, if found.
Result Variables
^^^^^^^^^^^^^^^^
This will define the following variables in your project:
``FONTCONFIG_FOUND``
true if (the requested version of) Fontconfig is available.
``FONTCONFIG_VERSION``
the version of Fontconfig.
``FONTCONFIG_LIBRARIES``
the libraries to link against to use Fontconfig.
``FONTCONFIG_INCLUDE_DIRS``
where to find the Fontconfig headers.
``FONTCONFIG_COMPILE_OPTIONS``
this should be passed to target_compile_options(), if the
target is not used for linking
=======================================================================]]
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
find_package(PkgConfig QUIET)
pkg_check_modules(PKG_FONTCONFIG QUIET fontconfig)
set(FONTCONFIG_COMPILE_OPTIONS ${PKG_FONTCONFIG_CFLAGS_OTHER})
set(FONTCONFIG_VERSION ${PKG_FONTCONFIG_VERSION})
find_path( FONTCONFIG_INCLUDE_DIR
NAMES
fontconfig/fontconfig.h
HINTS
${PKG_FONTCONFIG_INCLUDE_DIRS}
/usr/X11/include
)
find_library( FONTCONFIG_LIBRARY
NAMES
fontconfig
PATHS
${PKG_FONTCONFIG_LIBRARY_DIRS}
)
if (FONTCONFIG_INCLUDE_DIR AND NOT FONTCONFIG_VERSION)
file(STRINGS ${FONTCONFIG_INCLUDE_DIR}/fontconfig/fontconfig.h _contents REGEX "^#define[ \t]+FC_[A-Z]+[ \t]+[0-9]+$")
unset(FONTCONFIG_VERSION)
foreach(VPART MAJOR MINOR REVISION)
foreach(VLINE ${_contents})
if(VLINE MATCHES "^#define[\t ]+FC_${VPART}[\t ]+([0-9]+)$")
set(FONTCONFIG_VERSION_PART "${CMAKE_MATCH_1}")
if(FONTCONFIG_VERSION)
string(APPEND FONTCONFIG_VERSION ".${FONTCONFIG_VERSION_PART}")
else()
set(FONTCONFIG_VERSION "${FONTCONFIG_VERSION_PART}")
endif()
endif()
endforeach()
endforeach()
endif ()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Fontconfig
FOUND_VAR
FONTCONFIG_FOUND
REQUIRED_VARS
FONTCONFIG_LIBRARY
FONTCONFIG_INCLUDE_DIR
VERSION_VAR
FONTCONFIG_VERSION
)
if(FONTCONFIG_FOUND AND NOT TARGET Fontconfig::Fontconfig)
add_library(Fontconfig::Fontconfig UNKNOWN IMPORTED)
set_target_properties(Fontconfig::Fontconfig PROPERTIES
IMPORTED_LOCATION "${FONTCONFIG_LIBRARY}"
INTERFACE_COMPILE_OPTIONS "${FONTCONFIG_COMPILE_OPTIONS}"
INTERFACE_INCLUDE_DIRECTORIES "${FONTCONFIG_INCLUDE_DIR}"
)
endif()
mark_as_advanced(FONTCONFIG_LIBRARY FONTCONFIG_INCLUDE_DIR)
if(FONTCONFIG_FOUND)
set(FONTCONFIG_LIBRARIES ${FONTCONFIG_LIBRARY})
set(FONTCONFIG_INCLUDE_DIRS ${FONTCONFIG_INCLUDE_DIR})
endif()

View File

@@ -65,7 +65,7 @@
# )
#endmacro()
if (MSVC)
if (WIN32)
macro(FIND_GSTREAMER_COMPONENT _component_prefix _pkgconfig_name _header _library)
find_path(${_component_prefix}_INCLUDE_DIRS
NAMES ${_header}

View File

@@ -16,42 +16,41 @@ IF(PKG_CONFIG_FOUND)
PKG_CHECK_MODULES(GTA gta)
ELSE(PKG_CONFIG_FOUND)
FIND_PATH(GTA_INCLUDE_DIRS gta/gta.hpp
$ENV{GTA_DIR}/include
$ENV{GTA_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local/include
/usr/include
/sw/include # Fink
/opt/local/include # DarwinPorts
/opt/csw/include # Blastwave
/opt/include
/usr/freeware/include
)
FIND_LIBRARY(GTA_LIBRARIES
NAMES gta libgta
PATHS
$ENV{GTA_DIR}/lib
$ENV{GTA_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
/usr/freeware/lib64
)
SET(GTA_FOUND "NO")
IF(GTA_LIBRARIES AND GTA_INCLUDE_DIRS)
SET(GTA_FOUND "YES")
ENDIF(GTA_LIBRARIES AND GTA_INCLUDE_DIRS)
ENDIF(PKG_CONFIG_FOUND)
IF(NOT GTA_FOUND)
FIND_PATH(GTA_INCLUDE_DIRS gta/gta.hpp
$ENV{GTA_DIR}/include
$ENV{GTA_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local/include
/usr/include
/sw/include # Fink
/opt/local/include # DarwinPorts
/opt/csw/include # Blastwave
/opt/include
/usr/freeware/include
)
FIND_LIBRARY(GTA_LIBRARY
NAMES gta libgta
PATHS
$ENV{GTA_DIR}/lib
$ENV{GTA_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
/usr/freeware/lib64
)
SET(GTA_FOUND "NO")
IF(GTA_LIBRARY AND GTA_INCLUDE_DIRS)
SET(GTA_FOUND "YES")
ENDIF(GTA_LIBRARY AND GTA_INCLUDE_DIRS)
ENDIF(NOT GTA_FOUND)

View File

@@ -17,7 +17,7 @@ macro(FIND_LIBLAS_LIBRARY MYLIBRARY MYLIBRARYNAME)
find_library(
"${MYLIBRARY}_DEBUG"
NAMES "${MYLIBRARYNAME}${CMAKE_DEBUG_POSTFIX}" "lib${MYLIBRARYNAME}${CMAKE_DEBUG_POSTFIX}"
NAMES "${MYLIBRARYNAME}${CMAKE_DEBUG_POSTFIX}"
PATHS
${LIBLAS_DIR}/lib/Debug
${LIBLAS_DIR}/lib64/Debug
@@ -30,7 +30,7 @@ macro(FIND_LIBLAS_LIBRARY MYLIBRARY MYLIBRARYNAME)
find_library(
"${MYLIBRARY}_DEBUG"
NAMES "${MYLIBRARYNAME}${CMAKE_DEBUG_POSTFIX}" "lib${MYLIBRARYNAME}${CMAKE_DEBUG_POSTFIX}"
NAMES "${MYLIBRARYNAME}${CMAKE_DEBUG_POSTFIX}"
PATHS
~/Library/Frameworks
/Library/Frameworks
@@ -48,7 +48,7 @@ macro(FIND_LIBLAS_LIBRARY MYLIBRARY MYLIBRARYNAME)
find_library(
${MYLIBRARY}
NAMES "${MYLIBRARYNAME}${CMAKE_RELEASE_POSTFIX}" "lib${MYLIBRARYNAME}${CMAKE_RELEASE_POSTFIX}"
NAMES "${MYLIBRARYNAME}${CMAKE_RELEASE_POSTFIX}"
PATHS
${LIBLAS_DIR}/lib/Release
${LIBLAS_DIR}/lib64/Release
@@ -69,7 +69,7 @@ macro(FIND_LIBLAS_LIBRARY MYLIBRARY MYLIBRARYNAME)
find_library(
${MYLIBRARY}
NAMES "${MYLIBRARYNAME}${CMAKE_RELEASE_POSTFIX}" "lib${MYLIBRARYNAME}${CMAKE_RELEASE_POSTFIX}"
NAMES "${MYLIBRARYNAME}${CMAKE_RELEASE_POSTFIX}"
PATHS
~/Library/Frameworks
/Library/Frameworks
@@ -94,15 +94,14 @@ macro(FIND_LIBLAS_LIBRARY MYLIBRARY MYLIBRARYNAME)
endmacro(FIND_LIBLAS_LIBRARY LIBRARY LIBRARYNAME)
FIND_LIBLAS_LIBRARY(LIBLAS_LIBRARY las)
FIND_LIBLAS_LIBRARY(LIBLASC_LIBRARY las_c)
set(LIBLAS_FOUND "NO")
if(LIBLAS_LIBRARY AND LIBLAS_INCLUDE_DIR)
if(LIBLAS_LIBRARY AND LIBLASC_LIBRARY AND LIBLAS_INCLUDE_DIR)
FIND_PACKAGE(Boost) # used by LIBLAS
if(Boost_FOUND)
set(LIBLAS_LIBRARIES ${LIBLAS_LIBRARY} )
set(LIBLAS_LIBRARIES ${LIBLAS_LIBRARY} ${LIBLASC_LIBRARY} )
set(LIBLAS_FOUND "YES")
if(WIN32)
link_directories(${Boost_LIBRARY_DIRS})
endif()
endif()
endif()

View File

@@ -16,7 +16,7 @@ FIND_PATH(NVTT_INCLUDE_DIR nvtt/nvtt.h
)
# NVTT
FIND_LIBRARY(NVTT_LIBRARY_RELEASE
FIND_LIBRARY(NVTT_LIBRARY
NAMES nvtt
PATHS
/usr/local
@@ -37,7 +37,7 @@ FIND_LIBRARY(NVTT_LIBRARY_DEBUG
)
# NVIMAGE
FIND_LIBRARY(NVIMAGE_LIBRARY_RELEASE
FIND_LIBRARY(NVIMAGE_LIBRARY
NAMES nvimage
PATHS
/usr/local
@@ -58,7 +58,7 @@ FIND_LIBRARY(NVIMAGE_LIBRARY_DEBUG
)
# NVMATH
FIND_LIBRARY(NVMATH_LIBRARY_RELEASE
FIND_LIBRARY(NVMATH_LIBRARY
NAMES nvmath
PATHS
/usr/local
@@ -79,7 +79,7 @@ FIND_LIBRARY(NVMATH_LIBRARY_DEBUG
)
# NVCORE
FIND_LIBRARY(NVCORE_LIBRARY_RELEASE
FIND_LIBRARY(NVCORE_LIBRARY
NAMES nvcore
PATHS
/usr/local
@@ -99,7 +99,7 @@ FIND_LIBRARY(NVCORE_LIBRARY_DEBUG
)
# NVTHREAD
FIND_LIBRARY(NVTHREAD_LIBRARY_RELEASE
FIND_LIBRARY(NVTHREAD_LIBRARY
NAMES nvthread
PATHS
/usr/local
@@ -119,7 +119,7 @@ FIND_LIBRARY(NVTHREAD_LIBRARY_DEBUG
)
# SQUISH
FIND_LIBRARY(NVSQUISH_LIBRARY_RELEASE
FIND_LIBRARY(NVSQUISH_LIBRARY
NAMES squish
PATHS
/usr/local
@@ -139,7 +139,7 @@ FIND_LIBRARY(NVSQUISH_LIBRARY_DEBUG
)
# BC6H
FIND_LIBRARY(NVBC6H_LIBRARY_RELEASE
FIND_LIBRARY(NVBC6H_LIBRARY
NAMES bc6h
PATHS
/usr/local
@@ -159,7 +159,7 @@ FIND_LIBRARY(NVBC6H_LIBRARY_DEBUG
)
# BC7
FIND_LIBRARY(NVBC7_LIBRARY_RELEASE
FIND_LIBRARY(NVBC7_LIBRARY
NAMES bc7
PATHS
/usr/local
@@ -178,34 +178,9 @@ FIND_LIBRARY(NVBC7_LIBRARY_DEBUG
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
)
IF (WIN32)
SET(LIBS_TO_SETUP "NVTT" "NVCORE" "NVMATH" "NVIMAGE" "NVTHREAD" "NVBC7" "NVBC6H" "NVSQUISH")
ELSE()
SET(LIBS_TO_SETUP "NVTT" "NVCORE" "NVMATH" "NVIMAGE")
ENDIF()
FOREACH(LIB ${LIBS_TO_SETUP})
IF(${LIB}_LIBRARY_DEBUG)
SET(${LIB}_LIBRARIES optimized ${${LIB}_LIBRARY_RELEASE} debug ${${LIB}_LIBRARY_DEBUG})
ELSE(${LIB}_LIBRARY_DEBUG)
SET(${LIB}_LIBRARY_DEBUG ${${LIB}_LIBRARY_RELEASE})
SET(${LIB}_LIBRARIES optimized ${${LIB}_LIBRARY_RELEASE} debug ${${LIB}_LIBRARY_DEBUG})
ENDIF(${LIB}_LIBRARY_DEBUG)
ENDFOREACH(LIB ${LIBS_TO_SETUP})
SET(NVTT_LIBRARIES
${NVTT_LIBRARIES}
${NVCORE_LIBRARIES}
${NVMATH_LIBRARIES}
${NVIMAGE_LIBRARIES}
${NVTHREAD_LIBRARIES}
${NVBC7_LIBRARIES}
${NVBC6H_LIBRARIES}
${NVSQUISH_LIBRARIES}
)
SET(NVTT_FOUND "NO")
IF(NVTT_LIBRARY_RELEASE AND NVTT_INCLUDE_DIR)
SET(NVTT_FOUND "YES" )
ENDIF(NVTT_LIBRARY_RELEASE AND NVTT_INCLUDE_DIR)
IF(NVTT_LIBRARY AND NVTT_INCLUDE_DIR)
SET(NVTT_FOUND "YES")
ENDIF(NVTT_LIBRARY AND NVTT_INCLUDE_DIR)

View File

@@ -116,6 +116,7 @@ FIND_OSG_LIBRARY(OSGUTIL_LIBRARY osgUtil)
FIND_OSG_LIBRARY(OSGDB_LIBRARY osgDB)
FIND_OSG_LIBRARY(OSGTEXT_LIBRARY osgText)
FIND_OSG_LIBRARY(OSGWIDGET_LIBRARY osgWidget)
FIND_OSG_LIBRARY(OSGQT_LIBRARY osgQt)
FIND_OSG_LIBRARY(OSGTERRAIN_LIBRARY osgTerrain)
FIND_OSG_LIBRARY(OSGFX_LIBRARY osgFX)
FIND_OSG_LIBRARY(OSGVIEWER_LIBRARY osgViewer)

View File

@@ -1,174 +0,0 @@
# LocateOPENCASCADE
# This module defines
# OPENCASCADE_LIBRARY
# OPENCASCADE_FOUND, if false, do not try to link to OPENCASCADE
# OPENCASCADE_INCLUDE_DIR, where to find the headers
#
# $OPENCASCADE_DIR is an environment variable that would
# correspond to the ./configure --prefix=$OPENCASCADE_DIR
# used in building OPENCASCADE.
FIND_PATH(OPENCASCADE_INCLUDE_DIR Standard_Version.hxx
PATHS
${OPENCASCADE_DIR}
$ENV{OPENCASCADE_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt
/usr/freeware
PATH_SUFFIXES
opencascade
inc
include
inc/cascade
include/cascade
)
MACRO(FIND_OPENCASCADE_LIBRARY MYLIBRARY MYLIBRARYNAME)
FIND_LIBRARY("${MYLIBRARY}"
NAMES "${MYLIBRARYNAME}"
PATHS
$ENV{OPENCASCADE_DIR}/lib}
$ENV{OPENCASCADE_LIB}
${OPENCASCADE_DIR}/lib
$ENV{OPENCASCADE_DIR}/lib
${OPENCASCADE_DIR}/lib/
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
/usr/freeware/lib64
)
ENDMACRO()
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKBinL TKBinL)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKBin TKBin)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKBinTObj TKBinTObj)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKBinXCAF TKBinXCAF)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKBool TKBool)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKBO TKBO)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKBRep TKBRep)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKCAF TKCAF)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKCDF TKCDF)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKernel TKernel)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKFeat TKFeat)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKFillet TKFillet)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKG2d TKG2d)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKG3d TKG3d)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKGeomAlgo TKGeomAlgo)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKGeomBase TKGeomBase)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKHLR TKHLR)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKIGES TKIGES)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKLCAF TKLCAF)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKMath TKMath)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKMesh TKMesh)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKMeshVS TKMeshVS)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKOffset TKOffset)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKOpenGl TKOpenGl)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKPrim TKPrim)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKService TKService)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKShHealing TKShHealing)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKSTEP209 TKSTEP209)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKSTEPAttr TKSTEPAttr)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKSTEPBase TKSTEPBase)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKSTEP TKSTEP)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKSTL TKSTL)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKTObj TKTObj)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKTopAlgo TKTopAlgo)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKV3d TKV3d)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKVRML TKVRML)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXDEIGES TKXDEIGES)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXDESTEP TKXDESTEP)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXMesh TKXMesh)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXmlL TKXmlL)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXml TKXml)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXmlTObj TKXmlTObj)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXmlXCAF TKXmlXCAF)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXSBase TKXSBase)
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXCAF TKXCAF)
set (OPENCASCADE_LIBRARY_TYPE_DESCR
"Specifies the type of library to be used. 'Shared' libraries
are linked dynamically and loaded at runtime. 'Static' libraries
are archives of object files for use when linking other targets")
# set type of OCCT libraries
if (NOT OPENCASCADE_LIBRARY_TYPE)
set (OPENCASCADE_LIBRARY_TYPE "Static" CACHE STRING "${OPENCASCADE_LIBRARY_TYPE_DESCR}" FORCE)
SET_PROPERTY(CACHE OPENCASCADE_LIBRARY_TYPE PROPERTY STRINGS Shared Static)
endif()
if ("${OPENCASCADE_LIBRARY_TYPE}" STREQUAL "Shared")
SET(OPENCASCADE_LIBRARY ${OPENCASCADE_LIBRARY}
${OPENCASCADE_TKernel}
${OPENCASCADE_TKMath}
${OPENCASCADE_TKXCAF}
${OPENCASCADE_TKXSBase}
${OPENCASCADE_TKSTEPAttr}
${OPENCASCADE_TKSTEPBase}
${OPENCASCADE_TKSTEP209}
${OPENCASCADE_TKSTEP}
${OPENCASCADE_TKXDESTEP}
${OPENCASCADE_TKIGES}
${OPENCASCADE_TKXDEIGES}
${OPENCASCADE_TKLCAF}
${OPENCASCADE_TKBRep}
${OPENCASCADE_TKMesh}
${OPENCASCADE_TKTopAlgo}
${OPENCASCADE_TKShHealing}
)
else ("${OPENCASCADE_LIBRARY_TYPE}" STREQUAL "Shared")
SET(OPENCASCADE_LIBRARY ${OPENCASCADE_LIBRARY}
${OPENCASCADE_TKBO}
${OPENCASCADE_TKBool}
${OPENCASCADE_TKBRep}
${OPENCASCADE_TKCAF}
${OPENCASCADE_TKCDF}
${OPENCASCADE_TKernel}
${OPENCASCADE_TKG2d}
${OPENCASCADE_TKG3d}
${OPENCASCADE_TKGeomAlgo}
${OPENCASCADE_TKGeomBase}
${OPENCASCADE_TKHLR}
${OPENCASCADE_TKIGES}
${OPENCASCADE_TKLCAF}
${OPENCASCADE_TKMath}
${OPENCASCADE_TKMesh}
${OPENCASCADE_TKPrim}
${OPENCASCADE_TKService}
${OPENCASCADE_TKShHealing}
${OPENCASCADE_TKSTEP}
${OPENCASCADE_TKSTEP209}
${OPENCASCADE_TKSTEPAttr}
${OPENCASCADE_TKSTEPBase}
${OPENCASCADE_TKTopAlgo}
${OPENCASCADE_TKV3d}
${OPENCASCADE_TKXCAF}
${OPENCASCADE_TKXDEIGES}
${OPENCASCADE_TKXDESTEP}
${OPENCASCADE_TKXSBase}
)
endif ("${OPENCASCADE_LIBRARY_TYPE}" STREQUAL "Shared")
SET(OPENCASCADE_FOUND "NO")
IF(OPENCASCADE_LIBRARY AND OPENCASCADE_INCLUDE_DIR)
SET(OPENCASCADE_FOUND "YES")
ENDIF(OPENCASCADE_LIBRARY AND OPENCASCADE_INCLUDE_DIR)
IF(OPENCASCADE_INCLUDE_DIR)
SET(OPENCASCADE_FOUND "YES")
ENDIF(OPENCASCADE_INCLUDE_DIR)

View File

@@ -28,7 +28,7 @@ FIND_PATH(OPENEXR_INCLUDE_DIR OpenEXR/ImfIO.h
# example: OPENEXR_FIND_VAR(OPENEXR_IlmImf_LIBRARY IlmImf)
MACRO(OPENEXR_FIND_VAR varname libname)
FIND_LIBRARY( ${varname}
NAMES ${libname} ${libname}-2_1 ${libname}-2_2
NAMES ${libname}
PATHS
$ENV{OPENEXR_DIR}/lib
$ENV{OPENEXR_DIR}
@@ -52,10 +52,13 @@ MACRO(OPENEXR_FIND libname)
ENDMACRO(OPENEXR_FIND)
OPENEXR_FIND(IlmImf)
OPENEXR_FIND(IlmThread)
OPENEXR_FIND(Iex)
OPENEXR_FIND(Half)
SET(OPENEXR_FOUND "NO")
IF(OPENEXR_INCLUDE_DIR AND OPENEXR_IlmImf_LIBRARY)
SET(OPENEXR_LIBRARIES ${OPENEXR_IlmImf_LIBRARY} )
SET(OPENEXR_LIBRARIES_VARS OPENEXR_IlmImf_LIBRARY )
IF(OPENEXR_INCLUDE_DIR AND OPENEXR_IlmImf_LIBRARY AND OPENEXR_IlmThread_LIBRARY AND OPENEXR_Iex_LIBRARY AND OPENEXR_Half_LIBRARY)
SET(OPENEXR_LIBRARIES ${OPENEXR_IlmImf_LIBRARY} ${OPENEXR_IlmThread_LIBRARY} ${OPENEXR_Half_LIBRARY} ${OPENEXR_Iex_LIBRARY} )
SET(OPENEXR_LIBRARIES_VARS OPENEXR_IlmImf_LIBRARY OPENEXR_IlmThread_LIBRARY OPENEXR_Half_LIBRARY OPENEXR_Iex_LIBRARY )
SET(OPENEXR_FOUND "YES")
ENDIF(OPENEXR_INCLUDE_DIR AND OPENEXR_IlmImf_LIBRARY)
ENDIF(OPENEXR_INCLUDE_DIR AND OPENEXR_IlmImf_LIBRARY AND OPENEXR_IlmThread_LIBRARY AND OPENEXR_Iex_LIBRARY AND OPENEXR_Half_LIBRARY)

View File

@@ -0,0 +1,270 @@
# - find DCMTK libraries
#
# DCMTK_INCLUDE_DIRS - Directories to include to use DCMTK
# DCMTK_LIBRARIES - Files to link against to use DCMTK
# DCMTK_FOUND - If false, don't try to use DCMTK
# DCMTK_DIR - (optional) Source directory for DCMTK
#
# DCMTK_DIR can be used to make it simpler to find the various include
# directories and compiled libraries if you've just compiled it in the
# source tree. Just set it to the root of the tree where you extracted
# the source.
#
# Written for VXL by Amitha Perera.
# Modified by Robert Osfied to enable support for install placements of DCMTK 3.5.4 versions onwards
FIND_PATH( DCMTK_ROOT_INCLUDE_DIR dcmtk/config/osconfig.h
${DCMTK_DIR}/config/include
${DCMTK_DIR}/include
/usr/local/dicom/include
/usr/local/include/
/usr/include/
/usr/local/dicom/include/
)
FIND_PATH( DCMTK_config_INCLUDE_DIR osconfig.h
${DCMTK_ROOT_INCLUDE_DIR}/dcmtk/config
${DCMTK_DIR}/config/include
${DCMTK_DIR}/include
/usr/local/dicom/include
/usr/local/include/dcmtk/config
/usr/include/dcmtk/config
/usr/local/dicom/include/dcmtk/config
)
FIND_PATH( DCMTK_ofstd_INCLUDE_DIR ofstdinc.h
${DCMTK_ROOT_INCLUDE_DIR}/dcmtk/ofstd
${DCMTK_DIR}/ofstd/include
${DCMTK_DIR}/include/ofstd
/usr/local/dicom/include/dcmtk/ofstd
/usr/local/include/dcmtk/ofstd
/usr/include/dcmtk/ofstd
/usr/local/dicom/include/dcmtk/ofstd
)
FIND_LIBRARY( DCMTK_ofstd_LIBRARY ofstd
PATHS
${DCMTK_DIR}/ofstd/libsrc
${DCMTK_DIR}/ofstd/libsrc/Release
${DCMTK_DIR}/ofstd/libsrc/Debug
${DCMTK_DIR}/ofstd/Release
${DCMTK_DIR}/ofstd/Debug
${DCMTK_DIR}/lib
/usr/local/dicom/lib
/usr/local/lib64
/usr/lib64
/usr/local/lib
/usr/lib
/usr/local/dicom/lib
PATH_SUFFIXES dcmtk
)
FIND_PATH( DCMTK_dcmdata_INCLUDE_DIR dctypes.h
${DCMTK_ROOT_INCLUDE_DIR}/dcmtk/dcmdata
${DCMTK_DIR}/dcmdata/include
${DCMTK_DIR}/include/dcmdata
/usr/local/dicom/include/dcmtk/dcmdata
/usr/local/include/dcmtk/dcmdata
/usr/include/dcmtk/dcmdata
/usr/local/dicom/include/dcmtk/dcmdata
)
FIND_LIBRARY( DCMTK_dcmdata_LIBRARY dcmdata
PATHS
${DCMTK_DIR}/dcmdata/libsrc
${DCMTK_DIR}/dcmdata/libsrc/Release
${DCMTK_DIR}/dcmdata/libsrc/Debug
${DCMTK_DIR}/dcmdata/Release
${DCMTK_DIR}/dcmdata/Debug
${DCMTK_DIR}/lib
/usr/local/dicom/lib
/usr/local/lib64
/usr/lib64
/usr/local/lib
/usr/lib
/usr/local/dicom/lib
PATH_SUFFIXES dcmtk
)
FIND_PATH( DCMTK_dcmimgle_INCLUDE_DIR dcmimage.h
${DCMTK_ROOT_INCLUDE_DIR}/dcmtk/dcmimgle
${DCMTK_DIR}/dcmimgle/include
${DCMTK_DIR}/include/dcmimgle
/usr/local/dicom/include/dcmtk/dcmimgle
/usr/local/include/dcmtk/dcmimgle
/usr/include/dcmtk/dcmimgle
/usr/local/dicom/include/dcmtk/dcmimgle
)
FIND_LIBRARY( DCMTK_dcmimgle_LIBRARY dcmimgle
PATHS
${DCMTK_DIR}/dcmimgle/libsrc
${DCMTK_DIR}/dcmimgle/libsrc/Release
${DCMTK_DIR}/dcmimgle/libsrc/Debug
${DCMTK_DIR}/dcmimgle/Release
${DCMTK_DIR}/dcmimgle/Debug
${DCMTK_DIR}/lib
/usr/local/dicom/lib
/usr/local/lib64
/usr/lib64
/usr/local/lib
/usr/lib
/usr/local/dicom/lib
PATH_SUFFIXES dcmtk
)
FIND_PATH( DCMTK_dcmimage_INCLUDE_DIR diregist.h
${DCMTK_ROOT_INCLUDE_DIR}/dcmtk/dcmimage
${DCMTK_DIR}/dcmimage/include
${DCMTK_DIR}/include/dcmimage
/usr/local/dicom/include/dcmtk/dcmimage
/usr/local/include/dcmtk/dcmimage
/usr/include/dcmtk/dcmimage
/usr/local/dicom/include/dcmtk/dcmimage
)
FIND_LIBRARY( DCMTK_dcmimage_LIBRARY dcmimage
PATHS
${DCMTK_DIR}/dcmimage/libsrc
${DCMTK_DIR}/dcmimage/libsrc/Release
${DCMTK_DIR}/dcmimage/libsrc/Debug
${DCMTK_DIR}/dcmimage/Release
${DCMTK_DIR}/dcmimage/Debug
${DCMTK_DIR}/lib
/usr/local/dicom/lib
/usr/local/lib64
/usr/lib64
/usr/local/lib
/usr/lib
/usr/local/dicom/lib
PATH_SUFFIXES dcmtk
)
FIND_LIBRARY(DCMTK_imagedb_LIBRARY imagedb
PATHS
${DCMTK_DIR}/imagectn/libsrc/Release
${DCMTK_DIR}/imagectn/libsrc/
${DCMTK_DIR}/imagectn/libsrc/Debug
${DCMTK_DIR}/lib
/usr/local/dicom/lib
/usr/local/lib64
/usr/lib64
/usr/local/lib
/usr/lib
/usr/local/dicom/lib
PATH_SUFFIXES dcmtk
)
FIND_LIBRARY(DCMTK_dcmnet_LIBRARY dcmnet
PATHS
${DCMTK_DIR}/dcmnet/libsrc/Release
${DCMTK_DIR}/dcmnet/libsrc/Debug
${DCMTK_DIR}/dcmnet/libsrc/
${DCMTK_DIR}/lib
/usr/local/dicom/lib
/usr/local/lib64
/usr/lib64
/usr/local/lib
/usr/lib
/usr/local/dicom/lib
PATH_SUFFIXES dcmtk
)
FIND_LIBRARY(DCMTK_oflog_LIBRARY oflog
PATHS
${DCMTK_DIR}/dcmnet/libsrc/Release
${DCMTK_DIR}/dcmnet/libsrc/Debug
${DCMTK_DIR}/dcmnet/libsrc/
${DCMTK_DIR}/lib
/usr/local/dicom/lib
/usr/local/lib64
/usr/lib64
/usr/local/lib
/usr/lib
/usr/local/dicom/lib
PATH_SUFFIXES dcmtk
)
FIND_LIBRARY(DCMTK_ofstd_LIBRARY ofstd
PATHS
${DCMTK_DIR}/dcmnet/libsrc/Release
${DCMTK_DIR}/dcmnet/libsrc/Debug
${DCMTK_DIR}/dcmnet/libsrc/
${DCMTK_DIR}/lib
/usr/local/dicom/lib
/usr/local/lib64
/usr/lib64
/usr/local/lib
/usr/lib
/usr/local/dicom/lib
PATH_SUFFIXES dcmtk
)
IF( DCMTK_config_INCLUDE_DIR
AND DCMTK_ofstd_INCLUDE_DIR
AND DCMTK_ofstd_LIBRARY
AND DCMTK_dcmdata_INCLUDE_DIR
AND DCMTK_dcmdata_LIBRARY
AND DCMTK_dcmimgle_INCLUDE_DIR
AND DCMTK_dcmimgle_LIBRARY
AND DCMTK_dcmimage_INCLUDE_DIR
AND DCMTK_dcmimage_LIBRARY )
SET( DCMTK_FOUND "YES" )
SET( DCMTK_INCLUDE_DIRS
${DCMTK_config_INCLUDE_DIR}
${DCMTK_ofstd_INCLUDE_DIR}
${DCMTK_dcmdata_INCLUDE_DIR}
${DCMTK_dcmimgle_INCLUDE_DIR}
${DCMTK_dcmimage_INCLUDE_DIR}
)
SET( DCMTK_LIBRARIES
${DCMTK_dcmimgle_LIBRARY}
${DCMTK_dcmimage_LIBRARY}
${DCMTK_dcmdata_LIBRARY}
${DCMTK_ofstd_LIBRARY}
${DCMTK_config_LIBRARY}
)
IF(DCMTK_imagedb_LIBRARY)
SET( DCMTK_LIBRARIES
${DCMTK_LIBRARIES}
${DCMTK_imagedb_LIBRARY}
)
ENDIF()
IF(DCMTK_dcmnet_LIBRARY)
SET( DCMTK_LIBRARIES
${DCMTK_LIBRARIES}
${DCMTK_dcmnet_LIBRARY}
)
ENDIF()
IF(DCMTK_oflog_LIBRARY)
SET( DCMTK_LIBRARIES
${DCMTK_LIBRARIES}
${DCMTK_oflog_LIBRARY}
)
ENDIF()
IF(DCMTK_ofstd_LIBRARY)
SET( DCMTK_LIBRARIES
${DCMTK_LIBRARIES}
${DCMTK_ofstd_LIBRARY}
)
ENDIF()
IF( WIN32 )
SET( DCMTK_LIBRARIES ${DCMTK_LIBRARIES} netapi32 )
ENDIF()
ENDIF()
IF( NOT DCMTK_FOUND )
SET( DCMTK_DIR "" CACHE PATH "Root of DCMTK source tree (optional)." )
MARK_AS_ADVANCED( DCMTK_DIR )
ENDIF()

View File

@@ -55,20 +55,19 @@ ELSE()
#Quicktime is not supported under 64bit OSX build so we need to detect it and disable it.
#First check to see if we are running with a native 64-bit compiler (10.6 default) and implicit arch
IF(NOT CMAKE_OSX_ARCHITECTURES AND CMAKE_SIZEOF_VOID_P EQUAL 8)
MESSAGE("Disabling QuickTime on 64-bit architectures")
SET(QUICKTIME_FOUND "NO")
ELSEIF(OSG_OSX_VERSION VERSION_GREATER 10.6)
# Quicktime officially deprecated starting 10.7
MESSAGE("Disabling QuickTime because it's not supported by the selected SDK ${OSG_OSX_VERSION}")
SET(QUICKTIME_FOUND "NO")
ELSE()
#Otherwise check to see if 64-bit is explicitly called for.
LIST(FIND CMAKE_OSX_ARCHITECTURES "x86_64" has64Compile)
IF(NOT has64Compile EQUAL -1)
MESSAGE("Disabling QuickTime on 64-bit architectures")
SET(QUICKTIME_FOUND "NO")
ENDIF()
ELSE()
#Otherwise check to see if 64-bit is explicitly called for.
LIST(FIND CMAKE_OSX_ARCHITECTURES "x86_64" has64Compile)
IF(NOT has64Compile EQUAL -1)
SET(QUICKTIME_FOUND "NO")
ENDIF()
ENDIF()
# Disable quicktime for >= 10.7, as it's officially deprecated
IF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.7" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.8" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.9" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.10")
MESSAGE("disabling quicktime because it's not supported by the selected SDK ${OSG_OSX_SDK_NAME}")
SET(QUICKTIME_FOUND "NO")
ENDIF()
ENDIF()
ENDIF()

View File

@@ -0,0 +1,58 @@
# Locate zlib
# This module defines
# ZLIB_LIBRARY
# ZLIB_FOUND, if false, do not try to link to zlib
# ZLIB_INCLUDE_DIR, where to find the headers
#
# $ZLIB_DIR is an environment variable that would
# correspond to the ./configure --prefix=$ZLIB_DIR
# used in building zlib.
#
# Created by Ulrich Hertlein.
# prefer FindZLIB from cmake distribution
if(EXISTS ${CMAKE_ROOT}/Modules/FindZLIB.cmake)
include(${CMAKE_ROOT}/Modules/FindZLIB.cmake)
if(ZLIB_FOUND)
return()
endif()
endif()
FIND_PATH(ZLIB_INCLUDE_DIR zlib.h
$ENV{ZLIB_DIR}/include
$ENV{ZLIB_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local/include
/usr/include
/sw/include # Fink
/opt/local/include # DarwinPorts
/opt/csw/include # Blastwave
/opt/include
/usr/freeware/include
)
FIND_LIBRARY(ZLIB_LIBRARY
NAMES z libz zlib
PATHS
$ENV{ZLIB_DIR}/lib
$ENV{ZLIB_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
/usr/freeware/lib64
)
SET(ZLIB_FOUND "NO")
IF(ZLIB_LIBRARY AND ZLIB_INCLUDE_DIR)
SET(ZLIB_FOUND "YES")
ENDIF(ZLIB_LIBRARY AND ZLIB_INCLUDE_DIR)

View File

@@ -1,63 +0,0 @@
# Locate ILMBASE
# This module defines
# ILMBASE_LIBRARY
# ILMBASE_FOUND, if false, do not try to link to ILMBASE
# ILMBASE_INCLUDE_DIR, where to find the headers
#
# $ILMBASE_DIR is an environment variable that would
# correspond to the ./configure --prefix=$ILMBASE_DIR
#
# Created by Robert Osfield.
FIND_PATH(ILMBASE_INCLUDE_DIR OpenEXR/ImathVec.h
$ENV{ILMBASE_DIR}/include
$ENV{ILMBASE_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local/include
/usr/include
/sw/include # Fink
/opt/local/include # DarwinPorts
/opt/csw/include # Blastwave
/opt/include
/usr/freeware/include
)
# Macro to find ilmbase libraries
# example: ILMBASE_FIND_VAR(OPENEXR_IlmThread_LIBRARY IlmThread)
MACRO(ILMBASE_FIND_VAR varname libname)
FIND_LIBRARY( ${varname}
NAMES ${libname} ${libname}-2_1 ${libname}-2_2
PATHS
$ENV{ILMBASE_DIR}/lib
$ENV{ILMBASE_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
/usr/freeware/lib64
)
ENDMACRO(ILMBASE_FIND_VAR)
# Macro to find exr libraries (and debug versions)
# example: ILMBASE_FIND(OPENEXR_IlmThread_LIBRARY IlmThread)
MACRO(ILMBASE_FIND libname)
ILMBASE_FIND_VAR(ILMBASE_${libname}_LIBRARY ${libname})
ILMBASE_FIND_VAR(ILMBASE_${libname}_LIBRARY_DEBUG ${libname}d)
ENDMACRO(ILMBASE_FIND)
ILMBASE_FIND(IlmThread)
ILMBASE_FIND(Iex)
ILMBASE_FIND(Half)
SET(ILMBASE_FOUND "NO")
IF(ILMBASE_INCLUDE_DIR AND ILMBASE_IlmThread_LIBRARY AND ILMBASE_Iex_LIBRARY AND ILMBASE_Half_LIBRARY)
SET(ILMBASE_LIBRARIES ${ILMBASE_IlmThread_LIBRARY} ${ILMBASE_Half_LIBRARY} ${ILMBASE_Iex_LIBRARY} )
SET(ILMBASE_LIBRARIES_VARS ILMBASE_IlmThread_LIBRARY ILMBASE_Half_LIBRARY ILMBASE_Iex_LIBRARY )
SET(ILMBASE_FOUND "YES")
ENDIF(ILMBASE_INCLUDE_DIR AND ILMBASE_IlmThread_LIBRARY AND ILMBASE_Iex_LIBRARY AND ILMBASE_Half_LIBRARY)

View File

@@ -34,9 +34,6 @@ INSTALL(
IF(MSVC AND DYNAMIC_OPENSCENEGRAPH)
GET_TARGET_PROPERTY(PREFIX ${LIB_NAME} PREFIX)
IF("${PREFIX}" STREQUAL PREFIX-NOTFOUND) # Fix for PREFIX-NOTFOUND left in file names
SET(PREFIX "")
ENDIF()
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)

View File

@@ -57,7 +57,7 @@ ENDIF()
SET(CPACK_SOURCE_GENERATOR "TGZ")
# for ms visual studio we use it's internally defined variable to get the configuration (debug,release, ...)
# for ms visual studio we use it's internally defined variable to get the configuration (debug,release, ...)
IF(MSVC_IDE)
SET(OSG_CPACK_CONFIGURATION "$(OutDir)")
SET(PACKAGE_TARGET_PREFIX "Package ")
@@ -84,87 +84,9 @@ ENDIF()
SET(PACKAGE_ALL_TARGETNAME "${PACKAGE_TARGET_PREFIX}ALL")
ADD_CUSTOM_TARGET(${PACKAGE_ALL_TARGETNAME})
# cpack configuration for debian packages
IF(${CPACK_GENERATOR} STREQUAL "DEB")
SET(OPENSCENEGRAPH_PACKAGE_MAINTAINER
""
CACHE STRING
"Name and email address of the package maintainer, e.g., 'Jon Doe <jon.doe@superawesomemail.com>'"
)
SET(CPACK_LIBOPENSCENEGRAPH_DEPENDENCIES
"libopenthreads"
CACHE STRING
"Dependend packages for the openscenegraph library package (uses deb dependecy format), e.g., 'libc6, libcurl3-gnutls, libgif4, libjpeg8, libpng12-0'"
)
SET(CPACK_LIBOPENSCENEGRAPH-DEV_DEPENDENCIES
"libopenscenegraph"
CACHE STRING
"Dependend packages for the openscenegraph development package (uses deb dependecy format), e.g., 'libc6, libcurl3-gnutls, libgif4, libjpeg8, libpng12-0'"
)
SET(CPACK_LIBOPENTHREADS_DEPENDENCIES
""
CACHE STRING
"Dependend packages for the openthreads library package (uses deb dependecy format), e.g., 'libc6, libcurl3-gnutls, libgif4, libjpeg8, libpng12-0'"
)
SET(CPACK_LIBOPENTHREADS-DEV_DEPENDENCIES
"libopenthreads"
CACHE STRING
"Dependend packages for the openthreads development package (uses deb dependecy format), e.g., 'libc6, libcurl3-gnutls, libgif4, libjpeg8, libpng12-0'"
)
SET(CPACK_OPENSCENEGRAPH_DEPENDENCIES
"libopenscenegraph"
CACHE STRING
"Dependend packages for the openscenegraph main package (uses deb dependecy format), e.g., 'libc6, libcurl3-gnutls, libgif4, libjpeg8, libpng12-0'"
)
SET(CPACK_OPENSCENEGRAPH-ALL_DEPENDENCIES
""
CACHE STRING
"Dependend packages for the openscenegraph package with all components (uses deb dependecy format), e.g., 'libc6, libcurl3-gnutls, libgif4, libjpeg8, libpng12-0'"
)
SET(CPACK_LIBOPENSCENEGRAPH_CONFLICTS
""
CACHE STRING
"Conflicting packages for the openscenegraph library package (uses deb dependecy format), e.g., 'libc6, libcurl3-gnutls, libgif4, libjpeg8, libpng12-0'"
)
SET(CPACK_LIBOPENSCENEGRAPH-DEV_CONFLICTS
""
CACHE STRING
"Conflicting packages for the openscenegraph development package (uses deb dependecy format), e.g., 'libc6, libcurl3-gnutls, libgif4, libjpeg8, libpng12-0'"
)
SET(CPACK_LIBOPENTHREADS_CONFLICTS
""
CACHE STRING
"Conflicting packages for the openthreads library package (uses deb dependecy format), e.g., 'libc6, libcurl3-gnutls, libgif4, libjpeg8, libpng12-0'"
)
SET(CPACK_LIBOPENTHREADS-DEV_CONFLICTS
""
CACHE STRING
"Conflicting packages for the openthreads development package (uses deb dependecy format), e.g., 'libc6, libcurl3-gnutls, libgif4, libjpeg8, libpng12-0'"
)
SET(CPACK_OPENSCENEGRAPH_CONFLICTS
""
CACHE STRING
"Conflicting packages for the openscenegraph main package (uses deb dependecy format), e.g., 'libc6, libcurl3-gnutls, libgif4, libjpeg8, libpng12-0'"
)
SET(CPACK_OPENSCENEGRAPH-ALL_CONFLICTS
""
CACHE STRING
"Conflicting packages for the openscenegraph package with all components (uses deb dependecy format), e.g., 'libc6, libcurl3-gnutls, libgif4, libjpeg8, libpng12-0'"
)
ENDIF()
MACRO(GENERATE_PACKAGING_TARGET package_name)
SET(CPACK_PACKAGE_NAME ${package_name})
# set debian dependencies AND conflicts
IF(${CPACK_GENERATOR} STREQUAL "DEB")
STRING(TOUPPER CPACK_${package_name}_DEPENDENCIES DEPENDENCIES_VAR)
STRING(TOUPPER CPACK_${package_name}_CONFLICTS CONFLICTS_VAR)
SET(OSG_PACKAGE_DEPENDS "${${DEPENDENCIES_VAR}}")
SET(OSG_PACKAGE_CONFLICTS "${${CONFLICTS_VAR}}")
ENDIF()
# the doc packages don't need a system-arch specification
IF(${package} MATCHES -doc)
SET(OSG_PACKAGE_FILE_NAME ${package_name}-${OPENSCENEGRAPH_VERSION})
@@ -192,7 +114,7 @@ MACRO(GENERATE_PACKAGING_TARGET package_name)
ELSE()
SET(ARCHIVE_EXT "tar.gz")
ENDIF()
# Create a target that creates the current package
# and rename the package to give it proper filename
ADD_CUSTOM_TARGET(${PACKAGE_TARGETNAME})
@@ -202,8 +124,8 @@ MACRO(GENERATE_PACKAGING_TARGET package_name)
COMMAND ${CMAKE_CPACK_COMMAND} -C ${OSG_CPACK_CONFIGURATION} --config ${OpenSceneGraph_BINARY_DIR}/CPackConfig-${package_name}.cmake
COMMENT "Run CPack packaging for ${package_name}..."
)
# Add the exact same custom command to the all package generating target.
# I can't use add_dependencies to do this because it would allow parallel building of packages so am going brute here
# Add the exact same custom command to the all package generating target.
# I can't use add_dependencies to do this because it would allow parallell building of packages so am going brute here
ADD_CUSTOM_COMMAND(TARGET ${PACKAGE_ALL_TARGETNAME}
COMMAND ${CMAKE_CPACK_COMMAND} -C ${OSG_CPACK_CONFIGURATION} --config ${OpenSceneGraph_BINARY_DIR}/CPackConfig-${package_name}.cmake
)

View File

@@ -53,7 +53,7 @@ SET(CPACK_NSIS_INSTALLER_ICON_CODE "")
SET(CPACK_NSIS_INSTALLER_MUI_ICON_CODE "")
SET(CPACK_OUTPUT_CONFIG_FILE "${PROJECT_BINARY_DIR}/CPackConfig-${OSG_CPACK_COMPONENT}.cmake")
SET(CPACK_PACKAGE_DEFAULT_LOCATION "/")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${OpenSceneGraph_SOURCE_DIR}/README.md")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${OpenSceneGraph_SOURCE_DIR}/README.txt")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The OpenSceneGraph is an open source high performance 3d graphics toolkit")
SET(CPACK_PACKAGE_FILE_NAME "${OSG_PACKAGE_FILE_NAME}")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
@@ -66,16 +66,6 @@ SET(CPACK_PACKAGE_VERSION_MAJOR "${OPENSCENEGRAPH_MAJOR_VERSION}")
SET(CPACK_PACKAGE_VERSION_MINOR "${OPENSCENEGRAPH_MINOR_VERSION}")
SET(CPACK_PACKAGE_VERSION_PATCH "${OPENSCENEGRAPH_PATCH_VERSION}")
SET(CPACK_RESOURCE_FILE_LICENSE "${OpenSceneGraph_SOURCE_DIR}/LICENSE.txt")
SET(CPACK_RESOURCE_FILE_README "${OpenSceneGraph_SOURCE_DIR}/README.md")
SET(CPACK_RESOURCE_FILE_README "${OpenSceneGraph_SOURCE_DIR}/README.txt")
SET(CPACK_RESOURCE_FILE_WELCOME "${OpenSceneGraph_SOURCE_DIR}/NEWS.txt")
SET(CPACK_STRIP_FILES "ON")
# DEBIAN OPTIONS
IF(${CPACK_GENERATOR} STREQUAL "DEB")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "${OPENSCENEGRAPH_PACKAGE_MAINTAINER}")
SET(CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://www.openscenegraph.org")
SET(CPACK_DEBIAN_PACKAGE_SECTION "Development")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${OSG_PACKAGE_DEPENDS}")
SET(CPACK_DEBIAN_PACKAGE_CONFLICTS "${OSG_PACKAGE_CONFLICTS}")
SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${OpenSceneGraph_SOURCE_DIR}/debian_scripts/postinst;")
ENDIF()

View File

@@ -1,22 +0,0 @@
# - If Windows is used, this script sets the variable WIN32_WINNT to the corresponding windows version
if (WIN32)
message(STATUS "Checking windows version...")
macro(get_WIN32_WINNT version)
if (CMAKE_SYSTEM_VERSION)
set(ver ${CMAKE_SYSTEM_VERSION})
string(REGEX MATCH "^([0-9]+).([0-9])" ver ${ver})
string(REGEX MATCH "^([0-9]+)" verMajor ${ver})
# Check for Windows 10, b/c we'll need to convert to hex 'A'.
if ("${verMajor}" MATCHES "10")
set(verMajor "A")
string(REGEX REPLACE "^([0-9]+)" ${verMajor} ver ${ver})
endif ("${verMajor}" MATCHES "10")
# Remove all remaining '.' characters.
string(REPLACE "." "" ver ${ver})
# Prepend each digit with a zero.
string(REGEX REPLACE "([0-9A-Z])" "0\\1" ver ${ver})
set(${version} "0x${ver}")
endif(CMAKE_SYSTEM_VERSION)
endmacro(get_WIN32_WINNT)
endif(WIN32)

View File

@@ -27,10 +27,15 @@ MACRO(BUILDER_VERSION_GREATER MAJOR_VER MINOR_VER PATCH_VER)
ENDIF()
ENDMACRO(BUILDER_VERSION_GREATER MAJOR_VER MINOR_VER PATCH_VER)
# CMAKE24: if CMake version is <2.6.0.
SET(CMAKE24 OFF)
IF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} LESS 5)
SET(CMAKE24 ON)
ENDIF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} LESS 5)
# CMAKE_VERSION_TEST: Define whether "IF(${CMAKE_VERSION} VERSION_LESS "x.y.z")" can be used or not.
BUILDER_VERSION_GREATER(2 8 0)
SET(CMAKE_VERSION_TEST ${VALID_BUILDER_VERSION}) # >= 2.8.0
BUILDER_VERSION_GREATER(2 6 3)
SET(CMAKE_VERSION_TEST ${VALID_BUILDER_VERSION}) # >= 2.6.4
SET(VALID_BUILDER_VERSION OFF)
@@ -44,7 +49,7 @@ MACRO(LINK_WITH_VARIABLES TRGTNAME)
TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${${varname}}" debug "${${varname}_DEBUG}")
ENDIF(${varname}_RELEASE)
ELSE(${varname}_DEBUG)
TARGET_LINK_LIBRARIES(${TRGTNAME} ${${varname}} )
TARGET_LINK_LIBRARIES(${TRGTNAME} "${${varname}}" )
ENDIF(${varname}_DEBUG)
ENDFOREACH(varname)
ENDMACRO(LINK_WITH_VARIABLES TRGTNAME)
@@ -82,8 +87,8 @@ ENDMACRO(LINK_EXTERNAL TRGTNAME)
MACRO(LINK_CORELIB_DEFAULT CORELIB_NAME)
#SET(ALL_GL_LIBRARIES ${OPENGL_LIBRARIES})
SET(ALL_GL_LIBRARIES ${OPENGL_gl_LIBRARY})
IF (OSG_GLES1_AVAILABLE OR OSG_GLES2_AVAILABLE OR OSG_GLES3_AVAILABLE)
SET(ALL_GL_LIBRARIES ${ALL_GL_LIBRARIES} ${EGL_LIBRARY})
IF (OSG_GLES1_AVAILABLE OR OSG_GLES2_AVAILABLE)
SET(ALL_GL_LIBRARIES ${ALL_GL_LIBRARIES} ${OPENGL_egl_LIBRARY})
ENDIF()
LINK_EXTERNAL(${CORELIB_NAME} ${ALL_GL_LIBRARIES})
@@ -133,8 +138,8 @@ MACRO(SETUP_LINK_LIBRARIES)
#SET(ALL_GL_LIBRARIES ${OPENGL_LIBRARIES})
SET(ALL_GL_LIBRARIES ${OPENGL_gl_LIBRARY})
IF (OSG_GLES1_AVAILABLE OR OSG_GLES2_AVAILABLE OR OSG_GLES3_AVAILABLE)
SET(ALL_GL_LIBRARIES ${ALL_GL_LIBRARIES} ${EGL_LIBRARY})
IF (OSG_GLES1_AVAILABLE OR OSG_GLES2_AVAILABLE)
SET(ALL_GL_LIBRARIES ${ALL_GL_LIBRARIES} ${OPENGL_egl_LIBRARY})
ENDIF()
# FOREACH(LINKLIB ${TARGET_LIBRARIES})
@@ -225,9 +230,6 @@ MACRO(SETUP_LIBRARY LIB_NAME)
)
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES FOLDER "OSG Core")
IF(APPLE)
IF(OSG_BUILD_PLATFORM_IPHONE)
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE ${IPHONE_ENABLE_BITCODE})
ENDIF()
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES XCODE_ATTRIBUTE_WARNING_CFLAGS "")
ENDIF()
IF(TARGET_LABEL)
@@ -269,23 +271,6 @@ MACRO(SETUP_PLUGIN PLUGIN_NAME)
## plugins gets put in libopenscenegraph by default
IF(${ARGC} GREATER 1)
SET(PACKAGE_COMPONENT libopenscenegraph-${ARGV1})
# add cpack config variables for plugin with own package
IF(BUILD_OSG_PACKAGES)
IF("${CPACK_GENERATOR}" STREQUAL "DEB")
STRING(TOUPPER ${PACKAGE_COMPONENT} UPPER_PACKAGE_COMPONENT)
SET(CPACK_${UPPER_PACKAGE_COMPONENT}_DEPENDENCIES
"libopenscenegraph"
CACHE STRING
"Dependend packages for the ${PACKAGE_COMPONENT} package with all components (uses deb dependecy format), e.g., 'libc6, libcurl3-gnutls, libgif4, libjpeg8, libpng12-0'"
)
SET(CPACK_${UPPER_PACKAGE_COMPONENT}_CONFLICTS
""
CACHE STRING
"Conflicting packages for the ${PACKAGE_COMPONENT} package (uses deb dependecy format), e.g., 'libc6, libcurl3-gnutls, libgif4, libjpeg8, libpng12-0'"
)
ENDIF()
ENDIF()
ELSE(${ARGC} GREATER 1)
SET(PACKAGE_COMPONENT libopenscenegraph)
ENDIF(${ARGC} GREATER 1)
@@ -336,9 +321,6 @@ MACRO(SETUP_PLUGIN PLUGIN_NAME)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES FOLDER "Plugins")
IF(APPLE)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_WARNING_CFLAGS "")
IF(OSG_BUILD_PLATFORM_IPHONE)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE ${IPHONE_ENABLE_BITCODE})
ENDIF()
ENDIF()
SETUP_LINK_LIBRARIES()
@@ -367,7 +349,7 @@ ENDMACRO(SETUP_PLUGIN)
MACRO(SETUP_EXE IS_COMMANDLINE_APP)
#MESSAGE("in -->SETUP_EXE<-- ${TARGET_NAME}-->${TARGET_SRC} <--> ${TARGET_H}<--")
IF(GLCORE_FOUND)
IF(GL3_FOUND)
INCLUDE_DIRECTORIES( ${GLCORE_INCLUDE_DIR} )
ENDIF()
@@ -429,9 +411,6 @@ MACRO(SETUP_EXE IS_COMMANDLINE_APP)
IF(APPLE)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_WARNING_CFLAGS "")
IF(OSG_BUILD_PLATFORM_IPHONE)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE ${IPHONE_ENABLE_BITCODE})
ENDIF()
ENDIF()
SETUP_LINK_LIBRARIES()
@@ -491,8 +470,8 @@ MACRO(SETUP_EXAMPLE EXAMPLE_NAME)
ELSE(APPLE)
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION share/OpenSceneGraph/bin COMPONENT openscenegraph-examples )
IF(MSVC)
INSTALL(FILES ${CMAKE_BINARY_DIR}/bin/${TARGET_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION share/OpenSceneGraph/bin COMPONENT openscenegraph-examples CONFIGURATIONS RelWithDebInfo)
INSTALL(FILES ${CMAKE_BINARY_DIR}/bin/${TARGET_NAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION share/OpenSceneGraph/bin COMPONENT openscenegraph-examples CONFIGURATIONS Debug)
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)

38442
ChangeLog

File diff suppressed because it is too large Load Diff

View File

@@ -1,8 +1,8 @@
OpenSceneGraph Public License, Version 1.0
OpenSceneGraph Public License, Version 0.0
==========================================
Copyright (C) 2018 Robert Osfield.
Copyright (C) 2002 Robert Osfield.
Everyone is permitted to copy and distribute verbatim copies
of this licence document, but changing it is not allowed.
@@ -12,19 +12,18 @@
This library is free software; you can redistribute it and/or modify it
under the terms of the OpenSceneGraph Public License (OSGPL) version 0.0
or later.
Notes: the OSGPL is based on the LGPL-2.1-only WITH WxWindows-exception-3.1,
with the 4 exceptions laid out in the wxWindows section below. The LGPL is
contained in the final section of this license.
Notes: the OSGPL is based on the LGPL, with the 4 exceptions laid
out in the wxWindows section below. The LGPL is contained in the
final section of this license.
-------------------------------------------------------------------------------
wxWindows Library Licence, Version 3
====================================
wxWindows Library Licence, Version 3.1
======================================
Copyright (c) 1998-2005 Julian Smart, Robert Roebling et al
Copyright (C) 1998 Julian Smart, Robert Roebling [, ...]
Everyone is permitted to copy and distribute verbatim copies
of this licence document, but changing it is not allowed.
@@ -44,20 +43,20 @@
You should have received a copy of the GNU Library General Public Licence
along with this software, usually in a file named COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301 USA.
write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA.
EXCEPTION NOTICE
1. As a special exception, the copyright holders of this library give
permission for additional uses of the text contained in this release of
the library as licenced under the wxWindows Library Licence, applying
either version 3.1 of the Licence, or (at your option) any later version of
the Licence as published by the copyright holders of version
3.1 of the Licence document.
either version 3 of the Licence, or (at your option) any later version of
the Licence as published by the copyright holders of version 3 of the
Licence document.
2. The exception is that you may use, copy, link, modify and distribute
under your own terms, binary object code versions of works based
under the user's own terms, binary object code versions of works based
on the Library.
3. If you copy code from files distributed under the terms of the GNU
@@ -72,13 +71,11 @@
choice whether to permit this exception to apply to your modifications.
If you do not wish that, you must delete the exception notice from such
code and/or adjust the licensing conditions notice accordingly.
------------------------------------------------------------------------------
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
@@ -89,7 +86,7 @@
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
@@ -134,7 +131,7 @@ modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
@@ -190,8 +187,8 @@ modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
@@ -225,7 +222,7 @@ such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
@@ -237,7 +234,7 @@ Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
@@ -295,7 +292,7 @@ instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
@@ -346,7 +343,7 @@ Library will still fall under Section 6.)
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
@@ -408,7 +405,7 @@ restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
@@ -449,7 +446,7 @@ subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
@@ -501,7 +498,7 @@ conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
@@ -511,7 +508,7 @@ decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
@@ -534,8 +531,8 @@ FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest

View File

@@ -1,61 +1,41 @@
OSG News
========
OpenSceneGraph 3.6 release
PERTHSHIRE, Scotland - 7th April 2018 - OpenSceneGraph Professional Services announces the release of OpenSceneGraph 3.6.0, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. The OpenSceneGraph is written entirely in Standard C++ and built upon OpenGL (1.2 to 4.6) and OpenGL ES (1.0 to 3.0), and offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modelling markets. OpenSceneGraph 3.6 runs on all Microsoft Windows platforms, Apple OS/X, iOS, GNU/Linux, Android, Solaris, HP-UX, AIX and FreeBSD operating systems.
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:
* OpenThreads::Affinity introduced to enable setting of processor affinity on viewer and database threads
* osgText rewritten to improve visual quality, add signed distance field support and full GLES2/3 and GL3/4 support
* Added VertexArrayObject support, enable full OpenGL Core Profile support under OSX.
* Added OpenCASCADE plugin
* Added STEP (.stp) plugin
* Improvements to FBX and COLLADA loaders
* Improvements to gles plugin to provide better Sketchfab support
* Added osgemscripten example
* Improvements to osgAnimation
* NodeVisitor ValueMap for storing values that can be stored and accessed across frames, such as update, event and cull traversals
* ShapeDrawable rewritten as an osg::Geometry to improve performance and flexibility
* Added osg::MultiDrawArrays support
* Added osgdeferred example that illustrates how to implement deferred rendering
* Added MultiDrawIndirect support
* Moved glDispatchCompute control out of osg::Program into a dedicated osg::DispatchCompute class to improve control of compute shaders
* KdTree support added for PolytopeIntersector, and ability to work with points, lines and polygons
* osgQt has been moved out to it's own dedicated osgQt github repository
* CMake build support for iOS bitcode builds
* CoverityScan testing introduced, fixes bring defect density to 0.0 per 1,0000 lines of code!
* Support for Codedoc automated documentation
* Support for Travis automated build system
* 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 at http://www.openscenegraph.org/index.php/download-section/stable-releases and at our github repository https://github.com/openscenegraph/OpenSceneGraph/.
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. Further details http://www.openscenegraph.org/index.php/about/licensing
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
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 http://www.openscenegraph.org/index.php/support/professional-support. For enquires email robert@openscenegraph.com. Services available include:
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 568 individuals from around the world that have directly contributed to the development and refinement of the OpenSceneGraph code base.
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 modelling 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.
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.
@@ -90,9 +70,11 @@ The OpenSceneGraph project owes a great deal to the community for its developmen
= !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 modelling 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.
=== Open-source development delivers industry-leading features and performance ===
The !OpenSceneGraph 3.2 release is the culmination of 14 years of work by the open-source community that has grown up around the project. The real-time graphics industry and academia embraced it from the very beginning, deploying it in real-world applications, and actively participating in its development, testing and refinement. The end result is a high-quality library with a feature set relevant to application developers' needs in both the desktop and mobile space.
@@ -106,7 +88,7 @@ The !OpenSceneGraph 3.2 release is the culmination of 14 years of work by the op
* New OpenGL extensions support including compute shaders, tessellation shaders, integer array formats and associated Vec* classes, primitive restart
* Improvements to osgManipulator NodeKit that introduce new manipulators and improve flexibility and customizability
* Updates to osgQt to support Qt5 and provide better support for Qt4
* New osgGA::Device base class for receiving from and sending events to both real and virtual devices in a generic, extensible way
* New osgGA::Device base class for recieving from and sending events to both real and virtual devices in a generic, extensible way
* New ZeroConf, RestHTTP and OSC plugins to enable remote control of applications such as controlling desktop systems from tablets and phones
* Improvements to osgVolume NodeKit and DICOM plugin for better medical visualization
* New TrackVis .trk track files plugin for the visualization of brain scans.
@@ -143,7 +125,7 @@ The !OpenSceneGraph project owes a great deal to the community for its developme
= !OpenSceneGraph 3.0 release adds support OpenGL ES 1.1, OpenGL ES 2.0, OpenGL 3.x to 4.0, support for Andoid and IOS platforms and much more.
PERTHSHIRE, Scotland - 28th June 2011 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 3.0, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 3.0 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modelling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 3.0 runs on all Microsoft Windows platforms, Apple OS/X, iOS, GNU/Linux, Android, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems.
PERTHSHIRE, Scotland - 28th June 2011 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 3.0, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 3.0 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.0 runs on all Microsoft Windows platforms, Apple OS/X, IOS, GNU/Linux, Android, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems.
=== Open-source development delivers industry-leading features and performance ===
The !OpenSceneGraph 3.0 release is the culmination of 12 years of work by the lead developers and the open-source community that has grown up around the project. The real-time graphics industry and academia embraced it from the very beginning, deploying it in real-world applications, and actively participating in its development, testing and refinement. The end result is a high-quality library with a feature set relevant to application developers' needs.
@@ -198,7 +180,7 @@ The !OpenSceneGraph project owes a great deal to the community for its developme
= !OpenSceneGraph 2.8 release adds osgAnimation and osgVolume libraries, DICOM support, LispSM shadowing and much more. =
PERTHSHIRE, Scotland - 12th February 2009 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 2.8, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 2.8 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modelling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 2.8 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems.
PERTHSHIRE, Scotland - 12th February 2009 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 2.8, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 2.8 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 2.8 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems.
=== Open-source development delivers industry-leading features and performance ===
The !OpenSceneGraph 2.8 release is the culmination of 10 years of work by the lead developers and the open-source community that has grown up around the project. The real-time graphics industry and academia embraced it from the very beginning, deploying it in real-world applications, and actively participating in its development, testing and refinement. The end result is a high-quality library with a feature set relevant to application developers' needs.
@@ -269,7 +251,7 @@ About !OpenSceneGraph Professional Services:[[BR]]
= !OpenSceneGraph 2.6 release adds osgWidget library, KdTree intersections, Anti-aliased FBOsand much more. =
PERTHSHIRE, Scotland - 5th August 2008 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 2.6, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 2.6 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modelling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 2.6 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems.
PERTHSHIRE, Scotland - 5th August 2008 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 2.6, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 2.6 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 2.6 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems.
=== Open-source development delivers industry-leading features and performance ===
The !OpenSceneGraph 2.6 release is the culmination of 9 years of work by the lead developers and the open-source community that has grown up around the project. The real-time graphics industry and academia embraced it from the very beginning, deploying it in real-world applications, and actively participating in its development, testing and refinement. The end result is a high-quality library with a feature set relevant to application developers' needs.
@@ -338,7 +320,7 @@ About !OpenSceneGraph Professional Services:[[BR]]
= !OpenSceneGraph 2.4 release adds geometry shaders, multiple render targets, support for terrabyte scale terrain databases, writing to !OpenFlight and much more. =
PERTHSHIRE, Scotland - 25th April 2008 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 2.4, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 2.4 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modelling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 2.4 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems.
PERTHSHIRE, Scotland - 25th April 2008 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 2.4, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 2.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 2.4 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems.
=== Open-source development delivers industry-leading features and performance ===
The !OpenSceneGraph 2.4 release is the culmination of 9 years of work by the lead developers and the open-source community that has grown up around the project. The real-time graphics industry and academia embraced it from the very beginning, deploying it in real-world applications, and actively participating in its development, testing and refinement. The end result is a high-quality library with a feature set relevant to application developers' needs.
@@ -394,7 +376,7 @@ About !OpenSceneGraph Professional Services:[[BR]]
= OpenSceneGraph 2.2 release adds support for advanced displays, soft and parallel split shadow maps and easier builds =
PERTHSHIRE, Scotland - 4th October 2007 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 2.2, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 2.2 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modelling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 2.2 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and !FreeBSD operating systems.
PERTHSHIRE, Scotland - 4th October 2007 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 2.2, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 2.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 2.2 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and !FreeBSD operating systems.
=== Open-source development delivers industry-leading features and performance ===
The !OpenSceneGraph 2.2 release is the culmination of 8 years of work by the lead developers and the open-source community that has grown up around the project. The real-time graphics industry and academia embraced it from the very beginning, deploying it in real-world applications, and actively participating in its development, testing and refinement. The end result is a high-quality library with a feature set relevant to application developers' needs.
@@ -451,7 +433,7 @@ About !OpenSceneGraph Professional Services:[[BR]]
!!![=OpenSceneGraph=] 2.0 release improves ease-of-use and scalability, introducing new osgViewer, osgShadow and osgManipulator libraries, new build system, improved multi-core, multi-GPU support.
PERTHSHIRE, Scotland - 15th June 2007 - [=OpenSceneGraph=] Professional Services announces the release of [=OpenSceneGraph=] 2.0, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. [=OpenSceneGraph=] 2.0, written entirely in Standard C++ and built upon [=OpenGL=], offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modelling markets a real-time visualization tool which rivals established commercial scene graph toolkits in functionality and performance. [=OpenSceneGraph=] 2.0 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and [=FreeBSD=] operating systems.
PERTHSHIRE, Scotland - 15th June 2007 - [=OpenSceneGraph=] Professional Services announces the release of [=OpenSceneGraph=] 2.0, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. [=OpenSceneGraph=] 2.0, 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 rivals established commercial scene graph toolkits in functionality and performance. [=OpenSceneGraph=] 2.0 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and [=FreeBSD=] operating systems.
!!!Open-source development delivers industry-leading features and performance
The [=OpenSceneGraph=] 2.0 release is the culmination of 8 years of work by the lead developers and the open-source community that has grown up around the project. The real-time graphics industry and academia embraced it from the very beginning, deploying it in real-world applications, and actively participating in its development, testing and refinement. The end result is a high-quality library with a feature set relevant to application developers' needs.
@@ -509,7 +491,7 @@ Project Lead and Proprietor [=OpenSceneGraph=] Professional Services
!!![=OpenSceneGraph=] 1.2 release introduces Windows 64bit and AIX support, COLLADA support, processor affinity and texture atlas builder.
PERTHSHIRE, Scotland - 12th September 2006 - [=OpenSceneGraph=] Professional Services announces the release of [=OpenSceneGraph=] 1.2, the industry's leading open source scene graph technology, designed to accelerate application development and improve 3D graphics performance. [=OpenSceneGraph=] 1.2, written entirely in Standard C++ and built upon [=OpenGL=], offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modelling markets a real time visualization tool which rivals established commercial scene graph toolkits in functionality and performance. [=OpenSceneGraph=] 1.2 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and [=FreeBSD=] operating systems.
PERTHSHIRE, Scotland - 12th September 2006 - [=OpenSceneGraph=] Professional Services announces the release of [=OpenSceneGraph=] 1.2, the industry's leading open source scene graph technology, designed to accelerate application development and improve 3D graphics performance. [=OpenSceneGraph=] 1.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 rivals established commercial scene graph toolkits in functionality and performance. [=OpenSceneGraph=] 1.2 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and [=FreeBSD=] operating systems.
The [=OpenSceneGraph=]-1.2 release introduces:
@@ -534,7 +516,7 @@ Project Lead and Proprietor [=OpenSceneGraph=] Professional Services
!!!OpenSceneGraph 1.1 release introduces peformance and scalability improvements, full OpenGL Shading Language support and new OpenFlight 16.1, TerrPagea2.2 and Quake3 loaders.
AYRSHIRE, Scotland - July 19th 2006 - [=OpenSceneGraph=] Professional Services announces the release of [=OpenSceneGraph=] 1.1,
the industry's leading open-source graphics library with [=OpenGL=] 2.0 and [=OpenGL=] Shading Language support. [=OpenSceneGraph=] is designed to accelerate application development and improve 3D graphics performance. [=OpenSceneGraph=] 1.1, written entirely in Standard C++ and built upon [=OpenGL=], offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modelling markets a real time visualization tool which rivals established commercial scene graph toolkits in functionality and performance. [=OpenSceneGraph=] 1.1 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris and [=FreeBSD=] operating systems.
the industry's leading open-source graphics library with [=OpenGL=] 2.0 and [=OpenGL=] Shading Language support. [=OpenSceneGraph=] is designed to accelerate application development and improve 3D graphics performance. [=OpenSceneGraph=] 1.1, 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 rivals established commercial scene graph toolkits in functionality and performance. [=OpenSceneGraph=] 1.1 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris and [=FreeBSD=] operating systems.
The OpenSceneGraph-1.1 release introduces:
@@ -561,7 +543,7 @@ Project Lead and Proprietor [=OpenSceneGraph=] Professional Services
!!!High performance open-source graphics toolkit [=OpenSceneGraph=] hits 1.0!
AYRSHIRE, Scotland - December 9th, 2005 - [=OpenSceneGraph=] Professional Services announces the release of [=OpenSceneGraph=] 1.0, the industry's leading open-source graphics library with [=OpenGL=] 2.0 and [=OpenGL=] Shading Language support. [=OpenSceneGraph=] is designed to accelerate application development and improve 3D graphics performance. [=OpenSceneGraph=] 1.0, written entirely in Standard C++ and built upon [=OpenGL=], offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modelling markets a real time visualization tool which rivals established commercial scene graph toolkits in functionality and performance. [=OpenSceneGraph=] 1.0 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris and [=FreeBSD=] operating systems.
AYRSHIRE, Scotland - December 9th, 2005 - [=OpenSceneGraph=] Professional Services announces the release of [=OpenSceneGraph=] 1.0, the industry's leading open-source graphics library with [=OpenGL=] 2.0 and [=OpenGL=] Shading Language support. [=OpenSceneGraph=] is designed to accelerate application development and improve 3D graphics performance. [=OpenSceneGraph=] 1.0, 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 rivals established commercial scene graph toolkits in functionality and performance. [=OpenSceneGraph=] 1.0 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris and [=FreeBSD=] operating systems.
->''"3Dlabs congratulates the [=OpenSceneGraph=] development community on the release of [=OpenSceneGraph=] 1.0. [=OpenSceneGraph=] is a shining example of how open-source projects can deliver commercial-quality products with outstanding performance and a ton of cutting-edge features. 3Dlabs committed engineering resources to [=OpenSceneGraph=] to help implement full support of programmable shader technology through [=OpenGL=] Shading Language. It is gratifying to see the excitement that developers have for this important cross-platform, real-time visualization library."'''\\
Randi Rost, director of developer relations at 3Dlabs, http://developer.3Dlabs.com/
@@ -688,7 +670,7 @@ osgpbuffer also example now uses Producer's pbuffer support making it portable a
API refinements, bug fixes and performance improvements:
There have been many bug fixes, a number of performance improvements and API cleanups that have occurred throughout the 0.9.8 - 0.9.9, too many separate items to enumerate here. Together with the above new features they all go to making the OpenSceneGraph-0.9.9 the most robust, high performance and feature rich version so far, and sets the stage for the upcoming 1.0.
There have been many bug fixes, a number of performance improvements and API cleanups that have occured throughout the 0.9.8 - 0.9.9, too many separate items to enumerate here. Together with the above new features they all go to making the OpenSceneGraph-0.9.9 the most robust, high performance and feature rich version so far, and sets the stage for the upcoming 1.0.
We would like to thank the following engineers for their contributions in the 0.9.8 - 0.9.9.9 time frame (in alphabetic order):
Alberto Farre, Bob Kuehne, Brede Johansen, Carlo Camporesi, Chris Hanson, Don Burns, Donn Mielcarek, Don Tidrow, Farshid Lashkari, Frederic Marmond, Garrett Potts, Igor Kravtchenko, James French, Jan Ciger, John Grant, Joakim Simonsson, Joran Jessurun, Jason Daly, Kevin Moiule, Leandro Motta Barros, Marco Jez, Mason Menninger, Mike Weiblen, Nathan Monteleone, Norman Vine, Olaf Flebbe, Paul Melis, Per Fahlberg, Rainer Oder, Randall Hopper, Reinhard Sainitzer, Robert Osfield, Ruben, Sebastien Grignard, Stephan Huber, Terry Welsh, Thom DeCarlo, Tony Horrobin, Tree, Tugkan Calapoglu, Vivek Rajan, Waltice and Yuzhong Shen
@@ -707,7 +689,7 @@ OpenProducer - http://www.andesengineering.com/Producer/index.html
OpenThreads - http://openthreads.sf.net
xine-lib - http://xinehq.de/
OpenSceneGraph Commercial Support, Training and Consultancy links:
OpenSceneGraph Commericial Support, Training and Consultancy links:
OpenSceneGraph Professional Services - http://www.openscenegraph.com
Andes Engineering - http://www.andesengineering.com
@@ -721,7 +703,7 @@ Andes Engineering - http://www.andesengineering.com
>>> Support for database archives, improved pager, 3d compressed textures
Release 0.9.8 reflects a continuation of the prior commitment to release
Release 0.9.8 reflects a continuation of the prior committment to release
often, arriving only two short months after 0.9.7. This contrasts sharply
to the long period between 0.9.6-2 and 0.9.7. The following set of
improvements and features are part of the 0.9.8 release.
@@ -1136,7 +1118,7 @@ Andes Engineering - http://www.andesengineering.com
has now been moved to a freetype plug-in which is dynamically loaded on demand,
with the core osgText library providing a default font when the plug-in is
unavailable. Moving the freetype dependency out of the osgText library makes
it just dependent on OpenGL and Standard C++ like the rest of the core libraries,
it just dependant on OpenGL and Standard C++ like the rest of the core libraries,
allowing osgText to compile by default on all platforms.
Improved thread safety has also been achieved in the core osg and osgUtil libraries
@@ -1561,9 +1543,9 @@ Andes Engineering - http://www.andesengineering.com
Scene graph optimization has been added which can boost performance
on some database by as much as an order of magnititude, this is
particularly noticeable in .flt based databases. Display list performance
particularily noticable in .flt based databases. Display list performance
has also been boosted on NVidia based machines thanks to changing the
compilation and execution of display list into two separate operations.
compilation and execution of display list into two seperate operations.
App callbacks are now supported on all Nodes, and there now a proper
app traversal which can be used to animate the scene.
@@ -1613,7 +1595,7 @@ Andes Engineering - http://www.andesengineering.com
the core scene graph library making extremely easy to take advantage of
this advanced rendering techinque - normally only seen in research papers.
Check out osgimpostor demo to see how easy it is to add osg::Impostor
nodes to your own models. Impostors are particularly effective are
nodes to your own models. Impostors are particularily effective are
reducing scene complexity whilest minimizing the visual impact, making it
ideal for scenes with large numbers of complex objects such as a city
scene, or a dense forest.
@@ -1624,7 +1606,7 @@ Andes Engineering - http://www.andesengineering.com
The cool thing about both the osgreflect and osgimpostor demos is that
there is no hardwiring to achieve the results, the scene graph stores
all the information necessary to specify the number and type of rendering
all the information neccessary to specify the number and type of rendering
passes, and the framework handles the rest behind the scenes. This also
makes it very easy to add these advanced rendering techinques to your
own applications as everything is cleanly encapsulated with
@@ -1636,7 +1618,7 @@ Andes Engineering - http://www.andesengineering.com
web or your own.
osg::Camera has been totally revamped and now supports asymetric
and othographics projections in addition to the symmetrical perspective
and othographics projections in addition to the symetrical perspective
projections.
And finally, support for texture subloading has been added to osg::Texture

125
README.md
View File

@@ -1,125 +0,0 @@
[![Build Status](https://travis-ci.org/openscenegraph/OpenSceneGraph.svg?branch=master)](https://travis-ci.org/openscenegraph/OpenSceneGraph)
[![Coverity Status](https://scan.coverity.com/projects/9159/badge.svg)](https://scan.coverity.com/projects/openscenegraph-openscenegraph)
[![Documentation](https://codedocs.xyz/openscenegraph/OpenSceneGraph.svg)](https://codedocs.xyz/openscenegraph/OpenSceneGraph/)
[ABI Tracker](https://abi-laboratory.pro/tracker/timeline/openscenegraph/ "ABI Tracker")
# Introduction
Welcome to the OpenSceneGraph (OSG).
For up-to-date information on the project, in-depth details on how to compile and run libraries and examples, see the documentation on the OpenSceneGraph website:
http://www.openscenegraph.org/index.php/documentation
For support subscribe to our public mailing list or forum, details at:
http://www.openscenegraph.org/index.php/support
For the impatient, we've included quick build instructions below, these are are broken down is three parts:
1) General notes on building the OpenSceneGraph
2) macOS release notes
3) iOS release notes
If details below are not sufficient then head over to the openscenegraph.org to the Documentation/GettingStarted and Documentation/PlatformSpecifics sections for more indepth instructions.
Robert Osfield.
Project Lead.
31th January 2020.
---
## Section 1. How to build OpenSceneGraph
If you are using the [vcpkg](https://github.com/Microsoft/vcpkg/) dependency manager you can download and install OpenSceneGraph from source with CMake integration using a single command:
```
vcpkg install osg
```
The OpenSceneGraph uses the CMake build system to generate a platform-specific build environment. CMake reads the `CMakeLists.txt` files that you'll find throughout the OpenSceneGraph directories, checks for installed dependencies and then generates files for the selected build system.
If you don't already have CMake installed on your system you can grab it from http://www.cmake.org, use version 2.8.0 or later. Details on the OpenSceneGraph's CMake build can be found at:
http://www.openscenegraph.org/projects/osg/wiki/Build/CMake
Under Unix-like systems (i.e. Linux, IRIX, Solaris, Free-BSD, HP-UX, AIX, macOS) use the `cmake` or `ccmake` command-line utils. Note that `cmake .` defaults to building Release to ensure that you get the best performance from your final libraries/applications.
cd OpenSceneGraph
cmake .
make
sudo make install
Alternatively, you can create an out-of-source build directory and run cmake or ccmake from there. The advantage to this approach is that the temporary files created by CMake won't clutter the OpenSceneGraph source directory, and also makes it possible to have multiple independent build targets by creating multiple build directories. In a directory alongside the OpenSceneGraph use:
mkdir build
cd build
cmake ../OpenSceneGraph
make
sudo make install
Under Windows use the GUI tool CMakeSetup to build your VisualStudio files. The following page on our wiki dedicated to the CMake build system should help guide you through the process:
http://www.openscenegraph.org/index.php/documentation/platform-specifics/windows
Under macOS you can either use the CMake build system above, or use the Xcode projects that you will find in the OpenSceneGraph/Xcode directory. See release notes on macOS CMake build below.
For further details on compilation, installation and platform-specific information read "Getting Started" guide:
http://www.openscenegraph.org/index.php/documentation/10-getting-started
## Section 2. Release notes on macOS build, by Eric Sokolowski et al.
There are two ways to compile OpenSceneGraph under macOS. The recommended way is to use CMake to generate Xcode project files and then use Xcode to build the library. The default project will be able to build Debug or Release libraries, examples, and sample applications.
The alternative is to build OpenSceneGraph from the command line using `make` or `ninja` using the instructions for Unix-like systems above.
Here are some key settings to consider when using CMake:
- BUILD_OSG_EXAMPLES - By default this is turned off. Turn this setting on to compile many great example programs.
- CMAKE_OSX_ARCHITECTURES - Xcode can create applications, executables, libraries, and frameworks that can be run on more than one architecture. Use this setting to indicate the architectures on which to build OSG. x86_64 is the only supported value for OS versions > 10.7.
- OSG_BUILD_APPLICATION_BUNDLES - Normally only executable binaries are created for the examples and sample applications. Turn this option on if you want to create real macOS .app bundles. There are caveats to creating `.app` bundles, see below.
- OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX - By default macOS uses the `imageio` plugin instead of the plugins for the individual file types (e.g. `jpg`, `gif`, etc.) to load image file types. The `imageio` plugin can handle all popular file formats through the ImageIO framework.
- OSG_WINDOWING_SYSTEM - You have the choice to use Cocoa, Carbon, or X11 when building applications on macOS. Cocoa is the default for OS versions >= 10.5. Carbon and X11 are no longer actively supported, either by Apple or the OSG community.
### APPLICATION BUNDLES (.app bundles)
The example programs when built as application bundles only contain the executable file. They do not contain the dependent libraries as would a normal bundle, so they are not generally portable to other machines.
They also do not know where to find plugins. An environmental variable OSG_LIBRARY_PATH may be set to point to the location where the plugin .so files are located. OSG_FILE_PATH may be set to point to the location where data files are located. Setting OSG_FILE_PATH to the OpenSceneGraph-Data directory is very useful when testing OSG by running the example programs.
Many of the example programs use command-line arguments. When double-clicking on an application (or using the equivalent "open" command on the command line) only those examples and applications that do not require command-line arguments will successfully run. The executable file within the .app bundle can be run from the command-line if command-line arguments are needed.
## Section 3. Release notes on iOS build, by Thomas Hogarth
With CMake 3.11, XCode 9.4 and the iOS sdk 11.4 installed you can generate an iOS XCode project using the following command line:
export THIRDPARTY_PATH=/path/to/3rdParty
cmake ./ -G Xcode -DOSG_BUILD_PLATFORM_IPHONE:BOOL=ON \
-DIPHONE_SDKVER="11.4" \
-DIPHONE_VERSION_MIN="10.0" \
-DOPENGL_PROFILE:STRING=GLES3 \
-DOSG_CPP_EXCEPTIONS_AVAILABLE:BOOL=ON \
-DBUILD_OSG_APPLICATIONS:BOOL=OFF \
-DBUILD_OSG_EXAMPLES:BOOL=ON \
-DOSG_WINDOWING_SYSTEM:STRING=IOS \
-DOSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX="imageio" \
-DDYNAMIC_OPENSCENEGRAPH:BOOL=OFF \
-DDYNAMIC_OPENTHREADS:BOOL=OFF \
-DCURL_INCLUDE_DIR:PATH="$THIRDPARTY_PATH/curl-ios-device/include" \
-DCURL_LIBRARY:PATH="$THIRDPARTY_PATH/curl-ios-device/lib/libcurl.a" \
-DFREETYPE_INCLUDE_DIR_freetype2:PATH="$THIRDPARTY_PATH/freetype-ios-universal/include/freetype" \
-DFREETYPE_INCLUDE_DIR_ft2build:PATH="$THIRDPARTY_PATH/freetype-ios-universal/include" \
-DFREETYPE_LIBRARY:PATH="$THIRDPARTY_PATH/freetype-ios-universal/lib/libFreetype2.a" \
-DTIFF_INCLUDE_DIR:PATH="$THIRDPARTY_PATH/tiff-ios-device/include" \
-DTIFF_LIBRARY:PATH="$THIRDPARTY_PATH/tiff-ios-device/lib/libtiff.a" \
-DGDAL_INCLUDE_DIR:PATH="$THIRDPARTY_PATH/gdal-ios-device/include" \
-DGDAL_LIBRARY:PATH="$THIRDPARTY_PATH/gdal-ios-device/lib/libgdal.a"
Be sure to set the THIRDPARTY_PATH to the path containing your thirdparty dependencies. Set IPHONE_SDKVER to the version of the iOS sdk you have installed, in this instance 11.4. IPHONE_VERSION_MIN controls the deployment sdk used by xcode, and lastly set OPENGL_PROFILE to the version of GLES you want to use.
Once this completes an XCode project will have been generated in the osg root folder. Open the generated Xcode project, select the example_osgViewerIPhone target. In 'General' tab set a development team.
Once this is done you should be able to build and deploy the `example_osgViewerIPhone` target on your device.

209
README.txt Normal file
View File

@@ -0,0 +1,209 @@
Welcome to the OpenSceneGraph (OSG).
For up-to-date information on the project, in-depth details on how to
compile and run libraries and examples, see the documentation on the
OpenSceneGraph website:
http://www.openscenegraph.org/index.php/documentation
For support subscribe to our public mailing list or forum, details at:
http://www.openscenegraph.org/index.php/support
For the impatient, we've included quick build instructions below, these
are are broken down is three parts:
1) General notes on building the OpenSceneGraph
2) OSX release notes
3) iOS release notes
If details below are not sufficient then head over to the openscenegraph.org
to the Documentation/GettingStarted and Documentation/PlatformSpecifics sections for
more indepth instructions.
Robert Osfield.
Project Lead.
28th August 2017.
--
Section 1. How to build the OpenSceneGraph
==========================================
The OpenSceneGraph uses the CMake build system to generate a
platform-specific build environment. CMake reads the CMakeLists.txt
files that you'll find throughout the OpenSceneGraph directories,
checks for installed dependenciesand then generates the appropriate
build system.
If you don't already have CMake installed on your system you can grab
it from http://www.cmake.org, use version 2.4.6 or later. Details on the
OpenSceneGraph's CMake build can be found at:
http://www.openscenegraph.org/projects/osg/wiki/Build/CMake
Under unices (i.e. Linux, IRIX, Solaris, Free-BSD, HP-Ux, AIX, OSX)
use the cmake or ccmake command-line utils. Note that cmake . defaults
to building Release to ensure that you get the best performance from
your final libraries/applications.
cd OpenSceneGraph
cmake .
make
sudo make install
Alternatively, you can create an out-of-source build directory and run
cmake or ccmake from there. The advantage to this approach is that the
temporary files created by CMake won't clutter the OpenSceneGraph
source directory, and also makes it possible to have multiple
independent build targets by creating multiple build directories. In a
directory alongside the OpenSceneGraph use:
mkdir build
cd build
cmake ../OpenSceneGraph
make
sudo make install
Under Windows use the GUI tool CMakeSetup to build your VisualStudio
files. The following page on our wiki dedicated to the CMake build
system should help guide you through the process:
http://www.openscenegraph.org/index.php/documentation/platform-specifics/windows
Under OSX you can either use the CMake build system above, or use the
Xcode projects that you will find in the OpenSceneGraph/Xcode
directory. See release notes on OSX CMake build below.
For further details on compilation, installation and platform-specific
information read "Getting Started" guide:
http://www.openscenegraph.org/index.php/documentation/10-getting-started
Section 2. Release notes on OSX build, by Eric Sokolowsky, August 5, 2008
=========================================================================
There are several ways to compile OpenSceneGraph under OSX. The
recommended way is to use CMake 2.6 to generate Xcode projects, then use
Xcode to build the library. The default project will be able to build
Debug or Release libraries, examples, and sample applications. Here are
some key settings to consider when using CMake:
BUILD_OSG_EXAMPLES - By default this is turned off. Turn this setting on
to compile many great example programs.
CMAKE_OSX_ARCHITECTURES - Xcode can create applications, executables,
libraries, and frameworks that can be run on more than one architecture.
Use this setting to indicate the architectures on which to build OSG.
Possibilities include ppc, ppc64, i386, and x86_64. Building OSG using
either of the 64-bit options (ppc64 and x86_64) has its own caveats
below.
OSG_BUILD_APPLICATION_BUNDLES - Normally only executable binaries are
created for the examples and sample applications. Turn this option on if
you want to create real OSX .app bundles. There are caveats to creating
.app bundles, see below.
OSG_WINDOWING_SYSTEM - You have the choice to use Carbon or X11 when
building applications on OSX. Under Leopard and later, X11 applications,
when started, will automatically launch X11 when needed. However,
full-screen X11 applications will still show the menu bar at the top of
the screen. Since many parts of the Carbon user interface are not
64-bit, X11 is the only supported option for OSX applications compiled
for ppc64 or x86_64.
There is an Xcode directory in the base of the OSG software
distribution, but its future is limited, and will be discontinued once
the CMake project generator completely implements its functionality.
APPLICATION BUNDLES (.app bundles)
The example programs when built as application bundles only contain the
executable file. They do not contain the dependent libraries as would a
normal bundle, so they are not generally portable to other machines.
They also do not know where to find plugins. An environmental variable
OSG_LIBRARY_PATH may be set to point to the location where the plugin
.so files are located. OSG_FILE_PATH may be set to point to the location
where data files are located. Setting OSG_FILE_PATH to the
OpenSceneGraph-Data directory is very useful when testing OSG by running
the example programs.
Many of the example programs use command-line arguments. When
double-clicking on an application (or using the equivalent "open"
command on the command line) only those examples and applications that
do not require command-line arguments will successfully run. The
executable file within the .app bundle can be run from the command-line
if command-line arguments are needed.
64-BIT APPLICATION SUPPORT
OpenSceneGraph will not compile successfully when OSG_WINDOWING_SYSTEM is
Carbon and either x86_64 or ppc64 is selected under CMAKE_OSX_ARCHITECTURES,
as Carbon is a 32bit only API. A version of the osgviewer library written in
Cocoa is needed. However, OSG may be compiled under 64-bits if the X11
windowing system is selected. However, Two parts of the OSG default
distribution will not work with 64-bit X11: the osgviewerWX example
program and the osgdb_qt (Quicktime) plugin. These must be removed from
the Xcode project after Cmake generates it in order to compile with
64-bit architectures. The lack of the latter means that images such as
jpeg, tiff, png, and gif will not work, nor will animations dependent on
Quicktime. A new ImageIO-based plugin is being developed to handle the
still images, and a QTKit plugin will need to be developed to handle
animations.
Section 3. Release notes on iOS build, by Thomas Hoghart
=========================================================
* Run CMake with either OSG_BUILD_PLATFORM_IPHONE or OSG_BUILD_PLATFORM_IPHONE_SIMULATOR set:
$ mkdir build-iOS ; cd build-iOS
$ ccmake -DOSG_BUILD_PLATFORM_IPHONE_SIMULATOR=YES -G Xcode ..
* Check that CMAKE_OSX_ARCHITECTURE is i386 for the simulator or armv6;armv7 for the device
* Disable DYNAMIC_OPENSCENEGRAPH, DYNAMIC_OPENTHREADS
This will give us the static build we need for iPhone.
* Disable OSG_GL1_AVAILABLE, OSG_GL2_AVAILABLE, OSG_GL3_AVAILABLE,
OSG_GL_DISPLAYLISTS_AVAILABLE, OSG_GL_VERTEX_FUNCS_AVAILABLE
* Enable OSG_GLES1_AVAILABLE *OR* OSG_GLES2_AVAILABLE *OR* OSG_GLES3_AVAILABLE (GLES3 will enable GLES2 features)
* Ensure OSG_WINDOWING_SYSTEM is set to IOS
* Change FREETYPE include and library paths to an iPhone version
(OpenFrameworks has one bundled with its distribution)
* Ensure that CMake_OSX_SYSROOT points to your iOS SDK.
* Generate the Xcode project
* Open the Xcode project
$ open OpenSceneGraph.xcodeproj
* Under Sources -> osgDB, select FileUtils.cpp and open the 'Get Info' panel, change File Type
to source.cpp.objcpp
Here's an example for the command-line:
$ cmake -G Xcode \
-D OSG_BUILD_PLATFORM_IPHONE:BOOL=ON \
-D CMAKE_CXX_FLAGS:STRING="-ftree-vectorize -fvisibility-inlines-hidden -mno-thumb -arch armv6 -pipe -no-cpp-precomp -miphoneos-version-min=3.1 -mno-thumb" \
-D BUILD_OSG_APPLICATIONS:BOOL=OFF \
-D OSG_BUILD_FRAMEWORKS:BOOL=OFF \
-D OSG_WINDOWING_SYSTEM:STRING=IOS \
-D OSG_BUILD_PLATFORM_IPHONE:BOOL=ON \
-D CMAKE_OSX_ARCHITECTURES:STRING="armv6;armv7" \
-D CMAKE_OSX_SYSROOT:STRING=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk \
-D OSG_GL1_AVAILABLE:BOOL=OFF \
-D OSG_GL2_AVAILABLE:BOOL=OFF \
-D OSG_GLES1_AVAILABLE:BOOL=ON \
-D OSG_GL_DISPLAYLISTS_AVAILABLE:BOOL=OFF \
-D OSG_GL_FIXED_FUNCTION_AVAILABLE:BOOL=ON \
-D OSG_GL_LIBRARY_STATIC:BOOL=OFF \
-D OSG_GL_MATRICES_AVAILABLE:BOOL=ON \
-D OSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE:BOOL=ON \
-D OSG_GL_VERTEX_FUNCS_AVAILABLE:BOOL=OFF \
-D DYNAMIC_OPENSCENEGRAPH:BOOL=OFF \
-D DYNAMIC_OPENTHREADS:BOOL=OFF .
Known issues:
* When Linking final app against ive plugin, you need to add -lz to
the 'Other linker flags' list.
* Apps and exes don't get created
* You can only select Simulator, or Device projects. In the XCode
project you will see both types but the sdk they link will
be the same.

View File

@@ -45,8 +45,6 @@ class MyGraphicsContext {
traits->doubleBuffer = false;
traits->sharedContext = 0;
traits->pbuffer = true;
traits->readDISPLAY();
traits->setUndefinedScreenDetailsToDefaultScreen();
_gc = osg::GraphicsContext::createGraphicsContext(traits.get());
@@ -627,19 +625,13 @@ int main( int argc, char **argv )
while (arguments.read("-e",ext))
{
std::string libName = osgDB::Registry::instance()->createLibraryNameForExtension(ext);
if (osgDB::Registry::instance()->loadLibrary(libName)==osgDB::Registry::NOT_LOADED)
{
OSG_NOTICE<<"Unable to load library : "<<libName<<std::endl;
}
osgDB::Registry::instance()->loadLibrary(libName);
}
std::string libName;
while (arguments.read("-l",libName))
{
if (osgDB::Registry::instance()->loadLibrary(libName)==osgDB::Registry::NOT_LOADED)
{
OSG_NOTICE<<"Unable to load library : "<<libName<<std::endl;
}
osgDB::Registry::instance()->loadLibrary(libName);
}
while (arguments.read("-o",str))
@@ -742,7 +734,7 @@ int main( int argc, char **argv )
while(arguments.read("--addMissingColours") || arguments.read("--addMissingColors")) { addMissingColours = true; }
bool do_overallNormal = false;
while(arguments.read("--overallNormal")) { do_overallNormal = true; }
while(arguments.read("--overallNormal") || arguments.read("--overallNormal")) { do_overallNormal = true; }
bool enableObjectCache = false;
while(arguments.read("--enable-object-cache")) { enableObjectCache = true; }
@@ -771,7 +763,7 @@ int main( int argc, char **argv )
osgDB::Registry::instance()->getOptions()->setObjectCacheHint(osgDB::Options::CACHE_ALL);
}
std::string fileNameOut("converted.osgt");
std::string fileNameOut("converted.osg");
if (fileNames.size()>1)
{
fileNameOut = fileNames.back();
@@ -780,66 +772,29 @@ int main( int argc, char **argv )
osg::Timer_t startTick = osg::Timer::instance()->tick();
typedef std::vector< osg::ref_ptr<osg::Image> > Images;
typedef std::vector< osg::ref_ptr<osg::Node> > Nodes;
typedef std::vector< osg::ref_ptr<osg::Object> > Objects;
osg::ref_ptr<osg::Node> root = osgDB::readRefNodeFiles(fileNames);
Images images;
Nodes nodes;
Objects objects;
for(FileNameList::iterator itr = fileNames.begin();
itr != fileNames.end();
++itr)
if (root.valid())
{
osg::ref_ptr<osg::Object> object = osgDB::readObjectFile(*itr);
if (object.valid())
{
if (object->asNode()) nodes.push_back(object->asNode());
else if (object->asImage()) images.push_back(object->asImage());
else objects.push_back(object);
}
}
if (images.empty() && nodes.empty() && objects.empty())
{
osg::notify(osg::NOTICE)<<"Warning: failed to load any files"<<std::endl;
return 1;
osg::Timer_t endTick = osg::Timer::instance()->tick();
osg::notify(osg::INFO)<<"Time to load files "<<osg::Timer::instance()->delta_m(startTick, endTick)<<" ms"<<std::endl;
}
osg::Timer_t endTick = osg::Timer::instance()->tick();
osg::notify(osg::INFO)<<"Time to load files "<<osg::Timer::instance()->delta_m(startTick, endTick)<<" ms"<<std::endl;
osg::ref_ptr<osg::Node> root;
if (nodes.size()==1) root = nodes.front();
else if (nodes.size()>1)
if (pruneStateSet)
{
osg::ref_ptr<osg::Group> group = new osg::Group;
for(Nodes::iterator itr = nodes.begin();
itr != nodes.end();
++itr)
{
group->addChild(itr->get());
}
PruneStateSetVisitor pssv;
root->accept(pssv);
}
root = group;
if (fixTransparencyMode != FixTransparencyVisitor::NO_TRANSPARANCY_FIXING)
{
FixTransparencyVisitor atv(fixTransparencyMode);
root->accept(atv);
}
if ( root.valid() )
{
if (pruneStateSet)
{
PruneStateSetVisitor pssv;
root->accept(pssv);
}
if (fixTransparencyMode != FixTransparencyVisitor::NO_TRANSPARANCY_FIXING)
{
FixTransparencyVisitor atv(fixTransparencyMode);
root->accept(atv);
}
if (smooth)
{
@@ -862,7 +817,7 @@ int main( int argc, char **argv )
if (internalFormatMode != osg::Texture::USE_IMAGE_DATA_FORMAT)
{
ext = osgDB::getFileExtension(fileNameOut);
std::string ext = osgDB::getFileExtension(fileNameOut);
CompressTexturesVisitor ctv(internalFormatMode);
root->accept(ctv);
ctv.compress();
@@ -905,20 +860,6 @@ int main( int argc, char **argv )
osg::notify(osg::NOTICE)<<result.message()<< std::endl;
}
}
else if (!images.empty())
{
if (images.size()>1)
{
OSG_NOTICE<<"Warning: osgconv does not support writing multiple to a single file."<<std::endl;
return 1;
}
osgDB::writeImageFile(*images.front(), fileNameOut);
}
else if (!objects.empty())
{
osgDB::writeObjectFile(*images.front(), fileNameOut);
}
else
{
osg::notify(osg::NOTICE)<<"Error no data loaded."<< std::endl;

View File

@@ -32,10 +32,7 @@
#include <signal.h>
#include <stdlib.h>
#include <OpenThreads/Atomic>
static OpenThreads::Atomic s_ExitApplication;
static OpenThreads::Atomic s_SigValue;
static bool s_ExitApplication = false;
struct Extents
{
@@ -386,8 +383,8 @@ protected:
static void signalHandler(int sig)
{
s_SigValue.exchange(sig);
s_ExitApplication.exchange(1);
printf("\nCaught signal %d, requesting exit...\n\n",sig);
s_ExitApplication = true;
}
int main( int argc, char **argv )
@@ -486,7 +483,7 @@ int main( int argc, char **argv )
if (s_ExitApplication)
{
std::cout<<"osgfilecache exited in response to signal : "<<s_SigValue<<std::endl;
std::cout<<"osgfilecache cleanly exited in response to signal."<<std::endl;
}
return 0;

View File

@@ -275,16 +275,7 @@ const char* invalidNames[] =
"I",
"TriangleFunctor",
"PrimitiveFunctor",
"OpenMW",
"StreamOperator",
"SceneLoader",
"OpenGL",
"FindLIBLAS",
"PissedCapslock",
"MinGW",
"Haojia521",
"Github",
"It"
"OpenMW"
};
@@ -523,8 +514,6 @@ struct NameCorrection
NameCorrection nameCorrections[] =
{
{"LaurensVoerman","GetScalarValue",
"Laurens", "Voerman"},
{"LaurensVoerman","Meta_Shape",
"Laurens", "Voerman"},
{"LaurensVoerman","OpenCascade",
@@ -710,9 +699,7 @@ NameCorrection nameCorrections[] =
{"WeSee", "",
"Alois", "Wismer"},
{"We", "See",
"Alois", "Wismer"},
{"AnyOldName3", "",
"Chris", "Djali"}
"Alois", "Wismer"}
};

View File

@@ -17,7 +17,6 @@
#include <osg/Plane>
#include <osg/BoundingBox>
#include <osg/BoundingSphere>
#include <osg/Quat>
#ifdef BUILD_CONTRIBUTORS
extern void printContributors(const std::string& changeLog, bool printNumEntries);
@@ -41,7 +40,6 @@ int main( int argc, char** argv)
arguments.getApplicationUsage()->addCommandLineOption("Plane::value_type", "Print the value of Plane::value_type");
arguments.getApplicationUsage()->addCommandLineOption("BoundingSphere::value_type", "Print the value of BoundingSphere::value_type");
arguments.getApplicationUsage()->addCommandLineOption("BoundingBox::value_type", "Print the value of BoundingBox::value_type");
arguments.getApplicationUsage()->addCommandLineOption("Quat::value_type", "Print the value of Quat::value_type");
#ifdef BUILD_CONTRIBUTORS
arguments.getApplicationUsage()->addCommandLineOption("-r <file> or --read <file>", "Read the ChangeLog to generate an estimated contributors list.");
@@ -141,12 +139,6 @@ int main( int argc, char** argv)
return 0;
}
if (arguments.read("Quat::value_type"))
{
cout << ((sizeof(osg::Quat::value_type) == 4) ? "float" : "double") << endl;
return 0;
}
cout << osgGetLibraryName() << " " << osgGetVersion() << endl << endl;
#ifdef BUILD_CONTRIBUTORS

View File

@@ -48,7 +48,6 @@ int main(int argc, char** argv)
arguments.getApplicationUsage()->addCommandLineOption("-p <filename>","Play specified camera path animation file, previously saved with 'z' key.");
arguments.getApplicationUsage()->addCommandLineOption("--speed <factor>","Speed factor for animation playing (1 == normal speed).");
arguments.getApplicationUsage()->addCommandLineOption("--device <device-name>","add named device to the viewer");
arguments.getApplicationUsage()->addCommandLineOption("--stats","print out load and compile timing stats");
osgViewer::Viewer viewer(arguments);
@@ -72,15 +71,17 @@ int main(int argc, char** argv)
return 1;
}
bool printStats = arguments.read("--stats");
std::string url, username, password;
while(arguments.read("--login",url, username, password))
{
osgDB::Registry::instance()->getOrCreateAuthenticationMap()->addAuthenticationDetails(
url,
new osgDB::AuthenticationDetails(username, password)
);
if (!osgDB::Registry::instance()->getAuthenticationMap())
{
osgDB::Registry::instance()->setAuthenticationMap(new osgDB::AuthenticationMap);
osgDB::Registry::instance()->getAuthenticationMap()->addAuthenticationDetails(
url,
new osgDB::AuthenticationDetails(username, password)
);
}
}
std::string device;
@@ -112,7 +113,7 @@ int main(int argc, char** argv)
while (arguments.read("-p",pathfile))
{
osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile);
if (apm && !apm->getAnimationPath()->empty())
if (apm || !apm->valid())
{
apm->setTimeScale(animationSpeed);
@@ -150,8 +151,6 @@ int main(int argc, char** argv)
// add the screen capture handler
viewer.addEventHandler(new osgViewer::ScreenCaptureHandler);
osg::ElapsedTime elapsedTime;
// load the data
osg::ref_ptr<osg::Node> loadedModel = osgDB::readRefNodeFiles(arguments);
if (!loadedModel)
@@ -160,15 +159,6 @@ int main(int argc, char** argv)
return 1;
}
if (printStats)
{
double loadTime = elapsedTime.elapsedTime_m();
std::cout<<"Load time "<<loadTime<<"ms"<<std::endl;
viewer.getStats()->collectStats("compile", true);
}
// any option left unread are converted into errors to write out later.
arguments.reportRemainingOptionsAsUnrecognized();

View File

@@ -1,14 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
* This software is open source and may be redistributed and/or modified under
* the terms of the GNU General Public License (GPL) version 2.0.
* The full license is in LICENSE.txt file included with this distribution,.
*
* This library is distributed in the hope that it will be useful,
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
* include LICENSE.txt for more details.
*/
#include "Cluster.h"
@@ -16,7 +15,6 @@
#include <stdio.h>
#include <fcntl.h>
#include <sys/types.h>
#include <errno.h>
#if !defined (WIN32) || defined(__CYGWIN__)
#include <sys/ioctl.h>
@@ -292,23 +290,14 @@ bool Receiver::init( void )
perror( "Socket" );
return false;
}
int result = 0;
#if defined (WIN32) && !defined(__CYGWIN__)
// const BOOL on = TRUE;
// setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, (const char*) &on, sizeof(int));
#else
int on = 1;
result = setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
#endif
if (result)
{
OSG_NOTICE<<"Warning: Reciever::init() setsockopt(..) failed, errno="<<errno<<std::endl;
return false;
}
// struct sockaddr_in saddr;
saddr.sin_family = AF_INET;
saddr.sin_port = htons( _port );
@@ -368,17 +357,11 @@ void Receiver::sync( void )
#if defined (WIN32) && !defined(__CYGWIN__)
// saddr.sin_port = htons( _port );
int result = recvfrom( _so, (char *)_buffer, _buffer_size, 0, (sockaddr*)&saddr, &size );
recvfrom( _so, (char *)_buffer, _buffer_size, 0, (sockaddr*)&saddr, &size );
// recvfrom(sock_Receive, szMessage, 256, 0, (sockaddr*)&addr_Cli, &clilen)
//int err = WSAGetLastError ();
//int *dum = (int*) _buffer;
if (result<0)
{
OSG_NOTICE<<"Warning: Receiver::sync() recvfrom(..) failed, errno="<<errno<<std::endl;
return;
}
while( select( _so+1, &fdset, 0L, 0L, &tv ) )
{
if( FD_ISSET( _so, &fdset ) )
@@ -387,13 +370,7 @@ void Receiver::sync( void )
}
}
#else
int result = recvfrom( _so, (caddr_t)_buffer, _buffer_size, 0, 0, &size );
if (result<0)
{
OSG_NOTICE<<"Warning: Receiver::sync() recvfrom(..) failed, errno="<<errno<<std::endl;
return;
}
recvfrom( _so, (caddr_t)_buffer, _buffer_size, 0, 0, &size );
while( select( _so+1, &fdset, 0L, 0L, &tv ) )
{
if( FD_ISSET( _so, &fdset ) )
@@ -452,26 +429,21 @@ bool Broadcaster::init( void )
int on = 1;
#endif
int result = 0;
#if defined (WIN32) && !defined(__CYGWIN__)
result = setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, (const char *) &on, sizeof(int));
setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, (const char *) &on, sizeof(int));
#else
result = setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
#endif
if (result) return false;
saddr.sin_family = AF_INET;
saddr.sin_port = htons( _port );
if( _address == 0 )
{
#if defined (WIN32) && !defined(__CYGWIN__)
result = setsockopt( _so, SOL_SOCKET, SO_BROADCAST, (const char *) &on, sizeof(int));
setsockopt( _so, SOL_SOCKET, SO_BROADCAST, (const char *) &on, sizeof(int));
#else
result = setsockopt( _so, SOL_SOCKET, SO_BROADCAST, &on, sizeof(on));
setsockopt( _so, SOL_SOCKET, SO_BROADCAST, &on, sizeof(on));
#endif
if (result) return false;
#if !defined (WIN32) || defined(__CYGWIN__)
struct ifreq ifr;
@@ -542,19 +514,14 @@ void Broadcaster::sync( void )
return;
}
int result = 0;
#if defined (WIN32) && !defined(__CYGWIN__)
unsigned int size = sizeof( SOCKADDR_IN );
result = sendto( _so, (const char *)_buffer, _buffer_size, 0, (struct sockaddr *)&saddr, size );
sendto( _so, (const char *)_buffer, _buffer_size, 0, (struct sockaddr *)&saddr, size );
// int err = WSAGetLastError ();
// int *dum = (int*) _buffer;
#else
unsigned int size = sizeof( struct sockaddr_in );
result = sendto( _so, (const void *)_buffer, _buffer_size, 0, (struct sockaddr *)&saddr, size );
sendto( _so, (const void *)_buffer, _buffer_size, 0, (struct sockaddr *)&saddr, size );
#endif
if (result)
{
OSG_NOTICE<<"Warning: sentTo(...) failed : errno="<<errno<<std::endl;
}
}

View File

@@ -1,14 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
* This software is open source and may be redistributed and/or modified under
* the terms of the GNU General Public License (GPL) version 2.0.
* The full license is in LICENSE.txt file included with this distribution,.
*
* This library is distributed in the hope that it will be useful,
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
* include LICENSE.txt for more details.
*/
#ifndef CLUSTER_H
@@ -44,7 +43,7 @@ class Receiver
// Define what port to listen and bind to
void setPort( const short port );
// Sync does a blocking wait to receive next message
// Sync does a blocking wait to recieve next message
void sync( void );
private :
@@ -142,7 +141,7 @@ class CameraPacket {
void writeEventQueue(osgViewer::Viewer& viewer);
void setMasterKilled(const bool flag) { _masterKilled = flag; }
bool getMasterKilled() const { return _masterKilled; }
const bool getMasterKilled() const { return _masterKilled; }
unsigned int _byte_order;
bool _masterKilled;

View File

@@ -1,14 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
* This software is open source and may be redistributed and/or modified under
* the terms of the GNU General Public License (GPL) version 2.0.
* The full license is in LICENSE.txt file included with this distribution,.
*
* This library is distributed in the hope that it will be useful,
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
* include LICENSE.txt for more details.
*/
#include "ExportHTML.h"

View File

@@ -1,14 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
* This software is open source and may be redistributed and/or modified under
* the terms of the GNU General Public License (GPL) version 2.0.
* The full license is in LICENSE.txt file included with this distribution,.
*
* This library is distributed in the hope that it will be useful,
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
* include LICENSE.txt for more details.
*/
#ifndef EXPORTHTML_H

View File

@@ -1,14 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
* This software is open source and may be redistributed and/or modified under
* the terms of the GNU General Public License (GPL) version 2.0.
* The full license is in LICENSE.txt file included with this distribution,.
*
* This library is distributed in the hope that it will be useful,
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
* include LICENSE.txt for more details.
*/
#include "PointsEventHandler.h"

View File

@@ -1,14 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
* This software is open source and may be redistributed and/or modified under
* the terms of the GNU General Public License (GPL) version 2.0.
* The full license is in LICENSE.txt file included with this distribution,.
*
* This library is distributed in the hope that it will be useful,
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
* include LICENSE.txt for more details.
*/
#ifndef POINTSEVENTHANDLER

View File

@@ -1,14 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
* This software is open source and may be redistributed and/or modified under
* the terms of the GNU General Public License (GPL) version 2.0.
* The full license is in LICENSE.txt file included with this distribution,.
*
* This library is distributed in the hope that it will be useful,
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
* include LICENSE.txt for more details.
*/
#include "ReadShowFile.h"
@@ -223,8 +222,8 @@ osg::ref_ptr<osg::Node> p3d::readShowFiles(osg::ArgumentParser& arguments,const
while (arguments.read("--movie",filename))
{
osg::ref_ptr<osg::Image> image = readRefImageFile(filename.c_str(), local_options.get());
osg::ImageStream* imageStream = dynamic_cast<osg::ImageStream*>(image.get());
if (imageStream)
osg::ref_ptr<osg::ImageStream> imageStream = dynamic_cast<osg::ImageStream*>(image.get());
if (image.valid())
{
imageStream->play();
nodeList.push_back(osg::createGeodeForImage(imageStream));
@@ -257,7 +256,7 @@ osg::ref_ptr<osg::Node> p3d::readShowFiles(osg::ArgumentParser& arguments,const
nodeList.push_back(node);
// make sure that this presentation isn't cached
osgDB::Registry::instance()->removeFromObjectCache( arguments[pos], local_options.get());
osgDB::Registry::instance()->removeFromObjectCache( arguments[pos] );
}
}
}

View File

@@ -1,14 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* This software is open source and may be redistributed and/or modified under
* the terms of the GNU General Public License (GPL) version 2.0.
* The full license is in LICENSE.txt file included with this distribution,.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* include LICENSE.txt for more details.
*/
#ifndef P3D_READFILE

View File

@@ -1,14 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* This software is open source and may be redistributed and/or modified under
* the terms of the GNU General Public License (GPL) version 2.0.
* The full license is in LICENSE.txt file included with this distribution,.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* include LICENSE.txt for more details.
*/
#include <osgViewer/Viewer>
@@ -34,7 +33,7 @@ SDLIntegration::SDLIntegration()
atexit(SDL_Quit);
int numJoysticks = SDL_NumJoysticks();
if (_verbose)
{
std::cout<<"number of joysticks "<<numJoysticks<<std::endl;
@@ -43,9 +42,9 @@ SDLIntegration::SDLIntegration()
std::cout<<"Joystick name '"<<SDL_JoystickName(i)<<"'"<<std::endl;
}
}
_joystick = numJoysticks>0 ? SDL_JoystickOpen(0) : 0;
_numAxes = _joystick ? SDL_JoystickNumAxes(_joystick) : 0;
_numBalls = _joystick ? SDL_JoystickNumBalls(_joystick) : 0;
_numHats = _joystick ? SDL_JoystickNumHats(_joystick) : 0;
@@ -58,13 +57,13 @@ SDLIntegration::SDLIntegration()
std::cout<<"numHats = "<<_numHats<<std::endl;
std::cout<<"numButtons = "<<_numButtons<<std::endl;
}
addMouseButtonMapping(4, 1); // left
addMouseButtonMapping(5, 3); // right
addMouseButtonMapping(6, 2); // middle
addKeyMapping(10, ' '); // R2
addKeyMapping(0, '1'); // 1
addKeyMapping(1, '2'); // 2
addKeyMapping(2, '3'); // 3
@@ -89,7 +88,7 @@ void SDLIntegration::capture(ValueList& axisValues, ValueList& buttonValues) con
if (_joystick)
{
SDL_JoystickUpdate();
axisValues.resize(_numAxes);
for(int ai=0; ai<_numAxes; ++ai)
{
@@ -108,21 +107,21 @@ void SDLIntegration::update(osgViewer::Viewer& viewer)
{
if (_joystick)
{
ValueList newAxisValues;
ValueList newButtonValues;
capture(newAxisValues, newButtonValues);
unsigned int mouseXaxis = 0;
unsigned int mouseYaxis = 1;
float prev_mx = (float)_axisValues[mouseXaxis]/32767.0f;
float prev_my = -(float)_axisValues[mouseYaxis]/32767.0f;
float mx = (float)newAxisValues[mouseXaxis]/32767.0f;
float my = -(float)newAxisValues[mouseYaxis]/32767.0f;
osgGA::EventQueue* eq = viewer.getEventQueue();
double time = eq ? eq->getTime() : 0.0;
@@ -146,7 +145,7 @@ void SDLIntegration::update(osgViewer::Viewer& viewer)
}
}
}
for(int bi=0; bi<_numButtons; ++bi)
{
if (newButtonValues[bi]!=_buttonValues[bi])
@@ -172,11 +171,11 @@ void SDLIntegration::update(osgViewer::Viewer& viewer)
}
}
}
_axisValues.swap(newAxisValues);
_buttonValues.swap(newButtonValues);
}
}

View File

@@ -1,14 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* This software is open source and may be redistributed and/or modified under
* the terms of the GNU General Public License (GPL) version 2.0.
* The full license is in LICENSE.txt file included with this distribution,.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* include LICENSE.txt for more details.
*/
#ifndef SDLINTEGRATION
@@ -32,12 +31,12 @@ class SDLIntegration
typedef std::map<int, int> ButtonMap;
void update(osgViewer::Viewer& viewer);
void addMouseButtonMapping(int joystickButton, int mouseButton)
{
_mouseButtonMap[joystickButton] = mouseButton;
}
int getMouseButtonMapping(int joystickButton)
{
ButtonMap::const_iterator itr = _mouseButtonMap.find(joystickButton);
@@ -49,16 +48,16 @@ class SDLIntegration
{
_keyMap[joystickButton] = key;
}
int getKeyMapping(int joystickButton)
{
ButtonMap::const_iterator itr = _keyMap.find(joystickButton);
if (itr != _keyMap.end()) return itr->second;
else return -1;
}
protected:
void capture(ValueList& axisValues, ValueList& buttonValues) const;
SDL_Joystick* _joystick;
@@ -67,7 +66,7 @@ class SDLIntegration
int _numHats;
int _numButtons;
bool _verbose;
ValueList _axisValues;
ValueList _buttonValues;
ButtonMap _mouseButtonMap;

View File

@@ -1,14 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
* This software is open source and may be redistributed and/or modified under
* the terms of the GNU General Public License (GPL) version 2.0.
* The full license is in LICENSE.txt file included with this distribution,.
*
* This library is distributed in the hope that it will be useful,
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
* include LICENSE.txt for more details.
*/
#include "ShowEventHandler.h"

View File

@@ -1,14 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
* This software is open source and may be redistributed and/or modified under
* the terms of the GNU General Public License (GPL) version 2.0.
* The full license is in LICENSE.txt file included with this distribution,.
*
* This library is distributed in the hope that it will be useful,
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
* include LICENSE.txt for more details.
*/
#ifndef SHOWEVENTHANDLER

View File

@@ -1,14 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
* This software is open source and may be redistributed and/or modified under
* the terms of the GNU General Public License (GPL) version 2.0.
* The full license is in LICENSE.txt file included with this distribution,.
*
* This library is distributed in the hope that it will be useful,
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
* include LICENSE.txt for more details.
*/
#include <osgDB/FileNameUtils>
@@ -87,7 +86,7 @@ bool SpellChecker::isCorrect(const std::string& word) const
return true;
}
SpellChecker::WordList SpellChecker::suggest(const std::string& /*word*/) const
SpellChecker::WordList SpellChecker::suggest(const std::string& word) const
{
return WordList();
}

View File

@@ -1,14 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
* This software is open source and may be redistributed and/or modified under
* the terms of the GNU General Public License (GPL) version 2.0.
* The full license is in LICENSE.txt file included with this distribution,.
*
* This library is distributed in the hope that it will be useful,
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
* include LICENSE.txt for more details.
*/
#ifndef SPELLCHCKER_H

View File

@@ -1,14 +1,13 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
* This software is open source and may be redistributed and/or modified under
* the terms of the GNU General Public License (GPL) version 2.0.
* The full license is in LICENSE.txt file included with this distribution,.
*
* This library is distributed in the hope that it will be useful,
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
* include LICENSE.txt for more details.
*/
#include <osg/Geometry>
@@ -138,7 +137,7 @@ class ForwardToDeviceEventHandler : public osgGA::GUIEventHandler {
public:
ForwardToDeviceEventHandler(osgGA::Device* device, bool format_mouse_events) : osgGA::GUIEventHandler(), _device(device), _forwardMouseEvents(format_mouse_events) {}
virtual bool handle (const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& /*aa*/, osg::Object *, osg::NodeVisitor *)
virtual bool handle (const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa, osg::Object *, osg::NodeVisitor *)
{
switch (ea.getEventType())
{
@@ -181,7 +180,7 @@ class DumpEventHandler : public osgGA::GUIEventHandler {
public:
DumpEventHandler() : osgGA::GUIEventHandler() {}
virtual bool handle (const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& /*aa*/, osg::Object *, osg::NodeVisitor *)
virtual bool handle (const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa, osg::Object *, osg::NodeVisitor *)
{
switch (ea.getEventType())
{
@@ -337,10 +336,14 @@ int main( int argc, char **argv )
std::string url, username, password;
while(arguments.read("--login",url, username, password))
{
osgDB::Registry::instance()->getOrCreateAuthenticationMap()->addAuthenticationDetails(
url,
new osgDB::AuthenticationDetails(username, password)
);
if (!osgDB::Registry::instance()->getAuthenticationMap())
{
osgDB::Registry::instance()->setAuthenticationMap(new osgDB::AuthenticationMap);
osgDB::Registry::instance()->getAuthenticationMap()->addAuthenticationDetails(
url,
new osgDB::AuthenticationDetails(username, password)
);
}
}
@@ -484,7 +487,7 @@ int main( int argc, char **argv )
while (arguments.read("-p",pathfile))
{
osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile);
if (apm && !apm->getAnimationPath()->empty())
if (apm || !apm->valid())
{
unsigned int num = keyswitchManipulator->getNumMatrixManipulators();
keyswitchManipulator->addMatrixManipulator( keyForAnimationPath, "Path", apm );
@@ -844,11 +847,12 @@ int main( int argc, char **argv )
}
}
osg::Timer_t startOfFrameTick = osg::Timer::instance()->tick();
double targetFrameTime = 1.0/targetFrameRate;
if (exportName.empty())
{
// objects for managing the broadcasting and receiving of camera packets.
// objects for managing the broadcasting and recieving of camera packets.
CameraPacket cp;
Broadcaster bc;
Receiver rc;
@@ -860,117 +864,116 @@ int main( int argc, char **argv )
while( !viewer.done() && !masterKilled)
{
osg::Timer_t startFrameTick = osg::Timer::instance()->tick();
// wait for all cull and draw threads to complete.
viewer.advance();
if (viewer.getRunFrameScheme()!=osgViewer::ViewerBase::ON_DEMAND || seh->checkNeedToDoFrame())
osg::Timer_t currentTick = osg::Timer::instance()->tick();
double deltaTime = osg::Timer::instance()->delta_s(startOfFrameTick, currentTick);
if (deltaTime<targetFrameTime)
{
// do the normal frame.
// wait for all cull and draw threads to complete.
viewer.advance();
#if 0
if (kmcb)
{
double time = kmcb->getTime();
viewer.getFrameStamp()->setReferenceTime(time);
}
#endif
#ifdef USE_SDL
sdlIntegration.update(viewer);
#endif
if (P3DApplicationType==MASTER)
{
// take camera zero as the guide.
osg::Matrix modelview(viewer.getCamera()->getViewMatrix());
cp.setPacket(modelview,viewer.getFrameStamp());
// cp.readEventQueue(viewer);
scratchPad.reset();
scratchPad.write(cp);
scratchPad.reset();
scratchPad.read(cp);
bc.setBuffer(scratchPad.startPtr(), scratchPad.numBytes());
std::cout << "bc.sync()"<<scratchPad.numBytes()<<std::endl;
bc.sync();
}
else if (P3DApplicationType==SLAVE)
{
rc.setBuffer(scratchPad.startPtr(), scratchPad.numBytes());
rc.sync();
scratchPad.reset();
scratchPad.read(cp);
// cp.writeEventQueue(viewer);
if (cp.getMasterKilled())
{
std::cout << "Received master killed."<<std::endl;
// break out of while (!done) loop since we've now want to shut down.
masterKilled = true;
}
}
// update the scene by traversing it with the update visitor which will
// call all node update callbacks and animations.
viewer.eventTraversal();
if (seh->getRequestReload())
{
OSG_INFO<<"Reload requested"<<std::endl;
seh->setRequestReload(false);
int previous_ActiveSlide = seh->getActiveSlide();
int previous_ActiveLayer = seh->getActiveLayer();
// reset time so any event key generate
loadedModel = p3d::readShowFiles(arguments,cacheAllOption.get());
processLoadedModel(loadedModel, optimizer_options, cursorFileName);
if (!loadedModel)
{
return 0;
}
viewer.setSceneData(loadedModel.get());
seh->set(loadedModel.get());
seh->selectSlide(previous_ActiveSlide, previous_ActiveLayer);
continue;
}
// update the scene by traversing it with the update visitor which will
// call all node update callbacks and animations.
viewer.updateTraversal();
if (P3DApplicationType==SLAVE)
{
osg::Matrix modelview;
cp.getModelView(modelview,camera_offset);
viewer.getCamera()->setViewMatrix(modelview);
}
// fire off the cull and draw traversals of the scene.
if(!masterKilled)
viewer.renderingTraversals();
OpenThreads::Thread::microSleep(static_cast<unsigned int>((targetFrameTime-deltaTime)*1000000.0));
}
// work out if we need to force a sleep to hold back the frame rate
osg::Timer_t endFrameTick = osg::Timer::instance()->tick();
double frameTime = osg::Timer::instance()->delta_s(startFrameTick, endFrameTick);
if (frameTime < targetFrameTime) OpenThreads::Thread::microSleep(static_cast<unsigned int>(1000000.0*(targetFrameTime-frameTime)));
startOfFrameTick = osg::Timer::instance()->tick();
#if 0
if (kmcb)
{
double time = kmcb->getTime();
viewer.getFrameStamp()->setReferenceTime(time);
}
#endif
#ifdef USE_SDL
sdlIntegration.update(viewer);
#endif
if (P3DApplicationType==MASTER)
{
// take camera zero as the guide.
osg::Matrix modelview(viewer.getCamera()->getViewMatrix());
cp.setPacket(modelview,viewer.getFrameStamp());
// cp.readEventQueue(viewer);
scratchPad.reset();
scratchPad.write(cp);
scratchPad.reset();
scratchPad.read(cp);
bc.setBuffer(scratchPad.startPtr(), scratchPad.numBytes());
std::cout << "bc.sync()"<<scratchPad.numBytes()<<std::endl;
bc.sync();
}
else if (P3DApplicationType==SLAVE)
{
rc.setBuffer(scratchPad.startPtr(), scratchPad.numBytes());
rc.sync();
scratchPad.reset();
scratchPad.read(cp);
// cp.writeEventQueue(viewer);
if (cp.getMasterKilled())
{
std::cout << "Received master killed."<<std::endl;
// break out of while (!done) loop since we've now want to shut down.
masterKilled = true;
}
}
// update the scene by traversing it with the update visitor which will
// call all node update callbacks and animations.
viewer.eventTraversal();
if (seh->getRequestReload())
{
OSG_INFO<<"Reload requested"<<std::endl;
seh->setRequestReload(false);
int previous_ActiveSlide = seh->getActiveSlide();
int previous_ActiveLayer = seh->getActiveLayer();
// reset time so any event key generate
loadedModel = p3d::readShowFiles(arguments,cacheAllOption.get());
processLoadedModel(loadedModel, optimizer_options, cursorFileName);
if (!loadedModel)
{
return 0;
}
viewer.setSceneData(loadedModel.get());
seh->set(loadedModel.get());
seh->selectSlide(previous_ActiveSlide, previous_ActiveLayer);
continue;
}
// update the scene by traversing it with the update visitor which will
// call all node update callbacks and animations.
viewer.updateTraversal();
if (P3DApplicationType==SLAVE)
{
osg::Matrix modelview;
cp.getModelView(modelview,camera_offset);
viewer.getCamera()->setViewMatrix(modelview);
}
// fire off the cull and draw traversals of the scene.
if(!masterKilled)
viewer.renderingTraversals();
}
}
else

View File

@@ -1 +0,0 @@
ldconfig

View File

@@ -39,7 +39,6 @@ OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
EXTENSION_MAPPING = no_extension=C++
BUILTIN_STL_SUPPORT = NO
CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO

View File

@@ -39,7 +39,6 @@ OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
EXTENSION_MAPPING = no_extension=C++
BUILTIN_STL_SUPPORT = NO
CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO
@@ -99,16 +98,15 @@ INPUT = ${OpenSceneGraph_SOURCE_DIR}/include/osg \
${OpenSceneGraph_SOURCE_DIR}/include/osgGA \
${OpenSceneGraph_SOURCE_DIR}/include/osgManipulator \
${OpenSceneGraph_SOURCE_DIR}/include/osgParticle \
${OpenSceneGraph_SOURCE_DIR}/include/osgPresentation \
${OpenSceneGraph_SOURCE_DIR}/include/osgShadow \
${OpenSceneGraph_SOURCE_DIR}/include/osgSim \
${OpenSceneGraph_SOURCE_DIR}/include/osgTerrain \
${OpenSceneGraph_SOURCE_DIR}/include/osgText \
${OpenSceneGraph_SOURCE_DIR}/include/osgUI \
${OpenSceneGraph_SOURCE_DIR}/include/osgUtil \
${OpenSceneGraph_SOURCE_DIR}/include/osgViewer \
${OpenSceneGraph_SOURCE_DIR}/include/osgVolume \
${OpenSceneGraph_SOURCE_DIR}/include/osgWidget \
${OpenSceneGraph_SOURCE_DIR}/include/osgQt \
${OpenSceneGraph_SOURCE_DIR}/doc/Doxyfiles/auto_Mainpage
INPUT_ENCODING = UTF-8
FILE_PATTERNS = *include* \

View File

@@ -169,25 +169,6 @@ OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO
# Doxygen selects the parser to use depending on the extension of the files it
# parses. With this tag you can assign which parser to use for a given
# extension. Doxygen has a built-in mapping, but you can override or extend it
# using this tag. The format is ext=language, where ext is a file extension, and
# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran:
# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran:
# Fortran. In the later case the parser tries to guess whether the code is fixed
# or free formatted code, this is the default for Fortran type files), VHDL. For
# instance to make doxygen treat .inc files as Fortran files (default is PHP),
# and .f files as C (default is Fortran), use: inc=Fortran f=C.
#
# Note: For files without extension you can use no_extension as a placeholder.
#
# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
# the files are not read by doxygen.
EXTENSION_MAPPING = no_extension=C++
# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
# the same type (for instance a group of public functions) to be put as a
# subgroup of that type (e.g. under the Public Functions section). Set it to

View File

@@ -29,7 +29,6 @@ OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
EXTENSION_MAPPING = no_extension=C++
BUILTIN_STL_SUPPORT = NO
CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO
@@ -89,16 +88,15 @@ INPUT = ${OpenSceneGraph_SOURCE_DIR}/include/osg \
${OpenSceneGraph_SOURCE_DIR}/include/osgGA \
${OpenSceneGraph_SOURCE_DIR}/include/osgManipulator \
${OpenSceneGraph_SOURCE_DIR}/include/osgParticle \
${OpenSceneGraph_SOURCE_DIR}/include/osgPresentation \
${OpenSceneGraph_SOURCE_DIR}/include/osgShadow \
${OpenSceneGraph_SOURCE_DIR}/include/osgSim \
${OpenSceneGraph_SOURCE_DIR}/include/osgTerrain \
${OpenSceneGraph_SOURCE_DIR}/include/osgText \
${OpenSceneGraph_SOURCE_DIR}/include/osgUI \
${OpenSceneGraph_SOURCE_DIR}/include/osgUtil \
${OpenSceneGraph_SOURCE_DIR}/include/osgViewer \
${OpenSceneGraph_SOURCE_DIR}/include/osgVolume \
${OpenSceneGraph_SOURCE_DIR}/include/osgWidget \
${OpenSceneGraph_SOURCE_DIR}/include/osgQt \
${OpenSceneGraph_SOURCE_DIR}/doc/Doxyfiles/auto_Mainpage
INPUT_ENCODING = UTF-8
FILE_PATTERNS = *include* \

View File

@@ -11,12 +11,12 @@ CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ABBREVIATE_BRIEF =
ABBREVIATE_BRIEF =
ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = YES
STRIP_FROM_PATH = "${OpenSceneGraph_SOURCE_DIR}/include/"
STRIP_FROM_INC_PATH =
STRIP_FROM_INC_PATH =
SHORT_NAMES = YES
JAVADOC_AUTOBRIEF = YES
QT_AUTOBRIEF = NO
@@ -24,12 +24,11 @@ MULTILINE_CPP_IS_BRIEF = NO
INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 8
ALIASES =
ALIASES =
OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
EXTENSION_MAPPING = no_extension=C++
BUILTIN_STL_SUPPORT = NO
CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO
@@ -37,6 +36,7 @@ IDL_PROPERTY_SUPPORT = YES
DISTRIBUTE_GROUP_DOC = NO
SUBGROUPING = YES
TYPEDEF_HIDES_STRUCT = NO
SYMBOL_CACHE_SIZE = 0
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
@@ -63,13 +63,13 @@ GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS =
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
SHOW_FILES = YES
SHOW_NAMESPACES = YES
FILE_VERSION_FILTER =
LAYOUT_FILE =
FILE_VERSION_FILTER =
LAYOUT_FILE =
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
@@ -79,27 +79,26 @@ WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = NO
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = "${OpenSceneGraph_SOURCE_DIR}/include/osg" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgAnimation" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgDB" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgFX" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgGA" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgManipulator" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgParticle" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgPresentation" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgShadow" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgSim" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgTerrain" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgText" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgUI" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgUtil" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgViewer" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgVolume" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgWidget"
"${OpenSceneGraph_SOURCE_DIR}/include/osgWidget" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgQt" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgAnimation"
INPUT_ENCODING = UTF-8
FILE_PATTERNS = *include* \
*.cpp
@@ -107,13 +106,13 @@ RECURSIVE = YES
EXCLUDE = .svn
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS = */.svn/*
EXCLUDE_SYMBOLS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS =
EXCLUDE_SYMBOLS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS =
EXAMPLE_RECURSIVE = NO
IMAGE_PATH =
INPUT_FILTER =
FILTER_PATTERNS =
IMAGE_PATH =
INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to source browsing
@@ -131,16 +130,16 @@ VERBATIM_HEADERS = YES
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = YES
COLS_IN_ALPHA_INDEX = 2
IGNORE_PREFIX =
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT = OpenSceneGraphReferenceDocs
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_HEADER =
HTML_FOOTER = "${OpenSceneGraph_SOURCE_DIR}/doc/Doxyfiles/custom_Footer.html"
HTML_STYLESHEET =
HTML_STYLESHEET =
HTML_DYNAMIC_SECTIONS = NO
GENERATE_DOCSET = NO
DOCSET_FEEDNAME = "Doxygen generated docs"
@@ -149,14 +148,14 @@ GENERATE_HTMLHELP = ${GENERATE_HTMLHELP}
CHM_FILE = "../${CMAKE_PROJECT_NAME}ReferenceDocs-${OPENSCENEGRAPH_VERSION}.chm"
HHC_LOCATION = "${HTML_HELP_COMPILER}"
GENERATE_CHI = NO
CHM_INDEX_ENCODING =
CHM_INDEX_ENCODING =
BINARY_TOC = NO
TOC_EXPAND = NO
GENERATE_QHP = NO
QCH_FILE =
QCH_FILE =
QHP_NAMESPACE = org.doxygen.Project
QHP_VIRTUAL_FOLDER = doc
QHG_LOCATION =
QHG_LOCATION =
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = NO
@@ -171,8 +170,8 @@ LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = a4wide
EXTRA_PACKAGES =
LATEX_HEADER =
EXTRA_PACKAGES =
LATEX_HEADER =
PDF_HYPERLINKS = NO
USE_PDFLATEX = NO
LATEX_BATCHMODE = NO
@@ -184,8 +183,8 @@ GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
@@ -198,6 +197,8 @@ MAN_LINKS = NO
#---------------------------------------------------------------------------
GENERATE_XML = NO
XML_OUTPUT = xml
XML_SCHEMA =
XML_DTD =
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
@@ -209,36 +210,37 @@ GENERATE_AUTOGEN_DEF = NO
GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX =
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS
EXPAND_AS_DEFINED =
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::additions related to external references
# Configuration::additions related to external references
#---------------------------------------------------------------------------
TAGFILES =
TAGFILES =
GENERATE_TAGFILE = ${GENERATE_TAGFILE}
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES
MSCGEN_PATH =
MSCGEN_PATH =
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = YES
DOT_FONTNAME = FreeSans
DOT_FONTSIZE = 10
DOT_FONTPATH =
DOT_FONTPATH =
CLASS_GRAPH = YES
COLLABORATION_GRAPH = NO
GROUP_GRAPHS = YES
@@ -252,7 +254,7 @@ GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
DOT_IMAGE_FORMAT = png
DOT_PATH = "${DOXYGEN_DOT_PATH}"
DOTFILE_DIRS =
DOTFILE_DIRS =
DOT_GRAPH_MAX_NODES = 50
MAX_DOT_GRAPH_DEPTH = 0
DOT_TRANSPARENT = YES
@@ -260,6 +262,6 @@ DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
#---------------------------------------------------------------------------
# Configuration::additions related to the search engine
# Configuration::additions related to the search engine
#---------------------------------------------------------------------------
SEARCHENGINE = ${SEARCHENGINE}

View File

@@ -11,12 +11,12 @@ CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ABBREVIATE_BRIEF =
ABBREVIATE_BRIEF =
ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = YES
STRIP_FROM_PATH = "${OpenSceneGraph_SOURCE_DIR}/include/"
STRIP_FROM_INC_PATH =
STRIP_FROM_INC_PATH =
SHORT_NAMES = YES
JAVADOC_AUTOBRIEF = YES
QT_AUTOBRIEF = NO
@@ -24,12 +24,11 @@ MULTILINE_CPP_IS_BRIEF = NO
INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 8
ALIASES =
ALIASES =
OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
EXTENSION_MAPPING = no_extension=C++
BUILTIN_STL_SUPPORT = NO
CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO
@@ -37,6 +36,7 @@ IDL_PROPERTY_SUPPORT = YES
DISTRIBUTE_GROUP_DOC = NO
SUBGROUPING = YES
TYPEDEF_HIDES_STRUCT = NO
SYMBOL_CACHE_SIZE = 0
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
@@ -63,13 +63,13 @@ GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS =
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
SHOW_FILES = YES
SHOW_NAMESPACES = YES
FILE_VERSION_FILTER =
LAYOUT_FILE =
FILE_VERSION_FILTER =
LAYOUT_FILE =
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
@@ -79,7 +79,7 @@ WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = NO
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
@@ -91,13 +91,13 @@ RECURSIVE = YES
EXCLUDE = .svn
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS = */.svn/*
EXCLUDE_SYMBOLS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS =
EXCLUDE_SYMBOLS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS =
EXAMPLE_RECURSIVE = NO
IMAGE_PATH =
INPUT_FILTER =
FILTER_PATTERNS =
IMAGE_PATH =
INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to source browsing
@@ -115,16 +115,16 @@ VERBATIM_HEADERS = YES
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = YES
COLS_IN_ALPHA_INDEX = 2
IGNORE_PREFIX =
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT = OpenThreadsReferenceDocs
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_HEADER =
HTML_FOOTER = "${OpenSceneGraph_SOURCE_DIR}/doc/Doxyfiles/custom_Footer.html"
HTML_STYLESHEET =
HTML_STYLESHEET =
HTML_DYNAMIC_SECTIONS = NO
GENERATE_DOCSET = NO
DOCSET_FEEDNAME = "Doxygen generated docs"
@@ -133,14 +133,14 @@ GENERATE_HTMLHELP = ${GENERATE_HTMLHELP}
CHM_FILE = "../OpenThreadsReferenceDocs-${OPENSCENEGRAPH_VERSION}.chm"
HHC_LOCATION = "${HTML_HELP_COMPILER}"
GENERATE_CHI = NO
CHM_INDEX_ENCODING =
CHM_INDEX_ENCODING =
BINARY_TOC = NO
TOC_EXPAND = NO
GENERATE_QHP = NO
QCH_FILE =
QCH_FILE =
QHP_NAMESPACE = org.doxygen.Project
QHP_VIRTUAL_FOLDER = doc
QHG_LOCATION =
QHG_LOCATION =
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = NO
@@ -155,8 +155,8 @@ LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = a4wide
EXTRA_PACKAGES =
LATEX_HEADER =
EXTRA_PACKAGES =
LATEX_HEADER =
PDF_HYPERLINKS = NO
USE_PDFLATEX = NO
LATEX_BATCHMODE = NO
@@ -168,8 +168,8 @@ GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
@@ -182,6 +182,8 @@ MAN_LINKS = NO
#---------------------------------------------------------------------------
GENERATE_XML = NO
XML_OUTPUT = xml
XML_SCHEMA =
XML_DTD =
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
@@ -193,36 +195,37 @@ GENERATE_AUTOGEN_DEF = NO
GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX =
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS
EXPAND_AS_DEFINED =
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::additions related to external references
# Configuration::additions related to external references
#---------------------------------------------------------------------------
TAGFILES =
TAGFILES =
GENERATE_TAGFILE = ${GENERATE_TAGFILE}
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES
MSCGEN_PATH =
MSCGEN_PATH =
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = YES
DOT_FONTNAME = FreeSans
DOT_FONTSIZE = 10
DOT_FONTPATH =
DOT_FONTPATH =
CLASS_GRAPH = YES
COLLABORATION_GRAPH = NO
GROUP_GRAPHS = YES
@@ -235,8 +238,8 @@ CALLER_GRAPH = NO
GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
DOT_IMAGE_FORMAT = png
DOT_PATH =
DOTFILE_DIRS =
DOT_PATH =
DOTFILE_DIRS =
DOT_GRAPH_MAX_NODES = 50
MAX_DOT_GRAPH_DEPTH = 0
DOT_TRANSPARENT = YES
@@ -244,6 +247,6 @@ DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
#---------------------------------------------------------------------------
# Configuration::additions related to the search engine
# Configuration::additions related to the search engine
#---------------------------------------------------------------------------
SEARCHENGINE = ${SEARCHENGINE}

View File

@@ -20,7 +20,6 @@ ELSE(ANDROID)
IF(DYNAMIC_OPENSCENEGRAPH)
ADD_SUBDIRECTORY(osgsimpleMDI)
ADD_SUBDIRECTORY(osg2cpp)
ADD_SUBDIRECTORY(osganalysis)
ADD_SUBDIRECTORY(osganimate)
@@ -37,7 +36,7 @@ IF(DYNAMIC_OPENSCENEGRAPH)
ADD_SUBDIRECTORY(osgcompositeviewer)
ADD_SUBDIRECTORY(osgcopy)
ADD_SUBDIRECTORY(osgcubemap)
ADD_SUBDIRECTORY(osgdeferred)
ADD_SUBDIRECTORY(osgdelaunay)
ADD_SUBDIRECTORY(osgcluster)
ADD_SUBDIRECTORY(osgdatabaserevisions)
ADD_SUBDIRECTORY(osgdepthpartition)
@@ -55,6 +54,7 @@ IF(DYNAMIC_OPENSCENEGRAPH)
ADD_SUBDIRECTORY(osghangglide)
ADD_SUBDIRECTORY(osghud)
ADD_SUBDIRECTORY(osgimagesequence)
ADD_SUBDIRECTORY(osgimpostor)
ADD_SUBDIRECTORY(osgintersection)
ADD_SUBDIRECTORY(osgkdtree)
ADD_SUBDIRECTORY(osgkeyboard)
@@ -69,7 +69,6 @@ IF(DYNAMIC_OPENSCENEGRAPH)
ADD_SUBDIRECTORY(osggpx)
ADD_SUBDIRECTORY(osggraphicscost)
ADD_SUBDIRECTORY(osgmanipulator)
ADD_SUBDIRECTORY(osgimpostor)
ADD_SUBDIRECTORY(osgmovie)
ADD_SUBDIRECTORY(osgmultiplemovies)
ADD_SUBDIRECTORY(osgmultiplerendertargets)
@@ -77,7 +76,6 @@ IF(DYNAMIC_OPENSCENEGRAPH)
ADD_SUBDIRECTORY(osgmultitexturecontrol)
ADD_SUBDIRECTORY(osgmultitouch)
ADD_SUBDIRECTORY(osgmultiviewpaging)
ADD_SUBDIRECTORY(osgobjectcache)
ADD_SUBDIRECTORY(osgoccluder)
ADD_SUBDIRECTORY(osgocclusionquery)
ADD_SUBDIRECTORY(osgoit)
@@ -99,15 +97,12 @@ IF(DYNAMIC_OPENSCENEGRAPH)
ADD_SUBDIRECTORY(osgreflect)
ADD_SUBDIRECTORY(osgrobot)
ADD_SUBDIRECTORY(osgSSBO)
ADD_SUBDIRECTORY(osgsampler)
ADD_SUBDIRECTORY(osgscalarbar)
ADD_SUBDIRECTORY(osgscribe)
ADD_SUBDIRECTORY(osgsequence)
ADD_SUBDIRECTORY(osgshaders)
ADD_SUBDIRECTORY(osgshaderpipeline)
ADD_SUBDIRECTORY(osgshadercomposition)
ADD_SUBDIRECTORY(osgshadergen)
ADD_SUBDIRECTORY(osgshadermultiviewport)
ADD_SUBDIRECTORY(osgshaderterrain)
# ADD_SUBDIRECTORY(osgshadercompositor)
ADD_SUBDIRECTORY(osgshadow)
@@ -168,9 +163,10 @@ IF(DYNAMIC_OPENSCENEGRAPH)
ADD_SUBDIRECTORY(osgwidgettable)
ADD_SUBDIRECTORY(osgwidgetwindow)
ADD_SUBDIRECTORY(osguserdata)
# GL3/GL4 example
ADD_SUBDIRECTORY(osgsimplegl3)
ADD_SUBDIRECTORY(osgbindlesstext)
IF(OSG_CPP_EXCEPTIONS_AVAILABLE)
ADD_SUBDIRECTORY(osgunittests)
ADD_SUBDIRECTORY(osgmemorytest)
@@ -193,6 +189,10 @@ IF(DYNAMIC_OPENSCENEGRAPH)
ADD_SUBDIRECTORY(osgpdf)
IF (GLUT_FOUND)
ADD_SUBDIRECTORY(osgviewerGLUT)
ENDIF(GLUT_FOUND)
IF (SDL_FOUND)
ADD_SUBDIRECTORY(osgviewerSDL)
ENDIF(SDL_FOUND)
@@ -211,6 +211,20 @@ IF(DYNAMIC_OPENSCENEGRAPH)
ENDIF()
ENDIF()
IF ( (QT4_FOUND OR Qt5Widgets_FOUND) AND NOT OSG_GLES1_AVAILABLE AND NOT OSG_GLES2_AVAILABLE AND NOT OSG_GL3_AVAILABLE)
IF ( QT4_FOUND OR Qt5Widgets_FOUND)
ADD_SUBDIRECTORY(osgviewerQt)
ADD_SUBDIRECTORY(osgqfont)
ENDIF()
IF ( (QT4_FOUND AND QT_QTWEBKIT_FOUND) OR Qt5WebKitWidgets_FOUND )
ADD_SUBDIRECTORY(osgQtWidgets)
ADD_SUBDIRECTORY(osgQtBrowser)
ENDIF()
ENDIF()
IF (FLTK_FOUND AND FLTK_GL_LIBRARY)
ADD_SUBDIRECTORY(osgviewerFLTK)
ENDIF()
@@ -243,12 +257,15 @@ ELSE(DYNAMIC_OPENSCENEGRAPH)
#needed on win32 or the linker get confused by _declspec declarations
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
IF(OSG_BUILD_PLATFORM_IPHONE)
ADD_SUBDIRECTORY(osgstaticviewer)
# IPHONE_PORT@tom
IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
ADD_SUBDIRECTORY(osgviewerIPhone)
ELSE()
ADD_SUBDIRECTORY(osgstaticviewer)
ENDIF()
# IPHONE_PORT@tom
ENDIF(DYNAMIC_OPENSCENEGRAPH)
ENDIF(ANDROID)

View File

@@ -5,7 +5,7 @@
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:targetSdkVersion="8" android:minSdkVersion="8"></uses-sdk>
<uses-feature android:glEsVersion="0x00010001"/> <!-- OpenGL min requirements (1.1) -->
<uses-feature android:glEsVersion="0x00010001"/> <!-- OpenGL min requierements (1.1) -->
<uses-permission android:name="android.permission.INTERNET"/>
<application android:label="@string/app_name" android:icon="@drawable/osg">

View File

@@ -23,7 +23,7 @@ void OsgMainApp::loadModels(){
newModel = _vModelsToLoad[i];
osg::notify(osg::ALWAYS)<<"Loading: "<<newModel.filename<<std::endl;
osg::ref_ptr<osg::Node> loadedModel = osgDB::readRefNodeFile(newModel.filename);
osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFile(newModel.filename);
if (loadedModel == 0) {
osg::notify(osg::ALWAYS)<<"Model not loaded"<<std::endl;
} else {

View File

@@ -5,7 +5,7 @@
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:targetSdkVersion="8" android:minSdkVersion="8"></uses-sdk>
<uses-feature android:glEsVersion="0x00020000"/> <!-- OpenGL min requirements (2.0) -->
<uses-feature android:glEsVersion="0x00020000"/> <!-- OpenGL min requierements (2.0) -->
<uses-permission android:name="android.permission.INTERNET"/>
<application android:label="@string/app_name" android:icon="@drawable/osg">

View File

@@ -23,7 +23,7 @@ void OsgMainApp::loadModels(){
newModel = _vModelsToLoad[i];
osg::notify(osg::ALWAYS)<<"Loading: "<<newModel.filename<<std::endl;
osg::ref_ptr<osg::Node> loadedModel = osgDB::readRefNodeFile(newModel.filename);
osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFile(newModel.filename);
if (loadedModel == 0) {
osg::notify(osg::ALWAYS)<<"Model not loaded"<<std::endl;
} else {
@@ -103,9 +103,7 @@ void OsgMainApp::initOsgWindow(int x,int y,int width,int height){
osg::notify(osg::ALWAYS)<<"Testing"<<std::endl;
_viewer = new osgViewer::Viewer();
osgViewer::GraphicsWindowEmbedded* window = _viewer->setUpViewerAsEmbeddedInWindow(x, y, width, height);
_viewer->getEventQueue()->setGraphicsContext(window);
_viewer->getEventQueue()->syncWindowRectangleWithGraphicsContext();
_viewer->setUpViewerAsEmbeddedInWindow(x, y, width, height);
_viewer->setThreadingModel(osgViewer::ViewerBase::SingleThreaded);
_root = new osg::Group();

View File

@@ -1,24 +0,0 @@
cmake_minimum_required(VERSION 2.6)
SET(PROJECT_NAME osgCMakeExample)
PROJECT(${PROJECT_NAME})
FIND_PACKAGE(OpenThreads)
FIND_PACKAGE(osg)
FIND_PACKAGE(osgDB)
FIND_PACKAGE(osgUtil)
FIND_PACKAGE(osgGA)
FIND_PACKAGE(osgViewer)
SET(SOURCES
main.cpp
)
INCLUDE_DIRECTORIES(${OPENTHREADS_INCLUDE_DIR} ${OSG_INCLUDE_DIR})
LINK_DIRECTORIES(${OSG_LIB_DIR})
ADD_EXECUTABLE(${PROJECT_NAME} ${SOURCES})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${OSG_LIBRARIES} ${OSGVIEWER_LIBRARIES} ${OSGUTIL_LIBRARIES} ${OSGDB_LIBRARIES} ${OSGGA_LIBRARIES} ${OPENTHREADS_LIBRARIES})

View File

@@ -1,183 +0,0 @@
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2010 Robert Osfield
*
* This application is open source and may be redistributed and/or modified
* freely and without restriction, both in commercial and non commercial applications,
* as long as this copyright notice is maintained.
*
* This application is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
#include <osgDB/ReadFile>
#include <osgUtil/Optimizer>
#include <osg/CoordinateSystemNode>
#include <osg/Switch>
#include <osg/Types>
#include <osgText/Text>
#include <osgViewer/Viewer>
#include <osgViewer/ViewerEventHandlers>
#include <osgGA/TrackballManipulator>
#include <osgGA/FlightManipulator>
#include <osgGA/DriveManipulator>
#include <osgGA/KeySwitchMatrixManipulator>
#include <osgGA/StateSetManipulator>
#include <osgGA/AnimationPathManipulator>
#include <osgGA/TerrainManipulator>
#include <osgGA/SphericalManipulator>
#include <osgGA/Device>
#include <iostream>
int main(int argc, char** argv)
{
// use an ArgumentParser object to manage the program arguments.
osg::ArgumentParser arguments(&argc,argv);
arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName());
arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is the standard OpenSceneGraph example which loads and visualises 3d models.");
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ...");
arguments.getApplicationUsage()->addCommandLineOption("--image <filename>","Load an image and render it on a quad");
arguments.getApplicationUsage()->addCommandLineOption("--dem <filename>","Load an image/DEM and render it on a HeightField");
arguments.getApplicationUsage()->addCommandLineOption("--login <url> <username> <password>","Provide authentication information for http file access.");
arguments.getApplicationUsage()->addCommandLineOption("-p <filename>","Play specified camera path animation file, previously saved with 'z' key.");
arguments.getApplicationUsage()->addCommandLineOption("--speed <factor>","Speed factor for animation playing (1 == normal speed).");
arguments.getApplicationUsage()->addCommandLineOption("--device <device-name>","add named device to the viewer");
osgViewer::Viewer viewer(arguments);
unsigned int helpType = 0;
if ((helpType = arguments.readHelpType()))
{
arguments.getApplicationUsage()->write(std::cout, helpType);
return 1;
}
// report any errors if they have occurred when parsing the program arguments.
if (arguments.errors())
{
arguments.writeErrorMessages(std::cout);
return 1;
}
if (arguments.argc()<=1)
{
arguments.getApplicationUsage()->write(std::cout,osg::ApplicationUsage::COMMAND_LINE_OPTION);
return 1;
}
std::string url, username, password;
while(arguments.read("--login",url, username, password))
{
if (!osgDB::Registry::instance()->getAuthenticationMap())
{
osgDB::Registry::instance()->setAuthenticationMap(new osgDB::AuthenticationMap);
osgDB::Registry::instance()->getAuthenticationMap()->addAuthenticationDetails(
url,
new osgDB::AuthenticationDetails(username, password)
);
}
}
std::string device;
while(arguments.read("--device", device))
{
osg::ref_ptr<osgGA::Device> dev = osgDB::readRefFile<osgGA::Device>(device);
if (dev.valid())
{
viewer.addDevice(dev);
}
}
// set up the camera manipulators.
{
osg::ref_ptr<osgGA::KeySwitchMatrixManipulator> keyswitchManipulator = new osgGA::KeySwitchMatrixManipulator;
keyswitchManipulator->addMatrixManipulator( '1', "Trackball", new osgGA::TrackballManipulator() );
keyswitchManipulator->addMatrixManipulator( '2', "Flight", new osgGA::FlightManipulator() );
keyswitchManipulator->addMatrixManipulator( '3', "Drive", new osgGA::DriveManipulator() );
keyswitchManipulator->addMatrixManipulator( '4', "Terrain", new osgGA::TerrainManipulator() );
keyswitchManipulator->addMatrixManipulator( '5', "Orbit", new osgGA::OrbitManipulator() );
keyswitchManipulator->addMatrixManipulator( '6', "FirstPerson", new osgGA::FirstPersonManipulator() );
keyswitchManipulator->addMatrixManipulator( '7', "Spherical", new osgGA::SphericalManipulator() );
std::string pathfile;
double animationSpeed = 1.0;
while(arguments.read("--speed",animationSpeed) ) {}
char keyForAnimationPath = '8';
while (arguments.read("-p",pathfile))
{
osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile);
if (apm && !apm->getAnimationPath()->empty())
{
apm->setTimeScale(animationSpeed);
unsigned int num = keyswitchManipulator->getNumMatrixManipulators();
keyswitchManipulator->addMatrixManipulator( keyForAnimationPath, "Path", apm );
keyswitchManipulator->selectMatrixManipulator(num);
++keyForAnimationPath;
}
}
viewer.setCameraManipulator( keyswitchManipulator.get() );
}
// add the state manipulator
viewer.addEventHandler( new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()) );
// add the thread model handler
viewer.addEventHandler(new osgViewer::ThreadingHandler);
// add the window size toggle handler
viewer.addEventHandler(new osgViewer::WindowSizeHandler);
// add the stats handler
viewer.addEventHandler(new osgViewer::StatsHandler);
// add the help handler
viewer.addEventHandler(new osgViewer::HelpHandler(arguments.getApplicationUsage()));
// add the record camera path handler
viewer.addEventHandler(new osgViewer::RecordCameraPathHandler);
// add the LOD Scale handler
viewer.addEventHandler(new osgViewer::LODScaleHandler);
// add the screen capture handler
viewer.addEventHandler(new osgViewer::ScreenCaptureHandler);
// load the data
osg::ref_ptr<osg::Node> loadedModel = osgDB::readRefNodeFiles(arguments);
if (!loadedModel)
{
std::cout << arguments.getApplicationName() <<": No data loaded" << std::endl;
return 1;
}
// any option left unread are converted into errors to write out later.
arguments.reportRemainingOptionsAsUnrecognized();
// report any errors if they have occurred when parsing the program arguments.
if (arguments.errors())
{
arguments.writeErrorMessages(std::cout);
return 1;
}
// optimize the scene graph, remove redundant nodes and state etc.
osgUtil::Optimizer optimizer;
optimizer.optimize(loadedModel);
viewer.setSceneData(loadedModel);
viewer.realize();
return viewer.run();
}

View File

@@ -0,0 +1,25 @@
SET(TARGET_SRC
osgQtBrowser.cpp
)
IF(CMAKE_COMPILER_IS_GNUCXX)
# Remove -pedantic flag as it barfs on Qt headers
STRING(REGEX REPLACE "-pedantic" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
ENDIF()
if ( QT4_FOUND )
SET(TARGET_EXTERNAL_LIBRARIES ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTOPENGL_LIBRARY} ${QT_QTWEBKIT_LIBRARY})
INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR} ${QT_QTOPENGL_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR} ${QT_QTWEBKIT_INCLUDE_DIR} )
endif( QT4_FOUND )
SET(TARGET_ADDED_LIBRARIES osgWidget osgQt)
#### end var setup ###
SET ( EXAMPLE_NAME osgQtBrowser )
SETUP_EXAMPLE(${EXAMPLE_NAME})
IF ( Qt5Widgets_FOUND )
qt5_use_modules( example_${EXAMPLE_NAME} Widgets OpenGL WebKitWidgets )
ENDIF( Qt5Widgets_FOUND )

View File

@@ -0,0 +1,145 @@
/* OpenSceneGraph example, osgcompositeviewer.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include <iostream>
#include <osg/Notify>
#include <osg/io_utils>
#include <osg/ArgumentParser>
#include <osgDB/WriteFile>
#include <osgGA/TrackballManipulator>
#include <osgGA/StateSetManipulator>
#include <osgViewer/Viewer>
#include <osgViewer/ViewerEventHandlers>
#include <osgWidget/Browser>
#include <QtGlobal>
#if QT_VERSION >= 0x050000
# include <QtWebKitWidgets>
#else
# include <QtWebKit>
#endif
#include <QWebSettings>
#include <QGraphicsScene>
#include <QGraphicsView>
#include <QApplication>
#include <QPainter>
#include <QtEvents>
#include <osgQt/QGraphicsViewAdapter>
#include <osgQt/QWebViewImage>
// Thread that runs the viewer's frame loop as we can't run Qt in the background...
class ViewerFrameThread : public OpenThreads::Thread
{
public:
ViewerFrameThread(osgViewer::ViewerBase* viewerBase, bool doQApplicationExit):
_viewerBase(viewerBase),
_doQApplicationExit(doQApplicationExit) {}
~ViewerFrameThread()
{
if (isRunning())
{
cancel();
join();
}
}
int cancel()
{
_viewerBase->setDone(true);
return 0;
}
void run()
{
int result = _viewerBase->run();
if (_doQApplicationExit) QApplication::exit(result);
}
osg::ref_ptr<osgViewer::ViewerBase> _viewerBase;
bool _doQApplicationExit;
};
int main(int argc, char **argv)
{
// Qt requires that we construct the global QApplication before creating any widgets.
QApplication app(argc, argv);
// use an ArgumentParser object to manage the program arguments.
osg::ArgumentParser arguments(&argc,argv);
bool useFrameLoopThread = false;
if (arguments.read("--no-frame-thread")) useFrameLoopThread = false;
if (arguments.read("--frame-thread")) useFrameLoopThread = true;
osg::ref_ptr<osgQt::QWebViewImage> image = new osgQt::QWebViewImage;
if (arguments.argc()>1) image->navigateTo((arguments[1]));
else image->navigateTo("http://www.youtube.com/");
osgWidget::GeometryHints hints(osg::Vec3(0.0f,0.0f,0.0f),
osg::Vec3(1.0f,0.0f,0.0f),
osg::Vec3(0.0f,0.0f,1.0f),
osg::Vec4(1.0f,1.0f,1.0f,1.0f),
osgWidget::GeometryHints::RESIZE_HEIGHT_TO_MAINTAINCE_ASPECT_RATIO);
osg::ref_ptr<osgWidget::Browser> browser = new osgWidget::Browser;
browser->assign(image.get(), hints);
// image->focusBrowser(true);
osg::ref_ptr<osgViewer::Viewer> viewer = new osgViewer::Viewer(arguments);
viewer->setSceneData(browser.get());
viewer->setCameraManipulator(new osgGA::TrackballManipulator());
viewer->addEventHandler(new osgViewer::StatsHandler);
viewer->addEventHandler(new osgViewer::WindowSizeHandler);
if (useFrameLoopThread)
{
// create a thread to run the viewer's frame loop
ViewerFrameThread viewerThread(viewer.get(), true);
viewerThread.startThread();
// now start the standard Qt event loop, then exists when the viewerThead sends the QApplication::exit() signal.
return QApplication::exec();
}
else
{
// run the frame loop, interleaving Qt and the main OSG frame loop
while(!viewer->done())
{
// process Qt events - this handles both events and paints the browser image
QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
viewer->frame();
}
return 0;
}
}

View File

@@ -0,0 +1,23 @@
SET(TARGET_SRC
osgQtWidgets.cpp
)
IF(CMAKE_COMPILER_IS_GNUCXX)
# Remove -pedantic flag as it barfs on Qt headers
STRING(REGEX REPLACE "-pedantic" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
ENDIF()
if ( QT4_FOUND )
SET(TARGET_EXTERNAL_LIBRARIES ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTOPENGL_LIBRARY} ${QT_QTWEBKIT_LIBRARY})
INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR} ${QT_QTOPENGL_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR} ${QT_QTWEBKIT_INCLUDE_DIR} )
endif( QT4_FOUND )
SET(TARGET_ADDED_LIBRARIES osgWidget osgQt)
#### end var setup ###
SET ( EXAMPLE_NAME osgQtWidgets )
SETUP_EXAMPLE(${EXAMPLE_NAME})
IF ( Qt5Widgets_FOUND )
qt5_use_modules( example_${EXAMPLE_NAME} OpenGL WebKitWidgets )
ENDIF( Qt5Widgets_FOUND )

File diff suppressed because one or more lines are too long

View File

@@ -10,7 +10,7 @@
#include <osg/StateAttributeCallback>
#include <osg/Texture2D>
#include <osg/Geometry>
#include <osg/DispatchCompute>
#include <osg/Geode>
#include <osgDB/ReadFile>
#include <osgGA/StateSetManipulator>
#include <osgViewer/Viewer>
@@ -142,7 +142,7 @@ enum Channel
class ShaderStorageBufferCallback : public osg::StateAttributeCallback
{
public:
void operator() (osg::StateAttribute* /*attr*/, osg::NodeVisitor* /*nv*/)
void operator() (osg::StateAttribute* attr, osg::NodeVisitor* nv)
{
//if you need to process the data in your app-code , better leaving it on GPU and processing there, uploading per frame will make it slow
#if 0
@@ -167,7 +167,6 @@ class ComputeNode : public osg::PositionAttitudeTransform
public:
osg::ref_ptr<osg::DispatchCompute> _DispatchCompute;
osg::ref_ptr<osg::Program> _computeProgram;
osg::ref_ptr<osg::Shader> _computeShader; //compute and write position data in SSBO
@@ -201,12 +200,15 @@ public:
ComputeNode()
{
_computeShaderSourcePath = "shaders/osgssboComputeShader.cs";
_vertexShaderSourcePath = "shaders/osgssboVertexShader.vs";
_geometryShaderSourcePath = "shaders/osgssboGeometryShader.gs";
_fragmentShaderSourcePath = "shaders/osgssboFragmentShader.fs";
_DispatchCompute=new osg::DispatchCompute();
addChild(_DispatchCompute);
const char* envOsgFilePath = getenv("OSG_FILE_PATH");
std::stringstream computeshaderpath; computeshaderpath << envOsgFilePath << "/shaders/osgssboComputeShader.cs";
_computeShaderSourcePath = computeshaderpath.str();
std::stringstream vertexshaderpath; vertexshaderpath << envOsgFilePath << "/shaders/osgssboVertexShader.vs";
_vertexShaderSourcePath = vertexshaderpath.str();
std::stringstream geometryshaderpath; geometryshaderpath << envOsgFilePath << "/shaders/osgssboGeometryShader.gs";
_geometryShaderSourcePath = geometryshaderpath.str();
std::stringstream fragmentshaderpath; fragmentshaderpath << envOsgFilePath << "/shaders/osgssboFragmentShader.fs";
_fragmentShaderSourcePath = fragmentshaderpath.str();
}
};
@@ -241,7 +243,7 @@ public:
if (_computeNode->_computeShader.valid())
{
runningSource = _computeNode->_computeShader->getShaderSource();
reloadedshader = osgDB::readRefShaderFile(osg::Shader::COMPUTE, _computeNode->_computeShaderSourcePath);
reloadedshader = osg::Shader::readShaderFile(osg::Shader::COMPUTE, _computeNode->_computeShaderSourcePath);
reloadedstring = reloadedshader->getShaderSource();
if (!osgDB::equalCaseInsensitive(runningSource.c_str(), reloadedstring.c_str()))
@@ -256,7 +258,7 @@ public:
{
runningSource = _computeNode->_vertexShader->getShaderSource();
reloadedshader = osgDB::readRefShaderFile(osg::Shader::VERTEX, _computeNode->_vertexShaderSourcePath);
reloadedshader = osg::Shader::readShaderFile(osg::Shader::VERTEX, _computeNode->_vertexShaderSourcePath);
reloadedstring = reloadedshader->getShaderSource();
if (!osgDB::equalCaseInsensitive(runningSource.c_str(), reloadedstring.c_str()))
@@ -272,7 +274,7 @@ public:
if (_computeNode->_geometryShader.valid())
{
runningSource = _computeNode->_geometryShader->getShaderSource();
reloadedshader = osgDB::readRefShaderFile(osg::Shader::GEOMETRY, _computeNode->_geometryShaderSourcePath);
reloadedshader = osg::Shader::readShaderFile(osg::Shader::GEOMETRY, _computeNode->_geometryShaderSourcePath);
reloadedstring = reloadedshader->getShaderSource();
if (!osgDB::equalCaseInsensitive(runningSource.c_str(), reloadedstring.c_str()))
@@ -286,7 +288,7 @@ public:
if (_computeNode->_fragmentShader.valid())
{
runningSource = _computeNode->_fragmentShader->getShaderSource();
reloadedshader = osgDB::readRefShaderFile(osg::Shader::FRAGMENT, _computeNode->_fragmentShaderSourcePath);
reloadedshader = osg::Shader::readShaderFile(osg::Shader::FRAGMENT, _computeNode->_fragmentShaderSourcePath);
reloadedstring = reloadedshader->getShaderSource();
if (!osgDB::equalCaseInsensitive(runningSource.c_str(), reloadedstring.c_str()))
@@ -471,6 +473,7 @@ void ComputeNode::addDataMonitor(osg::Vec3 placement, osg::Vec3 relativePlacemen
pat->setName(labelCaption);
text->setText(pat->getName());
text->setBackdropType(osgText::Text::OUTLINE);
text->setBackdropImplementation(osgText::Text::POLYGON_OFFSET);
text->setBackdropOffset(0.05f);
text->setBackdropColor(osg::Vec4(0.0f, 0.0f, 0.0f, 1.0f));
@@ -497,9 +500,9 @@ osg::Image* createSpotLightImage(const osg::Vec4& centerColour, const osg::Vec4&
{
float dx = (float(c) - mid)*div;
float dy = (float(r) - mid)*div;
float pr = powf(1.0f - sqrtf(dx*dx + dy*dy), power);
if (pr < 0.0f) pr = 0.0f;
osg::Vec4 color = centerColour*pr + backgroudColour*(1.0f - pr);
float r = powf(1.0f - sqrtf(dx*dx + dy*dy), power);
if (r < 0.0f) r = 0.0f;
osg::Vec4 color = centerColour*r + backgroudColour*(1.0f - r);
*ptr++ = (unsigned char)((color[0])*255.0f);
*ptr++ = (unsigned char)((color[1])*255.0f);
*ptr++ = (unsigned char)((color[2])*255.0f);
@@ -515,13 +518,13 @@ void ComputeNode::addComputationResultsRenderTree()
_computationResultsRenderProgram = new osg::Program;
_vertexShader = osgDB::readRefShaderFile(osg::Shader::VERTEX, _vertexShaderSourcePath);
_vertexShader = osg::Shader::readShaderFile(osg::Shader::VERTEX, _vertexShaderSourcePath);
_computationResultsRenderProgram->addShader(_vertexShader.get());
_geometryShader = osgDB::readRefShaderFile(osg::Shader::GEOMETRY, _geometryShaderSourcePath);
_geometryShader = osg::Shader::readShaderFile(osg::Shader::GEOMETRY, _geometryShaderSourcePath);
_computationResultsRenderProgram->addShader(_geometryShader.get());
_fragmentShader = osgDB::readRefShaderFile(osg::Shader::FRAGMENT, _fragmentShaderSourcePath);
_fragmentShader = osg::Shader::readShaderFile(osg::Shader::FRAGMENT, _fragmentShaderSourcePath);
_computationResultsRenderProgram->addShader(_fragmentShader.get());
@@ -625,8 +628,8 @@ void ComputeNode::initComputingSetup()
{
_computeProgram = new osg::Program;
_DispatchCompute->setComputeGroups((NUM_ELEMENTS_X / WORK_GROUP_SIZE) <= 1 ? 1 : (NUM_ELEMENTS_X / WORK_GROUP_SIZE), (NUM_ELEMENTS_Y / WORK_GROUP_SIZE) <= 1 ? 1 : (NUM_ELEMENTS_Y / WORK_GROUP_SIZE), 1);
_computeShader = osgDB::readRefShaderFile(osg::Shader::COMPUTE, _computeShaderSourcePath);
_computeProgram->setComputeGroups((NUM_ELEMENTS_X / WORK_GROUP_SIZE) <= 1 ? 1 : (NUM_ELEMENTS_X / WORK_GROUP_SIZE), (NUM_ELEMENTS_Y / WORK_GROUP_SIZE) <= 1 ? 1 : (NUM_ELEMENTS_Y / WORK_GROUP_SIZE), 1);
_computeShader = osg::Shader::readShaderFile(osg::Shader::COMPUTE, _computeShaderSourcePath);
_computeProgram->addShader(_computeShader.get());
setDataVariance(osg::Object::DYNAMIC);
@@ -770,7 +773,7 @@ void ComputeNode::initComputingSetup()
_dataArray->setBufferObject(_ssbo.get());
_ssbb = new osg::ShaderStorageBufferBinding(0, _dataArray.get(), 0, blockSize);
_ssbb = new osg::ShaderStorageBufferBinding(0, _ssbo.get(), 0, blockSize);
statesetComputation->setAttributeAndModes(_ssbb.get(), osg::StateAttribute::ON);

View File

@@ -20,8 +20,6 @@
#include <osgViewer/Viewer>
#include <osgViewer/ViewerEventHandlers>
#include <osg/ContextData>
#include <osgDB/ReadFile>
#include <osgDB/WriteFile>
#include <osgDB/FileNameUtils>
@@ -104,9 +102,9 @@ public:
{
if (!stateset) return;
for(unsigned int ti=0; ti<stateset->getNumTextureAttributeLists(); ++ti)
for(unsigned int i=0; i<stateset->getNumTextureAttributeLists(); ++i)
{
osg::StateAttribute* sa = stateset->getTextureAttribute(ti, osg::StateAttribute::TEXTURE);
osg::StateAttribute* sa = stateset->getTextureAttribute(i, osg::StateAttribute::TEXTURE);
osg::Texture* texture = dynamic_cast<osg::Texture*>(sa);
if (texture)
{
@@ -256,7 +254,9 @@ public:
{
OSG_NOTICE<<"Reallocating Arrays"<<std::endl;
typedef std::vector< osg::ref_ptr<osg::Array> > ArrayVector;
typedef std::vector< osg::ref_ptr<osg::Geometry> > GeometryVector;
ArrayVector newArrays;
GeometryVector newGeometries;
for(GeometryMap::iterator itr = _geometryMap.begin();
itr != _geometryMap.end();
@@ -393,6 +393,8 @@ public:
while (arguments.read("--dl")) { modifyDrawableSettings = true; useDisplayLists = true; }
while (arguments.read("-s", simplificatioRatio)) {}
while (arguments.read("--tristripper")) { useTriStripVisitor=true; }
while (arguments.read("--no-tristripper")) { useTriStripVisitor=false; }
while (arguments.read("--smoother")) { useSmoothingVisitor=true; }
while (arguments.read("--no-smoother")) { useSmoothingVisitor=false; }
@@ -424,6 +426,7 @@ public:
OSG_NOTICE<<"Running simplifier with simplification ratio="<<simplificatioRatio<<std::endl;
float maxError = 4.0f;
osgUtil::Simplifier simplifier(simplificatioRatio, maxError);
simplifier.setDoTriStrip(useTriStripVisitor);
simplifier.setSmoothing(useSmoothingVisitor);
node->accept(simplifier);
}
@@ -547,7 +550,7 @@ public:
{
}
virtual void operator () (osg::Object* /*object*/)
virtual void operator () (osg::Object* object)
{
osg::notify(osg::NOTICE)<<"LoadAndCompileOperation "<<_filename<<std::endl;
@@ -591,7 +594,7 @@ public:
osg::notify(osg::NOTICE)<<"done LoadAndCompileOperation "<<_filename<<std::endl;
}
virtual bool compileCompleted(osgUtil::IncrementalCompileOperation::CompileSet* /*compileSet*/)
virtual bool compileCompleted(osgUtil::IncrementalCompileOperation::CompileSet* compileSet)
{
OSG_NOTICE<<"compileCompleted"<<std::endl;
_modelReadyToMerge = true;
@@ -609,13 +612,14 @@ public:
class TexturePoolHandler : public osgGA::GUIEventHandler
{
public:
virtual bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& /*aa*/)
virtual bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa)
{
if (ea.getEventType() == osgGA::GUIEventAdapter::KEYUP)
{
if (ea.getKey()=='r')
{
osg::getOrCreateContextData(0)->reportStats(osg::notify(osg::NOTICE));
osg::Texture::getTextureObjectManager(0)->reportStats(osg::notify(osg::NOTICE));
osg::GLBufferObjectManager::getGLBufferObjectManager(0)->reportStats(osg::notify(osg::NOTICE));
}
}
return false;
@@ -627,7 +631,8 @@ struct ReportStatsAnimationCompletedCallback : public osgGA::AnimationPathManipu
virtual void completed(const osgGA::AnimationPathManipulator*)
{
OSG_NOTICE<<"Animation completed"<<std::endl;
osg::getOrCreateContextData(0)->reportStats(osg::notify(osg::NOTICE));
osg::Texture::getTextureObjectManager(0)->reportStats(osg::notify(osg::NOTICE));
osg::GLBufferObjectManager::getGLBufferObjectManager(0)->reportStats(osg::notify(osg::NOTICE));
}
};
@@ -777,8 +782,8 @@ int main(int argc, char** argv)
modelIndex<fileNames.size() &&
(currentTime-timeOfLastMerge)>timeBetweenMerges)
{
filename = fileNames[modelIndex++];
outputFilename = outputPostfix.empty() ? std::string() : osgDB::getStrippedName(filename)+outputPostfix;
std::string filename = fileNames[modelIndex++];
std::string outputFilename = outputPostfix.empty() ? std::string() : osgDB::getStrippedName(filename)+outputPostfix;
databasePagingOperation = new DatabasePagingOperation(
filename,

View File

@@ -26,7 +26,6 @@
#include <osgDB/Registry>
#include <osgDB/ReadFile>
#include <osgDB/WriteFile>
#include <osgGA/TrackballManipulator>
#include <osgGA/FlightManipulator>
@@ -147,7 +146,7 @@ osg::Node* createMovingModel(const osg::Vec3& center, float radius)
float size = radius/bs.radius()*0.3f;
osg::MatrixTransform* positioned = new osg::MatrixTransform;
positioned->setDataVariance(osg::Object::STATIC);
positioned ->setMatrix(osg::Matrix::translate(-bs.center())*
positioned->setMatrix(osg::Matrix::translate(-bs.center())*
osg::Matrix::scale(size,size,size)*
osg::Matrix::rotate(osg::inDegrees(-90.0f),0.0f,0.0f,1.0f));
@@ -181,10 +180,6 @@ osg::Node* createMovingModel(const osg::Vec3& center, float radius)
model->addChild(xform);
}
#ifndef OSG_GLES2_AVAILABLE
model->getOrCreateStateSet()->setMode(GL_NORMALIZE, osg::StateAttribute::ON);
#endif
return model.release();
}
@@ -252,13 +247,6 @@ int main( int argc, char **argv )
osgUtil::Optimizer optimzer;
optimzer.optimize(rootnode);
std::string filename;
if (arguments.read("-o",filename))
{
osgDB::writeNodeFile(*rootnode, filename);
return 1;
}
// set the scene to render
viewer.setSceneData(rootnode);

View File

@@ -317,8 +317,7 @@ public:
}
};
int main(int, char**)
{
int main(int argc, char** argv) {
osgViewer::Viewer viewer;
osgWidget::WindowManager* wm = new osgWidget::WindowManager(

View File

@@ -28,8 +28,6 @@
#include <osgAnimation/BasicAnimationManager>
#include <osgAnimation/RigGeometry>
#include <osgAnimation/RigTransformHardware>
#include <osgAnimation/MorphGeometry>
#include <osgAnimation/MorphTransformHardware>
#include <osgAnimation/AnimationManagerBase>
#include <osgAnimation/BoneMapVisitor>
@@ -42,100 +40,89 @@ static unsigned int getRandomValueinRange(unsigned int v)
}
osg::ref_ptr<osg::Program> CommonProgram;
osg::ref_ptr<osg::Program> program;
// show how to override the default RigTransformHardware for customized usage
struct MyRigTransformHardware : public osgAnimation::RigTransformHardware
{
int _maxmatrix;
MyRigTransformHardware() : _maxmatrix(99){}
virtual bool init(osgAnimation::RigGeometry& rig)
void operator()(osgAnimation::RigGeometry& geom)
{
if(_perVertexInfluences.empty())
{
prepareData(rig);
if (_needInit)
if (!init(geom))
return;
computeMatrixPaletteUniform(geom.getMatrixFromSkeletonToGeometry(), geom.getInvMatrixFromSkeletonToGeometry());
}
bool init(osgAnimation::RigGeometry& geom)
{
osg::Vec3Array* pos = dynamic_cast<osg::Vec3Array*>(geom.getVertexArray());
if (!pos) {
osg::notify(osg::WARN) << "RigTransformHardware no vertex array in the geometry " << geom.getName() << std::endl;
return false;
}
if(!rig.getSkeleton())
if (!geom.getSkeleton()) {
osg::notify(osg::WARN) << "RigTransformHardware no skeleting set in geometry " << geom.getName() << std::endl;
return false;
}
osgAnimation::BoneMapVisitor mapVisitor;
rig.getSkeleton()->accept(mapVisitor);
osgAnimation::BoneMap boneMap = mapVisitor.getBoneMap();
geom.getSkeleton()->accept(mapVisitor);
osgAnimation::BoneMap bm = mapVisitor.getBoneMap();
if (!buildPalette(boneMap,rig) )
if (!createPalette(pos->size(),bm, geom.getVertexInfluenceSet().getVertexToBoneList()))
return false;
osg::Geometry& source = *rig.getSourceGeometry();
osg::Vec3Array* positionSrc = dynamic_cast<osg::Vec3Array*>(source.getVertexArray());
int attribIndex = 11;
int nbAttribs = getNumVertexAttrib();
if (!positionSrc)
{
OSG_WARN << "RigTransformHardware no vertex array in the geometry " << rig.getName() << std::endl;
return false;
}
// use a global program for all avatar
if (!program.valid()) {
program = new osg::Program;
program->setName("HardwareSkinning");
if (!_shader.valid())
_shader = osg::Shader::readShaderFile(osg::Shader::VERTEX,"shaders/skinning.vert");
// copy shallow from source geometry to rig
rig.copyFrom(source);
osg::ref_ptr<osg::Shader> vertexshader;
osg::ref_ptr<osg::StateSet> stateset = rig.getOrCreateStateSet();
if(!CommonProgram.valid())
{
CommonProgram = new osg::Program;
CommonProgram->setName("HardwareSkinning");
//set default source if _shader is not user set
if (!vertexshader.valid())
{
vertexshader = osgDB::readRefShaderFile(osg::Shader::VERTEX,"skinning.vert");
}
if (!vertexshader.valid())
{
OSG_WARN << "RigTransformHardware can't load VertexShader" << std::endl;
if (!_shader.valid()) {
osg::notify(osg::WARN) << "RigTransformHardware can't load VertexShader" << std::endl;
return false;
}
// replace max matrix by the value from uniform
{
std::string str = vertexshader->getShaderSource();
std::string str = _shader->getShaderSource();
std::string toreplace = std::string("MAX_MATRIX");
std::size_t start = str.find(toreplace);
if (std::string::npos != start)
{
std::stringstream ss;
ss << _maxmatrix;//getMatrixPaletteUniform()->getNumElements();
str.replace(start, toreplace.size(), ss.str());
vertexshader->setShaderSource(str);
}
else
{
OSG_WARN<< "MAX_MATRIX not found in Shader! " << str << std::endl;
}
OSG_INFO << "Shader " << str << std::endl;
std::stringstream ss;
ss << getMatrixPaletteUniform()->getNumElements();
str.replace(start, toreplace.size(), ss.str());
_shader->setShaderSource(str);
osg::notify(osg::INFO) << "Shader " << str << std::endl;
}
program->addShader(_shader.get());
for (int i = 0; i < nbAttribs; i++)
{
std::stringstream ss;
ss << "boneWeight" << i;
program->addBindAttribLocation(ss.str(), attribIndex + i);
osg::notify(osg::INFO) << "set vertex attrib " << ss.str() << std::endl;
}
CommonProgram->addShader(vertexshader.get());
}
unsigned int nbAttribs = getNumVertexAttrib();
for (unsigned int i = 0; i < nbAttribs; i++)
for (int i = 0; i < nbAttribs; i++)
{
std::stringstream ss;
ss << "boneWeight" << i;
CommonProgram->addBindAttribLocation(ss.str(), _minAttribIndex + i);
rig.setVertexAttribArray(_minAttribIndex + i, getVertexAttrib(i));
OSG_INFO << "set vertex attrib " << ss.str() << std::endl;
geom.setVertexAttribArray(attribIndex + i, getVertexAttrib(i));
}
stateset->removeUniform("nbBonesPerVertex");
stateset->addUniform(new osg::Uniform("nbBonesPerVertex",_bonesPerVertex));
stateset->removeUniform("matrixPalette");
stateset->addUniform(_uniformMatrixPalette);
stateset->setAttribute(CommonProgram.get());
osg::ref_ptr<osg::StateSet> ss = new osg::StateSet;
ss->addUniform(getMatrixPaletteUniform());
ss->addUniform(new osg::Uniform("nbBonesPerVertex", getNumBonesPerVertex()));
ss->setAttributeAndModes(program.get());
geom.setStateSet(ss.get());
_needInit = false;
return true;
}
@@ -146,7 +133,6 @@ struct MyRigTransformHardware : public osgAnimation::RigTransformHardware
struct SetupRigGeometry : public osg::NodeVisitor
{
bool _hardware;
SetupRigGeometry( bool hardware = true) : osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN), _hardware(hardware) {}
void apply(osg::Geode& geode)
@@ -156,15 +142,10 @@ struct SetupRigGeometry : public osg::NodeVisitor
}
void apply(osg::Drawable& geom)
{
if (_hardware)
{
if (_hardware) {
osgAnimation::RigGeometry* rig = dynamic_cast<osgAnimation::RigGeometry*>(&geom);
if (rig)
{
rig->setRigTransformImplementation(new MyRigTransformHardware);
osgAnimation::MorphGeometry *morph=dynamic_cast<osgAnimation::MorphGeometry*>(rig->getSourceGeometry());
if(morph)morph->setMorphTransformImplementation(new osgAnimation::MorphTransformHardware);
}
}
#if 0
@@ -188,8 +169,7 @@ osg::Group* createCharacterInstance(osg::Group* character, bool hardware)
osgAnimation::BasicAnimationManager* anim = dynamic_cast<osgAnimation::BasicAnimationManager*>(animationManager);
const osgAnimation::AnimationList& list = animationManager->getAnimationList();
int v = getRandomValueinRange(list.size());
if (list[v]->getName() == std::string("MatIpo_ipo"))
{
if (list[v]->getName() == std::string("MatIpo_ipo")) {
anim->playAnimation(list[v].get());
v = (v + 1)%list.size();
}
@@ -213,10 +193,7 @@ int main (int argc, char* argv[])
bool hardware = true;
int maxChar = 10;
while (psr.read("--software"))
{
hardware = false;
}
while (psr.read("--software")) { hardware = false; }
while (psr.read("--number", maxChar)) {}
osg::ref_ptr<osg::Node> node = osgDB::readRefNodeFiles(psr);
@@ -266,10 +243,9 @@ int main (int argc, char* argv[])
double xChar = maxChar;
double yChar = xChar * 9.0/16;
for (double i = 0.0; i < xChar; i++)
{
for (double j = 0.0; j < yChar; j++)
{
for (double i = 0.0; i < xChar; i++) {
for (double j = 0.0; j < yChar; j++) {
osg::ref_ptr<osg::Group> c = createCharacterInstance(root.get(), hardware);
osg::MatrixTransform* tr = new osg::MatrixTransform;
tr->setMatrix(osg::Matrix::translate( 2.0 * (i - xChar * .5),
@@ -281,6 +257,7 @@ int main (int argc, char* argv[])
}
std::cout << "created " << xChar * yChar << " instance" << std::endl;
return viewer.run();
}

View File

@@ -1,14 +1,14 @@
/* -*-c++-*-
/* -*-c++-*-
* Copyright (C) 2008 Cedric Pinson <mornifle@plopbyte.net>
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*
* Authors:
@@ -33,7 +33,7 @@
public:
META_Object(osgAnimation, AnimtkUpdateCallback);
AnimtkUpdateCallback()
AnimtkUpdateCallback()
{
_sampler = new osgAnimation::Vec3CubicBezierSampler;
_playing = false;
@@ -41,7 +41,6 @@
}
AnimtkUpdateCallback(const AnimtkUpdateCallback& val, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY):
osg::Object(val, copyop),
osg::Callback(val, copyop),
osg::NodeCallback(val, copyop),
_sampler(val._sampler),
_startTime(val._startTime),
@@ -53,16 +52,16 @@
/** Callback method called by the NodeVisitor when visiting a node.*/
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
{
if (nv->getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR &&
nv->getFrameStamp() &&
nv->getFrameStamp()->getFrameNumber() != _lastUpdate)
{
if (nv->getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR &&
nv->getFrameStamp() &&
nv->getFrameStamp()->getFrameNumber() != _lastUpdate)
{
_lastUpdate = nv->getFrameStamp()->getFrameNumber();
_currentTime = osg::Timer::instance()->tick();
if (_playing && _sampler.get() && _sampler->getKeyframeContainer())
if (_playing && _sampler.get() && _sampler->getKeyframeContainer())
{
osg::MatrixTransform* transform = dynamic_cast<osg::MatrixTransform*>(node);
if (transform) {
@@ -98,7 +97,7 @@ class AnimtkStateSetUpdateCallback : public osg::StateSet::Callback
public:
META_Object(osgAnimation, AnimtkStateSetUpdateCallback);
AnimtkStateSetUpdateCallback()
AnimtkStateSetUpdateCallback()
{
_sampler = new osgAnimation::Vec4LinearSampler;
_playing = false;
@@ -107,7 +106,6 @@ public:
AnimtkStateSetUpdateCallback(const AnimtkStateSetUpdateCallback& val, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY):
osg::Object(val, copyop),
osg::Callback(val, copyop),
osg::StateSet::Callback(val, copyop),
_sampler(val._sampler),
_startTime(val._startTime),
@@ -119,19 +117,19 @@ public:
/** Callback method called by the NodeVisitor when visiting a node.*/
virtual void operator()(osg::StateSet* state, osg::NodeVisitor* nv)
{
if (state &&
nv->getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR &&
nv->getFrameStamp() &&
{
if (state &&
nv->getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR &&
nv->getFrameStamp() &&
nv->getFrameStamp()->getFrameNumber() != _lastUpdate) {
_lastUpdate = nv->getFrameStamp()->getFrameNumber();
_currentTime = osg::Timer::instance()->tick();
if (_playing && _sampler.get() && _sampler->getKeyframeContainer())
if (_playing && _sampler.get() && _sampler->getKeyframeContainer())
{
osg::Material* material = dynamic_cast<osg::Material*>(state->getAttribute(osg::StateAttribute::MATERIAL));
if (material)
if (material)
{
osg::Vec4 result;
float t = osg::Timer::instance()->delta_s(_startTime, _currentTime);
@@ -157,7 +155,7 @@ public:
// This won't really give good results in any situation, but it does demonstrate
// on possible "fast" usage...
class MakePathTimeCallback: public AnimtkUpdateCallback
class MakePathTimeCallback: public AnimtkUpdateCallback
{
osg::ref_ptr<osg::Geode> _geode;
float _lastAdd;
@@ -170,11 +168,11 @@ public:
_addSeconds(0.08f) {
}
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
{
float t = osg::Timer::instance()->delta_s(_startTime, _currentTime);
if(_lastAdd + _addSeconds <= t && t <= 8.0f)
if(_lastAdd + _addSeconds <= t && t <= 8.0f)
{
osg::Vec3 pos;
@@ -192,7 +190,7 @@ public:
// This will give great results if you DO NOT have VSYNC enabled and can generate
// decent FPS.
class MakePathDistanceCallback: public AnimtkUpdateCallback
class MakePathDistanceCallback: public AnimtkUpdateCallback
{
osg::ref_ptr<osg::Geode> _geode;
osg::Vec3 _lastAdd;
@@ -205,7 +203,7 @@ public:
_threshold(0.5f),
_count(0) {}
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
{
static bool countReported = false;
@@ -217,13 +215,13 @@ public:
osg::Vec3 distance = _lastAdd - pos;
if(t <= 8.0f && distance.length() >= _threshold)
if(t <= 8.0f && distance.length() >= _threshold)
{
_geode->addDrawable(new osg::ShapeDrawable(new osg::Sphere(pos, 0.25f)));
_lastAdd = pos;
_count++;
}
else if(t > 8.0f)
else if(t > 8.0f)
{
if(!countReported) std::cout << "Created " << _count << " nodes." << std::endl;
countReported = true;
@@ -233,13 +231,13 @@ public:
}
};
osg::StateSet* setupStateSet()
osg::StateSet* setupStateSet()
{
osg::StateSet* st = new osg::StateSet();
st->setAttributeAndModes(new osg::Material(), true);
st->setMode(GL_BLEND, true);
AnimtkStateSetUpdateCallback* callback = new AnimtkStateSetUpdateCallback();
osgAnimation::Vec4KeyframeContainer* keys = callback->_sampler->getOrCreateKeyframeContainer();
keys->push_back(osgAnimation::Vec4Keyframe(0, osg::Vec4(1,0,0,1)));
@@ -250,11 +248,11 @@ osg::StateSet* setupStateSet()
keys->push_back(osgAnimation::Vec4Keyframe(10, osg::Vec4(1,0,0,1)));
callback->start();
st->setUpdateCallback(callback);
return st;
}
osg::MatrixTransform* setupAnimtkNode(osg::Geode* staticGeode)
osg::MatrixTransform* setupAnimtkNode(osg::Geode* staticGeode)
{
osg::Vec3 v[5];
@@ -302,20 +300,20 @@ osg::MatrixTransform* setupAnimtkNode(osg::Geode* staticGeode)
node->setUpdateCallback(callback);
osg::Geode* geode = new osg::Geode();
geode->setStateSet(setupStateSet());
geode->addDrawable(new osg::ShapeDrawable(new osg::Sphere(osg::Vec3(0.0f, 0.0f, 0.0f), 2)));
node->addChild(geode);
return node;
}
int main(int argc, char** argv)
int main(int argc, char** argv)
{
osg::ArgumentParser arguments(&argc, argv);
osgViewer::Viewer viewer(arguments);
osgGA::TrackballManipulator* tbm = new osgGA::TrackballManipulator();
viewer.setCameraManipulator(tbm);

View File

@@ -107,9 +107,7 @@ int main (int argc, char* argv[])
osg::Geode* geode = new osg::Geode;
geode->addDrawable(morph);
osgAnimation::UpdateMorph* morphupdate=new osgAnimation::UpdateMorph("MorphNodeCallback");
morphupdate->addTarget("MorphNodeCallback");
geode->addUpdateCallback(morphupdate);
geode->addUpdateCallback(new osgAnimation::UpdateMorph("MorphNodeCallback"));
scene->addChild(geode);
viewer.addEventHandler(new osgViewer::StatsHandler());

View File

@@ -35,7 +35,6 @@ public:
}
AnimtkUpdateCallback(const AnimtkUpdateCallback& val, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY):
osg::Object(val, copyop),
osg::Callback(val, copyop),
osg::NodeCallback(val, copyop),
_sampler(val._sampler),
_startTime(val._startTime),
@@ -99,7 +98,6 @@ public:
AnimtkStateSetUpdateCallback(const AnimtkStateSetUpdateCallback& val, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY):
osg::Object(val, copyop),
osg::Callback(val, copyop),
osg::StateSet::Callback(val, copyop),
_sampler(val._sampler),
_startTime(val._startTime),

View File

@@ -134,10 +134,13 @@ void initVertexMap(osgAnimation::Bone* b0,
osgAnimation::RigGeometry* geom,
osg::Vec3Array* array)
{
osgAnimation::VertexInfluenceSet vertexesInfluences;
osgAnimation::VertexInfluenceMap* vim = new osgAnimation::VertexInfluenceMap;
(*vim)[b0->getName()].setName(b0->getName());
(*vim)[b1->getName()].setName(b1->getName());
(*vim)[b2->getName()].setName(b2->getName());
for (int i = 0; i < (int)array->size(); i++)
{
float val = (*array)[i][0];

View File

@@ -38,7 +38,7 @@
struct NoseBegin : public osgAnimation::Action::Callback
{
virtual void operator()(osgAnimation::Action* action, osgAnimation::ActionVisitor* /*nv*/)
virtual void operator()(osgAnimation::Action* action, osgAnimation::ActionVisitor* nv)
{
std::cout << "sacrebleu, it scratches my nose, let me scratch it" << std::endl;
std::cout << "process NoseBegin call back " << action->getName() << std::endl << std::endl;
@@ -47,7 +47,7 @@ struct NoseBegin : public osgAnimation::Action::Callback
struct NoseEnd : public osgAnimation::Action::Callback
{
virtual void operator()(osgAnimation::Action* action, osgAnimation::ActionVisitor* /*nv*/)
virtual void operator()(osgAnimation::Action* action, osgAnimation::ActionVisitor* nv)
{
std::cout << "shhhrt shrrrrt shhhhhhrrrrt, haaa it's better"<< std::endl;
std::cout << "process NoseEnd call back " << action->getName() << std::endl << std::endl;
@@ -129,7 +129,7 @@ struct ExampleTimelineUsage : public osgGA::GUIEventHandler
if (_releaseKey) // we hit a key and release it execute an action
{
osgAnimation::Timeline* tml = _manager->getTimeline();
// don't play if already playing
// dont play if already playing
if (!tml->isActive(_scratchNose.get()))
{
// add this animation on top of two other

View File

@@ -1,14 +1,14 @@
/* -*-c++-*-
/* -*-c++-*-
* Copyright (C) 2008 Cedric Pinson <mornifle@plopbyte.net>
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*
* Authors:
@@ -24,18 +24,18 @@
#include <osgDB/ReadFile>
#include <osgAnimation/BasicAnimationManager>
class AnimtkViewerModelController
class AnimtkViewerModelController
{
public:
typedef std::vector<std::string> AnimationMapVector;
static AnimtkViewerModelController& instance()
static AnimtkViewerModelController& instance()
{
static AnimtkViewerModelController avmc;
return avmc;
}
static bool setModel(osgAnimation::BasicAnimationManager* model)
static bool setModel(osgAnimation::BasicAnimationManager* model)
{
AnimtkViewerModelController& self = instance();
self._model = model;
@@ -48,7 +48,7 @@ public:
return true;
}
bool list()
bool list()
{
std::cout << "Animation List:" << std::endl;
for(osgAnimation::AnimationMap::iterator it = _map.begin(); it != _map.end(); it++)
@@ -56,9 +56,9 @@ public:
return true;
}
bool play()
bool play()
{
if(_focus < _amv.size())
if(_focus < _amv.size())
{
std::cout << "Play " << _amv[_focus] << std::endl;
_model->playAnimation(_map[_amv[_focus]].get());
@@ -68,44 +68,44 @@ public:
return false;
}
bool stop()
bool stop()
{
if(_focus < _amv.size())
if(_focus < _amv.size())
{
std::cout << "Stop " << _amv[_focus] << std::endl;
_model->stopAnimation(_map[_amv[_focus]].get());
return true;
}
return false;
}
}
bool next()
bool next()
{
_focus = (_focus + 1) % _map.size();
std::cout << "Current now is " << _amv[_focus] << std::endl;
return true;
}
bool previous()
bool previous()
{
_focus = (_map.size() + _focus - 1) % _map.size();
std::cout << "Current now is " << _amv[_focus] << std::endl;
return true;
}
bool playByName(const std::string& name)
bool playByName(const std::string& name)
{
for(unsigned int i = 0; i < _amv.size(); i++) if(_amv[i] == name) _focus = i;
_model->playAnimation(_map[name].get());
return true;
}
const std::string& getCurrentAnimationName() const
const std::string& getCurrentAnimationName() const
{
return _amv[_focus];
}
const AnimationMapVector& getAnimationMap() const
const AnimationMapVector& getAnimationMap() const
{
return _amv;
}

View File

@@ -1,4 +1,4 @@
/* -*-c++-*-
/* -*-c++-*-
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
@@ -31,7 +31,7 @@ class AnimtkViewerGUI: public osgWidget::WindowManager {
protected:
osgWidget::Widget* _createButton(const std::string&);
bool _buttonPush(osgWidget::Event&);
bool _listMouseHover(osgWidget::Event&);

View File

@@ -1,14 +1,14 @@
/* -*-c++-*-
/* -*-c++-*-
* Copyright (C) 2008 Cedric Pinson <mornifle@plopbyte.net>
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*
* Authors:
@@ -26,7 +26,7 @@
const std::string IMAGE_PATH = "osgWidget/";
template <class T>
struct Sampler: public osg::DrawableUpdateCallback
struct Sampler: public osg::Drawable::UpdateCallback
{
T _motion;
Sampler() {
@@ -35,28 +35,28 @@ struct Sampler: public osg::DrawableUpdateCallback
typedef Sampler<osgAnimation::OutQuadMotion> WidgetSampler;
struct ButtonFunctor: public WidgetSampler
struct ButtonFunctor: public WidgetSampler
{
float _direction;
float _previous;
const float _speed;
ButtonFunctor(): _speed(5) { _direction = -_speed; _previous = 0;}
bool enter(osgWidget::Event&)
{
_direction = _speed;
_direction = _speed;
return true;
}
bool leave(osgWidget::Event&)
{
_direction = -_speed;
_direction = -_speed;
return true;
}
void update(osg::NodeVisitor* nv , osg::Drawable* geom)
void update(osg::NodeVisitor* nv , osg::Drawable* geom)
{
const osg::FrameStamp* f = nv->getFrameStamp();
float dt = f->getSimulationTime() - _previous;
@@ -67,7 +67,7 @@ struct ButtonFunctor: public WidgetSampler
void update(float t, osgWidget::Widget* w)
{
if (!w) return;
_motion.update(t*_direction);
_motion.update(t*_direction);
float val = _motion.getValue()*0.5;
val += 0.5;
if (val >= 1.0)
@@ -76,7 +76,7 @@ struct ButtonFunctor: public WidgetSampler
}
};
struct LabelFunctor: public WidgetSampler
struct LabelFunctor: public WidgetSampler
{
float _previous;
bool _active;
@@ -86,7 +86,7 @@ struct LabelFunctor: public WidgetSampler
osgAnimation::OutCubicMotion _scaleSampler;
LabelFunctor():
_fadeOutTime(1.5f)
_fadeOutTime(1.5f)
{
_previous = 0.0f;
_active = false;
@@ -94,7 +94,7 @@ struct LabelFunctor: public WidgetSampler
_scaleSampler = osgAnimation::OutCubicMotion(0.5, 1.0, 1.0);
}
void setActive(bool active)
void setActive(bool active)
{
_active = active;
@@ -103,7 +103,7 @@ struct LabelFunctor: public WidgetSampler
_scaleSampler.reset();
}
void update(osg::NodeVisitor* nv , osg::Drawable* geom)
void update(osg::NodeVisitor* nv , osg::Drawable* geom)
{
const osg::FrameStamp* f = nv->getFrameStamp();
@@ -118,7 +118,7 @@ struct LabelFunctor: public WidgetSampler
updateScale(dt, dynamic_cast<osgWidget::Label*>(geom));
}
void update(float t, osgWidget::Label* w)
void update(float t, osgWidget::Label* w)
{
if(!w) return;
@@ -134,7 +134,7 @@ struct LabelFunctor: public WidgetSampler
w->setFontColor(osg::Vec4(0.0f, 0.0f, 0.0f, (1.0f - val) * 0.7f));
}
void updateScale(float t, osgWidget::Label* w)
void updateScale(float t, osgWidget::Label* w)
{
_scaleSampler.update(t);
float val = _scaleSampler.getValue();
@@ -146,14 +146,14 @@ struct LabelFunctor: public WidgetSampler
};
struct ListFunctor: public osg::NodeCallback
struct ListFunctor: public osg::NodeCallback
{
float _previous;
int _direction;
osgAnimation::InQuadMotion _transformSampler;
ListFunctor()
ListFunctor()
{
_direction = 1;
_previous = 0;
@@ -161,14 +161,14 @@ struct ListFunctor: public osg::NodeCallback
_transformSampler.update(1.0f);
}
void toggleShown()
void toggleShown()
{
if(_direction == 1) _direction = -1;
else _direction = 1;
}
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
{
const osg::FrameStamp* f = nv->getFrameStamp();
@@ -195,13 +195,13 @@ struct ListFunctor: public osg::NodeCallback
};
// This is a temporary hack to "prevent" dragging on Widgets and Windows.
bool eatDrag(osgWidget::Event&)
bool eatDrag(osgWidget::Event&)
{
return true;
}
AnimtkViewerGUI::AnimtkViewerGUI(osgViewer::View* view, float w, float h, unsigned int mask):
osgWidget::WindowManager(view, w, h, mask, 0)
osgWidget::WindowManager(view, w, h, mask, 0)
{
_createButtonBox();
_createLabelBox();
@@ -226,10 +226,10 @@ AnimtkViewerGUI::AnimtkViewerGUI(osgViewer::View* view, float w, float h, unsign
_buttonBox->resizeAdd(0.0f, 10.0f);
}
osgWidget::Widget* AnimtkViewerGUI::_createButton(const std::string& name)
osgWidget::Widget* AnimtkViewerGUI::_createButton(const std::string& name)
{
osgWidget::Widget* b = new osgWidget::Widget(name, 64.0f, 64.0f);
if(!b) return 0;
b->setImage(IMAGE_PATH + name + ".png", true);
@@ -237,7 +237,7 @@ osgWidget::Widget* AnimtkViewerGUI::_createButton(const std::string& name)
ButtonFunctor* bt = new ButtonFunctor();
b->setUpdateCallback(bt);
b->addCallback(new osgWidget::Callback(&ButtonFunctor::enter, bt, osgWidget::EVENT_MOUSE_ENTER));
b->addCallback(new osgWidget::Callback(&ButtonFunctor::leave, bt, osgWidget::EVENT_MOUSE_LEAVE));
b->addCallback(new osgWidget::Callback(&AnimtkViewerGUI::_buttonPush, this, osgWidget::EVENT_MOUSE_PUSH));
@@ -246,7 +246,7 @@ osgWidget::Widget* AnimtkViewerGUI::_createButton(const std::string& name)
return b;
}
bool AnimtkViewerGUI::_listMouseHover(osgWidget::Event& ev)
bool AnimtkViewerGUI::_listMouseHover(osgWidget::Event& ev)
{
osgWidget::Label* l = dynamic_cast<osgWidget::Label*>(ev.getWidget());
@@ -259,13 +259,13 @@ bool AnimtkViewerGUI::_listMouseHover(osgWidget::Event& ev)
else if(ev.type == osgWidget::EVENT_MOUSE_PUSH) {
AnimtkViewerModelController::instance().playByName(ev.getWidget()->getName());
}
else return false;
return true;
}
bool AnimtkViewerGUI::_buttonPush(osgWidget::Event& ev)
bool AnimtkViewerGUI::_buttonPush(osgWidget::Event& ev)
{
if(!ev.getWidget()) return false;
@@ -285,7 +285,7 @@ bool AnimtkViewerGUI::_buttonPush(osgWidget::Event& ev)
else if(name == "stop") mc.stop();
else if(name == "next")
else if(name == "next")
{
mc.next();
@@ -293,21 +293,21 @@ bool AnimtkViewerGUI::_buttonPush(osgWidget::Event& ev)
l->setLabel(mc.getCurrentAnimationName());
lf->setActive(true);
}
else if(name == "back")
else if(name == "back")
{
mc.previous();
l->setFontColor(osg::Vec4(0.0f, 0.0f, 0.0f, 0.7f));
l->setLabel(mc.getCurrentAnimationName());
lf->setActive(true);
}
else if(name == "pause")
else if(name == "pause")
{
}
else if(name == "open")
else if(name == "open")
{
ListFunctor* lsf = dynamic_cast<ListFunctor*>(_listBox->getUpdateCallback());
@@ -321,7 +321,7 @@ bool AnimtkViewerGUI::_buttonPush(osgWidget::Event& ev)
return true;
}
void AnimtkViewerGUI::_createButtonBox()
void AnimtkViewerGUI::_createButtonBox()
{
_buttonBox = new osgWidget::Box("buttonBox", osgWidget::Box::HORIZONTAL);
@@ -345,12 +345,12 @@ void AnimtkViewerGUI::_createButtonBox()
_buttonBox->addWidget(open);
_buttonBox->addWidget(osg::clone(space, "space1", osg::CopyOp::DEEP_COPY_ALL));
_buttonBox->getBackground()->setColor(0.0f, 0.0f, 0.0f, 0.7f);
_buttonBox->setEventMask(osgWidget::EVENT_MASK_MOUSE_DRAG);
_buttonBox->addCallback(new osgWidget::Callback(&eatDrag, osgWidget::EVENT_MOUSE_DRAG));
}
void AnimtkViewerGUI::_createListBox()
void AnimtkViewerGUI::_createListBox()
{
_listBox = new osgWidget::Box("listBox", osgWidget::Box::VERTICAL);
@@ -362,7 +362,7 @@ void AnimtkViewerGUI::_createListBox()
AnimtkViewerModelController::AnimationMapVector::const_iterator i = amv.begin();
i != amv.end();
i++
)
)
{
osgWidget::Label* label = new osgWidget::Label(*i);
@@ -387,12 +387,12 @@ void AnimtkViewerGUI::_createListBox()
_listBox->getBackground()->setColor(0.0f, 0.0f, 0.0f, 0.7f);
}
void AnimtkViewerGUI::_createLabelBox()
void AnimtkViewerGUI::_createLabelBox()
{
_labelBox = new osgWidget::Box("labelBox", osgWidget::Box::VERTICAL);
osgWidget::Label* label = new osgWidget::Label("label");
label->setFont("fonts/Vera.ttf");
label->setFontSize(50);
label->setFontColor(0.0f, 0.0f, 0.0f, 0.7f);

View File

@@ -1,4 +1,4 @@
/* -*-c++-*-
/* -*-c++-*-
* Copyright (C) 2008 Cedric Pinson <mornifle@plopbyte.net>
*
* This program is free software; you can redistribute it and/or modify
@@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Authors:
*
*
* Cedric Pinson <mornifle@plopbyte.net>
*
*/
@@ -32,7 +32,7 @@ AnimtkKeyEventHandler::AnimtkKeyEventHandler()
_actionKeys[Prev] = '[';
}
void AnimtkKeyEventHandler::printUsage() const
void AnimtkKeyEventHandler::printUsage() const
{
std::cout << (char) _actionKeys.find(Help)->second << " for Help" << std::endl;
std::cout << (char) _actionKeys.find(List)->second << " for List" << std::endl;
@@ -46,13 +46,13 @@ bool AnimtkKeyEventHandler::handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIA
osg::Object*, osg::NodeVisitor*)
{
AnimtkViewerModelController& mc = AnimtkViewerModelController::instance();
if(ea.getEventType() == osgGA::GUIEventAdapter::KEYDOWN)
if(ea.getEventType() == osgGA::GUIEventAdapter::KEYDOWN)
{
if (ea.getKey() == _actionKeys[List]) return mc.list();
else if (ea.getKey() == _actionKeys[Play]) return mc.play();
else if (ea.getKey() == _actionKeys[Next]) return mc.next();
else if (ea.getKey() == _actionKeys[Prev]) return mc.previous();
else if (ea.getKey() == _actionKeys[Help])
else if (ea.getKey() == _actionKeys[Help])
{
printUsage();
return true;

View File

@@ -108,10 +108,10 @@ class ResetAtomicCounter : public osg::StateAttributeCallback
osg::AtomicCounterBufferBinding * acbb = dynamic_cast<osg::AtomicCounterBufferBinding *>(sa);
if (acbb)
{
osg::BufferData * acbd = acbb->getBufferData();
if (acbd)
osg::AtomicCounterBufferObject * acbo = dynamic_cast<osg::AtomicCounterBufferObject*>(acbb->getBufferObject());
if (acbo && acbo->getBufferData(0))
{
acbd->dirty();
acbo->getBufferData(0)->dirty();
}
}
}
@@ -207,10 +207,10 @@ int main(int argc, char** argv)
acboBlue->setUsage(GL_STREAM_COPY);
atomicCounterArrayBlue->setBufferObject(acboBlue.get());
osg::ref_ptr<osg::AtomicCounterBufferBinding> acbbRedAndGreen = new osg::AtomicCounterBufferBinding(0, atomicCounterArrayRedAndGreen.get(), 0, sizeof(GLuint)*3);
osg::ref_ptr<osg::AtomicCounterBufferBinding> acbbRedAndGreen = new osg::AtomicCounterBufferBinding(0, acboRedAndGreen.get(), 0, sizeof(GLuint)*3);
ss->setAttributeAndModes(acbbRedAndGreen.get());
osg::ref_ptr<osg::AtomicCounterBufferBinding> acbbBlue = new osg::AtomicCounterBufferBinding(2, atomicCounterArrayBlue.get(), 0, sizeof(GLuint));
osg::ref_ptr<osg::AtomicCounterBufferBinding> acbbBlue = new osg::AtomicCounterBufferBinding(2, acboBlue.get(), 0, sizeof(GLuint));
ss->setAttributeAndModes(acbbBlue.get());
acbbRedAndGreen->setUpdateCallback(new ResetAtomicCounter);

View File

@@ -245,12 +245,10 @@ int main( int argc, char **argv )
traits->depth = src_traits->depth;
traits->pbuffer = true;
} else {
//viewer would use fullscreen size (unknown here) pbuffer will use 4096 x4096 (or best available)
//viewer would use fullscreen size (unknown here) pbuffer will use 4096 x4096 (or best avaiable)
traits->width = 1 << 12;
traits->height = 1 << 12;
traits->pbuffer = true;
traits->readDISPLAY();
traits->setUndefinedScreenDetailsToDefaultScreen();
}
osg::ref_ptr<osg::GraphicsContext> pbuffer = osg::GraphicsContext::createGraphicsContext(traits.get());
if (pbuffer.valid())

View File

@@ -18,9 +18,7 @@
#include <osgUtil/Optimizer>
#include <osgDB/ReadFile>
#include <osgGA/TrackballManipulator>
#include <osgViewer/ViewerEventHandlers>
#include <osgViewer/CompositeViewer>
#include <osgViewer/Viewer>
#include <osg/Material>
#include <osg/Geode>
@@ -195,133 +193,13 @@ osg::Node* createScene()
return root;
}
osgViewer::View* createView(osg::ref_ptr<osg::Node> scenegraph, osg::ref_ptr<osg::GraphicsContext> gc, unsigned int x, unsigned int y, unsigned int width, unsigned int height)
int main(int, char**)
{
OSG_NOTICE<<"createView(....,x="<<x<<", y="<<y<<", width="<<width<<", height="<<height<<")"<<std::endl;
if (!gc)
{
osg::ref_ptr<osg::GraphicsContext::Traits> traits = new osg::GraphicsContext::Traits;
traits->x = x;
traits->y = y;
traits->width = width;
traits->height = height;
traits->windowDecoration = true;
traits->doubleBuffer = true;
traits->sharedContext = 0;
traits->readDISPLAY();
traits->setUndefinedScreenDetailsToDefaultScreen();
gc = osg::GraphicsContext::createGraphicsContext(traits.get());
if (!gc)
{
osg::notify(osg::NOTICE)<<" GraphicsWindow has not been created successfully."<<std::endl;
return 0;
}
x = 0;
y = 0;
}
osgViewer::View* view = new osgViewer::View;
view->getCamera()->setGraphicsContext(gc.get());
view->getCamera()->setViewport(new osg::Viewport(x, y, width, height));
//view->getCamera()->setProjectionMatrixAsPerspective(30.0, double(width) / double(height), 1.0, 1000.0);
view->setCameraManipulator(new osgGA::TrackballManipulator);
view->setSceneData(scenegraph);
return view;
}
int main(int argc, char** argv)
{
osg::ArgumentParser arguments(&argc, argv);
// construct the viewer.
osgViewer::CompositeViewer viewer(arguments);
osgViewer::Viewer viewer;
// create the scene graph that contains osg::AutoTransform nodes, see about for implementation details
osg::ref_ptr<osg::Node> scenegraph = createScene();
unsigned int numViews = 1;
while (arguments.read("-n",numViews)) {}
bool windows = false;
while (arguments.read("-w")) { windows = true; }
if (numViews<=1)
{
osgViewer::View* view = new osgViewer::View;
view->setUpViewAcrossAllScreens();
view->setSceneData(scenegraph.get());
view->setCameraManipulator(new osgGA::TrackballManipulator);
view->addEventHandler( new osgViewer::StatsHandler );
viewer.addView(view);
}
else
{
osg::GraphicsContext::WindowingSystemInterface* wsi = osg::GraphicsContext::getWindowingSystemInterface();
if (!wsi)
{
osg::notify(osg::NOTICE)<<"Error, no WindowSystemInterface available, cannot create windows."<<std::endl;
return 1;
}
unsigned int width, height;
osg::GraphicsContext::ScreenIdentifier main_screen_id;
main_screen_id.readDISPLAY();
main_screen_id.setUndefinedScreenDetailsToDefaultScreen();
wsi->getScreenResolution(main_screen_id, width, height);
unsigned int x=0, y=0;
while(arguments.read("--window", x, y, width, height)) {}
osg::ref_ptr<osg::GraphicsContext> gc;
if (!windows)
{
osg::ref_ptr<osg::GraphicsContext::Traits> traits = new osg::GraphicsContext::Traits;
traits->x = x;
traits->y = y;
traits->width = width;
traits->height = height;
traits->windowDecoration = true;
traits->doubleBuffer = true;
traits->sharedContext = 0;
traits->readDISPLAY();
traits->setUndefinedScreenDetailsToDefaultScreen();
gc = osg::GraphicsContext::createGraphicsContext(traits.get());
if (!gc)
{
osg::notify(osg::NOTICE)<<" GraphicsWindow has not been created successfully."<<std::endl;
return 1;
}
}
if (numViews==2)
{
viewer.addView(createView(scenegraph, gc, 0, 0, width/2, height));
viewer.addView(createView(scenegraph, gc, width/2, 0, width/2, height));
}
else if (numViews==3)
{
viewer.addView(createView(scenegraph, gc, 0, 0, width/2, height/2));
viewer.addView(createView(scenegraph, gc, width/2, 0, width/2, height/2));
viewer.addView(createView(scenegraph, gc, 0, height/2, width, height/2));
}
else
{
viewer.addView(createView(scenegraph, gc, 0, 0, width/2, height/2));
viewer.addView(createView(scenegraph, gc, width/2, 0, width/2, height/2));
viewer.addView(createView(scenegraph, gc, 0, height/2, width/2, height/2));
viewer.addView(createView(scenegraph, gc, width/2, height/2, width/2, height/2));
}
viewer.getView(0)->addEventHandler( new osgViewer::StatsHandler );
}
// set the scene to render
viewer.setSceneData(createScene());
// run the viewers frame loop
return viewer.run();

View File

@@ -1,2 +0,0 @@
SET(TARGET_SRC osgbindlesstext.cpp )
SETUP_EXAMPLE(osgbindlesstext)

View File

@@ -1,599 +0,0 @@
/* OpenSceneGraph example, osgbindlesstex.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
///\author David A Heitbrink
/// This is an example implementation of the use of bindless textures.
/// "bindless" textures are relatively simple concept, basically
/// you get a texture handle, then ask the driver to keep said
/// handle resident.
///
/// Once the texture has been made resident, we need to upload
/// the handle (a 64 bit unsigned int) to the shader. This can
/// be done in a number of ways, through attributes, uniform
/// buffer objects, shader buffer objects or just plain uniforms.
///
/// The basic point of the bindless texture is to remove the need
/// to bind a new texture every time we want to render something
/// with a different texture. Generally speaking in broad terms
/// driver overhead tends to be a huge bottle neck on modern
/// hardware (as of late 2016). By using bindless textures
/// we can remove a lot of calls to the driver to switch active
/// textures while rendering. What this also allows us to do
/// is to consolidate more objects + draw states as we do
/// not need to change textures, this save us a lot of calls to
/// the driver.
///
/// This example combines instancing with bindless textures
/// to draw 1000 cubes, each with a unique texture. This is
/// a pretty simplified example, where each instance ID is
/// used as a index into the array of textures.
///
/// One of the powerful things about bindless textures is it allows
/// many more objects to be combined into a single drawable.
/// However to do this you may need to add an attribute to
/// use an index into the array of texture handles, and not
/// just use the instance ID like in this example.
#include <osg/Depth>
#include <osg/Geode>
#include <osg/Geometry>
#include <osg/Material>
#include <osg/Math>
#include <osg/MatrixTransform>
#include <osg/PolygonOffset>
#include <osg/Projection>
#include <osg/ShapeDrawable>
#include <osg/StateSet>
#include <osg/Switch>
#include <osg/Texture2D>
#include <osg/TextureBuffer>
#include <osg/Image>
#include <osg/TexEnv>
#include <osg/VertexProgram>
#include <osg/FragmentProgram>
#include <osg/GLExtensions>
#include <osg/ContextData>
#include <osg/TextureBuffer>
#include <osg/BufferIndexBinding>
#include <osgDB/ReadFile>
#include <osgDB/FileUtils>
#include <osgText/Text>
#include <osgViewer/Viewer>
#include <osgViewer/ViewerEventHandlers>
#include <osgGA/StateSetManipulator>
#include <iostream>
#include <sstream>
//Hard coded constant for number unique textures
const int TextureCount = 1000;
// To use bindless textures, we need to tell the GPU to
// enable the use of 64 bit integers and bindless textures
//
//
// At this time (late 2016) NVidia drivers seem to dislike
// the ARB, GL_ARB_bindless_texture, if you do not have a
// NVidia driver, you will most likely have to change:
// GL_NV_gpu_shader5
// to:
// GL_ARB_gpu_shader5
//the XXX is so we can replace it with a string from TextureCount
std::string vertShader=
"#version 450 compatibility \n"
"#extension GL_ARB_bindless_texture : require \n"
"#extension GL_NV_gpu_shader5 : require // uint64_t \n"
"//#extension GL_ARB_gpu_shader5 : require // uint64_t \n"
"//#extension GL_ARB_gpu_shader_int64: require // uint64_t \n"
"in float osg_FrameTime; \n"
"out vec2 TexCoord; \n"
"flat out int textureIndex; \n"
"void main() { \n"
" mat4 scale =mat4(0.01, 0.00, 0.00, 0.00, \n"
" 0.00, 0.01, 0.00, 0.00, \n"
" 0.00, 0.00, 0.01, 0.00, \n"
" 0.00, 0.00, 0.00, 1.00); \n"
" vec4 pos = gl_Vertex*scale; \n"
" pos.x += ((gl_InstanceID%100)/10)*0.015-0.075; \n"
" pos.y += (gl_InstanceID/100)*0.015 - 0.075; \n"
" pos.z += (gl_InstanceID%10)*0.015 - 0.075; \n"
" pos.w = 1; \n"
" gl_Position = gl_ModelViewProjectionMatrix*pos; \n"
" TexCoord = gl_MultiTexCoord0.xy; \n"
" textureIndex = gl_InstanceID%XXX; \n"
"} \n"
;
//we could setup tex to be of type sampler2D, and not have to do
//the type conversion, but I wanted to added code to test if tex
//had a value set.
//If we get a red cube, we are not getting our handle from our UBO,
//if we get a black cube, then we are having an issue with the
//texture handle itself
std::string fragShader =
"#version 450 compatibility \n"
"#extension GL_ARB_bindless_texture : require \n"
"#extension GL_NV_gpu_shader5 : require // uint64_t \n"
"//#extension GL_ARB_gpu_shader5 : require // uint64_t \n"
"//#extension GL_ARB_gpu_shader_int64: require // uint64_t \n"
"uniform sampler2D TextureId; \n"
"in vec2 TexCoord; \n"
"flat in int textureIndex; \n"
"layout (binding = 0, std140) uniform TEXTURE_BLOCK \n"
"{ \n"
" uint64_t tex[XXX]; \n"
"}; \n"
"void main() { \n"
" int tIndex = (int)(textureIndex); \n"
" sampler2D myText = sampler2D(tex[tIndex]); \n"
" gl_FragColor = texture2D(myText,TexCoord); \n"
" if (tex[tIndex] == 0) gl_FragColor.r = 1.0; \n"
"} \n"
;
///This class provides a basic wraper for a Uniform Buffer Object
///or UBO, and provides the storage for the texture handles
class BindlessBuffer: public osg::Referenced{
public:
typedef osg::ref_ptr<osg::UniformBufferObject> UniBufferObjRef;
typedef osg::ref_ptr<osg::UniformBufferBinding> UniBufferBindingRef;
typedef osg::ref_ptr<osg::UInt64Array> HandleArrayRef;
typedef osg::ref_ptr<BindlessBuffer> BindlessBufferRef;
static BindlessBufferRef Make(size_t count){
BindlessBufferRef val = new BindlessBuffer();
val->_count = count;
val->_sbbo = new osg::UniformBufferObject;
val->_handles = new osg::UInt64Array();
val->_handles->resize(count*2,0);
val->_handles->setBufferObject(val->_sbbo.get());
val->_ssbb = new osg::UniformBufferBinding(0, val->_handles.get(), 0, sizeof(GLuint64)*count);
return val;
}
BindlessBuffer& operator = (const BindlessBuffer& rhs){
if (this != &rhs){
_count=rhs._count;
_sbbo =rhs._sbbo ;
_ssbb =rhs._ssbb ;
_handles = rhs._handles;
}
return *this;
}
BindlessBuffer(const BindlessBuffer& rhs):osg::Referenced(rhs){
if (this != &rhs){
_count=rhs._count;
_sbbo =rhs._sbbo ;
_ssbb =rhs._ssbb ;
_handles = rhs._handles;
}
}
UniBufferObjRef& Object(){return _sbbo;}
UniBufferBindingRef& Binding(){return _ssbb;}
HandleArrayRef& Handles(){return _handles;}
int count(){return _count;}
private:
int _count;
UniBufferObjRef _sbbo;
UniBufferBindingRef _ssbb;
HandleArrayRef _handles;
BindlessBuffer():osg::Referenced(),_count(0){
}
};
///This class extends a Texture, when this is texture is applied
///the first time, it will setup all our texture handles, after that
///it will not make any more GL calls until it gets released
class BindlessTexture: public osg::Texture2D
{
public:
typedef osg::ref_ptr<BindlessBuffer> BufferRef;
typedef std::vector<osg::ref_ptr<osg::Image> > TextureList;
typedef std::vector<GLuint64> HandleList;
typedef osg::ref_ptr< osg::Texture::TextureObject> TextureObjectRef;
typedef std::vector<TextureObjectRef> TextureObjectList;
typedef osg::buffered_object<TextureObjectList> TextureObjectBuffer;
BindlessTexture();
BindlessTexture(BufferRef, TextureList);
BindlessTexture(const BindlessTexture& rhs, const osg::CopyOp& copy =osg::CopyOp::SHALLOW_COPY);
void releaseGLObjects(osg::State* state) const;
void resizeGLObjectBuffers(unsigned maxSize);
void setBidlessIndex(unsigned int index);
META_StateAttribute(osg, BindlessTexture, TEXTURE);
void apply(osg::State& state) const;
protected:
void applyOnce(osg::State &state) const;
mutable osg::buffered_object<HandleList> _handles;
mutable TextureList _textureList;
mutable osg::ref_ptr<BindlessBuffer> _buffer;
mutable std::vector<bool> _isBound;
mutable TextureObjectBuffer _textureBufferList;
// array index = texture image unit.
unsigned int _bindlessIndex;
};
BindlessTexture::BindlessTexture():osg::Texture2D(),_bindlessIndex(0)
{
_isBound.resize(5,false);
}
BindlessTexture::BindlessTexture(const BindlessTexture& rhs, const osg::CopyOp& copy) :
osg::Texture2D( rhs, copy )
{
_isBound.resize(5,false);
_buffer = rhs._buffer;
_bindlessIndex = rhs._bindlessIndex;
for(unsigned i=0; i<rhs._handles.size(); ++i)
_handles[i] = rhs._handles[i];
}
BindlessTexture::BindlessTexture(BufferRef ref,TextureList textureList) :
osg::Texture2D( textureList[0] ),
_textureList(textureList),
_buffer(ref),
_bindlessIndex(0)
{
_isBound.resize(5,false);
}
void BindlessTexture::setBidlessIndex(unsigned int index){
_bindlessIndex = index;
}
/// Just as the name suggest this should be called once per
/// context, during its lifetime. This basically
/// just sets up our texture handles, and loads them
/// into our UBO. A good portion of this was copied from
/// Texture2D::apply, this is in no ways a general solution.
void BindlessTexture::applyOnce(osg::State& state) const
{
if (!_buffer)
return;
TextureObject* textureObject;
unsigned contextID = state.getContextID();
osg::GLExtensions* extensions = osg::GLExtensions::Get( contextID, true );
osg::ref_ptr<osg::Image> image = _image;
if (_handles[contextID].size() < _textureList.size())
_handles[contextID].resize( _textureList.size(),0);
if (_textureBufferList[contextID].size() < _textureList.size())
_textureBufferList[contextID].resize( _textureList.size());
int txtcount = _textureList.size();
if (_buffer->count() < txtcount)
txtcount = _buffer->count();
//for each actual texture we have, bind it, get the texture hande, assign the value to our UBO
for (int i = 0; i <txtcount; i++){
image = _textureList[i];
if (_image.valid())
computeInternalFormatWithImage(*image);
else
continue;
// compute the dimensions of the texture.
computeRequiredTextureDimensions(state,*image,_textureWidth, _textureHeight, _numMipmapLevels);
textureObject = generateAndAssignTextureObject(contextID,GL_TEXTURE_2D,_numMipmapLevels,_internalFormat,_textureWidth,_textureHeight,1,_borderWidth);
textureObject->bind();
applyTexParameters(GL_TEXTURE_2D,state);
applyTexImage2D_load(state,GL_TEXTURE_2D,image.get(),
_textureWidth, _textureHeight, _numMipmapLevels);
textureObject->setAllocated(true);
_textureBufferList[contextID][i] = textureObject;
//Here is where the "magic" happens, we get the texture handle for our texture, copy it to our UBO,
//and then tell OpenGL to keep the handle resident
_handles[contextID][i] = extensions->glGetTextureHandle( textureObject->id() );
std::vector<GLuint64> &vec = _buffer->Handles()->asVector();
vec[i*2] = _handles[contextID][i];
_buffer->Object()->dirty();
_buffer->Handles()->dirty();
if ( _handles[contextID][i] != 0L || extensions->glIsTextureHandleResident( _handles[contextID][i]) == GL_FALSE)
{
extensions->glMakeTextureHandleResident( _handles[contextID][i] );
}
}
// update the modified tag to show that it is up to date.
getModifiedCount(contextID) = image->getModifiedCount();
}
void BindlessTexture::apply(osg::State& state) const
{
unsigned contextID = state.getContextID();
if ( _isBound[contextID] == false )
{
applyOnce(state);
_isBound[contextID] = true;
}else{
//we should mostly hit this during the lifetime of this object,
//note we basically do nothing......
}
}
/// cleanup, we just need to tell OpenGL to release our texture handle
void BindlessTexture::releaseGLObjects(osg::State* state) const
{
if ( state )
{
unsigned contextID = state->getContextID();
osg::Texture2D::releaseGLObjects( state );
osg::GLExtensions* ext = osg::GLExtensions::Get( contextID, true );
for(unsigned i=0; i<_handles[contextID].size(); ++i)
{
ext->glMakeTextureHandleNonResident( _handles[contextID][i] );
_handles[contextID][i] = 0;
}
}
}
void
BindlessTexture::resizeGLObjectBuffers(unsigned int maxSize)
{
osg::Texture2D::resizeGLObjectBuffers( maxSize );
unsigned int handleSize = _handles.size();
unsigned int txtSize = _textureList.size();
if ( handleSize < maxSize ) {
_isBound.resize(maxSize,false);
}
if ( handleSize < maxSize ) {
_handles.resize( maxSize );
for(unsigned i=handleSize; i<_handles.size(); ++i){
for(unsigned j=0; j<txtSize; ++j)
_handles[i][j] = 0;
}
}
}
typedef osg::ref_ptr<osg::Image> ImageRef;
///////////////////////////////////////////////////////
///Create an array of images, with checkerboard
///pattern with random color and size
///
void createImageArray(osg::StateSet* attachPnt){
BindlessTexture::TextureList images;
images.resize(TextureCount);
BindlessBuffer::BindlessBufferRef buffer = BindlessBuffer::Make(TextureCount);
srand (time(NULL));
for (int i =0; i < TextureCount; i++){
ImageRef tImage = new osg::Image();
int powerOf2 = rand()%6+4;
const unsigned int imageSize = 1<<powerOf2;
tImage->allocateImage(imageSize,imageSize,1,GL_RGBA,GL_UNSIGNED_BYTE);
unsigned char* buff = tImage->data();
const int stride = 4;
unsigned char primaryColor[4];
int boxWidth = rand()%15+2;
int boxLength = rand()%15+2;
//light squares
primaryColor[0] = rand()%128 + 128;
primaryColor[1] = rand()%128 + 128;
primaryColor[2] = rand()%128 + 128;
//dark squares
unsigned char secondaryColor[4];
secondaryColor[0] = rand()%128;
secondaryColor[1] = rand()%128;
secondaryColor[2] = rand()%128;
for (unsigned int x = 0; x < imageSize; x++){
for (unsigned int y =0; y<imageSize; y++){
unsigned char* pixel = &buff[(x*imageSize+y)*stride];
int xSide = x/boxWidth;
int ySide = y/boxLength;
bool isPrimaryColor = (xSide+ySide)%2>0;
if (isPrimaryColor){
pixel[0] = primaryColor[0];
pixel[1] = primaryColor[1];
pixel[2] = primaryColor[2];
}else{
pixel[0] = secondaryColor[0];
pixel[1] = secondaryColor[1];
pixel[2] = secondaryColor[2];
}
pixel[3] = 255;
}
}
images[i] = tImage;
std::stringstream sstr;
sstr<<"Image"<<i;
tImage->setName(sstr.str());
}
BindlessTexture* tex = new BindlessTexture(buffer,images);
attachPnt->setTextureAttribute(0,tex,osg::StateAttribute::ON);
attachPnt->setAttributeAndModes(buffer->Binding(), osg::StateAttribute::ON);
}
///Create a cube centered at the origin, with given by size
///
osg::Geometry* createCube(float scale, osg::Vec3 origin = osg::Vec3(0.0f,0.0f,0.0f) )
{
osg::Geometry* geometry = new osg::Geometry;
geometry->setName("TexturedCubeArray");
osg::Vec3Array* vertices = new osg::Vec3Array;
geometry->setVertexArray(vertices);
osg::Vec2Array* tcoords = new osg::Vec2Array();
geometry->setTexCoordArray(0,tcoords);
origin -= osg::Vec3(scale/2.0f,scale/2.0f,scale/2.0f);
osg::Vec3 dx(scale,0.0f,0.0f);
osg::Vec3 dy(0.0f,scale,0.0f);
osg::Vec3 dz(0.0f,0.0f,scale);
{
// front face
vertices->push_back(origin);
vertices->push_back(origin+dx);
vertices->push_back(origin+dx+dz);
vertices->push_back(origin+dz);
tcoords->push_back(osg::Vec2(0.0f,0.0f));
tcoords->push_back(osg::Vec2(1.0f,0.0f));
tcoords->push_back(osg::Vec2(1.0f,1.0f));
tcoords->push_back(osg::Vec2(0.0f,1.0f));
}
{
// back face
vertices->push_back(origin+dy);
vertices->push_back(origin+dy+dz);
vertices->push_back(origin+dy+dx+dz);
vertices->push_back(origin+dy+dx);
tcoords->push_back(osg::Vec2(0.0f,0.0f));
tcoords->push_back(osg::Vec2(1.0f,0.0f));
tcoords->push_back(osg::Vec2(1.0f,1.0f));
tcoords->push_back(osg::Vec2(0.0f,1.0f));
}
{
// left face
vertices->push_back(origin+dy);
vertices->push_back(origin);
vertices->push_back(origin+dz);
vertices->push_back(origin+dy+dz);
tcoords->push_back(osg::Vec2(0.0f,0.0f));
tcoords->push_back(osg::Vec2(1.0f,0.0f));
tcoords->push_back(osg::Vec2(1.0f,1.0f));
tcoords->push_back(osg::Vec2(0.0f,1.0f));
}
{
// right face
vertices->push_back(origin+dx+dy);
vertices->push_back(origin+dx+dy+dz);
vertices->push_back(origin+dx+dz);
vertices->push_back(origin+dx);
tcoords->push_back(osg::Vec2(0.0f,0.0f));
tcoords->push_back(osg::Vec2(1.0f,0.0f));
tcoords->push_back(osg::Vec2(1.0f,1.0f));
tcoords->push_back(osg::Vec2(0.0f,1.0f));
}
{
// top face
vertices->push_back(origin+dz);
vertices->push_back(origin+dz+dx);
vertices->push_back(origin+dz+dx+dy);
vertices->push_back(origin+dz+dy);
tcoords->push_back(osg::Vec2(0.0f,0.0f));
tcoords->push_back(osg::Vec2(1.0f,0.0f));
tcoords->push_back(osg::Vec2(1.0f,1.0f));
tcoords->push_back(osg::Vec2(0.0f,1.0f));
}
{
// bottom face
vertices->push_back(origin);
vertices->push_back(origin+dy);
vertices->push_back(origin+dx+dy);
vertices->push_back(origin+dx);
tcoords->push_back(osg::Vec2(0.0f,0.0f));
tcoords->push_back(osg::Vec2(1.0f,0.0f));
tcoords->push_back(osg::Vec2(1.0f,1.0f));
tcoords->push_back(osg::Vec2(0.0f,1.0f));
}
osg::DrawArrays* primSet = new osg::DrawArrays(GL_QUADS, 0, vertices->size());
geometry->addPrimitiveSet(primSet);
return geometry;
}
///
///Here we are going to create our scene, basically we need to make sure our
///Bindless texture gets applied before our shader programs.
///
///
osg::Group* CreateScene(){
osg::Group* sceneRoot= new osg::Group();
sceneRoot->setName("Root");
osg::Geode *geo = new osg::Geode();
geo->setName("Geo");
sceneRoot->addChild(geo);
osg::StateSet* scene_ss = sceneRoot->getOrCreateStateSet();
createImageArray(scene_ss);
scene_ss->setMode(GL_DEPTH_TEST,osg::StateAttribute::ON);
osg::ref_ptr<osg::Geometry> geom = createCube(0.9f);
osg::PrimitiveSet *prim = geom->getPrimitiveSet(0);
//instanced elements must use VBOs
geom->setUseDisplayList(false);
geom->setUseVertexBufferObjects(true);
geom->setCullingActive(false);
prim->setNumInstances(1000);
prim->dirty();
sceneRoot->addChild(geo);
geo->addDrawable(geom.get());
osg::StateSet* ss = geo->getOrCreateStateSet();
std::string strTextureCount;
std::stringstream ssconv;
ssconv<<TextureCount;
ssconv>>strTextureCount;
std::string::size_type pos = vertShader.find("XXX");
vertShader.replace(pos,size_t(3),strTextureCount);
pos = fragShader.find("XXX");
fragShader.replace(pos,size_t(3),strTextureCount);
osg::Program* program = new osg::Program;
osg::Shader* vertex_shader = new osg::Shader(osg::Shader::VERTEX, vertShader);
program->addShader(vertex_shader);
osg::Shader* fragment_shader = new osg::Shader(osg::Shader::FRAGMENT, fragShader);
program->addShader(fragment_shader);
ss->setAttributeAndModes(program, osg::StateAttribute::ON);
return sceneRoot;
}
int main(int argc, char** argv)
{
// set command line options
osg::ArgumentParser arguments(&argc,argv);
// construct the viewer.
osgViewer::Viewer viewer(arguments);
// add the stats handler
viewer.addEventHandler(new osgViewer::StatsHandler);
// add model to viewer.
viewer.setSceneData( CreateScene() );
viewer.realize();
viewer.getCamera()->getGraphicsContext()->getState()->setUseModelViewAndProjectionUniforms(true);
return viewer.run();
}

View File

@@ -65,7 +65,7 @@ class DrawableDrawCallback : public osg::Drawable::DrawCallback
}
};
struct DrawableUpdateCallback : public osg::DrawableUpdateCallback
struct DrawableUpdateCallback : public osg::Drawable::UpdateCallback
{
virtual void update(osg::NodeVisitor*, osg::Drawable* drawable)
{
@@ -73,7 +73,7 @@ struct DrawableUpdateCallback : public osg::DrawableUpdateCallback
}
};
struct DrawableCullCallback : public osg::DrawableCullCallback
struct DrawableCullCallback : public osg::Drawable::CullCallback
{
/** do customized cull code.*/
virtual bool cull(osg::NodeVisitor*, osg::Drawable* drawable, osg::State* /*state*/) const
@@ -158,11 +158,11 @@ class CameraEventCallback : public osg::NodeCallback
};
struct TestDrawableUpdateCallback : public osg::DrawableUpdateCallback
struct TestDrawableUpdateCallback : public osg::Drawable::UpdateCallback
{
TestDrawableUpdateCallback(const std::string &message): _message(message) {}
virtual void update(osg::NodeVisitor*, osg::Drawable* /*drw*/) {
virtual void update(osg::NodeVisitor*, osg::Drawable* drw) {
printf("%s\n", _message.c_str());
}
std::string _message;
@@ -172,7 +172,7 @@ struct TestNodeUpdateCallback : public osg::NodeCallback
{
TestNodeUpdateCallback(const std::string &message): _message(message) {}
virtual void operator()(osg::Node* /*node*/, osg::NodeVisitor* /*nv*/) {
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv) {
printf("%s\n", _message.c_str());
}
std::string _message;

View File

@@ -83,11 +83,7 @@ void singleWindowMultipleCameras(osgViewer::Viewer& viewer)
}
unsigned int width, height;
osg::GraphicsContext::ScreenIdentifier main_screen_id;
main_screen_id.readDISPLAY();
main_screen_id.setUndefinedScreenDetailsToDefaultScreen();
wsi->getScreenResolution(main_screen_id, width, height);
wsi->getScreenResolution(osg::GraphicsContext::ScreenIdentifier(0), width, height);
osg::ref_ptr<osg::GraphicsContext::Traits> traits = new osg::GraphicsContext::Traits;
traits->x = 0;
@@ -97,8 +93,6 @@ void singleWindowMultipleCameras(osgViewer::Viewer& viewer)
traits->windowDecoration = true;
traits->doubleBuffer = true;
traits->sharedContext = 0;
traits->readDISPLAY();
traits->setUndefinedScreenDetailsToDefaultScreen();
osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get());
if (gc.valid())
@@ -140,11 +134,7 @@ void multipleWindowMultipleCameras(osgViewer::Viewer& viewer, bool multipleScree
}
unsigned int width, height;
osg::GraphicsContext::ScreenIdentifier main_screen_id;
main_screen_id.readDISPLAY();
main_screen_id.setUndefinedScreenDetailsToDefaultScreen();
wsi->getScreenResolution(main_screen_id, width, height);
wsi->getScreenResolution(osg::GraphicsContext::ScreenIdentifier(0), width, height);
unsigned int numCameras = 6;
@@ -161,8 +151,6 @@ void multipleWindowMultipleCameras(osgViewer::Viewer& viewer, bool multipleScree
traits->windowDecoration = true;
traits->doubleBuffer = true;
traits->sharedContext = 0;
traits->readDISPLAY();
traits->setUndefinedScreenDetailsToDefaultScreen();
osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get());
if (gc.valid())

View File

@@ -107,10 +107,10 @@ Character::Character():
}
void Character::setCharacter(const std::string& filename, const std::string& name, const osg::Vec3& origin, const osg::Vec3& cwidth, const osg::Vec3& catchPos, float positionRatio)
void Character::setCharacter(const std::string& filename, const std::string& name, const osg::Vec3& origin, const osg::Vec3& width, const osg::Vec3& catchPos, float positionRatio)
{
_origin = origin;
_width = cwidth;
_width = width;
_positionRatio = positionRatio;
_numLives = 3;
_numCatches = 0;
@@ -349,7 +349,7 @@ class CatchableObject : public osg::Referenced
*/
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()
{
setToGravity(1.0f);
@@ -357,7 +357,7 @@ class CatchableObject : public osg::Referenced
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()
{
setToGravity(1.0f);
@@ -971,7 +971,9 @@ bool GameEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionA
{
createNewCatchable();
}
break;
}
case(osgGA::GUIEventAdapter::KEYDOWN):
{
@@ -985,7 +987,6 @@ bool GameEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionA
_rightKeyPressed=true;
return true;
}
break;
}
case(osgGA::GUIEventAdapter::KEYUP):
{
@@ -999,7 +1000,6 @@ bool GameEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionA
_rightKeyPressed=false;
return true;
}
break;
}
case(osgGA::GUIEventAdapter::DRAG):
case(osgGA::GUIEventAdapter::MOVE):

View File

@@ -1,7 +1,6 @@
#this file is automatically generated
#this file is automatically generated
SET(TARGET_SRC osgclip.cpp )
SET(TARGET_ADDED_LIBRARIES osgText )
#### end var setup ###
SETUP_EXAMPLE(osgclip)

View File

@@ -38,7 +38,6 @@
#include <osgViewer/Viewer>
#include <osgUtil/Optimizer>
#include <osgText/Text>
osg::ref_ptr<osg::Node> decorate_with_clip_node(const osg::ref_ptr<osg::Node>& subgraph)
@@ -58,43 +57,23 @@ osg::ref_ptr<osg::Node> decorate_with_clip_node(const osg::ref_ptr<osg::Node>& s
wireframe_subgraph->addChild(subgraph);
rootnode->addChild(wireframe_subgraph);
// more complex approach to managing ClipNode, allowing
// ClipNode node to be transformed independently from the subgraph
// that it is clipping.
/*
// simple approach to adding a clipnode above a subgraph.
osg::MatrixTransform* transform= new osg::MatrixTransform;
// create clipped part.
osg::ClipNode* clipped_subgraph = new osg::ClipNode;
osg::NodeCallback* nc = new osg::AnimationPathCallback(subgraph->getBound().center(),osg::Vec3(0.0f,0.0f,1.0f),osg::inDegrees(45.0f));
transform->setUpdateCallback(nc);
osg::ClipNode* clipnode = new osg::ClipNode;
osg::BoundingSphere bs = subgraph->getBound();
bs.radius()*= 0.4f;
osg::BoundingBox bb;
bb.expandBy(bs);
clipnode->createClipBox(bb);
clipnode->setCullingActive(false);
transform->addChild(clipnode);
rootnode->addChild(transform);
// create clipped part.
osg::Group* clipped_subgraph = new osg::Group;
clipped_subgraph->setStateSet(clipnode->getStateSet());
clipped_subgraph->createClipBox(bb);
clipped_subgraph->addChild(subgraph);
rootnode->addChild(clipped_subgraph);
return rootnode;
}
osg::ref_ptr<osg::Node> simple_decorate_with_clip_node(const osg::ref_ptr<osg::Node>& subgraph)
{
osg::ref_ptr<osg::Group> rootnode = new osg::Group;
*/
// more complex approach to managing ClipNode, allowing
@@ -130,66 +109,35 @@ osg::ref_ptr<osg::Node> simple_decorate_with_clip_node(const osg::ref_ptr<osg::N
return rootnode;
}
int main( int argc, char **argv )
{
// use an ArgumentParser object to manage the program arguments.
osg::ArgumentParser arguments(&argc,argv);
osgViewer::Viewer viewer(arguments);
// load the nodes from the commandline arguments.
osg::ref_ptr<osg::Group> scene = new osg::Group;
std::string textString;
while(arguments.read("--text", textString))
{
osg::ref_ptr<osgText::Text> text = new osgText::Text;
text->setFont("fonts/times.ttf");
text->setAxisAlignment(osgText::Text::XZ_PLANE);
text->setDrawMode(osgText::Text::TEXT|osgText::Text::ALIGNMENT|osgText::Text::BOUNDINGBOX|osgText::Text::FILLEDBOUNDINGBOX);
text->setText(textString);
scene->addChild(text);
}
osg::ref_ptr<osg::Node> loadedModel = osgDB::readRefNodeFiles(arguments);
if (loadedModel.valid())
{
scene->addChild(scene.get());
}
// if not loaded assume no arguments passed in, try use default mode instead.
if (scene->getNumChildren()==0)
{
loadedModel = osgDB::readRefNodeFile("cow.osgt");
scene->addChild(loadedModel.get());
}
if (!loadedModel) loadedModel = osgDB::readRefNodeFile("cow.osgt");
if (scene->getNumChildren()==0)
if (!loadedModel)
{
osg::notify(osg::NOTICE)<<"Please specify a filename on the command line"<<std::endl;
return 1;
}
// decorate the scenegraph with a clip node.
osg::ref_ptr<osg::Node> rootnode;
if (arguments.read("--simple"))
{
rootnode = simple_decorate_with_clip_node(scene);
}
else
{
rootnode = decorate_with_clip_node(scene);
}
osg::ref_ptr<osg::Node> rootnode = decorate_with_clip_node(loadedModel);
// run optimization over the scene graph
osgUtil::Optimizer optimzer;
optimzer.optimize(rootnode);
osgViewer::Viewer viewer;
// set the scene to render
viewer.setSceneData(rootnode);

View File

@@ -19,7 +19,6 @@
#include <stdio.h>
#include <fcntl.h>
#include <sys/types.h>
#include <iostream>
#if !defined (WIN32) || defined(__CYGWIN__)
#include <sys/ioctl.h>
@@ -69,13 +68,6 @@
Broadcaster::Broadcaster( void )
{
#if defined (__linux) || defined(__CYGWIN__)
_ifr_name = "eth0";
#elif defined(__sun)
_ifr_name = "hme0";
#elif !defined (WIN32)
_ifr_name = "ef0";
#endif
_port = 0;
_initialized = false;
_buffer = 0L;
@@ -135,7 +127,13 @@ bool Broadcaster::init( void )
#if !defined (WIN32) || defined(__CYGWIN__)
struct ifreq ifr;
strcpy( ifr.ifr_name, _ifr_name.c_str());
#endif
#if defined (__linux) || defined(__CYGWIN__)
strcpy( ifr.ifr_name, "eth0" );
#elif defined(__sun)
strcpy( ifr.ifr_name, "hme0" );
#elif !defined (WIN32)
strcpy( ifr.ifr_name, "ef0" );
#endif
#if defined (WIN32) // get the server address
saddr.sin_addr.s_addr = htonl(INADDR_BROADCAST);
@@ -143,7 +141,6 @@ bool Broadcaster::init( void )
#else
if( (ioctl( _so, SIOCGIFBRDADDR, &ifr)) < 0 )
{
printf(" ifr.ifr_name = %s\n",ifr.ifr_name);
perror( "Broadcaster::init() Cannot get Broadcast Address" );
return false;
}
@@ -164,11 +161,6 @@ bool Broadcaster::init( void )
return _initialized;
}
void Broadcaster::setIFRName( const std::string& name )
{
_ifr_name = name;
}
void Broadcaster::setHost( const char *hostname )
{
struct hostent *h;
@@ -210,7 +202,6 @@ void Broadcaster::sync( void )
#else
unsigned int size = sizeof( struct sockaddr_in );
sendto( _so, (const void *)_buffer, _buffer_size, 0, (struct sockaddr *)&saddr, size );
std::cout<<"sento("<<_buffer<<", "<<_buffer_size<<std::endl;
#endif
}

View File

@@ -21,8 +21,6 @@
#ifndef __BROADCASTER_H
#define __BROADCASTER_H
#include <string>
////////////////////////////////////////////////////////////
// Broadcaster.h
//
@@ -46,10 +44,6 @@ class Broadcaster
// Set the buffer to be broadcast
void setBuffer( void *buffer, const unsigned int buffer_size );
// Set the IFRName i.e. eth0, will default to platform appropriate setting where possible.
void setIFRName( const std::string& name );
// Set a recipient host. If this is used, the Broadcaster
// no longer broadcasts, but rather directs UDP packets at
// host.
@@ -62,9 +56,6 @@ class Broadcaster
bool init( void );
private :
std::string _ifr_name;
#if defined(WIN32) && !defined(__CYGWIN__)
SOCKET _so;
#else

View File

@@ -74,7 +74,7 @@ class CameraPacket {
void writeEventQueue(osgViewer::Viewer& viewer);
void setMasterKilled(const bool flag) { _masterKilled = flag; }
bool getMasterKilled() const { return _masterKilled; }
const bool getMasterKilled() const { return _masterKilled; }
unsigned int _byte_order;
bool _masterKilled;
@@ -461,7 +461,7 @@ int main( int argc, char **argv )
arguments.getApplicationUsage()->addCommandLineOption("-o <float>","Offset angle of camera");
// construct the viewer.
osgViewer::Viewer viewer(arguments);
osgViewer::Viewer viewer;
// read up the osgcluster specific arguments.
@@ -469,13 +469,6 @@ int main( int argc, char **argv )
while (arguments.read("-m")) viewerMode = MASTER;
while (arguments.read("-s")) viewerMode = SLAVE;
unsigned int messageSize = 1024;
while (arguments.read("--size", messageSize)) {}
bool readWriteFrame = false;
while (arguments.read("--frame")) readWriteFrame = true;
int socketNumber=8100;
while (arguments.read("-n",socketNumber)) ;
@@ -495,21 +488,10 @@ int main( int argc, char **argv )
return 1;
}
// objects for managing the broadcasting and receiving of camera packets.
Broadcaster bc;
Receiver rc;
std::string ifrName;
if (arguments.read("--ifr-name", ifrName)) { bc.setIFRName(ifrName); }
bc.setPort(static_cast<short int>(socketNumber));
rc.setPort(static_cast<short int>(socketNumber));
// any option left unread are converted into errors to write out later.
arguments.reportRemainingOptionsAsUnrecognized();
// report any errors if they have occurred when parsing the program arguments.
// report any errors if they have occured when parsing the program aguments.
if (arguments.errors())
{
arguments.writeErrorMessages(std::cout);
@@ -556,40 +538,19 @@ int main( int argc, char **argv )
// create the windows and run the threads.
viewer.realize();
osg::ref_ptr<osg::Image> image;
if (readWriteFrame)
{
osgViewer::Viewer::Windows windows;
viewer.getWindows(windows);
if (windows.empty())
{
return 1;
}
unsigned int width = windows.front()->getTraits()->width;
unsigned int height = windows.front()->getTraits()->height;
image = new osg::Image;
if (windows.front()->getTraits()->alpha)
{
OSG_NOTICE<<"Setting up RGBA osg::Image, width = "<<width<<", height = "<<height<<std::endl;
image->allocateImage(width, height, 1, GL_RGBA, GL_UNSIGNED_BYTE);
}
else
{
OSG_NOTICE<<"Setting up RGB osg::Image, width = "<<width<<", height = "<<height<<std::endl;
image->allocateImage(width, height, 1, GL_RGB, GL_UNSIGNED_BYTE);
}
// if (image->getImageStepInBytes()>messageSize) messageSize = image->getImageStepInBytes();
}
CameraPacket *cp = new CameraPacket;
// objects for managing the broadcasting and recieving of camera packets.
Broadcaster bc;
Receiver rc;
bc.setPort(static_cast<short int>(socketNumber));
rc.setPort(static_cast<short int>(socketNumber));
bool masterKilled = false;
DataConverter scratchPad(messageSize);
DataConverter scratchPad(1024);
while( !viewer.done() && !masterKilled )
{
@@ -618,15 +579,10 @@ int main( int argc, char **argv )
bc.setBuffer(scratchPad._startPtr, scratchPad._numBytes);
std::cout << "bc.sync()"<<scratchPad._numBytes<<std::endl;
bc.sync();
if (image.valid())
{
bc.setBuffer(image->data(), image->getImageStepInBytes());
bc.sync();
}
}
break;
case(SLAVE):
@@ -634,9 +590,7 @@ int main( int argc, char **argv )
rc.setBuffer(scratchPad._startPtr, scratchPad._numBytes);
unsigned int readsize = rc.sync();
if (readsize) std::cout<<std::endl<<"readsize = "<<readsize<<std::endl;
rc.sync();
scratchPad.reset();
scratchPad.read(*cp);
@@ -649,14 +603,6 @@ int main( int argc, char **argv )
// break out of while (!done) loop since we've now want to shut down.
masterKilled = true;
}
if (image)
{
rc.setBuffer(image->data(), image->getImageStepInBytes());
readsize = rc.sync();
if (readsize) std::cout<<"image readsize = "<<readsize<<std::endl;
}
}
break;
default:

View File

@@ -112,14 +112,14 @@ void Receiver::setBuffer( void *buffer, const unsigned int size )
_buffer_size = size;
}
unsigned int Receiver::sync( void )
void Receiver::sync( void )
{
if(!_initialized) init();
if( _buffer == 0L )
{
fprintf( stderr, "Receiver::sync() - No buffer\n" );
return 0;
return;
}
#if defined(__linux) || defined(__FreeBSD__) || defined( __APPLE__ ) || defined(__FreeBSD_kernel__) || defined(__GNU__)
@@ -161,6 +161,5 @@ unsigned int Receiver::sync( void )
}
}
#endif
return static_cast<unsigned int>(_buffer_size);
}

View File

@@ -46,8 +46,8 @@ class Receiver
// Define what port to listen and bind to
void setPort( const short port );
// Sync does a blocking wait to receive next message
unsigned int sync( void );
// Sync does a blocking wait to recieve next message
void sync( void );
private :
bool init( void );

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