Compare commits

...

282 Commits

Author SHA1 Message Date
Robert Osfield
07d2adec5c Release OpenSceneGraph-3.2.2
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/tags/OpenSceneGraph-3.2.2@15052 16af8721-9629-0410-8352-f15c8da7e697
2015-08-04 16:03:33 +00:00
Robert Osfield
30fff3106d Updated version and NEWS for 3.2.2 stable release
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@15051 16af8721-9629-0410-8352-f15c8da7e697
2015-08-04 15:52:28 +00:00
Robert Osfield
23458666b8 Update NEWS to online Contributors list.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@15050 16af8721-9629-0410-8352-f15c8da7e697
2015-08-04 10:37:50 +00:00
Robert Osfield
c91bfcee21 Updated AUTHORS
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@15049 16af8721-9629-0410-8352-f15c8da7e697
2015-08-04 10:26:26 +00:00
Robert Osfield
d763feddda Updated ChangeLog and NEWS for 3.2.2 release
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@15048 16af8721-9629-0410-8352-f15c8da7e697
2015-08-04 10:25:40 +00:00
Robert Osfield
3b789fc6b0 Upated rc number to 4
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@15047 16af8721-9629-0410-8352-f15c8da7e697
2015-08-04 10:11:39 +00:00
Robert Osfield
110cf64c3b Build fix for Mingw
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@15045 16af8721-9629-0410-8352-f15c8da7e697
2015-08-04 09:35:00 +00:00
Robert Osfield
9d326917f0 From Pjotr Svetachov, buid fixes for VS2015.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@15023 16af8721-9629-0410-8352-f15c8da7e697
2015-07-23 14:42:39 +00:00
Robert Osfield
5ead09215e Added check for validity of OpenFlight shininess value.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@15000 16af8721-9629-0410-8352-f15c8da7e697
2015-07-21 14:22:12 +00:00
Robert Osfield
60838d0c42 Fixed typo
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14995 16af8721-9629-0410-8352-f15c8da7e697
2015-07-21 13:42:07 +00:00
Robert Osfield
bddbdfdefe Reinstated the TIFFSetField(image, TIFFTAG_ROWSPERSTRIP, rowsperstrip);
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14987 16af8721-9629-0410-8352-f15c8da7e697
2015-07-19 09:51:27 +00:00
Robert Osfield
0744b6881f Updated release candidate nubmer
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14979 16af8721-9629-0410-8352-f15c8da7e697
2015-07-17 09:15:40 +00:00
Robert Osfield
3371ce640a Updated ChangeLog and AURHORS
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14976 16af8721-9629-0410-8352-f15c8da7e697
2015-07-17 09:03:49 +00:00
Robert Osfield
dff397f647 Updated ChangeLog and AUTHORS file
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14975 16af8721-9629-0410-8352-f15c8da7e697
2015-07-17 08:35:23 +00:00
Robert Osfield
1c833e2e4d Added cmake_policy setting for cmake-3.x to avoid warning with Qt usage.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14972 16af8721-9629-0410-8352-f15c8da7e697
2015-07-17 08:17:34 +00:00
Robert Osfield
cf268b4cfd From Patrick Neary, "To the tiff plugin, add the capability to write tiff images with unsigned short data"
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14971 16af8721-9629-0410-8352-f15c8da7e697
2015-07-17 08:13:01 +00:00
Robert Osfield
1d628eebfb From Patrick Neary, "Added some lesser used tokens that we use from GL_ARB_texture_rg to computeFormatDataType(), and computeNumComponents() in src/osg/Image.cpp"
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14968 16af8721-9629-0410-8352-f15c8da7e697
2015-07-16 19:19:29 +00:00
Robert Osfield
20401947bf Build fix for GLDAL>=2.0
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14926 16af8721-9629-0410-8352-f15c8da7e697
2015-06-30 08:38:53 +00:00
Robert Osfield
16ac602824 From Jannik Heller, fix to clearReferencesToDependentCameras().
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14923 16af8721-9629-0410-8352-f15c8da7e697
2015-06-19 09:54:05 +00:00
Robert Osfield
4f830fb0e2 From Farshid Lashkari, "I've modified some setter methods of TextBase to avoid unnecessary calls to computeGlyphRepresentation() if the value has not changed."
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14911 16af8721-9629-0410-8352-f15c8da7e697
2015-06-12 08:04:38 +00:00
Robert Osfield
d4fc0ceba3 Philippe Renon, "Fixed potential divide by zero in NodeTrackerManipulator : The divide by zero happens when throwing a NodeTrackerManipulator.
The infinite result trickles down and later causes NaN in culling.

The fix was to use getThrowScale() as done everywhere else."


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14906 16af8721-9629-0410-8352-f15c8da7e697
2015-06-10 10:02:22 +00:00
Robert Osfield
825882be19 Fixed setReferenceTime() bug where a * eather than the correct / was being used. Bug and fix suggested Benjamin Richter.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14897 16af8721-9629-0410-8352-f15c8da7e697
2015-06-07 11:13:08 +00:00
Robert Osfield
bc473c4e0e Fixed memory error associated with reading over the end of container due to an unbounded while loop.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14867 16af8721-9629-0410-8352-f15c8da7e697
2015-05-21 14:11:54 +00:00
Robert Osfield
a430566596 Changed the CMP0020 check to > 2.8.10
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14863 16af8721-9629-0410-8352-f15c8da7e697
2015-05-05 11:04:05 +00:00
Robert Osfield
3d77abc06d Merged correction to coordinates from svn/trunk
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14853 16af8721-9629-0410-8352-f15c8da7e697
2015-04-20 10:43:00 +00:00
Robert Osfield
033e52b8ef Updated contributor fixes
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14852 16af8721-9629-0410-8352-f15c8da7e697
2015-04-20 10:42:28 +00:00
Robert Osfield
785ce9f679 Moved uniform substitution to infront of vertex attribute substituion to make sure gl_Vertex usage is replaced when required.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14847 16af8721-9629-0410-8352-f15c8da7e697
2015-04-20 09:38:49 +00:00
Robert Osfield
f26be0155c From Lionel Largarde, "fix for the Image::computeNumberOfMipmapLevels method. The method did use the float version of the log function and the / operator.
It works for most of the input sizes, but fails for 8192, 32768...
For 8192, the method returns 13 instead of 14."



git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14815 16af8721-9629-0410-8352-f15c8da7e697
2015-04-01 09:37:53 +00:00
Robert Osfield
9eb02084a6 Removed unimplemented ComputeBoundingBoxCallback and ComputeBoundingSphereCallback
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14799 16af8721-9629-0410-8352-f15c8da7e697
2015-03-17 09:10:59 +00:00
Robert Osfield
bd82047acb Added missing references for static build
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14797 16af8721-9629-0410-8352-f15c8da7e697
2015-03-17 08:26:13 +00:00
Robert Osfield
f9a20d017a From Konstantin Matveyev, "Last update in the osgAnimation::Animation ONCE mode bug fix"
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14790 16af8721-9629-0410-8352-f15c8da7e697
2015-03-16 10:30:51 +00:00
Robert Osfield
5878a70ede Reverted merged from svn/trunk.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14787 16af8721-9629-0410-8352-f15c8da7e697
2015-03-13 08:13:59 +00:00
Robert Osfield
57d04290ab From Konstantin Matveyev, "Small fix for OSG 3.3.6.119 in the attachment.
One line added in osg/LibraryWrapper.cpp

USE_SERIALIZER_WRAPPER(Callback)
"



git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14785 16af8721-9629-0410-8352-f15c8da7e697
2015-03-13 08:12:19 +00:00
Robert Osfield
ceda86b31b From Laurens Voerman, "attached is a zip with a modified version of:
OpenSceneGraph\CMakeModules\FindFBX.cmake

This version can find fbx sdk 2015.1 and will prefer it over older versions.

Tested with Visual Studio Express 2013 on 64bit windows 7"


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14783 16af8721-9629-0410-8352-f15c8da7e697
2015-03-12 15:12:57 +00:00
Robert Osfield
499e38ff98 Warning fixes
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14779 16af8721-9629-0410-8352-f15c8da7e697
2015-03-11 17:47:30 +00:00
Robert Osfield
3461d9e8b5 From Laurens Voerman, "The current version will not compile with SDL version 2, error
OpenSceneGraph\src\osgPlugins\sdl\JoystickDevice.cpp(42): error C2664: 'const char *SDL_JoystickName(SDL_Joystick *)' : cannot convert argument 1 from 'int' to 'SDL_Joystick *'
due to changes in the SDL api.

Tested with Visual Studio Express 2013; SDL 2.0.1"


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14777 16af8721-9629-0410-8352-f15c8da7e697
2015-03-11 17:37:33 +00:00
Robert Osfield
4a535fe426 Updated RC to 2.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14763 16af8721-9629-0410-8352-f15c8da7e697
2015-03-05 18:00:54 +00:00
Robert Osfield
fc7302ccba Updated AUTHORS file for next release candidate
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14762 16af8721-9629-0410-8352-f15c8da7e697
2015-03-05 18:00:16 +00:00
Robert Osfield
7f4d116391 Restructed the checks in the CollectLowestTransformsVisitor::removeTransforms() to avoid benign case being flagged as warning.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14754 16af8721-9629-0410-8352-f15c8da7e697
2015-03-03 12:56:10 +00:00
Robert Osfield
edf27e36ed Re-organized the #ifdef's to avoid usage of glPolyginMode under GLES
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14750 16af8721-9629-0410-8352-f15c8da7e697
2015-03-03 12:00:22 +00:00
Robert Osfield
c8d8a051ad From Michael McDonnell, Merged enchancements to osgtesselationshader example from OSG-svn/trunk to OSG-3.2 branch.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14746 16af8721-9629-0410-8352-f15c8da7e697
2015-03-02 11:08:59 +00:00
Robert Osfield
4c9e17fcc7 From Jannik Heller, "I noticed the rotation in the OrbitManipulator depends on the framerate. To reproduce this issue, start the osganimate example, rotate the model with the left mouse button, then let go of the mouse button while still moving. You will notice that with V-Sync enabled, the model rotates slower.
The OrbitManipulator calculates a scale to counteract the framerate dependency, but it turns out this scale wasn't used for the rotation yet."


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14743 16af8721-9629-0410-8352-f15c8da7e697
2015-03-01 11:08:51 +00:00
Robert Osfield
95853370e1 Updated AUTHROS, Controbitors and rc number in prep for the 3.2.2-rc1
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14741 16af8721-9629-0410-8352-f15c8da7e697
2015-02-27 10:15:45 +00:00
Robert Osfield
c90cc658a0 Updated AUTHORS
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14734 16af8721-9629-0410-8352-f15c8da7e697
2015-02-26 20:06:11 +00:00
Robert Osfield
7c8ab128a6 From Bradley Baker Searles, "We had someone replace a DDS texture with a GL_RGB/GL_UNSIGNED_SHORT_5_6_6 image, which would trigger a crash in Image.cpp while flipping the mipmap chain. The code was trying to flip the mipmaps using the rowStep for the full-size image (we have "dds_flip" set in the osgDB::ReaderWriter::Options in the osgDB::Registry)."
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14731 16af8721-9629-0410-8352-f15c8da7e697
2015-02-26 19:13:46 +00:00
Robert Osfield
1185fbda34 From Bradley Baker Searles, "Small patch attached to handle DDS flip when s=4. Currently it will omit flipping and generate a warning: "Vertical flip was skipped. Image dimensions have to be multiple of 4."."
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14730 16af8721-9629-0410-8352-f15c8da7e697
2015-02-26 18:07:25 +00:00
Robert Osfield
005e52144d Fixed typo
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14726 16af8721-9629-0410-8352-f15c8da7e697
2015-02-26 14:16:36 +00:00
Robert Osfield
b6f05114dc Fixed image allocation operations.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14713 16af8721-9629-0410-8352-f15c8da7e697
2015-02-23 20:28:37 +00:00
Robert Osfield
8bb91a5265 From Arjun Ramamurthy, fix for StatsHandler when being used in multiple view/windows
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14710 16af8721-9629-0410-8352-f15c8da7e697
2015-02-23 11:07:35 +00:00
Robert Osfield
13f2cb3f47 From Sebastian Messerschmidt,"Attached you find a version of the ReaderWriterDDS with info outputs set to OSG_INFO instead of OSG_NOTICE. The old version spams the console for each loaded DDS file."
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14702 16af8721-9629-0410-8352-f15c8da7e697
2015-02-18 10:23:43 +00:00
Robert Osfield
dab3efadce Updated ChangeLog
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14649 16af8721-9629-0410-8352-f15c8da7e697
2015-01-06 15:10:48 +00:00
Robert Osfield
6f004ef7db From Julien Valentin, added missing initializer
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14648 16af8721-9629-0410-8352-f15c8da7e697
2015-01-06 14:55:10 +00:00
Robert Osfield
6895e29417 From Julien Valentin, typo fix
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14645 16af8721-9629-0410-8352-f15c8da7e697
2015-01-06 14:41:18 +00:00
Robert Osfield
6cf1db199c Added comment about using -DCMAKE_DISABLE_FINDPACKAGE_* command line.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14631 16af8721-9629-0410-8352-f15c8da7e697
2014-12-22 10:35:30 +00:00
Robert Osfield
d4e5c72ebc Added doxygen comment for ref_ptr<>::release().
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14629 16af8721-9629-0410-8352-f15c8da7e697
2014-12-22 09:50:08 +00:00
Robert Osfield
3dd2816414 From Mattias Helsing, "CMake have release 3.0 and 3.1 and we have some bad checks for cmake
major version when settings cmake policies in CMakeLists.txt. This fixes it"


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14619 16af8721-9629-0410-8352-f15c8da7e697
2014-12-18 15:59:06 +00:00
Robert Osfield
eeadbae72d Updated AUTHORS
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14618 16af8721-9629-0410-8352-f15c8da7e697
2014-12-18 11:37:54 +00:00
Robert Osfield
b203faaa22 From Adrian Clark, "Recently I tried compiling version 3.x of OpenSceneGraph for Android, using a recent Android NDK, only to run into problems with missing dependencies when trying to link my android project against the generated libraries.
After some exploration, I found the problem is because the APP_PLATFORM variable in Application.mk is set to a platform number which is no longer compatible with the Android NDK by the OSG CMake toolchain. This causes the Android to compile it using the most recent Android platform libraries which (for reasons I don't know) no longer provide functions which OSG relies (in particular rand and stat64).



This bug affects the current SVN repos for OSG 3.3.1, OSG 3.3.0, OSG 3.2.1 and OSG 3.2.0 (and possibly earlier).



I posted a longer discussion of what the problem is in this forum thread:

http://forum.openscenegraph.org/viewtopic.php?p=62012#62012





But essentially the fix is to change one line in OSG/PlatformSpecifics/Android/Application.mk.master.in from:



APP_PLATFORM := ${ANDROID_PLATFORM}



To



APP_PLATFORM := android-${ANDROID_PLATFORM}





The attached file will fix the bug in the 3.2.0 - 3.3.1 SVN repos for OSG.

"


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14612 16af8721-9629-0410-8352-f15c8da7e697
2014-12-18 09:20:40 +00:00
Robert Osfield
324dc573a0 From Farshid Lashkari, "The Collada loader would crash while processing textures on certain files. I've attached the fix."
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14596 16af8721-9629-0410-8352-f15c8da7e697
2014-12-10 11:30:02 +00:00
Robert Osfield
750cd78178 Fixed memory leak in RenderStageCache.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14579 16af8721-9629-0410-8352-f15c8da7e697
2014-12-08 11:08:48 +00:00
Robert Osfield
b5179e247f Fixed warnigns
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14548 16af8721-9629-0410-8352-f15c8da7e697
2014-11-26 17:07:51 +00:00
Robert Osfield
84ec88cc25 Removed redundent line endings
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14547 16af8721-9629-0410-8352-f15c8da7e697
2014-11-26 17:07:07 +00:00
Robert Osfield
7a9e97877c Fixed deprecated warnings
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14544 16af8721-9629-0410-8352-f15c8da7e697
2014-11-26 16:29:43 +00:00
Robert Osfield
0bedd4c43a Fixed warning
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14543 16af8721-9629-0410-8352-f15c8da7e697
2014-11-26 16:15:50 +00:00
Robert Osfield
d1b9bdbbbe Fixed warnings
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14541 16af8721-9629-0410-8352-f15c8da7e697
2014-11-26 16:07:46 +00:00
Robert Osfield
c923584158 Removed redudent spaces
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14540 16af8721-9629-0410-8352-f15c8da7e697
2014-11-26 16:06:55 +00:00
Robert Osfield
c789f7bced Fixed warning
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14538 16af8721-9629-0410-8352-f15c8da7e697
2014-11-26 16:02:06 +00:00
Robert Osfield
18810de975 From Jan Klimke, "i noticed, that there are a couple of additional flaws when building osg for Mac OS X 10.10 Yosemite.
The mac os sdk version is recognized by the current CMAKE script as 10.1 instead of 10.10 since it cuts the version string from the 4th place. I introduced a more reliable version checking based on splitting the returned version code into MAJOR MINOR and PATCH parts and reassemble the OSG sdk version afterwards.

I replaced the existing CMake code against the following (returning now version 10.10 as expected):

 # Determine the canonical name of the selected Platform SDK
   EXECUTE_PROCESS(COMMAND "/usr/bin/sw_vers" "-productVersion"
                   OUTPUT_VARIABLE OSG_OSX_SDK_NAME
                   OUTPUT_STRIP_TRAILING_WHITESPACE)
   STRING(REPLACE "." ";" MACOS_VERSION_LIST ${OSG_OSX_SDK_NAME})
   LIST(GET MACOS_VERSION_LIST 0 MACOS_VERSION_MAJOR)
   LIST(GET MACOS_VERSION_LIST 1 MACOS_VERSION_MINOR)
   LIST(GET MACOS_VERSION_LIST 2 MACOS_VERSION_PATCH)

   SET(OSG_OSX_SDK_NAME "macosx${MACOS_VERSION_MAJOR}.${MACOS_VERSION_MINOR}")

Also i added the check for the new Version to some more find scripts.

Additionally the nil object in Objective C now seems to be equivalent with a null_ptr that cannot be passed as GLInt anymore. So i switched this in the PixelBufferCocoa.mm to pass a zero instead of nil.
"


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14528 16af8721-9629-0410-8352-f15c8da7e697
2014-11-24 15:24:31 +00:00
Robert Osfield
e3ba4c82e4 Fixed handling of viewer's Camera
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14525 16af8721-9629-0410-8352-f15c8da7e697
2014-11-24 14:10:40 +00:00
Robert Osfield
ce82cfd25f From Alberto Luaces,"the current code uses the preprocessor for generating the plugin path in
a way that when CMAKE_INSTALL_PREFIX contains something along the lines
of

/usr/x86_64-linux-gnu/

it gets substituted as

/usr/x86_64-1-gnu/

that is, the string is preprocessed again, thereby making changes to
anything that matches any defined symbol, as "linux" in this example
(https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=763816).

Quoting that path directly in CMake scripts solves that problem.
"



git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14521 16af8721-9629-0410-8352-f15c8da7e697
2014-11-21 20:16:13 +00:00
Robert Osfield
9c42d8f0da From Björn Blissing, fix for ambiguous defines in Atomic.cpp when compiling with MinGW and GCC
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14512 16af8721-9629-0410-8352-f15c8da7e697
2014-11-21 10:21:44 +00:00
Robert Osfield
2b4221c211 Copied Contributors file from svn/trunk.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14511 16af8721-9629-0410-8352-f15c8da7e697
2014-11-21 09:28:20 +00:00
Robert Osfield
7d04c3457a From Claus Steuer, "XCode 6, IOs 8.1 SDK Compile fix : There are some undefined texture formats when compiling osg for IOs 8.1 with XCode 6 and OpenGLES2 enabled."
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14509 16af8721-9629-0410-8352-f15c8da7e697
2014-11-20 17:37:50 +00:00
Robert Osfield
166a8b6ccf From Farshid Lashkari, "The obj loader was overriding the existing database path list with the file path of the model, instead of prepending the file path to the path list. The latter seems to be more common behavior for most of the existing loader plugins. Also, the local options weren't actually being used when processing the scene graph for textures. I've attached the fix for both issues."
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14506 16af8721-9629-0410-8352-f15c8da7e697
2014-11-20 16:38:17 +00:00
Robert Osfield
5cc425cf99 From Marc Helbling, "here is a trivial fix in the Inventor plugin. In one code path, the pointer validity is checked after dereferencing a pointer that can be null (image->valid()) instead of calling ref_ptr::valid (image.valid())."
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14504 16af8721-9629-0410-8352-f15c8da7e697
2014-11-20 10:52:20 +00:00
Robert Osfield
f19a63e50d From Marc Helbling, "I've come across scenes that contains geometries with initialized but empty vertex arrays and primitives and that would make some optimizers crash.
The submission therefore only contains a test on the size of the vertex array for the VertexCacheMissVisitor and the VertexAccessOrderVisitor visitors."



git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14502 16af8721-9629-0410-8352-f15c8da7e697
2014-11-20 10:45:03 +00:00
Robert Osfield
506f26d292 From Sukender, "Fix for 3DS reader, which may read wrong triangles. Actually, indices may suffer a 'short int' overflow, in two places."
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14499 16af8721-9629-0410-8352-f15c8da7e697
2014-11-20 09:55:48 +00:00
Robert Osfield
c8d3571efd Fixed segfalt in Texture2DArray copy constructor where it would apply images to an uninitialzed vector.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14497 16af8721-9629-0410-8352-f15c8da7e697
2014-11-20 09:41:22 +00:00
Robert Osfield
1fa34dbbcc From Marc Helbling, "patch adding support for ambient material in the FBX plugin. It's a straightfoward adaptation of the emissive support and has been tested on a proprietary model."
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14496 16af8721-9629-0410-8352-f15c8da7e697
2014-11-20 09:32:40 +00:00
Robert Osfield
3cabbb5a5a Added default setting of build type to Release
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14494 16af8721-9629-0410-8352-f15c8da7e697
2014-11-20 09:31:47 +00:00
Robert Osfield
0c052ce2ed From Pjotr Svetachov, fix for build breakage with giflib 5.0.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14492 16af8721-9629-0410-8352-f15c8da7e697
2014-11-20 09:21:48 +00:00
Robert Osfield
60bafc2050 Fixed contributors names
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14488 16af8721-9629-0410-8352-f15c8da7e697
2014-11-19 17:31:45 +00:00
Robert Osfield
0dd978df7a From Clement Boesch, "Fix remaining bit of Giflib5 usage"
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14487 16af8721-9629-0410-8352-f15c8da7e697
2014-11-19 17:31:00 +00:00
Robert Osfield
0ec0b79d6c From Laurens Voerman, "I found a new way to crach the osgviewer:
osgviewer "ProxyNode { FileNameList { cow.osgt } num_children 1 }".osgs

The proxy node reader wrongly assumes options to be non NULL.

fixed in attached zip:
src\osgWrappers\deprecated-dotosg\osg\ProxyNode.cpp

applies to both the 3.2 branch and svn trunk"


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14483 16af8721-9629-0410-8352-f15c8da7e697
2014-11-19 11:37:33 +00:00
Robert Osfield
9f0f107c66 Build fixes for ffmpeg LIBAVCODEC_VERSION_MAJOR >= 56
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14463 16af8721-9629-0410-8352-f15c8da7e697
2014-11-04 16:29:37 +00:00
Robert Osfield
cceb63ed12 Fixed MD2 danglng pointer crash.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14412 16af8721-9629-0410-8352-f15c8da7e697
2014-08-19 09:27:44 +00:00
Robert Osfield
e5185937c8 From Ryan Kawicki, "There is an issue where the model insets of a terrex terrain are being removed during the loading process. The issue is described below.
- the issue here is that the plugin is removing group nodes if
      that group node only has one child.  becuase transforms are also
      group nodes, there were cases when the transform would have only
      one child under it and would cause it to remove the translation
      portion.  this would cause all the vertex data to be loaded around
      the last matrix operation, which in our case was the origin (0,0,0).

We work off of OSG 2.8.1 but see that this has not been addressed on latest yet.  I’ve tested this against 2.8.1 and have cleanly applied it to my local repository off of latest."



git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14406 16af8721-9629-0410-8352-f15c8da7e697
2014-08-08 16:42:31 +00:00
Robert Osfield
9221cab9c5 From Tim George, "Currently there is a problem with using a camera with a viewport with a non 0 offset and also using an FBO. The problem is that only area made up of the viewports width and height is drawn based on an offset of 0,0 instead of using the viewports offset.
It is caused by line 991 in RenderStage.cpp:


Code:
fbo_ext->glBlitFramebuffer(
0, 0, static_cast<GLint>(_viewport->width()), static_cast<GLint>(_viewport->height()),
0, 0, static_cast<GLint>(_viewport->width()), static_cast<GLint>(_viewport->height()),
blitMask, GL_NEAREST);



which is not taking into account the viewport x and y when performing the blit. It probably should be:


Code:
fbo_ext->glBlitFramebuffer(
static_cast<GLint>(_viewport->x()), static_cast<GLint>(_viewport->y()),
static_cast<GLint>(_viewport->width()) + static_cast<GLint>(_viewport->x()), static_cast<GLint>(_viewport->height()) + static_cast<GLint>(_viewport->y()),
static_cast<GLint>(_viewport->x()), static_cast<GLint>(_viewport->y()),
static_cast<GLint>(_viewport->width()) + static_cast<GLint>(_viewport->x()), static_cast<GLint>(_viewport->height()) + static_cast<GLint>(_viewport->y()),
blitMask, GL_NEAREST);
"

Note from Robert Osfield, made small tweak to above on merge, changing the width+x to x+width to make it read more naturally.



git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14404 16af8721-9629-0410-8352-f15c8da7e697
2014-08-08 16:34:09 +00:00
Robert Osfield
4b687b7a86 From Marc Helbling, "please find a fix for the vertex pretransform visitor (VertexAccessOrderVisitor).
The issue with current code is that arrays are collected *before* duplicating shared arrays which leads to arrays that are correctly duplicated but that are not reordered.

Also the submitted patch contains a small cleaning in GeometryArrayGathrer as the _useDrawElements variable is not used; it is only set in the GeometryArrayGathrer constructor and VertexAccessOrderVisitor already checks that primitives have indexed type."


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14402 16af8721-9629-0410-8352-f15c8da7e697
2014-08-08 16:09:38 +00:00
Robert Osfield
f32d30d033 Applied fix to Node::remove*Callback(NodeCallback*) inspired by fix from Glen Waldron that was applied to svn/trunk.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14400 16af8721-9629-0410-8352-f15c8da7e697
2014-08-08 15:45:48 +00:00
Robert Osfield
c931140eaf Added catch for NULL Transform pointers getting into the _transformMap.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14387 16af8721-9629-0410-8352-f15c8da7e697
2014-07-29 15:47:51 +00:00
Robert Osfield
21a2cf6ff1 Removed usage of _appliedProgramObjectSet as it's no longer used by OSG applications and was causing a threading crash.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14379 16af8721-9629-0410-8352-f15c8da7e697
2014-07-22 16:35:28 +00:00
Robert Osfield
3416f91704 Updated version to 3.2.2
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14378 16af8721-9629-0410-8352-f15c8da7e697
2014-07-22 16:34:44 +00:00
Robert Osfield
7126619e40 Added setting of glPixelStore before glTexSubImage2D call.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14373 16af8721-9629-0410-8352-f15c8da7e697
2014-07-21 13:45:57 +00:00
Robert Osfield
12cf202cfc I want to submit a bugfix for a crash occurring in osgText/Glyph.cpp if
the scene tree contains (large) 2D textures from images with STRIDE.

============================================================================
#0  0x00007fffe8ea4350 in __memmove_ssse3 () from /lib64/libc.so.6
#1  0x00007fffe52ced76 in ?? () from /usr/lib64/libnvidia-glcore.so.310.44
#2  0x00007fffe52d8e86 in ?? () from /usr/lib64/libnvidia-glcore.so.310.44
#3  0x00007fffe53dd8be in ?? () from /usr/lib64/libnvidia-glcore.so.310.44
#4  0x00007fffe53c2643 in ?? () from /usr/lib64/libnvidia-glcore.so.310.44
#5  0x00007fffe53c7fdd in ?? () from /usr/lib64/libnvidia-glcore.so.310.44
#6  0x00007fffe53cbabf in ?? () from /usr/lib64/libnvidia-glcore.so.310.44
#7  0x00007fffe53cc1fa in ?? () from /usr/lib64/libnvidia-glcore.so.310.44
#8  0x00007ffff30092fd in osgText::GlyphTexture::apply (this=0x1bb8cf0, state=
    ...)
    at /d43/jaap/dev/jaapOSG/build/OpenSceneGraph3.3.1/src/osgText/Glyph.cpp:234
#9  0x00007ffff56c30b6 in osg::State::applyAttributeOnTexUnit (this=0x125f180,
    unit=0, attribute=0x1bb8cf0, as=...)
    at /d43/jaap/dev/jaapOSG/build/OpenSceneGraph3.3.1/include/osg/State:1713
#10 0x00007ffff56c2f3f in osg::State::applyTextureAttribute (this=0x125f180,
    unit=0, attribute=0x1bb8cf0)
    at /d43/jaap/dev/jaapOSG/build/OpenSceneGraph3.3.1/include/osg/State:411
#11 0x00007ffff30204da in osgText::Text::drawTextWithBackdrop (this=0x1baed70,
    state=..., colorMultiplier=...)
==============================================================================

The crash disappears if I either (1) disable the use of images with stride
in the (public) osgGeo-library, or (2) add the following bugfix to Glyph.cpp.
This combination gives me the confidence that I understand where this problem
originates from, without trying to understand the full OpenGL details.

===============================================================================
@@ -221,7 +223,12 @@
             imageData[i] = 0;
         }

+        glPixelStorei(GL_UNPACK_ALIGNMENT,1);

