Compare commits

...

509 Commits

Author SHA1 Message Date
Robert Osfield
925270d909 Removed indentation to avoid github MD mark up from loosing link. 2022-12-01 18:18:42 +00:00
Robert Osfield
dd1745896a Updated links to discussion forum. 2022-12-01 18:15:55 +00:00
Robert Osfield
6c1cbb1f48 Fixed copyright notice 2022-09-27 11:12:10 +01:00
Robert Osfield
5a939746cc Removed debug messages 2022-05-14 15:17:37 +01:00
mmurrian
606a32685e Update DisplaySettings.cpp
DisplaySettings::setDisplaySettings sets _shaderHint from itself (potentially uninitialized)
2022-04-07 15:29:56 +01:00
Robert Osfield
06558a5dda Quietened down debug message 2021-12-09 15:46:15 +00:00
Robert Osfield
7505cb4603 Fixed orientation of quad strips. 2021-12-09 12:36:40 +00:00
Robert Osfield
8b20f0adef Renanabled check for Asio 2021-12-08 15:31:29 +00:00
Robert Osfield
fee977ac90 Added workaround to prevent building against new Asio headers 2021-12-08 14:28:47 +00:00
Robert Osfield
62dbe7b85e Added 's' write selected nodes to "saved_selected.osgt feature. 2021-12-08 14:28:47 +00:00
Bo Svensson
ecaca716e9 removes invalid glReadBuffer calls 2021-10-08 10:49:01 +01:00
Robert Osfield
df21f59779 Added alias from asc to 3dc 2021-08-31 16:21:18 +01:00
Robert Osfield
e28f789ffa Disabled the use of asio as the RestHttpDevice plugin no longer compiles with modern boost releases 2021-06-25 13:17:21 +01:00
Alexander "Ananace" Olofsson
b7fa2d7914 Fix OpenThreads install on MSVC without a prefix
All this change does is make the install config for OpenThreads identical to the one in ModuleInstall.cmake
2021-06-24 12:19:40 +01:00
Robert Osfield
51924943e2 Removed unnedded include 2021-05-06 10:21:16 +01:00
elsid
969c1821be Add move constructor and move assignment operator to ref_ptr
Use conditional compilation to make it work only with C++11 support.
2021-05-06 10:21:04 +01:00
Calum Robinson
2695f29be0 Fix bounds for empty text nodes
_lineCount can be 0, so we get underflow if the alignment is one of
the *_BOTTOM_BASE_LINE.
2021-04-14 11:51:09 +01:00
Robert Osfield
78cb12b531 Merge pull request #1005 from eligovision/OpenSceneGraph-3.6_webgl_compr_tex
ASTC Compression Support Added; GLExtensions improvements
2021-03-29 10:32:13 +01:00
Robert Osfield
beb9bc3cf2 Merge branch 'OpenSceneGraph-3.6' of https://github.com/openscenegraph/OpenSceneGraph into OpenSceneGraph-3.6 2021-03-29 10:07:02 +01:00
Robert Osfield
d11e84178f Merge pull request #1046 from eligovision/OpenSceneGraph-3.6_timer_query_gles
OpenSceneGraph 3.6 improvement: GL_EXT_disjoint_timer_query extension added
2021-03-29 09:57:43 +01:00
Gleb Mazovetskiy
b14eecb3c7 Check GL_NV_framebuffer_multisample_coverage
`isRenderbufferMultisampleCoverageSupported()` should not return true if
the extension is not supported.

Fixes #1028
2021-03-29 09:43:50 +01:00
Gleb Mazovetskiy
9fb010fadd Fix C++17 MSVC compilation error
With C++17, Windows headers must not be included after `using namespace std;`.

Windows headers define a `byte` type internally and `using namespace std`
causes it to conflict with `std::byte`:

    error C2872: 'byte': ambiguous symbol

MSVC thread: https://developercommunity.visualstudio.com/t/error-c2872-byte-ambiguous-symbol/93889
2021-03-29 09:31:55 +01:00
Robert Osfield
8a15f23c15 Merge pull request #1059 from eligovision/OpenSceneGraph-3.6_freetype_otf
FreeType plugin: 'otf' extension added
2021-03-29 09:26:46 +01:00
valid-ptr
e260dfb582 merged with upstream/OpenSceneGraph-3.6 2021-03-24 17:45:19 +03:00
valid-ptr
b728587fab conflict with upstream/OpenSceneGraph-3.6 resolved 2021-03-24 17:40:29 +03:00
valid-ptr
f29af50b76 FreeType plugin: 'otf' extension added 2021-03-24 17:01:00 +03:00
Gleb Mazovetskiy
8b2e02b71d Ensure global Mutex is initialized before Registry
A Registry instance may be accessed before the global mutex, e.g. here:

e77f50371c/src/osgText/Font.cpp (L49)

This leads to the Mutex being destroyed before the Registry is destroyed.

This causes a crash at exit, as described in #1048.

Fixes #1048.
2021-03-14 17:58:28 +00:00
Robert Osfield
5faae0e52e Moved Widget case to later. 2021-02-19 12:03:07 +00:00
Robert Osfield
5d51e5bf2a Fixed META_ macro usage 2021-02-18 16:13:50 +00:00
Robert Osfield
159c0271b7 Fixed osgWidget event handling 2021-02-18 16:08:25 +00:00
Robert Osfield
94d5211f43 Ran dos2unix to fix line endings 2021-02-17 18:23:32 +00:00
Robert Osfield
219adb7419 Ran dos2unix to fix line endings 2021-02-17 17:50:21 +00:00
valid-ptr
b101b4b4d2 GL_EXT_disjoint_timer_query extension added 2021-02-04 19:53:54 +03:00
Robert Osfield
b8862d0420 Merge pull request #1041 from glebm/3.6-cherry-pick-android-fix
3.6 cherry-pick: CMakeLists.txt: OSG_FIND_3RD_PARTY_DEPS option
2021-01-23 18:33:39 +00:00
Robert Osfield
8a0114a46a Replaced std::mem_fun_ref usage to avoid compatiblity with modern compilers. 2021-01-23 18:27:58 +00:00
Gleb Mazovetskiy
199035ae51 CMakeLists.txt: OSG_FIND_3RD_PARTY_DEPS option
Android-specific macros aren't needed in some cases, e.g. if the NDK is
setup with all the needed dependencies a much easier way to find
packages is to simply specify the correct `CMAKE_FIND_ROOT_PATH`.

The `ANDROID_3RD_PARTY` macro interferes with this.
Adds an option to disable it.

WIN32 build is in a similar situation, the new option affects it also.
2021-01-23 17:25:45 +00:00
Robert Osfield
23b4345517 Merge pull request #1032 from glebm/3.6-backport-deprecations-fix
Back-port (cherry-pick) warnings fixes into 3.6
2021-01-23 16:15:35 +00:00
Robert Osfield
b5b0bed7c3 Merge pull request #1039 from unelsson/clocaletodae
Use c-locale with std::istream
2021-01-23 15:57:16 +00:00
Nelsson Huotari
a531f2bd13 Use c-locale with std::istream 2021-01-23 14:46:16 +02:00
Gleb Mazovetskiy
f36e9f2a4a include/osgViewer: Fix typo
Follow-up to #1027
2021-01-23 10:53:44 +00:00
Robert Osfield
b7c186f6d3 Fixed warnings reported by gcc-9.3.0
Note from glebm@:

Back-ported from e0d5e4b0ff

Identical except for the changes to `MatrixTemplate`, which does not
exist in 3.6
2021-01-19 20:37:40 +00:00
valid-ptr
927d2f0f10 Texture::TextureProfile::computeSize function fixed for ASTC compressed textures 2021-01-19 12:09:24 +03:00
Robert Osfield
644251db98 Fixed warnings 2021-01-18 16:33:34 +00:00
Robert Osfield
295bfffc17 Added 0 to end of array. 2021-01-18 15:38:43 +00:00
Gleb Mazovetskiy
b4663ded94 osgAnimation/Keyframe: Fix -Wshadow warning
```
include/osgAnimation/Keyframe:108:53: warning: declaration of 'iterator' shadows a member of 'osgAnimation::TemplateKeyframeContainer<osgAnimation::TemplateCubicBezier<double> >' [-Wshadow]
  108 |             for(std::vector<unsigned int>::iterator iterator = intervalSizes.begin() ; iterator != intervalSizes.end() ; ++ iterator) {
      |                                                     ^~~~~~~~

include/osg/MixinVector:39:44: note: shadowed declaration is here
   39 |     typedef typename vector_type::iterator iterator;
      |                                            ^~~~~~~~
```
2021-01-18 14:51:48 +00:00
Gleb Mazovetskiy
44d3da02a9 Fix osgViewer USE_GRAPHICSWINDOW without a windowing system
There is no way for the user to know whether OSG was compiled with a
windowing system.

This means calling USE_GRAPHICSWINDOW() in client libraries was unsafe
in the case of the "None" windowing system, as it would fail to link.

