Compare commits

..

212 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
248 changed files with 2776 additions and 1185 deletions

1
.gitignore vendored
View File

@@ -89,6 +89,7 @@ PlatformSpecifics/Windows/*.rc
# Visual Studio - Cache/Options Directory
.vs/
.vscode/*
#osx xcode
DerivedData/

View File

@@ -3,13 +3,13 @@
#
SET(OPENSCENEGRAPH_MAJOR_VERSION 3)
SET(OPENSCENEGRAPH_MINOR_VERSION 6)
SET(OPENSCENEGRAPH_PATCH_VERSION 4)
SET(OPENSCENEGRAPH_SOVERSION 160)
SET(OPENSCENEGRAPH_PATCH_VERSION 5)
SET(OPENSCENEGRAPH_SOVERSION 162)
# set to 0 when not a release candidate, non zero means that any generated
# git tags will be treated as release candidates of given number
SET(OPENSCENEGRAPH_RELEASE_CANDIDATE 9)
SET(OPENSCENEGRAPH_RELEASE_CANDIDATE 0)
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
@@ -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)
@@ -73,18 +76,19 @@ ELSEIF(APPLE)
SET (IPHONE_ENABLE_BITCODE "NO" CACHE STRING "IOS Enable Bitcode")
# seamless toggle between device and simulator
SET(CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphoneos;-iphonesimulator")
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 "Deployment target for iOS" FORCE)
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)")
SET(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD)" CACHE STRING "Build architectures for iOS")
ELSE()
# OSX >= 10.5 uses Cocoa windowing system, otherwise Carbon
IF(OSG_OSX_VERSION VERSION_LESS 10.5)
SET(OSG_WINDOWING_SYSTEM "Carbon" CACHE STRING "Windowing system type for graphics window creation; options: Carbon, Cocoa, X11 or None.")
SET(OSG_WINDOWING_SYSTEM_CARBON ON INTERNAL "use Carbon (apple; 32 bit only)")
ELSE()
SET(OSG_WINDOWING_SYSTEM "Cocoa" CACHE STRING "Windowing system type for graphics window creation; options: Carbon, Cocoa, X11 or None.")
ENDIF()
@@ -117,6 +121,9 @@ ELSE()
SET(OSG_WINDOWING_SYSTEM "X11" CACHE STRING "Windowing system type for graphics window creation; options: X11 or None.")
ENDIF()
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})
@@ -352,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)
@@ -722,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()
@@ -733,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:
@@ -810,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)

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,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,19 +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"
"/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"
@@ -101,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

@@ -1,37 +1,34 @@
# 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
#]=======================================================================]
#[[=======================================================================.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

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

@@ -342,15 +342,20 @@ MACRO(SETUP_PLUGIN PLUGIN_NAME)
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}
@@ -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)

527
ChangeLog
View File

@@ -1,3 +1,530 @@
Fri, 31 Jan 2020 11:02:47 +0000
Author : Robert Osfield
Updates for 3.6.5 release
Fri, 31 Jan 2020 10:37:25 +0000
Author : Robert Osfield
Added mutex lock to avoid threading issues when glyphs are added to a Font from multiple threads
Thu, 30 Jan 2020 19:25:50 +0000
Author : Robert Osfield
Updates for 3.6.5-rc3
Thu, 30 Jan 2020 16:30:41 +0000
Author : OpenSceneGraph git repository
Merge pull request #911 from LaurensVoerman/FbxSdkFixFix for older versions of fbxsdk without xml or zlib libraries,
Thu, 30 Jan 2020 16:21:32 +0000
Author : Robert Osfield
Added explicit clean up removeView
Thu, 30 Jan 2020 16:32:42 +0100
Author : Laurens Voerman
Fix for older versions of fbxsdk without xml or zlib libraries, fix cmake multiconfig generators (msvc) with irrelevant CMAKE_BUILD_TYPE.
Mon, 27 Jan 2020 10:11:23 +0000
Author : OpenSceneGraph git repository
Merge pull request #907 from DeadParrot/OpenSceneGraph-3.6FBX plugin updates / PREFIX-NOTFOUND work-around
Sun, 26 Jan 2020 14:28:56 -0500
Author : Stuart Mentzer
FBX plugin updates / PREFIX-NOTFOUND work-around
Tue, 21 Jan 2020 10:11:30 +0000
Author : Robert Osfield
Updater rc number for 3.6.5-rc2, and CHangeLog
Tue, 21 Jan 2020 09:43:08 +0000
Author : Robert Osfield
Removed stray space
Tue, 21 Jan 2020 09:32:57 +0000
Author : OpenSceneGraph git repository
Merge pull request #902 from mp3butcher/oqn3.6 OQN API convergence
Tue, 21 Jan 2020 09:16:51 +0000
Author : OpenSceneGraph git repository
Merge pull request #903 from dedowsdi/renderstageAdd getPreRenderList, getPostRenderList to RenderStage.
Fri, 17 Jan 2020 18:47:49 +0800
Author : dedowsdi
Add getPreRenderList getPostRenderList to RenderStage.
Fri, 23 Aug 2019 09:59:54 +0200
Author : Daniel Trstenjak
OcclusionQueryNode: make all usages of 'updateDefaultQueryGeometry' thread safe
Fri, 23 Aug 2019 09:46:02 +0200
Author : Daniel Trstenjak
OcclusionQueryNode: fix resetting to default query geometryWhen 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.
Wed, 14 Aug 2019 11:27:40 +0200
Author : Daniel Trstenjak
OcclusionQueryNode: fix use case of user defined query geometryThe 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.
Tue, 29 Jan 2019 14:40:16 +0100
Author : Daniel Trstenjak
OcclusionQueryNode: reset the test result of the invalid geometryThere'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.
Tue, 29 Jan 2019 11:37:28 +0100
Author : Daniel Trstenjak
OcclusionQueryNode: ensure a valid query geometryIf the query geometry is invalid then don't do any occlusion queries and
never traverse the subgraphs.
Fri, 25 Jan 2019 15:02:45 +0100
Author : Daniel Trstenjak
OcclusionQueryNode: ensure a consistent value for '_passed'
Sat, 26 Jan 2019 16:33:23 +0000
Author : Robert Osfield
Introduced a QueryGeometry::getQueryResult(const osg::Camera*) method as a more informative replacedment for QueryGeometry::getNumPixels().
Mon, 20 Jan 2020 10:37:12 +0000
Author : OpenSceneGraph git repository
Merge pull request #900 from dedowsdi/fix_particle_rotationFix particle rotation.
Fri, 17 Jan 2020 11:18:30 +0800
Author : dedowsdi
Fix particle rotation.
Fri, 17 Jan 2020 09:28:09 +0000
Author : Robert Osfield
Updated ChangeLog
Fri, 17 Jan 2020 09:07:58 +0000
Author : Robert Osfield
Moved setting of isftream locale to Model::readOBJ(..) and Model::readMTL(..).
Fri, 17 Jan 2020 08:54:52 +0000
Author : Robert Osfield
Added explict setting of local to classic to avoid local platform settings affecting parsing
Tue, 14 Jan 2020 16:32:29 +0000
Author : Robert Osfield
Updated README.md for 3.6.5-rc1
Tue, 14 Jan 2020 16:30:14 +0000
Author : Robert Osfield
Updated ChangeLog and set rc candidate 1 for 3.6.5-rc1
Tue, 14 Jan 2020 16:29:07 +0000
Author : Robert Osfield
Fixed warnings
Tue, 14 Jan 2020 14:57:15 +0000
Author : Robert Osfield
Fixed build warning due to auto_ptr<>
Tue, 14 Jan 2020 14:42:01 +0000
Author : Robert Osfield
Fixed workaround for invalid indices
Mon, 13 Jan 2020 14:14:48 +0000
Author : OpenSceneGraph git repository
Merge pull request #895 from openscenegraph/CurrentThreadIdAdded commment explaining that OpenThreads::Thread::CurrentThread() r…
Mon, 13 Jan 2020 14:12:54 +0000
Author : Robert Osfield
Added commment explaining that OpenThreads::Thread::CurrentThread() return NULL on non OpenThreads thread.
Mon, 13 Jan 2020 13:41:37 +0000
Author : Robert Osfield
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
Mon, 13 Jan 2020 09:58:47 +0000
Author : Robert Osfield
Added encoding and font setting to dxfText as a first step towards making these user controllable to enble handling of non default settings
Sat, 11 Jan 2020 14:39:46 +0000
Author : Robert Osfield
Added creation of image directories when required
Fri, 10 Jan 2020 10:12:13 +0000
Author : Robert Osfield
Fixed handling of _autoScaleTransitionWidthRatio<=0.0
Tue, 7 Jan 2020 11:12:18 +0000
Author : Robert Osfield
Implemented TextBase::compileGLObjects() with handling of VAO/VBOs to address bugs associated with VAO usage of Text.
Mon, 6 Jan 2020 18:39:51 +0000
Author : Robert Osfield
Added Thread::CurrentThreadId() method to wrap up thread id functionality in a more platform appropriate way.
Mon, 6 Jan 2020 10:27:18 +0000
Author : OpenSceneGraph git repository
Merge pull request #887 from limbolily/patch-1Fix navagation error about Android GLES2 example.
Mon, 6 Jan 2020 14:48:34 +0800
Author : limbolily
Fix navagation error about Android GLES2 example.Android GLES2 example use event queue without initializing window rectangle with graphics context,that produce navigation error.
Mon, 23 Dec 2019 14:20:26 +0100
Author : Michael Danilov
Fix #877 "Shift key stuck if both shifts switch keymap"Adapted the patch from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=687332
Mon, 23 Dec 2019 14:53:17 +0000
Author : Robert Osfield
Adopted CMake's FindDCMTK.cmake variables
Sun, 22 Dec 2019 12:29:47 +0000
Author : OpenSceneGraph git repository
Merge pull request #874 from blobfish/occt7.4Occt7.4
Thu, 19 Dec 2019 11:46:05 -0500
Author : blobfish
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.
Thu, 19 Dec 2019 10:16:09 -0500
Author : blobfish
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.
Wed, 18 Dec 2019 14:25:07 +0000
Author : Robert Osfield
Added classic locale setting to avoid local setting of locale affecting the GLSL code generated.
Mon, 16 Dec 2019 17:10:39 +0000
Author : Robert Osfield
Updated ChangeLog
Mon, 16 Dec 2019 16:51:16 +0000
Author : Robert Osfield
Added automatically removal from the OjbectCache when a object or it's subgraph contain Texture that no longer have an osg::Image.
Mon, 16 Dec 2019 11:54:12 +0000
Author : OpenSceneGraph git repository
Merge pull request #871 from LaurensVoerman/commit_tgaFixfix debug compile error for ReaderWriterTGA
Mon, 16 Dec 2019 11:02:41 +0100
Author : Laurens Voerman
fix debug compile error for ReaderWriterTGA
Mon, 16 Dec 2019 09:40:30 +0000
Author : OpenSceneGraph git repository
Merge pull request #870 from eligovision/OpenSceneGraph-3.6_glext_fixGLExtensions's isPBOSupported and isVAOSupported flags fixed
Mon, 16 Dec 2019 09:40:00 +0000
Author : OpenSceneGraph git repository
Merge pull request #869 from eligovision/OpenSceneGraph-3.6_glextAdded FBO GL extensions (useful for mobile VR etc.)
Fri, 13 Dec 2019 19:40:11 +0300
Author : konstantin.matveyev
GLExtensions's isPBOSupported and isVAOSupported flags fixed for GLES2+GLES3 configuration
Fri, 13 Dec 2019 19:42:30 +0300
Author : konstantin.matveyev
GLExtensions's isInvalidateFramebufferSupported flag improved
Tue, 26 Nov 2019 17:17:38 +0800
Author : PntAndCnt
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.
Sun, 13 Oct 2019 20:24:36 +0800
Author : PntAndCnt
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.
Tue, 3 Sep 2019 16:11:14 +0800
Author : Kent
Mered fix for internalFormat
Thu, 12 Dec 2019 18:41:23 +0300
Author : valid-ptr
glInvalidateFramebuffer added to GLExtensions
Thu, 31 Oct 2019 18:59:04 +0300
Author : konstantin.matveyev
glFramebufferTexture2DMultisample added to GLExtensions
Tue, 10 Dec 2019 15:08:25 +0300
Author : Dmitry Marakasov
Add FreeBSD-specific code bits for pthread_setaffinity_np support
Thu, 12 Dec 2019 13:25:44 +0000
Author : Robert Osfield
Fix linking with Xinerama
Thu, 12 Dec 2019 13:09:33 +0000
Author : OpenSceneGraph git repository
Merge pull request #861 from aluaces/default-ffmpegSet ffmpeg as the default plugin for video files.
Fri, 22 Nov 2019 21:07:36 +0100
Author : elsid
Fix clang 8 & libc++ build errorsReplace 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.
Thu, 12 Dec 2019 10:55:35 +0000
Author : OpenSceneGraph git repository
Fixed indentation, replacing tabs with spaces
Mon, 4 Nov 2019 05:37:37 +0100
Author : Tim Moore
Fix bug in matrix transpose() and transpose3x3The diagonal elements were not copied from the source matrix.
Fri, 1 Nov 2019 09:26:28 -0700
Author : flashk
Support reading RGB float DDS imagesThe 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.
Thu, 12 Dec 2019 10:08:32 +0000
Author : OpenSceneGraph git repository
Merge pull request #851 from LaurensVoerman/submitCpSubImgfix copySubImage crash on compressed files
Wed, 25 Sep 2019 12:16:51 -0500
Author : DCFennell
GL_CLAMP_VERTEX_COLOR and GL_CLAMP_FRAGMENT_COLOR deprecated in GL core profile according to OpenGL 4.5 specification.
Mon, 23 Sep 2019 15:05:54 +0200
Author : Johannes Pabst
Fix: LuaCallbackObject could form circular references to LuaScriptEngine that prevented its destruction. Destruction of LuaScriptEngine now disarms all callbacks into Lua.
Fri, 13 Sep 2019 12:50:29 +0200
Author : Riccardo Corsi
Fbx Plugin: added plugin option to set the target axis system. Default left to OpenGL.
Thu, 12 Sep 2019 13:54:28 -0700
Author : grdowns
Add vcpkg installation instructions
Wed, 11 Dec 2019 17:51:02 +0000
Author : OpenSceneGraph git repository
Merge pull request #837 from LaurensVoerman/carbonFixfix apple carbon reference
Wed, 11 Dec 2019 17:07:27 +0000
Author : OpenSceneGraph git repository
Merge pull request #833 from cj-mcdonald/osga-fixUpdate ReaderWriterOSGA.cpp
Fri, 30 Aug 2019 16:48:25 +0200
Author : Guilhem Saurel
fix dae readme
Wed, 11 Dec 2019 16:58:50 +0000
Author : OpenSceneGraph git repository
Merge pull request #828 from eligovision/OpenSceneGraph-3.6_ios_build_fixFix build iOS: when using Toolchain or building with Makefiles (not X…
Wed, 11 Dec 2019 16:47:44 +0000
Author : OpenSceneGraph git repository
Merge pull request #822 from mp3butcher/patch-32optimize indexed color DDS conversion
Wed, 4 Dec 2019 22:10:46 +0100
Author : Alberto Luaces
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.
Fri, 1 Nov 2019 16:42:50 +0100
Author : Laurens Voerman
fix copySubImage crash on compressed files
Wed, 11 Sep 2019 10:22:16 +0200
Author : Laurens Voerman
fix apple carbon reference
Mon, 2 Sep 2019 17:43:38 +0100
Author : Colin McDonald
Update ReaderWriterOSGA.cppFix typo in osga archives which stops node files working
Fri, 23 Aug 2019 18:31:22 +0300
Author : Konstantin S. Matveyev
Fix build iOS: when using Toolchain or building with Makefiles (not Xcode)
Sun, 18 Aug 2019 17:56:51 +0200
Author : Julien Valentin
use memcpy instead of union
Sat, 17 Aug 2019 22:05:38 +0200
Author : Julien Valentin
optimize conversion with a union
Thu, 22 Aug 2019 14:49:43 +0100
Author : Robert Osfield
Removed exlict keyword to address build problems with VS older than 2015.
Sun, 18 Aug 2019 20:14:17 +0200
Author : Remo E
Debugging: Hint to debug LoadLibrary issuesThis helps to debug loading dynamic libraries in an environment without implemented "dlopen". For example emscripten with static compiled OSG.
Sat, 17 Aug 2019 20:04:38 +0100
Author : Robert Osfield
Merge branch 'OpenSceneGraph-3.6' of https://github.com/openscenegraph/OpenSceneGraph into OpenSceneGraph-3.6
Sat, 17 Aug 2019 20:04:30 +0100
Author : OpenSceneGraph git repository
Merge pull request #820 from Capostrophic/ddsDDS plugin: add support for DDPF_PALETTEINDEXED8 pixel format reading
Fri, 16 Aug 2019 13:52:56 +0200
Author : Björn Blissing
Fixed spelling error in warning message
Sat, 17 Aug 2019 15:11:49 +0300
Author : capostrophic
Fix memory leaks
Sat, 17 Aug 2019 01:43:47 +0300
Author : capostrophic
Add support for DDPF_PALETTEINDEXED8 pixel format reading
Fri, 16 Aug 2019 10:27:28 +0100
Author : Robert Osfield
Added TKXCAF to find package list
Thu, 15 Aug 2019 20:21:15 +0200
Author : Julien Valentin
remove return of local pointer
Fri, 16 Aug 2019 09:35:00 +0100
Author : OpenSceneGraph git repository
Merge pull request #818 from mp3butcher/patch-31fix comment block CMake syntax
Thu, 15 Aug 2019 20:46:52 +0200
Author : Julien Valentin
fix cmake block comment syntax
Thu, 15 Aug 2019 20:27:05 +0200
Author : Julien Valentin
remove unproperly parsed CMake commenthttps://github.com/openscenegraph/OpenSceneGraph/issues/812
Wed, 7 Aug 2019 10:56:59 +0100
Author : OpenSceneGraph git repository
Merge pull request #808 from 640kb/OpenSceneGraph-3.6las plugin: fix linking against static boost library under windows
Wed, 7 Aug 2019 09:49:16 +0200
Author : Daniel Wendt
las plugin: fix linking against static boost library under windowsSigned-off-by: Daniel Wendt <daniel.wendt@linux.com>
Wed, 31 Jul 2019 14:11:59 +0100
Author : Robert Osfield
Added a _fontFallback to TextBase to cache any fallback font (usually DefaultFont) that is used when the Textbase::_font is null.
Mon, 29 Jul 2019 13:01:00 +0100
Author : Robert Osfield
Replaced GL_QUADS usage with GL_TRIANGLE_STRIP
Mon, 29 Jul 2019 12:29:25 +0100
Author : Robert Osfield
Refactored the mesh setup to use GL_TRIANGLE_STIP instead of GL_QUADS
Mon, 29 Jul 2019 09:59:57 +0100
Author : Robert Osfield
Updated version to 3.6.5
Mon, 29 Jul 2019 08:57:56 +0100
Author : OpenSceneGraph git repository
Merge pull request #804 from eligovision/OpenSceneGraph-3.6_GLQUADS[*] ParticleSystem: Use GL_TRIANGLES instead if GL_QUADS when GL{1,2}…
Fri, 26 Jul 2019 21:14:45 +0300
Author : Konstantin S. Matveyev
[*] ParticleSystem: Use GL_TRIANGLES instead if GL_QUADS when GL{1,2} or GLES1 are unavailable
Fri, 26 Jul 2019 12:54:16 +0100
Author : OpenSceneGraph git repository
Merge pull request #802 from eligovision/OpenSceneGraph-3.6_osgtext_fcOSG_TEXT_USE_FONTCONFIG cmake option added: Set to ON to enable attem…
Fri, 26 Jul 2019 14:40:47 +0300
Author : konstantin.matveyev
OSG_TEXT_USE_FONTCONFIG additional check needed
Fri, 26 Jul 2019 14:09:36 +0300
Author : konstantin.matveyev
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
Thu, 25 Jul 2019 15:10:36 +0100
Author : Robert Osfield
UPdated for 3.6.3-rc9
Thu, 25 Jul 2019 14:58:17 +0100
Author : Robert Osfield
Changed the #extension enable

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.
25th July 2019.
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.

View File

@@ -18,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>
@@ -51,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)
@@ -63,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>
@@ -265,7 +265,7 @@ Receiver::Receiver( void )
Receiver::~Receiver( void )
{
#if defined (WIN32) && !defined(__CYGWIN__)
#if defined (_WIN32) && !defined(__CYGWIN__)
closesocket( _so);
#else
close( _so );
@@ -274,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
@@ -295,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
@@ -305,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;
@@ -366,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)
@@ -419,7 +419,7 @@ Broadcaster::Broadcaster( void )
Broadcaster::~Broadcaster( void )
{
#if defined (WIN32) && !defined(__CYGWIN__)
#if defined (_WIN32) && !defined(__CYGWIN__)
closesocket( _so);
#else
close( _so );
@@ -428,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
@@ -446,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;
@@ -454,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));
@@ -466,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
@@ -543,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

@@ -19,7 +19,7 @@
#include <osgViewer/Viewer>
#if !defined(WIN32) || defined(__CYGWIN__)
#if !defined(_WIN32) || defined(__CYGWIN__)
#include <netinet/in.h>
#else
#include "winsock.h"
@@ -51,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
@@ -94,7 +94,7 @@ class Broadcaster
bool init( void );
private :
#if defined(WIN32) && !defined(__CYGWIN__)
#if defined(_WIN32) && !defined(__CYGWIN__)
SOCKET _so;
#else
int _so;
@@ -103,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

@@ -508,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);
@@ -558,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();
@@ -690,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

@@ -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

@@ -312,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

@@ -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

@@ -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

@@ -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

@@ -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

@@ -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);

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

@@ -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

@@ -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"))
{

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

@@ -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);

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

@@ -158,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

@@ -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

@@ -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;
}

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

@@ -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

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

View File

@@ -63,6 +63,13 @@ class BoundingSphereImpl
* otherwise. */
inline bool valid() const { return _radius>=0.0; }
inline BoundingSphereImpl& operator = (const BoundingSphereImpl& rhs)
{
_center = rhs._center;
_radius = rhs._radius;
return *this;
}
inline bool operator == (const BoundingSphereImpl& rhs) const { return _center==rhs._center && _radius==rhs._radius; }
inline bool operator != (const BoundingSphereImpl& rhs) const { return _center!=rhs._center || _radius!=rhs._radius; }