+        #if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE)
+        glPixelStorei(GL_UNPACK_ROW_LENGTH,getTextureWidth());
+        #endif
+
         // allocate the texture memory.
         glTexImage2D( GL_TEXTURE_2D, 0, GL_ALPHA,
                 getTextureWidth(), getTextureHeight(), 0,
================================================================================

I have copied (and adapted) the added lines above from the same source file,
where they were used in front of a similar call to glTexSubImage2D(.) around
line 515."



git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14371 16af8721-9629-0410-8352-f15c8da7e697
2014-07-21 13:43:10 +00:00
Robert Osfield
ae81ca6b6e Updated ChangeLog and README for release
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14362 16af8721-9629-0410-8352-f15c8da7e697
2014-07-04 11:34:44 +00:00
Robert Osfield
27bfc09c7a Updated version number to 3.2.1 for release
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14361 16af8721-9629-0410-8352-f15c8da7e697
2014-07-04 11:29:02 +00:00
Robert Osfield
ea5857c8d5 Updated RC number
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14359 16af8721-9629-0410-8352-f15c8da7e697
2014-07-04 08:52:29 +00:00
Robert Osfield
fb7f800ba7 Updated release candidate number and ChangeLog for 3.2.1-rc6
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14354 16af8721-9629-0410-8352-f15c8da7e697
2014-07-03 14:20:46 +00:00
Robert Osfield
0ecaf90a7c Updated NEWS in prep for 3.2.1 release
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14353 16af8721-9629-0410-8352-f15c8da7e697
2014-07-03 14:13:01 +00:00
Robert Osfield
32fe2f09d4 Added vertical destructors
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14352 16af8721-9629-0410-8352-f15c8da7e697
2014-07-03 13:06:56 +00:00
Robert Osfield
46c52f2a97 Merged fix from svn/trunk to handlng of file type of nested files within a .osgx, .osgt and .osgb file.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14345 16af8721-9629-0410-8352-f15c8da7e697
2014-07-02 14:14:57 +00:00
Robert Osfield
dfd59cbfe1 Added #include <stdint.h> to address compile issue on some Linux distro's.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14342 16af8721-9629-0410-8352-f15c8da7e697
2014-07-01 07:31:48 +00:00
Robert Osfield
81b32a3d89 Add dds no flip on write option to prevent output of .dds volume from being flipped by the dds plugin.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14340 16af8721-9629-0410-8352-f15c8da7e697
2014-06-30 15:31:39 +00:00
Robert Osfield
98889b7331 Updated ChangeLog and AUTHORS file
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14336 16af8721-9629-0410-8352-f15c8da7e697
2014-06-30 10:22:37 +00:00
Robert Osfield
4fefd87b80 From Mikhail Izmestev, "Attached fix to avoid vector reallocs on push_back in StateGraph::moveStateGraph."
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14335 16af8721-9629-0410-8352-f15c8da7e697
2014-06-30 10:13:22 +00:00
Robert Osfield
586c177db9 Updated ChangeLog and AUTHORS file
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14333 16af8721-9629-0410-8352-f15c8da7e697
2014-06-30 09:13:04 +00:00
Robert Osfield
b138fa8ab7 Updated RC number
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14330 16af8721-9629-0410-8352-f15c8da7e697
2014-06-30 08:55:36 +00:00
Robert Osfield
5aa7acd92b From Pjotr Svetachov, "Here is a small fix for a overflow when editing large 3d volume data."
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14328 16af8721-9629-0410-8352-f15c8da7e697
2014-06-30 08:46:53 +00:00
Robert Osfield
a4a684cb07 Removed space from #include.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14327 16af8721-9629-0410-8352-f15c8da7e697
2014-06-30 08:20:31 +00:00
Robert Osfield
d009dec52f Merged librsvg-2.0>=2.35 version check from svn/trunk.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14325 16af8721-9629-0410-8352-f15c8da7e697
2014-06-30 07:39:16 +00:00
Robert Osfield
9d14c9908e From Alexander Sinditskiy, build fix to allow building against versions older than librsvg-2.36.2
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14324 16af8721-9629-0410-8352-f15c8da7e697
2014-06-30 07:37:09 +00:00
Robert Osfield
cd5e4a999b Removed unused method.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14317 16af8721-9629-0410-8352-f15c8da7e697
2014-06-27 15:55:02 +00:00
Robert Osfield
46e53047bc From Laurens Voerman, "attached is a modified version of src/osgUtil/Tessellator.cpp
current code checks for a Nullpointer and on notify level info or above will inform you with a crash, by dereferencing it."



git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14316 16af8721-9629-0410-8352-f15c8da7e697
2014-06-27 15:48:41 +00:00
Robert Osfield
1d120f7814 Updated AUTHORS file
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14314 16af8721-9629-0410-8352-f15c8da7e697
2014-06-27 15:39:56 +00:00
Robert Osfield
2c25825800 Added a render order sort to the list of Cameras being tested by the *Viewer::generatePointerData(..) method to ensure that the highest Camera gets focus.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14311 16af8721-9629-0410-8352-f15c8da7e697
2014-06-27 15:38:48 +00:00
Robert Osfield
2f83db9442 Added a render order sort to the list of Cameras being tested by the *Viewer::generatePointerData(..) method to ensure that the highest Camera gets focus.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14308 16af8721-9629-0410-8352-f15c8da7e697
2014-06-27 15:30:50 +00:00
Robert Osfield
78a59c33bd Updated AUTHORS file
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14307 16af8721-9629-0410-8352-f15c8da7e697
2014-06-27 15:26:03 +00:00
Robert Osfield
ec8a784d90 Updated ChangeLog for 3.2.1-rc4
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14305 16af8721-9629-0410-8352-f15c8da7e697
2014-06-26 15:54:37 +00:00
Robert Osfield
949d6f20e5 Updated RC number to 4.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14304 16af8721-9629-0410-8352-f15c8da7e697
2014-06-26 15:18:56 +00:00
Robert Osfield
ce51923f87 From Sebastian Messerschmidt, "I've applied a simple fix for the backward animation support in osg::Sequence.
It will simply use the sign of the speed set in the getNextValue. Attached file is against trunk."


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14301 16af8721-9629-0410-8352-f15c8da7e697
2014-06-26 11:49:58 +00:00
Robert Osfield
1571ac72b7 From Laurens Voerman, "In order to speed up loading large scenes (especially from network disk) I added code to our viewer to setup multiple database-pagers and request the files trough a database-request:
databasePager->setUpThreads(16, 1);

We experienced problems with multiple databasepagers loading files in parallel, when two threads start to load the same file (usually a texture referenced by multiple models). The second thread to add the file to the cache (sometimes) manages to do so while the refcount from the cached object still is zero, causing the object loaded to be destroyed.
Sometimes the second thread manages to ref() the object before Referenced::signalObserversAndDelete does the final recount check, causing a warning:
    "Warning Referenced::signalObserversAndDelete(,,) doing delete with _refCount=1"

With a deleted object added to the scenegraph we get some undesired results, I think the program only crashes if the object was a Node, and just has some untextured surfaces if it was a texture, but I'm not completely sure.

Attached is a modified version of the Registry.cpp, returning the object in cache and let the duplicate loaded object to be destroyed.

A more efficient option would be to add some sort of blocking entry to the objectcache to stop the second thread from reading the file, and just wait until the first thread added it to the cache. If you think that's worthwile we would be happy to implement that version. A bit tricky to implement and test, that's why I submit a simple version that stops my program from crashing.
"


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14299 16af8721-9629-0410-8352-f15c8da7e697
2014-06-26 11:11:38 +00:00
Robert Osfield
64bef29848 Removed erroneous character
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14297 16af8721-9629-0410-8352-f15c8da7e697
2014-06-26 11:09:21 +00:00
Robert Osfield
fc0c2a76c1 From Farshid Lashkari,
"I noticed that Text3D objects would change there z alignment depending on the alignment mode. I'm not sure if this was intentional or just a simple mistake. My expectation was that the front of the object would always stay aligned to the 0 z-plane, regardless of the alignment mode. I've attached an updated version that retains a consistent z-alignment."
"I just now noticed another issue with Text3D objects. It was not properly computing the bounding box when non-axis aligned rotations were being applied. In this case all corners of the bounding box need to be transformed in order to get the correct containing box. I've attached the updated file."
"The incorrect bounding box problem also applies to regular Text objects. I've attached the fix for that as well as the original Text3D fix."



git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14295 16af8721-9629-0410-8352-f15c8da7e697
2014-06-26 10:53:16 +00:00
Robert Osfield
fb09bd6c12 From Laurens Voerman, "while debugging ImageSequence I had a crash, due to the very large frametimes caused by halting the program. The problem is that when the frame time exceeds the length of the entire image sequence, a looping sequence will try to read it's _imageDataList beyond its size.
fix attached for  src/osg/ImageSequence.cpp"



git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14292 16af8721-9629-0410-8352-f15c8da7e697
2014-06-26 10:24:39 +00:00
Robert Osfield
94e7f4e860 From Laurens Voerman, "while testing databasepager stuff I noticed that the various loaders (osg/ive/osgx) do not pass the current options to the imagePager, therefore the images cannot be found if not in the global OSG_FILE_PATH. Attached is a fix, containing modified versions of
From Robert Osfield, add check to only apply Options object when a valid Option object is assigned.

src\osgPlugins\ive\ImageSequence.cpp
src\osgWrappers\deprecated-dotosg\osg\ImageSequence.cpp
src\osgWrappers\serializers\osg\ImageSequence.cpp"


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14291 16af8721-9629-0410-8352-f15c8da7e697
2014-06-26 10:05:55 +00:00
Robert Osfield
1ca2ed9729 From Farshid Lashkari, "I've attached a small fix for the ply loader to support Windows style line endings when reading the header."
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14289 16af8721-9629-0410-8352-f15c8da7e697
2014-06-26 09:39:16 +00:00
Robert Osfield
f86acab9b2 From Aurelien Albert, "This submission fix all my problems with reading / writing "osgb" files inside "osga" archive with final archive size > 2 Go, with Windows OS (didn't tested with Linux)"
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14286 16af8721-9629-0410-8352-f15c8da7e697
2014-06-26 09:33:54 +00:00
Robert Osfield
5461ca4b6f From Riccardo Corsi, "there's an inconsistency between the behavior of the method and the
debug message it prints out on the console.

Around line 1040 of Registry.cpp (see code below) the method returns
"simpleFileName" but prints about returning "filename".

In attachment the modified file, based on osg 3.2.0
ricky


<code>
if(fileExists(simpleFileName))
{
    OSG_DEBUG << "FindFileInPath(" << filename << "): returning " <<
filename << std::endl;
    return simpleFileName;
}
</code>
"



git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14284 16af8721-9629-0410-8352-f15c8da7e697
2014-06-25 16:05:53 +00:00
Robert Osfield
0f797078f0 Refactored the way that hole are pruned from the occluder hole list.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14281 16af8721-9629-0410-8352-f15c8da7e697
2014-06-25 15:47:54 +00:00
Robert Osfield
14332e5ca1 From Laurens Voerman, "a minor patch for osgconv to make sure the helptext is printed if you run "osgconv -h" with OSG_NOTIFY_LEVEL set too low.
applys to both trunk and stable branch."


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14279 16af8721-9629-0410-8352-f15c8da7e697
2014-06-25 11:07:57 +00:00
Robert Osfield
2f8a4c654a From Mikhail Izmestev, "Attached fix to avoid vector usage in StateGraph::prune and reduce heap allocations."
Notes from Robert Osfield, ammended the erase so that it explictly increments the iterator before the erase call.



git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14278 16af8721-9629-0410-8352-f15c8da7e697
2014-06-25 10:45:35 +00:00
Robert Osfield
832fb9798e From Björn Blissing, "I found a minor error in documentation in include/osg/Math.
Function: absolute() had the same description as the function minimum()

I removed the erroneous text."


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14274 16af8721-9629-0410-8352-f15c8da7e697
2014-06-25 08:21:40 +00:00
Robert Osfield
79b0f8c839 From Björn Blissing, "Fix to support correct shininess and transparency in FBX plugin
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14271 16af8721-9629-0410-8352-f15c8da7e697
2014-06-25 08:17:59 +00:00
Robert Osfield
8d41495014 From Pjotr Svetachov, "There were some modes missing when exporting to .ogst so I added them."
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14270 16af8721-9629-0410-8352-f15c8da7e697
2014-06-24 19:57:45 +00:00
Robert Osfield
fb28e0ffa1 "I've attached a small for the osg ReaderWriter. It was performing a case sensitive comparison to the file extension to determine whether to write the file in ascii or binary. This meant that if the filename was "model.OSGT" it would be treated as binary, instead of ascii. I've updated the plugin to ignore case."
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14268 16af8721-9629-0410-8352-f15c8da7e697
2014-06-24 14:59:04 +00:00
Robert Osfield
cb3ce747ca Fix to merge Geometries.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14266 16af8721-9629-0410-8352-f15c8da7e697
2014-06-24 11:24:48 +00:00
Robert Osfield
a6939bc46f Fixed check against number of vertices
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14263 16af8721-9629-0410-8352-f15c8da7e697
2014-06-16 16:18:02 +00:00
Robert Osfield
773d0a2ddf From Aurelien Albert, "I've got some issues using osgb files within an big osga archive (file size > 2Go).
Issue is described here : http://forum.openscenegraph.org/viewtopic.php?t=13914

Here is a fix, using "std::streampos" standard type for stream positions up to 64bits.
"



git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14260 16af8721-9629-0410-8352-f15c8da7e697
2014-06-16 08:54:51 +00:00
Robert Osfield
1b3dba7860 Removed generation of scroll event on the X11 button release event as X11 was generating both a pair of press/release events for a single scroll when movement.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14256 16af8721-9629-0410-8352-f15c8da7e697
2014-06-12 16:00:20 +00:00
Robert Osfield
f127220582 Added if () blocks to State::convertVertexShaderSourceToOsgBuiltIns() to ensure that only parts of the shader than need replacing are replaced.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14254 16af8721-9629-0410-8352-f15c8da7e697
2014-06-12 15:24:31 +00:00
Robert Osfield
52abe9503f Updated release candidate for 3.2.1-rc3 2014-05-22 14:52:26 +00:00
Robert Osfield
95acbe55b5 Upated ChangeLog and AUTHORS in prep for release candidate 2014-05-22 14:43:30 +00:00
Robert Osfield
3a5d834643 From Sebastian Messershmidt, "There was some small error due to MS non-conformity handling comments correctly." 2014-05-15 14:58:43 +00:00
Robert Osfield
2ab66723d5 From Pjotr Svetachov, "Today I found a bug in the IutputStream class when saving array
attributes in vec3b format. It looks like my compiler takes the wrong
overload and outputs integers instead of characters. The problem is
that vec3b is of type signed char and that is not the same as char (
see http://stackoverflow.com/questions/436513/char-signed-char-char-unsigned-char
) and visual studio 2013 will promote it to integer when choosing an
overload.
It looks like that the InputStream class already takes care of this
issue (if it didn't it would have read everything ok and I would have
not even stumbled upon this bug. :) )"
2014-04-29 13:41:33 +00:00
Robert Osfield
044e20911b From Pjotr Svetachov, "I had the osgvolume example crash on me when loading large volume
datasets due to an overflow in image.cpp after a unneeded cast from
unsigned int to int. Here is a small fix."
2014-04-28 14:58:33 +00:00
Robert Osfield
a256eac9c5 From Jason Beverage, "Here is a fix for a small race condition in osgDB::makeDirectory. It attempts to create all the directories in the given path and stops attempting to make directories when one of them fails. I've added a check to see if the failure occurred b/c the directory was created by another thread or process.
We were running into issues occasionally in osgEarth where multiple threads were writing out files like /1/2/3.jpg and /1/3/4.jpg.  Both threads would try to create the /1 directory and only one of them would succeed.  So the first thread would write out the full /1/2/3.jpg while the second thread wouldn't create the /1/3 directory b/c /1 was already created and the writing of /1/3/4.jpg would fail.
"
2014-04-28 14:57:01 +00:00
Robert Osfield
14b978369e Fixed type error 2014-04-28 11:53:53 +00:00
Robert Osfield
25aeb1dadc From Farshid Lashkari, "I've attached a small fix to the Collada loader which prevents a null pointer access in some cases." 2014-04-24 17:26:44 +00:00
Robert Osfield
762f0819ff In the ::apply method, when the image data need to be re-uploaded, the Texture2DArray checks if the TextureObject can be re-used. The test was made using the constant 1 instead of the real texture depth, so the TextureObject was never re-used. 2014-04-24 17:23:15 +00:00
Robert Osfield
0d30acccf1 Fixed reference invalidation bug. 2014-04-24 10:39:03 +00:00
Robert Osfield
5c73224c36 Fixed comment 2014-04-14 16:16:22 +00:00
Robert Osfield
b65f0043ef Renamed FindFreeType.cmake to FindFreetype.cmake to enable CMake build to pick up on CMake's own FindFreetype.cmake when it's available. 2014-04-13 16:04:25 +00:00
Robert Osfield
283b9d4447 Merged changes from svn/trunk to add the REMOVE_CXX_FLAGS macro 2014-04-13 16:03:17 +00:00
Robert Osfield
2d8b521e33 Disabled warnings that FBX headers are generating that we can't fix 2014-04-09 17:21:26 +00:00
Robert Osfield
a6df790b64 Added extra search files for K/Ubuntu 14.04 new location for freetype headers 2014-04-08 19:44:29 +00:00
Robert Osfield
c0ef8b8264 From Remo Eichenberger, "I have extended the TIFF plugin that allows you to write LZW or JPEG compressed TIFF's. Options are:
tiff_compression = lzw | jpeg"
2014-04-08 12:00:59 +00:00
Robert Osfield
8c0413e293 From Pjotr Svetachov, "We had a small problem converting skeleton animations from fbx to osgt
format. Turned out that the serializer didn't handle bone names with
spaces very well (the 3ds studio max biped for instance has spaces by
default). Here is a small fix for the problem."
2014-04-08 11:17:55 +00:00
Robert Osfield
a3288ea19a From Pjotr Svetachov, previous obj "commit broke compilation under visual studio 2013. To use std::not1 you need to include the functional header. Here is a fix." 2014-04-08 11:07:57 +00:00
Robert Osfield
eeeb18926a Fixed build when using of double BoundingBox/BoundingSphere 2014-04-07 15:04:32 +00:00
Robert Osfield
dcb01cf3e5 From Jan Peciva, "I am sending four fixes to obj plugin:
- materialName used to be not stripped of whitespace, making number of models
fail to load materials; now fixed
- stripping was considering spaces only, thus models using tabs had problems
to load correctly; fixed
- fixed references to textures; they did not performed conversion to native
directory separators
- make d (dissolve) takes precedence over Tr (transparency); there seems to be
a confusion about the Tr item - some claiming 1 to be opaque and 0
transparent, while number of models uses exactly the opposite. d (dissolve),
if present in the model, does not suffer from this confusion, thus using it
instead fixes the problem for many many models.

I put many comments to the file concerning d and Tr item as others may further
investigate. Let me know in the case of any problems."
2014-04-07 14:18:17 +00:00
Robert Osfield
6077e19029 From Marcel Pursche, "The problem is that when OpenThreads is build with the Linux pthreads implementation all threads inherit the processor affinity from their parent thread.
This behavior is also described in the pthreads man page (http://man7.org/linux/man-pages/man3/pthread_create.3.html):

>
> Linux-specific details
> The new thread inherits copies of the calling thread's capability
> sets (see capabilities(7)) and CPU affinity mask (see
> sched_setaffinity(2)).
>

To prevent this behaviour I wrote a patch that explicitly sets the affinity mask to all cores of the system, if no specific affinity was defined with PThread::setProcessorAffinity(unsigned int) .

Thank you!
"
2014-04-07 14:11:11 +00:00
Robert Osfield
34911d071e From Bjorn Blessing, "I got bored of the constant reports of “missing chunk 0xA08A” when reading 3ds-files. After a bit of research I discovered that this property is related to the advanced transparency settings for the material in 3D studio. In this case the falloff parameter. These controls affect the opacity falloff of a transparent material. And the property chooses whether falloff is in or out. I have added the property to the file reader BUT no changes are made to make this property propagate into the osgMaterial. But at least we get rid of this annoying error message." 2014-04-07 14:03:54 +00:00
Robert Osfield
21acda6898 From Paul Martz, "We discussed the issue of GL_RED_SNORM and GL_RG_SNORM some time ago, but the issue was never completely resolved. Please see the attached submission to fix the issue.
osg/GL2Extensions was incorrectly defining GL_RED_SNORM and GL_RG_SNORM as part of the definitions for OpenGL v3.1. However, a quick review of the 3.1 spec indicates that these are not part of the 3.1 standard.

My attached change moves these definitions out of the #ifndef GL_VERSION_3_1 conditional block, and defines them conditionally if not already defined. This allows the DDS plugin to build for GL3.
"
2014-04-07 13:48:11 +00:00
Robert Osfield
cdf9886a9e Improved white space trimming 2014-02-05 11:06:39 +00:00
Robert Osfield
d91c8b81cd Replaced C cast to long with a static_cast<const void*>() to avoid a build error under Mingw 64. 2014-01-31 19:18:22 +00:00
Robert Osfield
5a8aee3ede Updated ChangeLog 2014-01-29 11:08:29 +00:00
Robert Osfield
abefc9d8a8 Fixed MingW build's handling of debug d postfix. 2014-01-28 16:48:27 +00:00
Robert Osfield
8cbee2664f Disabled the compiler invocation at runtime. 2014-01-28 16:47:53 +00:00
Robert Osfield
ebbf2d1653 From Laurens Voerman, "I experienced a crash in Geometry::fixDeprecatedData(), on certain files, and brought the problem down to a very simple test file, attached as test3.zip.
There are two problems:
1> for DrawElementsUShortPrimitiveType (and UInt) the source_pindex still equals -1 and causes a crash
     in DrawElementsUBytePrimitiveType source_pindex is incremented, and in DrawElementsU(Short/Int)PrimitiveType primitiveNum is incremented, but never used

2> The drawelements need to be rewritten as the vertices are reordered.

created a patch for osg stable branch(r14038): attached as Geometry-osg-3.2.zip
and for svn brach(r14044): attached as Geometry_osg_svn.zip"
2014-01-24 17:31:03 +00:00
Robert Osfield
aa81404a41 From Aurelien Albert, "In the "apply" method of osg::FrameBufferObject, the draw buffers are always enabled, even if the target is only "READ_FRAMEBUFFER".
This can lead to inconsistency if you bind a framebuffer with multiple attachments in DRAW mode and then a framebuffer with different attachment count in READ mode (for example to manually "blit" from a FBo to another).

On some ATI cards (at least RADEON HD) this also leads to an "incomplete " FBO status

I've added a test to enable drawbuffers only if target is "DRAW" or "READ_DRAW", this solves my problems on ATI cards."
2014-01-24 17:06:33 +00:00
Robert Osfield
a69d12af10 From Michael Schanne, "small fix for a duplicate OR operand in KdTree.cpp." 2014-01-24 16:45:46 +00:00
Robert Osfield
1102058f31 From Torben Dannahuer, "modified findcollada.cmake which can now detect Boost 1.55 libraries, which are used by Collada in my 3rdParty package" 2014-01-24 16:28:28 +00:00
Robert Osfield
684b4d8bf5 From Torben Dannhauer, VisualStudio 2013 build fixes 2014-01-24 16:24:59 +00:00
Robert Osfield
69fd9d7530 From Marc Helbling, "I am sending a small fix in the PLY pseudo-loader; the extension was checked in plyfile.cpp thus preventing the loading of any .PLY file (extension in uppercase). The extension filtering is already handled by ReaderWriter::acceptsExtension in a case unsensitive way." 2014-01-24 16:02:00 +00:00
Robert Osfield
6ffe11dda5 Fixed warnings 2014-01-23 19:55:35 +00:00
Robert Osfield
a8e7dbd9ce Cleaned up the Qt find package, and made changed the default threading model to SingleThreaded when using Qt5 to avoid crash due to regresssion since Qt4. 2014-01-23 10:09:57 +00:00
Robert Osfield
a2e1dc04bf Added clean up of osg::Program that are applied by the GLObjectsVisitor, which addresses a state leak that creates GL error once the main scene graph is rendered. 2014-01-23 09:41:16 +00:00
Robert Osfield
7b39cbddfd Added GL_TEXTURE_2D_MULTISAMPLE to texture mode list. 2014-01-23 07:59:53 +00:00
Robert Osfield
eaca0d3d3d From Stephan Huber, OSX build fix 2014-01-17 18:22:16 +00:00
Robert Osfield
2665191aed From Kristofer Tingdahl, "the patch I sent to src/osgQt/CMakeModules.txt did not do the work on windows. I have fixed that, and also made it more generic so there is no special handling of qt5.2, but all qt5 are the same.
I have tested this on:

mac/qt5.2
linux/qt5.2
windows/qt5.2, and
mac/qt5.1

All platforms perform as expected.

The previous fix removed the -f flag to the moc-pre-processor, but on windows, it turned out that -f "osgQt/QGraphicsViewer" was needed.

This becomes an include-statement in the file generated by moc which is needed for compiling it. I ask you consider this patch for the trunk and the 3.2 branch.


Secondly, I wonder if it would be possible to apply my patch for FindRSVG.cmake from 22nd November in the 3.2 branch.

In short, the version of librsvg must be equal or higher to 2.35:

PKG_CHECK_MODULES(RSVG librsvg-2.0>=2.35)
"
2014-01-17 14:02:46 +00:00
Robert Osfield
ed2b25e32c From Jordi Torres, "Fixed a typo in ReaderWriterCURL::ReaderWriterCURL() changed Psuedo for Pseudo." 2014-01-17 13:53:54 +00:00
Robert Osfield
acdebc99bc From Farshid Lashkari, "I've attached a fix for the Collada loader that prevents a crash with some files containing textures. I also converted an OSG_NOTICE to OSG_INFO to be consistent with other log messages within the loader." 2014-01-08 10:32:58 +00:00
Robert Osfield
574b3eb573 Removed more odd characters 2014-01-08 10:31:24 +00:00
Robert Osfield
d32d406019 Removed more odd characters 2014-01-08 10:28:11 +00:00
Robert Osfield
8b3a85e6bc Removed odd characters 2014-01-08 10:24:32 +00:00
Robert Osfield
91660974e2 Removed execute permissions using svn propdel svn:executable file 2014-01-07 16:43:49 +00:00
Robert Osfield
0f547585d3 From Farshid Lashkari, "I've attached a small change to the DAE writer to support writing out unknown transform types. It will essentially treat it as a matrix transform, using the the local to world matrix value." 2014-01-07 16:29:20 +00:00
Robert Osfield
3ba5f22604 From Sebastian Messerschmidt, "Original shader was not running on various NVidia cards due to old syntax in shader." 2014-01-07 16:16:25 +00:00
Robert Osfield
64707b12f2 Updated SO_VERSION of OpenThreads to avoid conflicts with Debian increments to the SO version they have bumped for OpenThreads 2014-01-07 11:02:39 +00:00
Robert Osfield
7da5ae26d0 Added State::getMaxTextureCoords() and State::getMaxTextureUnits() inline methods. 2014-01-07 11:01:27 +00:00
Robert Osfield
485776bf18 Renamed the OSGSIM cmake variable to OSGSIM_LIBRARY to be consistent with the rest of the variables. 2014-01-06 10:23:31 +00:00
Robert Osfield
3eddec871a From Kristofer Tingdahl, "the syntax of the moc executable has changed between 5.1.1 and 5.2.0 versions of qt (see below). The difference is that the <file> argument has become mandatory after the -f option.
Hence, moc will complain when osg throws in a -f without anything after it. Hence I propose removing the -f on Qt5 builds. I have tested building without -f on both qt520 and qt511, and that works well.

The attached src/osgQt/CMakeLists.txt that can be patched into 3.2 safely. For the trunk, I would consider dropping the check on the version, and simply remove the option on qt5. I have tested that on qt5.1.1, and that worked fine. Question is however if it works on qt5.0. Probably it does, so the question is simplicity of CMakeList.txt vs safety."
2013-12-19 17:13:23 +00:00
Robert Osfield
f8f04cb04c From Mike Krus, compile fix to enable compiling across a wider set of versions. 2013-12-06 09:36:02 +00:00
Robert Osfield
4f11db1653 From Stephan Huber, workaround for Clang bug under Apple 2013-11-22 10:33:57 +00:00
Robert Osfield
63bd3be9cd Warning fixes 2013-11-22 10:27:20 +00:00
Robert Osfield
4ca088dcf9 Clean up of line endings 2013-11-22 10:10:14 +00:00
Robert Osfield
3ef97ddeea From Stephan Huber, "attached you’ll find some minor ios-fixes/-enhancements
* force _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC for IOS device + simulator as the test does not pick the right implementation
* fixed a small compile-bug for iphone-example
* added a check to prevent multiple realization of a GraphicsWindowIOS-object
"
2013-11-21 14:09:20 +00:00
Robert Osfield
31c54aa3e4 From Farshid Lashkari, "I recently encountered an issue attempting to load an IVE file generated by an older version of OSG. The file contained dxt1 compressed image data with mipmaps. The loaded model would cause crashes when passing the mipmap data to glCompressedTexImage2D. It seems that the size of the data array within the IVE file did not match the computed size from Image::getTotalSizeInBytesIncludingMipmaps(). This essentially made the mipmap offsets invalid within the Image object.
I'm not sure if the IVE was simply generated incorrectly, or if the Image::getTotalSizeInBytesIncludingMipmaps() was modified since the file was generated. Either way, I added a simple check in the IVE loader so that it clears the mipmap offsets if the actual data size does not match the computed data size. This seems like a safe fallback since the mipmap data can be automatically generated, and it fixes the problem in my case.

Also, while looking into this issue, I noticed that the osgDB::InputStream class applies the serialized image allocation mode. However, since the serializer is allocating the image data itself, it seems like it should force the allocation mode to USE_NEW_DELETE.
"
2013-11-21 13:58:36 +00:00
Robert Osfield
76c45c7731 Changed std::max to osg::minimum to addres build error under VS2013. 2013-11-21 11:00:50 +00:00
Robert Osfield
5efce09451 Removed -fpermissive flag from GCC build, and fixed warning 2013-10-25 15:48:15 +00:00
Robert Osfield
3f8e6d0a74 Added explict setting of the PolygonMode to over the distion mesh being toggled to wireframe. 2013-10-25 15:47:41 +00:00
Robert Osfield
9433947d2a Fixed warning 2013-10-24 20:22:05 +00:00
Robert Osfield
6f9b82142a Removed deprecated glib call 2013-10-24 19:56:14 +00:00
Robert Osfield
1dcc2555e7 Fixed FileInfo self initialization bug 2013-10-24 19:31:41 +00:00
Robert Osfield
27f9021df7 Fixed warnings 2013-10-22 16:28:03 +00:00
Robert Osfield
9af08d6715 From Colin McDonald, two submissions merged from svn/trunk:
"The osgb file reader uses seek to position within the file.
But the nested stream implementation for osga archive files doesn't
support seeking.  So osgb files can't currently be used in an osga
archive e.g. if osgdem is used to output a osgb format database it
can't be packaged in an archive file, in the same manner that ive
files could.

I've added seek support to the osga nested stream implementation."


"The osgt/osgb file formats output a scenegraph node with the type
set to "SCENE" in the file header.  But if the file is stored and
then extracted again from an osga archive this header info is lost,
and the resulting file is just an "OBJECT".  Possibly other plugin
operations would have the same effect.  The osgt/osgb plugin won't
then return the scenegraph contents.

I have updated the osgt/osgb plugin to return a node from an "OBJECT"
file."
2013-10-22 11:33:45 +00:00
Robert Osfield
5c4800c774 Fixed handling of in scene graph osg::Program being overriden by shader composition. 2013-10-22 11:17:29 +00:00
Robert Osfield
dfd8594042 From Robert Milharcic, workaround for ShaderComposer clean up bug. 2013-10-21 17:44:24 +00:00
Robert Osfield
be2d80abca Build fixes for clang 2013-10-21 09:56:57 +00:00
Robert Osfield
ca8f3d5f8a From Farshid Lashkari, "previously discussed change to the dae loader which applies the node ID as a "dae_node_id" user value." 2013-10-18 09:57:53 +00:00
Robert Osfield
790c0091e6 From Vladimir Chebeav, fix for removal of nested callbacks 2013-10-18 08:37:19 +00:00
Robert Osfield
ce58131cfc From Konstantin Matveyev, "Multiple light fix in FBX-importer" 2013-10-18 07:54:59 +00:00
Robert Osfield
309da2fe07 From Colin McDonald, "Added some missing updates to the serializer static build support." 2013-10-18 07:52:00 +00:00
Robert Osfield
97d706c640 Build fix 2013-10-17 18:34:16 +00:00
Robert Osfield
f14f58c486 Fix for error in getting the uniform block max name length, fix suggested by Christopher Fennell. 2013-10-17 18:29:38 +00:00
Robert Osfield
7c9cbc5ff9 From Pjotr Svetachov, "With the new osg::Geometry the binding for arrays now default to undefined. This breaks previously working code in osgAnimation::RigTransformHardware where the arrays got an undefined bounding and because of this the bone indices and weights were not loaded by the shader. Here is a little patch to fix this." 2013-10-10 20:42:21 +00:00
Robert Osfield
2a70ea9f64 Updated rc number 2013-10-07 10:40:10 +00:00
Robert Osfield
2f71509ebf From Stephan Huber, "attached you’ll find a bunch of fixes + enhancements for iOS and OS X based on current trunk. I incorporated + tested the submission from Colin Cochran, so his submission is not needed anymore.
* fixed a bug with multi-touch and touch-id-generation on iOS and OS X. (will fix a bug reported by Colin Cochran, without ditching the existing logic)
* removed unnecessary warning-flagss when generating xcode-projects via cmake, will enable the usage of OSG_AGGRESSIVE_WARNING_FLAGS
* added support for 10.9 (OS X)
* new cmake-variable: IPHONE_VERSION_MIN, this will set the deployment-target (previously hard-coded) If you set the IPHONE_VERSION_MIN to something like 7.0 osg gets compiled also for 64bit (amd64)
* cmake defaults now to the clang compiler if IPHONE_VERSION_MIN > 4.2
* cmake now sets some xcode-settings so the compiler uses the c++98-standard (clang defaults to c++11, w/o this I got a lot of linking errors)
* removed include-dir for avfoundation-plugin as not needed on OSX/IOS.
* enhanced the ios-example, will now show multitouch-information on a hud (similar to the  osgmultitouch-example), and more importantly, will compile + link out of the box
* small enhancements for the osc-device-plugin (send only one msg for MOVE/DRAG, even if multiple msgs/event is enabled)
* better memory-handling for the zeroconf-plugin
* fixed a possible bug in the rest-http-plugin when receiving mouse-events.
* incorporated a fix from Colin Cochran "forwarded touch events are not transformed into the GL UIView“
"
2013-10-07 10:38:58 +00:00
Robert Osfield
320c51aa96 Updated Controbutors to fix errors 2013-10-03 16:13:54 +00:00
Robert Osfield
8de7ad3fa3 Updated AUTHORS and ChangeLog for 3.2.1-rc1 2013-10-03 15:40:08 +00:00
Robert Osfield
316726445d Updated versions in prep for 3.2.1-rc1 2013-10-03 15:29:26 +00:00
Robert Osfield
eac772a841 Updated AUTHORS for for rc 2013-10-03 15:24:07 +00:00
Robert Osfield
f2428e961f From Dmitry Marakasov, "These are FreeBSD bits for src/osgPlugins/osc/osc/OscHostEndianness.h,
required to build newever OSG on this OS. Also corrects file name
in the error message - I was confused not to find OSCHostEndianness.h
after I've got this error.

Tested by successfully building OSG 3.2.0 with this patch on FreeBSD
9.1."
2013-10-02 11:29:56 +00:00
Robert Osfield
d636e89f9a From Björn Hein, "it seems that for generating "per vertex normals" as stated in the
comment, two of them are missing. This results in wrong display of
STL-files regarding normals. Following simple fix seems to work:

Index: ReaderWriterSTL.cpp
===================================================================
--- ReaderWriterSTL.cpp    (Revision 13797)
+++ ReaderWriterSTL.cpp    (Arbeitskopie)
@@ -108,6 +108,8 @@
                     ++itr)
                 {
                     perVertexNormals->push_back(*itr);
+                    perVertexNormals->push_back(*itr);
+                    perVertexNormals->push_back(*itr);
                 }

                 geom->setNormalArray(perVertexNormals.get(),
osg::Array::BIND_PER_VERTEX);
"
2013-10-02 11:09:22 +00:00
Robert Osfield
cb67c10b5f From Björn Blissing, "I propose making the following outputs a little bit more silent. In my mind it would suffice with OSG_DEBUG (compared to OSG_NOTICE) for these information messages." 2013-10-01 16:20:18 +00:00
Robert Osfield
7990effc06 From Christopher Baker, submitted by Alberto Luacas, "there is a bug report in the Ubuntu tracker that points to a bug when
loading multiple VRML files in parallel.  Christopher R. Baker has
detected this bug and crafted a patch.  In addition, libcoin has to be
also built with the "--enable-threadsafe" option.