Turns the call into a no-op in that case.
2021-01-18 14:48:12 +00:00
Gleb Mazovetskiy
4093860c32 cmake: Allow passing LTO option 2021-01-18 14:45:41 +00:00
Gleb Mazovetskiy
0161b8ab46 include/osg/Callback: nullptr -> NULL
Fixes travis, which explictly requires c++98
2021-01-18 14:45:06 +00:00
ankurverma85
417f78ac5e Update unzip.cpp 2021-01-18 14:07:47 +00:00
Robert Osfield
8195b9c8e7 Merge pull request #1015 from eligovision/OpenSceneGraph-3.6_state_arg_rename
Wrong argument name rename: uniformMap -> defineMap
2021-01-18 13:57:29 +00:00
Glenn Waldron
5ca6759a1f Fix for #1013 - Texture2DArray fails to regenerate after a releaseGLObjects/dirtyTextureObject - remove the modified count condition on component images when subloading when there is no texture object 2021-01-18 13:55:53 +00:00
Sam Brkopac
9c7cde1db4 updated cmake to properly disable debug iterators on windows 2021-01-18 13:42:40 +00:00
valid-ptr
aed9fd74f6 Wrong argument name rename: uniformMap -> defineMap 2020-12-29 15:07:15 +03:00
valid-ptr
39a78e075f isTextureLODBiasSupported check added 2020-12-04 18:34:02 +03:00
valid-ptr
b4eb001d14 ASTC Texture compression support added 2020-12-04 18:33:18 +03:00
valid-ptr
6cd699e55f GLExtensions: isTextureCompressionASTCSupported (ASTC compression texture), isTextureLODBiasSupported (is needed for GL_TEXTURE_LOD_BIAS) flags added 2020-12-04 18:32:35 +03:00
konstantin.matveyev
4b0bed8161 GLExtensions improved: added support for WebGL compressed textures: S3TC, ETC{1,2}, PVRTC 2020-11-26 14:02:50 +03:00
tomhog
ddbed23537 fix for typo in windows branch of delimiter definition 2020-11-12 12:55:23 +00:00
Robert Osfield
a13f8cf4b4 Merge pull request #973 from arnauddgbes/OpenSceneGraph-3.6
fixed installation of PDB files on Windows with Ninja generator.
2020-11-10 16:41:46 +00:00
Robert Osfield
fab1431e59 Merge pull request #989 from eligovision/OpenSceneGraph-3.6_shader_composer
ShaderComposition mechanism on the osg::State fixed
2020-11-10 16:19:40 +00:00
Matthew Reid
073cfab166 Added support for sRGB texture formats 2020-11-10 16:05:56 +00:00
Robert Osfield
bf279a59fa Merged from master "Declare "result" as LONG for Mingw build" 2020-11-10 15:56:39 +00:00
Robert Osfield
4ad410969e Added Node::accept() usage from IntersectionVisitor to IntersectVisitor 2020-11-10 15:44:51 +00:00
Robert Osfield
f50d32547d Changed to using Node::accept() to handled children of Geode/Billboard to enable scene graphs with non drawables as children 2020-11-10 15:34:32 +00:00
Robert Osfield
8406442a96 Merge pull request #976 from MeyerFabian/build/windows_clang_3.6_target
build/windows_clang 3.6
2020-11-10 14:45:22 +00:00
Robert Osfield
7994bfa767 Merge branch 'OpenSceneGraph-3.6' into build/windows_clang_3.6_target 2020-11-10 14:41:56 +00:00
Robert Osfield
b8982224c3 Merge pull request #969 from unelsson/daeremoveprotcheck
Remove "file" protocol check
2020-11-10 14:13:26 +00:00
Robert Osfield
8178b51956 Merge pull request #968 from unelsson/getdaenamesbonesskel
Get names of bones and skeleton to osg nodes
2020-11-10 14:04:29 +00:00
Robert Osfield
a7a7c0de8b Merge pull request #967 from unelsson/daepluginoptionsfix
Clone pluginOptions.options
2020-11-10 13:51:18 +00:00
Alberto Luaces
2ade061ced Code comments, log strings and some variable spell fixes. 2020-10-29 15:14:29 +00:00
valid-ptr
0415b7df84 ShaderComposition mechanism on the osg::State fixed: condition improved 2020-10-28 15:13:47 +03:00
valid-ptr
43724f004e ShaderComposition mechanism on the osg::State fixed 2020-10-27 17:24:28 +03:00
OpenSceneGraph git repository
300ba7aa02 Merge pull request #983 from rhabacker/update-so-version
Updated SO version as osgDB::ReaderWriter changes from #981 change the ABI
2020-08-19 10:45:54 +01:00
Ralf Habacker
97a4094d76 Updated SO version as osgDB::ReaderWriter changes from #981 change the ABI 2020-08-19 11:19:08 +02:00
OpenSceneGraph git repository
6b95718d65 Merge pull request #981 from rhabacker/3.6-add-plugin-env-support
Add support for showing environment variables provided by osg plugins
2020-08-19 09:57:43 +01:00
Ralf Habacker
47ab799168 Use new method supportsEnvironment() from class ReaderWriter in client code 2020-08-19 10:35:54 +02:00
Ralf Habacker
c3108697de Add support for showing environment variables provided by osg plugins 2020-08-19 10:35:54 +02:00
MeyerFabian
ba70c7d543 build/windows_clang 2020-07-21 17:37:24 +02:00
Arnaud Huck
855212548d fixed installation of PDB files on Windows with Ninja generator.
Also added installation of PDB files for OpenThreads
2020-07-14 12:09:53 +02:00
Robert Osfield
47207248d4 Selected USE_NEW_DELETE allocation mode to fix memory leak 2020-07-09 10:14:02 +01:00
Nelsson Huotari
e1e6e07de3 Remove protocol check 2020-07-01 12:44:43 +03:00
Nelsson Huotari
508cf89f9c get names of bones and skeleton to osg nodes 2020-07-01 12:42:03 +03:00
Nelsson Huotari
f29ecc10a8 clone pluginOptions.options 2020-07-01 12:39:24 +03:00
OpenSceneGraph git repository
46505f66d3 Merge pull request #965 from gramnation/patch-1
comment out cmake internal help markup
2020-06-23 17:54:38 +01:00
Graham Stewart
fb63c5b0a5 comment out cmake internal help markup
cmake 2.8.12 cannot parse it. From the looks of it this sort of markup only needs to be parsable when building cmake v3 itself.
2020-06-23 11:51:58 -05:00
Calum Robinson
2b64d30fca Return early in osgText::Text property setters
Matches what the rest of the properties are doing & avoids unnecessary
computation.
2020-05-29 11:12:35 +01:00
Mathias Nährig
e0b288fe37 Update GLExtensions.cpp
GLExtensions::glTexStorage2DMultisample in fact called glTextureStorage2DMultisample which expects texture object instead of texture target
2020-05-18 09:44:58 +01:00
Conrad Poelman
91cfc02700 Remove register keyword (deprecated in C++17/20)
The "register" keyword is deprecated as of C++17. (https://en.cppreference.com/w/cpp/keyword/register) Removing it is necessary to build with clang10+.
2020-05-18 09:44:40 +01:00
Robert Osfield
b29fb0b870 Added ZLIB as a build depdency to PNG plugin build 2020-05-07 11:28:53 +01:00
OpenSceneGraph git repository
6ca2487362 Merge pull request #934 from mp3butcher/orphanalreadyimmutable
[osg3.6] prevent immutability setting when textureobject is taken from orphans
2020-05-03 09:37:44 +01:00
Julien Valentin
197fc401b4 prevent immutability resetting when textureobject is taken from orphans 2020-05-02 16:01:16 +02:00
Robert Osfield
16cd192562 Updated shaders from OpenSceneGraph-Data. 2020-04-29 12:02:52 +01:00
Remo E
2f043345c9 [macosx 10.15] Fix for https://github.com/openscenegraph/OpenSceneGraph/issues/926 from @PetrBo and @tikittel 2020-04-29 10:52:27 +01:00
Robert Osfield
24fc34a440 Merge branch 'AnyOldName3-tga-1' into OpenSceneGraph-3.6 2020-04-29 10:28:51 +01:00
Robert Osfield
decf339b74 Merge branch 'tga-1' of https://github.com/AnyOldName3/osg into AnyOldName3-tga-1 2020-04-29 10:17:11 +01:00
Conrad Poelman
889325b496 Name unnamed typedef struct {...} to fix MSVC error
Compile with latest MSVC 16.6.0 Preview Release, got error message:
> osgPlugins\x\types.h(41,20): error C7626: unnamed class used in typedef name cannot declare members other than non-static data members, member enumerations, or member classes (compiling source file ...3rdparty\OpenSceneGraph\src\osgPlugins\x\mesh.cpp)

The fix was just to give it a name, which will never be used. I picked Vector_struct, feel free to improve.
2020-04-29 09:45:00 +01:00
Jason Beverage
126623645f Closing ZipArchive in destructor 2020-04-29 09:25:13 +01:00
Scott Giese
6c908e9081 osgsimplegl3: fix minor typo 2020-04-29 09:18:54 +01:00
Robert Osfield
e4373b0143 Fixed crash during compile traversal 2020-04-29 09:14:01 +01:00
Chris Djali
16a5e019c5 Register option
Also make the capitalisation consistent with more plugins
2020-04-25 20:07:03 +01:00
AnyOldName3
597441ca33 Add option to treat all TGA files as TGA 1.0
Some files which are malformed TGA 2.0 files are technically valid TGA 1.0 files. For example, an image that just happened to have pixel data matching the TGA 2.0 footer or files created by buggy TGA 2.0 writers and were only ever fed to TGA 1.0 readers.
2020-04-13 20:42:57 +01:00
Scott Giese
864b087b1f Ignore Visual Studio Code configuration 2020-03-23 16:39:55 +00:00
Philip Lamb
75d03de844 png and tiff plugins do not depend on C++ exceptions. 2020-03-23 11:39:55 +00:00
OpenSceneGraph git repository
1bd75f464a Merge pull request #918 from LaurensVoerman/proxy-3.6
fix bug in ProxyNode with DEFER_LOADING_TO_DATABASE_PAGER
2020-03-13 08:46:29 +00:00
OpenSceneGraph git repository
d501def836 Merge pull request #914 from LaurensVoerman/las_recenter
ReaderWriterLAS recenter bug fixed, final batch of points was missed in translating the center point.
2020-03-13 08:36:19 +00:00
Robert Osfield
cdbec116fa Added arguments to viwer construction to allow better command line control 2020-03-13 08:33:52 +00:00
Laurens Voerman
68c5e6e6ca fix bug in ProxyNode with DEFER_LOADING_TO_DATABASE_PAGER causing crash when children reorder during load. 2020-03-02 10:48:12 +01:00
Laurens Voerman
638069f93b ReaderWriterLAS recenter bug fixed, final batch of points was missed in translating the center point. 2020-02-19 09:49:51 +01:00
Robert Osfield
a827840baf Updated ChangeLog 2020-01-31 11:03:07 +00:00
Robert Osfield
35f3876797 Updates for 3.6.5 release 2020-01-31 11:02:47 +00:00
Robert Osfield
2e0472ba7e Added mutex lock to avoid threading issues when glyphs are added to a Font from multiple threads 2020-01-31 10:37:25 +00:00
Robert Osfield
36e47d31bd Updates for 3.6.5-rc3 2020-01-30 19:25:50 +00:00
OpenSceneGraph git repository
994ea4d203 Merge pull request #911 from LaurensVoerman/FbxSdkFix
Fix for older versions of fbxsdk without xml or zlib libraries,
2020-01-30 16:30:41 +00:00
Robert Osfield
54ac72a126 Added explicit clean up removeView 2020-01-30 16:21:32 +00:00
Laurens Voerman
6559295768 Fix for older versions of fbxsdk without xml or zlib libraries, fix cmake multiconfig generators (msvc) with irrelevant CMAKE_BUILD_TYPE. 2020-01-30 17:13:14 +01:00
OpenSceneGraph git repository
9b41f260d9 Merge pull request #907 from DeadParrot/OpenSceneGraph-3.6
FBX plugin updates / PREFIX-NOTFOUND work-around
2020-01-27 10:11:23 +00:00
Stuart Mentzer
7a442801cd FBX plugin updates / PREFIX-NOTFOUND work-around 2020-01-26 14:28:56 -05:00
Robert Osfield
f3c615631b Updater rc number for 3.6.5-rc2, and CHangeLog 2020-01-21 10:11:30 +00:00
Robert Osfield
62cd8850e2 Removed stray space 2020-01-21 09:43:08 +00:00
OpenSceneGraph git repository
14e7bc5a17 Merge pull request #902 from mp3butcher/oqn
3.6 OQN API convergence
2020-01-21 09:32:57 +00:00
OpenSceneGraph git repository
5ac3a982ae Merge pull request #903 from dedowsdi/renderstage
Add getPreRenderList, getPostRenderList to RenderStage.
2020-01-21 09:16:51 +00:00
dedowsdi
a90a9a0a15 Add getPreRenderList getPostRenderList to RenderStage. 2020-01-21 11:00:25 +08:00
Daniel Trstenjak
995e849e8a OcclusionQueryNode: make all usages of 'updateDefaultQueryGeometry' thread safe 2020-01-20 16:44:58 +01:00
Daniel Trstenjak
ddb72691bc OcclusionQueryNode: fix resetting to default query geometry
When the query geometry gets reset to its default then its
vertices have to be updated by the bounding box dimensions of
the current children of the OcclusionQueryNode.
2020-01-20 16:44:48 +01:00
Daniel Trstenjak
817d92b703 OcclusionQueryNode: fix use case of user defined query geometry
The user defined query geometry handling has been broken in several ways.

The previous way of defining a query geometry was using the non const
`getQueryGeometry` method and overriding its members. But then
`OcclusionQueryNode` wasn't aware of the geometry change and couldn't
internally handle it correctly.

The `computeBound` method never considered a user defined query geometry and
always just overrode the vertices of the geometry.

The member `_validQueryGeometry` wasn't correctly set.

This change should fix all this issues by introducing a small backward
compatibility break. The non const `getQueryGeometry` method is removed
forcing the user to use the `setQueryGeometry` method. But then `OcclusionQueryNode`
is aware of the user defined query geometry and can handle it correctly.
2020-01-20 16:42:38 +01:00
Daniel Trstenjak
8fb5ba4a3f OcclusionQueryNode: reset the test result of the invalid geometry
There're cases that the occlusion test result has been retrieved
after the query geometry has been changed, it's the result of the
geometry before the change.
2020-01-20 16:24:24 +01:00
Daniel Trstenjak
3ef5d2b331 OcclusionQueryNode: ensure a valid query geometry
If the query geometry is invalid then don't do any occlusion queries and
never traverse the subgraphs.
2020-01-20 16:24:08 +01:00
Daniel Trstenjak
c64b94da2e OcclusionQueryNode: ensure a consistent value for '_passed' 2020-01-20 16:21:34 +01:00
Robert Osfield
19cf8b46c3 Introduced a QueryGeometry::getQueryResult(const osg::Camera*) method as a more informative replacedment for QueryGeometry::getNumPixels(). 2020-01-20 16:15:18 +01:00
OpenSceneGraph git repository
2568d1ac79 Merge pull request #900 from dedowsdi/fix_particle_rotation
Fix particle rotation.
2020-01-20 10:37:12 +00:00
dedowsdi
84ee98d9c4 Fix particle rotation. 2020-01-17 18:52:55 +08:00
Robert Osfield
49921bf300 Updated ChangeLog 2020-01-17 09:28:09 +00:00
Robert Osfield
b063f510c1 Moved setting of isftream locale to Model::readOBJ(..) and Model::readMTL(..). 2020-01-17 09:13:27 +00:00
Robert Osfield
396cfca1ae Added explict setting of local to classic to avoid local platform settings affecting parsing 2020-01-17 08:54:52 +00:00
Robert Osfield
aebc71a113 Updated README.md for 3.6.5-rc1 2020-01-14 16:32:29 +00:00
Robert Osfield
d8896f4bcb Updated ChangeLog and set rc candidate 1 for 3.6.5-rc1 2020-01-14 16:30:14 +00:00
Robert Osfield
b2b6ee952b Fixed warnings 2020-01-14 16:29:07 +00:00
Robert Osfield
fbe4e1cf2f Fixed build warning due to auto_ptr<> 2020-01-14 14:58:06 +00:00
Robert Osfield
2b9c501e18 Fixed workaround for invalid indices 2020-01-14 14:42:01 +00:00
OpenSceneGraph git repository
3930621edc Merge pull request #895 from openscenegraph/CurrentThreadId
Added commment explaining that OpenThreads::Thread::CurrentThread() r…
2020-01-13 14:14:48 +00:00
Robert Osfield
9305485a11 Added commment explaining that OpenThreads::Thread::CurrentThread() return NULL on non OpenThreads thread. 2020-01-13 14:12:54 +00:00
Robert Osfield
9e75926338 Added support for using CurrentCodePage functionality with osgText::String
To the DXF plugin added Option string support for using CurrentCodePage|WidePage, UTF8, UTF16, UTF32 and FontFile=filename
2020-01-13 13:41:37 +00:00
Robert Osfield
d969516595 Added encoding and font setting to dxfText as a first step towards making these user controllable to enble handling of non default settings 2020-01-13 09:58:47 +00:00
Robert Osfield
457d12d9b2 Added creation of image directories when required 2020-01-11 14:39:46 +00:00
Robert Osfield
61c7ee76c5 Fixed handling of _autoScaleTransitionWidthRatio<=0.0 2020-01-10 10:12:13 +00:00
Robert Osfield
605821e655 Implemented TextBase::compileGLObjects() with handling of VAO/VBOs to address bugs associated with VAO usage of Text. 2020-01-07 11:12:18 +00:00
Robert Osfield
d1ff16614c Added Thread::CurrentThreadId() method to wrap up thread id functionality in a more platform appropriate way. 2020-01-06 18:39:51 +00:00
OpenSceneGraph git repository
8551f25da0 Merge pull request #887 from limbolily/patch-1
Fix navagation error about Android GLES2 example.
2020-01-06 10:27:18 +00:00
limbolily
315031fa3b Fix navagation error about Android GLES2 example.
Android GLES2 example use event queue without initializing window rectangle with graphics context,that produce navigation error.
2020-01-06 14:48:34 +08:00
Michael Danilov
f4fe1e5cec Fix #877 "Shift key stuck if both shifts switch keymap"
Adapted the patch from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=687332
2019-12-23 15:07:14 +00:00
Robert Osfield
7e8665308d Adopted CMake's FindDCMTK.cmake variables 2019-12-23 14:53:17 +00:00
OpenSceneGraph git repository
c50b699992 Merge pull request #874 from blobfish/occt7.4
Occt7.4
2019-12-22 12:29:47 +00:00
blobfish
cd5740e98f Plugins: OpenCasCade: Adding 'std' prefix where needed. See Following.
Prior to 7.4, occt had a 'using namespace std' in a header file that
was polluting dependent projects. They have since fixed it and so these
changes are required.
2019-12-19 12:41:56 -05:00
blobfish
023bfb8bbb Plugins: Cmake: OpenCasCade: Changing header used for include directory search. See Following.
BRepMesh.hxx is gone in occt 7.4. Now searching for Standard_Version.hxx, which should be more consistent.
2019-12-19 10:16:09 -05:00
Robert Osfield
c5ff9e63df Added classic locale setting to avoid local setting of locale affecting the GLSL code generated. 2019-12-18 14:25:07 +00:00
Robert Osfield
e5e5ea6239 Updated ChangeLog 2019-12-16 17:10:39 +00:00
Robert Osfield
9ae47b921b Added automatically removal from the OjbectCache when a object or it's subgraph contain Texture that no longer have an osg::Image. 2019-12-16 16:51:16 +00:00
OpenSceneGraph git repository
994b066329 Merge pull request #871 from LaurensVoerman/commit_tgaFix
fix debug compile error for ReaderWriterTGA
2019-12-16 11:54:12 +00:00
Laurens Voerman
ad82aea2e3 fix debug compile error for ReaderWriterTGA 2019-12-16 11:06:06 +01:00
OpenSceneGraph git repository
5f2a3ef76f Merge pull request #870 from eligovision/OpenSceneGraph-3.6_glext_fix
GLExtensions's isPBOSupported and isVAOSupported flags fixed
2019-12-16 09:40:30 +00:00
OpenSceneGraph git repository
2e7a7d786a Merge pull request #869 from eligovision/OpenSceneGraph-3.6_glext
Added FBO GL extensions (useful for mobile VR etc.)
2019-12-16 09:40:00 +00:00
konstantin.matveyev
67523373a9 GLExtensions's isPBOSupported and isVAOSupported flags fixed for GLES2+GLES3 configuration 2019-12-13 19:52:10 +03:00
konstantin.matveyev
f38fa9e9c3 GLExtensions's isInvalidateFramebufferSupported flag improved 2019-12-13 19:45:42 +03:00
PntAndCnt
99b2fffa7c Fontconfig should be external library.
Add Fontconfig to TARGET_LIBRARIES cause osg3::osgText target looking for
openscegraph-Fontconfig-import-targets.cmake, which doesn't exists.
2019-12-13 11:11:44 +00:00
PntAndCnt
3fbf24759f Fix a typo and invisible 3dtext in examples/osgtext.
Second text alignment is wrong when "--alignment" specified.

3D text radius is too small, only SCREEN_COORDS can be seen.

Text position should multiply radius.
2019-12-13 10:23:47 +00:00
Kent
d215b255c4 Mered fix for internalFormat 2019-12-13 10:03:52 +00:00
valid-ptr
51fee80224 glInvalidateFramebuffer added to GLExtensions 2019-12-13 12:09:06 +03:00
konstantin.matveyev
fefabb6c2b glFramebufferTexture2DMultisample added to GLExtensions 2019-12-13 12:08:37 +03:00
Dmitry Marakasov
27e3f57da2 Add FreeBSD-specific code bits for pthread_setaffinity_np support 2019-12-12 13:58:23 +00:00
Robert Osfield
56835cf821 Fix linking with Xinerama 2019-12-12 13:25:44 +00:00
OpenSceneGraph git repository
445596e59c Merge pull request #861 from aluaces/default-ffmpeg
Set ffmpeg as the default plugin for video files.
2019-12-12 13:09:33 +00:00
elsid
c0ea4c6310 Fix clang 8 & libc++ build errors
Replace operators for implicit type conversion by explicit data() method to
access implementation pointer and subscript operator to access element by
index just like in std::vector.

src/osgPlugins/tga/ReaderWriterTGA.cpp:455:22: error: use of overloaded operator '==' is ambiguous (with operand types 'SafeArray<unsigned char>' and 'long')
        if (colormap == NULL)
            ~~~~~~~~ ^  ~~~~
src/osgPlugins/tga/ReaderWriterTGA.cpp:525:16: error: use of overloaded operator '==' is ambiguous (with operand types 'SafeArray<unsigned char>' and 'long')
    if (buffer == NULL || linebuf == NULL)
        ~~~~~~ ^  ~~~~
src/osgPlugins/tga/ReaderWriterTGA.cpp:525:35: error: use of overloaded operator '==' is ambiguous (with operand types 'SafeArray<unsigned char>' and 'long')
    if (buffer == NULL || linebuf == NULL)
                          ~~~~~~~ ^  ~~~~
src/osgPlugins/tga/ReaderWriterTGA.cpp:548:30: error: use of overloaded operator '==' is ambiguous (with operand types 'SafeArray<unsigned char>' and 'long')
            if (formattedMap == NULL)
                ~~~~~~~~~~~~ ^  ~~~~
src/osgPlugins/tga/ReaderWriterTGA.cpp:574:40: error: use of overloaded operator '[]' is ambiguous (with operand types 'SafeArray<unsigned char>' and 'int')
                        index = linebuf[x];
                                ~~~~~~~^~
src/osgPlugins/tga/ReaderWriterTGA.cpp:577:50: error: use of overloaded operator '+' is ambiguous (with operand types 'SafeArray<unsigned char>' and 'int')
                        index = getInt16(linebuf + x * 2);
                                         ~~~~~~~ ^ ~~~~~
src/osgPlugins/tga/ReaderWriterTGA.cpp:580:50: error: use of overloaded operator '+' is ambiguous (with operand types 'SafeArray<unsigned char>' and 'int')
                        index = getInt24(linebuf + x * 3);
                                         ~~~~~~~ ^ ~~~~~
src/osgPlugins/tga/ReaderWriterTGA.cpp:583:50: error: use of overloaded operator '+' is ambiguous (with operand types 'SafeArray<unsigned char>' and 'int')
                        index = getInt32(linebuf + x * 4);
                                         ~~~~~~~ ^ ~~~~~
src/osgPlugins/tga/ReaderWriterTGA.cpp:592:72: error: use of overloaded operator '+' is ambiguous (with operand types 'SafeArray<unsigned char>' and 'int')
                        (dest + adjustedX * format)[i] = (formattedMap + index * format)[i];
                                                          ~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~
src/osgPlugins/tga/ReaderWriterTGA.cpp:626:30: error: use of overloaded operator '==' is ambiguous (with operand types 'SafeArray<unsigned char>' and 'long')
            if (formattedMap == NULL)
                ~~~~~~~~~~~~ ^  ~~~~
src/osgPlugins/tga/ReaderWriterTGA.cpp:642:21: error: use of overloaded operator '==' is ambiguous (with operand types 'SafeArray<unsigned char>' and 'long')
            if (buf == NULL)
                ~~~ ^  ~~~~
src/osgPlugins/tga/ReaderWriterTGA.cpp:664:44: error: use of overloaded operator '[]' is ambiguous (with operand types 'SafeArray<unsigned char>' and 'int')
                            index = linebuf[x];
                                    ~~~~~~~^~
src/osgPlugins/tga/ReaderWriterTGA.cpp:667:54: error: use of overloaded operator '+' is ambiguous (with operand types 'SafeArray<unsigned char>' and 'int')
                            index = getInt16(linebuf + x * 2);
                                             ~~~~~~~ ^ ~~~~~
src/osgPlugins/tga/ReaderWriterTGA.cpp:670:54: error: use of overloaded operator '+' is ambiguous (with operand types 'SafeArray<unsigned char>' and 'int')
                            index = getInt24(linebuf + x * 3);
                                             ~~~~~~~ ^ ~~~~~
src/osgPlugins/tga/ReaderWriterTGA.cpp:673:54: error: use of overloaded operator '+' is ambiguous (with operand types 'SafeArray<unsigned char>' and 'int')
                            index = getInt32(linebuf + x * 4);
                                             ~~~~~~~ ^ ~~~~~
src/osgPlugins/tga/ReaderWriterTGA.cpp:688:76: error: use of overloaded operator '+' is ambiguous (with operand types 'SafeArray<unsigned char>' and 'int')
                            (dest + adjustedX * format)[i] = (formattedMap + index * format)[i];
                                                              ~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~
src/osgPlugins/tga/ReaderWriterTGA.cpp:708:21: error: use of overloaded operator '==' is ambiguous (with operand types 'SafeArray<unsigned char>' and 'long')
            if (buf == NULL)
                ~~~ ^  ~~~~
17 errors generated.
2019-12-12 11:29:41 +00:00
OpenSceneGraph git repository
ddea94b41c Fixed indentation, replacing tabs with spaces 2019-12-12 11:13:49 +00:00
Tim Moore
5f1e33fcb3 Fix bug in matrix transpose() and transpose3x3
The diagonal elements were not copied from the source matrix.
2019-12-12 10:40:41 +00:00
flashk
46e17699b3 Support reading RGB float DDS images
The DDS plugin is not able to load floating point RGB images saved out by itself. There doesn't appear to be a fourcc code for RGB float/half-float data, so I added the appropriate entries to the RGBFormat table so the images can be loaded properly.
2019-12-12 10:38:40 +00:00
OpenSceneGraph git repository
38807c4bb8 Merge pull request #851 from LaurensVoerman/submitCpSubImg
fix copySubImage crash on compressed files
2019-12-12 10:08:32 +00:00
DCFennell
987521ba9c GL_CLAMP_VERTEX_COLOR and GL_CLAMP_FRAGMENT_COLOR deprecated in GL core profile according to OpenGL 4.5 specification. 2019-12-12 09:40:02 +00:00
Johannes Pabst
6776cc2c63 Fix: LuaCallbackObject could form circular references to LuaScriptEngine that prevented its destruction. Destruction of LuaScriptEngine now disarms all callbacks into Lua. 2019-12-12 09:24:19 +00:00
Riccardo Corsi
3fe2e5a9e0 Fbx Plugin: added plugin option to set the target axis system. Default left to OpenGL. 2019-12-12 09:19:59 +00:00
grdowns
0d94d8e5a6 Add vcpkg installation instructions 2019-12-12 09:14:26 +00:00
OpenSceneGraph git repository
c8e283cfe9 Merge pull request #837 from LaurensVoerman/carbonFix
fix apple carbon reference
2019-12-11 17:51:02 +00:00
OpenSceneGraph git repository
b1314c0fb8 Merge pull request #833 from cj-mcdonald/osga-fix
Update ReaderWriterOSGA.cpp
2019-12-11 17:07:27 +00:00
Guilhem Saurel
a86b90ca4a fix dae readme 2019-12-11 17:01:02 +00:00
OpenSceneGraph git repository
bc3372fda0 Merge pull request #828 from eligovision/OpenSceneGraph-3.6_ios_build_fix
Fix build iOS: when using Toolchain or building with Makefiles (not X…
2019-12-11 16:58:50 +00:00
OpenSceneGraph git repository
6477397b95 Merge pull request #822 from mp3butcher/patch-32
optimize indexed color DDS conversion
2019-12-11 16:47:44 +00:00
Alberto Luaces
8f6eff9de5 Set ffmpeg as the default plugin for video files.
As xine is not used anymore, there is no plugin in charge of loading
video files, and osgmovie and other programs are not able to open
them.

If ffmpeg is present, it is registered for opening video files.
2019-12-04 22:16:25 +01:00
Laurens Voerman
c4e7a07367 fix copySubImage crash on compressed files 2019-11-01 16:45:16 +01:00
Laurens Voerman
23b7c4d47d fix apple carbon reference 2019-09-11 10:22:16 +02:00
Colin McDonald
a9900712a4 Update ReaderWriterOSGA.cpp
Fix typo in osga archives which stops node files working
2019-09-02 17:43:38 +01:00
Konstantin S. Matveyev
6774f77779 Fix build iOS: when using Toolchain or building with Makefiles (not Xcode) 2019-08-23 18:35:49 +03:00
Julien Valentin
5516f86f9e use memcpy instead of union 2019-08-22 18:16:43 +02:00
Julien Valentin
a9546da368 optimize conversion with a union 2019-08-22 18:15:46 +02:00
Robert Osfield
415925b024 Removed exlict keyword to address build problems with VS older than 2015. 2019-08-22 14:50:56 +01:00
Remo E
30aae63c3b Debugging: Hint to debug LoadLibrary issues
This helps to debug loading dynamic libraries in an environment without implemented "dlopen". For example emscripten with static compiled OSG.
2019-08-22 13:48:01 +01:00
Robert Osfield
694b1c3d32 Merge branch 'OpenSceneGraph-3.6' of https://github.com/openscenegraph/OpenSceneGraph into OpenSceneGraph-3.6 2019-08-17 20:04:38 +01:00
OpenSceneGraph git repository
a2436fa8b5 Merge pull request #820 from Capostrophic/dds
DDS plugin: add support for DDPF_PALETTEINDEXED8 pixel format reading
2019-08-17 20:04:30 +01:00
Björn Blissing
64d9b51f91 Fixed spelling error in warning message 2019-08-17 19:50:59 +01:00
capostrophic
a3b507bb01 Fix memory leaks 2019-08-17 15:28:09 +03:00
capostrophic
cbac09902d Add support for DDPF_PALETTEINDEXED8 pixel format reading 2019-08-17 04:15:23 +03:00
Robert Osfield
515a0bbe65 Added TKXCAF to find package list 2019-08-16 10:27:28 +01:00
Julien Valentin
0c142215b9 remove return of local pointer 2019-08-16 10:15:46 +01:00
OpenSceneGraph git repository
dcc6dce8e3 Merge pull request #818 from mp3butcher/patch-31
fix comment block CMake syntax
2019-08-16 09:35:00 +01:00
Julien Valentin
7b3d1dff25 fix cmake block comment syntax 2019-08-15 20:46:52 +02:00
Julien Valentin
842b334803 remove unproperly parsed CMake comment
https://github.com/openscenegraph/OpenSceneGraph/issues/812
2019-08-15 20:27:05 +02:00
OpenSceneGraph git repository
8f5695eafb Merge pull request #808 from 640kb/OpenSceneGraph-3.6
las plugin: fix linking against static boost library under windows
2019-08-07 10:56:59 +01:00
Daniel Wendt
0a704161fe las plugin: fix linking against static boost library under windows
Signed-off-by: Daniel Wendt <daniel.wendt@linux.com>
2019-08-07 10:36:03 +02:00
Robert Osfield
149c04b0df Added a _fontFallback to TextBase to cache any fallback font (usually DefaultFont) that is used when the Textbase::_font is null. 2019-07-31 14:11:59 +01:00
Robert Osfield
92abaca210 Replaced GL_QUADS usage with GL_TRIANGLE_STRIP 2019-07-29 13:01:00 +01:00
Robert Osfield
0e5bb43841 Refactored the mesh setup to use GL_TRIANGLE_STIP instead of GL_QUADS 2019-07-29 12:30:41 +01:00
Robert Osfield
b3808ef89c Updated version to 3.6.5 2019-07-29 09:59:57 +01:00
OpenSceneGraph git repository
99847c3ef2 Merge pull request #804 from eligovision/OpenSceneGraph-3.6_GLQUADS
[*] ParticleSystem: Use GL_TRIANGLES instead if GL_QUADS when GL{1,2}…
2019-07-29 08:57:56 +01:00
Konstantin S. Matveyev
0a6bea870c [*] ParticleSystem: Use GL_TRIANGLES instead if GL_QUADS when GL{1,2} or GLES1 are unavailable 2019-07-26 21:26:31 +03:00
OpenSceneGraph git repository
312f640a4a Merge pull request #802 from eligovision/OpenSceneGraph-3.6_osgtext_fc
OSG_TEXT_USE_FONTCONFIG cmake option added: Set to ON to enable attem…
2019-07-26 12:54:16 +01:00
konstantin.matveyev
2b0105f875 OSG_TEXT_USE_FONTCONFIG additional check needed 2019-07-26 14:40:47 +03:00
konstantin.matveyev
b0c89b137d OSG_TEXT_USE_FONTCONFIG cmake option added: Set to ON to enable attempt to use FontConfig in osgText; Disabled by default for iOS and Android 2019-07-26 14:09:36 +03:00
Robert Osfield
b2daa32420 UPdated for 3.6.3-rc9 2019-07-25 15:10:36 +01:00
Robert Osfield
bf208e1d10 Changed the #extension enable 2019-07-25 14:58:17 +01:00
Robert Osfield
24d61c2df0 Change the DefaultFont so that it's managemed via the ObjectCache to enabl it to be release and cleared in a central manner.
Added call to Registry::releaseGLObjects() to osgViewer/Renderer.cpp to enable automatic clean up of objects in the ObjectCache.
2019-07-25 14:10:01 +01:00
Robert Osfield
e6f6de640a Added readObject() implementations 2019-07-25 12:48:21 +01:00
Robert Osfield
00679c7631 Added ReaderWriterOBJ::readObject(..) implementations to address issue with using osgconv 2019-07-25 10:39:34 +01:00
Robert Osfield
4e126469fc Updates for 3.6.4-rc8 2019-07-22 19:22:16 +01:00
Robert Osfield
ccbc632afc Added handling of iOS and Android to make sure FontConfig is only used for Desktop builds 2019-07-22 17:20:10 +01:00
Robert Osfield
060a641c2b Updated for rc7 2019-07-19 09:20:50 +01:00
OpenSceneGraph git repository
cd124228fd Merge pull request #797 from wangii/OpenSceneGraph-3.6
fix u64 and i64 allocation, setArray bug
2019-07-19 09:10:02 +01:00
Linan Wang
4ad34877d2 fix typo 2019-07-19 14:06:20 +08:00
Linan Wang
2a8b760833 fix u64 and i64 allocation, setArray bug 2019-07-19 13:28:25 +08:00
Robert Osfield
8dea265a91 Fixed indentation 2019-07-18 14:08:41 +01:00
Long Huan
7ec8b65ec4 Add OutputTextureFiles Option
Add OutputTextureFiles Option support Write out the texture images to file
2019-07-18 14:00:11 +01:00
Long Huan
c6c49c3745 Update OBJWriterNodeVisitor.cpp 2019-07-18 13:51:10 +01:00
Long Huan
acac960227 fix obj-Plugin export texture file
Fix obj-plugin to support export texture file
2019-07-18 13:50:56 +01:00
Robert Osfield
da6b4df00a Added handling of zero radius models 2019-07-18 12:18:04 +01:00
Robert Osfield
7f370bdfc6 Removed references OpenVRML plugin 2019-07-18 11:16:49 +01:00
Robert Osfield
587fd6a022 Removed vrml plugin from build as OpenVRML plugin relies on no longer supported functionality 2019-07-18 11:16:49 +01:00
Robert Osfield
730e6ad8f5 Added calls to curl_global_init and curl_global_cleanup to improve the robustness of threaded curl plugin usage 2019-07-18 10:34:53 +01:00
Robert Osfield
a8017cb807 Updated for rc6 2019-07-16 13:50:02 +01:00
OpenSceneGraph git repository
ac6b082963 Merge pull request #789 from rhabacker/OpenSceneGraph-3.6
cmake: Add find_package module for fontconfig
2019-07-16 11:53:24 +01:00
OpenSceneGraph git repository
61957024fc Merge pull request #791 from aluaces/mingw-osg_windowing_system
Avoid that mingw cross-compilation choosing X11 as the windowing system.
2019-07-16 11:32:10 +01:00
Alberto Luaces
117fd42efc Avoid that mingw cross-compilation choosing X11 as the windowing system.
I have moved the PROJECT stanza before the conditionals, because
otherwise expressions like IF(MINGW) always fail.
2019-07-16 11:08:25 +02:00
Ralf Habacker
387e66911b cmake: Add summary information to get an idea of what dependencies might be missing 2019-07-15 19:00:55 +02:00
Ralf Habacker
dc9f6f2751 cmake: Added find_package module for fontconfig which is not available with cmake < 3.14
This file has been taken from cmake 3.14
2019-07-15 19:00:25 +02:00
Robert Osfield
8a4cdcf264 Updated for 3.6.4-rc5 2019-07-15 17:06:51 +01:00
Robert Osfield
02d91a3eea Adopted the matrix transformation code from Text 2019-07-15 16:16:45 +01:00
Robert Osfield
59f417f1e0 Added test of picking 2019-07-15 16:13:57 +01:00
Robert Osfield
9ad7ae5524 Cuietened down the reporting of failure to find fontconfig 2019-07-15 15:05:05 +01:00
OpenSceneGraph git repository
0c7fda710c Merge pull request #788 from rhabacker/3.6-obj-plugin-fixes
3.6 obj plugin fixes
2019-07-15 14:11:11 +01:00
Ralf Habacker
cbf5b14f61 obj plugin: Fix bug not adding first vertex index on writing GL_LINExxx array types 2019-07-15 14:39:02 +02:00
Ralf Habacker
2e33cf0abc obj plugin: Fix not writing material shininess 2019-07-15 14:39:02 +02:00
Ralf Habacker
361ea5d15d obj plugin: add option "NsIfNotPresent=" for setting the specular exponent of a material if not present 2019-07-15 14:39:02 +02:00
Ralf Habacker
a3b2ac63b3 obj plugin: Fix bug not using specular color (Ks) for illumination mode > 2
See paragraph "Illumination models" at http://paulbourke.net/dataformats/mtl/ for details.
2019-07-15 14:26:31 +02:00
OpenSceneGraph git repository
3f9ab5689c Merge pull request #786 from rhabacker/OpenSceneGraph-3.6
Fix 'Incorrect default location for true type fonts on openSUSE'
2019-07-15 11:14:47 +01:00
Ralf Habacker
af5a794a82 Fix 'Incorrect default location for true type fonts on openSUSE'
https://github.com/openscenegraph/OpenSceneGraph/issues/778
2019-07-15 11:08:31 +02:00
Robert Osfield
faa2b1d964 Added check against any empty _segments to avoid undefined behaviour 2019-07-12 17:00:20 +01:00
Robert Osfield
ab95a79540 Removed debug info for constructor and destructors 2019-07-12 16:16:43 +01:00
Robert Osfield
079cf6c090 Added FrameBufferAttachment::resizeGLObjectBuffers(..) and releaseGLObjects(..) methods 2019-07-12 16:09:12 +01:00
StefanBruens
7dbcb4b7d3 Fix wxWidgets COMPONENTS specification, deprecated usage broken with CMake 3.14
Current FindWxWidgets.cmake allows to specify OPTIONAL components, unfortunately
this broke the (deprecated) use of wxWidgets_USE_LIBS.

Fixes: #779
2019-07-03 07:24:03 +01:00
Robert Osfield
634bd7f12d Updated ChangeLog for rc4 2019-07-02 20:21:45 +01:00
Robert Osfield
384cc25380 Updated SO number to refect change to the Drawable header inline method status 2019-07-02 20:21:05 +01:00
Robert Osfield
b43a59aa5d Updated in prep for 3.6.4-rc4 2019-07-02 20:19:05 +01:00
Colin McDonald
e135a85c1a Trivial change to src/osgSim/LineOfSight.cpp to quieten down an info message in DatabaseCacheReadCallback::readNodeFile. 2019-07-01 16:15:21 +01:00
Robert Osfield
2f914506e9 Updated release candidate number to 4 in prep for 3.6.4-rc4 release. 2019-07-01 16:12:53 +01:00
Robert Osfield
e5c951f5a3 Removed stray tab 2019-07-01 15:50:20 +01:00
jimcamel
9566fb7acf Fixed bug where FFmpeg Image Stream would stop if paused for more than 10 seconds
The FFmpeg image stream class uses a 10 second timeout between frames to determine if the stream is dead and if so closes it. However, the timeout is determined using the variable lastUpdateTS which stores the last time the publishNewFrame function was called, and if the video has been playing and then is paused for longer than 10 seconds, when it is unpaused this timeout will fire and the stream will be closed, stopping the video playing beyond what has been buffered.

To stop this timeout from happening before the video starts playing, the timeout checks to see if the lastUpdateTS > 0 (at initialization it is set to 0). In this fix, we simply set the value of lastUpdateTS to 0 when the video is unpaused, this will force the check to skip on unpause, and from then on lastUpdateTS will have the correct value again.

The lastUpdateTS variable is private and only used for this one function, so there should be no side effects from the change.
2019-07-01 15:50:14 +01:00
Riccardo Corsi
511f7be394 Bugfix due to copy-paste typo which prevented multi uv channel mesh to be imported correctly. 2019-07-01 15:11:23 +01:00
Robert Osfield
56e2a03378 Fixed layout 2019-07-01 13:43:29 +01:00
Robert Osfield
5fc917881d Merge branch 'patch-27' of https://github.com/mp3butcher/OpenSceneGraph into patch-27 2019-07-01 13:42:33 +01:00
Alexey Galitsyn
00e2930fb7 Fix not checking num lock state when remapping keypad keys on Windows.
Num lock state was never checked during remapping keypad keys on Windows.
Now when num lock is active, keypad numeric keys and keypad delimeter key
should work as expected (return KEY_KP_0 to KEY_KP_9 and KEY_KP_Decimal
respectivly).
2019-07-01 13:39:33 +01:00
Robert Osfield
fe9c235806 Restructed the setting of the default osgDB::Options so it doesn't override the ObjectCacheHint setting when a user specified osgDB::Options object is passed in. 2019-07-01 12:56:36 +01:00
Robert Osfield
8d505e80a9 Merge branch 'OpenSceneGraph-3.6_vas' of https://github.com/eligovision/OpenSceneGraph into OpenSceneGraph-3.6_vas 2019-07-01 12:33:21 +01:00
Robert Osfield
b6cb11b655 Couldn't resolve warnings coming from the FBX headers so had to suppress warnings. 2019-07-01 12:18:21 +01:00
Laurens Voerman
4b6d9287bc replaced "if (apm || !apm->valid())" 2019-06-14 15:46:55 +01:00
Laurens Voerman
b41c5bde96 fix typo in header guard. 2019-06-14 15:38:38 +01:00
Laurens Voerman
2ac97b5ece fix typo in ReaderWriterFBX: writObject -> writeObject 2019-06-14 15:36:18 +01:00
OpenSceneGraph git repository
21c0affe66 Merge pull request #760 from LaurensVoerman/readObject
implement readObject for all relevant readerWriters
2019-06-14 15:28:46 +01:00
OpenSceneGraph git repository
68fc6ca610 Merge pull request #759 from AnyOldName3/more-tga
Various TGA improvements
2019-06-14 15:01:15 +01:00
OpenSceneGraph git repository
52edc4af8d Merge pull request #758 from LaurensVoerman/osgt_indentation
fix indentation for osgt files for windows dynamic library build.
2019-06-14 14:32:31 +01:00
OpenSceneGraph git repository
c1757aadb4 Merge pull request #757 from LaurensVoerman/rendererNoRefCount
fix compile error if OSGUTIL_RENDERBACKEND_USE_REF_PTR not defined in include/osgUtil/RenderLeaf
2019-06-14 14:29:32 +01:00
Julien Valentin
cfd190a9fa update traversedebug preventing traversal to disable OQN 2019-06-08 01:17:21 +02:00
Julien Valentin
5311d6fb6b add enable check in traverseQuery 2019-05-31 15:27:18 +02:00
Konstantin S. Matveyev
e31afbf78a typo fix 2019-05-15 14:35:39 +03:00
valid-ptr
be6bc39016 VertexArrayState's lazy disabling of vertex attributes mechanism major fix: _vertexAttribArrays must be 'shared' 2019-05-15 14:32:09 +03:00
Laurens Voerman
38727ed4b4 implement readObject for all relevant readerWriters 2019-05-14 14:25:30 +02:00
AnyOldName3
8491fd780d Add support for Targa type 3 and 11 images (greyscale) 2019-05-13 21:56:07 +01:00
Laurens Voerman
3ccdc66717 fix indentation for osgt files for windows dynamic library build. 2019-05-13 17:25:29 +02:00
Laurens Voerman
2f71c55da9 fix compile error if OSGUTIL_RENDERBACKEND_USE_REF_PTR not defined in include/osgUtil/RenderLeaf 2019-05-13 17:02:53 +02:00
AnyOldName3
7b6135f0f7 Avoid wasting memory loading optional TGA fields as RLE image data 2019-05-11 00:00:41 +01:00
AnyOldName3
05e896af7e Add support for type 9 (colour mapped, compressed) TGA images. 2019-05-10 00:04:49 +01:00
AnyOldName3
33bf30cd8c Check TGA footer if present to see if attribute channel contains alpha data 2019-05-10 00:04:08 +01:00
Robert Osfield
fd014e3b52 Merged ELSEIF fix from master 2019-05-08 10:17:06 +01:00
Laurens Voerman
3f0c1daaa2 add missing E to ELSIF
# Conflicts:
#	src/osgViewer/CMakeLists.txt
2019-05-08 09:50:17 +01:00
AnyOldName3
c9fc6e0f79 Consistently check for failed memory allocation 2019-05-08 00:59:40 +01:00
AnyOldName3
348fbfe410 Switch to using safe buffers (fixing a memory leak) 2019-05-08 00:56:42 +01:00
AnyOldName3
47ec2c7951 Cleanup TGA header interpretation
* Read the colour map `First Entry Index` field. If non-zero, error out as the format specification is vague as to what it does and different readers interpret it differently.
* Rename the variable that holds the colour map entry size as the existing name could be misinterpreted as the size of the pointer, not the thing pointed to.
* Handle images reporting themselves as 15 bits per pixel in the same way as Truevision's example code.
2019-05-04 01:19:31 +01:00
Robert Osfield
6ea8ebf25a Fixed indentation 2019-04-26 10:46:04 +01:00
Wei Lisi
2b65555d5f remove tabs 2019-04-26 10:44:04 +01:00
flashk
2439679b0c Update fbxRMesh.cpp 2019-04-26 10:43:04 +01:00
Wei Lisi
0cbf839425 clean up 2019-04-26 10:41:05 +01:00
Wei Lisi
82cae6daf4 fix fbx hierarchy issue 2019-04-26 10:41:05 +01:00
Derek Quam
6767ff540b Fix two bugs introduced when removing the Geode visitor from the FBX
exporter.

In the Geometry visitor, use getNodePath to check if the Geometry node
is root instead of getNumParents.

Reset the state inside buildFaces to prevent duplication when a
Group is inside of Group.
2019-04-26 10:30:24 +01:00
Derek Quam
69ebfecfcc Fix duplicate geometries in FBX export.
The fix to allow the export of orphaned Geometry nodes accidentally
duplicated those geometry nodes in 'normal' scene trees. This commit
refactors the code to rely on the visitor to traverse the Geometry as
opposed to traversing the Geometry in the Geode visit and the Geometry
visit.
2019-04-26 10:30:15 +01:00
OpenSceneGraph git repository
3834172342 Merge pull request #745 from eligovision/OpenSceneGraph-3.6_cmake
CMake: OSG_WINDOWING_SYSTEM fixed
2019-04-26 09:36:51 +01:00
Konstantin S. Matveyev
036bb7b472 CMake: Win32 option added to OSG_WINDOWING_SYSTEM 2019-04-14 00:47:36 +03:00
valid-ptr
b5dff94107 CMake: OSG_WINDOWING_SYSTEM fixed; FORCE flag removed 2019-04-14 00:08:09 +03:00
Robert Osfield
1784381dc7 cMerge branch 'OpenSceneGraph-3.6' of https://github.com/openscenegraph/OpenSceneGraph into OpenSceneGraph-3.6 2019-04-12 13:57:35 +01:00
Robert Osfield
9e18a7542b Added ability to set which tree rendering techniques to build (via --featuers bitmask command line) and
output scene to using -o outputfilename.extension command line.
2019-04-12 13:55:39 +01:00
OpenSceneGraph git repository
1c6fd4da9b Merge pull request #737 from eligovision/OpenSceneGraph-3.6_android
osgDB::DynamicLibrary: local lib loading on Android fixed
2019-04-11 12:42:22 +01:00
Konstantin S. Matveyev
e1b3c78013 osgDB::DynamicLibrary: local lib loading on Android fixed 2019-03-29 16:32:58 +03:00
Jeongseok Lee
f263ad29db Update CMakeModules/FindCOLLADA.cmake
Keeping old style operator to align with OSG CMake 2.8.0 support.

Co-Authored-By: eknabe <44489094+eknabe@users.noreply.github.com>
2019-03-26 08:05:06 +00:00
Robert Osfield
dd32ee2945 Added basic load and compile stats collection enabled by --stats command line. 2019-03-25 14:09:04 +00:00
Robert Osfield
0b5cb65cdd Added a call to the CullSetting::readCommnadLine(..) to make sure the --NO_CULLING and --VIEW_FRUSTUM, --VIEW_FRUSTUM_SIDES command line parameters are honoured 2019-03-25 12:42:28 +00:00
Robert Osfield
a8e78fde99 Added --NO_CULLING, --VIEW_FRSUTUM and --VIEW_FRUSTUM_SIDES/--vfs command line options for setting the Camera CullingMode value 2019-03-25 12:40:41 +00:00
Jeongseok Lee
43b274f65c Update comments and fix cmake version check 2019-03-21 08:40:33 +00:00
OpenSceneGraph git repository
f97ea3577d Merge pull request #727 from ccochran/OpenSceneGraph-3.6
Fixes Android build for osgViewer.
2019-03-19 14:33:42 +00:00
Colin Cochran
9726617b6e Fixes osgViewer CMake build for Android.
Adds FORCE to overwrite the cached OWG_WINDOWING_SYSTEM variable.
2019-03-18 08:55:05 -06:00
Colin Cochran
997276d359 Fixes Android build for osgViewer.
Previously, cmake attempted to build cocoa windowing system source even if MAKE_SYSTEM_NAME was set to ANDROID.
2019-03-16 11:59:28 -06:00
Capostrophic
dceb353fe6 Replace redundant asCullVisitor usage with a type check 2019-03-16 12:29:39 +00:00
OpenSceneGraph git repository
d8600411bd Merge pull request #726 from Capostrophic/linearinterpolator
Override default behavior for linear vector interpolations
2019-03-16 11:30:21 +00:00
Capostrophic
066c272f7a Override default behavior for linear vector interpolations 2019-03-15 21:29:13 +03:00
Chris Djali
7ebe56291f Resolve OpenGL error caused by confusion between geometry shader implementations.
There are two types of Geometry Shaders in OpenGL. One is provided by `GL_EXT_geometry_shader4` and `GL_ARB_geometry_shader4` and requires that certain parameters are set with calls to `glProgramParameteri` before the program is linked. The other is provided by OpenGL 3.2 as a core feature and by the GLES extensions `GL_EXT_geometry_shader` and `GL_OES_geometry_shader` and requires these parameters to be set in the GLSL source itself.

The value of `isGeometryShader4Supported` is being used to determine if the `glProgramParameteri` calls should occur, so it should only be `true` when one of the extensions requiring them is present.
2019-03-14 13:51:44 +00:00
flashk
c89a7fe67c Update StackedTransform.cpp 2019-03-14 11:25:11 +00:00
Capostrophic
b14bb21801 Avoid unnecessary matrix type conversion in osgParticle 2019-03-14 10:47:08 +00:00
Robert Osfield
37eae8c719 Removed the optional code path hack 2019-03-14 10:46:59 +00:00
Capostrophic
12b298130a Add OSG_USE_FLOAT_QUAT build option to use single precision quaternions 2019-03-14 10:46:42 +00:00
OpenSceneGraph git repository
c548289ac1 Merge pull request #724 from AnyOldName3/more-gitignore
Add missing files to .gitignore
2019-03-14 09:39:40 +00:00
AnyOldName3
2ebde09aff Add Visual Studio cache/options directory to .gitignore 2019-03-13 23:13:41 +00:00
AnyOldName3
049f88325a Add missing documentation build files to .gitignore 2019-03-13 23:13:00 +00:00
Robert Osfield
cc68d7f151 Streamline the animation path completion message 2019-02-25 15:09:12 +00:00
Daniel Trstenjak
5770774e00 OcclusionQueryNode: reset the test result of the invalid geometry
There're cases that the occlusion test result has been retrieved
after the query geometry has been changed, it's the result of the
geometry before the change.
2019-02-25 15:08:38 +00:00
Daniel Trstenjak
5624a22fe4 OcclusionQueryNode: ensure a valid query geometry
If the query geometry is invalid then don't do any occlusion queries and
never traverse the subgraphs.
2019-02-21 17:34:26 +00:00
Björn Blissing
9905b90a18 Add search location for textures in FBX plugin
The FBX plugin may fail texture lookup even if the texture is located in
the same folder as the model file. This change tries, as a last resort,
to check if the texture filename is available in the same folder as the
model.
2019-02-20 17:19:04 +00:00
OpenSceneGraph git repository
6d5c6ad6cc Merge pull request #704 from mp3butcher/patch-24
uncomment INLINE_DRAWABLE_DRAW
2019-02-20 16:54:23 +00:00
Robert Osfield
971eba37ad Added override for broken bindings 2019-02-20 16:31:58 +00:00
Julien Valentin
43574b52c1 uncomment INLINE_DRAWABLE_DRAW 2019-01-28 01:40:35 +01:00
Robert Osfield
625c771641 Updates for 3.6.4-rc3 2019-01-26 19:36:30 +00:00
OpenSceneGraph git repository
1504a54cd8 Merge pull request #702 from mp3butcher/fix36
add MeshReindexation flag
2019-01-26 18:21:47 +00:00
Robert Osfield
0f2e9e6557 Added missing {} to fix getPassed() bug introducted by previus commit 2019-01-26 18:10:44 +00:00
Daniel Trstenjak
cd150cbe96 OcclusionQueryNode: ensure a consistent value for '_passed' 2019-01-26 17:42:20 +00:00
Robert Osfield
02d7d980a7 Introduced a QueryGeometry::getQueryResult(const osg::Camera*) method as a more informative replacedment for QueryGeometry::getNumPixels(). 2019-01-26 16:33:23 +00:00
Daniel Trstenjak
c8521068a5 OcclusionQueryNode: add resetting of queries
If there's a big view change then it might not be appropriate to wait
for '_queryFrameCount' till the next query is issued, because then
geometry might pop into the view after '_queryFrameCount'.

This is especially important for applications not having a constant
frame rate, but just issue a new frame on demand.
2019-01-26 15:22:08 +00:00
mp3butcher
832d8d5228 fix variable name 2019-01-23 17:06:04 +01:00
OpenSceneGraph git repository
bdd0be2f8f Changed member variable name to be consistent with header 2019-01-23 17:03:27 +01:00
OpenSceneGraph git repository
968a427e00 Changed the member variable to be consistent with the method name. 2019-01-23 17:03:11 +01:00
mp3butcher
b8f9249bea add a bool parameter to allow forced reindexation of a mesh 2019-01-23 17:02:53 +01:00
Robert Osfield
e2fb88e187 Commented out the reset of the _vertexArrayObject = 0 as it was break later State::resetCurrentVertexArrayStateOnMatch() calls ability to reset the State::_currentVAO when required. 2019-01-23 15:40:13 +00:00
Robert Osfield
749dc86dd3 Fixed typo 2019-01-23 08:52:11 +00:00
Robert Osfield
84bae01643 Added separate test and rest of _currentVAO to State::resetCurrentVertexArrayStateOnMatch(..) method 2019-01-22 20:21:56 +00:00
Robert Osfield
8a5d1b9f44 Changed resetCurrentVertexArrayStateOnMatch() to reset _vas tp _globalVertexArrayState and currentVAO to 0. 2019-01-21 18:15:02 +00:00
Robert Osfield
488b4854b2 Added reset of the State::CurrentVertexArrayState() to prevent the State::_vas becoming a dangling pointer when VertexArrayState objects are deleted. 2019-01-21 17:36:40 +00:00
Robert Osfield
6455159757 Added calling of releaseGLObjects() and resizeGLObjects() to the Camera DrawCallback's to enable the draw callbacks to clean up their own GL objects. 2019-01-19 16:16:53 +00:00
OpenSceneGraph git repository
2e68db5b55 Merge pull request #693 from LaurensVoerman/glObj_C4250
fix MSVC warning C4250: inherits 'X' via dominance (94x)
2019-01-17 17:24:22 +00:00
Laurens Voerman
2e29085669 fix MSVC warning C4250: inherits 'X' via dominance (94x) 2019-01-17 16:22:51 +01:00
Robert Osfield
f223fec92d Added derpecated and thread unsafe warning message to docs of ObjectCache::getgetFromObjectCache() 2019-01-14 11:56:23 +00:00
OpenSceneGraph git repository
cc3cb92ddc Merge pull request #691 from LaurensVoerman/clrObjCache
clear temp objectCache in databaseRequest
2019-01-14 10:23:05 +00:00
Robert Osfield
4dcb2bbf3c Added using to quieten VS warnings 2019-01-14 09:55:00 +00:00
Laurens Voerman
eeb13d1efc clear temp objectCache in databaseRequest 2019-01-14 10:24:30 +01:00
Robert Osfield
fe98c3d7f5 Moved resizeGLObjects/releaseGLObjects out of Referenced to avoid multiple inheritance warnings 2019-01-12 11:27:18 +00:00
Robert Osfield
46b07141e8 Added read/writeObject() entry point to FBX plugin. 2019-01-10 09:45:32 +00:00
Robert Osfield
02bfd05d6f Upated ChangeLog 2019-01-09 10:22:54 +00:00
Robert Osfield
035abfdb71 Updated for 3.6.4-rc2 2019-01-09 10:19:34 +00:00
Robert Osfield
0c99326db3 Added cmake package configuration files to gitignore 2019-01-09 09:51:21 +00:00
Robert Osfield
8103da6ef1 Replaced use of heap with use of stack created ifstream to avoid potential memory leak 2019-01-09 09:51:21 +00:00
Robert Osfield
bd83044c08 Introduced use of ref_ptr<> and private destructor to tighen up memory management and avoid users attempting to inappropriately delete TexCoordRange. 2019-01-09 09:51:21 +00:00
Robert Osfield
f6b64afdfc Fixed for crashes on exit associaciated with VAO usage and vairous niche usage cases 2019-01-08 19:32:50 +00:00
Robert Osfield
1c65815f4e Fixed crash on exit issues with osgFX, osgParticle, osgSim and the osgforest example 2019-01-07 17:46:02 +00:00
Robert Osfield
5e9be10da6 Merged changes from master 2019-01-07 10:25:13 +00:00
Robert Osfield
820532ddff Updated rc number for 3.6.4 release candidate 2019-01-04 09:22:12 +00:00
Robert Osfield
6951c44464 Updated ChangeLog and AUTHORS in prep for 3.6.4 work 2019-01-04 09:10:39 +00:00
Robert Osfield
e12049ed47 Added use of sizeof to make code a bit more flexible 2019-01-04 08:14:41 +00:00
Robert Osfield
fd47b84bd7 Restructured the clean up of arrays/primitives and GL objects 2019-01-04 08:14:33 +00:00
Robert Osfield
b7947b13f3 Changed the clean up of the GL objects on destruction so that the destructors of the arrays/primitives themselves do the release rather than have it done explictly in the destructor. This allows arrays/primitives to be shared. 2018-12-31 11:06:45 +00:00
OpenSceneGraph git repository
7a601753e0 Merge pull request #679 from mp3butcher/patch-18
setup camera Read/Draw Buffer
2018-12-20 08:46:12 +00:00
Julien Valentin
07e5480b57 setup camera Read/Draw Buffer
fix flickering shadows in SingleThread
2018-12-19 18:30:26 +01:00
Robert Osfield
ea1e832d4d Removed examples from build as it was causing travis to timeout 2018-12-14 09:14:26 +00:00
OpenSceneGraph git repository
da7bf3ff81 Fixed indentation 2018-12-13 14:10:26 +00:00
OpenSceneGraph git repository
a6fbf73f36 Merge pull request #671 from mp3butcher/patch-16
remove useless code
2018-12-13 08:31:27 +00:00
OpenSceneGraph git repository
ef8fd268de Merge pull request #672 from ccochran/OpenSceneGraph-3.6
Xcode 9/10 build fixes for OSG 3.6
2018-12-13 08:01:24 +00:00
Julien Valentin
064c39a7f3 remove dead code 2018-12-11 23:56:47 +01:00
Thomas Hogarth
5eb9ab1d75 removed ios simulator reference, adjusted readme 2018-12-10 08:23:04 -07:00
Thomas Hogarth
e8ba57b22f Improved iOS cmake support for xcode 9.4 and cmake 3.11 2018-12-10 08:22:36 -07:00
OpenSceneGraph git repository
47aa320787 Merge pull request #670 from emminizer/four-byte-utf8
osgText::String:createUTF8EncodedString() now supports 4-byte UTF-8 strings (code points over 0x100000)
2018-12-07 14:53:52 +00:00
Daniel Emminizer
3a3ddfce49 osgText::String:createUTF8EncodedString() now supports 4-byte UTF-8 strings (code points over 0x100000). 2018-12-06 14:10:14 -05:00
flashk
dc2aa77d98 Prefer FOURCC pixel format in DDS loader
I have found that certain image editing programs export DDS images with both the DDPF_FOURCC and DDPF_RGB pixel format flags. The DDS loader will give preference to the DDPF_RGB flag and try to deduce the format from the RGB bit mask values instead of using the more reliable FOURCC flag. This causes some images to not load, even though the FOURCC flag is supported.  I've modified the loader so that it checks for the DDPF_FOURCC flag first, then falls back on deducing the format from the RGB bit masks.
2018-11-23 12:36:45 +00:00
Robert Osfield
aa6cd2d7da Added, currently commented out, alias for .vsga and .vsgb to help with automatic loading a vsg plugin when .vsga and .vsgb files are encountered. 2018-11-20 14:24:24 +00:00
Robert Osfield
658fd4d19d Added support for reading and writing images 2018-11-20 14:19:37 +00:00
Robert Osfield
8b4359b77e Restructed the setting of the OSG_GL_CONTEXT_VERSION to allow script to set it's default value 2018-11-11 10:14:50 +00:00
Robert Osfield
c5d00bc223 Added make clobber target, imported in from the VSG project. 2018-11-09 11:28:57 +00:00
Robert Osfield
1eedae844e Removed 12 year old workaround that is no longer required and was causing a misleading info message "OpenGL extension '' is not supported." to be reported. 2018-11-09 11:25:16 +00:00
OpenSceneGraph git repository
e819ea9c0e Replaced tabs with spaces to fix indentation 2018-11-03 16:16:19 +00:00
flashk
15b9a493ed Fix handling of alpha values in animated gifs
The gif loader was incorrectly setting pixels as transparent in certain animated gifs. It was ignoring the disposal method value in the extension block and always overwriting the alpha value in each frame. It is common for some animated gifs to set the disposal method so that the previous alpha value is retained. This patch modifies the loader to respect the disposal method flag.
2018-11-03 16:16:10 +00:00
Robert Osfield
0341d6f873 Removed reprecated C++ usage 2018-11-01 09:13:43 +00:00
Emil Knabe
3577fd9d90 Added support for FBX 2019 2018-10-29 08:25:18 +00:00
OpenSceneGraph git repository
a47294a580 Merge pull request #649 from LaurensVoerman/3.6-dae
3.6 dae
2018-10-23 08:44:55 +01:00
flashk
452802b168 Update daeRMaterials.cpp 2018-10-22 09:17:37 +02:00
flashk
5a3f2e287c Update daeReader.h 2018-10-22 09:17:37 +02:00
Robert Osfield
bf5a88870f Added check under Windows for a concatinated path that exceeds the MAX_PATH so that it isn't used for file IO operations that could lead to undefined behavior
https://github.com/openscenegraph/OpenSceneGraph/issues/634
2018-10-17 15:55:10 +01:00
flashk
8af46a6e98 Update ReaderWriterDAE.cpp 2018-10-17 15:54:54 +01:00
flashk
56617a4bfb Fix crash in Collada loader
The collada loader would crash when processing effects that didn't have a technique defined.
2018-10-12 07:38:59 +01:00
Boris Pek
7eaceb0baa fix builds with case sensitive includes
Tested during cross-compilation for MS Windows using MinGW.
2018-10-10 18:26:43 +01:00
Robert Osfield
8feae585e1 Fixed buld 2018-10-10 13:10:55 +01:00
Antoine Lavenant
fa7843d520 fix apply once 2018-10-10 08:16:41 +01:00
flashk
d48a304569 Fix for HDR DDS images
The DDS loader was not applying the correct internal format for certain HDR images (e.g. float/half_float formats)
2018-10-04 09:22:57 +01:00
flashk
ce90a9b2da osgDB::OutputStream write array optimization
I've made a change to osgDB::OutputStream::writeArrayImplementation so that it writes the array data in a single write operation for binary files. This significantly speeds up writing out osgb files for large data sets (e.g. point clouds). osgDB::InputStream already performs a similar optimization when reading array data from binary files.
2018-10-04 09:22:38 +01:00
flashk
273dd046c2 Fix for GifImageStream::setReferenceTime
Setting the reference time greater than the duration of a gif would cause a crash. Also, the current reference time is not immediately updated when manually setting the reference time.
2018-10-04 09:22:26 +01:00
flashk
627c3df093 Update ReaderWriterFBX.cpp 2018-10-04 09:22:14 +01:00
flashk
ab372b9ead Update fbxRMesh.cpp 2018-10-04 09:21:58 +01:00
flashk
247eee2ca1 Update fbxReader.h 2018-10-04 09:21:41 +01:00
flashk
d4bbec4a0c Fix hardware mipmap generation for cube maps
I was getting a black image when enabling hardware mipmap generation on cubemaps. I believe the problem is that the base Texture class is hard coding GL_TEXTURE_2D when enabling mipmap generation, instead of using the target type from the derived class.
2018-10-03 12:00:04 +01:00
Robert Osfield
114c818f2e Removed unused static variables 2018-10-02 12:21:31 +01:00
Robert Osfield
1ee6d476f8 From Andy Skinner, Added ~GLExtensions to clear cached values for context ID 2018-10-02 11:28:34 +01:00
Julien Valentin
8a29c504e4 add version and required extension
let a chance to work on intel chipset
2018-10-02 11:06:22 +01:00
OpenSceneGraph git repository
f376af1fd5 Merge pull request #627 from eligovision/OpenSceneGraph-3.6_gui_adapters_1px
1px error in GUIEventAdapter, View, Viewer and CompositeViewer major fix
2018-10-02 10:46:25 +01:00
Konstantin S. Matveyev
e663330bdf 1px error in GUIEventAdapter, View, Viewer and CompositeViewer major fix 2018-09-21 13:30:39 +03:00
Robert Osfield
d011ca4e8d Updated ChangeLog for 3.6.3 release 2018-09-14 11:16:53 +01:00
Robert Osfield
3a6b13c46e Updated version number and date for 3.6.3 stable release 2018-09-14 10:41:24 +01:00
Robert Osfield
88afccd85e Updated ChangeLog for 3.6.3-rc3 2018-09-13 08:52:21 +01:00
Robert Osfield
d6d6c3cda2 Updated for 3.6.3-rc3 2018-09-13 08:47:17 +01:00
Robert Osfield
ca134dca2d Standardized the glTexStorage*() calls to use osg::maximum(_numMipmapLevels,1) of rnumber of mipmaps to keep the usage consistent.
Fixed the erronous Texture2DArray glTexStorage call so that it used the _numMipmapLevels as above to resolve bug in allocation.
2018-09-12 17:45:49 +01:00
Robert Osfield
66246703bf Warning fixes 2018-09-11 15:32:44 +01:00
Robert Osfield
fb09be05a9 Fixed warning 2018-09-11 12:29:40 +01:00
Robert Osfield
41fa8fecd1 Updated for 3.6.3-rc2 2018-09-11 12:23:01 +01:00
Robert Osfield
2213011caa Updated rc number 2 for 3.6.3-rc2 2018-09-11 11:56:04 +01:00
OpenSceneGraph git repository
c2f0da31f2 Merge pull request #620 from LaurensVoerman/txt_SCREEN_COORDS
fix scale problem for osgText with characterSizeMode SCREEN_COORDS and _position set.
2018-09-11 11:29:36 +01:00
Robert Osfield
2e14bd52bf Fixed hang using a ReentrantMutex 2018-09-11 11:23:34 +01:00
Robert Osfield
4ea833cc6b Fixed build 2018-09-11 10:13:49 +01:00
Robert Osfield
7fae3b67cd Fixed build 2018-09-11 09:31:35 +01:00
Robert Osfield
8780347f2f Cleaned up code 2018-09-11 09:05:16 +01:00
gwaldron
22e6f6038f osgText: fixed thread-safety issues in Glyph and Font 2018-09-11 08:53:40 +01:00
mp3butcher
385cfa0cbf fix examples context creation for X11
(when display not :0.0)
2018-09-11 08:40:02 +01:00
OpenSceneGraph git repository
960f4d1ef2 Merge pull request #619 from mathieu/topic/SaveInlinedImages
Added saving of inline Images without having the physical image file.
2018-09-11 08:34:20 +01:00
Robert Osfield
257c2deb86 Added greater control of how cubemap is set up and controlled 2018-09-11 08:11:27 +01:00
Laurens Voerman
4dc6a6c4cd fix scale problem for osgText with characterSizeMode SCREEN_COORDS and _position set. 2018-09-07 15:09:15 +02:00
Mathieu MARACHE
2e38e4751c Added saving of inline Images without having the physical image file.
The can be read from and inlined image file
2018-09-07 14:05:50 +02:00
Robert Osfield
dfdb946d60 Merge branch 'OpenSceneGraph-3.6' of https://github.com/openscenegraph/OpenSceneGraph into OpenSceneGraph-3.6 2018-09-06 12:30:18 +01:00
Robert Osfield
2f056dcaa9 Updated for 3.6.3-rc1 2018-09-06 12:29:44 +01:00
Robert Osfield
d07fe93f34 Fixed memory leak with assignment of default value to ObjectSerializer 2018-09-06 11:53:35 +01:00
OpenSceneGraph git repository
05297f439c Merge pull request #616 from eligovision/OpenSceneGraph-3.6_particles
ParticleSystem: Added support for GLES2 and upper (GL_QUADS -> GL_TRI…
2018-09-05 18:06:25 +01:00
Robert Osfield
34d58d447d Fixed copy constructor 2018-09-05 18:01:33 +01:00
Konstantin S. Matveyev
637e1cc33b ParticleSystem: Using of GL_TRIANGLES for GLES2 and upper; GL_QUADS otherwise 2018-09-05 19:00:29 +03:00
OpenSceneGraph git repository
5d6ab3e6b7 Merge pull request #617 from aluaces/Image_scaleImage_typo
Fix typo in the initial check of Image::scaleImage().
2018-09-05 14:04:57 +01:00
Alberto Luaces
69667a478f Fix typo in the initial check of Image::scaleImage(). 2018-09-05 13:38:09 +02:00
Konstantin S. Matveyev
f00b7180cb ParticleSystem: Added support for GLES2 and upper (GL_QUADS -> GL_TRIANGLES) 2018-09-05 14:05:29 +03:00
Jason Beverage
6ae1139630 Protect the _programSet in Shader with a mutex.
This prevents thread safety issues when Shader objects are used in
multiple programs.
2018-09-05 09:34:54 +01:00
Robert Osfield
a06fcbe5d9 Updated ChangeLog 2018-09-05 09:33:24 +01:00
Robert Osfield
5f9c6a0170 Changed the ShapeDrawable::build() methpd so that it does run when the ShadpwDrawabe is a KdTree. 2018-09-04 15:26:30 +01:00
Robert Osfield
2a4dd6e03b Updated SO version as XmlNode::Input changes change the ABI 2018-09-04 14:13:32 +01:00
Robert Osfield
afe5644b9f Added support for reading UTF-8 encoded of xml files 2018-09-04 12:42:31 +01:00
Robert Osfield
ae3133522d Changed the logic for whether to call setUpThreading() in setThreadingModel() to make it possible to changed threadings even if the threading model starts of as SingleThreaded 2018-09-03 12:30:02 +01:00
Robert Osfield
5040c583b4 Updated version number to 3.6.3 in prep for next naintainance release 2018-09-03 11:19:50 +01:00
Robert Osfield
61967a7d1a Merge branch 'OpenSceneGraph-3.6-TexStorage' into OpenSceneGraph-3.6 2018-09-03 10:16:45 +01:00
Robert Osfield
bcba3928e6 Added reset of _stateset to prevent the releaseGLObjects calling release on th StateSet from the destructor 2018-09-03 09:41:59 +01:00
Robert Osfield
006ca64f4b Added reset of _stateset to prevent the releaseGLObjects calling release on th StateSet from the destructor 2018-09-03 09:37:36 +01:00
Robert Osfield
77fd07eaa9 Replaced the glSGetProcAddressARB code with the dlsym() usage as the NVidia driver looks to be returning non NULL pointers for invalid function names. 2018-08-28 12:01:35 +01:00
Robert Osfield
8b8c427afe Replaced the glSGetProcAddressARB code with the dlsym() usage as the NVidia driver looks to be returning non NULL pointers for invalid function names. 2018-08-28 11:52:42 +01:00
Robert Osfield
f55b864d59 Enabled point sprite validty modes. 2018-08-22 11:21:30 +01:00
Robert Osfield
d18c498322 Enabled point sprite validty modes. 2018-08-22 11:13:11 +01:00
Robert Osfield
4f7f34a6b0 Merged fix for PointSprite modes validity checks from master. 2018-08-22 10:43:15 +01:00
Robert Osfield
29789f898b Merged fix for PointSprite modes validity checks from master. 2018-08-22 10:42:18 +01:00
plevy
dd9312ae35 Change GL_RGBA16F to GL_RGBA16F_ARB to fix Windows Build
Change GL_RGBA16F to  GL_RGBA16F_ARB to fix Windows build.
2018-08-22 07:48:55 +01:00
plevy
78e050db43 Change GL_RGBA16F to GL_RGBA16F_ARB to fix Windows Build
Change GL_RGBA16F to  GL_RGBA16F_ARB to fix Windows build.
2018-08-22 07:48:22 +01:00
Robert Osfield
250dcc5b6c Replaced GL_RGBA32F with GL_RGBA32F_ARB to fix Windows build 2018-08-21 09:20:49 +01:00
Robert Osfield
f2dfd78914 Replaced GL_RGBA32F with GL_RGBA32F_ARB to fix Windows build 2018-08-21 09:19:50 +01:00
OpenSceneGraph git repository
1819bb32ae Merge pull request #606 from mp3butcher/OpenSceneGraph-3.6-TexStorage
Open scene graph 3.6 tex storage
2018-08-20 10:08:09 +01:00
mp3butcher
e043c3db33 complete TexStorage support 2018-08-20 05:11:43 +02:00
mp3butcher
587e65e674 add more extensions 2018-08-20 05:11:29 +02:00
mp3butcher
274b6894af remove redondant variable and test 2018-08-19 22:46:10 +02:00
Robert Osfield
29e87780f5 Removed check as this is better outside of the function 2018-08-17 16:53:13 +01:00
Robert Osfield
58a51cbc41 Created a GLenum Texture::selectSizedInternalFormat(const osg::Image* image=0) const method to help clean up set up of glTexStorage.
Fixed typo.
2018-08-17 12:20:59 +01:00
Robert Osfield
7ae7a994b4 Merged changes to InternalPixelRelations sizedInternalFormats[] from master 2018-08-17 10:31:46 +01:00
Robert Osfield
3808b298d1 Fixed memory leak associated with VertexArrayStte objects not getting released on destruction of Geometry/Drawables. 2018-08-16 19:24:56 +01:00
Robert Osfield
ed13576d03 From Chris White, Cygwin build fix 2018-08-08 14:42:04 +01:00
Vic-Min
15f2ae8d15 Renamed USE_DEPRECATED_API to OSG_USE_DEPRECATED_API 2018-08-08 14:37:28 +01:00
OpenSceneGraph git repository
9ab5aafd02 Merge pull request #583 from emminizer/flt-registry-cache
OpenFlight: Replace internal caches with osgDB::ObjectCache use.  Fix…
2018-07-31 16:58:41 +01:00
Daniel Emminizer
2e0e78144f OpenFlight: Replace internal caches with osgDB::ObjectCache use. Fixes unbounded memory growth when using readNode(std::istream&, ...) method. 2018-07-31 11:45:33 -04:00
Robert Osfield
ffb68bec7c Removed unneccessary FIX ME statement. 2018-07-31 09:14:02 +01:00
Robert Osfield
79bc4c3843 Fixed check against dataType changes 2018-07-27 17:34:30 +01:00
Alex Burton
a7747972dc updated osgviewerWX to remove deprecated calls in wxWidgets 3.x 2018-07-27 17:12:07 +01:00
OpenSceneGraph git repository
467baa8c00 Merge pull request #573 from emminizer/fix-flt-typo
FLT: Fix texture unit typo and code style from PR 568.
2018-07-09 17:55:38 +01:00
Daniel Emminizer
4d6c4a7f1f FLT: Fix texture unit typo and code style from PR 568. 2018-07-09 06:34:41 -04:00
Robert Osfield
fb40a0d1db Updated ChangeLog for 3.6.2 release 2018-06-29 10:56:35 +01:00
Robert Osfield
975b62c735 Updated date for 3.6.2 releases 2018-06-29 10:56:01 +01:00
Robert Osfield
dff2faa63b Updates for 3.6.2 stable release 2018-06-29 10:54:13 +01:00
Robert Osfield
500d3947ef Fixed isPointSpriteModeSupported assignment bug 2018-06-29 10:53:23 +01:00
Robert Osfield
2b7b051421 Removed the gl3.h usage for GL3 case as these headers were replaced by glcorearb.h, it's probably better to just fallback to gl.h and have the OSG get the extentions at runtime. 2018-06-29 09:52:47 +01:00
Robert Osfield
8a05850048 UPdated ChangeLog 2018-06-28 07:34:49 +01:00
Robert Osfield
469d743bec Updated for rc3 2018-06-28 07:06:59 +01:00
Larry-Hu
c1dfc39706 Remove call to nonexistent member seekpos() of std::fpos in VS 2017 version 15.8 or later 2018-06-28 06:54:57 +01:00
OpenSceneGraph git repository
aa5e25db8d Merge pull request #568 from emminizer/fix-flt-texture-export-gl3
OpenFlight: Textures now correctly export in GLCORE mode.
2018-06-27 20:59:09 +01:00
Daniel Emminizer
33cb2e6f70 OpenFlight: Textures now correctly export in GLCORE mode. 2018-06-27 12:57:20 -04:00
Robert Osfield
11e4a995c4 Updated for 3.6.2-rc2 2018-06-27 09:17:00 +01:00
Robert Osfield
27fc282bb5 Fixed relaseGLObjects() calls 2018-06-27 09:06:58 +01:00
Robert Osfield
9d897c2555 Merge branch 'OpenSceneGraph-3.6' of https://github.com/openscenegraph/OpenSceneGraph into OpenSceneGraph-3.6 2018-06-26 20:50:55 +01:00
Robert Osfield
cbcf7015bb Replaced creation of a temporary Settings object on the heap with creation on the stack to improve performance 2018-06-26 20:46:49 +01:00
OpenSceneGraph git repository
4d5c1ff14e Merge pull request #566 from emminizer/fix-gl_rb-in-gluscaleimage
GL_RG is now a supported format in gluScaleImage().
2018-06-26 20:17:07 +01:00
Robert Osfield
d01edcb540 Added GLExtensions::isPointSpriteModeSupported to allow it to be enable for GL versions that support GL_POINT_SPRITE_ARB/GL_POINT_SPRITE_OES 2018-06-26 20:10:51 +01:00
Daniel Emminizer
bfa8d157c1 GL_RG is now a support format in gluScaleImage(). 2018-06-26 14:44:34 -04:00
Robert Osfield
44b3bcc3fc Moved osg::clampProjectionMatrix() template from CullVisitor.cpp into include/osg/CullSettings to make it easier to implement custom clampProjectionMatrix callbacks 2018-06-25 20:02:30 +01:00
Robert Osfield
89e186014e Updates for 3.6.2-rc1 2018-06-20 13:59:10 +01:00
Calum Robinson
40bde873bc Fix z near calculation for lines 2018-06-20 12:28:06 +01:00
OpenSceneGraph git repository
12db2f8011 Merge pull request #558 from LaurensVoerman/submit-ffmpeg3.2
resolve av sync failure with ffmpeg 3.2 and up
2018-06-19 11:50:38 +01:00
Laurens Voerman
e18a03abc3 resolve av sync failure with ffmpeg 3.2 and up 2018-06-19 10:47:23 +02:00
弥继平
2205506aa3 Fixed the position of the viewport for the camera
The position of viewport doesn't setup properly, some part of viewer is out of CMFC_OSG_MDIView,  and not visible.
2018-06-18 19:38:27 +01:00
Laurens Voerman
15c6b7a196 remove include/osgQt from doxyfiles; add osgPresentation and osgUI 2018-06-14 14:45:49 +01:00
OpenSceneGraph git repository
9171f12069 Merge pull request #555 from emminizer/fix-noisy-flt-loading
FLT: Missing optional attr files on textures no longer generates a co…
2018-06-14 14:44:16 +01:00
Daniel Emminizer
acf359777e FLT: Missing optional attr files on textures no longer generates a console warning. 2018-06-14 07:33:08 -04:00
Robert Osfield
a9f91a875b Changed version to 3.6.2 in prep for next release 2018-06-14 08:54:21 +01:00
Robert Osfield
4665a2f033 To handle calling Array::setBinding() after Geometry::set*Array() call, to the Geometry::addVertexBufferObjectIfRequired(osg::Array* array) added treatment of array->getBinding()==Array::BIND_UNDEFINED as BIND_PER_VERTEX as a safe fallback. 2018-06-14 08:51:00 +01:00
Robert Osfield
673292b995 Moved Stae::setUseVertexAttributeAliasing(bool) implementation to .cpp an added call to _globalVertexArrayState->assignAllDispatchers(); to ensure state is consistent 2018-06-13 12:23:29 +01:00
Robert Osfield
b1d64ee476 Updated LICENSE to use the WxWidgets-3.1 and updates to the LGPL-2.1-only that updates addresses and tighten up language used.
Functionality the OSGPL-1.0 is the same as OSGPL-0.0, All the OpenSceneGraph users can use either OSGPL-0.0 or OSGPL-1.0.
2018-06-03 10:30:55 +01:00
Robert Osfield
5fb1e9c120 Removed deprecated xine plugin to simplify licensing (xine plugin is GPL'd) 2018-05-31 15:11:19 +01:00
Robert Osfield
801069d4cc As the author of all the files in osgPresentation and present3D have rectified the license notices to reflect their intended license rather than histoical license they had prior to being merged into the OpenSceneGraph project. OSGPL was always intended but missed during merge.
Replaced the GPL notices with OSGPL usge in present3D and include/osgPresentation as this was intended when Present3D was merged back into OpenSceneGraph but missed.
2018-05-31 14:45:37 +01:00
454 changed files with 7747 additions and 9929 deletions

12
.gitignore vendored
View File

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

View File

@@ -15,8 +15,8 @@ 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"
# - 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:

View File

@@ -1,6 +1,6 @@
OpenSceneGraph Library 3.6.0
OpenSceneGraph Library 3.6.4
568 Contributors:
570 Contributors:
Firstname Surname
-----------------
@@ -43,8 +43,8 @@ Chris Hanson
Roland Smeenk
Roger James
Jeremy Moles
J.P. Delport
Andy Skinner
J.P. Delport
Magnus Kessler
David Fries
Tom Jolley
@@ -232,6 +232,7 @@ Dietmar Funck
Colin Cochran
Christian Ruzicka
Christian Buchner
Chris Djali
Charles Cole
Blake Williams
Bj<EFBFBD>rn Hein
@@ -537,9 +538,10 @@ Christophe Herreman
Christian Noon
Christian Kaser
Christian Ehrlicher
Chris White
Chris McGlone
Chris Djali
Carlos Garcea
Capostrophic
Bryce Eldridge
Bruno Herbelin
Brian Keener

View File

@@ -3,8 +3,8 @@
#
SET(OPENSCENEGRAPH_MAJOR_VERSION 3)
SET(OPENSCENEGRAPH_MINOR_VERSION 6)
SET(OPENSCENEGRAPH_PATCH_VERSION 1)
SET(OPENSCENEGRAPH_SOVERSION 157)
SET(OPENSCENEGRAPH_PATCH_VERSION 5)
SET(OPENSCENEGRAPH_SOVERSION 162)
# set to 0 when not a release candidate, non zero means that any generated
@@ -30,6 +30,9 @@ if(COMMAND cmake_policy)
cmake_policy(SET CMP0017 NEW)
endif()
# INTERPROCEDURAL_OPTIMIZATION is enforced when enabled.
# Allows passing -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON
cmake_policy(SET CMP0069 NEW)
endif()
IF(APPLE)
@@ -41,6 +44,8 @@ IF(APPLE)
OSG_OSX_VERSION "${OSG_OSX_VERSION}")
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
@@ -48,67 +53,77 @@ ENDIF()
# 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(APPLE AND NOT ANDROID)
# Here we check if the user specified IPhone SDK
# These options are formally defined later, but can also be specified
# by the user at the command line using the cmake -D switch
# Note that FORCE is used since the user will likely enable IPhone
# build via CMake GUI after already having configured once
IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
SET(OSG_WINDOWING_SYSTEM "IOS" CACHE STRING "Windowing system type for graphics window creation, options only IOS.")
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)
#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)
ELSE()
SET(CMAKE_OSX_ARCHITECTURES "armv7;armv7s;arm64" CACHE STRING "Build architectures for iOS" FORCE)
ENDIF()
# 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()
#simulator uses i386 and x86_64 architectures
SET(CMAKE_OSX_ARCHITECTURES "i386;x86_64" CACHE STRING "Build architectures for iOS Simulator" FORCE)
ENDIF()
# 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()
#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 separate projects
SET(CMAKE_OSX_SYSROOT "${IPHONE_SDKROOT}" CACHE STRING "System root for iOS" FORCE)
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 or X11.")
ELSE()
SET(OSG_WINDOWING_SYSTEM "Cocoa" CACHE STRING "Windowing system type for graphics window creation, options Carbon, Cocoa or X11.")
# 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()
# 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()
PROJECT(OpenSceneGraph)
IF(OSG_WINDOWING_SYSTEM STREQUAL "None")
SET(OSG_WINDOWING_SYSTEM_NONE ON INTERNAL "No windowing system")
ENDIF()
SET(OPENSCENEGRAPH_VERSION ${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION})
@@ -218,40 +233,15 @@ ENDIF(OSG_MAINTAINER)
IF(NOT ANDROID)
IF(APPLE)
# 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 really 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)
IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
IF(OSG_BUILD_PLATFORM_IPHONE)
#you need to manually set the default sdk version here
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")
# 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)
#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 the path to OpenGL library
SET(OPENGL_gl_LIBRARY "${IPHONE_SDKROOT}/System/Library/Frameworks/OpenGLES.framework")
#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()
SET (IPHONE_ENABLE_BITCODE "NO" CACHE STRING "IOS Enable Bitcode")
# Apple iOS: Find OpenGLES
FIND_LIBRARY(OPENGLES_LIBRARY OpenGLES)
ELSE ()
FIND_LIBRARY(CARBON_LIBRARY Carbon)
FIND_LIBRARY(COCOA_LIBRARY Cocoa)
@@ -369,7 +359,9 @@ IF(WIN32 AND NOT ANDROID)
OPTION(MSVC_DISABLE_CHECKED_ITERATORS "Set to ON to disable Visual C++ checked iterators. If you do this you must ensure that every other project in your solution and all dependencies are compiled with _SECURE_SCL=0." OFF)
MARK_AS_ADVANCED(MSVC_DISABLE_CHECKED_ITERATORS)
IF(MSVC_DISABLE_CHECKED_ITERATORS)
ADD_DEFINITIONS(-D_ITERATOR_DEBUG_LEVEL=0) # this supercedes _SECURE_SCL and _HAS_ITERATOR_DEBUGGING in VS2010 and forward
ADD_DEFINITIONS(-D_SECURE_SCL=0)
ADD_DEFINITIONS(-D_HAS_ITERATOR_DEBUGGING=0)
ENDIF(MSVC_DISABLE_CHECKED_ITERATORS)
OPTION(MSVC_USE_DEFAULT_STACK_SIZE "Set to ON to use the default Visual C++ stack size. CMake forces a high stack size by default, which can cause problems for applications with large number of threads." OFF)
@@ -454,6 +446,9 @@ 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)
@@ -515,6 +510,12 @@ 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 ()
# Map the OSG_GL*_AVAILABLE settings to OSG_GL_* settings
IF (OSG_GLES2_AVAILABLE OR OSG_GLES3_AVAILABLE OR OSG_GL3_AVAILABLE)
OPTION(OSG_GL_DISPLAYLISTS_AVAILABLE "Set to OFF to disable use of OpenGL display lists." OFF)
@@ -542,12 +543,12 @@ ELSE()
OPTION(OSG_CPP_EXCEPTIONS_AVAILABLE "Set to OFF to disable compile of OSG components that use C++ exceptions." ON)
ENDIF()
SET(OSG_GL_CONTEXT_VERSION "1.0" CACHE STRING "GL Context String to pass when creaing graphics contexts")
# Map the OSG_GL*_AVAILABLE settings to OpenGL header settings
SET(DEFAULT_GL_CONTEXT_VERSION "1.0")
IF (OSG_GL3_AVAILABLE)
SET(OSG_GL_CONTEXT_VERSION "3.3")
SET(DEFAULT_GL_CONTEXT_VERSION "3.3")
IF (APPLE)
SET(OPENGL_HEADER1 "#include <OpenGL/gl.h>" CACHE STRING "#include<> line for OpenGL Header")
@@ -561,7 +562,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 <GL3/gl3.h>" CACHE STRING "#include<> line for OpenGL Header")
SET(OPENGL_HEADER1 "#include <GL/gl.h>" CACHE STRING "#include<> line for OpenGL Header")
SET(OPENGL_HEADER2 "" CACHE STRING "#include<> line for additional OpenGL Headers if required")
ENDIF()
@@ -600,6 +601,8 @@ 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()
@@ -728,7 +731,9 @@ OPTION(BUILD_OSG_PLUGINS "Build OSG Plugins - Disable for compile testing exampl
mark_as_advanced(BUILD_OSG_PLUGINS)
################################################################################
# 3rd Party Dependency Stuff
IF(WIN32 AND NOT ANDROID)
OPTION(OSG_FIND_3RD_PARTY_DEPS "Enable to search for Android or Windows dependencies in ./3rdparty" ON)
IF(WIN32 AND NOT ANDROID AND OSG_FIND_3RD_PARTY_DEPS)
INCLUDE(Find3rdPartyDependencies)
ENDIF()
@@ -739,7 +744,7 @@ OPTION(OSG_USE_LOCAL_LUA_SOURCE "Enable to use local Lua source when building th
# you can use the following style of command line option when invoking Cmake (here illustrating ignoring PythonLibs) :
# cmake -DCMAKE_DISABLE_FIND_PACKAGE_PythonLibs=1 .
#
IF(ANDROID)
IF(ANDROID AND OSG_FIND_3RD_PARTY_DEPS)
ANDROID_3RD_PARTY()
ELSE()
# Common to all platforms except android:
@@ -752,8 +757,6 @@ ELSE()
FIND_PACKAGE(COLLADA)
FIND_PACKAGE(FBX)
FIND_PACKAGE(ZLIB)
FIND_PACKAGE(Xine)
FIND_PACKAGE(OpenVRML)
FIND_PACKAGE(GDAL)
FIND_PACKAGE(GTA)
FIND_PACKAGE(CURL)
@@ -799,9 +802,7 @@ IF (BUILD_OSG_EXAMPLES AND NOT ANDROID)
FIND_PACKAGE(FLTK)
FIND_PACKAGE(FOX)
SET(wxWidgets_USE_LIBS base core gl net)
FIND_PACKAGE(wxWidgets)
FIND_PACKAGE(wxWidgets COMPONENTS base core gl net)
ENDIF(BUILD_OSG_EXAMPLES AND NOT ANDROID)
@@ -820,7 +821,7 @@ ENDIF(BUILD_OSG_EXAMPLES AND NOT ANDROID)
# Image readers/writers depend on 3rd party libraries except for OS X which
# can use Quicktime.
IF(NOT ANDROID)
IF(NOT (ANDROID AND OSG_FIND_3RD_PARTY_DEPS))
IF(NOT APPLE)
FIND_PACKAGE(GIFLIB)
FIND_PACKAGE(JPEG)
@@ -892,10 +893,26 @@ IF(CYGWIN)
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG")
ENDIF()
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)
# 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})
ENDIF()
ENDIF()
IF(NOT DEFINED LIB_POSTFIX)
@@ -1106,41 +1123,15 @@ ENDIF()
IF(APPLE AND NOT ANDROID)
#Here we check if the user specified IPhone SDK
IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
IF(OSG_BUILD_PLATFORM_IPHONE)
#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 window system to iOS
SET(OSG_WINDOWING_SYSTEM "IOS" CACHE STRING "Windowing system type for graphics window creation, options only IOS." FORCE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -miphoneos-version-min=${IPHONE_VERSION_MIN}" FORCE)
ELSE()
#simulator uses i386 and x86_64 architectures
SET(CMAKE_OSX_ARCHITECTURES "i386;x86_64" CACHE STRING "Build architectures for iOS Simulator" 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)
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 separate 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
SET(OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX "imageio" CACHE STRING "Forced imageio default image plugin for iOS" FORCE)
#I think this or similar will be required for IPhone apps
# ensure app bundles for example app
OPTION(OSG_BUILD_APPLICATION_BUNDLES "Enable the building of applications and examples as OSX Bundles" ON)
ELSE()
@@ -1366,6 +1357,13 @@ 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
#-----------------------------------------------------------------------------
@@ -1377,4 +1375,5 @@ ADD_CUSTOM_TARGET(uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
#
include(FeatureSummary)
feature_summary(WHAT ALL)

View File

@@ -15,8 +15,20 @@ FIND_PATH(ASIO_INCLUDE_DIR
SET(ASIO_FOUND "NO")
IF(ASIO_INCLUDE_DIR)
FIND_PACKAGE( Boost 1.37 )
IF(Boost_FOUND)
SET(ASIO_FOUND "YES")
ENDIF()
set(ASIO_VERSION_H ${ASIO_INCLUDE_DIR}/asio/version.hpp)
file(STRINGS ${ASIO_VERSION_H} AsioVersionLine REGEX "^#define ASIO_VERSION ")
string(REGEX MATCHALL "[0-9]+" AsioHeaderVersionMatches "${AsioVersionLine}")
list(GET AsioHeaderVersionMatches 0 AsioHeaderVersion)
# check version is less than 1.14.0 otherwise API changes break build
if (${AsioHeaderVersion} LESS "101400")
FIND_PACKAGE( Boost 1.37 )
IF(Boost_FOUND)
SET(ASIO_FOUND "YES")
ENDIF()
else()
message("ASIO not compatible")
endif()
ENDIF()

View File

@@ -25,11 +25,14 @@ ENDIF()
IF(APPLE)
SET(COLLADA_BUILDNAME "mac")
SET(COLLADA_BOOST_BUILDNAME ${COLLADA_BUILDNAME})
SET(COLLADA_BOOST_BUILDNAME ${COLLADA_BUILDNAME})
ELSEIF(MINGW)
SET(COLLADA_BUILDNAME "mingw")
SET(COLLADA_BOOST_BUILDNAME ${COLLADA_BUILDNAME})
ELSEIF(MSVC_VERSION EQUAL 1900 OR MSVC_VERSION EQUAL 1910 )
SET(COLLADA_BOOST_BUILDNAME ${COLLADA_BUILDNAME})
ELSEIF((MSVC_VERSION GREATER 1910) OR (MSVC_VERSION EQUAL 1910))
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)

View File

@@ -25,17 +25,22 @@ ELSEIF(MSVC10)
SET(FBX_LIBDIR "vs2010")
ELSEIF(MSVC11)
SET(FBX_LIBDIR "vs2012")
ELSEIF(MSVC12 OR MSVC_VERSION==1800)
ELSEIF(MSVC_VERSION EQUAL 1800)
SET(FBX_LIBDIR "vs2013")
ELSEIF(MSVC14 OR MSVC_VERSION>1900)
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_COMPILER_IS_GNUCXX AND CMAKE_SIZEOF_VOID_P EQUAL 8)
ELSEIF(CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(FBX_LIBDIR ${FBX_LIBDIR}/x64)
ELSE()
SET(FBX_LIBDIR ${FBX_LIBDIR}/x86)
@@ -53,6 +58,10 @@ ELSE()
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()
ENDIF()
@@ -60,16 +69,41 @@ 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.0"
"/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"
@@ -98,6 +132,21 @@ 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

@@ -0,0 +1,98 @@
# 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

@@ -101,5 +101,8 @@ if(LIBLAS_LIBRARY AND LIBLAS_INCLUDE_DIR)
if(Boost_FOUND)
set(LIBLAS_LIBRARIES ${LIBLAS_LIBRARY} )
set(LIBLAS_FOUND "YES")
if(WIN32)
link_directories(${Boost_LIBRARY_DIRS})
endif()
endif()
endif()

View File

@@ -8,7 +8,7 @@
# correspond to the ./configure --prefix=$OPENCASCADE_DIR
# used in building OPENCASCADE.
FIND_PATH(OPENCASCADE_INCLUDE_DIR BRepMesh.hxx
FIND_PATH(OPENCASCADE_INCLUDE_DIR Standard_Version.hxx
PATHS
${OPENCASCADE_DIR}
$ENV{OPENCASCADE_DIR}
@@ -98,6 +98,7 @@ 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

View File

@@ -34,8 +34,17 @@ INSTALL(
IF(MSVC AND DYNAMIC_OPENSCENEGRAPH)
GET_TARGET_PROPERTY(PREFIX ${LIB_NAME} PREFIX)
INSTALL(FILES ${OUTPUT_BINDIR}/${PREFIX}${LIB_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph CONFIGURATIONS RelWithDebInfo)
INSTALL(FILES ${OUTPUT_BINDIR}/${PREFIX}${LIB_NAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph CONFIGURATIONS Debug)
IF("${PREFIX}" STREQUAL PREFIX-NOTFOUND) # Fix for PREFIX-NOTFOUND left in file names
SET(PREFIX "")
ENDIF()
IF ( ${CMAKE_GENERATOR} STREQUAL "Ninja" )
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PREFIX}${LIB_NAME}${CMAKE_RELEASE_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph CONFIGURATIONS Release)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PREFIX}${LIB_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph CONFIGURATIONS RelWithDebInfo)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PREFIX}${LIB_NAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph CONFIGURATIONS Debug)
ELSE ( ${CMAKE_GENERATOR} STREQUAL "Ninja" )
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 ( ${CMAKE_GENERATOR} STREQUAL "Ninja" )
ENDIF(MSVC AND DYNAMIC_OPENSCENEGRAPH)
IF(NOT OSG_COMPILE_FRAMEWORKS)

View File

@@ -225,7 +225,7 @@ MACRO(SETUP_LIBRARY LIB_NAME)
)
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES FOLDER "OSG Core")
IF(APPLE)
IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
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 "")
@@ -336,21 +336,26 @@ 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 OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
IF(OSG_BUILD_PLATFORM_IPHONE)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE ${IPHONE_ENABLE_BITCODE})
ENDIF()
ENDIF()
SETUP_LINK_LIBRARIES()
#the installation path are differentiated for win32 that install in bib versus other architecture that install in lib${LIB_POSTFIX}/${OSG_PLUGINS}
#the installation path are differentiated for win32 that install in bin versus other architecture that install in lib${LIB_POSTFIX}/${OSG_PLUGINS}
IF(WIN32)
INSTALL(TARGETS ${TARGET_TARGETNAME}
RUNTIME DESTINATION bin COMPONENT ${PACKAGE_COMPONENT}
ARCHIVE DESTINATION lib/${OSG_PLUGINS} COMPONENT libopenscenegraph-dev
LIBRARY DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT})
IF(MSVC AND DYNAMIC_OPENSCENEGRAPH)
INSTALL(FILES ${OUTPUT_BINDIR}/${OSG_PLUGINS}/${TARGET_TARGETNAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT} CONFIGURATIONS RelWithDebInfo)
INSTALL(FILES ${OUTPUT_BINDIR}/${OSG_PLUGINS}/${TARGET_TARGETNAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT} CONFIGURATIONS Debug)
IF( ${CMAKE_GENERATOR} STREQUAL "Ninja" )
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_TARGETNAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT} CONFIGURATIONS RelWithDebInfo)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_TARGETNAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT} CONFIGURATIONS Debug)
ELSE( ${CMAKE_GENERATOR} STREQUAL "Ninja" )
INSTALL(FILES ${OUTPUT_BINDIR}/${OSG_PLUGINS}/${TARGET_TARGETNAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT} CONFIGURATIONS RelWithDebInfo)
INSTALL(FILES ${OUTPUT_BINDIR}/${OSG_PLUGINS}/${TARGET_TARGETNAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT} CONFIGURATIONS Debug)
ENDIF( ${CMAKE_GENERATOR} STREQUAL "Ninja" )
ENDIF(MSVC AND DYNAMIC_OPENSCENEGRAPH)
ELSE(WIN32)
INSTALL(TARGETS ${TARGET_TARGETNAME}
@@ -429,7 +434,7 @@ MACRO(SETUP_EXE IS_COMMANDLINE_APP)
IF(APPLE)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_WARNING_CFLAGS "")
IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
IF(OSG_BUILD_PLATFORM_IPHONE)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE ${IPHONE_ENABLE_BITCODE})
ENDIF()
ENDIF()
@@ -458,8 +463,8 @@ MACRO(SETUP_APPLICATION APPLICATION_NAME)
ELSE(APPLE)
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION bin COMPONENT openscenegraph )
IF(MSVC)
INSTALL(FILES ${CMAKE_BINARY_DIR}/bin/${TARGET_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION bin COMPONENT openscenegraph CONFIGURATIONS RelWithDebInfo)
INSTALL(FILES ${CMAKE_BINARY_DIR}/bin/${TARGET_NAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION bin COMPONENT openscenegraph CONFIGURATIONS Debug)
INSTALL(FILES ${OUTPUT_BINDIR}/${TARGET_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION bin COMPONENT openscenegraph CONFIGURATIONS RelWithDebInfo)
INSTALL(FILES ${OUTPUT_BINDIR}/${TARGET_NAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION bin COMPONENT openscenegraph CONFIGURATIONS Debug)
ENDIF(MSVC)
ENDIF(APPLE)
@@ -491,8 +496,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 ${OUTPUT_BINDIR}/${TARGET_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION share/OpenSceneGraph/bin COMPONENT openscenegraph-examples CONFIGURATIONS RelWithDebInfo)
INSTALL(FILES ${OUTPUT_BINDIR}/${TARGET_NAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION share/OpenSceneGraph/bin COMPONENT openscenegraph-examples CONFIGURATIONS Debug)
ENDIF(MSVC)
ENDIF(APPLE)

1769
ChangeLog

File diff suppressed because it is too large Load Diff

View File

@@ -1,8 +1,8 @@
OpenSceneGraph Public License, Version 0.0
OpenSceneGraph Public License, Version 1.0
==========================================
Copyright (C) 2002 Robert Osfield.
Copyright (C) 2018 Robert Osfield.
Everyone is permitted to copy and distribute verbatim copies
of this licence document, but changing it is not allowed.
@@ -12,18 +12,19 @@
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, 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-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.
-------------------------------------------------------------------------------
wxWindows Library Licence, Version 3
====================================
Copyright (C) 1998 Julian Smart, Robert Roebling [, ...]
wxWindows Library Licence, Version 3.1
======================================
Copyright (c) 1998-2005 Julian Smart, Robert Roebling et al
Everyone is permitted to copy and distribute verbatim copies
of this licence document, but changing it is not allowed.
@@ -43,20 +44,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., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA.
write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301 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 licensed under the wxWindows Library Licence, applying
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.
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.
2. The exception is that you may use, copy, link, modify and distribute
under the user's own terms, binary object code versions of works based
under your 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
@@ -71,11 +72,13 @@
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
@@ -86,7 +89,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
@@ -131,7 +134,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
@@ -187,8 +190,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
@@ -222,7 +225,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
@@ -234,7 +237,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
@@ -292,7 +295,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.
@@ -343,7 +346,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
@@ -405,7 +408,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
@@ -446,7 +449,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
@@ -498,7 +501,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
@@ -508,7 +511,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.
@@ -531,8 +534,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

@@ -7,13 +7,13 @@
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:
For 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
http://www.openscenegraph.org/index.php/documentation
For support subscribe to our public mailing list or forum, details at:
For support please use the github OpenSceneGraph Discussions forum:
http://www.openscenegraph.org/index.php/support
https://github.com/openscenegraph/OpenSceneGraph/discussions
For the impatient, we've included quick build instructions below, these are are broken down is three parts:
@@ -25,17 +25,22 @@ If details below are not sufficient then head over to the openscenegraph.org to
Robert Osfield.
Project Lead.
28th May 2018.
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
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.
@@ -54,13 +59,13 @@ Alternatively, you can create an out-of-source build directory and run cmake or
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
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
http://www.openscenegraph.org/index.php/documentation/10-getting-started
## Section 2. Release notes on macOS build, by Eric Sokolowski et al.
@@ -88,13 +93,14 @@ Many of the example programs use command-line arguments. When double-clicking on
## Section 3. Release notes on iOS build, by Thomas Hogarth
With CMake, XCode and the iOS sdk installed you can generate an iOS XCode project using the following command line:
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/my/3rdParty
export THIRDPARTY_PATH=/path/to/3rdParty
cmake ./ -G Xcode -DOSG_BUILD_PLATFORM_IPHONE:BOOL=ON \
-DIPHONE_SDKVER="10.2" \
-DIPHONE_VERSION_MIN="8.0" \
-DOPENGL_PROFILE:STRING=GLES2 \
-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 \
@@ -105,15 +111,15 @@ With CMake, XCode and the iOS sdk installed you can generate an iOS XCode projec
-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/libFreeType_iphone_universal.a" \
-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 10.2. IPHONE_VERSION_MIN controls the base sdk used by xcode, and lastly set OPENGL_PROFILE to the version of GLES you want to use.
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. In the 'Build Settings' tab search for 'Other Linker Flags', then for each target type (debug, release etc) that you want to use open the list of arguments and delete the 'OpenGL' line and the '-framework' line above it. This is because cmake has tried to add the desktop OpenGL library which we don't want.
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.
Once this is done you should be able to build and deploy the `example_osgViewerIPhone` target on your device.

View File

@@ -45,6 +45,8 @@ class MyGraphicsContext {
traits->doubleBuffer = false;
traits->sharedContext = 0;
traits->pbuffer = true;
traits->readDISPLAY();
traits->setUndefinedScreenDetailsToDefaultScreen();
_gc = osg::GraphicsContext::createGraphicsContext(traits.get());
@@ -769,7 +771,7 @@ int main( int argc, char **argv )
osgDB::Registry::instance()->getOptions()->setObjectCacheHint(osgDB::Options::CACHE_ALL);
}
std::string fileNameOut("converted.osg");
std::string fileNameOut("converted.osgt");
if (fileNames.size()>1)
{
fileNameOut = fileNames.back();
@@ -778,29 +780,66 @@ int main( int argc, char **argv )
osg::Timer_t startTick = osg::Timer::instance()->tick();
osg::ref_ptr<osg::Node> root = osgDB::readRefNodeFiles(fileNames);
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;
if (root.valid())
Images images;
Nodes nodes;
Objects objects;
for(FileNameList::iterator itr = fileNames.begin();
itr != fileNames.end();
++itr)
{
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::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;
}
if (pruneStateSet)
{
PruneStateSetVisitor pssv;
root->accept(pssv);
}
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;
if (fixTransparencyMode != FixTransparencyVisitor::NO_TRANSPARANCY_FIXING)
osg::ref_ptr<osg::Node> root;
if (nodes.size()==1) root = nodes.front();
else if (nodes.size()>1)
{
FixTransparencyVisitor atv(fixTransparencyMode);
root->accept(atv);
osg::ref_ptr<osg::Group> group = new osg::Group;
for(Nodes::iterator itr = nodes.begin();
itr != nodes.end();
++itr)
{
group->addChild(itr->get());
}
root = group;
}
if ( root.valid() )
{
if (pruneStateSet)
{
PruneStateSetVisitor pssv;
root->accept(pssv);
}
if (fixTransparencyMode != FixTransparencyVisitor::NO_TRANSPARANCY_FIXING)
{
FixTransparencyVisitor atv(fixTransparencyMode);
root->accept(atv);
}
if (smooth)
{
@@ -866,6 +905,20 @@ 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

@@ -17,6 +17,7 @@
#include <osg/Plane>
#include <osg/BoundingBox>
#include <osg/BoundingSphere>
#include <osg/Quat>
#ifdef BUILD_CONTRIBUTORS
extern void printContributors(const std::string& changeLog, bool printNumEntries);
@@ -40,6 +41,7 @@ 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.");
@@ -139,6 +141,12 @@ 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,6 +48,7 @@ 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);
@@ -71,6 +72,8 @@ 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))
{
@@ -109,7 +112,7 @@ int main(int argc, char** argv)
while (arguments.read("-p",pathfile))
{
osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile);
if (apm || !apm->valid())
if (apm && !apm->getAnimationPath()->empty())
{
apm->setTimeScale(animationSpeed);
@@ -147,6 +150,8 @@ 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)
@@ -155,6 +160,15 @@ 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,13 +1,14 @@
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* 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 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 distributed in the hope that it will be useful,
* 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
* include LICENSE.txt for more details.
* OpenSceneGraph Public License for more details.
*/
#include "Cluster.h"
@@ -17,7 +18,7 @@
#include <sys/types.h>
#include <errno.h>
#if !defined (WIN32) || defined(__CYGWIN__)
#if !defined (_WIN32) || defined(__CYGWIN__)
#include <sys/ioctl.h>
#include <sys/uio.h>
#include <sys/socket.h>
@@ -50,7 +51,7 @@
#elif defined (__APPLE__)
#include <unistd.h>
#include <sys/sockio.h>
#elif defined (WIN32)
#elif defined (_WIN32)
#include <winsock.h>
#include <stdio.h>
#elif defined (__hpux)
@@ -62,7 +63,7 @@
#include <stdio.h>
#include <fcntl.h>
#include <sys/types.h>
#if defined (WIN32) && !defined(__CYGWIN__)
#if defined (_WIN32) && !defined(__CYGWIN__)
#include <winsock.h>
#else
#include <unistd.h>
@@ -264,7 +265,7 @@ Receiver::Receiver( void )
Receiver::~Receiver( void )
{
#if defined (WIN32) && !defined(__CYGWIN__)
#if defined (_WIN32) && !defined(__CYGWIN__)
closesocket( _so);
#else
close( _so );
@@ -273,7 +274,7 @@ Receiver::~Receiver( void )
bool Receiver::init( void )
{
#if defined(WIN32) && !defined(__CYGWIN__)
#if defined(_WIN32) && !defined(__CYGWIN__)
WORD version = MAKEWORD(1,1);
WSADATA wsaData;
// First, we start up Winsock
@@ -294,7 +295,7 @@ bool Receiver::init( void )
int result = 0;
#if defined (WIN32) && !defined(__CYGWIN__)
#if defined (_WIN32) && !defined(__CYGWIN__)
// const BOOL on = TRUE;
// setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, (const char*) &on, sizeof(int));
#else
@@ -304,14 +305,14 @@ bool Receiver::init( void )
if (result)
{
OSG_NOTICE<<"Warning: Reciever::init() setsockopt(..) failed, errno="<<errno<<std::endl;
OSG_NOTICE<<"Warning: Receiver::init() setsockopt(..) failed, errno="<<errno<<std::endl;
return false;
}
// struct sockaddr_in saddr;
saddr.sin_family = AF_INET;
saddr.sin_port = htons( _port );
#if defined (WIN32) && !defined(__CYGWIN__)
#if defined (_WIN32) && !defined(__CYGWIN__)
saddr.sin_addr.s_addr = htonl(INADDR_ANY);
#else
saddr.sin_addr.s_addr = 0;
@@ -365,7 +366,7 @@ void Receiver::sync( void )
tv.tv_sec = 0;
tv.tv_usec = 0;
#if defined (WIN32) && !defined(__CYGWIN__)
#if defined (_WIN32) && !defined(__CYGWIN__)
// saddr.sin_port = htons( _port );
int result = recvfrom( _so, (char *)_buffer, _buffer_size, 0, (sockaddr*)&saddr, &size );
// recvfrom(sock_Receive, szMessage, 256, 0, (sockaddr*)&addr_Cli, &clilen)
@@ -418,7 +419,7 @@ Broadcaster::Broadcaster( void )
Broadcaster::~Broadcaster( void )
{
#if defined (WIN32) && !defined(__CYGWIN__)
#if defined (_WIN32) && !defined(__CYGWIN__)
closesocket( _so);
#else
close( _so );
@@ -427,7 +428,7 @@ Broadcaster::~Broadcaster( void )
bool Broadcaster::init( void )
{
#if defined (WIN32) && !defined(__CYGWIN__)
#if defined (_WIN32) && !defined(__CYGWIN__)
WORD version = MAKEWORD(1,1);
WSADATA wsaData;
// First, we start up Winsock
@@ -445,7 +446,7 @@ bool Broadcaster::init( void )
perror( "Socket" );
return false;
}
#if defined (WIN32) && !defined(__CYGWIN__)
#if defined (_WIN32) && !defined(__CYGWIN__)
const BOOL on = TRUE;
#else
int on = 1;
@@ -453,7 +454,7 @@ bool Broadcaster::init( void )
int result = 0;
#if defined (WIN32) && !defined(__CYGWIN__)
#if defined (_WIN32) && !defined(__CYGWIN__)
result = setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, (const char *) &on, sizeof(int));
#else
result = setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
@@ -465,24 +466,24 @@ bool Broadcaster::init( void )
saddr.sin_port = htons( _port );
if( _address == 0 )
{
#if defined (WIN32) && !defined(__CYGWIN__)
#if defined (_WIN32) && !defined(__CYGWIN__)
result = setsockopt( _so, SOL_SOCKET, SO_BROADCAST, (const char *) &on, sizeof(int));
#else
result = setsockopt( _so, SOL_SOCKET, SO_BROADCAST, &on, sizeof(on));
#endif
if (result) return false;
#if !defined (WIN32) || defined(__CYGWIN__)
#if !defined (_WIN32) || defined(__CYGWIN__)
struct ifreq ifr;
#endif
#if defined (__linux) || defined(__CYGWIN__)
strcpy( ifr.ifr_name, "eth0" );
#elif defined(__sun)
strcpy( ifr.ifr_name, "hme0" );
#elif !defined (WIN32)
#elif !defined (_WIN32)
strcpy( ifr.ifr_name, "ef0" );
#endif
#if defined (WIN32) // get the server address
#if defined (_WIN32) // get the server address
saddr.sin_addr.s_addr = htonl(INADDR_BROADCAST);
}
#else
@@ -542,7 +543,7 @@ void Broadcaster::sync( void )
}
int result = 0;
#if defined (WIN32) && !defined(__CYGWIN__)
#if defined (_WIN32) && !defined(__CYGWIN__)
unsigned int size = sizeof( SOCKADDR_IN );
result = sendto( _so, (const char *)_buffer, _buffer_size, 0, (struct sockaddr *)&saddr, size );
// int err = WSAGetLastError ();

View File

@@ -1,13 +1,14 @@
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* 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 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 distributed in the hope that it will be useful,
* 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
* include LICENSE.txt for more details.
* OpenSceneGraph Public License for more details.
*/
#ifndef CLUSTER_H
@@ -18,7 +19,7 @@
#include <osgViewer/Viewer>
#if !defined(WIN32) || defined(__CYGWIN__)
#if !defined(_WIN32) || defined(__CYGWIN__)
#include <netinet/in.h>
#else
#include "winsock.h"
@@ -50,7 +51,7 @@ class Receiver
bool init( void );
private :
#if defined (WIN32) && !defined(__CYGWIN__)
#if defined (_WIN32) && !defined(__CYGWIN__)
SOCKET _so;
SOCKADDR_IN saddr;
#else
@@ -93,7 +94,7 @@ class Broadcaster
bool init( void );
private :
#if defined(WIN32) && !defined(__CYGWIN__)
#if defined(_WIN32) && !defined(__CYGWIN__)
SOCKET _so;
#else
int _so;
@@ -102,7 +103,7 @@ class Broadcaster
short _port;
void *_buffer;
unsigned int _buffer_size;
#if defined(WIN32) && !defined(__CYGWIN__)
#if defined(_WIN32) && !defined(__CYGWIN__)
SOCKADDR_IN saddr;
#else
struct sockaddr_in saddr;

View File

@@ -1,13 +1,14 @@
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* 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 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 distributed in the hope that it will be useful,
* 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
* include LICENSE.txt for more details.
* OpenSceneGraph Public License for more details.
*/
#include "ExportHTML.h"

View File

@@ -1,13 +1,14 @@
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* 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 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 distributed in the hope that it will be useful,
* 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
* include LICENSE.txt for more details.
* OpenSceneGraph Public License for more details.
*/
#ifndef EXPORTHTML_H

View File

@@ -1,13 +1,14 @@
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* 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 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 distributed in the hope that it will be useful,
* 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
* include LICENSE.txt for more details.
* OpenSceneGraph Public License for more details.
*/
#include "PointsEventHandler.h"

View File

@@ -1,13 +1,14 @@
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* 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 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 distributed in the hope that it will be useful,
* 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
* include LICENSE.txt for more details.
* OpenSceneGraph Public License for more details.
*/
#ifndef POINTSEVENTHANDLER

View File

@@ -1,13 +1,14 @@
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* 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 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 distributed in the hope that it will be useful,
* 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
* include LICENSE.txt for more details.
* OpenSceneGraph Public License for more details.
*/
#include "ReadShowFile.h"

View File

@@ -1,13 +1,14 @@
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* 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,
* 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
* include LICENSE.txt for more details.
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#ifndef P3D_READFILE

View File

@@ -1,13 +1,14 @@
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* 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,
* 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
* include LICENSE.txt for more details.
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#include <osgViewer/Viewer>
@@ -33,7 +34,7 @@ SDLIntegration::SDLIntegration()
atexit(SDL_Quit);
int numJoysticks = SDL_NumJoysticks();
if (_verbose)
{
std::cout<<"number of joysticks "<<numJoysticks<<std::endl;
@@ -42,9 +43,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;
@@ -57,13 +58,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
@@ -88,7 +89,7 @@ void SDLIntegration::capture(ValueList& axisValues, ValueList& buttonValues) con
if (_joystick)
{
SDL_JoystickUpdate();
axisValues.resize(_numAxes);
for(int ai=0; ai<_numAxes; ++ai)
{
@@ -107,21 +108,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;
@@ -145,7 +146,7 @@ void SDLIntegration::update(osgViewer::Viewer& viewer)
}
}
}
for(int bi=0; bi<_numButtons; ++bi)
{
if (newButtonValues[bi]!=_buttonValues[bi])
@@ -171,11 +172,11 @@ void SDLIntegration::update(osgViewer::Viewer& viewer)
}
}
}
_axisValues.swap(newAxisValues);
_buttonValues.swap(newButtonValues);
}
}

View File

@@ -1,13 +1,14 @@
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* 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,
* 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
* include LICENSE.txt for more details.
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#ifndef SDLINTEGRATION
@@ -31,12 +32,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);
@@ -48,16 +49,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;
@@ -66,7 +67,7 @@ class SDLIntegration
int _numHats;
int _numButtons;
bool _verbose;
ValueList _axisValues;
ValueList _buttonValues;
ButtonMap _mouseButtonMap;

View File

@@ -1,13 +1,14 @@
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* 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 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 distributed in the hope that it will be useful,
* 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
* include LICENSE.txt for more details.
* OpenSceneGraph Public License for more details.
*/
#include "ShowEventHandler.h"

View File

@@ -1,13 +1,14 @@
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* 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 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 distributed in the hope that it will be useful,
* 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
* include LICENSE.txt for more details.
* OpenSceneGraph Public License for more details.
*/
#ifndef SHOWEVENTHANDLER

View File

@@ -1,13 +1,14 @@
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* 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 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 distributed in the hope that it will be useful,
* 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
* include LICENSE.txt for more details.
* OpenSceneGraph Public License for more details.
*/
#include <osgDB/FileNameUtils>

View File

@@ -1,13 +1,14 @@
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* 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 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 distributed in the hope that it will be useful,
* 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
* include LICENSE.txt for more details.
* OpenSceneGraph Public License for more details.
*/
#ifndef SPELLCHCKER_H

View File

@@ -1,13 +1,14 @@
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* 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 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 distributed in the hope that it will be useful,
* 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
* include LICENSE.txt for more details.
* OpenSceneGraph Public License for more details.
*/
#include <osg/Geometry>
@@ -483,7 +484,7 @@ int main( int argc, char **argv )
while (arguments.read("-p",pathfile))
{
osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile);
if (apm || !apm->valid())
if (apm && !apm->getAnimationPath()->empty())
{
unsigned int num = keyswitchManipulator->getNumMatrixManipulators();
keyswitchManipulator->addMatrixManipulator( keyForAnimationPath, "Path", apm );
@@ -507,7 +508,7 @@ int main( int argc, char **argv )
viewer.addEventHandler( new osgViewer::WindowSizeHandler() );
// neeed to address.
// need to address.
// viewer.getScene()->getUpdateVisitor()->setTraversalMode(osg::NodeVisitor::TRAVERSE_ACTIVE_CHILDREN);
@@ -557,7 +558,7 @@ int main( int argc, char **argv )
while (arguments.read("--loop")) loopPresentation = true;
{
// set update hte default traversal mode settings for update visitor
// set update the default traversal mode settings for update visitor
// default to osg::NodeVisitor::TRAVERSE_ACTIVE_CHILDREN.
osg::NodeVisitor::TraversalMode updateTraversalMode = osg::NodeVisitor::TRAVERSE_ACTIVE_CHILDREN; // viewer.getUpdateVisitor()->getTraversalMode();
@@ -689,7 +690,7 @@ int main( int argc, char **argv )
// any option left unread are converted into errors to write out later.
//arguments.reportRemainingOptionsAsUnrecognized();
// report any errors if they have ocured when parsing the program aguments.
// report any errors if they have ocured when parsing the program arguments.
if (arguments.errors())
{
arguments.writeErrorMessages(osg::notify(osg::INFO));

View File

@@ -99,15 +99,16 @@ 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

@@ -89,15 +89,16 @@ 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

@@ -90,7 +90,7 @@ 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/osgQt" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgPresentation" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgShadow" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgSim" \
"${OpenSceneGraph_SOURCE_DIR}/include/osgTerrain" \

View File

@@ -243,13 +243,11 @@ ELSE(DYNAMIC_OPENSCENEGRAPH)
#needed on win32 or the linker get confused by _declspec declarations
ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC)
ADD_SUBDIRECTORY(osgstaticviewer)
# IPHONE_PORT@tom
IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
IF(OSG_BUILD_PLATFORM_IPHONE)
ADD_SUBDIRECTORY(osgviewerIPhone)
ELSE()
ADD_SUBDIRECTORY(osgstaticviewer)
ENDIF()
# IPHONE_PORT@tom
ENDIF(DYNAMIC_OPENSCENEGRAPH)

View File

@@ -103,7 +103,9 @@ void OsgMainApp::initOsgWindow(int x,int y,int width,int height){
osg::notify(osg::ALWAYS)<<"Testing"<<std::endl;
_viewer = new osgViewer::Viewer();
_viewer->setUpViewerAsEmbeddedInWindow(x, y, width, height);
osgViewer::GraphicsWindowEmbedded* window = _viewer->setUpViewerAsEmbeddedInWindow(x, y, width, height);
_viewer->getEventQueue()->setGraphicsContext(window);
_viewer->getEventQueue()->syncWindowRectangleWithGraphicsContext();
_viewer->setThreadingModel(osgViewer::ViewerBase::SingleThreaded);
_root = new osg::Group();

View File

@@ -113,7 +113,7 @@ int main(int argc, char** argv)
while (arguments.read("-p",pathfile))
{
osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile);
if (apm || !apm->valid())
if (apm && !apm->getAnimationPath()->empty())
{
apm->setTimeScale(animationSpeed);

View File

@@ -249,6 +249,8 @@ int main( int argc, char **argv )
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())
@@ -310,7 +312,7 @@ int main( int argc, char **argv )
osg::CoordinateSystemNode* csn = findTopMostNodeOfType<osg::CoordinateSystemNode>(loadedModel.get());
if(!csn) return 1;
// Compute eye point in world coordiantes
// Compute eye point in world coordinates
osg::Vec3d eye;
csn->getEllipsoidModel()->convertLatLongHeightToXYZ(lat, lon, alt, eye.x(), eye.y(), eye.z());

View File

@@ -209,6 +209,8 @@ osgViewer::View* createView(osg::ref_ptr<osg::Node> scenegraph, osg::ref_ptr<osg
traits->windowDecoration = true;
traits->doubleBuffer = true;
traits->sharedContext = 0;
traits->readDISPLAY();
traits->setUndefinedScreenDetailsToDefaultScreen();
gc = osg::GraphicsContext::createGraphicsContext(traits.get());
if (!gc)
@@ -267,7 +269,11 @@ int main(int argc, char** argv)
}
unsigned int width, height;
wsi->getScreenResolution(osg::GraphicsContext::ScreenIdentifier(0), 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)) {}
@@ -283,6 +289,8 @@ int main(int argc, char** argv)
traits->windowDecoration = true;
traits->doubleBuffer = true;
traits->sharedContext = 0;
traits->readDISPLAY();
traits->setUndefinedScreenDetailsToDefaultScreen();
gc = osg::GraphicsContext::createGraphicsContext(traits.get());
if (!gc)

View File

@@ -184,7 +184,7 @@ int main( int argc, char **argv )
// use an ArgumentParser object to manage the program arguments.
osg::ArgumentParser arguments(&argc,argv);
// set the osgDB::Registy read file callback to catch all requests for reading files.
// set the osgDB::Registry read file callback to catch all requests for reading files.
osgDB::Registry::instance()->setReadFileCallback(new MyReadFileCallback());
// initialize the viewer.

View File

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

@@ -971,9 +971,7 @@ bool GameEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionA
{
createNewCatchable();
}
break;
}
case(osgGA::GUIEventAdapter::KEYDOWN):
{
@@ -987,6 +985,7 @@ bool GameEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionA
_rightKeyPressed=true;
return true;
}
break;
}
case(osgGA::GUIEventAdapter::KEYUP):
{
@@ -1000,6 +999,7 @@ bool GameEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionA
_rightKeyPressed=false;
return true;
}
break;
}
case(osgGA::GUIEventAdapter::DRAG):
case(osgGA::GUIEventAdapter::MOVE):

View File

@@ -21,7 +21,7 @@
#include <sys/types.h>
#include <iostream>
#if !defined (WIN32) || defined(__CYGWIN__)
#if !defined (_WIN32) || defined(__CYGWIN__)
#include <sys/ioctl.h>
#include <sys/uio.h>
#include <sys/socket.h>
@@ -54,7 +54,7 @@
#elif defined (__APPLE__)
#include <unistd.h>
#include <sys/sockio.h>
#elif defined (WIN32)
#elif defined (_WIN32)
#include <winsock.h>
#include <stdio.h>
#elif defined (__hpux)
@@ -73,7 +73,7 @@ Broadcaster::Broadcaster( void )
_ifr_name = "eth0";
#elif defined(__sun)
_ifr_name = "hme0";
#elif !defined (WIN32)
#elif !defined (_WIN32)
_ifr_name = "ef0";
#endif
_port = 0;
@@ -84,7 +84,7 @@ Broadcaster::Broadcaster( void )
Broadcaster::~Broadcaster( void )
{
#if defined (WIN32) && !defined(__CYGWIN__)
#if defined (_WIN32) && !defined(__CYGWIN__)
closesocket( _so);
#else
close( _so );
@@ -93,7 +93,7 @@ Broadcaster::~Broadcaster( void )
bool Broadcaster::init( void )
{
#if defined (WIN32) && !defined(__CYGWIN__)
#if defined (_WIN32) && !defined(__CYGWIN__)
WORD version = MAKEWORD(1,1);
WSADATA wsaData;
// First, we start up Winsock
@@ -111,13 +111,13 @@ bool Broadcaster::init( void )
perror( "Socket" );
return false;
}
#if defined (WIN32) && !defined(__CYGWIN__)
#if defined (_WIN32) && !defined(__CYGWIN__)
const BOOL on = TRUE;
#else
int on = 1;
#endif
#if defined (WIN32) && !defined(__CYGWIN__)
#if defined (_WIN32) && !defined(__CYGWIN__)
setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, (const char *) &on, sizeof(int));
#else
setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
@@ -127,17 +127,17 @@ bool Broadcaster::init( void )
saddr.sin_port = htons( _port );
if( _address == 0 )
{
#if defined (WIN32) && !defined(__CYGWIN__)
#if defined (_WIN32) && !defined(__CYGWIN__)
setsockopt( _so, SOL_SOCKET, SO_BROADCAST, (const char *) &on, sizeof(int));
#else
setsockopt( _so, SOL_SOCKET, SO_BROADCAST, &on, sizeof(on));
#endif
#if !defined (WIN32) || defined(__CYGWIN__)
#if !defined (_WIN32) || defined(__CYGWIN__)
struct ifreq ifr;
strcpy( ifr.ifr_name, _ifr_name.c_str());
#endif
#if defined (WIN32) // get the server address
#if defined (_WIN32) // get the server address
saddr.sin_addr.s_addr = htonl(INADDR_BROADCAST);
}
#else
@@ -202,7 +202,7 @@ void Broadcaster::sync( void )
return;
}
#if defined (WIN32) && !defined(__CYGWIN__)
#if defined (_WIN32) && !defined(__CYGWIN__)
unsigned int size = sizeof( SOCKADDR_IN );
sendto( _so, (const char *)_buffer, _buffer_size, 0, (struct sockaddr *)&saddr, size );
int err = WSAGetLastError ();

