diff --git a/.gitignore b/.gitignore index f061be0e27d..f0ac01816d2 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,10 @@ doc/openthreads.doxyfile doc/OpenSceneGraphReferenceDocs/ doc/OpenThreadsReferenceDocs/ +doc/*.chm + +CMakeDoxyfile.in +CMakeDoxygenDefaults.cmake cmake_uninstall.cmake @@ -59,6 +63,10 @@ install_manifest*.txt *.out *.app +# Automatically generated Package files +packaging/cmake/* +configure/* + # Platform Specifics - auto generated files PlatformSpecifics/Windows/*.rc @@ -79,6 +87,10 @@ PlatformSpecifics/Windows/*.rc *.sdf *.opensdf +# Visual Studio - Cache/Options Directory +.vs/ +.vscode/* + #osx xcode DerivedData/ *.DS_Store diff --git a/.travis.yml b/.travis.yml index 9947007e640..35059926e1b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,8 +15,8 @@ matrix: dist: trusty language: cpp env: - - CMAKECMD_ARGS="-DBUILD_OSG_EXAMPLES=ON -DBUILD_OSG_PLUGINS_BY_DEFAULT=ON -DBUILD_OSG_APPLICATIONS=ON" - # - CMAKECMD_ARGS="-DBUILD_OSG_EXAMPLES=OFF -DBUILD_OSG_PLUGINS_BY_DEFAULT=ON -DBUILD_OSG_APPLICATIONS=ON" + # - CMAKECMD_ARGS="-DBUILD_OSG_EXAMPLES=ON -DBUILD_OSG_PLUGINS_BY_DEFAULT=ON -DBUILD_OSG_APPLICATIONS=ON" + - CMAKECMD_ARGS="-DBUILD_OSG_EXAMPLES=OFF -DBUILD_OSG_PLUGINS_BY_DEFAULT=ON -DBUILD_OSG_APPLICATIONS=ON" #- LLVM_VERSION=3.8 sudo: false cache: diff --git a/AUTHORS.txt b/AUTHORS.txt index 875fbf5aa81..b86141f6a4d 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -1,10 +1,11 @@ -OpenSceneGraph Library 3.5.11 +OpenSceneGraph Library 3.6.4 -569 Contributors: +570 Contributors: Firstname Surname ----------------- Robert Osfield +Don Burns Stephan Huber Paul Martz Laurens Voerman @@ -42,8 +43,8 @@ Chris Hanson Roland Smeenk Roger James Jeremy Moles -J.P. Delport Andy Skinner +J.P. Delport Magnus Kessler David Fries Tom Jolley @@ -176,7 +177,6 @@ John Ivar Gustav Haapalahti Erik den Dekker Emmanuel Roche -Don Burns Domenico Mangieri Daniel Larimer Colin Dunlop @@ -232,6 +232,7 @@ Dietmar Funck Colin Cochran Christian Ruzicka Christian Buchner +Chris Djali Charles Cole Blake Williams Björn Hein @@ -491,7 +492,6 @@ Hartmut Seichter Gunter Huber Gregory Jaegy Graeme Harkness -Github It Gian Lorenzetto George Papagiannakis Geoff Thu @@ -538,9 +538,10 @@ Christophe Herreman Christian Noon Christian Kaser Christian Ehrlicher +Chris White Chris McGlone -Chris Djali Carlos Garcea +Capostrophic Bryce Eldridge Bruno Herbelin Brian Keener diff --git a/CMakeLists.txt b/CMakeLists.txt index 5fc7b180733..c98408d84dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,13 +3,13 @@ # SET(OPENSCENEGRAPH_MAJOR_VERSION 3) SET(OPENSCENEGRAPH_MINOR_VERSION 6) -SET(OPENSCENEGRAPH_PATCH_VERSION 0) -SET(OPENSCENEGRAPH_SOVERSION 155) +SET(OPENSCENEGRAPH_PATCH_VERSION 5) +SET(OPENSCENEGRAPH_SOVERSION 162) # set to 0 when not a release candidate, non zero means that any generated # git tags will be treated as release candidates of given number -SET(OPENSCENEGRAPH_RELEASE_CANDIDATE 1) +SET(OPENSCENEGRAPH_RELEASE_CANDIDATE 0) set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE) set_property(GLOBAL PROPERTY USE_FOLDERS ON) @@ -26,25 +26,13 @@ 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} 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)) + if("${CMAKE_VERSION}" VERSION_GREATER 2.8.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} 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() - - # 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) - + # INTERPROCEDURAL_OPTIMIZATION is enforced when enabled. + # Allows passing -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON + cmake_policy(SET CMP0069 NEW) endif() IF(APPLE) @@ -56,6 +44,8 @@ IF(APPLE) OSG_OSX_VERSION "${OSG_OSX_VERSION}") ENDIF() +PROJECT(OpenSceneGraph) + # Set OSX architecture flags here, since they must be specified before # creating the actual OSG project. # Note that the CMAKE_OSX_* variables are not well documented in @@ -63,67 +53,77 @@ ENDIF() # See https://cmake.org/Bug/view.php?id=14695#c34953 # Additionally, OSG_WINDOWING_SYSTEM is set here for OSX since its # value is needed to find the correct version of OpenGL (X11 or Cocoa). -IF(APPLE AND NOT ANDROID) - # Here we check if the user specified IPhone SDK - # These options are formally defined later, but can also be specified - # by the user at the command line using the cmake -D switch - # Note that FORCE is used since the user will likely enable IPhone - # build via CMake GUI after already having configured once - IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR) - SET(OSG_WINDOWING_SYSTEM "IOS" CACHE STRING "Windowing system type for graphics window creation, options only IOS.") +IF(ANDROID) + SET(OSG_WINDOWING_SYSTEM "None" CACHE STRING "Windowing system type for graphics window creation; options: None.") +ELSEIF(WIN32 OR MINGW) + SET(OSG_WINDOWING_SYSTEM "Win32" CACHE STRING "Windowing system type for graphics window creation; options: Win32 or None.") +ELSEIF(APPLE) + # custom option to flag an iOS build + OPTION(OSG_BUILD_PLATFORM_IPHONE "Enable IPhoneSDK Device support" OFF) - #set iphone arch and flags taken from http://sites.google.com/site/michaelsafyan/coding/resources/how-to-guides/cross-compile-for-the-iphone/how-to-cross-compile-for-the-iphone-using-cmake IF(OSG_BUILD_PLATFORM_IPHONE) - IF(${IPHONE_VERSION_MIN} LESS "7.0") - SET(CMAKE_OSX_ARCHITECTURES "armv6;armv7" CACHE STRING "Build architectures for iOS" FORCE) - ELSE() - SET(CMAKE_OSX_ARCHITECTURES "armv7;armv7s;arm64" CACHE STRING "Build architectures for iOS" FORCE) - ENDIF() - ELSE() - #simulator uses i386 and x86_64 architectures - SET(CMAKE_OSX_ARCHITECTURES "i386;x86_64" CACHE STRING "Build architectures for iOS Simulator" FORCE) - ENDIF() + # set sdk and min versions + SET (IPHONE_SDKVER "10.2" CACHE STRING "IOS SDK-Version") + SET (IPHONE_VERSION_MIN "7.0" CACHE STRING "IOS minimum os version, use 7.0 or greater to get 64bit support") - #here we set the specific iphone sdk version. We can only set either device or simulator sdk. So if you want both you currently have to have two separate projects - SET(CMAKE_OSX_SYSROOT "${IPHONE_SDKROOT}" CACHE STRING "System root for iOS" FORCE) + # get full path to sdk from requested versions + SET (IPHONE_DEVROOT "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer") + SET (IPHONE_SDKROOT "${IPHONE_DEVROOT}/SDKs/iPhoneOS${IPHONE_SDKVER}.sdk") - ELSE() - # OSX >= 10.5 uses Cocoa windowing system, otherwise Carbon - IF(OSG_OSX_VERSION VERSION_LESS 10.5) - SET(OSG_WINDOWING_SYSTEM "Carbon" CACHE STRING "Windowing system type for graphics window creation, options Carbon, Cocoa or X11.") - ELSE() - SET(OSG_WINDOWING_SYSTEM "Cocoa" CACHE STRING "Windowing system type for graphics window creation, options Carbon, Cocoa or X11.") - ENDIF() + # optionally enable bitcode for the build + SET (IPHONE_ENABLE_BITCODE "NO" CACHE STRING "IOS Enable Bitcode") + + # seamless toggle between device and simulator + SET(CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphoneos;-iphonesimulator" CACHE STRING "Xcode effective platforms for iOS") + + # set deployment target to min version + SET(CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "${IPHONE_VERSION_MIN}" CACHE STRING "Xcode deployment target for iOS") + + # Set standard architectures + SET(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD)" CACHE STRING "Build architectures for iOS") - # Set defaults for Universal Binaries. We want 32-bit Intel/PPC on 10.4 - # and 32/64-bit Intel/PPC on >= 10.5. Anything <= 10.3 doesn't support. - # These are set the first time CMake is run, and can be changed by - # the user at any time. - IF(OSG_OSX_VERSION VERSION_GREATER 10.7) - # 64 Bit Works, i386,ppc is not supported any more - SET(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "Build architectures for OSX") - SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.8" CACHE STRING "Target OSX version") - ELSEIF(OSG_OSX_VERSION VERSION_EQUAL 10.7) - # 64 Bit Works, PPC is not supported any more - SET(CMAKE_OSX_ARCHITECTURES "i386;x86_64" CACHE STRING "Build architectures for OSX") - ELSEIF(OSG_OSX_VERSION VERSION_GREATER 10.4) - # 64-bit compiles are not supported with Carbon. - SET(CMAKE_OSX_ARCHITECTURES "ppc;i386" CACHE STRING "Build architectures for OSX") - SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.5" CACHE STRING "Target OSX version") - ELSEIF(OSG_OSX_VERSION VERSION_EQUAL 10.4) - # 64-bit compiles are not supported with Carbon. - SET(CMAKE_OSX_ARCHITECTURES "ppc;i386" CACHE STRING "Build architectures for OSX") ELSE() - # No Universal Binary support and SDK detection is too unreliable. - # Warn user and continue at their own peril. - MESSAGE(WARNING "OSX 10.3 and earlier not supported.") + # OSX >= 10.5 uses Cocoa windowing system, otherwise Carbon + IF(OSG_OSX_VERSION VERSION_LESS 10.5) + SET(OSG_WINDOWING_SYSTEM "Carbon" CACHE STRING "Windowing system type for graphics window creation; options: Carbon, Cocoa, X11 or None.") + SET(OSG_WINDOWING_SYSTEM_CARBON ON INTERNAL "use Carbon (apple; 32 bit only)") + ELSE() + SET(OSG_WINDOWING_SYSTEM "Cocoa" CACHE STRING "Windowing system type for graphics window creation; options: Carbon, Cocoa, X11 or None.") + ENDIF() + + # Set defaults for Universal Binaries. We want 32-bit Intel/PPC on 10.4 + # and 32/64-bit Intel/PPC on >= 10.5. Anything <= 10.3 doesn't support. + # These are set the first time CMake is run, and can be changed by + # the user at any time. + IF(OSG_OSX_VERSION VERSION_GREATER 10.7) + # 64 Bit Works, i386,ppc is not supported any more + SET(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "Build architectures for OSX") + SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.8" CACHE STRING "Target OSX version") + ELSEIF(OSG_OSX_VERSION VERSION_EQUAL 10.7) + # 64 Bit Works, PPC is not supported any more + SET(CMAKE_OSX_ARCHITECTURES "i386;x86_64" CACHE STRING "Build architectures for OSX") + ELSEIF(OSG_OSX_VERSION VERSION_GREATER 10.4) + # 64-bit compiles are not supported with Carbon. + SET(CMAKE_OSX_ARCHITECTURES "ppc;i386" CACHE STRING "Build architectures for OSX") + SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.5" CACHE STRING "Target OSX version") + ELSEIF(OSG_OSX_VERSION VERSION_EQUAL 10.4) + # 64-bit compiles are not supported with Carbon. + SET(CMAKE_OSX_ARCHITECTURES "ppc;i386" CACHE STRING "Build architectures for OSX") + ELSE() + # No Universal Binary support and SDK detection is too unreliable. + # Warn user and continue at their own peril. + MESSAGE(WARNING "OSX 10.3 and earlier not supported.") + ENDIF() ENDIF() - ENDIF() +ELSE() + SET(OSG_WINDOWING_SYSTEM "X11" CACHE STRING "Windowing system type for graphics window creation; options: X11 or None.") ENDIF() -PROJECT(OpenSceneGraph) +IF(OSG_WINDOWING_SYSTEM STREQUAL "None") + SET(OSG_WINDOWING_SYSTEM_NONE ON INTERNAL "No windowing system") +ENDIF() SET(OPENSCENEGRAPH_VERSION ${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION}) @@ -210,12 +210,12 @@ IF (OSG_MAINTAINER) ) ADD_CUSTOM_TARGET(branch-test - COMMAND echo ${GITCOMMAND} branch ${OPENSCENEGRAPH_BRANCH} -m ${BRANCH_MESSAGE} + COMMAND echo ${GITCOMMAND} branch ${OPENSCENEGRAPH_BRANCH} COMMAND echo ${GITCOMMAND} push origin ${OPENSCENEGRAPH_BRANCH} ) ADD_CUSTOM_TARGET(branch-run - COMMAND ${GITCOMMAND} branch ${OPENSCENEGRAPH_BRANCH} -m ${BRANCH_MESSAGE} + COMMAND ${GITCOMMAND} branch ${OPENSCENEGRAPH_BRANCH} COMMAND ${GITCOMMAND} push origin ${OPENSCENEGRAPH_BRANCH} ) @@ -233,40 +233,15 @@ ENDIF(OSG_MAINTAINER) IF(NOT ANDROID) IF(APPLE) - # Trying to get CMake to generate an XCode IPhone project, current efforts are to get iphoneos sdk 3.1 working - # Added option which needs manually setting to select the IPhone SDK for building. We can only have one of the below - # set to true. Should really have an OSG_BUILD_PLATFORM variable that we set to our desired platform - OPTION(OSG_BUILD_PLATFORM_IPHONE "Enable IPhoneSDK Device support" OFF) - OPTION(OSG_BUILD_PLATFORM_IPHONE_SIMULATOR "Enable IPhoneSDK Simulator support" OFF) - - IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR) - #you need to manually set the default sdk version here - SET (IPHONE_SDKVER "10.2" CACHE STRING "IOS SDK-Version") - SET (IPHONE_VERSION_MIN "7.0" CACHE STRING "IOS minimum os version, use 7.0 or greater to get 64bit support") - - #the below is taken from ogre, it states the gcc stuff needs to happen before PROJECT() is called. I've no clue if we even need it - # Force gcc <= 4.2 on iPhone - IF(IPHONE_VERSION_MIN LESS "6.0") - include(CMakeForceCompiler) - CMAKE_FORCE_C_COMPILER(llvm-gcc-4.2 GNU) - CMAKE_FORCE_CXX_COMPILER(llvm-gcc-4.2 GNU) - SET(GCC_THUMB_SUPPORT NO) - ENDIF() + IF(OSG_BUILD_PLATFORM_IPHONE) - #set either the device sdk or the simulator sdk. Can't find away to separate these in the same project - IF(OSG_BUILD_PLATFORM_IPHONE) - SET (IPHONE_DEVROOT "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer") - SET (IPHONE_SDKROOT "${IPHONE_DEVROOT}/SDKs/iPhoneOS${IPHONE_SDKVER}.sdk") - ELSE() - SET (IPHONE_DEVROOT "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer") - SET (IPHONE_SDKROOT "${IPHONE_DEVROOT}/SDKs/iPhoneSimulator${IPHONE_SDKVER}.sdk") - ENDIF() + # set the sdk path as our sysroot, if we set this before the project is defined cmake fails to build its test program + SET(CMAKE_OSX_SYSROOT "${IPHONE_SDKROOT}" CACHE STRING "System root for iOS" FORCE) - SET (IPHONE_ENABLE_BITCODE "NO" CACHE STRING "IOS Enable Bitcode") + # Set the path to OpenGL library + SET(OPENGL_gl_LIBRARY "${IPHONE_SDKROOT}/System/Library/Frameworks/OpenGLES.framework") - # Apple iOS: Find OpenGLES - FIND_LIBRARY(OPENGLES_LIBRARY OpenGLES) ELSE () FIND_LIBRARY(CARBON_LIBRARY Carbon) FIND_LIBRARY(COCOA_LIBRARY Cocoa) @@ -330,16 +305,16 @@ IF(UNIX AND NOT ANDROID) ENDIF() -INCLUDE_DIRECTORIES( - ${OpenSceneGraph_SOURCE_DIR}/include - ${OPENGL_INCLUDE_DIR} -) # Make the headers visible to everything IF(NOT ${PROJECT_BINARY_DIR} EQUAL ${PROJECT_SOURCE_DIR}) INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR}/include) ENDIF() +INCLUDE_DIRECTORIES(${OpenSceneGraph_SOURCE_DIR}/include/) + +INCLUDE_DIRECTORIES(SYSTEM ${OPENGL_INCLUDE_DIR}) + # Common global definitions #ADD_DEFINITIONS(-D) # Platform specific definitions @@ -384,7 +359,9 @@ IF(WIN32 AND NOT ANDROID) OPTION(MSVC_DISABLE_CHECKED_ITERATORS "Set to ON to disable Visual C++ checked iterators. If you do this you must ensure that every other project in your solution and all dependencies are compiled with _SECURE_SCL=0." OFF) MARK_AS_ADVANCED(MSVC_DISABLE_CHECKED_ITERATORS) IF(MSVC_DISABLE_CHECKED_ITERATORS) + ADD_DEFINITIONS(-D_ITERATOR_DEBUG_LEVEL=0) # this supercedes _SECURE_SCL and _HAS_ITERATOR_DEBUGGING in VS2010 and forward ADD_DEFINITIONS(-D_SECURE_SCL=0) + ADD_DEFINITIONS(-D_HAS_ITERATOR_DEBUGGING=0) ENDIF(MSVC_DISABLE_CHECKED_ITERATORS) OPTION(MSVC_USE_DEFAULT_STACK_SIZE "Set to ON to use the default Visual C++ stack size. CMake forces a high stack size by default, which can cause problems for applications with large number of threads." OFF) @@ -469,6 +446,9 @@ MARK_AS_ADVANCED(OSG_USE_FLOAT_BOUNDINGSPHERE) OPTION(OSG_USE_FLOAT_BOUNDINGBOX "Set to ON to build OpenSceneGraph with float BoundingBox instead of double." ON) MARK_AS_ADVANCED(OSG_USE_FLOAT_BOUNDINGBOX) +OPTION(OSG_USE_FLOAT_QUAT "Set to ON to build OpenSceneGraph with float Quat instead of double." OFF) +MARK_AS_ADVANCED(OSG_USE_FLOAT_QUAT) + IF (WIN32) OPTION(OSG_USE_UTF8_FILENAME "Set to ON to use a UTF8 locale for filenames instead of the default locale." OFF) MARK_AS_ADVANCED(OSG_USE_UTF8_FILENAME) @@ -530,6 +510,12 @@ ENDIF() OPTION(OSG_GL_LIBRARY_STATIC "Set to ON to statically link with OpenGL/GLES library." OFF) +IF (OSG_BUILD_PLATFORM_IPHONE OR ANDROID) + OPTION(OSG_TEXT_USE_FONTCONFIG "Set to ON to enable attempt to use FontConfig in osgText." OFF) +ELSE () + OPTION(OSG_TEXT_USE_FONTCONFIG "Set to OFF to disable attempt to use FontConfig in osgText." ON) +ENDIF () + # Map the OSG_GL*_AVAILABLE settings to OSG_GL_* settings IF (OSG_GLES2_AVAILABLE OR OSG_GLES3_AVAILABLE OR OSG_GL3_AVAILABLE) OPTION(OSG_GL_DISPLAYLISTS_AVAILABLE "Set to OFF to disable use of OpenGL display lists." OFF) @@ -559,7 +545,11 @@ ENDIF() # Map the OSG_GL*_AVAILABLE settings to OpenGL header settings +SET(DEFAULT_GL_CONTEXT_VERSION "1.0") IF (OSG_GL3_AVAILABLE) + + SET(DEFAULT_GL_CONTEXT_VERSION "3.3") + IF (APPLE) SET(OPENGL_HEADER1 "#include " CACHE STRING "#include<> line for OpenGL Header") SET(OPENGL_HEADER2 "#include " CACHE STRING "#include<> line for additional OpenGL Headers if required") @@ -572,7 +562,7 @@ IF (OSG_GL3_AVAILABLE) SET(OPENGL_HEADER1 "#include " CACHE STRING "#include<> line for OpenGL Header") SET(OPENGL_HEADER2 "" CACHE STRING "#include<> line for additional OpenGL Headers if required") ELSE() - SET(OPENGL_HEADER1 "#include " CACHE STRING "#include<> line for OpenGL Header") + SET(OPENGL_HEADER1 "#include " CACHE STRING "#include<> line for OpenGL Header") SET(OPENGL_HEADER2 "" CACHE STRING "#include<> line for additional OpenGL Headers if required") ENDIF() @@ -611,6 +601,8 @@ ELSE() ENDIF() ENDIF() +SET(OSG_GL_CONTEXT_VERSION ${DEFAULT_GL_CONTEXT_VERSION} CACHE STRING "GL Context String to pass when creaing graphics contexts") + IF (OSG_GL1_AVAILABLE) SET(OSG_GL1_FEATURES 1) ELSE() @@ -739,7 +731,9 @@ OPTION(BUILD_OSG_PLUGINS "Build OSG Plugins - Disable for compile testing exampl mark_as_advanced(BUILD_OSG_PLUGINS) ################################################################################ # 3rd Party Dependency Stuff -IF(WIN32 AND NOT ANDROID) +OPTION(OSG_FIND_3RD_PARTY_DEPS "Enable to search for Android or Windows dependencies in ./3rdparty" ON) + +IF(WIN32 AND NOT ANDROID AND OSG_FIND_3RD_PARTY_DEPS) INCLUDE(Find3rdPartyDependencies) ENDIF() @@ -750,7 +744,7 @@ OPTION(OSG_USE_LOCAL_LUA_SOURCE "Enable to use local Lua source when building th # you can use the following style of command line option when invoking Cmake (here illustrating ignoring PythonLibs) : # cmake -DCMAKE_DISABLE_FIND_PACKAGE_PythonLibs=1 . # -IF(ANDROID) +IF(ANDROID AND OSG_FIND_3RD_PARTY_DEPS) ANDROID_3RD_PARTY() ELSE() # Common to all platforms except android: @@ -763,8 +757,6 @@ ELSE() FIND_PACKAGE(COLLADA) FIND_PACKAGE(FBX) FIND_PACKAGE(ZLIB) - FIND_PACKAGE(Xine) - FIND_PACKAGE(OpenVRML) FIND_PACKAGE(GDAL) FIND_PACKAGE(GTA) FIND_PACKAGE(CURL) @@ -810,9 +802,7 @@ IF (BUILD_OSG_EXAMPLES AND NOT ANDROID) FIND_PACKAGE(FLTK) FIND_PACKAGE(FOX) - - SET(wxWidgets_USE_LIBS base core gl net) - FIND_PACKAGE(wxWidgets) + FIND_PACKAGE(wxWidgets COMPONENTS base core gl net) ENDIF(BUILD_OSG_EXAMPLES AND NOT ANDROID) @@ -831,7 +821,7 @@ ENDIF(BUILD_OSG_EXAMPLES AND NOT ANDROID) # Image readers/writers depend on 3rd party libraries except for OS X which # can use Quicktime. -IF(NOT ANDROID) +IF(NOT (ANDROID AND OSG_FIND_3RD_PARTY_DEPS)) IF(NOT APPLE) FIND_PACKAGE(GIFLIB) FIND_PACKAGE(JPEG) @@ -903,10 +893,26 @@ IF(CYGWIN) SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG") ENDIF() -IF(UNIX AND NOT WIN32 AND NOT APPLE) - IF(CMAKE_SIZEOF_VOID_P MATCHES "8") - SET(LIB_POSTFIX "64" CACHE STRING "suffix for 32/64 dir placement") - MARK_AS_ADVANCED(LIB_POSTFIX) +# Set OSG_INSTALL_LIBDIR to specify the installation directories of object code libraries +IF(DEFINED LIB_POSTFIX) + # Use LIB_POSTFIX if defined + SET(OSG_INSTALL_LIBDIR lib${LIB_POSTFIX}) +ELSE() + IF(CMAKE_VERSION VERSION_LESS "2.8.5") + IF(UNIX AND NOT WIN32 AND NOT APPLE) + IF(CMAKE_SIZEOF_VOID_P MATCHES "8") + SET(LIB_POSTFIX "64" CACHE STRING "suffix for 32/64 dir placement") + MARK_AS_ADVANCED(LIB_POSTFIX) + ENDIF() + ENDIF() + IF(NOT DEFINED LIB_POSTFIX) + SET(LIB_POSTFIX "") + ENDIF() + SET(OSG_INSTALL_LIBDIR lib${LIB_POSTFIX}) + ELSE() + # Use the GNU standard installation directories for CMake >= 2.8.5 + INCLUDE(GNUInstallDirs) + SET(OSG_INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR}) ENDIF() ENDIF() IF(NOT DEFINED LIB_POSTFIX) @@ -1117,41 +1123,15 @@ ENDIF() IF(APPLE AND NOT ANDROID) - #Here we check if the user specified IPhone SDK - IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR) - - #set iphone arch and flags taken from http://sites.google.com/site/michaelsafyan/coding/resources/how-to-guides/cross-compile-for-the-iphone/how-to-cross-compile-for-the-iphone-using-cmake - IF(OSG_BUILD_PLATFORM_IPHONE) - IF(${IPHONE_VERSION_MIN} LESS "7.0") - SET(CMAKE_OSX_ARCHITECTURES "armv6;armv7" CACHE STRING "Build architectures for iOS" FORCE) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mno-thumb -pipe -no-cpp-precomp" CACHE STRING "Flags used by the compiler during all build types." FORCE) - ELSE() - SET(CMAKE_OSX_ARCHITECTURES "armv7;armv7s;arm64" CACHE STRING "Build architectures for iOS" FORCE) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -no-cpp-precomp" CACHE STRING "Flags used by the compiler during all build types." FORCE) - ENDIF() - - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -miphoneos-version-min=${IPHONE_VERSION_MIN}" FORCE) - - ELSE() - #simulator uses i386 and x86_64 architectures - SET(CMAKE_OSX_ARCHITECTURES "i386;x86_64" CACHE STRING "Build architectures for iOS Simulator" FORCE) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mno-thumb -pipe -no-cpp-precomp" CACHE STRING "Flags used by the compiler during all build types." FORCE) - - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mios-simulator-version-min=${IPHONE_VERSION_MIN}" FORCE) - - ENDIF() - - #here we set the specific iphone sdk version. We can only set either device or simulator sdk. So if you want both you currently have to have two separate projects - SET(CMAKE_OSX_SYSROOT "${IPHONE_SDKROOT}" CACHE STRING "System root for iOS" FORCE) + IF(OSG_BUILD_PLATFORM_IPHONE) - #hack, force link to opengles - set(CMAKE_EXE_LINKER_FLAGS "-framework Foundation -framework OpenGLES") + # set osg window system to iOS + SET(OSG_WINDOWING_SYSTEM "IOS" CACHE STRING "Windowing system type for graphics window creation, options only IOS." FORCE) - #use the IPhone windowing system - SET(OSG_WINDOWING_SYSTEM "IOS" CACHE STRING "Forced IPhone windowing system on iOS" FORCE) + # set osg default image plugin SET(OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX "imageio" CACHE STRING "Forced imageio default image plugin for iOS" FORCE) - #I think this or similar will be required for IPhone apps + # ensure app bundles for example app OPTION(OSG_BUILD_APPLICATION_BUNDLES "Enable the building of applications and examples as OSX Bundles" ON) ELSE() @@ -1377,6 +1357,13 @@ IF(NOT OSG_CONFIG_HAS_BEEN_RUN_BEFORE) SET(OSG_CONFIG_HAS_BEEN_RUN_BEFORE 1 CACHE INTERNAL "Flag to track whether this is the first time running CMake or if CMake has been configured before") ENDIF() +#----------------------------------------------------------------------------- +# add clobber build target to clear all the non git registered files/directories +#----------------------------------------------------------------------------- +add_custom_target(clobber + COMMAND git clean -d -f -x +) + #----------------------------------------------------------------------------- ### uninstall target #----------------------------------------------------------------------------- @@ -1388,4 +1375,5 @@ ADD_CUSTOM_TARGET(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") # - +include(FeatureSummary) +feature_summary(WHAT ALL) diff --git a/CMakeModules/FindAsio.cmake b/CMakeModules/FindAsio.cmake index 433d5c73cc4..aca5f82d0be 100644 --- a/CMakeModules/FindAsio.cmake +++ b/CMakeModules/FindAsio.cmake @@ -15,8 +15,20 @@ FIND_PATH(ASIO_INCLUDE_DIR SET(ASIO_FOUND "NO") IF(ASIO_INCLUDE_DIR) - FIND_PACKAGE( Boost 1.37 ) - IF(Boost_FOUND) - SET(ASIO_FOUND "YES") - ENDIF() + + set(ASIO_VERSION_H ${ASIO_INCLUDE_DIR}/asio/version.hpp) + file(STRINGS ${ASIO_VERSION_H} AsioVersionLine REGEX "^#define ASIO_VERSION ") + string(REGEX MATCHALL "[0-9]+" AsioHeaderVersionMatches "${AsioVersionLine}") + list(GET AsioHeaderVersionMatches 0 AsioHeaderVersion) + + # check version is less than 1.14.0 otherwise API changes break build + if (${AsioHeaderVersion} LESS "101400") + FIND_PACKAGE( Boost 1.37 ) + IF(Boost_FOUND) + SET(ASIO_FOUND "YES") + ENDIF() + else() + message("ASIO not compatible") + endif() + ENDIF() diff --git a/CMakeModules/FindCOLLADA.cmake b/CMakeModules/FindCOLLADA.cmake index 8c9c2fc334f..7c7d2905327 100644 --- a/CMakeModules/FindCOLLADA.cmake +++ b/CMakeModules/FindCOLLADA.cmake @@ -25,11 +25,14 @@ ENDIF() IF(APPLE) SET(COLLADA_BUILDNAME "mac") - SET(COLLADA_BOOST_BUILDNAME ${COLLADA_BUILDNAME}) + SET(COLLADA_BOOST_BUILDNAME ${COLLADA_BUILDNAME}) ELSEIF(MINGW) SET(COLLADA_BUILDNAME "mingw") - SET(COLLADA_BOOST_BUILDNAME ${COLLADA_BUILDNAME}) -ELSEIF(MSVC_VERSION EQUAL 1900 OR MSVC_VERSION EQUAL 1910 ) + SET(COLLADA_BOOST_BUILDNAME ${COLLADA_BUILDNAME}) +ELSEIF((MSVC_VERSION GREATER 1910) OR (MSVC_VERSION EQUAL 1910)) + SET(COLLADA_BUILDNAME "vc14") + SET(COLLADA_BOOST_BUILDNAME "vc141") +ELSEIF(MSVC_VERSION EQUAL 1900) SET(COLLADA_BUILDNAME "vc14") SET(COLLADA_BOOST_BUILDNAME "vc140") ELSEIF(MSVC_VERSION EQUAL 1800) diff --git a/CMakeModules/FindFBX.cmake b/CMakeModules/FindFBX.cmake index 58e526c6219..6ffee2ceb6b 100644 --- a/CMakeModules/FindFBX.cmake +++ b/CMakeModules/FindFBX.cmake @@ -25,17 +25,22 @@ ELSEIF(MSVC10) SET(FBX_LIBDIR "vs2010") ELSEIF(MSVC11) SET(FBX_LIBDIR "vs2012") -ELSEIF(MSVC12 OR MSVC_VERSION==1800) +ELSEIF(MSVC_VERSION EQUAL 1800) SET(FBX_LIBDIR "vs2013") -ELSEIF(MSVC14 OR MSVC_VERSION>1900) +ELSEIF(MSVC_VERSION EQUAL 1900) SET(FBX_LIBDIR "vs2015") +ELSEIF(MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS 1920) + SET(FBX_LIBDIR "vs2017") +ELSEIF(MSVC_VERSION GREATER_EQUAL 1920 AND MSVC_VERSION LESS 1930) +# SET(FBX_LIBDIR "vs2019") # FBX doesn't have this yet as of version 2020.0.1 + SET(FBX_LIBDIR "vs2017") # Binary compatible with vs2019 ENDIF() IF(APPLE) # do nothing ELSEIF(CMAKE_CL_64) SET(FBX_LIBDIR ${FBX_LIBDIR}/x64) -ELSEIF(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_SIZEOF_VOID_P EQUAL 8) +ELSEIF(CMAKE_SIZEOF_VOID_P EQUAL 8) SET(FBX_LIBDIR ${FBX_LIBDIR}/x64) ELSE() SET(FBX_LIBDIR ${FBX_LIBDIR}/x86) @@ -53,6 +58,10 @@ ELSE() SET(FBX_LIBNAME "libfbxsdk") ELSE() SET(FBX_LIBNAME "libfbxsdk-md") + IF(WIN32) + SET(FBX_XML2_LIBNAME "libxml2-md") + SET(FBX_ZLIB_LIBNAME "zlib-md") + ENDIF() ENDIF() ENDIF() @@ -60,16 +69,41 @@ SET(FBX_LIBNAME_DEBUG ${FBX_LIBNAME}d) SET( FBX_SEARCH_PATHS $ENV{FBX_DIR} + "$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2020.0.1" + "$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2020.0.1" + "/Applications/Autodesk/FBX SDK/2020.0.1" + "$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2020.0" + "$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2020.0" + "/Applications/Autodesk/FBX SDK/2020.0" + "$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2019.5" + "$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2019.5" + "/Applications/Autodesk/FBX SDK/2019.5" + "$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2019.2" + "$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2019.2" + "/Applications/Autodesk/FBX SDK/2019.2" + "$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2019.0" + "$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2019.0" + "/Applications/Autodesk/FBX SDK/2019.0" "$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2018.1.1" "$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2018.1.1" - "/Applications/Autodesk/FBX\ SDK/2018.0" + "/Applications/Autodesk/FBX SDK/2018.1.1" + "$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2018.0" + "$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2018.0" + "/Applications/Autodesk/FBX SDK/2018.0" "$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2017.1" "$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2017.1" "/Applications/Autodesk/FBX SDK/2017.1" + "$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2017.0" + "$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2017.0" + "/Applications/Autodesk/FBX SDK/2017.0" "$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2016.1.2" "$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2016.1.2" + "/Applications/Autodesk/FBX/FBX SDK/2016.1.2" + /Applications/Autodesk/FBXSDK201612 "$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2016.1.1" "$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2016.1.1" + "/Applications/Autodesk/FBX/FBX SDK/2016.1.1" + /Applications/Autodesk/FBXSDK201611 "$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2015.1" "$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2015.1" "/Applications/Autodesk/FBX/FBX SDK/2015.1" @@ -98,6 +132,21 @@ FIND_LIBRARY( FBX_LIBRARY_DEBUG ${FBX_LIBNAME_DEBUG} PATHS ${FBX_SEARCH_PATHS} PATH_SUFFIXES "lib/${FBX_LIBDIR}") +IF(WIN32) + FIND_LIBRARY( FBX_XML2_LIBRARY ${FBX_XML2_LIBNAME} + PATHS ${FBX_SEARCH_PATHS} + PATH_SUFFIXES "lib/${FBX_LIBDIR}/release" "lib/${FBX_LIBDIR}") + FIND_LIBRARY( FBX_ZLIB_LIBRARY ${FBX_ZLIB_LIBNAME} + PATHS ${FBX_SEARCH_PATHS} + PATH_SUFFIXES "lib/${FBX_LIBDIR}/release" "lib/${FBX_LIBDIR}") + FIND_LIBRARY( FBX_XML2_LIBRARY_DEBUG ${FBX_XML2_LIBNAME} + PATHS ${FBX_SEARCH_PATHS} + PATH_SUFFIXES "lib/${FBX_LIBDIR}/debug") + FIND_LIBRARY( FBX_ZLIB_LIBRARY_DEBUG ${FBX_ZLIB_LIBNAME} + PATHS ${FBX_SEARCH_PATHS} + PATH_SUFFIXES "lib/${FBX_LIBDIR}/debug") +ENDIF() + IF(FBX_LIBRARY AND FBX_LIBRARY_DEBUG AND FBX_INCLUDE_DIR) SET(FBX_FOUND "YES") ELSE() diff --git a/CMakeModules/FindFontconfig.cmake b/CMakeModules/FindFontconfig.cmake new file mode 100644 index 00000000000..9527dfb0a39 --- /dev/null +++ b/CMakeModules/FindFontconfig.cmake @@ -0,0 +1,98 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. +#[[=======================================================================.rst: +# FindFontconfig +# -------------- +# +# Find Fontconfig headers and library. +# +# Imported Targets +# ^^^^^^^^^^^^^^^^ +# +# ``Fontconfig::Fontconfig`` +# The Fontconfig library, if found. +# +# Result Variables +# ^^^^^^^^^^^^^^^^ +# +# This will define the following variables in your project: +# +# ``FONTCONFIG_FOUND`` +# true if (the requested version of) Fontconfig is available. +# ``FONTCONFIG_VERSION`` +# the version of Fontconfig. +# ``FONTCONFIG_LIBRARIES`` +# the libraries to link against to use Fontconfig. +# ``FONTCONFIG_INCLUDE_DIRS`` +# where to find the Fontconfig headers. +# ``FONTCONFIG_COMPILE_OPTIONS`` +# this should be passed to target_compile_options(), if the +# target is not used for linking +#=======================================================================]] + +# use pkg-config to get the directories and then use these values +# in the FIND_PATH() and FIND_LIBRARY() calls +find_package(PkgConfig QUIET) +pkg_check_modules(PKG_FONTCONFIG QUIET fontconfig) +set(FONTCONFIG_COMPILE_OPTIONS ${PKG_FONTCONFIG_CFLAGS_OTHER}) +set(FONTCONFIG_VERSION ${PKG_FONTCONFIG_VERSION}) + +find_path( FONTCONFIG_INCLUDE_DIR + NAMES + fontconfig/fontconfig.h + HINTS + ${PKG_FONTCONFIG_INCLUDE_DIRS} + /usr/X11/include +) + +find_library( FONTCONFIG_LIBRARY + NAMES + fontconfig + PATHS + ${PKG_FONTCONFIG_LIBRARY_DIRS} +) + +if (FONTCONFIG_INCLUDE_DIR AND NOT FONTCONFIG_VERSION) + file(STRINGS ${FONTCONFIG_INCLUDE_DIR}/fontconfig/fontconfig.h _contents REGEX "^#define[ \t]+FC_[A-Z]+[ \t]+[0-9]+$") + unset(FONTCONFIG_VERSION) + foreach(VPART MAJOR MINOR REVISION) + foreach(VLINE ${_contents}) + if(VLINE MATCHES "^#define[\t ]+FC_${VPART}[\t ]+([0-9]+)$") + set(FONTCONFIG_VERSION_PART "${CMAKE_MATCH_1}") + if(FONTCONFIG_VERSION) + string(APPEND FONTCONFIG_VERSION ".${FONTCONFIG_VERSION_PART}") + else() + set(FONTCONFIG_VERSION "${FONTCONFIG_VERSION_PART}") + endif() + endif() + endforeach() + endforeach() +endif () + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Fontconfig + FOUND_VAR + FONTCONFIG_FOUND + REQUIRED_VARS + FONTCONFIG_LIBRARY + FONTCONFIG_INCLUDE_DIR + VERSION_VAR + FONTCONFIG_VERSION +) + + +if(FONTCONFIG_FOUND AND NOT TARGET Fontconfig::Fontconfig) + add_library(Fontconfig::Fontconfig UNKNOWN IMPORTED) + set_target_properties(Fontconfig::Fontconfig PROPERTIES + IMPORTED_LOCATION "${FONTCONFIG_LIBRARY}" + INTERFACE_COMPILE_OPTIONS "${FONTCONFIG_COMPILE_OPTIONS}" + INTERFACE_INCLUDE_DIRECTORIES "${FONTCONFIG_INCLUDE_DIR}" + ) +endif() + +mark_as_advanced(FONTCONFIG_LIBRARY FONTCONFIG_INCLUDE_DIR) + +if(FONTCONFIG_FOUND) + set(FONTCONFIG_LIBRARIES ${FONTCONFIG_LIBRARY}) + set(FONTCONFIG_INCLUDE_DIRS ${FONTCONFIG_INCLUDE_DIR}) +endif() diff --git a/CMakeModules/FindLIBLAS.cmake b/CMakeModules/FindLIBLAS.cmake index 1c9a7ee0179..0ce247a751f 100644 --- a/CMakeModules/FindLIBLAS.cmake +++ b/CMakeModules/FindLIBLAS.cmake @@ -101,5 +101,8 @@ if(LIBLAS_LIBRARY AND LIBLAS_INCLUDE_DIR) if(Boost_FOUND) set(LIBLAS_LIBRARIES ${LIBLAS_LIBRARY} ) set(LIBLAS_FOUND "YES") + if(WIN32) + link_directories(${Boost_LIBRARY_DIRS}) + endif() endif() endif() diff --git a/CMakeModules/FindOpenCascade.cmake b/CMakeModules/FindOpenCascade.cmake index dd002bf55bb..ade975da5ee 100644 --- a/CMakeModules/FindOpenCascade.cmake +++ b/CMakeModules/FindOpenCascade.cmake @@ -8,7 +8,7 @@ # correspond to the ./configure --prefix=$OPENCASCADE_DIR # used in building OPENCASCADE. -FIND_PATH(OPENCASCADE_INCLUDE_DIR BRepMesh.hxx +FIND_PATH(OPENCASCADE_INCLUDE_DIR Standard_Version.hxx PATHS ${OPENCASCADE_DIR} $ENV{OPENCASCADE_DIR} @@ -98,6 +98,7 @@ FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXml TKXml) FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXmlTObj TKXmlTObj) FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXmlXCAF TKXmlXCAF) FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXSBase TKXSBase) +FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXCAF TKXCAF) set (OPENCASCADE_LIBRARY_TYPE_DESCR "Specifies the type of library to be used. 'Shared' libraries diff --git a/CMakeModules/ModuleInstall.cmake b/CMakeModules/ModuleInstall.cmake index be80fd1dbc6..1a5448b8768 100644 --- a/CMakeModules/ModuleInstall.cmake +++ b/CMakeModules/ModuleInstall.cmake @@ -34,8 +34,17 @@ INSTALL( IF(MSVC AND DYNAMIC_OPENSCENEGRAPH) GET_TARGET_PROPERTY(PREFIX ${LIB_NAME} PREFIX) - INSTALL(FILES ${OUTPUT_BINDIR}/${PREFIX}${LIB_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph CONFIGURATIONS RelWithDebInfo) - INSTALL(FILES ${OUTPUT_BINDIR}/${PREFIX}${LIB_NAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph CONFIGURATIONS Debug) + IF("${PREFIX}" STREQUAL PREFIX-NOTFOUND) # Fix for PREFIX-NOTFOUND left in file names + SET(PREFIX "") + ENDIF() + IF ( ${CMAKE_GENERATOR} STREQUAL "Ninja" ) + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PREFIX}${LIB_NAME}${CMAKE_RELEASE_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph CONFIGURATIONS Release) + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PREFIX}${LIB_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph CONFIGURATIONS RelWithDebInfo) + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PREFIX}${LIB_NAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph CONFIGURATIONS Debug) + ELSE ( ${CMAKE_GENERATOR} STREQUAL "Ninja" ) + INSTALL(FILES ${OUTPUT_BINDIR}/${PREFIX}${LIB_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph CONFIGURATIONS RelWithDebInfo) + INSTALL(FILES ${OUTPUT_BINDIR}/${PREFIX}${LIB_NAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph CONFIGURATIONS Debug) + ENDIF ( ${CMAKE_GENERATOR} STREQUAL "Ninja" ) ENDIF(MSVC AND DYNAMIC_OPENSCENEGRAPH) IF(NOT OSG_COMPILE_FRAMEWORKS) diff --git a/CMakeModules/OsgMacroUtils.cmake b/CMakeModules/OsgMacroUtils.cmake index 8fcc627c2e6..b5abe4a8baf 100644 --- a/CMakeModules/OsgMacroUtils.cmake +++ b/CMakeModules/OsgMacroUtils.cmake @@ -225,7 +225,7 @@ MACRO(SETUP_LIBRARY LIB_NAME) ) SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES FOLDER "OSG Core") IF(APPLE) - IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR) + IF(OSG_BUILD_PLATFORM_IPHONE) SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE ${IPHONE_ENABLE_BITCODE}) ENDIF() SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES XCODE_ATTRIBUTE_WARNING_CFLAGS "") @@ -336,21 +336,26 @@ MACRO(SETUP_PLUGIN PLUGIN_NAME) SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES FOLDER "Plugins") IF(APPLE) SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_WARNING_CFLAGS "") - IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR) + IF(OSG_BUILD_PLATFORM_IPHONE) SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE ${IPHONE_ENABLE_BITCODE}) ENDIF() ENDIF() SETUP_LINK_LIBRARIES() -#the installation path are differentiated for win32 that install in bib versus other architecture that install in lib${LIB_POSTFIX}/${OSG_PLUGINS} +#the installation path are differentiated for win32 that install in bin versus other architecture that install in lib${LIB_POSTFIX}/${OSG_PLUGINS} IF(WIN32) INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION bin COMPONENT ${PACKAGE_COMPONENT} ARCHIVE DESTINATION lib/${OSG_PLUGINS} COMPONENT libopenscenegraph-dev LIBRARY DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT}) IF(MSVC AND DYNAMIC_OPENSCENEGRAPH) - INSTALL(FILES ${OUTPUT_BINDIR}/${OSG_PLUGINS}/${TARGET_TARGETNAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT} CONFIGURATIONS RelWithDebInfo) - INSTALL(FILES ${OUTPUT_BINDIR}/${OSG_PLUGINS}/${TARGET_TARGETNAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT} CONFIGURATIONS Debug) + IF( ${CMAKE_GENERATOR} STREQUAL "Ninja" ) + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_TARGETNAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT} CONFIGURATIONS RelWithDebInfo) + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_TARGETNAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT} CONFIGURATIONS Debug) + ELSE( ${CMAKE_GENERATOR} STREQUAL "Ninja" ) + INSTALL(FILES ${OUTPUT_BINDIR}/${OSG_PLUGINS}/${TARGET_TARGETNAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT} CONFIGURATIONS RelWithDebInfo) + INSTALL(FILES ${OUTPUT_BINDIR}/${OSG_PLUGINS}/${TARGET_TARGETNAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT} CONFIGURATIONS Debug) + ENDIF( ${CMAKE_GENERATOR} STREQUAL "Ninja" ) ENDIF(MSVC AND DYNAMIC_OPENSCENEGRAPH) ELSE(WIN32) INSTALL(TARGETS ${TARGET_TARGETNAME} @@ -429,7 +434,7 @@ MACRO(SETUP_EXE IS_COMMANDLINE_APP) IF(APPLE) SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_WARNING_CFLAGS "") - IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR) + IF(OSG_BUILD_PLATFORM_IPHONE) SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_ENABLE_BITCODE ${IPHONE_ENABLE_BITCODE}) ENDIF() ENDIF() @@ -458,8 +463,8 @@ MACRO(SETUP_APPLICATION APPLICATION_NAME) ELSE(APPLE) INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION bin COMPONENT openscenegraph ) IF(MSVC) - INSTALL(FILES ${CMAKE_BINARY_DIR}/bin/${TARGET_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION bin COMPONENT openscenegraph CONFIGURATIONS RelWithDebInfo) - INSTALL(FILES ${CMAKE_BINARY_DIR}/bin/${TARGET_NAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION bin COMPONENT openscenegraph CONFIGURATIONS Debug) + INSTALL(FILES ${OUTPUT_BINDIR}/${TARGET_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION bin COMPONENT openscenegraph CONFIGURATIONS RelWithDebInfo) + INSTALL(FILES ${OUTPUT_BINDIR}/${TARGET_NAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION bin COMPONENT openscenegraph CONFIGURATIONS Debug) ENDIF(MSVC) ENDIF(APPLE) @@ -491,8 +496,8 @@ MACRO(SETUP_EXAMPLE EXAMPLE_NAME) ELSE(APPLE) INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION share/OpenSceneGraph/bin COMPONENT openscenegraph-examples ) IF(MSVC) - INSTALL(FILES ${CMAKE_BINARY_DIR}/bin/${TARGET_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION share/OpenSceneGraph/bin COMPONENT openscenegraph-examples CONFIGURATIONS RelWithDebInfo) - INSTALL(FILES ${CMAKE_BINARY_DIR}/bin/${TARGET_NAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION share/OpenSceneGraph/bin COMPONENT openscenegraph-examples CONFIGURATIONS Debug) + INSTALL(FILES ${OUTPUT_BINDIR}/${TARGET_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION share/OpenSceneGraph/bin COMPONENT openscenegraph-examples CONFIGURATIONS RelWithDebInfo) + INSTALL(FILES ${OUTPUT_BINDIR}/${TARGET_NAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION share/OpenSceneGraph/bin COMPONENT openscenegraph-examples CONFIGURATIONS Debug) ENDIF(MSVC) ENDIF(APPLE) diff --git a/ChangeLog b/ChangeLog index 5f61367212a..c7cb71b5ab5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,2445 @@ +Fri, 31 Jan 2020 11:02:47 +0000 +Author : Robert Osfield +Updates for 3.6.5 release + +Fri, 31 Jan 2020 10:37:25 +0000 +Author : Robert Osfield +Added mutex lock to avoid threading issues when glyphs are added to a Font from multiple threads + +Thu, 30 Jan 2020 19:25:50 +0000 +Author : Robert Osfield +Updates for 3.6.5-rc3 + +Thu, 30 Jan 2020 16:30:41 +0000 +Author : OpenSceneGraph git repository +Merge pull request #911 from LaurensVoerman/FbxSdkFixFix for older versions of fbxsdk without xml or zlib libraries, + +Thu, 30 Jan 2020 16:21:32 +0000 +Author : Robert Osfield +Added explicit clean up removeView + +Thu, 30 Jan 2020 16:32:42 +0100 +Author : Laurens Voerman +Fix for older versions of fbxsdk without xml or zlib libraries, fix cmake multiconfig generators (msvc) with irrelevant CMAKE_BUILD_TYPE. + +Mon, 27 Jan 2020 10:11:23 +0000 +Author : OpenSceneGraph git repository +Merge pull request #907 from DeadParrot/OpenSceneGraph-3.6FBX plugin updates / PREFIX-NOTFOUND work-around + +Sun, 26 Jan 2020 14:28:56 -0500 +Author : Stuart Mentzer +FBX plugin updates / PREFIX-NOTFOUND work-around + +Tue, 21 Jan 2020 10:11:30 +0000 +Author : Robert Osfield +Updater rc number for 3.6.5-rc2, and CHangeLog + +Tue, 21 Jan 2020 09:43:08 +0000 +Author : Robert Osfield +Removed stray space + +Tue, 21 Jan 2020 09:32:57 +0000 +Author : OpenSceneGraph git repository +Merge pull request #902 from mp3butcher/oqn3.6 OQN API convergence + +Tue, 21 Jan 2020 09:16:51 +0000 +Author : OpenSceneGraph git repository +Merge pull request #903 from dedowsdi/renderstageAdd getPreRenderList, getPostRenderList to RenderStage. + +Fri, 17 Jan 2020 18:47:49 +0800 +Author : dedowsdi +Add getPreRenderList getPostRenderList to RenderStage. + +Fri, 23 Aug 2019 09:59:54 +0200 +Author : Daniel Trstenjak +OcclusionQueryNode: make all usages of 'updateDefaultQueryGeometry' thread safe + +Fri, 23 Aug 2019 09:46:02 +0200 +Author : Daniel Trstenjak +OcclusionQueryNode: fix resetting to default query geometryWhen the query geometry gets reset to its default then its +vertices have to be updated by the bounding box dimensions of +the current children of the OcclusionQueryNode. + + +Wed, 14 Aug 2019 11:27:40 +0200 +Author : Daniel Trstenjak +OcclusionQueryNode: fix use case of user defined query geometryThe user defined query geometry handling has been broken in several ways. + +The previous way of defining a query geometry was using the non const +`getQueryGeometry` method and overriding its members. But then +`OcclusionQueryNode` wasn't aware of the geometry change and couldn't +internally handle it correctly. + +The `computeBound` method never considered a user defined query geometry and +always just overrode the vertices of the geometry. + +The member `_validQueryGeometry` wasn't correctly set. + +This change should fix all this issues by introducing a small backward +compatibility break. The non const `getQueryGeometry` method is removed +forcing the user to use the `setQueryGeometry` method. But then `OcclusionQueryNode` +is aware of the user defined query geometry and can handle it correctly. + + +Tue, 29 Jan 2019 14:40:16 +0100 +Author : Daniel Trstenjak +OcclusionQueryNode: reset the test result of the invalid geometryThere're cases that the occlusion test result has been retrieved +after the query geometry has been changed, it's the result of the +geometry before the change. + + +Tue, 29 Jan 2019 11:37:28 +0100 +Author : Daniel Trstenjak +OcclusionQueryNode: ensure a valid query geometryIf the query geometry is invalid then don't do any occlusion queries and +never traverse the subgraphs. + + +Fri, 25 Jan 2019 15:02:45 +0100 +Author : Daniel Trstenjak +OcclusionQueryNode: ensure a consistent value for '_passed' + +Sat, 26 Jan 2019 16:33:23 +0000 +Author : Robert Osfield +Introduced a QueryGeometry::getQueryResult(const osg::Camera*) method as a more informative replacedment for QueryGeometry::getNumPixels(). + +Mon, 20 Jan 2020 10:37:12 +0000 +Author : OpenSceneGraph git repository +Merge pull request #900 from dedowsdi/fix_particle_rotationFix particle rotation. + +Fri, 17 Jan 2020 11:18:30 +0800 +Author : dedowsdi +Fix particle rotation. + +Fri, 17 Jan 2020 09:28:09 +0000 +Author : Robert Osfield +Updated ChangeLog + +Fri, 17 Jan 2020 09:07:58 +0000 +Author : Robert Osfield +Moved setting of isftream locale to Model::readOBJ(..) and Model::readMTL(..). + +Fri, 17 Jan 2020 08:54:52 +0000 +Author : Robert Osfield +Added explict setting of local to classic to avoid local platform settings affecting parsing + +Tue, 14 Jan 2020 16:32:29 +0000 +Author : Robert Osfield +Updated README.md for 3.6.5-rc1 + +Tue, 14 Jan 2020 16:30:14 +0000 +Author : Robert Osfield +Updated ChangeLog and set rc candidate 1 for 3.6.5-rc1 + +Tue, 14 Jan 2020 16:29:07 +0000 +Author : Robert Osfield +Fixed warnings + +Tue, 14 Jan 2020 14:57:15 +0000 +Author : Robert Osfield +Fixed build warning due to auto_ptr<> + +Tue, 14 Jan 2020 14:42:01 +0000 +Author : Robert Osfield +Fixed workaround for invalid indices + +Mon, 13 Jan 2020 14:14:48 +0000 +Author : OpenSceneGraph git repository +Merge pull request #895 from openscenegraph/CurrentThreadIdAdded commment explaining that OpenThreads::Thread::CurrentThread() r… + +Mon, 13 Jan 2020 14:12:54 +0000 +Author : Robert Osfield +Added commment explaining that OpenThreads::Thread::CurrentThread() return NULL on non OpenThreads thread. + +Mon, 13 Jan 2020 13:41:37 +0000 +Author : Robert Osfield +Added support for using CurrentCodePage functionality with osgText::String To the DXF plugin added Option string support for using CurrentCodePage|WidePage, UTF8, UTF16, UTF32 and FontFile=filename + +Mon, 13 Jan 2020 09:58:47 +0000 +Author : Robert Osfield +Added encoding and font setting to dxfText as a first step towards making these user controllable to enble handling of non default settings + +Sat, 11 Jan 2020 14:39:46 +0000 +Author : Robert Osfield +Added creation of image directories when required + +Fri, 10 Jan 2020 10:12:13 +0000 +Author : Robert Osfield +Fixed handling of _autoScaleTransitionWidthRatio<=0.0 + +Tue, 7 Jan 2020 11:12:18 +0000 +Author : Robert Osfield +Implemented TextBase::compileGLObjects() with handling of VAO/VBOs to address bugs associated with VAO usage of Text. + +Mon, 6 Jan 2020 18:39:51 +0000 +Author : Robert Osfield +Added Thread::CurrentThreadId() method to wrap up thread id functionality in a more platform appropriate way. + +Mon, 6 Jan 2020 10:27:18 +0000 +Author : OpenSceneGraph git repository +Merge pull request #887 from limbolily/patch-1Fix navagation error about Android GLES2 example. + +Mon, 6 Jan 2020 14:48:34 +0800 +Author : limbolily +Fix navagation error about Android GLES2 example.Android GLES2 example use event queue without initializing window rectangle with graphics context,that produce navigation error. + +Mon, 23 Dec 2019 14:20:26 +0100 +Author : Michael Danilov +Fix #877 "Shift key stuck if both shifts switch keymap"Adapted the patch from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=687332 + + +Mon, 23 Dec 2019 14:53:17 +0000 +Author : Robert Osfield +Adopted CMake's FindDCMTK.cmake variables + +Sun, 22 Dec 2019 12:29:47 +0000 +Author : OpenSceneGraph git repository +Merge pull request #874 from blobfish/occt7.4Occt7.4 + +Thu, 19 Dec 2019 11:46:05 -0500 +Author : blobfish +Plugins: OpenCasCade: Adding 'std' prefix where needed. See Following.Prior to 7.4, occt had a 'using namespace std' in a header file that +was polluting dependent projects. They have since fixed it and so these +changes are required. + + +Thu, 19 Dec 2019 10:16:09 -0500 +Author : blobfish +Plugins: Cmake: OpenCasCade: Changing header used for include directory search. See Following.BRepMesh.hxx is gone in occt 7.4. Now searching for Standard_Version.hxx, which should be more consistent. + + +Wed, 18 Dec 2019 14:25:07 +0000 +Author : Robert Osfield +Added classic locale setting to avoid local setting of locale affecting the GLSL code generated. + +Mon, 16 Dec 2019 17:10:39 +0000 +Author : Robert Osfield +Updated ChangeLog + +Mon, 16 Dec 2019 16:51:16 +0000 +Author : Robert Osfield +Added automatically removal from the OjbectCache when a object or it's subgraph contain Texture that no longer have an osg::Image. + +Mon, 16 Dec 2019 11:54:12 +0000 +Author : OpenSceneGraph git repository +Merge pull request #871 from LaurensVoerman/commit_tgaFixfix debug compile error for ReaderWriterTGA + +Mon, 16 Dec 2019 11:02:41 +0100 +Author : Laurens Voerman +fix debug compile error for ReaderWriterTGA + +Mon, 16 Dec 2019 09:40:30 +0000 +Author : OpenSceneGraph git repository +Merge pull request #870 from eligovision/OpenSceneGraph-3.6_glext_fixGLExtensions's isPBOSupported and isVAOSupported flags fixed + +Mon, 16 Dec 2019 09:40:00 +0000 +Author : OpenSceneGraph git repository +Merge pull request #869 from eligovision/OpenSceneGraph-3.6_glextAdded FBO GL extensions (useful for mobile VR etc.) + +Fri, 13 Dec 2019 19:40:11 +0300 +Author : konstantin.matveyev +GLExtensions's isPBOSupported and isVAOSupported flags fixed for GLES2+GLES3 configuration + +Fri, 13 Dec 2019 19:42:30 +0300 +Author : konstantin.matveyev +GLExtensions's isInvalidateFramebufferSupported flag improved + +Tue, 26 Nov 2019 17:17:38 +0800 +Author : PntAndCnt +Fontconfig should be external library.Add Fontconfig to TARGET_LIBRARIES cause osg3::osgText target looking for +openscegraph-Fontconfig-import-targets.cmake, which doesn't exists. + + +Sun, 13 Oct 2019 20:24:36 +0800 +Author : PntAndCnt +Fix a typo and invisible 3dtext in examples/osgtext.Second text alignment is wrong when "--alignment" specified. + +3D text radius is too small, only SCREEN_COORDS can be seen. + +Text position should multiply radius. + + +Tue, 3 Sep 2019 16:11:14 +0800 +Author : Kent +Mered fix for internalFormat + +Thu, 12 Dec 2019 18:41:23 +0300 +Author : valid-ptr +glInvalidateFramebuffer added to GLExtensions + +Thu, 31 Oct 2019 18:59:04 +0300 +Author : konstantin.matveyev +glFramebufferTexture2DMultisample added to GLExtensions + +Tue, 10 Dec 2019 15:08:25 +0300 +Author : Dmitry Marakasov +Add FreeBSD-specific code bits for pthread_setaffinity_np support + +Thu, 12 Dec 2019 13:25:44 +0000 +Author : Robert Osfield +Fix linking with Xinerama + +Thu, 12 Dec 2019 13:09:33 +0000 +Author : OpenSceneGraph git repository +Merge pull request #861 from aluaces/default-ffmpegSet ffmpeg as the default plugin for video files. + +Fri, 22 Nov 2019 21:07:36 +0100 +Author : elsid +Fix clang 8 & libc++ build errorsReplace operators for implicit type conversion by explicit data() method to +access implementation pointer and subscript operator to access element by +index just like in std::vector. + +src/osgPlugins/tga/ReaderWriterTGA.cpp:455:22: error: use of overloaded operator '==' is ambiguous (with operand types 'SafeArray' and 'long') + if (colormap == NULL) + ~~~~~~~~ ^ ~~~~ +src/osgPlugins/tga/ReaderWriterTGA.cpp:525:16: error: use of overloaded operator '==' is ambiguous (with operand types 'SafeArray' and 'long') + if (buffer == NULL || linebuf == NULL) + ~~~~~~ ^ ~~~~ +src/osgPlugins/tga/ReaderWriterTGA.cpp:525:35: error: use of overloaded operator '==' is ambiguous (with operand types 'SafeArray' and 'long') + if (buffer == NULL || linebuf == NULL) + ~~~~~~~ ^ ~~~~ +src/osgPlugins/tga/ReaderWriterTGA.cpp:548:30: error: use of overloaded operator '==' is ambiguous (with operand types 'SafeArray' and 'long') + if (formattedMap == NULL) + ~~~~~~~~~~~~ ^ ~~~~ +src/osgPlugins/tga/ReaderWriterTGA.cpp:574:40: error: use of overloaded operator '[]' is ambiguous (with operand types 'SafeArray' and 'int') + index = linebuf[x]; + ~~~~~~~^~ +src/osgPlugins/tga/ReaderWriterTGA.cpp:577:50: error: use of overloaded operator '+' is ambiguous (with operand types 'SafeArray' and 'int') + index = getInt16(linebuf + x * 2); + ~~~~~~~ ^ ~~~~~ +src/osgPlugins/tga/ReaderWriterTGA.cpp:580:50: error: use of overloaded operator '+' is ambiguous (with operand types 'SafeArray' and 'int') + index = getInt24(linebuf + x * 3); + ~~~~~~~ ^ ~~~~~ +src/osgPlugins/tga/ReaderWriterTGA.cpp:583:50: error: use of overloaded operator '+' is ambiguous (with operand types 'SafeArray' and 'int') + index = getInt32(linebuf + x * 4); + ~~~~~~~ ^ ~~~~~ +src/osgPlugins/tga/ReaderWriterTGA.cpp:592:72: error: use of overloaded operator '+' is ambiguous (with operand types 'SafeArray' and 'int') + (dest + adjustedX * format)[i] = (formattedMap + index * format)[i]; + ~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~ +src/osgPlugins/tga/ReaderWriterTGA.cpp:626:30: error: use of overloaded operator '==' is ambiguous (with operand types 'SafeArray' and 'long') + if (formattedMap == NULL) + ~~~~~~~~~~~~ ^ ~~~~ +src/osgPlugins/tga/ReaderWriterTGA.cpp:642:21: error: use of overloaded operator '==' is ambiguous (with operand types 'SafeArray' and 'long') + if (buf == NULL) + ~~~ ^ ~~~~ +src/osgPlugins/tga/ReaderWriterTGA.cpp:664:44: error: use of overloaded operator '[]' is ambiguous (with operand types 'SafeArray' and 'int') + index = linebuf[x]; + ~~~~~~~^~ +src/osgPlugins/tga/ReaderWriterTGA.cpp:667:54: error: use of overloaded operator '+' is ambiguous (with operand types 'SafeArray' and 'int') + index = getInt16(linebuf + x * 2); + ~~~~~~~ ^ ~~~~~ +src/osgPlugins/tga/ReaderWriterTGA.cpp:670:54: error: use of overloaded operator '+' is ambiguous (with operand types 'SafeArray' and 'int') + index = getInt24(linebuf + x * 3); + ~~~~~~~ ^ ~~~~~ +src/osgPlugins/tga/ReaderWriterTGA.cpp:673:54: error: use of overloaded operator '+' is ambiguous (with operand types 'SafeArray' and 'int') + index = getInt32(linebuf + x * 4); + ~~~~~~~ ^ ~~~~~ +src/osgPlugins/tga/ReaderWriterTGA.cpp:688:76: error: use of overloaded operator '+' is ambiguous (with operand types 'SafeArray' and 'int') + (dest + adjustedX * format)[i] = (formattedMap + index * format)[i]; + ~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~ +src/osgPlugins/tga/ReaderWriterTGA.cpp:708:21: error: use of overloaded operator '==' is ambiguous (with operand types 'SafeArray' and 'long') + if (buf == NULL) + ~~~ ^ ~~~~ +17 errors generated. + + +Thu, 12 Dec 2019 10:55:35 +0000 +Author : OpenSceneGraph git repository +Fixed indentation, replacing tabs with spaces + +Mon, 4 Nov 2019 05:37:37 +0100 +Author : Tim Moore +Fix bug in matrix transpose() and transpose3x3The diagonal elements were not copied from the source matrix. + + +Fri, 1 Nov 2019 09:26:28 -0700 +Author : flashk +Support reading RGB float DDS imagesThe DDS plugin is not able to load floating point RGB images saved out by itself. There doesn't appear to be a fourcc code for RGB float/half-float data, so I added the appropriate entries to the RGBFormat table so the images can be loaded properly. + +Thu, 12 Dec 2019 10:08:32 +0000 +Author : OpenSceneGraph git repository +Merge pull request #851 from LaurensVoerman/submitCpSubImgfix copySubImage crash on compressed files + +Wed, 25 Sep 2019 12:16:51 -0500 +Author : DCFennell +GL_CLAMP_VERTEX_COLOR and GL_CLAMP_FRAGMENT_COLOR deprecated in GL core profile according to OpenGL 4.5 specification. + +Mon, 23 Sep 2019 15:05:54 +0200 +Author : Johannes Pabst +Fix: LuaCallbackObject could form circular references to LuaScriptEngine that prevented its destruction. Destruction of LuaScriptEngine now disarms all callbacks into Lua. + +Fri, 13 Sep 2019 12:50:29 +0200 +Author : Riccardo Corsi +Fbx Plugin: added plugin option to set the target axis system. Default left to OpenGL. + +Thu, 12 Sep 2019 13:54:28 -0700 +Author : grdowns +Add vcpkg installation instructions + +Wed, 11 Dec 2019 17:51:02 +0000 +Author : OpenSceneGraph git repository +Merge pull request #837 from LaurensVoerman/carbonFixfix apple carbon reference + +Wed, 11 Dec 2019 17:07:27 +0000 +Author : OpenSceneGraph git repository +Merge pull request #833 from cj-mcdonald/osga-fixUpdate ReaderWriterOSGA.cpp + +Fri, 30 Aug 2019 16:48:25 +0200 +Author : Guilhem Saurel +fix dae readme + +Wed, 11 Dec 2019 16:58:50 +0000 +Author : OpenSceneGraph git repository +Merge pull request #828 from eligovision/OpenSceneGraph-3.6_ios_build_fixFix build iOS: when using Toolchain or building with Makefiles (not X… + +Wed, 11 Dec 2019 16:47:44 +0000 +Author : OpenSceneGraph git repository +Merge pull request #822 from mp3butcher/patch-32optimize indexed color DDS conversion + +Wed, 4 Dec 2019 22:10:46 +0100 +Author : Alberto Luaces +Set ffmpeg as the default plugin for video files.As xine is not used anymore, there is no plugin in charge of loading +video files, and osgmovie and other programs are not able to open +them. + +If ffmpeg is present, it is registered for opening video files. + + +Fri, 1 Nov 2019 16:42:50 +0100 +Author : Laurens Voerman +fix copySubImage crash on compressed files + +Wed, 11 Sep 2019 10:22:16 +0200 +Author : Laurens Voerman +fix apple carbon reference + +Mon, 2 Sep 2019 17:43:38 +0100 +Author : Colin McDonald +Update ReaderWriterOSGA.cppFix typo in osga archives which stops node files working + +Fri, 23 Aug 2019 18:31:22 +0300 +Author : Konstantin S. Matveyev +Fix build iOS: when using Toolchain or building with Makefiles (not Xcode) + +Sun, 18 Aug 2019 17:56:51 +0200 +Author : Julien Valentin +use memcpy instead of union + +Sat, 17 Aug 2019 22:05:38 +0200 +Author : Julien Valentin +optimize conversion with a union + +Thu, 22 Aug 2019 14:49:43 +0100 +Author : Robert Osfield +Removed exlict keyword to address build problems with VS older than 2015. + +Sun, 18 Aug 2019 20:14:17 +0200 +Author : Remo E +Debugging: Hint to debug LoadLibrary issuesThis helps to debug loading dynamic libraries in an environment without implemented "dlopen". For example emscripten with static compiled OSG. + +Sat, 17 Aug 2019 20:04:38 +0100 +Author : Robert Osfield +Merge branch 'OpenSceneGraph-3.6' of https://github.com/openscenegraph/OpenSceneGraph into OpenSceneGraph-3.6 + +Sat, 17 Aug 2019 20:04:30 +0100 +Author : OpenSceneGraph git repository +Merge pull request #820 from Capostrophic/ddsDDS plugin: add support for DDPF_PALETTEINDEXED8 pixel format reading + +Fri, 16 Aug 2019 13:52:56 +0200 +Author : Björn Blissing +Fixed spelling error in warning message + +Sat, 17 Aug 2019 15:11:49 +0300 +Author : capostrophic +Fix memory leaks + +Sat, 17 Aug 2019 01:43:47 +0300 +Author : capostrophic +Add support for DDPF_PALETTEINDEXED8 pixel format reading + +Fri, 16 Aug 2019 10:27:28 +0100 +Author : Robert Osfield +Added TKXCAF to find package list + +Thu, 15 Aug 2019 20:21:15 +0200 +Author : Julien Valentin +remove return of local pointer + +Fri, 16 Aug 2019 09:35:00 +0100 +Author : OpenSceneGraph git repository +Merge pull request #818 from mp3butcher/patch-31fix comment block CMake syntax + +Thu, 15 Aug 2019 20:46:52 +0200 +Author : Julien Valentin +fix cmake block comment syntax + +Thu, 15 Aug 2019 20:27:05 +0200 +Author : Julien Valentin +remove unproperly parsed CMake commenthttps://github.com/openscenegraph/OpenSceneGraph/issues/812 + +Wed, 7 Aug 2019 10:56:59 +0100 +Author : OpenSceneGraph git repository +Merge pull request #808 from 640kb/OpenSceneGraph-3.6las plugin: fix linking against static boost library under windows + +Wed, 7 Aug 2019 09:49:16 +0200 +Author : Daniel Wendt +las plugin: fix linking against static boost library under windowsSigned-off-by: Daniel Wendt + + +Wed, 31 Jul 2019 14:11:59 +0100 +Author : Robert Osfield +Added a _fontFallback to TextBase to cache any fallback font (usually DefaultFont) that is used when the Textbase::_font is null. + +Mon, 29 Jul 2019 13:01:00 +0100 +Author : Robert Osfield +Replaced GL_QUADS usage with GL_TRIANGLE_STRIP + +Mon, 29 Jul 2019 12:29:25 +0100 +Author : Robert Osfield +Refactored the mesh setup to use GL_TRIANGLE_STIP instead of GL_QUADS + +Mon, 29 Jul 2019 09:59:57 +0100 +Author : Robert Osfield +Updated version to 3.6.5 + +Mon, 29 Jul 2019 08:57:56 +0100 +Author : OpenSceneGraph git repository +Merge pull request #804 from eligovision/OpenSceneGraph-3.6_GLQUADS[*] ParticleSystem: Use GL_TRIANGLES instead if GL_QUADS when GL{1,2}… + +Fri, 26 Jul 2019 21:14:45 +0300 +Author : Konstantin S. Matveyev +[*] ParticleSystem: Use GL_TRIANGLES instead if GL_QUADS when GL{1,2} or GLES1 are unavailable + +Fri, 26 Jul 2019 12:54:16 +0100 +Author : OpenSceneGraph git repository +Merge pull request #802 from eligovision/OpenSceneGraph-3.6_osgtext_fcOSG_TEXT_USE_FONTCONFIG cmake option added: Set to ON to enable attem… + +Fri, 26 Jul 2019 14:40:47 +0300 +Author : konstantin.matveyev +OSG_TEXT_USE_FONTCONFIG additional check needed + +Fri, 26 Jul 2019 14:09:36 +0300 +Author : konstantin.matveyev +OSG_TEXT_USE_FONTCONFIG cmake option added: Set to ON to enable attempt to use FontConfig in osgText; Disabled by default for iOS and Android + +Thu, 25 Jul 2019 15:10:36 +0100 +Author : Robert Osfield +UPdated for 3.6.3-rc9 + +Thu, 25 Jul 2019 14:58:17 +0100 +Author : Robert Osfield +Changed the #extension enable + +Thu, 25 Jul 2019 14:10:01 +0100 +Author : Robert Osfield +Change the DefaultFont so that it's managemed via the ObjectCache to enabl it to be release and cleared in a central manner. Added call to Registry::releaseGLObjects() to osgViewer/Renderer.cpp to enable automatic clean up of objects in the ObjectCache. + +Thu, 25 Jul 2019 12:48:21 +0100 +Author : Robert Osfield +Added readObject() implementations + +Thu, 25 Jul 2019 10:39:34 +0100 +Author : Robert Osfield +Added ReaderWriterOBJ::readObject(..) implementations to address issue with using osgconv + +Mon, 22 Jul 2019 19:22:16 +0100 +Author : Robert Osfield +Updates for 3.6.4-rc8 + +Mon, 22 Jul 2019 17:20:10 +0100 +Author : Robert Osfield +Added handling of iOS and Android to make sure FontConfig is only used for Desktop builds + +Fri, 19 Jul 2019 09:20:50 +0100 +Author : Robert Osfield +Updated for rc7 + +Fri, 19 Jul 2019 09:10:02 +0100 +Author : OpenSceneGraph git repository +Merge pull request #797 from wangii/OpenSceneGraph-3.6 fix u64 and i64 allocation, setArray bug + +Fri, 19 Jul 2019 14:06:20 +0800 +Author : Linan Wang +fix typo + +Fri, 19 Jul 2019 13:28:25 +0800 +Author : Linan Wang +fix u64 and i64 allocation, setArray bug + +Thu, 18 Jul 2019 12:44:59 +0100 +Author : Robert Osfield +Fixed indentation + +Thu, 18 Jul 2019 09:13:25 +0800 +Author : Long Huan +Add OutputTextureFiles OptionAdd OutputTextureFiles Option support Write out the texture images to file + + +Wed, 17 Jul 2019 15:07:38 +0800 +Author : Long Huan +Update OBJWriterNodeVisitor.cpp + +Wed, 17 Jul 2019 14:52:10 +0800 +Author : Long Huan +fix obj-Plugin export texture fileFix obj-plugin to support export texture file + + +Thu, 18 Jul 2019 12:18:04 +0100 +Author : Robert Osfield +Added handling of zero radius models + +Thu, 18 Jul 2019 11:16:08 +0100 +Author : Robert Osfield +Removed references OpenVRML plugin + +Thu, 18 Jul 2019 11:14:10 +0100 +Author : Robert Osfield +Removed vrml plugin from build as OpenVRML plugin relies on no longer supported functionality + +Thu, 18 Jul 2019 10:34:53 +0100 +Author : Robert Osfield +Added calls to curl_global_init and curl_global_cleanup to improve the robustness of threaded curl plugin usage + +Tue, 16 Jul 2019 13:50:02 +0100 +Author : Robert Osfield +Updated for rc6 + +Tue, 16 Jul 2019 11:53:24 +0100 +Author : OpenSceneGraph git repository +Merge pull request #789 from rhabacker/OpenSceneGraph-3.6cmake: Add find_package module for fontconfig + +Tue, 16 Jul 2019 11:32:10 +0100 +Author : OpenSceneGraph git repository +Merge pull request #791 from aluaces/mingw-osg_windowing_systemAvoid that mingw cross-compilation choosing X11 as the windowing system. + +Tue, 16 Jul 2019 11:08:25 +0200 +Author : Alberto Luaces +Avoid that mingw cross-compilation choosing X11 as the windowing system.I have moved the PROJECT stanza before the conditionals, because +otherwise expressions like IF(MINGW) always fail. + + +Mon, 15 Jul 2019 18:54:30 +0200 +Author : Ralf Habacker +cmake: Add summary information to get an idea of what dependencies might be missing + +Mon, 15 Jul 2019 18:52:14 +0200 +Author : Ralf Habacker +cmake: Added find_package module for fontconfig which is not available with cmake < 3.14This file has been taken from cmake 3.14 + + +Mon, 15 Jul 2019 17:06:51 +0100 +Author : Robert Osfield +Updated for 3.6.4-rc5 + +Mon, 15 Jul 2019 16:16:45 +0100 +Author : Robert Osfield +Adopted the matrix transformation code from Text + +Mon, 15 Jul 2019 16:13:57 +0100 +Author : Robert Osfield +Added test of picking + +Mon, 15 Jul 2019 15:05:05 +0100 +Author : Robert Osfield +Cuietened down the reporting of failure to find fontconfig + +Mon, 15 Jul 2019 14:11:11 +0100 +Author : OpenSceneGraph git repository +Merge pull request #788 from rhabacker/3.6-obj-plugin-fixes3.6 obj plugin fixes + +Tue, 16 Jan 2018 10:23:36 +0100 +Author : Ralf Habacker +obj plugin: Fix bug not adding first vertex index on writing GL_LINExxx array types + +Mon, 15 Jan 2018 14:22:18 +0100 +Author : Ralf Habacker +obj plugin: Fix not writing material shininess + +Mon, 15 Jul 2019 14:29:26 +0200 +Author : Ralf Habacker +obj plugin: add option "NsIfNotPresent=" for setting the specular exponent of a material if not present + +Mon, 25 Sep 2017 13:59:13 +0200 +Author : Ralf Habacker +obj plugin: Fix bug not using specular color (Ks) for illumination mode > 2See paragraph "Illumination models" at http://paulbourke.net/dataformats/mtl/ for details. + + +Mon, 15 Jul 2019 11:14:47 +0100 +Author : OpenSceneGraph git repository +Merge pull request #786 from rhabacker/OpenSceneGraph-3.6Fix 'Incorrect default location for true type fonts on openSUSE' + +Tue, 2 Jul 2019 22:56:02 +0200 +Author : Ralf Habacker +Fix 'Incorrect default location for true type fonts on openSUSE'https://github.com/openscenegraph/OpenSceneGraph/issues/778 + + +Fri, 12 Jul 2019 17:00:20 +0100 +Author : Robert Osfield +Added check against any empty _segments to avoid undefined behaviour + +Fri, 12 Jul 2019 16:16:43 +0100 +Author : Robert Osfield +Removed debug info for constructor and destructors + +Fri, 12 Jul 2019 16:09:12 +0100 +Author : Robert Osfield +Added FrameBufferAttachment::resizeGLObjectBuffers(..) and releaseGLObjects(..) methods + +Tue, 2 Jul 2019 20:37:02 +0200 +Author : StefanBruens +Fix wxWidgets COMPONENTS specification, deprecated usage broken with CMake 3.14Current FindWxWidgets.cmake allows to specify OPTIONAL components, unfortunately +this broke the (deprecated) use of wxWidgets_USE_LIBS. + +Fixes: #779 + +Tue, 2 Jul 2019 20:21:45 +0100 +Author : Robert Osfield +Updated ChangeLog for rc4 + +Tue, 2 Jul 2019 20:21:05 +0100 +Author : Robert Osfield +Updated SO number to refect change to the Drawable header inline method status + +Tue, 2 Jul 2019 20:19:05 +0100 +Author : Robert Osfield +Updated in prep for 3.6.4-rc4 + +Mon, 1 Jul 2019 16:15:21 +0100 +Author : Colin McDonald +Trivial change to src/osgSim/LineOfSight.cpp to quieten down an info message in DatabaseCacheReadCallback::readNodeFile. + +Mon, 1 Jul 2019 16:12:53 +0100 +Author : Robert Osfield +Updated release candidate number to 4 in prep for 3.6.4-rc4 release. + +Mon, 1 Jul 2019 15:48:29 +0100 +Author : Robert Osfield +Removed stray tab + +Tue, 25 Jun 2019 17:09:46 +1200 +Author : jimcamel +Fixed bug where FFmpeg Image Stream would stop if paused for more than 10 secondsThe FFmpeg image stream class uses a 10 second timeout between frames to determine if the stream is dead and if so closes it. However, the timeout is determined using the variable lastUpdateTS which stores the last time the publishNewFrame function was called, and if the video has been playing and then is paused for longer than 10 seconds, when it is unpaused this timeout will fire and the stream will be closed, stopping the video playing beyond what has been buffered. + +To stop this timeout from happening before the video starts playing, the timeout checks to see if the lastUpdateTS > 0 (at initialization it is set to 0). In this fix, we simply set the value of lastUpdateTS to 0 when the video is unpaused, this will force the check to skip on unpause, and from then on lastUpdateTS will have the correct value again. + +The lastUpdateTS variable is private and only used for this one function, so there should be no side effects from the change. + +Fri, 7 Jun 2019 12:45:45 +0200 +Author : Riccardo Corsi +Bugfix due to copy-paste typo which prevented multi uv channel mesh to be imported correctly. + +Mon, 1 Jul 2019 13:43:29 +0100 +Author : Robert Osfield +Fixed layout + +Mon, 1 Jul 2019 13:42:33 +0100 +Author : Robert Osfield +Merge branch 'patch-27' of https://github.com/mp3butcher/OpenSceneGraph into patch-27 + +Thu, 30 May 2019 23:10:27 +0300 +Author : Alexey Galitsyn +Fix not checking num lock state when remapping keypad keys on Windows.Num lock state was never checked during remapping keypad keys on Windows. +Now when num lock is active, keypad numeric keys and keypad delimeter key +should work as expected (return KEY_KP_0 to KEY_KP_9 and KEY_KP_Decimal +respectivly). + + +Mon, 1 Jul 2019 12:56:36 +0100 +Author : Robert Osfield +Restructed the setting of the default osgDB::Options so it doesn't override the ObjectCacheHint setting when a user specified osgDB::Options object is passed in. + +Mon, 1 Jul 2019 12:33:21 +0100 +Author : Robert Osfield +Merge branch 'OpenSceneGraph-3.6_vas' of https://github.com/eligovision/OpenSceneGraph into OpenSceneGraph-3.6_vas + +Mon, 1 Jul 2019 12:18:21 +0100 +Author : Robert Osfield +Couldn't resolve warnings coming from the FBX headers so had to suppress warnings. + +Tue, 21 May 2019 13:28:41 +0200 +Author : Laurens Voerman +replaced "if (apm || !apm->valid())" + +Tue, 21 May 2019 13:29:47 +0200 +Author : Laurens Voerman +fix typo in header guard. + +Wed, 15 May 2019 11:49:17 +0200 +Author : Laurens Voerman +fix typo in ReaderWriterFBX: writObject -> writeObject + +Fri, 14 Jun 2019 15:28:46 +0100 +Author : OpenSceneGraph git repository +Merge pull request #760 from LaurensVoerman/readObjectimplement readObject for all relevant readerWriters + +Fri, 14 Jun 2019 15:01:15 +0100 +Author : OpenSceneGraph git repository +Merge pull request #759 from AnyOldName3/more-tgaVarious TGA improvements + +Fri, 14 Jun 2019 14:32:31 +0100 +Author : OpenSceneGraph git repository +Merge pull request #758 from LaurensVoerman/osgt_indentationfix indentation for osgt files for windows dynamic library build. + +Fri, 14 Jun 2019 14:29:32 +0100 +Author : OpenSceneGraph git repository +Merge pull request #757 from LaurensVoerman/rendererNoRefCountfix compile error if OSGUTIL_RENDERBACKEND_USE_REF_PTR not defined in include/osgUtil/RenderLeaf + +Sat, 8 Jun 2019 01:17:21 +0200 +Author : Julien Valentin +update traversedebug preventing traversal to disable OQN + +Fri, 31 May 2019 15:27:18 +0200 +Author : Julien Valentin +add enable check in traverseQuery + +Wed, 15 May 2019 14:35:39 +0300 +Author : Konstantin S. Matveyev +typo fix + +Wed, 15 May 2019 14:27:10 +0300 +Author : valid-ptr +VertexArrayState's lazy disabling of vertex attributes mechanism major fix: _vertexAttribArrays must be 'shared' + +Tue, 14 May 2019 14:25:30 +0200 +Author : Laurens Voerman +implement readObject for all relevant readerWriters + +Mon, 13 May 2019 21:56:07 +0100 +Author : AnyOldName3 +Add support for Targa type 3 and 11 images (greyscale) + +Mon, 13 May 2019 17:25:29 +0200 +Author : Laurens Voerman +fix indentation for osgt files for windows dynamic library build. + +Mon, 13 May 2019 17:02:53 +0200 +Author : Laurens Voerman +fix compile error if OSGUTIL_RENDERBACKEND_USE_REF_PTR not defined in include/osgUtil/RenderLeaf + +Sat, 11 May 2019 00:00:41 +0100 +Author : AnyOldName3 +Avoid wasting memory loading optional TGA fields as RLE image data + +Fri, 10 May 2019 00:04:49 +0100 +Author : AnyOldName3 +Add support for type 9 (colour mapped, compressed) TGA images. + +Fri, 10 May 2019 00:04:08 +0100 +Author : AnyOldName3 +Check TGA footer if present to see if attribute channel contains alpha data + +Wed, 8 May 2019 10:17:06 +0100 +Author : Robert Osfield +Merged ELSEIF fix from master + +Tue, 30 Apr 2019 11:03:02 +0200 +Author : Laurens Voerman +add missing E to ELSIF# Conflicts: +# src/osgViewer/CMakeLists.txt + + +Wed, 8 May 2019 00:59:40 +0100 +Author : AnyOldName3 +Consistently check for failed memory allocation + +Wed, 8 May 2019 00:56:42 +0100 +Author : AnyOldName3 +Switch to using safe buffers (fixing a memory leak) + +Sat, 4 May 2019 01:19:31 +0100 +Author : AnyOldName3 +Cleanup TGA header interpretation* Read the colour map `First Entry Index` field. If non-zero, error out as the format specification is vague as to what it does and different readers interpret it differently. +* Rename the variable that holds the colour map entry size as the existing name could be misinterpreted as the size of the pointer, not the thing pointed to. +* Handle images reporting themselves as 15 bits per pixel in the same way as Truevision's example code. + + +Fri, 26 Apr 2019 10:46:04 +0100 +Author : Robert Osfield +Fixed indentation + +Fri, 19 Apr 2019 13:04:35 +0800 +Author : Wei Lisi +remove tabs + +Fri, 5 Apr 2019 14:31:21 -0700 +Author : flashk +Update fbxRMesh.cpp + +Tue, 26 Mar 2019 22:37:50 +0800 +Author : Wei Lisi +clean up + +Tue, 26 Mar 2019 21:01:24 +0800 +Author : Wei Lisi +fix fbx hierarchy issue + +Wed, 28 Nov 2018 14:21:37 -0600 +Author : Derek Quam +Fix two bugs introduced when removing the Geode visitor from the FBX exporter.In the Geometry visitor, use getNodePath to check if the Geometry node +is root instead of getNumParents. + +Reset the state inside buildFaces to prevent duplication when a +Group is inside of Group. + + +Tue, 13 Nov 2018 08:47:06 -0600 +Author : Derek Quam +Fix duplicate geometries in FBX export.The fix to allow the export of orphaned Geometry nodes accidentally +duplicated those geometry nodes in 'normal' scene trees. This commit +refactors the code to rely on the visitor to traverse the Geometry as +opposed to traversing the Geometry in the Geode visit and the Geometry +visit. + + +Fri, 26 Apr 2019 09:36:51 +0100 +Author : OpenSceneGraph git repository +Merge pull request #745 from eligovision/OpenSceneGraph-3.6_cmake CMake: OSG_WINDOWING_SYSTEM fixed + +Sun, 14 Apr 2019 00:47:36 +0300 +Author : Konstantin S. Matveyev +CMake: Win32 option added to OSG_WINDOWING_SYSTEM + +Sun, 14 Apr 2019 00:04:11 +0300 +Author : valid-ptr +CMake: OSG_WINDOWING_SYSTEM fixed; FORCE flag removed + +Fri, 12 Apr 2019 13:57:35 +0100 +Author : Robert Osfield +cMerge branch 'OpenSceneGraph-3.6' of https://github.com/openscenegraph/OpenSceneGraph into OpenSceneGraph-3.6 + +Fri, 12 Apr 2019 13:55:39 +0100 +Author : Robert Osfield +Added ability to set which tree rendering techniques to build (via --featuers bitmask command line) and output scene to using -o outputfilename.extension command line. + +Thu, 11 Apr 2019 12:42:22 +0100 +Author : OpenSceneGraph git repository +Merge pull request #737 from eligovision/OpenSceneGraph-3.6_androidosgDB::DynamicLibrary: local lib loading on Android fixed + +Fri, 29 Mar 2019 16:25:43 +0300 +Author : Konstantin S. Matveyev +osgDB::DynamicLibrary: local lib loading on Android fixed + +Tue, 26 Mar 2019 06:52:09 +0100 +Author : Jeongseok Lee +Update CMakeModules/FindCOLLADA.cmakeKeeping old style operator to align with OSG CMake 2.8.0 support. + +Co-Authored-By: eknabe <44489094+eknabe@users.noreply.github.com> + + +Mon, 25 Mar 2019 14:09:04 +0000 +Author : Robert Osfield +Added basic load and compile stats collection enabled by --stats command line. + +Mon, 25 Mar 2019 12:42:28 +0000 +Author : Robert Osfield +Added a call to the CullSetting::readCommnadLine(..) to make sure the --NO_CULLING and --VIEW_FRUSTUM, --VIEW_FRUSTUM_SIDES command line parameters are honoured + +Mon, 25 Mar 2019 12:40:41 +0000 +Author : Robert Osfield +Added --NO_CULLING, --VIEW_FRSUTUM and --VIEW_FRUSTUM_SIDES/--vfs command line options for setting the Camera CullingMode value + +Wed, 20 Mar 2019 09:09:56 -0700 +Author : Jeongseok Lee +Update comments and fix cmake version check + +Tue, 19 Mar 2019 14:33:42 +0000 +Author : OpenSceneGraph git repository +Merge pull request #727 from ccochran/OpenSceneGraph-3.6Fixes Android build for osgViewer. + +Mon, 18 Mar 2019 08:55:05 -0600 +Author : Colin Cochran +Fixes osgViewer CMake build for Android.Adds FORCE to overwrite the cached OWG_WINDOWING_SYSTEM variable. + + +Sat, 16 Mar 2019 11:59:28 -0600 +Author : Colin Cochran +Fixes Android build for osgViewer.Previously, cmake attempted to build cocoa windowing system source even if MAKE_SYSTEM_NAME was set to ANDROID. + + +Fri, 15 Mar 2019 15:46:58 +0300 +Author : Capostrophic +Replace redundant asCullVisitor usage with a type check + +Sat, 16 Mar 2019 11:30:21 +0000 +Author : OpenSceneGraph git repository +Merge pull request #726 from Capostrophic/linearinterpolatorOverride default behavior for linear vector interpolations + +Fri, 15 Mar 2019 21:29:13 +0300 +Author : Capostrophic +Override default behavior for linear vector interpolations + +Tue, 26 Feb 2019 17:19:06 +0000 +Author : Chris Djali +Resolve OpenGL error caused by confusion between geometry shader implementations.There are two types of Geometry Shaders in OpenGL. One is provided by `GL_EXT_geometry_shader4` and `GL_ARB_geometry_shader4` and requires that certain parameters are set with calls to `glProgramParameteri` before the program is linked. The other is provided by OpenGL 3.2 as a core feature and by the GLES extensions `GL_EXT_geometry_shader` and `GL_OES_geometry_shader` and requires these parameters to be set in the GLSL source itself. + +The value of `isGeometryShader4Supported` is being used to determine if the `glProgramParameteri` calls should occur, so it should only be `true` when one of the extensions requiring them is present. + +Tue, 5 Mar 2019 09:32:55 -0800 +Author : flashk +Update StackedTransform.cpp + +Sun, 10 Mar 2019 15:43:48 +0300 +Author : Capostrophic +Avoid unnecessary matrix type conversion in osgParticle + +Thu, 14 Mar 2019 10:13:15 +0000 +Author : Robert Osfield +Removed the optional code path hack + +Wed, 13 Mar 2019 20:05:12 +0300 +Author : Capostrophic +Add OSG_USE_FLOAT_QUAT build option to use single precision quaternions + +Thu, 14 Mar 2019 09:39:40 +0000 +Author : OpenSceneGraph git repository +Merge pull request #724 from AnyOldName3/more-gitignoreAdd missing files to .gitignore + +Wed, 13 Mar 2019 23:13:41 +0000 +Author : AnyOldName3 +Add Visual Studio cache/options directory to .gitignore + +Wed, 13 Mar 2019 23:13:00 +0000 +Author : AnyOldName3 +Add missing documentation build files to .gitignore + +Mon, 25 Feb 2019 15:06:54 +0000 +Author : Robert Osfield +Streamline the animation path completion message + +Tue, 29 Jan 2019 14:40:16 +0100 +Author : Daniel Trstenjak +OcclusionQueryNode: reset the test result of the invalid geometryThere're cases that the occlusion test result has been retrieved +after the query geometry has been changed, it's the result of the +geometry before the change. + + +Tue, 29 Jan 2019 11:37:28 +0100 +Author : Daniel Trstenjak +OcclusionQueryNode: ensure a valid query geometryIf the query geometry is invalid then don't do any occlusion queries and +never traverse the subgraphs. + + +Mon, 4 Feb 2019 14:46:42 +0100 +Author : Björn Blissing +Add search location for textures in FBX pluginThe FBX plugin may fail texture lookup even if the texture is located in +the same folder as the model file. This change tries, as a last resort, +to check if the texture filename is available in the same folder as the +model. + + +Wed, 20 Feb 2019 16:54:23 +0000 +Author : OpenSceneGraph git repository +Merge pull request #704 from mp3butcher/patch-24uncomment INLINE_DRAWABLE_DRAW + +Wed, 20 Feb 2019 16:31:58 +0000 +Author : Robert Osfield +Added override for broken bindings + +Mon, 28 Jan 2019 01:40:35 +0100 +Author : Julien Valentin +uncomment INLINE_DRAWABLE_DRAW + +Sat, 26 Jan 2019 19:36:30 +0000 +Author : Robert Osfield +Updates for 3.6.4-rc3 + +Sat, 26 Jan 2019 18:21:47 +0000 +Author : OpenSceneGraph git repository +Merge pull request #702 from mp3butcher/fix36add MeshReindexation flag + +Sat, 26 Jan 2019 18:10:44 +0000 +Author : Robert Osfield +Added missing {} to fix getPassed() bug introducted by previus commit + +Fri, 25 Jan 2019 15:02:45 +0100 +Author : Daniel Trstenjak +OcclusionQueryNode: ensure a consistent value for '_passed' + +Sat, 26 Jan 2019 16:33:23 +0000 +Author : Robert Osfield +Introduced a QueryGeometry::getQueryResult(const osg::Camera*) method as a more informative replacedment for QueryGeometry::getNumPixels(). + +Wed, 23 Jan 2019 12:10:00 +0100 +Author : Daniel Trstenjak +OcclusionQueryNode: add resetting of queriesIf there's a big view change then it might not be appropriate to wait +for '_queryFrameCount' till the next query is issued, because then +geometry might pop into the view after '_queryFrameCount'. + +This is especially important for applications not having a constant +frame rate, but just issue a new frame on demand. + + +Wed, 23 Jan 2019 17:06:04 +0100 +Author : mp3butcher +fix variable name + +Fri, 17 Aug 2018 09:22:40 +0100 +Author : OpenSceneGraph git repository +Changed member variable name to be consistent with header + +Fri, 17 Aug 2018 09:21:31 +0100 +Author : OpenSceneGraph git repository +Changed the member variable to be consistent with the method name. + +Thu, 16 Aug 2018 00:18:24 +0200 +Author : mp3butcher +add a bool parameter to allow forced reindexation of a mesh + +Wed, 23 Jan 2019 15:40:13 +0000 +Author : Robert Osfield +Commented out the reset of the _vertexArrayObject = 0 as it was break later State::resetCurrentVertexArrayStateOnMatch() calls ability to reset the State::_currentVAO when required. + +Wed, 23 Jan 2019 08:52:11 +0000 +Author : Robert Osfield +Fixed typo + +Tue, 22 Jan 2019 20:21:56 +0000 +Author : Robert Osfield +Added separate test and rest of _currentVAO to State::resetCurrentVertexArrayStateOnMatch(..) method + +Mon, 21 Jan 2019 18:13:43 +0000 +Author : Robert Osfield +Changed resetCurrentVertexArrayStateOnMatch() to reset _vas tp _globalVertexArrayState and currentVAO to 0. + +Mon, 21 Jan 2019 17:36:40 +0000 +Author : Robert Osfield +Added reset of the State::CurrentVertexArrayState() to prevent the State::_vas becoming a dangling pointer when VertexArrayState objects are deleted. + +Sat, 19 Jan 2019 16:16:53 +0000 +Author : Robert Osfield +Added calling of releaseGLObjects() and resizeGLObjects() to the Camera DrawCallback's to enable the draw callbacks to clean up their own GL objects. + +Thu, 17 Jan 2019 17:24:22 +0000 +Author : OpenSceneGraph git repository +Merge pull request #693 from LaurensVoerman/glObj_C4250fix MSVC warning C4250: inherits 'X' via dominance (94x) + +Thu, 17 Jan 2019 16:22:51 +0100 +Author : Laurens Voerman +fix MSVC warning C4250: inherits 'X' via dominance (94x) + +Mon, 14 Jan 2019 11:55:24 +0000 +Author : Robert Osfield +Added derpecated and thread unsafe warning message to docs of ObjectCache::getgetFromObjectCache() + +Mon, 14 Jan 2019 10:23:05 +0000 +Author : OpenSceneGraph git repository +Merge pull request #691 from LaurensVoerman/clrObjCacheclear temp objectCache in databaseRequest + +Mon, 14 Jan 2019 09:55:00 +0000 +Author : Robert Osfield +Added using to quieten VS warnings + +Mon, 14 Jan 2019 10:19:41 +0100 +Author : Laurens Voerman +clear temp objectCache in databaseRequest + +Sat, 12 Jan 2019 11:27:18 +0000 +Author : Robert Osfield +Moved resizeGLObjects/releaseGLObjects out of Referenced to avoid multiple inheritance warnings + +Thu, 10 Jan 2019 09:45:32 +0000 +Author : Robert Osfield +Added read/writeObject() entry point to FBX plugin. + +Wed, 9 Jan 2019 10:22:54 +0000 +Author : Robert Osfield +Upated ChangeLog + +Wed, 9 Jan 2019 10:19:34 +0000 +Author : Robert Osfield +Updated for 3.6.4-rc2 + +Wed, 9 Jan 2019 08:51:29 +0000 +Author : Robert Osfield +Added cmake package configuration files to gitignore + +Wed, 9 Jan 2019 08:43:08 +0000 +Author : Robert Osfield +Replaced use of heap with use of stack created ifstream to avoid potential memory leak + +Wed, 9 Jan 2019 08:38:16 +0000 +Author : Robert Osfield +Introduced use of ref_ptr<> and private destructor to tighen up memory management and avoid users attempting to inappropriately delete TexCoordRange. + +Tue, 8 Jan 2019 19:32:50 +0000 +Author : Robert Osfield +Fixed for crashes on exit associaciated with VAO usage and vairous niche usage cases + +Mon, 7 Jan 2019 17:46:02 +0000 +Author : Robert Osfield +Fixed crash on exit issues with osgFX, osgParticle, osgSim and the osgforest example + +Mon, 7 Jan 2019 10:25:13 +0000 +Author : Robert Osfield +Merged changes from master + +Fri, 4 Jan 2019 09:22:12 +0000 +Author : Robert Osfield +Updated rc number for 3.6.4 release candidate + +Fri, 4 Jan 2019 09:10:39 +0000 +Author : Robert Osfield +Updated ChangeLog and AUTHORS in prep for 3.6.4 work + +Fri, 4 Jan 2019 08:10:15 +0000 +Author : Robert Osfield +Added use of sizeof to make code a bit more flexible + +Fri, 4 Jan 2019 08:08:07 +0000 +Author : Robert Osfield +Restructured the clean up of arrays/primitives and GL objects + +Mon, 31 Dec 2018 11:06:45 +0000 +Author : Robert Osfield +Changed the clean up of the GL objects on destruction so that the destructors of the arrays/primitives themselves do the release rather than have it done explictly in the destructor. This allows arrays/primitives to be shared. + +Thu, 20 Dec 2018 08:46:12 +0000 +Author : OpenSceneGraph git repository +Merge pull request #679 from mp3butcher/patch-18setup camera Read/Draw Buffer + +Wed, 19 Dec 2018 18:30:26 +0100 +Author : Julien Valentin +setup camera Read/Draw Bufferfix flickering shadows in SingleThread + +Fri, 14 Dec 2018 09:14:26 +0000 +Author : Robert Osfield +Removed examples from build as it was causing travis to timeout + +Thu, 13 Dec 2018 14:06:51 +0000 +Author : OpenSceneGraph git repository +Fixed indentation + +Thu, 13 Dec 2018 08:31:27 +0000 +Author : OpenSceneGraph git repository +Merge pull request #671 from mp3butcher/patch-16remove useless code + +Thu, 13 Dec 2018 08:01:24 +0000 +Author : OpenSceneGraph git repository +Merge pull request #672 from ccochran/OpenSceneGraph-3.6Xcode 9/10 build fixes for OSG 3.6 + +Tue, 11 Dec 2018 23:56:47 +0100 +Author : Julien Valentin +remove dead code + +Mon, 23 Jul 2018 23:52:16 +0100 +Author : Thomas Hogarth +removed ios simulator reference, adjusted readme + +Tue, 10 Jul 2018 02:09:28 +0100 +Author : Thomas Hogarth +Improved iOS cmake support for xcode 9.4 and cmake 3.11 + +Fri, 7 Dec 2018 14:53:52 +0000 +Author : OpenSceneGraph git repository +Merge pull request #670 from emminizer/four-byte-utf8osgText::String:createUTF8EncodedString() now supports 4-byte UTF-8 strings (code points over 0x100000) + +Thu, 6 Dec 2018 14:07:55 -0500 +Author : Daniel Emminizer +osgText::String:createUTF8EncodedString() now supports 4-byte UTF-8 strings (code points over 0x100000). + +Tue, 20 Nov 2018 16:12:21 -0800 +Author : flashk +Prefer FOURCC pixel format in DDS loaderI have found that certain image editing programs export DDS images with both the DDPF_FOURCC and DDPF_RGB pixel format flags. The DDS loader will give preference to the DDPF_RGB flag and try to deduce the format from the RGB bit mask values instead of using the more reliable FOURCC flag. This causes some images to not load, even though the FOURCC flag is supported. I've modified the loader so that it checks for the DDPF_FOURCC flag first, then falls back on deducing the format from the RGB bit masks. + +Tue, 20 Nov 2018 14:24:24 +0000 +Author : Robert Osfield +Added, currently commented out, alias for .vsga and .vsgb to help with automatic loading a vsg plugin when .vsga and .vsgb files are encountered. + +Tue, 20 Nov 2018 14:19:37 +0000 +Author : Robert Osfield +Added support for reading and writing images + +Sun, 11 Nov 2018 10:14:50 +0000 +Author : Robert Osfield +Restructed the setting of the OSG_GL_CONTEXT_VERSION to allow script to set it's default value + +Fri, 9 Nov 2018 11:28:57 +0000 +Author : Robert Osfield +Added make clobber target, imported in from the VSG project. + +Fri, 9 Nov 2018 11:25:16 +0000 +Author : Robert Osfield +Removed 12 year old workaround that is no longer required and was causing a misleading info message "OpenGL extension '' is not supported." to be reported. + +Fri, 2 Nov 2018 08:34:43 +0000 +Author : OpenSceneGraph git repository +Replaced tabs with spaces to fix indentation + +Thu, 1 Nov 2018 10:49:40 -0700 +Author : flashk +Fix handling of alpha values in animated gifsThe gif loader was incorrectly setting pixels as transparent in certain animated gifs. It was ignoring the disposal method value in the extension block and always overwriting the alpha value in each frame. It is common for some animated gifs to set the disposal method so that the previous alpha value is retained. This patch modifies the loader to respect the disposal method flag. + +Thu, 1 Nov 2018 09:13:43 +0000 +Author : Robert Osfield +Removed reprecated C++ usage + +Mon, 29 Oct 2018 07:22:50 +0100 +Author : Emil Knabe +Added support for FBX 2019 + +Tue, 23 Oct 2018 08:44:55 +0100 +Author : OpenSceneGraph git repository +Merge pull request #649 from LaurensVoerman/3.6-dae3.6 dae + +Fri, 12 Oct 2018 13:25:13 -0700 +Author : flashk +Update daeRMaterials.cpp + +Fri, 12 Oct 2018 13:23:23 -0700 +Author : flashk +Update daeReader.h + +Wed, 17 Oct 2018 15:55:10 +0100 +Author : Robert Osfield +Added check under Windows for a concatinated path that exceeds the MAX_PATH so that it isn't used for file IO operations that could lead to undefined behavior https://github.com/openscenegraph/OpenSceneGraph/issues/634 + +Mon, 15 Oct 2018 11:03:54 -0700 +Author : flashk +Update ReaderWriterDAE.cpp + +Thu, 11 Oct 2018 16:13:01 -0700 +Author : flashk +Fix crash in Collada loaderThe collada loader would crash when processing effects that didn't have a technique defined. + +Wed, 10 Oct 2018 02:33:47 +0300 +Author : Boris Pek +fix builds with case sensitive includesTested during cross-compilation for MS Windows using MinGW. + + +Wed, 10 Oct 2018 13:10:55 +0100 +Author : Robert Osfield +Fixed buld + +Wed, 10 Oct 2018 08:31:30 +0200 +Author : Antoine Lavenant +fix apply once + +Wed, 3 Oct 2018 14:21:03 -0700 +Author : flashk +Fix for HDR DDS imagesThe DDS loader was not applying the correct internal format for certain HDR images (e.g. float/half_float formats) + +Wed, 3 Oct 2018 14:12:54 -0700 +Author : flashk +osgDB::OutputStream write array optimizationI've made a change to osgDB::OutputStream::writeArrayImplementation so that it writes the array data in a single write operation for binary files. This significantly speeds up writing out osgb files for large data sets (e.g. point clouds). osgDB::InputStream already performs a similar optimization when reading array data from binary files. + +Wed, 3 Oct 2018 11:32:10 -0700 +Author : flashk +Fix for GifImageStream::setReferenceTimeSetting the reference time greater than the duration of a gif would cause a crash. Also, the current reference time is not immediately updated when manually setting the reference time. + +Wed, 3 Oct 2018 09:59:34 -0700 +Author : flashk +Update ReaderWriterFBX.cpp + +Wed, 3 Oct 2018 09:52:10 -0700 +Author : flashk +Update fbxRMesh.cpp + +Wed, 3 Oct 2018 09:49:37 -0700 +Author : flashk +Update fbxReader.h + +Tue, 2 Oct 2018 09:04:26 -0700 +Author : flashk +Fix hardware mipmap generation for cube mapsI was getting a black image when enabling hardware mipmap generation on cubemaps. I believe the problem is that the base Texture class is hard coding GL_TEXTURE_2D when enabling mipmap generation, instead of using the target type from the derived class. + +Tue, 2 Oct 2018 12:21:31 +0100 +Author : Robert Osfield +Removed unused static variables + +Tue, 2 Oct 2018 11:28:34 +0100 +Author : Robert Osfield +From Andy Skinner, Added ~GLExtensions to clear cached values for context ID + +Mon, 1 Oct 2018 23:13:10 +0200 +Author : Julien Valentin +add version and required extensionlet a chance to work on intel chipset + +Tue, 2 Oct 2018 10:46:25 +0100 +Author : OpenSceneGraph git repository +Merge pull request #627 from eligovision/OpenSceneGraph-3.6_gui_adapters_1px1px error in GUIEventAdapter, View, Viewer and CompositeViewer major fix + +Fri, 21 Sep 2018 13:26:18 +0300 +Author : Konstantin S. Matveyev +1px error in GUIEventAdapter, View, Viewer and CompositeViewer major fix + +Fri, 14 Sep 2018 11:16:53 +0100 +Author : Robert Osfield +Updated ChangeLog for 3.6.3 release + +Fri, 14 Sep 2018 10:41:24 +0100 +Author : Robert Osfield +Updated version number and date for 3.6.3 stable release + +Thu, 13 Sep 2018 08:52:21 +0100 +Author : Robert Osfield +Updated ChangeLog for 3.6.3-rc3 + +Thu, 13 Sep 2018 08:47:17 +0100 +Author : Robert Osfield +Updated for 3.6.3-rc3 + +Wed, 12 Sep 2018 17:45:49 +0100 +Author : Robert Osfield +Standardized the glTexStorage*() calls to use osg::maximum(_numMipmapLevels,1) of rnumber of mipmaps to keep the usage consistent. Fixed the erronous Texture2DArray glTexStorage call so that it used the _numMipmapLevels as above to resolve bug in allocation. + +Tue, 11 Sep 2018 15:32:44 +0100 +Author : Robert Osfield +Warning fixes + +Tue, 11 Sep 2018 12:29:40 +0100 +Author : Robert Osfield +Fixed warning + +Tue, 11 Sep 2018 12:23:01 +0100 +Author : Robert Osfield +Updated for 3.6.3-rc2 + +Tue, 11 Sep 2018 11:56:04 +0100 +Author : Robert Osfield +Updated rc number 2 for 3.6.3-rc2 + +Tue, 11 Sep 2018 11:29:36 +0100 +Author : OpenSceneGraph git repository +Merge pull request #620 from LaurensVoerman/txt_SCREEN_COORDSfix scale problem for osgText with characterSizeMode SCREEN_COORDS and _position set. + +Tue, 11 Sep 2018 11:23:34 +0100 +Author : Robert Osfield +Fixed hang using a ReentrantMutex + +Tue, 11 Sep 2018 10:13:49 +0100 +Author : Robert Osfield +Fixed build + +Tue, 11 Sep 2018 09:31:35 +0100 +Author : Robert Osfield +Fixed build + +Tue, 11 Sep 2018 09:03:01 +0100 +Author : Robert Osfield +Cleaned up code + +Mon, 10 Sep 2018 08:00:41 -0400 +Author : gwaldron +osgText: fixed thread-safety issues in Glyph and Font + +Sat, 8 Sep 2018 18:18:33 +0200 +Author : mp3butcher +fix examples context creation for X11 (when display not :0.0) + +Tue, 11 Sep 2018 08:34:20 +0100 +Author : OpenSceneGraph git repository +Merge pull request #619 from mathieu/topic/SaveInlinedImagesAdded saving of inline Images without having the physical image file. + +Tue, 11 Sep 2018 08:11:27 +0100 +Author : Robert Osfield +Added greater control of how cubemap is set up and controlled + +Fri, 7 Sep 2018 15:09:15 +0200 +Author : Laurens Voerman +fix scale problem for osgText with characterSizeMode SCREEN_COORDS and _position set. + +Fri, 7 Sep 2018 14:04:41 +0200 +Author : Mathieu MARACHE +Added saving of inline Images without having the physical image file.The can be read from and inlined image file + + +Thu, 6 Sep 2018 12:30:18 +0100 +Author : Robert Osfield +Merge branch 'OpenSceneGraph-3.6' of https://github.com/openscenegraph/OpenSceneGraph into OpenSceneGraph-3.6 + +Thu, 6 Sep 2018 12:29:44 +0100 +Author : Robert Osfield +Updated for 3.6.3-rc1 + +Thu, 6 Sep 2018 11:50:21 +0100 +Author : Robert Osfield +Fixed memory leak with assignment of default value to ObjectSerializer + +Wed, 5 Sep 2018 18:06:25 +0100 +Author : OpenSceneGraph git repository +Merge pull request #616 from eligovision/OpenSceneGraph-3.6_particlesParticleSystem: Added support for GLES2 and upper (GL_QUADS -> GL_TRI… + +Wed, 5 Sep 2018 18:01:33 +0100 +Author : Robert Osfield +Fixed copy constructor + +Wed, 5 Sep 2018 19:00:29 +0300 +Author : Konstantin S. Matveyev +ParticleSystem: Using of GL_TRIANGLES for GLES2 and upper; GL_QUADS otherwise + +Wed, 5 Sep 2018 14:04:57 +0100 +Author : OpenSceneGraph git repository +Merge pull request #617 from aluaces/Image_scaleImage_typoFix typo in the initial check of Image::scaleImage(). + +Wed, 5 Sep 2018 13:27:35 +0200 +Author : Alberto Luaces +Fix typo in the initial check of Image::scaleImage(). + +Wed, 5 Sep 2018 14:00:09 +0300 +Author : Konstantin S. Matveyev +ParticleSystem: Added support for GLES2 and upper (GL_QUADS -> GL_TRIANGLES) + +Tue, 4 Sep 2018 10:35:38 -0400 +Author : Jason Beverage +Protect the _programSet in Shader with a mutex. This prevents thread safety issues when Shader objects are used in multiple programs. + +Wed, 5 Sep 2018 09:33:24 +0100 +Author : Robert Osfield +Updated ChangeLog + +Tue, 4 Sep 2018 15:26:30 +0100 +Author : Robert Osfield +Changed the ShapeDrawable::build() methpd so that it does run when the ShadpwDrawabe is a KdTree. + +Tue, 4 Sep 2018 14:13:32 +0100 +Author : Robert Osfield +Updated SO version as XmlNode::Input changes change the ABI + +Tue, 4 Sep 2018 12:19:14 +0100 +Author : Robert Osfield +Added support for reading UTF-8 encoded of xml files + +Mon, 3 Sep 2018 12:30:02 +0100 +Author : Robert Osfield +Changed the logic for whether to call setUpThreading() in setThreadingModel() to make it possible to changed threadings even if the threading model starts of as SingleThreaded + +Mon, 3 Sep 2018 11:19:50 +0100 +Author : Robert Osfield +Updated version number to 3.6.3 in prep for next naintainance release + +Mon, 3 Sep 2018 10:16:45 +0100 +Author : Robert Osfield +Merge branch 'OpenSceneGraph-3.6-TexStorage' into OpenSceneGraph-3.6 + +Mon, 3 Sep 2018 09:37:36 +0100 +Author : Robert Osfield +Added reset of _stateset to prevent the releaseGLObjects calling release on th StateSet from the destructor + +Mon, 3 Sep 2018 09:37:36 +0100 +Author : Robert Osfield +Added reset of _stateset to prevent the releaseGLObjects calling release on th StateSet from the destructor + +Tue, 28 Aug 2018 11:22:57 +0100 +Author : Robert Osfield +Replaced the glSGetProcAddressARB code with the dlsym() usage as the NVidia driver looks to be returning non NULL pointers for invalid function names. + +Tue, 28 Aug 2018 11:22:57 +0100 +Author : Robert Osfield +Replaced the glSGetProcAddressARB code with the dlsym() usage as the NVidia driver looks to be returning non NULL pointers for invalid function names. + +Wed, 22 Aug 2018 11:13:11 +0100 +Author : Robert Osfield +Enabled point sprite validty modes. + +Wed, 22 Aug 2018 11:13:11 +0100 +Author : Robert Osfield +Enabled point sprite validty modes. + +Wed, 22 Aug 2018 10:42:18 +0100 +Author : Robert Osfield +Merged fix for PointSprite modes validity checks from master. + +Wed, 22 Aug 2018 10:42:18 +0100 +Author : Robert Osfield +Merged fix for PointSprite modes validity checks from master. + +Tue, 21 Aug 2018 09:38:03 -0400 +Author : plevy +Change GL_RGBA16F to GL_RGBA16F_ARB to fix Windows BuildChange GL_RGBA16F to GL_RGBA16F_ARB to fix Windows build. + +Tue, 21 Aug 2018 09:38:03 -0400 +Author : plevy +Change GL_RGBA16F to GL_RGBA16F_ARB to fix Windows BuildChange GL_RGBA16F to GL_RGBA16F_ARB to fix Windows build. + +Tue, 21 Aug 2018 09:19:50 +0100 +Author : Robert Osfield +Replaced GL_RGBA32F with GL_RGBA32F_ARB to fix Windows build + +Tue, 21 Aug 2018 09:19:50 +0100 +Author : Robert Osfield +Replaced GL_RGBA32F with GL_RGBA32F_ARB to fix Windows build + +Mon, 20 Aug 2018 10:08:09 +0100 +Author : OpenSceneGraph git repository +Merge pull request #606 from mp3butcher/OpenSceneGraph-3.6-TexStorageOpen scene graph 3.6 tex storage + +Mon, 20 Aug 2018 05:10:11 +0200 +Author : mp3butcher +complete TexStorage support + +Mon, 20 Aug 2018 04:50:14 +0200 +Author : mp3butcher +add more extensions + +Sun, 19 Aug 2018 22:46:10 +0200 +Author : mp3butcher +remove redondant variable and test + +Fri, 17 Aug 2018 16:51:55 +0100 +Author : Robert Osfield +Removed check as this is better outside of the function + +Fri, 17 Aug 2018 12:20:59 +0100 +Author : Robert Osfield +Created a GLenum Texture::selectSizedInternalFormat(const osg::Image* image=0) const method to help clean up set up of glTexStorage. Fixed typo. + +Fri, 17 Aug 2018 10:31:46 +0100 +Author : Robert Osfield +Merged changes to InternalPixelRelations sizedInternalFormats[] from master + +Thu, 16 Aug 2018 19:23:17 +0100 +Author : Robert Osfield +Fixed memory leak associated with VertexArrayStte objects not getting released on destruction of Geometry/Drawables. + +Wed, 8 Aug 2018 14:42:04 +0100 +Author : Robert Osfield +From Chris White, Cygwin build fix + +Wed, 8 Aug 2018 15:05:53 +0300 +Author : Vic-Min +Renamed USE_DEPRECATED_API to OSG_USE_DEPRECATED_API + +Tue, 31 Jul 2018 16:58:41 +0100 +Author : OpenSceneGraph git repository +Merge pull request #583 from emminizer/flt-registry-cacheOpenFlight: Replace internal caches with osgDB::ObjectCache use. Fix… + +Tue, 31 Jul 2018 11:45:33 -0400 +Author : Daniel Emminizer +OpenFlight: Replace internal caches with osgDB::ObjectCache use. Fixes unbounded memory growth when using readNode(std::istream&, ...) method. + +Tue, 31 Jul 2018 09:13:20 +0100 +Author : Robert Osfield +Removed unneccessary FIX ME statement. + +Fri, 27 Jul 2018 17:34:30 +0100 +Author : Robert Osfield +Fixed check against dataType changes + +Wed, 25 Nov 2015 09:36:15 +1100 +Author : Alex Burton +updated osgviewerWX to remove deprecated calls in wxWidgets 3.x + +Mon, 9 Jul 2018 17:55:38 +0100 +Author : OpenSceneGraph git repository +Merge pull request #573 from emminizer/fix-flt-typoFLT: Fix texture unit typo and code style from PR 568. + +Mon, 9 Jul 2018 06:34:41 -0400 +Author : Daniel Emminizer +FLT: Fix texture unit typo and code style from PR 568. + +Fri, 29 Jun 2018 10:56:35 +0100 +Author : Robert Osfield +Updated ChangeLog for 3.6.2 release + +Fri, 29 Jun 2018 10:56:01 +0100 +Author : Robert Osfield +Updated date for 3.6.2 releases + +Fri, 29 Jun 2018 10:54:13 +0100 +Author : Robert Osfield +Updates for 3.6.2 stable release + +Fri, 29 Jun 2018 10:53:23 +0100 +Author : Robert Osfield +Fixed isPointSpriteModeSupported assignment bug + +Fri, 29 Jun 2018 09:52:47 +0100 +Author : Robert Osfield +Removed the gl3.h usage for GL3 case as these headers were replaced by glcorearb.h, it's probably better to just fallback to gl.h and have the OSG get the extentions at runtime. + +Thu, 28 Jun 2018 07:34:49 +0100 +Author : Robert Osfield +UPdated ChangeLog + +Thu, 28 Jun 2018 07:06:59 +0100 +Author : Robert Osfield +Updated for rc3 + +Wed, 27 Jun 2018 21:21:31 -0700 +Author : Larry-Hu +Remove call to nonexistent member seekpos() of std::fpos in VS 2017 version 15.8 or later + +Wed, 27 Jun 2018 20:59:09 +0100 +Author : OpenSceneGraph git repository +Merge pull request #568 from emminizer/fix-flt-texture-export-gl3OpenFlight: Textures now correctly export in GLCORE mode. + +Wed, 27 Jun 2018 12:57:20 -0400 +Author : Daniel Emminizer +OpenFlight: Textures now correctly export in GLCORE mode. + +Wed, 27 Jun 2018 09:17:00 +0100 +Author : Robert Osfield +Updated for 3.6.2-rc2 + +Wed, 27 Jun 2018 09:06:58 +0100 +Author : Robert Osfield +Fixed relaseGLObjects() calls + +Tue, 26 Jun 2018 20:50:55 +0100 +Author : Robert Osfield +Merge branch 'OpenSceneGraph-3.6' of https://github.com/openscenegraph/OpenSceneGraph into OpenSceneGraph-3.6 + +Tue, 26 Jun 2018 20:46:49 +0100 +Author : Robert Osfield +Replaced creation of a temporary Settings object on the heap with creation on the stack to improve performance + +Tue, 26 Jun 2018 20:17:07 +0100 +Author : OpenSceneGraph git repository +Merge pull request #566 from emminizer/fix-gl_rb-in-gluscaleimageGL_RG is now a supported format in gluScaleImage(). + +Tue, 26 Jun 2018 20:10:51 +0100 +Author : Robert Osfield +Added GLExtensions::isPointSpriteModeSupported to allow it to be enable for GL versions that support GL_POINT_SPRITE_ARB/GL_POINT_SPRITE_OES + +Tue, 26 Jun 2018 14:44:34 -0400 +Author : Daniel Emminizer +GL_RG is now a support format in gluScaleImage(). + +Mon, 25 Jun 2018 20:02:30 +0100 +Author : Robert Osfield +Moved osg::clampProjectionMatrix() template from CullVisitor.cpp into include/osg/CullSettings to make it easier to implement custom clampProjectionMatrix callbacks + +Wed, 20 Jun 2018 13:59:10 +0100 +Author : Robert Osfield +Updates for 3.6.2-rc1 + +Tue, 19 Jun 2018 17:09:56 +0100 +Author : Calum Robinson +Fix z near calculation for lines + +Tue, 19 Jun 2018 11:50:38 +0100 +Author : OpenSceneGraph git repository +Merge pull request #558 from LaurensVoerman/submit-ffmpeg3.2resolve av sync failure with ffmpeg 3.2 and up + +Tue, 19 Jun 2018 09:21:02 +0200 +Author : Laurens Voerman +resolve av sync failure with ffmpeg 3.2 and up + +Tue, 19 Jun 2018 00:33:03 +0800 +Author : 弥继平 +Fixed the position of the viewport for the cameraThe position of viewport doesn't setup properly, some part of viewer is out of CMFC_OSG_MDIView, and not visible. + +Thu, 14 Jun 2018 14:31:28 +0200 +Author : Laurens Voerman +remove include/osgQt from doxyfiles; add osgPresentation and osgUI + +Thu, 14 Jun 2018 14:44:16 +0100 +Author : OpenSceneGraph git repository +Merge pull request #555 from emminizer/fix-noisy-flt-loadingFLT: Missing optional attr files on textures no longer generates a co… + +Thu, 14 Jun 2018 07:33:08 -0400 +Author : Daniel Emminizer +FLT: Missing optional attr files on textures no longer generates a console warning. + +Thu, 14 Jun 2018 08:54:21 +0100 +Author : Robert Osfield +Changed version to 3.6.2 in prep for next release + +Thu, 14 Jun 2018 08:51:00 +0100 +Author : Robert Osfield +To handle calling Array::setBinding() after Geometry::set*Array() call, to the Geometry::addVertexBufferObjectIfRequired(osg::Array* array) added treatment of array->getBinding()==Array::BIND_UNDEFINED as BIND_PER_VERTEX as a safe fallback. + +Wed, 13 Jun 2018 12:23:29 +0100 +Author : Robert Osfield +Moved Stae::setUseVertexAttributeAliasing(bool) implementation to .cpp an added call to _globalVertexArrayState->assignAllDispatchers(); to ensure state is consistent + +Sun, 3 Jun 2018 10:27:00 +0100 +Author : Robert Osfield +Updated LICENSE to use the WxWidgets-3.1 and updates to the LGPL-2.1-only that updates addresses and tighten up language used.Functionality the OSGPL-1.0 is the same as OSGPL-0.0, All the OpenSceneGraph users can use either OSGPL-0.0 or OSGPL-1.0. + + +Thu, 31 May 2018 15:11:19 +0100 +Author : Robert Osfield +Removed deprecated xine plugin to simplify licensing (xine plugin is GPL'd) + +Thu, 31 May 2018 14:45:37 +0100 +Author : Robert Osfield +As the author of all the files in osgPresentation and present3D have rectified the license notices to reflect their intended license rather than histoical license they had prior to being merged into the OpenSceneGraph project. OSGPL was always intended but missed during merge. Replaced the GPL notices with OSGPL usge in present3D and include/osgPresentation as this was intended when Present3D was merged back into OpenSceneGraph but missed. + +Mon, 28 May 2018 08:58:21 +0100 +Author : Robert Osfield +Updated for 3.6.1 + +Sun, 27 May 2018 14:21:57 +0200 +Author : Philippe Renon +Notify: silence warning about unused argument + +Wed, 23 May 2018 19:54:10 +0100 +Author : Robert Osfield +Updated ChangeLog + +Wed, 23 May 2018 19:53:12 +0100 +Author : Robert Osfield +Updates for 3.6.1-rc7 + +Wed, 23 May 2018 17:02:28 +0100 +Author : Robert Osfield +Updated REMOVE_SERIALIZER( ImageAttachment ); block to use 154 version to retain compatibility with binaries made with 153 SOVERSION prior to the Imageattachement change + +Wed, 23 May 2018 14:30:31 +0100 +Author : Robert Osfield +Implemented StateGraph reuse in in scene graph Canera's RenderStage. + +Wed, 23 May 2018 14:13:27 +0100 +Author : Robert Osfield +Fixed warning of RenderLeaf's having multiple references in CullVisitor::createOrReuseRenderLeaf() but forcing a clean up of the StateGraph at the end of RenderStage::draw() + +Wed, 23 May 2018 07:47:15 +0100 +Author : Robert Osfield +Added check to make sure that glEnablei and glDisablei are only called when the capability is non zero to fix GL invalid value error. + +Wed, 23 May 2018 06:32:42 +0100 +Author : Robert Osfield +Fixed type of Timer_t under Windows + +Tue, 22 May 2018 09:04:48 +0100 +Author : Robert Osfield +Updates for rc6 + +Mon, 21 May 2018 13:26:04 -0400 +Author : gwaldron +osgText: perform pixel size computation in double-precision to prevent coordinate jitter + +Mon, 21 May 2018 18:14:18 +0100 +Author : Robert Osfield +Moved the rotation to before the scale + +Mon, 21 May 2018 13:18:29 +0100 +Author : Robert Osfield +Fixed typos + +Mon, 21 May 2018 13:10:40 +0100 +Author : Robert Osfield +Restored the REGISTER_WINDOWINGSYSTEMINTERFACE macro to the include/osg/GraphicsContext header and removed the OSGVIEWER_EXPORT as this was causing compatibility issues with osgQt.In GraphicsWindowWin32 replaced REGISTER_WINDOWINGSYSTEMINTERFACE usage with locally implemented equivilant with the required OSGVIEWER_EXPORT. + + +Sun, 20 May 2018 13:39:44 +0100 +Author : Robert Osfield +Updated ChangeLog and README.md for rc5 + +Sun, 20 May 2018 13:22:58 +0100 +Author : Robert Osfield +Restructed SCREEN auto scaling so that it's removes the rotation of the modelview matrix so that the XY coords of the text map directly to window xy coords for all text alignment types + +Fri, 18 May 2018 15:49:28 +0100 +Author : Robert Osfield +Updates in prep for 3.6.1-rc5 + +Fri, 18 May 2018 14:58:53 +0100 +Author : Robert Osfield +Moved REGISTER_WINDOWINGSYSTEMINTERFACE from include/osg/GraphicsContext to include/osgViewer/GraphicsWindow and added OSGVIEWER_EXPORT + +Fri, 18 May 2018 13:53:39 +0100 +Author : Robert Osfield +Added GL_RED and GL_RG support to _readColor()/Image::getColor(); + +Fri, 18 May 2018 12:52:50 +0100 +Author : Robert Osfield +Cleaned up the WindowingSystemInterface registration + +Fri, 18 May 2018 12:47:34 +0100 +Author : Robert Osfield +Fixed create of graphics context by explicting adding USE_GRAPHICSWINDOW to force the WindowingSystemInterface to initialize + +Fri, 18 May 2018 12:42:20 +0100 +Author : Robert Osfield +Quitened down unsupport compression output when passing in a file with a non rgb extension + +Fri, 18 May 2018 10:00:10 +0100 +Author : Robert Osfield +Introduced a local StateGraph hierarchy into CullVisitor::apply(osg::Camera&) and RenderBin to fixed RTT Camera bug where multiple RTT Camera end up with the rendering back end results assigned to them which occured when RTT Camera's share the same StateSet or null StateSet. + +Mon, 14 May 2018 09:34:04 +0100 +Author : Robert Osfield +Fixed support for update and event callbacks on StateSet/Uniform/StateAttributes on View(er) Cameras. + +Mon, 14 May 2018 08:43:08 +0100 +Author : Robert Osfield +Renamed the counter used to enable traversal order sorting + +Mon, 14 May 2018 08:24:02 +0100 +Author : Robert Osfield +Improved the handling of precision + +Sun, 13 May 2018 11:52:06 +0100 +Author : Robert Osfield +Fixed crash when using ShapeDrawable with a TriangleMesh or ConvexHull shape due to missing texture coords + +Sun, 13 May 2018 09:23:38 +0100 +Author : Robert Osfield +Updated for rc + +Sun, 13 May 2018 09:18:31 +0100 +Author : Robert Osfield +Removed _traverseNumber variable that was duplicating the one in NodeVisitor base class + +Sat, 12 May 2018 12:47:08 +0100 +Author : Robert Osfield +Updates for 3.6.1-rc4 + +Sat, 12 May 2018 12:41:42 +0100 +Author : Robert Osfield +Build fixes for OSG_USE_REF_PTR_IMPLICIT_OUTPUT set to OFF + +Sat, 12 May 2018 11:40:25 +0100 +Author : Robert Osfield +Rewrote TextBase::computeMatrix(..) computation of the scaling factor with slower but easier to understand and more robust code + +Sat, 12 May 2018 07:51:51 +0100 +Author : Robert Osfield +Removed use of deprecated cmake policy + +Fri, 11 May 2018 11:15:45 +0100 +Author : Robert Osfield +Moved constructors and destructors to .cpp + +Fri, 11 May 2018 11:11:48 +0100 +Author : Robert Osfield +Revert "Moved the Options constructors and destructor implementaions into the cpp to make it easier to do debugging"This reverts commit 0fc7aa8cc096e59b9366df60c1fdbd0803ac4481. + + +Fri, 11 May 2018 09:00:22 +0100 +Author : Robert Osfield +Fixed crash the occurred when passing in a osgDB::Options to the ObjectCache that doesn't have any references to it. + +Fri, 11 May 2018 08:58:30 +0100 +Author : Robert Osfield +Moved the Options constructors and destructor implementaions into the cpp to make it easier to do debugging + +Thu, 10 May 2018 18:58:29 +0100 +Author : Robert Osfield +Fixed build when OSG_ENVVAR_SUPPORTED is disabled and quietened down warnings using OSG_UNUSED* macros + +Thu, 10 May 2018 18:50:17 +0100 +Author : Robert Osfield +Changed the ordering of the build include directory and the source include directory to avoid build issues on systems where a different version of the OSG has been built in-source then another built out-of-source resulting in conflicts + +Thu, 10 May 2018 16:59:56 +0100 +Author : Robert Osfield +Fixed typo + +Sun, 6 May 2018 07:47:23 +0100 +Author : Robert Osfield +Updates for 3.6.1-rc3 + +Sat, 5 May 2018 15:47:28 +0100 +Author : Robert Osfield +Restructed the handling of SCREEN_COORD scaling to better handle window resizing + +Sat, 5 May 2018 12:31:00 +0100 +Author : Robert Osfield +Added C++ specific path for calling std::map<>::erase() to avoid issues with std::map<>::erase implementation that invalidates iterators + +Sat, 5 May 2018 12:28:45 +0100 +Author : Robert Osfield +Replaced std::auto_ptr<> usage as it's deprecated in C++11 and will be removed in C++17 + +Fri, 4 May 2018 16:11:31 +0100 +Author : OpenSceneGraph git repository +Merge pull request #545 from emminizer/fix-gl3-text-bad-modeText only applies GL_TEXTURE_2D modes when fixed function is availabl… + +Fri, 4 May 2018 06:44:13 -0400 +Author : Daniel Emminizer +Text only applies GL_TEXTURE_2D modes when fixed function is available. Prevents GL3 Core Profile console spam. + +Fri, 4 May 2018 10:54:02 +0100 +Author : Robert Osfield +Added non const version of State::getActiveDisplaySettings() + +Fri, 4 May 2018 09:44:43 +0100 +Author : Robert Osfield +Added check for null to prevent null entries getting into the cache + +Fri, 18 Nov 2016 14:56:05 +0000 +Author : Robert Osfield +Added osg::MakeString class to make it easier to create std::string's using std::ostream style << usage. + +Fri, 4 May 2018 09:22:54 +0100 +Author : Robert Osfield +Fixed null pointer warning + +Thu, 3 May 2018 12:56:08 +0200 +Author : Björn Blissing +Check existence of path before reading imageWhen loading texture images inside the FBX plugin check that the path +exists before trying to read the image. This is done to avoid +unnecessary warnings inside the readRefImageFile function. + + +Wed, 2 May 2018 09:14:04 +0100 +Author : Robert Osfield +Updated ChangeLog + +Wed, 2 May 2018 09:10:54 +0100 +Author : Robert Osfield +Updates for the 3.6.1-rc2 + +Mon, 30 Apr 2018 11:55:17 +0100 +Author : Robert Osfield +Updated SO version to reflect change in ABI + +Mon, 30 Apr 2018 11:44:02 +0100 +Author : OpenSceneGraph git repository +Merge pull request #542 from psyinf/fix_particle_system_headerFIX: removed unimplemented functions from header + +Mon, 30 Apr 2018 11:16:02 +0200 +Author : Sebastian Messerschmidt +FIX: removed unimplemented functions from header + +Fri, 27 Apr 2018 11:23:07 +0100 +Author : Robert Osfield +Fixed particle update bug where a ParticleSystem wouldn't start when loaded during the frame loop due to the _last_frame value not being set. + +Thu, 26 Apr 2018 10:21:53 +0100 +Author : Robert Osfield +Updated ChangeLog, README.md and rc number for 3.6.1-rc1 + +Thu, 26 Apr 2018 09:49:35 +0100 +Author : Robert Osfield +Split up #pragma so that there only three parameters per line to aovid Intel driver bug crash + +Thu, 26 Apr 2018 09:36:52 +0100 +Author : Robert Osfield +Renamed text.vert and text.frag to osgText_Text.vert and .frag to avoid name overlapping with user shaders. + +Wed, 25 Apr 2018 09:48:02 +0100 +Author : Julien Valentin +add wrapper for osg::DrawIndirectBufferObject + +Tue, 24 Apr 2018 17:05:03 +0100 +Author : Robert Osfield +Renamed CMake variable + C++ #define to OSG_GL_CONTEXT_VERSION + +Tue, 24 Apr 2018 16:22:13 +0100 +Author : Robert Osfield +Added OSG_GL_CONTEXT_STRING cmake variable to set include/osg/GL headers that sets Traits::glContextVersion. + +Tue, 24 Apr 2018 15:38:02 +0100 +Author : OpenSceneGraph git repository +Merge pull request #537 from openscenegraph/revert-536-default-gl3-contextRevert "When GL3 build is enabled, default context requested is version 3.3, …" + +Tue, 24 Apr 2018 15:37:44 +0100 +Author : OpenSceneGraph git repository +Revert "When GL3 build is enabled, default context requested is version 3.3, …" + +Tue, 24 Apr 2018 15:36:11 +0100 +Author : OpenSceneGraph git repository +Merge pull request #536 from emminizer/default-gl3-contextWhen GL3 build is enabled, default context requested is version 3.3, … + +Tue, 24 Apr 2018 15:33:03 +0100 +Author : Robert Osfield +Refactored the handling of glyph and shadow alpha values to make the text and shadow clearer for fonts with narrow glyphs + +Tue, 24 Apr 2018 13:52:53 +0100 +Author : Robert Osfield +Refactored the handling of text bounding box to provide more stable bounding box computation + +Tue, 24 Apr 2018 06:31:32 -0400 +Author : Daniel Emminizer +When GL3 build is enabled, default context requested is version 3.3, enabling core profile by default. + +Fri, 20 Apr 2018 21:16:46 +0200 +Author : Alberto Luaces +Small fix for uncaught typo. + +Fri, 20 Apr 2018 18:18:22 +0200 +Author : Alberto Luaces +Fix typos and spelling. + +Mon, 23 Apr 2018 11:02:03 +0100 +Author : OpenSceneGraph git repository +Merge pull request #534 from emminizer/fix-msvc-includesFix includes for MSVC 2015 build. + +Fri, 20 Apr 2018 13:16:43 -0400 +Author : Daniel Emminizer +Fix includes for MSVC 2015 build. + +Fri, 20 Apr 2018 15:58:27 +0100 +Author : Robert Osfield +Updated ChangeLog + +Fri, 20 Apr 2018 14:32:34 +0100 +Author : Robert Osfield +Replaced osgUtil::IntersectVisitor usage with osgUtil::InteresectionVisitor + +Fri, 20 Apr 2018 10:24:17 +0100 +Author : Robert Osfield +Removed TriStripVisitor for default set of Optimizer passes as it doesn't generate efficient scene graphs + +Fri, 20 Apr 2018 09:57:04 +0100 +Author : Robert Osfield +Added osgUtil::optimizeMesh(osg::Node* node) convinience method + +Fri, 20 Apr 2018 11:42:31 +0100 +Author : Robert Osfield +Removed usage of the osgUtil::TriStripVisitor is it generates osg::Geometry that perform very poorly when using VBO and VAO's vs GL DisplayLists. With DisplayLists being deprecated in GL and VBO and VAO becoming standard it's best to standardize on using the osgUtil::MeshOptimizers instead of TripStrupVisitor + +Thu, 19 Apr 2018 19:43:14 +0100 +Author : Robert Osfield +Fixed the set*Binding() methods so that they assign BufferObjects when required + +Thu, 19 Apr 2018 19:42:51 +0100 +Author : Robert Osfield +Fixed messages + +Thu, 19 Apr 2018 19:41:51 +0100 +Author : Robert Osfield +Fixed the GLBufferObject size computation so that it takes into account padding. + +Thu, 19 Apr 2018 19:36:19 +0100 +Author : Robert Osfield +Replaced the use of osgUtil::TriStripVisitor with ogUtil::MeshOptimizer usage to improve performance. Fixed set setColorArray assignement to pass in the color binding + +Wed, 18 Apr 2018 10:02:43 +0100 +Author : Robert Osfield +Fixed the handle of boundary equalization + +Wed, 18 Apr 2018 09:33:12 +0100 +Author : Robert Osfield +Added --equalize-boundaries -e command line option to call terrain->setEqualizeBoundaries(true) + +Mon, 16 Apr 2018 17:53:38 +0100 +Author : Robert Osfield +Updated version number in prep for future 3.6.1 release. + +Mon, 16 Apr 2018 15:08:24 +0100 +Author : Robert Osfield +Fixed inline Drawable::draw(..) method + +Mon, 16 Apr 2018 15:05:11 +0100 +Author : Robert Osfield +Fixed Geometry::drawImplmentation() handling of VBO's to prevent them from being used when display lists are used. + +Sun, 15 Apr 2018 08:25:57 +0100 +Author : Robert Osfield +Replaced osgViewer::GraphicsWindow dynamic_cast as it's not neccessary. + +Sat, 7 Apr 2018 18:35:19 +0100 +Author : Robert Osfield +Fixed typo + +Sat, 7 Apr 2018 17:59:55 +0100 +Author : Robert Osfield +Renamed osg::ComputeDispatch to osg::DispatchCompute to make sure the nameing between GL and OSG is consistent i.e glDispatchCompute -> osg::DispatchComputeUpdated AUTHORS.txt, NEWS.txt and README.txt for CMakeLists.txt for 3.6.0 release + + +Sat, 7 Apr 2018 07:19:14 +0100 +Author : Robert Osfield +Updated ChangeLog + +Sat, 7 Apr 2018 07:18:41 +0100 +Author : Robert Osfield +Updated for rc7 + +Fri, 6 Apr 2018 20:05:26 +0100 +Author : Robert Osfield +Refactored the way that margin is applied to the text buounding box to prevent growth of the bounding box each time Text::setPosition() is called. + +Fri, 6 Apr 2018 15:33:42 +0100 +Author : Robert Osfield +Updated ChangeLog + +Fri, 6 Apr 2018 14:58:00 +0100 +Author : Robert Osfield +Update ChangeLog + +Fri, 6 Apr 2018 14:47:54 +0100 +Author : Robert Osfield +Updated for rc6 + +Fri, 6 Apr 2018 14:17:35 +0100 +Author : Robert Osfield +Fixed warning + +Fri, 6 Apr 2018 14:07:58 +0100 +Author : Robert Osfield +Changed TextBase::setAlignment() to use computeGlyphRepresentation(); rather than computePositions(); to address issues seen with calling Text::setAlignment() after calls to Text::setText() + +Fri, 6 Apr 2018 14:06:50 +0100 +Author : Robert Osfield +Added osgtext --alignment test to look the effect of calling Text::setAlignent() before and after the Text::setText(). + +Thu, 5 Apr 2018 18:00:30 +0100 +Author : OpenSceneGraph git repository +Merge pull request #525 from emminizer/fix-windows-exportosgDB: Added missing extern OSGDB_EXPORT. + +Thu, 5 Apr 2018 10:51:24 -0400 +Author : Daniel Emminizer +osgDB: Added missing extern OSGDB_EXPORT. + +Thu, 5 Apr 2018 14:14:49 +0100 +Author : Robert Osfield +Quietened down debug message output for osgText shader setup and Drawable::createVertexArrayStateImplementation + +Thu, 5 Apr 2018 12:35:36 +0100 +Author : Robert Osfield +Changed DisplaySettings::setShaderHint(..) messages to INFO + +Thu, 5 Apr 2018 12:19:56 +0100 +Author : Robert Osfield +Updated ChangeLOG and news + +Thu, 5 Apr 2018 11:21:55 +0200 +Author : Philippe Renon +mingw: fix compile error in GraphicsWindowWin32.cppcompilation error was introduced by msvc specific change +see https://github.com/openscenegraph/OpenSceneGraph/commit/bb169979a1054e2fa63a7ea82c9c8bec87e90494 + + +Wed, 4 Apr 2018 08:33:55 +0200 +Author : Ralf Habacker +Remove duplicated and incorrect fetching of 'map_bump' attributes in obj pluginParsing the key 'map_bump' was processed in the block, where the attributes +for 'bump' are extracted and results into having parts of the key in the +extracted filename, generating an invalid filename. + +The mentioned string compare could be removed without loosing any features, +because the key 'map_bump' is parsed correctly some lines below. + + +Wed, 4 Apr 2018 15:35:28 +0100 +Author : Robert Osfield +Updated ChangeLog for rc5 + +Wed, 4 Apr 2018 15:09:43 +0100 +Author : Robert Osfield +Fixed threading crash in osgFX that occurred when an osgFX node is added to the scene being rendered in multiple threaded windows. + +Wed, 4 Apr 2018 13:40:51 +0100 +Author : Robert Osfield +Added focus classifiction of handling of keyboard events + +Wed, 4 Apr 2018 13:40:06 +0100 +Author : Robert Osfield +Added EventHandler to report key and mouse events for debugging purposes + +Wed, 4 Apr 2018 12:26:53 +0100 +Author : Robert Osfield +Added -4 command line entry that creates two seperate windows within CompositeViewer + +Wed, 4 Apr 2018 08:50:39 +0100 +Author : Frank Bausch +When testing XYZ/ECEF coordinate values that convert to LLA points with latitude = 90.0 or latitude = -90.0, the heights calculated by EllipsoidModel::convertXYZToLatLongHeight have substantial errors. With the provided change, points at the pole are handled more correctly. This has been tested against US NGA GoldData. + +Tue, 3 Apr 2018 17:21:47 +0100 +Author : Robert Osfield +Updated rc to 5 + +Tue, 3 Apr 2018 17:17:59 +0100 +Author : OpenSceneGraph git repository +Merge pull request #518 from emminizer/fix-scroll-eventCompositeViewer: SCROLL event now only goes to view with focus. Incl… + +Tue, 3 Apr 2018 16:07:46 +0100 +Author : Robert Osfield +Updated rc number to 4 + +Tue, 3 Apr 2018 16:04:24 +0100 +Author : Robert Osfield +Updated ChangeLog and NEWS for rc3 + +Tue, 3 Apr 2018 15:48:37 +0100 +Author : Thomas Hogarth +missing gles2 check + +Tue, 3 Apr 2018 10:32:58 -0400 +Author : Daniel Emminizer +CompositeViewer: SCROLL event now only goes to view with focus. Includes minor typo fixes. + +Tue, 3 Apr 2018 15:29:54 +0100 +Author : Robert Osfield +Added a ShadowTechniue::setShadowedScene() virtual method to make it possible to implement techniques as fascades to other techniques + +Tue, 3 Apr 2018 12:42:37 +0100 +Author : Andreas Ekstrand +The attached code (from the 3.6 branch) adds a keepSeparatePoints option to the SHP plugin which makes it possible to avoid merging point features into multi-points, in case you e.g. need to keep separate point attributes.It also contains a fix in the Xbase DBF parser, converting a numeric shape attribute to double instead of integer. As stated in e.g. https://en.wikipedia.org/wiki/.dbf the numeric field can contain decimals. + + +Tue, 3 Apr 2018 11:35:31 +0100 +Author : Robert Osfield +Removed osgShadow::ShadowVolume as it functionality isn't functional + +Tue, 3 Apr 2018 12:10:29 +0100 +Author : OpenSceneGraph git repository +Merge pull request #516 from eligovision/OpenSceneGraph-3.6_programosg::Program's compileGLObjects and apply methods fixed for OSG witho… + +Mon, 2 Apr 2018 23:56:36 +0300 +Author : Konstantin S. Matveyev +osg::Program's compileGLObjects and apply methods fixed for OSG without OSG_GL_FIXED_FUNCTION_AVAILABLE + +Mon, 2 Apr 2018 18:26:26 +0100 +Author : Robert Osfield +Rewrote the handling of AutoTransform::setAutoScaleToScreen(bool) functionality so that is disabling CullingActive when switched on. + +Mon, 2 Apr 2018 16:21:20 +0100 +Author : Robert Osfield +Added __VERSION__<140 check for usage of gl_ClipVertex to avoid GL3 core profile usage issues + +Mon, 2 Apr 2018 14:08:47 +0100 +Author : Robert Osfield +Restructured merge geometry code to make it easier to follow + +Mon, 2 Apr 2018 11:44:03 +0100 +Author : Robert Osfield +Fix for MergeGeometryVsiitor bug. Restructured the processing the merge geometry list to avoid missing geometries that aren't binned along with other geometries. + +Sun, 1 Apr 2018 10:40:25 +0100 +Author : Robert Osfield +Removed stray CMAkeLists.txt from TARGET_SRC list + +Sun, 1 Apr 2018 10:18:45 +0100 +Author : Andreas Ekstrand +Small fix (from the 3.6 branch) in the osgjs plugin, avoiding a double addition of the CullFace attribute when it has been turned off. This resulted in an empty json object in the osgjs file causing warnings in osgjs. + +Fri, 30 Mar 2018 17:52:12 +0100 +Author : Robert Osfield +Updated NEWS and ChangeLog for 3.6.0-rc3 + +Fri, 30 Mar 2018 16:34:01 +0100 +Author : Robert Osfield +Fixed build with OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION set to OFF + +Fri, 30 Mar 2018 15:27:35 +0100 +Author : Robert Osfield +Added suport for writing to gl_ClipVertex + +Fri, 30 Mar 2018 15:16:45 +0100 +Author : Robert Osfield +To osgclipe example added --text textstring and --simple command line options to test mixing text and clipping + +Fri, 30 Mar 2018 12:39:52 +0100 +Author : Robert Osfield +Changed Layer::get*Value(..) methods to const + +Thu, 29 Mar 2018 11:38:04 +0100 +Author : Robert Osfield +Fixed double calling of TerrainTechnique::init(). + +Thu, 29 Mar 2018 11:35:34 +0100 +Author : Robert Osfield +Maded TerrainTechnique::setTerrainTile(..), addNeighbour(..), removeNeighbour(..) and containsNeighbour(..) virtual and public to enable implementation of TerrainTechnique that act as a facade to actual TerrainTechnique implementations. + +Wed, 28 Mar 2018 14:04:41 +0100 +Author : Robert Osfield +Updated RC number to 3 + +Wed, 28 Mar 2018 11:34:52 +0100 +Author : Robert Osfield +Fixed osgDB::findFileInDirectory() handling of directory strings with trailing \ or / that was causing failure to find valid files in otherwise valid directories + +Tue, 27 Mar 2018 18:56:38 +0800 +Author : Haojia Yu +OutputStream writes images using its Options objectwhen writing images, OutputStream can search files using its Options object rahter than always using FilePathList object of global Regidtry instance. + + +Tue, 27 Mar 2018 08:39:52 +0100 +Author : OpenSceneGraph git repository +Merge pull request #510 from eligovision/OpenSceneGraph-3.6_iosGraphicsWindowIOS: multithreaded viewer's mode support added; updated… + +Tue, 27 Mar 2018 08:37:29 +0100 +Author : OpenSceneGraph git repository +Merge pull request #508 from eligovision/OpenSceneGraph-3.6_pluginsOSG 3.6: Write support with .curl pseudo extension added + +Tue, 27 Mar 2018 08:35:57 +0100 +Author : OpenSceneGraph git repository +Merge pull request #509 from eligovision/OpenSceneGraph-3.6_vasVertexArrayState: typo fixed in log + +Mon, 26 Mar 2018 20:40:14 +0300 +Author : Konstantin S. Matveyev +GraphicsWindowIOS: multithreaded viewer's mode support added; updated for iOS-11 SDK; view rotations fixed; GLES2, GLES3 preprocessors fixed; tested on iPhone4 and upper + +Fri, 19 Jan 2018 22:20:01 +0300 +Author : Konstantin S. Matveyev +VertexArrayState: typo fixed in log + +Mon, 26 Mar 2018 17:59:49 +0300 +Author : Konstantin S. Matveyev +Write support with .curl pseudo extension added + +Mon, 26 Mar 2018 09:55:53 +0100 +Author : Robert Osfield +Updated ChangeLog + +Mon, 26 Mar 2018 09:54:59 +0100 +Author : Robert Osfield +Updated NEWS for 3.6.0-rc2 + +Sun, 25 Mar 2018 12:14:46 +0100 +Author : Robert Osfield +Re-ordered the creating of the DatagbaseThread to avoid startThread being called twice. + +Sun, 25 Mar 2018 12:13:50 +0100 +Author : Robert Osfield +Added check if thraeding is running before executing start thread. + +Sat, 24 Mar 2018 18:02:35 +0000 +Author : Robert Osfield +Updated ChangeLog, AUTHORS and Controbitors for 3.6.0-rc1 + +Sat, 24 Mar 2018 17:51:06 +0000 +Author : Robert Osfield +Added new features in 3.6 to NEWS release + +Sat, 24 Mar 2018 12:13:59 +0000 +Author : Robert Osfield +First step for 3.6 stable release news + +Sat, 24 Mar 2018 11:23:59 +0000 +Author : Robert Osfield +Fixed read shader to safer ref version + +Sat, 24 Mar 2018 10:59:15 +0000 +Author : Robert Osfield +Fixed spotlight colour mixing + +Fri, 23 Mar 2018 20:08:37 +0000 +Author : OpenSceneGraph git repository +Merge pull request #502 from Haojia521/OutputStreamUseTargertSoVersionwrite binary file with a specific so version + +Fri, 23 Mar 2018 19:54:33 +0000 +Author : Robert Osfield +Removed serailizers that are now supplied by osg::Node + +Fri, 23 Mar 2018 19:54:01 +0000 +Author : Robert Osfield +Fixed member variable names to avoid conflicts with osg::Node + +Fri, 23 Mar 2018 18:07:36 +0000 +Author : Robert Osfield +Removed Drawable writing out of StateSet as this is now done by Node + +Fri, 23 Mar 2018 18:07:07 +0300 +Author : Michael Kapelko +Provide osgemscripten example CMake flags in a more stable way + +Fri, 23 Mar 2018 12:55:00 +0000 +Author : Robert Osfield +Changed the isBufferObjectSupported flag so that it's true when either VBO or PBO's are supported + +Thu, 22 Mar 2018 17:35:13 +0000 +Author : Paul Obermeier +Fixes for VS2008 and 2010 build + +Thu, 22 Mar 2018 16:51:03 +0000 +Author : Robert Osfield +Moved OPENGL_INCLUDE_DIR include into it's own INCLUDE_DIRECTORIES(SYSTEM ${OPENGL_INCLUDE_DIR}) entry to help with FreeBSD builds where a previous rev of the OSG has already been installed + +Thu, 22 Mar 2018 09:04:47 +0000 +Author : Robert Osfield +Removed typedef and used osg::GraphicsContext::Cameras explictly to avoid any hiding of type + +Wed, 21 Mar 2018 19:44:25 +0300 +Author : Victor +Fixed bug of determining availability of functions ‘pthread_getconcurrency’, ‘pthread_setconcurrency’, ‘pthread_setaffinity_np’ in ‘pthread’ libraryCMake cannot find 'pthread_getconcurrency’, ‘pthread_setconcurrency’ and ‘pthread_setaffinity_np' functions in 'pthread' library because when linking internal cmake test did’t specifed ‘-l pthread’. + + +Tue, 20 Mar 2018 09:20:59 +0000 +Author : Robert Osfield +Removed -m message that was causing problems with branch creation + +Tue, 20 Mar 2018 09:12:58 +0000 +Author : Robert Osfield +Updated version numbers in prep for 3.6 branch + +Tue, 20 Mar 2018 09:02:05 +0000 +Author : Robert Osfield +Updated ChangeLog and AUTHORS file + Mon, 19 Mar 2018 14:27:18 +0000 Author : Robert Osfield Updated ChangeLog and updated version to 3.5.11 diff --git a/LICENSE.txt b/LICENSE.txt index accbb69f71a..79387994340 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,8 +1,8 @@ - OpenSceneGraph Public License, Version 0.0 + OpenSceneGraph Public License, Version 1.0 ========================================== - - Copyright (C) 2002 Robert Osfield. - + + Copyright (C) 2018 Robert Osfield. + Everyone is permitted to copy and distribute verbatim copies of this licence document, but changing it is not allowed. @@ -12,18 +12,19 @@ This library is free software; you can redistribute it and/or modify it under the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or later. - - Notes: the OSGPL is based on the LGPL, with the 4 exceptions laid - out in the wxWindows section below. The LGPL is contained in the - final section of this license. + + Notes: the OSGPL is based on the LGPL-2.1-only WITH WxWindows-exception-3.1, + with the 4 exceptions laid out in the wxWindows section below. The LGPL is + contained in the final section of this license. ------------------------------------------------------------------------------- - wxWindows Library Licence, Version 3 - ==================================== - Copyright (C) 1998 Julian Smart, Robert Roebling [, ...] + wxWindows Library Licence, Version 3.1 + ====================================== + + Copyright (c) 1998-2005 Julian Smart, Robert Roebling et al Everyone is permitted to copy and distribute verbatim copies of this licence document, but changing it is not allowed. @@ -43,20 +44,20 @@ You should have received a copy of the GNU Library General Public Licence along with this software, usually in a file named COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA. + write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301 USA. EXCEPTION NOTICE 1. As a special exception, the copyright holders of this library give permission for additional uses of the text contained in this release of - the library as licensed under the wxWindows Library Licence, applying - either version 3 of the Licence, or (at your option) any later version of - the Licence as published by the copyright holders of version 3 of the - Licence document. + the library as licenced under the wxWindows Library Licence, applying + either version 3.1 of the Licence, or (at your option) any later version of + the Licence as published by the copyright holders of version + 3.1 of the Licence document. 2. The exception is that you may use, copy, link, modify and distribute - under the user's own terms, binary object code versions of works based + under your own terms, binary object code versions of works based on the Library. 3. If you copy code from files distributed under the terms of the GNU @@ -71,11 +72,13 @@ choice whether to permit this exception to apply to your modifications. If you do not wish that, you must delete the exception notice from such code and/or adjust the licensing conditions notice accordingly. - - + + + ------------------------------------------------------------------------------ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 + + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA @@ -86,7 +89,7 @@ as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] - Preamble + Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public @@ -131,7 +134,7 @@ modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. - + Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a @@ -187,8 +190,8 @@ modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE + + GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other @@ -222,7 +225,7 @@ such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. - + 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an @@ -234,7 +237,7 @@ Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. - + 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 @@ -292,7 +295,7 @@ instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. - + Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. @@ -343,7 +346,7 @@ Library will still fall under Section 6.) distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. - + 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work @@ -405,7 +408,7 @@ restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. - + 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined @@ -446,7 +449,7 @@ subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. - + 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or @@ -498,7 +501,7 @@ conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. - + 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is @@ -508,7 +511,7 @@ decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. - NO WARRANTY + NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. @@ -531,8 +534,8 @@ FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - END OF TERMS AND CONDITIONS - + END OF TERMS AND CONDITIONS + How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest diff --git a/NEWS.txt b/NEWS.txt index e0727264e4d..02b6f509020 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -1,8 +1,61 @@ OSG News ======== +OpenSceneGraph 3.6 release +PERTHSHIRE, Scotland - 7th April 2018 - OpenSceneGraph Professional Services announces the release of OpenSceneGraph 3.6.0, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. The OpenSceneGraph is written entirely in Standard C++ and built upon OpenGL (1.2 to 4.6) and OpenGL ES (1.0 to 3.0), and offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modelling markets. OpenSceneGraph 3.6 runs on all Microsoft Windows platforms, Apple OS/X, iOS, GNU/Linux, Android, Solaris, HP-UX, AIX and FreeBSD operating systems. + +Updates include: + + * OpenThreads::Affinity introduced to enable setting of processor affinity on viewer and database threads + * osgText rewritten to improve visual quality, add signed distance field support and full GLES2/3 and GL3/4 support + * Added VertexArrayObject support, enable full OpenGL Core Profile support under OSX. + * Added OpenCASCADE plugin + * Added STEP (.stp) plugin + * Improvements to FBX and COLLADA loaders + * Improvements to gles plugin to provide better Sketchfab support + * Added osgemscripten example + * Improvements to osgAnimation + * NodeVisitor ValueMap for storing values that can be stored and accessed across frames, such as update, event and cull traversals + * ShapeDrawable rewritten as an osg::Geometry to improve performance and flexibility + * Added osg::MultiDrawArrays support + * Added osgdeferred example that illustrates how to implement deferred rendering + * Added MultiDrawIndirect support + * Moved glDispatchCompute control out of osg::Program into a dedicated osg::DispatchCompute class to improve control of compute shaders + * KdTree support added for PolytopeIntersector, and ability to work with points, lines and polygons + * osgQt has been moved out to it's own dedicated osgQt github repository + * CMake build support for iOS bitcode builds + * CoverityScan testing introduced, fixes bring defect density to 0.0 per 1,0000 lines of code! + * Support for Codedoc automated documentation + * Support for Travis automated build system + + +Downloads and Licensing: + +OpenSceneGraph is open-source, so full source code is provided, and can be copied, modified and used free of charge for commercial and non-commercial use. Access to the source allows end users greater flexibility in how they develop, debug and deploy their applications. They gain productivity and freedom by being able to leverage the tool chain in accordance with their own release cycles. Downloads of binaries and source can be found at http://www.openscenegraph.org/index.php/download-section/stable-releases and at our github repository https://github.com/openscenegraph/OpenSceneGraph/. + +OpenSceneGraph is released under the OpenSceneGraph Public License, which is based on the Lesser GNU Public License (LGPL), permitting the software to be used free of charge across the full spectrum of commercial and open-source applications. Furthermore, it allows both static and dynamic linking of the OpenSceneGraph libraries without restricting the licensing of the user's software. Further details http://www.openscenegraph.org/index.php/about/licensing + + +Professional support and services: + +OpenSceneGraph project is backed up with professional services by OpenSceneGraph Professional Services, based in Scotland, and a range of Contractors from around the world http://www.openscenegraph.org/index.php/support/professional-support. For enquires email robert@openscenegraph.com. Services available include: + + Confidential Professional Support + Bespoke development + Consultancy + Training + + +Community support and contributions: + +The diverse and growing community of over 5000 developers is centred around the public osg-users mailing list/forum, where members discuss how best to use OpenSceneGraph, provide mutual support, and coordinate development of new features and bug fixes. Members of this community come from many different countries with backgrounds ranging from some of the world's largest aerospace companies, game companies, and visual simulation specialists to university researchers, students and hobbyists. + +The OpenSceneGraph project owes a great deal to the community for its development and support, in particular we wish to thank the 568 individuals from around the world that have directly contributed to the development and refinement of the OpenSceneGraph code base. + + + OpenSceneGraph 3.4 release introduces shader composition, new osgUI library, displacement mapping, volume rendering, lua scripting support and much more -PERTHSHIRE, Scotland - 12th August 2015 - OpenSceneGraph Professional Services announces the release of OpenSceneGraph 3.4, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. OpenSceneGraph 3.4 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modeling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. OpenSceneGraph 3.4 runs on all Microsoft Windows platforms, Apple OS/X, IOS, GNU/Linux, Android, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems. +PERTHSHIRE, Scotland - 12th August 2015 - OpenSceneGraph Professional Services announces the release of OpenSceneGraph 3.4, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. OpenSceneGraph 3.4 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modelling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. OpenSceneGraph 3.4 runs on all Microsoft Windows platforms, Apple OS/X, iOS, GNU/Linux, Android, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems. Updates include: * New #pragma(tic) composition shader functionality built into the core OSG that provides a easy to use yet flexible scheme for controlling and composing shaders at runtime levering GLSL support for #define and #pragma. @@ -39,7 +92,7 @@ The OpenSceneGraph project owes a great deal to the community for its developmen = !OpenSceneGraph 3.2 release improves support iOS and Android, supports a range of new OpenGL features much more. -PERTHSHIRE, Scotland - 24th July 2013 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 3.2, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 3.2 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modeling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 3.2 runs on all Microsoft Windows platforms, Apple OS/X, IOS, GNU/Linux, Android, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems. +PERTHSHIRE, Scotland - 24th July 2013 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 3.2, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 3.2 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modelling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 3.2 runs on all Microsoft Windows platforms, Apple OS/X, iOS, GNU/Linux, Android, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems. === Open-source development delivers industry-leading features and performance === The !OpenSceneGraph 3.2 release is the culmination of 14 years of work by the open-source community that has grown up around the project. The real-time graphics industry and academia embraced it from the very beginning, deploying it in real-world applications, and actively participating in its development, testing and refinement. The end result is a high-quality library with a feature set relevant to application developers' needs in both the desktop and mobile space. @@ -90,7 +143,7 @@ The !OpenSceneGraph project owes a great deal to the community for its developme = !OpenSceneGraph 3.0 release adds support OpenGL ES 1.1, OpenGL ES 2.0, OpenGL 3.x to 4.0, support for Andoid and IOS platforms and much more. -PERTHSHIRE, Scotland - 28th June 2011 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 3.0, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 3.0 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modeling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 3.0 runs on all Microsoft Windows platforms, Apple OS/X, IOS, GNU/Linux, Android, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems. +PERTHSHIRE, Scotland - 28th June 2011 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 3.0, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 3.0 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modelling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 3.0 runs on all Microsoft Windows platforms, Apple OS/X, iOS, GNU/Linux, Android, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems. === Open-source development delivers industry-leading features and performance === The !OpenSceneGraph 3.0 release is the culmination of 12 years of work by the lead developers and the open-source community that has grown up around the project. The real-time graphics industry and academia embraced it from the very beginning, deploying it in real-world applications, and actively participating in its development, testing and refinement. The end result is a high-quality library with a feature set relevant to application developers' needs. @@ -145,7 +198,7 @@ The !OpenSceneGraph project owes a great deal to the community for its developme = !OpenSceneGraph 2.8 release adds osgAnimation and osgVolume libraries, DICOM support, LispSM shadowing and much more. = -PERTHSHIRE, Scotland - 12th February 2009 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 2.8, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 2.8 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modeling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 2.8 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems. +PERTHSHIRE, Scotland - 12th February 2009 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 2.8, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 2.8 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modelling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 2.8 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems. === Open-source development delivers industry-leading features and performance === The !OpenSceneGraph 2.8 release is the culmination of 10 years of work by the lead developers and the open-source community that has grown up around the project. The real-time graphics industry and academia embraced it from the very beginning, deploying it in real-world applications, and actively participating in its development, testing and refinement. The end result is a high-quality library with a feature set relevant to application developers' needs. @@ -216,7 +269,7 @@ About !OpenSceneGraph Professional Services:[[BR]] = !OpenSceneGraph 2.6 release adds osgWidget library, KdTree intersections, Anti-aliased FBOsand much more. = -PERTHSHIRE, Scotland - 5th August 2008 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 2.6, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 2.6 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modeling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 2.6 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems. +PERTHSHIRE, Scotland - 5th August 2008 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 2.6, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 2.6 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modelling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 2.6 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems. === Open-source development delivers industry-leading features and performance === The !OpenSceneGraph 2.6 release is the culmination of 9 years of work by the lead developers and the open-source community that has grown up around the project. The real-time graphics industry and academia embraced it from the very beginning, deploying it in real-world applications, and actively participating in its development, testing and refinement. The end result is a high-quality library with a feature set relevant to application developers' needs. @@ -285,7 +338,7 @@ About !OpenSceneGraph Professional Services:[[BR]] = !OpenSceneGraph 2.4 release adds geometry shaders, multiple render targets, support for terrabyte scale terrain databases, writing to !OpenFlight and much more. = -PERTHSHIRE, Scotland - 25th April 2008 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 2.4, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 2.4 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modeling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 2.4 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems. +PERTHSHIRE, Scotland - 25th April 2008 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 2.4, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 2.4 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modelling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 2.4 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems. === Open-source development delivers industry-leading features and performance === The !OpenSceneGraph 2.4 release is the culmination of 9 years of work by the lead developers and the open-source community that has grown up around the project. The real-time graphics industry and academia embraced it from the very beginning, deploying it in real-world applications, and actively participating in its development, testing and refinement. The end result is a high-quality library with a feature set relevant to application developers' needs. @@ -341,7 +394,7 @@ About !OpenSceneGraph Professional Services:[[BR]] = OpenSceneGraph 2.2 release adds support for advanced displays, soft and parallel split shadow maps and easier builds = -PERTHSHIRE, Scotland - 4th October 2007 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 2.2, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 2.2 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modeling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 2.2 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and !FreeBSD operating systems. +PERTHSHIRE, Scotland - 4th October 2007 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 2.2, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 2.2 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modelling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 2.2 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and !FreeBSD operating systems. === Open-source development delivers industry-leading features and performance === The !OpenSceneGraph 2.2 release is the culmination of 8 years of work by the lead developers and the open-source community that has grown up around the project. The real-time graphics industry and academia embraced it from the very beginning, deploying it in real-world applications, and actively participating in its development, testing and refinement. The end result is a high-quality library with a feature set relevant to application developers' needs. @@ -398,7 +451,7 @@ About !OpenSceneGraph Professional Services:[[BR]] !!![=OpenSceneGraph=] 2.0 release improves ease-of-use and scalability, introducing new osgViewer, osgShadow and osgManipulator libraries, new build system, improved multi-core, multi-GPU support. -PERTHSHIRE, Scotland - 15th June 2007 - [=OpenSceneGraph=] Professional Services announces the release of [=OpenSceneGraph=] 2.0, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. [=OpenSceneGraph=] 2.0, written entirely in Standard C++ and built upon [=OpenGL=], offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modeling markets a real-time visualization tool which rivals established commercial scene graph toolkits in functionality and performance. [=OpenSceneGraph=] 2.0 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and [=FreeBSD=] operating systems. +PERTHSHIRE, Scotland - 15th June 2007 - [=OpenSceneGraph=] Professional Services announces the release of [=OpenSceneGraph=] 2.0, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. [=OpenSceneGraph=] 2.0, written entirely in Standard C++ and built upon [=OpenGL=], offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modelling markets a real-time visualization tool which rivals established commercial scene graph toolkits in functionality and performance. [=OpenSceneGraph=] 2.0 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and [=FreeBSD=] operating systems. !!!Open-source development delivers industry-leading features and performance The [=OpenSceneGraph=] 2.0 release is the culmination of 8 years of work by the lead developers and the open-source community that has grown up around the project. The real-time graphics industry and academia embraced it from the very beginning, deploying it in real-world applications, and actively participating in its development, testing and refinement. The end result is a high-quality library with a feature set relevant to application developers' needs. @@ -456,7 +509,7 @@ Project Lead and Proprietor [=OpenSceneGraph=] Professional Services !!![=OpenSceneGraph=] 1.2 release introduces Windows 64bit and AIX support, COLLADA support, processor affinity and texture atlas builder. -PERTHSHIRE, Scotland - 12th September 2006 - [=OpenSceneGraph=] Professional Services announces the release of [=OpenSceneGraph=] 1.2, the industry's leading open source scene graph technology, designed to accelerate application development and improve 3D graphics performance. [=OpenSceneGraph=] 1.2, written entirely in Standard C++ and built upon [=OpenGL=], offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modeling markets a real time visualization tool which rivals established commercial scene graph toolkits in functionality and performance. [=OpenSceneGraph=] 1.2 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and [=FreeBSD=] operating systems. +PERTHSHIRE, Scotland - 12th September 2006 - [=OpenSceneGraph=] Professional Services announces the release of [=OpenSceneGraph=] 1.2, the industry's leading open source scene graph technology, designed to accelerate application development and improve 3D graphics performance. [=OpenSceneGraph=] 1.2, written entirely in Standard C++ and built upon [=OpenGL=], offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modelling markets a real time visualization tool which rivals established commercial scene graph toolkits in functionality and performance. [=OpenSceneGraph=] 1.2 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris, HP-UX, AIX and [=FreeBSD=] operating systems. The [=OpenSceneGraph=]-1.2 release introduces: @@ -481,7 +534,7 @@ Project Lead and Proprietor [=OpenSceneGraph=] Professional Services !!!OpenSceneGraph 1.1 release introduces peformance and scalability improvements, full OpenGL Shading Language support and new OpenFlight 16.1, TerrPagea2.2 and Quake3 loaders. AYRSHIRE, Scotland - July 19th 2006 - [=OpenSceneGraph=] Professional Services announces the release of [=OpenSceneGraph=] 1.1, -the industry's leading open-source graphics library with [=OpenGL=] 2.0 and [=OpenGL=] Shading Language support. [=OpenSceneGraph=] is designed to accelerate application development and improve 3D graphics performance. [=OpenSceneGraph=] 1.1, written entirely in Standard C++ and built upon [=OpenGL=], offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modeling markets a real time visualization tool which rivals established commercial scene graph toolkits in functionality and performance. [=OpenSceneGraph=] 1.1 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris and [=FreeBSD=] operating systems. +the industry's leading open-source graphics library with [=OpenGL=] 2.0 and [=OpenGL=] Shading Language support. [=OpenSceneGraph=] is designed to accelerate application development and improve 3D graphics performance. [=OpenSceneGraph=] 1.1, written entirely in Standard C++ and built upon [=OpenGL=], offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modelling markets a real time visualization tool which rivals established commercial scene graph toolkits in functionality and performance. [=OpenSceneGraph=] 1.1 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris and [=FreeBSD=] operating systems. The OpenSceneGraph-1.1 release introduces: @@ -508,7 +561,7 @@ Project Lead and Proprietor [=OpenSceneGraph=] Professional Services !!!High performance open-source graphics toolkit [=OpenSceneGraph=] hits 1.0! -AYRSHIRE, Scotland - December 9th, 2005 - [=OpenSceneGraph=] Professional Services announces the release of [=OpenSceneGraph=] 1.0, the industry's leading open-source graphics library with [=OpenGL=] 2.0 and [=OpenGL=] Shading Language support. [=OpenSceneGraph=] is designed to accelerate application development and improve 3D graphics performance. [=OpenSceneGraph=] 1.0, written entirely in Standard C++ and built upon [=OpenGL=], offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modeling markets a real time visualization tool which rivals established commercial scene graph toolkits in functionality and performance. [=OpenSceneGraph=] 1.0 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris and [=FreeBSD=] operating systems. +AYRSHIRE, Scotland - December 9th, 2005 - [=OpenSceneGraph=] Professional Services announces the release of [=OpenSceneGraph=] 1.0, the industry's leading open-source graphics library with [=OpenGL=] 2.0 and [=OpenGL=] Shading Language support. [=OpenSceneGraph=] is designed to accelerate application development and improve 3D graphics performance. [=OpenSceneGraph=] 1.0, written entirely in Standard C++ and built upon [=OpenGL=], offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modelling markets a real time visualization tool which rivals established commercial scene graph toolkits in functionality and performance. [=OpenSceneGraph=] 1.0 runs on all Microsoft Windows platforms, Apple OS/X, GNU/Linux, IRIX, Solaris and [=FreeBSD=] operating systems. ->''"3Dlabs congratulates the [=OpenSceneGraph=] development community on the release of [=OpenSceneGraph=] 1.0. [=OpenSceneGraph=] is a shining example of how open-source projects can deliver commercial-quality products with outstanding performance and a ton of cutting-edge features. 3Dlabs committed engineering resources to [=OpenSceneGraph=] to help implement full support of programmable shader technology through [=OpenGL=] Shading Language. It is gratifying to see the excitement that developers have for this important cross-platform, real-time visualization library."'''\\ Randi Rost, director of developer relations at 3Dlabs, http://developer.3Dlabs.com/ diff --git a/README.md b/README.md index d890bddbc3d..4831f1be8ef 100644 --- a/README.md +++ b/README.md @@ -7,13 +7,13 @@ Welcome to the OpenSceneGraph (OSG). -For up-to-date information on the project, in-depth details on how to compile and run libraries and examples, see the documentation on the OpenSceneGraph website: +For information on the project, in-depth details on how to compile and run libraries and examples, see the documentation on the OpenSceneGraph website: - http://www.openscenegraph.org/index.php/documentation +http://www.openscenegraph.org/index.php/documentation -For support subscribe to our public mailing list or forum, details at: +For support please use the github OpenSceneGraph Discussions forum: - http://www.openscenegraph.org/index.php/support +https://github.com/openscenegraph/OpenSceneGraph/discussions For the impatient, we've included quick build instructions below, these are are broken down is three parts: @@ -25,17 +25,22 @@ If details below are not sufficient then head over to the openscenegraph.org to Robert Osfield. Project Lead. -28th March 2017. +31th January 2020. --- ## Section 1. How to build OpenSceneGraph +If you are using the [vcpkg](https://github.com/Microsoft/vcpkg/) dependency manager you can download and install OpenSceneGraph from source with CMake integration using a single command: +``` +vcpkg install osg +``` + The OpenSceneGraph uses the CMake build system to generate a platform-specific build environment. CMake reads the `CMakeLists.txt` files that you'll find throughout the OpenSceneGraph directories, checks for installed dependencies and then generates files for the selected build system. If you don't already have CMake installed on your system you can grab it from http://www.cmake.org, use version 2.8.0 or later. Details on the OpenSceneGraph's CMake build can be found at: - http://www.openscenegraph.org/projects/osg/wiki/Build/CMake +http://www.openscenegraph.org/projects/osg/wiki/Build/CMake Under Unix-like systems (i.e. Linux, IRIX, Solaris, Free-BSD, HP-UX, AIX, macOS) use the `cmake` or `ccmake` command-line utils. Note that `cmake .` defaults to building Release to ensure that you get the best performance from your final libraries/applications. @@ -54,13 +59,13 @@ Alternatively, you can create an out-of-source build directory and run cmake or Under Windows use the GUI tool CMakeSetup to build your VisualStudio files. The following page on our wiki dedicated to the CMake build system should help guide you through the process: - http://www.openscenegraph.org/index.php/documentation/platform-specifics/windows +http://www.openscenegraph.org/index.php/documentation/platform-specifics/windows Under macOS you can either use the CMake build system above, or use the Xcode projects that you will find in the OpenSceneGraph/Xcode directory. See release notes on macOS CMake build below. For further details on compilation, installation and platform-specific information read "Getting Started" guide: - http://www.openscenegraph.org/index.php/documentation/10-getting-started +http://www.openscenegraph.org/index.php/documentation/10-getting-started ## Section 2. Release notes on macOS build, by Eric Sokolowski et al. @@ -88,13 +93,14 @@ Many of the example programs use command-line arguments. When double-clicking on ## Section 3. Release notes on iOS build, by Thomas Hogarth -With CMake, XCode and the iOS sdk installed you can generate an iOS XCode project using the following command line: +With CMake 3.11, XCode 9.4 and the iOS sdk 11.4 installed you can generate an iOS XCode project using the following command line: - export THIRDPARTY_PATH=/path/to/my/3rdParty + export THIRDPARTY_PATH=/path/to/3rdParty cmake ./ -G Xcode -DOSG_BUILD_PLATFORM_IPHONE:BOOL=ON \ - -DIPHONE_SDKVER="10.2" \ - -DIPHONE_VERSION_MIN="8.0" \ - -DOPENGL_PROFILE:STRING=GLES2 \ + -DIPHONE_SDKVER="11.4" \ + -DIPHONE_VERSION_MIN="10.0" \ + -DOPENGL_PROFILE:STRING=GLES3 \ + -DOSG_CPP_EXCEPTIONS_AVAILABLE:BOOL=ON \ -DBUILD_OSG_APPLICATIONS:BOOL=OFF \ -DBUILD_OSG_EXAMPLES:BOOL=ON \ -DOSG_WINDOWING_SYSTEM:STRING=IOS \ @@ -105,15 +111,15 @@ With CMake, XCode and the iOS sdk installed you can generate an iOS XCode projec -DCURL_LIBRARY:PATH="$THIRDPARTY_PATH/curl-ios-device/lib/libcurl.a" \ -DFREETYPE_INCLUDE_DIR_freetype2:PATH="$THIRDPARTY_PATH/freetype-ios-universal/include/freetype" \ -DFREETYPE_INCLUDE_DIR_ft2build:PATH="$THIRDPARTY_PATH/freetype-ios-universal/include" \ - -DFREETYPE_LIBRARY:PATH="$THIRDPARTY_PATH/freetype-ios-universal/lib/libFreeType_iphone_universal.a" \ + -DFREETYPE_LIBRARY:PATH="$THIRDPARTY_PATH/freetype-ios-universal/lib/libFreetype2.a" \ -DTIFF_INCLUDE_DIR:PATH="$THIRDPARTY_PATH/tiff-ios-device/include" \ -DTIFF_LIBRARY:PATH="$THIRDPARTY_PATH/tiff-ios-device/lib/libtiff.a" \ -DGDAL_INCLUDE_DIR:PATH="$THIRDPARTY_PATH/gdal-ios-device/include" \ -DGDAL_LIBRARY:PATH="$THIRDPARTY_PATH/gdal-ios-device/lib/libgdal.a" -Be sure to set the THIRDPARTY_PATH to the path containing your thirdparty dependencies. Set IPHONE_SDKVER to the version of the iOS sdk you have installed, in this instance 10.2. IPHONE_VERSION_MIN controls the base sdk used by xcode, and lastly set OPENGL_PROFILE to the version of GLES you want to use. +Be sure to set the THIRDPARTY_PATH to the path containing your thirdparty dependencies. Set IPHONE_SDKVER to the version of the iOS sdk you have installed, in this instance 11.4. IPHONE_VERSION_MIN controls the deployment sdk used by xcode, and lastly set OPENGL_PROFILE to the version of GLES you want to use. -Once this completes an XCode project will have been generated in the osg root folder. Open the generated Xcode project, select the example_osgViewerIPhone target. In 'General' tab set a development team. In the 'Build Settings' tab search for 'Other Linker Flags', then for each target type (debug, release etc) that you want to use open the list of arguments and delete the 'OpenGL' line and the '-framework' line above it. This is because cmake has tried to add the desktop OpenGL library which we don't want. +Once this completes an XCode project will have been generated in the osg root folder. Open the generated Xcode project, select the example_osgViewerIPhone target. In 'General' tab set a development team. -Once this is done you should be able to build and deploy the `example_osgViewerIPhone` target on your device. \ No newline at end of file +Once this is done you should be able to build and deploy the `example_osgViewerIPhone` target on your device. diff --git a/applications/osgconv/osgconv.cpp b/applications/osgconv/osgconv.cpp index a324dd0ee88..8604c1df887 100644 --- a/applications/osgconv/osgconv.cpp +++ b/applications/osgconv/osgconv.cpp @@ -45,6 +45,8 @@ class MyGraphicsContext { traits->doubleBuffer = false; traits->sharedContext = 0; traits->pbuffer = true; + traits->readDISPLAY(); + traits->setUndefinedScreenDetailsToDefaultScreen(); _gc = osg::GraphicsContext::createGraphicsContext(traits.get()); @@ -769,7 +771,7 @@ int main( int argc, char **argv ) osgDB::Registry::instance()->getOptions()->setObjectCacheHint(osgDB::Options::CACHE_ALL); } - std::string fileNameOut("converted.osg"); + std::string fileNameOut("converted.osgt"); if (fileNames.size()>1) { fileNameOut = fileNames.back(); @@ -778,29 +780,66 @@ int main( int argc, char **argv ) osg::Timer_t startTick = osg::Timer::instance()->tick(); - osg::ref_ptr root = osgDB::readRefNodeFiles(fileNames); + typedef std::vector< osg::ref_ptr > Images; + typedef std::vector< osg::ref_ptr > Nodes; + typedef std::vector< osg::ref_ptr > Objects; - if (root.valid()) + Images images; + Nodes nodes; + Objects objects; + + for(FileNameList::iterator itr = fileNames.begin(); + itr != fileNames.end(); + ++itr) { - osg::Timer_t endTick = osg::Timer::instance()->tick(); - osg::notify(osg::INFO)<<"Time to load files "<delta_m(startTick, endTick)<<" ms"< object = osgDB::readObjectFile(*itr); + if (object.valid()) + { + if (object->asNode()) nodes.push_back(object->asNode()); + else if (object->asImage()) images.push_back(object->asImage()); + else objects.push_back(object); + } } - - if (pruneStateSet) + if (images.empty() && nodes.empty() && objects.empty()) { - PruneStateSetVisitor pssv; - root->accept(pssv); + osg::notify(osg::NOTICE)<<"Warning: failed to load any files"<tick(); + osg::notify(osg::INFO)<<"Time to load files "<delta_m(startTick, endTick)<<" ms"< root; + + if (nodes.size()==1) root = nodes.front(); + else if (nodes.size()>1) { - FixTransparencyVisitor atv(fixTransparencyMode); - root->accept(atv); + osg::ref_ptr group = new osg::Group; + for(Nodes::iterator itr = nodes.begin(); + itr != nodes.end(); + ++itr) + { + group->addChild(itr->get()); + } + + root = group; } if ( root.valid() ) { + if (pruneStateSet) + { + PruneStateSetVisitor pssv; + root->accept(pssv); + } + + if (fixTransparencyMode != FixTransparencyVisitor::NO_TRANSPARANCY_FIXING) + { + FixTransparencyVisitor atv(fixTransparencyMode); + root->accept(atv); + } if (smooth) { @@ -866,6 +905,20 @@ int main( int argc, char **argv ) osg::notify(osg::NOTICE)<1) + { + OSG_NOTICE<<"Warning: osgconv does not support writing multiple to a single file."< #include #include +#include #ifdef BUILD_CONTRIBUTORS extern void printContributors(const std::string& changeLog, bool printNumEntries); @@ -40,6 +41,7 @@ int main( int argc, char** argv) arguments.getApplicationUsage()->addCommandLineOption("Plane::value_type", "Print the value of Plane::value_type"); arguments.getApplicationUsage()->addCommandLineOption("BoundingSphere::value_type", "Print the value of BoundingSphere::value_type"); arguments.getApplicationUsage()->addCommandLineOption("BoundingBox::value_type", "Print the value of BoundingBox::value_type"); + arguments.getApplicationUsage()->addCommandLineOption("Quat::value_type", "Print the value of Quat::value_type"); #ifdef BUILD_CONTRIBUTORS arguments.getApplicationUsage()->addCommandLineOption("-r or --read ", "Read the ChangeLog to generate an estimated contributors list."); @@ -139,6 +141,12 @@ int main( int argc, char** argv) return 0; } + if (arguments.read("Quat::value_type")) + { + cout << ((sizeof(osg::Quat::value_type) == 4) ? "float" : "double") << endl; + return 0; + } + cout << osgGetLibraryName() << " " << osgGetVersion() << endl << endl; #ifdef BUILD_CONTRIBUTORS diff --git a/applications/osgviewer/osgviewer.cpp b/applications/osgviewer/osgviewer.cpp index 0d7919687b2..d868c3faa13 100644 --- a/applications/osgviewer/osgviewer.cpp +++ b/applications/osgviewer/osgviewer.cpp @@ -48,6 +48,7 @@ int main(int argc, char** argv) arguments.getApplicationUsage()->addCommandLineOption("-p ","Play specified camera path animation file, previously saved with 'z' key."); arguments.getApplicationUsage()->addCommandLineOption("--speed ","Speed factor for animation playing (1 == normal speed)."); arguments.getApplicationUsage()->addCommandLineOption("--device ","add named device to the viewer"); + arguments.getApplicationUsage()->addCommandLineOption("--stats","print out load and compile timing stats"); osgViewer::Viewer viewer(arguments); @@ -71,6 +72,8 @@ int main(int argc, char** argv) return 1; } + bool printStats = arguments.read("--stats"); + std::string url, username, password; while(arguments.read("--login",url, username, password)) { @@ -109,7 +112,7 @@ int main(int argc, char** argv) while (arguments.read("-p",pathfile)) { osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile); - if (apm || !apm->valid()) + if (apm && !apm->getAnimationPath()->empty()) { apm->setTimeScale(animationSpeed); @@ -147,6 +150,8 @@ int main(int argc, char** argv) // add the screen capture handler viewer.addEventHandler(new osgViewer::ScreenCaptureHandler); + osg::ElapsedTime elapsedTime; + // load the data osg::ref_ptr loadedModel = osgDB::readRefNodeFiles(arguments); if (!loadedModel) @@ -155,6 +160,15 @@ int main(int argc, char** argv) return 1; } + if (printStats) + { + double loadTime = elapsedTime.elapsedTime_m(); + std::cout<<"Load time "<collectStats("compile", true); + } + + // any option left unread are converted into errors to write out later. arguments.reportRemainingOptionsAsUnrecognized(); diff --git a/applications/present3D/Cluster.cpp b/applications/present3D/Cluster.cpp index d88a3603401..d1863e8386e 100644 --- a/applications/present3D/Cluster.cpp +++ b/applications/present3D/Cluster.cpp @@ -1,13 +1,14 @@ -/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield * - * This software is open source and may be redistributed and/or modified under - * the terms of the GNU General Public License (GPL) version 2.0. - * The full license is in LICENSE.txt file included with this distribution,. + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * (at your option) any later version. The full license is in LICENSE file + * included with this distribution, and on the openscenegraph.org website. * - * This software is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * include LICENSE.txt for more details. + * OpenSceneGraph Public License for more details. */ #include "Cluster.h" @@ -17,7 +18,7 @@ #include #include -#if !defined (WIN32) || defined(__CYGWIN__) +#if !defined (_WIN32) || defined(__CYGWIN__) #include #include #include @@ -50,7 +51,7 @@ #elif defined (__APPLE__) #include #include -#elif defined (WIN32) +#elif defined (_WIN32) #include #include #elif defined (__hpux) @@ -62,7 +63,7 @@ #include #include #include -#if defined (WIN32) && !defined(__CYGWIN__) +#if defined (_WIN32) && !defined(__CYGWIN__) #include #else #include @@ -264,7 +265,7 @@ Receiver::Receiver( void ) Receiver::~Receiver( void ) { -#if defined (WIN32) && !defined(__CYGWIN__) +#if defined (_WIN32) && !defined(__CYGWIN__) closesocket( _so); #else close( _so ); @@ -273,7 +274,7 @@ Receiver::~Receiver( void ) bool Receiver::init( void ) { -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) WORD version = MAKEWORD(1,1); WSADATA wsaData; // First, we start up Winsock @@ -294,7 +295,7 @@ bool Receiver::init( void ) int result = 0; -#if defined (WIN32) && !defined(__CYGWIN__) +#if defined (_WIN32) && !defined(__CYGWIN__) // const BOOL on = TRUE; // setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, (const char*) &on, sizeof(int)); #else @@ -304,14 +305,14 @@ bool Receiver::init( void ) if (result) { - OSG_NOTICE<<"Warning: Reciever::init() setsockopt(..) failed, errno="< -#if !defined(WIN32) || defined(__CYGWIN__) +#if !defined(_WIN32) || defined(__CYGWIN__) #include #else #include "winsock.h" @@ -50,7 +51,7 @@ class Receiver bool init( void ); private : -#if defined (WIN32) && !defined(__CYGWIN__) +#if defined (_WIN32) && !defined(__CYGWIN__) SOCKET _so; SOCKADDR_IN saddr; #else @@ -93,7 +94,7 @@ class Broadcaster bool init( void ); private : -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) SOCKET _so; #else int _so; @@ -102,7 +103,7 @@ class Broadcaster short _port; void *_buffer; unsigned int _buffer_size; -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) SOCKADDR_IN saddr; #else struct sockaddr_in saddr; diff --git a/applications/present3D/ExportHTML.cpp b/applications/present3D/ExportHTML.cpp index f573ce04173..3c7de139742 100644 --- a/applications/present3D/ExportHTML.cpp +++ b/applications/present3D/ExportHTML.cpp @@ -1,13 +1,14 @@ -/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield * - * This software is open source and may be redistributed and/or modified under - * the terms of the GNU General Public License (GPL) version 2.0. - * The full license is in LICENSE.txt file included with this distribution,. + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * (at your option) any later version. The full license is in LICENSE file + * included with this distribution, and on the openscenegraph.org website. * - * This software is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * include LICENSE.txt for more details. + * OpenSceneGraph Public License for more details. */ #include "ExportHTML.h" diff --git a/applications/present3D/ExportHTML.h b/applications/present3D/ExportHTML.h index a2566cf3ddd..47bfe787ab3 100644 --- a/applications/present3D/ExportHTML.h +++ b/applications/present3D/ExportHTML.h @@ -1,13 +1,14 @@ -/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield * - * This software is open source and may be redistributed and/or modified under - * the terms of the GNU General Public License (GPL) version 2.0. - * The full license is in LICENSE.txt file included with this distribution,. + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * (at your option) any later version. The full license is in LICENSE file + * included with this distribution, and on the openscenegraph.org website. * - * This software is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * include LICENSE.txt for more details. + * OpenSceneGraph Public License for more details. */ #ifndef EXPORTHTML_H diff --git a/applications/present3D/PointsEventHandler.cpp b/applications/present3D/PointsEventHandler.cpp index 78ff548c75e..78eb7a037b4 100644 --- a/applications/present3D/PointsEventHandler.cpp +++ b/applications/present3D/PointsEventHandler.cpp @@ -1,13 +1,14 @@ -/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield * - * This software is open source and may be redistributed and/or modified under - * the terms of the GNU General Public License (GPL) version 2.0. - * The full license is in LICENSE.txt file included with this distribution,. + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * (at your option) any later version. The full license is in LICENSE file + * included with this distribution, and on the openscenegraph.org website. * - * This software is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * include LICENSE.txt for more details. + * OpenSceneGraph Public License for more details. */ #include "PointsEventHandler.h" diff --git a/applications/present3D/PointsEventHandler.h b/applications/present3D/PointsEventHandler.h index 2594ad73bea..a9abd76ff55 100644 --- a/applications/present3D/PointsEventHandler.h +++ b/applications/present3D/PointsEventHandler.h @@ -1,13 +1,14 @@ -/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield * - * This software is open source and may be redistributed and/or modified under - * the terms of the GNU General Public License (GPL) version 2.0. - * The full license is in LICENSE.txt file included with this distribution,. + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * (at your option) any later version. The full license is in LICENSE file + * included with this distribution, and on the openscenegraph.org website. * - * This software is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * include LICENSE.txt for more details. + * OpenSceneGraph Public License for more details. */ #ifndef POINTSEVENTHANDLER diff --git a/applications/present3D/ReadShowFile.cpp b/applications/present3D/ReadShowFile.cpp index 474660cb59b..21b7d4abbff 100644 --- a/applications/present3D/ReadShowFile.cpp +++ b/applications/present3D/ReadShowFile.cpp @@ -1,13 +1,14 @@ -/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield * - * This software is open source and may be redistributed and/or modified under - * the terms of the GNU General Public License (GPL) version 2.0. - * The full license is in LICENSE.txt file included with this distribution,. + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * (at your option) any later version. The full license is in LICENSE file + * included with this distribution, and on the openscenegraph.org website. * - * This software is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * include LICENSE.txt for more details. + * OpenSceneGraph Public License for more details. */ #include "ReadShowFile.h" diff --git a/applications/present3D/ReadShowFile.h b/applications/present3D/ReadShowFile.h index f664a2b6ac9..caa32ba0ca1 100644 --- a/applications/present3D/ReadShowFile.h +++ b/applications/present3D/ReadShowFile.h @@ -1,13 +1,14 @@ -/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield * - * This software is open source and may be redistributed and/or modified under - * the terms of the GNU General Public License (GPL) version 2.0. - * The full license is in LICENSE.txt file included with this distribution,. - * - * This software is distributed in the hope that it will be useful, + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * (at your option) any later version. The full license is in LICENSE file + * included with this distribution, and on the openscenegraph.org website. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * include LICENSE.txt for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * OpenSceneGraph Public License for more details. */ #ifndef P3D_READFILE diff --git a/applications/present3D/SDLIntegration.cpp b/applications/present3D/SDLIntegration.cpp index 1a46c8d8bbd..5e938719bd4 100644 --- a/applications/present3D/SDLIntegration.cpp +++ b/applications/present3D/SDLIntegration.cpp @@ -1,13 +1,14 @@ -/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield * - * This software is open source and may be redistributed and/or modified under - * the terms of the GNU General Public License (GPL) version 2.0. - * The full license is in LICENSE.txt file included with this distribution,. - * - * This software is distributed in the hope that it will be useful, + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * (at your option) any later version. The full license is in LICENSE file + * included with this distribution, and on the openscenegraph.org website. + * + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * include LICENSE.txt for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * OpenSceneGraph Public License for more details. */ #include @@ -33,7 +34,7 @@ SDLIntegration::SDLIntegration() atexit(SDL_Quit); int numJoysticks = SDL_NumJoysticks(); - + if (_verbose) { std::cout<<"number of joysticks "<0 ? SDL_JoystickOpen(0) : 0; - + _numAxes = _joystick ? SDL_JoystickNumAxes(_joystick) : 0; _numBalls = _joystick ? SDL_JoystickNumBalls(_joystick) : 0; _numHats = _joystick ? SDL_JoystickNumHats(_joystick) : 0; @@ -57,13 +58,13 @@ SDLIntegration::SDLIntegration() std::cout<<"numHats = "<<_numHats< diff --git a/applications/present3D/SpellChecker.h b/applications/present3D/SpellChecker.h index 12781208fad..57daa32afc6 100644 --- a/applications/present3D/SpellChecker.h +++ b/applications/present3D/SpellChecker.h @@ -1,13 +1,14 @@ -/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield * - * This software is open source and may be redistributed and/or modified under - * the terms of the GNU General Public License (GPL) version 2.0. - * The full license is in LICENSE.txt file included with this distribution,. + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * (at your option) any later version. The full license is in LICENSE file + * included with this distribution, and on the openscenegraph.org website. * - * This software is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * include LICENSE.txt for more details. + * OpenSceneGraph Public License for more details. */ #ifndef SPELLCHCKER_H diff --git a/applications/present3D/present3D.cpp b/applications/present3D/present3D.cpp index 24318d9ec3b..279d70db19b 100644 --- a/applications/present3D/present3D.cpp +++ b/applications/present3D/present3D.cpp @@ -1,13 +1,14 @@ -/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield * - * This software is open source and may be redistributed and/or modified under - * the terms of the GNU General Public License (GPL) version 2.0. - * The full license is in LICENSE.txt file included with this distribution,. + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * (at your option) any later version. The full license is in LICENSE file + * included with this distribution, and on the openscenegraph.org website. * - * This software is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * include LICENSE.txt for more details. + * OpenSceneGraph Public License for more details. */ #include @@ -483,7 +484,7 @@ int main( int argc, char **argv ) while (arguments.read("-p",pathfile)) { osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile); - if (apm || !apm->valid()) + if (apm && !apm->getAnimationPath()->empty()) { unsigned int num = keyswitchManipulator->getNumMatrixManipulators(); keyswitchManipulator->addMatrixManipulator( keyForAnimationPath, "Path", apm ); @@ -507,7 +508,7 @@ int main( int argc, char **argv ) viewer.addEventHandler( new osgViewer::WindowSizeHandler() ); - // neeed to address. + // need to address. // viewer.getScene()->getUpdateVisitor()->setTraversalMode(osg::NodeVisitor::TRAVERSE_ACTIVE_CHILDREN); @@ -557,7 +558,7 @@ int main( int argc, char **argv ) while (arguments.read("--loop")) loopPresentation = true; { - // set update hte default traversal mode settings for update visitor + // set update the default traversal mode settings for update visitor // default to osg::NodeVisitor::TRAVERSE_ACTIVE_CHILDREN. osg::NodeVisitor::TraversalMode updateTraversalMode = osg::NodeVisitor::TRAVERSE_ACTIVE_CHILDREN; // viewer.getUpdateVisitor()->getTraversalMode(); @@ -689,7 +690,7 @@ int main( int argc, char **argv ) // any option left unread are converted into errors to write out later. //arguments.reportRemainingOptionsAsUnrecognized(); - // report any errors if they have ocured when parsing the program aguments. + // report any errors if they have ocured when parsing the program arguments. if (arguments.errors()) { arguments.writeErrorMessages(osg::notify(osg::INFO)); diff --git a/doc/Doxyfiles/auto_Doxyfile b/doc/Doxyfiles/auto_Doxyfile index 99a9bd868c3..0759f326a62 100644 --- a/doc/Doxyfiles/auto_Doxyfile +++ b/doc/Doxyfiles/auto_Doxyfile @@ -99,15 +99,16 @@ INPUT = ${OpenSceneGraph_SOURCE_DIR}/include/osg \ ${OpenSceneGraph_SOURCE_DIR}/include/osgGA \ ${OpenSceneGraph_SOURCE_DIR}/include/osgManipulator \ ${OpenSceneGraph_SOURCE_DIR}/include/osgParticle \ + ${OpenSceneGraph_SOURCE_DIR}/include/osgPresentation \ ${OpenSceneGraph_SOURCE_DIR}/include/osgShadow \ ${OpenSceneGraph_SOURCE_DIR}/include/osgSim \ ${OpenSceneGraph_SOURCE_DIR}/include/osgTerrain \ ${OpenSceneGraph_SOURCE_DIR}/include/osgText \ + ${OpenSceneGraph_SOURCE_DIR}/include/osgUI \ ${OpenSceneGraph_SOURCE_DIR}/include/osgUtil \ ${OpenSceneGraph_SOURCE_DIR}/include/osgViewer \ ${OpenSceneGraph_SOURCE_DIR}/include/osgVolume \ ${OpenSceneGraph_SOURCE_DIR}/include/osgWidget \ - ${OpenSceneGraph_SOURCE_DIR}/include/osgQt \ ${OpenSceneGraph_SOURCE_DIR}/doc/Doxyfiles/auto_Mainpage INPUT_ENCODING = UTF-8 FILE_PATTERNS = *include* \ diff --git a/doc/Doxyfiles/core_Doxyfile b/doc/Doxyfiles/core_Doxyfile index 373e1b68523..2fb8f57025c 100644 --- a/doc/Doxyfiles/core_Doxyfile +++ b/doc/Doxyfiles/core_Doxyfile @@ -89,15 +89,16 @@ INPUT = ${OpenSceneGraph_SOURCE_DIR}/include/osg \ ${OpenSceneGraph_SOURCE_DIR}/include/osgGA \ ${OpenSceneGraph_SOURCE_DIR}/include/osgManipulator \ ${OpenSceneGraph_SOURCE_DIR}/include/osgParticle \ + ${OpenSceneGraph_SOURCE_DIR}/include/osgPresentation \ ${OpenSceneGraph_SOURCE_DIR}/include/osgShadow \ ${OpenSceneGraph_SOURCE_DIR}/include/osgSim \ ${OpenSceneGraph_SOURCE_DIR}/include/osgTerrain \ ${OpenSceneGraph_SOURCE_DIR}/include/osgText \ + ${OpenSceneGraph_SOURCE_DIR}/include/osgUI \ ${OpenSceneGraph_SOURCE_DIR}/include/osgUtil \ ${OpenSceneGraph_SOURCE_DIR}/include/osgViewer \ ${OpenSceneGraph_SOURCE_DIR}/include/osgVolume \ ${OpenSceneGraph_SOURCE_DIR}/include/osgWidget \ - ${OpenSceneGraph_SOURCE_DIR}/include/osgQt \ ${OpenSceneGraph_SOURCE_DIR}/doc/Doxyfiles/auto_Mainpage INPUT_ENCODING = UTF-8 FILE_PATTERNS = *include* \ diff --git a/doc/Doxyfiles/doxyfile.cmake b/doc/Doxyfiles/doxyfile.cmake index d3d17271cc4..b59663b8d87 100644 --- a/doc/Doxyfiles/doxyfile.cmake +++ b/doc/Doxyfiles/doxyfile.cmake @@ -90,7 +90,7 @@ INPUT = "${OpenSceneGraph_SOURCE_DIR}/include/osg" \ "${OpenSceneGraph_SOURCE_DIR}/include/osgGA" \ "${OpenSceneGraph_SOURCE_DIR}/include/osgManipulator" \ "${OpenSceneGraph_SOURCE_DIR}/include/osgParticle" \ - "${OpenSceneGraph_SOURCE_DIR}/include/osgQt" \ + "${OpenSceneGraph_SOURCE_DIR}/include/osgPresentation" \ "${OpenSceneGraph_SOURCE_DIR}/include/osgShadow" \ "${OpenSceneGraph_SOURCE_DIR}/include/osgSim" \ "${OpenSceneGraph_SOURCE_DIR}/include/osgTerrain" \ diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 4edb8dc39c0..788e5075f5c 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -243,13 +243,11 @@ ELSE(DYNAMIC_OPENSCENEGRAPH) #needed on win32 or the linker get confused by _declspec declarations ADD_DEFINITIONS(-DOSG_LIBRARY_STATIC) - ADD_SUBDIRECTORY(osgstaticviewer) - - # IPHONE_PORT@tom - IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR) + IF(OSG_BUILD_PLATFORM_IPHONE) ADD_SUBDIRECTORY(osgviewerIPhone) + ELSE() + ADD_SUBDIRECTORY(osgstaticviewer) ENDIF() - # IPHONE_PORT@tom ENDIF(DYNAMIC_OPENSCENEGRAPH) diff --git a/examples/osgAndroidExampleGLES1/AndroidManifest.xml b/examples/osgAndroidExampleGLES1/AndroidManifest.xml index eac0d374abc..ccb99b39b19 100644 --- a/examples/osgAndroidExampleGLES1/AndroidManifest.xml +++ b/examples/osgAndroidExampleGLES1/AndroidManifest.xml @@ -5,7 +5,7 @@ android:versionCode="1" android:versionName="1.0"> - + diff --git a/examples/osgAndroidExampleGLES2/AndroidManifest.xml b/examples/osgAndroidExampleGLES2/AndroidManifest.xml index 7c6c68209fc..d7b9b3f293f 100644 --- a/examples/osgAndroidExampleGLES2/AndroidManifest.xml +++ b/examples/osgAndroidExampleGLES2/AndroidManifest.xml @@ -5,7 +5,7 @@ android:versionCode="1" android:versionName="1.0"> - + diff --git a/examples/osgAndroidExampleGLES2/jni/OsgMainApp.cpp b/examples/osgAndroidExampleGLES2/jni/OsgMainApp.cpp index 8d11fb14de3..628e15588f2 100644 --- a/examples/osgAndroidExampleGLES2/jni/OsgMainApp.cpp +++ b/examples/osgAndroidExampleGLES2/jni/OsgMainApp.cpp @@ -103,7 +103,9 @@ void OsgMainApp::initOsgWindow(int x,int y,int width,int height){ osg::notify(osg::ALWAYS)<<"Testing"<setUpViewerAsEmbeddedInWindow(x, y, width, height); + osgViewer::GraphicsWindowEmbedded* window = _viewer->setUpViewerAsEmbeddedInWindow(x, y, width, height); + _viewer->getEventQueue()->setGraphicsContext(window); + _viewer->getEventQueue()->syncWindowRectangleWithGraphicsContext(); _viewer->setThreadingModel(osgViewer::ViewerBase::SingleThreaded); _root = new osg::Group(); diff --git a/examples/osgCMakeExample/main.cpp b/examples/osgCMakeExample/main.cpp index d790d3873d1..e7592c8bee0 100644 --- a/examples/osgCMakeExample/main.cpp +++ b/examples/osgCMakeExample/main.cpp @@ -113,7 +113,7 @@ int main(int argc, char** argv) while (arguments.read("-p",pathfile)) { osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile); - if (apm || !apm->valid()) + if (apm && !apm->getAnimationPath()->empty()) { apm->setTimeScale(animationSpeed); diff --git a/examples/osgSSBO/osgSSBO.cpp b/examples/osgSSBO/osgSSBO.cpp index 5ce2ec07c67..ca8f80d5583 100644 --- a/examples/osgSSBO/osgSSBO.cpp +++ b/examples/osgSSBO/osgSSBO.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include @@ -167,7 +167,7 @@ class ComputeNode : public osg::PositionAttitudeTransform public: - osg::ref_ptr _computeDispatch; + osg::ref_ptr _DispatchCompute; osg::ref_ptr _computeProgram; osg::ref_ptr _computeShader; //compute and write position data in SSBO @@ -205,8 +205,8 @@ class ComputeNode : public osg::PositionAttitudeTransform _vertexShaderSourcePath = "shaders/osgssboVertexShader.vs"; _geometryShaderSourcePath = "shaders/osgssboGeometryShader.gs"; _fragmentShaderSourcePath = "shaders/osgssboFragmentShader.fs"; - _computeDispatch=new osg::ComputeDispatch(); - addChild(_computeDispatch); + _DispatchCompute=new osg::DispatchCompute(); + addChild(_DispatchCompute); } }; @@ -625,7 +625,7 @@ void ComputeNode::initComputingSetup() { _computeProgram = new osg::Program; - _computeDispatch->setComputeGroups((NUM_ELEMENTS_X / WORK_GROUP_SIZE) <= 1 ? 1 : (NUM_ELEMENTS_X / WORK_GROUP_SIZE), (NUM_ELEMENTS_Y / WORK_GROUP_SIZE) <= 1 ? 1 : (NUM_ELEMENTS_Y / WORK_GROUP_SIZE), 1); + _DispatchCompute->setComputeGroups((NUM_ELEMENTS_X / WORK_GROUP_SIZE) <= 1 ? 1 : (NUM_ELEMENTS_X / WORK_GROUP_SIZE), (NUM_ELEMENTS_Y / WORK_GROUP_SIZE) <= 1 ? 1 : (NUM_ELEMENTS_Y / WORK_GROUP_SIZE), 1); _computeShader = osgDB::readRefShaderFile(osg::Shader::COMPUTE, _computeShaderSourcePath); _computeProgram->addShader(_computeShader.get()); diff --git a/examples/osganalysis/osganalysis.cpp b/examples/osganalysis/osganalysis.cpp index 063c410dba9..37fa01deb8f 100644 --- a/examples/osganalysis/osganalysis.cpp +++ b/examples/osganalysis/osganalysis.cpp @@ -393,8 +393,6 @@ class SceneGraphProcessor : public osg::Referenced while (arguments.read("--dl")) { modifyDrawableSettings = true; useDisplayLists = true; } while (arguments.read("-s", simplificatioRatio)) {} - while (arguments.read("--tristripper")) { useTriStripVisitor=true; } - while (arguments.read("--no-tristripper")) { useTriStripVisitor=false; } while (arguments.read("--smoother")) { useSmoothingVisitor=true; } while (arguments.read("--no-smoother")) { useSmoothingVisitor=false; } @@ -426,7 +424,6 @@ class SceneGraphProcessor : public osg::Referenced OSG_NOTICE<<"Running simplifier with simplification ratio="<accept(simplifier); } diff --git a/examples/osganimationhardware/osganimationhardware.cpp b/examples/osganimationhardware/osganimationhardware.cpp index 1cb05473f99..36a63d9db7f 100644 --- a/examples/osganimationhardware/osganimationhardware.cpp +++ b/examples/osganimationhardware/osganimationhardware.cpp @@ -84,7 +84,7 @@ struct MyRigTransformHardware : public osgAnimation::RigTransformHardware CommonProgram = new osg::Program; CommonProgram->setName("HardwareSkinning"); - //set default source if _shader is not user setted + //set default source if _shader is not user set if (!vertexshader.valid()) { vertexshader = osgDB::readRefShaderFile(osg::Shader::VERTEX,"skinning.vert"); diff --git a/examples/osgautocapture/osgautocapture.cpp b/examples/osgautocapture/osgautocapture.cpp index be19ef22a07..9add26db092 100644 --- a/examples/osgautocapture/osgautocapture.cpp +++ b/examples/osgautocapture/osgautocapture.cpp @@ -245,10 +245,12 @@ int main( int argc, char **argv ) traits->depth = src_traits->depth; traits->pbuffer = true; } else { - //viewer would use fullscreen size (unknown here) pbuffer will use 4096 x4096 (or best avaiable) + //viewer would use fullscreen size (unknown here) pbuffer will use 4096 x4096 (or best available) traits->width = 1 << 12; traits->height = 1 << 12; traits->pbuffer = true; + traits->readDISPLAY(); + traits->setUndefinedScreenDetailsToDefaultScreen(); } osg::ref_ptr pbuffer = osg::GraphicsContext::createGraphicsContext(traits.get()); if (pbuffer.valid()) @@ -310,7 +312,7 @@ int main( int argc, char **argv ) osg::CoordinateSystemNode* csn = findTopMostNodeOfType(loadedModel.get()); if(!csn) return 1; - // Compute eye point in world coordiantes + // Compute eye point in world coordinates osg::Vec3d eye; csn->getEllipsoidModel()->convertLatLongHeightToXYZ(lat, lon, alt, eye.x(), eye.y(), eye.z()); diff --git a/examples/osgautotransform/osgautotransform.cpp b/examples/osgautotransform/osgautotransform.cpp index 599ac222803..8e540d82b4f 100644 --- a/examples/osgautotransform/osgautotransform.cpp +++ b/examples/osgautotransform/osgautotransform.cpp @@ -209,6 +209,8 @@ osgViewer::View* createView(osg::ref_ptr scenegraph, osg::ref_ptrwindowDecoration = true; traits->doubleBuffer = true; traits->sharedContext = 0; + traits->readDISPLAY(); + traits->setUndefinedScreenDetailsToDefaultScreen(); gc = osg::GraphicsContext::createGraphicsContext(traits.get()); if (!gc) @@ -267,7 +269,11 @@ int main(int argc, char** argv) } unsigned int width, height; - wsi->getScreenResolution(osg::GraphicsContext::ScreenIdentifier(0), width, height); + osg::GraphicsContext::ScreenIdentifier main_screen_id; + + main_screen_id.readDISPLAY(); + main_screen_id.setUndefinedScreenDetailsToDefaultScreen(); + wsi->getScreenResolution(main_screen_id, width, height); unsigned int x=0, y=0; while(arguments.read("--window", x, y, width, height)) {} @@ -283,6 +289,8 @@ int main(int argc, char** argv) traits->windowDecoration = true; traits->doubleBuffer = true; traits->sharedContext = 0; + traits->readDISPLAY(); + traits->setUndefinedScreenDetailsToDefaultScreen(); gc = osg::GraphicsContext::createGraphicsContext(traits.get()); if (!gc) diff --git a/examples/osgcallback/osgcallback.cpp b/examples/osgcallback/osgcallback.cpp index 661b8e08e04..0d5ab8ea62d 100644 --- a/examples/osgcallback/osgcallback.cpp +++ b/examples/osgcallback/osgcallback.cpp @@ -184,7 +184,7 @@ int main( int argc, char **argv ) // use an ArgumentParser object to manage the program arguments. osg::ArgumentParser arguments(&argc,argv); - // set the osgDB::Registy read file callback to catch all requests for reading files. + // set the osgDB::Registry read file callback to catch all requests for reading files. osgDB::Registry::instance()->setReadFileCallback(new MyReadFileCallback()); // initialize the viewer. diff --git a/examples/osgcamera/osgcamera.cpp b/examples/osgcamera/osgcamera.cpp index af585549e74..8d9f7f8e0d0 100644 --- a/examples/osgcamera/osgcamera.cpp +++ b/examples/osgcamera/osgcamera.cpp @@ -83,7 +83,11 @@ void singleWindowMultipleCameras(osgViewer::Viewer& viewer) } unsigned int width, height; - wsi->getScreenResolution(osg::GraphicsContext::ScreenIdentifier(0), width, height); + osg::GraphicsContext::ScreenIdentifier main_screen_id; + + main_screen_id.readDISPLAY(); + main_screen_id.setUndefinedScreenDetailsToDefaultScreen(); + wsi->getScreenResolution(main_screen_id, width, height); osg::ref_ptr traits = new osg::GraphicsContext::Traits; traits->x = 0; @@ -93,6 +97,8 @@ void singleWindowMultipleCameras(osgViewer::Viewer& viewer) traits->windowDecoration = true; traits->doubleBuffer = true; traits->sharedContext = 0; + traits->readDISPLAY(); + traits->setUndefinedScreenDetailsToDefaultScreen(); osg::ref_ptr gc = osg::GraphicsContext::createGraphicsContext(traits.get()); if (gc.valid()) @@ -134,7 +140,11 @@ void multipleWindowMultipleCameras(osgViewer::Viewer& viewer, bool multipleScree } unsigned int width, height; - wsi->getScreenResolution(osg::GraphicsContext::ScreenIdentifier(0), width, height); + osg::GraphicsContext::ScreenIdentifier main_screen_id; + + main_screen_id.readDISPLAY(); + main_screen_id.setUndefinedScreenDetailsToDefaultScreen(); + wsi->getScreenResolution(main_screen_id, width, height); unsigned int numCameras = 6; @@ -151,6 +161,8 @@ void multipleWindowMultipleCameras(osgViewer::Viewer& viewer, bool multipleScree traits->windowDecoration = true; traits->doubleBuffer = true; traits->sharedContext = 0; + traits->readDISPLAY(); + traits->setUndefinedScreenDetailsToDefaultScreen(); osg::ref_ptr gc = osg::GraphicsContext::createGraphicsContext(traits.get()); if (gc.valid()) diff --git a/examples/osgcatch/osgcatch.cpp b/examples/osgcatch/osgcatch.cpp index 8108ed3fc2d..1aae952f295 100644 --- a/examples/osgcatch/osgcatch.cpp +++ b/examples/osgcatch/osgcatch.cpp @@ -971,9 +971,7 @@ bool GameEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionA { createNewCatchable(); } - - - + break; } case(osgGA::GUIEventAdapter::KEYDOWN): { @@ -987,6 +985,7 @@ bool GameEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionA _rightKeyPressed=true; return true; } + break; } case(osgGA::GUIEventAdapter::KEYUP): { @@ -1000,6 +999,7 @@ bool GameEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionA _rightKeyPressed=false; return true; } + break; } case(osgGA::GUIEventAdapter::DRAG): case(osgGA::GUIEventAdapter::MOVE): diff --git a/examples/osgclip/CMakeLists.txt b/examples/osgclip/CMakeLists.txt index acc0d137fdc..f657fb111dc 100644 --- a/examples/osgclip/CMakeLists.txt +++ b/examples/osgclip/CMakeLists.txt @@ -1,6 +1,7 @@ -#this file is automatically generated - +#this file is automatically generated SET(TARGET_SRC osgclip.cpp ) +SET(TARGET_ADDED_LIBRARIES osgText ) + #### end var setup ### SETUP_EXAMPLE(osgclip) diff --git a/examples/osgclip/osgclip.cpp b/examples/osgclip/osgclip.cpp index b6f8e5cb1dc..1e2f56691e9 100644 --- a/examples/osgclip/osgclip.cpp +++ b/examples/osgclip/osgclip.cpp @@ -38,6 +38,7 @@ #include #include +#include osg::ref_ptr decorate_with_clip_node(const osg::ref_ptr& subgraph) @@ -57,23 +58,43 @@ osg::ref_ptr decorate_with_clip_node(const osg::ref_ptr& s wireframe_subgraph->addChild(subgraph); rootnode->addChild(wireframe_subgraph); -/* - // simple approach to adding a clipnode above a subgraph. + // more complex approach to managing ClipNode, allowing + // ClipNode node to be transformed independently from the subgraph + // that it is clipping. - // create clipped part. - osg::ClipNode* clipped_subgraph = new osg::ClipNode; + osg::MatrixTransform* transform= new osg::MatrixTransform; + + osg::NodeCallback* nc = new osg::AnimationPathCallback(subgraph->getBound().center(),osg::Vec3(0.0f,0.0f,1.0f),osg::inDegrees(45.0f)); + transform->setUpdateCallback(nc); + osg::ClipNode* clipnode = new osg::ClipNode; osg::BoundingSphere bs = subgraph->getBound(); bs.radius()*= 0.4f; osg::BoundingBox bb; bb.expandBy(bs); + clipnode->createClipBox(bb); + clipnode->setCullingActive(false); - clipped_subgraph->createClipBox(bb); + transform->addChild(clipnode); + rootnode->addChild(transform); + + + // create clipped part. + osg::Group* clipped_subgraph = new osg::Group; + + clipped_subgraph->setStateSet(clipnode->getStateSet()); clipped_subgraph->addChild(subgraph); rootnode->addChild(clipped_subgraph); -*/ + + return rootnode; +} + + +osg::ref_ptr simple_decorate_with_clip_node(const osg::ref_ptr& subgraph) +{ + osg::ref_ptr rootnode = new osg::Group; // more complex approach to managing ClipNode, allowing @@ -109,35 +130,66 @@ osg::ref_ptr decorate_with_clip_node(const osg::ref_ptr& s return rootnode; } - int main( int argc, char **argv ) { // use an ArgumentParser object to manage the program arguments. osg::ArgumentParser arguments(&argc,argv); + osgViewer::Viewer viewer(arguments); + // load the nodes from the commandline arguments. + osg::ref_ptr scene = new osg::Group; + + std::string textString; + while(arguments.read("--text", textString)) + { + osg::ref_ptr text = new osgText::Text; + text->setFont("fonts/times.ttf"); + text->setAxisAlignment(osgText::Text::XZ_PLANE); + text->setDrawMode(osgText::Text::TEXT|osgText::Text::ALIGNMENT|osgText::Text::BOUNDINGBOX|osgText::Text::FILLEDBOUNDINGBOX); + text->setText(textString); + scene->addChild(text); + } + + osg::ref_ptr loadedModel = osgDB::readRefNodeFiles(arguments); + if (loadedModel.valid()) + { + scene->addChild(scene.get()); + } // if not loaded assume no arguments passed in, try use default mode instead. - if (!loadedModel) loadedModel = osgDB::readRefNodeFile("cow.osgt"); + if (scene->getNumChildren()==0) + { + loadedModel = osgDB::readRefNodeFile("cow.osgt"); + scene->addChild(loadedModel.get()); + } - if (!loadedModel) + if (scene->getNumChildren()==0) { osg::notify(osg::NOTICE)<<"Please specify a filename on the command line"< rootnode = decorate_with_clip_node(loadedModel); + osg::ref_ptr rootnode; + + + if (arguments.read("--simple")) + { + rootnode = simple_decorate_with_clip_node(scene); + } + else + { + rootnode = decorate_with_clip_node(scene); + } // run optimization over the scene graph osgUtil::Optimizer optimzer; optimzer.optimize(rootnode); - osgViewer::Viewer viewer; - // set the scene to render viewer.setSceneData(rootnode); diff --git a/examples/osgcluster/broadcaster.cpp b/examples/osgcluster/broadcaster.cpp index a1a21432f5f..d968f437216 100644 --- a/examples/osgcluster/broadcaster.cpp +++ b/examples/osgcluster/broadcaster.cpp @@ -21,7 +21,7 @@ #include #include -#if !defined (WIN32) || defined(__CYGWIN__) +#if !defined (_WIN32) || defined(__CYGWIN__) #include #include #include @@ -54,7 +54,7 @@ #elif defined (__APPLE__) #include #include -#elif defined (WIN32) +#elif defined (_WIN32) #include #include #elif defined (__hpux) @@ -73,7 +73,7 @@ Broadcaster::Broadcaster( void ) _ifr_name = "eth0"; #elif defined(__sun) _ifr_name = "hme0"; -#elif !defined (WIN32) +#elif !defined (_WIN32) _ifr_name = "ef0"; #endif _port = 0; @@ -84,7 +84,7 @@ Broadcaster::Broadcaster( void ) Broadcaster::~Broadcaster( void ) { -#if defined (WIN32) && !defined(__CYGWIN__) +#if defined (_WIN32) && !defined(__CYGWIN__) closesocket( _so); #else close( _so ); @@ -93,7 +93,7 @@ Broadcaster::~Broadcaster( void ) bool Broadcaster::init( void ) { -#if defined (WIN32) && !defined(__CYGWIN__) +#if defined (_WIN32) && !defined(__CYGWIN__) WORD version = MAKEWORD(1,1); WSADATA wsaData; // First, we start up Winsock @@ -111,13 +111,13 @@ bool Broadcaster::init( void ) perror( "Socket" ); return false; } -#if defined (WIN32) && !defined(__CYGWIN__) +#if defined (_WIN32) && !defined(__CYGWIN__) const BOOL on = TRUE; #else int on = 1; #endif -#if defined (WIN32) && !defined(__CYGWIN__) +#if defined (_WIN32) && !defined(__CYGWIN__) setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, (const char *) &on, sizeof(int)); #else setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); @@ -127,17 +127,17 @@ bool Broadcaster::init( void ) saddr.sin_port = htons( _port ); if( _address == 0 ) { -#if defined (WIN32) && !defined(__CYGWIN__) +#if defined (_WIN32) && !defined(__CYGWIN__) setsockopt( _so, SOL_SOCKET, SO_BROADCAST, (const char *) &on, sizeof(int)); #else setsockopt( _so, SOL_SOCKET, SO_BROADCAST, &on, sizeof(on)); #endif -#if !defined (WIN32) || defined(__CYGWIN__) +#if !defined (_WIN32) || defined(__CYGWIN__) struct ifreq ifr; strcpy( ifr.ifr_name, _ifr_name.c_str()); #endif -#if defined (WIN32) // get the server address +#if defined (_WIN32) // get the server address saddr.sin_addr.s_addr = htonl(INADDR_BROADCAST); } #else @@ -202,7 +202,7 @@ void Broadcaster::sync( void ) return; } -#if defined (WIN32) && !defined(__CYGWIN__) +#if defined (_WIN32) && !defined(__CYGWIN__) unsigned int size = sizeof( SOCKADDR_IN ); sendto( _so, (const char *)_buffer, _buffer_size, 0, (struct sockaddr *)&saddr, size ); int err = WSAGetLastError (); diff --git a/examples/osgcluster/broadcaster.h b/examples/osgcluster/broadcaster.h index 8f9648cb36e..bcdd68aa2c0 100644 --- a/examples/osgcluster/broadcaster.h +++ b/examples/osgcluster/broadcaster.h @@ -29,7 +29,7 @@ // Class definition for broadcasting a buffer to a LAN // -#if !defined(WIN32) || defined(__CYGWIN__) +#if !defined(_WIN32) || defined(__CYGWIN__) #include #endif @@ -65,7 +65,7 @@ class Broadcaster std::string _ifr_name; -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) SOCKET _so; #else int _so; @@ -74,7 +74,7 @@ class Broadcaster short _port; void *_buffer; unsigned int _buffer_size; -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) SOCKADDR_IN saddr; #else struct sockaddr_in saddr; diff --git a/examples/osgcluster/osgcluster.cpp b/examples/osgcluster/osgcluster.cpp index c61380203ff..e2ba41d7a3c 100644 --- a/examples/osgcluster/osgcluster.cpp +++ b/examples/osgcluster/osgcluster.cpp @@ -36,7 +36,7 @@ #include -#if defined (WIN32) && !defined(__CYGWIN__) +#if defined (_WIN32) && !defined(__CYGWIN__) #include #endif @@ -509,7 +509,7 @@ int main( int argc, char **argv ) // any option left unread are converted into errors to write out later. arguments.reportRemainingOptionsAsUnrecognized(); - // report any errors if they have occurred when parsing the program aguments. + // report any errors if they have occurred when parsing the program arguments. if (arguments.errors()) { arguments.writeErrorMessages(std::cout); diff --git a/examples/osgcluster/receiver.cpp b/examples/osgcluster/receiver.cpp index 6ab5e79311f..985fab4e5c3 100644 --- a/examples/osgcluster/receiver.cpp +++ b/examples/osgcluster/receiver.cpp @@ -19,7 +19,7 @@ #include #include #include -#if defined (WIN32) && !defined(__CYGWIN__) +#if defined (_WIN32) && !defined(__CYGWIN__) #include #else #include @@ -46,7 +46,7 @@ Receiver::Receiver( void ) Receiver::~Receiver( void ) { -#if defined (WIN32) && !defined(__CYGWIN__) +#if defined (_WIN32) && !defined(__CYGWIN__) closesocket( _so); #else close( _so ); @@ -55,7 +55,7 @@ Receiver::~Receiver( void ) bool Receiver::init( void ) { -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) WORD version = MAKEWORD(1,1); WSADATA wsaData; // First, we start up Winsock @@ -73,7 +73,7 @@ bool Receiver::init( void ) perror( "Socket" ); return false; } -#if defined (WIN32) && !defined(__CYGWIN__) +#if defined (_WIN32) && !defined(__CYGWIN__) // const BOOL on = TRUE; // setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, (const char*) &on, sizeof(int)); #else @@ -84,7 +84,7 @@ bool Receiver::init( void ) // struct sockaddr_in saddr; saddr.sin_family = AF_INET; saddr.sin_port = htons( _port ); -#if defined (WIN32) && !defined(__CYGWIN__) +#if defined (_WIN32) && !defined(__CYGWIN__) saddr.sin_addr.s_addr = htonl(INADDR_ANY); #else saddr.sin_addr.s_addr = 0; @@ -137,7 +137,7 @@ unsigned int Receiver::sync( void ) tv.tv_sec = 0; tv.tv_usec = 0; -#if defined (WIN32) && !defined(__CYGWIN__) +#if defined (_WIN32) && !defined(__CYGWIN__) // saddr.sin_port = htons( _port ); recvfrom( _so, (char *)_buffer, _buffer_size, 0, (sockaddr*)&saddr, &size ); // recvfrom(sock_Receive, szMessage, 256, 0, (sockaddr*)&addr_Cli, &clilen) diff --git a/examples/osgcluster/receiver.h b/examples/osgcluster/receiver.h index 7b2a3b5d531..3d4877cff80 100644 --- a/examples/osgcluster/receiver.h +++ b/examples/osgcluster/receiver.h @@ -28,7 +28,7 @@ // Class definition for the recipient of a broadcasted message // -#if !defined(WIN32) || defined(__CYGWIN__) +#if !defined(_WIN32) || defined(__CYGWIN__) #include #endif @@ -53,7 +53,7 @@ class Receiver bool init( void ); private : -#if defined (WIN32) && !defined(__CYGWIN__) +#if defined (_WIN32) && !defined(__CYGWIN__) SOCKET _so; SOCKADDR_IN saddr; #else diff --git a/examples/osgcompositeviewer/osgcompositeviewer.cpp b/examples/osgcompositeviewer/osgcompositeviewer.cpp index 3e664d32582..ad1a955bccd 100644 --- a/examples/osgcompositeviewer/osgcompositeviewer.cpp +++ b/examples/osgcompositeviewer/osgcompositeviewer.cpp @@ -125,6 +125,42 @@ class PickHandler : public osgGA::GUIEventHandler { }; +class EventHandler : public osgGA::GUIEventHandler { +public: + + EventHandler() {} + + ~EventHandler() {} + + bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa) + { + osgViewer::View* view = dynamic_cast(&aa); + if (!view) return false; + + switch(ea.getEventType()) + { + case(osgGA::GUIEventAdapter::KEYDOWN): + case(osgGA::GUIEventAdapter::KEYUP): + OSG_NOTICE<<"View "<setName("View one"); + viewer.addView(view); + + view->setUpViewInWindow(0, 0, 800, 600); + view->setSceneData(scene.get()); + view->setCameraManipulator(new osgGA::TrackballManipulator); + + // add the state manipulator + osg::ref_ptr statesetManipulator = new osgGA::StateSetManipulator; + statesetManipulator->setStateSet(view->getCamera()->getOrCreateStateSet()); + + view->addEventHandler( statesetManipulator.get() ); + + view->addEventHandler( new EventHandler()); + } + + // view two + { + osgViewer::View* view = new osgViewer::View; + view->setName("View two"); + viewer.addView(view); + + view->setUpViewInWindow(1000, 0, 800, 600); + view->setSceneData(scene.get()); + view->setCameraManipulator(new osgGA::TrackballManipulator); + + view->addEventHandler( new osgViewer::StatsHandler ); + + + // add the handler for doing the picking + view->addEventHandler(new PickHandler()); + + view->addEventHandler( new EventHandler()); + } + } + + if (arguments.read("-3") || viewer.getNumViews()==0) { @@ -209,7 +289,11 @@ int main( int argc, char **argv ) } unsigned int width, height; - wsi->getScreenResolution(osg::GraphicsContext::ScreenIdentifier(0), width, height); + osg::GraphicsContext::ScreenIdentifier main_screen_id; + + main_screen_id.readDISPLAY(); + main_screen_id.setUndefinedScreenDetailsToDefaultScreen(); + wsi->getScreenResolution(main_screen_id, width, height); osg::ref_ptr traits = new osg::GraphicsContext::Traits; traits->x = 100; @@ -219,6 +303,8 @@ int main( int argc, char **argv ) traits->windowDecoration = true; traits->doubleBuffer = true; traits->sharedContext = 0; + traits->readDISPLAY(); + traits->setUndefinedScreenDetailsToDefaultScreen(); osg::ref_ptr gc = osg::GraphicsContext::createGraphicsContext(traits.get()); if (gc.valid()) diff --git a/examples/osgcomputeshaders/osgcomputeshaders.cpp b/examples/osgcomputeshaders/osgcomputeshaders.cpp index fa75987bf7f..c0b48445d53 100644 --- a/examples/osgcomputeshaders/osgcomputeshaders.cpp +++ b/examples/osgcomputeshaders/osgcomputeshaders.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include #include @@ -65,7 +65,7 @@ int main( int argc, char** argv ) // Create a node for outputting to the texture. // It is OK to have just an empty node here, but seems inbuilt uniforms like osg_FrameTime won't work then. // TODO: maybe we can have a custom drawable which also will implement glMemoryBarrier? - osg::ref_ptr sourceNode = new osg::ComputeDispatch(512/16, 512/16, 1 ); + osg::ref_ptr sourceNode = new osg::DispatchCompute(512/16, 512/16, 1 ); sourceNode->setDataVariance( osg::Object::DYNAMIC ); sourceNode->getOrCreateStateSet()->setAttributeAndModes( computeProg.get() ); sourceNode->getOrCreateStateSet()->addUniform( new osg::Uniform("targetTex", (int)0) ); diff --git a/examples/osgcopy/osgcopy.cpp b/examples/osgcopy/osgcopy.cpp index 6e9087c6a72..ef60b33d604 100644 --- a/examples/osgcopy/osgcopy.cpp +++ b/examples/osgcopy/osgcopy.cpp @@ -211,7 +211,7 @@ int main( int argc, char **argv ) // ------------- Start of copy specific code ------------------------------------------------------- - // do a deep copy, using MyCopyOp to reveal whats going on under the hood, + // do a deep copy, using MyCopyOp to reveal what's going on under the hood, // in your own code you'd typically just use the basic osg::CopyOp something like osg::ref_ptr mycopy = dynamic_cast(rootnode->clone(osg::CopyOp::DEEP_COPY_ALL)); std::cout << "Doing a deep copy of scene graph"< #include -void create_specular_highlights(osg::Node *node) +int main(int argc, char *argv[]) { - osg::StateSet *ss = node->getOrCreateStateSet(); + // use an ArgumentParser object to manage the program arguments. + osg::ArgumentParser arguments(&argc,argv); + + // construct the viewer. + osgViewer::Viewer viewer; + + osg::ref_ptr tcm = new osg::TextureCubeMap; - // create and setup the texture object - osg::TextureCubeMap *tcm = new osg::TextureCubeMap; tcm->setWrap(osg::Texture::WRAP_S, osg::Texture::CLAMP); tcm->setWrap(osg::Texture::WRAP_T, osg::Texture::CLAMP); tcm->setWrap(osg::Texture::WRAP_R, osg::Texture::CLAMP); - tcm->setFilter(osg::Texture::MIN_FILTER, osg::Texture::LINEAR_MIPMAP_LINEAR); - tcm->setFilter(osg::Texture::MAG_FILTER, osg::Texture::LINEAR); - // generate the six highlight map images (light direction = [1, 1, -1]) - osgUtil::HighlightMapGenerator *mapgen = new osgUtil::HighlightMapGenerator( - osg::Vec3(1, 1, -1), // light direction - osg::Vec4(1, 0.9f, 0.8f, 1), // light color - 8); // specular exponent + if (arguments.read("--no-mip-map")) + { + tcm->setFilter(osg::Texture::MIN_FILTER, osg::Texture::LINEAR); + tcm->setFilter(osg::Texture::MAG_FILTER, osg::Texture::LINEAR); + } + else + { + tcm->setFilter(osg::Texture::MIN_FILTER, osg::Texture::LINEAR_MIPMAP_LINEAR); + tcm->setFilter(osg::Texture::MAG_FILTER, osg::Texture::LINEAR); + } + + if (arguments.read("--hardware-mip-map") || arguments.read("--hmp")) + { + OSG_NOTICE<<"tcm->setUseHardwareMipMapGeneration(true)"<setUseHardwareMipMapGeneration(true); + } + + std::string filename; + if (arguments.read("--posx", filename)) tcm->setImage(osg::TextureCubeMap::POSITIVE_X, osgDB::readImageFile(filename)); + if (arguments.read("--negx", filename)) tcm->setImage(osg::TextureCubeMap::NEGATIVE_X, osgDB::readImageFile(filename)); + if (arguments.read("--posy", filename)) tcm->setImage(osg::TextureCubeMap::POSITIVE_Y, osgDB::readImageFile(filename)); + if (arguments.read("--negy", filename)) tcm->setImage(osg::TextureCubeMap::NEGATIVE_Y, osgDB::readImageFile(filename)); + if (arguments.read("--posz", filename)) tcm->setImage(osg::TextureCubeMap::POSITIVE_Z, osgDB::readImageFile(filename)); + if (arguments.read("--negz", filename)) tcm->setImage(osg::TextureCubeMap::NEGATIVE_Z, osgDB::readImageFile(filename)); - mapgen->generateMap(); - // assign the six images to the texture object - tcm->setImage(osg::TextureCubeMap::POSITIVE_X, mapgen->getImage(osg::TextureCubeMap::POSITIVE_X)); - tcm->setImage(osg::TextureCubeMap::NEGATIVE_X, mapgen->getImage(osg::TextureCubeMap::NEGATIVE_X)); - tcm->setImage(osg::TextureCubeMap::POSITIVE_Y, mapgen->getImage(osg::TextureCubeMap::POSITIVE_Y)); - tcm->setImage(osg::TextureCubeMap::NEGATIVE_Y, mapgen->getImage(osg::TextureCubeMap::NEGATIVE_Y)); - tcm->setImage(osg::TextureCubeMap::POSITIVE_Z, mapgen->getImage(osg::TextureCubeMap::POSITIVE_Z)); - tcm->setImage(osg::TextureCubeMap::NEGATIVE_Z, mapgen->getImage(osg::TextureCubeMap::NEGATIVE_Z)); + int numValidImages = 0; + if (tcm->getImage(osg::TextureCubeMap::POSITIVE_X)) ++numValidImages; + if (tcm->getImage(osg::TextureCubeMap::NEGATIVE_X)) ++numValidImages; + if (tcm->getImage(osg::TextureCubeMap::POSITIVE_Y)) ++numValidImages; + if (tcm->getImage(osg::TextureCubeMap::NEGATIVE_Y)) ++numValidImages; + if (tcm->getImage(osg::TextureCubeMap::POSITIVE_Z)) ++numValidImages; + if (tcm->getImage(osg::TextureCubeMap::NEGATIVE_Z)) ++numValidImages; + + if (numValidImages!=6) + { + // generate the six highlight map images (light direction = [1, 1, -1]) + osgUtil::HighlightMapGenerator *mapgen = new osgUtil::HighlightMapGenerator( + osg::Vec3(1, 1, -1), // light direction + osg::Vec4(1, 0.9f, 0.8f, 1), // light color + 8); // specular exponent + + mapgen->generateMap(); + + // assign the six images to the texture object + if (!tcm->getImage(osg::TextureCubeMap::POSITIVE_X)) tcm->setImage(osg::TextureCubeMap::POSITIVE_X, mapgen->getImage(osg::TextureCubeMap::POSITIVE_X)); + if (!tcm->getImage(osg::TextureCubeMap::NEGATIVE_X)) tcm->setImage(osg::TextureCubeMap::NEGATIVE_X, mapgen->getImage(osg::TextureCubeMap::NEGATIVE_X)); + if (!tcm->getImage(osg::TextureCubeMap::POSITIVE_Y)) tcm->setImage(osg::TextureCubeMap::POSITIVE_Y, mapgen->getImage(osg::TextureCubeMap::POSITIVE_Y)); + if (!tcm->getImage(osg::TextureCubeMap::NEGATIVE_Y)) tcm->setImage(osg::TextureCubeMap::NEGATIVE_Y, mapgen->getImage(osg::TextureCubeMap::NEGATIVE_Y)); + if (!tcm->getImage(osg::TextureCubeMap::POSITIVE_Z)) tcm->setImage(osg::TextureCubeMap::POSITIVE_Z, mapgen->getImage(osg::TextureCubeMap::POSITIVE_Z)); + if (!tcm->getImage(osg::TextureCubeMap::NEGATIVE_Z)) tcm->setImage(osg::TextureCubeMap::NEGATIVE_Z, mapgen->getImage(osg::TextureCubeMap::NEGATIVE_Z)); + } + + float LODBias; + if (arguments.read("--lod",LODBias)) + { + tcm->setLODBias(LODBias); + } + + osg::ref_ptr program = new osg::Program; + std::string shaderFilename; + while (arguments.read("-s", shaderFilename)) + { + osg::ref_ptr shader = osgDB::readRefShaderFile(shaderFilename); + if (shader) program->addShader(shader); + } + + + // load the nodes from the commandline arguments. + osg::ref_ptr rootnode = osgDB::readRefNodeFiles(arguments); + + // if not loaded assume no arguments passed in, try use default mode instead. + if (!rootnode) rootnode = osgDB::readRefNodeFile("cessna.osgt"); + + if (!rootnode) + { + osg::notify(osg::NOTICE)<<"Please specify a model filename on the command line."<getOrCreateStateSet(); // enable texturing, replacing any textures in the subgraphs ss->setTextureAttributeAndModes(0, tcm, osg::StateAttribute::OVERRIDE | osg::StateAttribute::ON); @@ -84,31 +152,13 @@ void create_specular_highlights(osg::Node *node) te->setSource1_RGB(osg::TexEnvCombine::PRIMARY_COLOR); te->setOperand1_RGB(osg::TexEnvCombine::SRC_COLOR); ss->setTextureAttributeAndModes(0, te, osg::StateAttribute::OVERRIDE | osg::StateAttribute::ON); -} - -int main(int argc, char *argv[]) -{ - // use an ArgumentParser object to manage the program arguments. - osg::ArgumentParser arguments(&argc,argv); - - // construct the viewer. - osgViewer::Viewer viewer; - - // load the nodes from the commandline arguments. - osg::ref_ptr rootnode = osgDB::readRefNodeFiles(arguments); - // if not loaded assume no arguments passed in, try use default mode instead. - if (!rootnode) rootnode = osgDB::readRefNodeFile("cessna.osgt"); - - if (!rootnode) + if (program->getNumShaders()>0) { - osg::notify(osg::NOTICE)<<"Please specify a model filename on the command line."<setAttribute(program.get()); + ss->addUniform(new osg::Uniform("baseTexture",0)); } - // create specular highlights - create_specular_highlights(rootnode.get()); - // run optimization over the scene graph osgUtil::Optimizer optimzer; optimzer.optimize(rootnode); diff --git a/examples/osgdepthpartition/osgdepthpartition.cpp b/examples/osgdepthpartition/osgdepthpartition.cpp index 1a7d5a6d1da..441ee4eaa7e 100644 --- a/examples/osgdepthpartition/osgdepthpartition.cpp +++ b/examples/osgdepthpartition/osgdepthpartition.cpp @@ -128,7 +128,7 @@ int main( int argc, char **argv ) osg::ArgumentParser arguments(&argc,argv); // construct the viewer. - osgViewer::Viewer viewer; + osgViewer::Viewer viewer(arguments); // add the state manipulator viewer.addEventHandler( new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()) ); diff --git a/examples/osgdepthpeeling/DePee.h b/examples/osgdepthpeeling/DePee.h index 1933ff94ae9..2d9ab1621f1 100644 --- a/examples/osgdepthpeeling/DePee.h +++ b/examples/osgdepthpeeling/DePee.h @@ -91,7 +91,7 @@ class DePee : public osg::Referenced bool createMap(MapMode mapMode, bool first=false); /*! - Creates a two dimensional noise map and initalizes _noiseMap with it + Creates a two dimensional noise map and initializes _noiseMap with it */ bool createNoiseMap(); diff --git a/examples/osgdepthpeeling/DePeePass.h b/examples/osgdepthpeeling/DePeePass.h index d80c3c16800..8a47522cabc 100644 --- a/examples/osgdepthpeeling/DePeePass.h +++ b/examples/osgdepthpeeling/DePeePass.h @@ -34,7 +34,7 @@ class DePeePass DePeePass(); /*! - Desctructor cleans the whole depth peeling pass + Destructor cleans the whole depth peeling pass */ ~DePeePass(); diff --git a/examples/osgdistortion/osgdistortion.cpp b/examples/osgdistortion/osgdistortion.cpp index 96376b4d782..18a813669b9 100644 --- a/examples/osgdistortion/osgdistortion.cpp +++ b/examples/osgdistortion/osgdistortion.cpp @@ -79,7 +79,11 @@ struct CommandLineOptions return; } - wsi->getScreenResolution(osg::GraphicsContext::ScreenIdentifier(0), width, height); + osg::GraphicsContext::ScreenIdentifier main_screen_id; + + main_screen_id.readDISPLAY(); + main_screen_id.setUndefinedScreenDetailsToDefaultScreen(); + wsi->getScreenResolution(main_screen_id, width, height); distance = sqrt(sphere_radius*sphere_radius - collar_radius*collar_radius); } @@ -274,6 +278,8 @@ void setDomeFaces(osgViewer::Viewer& viewer, CommandLineOptions& options) traits->windowDecoration = true; traits->doubleBuffer = true; traits->sharedContext = 0; + traits->readDISPLAY(); + traits->setUndefinedScreenDetailsToDefaultScreen(); osg::ref_ptr gc = osg::GraphicsContext::createGraphicsContext(traits.get()); if (!gc) @@ -502,6 +508,8 @@ void setDomeCorrection(osgViewer::Viewer& viewer, CommandLineOptions& options) traits->windowDecoration = false; traits->doubleBuffer = true; traits->sharedContext = 0; + traits->readDISPLAY(); + traits->setUndefinedScreenDetailsToDefaultScreen(); osg::ref_ptr gc = osg::GraphicsContext::createGraphicsContext(traits.get()); if (!gc) diff --git a/examples/osgdrawinstanced/osgdrawinstanced.cpp b/examples/osgdrawinstanced/osgdrawinstanced.cpp index 87d856e7d36..77a0f03cba2 100644 --- a/examples/osgdrawinstanced/osgdrawinstanced.cpp +++ b/examples/osgdrawinstanced/osgdrawinstanced.cpp @@ -59,6 +59,7 @@ createStateSet() // render each instance uniquely. gl_InstanceID will be in the range // 0 to numInstances-1 (1023 in our case). std::string vertexSource = + "#extension GL_EXT_gpu_shader4 : enable\n" "uniform sampler2D osgLogo; \n" "uniform float osg_SimulationTime; \n" diff --git a/examples/osgemscripten/CMakeLists.txt b/examples/osgemscripten/CMakeLists.txt index 65c9bc694f8..b2bc9875a5a 100644 --- a/examples/osgemscripten/CMakeLists.txt +++ b/examples/osgemscripten/CMakeLists.txt @@ -14,12 +14,12 @@ SET(DYNAMIC_OPENTHREADS OFF CACHE BOOL "Link OpenThreads statically") SET(DYNAMIC_OPENSCENEGRAPH OFF CACHE BOOL "Link OpenSceneGraph statically") # Prevent CMake configuration error. SET(_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS_EXITCODE "0" CACHE STRING "Prevent cfg error") -# Reference SDL2 during build process. -# We use SDL2 to do the following: -# * OpenGL functions' address retrieval -# * OpenGL graphics context creation -SET(USE_SDL2 "-s USE_SDL=2") -SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${USE_SDL2}" CACHE STRING "Use SDL2" FORCE) + +# Set special build flags: +# * -O3: make compact binary, critical for web +# * -s USE_SDL=2: provide SDL2 +SET(BUILD_FLAGS "-O3 -s USE_SDL=2") +ADD_DEFINITIONS(${BUILD_FLAGS}) # Reference OpenSceneGraph includes and libraries. SET(OSG_SOURCE_DIR "${OSG_DIR}") @@ -42,7 +42,7 @@ ADD_EXECUTABLE(osgemscripten osgemscripten.cpp) # Make Emscripten generate ready-to-open HTML page. SET(CMAKE_EXECUTABLE_SUFFIX ".html") # Make Emscripten preload the resource. -SET_TARGET_PROPERTIES(osgemscripten PROPERTIES LINK_FLAGS "--preload-file box.osgt") +SET_TARGET_PROPERTIES(osgemscripten PROPERTIES LINK_FLAGS "--preload-file box.osgt ${BUILD_FLAGS}") # Copy the resource to the build directory. CONFIGURE_FILE(box.osgt box.osgt COPYONLY) # Libraries must be linked in the specified order. diff --git a/examples/osgfont/osgfont.cpp b/examples/osgfont/osgfont.cpp index bad750798c5..f0f54e59b8f 100644 --- a/examples/osgfont/osgfont.cpp +++ b/examples/osgfont/osgfont.cpp @@ -12,11 +12,6 @@ void textInfo(osgText::Text* text) { - const osgText::Text::TextureGlyphQuadMap& tgqm = text->getTextureGlyphQuadMap(); - - const osgText::Text::TextureGlyphQuadMap::const_iterator tgqmi = tgqm.begin(); - - osgText::String& s = text->getText(); for(unsigned int i = 0; i < s.size(); i++) diff --git a/examples/osgforest/osgforest.cpp b/examples/osgforest/osgforest.cpp index 6c7ae9a281e..dcbe62f3b45 100644 --- a/examples/osgforest/osgforest.cpp +++ b/examples/osgforest/osgforest.cpp @@ -38,6 +38,7 @@ #include #include +#include #include #include @@ -64,6 +65,18 @@ class ForestTechniqueManager : public osg::Referenced ForestTechniqueManager() {} + enum Features + { + HUD_TEXT = 1, + BILLBOARD_GRAPH = 2, + X_GRAPH = 4, + TRANSFORM_GRAPH = 8, + SHADER_GRAPH = 16, + GEOMETRY_SHADER_GRAPH = 32, + TEXTURE_BUFFER_GRAPH = 64, + ALL_FEATURES = (TEXTURE_BUFFER_GRAPH<<1)-1 + }; + class Tree : public osg::Referenced { public: @@ -150,7 +163,7 @@ class ForestTechniqueManager : public osg::Referenced osg::Node* createHUDWithText(const std::string& text); - osg::Node* createScene(unsigned int numTreesToCreates, unsigned int maxNumTreesPerCell); + osg::Node* createScene(unsigned int numTreesToCreates, unsigned int maxNumTreesPerCell, unsigned int mask=ALL_FEATURES); void advanceToNextTechnique(int delta=1) { @@ -803,6 +816,18 @@ class ShaderGeometry : public osg::Drawable typedef std::vector PositionSizeList; + virtual void resizeGLObjectBuffers(unsigned int maxSize) + { + osg::Drawable::resizeGLObjectBuffers(maxSize); + if (_geometry) _geometry->resizeGLObjectBuffers(maxSize); + } + + virtual void releaseGLObjects(osg::State* state) const + { + osg::Drawable::releaseGLObjects(state); + if (_geometry) _geometry->releaseGLObjects(state); + } + virtual void drawImplementation(osg::RenderInfo& renderInfo) const { for(PositionSizeList::const_iterator itr = _trees.begin(); @@ -1160,7 +1185,7 @@ osg::Node* ForestTechniqueManager::createHUDWithText(const std::string& str) return projection; } -osg::Node* ForestTechniqueManager::createScene(unsigned int numTreesToCreates, unsigned int maxNumTreesPerCell) +osg::Node* ForestTechniqueManager::createScene(unsigned int numTreesToCreates, unsigned int maxNumTreesPerCell, unsigned int mask) { osg::Vec3 origin(0.0f,0.0f,0.0f); osg::Vec3 size(1000.0f,1000.0f,200.0f); @@ -1206,33 +1231,37 @@ osg::Node* ForestTechniqueManager::createScene(unsigned int numTreesToCreates, u _techniqueSwitch = new osg::Switch; + if ((mask & BILLBOARD_GRAPH)!=0) { std::cout<<"Creating osg::Billboard based forest..."; osg::Group* group = new osg::Group; group->addChild(createBillboardGraph(cell.get(),dstate)); - group->addChild(createHUDWithText("Using osg::Billboard's to create a forest\n\nPress left cursor key to select geometry instancing with Texture Buffer Object\nPress right cursor key to select double quad based forest")); + if ((mask & HUD_TEXT)!=0) group->addChild(createHUDWithText("Using osg::Billboard's to create a forest\n\nPress left cursor key to select geometry instancing with Texture Buffer Object\nPress right cursor key to select double quad based forest")); _techniqueSwitch->addChild(group); std::cout<<"done."<addChild(createXGraph(cell.get(),dstate)); - group->addChild(createHUDWithText("Using double quads to create a forest\n\nPress left cursor key to select osg::Billboard based forest\nPress right cursor key to select osg::MatrixTransform based forest\n")); + if ((mask & HUD_TEXT)!=0) group->addChild(createHUDWithText("Using double quads to create a forest\n\nPress left cursor key to select osg::Billboard based forest\nPress right cursor key to select osg::MatrixTransform based forest\n")); _techniqueSwitch->addChild(group); std::cout<<"done."<addChild(createTransformGraph(cell.get(),dstate)); - group->addChild(createHUDWithText("Using osg::MatrixTransform's to create a forest\n\nPress left cursor key to select double quad based forest\nPress right cursor key to select osg::Vertex/FragmentProgram based forest")); + if ((mask & HUD_TEXT)!=0) group->addChild(createHUDWithText("Using osg::MatrixTransform's to create a forest\n\nPress left cursor key to select double quad based forest\nPress right cursor key to select osg::Vertex/FragmentProgram based forest")); _techniqueSwitch->addChild(group); std::cout<<"done."<addChild(createShaderGraph(cell.get(),stateset)); - group->addChild(createHUDWithText("Using osg::Vertex/FragmentProgram to create a forest\n\nPress left cursor key to select osg::MatrixTransform's based forest\nPress right cursor key to select OpenGL shader based forest")); + if ((mask & HUD_TEXT)!=0) group->addChild(createHUDWithText("Using osg::Vertex/FragmentProgram to create a forest\n\nPress left cursor key to select osg::MatrixTransform's based forest\nPress right cursor key to select OpenGL shader based forest")); _techniqueSwitch->addChild(group); std::cout<<"done."<addChild(createShaderGraph(cell.get(),stateset)); - group->addChild(createHUDWithText("Using OpenGL Shader to create a forest\n\nPress left cursor key to select osg::Vertex/FragmentProgram based forest\nPress right cursor key to select osg::Vertex/Geometry/FragmentProgram based forest")); + if ((mask & HUD_TEXT)!=0) group->addChild(createHUDWithText("Using OpenGL Shader to create a forest\n\nPress left cursor key to select osg::Vertex/FragmentProgram based forest\nPress right cursor key to select osg::Vertex/Geometry/FragmentProgram based forest")); _techniqueSwitch->addChild(group); std::cout<<"done."<addChild(createGeometryShaderGraph(cell.get(), stateset)); - group->addChild(createHUDWithText("Using osg::Vertex/Geometry/FragmentProgram to create a forest\n\nPress left cursor key to select OpenGL Shader based forest\nPress right cursor key to select geometry instancing with Texture Buffer Object")); + if ((mask & HUD_TEXT)!=0) group->addChild(createHUDWithText("Using osg::Vertex/Geometry/FragmentProgram to create a forest\n\nPress left cursor key to select OpenGL Shader based forest\nPress right cursor key to select geometry instancing with Texture Buffer Object")); _techniqueSwitch->addChild(group); std::cout<<"done."<setStateSet( stateset ); osg::Group* group = new osg::Group; group->addChild(textureBufferGraph); - group->addChild(createHUDWithText("Using geometry instancing to create a forest\n\nPress left cursor key to select osg::Vertex/Geometry/FragmentProgram based forest\nPress right cursor key to select osg::Billboard based forest")); + if ((mask & HUD_TEXT)!=0) group->addChild(createHUDWithText("Using geometry instancing to create a forest\n\nPress left cursor key to select osg::Vertex/Geometry/FragmentProgram based forest\nPress right cursor key to select osg::Billboard based forest")); _techniqueSwitch->addChild(group); @@ -1466,6 +1498,16 @@ int main( int argc, char **argv ) arguments.read("--trees-per-cell",maxNumTreesPerCell); + + unsigned int features = ForestTechniqueManager::ALL_FEATURES; + while(arguments.read("--features", features)) + { + std::cout<<"features = "< ttm = new ForestTechniqueManager; // add the stats handler @@ -1475,8 +1517,13 @@ int main( int argc, char **argv ) viewer.addEventHandler(new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet())); // add model to viewer. - viewer.setSceneData( ttm->createScene(numTreesToCreate, maxNumTreesPerCell) ); + viewer.setSceneData( ttm->createScene(numTreesToCreate, maxNumTreesPerCell, features) ); + if (!outputFilename.empty()) + { + osgDB::writeNodeFile(*viewer.getSceneData(), outputFilename); + return 0; + } return viewer.run(); } diff --git a/examples/osgfpdepth/osgfpdepth.cpp b/examples/osgfpdepth/osgfpdepth.cpp index 49e6d349d2e..f8c057b45f0 100644 --- a/examples/osgfpdepth/osgfpdepth.cpp +++ b/examples/osgfpdepth/osgfpdepth.cpp @@ -138,9 +138,7 @@ void getPossibleConfigs(GraphicsContext* gc, BufferConfigList& colorConfigs, return; if (ext->isMultisampleSupported) glGetIntegerv(GL_MAX_SAMPLES_EXT, &maxSamples); - // isMultisampleCoverageSupported - if (isGLExtensionSupported(contextID, - "GL_NV_framebuffer_multisample_coverage")) + if (ext->isRenderbufferMultisampleCoverageSupported()) { glGetIntegerv(GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV, &coverageSampleConfigs); @@ -381,7 +379,7 @@ AppState::AppState(osgViewer::Viewer* viewer_) textProjection = new Projection; textProjection->setMatrix(Matrix::ortho2D(0,1280,0,1024)); textProjection->addChild(textGeode); - // "texture not available" text displayed when the user trys to + // "texture not available" text displayed when the user tries to // display the depth texture while multisampling. osgText::Text* noCanDo = new osgText::Text; noCanDo->setFont(fontName); @@ -722,6 +720,8 @@ GraphicsContext* setupGC(osgViewer::Viewer& viewer, ArgumentParser& arguments) traits->windowDecoration = decoration; traits->doubleBuffer = true; traits->sharedContext = 0; + traits->readDISPLAY(); + traits->setUndefinedScreenDetailsToDefaultScreen(); ref_ptr gc = GraphicsContext::createGraphicsContext(traits.get()); osgViewer::GraphicsWindow* gw = dynamic_cast(gc.get()); diff --git a/examples/osgframerenderer/osgframerenderer.cpp b/examples/osgframerenderer/osgframerenderer.cpp index 7c0eddaf936..c34563be301 100644 --- a/examples/osgframerenderer/osgframerenderer.cpp +++ b/examples/osgframerenderer/osgframerenderer.cpp @@ -74,10 +74,10 @@ int main( int argc, char **argv ) arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options]"); arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information"); arguments.getApplicationUsage()->addCommandLineOption("-i ","Input scene (or presentation) filename."); - arguments.getApplicationUsage()->addCommandLineOption("-o ","Base ouput filename of the images, recommended to use something like Images/image.png"); + arguments.getApplicationUsage()->addCommandLineOption("-o ","Base output filename of the images, recommended to use something like Images/image.png"); arguments.getApplicationUsage()->addCommandLineOption("--cs ","Load pre-generated configuration file for run."); arguments.getApplicationUsage()->addCommandLineOption("--ouput-cs ","Output configuration file with settings provided on commandline."); - arguments.getApplicationUsage()->addCommandLineOption("-p ","Use specificied camera path file to control camera position."); + arguments.getApplicationUsage()->addCommandLineOption("-p ","Use specified camera path file to control camera position."); arguments.getApplicationUsage()->addCommandLineOption("--offscreen","Use an pbuffer to render the images offscreen."); arguments.getApplicationUsage()->addCommandLineOption("--screen","Use an window to render the images."); arguments.getApplicationUsage()->addCommandLineOption("--width ","Window/output image width."); diff --git a/examples/osggameoflife/osggameoflife.cpp b/examples/osggameoflife/osggameoflife.cpp index a75ee2cfdeb..130a7110366 100644 --- a/examples/osggameoflife/osggameoflife.cpp +++ b/examples/osggameoflife/osggameoflife.cpp @@ -96,7 +96,7 @@ int main(int argc, char *argv[]) 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 ping pong rendering with FBOs and mutliple rendering branches. It uses Conway's Game of Life to illustrate the concept."); + arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is the example which demonstrates ping pong rendering with FBOs and multiple rendering branches. It uses Conway's Game of Life to illustrate the concept."); arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] --startim start_image"); arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information"); arguments.getApplicationUsage()->addCommandLineOption("--startim","The initial image to seed the game of life with."); diff --git a/examples/osggeometry/osggeometry.cpp b/examples/osggeometry/osggeometry.cpp index b3541ba18eb..6195417bebd 100644 --- a/examples/osggeometry/osggeometry.cpp +++ b/examples/osggeometry/osggeometry.cpp @@ -148,7 +148,7 @@ osg::Node* createScene() // create a Vec3Array and add to it all my coordinates. // Like all the *Array variants (see include/osg/Array) , Vec3Array is derived from both osg::Array - // and std::vector<>. osg::Array's are reference counted and hence sharable, + // and std::vector<>. osg::Array's are reference counted and hence shareable, // which std::vector<> provides all the convenience, flexibility and robustness // of the most popular of all STL containers. osg::Vec3Array* vertices = new osg::Vec3Array; diff --git a/examples/osggpucull/osggpucull.cpp b/examples/osggpucull/osggpucull.cpp index 9001c861650..8461b4bf03f 100644 --- a/examples/osggpucull/osggpucull.cpp +++ b/examples/osggpucull/osggpucull.cpp @@ -124,7 +124,7 @@ but if Robert will accept its current implementations ( I mean - primitive sets that have osg::TextureBuffer in constructor ), I may add it to osg/include/PrimitiveSet header. - - I used BufferTemplate class writen and published by Aurelien in submission forum + - I used BufferTemplate class written and published by Aurelien in submission forum some time ago. For some reason this class never got into osg/include, but is really needed during creation of UBOs, TBOs, and possibly SSBOs in the future. I added std::vector specialization to that template class. @@ -1145,7 +1145,7 @@ osg::Group* createAirplane( float detailRatio, const osg::Vec4& hullColor, const return root.release(); } -// createStaticRendering() shows how to use any OSG graph ( wheter it is single osg::Geode, or sophisticated osg::PagedLOD tree covering whole earth ) +// createStaticRendering() shows how to use any OSG graph ( whether it is single osg::Geode, or sophisticated osg::PagedLOD tree covering whole earth ) // as a source of instance data. This way, the OSG graph of arbitrary size is at first culled using typical OSG mechanisms, then remaining osg::Geometries // are sent to cull shader ( cullProgram ). Cull shader does not draw anything to screen ( thanks to GL_RASTERIZER_DISCARD mode ), but calculates if particular // instances - sourced from above mentioned osg::Geometries - are visible and what LODs for these instances should be rendered. diff --git a/examples/osghangglide/hat.cpp b/examples/osghangglide/hat.cpp index 3f4f49e3e33..1f6587bf97b 100644 --- a/examples/osghangglide/hat.cpp +++ b/examples/osghangglide/hat.cpp @@ -17,7 +17,7 @@ */ #ifdef _MSC_VER -#include +#include #pragma warning( disable : 4244 ) #endif diff --git a/examples/osghangglide/osghangglide.cpp b/examples/osghangglide/osghangglide.cpp index b6caee4d70f..d13a1405298 100644 --- a/examples/osghangglide/osghangglide.cpp +++ b/examples/osghangglide/osghangglide.cpp @@ -48,7 +48,7 @@ class MoveEarthySkyWithEyePointTransform : public osg::Transform { public: /** Get the transformation matrix which moves from local coords to world coords.*/ - virtual bool computeLocalToWorldMatrix(osg::Matrix& matrix,osg::NodeVisitor* nv) const + virtual bool computeLocalToWorldMatrix(osg::Matrix& matrix,osg::NodeVisitor* nv) const { osgUtil::CullVisitor* cv = dynamic_cast(nv); if (cv) @@ -63,7 +63,7 @@ class MoveEarthySkyWithEyePointTransform : public osg::Transform virtual bool computeWorldToLocalMatrix(osg::Matrix& matrix,osg::NodeVisitor* nv) const { std::cout<<"computing transform"<(nv); if (cv) { @@ -99,7 +99,7 @@ osg::Group* createModel() // add the sky and base layer. transform->addChild(makeSky()); // bin number -2 so drawn first. - transform->addChild(makeBase()); // bin number -1 so draw second. + transform->addChild(makeBase()); // bin number -1 so draw second. // add the transform to the earth sky. clearNode->addChild(transform); @@ -125,7 +125,7 @@ int main( int argc, char **argv ) 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 create a scene programatically, in this case a hang gliding flying site."); + arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is the example which demonstrates how to create a scene programmatically, in this case a hang gliding flying site."); arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ..."); arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information"); @@ -138,14 +138,14 @@ int main( int argc, char **argv ) arguments.getApplicationUsage()->write(std::cout); return 1; } - + bool customWindows = false; while(arguments.read("-2")) customWindows = true; if (customWindows) { osg::GraphicsContext::WindowingSystemInterface* wsi = osg::GraphicsContext::getWindowingSystemInterface(); - if (!wsi) + if (!wsi) { osg::notify(osg::NOTICE)<<"View::setUpViewAcrossAllScreens() : Error, no WindowSystemInterface available, cannot create windows."<windowDecoration = true; traits->doubleBuffer = true; traits->sharedContext = 0; + traits->readDISPLAY(); + traits->setUndefinedScreenDetailsToDefaultScreen(); osg::ref_ptr gc = osg::GraphicsContext::createGraphicsContext(traits.get()); if (gc.valid()) @@ -186,17 +188,17 @@ int main( int argc, char **argv ) viewer.addSlave(camera.get(), osg::Matrixd(), osg::Matrixd::scale(aspectRatioScale,1.0,1.0)); } - } + } else { viewer.setUpViewAcrossAllScreens(); - + } // set up the camera manipulation with our custom manipultor viewer.setCameraManipulator(new GliderManipulator()); - // pass the scene graph to the viewer + // pass the scene graph to the viewer viewer.setSceneData( createModel() ); return viewer.run(); diff --git a/examples/osghangglide/terrain_coords.h b/examples/osghangglide/terrain_coords.h index 04aad2fd29d..948c003d4fc 100644 --- a/examples/osghangglide/terrain_coords.h +++ b/examples/osghangglide/terrain_coords.h @@ -18,7 +18,7 @@ * THE SOFTWARE. */ -#if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__)) +#if defined(_WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__)) // disable the double to float errors. #pragma warning( disable : 4305 ) #endif diff --git a/examples/osghangglide/terrain_normals.h b/examples/osghangglide/terrain_normals.h index bfe1dc70586..081f5c96f1c 100644 --- a/examples/osghangglide/terrain_normals.h +++ b/examples/osghangglide/terrain_normals.h @@ -18,7 +18,7 @@ * THE SOFTWARE. */ -#if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__)) +#if defined(_WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__)) // disable the double to float errors. #pragma warning( disable : 4305 ) #endif diff --git a/examples/osghangglide/terrain_texcoords.h b/examples/osghangglide/terrain_texcoords.h index 33cd3514947..adc4c822f6a 100644 --- a/examples/osghangglide/terrain_texcoords.h +++ b/examples/osghangglide/terrain_texcoords.h @@ -18,7 +18,7 @@ * THE SOFTWARE. */ -#if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__)) +#if defined(_WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__)) // disable the double to float errors. #pragma warning( disable : 4305 ) #endif diff --git a/examples/osgkeyboard/osgkeyboard.cpp b/examples/osgkeyboard/osgkeyboard.cpp index e5c5b1dfa54..b709f1fa2c1 100644 --- a/examples/osgkeyboard/osgkeyboard.cpp +++ b/examples/osgkeyboard/osgkeyboard.cpp @@ -64,7 +64,7 @@ void KeyboardModel::keyChange(int key, int virtualKey, int value) { osg::notify(osg::INFO) << "key value change, code="<getSceneData()), "saved_model.osgt"); } + else if (ea.getKey()=='s') + { + SelectedNodesVisitor snv; + viewer->getSceneData()->accept(snv); + osg::ref_ptr selected = snv.createSelectedNodeSubgraph(); + + if (selected) + { + osg::notify(osg::NOTICE)<<"Saved selected to file 'saved_selected.osgt'"<getSceneData()), "saved_selected.osgt"); + } + } else if (ea.getKey()=='p') { _usePolytopeIntersector = !_usePolytopeIntersector; @@ -167,7 +196,7 @@ class PickHandler : public osgGA::GUIEventHandler { osg::notify(osg::NOTICE)<<"Using window coordinates for picking"<getSceneData()->accept(dsnv); dsnv.pruneSelectedNodes(); } @@ -401,7 +430,7 @@ class PickHandler : public osgGA::GUIEventHandler if (cmtsv._group->getNumChildren()>0) { - std::cout<<"Writing selected compoents to 'selected_model.osgt'"< traits = new osg::GraphicsContext::Traits; @@ -65,9 +65,11 @@ class ContextTest : public MemoryTest traits->height = _height; traits->windowDecoration = true; traits->pbuffer = _pbuffer; - + traits->readDISPLAY(); + traits->setUndefinedScreenDetailsToDefaultScreen(); + osg::ref_ptr window = osg::GraphicsContext::createGraphicsContext(traits.get()); - if (window.valid()) + if (window.valid()) { if (window->realize()) { @@ -82,15 +84,15 @@ class ContextTest : public MemoryTest else { std::cerr<<"Error: Unable to create graphics context, problem with running osgViewer-"<apply(*renderInfo.getState()); - + if (renderInfo.getState()->checkGLErrors(_attribute.get())) { throw "OpenGL error"; } } - + osg::ref_ptr _attribute; }; @@ -129,40 +131,40 @@ class TextureTest : public GLMemoryTest _width(width), _height(height), _depth(depth) {} - + virtual GLObject* allocate() { if (_depth>1) { osg::ref_ptr image = new osg::Image; image->allocateImage(_width, _height, _depth, GL_RGBA, GL_UNSIGNED_BYTE); - + osg::ref_ptr texture = new osg::Texture3D; texture->setImage(image.get()); texture->setResizeNonPowerOfTwoHint(false); - + return new StateAttributeObject(texture.get()); } if (_height>1) { osg::ref_ptr image = new osg::Image; image->allocateImage(_width, _height, 1, GL_RGBA, GL_UNSIGNED_BYTE); - + osg::ref_ptr texture = new osg::Texture2D; texture->setImage(image.get()); texture->setResizeNonPowerOfTwoHint(false); - + return new StateAttributeObject(texture.get()); } if (_width>1) { osg::ref_ptr image = new osg::Image; image->allocateImage(_width, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE); - + osg::ref_ptr texture = new osg::Texture1D; texture->setImage(image.get()); texture->setResizeNonPowerOfTwoHint(false); - + return new StateAttributeObject(texture.get()); } else @@ -170,10 +172,10 @@ class TextureTest : public GLMemoryTest throw "Invalid texture size of 0,0,0"; } } - + protected: - + int _width; int _height; int _depth; @@ -191,7 +193,7 @@ class FboTest : public GLMemoryTest _width(width), _height(height), _depth(depth) {} - + virtual GLObject* allocate() { osg::ref_ptr fbo = new osg::FrameBufferObject; @@ -201,10 +203,10 @@ class FboTest : public GLMemoryTest return new StateAttributeObject(fbo.get()); } - + protected: - + int _width; int _height; int _depth; @@ -218,19 +220,19 @@ class FboTest : public GLMemoryTest class DrawableObject : public GLObject { public: - + DrawableObject(osg::Drawable* drawable): _drawable(drawable) {} - + void apply(osg::RenderInfo& renderInfo) { _drawable->draw(renderInfo); - + if (renderInfo.getState()->checkGLErrors("Drawable")) { throw "OpenGL error"; } } - + osg::ref_ptr _drawable; }; @@ -240,20 +242,20 @@ class DrawableObject : public GLObject class GeometryTest : public GLMemoryTest { public: - + enum GLObjectType { VERTEX_ARRAY, DISPLAY_LIST, VERTEX_BUFFER_OBJECT }; - + GeometryTest(GLObjectType type, int width=64, int height=64): _glObjectType(type), _width(width), _height(height) {} - + virtual GLObject* allocate() { unsigned int numVertices = _width * _height; @@ -279,11 +281,11 @@ class GeometryTest : public GLMemoryTest quads->push_back(i + (j+1)*_width); } } - + osg::Geometry* geometry = new osg::Geometry; geometry->setVertexArray(vertices); geometry->addPrimitiveSet(quads); - + switch(_glObjectType) { case(VERTEX_ARRAY): @@ -302,10 +304,10 @@ class GeometryTest : public GLMemoryTest return new DrawableObject(geometry); } - + protected: - + GLObjectType _glObjectType; int _width; int _height; @@ -314,7 +316,7 @@ class GeometryTest : public GLMemoryTest int main( int argc, char **argv ) { osg::ArgumentParser arguments(&argc,argv); - + arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName()); arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" tests OpenGL and Windowing memory scalability.."); arguments.getApplicationUsage()->addCommandLineOption("-h or --help","List command line options."); @@ -326,7 +328,7 @@ int main( int argc, char **argv ) arguments.getApplicationUsage()->addCommandLineOption("--texture ","Allocate a 3D texture of specified dimensions."); arguments.getApplicationUsage()->addCommandLineOption("--texture ","Allocate a 2D texture of specified dimensions."); arguments.getApplicationUsage()->addCommandLineOption("--texture ","Allocate a 1D texture of specified dimensions."); - arguments.getApplicationUsage()->addCommandLineOption("--geometry ","Allocate a osg::Geometry representing a grid of specified size, using OpenGL Dislay Lists."); + arguments.getApplicationUsage()->addCommandLineOption("--geometry ","Allocate a osg::Geometry representing a grid of specified size, using OpenGL Display Lists."); arguments.getApplicationUsage()->addCommandLineOption("--geometry-va ","Allocate a osg::Geometry representing a grid of specified size, using Vertex Arrays."); arguments.getApplicationUsage()->addCommandLineOption("--geometry-vbo ","Allocate a osg::Geometry representing a grid of specified size, using Vertex Buffer Objects."); arguments.getApplicationUsage()->addCommandLineOption("--fbo ","Allocate a FrameBufferObject of specified dimensions."); @@ -351,7 +353,7 @@ int main( int argc, char **argv ) ContextTests contextTests; GLMemoryTests glMemoryTests; - + int width, height, depth; while(arguments.read("--pbuffer",width,height)) { contextTests.push_back(new ContextTest(width, height, true)); } while(arguments.read("--pbuffer")) { contextTests.push_back(new ContextTest(512, 512, true)); } @@ -396,20 +398,20 @@ int main( int argc, char **argv ) return 1; } #endif - + typedef std::list< osg::ref_ptr > Contexts; typedef std::list< osg::ref_ptr > GLObjects; Contexts allocatedContexts; GLObjects glObjects; - + if (contextTests.empty()) { if (glMemoryTests.empty()) { std::cout<<"No tests specified, please specify test using the command line options below."<write(std::cout,osg::ApplicationUsage::COMMAND_LINE_OPTION); - return 1; + return 1; } else { @@ -421,14 +423,14 @@ int main( int argc, char **argv ) // use printf's below as C++'s ostream classes use more memory and are more likely to fail when everything // goes wrong with memory allocations. - + int numContextIterations = 0; int numGLObjectIterations = 0; int numGLObjectsApplied = 0; try { for(; numGLObjectIterationsmakeCurrent(); - + osg::RenderInfo renderInfo; renderInfo.setState(context->getState()); - + for(GLObjects::iterator gitr = glObjects.begin(); gitr != glObjects.end(); ++gitr) @@ -466,9 +468,9 @@ int main( int argc, char **argv ) (*gitr)->apply(renderInfo); ++numGLObjectsApplied; } - + context->releaseContext(); - + printf("\n\n"); fflush(stdout); } } @@ -489,7 +491,7 @@ int main( int argc, char **argv ) printf("\nSuccessful completion, contexts created = %i, gl objects applied = %i\n",numContextIterations, numGLObjectsApplied); printf("Duration = %f seconds.\n\n",osg::Timer::instance()->delta_s(startTick, endTick)); - + return 0; } diff --git a/examples/osgmovie/osgmovie.cpp b/examples/osgmovie/osgmovie.cpp index 523822ee2aa..33775af9aa5 100644 --- a/examples/osgmovie/osgmovie.cpp +++ b/examples/osgmovie/osgmovie.cpp @@ -417,7 +417,7 @@ int main(int argc, char** argv) arguments.getApplicationUsage()->addCommandLineOption("--shader","Use shaders to post process the video."); arguments.getApplicationUsage()->addCommandLineOption("--interactive","Use camera manipulator to allow movement around movie."); arguments.getApplicationUsage()->addCommandLineOption("--flip","Flip the movie so top becomes bottom."); -#if defined(WIN32) || defined(__APPLE__) +#if defined(_WIN32) || defined(__APPLE__) arguments.getApplicationUsage()->addCommandLineOption("--devices","Print the Video input capability via QuickTime and exit."); #endif @@ -433,7 +433,7 @@ int main(int argc, char** argv) return 1; } -#if defined(WIN32) || defined(__APPLE__) +#if defined(_WIN32) || defined(__APPLE__) // if user requests devices video capability. if (arguments.read("-devices") || arguments.read("--devices")) { @@ -641,7 +641,11 @@ int main(int argc, char** argv) if (wsi) { unsigned int width, height; - wsi->getScreenResolution(osg::GraphicsContext::ScreenIdentifier(0), width, height); + osg::GraphicsContext::ScreenIdentifier main_screen_id; + + main_screen_id.readDISPLAY(); + main_screen_id.setUndefinedScreenDetailsToDefaultScreen(); + wsi->getScreenResolution(main_screen_id, width, height); screenAspectRatio = float(width) / float(height); } diff --git a/examples/osgmultiviewpaging/osgmultiviewpaging.cpp b/examples/osgmultiviewpaging/osgmultiviewpaging.cpp index 73b5c3997a1..e7b4f0e1aef 100644 --- a/examples/osgmultiviewpaging/osgmultiviewpaging.cpp +++ b/examples/osgmultiviewpaging/osgmultiviewpaging.cpp @@ -91,7 +91,11 @@ int main( int argc, char **argv ) } unsigned int width, height; - wsi->getScreenResolution(osg::GraphicsContext::ScreenIdentifier(0), width, height); + osg::GraphicsContext::ScreenIdentifier main_screen_id; + + main_screen_id.readDISPLAY(); + main_screen_id.setUndefinedScreenDetailsToDefaultScreen(); + wsi->getScreenResolution(main_screen_id, width, height); osg::ref_ptr traits = new osg::GraphicsContext::Traits; traits->x = 100; @@ -101,6 +105,8 @@ int main( int argc, char **argv ) traits->windowDecoration = true; traits->doubleBuffer = true; traits->sharedContext = 0; + traits->readDISPLAY(); + traits->setUndefinedScreenDetailsToDefaultScreen(); osg::ref_ptr gc = osg::GraphicsContext::createGraphicsContext(traits.get()); if (gc.valid()) diff --git a/examples/osgoccluder/osgoccluder.cpp b/examples/osgoccluder/osgoccluder.cpp index 12f917b490a..d959d8527db 100644 --- a/examples/osgoccluder/osgoccluder.cpp +++ b/examples/osgoccluder/osgoccluder.cpp @@ -290,7 +290,7 @@ int main( int argc, char **argv ) arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is the example which demonstrates use of convex planer occluders."); arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ..."); arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information"); - arguments.getApplicationUsage()->addCommandLineOption("-m","Mannually create occluders"); + arguments.getApplicationUsage()->addCommandLineOption("-m","Manually create occluders"); // initialize the viewer. osgViewer::Viewer viewer; diff --git a/examples/osgoscdevice/osgoscdevice.cpp b/examples/osgoscdevice/osgoscdevice.cpp index ea23a611b4c..c201c446243 100644 --- a/examples/osgoscdevice/osgoscdevice.cpp +++ b/examples/osgoscdevice/osgoscdevice.cpp @@ -109,8 +109,9 @@ bool PickHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapte user_event->setName("osc_test_1"); _device->sendEvent(*user_event); + return true; } - + return false; } default: @@ -443,6 +444,8 @@ int main( int argc, char **argv ) traits->doubleBuffer = true; traits->sharedContext = 0; traits->windowName = "Receiver / view two"; + traits->readDISPLAY(); + traits->setUndefinedScreenDetailsToDefaultScreen(); osg::ref_ptr gc = osg::GraphicsContext::createGraphicsContext(traits.get()); @@ -509,6 +512,8 @@ int main( int argc, char **argv ) traits->doubleBuffer = true; traits->sharedContext = 0; traits->windowName = "Sender / view one"; + traits->readDISPLAY(); + traits->setUndefinedScreenDetailsToDefaultScreen(); osg::ref_ptr gc = osg::GraphicsContext::createGraphicsContext(traits.get()); diff --git a/examples/osgparticle/osgparticle.cpp b/examples/osgparticle/osgparticle.cpp index c0d9c4a0605..6f71167ce92 100644 --- a/examples/osgparticle/osgparticle.cpp +++ b/examples/osgparticle/osgparticle.cpp @@ -444,7 +444,7 @@ void build_world(osg::Group *root) // the second one will be a little bit more complex, showing how to // create custom operators. // To avoid inserting too much code in a single function, we have - // splitted the work into two functions which accept a Group node as + // split the work into two functions which accept a Group node as // parameter, and return a pointer to the particle system they created. osgParticle::ParticleSystem *ps1 = create_simple_particle_system(root); diff --git a/examples/osgparticleeffects/osgparticleeffects.cpp b/examples/osgparticleeffects/osgparticleeffects.cpp index 289914328ae..0684259fd57 100644 --- a/examples/osgparticleeffects/osgparticleeffects.cpp +++ b/examples/osgparticleeffects/osgparticleeffects.cpp @@ -317,7 +317,7 @@ class PickHandler : public osgGA::GUIEventHandler { // insert particle effects alongside the hit node, therefore able to track that nodes movement, // however, this does require us to insert the ParticleSystem itself into the root of the scene graph // separately from the main particle effects group which contains the emitters and programs. - // the follow code block implements this, note the path for handling particle effects which arn't attached to + // the follow code block implements this, note the path for handling particle effects which aren't attached to // moving models is easy - just a single line of code! // tell the effects not to attach to the particle system locally for rendering, as we'll handle add it into the diff --git a/examples/osgparticleshader/osgparticleshader.cpp b/examples/osgparticleshader/osgparticleshader.cpp index d701c7c3b91..9c05e909122 100644 --- a/examples/osgparticleshader/osgparticleshader.cpp +++ b/examples/osgparticleshader/osgparticleshader.cpp @@ -155,7 +155,7 @@ int main( int argc, char** argv ) root->addChild( parent.get() ); root->addChild( updater.get() ); - // FIXME 2010.9.19: the updater can't be a drawable; otehrwise the ParticleEffect will not work properly. why? + // FIXME 2010.9.19: the updater can't be a drawable; otherwise the ParticleEffect will not work properly. why? updater->addParticleSystem( ps.get() ); osg::ref_ptr geode = new osg::Geode; @@ -175,7 +175,7 @@ int main( int argc, char** argv ) // A floating error of delta-time should be explained here: // The particles emitter, program and updater all use a 'dt' to compute the time value in every frame. // Because the 'dt' is a double value, it is not suitable to keep three copies of it separately, which - // is the previous implementation. The small error makes some opeartors unable to work correctly, e.g. + // is the previous implementation. The small error makes some operators unable to work correctly, e.g. // the BounceOperator. // Now we make use of the getDeltaTime() of ParticleSystem to maintain and dispatch the delta time. But.. // it is not the best solution so far, since there are still very few particles acting unexpectedly. diff --git a/examples/osgphotoalbum/osgphotoalbum.cpp b/examples/osgphotoalbum/osgphotoalbum.cpp index 300de7d4eef..545c7d1c31e 100644 --- a/examples/osgphotoalbum/osgphotoalbum.cpp +++ b/examples/osgphotoalbum/osgphotoalbum.cpp @@ -644,6 +644,7 @@ bool SlideEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIAction } _album->setVisibility(); + return true; } @@ -747,7 +748,7 @@ int main( int argc, char **argv ) osg::ref_ptr album = new Album(arguments,width,height); - // creat the scene from the file list. + // create the scene from the file list. osg::ref_ptr rootNode = album->getScene(); if (!rootNode) return 0; diff --git a/examples/osgpick/osgpick.cpp b/examples/osgpick/osgpick.cpp index 0f21490a656..3e6cafcabe7 100644 --- a/examples/osgpick/osgpick.cpp +++ b/examples/osgpick/osgpick.cpp @@ -16,9 +16,7 @@ * THE SOFTWARE. */ -/* osgpick sample -* demonstrate use of osgUtil/PickVisitor for picking in a HUD or -* in a 3d scene, +/* osgpick sample - Mouse picking in a 3d scene, */ #include diff --git a/examples/osgposter/osgposter.cpp b/examples/osgposter/osgposter.cpp index 6f5cb820ea8..6cdcbcf4509 100644 --- a/examples/osgposter/osgposter.cpp +++ b/examples/osgposter/osgposter.cpp @@ -76,7 +76,7 @@ void computeViewMatrixOnEarth( osg::Camera* camera, osg::Node* scene, osg::CoordinateSystemNode* csn = findTopMostNodeOfType(scene); if ( !csn ) return; - // Compute eye point in world coordiantes + // Compute eye point in world coordinates osg::Vec3d eye; csn->getEllipsoidModel()->convertLatLongHeightToXYZ( latLongHeight.x(), latLongHeight.y(), latLongHeight.z(), eye.x(), eye.y(), eye.z() ); diff --git a/examples/osgpresentation/osgpresentation.cpp b/examples/osgpresentation/osgpresentation.cpp index 24e5f601e62..93e9b5819c5 100644 --- a/examples/osgpresentation/osgpresentation.cpp +++ b/examples/osgpresentation/osgpresentation.cpp @@ -50,7 +50,7 @@ int main(int argc, char** argv) if (script.valid()) scripts.push_back(script.get()); } - // assgin script engine to scene graphs + // assign script engine to scene graphs model->getOrCreateUserDataContainer()->addUserObject(osgDB::readFile("ScriptEngine.lua")); model->getOrCreateUserDataContainer()->addUserObject(osgDB::readFile("ScriptEngine.python")); model->getOrCreateUserDataContainer()->addUserObject(osgDB::readFile("ScriptEngine.js")); diff --git a/examples/osgreflect/osgreflect.cpp b/examples/osgreflect/osgreflect.cpp index 6837a669176..ac37bf662fc 100644 --- a/examples/osgreflect/osgreflect.cpp +++ b/examples/osgreflect/osgreflect.cpp @@ -39,7 +39,7 @@ // // A simple demo demonstrating planar reflections using multiple renderings -// of a subgraph, overriding of state attribures and use of the stencil buffer. +// of a subgraph, overriding of state attributes and use of the stencil buffer. // // The multipass system implemented here is a variation of Mark Kilgard's // paper "Improving Shadows and Reflections via the Stencil Buffer" which diff --git a/examples/osgsampler/osgSampler.cpp b/examples/osgsampler/osgSampler.cpp index 4c09d13c160..d1a984ae2ad 100644 --- a/examples/osgsampler/osgSampler.cpp +++ b/examples/osgsampler/osgSampler.cpp @@ -120,7 +120,7 @@ int main(int argc, char* argv[]) sampler2=(osg::Sampler*)(*it)->getTextureAttribute(0, osg::StateAttribute::SAMPLER); } if(sampler1.valid()&&sampler2.valid()){ - OSG_WARN<<"2samplers manipulator setted"<dirty(); tex2->setImage(im); } - ///Overrided Filtering setup + ///Overridden Filtering setup tex1->setFilter(osg::Texture::MAG_FILTER,osg::Texture::NEAREST); tex1->setFilter(osg::Texture::MIN_FILTER,osg::Texture::NEAREST); diff --git a/examples/osgscreencapture/osgscreencapture.cpp b/examples/osgscreencapture/osgscreencapture.cpp index be49dcb4237..771c698aecb 100644 --- a/examples/osgscreencapture/osgscreencapture.cpp +++ b/examples/osgscreencapture/osgscreencapture.cpp @@ -99,19 +99,19 @@ class WindowCaptureCallback : public osg::Camera::DrawCallback switch(_mode) { case(READ_PIXELS): - osg::notify(osg::NOTICE)<<"Reading window usig glReadPixels, with out PixelBufferObject."<pbuffer = true; traits->doubleBuffer = true; traits->sharedContext = 0; + traits->readDISPLAY(); + traits->setUndefinedScreenDetailsToDefaultScreen(); pbuffer = osg::GraphicsContext::createGraphicsContext(traits.get()); if (pbuffer.valid()) diff --git a/examples/osgsequence/osgsequence.cpp b/examples/osgsequence/osgsequence.cpp index 91d2473b2b2..8f426069388 100644 --- a/examples/osgsequence/osgsequence.cpp +++ b/examples/osgsequence/osgsequence.cpp @@ -69,7 +69,7 @@ osg::Node* createTextGroup(const char** text) // loop through all children seq->setInterval(osg::Sequence::LOOP, 0,-1); - // real-time playback, repeat indefinitively + // real-time playback, repeat indefinitely seq->setDuration(1.0f, -1); // must be started explicitly @@ -157,7 +157,7 @@ osg::Sequence* createSequence(osg::ArgumentParser& arguments) // loop through all children seq->setInterval(osg::Sequence::LOOP, 0,-1); - // real-time playback, repeat indefinitively + // real-time playback, repeat indefinitely seq->setDuration(1.0f, -1); seq->setMode(osg::Sequence::START); @@ -244,7 +244,7 @@ int main( int argc, char **argv ) "- is subclassed from osg::Switch", "- assigns a display duration to each child", "- can loop or swing through an interval of it's children", - "- can repeat the interval a number of times or indefinitively", + "- can repeat the interval a number of times or indefinitely", "- press 's' to start/pause/resume", "- press 'l' to toggle loop/swing mode", NULL diff --git a/examples/osgshadercomposition/oldshadercomposition.cpp b/examples/osgshadercomposition/oldshadercomposition.cpp index 2c9e7cacf4f..b9b804008f8 100644 --- a/examples/osgshadercomposition/oldshadercomposition.cpp +++ b/examples/osgshadercomposition/oldshadercomposition.cpp @@ -99,7 +99,7 @@ osg::Node* createOldShaderCompositionScene(osg::ArgumentParser& arguments) group->addChild(pat); } - // resuse the first ShaderAttribute's type and ShaderComponent, just use new uniform + // reuse the first ShaderAttribute's type and ShaderComponent, just use new uniform { osg::PositionAttitudeTransform* pat = new osg::PositionAttitudeTransform; pat->setPosition(position); @@ -119,7 +119,7 @@ osg::Node* createOldShaderCompositionScene(osg::ArgumentParser& arguments) } - // resuse the first ShaderAttribute's type and ShaderComponent, just use new uniform + // reuse the first ShaderAttribute's type and ShaderComponent, just use new uniform { osg::PositionAttitudeTransform* pat = new osg::PositionAttitudeTransform; pat->setPosition(position); diff --git a/examples/osgshadergen/osgshadergen.cpp b/examples/osgshadergen/osgshadergen.cpp index a482836f178..2e027349b02 100644 --- a/examples/osgshadergen/osgshadergen.cpp +++ b/examples/osgshadergen/osgshadergen.cpp @@ -116,7 +116,7 @@ int main(int argc, char** argv) std::string shaderFilename; while(arguments.read("--shader", shaderFilename)) { - osg::ref_ptr shader = osgDB::readShaderFile(shaderFilename); + osg::ref_ptr shader = osgDB::readRefShaderFile(shaderFilename); if (shader.valid()) uberProgram->addShader(shader.get()); } diff --git a/examples/osgshaderterrain/osgshaderterrain.cpp b/examples/osgshaderterrain/osgshaderterrain.cpp index cb2f5459b84..ac7ea1dcf13 100644 --- a/examples/osgshaderterrain/osgshaderterrain.cpp +++ b/examples/osgshaderterrain/osgshaderterrain.cpp @@ -314,7 +314,7 @@ int main(int, char **) osg::ref_ptr testSupportOperation = new TestSupportOperation; #if 0 - // temporily commenting out as its causing the viewer to crash... no clue yet to why + // temporarily commenting out as its causing the viewer to crash... no clue yet to why viewer.setRealizeOperation(testSupportOperation.get()); #endif // create the windows and run the threads. diff --git a/examples/osgshadow/osgshadow.cpp b/examples/osgshadow/osgshadow.cpp index 6876e8a4190..0cacccfbdef 100644 --- a/examples/osgshadow/osgshadow.cpp +++ b/examples/osgshadow/osgshadow.cpp @@ -36,7 +36,6 @@ #include #include -#include #include #include #include @@ -707,7 +706,6 @@ int main(int argc, char** argv) arguments.getApplicationUsage()->addCommandLineOption("--receivesShadowMask", "Override default receivesShadowMask (default - 0x1)"); arguments.getApplicationUsage()->addCommandLineOption("--base", "Add a base geometry to test shadows."); - arguments.getApplicationUsage()->addCommandLineOption("--sv", "Select ShadowVolume implementation."); arguments.getApplicationUsage()->addCommandLineOption("--ssm", "Select SoftShadowMap implementation."); arguments.getApplicationUsage()->addCommandLineOption("--sm", "Select ShadowMap implementation."); @@ -873,15 +871,8 @@ int main(int argc, char** argv) } else if (arguments.read("--sv")) { - // hint to tell viewer to request stencil buffer when setting up windows - osg::DisplaySettings::instance()->setMinimumNumStencilBits(8); - - osg::ref_ptr sv = new osgShadow::ShadowVolume; - sv->setDynamicShadowVolumes(updateLightPosition); - while (arguments.read("--two-sided")) sv->setDrawMode(osgShadow::ShadowVolumeGeometry::STENCIL_TWO_SIDED); - while (arguments.read("--two-pass")) sv->setDrawMode(osgShadow::ShadowVolumeGeometry::STENCIL_TWO_PASS); - - shadowedScene->setShadowTechnique(sv.get()); + OSG_NOTICE<<"Warning: ShadowVolume no longer supported."<getScreenResolution(osg::GraphicsContext::ScreenIdentifier(0), width, height); + osg::GraphicsContext::ScreenIdentifier main_screen_id; + + main_screen_id.readDISPLAY(); + main_screen_id.setUndefinedScreenDetailsToDefaultScreen(); + wsi->getScreenResolution(main_screen_id, width, height); @@ -198,6 +202,8 @@ void singleWindowSideBySideCameras(osgViewer::Viewer& viewer) traits->windowDecoration = true; traits->doubleBuffer = true; traits->sharedContext = 0; + traits->readDISPLAY(); + traits->setUndefinedScreenDetailsToDefaultScreen(); osg::ref_ptr gc = osg::GraphicsContext::createGraphicsContext(traits.get()); if (gc.valid()) diff --git a/examples/osgsimplegl3/osgsimplegl3.cpp b/examples/osgsimplegl3/osgsimplegl3.cpp index 6a35b1fb669..d477784601c 100644 --- a/examples/osgsimplegl3/osgsimplegl3.cpp +++ b/examples/osgsimplegl3/osgsimplegl3.cpp @@ -87,6 +87,8 @@ int main( int argc, char** argv ) traits->windowDecoration = true; traits->doubleBuffer = true; traits->glContextVersion = version; + traits->readDISPLAY(); + traits->setUndefinedScreenDetailsToDefaultScreen(); osg::ref_ptr< osg::GraphicsContext > gc = osg::GraphicsContext::createGraphicsContext( traits.get() ); if( !gc.valid() ) { @@ -156,7 +158,7 @@ If you have an external project that will depend on OSG built for OpenGL 3.x, you'll need to ensure your external project also uses the compiler include directives to find . -To berify your application is using a pure OpenGL 3.x context, set +To verify your application is using a pure OpenGL 3.x context, set OSG_NOTIFY_LEVEL=INFO in the environment and check the console output. Context creation displays output such as the following: GL3: Attempting to create OpenGL3 context. diff --git a/examples/osgsimulation/osgsimulation.cpp b/examples/osgsimulation/osgsimulation.cpp index c5509b43a01..dd114e2fb50 100644 --- a/examples/osgsimulation/osgsimulation.cpp +++ b/examples/osgsimulation/osgsimulation.cpp @@ -16,7 +16,7 @@ * THE SOFTWARE. */ -#if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__)) +#if defined(_WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__)) ///////////////////////////////////////////////////////////////////////////// // Disable unavoidable warning messages: @@ -32,7 +32,7 @@ #pragma warning(disable : 4103 4114 4201 4237 4251 4275 4290 4503 4335 4786) -#endif // WIN32 +#endif // _WIN32 #include #include diff --git a/examples/osgslice/osgslice.cpp b/examples/osgslice/osgslice.cpp index e2905e35013..cde97d1c55e 100644 --- a/examples/osgslice/osgslice.cpp +++ b/examples/osgslice/osgslice.cpp @@ -26,11 +26,16 @@ #include #include +#include + #include #include #define MIN_NEARFAROFFSET 0.1 +// force the WIndowingSystem to initialize to allow us to create a graphics context. +USE_GRAPHICSWINDOW() + class SliceProcessor { public: @@ -137,6 +142,8 @@ int main( int argc, char **argv ) traits->doubleBuffer = true; traits->sharedContext = 0; traits->pbuffer = false; + traits->readDISPLAY(); + traits->setUndefinedScreenDetailsToDefaultScreen(); osg::ref_ptr gc = osg::GraphicsContext::createGraphicsContext(traits.get()); if (!gc || !gc->valid()) @@ -187,7 +194,7 @@ int main( int argc, char **argv ) // pass frame stamp to the SceneView so that the update, cull and draw traversals all use the same FrameStamp sceneView->setFrameStamp(frameStamp.get()); - // update the viewport dimensions, incase the window has been resized. + // update the viewport dimensions, in case the window has been resized. sceneView->setViewport(0,0,traits->width,traits->height); diff --git a/examples/osgspotlight/osgspotlight.cpp b/examples/osgspotlight/osgspotlight.cpp index 737f1cb5699..393696b52d7 100644 --- a/examples/osgspotlight/osgspotlight.cpp +++ b/examples/osgspotlight/osgspotlight.cpp @@ -56,7 +56,7 @@ osg::Image* createSpotLightImage(const osg::Vec4& centerColour, const osg::Vec4& float dy = (float(r) - mid)*div; float pr = powf(1.0f-sqrtf(dx*dx+dy*dy),power); if (pr<0.0f) pr=0.0f; - osg::Vec4 color = centerColour*r+backgroudColour*(1.0f-pr); + osg::Vec4 color = centerColour*pr+backgroudColour*(1.0f-pr); *ptr++ = (unsigned char)((color[0])*255.0f); *ptr++ = (unsigned char)((color[1])*255.0f); *ptr++ = (unsigned char)((color[2])*255.0f); diff --git a/examples/osgstereoimage/osgstereoimage.cpp b/examples/osgstereoimage/osgstereoimage.cpp index f23fedef5e8..9d666a68cc3 100644 --- a/examples/osgstereoimage/osgstereoimage.cpp +++ b/examples/osgstereoimage/osgstereoimage.cpp @@ -610,7 +610,7 @@ int main( int argc, char **argv ) osg::TexMat* texmatLeft = new osg::TexMat; osg::TexMat* texmatRight = new osg::TexMat; - // creat the scene from the file list. + // create the scene from the file list. osg::ref_ptr rootNode; if (!onDisk) rootNode = createScene(fileList,texmatLeft,texmatRight,radius,height,length); else rootNode=new osg::Switch(); diff --git a/examples/osgteapot/osgteapot.cpp b/examples/osgteapot/osgteapot.cpp index 0d657546040..88cce2a596d 100644 --- a/examples/osgteapot/osgteapot.cpp +++ b/examples/osgteapot/osgteapot.cpp @@ -235,7 +235,7 @@ class Teapot : public osg::Drawable // of OpenGL primitives. virtual void drawImplementation(osg::RenderInfo&) const { - // teapot(..) doens't use vertex arrays at all so we don't need to toggle their state + // teapot(..) doesn't use vertex arrays at all so we don't need to toggle their state // if we did we'd need to something like following call // state.disableAllVertexArrays(), see src/osg/Geometry.cpp for the low down. diff --git a/examples/osgterrain/osgterrain.cpp b/examples/osgterrain/osgterrain.cpp index ba6817688e7..11607f96c98 100644 --- a/examples/osgterrain/osgterrain.cpp +++ b/examples/osgterrain/osgterrain.cpp @@ -379,6 +379,11 @@ int main(int argc, char** argv) terrain->setVerticalScale(verticalScale); terrain->setBlendingPolicy(blendingPolicy); + if (arguments.read("--equalize-boundaries") || arguments.read("-e")) + { + terrain->setEqualizeBoundaries(true); + } + if (useDisplacementMappingTechnique) { diff --git a/examples/osgtessellate/osgtessellate.cpp b/examples/osgtessellate/osgtessellate.cpp index e2e6b2b3e9b..53dfed36083 100644 --- a/examples/osgtessellate/osgtessellate.cpp +++ b/examples/osgtessellate/osgtessellate.cpp @@ -470,7 +470,7 @@ osg::Geometry *makePols (void) { gtess->setStateSet( stateset ); int nstart=0; - // the contours accepoted are polygons; quads & tris. Trifans can bve added later. + // the contours accepted are polygons; quads & tris. Trifans can be added later. gtess->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::QUADS,nstart,12));nstart+=12; gtess->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::QUADS,nstart,12));nstart+=12; gtess->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::POLYGON,nstart,16));nstart+=16; diff --git a/examples/osgtessellationshaders/osgtessellationshaders.cpp b/examples/osgtessellationshaders/osgtessellationshaders.cpp index 766e7fd7edd..15e6bcad9c1 100644 --- a/examples/osgtessellationshaders/osgtessellationshaders.cpp +++ b/examples/osgtessellationshaders/osgtessellationshaders.cpp @@ -1,9 +1,9 @@ /* A demonstration of Tessellation Shaders in OpenScenegraph. * * Instructions: - * Press plus to increase tesselation and minus to decrease it. - * Press right arrow to increase inner tesselation and left arrow to decrease it. - * Press up arrow to increase outer tesselation and down arrow to decrease it. + * Press plus to increase tessellation and minus to decrease it. + * Press right arrow to increase inner tessellation and left arrow to decrease it. + * Press up arrow to increase outer tessellation and down arrow to decrease it. * * Original code by Philip Rideout * Adapted to OpenScenegraph by John Kaniarz diff --git a/examples/osgtext/osgtext.cpp b/examples/osgtext/osgtext.cpp index 4f7972fe33b..b9327912d32 100644 --- a/examples/osgtext/osgtext.cpp +++ b/examples/osgtext/osgtext.cpp @@ -440,7 +440,7 @@ osg::Group* create3DText(const osg::Vec3& center,float radius) text5->setFont("fonts/times.ttf"); //text5->setCharacterSize(characterSize); text5->setCharacterSize(32.0f); // medium - text5->setPosition(center - osg::Vec3(0.0, 0.0, 0.2)); + text5->setPosition(center - osg::Vec3(0.0, 0.0, 0.2) * radius); text5->setAxisAlignment(osgText::Text::SCREEN); text5->setCharacterSizeMode(osgText::Text::SCREEN_COORDS); text5->setDrawMode(osgText::Text::TEXT | osgText::Text::BOUNDINGBOX); @@ -451,7 +451,7 @@ osg::Group* create3DText(const osg::Vec3& center,float radius) text6->setColor(characterSizeModeColor); text6->setFont("fonts/times.ttf"); text6->setCharacterSize(characterSize); - text6->setPosition(center - osg::Vec3(0.0, 0.0, 0.4)); + text6->setPosition(center - osg::Vec3(0.0, 0.0, 0.4) * radius); text6->setAxisAlignment(osgText::Text::SCREEN); text6->setCharacterSizeMode(osgText::Text::OBJECT_COORDS_WITH_MAXIMUM_SCREEN_SIZE_CAPPED_BY_FONT_HEIGHT); text6->setText("CharacterSizeMode OBJECT_COORDS_WITH_MAXIMUM_SCREEN_SIZE_CAPPED_BY_FONT_HEIGHT"); @@ -461,7 +461,7 @@ osg::Group* create3DText(const osg::Vec3& center,float radius) text7->setColor(characterSizeModeColor); text7->setFont("fonts/times.ttf"); text7->setCharacterSize(characterSize); - text7->setPosition(center - osg::Vec3(0.0, 0.0, 0.6)); + text7->setPosition(center - osg::Vec3(0.0, 0.0, 0.6) * radius); text7->setAxisAlignment(osgText::Text::SCREEN); text7->setCharacterSizeMode(osgText::Text::OBJECT_COORDS); text7->setText("CharacterSizeMode OBJECT_COORDS (default)"); @@ -674,6 +674,30 @@ int main(int argc, char** argv) viewer.setSceneData(text.get()); } + else if (arguments.read("--alignment")) + { + osg::ref_ptr group = new osg::Group; + + { + osg::ref_ptr text = new osgText::Text; + text->setFont("fonts/times.ttf"); + text->setAxisAlignment(osgText::Text::XZ_PLANE); + text->setAlignment(osgText::Text::RIGHT_TOP); + text->setText("Alignment\nBefore:"); + group->addChild(text); + } + + { + osg::ref_ptr text = new osgText::Text; + text->setFont("fonts/times.ttf"); + text->setAxisAlignment(osgText::Text::XZ_PLANE); + text->setText("Alignment\nAfter:"); + text->setAlignment(osgText::Text::LEFT_TOP); + group->addChild(text); + } + + viewer.setSceneData(group.get()); + } else if (arguments.read("--mt", numThreads) || arguments.read("--mt")) { // construct a multi-threaded text updating test. @@ -730,7 +754,7 @@ int main(int argc, char** argv) { // prepare scene. osg::Vec3 center(0.0f,0.0f,0.0f); - float radius = 1.0f; + float radius = 100.0f; // make sure the root node is group so we can add extra nodes to it. osg::Group* group = new osg::Group; diff --git a/examples/osgtext3D/TextNode.h b/examples/osgtext3D/TextNode.h index 710cc9a18c6..bdc0a7955dc 100644 --- a/examples/osgtext3D/TextNode.h +++ b/examples/osgtext3D/TextNode.h @@ -61,7 +61,7 @@ class /*OSGTEXT_EXPORT*/ TextTechnique : public osg::Object /// default TextTechnique implementation used if no other is specified on TextNode static osg::ref_ptr& getDefaultTextTechinque(); - /// start building a new charater layout + /// start building a new character layout virtual void start(); /// called by Layout engine to place individual characters @@ -70,7 +70,7 @@ class /*OSGTEXT_EXPORT*/ TextTechnique : public osg::Object /// called by Layout engine to place individual characters virtual void addCharacter(const osg::Vec3& position, const osg::Vec3& size, Glyph3D* glyph, Style* style); - /// finish building new charater layout + /// finish building new character layout virtual void finish(); /// provide traversal control diff --git a/examples/osgtext3D/osgtext3D.cpp b/examples/osgtext3D/osgtext3D.cpp index 15bdbfdc24d..f71be4e308c 100644 --- a/examples/osgtext3D/osgtext3D.cpp +++ b/examples/osgtext3D/osgtext3D.cpp @@ -43,9 +43,15 @@ class Text3DAttributeHandler : public osgGA::GUIEventHandler { } - virtual bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter&) + virtual bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa) { - if (ea.getEventType() == osgGA::GUIEventAdapter::KEYUP) + if (ea.getEventType() == osgGA::GUIEventAdapter::PUSH) + { + osgViewer::View* view = dynamic_cast(&aa); + if (view) pick(view,ea); + return false; + } + else if (ea.getEventType() == osgGA::GUIEventAdapter::KEYUP) { if (ea.getKey() == osgGA::GUIEventAdapter::KEY_Up) { @@ -83,6 +89,24 @@ class Text3DAttributeHandler : public osgGA::GUIEventHandler return false; } + void pick(osgViewer::View* view, const osgGA::GUIEventAdapter& ea) + { + osgUtil::LineSegmentIntersector::Intersections intersections; + if (view->computeIntersections(ea, intersections)) + { + OSG_NOTICE<<"found intersections : "<localIntersectionPoint<setImage(originalImage->s()/2, originalImage->t()/2, originalImage->r(), // half the width and height originalImage->getInternalTextureFormat(), // same internal texture format - originalImage->getPixelFormat(),originalImage->getDataType(), // same pixel foramt and data type + originalImage->getPixelFormat(),originalImage->getDataType(), // same pixel format and data type originalImage->data(originalImage->s()/4,originalImage->t()/4), // offset the start point to 1/4 into the image osg::Image::NO_DELETE, // don't attempt to delete the image data, leave this to the originalImage originalImage->getPacking(), // use the same packing diff --git a/examples/osgtexturecompression/osgtexturecompression.cpp b/examples/osgtexturecompression/osgtexturecompression.cpp index be18a94699b..b830bec1b1e 100644 --- a/examples/osgtexturecompression/osgtexturecompression.cpp +++ b/examples/osgtexturecompression/osgtexturecompression.cpp @@ -124,7 +124,7 @@ int main(int argc, char** argv) if (arguments.argc()<=1) { - std::cout<<"Please supply an image filename on the commnand line."<getScreenResolution(osg::GraphicsContext::ScreenIdentifier(0), width, height); + osg::GraphicsContext::ScreenIdentifier main_screen_id; + + main_screen_id.readDISPLAY(); + main_screen_id.setUndefinedScreenDetailsToDefaultScreen(); + wsi->getScreenResolution(main_screen_id, width, height); osg::ref_ptr traits = new osg::GraphicsContext::Traits; traits->x = 0; @@ -155,6 +159,8 @@ int main(int argc, char** argv) traits->height = height; traits->windowDecoration = false; traits->doubleBuffer = true; + traits->readDISPLAY(); + traits->setUndefinedScreenDetailsToDefaultScreen(); osg::ref_ptr gc = osg::GraphicsContext::createGraphicsContext(traits.get()); if (!gc) diff --git a/examples/osgunittests/UnitTestFramework.cpp b/examples/osgunittests/UnitTestFramework.cpp index 13305fb0545..b9f88d8f98a 100644 --- a/examples/osgunittests/UnitTestFramework.cpp +++ b/examples/osgunittests/UnitTestFramework.cpp @@ -50,7 +50,7 @@ std::ostream& TestContext::tout(TraceLevel tl) const TestContext::TraceStream::TraceStream(std::ostream& o, TraceLevel tl): _traceLevel(tl), _outputStreamPtr(&o), -#if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__)) +#if defined(_WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__)) _nullStream("nul") #else _nullStream("/dev/null") diff --git a/examples/osgunittests/osgunittests.cpp b/examples/osgunittests/osgunittests.cpp index 6c4fb4fa009..57bbfe080d6 100644 --- a/examples/osgunittests/osgunittests.cpp +++ b/examples/osgunittests/osgunittests.cpp @@ -215,7 +215,7 @@ void testGetQuatFromMatrix(const osg::Vec3d& scale) double yaw2stop = 360.0; double yaw2step = 20.0; #else - // focussed range + // focused range double rol1start = 0.0; double rol1stop = 0.0; double rol1step = 0.1; diff --git a/examples/osgviewerGTK/osggtkdrawingarea.h b/examples/osgviewerGTK/osggtkdrawingarea.h index 9f916a2995f..53748e948f9 100644 --- a/examples/osgviewerGTK/osggtkdrawingarea.h +++ b/examples/osgviewerGTK/osggtkdrawingarea.h @@ -4,7 +4,7 @@ #include // This is an implementation of SimpleViewer that is designed to be subclassed -// and used as a GtkDrawingArea in a GTK application. Because of the implemention +// and used as a GtkDrawingArea in a GTK application. Because of the implementation // of GTK, I was unable to derive from GtkWidget and instead had to "wrap" it. // Conceptually, however, you can think of an OSGGTKDrawingArea as both an OSG // Viewer AND GtkDrawingArea. diff --git a/examples/osgviewerIPhone/CMakeLists.txt b/examples/osgviewerIPhone/CMakeLists.txt index b0a48f00de6..7312207a0f9 100644 --- a/examples/osgviewerIPhone/CMakeLists.txt +++ b/examples/osgviewerIPhone/CMakeLists.txt @@ -27,7 +27,7 @@ SET(TARGET_ADDED_LIBRARIES ${TARGET_ADDED_LIBRARIES} #backup setting SET(TMP_OSG_BUILD_APPLICATION_BUNDLES {$OSG_BUILD_APPLICATION_BUNDLES}) SET(OSG_BUILD_APPLICATION_BUNDLES TRUE) -SET(MACOSX_DEPLOYMENT_TARGET, ${IPHONE_VERSION_MIN}) +#SET(MACOSX_DEPLOYMENT_TARGET, ${IPHONE_VERSION_MIN}) SETUP_EXAMPLE(osgViewerIPhone) SET_TARGET_PROPERTIES(example_osgViewerIPhone PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer" XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET ${IPHONE_VERSION_MIN} @@ -35,4 +35,4 @@ SET_TARGET_PROPERTIES(example_osgViewerIPhone PROPERTIES XCODE_ATTRIBUTE_CODE_SI #restore setting SET(OSG_BUILD_APPLICATION_BUNDLES {$TMP_OSG_BUILD_APPLICATION_BUNDLES}) -SET(CMAKE_EXE_LINKER_FLAGS "-framework QuartzCore -framework Foundation -framework OpenGLES -framework UIKit -framework ImageIO -framework CoreImage -framework MobileCoreServices -framework CoreGraphics") +SET(CMAKE_EXE_LINKER_FLAGS "-framework QuartzCore -framework Foundation -framework UIKit -framework ImageIO -framework CoreImage -framework MobileCoreServices -framework CoreGraphics") diff --git a/examples/osgviewerMFC/MFC_OSG.cpp b/examples/osgviewerMFC/MFC_OSG.cpp index d27acdf65ee..7573d74f40f 100644 --- a/examples/osgviewerMFC/MFC_OSG.cpp +++ b/examples/osgviewerMFC/MFC_OSG.cpp @@ -104,7 +104,7 @@ void cOSG::InitCameraConfig(void) camera->setGraphicsContext(gc); // Set the viewport for the Camera - camera->setViewport(new osg::Viewport(traits->x, traits->y, traits->width, traits->height)); + camera->setViewport(new osg::Viewport(0, 0, traits->width, traits->height)); // set the draw and read buffers up for a double buffered window with rendering going to back buffer camera->setDrawBuffer(GL_BACK); diff --git a/examples/osgviewerWX/osgviewerWX.cpp b/examples/osgviewerWX/osgviewerWX.cpp index 9b7ace40e34..d5a6aac0277 100644 --- a/examples/osgviewerWX/osgviewerWX.cpp +++ b/examples/osgviewerWX/osgviewerWX.cpp @@ -10,7 +10,7 @@ #endif // For wxCURSOR_BLANK below, but isn't used a.t.m. -//#ifdef WIN32 +//#ifdef _WIN32 //#include "wx/msw/wx.rc" //#endif @@ -140,7 +140,8 @@ END_EVENT_TABLE() OSGCanvas::OSGCanvas(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name, int *attributes) - : wxGLCanvas(parent, id, pos, size, style|wxFULL_REPAINT_ON_RESIZE, name, attributes) + : wxGLCanvas(parent, id, attributes, pos, size, style|wxFULL_REPAINT_ON_RESIZE, name) + ,_context(this) { // default cursor to standard _oldCursor = *wxSTANDARD_CURSOR; @@ -150,6 +151,11 @@ OSGCanvas::~OSGCanvas() { } +void OSGCanvas::SetContextCurrent() +{ + _context.SetCurrent(*this); +} + void OSGCanvas::OnPaint( wxPaintEvent& WXUNUSED(event) ) { /* must always be here */ @@ -158,8 +164,6 @@ void OSGCanvas::OnPaint( wxPaintEvent& WXUNUSED(event) ) void OSGCanvas::OnSize(wxSizeEvent& event) { - // this is also necessary to update the context on some platforms - wxGLCanvas::OnSize(event); // set GL viewport (not called by wxGLCanvas::OnSize on all platforms...) int width, height; @@ -337,7 +341,7 @@ void GraphicsWindowWX::useCursor(bool cursorOn) bool GraphicsWindowWX::makeCurrentImplementation() { - _canvas->SetCurrent(); + _canvas->SetContextCurrent(); return true; } diff --git a/examples/osgviewerWX/osgviewerWX.h b/examples/osgviewerWX/osgviewerWX.h index db41d24a2c4..9e0edbda8ad 100644 --- a/examples/osgviewerWX/osgviewerWX.h +++ b/examples/osgviewerWX/osgviewerWX.h @@ -38,12 +38,14 @@ class OSGCanvas : public wxGLCanvas void UseCursor(bool value); + void SetContextCurrent(); private: DECLARE_EVENT_TABLE() osg::ref_ptr _graphics_window; wxCursor _oldCursor; + wxGLContext _context; }; class GraphicsWindowWX : public osgViewer::GraphicsWindow diff --git a/examples/osgvirtualprogram/CreateAdvancedHierachy.cpp b/examples/osgvirtualprogram/CreateAdvancedHierachy.cpp index 3efe3cdc128..1c9f8a964ec 100644 --- a/examples/osgvirtualprogram/CreateAdvancedHierachy.cpp +++ b/examples/osgvirtualprogram/CreateAdvancedHierachy.cpp @@ -211,7 +211,7 @@ osg::Node * CreateAdvancedHierarchy( osg::Node * model ) // Set default VirtualProgram in root StateSet // With main vertex and main fragment shaders calling - // lighting and texture functions defined in aditional shaders + // lighting and texture functions defined in additional shaders // Lighting is done per vertex using simple directional light // Texture uses stage 0 TexCoords and TexMap diff --git a/examples/osgvnc/osgvnc.cpp b/examples/osgvnc/osgvnc.cpp index 52d42417829..83ad9ae297e 100644 --- a/examples/osgvnc/osgvnc.cpp +++ b/examples/osgvnc/osgvnc.cpp @@ -25,6 +25,7 @@ class EscapeHandler : public osgGA::GUIEventHandler return true; } + break; } default: @@ -95,7 +96,7 @@ int main(int argc,char** argv) // add a custom escape handler, but disable the standard viewer one to enable the vnc images to handle // the escape without it getting caught by the viewer. - viewer.addEventHandler(new EscapeHandler); + viewer.addEventHandler(new EscapeHandler); viewer.setKeyEventSetsDone(0); return viewer.run(); diff --git a/examples/osgwindows/osgwindows.cpp b/examples/osgwindows/osgwindows.cpp index e9bf726eed9..1ca9a2c805a 100644 --- a/examples/osgwindows/osgwindows.cpp +++ b/examples/osgwindows/osgwindows.cpp @@ -58,6 +58,8 @@ int main( int argc, char **argv ) traits->windowDecoration = true; traits->doubleBuffer = true; traits->sharedContext = 0; + traits->readDISPLAY(); + traits->setUndefinedScreenDetailsToDefaultScreen(); osg::ref_ptr gc = osg::GraphicsContext::createGraphicsContext(traits.get()); @@ -82,6 +84,8 @@ int main( int argc, char **argv ) traits->windowDecoration = true; traits->doubleBuffer = true; traits->sharedContext = 0; + traits->readDISPLAY(); + traits->setUndefinedScreenDetailsToDefaultScreen(); osg::ref_ptr gc = osg::GraphicsContext::createGraphicsContext(traits.get()); diff --git a/include/OpenThreads/Affinity b/include/OpenThreads/Affinity index 27fc2a546e1..0f9626195d4 100644 --- a/include/OpenThreads/Affinity +++ b/include/OpenThreads/Affinity @@ -45,10 +45,10 @@ public: Affinity& operator = (const Affinity& rhs) { if (&rhs!=this) { activeCPUs = rhs.activeCPUs; } return *this; } - /** add a specfied cpu core from the list to have affinity to. */ + /** add a specified cpu core from the list to have affinity to. */ void add(unsigned int cpuNmber) { activeCPUs.insert(cpuNmber); } - /** remove a specfied cpu core from the list to have affinity to. */ + /** remove a specified cpu core from the list to have affinity to. */ void remove(unsigned int cpuNmber) { activeCPUs.erase(cpuNmber); } /** return true if affinity has been provided for specific CPU cores.*/ diff --git a/include/OpenThreads/Exports b/include/OpenThreads/Exports index bf262099355..8755ce51a76 100644 --- a/include/OpenThreads/Exports +++ b/include/OpenThreads/Exports @@ -16,7 +16,7 @@ #include -#ifndef WIN32 +#ifndef _WIN32 #define OPENTHREAD_EXPORT_DIRECTIVE #else #if defined( OT_LIBRARY_STATIC ) diff --git a/include/OpenThreads/Thread b/include/OpenThreads/Thread index 90a424dadb1..1a2ac52d3b4 100644 --- a/include/OpenThreads/Thread +++ b/include/OpenThreads/Thread @@ -109,10 +109,15 @@ public: /** - * Return a pointer to the current running thread + * Return a pointer to the current running thread, returns NULL for a non OpenThreads thread. */ static Thread *CurrentThread(); + /** + * Return the id of the current thread + */ + static size_t CurrentThreadId(); + /** * Initialize Threading in a program. This method must be called before @@ -147,7 +152,7 @@ public: * * @return a unique thread identifier */ - int getThreadId(); + size_t getThreadId(); /** * Get the thread's process id. This is the pthread_t or pid_t value @@ -190,7 +195,7 @@ public: /** * Set the thread's schedule priority. This is a complex method. * Beware of thread priorities when using a many-to-many kernel - * entity implemenation (such as IRIX pthreads). If one is not careful + * entity implementation (such as IRIX pthreads). If one is not careful * to manage the thread priorities, a priority inversion deadlock can * easily occur (Although the OpenThreads::Mutex & OpenThreads::Barrier * constructs have been designed with this scenario in mind). Unless diff --git a/include/osg/AutoTransform b/include/osg/AutoTransform index 7867b0ff970..0e569111058 100644 --- a/include/osg/AutoTransform +++ b/include/osg/AutoTransform @@ -89,8 +89,7 @@ class OSG_EXPORT AutoTransform : public Transform /** Get the front face direction normal. */ inline const Vec3& getNormal() const { return _normal; } - void setAutoScaleToScreen(bool autoScaleToScreen) { _autoScaleToScreen = autoScaleToScreen; } - + void setAutoScaleToScreen(bool autoScaleToScreen); bool getAutoScaleToScreen() const { return _autoScaleToScreen; } void setAutoScaleTransitionWidthRatio(float ratio) { _autoScaleTransitionWidthRatio = ratio; } @@ -101,9 +100,6 @@ class OSG_EXPORT AutoTransform : public Transform virtual bool computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor* nv) const; - virtual BoundingSphere computeBound() const; - - protected : virtual ~AutoTransform() {} @@ -125,9 +121,6 @@ class OSG_EXPORT AutoTransform : public Transform osg::Matrixd computeMatrix(const osg::NodeVisitor* nv) const; - mutable bool _matrixInitalized; - mutable osg::Matrixd _cachedMatrix; - enum AxisAligned { AXIAL_ROT_X_AXIS=ROTATE_TO_AXIS+1, diff --git a/include/osg/BoundingSphere b/include/osg/BoundingSphere index 4502e459594..d3903b38074 100644 --- a/include/osg/BoundingSphere +++ b/include/osg/BoundingSphere @@ -63,6 +63,13 @@ class BoundingSphereImpl * otherwise. */ inline bool valid() const { return _radius>=0.0; } + inline BoundingSphereImpl& operator = (const BoundingSphereImpl& rhs) + { + _center = rhs._center; + _radius = rhs._radius; + return *this; + } + inline bool operator == (const BoundingSphereImpl& rhs) const { return _center==rhs._center && _radius==rhs._radius; } inline bool operator != (const BoundingSphereImpl& rhs) const { return _center!=rhs._center || _radius!=rhs._radius; } diff --git a/include/osg/BufferObject b/include/osg/BufferObject index 37ae19a5513..3ec365544fb 100644 --- a/include/osg/BufferObject +++ b/include/osg/BufferObject @@ -152,6 +152,14 @@ class BufferObjectProfile class GLBufferObjectSet; class GLBufferObjectManager; +inline unsigned int computeBufferAlignment(unsigned int pos, unsigned int bufferAlignment) +{ + if (bufferAlignment<2) return pos; + if ((pos%bufferAlignment)==0) return pos; + return ((pos/bufferAlignment)+1)*bufferAlignment; +} + + class OSG_EXPORT GLBufferObject : public GraphicsObject { public: @@ -235,9 +243,7 @@ class OSG_EXPORT GLBufferObject : public GraphicsObject unsigned int computeBufferAlignment(unsigned int pos, unsigned int bufferAlignment) const { - if (bufferAlignment<2) return pos; - if ((pos%bufferAlignment)==0) return pos; - return ((pos/bufferAlignment)+1)*bufferAlignment; + return osg::computeBufferAlignment(pos, bufferAlignment); } unsigned int _contextID; @@ -431,10 +437,10 @@ class OSG_EXPORT BufferObject : public Object const BufferObjectProfile& getProfile() const { return _profile; } - /** Set whether the BufferObject should use a GLBufferObject just for copying the BufferData and release it immmediately so that it may be reused.*/ + /** Set whether the BufferObject should use a GLBufferObject just for copying the BufferData and release it immediately so that it may be reused.*/ void setCopyDataAndReleaseGLBufferObject(bool copyAndRelease) { _copyDataAndReleaseGLBufferObject = copyAndRelease; } - /** Get whether the BufferObject should use a GLBufferObject just for copying the BufferData and release it immmediately.*/ + /** Get whether the BufferObject should use a GLBufferObject just for copying the BufferData and release it immediately.*/ bool getCopyDataAndReleaseGLBufferObject() const { return _copyDataAndReleaseGLBufferObject; } diff --git a/include/osg/Callback b/include/osg/Callback index 1387fce4bb4..02a5171689e 100644 --- a/include/osg/Callback +++ b/include/osg/Callback @@ -121,6 +121,32 @@ class OSG_EXPORT Callback : public virtual Object { } } + /** Convenience method to find a nested callback by type. */ + template + static T* findNestedCallback(osg::Callback* callback) + { + if (!callback) + return NULL; + + if (T* cb = dynamic_cast(callback)) + return cb; + + return findNestedCallback(callback->getNestedCallback()); + } + + /** Convenience method to find a nested callback by type. */ + template + static const T* findNestedCallback(const osg::Callback* callback) + { + if (!callback) + return NULL; + + if (const T* cb = dynamic_cast(callback)) + return cb; + + return findNestedCallback(callback->getNestedCallback()); + } + protected: virtual ~Callback() {} @@ -158,7 +184,7 @@ public: }; -/** Convenience function for getting the CallbackObject associated with specificed name from an Object's UserDataContainer.*/ +/** Convenience function for getting the CallbackObject associated with specified name from an Object's UserDataContainer.*/ inline CallbackObject* getCallbackObject(osg::Object* object, const std::string& name) { osg::UserDataContainer* udc = object->getUserDataContainer(); @@ -171,7 +197,7 @@ inline CallbackObject* getCallbackObject(osg::Object* object, const std::string& } -/** Convenience function for getting the CallbackObject associated with specificed name from an Object's UserDataContainer.*/ +/** Convenience function for getting the CallbackObject associated with specified name from an Object's UserDataContainer.*/ inline const CallbackObject* getCallbackObject(const osg::Object* object, const std::string& name) { const osg::UserDataContainer* udc = object->getUserDataContainer(); diff --git a/include/osg/Camera b/include/osg/Camera index fc9671d844c..b1cfc95dcce 100644 --- a/include/osg/Camera +++ b/include/osg/Camera @@ -599,12 +599,12 @@ class OSG_EXPORT Camera : public Transform, public CullSettings Callback(org, copyop) {} META_Object(osg, DrawCallback); - + /** Functor method called by rendering thread to recursively launch operator() on _nestedcallback **/ inline void run(osg::RenderInfo& renderInfo) const { operator () (renderInfo); - + if (_nestedCallback.valid()) ((const DrawCallback*)_nestedCallback.get())->run(renderInfo); } @@ -614,6 +614,23 @@ class OSG_EXPORT Camera : public Transform, public CullSettings /** Functor method, provided for backwards compatibility, called by operator() (osg::RenderInfo& renderInfo) method.**/ virtual void operator () (const osg::Camera& /*camera*/) const {} + + /** Resize any per context GLObject buffers to specified size. */ + virtual void resizeGLObjectBuffers(unsigned int maxSize) + { + if (_nestedCallback.valid()) + _nestedCallback->resizeGLObjectBuffers(maxSize); + } + + /** If State is non-zero, this function releases any associated OpenGL objects for + * the specified graphics context. Otherwise, releases OpenGL objexts + * for all graphics contexts. */ + virtual void releaseGLObjects(osg::State* state = 0) const + { + if (_nestedCallback.valid()) + _nestedCallback->releaseGLObjects(state); + } + }; /** Set the initial draw callback for custom operations to be done before the drawing of the camera's subgraph and pre render stages.*/ diff --git a/include/osg/ComputeDispatch b/include/osg/ComputeDispatch deleted file mode 100644 index 5e0ac6ffe54..00000000000 --- a/include/osg/ComputeDispatch +++ /dev/null @@ -1,55 +0,0 @@ -/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2014 Robert Osfield - * Copyright (C) 2017 Julien Valentin - * - * This library is open source and may be redistributed and/or modified under - * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or - * (at your option) any later version. The full license is in LICENSE file - * included with this distribution, and on the openscenegraph.org website. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * OpenSceneGraph Public License for more details. -*/ - -#ifndef OSG_COMPUTEDISPATCH -#define OSG_COMPUTEDISPATCH 1 - -#include - -#include - -namespace osg{ - class OSG_EXPORT ComputeDispatch : public osg::Drawable - { - public: - ComputeDispatch(GLint numGroupsX=0, GLint numGroupsY=0, GLint numGroupsZ=0): - Drawable(), - _numGroupsX(numGroupsX), - _numGroupsY(numGroupsY), - _numGroupsZ(numGroupsZ) - {} - - ComputeDispatch(const ComputeDispatch&,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY); - - META_Node(osg, ComputeDispatch); - - virtual void compileGLObjects(RenderInfo&) const {} - - virtual VertexArrayState* createVertexArrayStateImplememtation(RenderInfo&) const { return 0; } - - virtual void drawImplementation(RenderInfo& renderInfo) const; - - /** Set compute shader work groups */ - void setComputeGroups( GLint numGroupsX, GLint numGroupsY, GLint numGroupsZ ) { _numGroupsX=numGroupsX; _numGroupsY=numGroupsY; _numGroupsZ=numGroupsZ; } - - /** Get compute shader work groups */ - void getComputeGroups( GLint& numGroupsX, GLint& numGroupsY, GLint& numGroupsZ ) const{ numGroupsX=_numGroupsX; numGroupsY=_numGroupsY; numGroupsZ=_numGroupsZ; } - - protected: - GLint _numGroupsX, _numGroupsY, _numGroupsZ; - - }; -} -#endif - diff --git a/include/osg/CoordinateSystemNode b/include/osg/CoordinateSystemNode index 38d7df9b7ae..61ca2d8f69f 100644 --- a/include/osg/CoordinateSystemNode +++ b/include/osg/CoordinateSystemNode @@ -168,6 +168,38 @@ inline void EllipsoidModel::convertLatLongHeightToXYZ(double latitude, double lo inline void EllipsoidModel::convertXYZToLatLongHeight(double X, double Y, double Z, double& latitude, double& longitude, double& height) const { + // handle polar and center-of-earth cases directly. + if (X != 0.0) + longitude = atan2(Y,X); + else + { + if (Y > 0.0) + longitude = PI_2; + else if (Y < 0.0) + longitude = -PI_2; + else + { + // at pole or at center of the earth + longitude = 0.0; + if (Z > 0.0) + { // north pole. + latitude = PI_2; + height = Z - _radiusPolar; + } + else if (Z < 0.0) + { // south pole. + latitude = -PI_2; + height = -Z - _radiusPolar; + } + else + { // center of earth. + latitude = PI_2; + height = -_radiusPolar; + } + return; + } + } + // http://www.colorado.edu/geography/gcraft/notes/datum/gif/xyzllh.gif double p = sqrt(X*X + Y*Y); double theta = atan2(Z*_radiusEquator , (p*_radiusPolar)); @@ -179,7 +211,6 @@ inline void EllipsoidModel::convertXYZToLatLongHeight(double X, double Y, double latitude = atan( (Z + eDashSquared*_radiusPolar*sin_theta*sin_theta*sin_theta) / (p - _eccentricitySquared*_radiusEquator*cos_theta*cos_theta*cos_theta) ); - longitude = atan2(Y,X); double sin_latitude = sin(latitude); double N = _radiusEquator / sqrt( 1.0 - _eccentricitySquared*sin_latitude*sin_latitude); diff --git a/include/osg/CullSettings b/include/osg/CullSettings index c1a8877ce23..c61fe913825 100644 --- a/include/osg/CullSettings +++ b/include/osg/CullSettings @@ -270,6 +270,88 @@ class OSG_EXPORT CullSettings }; +template +bool clampProjectionMatrix(matrix_type& projection, double& znear, double& zfar, value_type nearFarRatio) +{ + double epsilon = 1e-6; + if (zfar + +#include + +namespace osg +{ + +/** Wrapper around glDispatchCompute.*/ +class OSG_EXPORT DispatchCompute : public osg::Drawable +{ + public: + DispatchCompute(GLint numGroupsX=0, GLint numGroupsY=0, GLint numGroupsZ=0): + Drawable(), + _numGroupsX(numGroupsX), + _numGroupsY(numGroupsY), + _numGroupsZ(numGroupsZ) + {} + + DispatchCompute(const DispatchCompute&,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY); + + META_Node(osg, DispatchCompute); + + virtual void compileGLObjects(RenderInfo&) const {} + + virtual VertexArrayState* createVertexArrayStateImplememtation(RenderInfo&) const { return 0; } + + virtual void drawImplementation(RenderInfo& renderInfo) const; + + /** Set compute shader work groups */ + void setComputeGroups( GLint numGroupsX, GLint numGroupsY, GLint numGroupsZ ) { _numGroupsX=numGroupsX; _numGroupsY=numGroupsY; _numGroupsZ=numGroupsZ; } + + /** Get compute shader work groups */ + void getComputeGroups( GLint& numGroupsX, GLint& numGroupsY, GLint& numGroupsZ ) const{ numGroupsX=_numGroupsX; numGroupsY=_numGroupsY; numGroupsZ=_numGroupsZ; } + + protected: + GLint _numGroupsX, _numGroupsY, _numGroupsZ; + +}; + +} +#endif + diff --git a/include/osg/Drawable b/include/osg/Drawable index 43b67357972..b289443541e 100644 --- a/include/osg/Drawable +++ b/include/osg/Drawable @@ -55,7 +55,7 @@ #endif -// #define INLINE_DRAWABLE_DRAW +#define INLINE_DRAWABLE_DRAW namespace osg { @@ -113,10 +113,10 @@ class OSG_EXPORT Drawable : public Node /** Set the initial bounding volume to use when computing the overall bounding volume.*/ - void setInitialBound(const osg::BoundingBox& bbox) { _initialBound = bbox; dirtyBound(); } + void setInitialBound(const osg::BoundingBox& bbox) { _initialBoundingBox = bbox; dirtyBound(); } /** Set the initial bounding volume to use when computing the overall bounding volume.*/ - const BoundingBox& getInitialBound() const { return _initialBound; } + const BoundingBox& getInitialBound() const { return _initialBoundingBox; } inline const BoundingSphere& getBound() const { @@ -131,10 +131,10 @@ class OSG_EXPORT Drawable : public Node { if(!_boundingSphereComputed) { - _boundingBox = _initialBound; + _boundingBox = _initialBoundingBox; - if (_computeBoundCallback.valid()) - _boundingBox.expandBy(_computeBoundCallback->computeBound(*this)); + if (_computeBoundingBoxCallback.valid()) + _boundingBox.expandBy(_computeBoundingBoxCallback->computeBound(*this)); else _boundingBox.expandBy(computeBoundingBox()); @@ -171,13 +171,13 @@ class OSG_EXPORT Drawable : public Node }; /** Set the compute bound callback to override the default computeBound.*/ - void setComputeBoundingBoxCallback(ComputeBoundingBoxCallback* callback) { _computeBoundCallback = callback; } + void setComputeBoundingBoxCallback(ComputeBoundingBoxCallback* callback) { _computeBoundingBoxCallback = callback; } /** Get the compute bound callback.*/ - ComputeBoundingBoxCallback* getComputeBoundingBoxCallback() { return _computeBoundCallback.get(); } + ComputeBoundingBoxCallback* getComputeBoundingBoxCallback() { return _computeBoundingBoxCallback.get(); } /** Get the const compute bound callback.*/ - const ComputeBoundingBoxCallback* getComputeBoundingBoxCallback() const { return _computeBoundCallback.get(); } + const ComputeBoundingBoxCallback* getComputeBoundingBoxCallback() const { return _computeBoundingBoxCallback.get(); } /** Set the Shape of the \c Drawable. The shape can be used to @@ -524,8 +524,8 @@ class OSG_EXPORT Drawable : public Node friend class Geode; friend class StateSet; - BoundingBox _initialBound; - ref_ptr _computeBoundCallback; + BoundingBox _initialBoundingBox; + ref_ptr _computeBoundingBoxCallback; mutable BoundingBox _boundingBox; ref_ptr _shape; @@ -566,7 +566,7 @@ inline void Drawable::draw(RenderInfo& renderInfo) const State::SetCurrentVertexArrayStateProxy setVASProxy(state, vas); - vas->bindVertexArrayObject(); + state.bindVertexArrayObject(vas); drawInner(renderInfo); @@ -576,7 +576,11 @@ inline void Drawable::draw(RenderInfo& renderInfo) const } // TODO, add check against whether VAO is active and supported - if (state.getCurrentVertexArrayState()) state.getCurrentVertexArrayState()->bindVertexArrayObject(); + if (state.getCurrentVertexArrayState()) + { + //OSG_NOTICE<<"state.getCurrentVertexArrayState()->getVertexArrayObject()="<< state.getCurrentVertexArrayState()->getVertexArrayObject()< _operationsBlock; diff --git a/include/osg/GraphicsThread b/include/osg/GraphicsThread index 8001cc5f3ca..5effe7b8e94 100644 --- a/include/osg/GraphicsThread +++ b/include/osg/GraphicsThread @@ -42,6 +42,14 @@ struct OSG_EXPORT GraphicsOperation : public Operation virtual void operator () (Object* object); virtual void operator () (GraphicsContext* context) = 0; + + /** Resize any per context GLObject buffers to specified size. */ + virtual void resizeGLObjectBuffers(unsigned int /*maxSize*/) {} + + /** If State is non-zero, this function releases any associated OpenGL objects for + * the specified graphics context. Otherwise, releases OpenGL objects + * for all graphics contexts. */ + virtual void releaseGLObjects(osg::State* = 0) const {} }; diff --git a/include/osg/Image b/include/osg/Image index 4bf7df74bdc..28c28429d7d 100644 --- a/include/osg/Image +++ b/include/osg/Image @@ -433,7 +433,7 @@ class OSG_EXPORT Image : public BufferData /** Ensure image dimensions are a power of two. * Mipmapped textures require the image dimensions to be - * power of two and are within the maxiumum texture size for + * power of two and are within the maximum texture size for * the host machine. */ void ensureValidSizeForTexturing(GLint maxTextureSize); diff --git a/include/osg/Matrixd b/include/osg/Matrixd index 318fbc77569..b9e3940e11b 100644 --- a/include/osg/Matrixd +++ b/include/osg/Matrixd @@ -327,7 +327,7 @@ class OSG_EXPORT Matrixd inline Vec4f operator* ( const Vec4f& v ) const; inline Vec4d operator* ( const Vec4d& v ) const; -#ifdef USE_DEPRECATED_API +#ifdef OSG_USE_DEPRECATED_API inline void set(const Quat& q) { makeRotate(q); } /// deprecated, replace with makeRotate(q) inline void get(Quat& q) const { q = getRotate(); } /// deprecated, replace with getRotate() #endif diff --git a/include/osg/Matrixf b/include/osg/Matrixf index 845c8a3a0ef..e9bcfbbc353 100644 --- a/include/osg/Matrixf +++ b/include/osg/Matrixf @@ -328,7 +328,7 @@ class OSG_EXPORT Matrixf inline Vec4f operator* ( const Vec4f& v ) const; inline Vec4d operator* ( const Vec4d& v ) const; -#ifdef USE_DEPRECATED_API +#ifdef OSG_USE_DEPRECATED_API inline void set(const Quat& q) { makeRotate(q); } inline void get(Quat& q) const { q = getRotate(); } #endif diff --git a/include/osg/Node b/include/osg/Node index 32ff5c3d270..68642bd68a9 100644 --- a/include/osg/Node +++ b/include/osg/Node @@ -194,11 +194,11 @@ class OSG_EXPORT Node : public Object /** Get the list of node paths parent paths. - * The optional Node* haltTraversalAtNode allows the user to prevent traversal beyond a specifed node. */ + * The optional Node* haltTraversalAtNode allows the user to prevent traversal beyond a specified node. */ NodePathList getParentalNodePaths(osg::Node* haltTraversalAtNode=0) const; /** Get the list of matrices that transform this node from local coordinates to world coordinates. - * The optional Node* haltTraversalAtNode allows the user to prevent traversal beyond a specifed node. */ + * The optional Node* haltTraversalAtNode allows the user to prevent traversal beyond a specified node. */ MatrixList getWorldMatrices(const osg::Node* haltTraversalAtNode=0) const; diff --git a/include/osg/Notify b/include/osg/Notify index 9e21a8695f4..9bb8e684b69 100644 --- a/include/osg/Notify +++ b/include/osg/Notify @@ -126,7 +126,7 @@ public: void notify(osg::NotifySeverity severity, const char *message); }; -#if defined(WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) /** Redirects notification stream to windows debugger with use of * OuputDebugString functions. diff --git a/include/osg/Object b/include/osg/Object index f15257e2bfc..fe0031388c0 100644 --- a/include/osg/Object +++ b/include/osg/Object @@ -25,7 +25,6 @@ namespace osg { // forward declare -class State; class UserDataContainer; class Node; class NodeVisitor; diff --git a/include/osg/OcclusionQueryNode b/include/osg/OcclusionQueryNode index 2b68e4ce284..9d8ebabc3ff 100644 --- a/include/osg/OcclusionQueryNode +++ b/include/osg/OcclusionQueryNode @@ -72,7 +72,19 @@ public: virtual void drawImplementation( osg::RenderInfo& renderInfo ) const; - unsigned int getNumPixels( const osg::Camera* cam ); + struct QueryResult + { + QueryResult() : valid(false), numPixels(0) {} + QueryResult(bool v, unsigned int p) : valid(v), numPixels(p) {} + + bool valid; + unsigned int numPixels; + }; + + /** return a QueryResult for specified Camera, where the QueryResult.valid is true when query results are available, and in which case the QueryResult.numPixels provides the num of pixels in the query result.*/ + QueryResult getQueryResult( const osg::Camera* cam ) const; + + unsigned int getNumPixels( const osg::Camera* cam ) const; virtual void releaseGLObjects( osg::State* state = 0 ) const; @@ -125,6 +137,11 @@ public: void setQueryFrameCount( unsigned int frames ) { _queryFrameCount = frames; } unsigned int getQueryFrameCount() const { return _queryFrameCount; } + // Resets the queries. The next frame will issue a new query. + // This is useful for big view changes, if it shouldn't be waited for + // '_queryFrameCount' till the frame contents change. + void resetQueries(); + // Indicate whether or not the bounding box used in the occlusion query test // should be rendered. Handy for debugging and development. // Should only be called outside of cull/draw. No thread issues. @@ -141,8 +158,11 @@ public: osg::StateSet* getQueryStateSet(); const osg::StateSet* getQueryStateSet() const; - // Get the QueryGeometry object used for occlusion query. Returns 0 if no QueryGeometry is created. - osg::QueryGeometry* getQueryGeometry(); + // Set and get the QueryGeometry object used for the occlusion query. + // By default an axis aligned box is used as the query geometry. + // Resetting to the default query geometry is done by setting it to 0. + // Returns 0 if no QueryGeometry is created. + void setQueryGeometry( osg::QueryGeometry* geom ); const osg::QueryGeometry* getQueryGeometry() const; // Set and get the StateSet used by the OcclusionQueryNode @@ -172,15 +192,31 @@ public: static void discardDeletedQueryObjects( unsigned int contextID ); protected: + enum QueryGeometryState { + INVALID, + VALID, + USER_DEFINED + }; + virtual ~OcclusionQueryNode(); virtual void createSupportNodes(); + bool isQueryGeometryValid() const { return _queryGeometryState != INVALID; } + + void setQueryGeometryInternal( osg::QueryGeometry* queryGeom, + osg::Geometry* debugQueryGeom, + QueryGeometryState state ); + + void updateDefaultQueryGeometry(); + osg::ref_ptr< osg::Geode > _queryGeode; osg::ref_ptr< osg::Geode > _debugGeode; bool _enabled; + mutable QueryGeometryState _queryGeometryState; + // Tracks the last frame number that we performed a query. // User can set how many times (See setQueryFrameCount). typedef std::map< const osg::Camera*, unsigned int > FrameCountMap; diff --git a/include/osg/PagedLOD b/include/osg/PagedLOD index c24666e5afe..06b88282a7f 100644 --- a/include/osg/PagedLOD +++ b/include/osg/PagedLOD @@ -154,7 +154,7 @@ class OSG_EXPORT PagedLOD : public LOD /** Get the number of children that the PagedLOD must keep around, even if they are older than their expiry time.*/ unsigned int getNumChildrenThatCannotBeExpired() const { return _numChildrenThatCannotBeExpired; } - /** Set wether you want to disable the paging in of external nodes.*/ + /** Set whether you want to disable the paging in of external nodes.*/ void setDisableExternalChildrenPaging(bool flag) { _disableExternalChildrenPaging = flag; } bool getDisableExternalChildrenPaging() const { return _disableExternalChildrenPaging; } diff --git a/include/osg/Quat b/include/osg/Quat index c8ef76f1b00..adebc8768a0 100644 --- a/include/osg/Quat +++ b/include/osg/Quat @@ -32,7 +32,11 @@ class OSG_EXPORT Quat public: /** Data type of vector components.*/ + #ifdef OSG_USE_FLOAT_QUAT + typedef float value_type; + #else typedef double value_type; + #endif /** Number of vector components. */ enum { num_components = 4 }; @@ -49,6 +53,14 @@ class OSG_EXPORT Quat _v[3]=w; } + inline Quat( const Quat& rhs ) + { + _v[0]=rhs._v[0]; + _v[1]=rhs._v[1]; + _v[2]=rhs._v[2]; + _v[3]=rhs._v[3]; + } + inline Quat( const Vec4f& v ) { _v[0]=v.x(); diff --git a/include/osg/Referenced b/include/osg/Referenced index 0a683232fce..90811233f67 100644 --- a/include/osg/Referenced +++ b/include/osg/Referenced @@ -30,6 +30,7 @@ namespace osg { class DeleteHandler; class Observer; class ObserverSet; +class State; /** template class to help enforce static initialization order. */ template @@ -47,7 +48,7 @@ class OSG_EXPORT Referenced Referenced(); - /** Deprecated, Referenced is now always uses thread safe ref/unref, use default Refernced() constructor instead */ + /** Deprecated, Referenced is now always uses thread safe ref/unref, use default Referenced() constructor instead */ explicit Referenced(bool threadSafeRefUnref); Referenced(const Referenced&); @@ -114,8 +115,16 @@ class OSG_EXPORT Referenced /** Remove Observer that is observing this object.*/ void removeObserver(Observer* observer) const; - - public: +#if 0 + /** Resize any per context GLObject buffers to specified size. */ + virtual void resizeGLObjectBuffers(unsigned int /*maxSize*/) {} + + /** If State is non-zero, this function releases any associated OpenGL objects for + * the specified graphics context. Otherwise, releases OpenGL objects + * for all graphics contexts. */ + virtual void releaseGLObjects(osg::State* = 0) const {} +#endif +public: friend class DeleteHandler; diff --git a/include/osg/Shader b/include/osg/Shader index 4347cf9a573..6b7ad0bca45 100644 --- a/include/osg/Shader +++ b/include/osg/Shader @@ -306,6 +306,7 @@ class OSG_EXPORT Shader : public osg::Object /** osg::Programs that this osg::Shader is attached to */ typedef std::set< osg::Program* > ProgramSet; ProgramSet _programSet; + OpenThreads::Mutex _programSetMutex; mutable osg::buffered_value< osg::ref_ptr > _pcsList; private: diff --git a/include/osg/Shape b/include/osg/Shape index 69cd9e90e1e..5f46036bd7d 100644 --- a/include/osg/Shape +++ b/include/osg/Shape @@ -747,7 +747,7 @@ class TessellationHints : public Object // forward declare; class Geometry; -/** Convenience class for populating an Geomtry with vertex, normals, texture coords and primitives that can render a Shape. */ +/** Convenience class for populating an Geometry with vertex, normals, texture coords and primitives that can render a Shape. */ class OSG_EXPORT BuildShapeGeometryVisitor : public ConstShapeVisitor { public: @@ -768,10 +768,13 @@ class OSG_EXPORT BuildShapeGeometryVisitor : public ConstShapeVisitor virtual void apply(const CompositeShape&); void Normal(const Vec3f& v) { _normals->push_back(v); } - void Normal3f(float x, float y, float z) { _normals->push_back(Vec3(x,y,z)); } - void TexCoord2f(float x, float y) { _texcoords->push_back(Vec2(x,y)); } - void Vertex(const Vec3f& v) { _vertices->push_back(v); } - void Vertex3f(float x, float y, float z) { _vertices->push_back(Vec3(x,y,z)); } + void Normal3f(float x, float y, float z) { Normal(Vec3(x,y,z)); } + + void TexCoord(const Vec2f& tc) { _texcoords->push_back(tc); } + void TexCoord2f(float x, float y) { TexCoord(Vec2(x,y)); } + + void Vertex(const Vec3f& v); + void Vertex3f(float x, float y, float z) { Vertex(Vec3(x,y,z)); } void setMatrix(const Matrixd& m); diff --git a/include/osg/State b/include/osg/State index c2132bdadfc..b74fcbb5b6f 100644 --- a/include/osg/State +++ b/include/osg/State @@ -252,7 +252,7 @@ class OSG_EXPORT State : public Referenced Polytope getViewFrustum() const; - void setUseVertexAttributeAliasing(bool flag) { _useVertexAttributeAliasing = flag; } + void setUseVertexAttributeAliasing(bool flag); bool getUseVertexAttributeAliasing() const { return _useVertexAttributeAliasing ; } typedef std::vector VertexAttribAliasList; @@ -549,6 +549,13 @@ class OSG_EXPORT State : public Referenced /** Set the getCurrentVertexArrayState to the GlobalVertexArrayState.*/ void setCurrentToGlobalVertexArrayState() { _vas = _globalVertexArrayState.get(); } + /** Reset the CurrentVertexArrayState/VertexArrayObject if it's value matches the specificied vas - use when deleting a vas.*/ + void resetCurrentVertexArrayStateOnMatch(VertexArrayState* vas) + { + if (vas->getVertexArrayObject()== _currentVAO) _currentVAO = 0; + if (_vas==vas) _vas = _globalVertexArrayState.get(); + } + /** disable the vertex, normal, color, tex coords, secondary color, fog coord and index arrays.*/ void disableAllVertexArrays(); @@ -834,11 +841,13 @@ class OSG_EXPORT State : public Referenced /** Get the const DisplaySettings */ inline const DisplaySettings* getDisplaySettings() const { return _displaySettings.get(); } + /** Get the DisplaySettings that is current active DisplaySettings to be used by osg::State, - if DisplaySettings is not directly assigned then fallback to DisplaySettings::instance(). */ + inline DisplaySettings* getActiveDisplaySettings() { return _displaySettings.valid() ? _displaySettings.get() : osg::DisplaySettings::instance().get(); } + /** Get the const DisplaySettings that is current active DisplaySettings to be used by osg::State, - if DisplaySettings is not directly assigned then fallback to DisplaySettings::instance(). */ inline const DisplaySettings* getActiveDisplaySettings() const { return _displaySettings.valid() ? _displaySettings.get() : osg::DisplaySettings::instance().get(); } - /** Set flag for early termination of the draw traversal.*/ void setAbortRenderingPtr(bool* abortPtr) { _abortRenderingPtr = abortPtr; } @@ -1319,12 +1328,12 @@ class OSG_EXPORT State : public Referenced inline void popModeList(ModeMap& modeMap,const StateSet::ModeList& modeList); inline void popAttributeList(AttributeMap& attributeMap,const StateSet::AttributeList& attributeList); inline void popUniformList(UniformMap& uniformMap,const StateSet::UniformList& uniformList); - inline void popDefineList(DefineMap& uniformMap,const StateSet::DefineList& defineList); + inline void popDefineList(DefineMap& defineMap,const StateSet::DefineList& defineList); inline void applyModeList(ModeMap& modeMap,const StateSet::ModeList& modeList); inline void applyAttributeList(AttributeMap& attributeMap,const StateSet::AttributeList& attributeList); inline void applyUniformList(UniformMap& uniformMap,const StateSet::UniformList& uniformList); - inline void applyDefineList(DefineMap& uniformMap,const StateSet::DefineList& defineList); + inline void applyDefineList(DefineMap& defineMap,const StateSet::DefineList& defineList); inline void applyModeMap(ModeMap& modeMap); inline void applyAttributeMap(AttributeMap& attributeMap); diff --git a/include/osg/TemplatePrimitiveIndexFunctor b/include/osg/TemplatePrimitiveIndexFunctor index f5bc5efc431..d5757b16ff3 100644 --- a/include/osg/TemplatePrimitiveIndexFunctor +++ b/include/osg/TemplatePrimitiveIndexFunctor @@ -90,7 +90,7 @@ public: unsigned int pos=first; for(GLsizei i=3;ioperator()(pos,pos+1,pos+2,pos+3); + this->operator()(pos,pos+1,pos+3,pos+2); } break; } @@ -187,7 +187,7 @@ public: IndexPointer iptr = indices; for(GLsizei i=3;ioperator()(*(iptr),*(iptr+1),*(iptr+2),*(iptr+3)); + this->operator()(*(iptr),*(iptr+1),*(iptr+3),*(iptr+2)); } break; } @@ -283,7 +283,7 @@ public: IndexPointer iptr = indices; for(GLsizei i=3;ioperator()(*(iptr),*(iptr+1),*(iptr+2),*(iptr+3)); + this->operator()(*(iptr),*(iptr+1),*(iptr+3),*(iptr+2)); } break; } @@ -378,7 +378,7 @@ public: IndexPointer iptr = indices; for(GLsizei i=3;ioperator()(*(iptr),*(iptr+1),*(iptr+2),*(iptr+3)); + this->operator()(*(iptr),*(iptr+1),*(iptr+3),*(iptr+2)); } break; } diff --git a/include/osg/Texture b/include/osg/Texture index eb413137441..f6614633acd 100644 --- a/include/osg/Texture +++ b/include/osg/Texture @@ -62,6 +62,10 @@ #define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 #define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 #define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 + #define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C + #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D + #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E + #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F #endif #ifndef GL_EXT_texture_compression_rgtc @@ -652,8 +656,10 @@ class OSG_EXPORT Texture : public osg::StateAttribute /** Get the internal texture format type. */ inline InternalFormatType getInternalFormatType() const { return _internalFormatType; } - class TextureObject; + /* select the size internal format to use based on Image when available or Texture format settings.*/ + GLenum selectSizedInternalFormat(const osg::Image* image=0) const; + class TextureObject; /** return true if the texture image data has been modified and the associated GL texture object needs to be updated.*/ virtual bool isDirty(unsigned int /*contextID*/) const { return false; } diff --git a/include/osg/Timer b/include/osg/Timer index 77330944b3b..acc3ab79fdb 100644 --- a/include/osg/Timer +++ b/include/osg/Timer @@ -18,8 +18,8 @@ namespace osg { -#if defined(_MSC_VER) - typedef __int64 Timer_t; +#if defined(_MSC_VER) && !defined(__clang__) + typedef unsigned __int64 Timer_t; #else typedef unsigned long long Timer_t; #endif diff --git a/include/osg/UserDataContainer b/include/osg/UserDataContainer index ab63aaf2098..65b0100a3d2 100644 --- a/include/osg/UserDataContainer +++ b/include/osg/UserDataContainer @@ -203,14 +203,14 @@ protected: }; -/** Convenience function for getting the User Object associated with specificed name from an Object's UserDataContainer.*/ +/** Convenience function for getting the User Object associated with specified name from an Object's UserDataContainer.*/ inline Object* getUserObject(osg::Object* object, const std::string& name) { osg::UserDataContainer* udc = object->getUserDataContainer(); return udc ? udc->getUserObject(name) : 0; } -/** Convenience function for getting the User Object associated with specificed name from an Object's UserDataContainer.*/ +/** Convenience function for getting the User Object associated with specified name from an Object's UserDataContainer.*/ inline const Object* getUserObject(const osg::Object* object, const std::string& name) { const osg::UserDataContainer* udc = object->getUserDataContainer(); diff --git a/include/osg/Vec2i b/include/osg/Vec2i index 6ec16054ced..bc26d69851e 100644 --- a/include/osg/Vec2i +++ b/include/osg/Vec2i @@ -28,7 +28,7 @@ class Vec2i /** Number of vector components. */ enum { num_components = 2 }; - /** Vec member varaible. */ + /** Vec member variable. */ value_type _v[2]; Vec2i() { _v[0]=0; _v[1]=0; } diff --git a/include/osg/Vec2ui b/include/osg/Vec2ui index 7e5e31bc5a1..641bc4e9e16 100644 --- a/include/osg/Vec2ui +++ b/include/osg/Vec2ui @@ -28,7 +28,7 @@ class Vec2ui /** Number of vector components. */ enum { num_components = 2 }; - /** Vec member varaible. */ + /** Vec member variable. */ value_type _v[2]; Vec2ui() { _v[0]=0; _v[1]=0; } diff --git a/include/osg/Vec3i b/include/osg/Vec3i index fe0a0c7612f..88446008876 100644 --- a/include/osg/Vec3i +++ b/include/osg/Vec3i @@ -28,7 +28,7 @@ class Vec3i /** Number of vector components. */ enum { num_components = 3 }; - /** Vec member varaible. */ + /** Vec member variable. */ value_type _v[3]; Vec3i() { _v[0]=0; _v[1]=0; _v[2]=0; } diff --git a/include/osg/Vec3ui b/include/osg/Vec3ui index 410f80cfadf..126a97599f2 100644 --- a/include/osg/Vec3ui +++ b/include/osg/Vec3ui @@ -28,7 +28,7 @@ class Vec3ui /** Number of vector components. */ enum { num_components = 3 }; - /** Vec member varaible. */ + /** Vec member variable. */ value_type _v[3]; Vec3ui() { _v[0]=0; _v[1]=0; _v[2]=0; } diff --git a/include/osg/Vec4i b/include/osg/Vec4i index d53ac8f3e53..e29675e3424 100644 --- a/include/osg/Vec4i +++ b/include/osg/Vec4i @@ -28,7 +28,7 @@ class Vec4i /** Number of vector components. */ enum { num_components = 4 }; - /** Vec member varaible. */ + /** Vec member variable. */ value_type _v[4]; Vec4i() { _v[0]=0; _v[1]=0; _v[2]=0; _v[3]=0; } diff --git a/include/osg/Vec4ui b/include/osg/Vec4ui index 7be56811eb2..059617ea807 100644 --- a/include/osg/Vec4ui +++ b/include/osg/Vec4ui @@ -28,7 +28,7 @@ class Vec4ui /** Number of vector components. */ enum { num_components = 4 }; - /** Vec member varaible. */ + /** Vec member variable. */ value_type _v[4]; Vec4ui() { _v[0]=0; _v[1]=0; _v[2]=0; _v[3]=0; } diff --git a/include/osg/VertexArrayState b/include/osg/VertexArrayState index 5b66db4a93f..ef717719bfe 100644 --- a/include/osg/VertexArrayState +++ b/include/osg/VertexArrayState @@ -182,10 +182,12 @@ class OSG_EXPORT VertexArrayState : public osg::Referenced public: + virtual ~VertexArrayState(); // osg::GLBufferObject* getGLBufferObject(osg::Array* array); osg::State* _state; + osg::ref_ptr _stateObserverSet; osg::ref_ptr _ext; bool _isVertexBufferObjectSupported; diff --git a/include/osg/View b/include/osg/View index 6143be11b5e..e45c326a329 100644 --- a/include/osg/View +++ b/include/osg/View @@ -161,6 +161,9 @@ class OSG_EXPORT View : public virtual osg::Object void updateSlaves(); + virtual void resizeGLObjectBuffers(unsigned int maxSize); + virtual void releaseGLObjects(osg::State* = 0) const; + protected : virtual ~View(); diff --git a/include/osg/io_utils b/include/osg/io_utils index 6f6d9aaf08c..857810adf29 100644 --- a/include/osg/io_utils +++ b/include/osg/io_utils @@ -16,6 +16,7 @@ #include #include +#include #include #include @@ -35,6 +36,42 @@ namespace osg { +/** Convinience class for building std::string using stringstream. + * Usage: + * MakeString str; + * std::string s = str<<"Mix strings with numbers "<<0" ; + * std::string s2 = str.clear()<<"and other classes such as ("< + MakeString& operator << (const T& t) + { + sstream << t; + return *this; + } + + MakeString& operator << (std::ostream& (*fun)(std::ostream&)) + { + sstream << fun; + return *this; + } + + inline MakeString& clear() { sstream.str("") ; return *this; } + + inline operator std::string () const { return sstream.str(); } + + inline std::string str() const { return sstream.str(); } +}; + + + +inline std::ostream& operator << (std::ostream& output, const MakeString& str) { output << str.str(); return output; } + ////////////////////////////////////////////////////////////////////////// // Vec2f streaming operators inline std::ostream& operator << (std::ostream& output, const Vec2f& vec) diff --git a/include/osg/observer_ptr b/include/osg/observer_ptr index e56cca5cc39..dd914f7bbe6 100644 --- a/include/osg/observer_ptr +++ b/include/osg/observer_ptr @@ -123,7 +123,7 @@ public: bool operator == (const observer_ptr& wp) const { return _reference == wp._reference; } bool operator != (const observer_ptr& wp) const { return _reference != wp._reference; } bool operator < (const observer_ptr& wp) const { return _reference < wp._reference; } - bool operator > (const observer_ptr& wp) const { return _reference > wp._reference; } + bool operator > (const observer_ptr& wp) const { return wp._reference < _reference; } // Non-strict interface, for compatibility // comparison operator for const T*. diff --git a/include/osg/os_utils b/include/osg/os_utils index b46073f5b73..27bdec2a288 100644 --- a/include/osg/os_utils +++ b/include/osg/os_utils @@ -30,6 +30,8 @@ extern OSG_EXPORT int osg_system(const char* str); #ifdef __cplusplus +#include + #if defined(OSG_ENVVAR_SUPPORTED) #include #include @@ -47,11 +49,16 @@ inline unsigned int getClampedLength(const char* str, unsigned int maxNumChars=4 inline std::string getEnvVar(const char* name) { +#ifdef OSG_ENVVAR_SUPPORTED std::string value; const char* ptr = getenv(name); if (ptr) value.assign(ptr, getClampedLength(ptr)); return value; - } +#else + OSG_UNUSED(name); + return std::string(); +#endif +} template @@ -65,6 +72,7 @@ inline bool getEnvVar(const char* name, T& value) str >> value; return !str.fail(); #else + OSG_UNUSED2(name, value); return false; #endif } @@ -79,6 +87,7 @@ inline bool getEnvVar(const char* name, std::string& value) value.assign(ptr, getClampedLength(ptr)); return true; #else + OSG_UNUSED2(name, value); return false; #endif } @@ -94,6 +103,7 @@ inline bool getEnvVar(const char* name, T1& value1, T2& value2) str >> value1 >> value2; return !str.fail(); #else + OSG_UNUSED3(name, value1, value2); return false; #endif } @@ -109,6 +119,7 @@ inline bool getEnvVar(const char* name, T1& value1, T2& value2, T3& value3) str >> value1 >> value2 >> value3; return !str.fail(); #else + OSG_UNUSED4(name, value1, value2, value3); return false; #endif } @@ -124,6 +135,7 @@ inline bool getEnvVar(const char* name, T1& value1, T2& value2, T3& value3, T4& str >> value1 >> value2 >> value3 >> value4; return !str.fail(); #else + OSG_UNUSED5(name, value1, value2, value3, value4); return false; #endif } diff --git a/include/osg/ref_ptr b/include/osg/ref_ptr index f9166ac1540..eb8e3666250 100644 --- a/include/osg/ref_ptr +++ b/include/osg/ref_ptr @@ -36,6 +36,9 @@ class ref_ptr ref_ptr() : _ptr(0) {} ref_ptr(T* ptr) : _ptr(ptr) { if (_ptr) _ptr->ref(); } ref_ptr(const ref_ptr& rp) : _ptr(rp._ptr) { if (_ptr) _ptr->ref(); } +#if __cplusplus >= 201103L + ref_ptr(ref_ptr&& rp) noexcept : _ptr(rp._ptr) { rp._ptr = 0; } +#endif template ref_ptr(const ref_ptr& rp) : _ptr(rp._ptr) { if (_ptr) _ptr->ref(); } ref_ptr(observer_ptr& optr) : _ptr(0) { optr.lock(*this); } ~ref_ptr() { if (_ptr) _ptr->unref(); _ptr = 0; } @@ -52,6 +55,17 @@ class ref_ptr return *this; } +#if __cplusplus >= 201103L + template ref_ptr& operator = (ref_ptr&& rp) + { + if (_ptr == rp._ptr) return *this; + if (_ptr != nullptr) _ptr->unref(); + _ptr = rp._ptr; + rp._ptr = nullptr; + return *this; + } +#endif + inline ref_ptr& operator = (T* ptr) { if (_ptr==ptr) return *this; @@ -81,7 +95,7 @@ class ref_ptr bool operator < (const ref_ptr& rp) const { return (_ptr::iterator iterator = intervalSizes.begin() ; iterator != intervalSizes.end() ; ++ iterator) { + for(std::vector::iterator it = intervalSizes.begin() ; it != intervalSizes.end() ; ++ it) { deduplicated.push_back((*this)[cumul]); - if(*iterator > 1) { - deduplicated.push_back((*this)[cumul + (*iterator) - 1]); + if(*it > 1) { + deduplicated.push_back((*this)[cumul + (*it) - 1]); } - cumul += *iterator; + cumul += *it; } unsigned int count = size() - deduplicated.size(); diff --git a/include/osgAnimation/RigTransformSoftware b/include/osgAnimation/RigTransformSoftware index 4424498ba44..f88988e9bcd 100644 --- a/include/osgAnimation/RigTransformSoftware +++ b/include/osgAnimation/RigTransformSoftware @@ -135,15 +135,15 @@ namespace osgAnimation template inline void compute(const osg::Matrix& transform, const osg::Matrix& invTransform, const V* src, V* dst) { - // the result of matrix mult should be cached to be used for vertexes transform and normal transform and maybe other computation + // the result of matrix mult should be cached to be used for vertices transform and normal transform and maybe other computation for(VertexGroupList::iterator itvg=_uniqVertexGroupList.begin(); itvg!=_uniqVertexGroupList.end(); ++itvg) { VertexGroup& uniq = *itvg; uniq.computeMatrixForVertexSet(); osg::Matrix matrix = transform * uniq.getMatrix() * invTransform; - const IndexList& vertexes = uniq.getVertices(); - for(IndexList::const_iterator vertIDit=vertexes.begin(); vertIDit!=vertexes.end(); ++vertIDit) + const IndexList& vertices = uniq.getVertices(); + for(IndexList::const_iterator vertIDit=vertices.begin(); vertIDit!=vertices.end(); ++vertIDit) { dst[*vertIDit] = src[*vertIDit] * matrix; } @@ -160,8 +160,8 @@ namespace osgAnimation uniq.computeMatrixForVertexSet(); osg::Matrix matrix = transform * uniq.getMatrix() * invTransform; - const IndexList& vertexes = uniq.getVertices(); - for(IndexList::const_iterator vertIDit=vertexes.begin(); vertIDit!=vertexes.end(); ++vertIDit) + const IndexList& vertices = uniq.getVertices(); + for(IndexList::const_iterator vertIDit=vertices.begin(); vertIDit!=vertices.end(); ++vertIDit) { dst[*vertIDit] = osg::Matrix::transform3x3(src[*vertIDit],matrix); } diff --git a/include/osgAnimation/VertexInfluence b/include/osgAnimation/VertexInfluence index 1bf1e6e01b1..1aa3e83da96 100644 --- a/include/osgAnimation/VertexInfluence +++ b/include/osgAnimation/VertexInfluence @@ -61,7 +61,7 @@ namespace osgAnimation ///normalize per vertex weights given numvert of the attached mesh void normalize(unsigned int numvert); - ///remove weakest influences in order to fit targetted numbonepervertex + ///remove weakest influences in order to fit targeted numbonepervertex void cullInfluenceCountPerVertex(unsigned int maxnumbonepervertex, float minweight=0, bool renormalize=true); //compute PerVertexInfluenceList diff --git a/include/osgDB/ClassInterface b/include/osgDB/ClassInterface index 5c66ac9c7c6..703f3c472ed 100644 --- a/include/osgDB/ClassInterface +++ b/include/osgDB/ClassInterface @@ -110,12 +110,12 @@ DECLARE_TYPE(osg::BoundingBoxd, BOUNDINGBOXD) DECLARE_TYPE(osg::BoundingSpheref, BOUNDINGSPHEREF) DECLARE_TYPE(osg::BoundingSphered, BOUNDINGSPHERED) -// forward decalare +// forward declare class PropertyOutputIterator; class PropertyInputIterator; -/** ClassInterface provides a general means of checking for supported properties of classes, and getting/setting thoses properties. +/** ClassInterface provides a general means of checking for supported properties of classes, and getting/setting those properties. Uses the osgDB serializers to do the actual object query/get/set. */ class OSGDB_EXPORT ClassInterface @@ -166,10 +166,10 @@ public: /// run method of object bool run(osg::Object* object, const std::string& methodName, osg::Parameters& inputParameters, osg::Parameters& outputParameters) const; - /// checked for support of specificed method + /// checked for support of specified method bool hasMethod(const std::string& compoundClassName, const std::string& methodName) const; - /// checked for support of specificed method + /// checked for support of specified method bool hasMethod(const osg::Object* object, const std::string& methodName) const; diff --git a/include/osgDB/DatabasePager b/include/osgDB/DatabasePager index f90e790759b..e7cc062f8b7 100644 --- a/include/osgDB/DatabasePager +++ b/include/osgDB/DatabasePager @@ -434,7 +434,7 @@ class OSGDB_EXPORT DatabasePager : public osg::NodeVisitor::DatabaseRequestHandl void compileCompleted(DatabaseRequest* databaseRequest); /** Iterate through the active PagedLOD nodes children removing - * children which havn't been visited since specified expiryTime. + * children which haven't been visited since specified expiryTime. * note, should be only be called from the update thread. */ virtual void removeExpiredSubgraphs(const osg::FrameStamp &frameStamp); diff --git a/include/osgDB/FileNameUtils b/include/osgDB/FileNameUtils index 42be97a9a99..c7a2560d5fd 100644 --- a/include/osgDB/FileNameUtils +++ b/include/osgDB/FileNameUtils @@ -39,7 +39,7 @@ extern OSGDB_EXPORT std::string getNameLessAllExtensions(const std::string& file extern OSGDB_EXPORT std::string getStrippedName(const std::string& fileName); /** If 'to' is in a subdirectory of 'from' then this function returns the subpath, otherwise it just returns the file name. * The function does \b not automagically resolve paths as the system does, so be careful to give canonical paths. - * However, the function interprets slashes ('/') ans backslashes ('\') as they were equal. + * However, the function interprets slashes ('/') and backslashes ('\') as they were equal. */ extern OSGDB_EXPORT std::string getPathRelative(const std::string& from, const std::string& to); /** Gets root part of a path ("/" or "C:"), or an empty string if none found. */ diff --git a/include/osgDB/ImageOptions b/include/osgDB/ImageOptions index b5453208433..21d8f3887b6 100644 --- a/include/osgDB/ImageOptions +++ b/include/osgDB/ImageOptions @@ -120,6 +120,8 @@ class OSGDB_EXPORT ImageOptions : public osgDB::Options } double _x,_y,_w,_h; + protected: + virtual ~TexCoordRange() {} }; diff --git a/include/osgDB/InputStream b/include/osgDB/InputStream index f6afc027bfc..8fc999a6e03 100644 --- a/include/osgDB/InputStream +++ b/include/osgDB/InputStream @@ -181,10 +181,10 @@ public: else return 0; } - /// set an input iterator, used directly when not using InputStream with a traditional file releated stream. + /// set an input iterator, used directly when not using InputStream with a traditional file related stream. void setInputIterator( InputIterator* ii ) { _in = ii; } - /// start reading from InputStream treating it as a traditional file releated stream, handles headers and versioning + /// start reading from InputStream treating it as a traditional file related stream, handles headers and versioning ReadType start( InputIterator* ); void decompress(); diff --git a/include/osgDB/ObjectCache b/include/osgDB/ObjectCache index fc068707ea8..195455e88dc 100644 --- a/include/osgDB/ObjectCache +++ b/include/osgDB/ObjectCache @@ -55,10 +55,10 @@ class OSGDB_EXPORT ObjectCache : public osg::Referenced /** Remove Object from cache.*/ void removeFromObjectCache(const std::string& fileName, const Options *options = NULL); - /** Get an Object from the object cache*/ + /** Deprecated, the getFromObjectCache() returns a C pointer that is not thread safe when using database paging, please use the thread safe getRefFromObjectCache() method instead. */ osg::Object* getFromObjectCache(const std::string& fileName, const Options *options = NULL); - /** Get an ref_ptr from the object cache*/ + /** Get a thread safe ref_ptr from the object cache*/ osg::ref_ptr getRefFromObjectCache(const std::string& fileName, const Options *options = NULL); /** call rleaseGLObjects on all objects attached to the object cache.*/ @@ -70,14 +70,17 @@ class OSGDB_EXPORT ObjectCache : public osg::Referenced typedef std::pair > FileNameOptionsPair; - class ClassComp { - public: + struct ClassComp + { bool operator() (const ObjectCache::FileNameOptionsPair& lhs, const ObjectCache::FileNameOptionsPair& rhs) const; }; + typedef std::pair, double > ObjectTimeStampPair; typedef std::map ObjectCacheMap; + ObjectCacheMap::iterator find(const std::string& fileName, const osgDB::Options* options); + ObjectCacheMap _objectCache; OpenThreads::Mutex _objectCacheMutex; diff --git a/include/osgDB/Options b/include/osgDB/Options index 0790161deff..b9ef3eebcb0 100644 --- a/include/osgDB/Options +++ b/include/osgDB/Options @@ -95,21 +95,9 @@ class OSGDB_EXPORT Options : public osg::Object }; - Options(): - osg::Object(true), - _objectCacheHint(CACHE_ARCHIVES), - _precisionHint(FLOAT_PRECISION_ALL), - _buildKdTreesHint(NO_PREFERENCE) {} - - Options(const std::string& str): - osg::Object(true), - _str(str), - _objectCacheHint(CACHE_ARCHIVES), - _precisionHint(FLOAT_PRECISION_ALL), - _buildKdTreesHint(NO_PREFERENCE) - { - parsePluginStringData(str); - } + Options(); + + Options(const std::string& str); Options(const Options& options,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY); @@ -257,10 +245,11 @@ class OSGDB_EXPORT Options : public osg::Object bool operator < (const Options &rhs) const; bool operator == (const Options &rhs) const; - virtual ~Options() {} protected: + virtual ~Options(); + std::string _str; FilePathList _databasePaths; diff --git a/include/osgDB/OutputStream b/include/osgDB/OutputStream index d312680bb37..7a2b9e64c38 100644 --- a/include/osgDB/OutputStream +++ b/include/osgDB/OutputStream @@ -79,7 +79,7 @@ public: OutputStream( const osgDB::Options* options ); virtual ~OutputStream(); - void setFileVersion( const std::string& d, int v ) { _domainVersionMap[d] = v; } + void setFileVersion( const std::string& d, int v ); int getFileVersion( const std::string& d=std::string() ) const; bool isBinary() const { return _out->isBinary(); } @@ -147,13 +147,13 @@ public: OutputStream& operator<<( const osg::BoundingSphered& bb ); OutputStream& operator<<( const osg::Image* img ) { writeImage(img); return *this; } - OutputStream& operator<<( const osg::Array* a ) { writeObject(a); return *this; } - OutputStream& operator<<( const osg::PrimitiveSet* p ) { writeObject(p); return *this; } + OutputStream& operator<<( const osg::Array* a ) { if (_targetFileVersion >= 112) writeObject(a); else writeArray(a); return *this; } + OutputStream& operator<<( const osg::PrimitiveSet* p ) { if (_targetFileVersion >= 112) writeObject(p); else writePrimitiveSet(p); return *this; } OutputStream& operator<<( const osg::Object* obj ) { writeObject(obj); return *this; } OutputStream& operator<<( const osg::ref_ptr& ptr ) { writeImage(ptr.get()); return *this; } - OutputStream& operator<<( const osg::ref_ptr& ptr ) { writeObject(ptr.get()); return *this; } - OutputStream& operator<<( const osg::ref_ptr& ptr ) { writeObject(ptr.get()); return *this; } + OutputStream& operator<<( const osg::ref_ptr& ptr ) { if (_targetFileVersion >= 112) writeObject(ptr.get()); else writeArray(ptr.get()); return *this; } + OutputStream& operator<<( const osg::ref_ptr& ptr ) { if (_targetFileVersion >= 112) writeObject(ptr.get()); else writePrimitiveSet(ptr.get()); return *this; } template OutputStream& operator<<( const osg::ref_ptr& ptr ) { writeObject(ptr.get()); return *this; } @@ -173,10 +173,10 @@ public: void writeObjectFields( const osg::Object* obj ); void writeObjectFields( const osg::Object* obj, const std::string& compoundName ); - /// set an output iterator, used directly when not using OutputStream with a traditional file releated stream. + /// set an output iterator, used directly when not using OutputStream with a traditional file related stream. void setOutputIterator( OutputIterator* oi ) { _out = oi; } - /// start writing to OutputStream treating it as a traditional file releated stream, handles headers and versioning + /// start writing to OutputStream treating it as a traditional file related stream, handles headers and versioning void start( OutputIterator* outIterator, WriteType type ); void compress( std::ostream* ostream ); @@ -218,6 +218,8 @@ protected: osg::ref_ptr _out; osg::ref_ptr _exception; osg::ref_ptr _options; + + int _targetFileVersion; }; void OutputStream::throwException( const std::string& msg ) diff --git a/include/osgDB/PluginQuery b/include/osgDB/PluginQuery index 9b1a27f6402..800b587b1dd 100644 --- a/include/osgDB/PluginQuery +++ b/include/osgDB/PluginQuery @@ -40,6 +40,7 @@ class ReaderWriterInfo : public osg::Referenced ReaderWriter::FormatDescriptionMap protocols; ReaderWriter::FormatDescriptionMap extensions; ReaderWriter::FormatDescriptionMap options; + ReaderWriter::FormatDescriptionMap environment; ReaderWriter::Features features; protected: diff --git a/include/osgDB/ReadFile b/include/osgDB/ReadFile index dfe87ae1b03..4d0670bb056 100644 --- a/include/osgDB/ReadFile +++ b/include/osgDB/ReadFile @@ -197,13 +197,7 @@ inline osg::ref_ptr readRefShaderFile(osg::Shader::Type type, const * The osgDB::Registry is used to load the appropriate ReaderWriter plugin * for the filename extension, and this plugin then handles the request * to read the specified file.*/ -inline osg::ref_ptr readRefShaderFileWithFallback(osg::Shader::Type type, const std::string& filename, const Options* options, const char* fallback) -{ - osg::ref_ptr shader = readRefShaderFile(filename, options); - if (shader.valid() && type != osg::Shader::UNDEFINED) shader->setType(type); - if (!shader) shader = new osg::Shader(type, fallback); - return shader; -} +extern OSGDB_EXPORT osg::ref_ptr readRefShaderFileWithFallback(osg::Shader::Type type, const std::string& filename, const Options* options, const char* fallback); /** Read an osg::Shader from file and set to specified shader type, if a shader isn't loaded fallback to specific shader source. * The osgDB::Registry is used to load the appropriate ReaderWriter plugin diff --git a/include/osgDB/ReaderWriter b/include/osgDB/ReaderWriter index 0bdffb03288..4037434d0bf 100644 --- a/include/osgDB/ReaderWriter +++ b/include/osgDB/ReaderWriter @@ -63,6 +63,9 @@ class OSGDB_EXPORT ReaderWriter : public osg::Object /** Return which list of file extensions supported by ReaderWriter. */ virtual const FormatDescriptionMap& supportedOptions() const { return _supportedOptions; } + /** Return which list of file environment variables supported by ReaderWriter. */ + virtual const FormatDescriptionMap& supportedEnvironment() const { return _supportedEnvironment; } + /** Return true if ReaderWriter accepts specified file extension.*/ virtual bool acceptsExtension(const std::string& /*extension*/) const; @@ -282,11 +285,15 @@ class OSGDB_EXPORT ReaderWriter : public osg::Object * Please note, this should usually only be used internally by subclasses of ReaderWriter. */ void supportsOption(const std::string& opt, const std::string& description); + /** Specify env string as a supported environment string. */ + void supportsEnvironment(const std::string& opt, const std::string& description); + protected: FormatDescriptionMap _supportedProtocols; FormatDescriptionMap _supportedExtensions; FormatDescriptionMap _supportedOptions; + FormatDescriptionMap _supportedEnvironment; }; } diff --git a/include/osgDB/Registry b/include/osgDB/Registry index 87076dc8181..2b317ea91d8 100644 --- a/include/osgDB/Registry +++ b/include/osgDB/Registry @@ -50,7 +50,8 @@ namespace osgDB { The RegisterReaderWriterProxy can be used to automatically register at runtime a reader/writer with the Registry. */ -class OSGDB_EXPORT Registry : public osg::Referenced +class OSGDB_EXPORT Registry : osg::depends_on, + public osg::Referenced { public: @@ -554,7 +555,7 @@ class OSGDB_EXPORT Registry : public osg::Referenced public: /** Functor used in internal implementations.*/ - struct ReadFunctor + struct ReadFunctor : public osg::Referenced { ReadFunctor(const std::string& filename, const Options* options): _filename(filename), diff --git a/include/osgDB/Serializer b/include/osgDB/Serializer index 4eea99d7e7c..d25f08ca038 100644 --- a/include/osgDB/Serializer +++ b/include/osgDB/Serializer @@ -551,21 +551,24 @@ public: }; template -class ObjectSerializer : public TemplateSerializer +class ObjectSerializer : public BaseSerializer { public: - typedef TemplateSerializer ParentType; typedef const P* (C::*Getter)() const; typedef void (C::*Setter)( P* ); - ObjectSerializer( const char* name, P* def, Getter gf, Setter sf ) : ParentType(name, def), _getter(gf), _setter(sf) + ObjectSerializer( const char* name, P* def, Getter gf, Setter sf ) : + BaseSerializer(READ_WRITE_PROPERTY), + _name(name), _defaultValue(def), _getter(gf), _setter(sf) { - ParentType::setUsage( _getter!=0, _setter!=0); + setUsage( _getter!=0, _setter!=0); } virtual bool set(osg::Object& obj, void* value) { C& object = OBJECT_CAST(obj); (object.*_setter)( dynamic_cast(*(reinterpret_cast(value))) ); return true; } virtual bool get(const osg::Object& obj, void* value) { const C& object = OBJECT_CAST(obj);*(reinterpret_cast(value )) = dynamic_cast((object.*_getter)()); return true; } + virtual const std::string& getName() const { return _name; } + virtual bool read( InputStream& is, osg::Object& obj ) { C& object = OBJECT_CAST(obj); @@ -579,7 +582,7 @@ public: (object.*_setter)( value.get() ); } } - else if ( is.matchString(ParentType::_name) ) + else if ( is.matchString(_name) ) { is >> hasObject; if ( hasObject ) @@ -606,9 +609,9 @@ public: os.writeObject( value ); } } - else if ( ParentType::_defaultValue!=value ) + else if ( _defaultValue!=value ) { - os << os.PROPERTY((ParentType::_name).c_str()) << hasObject; + os << os.PROPERTY(_name.c_str()) << hasObject; if ( hasObject ) { os << os.BEGIN_BRACKET << std::endl; @@ -621,8 +624,10 @@ public: } public: - Getter _getter; - Setter _setter; + std::string _name; + osg::ref_ptr

_defaultValue; + Getter _getter; + Setter _setter; }; template diff --git a/include/osgDB/StreamOperator b/include/osgDB/StreamOperator index b50ebb43a84..17c3fa2e59a 100644 --- a/include/osgDB/StreamOperator +++ b/include/osgDB/StreamOperator @@ -62,8 +62,9 @@ protected: // Return true if the manipulator is std::endl bool isEndl( std::ostream& (*fn)(std::ostream&) ) { -#ifdef __sun +#if defined (__sun) || (defined _WIN32 && !defined OSG_LIBRARY_STATIC) // What a mess, but solaris does not like taking the address below + // windows std::endl is a template with different adresses in different dll's std::stringstream ss; ss << fn; std::string s = ss.str(); diff --git a/include/osgDB/XmlParser b/include/osgDB/XmlParser index fbe682a9306..4c3ac9b211d 100644 --- a/include/osgDB/XmlParser +++ b/include/osgDB/XmlParser @@ -105,9 +105,9 @@ class OSGDB_EXPORT XmlNode : public osg::Referenced size_type currentPosition() const { return _currentPos; } - int get() { if (_currentPos<_buffer.size()) return _buffer[_currentPos++]; else return -1; } + int get() { if (_currentPos<_buffer.size()) return static_cast(_buffer[_currentPos++]); else return -1; } - int operator [] (size_type i) const { if ((_currentPos+i)<_buffer.size()) return _buffer[_currentPos+i]; else return -1; } + int operator [] (size_type i) const { if ((_currentPos+i)<_buffer.size()) return static_cast(_buffer[_currentPos+i]); else return -1; } void operator ++ () { if (_currentPos<_buffer.size()) ++_currentPos; } @@ -129,12 +129,56 @@ class OSGDB_EXPORT XmlNode : public osg::Referenced bool match(const std::string& str) { return (_currentPos<_buffer.size()) ? _buffer.compare(_currentPos, str.size(), str)==0 : false; } + enum Encoding + { + ENCODING_ASCII, + ENCODING_UTF8 + }; + + void setEncoding(Encoding encoding) { _encoding = encoding; } + Encoding getEncoding() const { return _encoding; } + + inline void copyCharacterToString(std::string& str) + { + if (_currentPos>=_buffer.size()) return; + switch (_encoding) + { + case(ENCODING_UTF8) : + { + int char0 = static_cast(_buffer[_currentPos]); ++_currentPos; + str.push_back(char0); + + if (char0 < 0x80 || _currentPos>=_buffer.size()) break; // 1-byte character + + str.push_back(_buffer[_currentPos]); ++_currentPos; + if (char0<0xe0 || _currentPos<_buffer.size()) break; // 2-byte character + + str.push_back(_buffer[_currentPos]); ++_currentPos; + if (char0<0xf0 || _currentPos>=_buffer.size()) break; // 3-byte character + + str.push_back(_buffer[_currentPos]); ++_currentPos; + if (char0<0xf8 || _currentPos>=_buffer.size()) break; // 4-byte character + + if (_currentPos>=_buffer.size()) break; + str.push_back(_buffer[_currentPos]); ++_currentPos; // 5-byte character? + + break; + } + case(ENCODING_ASCII) : + default: + str.push_back(_buffer[_currentPos]); + ++_currentPos; + return; + } + } + private: - size_type _currentPos; + size_type _currentPos; - std::ifstream _fin; - std::string _buffer; + std::ifstream _fin; + std::string _buffer; + Encoding _encoding; }; diff --git a/include/osgFX/Cartoon b/include/osgFX/Cartoon index 361a22ec0b3..57603e77ff4 100644 --- a/include/osgFX/Cartoon +++ b/include/osgFX/Cartoon @@ -37,7 +37,7 @@ namespace osgFX Cartoon(); Cartoon(const Cartoon& copy, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY); - // effect class informations + // effect class information META_Effect( osgFX, Cartoon, diff --git a/include/osgFX/Effect b/include/osgFX/Effect index 205e2e85261..14b085c38e7 100644 --- a/include/osgFX/Effect +++ b/include/osgFX/Effect @@ -119,6 +119,9 @@ namespace osgFX /** default traversal */ inline void inherited_traverse(osg::NodeVisitor& nv); + virtual void resizeGLObjectBuffers(unsigned int maxSize); + virtual void releaseGLObjects(osg::State* state = 0) const; + protected: virtual ~Effect(); Effect &operator=(const Effect &) { return *this; } diff --git a/include/osgFX/Scribe b/include/osgFX/Scribe index 3b28285bc5c..28a6ccdca42 100644 --- a/include/osgFX/Scribe +++ b/include/osgFX/Scribe @@ -36,7 +36,7 @@ namespace osgFX Scribe(); Scribe(const Scribe& copy, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY); - // effect class informations + // effect class information META_Effect( osgFX, Scribe, diff --git a/include/osgFX/Technique b/include/osgFX/Technique index dac5fdbebd9..e0b9873eb10 100644 --- a/include/osgFX/Technique +++ b/include/osgFX/Technique @@ -123,28 +123,32 @@ namespace osgFX private: typedef std::vector > Pass_list; - Pass_list _passes; + OpenThreads::Mutex _mutex; + OpenThreads::Atomic _passesDefined; + Pass_list _passes; }; // INLINE METHODS inline int Technique::getNumPasses() const { - return static_cast(_passes.size()); + return _passesDefined!=0 ? static_cast(_passes.size()) : 0; } inline osg::StateSet* Technique::getPassStateSet(int i) { - return _passes[i].get(); + return _passesDefined!=0 ? _passes[i].get() : 0; } inline const osg::StateSet* Technique::getPassStateSet(int i) const { - return _passes[i].get(); + return _passesDefined!=0 ? _passes[i].get() : 0; } inline void Technique::dirtyPasses() { + OpenThreads::ScopedLock lock( _mutex); + _passesDefined.exchange(0); _passes.clear(); } diff --git a/include/osgGA/CameraManipulator b/include/osgGA/CameraManipulator index 3e4d99831d7..25019bf16f7 100644 --- a/include/osgGA/CameraManipulator +++ b/include/osgGA/CameraManipulator @@ -162,7 +162,6 @@ class OSGGA_EXPORT CameraManipulator : public GUIEventHandler /** Start/restart the manipulator. - FIXME: what does this actually mean? Provide examples. */ virtual void init(const GUIEventAdapter& ,GUIActionAdapter&) {} diff --git a/include/osgGA/EventVisitor b/include/osgGA/EventVisitor index ff3deece54c..a4c9baa5edd 100644 --- a/include/osgGA/EventVisitor +++ b/include/osgGA/EventVisitor @@ -107,7 +107,7 @@ class OSGGA_EXPORT EventVisitor : public osg::NodeVisitor } // The following overrides are technically redundant as the default implementation would eventually trickle down to - // apply(osg::Node&); - however defining these explicitely should save a couple of virtual function calls + // apply(osg::Node&); - however defining these explicitly should save a couple of virtual function calls virtual void apply(osg::Geode& node) { handle_callbacks_and_traverse(node); } virtual void apply(osg::Billboard& node) { handle_callbacks_and_traverse(node); } virtual void apply(osg::LightSource& node) { handle_callbacks_and_traverse(node); } diff --git a/include/osgGA/Export b/include/osgGA/Export index 0743d679505..d997a70b4bc 100644 --- a/include/osgGA/Export +++ b/include/osgGA/Export @@ -66,7 +66,7 @@ as appropriate for the viewer. Events from the windowing environment are adpated, and then fed into the GUIEventHandlers. The GUIEventHandlers analyse and take action, and make requests of the windowing -environemnt via the GUIActionAdapter. The viewer writer should then honour these +environment via the GUIActionAdapter. The viewer writer should then honour these requests, translating them into calls to the windowing API. */ diff --git a/include/osgGA/KeySwitchMatrixManipulator b/include/osgGA/KeySwitchMatrixManipulator index f67a5e04a44..d1dec04a469 100644 --- a/include/osgGA/KeySwitchMatrixManipulator +++ b/include/osgGA/KeySwitchMatrixManipulator @@ -44,7 +44,7 @@ class OSGGA_EXPORT KeySwitchMatrixManipulator : public CameraManipulator void addMatrixManipulator(int key, std::string name, CameraManipulator *cm); /** - Add a camera manipulator with an autogenerated keybinding which is '1' + previous number of camera's registerd. + Add a camera manipulator with an autogenerated keybinding which is '1' + previous number of camera's registered. */ void addNumberedMatrixManipulator(CameraManipulator *cm); diff --git a/include/osgManipulator/Dragger b/include/osgManipulator/Dragger index 80aadaeeee2..8bbb407a706 100644 --- a/include/osgManipulator/Dragger +++ b/include/osgManipulator/Dragger @@ -21,7 +21,6 @@ #include #include #include -#include #include #include diff --git a/include/osgManipulator/TrackballDragger b/include/osgManipulator/TrackballDragger index a8613d23691..5188b5628d7 100644 --- a/include/osgManipulator/TrackballDragger +++ b/include/osgManipulator/TrackballDragger @@ -19,6 +19,7 @@ #include #include #include +#include #include namespace osgManipulator { diff --git a/include/osgParticle/LinearInterpolator b/include/osgParticle/LinearInterpolator index c44e2635639..46c603874c1 100644 --- a/include/osgParticle/LinearInterpolator +++ b/include/osgParticle/LinearInterpolator @@ -42,6 +42,21 @@ namespace osgParticle return y1 + (y2 - y1) * t; } + virtual osg::Vec2 interpolate(float t, const osg::Vec2& y1, const osg::Vec2& y2) const + { + return y1 + (y2 - y1) * t; + } + + virtual osg::Vec3 interpolate(float t, const osg::Vec3& y1, const osg::Vec3& y2) const + { + return y1 + (y2 - y1) * t; + } + + virtual osg::Vec4 interpolate(float t, const osg::Vec4& y1, const osg::Vec4& y2) const + { + return y1 + (y2 - y1) * t; + } + protected: virtual ~LinearInterpolator() {} }; diff --git a/include/osgParticle/ParticleSystem b/include/osgParticle/ParticleSystem index 099549501b4..35e97ff8967 100644 --- a/include/osgParticle/ParticleSystem +++ b/include/osgParticle/ParticleSystem @@ -265,7 +265,7 @@ namespace osgParticle * for all graphics contexts. */ virtual void releaseGLObjects(osg::State* state=0) const; - virtual osg::VertexArrayState* createVertexArrayStateImplemenation(osg::RenderInfo& renderInfo) const; + virtual osg::VertexArrayState* createVertexArrayStateImplementation(osg::RenderInfo& renderInfo) const; void adjustEstimatedMaxNumOfParticles(int delta) { _estimatedMaxNumOfParticles += delta; } @@ -279,10 +279,6 @@ namespace osgParticle ParticleSystem& operator=(const ParticleSystem&) { return *this; } inline void update_bounds(const osg::Vec3& p, float r); - void single_pass_render(osg::RenderInfo& renderInfo, const osg::Matrix& modelview) const; - void render_vertex_array(osg::RenderInfo& renderInfo) const; - - void new_drawImplementation(osg::RenderInfo& renderInfo) const; typedef std::vector Particle_vector; typedef std::stack Death_stack; diff --git a/include/osgParticle/PrecipitationEffect b/include/osgParticle/PrecipitationEffect index 1f713f4abb0..f7b89008d4a 100644 --- a/include/osgParticle/PrecipitationEffect +++ b/include/osgParticle/PrecipitationEffect @@ -37,8 +37,10 @@ namespace osgParticle virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast(obj) != 0; } virtual void accept(osg::NodeVisitor& nv) { if (nv.validNodeMask(*this)) { nv.pushOntoNodePath(this); nv.apply(*this); nv.popFromNodePath(); } } - virtual void traverse(osg::NodeVisitor& nv); + virtual void resizeGLObjectBuffers(unsigned int maxSize); + virtual void releaseGLObjects(osg::State* state = 0) const; + virtual void traverse(osg::NodeVisitor& nv); /** Set all the parameters to create an rain effect of specified intensity.*/ void rain(float intensity); @@ -117,6 +119,9 @@ namespace osgParticle void setNumberOfVertices(unsigned int numVertices) { _numberOfVertices = numVertices; } unsigned int getNumberOfVertices() const { return _numberOfVertices; } + virtual void resizeGLObjectBuffers(unsigned int maxSize); + virtual void releaseGLObjects(osg::State* state) const; + virtual void drawImplementation(osg::RenderInfo& renderInfo) const; struct Cell @@ -174,7 +179,7 @@ namespace osgParticle protected: - virtual ~PrecipitationDrawable() {} + virtual ~PrecipitationDrawable(); bool _requiresPreviousMatrix; diff --git a/include/osgPresentation/AnimationMaterial b/include/osgPresentation/AnimationMaterial index 39d43786a70..568b0ab2763 100644 --- a/include/osgPresentation/AnimationMaterial +++ b/include/osgPresentation/AnimationMaterial @@ -1,13 +1,14 @@ -/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2018 Robert Osfield * - * This software is open source and may be redistributed and/or modified under - * the terms of the GNU General Public License (GPL) version 2.0. - * The full license is in LICENSE.txt file included with this distribution,. + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * (at your option) any later version. The full license is in LICENSE file + * included with this distribution, and on the openscenegraph.org website. * - * This software is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * include LICENSE.txt for more details. + * OpenSceneGraph Public License for more details. */ #ifndef OSG_ANIMATIONMATERIAL diff --git a/include/osgPresentation/CompileSlideCallback b/include/osgPresentation/CompileSlideCallback index 83c69c45d64..3df99468a21 100644 --- a/include/osgPresentation/CompileSlideCallback +++ b/include/osgPresentation/CompileSlideCallback @@ -1,13 +1,14 @@ -/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2018 Robert Osfield * - * This software is open source and may be redistributed and/or modified under - * the terms of the GNU General Public License (GPL) version 2.0. - * The full license is in LICENSE.txt file included with this distribution,. + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * (at your option) any later version. The full license is in LICENSE file + * included with this distribution, and on the openscenegraph.org website. * - * This software is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * include LICENSE.txt for more details. + * OpenSceneGraph Public License for more details. */ #ifndef OSG_COMPILESLIDECALLBACK diff --git a/include/osgPresentation/KeyEventHandler b/include/osgPresentation/KeyEventHandler index 45618bbdcc9..5c7f7b95d37 100644 --- a/include/osgPresentation/KeyEventHandler +++ b/include/osgPresentation/KeyEventHandler @@ -1,13 +1,14 @@ -/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2018 Robert Osfield * - * This software is open source and may be redistributed and/or modified under - * the terms of the GNU General Public License (GPL) version 2.0. - * The full license is in LICENSE.txt file included with this distribution,. + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * (at your option) any later version. The full license is in LICENSE file + * included with this distribution, and on the openscenegraph.org website. * - * This software is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * include LICENSE.txt for more details. + * OpenSceneGraph Public License for more details. */ #ifndef KEYEVENTHANDLER diff --git a/include/osgPresentation/PickEventHandler b/include/osgPresentation/PickEventHandler index caaeb39111e..c28529a48d0 100644 --- a/include/osgPresentation/PickEventHandler +++ b/include/osgPresentation/PickEventHandler @@ -1,13 +1,14 @@ -/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2018 Robert Osfield * - * This software is open source and may be redistributed and/or modified under - * the terms of the GNU General Public License (GPL) version 2.0. - * The full license is in LICENSE.txt file included with this distribution,. + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * (at your option) any later version. The full license is in LICENSE file + * included with this distribution, and on the openscenegraph.org website. * - * This software is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * include LICENSE.txt for more details. + * OpenSceneGraph Public License for more details. */ #ifndef PICKEVENTHANDLER diff --git a/include/osgPresentation/PropertyManager b/include/osgPresentation/PropertyManager index 27e6da4c11f..df4eb551cc2 100644 --- a/include/osgPresentation/PropertyManager +++ b/include/osgPresentation/PropertyManager @@ -1,13 +1,14 @@ -/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2018 Robert Osfield * - * This software is open source and may be redistributed and/or modified under - * the terms of the GNU General Public License (GPL) version 2.0. - * The full license is in LICENSE.txt file included with this distribution,. + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * (at your option) any later version. The full license is in LICENSE file + * included with this distribution, and on the openscenegraph.org website. * - * This software is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * include LICENSE.txt for more details. + * OpenSceneGraph Public License for more details. */ #ifndef PROPERTYMANAGER diff --git a/include/osgPresentation/SlideEventHandler b/include/osgPresentation/SlideEventHandler index ed8089e49c0..fe97cb437da 100644 --- a/include/osgPresentation/SlideEventHandler +++ b/include/osgPresentation/SlideEventHandler @@ -1,13 +1,14 @@ -/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2018 Robert Osfield * - * This software is open source and may be redistributed and/or modified under - * the terms of the GNU General Public License (GPL) version 2.0. - * The full license is in LICENSE.txt file included with this distribution,. + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * (at your option) any later version. The full license is in LICENSE file + * included with this distribution, and on the openscenegraph.org website. * - * This software is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * include LICENSE.txt for more details. + * OpenSceneGraph Public License for more details. */ #ifndef SLIDEEVENTHANDLER diff --git a/include/osgPresentation/SlideShowConstructor b/include/osgPresentation/SlideShowConstructor index 08d9d16fa0b..31bf793b539 100644 --- a/include/osgPresentation/SlideShowConstructor +++ b/include/osgPresentation/SlideShowConstructor @@ -1,13 +1,14 @@ -/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2018 Robert Osfield * - * This software is open source and may be redistributed and/or modified under - * the terms of the GNU General Public License (GPL) version 2.0. - * The full license is in LICENSE.txt file included with this distribution,. + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * (at your option) any later version. The full license is in LICENSE file + * included with this distribution, and on the openscenegraph.org website. * - * This software is distributed in the hope that it will be useful, + * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * include LICENSE.txt for more details. + * OpenSceneGraph Public License for more details. */ #ifndef SLIDESHOWCONSTRUCTOR diff --git a/include/osgShadow/MinimalShadowMap b/include/osgShadow/MinimalShadowMap index bec349f41c2..d1de7819426 100644 --- a/include/osgShadow/MinimalShadowMap +++ b/include/osgShadow/MinimalShadowMap @@ -90,7 +90,7 @@ class OSGSHADOW_EXPORT MinimalShadowMap : public StandardShadowMap // when scene objects are put on earth ellipsoid surface. // Other scenarios are also possible for example when models are - // built in XZY space which would require identity matrix with swapped colums + // built in XZY space which would require identity matrix with swapped columns osg::Matrix _modellingSpaceToWorld; float _maxFarPlane; diff --git a/include/osgShadow/OccluderGeometry b/include/osgShadow/OccluderGeometry deleted file mode 100644 index e358cdfea4d..00000000000 --- a/include/osgShadow/OccluderGeometry +++ /dev/null @@ -1,259 +0,0 @@ -/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield - * - * This library is open source and may be redistributed and/or modified under - * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or - * (at your option) any later version. The full license is in LICENSE file - * included with this distribution, and on the openscenegraph.org website. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * OpenSceneGraph Public License for more details. -*/ - -#ifndef OSGSHADOW_OCCLUDERGEOMETRY -#define OSGSHADOW_OCCLUDERGEOMETRY 1 - -#include -#include -#include -#include - -#include - - -namespace osgShadow { - -class ShadowVolumeGeometry; - -/** OccluderGeometry provides a sepecialised geometry representation of objects in scene that occlude light and therefore cast shadows. - * OccluderGeometry supports the computation of silhouette edges and shadow volume geometries, as well as use as geometry that one can rendering - * into a shadow map or end caps for the ZP+ algorithm. OccluderGeometry may be of the same resolution as an underlying geometry that it - * represents, or can be of lower resolution and combine manager separate geometries together into a single shadow casting object. - * OccluderGeometry may be attached as UserData to Nodes or to Drawables. */ -class OSGSHADOW_EXPORT OccluderGeometry : public osg::Drawable -{ - public : - OccluderGeometry(); - - OccluderGeometry(const OccluderGeometry& oc, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY); - - virtual Object* cloneType() const { return new OccluderGeometry(); } - virtual Object* clone(const osg::CopyOp& copyop) const { return new OccluderGeometry(*this,copyop); } - virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast(obj)!=NULL; } - virtual const char* libraryName() const { return "osgShadow"; } - virtual const char* className() const { return "OccluderGeometry"; } - - /** Compute an occluder geometry containing all the geometry in specified subgraph.*/ - void computeOccluderGeometry(osg::Node* subgraph, osg::Matrix* matrix=0, float sampleRatio=1.0f); - - /** Compute an occluder geometry containing the geometry in specified drawable.*/ - void computeOccluderGeometry(osg::Drawable* drawable, osg::Matrix* matrix=0, float sampleRatio=1.0f); - - - /** Compute ShadowVolumeGeometry. */ - void computeShadowVolumeGeometry(const osg::Vec4& lightpos, ShadowVolumeGeometry& svg) const; - - - /** Set the bounding polytope of the OccluderGeometry.*/ - void setBoundingPolytope(const osg::Polytope& polytope) { _boundingPolytope = polytope; } - - /** Get the bounding polytope of the OccluderGeometry.*/ - osg::Polytope& getBoundingPolytope() { return _boundingPolytope; } - - /** Get the const bounding polytope of the OccluderGeometry.*/ - const osg::Polytope& getBoundingPolytope() const { return _boundingPolytope; } - - - /** Render the occluder geometry. */ - virtual void drawImplementation(osg::RenderInfo& renderInfo) const; - - /** Compute the bounding box around occluder geometry.*/ - virtual osg::BoundingBox computeBoundingBox() const; - - typedef std::vector Vec3List; - typedef std::vector UIntList; - - public: - - void processGeometry(osg::Drawable* drawable, osg::Matrix* matrix=0, float sampleRatio=1.0f); - - protected : - - virtual ~OccluderGeometry() {} - - struct Edge - { - Edge(): - _p1(0), - _p2(0), - _t1(-1), - _t2(-1) {} - - Edge(unsigned int p1, unsigned int p2): - _p1(p1), - _p2(p2), - _t1(-1), - _t2(-1) - { - if (p1>p2) - { - // swap ordering so p1 is less than or equal to p2 - _p1 = p2; - _p2 = p1; - } - } - - inline bool operator < (const Edge& rhs) const - { - if (_p1 < rhs._p1) return true; - if (_p1 > rhs._p1) return false; - return (_p2 < rhs._p2); - } - - bool addTriangle(unsigned int tri) const - { - if (_t1<0) - { - _t1 = tri; - return true; - } - else if (_t2<0) - { - _t2 = tri; - return true; - } - // argg more than two triangles assigned - return false; - } - - bool boundaryEdge() const { return _t2<0; } - - unsigned int _p1; - unsigned int _p2; - - mutable int _t1; - mutable int _t2; - - mutable osg::Vec3 _normal; - }; - - typedef std::vector EdgeList; - - inline bool isLightPointSilhouetteEdge(const osg::Vec3& lightpos, const Edge& edge) const - { - if (edge.boundaryEdge()) return true; - - float offset = 0.0f; - - osg::Vec3 delta(lightpos-_vertices[edge._p1]); - delta.normalize(); - - float n1 = delta * _triangleNormals[edge._t1] + offset; - float n2 = delta * _triangleNormals[edge._t2] + offset; - - float angle_offset = 0.0f; - - n1 = cos(acosf(n1) + angle_offset); - n2 = cos(acosf(n2) + angle_offset); - - if (n1==0.0f && n2==0.0f) return false; - - return n1*n2 <= 0.0f; - } - - inline bool isLightDirectionSilhouetteEdge(const osg::Vec3& lightdirection, const Edge& edge) const - { - if (edge.boundaryEdge()) return true; - - float offset = 0.0f; - - float n1 = lightdirection * _triangleNormals[edge._t1] + offset; - float n2 = lightdirection * _triangleNormals[edge._t2] + offset; - - float angle_offset = 0.0f; - - n1 = cos(acosf(n1) + angle_offset); - n2 = cos(acosf(n2) + angle_offset); - - if (n1==0.0f && n2==0.0f) return false; - - return n1*n2 <= 0.0f; - } - - void setUpInternalStructures(); - - void removeDuplicateVertices(); - void removeNullTriangles(); - void computeNormals(); - void buildEdgeMaps(); - - void computeLightDirectionSilhouetteEdges(const osg::Vec3& lightdirection, UIntList& silhouetteIndices) const; - void computeLightPositionSilhouetteEdges(const osg::Vec3& lightpos, UIntList& silhouetteIndices) const; - - osg::Polytope _boundingPolytope; - - Vec3List _vertices; - Vec3List _normals; - Vec3List _triangleNormals; - UIntList _triangleIndices; - - EdgeList _edges; -}; - -class OSGSHADOW_EXPORT ShadowVolumeGeometry : public osg::Drawable -{ - public : - ShadowVolumeGeometry(); - - ShadowVolumeGeometry(const ShadowVolumeGeometry& oc, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY); - - virtual Object* cloneType() const { return new ShadowVolumeGeometry(); } - virtual Object* clone(const osg::CopyOp& copyop) const { return new ShadowVolumeGeometry(*this,copyop); } - virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast(obj)!=NULL; } - virtual const char* libraryName() const { return "osgShadow"; } - virtual const char* className() const { return "ShadowVolumeGeometry"; } - - enum DrawMode - { - GEOMETRY, - STENCIL_TWO_PASS, - STENCIL_TWO_SIDED - }; - - void setDrawMode(DrawMode mode) { _drawMode = mode; } - DrawMode getDrawMode() const { return _drawMode; } - - typedef std::vector Vec3List; - typedef std::vector UIntList; - - void setVertices(const Vec3List& vertices) { _vertices = vertices; } - Vec3List& getVertices() { return _vertices; } - const Vec3List& getVertices() const { return _vertices; } - - void setNormals(const Vec3List& normals) { _normals = normals; } - Vec3List& getNormals() { return _normals; } - const Vec3List& getNormals() const { return _normals; } - - - /** Render the occluder geometry. */ - virtual void drawImplementation(osg::RenderInfo& renderInfo) const; - - /** Compute the bounding box around occluder geometry.*/ - virtual osg::BoundingBox computeBoundingBox() const; - - public: - - protected : - - virtual ~ShadowVolumeGeometry() {} - - DrawMode _drawMode; - Vec3List _vertices; - Vec3List _normals; - UIntList _indices; -}; - -} - -#endif diff --git a/include/osgShadow/ShadowTechnique b/include/osgShadow/ShadowTechnique index a9fc4be4c08..0498ac46d9c 100644 --- a/include/osgShadow/ShadowTechnique +++ b/include/osgShadow/ShadowTechnique @@ -27,7 +27,7 @@ namespace osgShadow { // forward declare ShadowedScene class ShadowedScene; -/** ShadowedScene provides a mechanism for decorating a scene that the needs to have shadows cast upon it.*/ +/** ShadowTechnique is the base class for different shadow implementations.*/ class OSGSHADOW_EXPORT ShadowTechnique : public osg::Object { public : @@ -39,6 +39,8 @@ class OSGSHADOW_EXPORT ShadowTechnique : public osg::Object virtual const char* libraryName() const { return "osgShadow"; }\ virtual const char* className() const { return "ShadowTechnique"; } + virtual void setShadowedScene(ShadowedScene* ss); + ShadowedScene* getShadowedScene() { return _shadowedScene; } const ShadowedScene* getShadowedScene() const { return _shadowedScene; } diff --git a/include/osgShadow/ShadowVolume b/include/osgShadow/ShadowVolume deleted file mode 100644 index 07efd516d39..00000000000 --- a/include/osgShadow/ShadowVolume +++ /dev/null @@ -1,91 +0,0 @@ -/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield - * - * This library is open source and may be redistributed and/or modified under - * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or - * (at your option) any later version. The full license is in LICENSE file - * included with this distribution, and on the openscenegraph.org website. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * OpenSceneGraph Public License for more details. -*/ - -#ifndef OSGSHADOW_SHADOWVOLUME -#define OSGSHADOW_SHADOWVOLUME 1 - -#include -#include -#include - -#include -#include - -namespace osgShadow { - -/** ShadowedTexture provides an implementation of shadow textures.*/ -class OSGSHADOW_EXPORT ShadowVolume : public ShadowTechnique -{ - public : - ShadowVolume(); - - ShadowVolume(const ShadowVolume& es, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY); - - META_Object(osgShadow, ShadowVolume); - - - void setDrawMode(osgShadow::ShadowVolumeGeometry::DrawMode drawMode); - osgShadow::ShadowVolumeGeometry::DrawMode getDrawMode() const { return _drawMode; } - - void setDynamicShadowVolumes(bool dynamicShadowVolumes); - bool getDynamicShadowVolumes() const { return _dynamicShadowVolumes; } - - /** initialize the ShadowedScene and local cached data structures.*/ - virtual void init(); - - /** run the update traversal of the ShadowedScene and update any loca chached data structures.*/ - virtual void update(osg::NodeVisitor& nv); - - /** run the cull traversal of the ShadowedScene and set up the rendering for this ShadowTechnique.*/ - virtual void cull(osgUtil::CullVisitor& cv); - - /** Clean scene graph from any shadow technique specific nodes, state and drawables.*/ - virtual void cleanSceneGraph(); - - - /** Resize any per context GLObject buffers to specified size. */ - virtual void resizeGLObjectBuffers(unsigned int maxSize); - - /** If State is non-zero, this function releases any associated OpenGL objects for - * the specified graphics context. Otherwise, releases OpenGL objects - * for all graphics contexts. */ - virtual void releaseGLObjects(osg::State* = 0) const; - - protected : - - virtual ~ShadowVolume(); - - osgShadow::ShadowVolumeGeometry::DrawMode _drawMode; - bool _dynamicShadowVolumes; - - osg::ref_ptr _occluder; - - OpenThreads::Mutex _shadowVolumeMutex; - osg::ref_ptr _shadowVolume; - - osg::Vec4 _lightpos; - - osg::ref_ptr _ambientLight; - osg::ref_ptr _diffuseLight; - - osg::ref_ptr _ss1; - osg::ref_ptr _mainShadowStateSet; - osg::ref_ptr _shadowVolumeStateSet; - osg::ref_ptr _shadowedSceneStateSet; - - -}; - -} - -#endif diff --git a/include/osgShadow/StandardShadowMap b/include/osgShadow/StandardShadowMap index b0ec7f554e5..d6a3da6d5b5 100644 --- a/include/osgShadow/StandardShadowMap +++ b/include/osgShadow/StandardShadowMap @@ -61,7 +61,7 @@ class OSGSHADOW_EXPORT StandardShadowMap : public DebugShadowMap // Example: Imagine we want to swap base(0) and shadow(1) indices: // We have to do an extra step to make sure both do not end up as 1 // - // // initialy change base to something else than 1 + // // initially change base to something else than 1 // setBaseTextureCoordIndex( 100 ); // // now search and replace all gl_TexCord[1] to gl_TexCord[0] // setShadowTextureCoordIndex( 0 ); diff --git a/include/osgSim/SphereSegment b/include/osgSim/SphereSegment index ec451af81da..08fb38f388a 100644 --- a/include/osgSim/SphereSegment +++ b/include/osgSim/SphereSegment @@ -53,7 +53,7 @@ Caveats: - It's possible to render the whole sphere by specifying elevation and azimuth ranges round the full 360 degrees. When doing so you may consider switching the planes, spokes, and edge lines - off, to avoid rendering artefacts, e.g. the upper and lower + off, to avoid rendering artifacts, e.g. the upper and lower planes will be coincident. */ @@ -214,32 +214,36 @@ public: /** A list of vertex arrays representing a list of lines.*/ typedef std::vector< osg::ref_ptr > LineList; - /** Compute the interesection lines between subgraph and this sphere segment. - * The matrix is the transform that takes the subgraph into the same coordiante frame as the sphere segment. + /** Compute the intersection lines between subgraph and this sphere segment. + * The matrix is the transform that takes the subgraph into the same coordinate frame as the sphere segment. * The resulting intersections are in the coordinate frame of the sphere segment. */ LineList computeIntersection(const osg::Matrixd& matrix, osg::Node* subgraph); - /** Compute the interesection lines between specified drawable and this sphere segment. - * The matrix is the transform that takes the subgraph into the same coordiante frame as the sphere segment. + /** Compute the intersection lines between specified drawable and this sphere segment. + * The matrix is the transform that takes the subgraph into the same coordinate frame as the sphere segment. * The resulting intersections are in the coordinate frame of the sphere segment. */ LineList computeIntersection(const osg::Matrixd& matrix, osg::Drawable* drawable); - /** Compute the interesection lines between subgraph and this sphere segment. - * The matrix is the transform that takes the subgraph into the same coordiante frame as the sphere segment. + /** Compute the intersection lines between subgraph and this sphere segment. + * The matrix is the transform that takes the subgraph into the same coordinate frame as the sphere segment. * The resulting intersections are in the coordinate frame of the sphere segment. */ osg::Node* computeIntersectionSubgraph(const osg::Matrixd& matrix, osg::Node* subgraph); - /** Compute the interesection lines between specified drawable and this sphere segment. - * The matrix is the transform that takes the subgraph into the same coordiante frame as the sphere segment. + /** Compute the intersection lines between specified drawable and this sphere segment. + * The matrix is the transform that takes the subgraph into the same coordinate frame as the sphere segment. * The resulting intersections are in the coordinate frame of the sphere segment. */ osg::Node* computeIntersectionSubgraph(const osg::Matrixd& matrix, osg::Drawable* drawable); - /** recompute the vertex positions of the rendering meshes/lines thtat represent the sphere segment.*/ + /** recompute the vertex positions of the rendering meshes/lines that represent the sphere segment.*/ void updatePositions(); /** recompute the primitives rendering meshes/lines thtat represent the sphere segment.*/ void updatePrimitives(); + + virtual void resizeGLObjectBuffers(unsigned int maxSize); + virtual void releaseGLObjects(osg::State* state = 0) const; + virtual osg::BoundingSphere computeBound() const; private: diff --git a/include/osgTerrain/Layer b/include/osgTerrain/Layer index e4c5eb464ca..c7d8c6ad800 100644 --- a/include/osgTerrain/Layer +++ b/include/osgTerrain/Layer @@ -162,7 +162,7 @@ class OSGTERRAIN_EXPORT Layer : public osg::Object * @param[out] ir Returned X-axis fraction. * @param[out] jr Returned Y-axis fraction. */ - inline void computeIndices(double ndc_x, double ndc_y, unsigned int& i, unsigned int& j, double& ir, double& jr) + inline void computeIndices(double ndc_x, double ndc_y, unsigned int& i, unsigned int& j, double& ir, double& jr) const { ndc_x *= double(getNumColumns()-1); ndc_y *= double(getNumRows()-1); @@ -179,7 +179,7 @@ class OSGTERRAIN_EXPORT Layer : public osg::Object * @param[out] value Returned layer value. * @return true if value is valid, else false */ - inline bool getInterpolatedValue(double ndc_x, double ndc_y, float& value) + inline bool getInterpolatedValue(double ndc_x, double ndc_y, float& value) const { unsigned int i,j; double ir, jr; @@ -226,7 +226,7 @@ class OSGTERRAIN_EXPORT Layer : public osg::Object return false; } - inline bool getInterpolatedValidValue(double ndc_x, double ndc_y, float& value) + inline bool getInterpolatedValidValue(double ndc_x, double ndc_y, float& value) const { unsigned int i,j; double ir, jr; diff --git a/include/osgTerrain/TerrainTechnique b/include/osgTerrain/TerrainTechnique index 8c3d789bd1b..8b21f2d8aea 100644 --- a/include/osgTerrain/TerrainTechnique +++ b/include/osgTerrain/TerrainTechnique @@ -60,6 +60,7 @@ class OSGTERRAIN_EXPORT TerrainTechnique : public osg::Object, public osg::Obser META_Object(osgTerrain, TerrainTechnique); + virtual void setTerrainTile(TerrainTile* tile); TerrainTile* getTerrainTile() { return _terrainTile; } const TerrainTile* getTerrainTile() const { return _terrainTile; } @@ -80,17 +81,15 @@ class OSGTERRAIN_EXPORT TerrainTechnique : public osg::Object, public osg::Obser * for all graphics contexts. */ virtual void releaseGLObjects(osg::State* = 0) const {} - void addNeighbour(TerrainTile* tile) { _neighbours.addNeighbour(tile); } - void removeNeighbour(TerrainTile* tile) { _neighbours.removeNeighbour(tile); } - bool containsNeighbour(TerrainTile* tile) { return _neighbours.containsNeighbour(tile); } + virtual void addNeighbour(TerrainTile* tile) { _neighbours.addNeighbour(tile); } + virtual void removeNeighbour(TerrainTile* tile) { _neighbours.removeNeighbour(tile); } + virtual bool containsNeighbour(TerrainTile* tile) { return _neighbours.containsNeighbour(tile); } + protected: virtual ~TerrainTechnique(); - void setTerrainTile(TerrainTile* tile); - void setDirty(bool dirty); - friend class osgTerrain::TerrainTile; TerrainTile* _terrainTile; diff --git a/include/osgText/Font b/include/osgText/Font index ab4641c9304..7f359f3f98d 100644 --- a/include/osgText/Font +++ b/include/osgText/Font @@ -83,7 +83,7 @@ public: virtual std::string getFileName() const; - static osg::ref_ptr& getDefaultFont(); + static osg::ref_ptr getDefaultFont(); typedef std::vector< osg::ref_ptr > StateSets; StateSets& getCachedStateSets() { return _statesets; } diff --git a/include/osgText/Glyph b/include/osgText/Glyph index 2d1eafa058b..15d6b45f2d8 100644 --- a/include/osgText/Glyph +++ b/include/osgText/Glyph @@ -28,7 +28,7 @@ #include #include -#include +#include namespace osgText { @@ -126,6 +126,8 @@ protected: typedef std::vector< osg::ref_ptr > TextureInfoList; TextureInfoList _textureInfoList; + + mutable OpenThreads::ReentrantMutex _textureInfoListMutex; }; class OSGTEXT_EXPORT GlyphGeometry : public osg::Referenced diff --git a/include/osgText/String b/include/osgText/String index 3fb51e4ae75..cc89c72a756 100644 --- a/include/osgText/String +++ b/include/osgText/String @@ -60,7 +60,8 @@ class OSGTEXT_EXPORT String : public VectorUInt ENCODING_UTF32, /// 32-bit signature ENCODING_UTF32_BE, /// 32-bit big-endian ENCODING_UTF32_LE, /// 32-bit little-endian - ENCODING_SIGNATURE /// detect encoding from signature + ENCODING_SIGNATURE, /// detect encoding from signature + ENCODING_CURRENT_CODE_PAGE /// Use Windows Current Code Page ecoding }; diff --git a/include/osgText/Text b/include/osgText/Text index b2ae9c69599..5be160086b0 100644 --- a/include/osgText/Text +++ b/include/osgText/Text @@ -73,7 +73,7 @@ public: * placing text against noisy backgrounds. * The color of the background shadow text is specified by setBackdropColor(). * DROP_SHADOW_BOTTOM_RIGHT will draw backdrop text to the right and down of - * the normal text. Other DROW_SHADOW_* modes do the same for their repective directions. + * the normal text. Other DROP_SHADOW_* modes do the same for their respective directions. * OUTLINE will draw backdrop text so that it appears the text has an outline * or border around the normal text. This mode is particularly useful against * really noisy backgrounds that may put text on top of things that have @@ -265,7 +265,6 @@ protected: virtual osg::StateSet* createStateSet(); Font* getActiveFont(); - const Font* getActiveFont() const; String::iterator computeLastCharacterOnLine(osg::Vec2& cursor, String::iterator first,String::iterator last); @@ -282,9 +281,6 @@ protected: virtual void computePositionsImplementation(); - void computeBackdropBoundingBox(); - void computeBoundingBoxMargin(); - void computeColorGradients(); void computeColorGradientsOverall(); void computeColorGradientsPerCharacter(); diff --git a/include/osgText/TextBase b/include/osgText/TextBase index a674e3bd42e..1611a785c38 100644 --- a/include/osgText/TextBase +++ b/include/osgText/TextBase @@ -312,6 +312,7 @@ protected: // members which have public access. osg::Vec4 _color; osg::ref_ptr _font; + osg::ref_ptr _fontFallback; osg::ref_ptr