Compare commits
212 Commits
OpenSceneG
...
OpenSceneG
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
925270d909 | ||
|
|
dd1745896a | ||
|
|
6c1cbb1f48 | ||
|
|
5a939746cc | ||
|
|
606a32685e | ||
|
|
06558a5dda | ||
|
|
7505cb4603 | ||
|
|
8b20f0adef | ||
|
|
fee977ac90 | ||
|
|
62dbe7b85e | ||
|
|
ecaca716e9 | ||
|
|
df21f59779 | ||
|
|
e28f789ffa | ||
|
|
b7fa2d7914 | ||
|
|
51924943e2 | ||
|
|
969c1821be | ||
|
|
2695f29be0 | ||
|
|
78cb12b531 | ||
|
|
beb9bc3cf2 | ||
|
|
d11e84178f | ||
|
|
b14eecb3c7 | ||
|
|
9fb010fadd | ||
|
|
8a15f23c15 | ||
|
|
e260dfb582 | ||
|
|
b728587fab | ||
|
|
f29af50b76 | ||
|
|
8b2e02b71d | ||
|
|
5faae0e52e | ||
|
|
5d51e5bf2a | ||
|
|
159c0271b7 | ||
|
|
94d5211f43 | ||
|
|
219adb7419 | ||
|
|
b101b4b4d2 | ||
|
|
b8862d0420 | ||
|
|
8a0114a46a | ||
|
|
199035ae51 | ||
|
|
23b4345517 | ||
|
|
b5b0bed7c3 | ||
|
|
a531f2bd13 | ||
|
|
f36e9f2a4a | ||
|
|
b7c186f6d3 | ||
|
|
927d2f0f10 | ||
|
|
644251db98 | ||
|
|
295bfffc17 | ||
|
|
b4663ded94 | ||
|
|
44d3da02a9 | ||
|
|
4093860c32 | ||
|
|
0161b8ab46 | ||
|
|
417f78ac5e | ||
|
|
8195b9c8e7 | ||
|
|
5ca6759a1f | ||
|
|
9c7cde1db4 | ||
|
|
aed9fd74f6 | ||
|
|
39a78e075f | ||
|
|
b4eb001d14 | ||
|
|
6cd699e55f | ||
|
|
4b0bed8161 | ||
|
|
ddbed23537 | ||
|
|
a13f8cf4b4 | ||
|
|
fab1431e59 | ||
|
|
073cfab166 | ||
|
|
bf279a59fa | ||
|
|
4ad410969e | ||
|
|
f50d32547d | ||
|
|
8406442a96 | ||
|
|
7994bfa767 | ||
|
|
b8982224c3 | ||
|
|
8178b51956 | ||
|
|
a7a7c0de8b | ||
|
|
2ade061ced | ||
|
|
0415b7df84 | ||
|
|
43724f004e | ||
|
|
300ba7aa02 | ||
|
|
97a4094d76 | ||
|
|
6b95718d65 | ||
|
|
47ab799168 | ||
|
|
c3108697de | ||
|
|
ba70c7d543 | ||
|
|
855212548d | ||
|
|
47207248d4 | ||
|
|
e1e6e07de3 | ||
|
|
508cf89f9c | ||
|
|
f29ecc10a8 | ||
|
|
46505f66d3 | ||
|
|
fb63c5b0a5 | ||
|
|
2b64d30fca | ||
|
|
e0b288fe37 | ||
|
|
91cfc02700 | ||
|
|
b29fb0b870 | ||
|
|
6ca2487362 | ||
|
|
197fc401b4 | ||
|
|
16cd192562 | ||
|
|
2f043345c9 | ||
|
|
24fc34a440 | ||
|
|
decf339b74 | ||
|
|
889325b496 | ||
|
|
126623645f | ||
|
|
6c908e9081 | ||
|
|
e4373b0143 | ||
|
|
16a5e019c5 | ||
|
|
597441ca33 | ||
|
|
864b087b1f | ||
|
|
75d03de844 | ||
|
|
1bd75f464a | ||
|
|
d501def836 | ||
|
|
cdbec116fa | ||
|
|
68c5e6e6ca | ||
|
|
638069f93b | ||
|
|
a827840baf | ||
|
|
35f3876797 | ||
|
|
2e0472ba7e | ||
|
|
36e47d31bd | ||
|
|
994ea4d203 | ||
|
|
54ac72a126 | ||
|
|
6559295768 | ||
|
|
9b41f260d9 | ||
|
|
7a442801cd | ||
|
|
f3c615631b | ||
|
|
62cd8850e2 | ||
|
|
14e7bc5a17 | ||
|
|
5ac3a982ae | ||
|
|
a90a9a0a15 | ||
|
|
995e849e8a | ||
|
|
ddb72691bc | ||
|
|
817d92b703 | ||
|
|
8fb5ba4a3f | ||
|
|
3ef5d2b331 | ||
|
|
c64b94da2e | ||
|
|
19cf8b46c3 | ||
|
|
2568d1ac79 | ||
|
|
84ee98d9c4 | ||
|
|
49921bf300 | ||
|
|
b063f510c1 | ||
|
|
396cfca1ae | ||
|
|
aebc71a113 | ||
|
|
d8896f4bcb | ||
|
|
b2b6ee952b | ||
|
|
fbe4e1cf2f | ||
|
|
2b9c501e18 | ||
|
|
3930621edc | ||
|
|
9305485a11 | ||
|
|
9e75926338 | ||
|
|
d969516595 | ||
|
|
457d12d9b2 | ||
|
|
61c7ee76c5 | ||
|
|
605821e655 | ||
|
|
d1ff16614c | ||
|
|
8551f25da0 | ||
|
|
315031fa3b | ||
|
|
f4fe1e5cec | ||
|
|
7e8665308d | ||
|
|
c50b699992 | ||
|
|
cd5740e98f | ||
|
|
023bfb8bbb | ||
|
|
c5ff9e63df | ||
|
|
e5e5ea6239 | ||
|
|
9ae47b921b | ||
|
|
994b066329 | ||
|
|
ad82aea2e3 | ||
|
|
5f2a3ef76f | ||
|
|
2e7a7d786a | ||
|
|
67523373a9 | ||
|
|
f38fa9e9c3 | ||
|
|
99b2fffa7c | ||
|
|
3fbf24759f | ||
|
|
d215b255c4 | ||
|
|
51fee80224 | ||
|
|
fefabb6c2b | ||
|
|
27e3f57da2 | ||
|
|
56835cf821 | ||
|
|
445596e59c | ||
|
|
c0ea4c6310 | ||
|
|
ddea94b41c | ||
|
|
5f1e33fcb3 | ||
|
|
46e17699b3 | ||
|
|
38807c4bb8 | ||
|
|
987521ba9c | ||
|
|
6776cc2c63 | ||
|
|
3fe2e5a9e0 | ||
|
|
0d94d8e5a6 | ||
|
|
c8e283cfe9 | ||
|
|
b1314c0fb8 | ||
|
|
a86b90ca4a | ||
|
|
bc3372fda0 | ||
|
|
6477397b95 | ||
|
|
8f6eff9de5 | ||
|
|
c4e7a07367 | ||
|
|
23b7c4d47d | ||
|
|
a9900712a4 | ||
|
|
6774f77779 | ||
|
|
5516f86f9e | ||
|
|
a9546da368 | ||
|
|
415925b024 | ||
|
|
30aae63c3b | ||
|
|
694b1c3d32 | ||
|
|
a2436fa8b5 | ||
|
|
64d9b51f91 | ||
|
|
a3b507bb01 | ||
|
|
cbac09902d | ||
|
|
515a0bbe65 | ||
|
|
0c142215b9 | ||
|
|
dcc6dce8e3 | ||
|
|
7b3d1dff25 | ||
|
|
842b334803 | ||
|
|
8f5695eafb | ||
|
|
0a704161fe | ||
|
|
149c04b0df | ||
|
|
92abaca210 | ||
|
|
0e5bb43841 | ||
|
|
b3808ef89c | ||
|
|
99847c3ef2 | ||
|
|
0a6bea870c |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -89,6 +89,7 @@ PlatformSpecifics/Windows/*.rc
|
|||||||
|
|
||||||
# Visual Studio - Cache/Options Directory
|
# Visual Studio - Cache/Options Directory
|
||||||
.vs/
|
.vs/
|
||||||
|
.vscode/*
|
||||||
|
|
||||||
#osx xcode
|
#osx xcode
|
||||||
DerivedData/
|
DerivedData/
|
||||||
|
|||||||
@@ -3,13 +3,13 @@
|
|||||||
#
|
#
|
||||||
SET(OPENSCENEGRAPH_MAJOR_VERSION 3)
|
SET(OPENSCENEGRAPH_MAJOR_VERSION 3)
|
||||||
SET(OPENSCENEGRAPH_MINOR_VERSION 6)
|
SET(OPENSCENEGRAPH_MINOR_VERSION 6)
|
||||||
SET(OPENSCENEGRAPH_PATCH_VERSION 4)
|
SET(OPENSCENEGRAPH_PATCH_VERSION 5)
|
||||||
SET(OPENSCENEGRAPH_SOVERSION 160)
|
SET(OPENSCENEGRAPH_SOVERSION 162)
|
||||||
|
|
||||||
|
|
||||||
# set to 0 when not a release candidate, non zero means that any generated
|
# 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
|
# git tags will be treated as release candidates of given number
|
||||||
SET(OPENSCENEGRAPH_RELEASE_CANDIDATE 9)
|
SET(OPENSCENEGRAPH_RELEASE_CANDIDATE 0)
|
||||||
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE)
|
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE)
|
||||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||||
|
|
||||||
@@ -30,6 +30,9 @@ if(COMMAND cmake_policy)
|
|||||||
cmake_policy(SET CMP0017 NEW)
|
cmake_policy(SET CMP0017 NEW)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# INTERPROCEDURAL_OPTIMIZATION is enforced when enabled.
|
||||||
|
# Allows passing -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON
|
||||||
|
cmake_policy(SET CMP0069 NEW)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
IF(APPLE)
|
IF(APPLE)
|
||||||
@@ -73,18 +76,19 @@ ELSEIF(APPLE)
|
|||||||
SET (IPHONE_ENABLE_BITCODE "NO" CACHE STRING "IOS Enable Bitcode")
|
SET (IPHONE_ENABLE_BITCODE "NO" CACHE STRING "IOS Enable Bitcode")
|
||||||
|
|
||||||
# seamless toggle between device and simulator
|
# seamless toggle between device and simulator
|
||||||
SET(CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphoneos;-iphonesimulator")
|
SET(CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphoneos;-iphonesimulator" CACHE STRING "Xcode effective platforms for iOS")
|
||||||
|
|
||||||
# set deployment target to min version
|
# set deployment target to min version
|
||||||
SET(CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "${IPHONE_VERSION_MIN}" CACHE STRING "Deployment target for iOS" FORCE)
|
SET(CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "${IPHONE_VERSION_MIN}" CACHE STRING "Xcode deployment target for iOS")
|
||||||
|
|
||||||
# Set standard architectures
|
# Set standard architectures
|
||||||
SET(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD)")
|
SET(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD)" CACHE STRING "Build architectures for iOS")
|
||||||
|
|
||||||
ELSE()
|
ELSE()
|
||||||
# OSX >= 10.5 uses Cocoa windowing system, otherwise Carbon
|
# OSX >= 10.5 uses Cocoa windowing system, otherwise Carbon
|
||||||
IF(OSG_OSX_VERSION VERSION_LESS 10.5)
|
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" 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()
|
ELSE()
|
||||||
SET(OSG_WINDOWING_SYSTEM "Cocoa" CACHE STRING "Windowing system type for graphics window creation; options: Carbon, Cocoa, X11 or None.")
|
SET(OSG_WINDOWING_SYSTEM "Cocoa" CACHE STRING "Windowing system type for graphics window creation; options: Carbon, Cocoa, X11 or None.")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
@@ -117,6 +121,9 @@ ELSE()
|
|||||||
SET(OSG_WINDOWING_SYSTEM "X11" CACHE STRING "Windowing system type for graphics window creation; options: X11 or None.")
|
SET(OSG_WINDOWING_SYSTEM "X11" CACHE STRING "Windowing system type for graphics window creation; options: X11 or None.")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
IF(OSG_WINDOWING_SYSTEM STREQUAL "None")
|
||||||
|
SET(OSG_WINDOWING_SYSTEM_NONE ON INTERNAL "No windowing system")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
SET(OPENSCENEGRAPH_VERSION ${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION})
|
SET(OPENSCENEGRAPH_VERSION ${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION})
|
||||||
|
|
||||||
@@ -352,7 +359,9 @@ IF(WIN32 AND NOT ANDROID)
|
|||||||
OPTION(MSVC_DISABLE_CHECKED_ITERATORS "Set to ON to disable Visual C++ checked iterators. If you do this you must ensure that every other project in your solution and all dependencies are compiled with _SECURE_SCL=0." OFF)
|
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)
|
MARK_AS_ADVANCED(MSVC_DISABLE_CHECKED_ITERATORS)
|
||||||
IF(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_SECURE_SCL=0)
|
||||||
|
ADD_DEFINITIONS(-D_HAS_ITERATOR_DEBUGGING=0)
|
||||||
ENDIF(MSVC_DISABLE_CHECKED_ITERATORS)
|
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)
|
OPTION(MSVC_USE_DEFAULT_STACK_SIZE "Set to ON to use the default Visual C++ stack size. CMake forces a high stack size by default, which can cause problems for applications with large number of threads." OFF)
|
||||||
@@ -722,7 +731,9 @@ OPTION(BUILD_OSG_PLUGINS "Build OSG Plugins - Disable for compile testing exampl
|
|||||||
mark_as_advanced(BUILD_OSG_PLUGINS)
|
mark_as_advanced(BUILD_OSG_PLUGINS)
|
||||||
################################################################################
|
################################################################################
|
||||||
# 3rd Party Dependency Stuff
|
# 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)
|
INCLUDE(Find3rdPartyDependencies)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
@@ -733,7 +744,7 @@ OPTION(OSG_USE_LOCAL_LUA_SOURCE "Enable to use local Lua source when building th
|
|||||||
# you can use the following style of command line option when invoking Cmake (here illustrating ignoring PythonLibs) :
|
# you can use the following style of command line option when invoking Cmake (here illustrating ignoring PythonLibs) :
|
||||||
# cmake -DCMAKE_DISABLE_FIND_PACKAGE_PythonLibs=1 .
|
# cmake -DCMAKE_DISABLE_FIND_PACKAGE_PythonLibs=1 .
|
||||||
#
|
#
|
||||||
IF(ANDROID)
|
IF(ANDROID AND OSG_FIND_3RD_PARTY_DEPS)
|
||||||
ANDROID_3RD_PARTY()
|
ANDROID_3RD_PARTY()
|
||||||
ELSE()
|
ELSE()
|
||||||
# Common to all platforms except android:
|
# Common to all platforms except android:
|
||||||
@@ -810,7 +821,7 @@ ENDIF(BUILD_OSG_EXAMPLES AND NOT ANDROID)
|
|||||||
|
|
||||||
# Image readers/writers depend on 3rd party libraries except for OS X which
|
# Image readers/writers depend on 3rd party libraries except for OS X which
|
||||||
# can use Quicktime.
|
# can use Quicktime.
|
||||||
IF(NOT ANDROID)
|
IF(NOT (ANDROID AND OSG_FIND_3RD_PARTY_DEPS))
|
||||||
IF(NOT APPLE)
|
IF(NOT APPLE)
|
||||||
FIND_PACKAGE(GIFLIB)
|
FIND_PACKAGE(GIFLIB)
|
||||||
FIND_PACKAGE(JPEG)
|
FIND_PACKAGE(JPEG)
|
||||||
|
|||||||
@@ -15,8 +15,20 @@ FIND_PATH(ASIO_INCLUDE_DIR
|
|||||||
|
|
||||||
SET(ASIO_FOUND "NO")
|
SET(ASIO_FOUND "NO")
|
||||||
IF(ASIO_INCLUDE_DIR)
|
IF(ASIO_INCLUDE_DIR)
|
||||||
FIND_PACKAGE( Boost 1.37 )
|
|
||||||
IF(Boost_FOUND)
|
set(ASIO_VERSION_H ${ASIO_INCLUDE_DIR}/asio/version.hpp)
|
||||||
SET(ASIO_FOUND "YES")
|
file(STRINGS ${ASIO_VERSION_H} AsioVersionLine REGEX "^#define ASIO_VERSION ")
|
||||||
ENDIF()
|
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()
|
ENDIF()
|
||||||
|
|||||||
@@ -25,17 +25,22 @@ ELSEIF(MSVC10)
|
|||||||
SET(FBX_LIBDIR "vs2010")
|
SET(FBX_LIBDIR "vs2010")
|
||||||
ELSEIF(MSVC11)
|
ELSEIF(MSVC11)
|
||||||
SET(FBX_LIBDIR "vs2012")
|
SET(FBX_LIBDIR "vs2012")
|
||||||
ELSEIF(MSVC12 OR MSVC_VERSION==1800)
|
ELSEIF(MSVC_VERSION EQUAL 1800)
|
||||||
SET(FBX_LIBDIR "vs2013")
|
SET(FBX_LIBDIR "vs2013")
|
||||||
ELSEIF(MSVC14 OR MSVC_VERSION>1900)
|
ELSEIF(MSVC_VERSION EQUAL 1900)
|
||||||
SET(FBX_LIBDIR "vs2015")
|
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()
|
ENDIF()
|
||||||
|
|
||||||
IF(APPLE)
|
IF(APPLE)
|
||||||
# do nothing
|
# do nothing
|
||||||
ELSEIF(CMAKE_CL_64)
|
ELSEIF(CMAKE_CL_64)
|
||||||
SET(FBX_LIBDIR ${FBX_LIBDIR}/x64)
|
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)
|
SET(FBX_LIBDIR ${FBX_LIBDIR}/x64)
|
||||||
ELSE()
|
ELSE()
|
||||||
SET(FBX_LIBDIR ${FBX_LIBDIR}/x86)
|
SET(FBX_LIBDIR ${FBX_LIBDIR}/x86)
|
||||||
@@ -53,6 +58,10 @@ ELSE()
|
|||||||
SET(FBX_LIBNAME "libfbxsdk")
|
SET(FBX_LIBNAME "libfbxsdk")
|
||||||
ELSE()
|
ELSE()
|
||||||
SET(FBX_LIBNAME "libfbxsdk-md")
|
SET(FBX_LIBNAME "libfbxsdk-md")
|
||||||
|
IF(WIN32)
|
||||||
|
SET(FBX_XML2_LIBNAME "libxml2-md")
|
||||||
|
SET(FBX_ZLIB_LIBNAME "zlib-md")
|
||||||
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
@@ -60,19 +69,41 @@ SET(FBX_LIBNAME_DEBUG ${FBX_LIBNAME}d)
|
|||||||
|
|
||||||
SET( FBX_SEARCH_PATHS
|
SET( FBX_SEARCH_PATHS
|
||||||
$ENV{FBX_DIR}
|
$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{ProgramW6432}/Autodesk/FBX/FBX SDK/2019.0"
|
||||||
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2019.0"
|
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2019.0"
|
||||||
"/Applications/Autodesk/FBX\ SDK/2019.0"
|
"/Applications/Autodesk/FBX SDK/2019.0"
|
||||||
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2018.1.1"
|
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2018.1.1"
|
||||||
"$ENV{PROGRAMFILES}/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{ProgramW6432}/Autodesk/FBX/FBX SDK/2017.1"
|
||||||
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2017.1"
|
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2017.1"
|
||||||
"/Applications/Autodesk/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{ProgramW6432}/Autodesk/FBX/FBX SDK/2016.1.2"
|
||||||
"$ENV{PROGRAMFILES}/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{ProgramW6432}/Autodesk/FBX/FBX SDK/2016.1.1"
|
||||||
"$ENV{PROGRAMFILES}/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{ProgramW6432}/Autodesk/FBX/FBX SDK/2015.1"
|
||||||
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2015.1"
|
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2015.1"
|
||||||
"/Applications/Autodesk/FBX/FBX SDK/2015.1"
|
"/Applications/Autodesk/FBX/FBX SDK/2015.1"
|
||||||
@@ -101,6 +132,21 @@ FIND_LIBRARY( FBX_LIBRARY_DEBUG ${FBX_LIBNAME_DEBUG}
|
|||||||
PATHS ${FBX_SEARCH_PATHS}
|
PATHS ${FBX_SEARCH_PATHS}
|
||||||
PATH_SUFFIXES "lib/${FBX_LIBDIR}")
|
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)
|
IF(FBX_LIBRARY AND FBX_LIBRARY_DEBUG AND FBX_INCLUDE_DIR)
|
||||||
SET(FBX_FOUND "YES")
|
SET(FBX_FOUND "YES")
|
||||||
ELSE()
|
ELSE()
|
||||||
|
|||||||
@@ -1,37 +1,34 @@
|
|||||||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||||
|
#[[=======================================================================.rst:
|
||||||
#[=======================================================================[.rst:
|
# FindFontconfig
|
||||||
FindFontconfig
|
# --------------
|
||||||
--------------
|
#
|
||||||
|
# Find Fontconfig headers and library.
|
||||||
Find Fontconfig headers and library.
|
#
|
||||||
|
# Imported Targets
|
||||||
Imported Targets
|
# ^^^^^^^^^^^^^^^^
|
||||||
^^^^^^^^^^^^^^^^
|
#
|
||||||
|
# ``Fontconfig::Fontconfig``
|
||||||
``Fontconfig::Fontconfig``
|
# The Fontconfig library, if found.
|
||||||
The Fontconfig library, if found.
|
#
|
||||||
|
# Result Variables
|
||||||
Result Variables
|
# ^^^^^^^^^^^^^^^^
|
||||||
^^^^^^^^^^^^^^^^
|
#
|
||||||
|
# This will define the following variables in your project:
|
||||||
This will define the following variables in your project:
|
#
|
||||||
|
# ``FONTCONFIG_FOUND``
|
||||||
``FONTCONFIG_FOUND``
|
# true if (the requested version of) Fontconfig is available.
|
||||||
true if (the requested version of) Fontconfig is available.
|
# ``FONTCONFIG_VERSION``
|
||||||
``FONTCONFIG_VERSION``
|
# the version of Fontconfig.
|
||||||
the version of Fontconfig.
|
# ``FONTCONFIG_LIBRARIES``
|
||||||
``FONTCONFIG_LIBRARIES``
|
# the libraries to link against to use Fontconfig.
|
||||||
the libraries to link against to use Fontconfig.
|
# ``FONTCONFIG_INCLUDE_DIRS``
|
||||||
``FONTCONFIG_INCLUDE_DIRS``
|
# where to find the Fontconfig headers.
|
||||||
where to find the Fontconfig headers.
|
# ``FONTCONFIG_COMPILE_OPTIONS``
|
||||||
``FONTCONFIG_COMPILE_OPTIONS``
|
# this should be passed to target_compile_options(), if the
|
||||||
this should be passed to target_compile_options(), if the
|
# target is not used for linking
|
||||||
target is not used for linking
|
#=======================================================================]]
|
||||||
|
|
||||||
#]=======================================================================]
|
|
||||||
|
|
||||||
|
|
||||||
# use pkg-config to get the directories and then use these values
|
# use pkg-config to get the directories and then use these values
|
||||||
# in the FIND_PATH() and FIND_LIBRARY() calls
|
# in the FIND_PATH() and FIND_LIBRARY() calls
|
||||||
|
|||||||
@@ -101,5 +101,8 @@ if(LIBLAS_LIBRARY AND LIBLAS_INCLUDE_DIR)
|
|||||||
if(Boost_FOUND)
|
if(Boost_FOUND)
|
||||||
set(LIBLAS_LIBRARIES ${LIBLAS_LIBRARY} )
|
set(LIBLAS_LIBRARIES ${LIBLAS_LIBRARY} )
|
||||||
set(LIBLAS_FOUND "YES")
|
set(LIBLAS_FOUND "YES")
|
||||||
|
if(WIN32)
|
||||||
|
link_directories(${Boost_LIBRARY_DIRS})
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
# correspond to the ./configure --prefix=$OPENCASCADE_DIR
|
# correspond to the ./configure --prefix=$OPENCASCADE_DIR
|
||||||
# used in building OPENCASCADE.
|
# used in building OPENCASCADE.
|
||||||
|
|
||||||
FIND_PATH(OPENCASCADE_INCLUDE_DIR BRepMesh.hxx
|
FIND_PATH(OPENCASCADE_INCLUDE_DIR Standard_Version.hxx
|
||||||
PATHS
|
PATHS
|
||||||
${OPENCASCADE_DIR}
|
${OPENCASCADE_DIR}
|
||||||
$ENV{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_TKXmlTObj TKXmlTObj)
|
||||||
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXmlXCAF TKXmlXCAF)
|
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXmlXCAF TKXmlXCAF)
|
||||||
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXSBase TKXSBase)
|
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXSBase TKXSBase)
|
||||||
|
FIND_OPENCASCADE_LIBRARY(OPENCASCADE_TKXCAF TKXCAF)
|
||||||
|
|
||||||
set (OPENCASCADE_LIBRARY_TYPE_DESCR
|
set (OPENCASCADE_LIBRARY_TYPE_DESCR
|
||||||
"Specifies the type of library to be used. 'Shared' libraries
|
"Specifies the type of library to be used. 'Shared' libraries
|
||||||
|
|||||||
@@ -34,8 +34,17 @@ INSTALL(
|
|||||||
|
|
||||||
IF(MSVC AND DYNAMIC_OPENSCENEGRAPH)
|
IF(MSVC AND DYNAMIC_OPENSCENEGRAPH)
|
||||||
GET_TARGET_PROPERTY(PREFIX ${LIB_NAME} PREFIX)
|
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)
|
IF("${PREFIX}" STREQUAL PREFIX-NOTFOUND) # Fix for PREFIX-NOTFOUND left in file names
|
||||||
INSTALL(FILES ${OUTPUT_BINDIR}/${PREFIX}${LIB_NAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph CONFIGURATIONS Debug)
|
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)
|
ENDIF(MSVC AND DYNAMIC_OPENSCENEGRAPH)
|
||||||
|
|
||||||
IF(NOT OSG_COMPILE_FRAMEWORKS)
|
IF(NOT OSG_COMPILE_FRAMEWORKS)
|
||||||
|
|||||||
@@ -342,15 +342,20 @@ MACRO(SETUP_PLUGIN PLUGIN_NAME)
|
|||||||
ENDIF()
|
ENDIF()
|
||||||
SETUP_LINK_LIBRARIES()
|
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)
|
IF(WIN32)
|
||||||
INSTALL(TARGETS ${TARGET_TARGETNAME}
|
INSTALL(TARGETS ${TARGET_TARGETNAME}
|
||||||
RUNTIME DESTINATION bin COMPONENT ${PACKAGE_COMPONENT}
|
RUNTIME DESTINATION bin COMPONENT ${PACKAGE_COMPONENT}
|
||||||
ARCHIVE DESTINATION lib/${OSG_PLUGINS} COMPONENT libopenscenegraph-dev
|
ARCHIVE DESTINATION lib/${OSG_PLUGINS} COMPONENT libopenscenegraph-dev
|
||||||
LIBRARY DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT})
|
LIBRARY DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT})
|
||||||
IF(MSVC AND DYNAMIC_OPENSCENEGRAPH)
|
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)
|
IF( ${CMAKE_GENERATOR} STREQUAL "Ninja" )
|
||||||
INSTALL(FILES ${OUTPUT_BINDIR}/${OSG_PLUGINS}/${TARGET_TARGETNAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT} CONFIGURATIONS Debug)
|
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)
|
ENDIF(MSVC AND DYNAMIC_OPENSCENEGRAPH)
|
||||||
ELSE(WIN32)
|
ELSE(WIN32)
|
||||||
INSTALL(TARGETS ${TARGET_TARGETNAME}
|
INSTALL(TARGETS ${TARGET_TARGETNAME}
|
||||||
@@ -458,8 +463,8 @@ MACRO(SETUP_APPLICATION APPLICATION_NAME)
|
|||||||
ELSE(APPLE)
|
ELSE(APPLE)
|
||||||
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION bin COMPONENT openscenegraph )
|
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION bin COMPONENT openscenegraph )
|
||||||
IF(MSVC)
|
IF(MSVC)
|
||||||
INSTALL(FILES ${CMAKE_BINARY_DIR}/bin/${TARGET_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION bin COMPONENT openscenegraph CONFIGURATIONS RelWithDebInfo)
|
INSTALL(FILES ${OUTPUT_BINDIR}/${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_DEBUG_POSTFIX}.pdb DESTINATION bin COMPONENT openscenegraph CONFIGURATIONS Debug)
|
||||||
ENDIF(MSVC)
|
ENDIF(MSVC)
|
||||||
ENDIF(APPLE)
|
ENDIF(APPLE)
|
||||||
|
|
||||||
@@ -491,8 +496,8 @@ MACRO(SETUP_EXAMPLE EXAMPLE_NAME)
|
|||||||
ELSE(APPLE)
|
ELSE(APPLE)
|
||||||
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION share/OpenSceneGraph/bin COMPONENT openscenegraph-examples )
|
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION share/OpenSceneGraph/bin COMPONENT openscenegraph-examples )
|
||||||
IF(MSVC)
|
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 ${OUTPUT_BINDIR}/${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_DEBUG_POSTFIX}.pdb DESTINATION share/OpenSceneGraph/bin COMPONENT openscenegraph-examples CONFIGURATIONS Debug)
|
||||||
ENDIF(MSVC)
|
ENDIF(MSVC)
|
||||||
ENDIF(APPLE)
|
ENDIF(APPLE)
|
||||||
|
|
||||||
|
|||||||
527
ChangeLog
527
ChangeLog
@@ -1,3 +1,530 @@
|
|||||||
|
Fri, 31 Jan 2020 11:02:47 +0000
|
||||||
|
Author : Robert Osfield
|
||||||
|
Updates for 3.6.5 release
|
||||||
|
|
||||||
|
Fri, 31 Jan 2020 10:37:25 +0000
|
||||||
|
Author : Robert Osfield
|
||||||
|
Added mutex lock to avoid threading issues when glyphs are added to a Font from multiple threads
|
||||||
|
|
||||||
|
Thu, 30 Jan 2020 19:25:50 +0000
|
||||||
|
Author : Robert Osfield
|
||||||
|
Updates for 3.6.5-rc3
|
||||||
|
|
||||||
|
Thu, 30 Jan 2020 16:30:41 +0000
|
||||||
|
Author : OpenSceneGraph git repository
|
||||||
|
Merge pull request #911 from LaurensVoerman/FbxSdkFixFix for older versions of fbxsdk without xml or zlib libraries,
|
||||||
|
|
||||||
|
Thu, 30 Jan 2020 16:21:32 +0000
|
||||||
|
Author : Robert Osfield
|
||||||
|
Added explicit clean up removeView
|
||||||
|
|
||||||
|
Thu, 30 Jan 2020 16:32:42 +0100
|
||||||
|
Author : Laurens Voerman
|
||||||
|
Fix for older versions of fbxsdk without xml or zlib libraries, fix cmake multiconfig generators (msvc) with irrelevant CMAKE_BUILD_TYPE.
|
||||||
|
|
||||||
|
Mon, 27 Jan 2020 10:11:23 +0000
|
||||||
|
Author : OpenSceneGraph git repository
|
||||||
|
Merge pull request #907 from DeadParrot/OpenSceneGraph-3.6FBX plugin updates / PREFIX-NOTFOUND work-around
|
||||||
|
|
||||||
|
Sun, 26 Jan 2020 14:28:56 -0500
|
||||||
|
Author : Stuart Mentzer
|
||||||
|
FBX plugin updates / PREFIX-NOTFOUND work-around
|
||||||
|
|
||||||
|
Tue, 21 Jan 2020 10:11:30 +0000
|
||||||
|
Author : Robert Osfield
|
||||||
|
Updater rc number for 3.6.5-rc2, and CHangeLog
|
||||||
|
|
||||||
|
Tue, 21 Jan 2020 09:43:08 +0000
|
||||||
|
Author : Robert Osfield
|
||||||
|
Removed stray space
|
||||||
|
|
||||||
|
Tue, 21 Jan 2020 09:32:57 +0000
|
||||||
|
Author : OpenSceneGraph git repository
|
||||||
|
Merge pull request #902 from mp3butcher/oqn3.6 OQN API convergence
|
||||||
|
|
||||||
|
Tue, 21 Jan 2020 09:16:51 +0000
|
||||||
|
Author : OpenSceneGraph git repository
|
||||||
|
Merge pull request #903 from dedowsdi/renderstageAdd getPreRenderList, getPostRenderList to RenderStage.
|
||||||
|
|
||||||
|
Fri, 17 Jan 2020 18:47:49 +0800
|
||||||
|
Author : dedowsdi
|
||||||
|
Add getPreRenderList getPostRenderList to RenderStage.
|
||||||
|
|
||||||
|
Fri, 23 Aug 2019 09:59:54 +0200
|
||||||
|
Author : Daniel Trstenjak
|
||||||
|
OcclusionQueryNode: make all usages of 'updateDefaultQueryGeometry' thread safe
|
||||||
|
|
||||||
|
Fri, 23 Aug 2019 09:46:02 +0200
|
||||||
|
Author : Daniel Trstenjak
|
||||||
|
OcclusionQueryNode: fix resetting to default query geometryWhen the query geometry gets reset to its default then its
|
||||||
|
vertices have to be updated by the bounding box dimensions of
|
||||||
|
the current children of the OcclusionQueryNode.
|
||||||
|
|
||||||
|
|
||||||
|
Wed, 14 Aug 2019 11:27:40 +0200
|
||||||
|
Author : Daniel Trstenjak
|
||||||
|
OcclusionQueryNode: fix use case of user defined query geometryThe user defined query geometry handling has been broken in several ways.
|
||||||
|
|
||||||
|
The previous way of defining a query geometry was using the non const
|
||||||
|
`getQueryGeometry` method and overriding its members. But then
|
||||||
|
`OcclusionQueryNode` wasn't aware of the geometry change and couldn't
|
||||||
|
internally handle it correctly.
|
||||||
|
|
||||||
|
The `computeBound` method never considered a user defined query geometry and
|
||||||
|
always just overrode the vertices of the geometry.
|
||||||
|
|
||||||
|
The member `_validQueryGeometry` wasn't correctly set.
|
||||||
|
|
||||||
|
This change should fix all this issues by introducing a small backward
|
||||||
|
compatibility break. The non const `getQueryGeometry` method is removed
|
||||||
|
forcing the user to use the `setQueryGeometry` method. But then `OcclusionQueryNode`
|
||||||
|
is aware of the user defined query geometry and can handle it correctly.
|
||||||
|
|
||||||
|
|
||||||
|
Tue, 29 Jan 2019 14:40:16 +0100
|
||||||
|
Author : Daniel Trstenjak
|
||||||
|
OcclusionQueryNode: reset the test result of the invalid geometryThere're cases that the occlusion test result has been retrieved
|
||||||
|
after the query geometry has been changed, it's the result of the
|
||||||
|
geometry before the change.
|
||||||
|
|
||||||
|
|
||||||
|
Tue, 29 Jan 2019 11:37:28 +0100
|
||||||
|
Author : Daniel Trstenjak
|
||||||
|
OcclusionQueryNode: ensure a valid query geometryIf the query geometry is invalid then don't do any occlusion queries and
|
||||||
|
never traverse the subgraphs.
|
||||||
|
|
||||||
|
|
||||||
|
Fri, 25 Jan 2019 15:02:45 +0100
|
||||||
|
Author : Daniel Trstenjak
|
||||||
|
OcclusionQueryNode: ensure a consistent value for '_passed'
|
||||||
|
|
||||||
|
Sat, 26 Jan 2019 16:33:23 +0000
|
||||||
|
Author : Robert Osfield
|
||||||
|
Introduced a QueryGeometry::getQueryResult(const osg::Camera*) method as a more informative replacedment for QueryGeometry::getNumPixels().
|
||||||
|
|
||||||
|
Mon, 20 Jan 2020 10:37:12 +0000
|
||||||
|
Author : OpenSceneGraph git repository
|
||||||
|
Merge pull request #900 from dedowsdi/fix_particle_rotationFix particle rotation.
|
||||||
|
|
||||||
|
Fri, 17 Jan 2020 11:18:30 +0800
|
||||||
|
Author : dedowsdi
|
||||||
|
Fix particle rotation.
|
||||||
|
|
||||||
|
Fri, 17 Jan 2020 09:28:09 +0000
|
||||||
|
Author : Robert Osfield
|
||||||
|
Updated ChangeLog
|
||||||
|
|
||||||
|
Fri, 17 Jan 2020 09:07:58 +0000
|
||||||
|
Author : Robert Osfield
|
||||||
|
Moved setting of isftream locale to Model::readOBJ(..) and Model::readMTL(..).
|
||||||
|
|
||||||
|
Fri, 17 Jan 2020 08:54:52 +0000
|
||||||
|
Author : Robert Osfield
|
||||||
|
Added explict setting of local to classic to avoid local platform settings affecting parsing
|
||||||
|
|
||||||
|
Tue, 14 Jan 2020 16:32:29 +0000
|
||||||
|
Author : Robert Osfield
|
||||||
|
Updated README.md for 3.6.5-rc1
|
||||||
|
|
||||||
|
Tue, 14 Jan 2020 16:30:14 +0000
|
||||||
|
Author : Robert Osfield
|
||||||
|
Updated ChangeLog and set rc candidate 1 for 3.6.5-rc1
|
||||||
|
|
||||||
|
Tue, 14 Jan 2020 16:29:07 +0000
|
||||||
|
Author : Robert Osfield
|
||||||
|
Fixed warnings
|
||||||
|
|
||||||
|
Tue, 14 Jan 2020 14:57:15 +0000
|
||||||
|
Author : Robert Osfield
|
||||||
|
Fixed build warning due to auto_ptr<>
|
||||||
|
|
||||||
|
Tue, 14 Jan 2020 14:42:01 +0000
|
||||||
|
Author : Robert Osfield
|
||||||
|
Fixed workaround for invalid indices
|
||||||
|
|
||||||
|
Mon, 13 Jan 2020 14:14:48 +0000
|
||||||
|
Author : OpenSceneGraph git repository
|
||||||
|
Merge pull request #895 from openscenegraph/CurrentThreadIdAdded commment explaining that OpenThreads::Thread::CurrentThread() r…
|
||||||
|
|
||||||
|
Mon, 13 Jan 2020 14:12:54 +0000
|
||||||
|
Author : Robert Osfield
|
||||||
|
Added commment explaining that OpenThreads::Thread::CurrentThread() return NULL on non OpenThreads thread.
|
||||||
|
|
||||||
|
Mon, 13 Jan 2020 13:41:37 +0000
|
||||||
|
Author : Robert Osfield
|
||||||
|
Added support for using CurrentCodePage functionality with osgText::String To the DXF plugin added Option string support for using CurrentCodePage|WidePage, UTF8, UTF16, UTF32 and FontFile=filename
|
||||||
|
|
||||||
|
Mon, 13 Jan 2020 09:58:47 +0000
|
||||||
|
Author : Robert Osfield
|
||||||
|
Added encoding and font setting to dxfText as a first step towards making these user controllable to enble handling of non default settings
|
||||||
|
|
||||||
|
Sat, 11 Jan 2020 14:39:46 +0000
|
||||||
|
Author : Robert Osfield
|
||||||
|
Added creation of image directories when required
|
||||||
|
|
||||||
|
Fri, 10 Jan 2020 10:12:13 +0000
|
||||||
|
Author : Robert Osfield
|
||||||
|
Fixed handling of _autoScaleTransitionWidthRatio<=0.0
|
||||||
|
|
||||||
|
Tue, 7 Jan 2020 11:12:18 +0000
|
||||||
|
Author : Robert Osfield
|
||||||
|
Implemented TextBase::compileGLObjects() with handling of VAO/VBOs to address bugs associated with VAO usage of Text.
|
||||||
|
|
||||||
|
Mon, 6 Jan 2020 18:39:51 +0000
|
||||||
|
Author : Robert Osfield
|
||||||
|
Added Thread::CurrentThreadId() method to wrap up thread id functionality in a more platform appropriate way.
|
||||||
|
|
||||||
|
Mon, 6 Jan 2020 10:27:18 +0000
|
||||||
|
Author : OpenSceneGraph git repository
|
||||||
|
Merge pull request #887 from limbolily/patch-1Fix navagation error about Android GLES2 example.
|
||||||
|
|
||||||
|
Mon, 6 Jan 2020 14:48:34 +0800
|
||||||
|
Author : limbolily
|
||||||
|
Fix navagation error about Android GLES2 example.Android GLES2 example use event queue without initializing window rectangle with graphics context,that produce navigation error.
|
||||||
|
|
||||||
|
Mon, 23 Dec 2019 14:20:26 +0100
|
||||||
|
Author : Michael Danilov
|
||||||
|
Fix #877 "Shift key stuck if both shifts switch keymap"Adapted the patch from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=687332
|
||||||
|
|
||||||
|
|
||||||
|
Mon, 23 Dec 2019 14:53:17 +0000
|
||||||
|
Author : Robert Osfield
|
||||||
|
Adopted CMake's FindDCMTK.cmake variables
|
||||||
|
|
||||||
|
Sun, 22 Dec 2019 12:29:47 +0000
|
||||||
|
Author : OpenSceneGraph git repository
|
||||||
|
Merge pull request #874 from blobfish/occt7.4Occt7.4
|
||||||
|
|
||||||
|
Thu, 19 Dec 2019 11:46:05 -0500
|
||||||
|
Author : blobfish
|
||||||
|
Plugins: OpenCasCade: Adding 'std' prefix where needed. See Following.Prior to 7.4, occt had a 'using namespace std' in a header file that
|
||||||
|
was polluting dependent projects. They have since fixed it and so these
|
||||||
|
changes are required.
|
||||||
|
|
||||||
|
|
||||||
|
Thu, 19 Dec 2019 10:16:09 -0500
|
||||||
|
Author : blobfish
|
||||||
|
Plugins: Cmake: OpenCasCade: Changing header used for include directory search. See Following.BRepMesh.hxx is gone in occt 7.4. Now searching for Standard_Version.hxx, which should be more consistent.
|
||||||
|
|
||||||
|
|
||||||
|
Wed, 18 Dec 2019 14:25:07 +0000
|
||||||
|
Author : Robert Osfield
|
||||||
|
Added classic locale setting to avoid local setting of locale affecting the GLSL code generated.
|
||||||
|
|
||||||
|
Mon, 16 Dec 2019 17:10:39 +0000
|
||||||
|
Author : Robert Osfield
|
||||||
|
Updated ChangeLog
|
||||||
|
|
||||||
|
Mon, 16 Dec 2019 16:51:16 +0000
|
||||||
|
Author : Robert Osfield
|
||||||
|
Added automatically removal from the OjbectCache when a object or it's subgraph contain Texture that no longer have an osg::Image.
|
||||||
|
|
||||||
|
Mon, 16 Dec 2019 11:54:12 +0000
|
||||||
|
Author : OpenSceneGraph git repository
|
||||||
|
Merge pull request #871 from LaurensVoerman/commit_tgaFixfix debug compile error for ReaderWriterTGA
|
||||||
|
|
||||||
|
Mon, 16 Dec 2019 11:02:41 +0100
|
||||||
|
Author : Laurens Voerman
|
||||||
|
fix debug compile error for ReaderWriterTGA
|
||||||
|
|
||||||
|
Mon, 16 Dec 2019 09:40:30 +0000
|
||||||
|
Author : OpenSceneGraph git repository
|
||||||
|
Merge pull request #870 from eligovision/OpenSceneGraph-3.6_glext_fixGLExtensions's isPBOSupported and isVAOSupported flags fixed
|
||||||
|
|
||||||
|
Mon, 16 Dec 2019 09:40:00 +0000
|
||||||
|
Author : OpenSceneGraph git repository
|
||||||
|
Merge pull request #869 from eligovision/OpenSceneGraph-3.6_glextAdded FBO GL extensions (useful for mobile VR etc.)
|
||||||
|
|
||||||
|
Fri, 13 Dec 2019 19:40:11 +0300
|
||||||
|
Author : konstantin.matveyev
|
||||||
|
GLExtensions's isPBOSupported and isVAOSupported flags fixed for GLES2+GLES3 configuration
|
||||||
|
|
||||||
|
Fri, 13 Dec 2019 19:42:30 +0300
|
||||||
|
Author : konstantin.matveyev
|
||||||
|
GLExtensions's isInvalidateFramebufferSupported flag improved
|
||||||
|
|
||||||
|
Tue, 26 Nov 2019 17:17:38 +0800
|
||||||
|
Author : PntAndCnt
|
||||||
|
Fontconfig should be external library.Add Fontconfig to TARGET_LIBRARIES cause osg3::osgText target looking for
|
||||||
|
openscegraph-Fontconfig-import-targets.cmake, which doesn't exists.
|
||||||
|
|
||||||
|
|
||||||
|
Sun, 13 Oct 2019 20:24:36 +0800
|
||||||
|
Author : PntAndCnt
|
||||||
|
Fix a typo and invisible 3dtext in examples/osgtext.Second text alignment is wrong when "--alignment" specified.
|
||||||
|
|
||||||
|
3D text radius is too small, only SCREEN_COORDS can be seen.
|
||||||
|
|
||||||
|
Text position should multiply radius.
|
||||||
|
|
||||||
|
|
||||||
|
Tue, 3 Sep 2019 16:11:14 +0800
|
||||||
|
Author : Kent
|
||||||
|
Mered fix for internalFormat
|
||||||
|
|
||||||
|
Thu, 12 Dec 2019 18:41:23 +0300
|
||||||
|
Author : valid-ptr
|
||||||
|
glInvalidateFramebuffer added to GLExtensions
|
||||||
|
|
||||||
|
Thu, 31 Oct 2019 18:59:04 +0300
|
||||||
|
Author : konstantin.matveyev
|
||||||
|
glFramebufferTexture2DMultisample added to GLExtensions
|
||||||
|
|
||||||
|
Tue, 10 Dec 2019 15:08:25 +0300
|
||||||
|
Author : Dmitry Marakasov
|
||||||
|
Add FreeBSD-specific code bits for pthread_setaffinity_np support
|
||||||
|
|
||||||
|
Thu, 12 Dec 2019 13:25:44 +0000
|
||||||
|
Author : Robert Osfield
|
||||||
|
Fix linking with Xinerama
|
||||||
|
|
||||||
|
Thu, 12 Dec 2019 13:09:33 +0000
|
||||||
|
Author : OpenSceneGraph git repository
|
||||||
|
Merge pull request #861 from aluaces/default-ffmpegSet ffmpeg as the default plugin for video files.
|
||||||
|
|
||||||
|
Fri, 22 Nov 2019 21:07:36 +0100
|
||||||
|
Author : elsid
|
||||||
|
Fix clang 8 & libc++ build errorsReplace operators for implicit type conversion by explicit data() method to
|
||||||
|
access implementation pointer and subscript operator to access element by
|
||||||
|
index just like in std::vector.
|
||||||
|
|
||||||
|
src/osgPlugins/tga/ReaderWriterTGA.cpp:455:22: error: use of overloaded operator '==' is ambiguous (with operand types 'SafeArray<unsigned char>' and 'long')
|
||||||
|
if (colormap == NULL)
|
||||||
|
~~~~~~~~ ^ ~~~~
|
||||||
|
src/osgPlugins/tga/ReaderWriterTGA.cpp:525:16: error: use of overloaded operator '==' is ambiguous (with operand types 'SafeArray<unsigned char>' and 'long')
|
||||||
|
if (buffer == NULL || linebuf == NULL)
|
||||||
|
~~~~~~ ^ ~~~~
|
||||||
|
src/osgPlugins/tga/ReaderWriterTGA.cpp:525:35: error: use of overloaded operator '==' is ambiguous (with operand types 'SafeArray<unsigned char>' and 'long')
|
||||||
|
if (buffer == NULL || linebuf == NULL)
|
||||||
|
~~~~~~~ ^ ~~~~
|
||||||
|
src/osgPlugins/tga/ReaderWriterTGA.cpp:548:30: error: use of overloaded operator '==' is ambiguous (with operand types 'SafeArray<unsigned char>' and 'long')
|
||||||
|
if (formattedMap == NULL)
|
||||||
|
~~~~~~~~~~~~ ^ ~~~~
|
||||||
|
src/osgPlugins/tga/ReaderWriterTGA.cpp:574:40: error: use of overloaded operator '[]' is ambiguous (with operand types 'SafeArray<unsigned char>' and 'int')
|
||||||
|
index = linebuf[x];
|
||||||
|
~~~~~~~^~
|
||||||
|
src/osgPlugins/tga/ReaderWriterTGA.cpp:577:50: error: use of overloaded operator '+' is ambiguous (with operand types 'SafeArray<unsigned char>' and 'int')
|
||||||
|
index = getInt16(linebuf + x * 2);
|
||||||
|
~~~~~~~ ^ ~~~~~
|
||||||
|
src/osgPlugins/tga/ReaderWriterTGA.cpp:580:50: error: use of overloaded operator '+' is ambiguous (with operand types 'SafeArray<unsigned char>' and 'int')
|
||||||
|
index = getInt24(linebuf + x * 3);
|
||||||
|
~~~~~~~ ^ ~~~~~
|
||||||
|
src/osgPlugins/tga/ReaderWriterTGA.cpp:583:50: error: use of overloaded operator '+' is ambiguous (with operand types 'SafeArray<unsigned char>' and 'int')
|
||||||
|
index = getInt32(linebuf + x * 4);
|
||||||
|
~~~~~~~ ^ ~~~~~
|
||||||
|
src/osgPlugins/tga/ReaderWriterTGA.cpp:592:72: error: use of overloaded operator '+' is ambiguous (with operand types 'SafeArray<unsigned char>' and 'int')
|
||||||
|
(dest + adjustedX * format)[i] = (formattedMap + index * format)[i];
|
||||||
|
~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~
|
||||||
|
src/osgPlugins/tga/ReaderWriterTGA.cpp:626:30: error: use of overloaded operator '==' is ambiguous (with operand types 'SafeArray<unsigned char>' and 'long')
|
||||||
|
if (formattedMap == NULL)
|
||||||
|
~~~~~~~~~~~~ ^ ~~~~
|
||||||
|
src/osgPlugins/tga/ReaderWriterTGA.cpp:642:21: error: use of overloaded operator '==' is ambiguous (with operand types 'SafeArray<unsigned char>' and 'long')
|
||||||
|
if (buf == NULL)
|
||||||
|
~~~ ^ ~~~~
|
||||||
|
src/osgPlugins/tga/ReaderWriterTGA.cpp:664:44: error: use of overloaded operator '[]' is ambiguous (with operand types 'SafeArray<unsigned char>' and 'int')
|
||||||
|
index = linebuf[x];
|
||||||
|
~~~~~~~^~
|
||||||
|
src/osgPlugins/tga/ReaderWriterTGA.cpp:667:54: error: use of overloaded operator '+' is ambiguous (with operand types 'SafeArray<unsigned char>' and 'int')
|
||||||
|
index = getInt16(linebuf + x * 2);
|
||||||
|
~~~~~~~ ^ ~~~~~
|
||||||
|
src/osgPlugins/tga/ReaderWriterTGA.cpp:670:54: error: use of overloaded operator '+' is ambiguous (with operand types 'SafeArray<unsigned char>' and 'int')
|
||||||
|
index = getInt24(linebuf + x * 3);
|
||||||
|
~~~~~~~ ^ ~~~~~
|
||||||
|
src/osgPlugins/tga/ReaderWriterTGA.cpp:673:54: error: use of overloaded operator '+' is ambiguous (with operand types 'SafeArray<unsigned char>' and 'int')
|
||||||
|
index = getInt32(linebuf + x * 4);
|
||||||
|
~~~~~~~ ^ ~~~~~
|
||||||
|
src/osgPlugins/tga/ReaderWriterTGA.cpp:688:76: error: use of overloaded operator '+' is ambiguous (with operand types 'SafeArray<unsigned char>' and 'int')
|
||||||
|
(dest + adjustedX * format)[i] = (formattedMap + index * format)[i];
|
||||||
|
~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~
|
||||||
|
src/osgPlugins/tga/ReaderWriterTGA.cpp:708:21: error: use of overloaded operator '==' is ambiguous (with operand types 'SafeArray<unsigned char>' and 'long')
|
||||||
|
if (buf == NULL)
|
||||||
|
~~~ ^ ~~~~
|
||||||
|
17 errors generated.
|
||||||
|
|
||||||
|
|
||||||
|
Thu, 12 Dec 2019 10:55:35 +0000
|
||||||
|
Author : OpenSceneGraph git repository
|
||||||
|
Fixed indentation, replacing tabs with spaces
|
||||||
|
|
||||||
|
Mon, 4 Nov 2019 05:37:37 +0100
|
||||||
|
Author : Tim Moore
|
||||||
|
Fix bug in matrix transpose() and transpose3x3The diagonal elements were not copied from the source matrix.
|
||||||
|
|
||||||
|
|
||||||
|
Fri, 1 Nov 2019 09:26:28 -0700
|
||||||
|
Author : flashk
|
||||||
|
Support reading RGB float DDS imagesThe DDS plugin is not able to load floating point RGB images saved out by itself. There doesn't appear to be a fourcc code for RGB float/half-float data, so I added the appropriate entries to the RGBFormat table so the images can be loaded properly.
|
||||||
|
|
||||||
|
Thu, 12 Dec 2019 10:08:32 +0000
|
||||||
|
Author : OpenSceneGraph git repository
|
||||||
|
Merge pull request #851 from LaurensVoerman/submitCpSubImgfix copySubImage crash on compressed files
|
||||||
|
|
||||||
|
Wed, 25 Sep 2019 12:16:51 -0500
|
||||||
|
Author : DCFennell
|
||||||
|
GL_CLAMP_VERTEX_COLOR and GL_CLAMP_FRAGMENT_COLOR deprecated in GL core profile according to OpenGL 4.5 specification.
|
||||||
|
|
||||||
|
Mon, 23 Sep 2019 15:05:54 +0200
|
||||||
|
Author : Johannes Pabst
|
||||||
|
Fix: LuaCallbackObject could form circular references to LuaScriptEngine that prevented its destruction. Destruction of LuaScriptEngine now disarms all callbacks into Lua.
|
||||||
|
|
||||||
|
Fri, 13 Sep 2019 12:50:29 +0200
|
||||||
|
Author : Riccardo Corsi
|
||||||
|
Fbx Plugin: added plugin option to set the target axis system. Default left to OpenGL.
|
||||||
|
|
||||||
|
Thu, 12 Sep 2019 13:54:28 -0700
|
||||||
|
Author : grdowns
|
||||||
|
Add vcpkg installation instructions
|
||||||
|
|
||||||
|
Wed, 11 Dec 2019 17:51:02 +0000
|
||||||
|
Author : OpenSceneGraph git repository
|
||||||
|
Merge pull request #837 from LaurensVoerman/carbonFixfix apple carbon reference
|
||||||
|
|
||||||
|
Wed, 11 Dec 2019 17:07:27 +0000
|
||||||
|
Author : OpenSceneGraph git repository
|
||||||
|
Merge pull request #833 from cj-mcdonald/osga-fixUpdate ReaderWriterOSGA.cpp
|
||||||
|
|
||||||
|
Fri, 30 Aug 2019 16:48:25 +0200
|
||||||
|
Author : Guilhem Saurel
|
||||||
|
fix dae readme
|
||||||
|
|
||||||
|
Wed, 11 Dec 2019 16:58:50 +0000
|
||||||
|
Author : OpenSceneGraph git repository
|
||||||
|
Merge pull request #828 from eligovision/OpenSceneGraph-3.6_ios_build_fixFix build iOS: when using Toolchain or building with Makefiles (not X…
|
||||||
|
|
||||||
|
Wed, 11 Dec 2019 16:47:44 +0000
|
||||||
|
Author : OpenSceneGraph git repository
|
||||||
|
Merge pull request #822 from mp3butcher/patch-32optimize indexed color DDS conversion
|
||||||
|
|
||||||
|
Wed, 4 Dec 2019 22:10:46 +0100
|
||||||
|
Author : Alberto Luaces
|
||||||
|
Set ffmpeg as the default plugin for video files.As xine is not used anymore, there is no plugin in charge of loading
|
||||||
|
video files, and osgmovie and other programs are not able to open
|
||||||
|
them.
|
||||||
|
|
||||||
|
If ffmpeg is present, it is registered for opening video files.
|
||||||
|
|
||||||
|
|
||||||
|
Fri, 1 Nov 2019 16:42:50 +0100
|
||||||
|
Author : Laurens Voerman
|
||||||
|
fix copySubImage crash on compressed files
|
||||||
|
|
||||||
|
Wed, 11 Sep 2019 10:22:16 +0200
|
||||||
|
Author : Laurens Voerman
|
||||||
|
fix apple carbon reference
|
||||||
|
|
||||||
|
Mon, 2 Sep 2019 17:43:38 +0100
|
||||||
|
Author : Colin McDonald
|
||||||
|
Update ReaderWriterOSGA.cppFix typo in osga archives which stops node files working
|
||||||
|
|
||||||
|
Fri, 23 Aug 2019 18:31:22 +0300
|
||||||
|
Author : Konstantin S. Matveyev
|
||||||
|
Fix build iOS: when using Toolchain or building with Makefiles (not Xcode)
|
||||||
|
|
||||||
|
Sun, 18 Aug 2019 17:56:51 +0200
|
||||||
|
Author : Julien Valentin
|
||||||
|
use memcpy instead of union
|
||||||
|
|
||||||
|
Sat, 17 Aug 2019 22:05:38 +0200
|
||||||
|
Author : Julien Valentin
|
||||||
|
optimize conversion with a union
|
||||||
|
|
||||||
|
Thu, 22 Aug 2019 14:49:43 +0100
|
||||||
|
Author : Robert Osfield
|
||||||
|
Removed exlict keyword to address build problems with VS older than 2015.
|
||||||
|
|
||||||
|
Sun, 18 Aug 2019 20:14:17 +0200
|
||||||
|
Author : Remo E
|
||||||
|
Debugging: Hint to debug LoadLibrary issuesThis helps to debug loading dynamic libraries in an environment without implemented "dlopen". For example emscripten with static compiled OSG.
|
||||||
|
|
||||||
|
Sat, 17 Aug 2019 20:04:38 +0100
|
||||||
|
Author : Robert Osfield
|
||||||
|
Merge branch 'OpenSceneGraph-3.6' of https://github.com/openscenegraph/OpenSceneGraph into OpenSceneGraph-3.6
|
||||||
|
|
||||||
|
Sat, 17 Aug 2019 20:04:30 +0100
|
||||||
|
Author : OpenSceneGraph git repository
|
||||||
|
Merge pull request #820 from Capostrophic/ddsDDS plugin: add support for DDPF_PALETTEINDEXED8 pixel format reading
|
||||||
|
|
||||||
|
Fri, 16 Aug 2019 13:52:56 +0200
|
||||||
|
Author : Björn Blissing
|
||||||
|
Fixed spelling error in warning message
|
||||||
|
|
||||||
|
Sat, 17 Aug 2019 15:11:49 +0300
|
||||||
|
Author : capostrophic
|
||||||
|
Fix memory leaks
|
||||||
|
|
||||||
|
Sat, 17 Aug 2019 01:43:47 +0300
|
||||||
|
Author : capostrophic
|
||||||
|
Add support for DDPF_PALETTEINDEXED8 pixel format reading
|
||||||
|
|
||||||
|
Fri, 16 Aug 2019 10:27:28 +0100
|
||||||
|
Author : Robert Osfield
|
||||||
|
Added TKXCAF to find package list
|
||||||
|
|
||||||
|
Thu, 15 Aug 2019 20:21:15 +0200
|
||||||
|
Author : Julien Valentin
|
||||||
|
remove return of local pointer
|
||||||
|
|
||||||
|
Fri, 16 Aug 2019 09:35:00 +0100
|
||||||
|
Author : OpenSceneGraph git repository
|
||||||
|
Merge pull request #818 from mp3butcher/patch-31fix comment block CMake syntax
|
||||||
|
|
||||||
|
Thu, 15 Aug 2019 20:46:52 +0200
|
||||||
|
Author : Julien Valentin
|
||||||
|
fix cmake block comment syntax
|
||||||
|
|
||||||
|
Thu, 15 Aug 2019 20:27:05 +0200
|
||||||
|
Author : Julien Valentin
|
||||||
|
remove unproperly parsed CMake commenthttps://github.com/openscenegraph/OpenSceneGraph/issues/812
|
||||||
|
|
||||||
|
Wed, 7 Aug 2019 10:56:59 +0100
|
||||||
|
Author : OpenSceneGraph git repository
|
||||||
|
Merge pull request #808 from 640kb/OpenSceneGraph-3.6las plugin: fix linking against static boost library under windows
|
||||||
|
|
||||||
|
Wed, 7 Aug 2019 09:49:16 +0200
|
||||||
|
Author : Daniel Wendt
|
||||||
|
las plugin: fix linking against static boost library under windowsSigned-off-by: Daniel Wendt <daniel.wendt@linux.com>
|
||||||
|
|
||||||
|
|
||||||
|
Wed, 31 Jul 2019 14:11:59 +0100
|
||||||
|
Author : Robert Osfield
|
||||||
|
Added a _fontFallback to TextBase to cache any fallback font (usually DefaultFont) that is used when the Textbase::_font is null.
|
||||||
|
|
||||||
|
Mon, 29 Jul 2019 13:01:00 +0100
|
||||||
|
Author : Robert Osfield
|
||||||
|
Replaced GL_QUADS usage with GL_TRIANGLE_STRIP
|
||||||
|
|
||||||
|
Mon, 29 Jul 2019 12:29:25 +0100
|
||||||
|
Author : Robert Osfield
|
||||||
|
Refactored the mesh setup to use GL_TRIANGLE_STIP instead of GL_QUADS
|
||||||
|
|
||||||
|
Mon, 29 Jul 2019 09:59:57 +0100
|
||||||
|
Author : Robert Osfield
|
||||||
|
Updated version to 3.6.5
|
||||||
|
|
||||||
|
Mon, 29 Jul 2019 08:57:56 +0100
|
||||||
|
Author : OpenSceneGraph git repository
|
||||||
|
Merge pull request #804 from eligovision/OpenSceneGraph-3.6_GLQUADS[*] ParticleSystem: Use GL_TRIANGLES instead if GL_QUADS when GL{1,2}…
|
||||||
|
|
||||||
|
Fri, 26 Jul 2019 21:14:45 +0300
|
||||||
|
Author : Konstantin S. Matveyev
|
||||||
|
[*] ParticleSystem: Use GL_TRIANGLES instead if GL_QUADS when GL{1,2} or GLES1 are unavailable
|
||||||
|
|
||||||
|
Fri, 26 Jul 2019 12:54:16 +0100
|
||||||
|
Author : OpenSceneGraph git repository
|
||||||
|
Merge pull request #802 from eligovision/OpenSceneGraph-3.6_osgtext_fcOSG_TEXT_USE_FONTCONFIG cmake option added: Set to ON to enable attem…
|
||||||
|
|
||||||
|
Fri, 26 Jul 2019 14:40:47 +0300
|
||||||
|
Author : konstantin.matveyev
|
||||||
|
OSG_TEXT_USE_FONTCONFIG additional check needed
|
||||||
|
|
||||||
|
Fri, 26 Jul 2019 14:09:36 +0300
|
||||||
|
Author : konstantin.matveyev
|
||||||
|
OSG_TEXT_USE_FONTCONFIG cmake option added: Set to ON to enable attempt to use FontConfig in osgText; Disabled by default for iOS and Android
|
||||||
|
|
||||||
|
Thu, 25 Jul 2019 15:10:36 +0100
|
||||||
|
Author : Robert Osfield
|
||||||
|
UPdated for 3.6.3-rc9
|
||||||
|
|
||||||
Thu, 25 Jul 2019 14:58:17 +0100
|
Thu, 25 Jul 2019 14:58:17 +0100
|
||||||
Author : Robert Osfield
|
Author : Robert Osfield
|
||||||
Changed the #extension enable
|
Changed the #extension enable
|
||||||
|
|||||||
21
README.md
21
README.md
@@ -7,13 +7,13 @@
|
|||||||
|
|
||||||
Welcome to the OpenSceneGraph (OSG).
|
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:
|
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.
|
Robert Osfield.
|
||||||
Project Lead.
|
Project Lead.
|
||||||
25th July 2019.
|
31th January 2020.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Section 1. How to build OpenSceneGraph
|
## 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.
|
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:
|
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.
|
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:
|
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.
|
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:
|
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.
|
## Section 2. Release notes on macOS build, by Eric Sokolowski et al.
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#if !defined (WIN32) || defined(__CYGWIN__)
|
#if !defined (_WIN32) || defined(__CYGWIN__)
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
#elif defined (__APPLE__)
|
#elif defined (__APPLE__)
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/sockio.h>
|
#include <sys/sockio.h>
|
||||||
#elif defined (WIN32)
|
#elif defined (_WIN32)
|
||||||
#include <winsock.h>
|
#include <winsock.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#elif defined (__hpux)
|
#elif defined (__hpux)
|
||||||
@@ -63,7 +63,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||||
#include <winsock.h>
|
#include <winsock.h>
|
||||||
#else
|
#else
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@@ -265,7 +265,7 @@ Receiver::Receiver( void )
|
|||||||
|
|
||||||
Receiver::~Receiver( void )
|
Receiver::~Receiver( void )
|
||||||
{
|
{
|
||||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||||
closesocket( _so);
|
closesocket( _so);
|
||||||
#else
|
#else
|
||||||
close( _so );
|
close( _so );
|
||||||
@@ -274,7 +274,7 @@ Receiver::~Receiver( void )
|
|||||||
|
|
||||||
bool Receiver::init( void )
|
bool Receiver::init( void )
|
||||||
{
|
{
|
||||||
#if defined(WIN32) && !defined(__CYGWIN__)
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||||
WORD version = MAKEWORD(1,1);
|
WORD version = MAKEWORD(1,1);
|
||||||
WSADATA wsaData;
|
WSADATA wsaData;
|
||||||
// First, we start up Winsock
|
// First, we start up Winsock
|
||||||
@@ -295,7 +295,7 @@ bool Receiver::init( void )
|
|||||||
|
|
||||||
int result = 0;
|
int result = 0;
|
||||||
|
|
||||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||||
// const BOOL on = TRUE;
|
// const BOOL on = TRUE;
|
||||||
// setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, (const char*) &on, sizeof(int));
|
// setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, (const char*) &on, sizeof(int));
|
||||||
#else
|
#else
|
||||||
@@ -305,14 +305,14 @@ bool Receiver::init( void )
|
|||||||
|
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
OSG_NOTICE<<"Warning: Reciever::init() setsockopt(..) failed, errno="<<errno<<std::endl;
|
OSG_NOTICE<<"Warning: Receiver::init() setsockopt(..) failed, errno="<<errno<<std::endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// struct sockaddr_in saddr;
|
// struct sockaddr_in saddr;
|
||||||
saddr.sin_family = AF_INET;
|
saddr.sin_family = AF_INET;
|
||||||
saddr.sin_port = htons( _port );
|
saddr.sin_port = htons( _port );
|
||||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||||
saddr.sin_addr.s_addr = htonl(INADDR_ANY);
|
saddr.sin_addr.s_addr = htonl(INADDR_ANY);
|
||||||
#else
|
#else
|
||||||
saddr.sin_addr.s_addr = 0;
|
saddr.sin_addr.s_addr = 0;
|
||||||
@@ -366,7 +366,7 @@ void Receiver::sync( void )
|
|||||||
tv.tv_sec = 0;
|
tv.tv_sec = 0;
|
||||||
tv.tv_usec = 0;
|
tv.tv_usec = 0;
|
||||||
|
|
||||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||||
// saddr.sin_port = htons( _port );
|
// saddr.sin_port = htons( _port );
|
||||||
int result = recvfrom( _so, (char *)_buffer, _buffer_size, 0, (sockaddr*)&saddr, &size );
|
int result = recvfrom( _so, (char *)_buffer, _buffer_size, 0, (sockaddr*)&saddr, &size );
|
||||||
// recvfrom(sock_Receive, szMessage, 256, 0, (sockaddr*)&addr_Cli, &clilen)
|
// recvfrom(sock_Receive, szMessage, 256, 0, (sockaddr*)&addr_Cli, &clilen)
|
||||||
@@ -419,7 +419,7 @@ Broadcaster::Broadcaster( void )
|
|||||||
|
|
||||||
Broadcaster::~Broadcaster( void )
|
Broadcaster::~Broadcaster( void )
|
||||||
{
|
{
|
||||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||||
closesocket( _so);
|
closesocket( _so);
|
||||||
#else
|
#else
|
||||||
close( _so );
|
close( _so );
|
||||||
@@ -428,7 +428,7 @@ Broadcaster::~Broadcaster( void )
|
|||||||
|
|
||||||
bool Broadcaster::init( void )
|
bool Broadcaster::init( void )
|
||||||
{
|
{
|
||||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||||
WORD version = MAKEWORD(1,1);
|
WORD version = MAKEWORD(1,1);
|
||||||
WSADATA wsaData;
|
WSADATA wsaData;
|
||||||
// First, we start up Winsock
|
// First, we start up Winsock
|
||||||
@@ -446,7 +446,7 @@ bool Broadcaster::init( void )
|
|||||||
perror( "Socket" );
|
perror( "Socket" );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||||
const BOOL on = TRUE;
|
const BOOL on = TRUE;
|
||||||
#else
|
#else
|
||||||
int on = 1;
|
int on = 1;
|
||||||
@@ -454,7 +454,7 @@ bool Broadcaster::init( void )
|
|||||||
|
|
||||||
int result = 0;
|
int result = 0;
|
||||||
|
|
||||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||||
result = setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, (const char *) &on, sizeof(int));
|
result = setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, (const char *) &on, sizeof(int));
|
||||||
#else
|
#else
|
||||||
result = setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
|
result = setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
|
||||||
@@ -466,24 +466,24 @@ bool Broadcaster::init( void )
|
|||||||
saddr.sin_port = htons( _port );
|
saddr.sin_port = htons( _port );
|
||||||
if( _address == 0 )
|
if( _address == 0 )
|
||||||
{
|
{
|
||||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||||
result = setsockopt( _so, SOL_SOCKET, SO_BROADCAST, (const char *) &on, sizeof(int));
|
result = setsockopt( _so, SOL_SOCKET, SO_BROADCAST, (const char *) &on, sizeof(int));
|
||||||
#else
|
#else
|
||||||
result = setsockopt( _so, SOL_SOCKET, SO_BROADCAST, &on, sizeof(on));
|
result = setsockopt( _so, SOL_SOCKET, SO_BROADCAST, &on, sizeof(on));
|
||||||
#endif
|
#endif
|
||||||
if (result) return false;
|
if (result) return false;
|
||||||
|
|
||||||
#if !defined (WIN32) || defined(__CYGWIN__)
|
#if !defined (_WIN32) || defined(__CYGWIN__)
|
||||||
struct ifreq ifr;
|
struct ifreq ifr;
|
||||||
#endif
|
#endif
|
||||||
#if defined (__linux) || defined(__CYGWIN__)
|
#if defined (__linux) || defined(__CYGWIN__)
|
||||||
strcpy( ifr.ifr_name, "eth0" );
|
strcpy( ifr.ifr_name, "eth0" );
|
||||||
#elif defined(__sun)
|
#elif defined(__sun)
|
||||||
strcpy( ifr.ifr_name, "hme0" );
|
strcpy( ifr.ifr_name, "hme0" );
|
||||||
#elif !defined (WIN32)
|
#elif !defined (_WIN32)
|
||||||
strcpy( ifr.ifr_name, "ef0" );
|
strcpy( ifr.ifr_name, "ef0" );
|
||||||
#endif
|
#endif
|
||||||
#if defined (WIN32) // get the server address
|
#if defined (_WIN32) // get the server address
|
||||||
saddr.sin_addr.s_addr = htonl(INADDR_BROADCAST);
|
saddr.sin_addr.s_addr = htonl(INADDR_BROADCAST);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@@ -543,7 +543,7 @@ void Broadcaster::sync( void )
|
|||||||
}
|
}
|
||||||
|
|
||||||
int result = 0;
|
int result = 0;
|
||||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||||
unsigned int size = sizeof( SOCKADDR_IN );
|
unsigned int size = sizeof( SOCKADDR_IN );
|
||||||
result = sendto( _so, (const char *)_buffer, _buffer_size, 0, (struct sockaddr *)&saddr, size );
|
result = sendto( _so, (const char *)_buffer, _buffer_size, 0, (struct sockaddr *)&saddr, size );
|
||||||
// int err = WSAGetLastError ();
|
// int err = WSAGetLastError ();
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
#include <osgViewer/Viewer>
|
#include <osgViewer/Viewer>
|
||||||
|
|
||||||
#if !defined(WIN32) || defined(__CYGWIN__)
|
#if !defined(_WIN32) || defined(__CYGWIN__)
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#else
|
#else
|
||||||
#include "winsock.h"
|
#include "winsock.h"
|
||||||
@@ -51,7 +51,7 @@ class Receiver
|
|||||||
bool init( void );
|
bool init( void );
|
||||||
|
|
||||||
private :
|
private :
|
||||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||||
SOCKET _so;
|
SOCKET _so;
|
||||||
SOCKADDR_IN saddr;
|
SOCKADDR_IN saddr;
|
||||||
#else
|
#else
|
||||||
@@ -94,7 +94,7 @@ class Broadcaster
|
|||||||
bool init( void );
|
bool init( void );
|
||||||
|
|
||||||
private :
|
private :
|
||||||
#if defined(WIN32) && !defined(__CYGWIN__)
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||||
SOCKET _so;
|
SOCKET _so;
|
||||||
#else
|
#else
|
||||||
int _so;
|
int _so;
|
||||||
@@ -103,7 +103,7 @@ class Broadcaster
|
|||||||
short _port;
|
short _port;
|
||||||
void *_buffer;
|
void *_buffer;
|
||||||
unsigned int _buffer_size;
|
unsigned int _buffer_size;
|
||||||
#if defined(WIN32) && !defined(__CYGWIN__)
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||||
SOCKADDR_IN saddr;
|
SOCKADDR_IN saddr;
|
||||||
#else
|
#else
|
||||||
struct sockaddr_in saddr;
|
struct sockaddr_in saddr;
|
||||||
|
|||||||
@@ -508,7 +508,7 @@ int main( int argc, char **argv )
|
|||||||
|
|
||||||
viewer.addEventHandler( new osgViewer::WindowSizeHandler() );
|
viewer.addEventHandler( new osgViewer::WindowSizeHandler() );
|
||||||
|
|
||||||
// neeed to address.
|
// need to address.
|
||||||
// viewer.getScene()->getUpdateVisitor()->setTraversalMode(osg::NodeVisitor::TRAVERSE_ACTIVE_CHILDREN);
|
// viewer.getScene()->getUpdateVisitor()->setTraversalMode(osg::NodeVisitor::TRAVERSE_ACTIVE_CHILDREN);
|
||||||
|
|
||||||
|
|
||||||
@@ -558,7 +558,7 @@ int main( int argc, char **argv )
|
|||||||
while (arguments.read("--loop")) loopPresentation = true;
|
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.
|
// default to osg::NodeVisitor::TRAVERSE_ACTIVE_CHILDREN.
|
||||||
osg::NodeVisitor::TraversalMode updateTraversalMode = osg::NodeVisitor::TRAVERSE_ACTIVE_CHILDREN; // viewer.getUpdateVisitor()->getTraversalMode();
|
osg::NodeVisitor::TraversalMode updateTraversalMode = osg::NodeVisitor::TRAVERSE_ACTIVE_CHILDREN; // viewer.getUpdateVisitor()->getTraversalMode();
|
||||||
|
|
||||||
@@ -690,7 +690,7 @@ int main( int argc, char **argv )
|
|||||||
// any option left unread are converted into errors to write out later.
|
// any option left unread are converted into errors to write out later.
|
||||||
//arguments.reportRemainingOptionsAsUnrecognized();
|
//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())
|
if (arguments.errors())
|
||||||
{
|
{
|
||||||
arguments.writeErrorMessages(osg::notify(osg::INFO));
|
arguments.writeErrorMessages(osg::notify(osg::INFO));
|
||||||
|
|||||||
@@ -103,7 +103,9 @@ void OsgMainApp::initOsgWindow(int x,int y,int width,int height){
|
|||||||
osg::notify(osg::ALWAYS)<<"Testing"<<std::endl;
|
osg::notify(osg::ALWAYS)<<"Testing"<<std::endl;
|
||||||
|
|
||||||
_viewer = new osgViewer::Viewer();
|
_viewer = new osgViewer::Viewer();
|
||||||
_viewer->setUpViewerAsEmbeddedInWindow(x, y, width, height);
|
osgViewer::GraphicsWindowEmbedded* window = _viewer->setUpViewerAsEmbeddedInWindow(x, y, width, height);
|
||||||
|
_viewer->getEventQueue()->setGraphicsContext(window);
|
||||||
|
_viewer->getEventQueue()->syncWindowRectangleWithGraphicsContext();
|
||||||
_viewer->setThreadingModel(osgViewer::ViewerBase::SingleThreaded);
|
_viewer->setThreadingModel(osgViewer::ViewerBase::SingleThreaded);
|
||||||
|
|
||||||
_root = new osg::Group();
|
_root = new osg::Group();
|
||||||
|
|||||||
@@ -312,7 +312,7 @@ int main( int argc, char **argv )
|
|||||||
osg::CoordinateSystemNode* csn = findTopMostNodeOfType<osg::CoordinateSystemNode>(loadedModel.get());
|
osg::CoordinateSystemNode* csn = findTopMostNodeOfType<osg::CoordinateSystemNode>(loadedModel.get());
|
||||||
if(!csn) return 1;
|
if(!csn) return 1;
|
||||||
|
|
||||||
// Compute eye point in world coordiantes
|
// Compute eye point in world coordinates
|
||||||
osg::Vec3d eye;
|
osg::Vec3d eye;
|
||||||
csn->getEllipsoidModel()->convertLatLongHeightToXYZ(lat, lon, alt, eye.x(), eye.y(), eye.z());
|
csn->getEllipsoidModel()->convertLatLongHeightToXYZ(lat, lon, alt, eye.x(), eye.y(), eye.z());
|
||||||
|
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ int main( int argc, char **argv )
|
|||||||
// use an ArgumentParser object to manage the program arguments.
|
// use an ArgumentParser object to manage the program arguments.
|
||||||
osg::ArgumentParser arguments(&argc,argv);
|
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());
|
osgDB::Registry::instance()->setReadFileCallback(new MyReadFileCallback());
|
||||||
|
|
||||||
// initialize the viewer.
|
// initialize the viewer.
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#if !defined (WIN32) || defined(__CYGWIN__)
|
#if !defined (_WIN32) || defined(__CYGWIN__)
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
#elif defined (__APPLE__)
|
#elif defined (__APPLE__)
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/sockio.h>
|
#include <sys/sockio.h>
|
||||||
#elif defined (WIN32)
|
#elif defined (_WIN32)
|
||||||
#include <winsock.h>
|
#include <winsock.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#elif defined (__hpux)
|
#elif defined (__hpux)
|
||||||
@@ -73,7 +73,7 @@ Broadcaster::Broadcaster( void )
|
|||||||
_ifr_name = "eth0";
|
_ifr_name = "eth0";
|
||||||
#elif defined(__sun)
|
#elif defined(__sun)
|
||||||
_ifr_name = "hme0";
|
_ifr_name = "hme0";
|
||||||
#elif !defined (WIN32)
|
#elif !defined (_WIN32)
|
||||||
_ifr_name = "ef0";
|
_ifr_name = "ef0";
|
||||||
#endif
|
#endif
|
||||||
_port = 0;
|
_port = 0;
|
||||||
@@ -84,7 +84,7 @@ Broadcaster::Broadcaster( void )
|
|||||||
|
|
||||||
Broadcaster::~Broadcaster( void )
|
Broadcaster::~Broadcaster( void )
|
||||||
{
|
{
|
||||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||||
closesocket( _so);
|
closesocket( _so);
|
||||||
#else
|
#else
|
||||||
close( _so );
|
close( _so );
|
||||||
@@ -93,7 +93,7 @@ Broadcaster::~Broadcaster( void )
|
|||||||
|
|
||||||
bool Broadcaster::init( void )
|
bool Broadcaster::init( void )
|
||||||
{
|
{
|
||||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||||
WORD version = MAKEWORD(1,1);
|
WORD version = MAKEWORD(1,1);
|
||||||
WSADATA wsaData;
|
WSADATA wsaData;
|
||||||
// First, we start up Winsock
|
// First, we start up Winsock
|
||||||
@@ -111,13 +111,13 @@ bool Broadcaster::init( void )
|
|||||||
perror( "Socket" );
|
perror( "Socket" );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||||
const BOOL on = TRUE;
|
const BOOL on = TRUE;
|
||||||
#else
|
#else
|
||||||
int on = 1;
|
int on = 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||||
setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, (const char *) &on, sizeof(int));
|
setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, (const char *) &on, sizeof(int));
|
||||||
#else
|
#else
|
||||||
setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
|
setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
|
||||||
@@ -127,17 +127,17 @@ bool Broadcaster::init( void )
|
|||||||
saddr.sin_port = htons( _port );
|
saddr.sin_port = htons( _port );
|
||||||
if( _address == 0 )
|
if( _address == 0 )
|
||||||
{
|
{
|
||||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||||
setsockopt( _so, SOL_SOCKET, SO_BROADCAST, (const char *) &on, sizeof(int));
|
setsockopt( _so, SOL_SOCKET, SO_BROADCAST, (const char *) &on, sizeof(int));
|
||||||
#else
|
#else
|
||||||
setsockopt( _so, SOL_SOCKET, SO_BROADCAST, &on, sizeof(on));
|
setsockopt( _so, SOL_SOCKET, SO_BROADCAST, &on, sizeof(on));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined (WIN32) || defined(__CYGWIN__)
|
#if !defined (_WIN32) || defined(__CYGWIN__)
|
||||||
struct ifreq ifr;
|
struct ifreq ifr;
|
||||||
strcpy( ifr.ifr_name, _ifr_name.c_str());
|
strcpy( ifr.ifr_name, _ifr_name.c_str());
|
||||||
#endif
|
#endif
|
||||||
#if defined (WIN32) // get the server address
|
#if defined (_WIN32) // get the server address
|
||||||
saddr.sin_addr.s_addr = htonl(INADDR_BROADCAST);
|
saddr.sin_addr.s_addr = htonl(INADDR_BROADCAST);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@@ -202,7 +202,7 @@ void Broadcaster::sync( void )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||||
unsigned int size = sizeof( SOCKADDR_IN );
|
unsigned int size = sizeof( SOCKADDR_IN );
|
||||||
sendto( _so, (const char *)_buffer, _buffer_size, 0, (struct sockaddr *)&saddr, size );
|
sendto( _so, (const char *)_buffer, _buffer_size, 0, (struct sockaddr *)&saddr, size );
|
||||||
int err = WSAGetLastError ();
|
int err = WSAGetLastError ();
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
// Class definition for broadcasting a buffer to a LAN
|
// Class definition for broadcasting a buffer to a LAN
|
||||||
//
|
//
|
||||||
|
|
||||||
#if !defined(WIN32) || defined(__CYGWIN__)
|
#if !defined(_WIN32) || defined(__CYGWIN__)
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ class Broadcaster
|
|||||||
|
|
||||||
std::string _ifr_name;
|
std::string _ifr_name;
|
||||||
|
|
||||||
#if defined(WIN32) && !defined(__CYGWIN__)
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||||
SOCKET _so;
|
SOCKET _so;
|
||||||
#else
|
#else
|
||||||
int _so;
|
int _so;
|
||||||
@@ -74,7 +74,7 @@ class Broadcaster
|
|||||||
short _port;
|
short _port;
|
||||||
void *_buffer;
|
void *_buffer;
|
||||||
unsigned int _buffer_size;
|
unsigned int _buffer_size;
|
||||||
#if defined(WIN32) && !defined(__CYGWIN__)
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||||
SOCKADDR_IN saddr;
|
SOCKADDR_IN saddr;
|
||||||
#else
|
#else
|
||||||
struct sockaddr_in saddr;
|
struct sockaddr_in saddr;
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||||
#include <winsock.h>
|
#include <winsock.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||||
#include <winsock.h>
|
#include <winsock.h>
|
||||||
#else
|
#else
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@@ -46,7 +46,7 @@ Receiver::Receiver( void )
|
|||||||
|
|
||||||
Receiver::~Receiver( void )
|
Receiver::~Receiver( void )
|
||||||
{
|
{
|
||||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||||
closesocket( _so);
|
closesocket( _so);
|
||||||
#else
|
#else
|
||||||
close( _so );
|
close( _so );
|
||||||
@@ -55,7 +55,7 @@ Receiver::~Receiver( void )
|
|||||||
|
|
||||||
bool Receiver::init( void )
|
bool Receiver::init( void )
|
||||||
{
|
{
|
||||||
#if defined(WIN32) && !defined(__CYGWIN__)
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||||
WORD version = MAKEWORD(1,1);
|
WORD version = MAKEWORD(1,1);
|
||||||
WSADATA wsaData;
|
WSADATA wsaData;
|
||||||
// First, we start up Winsock
|
// First, we start up Winsock
|
||||||
@@ -73,7 +73,7 @@ bool Receiver::init( void )
|
|||||||
perror( "Socket" );
|
perror( "Socket" );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||||
// const BOOL on = TRUE;
|
// const BOOL on = TRUE;
|
||||||
// setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, (const char*) &on, sizeof(int));
|
// setsockopt( _so, SOL_SOCKET, SO_REUSEADDR, (const char*) &on, sizeof(int));
|
||||||
#else
|
#else
|
||||||
@@ -84,7 +84,7 @@ bool Receiver::init( void )
|
|||||||
// struct sockaddr_in saddr;
|
// struct sockaddr_in saddr;
|
||||||
saddr.sin_family = AF_INET;
|
saddr.sin_family = AF_INET;
|
||||||
saddr.sin_port = htons( _port );
|
saddr.sin_port = htons( _port );
|
||||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||||
saddr.sin_addr.s_addr = htonl(INADDR_ANY);
|
saddr.sin_addr.s_addr = htonl(INADDR_ANY);
|
||||||
#else
|
#else
|
||||||
saddr.sin_addr.s_addr = 0;
|
saddr.sin_addr.s_addr = 0;
|
||||||
@@ -137,7 +137,7 @@ unsigned int Receiver::sync( void )
|
|||||||
tv.tv_sec = 0;
|
tv.tv_sec = 0;
|
||||||
tv.tv_usec = 0;
|
tv.tv_usec = 0;
|
||||||
|
|
||||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||||
// saddr.sin_port = htons( _port );
|
// saddr.sin_port = htons( _port );
|
||||||
recvfrom( _so, (char *)_buffer, _buffer_size, 0, (sockaddr*)&saddr, &size );
|
recvfrom( _so, (char *)_buffer, _buffer_size, 0, (sockaddr*)&saddr, &size );
|
||||||
// recvfrom(sock_Receive, szMessage, 256, 0, (sockaddr*)&addr_Cli, &clilen)
|
// recvfrom(sock_Receive, szMessage, 256, 0, (sockaddr*)&addr_Cli, &clilen)
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
// Class definition for the recipient of a broadcasted message
|
// Class definition for the recipient of a broadcasted message
|
||||||
//
|
//
|
||||||
|
|
||||||
#if !defined(WIN32) || defined(__CYGWIN__)
|
#if !defined(_WIN32) || defined(__CYGWIN__)
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ class Receiver
|
|||||||
bool init( void );
|
bool init( void );
|
||||||
|
|
||||||
private :
|
private :
|
||||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
#if defined (_WIN32) && !defined(__CYGWIN__)
|
||||||
SOCKET _so;
|
SOCKET _so;
|
||||||
SOCKADDR_IN saddr;
|
SOCKADDR_IN saddr;
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ int main( int argc, char **argv )
|
|||||||
|
|
||||||
// ------------- Start of copy specific code -------------------------------------------------------
|
// ------------- 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
|
// in your own code you'd typically just use the basic osg::CopyOp something like
|
||||||
osg::ref_ptr<osg::Node> mycopy = dynamic_cast<osg::Node*>(rootnode->clone(osg::CopyOp::DEEP_COPY_ALL));
|
osg::ref_ptr<osg::Node> mycopy = dynamic_cast<osg::Node*>(rootnode->clone(osg::CopyOp::DEEP_COPY_ALL));
|
||||||
std::cout << "Doing a deep copy of scene graph"<<std::endl;
|
std::cout << "Doing a deep copy of scene graph"<<std::endl;
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ int main( int argc, char **argv )
|
|||||||
osg::ArgumentParser arguments(&argc,argv);
|
osg::ArgumentParser arguments(&argc,argv);
|
||||||
|
|
||||||
// construct the viewer.
|
// construct the viewer.
|
||||||
osgViewer::Viewer viewer;
|
osgViewer::Viewer viewer(arguments);
|
||||||
|
|
||||||
// add the state manipulator
|
// add the state manipulator
|
||||||
viewer.addEventHandler( new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()) );
|
viewer.addEventHandler( new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()) );
|
||||||
|
|||||||
@@ -138,9 +138,7 @@ void getPossibleConfigs(GraphicsContext* gc, BufferConfigList& colorConfigs,
|
|||||||
return;
|
return;
|
||||||
if (ext->isMultisampleSupported)
|
if (ext->isMultisampleSupported)
|
||||||
glGetIntegerv(GL_MAX_SAMPLES_EXT, &maxSamples);
|
glGetIntegerv(GL_MAX_SAMPLES_EXT, &maxSamples);
|
||||||
// isMultisampleCoverageSupported
|
if (ext->isRenderbufferMultisampleCoverageSupported())
|
||||||
if (isGLExtensionSupported(contextID,
|
|
||||||
"GL_NV_framebuffer_multisample_coverage"))
|
|
||||||
{
|
{
|
||||||
glGetIntegerv(GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV,
|
glGetIntegerv(GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV,
|
||||||
&coverageSampleConfigs);
|
&coverageSampleConfigs);
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ int main( int argc, char **argv )
|
|||||||
arguments.getApplicationUsage()->addCommandLineOption("-o <filename>","Base output filename of the images, recommended to use something like Images/image.png");
|
arguments.getApplicationUsage()->addCommandLineOption("-o <filename>","Base output filename of the images, recommended to use something like Images/image.png");
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("--cs <filename>","Load pre-generated configuration file for run.");
|
arguments.getApplicationUsage()->addCommandLineOption("--cs <filename>","Load pre-generated configuration file for run.");
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("--ouput-cs <filename>","Output configuration file with settings provided on commandline.");
|
arguments.getApplicationUsage()->addCommandLineOption("--ouput-cs <filename>","Output configuration file with settings provided on commandline.");
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("-p <filename>","Use specificied camera path file to control camera position.");
|
arguments.getApplicationUsage()->addCommandLineOption("-p <filename>","Use specified camera path file to control camera position.");
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("--offscreen","Use an pbuffer to render the images offscreen.");
|
arguments.getApplicationUsage()->addCommandLineOption("--offscreen","Use an pbuffer to render the images offscreen.");
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("--screen","Use an window to render the images.");
|
arguments.getApplicationUsage()->addCommandLineOption("--screen","Use an window to render the images.");
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("--width <width>","Window/output image width.");
|
arguments.getApplicationUsage()->addCommandLineOption("--width <width>","Window/output image width.");
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ osg::Node* createScene()
|
|||||||
|
|
||||||
// create a Vec3Array and add to it all my coordinates.
|
// 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
|
// 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
|
// which std::vector<> provides all the convenience, flexibility and robustness
|
||||||
// of the most popular of all STL containers.
|
// of the most popular of all STL containers.
|
||||||
osg::Vec3Array* vertices = new osg::Vec3Array;
|
osg::Vec3Array* vertices = new osg::Vec3Array;
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
|
#if defined(_WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
|
||||||
// disable the double to float errors.
|
// disable the double to float errors.
|
||||||
#pragma warning( disable : 4305 )
|
#pragma warning( disable : 4305 )
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
|
#if defined(_WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
|
||||||
// disable the double to float errors.
|
// disable the double to float errors.
|
||||||
#pragma warning( disable : 4305 )
|
#pragma warning( disable : 4305 )
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
|
#if defined(_WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
|
||||||
// disable the double to float errors.
|
// disable the double to float errors.
|
||||||
#pragma warning( disable : 4305 )
|
#pragma warning( disable : 4305 )
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ void KeyboardModel::keyChange(int key, int virtualKey, int value)
|
|||||||
{
|
{
|
||||||
osg::notify(osg::INFO) << "key value change, code="<<std::hex << key << "\t value="<< value << std::dec << std::endl;
|
osg::notify(osg::INFO) << "key value change, code="<<std::hex << key << "\t value="<< value << std::dec << std::endl;
|
||||||
|
|
||||||
// toggle the keys graphical representation on or off via osg::Swithc
|
// toggle the keys graphical representation on or off via osg::Switch
|
||||||
KeyModelMap::iterator itr = _keyModelMap.find(virtualKey);
|
KeyModelMap::iterator itr = _keyModelMap.find(virtualKey);
|
||||||
if (itr!=_keyModelMap.end())
|
if (itr!=_keyModelMap.end())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -71,11 +71,11 @@ public:
|
|||||||
bool _addToModel;
|
bool _addToModel;
|
||||||
};
|
};
|
||||||
|
|
||||||
class DeleteSelectedNodesVisitor : public osg::NodeVisitor
|
class SelectedNodesVisitor : public osg::NodeVisitor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
DeleteSelectedNodesVisitor():
|
SelectedNodesVisitor():
|
||||||
osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN)
|
osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -110,6 +110,23 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
osg::ref_ptr<osg::Node> createSelectedNodeSubgraph()
|
||||||
|
{
|
||||||
|
if (_selectedNodes.empty()) return osg::ref_ptr<osg::Node>();
|
||||||
|
|
||||||
|
if (_selectedNodes.size()==1) return _selectedNodes[0];
|
||||||
|
|
||||||
|
// note code doesn't yet handle selected nodes being nested within transforms.
|
||||||
|
osg::ref_ptr<osg::Group> group;
|
||||||
|
for(SelectedNodes::iterator itr = _selectedNodes.begin();
|
||||||
|
itr != _selectedNodes.end();
|
||||||
|
++itr)
|
||||||
|
{
|
||||||
|
group->addChild(*itr);
|
||||||
|
}
|
||||||
|
return group;
|
||||||
|
}
|
||||||
|
|
||||||
typedef std::vector< osg::ref_ptr<osgFX::Scribe> > SelectedNodes;
|
typedef std::vector< osg::ref_ptr<osgFX::Scribe> > SelectedNodes;
|
||||||
SelectedNodes _selectedNodes;
|
SelectedNodes _selectedNodes;
|
||||||
|
|
||||||
@@ -150,6 +167,18 @@ public:
|
|||||||
osg::notify(osg::NOTICE)<<"Saved model to file 'saved_model.osgt'"<<std::endl;
|
osg::notify(osg::NOTICE)<<"Saved model to file 'saved_model.osgt'"<<std::endl;
|
||||||
osgDB::writeNodeFile(*(viewer->getSceneData()), "saved_model.osgt");
|
osgDB::writeNodeFile(*(viewer->getSceneData()), "saved_model.osgt");
|
||||||
}
|
}
|
||||||
|
else if (ea.getKey()=='s')
|
||||||
|
{
|
||||||
|
SelectedNodesVisitor snv;
|
||||||
|
viewer->getSceneData()->accept(snv);
|
||||||
|
osg::ref_ptr<osg::Node> selected = snv.createSelectedNodeSubgraph();
|
||||||
|
|
||||||
|
if (selected)
|
||||||
|
{
|
||||||
|
osg::notify(osg::NOTICE)<<"Saved selected to file 'saved_selected.osgt'"<<std::endl;
|
||||||
|
osgDB::writeNodeFile(*(viewer->getSceneData()), "saved_selected.osgt");
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (ea.getKey()=='p')
|
else if (ea.getKey()=='p')
|
||||||
{
|
{
|
||||||
_usePolytopeIntersector = !_usePolytopeIntersector;
|
_usePolytopeIntersector = !_usePolytopeIntersector;
|
||||||
@@ -167,7 +196,7 @@ public:
|
|||||||
{
|
{
|
||||||
osg::notify(osg::NOTICE)<<"Using window coordinates for picking"<<std::endl;
|
osg::notify(osg::NOTICE)<<"Using window coordinates for picking"<<std::endl;
|
||||||
} else {
|
} else {
|
||||||
osg::notify(osg::NOTICE)<<"Using projection coordiates for picking"<<std::endl;
|
osg::notify(osg::NOTICE)<<"Using projection coordinates for picking"<<std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (ea.getKey()=='a')
|
else if (ea.getKey()=='a')
|
||||||
@@ -177,7 +206,7 @@ public:
|
|||||||
else if (ea.getKey()==osgGA::GUIEventAdapter::KEY_Delete || ea.getKey()==osgGA::GUIEventAdapter::KEY_BackSpace)
|
else if (ea.getKey()==osgGA::GUIEventAdapter::KEY_Delete || ea.getKey()==osgGA::GUIEventAdapter::KEY_BackSpace)
|
||||||
{
|
{
|
||||||
osg::notify(osg::NOTICE)<<"Delete"<<std::endl;
|
osg::notify(osg::NOTICE)<<"Delete"<<std::endl;
|
||||||
DeleteSelectedNodesVisitor dsnv;
|
SelectedNodesVisitor dsnv;
|
||||||
viewer->getSceneData()->accept(dsnv);
|
viewer->getSceneData()->accept(dsnv);
|
||||||
dsnv.pruneSelectedNodes();
|
dsnv.pruneSelectedNodes();
|
||||||
}
|
}
|
||||||
@@ -401,7 +430,7 @@ public:
|
|||||||
|
|
||||||
if (cmtsv._group->getNumChildren()>0)
|
if (cmtsv._group->getNumChildren()>0)
|
||||||
{
|
{
|
||||||
std::cout<<"Writing selected compoents to 'selected_model.osgt'"<<std::endl;
|
std::cout<<"Writing selected components to 'selected_model.osgt'"<<std::endl;
|
||||||
osgDB::writeNodeFile(*cmtsv._group, "selected_model.osgt");
|
osgDB::writeNodeFile(*cmtsv._group, "selected_model.osgt");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -417,7 +417,7 @@ int main(int argc, char** argv)
|
|||||||
arguments.getApplicationUsage()->addCommandLineOption("--shader","Use shaders to post process the video.");
|
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("--interactive","Use camera manipulator to allow movement around movie.");
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("--flip","Flip the movie so top becomes bottom.");
|
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.");
|
arguments.getApplicationUsage()->addCommandLineOption("--devices","Print the Video input capability via QuickTime and exit.");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -433,7 +433,7 @@ int main(int argc, char** argv)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(WIN32) || defined(__APPLE__)
|
#if defined(_WIN32) || defined(__APPLE__)
|
||||||
// if user requests devices video capability.
|
// if user requests devices video capability.
|
||||||
if (arguments.read("-devices") || arguments.read("--devices"))
|
if (arguments.read("-devices") || arguments.read("--devices"))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ int main( int argc, char** argv )
|
|||||||
// A floating error of delta-time should be explained here:
|
// 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.
|
// 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
|
// 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.
|
// the BounceOperator.
|
||||||
// Now we make use of the getDeltaTime() of ParticleSystem to maintain and dispatch the delta time. But..
|
// 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.
|
// it is not the best solution so far, since there are still very few particles acting unexpectedly.
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ void computeViewMatrixOnEarth( osg::Camera* camera, osg::Node* scene,
|
|||||||
osg::CoordinateSystemNode* csn = findTopMostNodeOfType<osg::CoordinateSystemNode>(scene);
|
osg::CoordinateSystemNode* csn = findTopMostNodeOfType<osg::CoordinateSystemNode>(scene);
|
||||||
if ( !csn ) return;
|
if ( !csn ) return;
|
||||||
|
|
||||||
// Compute eye point in world coordiantes
|
// Compute eye point in world coordinates
|
||||||
osg::Vec3d eye;
|
osg::Vec3d eye;
|
||||||
csn->getEllipsoidModel()->convertLatLongHeightToXYZ(
|
csn->getEllipsoidModel()->convertLatLongHeightToXYZ(
|
||||||
latLongHeight.x(), latLongHeight.y(), latLongHeight.z(), eye.x(), eye.y(), eye.z() );
|
latLongHeight.x(), latLongHeight.y(), latLongHeight.z(), eye.x(), eye.y(), eye.z() );
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
//
|
//
|
||||||
// A simple demo demonstrating planar reflections using multiple renderings
|
// 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
|
// The multipass system implemented here is a variation of Mark Kilgard's
|
||||||
// paper "Improving Shadows and Reflections via the Stencil Buffer" which
|
// paper "Improving Shadows and Reflections via the Stencil Buffer" which
|
||||||
|
|||||||
@@ -99,19 +99,19 @@ class WindowCaptureCallback : public osg::Camera::DrawCallback
|
|||||||
switch(_mode)
|
switch(_mode)
|
||||||
{
|
{
|
||||||
case(READ_PIXELS):
|
case(READ_PIXELS):
|
||||||
osg::notify(osg::NOTICE)<<"Reading window usig glReadPixels, with out PixelBufferObject."<<std::endl;
|
osg::notify(osg::NOTICE)<<"Reading window using glReadPixels, with out PixelBufferObject."<<std::endl;
|
||||||
break;
|
break;
|
||||||
case(SINGLE_PBO):
|
case(SINGLE_PBO):
|
||||||
osg::notify(osg::NOTICE)<<"Reading window usig glReadPixels, with a single PixelBufferObject."<<std::endl;
|
osg::notify(osg::NOTICE)<<"Reading window using glReadPixels, with a single PixelBufferObject."<<std::endl;
|
||||||
_pboBuffer.push_back(0);
|
_pboBuffer.push_back(0);
|
||||||
break;
|
break;
|
||||||
case(DOUBLE_PBO):
|
case(DOUBLE_PBO):
|
||||||
osg::notify(osg::NOTICE)<<"Reading window usig glReadPixels, with a double buffer PixelBufferObject."<<std::endl;
|
osg::notify(osg::NOTICE)<<"Reading window using glReadPixels, with a double buffer PixelBufferObject."<<std::endl;
|
||||||
_pboBuffer.push_back(0);
|
_pboBuffer.push_back(0);
|
||||||
_pboBuffer.push_back(0);
|
_pboBuffer.push_back(0);
|
||||||
break;
|
break;
|
||||||
case(TRIPLE_PBO):
|
case(TRIPLE_PBO):
|
||||||
osg::notify(osg::NOTICE)<<"Reading window usig glReadPixels, with a triple buffer PixelBufferObject."<<std::endl;
|
osg::notify(osg::NOTICE)<<"Reading window using glReadPixels, with a triple buffer PixelBufferObject."<<std::endl;
|
||||||
_pboBuffer.push_back(0);
|
_pboBuffer.push_back(0);
|
||||||
_pboBuffer.push_back(0);
|
_pboBuffer.push_back(0);
|
||||||
_pboBuffer.push_back(0);
|
_pboBuffer.push_back(0);
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ osg::Node* createTextGroup(const char** text)
|
|||||||
// loop through all children
|
// loop through all children
|
||||||
seq->setInterval(osg::Sequence::LOOP, 0,-1);
|
seq->setInterval(osg::Sequence::LOOP, 0,-1);
|
||||||
|
|
||||||
// real-time playback, repeat indefinitively
|
// real-time playback, repeat indefinitely
|
||||||
seq->setDuration(1.0f, -1);
|
seq->setDuration(1.0f, -1);
|
||||||
|
|
||||||
// must be started explicitly
|
// must be started explicitly
|
||||||
@@ -157,7 +157,7 @@ osg::Sequence* createSequence(osg::ArgumentParser& arguments)
|
|||||||
// loop through all children
|
// loop through all children
|
||||||
seq->setInterval(osg::Sequence::LOOP, 0,-1);
|
seq->setInterval(osg::Sequence::LOOP, 0,-1);
|
||||||
|
|
||||||
// real-time playback, repeat indefinitively
|
// real-time playback, repeat indefinitely
|
||||||
seq->setDuration(1.0f, -1);
|
seq->setDuration(1.0f, -1);
|
||||||
|
|
||||||
seq->setMode(osg::Sequence::START);
|
seq->setMode(osg::Sequence::START);
|
||||||
@@ -244,7 +244,7 @@ int main( int argc, char **argv )
|
|||||||
"- is subclassed from osg::Switch",
|
"- is subclassed from osg::Switch",
|
||||||
"- assigns a display duration to each child",
|
"- assigns a display duration to each child",
|
||||||
"- can loop or swing through an interval of it's children",
|
"- 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 's' to start/pause/resume",
|
||||||
"- press 'l' to toggle loop/swing mode",
|
"- press 'l' to toggle loop/swing mode",
|
||||||
NULL
|
NULL
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ osg::Node* createOldShaderCompositionScene(osg::ArgumentParser& arguments)
|
|||||||
group->addChild(pat);
|
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;
|
osg::PositionAttitudeTransform* pat = new osg::PositionAttitudeTransform;
|
||||||
pat->setPosition(position);
|
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;
|
osg::PositionAttitudeTransform* pat = new osg::PositionAttitudeTransform;
|
||||||
pat->setPosition(position);
|
pat->setPosition(position);
|
||||||
|
|||||||
@@ -314,7 +314,7 @@ int main(int, char **)
|
|||||||
|
|
||||||
osg::ref_ptr<TestSupportOperation> testSupportOperation = new TestSupportOperation;
|
osg::ref_ptr<TestSupportOperation> testSupportOperation = new TestSupportOperation;
|
||||||
#if 0
|
#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());
|
viewer.setRealizeOperation(testSupportOperation.get());
|
||||||
#endif
|
#endif
|
||||||
// create the windows and run the threads.
|
// create the windows and run the threads.
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
|
#if defined(_WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
|
||||||
// disable the double to float errors.
|
// disable the double to float errors.
|
||||||
#pragma warning( disable : 4305 )
|
#pragma warning( disable : 4305 )
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ If you have an external project that will depend on OSG built for OpenGL 3.x,
|
|||||||
you'll need to ensure your external project also uses the compiler include
|
you'll need to ensure your external project also uses the compiler include
|
||||||
directives to find <GL3/gl3.h>.
|
directives to find <GL3/gl3.h>.
|
||||||
|
|
||||||
To berify your application is using a pure OpenGL 3.x context, set
|
To verify your application is using a pure OpenGL 3.x context, set
|
||||||
OSG_NOTIFY_LEVEL=INFO in the environment and check the console output. Context
|
OSG_NOTIFY_LEVEL=INFO in the environment and check the console output. Context
|
||||||
creation displays output such as the following:
|
creation displays output such as the following:
|
||||||
GL3: Attempting to create OpenGL3 context.
|
GL3: Attempting to create OpenGL3 context.
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
|
#if defined(_WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Disable unavoidable warning messages:
|
// Disable unavoidable warning messages:
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
#pragma warning(disable : 4103 4114 4201 4237 4251 4275 4290 4503 4335 4786)
|
#pragma warning(disable : 4103 4114 4201 4237 4251 4275 4290 4503 4335 4786)
|
||||||
|
|
||||||
#endif // WIN32
|
#endif // _WIN32
|
||||||
|
|
||||||
#include <osgViewer/Viewer>
|
#include <osgViewer/Viewer>
|
||||||
#include <osgViewer/ViewerEventHandlers>
|
#include <osgViewer/ViewerEventHandlers>
|
||||||
|
|||||||
@@ -470,7 +470,7 @@ osg::Geometry *makePols (void) {
|
|||||||
gtess->setStateSet( stateset );
|
gtess->setStateSet( stateset );
|
||||||
|
|
||||||
int nstart=0;
|
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::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;
|
gtess->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::POLYGON,nstart,16));nstart+=16;
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/* A demonstration of Tessellation Shaders in OpenScenegraph.
|
/* A demonstration of Tessellation Shaders in OpenScenegraph.
|
||||||
*
|
*
|
||||||
* Instructions:
|
* Instructions:
|
||||||
* Press plus to increase tesselation and minus to decrease it.
|
* Press plus to increase tessellation and minus to decrease it.
|
||||||
* Press right arrow to increase inner tesselation and left arrow to decrease it.
|
* Press right arrow to increase inner tessellation and left arrow to decrease it.
|
||||||
* Press up arrow to increase outer tesselation and down arrow to decrease it.
|
* Press up arrow to increase outer tessellation and down arrow to decrease it.
|
||||||
*
|
*
|
||||||
* Original code by Philip Rideout
|
* Original code by Philip Rideout
|
||||||
* Adapted to OpenScenegraph by John Kaniarz
|
* Adapted to OpenScenegraph by John Kaniarz
|
||||||
|
|||||||
@@ -440,7 +440,7 @@ osg::Group* create3DText(const osg::Vec3& center,float radius)
|
|||||||
text5->setFont("fonts/times.ttf");
|
text5->setFont("fonts/times.ttf");
|
||||||
//text5->setCharacterSize(characterSize);
|
//text5->setCharacterSize(characterSize);
|
||||||
text5->setCharacterSize(32.0f); // medium
|
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->setAxisAlignment(osgText::Text::SCREEN);
|
||||||
text5->setCharacterSizeMode(osgText::Text::SCREEN_COORDS);
|
text5->setCharacterSizeMode(osgText::Text::SCREEN_COORDS);
|
||||||
text5->setDrawMode(osgText::Text::TEXT | osgText::Text::BOUNDINGBOX);
|
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->setColor(characterSizeModeColor);
|
||||||
text6->setFont("fonts/times.ttf");
|
text6->setFont("fonts/times.ttf");
|
||||||
text6->setCharacterSize(characterSize);
|
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->setAxisAlignment(osgText::Text::SCREEN);
|
||||||
text6->setCharacterSizeMode(osgText::Text::OBJECT_COORDS_WITH_MAXIMUM_SCREEN_SIZE_CAPPED_BY_FONT_HEIGHT);
|
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");
|
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->setColor(characterSizeModeColor);
|
||||||
text7->setFont("fonts/times.ttf");
|
text7->setFont("fonts/times.ttf");
|
||||||
text7->setCharacterSize(characterSize);
|
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->setAxisAlignment(osgText::Text::SCREEN);
|
||||||
text7->setCharacterSizeMode(osgText::Text::OBJECT_COORDS);
|
text7->setCharacterSizeMode(osgText::Text::OBJECT_COORDS);
|
||||||
text7->setText("CharacterSizeMode OBJECT_COORDS (default)");
|
text7->setText("CharacterSizeMode OBJECT_COORDS (default)");
|
||||||
@@ -683,7 +683,7 @@ int main(int argc, char** argv)
|
|||||||
text->setFont("fonts/times.ttf");
|
text->setFont("fonts/times.ttf");
|
||||||
text->setAxisAlignment(osgText::Text::XZ_PLANE);
|
text->setAxisAlignment(osgText::Text::XZ_PLANE);
|
||||||
text->setAlignment(osgText::Text::RIGHT_TOP);
|
text->setAlignment(osgText::Text::RIGHT_TOP);
|
||||||
text->setText("Alingment\nBefore:");
|
text->setText("Alignment\nBefore:");
|
||||||
group->addChild(text);
|
group->addChild(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -691,8 +691,8 @@ int main(int argc, char** argv)
|
|||||||
osg::ref_ptr<osgText::Text> text = new osgText::Text;
|
osg::ref_ptr<osgText::Text> text = new osgText::Text;
|
||||||
text->setFont("fonts/times.ttf");
|
text->setFont("fonts/times.ttf");
|
||||||
text->setAxisAlignment(osgText::Text::XZ_PLANE);
|
text->setAxisAlignment(osgText::Text::XZ_PLANE);
|
||||||
text->setText("Alingment\nAfter:");
|
text->setText("Alignment\nAfter:");
|
||||||
text->setAlignment(osgText::Text::RIGHT_TOP);
|
text->setAlignment(osgText::Text::LEFT_TOP);
|
||||||
group->addChild(text);
|
group->addChild(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -754,7 +754,7 @@ int main(int argc, char** argv)
|
|||||||
{
|
{
|
||||||
// prepare scene.
|
// prepare scene.
|
||||||
osg::Vec3 center(0.0f,0.0f,0.0f);
|
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.
|
// make sure the root node is group so we can add extra nodes to it.
|
||||||
osg::Group* group = new osg::Group;
|
osg::Group* group = new osg::Group;
|
||||||
|
|||||||
@@ -543,7 +543,7 @@ public:
|
|||||||
// now assign the appropriate portion data from the originalImage
|
// now assign the appropriate portion data from the originalImage
|
||||||
subImage->setImage(originalImage->s()/2, originalImage->t()/2, originalImage->r(), // half the width and height
|
subImage->setImage(originalImage->s()/2, originalImage->t()/2, originalImage->r(), // half the width and height
|
||||||
originalImage->getInternalTextureFormat(), // same internal texture format
|
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
|
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
|
osg::Image::NO_DELETE, // don't attempt to delete the image data, leave this to the originalImage
|
||||||
originalImage->getPacking(), // use the same packing
|
originalImage->getPacking(), // use the same packing
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ int main(int argc, char** argv)
|
|||||||
|
|
||||||
if (arguments.argc()<=1)
|
if (arguments.argc()<=1)
|
||||||
{
|
{
|
||||||
std::cout<<"Please supply an image filename on the commnand line."<<std::endl;
|
std::cout<<"Please supply an image filename on the command line."<<std::endl;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ std::ostream& TestContext::tout(TraceLevel tl) const
|
|||||||
TestContext::TraceStream::TraceStream(std::ostream& o, TraceLevel tl):
|
TestContext::TraceStream::TraceStream(std::ostream& o, TraceLevel tl):
|
||||||
_traceLevel(tl),
|
_traceLevel(tl),
|
||||||
_outputStreamPtr(&o),
|
_outputStreamPtr(&o),
|
||||||
#if defined(WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
|
#if defined(_WIN32) && !(defined(__CYGWIN__) || defined(__MINGW32__))
|
||||||
_nullStream("nul")
|
_nullStream("nul")
|
||||||
#else
|
#else
|
||||||
_nullStream("/dev/null")
|
_nullStream("/dev/null")
|
||||||
|
|||||||
@@ -215,7 +215,7 @@ void testGetQuatFromMatrix(const osg::Vec3d& scale)
|
|||||||
double yaw2stop = 360.0;
|
double yaw2stop = 360.0;
|
||||||
double yaw2step = 20.0;
|
double yaw2step = 20.0;
|
||||||
#else
|
#else
|
||||||
// focussed range
|
// focused range
|
||||||
double rol1start = 0.0;
|
double rol1start = 0.0;
|
||||||
double rol1stop = 0.0;
|
double rol1stop = 0.0;
|
||||||
double rol1step = 0.1;
|
double rol1step = 0.1;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// For wxCURSOR_BLANK below, but isn't used a.t.m.
|
// For wxCURSOR_BLANK below, but isn't used a.t.m.
|
||||||
//#ifdef WIN32
|
//#ifdef _WIN32
|
||||||
//#include "wx/msw/wx.rc"
|
//#include "wx/msw/wx.rc"
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
#include <OpenThreads/Config>
|
#include <OpenThreads/Config>
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
#define OPENTHREAD_EXPORT_DIRECTIVE
|
#define OPENTHREAD_EXPORT_DIRECTIVE
|
||||||
#else
|
#else
|
||||||
#if defined( OT_LIBRARY_STATIC )
|
#if defined( OT_LIBRARY_STATIC )
|
||||||
|
|||||||
@@ -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();
|
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
|
* Initialize Threading in a program. This method must be called before
|
||||||
@@ -147,7 +152,7 @@ public:
|
|||||||
*
|
*
|
||||||
* @return a unique thread identifier
|
* @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
|
* Get the thread's process id. This is the pthread_t or pid_t value
|
||||||
|
|||||||
@@ -63,6 +63,13 @@ class BoundingSphereImpl
|
|||||||
* otherwise. */
|
* otherwise. */
|
||||||
inline bool valid() const { return _radius>=0.0; }
|
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; }
|
||||||
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; }
|
||||||
|
|
||||||
|
|||||||
@@ -121,6 +121,32 @@ class OSG_EXPORT Callback : public virtual Object {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Convenience method to find a nested callback by type. */
|
||||||
|
template <typename T>
|
||||||
|
static T* findNestedCallback(osg::Callback* callback)
|
||||||
|
{
|
||||||
|
if (!callback)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
if (T* cb = dynamic_cast<T*>(callback))
|
||||||
|
return cb;
|
||||||
|
|
||||||
|
return findNestedCallback<T>(callback->getNestedCallback());
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Convenience method to find a nested callback by type. */
|
||||||
|
template <typename T>
|
||||||
|
static const T* findNestedCallback(const osg::Callback* callback)
|
||||||
|
{
|
||||||
|
if (!callback)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
if (const T* cb = dynamic_cast<const T*>(callback))
|
||||||
|
return cb;
|
||||||
|
|
||||||
|
return findNestedCallback<T>(callback->getNestedCallback());
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
virtual ~Callback() {}
|
virtual ~Callback() {}
|
||||||
|
|||||||
@@ -149,6 +149,15 @@ class VertexAttribAlias
|
|||||||
_osgName(osgName),
|
_osgName(osgName),
|
||||||
_declaration(declaration) {}
|
_declaration(declaration) {}
|
||||||
|
|
||||||
|
VertexAttribAlias& operator = (const VertexAttribAlias& rhs)
|
||||||
|
{
|
||||||
|
_location = rhs._location;
|
||||||
|
_glName = rhs._glName;
|
||||||
|
_osgName = rhs._osgName;
|
||||||
|
_declaration = rhs._declaration;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
GLuint _location;
|
GLuint _location;
|
||||||
std::string _glName;
|
std::string _glName;
|
||||||
std::string _osgName;
|
std::string _osgName;
|
||||||
@@ -521,6 +530,7 @@ class OSG_EXPORT GLExtensions : public osg::Referenced
|
|||||||
bool isTextureCompressionETC2Supported;
|
bool isTextureCompressionETC2Supported;
|
||||||
bool isTextureCompressionRGTCSupported;
|
bool isTextureCompressionRGTCSupported;
|
||||||
bool isTextureCompressionPVRTCSupported;
|
bool isTextureCompressionPVRTCSupported;
|
||||||
|
bool isTextureCompressionASTCSupported;
|
||||||
bool isTextureMirroredRepeatSupported;
|
bool isTextureMirroredRepeatSupported;
|
||||||
bool isTextureEdgeClampSupported;
|
bool isTextureEdgeClampSupported;
|
||||||
bool isTextureBorderClampSupported;
|
bool isTextureBorderClampSupported;
|
||||||
@@ -530,6 +540,7 @@ class OSG_EXPORT GLExtensions : public osg::Referenced
|
|||||||
bool isShadowSupported;
|
bool isShadowSupported;
|
||||||
bool isShadowAmbientSupported;
|
bool isShadowAmbientSupported;
|
||||||
bool isTextureMaxLevelSupported;
|
bool isTextureMaxLevelSupported;
|
||||||
|
bool isTextureLODBiasSupported;
|
||||||
GLint maxTextureSize;
|
GLint maxTextureSize;
|
||||||
bool isClientStorageSupported;
|
bool isClientStorageSupported;
|
||||||
bool isTextureIntegerEXTSupported;
|
bool isTextureIntegerEXTSupported;
|
||||||
@@ -656,6 +667,9 @@ class OSG_EXPORT GLExtensions : public osg::Referenced
|
|||||||
// FrameBuferObject
|
// FrameBuferObject
|
||||||
bool isFrameBufferObjectSupported;
|
bool isFrameBufferObjectSupported;
|
||||||
bool isPackedDepthStencilSupported;
|
bool isPackedDepthStencilSupported;
|
||||||
|
bool isMultisampledRenderToTextureSupported;
|
||||||
|
bool isInvalidateFramebufferSupported;
|
||||||
|
|
||||||
bool isRenderbufferMultisampleSupported() const { return glRenderbufferStorageMultisample != 0; }
|
bool isRenderbufferMultisampleSupported() const { return glRenderbufferStorageMultisample != 0; }
|
||||||
bool isRenderbufferMultisampleCoverageSupported() const { return glRenderbufferStorageMultisampleCoverageNV != 0; }
|
bool isRenderbufferMultisampleCoverageSupported() const { return glRenderbufferStorageMultisampleCoverageNV != 0; }
|
||||||
|
|
||||||
@@ -672,6 +686,7 @@ class OSG_EXPORT GLExtensions : public osg::Referenced
|
|||||||
|
|
||||||
void (GL_APIENTRY * glFramebufferTexture1D) (GLenum, GLenum, GLenum, GLuint, GLint);
|
void (GL_APIENTRY * glFramebufferTexture1D) (GLenum, GLenum, GLenum, GLuint, GLint);
|
||||||
void (GL_APIENTRY * glFramebufferTexture2D) (GLenum, GLenum, GLenum, GLuint, GLint);
|
void (GL_APIENTRY * glFramebufferTexture2D) (GLenum, GLenum, GLenum, GLuint, GLint);
|
||||||
|
void (GL_APIENTRY * glFramebufferTexture2DMultisample) (GLenum, GLenum, GLenum, GLuint, GLint, GLsizei);
|
||||||
void (GL_APIENTRY * glFramebufferTexture3D) (GLenum, GLenum, GLenum, GLuint, GLint, GLint);
|
void (GL_APIENTRY * glFramebufferTexture3D) (GLenum, GLenum, GLenum, GLuint, GLint, GLint);
|
||||||
void (GL_APIENTRY * glFramebufferTexture) (GLenum, GLenum, GLint, GLint);
|
void (GL_APIENTRY * glFramebufferTexture) (GLenum, GLenum, GLint, GLint);
|
||||||
void (GL_APIENTRY * glFramebufferTextureLayer) (GLenum, GLenum, GLuint, GLint, GLint);
|
void (GL_APIENTRY * glFramebufferTextureLayer) (GLenum, GLenum, GLuint, GLint, GLint);
|
||||||
@@ -680,6 +695,7 @@ class OSG_EXPORT GLExtensions : public osg::Referenced
|
|||||||
|
|
||||||
void (GL_APIENTRY * glGenerateMipmap) (GLenum);
|
void (GL_APIENTRY * glGenerateMipmap) (GLenum);
|
||||||
void (GL_APIENTRY * glBlitFramebuffer) (GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum);
|
void (GL_APIENTRY * glBlitFramebuffer) (GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum);
|
||||||
|
void (GL_APIENTRY * glInvalidateFramebuffer) (GLenum, GLsizei, const GLenum*); // GL_ARB_invalidate_subdata or GL 4.3 or GLES 3
|
||||||
void (GL_APIENTRY * glGetRenderbufferParameteriv) (GLenum, GLenum, GLint*);
|
void (GL_APIENTRY * glGetRenderbufferParameteriv) (GLenum, GLenum, GLint*);
|
||||||
|
|
||||||
//ARB_framebuffer_no_attachments
|
//ARB_framebuffer_no_attachments
|
||||||
|
|||||||
@@ -390,7 +390,7 @@ class OSG_EXPORT GraphicsContext : public Object
|
|||||||
bool releaseContext();
|
bool releaseContext();
|
||||||
|
|
||||||
/** Return true if the current thread has this OpenGL graphics context.*/
|
/** Return true if the current thread has this OpenGL graphics context.*/
|
||||||
inline bool isCurrent() const { return _threadOfLastMakeCurrent == OpenThreads::Thread::CurrentThread(); }
|
inline bool isCurrent() const { return _threadOfLastMakeCurrent == OpenThreads::Thread::CurrentThreadId(); }
|
||||||
|
|
||||||
/** Bind the graphics context to associated texture.*/
|
/** Bind the graphics context to associated texture.*/
|
||||||
inline void bindPBufferToTexture(GLenum buffer) { bindPBufferToTextureImplementation(buffer); }
|
inline void bindPBufferToTexture(GLenum buffer) { bindPBufferToTextureImplementation(buffer); }
|
||||||
@@ -547,7 +547,7 @@ class OSG_EXPORT GraphicsContext : public Object
|
|||||||
Vec4 _clearColor;
|
Vec4 _clearColor;
|
||||||
GLbitfield _clearMask;
|
GLbitfield _clearMask;
|
||||||
|
|
||||||
OpenThreads::Thread* _threadOfLastMakeCurrent;
|
size_t _threadOfLastMakeCurrent;
|
||||||
|
|
||||||
OpenThreads::Mutex _operationsMutex;
|
OpenThreads::Mutex _operationsMutex;
|
||||||
osg::ref_ptr<osg::RefBlock> _operationsBlock;
|
osg::ref_ptr<osg::RefBlock> _operationsBlock;
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ public:
|
|||||||
void notify(osg::NotifySeverity severity, const char *message);
|
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
|
/** Redirects notification stream to windows debugger with use of
|
||||||
* OuputDebugString functions.
|
* OuputDebugString functions.
|
||||||
|
|||||||
@@ -82,9 +82,9 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** return a QueryResult for specified Camera, where the QueryResult.valid is true when query results are available, and in which case the QueryResult.numPixels provides the num of pixels in the query result.*/
|
/** return a QueryResult for specified Camera, where the QueryResult.valid is true when query results are available, and in which case the QueryResult.numPixels provides the num of pixels in the query result.*/
|
||||||
QueryResult getQueryResult( const osg::Camera* cam );
|
QueryResult getQueryResult( const osg::Camera* cam ) const;
|
||||||
|
|
||||||
unsigned int getNumPixels( const osg::Camera* cam );
|
unsigned int getNumPixels( const osg::Camera* cam ) const;
|
||||||
|
|
||||||
virtual void releaseGLObjects( osg::State* state = 0 ) const;
|
virtual void releaseGLObjects( osg::State* state = 0 ) const;
|
||||||
|
|
||||||
@@ -158,8 +158,11 @@ public:
|
|||||||
osg::StateSet* getQueryStateSet();
|
osg::StateSet* getQueryStateSet();
|
||||||
const osg::StateSet* getQueryStateSet() const;
|
const osg::StateSet* getQueryStateSet() const;
|
||||||
|
|
||||||
// Get the QueryGeometry object used for occlusion query. Returns 0 if no QueryGeometry is created.
|
// Set and get the QueryGeometry object used for the occlusion query.
|
||||||
osg::QueryGeometry* getQueryGeometry();
|
// 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;
|
const osg::QueryGeometry* getQueryGeometry() const;
|
||||||
|
|
||||||
// Set and get the StateSet used by the OcclusionQueryNode
|
// Set and get the StateSet used by the OcclusionQueryNode
|
||||||
@@ -189,17 +192,30 @@ public:
|
|||||||
static void discardDeletedQueryObjects( unsigned int contextID );
|
static void discardDeletedQueryObjects( unsigned int contextID );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
enum QueryGeometryState {
|
||||||
|
INVALID,
|
||||||
|
VALID,
|
||||||
|
USER_DEFINED
|
||||||
|
};
|
||||||
|
|
||||||
virtual ~OcclusionQueryNode();
|
virtual ~OcclusionQueryNode();
|
||||||
|
|
||||||
virtual void createSupportNodes();
|
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 > _queryGeode;
|
||||||
osg::ref_ptr< osg::Geode > _debugGeode;
|
osg::ref_ptr< osg::Geode > _debugGeode;
|
||||||
|
|
||||||
bool _enabled;
|
bool _enabled;
|
||||||
|
|
||||||
// If the box of the query geometry is valid.
|
mutable QueryGeometryState _queryGeometryState;
|
||||||
mutable bool _validQueryGeometry;
|
|
||||||
|
|
||||||
// Tracks the last frame number that we performed a query.
|
// Tracks the last frame number that we performed a query.
|
||||||
// User can set how many times (See setQueryFrameCount).
|
// User can set how many times (See setQueryFrameCount).
|
||||||
|
|||||||
@@ -53,6 +53,14 @@ class OSG_EXPORT Quat
|
|||||||
_v[3]=w;
|
_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 )
|
inline Quat( const Vec4f& v )
|
||||||
{
|
{
|
||||||
_v[0]=v.x();
|
_v[0]=v.x();
|
||||||
|
|||||||
@@ -1328,12 +1328,12 @@ class OSG_EXPORT State : public Referenced
|
|||||||
inline void popModeList(ModeMap& modeMap,const StateSet::ModeList& modeList);
|
inline void popModeList(ModeMap& modeMap,const StateSet::ModeList& modeList);
|
||||||
inline void popAttributeList(AttributeMap& attributeMap,const StateSet::AttributeList& attributeList);
|
inline void popAttributeList(AttributeMap& attributeMap,const StateSet::AttributeList& attributeList);
|
||||||
inline void popUniformList(UniformMap& uniformMap,const StateSet::UniformList& uniformList);
|
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 applyModeList(ModeMap& modeMap,const StateSet::ModeList& modeList);
|
||||||
inline void applyAttributeList(AttributeMap& attributeMap,const StateSet::AttributeList& attributeList);
|
inline void applyAttributeList(AttributeMap& attributeMap,const StateSet::AttributeList& attributeList);
|
||||||
inline void applyUniformList(UniformMap& uniformMap,const StateSet::UniformList& uniformList);
|
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 applyModeMap(ModeMap& modeMap);
|
||||||
inline void applyAttributeMap(AttributeMap& attributeMap);
|
inline void applyAttributeMap(AttributeMap& attributeMap);
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ public:
|
|||||||
unsigned int pos=first;
|
unsigned int pos=first;
|
||||||
for(GLsizei i=3;i<count;i+=2,pos+=2)
|
for(GLsizei i=3;i<count;i+=2,pos+=2)
|
||||||
{
|
{
|
||||||
this->operator()(pos,pos+1,pos+2,pos+3);
|
this->operator()(pos,pos+1,pos+3,pos+2);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -187,7 +187,7 @@ public:
|
|||||||
IndexPointer iptr = indices;
|
IndexPointer iptr = indices;
|
||||||
for(GLsizei i=3;i<count;i+=2,iptr+=2)
|
for(GLsizei i=3;i<count;i+=2,iptr+=2)
|
||||||
{
|
{
|
||||||
this->operator()(*(iptr),*(iptr+1),*(iptr+2),*(iptr+3));
|
this->operator()(*(iptr),*(iptr+1),*(iptr+3),*(iptr+2));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -283,7 +283,7 @@ public:
|
|||||||
IndexPointer iptr = indices;
|
IndexPointer iptr = indices;
|
||||||
for(GLsizei i=3;i<count;i+=2,iptr+=2)
|
for(GLsizei i=3;i<count;i+=2,iptr+=2)
|
||||||
{
|
{
|
||||||
this->operator()(*(iptr),*(iptr+1),*(iptr+2),*(iptr+3));
|
this->operator()(*(iptr),*(iptr+1),*(iptr+3),*(iptr+2));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -378,7 +378,7 @@ public:
|
|||||||
IndexPointer iptr = indices;
|
IndexPointer iptr = indices;
|
||||||
for(GLsizei i=3;i<count;i+=2,iptr+=2)
|
for(GLsizei i=3;i<count;i+=2,iptr+=2)
|
||||||
{
|
{
|
||||||
this->operator()(*(iptr),*(iptr+1),*(iptr+2),*(iptr+3));
|
this->operator()(*(iptr),*(iptr+1),*(iptr+3),*(iptr+2));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,6 +62,10 @@
|
|||||||
#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
|
#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
|
||||||
#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
|
#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
|
||||||
#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
|
#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
|
#endif
|
||||||
|
|
||||||
#ifndef GL_EXT_texture_compression_rgtc
|
#ifndef GL_EXT_texture_compression_rgtc
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
namespace osg {
|
namespace osg {
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER) && !defined(__clang__)
|
||||||
typedef unsigned __int64 Timer_t;
|
typedef unsigned __int64 Timer_t;
|
||||||
#else
|
#else
|
||||||
typedef unsigned long long Timer_t;
|
typedef unsigned long long Timer_t;
|
||||||
|
|||||||
@@ -66,7 +66,6 @@ class MakeString
|
|||||||
inline operator std::string () const { return sstream.str(); }
|
inline operator std::string () const { return sstream.str(); }
|
||||||
|
|
||||||
inline std::string str() const { return sstream.str(); }
|
inline std::string str() const { return sstream.str(); }
|
||||||
inline const char* c_str() const { return sstream.str().c_str(); }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,9 @@ class ref_ptr
|
|||||||
ref_ptr() : _ptr(0) {}
|
ref_ptr() : _ptr(0) {}
|
||||||
ref_ptr(T* ptr) : _ptr(ptr) { if (_ptr) _ptr->ref(); }
|
ref_ptr(T* ptr) : _ptr(ptr) { if (_ptr) _ptr->ref(); }
|
||||||
ref_ptr(const ref_ptr& rp) : _ptr(rp._ptr) { if (_ptr) _ptr->ref(); }
|
ref_ptr(const ref_ptr& rp) : _ptr(rp._ptr) { if (_ptr) _ptr->ref(); }
|
||||||
|
#if __cplusplus >= 201103L
|
||||||
|
ref_ptr(ref_ptr&& rp) noexcept : _ptr(rp._ptr) { rp._ptr = 0; }
|
||||||
|
#endif
|
||||||
template<class Other> ref_ptr(const ref_ptr<Other>& rp) : _ptr(rp._ptr) { if (_ptr) _ptr->ref(); }
|
template<class Other> ref_ptr(const ref_ptr<Other>& rp) : _ptr(rp._ptr) { if (_ptr) _ptr->ref(); }
|
||||||
ref_ptr(observer_ptr<T>& optr) : _ptr(0) { optr.lock(*this); }
|
ref_ptr(observer_ptr<T>& optr) : _ptr(0) { optr.lock(*this); }
|
||||||
~ref_ptr() { if (_ptr) _ptr->unref(); _ptr = 0; }
|
~ref_ptr() { if (_ptr) _ptr->unref(); _ptr = 0; }
|
||||||
@@ -52,6 +55,17 @@ class ref_ptr
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if __cplusplus >= 201103L
|
||||||
|
template<class Other> ref_ptr& operator = (ref_ptr<Other>&& rp)
|
||||||
|
{
|
||||||
|
if (_ptr == rp._ptr) return *this;
|
||||||
|
if (_ptr != nullptr) _ptr->unref();
|
||||||
|
_ptr = rp._ptr;
|
||||||
|
rp._ptr = nullptr;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
inline ref_ptr& operator = (T* ptr)
|
inline ref_ptr& operator = (T* ptr)
|
||||||
{
|
{
|
||||||
if (_ptr==ptr) return *this;
|
if (_ptr==ptr) return *this;
|
||||||
|
|||||||
@@ -105,12 +105,12 @@ namespace osgAnimation
|
|||||||
// 2. build deduplicated list of keyframes
|
// 2. build deduplicated list of keyframes
|
||||||
unsigned int cumul = 0;
|
unsigned int cumul = 0;
|
||||||
VectorType deduplicated;
|
VectorType deduplicated;
|
||||||
for(std::vector<unsigned int>::iterator iterator = intervalSizes.begin() ; iterator != intervalSizes.end() ; ++ iterator) {
|
for(std::vector<unsigned int>::iterator it = intervalSizes.begin() ; it != intervalSizes.end() ; ++ it) {
|
||||||
deduplicated.push_back((*this)[cumul]);
|
deduplicated.push_back((*this)[cumul]);
|
||||||
if(*iterator > 1) {
|
if(*it > 1) {
|
||||||
deduplicated.push_back((*this)[cumul + (*iterator) - 1]);
|
deduplicated.push_back((*this)[cumul + (*it) - 1]);
|
||||||
}
|
}
|
||||||
cumul += *iterator;
|
cumul += *it;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int count = size() - deduplicated.size();
|
unsigned int count = size() - deduplicated.size();
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ class ReaderWriterInfo : public osg::Referenced
|
|||||||
ReaderWriter::FormatDescriptionMap protocols;
|
ReaderWriter::FormatDescriptionMap protocols;
|
||||||
ReaderWriter::FormatDescriptionMap extensions;
|
ReaderWriter::FormatDescriptionMap extensions;
|
||||||
ReaderWriter::FormatDescriptionMap options;
|
ReaderWriter::FormatDescriptionMap options;
|
||||||
|
ReaderWriter::FormatDescriptionMap environment;
|
||||||
ReaderWriter::Features features;
|
ReaderWriter::Features features;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@@ -63,6 +63,9 @@ class OSGDB_EXPORT ReaderWriter : public osg::Object
|
|||||||
/** Return which list of file extensions supported by ReaderWriter. */
|
/** Return which list of file extensions supported by ReaderWriter. */
|
||||||
virtual const FormatDescriptionMap& supportedOptions() const { return _supportedOptions; }
|
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.*/
|
/** Return true if ReaderWriter accepts specified file extension.*/
|
||||||
virtual bool acceptsExtension(const std::string& /*extension*/) const;
|
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. */
|
* Please note, this should usually only be used internally by subclasses of ReaderWriter. */
|
||||||
void supportsOption(const std::string& opt, const std::string& description);
|
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:
|
protected:
|
||||||
|
|
||||||
FormatDescriptionMap _supportedProtocols;
|
FormatDescriptionMap _supportedProtocols;
|
||||||
FormatDescriptionMap _supportedExtensions;
|
FormatDescriptionMap _supportedExtensions;
|
||||||
FormatDescriptionMap _supportedOptions;
|
FormatDescriptionMap _supportedOptions;
|
||||||
|
FormatDescriptionMap _supportedEnvironment;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,8 @@ namespace osgDB {
|
|||||||
The RegisterReaderWriterProxy can be used to automatically
|
The RegisterReaderWriterProxy can be used to automatically
|
||||||
register at runtime a reader/writer with the Registry.
|
register at runtime a reader/writer with the Registry.
|
||||||
*/
|
*/
|
||||||
class OSGDB_EXPORT Registry : public osg::Referenced
|
class OSGDB_EXPORT Registry : osg::depends_on<OpenThreads::Mutex*, osg::Referenced::getGlobalReferencedMutex>,
|
||||||
|
public osg::Referenced
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|||||||
@@ -60,7 +60,8 @@ class OSGTEXT_EXPORT String : public VectorUInt
|
|||||||
ENCODING_UTF32, /// 32-bit signature
|
ENCODING_UTF32, /// 32-bit signature
|
||||||
ENCODING_UTF32_BE, /// 32-bit big-endian
|
ENCODING_UTF32_BE, /// 32-bit big-endian
|
||||||
ENCODING_UTF32_LE, /// 32-bit little-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
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -265,7 +265,6 @@ protected:
|
|||||||
virtual osg::StateSet* createStateSet();
|
virtual osg::StateSet* createStateSet();
|
||||||
|
|
||||||
Font* getActiveFont();
|
Font* getActiveFont();
|
||||||
const Font* getActiveFont() const;
|
|
||||||
|
|
||||||
String::iterator computeLastCharacterOnLine(osg::Vec2& cursor, String::iterator first,String::iterator last);
|
String::iterator computeLastCharacterOnLine(osg::Vec2& cursor, String::iterator first,String::iterator last);
|
||||||
|
|
||||||
|
|||||||
@@ -312,6 +312,7 @@ protected:
|
|||||||
// members which have public access.
|
// members which have public access.
|
||||||
osg::Vec4 _color;
|
osg::Vec4 _color;
|
||||||
osg::ref_ptr<Font> _font;
|
osg::ref_ptr<Font> _font;
|
||||||
|
osg::ref_ptr<Font> _fontFallback;
|
||||||
osg::ref_ptr<Style> _style;
|
osg::ref_ptr<Style> _style;
|
||||||
FontResolution _fontSize;
|
FontResolution _fontSize;
|
||||||
float _characterHeight;
|
float _characterHeight;
|
||||||
|
|||||||
@@ -38,6 +38,8 @@ class OSGUTIL_EXPORT RenderStage : public RenderBin
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
typedef std::pair< int , osg::ref_ptr<RenderStage> > RenderStageOrderPair;
|
||||||
|
typedef std::list< RenderStageOrderPair > RenderStageList;
|
||||||
|
|
||||||
RenderStage();
|
RenderStage();
|
||||||
RenderStage(SortMode mode);
|
RenderStage(SortMode mode);
|
||||||
@@ -236,6 +238,12 @@ class OSGUTIL_EXPORT RenderStage : public RenderBin
|
|||||||
|
|
||||||
void addPostRenderStage(RenderStage* rs, int order = 0);
|
void addPostRenderStage(RenderStage* rs, int order = 0);
|
||||||
|
|
||||||
|
const RenderStageList& getPreRenderList() const { return _preRenderList; }
|
||||||
|
RenderStageList& getPreRenderList() { return _preRenderList; }
|
||||||
|
|
||||||
|
const RenderStageList& getPostRenderList() const { return _postRenderList; }
|
||||||
|
RenderStageList& getPostRenderList() { return _postRenderList; }
|
||||||
|
|
||||||
/** Extract stats for current draw list. */
|
/** Extract stats for current draw list. */
|
||||||
bool getStats(Statistics& stats) const;
|
bool getStats(Statistics& stats) const;
|
||||||
|
|
||||||
@@ -266,8 +274,6 @@ protected:
|
|||||||
|
|
||||||
virtual ~RenderStage();
|
virtual ~RenderStage();
|
||||||
|
|
||||||
typedef std::pair< int , osg::ref_ptr<RenderStage> > RenderStageOrderPair;
|
|
||||||
typedef std::list< RenderStageOrderPair > RenderStageList;
|
|
||||||
typedef std::vector< osg::ref_ptr<osg::Camera> > Cameras;
|
typedef std::vector< osg::ref_ptr<osg::Camera> > Cameras;
|
||||||
|
|
||||||
bool _stageDrawnThisFrame;
|
bool _stageDrawnThisFrame;
|
||||||
|
|||||||
@@ -283,10 +283,16 @@ struct GraphicsWindowFunctionProxy
|
|||||||
extern "C" void graphicswindow_##ext(void); \
|
extern "C" void graphicswindow_##ext(void); \
|
||||||
static osgViewer::GraphicsWindowFunctionProxy graphicswindowproxy_##ext(graphicswindow_##ext);
|
static osgViewer::GraphicsWindowFunctionProxy graphicswindowproxy_##ext(graphicswindow_##ext);
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(OSG_WINDOWING_SYSTEM_NONE)
|
||||||
|
#define USE_GRAPHICSWINDOW()
|
||||||
|
#elif defined(_WIN32)
|
||||||
#define USE_GRAPHICSWINDOW() USE_GRAPICSWINDOW_IMPLEMENTATION(Win32)
|
#define USE_GRAPHICSWINDOW() USE_GRAPICSWINDOW_IMPLEMENTATION(Win32)
|
||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__)
|
||||||
|
#if defined(OSG_WINDOWING_SYSTEM_CARBON)
|
||||||
#define USE_GRAPHICSWINDOW() USE_GRAPICSWINDOW_IMPLEMENTATION(Carbon)
|
#define USE_GRAPHICSWINDOW() USE_GRAPICSWINDOW_IMPLEMENTATION(Carbon)
|
||||||
|
#else
|
||||||
|
#define USE_GRAPHICSWINDOW() USE_GRAPICSWINDOW_IMPLEMENTATION(Cocoa)
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
#define USE_GRAPHICSWINDOW() USE_GRAPICSWINDOW_IMPLEMENTATION(X11)
|
#define USE_GRAPHICSWINDOW() USE_GRAPICSWINDOW_IMPLEMENTATION(X11)
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ public:
|
|||||||
Widget (const std::string& = "", point_type = 0.0f, point_type = 0.0f);
|
Widget (const std::string& = "", point_type = 0.0f, point_type = 0.0f);
|
||||||
Widget (const Widget&, const osg::CopyOp&);
|
Widget (const Widget&, const osg::CopyOp&);
|
||||||
|
|
||||||
META_Object (osgWidget, Widget);
|
META_Node (osgWidget, Widget);
|
||||||
|
|
||||||
virtual ~Widget() {
|
virtual ~Widget() {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,8 +80,15 @@ ELSE()
|
|||||||
# double check that pthread_setaffinity_np is available as FreeBSD header doesn't contain required function
|
# double check that pthread_setaffinity_np is available as FreeBSD header doesn't contain required function
|
||||||
CHECK_CXX_SOURCE_COMPILES("
|
CHECK_CXX_SOURCE_COMPILES("
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
#ifdef __FreeBSD__
|
||||||
|
#include <pthread_np.h>
|
||||||
|
#endif
|
||||||
int main() {
|
int main() {
|
||||||
|
#ifdef __FreeBSD__
|
||||||
|
cpuset_t cpumask;
|
||||||
|
#else
|
||||||
cpu_set_t cpumask;
|
cpu_set_t cpumask;
|
||||||
|
#endif
|
||||||
CPU_ZERO( &cpumask );
|
CPU_ZERO( &cpumask );
|
||||||
CPU_SET( 0, &cpumask );
|
CPU_SET( 0, &cpumask );
|
||||||
pthread_setaffinity_np( pthread_self(), sizeof(cpumask), &cpumask);
|
pthread_setaffinity_np( pthread_self(), sizeof(cpumask), &cpumask);
|
||||||
|
|||||||
@@ -21,6 +21,9 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
#if defined(HAVE_PTHREAD_SETAFFINITY_NP) && defined(__FreeBSD__)
|
||||||
|
#include <pthread_np.h>
|
||||||
|
#endif
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
|
||||||
#if defined __linux__ || defined __sun || defined __APPLE__ || ANDROID
|
#if defined __linux__ || defined __sun || defined __APPLE__ || ANDROID
|
||||||
@@ -45,6 +48,11 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(__APPLE__) || defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__ANDROID__)
|
||||||
|
# include <unistd.h>
|
||||||
|
# include <sys/syscall.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(__ANDROID__)
|
#if defined(__ANDROID__)
|
||||||
#ifndef PAGE_SIZE
|
#ifndef PAGE_SIZE
|
||||||
#define PAGE_SIZE 0x400
|
#define PAGE_SIZE 0x400
|
||||||
@@ -65,11 +73,6 @@ using namespace OpenThreads;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
|
||||||
// Initialize the static unique ids.
|
|
||||||
//
|
|
||||||
int PThreadPrivateData::nextId = 0;
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// Initialize thread master priority level
|
// Initialize thread master priority level
|
||||||
//
|
//
|
||||||
@@ -113,7 +116,11 @@ namespace OpenThreads
|
|||||||
static void setAffinity(const Affinity& affinity)
|
static void setAffinity(const Affinity& affinity)
|
||||||
{
|
{
|
||||||
//std::cout<<"setProcessAffinity : "<< affinity.activeCPUs.size() <<std::endl;
|
//std::cout<<"setProcessAffinity : "<< affinity.activeCPUs.size() <<std::endl;
|
||||||
|
#if defined(__FreeBSD__)
|
||||||
|
cpuset_t cpumask;
|
||||||
|
#else
|
||||||
cpu_set_t cpumask;
|
cpu_set_t cpumask;
|
||||||
|
#endif
|
||||||
CPU_ZERO( &cpumask );
|
CPU_ZERO( &cpumask );
|
||||||
unsigned int numprocessors = OpenThreads::GetNumberOfProcessors();
|
unsigned int numprocessors = OpenThreads::GetNumberOfProcessors();
|
||||||
if (affinity)
|
if (affinity)
|
||||||
@@ -177,8 +184,7 @@ private:
|
|||||||
|
|
||||||
Thread *thread = static_cast<Thread *>(data);
|
Thread *thread = static_cast<Thread *>(data);
|
||||||
|
|
||||||
PThreadPrivateData *pd =
|
PThreadPrivateData *pd = static_cast<PThreadPrivateData *>(thread->_prvData);
|
||||||
static_cast<PThreadPrivateData *>(thread->_prvData);
|
|
||||||
|
|
||||||
// set up processor affinity
|
// set up processor affinity
|
||||||
setAffinity( pd->affinity );
|
setAffinity( pd->affinity );
|
||||||
@@ -205,6 +211,8 @@ private:
|
|||||||
|
|
||||||
#endif // ] ALLOW_PRIORITY_SCHEDULING
|
#endif // ] ALLOW_PRIORITY_SCHEDULING
|
||||||
|
|
||||||
|
pd->uniqueId = Thread::CurrentThreadId();
|
||||||
|
|
||||||
pd->setRunning(true);
|
pd->setRunning(true);
|
||||||
|
|
||||||
// release the thread that created this thread.
|
// release the thread that created this thread.
|
||||||
@@ -221,7 +229,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
// Print information related to thread schduling parameters.
|
// Print information related to thread scheduling parameters.
|
||||||
//
|
//
|
||||||
static void PrintThreadSchedulingInfo(Thread *thread) {
|
static void PrintThreadSchedulingInfo(Thread *thread) {
|
||||||
|
|
||||||
@@ -456,6 +464,25 @@ Thread *Thread::CurrentThread()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t Thread::CurrentThreadId()
|
||||||
|
{
|
||||||
|
#if defined(__APPLE__)
|
||||||
|
return (size_t)::syscall(SYS_thread_selfid);
|
||||||
|
#elif defined(__ANDROID__)
|
||||||
|
return (size_t)gettid();
|
||||||
|
#elif defined(__linux__)
|
||||||
|
return (size_t)::syscall(SYS_gettid);
|
||||||
|
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||||
|
long tid;
|
||||||
|
syscall(SYS_thr_self, &tid);
|
||||||
|
return (size_t)tid;
|
||||||
|
#else
|
||||||
|
return (size_t)pthread_self();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// Description: Initialize Threading
|
// Description: Initialize Threading
|
||||||
@@ -521,7 +548,7 @@ void Thread::Init()
|
|||||||
//
|
//
|
||||||
// Use: public
|
// Use: public
|
||||||
//
|
//
|
||||||
int Thread::getThreadId()
|
size_t Thread::getThreadId()
|
||||||
{
|
{
|
||||||
|
|
||||||
PThreadPrivateData *pd = static_cast<PThreadPrivateData *> (_prvData);
|
PThreadPrivateData *pd = static_cast<PThreadPrivateData *> (_prvData);
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ int Condition::wait(Mutex *mutex, unsigned long int ms) {
|
|||||||
static_cast<PThreadMutexPrivateData *>(mutex->_prvData);
|
static_cast<PThreadMutexPrivateData *>(mutex->_prvData);
|
||||||
|
|
||||||
|
|
||||||
// wait time is now in ms milliseconds, so need to convert to seconds and nanoseconds for timespec strucuture.
|
// wait time is now in ms milliseconds, so need to convert to seconds and nanoseconds for timespec structure.
|
||||||
unsigned int sec = ms / 1000;
|
unsigned int sec = ms / 1000;
|
||||||
unsigned int nsec = (ms % 1000) * 1000000;
|
unsigned int nsec = (ms % 1000) * 1000000;
|
||||||
|
|
||||||
|
|||||||
@@ -49,8 +49,7 @@ private:
|
|||||||
setRunning(false);
|
setRunning(false);
|
||||||
isCanceled = false;
|
isCanceled = false;
|
||||||
tid = 0;
|
tid = 0;
|
||||||
uniqueId = nextId;
|
uniqueId = 0;
|
||||||
nextId++;
|
|
||||||
threadPriority = Thread::THREAD_PRIORITY_DEFAULT;
|
threadPriority = Thread::THREAD_PRIORITY_DEFAULT;
|
||||||
threadPolicy = Thread::THREAD_SCHEDULE_DEFAULT;
|
threadPolicy = Thread::THREAD_SCHEDULE_DEFAULT;
|
||||||
};
|
};
|
||||||
@@ -78,12 +77,10 @@ private:
|
|||||||
|
|
||||||
pthread_t tid;
|
pthread_t tid;
|
||||||
|
|
||||||
volatile int uniqueId;
|
size_t uniqueId;
|
||||||
|
|
||||||
Affinity affinity;
|
Affinity affinity;
|
||||||
|
|
||||||
static int nextId;
|
|
||||||
|
|
||||||
static pthread_key_t s_tls_key;
|
static pthread_key_t s_tls_key;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -43,11 +43,13 @@ IF(MSVC AND OSG_MSVC_VERSIONED_DLL)
|
|||||||
HANDLE_MSVC_DLL(ot ${OPENTHREADS_SOVERSION})
|
HANDLE_MSVC_DLL(ot ${OPENTHREADS_SOVERSION})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
SET(INSTALL_BINDIR bin)
|
||||||
|
|
||||||
INSTALL(
|
INSTALL(
|
||||||
TARGETS OpenThreads
|
TARGETS OpenThreads
|
||||||
ARCHIVE DESTINATION lib COMPONENT libopenthreads-dev
|
ARCHIVE DESTINATION lib COMPONENT libopenthreads-dev
|
||||||
LIBRARY DESTINATION lib COMPONENT libopenthreads
|
LIBRARY DESTINATION lib COMPONENT libopenthreads
|
||||||
RUNTIME DESTINATION bin COMPONENT libopenthreads
|
RUNTIME DESTINATION ${INSTALL_BINDIR} COMPONENT libopenthreads
|
||||||
)
|
)
|
||||||
INSTALL(
|
INSTALL(
|
||||||
FILES ${OpenThreads_PUBLIC_HEADERS}
|
FILES ${OpenThreads_PUBLIC_HEADERS}
|
||||||
@@ -55,4 +57,19 @@ INSTALL(
|
|||||||
COMPONENT libopenthreads-dev
|
COMPONENT libopenthreads-dev
|
||||||
)
|
)
|
||||||
|
|
||||||
|
IF(MSVC AND DYNAMIC_OPENSCENEGRAPH)
|
||||||
|
GET_TARGET_PROPERTY(PREFIX ${LIB_NAME} PREFIX)
|
||||||
|
IF("${PREFIX}" STREQUAL PREFIX-NOTFOUND) # Fix for PREFIX-NOTFOUND left in file names
|
||||||
|
SET(PREFIX "")
|
||||||
|
ENDIF()
|
||||||
|
IF( ${CMAKE_GENERATOR} STREQUAL "Ninja" )
|
||||||
|
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PREFIX}${LIB_NAME}${CMAKE_RELEASE_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenthreads CONFIGURATIONS Release)
|
||||||
|
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PREFIX}${LIB_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenthreads CONFIGURATIONS RelWithDebInfo)
|
||||||
|
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PREFIX}${LIB_NAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenthreads CONFIGURATIONS Debug)
|
||||||
|
ELSE( ${CMAKE_GENERATOR} STREQUAL "Ninja" )
|
||||||
|
INSTALL(FILES ${OUTPUT_BINDIR}/${PREFIX}${LIB_NAME}${CMAKE_RELWITHDEBINFO_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenthreads CONFIGURATIONS RelWithDebInfo)
|
||||||
|
INSTALL(FILES ${OUTPUT_BINDIR}/${PREFIX}${LIB_NAME}${CMAKE_DEBUG_POSTFIX}.pdb DESTINATION ${INSTALL_BINDIR} COMPONENT libopenthreads CONFIGURATIONS Debug)
|
||||||
|
ENDIF( ${CMAKE_GENERATOR} STREQUAL "Ninja" )
|
||||||
|
ENDIF(MSVC AND DYNAMIC_OPENSCENEGRAPH)
|
||||||
|
|
||||||
#commented out# INCLUDE(ModuleInstall OPTIONAL)
|
#commented out# INCLUDE(ModuleInstall OPTIONAL)
|
||||||
|
|||||||
@@ -103,6 +103,8 @@ namespace OpenThreads {
|
|||||||
|
|
||||||
pd->isRunning = true;
|
pd->isRunning = true;
|
||||||
|
|
||||||
|
pd->uniqueId = Thread::CurrentThreadId();
|
||||||
|
|
||||||
// release the thread that created this thread.
|
// release the thread that created this thread.
|
||||||
pd->threadStartedBlock.release();
|
pd->threadStartedBlock.release();
|
||||||
|
|
||||||
@@ -130,7 +132,7 @@ namespace OpenThreads {
|
|||||||
};
|
};
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
// Print information related to thread schduling parameters.
|
// Print information related to thread scheduling parameters.
|
||||||
//
|
//
|
||||||
static void PrintThreadSchedulingInfo(Thread *thread) {
|
static void PrintThreadSchedulingInfo(Thread *thread) {
|
||||||
|
|
||||||
@@ -210,6 +212,11 @@ Thread* Thread::CurrentThread()
|
|||||||
return (Thread* )TlsGetValue(ID);
|
return (Thread* )TlsGetValue(ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t Thread::CurrentThreadId()
|
||||||
|
{
|
||||||
|
return (size_t)::GetCurrentThreadId();
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// Description: Set the concurrency level (no-op)
|
// Description: Set the concurrency level (no-op)
|
||||||
@@ -300,7 +307,7 @@ void Thread::Init() {
|
|||||||
//
|
//
|
||||||
// Use: public
|
// Use: public
|
||||||
//
|
//
|
||||||
int Thread::getThreadId() {
|
size_t Thread::getThreadId() {
|
||||||
Win32ThreadPrivateData *pd = static_cast<Win32ThreadPrivateData *> (_prvData);
|
Win32ThreadPrivateData *pd = static_cast<Win32ThreadPrivateData *> (_prvData);
|
||||||
return pd->uniqueId;
|
return pd->uniqueId;
|
||||||
}
|
}
|
||||||
@@ -352,7 +359,7 @@ int Thread::start() {
|
|||||||
pd->tid.set( (void*)_beginthreadex(NULL,static_cast<unsigned>(pd->stackSize),ThreadPrivateActions::StartThread,static_cast<void *>(this),CREATE_SUSPENDED,&ID));
|
pd->tid.set( (void*)_beginthreadex(NULL,static_cast<unsigned>(pd->stackSize),ThreadPrivateActions::StartThread,static_cast<void *>(this),CREATE_SUSPENDED,&ID));
|
||||||
ResumeThread(pd->tid.get());
|
ResumeThread(pd->tid.get());
|
||||||
|
|
||||||
pd->uniqueId = (int)ID;
|
pd->uniqueId = (size_t)ID;
|
||||||
|
|
||||||
if(!pd->tid) {
|
if(!pd->tid) {
|
||||||
return -1;
|
return -1;
|
||||||
@@ -442,9 +449,9 @@ int Thread::testCancel()
|
|||||||
if(pd->cancelMode == 2)
|
if(pd->cancelMode == 2)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
DWORD curr = GetCurrentThreadId();
|
size_t curr = Thread::CurrentThreadId();
|
||||||
|
|
||||||
if( pd->uniqueId != (int)curr )
|
if( pd->uniqueId != curr )
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
// pd->isRunning = false;
|
// pd->isRunning = false;
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ private:
|
|||||||
|
|
||||||
HandleHolder tid;
|
HandleHolder tid;
|
||||||
|
|
||||||
int uniqueId;
|
size_t uniqueId;
|
||||||
|
|
||||||
Affinity affinity;
|
Affinity affinity;
|
||||||
|
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ void ApplicationUsage::getFormattedString(std::string& str, const UsageMap& um,u
|
|||||||
std::string::size_type slashn_pos = explanation.find('\n',pos);
|
std::string::size_type slashn_pos = explanation.find('\n',pos);
|
||||||
|
|
||||||
unsigned int extraSkip = 0;
|
unsigned int extraSkip = 0;
|
||||||
bool concatinated = false;
|
bool concatenated = false;
|
||||||
if (slashn_pos!=std::string::npos)
|
if (slashn_pos!=std::string::npos)
|
||||||
{
|
{
|
||||||
if (slashn_pos<pos+width)
|
if (slashn_pos<pos+width)
|
||||||
@@ -227,13 +227,13 @@ void ApplicationUsage::getFormattedString(std::string& str, const UsageMap& um,u
|
|||||||
// word must be longer than a whole line so will need
|
// word must be longer than a whole line so will need
|
||||||
// to concatenate it.
|
// to concatenate it.
|
||||||
width = explanationWidth-1;
|
width = explanationWidth-1;
|
||||||
concatinated = true;
|
concatenated = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
line.replace(explanationPos+offset,explanationWidth, explanation, pos, width);
|
line.replace(explanationPos+offset,explanationWidth, explanation, pos, width);
|
||||||
|
|
||||||
if (concatinated) { str += line; str += "-\n"; }
|
if (concatenated) { str += line; str += "-\n"; }
|
||||||
else { str += line; str += "\n"; }
|
else { str += line; str += "\n"; }
|
||||||
|
|
||||||
// move to the next line of output.
|
// move to the next line of output.
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ ArgumentParser::ArgumentParser(int* argc,char **argv):
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
// Remove linefeed from last argument if it exist
|
// Remove linefeed from last argument if it exist
|
||||||
char* lastline = argc==0 ? 0 : _argv[*argc-1];
|
char* lastline = argc==0 ? 0 : _argv[*argc-1];
|
||||||
if (lastline)
|
if (lastline)
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ osg::Matrixd AutoTransform::computeMatrix(const osg::NodeVisitor* nv) const
|
|||||||
{
|
{
|
||||||
double size = 1.0/cs->pixelSize(getPosition(),0.48f);
|
double size = 1.0/cs->pixelSize(getPosition(),0.48f);
|
||||||
|
|
||||||
//if (_autoScaleTransitionWidthRatio>0.0)
|
if (_autoScaleTransitionWidthRatio>0.0)
|
||||||
{
|
{
|
||||||
if (_minimumScale>0.0)
|
if (_minimumScale>0.0)
|
||||||
{
|
{
|
||||||
@@ -185,6 +185,18 @@ osg::Matrixd AutoTransform::computeMatrix(const osg::NodeVisitor* nv) const
|
|||||||
else if (size>m) size = a + b*size + c*(size*size);
|
else if (size>m) size = a + b*size + c*(size*size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (_minimumScale>0.0 && size<_minimumScale)
|
||||||
|
{
|
||||||
|
size = _minimumScale;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_maximumScale<DBL_MAX && size>_maximumScale)
|
||||||
|
{
|
||||||
|
size = _maximumScale;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// TODO setScale(size);
|
// TODO setScale(size);
|
||||||
scale.set(size, size, size);
|
scale.set(size, size, size);
|
||||||
|
|||||||
@@ -815,7 +815,7 @@ void GLBufferObjectSet::remove(GLBufferObject* to)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// 'to' was tail so assing tail to the previous in list
|
// 'to' was tail so assign tail to the previous in list
|
||||||
_tail = to->_previous;
|
_tail = to->_previous;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,9 @@ void ClampColor::apply(State& state) const
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined(OSG_GL3_AVAILABLE)
|
||||||
extensions->glClampColor(GL_CLAMP_VERTEX_COLOR, _clampVertexColor);
|
extensions->glClampColor(GL_CLAMP_VERTEX_COLOR, _clampVertexColor);
|
||||||
extensions->glClampColor(GL_CLAMP_FRAGMENT_COLOR, _clampFragmentColor);
|
extensions->glClampColor(GL_CLAMP_FRAGMENT_COLOR, _clampFragmentColor);
|
||||||
|
#endif
|
||||||
extensions->glClampColor(GL_CLAMP_READ_COLOR, _clampReadColor);
|
extensions->glClampColor(GL_CLAMP_READ_COLOR, _clampReadColor);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,5 +36,7 @@
|
|||||||
#cmakedefine OSG_PROVIDE_READFILE
|
#cmakedefine OSG_PROVIDE_READFILE
|
||||||
#cmakedefine OSG_USE_DEPRECATED_API
|
#cmakedefine OSG_USE_DEPRECATED_API
|
||||||
#cmakedefine OSG_ENVVAR_SUPPORTED
|
#cmakedefine OSG_ENVVAR_SUPPORTED
|
||||||
|
#cmakedefine OSG_WINDOWING_SYSTEM_CARBON
|
||||||
|
#cmakedefine OSG_WINDOWING_SYSTEM_NONE
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -22,16 +22,16 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
using namespace osg;
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
#if defined(WIN32) && !defined(__CYGWIN__)
|
|
||||||
#include<windows.h>
|
#include<windows.h>
|
||||||
extern "C" { OSG_EXPORT DWORD NvOptimusEnablement=0x00000001; }
|
extern "C" { OSG_EXPORT DWORD NvOptimusEnablement=0x00000001; }
|
||||||
#else
|
#else
|
||||||
extern "C" { int NvOptimusEnablement=0x00000001; }
|
extern "C" { int NvOptimusEnablement=0x00000001; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
using namespace osg;
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
void DisplaySettings::setNvOptimusEnablement(int value)
|
void DisplaySettings::setNvOptimusEnablement(int value)
|
||||||
{
|
{
|
||||||
NvOptimusEnablement = value;
|
NvOptimusEnablement = value;
|
||||||
@@ -120,7 +120,7 @@ void DisplaySettings::setDisplaySettings(const DisplaySettings& vs)
|
|||||||
|
|
||||||
_vertexBufferHint = vs._vertexBufferHint;
|
_vertexBufferHint = vs._vertexBufferHint;
|
||||||
|
|
||||||
setShaderHint(_shaderHint);
|
setShaderHint(vs._shaderHint);
|
||||||
|
|
||||||
_keystoneHint = vs._keystoneHint;
|
_keystoneHint = vs._keystoneHint;
|
||||||
_keystoneFileNames = vs._keystoneFileNames;
|
_keystoneFileNames = vs._keystoneFileNames;
|
||||||
@@ -719,7 +719,7 @@ void DisplaySettings::readEnvironmentalVariables()
|
|||||||
|
|
||||||
if (getEnvVar("OSG_KEYSTONE_FILES", value))
|
if (getEnvVar("OSG_KEYSTONE_FILES", value))
|
||||||
{
|
{
|
||||||
#if defined(WIN32) && !defined(__CYGWIN__)
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||||
char delimitor = ';';
|
char delimitor = ';';
|
||||||
#else
|
#else
|
||||||
char delimitor = ':';
|
char delimitor = ':';
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
#define OSG_GL_CONTEXT_VERSION "@OSG_GL_CONTEXT_VERSION@"
|
#define OSG_GL_CONTEXT_VERSION "@OSG_GL_CONTEXT_VERSION@"
|
||||||
|
|
||||||
|
|
||||||
#ifndef WIN32
|
#ifndef _WIN32
|
||||||
|
|
||||||
// Required for compatibility with glext.h style function definitions of
|
// Required for compatibility with glext.h style function definitions of
|
||||||
// OpenGL extensions, such as in src/osg/Point.cpp.
|
// OpenGL extensions, such as in src/osg/Point.cpp.
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
#define APIENTRY
|
#define APIENTRY
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else // WIN32
|
#else // _WIN32
|
||||||
|
|
||||||
#if defined(__CYGWIN__) || defined(__MINGW32__)
|
#if defined(__CYGWIN__) || defined(__MINGW32__)
|
||||||
|
|
||||||
@@ -103,7 +103,7 @@
|
|||||||
#define _WCHAR_T_DEFINED
|
#define _WCHAR_T_DEFINED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // WIN32
|
#endif // _WIN32
|
||||||
|
|
||||||
#if defined(OSG_GL3_AVAILABLE)
|
#if defined(OSG_GL3_AVAILABLE)
|
||||||
#define GL3_PROTOTYPES 1
|
#define GL3_PROTOTYPES 1
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
#include <set>
|
#include <set>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
#if defined(WIN32)
|
#if defined(_WIN32)
|
||||||
#ifndef WIN32_LEAN_AND_MEAN
|
#ifndef WIN32_LEAN_AND_MEAN
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#endif // WIN32_LEAN_AND_MEAN
|
#endif // WIN32_LEAN_AND_MEAN
|
||||||
@@ -174,7 +174,7 @@ bool osg::isGLExtensionOrVersionSupported(unsigned int contextID, const char *ex
|
|||||||
if (*startOfWord!=0) extensionSet.insert(std::string(startOfWord));
|
if (*startOfWord!=0) extensionSet.insert(std::string(startOfWord));
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(WIN32) && (defined(OSG_GL1_AVAILABLE) || defined(OSG_GL2_AVAILABLE) || defined(OSG_GL3_AVAILABLE))
|
#if defined(_WIN32) && (defined(OSG_GL1_AVAILABLE) || defined(OSG_GL2_AVAILABLE) || defined(OSG_GL3_AVAILABLE))
|
||||||
|
|
||||||
// add WGL extensions to the list
|
// add WGL extensions to the list
|
||||||
|
|
||||||
@@ -340,7 +340,7 @@ OSG_INIT_SINGLETON_PROXY(GLExtensionDisableStringInitializationProxy, osg::getGL
|
|||||||
#endif
|
#endif
|
||||||
return dlsym(handle, funcName);
|
return dlsym(handle, funcName);
|
||||||
|
|
||||||
#elif defined(WIN32)
|
#elif defined(_WIN32)
|
||||||
|
|
||||||
#if defined(OSG_GLES2_AVAILABLE)
|
#if defined(OSG_GLES2_AVAILABLE)
|
||||||
static HMODULE hmodule = GetModuleHandle(TEXT("libGLESv2.dll"));
|
static HMODULE hmodule = GetModuleHandle(TEXT("libGLESv2.dll"));
|
||||||
@@ -721,9 +721,9 @@ GLExtensions::GLExtensions(unsigned int in_contextID):
|
|||||||
setGLExtensionFuncPtr(glTexBuffer, "glTexBuffer","glTexBufferARB" , validContext);
|
setGLExtensionFuncPtr(glTexBuffer, "glTexBuffer","glTexBufferARB" , validContext);
|
||||||
|
|
||||||
isVBOSupported = validContext && (OSG_GLES2_FEATURES || OSG_GLES3_FEATURES || OSG_GL3_FEATURES || osg::isGLExtensionSupported(contextID,"GL_ARB_vertex_buffer_object"));
|
isVBOSupported = validContext && (OSG_GLES2_FEATURES || OSG_GLES3_FEATURES || OSG_GL3_FEATURES || osg::isGLExtensionSupported(contextID,"GL_ARB_vertex_buffer_object"));
|
||||||
isPBOSupported = validContext && (OSG_GLES3_FEATURES || OSG_GL3_FEATURES || osg::isGLExtensionSupported(contextID,"GL_ARB_pixel_buffer_object"));
|
isPBOSupported = validContext && ((OSG_GLES3_FEATURES && glVersion >= 3.0) || OSG_GL3_FEATURES || osg::isGLExtensionSupported(contextID,"GL_ARB_pixel_buffer_object"));
|
||||||
isTBOSupported = validContext && osg::isGLExtensionSupported(contextID,"GL_ARB_texture_buffer_object");
|
isTBOSupported = validContext && osg::isGLExtensionSupported(contextID,"GL_ARB_texture_buffer_object");
|
||||||
isVAOSupported = validContext && (OSG_GLES3_FEATURES || OSG_GL3_FEATURES || osg::isGLExtensionSupported(contextID, "GL_ARB_vertex_array_object", "GL_OES_vertex_array_object"));
|
isVAOSupported = validContext && ((OSG_GLES3_FEATURES && glVersion >= 3.0) || OSG_GL3_FEATURES || osg::isGLExtensionSupported(contextID, "GL_ARB_vertex_array_object", "GL_OES_vertex_array_object"));
|
||||||
isTransformFeedbackSupported = validContext && osg::isGLExtensionSupported(contextID, "GL_ARB_transform_feedback2");
|
isTransformFeedbackSupported = validContext && osg::isGLExtensionSupported(contextID, "GL_ARB_transform_feedback2");
|
||||||
isBufferObjectSupported = isVBOSupported || isPBOSupported;
|
isBufferObjectSupported = isVBOSupported || isPBOSupported;
|
||||||
|
|
||||||
@@ -746,7 +746,7 @@ GLExtensions::GLExtensions(unsigned int in_contextID):
|
|||||||
isOcclusionQuerySupported = validContext && osg::isGLExtensionSupported(contextID, "GL_NV_occlusion_query");
|
isOcclusionQuerySupported = validContext && osg::isGLExtensionSupported(contextID, "GL_NV_occlusion_query");
|
||||||
isARBOcclusionQuerySupported = validContext && (OSG_GL3_FEATURES || osg::isGLExtensionSupported(contextID, "GL_ARB_occlusion_query"));
|
isARBOcclusionQuerySupported = validContext && (OSG_GL3_FEATURES || osg::isGLExtensionSupported(contextID, "GL_ARB_occlusion_query"));
|
||||||
|
|
||||||
isTimerQuerySupported = validContext && osg::isGLExtensionSupported(contextID, "GL_EXT_timer_query");
|
isTimerQuerySupported = validContext && (osg::isGLExtensionSupported(contextID, "GL_EXT_timer_query") || osg::isGLExtensionSupported(contextID, "GL_EXT_disjoint_timer_query"));
|
||||||
isARBTimerQuerySupported = validContext && osg::isGLExtensionSupported(contextID, "GL_ARB_timer_query");
|
isARBTimerQuerySupported = validContext && osg::isGLExtensionSupported(contextID, "GL_ARB_timer_query");
|
||||||
|
|
||||||
|
|
||||||
@@ -781,19 +781,19 @@ GLExtensions::GLExtensions(unsigned int in_contextID):
|
|||||||
setGLExtensionFuncPtr(glGetOcclusionQueryiv, "glGetOcclusionQueryiv","glGetOcclusionQueryivNV", validContext);
|
setGLExtensionFuncPtr(glGetOcclusionQueryiv, "glGetOcclusionQueryiv","glGetOcclusionQueryivNV", validContext);
|
||||||
setGLExtensionFuncPtr(glGetOcclusionQueryuiv, "glGetOcclusionQueryuiv","glGetOcclusionQueryuivNV", validContext);
|
setGLExtensionFuncPtr(glGetOcclusionQueryuiv, "glGetOcclusionQueryuiv","glGetOcclusionQueryuivNV", validContext);
|
||||||
|
|
||||||
setGLExtensionFuncPtr(glGenQueries, "glGenQueries", "glGenQueriesARB", validContext);
|
setGLExtensionFuncPtr(glGenQueries, "glGenQueries", "glGenQueriesARB", "glGenQueriesEXT", validContext);
|
||||||
setGLExtensionFuncPtr(glDeleteQueries, "glDeleteQueries", "glDeleteQueriesARB", validContext);
|
setGLExtensionFuncPtr(glDeleteQueries, "glDeleteQueries", "glDeleteQueriesARB", "glDeleteQueriesEXT", validContext);
|
||||||
setGLExtensionFuncPtr(glIsQuery, "glIsQuery", "glIsQueryARB", validContext);
|
setGLExtensionFuncPtr(glIsQuery, "glIsQuery", "glIsQueryARB", "glIsQueryEXT", validContext);
|
||||||
setGLExtensionFuncPtr(glBeginQuery, "glBeginQuery", "glBeginQueryARB", validContext);
|
setGLExtensionFuncPtr(glBeginQuery, "glBeginQuery", "glBeginQueryARB", "glBeginQueryEXT", validContext);
|
||||||
setGLExtensionFuncPtr(glEndQuery, "glEndQuery", "glEndQueryARB", validContext);
|
setGLExtensionFuncPtr(glEndQuery, "glEndQuery", "glEndQueryARB", "glEndQueryEXT", validContext);
|
||||||
setGLExtensionFuncPtr(glBeginQueryIndexed, "glBeginQueryIndexed", "glBeginQueryIndexedARB", validContext);
|
setGLExtensionFuncPtr(glBeginQueryIndexed, "glBeginQueryIndexed", "glBeginQueryIndexedARB", validContext);
|
||||||
setGLExtensionFuncPtr(glEndQueryIndexed, "glEndQueryIndexed", "glEndQueryIndexedARB", validContext);
|
setGLExtensionFuncPtr(glEndQueryIndexed, "glEndQueryIndexed", "glEndQueryIndexedARB", validContext);
|
||||||
setGLExtensionFuncPtr(glGetQueryiv, "glGetQueryiv", "glGetQueryivARB", validContext);
|
setGLExtensionFuncPtr(glGetQueryiv, "glGetQueryiv", "glGetQueryivARB", "glGetQueryivEXT", validContext);
|
||||||
setGLExtensionFuncPtr(glGetQueryObjectiv, "glGetQueryObjectiv","glGetQueryObjectivARB", validContext);
|
setGLExtensionFuncPtr(glGetQueryObjectiv, "glGetQueryObjectiv","glGetQueryObjectivARB", "glGetQueryObjectivEXT", validContext);
|
||||||
setGLExtensionFuncPtr(glGetQueryObjectuiv, "glGetQueryObjectuiv","glGetQueryObjectuivARB", validContext);
|
setGLExtensionFuncPtr(glGetQueryObjectuiv, "glGetQueryObjectuiv","glGetQueryObjectuivARB", "glGetQueryObjectuivEXT", validContext);
|
||||||
setGLExtensionFuncPtr(glGetQueryObjectui64v, "glGetQueryObjectui64v","glGetQueryObjectui64vEXT", validContext);
|
setGLExtensionFuncPtr(glGetQueryObjectui64v, "glGetQueryObjectui64v","glGetQueryObjectui64vEXT", "glGetQueryObjectui64vEXT", validContext);
|
||||||
setGLExtensionFuncPtr(glQueryCounter, "glQueryCounter", validContext);
|
setGLExtensionFuncPtr(glQueryCounter, "glQueryCounter", "glQueryCounterEXT", validContext);
|
||||||
setGLExtensionFuncPtr(glGetInteger64v, "glGetInteger64v", validContext);
|
setGLExtensionFuncPtr(glGetInteger64v, "glGetInteger64v", "glGetInteger64vEXT", validContext);
|
||||||
|
|
||||||
|
|
||||||
// SampleMaski functionality
|
// SampleMaski functionality
|
||||||
@@ -850,13 +850,26 @@ GLExtensions::GLExtensions(unsigned int in_contextID):
|
|||||||
isTextureFilterAnisotropicSupported = validContext && isGLExtensionSupported(contextID,"GL_EXT_texture_filter_anisotropic");
|
isTextureFilterAnisotropicSupported = validContext && isGLExtensionSupported(contextID,"GL_EXT_texture_filter_anisotropic");
|
||||||
isTextureSwizzleSupported = validContext && isGLExtensionSupported(contextID,"GL_ARB_texture_swizzle");
|
isTextureSwizzleSupported = validContext && isGLExtensionSupported(contextID,"GL_ARB_texture_swizzle");
|
||||||
isTextureCompressionARBSupported = validContext && (builtInSupport || isGLExtensionOrVersionSupported(contextID,"GL_ARB_texture_compression", 1.3f));
|
isTextureCompressionARBSupported = validContext && (builtInSupport || isGLExtensionOrVersionSupported(contextID,"GL_ARB_texture_compression", 1.3f));
|
||||||
isTextureCompressionS3TCSupported = validContext && (isGLExtensionSupported(contextID,"GL_EXT_texture_compression_s3tc") || isGLExtensionSupported(contextID, "GL_S3_s3tc"));
|
isTextureCompressionS3TCSupported = validContext && (isGLExtensionSupported(contextID,"GL_EXT_texture_compression_s3tc") ||
|
||||||
isTextureCompressionPVRTC2BPPSupported = validContext && isGLExtensionSupported(contextID,"GL_IMG_texture_compression_pvrtc");
|
isGLExtensionSupported(contextID, "GL_S3_s3tc") ||
|
||||||
|
isGLExtensionSupported(contextID, "WEBGL_compressed_texture_s3tc") ||
|
||||||
|
isGLExtensionSupported(contextID, "MOZ_WEBGL_compressed_texture_s3tc") ||
|
||||||
|
isGLExtensionSupported(contextID, "WEBKIT_WEBGL_compressed_texture_s3tc") ||
|
||||||
|
isGLExtensionSupported(contextID, "WEBGL_compressed_texture_s3tc_srgb") /* TODO: separate flag */);
|
||||||
|
isTextureCompressionPVRTC2BPPSupported = validContext && (isGLExtensionSupported(contextID,"GL_IMG_texture_compression_pvrtc") ||
|
||||||
|
isGLExtensionSupported(contextID, "WEBGL_compressed_texture_pvrtc"));
|
||||||
isTextureCompressionPVRTC4BPPSupported = isTextureCompressionPVRTC2BPPSupported;//covered by same extension
|
isTextureCompressionPVRTC4BPPSupported = isTextureCompressionPVRTC2BPPSupported;//covered by same extension
|
||||||
isTextureCompressionETCSupported = validContext && isGLExtensionSupported(contextID,"GL_OES_compressed_ETC1_RGB8_texture");
|
isTextureCompressionETCSupported = validContext && (isGLExtensionSupported(contextID, "GL_OES_compressed_ETC1_RGB8_texture") ||
|
||||||
isTextureCompressionETC2Supported = validContext && isGLExtensionSupported(contextID,"GL_ARB_ES3_compatibility");
|
isGLExtensionSupported(contextID, "WEBGL_compressed_texture_etc1"));
|
||||||
|
isTextureCompressionETC2Supported = validContext && (isGLExtensionSupported(contextID,"GL_ARB_ES3_compatibility") ||
|
||||||
|
isGLExtensionSupported(contextID, "WEBGL_compressed_texture_etc"));
|
||||||
isTextureCompressionRGTCSupported = validContext && isGLExtensionSupported(contextID,"GL_EXT_texture_compression_rgtc");
|
isTextureCompressionRGTCSupported = validContext && isGLExtensionSupported(contextID,"GL_EXT_texture_compression_rgtc");
|
||||||
isTextureCompressionPVRTCSupported = validContext && isGLExtensionSupported(contextID,"GL_IMG_texture_compression_pvrtc");
|
isTextureCompressionPVRTCSupported = isTextureCompressionPVRTC2BPPSupported;//covered by same extension
|
||||||
|
|
||||||
|
isTextureCompressionASTCSupported = validContext && (isGLExtensionSupported(contextID, "GL_KHR_texture_compression_astc_hdr") ||
|
||||||
|
isGLExtensionSupported(contextID, "GL_KHR_texture_compression_astc_ldr") ||
|
||||||
|
isGLExtensionSupported(contextID, "GL_OES_texture_compression_astc") ||
|
||||||
|
isGLExtensionSupported(contextID, "WEBGL_compressed_texture_astc"));
|
||||||
|
|
||||||
isTextureMirroredRepeatSupported = validContext &&
|
isTextureMirroredRepeatSupported = validContext &&
|
||||||
(builtInSupport ||
|
(builtInSupport ||
|
||||||
@@ -898,18 +911,22 @@ GLExtensions::GLExtensions(unsigned int in_contextID):
|
|||||||
{
|
{
|
||||||
maxTextureSize = osg_max_size;
|
maxTextureSize = osg_max_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(__EMSCRIPTEN__)
|
||||||
|
isTextureMaxLevelSupported = (glVersion >= 3.0f); // WebGL 2.0 (OpenGL ES 3.0)
|
||||||
|
isTextureLODBiasSupported = (glVersion >= 3.0f) || isGLExtensionSupported(contextID, "GL_EXT_texture_lod_bias");
|
||||||
|
#else
|
||||||
isTextureMaxLevelSupported = (glVersion >= 1.2f);
|
isTextureMaxLevelSupported = (glVersion >= 1.2f);
|
||||||
|
isTextureLODBiasSupported = (glVersion >= 1.2f) || isGLExtensionSupported(contextID, "GL_EXT_texture_lod_bias");
|
||||||
|
#endif
|
||||||
|
|
||||||
isTextureStorageEnabled = validContext && ((glVersion >= 4.2f) || isGLExtensionSupported(contextID, "GL_ARB_texture_storage"));
|
isTextureStorageEnabled = validContext && ((glVersion >= 4.2f) || isGLExtensionSupported(contextID, "GL_ARB_texture_storage"));
|
||||||
|
|
||||||
if (isTextureStorageEnabled)
|
if (isTextureStorageEnabled)
|
||||||
{
|
{
|
||||||
std::string value;
|
std::string value;
|
||||||
if (getEnvVar("OSG_GL_TEXTURE_STORAGE", value))
|
if (getEnvVar("OSG_GL_TEXTURE_STORAGE", value) && (value == "OFF" || value == "DISABLE"))
|
||||||
{
|
isTextureStorageEnabled = false;
|
||||||
if (value=="OFF" || value=="DISABLE") isTextureStorageEnabled = false;
|
|
||||||
else isTextureStorageEnabled = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setGLExtensionFuncPtr(glTexStorage1D,"glTexStorage1D","glTexStorage1DARB", validContext);
|
setGLExtensionFuncPtr(glTexStorage1D,"glTexStorage1D","glTexStorage1DARB", validContext);
|
||||||
@@ -918,8 +935,8 @@ GLExtensions::GLExtensions(unsigned int in_contextID):
|
|||||||
setGLExtensionFuncPtr(glTextureStorage2D,"glTextureStorage2D","glTextureStorage2DARB", validContext);
|
setGLExtensionFuncPtr(glTextureStorage2D,"glTextureStorage2D","glTextureStorage2DARB", validContext);
|
||||||
setGLExtensionFuncPtr(glTexStorage3D, "glTexStorage3D","glTexStorage3DEXT", validContext);
|
setGLExtensionFuncPtr(glTexStorage3D, "glTexStorage3D","glTexStorage3DEXT", validContext);
|
||||||
setGLExtensionFuncPtr(glTextureStorage3D, "glTextureStorage3D","glTextureStorage3DEXT", validContext);
|
setGLExtensionFuncPtr(glTextureStorage3D, "glTextureStorage3D","glTextureStorage3DEXT", validContext);
|
||||||
setGLExtensionFuncPtr(glTexStorage2DMultisample, "glTextureStorage2DMultisample","glTextureStorage2DMultisampleEXT", validContext);
|
setGLExtensionFuncPtr(glTexStorage2DMultisample, "glTexStorage2DMultisample", validContext);
|
||||||
setGLExtensionFuncPtr(glTexStorage3DMultisample, "glTextureStorage3DMultisample","glTextureStorage3DMultisampleEXT", validContext);
|
setGLExtensionFuncPtr(glTexStorage3DMultisample, "glTexStorage3DMultisample", validContext);
|
||||||
setGLExtensionFuncPtr(glTextureView, "glTextureView","glTextureViewEXT", validContext);
|
setGLExtensionFuncPtr(glTextureView, "glTextureView","glTextureViewEXT", validContext);
|
||||||
|
|
||||||
setGLExtensionFuncPtr(glCompressedTexImage2D,"glCompressedTexImage2D","glCompressedTexImage2DARB", validContext);
|
setGLExtensionFuncPtr(glCompressedTexImage2D,"glCompressedTexImage2D","glCompressedTexImage2DARB", validContext);
|
||||||
@@ -1077,12 +1094,18 @@ GLExtensions::GLExtensions(unsigned int in_contextID):
|
|||||||
|
|
||||||
|
|
||||||
// FrameBufferObject
|
// FrameBufferObject
|
||||||
|
isMultisampledRenderToTextureSupported = validContext && isGLExtensionSupported(contextID, "GL_EXT_multisampled_render_to_texture");
|
||||||
|
isInvalidateFramebufferSupported = validContext && (isGLExtensionSupported(contextID, "GL_ARB_invalidate_subdata") || (OSG_GLES3_FEATURES && glVersion >= 3.0) || glVersion >= 4.3);
|
||||||
|
|
||||||
setGLExtensionFuncPtr(glBindRenderbuffer, "glBindRenderbuffer", "glBindRenderbufferEXT", "glBindRenderbufferOES", validContext);
|
setGLExtensionFuncPtr(glBindRenderbuffer, "glBindRenderbuffer", "glBindRenderbufferEXT", "glBindRenderbufferOES", validContext);
|
||||||
setGLExtensionFuncPtr(glDeleteRenderbuffers, "glDeleteRenderbuffers", "glDeleteRenderbuffersEXT", "glDeleteRenderbuffersOES", validContext);
|
setGLExtensionFuncPtr(glDeleteRenderbuffers, "glDeleteRenderbuffers", "glDeleteRenderbuffersEXT", "glDeleteRenderbuffersOES", validContext);
|
||||||
setGLExtensionFuncPtr(glGenRenderbuffers, "glGenRenderbuffers", "glGenRenderbuffersEXT", "glGenRenderbuffersOES", validContext);
|
setGLExtensionFuncPtr(glGenRenderbuffers, "glGenRenderbuffers", "glGenRenderbuffersEXT", "glGenRenderbuffersOES", validContext);
|
||||||
setGLExtensionFuncPtr(glRenderbufferStorage, "glRenderbufferStorage", "glRenderbufferStorageEXT", "glRenderbufferStorageOES", validContext);
|
setGLExtensionFuncPtr(glRenderbufferStorage, "glRenderbufferStorage", "glRenderbufferStorageEXT", "glRenderbufferStorageOES", validContext);
|
||||||
setGLExtensionFuncPtr(glRenderbufferStorageMultisample, "glRenderbufferStorageMultisample", "glRenderbufferStorageMultisampleEXT", "glRenderbufferStorageMultisampleOES", validContext);
|
setGLExtensionFuncPtr(glRenderbufferStorageMultisample, "glRenderbufferStorageMultisample", "glRenderbufferStorageMultisampleEXT", "glRenderbufferStorageMultisampleOES", validContext);
|
||||||
setGLExtensionFuncPtr(glRenderbufferStorageMultisampleCoverageNV, "glRenderbufferStorageMultisampleCoverageNV", validContext);
|
if (isGLExtensionSupported(contextID, "GL_NV_framebuffer_multisample_coverage"))
|
||||||
|
setGLExtensionFuncPtr(glRenderbufferStorageMultisampleCoverageNV, "glRenderbufferStorageMultisampleCoverageNV", validContext);
|
||||||
|
else
|
||||||
|
glRenderbufferStorageMultisampleCoverageNV = NULL;
|
||||||
setGLExtensionFuncPtr(glBindFramebuffer, "glBindFramebuffer", "glBindFramebufferEXT", "glBindFramebufferOES", validContext);
|
setGLExtensionFuncPtr(glBindFramebuffer, "glBindFramebuffer", "glBindFramebufferEXT", "glBindFramebufferOES", validContext);
|
||||||
setGLExtensionFuncPtr(glDeleteFramebuffers, "glDeleteFramebuffers", "glDeleteFramebuffersEXT", "glDeleteFramebuffersOES", validContext);
|
setGLExtensionFuncPtr(glDeleteFramebuffers, "glDeleteFramebuffers", "glDeleteFramebuffersEXT", "glDeleteFramebuffersOES", validContext);
|
||||||
setGLExtensionFuncPtr(glGenFramebuffers, "glGenFramebuffers", "glGenFramebuffersEXT", "glGenFramebuffersOES", validContext);
|
setGLExtensionFuncPtr(glGenFramebuffers, "glGenFramebuffers", "glGenFramebuffersEXT", "glGenFramebuffersOES", validContext);
|
||||||
@@ -1090,6 +1113,7 @@ GLExtensions::GLExtensions(unsigned int in_contextID):
|
|||||||
|
|
||||||
setGLExtensionFuncPtr(glFramebufferTexture1D, "glFramebufferTexture1D", "glFramebufferTexture1DEXT", "glFramebufferTexture1DOES", validContext);
|
setGLExtensionFuncPtr(glFramebufferTexture1D, "glFramebufferTexture1D", "glFramebufferTexture1DEXT", "glFramebufferTexture1DOES", validContext);
|
||||||
setGLExtensionFuncPtr(glFramebufferTexture2D, "glFramebufferTexture2D", "glFramebufferTexture2DEXT", "glFramebufferTexture2DOES", validContext);
|
setGLExtensionFuncPtr(glFramebufferTexture2D, "glFramebufferTexture2D", "glFramebufferTexture2DEXT", "glFramebufferTexture2DOES", validContext);
|
||||||
|
setGLExtensionFuncPtr(glFramebufferTexture2DMultisample, "glFramebufferTexture2DMultisample", "glFramebufferTexture2DMultisampleEXT", validContext);
|
||||||
setGLExtensionFuncPtr(glFramebufferTexture3D, "glFramebufferTexture3D", "glFramebufferTexture3DEXT", "glFramebufferTexture3DOES", validContext);
|
setGLExtensionFuncPtr(glFramebufferTexture3D, "glFramebufferTexture3D", "glFramebufferTexture3DEXT", "glFramebufferTexture3DOES", validContext);
|
||||||
setGLExtensionFuncPtr(glFramebufferTexture, "glFramebufferTexture", "glFramebufferTextureEXT", "glFramebufferTextureOES", validContext);
|
setGLExtensionFuncPtr(glFramebufferTexture, "glFramebufferTexture", "glFramebufferTextureEXT", "glFramebufferTextureOES", validContext);
|
||||||
setGLExtensionFuncPtr(glFramebufferTextureLayer, "glFramebufferTextureLayer", "glFramebufferTextureLayerEXT", "glFramebufferTextureLayerOES", validContext);
|
setGLExtensionFuncPtr(glFramebufferTextureLayer, "glFramebufferTextureLayer", "glFramebufferTextureLayerEXT", "glFramebufferTextureLayerOES", validContext);
|
||||||
@@ -1105,6 +1129,7 @@ GLExtensions::GLExtensions(unsigned int in_contextID):
|
|||||||
|
|
||||||
setGLExtensionFuncPtr(glGenerateMipmap, "glGenerateMipmap", "glGenerateMipmapEXT", "glGenerateMipmapOES", validContext);
|
setGLExtensionFuncPtr(glGenerateMipmap, "glGenerateMipmap", "glGenerateMipmapEXT", "glGenerateMipmapOES", validContext);
|
||||||
setGLExtensionFuncPtr(glBlitFramebuffer, "glBlitFramebuffer", "glBlitFramebufferEXT", "glBlitFramebufferOES", validContext);
|
setGLExtensionFuncPtr(glBlitFramebuffer, "glBlitFramebuffer", "glBlitFramebufferEXT", "glBlitFramebufferOES", validContext);
|
||||||
|
setGLExtensionFuncPtr(glInvalidateFramebuffer, "glInvalidateFramebuffer", "glInvalidateFramebufferEXT", validContext);
|
||||||
setGLExtensionFuncPtr(glGetRenderbufferParameteriv, "glGetRenderbufferParameteriv", "glGetRenderbufferParameterivEXT", "glGetRenderbufferParameterivOES", validContext);
|
setGLExtensionFuncPtr(glGetRenderbufferParameteriv, "glGetRenderbufferParameteriv", "glGetRenderbufferParameterivEXT", "glGetRenderbufferParameterivOES", validContext);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -526,7 +526,7 @@ void GraphicsContext::close(bool callCloseImplementation)
|
|||||||
|
|
||||||
bool GraphicsContext::makeCurrent()
|
bool GraphicsContext::makeCurrent()
|
||||||
{
|
{
|
||||||
_threadOfLastMakeCurrent = OpenThreads::Thread::CurrentThread();
|
_threadOfLastMakeCurrent = OpenThreads::Thread::CurrentThreadId();
|
||||||
|
|
||||||
bool result = makeCurrentImplementation();
|
bool result = makeCurrentImplementation();
|
||||||
|
|
||||||
@@ -546,7 +546,7 @@ bool GraphicsContext::makeContextCurrent(GraphicsContext* readContext)
|
|||||||
|
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
_threadOfLastMakeCurrent = OpenThreads::Thread::CurrentThread();
|
_threadOfLastMakeCurrent = OpenThreads::Thread::CurrentThreadId();
|
||||||
|
|
||||||
// initialize extension process, not only initializes on first
|
// initialize extension process, not only initializes on first
|
||||||
// call, will be a non-op on subsequent calls.
|
// call, will be a non-op on subsequent calls.
|
||||||
@@ -560,7 +560,7 @@ bool GraphicsContext::releaseContext()
|
|||||||
{
|
{
|
||||||
bool result = releaseContextImplementation();
|
bool result = releaseContextImplementation();
|
||||||
|
|
||||||
_threadOfLastMakeCurrent = (OpenThreads::Thread*)(-1);
|
_threadOfLastMakeCurrent = 0;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -573,7 +573,7 @@ void GraphicsContext::swapBuffers()
|
|||||||
clear();
|
clear();
|
||||||
}
|
}
|
||||||
else if (_graphicsThread.valid() &&
|
else if (_graphicsThread.valid() &&
|
||||||
_threadOfLastMakeCurrent == _graphicsThread.get())
|
_threadOfLastMakeCurrent == _graphicsThread->getThreadId())
|
||||||
{
|
{
|
||||||
_graphicsThread->add(new SwapBuffersOperation);
|
_graphicsThread->add(new SwapBuffersOperation);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ bool Group::removeChildren(unsigned int pos,unsigned int numChildrenToRemove)
|
|||||||
if (endOfRemoveRange>_children.size())
|
if (endOfRemoveRange>_children.size())
|
||||||
{
|
{
|
||||||
OSG_DEBUG<<"Warning: Group::removeChild(i,numChildrenToRemove) has been passed an excessive number"<<std::endl;
|
OSG_DEBUG<<"Warning: Group::removeChild(i,numChildrenToRemove) has been passed an excessive number"<<std::endl;
|
||||||
OSG_DEBUG<<" of chilren to remove, trimming just to end of child list."<<std::endl;
|
OSG_DEBUG<<" of children to remove, trimming just to end of child list."<<std::endl;
|
||||||
endOfRemoveRange=_children.size();
|
endOfRemoveRange=_children.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -537,9 +537,12 @@ unsigned int Image::computeNumComponents(GLenum pixelFormat)
|
|||||||
switch(pixelFormat)
|
switch(pixelFormat)
|
||||||
{
|
{
|
||||||
case(GL_COMPRESSED_RGB_S3TC_DXT1_EXT): return 3;
|
case(GL_COMPRESSED_RGB_S3TC_DXT1_EXT): return 3;
|
||||||
case(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT): return 4;
|
case(GL_COMPRESSED_SRGB_S3TC_DXT1_EXT): return 3;
|
||||||
|
case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT): return 4;
|
||||||
case(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT): return 4;
|
case(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT): return 4;
|
||||||
|
case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT): return 4;
|
||||||
case(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT): return 4;
|
case(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT): return 4;
|
||||||
|
case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT): return 4;
|
||||||
case(GL_COMPRESSED_SIGNED_RED_RGTC1_EXT): return 1;
|
case(GL_COMPRESSED_SIGNED_RED_RGTC1_EXT): return 1;
|
||||||
case(GL_COMPRESSED_RED_RGTC1_EXT): return 1;
|
case(GL_COMPRESSED_RED_RGTC1_EXT): return 1;
|
||||||
case(GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT): return 2;
|
case(GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT): return 2;
|
||||||
@@ -719,9 +722,13 @@ unsigned int Image::computePixelSizeInBits(GLenum format,GLenum type)
|
|||||||
switch(format)
|
switch(format)
|
||||||
{
|
{
|
||||||
case(GL_COMPRESSED_RGB_S3TC_DXT1_EXT): return 4;
|
case(GL_COMPRESSED_RGB_S3TC_DXT1_EXT): return 4;
|
||||||
|
case(GL_COMPRESSED_SRGB_S3TC_DXT1_EXT): return 4;
|
||||||
case(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT): return 4;
|
case(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT): return 4;
|
||||||
|
case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT): return 4;
|
||||||
case(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT): return 8;
|
case(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT): return 8;
|
||||||
|
case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT): return 8;
|
||||||
case(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT): return 8;
|
case(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT): return 8;
|
||||||
|
case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT): return 8;
|
||||||
case(GL_COMPRESSED_SIGNED_RED_RGTC1_EXT): return 4;
|
case(GL_COMPRESSED_SIGNED_RED_RGTC1_EXT): return 4;
|
||||||
case(GL_COMPRESSED_RED_RGTC1_EXT): return 4;
|
case(GL_COMPRESSED_RED_RGTC1_EXT): return 4;
|
||||||
case(GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT): return 8;
|
case(GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT): return 8;
|
||||||
@@ -749,7 +756,7 @@ unsigned int Image::computePixelSizeInBits(GLenum format,GLenum type)
|
|||||||
// which raises the question of how to actually query for these sizes...
|
// which raises the question of how to actually query for these sizes...
|
||||||
// will need to revisit this issue, for now just report an error.
|
// will need to revisit this issue, for now just report an error.
|
||||||
// this is possible a bit of mute point though as since the ARB compressed formats
|
// this is possible a bit of mute point though as since the ARB compressed formats
|
||||||
// aren't yet used for storing images to disk, so its likely that users wont have
|
// aren't yet used for storing images to disk, so its likely that users won't have
|
||||||
// osg::Image's for pixel formats set the ARB compressed formats, just using these
|
// osg::Image's for pixel formats set the ARB compressed formats, just using these
|
||||||
// compressed formats as internal texture modes. This is very much speculation though
|
// compressed formats as internal texture modes. This is very much speculation though
|
||||||
// if get the below error then its time to revist this issue :-)
|
// if get the below error then its time to revist this issue :-)
|
||||||
@@ -942,10 +949,14 @@ unsigned int Image::computeBlockSize(GLenum pixelFormat, GLenum packing)
|
|||||||
switch(pixelFormat)
|
switch(pixelFormat)
|
||||||
{
|
{
|
||||||
case(GL_COMPRESSED_RGB_S3TC_DXT1_EXT):
|
case(GL_COMPRESSED_RGB_S3TC_DXT1_EXT):
|
||||||
|
case(GL_COMPRESSED_SRGB_S3TC_DXT1_EXT):
|
||||||
case(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT):
|
case(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT):
|
||||||
return osg::maximum(8u,packing); // block size of 8
|
case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT):
|
||||||
|
return osg::maximum(8u, packing); // block size of 8
|
||||||
case(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT):
|
case(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT):
|
||||||
|
case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT):
|
||||||
case(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT):
|
case(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT):
|
||||||
|
case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT):
|
||||||
case(GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG):
|
case(GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG):
|
||||||
case(GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG):
|
case(GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG):
|
||||||
case(GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG):
|
case(GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG):
|
||||||
@@ -1095,9 +1106,13 @@ bool Image::isCompressed() const
|
|||||||
case(GL_COMPRESSED_RGBA_ARB):
|
case(GL_COMPRESSED_RGBA_ARB):
|
||||||
case(GL_COMPRESSED_RGB_ARB):
|
case(GL_COMPRESSED_RGB_ARB):
|
||||||
case(GL_COMPRESSED_RGB_S3TC_DXT1_EXT):
|
case(GL_COMPRESSED_RGB_S3TC_DXT1_EXT):
|
||||||
|
case(GL_COMPRESSED_SRGB_S3TC_DXT1_EXT):
|
||||||
case(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT):
|
case(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT):
|
||||||
|
case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT):
|
||||||
case(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT):
|
case(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT):
|
||||||
|
case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT):
|
||||||
case(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT):
|
case(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT):
|
||||||
|
case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT):
|
||||||
case(GL_COMPRESSED_SIGNED_RED_RGTC1_EXT):
|
case(GL_COMPRESSED_SIGNED_RED_RGTC1_EXT):
|
||||||
case(GL_COMPRESSED_RED_RGTC1_EXT):
|
case(GL_COMPRESSED_RED_RGTC1_EXT):
|
||||||
case(GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT):
|
case(GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT):
|
||||||
@@ -1696,11 +1711,11 @@ void Image::copySubImage(int s_offset, int t_offset, int r_offset, const osg::Im
|
|||||||
}
|
}
|
||||||
unsigned int rowWidthInBlocks = (_s + footprint.x() - 1) / footprint.x();
|
unsigned int rowWidthInBlocks = (_s + footprint.x() - 1) / footprint.x();
|
||||||
unsigned int blockSize = computeBlockSize(_pixelFormat, 0);
|
unsigned int blockSize = computeBlockSize(_pixelFormat, 0);
|
||||||
data_destination = _data + blockSize * (rowWidthInBlocks * t_offset + (s_offset / footprint.x()));
|
data_destination = _data + blockSize * (rowWidthInBlocks * (t_offset / footprint.y()) + (s_offset / footprint.x()));
|
||||||
unsigned int copy_width = (osg::minimum(source->s(), _s - s_offset) + footprint.x() - 1) / footprint.x();
|
unsigned int copy_width = (osg::minimum(source->s(), _s - s_offset) + footprint.x() - 1) / footprint.x();
|
||||||
unsigned int copy_height = (osg::minimum(source->t(), _t - t_offset) + footprint.y() - 1) / footprint.y();
|
unsigned int copy_height = (osg::minimum(source->t(), _t - t_offset) + footprint.y() - 1) / footprint.y();
|
||||||
unsigned int dstRowStep = blockSize * rowWidthInBlocks;
|
unsigned int dstRowStep = blockSize * rowWidthInBlocks;
|
||||||
unsigned int srcRowStep = blockSize * (source->_s + footprint.x() - 1) / footprint.x();
|
unsigned int srcRowStep = blockSize * ((source->_s + footprint.x() - 1) / footprint.x());
|
||||||
const unsigned char* data_source = source->data(0, 0, 0);
|
const unsigned char* data_source = source->data(0, 0, 0);
|
||||||
for (unsigned int row = 0; row < copy_height; row += 1) { //copy blocks in a row, footprint.y() rows at a time
|
for (unsigned int row = 0; row < copy_height; row += 1) { //copy blocks in a row, footprint.y() rows at a time
|
||||||
memcpy(data_destination, data_source, copy_width * blockSize);
|
memcpy(data_destination, data_source, copy_width * blockSize);
|
||||||
@@ -2013,10 +2028,14 @@ bool Image::isImageTranslucent() const
|
|||||||
case(GL_BGR):
|
case(GL_BGR):
|
||||||
return false;
|
return false;
|
||||||
case(GL_COMPRESSED_RGB_S3TC_DXT1_EXT):
|
case(GL_COMPRESSED_RGB_S3TC_DXT1_EXT):
|
||||||
|
case(GL_COMPRESSED_SRGB_S3TC_DXT1_EXT):
|
||||||
return false;
|
return false;
|
||||||
case(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT):
|
case(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT):
|
||||||
|
case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT):
|
||||||
case(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT):
|
case(GL_COMPRESSED_RGBA_S3TC_DXT3_EXT):
|
||||||
|
case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT):
|
||||||
case(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT):
|
case(GL_COMPRESSED_RGBA_S3TC_DXT5_EXT):
|
||||||
|
case(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT):
|
||||||
return dxtc_tool::isCompressedImageTranslucent(_s, _t, _pixelFormat, _data);
|
return dxtc_tool::isCompressedImageTranslucent(_s, _t, _pixelFormat, _data);
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -747,18 +747,22 @@ bool Matrix_implementation::transpose(const Matrix_implementation&mat){
|
|||||||
Matrix_implementation tm(mat);
|
Matrix_implementation tm(mat);
|
||||||
return transpose(tm);
|
return transpose(tm);
|
||||||
}
|
}
|
||||||
|
_mat[0][0]=mat._mat[0][0];
|
||||||
_mat[0][1]=mat._mat[1][0];
|
_mat[0][1]=mat._mat[1][0];
|
||||||
_mat[0][2]=mat._mat[2][0];
|
_mat[0][2]=mat._mat[2][0];
|
||||||
_mat[0][3]=mat._mat[3][0];
|
_mat[0][3]=mat._mat[3][0];
|
||||||
_mat[1][0]=mat._mat[0][1];
|
_mat[1][0]=mat._mat[0][1];
|
||||||
|
_mat[1][1]=mat._mat[1][1];
|
||||||
_mat[1][2]=mat._mat[2][1];
|
_mat[1][2]=mat._mat[2][1];
|
||||||
_mat[1][3]=mat._mat[3][1];
|
_mat[1][3]=mat._mat[3][1];
|
||||||
_mat[2][0]=mat._mat[0][2];
|
_mat[2][0]=mat._mat[0][2];
|
||||||
_mat[2][1]=mat._mat[1][2];
|
_mat[2][1]=mat._mat[1][2];
|
||||||
|
_mat[2][2]=mat._mat[2][2];
|
||||||
_mat[2][3]=mat._mat[3][2];
|
_mat[2][3]=mat._mat[3][2];
|
||||||
_mat[3][0]=mat._mat[0][3];
|
_mat[3][0]=mat._mat[0][3];
|
||||||
_mat[3][1]=mat._mat[1][3];
|
_mat[3][1]=mat._mat[1][3];
|
||||||
_mat[3][2]=mat._mat[2][3];
|
_mat[3][2]=mat._mat[2][3];
|
||||||
|
_mat[3][3]=mat._mat[3][3];
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -767,12 +771,15 @@ bool Matrix_implementation::transpose3x3(const Matrix_implementation&mat){
|
|||||||
Matrix_implementation tm(mat);
|
Matrix_implementation tm(mat);
|
||||||
return transpose3x3(tm);
|
return transpose3x3(tm);
|
||||||
}
|
}
|
||||||
|
_mat[0][0]=mat._mat[0][0];
|
||||||
_mat[0][1]=mat._mat[1][0];
|
_mat[0][1]=mat._mat[1][0];
|
||||||
_mat[0][2]=mat._mat[2][0];
|
_mat[0][2]=mat._mat[2][0];
|
||||||
_mat[1][0]=mat._mat[0][1];
|
_mat[1][0]=mat._mat[0][1];
|
||||||
|
_mat[1][1]=mat._mat[1][1];
|
||||||
_mat[1][2]=mat._mat[2][1];
|
_mat[1][2]=mat._mat[2][1];
|
||||||
_mat[2][0]=mat._mat[0][2];
|
_mat[2][0]=mat._mat[0][2];
|
||||||
_mat[2][1]=mat._mat[1][2];
|
_mat[2][1]=mat._mat[1][2];
|
||||||
|
_mat[2][2]=mat._mat[2][2];
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -241,7 +241,7 @@ void osg::StandardNotifyHandler::notify(osg::NotifySeverity severity, const char
|
|||||||
fputs(message, stdout);
|
fputs(message, stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(WIN32) && !defined(__CYGWIN__)
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||||
|
|
||||||
#ifndef WIN32_LEAN_AND_MEAN
|
#ifndef WIN32_LEAN_AND_MEAN
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
|||||||
@@ -48,6 +48,36 @@
|
|||||||
namespace osg
|
namespace osg
|
||||||
{
|
{
|
||||||
|
|
||||||
|
QueryGeometry* createDefaultQueryGeometry( const std::string& name )
|
||||||
|
{
|
||||||
|
GLushort indices[] = { 0, 1, 2, 3, 4, 5, 6, 7,
|
||||||
|
0, 3, 6, 5, 2, 1, 4, 7,
|
||||||
|
5, 4, 1, 0, 2, 7, 6, 3 };
|
||||||
|
|
||||||
|
ref_ptr<QueryGeometry> geom = new QueryGeometry( name );
|
||||||
|
geom->setDataVariance( Object::DYNAMIC );
|
||||||
|
geom->addPrimitiveSet( new DrawElementsUShort( PrimitiveSet::QUADS, 24, indices ) );
|
||||||
|
|
||||||
|
return geom.release();
|
||||||
|
}
|
||||||
|
|
||||||
|
Geometry* createDefaultDebugQueryGeometry()
|
||||||
|
{
|
||||||
|
GLushort indices[] = { 0, 1, 2, 3, 4, 5, 6, 7,
|
||||||
|
0, 3, 6, 5, 2, 1, 4, 7,
|
||||||
|
5, 4, 1, 0, 2, 7, 6, 3 };
|
||||||
|
|
||||||
|
ref_ptr<Vec4Array> ca = new Vec4Array;
|
||||||
|
ca->push_back( Vec4( 1.f, 1.f, 1.f, 1.f ) );
|
||||||
|
|
||||||
|
ref_ptr<Geometry> geom = new Geometry;
|
||||||
|
geom->setDataVariance( Object::DYNAMIC );
|
||||||
|
geom->setColorArray( ca.get(), Array::BIND_OVERALL );
|
||||||
|
geom->addPrimitiveSet( new DrawElementsUShort( PrimitiveSet::QUADS, 24, indices ) );
|
||||||
|
|
||||||
|
return geom.release();
|
||||||
|
}
|
||||||
|
|
||||||
// Create and return a StateSet appropriate for performing an occlusion
|
// Create and return a StateSet appropriate for performing an occlusion
|
||||||
// query test (disable lighting, texture mapping, etc). Probably some
|
// query test (disable lighting, texture mapping, etc). Probably some
|
||||||
// room for improvement here. Could disable shaders, for example.
|
// room for improvement here. Could disable shaders, for example.
|
||||||
@@ -364,7 +394,7 @@ QueryGeometry::drawImplementation( osg::RenderInfo& renderInfo ) const
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryGeometry::QueryResult QueryGeometry::getQueryResult( const osg::Camera* cam )
|
QueryGeometry::QueryResult QueryGeometry::getQueryResult( const osg::Camera* cam ) const
|
||||||
{
|
{
|
||||||
osg::ref_ptr<osg::TestResult> tr;
|
osg::ref_ptr<osg::TestResult> tr;
|
||||||
{
|
{
|
||||||
@@ -380,7 +410,7 @@ QueryGeometry::QueryResult QueryGeometry::getQueryResult( const osg::Camera* cam
|
|||||||
}
|
}
|
||||||
|
|
||||||
unsigned int
|
unsigned int
|
||||||
QueryGeometry::getNumPixels( const osg::Camera* cam )
|
QueryGeometry::getNumPixels( const osg::Camera* cam ) const
|
||||||
{
|
{
|
||||||
return getQueryResult(cam).numPixels;
|
return getQueryResult(cam).numPixels;
|
||||||
}
|
}
|
||||||
@@ -442,7 +472,7 @@ QueryGeometry::discardDeletedQueryObjects( unsigned int contextID )
|
|||||||
|
|
||||||
OcclusionQueryNode::OcclusionQueryNode()
|
OcclusionQueryNode::OcclusionQueryNode()
|
||||||
: _enabled( true ),
|
: _enabled( true ),
|
||||||
_validQueryGeometry( false ),
|
_queryGeometryState( INVALID ),
|
||||||
_passed(false),
|
_passed(false),
|
||||||
_visThreshold( 500 ),
|
_visThreshold( 500 ),
|
||||||
_queryFrameCount( 5 ),
|
_queryFrameCount( 5 ),
|
||||||
@@ -460,7 +490,7 @@ OcclusionQueryNode::~OcclusionQueryNode()
|
|||||||
|
|
||||||
OcclusionQueryNode::OcclusionQueryNode( const OcclusionQueryNode& oqn, const CopyOp& copyop )
|
OcclusionQueryNode::OcclusionQueryNode( const OcclusionQueryNode& oqn, const CopyOp& copyop )
|
||||||
: Group( oqn, copyop ),
|
: Group( oqn, copyop ),
|
||||||
_validQueryGeometry( false ),
|
_queryGeometryState( INVALID ),
|
||||||
_passed( false )
|
_passed( false )
|
||||||
{
|
{
|
||||||
_enabled = oqn._enabled;
|
_enabled = oqn._enabled;
|
||||||
@@ -485,7 +515,7 @@ bool OcclusionQueryNode::getPassed( const Camera* camera, NodeVisitor& nv )
|
|||||||
|
|
||||||
QueryGeometry* qg = static_cast< QueryGeometry* >( _queryGeode->getDrawable( 0 ) );
|
QueryGeometry* qg = static_cast< QueryGeometry* >( _queryGeode->getDrawable( 0 ) );
|
||||||
|
|
||||||
if ( !_validQueryGeometry )
|
if ( !isQueryGeometryValid() )
|
||||||
{
|
{
|
||||||
// There're cases that the occlusion test result has been retrieved
|
// There're cases that the occlusion test result has been retrieved
|
||||||
// after the query geometry has been changed, it's the result of the
|
// after the query geometry has been changed, it's the result of the
|
||||||
@@ -556,7 +586,7 @@ bool OcclusionQueryNode::getPassed( const Camera* camera, NodeVisitor& nv )
|
|||||||
|
|
||||||
void OcclusionQueryNode::traverseQuery( const Camera* camera, NodeVisitor& nv )
|
void OcclusionQueryNode::traverseQuery( const Camera* camera, NodeVisitor& nv )
|
||||||
{
|
{
|
||||||
if (!_validQueryGeometry || ! _enabled)
|
if (!isQueryGeometryValid() || !_enabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
bool issueQuery;
|
bool issueQuery;
|
||||||
@@ -590,42 +620,13 @@ BoundingSphere OcclusionQueryNode::computeBound() const
|
|||||||
// an application thread or by a non-osgViewer application.
|
// an application thread or by a non-osgViewer application.
|
||||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock( _computeBoundMutex ) ;
|
OpenThreads::ScopedLock<OpenThreads::Mutex> lock( _computeBoundMutex ) ;
|
||||||
|
|
||||||
// This is the logical place to put this code, but the method is const. Cast
|
if (_queryGeometryState != USER_DEFINED)
|
||||||
// away constness to compute the bounding box and modify the query geometry.
|
|
||||||
osg::OcclusionQueryNode* nonConstThis = const_cast<osg::OcclusionQueryNode*>( this );
|
|
||||||
|
|
||||||
|
|
||||||
ComputeBoundsVisitor cbv;
|
|
||||||
nonConstThis->accept( cbv );
|
|
||||||
BoundingBox bb = cbv.getBoundingBox();
|
|
||||||
const bool bbValid = bb.valid();
|
|
||||||
_validQueryGeometry = bbValid;
|
|
||||||
|
|
||||||
osg::ref_ptr<Vec3Array> v = new Vec3Array;
|
|
||||||
v->resize( 8 );
|
|
||||||
|
|
||||||
// Having (0,0,0) as vertices for the case of the invalid query geometry
|
|
||||||
// still isn't quite the right thing. But the query geometry is public
|
|
||||||
// accessible and therefore a user might expect eight vertices, so
|
|
||||||
// it seems safer to keep eight vertices in the geometry.
|
|
||||||
|
|
||||||
if (bbValid)
|
|
||||||
{
|
{
|
||||||
(*v)[0] = Vec3( bb._min.x(), bb._min.y(), bb._min.z() );
|
// This is the logical place to put this code, but the method is const. Cast
|
||||||
(*v)[1] = Vec3( bb._max.x(), bb._min.y(), bb._min.z() );
|
// away constness to compute the bounding box and modify the query geometry.
|
||||||
(*v)[2] = Vec3( bb._max.x(), bb._min.y(), bb._max.z() );
|
osg::OcclusionQueryNode* nonConstThis = const_cast<osg::OcclusionQueryNode*>( this );
|
||||||
(*v)[3] = Vec3( bb._min.x(), bb._min.y(), bb._max.z() );
|
nonConstThis->updateDefaultQueryGeometry();
|
||||||
(*v)[4] = Vec3( bb._max.x(), bb._max.y(), bb._min.z() );
|
|
||||||
(*v)[5] = Vec3( bb._min.x(), bb._max.y(), bb._min.z() );
|
|
||||||
(*v)[6] = Vec3( bb._min.x(), bb._max.y(), bb._max.z() );
|
|
||||||
(*v)[7] = Vec3( bb._max.x(), bb._max.y(), bb._max.z() );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Geometry* geom = static_cast< Geometry* >( nonConstThis->_queryGeode->getDrawable( 0 ) );
|
|
||||||
geom->setVertexArray( v.get() );
|
|
||||||
|
|
||||||
geom = static_cast< osg::Geometry* >( nonConstThis->_debugGeode->getDrawable( 0 ) );
|
|
||||||
geom->setVertexArray( v.get() );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Group::computeBound();
|
return Group::computeBound();
|
||||||
@@ -723,21 +724,12 @@ bool OcclusionQueryNode::getPassed() const
|
|||||||
|
|
||||||
void OcclusionQueryNode::createSupportNodes()
|
void OcclusionQueryNode::createSupportNodes()
|
||||||
{
|
{
|
||||||
GLushort indices[] = { 0, 1, 2, 3, 4, 5, 6, 7,
|
|
||||||
0, 3, 6, 5, 2, 1, 4, 7,
|
|
||||||
5, 4, 1, 0, 2, 7, 6, 3 };
|
|
||||||
|
|
||||||
{
|
{
|
||||||
// Add the test geometry Geode
|
// Add the test geometry Geode
|
||||||
_queryGeode = new Geode;
|
_queryGeode = new Geode;
|
||||||
_queryGeode->setName( "OQTest" );
|
_queryGeode->setName( "OQTest" );
|
||||||
_queryGeode->setDataVariance( Object::DYNAMIC );
|
_queryGeode->setDataVariance( Object::DYNAMIC );
|
||||||
|
_queryGeode->addDrawable( createDefaultQueryGeometry( getName() ) );
|
||||||
ref_ptr< QueryGeometry > geom = new QueryGeometry( getName() );
|
|
||||||
geom->setDataVariance( Object::DYNAMIC );
|
|
||||||
geom->addPrimitiveSet( new DrawElementsUShort( PrimitiveSet::QUADS, 24, indices ) );
|
|
||||||
|
|
||||||
_queryGeode->addDrawable( geom.get() );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -746,17 +738,7 @@ void OcclusionQueryNode::createSupportNodes()
|
|||||||
_debugGeode = new Geode;
|
_debugGeode = new Geode;
|
||||||
_debugGeode->setName( "Debug" );
|
_debugGeode->setName( "Debug" );
|
||||||
_debugGeode->setDataVariance( Object::DYNAMIC );
|
_debugGeode->setDataVariance( Object::DYNAMIC );
|
||||||
|
_debugGeode->addDrawable( createDefaultDebugQueryGeometry() );
|
||||||
ref_ptr<Geometry> geom = new Geometry;
|
|
||||||
geom->setDataVariance( Object::DYNAMIC );
|
|
||||||
|
|
||||||
ref_ptr<Vec4Array> ca = new Vec4Array;
|
|
||||||
ca->push_back( Vec4( 1.f, 1.f, 1.f, 1.f ) );
|
|
||||||
geom->setColorArray( ca.get(), Array::BIND_OVERALL );
|
|
||||||
|
|
||||||
geom->addPrimitiveSet( new DrawElementsUShort( PrimitiveSet::QUADS, 24, indices ) );
|
|
||||||
|
|
||||||
_debugGeode->addDrawable( geom.get() );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Creste state sets. Note that the osgOQ visitors (which place OQNs throughout
|
// Creste state sets. Note that the osgOQ visitors (which place OQNs throughout
|
||||||
@@ -767,6 +749,69 @@ void OcclusionQueryNode::createSupportNodes()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void OcclusionQueryNode::setQueryGeometryInternal( QueryGeometry* queryGeom,
|
||||||
|
Geometry* debugQueryGeom,
|
||||||
|
QueryGeometryState state )
|
||||||
|
{
|
||||||
|
if (!queryGeom || !debugQueryGeom)
|
||||||
|
{
|
||||||
|
OSG_FATAL << "osgOQ: OcclusionQueryNode: No QueryGeometry." << std::endl;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_queryGeometryState = state;
|
||||||
|
|
||||||
|
_queryGeode->removeDrawables(0, _queryGeode->getNumDrawables());
|
||||||
|
_queryGeode->addDrawable(queryGeom);
|
||||||
|
|
||||||
|
_debugGeode->removeDrawables(0, _debugGeode->getNumDrawables());
|
||||||
|
_debugGeode->addDrawable(debugQueryGeom);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void OcclusionQueryNode::updateDefaultQueryGeometry()
|
||||||
|
{
|
||||||
|
if (_queryGeometryState == USER_DEFINED)
|
||||||
|
{
|
||||||
|
OSG_FATAL << "osgOQ: OcclusionQueryNode: Unexpected QueryGeometryState=USER_DEFINED." << std::endl;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ComputeBoundsVisitor cbv;
|
||||||
|
accept( cbv );
|
||||||
|
|
||||||
|
BoundingBox bb = cbv.getBoundingBox();
|
||||||
|
const bool bbValid = bb.valid();
|
||||||
|
_queryGeometryState = bbValid ? VALID : INVALID;
|
||||||
|
|
||||||
|
osg::ref_ptr<Vec3Array> v = new Vec3Array;
|
||||||
|
v->resize( 8 );
|
||||||
|
|
||||||
|
// Having (0,0,0) as vertices for the case of the invalid query geometry
|
||||||
|
// still isn't quite the right thing. But the query geometry is public
|
||||||
|
// accessible and therefore a user might expect eight vertices, so
|
||||||
|
// it seems safer to keep eight vertices in the geometry.
|
||||||
|
|
||||||
|
if (bbValid)
|
||||||
|
{
|
||||||
|
(*v)[0] = Vec3( bb._min.x(), bb._min.y(), bb._min.z() );
|
||||||
|
(*v)[1] = Vec3( bb._max.x(), bb._min.y(), bb._min.z() );
|
||||||
|
(*v)[2] = Vec3( bb._max.x(), bb._min.y(), bb._max.z() );
|
||||||
|
(*v)[3] = Vec3( bb._min.x(), bb._min.y(), bb._max.z() );
|
||||||
|
(*v)[4] = Vec3( bb._max.x(), bb._max.y(), bb._min.z() );
|
||||||
|
(*v)[5] = Vec3( bb._min.x(), bb._max.y(), bb._min.z() );
|
||||||
|
(*v)[6] = Vec3( bb._min.x(), bb._max.y(), bb._max.z() );
|
||||||
|
(*v)[7] = Vec3( bb._max.x(), bb._max.y(), bb._max.z() );
|
||||||
|
}
|
||||||
|
|
||||||
|
Geometry* geom = static_cast< Geometry* >( _queryGeode->getDrawable( 0 ) );
|
||||||
|
geom->setVertexArray( v.get() );
|
||||||
|
|
||||||
|
geom = static_cast< osg::Geometry* >( _debugGeode->getDrawable( 0 ) );
|
||||||
|
geom->setVertexArray( v.get() );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void OcclusionQueryNode::releaseGLObjects( State* state ) const
|
void OcclusionQueryNode::releaseGLObjects( State* state ) const
|
||||||
{
|
{
|
||||||
if (_queryGeode.valid()) _queryGeode->releaseGLObjects(state);
|
if (_queryGeode.valid()) _queryGeode->releaseGLObjects(state);
|
||||||
@@ -787,14 +832,22 @@ void OcclusionQueryNode::discardDeletedQueryObjects( unsigned int contextID )
|
|||||||
QueryGeometry::discardDeletedQueryObjects( contextID );
|
QueryGeometry::discardDeletedQueryObjects( contextID );
|
||||||
}
|
}
|
||||||
|
|
||||||
osg::QueryGeometry* OcclusionQueryNode::getQueryGeometry()
|
void OcclusionQueryNode::setQueryGeometry( QueryGeometry* geom )
|
||||||
{
|
{
|
||||||
if (_queryGeode && _queryGeode->getDrawable( 0 ))
|
OpenThreads::ScopedLock<OpenThreads::Mutex> lock( _computeBoundMutex ) ;
|
||||||
|
|
||||||
|
if (geom)
|
||||||
{
|
{
|
||||||
QueryGeometry* qg = static_cast< QueryGeometry* >( _queryGeode->getDrawable( 0 ) );
|
setQueryGeometryInternal( geom, geom, USER_DEFINED );
|
||||||
return qg;
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setQueryGeometryInternal( createDefaultQueryGeometry( getName() ),
|
||||||
|
createDefaultDebugQueryGeometry(),
|
||||||
|
INVALID);
|
||||||
|
|
||||||
|
updateDefaultQueryGeometry();
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const osg::QueryGeometry* OcclusionQueryNode::getQueryGeometry() const
|
const osg::QueryGeometry* OcclusionQueryNode::getQueryGeometry() const
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ void PagedLOD::setDatabasePath(const std::string& path)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
// make sure the last character is the appropriate slash
|
// make sure the last character is the appropriate slash
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
if (lastCharacter==unixSlash)
|
if (lastCharacter==unixSlash)
|
||||||
{
|
{
|
||||||
lastCharacter = winSlash;
|
lastCharacter = winSlash;
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ void DrawElementsIndirectUInt::draw(State& state, bool /*useVertexBufferObjects*
|
|||||||
|
|
||||||
state.get<GLExtensions>()-> glDrawElementsIndirect(mode, GL_UNSIGNED_INT,
|
state.get<GLExtensions>()-> glDrawElementsIndirect(mode, GL_UNSIGNED_INT,
|
||||||
(const GLvoid *)(dibo->getOffset(_indirectCommandArray->getBufferIndex()) //command array address
|
(const GLvoid *)(dibo->getOffset(_indirectCommandArray->getBufferIndex()) //command array address
|
||||||
+_firstCommand* _indirectCommandArray->getElementSize())// runtime offset computaion can be sizeof(*_indirectCommandArray->begin())
|
+_firstCommand* _indirectCommandArray->getElementSize())// runtime offset computation can be sizeof(*_indirectCommandArray->begin())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user