View File

@@ -29,7 +29,7 @@
// Class definition for broadcasting a buffer to a LAN
//
#if !defined(WIN32) || defined(__CYGWIN__)
#if !defined(_WIN32) || defined(__CYGWIN__)
#include <netinet/in.h>
#endif
@@ -65,7 +65,7 @@ class Broadcaster
std::string _ifr_name;
#if defined(WIN32) && !defined(__CYGWIN__)
#if defined(_WIN32) && !defined(__CYGWIN__)
SOCKET _so;
#else
int _so;
@@ -74,7 +74,7 @@ class Broadcaster
short _port;
void *_buffer;
unsigned int _buffer_size;
#if defined(WIN32) && !defined(__CYGWIN__)
#if defined(_WIN32) && !defined(__CYGWIN__)
SOCKADDR_IN saddr;
#else
struct sockaddr_in saddr;

View File

@@ -36,7 +36,7 @@
#include <iostream>
#if defined (WIN32) && !defined(__CYGWIN__)
#if defined (_WIN32) && !defined(__CYGWIN__)
#include <winsock.h>
#endif

View File

@@ -19,7 +19,7 @@
#include <stdio.h>
#include <fcntl.h>
#include <sys/types.h>
#if defined (WIN32) && !defined(__CYGWIN__)
#if defined (_WIN32) && !defined(__CYGWIN__)
#include <winsock.h>
#else
#include <unistd.h>
@@ -46,7 +46,7 @@ Receiver::Receiver( void )
Receiver::~Receiver( void )
{
#if defined (WIN32) && !defined(__CYGWIN__)
#if defined (_WIN32) && !defined(__CYGWIN__)
closesocket( _so);
#else
close( _so );
@@ -55,7 +55,7 @@ Receiver::~Receiver( void )
bool Receiver::init( void )
{
#if defined(WIN32) && !defined(__CYGWIN__)
#if defined(_WIN32) && !defined(__CYGWIN__)
WORD version = MAKEWORD(1,1);
WSADATA wsaData;
// First, we start up Winsock
@@ -73,7 +73,7 @@ bool Receiver::init( void )
perror( "Socket" );
return false;
}
#if defined (WIN32) && !defined(__CYGWIN__)
#if defined (_WIN32) && !defined(__CYGWIN__)
// const BOOL on = TRUE;
// setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, (const char*) &on, sizeof(int));
#else
@@ -84,7 +84,7 @@ bool Receiver::init( void )
// struct sockaddr_in saddr;
saddr.sin_family = AF_INET;
saddr.sin_port = htons( _port );
#if defined (WIN32) && !defined(__CYGWIN__)
#if defined (_WIN32) && !defined(__CYGWIN__)
saddr.sin_addr.s_addr = htonl(INADDR_ANY);
#else
saddr.sin_addr.s_addr = 0;
@@ -137,7 +137,7 @@ unsigned int Receiver::sync( void )
tv.tv_sec = 0;
tv.tv_usec = 0;
#if defined (WIN32) && !defined(__CYGWIN__)
#if defined (_WIN32) && !defined(__CYGWIN__)
// saddr.sin_port = htons( _port );
recvfrom( _so, (char *)_buffer, _buffer_size, 0, (sockaddr*)&saddr, &size );
// recvfrom(sock_Receive, szMessage, 256, 0, (sockaddr*)&addr_Cli, &clilen)

View File

@@ -28,7 +28,7 @@
// Class definition for the recipient of a broadcasted message
//
#if !defined(WIN32) || defined(__CYGWIN__)
#if !defined(_WIN32) || defined(__CYGWIN__)
#include <netinet/in.h>
#endif
@@ -53,7 +53,7 @@ class Receiver
bool init( void );
private :
#if defined (WIN32) && !defined(__CYGWIN__)
#if defined (_WIN32) && !defined(__CYGWIN__)
SOCKET _so;
SOCKADDR_IN saddr;
#else

View File

@@ -289,7 +289,11 @@ int main( int argc, char **argv )
}
unsigned int width, height;
wsi->getScreenResolution(osg::GraphicsContext::ScreenIdentifier(0), width, height);
osg::GraphicsContext::ScreenIdentifier main_screen_id;
main_screen_id.readDISPLAY();
main_screen_id.setUndefinedScreenDetailsToDefaultScreen();
wsi->getScreenResolution(main_screen_id, width, height);
osg::ref_ptr<osg::GraphicsContext::Traits> traits = new osg::GraphicsContext::Traits;
traits->x = 100;
@@ -299,6 +303,8 @@ int main( int argc, char **argv )
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