View File

@@ -121,6 +121,32 @@ class OSG_EXPORT Callback : public virtual Object {
}
}
/** Convenience method to find a nested callback by type. */
template <typename T>
static T* findNestedCallback(osg::Callback* callback)
{
if (!callback)
return NULL;
if (T* cb = dynamic_cast<T*>(callback))
return cb;
return findNestedCallback<T>(callback->getNestedCallback());
}
/** Convenience method to find a nested callback by type. */
template <typename T>
static const T* findNestedCallback(const osg::Callback* callback)
{
if (!callback)
return NULL;
if (const T* cb = dynamic_cast<const T*>(callback))
return cb;
return findNestedCallback<T>(callback->getNestedCallback());
}
protected:
virtual ~Callback() {}

View File

@@ -149,6 +149,15 @@ class VertexAttribAlias
_osgName(osgName),
_declaration(declaration) {}
VertexAttribAlias& operator = (const VertexAttribAlias& rhs)
{
_location = rhs._location;
_glName = rhs._glName;
_osgName = rhs._osgName;
_declaration = rhs._declaration;
return *this;
}
GLuint _location;
std::string _glName;
std::string _osgName;
@@ -521,6 +530,7 @@ class OSG_EXPORT GLExtensions : public osg::Referenced
bool isTextureCompressionETC2Supported;
bool isTextureCompressionRGTCSupported;
bool isTextureCompressionPVRTCSupported;
bool isTextureCompressionASTCSupported;
bool isTextureMirroredRepeatSupported;
bool isTextureEdgeClampSupported;
bool isTextureBorderClampSupported;
@@ -530,6 +540,7 @@ class OSG_EXPORT GLExtensions : public osg::Referenced
bool isShadowSupported;
bool isShadowAmbientSupported;
bool isTextureMaxLevelSupported;
bool isTextureLODBiasSupported;
GLint maxTextureSize;
bool isClientStorageSupported;
bool isTextureIntegerEXTSupported;
@@ -656,6 +667,9 @@ class OSG_EXPORT GLExtensions : public osg::Referenced
// FrameBuferObject
bool isFrameBufferObjectSupported;
bool isPackedDepthStencilSupported;
bool isMultisampledRenderToTextureSupported;
bool isInvalidateFramebufferSupported;
bool isRenderbufferMultisampleSupported() const { return glRenderbufferStorageMultisample != 0; }
bool isRenderbufferMultisampleCoverageSupported() const { return glRenderbufferStorageMultisampleCoverageNV != 0; }
@@ -672,6 +686,7 @@ class OSG_EXPORT GLExtensions : public osg::Referenced
void (GL_APIENTRY * glFramebufferTexture1D) (GLenum, GLenum, GLenum, GLuint, GLint);
void (GL_APIENTRY * glFramebufferTexture2D) (GLenum, GLenum, GLenum, GLuint, GLint);
void (GL_APIENTRY * glFramebufferTexture2DMultisample) (GLenum, GLenum, GLenum, GLuint, GLint, GLsizei);
void (GL_APIENTRY * glFramebufferTexture3D) (GLenum, GLenum, GLenum, GLuint, GLint, GLint);
void (GL_APIENTRY * glFramebufferTexture) (GLenum, GLenum, GLint, GLint);
void (GL_APIENTRY * glFramebufferTextureLayer) (GLenum, GLenum, GLuint, GLint, GLint);
@@ -680,6 +695,7 @@ class OSG_EXPORT GLExtensions : public osg::Referenced
void (GL_APIENTRY * glGenerateMipmap) (GLenum);
void (GL_APIENTRY * glBlitFramebuffer) (GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum);
void (GL_APIENTRY * glInvalidateFramebuffer) (GLenum, GLsizei, const GLenum*); // GL_ARB_invalidate_subdata or GL 4.3 or GLES 3
void (GL_APIENTRY * glGetRenderbufferParameteriv) (GLenum, GLenum, GLint*);
//ARB_framebuffer_no_attachments