I copy here his report, extracted from
(https://bugs.launchpad.net/ubuntu/+source/openscenegraph/+bug/1211993)
and attach his fix.  All credit is due to him:

«
There are three instances of a classical method-local-static
multithreaded initialization bug in the Inventor plugin for OSG that
trigger various memory faults when reading multiple VRML files in
parallel via osgDB::readNodeFile. These bugs are of the form:

static std::map<Stuff,OtherStuff> myHandyMap;
static bool once = true;
if(once) { ...fill myHandyMap; once = false }
... use myHandyMap;

To repeat: try loading multiple VRML files from multiple threads. The
liklihood of the bug depends on many factors, but my application, which
parallel-loads some dozens of small (<100K) VRML files on startup,
triggers this problem 25% of the time or more.

The attached patch (inventor-plugin-multithread.patch) rectifies this
problem by:

1 - Inheriting MyHandyMap from std::map, then
2 - Moving the map initialization into the derived constructor, which
3 - Is intrinsically protected from multithread issues by g++ (and is
part of the C++ standard), unless you pass -fno-threadsafe-statics,
which is strongly discouraged by the man page.
»
"
2013-10-01 09:37:54 +00:00
Robert Osfield
8d2c3db14c From Adrien Grandemange, "On Windows 7 and 8, mouse messages are generated in addition to touch messages, which leads to duplicate PUSH, DRAG and RELEASE events in OSG. Besides, the mouse and touch messages referring to the same user input are not necessarily sent at the same time, due to gesture translation done by Windows by default, such as double-tap => double-click and long-push => right-click.
The delay between the 2 types of messages is more noticeable on Windows 8 and leads to serious disruptions in our application.

Mouse messages generated by touch input are only present for legacy support. I think they should be filtered out by OSG (real click events originating from a physical mouse will of course still go through).

This is what this patch does, according to this suggestion: http://msdn.microsoft.com/en-us/library/dd693088%28v=VS.85%29.aspx (third issue in this page)."
2013-10-01 09:11:23 +00:00
Robert Osfield
04ea3aa6a2 From Thomas Hogarth, "Attached is a small build fix for PointSprite when compiling under GLES2 (r13788)
GL_POINT_SPRITE_OES does not exist in GLES2, instead you just draw using GL_POINTS then use gl_PointSize in a vertex shader to set the size."
2013-10-01 09:05:42 +00:00
Robert Osfield
d30a94bf4c 2013-09-30 18:32:44 +00:00
Robert Osfield
8ff77c10f9 From Farshid Lashkari, "I have a scene that makes heavy use of the StateSet::compare method and my profiler showed that a lot of time was being spent inside it. I made a small change to the method so that it performs a quick size comparison between the attribute/mode lists and bin mode before iterating through all the attributes. This made a noticeable improvement in my scene. I've attached the change." 2013-09-30 18:16:08 +00:00
Robert Osfield
76edd07195 Refactored the epsilon code to use the same one now used in svn/trunk. 2013-09-30 10:45:24 +00:00
Robert Osfield
0ab211cb7c Removed unnceccesary setNumChildrenRequiringUpdateTraversal from VolumeTile constructor. 2013-09-20 15:43:22 +00:00
Robert Osfield
0cd6a935e0 From Giuseppe Donvito, "I'm using OSG 320 and I need to flush a DDS 3D texture on disk.
I found a bug on DDS ReaderWriter that generates a false positive on a guard for the size check on writing operation. This is due to a wrong imageSize computation that uses img->getImageSizeInBytes() method instead of img->getTotalSizeInBytes(), that actually ignores the r() dimension, contrariwise taken into account by the function ComputeImageSizeInBytes() later.

The line 1062 on file ReaderWriterDDS.cpp should be fixed with:
[code]unsigned int imageSize = img->getTotalSizeInBytes();[/code]"
2013-09-10 15:18:34 +00:00
Robert Osfield
cab0f50371 From Giuseppe Donvito, Fixed typo of "CLEAR_GLOBAL_STATESET = 0x16," to indended "CLEAR_GLOBAL_STATESET = "0x10". 2013-09-10 13:29:28 +00:00
Robert Osfield
c62a57c006 From Colin Cochran, OES support for point sprites 2013-09-09 14:58:08 +00:00
Robert Osfield
fefe87ec13 osg uses osg::FBOExtensions to check if Frame Buffer Objects are
available.  But this just checks if the fbo functions can be called.
It doesn't check if the OpenGL renderer supports fbos.  For indirect
rendering on linux the client side capability may be different from
the display server, which can lead to mipmapped textures failing to
render.  I've added a fbo extension check.
2013-09-09 13:33:11 +00:00
Robert Osfield
8fd8036e33 From Ulrich Hertlein, "Patch for FindAVFoundation to work with OS X 10.9" 2013-09-09 12:44:32 +00:00
Robert Osfield
f653048d5f From Wang Rui, "Some developers report that the osgviewerMFC example is broken in 3.2, in which depth test is not enabled by default so all models loaded look awkward. I submit this patch to make it work again. I haven't gone deep to check why previous example goes wrong in newer version but I believe the problem was because the newly created camera object missed some important global statesets before set as the main camera." 2013-09-09 12:37:55 +00:00
Robert Osfield
caf56902c3 From Laurens Voerman, "two minor fixes, both in a CMakeList.txt file,
1> osgmultiplemovies example does not use SDL so needs no link to SDL

2> Added header files to "Plugins osg" project, so visual studio can find the source of
   OSG_WARN <<  "AsciiInputIterator::readProperty(): Unmatched property "
"
2013-09-09 12:33:20 +00:00
Robert Osfield
48498a1517 From Colin McDonald, "Attached are some fixes to build osg using the Solaris Studio compiler.
I've also checked the modified files still build ok with other
compilers (Linux gcc, Windows Visual Studio).

osgDB/OutputStream.cpp and osgPlugins/lws/SceneLoader.cpp require
stdlib.h for atoi use.

In osg/Uniform.cpp the compiler complains that base_class is unknown
unless I add a class name qualifier.

Not a build fix, but I spotted a typo in osgUtil/SceneView."
2013-09-05 10:23:24 +00:00
Robert Osfield
b86e644542 From Laurens Voerman, "like the "Bug in ProxyNode serializer" Farshid Lashkari found (svn submit 13754) the PagedLOD serializer attempts to read begin and and brackets.
Fix is identical (don't read brackets when num_chidren is zero) and applies both to trunk and 3.2 branch."
2013-09-05 10:08:06 +00:00
Robert Osfield
97091aa96c Fixed warnings 2013-09-05 10:05:05 +00:00
Robert Osfield
9574f4c087 From Alberto Luaces, "current versions of ffmpeg render «url_feof» macro as obsolete. The fix
is very simple and it is contained in the attached file."
2013-09-05 08:41:58 +00:00
Robert Osfield
a5002123a9 From Farshid Lashkari, "The ProxyNode serializer was not correctly reading the "Children" field. It conditionally writes the begin/end brackets, depending on whether it has children. However, during input it unconditionally attempts to read the begin/end brackets. I've modified the code to only read the brackets if it has children." 2013-09-02 10:57:50 +00:00
Robert Osfield
bddb6e8eaa Merged from svn/trunk, fixed double copy in StackedTransform constructor 2013-09-02 09:13:20 +00:00
Robert Osfield
41b1fcffe6 From Aurelien Albert, "I've go some problem with the method "State_Utils::replace" : if the original_phrase is empty, it leads to an infinite loop.
Here is a path to prevent this."
2013-08-05 12:00:59 +00:00
Robert Osfield
044f16b8b9 From Anish Thomas, added catch for to an empty DrawElementsUInt creation. 2013-08-01 11:25:07 +00:00
Robert Osfield
d581806619 From Ulrich Hertlein, "Based on the exchange on osg-users I went ahead and reworked shp/XBaseParser to avoid
weird behaviour (closing stdin) and leaking file descriptors, as well as some const-ness."
2013-08-01 10:28:15 +00:00
Robert Osfield
48364df671 From Sebastian Messerschmidt, "Seems like your re-factoring didn't really produces the correct results.
You can check with the tester2.flt provided earlier and check with the result image.
I double checked this with OpenFlight creator, and it seems the yaw is broken.

With my initial quaternion version is seems correct and if I change the


float cos_yaw = cosf(osg::inDegrees(yaw));
float sin_yaw = sinf(osg::inDegrees(yaw));

to be
float cos_yaw = cosf(osg::inDegrees(-yaw));
float sin_yaw = sinf(osg::inDegrees(-yaw));

it seems to work as well."
2013-08-01 10:04:07 +00:00
Robert Osfield
981ed52356 From Tom Jolley, "I found a couple more bugs after closely looking at the small piece of deprecated geometry in my model. There were problems with more than one primitive in a couple places. The first was the number of vertices were not being accumulated for DrawArraysPrimitiveType (caused another crash). The second is I had to move target_vindex and source_pindex before the PrimitiveSetList loop so they don't get reset on the next primitive (otherwise you end up with a lot of zeros in per vertex lists)." 2013-08-01 10:00:31 +00:00
Robert Osfield
9a90ddd2d9 From Aurelien Albert, "Here is the code to get access to OpenGL handle of an osg::FrameBufferObject" 2013-07-31 07:11:05 +00:00
Robert Osfield
123058965c From Tom Jolly, "I ran across this error reading one of our older files. An iterator was being changed inside a loop that caused a crash." 2013-07-31 06:56:28 +00:00
Robert Osfield
1364329fc8 From Sergey Kurdakov, merged from svn/trunk fix for GLES2 runtime invalid enumerant warning. 2013-07-31 06:43:46 +00:00
Robert Osfield
07550df2f2 From svn/trunk merged "Changed default cull mask to match the left cull mask so that mono rendering of presentations with left/right stereo images/movies works fine." 2013-07-30 06:39:36 +00:00
Robert Osfield
45f463ccd2 Removed trailing spaces 2013-07-30 06:39:01 +00:00
Robert Osfield
789d435abe Updated ChangeLog 2013-07-24 17:29:50 +00:00
Robert Osfield
6b8db67c91 Changed default of serialize draw to OFF 2013-07-24 17:27:14 +00:00
Robert Osfield
2975f9c20a Updated README for 3.2 release 2013-07-24 14:23:37 +00:00
Robert Osfield
ebc855cf50 Removed release candidate number in prep for 3.2.0 release 2013-07-24 14:11:55 +00:00
Robert Osfield
c9547497cc Fixed typo 2013-07-24 14:05:08 +00:00
Robert Osfield
75d32b3af6 Updated ChangeLog 2013-07-24 13:29:22 +00:00
Robert Osfield
a844a278ab Added GL2Extensions::isDrawBuffersSupported() and usage with FrameBufferObject.cpp to prevent invalid MRT usage causing crash under GLES2 2013-07-24 13:01:38 +00:00
Robert Osfield
94dcfb4ec2 Updated NEWS for 3.2 release 2013-07-24 12:50:34 +00:00
Robert Osfield
8528449dff Fixed warning 2013-07-24 12:49:11 +00:00
Robert Osfield
8d7fd88d5f Added getCallbacks() methods 2013-07-24 12:17:10 +00:00
Robert Osfield
28dd1cf8a8 Updated ChangeLog, AUTHORS file, Release Candidate Number and SO version number for 3.2-rc4 2013-07-23 18:34:01 +00:00
Robert Osfield
14de2266ba From Rocco Martino, build fix for compiling against ffmpeg/trunk 2013-07-23 18:11:31 +00:00
Robert Osfield
cc02695822 Disabled the check for Asio for Windows 2013-07-23 15:36:45 +00:00
Robert Osfield
2c442c9e9a Added NOT ANDROID to force use of posix API when building for Android under Windows 2013-07-23 15:28:34 +00:00
Robert Osfield
ca44b9cbce Added lazy setting of the UserDataContainer to avoid unncessarily create a UserDataContain when an empty description list is passed to Node::setDescriptions(..) 2013-07-23 10:24:27 +00:00
Robert Osfield
0483912e32 Fixed crash when open(..) returns an error. 2013-07-23 09:54:28 +00:00
Robert Osfield
21b5109089 Updated ChangeLog and AUTHORS file for rc3 2013-07-23 05:45:34 +00:00
Robert Osfield
549e20fbe7 Fixed svn source to that it's relase candidates and final release made from the OpenSceneGraph-3.2 branch 2013-07-23 05:41:40 +00:00
Robert Osfield
b4b7a13063 From Torben Dannhauer, "Please find attached further changes to make library auto detection
functional again for some libraries:

    Find3rdPa..: Fix to find libxml2
    FindCollada: Rearranged to handle different MSVC versions more effective.
    This file is already prepared for the upcoming VS 2013.
    FindNVTT: introduced management of debug libraries (also auto detected).
    "
2013-07-23 05:25:45 +00:00
Robert Osfield
8b58890975 Updatected rc number 2, ChangeLog and AUTHORS file for OSG-3.2-rc2 release 2013-07-22 13:40:53 +00:00
Robert Osfield
871521cfea From Andreas Ekstrand, "Attached is a small modification of the Collada writer that protects from crashes due to valArray being NULL in some situations." 2013-07-22 13:31:32 +00:00
Robert Osfield
f19018a03d Added FRAME_BUFFER_OBJECT enum 2013-07-22 10:07:21 +00:00
Robert Osfield
2709a5e946 From Christian Ruzicka, "with the current touch implementation on iOS the touches are not forwarded to parent views because the base implementation is not called. Also see the "Best Practices" in the iOS documentation for event handling:
http://developer.apple.com/library/ios/#documentation/EventHandling/Conceptual/EventHandlingiPhoneOS/multitouch_background/multitouch_background.html

"If you handle events in a subclass of any other UIKit responder class:
- You do not have to implement all of the event handling methods.
- In the methods you do implement, be sure to call the superclass implementation. For example, [super touchesBegan:touches withEvent:event]."

I added the missing lines and tested it with OSG 3.1.9 and iOS SDK 6.1."
2013-07-19 21:03:28 +00:00
Robert Osfield
52d5d80508 Added default setting of BIND_PER_VERTEX when applying Geometry::setTexCoordArray() 2013-07-19 20:59:14 +00:00
Robert Osfield
86e465d5d8 Updated OpenThreads version to be in sync with OSG version. 2013-07-19 17:00:08 +00:00
Robert Osfield
50ed5ebd1c Branch OpenSceneGraph-3.2 2013-07-19 14:08:08 +00:00
215 changed files with 24615 additions and 63449 deletions

View File

@@ -1,6 +1,6 @@
OpenSceneGraph Library 3.2.0
OpenSceneGraph Library 3.2.2
510 Contributors:
529 Contributors:
Firstname Surname
-----------------
@@ -9,14 +9,14 @@ Don Burns
Stephan Huber
Paul Martz
Mathias Fr<46>hlich
Marco Jez
Farshid Lashkari
Marco Jez
Wang Rui
Jean-S<>bastien Guay
Mike Weiblen
Ulrich Hertlein
Mike Weiblen
Sukender
Eric Wing
Sukender
Cedric Pinson
Brede Johansen
Bob Kuehne
@@ -25,43 +25,47 @@ Geoff Michel
Wojciech Lewandowski
Eric Sokolowsky
David Callu
Trajce Nikolov
Laurens Voerman
Colin McDonald
Trajce Nikolov
Tim Moore
Martin Lavery
Laurens Voerman
Tree
Tree
Luigi Calori
Mike Wittman
Jason Beverage
Chris Hanson
Roland Smeenk
Roger James
Jeremy Moles
Jason Beverage
Jan Peciva
J.P. Delport
Mattias Helsing
Jeremy Moles
Jan Peciva
Alberto Luaces
J.P. Delport
Magnus Kessler
David Fries
Andy Skinner
Paul Melis
Alberto Luaces
Luc Frauciel
Tom Jolley
Paul Melis
Luc Frauciel
Pavel Moloshtan
Brad Christiansen
Olaf Flebbe
Mathieu Marache
Jason Daly
Aurelien Albert
Art Tevs
Philip Lowman
Per Fahlberg
Norman Vine
Lionel Lagarde
Terry Welsh
Serge Lages
Lionel Lagarde
Romano Jos<6F> Magacho da Silva
Pjotr Svetachov
Chris Denham
Alberto Farre
Torben Dannhauer
Sherman Wilcox
Robert Michael
Mourad Boufarguine
@@ -73,10 +77,7 @@ Jan Ciger
Glenn Waldron
Gideon May
Don Tidrow
Aurelien Albert
Torben Dannhauer
Stephane Lamoliatte
Romano Jos<6F> Magacho da Silva
Michael Gronager
Martin Naylor
Joakim Simonsson
@@ -84,11 +85,13 @@ David Spilling
Daniel Sj<53>lie
Bryan Thrall
Fabien Lavignotte
Andreas Ekstrand
Riccardo Corsi
Mike Connell
Melchior Franz
Johannes Baeuerle
Andreas Ekstrand
Riccardo Corsi
Thomas Hogarth
Sebastian Messerschmidt
Rafa Gaitan
Neil Hughes
Martin Beckett
@@ -101,7 +104,6 @@ Cory Riddell
Chuck Seberino
Boris Bralo
Yefei He
Thomas Hogarth
Sondra Iverson
Simon Julier
Rune Schmidt Jensen
@@ -119,13 +121,16 @@ Thibault Genessay
Sasa Bistrovic
Ravi Mathur
Ralf Habacker
Pjotr Svetachov
Neil Groves
Mikhail Izmestev
Markus Trenkwalder
Loic Dachary
Joseph Steel
Jordi Torres
John Shue
Brad Colbert
Bj<EFBFBD>rn Blissing
Alexander Sinditskiy
Vivek Rajan
Uwe Woessner
Tony Horrobin
@@ -133,6 +138,7 @@ Thom DeCarlo
Tatsuhiro Nishioka
Tanguy Fautr<74>
Sean Spicer
Ryan Kawicki
Richard Schmidt
Peter Hrenka
Paul de Repentigny
@@ -141,25 +147,24 @@ Neil Salter
Mihai Radu
Michael Hartman
Martins Innus
Marc Helbling
Maciej Krol
Lilin Xiong
Leandro Motta Barros
Jordi Torres
Johan Nouvel
Hartwig Wiesmann
Donn Mielcarek
Corbin Holtz
Blasius Czink
Alexander Sinditskiy
Alexander Irion
Toshiyuki Takahei
Sebastien Grignard
Ryan Kawicki
Rudolf Wiedemann
Romano Magacho
Mikhail Izmestev
Robert Milharcic
Maria Ten
Liang Aibin
Kristofer Tingdahl
Konstantin Matveyev
Katharina Plugge
John Vidar Larring
John Kelso
@@ -177,14 +182,13 @@ Alok Priyadarshi
Alberto Barbati
Alan Dickinson
Vladimir Shabanov
Vladimir Chebaev
Tugkan Calapoglu
Tim Daoust
Sohey Yamamoto
Sergey Leontyev
Sebastian Messerschmidt
Santosh Gaikwad
Ryan Pavlik
Robert Milharcic
Rene Molenaar
Piotr Domagalski
Phil Atkin
@@ -194,6 +198,7 @@ Mattias Linde
Mark Sciabica
Marcin Prus
Lee Butler
Lars Nilsson
Konstantin Sinitsyn
Ken Sewell
Julian Ortiz
@@ -211,6 +216,7 @@ Doug McCorkle
Donald Cipperly
Don Leich
Dietmar Funck
Colin Cochran
Christian Buchner
Charles Cole
Blake Williams
@@ -224,9 +230,8 @@ Zach Deedler
Yuzhong Shen
Wee See
Warren Macchi
Vladimir Chebaev
Vincent Bourdier
Terrex
Terrex
Tassilo Glander
Sylvain Marie
Steve Lunsford
@@ -242,6 +247,7 @@ Perry Miller
Pawel Ksiezopolski
Paul Palumbo
Paul Obermeier
Patrick Neary
Nguyen Van Truong
Nathan Cournia
Morten Haukness
@@ -258,11 +264,11 @@ Martin Lambers
Martijn Kragtwijk
Marius Heise
Marcin Hajder
Marcel Pursche
Lilith Bryant
Lars Nilsson
Kristofer Tingdahl
Kevin Moiule
Keith Steffen
Julien Valentin
Julen Garcia
Joseph Winston
John Aughey
@@ -270,6 +276,8 @@ Johannes Scholz
Joachim Pouderoux
Jean-Christophe Lombardo
Javier Taibo
Jannik Heller
Jan Klimke
James Moliere
Jaap Glas
Igor Kravtchenko
@@ -279,6 +287,7 @@ Guy Volckaert
Gustavo Wagner
Guillaume Taze
Guillaume Chouvenc
Giuseppe Donvito
Gill Peacegood
Gerrick Bivins
George Tarantilis
@@ -287,14 +296,17 @@ Eric Buehler
Eduardo Poyart
Edgar Ellis
Dimi Christopoulos
Diane Delallée
Diane Delall<EFBFBD>e
David Longest
David Ergo
Daniel Trstenjak
Craig Bosma
Claus Scheiblauer
Christophe Loustaunau
Christian Ruzicka
Bradley Baker Searles
Brad Anderegg
Bj<EFBFBD>rn Hein
Aric Aumann
Andrew Sampson
Andrew Lorino
@@ -321,6 +333,7 @@ Tomas Hnilica
Todd Furlong
Tobias Ottenweller
Tino Schwarze
Tim George
Thorsten Brehm
Thomas Weidner
Tan Dunning
@@ -333,6 +346,7 @@ Simon Buckley
Sid Byce
Shuxing Xiao
Shane Arnott
Sergey Kurdakov
Sebastien Kuntz
Ruth Lang
Ruben Smelik
@@ -340,12 +354,14 @@ Ross Anderson
Ronny Krueger
Ronald van Maarseveen
Romain Charbit
Rocco Martino
Robert Swain
Rob Smith
Rob Radtke
Rob Bloemkool
Rick Pingry
Rick Appleton
Remo Eichenberger
Reinhard Sainitzer
Rein Kadijk
Ragnar Hammarqvist
@@ -375,18 +391,20 @@ Nicolas Brodu
Nick Black
Mojtaba Fathi
Mirko Viviani
Mikkel Gjøl
Mikkel Gj<EFBFBD>l
Mike Krus
Mike Garrity
Miha Ravsel
Miha Rav<EFBFBD>elj
Michael Schanne
Michael Polak
Michael Morrison
Michael Mc Donnell
Michael Logan
Michael Kapelko
Michael Bach Jensen
Max Rhiener
Max Behensky
Mauricio Hofmam
Matthias Helsing
Matthew May
Matthew Johnson-Roberson
Matt Green
@@ -401,7 +419,6 @@ Marius Kintel
Mario Guimaraes
Marco Sciabica
Marco Lehmann
Marcel Pursche
Maik Keller
Lukas Diduch
Louis Hamilton
@@ -409,10 +426,8 @@ Lewis Harmon
Leigh Stivers
Laurence Muller
Laura Cerritelli
Lars Nillson
Kyle Centers
Kristopher Bixler
Konstantin Matveyev
Kim Seokhwan
Kim Bale
Karsten Weiss
@@ -435,7 +450,6 @@ Jeroen den Dekker
Jay Zuckerman
Jason Howlett
Jason Ballenger
Jan Klimke
James Turner
James Killian
James Athey
@@ -470,6 +484,7 @@ Duvan Cope
Duncan Cavens
Drew Whitehouse
Douglas A. Pouk
Dmitry Marakasov
Dean Iverson
David Jung
Danny Valente
@@ -477,11 +492,13 @@ Daniel Stien
Dan Minor
C<EFBFBD>sar L. B. Silveira
Cyril Brulebois
Cl<EFBFBD>ment B<>sch
Clay Fowler
Claus Steuer
Chuck Sembroski
Christopher Blaesius
Christopher Baker
Christophe Herreman
Christian Ruzicka
Christian Noon
Christian Kaser
Christian Ehrlicher
@@ -492,8 +509,6 @@ Bruno Herbelin
Brian Keener
Brandon Hamm
Bora Utka
Bj<EFBFBD>rn Hein
Bjorn Blissing
Bill Prendergast
Bernardt Duvenhage
Benoit Laniel
@@ -501,7 +516,9 @@ Benjamin Wasty
Ben van Basten
Bart Gallet
Axel Volley
Arjun Ramamurthy
Anthousis Andreadis
Anish Thomas
Andy Preece
Andrew Reyonolds
Andreas Roth
@@ -513,4 +530,6 @@ Alberto Jaspe
Alan Purvis
Alan Ott
Alan Harris
Adrien Grandemange
Adrian Clark
Adam Richard

View File

@@ -22,25 +22,30 @@ if(COMMAND cmake_policy)
# tell CMake to prefer CMake's own CMake modules when available
# only available from cmake-2.8.4
if(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 8 AND ${CMAKE_PATCH_VERSION} GREATER 3)
if(${CMAKE_MAJOR_VERSION} GREATER 2 OR
(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 8) OR
(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 8 AND ${CMAKE_PATCH_VERSION} GREATER 3))
cmake_policy(SET CMP0017 NEW)
endif()
# cmake-2.6.1 introduces policy cmp0008 decide how to treat full path libraries that do not appear to be valid library file names
# quote from cvslog "Such libraries worked by accident in the VS IDE and Xcode generators in CMake 2.4 and below."
if(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4 AND ${CMAKE_PATCH_VERSION} GREATER 0)
if(${CMAKE_MAJOR_VERSION} GREATER 2 OR
(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 6) OR
(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 6 AND ${CMAKE_PATCH_VERSION} GREATER 0))
cmake_policy(SET CMP0008 OLD)
endif()
# disable autolinking to qtmain as we have our own main() functions (new in Qt 5.1)
if((${CMAKE_MAJOR_VERSION} EQUAL 2 OR ${CMAKE_MAJOR_VERSION} GREATER 2) AND
(${CMAKE_MINOR_VERSION} EQUAL 8 OR ${CMAKE_MINOR_VERSION} GREATER 8) AND
${CMAKE_PATCH_VERSION} GREATER 10)
if(${CMAKE_MAJOR_VERSION} GREATER 2 OR
(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 8) OR
(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 8 AND ${CMAKE_PATCH_VERSION} GREATER 10))
cmake_policy(SET CMP0020 OLD)
endif()
# nicer version check - but needs at least CMake 2.6.2? Worth upgrading the requirements?
#if("${CMAKE_VERSION}" VERSION_GREATER 2.8.10)
# or even easier (available in cmake-2.6)
#if(POLICY CMPxyzw)
endif()
@@ -48,12 +53,12 @@ PROJECT(OpenSceneGraph)
SET(OPENSCENEGRAPH_MAJOR_VERSION 3)
SET(OPENSCENEGRAPH_MINOR_VERSION 2)
SET(OPENSCENEGRAPH_PATCH_VERSION 0)
SET(OPENSCENEGRAPH_SOVERSION 99)
SET(OPENSCENEGRAPH_PATCH_VERSION 2)
SET(OPENSCENEGRAPH_SOVERSION 100)
# set to 0 when not a release candidate, non zero means that any generated
# svn tags will be treated as release candidates of given number
SET(OPENSCENEGRAPH_RELEASE_CANDIDATE 1)
SET(OPENSCENEGRAPH_RELEASE_CANDIDATE 0)
SET(OPENSCENEGRAPH_VERSION ${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION})
@@ -80,6 +85,13 @@ SET(OpenThreads_SOURCE_DIR ${OpenSceneGraph_SOURCE_DIR})
# Maybe this can be used override existing behavior if needed?
SET(CMAKE_MODULE_PATH "${OpenSceneGraph_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}")
# Change the default build type to Release
IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
ENDIF(NOT CMAKE_BUILD_TYPE)
## Option to enable Android build using AndroidNDK
OPTION(OSG_BUILD_PLATFORM_ANDROID OFF)
IF(OSG_BUILD_PLATFORM_ANDROID)
@@ -174,8 +186,8 @@ ENDIF()
OPTION(OSG_MAINTAINER "Enable OpenSceneGraph maintainer build methods, such as making svn branches, tags, updating ChangeLog." OFF)
IF (OSG_MAINTAINER)
SET(OPENSCENEGRAPH_SVN "trunk")
#SET(OPENSCENEGRAPH_SVN "branches")
#SET(OPENSCENEGRAPH_SVN "trunk")
SET(OPENSCENEGRAPH_SVN "branches")
SET(OPENSCENEGRAPH_BRANCH OpenSceneGraph-${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION})
#
@@ -234,8 +246,12 @@ IF(APPLE)
EXECUTE_PROCESS(COMMAND "/usr/bin/sw_vers" "-productVersion"
OUTPUT_VARIABLE OSG_OSX_SDK_NAME
OUTPUT_STRIP_TRAILING_WHITESPACE)
STRING(SUBSTRING "${OSG_OSX_SDK_NAME}" 0 4 OSG_OSX_SDK_NAME)
SET(OSG_OSX_SDK_NAME "macosx${OSG_OSX_SDK_NAME}")
STRING(REPLACE "." ";" MACOS_VERSION_LIST ${OSG_OSX_SDK_NAME})
LIST(GET MACOS_VERSION_LIST 0 MACOS_VERSION_MAJOR)
LIST(GET MACOS_VERSION_LIST 1 MACOS_VERSION_MINOR)
LIST(GET MACOS_VERSION_LIST 2 MACOS_VERSION_PATCH)
SET(OSG_OSX_SDK_NAME "macosx${MACOS_VERSION_MAJOR}.${MACOS_VERSION_MINOR}")
# Trying to get CMake to generate an XCode IPhone project, current efforts are to get iphoneos sdk 3.1 working
# Added option which needs manually setting to select the IPhone SDK for building. We can only have one of the below
@@ -247,13 +263,16 @@ IF(APPLE)
#you need to manually set the default sdk version here
SET (IPHONE_SDKVER "6.0" CACHE STRING "IOS SDK-Version")
SET (IPHONE_VERSION_MIN "4.2" CACHE STRING "IOS minimum os version, use 7.0 or greater to get 64bit support")
#the below is taken from ogre, it states the gcc stuff needs to happen before PROJECT() is called. I've no clue if we even need it
# Force gcc <= 4.2 on iPhone
include(CMakeForceCompiler)
CMAKE_FORCE_C_COMPILER(llvm-gcc-4.2 GNU)
CMAKE_FORCE_CXX_COMPILER(llvm-gcc-4.2 GNU)
SET(GCC_THUMB_SUPPORT NO)
IF(IPHONE_VERSION_MIN LESS "6.0")
include(CMakeForceCompiler)
CMAKE_FORCE_C_COMPILER(llvm-gcc-4.2 GNU)
CMAKE_FORCE_CXX_COMPILER(llvm-gcc-4.2 GNU)
SET(GCC_THUMB_SUPPORT NO)
ENDIF()
#set either the device sdk or the simulator sdk. Can't find away to separate these in the same project
IF(OSG_BUILD_PLATFORM_IPHONE)
@@ -508,11 +527,17 @@ IF(WIN32 AND NOT ANDROID)
INCLUDE(Find3rdPartyDependencies)
ENDIF()
#
# If you want to prevent CMake from picking up on any of the following optional 3rd Party dependencies in CMake 2.8 onwards
# 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)
ANDROID_3RD_PARTY()
ELSE()
# Common to all platforms except android:
FIND_PACKAGE(FreeType)
FIND_PACKAGE(Freetype)
FIND_PACKAGE(Inventor)
FIND_PACKAGE(Jasper)
FIND_PACKAGE(OpenEXR)
@@ -535,7 +560,9 @@ ELSE()
FIND_PACKAGE(GtkGl)
FIND_PACKAGE(DirectInput)
FIND_PACKAGE(NVTT)
FIND_PACKAGE(Asio)
IF (NOT WIN32)
FIND_PACKAGE(Asio)
ENDIF()
FIND_PACKAGE(ZeroConf)
ENDIF()
@@ -590,7 +617,14 @@ IF(OSG_USE_QT AND NOT ANDROID)
#If we have found Qt5, let's try to top off by getting the webkit as well
IF ( Qt5Widgets_FOUND )
FIND_PACKAGE(Qt5WebKitWidgets)
FIND_PACKAGE(Qt5WebKitWidgets QUIET)
IF(COMMAND cmake_policy)
IF(${CMAKE_MAJOR_VERSION} GREATER 2)
# Qt5 qt5_use_modules usage was causing "Policy CMP0043 is not set: Ignore COMPILE_DEFINITIONS_<Config> properties." warnings
cmake_policy(SET CMP0043 NEW)
ENDIF()
ENDIF()
ENDIF()
ENDIF()
@@ -790,11 +824,7 @@ IF(CMAKE_COMPILER_IS_GNUCXX)
# returns too many hits.
# FYI, if we do implement GNUCC, then -Wmissing-prototypes in another
# interesting C-specific flag.
# Also, there is a bug in gcc 4.0. Under C++, -pedantic will create
# errors instead of warnings for certain issues, including superfluous
# semicolons and commas, and the use of long long. -fpermissive seems
# to be the workaround.
SET(OSG_AGGRESSIVE_WARNING_FLAGS -Wall -Wparentheses -Wno-long-long -Wno-import -pedantic -Wreturn-type -Wmissing-braces -Wunknown-pragmas -Wunused -fpermissive)
SET(OSG_AGGRESSIVE_WARNING_FLAGS -Wall -Wparentheses -Wno-long-long -Wno-import -pedantic -Wreturn-type -Wmissing-braces -Wunknown-pragmas -Wunused)
# Previous included -Wformat=2 in OSG_AGGRESSIVE_WARNING_FLAGS but had to remove it due to standard library errors
@@ -811,6 +841,14 @@ ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
# CMake lacks an elseif, so other non-gcc, non-VS compilers need
# to be listed below. If unhandled, OSG_AGGRESSIVE_WARNING_FLAGS should
# remain unset.
IF (APPLE)
# set standard lib, clang defaults to c++0x
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++98")
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libstdc++")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98 -stdlib=libstdc++ -Wno-overloaded-virtual -Wno-conversion")
set(WARNING_CFLAGS "")
ENDIF()
ENDIF()
# This part is for the CMake menu option to toggle the warnings on/off.
@@ -870,8 +908,14 @@ IF(APPLE AND NOT ANDROID)
#set iphone arch and flags taken from http://sites.google.com/site/michaelsafyan/coding/resources/how-to-guides/cross-compile-for-the-iphone/how-to-cross-compile-for-the-iphone-using-cmake
IF(OSG_BUILD_PLATFORM_IPHONE)
SET(CMAKE_OSX_ARCHITECTURES "armv6;armv7" CACHE STRING "Build architectures for iOS" FORCE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -miphoneos-version-min=4.1 -mno-thumb -arch armv6 -pipe -no-cpp-precomp" CACHE STRING "Flags used by the compiler during all build types." FORCE)
IF(${IPHONE_VERSION_MIN} LESS "7.0")
SET(CMAKE_OSX_ARCHITECTURES "armv6;armv7" CACHE STRING "Build architectures for iOS" FORCE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -miphoneos-version-min=${IPHONE_VERSION_MIN} -mno-thumb -pipe -no-cpp-precomp" CACHE STRING "Flags used by the compiler during all build types." FORCE)
ELSE()
SET(CMAKE_OSX_ARCHITECTURES "armv7;armv7s;arm64" CACHE STRING "Build architectures for iOS" FORCE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -miphoneos-version-min=${IPHONE_VERSION_MIN} -pipe -no-cpp-precomp" CACHE STRING "Flags used by the compiler during all build types." FORCE)
ENDIF()
ELSE()
#simulator uses i386 architectures
SET(CMAKE_OSX_ARCHITECTURES "i386" CACHE STRING "Build architectures for iOS Simulator" FORCE)
@@ -903,7 +947,7 @@ IF(APPLE AND NOT ANDROID)
# FORCE is used because the options are not reflected in the UI otherwise.
# Seems like a good place to add version specific compiler flags too.
IF(NOT OSG_CONFIG_HAS_BEEN_RUN_BEFORE)
IF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.8")
IF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.8" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.9" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.10")
SET(OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX "imageio" CACHE STRING "Forced imageio default image plugin for OSX" FORCE)
# 64 Bit Works, i386,ppc is not supported any more
SET(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "Build architectures for OSX" FORCE)

View File

@@ -1,4 +1,4 @@
# Check for availability of atomic operations
# Check for availability of atomic operations
# This module defines
# OPENTHREADS_HAVE_ATOMIC_OPS
@@ -15,123 +15,143 @@ IF (OPENTHREADS_ATOMIC_USE_MUTEX)
SET(_OPENTHREADS_ATOMIC_USE_MUTEX 1)
ELSE()
# as the test does not work for IOS hardcode the ATOMIC implementation
IF(OSG_BUILD_PLATFORM_IPHONE_SIMULATOR OR OSG_BUILD_PLATFORM_IPHONE)
SET(_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS 0)
SET(_OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS 0)
SET(_OPENTHREADS_ATOMIC_USE_SUN 0)
SET(_OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED 0)
SET(_OPENTHREADS_ATOMIC_USE_MUTEX 0)
INCLUDE(CheckCXXSourceRuns)
SET(_OPENTHREADS_ATOMIC_USE_BSD_ATOMIC 1)
# Do step by step checking,
CHECK_CXX_SOURCE_RUNS("
#include <cstdlib>
ELSE()
INCLUDE(CheckCXXSourceRuns)
int main()
{
unsigned value = 0;
void* ptr = &value;
__sync_add_and_fetch(&value, 1);
__sync_synchronize();
__sync_sub_and_fetch(&value, 1);
if (!__sync_bool_compare_and_swap(&value, 0, 1))
return EXIT_FAILURE;
# Do step by step checking,
CHECK_CXX_SOURCE_RUNS("
#include <cstdlib>
if (!__sync_bool_compare_and_swap(&ptr, ptr, ptr))
return EXIT_FAILURE;
int main()
{
unsigned value = 0;
void* ptr = &value;
__sync_add_and_fetch(&value, 1);
__sync_synchronize();
__sync_sub_and_fetch(&value, 1);
if (!__sync_bool_compare_and_swap(&value, 0, 1))
return EXIT_FAILURE;
return EXIT_SUCCESS;
}
" _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS)
if (!__sync_bool_compare_and_swap(&ptr, ptr, ptr))
return EXIT_FAILURE;
CHECK_CXX_SOURCE_RUNS("
#include <stdlib.h>
return EXIT_SUCCESS;
}
" _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS)
int main(int, const char**)
{
unsigned value = 0;
void* ptr = &value;
__add_and_fetch(&value, 1);
__synchronize(value);
__sub_and_fetch(&value, 1);
if (!__compare_and_swap(&value, 0, 1))
return EXIT_FAILURE;
CHECK_CXX_SOURCE_RUNS("
#include <stdlib.h>
if (!__compare_and_swap((unsigned long*)&ptr, (unsigned long)ptr, (unsigned long)ptr))
return EXIT_FAILURE;
int main(int, const char**)
{
unsigned value = 0;
void* ptr = &value;
__add_and_fetch(&value, 1);
__synchronize(value);
__sub_and_fetch(&value, 1);
if (!__compare_and_swap(&value, 0, 1))
return EXIT_FAILURE;
return EXIT_SUCCESS;
}
" _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS)
if (!__compare_and_swap((unsigned long*)&ptr, (unsigned long)ptr, (unsigned long)ptr))
return EXIT_FAILURE;
CHECK_CXX_SOURCE_RUNS("
#include <atomic.h>
#include <cstdlib>
return EXIT_SUCCESS;
}
" _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS)
int main(int, const char**)
{
uint_t value = 0;
void* ptr = &value;
atomic_inc_uint_nv(&value);
membar_consumer();
atomic_dec_uint_nv(&value);
if (0 != atomic_cas_uint(&value, 0, 1))
return EXIT_FAILURE;
CHECK_CXX_SOURCE_RUNS("
#include <atomic.h>
#include <cstdlib>
if (ptr != atomic_cas_ptr(&ptr, ptr, ptr))
return EXIT_FAILURE;
int main(int, const char**)
{
uint_t value = 0;
void* ptr = &value;
atomic_inc_uint_nv(&value);
membar_consumer();
atomic_dec_uint_nv(&value);
if (0 != atomic_cas_uint(&value, 0, 1))
return EXIT_FAILURE;
return EXIT_SUCCESS;
}
" _OPENTHREADS_ATOMIC_USE_SUN)
if (ptr != atomic_cas_ptr(&ptr, ptr, ptr))
return EXIT_FAILURE;
CHECK_CXX_SOURCE_RUNS("
#include <windows.h>
#include <intrin.h>
#include <cstdlib>
return EXIT_SUCCESS;
}
" _OPENTHREADS_ATOMIC_USE_SUN)
#pragma intrinsic(_InterlockedAnd)
#pragma intrinsic(_InterlockedOr)
#pragma intrinsic(_InterlockedXor)
CHECK_CXX_SOURCE_RUNS("
#include <windows.h>
#include <intrin.h>
#include <cstdlib>
int main(int, const char**)
{
volatile long value = 0;
long data = 0;
long* volatile ptr = &data;
#pragma intrinsic(_InterlockedAnd)
#pragma intrinsic(_InterlockedOr)
#pragma intrinsic(_InterlockedXor)
InterlockedIncrement(&value);
MemoryBarrier();
InterlockedDecrement(&value);
int main(int, const char**)
{
volatile long value = 0;
long data = 0;
long* volatile ptr = &data;
if (0 != InterlockedCompareExchange(&value, 1, 0))
return EXIT_FAILURE;
InterlockedIncrement(&value);
MemoryBarrier();
InterlockedDecrement(&value);
if (ptr != InterlockedCompareExchangePointer((PVOID volatile*)&ptr, (PVOID)ptr, (PVOID)ptr))
return EXIT_FAILURE;
if (0 != InterlockedCompareExchange(&value, 1, 0))
return EXIT_FAILURE;
return EXIT_SUCCESS;
}
" _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED)
if (ptr != InterlockedCompareExchangePointer((PVOID volatile*)&ptr, (PVOID)ptr, (PVOID)ptr))
return EXIT_FAILURE;
CHECK_CXX_SOURCE_RUNS("
#include <libkern/OSAtomic.h>
return EXIT_SUCCESS;
}
" _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED)
int main()
{
volatile int32_t value = 0;
long data = 0;
long * volatile ptr = &data;
CHECK_CXX_SOURCE_RUNS("
#include <libkern/OSAtomic.h>
OSAtomicIncrement32(&value);
OSMemoryBarrier();
OSAtomicDecrement32(&value);
OSAtomicCompareAndSwapInt(value, 1, &value);
OSAtomicCompareAndSwapPtr(ptr, ptr, (void * volatile *)&ptr);
}
" _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC)
int main()
{
volatile int32_t value = 0;
long data = 0;
long * volatile ptr = &data;
OSAtomicIncrement32(&value);
OSMemoryBarrier();
OSAtomicDecrement32(&value);
OSAtomicCompareAndSwapInt(value, 1, &value);
OSAtomicCompareAndSwapPtr(ptr, ptr, (void * volatile *)&ptr);
}
" _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC)
IF(NOT _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS AND
NOT _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS AND
NOT _OPENTHREADS_ATOMIC_USE_SUN AND
NOT _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED AND
NOT _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC)
SET(_OPENTHREADS_ATOMIC_USE_MUTEX 1)
ENDIF()
# MinGW can set both WIN32_INTERLOCKED and GCC_BUILTINS to true which results in compliation errors
IF (_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS AND _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED)
# In this case we prefer the GCC_BUILTINS
SET(_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS 1)
SET(_OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED 0)
ENDIF()
IF(NOT _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS AND
NOT _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS AND
NOT _OPENTHREADS_ATOMIC_USE_SUN AND
NOT _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED AND
NOT _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC)
SET(_OPENTHREADS_ATOMIC_USE_MUTEX 1)
ENDIF()
ENDIF()

View File

@@ -54,7 +54,7 @@ ENDMACRO(FIND_DEPENDENCY DEPNAME INCLUDEFILE LIBRARY_NAMES_BASE SEARCHPATHLIST D
################################################################################################
# this Macro is tailored to Mike dependencies
# this Macro is tailored to Mike and Torbens dependencies
################################################################################################
MACRO(SEARCH_3RDPARTY OSG_3RDPARTY_BIN)
@@ -86,14 +86,14 @@ MACRO(SEARCH_3RDPARTY OSG_3RDPARTY_BIN)
MARK_AS_ADVANCED(PNG_PNG_INCLUDE_DIR)
ENDIF(PNG_FOUND)
ENDIF(ZLIB_FOUND)
FIND_DEPENDENCY(LIBXML2 libxml "libxml2" ${OSG_3RDPARTY_BIN} "D" "")
FIND_DEPENDENCY(LIBXML2 libxml2 "libxml2" ${OSG_3RDPARTY_BIN} "D" "")
IF(LIBXML2_FOUND)
# The CMAKE find libxml module uses LIBXML2_LIBRARIES -> fill it.... kind of a hack
SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARY} CACHE FILEPATH "" FORCE)
SET(LIBXML2_XMLLINT_EXECUTABLE ${OSG_3RDPARTY_BIN}/bin/xmllint.exe CACHE FILEPATH "Path to xmllint executable" FORCE)
ENDIF(LIBXML2_FOUND)
#FIND_DEPENDENCY(DEPNAME INCLUDEFILE LIBRARY_NAMES_BASE SEARCHPATHLIST DEBUGSUFFIX EXSUFFIX)
FIND_Package(NVTT)
FIND_Package(NVTT)
#luigi#INCLUDE(FindOSGDepends.cmake)
ENDMACRO(SEARCH_3RDPARTY OSG_3RDPARTY_BIN)

View File

@@ -1,22 +1,20 @@
# Locate Apple AVFoundation (next-generation QTKit)
# This module defines
# AV_FOUNDATION_LIBRARY
# AV_FOUNDATION_FOUND, if false, do not try to link to gdal
# AV_FOUNDATION_INCLUDE_DIR, where to find the headers
# AV_FOUNDATION_FOUND, if false, do not try to link to gdal
#
# $AV_FOUNDATION_DIR is an environment variable that would
# correspond to the ./configure --prefix=$AV_FOUNDATION_DIR
#
# Created by Stephan Maximilian Huber
# Created by Stephan Maximilian Huber
IF(APPLE)
FIND_PATH(AV_FOUNDATION_INCLUDE_DIR AVFoundation/AVFoundation.h)
FIND_LIBRARY(AV_FOUNDATION_LIBRARY AVFoundation)
ENDIF()
SET(AV_FOUNDATION_FOUND "NO")
IF(AV_FOUNDATION_LIBRARY AND AV_FOUNDATION_INCLUDE_DIR)
IF(AV_FOUNDATION_LIBRARY)
SET(AV_FOUNDATION_FOUND "YES")
ENDIF()
@@ -32,11 +30,11 @@ ELSE()
# AVFoundation exists since 10.7, but only 10.8 has all features necessary for OSG
# so check the SDK-setting
IF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.8")
IF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.8" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.9" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.10")
# nothing special here ;-)
ELSE()
MESSAGE("AVFoundation disabled for SDK < 10.8")
SET(AV_FOUNDATION_FOUND "NO")
SET(AV_FOUNDATION_FOUND "NO")
ENDIF()
ENDIF()
ENDIF()

0
CMakeModules/FindAsio.cmake Executable file → Normal file
View File

View File

@@ -28,6 +28,10 @@ IF(APPLE)
SET(COLLADA_BUILDNAME "mac")
ELSEIF(MINGW)
SET(COLLADA_BUILDNAME "mingw")
ELSEIF(MSVC12)
SET(COLLADA_BUILDNAME "vc12")
ELSEIF(MSVC11)
SET(COLLADA_BUILDNAME "vc11")
ELSEIF(MSVC10)
SET(COLLADA_BUILDNAME "vc10")
ELSEIF(MSVC90)
@@ -238,7 +242,7 @@ FIND_LIBRARY(COLLADA_STATIC_LIBRARY_DEBUG
)
FIND_LIBRARY(COLLADA_BOOST_FILESYSTEM_LIBRARY
NAMES libboost_filesystem boost_filesystem boost_filesystem-mt libboost_filesystem-vc90-mt libboost_filesystem-vc100-mt
NAMES libboost_filesystem boost_filesystem boost_filesystem-mt libboost_filesystem-${COLLADA_BUILDNAME}0-mt libboost_filesystem-${COLLADA_BUILDNAME}0-mt-1_54 libboost_filesystem-${COLLADA_BUILDNAME}0-mt-1_55
PATHS
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
@@ -246,7 +250,7 @@ FIND_LIBRARY(COLLADA_STATIC_LIBRARY_DEBUG
)
FIND_LIBRARY(COLLADA_BOOST_FILESYSTEM_LIBRARY_DEBUG
NAMES libboost_filesystem-d boost_filesystem-d boost_filesystem-mt-d libboost_filesystem-vc90-mt-gd libboost_filesystem-vc100-mt-gd
NAMES libboost_filesystem-d boost_filesystem-d boost_filesystem-mt-d libboost_filesystem-${COLLADA_BUILDNAME}0-mt-gd libboost_filesystem-${COLLADA_BUILDNAME}0-mt-gd-1_54 libboost_filesystem-${COLLADA_BUILDNAME}0-mt-gd-1_55
PATHS
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
@@ -254,7 +258,7 @@ FIND_LIBRARY(COLLADA_STATIC_LIBRARY_DEBUG
)
FIND_LIBRARY(COLLADA_BOOST_SYSTEM_LIBRARY
NAMES libboost_system boost_system boost_system-mt libboost_system-vc90-mt libboost_system-vc100-mt
NAMES libboost_system boost_system boost_system-mt libboost_system-${COLLADA_BUILDNAME}0-mt libboost_system-${COLLADA_BUILDNAME}0-mt-1_54 libboost_system-${COLLADA_BUILDNAME}0-mt-1_55
PATHS
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
@@ -262,7 +266,7 @@ FIND_LIBRARY(COLLADA_STATIC_LIBRARY_DEBUG
)
FIND_LIBRARY(COLLADA_BOOST_SYSTEM_LIBRARY_DEBUG
NAMES libboost_system-d boost_system-d boost_system-mt-d libboost_system-vc90-mt-gd libboost_system-vc100-mt-gd
NAMES libboost_system-d boost_system-d boost_system-mt-d libboost_system-${COLLADA_BUILDNAME}0-mt-gd libboost_system-${COLLADA_BUILDNAME}0-mt-gd-1_54 libboost_system-${COLLADA_BUILDNAME}0-mt-gd-1_55
PATHS
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw

View File

@@ -18,8 +18,10 @@ ELSEIF(MSVC90)
SET(FBX_LIBDIR "vs2008")
ELSEIF(MSVC10)
SET(FBX_LIBDIR "vs2010")
ELSEIF(MSVC11 OR MSVC_VERSION>1700)
ELSEIF(MSVC11)
SET(FBX_LIBDIR "vs2012")
ELSEIF(MSVC12 OR MSVC_VERSION>1800)
SET(FBX_LIBDIR "vs2013")
ENDIF()
IF(APPLE)
@@ -32,6 +34,8 @@ ELSE()
SET(FBX_LIBDIR ${FBX_LIBDIR}/x86)
ENDIF()
#try to use 2015.1 or 2014.2 version
IF(APPLE)
SET(FBX_LIBNAME "libfbxsdk")
ELSEIF(CMAKE_COMPILER_IS_GNUCXX)
@@ -44,10 +48,15 @@ SET(FBX_LIBNAME_DEBUG ${FBX_LIBNAME}d)
SET( FBX_SEARCH_PATHS
$ENV{FBX_DIR}
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2014.1"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2014.1"
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2015.1"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2015.1"
/Applications/Autodesk/FBXSDK20151
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2014.2"
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2014.2"
/Applications/Autodesk/FBXSDK20142
/Applications/Autodesk/FBXSDK20141
)
#I think the last line in the search path is an old typo, but let's search for 2014.1 anyway - LV
# search for headers & debug/release libraries
FIND_PATH(FBX_INCLUDE_DIR "fbxsdk.h"
@@ -74,21 +83,21 @@ ELSE()
ENDIF()
IF(NOT FBX_FOUND)
#try to use 2013.3 version
#try to use 2014.1 version
IF(APPLE)
SET(FBX_LIBNAME "fbxsdk-2013.3-static")
SET(FBX_LIBNAME "fbxsdk-2014.1")
ELSEIF(CMAKE_COMPILER_IS_GNUCXX)
SET(FBX_LIBNAME "fbxsdk-2013.3-static")
SET(FBX_LIBNAME "fbxsdk-2014.1")
ELSE()
SET(FBX_LIBNAME "fbxsdk-2013.3-md")
SET(FBX_LIBNAME "fbxsdk-2014.1")
ENDIF()
SET(FBX_LIBNAME_DEBUG ${FBX_LIBNAME}d)
SET( FBX_SEARCH_PATHS
$ENV{FBX_DIR}
$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2013.3
$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2013.3
$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2014.1
$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2014.1
/Applications/Autodesk/FBXSDK20141
)
@@ -110,3 +119,41 @@ IF(NOT FBX_FOUND)
ENDIF()
ENDIF()
IF(NOT FBX_FOUND)
#try to use 2013.3 version
IF(APPLE)
SET(FBX_LIBNAME "fbxsdk-2013.3-static")
ELSEIF(CMAKE_COMPILER_IS_GNUCXX)
SET(FBX_LIBNAME "fbxsdk-2013.3-static")
ELSE()
SET(FBX_LIBNAME "fbxsdk-2013.3-md")
ENDIF()
SET(FBX_LIBNAME_DEBUG ${FBX_LIBNAME}d)
SET( FBX_SEARCH_PATHS
$ENV{FBX_DIR}
$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2013.3
$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2013.3
/Applications/Autodesk/FBXSDK20133
)
# search for headers & debug/release libraries
FIND_PATH(FBX_INCLUDE_DIR "fbxsdk.h"
PATHS ${FBX_SEARCH_PATHS}
PATH_SUFFIXES "include")
FIND_LIBRARY( FBX_LIBRARY ${FBX_LIBNAME}
PATHS ${FBX_SEARCH_PATHS}
PATH_SUFFIXES "lib/${FBX_LIBDIR}")
FIND_LIBRARY( FBX_LIBRARY_DEBUG ${FBX_LIBNAME_DEBUG}
PATHS ${FBX_SEARCH_PATHS}
PATH_SUFFIXES "lib/${FBX_LIBDIR}")
IF(FBX_LIBRARY AND FBX_LIBRARY_DEBUG AND FBX_INCLUDE_DIR)
SET(FBX_FOUND "YES")
ELSE()
SET(FBX_FOUND "NO")
ENDIF()
ENDIF()

View File

@@ -48,7 +48,7 @@ FIND_PATH(FREETYPE_INCLUDE_DIR_ft2build ft2build.h
/opt/csw
/opt
/usr/freeware
PATH_SUFFIXES include
PATH_SUFFIXES include include/freetype2
)
FIND_PATH(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h
@@ -74,6 +74,20 @@ FIND_PATH(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h
/usr/freeware/include/freetype2
)
FIND_PATH(FREETYPE_INCLUDE_DIR_freetype2 config/ftheader.h
/usr/local/include/freetype2
/usr/include/freetype2
/usr/local/X11R6/include/freetype2
/usr/local/X11/include/freetype2
/usr/X11R6/include/freetype2
/usr/X11/include/freetype2
/sw/include/freetype2
/opt/local/include/freetype2
/opt/csw/include/freetype2
/opt/include/freetype2
/usr/freeware/include/freetype2
)
FIND_LIBRARY(FREETYPE_LIBRARY
NAMES freetype libfreetype freetype219
PATHS

View File

@@ -15,6 +15,7 @@ FIND_PATH(NVTT_INCLUDE_DIR nvtt/nvtt.h
PATH_SUFFIXES include
)
# NVTT
FIND_LIBRARY(NVTT_LIBRARY
NAMES nvtt
PATHS
@@ -25,6 +26,17 @@ FIND_LIBRARY(NVTT_LIBRARY
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
)
FIND_LIBRARY(NVTT_LIBRARY_DEBUG
NAMES nvtt_d
PATHS
/usr/local
/usr
$ENV{NVTT_DIR}
${3rdPartyRoot}
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
)
# NVIMAGE
FIND_LIBRARY(NVIMAGE_LIBRARY
NAMES nvimage
PATHS
@@ -35,6 +47,17 @@ FIND_LIBRARY(NVIMAGE_LIBRARY
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
)
FIND_LIBRARY(NVIMAGE_LIBRARY_DEBUG
NAMES nvimage_d
PATHS
/usr/local
/usr
$ENV{NVTT_DIR}
${3rdPartyRoot}
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
)
# NVMATH
FIND_LIBRARY(NVMATH_LIBRARY
NAMES nvmath
PATHS
@@ -45,6 +68,17 @@ FIND_LIBRARY(NVMATH_LIBRARY
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
)
FIND_LIBRARY(NVMATH_LIBRARY_DEBUG
NAMES nvmath_d
PATHS
/usr/local
/usr
$ENV{NVTT_DIR}
${3rdPartyRoot}
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
)
# NVCORE
FIND_LIBRARY(NVCORE_LIBRARY
NAMES nvcore
PATHS
@@ -54,6 +88,18 @@ FIND_LIBRARY(NVCORE_LIBRARY
${3rdPartyRoot}
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
)
FIND_LIBRARY(NVCORE_LIBRARY_DEBUG
NAMES nvcore_d
PATHS
/usr/local
/usr
$ENV{NVTT_DIR}
${3rdPartyRoot}
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
)
SET(NVTT_FOUND "NO")
IF(NVTT_LIBRARY AND NVTT_INCLUDE_DIR)

View File

@@ -1,13 +1,13 @@
# Locate gdal
# This module defines
# OSG_LIBRARY
# OSG_FOUND, if false, do not try to link to gdal
# OSG_FOUND, if false, do not try to link to gdal
# OSG_INCLUDE_DIR, where to find the headers
#
# $OSG_DIR is an environment variable that would
# correspond to the ./configure --prefix=$OSG_DIR
#
# Created by Robert Osfield.
# Created by Robert Osfield.
FIND_PATH(OSG_INCLUDE_DIR osg/Node
${OSG_DIR}/include
@@ -59,7 +59,7 @@ MACRO(FIND_OSG_LIBRARY MYLIBRARY MYLIBRARYNAME)
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
/usr/freeware/lib64
)
FIND_LIBRARY(${MYLIBRARY}
NAMES "${MYLIBRARYNAME}${CMAKE_RELEASE_POSTFIX}"
PATHS
@@ -107,7 +107,7 @@ MACRO(FIND_OSG_LIBRARY MYLIBRARY MYLIBRARYNAME)
ENDIF(NOT MYLIBRARY)
ENDIF( NOT ${MYLIBRARY}_DEBUG )
ENDMACRO(FIND_OSG_LIBRARY LIBRARY LIBRARYNAME)
FIND_OSG_LIBRARY(OSG_LIBRARY osg)
@@ -126,7 +126,7 @@ FIND_OSG_LIBRARY(OSGANIMATION_LIBRARY osgAnimation)
FIND_OSG_LIBRARY(OSGPARTICLE_LIBRARY osgParticle)
FIND_OSG_LIBRARY(OSGSHADOW_LIBRARY osgShadow)
FIND_OSG_LIBRARY(OSGPRESENTATION_LIBRARY osgPresentation)
FIND_OSG_LIBRARY(OSGSIM osgSim)
FIND_OSG_LIBRARY(OSGSIM_LIBRARY osgSim)
FIND_OSG_LIBRARY(OPENTHREADS_LIBRARY OpenThreads)

View File

@@ -63,8 +63,8 @@ ELSE()
ENDIF()
ENDIF()
# Disable quicktime for >= 10.7, as it's officially deprecated
IF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.7" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.8" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.9")
IF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.7" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.8" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.9" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.10")
MESSAGE("disabling quicktime because it's not supported by the selected SDK ${OSG_OSX_SDK_NAME}")
SET(QUICKTIME_FOUND "NO")
ENDIF()

View File

@@ -5,7 +5,9 @@ IF(PKG_CONFIG_FOUND)
INCLUDE(FindPkgConfig)
PKG_CHECK_MODULES(RSVG librsvg-2.0)
#Version 2.35 introduces the rsvg_cleanup function which is used
PKG_CHECK_MODULES(RSVG librsvg-2.0>=2.35)
PKG_CHECK_MODULES(CAIRO cairo)
IF (RSVG_FOUND AND NOT CAIRO_FOUND)

0
CMakeModules/FindZeroConf.cmake Executable file → Normal file
View File

View File

@@ -5,7 +5,7 @@
# NAME of the variables, so the macro gets as arguments the target name and the following list of parameters
# is intended as a list of variable names each one containing the path of the libraries to link to
# The existance of a variable name with _DEBUG appended is tested and, in case it' s value is used
# for linking to when in debug mode
# for linking to when in debug mode
# the content of this library for linking when in debugging
#######################################################################################################
@@ -87,12 +87,12 @@ MACRO(LINK_CORELIB_DEFAULT CORELIB_NAME)
SET(ALL_GL_LIBRARIES ${ALL_GL_LIBRARIES} ${OPENGL_egl_LIBRARY})
ENDIF()
LINK_EXTERNAL(${CORELIB_NAME} ${ALL_GL_LIBRARIES})
LINK_EXTERNAL(${CORELIB_NAME} ${ALL_GL_LIBRARIES})
LINK_WITH_VARIABLES(${CORELIB_NAME} OPENTHREADS_LIBRARY)
IF(OPENSCENEGRAPH_SONAMES)
SET_TARGET_PROPERTIES(${CORELIB_NAME} PROPERTIES VERSION ${OPENSCENEGRAPH_VERSION} SOVERSION ${OPENSCENEGRAPH_SOVERSION})
ENDIF(OPENSCENEGRAPH_SONAMES)
ENDMACRO(LINK_CORELIB_DEFAULT CORELIB_NAME)
@@ -112,11 +112,11 @@ MACRO(SETUP_LINK_LIBRARIES)
######################################################################
#
# This set up the libraries to link to, it assumes there are two variable: one common for a group of examples or plugins
# kept in the variable TARGET_COMMON_LIBRARIES and an example or plugin specific kept in TARGET_ADDED_LIBRARIES
# they are combined in a single list checked for unicity
# kept in the variable TARGET_COMMON_LIBRARIES and an example or plugin specific kept in TARGET_ADDED_LIBRARIES
# they are combined in a single list checked for unicity
# the suffix ${CMAKE_DEBUG_POSTFIX} is used for differentiating optimized and debug
#
# a second variable TARGET_EXTERNAL_LIBRARIES hold the list of libraries not differentiated between debug and optimized
# a second variable TARGET_EXTERNAL_LIBRARIES hold the list of libraries not differentiated between debug and optimized
##################################################################################
SET(TARGET_LIBRARIES ${TARGET_COMMON_LIBRARIES})
@@ -151,7 +151,7 @@ MACRO(SETUP_LINK_LIBRARIES)
ENDIF(TARGET_LIBRARIES_VARS)
IF(MSVC AND OSG_MSVC_VERSIONED_DLL)
#when using full path name to specify linkage, it seems that already linked libs must be specified
LINK_EXTERNAL(${TARGET_TARGETNAME} ${ALL_GL_LIBRARIES})
LINK_EXTERNAL(${TARGET_TARGETNAME} ${ALL_GL_LIBRARIES})
ENDIF(MSVC AND OSG_MSVC_VERSIONED_DLL)
ENDMACRO(SETUP_LINK_LIBRARIES)
@@ -213,7 +213,7 @@ ENDMACRO(SET_OUTPUT_DIR_PROPERTY_260 TARGET_TARGETNAME RELATIVE_OUTDIR)
MACRO(SETUP_LIBRARY LIB_NAME)
IF(ANDROID)
SETUP_ANDROID_LIBRARY(${LIB_NAME})
SETUP_ANDROID_LIBRARY(${LIB_NAME})
ELSE()
SET(TARGET_NAME ${LIB_NAME} )
SET(TARGET_TARGETNAME ${LIB_NAME} )
@@ -224,10 +224,13 @@ MACRO(SETUP_LIBRARY LIB_NAME)
${TARGET_SRC}
)
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES FOLDER "OSG Core")
IF(APPLE)
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES XCODE_ATTRIBUTE_WARNING_CFLAGS "")
ENDIF()
IF(TARGET_LABEL)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PROJECT_LABEL "${TARGET_LABEL}")
ENDIF(TARGET_LABEL)
IF(TARGET_LIBRARIES)
LINK_INTERNAL(${LIB_NAME} ${TARGET_LIBRARIES})
ENDIF()
@@ -238,14 +241,14 @@ MACRO(SETUP_LIBRARY LIB_NAME)
LINK_WITH_VARIABLES(${LIB_NAME} ${TARGET_LIBRARIES_VARS})
ENDIF(TARGET_LIBRARIES_VARS)
LINK_CORELIB_DEFAULT(${LIB_NAME})
ENDIF()
INCLUDE(ModuleInstall OPTIONAL)
ENDMACRO(SETUP_LIBRARY LIB_NAME)
MACRO(SETUP_PLUGIN PLUGIN_NAME)
IF(ANDROID)
SETUP_ANDROID_LIBRARY(${TARGET_DEFAULT_PREFIX}${PLUGIN_NAME})
SETUP_ANDROID_LIBRARY(${TARGET_DEFAULT_PREFIX}${PLUGIN_NAME})
ELSE()
SET(TARGET_NAME ${PLUGIN_NAME} )
@@ -268,38 +271,33 @@ MACRO(SETUP_PLUGIN PLUGIN_NAME)
SET(PACKAGE_COMPONENT libopenscenegraph)
ENDIF(${ARGC} GREATER 1)
# Add the VisualStudio versioning info
# Add the VisualStudio versioning info
SET(TARGET_SRC ${TARGET_SRC} ${OPENSCENEGRAPH_VERSIONINFO_RC})
# here we use the command to generate the library
# here we use the command to generate the library
IF (DYNAMIC_OPENSCENEGRAPH)
ADD_LIBRARY(${TARGET_TARGETNAME} MODULE ${TARGET_SRC} ${TARGET_H})
ELSE (DYNAMIC_OPENSCENEGRAPH)
ADD_LIBRARY(${TARGET_TARGETNAME} STATIC ${TARGET_SRC} ${TARGET_H})
ENDIF(DYNAMIC_OPENSCENEGRAPH)
#not sure if needed, but for plugins only Msvc need the d suffix
IF(NOT MSVC)
IF(NOT UNIX)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES DEBUG_POSTFIX "")
ENDIF(NOT UNIX)
ELSE(NOT MSVC)
IF(MSVC)
IF(NOT CMAKE24)
SET_OUTPUT_DIR_PROPERTY_260(${TARGET_TARGETNAME} "${OSG_PLUGINS}") # Sets the ouput to be /osgPlugin-X.X.X ; also ensures the /Debug /Release are removed
ELSE(NOT CMAKE24)
IF(OSG_MSVC_VERSIONED_DLL)
IF(OSG_MSVC_VERSIONED_DLL)
#this is a hack... the build place is set to lib/<debug or release> by LIBARARY_OUTPUT_PATH equal to OUTPUT_LIBDIR
#the .lib will be crated in ../ so going straight in lib by the IMPORT_PREFIX property
#because we want dll placed in OUTPUT_BINDIR ie the bin folder sibling of lib, we can use ../../bin to go there,
#it is hardcoded, we should compute OUTPUT_BINDIR position relative to OUTPUT_LIBDIR ... to be implemented
#changing bin to something else breaks this hack
#the dll are placed in bin/${OSG_PLUGINS}
#the dll are placed in bin/${OSG_PLUGINS}
IF(NOT MSVC_IDE)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "../bin/${OSG_PLUGINS}/")
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "../bin/${OSG_PLUGINS}/")
ELSE(NOT MSVC_IDE)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "../../bin/${OSG_PLUGINS}/" IMPORT_PREFIX "../")
ENDIF(NOT MSVC_IDE)
@@ -313,16 +311,18 @@ MACRO(SETUP_PLUGIN PLUGIN_NAME)
ENDIF(OSG_MSVC_VERSIONED_DLL)
ENDIF(NOT CMAKE24)
ENDIF(NOT MSVC)
ENDIF(MSVC)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PROJECT_LABEL "${TARGET_LABEL}")
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES FOLDER "Plugins")
IF(APPLE)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_WARNING_CFLAGS "")
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}
IF(WIN32)
INSTALL(TARGETS ${TARGET_TARGETNAME}
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})
@@ -350,11 +350,11 @@ MACRO(SETUP_EXE IS_COMMANDLINE_APP)
ENDIF(NOT TARGET_LABEL)
IF(${IS_COMMANDLINE_APP})
ADD_EXECUTABLE(${TARGET_TARGETNAME} ${TARGET_SRC} ${TARGET_H})
ELSE(${IS_COMMANDLINE_APP})
IF(APPLE)
# SET(MACOSX_BUNDLE_LONG_VERSION_STRING "${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION}")
# Short Version is the "marketing version". It is the version
@@ -363,6 +363,8 @@ MACRO(SETUP_EXE IS_COMMANDLINE_APP)
# Bundle version is the version the OS looks at.
SET(MACOSX_BUNDLE_BUNDLE_VERSION "${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION}")
SET(MACOSX_BUNDLE_GUI_IDENTIFIER "org.openscenegraph.${TARGET_TARGETNAME}" )
# replace underscore by hyphen
STRING(REGEX REPLACE "_" "-" MACOSX_BUNDLE_GUI_IDENTIFIER ${MACOSX_BUNDLE_GUI_IDENTIFIER})
SET(MACOSX_BUNDLE_BUNDLE_NAME "${TARGET_NAME}" )
# SET(MACOSX_BUNDLE_ICON_FILE "myicon.icns")
# SET(MACOSX_BUNDLE_COPYRIGHT "")
@@ -382,7 +384,7 @@ MACRO(SETUP_EXE IS_COMMANDLINE_APP)
ENDIF(APPLE)
ADD_EXECUTABLE(${TARGET_TARGETNAME} ${PLATFORM_SPECIFIC_CONTROL} ${TARGET_SRC} ${TARGET_H})
ENDIF(${IS_COMMANDLINE_APP})
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PROJECT_LABEL "${TARGET_LABEL}")
@@ -396,7 +398,11 @@ MACRO(SETUP_EXE IS_COMMANDLINE_APP)
SET_OUTPUT_DIR_PROPERTY_260(${TARGET_TARGETNAME} "") # Ensure the /Debug /Release are removed
ENDIF(MSVC_IDE AND OSG_MSVC_VERSIONED_DLL)
SETUP_LINK_LIBRARIES()
IF(APPLE)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_WARNING_CFLAGS "")
ENDIF()
SETUP_LINK_LIBRARIES()
ENDMACRO(SETUP_EXE)
@@ -410,11 +416,11 @@ MACRO(SETUP_APPLICATION APPLICATION_NAME)
ELSE(${ARGC} GREATER 1)
SET(IS_COMMANDLINE_APP 0)
ENDIF(${ARGC} GREATER 1)
SETUP_EXE(${IS_COMMANDLINE_APP})
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES FOLDER "Applications")
IF(APPLE)
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION bin BUNDLE DESTINATION bin)
ELSE(APPLE)
@@ -439,13 +445,13 @@ MACRO(SETUP_EXAMPLE EXAMPLE_NAME)
ELSE(${ARGC} GREATER 1)
SET(IS_COMMANDLINE_APP 0)
ENDIF(${ARGC} GREATER 1)
SETUP_EXE(${IS_COMMANDLINE_APP})
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES FOLDER "Examples")
IF(APPLE)
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION share/OpenSceneGraph/bin BUNDLE DESTINATION share/OpenSceneGraph/bin )
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION share/OpenSceneGraph/bin BUNDLE DESTINATION share/OpenSceneGraph/bin )
ELSE(APPLE)
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION share/OpenSceneGraph/bin COMPONENT openscenegraph-examples )
ENDIF(APPLE)
@@ -483,7 +489,7 @@ MACRO(HANDLE_MSVC_DLL)
ENDIF(${ARGC} GREATER 1)
SET_OUTPUT_DIR_PROPERTY_260(${LIB_NAME} "") # Ensure the /Debug /Release are removed
IF(NOT MSVC_IDE)
IF(NOT MSVC_IDE)
IF (NOT CMAKE24)
BUILDER_VERSION_GREATER(2 8 0)
IF(NOT VALID_BUILDER_VERSION)
@@ -516,8 +522,12 @@ MACRO(HANDLE_MSVC_DLL)
ELSE (NOT CMAKE24)
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../../bin/${LIB_PREFIX}${LIB_SOVERSION}-" IMPORT_PREFIX "../")
ENDIF (NOT CMAKE24)
ENDIF(NOT MSVC_IDE)
ENDIF(NOT MSVC_IDE)
# SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../../bin/osg${OPENSCENEGRAPH_SOVERSION}-")
# SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES IMPORT_PREFIX "../")
ENDMACRO(HANDLE_MSVC_DLL)
MACRO(REMOVE_CXX_FLAG flag)
STRING(REPLACE "${flag}" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
ENDMACRO()

82585
ChangeLog

File diff suppressed because it is too large Load Diff

892
NEWS.txt

File diff suppressed because it is too large Load Diff

View File

@@ -4,7 +4,7 @@ APP_PROJECT_PATH := $(call my-dir)
APP_OPTIM := ${ANDROID_RELEASE_OPTIM}
APP_PLATFORM := ${ANDROID_PLATFORM}
APP_PLATFORM := android-${ANDROID_PLATFORM}
APP_STL := ${ANDROID_STL}
APP_CPPFLAGS := -fexceptions -frtti
#APP_CPPFLAGS := -Os -mthumb-interwork -fno-short-enums

View File

@@ -1,18 +1,14 @@
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
For up-to-date information on the project, in-depth details on how to
compile and run libraries and examples, see the documentation on the
OpenSceneGraph website:
http://www.openscenegraph.org
For support subscribe to our public mailing list:
http://www.openscenegraph.org/index.php/documentation
http://www.openscenegraph.org/projects/osg/wiki/MailingLists
For support subscribe to our public mailing list or forum, details at:
or forum:
http://forum.openscenegraph.org/
http://www.openscenegraph.org/index.php/support
For the impatient, we've included quick build instructions below, these
are are broken down is three parts:
@@ -27,41 +23,41 @@ more indepth instructions.
Robert Osfield.
Project Lead.
26th April 2013.
4th July 2014.
--
Section 1. How to build the OpenSceneGraph
==========================================
The OpenSceneGraph uses the CMake build system to generate a
platform-specific build environment. CMake reads the CMakeLists.txt
files that you'll find throughout the OpenSceneGraph directories,
checks for installed dependenciesand then generates the appropriate
The OpenSceneGraph uses the CMake build system to generate a
platform-specific build environment. CMake reads the CMakeLists.txt
files that you'll find throughout the OpenSceneGraph directories,
checks for installed dependenciesand then generates the appropriate
build system.
If you don't already have CMake installed on your system you can grab
it from http://www.cmake.org, use version 2.4.6 or later. Details on the
If you don't already have CMake installed on your system you can grab
it from http://www.cmake.org, use version 2.4.6 or later. Details on the
OpenSceneGraph's CMake build can be found at:
http://www.openscenegraph.org/projects/osg/wiki/Build/CMake
Under unices (i.e. Linux, IRIX, Solaris, Free-BSD, HP-Ux, AIX, OSX)
use the cmake or ccmake command-line utils, or use the included tiny
configure script that'll run cmake for you. The configure script
simply runs 'cmake . -DCMAKE_BUILD_TYPE=Release' to ensure that you
Under unices (i.e. Linux, IRIX, Solaris, Free-BSD, HP-Ux, AIX, OSX)
use the cmake or ccmake command-line utils, or use the included tiny
configure script that'll run cmake for you. The configure script
simply runs 'cmake . -DCMAKE_BUILD_TYPE=Release' to ensure that you
get the best performance from your final libraries/applications.
cd OpenSceneGraph
./configure
make
sudo make install
Alternatively, you can create an out-of-source build directory and run
cmake or ccmake from there. The advantage to this approach is that the
temporary files created by CMake won't clutter the OpenSceneGraph
source directory, and also makes it possible to have multiple
independent build targets by creating multiple build directories. In a
Alternatively, you can create an out-of-source build directory and run
cmake or ccmake from there. The advantage to this approach is that the
temporary files created by CMake won't clutter the OpenSceneGraph
source directory, and also makes it possible to have multiple
independent build targets by creating multiple build directories. In a
directory alongside the OpenSceneGraph use:
mkdir build
@@ -70,22 +66,22 @@ directory alongside the OpenSceneGraph use:
make
sudo make install
Under Windows use the GUI tool CMakeSetup to build your VisualStudio
files. The following page on our wiki dedicated to the CMake build
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/projects/osg/wiki/Support/PlatformSpecifics/VisualStudio
http://www.openscenegraph.org/index.php/documentation/platform-specifics/windows
Under OSX you can either use the CMake build system above, or use the
Xcode projects that you will find in the OpenSceneGraph/Xcode
Under OSX you can either use the CMake build system above, or use the
Xcode projects that you will find in the OpenSceneGraph/Xcode
directory. See release notes on OSX CMake build below.
For further details on compilation, installation and platform-specific
For further details on compilation, installation and platform-specific
information read "Getting Started" guide:
http://www.openscenegraph.org/projects/osg/wiki/Support/GettingStarted
http://www.openscenegraph.org/index.php/documentation/10-getting-started
Section 2. Release notes on OSX build, by Eric Sokolowsky, August 5, 2008
=========================================================================
@@ -169,11 +165,11 @@ Section 3. Release notes on iOS build, by Thomas Hoghart
* Check that CMAKE_OSX_ARCHITECTURE is i386 for the simulator or armv6;armv7 for the device
* Disable DYNAMIC_OPENSCENEGRAPH, DYNAMIC_OPENTHREADS
This will give us the static build we need for iPhone.
* Disable OSG_GL1_AVAILABLE, OSG_GL2_AVAILABLE, OSG_GL3_AVAILABLE,
* Disable OSG_GL1_AVAILABLE, OSG_GL2_AVAILABLE, OSG_GL3_AVAILABLE,
OSG_GL_DISPLAYLISTS_AVAILABLE, OSG_GL_VERTEX_FUNCS_AVAILABLE
* Enable OSG_GLES1_AVAILABLE *OR* OSG_GLES2_AVAILABLE
* Ensure OSG_WINDOWING_SYSTEM is set to IOS
* Change FREETYPE include and library paths to an iPhone version
* Change FREETYPE include and library paths to an iPhone version
(OpenFrameworks has one bundled with its distribution)
* Ensure that CMake_OSX_SYSROOT points to your iOS SDK.
* Generate the Xcode project
@@ -206,9 +202,9 @@ $ cmake -G Xcode \
Known issues:
* When Linking final app against ive plugin, you need to add -lz to
* When Linking final app against ive plugin, you need to add -lz to
the 'Other linker flags' list.
* Apps and exes don't get created
* You can only select Simulator, or Device projects. In the XCode
project you will see both types but the sdk they link will
* You can only select Simulator, or Device projects. In the XCode
project you will see both types but the sdk they link will
be the same.

View File

@@ -557,6 +557,7 @@ int main( int argc, char **argv )
// if user request help write it out to cout.
if (arguments.read("-h") || arguments.read("--help"))
{
osg::setNotifyLevel(osg::NOTICE);
usage( arguments.getApplicationName().c_str(), 0 );
//arguments.getApplicationUsage()->write(std::cout);
return 1;

View File

@@ -254,7 +254,13 @@ const char* invalidNames[] =
"GraphicsContext*",
"Apple",
"GeometryNew",
"FrameBufferObject"
"FrameBufferObject",
"Lua",
"VolumeTile",
"PushStackValueVisitor",
"RayIntersector",
"OpenSceneGraph-Data",
"Node"
};
@@ -347,6 +353,7 @@ TypoCorrection typoCorrections[] =
{"Krulthof", "Kruithof"},
{"Lagrade", "Lagarde"},
{"Largade", "Lagarde"},
{"Largarde", "Lagarde"},
{"Larshkari", "Lashkari"},
{"Lashakari", "Lashkari"},
{"Lashari", "Lashkari"},
@@ -454,7 +461,27 @@ TypoCorrection typoCorrections[] =
{"Eskland","Ekstrand"},
{"Baeuerele","Baeuerle"},
{"Bauerle","Baeuerle"},
{"Baeurele","Baeuerle"}
{"Baeurele","Baeuerle"},
{"Nillson","Nilsson"},
{"Bjorn","Bj<EFBFBD>rn"},
{"Björn","Bj<EFBFBD>rn"},
{"Stepan","Stephan"},
{"Kristoger","Kristofer"},
{"Blessing","Blissing"},
{"Dannahuer","Dannhauer"},
{"Chebeav", "Chebaev"},
{"Messershmidt","Messerschmidt"},
{"Auelien","Aurelien"},
{"Aurélien","Aur<EFBFBD>lien"},
{"McDonnel","Mc Donnell"},
{"McDonnell","Mc Donnell"},
{"Delallée","Delall<EFBFBD>e"},
{"Gjøl","Gj<EFBFBD>l"},
{"Ravšelj","Rav<EFBFBD>elj"},
{"Ravsel", "Rav<EFBFBD>elj"},
{"Ravselj", "Rav<EFBFBD>elj"},
{"Janik", "Jannik"},
{"Viganò", "Vigan<EFBFBD>"}
};
@@ -562,6 +589,8 @@ NameCorrection nameCorrections[] =
"Melchior", "Franz"},
{"Glen", "Waldon",
"Glenn", "Waldron"},
{"Glen", "Waldron",
"Glenn", "Waldron"},
{"Ralf", "Karn",
"Ralf", "Kern"},
{"Donny", "Cipperly",
@@ -594,6 +623,8 @@ NameCorrection nameCorrections[] =
"Romano", "Jos<EFBFBD> Magacho da Silva"},
{"Rommano", "Silva",
"Romano", "Jos<EFBFBD> Magacho da Silva"},
{"Romano", "Magacho",
"Romano", "Jos<EFBFBD> Magacho da Silva"},
{"Leandro", "Motta",
"Leandro", "Motta Barros"},
{"Leandro", "Motto",
@@ -619,7 +650,19 @@ NameCorrection nameCorrections[] =
{"Tyge", "",
"Tyge", "L<EFBFBD>vset"},
{"Ricard", "Schmidt",
"Richard", "Schmidt"}
"Richard", "Schmidt"},
{"Matthias", "Helsing",
"Mattias", "Helsing"},
{"Clement", "Boesch",
"Cl<EFBFBD>ment", "B<EFBFBD>sch"},
{"Lauren", "Voerman",
"Laurens", "Voerman"},
{"Pjotr", "Sventachov",
"Pjotr", "Svetachov"},
{"Bradley", "Baker",
"Bradley", "Baker Searles"},
{"PawelKsiezopolski", "",
"Pawel", "Ksiezopolski"}
};
@@ -951,7 +994,9 @@ void printContributors(const std::string& changeLog, bool printNumEntries)
cout << "-------------------------" << endl;
for (SortedNameMap::reverse_iterator sitr = sortedNames.rbegin(); sitr != sortedNames.rend(); ++sitr)
{
cout << sitr->first << "\t" << sitr->second.first << " " << sitr->second.second << endl;
cout << sitr->first << "\t" << sitr->second.first;
if (!sitr->second.second.empty()) cout << " " << sitr->second.second;
cout << endl;
}
}
else
@@ -960,7 +1005,9 @@ void printContributors(const std::string& changeLog, bool printNumEntries)
cout << "-----------------" << endl;
for (SortedNameMap::reverse_iterator sitr = sortedNames.rbegin(); sitr != sortedNames.rend(); ++sitr)
{
cout << sitr->second.first << " " << sitr->second.second << endl;
cout << sitr->second.first;
if (!sitr->second.second.empty()) cout << " " << sitr->second.second;
cout << endl;
}
}
}