@@ -211,7 +211,7 @@ int main( int argc, char **argv )
// ------------- Start of copy specific code -------------------------------------------------------
// do a deep copy, using MyCopyOp to reveal whats going on under the hood,
// do a deep copy, using MyCopyOp to reveal what's going on under the hood,
// in your own code you'd typically just use the basic osg::CopyOp something like
osg::ref_ptr<osg::Node> mycopy = dynamic_cast<osg::Node*>(rootnode->clone(osg::CopyOp::DEEP_COPY_ALL));
std::cout << "Doing a deep copy of scene graph"<<std::endl;

View File

@@ -40,33 +40,101 @@
#include <string>
#include <vector>
void create_specular_highlights(osg::Node *node)
int main(int argc, char *argv[])
{
osg::StateSet *ss = node->getOrCreateStateSet();
// use an ArgumentParser object to manage the program arguments.
osg::ArgumentParser arguments(&argc,argv);
// construct the viewer.
osgViewer::Viewer viewer;
osg::ref_ptr<osg::TextureCubeMap> tcm = new osg::TextureCubeMap;
// create and setup the texture object
osg::TextureCubeMap *tcm = new osg::TextureCubeMap;
tcm->setWrap(osg::Texture::WRAP_S, osg::Texture::CLAMP);
tcm->setWrap(osg::Texture::WRAP_T, osg::Texture::CLAMP);
tcm->setWrap(osg::Texture::WRAP_R, osg::Texture::CLAMP);
tcm->setFilter(osg::Texture::MIN_FILTER, osg::Texture::LINEAR_MIPMAP_LINEAR);
tcm->setFilter(osg::Texture::MAG_FILTER, osg::Texture::LINEAR);
// generate the six highlight map images (light direction = [1, 1, -1])
osgUtil::HighlightMapGenerator *mapgen = new osgUtil::HighlightMapGenerator(
osg::Vec3(1, 1, -1), // light direction
osg::Vec4(1, 0.9f, 0.8f, 1), // light color
8); // specular exponent
if (arguments.read("--no-mip-map"))
{
tcm->setFilter(osg::Texture::MIN_FILTER, osg::Texture::LINEAR);
tcm->setFilter(osg::Texture::MAG_FILTER, osg::Texture::LINEAR);
}
else
{
tcm->setFilter(osg::Texture::MIN_FILTER, osg::Texture::LINEAR_MIPMAP_LINEAR);
tcm->setFilter(osg::Texture::MAG_FILTER, osg::Texture::LINEAR);
}
mapgen->generateMap();
if (arguments.read("--hardware-mip-map") || arguments.read("--hmp"))
{
OSG_NOTICE<<"tcm->setUseHardwareMipMapGeneration(true)"<<std::endl;
tcm->setUseHardwareMipMapGeneration(true);
}
// assign the six images to the texture object
tcm->setImage(osg::TextureCubeMap::POSITIVE_X, mapgen->getImage(osg::TextureCubeMap::POSITIVE_X));
tcm->setImage(osg::TextureCubeMap::NEGATIVE_X, mapgen->getImage(osg::TextureCubeMap::NEGATIVE_X));
tcm->setImage(osg::TextureCubeMap::POSITIVE_Y, mapgen->getImage(osg::TextureCubeMap::POSITIVE_Y));
tcm->setImage(osg::TextureCubeMap::NEGATIVE_Y, mapgen->getImage(osg::TextureCubeMap::NEGATIVE_Y));
tcm->setImage(osg::TextureCubeMap::POSITIVE_Z, mapgen->getImage(osg::TextureCubeMap::POSITIVE_Z));
tcm->setImage(osg::TextureCubeMap::NEGATIVE_Z, mapgen->getImage(osg::TextureCubeMap::NEGATIVE_Z));
std::string filename;
if (arguments.read("--posx", filename)) tcm->setImage(osg::TextureCubeMap::POSITIVE_X, osgDB::readImageFile(filename));
if (arguments.read("--negx", filename)) tcm->setImage(osg::TextureCubeMap::NEGATIVE_X, osgDB::readImageFile(filename));
if (arguments.read("--posy", filename)) tcm->setImage(osg::TextureCubeMap::POSITIVE_Y, osgDB::readImageFile(filename));
if (arguments.read("--negy", filename)) tcm->setImage(osg::TextureCubeMap::NEGATIVE_Y, osgDB::readImageFile(filename));
if (arguments.read("--posz", filename)) tcm->setImage(osg::TextureCubeMap::POSITIVE_Z, osgDB::readImageFile(filename));
if (arguments.read("--negz", filename)) tcm->setImage(osg::TextureCubeMap::NEGATIVE_Z, osgDB::readImageFile(filename));
int numValidImages = 0;
if (tcm->getImage(osg::TextureCubeMap::POSITIVE_X)) ++numValidImages;
if (tcm->getImage(osg::TextureCubeMap::NEGATIVE_X)) ++numValidImages;
if (tcm->getImage(osg::TextureCubeMap::POSITIVE_Y)) ++numValidImages;
if (tcm->getImage(osg::TextureCubeMap::NEGATIVE_Y)) ++numValidImages;
if (tcm->getImage(osg::TextureCubeMap::POSITIVE_Z)) ++numValidImages;
if (tcm->getImage(osg::TextureCubeMap::NEGATIVE_Z)) ++numValidImages;
if (numValidImages!=6)
{
// generate the six highlight map images (light direction = [1, 1, -1])
osgUtil::HighlightMapGenerator *mapgen = new osgUtil::HighlightMapGenerator(
osg::Vec3(1, 1, -1), // light direction
osg::Vec4(1, 0.9f, 0.8f, 1), // light color
8); // specular exponent
mapgen->generateMap();
// assign the six images to the texture object
if (!tcm->getImage(osg::TextureCubeMap::POSITIVE_X)) tcm->setImage(osg::TextureCubeMap::POSITIVE_X, mapgen->getImage(osg::TextureCubeMap::POSITIVE_X));
if (!tcm->getImage(osg::TextureCubeMap::NEGATIVE_X)) tcm->setImage(osg::TextureCubeMap::NEGATIVE_X, mapgen->getImage(osg::TextureCubeMap::NEGATIVE_X));
if (!tcm->getImage(osg::TextureCubeMap::POSITIVE_Y)) tcm->setImage(osg::TextureCubeMap::POSITIVE_Y, mapgen->getImage(osg::TextureCubeMap::POSITIVE_Y));
if (!tcm->getImage(osg::TextureCubeMap::NEGATIVE_Y)) tcm->setImage(osg::TextureCubeMap::NEGATIVE_Y, mapgen->getImage(osg::TextureCubeMap::NEGATIVE_Y));
if (!tcm->getImage(osg::TextureCubeMap::POSITIVE_Z)) tcm->setImage(osg::TextureCubeMap::POSITIVE_Z, mapgen->getImage(osg::TextureCubeMap::POSITIVE_Z));
if (!tcm->getImage(osg::TextureCubeMap::NEGATIVE_Z)) tcm->setImage(osg::TextureCubeMap::NEGATIVE_Z, mapgen->getImage(osg::TextureCubeMap::NEGATIVE_Z));
}
float LODBias;
if (arguments.read("--lod",LODBias))
{
tcm->setLODBias(LODBias);
}
osg::ref_ptr<osg::Program> program = new osg::Program;
std::string shaderFilename;
while (arguments.read("-s", shaderFilename))
{
osg::ref_ptr<osg::Shader> shader = osgDB::readRefShaderFile(shaderFilename);
if (shader) program->addShader(shader);
}
// load the nodes from the commandline arguments.
osg::ref_ptr<osg::Node> rootnode = osgDB::readRefNodeFiles(arguments);
// if not loaded assume no arguments passed in, try use default mode instead.
if (!rootnode) rootnode = osgDB::readRefNodeFile("cessna.osgt");
if (!rootnode)
{
osg::notify(osg::NOTICE)<<"Please specify a model filename on the command line."<<std::endl;
return 1;
}
osg::StateSet *ss = rootnode->getOrCreateStateSet();
// enable texturing, replacing any textures in the subgraphs
ss->setTextureAttributeAndModes(0, tcm, osg::StateAttribute::OVERRIDE | osg::StateAttribute::ON);
@@ -84,31 +152,13 @@ void create_specular_highlights(osg::Node *node)
te->setSource1_RGB(osg::TexEnvCombine::PRIMARY_COLOR);
te->setOperand1_RGB(osg::TexEnvCombine::SRC_COLOR);
ss->setTextureAttributeAndModes(0, te, osg::StateAttribute::OVERRIDE | osg::StateAttribute::ON);
}
int main(int argc, char *argv[])
{
// use an ArgumentParser object to manage the program arguments.
osg::ArgumentParser arguments(&argc,argv);
// construct the viewer.
osgViewer::Viewer viewer;
// load the nodes from the commandline arguments.
osg::ref_ptr<osg::Node> rootnode = osgDB::readRefNodeFiles(arguments);
// if not loaded assume no arguments passed in, try use default mode instead.
if (!rootnode) rootnode = osgDB::readRefNodeFile("cessna.osgt");
if (!rootnode)
if (program->getNumShaders()>0)
{
osg::notify(osg::NOTICE)<<"Please specify a model filename on the command line."<<std::endl;
return 1;
ss->setAttribute(program.get());
ss->addUniform(new osg::Uniform("baseTexture",0));
}
// create specular highlights
create_specular_highlights(rootnode.get());
// run optimization over the scene graph
osgUtil::Optimizer optimzer;
optimzer.optimize(rootnode);

View File

@@ -128,7 +128,7 @@ int main( int argc, char **argv )
osg::ArgumentParser arguments(&argc,argv);
// construct the viewer.
osgViewer::Viewer viewer;
osgViewer::Viewer viewer(arguments);
// add the state manipulator
viewer.addEventHandler( new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()) );