View File

@@ -390,7 +390,7 @@ class OSG_EXPORT GraphicsContext : public Object
bool releaseContext();
/** Return true if the current thread has this OpenGL graphics context.*/
inline bool isCurrent() const { return _threadOfLastMakeCurrent == OpenThreads::Thread::CurrentThread(); }
inline bool isCurrent() const { return _threadOfLastMakeCurrent == OpenThreads::Thread::CurrentThreadId(); }
/** Bind the graphics context to associated texture.*/
inline void bindPBufferToTexture(GLenum buffer) { bindPBufferToTextureImplementation(buffer); }
@@ -547,7 +547,7 @@ class OSG_EXPORT GraphicsContext : public Object
Vec4 _clearColor;
GLbitfield _clearMask;
OpenThreads::Thread* _threadOfLastMakeCurrent;
size_t _threadOfLastMakeCurrent;
OpenThreads::Mutex _operationsMutex;
osg::ref_ptr<osg::RefBlock> _operationsBlock;

View File

@@ -126,7 +126,7 @@ public:
void notify(osg::NotifySeverity severity, const char *message);
};
#if defined(WIN32) && !defined(__CYGWIN__)
#if defined(_WIN32) && !defined(__CYGWIN__)
/** Redirects notification stream to windows debugger with use of
* OuputDebugString functions.

View File

@@ -82,9 +82,9 @@ public:
};
/** return a QueryResult for specified Camera, where the QueryResult.valid is true when query results are available, and in which case the QueryResult.numPixels provides the num of pixels in the query result.*/
QueryResult getQueryResult( const osg::Camera* cam );
QueryResult getQueryResult( const osg::Camera* cam ) const;
unsigned int getNumPixels( const osg::Camera* cam );
unsigned int getNumPixels( const osg::Camera* cam ) const;
virtual void releaseGLObjects( osg::State* state = 0 ) const;
@@ -158,8 +158,11 @@ public:
osg::StateSet* getQueryStateSet();
const osg::StateSet* getQueryStateSet() const;
// Get the QueryGeometry object used for occlusion query. Returns 0 if no QueryGeometry is created.
osg::QueryGeometry* getQueryGeometry();
// Set and get the QueryGeometry object used for the occlusion query.
// By default an axis aligned box is used as the query geometry.
// Resetting to the default query geometry is done by setting it to 0.
// Returns 0 if no QueryGeometry is created.
void setQueryGeometry( osg::QueryGeometry* geom );
const osg::QueryGeometry* getQueryGeometry() const;
// Set and get the StateSet used by the OcclusionQueryNode
@@ -189,17 +192,30 @@ public:
static void discardDeletedQueryObjects( unsigned int contextID );
protected:
enum QueryGeometryState {
INVALID,
VALID,
USER_DEFINED
};
virtual ~OcclusionQueryNode();
virtual void createSupportNodes();
bool isQueryGeometryValid() const { return _queryGeometryState != INVALID; }
void setQueryGeometryInternal( osg::QueryGeometry* queryGeom,
osg::Geometry* debugQueryGeom,
QueryGeometryState state );
void updateDefaultQueryGeometry();
osg::ref_ptr< osg::Geode > _queryGeode;
osg::ref_ptr< osg::Geode > _debugGeode;
bool _enabled;
// If the box of the query geometry is valid.
mutable bool _validQueryGeometry;
mutable QueryGeometryState _queryGeometryState;
// Tracks the last frame number that we performed a query.
// User can set how many times (See setQueryFrameCount).

View File

@@ -53,6 +53,14 @@ class OSG_EXPORT Quat
_v[3]=w;
}
inline Quat( const Quat& rhs )
{
_v[0]=rhs._v[0];
_v[1]=rhs._v[1];
_v[2]=rhs._v[2];
_v[3]=rhs._v[3];
}
inline Quat( const Vec4f& v )
{
_v[0]=v.x();

View File

@@ -1328,12 +1328,12 @@ class OSG_EXPORT State : public Referenced
inline void popModeList(ModeMap& modeMap,const StateSet::ModeList& modeList);
inline void popAttributeList(AttributeMap& attributeMap,const StateSet::AttributeList& attributeList);
inline void popUniformList(UniformMap& uniformMap,const StateSet::UniformList& uniformList);
inline void popDefineList(DefineMap& uniformMap,const StateSet::DefineList& defineList);
inline void popDefineList(DefineMap& defineMap,const StateSet::DefineList& defineList);
inline void applyModeList(ModeMap& modeMap,const StateSet::ModeList& modeList);
inline void applyAttributeList(AttributeMap& attributeMap,const StateSet::AttributeList& attributeList);
inline void applyUniformList(UniformMap& uniformMap,const StateSet::UniformList& uniformList);
inline void applyDefineList(DefineMap& uniformMap,const StateSet::DefineList& defineList);
inline void applyDefineList(DefineMap& defineMap,const StateSet::DefineList& defineList);
inline void applyModeMap(ModeMap& modeMap);
inline void applyAttributeMap(AttributeMap& attributeMap);

View File

@@ -90,7 +90,7 @@ public:
unsigned int pos=first;
for(GLsizei i=3;i<count;i+=2,pos+=2)
{
this->operator()(pos,pos+1,pos+2,pos+3);
this->operator()(pos,pos+1,pos+3,pos+2);
}
break;
}
@@ -187,7 +187,7 @@ public:
IndexPointer iptr = indices;
for(GLsizei i=3;i<count;i+=2,iptr+=2)
{
this->operator()(*(iptr),*(iptr+1),*(iptr+2),*(iptr+3));
this->operator()(*(iptr),*(iptr+1),*(iptr+3),*(iptr+2));
}
break;
}
@@ -283,7 +283,7 @@ public:
IndexPointer iptr = indices;
for(GLsizei i=3;i<count;i+=2,iptr+=2)
{
this->operator()(*(iptr),*(iptr+1),*(iptr+2),*(iptr+3));
this->operator()(*(iptr),*(iptr+1),*(iptr+3),*(iptr+2));
}
break;
}
@@ -378,7 +378,7 @@ public:
IndexPointer iptr = indices;
for(GLsizei i=3;i<count;i+=2,iptr+=2)
{
this->operator()(*(iptr),*(iptr+1),*(iptr+2),*(iptr+3));
this->operator()(*(iptr),*(iptr+1),*(iptr+3),*(iptr+2));
}
break;
}

View File

@@ -62,6 +62,10 @@
#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C
#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D
#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E
#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F
#endif
#ifndef GL_EXT_texture_compression_rgtc

View File

@@ -18,7 +18,7 @@
namespace osg {
#if defined(_MSC_VER)
#if defined(_MSC_VER) && !defined(__clang__)
typedef unsigned __int64 Timer_t;
#else
typedef unsigned long long Timer_t;

View File

@@ -66,7 +66,6 @@ class MakeString
inline operator std::string () const { return sstream.str(); }
inline std::string str() const { return sstream.str(); }
inline const char* c_str() const { return sstream.str().c_str(); }
};

View File