View File

@@ -31,6 +31,7 @@
#include <osgGA/Device>
#include <iostream>
#include <stdint.h>
#include <osg/GLExtensions>
@@ -90,7 +91,7 @@ public:
if (!_extensionInitialized) setUpExtensions();
if (_glClientWaitSync)
{
{
if (_previousSync)
{
unsigned int num_seconds = 1;
@@ -126,7 +127,7 @@ public:
typedef void (GL_APIENTRY * PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
bool _extensionInitialized;
PFNGLFENCESYNCPROC _glFenceSync;
PFNGLISSYNCPROC _glIsSync;
PFNGLDELETESYNCPROC _glDeleteSync;
@@ -187,7 +188,7 @@ int main(int argc, char** argv)
);
}
}
std::string device;
while(arguments.read("--device", device))
{

View File

@@ -1,12 +1,12 @@
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
*
* This software is open source and may be redistributed and/or modified under
* This software is open source and may be redistributed and/or modified under
* the terms of the GNU General Public License (GPL) version 2.0.
* The full license is in LICENSE.txt file included with this distribution,.
*
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* include LICENSE.txt for more details.
*/
@@ -39,9 +39,9 @@
#elif defined(__sgi)
#include <unistd.h>
#include <net/soioctl.h>
#elif defined(__CYGWIN__)
#elif defined(__CYGWIN__)
#include <unistd.h>
#elif defined(__sun)
#elif defined(__sun)
#include <unistd.h>
#include <sys/sockio.h>
#elif defined (__APPLE__)
@@ -249,7 +249,7 @@ void CameraPacket::writeEventQueue(osgViewer::Viewer& viewer)
//////////////////////////////////////////////////////////////////////////////
//
// Reciever
// Reciever
//
Receiver::Receiver( void )
{
@@ -338,7 +338,7 @@ void Receiver::sync( void )
#if defined(__linux) || defined(__FreeBSD__) || defined( __APPLE__ ) || \
defined(__DragonFly__)
socklen_t
socklen_t
#else
int
#endif
@@ -381,7 +381,7 @@ void Receiver::sync( void )
//////////////////////////////////////////////////////////////////////////////
//
// Broadcaster
// Broadcaster
//
Broadcaster::Broadcaster( void )
{

View File

@@ -1,12 +1,12 @@
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
*
* This software is open source and may be redistributed and/or modified under
* This software is open source and may be redistributed and/or modified under
* the terms of the GNU General Public License (GPL) version 2.0.
* The full license is in LICENSE.txt file included with this distribution,.
*
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* include LICENSE.txt for more details.
*/
@@ -29,7 +29,7 @@
//
// Class definition for the recipient of a broadcasted message
//
class Receiver
class Receiver
{
public :
@@ -68,7 +68,7 @@ class Receiver
//
// Class definition for broadcasting a buffer to a LAN
//
class Broadcaster
class Broadcaster
{
public :
@@ -84,7 +84,7 @@ class Broadcaster
// Set a recipient host. If this is used, the Broadcaster
// no longer broadcasts, but rather directs UDP packets at
// host.
void setHost( const char *hostname );
void setHost( const char *hostname );
// Sync broadcasts the buffer
void sync( void );
@@ -112,15 +112,15 @@ class Broadcaster
class CameraPacket {
public:
static const unsigned int MAX_NUM_EVENTS;
static const unsigned int SWAP_BYTES_COMPARE;
CameraPacket():_masterKilled(false)
CameraPacket():_masterKilled(false)
{
_byte_order = SWAP_BYTES_COMPARE;
}
void setPacket(const osg::Matrix& matrix,const osg::FrameStamp* frameStamp)
{
_matrix = matrix;
@@ -129,20 +129,20 @@ class CameraPacket {
_frameStamp = *frameStamp;
}
}
void getModelView(osg::Matrix& matrix,float angle_offset=0.0f)
{
matrix = _matrix * osg::Matrix::rotate(osg::DegreesToRadians(angle_offset),0.0f,1.0f,0.0f);
}
void readEventQueue(osgViewer::Viewer& viewer);
void writeEventQueue(osgViewer::Viewer& viewer);
void setMasterKilled(const bool flag) { _masterKilled = flag; }
const bool getMasterKilled() const { return _masterKilled; }
unsigned int _byte_order;
bool _masterKilled;
osg::Matrix _matrix;
@@ -150,11 +150,11 @@ class CameraPacket {
// note don't use a ref_ptr as used elsewhere for FrameStamp
// since we don't want to copy the pointer - but the memory.
// FrameStamp doesn't have a private destructor to allow
// us to do this, even though its a reference counted object.
// us to do this, even though its a reference counted object.
osg::FrameStamp _frameStamp;
osgGA::EventQueue::Events _events;
};
class DataConverter
@@ -186,22 +186,22 @@ class DataConverter
{
if (_currentPtr+1>=_endPtr) return;
*(_currentPtr++) = *(ptr);
*(_currentPtr++) = *(ptr);
}
inline void read1(char* ptr)
{
if (_currentPtr+1>=_endPtr) return;
*(ptr) = *(_currentPtr++);
*(ptr) = *(_currentPtr++);
}
inline void write2(char* ptr)
{
if (_currentPtr+2>=_endPtr) return;
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr);
}
inline void read2(char* ptr)
@@ -210,13 +210,13 @@ class DataConverter
if (_swapBytes)
{
*(ptr+1) = *(_currentPtr++);
*(ptr) = *(_currentPtr++);
*(ptr+1) = *(_currentPtr++);
*(ptr) = *(_currentPtr++);
}
else
{
*(ptr++) = *(_currentPtr++);
*(ptr) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr) = *(_currentPtr++);
}
}
@@ -224,10 +224,10 @@ class DataConverter
{
if (_currentPtr+4>=_endPtr) return;
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr);
}
inline void read4(char* ptr)
@@ -236,17 +236,17 @@ class DataConverter
if (_swapBytes)
{
*(ptr+3) = *(_currentPtr++);
*(ptr+2) = *(_currentPtr++);
*(ptr+1) = *(_currentPtr++);
*(ptr) = *(_currentPtr++);
*(ptr+3) = *(_currentPtr++);
*(ptr+2) = *(_currentPtr++);
*(ptr+1) = *(_currentPtr++);
*(ptr) = *(_currentPtr++);
}
else
{
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr) = *(_currentPtr++);
}
}
@@ -254,15 +254,15 @@ class DataConverter
{
if (_currentPtr+8>=_endPtr) return;
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr);
}
inline void read8(char* ptr)
@@ -272,27 +272,27 @@ class DataConverter
if (_swapBytes)
{
*(ptr+7) = *(_currentPtr++);
*(ptr+6) = *(_currentPtr++);
*(ptr+5) = *(_currentPtr++);
*(ptr+4) = *(_currentPtr++);
*(ptr+7) = *(_currentPtr++);
*(ptr+6) = *(_currentPtr++);
*(ptr+5) = *(_currentPtr++);
*(ptr+4) = *(_currentPtr++);
*(ptr+3) = *(_currentPtr++);
*(ptr+2) = *(_currentPtr++);
*(ptr+1) = *(_currentPtr++);
*(ptr) = *(_currentPtr++);
*(ptr+3) = *(_currentPtr++);
*(ptr+2) = *(_currentPtr++);
*(ptr+1) = *(_currentPtr++);
*(ptr) = *(_currentPtr++);
}
else
{
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr) = *(_currentPtr++);
}
}
@@ -305,14 +305,14 @@ class DataConverter
inline void writeFloat(float c) { write4((char*)&c); }
inline void writeDouble(double c) { write8((char*)&c); }
inline char readChar() { char c; read1(&c); return c; }
inline unsigned char readUChar() { unsigned char c; read1((char*)&c); return c; }
inline short readShort() { short c; read2((char*)&c); return c; }
inline unsigned short readUShort() { unsigned short c; read2((char*)&c); return c; }
inline int readInt() { int c; read4((char*)&c); return c; }
inline unsigned int readUInt() { unsigned int c; read4((char*)&c); return c; }
inline float readFloat() { float c; read4((char*)&c); return c; }
inline double readDouble() { double c; read8((char*)&c); return c; }
inline char readChar() { char c=0; read1(&c); return c; }
inline unsigned char readUChar() { unsigned char c=0; read1((char*)&c); return c; }
inline short readShort() { short c=0; read2((char*)&c); return c; }
inline unsigned short readUShort() { unsigned short c=0; read2((char*)&c); return c; }
inline int readInt() { int c=0; read4((char*)&c); return c; }
inline unsigned int readUInt() { unsigned int c=0; read4((char*)&c); return c; }
inline float readFloat() { float c=0.0f; read4((char*)&c); return c; }
inline double readDouble() { double c=0.0; read8((char*)&c); return c; }
void write(const osg::FrameStamp& fs);
void read(osg::FrameStamp& fs);
@@ -322,13 +322,13 @@ class DataConverter
void write(const osgGA::GUIEventAdapter& event);
void read(osgGA::GUIEventAdapter& event);
void write(CameraPacket& cameraPacket);
void read(CameraPacket& cameraPacket);
char* startPtr() { return _startPtr; }
unsigned int numBytes() { return _numBytes; }
protected:
char* _startPtr;
@@ -341,4 +341,4 @@ class DataConverter
#endif
#endif