View File

@@ -79,7 +79,11 @@ struct CommandLineOptions
return;
}
wsi->getScreenResolution(osg::GraphicsContext::ScreenIdentifier(0), width, height);
osg::GraphicsContext::ScreenIdentifier main_screen_id;
main_screen_id.readDISPLAY();
main_screen_id.setUndefinedScreenDetailsToDefaultScreen();
wsi->getScreenResolution(main_screen_id, width, height);
distance = sqrt(sphere_radius*sphere_radius - collar_radius*collar_radius);
}
@@ -274,6 +278,8 @@ void setDomeFaces(osgViewer::Viewer& viewer, CommandLineOptions& options)
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)
@@ -502,6 +508,8 @@ void setDomeCorrection(osgViewer::Viewer& viewer, CommandLineOptions& options)
traits->windowDecoration = false;
traits->doubleBuffer = true;
traits->sharedContext = 0;
traits->readDISPLAY();
traits->setUndefinedScreenDetailsToDefaultScreen();
osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get());
if (!gc)

View File

@@ -59,6 +59,7 @@ createStateSet()
// render each instance uniquely. gl_InstanceID will be in the range
// 0 to numInstances-1 (1023 in our case).
std::string vertexSource =
"#extension GL_EXT_gpu_shader4 : enable\n"
"uniform sampler2D osgLogo; \n"
"uniform float osg_SimulationTime; \n"