@@ -36,6 +36,9 @@ class ref_ptr
ref_ptr() : _ptr(0) {}
ref_ptr(T* ptr) : _ptr(ptr) { if (_ptr) _ptr->ref(); }
ref_ptr(const ref_ptr& rp) : _ptr(rp._ptr) { if (_ptr) _ptr->ref(); }
#if __cplusplus >= 201103L
ref_ptr(ref_ptr&& rp) noexcept : _ptr(rp._ptr) { rp._ptr = 0; }
#endif
template<class Other> ref_ptr(const ref_ptr<Other>& rp) : _ptr(rp._ptr) { if (_ptr) _ptr->ref(); }
ref_ptr(observer_ptr<T>& optr) : _ptr(0) { optr.lock(*this); }
~ref_ptr() { if (_ptr) _ptr->unref(); _ptr = 0; }
@@ -52,6 +55,17 @@ class ref_ptr
return *this;
}
#if __cplusplus >= 201103L
template<class Other> ref_ptr& operator = (ref_ptr<Other>&& rp)
{
if (_ptr == rp._ptr) return *this;
if (_ptr != nullptr) _ptr->unref();
_ptr = rp._ptr;
rp._ptr = nullptr;
return *this;
}
#endif
inline ref_ptr& operator = (T* ptr)
{
if (_ptr==ptr) return *this;

View File

@@ -105,12 +105,12 @@ namespace osgAnimation
// 2. build deduplicated list of keyframes
unsigned int cumul = 0;
VectorType deduplicated;
for(std::vector<unsigned int>::iterator iterator = intervalSizes.begin() ; iterator != intervalSizes.end() ; ++ iterator) {
for(std::vector<unsigned int>::iterator it = intervalSizes.begin() ; it != intervalSizes.end() ; ++ it) {
deduplicated.push_back((*this)[cumul]);
if(*iterator > 1) {
deduplicated.push_back((*this)[cumul + (*iterator) - 1]);
if(*it > 1) {
deduplicated.push_back((*this)[cumul + (*it) - 1]);
}
cumul += *iterator;
cumul += *it;
}
unsigned int count = size() - deduplicated.size();

View File

@@ -40,6 +40,7 @@ class ReaderWriterInfo : public osg::Referenced
ReaderWriter::FormatDescriptionMap protocols;
ReaderWriter::FormatDescriptionMap extensions;
ReaderWriter::FormatDescriptionMap options;
ReaderWriter::FormatDescriptionMap environment;
ReaderWriter::Features features;
protected:

View File

@@ -63,6 +63,9 @@ class OSGDB_EXPORT ReaderWriter : public osg::Object
/** Return which list of file extensions supported by ReaderWriter. */
virtual const FormatDescriptionMap& supportedOptions() const { return _supportedOptions; }
/** Return which list of file environment variables supported by ReaderWriter. */
virtual const FormatDescriptionMap& supportedEnvironment() const { return _supportedEnvironment; }
/** Return true if ReaderWriter accepts specified file extension.*/
virtual bool acceptsExtension(const std::string& /*extension*/) const;
@@ -282,11 +285,15 @@ class OSGDB_EXPORT ReaderWriter : public osg::Object
* Please note, this should usually only be used internally by subclasses of ReaderWriter. */
void supportsOption(const std::string& opt, const std::string& description);
/** Specify env string as a supported environment string. */
void supportsEnvironment(const std::string& opt, const std::string& description);
protected:
FormatDescriptionMap _supportedProtocols;
FormatDescriptionMap _supportedExtensions;
FormatDescriptionMap _supportedOptions;
FormatDescriptionMap _supportedEnvironment;
};
}

View File

@@ -50,7 +50,8 @@ namespace osgDB {
The RegisterReaderWriterProxy can be used to automatically
register at runtime a reader/writer with the Registry.
*/
class OSGDB_EXPORT Registry : public osg::Referenced
class OSGDB_EXPORT Registry : osg::depends_on<OpenThreads::Mutex*, osg::Referenced::getGlobalReferencedMutex>,
public osg::Referenced
{
public:

View File

@@ -60,7 +60,8 @@ class OSGTEXT_EXPORT String : public VectorUInt
ENCODING_UTF32, /// 32-bit signature
ENCODING_UTF32_BE, /// 32-bit big-endian
ENCODING_UTF32_LE, /// 32-bit little-endian
ENCODING_SIGNATURE /// detect encoding from signature
ENCODING_SIGNATURE, /// detect encoding from signature
ENCODING_CURRENT_CODE_PAGE /// Use Windows Current Code Page ecoding
};

View File

@@ -265,7 +265,6 @@ protected:
virtual osg::StateSet* createStateSet();
Font* getActiveFont();
const Font* getActiveFont() const;
String::iterator computeLastCharacterOnLine(osg::Vec2& cursor, String::iterator first,String::iterator last);

View File

@@ -312,6 +312,7 @@ protected:
// members which have public access.
osg::Vec4 _color;
osg::ref_ptr<Font> _font;
osg::ref_ptr<Font> _fontFallback;
osg::ref_ptr<Style> _style;
FontResolution _fontSize;
float _characterHeight;

View File

@@ -38,6 +38,8 @@ class OSGUTIL_EXPORT RenderStage : public RenderBin
{
public:
typedef std::pair< int , osg::ref_ptr<RenderStage> > RenderStageOrderPair;
typedef std::list< RenderStageOrderPair > RenderStageList;
RenderStage();
RenderStage(SortMode mode);
@@ -236,6 +238,12 @@ class OSGUTIL_EXPORT RenderStage : public RenderBin
void addPostRenderStage(RenderStage* rs, int order = 0);
const RenderStageList& getPreRenderList() const { return _preRenderList; }
RenderStageList& getPreRenderList() { return _preRenderList; }
const RenderStageList& getPostRenderList() const { return _postRenderList; }
RenderStageList& getPostRenderList() { return _postRenderList; }
/** Extract stats for current draw list. */
bool getStats(Statistics& stats) const;
@@ -266,8 +274,6 @@ protected:
virtual ~RenderStage();
typedef std::pair< int , osg::ref_ptr<RenderStage> > RenderStageOrderPair;
typedef std::list< RenderStageOrderPair > RenderStageList;
typedef std::vector< osg::ref_ptr<osg::Camera> > Cameras;
bool _stageDrawnThisFrame;

View File

@@ -283,10 +283,16 @@ struct GraphicsWindowFunctionProxy
extern "C" void graphicswindow_##ext(void); \
static osgViewer::GraphicsWindowFunctionProxy graphicswindowproxy_##ext(graphicswindow_##ext);
#if defined(_WIN32)
#if defined(OSG_WINDOWING_SYSTEM_NONE)
#define USE_GRAPHICSWINDOW()
#elif defined(_WIN32)
#define USE_GRAPHICSWINDOW() USE_GRAPICSWINDOW_IMPLEMENTATION(Win32)
#elif defined(__APPLE__)
#if defined(OSG_WINDOWING_SYSTEM_CARBON)
#define USE_GRAPHICSWINDOW() USE_GRAPICSWINDOW_IMPLEMENTATION(Carbon)
#else
#define USE_GRAPHICSWINDOW() USE_GRAPICSWINDOW_IMPLEMENTATION(Cocoa)
#endif
#else
#define USE_GRAPHICSWINDOW() USE_GRAPICSWINDOW_IMPLEMENTATION(X11)
#endif

View File

@@ -75,7 +75,7 @@ public:
Widget (const std::string& = "", point_type = 0.0f, point_type = 0.0f);
Widget (const Widget&, const osg::CopyOp&);
META_Object (osgWidget, Widget);
META_Node (osgWidget, Widget);
virtual ~Widget() {
}

View File

@@ -80,8 +80,15 @@ ELSE()
# double check that pthread_setaffinity_np is available as FreeBSD header doesn't contain required function
CHECK_CXX_SOURCE_COMPILES("
#include <pthread.h>
#ifdef __FreeBSD__
#include <pthread_np.h>
#endif
int main() {
#ifdef __FreeBSD__
cpuset_t cpumask;
#else
cpu_set_t cpumask;
#endif
CPU_ZERO( &cpumask );
CPU_SET( 0, &cpumask );
pthread_setaffinity_np( pthread_self(), sizeof(cpumask), &cpumask);

View File

@@ -21,6 +21,9 @@
#include <sys/types.h>
#include <unistd.h>
#include <pthread.h>
#if defined(HAVE_PTHREAD_SETAFFINITY_NP) && defined(__FreeBSD__)
#include <pthread_np.h>
#endif
#include <limits.h>
#if defined __linux__ || defined __sun || defined __APPLE__ || ANDROID
@@ -45,6 +48,11 @@
#endif
#endif
#if defined(__APPLE__) || defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__ANDROID__)
# include <unistd.h>
# include <sys/syscall.h>
#endif
#if defined(__ANDROID__)
#ifndef PAGE_SIZE
#define PAGE_SIZE 0x400
@@ -65,11 +73,6 @@ using namespace OpenThreads;
#endif
//-----------------------------------------------------------------------------
// Initialize the static unique ids.
//
int PThreadPrivateData::nextId = 0;
//-----------------------------------------------------------------------------
// Initialize thread master priority level
//
@@ -113,7 +116,11 @@ namespace OpenThreads
static void setAffinity(const Affinity& affinity)
{
//std::cout<<"setProcessAffinity : "<< affinity.activeCPUs.size() <<std::endl;
#if defined(__FreeBSD__)
cpuset_t cpumask;
#else
cpu_set_t cpumask;
#endif
CPU_ZERO( &cpumask );
unsigned int numprocessors = OpenThreads::GetNumberOfProcessors();
if (affinity)
@@ -177,8 +184,7 @@ private:
Thread *thread = static_cast<Thread *>(data);
PThreadPrivateData *pd =
static_cast<PThreadPrivateData *>(thread->_prvData);
PThreadPrivateData *pd = static_cast<PThreadPrivateData *>(thread->_prvData);
// set up processor affinity
setAffinity( pd->affinity );
@@ -205,6 +211,8 @@ private:
#endif // ] ALLOW_PRIORITY_SCHEDULING
pd->uniqueId = Thread::CurrentThreadId();
pd->setRunning(true);
// release the thread that created this thread.
@@ -221,7 +229,7 @@ private:
};
//-------------------------------------------------------------------------
// Print information related to thread schduling parameters.
// Print information related to thread scheduling parameters.
//
static void PrintThreadSchedulingInfo(Thread *thread) {
@@ -456,6 +464,25 @@ Thread *Thread::CurrentThread()
}
size_t Thread::CurrentThreadId()
{
#if defined(__APPLE__)
return (size_t)::syscall(SYS_thread_selfid);
#elif defined(__ANDROID__)
return (size_t)gettid();
#elif defined(__linux__)
return (size_t)::syscall(SYS_gettid);
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
long tid;
syscall(SYS_thr_self, &tid);
return (size_t)tid;
#else
return (size_t)pthread_self();
#endif
}
//-----------------------------------------------------------------------------
//
// Description: Initialize Threading
@@ -521,7 +548,7 @@ void Thread::Init()
//
// Use: public
//
int Thread::getThreadId()
size_t Thread::getThreadId()
{
PThreadPrivateData *pd = static_cast<PThreadPrivateData *> (_prvData);

View File

@@ -158,7 +158,7 @@ int Condition::wait(Mutex *mutex, unsigned long int ms) {
static_cast<PThreadMutexPrivateData *>(mutex->_prvData);
// wait time is now in ms milliseconds, so need to convert to seconds and nanoseconds for timespec strucuture.
// wait time is now in ms milliseconds, so need to convert to seconds and nanoseconds for timespec structure.
unsigned int sec = ms / 1000;
unsigned int nsec = (ms % 1000) * 1000000;

View File

@@ -49,8 +49,7 @@ private:
setRunning(false);
isCanceled = false;
tid = 0;
uniqueId = nextId;
nextId++;
uniqueId = 0;
threadPriority = Thread::THREAD_PRIORITY_DEFAULT;
threadPolicy = Thread::THREAD_SCHEDULE_DEFAULT;
};
@@ -78,12 +77,10 @@ private:
pthread_t tid;
volatile int uniqueId;
size_t uniqueId;
Affinity affinity;
static int nextId;
static pthread_key_t s_tls_key;
};

View File

@@ -43,11 +43,13 @@ IF(MSVC AND OSG_MSVC_VERSIONED_DLL)
HANDLE_MSVC_DLL(ot ${OPENTHREADS_SOVERSION})
ENDIF()
SET(INSTALL_BINDIR bin)
INSTALL(
TARGETS OpenThreads
ARCHIVE DESTINATION lib COMPONENT libopenthreads-dev
LIBRARY DESTINATION lib COMPONENT libopenthreads
RUNTIME DESTINATION bin COMPONENT libopenthreads
RUNTIME DESTINATION ${INSTALL_BINDIR} COMPONENT libopenthreads
)
INSTALL(
FILES ${OpenThreads_PUBLIC_HEADERS}
@@ -55,4 +57,19 @@ INSTALL(
COMPONENT libopenthreads-dev
)
IF(MSVC AND DYNAMIC_OPENSCENEGRAPH)
GET_TARGET_PROPERTY(PREFIX ${LIB_NAME} PREFIX)
IF("${PREFIX}" STREQUAL PREFIX-NOTFOUND) # Fix for PREFIX-NOTFOUND left in file names
SET(PREFIX "")
ENDIF()
IF( ${CMAKE_GENERATOR} STREQUAL "Ninja" )
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PREFIX}${LIB_NAME}${CMAKE_RELEASE_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenthreads CONFIGURATIONS Release)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PREFIX}${LIB_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenthreads CONFIGURATIONS RelWithDebInfo)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PREFIX}${LIB_NAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenthreads CONFIGURATIONS Debug)
ELSE( ${CMAKE_GENERATOR} STREQUAL "Ninja" )
INSTALL(FILES ${OUTPUT_BINDIR}/${PREFIX}${LIB_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenthreads CONFIGURATIONS RelWithDebInfo)
INSTALL(FILES ${OUTPUT_BINDIR}/${PREFIX}${LIB_NAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenthreads CONFIGURATIONS Debug)
ENDIF( ${CMAKE_GENERATOR} STREQUAL "Ninja" )
ENDIF(MSVC AND DYNAMIC_OPENSCENEGRAPH)
#commented out# INCLUDE(ModuleInstall OPTIONAL)

View File

@@ -103,6 +103,8 @@ namespace OpenThreads {
pd->isRunning = true;
pd->uniqueId = Thread::CurrentThreadId();
// release the thread that created this thread.
pd->threadStartedBlock.release();
@@ -130,7 +132,7 @@ namespace OpenThreads {
};
//-------------------------------------------------------------------------
// Print information related to thread schduling parameters.
// Print information related to thread scheduling parameters.
//
static void PrintThreadSchedulingInfo(Thread *thread) {
@@ -210,6 +212,11 @@ Thread* Thread::CurrentThread()
return (Thread* )TlsGetValue(ID);
}
size_t Thread::CurrentThreadId()
{
return (size_t)::GetCurrentThreadId();
}
//----------------------------------------------------------------------------
//
// Description: Set the concurrency level (no-op)
@@ -300,7 +307,7 @@ void Thread::Init() {
//
// Use: public
//
int Thread::getThreadId() {
size_t Thread::getThreadId() {
Win32ThreadPrivateData *pd = static_cast<Win32ThreadPrivateData *> (_prvData);
return pd->uniqueId;
}
@@ -352,7 +359,7 @@ int Thread::start() {
pd->tid.set( (void*)_beginthreadex(NULL,static_cast<unsigned>(pd->stackSize),ThreadPrivateActions::StartThread,static_cast<void *>(this),CREATE_SUSPENDED,&ID));
ResumeThread(pd->tid.get());
pd->uniqueId = (int)ID;
pd->uniqueId = (size_t)ID;
if(!pd->tid) {
return -1;
@@ -442,9 +449,9 @@ int Thread::testCancel()
if(pd->cancelMode == 2)
return 0;
DWORD curr = GetCurrentThreadId();
size_t curr = Thread::CurrentThreadId();
if( pd->uniqueId != (int)curr )
if( pd->uniqueId != curr )
return -1;
// pd->isRunning = false;

View File

@@ -54,7 +54,7 @@ private:
HandleHolder tid;
int uniqueId;
size_t uniqueId;
Affinity affinity;

View File

@@ -198,7 +198,7 @@ void ApplicationUsage::getFormattedString(std::string& str, const UsageMap& um,u
std::string::size_type slashn_pos = explanation.find('\n',pos);
unsigned int extraSkip = 0;
bool concatinated = false;
bool concatenated = false;
if (slashn_pos!=std::string::npos)
{
if (slashn_pos<pos+width)
@@ -227,13 +227,13 @@ void ApplicationUsage::getFormattedString(std::string& str, const UsageMap& um,u
// word must be longer than a whole line so will need
// to concatenate it.
width = explanationWidth-1;
concatinated = true;
concatenated = true;
}
}
line.replace(explanationPos+offset,explanationWidth, explanation, pos, width);
if (concatinated) { str += line; str += "-\n"; }
if (concatenated) { str += line; str += "-\n"; }
else { str += line; str += "\n"; }
// move to the next line of output.

View File

@@ -198,7 +198,7 @@ ArgumentParser::ArgumentParser(int* argc,char **argv):
}
#endif
#ifdef WIN32
#ifdef _WIN32
// Remove linefeed from last argument if it exist
char* lastline = argc==0 ? 0 : _argv[*argc-1];
if (lastline)

View File

@@ -153,7 +153,7 @@ osg::Matrixd AutoTransform::computeMatrix(const osg::NodeVisitor* nv) const
{
double size = 1.0/cs->pixelSize(getPosition(),0.48f);
//if (_autoScaleTransitionWidthRatio>0.0)
if (_autoScaleTransitionWidthRatio>0.0)
{
if (_minimumScale>0.0)
{
@@ -185,6 +185,18 @@ osg::Matrixd AutoTransform::computeMatrix(const osg::NodeVisitor* nv) const
else if (size>m) size = a + b*size + c*(size*size);
}
}
else
{
if (_minimumScale>0.0 && size<_minimumScale)
{
size = _minimumScale;
}
if (_maximumScale<DBL_MAX && size>_maximumScale)
{
size = _maximumScale;
}
}
// TODO setScale(size);
scale.set(size, size, size);

View File

@@ -815,7 +815,7 @@ void GLBufferObjectSet::remove(GLBufferObject* to)
}
else
{
// 'to' was tail so assing tail to the previous in list
// 'to' was tail so assign tail to the previous in list
_tail = to->_previous;
}

View File

@@ -49,7 +49,9 @@ void ClampColor::apply(State& state) const
return;
}
#if !defined(OSG_GL3_AVAILABLE)
extensions->glClampColor(GL_CLAMP_VERTEX_COLOR, _clampVertexColor);
extensions->glClampColor(GL_CLAMP_FRAGMENT_COLOR, _clampFragmentColor);
#endif
extensions->glClampColor(GL_CLAMP_READ_COLOR, _clampReadColor);
}

View File

@@ -36,5 +36,7 @@
#cmakedefine OSG_PROVIDE_READFILE
#cmakedefine OSG_USE_DEPRECATED_API
#cmakedefine OSG_ENVVAR_SUPPORTED
#cmakedefine OSG_WINDOWING_SYSTEM_CARBON
#cmakedefine OSG_WINDOWING_SYSTEM_NONE
#endif

View File

@@ -22,16 +22,16 @@
#include <algorithm>
#include <string.h>
using namespace osg;
using namespace std;
#if defined(WIN32) && !defined(__CYGWIN__)
#if defined(_WIN32) && !defined(__CYGWIN__)
#include<windows.h>
extern "C" { OSG_EXPORT DWORD NvOptimusEnablement=0x00000001; }
#else
extern "C" { int NvOptimusEnablement=0x00000001; }
#endif
using namespace osg;
using namespace std;
void DisplaySettings::setNvOptimusEnablement(int value)
{
NvOptimusEnablement = value;
@@ -120,7 +120,7 @@ void DisplaySettings::setDisplaySettings(const DisplaySettings& vs)
_vertexBufferHint = vs._vertexBufferHint;
setShaderHint(_shaderHint);
setShaderHint(vs._shaderHint);
_keystoneHint = vs._keystoneHint;
_keystoneFileNames = vs._keystoneFileNames;
@@ -719,7 +719,7 @@ void DisplaySettings::readEnvironmentalVariables()
if (getEnvVar("OSG_KEYSTONE_FILES", value))
{
#if defined(WIN32) && !defined(__CYGWIN__)
#if defined(_WIN32) && !defined(__CYGWIN__)
char delimitor = ';';
#else
char delimitor = ':';

View File

@@ -42,7 +42,7 @@
#define OSG_GL_CONTEXT_VERSION "@OSG_GL_CONTEXT_VERSION@"
#ifndef WIN32
#ifndef _WIN32
// Required for compatibility with glext.h style function definitions of
// OpenGL extensions, such as in src/osg/Point.cpp.
@@ -50,7 +50,7 @@
#define APIENTRY
#endif
#else // WIN32
#else // _WIN32
#if defined(__CYGWIN__) || defined(__MINGW32__)
@@ -103,7 +103,7 @@
#define _WCHAR_T_DEFINED
#endif
#endif // WIN32
#endif // _WIN32
#if defined(OSG_GL3_AVAILABLE)
#define GL3_PROTOTYPES 1

View File

@@ -27,7 +27,7 @@
#include <set>
#include <sstream>
#if defined(WIN32)
#if defined(_WIN32)
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif // WIN32_LEAN_AND_MEAN
@@ -174,7 +174,7 @@ bool osg::isGLExtensionOrVersionSupported(unsigned int contextID, const char *ex
if (*startOfWord!=0) extensionSet.insert(std::string(startOfWord));
}
#if defined(WIN32) && (defined(OSG_GL1_AVAILABLE) || defined(OSG_GL2_AVAILABLE) || defined(OSG_GL3_AVAILABLE))
#if defined(_WIN32) && (defined(OSG_GL1_AVAILABLE) || defined(OSG_GL2_AVAILABLE) || defined(OSG_GL3_AVAILABLE))
// add WGL extensions to the list
@@ -340,7 +340,7 @@ OSG_INIT_SINGLETON_PROXY(GLExtensionDisableStringInitializationProxy, osg::getGL
#endif
return dlsym(handle, funcName);
#elif defined(WIN32)
#elif defined(_WIN32)
#if defined(OSG_GLES2_AVAILABLE)
static HMODULE hmodule = GetModuleHandle(TEXT("libGLESv2.dll"));
@@ -721,9 +721,9 @@ GLExtensions::GLExtensions(unsigned int in_contextID):
setGLExtensionFuncPtr(glTexBuffer, "glTexBuffer","glTexBufferARB" , validContext);
isVBOSupported = validContext && (OSG_GLES2_FEATURES || OSG_GLES3_FEATURES || OSG_GL3_FEATURES || osg::isGLExtensionSupported(contextID,"GL_ARB_vertex_buffer_object"));
isPBOSupported = validContext && (OSG_GLES3_FEATURES || OSG_GL3_FEATURES || osg::isGLExtensionSupported(contextID,"GL_ARB_pixel_buffer_object"));
isPBOSupported = validContext && ((OSG_GLES3_FEATURES && glVersion >= 3.0) || OSG_GL3_FEATURES || osg::isGLExtensionSupported(contextID,"GL_ARB_pixel_buffer_object"));
isTBOSupported = validContext && osg::isGLExtensionSupported(contextID,"GL_ARB_texture_buffer_object");
isVAOSupported = validContext && (OSG_GLES3_FEATURES || OSG_GL3_FEATURES || osg::isGLExtensionSupported(contextID, "GL_ARB_vertex_array_object", "GL_OES_vertex_array_object"));
isVAOSupported = validContext && ((OSG_GLES3_FEATURES && glVersion >= 3.0) || OSG_GL3_FEATURES || osg::isGLExtensionSupported(contextID, "GL_ARB_vertex_array_object", "GL_OES_vertex_array_object"));
isTransformFeedbackSupported = validContext && osg::isGLExtensionSupported(contextID, "GL_ARB_transform_feedback2");
isBufferObjectSupported = isVBOSupported || isPBOSupported;
@@ -746,7 +746,7 @@ GLExtensions::GLExtensions(unsigned int in_contextID):
isOcclusionQuerySupported = validContext && osg::isGLExtensionSupported(contextID, "GL_NV_occlusion_query");
isARBOcclusionQuerySupported = validContext && (OSG_GL3_FEATURES || osg::isGLExtensionSupported(contextID, "GL_ARB_occlusion_query"));
isTimerQuerySupported = validContext && osg::isGLExtensionSupported(contextID, "GL_EXT_timer_query");
isTimerQuerySupported = validContext && (osg::isGLExtensionSupported(contextID, "GL_EXT_timer_query") || osg::isGLExtensionSupported(contextID, "GL_EXT_disjoint_timer_query"));
isARBTimerQuerySupported = validContext && osg::isGLExtensionSupported(contextID, "GL_ARB_timer_query");
@@ -781,19 +781,19 @@ GLExtensions::GLExtensions(unsigned int in_contextID):
setGLExtensionFuncPtr(glGetOcclusionQueryiv, "glGetOcclusionQueryiv","glGetOcclusionQueryivNV", validContext);
setGLExtensionFuncPtr(glGetOcclusionQueryuiv, "glGetOcclusionQueryuiv","glGetOcclusionQueryuivNV", validContext);
setGLExtensionFuncPtr(glGenQueries, "glGenQueries", "glGenQueriesARB", validContext);
setGLExtensionFuncPtr(glDeleteQueries, "glDeleteQueries", "glDeleteQueriesARB", validContext);
setGLExtensionFuncPtr(glIsQuery, "glIsQuery", "glIsQueryARB", validContext);
setGLExtensionFuncPtr(glBeginQuery, "glBeginQuery", "glBeginQueryARB", validContext);
setGLExtensionFuncPtr(glEndQuery, "glEndQuery", "glEndQueryARB", validContext);
setGLExtensionFuncPtr(glGenQueries, "glGenQueries", "glGenQueriesARB", "glGenQueriesEXT", validContext);
setGLExtensionFuncPtr(glDeleteQueries, "glDeleteQueries", "glDeleteQueriesARB", "glDeleteQueriesEXT", validContext);
setGLExtensionFuncPtr(glIsQuery, "glIsQuery", "glIsQueryARB", "glIsQueryEXT", validContext);
setGLExtensionFuncPtr(glBeginQuery, "glBeginQuery", "glBeginQueryARB", "glBeginQueryEXT", validContext);
setGLExtensionFuncPtr(glEndQuery, "glEndQuery", "glEndQueryARB", "glEndQueryEXT", validContext);
setGLExtensionFuncPtr(glBeginQueryIndexed, "glBeginQueryIndexed", "glBeginQueryIndexedARB", validContext);
setGLExtensionFuncPtr(glEndQueryIndexed, "glEndQueryIndexed", "glEndQueryIndexedARB", validContext);
setGLExtensionFuncPtr(glGetQueryiv, "glGetQueryiv", "glGetQueryivARB", validContext);
setGLExtensionFuncPtr(glGetQueryObjectiv, "glGetQueryObjectiv","glGetQueryObjectivARB", validContext);
setGLExtensionFuncPtr(glGetQueryObjectuiv, "glGetQueryObjectuiv","glGetQueryObjectuivARB", validContext);
setGLExtensionFuncPtr(glGetQueryObjectui64v, "glGetQueryObjectui64v","glGetQueryObjectui64vEXT", validContext);
setGLExtensionFuncPtr(glQueryCounter, "glQueryCounter", validContext);
setGLExtensionFuncPtr(glGetInteger64v, "glGetInteger64v", validContext);
setGLExtensionFuncPtr(glGetQueryiv, "glGetQueryiv", "glGetQueryivARB", "glGetQueryivEXT", validContext);
setGLExtensionFuncPtr(glGetQueryObjectiv, "glGetQueryObjectiv","glGetQueryObjectivARB", "glGetQueryObjectivEXT", validContext);
setGLExtensionFuncPtr(glGetQueryObjectuiv, "glGetQueryObjectuiv","glGetQueryObjectuivARB", "glGetQueryObjectuivEXT", validContext);
setGLExtensionFuncPtr(glGetQueryObjectui64v, "glGetQueryObjectui64v","glGetQueryObjectui64vEXT", "glGetQueryObjectui64vEXT", validContext);
setGLExtensionFuncPtr(glQueryCounter, "glQueryCounter", "glQueryCounterEXT", validContext);
setGLExtensionFuncPtr(glGetInteger64v, "glGetInteger64v", "glGetInteger64vEXT", validContext);
// SampleMaski functionality
@@ -850,13 +850,26 @@ GLExtensions::GLExtensions(unsigned int in_contextID):
isTextureFilterAnisotropicSupported = validContext && isGLExtensionSupported(contextID,"GL_EXT_texture_filter_anisotropic");
isTextureSwizzleSupported = validContext && isGLExtensionSupported(contextID,"GL_ARB_texture_swizzle");
isTextureCompressionARBSupported = validContext && (builtInSupport || isGLExtensionOrVersionSupported(contextID,"GL_ARB_texture_compression", 1.3f));
isTextureCompressionS3TCSupported = validContext && (isGLExtensionSupported(contextID,"GL_EXT_texture_compression_s3tc") || isGLExtensionSupported(contextID, "GL_S3_s3tc"));
isTextureCompressionPVRTC2BPPSupported = validContext && isGLExtensionSupported(contextID,"GL_IMG_texture_compression_pvrtc");
isTextureCompressionS3TCSupported = validContext && (isGLExtensionSupported(contextID,"GL_EXT_texture_compression_s3tc") ||
isGLExtensionSupported(contextID, "GL_S3_s3tc") ||
isGLExtensionSupported(contextID, "WEBGL_compressed_texture_s3tc") ||
isGLExtensionSupported(contextID, "MOZ_WEBGL_compressed_texture_s3tc") ||
isGLExtensionSupported(contextID, "WEBKIT_WEBGL_compressed_texture_s3tc") ||
isGLExtensionSupported(contextID, "WEBGL_compressed_texture_s3tc_srgb") /* TODO: separate flag */);
isTextureCompressionPVRTC2BPPSupported = validContext && (isGLExtensionSupported(contextID,"GL_IMG_texture_compression_pvrtc") ||
isGLExtensionSupported(contextID, "WEBGL_compressed_texture_pvrtc"));
isTextureCompressionPVRTC4BPPSupported = isTextureCompressionPVRTC2BPPSupported;//covered by same extension
isTextureCompressionETCSupported = validContext && isGLExtensionSupported(contextID,"GL_OES_compressed_ETC1_RGB8_texture");
isTextureCompressionETC2Supported = validContext && isGLExtensionSupported(contextID,"GL_ARB_ES3_compatibility");
isTextureCompressionETCSupported = validContext && (isGLExtensionSupported(contextID, "GL_OES_compressed_ETC1_RGB8_texture") ||
isGLExtensionSupported(contextID, "WEBGL_compressed_texture_etc1"));
isTextureCompressionETC2Supported = validContext && (isGLExtensionSupported(contextID,"GL_ARB_ES3_compatibility") ||
isGLExtensionSupported(contextID, "WEBGL_compressed_texture_etc"));
isTextureCompressionRGTCSupported = validContext && isGLExtensionSupported(contextID,"GL_EXT_texture_compression_rgtc");
isTextureCompressionPVRTCSupported = validContext && isGLExtensionSupported(contextID,"GL_IMG_texture_compression_pvrtc");
isTextureCompressionPVRTCSupported = isTextureCompressionPVRTC2BPPSupported;//covered by same extension
isTextureCompressionASTCSupported = validContext && (isGLExtensionSupported(contextID, "GL_KHR_texture_compression_astc_hdr") ||
isGLExtensionSupported(contextID, "GL_KHR_texture_compression_astc_ldr") ||
isGLExtensionSupported(contextID, "GL_OES_texture_compression_astc") ||
isGLExtensionSupported(contextID, "WEBGL_compressed_texture_astc"));
isTextureMirroredRepeatSupported = validContext &&
(builtInSupport ||
@@ -898,18 +911,22 @@ GLExtensions::GLExtensions(unsigned int in_contextID):
{
maxTextureSize = osg_max_size;
}
#if defined(__EMSCRIPTEN__)
isTextureMaxLevelSupported = (glVersion >= 3.0f); // WebGL 2.0 (OpenGL ES 3.0)
isTextureLODBiasSupported = (glVersion >= 3.0f) || isGLExtensionSupported(contextID, "GL_EXT_texture_lod_bias");
#else
isTextureMaxLevelSupported = (glVersion >= 1.2f);
isTextureLODBiasSupported = (glVersion >= 1.2f) || isGLExtensionSupported(contextID, "GL_EXT_texture_lod_bias");
#endif
isTextureStorageEnabled = validContext && ((glVersion >= 4.2f) || isGLExtensionSupported(contextID, "GL_ARB_texture_storage"));
if (isTextureStorageEnabled)
{
std::string value;
if (getEnvVar("OSG_GL_TEXTURE_STORAGE", value))
{
if (value=="OFF" || value=="DISABLE") isTextureStorageEnabled = false;
else isTextureStorageEnabled = true;
}
if (getEnvVar("OSG_GL_TEXTURE_STORAGE", value) && (value == "OFF" || value == "DISABLE"))
isTextureStorageEnabled = false;
}
setGLExtensionFuncPtr(glTexStorage1D,"glTexStorage1D","glTexStorage1DARB", validContext);
@@ -918,8 +935,8 @@ GLExtensions::GLExtensions(unsigned int in_contextID):
setGLExtensionFuncPtr(glTextureStorage2D,"glTextureStorage2D","glTextureStorage2DARB", validContext);
setGLExtensionFuncPtr(glTexStorage3D, "glTexStorage3D","glTexStorage3DEXT", validContext);
setGLExtensionFuncPtr(glTextureStorage3D, "glTextureStorage3D","glTextureStorage3DEXT", validContext);
setGLExtensionFuncPtr(glTexStorage2DMultisample, "glTextureStorage2DMultisample","glTextureStorage2DMultisampleEXT", validContext);
setGLExtensionFuncPtr(glTexStorage3DMultisample, "glTextureStorage3DMultisample","glTextureStorage3DMultisampleEXT", validContext);
setGLExtensionFuncPtr(glTexStorage2DMultisample, "glTexStorage2DMultisample", validContext);
setGLExtensionFuncPtr(glTexStorage3DMultisample, "glTexStorage3DMultisample", validContext);
setGLExtensionFuncPtr(glTextureView, "glTextureView","glTextureViewEXT", validContext);
setGLExtensionFuncPtr(glCompressedTexImage2D,"glCompressedTexImage2D","glCompressedTexImage2DARB", validContext);
@@ -1077,12 +1094,18 @@ GLExtensions::GLExtensions(unsigned int in_contextID):
// FrameBufferObject
isMultisampledRenderToTextureSupported = validContext && isGLExtensionSupported(contextID, "GL_EXT_multisampled_render_to_texture");
isInvalidateFramebufferSupported = validContext && (isGLExtensionSupported(contextID, "GL_ARB_invalidate_subdata") || (OSG_GLES3_FEATURES && glVersion >= 3.0) || glVersion >= 4.3);
setGLExtensionFuncPtr(glBindRenderbuffer, "glBindRenderbuffer", "glBindRenderbufferEXT", "glBindRenderbufferOES", validContext);
setGLExtensionFuncPtr(glDeleteRenderbuffers, "glDeleteRenderbuffers", "glDeleteRenderbuffersEXT", "glDeleteRenderbuffersOES", validContext);
setGLExtensionFuncPtr(glGenRenderbuffers, "glGenRenderbuffers", "glGenRenderbuffersEXT", "glGenRenderbuffersOES", validContext);
setGLExtensionFuncPtr(glRenderbufferStorage, "glRenderbufferStorage", "glRenderbufferStorageEXT", "glRenderbufferStorageOES", validContext);
setGLExtensionFuncPtr(glRenderbufferStorageMultisample, "glRenderbufferStorageMultisample", "glRenderbufferStorageMultisampleEXT", "glRenderbufferStorageMultisampleOES", validContext);
setGLExtensionFuncPtr(glRenderbufferStorageMultisampleCoverageNV, "glRenderbufferStorageMultisampleCoverageNV", validContext);
if (isGLExtensionSupported(contextID, "GL_NV_framebuffer_multisample_coverage"))
setGLExtensionFuncPtr(glRenderbufferStorageMultisampleCoverageNV, "glRenderbufferStorageMultisampleCoverageNV", validContext);
else
glRenderbufferStorageMultisampleCoverageNV = NULL;
setGLExtensionFuncPtr(glBindFramebuffer, "glBindFramebuffer", "glBindFramebufferEXT", "glBindFramebufferOES", validContext);
setGLExtensionFuncPtr(glDeleteFramebuffers, "glDeleteFramebuffers", "glDeleteFramebuffersEXT", "glDeleteFramebuffersOES", validContext);
setGLExtensionFuncPtr(glGenFramebuffers, "glGenFramebuffers", "glGenFramebuffersEXT", "glGenFramebuffersOES", validContext);
@@ -1090,6 +1113,7 @@ GLExtensions::GLExtensions(unsigned int in_contextID):
setGLExtensionFuncPtr(glFramebufferTexture1D, "glFramebufferTexture1D", "glFramebufferTexture1DEXT", "glFramebufferTexture1DOES", validContext);
setGLExtensionFuncPtr(glFramebufferTexture2D, "glFramebufferTexture2D", "glFramebufferTexture2DEXT", "glFramebufferTexture2DOES", validContext);
setGLExtensionFuncPtr(glFramebufferTexture2DMultisample, "glFramebufferTexture2DMultisample", "glFramebufferTexture2DMultisampleEXT", validContext);
setGLExtensionFuncPtr(glFramebufferTexture3D, "glFramebufferTexture3D", "glFramebufferTexture3DEXT", "glFramebufferTexture3DOES", validContext);
setGLExtensionFuncPtr(glFramebufferTexture, "glFramebufferTexture", "glFramebufferTextureEXT", "glFramebufferTextureOES", validContext);
setGLExtensionFuncPtr(glFramebufferTextureLayer, "glFramebufferTextureLayer", "glFramebufferTextureLayerEXT", "glFramebufferTextureLayerOES", validContext);
@@ -1105,6 +1129,7 @@ GLExtensions::GLExtensions(unsigned int in_contextID):
setGLExtensionFuncPtr(glGenerateMipmap, "glGenerateMipmap", "glGenerateMipmapEXT", "glGenerateMipmapOES", validContext);
setGLExtensionFuncPtr(glBlitFramebuffer, "glBlitFramebuffer", "glBlitFramebufferEXT", "glBlitFramebufferOES", validContext);
setGLExtensionFuncPtr(glInvalidateFramebuffer, "glInvalidateFramebuffer", "glInvalidateFramebufferEXT", validContext);
setGLExtensionFuncPtr(glGetRenderbufferParameteriv, "glGetRenderbufferParameteriv", "glGetRenderbufferParameterivEXT", "glGetRenderbufferParameterivOES", validContext);

View File

@@ -526,7 +526,7 @@ void GraphicsContext::close(bool callCloseImplementation)
bool GraphicsContext::makeCurrent()
{
_threadOfLastMakeCurrent = OpenThreads::Thread::CurrentThread();
_threadOfLastMakeCurrent = OpenThreads::Thread::CurrentThreadId();
bool result = makeCurrentImplementation();
@@ -546,7 +546,7 @@ bool GraphicsContext::makeContextCurrent(GraphicsContext* readContext)
if (result)
{
_threadOfLastMakeCurrent = OpenThreads::Thread::CurrentThread();
_threadOfLastMakeCurrent = OpenThreads::Thread::CurrentThreadId();
// initialize extension process, not only initializes on first
// call, will be a non-op on subsequent calls.
@@ -560,7 +560,7 @@ bool GraphicsContext::releaseContext()
{
bool result = releaseContextImplementation();
_threadOfLastMakeCurrent = (OpenThreads::Thread*)(-1);
_threadOfLastMakeCurrent = 0;
return result;
}
@@ -573,7 +573,7 @@ void GraphicsContext::swapBuffers()
clear();
}
else if (_graphicsThread.valid() &&
_threadOfLastMakeCurrent == _graphicsThread.get())
_threadOfLastMakeCurrent == _graphicsThread->getThreadId())
{
_graphicsThread->add(new SwapBuffersOperation);
}

View File

@@ -169,7 +169,7 @@ bool Group::removeChildren(unsigned int pos,unsigned int numChildrenToRemove)
if (endOfRemoveRange>_children.size())
{
OSG_DEBUG<<"Warning: Group::removeChild(i,numChildrenToRemove) has been passed an excessive number"<<std::endl;
OSG_DEBUG<<" of chilren to remove, trimming just to end of child list."<<std::endl;
OSG_DEBUG<<" of children to remove, trimming just to end of child list."<<std::endl;
endOfRemoveRange=_children.size();
}

View File

@@ -537,9 +537,12 @@ unsigned int Image::computeNumComponents(GLenum pixelFormat)
switch(pixelFormat)
{
case(GL_COMPRESSED_RGB_S3TC_DXT1_EXT): return 3;
case(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT): return 4;
case(GL_COMPRESSED_SRGB_S3TC_DXT1_EXT): return 3;
case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT): return 4;
case(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT): return 4;
case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT): return 4;
case(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT): return 4;
case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT): return 4;
case(GL_COMPRESSED_SIGNED_RED_RGTC1_EXT): return 1;
case(GL_COMPRESSED_RED_RGTC1_EXT): return 1;
case(GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT): return 2;
@@ -719,9 +722,13 @@ unsigned int Image::computePixelSizeInBits(GLenum format,GLenum type)
switch(format)
{
case(GL_COMPRESSED_RGB_S3TC_DXT1_EXT): return 4;
case(GL_COMPRESSED_SRGB_S3TC_DXT1_EXT): return 4;
case(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT): return 4;
case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT): return 4;
case(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT): return 8;
case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT): return 8;
case(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT): return 8;
case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT): return 8;
case(GL_COMPRESSED_SIGNED_RED_RGTC1_EXT): return 4;
case(GL_COMPRESSED_RED_RGTC1_EXT): return 4;
case(GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT): return 8;
@@ -749,7 +756,7 @@ unsigned int Image::computePixelSizeInBits(GLenum format,GLenum type)
// which raises the question of how to actually query for these sizes...
// will need to revisit this issue, for now just report an error.
// this is possible a bit of mute point though as since the ARB compressed formats
// aren't yet used for storing images to disk, so its likely that users wont have
// aren't yet used for storing images to disk, so its likely that users won't have
// osg::Image's for pixel formats set the ARB compressed formats, just using these
// compressed formats as internal texture modes. This is very much speculation though
// if get the below error then its time to revist this issue :-)
@@ -942,10 +949,14 @@ unsigned int Image::computeBlockSize(GLenum pixelFormat, GLenum packing)
switch(pixelFormat)
{
case(GL_COMPRESSED_RGB_S3TC_DXT1_EXT):
case(GL_COMPRESSED_SRGB_S3TC_DXT1_EXT):
case(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT):
return osg::maximum(8u,packing); // block size of 8
case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT):
return osg::maximum(8u, packing); // block size of 8
case(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT):
case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT):
case(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT):
case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT):
case(GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG):
case(GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG):
case(GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG):
@@ -1095,9 +1106,13 @@ bool Image::isCompressed() const
case(GL_COMPRESSED_RGBA_ARB):
case(GL_COMPRESSED_RGB_ARB):
case(GL_COMPRESSED_RGB_S3TC_DXT1_EXT):
case(GL_COMPRESSED_SRGB_S3TC_DXT1_EXT):
case(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT):
case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT):
case(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT):
case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT):
case(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT):
case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT):
case(GL_COMPRESSED_SIGNED_RED_RGTC1_EXT):
case(GL_COMPRESSED_RED_RGTC1_EXT):
case(GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT):
@@ -1696,11 +1711,11 @@ void Image::copySubImage(int s_offset, int t_offset, int r_offset, const osg::Im
}
unsigned int rowWidthInBlocks = (_s + footprint.x() - 1) / footprint.x();
unsigned int blockSize = computeBlockSize(_pixelFormat, 0);
data_destination = _data + blockSize * (rowWidthInBlocks * t_offset + (s_offset / footprint.x()));
data_destination = _data + blockSize * (rowWidthInBlocks * (t_offset / footprint.y()) + (s_offset / footprint.x()));
unsigned int copy_width = (osg::minimum(source->s(), _s - s_offset) + footprint.x() - 1) / footprint.x();
unsigned int copy_height = (osg::minimum(source->t(), _t - t_offset) + footprint.y() - 1) / footprint.y();
unsigned int dstRowStep = blockSize * rowWidthInBlocks;
unsigned int srcRowStep = blockSize * (source->_s + footprint.x() - 1) / footprint.x();
unsigned int srcRowStep = blockSize * ((source->_s + footprint.x() - 1) / footprint.x());
const unsigned char* data_source = source->data(0, 0, 0);
for (unsigned int row = 0; row < copy_height; row += 1) { //copy blocks in a row, footprint.y() rows at a time
memcpy(data_destination, data_source, copy_width * blockSize);
@@ -2013,10 +2028,14 @@ bool Image::isImageTranslucent() const
case(GL_BGR):
return false;
case(GL_COMPRESSED_RGB_S3TC_DXT1_EXT):
case(GL_COMPRESSED_SRGB_S3TC_DXT1_EXT):
return false;
case(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT):
case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT):
case(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT):
case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT):
case(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT):
case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT):
return dxtc_tool::isCompressedImageTranslucent(_s, _t, _pixelFormat, _data);
default:
return false;

View File

@@ -747,18 +747,22 @@ bool Matrix_implementation::transpose(const Matrix_implementation&mat){
Matrix_implementation tm(mat);
return transpose(tm);
}
_mat[0][0]=mat._mat[0][0];
_mat[0][1]=mat._mat[1][0];
_mat[0][2]=mat._mat[2][0];
_mat[0][3]=mat._mat[3][0];
_mat[1][0]=mat._mat[0][1];
_mat[1][1]=mat._mat[1][1];
_mat[1][2]=mat._mat[2][1];
_mat[1][3]=mat._mat[3][1];
_mat[2][0]=mat._mat[0][2];
_mat[2][1]=mat._mat[1][2];
_mat[2][2]=mat._mat[2][2];
_mat[2][3]=mat._mat[3][2];
_mat[3][0]=mat._mat[0][3];
_mat[3][1]=mat._mat[1][3];
_mat[3][2]=mat._mat[2][3];
_mat[3][3]=mat._mat[3][3];
return true;
}
@@ -767,12 +771,15 @@ bool Matrix_implementation::transpose3x3(const Matrix_implementation&mat){
Matrix_implementation tm(mat);
return transpose3x3(tm);
}
_mat[0][0]=mat._mat[0][0];
_mat[0][1]=mat._mat[1][0];
_mat[0][2]=mat._mat[2][0];
_mat[1][0]=mat._mat[0][1];
_mat[1][1]=mat._mat[1][1];
_mat[1][2]=mat._mat[2][1];
_mat[2][0]=mat._mat[0][2];
_mat[2][1]=mat._mat[1][2];
_mat[2][2]=mat._mat[2][2];
return true;
}