View File

@@ -1,12 +1,12 @@
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
*
* This software is open source and may be redistributed and/or modified under
* This software is open source and may be redistributed and/or modified under
* the terms of the GNU General Public License (GPL) version 2.0.
* The full license is in LICENSE.txt file included with this distribution,.
*
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* include LICENSE.txt for more details.
*/
@@ -135,14 +135,14 @@ void setViewer(osgViewer::Viewer& viewer, float width, float height, float dista
class ForwardToDeviceEventHandler : public osgGA::GUIEventHandler {
public:
ForwardToDeviceEventHandler(osgGA::Device* device) : osgGA::GUIEventHandler(), _device(device) {}
virtual bool handle (const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa, osg::Object *, osg::NodeVisitor *)
{
OSG_INFO<<"ForwardToDeviceEventHandler::setEvent("<<ea.getKey()<<")"<<std::endl;
_device->sendEvent(ea);
return false;
}
private:
osg::ref_ptr<osgGA::Device> _device;
};
@@ -161,7 +161,7 @@ class FollowMouseCallback: public osgGA::GUIEventHandler
if (!transform) return false;
osg::NotifySeverity level = osg::INFO;
switch(ea.getEventType())
{
case(osgGA::GUIEventAdapter::PUSH):
@@ -284,7 +284,7 @@ enum P3DApplicationType
void processLoadedModel(osg::ref_ptr<osg::Node>& loadedModel, int optimizer_options, const std::string& cursorFileName)
{
if (!loadedModel) return;
#if !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GL3_AVAILABLE)
// add back in enabling of the GL_ALPHA_TEST to get around the core OSG no longer setting it by default for opaque bins.
@@ -312,7 +312,7 @@ void addDeviceTo(osgViewer::Viewer& viewer, const std::string& device_name)
{
OSG_INFO << "Adding Device : " << device_name << std::endl;
viewer.addDevice(dev.get());
if (dev->getCapabilities() & osgGA::Device::SEND_EVENTS)
viewer.getEventHandlers().push_front(new ForwardToDeviceEventHandler(dev.get()));
}
@@ -327,7 +327,7 @@ int main( int argc, char **argv )
{
// use an ArgumentParser object to manage the program arguments.
osg::ArgumentParser arguments(&argc,argv);
// set up the usage document, in case we need to print out how to use this program.
arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName());
arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is the application for presenting 3D interactive slide shows.");
@@ -386,10 +386,10 @@ int main( int argc, char **argv )
#ifdef USE_SDL
SDLIntegration sdlIntegration;
osg::notify(osg::INFO)<<"USE_SDL"<<std::endl;
#endif
#endif
bool doSetViewer = true;
std::string configurationFile;
@@ -402,7 +402,7 @@ int main( int argc, char **argv )
while (arguments.read("-c",configurationFile)) {}
osg::Vec4 clearColor(0.0f,0.0f,0.0f,0.0f);
while (arguments.read("--clear-color",clearColor[0],clearColor[1],clearColor[2],clearColor[3])) {}
std::string filename;
@@ -441,7 +441,7 @@ int main( int argc, char **argv )
// construct the viewer.
osgViewer::Viewer viewer(arguments);
// set clear colour to black by default.
viewer.getCamera()->setClearColor(clearColor);
@@ -467,12 +467,12 @@ int main( int argc, char **argv )
while (arguments.read("--device", device))
{
addDeviceTo(viewer, device);
}
if (arguments.read("--http-control"))
{
std::string server_address = "localhost";
std::string server_port = "8080";
std::string document_root = "htdocs";
@@ -489,11 +489,21 @@ int main( int argc, char **argv )
viewer.addDevice(rest_http_device.get());
}
}
// set up stereo masks
viewer.getCamera()->setCullMask(0xffffffff);
viewer.getCamera()->setCullMaskLeft(0x00000001);
viewer.getCamera()->setCullMaskRight(0x00000002);
viewer.getCamera()->setCullMaskRight(0x00000002);
bool assignLeftCullMaskForMono = true;
if (assignLeftCullMaskForMono)
{
viewer.getCamera()->setCullMask(viewer.getCamera()->getCullMaskLeft());
}
else
{
viewer.getCamera()->setCullMask(0xffffffff);
}
// set up the camera manipulators.
{
@@ -509,7 +519,7 @@ int main( int argc, char **argv )
while (arguments.read("-p",pathfile))
{
osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile);
if (apm || !apm->valid())
if (apm || !apm->valid())
{
unsigned int num = keyswitchManipulator->getNumMatrixManipulators();
keyswitchManipulator->addMatrixManipulator( keyForAnimationPath, "Path", apm );
@@ -547,12 +557,12 @@ int main( int argc, char **argv )
bool hideCursor = (showCursor=="No" || showCursor=="NO" || showCursor=="no");
while (arguments.read("--set-viewer")) { doSetViewer = true; }
while (arguments.read("--no-set-viewer")) { doSetViewer = false; }
// if we want to hide the cursor override the custom cursor.
if (hideCursor) cursorFileName.clear();
// cluster related entries.
int socketNumber=8100;
@@ -599,7 +609,7 @@ int main( int argc, char **argv )
viewer.getUpdateVisitor()->setTraversalMode(updateTraversalMode);
}
// register the slide event handler - which moves the presentation from slide to slide, layer to layer.
osg::ref_ptr<osgPresentation::SlideEventHandler> seh = new osgPresentation::SlideEventHandler(&viewer);
viewer.addEventHandler(seh.get());
@@ -620,7 +630,7 @@ int main( int argc, char **argv )
// set up optimizer options
unsigned int optimizer_options = osgUtil::Optimizer::DEFAULT_OPTIMIZATIONS;
bool relase_and_compile = false;
while (arguments.read("--release-and-compile"))
while (arguments.read("--release-and-compile"))
{
relase_and_compile = true;
}
@@ -631,7 +641,7 @@ int main( int argc, char **argv )
viewer.getDatabasePager()->setUnrefImageDataAfterApplyPolicy(true,false);
optimizer_options &= ~osgUtil::Optimizer::OPTIMIZE_TEXTURE_SETTINGS;
}
//
//
// osgDB::Registry::instance()->getOrCreateDatabasePager()->setUnrefImageDataAfterApplyPolicy(true,false);
// optimizer_options &= ~osgUtil::Optimizer::OPTIMIZE_TEXTURE_SETTINGS;
// osg::Texture::getTextureObjectManager()->setExpiryDelay(0.0f);
@@ -657,7 +667,7 @@ int main( int argc, char **argv )
float width = osg::DisplaySettings::instance()->getScreenWidth();
float height = osg::DisplaySettings::instance()->getScreenHeight();
float distance = osg::DisplaySettings::instance()->getScreenDistance();
while (arguments.read("-s", width, height, distance))
while (arguments.read("-s", width, height, distance))
{
osg::DisplaySettings::instance()->setScreenDistance(distance);
osg::DisplaySettings::instance()->setScreenHeight(height);
@@ -687,11 +697,11 @@ int main( int argc, char **argv )
else if (strcmp(str,"master")==0) P3DApplicationType = MASTER;
else if (strcmp(str,"slave")==0) P3DApplicationType = SLAVE;
}
while (arguments.read("--viewer")) { P3DApplicationType = VIEWER; }
while (arguments.read("--master")) { P3DApplicationType = MASTER; }
while (arguments.read("--slave")) { P3DApplicationType = SLAVE; }
while (arguments.read("--version"))
{
std::string appTypeName = "invalid";
@@ -780,7 +790,7 @@ int main( int argc, char **argv )
// if no model has been successfully loaded report failure.
if (!loadedModel)
if (!loadedModel)
{
osg::notify(osg::INFO) << arguments.getApplicationName() <<": No data loaded" << std::endl;
return 1;
@@ -796,12 +806,12 @@ int main( int argc, char **argv )
for(unsigned int i=0; i<loadedModel->getNumDescriptions(); ++i)
{
const std::string& desc = loadedModel->getDescription(i);
if (desc=="loop")
if (desc=="loop")
{
osg::notify(osg::NOTICE)<<"Enabling looping"<<std::endl;
seh->setLoopPresentation(true);
}
else if (desc=="auto")
else if (desc=="auto")
{
osg::notify(osg::NOTICE)<<"Enabling auto run"<<std::endl;
seh->setAutoSteppingActive(true);
@@ -830,7 +840,7 @@ int main( int argc, char **argv )
}
// pass the model to the slide event handler so it knows which to manipulate.
seh->set(loadedModel.get());
@@ -843,7 +853,7 @@ int main( int argc, char **argv )
osgDB::writeNodeFile(*loadedModel,outputFileName);
return 0;
}
if (!cursorFileName.empty() || hideCursor)
{
@@ -865,7 +875,7 @@ int main( int argc, char **argv )
osg::Timer_t startOfFrameTick = osg::Timer::instance()->tick();
double targetFrameTime = 1.0/targetFrameRate;
if (exportName.empty())
{
// objects for managing the broadcasting and recieving of camera packets.
@@ -894,7 +904,7 @@ int main( int argc, char **argv )
startOfFrameTick = osg::Timer::instance()->tick();
#if 0
#if 0
if (kmcb)
{
double time = kmcb->getTime();
@@ -910,9 +920,9 @@ int main( int argc, char **argv )
{
// take camera zero as the guide.
osg::Matrix modelview(viewer.getCamera()->getViewMatrix());
cp.setPacket(modelview,viewer.getFrameStamp());
// cp.readEventQueue(viewer);
scratchPad.reset();
@@ -922,7 +932,7 @@ int main( int argc, char **argv )
scratchPad.read(cp);
bc.setBuffer(scratchPad.startPtr(), scratchPad.numBytes());
std::cout << "bc.sync()"<<scratchPad.numBytes()<<std::endl;
bc.sync();
@@ -932,13 +942,13 @@ int main( int argc, char **argv )
rc.setBuffer(scratchPad.startPtr(), scratchPad.numBytes());
rc.sync();
scratchPad.reset();
scratchPad.read(cp);
// cp.writeEventQueue(viewer);
if (cp.getMasterKilled())
if (cp.getMasterKilled())
{
std::cout << "Received master killed."<<std::endl;
// break out of while (!done) loop since we've now want to shut down.
@@ -972,7 +982,7 @@ int main( int argc, char **argv )
seh->selectSlide(previous_ActiveSlide, previous_ActiveLayer);
continue;
}
// update the scene by traversing it with the the update visitor which will
@@ -996,7 +1006,7 @@ int main( int argc, char **argv )
{
ExportHTML::write(seh.get(), viewer, exportName);
}
return 0;
}

View File

@@ -48,13 +48,13 @@ const unsigned int MAX_NUM_EVENTS = 10;
const unsigned int SWAP_BYTES_COMPARE = 0x12345678;
class CameraPacket {
public:
CameraPacket():_masterKilled(false)
CameraPacket():_masterKilled(false)
{
_byte_order = SWAP_BYTES_COMPARE;
}
void setPacket(const osg::Matrix& matrix,const osg::FrameStamp* frameStamp)
{
_matrix = matrix;
@@ -63,20 +63,20 @@ class CameraPacket {
_frameStamp = *frameStamp;
}
}
void getModelView(osg::Matrix& matrix,float angle_offset=0.0f)
{
matrix = _matrix * osg::Matrix::rotate(osg::DegreesToRadians(angle_offset),0.0f,1.0f,0.0f);
}
void readEventQueue(osgViewer::Viewer& viewer);
void writeEventQueue(osgViewer::Viewer& viewer);
void setMasterKilled(const bool flag) { _masterKilled = flag; }
const bool getMasterKilled() const { return _masterKilled; }
unsigned int _byte_order;
bool _masterKilled;
osg::Matrix _matrix;
@@ -84,11 +84,11 @@ class CameraPacket {
// note don't use a ref_ptr as used elsewhere for FrameStamp
// since we don't want to copy the pointer - but the memory.
// FrameStamp doesn't have a private destructor to allow
// us to do this, even though its a reference counted object.
// us to do this, even though its a reference counted object.
osg::FrameStamp _frameStamp;
osgGA::EventQueue::Events _events;
};
class DataConverter
@@ -112,7 +112,7 @@ class DataConverter
bool _swapBytes;
char* _currentPtr;
void reset()
{
_currentPtr = _startPtr;
@@ -122,22 +122,22 @@ class DataConverter
{
if (_currentPtr+1>=_endPtr) return;
*(_currentPtr++) = *(ptr);
*(_currentPtr++) = *(ptr);
}
inline void read1(char* ptr)
{
if (_currentPtr+1>=_endPtr) return;
*(ptr) = *(_currentPtr++);
*(ptr) = *(_currentPtr++);
}
inline void write2(char* ptr)
{
if (_currentPtr+2>=_endPtr) return;
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr);
}
inline void read2(char* ptr)
@@ -146,13 +146,13 @@ class DataConverter
if (_swapBytes)
{
*(ptr+1) = *(_currentPtr++);
*(ptr) = *(_currentPtr++);
*(ptr+1) = *(_currentPtr++);
*(ptr) = *(_currentPtr++);
}
else
{
*(ptr++) = *(_currentPtr++);
*(ptr) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr) = *(_currentPtr++);
}
}
@@ -160,10 +160,10 @@ class DataConverter
{
if (_currentPtr+4>=_endPtr) return;
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr);
}
inline void read4(char* ptr)
@@ -172,17 +172,17 @@ class DataConverter
if (_swapBytes)
{
*(ptr+3) = *(_currentPtr++);
*(ptr+2) = *(_currentPtr++);
*(ptr+1) = *(_currentPtr++);
*(ptr) = *(_currentPtr++);
*(ptr+3) = *(_currentPtr++);
*(ptr+2) = *(_currentPtr++);
*(ptr+1) = *(_currentPtr++);
*(ptr) = *(_currentPtr++);
}
else
{
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr) = *(_currentPtr++);
}
}
@@ -190,15 +190,15 @@ class DataConverter
{
if (_currentPtr+8>=_endPtr) return;
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr++);
*(_currentPtr++) = *(ptr);
}
inline void read8(char* ptr)
@@ -208,27 +208,27 @@ class DataConverter
if (_swapBytes)
{
*(ptr+7) = *(_currentPtr++);
*(ptr+6) = *(_currentPtr++);
*(ptr+5) = *(_currentPtr++);
*(ptr+4) = *(_currentPtr++);
*(ptr+7) = *(_currentPtr++);
*(ptr+6) = *(_currentPtr++);
*(ptr+5) = *(_currentPtr++);
*(ptr+4) = *(_currentPtr++);
*(ptr+3) = *(_currentPtr++);
*(ptr+2) = *(_currentPtr++);
*(ptr+1) = *(_currentPtr++);
*(ptr) = *(_currentPtr++);
*(ptr+3) = *(_currentPtr++);
*(ptr+2) = *(_currentPtr++);
*(ptr+1) = *(_currentPtr++);
*(ptr) = *(_currentPtr++);
}
else
{
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr++) = *(_currentPtr++);
*(ptr) = *(_currentPtr++);
}
}
@@ -241,14 +241,14 @@ class DataConverter
inline void writeFloat(float c) { write4((char*)&c); }
inline void writeDouble(double c) { write8((char*)&c); }
inline char readChar() { char c; read1(&c); return c; }
inline unsigned char readUChar() { unsigned char c; read1((char*)&c); return c; }
inline short readShort() { short c; read2((char*)&c); return c; }
inline unsigned short readUShort() { unsigned short c; read2((char*)&c); return c; }
inline int readInt() { int c; read4((char*)&c); return c; }
inline unsigned int readUInt() { unsigned int c; read4((char*)&c); return c; }
inline float readFloat() { float c; read4((char*)&c); return c; }
inline double readDouble() { double c; read8((char*)&c); return c; }
inline char readChar() { char c=0; read1(&c); return c; }
inline unsigned char readUChar() { unsigned char c=0; read1((char*)&c); return c; }
inline short readShort() { short c=0; read2((char*)&c); return c; }
inline unsigned short readUShort() { unsigned short c=0; read2((char*)&c); return c; }
inline int readInt() { int c=0; read4((char*)&c); return c; }
inline unsigned int readUInt() { unsigned int c=0; read4((char*)&c); return c; }
inline float readFloat() { float c=0.0f; read4((char*)&c); return c; }
inline double readDouble() { double c=0.0; read8((char*)&c); return c; }
void write(const osg::FrameStamp& fs)
{
@@ -361,16 +361,16 @@ class DataConverter
event.setModKeyMask(readUInt());
event.setTime(readDouble());
}
void write(CameraPacket& cameraPacket)
{
writeUInt(cameraPacket._byte_order);
writeUInt(cameraPacket._masterKilled);
write(cameraPacket._matrix);
write(cameraPacket._frameStamp);
writeUInt(cameraPacket._events.size());
for(osgGA::EventQueue::Events::iterator itr = cameraPacket._events.begin();
itr != cameraPacket._events.end();
@@ -387,12 +387,12 @@ class DataConverter
{
_swapBytes = !_swapBytes;
}
cameraPacket._masterKilled = readUInt()!=0;
read(cameraPacket._matrix);
read(cameraPacket._frameStamp);
cameraPacket._events.clear();
unsigned int numEvents = readUInt();
for(unsigned int i=0;i<numEvents;++i)
@@ -409,7 +409,7 @@ void CameraPacket::readEventQueue(osgViewer::Viewer& viewer)
_events.clear();
osgViewer::ViewerBase::Contexts contexts;
viewer.getContexts(contexts);
viewer.getContexts(contexts);
for(osgViewer::ViewerBase::Contexts::iterator citr =contexts.begin(); citr != contexts.end(); ++citr)
{
@@ -423,7 +423,7 @@ void CameraPacket::readEventQueue(osgViewer::Viewer& viewer)
}
_events.insert(_events.end(), gw_events.begin(), gw_events.end());
}
viewer.getEventQueue()->copyEvents(_events);
osg::notify(osg::INFO)<<"written events = "<<_events.size()<<std::endl;
@@ -449,7 +449,7 @@ int main( int argc, char **argv )
{
// use an ArgumentParser object to manage the program arguments.
osg::ArgumentParser arguments(&argc,argv);
// set up the usage document, in case we need to print out how to use this program.
arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is the example which demonstrates how to approach implementation of clustering.");
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ...");
@@ -459,7 +459,7 @@ int main( int argc, char **argv )
arguments.getApplicationUsage()->addCommandLineOption("-n <int>","Socket number to transmit packets");
arguments.getApplicationUsage()->addCommandLineOption("-f <float>","Field of view of camera");
arguments.getApplicationUsage()->addCommandLineOption("-o <float>","Offset angle of camera");
// construct the viewer.
osgViewer::Viewer viewer;
@@ -468,12 +468,12 @@ int main( int argc, char **argv )
ViewerMode viewerMode = STAND_ALONE;
while (arguments.read("-m")) viewerMode = MASTER;
while (arguments.read("-s")) viewerMode = SLAVE;
int socketNumber=8100;
while (arguments.read("-n",socketNumber)) ;
float camera_fov=-1.0f;
while (arguments.read("-f",camera_fov))
while (arguments.read("-f",camera_fov))
{
}
@@ -497,7 +497,7 @@ int main( int argc, char **argv )
arguments.writeErrorMessages(std::cout);
return 1;
}
if (arguments.argc()<=1)
{
arguments.getApplicationUsage()->write(std::cout,osg::ApplicationUsage::COMMAND_LINE_OPTION);
@@ -514,13 +514,13 @@ int main( int argc, char **argv )
{
double fovy, aspectRatio, zNear, zFar;
viewer.getCamera()->getProjectionMatrixAsPerspective(fovy, aspectRatio,zNear, zFar);
double original_fov = atan(tan(osg::DegreesToRadians(fovy)*0.5)*aspectRatio)*2.0;
std::cout << "setting lens perspective : original "<<original_fov<<" "<<fovy<<std::endl;
fovy = atan(tan(osg::DegreesToRadians(camera_fov)*0.5)/aspectRatio)*2.0;
viewer.getCamera()->setProjectionMatrixAsPerspective(fovy, aspectRatio,zNear, zFar);
viewer.getCamera()->getProjectionMatrixAsPerspective(fovy, aspectRatio,zNear, zFar);
original_fov = atan(tan(osg::DegreesToRadians(fovy)*0.5)*aspectRatio)*2.0;
std::cout << "setting lens perspective : new "<<original_fov<<" "<<fovy<<std::endl;
@@ -549,13 +549,13 @@ int main( int argc, char **argv )
rc.setPort(static_cast<short int>(socketNumber));
bool masterKilled = false;
DataConverter scratchPad(1024);
while( !viewer.done() && !masterKilled )
{
osg::Timer_t startTick = osg::Timer::instance()->tick();
viewer.advance();
// special handling for working as a cluster.
@@ -563,12 +563,12 @@ int main( int argc, char **argv )
{
case(MASTER):
{
// take camera zero as the guide.
osg::Matrix modelview(viewer.getCamera()->getViewMatrix());
cp->setPacket(modelview,viewer.getFrameStamp());
cp->readEventQueue(viewer);
scratchPad.reset();
@@ -578,11 +578,11 @@ int main( int argc, char **argv )
scratchPad.read(*cp);
bc.setBuffer(scratchPad._startPtr, scratchPad._numBytes);
std::cout << "bc.sync()"<<scratchPad._numBytes<<std::endl;
bc.sync();
}
break;
case(SLAVE):
@@ -591,13 +591,13 @@ int main( int argc, char **argv )
rc.setBuffer(scratchPad._startPtr, scratchPad._numBytes);
rc.sync();
scratchPad.reset();
scratchPad.read(*cp);
cp->writeEventQueue(viewer);
if (cp->getMasterKilled())
if (cp->getMasterKilled())
{
std::cout << "Received master killed."<<std::endl;
// break out of while (!done) loop since we've now want to shut down.
@@ -609,9 +609,9 @@ int main( int argc, char **argv )
// no need to anything here, just a normal interactive viewer.
break;
}
osg::Timer_t endTick = osg::Timer::instance()->tick();
osg::notify(osg::INFO)<<"Time to do cluster sync "<<osg::Timer::instance()->delta_m(startTick,endTick)<<std::endl;
// update the scene by traversing it with the the update visitor which will
@@ -623,14 +623,14 @@ int main( int argc, char **argv )
{
osg::Matrix modelview;
cp->getModelView(modelview,camera_offset);
viewer.getCamera()->setViewMatrix(modelview);
}
// fire off the cull and draw traversals of the scene.
if(!masterKilled)
viewer.renderingTraversals();
}
// if we are master clean up by telling all slaves that we're going down.
@@ -638,7 +638,7 @@ int main( int argc, char **argv )
{
// need to broadcast my death.
cp->setPacket(osg::Matrix::identity(),viewer.getFrameStamp());
cp->setMasterKilled(true);
cp->setMasterKilled(true);
scratchPad.reset();
scratchPad.write(*cp);

View File

@@ -30,7 +30,7 @@
static const char* computeSrc = {
"#version 430\n"
"uniform float osg_FrameTime;\n"
"uniform image2D targetTex;\n"
"layout (r32f, binding =0) uniform image2D targetTex;\n"
"layout (local_size_x = 16, local_size_y = 16) in;\n"
"void main() {\n"
" ivec2 storePos = ivec2(gl_GlobalInvocationID.xy);\n"

View File

@@ -99,12 +99,14 @@ Node *makeTerrain( void )
for( i = 0; i < m * n; i++ )
{
v[i][0] = vertex[i][0] - dbcenter[0];
v[i][1] = vertex[i][1] - dbcenter[1];
v[i][2] = vertex[i][2];
float* vc = vertex[i];
v[i][0] = vc[0] - dbcenter[0];
v[i][1] = vc[1] - dbcenter[1];
v[i][2] = vc[2];
t[i][0] = texcoord[i][0] + 0.025;
t[i][1] = texcoord[i][1];
float* tc = texcoord[i];
t[i][0] = tc[0];
t[i][1] = tc[1];
}
Geometry *geom = new Geometry;

View File

@@ -1,14 +1,3 @@
# INCLUDE_DIRECTORIES( ${OPENAL_INCLUDE_DIR} )
# SET(TARGET_EXTERNAL_LIBRARIES ${OPENAL_LIBRARY} alut)
IF (SDL_FOUND)
SET(TARGET_EXTERNAL_LIBRARIES ${SDL_LIBRARY} )
INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR} )
ADD_DEFINITIONS(-DUSE_SDL)
IF (MINGW)
SET(TARGET_EXTERNAL_LIBRARIES ${TARGET_EXTERNAL_LIBRARIES} winmm dinput ddraw dxguid)
ENDIF()
ENDIF(SDL_FOUND)
SET(TARGET_SRC osgmultiplemovies.cpp )
SET(TARGET_ADDED_LIBRARIES osgGA )

View File

@@ -20,7 +20,7 @@
void configureShaders( osg::StateSet* stateSet )
{
const std::string vertexSource =
const std::string vertexSource =
"#version 140 \n"
" \n"
"uniform mat4 osg_ModelViewProjectionMatrix; \n"
@@ -41,7 +41,7 @@ void configureShaders( osg::StateSet* stateSet )
"} \n";
osg::Shader* vShader = new osg::Shader( osg::Shader::VERTEX, vertexSource );
const std::string fragmentSource =
const std::string fragmentSource =
"#version 140 \n"
" \n"
"in vec4 color; \n"
@@ -90,16 +90,16 @@ int main( int argc, char** argv )
return( 1 );
}
osgViewer::Viewer viewer;
// Create a Camera that uses the above OpenGL context.
osg::Camera* cam = new osg::Camera;
osg::Camera* cam = viewer.getCamera();
cam->setGraphicsContext( gc.get() );
// Must set perspective projection for fovy and aspect.
cam->setProjectionMatrix( osg::Matrix::perspective( 30., (double)width/(double)height, 1., 100. ) );
// Unlike OpenGL, OSG viewport does *not* default to window dimensions.
cam->setViewport( new osg::Viewport( 0, 0, width, height ) );
osgViewer::Viewer viewer;
viewer.setCamera( cam );
viewer.setSceneData( root );
// for non GL3/GL4 and non GLES2 platforms we need enable the osg_ uniforms that the shaders will use,
@@ -118,7 +118,7 @@ OSG currently support OpenGL 3.x on Windows. This comment block describes the
necessary configuration steps.
Get the draft gl3.h header file from OpenGL.org and put it in a folder called
<EFBFBD>GL3<EFBFBD> somewhere on your hard drive. OSG includes this header as <GL3/gl3.h>. Get
GL3 somewhere on your hard drive. OSG includes this header as <GL3/gl3.h>. Get
gl3.h from here:
http://www.opengl.org/registry/
@@ -128,7 +128,7 @@ several changes.
* Add the path to <GL3/gl3.h> to the CMake compiler flags, CMAKE_CXX_FLAGS and
CMAKE_CXX_FLAGS_DEBUG (for release and debug builds; others if you use other
build configurations). The text to add should look something like this:
/I <EFBFBD>C:\GLHeader<EFBFBD>
/I C:\GLHeader
The folder GLHeader should contain a subfolder GL3, which in turn contains
gl3.h.

View File

@@ -1,6 +1,13 @@
/* 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.
*
* Original code by Philip Rideout
* Adapted to OpenScenegraph by John Kaniarz
* Additional work by Michael Mc Donnell
*/
#include <osg/Program>
@@ -113,7 +120,8 @@ static const char* fragSource = {
"}\n"
};
osg::ref_ptr<osg::Geode> CreateIcosahedron(osg::Program *program){
osg::ref_ptr<osg::Geode> CreateIcosahedron(osg::Program *program)
{
osg::Geode *geode=new osg::Geode();
osg::Geometry *geometry = new osg::Geometry();
const unsigned int Faces[] = {
@@ -163,10 +171,16 @@ osg::ref_ptr<osg::Geode> CreateIcosahedron(osg::Program *program){
geometry->setVertexArray(vertices);
geometry->addPrimitiveSet(new osg::DrawElementsUInt(osg::PrimitiveSet::PATCHES,IndexCount,Faces));
// Expand the bounding box, otherwise the geometry is clipped in front when tessellating.
osg::BoundingBox bbox(osg::Vec3(-1.0f, -1.9f, -1.0f), osg::Vec3(1.0f, 1.0f, 1.0f));
geometry->setInitialBound(bbox);
geode->addDrawable(geometry);
return geode;
}
osg::ref_ptr<osg::Program> createProgram(){
osg::ref_ptr<osg::Program> createProgram()
{
osg::Program *program = new osg::Program();
program->addShader(new osg::Shader(osg::Shader::VERTEX,vertSource));
program->addShader(new osg::Shader(osg::Shader::TESSCONTROL,tessControlSource));
@@ -179,38 +193,74 @@ osg::ref_ptr<osg::Program> createProgram(){
return program;
}
float tessInner=1.0f;
float tessOuter=1.0f;
osg::ref_ptr<osg::Uniform> tessInnerU = new osg::Uniform("TessLevelInner",tessInner);
osg::ref_ptr<osg::Uniform> tessOuterU = new osg::Uniform("TessLevelOuter",tessOuter);
class KeyboardEventHandler : public osgGA::GUIEventHandler {
class KeyboardEventHandler : public osgGA::GUIEventHandler
{
public:
KeyboardEventHandler():osgGA::GUIEventHandler(){}
virtual bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& gaa){
KeyboardEventHandler(osg::ref_ptr<osg::Uniform> tessInnerU, osg::ref_ptr<osg::Uniform> tessOuterU):
_tessInnerU(tessInnerU),
_tessOuterU(tessOuterU)
{
tessInnerU->get(_tessInner);
tessOuterU->get(_tessOuter);
}
virtual bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& gaa)
{
if(ea.getEventType()==osgGA::GUIEventAdapter::KEYDOWN){
switch (ea.getKey()){
case osgGA::GUIEventAdapter::KEY_Up:
tessOuter++;
tessOuterU->set(tessOuter);
increaseOuterTesselation();
return true;
case osgGA::GUIEventAdapter::KEY_Down:
tessOuter--;
tessOuter=std::max(1.0f,tessOuter);
tessOuterU->set(tessOuter);
decreaseOuterTesselation();
return true;
case osgGA::GUIEventAdapter::KEY_Left:
tessInner--;
tessInner=std::max(1.0f,tessInner);
tessInnerU->set(tessInner);
decreaseInnerTesselation();
return true;
case osgGA::GUIEventAdapter::KEY_Right:
tessInner++;
tessInnerU->set(tessInner);
increaseInnerTesselation();
return true;
case osgGA::GUIEventAdapter::KEY_Plus:
case osgGA::GUIEventAdapter::KEY_KP_Add:
increaseInnerTesselation();
increaseOuterTesselation();
return true;
case osgGA::GUIEventAdapter::KEY_Minus:
case osgGA::GUIEventAdapter::KEY_KP_Subtract:
decreaseInnerTesselation();
decreaseOuterTesselation();
return true;
}
}
return osgGA::GUIEventHandler::handle(ea,gaa);
return osgGA::GUIEventHandler::handle(ea, gaa);
}
private:
osg::ref_ptr<osg::Uniform> _tessInnerU;
osg::ref_ptr<osg::Uniform> _tessOuterU;
float _tessInner;
float _tessOuter;
void increaseInnerTesselation()
{
_tessInnerU->set(++_tessInner);
}
void decreaseInnerTesselation()
{
_tessInner = std::max(1.0f, _tessInner-1.0f);
_tessInnerU->set(_tessInner);
}
void increaseOuterTesselation()
{
_tessOuterU->set(++_tessOuter);
}
void decreaseOuterTesselation()
{
_tessOuter = std::max(1.0f, _tessOuter-1.0f);
_tessOuterU->set(_tessOuter);
}
};
@@ -220,6 +270,9 @@ int main(int argc, char* argv[])
viewer.setUpViewInWindow(100,100,800,600);
osg::ref_ptr<osg::Program> program = createProgram();
osg::ref_ptr<osg::Geode> geode = CreateIcosahedron(program.get());
osg::ref_ptr<osg::Uniform> tessInnerU = new osg::Uniform("TessLevelInner", 1.0f);
osg::ref_ptr<osg::Uniform> tessOuterU = new osg::Uniform("TessLevelOuter", 1.0f);
osg::StateSet *state;
state = geode->getOrCreateStateSet();
state->addUniform(new osg::Uniform("AmbientMaterial",osg::Vec3(0.04f, 0.04f, 0.04f)));
@@ -229,7 +282,7 @@ int main(int argc, char* argv[])
state->addUniform(tessOuterU.get());
state->setAttribute(new osg::PatchParameter(3));
state->setAttribute(program.get());
// switch on the uniforms that track the modelview and projection matrices
osgViewer::Viewer::Windows windows;
viewer.getWindows(windows);
@@ -241,8 +294,8 @@ int main(int argc, char* argv[])
s->setUseModelViewAndProjectionUniforms(true);
s->setUseVertexAttributeAliasing(true);
}
viewer.addEventHandler(new KeyboardEventHandler());
viewer.addEventHandler(new KeyboardEventHandler(tessInnerU, tessOuterU));
viewer.setSceneData(geode.get());
return viewer.run();
}

View File

@@ -1,6 +1,6 @@
FILE(GLOB ui_files_1 "English.lproj/*.strings")
FILE(GLOB ui_files_2 "English.lproj/MainMenu.nib/*.nib")
SET(TARGET_SRC ViewerCocoa.mm main.m Info.plist ${ui_files_1} ${ui_files_2})
SET(TARGET_SRC ViewerCocoa.mm main.mm Info.plist ${ui_files_1} ${ui_files_2})
SET(TARGET_EXTERNAL_LIBRARIES osg ${COCOA_LIBRARY})
SET_SOURCE_FILES_PROPERTIES(Info.plist PROPERTIES MACOSX_PACKAGE_LOCATION .)

View File

@@ -17,7 +17,7 @@
*/
//
// main.m
// main.mm
// osgsimpleviewerCocoa
//
// Created by Eric Wing on 11/13/06.

View File

@@ -1,17 +1,19 @@
SET(TARGET_SRC
iphoneViewerAppDelegate.h
SET(TARGET_SRC
iphoneViewerAppDelegate.h
iphoneViewerAppDelegate.mm
main.m
osgPlugins.h
osgIPhoneViewer-Info.plist
)
SET(TARGET_ADDED_LIBRARIES osgdb_osg osgdb_freetype osgdb_imageio)
SET(TARGET_ADDED_LIBRARIES osgdb_osg osgdb_imageio osgdb_avfoundation)
#backup setting
SET(TMP_OSG_BUILD_APPLICATION_BUNDLES {$OSG_BUILD_APPLICATION_BUNDLES})
SET(OSG_BUILD_APPLICATION_BUNDLES TRUE)
SETUP_EXAMPLE(osgViewerIPhone)
SET_TARGET_PROPERTIES(example_osgViewerIPhone PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer")
#restore setting
SET(OSG_BUILD_APPLICATION_BUNDLES {$TMP_OSG_BUILD_APPLICATION_BUNDLES})
SET(CMAKE_EXE_LINKER_FLAGS "-framework QuartzCore -framework Foundation -framework OpenGLES -framework UIKit")
SET(CMAKE_EXE_LINKER_FLAGS "-framework QuartzCore -framework Foundation -framework OpenGLES -framework UIKit -framework ImageIO -framework CoreImage -framework MobileCoreServices -framework CoreGraphics")

View File

@@ -5,7 +5,6 @@
#include <osgDB/ReadFile>
#include <osg/MatrixTransform>
#include <osg/CameraNode>
#include <osgText/Text>
#include <osgViewer/Viewer>
@@ -17,7 +16,7 @@
UIWindow* _window; //main application window
UIAccelerationValue accel[3];
CADisplayLink* _displayLink;
osg::ref_ptr<osgViewer::Viewer> _viewer;
osg::ref_ptr<osg::MatrixTransform> _root;

View File

@@ -1,39 +1,243 @@
//Created by Thomas Hogarth 2009
// Created by Thomas Hogarth 2009
// cleaned up by Stephan Huber 2013
//
//
//This exampe shows how to render osg into an existing windw. Apple recommends apps only have one window on IPhone so this
// will be your best bet.
//
// this example will create a fullscreen window showing a grey box. You can interact with it via
// multi-touch gestures.
#import "iphoneViewerAppDelegate.h"
#include <osgGA/TrackballManipulator>
#include <osgGA/MultiTouchTrackballManipulator>
#include <osg/ShapeDrawable>
//inckude the iphone specific windowing stuff
//include the iphone specific windowing stuff
#include <osgViewer/api/IOS/GraphicsWindowIOS>
#define kAccelerometerFrequency 30.0 // Hz
#define kFilteringFactor 0.1
@implementation iphoneViewerAppDelegate
@synthesize _window;
osg::Camera* createHUD(unsigned int w, unsigned int h)
{
// create a camera to set up the projection and model view matrices, and the subgraph to draw in the HUD
osg::Camera* camera = new osg::Camera;
// set the projection matrix
camera->setProjectionMatrix(osg::Matrix::ortho2D(0,w,0,h));
// set the view matrix
camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
camera->setViewMatrix(osg::Matrix::identity());
// only clear the depth buffer
camera->setClearMask(GL_DEPTH_BUFFER_BIT);
// draw subgraph after main camera view.
camera->setRenderOrder(osg::Camera::POST_RENDER);
// we don't want the camera to grab event focus from the viewers main camera(s).
camera->setAllowEventFocus(false);
// add to this camera a subgraph to render
{
osg::Geode* geode = new osg::Geode();
std::string timesFont("fonts/arial.ttf");
// turn lighting off for the text and disable depth test to ensure it's always ontop.
osg::StateSet* stateset = geode->getOrCreateStateSet();
stateset->setMode(GL_LIGHTING,osg::StateAttribute::OFF);
osg::Vec3 position(50.0f,h-50,0.0f);
{
osgText::Text* text = new osgText::Text;
geode->addDrawable( text );
text->setFont(timesFont);
text->setPosition(position);
text->setText("A simple multi-touch-example\n1 touch = rotate, \n2 touches = drag + scale, \n3 touches = home");
}
camera->addChild(geode);
}
return camera;
}
class TestMultiTouchEventHandler : public osgGA::GUIEventHandler {
public:
TestMultiTouchEventHandler(osg::Group* parent_group)
: osgGA::GUIEventHandler(),
_cleanupOnNextFrame(false)
{
createTouchRepresentations(parent_group, 10);
}
private:
void createTouchRepresentations(osg::Group* parent_group, unsigned int num_objects)
{
// create some geometry which is shown for every touch-point
for(unsigned int i = 0; i != num_objects; ++i)
{
std::ostringstream ss;
osg::Geode* geode = new osg::Geode();
osg::ShapeDrawable* drawable = new osg::ShapeDrawable(new osg::Box(osg::Vec3(0,0,0), 100));
drawable->setColor(osg::Vec4(0.5, 0.5, 0.5,1));
geode->addDrawable(drawable);
ss << "Touch " << i;
osgText::Text* text = new osgText::Text;
geode->addDrawable( text );
drawable->setDataVariance(osg::Object::DYNAMIC);
_drawables.push_back(drawable);
text->setFont("fonts/arial.ttf");
text->setPosition(osg::Vec3(110,0,0));
text->setText(ss.str());
_texts.push_back(text);
text->setDataVariance(osg::Object::DYNAMIC);
osg::MatrixTransform* mat = new osg::MatrixTransform();
mat->addChild(geode);
mat->setNodeMask(0x0);
_mats.push_back(mat);
parent_group->addChild(mat);
}
parent_group->getOrCreateStateSet()->setMode(GL_LIGHTING, osg::StateAttribute::OFF);
}
virtual bool handle (const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa, osg::Object *, osg::NodeVisitor *)
{
switch(ea.getEventType())
{
case osgGA::GUIEventAdapter::FRAME:
if (_cleanupOnNextFrame) {
cleanup(0);
_cleanupOnNextFrame = false;
}
break;
case osgGA::GUIEventAdapter::PUSH:
case osgGA::GUIEventAdapter::DRAG:
case osgGA::GUIEventAdapter::RELEASE:
{
// is this a multi-touch event?
if (!ea.isMultiTouchEvent())
return false;
unsigned int j(0);
// iterate over all touch-points and update the geometry
unsigned num_touch_ended(0);
for(osgGA::GUIEventAdapter::TouchData::iterator i = ea.getTouchData()->begin(); i != ea.getTouchData()->end(); ++i, ++j)
{
const osgGA::GUIEventAdapter::TouchData::TouchPoint& tp = (*i);
_mats[j]->setMatrix(osg::Matrix::translate(tp.x, ea.getWindowHeight() - tp.y, 0));
_mats[j]->setNodeMask(0xffff);
std::ostringstream ss;
ss << "Touch " << tp.id;
_texts[j]->setText(ss.str());
switch (tp.phase)
{
case osgGA::GUIEventAdapter::TOUCH_BEGAN:
_drawables[j]->setColor(osg::Vec4(0,1,0,1));
std::cout << "touch began: " << ss.str() << std::endl;
break;
case osgGA::GUIEventAdapter::TOUCH_MOVED:
//std::cout << "touch moved: " << ss.str() << std::endl;
_drawables[j]->setColor(osg::Vec4(1,1,1,1));
break;
case osgGA::GUIEventAdapter::TOUCH_ENDED:
_drawables[j]->setColor(osg::Vec4(1,0,0,1));
std::cout << "touch ended: " << ss.str() << std::endl;
++num_touch_ended;
break;
case osgGA::GUIEventAdapter::TOUCH_STATIONERY:
_drawables[j]->setColor(osg::Vec4(0.8,0.8,0.8,1));
break;
default:
break;
}
}
// hide unused geometry
cleanup(j);
//check if all touches ended
if ((ea.getTouchData()->getNumTouchPoints() > 0) && (ea.getTouchData()->getNumTouchPoints() == num_touch_ended))
{
_cleanupOnNextFrame = true;
}
// reposition mouse-pointer
aa.requestWarpPointer((ea.getWindowX() + ea.getWindowWidth()) / 2.0, (ea.getWindowY() + ea.getWindowHeight()) / 2.0);
}
break;
default:
break;
}
return false;
}
void cleanup(unsigned int j)
{
for(unsigned k = j; k < _mats.size(); ++k) {
_mats[k]->setNodeMask(0x0);
}
}
std::vector<osg::ShapeDrawable*> _drawables;
std::vector<osg::MatrixTransform*> _mats;
std::vector<osgText::Text*> _texts;
bool _cleanupOnNextFrame;
};
//
//Called once app has finished launching, create the viewer then realize. Can't call viewer->run as will
//Called once app has finished launching, create the viewer then realize. Can't call viewer->run as will
//block the final inialization of the windowing system
//
- (void)applicationDidFinishLaunching:(UIApplication *)application {
std::string test_string;
test_string = "huhu";
//get the screen size
CGRect lFrame = [[UIScreen mainScreen] bounds];
unsigned int w = lFrame.size.width;
unsigned int h = lFrame.size.height;
//create the viewer
_viewer = new osgViewer::Viewer();
/*
// If you want full control over the graphics context / window creation, please uncomment this section
// create the main window at screen size
self._window = [[UIWindow alloc] initWithFrame: lFrame];
@@ -41,7 +245,7 @@
[_window makeKeyAndVisible];
//create our graphics context directly so we can pass our own window
//create our graphics context directly so we can pass our own window
osg::ref_ptr<osg::GraphicsContext::Traits> traits = new osg::GraphicsContext::Traits;
// Init the Windata Variable that holds the handle for the Window to display OSG in.
@@ -53,97 +257,65 @@
traits->width = w;
traits->height = h;
traits->depth = 16; //keep memory down, default is currently 24
//traits->alpha = 8;
//traits->stencil = 8;
traits->windowDecoration = false;
traits->doubleBuffer = true;
traits->sharedContext = 0;
traits->setInheritedWindowPixelFormat = true;
//traits->windowName = "osgViewer";
traits->samples = 4;
traits->sampleBuffers = 1;
traits->inheritedWindowData = windata;
// Create the Graphics Context
osg::ref_ptr<osg::GraphicsContext> graphicsContext = osg::GraphicsContext::createGraphicsContext(traits.get());
//create the viewer
_viewer = new osgViewer::Viewer();
//if the context was created then attach to our viewer
// if the context was created then attach to our viewer
if(graphicsContext)
{
_viewer->getCamera()->setGraphicsContext(graphicsContext);
_viewer->getCamera()->setViewport(new osg::Viewport(0, 0, traits->width, traits->height));
}
*/
//create scene and attch to viewer
//create root
_root = new osg::MatrixTransform();
//load and attach scene model
osg::ref_ptr<osg::Node> model = (osgDB::readNodeFile("hog.osg"));
_root->addChild(model);
if (model) {
_root->addChild(model);
}
else {
osg::Geode* geode = new osg::Geode();
osg::ShapeDrawable* drawable = new osg::ShapeDrawable(new osg::Box(osg::Vec3(1,1,1), 1));
geode->addDrawable(drawable);
_root->addChild(geode);
}
osg::Geode* geode = new osg::Geode();
osg::ShapeDrawable* drawable = new osg::ShapeDrawable(new osg::Box(osg::Vec3(1,1,1), 1));
geode->addDrawable(drawable);
_root->addChild(geode);
osg::Camera* hud_camera = createHUD(w,h);
_root->addChild(hud_camera);
//create and attach ortho camera for hud text
osg::ref_ptr<osg::CameraNode> _hudCamera = new osg::CameraNode;
// set the projection matrix
_hudCamera->setProjectionMatrix(osg::Matrix::ortho2D(0,w,0,h));
// set the view matrix
_hudCamera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
_hudCamera->setViewMatrix(osg::Matrix::identity());
// only clear the depth buffer
_hudCamera->setClearMask(GL_DEPTH_BUFFER_BIT);
// draw subgraph after main camera view.
_hudCamera->setRenderOrder(osg::CameraNode::POST_RENDER);
_root->addChild(_hudCamera.get());
//attcg text to hud
/*osg::ref_ptr<osgText::Text> text = new osgText::Text;
osg::ref_ptr<osg::Geode> textGeode = new osg::Geode();
osg::StateSet* stateset = textGeode->getOrCreateStateSet();
stateset->setMode(GL_LIGHTING,osg::StateAttribute::OFF);
textGeode->addDrawable( text );
_hudCamera->addChild(textGeode.get());
std::string timesFont("arial.ttf");
osg::Vec3 position = osg::Vec3(w/2.0f, h/2.0f, 0.0f);
osg::Vec3 delta(0.0f,-120.0f,0.0f);
text->setFont(timesFont);
text->setCharacterSize(20.0,1.0);
text->setColor(osg::Vec4(0.8,0.8,0.8,1.0));
text->setPosition(position);
text->setMaximumHeight(480);
text->setMaximumWidth(320);
text->setAlignment(osgText::Text::CENTER_CENTER );
text->setText("It's a Hogs life...");*/
_viewer->setSceneData(_root.get());
_viewer->setCameraManipulator(new osgGA::TrackballManipulator);
_viewer->setThreadingModel(osgViewer::Viewer::SingleThreaded);//SingleThreaded DrawThreadPerContext
_viewer->setCameraManipulator(new osgGA::MultiTouchTrackballManipulator());
//
//_viewer->realize();
_viewer->addEventHandler(new TestMultiTouchEventHandler(hud_camera));
osg::setNotifyLevel(osg::DEBUG_FP);
// sun single-threaded
_viewer->setThreadingModel(osgViewer::Viewer::SingleThreaded);
[NSTimer scheduledTimerWithTimeInterval:1.0/30.0 target:self selector:@selector(updateScene) userInfo:nil repeats:YES];
_viewer->realize();
// render a frame so the window-manager shows some content and not only an empty + black window
_viewer->frame();
// create a display link, which will update our scene on every screen-refresh
_displayLink = [application.keyWindow.screen displayLinkWithTarget:self selector:@selector(updateScene)];
[_displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
//Configure and start accelerometer
[[UIAccelerometer sharedAccelerometer] setUpdateInterval:(1.0 / kAccelerometerFrequency)];
[[UIAccelerometer sharedAccelerometer] setDelegate:self];
}
@@ -165,21 +337,15 @@
}
-(void)applicationWillTerminate:(UIApplication *)application{
-(void)applicationWillTerminate:(UIApplication *)application {
if (_displayLink)
[_displayLink invalidate];
_displayLink = NULL;
_root = NULL;
_viewer = NULL;
}
//
//Accelorometer
//
- (void)accelerometer:(UIAccelerometer*)accelerometer didAccelerate:(UIAcceleration*)acceleration
{
//Use a basic low-pass filter to only keep the gravity in the accelerometer values
accel[0] = acceleration.x * kFilteringFactor + accel[0] * (1.0 - kFilteringFactor);
accel[1] = acceleration.y * kFilteringFactor + accel[1] * (1.0 - kFilteringFactor);
accel[2] = acceleration.z * kFilteringFactor + accel[2] * (1.0 - kFilteringFactor);
}
- (void)dealloc {

View File

@@ -14,6 +14,6 @@ USE_GRAPICSWINDOW_IMPLEMENTATION(IOS)
USE_OSGPLUGIN(osg)
USE_OSGPLUGIN(imageio)
USE_OSGPLUGIN(freetype)
USE_OSGPLUGIN(avfoundation)
//USE_OSGPLUGIN(freetype)

View File

@@ -97,8 +97,8 @@ void cOSG::InitCameraConfig(void)
// Create the Graphics Context
osg::GraphicsContext* gc = osg::GraphicsContext::createGraphicsContext(traits.get());
// Init a new Camera (Master for this View)
osg::ref_ptr<osg::Camera> camera = new osg::Camera;
// Init Master Camera for this View
osg::ref_ptr<osg::Camera> camera = mViewer->getCamera();
// Assign Graphics Context to the Camera
camera->setGraphicsContext(gc);

View File

@@ -93,7 +93,13 @@ int main( int argc, char** argv )
{
osg::ArgumentParser arguments(&argc, argv);
#if QT_VERSION >= 0x050000
// Qt5 is currently crashing and reporting "Cannot make QOpenGLContext current in a different thread" when the viewer is run multi-threaded, this is regression from Qt4
osgViewer::ViewerBase::ThreadingModel threadingModel = osgViewer::ViewerBase::SingleThreaded;
#else
osgViewer::ViewerBase::ThreadingModel threadingModel = osgViewer::ViewerBase::CullDrawThreadPerContext;
#endif
while (arguments.read("--SingleThreaded")) threadingModel = osgViewer::ViewerBase::SingleThreaded;
while (arguments.read("--CullDrawThreadPerContext")) threadingModel = osgViewer::ViewerBase::CullDrawThreadPerContext;
while (arguments.read("--DrawThreadPerContext")) threadingModel = osgViewer::ViewerBase::DrawThreadPerContext;

View File

@@ -1115,7 +1115,8 @@ int main( int argc, char **argv )
if (image_3d.valid())
{
image_3d->setFileName(name_no_ext + ".dds");
osgDB::writeImageFile(*image_3d, image_3d->getFileName());
osg::ref_ptr<osgDB::Options> options = new osgDB::Options("ddsNoAutoFlipWrite");;
osgDB::writeImageFile(*image_3d, image_3d->getFileName(), options.get());
}
osgDB::writeNodeFile(*volume, outputFile);
}

View File

@@ -18,10 +18,10 @@
extern "C" {
#define OPENTHREADS_MAJOR_VERSION 2
#define OPENTHREADS_MINOR_VERSION 6
#define OPENTHREADS_PATCH_VERSION 0
#define OPENTHREADS_SOVERSION 12
#define OPENTHREADS_MAJOR_VERSION 3
#define OPENTHREADS_MINOR_VERSION 2
#define OPENTHREADS_PATCH_VERSION 1
#define OPENTHREADS_SOVERSION 20
/** OpenThreadsGetVersion() returns the library version number.
* Numbering convention : OpenThreads-1.0 will return 1.0 from OpenThreadsGetVersion. */

View File

@@ -51,6 +51,12 @@ class BoundingBoxImpl
-FLT_MAX)
{}
template<typename BT>
inline BoundingBoxImpl(const BoundingBoxImpl<BT>& bb) :
_min(bb._min),
_max(bb._max)
{}
/** Creates a bounding box initialized to the given extents. */
inline BoundingBoxImpl(value_type xmin, value_type ymin, value_type zmin,
value_type xmax, value_type ymax, value_type zmax) :
@@ -73,6 +79,9 @@ class BoundingBoxImpl
-FLT_MAX);
}
inline bool operator == (const BoundingBoxImpl& rhs) const { return _min==rhs._min && _max==rhs._max; }
inline bool operator != (const BoundingBoxImpl& rhs) const { return _min!=rhs._min || _max!=rhs._max; }
/** Returns true if the bounding box extents are valid, false otherwise. */
inline bool valid() const
{
@@ -189,7 +198,8 @@ class BoundingBoxImpl
/** Expands this bounding box to include the given sphere.
* If this box is uninitialized, set it to include sh. */
void expandBy(const BoundingSphereImpl<VT>& sh)
template<typename BST>
void expandBy(const BoundingSphereImpl<BST>& sh)
{
if (!sh.valid()) return;
@@ -227,6 +237,15 @@ class BoundingBoxImpl
(v.y()>=_min.y() && v.y()<=_max.y()) &&
(v.z()>=_min.z() && v.z()<=_max.z());
}
/** Returns true if this bounding box contains the specified coordinate allowing for specific epsilon. */
inline bool contains(const vec_type& v, value_type epsilon) const
{
return valid() &&
((v.x()+epsilon)>=_min.x() && (v.x()-epsilon)<=_max.x()) &&
((v.y()+epsilon)>=_min.y() && (v.y()-epsilon)<=_max.y()) &&
((v.z()+epsilon)>=_min.z() && (v.z()-epsilon)<=_max.z());
}
};
typedef BoundingBoxImpl<Vec3f> BoundingBoxf;

View File

@@ -63,6 +63,9 @@ class BoundingSphereImpl
* otherwise. */
inline bool valid() const { return _radius>=0.0; }
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; }
/** Set the bounding sphere to the given center/radius using floats. */
inline void set(const vec_type& center,value_type radius)
{
@@ -110,11 +113,13 @@ class BoundingSphereImpl
/** Expands the sphere to encompass the given box. Repositions the
* sphere center to minimize the radius increase. */
void expandBy(const BoundingBoxImpl<VT>& bb);
template<typename BBT>
void expandBy(const BoundingBoxImpl<BBT>& bb);
/** Expands the sphere to encompass the given box. Does not
* repositions the sphere center. */
void expandRadiusBy(const BoundingBoxImpl<VT>& bb);
template<typename BBT>
void expandRadiusBy(const BoundingBoxImpl<BBT>& bb);
/** Returns true if v is within the sphere. */
inline bool contains(const vec_type& v) const
@@ -135,12 +140,12 @@ class BoundingSphereImpl
template<typename VT>
template<typename vector_type>
template<typename vector_type>
void BoundingSphereImpl<VT>::expandBy(const vector_type& v)
{
if (valid())
{
vec_type dv = v-_center;
vec_type dv = vec_type(v)-_center;
value_type r = dv.length();
if (r>_radius)
{
@@ -157,12 +162,12 @@ void BoundingSphereImpl<VT>::expandBy(const vector_type& v)
}
template<typename VT>
template<typename vector_type>
template<typename vector_type>
void BoundingSphereImpl<VT>::expandRadiusBy(const vector_type& v)
{
if (valid())
{
value_type r = (v-_center).length();
value_type r = (vec_type(v)-_center).length();
if (r>_radius) _radius = r;
// else do nothing as vertex is within sphere.
}
@@ -244,7 +249,8 @@ void BoundingSphereImpl<VT>::expandRadiusBy(const BoundingSphereImpl& sh)
}
template<typename VT>
void BoundingSphereImpl<VT>::expandBy(const BoundingBoxImpl<VT>& bb)
template<typename BBT>
void BoundingSphereImpl<VT>::expandBy(const BoundingBoxImpl<BBT>& bb)
{
if (bb.valid())
{
@@ -274,7 +280,8 @@ void BoundingSphereImpl<VT>::expandBy(const BoundingBoxImpl<VT>& bb)
}
template<typename VT>
void BoundingSphereImpl<VT>::expandRadiusBy(const BoundingBoxImpl<VT>& bb)
template<typename BBT>
void BoundingSphereImpl<VT>::expandRadiusBy(const BoundingBoxImpl<BBT>& bb)
{
if (bb.valid())
{

View File

@@ -27,7 +27,7 @@ inline void clampGEQUAL(T& value,const T minValue,const char* valueName)
{
if (value<minValue)
{
notify(WARN) << "Warning: "<<valueName<<" of "<<value<<" is below permitted minimum, clampping to "<<minValue<<"."<< std::endl;
notify(WARN) << "Warning: "<<valueName<<" of "<<value<<" is below permitted minimum, clamping to "<<minValue<<"."<< std::endl;
value = minValue;
}
}
@@ -40,7 +40,7 @@ inline void clampLEQUAL(T& value,const T maxValue,const char* valueName)
{
if (value>maxValue)
{
notify(WARN) << "Warning: "<<valueName<<" of "<<value<<" is above permitted maximum, clampping to "<<maxValue<<"."<< std::endl;
notify(WARN) << "Warning: "<<valueName<<" of "<<value<<" is above permitted maximum, clamping to "<<maxValue<<"."<< std::endl;
value = maxValue;
}
}
@@ -55,13 +55,13 @@ inline void clampBetweenRange(T& value,const T minValue,const T maxValue,const c
{
if (value<minValue)
{
notify(WARN) << "Warning: "<<valueName<<" of "<<value<<" is below permitted minimum, clampping to "<<minValue<<"."<< std::endl;
notify(WARN) << "Warning: "<<valueName<<" of "<<value<<" is below permitted minimum, clamping to "<<minValue<<"."<< std::endl;
value = minValue;
}
else
if (value>maxValue)
{
notify(WARN) << "Warning: "<<valueName<<" of "<<value<<" is above permitted maximum, clampping to "<<maxValue<<"."<< std::endl;
notify(WARN) << "Warning: "<<valueName<<" of "<<value<<" is above permitted maximum, clamping to "<<maxValue<<"."<< std::endl;
value = maxValue;
}
@@ -75,7 +75,7 @@ inline void clampArrayElementGEQUAL(A& value,unsigned int i,const T minValue,con
{
if (value[i]<minValue)
{
notify(WARN) << "Warning: "<<valueName<<"["<<i<<"] of "<<value[i]<<" is below permitted minimum, clampping to "<<minValue<<"."<< std::endl;
notify(WARN) << "Warning: "<<valueName<<"["<<i<<"] of "<<value[i]<<" is below permitted minimum, clamping to "<<minValue<<"."<< std::endl;
value[i] = minValue;
}
}
@@ -88,7 +88,7 @@ inline void clampArrayElementLEQUAL(A& value,unsigned int i,const T maxValue,con
{
if (value[i]>maxValue)
{
notify(WARN) << "Warning: "<<valueName<<"["<<i<<"] of "<<value[i]<<" is above permitted maximum, clampping to "<<maxValue<<"."<< std::endl;
notify(WARN) << "Warning: "<<valueName<<"["<<i<<"] of "<<value[i]<<" is above permitted maximum, clamping to "<<maxValue<<"."<< std::endl;
value = maxValue;
}
}
@@ -103,13 +103,13 @@ inline void clampArrayElementBetweenRange(A& value,unsigned int i,const T minVal
{
if (value[i]<minValue)
{
notify(WARN) << "Warning: "<<valueName<<"["<<i<<"] of "<<value[i]<<" is below permitted minimum, clampping to "<<minValue<<"."<< std::endl;
notify(WARN) << "Warning: "<<valueName<<"["<<i<<"] of "<<value[i]<<" is below permitted minimum, clamping to "<<minValue<<"."<< std::endl;
value[i] = minValue;
}
else
if (value[i]>maxValue)
{
notify(WARN) << "Warning: "<<valueName<<"["<<i<<"] of "<<value[i]<<" is above permitted maximum, clampping to "<<maxValue<<"."<< std::endl;
notify(WARN) << "Warning: "<<valueName<<"["<<i<<"] of "<<value[i]<<" is above permitted maximum, clamping to "<<maxValue<<"."<< std::endl;
value[i] = maxValue;
}

View File

@@ -680,6 +680,19 @@ class OSG_EXPORT Camera : public Transform, public CullSettings
ref_ptr<DrawCallback> _finalDrawCallback;
};
/** Functor to assist with ordering camers in the order they should be rendered in.*/
struct CameraRenderOrderSortOp
{
inline bool operator() (const Camera* lhs,const Camera* rhs) const
{
if (lhs->getRenderOrder()<rhs->getRenderOrder()) return true;
if (rhs->getRenderOrder()<lhs->getRenderOrder()) return false;
return lhs->getRenderOrderNum()<rhs->getRenderOrderNum();
}
};
}
#endif

View File

@@ -400,7 +400,7 @@ namespace osg
FrameBufferObject();
FrameBufferObject(const FrameBufferObject& copy, const CopyOp& copyop = CopyOp::SHALLOW_COPY);
META_StateAttribute(osg, FrameBufferObject, (StateAttribute::Type)0x101010/*FrameBufferObject*/);
META_StateAttribute(osg, FrameBufferObject, FRAME_BUFFER_OBJECT);
inline const AttachmentMap& getAttachmentMap() const;
@@ -418,6 +418,11 @@ namespace osg
void apply(State &state) const;
inline GLuint getHandle(unsigned int contextID) const
{
return _fboID[contextID];
}
enum BindTarget
{
READ_FRAMEBUFFER = GL_READ_FRAMEBUFFER_EXT,

View File

@@ -96,7 +96,7 @@
#endif
// XXX This is from Win32's <ctype.h>
#if !defined(_WCHAR_T_DEFINED) && !(defined(__GNUC__)&&((__GNUC__ == 3)||(__GNUC__ == 4)))
#if !defined(_WCHAR_T_DEFINED) && !(defined(__GNUC__)&&(__GNUC__ >2))
typedef unsigned short wchar_t;
#define _WCHAR_T_DEFINED
#endif

View File

@@ -385,8 +385,6 @@ typedef char GLchar;
#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6
#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7
#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8
#define GL_RED_SNORM 0x8F90
#define GL_RG_SNORM 0x8F91
#define GL_RGB_SNORM 0x8F92
#define GL_RGBA_SNORM 0x8F93
#define GL_R8_SNORM 0x8F94
@@ -402,6 +400,14 @@ typedef char GLchar;
#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E
#endif
#ifndef GL_RED_SNORM
#define GL_RED_SNORM 0x8F90
#endif
#ifndef GL_RG_SNORM
#define GL_RG_SNORM 0x8F91
#endif
#ifndef GL_VERSION_4_0
#define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C
#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D
@@ -530,6 +536,8 @@ class OSG_EXPORT GL2Extensions : public osg::Referenced
void setShaderAtomicCounterSupported(bool flag) { _isShaderAtomicCountersSupported = flag; }
bool isShaderAtomicCounterSupported() const {return _isShaderAtomicCountersSupported; }
bool isDrawBuffersSupported() const { return _glDrawBuffers!=0; }
/** Function to call to get the extension of a specified context.
* If the Exentsion object for that context has not yet been created then
* and the 'createIfNotInitalized' flag been set to false then returns NULL.

View File

@@ -302,13 +302,13 @@ class OSG_EXPORT Image : public BufferData
* take care to access the data per row rather than treating the whole data as a single block. */
inline const unsigned char* data() const { return _data; }
inline unsigned char* data(int column, int row=0,int image=0)
inline unsigned char* data(unsigned int column, unsigned int row = 0, unsigned int image = 0)
{
if (!_data) return NULL;
return _data+(column*getPixelSizeInBits())/8+row*getRowStepInBytes()+image*getImageSizeInBytes();
}
inline const unsigned char* data(int column, int row=0,int image=0) const
inline const unsigned char* data(unsigned int column, unsigned int row = 0, unsigned int image = 0) const
{
if (!_data) return NULL;
return _data+(column*getPixelSizeInBits())/8+row*getRowStepInBytes()+image*getImageSizeInBytes();

View File

@@ -34,10 +34,6 @@ const double LN_2 = 0.69314718055994530942;
const double INVLN_2 = 1.0 / LN_2;
/** return the minimum of two values, equivalent to std::min.
* std::min not used because of STL implementation under IRIX not
* containing std::min.
*/
template<typename T>
inline T absolute(T v) { return v<(T)0?-v:v; }

View File

@@ -201,7 +201,12 @@ class OSG_EXPORT Node : public Object
/** Convenience method that removes a given callback from a node, even if that callback is nested. There is no error return in case the given callback is not found. */
inline void removeUpdateCallback(NodeCallback* nc) {
if (nc != NULL && _updateCallback.valid()) {
if (_updateCallback == nc) setUpdateCallback(nc->getNestedCallback()); // replace the callback by the nested one
if (_updateCallback == nc)
{
ref_ptr<NodeCallback> new_nested_callback = nc->getNestedCallback();
nc->setNestedCallback(0);
setUpdateCallback(new_nested_callback.get());
}
else _updateCallback->removeNestedCallback(nc);
}
}
@@ -231,7 +236,12 @@ class OSG_EXPORT Node : public Object
/** Convenience method that removes a given callback from a node, even if that callback is nested. There is no error return in case the given callback is not found. */
inline void removeEventCallback(NodeCallback* nc) {
if (nc != NULL && _eventCallback.valid()) {
if (_eventCallback == nc) setEventCallback(nc->getNestedCallback()); // replace the callback by the nested one
if (_eventCallback == nc)
{
ref_ptr<NodeCallback> new_nested_callback = nc->getNestedCallback();
nc->setNestedCallback(0);
setEventCallback(new_nested_callback.get()); // replace the callback by the nested one
}
else _eventCallback->removeNestedCallback(nc);
}
}
@@ -261,7 +271,12 @@ class OSG_EXPORT Node : public Object
/** Convenience method that removes a given callback from a node, even if that callback is nested. There is no error return in case the given callback is not found. */
inline void removeCullCallback(NodeCallback* nc) {
if (nc != NULL && _cullCallback.valid()) {
if (_cullCallback == nc) setCullCallback(nc->getNestedCallback()); // replace the callback by the nested one
if (_cullCallback == nc)
{
ref_ptr<NodeCallback> new_nested_callback = nc->getNestedCallback();
nc->setNestedCallback(0);
setCullCallback(new_nested_callback.get()); // replace the callback by the nested one
}
else _cullCallback->removeNestedCallback(nc);
}
}

View File

@@ -1203,6 +1203,13 @@ class OSG_EXPORT State : public Referenced, public Observer
}
/// For GL>=2.0 uses GL_MAX_TEXTURE_COORDS, for GL<2 uses GL_MAX_TEXTURE_UNITS
inline GLint getMaxTextureCoords() const { return _glMaxTextureCoords; }
/// For GL>=2.0 uses GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, for GL<2 uses GL_MAX_TEXTURE_UNITS
inline GLint getMaxTextureUnits() const { return _glMaxTextureUnits; }
/** Set the current texture unit, return true if selected,
* false if selection failed such as when multi texturing is not supported.
* note, only updates values that change.*/
@@ -1329,11 +1336,6 @@ class OSG_EXPORT State : public Referenced, public Observer
if (_lastAppliedProgramObject!=program)
{
_lastAppliedProgramObject = program;
if (program && _appliedProgramObjectSet.count(program)==0)
{
_appliedProgramObjectSet.insert(program);
program->addObserver(this);
}
}
}
inline const Program::PerContextProgram* getLastAppliedProgramObject() const { return _lastAppliedProgramObject; }

View File

@@ -192,8 +192,10 @@ class OSG_EXPORT StateAttribute : public Object
TRANSFORMFEEDBACKBUFFERBINDING,
ATOMICCOUNTERBUFFERBINDING,
PATCH_PARAMETER
PATCH_PARAMETER,
FRAME_BUFFER_OBJECT
};
/** Simple pairing between an attribute type and the member within that attribute type group.*/

View File

@@ -305,6 +305,25 @@
#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E
#endif
#ifndef GL_VERSION_1_1
#define GL_R3_G3_B2 0x2A10
#define GL_RGB4 0x804F
#define GL_RGB5 0x8050
#define GL_RGB8 0x8051
#define GL_RGB10 0x8052
#define GL_RGB12 0x8053
#define GL_RGB16 0x8054
#define GL_RGBA2 0x8055
#define GL_RGBA4 0x8056
#define GL_RGB5_A1 0x8057
#define GL_RGBA8 0x8058
#define GL_RGB10_A2 0x8059
#define GL_RGBA12 0x805A
#define GL_RGBA16 0x805B
#define GL_BGR_EXT 0x80E0
#define GL_BGRA_EXT 0x80E1
#endif
#ifndef GL_ARB_texture_rg
#define GL_RG 0x8227
#define GL_RG_INTEGER 0x8228

View File

@@ -20,8 +20,8 @@ extern "C" {
#define OPENSCENEGRAPH_MAJOR_VERSION 3
#define OPENSCENEGRAPH_MINOR_VERSION 2
#define OPENSCENEGRAPH_PATCH_VERSION 0
#define OPENSCENEGRAPH_SOVERSION 99
#define OPENSCENEGRAPH_PATCH_VERSION 2
#define OPENSCENEGRAPH_SOVERSION 100
/* Convenience macro that can be used to decide whether a feature is present or not i.e.
* #if OSG_MIN_VERSION_REQUIRED(2,9,5)

View File

@@ -94,6 +94,10 @@ class ref_ptr
bool operator!() const { return _ptr==0; } // not required
bool valid() const { return _ptr!=0; }
/** release the pointer from ownership by this ref_ptr<>, decrementing the objects refencedCount() via unref_nodelete() to prevent the Object
* object from being deleted even if the reference count goes to zero. Use when using a local ref_ptr<> to an Object that you want to return
* from a function/method via a C pointer, whilst preventing the normal ref_ptr<> destructor from cleaning up the object. When using release()
* you are implicitly expecting other code to take over managment of the object, otherwise a memory leak will result. */
T* release() { T* tmp=_ptr; if (_ptr) _ptr->unref_nodelete(); _ptr=0; return tmp; }
void swap(ref_ptr& rp) { T* tmp=_ptr; _ptr=rp._ptr; rp._ptr=tmp; }

View File

@@ -89,6 +89,7 @@ public:
// Serialization related functions
OutputStream& operator<<( bool b ) { _out->writeBool(b); return *this; }
OutputStream& operator<<( char c ) { _out->writeChar(c); return *this; }
OutputStream& operator<<( signed char c) { _out->writeChar(c); return *this; }
OutputStream& operator<<( unsigned char c ) { _out->writeUChar(c); return *this; }
OutputStream& operator<<( short s ) { _out->writeShort(s); return *this; }
OutputStream& operator<<( unsigned short s ) { _out->writeUShort(s); return *this; }

View File

@@ -21,8 +21,7 @@
namespace osgManipulator {
/**
* Tab plane dragger consists of a plane with tabs on it's corners and edges
* for scaling. And the plane is used as a 2D translate dragger.
* Translate plane dragger consists of a wireframe box representing a plane that can be dragged to translate along the plane.
*/
class OSGMANIPULATOR_EXPORT TranslatePlaneDragger : public CompositeDragger
{

View File

@@ -38,7 +38,7 @@ class OSGSHADOW_EXPORT ShadowSettings : public osg::Object
void setComputeNearFarModeOverride(osg::CullSettings::ComputeNearFarMode cnfn) { _computeNearFearModeOverride = cnfn; }
osg::CullSettings::ComputeNearFarMode getComputeNearFarModeOverride() const { return _computeNearFearModeOverride; }
/** Set the LightNum of the light in the scene to assign a shadow for.
* Default value is -1, which signifies that shadow technique should automatically select an active light
* to assign a shadow, typically this will be the first active light found. */
@@ -67,7 +67,7 @@ class OSGSHADOW_EXPORT ShadowSettings : public osg::Object
void setMaximumShadowMapDistance(double distance) { _maximumShadowMapDistance = distance; }
double getMaximumShadowMapDistance() const { return _maximumShadowMapDistance; }
enum ShadowMapProjectionHint
{
@@ -144,4 +144,4 @@ class OSGSHADOW_EXPORT ShadowSettings : public osg::Object
}
#endif
#endif

View File

@@ -51,7 +51,7 @@ class OSGUTIL_EXPORT SceneView : public osg::Object, public osg::CullSettings
SKY_LIGHT = 0x2,
COMPILE_GLOBJECTS_AT_INIT = 0x4,
APPLY_GLOBAL_DEFAULTS = 0x8,
CLEAR_GLOBAL_STATESET = 0x16,
CLEAR_GLOBAL_STATESET = 0x10,
STANDARD_SETTINGS = HEADLIGHT |
COMPILE_GLOBJECTS_AT_INIT |
APPLY_GLOBAL_DEFAULTS |
@@ -495,7 +495,7 @@ class OSGUTIL_EXPORT SceneView : public osg::Object, public osg::CullSettings
bool getAutomaticFlush() const { return _automaticFlush; }
void setResetColorMaskToAllOn(bool enable) { _resetColorMaskToAllEnabled = enable; }
bool setResetColorMaskToAllOn() const { return _resetColorMaskToAllEnabled; }
bool getResetColorMaskToAllOn() const { return _resetColorMaskToAllEnabled; }
protected:

View File

@@ -207,6 +207,7 @@ class OSGUTIL_EXPORT StateGraph : public osg::Referenced
// use return path to trace back steps to sg_new.
std::vector<StateGraph*> return_path;
return_path.reserve(sg_new->_depth+1);
// need to pop back root render graph.
do
@@ -248,6 +249,7 @@ class OSGUTIL_EXPORT StateGraph : public osg::Referenced
// use return path to trace back steps to sg_new.
std::vector<StateGraph*> return_path;
return_path.reserve(sg_new->_depth+1);
// need to pop back up to the same depth as the curr state group.
while (sg_new->_depth>sg_curr->_depth)

View File

@@ -24,23 +24,23 @@
namespace osgViewer
{
class OSGVIEWER_EXPORT Keystone : public osg::Object
{
public:
Keystone();
Keystone(const Keystone& rhs, const osg::CopyOp& copop=osg::CopyOp::SHALLOW_COPY);
META_Object(osgViewer, Keystone)
void reset();
Keystone& operator = (const Keystone& rhs);
void setKeystoneEditingEnabled(bool flag) { keystoneEditingEnabled = flag; }
bool getKeystoneEditingEnabled() const { return keystoneEditingEnabled; }
void setGridColor(const osg::Vec4& color) { gridColour = color; }
osg::Vec4& getGridColor() { return gridColour; }
const osg::Vec4& getGridColor() const { return gridColour; }
@@ -61,23 +61,23 @@ public:
osg::Vec2d& getTopRight() { return top_right; }
const osg::Vec2d& getTopRight() const { return top_right; }
void compute3DPositions(osg::DisplaySettings* ds, osg::Vec3& tl, osg::Vec3& tr, osg::Vec3& br, osg::Vec3& bl) const;
osg::Geode* createKeystoneDistortionMesh();
osg::Node* createGrid();
/** Write the file specified by the "filename" user value field. Return true if file successfully written. */
bool writeToFile();
/** convinience function that loads and assigns any keystone files specified in the DisplaySettings::KeystoneFileNames list, return true if Keystone's assigned to DisplaySettings.*/
static bool loadKeystoneFiles(osg::DisplaySettings* ds);
protected:
protected:
bool keystoneEditingEnabled;
osg::Vec4 gridColour;
@@ -91,8 +91,8 @@ protected:
protected:
virtual ~Keystone() {}
};
class OSGVIEWER_EXPORT KeystoneHandler : public osgGA::GUIEventHandler
@@ -125,7 +125,7 @@ public:
osg::Vec2d incrementScale(const osgGA::GUIEventAdapter& ea) const;
Region computeRegion(const osgGA::GUIEventAdapter& ea) const;
void move(Region region, const osg::Vec2d& delta);
protected:
@@ -138,7 +138,7 @@ protected:
osg::Vec2d _startPosition;
osg::ref_ptr<Keystone> _startControlPoints;
Region _selectedRegion;
osg::ref_ptr<Keystone> _currentControlPoints;
@@ -146,4 +146,4 @@ protected:
}
#endif
#endif

View File

@@ -335,6 +335,12 @@ class OSGVIEWER_EXPORT ViewerBase : public virtual osg::Object
osg::ref_ptr<osgUtil::IncrementalCompileOperation> _incrementalCompileOperation;
osg::observer_ptr<osg::GraphicsContext> _currentContext;
private:
// Define private copy constructor
// otherwsie VS2015 will construct it's own which will call the private copy operator from osg::Object resulting in an compile error.
ViewerBase& operator = (const ViewerBase&) { return *this; }
};
}

View File

@@ -314,6 +314,11 @@ class OSGWIDGET_EXPORT EventInterface
return _eventMask;
}
typedef std::list<osg::ref_ptr<Callback> > CallbackList;
inline CallbackList& getCallbacks() { return _callbacks; }
inline const CallbackList& getCallbacks() const { return _callbacks; }
void addCallback(Callback* cb) {
_callbacks.push_back(cb);
}
@@ -400,7 +405,6 @@ class OSGWIDGET_EXPORT EventInterface
bool canKeyUp () const { return (_eventMask & EVENT_KEY_UP) != 0; }
private:
typedef std::list<osg::ref_ptr<Callback> > CallbackList;
unsigned int _eventMask;
CallbackList _callbacks;

View File

@@ -2,10 +2,10 @@
# what to do with it.
ADD_DEFINITIONS(-DOPENTHREADS_EXPORTS)
SET(OPENTHREADS_MAJOR_VERSION 2)
SET(OPENTHREADS_MINOR_VERSION 6)
SET(OPENTHREADS_PATCH_VERSION 0)
SET(OPENTHREADS_SOVERSION 12)
SET(OPENTHREADS_MAJOR_VERSION 3)
SET(OPENTHREADS_MINOR_VERSION 2)
SET(OPENTHREADS_PATCH_VERSION 1)
SET(OPENTHREADS_SOVERSION 20)
SET(OPENTHREADS_VERSION ${OPENTHREADS_MAJOR_VERSION}.${OPENTHREADS_MINOR_VERSION}.${OPENTHREADS_PATCH_VERSION})
@@ -55,10 +55,10 @@ SET(OpenThreads_PUBLIC_HEADERS
${HEADER_PATH}/Block
${HEADER_PATH}/Condition
${HEADER_PATH}/Exports
${HEADER_PATH}/Mutex
${HEADER_PATH}/ReadWriteMutex
${HEADER_PATH}/ReentrantMutex
${HEADER_PATH}/ScopedLock
${HEADER_PATH}/Mutex
${HEADER_PATH}/ReadWriteMutex
${HEADER_PATH}/ReentrantMutex
${HEADER_PATH}/ScopedLock
${HEADER_PATH}/Thread
${HEADER_PATH}/Version
${OPENTHREADS_CONFIG_HEADER}
@@ -96,7 +96,7 @@ ELSEIF(WIN32)
SUBDIRS(pthreads)
ELSE()
# Everybody else including Msys should probably go here
SUBDIRS(win32)
SUBDIRS(win32)
# examples)
ENDIF()
ELSE()

View File

@@ -149,7 +149,30 @@ private:
#endif
#endif
}
#if defined(HAVE_PTHREAD_SETAFFINITY_NP) || defined(HAVE_THREE_PARAM_SCHED_SETAFFINITY) || defined(HAVE_TWO_PARAM_SCHED_SETAFFINITY)
else
{
// BUG-fix for linux:
// Each thread inherits the processor affinity mask from its parent thread.
// We need to explicitly set it to all CPUs, if no affinity was specified.
cpu_set_t cpumask;
CPU_ZERO( &cpumask );
for (int i = 0; i < OpenThreads::GetNumberOfProcessors(); ++i)
{
CPU_SET( i, &cpumask );
}
#if defined(HAVE_PTHREAD_SETAFFINITY_NP)
pthread_setaffinity_np( pthread_self(), sizeof(cpumask), &cpumask);
#elif defined(HAVE_THREE_PARAM_SCHED_SETAFFINITY)
sched_setaffinity( 0, sizeof(cpumask), &cpumask );
#elif defined(HAVE_TWO_PARAM_SCHED_SETAFFINITY)
sched_setaffinity( 0, &cpumask );
#endif
}
#endif
ThreadCleanupStruct tcs;
tcs.thread = thread;

View File

@@ -15,6 +15,7 @@
#include <string.h>
#include <osg/ApplicationUsage>
#include <osg/Object>
#include <osg/Math>
#include <osg/ref_ptr>
@@ -33,6 +34,8 @@ ApplicationUsage* ApplicationUsage::instance()
return s_applicationUsage.get();
}
OSG_INIT_SINGLETON_PROXY(ApplicationUsageSingletonProxy, ApplicationUsage::instance())
void ApplicationUsage::addUsageExplanation(Type type,const std::string& option,const std::string& explanation)
{
switch(type)
@@ -69,7 +72,7 @@ void ApplicationUsage::addKeyboardMouseBinding(const std::string& prefix, int ke
{
std::ostringstream ostr;
ostr<<prefix;
if (key==' ')
{
ostr<<"Space";

View File

@@ -225,21 +225,26 @@ void CollectOccludersVisitor::removeOccludedOccluders()
break;
}
// now check all the holes in the occludee against the occluder,
// do so in reverse order so that the iterators remain valid.
for(ShadowVolumeOccluder::HoleList::reverse_iterator holeItr=holeList.rbegin();
holeItr!=holeList.rend();
)
// now check all the holes in the occludee against the occluder, and remove the ones that won't be valid
unsigned int previous_valid_hole_i = 0;
for(unsigned int i=0; i<holeList.size(); ++i)
{
if (occluder->contains((*holeItr).getReferenceVertexList()))
if (!occluder->contains(holeList[i].getReferenceVertexList()))
{
holeList.erase((++holeItr).base());
}
else
{
++holeItr;
}
if (previous_valid_hole_i<i)
{
// copy valid holes into gaps left by invalid ones
holeList[previous_valid_hole_i] = holeList[i];
}
previous_valid_hole_i++;
}
}
// remove the tail of the holeList if holes have been removed.
if (previous_valid_hole_i<holeList.size())
{
holeList.erase(holeList.begin()+previous_valid_hole_i,holeList.end());
}
}

View File

@@ -96,7 +96,7 @@ void DisplaySettings::setDisplaySettings(const DisplaySettings& vs)
_glContextFlags = vs._glContextFlags;
_glContextProfileMask = vs._glContextProfileMask;
_swapMethod = vs._swapMethod;
_keystoneHint = vs._keystoneHint;
_keystoneFileNames = vs._keystoneFileNames;
_keystones = vs._keystones;
@@ -137,7 +137,7 @@ void DisplaySettings::merge(const DisplaySettings& vs)
_swapMethod = vs._swapMethod;
_keystoneHint = _keystoneHint | vs._keystoneHint;
// insert any unique filenames into the local list
for(FileNames::const_iterator itr = vs._keystoneFileNames.begin();
itr != vs._keystoneFileNames.end();
@@ -146,7 +146,7 @@ void DisplaySettings::merge(const DisplaySettings& vs)
const std::string& filename = *itr;
FileNames::iterator found_itr = std::find(_keystoneFileNames.begin(), _keystoneFileNames.end(), filename);
if (found_itr == _keystoneFileNames.end()) _keystoneFileNames.push_back(filename);
}
}
// insert unique Keystone object into local list
for(Objects::const_iterator itr = vs._keystones.begin();
@@ -156,7 +156,7 @@ void DisplaySettings::merge(const DisplaySettings& vs)
const osg::Object* object = itr->get();
Objects::iterator found_itr = std::find(_keystones.begin(), _keystones.end(), object);
if (found_itr == _keystones.end()) _keystones.push_back(const_cast<osg::Object*>(object));
}
}
}
void DisplaySettings::setDefaults()
@@ -197,7 +197,7 @@ void DisplaySettings::setDefaults()
#endif
_compileContextsHint = false;
_serializeDrawDispatch = true;
_serializeDrawDispatch = false;
_useSceneViewForStereoHint = true;
_numDatabaseThreadsHint = 2;
@@ -633,7 +633,7 @@ void DisplaySettings::readEnvironmentalVariables()
}
}
if ((ptr = getenv("OSG_KEYSTONE_FILES")) != 0)
{
#if defined(WIN32) && !defined(__CYGWIN__)
@@ -641,7 +641,7 @@ void DisplaySettings::readEnvironmentalVariables()
#else
char delimitor = ':';
#endif
std::string paths(ptr);
if (!paths.empty())
{
@@ -743,10 +743,10 @@ void DisplaySettings::readCommandLine(ArgumentParser& arguments)
if (arguments.read("--keystone",str))
{
_keystoneHint = true;
if (!_keystoneFileNames.empty()) _keystoneFileNames.clear();
_keystoneFileNames.push_back(str);
while(arguments.read("--keystone",str))
{
_keystoneFileNames.push_back(str);

View File

@@ -105,7 +105,8 @@ FBOExtensions::FBOExtensions(unsigned int contextID)
#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE)
_supported = _supported &&
glFramebufferTexture1D != 0 &&
glFramebufferTexture3D != 0;
glFramebufferTexture3D != 0 &&
isGLExtensionOrVersionSupported(contextID, "GL_EXT_framebuffer_object",3.0f);
#endif
LOAD_FBO_EXT(glBlitFramebuffer);
@@ -913,12 +914,19 @@ void FrameBufferObject::apply(State &state, BindTarget target) const
ext->glBindFramebuffer(target, fboID);
// enable drawing buffers to render the result to fbo
if (_drawBuffers.size() > 0)
if ( (target == READ_DRAW_FRAMEBUFFER) || (target == DRAW_FRAMEBUFFER) )
{
GL2Extensions *gl2e = GL2Extensions::Get(state.getContextID(), true );
if (gl2e)
if (_drawBuffers.size() > 0)
{
gl2e->glDrawBuffers(_drawBuffers.size(), &(_drawBuffers[0]));
GL2Extensions *gl2e = GL2Extensions::Get(state.getContextID(), true );
if (gl2e && gl2e->isDrawBuffersSupported())
{
gl2e->glDrawBuffers(_drawBuffers.size(), &(_drawBuffers[0]));
}
else
{
OSG_WARN <<"Warning: FrameBufferObject: could not set draw buffers, glDrawBuffers is not supported!" << std::endl;
}
}
}
@@ -939,7 +947,7 @@ void FrameBufferObject::apply(State &state, BindTarget target) const
{
OSG_WARN <<
"Warning: FrameBufferObject: could not attach PACKED_DEPTH_STENCIL_BUFFER, "
"EXT_packed_depth_stencil is not supported !" << std::endl;
"EXT_packed_depth_stencil is not supported!" << std::endl;
}
break;

View File

@@ -161,12 +161,14 @@ void Geometry::setTexCoordArray(unsigned int index,Array* array, osg::Array::Bin
if (_texCoordList.size()<=index)
_texCoordList.resize(index+1);
if (array && binding!=osg::Array::BIND_UNDEFINED) array->setBinding(binding);
if (array)
{
if (binding!=osg::Array::BIND_UNDEFINED) array->setBinding(binding);
else array->setBinding(osg::Array::BIND_PER_VERTEX);
}
_texCoordList[index] = array;
// do we set to array BIND_PER_VERTEX?
dirtyDisplayList();
if (_useVertexBufferObjects && array)
@@ -1425,7 +1427,7 @@ void Geometry::fixDeprecatedData()
case(PrimitiveSet::DrawArraysPrimitiveType):
{
const DrawArrays* drawArray = static_cast<const DrawArrays*>(primitiveset);
numVertices = drawArray->getCount();
numVertices += drawArray->getCount();
break;
}
case(PrimitiveSet::DrawArrayLengthsPrimitiveType):
@@ -1437,7 +1439,6 @@ void Geometry::fixDeprecatedData()
{
unsigned int localNumVertices = *primItr;
numVertices += localNumVertices;
primItr += localNumVertices;
}
break;
}
@@ -1538,7 +1539,8 @@ void Geometry::fixDeprecatedData()
// start the primitiveNum at -1 as we increment it the first time through when
// we start processing the primitive sets.
int primitiveNum = -1;
int target_vindex = 0;
int source_pindex = -1; // equals primitiveNum
for(PrimitiveSetList::iterator itr = _primitives.begin();
itr != _primitives.end();
++itr)
@@ -1557,27 +1559,27 @@ void Geometry::fixDeprecatedData()
}
// copy the vertex data across to the new arays
int source_pindex = -1;
int target_vindex = 0;
switch(primitiveset->getType())
{
case(PrimitiveSet::DrawArraysPrimitiveType):
{
if (primLength==0) primLength=primitiveset->getNumIndices();
const DrawArrays* drawArray = static_cast<const DrawArrays*>(primitiveset);
DrawArrays* drawArray = static_cast<DrawArrays*>(primitiveset);
if (primLength==0) primLength = drawArray->getCount();
unsigned int primCount=0;
unsigned int indexEnd = drawArray->getFirst()+drawArray->getCount();
for(unsigned int vindex=drawArray->getFirst();
unsigned int startindex=drawArray->getFirst();
drawArray->setFirst(target_vindex);
unsigned int indexEnd = startindex+drawArray->getCount();
for(unsigned int vindex=startindex;
vindex<indexEnd;
++vindex, ++target_vindex, ++primCount)
{
if ((primCount%primLength)==0) ++source_pindex;
// copy bind per primitive from primitiveNum
// copy bind per vertex from vindex
for(PtrList::iterator itr = perVertexPtrs.begin();
itr != perVertexPtrs.end();
++itr)
@@ -1591,7 +1593,7 @@ void Geometry::fixDeprecatedData()
}
}
// copy bind per vertex from vindex
// copy bind per primitive from source_pindex
for(PtrList::iterator itr = perPrimitivePtrs.begin();
itr != perPrimitivePtrs.end();
++itr)
@@ -1609,23 +1611,22 @@ void Geometry::fixDeprecatedData()
}
case(PrimitiveSet::DrawArrayLengthsPrimitiveType):
{
const DrawArrayLengths* drawArrayLengths = static_cast<const DrawArrayLengths*>(primitiveset);
DrawArrayLengths* drawArrayLengths = static_cast<DrawArrayLengths*>(primitiveset);
unsigned int vindex=drawArrayLengths->getFirst();
for(DrawArrayLengths::const_iterator primItr=drawArrayLengths->begin();
for(DrawArrayLengths::iterator primItr=drawArrayLengths->begin();
primItr!=drawArrayLengths->end();
++primItr)
{
unsigned int localPrimLength;
if (primLength==0) localPrimLength=*primItr;
else localPrimLength=primLength;
drawArrayLengths->setFirst(target_vindex);
for(GLsizei primCount=0;
primCount<*primItr;
++vindex, ++target_vindex, ++primCount)
{
if ((primCount%localPrimLength)==0) ++source_pindex;
// copy bind per primitive from primitiveNum
// copy bind per vertex from vindex
for(PtrList::iterator itr = perVertexPtrs.begin();
itr != perVertexPtrs.end();
++itr)
@@ -1639,7 +1640,7 @@ void Geometry::fixDeprecatedData()
}
}
// copy bind per vertex from vindex
// copy bind per primitive from source_pindex
for(PtrList::iterator itr = perPrimitivePtrs.begin();
itr != perPrimitivePtrs.end();
++itr)
@@ -1660,16 +1661,17 @@ void Geometry::fixDeprecatedData()
{
if (primLength==0) primLength=primitiveset->getNumIndices();
const DrawElementsUByte* drawElements = static_cast<const DrawElementsUByte*>(primitiveset);
DrawElementsUByte* drawElements = static_cast<DrawElementsUByte*>(primitiveset);
unsigned int primCount=0;
for(DrawElementsUByte::const_iterator primItr=drawElements->begin();
for(DrawElementsUByte::iterator primItr=drawElements->begin();
primItr!=drawElements->end();
++primCount, ++target_vindex, ++primItr)
{
if ((primCount%primLength)==0) ++source_pindex;
unsigned int vindex=*primItr;
*primItr=target_vindex;
// copy bind per primitive from primitiveNum
// copy bind per vertex from vindex
for(PtrList::iterator itr = perVertexPtrs.begin();
itr != perVertexPtrs.end();
++itr)
@@ -1683,7 +1685,7 @@ void Geometry::fixDeprecatedData()
}
}
// copy bind per vertex from vindex
// copy bind per primitive from source_pindex
for(PtrList::iterator itr = perPrimitivePtrs.begin();
itr != perPrimitivePtrs.end();
++itr)
@@ -1703,16 +1705,17 @@ void Geometry::fixDeprecatedData()
{
if (primLength==0) primLength=primitiveset->getNumIndices();
const DrawElementsUShort* drawElements = static_cast<const DrawElementsUShort*>(primitiveset);
DrawElementsUShort* drawElements = static_cast<DrawElementsUShort*>(primitiveset);
unsigned int primCount=0;
for(DrawElementsUShort::const_iterator primItr=drawElements->begin();
for(DrawElementsUShort::iterator primItr=drawElements->begin();
primItr!=drawElements->end();
++primCount, ++target_vindex, ++primItr)
{
if ((primCount%primLength)==0) ++primitiveNum;
if ((primCount%primLength)==0) ++source_pindex;
unsigned int vindex=*primItr;
*primItr=target_vindex;
// copy bind per primitive from primitiveNum
// copy bind per vertex from vindex
for(PtrList::iterator itr = perVertexPtrs.begin();
itr != perVertexPtrs.end();
++itr)
@@ -1725,8 +1728,7 @@ void Geometry::fixDeprecatedData()
*target++ = *source++;
}
}
// copy bind per vertex from vindex
// copy bind per primitive from source_pindex
for(PtrList::iterator itr = perPrimitivePtrs.begin();
itr != perPrimitivePtrs.end();
++itr)
@@ -1746,16 +1748,17 @@ void Geometry::fixDeprecatedData()
{
if (primLength==0) primLength=primitiveset->getNumIndices();
const DrawElementsUInt* drawElements = static_cast<const DrawElementsUInt*>(primitiveset);
DrawElementsUInt* drawElements = static_cast<DrawElementsUInt*>(primitiveset);
unsigned int primCount=0;
for(DrawElementsUInt::const_iterator primItr=drawElements->begin();
for(DrawElementsUInt::iterator primItr=drawElements->begin();
primItr!=drawElements->end();
++primCount, ++target_vindex, ++primItr)
{
if ((primCount%primLength)==0) ++primitiveNum;
if ((primCount%primLength)==0) ++source_pindex;
unsigned int vindex=*primItr;
*primItr=target_vindex;
// copy bind per primitive from primitiveNum
// copy bind per vertex from vindex
for(PtrList::iterator itr = perVertexPtrs.begin();
itr != perVertexPtrs.end();
++itr)
@@ -1769,7 +1772,7 @@ void Geometry::fixDeprecatedData()
}
}
// copy bind per vertex from vindex
// copy bind per primitive from source_pindex
for(PtrList::iterator itr = perPrimitivePtrs.begin();
itr != perPrimitivePtrs.end();
++itr)

View File

@@ -547,6 +547,9 @@ void GraphicsContext::close(bool callCloseImplementation)
}
bool contextIDValid = _state.valid();
unsigned int contextID = _state.valid() ? _state->getContextID() : ~0U;
if (callCloseImplementation && _state.valid() && isRealized())
{
OSG_INFO<<"Closing still viable window "<<sharedContextExists<<" _state->getContextID()="<<_state->getContextID()<<std::endl;
@@ -557,7 +560,14 @@ void GraphicsContext::close(bool callCloseImplementation)
{
OSG_INFO<<"Doing delete of GL objects"<<std::endl;
osg::deleteAllGLObjects(_state->getContextID());
_state->reset();
// Kill the State now so all the (directly or indirectly) referenced GLObjects can make it into delete cache in time.
// That way osg::deleteAllGLObjects won't miss them and left them to be deleted afterwards in a new GraphicsContext
// that happens to have the same contextID (see SceneView::draw() and _requiresFlush flag).
_state = 0;
osg::deleteAllGLObjects(contextID);
OSG_INFO<<"Done delete of GL objects"<<std::endl;
}
@@ -567,9 +577,9 @@ void GraphicsContext::close(bool callCloseImplementation)
// which have already been deleted
osg::flushAllDeletedGLObjects(_state->getContextID());
}
_state->reset();
_state->reset();
}
releaseContext();
}
@@ -585,18 +595,18 @@ void GraphicsContext::close(bool callCloseImplementation)
// now discard any deleted deleted OpenGL objects that the are still hanging around - such as due to
// the the flushDelete*() methods not being invoked, such as when using GraphicContextEmbedded where makeCurrent
// does not work.
if ( !sharedContextExists && _state.valid())
if ( !sharedContextExists && contextIDValid)
{
OSG_INFO<<"Doing discard of deleted OpenGL objects."<<std::endl;
osg::discardAllGLObjects(_state->getContextID());
osg::discardAllGLObjects(contextID);
}
if (_state.valid())
if (contextIDValid)
{
decrementContextIDUsageCount(_state->getContextID());
decrementContextIDUsageCount(contextID);
_state = 0;
if (_state.valid()) _state = 0;
}
}
@@ -752,18 +762,6 @@ void GraphicsContext::removeAllOperations()
_operationsBlock->set(false);
}
struct CameraRenderOrderSortOp
{
inline bool operator() (const Camera* lhs,const Camera* rhs) const
{
if (lhs->getRenderOrder()<rhs->getRenderOrder()) return true;
if (rhs->getRenderOrder()<lhs->getRenderOrder()) return false;
return lhs->getRenderOrderNum()<rhs->getRenderOrderNum();
}
};
void GraphicsContext::runOperations()
{
// sort the cameras into order

View File

@@ -239,7 +239,7 @@ Image::Image(const Image& image,const CopyOp& copyop):
{
if (image._data)
{
int size = image.getTotalSizeInBytesIncludingMipmaps();
unsigned int size = image.getTotalSizeInBytesIncludingMipmaps();
setData(new unsigned char [size],USE_NEW_DELETE);
unsigned char* dest_ptr = _data;
for(DataIterator itr(&image); itr.valid(); ++itr)
@@ -425,6 +425,8 @@ GLenum Image::computeFormatDataType(GLenum pixelFormat)
{
switch (pixelFormat)
{
case GL_R32F:
case GL_RG32F:
case GL_LUMINANCE32F_ARB:
case GL_LUMINANCE16F_ARB:
case GL_LUMINANCE_ALPHA32F_ARB:
@@ -466,6 +468,8 @@ GLenum Image::computeFormatDataType(GLenum pixelFormat)
case GL_RGBA:
case GL_RGB:
case GL_RED:
case GL_RG:
case GL_LUMINANCE:
case GL_LUMINANCE_ALPHA:
case GL_ALPHA: return GL_UNSIGNED_BYTE;
@@ -515,6 +519,9 @@ unsigned int Image::computeNumComponents(GLenum pixelFormat)
case(GL_ALPHA32UI_EXT): return 1;
case(GL_ALPHA16F_ARB): return 1;
case(GL_ALPHA32F_ARB): return 1;
case(GL_R32F): return 1;
case(GL_RG): return 2;
case(GL_RG32F): return 2;
case(GL_RGB): return 3;
case(GL_BGR): return 3;
case(GL_RGB8I_EXT): return 3;
@@ -799,7 +806,11 @@ int Image::computeNumberOfMipmapLevels(int s,int t, int r)
{
int w = maximum(s, t);
w = maximum(w, r);
return 1 + static_cast<int>(floor(logf(w)/logf(2.0f)));
int n = 0;
while (w >>= 1)
++n;
return n+1;
}
bool Image::isCompressed() const
@@ -1510,16 +1521,18 @@ void Image::flipVertical()
{
if (!dxtc_tool::VerticalFlip(s,t,_pixelFormat,_data+_mipmapData[i]))
{
OSG_NOTICE << "Notice Image::flipVertical(): Vertical flip do not succeed" << std::endl;
OSG_NOTICE << "Notice Image::flipVertical(): Vertical flip did not succeed" << std::endl;
}
}
else
{
// its not a compressed image, so implement flip oursleves.
// it's not a compressed image, so implement flip ourselves.
unsigned int mipRowSize = computeRowWidthInBytes(s, _pixelFormat, _dataType, _packing);
unsigned int mipRowStep = mipRowSize;
unsigned char* top = _data+_mipmapData[i];
unsigned char* bottom = top + (t-1)*rowStep;
unsigned char* bottom = top + (t-1)*mipRowStep;
flipImageVertical(top, bottom, rowSize, rowStep);
flipImageVertical(top, bottom, mipRowSize, mipRowStep);
}
}
}

View File

@@ -396,17 +396,8 @@ void ImageSequence::update(osg::NodeVisitor* nv)
if (startLoadIndex<0) startLoadIndex = 0;
int endLoadIndex = int(preLoadTime/_timePerImage);
if (endLoadIndex>=int(_imageDataList.size()))
{
if (looping)
{
endLoadIndex -= int(_imageDataList.size());
}
else
{
endLoadIndex = int(_imageDataList.size())-1;
}
}
if (looping && (endLoadIndex>=int(_imageDataList.size()))) endLoadIndex -= int(_imageDataList.size());
if (endLoadIndex>=int(_imageDataList.size())) endLoadIndex = int(_imageDataList.size())-1;
if (endLoadIndex<0) endLoadIndex = 0;
double requestTime = time;

View File

@@ -71,7 +71,7 @@ struct TriangleIndicesCollector
const osg::Vec3& v2 = (*(_buildKdTree->_kdTree.getVertices()))[p2];
// discard degenerate points
if (v0==v1 || v1==v2 || v1==v2)
if (v0==v1 || v1==v2 || v2==v0)
{
//OSG_NOTICE<<"Disgarding degenerate triangle"<<std::endl;
return;

View File

@@ -475,7 +475,11 @@ bool Node::containsOccluderNodes() const
void Node::setDescriptions(const DescriptionList& descriptions)
{
getOrCreateUserDataContainer()->setDescriptions(descriptions);
// only assign a description list (and associated UseDataContainer) if we need to.
if (!descriptions.empty() || getUserDataContainer())
{
getOrCreateUserDataContainer()->setDescriptions(descriptions);
}
}
Node::DescriptionList& Node::getDescriptions()

View File

@@ -29,7 +29,7 @@ namespace osg
class NullStreamBuffer : public std::streambuf
{
private:
std::streamsize xsputn(const std::streambuf::char_type */*str*/, std::streamsize n)
std::streamsize xsputn(const std::streambuf::char_type * /*str*/, std::streamsize n)
{
return n;
}

View File

@@ -44,17 +44,31 @@ bool PointSprite::checkValidityOfAssociatedModes(osg::State& state) const
{
bool modeValid = isPointSpriteSupported(state.getContextID());
state.setModeValidity(GL_POINT_SPRITE_ARB, modeValid);
#if defined( OSG_GLES1_AVAILABLE ) //point sprites don't exist on es 2.0
state.setModeValidity(GL_POINT_SPRITE_OES, modeValid);
#else
state.setModeValidity(GL_POINT_SPRITE_ARB, modeValid);
#endif
return modeValid;
}
void PointSprite::apply(osg::State& state) const
{
#if defined( OSG_GL3_AVAILABLE )
const Point::Extensions* extensions = Point::getExtensions(state.getContextID(),true);
extensions->glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN,_coordOriginMode);
#elif defined( OSG_GLES1_AVAILABLE ) //point sprites don't exist on es 2.0
if(!isPointSpriteSupported(state.getContextID())) return;
glTexEnvi(GL_POINT_SPRITE_OES, GL_COORD_REPLACE_OES, 1);
#elif defined( OSG_GL_FIXED_FUNCTION_AVAILABLE )
if(!isPointSpriteSupported(state.getContextID())) return;
glTexEnvi(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, 1);
@@ -63,8 +77,10 @@ void PointSprite::apply(osg::State& state) const
if (extensions->isPointSpriteCoordOriginSupported())
extensions->glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN,_coordOriginMode);
#else
OSG_NOTICE<<"Warning: PointSprite::apply(State&) - not supported."<<std::endl;
#endif
}
@@ -86,7 +102,7 @@ bool PointSprite::isPointSpriteSupported(unsigned int contextID)
if (!s_extensions[contextID].initialized)
{
s_extensions[contextID].initialized = true;
s_extensions[contextID].supported = OSG_GL3_FEATURES || isGLExtensionSupported(contextID, "GL_ARB_point_sprite") || isGLExtensionSupported(contextID, "GL_NV_point_sprite");
s_extensions[contextID].supported = OSG_GL3_FEATURES || isGLExtensionSupported(contextID, "GL_ARB_point_sprite") || isGLExtensionSupported(contextID, "GL_OES_point_sprite") || isGLExtensionSupported(contextID, "GL_NV_point_sprite");
}
return s_extensions[contextID].supported;

View File

@@ -68,18 +68,22 @@ PolygonMode::Mode PolygonMode::getMode(Face face) const
void PolygonMode::apply(State&) const
{
#ifdef OSG_GL1_AVAILABLE
#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE)
if (_modeFront==_modeBack)
{
glPolygonMode(GL_FRONT_AND_BACK,(GLenum)_modeFront);
}
else
{
glPolygonMode(GL_FRONT,(GLenum)_modeFront);
glPolygonMode(GL_BACK,(GLenum)_modeBack);
#ifdef OSG_GL1_AVAILABLE
glPolygonMode(GL_FRONT,(GLenum)_modeFront);
glPolygonMode(GL_BACK,(GLenum)_modeBack);
#else
OSG_NOTICE << "Warning: PolygonMode::apply(State&) - only GL_FRONT_AND_BACK is supported." << std::endl;
#endif
}
#else
OSG_NOTICE<<"Warning: PolygonMode::apply(State&) - not supported."<<std::endl;
OSG_NOTICE << "Warning: PolygonMode::apply(State&) - is not supported." << std::endl;
#endif
}

View File

@@ -515,8 +515,8 @@ const Program::UniformBlockMap& Program::getUniformBlocks(unsigned contextID) co
Program::PerContextProgram::PerContextProgram(const Program* program, unsigned int contextID, GLuint programHandle ) :
osg::Referenced(),
_loadedBinary(false),
_glProgramHandle(programHandle),
_loadedBinary(false),
_contextID( contextID ),
_ownsProgramHandle(false)
{
@@ -674,7 +674,7 @@ void Program::PerContextProgram::linkProgram(osg::State& state)
_extensions->glGetProgramiv(_glProgramHandle, GL_ACTIVE_UNIFORM_BLOCKS,
reinterpret_cast<GLint*>(&activeUniformBlocks));
_extensions->glGetProgramiv(_glProgramHandle,
GL_ACTIVE_UNIFORM_MAX_LENGTH,
GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH,
&maxBlockNameLen);
if (maxBlockNameLen > 0)
{

View File

@@ -402,7 +402,7 @@ int Sequence::_getNextValue()
int _sbegin = osg::minimum(_ubegin,_uend);
int _send = osg::maximum(_ubegin,_uend);
int v = _value + _step;
int v = _value + _step * static_cast<int>(osg::sign(_speed));
if (_sbegin==_send)
{

View File

@@ -134,25 +134,10 @@ State::~State()
//_texCoordArrayList.clear();
//_vertexAttribArrayList.clear();
// OSG_NOTICE<<"State::~State()"<<this<<std::endl;
for(AppliedProgramObjectSet::iterator itr = _appliedProgramObjectSet.begin();
itr != _appliedProgramObjectSet.end();
++itr)
{
(*itr)->removeObserver(this);
}
}
void State::objectDeleted(void* object)
{
const Program::PerContextProgram* ppcp = reinterpret_cast<const Program::PerContextProgram*>(object);
AppliedProgramObjectSet::iterator itr = _appliedProgramObjectSet.find(ppcp);
if (itr != _appliedProgramObjectSet.end())
{
// OSG_NOTICE<<"Removing _appliedProgramObjectSet entry "<<ppcp<<std::endl;
_appliedProgramObjectSet.erase(itr);
}
}
void State::reset()
@@ -239,17 +224,6 @@ void State::reset()
_lastAppliedProgramObject = 0;
for(AppliedProgramObjectSet::iterator apitr=_appliedProgramObjectSet.begin();
apitr!=_appliedProgramObjectSet.end();
++apitr)
{
(*apitr)->resetAppliedUniforms();
(*apitr)->removeObserver(this);
}
_appliedProgramObjectSet.clear();
// what about uniforms??? need to clear them too...
// go through all active Unfirom's, setting to change to force update,
// the idea is to leave only the global defaults left.
@@ -484,12 +458,18 @@ void State::apply(const StateSet* dstate)
else if (unit<_textureAttributeMapList.size()) applyAttributeMapOnTexUnit(unit,_textureAttributeMapList[unit]);
}
const Program::PerContextProgram* previousLastAppliedProgramObject = _lastAppliedProgramObject;
applyModeList(_modeMap,dstate->getModeList());
applyAttributeList(_attributeMap,dstate->getAttributeList());
if (_shaderCompositionEnabled)
{
applyShaderComposition();
if (previousLastAppliedProgramObject == _lastAppliedProgramObject || _lastAppliedProgramObject==0)
{
// No program has been applied by the StateSet stack so assume shader composition is required
applyShaderComposition();
}
}
if (dstate->getUniformList().empty())
@@ -911,7 +891,10 @@ void State::initializeExtensionProcs()
if ( osg::getGLVersionNumber() >= 2.0 || osg::isGLExtensionSupported(_contextID,"GL_ARB_vertex_shader") || OSG_GLES2_FEATURES)
{
glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS,&_glMaxTextureUnits);
glGetIntegerv(GL_MAX_TEXTURE_COORDS,&_glMaxTextureCoords);
if(OSG_GLES2_FEATURES)
_glMaxTextureCoords = _glMaxTextureUnits;
else
glGetIntegerv(GL_MAX_TEXTURE_COORDS,&_glMaxTextureCoords);
}
else if ( osg::getGLVersionNumber() >= 1.3 ||
osg::isGLExtensionSupported(_contextID,"GL_ARB_multitexture") ||
@@ -1322,6 +1305,9 @@ namespace State_Utils
{
bool replace(std::string& str, const std::string& original_phrase, const std::string& new_phrase)
{
// Prevent infinite loop : if original_phrase is empty, do nothing and return false
if (original_phrase.empty()) return false;
bool replacedStr = false;
std::string::size_type pos = 0;
while((pos=str.find(original_phrase, pos))!=std::string::npos)
@@ -1360,9 +1346,6 @@ bool State::convertVertexShaderSourceToOsgBuiltIns(std::string& source) const
OSG_INFO<<"++Before Converted source "<<std::endl<<source<<std::endl<<"++++++++"<<std::endl;
// replace ftransform as it only works with built-ins
State_Utils::replace(source, "ftransform()", "gl_ModelViewProjectionMatrix * gl_Vertex");
// find the first legal insertion point for replacement declarations. GLSL requires that nothing
// precede a "#verson" compiler directive, so we must insert new declarations after it.
std::string::size_type declPos = source.rfind( "#version " );
@@ -1377,22 +1360,31 @@ bool State::convertVertexShaderSourceToOsgBuiltIns(std::string& source) const
declPos = 0;
}
State_Utils::replaceAndInsertDeclaration(source, declPos, _vertexAlias._glName, _vertexAlias._osgName, _vertexAlias._declaration);
State_Utils::replaceAndInsertDeclaration(source, declPos, _normalAlias._glName, _normalAlias._osgName, _normalAlias._declaration);
State_Utils::replaceAndInsertDeclaration(source, declPos, _colorAlias._glName, _colorAlias._osgName, _colorAlias._declaration);
State_Utils::replaceAndInsertDeclaration(source, declPos, _secondaryColorAlias._glName, _secondaryColorAlias._osgName, _secondaryColorAlias._declaration);
State_Utils::replaceAndInsertDeclaration(source, declPos, _fogCoordAlias._glName, _fogCoordAlias._osgName, _fogCoordAlias._declaration);
for (size_t i=0; i<_texCoordAliasList.size(); i++)
if (_useModelViewAndProjectionUniforms)
{
const VertexAttribAlias& texCoordAlias = _texCoordAliasList[i];
State_Utils::replaceAndInsertDeclaration(source, declPos, texCoordAlias._glName, texCoordAlias._osgName, texCoordAlias._declaration);
// replace ftransform as it only works with built-ins
State_Utils::replace(source, "ftransform()", "gl_ModelViewProjectionMatrix * gl_Vertex");
// replace built in uniform
State_Utils::replaceAndInsertDeclaration(source, declPos, "gl_ModelViewMatrix", "osg_ModelViewMatrix", "uniform mat4 ");
State_Utils::replaceAndInsertDeclaration(source, declPos, "gl_ModelViewProjectionMatrix", "osg_ModelViewProjectionMatrix", "uniform mat4 ");
State_Utils::replaceAndInsertDeclaration(source, declPos, "gl_ProjectionMatrix", "osg_ProjectionMatrix", "uniform mat4 ");
State_Utils::replaceAndInsertDeclaration(source, declPos, "gl_NormalMatrix", "osg_NormalMatrix", "uniform mat3 ");
}
// replace built in uniform
State_Utils::replaceAndInsertDeclaration(source, declPos, "gl_ModelViewMatrix", "osg_ModelViewMatrix", "uniform mat4 ");
State_Utils::replaceAndInsertDeclaration(source, declPos, "gl_ModelViewProjectionMatrix", "osg_ModelViewProjectionMatrix", "uniform mat4 ");
State_Utils::replaceAndInsertDeclaration(source, declPos, "gl_ProjectionMatrix", "osg_ProjectionMatrix", "uniform mat4 ");
State_Utils::replaceAndInsertDeclaration(source, declPos, "gl_NormalMatrix", "osg_NormalMatrix", "uniform mat3 ");
if (_useVertexAttributeAliasing)
{
State_Utils::replaceAndInsertDeclaration(source, declPos, _vertexAlias._glName, _vertexAlias._osgName, _vertexAlias._declaration);
State_Utils::replaceAndInsertDeclaration(source, declPos, _normalAlias._glName, _normalAlias._osgName, _normalAlias._declaration);
State_Utils::replaceAndInsertDeclaration(source, declPos, _colorAlias._glName, _colorAlias._osgName, _colorAlias._declaration);
State_Utils::replaceAndInsertDeclaration(source, declPos, _secondaryColorAlias._glName, _secondaryColorAlias._osgName, _secondaryColorAlias._declaration);
State_Utils::replaceAndInsertDeclaration(source, declPos, _fogCoordAlias._glName, _fogCoordAlias._osgName, _fogCoordAlias._declaration);
for (size_t i=0; i<_texCoordAliasList.size(); i++)
{
const VertexAttribAlias& texCoordAlias = _texCoordAliasList[i];
State_Utils::replaceAndInsertDeclaration(source, declPos, texCoordAlias._glName, texCoordAlias._osgName, texCoordAlias._declaration);
}
}
OSG_INFO<<"-------- Converted source "<<std::endl<<source<<std::endl<<"----------------"<<std::endl;
@@ -1698,15 +1690,6 @@ void State::print(std::ostream& fout) const
}
fout<<"}"<<std::endl;
#if 0
TextureModeMapList _textureModeMapList;
TextureAttributeMapList _textureAttributeMapList;
AppliedProgramObjectSet _appliedProgramObjectSet;
const Program::PerContextProgram* _lastAppliedProgramObject;
#endif
fout<<"StateSetStack _stateSetStack {"<<std::endl;
for(StateSetStack::const_iterator itr = _stateStateStack.begin();
itr != _stateStateStack.end();

View File

@@ -54,6 +54,7 @@ class TextureGLModeSet
_textureModeSet.insert(GL_TEXTURE_CUBE_MAP);
_textureModeSet.insert(GL_TEXTURE_RECTANGLE_NV);
_textureModeSet.insert(GL_TEXTURE_2D_ARRAY_EXT);
_textureModeSet.insert(GL_TEXTURE_2D_MULTISAMPLE);
_textureModeSet.insert(GL_TEXTURE_GEN_Q);
_textureModeSet.insert(GL_TEXTURE_GEN_R);
@@ -274,6 +275,32 @@ int StateSet::compare(const StateSet& rhs,bool compareAttributeContents) const
if (_textureAttributeList.size()<rhs._textureAttributeList.size()) return -1;
if (_textureAttributeList.size()>rhs._textureAttributeList.size()) return 1;
if (_textureModeList.size()<rhs._textureModeList.size()) return -1;
if (_textureModeList.size()>rhs._textureModeList.size()) return 1;
if (_attributeList.size()<rhs._attributeList.size()) return -1;
if (_attributeList.size()>rhs._attributeList.size()) return 1;
if (_modeList.size()<rhs._modeList.size()) return -1;
if (_modeList.size()>rhs._modeList.size()) return 1;
if (_uniformList.size()<rhs._uniformList.size()) return -1;
if (_uniformList.size()>rhs._uniformList.size()) return 1;
// check render bin details
if ( _binMode < rhs._binMode ) return -1;
else if ( _binMode > rhs._binMode ) return 1;
if ( _binMode != INHERIT_RENDERBIN_DETAILS )
{
if ( _binNum < rhs._binNum ) return -1;
else if ( _binNum > rhs._binNum ) return 1;
if ( _binName < rhs._binName ) return -1;
else if ( _binName > rhs._binName ) return 1;
}
for(unsigned int ai=0;ai<_textureAttributeList.size();++ai)
{
const AttributeList& rhs_attributeList = _textureAttributeList[ai];
@@ -373,10 +400,6 @@ int StateSet::compare(const StateSet& rhs,bool compareAttributeContents) const
// we've got here so attributes must be equal...
if (_textureModeList.size()<rhs._textureModeList.size()) return -1;
if (_textureModeList.size()>rhs._textureModeList.size()) return 1;
// check to see how the modes compare.
// first check the rest of the texture modes
for(unsigned int ti=0;ti<_textureModeList.size();++ti)
@@ -441,20 +464,6 @@ int StateSet::compare(const StateSet& rhs,bool compareAttributeContents) const
}
else if (rhs_uniform_itr == rhs._uniformList.end()) return 1;
// check render bin details
if ( _binMode < rhs._binMode ) return -1;
else if ( _binMode > rhs._binMode ) return 1;
if ( _binMode != INHERIT_RENDERBIN_DETAILS )
{
if ( _binNum < rhs._binNum ) return -1;
else if ( _binNum > rhs._binNum ) return 1;
if ( _binName < rhs._binName ) return -1;
else if ( _binName > rhs._binName ) return 1;
}
return 0;
}

View File

@@ -2351,7 +2351,7 @@ bool Texture::isHardwareMipmapGenerationEnabled(const State& state) const
const FBOExtensions* fbo_ext = FBOExtensions::instance(contextID,true);
if (fbo_ext->glGenerateMipmap)
if (fbo_ext->isSupported() && fbo_ext->glGenerateMipmap)
{
return true;
}
@@ -2368,7 +2368,8 @@ Texture::GenerateMipmapMode Texture::mipmapBeforeTexImage(const State& state, bo
return GENERATE_MIPMAP;
#else
bool useGenerateMipMap = FBOExtensions::instance(state.getContextID(), true)->glGenerateMipmap!=0;
FBOExtensions* fbo_ext = FBOExtensions::instance(state.getContextID(),true);
bool useGenerateMipMap = fbo_ext->isSupported() && fbo_ext->glGenerateMipmap;
if (useGenerateMipMap)
{
@@ -2440,7 +2441,7 @@ void Texture::generateMipmap(State& state) const
osg::FBOExtensions* fbo_ext = osg::FBOExtensions::instance(state.getContextID(), true);
// check if the function is supported
if (fbo_ext->glGenerateMipmap)
if (fbo_ext->isSupported() && fbo_ext->glGenerateMipmap)
{
textureObject->bind();
fbo_ext->glGenerateMipmap(textureObject->target());

View File

@@ -32,15 +32,16 @@ Texture2DArray::Texture2DArray(const Texture2DArray& text,const CopyOp& copyop):
Texture(text,copyop),
_textureWidth(text._textureWidth),
_textureHeight(text._textureHeight),
_textureDepth(text._textureDepth),
_textureDepth(0),
_numMipmapLevels(text._numMipmapLevels),
_subloadCallback(text._subloadCallback)
{
setTextureDepth(text._textureDepth);
// copy all images by iterating through all of them
for (int i=0; i < text._textureDepth; i++)
{
setImage(i, copyop(text._images[i].get()));
_modifiedCount.push_back(ImageModifiedCount());
}
}
@@ -249,7 +250,7 @@ void Texture2DArray::apply(State& state) const
// compute the dimensions of the texture.
computeRequiredTextureDimensions(state, *image, new_width, new_height, new_numMipmapLevels);
if (!textureObject->match(GL_TEXTURE_2D_ARRAY_EXT, new_numMipmapLevels, _internalFormat, new_width, new_height, 1, _borderWidth))
if (!textureObject->match(GL_TEXTURE_2D_ARRAY_EXT, new_numMipmapLevels, _internalFormat, new_width, new_height, _textureDepth, _borderWidth))
{
Texture::releaseTextureObject(contextID, _textureObjectBuffer[contextID].get());
_textureObjectBuffer[contextID] = 0;

View File

@@ -48,14 +48,15 @@ TransferFunction1D::TransferFunction1D(const TransferFunction1D& tf, const CopyO
TransferFunction(tf,copyop)
{
allocate(tf.getNumberImageCells());
assign(_colorMap);
assign(tf._colorMap);
}
void TransferFunction1D::allocate(unsigned int numX)
{
_image = new osg::Image;
_image->allocateImage(numX,1,1,GL_RGBA, GL_FLOAT);
if (!_colorMap.empty()) assign(_colorMap);
updateImage();
}
void TransferFunction1D::clear(const osg::Vec4& color)
@@ -177,7 +178,7 @@ osg::Vec4 TransferFunction1D::getColor(float v) const
void TransferFunction1D::assign(const ColorMap& newColours)
{
_colorMap = newColours;
if (&_colorMap != &newColours) _colorMap = newColours;
updateImage();
}

View File

@@ -2153,7 +2153,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix2& m2 ) const
{
if( index>=getNumElements() || !isCompatibleType(FLOAT_MAT2) ) return false;
unsigned int j = index * getTypeNumComponents(getType());
m2.base_class::set( &((*_floatArray)[j]) );
m2.Matrix2::base_class::set( &((*_floatArray)[j]) );
return true;
}
@@ -2161,7 +2161,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix3& m3 ) const
{
if( index>=getNumElements() || !isCompatibleType(FLOAT_MAT3) ) return false;
unsigned int j = index * getTypeNumComponents(getType());
m3.base_class::set( &((*_floatArray)[j]) );
m3.Matrix3::base_class::set( &((*_floatArray)[j]) );
return true;
}
@@ -2177,7 +2177,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix2x3& m2x3 ) const
{
if( index>=getNumElements() || !isCompatibleType(FLOAT_MAT2x3) ) return false;
unsigned int j = index * getTypeNumComponents(getType());
m2x3.base_class::set( &((*_floatArray)[j]) );
m2x3.Matrix2x3::base_class::set( &((*_floatArray)[j]) );
return true;
}
@@ -2185,7 +2185,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix2x4& m2x4 ) const
{
if( index>=getNumElements() || !isCompatibleType(FLOAT_MAT2x4) ) return false;
unsigned int j = index * getTypeNumComponents(getType());
m2x4.base_class::set( &((*_floatArray)[j]) );
m2x4.Matrix2x4::base_class::set( &((*_floatArray)[j]) );
return true;
}
@@ -2193,7 +2193,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix3x2& m3x2 ) const
{
if( index>=getNumElements() || !isCompatibleType(FLOAT_MAT3x2) ) return false;
unsigned int j = index * getTypeNumComponents(getType());
m3x2.base_class::set( &((*_floatArray)[j]) );
m3x2.Matrix3x2::base_class::set( &((*_floatArray)[j]) );
return true;
}
@@ -2201,7 +2201,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix3x4& m3x4 ) const
{
if( index>=getNumElements() || !isCompatibleType(FLOAT_MAT3x4) ) return false;
unsigned int j = index * getTypeNumComponents(getType());
m3x4.base_class::set( &((*_floatArray)[j]) );
m3x4.Matrix3x4::base_class::set( &((*_floatArray)[j]) );
return true;
}
@@ -2209,7 +2209,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix4x2& m4x2 ) const
{
if( index>=getNumElements() || !isCompatibleType(FLOAT_MAT4x2) ) return false;
unsigned int j = index * getTypeNumComponents(getType());
m4x2.base_class::set( &((*_floatArray)[j]) );
m4x2.Matrix4x2::base_class::set( &((*_floatArray)[j]) );
return true;
}
@@ -2217,7 +2217,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix4x3& m4x3 ) const
{
if( index>=getNumElements() || !isCompatibleType(FLOAT_MAT4x3) ) return false;
unsigned int j = index * getTypeNumComponents(getType());
m4x3.base_class::set( &((*_floatArray)[j]) );
m4x3.Matrix4x3::base_class::set( &((*_floatArray)[j]) );
return true;
}
@@ -2263,7 +2263,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix2d& m2 ) const
{
if( index>=getNumElements() || !isCompatibleType(DOUBLE_MAT2) ) return false;
unsigned int j = index * getTypeNumComponents(getType());
m2.base_class::set( &((*_doubleArray)[j]) );
m2.Matrix2d::base_class::set( &((*_doubleArray)[j]) );
return true;
}
@@ -2271,7 +2271,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix3d& m3 ) const
{
if( index>=getNumElements() || !isCompatibleType(DOUBLE_MAT3) ) return false;
unsigned int j = index * getTypeNumComponents(getType());
m3.base_class::set( &((*_doubleArray)[j]) );
m3.Matrix3d::base_class::set( &((*_doubleArray)[j]) );
return true;
}
@@ -2291,7 +2291,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix2x3d& m2x3 ) const
{
if( index>=getNumElements() || !isCompatibleType(DOUBLE_MAT2x3) ) return false;
unsigned int j = index * getTypeNumComponents(getType());
m2x3.base_class::set( &((*_doubleArray)[j]) );
m2x3.Matrix2x3d::base_class::set( &((*_doubleArray)[j]) );
return true;
}
@@ -2299,7 +2299,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix2x4d& m2x4 ) const
{
if( index>=getNumElements() || !isCompatibleType(DOUBLE_MAT2x4) ) return false;
unsigned int j = index * getTypeNumComponents(getType());
m2x4.base_class::set( &((*_doubleArray)[j]) );
m2x4.Matrix2x4d::base_class::set( &((*_doubleArray)[j]) );
return true;
}
@@ -2307,7 +2307,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix3x2d& m3x2 ) const
{
if( index>=getNumElements() || !isCompatibleType(DOUBLE_MAT3x2) ) return false;
unsigned int j = index * getTypeNumComponents(getType());
m3x2.base_class::set( &((*_doubleArray)[j]) );
m3x2.Matrix3x2d::base_class::set( &((*_doubleArray)[j]) );
return true;
}
@@ -2315,7 +2315,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix3x4d& m3x4 ) const
{
if( index>=getNumElements() || !isCompatibleType(DOUBLE_MAT3x4) ) return false;
unsigned int j = index * getTypeNumComponents(getType());
m3x4.base_class::set( &((*_doubleArray)[j]) );
m3x4.Matrix3x4d::base_class::set( &((*_doubleArray)[j]) );
return true;
}
@@ -2323,7 +2323,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix4x2d& m4x2 ) const
{
if( index>=getNumElements() || !isCompatibleType(DOUBLE_MAT4x2) ) return false;
unsigned int j = index * getTypeNumComponents(getType());
m4x2.base_class::set( &((*_doubleArray)[j]) );
m4x2.Matrix4x2d::base_class::set( &((*_doubleArray)[j]) );
return true;
}
@@ -2331,7 +2331,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix4x3d& m4x3 ) const
{
if( index>=getNumElements() || !isCompatibleType(DOUBLE_MAT4x3) ) return false;
unsigned int j = index * getTypeNumComponents(getType());
m4x3.base_class::set( &((*_doubleArray)[j]) );
m4x3.Matrix4x3d::base_class::set( &((*_doubleArray)[j]) );
return true;
}

View File

@@ -150,4 +150,4 @@ const GLubyte* gluErrorString(GLenum errorCode)
return (const GLubyte *) 0;
}
} // end of namespace osg
} // end of namespace osg

View File

@@ -908,10 +908,11 @@ static void halveImage_uint(GLint components, GLuint width, GLuint height,
for (j = 0; j < newwidth; j++) {
for (k = 0; k < components; k++) {
/* need to cast to double to hold large unsigned ints */
s[0] = ((double)*(const GLuint*)t +
(double)*(const GLuint*)(t+group_size) +
(double)*(const GLuint*)(t+ysize) +
(double)*(const GLuint*)(t+ysize+group_size))/4 + 0.5;
GLdouble buf = (double)*(const GLuint*)t +
(double)*(const GLuint*)(t+group_size) +
(double)*(const GLuint*)(t+ysize) +
(double)*(const GLuint*)(t+ysize+group_size);
s[0] = (GLuint)(buf/4.0 + 0.5);
s++; t += element_size;
}
@@ -925,12 +926,11 @@ static void halveImage_uint(GLint components, GLuint width, GLuint height,
for (j = 0; j < newwidth; j++) {
for (k = 0; k < components; k++) {
/* need to cast to double to hold large unsigned ints */
GLdouble buf;
buf = (GLdouble)__GLU_SWAP_4_BYTES(t) +
(GLdouble)__GLU_SWAP_4_BYTES(t+group_size) +
(GLdouble)__GLU_SWAP_4_BYTES(t+ysize) +
(GLdouble)__GLU_SWAP_4_BYTES(t+ysize+group_size);
s[0] = (GLuint)(buf/4 + 0.5);
GLdouble buf = (GLdouble)__GLU_SWAP_4_BYTES(t) +
(GLdouble)__GLU_SWAP_4_BYTES(t+group_size) +
(GLdouble)__GLU_SWAP_4_BYTES(t+ysize) +
(GLdouble)__GLU_SWAP_4_BYTES(t+ysize+group_size);
s[0] = (GLuint)(buf/4.0 + 0.5);
s++; t += element_size;
}

View File

@@ -107,7 +107,13 @@ bool Animation::update (double time, int priority)
{
case ONCE:
if (t > _originalDuration)
{
for (ChannelList::const_iterator chan = _channels.begin();
chan != _channels.end(); ++chan)
(*chan)->update(_originalDuration, _weight, priority);
return false;
}
break;
case STAY:
if (t > _originalDuration)

View File

@@ -41,7 +41,7 @@ void LinkVisitor::link(AnimationUpdateCallbackBase* cb)
result += cb->link(_animations[i].get());
_nbLinkedTarget += result;
}
OSG_NOTICE << "LinkVisitor links " << result << " for \"" << cb->getName() << '"' << std::endl;
OSG_DEBUG << "LinkVisitor links " << result << " for \"" << cb->getName() << '"' << std::endl;
}
void LinkVisitor::handle_stateset(osg::StateSet* stateset)

View File

@@ -109,7 +109,7 @@ void RigGeometry::buildVertexInfluenceSet()
_vertexInfluenceSet.buildVertex2BoneList();
_vertexInfluenceSet.buildUniqVertexSetToBoneSetList();
OSG_NOTICE << "uniq groups " << _vertexInfluenceSet.getUniqVertexSetToBoneSetList().size() << " for " << getName() << std::endl;
OSG_DEBUG << "uniq groups " << _vertexInfluenceSet.getUniqVertexSetToBoneSetList().size() << " for " << getName() << std::endl;
}
void RigGeometry::computeMatrixFromRootSkeleton()

View File

@@ -152,7 +152,7 @@ RigTransformHardware::BoneWeightAttribList RigTransformHardware::createVertexAtt
arrayList.resize(nbArray);
for (int i = 0; i < nbArray; i++)
{
osg::ref_ptr<osg::Vec4Array> array = new osg::Vec4Array;
osg::ref_ptr<osg::Vec4Array> array = new osg::Vec4Array(osg::Array::BIND_PER_VERTEX);
arrayList[i] = array;
int nbVertexes = getNumVertexes();
array->resize(nbVertexes);

View File

@@ -18,8 +18,7 @@ using namespace osgAnimation;
StackedTransform::StackedTransform() {}
StackedTransform::StackedTransform(const StackedTransform& rhs, const osg::CopyOp& co):
osg::MixinVector<osg::ref_ptr<StackedTransformElement> >(rhs)
StackedTransform::StackedTransform(const StackedTransform& rhs, const osg::CopyOp& co)
{
reserve(rhs.size());
for (StackedTransform::const_iterator it = rhs.begin(); it != rhs.end(); ++it)

View File

@@ -7,7 +7,7 @@ IF (DYNAMIC_OPENSCENEGRAPH)
IF(OSG_PLUGIN_SEARCH_INSTALL_DIR_FOR_PLUGINS)
# Add a default plugin search path component
ADD_DEFINITIONS(-DOSG_DEFAULT_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib${LIB_POSTFIX}/${OSG_PLUGINS})
ADD_DEFINITIONS(-DOSG_DEFAULT_LIBRARY_PATH=\"${CMAKE_INSTALL_PREFIX}/lib${LIB_POSTFIX}/${OSG_PLUGINS}\")
ENDIF()
# Set the library extension according to what configuration is being built.
@@ -124,7 +124,7 @@ SET(TARGET_SRC
IF(APPLE AND NOT ANDROID)
IF(NOT OSG_BUILD_PLATFORM_IPHONE AND NOT OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
# Needs CoreFoundation calls and a Carbon function
SET(OSGDB_PLATFORM_SPECIFIC_LIBRARIES ${CARBON_LIBRARY})
SET(OSGDB_PLATFORM_SPECIFIC_LIBRARIES ${CARBON_LIBRARY} ${COCOA_LIBRARY})
ENDIF()
IF(OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX STREQUAL "quicktime")

View File

@@ -209,8 +209,13 @@ bool osgDB::makeDirectory( const std::string &path )
if( mkdir( dir.c_str(), 0755 )< 0 )
#endif
{
OSG_DEBUG << "osgDB::makeDirectory(): " << strerror(errno) << std::endl;
return false;
// Only return an error if the directory actually doesn't exist. It's possible that the directory was created
// by another thread or process
if (!osgDB::fileExists(dir))
{
OSG_DEBUG << "osgDB::makeDirectory(): " << strerror(errno) << std::endl;
return false;
}
}
paths.pop();
}
@@ -500,7 +505,7 @@ static void appendInstallationLibraryFilePaths(osgDB::FilePathList& filepath)
#ifdef OSG_DEFAULT_LIBRARY_PATH
// Append the install prefix path to the library search path if configured
filepath.push_back(ADDQUOTES(OSG_DEFAULT_LIBRARY_PATH));
filepath.push_back(OSG_DEFAULT_LIBRARY_PATH);
#endif
}

View File

@@ -639,7 +639,7 @@ osg::Image* InputStream::readImage(bool readFromExternal)
image = new osg::Image;
image->setOrigin( (osg::Image::Origin)origin );
image->setImage( s, t, r, internalFormat, pixelFormat, dataType,
(unsigned char*)data, (osg::Image::AllocationMode)mode, packing );
(unsigned char*)data, osg::Image::USE_NEW_DELETE, packing );
}
// _mipmapData

View File

@@ -379,6 +379,9 @@ ObjectWrapperManager::ObjectWrapperManager()
glTable.add( "GL_LIGHT6", GL_LIGHT6 );
glTable.add( "GL_LIGHT7", GL_LIGHT7 );
glTable.add("GL_VERTEX_PROGRAM_POINT_SIZE", GL_VERTEX_PROGRAM_POINT_SIZE);
glTable.add("GL_VERTEX_PROGRAM_TWO_SIDE", GL_VERTEX_PROGRAM_TWO_SIDE);
// Functions
glTable.add( "NEVER", GL_NEVER );
glTable.add( "LESS", GL_LESS );

View File

@@ -19,6 +19,7 @@
#include <osgDB/ObjectWrapper>
#include <fstream>
#include <sstream>
#include <stdlib.h>
using namespace osgDB;

View File

@@ -414,7 +414,7 @@ Registry::Registry()
addFileExtensionAlias("cid", "freetype"); // Postscript CID-Fonts
addFileExtensionAlias("cff", "freetype"); // OpenType
addFileExtensionAlias("cef", "freetype"); // OpenType
addFileExtensionAlias("fon", "freetype"); // Windows bitmap fonts
addFileExtensionAlias("fon", "freetype"); // Windows bitmap fonts
addFileExtensionAlias("fnt", "freetype"); // Windows bitmap fonts
addFileExtensionAlias("text3d", "freetype"); // use 3D Font instead of 2D Font
@@ -1040,7 +1040,7 @@ std::string Registry::findDataFileImplementation(const std::string& filename, co
if(fileExists(simpleFileName))
{
OSG_DEBUG << "FindFileInPath(" << filename << "): returning " << filename << std::endl;
OSG_DEBUG << "FindFileInPath(" << filename << "): returning " << simpleFileName << std::endl;
return simpleFileName;
}
@@ -1249,9 +1249,21 @@ ReaderWriter::ReadResult Registry::readImplementation(const ReadFunctor& readFun
ReaderWriter::ReadResult rr = read(readFunctor);
if (rr.validObject())
{
// update cache with new entry.
OSG_INFO<<"Adding to object cache "<<file<<std::endl;
addEntryToObjectCache(file,rr.getObject());
// search AGAIN for entry in the object cache.
{
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_objectCacheMutex);
ObjectCache::iterator oitr = _objectCache.find(file);
if (oitr != _objectCache.end())
{
OSG_INFO << "returning cached instanced of " << file << std::endl;
if (readFunctor.isValid(oitr->second.first.get())) return ReaderWriter::ReadResult(oitr->second.first.get(), ReaderWriter::ReadResult::FILE_LOADED_FROM_CACHE);
else return ReaderWriter::ReadResult("Error file does not contain an osg::Object");
}
// update cache with new entry.
OSG_INFO<<"Adding to object cache "<<file<<std::endl;
//addEntryToObjectCache(file,rr.getObject()); //copy implementation: we already have the _objectCacheMutex lock
_objectCache[file] = ObjectTimeStampPair(rr.getObject(), 0.0);
}
}
else
{

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