View File

@@ -12,11 +12,6 @@
void textInfo(osgText::Text* text)
{
const osgText::Text::TextureGlyphQuadMap& tgqm = text->getTextureGlyphQuadMap();
const osgText::Text::TextureGlyphQuadMap::const_iterator tgqmi = tgqm.begin();
osgText::String& s = text->getText();
for(unsigned int i = 0; i < s.size(); i++)

View File

@@ -38,6 +38,7 @@
#include <osg/FragmentProgram>
#include <osgDB/ReadFile>
#include <osgDB/WriteFile>
#include <osgDB/FileUtils>
#include <osgUtil/LineSegmentIntersector>
@@ -64,6 +65,18 @@ public:
ForestTechniqueManager() {}
enum Features
{
HUD_TEXT = 1,
BILLBOARD_GRAPH = 2,
X_GRAPH = 4,
TRANSFORM_GRAPH = 8,
SHADER_GRAPH = 16,
GEOMETRY_SHADER_GRAPH = 32,
TEXTURE_BUFFER_GRAPH = 64,
ALL_FEATURES = (TEXTURE_BUFFER_GRAPH<<1)-1
};
class Tree : public osg::Referenced
{
public:
@@ -150,7 +163,7 @@ public:
osg::Node* createHUDWithText(const std::string& text);
osg::Node* createScene(unsigned int numTreesToCreates, unsigned int maxNumTreesPerCell);
osg::Node* createScene(unsigned int numTreesToCreates, unsigned int maxNumTreesPerCell, unsigned int mask=ALL_FEATURES);
void advanceToNextTechnique(int delta=1)
{
@@ -803,6 +816,18 @@ class ShaderGeometry : public osg::Drawable
typedef std::vector<osg::Vec4> PositionSizeList;
virtual void resizeGLObjectBuffers(unsigned int maxSize)
{
osg::Drawable::resizeGLObjectBuffers(maxSize);
if (_geometry) _geometry->resizeGLObjectBuffers(maxSize);
}
virtual void releaseGLObjects(osg::State* state) const
{
osg::Drawable::releaseGLObjects(state);
if (_geometry) _geometry->releaseGLObjects(state);
}
virtual void drawImplementation(osg::RenderInfo& renderInfo) const
{
for(PositionSizeList::const_iterator itr = _trees.begin();
@@ -1160,7 +1185,7 @@ osg::Node* ForestTechniqueManager::createHUDWithText(const std::string& str)
return projection;
}
osg::Node* ForestTechniqueManager::createScene(unsigned int numTreesToCreates, unsigned int maxNumTreesPerCell)
osg::Node* ForestTechniqueManager::createScene(unsigned int numTreesToCreates, unsigned int maxNumTreesPerCell, unsigned int mask)
{
osg::Vec3 origin(0.0f,0.0f,0.0f);
osg::Vec3 size(1000.0f,1000.0f,200.0f);
@@ -1206,33 +1231,37 @@ osg::Node* ForestTechniqueManager::createScene(unsigned int numTreesToCreates, u
_techniqueSwitch = new osg::Switch;
if ((mask & BILLBOARD_GRAPH)!=0)
{
std::cout<<"Creating osg::Billboard based forest...";
osg::Group* group = new osg::Group;
group->addChild(createBillboardGraph(cell.get(),dstate));
group->addChild(createHUDWithText("Using osg::Billboard's to create a forest\n\nPress left cursor key to select geometry instancing with Texture Buffer Object\nPress right cursor key to select double quad based forest"));
if ((mask & HUD_TEXT)!=0) group->addChild(createHUDWithText("Using osg::Billboard's to create a forest\n\nPress left cursor key to select geometry instancing with Texture Buffer Object\nPress right cursor key to select double quad based forest"));
_techniqueSwitch->addChild(group);
std::cout<<"done."<<std::endl;
}
if ((mask & X_GRAPH)!=0)
{
std::cout<<"Creating double quad based forest...";
osg::Group* group = new osg::Group;
group->addChild(createXGraph(cell.get(),dstate));
group->addChild(createHUDWithText("Using double quads to create a forest\n\nPress left cursor key to select osg::Billboard based forest\nPress right cursor key to select osg::MatrixTransform based forest\n"));
if ((mask & HUD_TEXT)!=0) group->addChild(createHUDWithText("Using double quads to create a forest\n\nPress left cursor key to select osg::Billboard based forest\nPress right cursor key to select osg::MatrixTransform based forest\n"));
_techniqueSwitch->addChild(group);
std::cout<<"done."<<std::endl;
}
if ((mask & TRANSFORM_GRAPH)!=0)
{
std::cout<<"Creating osg::MatrixTransform based forest...";
osg::Group* group = new osg::Group;
group->addChild(createTransformGraph(cell.get(),dstate));
group->addChild(createHUDWithText("Using osg::MatrixTransform's to create a forest\n\nPress left cursor key to select double quad based forest\nPress right cursor key to select osg::Vertex/FragmentProgram based forest"));
if ((mask & HUD_TEXT)!=0) group->addChild(createHUDWithText("Using osg::MatrixTransform's to create a forest\n\nPress left cursor key to select double quad based forest\nPress right cursor key to select osg::Vertex/FragmentProgram based forest"));
_techniqueSwitch->addChild(group);
std::cout<<"done."<<std::endl;
}
if ((mask & SHADER_GRAPH)!=0)
{
std::cout<<"Creating osg::Vertex/FragmentProgram based forest...";
osg::Group* group = new osg::Group;
@@ -1289,11 +1318,12 @@ osg::Node* ForestTechniqueManager::createScene(unsigned int numTreesToCreates, u
}
group->addChild(createShaderGraph(cell.get(),stateset));
group->addChild(createHUDWithText("Using osg::Vertex/FragmentProgram to create a forest\n\nPress left cursor key to select osg::MatrixTransform's based forest\nPress right cursor key to select OpenGL shader based forest"));
if ((mask & HUD_TEXT)!=0) group->addChild(createHUDWithText("Using osg::Vertex/FragmentProgram to create a forest\n\nPress left cursor key to select osg::MatrixTransform's based forest\nPress right cursor key to select OpenGL shader based forest"));
_techniqueSwitch->addChild(group);
std::cout<<"done."<<std::endl;
}
if ((mask & SHADER_GRAPH)!=0)
{
std::cout<<"Creating OpenGL shader based forest...";
osg::Group* group = new osg::Group;
@@ -1351,11 +1381,12 @@ osg::Node* ForestTechniqueManager::createScene(unsigned int numTreesToCreates, u
}
group->addChild(createShaderGraph(cell.get(),stateset));
group->addChild(createHUDWithText("Using OpenGL Shader to create a forest\n\nPress left cursor key to select osg::Vertex/FragmentProgram based forest\nPress right cursor key to select osg::Vertex/Geometry/FragmentProgram based forest"));
if ((mask & HUD_TEXT)!=0) group->addChild(createHUDWithText("Using OpenGL Shader to create a forest\n\nPress left cursor key to select osg::Vertex/FragmentProgram based forest\nPress right cursor key to select osg::Vertex/Geometry/FragmentProgram based forest"));
_techniqueSwitch->addChild(group);
std::cout<<"done."<<std::endl;
}
if ((mask & GEOMETRY_SHADER_GRAPH)!=0)
{
std::cout<<"Creating Geometry Shader based forest...";
@@ -1363,12 +1394,13 @@ osg::Node* ForestTechniqueManager::createScene(unsigned int numTreesToCreates, u
osg::Group* group = new osg::Group;
group->addChild(createGeometryShaderGraph(cell.get(), stateset));
group->addChild(createHUDWithText("Using osg::Vertex/Geometry/FragmentProgram to create a forest\n\nPress left cursor key to select OpenGL Shader based forest\nPress right cursor key to select geometry instancing with Texture Buffer Object"));
if ((mask & HUD_TEXT)!=0) group->addChild(createHUDWithText("Using osg::Vertex/Geometry/FragmentProgram to create a forest\n\nPress left cursor key to select OpenGL Shader based forest\nPress right cursor key to select geometry instancing with Texture Buffer Object"));
_techniqueSwitch->addChild(group);
std::cout<<"done."<<std::endl;
}
if ((mask & TEXTURE_BUFFER_GRAPH)!=0)
{
std::cout<<"Creating forest using geometry instancing and texture buffer objects ...";
@@ -1430,7 +1462,7 @@ osg::Node* ForestTechniqueManager::createScene(unsigned int numTreesToCreates, u
textureBufferGraph->setStateSet( stateset );
osg::Group* group = new osg::Group;
group->addChild(textureBufferGraph);
group->addChild(createHUDWithText("Using geometry instancing to create a forest\n\nPress left cursor key to select osg::Vertex/Geometry/FragmentProgram based forest\nPress right cursor key to select osg::Billboard based forest"));
if ((mask & HUD_TEXT)!=0) group->addChild(createHUDWithText("Using geometry instancing to create a forest\n\nPress left cursor key to select osg::Vertex/Geometry/FragmentProgram based forest\nPress right cursor key to select osg::Billboard based forest"));
_techniqueSwitch->addChild(group);
@@ -1466,6 +1498,16 @@ int main( int argc, char **argv )
arguments.read("--trees-per-cell",maxNumTreesPerCell);
unsigned int features = ForestTechniqueManager::ALL_FEATURES;
while(arguments.read("--features", features))
{
std::cout<<"features = "<<features<<std::endl;
}
std::string outputFilename;
while(arguments.read("-o", outputFilename)) {}
osg::ref_ptr<ForestTechniqueManager> ttm = new ForestTechniqueManager;
// add the stats handler
@@ -1475,8 +1517,13 @@ int main( int argc, char **argv )
viewer.addEventHandler(new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()));
// add model to viewer.
viewer.setSceneData( ttm->createScene(numTreesToCreate, maxNumTreesPerCell) );
viewer.setSceneData( ttm->createScene(numTreesToCreate, maxNumTreesPerCell, features) );
if (!outputFilename.empty())
{
osgDB::writeNodeFile(*viewer.getSceneData(), outputFilename);
return 0;
}
return viewer.run();
}

View File

@@ -138,9 +138,7 @@ void getPossibleConfigs(GraphicsContext* gc, BufferConfigList& colorConfigs,
return;
if (ext->isMultisampleSupported)
glGetIntegerv(GL_MAX_SAMPLES_EXT, &maxSamples);
// isMultisampleCoverageSupported
if (isGLExtensionSupported(contextID,
"GL_NV_framebuffer_multisample_coverage"))
if (ext->isRenderbufferMultisampleCoverageSupported())
{
glGetIntegerv(GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV,
&coverageSampleConfigs);
@@ -722,6 +720,8 @@ GraphicsContext* setupGC(osgViewer::Viewer& viewer, ArgumentParser& arguments)
traits->windowDecoration = decoration;
traits->doubleBuffer = true;
traits->sharedContext = 0;
traits->readDISPLAY();
traits->setUndefinedScreenDetailsToDefaultScreen();
ref_ptr<GraphicsContext> gc = GraphicsContext::createGraphicsContext(traits.get());
osgViewer::GraphicsWindow* gw = dynamic_cast<osgViewer::GraphicsWindow*>(gc.get());

View File

@@ -77,7 +77,7 @@ int main( int argc, char **argv )
arguments.getApplicationUsage()->addCommandLineOption("-o <filename>","Base output filename of the images, recommended to use something like Images/image.png");
arguments.getApplicationUsage()->addCommandLineOption("--cs <filename>","Load pre-generated configuration file for run.");
arguments.getApplicationUsage()->addCommandLineOption("--ouput-cs <filename>","Output configuration file with settings provided on commandline.");
arguments.getApplicationUsage()->addCommandLineOption("-p <filename>","Use specificied camera path file to control camera position.");
arguments.getApplicationUsage()->addCommandLineOption("-p <filename>","Use specified camera path file to control camera position.");
arguments.getApplicationUsage()->addCommandLineOption("--offscreen","Use an pbuffer to render the images offscreen.");
arguments.getApplicationUsage()->addCommandLineOption("--screen","Use an window to render the images.");
arguments.getApplicationUsage()->addCommandLineOption("--width <width>","Window/output image width.");

View File

@@ -148,7 +148,7 @@ osg::Node* createScene()
// create a Vec3Array and add to it all my coordinates.
// Like all the *Array variants (see include/osg/Array) , Vec3Array is derived from both osg::Array
// and std::vector<>. osg::Array's are reference counted and hence sharable,
// and std::vector<>. osg::Array's are reference counted and hence shareable,
// which std::vector<> provides all the convenience, flexibility and robustness
// of the most popular of all STL containers.
osg::Vec3Array* vertices = new osg::Vec3Array;

View File

@@ -17,7 +17,7 @@
*/
#ifdef _MSC_VER
#include <Windows.h>
#include <windows.h>
#pragma warning( disable : 4244 )
#endif

View File

@@ -48,7 +48,7 @@ class MoveEarthySkyWithEyePointTransform : public osg::Transform
{
public:
/** Get the transformation matrix which moves from local coords to world coords.*/
virtual bool computeLocalToWorldMatrix(osg::Matrix& matrix,osg::NodeVisitor* nv) const
virtual bool computeLocalToWorldMatrix(osg::Matrix& matrix,osg::NodeVisitor* nv) const
{
osgUtil::CullVisitor* cv = dynamic_cast<osgUtil::CullVisitor*>(nv);
if (cv)
@@ -63,7 +63,7 @@ public:
virtual bool computeWorldToLocalMatrix(osg::Matrix& matrix,osg::NodeVisitor* nv) const
{
std::cout<<"computing transform"<<std::endl;
osgUtil::CullVisitor* cv = dynamic_cast<osgUtil::CullVisitor*>(nv);
if (cv)
{
@@ -99,7 +99,7 @@ osg::Group* createModel()
// add the sky and base layer.
transform->addChild(makeSky()); // bin number -2 so drawn first.
transform->addChild(makeBase()); // bin number -1 so draw second.
transform->addChild(makeBase()); // bin number -1 so draw second.
// add the transform to the earth sky.
clearNode->addChild(transform);
@@ -138,14 +138,14 @@ int main( int argc, char **argv )
arguments.getApplicationUsage()->write(std::cout);
return 1;
}
bool customWindows = false;
while(arguments.read("-2")) customWindows = true;
if (customWindows)
{
osg::GraphicsContext::WindowingSystemInterface* wsi = osg::GraphicsContext::getWindowingSystemInterface();
if (!wsi)
if (!wsi)
{
osg::notify(osg::NOTICE)<<"View::setUpViewAcrossAllScreens() : Error, no WindowSystemInterface available, cannot create windows."<<std::endl;
return 0;
@@ -159,6 +159,8 @@ int main( int argc, char **argv )
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())
@@ -186,17 +188,17 @@ int main( int argc, char **argv )
viewer.addSlave(camera.get(), osg::Matrixd(), osg::Matrixd::scale(aspectRatioScale,1.0,1.0));
}
}
}
else
{
viewer.setUpViewAcrossAllScreens();
}
// set up the camera manipulation with our custom manipultor
viewer.setCameraManipulator(new GliderManipulator());
// pass the scene graph to the viewer
// pass the scene graph to the viewer
viewer.setSceneData( createModel() );
return viewer.run();

View File

@@ -18,7 +18,7 @@
* THE SOFTWARE.
*/
#if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
#if defined(_WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
// disable the double to float errors.
#pragma warning( disable : 4305 )
#endif

View File

@@ -18,7 +18,7 @@
* THE SOFTWARE.
*/
#if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
#if defined(_WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
// disable the double to float errors.
#pragma warning( disable : 4305 )
#endif

View File

@@ -18,7 +18,7 @@
* THE SOFTWARE.
*/
#if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
#if defined(_WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
// disable the double to float errors.
#pragma warning( disable : 4305 )
#endif

View File

@@ -64,7 +64,7 @@ void KeyboardModel::keyChange(int key, int virtualKey, int value)
{
osg::notify(osg::INFO) << "key value change, code="<<std::hex << key << "\t value="<< value << std::dec << std::endl;
// toggle the keys graphical representation on or off via osg::Swithc
// toggle the keys graphical representation on or off via osg::Switch
KeyModelMap::iterator itr = _keyModelMap.find(virtualKey);
if (itr!=_keyModelMap.end())
{

View File

@@ -71,11 +71,11 @@ public:
bool _addToModel;
};
class DeleteSelectedNodesVisitor : public osg::NodeVisitor
class SelectedNodesVisitor : public osg::NodeVisitor
{
public:
DeleteSelectedNodesVisitor():
SelectedNodesVisitor():
osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN)
{
}
@@ -110,6 +110,23 @@ public:
}
}
osg::ref_ptr<osg::Node> createSelectedNodeSubgraph()
{
if (_selectedNodes.empty()) return osg::ref_ptr<osg::Node>();
if (_selectedNodes.size()==1) return _selectedNodes[0];
// note code doesn't yet handle selected nodes being nested within transforms.
osg::ref_ptr<osg::Group> group;
for(SelectedNodes::iterator itr = _selectedNodes.begin();
itr != _selectedNodes.end();
++itr)
{
group->addChild(*itr);
}
return group;
}
typedef std::vector< osg::ref_ptr<osgFX::Scribe> > SelectedNodes;
SelectedNodes _selectedNodes;
@@ -150,6 +167,18 @@ public:
osg::notify(osg::NOTICE)<<"Saved model to file 'saved_model.osgt'"<<std::endl;
osgDB::writeNodeFile(*(viewer->getSceneData()), "saved_model.osgt");
}
else if (ea.getKey()=='s')
{
SelectedNodesVisitor snv;
viewer->getSceneData()->accept(snv);
osg::ref_ptr<osg::Node> selected = snv.createSelectedNodeSubgraph();
if (selected)
{
osg::notify(osg::NOTICE)<<"Saved selected to file 'saved_selected.osgt'"<<std::endl;
osgDB::writeNodeFile(*(viewer->getSceneData()), "saved_selected.osgt");
}
}
else if (ea.getKey()=='p')
{
_usePolytopeIntersector = !_usePolytopeIntersector;
@@ -167,7 +196,7 @@ public:
{
osg::notify(osg::NOTICE)<<"Using window coordinates for picking"<<std::endl;
} else {
osg::notify(osg::NOTICE)<<"Using projection coordiates for picking"<<std::endl;
osg::notify(osg::NOTICE)<<"Using projection coordinates for picking"<<std::endl;
}
}
else if (ea.getKey()=='a')
@@ -177,7 +206,7 @@ public:
else if (ea.getKey()==osgGA::GUIEventAdapter::KEY_Delete || ea.getKey()==osgGA::GUIEventAdapter::KEY_BackSpace)
{
osg::notify(osg::NOTICE)<<"Delete"<<std::endl;
DeleteSelectedNodesVisitor dsnv;
SelectedNodesVisitor dsnv;
viewer->getSceneData()->accept(dsnv);
dsnv.pruneSelectedNodes();
}
@@ -401,7 +430,7 @@ public:
if (cmtsv._group->getNumChildren()>0)
{
std::cout<<"Writing selected compoents to 'selected_model.osgt'"<<std::endl;
std::cout<<"Writing selected components to 'selected_model.osgt'"<<std::endl;
osgDB::writeNodeFile(*cmtsv._group, "selected_model.osgt");
}
}

View File

@@ -57,7 +57,7 @@ class ContextTest : public MemoryTest
_width(width),
_height(height),
_pbuffer(pbuffer) {}
virtual osg::GraphicsContext* allocate()
{
osg::ref_ptr<osg::GraphicsContext::Traits> traits = new osg::GraphicsContext::Traits;
@@ -65,9 +65,11 @@ class ContextTest : public MemoryTest
traits->height = _height;
traits->windowDecoration = true;
traits->pbuffer = _pbuffer;
traits->readDISPLAY();
traits->setUndefinedScreenDetailsToDefaultScreen();
osg::ref_ptr<osg::GraphicsContext> window = osg::GraphicsContext::createGraphicsContext(traits.get());
if (window.valid())
if (window.valid())
{
if (window->realize())
{
@@ -82,15 +84,15 @@ class ContextTest : public MemoryTest
else
{
std::cerr<<"Error: Unable to create graphics context, problem with running osgViewer-"<<osgViewerGetVersion()<<", cannot create windows/pbuffers."<<std::endl;
if (_pbuffer) throw "Failed to create PixelBuffer";
else throw "Failed to create GraphicsWindow";
}
}
protected:
int _width;
int _height;
bool _pbuffer;
@@ -102,19 +104,19 @@ class ContextTest : public MemoryTest
class StateAttributeObject : public GLObject
{
public:
StateAttributeObject(osg::StateAttribute* sa): _attribute(sa) {}
void apply(osg::RenderInfo& renderInfo)
{
_attribute->apply(*renderInfo.getState());
if (renderInfo.getState()->checkGLErrors(_attribute.get()))
{
throw "OpenGL error";
}
}
osg::ref_ptr<osg::StateAttribute> _attribute;
};
@@ -129,40 +131,40 @@ class TextureTest : public GLMemoryTest
_width(width),
_height(height),
_depth(depth) {}
virtual GLObject* allocate()
{
if (_depth>1)
{
osg::ref_ptr<osg::Image> image = new osg::Image;
image->allocateImage(_width, _height, _depth, GL_RGBA, GL_UNSIGNED_BYTE);
osg::ref_ptr<osg::Texture3D> texture = new osg::Texture3D;
texture->setImage(image.get());
texture->setResizeNonPowerOfTwoHint(false);
return new StateAttributeObject(texture.get());
}
if (_height>1)
{
osg::ref_ptr<osg::Image> image = new osg::Image;
image->allocateImage(_width, _height, 1, GL_RGBA, GL_UNSIGNED_BYTE);
osg::ref_ptr<osg::Texture2D> texture = new osg::Texture2D;
texture->setImage(image.get());
texture->setResizeNonPowerOfTwoHint(false);
return new StateAttributeObject(texture.get());
}
if (_width>1)
{
osg::ref_ptr<osg::Image> image = new osg::Image;
image->allocateImage(_width, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE);
osg::ref_ptr<osg::Texture1D> texture = new osg::Texture1D;
texture->setImage(image.get());
texture->setResizeNonPowerOfTwoHint(false);
return new StateAttributeObject(texture.get());
}
else
@@ -170,10 +172,10 @@ class TextureTest : public GLMemoryTest
throw "Invalid texture size of 0,0,0";
}
}
protected:
int _width;
int _height;
int _depth;
@@ -191,7 +193,7 @@ class FboTest : public GLMemoryTest
_width(width),
_height(height),
_depth(depth) {}
virtual GLObject* allocate()
{
osg::ref_ptr<osg::FrameBufferObject> fbo = new osg::FrameBufferObject;
@@ -201,10 +203,10 @@ class FboTest : public GLMemoryTest
return new StateAttributeObject(fbo.get());
}
protected:
int _width;
int _height;
int _depth;
@@ -218,19 +220,19 @@ class FboTest : public GLMemoryTest
class DrawableObject : public GLObject
{
public:
DrawableObject(osg::Drawable* drawable): _drawable(drawable) {}
void apply(osg::RenderInfo& renderInfo)
{
_drawable->draw(renderInfo);
if (renderInfo.getState()->checkGLErrors("Drawable"))
{
throw "OpenGL error";
}
}
osg::ref_ptr<osg::Drawable> _drawable;
};
@@ -240,20 +242,20 @@ class DrawableObject : public GLObject
class GeometryTest : public GLMemoryTest
{
public:
enum GLObjectType
{
VERTEX_ARRAY,
DISPLAY_LIST,
VERTEX_BUFFER_OBJECT
};
GeometryTest(GLObjectType type, int width=64, int height=64):
_glObjectType(type),
_width(width),
_height(height) {}
virtual GLObject* allocate()
{
unsigned int numVertices = _width * _height;
@@ -279,11 +281,11 @@ class GeometryTest : public GLMemoryTest
quads->push_back(i + (j+1)*_width);
}
}
osg::Geometry* geometry = new osg::Geometry;
geometry->setVertexArray(vertices);
geometry->addPrimitiveSet(quads);
switch(_glObjectType)
{
case(VERTEX_ARRAY):
@@ -302,10 +304,10 @@ class GeometryTest : public GLMemoryTest
return new DrawableObject(geometry);
}
protected:
GLObjectType _glObjectType;
int _width;
int _height;
@@ -314,7 +316,7 @@ class GeometryTest : public GLMemoryTest
int main( int argc, char **argv )
{
osg::ArgumentParser arguments(&argc,argv);
arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName());
arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" tests OpenGL and Windowing memory scalability..");
arguments.getApplicationUsage()->addCommandLineOption("-h or --help","List command line options.");
@@ -351,7 +353,7 @@ int main( int argc, char **argv )
ContextTests contextTests;
GLMemoryTests glMemoryTests;
int width, height, depth;
while(arguments.read("--pbuffer",width,height)) { contextTests.push_back(new ContextTest(width, height, true)); }
while(arguments.read("--pbuffer")) { contextTests.push_back(new ContextTest(512, 512, true)); }
@@ -396,20 +398,20 @@ int main( int argc, char **argv )
return 1;
}
#endif
typedef std::list< osg::ref_ptr<osg::GraphicsContext> > Contexts;
typedef std::list< osg::ref_ptr<GLObject> > GLObjects;
Contexts allocatedContexts;
GLObjects glObjects;
if (contextTests.empty())
{
if (glMemoryTests.empty())
{
std::cout<<"No tests specified, please specify test using the command line options below."<<std::endl<<std::endl;
arguments.getApplicationUsage()->write(std::cout,osg::ApplicationUsage::COMMAND_LINE_OPTION);
return 1;
return 1;
}
else
{
@@ -421,14 +423,14 @@ int main( int argc, char **argv )
// use printf's below as C++'s ostream classes use more memory and are more likely to fail when everything
// goes wrong with memory allocations.
int numContextIterations = 0;
int numGLObjectIterations = 0;
int numGLObjectsApplied = 0;
try
{
for(; numGLObjectIterations<maxNumGLIterations; ++numGLObjectIterations)
{
{
for(GLMemoryTests::iterator itr = glMemoryTests.begin();
itr != glMemoryTests.end();
++itr)
@@ -437,7 +439,7 @@ int main( int argc, char **argv )
if (glObject.valid()) glObjects.push_back(glObject.get());
}
}
for(;numContextIterations<maxNumContextIterations; ++numContextIterations)
{
printf("GraphicsContext %i\n",numContextIterations);
@@ -451,10 +453,10 @@ int main( int argc, char **argv )
allocatedContexts.push_back(context);
context->makeCurrent();
osg::RenderInfo renderInfo;
renderInfo.setState(context->getState());
for(GLObjects::iterator gitr = glObjects.begin();
gitr != glObjects.end();
++gitr)
@@ -466,9 +468,9 @@ int main( int argc, char **argv )
(*gitr)->apply(renderInfo);
++numGLObjectsApplied;
}
context->releaseContext();
printf("\n\n"); fflush(stdout);
}
}
@@ -489,7 +491,7 @@ int main( int argc, char **argv )
printf("\nSuccessful completion, contexts created = %i, gl objects applied = %i\n",numContextIterations, numGLObjectsApplied);
printf("Duration = %f seconds.\n\n",osg::Timer::instance()->delta_s(startTick, endTick));
return 0;
}

View File

@@ -417,7 +417,7 @@ int main(int argc, char** argv)
arguments.getApplicationUsage()->addCommandLineOption("--shader","Use shaders to post process the video.");
arguments.getApplicationUsage()->addCommandLineOption("--interactive","Use camera manipulator to allow movement around movie.");
arguments.getApplicationUsage()->addCommandLineOption("--flip","Flip the movie so top becomes bottom.");
#if defined(WIN32) || defined(__APPLE__)
#if defined(_WIN32) || defined(__APPLE__)
arguments.getApplicationUsage()->addCommandLineOption("--devices","Print the Video input capability via QuickTime and exit.");
#endif
@@ -433,7 +433,7 @@ int main(int argc, char** argv)
return 1;
}
#if defined(WIN32) || defined(__APPLE__)
#if defined(_WIN32) || defined(__APPLE__)
// if user requests devices video capability.
if (arguments.read("-devices") || arguments.read("--devices"))
{
@@ -641,7 +641,11 @@ int main(int argc, char** argv)
if (wsi)
{
unsigned int width, height;
wsi->getScreenResolution(osg::GraphicsContext::ScreenIdentifier(0), width, height);
osg::GraphicsContext::ScreenIdentifier main_screen_id;
main_screen_id.readDISPLAY();
main_screen_id.setUndefinedScreenDetailsToDefaultScreen();
wsi->getScreenResolution(main_screen_id, width, height);
screenAspectRatio = float(width) / float(height);
}

View File

@@ -91,7 +91,11 @@ int main( int argc, char **argv )
}
unsigned int width, height;
wsi->getScreenResolution(osg::GraphicsContext::ScreenIdentifier(0), width, height);
osg::GraphicsContext::ScreenIdentifier main_screen_id;
main_screen_id.readDISPLAY();
main_screen_id.setUndefinedScreenDetailsToDefaultScreen();
wsi->getScreenResolution(main_screen_id, width, height);
osg::ref_ptr<osg::GraphicsContext::Traits> traits = new osg::GraphicsContext::Traits;
traits->x = 100;
@@ -101,6 +105,8 @@ int main( int argc, char **argv )
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

@@ -109,8 +109,9 @@ bool PickHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapte
user_event->setName("osc_test_1");
_device->sendEvent(*user_event);
return true;
}
return false;
}
default:
@@ -443,6 +444,8 @@ int main( int argc, char **argv )
traits->doubleBuffer = true;
traits->sharedContext = 0;
traits->windowName = "Receiver / view two";
traits->readDISPLAY();
traits->setUndefinedScreenDetailsToDefaultScreen();
osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get());
@@ -509,6 +512,8 @@ int main( int argc, char **argv )
traits->doubleBuffer = true;
traits->sharedContext = 0;
traits->windowName = "Sender / view one";
traits->readDISPLAY();
traits->setUndefinedScreenDetailsToDefaultScreen();
osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get());

View File

@@ -175,7 +175,7 @@ int main( int argc, char** argv )
// A floating error of delta-time should be explained here:
// The particles emitter, program and updater all use a 'dt' to compute the time value in every frame.
// Because the 'dt' is a double value, it is not suitable to keep three copies of it separately, which
// is the previous implementation. The small error makes some opeartors unable to work correctly, e.g.
// is the previous implementation. The small error makes some operators unable to work correctly, e.g.
// the BounceOperator.
// Now we make use of the getDeltaTime() of ParticleSystem to maintain and dispatch the delta time. But..
// it is not the best solution so far, since there are still very few particles acting unexpectedly.

View File

@@ -644,6 +644,7 @@ bool SlideEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIAction
}
_album->setVisibility();
return true;
}