View File

@@ -241,7 +241,7 @@ void osg::StandardNotifyHandler::notify(osg::NotifySeverity severity, const char
fputs(message, stdout);
}
#if defined(WIN32) && !defined(__CYGWIN__)
#if defined(_WIN32) && !defined(__CYGWIN__)
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN

View File

@@ -48,6 +48,36 @@
namespace osg
{
QueryGeometry* createDefaultQueryGeometry( const std::string& name )
{
GLushort indices[] = { 0, 1, 2, 3, 4, 5, 6, 7,
0, 3, 6, 5, 2, 1, 4, 7,
5, 4, 1, 0, 2, 7, 6, 3 };
ref_ptr<QueryGeometry> geom = new QueryGeometry( name );
geom->setDataVariance( Object::DYNAMIC );
geom->addPrimitiveSet( new DrawElementsUShort( PrimitiveSet::QUADS, 24, indices ) );
return geom.release();
}
Geometry* createDefaultDebugQueryGeometry()
{
GLushort indices[] = { 0, 1, 2, 3, 4, 5, 6, 7,
0, 3, 6, 5, 2, 1, 4, 7,
5, 4, 1, 0, 2, 7, 6, 3 };
ref_ptr<Vec4Array> ca = new Vec4Array;
ca->push_back( Vec4( 1.f, 1.f, 1.f, 1.f ) );
ref_ptr<Geometry> geom = new Geometry;
geom->setDataVariance( Object::DYNAMIC );
geom->setColorArray( ca.get(), Array::BIND_OVERALL );
geom->addPrimitiveSet( new DrawElementsUShort( PrimitiveSet::QUADS, 24, indices ) );
return geom.release();
}
// Create and return a StateSet appropriate for performing an occlusion
// query test (disable lighting, texture mapping, etc). Probably some
// room for improvement here. Could disable shaders, for example.
@@ -364,7 +394,7 @@ QueryGeometry::drawImplementation( osg::RenderInfo& renderInfo ) const
}
QueryGeometry::QueryResult QueryGeometry::getQueryResult( const osg::Camera* cam )
QueryGeometry::QueryResult QueryGeometry::getQueryResult( const osg::Camera* cam ) const
{
osg::ref_ptr<osg::TestResult> tr;
{
@@ -380,7 +410,7 @@ QueryGeometry::QueryResult QueryGeometry::getQueryResult( const osg::Camera* cam
}
unsigned int
QueryGeometry::getNumPixels( const osg::Camera* cam )
QueryGeometry::getNumPixels( const osg::Camera* cam ) const
{
return getQueryResult(cam).numPixels;
}
@@ -442,7 +472,7 @@ QueryGeometry::discardDeletedQueryObjects( unsigned int contextID )
OcclusionQueryNode::OcclusionQueryNode()
: _enabled( true ),
_validQueryGeometry( false ),
_queryGeometryState( INVALID ),
_passed(false),
_visThreshold( 500 ),
_queryFrameCount( 5 ),
@@ -460,7 +490,7 @@ OcclusionQueryNode::~OcclusionQueryNode()
OcclusionQueryNode::OcclusionQueryNode( const OcclusionQueryNode& oqn, const CopyOp& copyop )
: Group( oqn, copyop ),
_validQueryGeometry( false ),
_queryGeometryState( INVALID ),
_passed( false )
{
_enabled = oqn._enabled;
@@ -485,7 +515,7 @@ bool OcclusionQueryNode::getPassed( const Camera* camera, NodeVisitor& nv )
QueryGeometry* qg = static_cast< QueryGeometry* >( _queryGeode->getDrawable( 0 ) );
if ( !_validQueryGeometry )
if ( !isQueryGeometryValid() )
{
// There're cases that the occlusion test result has been retrieved
// after the query geometry has been changed, it's the result of the
@@ -556,7 +586,7 @@ bool OcclusionQueryNode::getPassed( const Camera* camera, NodeVisitor& nv )
void OcclusionQueryNode::traverseQuery( const Camera* camera, NodeVisitor& nv )
{
if (!_validQueryGeometry || ! _enabled)
if (!isQueryGeometryValid() || !_enabled)
return;
bool issueQuery;
@@ -590,42 +620,13 @@ BoundingSphere OcclusionQueryNode::computeBound() const
// an application thread or by a non-osgViewer application.
OpenThreads::ScopedLock<OpenThreads::Mutex> lock( _computeBoundMutex ) ;
// This is the logical place to put this code, but the method is const. Cast
// away constness to compute the bounding box and modify the query geometry.
osg::OcclusionQueryNode* nonConstThis = const_cast<osg::OcclusionQueryNode*>( this );
ComputeBoundsVisitor cbv;
nonConstThis->accept( cbv );
BoundingBox bb = cbv.getBoundingBox();
const bool bbValid = bb.valid();
_validQueryGeometry = bbValid;
osg::ref_ptr<Vec3Array> v = new Vec3Array;
v->resize( 8 );
// Having (0,0,0) as vertices for the case of the invalid query geometry
// still isn't quite the right thing. But the query geometry is public
// accessible and therefore a user might expect eight vertices, so
// it seems safer to keep eight vertices in the geometry.
if (bbValid)
if (_queryGeometryState != USER_DEFINED)
{
(*v)[0] = Vec3( bb._min.x(), bb._min.y(), bb._min.z() );
(*v)[1] = Vec3( bb._max.x(), bb._min.y(), bb._min.z() );
(*v)[2] = Vec3( bb._max.x(), bb._min.y(), bb._max.z() );
(*v)[3] = Vec3( bb._min.x(), bb._min.y(), bb._max.z() );
(*v)[4] = Vec3( bb._max.x(), bb._max.y(), bb._min.z() );
(*v)[5] = Vec3( bb._min.x(), bb._max.y(), bb._min.z() );
(*v)[6] = Vec3( bb._min.x(), bb._max.y(), bb._max.z() );
(*v)[7] = Vec3( bb._max.x(), bb._max.y(), bb._max.z() );
// This is the logical place to put this code, but the method is const. Cast
// away constness to compute the bounding box and modify the query geometry.
osg::OcclusionQueryNode* nonConstThis = const_cast<osg::OcclusionQueryNode*>( this );
nonConstThis->updateDefaultQueryGeometry();
}
Geometry* geom = static_cast< Geometry* >( nonConstThis->_queryGeode->getDrawable( 0 ) );
geom->setVertexArray( v.get() );
geom = static_cast< osg::Geometry* >( nonConstThis->_debugGeode->getDrawable( 0 ) );
geom->setVertexArray( v.get() );
}
return Group::computeBound();
@@ -723,21 +724,12 @@ bool OcclusionQueryNode::getPassed() const
void OcclusionQueryNode::createSupportNodes()
{
GLushort indices[] = { 0, 1, 2, 3, 4, 5, 6, 7,
0, 3, 6, 5, 2, 1, 4, 7,
5, 4, 1, 0, 2, 7, 6, 3 };
{
// Add the test geometry Geode
_queryGeode = new Geode;
_queryGeode->setName( "OQTest" );
_queryGeode->setDataVariance( Object::DYNAMIC );
ref_ptr< QueryGeometry > geom = new QueryGeometry( getName() );
geom->setDataVariance( Object::DYNAMIC );
geom->addPrimitiveSet( new DrawElementsUShort( PrimitiveSet::QUADS, 24, indices ) );
_queryGeode->addDrawable( geom.get() );
_queryGeode->addDrawable( createDefaultQueryGeometry( getName() ) );
}
{
@@ -746,17 +738,7 @@ void OcclusionQueryNode::createSupportNodes()
_debugGeode = new Geode;
_debugGeode->setName( "Debug" );
_debugGeode->setDataVariance( Object::DYNAMIC );
ref_ptr<Geometry> geom = new Geometry;
geom->setDataVariance( Object::DYNAMIC );
ref_ptr<Vec4Array> ca = new Vec4Array;
ca->push_back( Vec4( 1.f, 1.f, 1.f, 1.f ) );
geom->setColorArray( ca.get(), Array::BIND_OVERALL );
geom->addPrimitiveSet( new DrawElementsUShort( PrimitiveSet::QUADS, 24, indices ) );
_debugGeode->addDrawable( geom.get() );
_debugGeode->addDrawable( createDefaultDebugQueryGeometry() );
}
// Creste state sets. Note that the osgOQ visitors (which place OQNs throughout
@@ -767,6 +749,69 @@ void OcclusionQueryNode::createSupportNodes()
}
void OcclusionQueryNode::setQueryGeometryInternal( QueryGeometry* queryGeom,
Geometry* debugQueryGeom,
QueryGeometryState state )
{
if (!queryGeom || !debugQueryGeom)
{
OSG_FATAL << "osgOQ: OcclusionQueryNode: No QueryGeometry." << std::endl;
return;
}
_queryGeometryState = state;
_queryGeode->removeDrawables(0, _queryGeode->getNumDrawables());
_queryGeode->addDrawable(queryGeom);
_debugGeode->removeDrawables(0, _debugGeode->getNumDrawables());
_debugGeode->addDrawable(debugQueryGeom);
}
void OcclusionQueryNode::updateDefaultQueryGeometry()
{
if (_queryGeometryState == USER_DEFINED)
{
OSG_FATAL << "osgOQ: OcclusionQueryNode: Unexpected QueryGeometryState=USER_DEFINED." << std::endl;
return;
}
ComputeBoundsVisitor cbv;
accept( cbv );
BoundingBox bb = cbv.getBoundingBox();
const bool bbValid = bb.valid();
_queryGeometryState = bbValid ? VALID : INVALID;
osg::ref_ptr<Vec3Array> v = new Vec3Array;
v->resize( 8 );
// Having (0,0,0) as vertices for the case of the invalid query geometry
// still isn't quite the right thing. But the query geometry is public
// accessible and therefore a user might expect eight vertices, so
// it seems safer to keep eight vertices in the geometry.
if (bbValid)
{
(*v)[0] = Vec3( bb._min.x(), bb._min.y(), bb._min.z() );
(*v)[1] = Vec3( bb._max.x(), bb._min.y(), bb._min.z() );
(*v)[2] = Vec3( bb._max.x(), bb._min.y(), bb._max.z() );
(*v)[3] = Vec3( bb._min.x(), bb._min.y(), bb._max.z() );
(*v)[4] = Vec3( bb._max.x(), bb._max.y(), bb._min.z() );
(*v)[5] = Vec3( bb._min.x(), bb._max.y(), bb._min.z() );
(*v)[6] = Vec3( bb._min.x(), bb._max.y(), bb._max.z() );
(*v)[7] = Vec3( bb._max.x(), bb._max.y(), bb._max.z() );
}
Geometry* geom = static_cast< Geometry* >( _queryGeode->getDrawable( 0 ) );
geom->setVertexArray( v.get() );
geom = static_cast< osg::Geometry* >( _debugGeode->getDrawable( 0 ) );
geom->setVertexArray( v.get() );
}
void OcclusionQueryNode::releaseGLObjects( State* state ) const
{
if (_queryGeode.valid()) _queryGeode->releaseGLObjects(state);
@@ -787,14 +832,22 @@ void OcclusionQueryNode::discardDeletedQueryObjects( unsigned int contextID )
QueryGeometry::discardDeletedQueryObjects( contextID );
}
osg::QueryGeometry* OcclusionQueryNode::getQueryGeometry()
void OcclusionQueryNode::setQueryGeometry( QueryGeometry* geom )
{
if (_queryGeode && _queryGeode->getDrawable( 0 ))
OpenThreads::ScopedLock<OpenThreads::Mutex> lock( _computeBoundMutex ) ;
if (geom)
{
QueryGeometry* qg = static_cast< QueryGeometry* >( _queryGeode->getDrawable( 0 ) );
return qg;
setQueryGeometryInternal( geom, geom, USER_DEFINED );
}
else
{
setQueryGeometryInternal( createDefaultQueryGeometry( getName() ),
createDefaultDebugQueryGeometry(),
INVALID);
updateDefaultQueryGeometry();
}
return 0;
}
const osg::QueryGeometry* OcclusionQueryNode::getQueryGeometry() const

View File

@@ -98,7 +98,7 @@ void PagedLOD::setDatabasePath(const std::string& path)
/*
// make sure the last character is the appropriate slash
#ifdef WIN32
#ifdef _WIN32
if (lastCharacter==unixSlash)
{
lastCharacter = winSlash;

View File

@@ -78,7 +78,7 @@ void DrawElementsIndirectUInt::draw(State& state, bool /*useVertexBufferObjects*
state.get<GLExtensions>()-> glDrawElementsIndirect(mode, GL_UNSIGNED_INT,
(const GLvoid *)(dibo->getOffset(_indirectCommandArray->getBufferIndex()) //command array address
+_firstCommand* _indirectCommandArray->getElementSize())// runtime offset computaion can be sizeof(*_indirectCommandArray->begin())
+_firstCommand* _indirectCommandArray->getElementSize())// runtime offset computation can be sizeof(*_indirectCommandArray->begin())
);
}

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