View File

@@ -76,7 +76,7 @@ void computeViewMatrixOnEarth( osg::Camera* camera, osg::Node* scene,
osg::CoordinateSystemNode* csn = findTopMostNodeOfType<osg::CoordinateSystemNode>(scene);
if ( !csn ) return;
// Compute eye point in world coordiantes
// Compute eye point in world coordinates
osg::Vec3d eye;
csn->getEllipsoidModel()->convertLatLongHeightToXYZ(
latLongHeight.x(), latLongHeight.y(), latLongHeight.z(), eye.x(), eye.y(), eye.z() );

View File

@@ -39,7 +39,7 @@
//
// A simple demo demonstrating planar reflections using multiple renderings
// of a subgraph, overriding of state attribures and use of the stencil buffer.
// of a subgraph, overriding of state attributes and use of the stencil buffer.
//
// The multipass system implemented here is a variation of Mark Kilgard's
// paper "Improving Shadows and Reflections via the Stencil Buffer" which

View File

@@ -99,19 +99,19 @@ class WindowCaptureCallback : public osg::Camera::DrawCallback
switch(_mode)
{
case(READ_PIXELS):
osg::notify(osg::NOTICE)<<"Reading window usig glReadPixels, with out PixelBufferObject."<<std::endl;
osg::notify(osg::NOTICE)<<"Reading window using glReadPixels, with out PixelBufferObject."<<std::endl;
break;
case(SINGLE_PBO):
osg::notify(osg::NOTICE)<<"Reading window usig glReadPixels, with a single PixelBufferObject."<<std::endl;
osg::notify(osg::NOTICE)<<"Reading window using glReadPixels, with a single PixelBufferObject."<<std::endl;
_pboBuffer.push_back(0);
break;
case(DOUBLE_PBO):
osg::notify(osg::NOTICE)<<"Reading window usig glReadPixels, with a double buffer PixelBufferObject."<<std::endl;
osg::notify(osg::NOTICE)<<"Reading window using glReadPixels, with a double buffer PixelBufferObject."<<std::endl;
_pboBuffer.push_back(0);
_pboBuffer.push_back(0);
break;
case(TRIPLE_PBO):
osg::notify(osg::NOTICE)<<"Reading window usig glReadPixels, with a triple buffer PixelBufferObject."<<std::endl;
osg::notify(osg::NOTICE)<<"Reading window using glReadPixels, with a triple buffer PixelBufferObject."<<std::endl;
_pboBuffer.push_back(0);
_pboBuffer.push_back(0);
_pboBuffer.push_back(0);
@@ -712,6 +712,8 @@ int main(int argc, char** argv)
traits->pbuffer = true;
traits->doubleBuffer = true;
traits->sharedContext = 0;
traits->readDISPLAY();
traits->setUndefinedScreenDetailsToDefaultScreen();
pbuffer = osg::GraphicsContext::createGraphicsContext(traits.get());
if (pbuffer.valid())

View File

@@ -69,7 +69,7 @@ osg::Node* createTextGroup(const char** text)
// loop through all children
seq->setInterval(osg::Sequence::LOOP, 0,-1);
// real-time playback, repeat indefinitively
// real-time playback, repeat indefinitely
seq->setDuration(1.0f, -1);
// must be started explicitly
@@ -157,7 +157,7 @@ osg::Sequence* createSequence(osg::ArgumentParser& arguments)
// loop through all children
seq->setInterval(osg::Sequence::LOOP, 0,-1);
// real-time playback, repeat indefinitively
// real-time playback, repeat indefinitely
seq->setDuration(1.0f, -1);
seq->setMode(osg::Sequence::START);
@@ -244,7 +244,7 @@ int main( int argc, char **argv )
"- is subclassed from osg::Switch",
"- assigns a display duration to each child",
"- can loop or swing through an interval of it's children",
"- can repeat the interval a number of times or indefinitively",
"- can repeat the interval a number of times or indefinitely",
"- press 's' to start/pause/resume",
"- press 'l' to toggle loop/swing mode",
NULL

View File

@@ -99,7 +99,7 @@ osg::Node* createOldShaderCompositionScene(osg::ArgumentParser& arguments)
group->addChild(pat);
}
// resuse the first ShaderAttribute's type and ShaderComponent, just use new uniform
// reuse the first ShaderAttribute's type and ShaderComponent, just use new uniform
{
osg::PositionAttitudeTransform* pat = new osg::PositionAttitudeTransform;
pat->setPosition(position);
@@ -119,7 +119,7 @@ osg::Node* createOldShaderCompositionScene(osg::ArgumentParser& arguments)
}
// resuse the first ShaderAttribute's type and ShaderComponent, just use new uniform
// reuse the first ShaderAttribute's type and ShaderComponent, just use new uniform
{
osg::PositionAttitudeTransform* pat = new osg::PositionAttitudeTransform;
pat->setPosition(position);

View File

@@ -314,7 +314,7 @@ int main(int, char **)
osg::ref_ptr<TestSupportOperation> testSupportOperation = new TestSupportOperation;
#if 0
// temporily commenting out as its causing the viewer to crash... no clue yet to why
// temporarily commenting out as its causing the viewer to crash... no clue yet to why
viewer.setRealizeOperation(testSupportOperation.get());
#endif
// create the windows and run the threads.

View File

@@ -18,7 +18,7 @@
* THE SOFTWARE.
*/
#if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
#if defined(_WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
// disable the double to float errors.
#pragma warning( disable : 4305 )
#endif

View File

@@ -182,7 +182,11 @@ void singleWindowSideBySideCameras(osgViewer::Viewer& viewer)
}
unsigned int width, height;
wsi->getScreenResolution(osg::GraphicsContext::ScreenIdentifier(0), width, height);
osg::GraphicsContext::ScreenIdentifier main_screen_id;
main_screen_id.readDISPLAY();
main_screen_id.setUndefinedScreenDetailsToDefaultScreen();
wsi->getScreenResolution(main_screen_id, width, height);
@@ -198,6 +202,8 @@ void singleWindowSideBySideCameras(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())

View File

@@ -87,6 +87,8 @@ int main( int argc, char** argv )
traits->windowDecoration = true;
traits->doubleBuffer = true;
traits->glContextVersion = version;
traits->readDISPLAY();
traits->setUndefinedScreenDetailsToDefaultScreen();
osg::ref_ptr< osg::GraphicsContext > gc = osg::GraphicsContext::createGraphicsContext( traits.get() );
if( !gc.valid() )
{
@@ -156,7 +158,7 @@ If you have an external project that will depend on OSG built for OpenGL 3.x,
you'll need to ensure your external project also uses the compiler include
directives to find <GL3/gl3.h>.
To berify your application is using a pure OpenGL 3.x context, set
To verify your application is using a pure OpenGL 3.x context, set
OSG_NOTIFY_LEVEL=INFO in the environment and check the console output. Context
creation displays output such as the following:
GL3: Attempting to create OpenGL3 context.

View File

@@ -16,7 +16,7 @@
* THE SOFTWARE.
*/
#if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
#if defined(_WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
/////////////////////////////////////////////////////////////////////////////
// Disable unavoidable warning messages:
@@ -32,7 +32,7 @@
#pragma warning(disable : 4103 4114 4201 4237 4251 4275 4290 4503 4335 4786)
#endif // WIN32
#endif // _WIN32
#include <osgViewer/Viewer>
#include <osgViewer/ViewerEventHandlers>

View File

@@ -142,6 +142,8 @@ int main( int argc, char **argv )
traits->doubleBuffer = true;
traits->sharedContext = 0;
traits->pbuffer = false;
traits->readDISPLAY();
traits->setUndefinedScreenDetailsToDefaultScreen();
osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get());
if (!gc || !gc->valid())

View File

@@ -470,7 +470,7 @@ osg::Geometry *makePols (void) {
gtess->setStateSet( stateset );
int nstart=0;
// the contours accepoted are polygons; quads & tris. Trifans can bve added later.
// the contours accepted are polygons; quads & tris. Trifans can be added later.
gtess->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::QUADS,nstart,12));nstart+=12;
gtess->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::QUADS,nstart,12));nstart+=12;
gtess->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::POLYGON,nstart,16));nstart+=16;

View File

@@ -1,9 +1,9 @@
/* A demonstration of Tessellation Shaders in OpenScenegraph.
*
* Instructions:
* Press plus to increase tesselation and minus to decrease it.
* Press right arrow to increase inner tesselation and left arrow to decrease it.
* Press up arrow to increase outer tesselation and down arrow to decrease it.
* Press plus to increase tessellation and minus to decrease it.
* Press right arrow to increase inner tessellation and left arrow to decrease it.
* Press up arrow to increase outer tessellation and down arrow to decrease it.
*
* Original code by Philip Rideout
* Adapted to OpenScenegraph by John Kaniarz

View File

@@ -440,7 +440,7 @@ osg::Group* create3DText(const osg::Vec3& center,float radius)
text5->setFont("fonts/times.ttf");
//text5->setCharacterSize(characterSize);
text5->setCharacterSize(32.0f); // medium
text5->setPosition(center - osg::Vec3(0.0, 0.0, 0.2));
text5->setPosition(center - osg::Vec3(0.0, 0.0, 0.2) * radius);
text5->setAxisAlignment(osgText::Text::SCREEN);
text5->setCharacterSizeMode(osgText::Text::SCREEN_COORDS);
text5->setDrawMode(osgText::Text::TEXT | osgText::Text::BOUNDINGBOX);
@@ -451,7 +451,7 @@ osg::Group* create3DText(const osg::Vec3& center,float radius)
text6->setColor(characterSizeModeColor);
text6->setFont("fonts/times.ttf");
text6->setCharacterSize(characterSize);
text6->setPosition(center - osg::Vec3(0.0, 0.0, 0.4));
text6->setPosition(center - osg::Vec3(0.0, 0.0, 0.4) * radius);
text6->setAxisAlignment(osgText::Text::SCREEN);
text6->setCharacterSizeMode(osgText::Text::OBJECT_COORDS_WITH_MAXIMUM_SCREEN_SIZE_CAPPED_BY_FONT_HEIGHT);
text6->setText("CharacterSizeMode OBJECT_COORDS_WITH_MAXIMUM_SCREEN_SIZE_CAPPED_BY_FONT_HEIGHT");
@@ -461,7 +461,7 @@ osg::Group* create3DText(const osg::Vec3& center,float radius)
text7->setColor(characterSizeModeColor);
text7->setFont("fonts/times.ttf");
text7->setCharacterSize(characterSize);
text7->setPosition(center - osg::Vec3(0.0, 0.0, 0.6));
text7->setPosition(center - osg::Vec3(0.0, 0.0, 0.6) * radius);
text7->setAxisAlignment(osgText::Text::SCREEN);
text7->setCharacterSizeMode(osgText::Text::OBJECT_COORDS);
text7->setText("CharacterSizeMode OBJECT_COORDS (default)");
@@ -683,7 +683,7 @@ int main(int argc, char** argv)
text->setFont("fonts/times.ttf");
text->setAxisAlignment(osgText::Text::XZ_PLANE);
text->setAlignment(osgText::Text::RIGHT_TOP);
text->setText("Alingment\nBefore:");
text->setText("Alignment\nBefore:");
group->addChild(text);
}
@@ -691,8 +691,8 @@ int main(int argc, char** argv)
osg::ref_ptr<osgText::Text> text = new osgText::Text;
text->setFont("fonts/times.ttf");
text->setAxisAlignment(osgText::Text::XZ_PLANE);
text->setText("Alingment\nAfter:");
text->setAlignment(osgText::Text::RIGHT_TOP);
text->setText("Alignment\nAfter:");
text->setAlignment(osgText::Text::LEFT_TOP);
group->addChild(text);
}
@@ -754,7 +754,7 @@ int main(int argc, char** argv)
{
// prepare scene.
osg::Vec3 center(0.0f,0.0f,0.0f);
float radius = 1.0f;
float radius = 100.0f;
// make sure the root node is group so we can add extra nodes to it.
osg::Group* group = new osg::Group;

View File

@@ -43,9 +43,15 @@ public:
{
}
virtual bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter&)
virtual bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa)
{
if (ea.getEventType() == osgGA::GUIEventAdapter::KEYUP)
if (ea.getEventType() == osgGA::GUIEventAdapter::PUSH)
{
osgViewer::View* view = dynamic_cast<osgViewer::View*>(&aa);
if (view) pick(view,ea);
return false;
}
else if (ea.getEventType() == osgGA::GUIEventAdapter::KEYUP)
{
if (ea.getKey() == osgGA::GUIEventAdapter::KEY_Up)
{
@@ -83,6 +89,24 @@ public:
return false;
}
void pick(osgViewer::View* view, const osgGA::GUIEventAdapter& ea)
{
osgUtil::LineSegmentIntersector::Intersections intersections;
if (view->computeIntersections(ea, intersections))
{
OSG_NOTICE<<"found intersections : "<<std::endl;
for(osgUtil::LineSegmentIntersector::Intersections::iterator itr = intersections.begin();
itr != intersections.end();
++itr)
{
OSG_NOTICE<<" intersection "<<itr->localIntersectionPoint<<std::endl;
}
}
else
{
OSG_NOTICE<<"failed to get intersection "<<std::endl;
}
}
private:
osgText::Text3D* m_Text3D;
};

View File

@@ -543,7 +543,7 @@ public:
// now assign the appropriate portion data from the originalImage
subImage->setImage(originalImage->s()/2, originalImage->t()/2, originalImage->r(), // half the width and height
originalImage->getInternalTextureFormat(), // same internal texture format
originalImage->getPixelFormat(),originalImage->getDataType(), // same pixel foramt and data type
originalImage->getPixelFormat(),originalImage->getDataType(), // same pixel format and data type
originalImage->data(originalImage->s()/4,originalImage->t()/4), // offset the start point to 1/4 into the image
osg::Image::NO_DELETE, // don't attempt to delete the image data, leave this to the originalImage
originalImage->getPacking(), // use the same packing

View File

@@ -124,7 +124,7 @@ int main(int argc, char** argv)
if (arguments.argc()<=1)
{
std::cout<<"Please supply an image filename on the commnand line."<<std::endl;
std::cout<<"Please supply an image filename on the command line."<<std::endl;
return 1;
}
@@ -146,7 +146,11 @@ int main(int argc, char** argv)
unsigned int width, height;
wsi->getScreenResolution(osg::GraphicsContext::ScreenIdentifier(0), width, height);
osg::GraphicsContext::ScreenIdentifier main_screen_id;
main_screen_id.readDISPLAY();
main_screen_id.setUndefinedScreenDetailsToDefaultScreen();
wsi->getScreenResolution(main_screen_id, width, height);
osg::ref_ptr<osg::GraphicsContext::Traits> traits = new osg::GraphicsContext::Traits;
traits->x = 0;
@@ -155,6 +159,8 @@ int main(int argc, char** argv)
traits->height = height;
traits->windowDecoration = false;
traits->doubleBuffer = true;
traits->readDISPLAY();
traits->setUndefinedScreenDetailsToDefaultScreen();
osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get());
if (!gc)

View File

@@ -50,7 +50,7 @@ std::ostream& TestContext::tout(TraceLevel tl) const
TestContext::TraceStream::TraceStream(std::ostream& o, TraceLevel tl):
_traceLevel(tl),
_outputStreamPtr(&o),
#if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
#if defined(_WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
_nullStream("nul")
#else
_nullStream("/dev/null")

View File

@@ -215,7 +215,7 @@ void testGetQuatFromMatrix(const osg::Vec3d& scale)
double yaw2stop = 360.0;
double yaw2step = 20.0;
#else
// focussed range
// focused range
double rol1start = 0.0;
double rol1stop = 0.0;
double rol1step = 0.1;

View File

@@ -27,7 +27,7 @@ SET(TARGET_ADDED_LIBRARIES ${TARGET_ADDED_LIBRARIES}
#backup setting
SET(TMP_OSG_BUILD_APPLICATION_BUNDLES {$OSG_BUILD_APPLICATION_BUNDLES})
SET(OSG_BUILD_APPLICATION_BUNDLES TRUE)
SET(MACOSX_DEPLOYMENT_TARGET, ${IPHONE_VERSION_MIN})
#SET(MACOSX_DEPLOYMENT_TARGET, ${IPHONE_VERSION_MIN})
SETUP_EXAMPLE(osgViewerIPhone)
SET_TARGET_PROPERTIES(example_osgViewerIPhone PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer"
XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET ${IPHONE_VERSION_MIN}
@@ -35,4 +35,4 @@ SET_TARGET_PROPERTIES(example_osgViewerIPhone PROPERTIES XCODE_ATTRIBUTE_CODE_SI
#restore setting
SET(OSG_BUILD_APPLICATION_BUNDLES {$TMP_OSG_BUILD_APPLICATION_BUNDLES})
SET(CMAKE_EXE_LINKER_FLAGS "-framework QuartzCore -framework Foundation -framework OpenGLES -framework UIKit -framework ImageIO -framework CoreImage -framework MobileCoreServices -framework CoreGraphics")
SET(CMAKE_EXE_LINKER_FLAGS "-framework QuartzCore -framework Foundation -framework UIKit -framework ImageIO -framework CoreImage -framework MobileCoreServices -framework CoreGraphics")

View File

@@ -104,7 +104,7 @@ void cOSG::InitCameraConfig(void)
camera->setGraphicsContext(gc);
// Set the viewport for the Camera
camera->setViewport(new osg::Viewport(traits->x, traits->y, traits->width, traits->height));
camera->setViewport(new osg::Viewport(0, 0, traits->width, traits->height));
// set the draw and read buffers up for a double buffered window with rendering going to back buffer
camera->setDrawBuffer(GL_BACK);

View File

@@ -10,7 +10,7 @@
#endif
// For wxCURSOR_BLANK below, but isn't used a.t.m.
//#ifdef WIN32
//#ifdef _WIN32
//#include "wx/msw/wx.rc"
//#endif
@@ -140,7 +140,8 @@ END_EVENT_TABLE()
OSGCanvas::OSGCanvas(wxWindow *parent, wxWindowID id,
const wxPoint& pos, const wxSize& size, long style, const wxString& name, int *attributes)
: wxGLCanvas(parent, id, pos, size, style|wxFULL_REPAINT_ON_RESIZE, name, attributes)
: wxGLCanvas(parent, id, attributes, pos, size, style|wxFULL_REPAINT_ON_RESIZE, name)
,_context(this)
{
// default cursor to standard
_oldCursor = *wxSTANDARD_CURSOR;
@@ -150,6 +151,11 @@ OSGCanvas::~OSGCanvas()
{
}
void OSGCanvas::SetContextCurrent()
{
_context.SetCurrent(*this);
}
void OSGCanvas::OnPaint( wxPaintEvent& WXUNUSED(event) )
{
/* must always be here */
@@ -158,8 +164,6 @@ void OSGCanvas::OnPaint( wxPaintEvent& WXUNUSED(event) )
void OSGCanvas::OnSize(wxSizeEvent& event)
{
// this is also necessary to update the context on some platforms
wxGLCanvas::OnSize(event);
// set GL viewport (not called by wxGLCanvas::OnSize on all platforms...)
int width, height;
@@ -337,7 +341,7 @@ void GraphicsWindowWX::useCursor(bool cursorOn)
bool GraphicsWindowWX::makeCurrentImplementation()
{
_canvas->SetCurrent();
_canvas->SetContextCurrent();
return true;
}

View File

@@ -38,12 +38,14 @@ public:
void UseCursor(bool value);
void SetContextCurrent();
private:
DECLARE_EVENT_TABLE()
osg::ref_ptr<osgViewer::GraphicsWindow> _graphics_window;
wxCursor _oldCursor;
wxGLContext _context;
};
class GraphicsWindowWX : public osgViewer::GraphicsWindow

View File

@@ -25,6 +25,7 @@ class EscapeHandler : public osgGA::GUIEventHandler
return true;
}
break;
}
default:
@@ -95,7 +96,7 @@ int main(int argc,char** argv)
// add a custom escape handler, but disable the standard viewer one to enable the vnc images to handle
// the escape without it getting caught by the viewer.
viewer.addEventHandler(new EscapeHandler);
viewer.addEventHandler(new EscapeHandler);
viewer.setKeyEventSetsDone(0);
return viewer.run();

View File

@@ -58,6 +58,8 @@ int main( int argc, char **argv )
traits->windowDecoration = true;
traits->doubleBuffer = true;
traits->sharedContext = 0;
traits->readDISPLAY();
traits->setUndefinedScreenDetailsToDefaultScreen();
osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get());
@@ -82,6 +84,8 @@ int main( int argc, char **argv )
traits->windowDecoration = true;
traits->doubleBuffer = true;
traits->sharedContext = 0;
traits->readDISPLAY();
traits->setUndefinedScreenDetailsToDefaultScreen();
osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext(traits.get());

View File

@@ -16,7 +16,7 @@
#include <OpenThreads/Config>
#ifndef WIN32
#ifndef _WIN32
#define OPENTHREAD_EXPORT_DIRECTIVE
#else
#if defined( OT_LIBRARY_STATIC )

View File

@@ -109,10 +109,15 @@ public:
/**
* Return a pointer to the current running thread
* Return a pointer to the current running thread, returns NULL for a non OpenThreads thread.
*/
static Thread *CurrentThread();
/**
* Return the id of the current thread
*/
static size_t CurrentThreadId();
/**
* Initialize Threading in a program. This method must be called before
@@ -147,7 +152,7 @@ public:
*
* @return a unique thread identifier
*/
int getThreadId();
size_t getThreadId();
/**
* Get the thread's process id. This is the pthread_t or pid_t value

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