Compare commits
188 Commits
OpenSceneG
...
OpenSceneG
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2f780df47b | ||
|
|
ae81ca6b6e | ||
|
|
27bfc09c7a | ||
|
|
ea5857c8d5 | ||
|
|
fb7f800ba7 | ||
|
|
0ecaf90a7c | ||
|
|
32fe2f09d4 | ||
|
|
46c52f2a97 | ||
|
|
dfd59cbfe1 | ||
|
|
81b32a3d89 | ||
|
|
98889b7331 | ||
|
|
4fefd87b80 | ||
|
|
586c177db9 | ||
|
|
b138fa8ab7 | ||
|
|
5aa7acd92b | ||
|
|
a4a684cb07 | ||
|
|
d009dec52f | ||
|
|
9d14c9908e | ||
|
|
cd5e4a999b | ||
|
|
46e53047bc | ||
|
|
1d120f7814 | ||
|
|
2c25825800 | ||
|
|
2f83db9442 | ||
|
|
78a59c33bd | ||
|
|
ec8a784d90 | ||
|
|
949d6f20e5 | ||
|
|
ce51923f87 | ||
|
|
1571ac72b7 | ||
|
|
64bef29848 | ||
|
|
fc0c2a76c1 | ||
|
|
fb09bd6c12 | ||
|
|
94e7f4e860 | ||
|
|
1ca2ed9729 | ||
|
|
f86acab9b2 | ||
|
|
5461ca4b6f | ||
|
|
0f797078f0 | ||
|
|
14332e5ca1 | ||
|
|
2f8a4c654a | ||
|
|
832fb9798e | ||
|
|
79b0f8c839 | ||
|
|
8d41495014 | ||
|
|
fb28e0ffa1 | ||
|
|
cb3ce747ca | ||
|
|
a6939bc46f | ||
|
|
773d0a2ddf | ||
|
|
1b3dba7860 | ||
|
|
f127220582 | ||
|
|
52abe9503f | ||
|
|
95acbe55b5 | ||
|
|
3a5d834643 | ||
|
|
2ab66723d5 | ||
|
|
044e20911b | ||
|
|
a256eac9c5 | ||
|
|
14b978369e | ||
|
|
25aeb1dadc | ||
|
|
762f0819ff | ||
|
|
0d30acccf1 | ||
|
|
5c73224c36 | ||
|
|
b65f0043ef | ||
|
|
283b9d4447 | ||
|
|
2d8b521e33 | ||
|
|
a6df790b64 | ||
|
|
c0ef8b8264 | ||
|
|
8c0413e293 | ||
|
|
a3288ea19a | ||
|
|
eeeb18926a | ||
|
|
dcb01cf3e5 | ||
|
|
6077e19029 | ||
|
|
34911d071e | ||
|
|
21acda6898 | ||
|
|
cdf9886a9e | ||
|
|
d91c8b81cd | ||
|
|
5a8aee3ede | ||
|
|
abefc9d8a8 | ||
|
|
8cbee2664f | ||
|
|
ebbf2d1653 | ||
|
|
aa81404a41 | ||
|
|
a69d12af10 | ||
|
|
1102058f31 | ||
|
|
684b4d8bf5 | ||
|
|
69fd9d7530 | ||
|
|
6ffe11dda5 | ||
|
|
a8e7dbd9ce | ||
|
|
a2e1dc04bf | ||
|
|
7b39cbddfd | ||
|
|
eaca0d3d3d | ||
|
|
2665191aed | ||
|
|
ed2b25e32c | ||
|
|
acdebc99bc | ||
|
|
574b3eb573 | ||
|
|
d32d406019 | ||
|
|
8b3a85e6bc | ||
|
|
91660974e2 | ||
|
|
0f547585d3 | ||
|
|
3ba5f22604 | ||
|
|
64707b12f2 | ||
|
|
7da5ae26d0 | ||
|
|
485776bf18 | ||
|
|
3eddec871a | ||
|
|
f8f04cb04c | ||
|
|
4f11db1653 | ||
|
|
63bd3be9cd | ||
|
|
4ca088dcf9 | ||
|
|
3ef97ddeea | ||
|
|
31c54aa3e4 | ||
|
|
76c45c7731 | ||
|
|
5efce09451 | ||
|
|
3f8e6d0a74 | ||
|
|
9433947d2a | ||
|
|
6f9b82142a | ||
|
|
1dcc2555e7 | ||
|
|
27f9021df7 | ||
|
|
9af08d6715 | ||
|
|
5c4800c774 | ||
|
|
dfd8594042 | ||
|
|
be2d80abca | ||
|
|
ca8f3d5f8a | ||
|
|
790c0091e6 | ||
|
|
ce58131cfc | ||
|
|
309da2fe07 | ||
|
|
97d706c640 | ||
|
|
f14f58c486 | ||
|
|
7c9cbc5ff9 | ||
|
|
2a70ea9f64 | ||
|
|
2f71509ebf | ||
|
|
320c51aa96 | ||
|
|
8de7ad3fa3 | ||
|
|
316726445d | ||
|
|
eac772a841 | ||
|
|
f2428e961f | ||
|
|
d636e89f9a | ||
|
|
cb67c10b5f | ||
|
|
7990effc06 | ||
|
|
8d2c3db14c | ||
|
|
04ea3aa6a2 | ||
|
|
d30a94bf4c | ||
|
|
8ff77c10f9 | ||
|
|
76edd07195 | ||
|
|
0ab211cb7c | ||
|
|
0cd6a935e0 | ||
|
|
cab0f50371 | ||
|
|
c62a57c006 | ||
|
|
fefe87ec13 | ||
|
|
8fd8036e33 | ||
|
|
f653048d5f | ||
|
|
caf56902c3 | ||
|
|
48498a1517 | ||
|
|
b86e644542 | ||
|
|
97091aa96c | ||
|
|
9574f4c087 | ||
|
|
a5002123a9 | ||
|
|
bddb6e8eaa | ||
|
|
41b1fcffe6 | ||
|
|
044f16b8b9 | ||
|
|
d581806619 | ||
|
|
48364df671 | ||
|
|
981ed52356 | ||
|
|
9a90ddd2d9 | ||
|
|
123058965c | ||
|
|
1364329fc8 | ||
|
|
07550df2f2 | ||
|
|
45f463ccd2 | ||
|
|
789d435abe | ||
|
|
6b8db67c91 | ||
|
|
2975f9c20a | ||
|
|
ebc855cf50 | ||
|
|
c9547497cc | ||
|
|
75d32b3af6 | ||
|
|
a844a278ab | ||
|
|
94dcfb4ec2 | ||
|
|
8528449dff | ||
|
|
8d7fd88d5f | ||
|
|
28dd1cf8a8 | ||
|
|
14de2266ba | ||
|
|
cc02695822 | ||
|
|
2c442c9e9a | ||
|
|
ca44b9cbce | ||
|
|
0483912e32 | ||
|
|
21b5109089 | ||
|
|
549e20fbe7 | ||
|
|
b4b7a13063 | ||
|
|
8b58890975 | ||
|
|
871521cfea | ||
|
|
f19018a03d | ||
|
|
2709a5e946 | ||
|
|
52d5d80508 | ||
|
|
86e465d5d8 | ||
|
|
50ed5ebd1c |
77
AUTHORS.txt
77
AUTHORS.txt
@@ -1,6 +1,6 @@
|
||||
OpenSceneGraph Library 3.2.0
|
||||
OpenSceneGraph Library 3.2.1
|
||||
|
||||
510 Contributors:
|
||||
519 Contributors:
|
||||
|
||||
Firstname Surname
|
||||
-----------------
|
||||
@@ -9,12 +9,12 @@ Don Burns
|
||||
Stephan Huber
|
||||
Paul Martz
|
||||
Mathias Fr<46>hlich
|
||||
Marco Jez
|
||||
Farshid Lashkari
|
||||
Marco Jez
|
||||
Wang Rui
|
||||
Jean-S<>bastien Guay
|
||||
Mike Weiblen
|
||||
Ulrich Hertlein
|
||||
Mike Weiblen
|
||||
Eric Wing
|
||||
Sukender
|
||||
Cedric Pinson
|
||||
@@ -25,43 +25,46 @@ Geoff Michel
|
||||
Wojciech Lewandowski
|
||||
Eric Sokolowsky
|
||||
David Callu
|
||||
Trajce Nikolov
|
||||
Laurens Voerman
|
||||
Colin McDonald
|
||||
Trajce Nikolov
|
||||
Tim Moore
|
||||
Martin Lavery
|
||||
Laurens Voerman
|
||||
Tree
|
||||
Luigi Calori
|
||||
Mike Wittman
|
||||
Jason Beverage
|
||||
Chris Hanson
|
||||
Roland Smeenk
|
||||
Roger James
|
||||
Jeremy Moles
|
||||
Jason Beverage
|
||||
Jan Peciva
|
||||
J.P. Delport
|
||||
Mattias Helsing
|
||||
J.P. Delport
|
||||
Alberto Luaces
|
||||
Magnus Kessler
|
||||
David Fries
|
||||
Andy Skinner
|
||||
Paul Melis
|
||||
Alberto Luaces
|
||||
Luc Frauciel
|
||||
Tom Jolley
|
||||
Paul Melis
|
||||
Luc Frauciel
|
||||
Pavel Moloshtan
|
||||
Brad Christiansen
|
||||
Olaf Flebbe
|
||||
Mathieu Marache
|
||||
Jason Daly
|
||||
Aurelien Albert
|
||||
Art Tevs
|
||||
Philip Lowman
|
||||
Per Fahlberg
|
||||
Norman Vine
|
||||
Terry Welsh
|
||||
Serge Lages
|
||||
Romano Jos<6F> Magacho da Silva
|
||||
Lionel Lagarde
|
||||
Chris Denham
|
||||
Alberto Farre
|
||||
Torben Dannhauer
|
||||
Sherman Wilcox
|
||||
Robert Michael
|
||||
Mourad Boufarguine
|
||||
@@ -69,14 +72,12 @@ Andr
|
||||
Adrian Egli
|
||||
Ruben Lopez
|
||||
Randall Hopper
|
||||
Pjotr Svetachov
|
||||
Jan Ciger
|
||||
Glenn Waldron
|
||||
Gideon May
|
||||
Don Tidrow
|
||||
Aurelien Albert
|
||||
Torben Dannhauer
|
||||
Stephane Lamoliatte
|
||||
Romano Jos<6F> Magacho da Silva
|
||||
Michael Gronager
|
||||
Martin Naylor
|
||||
Joakim Simonsson
|
||||
@@ -84,11 +85,12 @@ David Spilling
|
||||
Daniel Sj<53>lie
|
||||
Bryan Thrall
|
||||
Fabien Lavignotte
|
||||
Andreas Ekstrand
|
||||
Riccardo Corsi
|
||||
Mike Connell
|
||||
Melchior Franz
|
||||
Johannes Baeuerle
|
||||
Andreas Ekstrand
|
||||
Riccardo Corsi
|
||||
Thomas Hogarth
|
||||
Rafa Gaitan
|
||||
Neil Hughes
|
||||
Martin Beckett
|
||||
@@ -101,9 +103,9 @@ Cory Riddell
|
||||
Chuck Seberino
|
||||
Boris Bralo
|
||||
Yefei He
|
||||
Thomas Hogarth
|
||||
Sondra Iverson
|
||||
Simon Julier
|
||||
Sebastian Messerschmidt
|
||||
Rune Schmidt Jensen
|
||||
Rainer Oder
|
||||
Nico Kruithof
|
||||
@@ -119,13 +121,15 @@ Thibault Genessay
|
||||
Sasa Bistrovic
|
||||
Ravi Mathur
|
||||
Ralf Habacker
|
||||
Pjotr Svetachov
|
||||
Neil Groves
|
||||
Mikhail Izmestev
|
||||
Markus Trenkwalder
|
||||
Loic Dachary
|
||||
Joseph Steel
|
||||
Jordi Torres
|
||||
John Shue
|
||||
Brad Colbert
|
||||
Alexander Sinditskiy
|
||||
Vivek Rajan
|
||||
Uwe Woessner
|
||||
Tony Horrobin
|
||||
@@ -144,22 +148,21 @@ Martins Innus
|
||||
Maciej Krol
|
||||
Lilin Xiong
|
||||
Leandro Motta Barros
|
||||
Jordi Torres
|
||||
Johan Nouvel
|
||||
Hartwig Wiesmann
|
||||
Donn Mielcarek
|
||||
Corbin Holtz
|
||||
Blasius Czink
|
||||
Alexander Sinditskiy
|
||||
Bj<EFBFBD>rn Blissing
|
||||
Alexander Irion
|
||||
Toshiyuki Takahei
|
||||
Sebastien Grignard
|
||||
Ryan Kawicki
|
||||
Rudolf Wiedemann
|
||||
Romano Magacho
|
||||
Mikhail Izmestev
|
||||
Robert Milharcic
|
||||
Maria Ten
|
||||
Liang Aibin
|
||||
Kristofer Tingdahl
|
||||
Katharina Plugge
|
||||
John Vidar Larring
|
||||
John Kelso
|
||||
@@ -177,14 +180,13 @@ Alok Priyadarshi
|
||||
Alberto Barbati
|
||||
Alan Dickinson
|
||||
Vladimir Shabanov
|
||||
Vladimir Chebaev
|
||||
Tugkan Calapoglu
|
||||
Tim Daoust
|
||||
Sohey Yamamoto
|
||||
Sergey Leontyev
|
||||
Sebastian Messerschmidt
|
||||
Santosh Gaikwad
|
||||
Ryan Pavlik
|
||||
Robert Milharcic
|
||||
Rene Molenaar
|
||||
Piotr Domagalski
|
||||
Phil Atkin
|
||||
@@ -194,6 +196,7 @@ Mattias Linde
|
||||
Mark Sciabica
|
||||
Marcin Prus
|
||||
Lee Butler
|
||||
Lars Nilsson
|
||||
Konstantin Sinitsyn
|
||||
Ken Sewell
|
||||
Julian Ortiz
|
||||
@@ -211,6 +214,7 @@ Doug McCorkle
|
||||
Donald Cipperly
|
||||
Don Leich
|
||||
Dietmar Funck
|
||||
Colin Cochran
|
||||
Christian Buchner
|
||||
Charles Cole
|
||||
Blake Williams
|
||||
@@ -224,7 +228,6 @@ Zach Deedler
|
||||
Yuzhong Shen
|
||||
Wee See
|
||||
Warren Macchi
|
||||
Vladimir Chebaev
|
||||
Vincent Bourdier
|
||||
Terrex
|
||||
Tassilo Glander
|
||||
@@ -258,9 +261,9 @@ Martin Lambers
|
||||
Martijn Kragtwijk
|
||||
Marius Heise
|
||||
Marcin Hajder
|
||||
Marcel Pursche
|
||||
Lilith Bryant
|
||||
Lars Nilsson
|
||||
Kristofer Tingdahl
|
||||
Konstantin Matveyev
|
||||
Kevin Moiule
|
||||
Keith Steffen
|
||||
Julen Garcia
|
||||
@@ -279,6 +282,7 @@ Guy Volckaert
|
||||
Gustavo Wagner
|
||||
Guillaume Taze
|
||||
Guillaume Chouvenc
|
||||
Giuseppe Donvito
|
||||
Gill Peacegood
|
||||
Gerrick Bivins
|
||||
George Tarantilis
|
||||
@@ -294,7 +298,9 @@ Daniel Trstenjak
|
||||
Craig Bosma
|
||||
Claus Scheiblauer
|
||||
Christophe Loustaunau
|
||||
Christian Ruzicka
|
||||
Brad Anderegg
|
||||
Bj<EFBFBD>rn Hein
|
||||
Aric Aumann
|
||||
Andrew Sampson
|
||||
Andrew Lorino
|
||||
@@ -333,6 +339,7 @@ Simon Buckley
|
||||
Sid Byce
|
||||
Shuxing Xiao
|
||||
Shane Arnott
|
||||
Sergey Kurdakov
|
||||
Sebastien Kuntz
|
||||
Ruth Lang
|
||||
Ruben Smelik
|
||||
@@ -340,12 +347,14 @@ Ross Anderson
|
||||
Ronny Krueger
|
||||
Ronald van Maarseveen
|
||||
Romain Charbit
|
||||
Rocco Martino
|
||||
Robert Swain
|
||||
Rob Smith
|
||||
Rob Radtke
|
||||
Rob Bloemkool
|
||||
Rick Pingry
|
||||
Rick Appleton
|
||||
Remo Eichenberger
|
||||
Reinhard Sainitzer
|
||||
Rein Kadijk
|
||||
Ragnar Hammarqvist
|
||||
@@ -376,8 +385,10 @@ Nick Black
|
||||
Mojtaba Fathi
|
||||
Mirko Viviani
|
||||
Mikkel Gjøl
|
||||
Mike Krus
|
||||
Mike Garrity
|
||||
Miha Ravsel
|
||||
Michael Schanne
|
||||
Michael Polak
|
||||
Michael Morrison
|
||||
Michael Logan
|
||||
@@ -386,7 +397,6 @@ Michael Bach Jensen
|
||||
Max Rhiener
|
||||
Max Behensky
|
||||
Mauricio Hofmam
|
||||
Matthias Helsing
|
||||
Matthew May
|
||||
Matthew Johnson-Roberson
|
||||
Matt Green
|
||||
@@ -401,7 +411,7 @@ Marius Kintel
|
||||
Mario Guimaraes
|
||||
Marco Sciabica
|
||||
Marco Lehmann
|
||||
Marcel Pursche
|
||||
Marc Helbling
|
||||
Maik Keller
|
||||
Lukas Diduch
|
||||
Louis Hamilton
|
||||
@@ -409,10 +419,8 @@ Lewis Harmon
|
||||
Leigh Stivers
|
||||
Laurence Muller
|
||||
Laura Cerritelli
|
||||
Lars Nillson
|
||||
Kyle Centers
|
||||
Kristopher Bixler
|
||||
Konstantin Matveyev
|
||||
Kim Seokhwan
|
||||
Kim Bale
|
||||
Karsten Weiss
|
||||
@@ -470,6 +478,7 @@ Duvan Cope
|
||||
Duncan Cavens
|
||||
Drew Whitehouse
|
||||
Douglas A. Pouk
|
||||
Dmitry Marakasov
|
||||
Dean Iverson
|
||||
David Jung
|
||||
Danny Valente
|
||||
@@ -480,8 +489,8 @@ Cyril Brulebois
|
||||
Clay Fowler
|
||||
Chuck Sembroski
|
||||
Christopher Blaesius
|
||||
Christopher Baker
|
||||
Christophe Herreman
|
||||
Christian Ruzicka
|
||||
Christian Noon
|
||||
Christian Kaser
|
||||
Christian Ehrlicher
|
||||
@@ -492,8 +501,6 @@ Bruno Herbelin
|
||||
Brian Keener
|
||||
Brandon Hamm
|
||||
Bora Utka
|
||||
Bj<EFBFBD>rn Hein
|
||||
Bjorn Blissing
|
||||
Bill Prendergast
|
||||
Bernardt Duvenhage
|
||||
Benoit Laniel
|
||||
@@ -502,6 +509,7 @@ Ben van Basten
|
||||
Bart Gallet
|
||||
Axel Volley
|
||||
Anthousis Andreadis
|
||||
Anish Thomas
|
||||
Andy Preece
|
||||
Andrew Reyonolds
|
||||
Andreas Roth
|
||||
@@ -513,4 +521,5 @@ Alberto Jaspe
|
||||
Alan Purvis
|
||||
Alan Ott
|
||||
Alan Harris
|
||||
Adrien Grandemange
|
||||
Adam Richard
|
||||
|
||||
@@ -48,12 +48,12 @@ PROJECT(OpenSceneGraph)
|
||||
|
||||
SET(OPENSCENEGRAPH_MAJOR_VERSION 3)
|
||||
SET(OPENSCENEGRAPH_MINOR_VERSION 2)
|
||||
SET(OPENSCENEGRAPH_PATCH_VERSION 0)
|
||||
SET(OPENSCENEGRAPH_SOVERSION 99)
|
||||
SET(OPENSCENEGRAPH_PATCH_VERSION 1)
|
||||
SET(OPENSCENEGRAPH_SOVERSION 100)
|
||||
|
||||
# set to 0 when not a release candidate, non zero means that any generated
|
||||
# svn tags will be treated as release candidates of given number
|
||||
SET(OPENSCENEGRAPH_RELEASE_CANDIDATE 1)
|
||||
SET(OPENSCENEGRAPH_RELEASE_CANDIDATE 0)
|
||||
|
||||
SET(OPENSCENEGRAPH_VERSION ${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION})
|
||||
|
||||
@@ -174,8 +174,8 @@ ENDIF()
|
||||
OPTION(OSG_MAINTAINER "Enable OpenSceneGraph maintainer build methods, such as making svn branches, tags, updating ChangeLog." OFF)
|
||||
IF (OSG_MAINTAINER)
|
||||
|
||||
SET(OPENSCENEGRAPH_SVN "trunk")
|
||||
#SET(OPENSCENEGRAPH_SVN "branches")
|
||||
#SET(OPENSCENEGRAPH_SVN "trunk")
|
||||
SET(OPENSCENEGRAPH_SVN "branches")
|
||||
SET(OPENSCENEGRAPH_BRANCH OpenSceneGraph-${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION})
|
||||
|
||||
#
|
||||
@@ -247,13 +247,16 @@ IF(APPLE)
|
||||
|
||||
#you need to manually set the default sdk version here
|
||||
SET (IPHONE_SDKVER "6.0" CACHE STRING "IOS SDK-Version")
|
||||
SET (IPHONE_VERSION_MIN "4.2" CACHE STRING "IOS minimum os version, use 7.0 or greater to get 64bit support")
|
||||
|
||||
#the below is taken from ogre, it states the gcc stuff needs to happen before PROJECT() is called. I've no clue if we even need it
|
||||
# Force gcc <= 4.2 on iPhone
|
||||
include(CMakeForceCompiler)
|
||||
CMAKE_FORCE_C_COMPILER(llvm-gcc-4.2 GNU)
|
||||
CMAKE_FORCE_CXX_COMPILER(llvm-gcc-4.2 GNU)
|
||||
SET(GCC_THUMB_SUPPORT NO)
|
||||
IF(IPHONE_VERSION_MIN LESS "6.0")
|
||||
include(CMakeForceCompiler)
|
||||
CMAKE_FORCE_C_COMPILER(llvm-gcc-4.2 GNU)
|
||||
CMAKE_FORCE_CXX_COMPILER(llvm-gcc-4.2 GNU)
|
||||
SET(GCC_THUMB_SUPPORT NO)
|
||||
ENDIF()
|
||||
|
||||
#set either the device sdk or the simulator sdk. Can't find away to separate these in the same project
|
||||
IF(OSG_BUILD_PLATFORM_IPHONE)
|
||||
@@ -512,7 +515,7 @@ IF(ANDROID)
|
||||
ANDROID_3RD_PARTY()
|
||||
ELSE()
|
||||
# Common to all platforms except android:
|
||||
FIND_PACKAGE(FreeType)
|
||||
FIND_PACKAGE(Freetype)
|
||||
FIND_PACKAGE(Inventor)
|
||||
FIND_PACKAGE(Jasper)
|
||||
FIND_PACKAGE(OpenEXR)
|
||||
@@ -535,7 +538,9 @@ ELSE()
|
||||
FIND_PACKAGE(GtkGl)
|
||||
FIND_PACKAGE(DirectInput)
|
||||
FIND_PACKAGE(NVTT)
|
||||
FIND_PACKAGE(Asio)
|
||||
IF (NOT WIN32)
|
||||
FIND_PACKAGE(Asio)
|
||||
ENDIF()
|
||||
FIND_PACKAGE(ZeroConf)
|
||||
ENDIF()
|
||||
|
||||
@@ -590,7 +595,7 @@ IF(OSG_USE_QT AND NOT ANDROID)
|
||||
|
||||
#If we have found Qt5, let's try to top off by getting the webkit as well
|
||||
IF ( Qt5Widgets_FOUND )
|
||||
FIND_PACKAGE(Qt5WebKitWidgets)
|
||||
FIND_PACKAGE(Qt5WebKitWidgets QUIET)
|
||||
ENDIF()
|
||||
|
||||
ENDIF()
|
||||
@@ -790,11 +795,7 @@ IF(CMAKE_COMPILER_IS_GNUCXX)
|
||||
# returns too many hits.
|
||||
# FYI, if we do implement GNUCC, then -Wmissing-prototypes in another
|
||||
# interesting C-specific flag.
|
||||
# Also, there is a bug in gcc 4.0. Under C++, -pedantic will create
|
||||
# errors instead of warnings for certain issues, including superfluous
|
||||
# semicolons and commas, and the use of long long. -fpermissive seems
|
||||
# to be the workaround.
|
||||
SET(OSG_AGGRESSIVE_WARNING_FLAGS -Wall -Wparentheses -Wno-long-long -Wno-import -pedantic -Wreturn-type -Wmissing-braces -Wunknown-pragmas -Wunused -fpermissive)
|
||||
SET(OSG_AGGRESSIVE_WARNING_FLAGS -Wall -Wparentheses -Wno-long-long -Wno-import -pedantic -Wreturn-type -Wmissing-braces -Wunknown-pragmas -Wunused)
|
||||
|
||||
# Previous included -Wformat=2 in OSG_AGGRESSIVE_WARNING_FLAGS but had to remove it due to standard library errors
|
||||
|
||||
@@ -811,6 +812,14 @@ ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
# CMake lacks an elseif, so other non-gcc, non-VS compilers need
|
||||
# to be listed below. If unhandled, OSG_AGGRESSIVE_WARNING_FLAGS should
|
||||
# remain unset.
|
||||
|
||||
IF (APPLE)
|
||||
# set standard lib, clang defaults to c++0x
|
||||
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++98")
|
||||
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libstdc++")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98 -stdlib=libstdc++ -Wno-overloaded-virtual -Wno-conversion")
|
||||
set(WARNING_CFLAGS "")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
# This part is for the CMake menu option to toggle the warnings on/off.
|
||||
@@ -870,8 +879,14 @@ IF(APPLE AND NOT ANDROID)
|
||||
|
||||
#set iphone arch and flags taken from http://sites.google.com/site/michaelsafyan/coding/resources/how-to-guides/cross-compile-for-the-iphone/how-to-cross-compile-for-the-iphone-using-cmake
|
||||
IF(OSG_BUILD_PLATFORM_IPHONE)
|
||||
SET(CMAKE_OSX_ARCHITECTURES "armv6;armv7" CACHE STRING "Build architectures for iOS" FORCE)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -miphoneos-version-min=4.1 -mno-thumb -arch armv6 -pipe -no-cpp-precomp" CACHE STRING "Flags used by the compiler during all build types." FORCE)
|
||||
IF(${IPHONE_VERSION_MIN} LESS "7.0")
|
||||
SET(CMAKE_OSX_ARCHITECTURES "armv6;armv7" CACHE STRING "Build architectures for iOS" FORCE)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -miphoneos-version-min=${IPHONE_VERSION_MIN} -mno-thumb -pipe -no-cpp-precomp" CACHE STRING "Flags used by the compiler during all build types." FORCE)
|
||||
ELSE()
|
||||
SET(CMAKE_OSX_ARCHITECTURES "armv7;armv7s;arm64" CACHE STRING "Build architectures for iOS" FORCE)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -miphoneos-version-min=${IPHONE_VERSION_MIN} -pipe -no-cpp-precomp" CACHE STRING "Flags used by the compiler during all build types." FORCE)
|
||||
ENDIF()
|
||||
|
||||
ELSE()
|
||||
#simulator uses i386 architectures
|
||||
SET(CMAKE_OSX_ARCHITECTURES "i386" CACHE STRING "Build architectures for iOS Simulator" FORCE)
|
||||
@@ -903,7 +918,7 @@ IF(APPLE AND NOT ANDROID)
|
||||
# FORCE is used because the options are not reflected in the UI otherwise.
|
||||
# Seems like a good place to add version specific compiler flags too.
|
||||
IF(NOT OSG_CONFIG_HAS_BEEN_RUN_BEFORE)
|
||||
IF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.8")
|
||||
IF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.8" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.9")
|
||||
SET(OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX "imageio" CACHE STRING "Forced imageio default image plugin for OSX" FORCE)
|
||||
# 64 Bit Works, i386,ppc is not supported any more
|
||||
SET(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "Build architectures for OSX" FORCE)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Check for availability of atomic operations
|
||||
# Check for availability of atomic operations
|
||||
# This module defines
|
||||
# OPENTHREADS_HAVE_ATOMIC_OPS
|
||||
|
||||
@@ -15,123 +15,134 @@ IF (OPENTHREADS_ATOMIC_USE_MUTEX)
|
||||
SET(_OPENTHREADS_ATOMIC_USE_MUTEX 1)
|
||||
|
||||
ELSE()
|
||||
# as the test does not work for IOS hardcode the ATOMIC implementation
|
||||
IF(OSG_BUILD_PLATFORM_IPHONE_SIMULATOR OR OSG_BUILD_PLATFORM_IPHONE)
|
||||
SET(_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS 0)
|
||||
SET(_OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS 0)
|
||||
SET(_OPENTHREADS_ATOMIC_USE_SUN 0)
|
||||
SET(_OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED 0)
|
||||
SET(_OPENTHREADS_ATOMIC_USE_MUTEX 0)
|
||||
|
||||
INCLUDE(CheckCXXSourceRuns)
|
||||
SET(_OPENTHREADS_ATOMIC_USE_BSD_ATOMIC 1)
|
||||
|
||||
# Do step by step checking,
|
||||
CHECK_CXX_SOURCE_RUNS("
|
||||
#include <cstdlib>
|
||||
ELSE()
|
||||
INCLUDE(CheckCXXSourceRuns)
|
||||
|
||||
int main()
|
||||
{
|
||||
unsigned value = 0;
|
||||
void* ptr = &value;
|
||||
__sync_add_and_fetch(&value, 1);
|
||||
__sync_synchronize();
|
||||
__sync_sub_and_fetch(&value, 1);
|
||||
if (!__sync_bool_compare_and_swap(&value, 0, 1))
|
||||
return EXIT_FAILURE;
|
||||
# Do step by step checking,
|
||||
CHECK_CXX_SOURCE_RUNS("
|
||||
#include <cstdlib>
|
||||
|
||||
if (!__sync_bool_compare_and_swap(&ptr, ptr, ptr))
|
||||
return EXIT_FAILURE;
|
||||
int main()
|
||||
{
|
||||
unsigned value = 0;
|
||||
void* ptr = &value;
|
||||
__sync_add_and_fetch(&value, 1);
|
||||
__sync_synchronize();
|
||||
__sync_sub_and_fetch(&value, 1);
|
||||
if (!__sync_bool_compare_and_swap(&value, 0, 1))
|
||||
return EXIT_FAILURE;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
" _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS)
|
||||
if (!__sync_bool_compare_and_swap(&ptr, ptr, ptr))
|
||||
return EXIT_FAILURE;
|
||||
|
||||
CHECK_CXX_SOURCE_RUNS("
|
||||
#include <stdlib.h>
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
" _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS)
|
||||
|
||||
int main(int, const char**)
|
||||
{
|
||||
unsigned value = 0;
|
||||
void* ptr = &value;
|
||||
__add_and_fetch(&value, 1);
|
||||
__synchronize(value);
|
||||
__sub_and_fetch(&value, 1);
|
||||
if (!__compare_and_swap(&value, 0, 1))
|
||||
return EXIT_FAILURE;
|
||||
CHECK_CXX_SOURCE_RUNS("
|
||||
#include <stdlib.h>
|
||||
|
||||
if (!__compare_and_swap((unsigned long*)&ptr, (unsigned long)ptr, (unsigned long)ptr))
|
||||
return EXIT_FAILURE;
|
||||
int main(int, const char**)
|
||||
{
|
||||
unsigned value = 0;
|
||||
void* ptr = &value;
|
||||
__add_and_fetch(&value, 1);
|
||||
__synchronize(value);
|
||||
__sub_and_fetch(&value, 1);
|
||||
if (!__compare_and_swap(&value, 0, 1))
|
||||
return EXIT_FAILURE;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
" _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS)
|
||||
if (!__compare_and_swap((unsigned long*)&ptr, (unsigned long)ptr, (unsigned long)ptr))
|
||||
return EXIT_FAILURE;
|
||||
|
||||
CHECK_CXX_SOURCE_RUNS("
|
||||
#include <atomic.h>
|
||||
#include <cstdlib>
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
" _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS)
|
||||
|
||||
int main(int, const char**)
|
||||
{
|
||||
uint_t value = 0;
|
||||
void* ptr = &value;
|
||||
atomic_inc_uint_nv(&value);
|
||||
membar_consumer();
|
||||
atomic_dec_uint_nv(&value);
|
||||
if (0 != atomic_cas_uint(&value, 0, 1))
|
||||
return EXIT_FAILURE;
|
||||
CHECK_CXX_SOURCE_RUNS("
|
||||
#include <atomic.h>
|
||||
#include <cstdlib>
|
||||
|
||||
if (ptr != atomic_cas_ptr(&ptr, ptr, ptr))
|
||||
return EXIT_FAILURE;
|
||||
int main(int, const char**)
|
||||
{
|
||||
uint_t value = 0;
|
||||
void* ptr = &value;
|
||||
atomic_inc_uint_nv(&value);
|
||||
membar_consumer();
|
||||
atomic_dec_uint_nv(&value);
|
||||
if (0 != atomic_cas_uint(&value, 0, 1))
|
||||
return EXIT_FAILURE;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
" _OPENTHREADS_ATOMIC_USE_SUN)
|
||||
if (ptr != atomic_cas_ptr(&ptr, ptr, ptr))
|
||||
return EXIT_FAILURE;
|
||||
|
||||
CHECK_CXX_SOURCE_RUNS("
|
||||
#include <windows.h>
|
||||
#include <intrin.h>
|
||||
#include <cstdlib>
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
" _OPENTHREADS_ATOMIC_USE_SUN)
|
||||
|
||||
#pragma intrinsic(_InterlockedAnd)
|
||||
#pragma intrinsic(_InterlockedOr)
|
||||
#pragma intrinsic(_InterlockedXor)
|
||||
CHECK_CXX_SOURCE_RUNS("
|
||||
#include <windows.h>
|
||||
#include <intrin.h>
|
||||
#include <cstdlib>
|
||||
|
||||
int main(int, const char**)
|
||||
{
|
||||
volatile long value = 0;
|
||||
long data = 0;
|
||||
long* volatile ptr = &data;
|
||||
#pragma intrinsic(_InterlockedAnd)
|
||||
#pragma intrinsic(_InterlockedOr)
|
||||
#pragma intrinsic(_InterlockedXor)
|
||||
|
||||
InterlockedIncrement(&value);
|
||||
MemoryBarrier();
|
||||
InterlockedDecrement(&value);
|
||||
int main(int, const char**)
|
||||
{
|
||||
volatile long value = 0;
|
||||
long data = 0;
|
||||
long* volatile ptr = &data;
|
||||
|
||||
if (0 != InterlockedCompareExchange(&value, 1, 0))
|
||||
return EXIT_FAILURE;
|
||||
InterlockedIncrement(&value);
|
||||
MemoryBarrier();
|
||||
InterlockedDecrement(&value);
|
||||
|
||||
if (ptr != InterlockedCompareExchangePointer((PVOID volatile*)&ptr, (PVOID)ptr, (PVOID)ptr))
|
||||
return EXIT_FAILURE;
|
||||
if (0 != InterlockedCompareExchange(&value, 1, 0))
|
||||
return EXIT_FAILURE;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
" _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED)
|
||||
if (ptr != InterlockedCompareExchangePointer((PVOID volatile*)&ptr, (PVOID)ptr, (PVOID)ptr))
|
||||
return EXIT_FAILURE;
|
||||
|
||||
CHECK_CXX_SOURCE_RUNS("
|
||||
#include <libkern/OSAtomic.h>
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
" _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED)
|
||||
|
||||
int main()
|
||||
{
|
||||
volatile int32_t value = 0;
|
||||
long data = 0;
|
||||
long * volatile ptr = &data;
|
||||
CHECK_CXX_SOURCE_RUNS("
|
||||
#include <libkern/OSAtomic.h>
|
||||
|
||||
OSAtomicIncrement32(&value);
|
||||
OSMemoryBarrier();
|
||||
OSAtomicDecrement32(&value);
|
||||
OSAtomicCompareAndSwapInt(value, 1, &value);
|
||||
OSAtomicCompareAndSwapPtr(ptr, ptr, (void * volatile *)&ptr);
|
||||
}
|
||||
" _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC)
|
||||
int main()
|
||||
{
|
||||
volatile int32_t value = 0;
|
||||
long data = 0;
|
||||
long * volatile ptr = &data;
|
||||
|
||||
IF(NOT _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS AND
|
||||
NOT _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS AND
|
||||
NOT _OPENTHREADS_ATOMIC_USE_SUN AND
|
||||
NOT _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED AND
|
||||
NOT _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC)
|
||||
SET(_OPENTHREADS_ATOMIC_USE_MUTEX 1)
|
||||
OSAtomicIncrement32(&value);
|
||||
OSMemoryBarrier();
|
||||
OSAtomicDecrement32(&value);
|
||||
OSAtomicCompareAndSwapInt(value, 1, &value);
|
||||
OSAtomicCompareAndSwapPtr(ptr, ptr, (void * volatile *)&ptr);
|
||||
}
|
||||
" _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC)
|
||||
|
||||
IF(NOT _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS AND
|
||||
NOT _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS AND
|
||||
NOT _OPENTHREADS_ATOMIC_USE_SUN AND
|
||||
NOT _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED AND
|
||||
NOT _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC)
|
||||
SET(_OPENTHREADS_ATOMIC_USE_MUTEX 1)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
ENDIF()
|
||||
|
||||
@@ -54,7 +54,7 @@ ENDMACRO(FIND_DEPENDENCY DEPNAME INCLUDEFILE LIBRARY_NAMES_BASE SEARCHPATHLIST D
|
||||
|
||||
|
||||
################################################################################################
|
||||
# this Macro is tailored to Mike dependencies
|
||||
# this Macro is tailored to Mike and Torbens dependencies
|
||||
################################################################################################
|
||||
|
||||
MACRO(SEARCH_3RDPARTY OSG_3RDPARTY_BIN)
|
||||
@@ -86,14 +86,14 @@ MACRO(SEARCH_3RDPARTY OSG_3RDPARTY_BIN)
|
||||
MARK_AS_ADVANCED(PNG_PNG_INCLUDE_DIR)
|
||||
ENDIF(PNG_FOUND)
|
||||
ENDIF(ZLIB_FOUND)
|
||||
FIND_DEPENDENCY(LIBXML2 libxml "libxml2" ${OSG_3RDPARTY_BIN} "D" "")
|
||||
FIND_DEPENDENCY(LIBXML2 libxml2 "libxml2" ${OSG_3RDPARTY_BIN} "D" "")
|
||||
IF(LIBXML2_FOUND)
|
||||
# The CMAKE find libxml module uses LIBXML2_LIBRARIES -> fill it.... kind of a hack
|
||||
SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARY} CACHE FILEPATH "" FORCE)
|
||||
SET(LIBXML2_XMLLINT_EXECUTABLE ${OSG_3RDPARTY_BIN}/bin/xmllint.exe CACHE FILEPATH "Path to xmllint executable" FORCE)
|
||||
ENDIF(LIBXML2_FOUND)
|
||||
#FIND_DEPENDENCY(DEPNAME INCLUDEFILE LIBRARY_NAMES_BASE SEARCHPATHLIST DEBUGSUFFIX EXSUFFIX)
|
||||
FIND_Package(NVTT)
|
||||
FIND_Package(NVTT)
|
||||
#luigi#INCLUDE(FindOSGDepends.cmake)
|
||||
ENDMACRO(SEARCH_3RDPARTY OSG_3RDPARTY_BIN)
|
||||
|
||||
|
||||
@@ -1,22 +1,20 @@
|
||||
# Locate Apple AVFoundation (next-generation QTKit)
|
||||
# This module defines
|
||||
# AV_FOUNDATION_LIBRARY
|
||||
# AV_FOUNDATION_FOUND, if false, do not try to link to gdal
|
||||
# AV_FOUNDATION_INCLUDE_DIR, where to find the headers
|
||||
# AV_FOUNDATION_FOUND, if false, do not try to link to gdal
|
||||
#
|
||||
# $AV_FOUNDATION_DIR is an environment variable that would
|
||||
# correspond to the ./configure --prefix=$AV_FOUNDATION_DIR
|
||||
#
|
||||
# Created by Stephan Maximilian Huber
|
||||
# Created by Stephan Maximilian Huber
|
||||
|
||||
|
||||
IF(APPLE)
|
||||
FIND_PATH(AV_FOUNDATION_INCLUDE_DIR AVFoundation/AVFoundation.h)
|
||||
FIND_LIBRARY(AV_FOUNDATION_LIBRARY AVFoundation)
|
||||
ENDIF()
|
||||
|
||||
SET(AV_FOUNDATION_FOUND "NO")
|
||||
IF(AV_FOUNDATION_LIBRARY AND AV_FOUNDATION_INCLUDE_DIR)
|
||||
IF(AV_FOUNDATION_LIBRARY)
|
||||
SET(AV_FOUNDATION_FOUND "YES")
|
||||
ENDIF()
|
||||
|
||||
@@ -32,11 +30,11 @@ ELSE()
|
||||
# AVFoundation exists since 10.7, but only 10.8 has all features necessary for OSG
|
||||
# so check the SDK-setting
|
||||
|
||||
IF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.8")
|
||||
IF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.8" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.9")
|
||||
# nothing special here ;-)
|
||||
ELSE()
|
||||
MESSAGE("AVFoundation disabled for SDK < 10.8")
|
||||
SET(AV_FOUNDATION_FOUND "NO")
|
||||
SET(AV_FOUNDATION_FOUND "NO")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
0
CMakeModules/FindAsio.cmake
Executable file → Normal file
0
CMakeModules/FindAsio.cmake
Executable file → Normal file
@@ -28,6 +28,10 @@ IF(APPLE)
|
||||
SET(COLLADA_BUILDNAME "mac")
|
||||
ELSEIF(MINGW)
|
||||
SET(COLLADA_BUILDNAME "mingw")
|
||||
ELSEIF(MSVC12)
|
||||
SET(COLLADA_BUILDNAME "vc12")
|
||||
ELSEIF(MSVC11)
|
||||
SET(COLLADA_BUILDNAME "vc11")
|
||||
ELSEIF(MSVC10)
|
||||
SET(COLLADA_BUILDNAME "vc10")
|
||||
ELSEIF(MSVC90)
|
||||
@@ -238,7 +242,7 @@ FIND_LIBRARY(COLLADA_STATIC_LIBRARY_DEBUG
|
||||
)
|
||||
|
||||
FIND_LIBRARY(COLLADA_BOOST_FILESYSTEM_LIBRARY
|
||||
NAMES libboost_filesystem boost_filesystem boost_filesystem-mt libboost_filesystem-vc90-mt libboost_filesystem-vc100-mt
|
||||
NAMES libboost_filesystem boost_filesystem boost_filesystem-mt libboost_filesystem-${COLLADA_BUILDNAME}0-mt libboost_filesystem-${COLLADA_BUILDNAME}0-mt-1_54 libboost_filesystem-${COLLADA_BUILDNAME}0-mt-1_55
|
||||
PATHS
|
||||
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
|
||||
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
|
||||
@@ -246,7 +250,7 @@ FIND_LIBRARY(COLLADA_STATIC_LIBRARY_DEBUG
|
||||
)
|
||||
|
||||
FIND_LIBRARY(COLLADA_BOOST_FILESYSTEM_LIBRARY_DEBUG
|
||||
NAMES libboost_filesystem-d boost_filesystem-d boost_filesystem-mt-d libboost_filesystem-vc90-mt-gd libboost_filesystem-vc100-mt-gd
|
||||
NAMES libboost_filesystem-d boost_filesystem-d boost_filesystem-mt-d libboost_filesystem-${COLLADA_BUILDNAME}0-mt-gd libboost_filesystem-${COLLADA_BUILDNAME}0-mt-gd-1_54 libboost_filesystem-${COLLADA_BUILDNAME}0-mt-gd-1_55
|
||||
PATHS
|
||||
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
|
||||
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
|
||||
@@ -254,7 +258,7 @@ FIND_LIBRARY(COLLADA_STATIC_LIBRARY_DEBUG
|
||||
)
|
||||
|
||||
FIND_LIBRARY(COLLADA_BOOST_SYSTEM_LIBRARY
|
||||
NAMES libboost_system boost_system boost_system-mt libboost_system-vc90-mt libboost_system-vc100-mt
|
||||
NAMES libboost_system boost_system boost_system-mt libboost_system-${COLLADA_BUILDNAME}0-mt libboost_system-${COLLADA_BUILDNAME}0-mt-1_54 libboost_system-${COLLADA_BUILDNAME}0-mt-1_55
|
||||
PATHS
|
||||
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
|
||||
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
|
||||
@@ -262,7 +266,7 @@ FIND_LIBRARY(COLLADA_STATIC_LIBRARY_DEBUG
|
||||
)
|
||||
|
||||
FIND_LIBRARY(COLLADA_BOOST_SYSTEM_LIBRARY_DEBUG
|
||||
NAMES libboost_system-d boost_system-d boost_system-mt-d libboost_system-vc90-mt-gd libboost_system-vc100-mt-gd
|
||||
NAMES libboost_system-d boost_system-d boost_system-mt-d libboost_system-${COLLADA_BUILDNAME}0-mt-gd libboost_system-${COLLADA_BUILDNAME}0-mt-gd-1_54 libboost_system-${COLLADA_BUILDNAME}0-mt-gd-1_55
|
||||
PATHS
|
||||
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
|
||||
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
|
||||
|
||||
@@ -48,7 +48,7 @@ FIND_PATH(FREETYPE_INCLUDE_DIR_ft2build ft2build.h
|
||||
/opt/csw
|
||||
/opt
|
||||
/usr/freeware
|
||||
PATH_SUFFIXES include
|
||||
PATH_SUFFIXES include include/freetype2
|
||||
)
|
||||
|
||||
FIND_PATH(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h
|
||||
@@ -74,6 +74,20 @@ FIND_PATH(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h
|
||||
/usr/freeware/include/freetype2
|
||||
)
|
||||
|
||||
FIND_PATH(FREETYPE_INCLUDE_DIR_freetype2 config/ftheader.h
|
||||
/usr/local/include/freetype2
|
||||
/usr/include/freetype2
|
||||
/usr/local/X11R6/include/freetype2
|
||||
/usr/local/X11/include/freetype2
|
||||
/usr/X11R6/include/freetype2
|
||||
/usr/X11/include/freetype2
|
||||
/sw/include/freetype2
|
||||
/opt/local/include/freetype2
|
||||
/opt/csw/include/freetype2
|
||||
/opt/include/freetype2
|
||||
/usr/freeware/include/freetype2
|
||||
)
|
||||
|
||||
FIND_LIBRARY(FREETYPE_LIBRARY
|
||||
NAMES freetype libfreetype freetype219
|
||||
PATHS
|
||||
@@ -15,6 +15,7 @@ FIND_PATH(NVTT_INCLUDE_DIR nvtt/nvtt.h
|
||||
PATH_SUFFIXES include
|
||||
)
|
||||
|
||||
# NVTT
|
||||
FIND_LIBRARY(NVTT_LIBRARY
|
||||
NAMES nvtt
|
||||
PATHS
|
||||
@@ -25,6 +26,17 @@ FIND_LIBRARY(NVTT_LIBRARY
|
||||
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
|
||||
)
|
||||
|
||||
FIND_LIBRARY(NVTT_LIBRARY_DEBUG
|
||||
NAMES nvtt_d
|
||||
PATHS
|
||||
/usr/local
|
||||
/usr
|
||||
$ENV{NVTT_DIR}
|
||||
${3rdPartyRoot}
|
||||
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
|
||||
)
|
||||
|
||||
# NVIMAGE
|
||||
FIND_LIBRARY(NVIMAGE_LIBRARY
|
||||
NAMES nvimage
|
||||
PATHS
|
||||
@@ -35,6 +47,17 @@ FIND_LIBRARY(NVIMAGE_LIBRARY
|
||||
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
|
||||
)
|
||||
|
||||
FIND_LIBRARY(NVIMAGE_LIBRARY_DEBUG
|
||||
NAMES nvimage_d
|
||||
PATHS
|
||||
/usr/local
|
||||
/usr
|
||||
$ENV{NVTT_DIR}
|
||||
${3rdPartyRoot}
|
||||
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
|
||||
)
|
||||
|
||||
# NVMATH
|
||||
FIND_LIBRARY(NVMATH_LIBRARY
|
||||
NAMES nvmath
|
||||
PATHS
|
||||
@@ -45,6 +68,17 @@ FIND_LIBRARY(NVMATH_LIBRARY
|
||||
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
|
||||
)
|
||||
|
||||
FIND_LIBRARY(NVMATH_LIBRARY_DEBUG
|
||||
NAMES nvmath_d
|
||||
PATHS
|
||||
/usr/local
|
||||
/usr
|
||||
$ENV{NVTT_DIR}
|
||||
${3rdPartyRoot}
|
||||
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
|
||||
)
|
||||
|
||||
# NVCORE
|
||||
FIND_LIBRARY(NVCORE_LIBRARY
|
||||
NAMES nvcore
|
||||
PATHS
|
||||
@@ -54,6 +88,18 @@ FIND_LIBRARY(NVCORE_LIBRARY
|
||||
${3rdPartyRoot}
|
||||
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
|
||||
)
|
||||
FIND_LIBRARY(NVCORE_LIBRARY_DEBUG
|
||||
NAMES nvcore_d
|
||||
PATHS
|
||||
/usr/local
|
||||
/usr
|
||||
$ENV{NVTT_DIR}
|
||||
${3rdPartyRoot}
|
||||
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
SET(NVTT_FOUND "NO")
|
||||
IF(NVTT_LIBRARY AND NVTT_INCLUDE_DIR)
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
# Locate gdal
|
||||
# This module defines
|
||||
# OSG_LIBRARY
|
||||
# OSG_FOUND, if false, do not try to link to gdal
|
||||
# OSG_FOUND, if false, do not try to link to gdal
|
||||
# OSG_INCLUDE_DIR, where to find the headers
|
||||
#
|
||||
# $OSG_DIR is an environment variable that would
|
||||
# correspond to the ./configure --prefix=$OSG_DIR
|
||||
#
|
||||
# Created by Robert Osfield.
|
||||
# Created by Robert Osfield.
|
||||
|
||||
FIND_PATH(OSG_INCLUDE_DIR osg/Node
|
||||
${OSG_DIR}/include
|
||||
@@ -59,7 +59,7 @@ MACRO(FIND_OSG_LIBRARY MYLIBRARY MYLIBRARYNAME)
|
||||
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
|
||||
/usr/freeware/lib64
|
||||
)
|
||||
|
||||
|
||||
FIND_LIBRARY(${MYLIBRARY}
|
||||
NAMES "${MYLIBRARYNAME}${CMAKE_RELEASE_POSTFIX}"
|
||||
PATHS
|
||||
@@ -107,7 +107,7 @@ MACRO(FIND_OSG_LIBRARY MYLIBRARY MYLIBRARYNAME)
|
||||
ENDIF(NOT MYLIBRARY)
|
||||
|
||||
ENDIF( NOT ${MYLIBRARY}_DEBUG )
|
||||
|
||||
|
||||
ENDMACRO(FIND_OSG_LIBRARY LIBRARY LIBRARYNAME)
|
||||
|
||||
FIND_OSG_LIBRARY(OSG_LIBRARY osg)
|
||||
@@ -126,7 +126,7 @@ FIND_OSG_LIBRARY(OSGANIMATION_LIBRARY osgAnimation)
|
||||
FIND_OSG_LIBRARY(OSGPARTICLE_LIBRARY osgParticle)
|
||||
FIND_OSG_LIBRARY(OSGSHADOW_LIBRARY osgShadow)
|
||||
FIND_OSG_LIBRARY(OSGPRESENTATION_LIBRARY osgPresentation)
|
||||
FIND_OSG_LIBRARY(OSGSIM osgSim)
|
||||
FIND_OSG_LIBRARY(OSGSIM_LIBRARY osgSim)
|
||||
FIND_OSG_LIBRARY(OPENTHREADS_LIBRARY OpenThreads)
|
||||
|
||||
|
||||
|
||||
@@ -5,7 +5,9 @@ IF(PKG_CONFIG_FOUND)
|
||||
|
||||
INCLUDE(FindPkgConfig)
|
||||
|
||||
PKG_CHECK_MODULES(RSVG librsvg-2.0)
|
||||
#Version 2.35 introduces the rsvg_cleanup function which is used
|
||||
PKG_CHECK_MODULES(RSVG librsvg-2.0>=2.35)
|
||||
|
||||
PKG_CHECK_MODULES(CAIRO cairo)
|
||||
|
||||
IF (RSVG_FOUND AND NOT CAIRO_FOUND)
|
||||
|
||||
0
CMakeModules/FindZeroConf.cmake
Executable file → Normal file
0
CMakeModules/FindZeroConf.cmake
Executable file → Normal file
@@ -5,7 +5,7 @@
|
||||
# NAME of the variables, so the macro gets as arguments the target name and the following list of parameters
|
||||
# is intended as a list of variable names each one containing the path of the libraries to link to
|
||||
# The existance of a variable name with _DEBUG appended is tested and, in case it' s value is used
|
||||
# for linking to when in debug mode
|
||||
# for linking to when in debug mode
|
||||
# the content of this library for linking when in debugging
|
||||
#######################################################################################################
|
||||
|
||||
@@ -87,12 +87,12 @@ MACRO(LINK_CORELIB_DEFAULT CORELIB_NAME)
|
||||
SET(ALL_GL_LIBRARIES ${ALL_GL_LIBRARIES} ${OPENGL_egl_LIBRARY})
|
||||
ENDIF()
|
||||
|
||||
LINK_EXTERNAL(${CORELIB_NAME} ${ALL_GL_LIBRARIES})
|
||||
LINK_EXTERNAL(${CORELIB_NAME} ${ALL_GL_LIBRARIES})
|
||||
LINK_WITH_VARIABLES(${CORELIB_NAME} OPENTHREADS_LIBRARY)
|
||||
IF(OPENSCENEGRAPH_SONAMES)
|
||||
SET_TARGET_PROPERTIES(${CORELIB_NAME} PROPERTIES VERSION ${OPENSCENEGRAPH_VERSION} SOVERSION ${OPENSCENEGRAPH_SOVERSION})
|
||||
ENDIF(OPENSCENEGRAPH_SONAMES)
|
||||
|
||||
|
||||
ENDMACRO(LINK_CORELIB_DEFAULT CORELIB_NAME)
|
||||
|
||||
|
||||
@@ -112,11 +112,11 @@ MACRO(SETUP_LINK_LIBRARIES)
|
||||
######################################################################
|
||||
#
|
||||
# This set up the libraries to link to, it assumes there are two variable: one common for a group of examples or plugins
|
||||
# kept in the variable TARGET_COMMON_LIBRARIES and an example or plugin specific kept in TARGET_ADDED_LIBRARIES
|
||||
# they are combined in a single list checked for unicity
|
||||
# kept in the variable TARGET_COMMON_LIBRARIES and an example or plugin specific kept in TARGET_ADDED_LIBRARIES
|
||||
# they are combined in a single list checked for unicity
|
||||
# the suffix ${CMAKE_DEBUG_POSTFIX} is used for differentiating optimized and debug
|
||||
#
|
||||
# a second variable TARGET_EXTERNAL_LIBRARIES hold the list of libraries not differentiated between debug and optimized
|
||||
# a second variable TARGET_EXTERNAL_LIBRARIES hold the list of libraries not differentiated between debug and optimized
|
||||
##################################################################################
|
||||
SET(TARGET_LIBRARIES ${TARGET_COMMON_LIBRARIES})
|
||||
|
||||
@@ -151,7 +151,7 @@ MACRO(SETUP_LINK_LIBRARIES)
|
||||
ENDIF(TARGET_LIBRARIES_VARS)
|
||||
IF(MSVC AND OSG_MSVC_VERSIONED_DLL)
|
||||
#when using full path name to specify linkage, it seems that already linked libs must be specified
|
||||
LINK_EXTERNAL(${TARGET_TARGETNAME} ${ALL_GL_LIBRARIES})
|
||||
LINK_EXTERNAL(${TARGET_TARGETNAME} ${ALL_GL_LIBRARIES})
|
||||
ENDIF(MSVC AND OSG_MSVC_VERSIONED_DLL)
|
||||
|
||||
ENDMACRO(SETUP_LINK_LIBRARIES)
|
||||
@@ -213,7 +213,7 @@ ENDMACRO(SET_OUTPUT_DIR_PROPERTY_260 TARGET_TARGETNAME RELATIVE_OUTDIR)
|
||||
|
||||
MACRO(SETUP_LIBRARY LIB_NAME)
|
||||
IF(ANDROID)
|
||||
SETUP_ANDROID_LIBRARY(${LIB_NAME})
|
||||
SETUP_ANDROID_LIBRARY(${LIB_NAME})
|
||||
ELSE()
|
||||
SET(TARGET_NAME ${LIB_NAME} )
|
||||
SET(TARGET_TARGETNAME ${LIB_NAME} )
|
||||
@@ -224,10 +224,13 @@ MACRO(SETUP_LIBRARY LIB_NAME)
|
||||
${TARGET_SRC}
|
||||
)
|
||||
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES FOLDER "OSG Core")
|
||||
IF(APPLE)
|
||||
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES XCODE_ATTRIBUTE_WARNING_CFLAGS "")
|
||||
ENDIF()
|
||||
IF(TARGET_LABEL)
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PROJECT_LABEL "${TARGET_LABEL}")
|
||||
ENDIF(TARGET_LABEL)
|
||||
|
||||
|
||||
IF(TARGET_LIBRARIES)
|
||||
LINK_INTERNAL(${LIB_NAME} ${TARGET_LIBRARIES})
|
||||
ENDIF()
|
||||
@@ -238,14 +241,14 @@ MACRO(SETUP_LIBRARY LIB_NAME)
|
||||
LINK_WITH_VARIABLES(${LIB_NAME} ${TARGET_LIBRARIES_VARS})
|
||||
ENDIF(TARGET_LIBRARIES_VARS)
|
||||
LINK_CORELIB_DEFAULT(${LIB_NAME})
|
||||
|
||||
|
||||
ENDIF()
|
||||
INCLUDE(ModuleInstall OPTIONAL)
|
||||
ENDMACRO(SETUP_LIBRARY LIB_NAME)
|
||||
|
||||
MACRO(SETUP_PLUGIN PLUGIN_NAME)
|
||||
IF(ANDROID)
|
||||
SETUP_ANDROID_LIBRARY(${TARGET_DEFAULT_PREFIX}${PLUGIN_NAME})
|
||||
SETUP_ANDROID_LIBRARY(${TARGET_DEFAULT_PREFIX}${PLUGIN_NAME})
|
||||
ELSE()
|
||||
|
||||
SET(TARGET_NAME ${PLUGIN_NAME} )
|
||||
@@ -268,38 +271,33 @@ MACRO(SETUP_PLUGIN PLUGIN_NAME)
|
||||
SET(PACKAGE_COMPONENT libopenscenegraph)
|
||||
ENDIF(${ARGC} GREATER 1)
|
||||
|
||||
# Add the VisualStudio versioning info
|
||||
# Add the VisualStudio versioning info
|
||||
SET(TARGET_SRC ${TARGET_SRC} ${OPENSCENEGRAPH_VERSIONINFO_RC})
|
||||
|
||||
# here we use the command to generate the library
|
||||
|
||||
# here we use the command to generate the library
|
||||
|
||||
IF (DYNAMIC_OPENSCENEGRAPH)
|
||||
ADD_LIBRARY(${TARGET_TARGETNAME} MODULE ${TARGET_SRC} ${TARGET_H})
|
||||
ELSE (DYNAMIC_OPENSCENEGRAPH)
|
||||
ADD_LIBRARY(${TARGET_TARGETNAME} STATIC ${TARGET_SRC} ${TARGET_H})
|
||||
ENDIF(DYNAMIC_OPENSCENEGRAPH)
|
||||
|
||||
#not sure if needed, but for plugins only Msvc need the d suffix
|
||||
IF(NOT MSVC)
|
||||
IF(NOT UNIX)
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES DEBUG_POSTFIX "")
|
||||
ENDIF(NOT UNIX)
|
||||
ELSE(NOT MSVC)
|
||||
|
||||
IF(MSVC)
|
||||
IF(NOT CMAKE24)
|
||||
SET_OUTPUT_DIR_PROPERTY_260(${TARGET_TARGETNAME} "${OSG_PLUGINS}") # Sets the ouput to be /osgPlugin-X.X.X ; also ensures the /Debug /Release are removed
|
||||
ELSE(NOT CMAKE24)
|
||||
|
||||
IF(OSG_MSVC_VERSIONED_DLL)
|
||||
IF(OSG_MSVC_VERSIONED_DLL)
|
||||
|
||||
#this is a hack... the build place is set to lib/<debug or release> by LIBARARY_OUTPUT_PATH equal to OUTPUT_LIBDIR
|
||||
#the .lib will be crated in ../ so going straight in lib by the IMPORT_PREFIX property
|
||||
#because we want dll placed in OUTPUT_BINDIR ie the bin folder sibling of lib, we can use ../../bin to go there,
|
||||
#it is hardcoded, we should compute OUTPUT_BINDIR position relative to OUTPUT_LIBDIR ... to be implemented
|
||||
#changing bin to something else breaks this hack
|
||||
#the dll are placed in bin/${OSG_PLUGINS}
|
||||
#the dll are placed in bin/${OSG_PLUGINS}
|
||||
|
||||
IF(NOT MSVC_IDE)
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "../bin/${OSG_PLUGINS}/")
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "../bin/${OSG_PLUGINS}/")
|
||||
ELSE(NOT MSVC_IDE)
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "../../bin/${OSG_PLUGINS}/" IMPORT_PREFIX "../")
|
||||
ENDIF(NOT MSVC_IDE)
|
||||
@@ -313,16 +311,18 @@ MACRO(SETUP_PLUGIN PLUGIN_NAME)
|
||||
ENDIF(OSG_MSVC_VERSIONED_DLL)
|
||||
|
||||
ENDIF(NOT CMAKE24)
|
||||
ENDIF(NOT MSVC)
|
||||
ENDIF(MSVC)
|
||||
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PROJECT_LABEL "${TARGET_LABEL}")
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES FOLDER "Plugins")
|
||||
|
||||
IF(APPLE)
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_WARNING_CFLAGS "")
|
||||
ENDIF()
|
||||
SETUP_LINK_LIBRARIES()
|
||||
|
||||
#the installation path are differentiated for win32 that install in bib versus other architecture that install in lib${LIB_POSTFIX}/${OSG_PLUGINS}
|
||||
IF(WIN32)
|
||||
INSTALL(TARGETS ${TARGET_TARGETNAME}
|
||||
INSTALL(TARGETS ${TARGET_TARGETNAME}
|
||||
RUNTIME DESTINATION bin COMPONENT ${PACKAGE_COMPONENT}
|
||||
ARCHIVE DESTINATION lib/${OSG_PLUGINS} COMPONENT libopenscenegraph-dev
|
||||
LIBRARY DESTINATION bin/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT})
|
||||
@@ -350,11 +350,11 @@ MACRO(SETUP_EXE IS_COMMANDLINE_APP)
|
||||
ENDIF(NOT TARGET_LABEL)
|
||||
|
||||
IF(${IS_COMMANDLINE_APP})
|
||||
|
||||
|
||||
ADD_EXECUTABLE(${TARGET_TARGETNAME} ${TARGET_SRC} ${TARGET_H})
|
||||
|
||||
|
||||
ELSE(${IS_COMMANDLINE_APP})
|
||||
|
||||
|
||||
IF(APPLE)
|
||||
# SET(MACOSX_BUNDLE_LONG_VERSION_STRING "${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION}")
|
||||
# Short Version is the "marketing version". It is the version
|
||||
@@ -363,6 +363,8 @@ MACRO(SETUP_EXE IS_COMMANDLINE_APP)
|
||||
# Bundle version is the version the OS looks at.
|
||||
SET(MACOSX_BUNDLE_BUNDLE_VERSION "${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION}")
|
||||
SET(MACOSX_BUNDLE_GUI_IDENTIFIER "org.openscenegraph.${TARGET_TARGETNAME}" )
|
||||
# replace underscore by hyphen
|
||||
STRING(REGEX REPLACE "_" "-" MACOSX_BUNDLE_GUI_IDENTIFIER ${MACOSX_BUNDLE_GUI_IDENTIFIER})
|
||||
SET(MACOSX_BUNDLE_BUNDLE_NAME "${TARGET_NAME}" )
|
||||
# SET(MACOSX_BUNDLE_ICON_FILE "myicon.icns")
|
||||
# SET(MACOSX_BUNDLE_COPYRIGHT "")
|
||||
@@ -382,7 +384,7 @@ MACRO(SETUP_EXE IS_COMMANDLINE_APP)
|
||||
ENDIF(APPLE)
|
||||
|
||||
ADD_EXECUTABLE(${TARGET_TARGETNAME} ${PLATFORM_SPECIFIC_CONTROL} ${TARGET_SRC} ${TARGET_H})
|
||||
|
||||
|
||||
ENDIF(${IS_COMMANDLINE_APP})
|
||||
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PROJECT_LABEL "${TARGET_LABEL}")
|
||||
@@ -396,7 +398,11 @@ MACRO(SETUP_EXE IS_COMMANDLINE_APP)
|
||||
SET_OUTPUT_DIR_PROPERTY_260(${TARGET_TARGETNAME} "") # Ensure the /Debug /Release are removed
|
||||
ENDIF(MSVC_IDE AND OSG_MSVC_VERSIONED_DLL)
|
||||
|
||||
SETUP_LINK_LIBRARIES()
|
||||
IF(APPLE)
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_WARNING_CFLAGS "")
|
||||
ENDIF()
|
||||
|
||||
SETUP_LINK_LIBRARIES()
|
||||
|
||||
ENDMACRO(SETUP_EXE)
|
||||
|
||||
@@ -410,11 +416,11 @@ MACRO(SETUP_APPLICATION APPLICATION_NAME)
|
||||
ELSE(${ARGC} GREATER 1)
|
||||
SET(IS_COMMANDLINE_APP 0)
|
||||
ENDIF(${ARGC} GREATER 1)
|
||||
|
||||
|
||||
SETUP_EXE(${IS_COMMANDLINE_APP})
|
||||
|
||||
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES FOLDER "Applications")
|
||||
|
||||
|
||||
IF(APPLE)
|
||||
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION bin BUNDLE DESTINATION bin)
|
||||
ELSE(APPLE)
|
||||
@@ -439,13 +445,13 @@ MACRO(SETUP_EXAMPLE EXAMPLE_NAME)
|
||||
ELSE(${ARGC} GREATER 1)
|
||||
SET(IS_COMMANDLINE_APP 0)
|
||||
ENDIF(${ARGC} GREATER 1)
|
||||
|
||||
|
||||
SETUP_EXE(${IS_COMMANDLINE_APP})
|
||||
|
||||
|
||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES FOLDER "Examples")
|
||||
|
||||
|
||||
IF(APPLE)
|
||||
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION share/OpenSceneGraph/bin BUNDLE DESTINATION share/OpenSceneGraph/bin )
|
||||
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION share/OpenSceneGraph/bin BUNDLE DESTINATION share/OpenSceneGraph/bin )
|
||||
ELSE(APPLE)
|
||||
INSTALL(TARGETS ${TARGET_TARGETNAME} RUNTIME DESTINATION share/OpenSceneGraph/bin COMPONENT openscenegraph-examples )
|
||||
ENDIF(APPLE)
|
||||
@@ -483,7 +489,7 @@ MACRO(HANDLE_MSVC_DLL)
|
||||
ENDIF(${ARGC} GREATER 1)
|
||||
|
||||
SET_OUTPUT_DIR_PROPERTY_260(${LIB_NAME} "") # Ensure the /Debug /Release are removed
|
||||
IF(NOT MSVC_IDE)
|
||||
IF(NOT MSVC_IDE)
|
||||
IF (NOT CMAKE24)
|
||||
BUILDER_VERSION_GREATER(2 8 0)
|
||||
IF(NOT VALID_BUILDER_VERSION)
|
||||
@@ -516,8 +522,12 @@ MACRO(HANDLE_MSVC_DLL)
|
||||
ELSE (NOT CMAKE24)
|
||||
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../../bin/${LIB_PREFIX}${LIB_SOVERSION}-" IMPORT_PREFIX "../")
|
||||
ENDIF (NOT CMAKE24)
|
||||
ENDIF(NOT MSVC_IDE)
|
||||
ENDIF(NOT MSVC_IDE)
|
||||
|
||||
# SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../../bin/osg${OPENSCENEGRAPH_SOVERSION}-")
|
||||
# SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES IMPORT_PREFIX "../")
|
||||
ENDMACRO(HANDLE_MSVC_DLL)
|
||||
|
||||
MACRO(REMOVE_CXX_FLAG flag)
|
||||
STRING(REPLACE "${flag}" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
ENDMACRO()
|
||||
|
||||
78
README.txt
78
README.txt
@@ -1,18 +1,14 @@
|
||||
Welcome to the OpenSceneGraph (OSG).
|
||||
|
||||
For up-to-date information on the project, in-depth details on how to
|
||||
compile and run libraries and examples, see the documentation on the
|
||||
For up-to-date information on the project, in-depth details on how to
|
||||
compile and run libraries and examples, see the documentation on the
|
||||
OpenSceneGraph website:
|
||||
|
||||
http://www.openscenegraph.org
|
||||
|
||||
For support subscribe to our public mailing list:
|
||||
http://www.openscenegraph.org/index.php/documentation
|
||||
|
||||
http://www.openscenegraph.org/projects/osg/wiki/MailingLists
|
||||
For support subscribe to our public mailing list or forum, details at:
|
||||
|
||||
or forum:
|
||||
|
||||
http://forum.openscenegraph.org/
|
||||
http://www.openscenegraph.org/index.php/support
|
||||
|
||||
For the impatient, we've included quick build instructions below, these
|
||||
are are broken down is three parts:
|
||||
@@ -27,41 +23,41 @@ more indepth instructions.
|
||||
|
||||
Robert Osfield.
|
||||
Project Lead.
|
||||
26th April 2013.
|
||||
4th July 2014.
|
||||
|
||||
--
|
||||
|
||||
Section 1. How to build the OpenSceneGraph
|
||||
==========================================
|
||||
|
||||
The OpenSceneGraph uses the CMake build system to generate a
|
||||
platform-specific build environment. CMake reads the CMakeLists.txt
|
||||
files that you'll find throughout the OpenSceneGraph directories,
|
||||
checks for installed dependenciesand then generates the appropriate
|
||||
The OpenSceneGraph uses the CMake build system to generate a
|
||||
platform-specific build environment. CMake reads the CMakeLists.txt
|
||||
files that you'll find throughout the OpenSceneGraph directories,
|
||||
checks for installed dependenciesand then generates the appropriate
|
||||
build system.
|
||||
|
||||
If you don't already have CMake installed on your system you can grab
|
||||
it from http://www.cmake.org, use version 2.4.6 or later. Details on the
|
||||
If you don't already have CMake installed on your system you can grab
|
||||
it from http://www.cmake.org, use version 2.4.6 or later. Details on the
|
||||
OpenSceneGraph's CMake build can be found at:
|
||||
|
||||
http://www.openscenegraph.org/projects/osg/wiki/Build/CMake
|
||||
|
||||
Under unices (i.e. Linux, IRIX, Solaris, Free-BSD, HP-Ux, AIX, OSX)
|
||||
use the cmake or ccmake command-line utils, or use the included tiny
|
||||
configure script that'll run cmake for you. The configure script
|
||||
simply runs 'cmake . -DCMAKE_BUILD_TYPE=Release' to ensure that you
|
||||
Under unices (i.e. Linux, IRIX, Solaris, Free-BSD, HP-Ux, AIX, OSX)
|
||||
use the cmake or ccmake command-line utils, or use the included tiny
|
||||
configure script that'll run cmake for you. The configure script
|
||||
simply runs 'cmake . -DCMAKE_BUILD_TYPE=Release' to ensure that you
|
||||
get the best performance from your final libraries/applications.
|
||||
|
||||
|
||||
cd OpenSceneGraph
|
||||
./configure
|
||||
make
|
||||
sudo make install
|
||||
|
||||
Alternatively, you can create an out-of-source build directory and run
|
||||
cmake or ccmake from there. The advantage to this approach is that the
|
||||
temporary files created by CMake won't clutter the OpenSceneGraph
|
||||
source directory, and also makes it possible to have multiple
|
||||
independent build targets by creating multiple build directories. In a
|
||||
|
||||
Alternatively, you can create an out-of-source build directory and run
|
||||
cmake or ccmake from there. The advantage to this approach is that the
|
||||
temporary files created by CMake won't clutter the OpenSceneGraph
|
||||
source directory, and also makes it possible to have multiple
|
||||
independent build targets by creating multiple build directories. In a
|
||||
directory alongside the OpenSceneGraph use:
|
||||
|
||||
mkdir build
|
||||
@@ -70,22 +66,22 @@ directory alongside the OpenSceneGraph use:
|
||||
make
|
||||
sudo make install
|
||||
|
||||
Under Windows use the GUI tool CMakeSetup to build your VisualStudio
|
||||
files. The following page on our wiki dedicated to the CMake build
|
||||
Under Windows use the GUI tool CMakeSetup to build your VisualStudio
|
||||
files. The following page on our wiki dedicated to the CMake build
|
||||
system should help guide you through the process:
|
||||
|
||||
http://www.openscenegraph.org/projects/osg/wiki/Support/PlatformSpecifics/VisualStudio
|
||||
http://www.openscenegraph.org/index.php/documentation/platform-specifics/windows
|
||||
|
||||
Under OSX you can either use the CMake build system above, or use the
|
||||
Xcode projects that you will find in the OpenSceneGraph/Xcode
|
||||
Under OSX you can either use the CMake build system above, or use the
|
||||
Xcode projects that you will find in the OpenSceneGraph/Xcode
|
||||
directory. See release notes on OSX CMake build below.
|
||||
|
||||
For further details on compilation, installation and platform-specific
|
||||
For further details on compilation, installation and platform-specific
|
||||
information read "Getting Started" guide:
|
||||
|
||||
http://www.openscenegraph.org/projects/osg/wiki/Support/GettingStarted
|
||||
|
||||
|
||||
http://www.openscenegraph.org/index.php/documentation/10-getting-started
|
||||
|
||||
|
||||
Section 2. Release notes on OSX build, by Eric Sokolowsky, August 5, 2008
|
||||
=========================================================================
|
||||
|
||||
@@ -169,11 +165,11 @@ Section 3. Release notes on iOS build, by Thomas Hoghart
|
||||
* Check that CMAKE_OSX_ARCHITECTURE is i386 for the simulator or armv6;armv7 for the device
|
||||
* Disable DYNAMIC_OPENSCENEGRAPH, DYNAMIC_OPENTHREADS
|
||||
This will give us the static build we need for iPhone.
|
||||
* Disable OSG_GL1_AVAILABLE, OSG_GL2_AVAILABLE, OSG_GL3_AVAILABLE,
|
||||
* Disable OSG_GL1_AVAILABLE, OSG_GL2_AVAILABLE, OSG_GL3_AVAILABLE,
|
||||
OSG_GL_DISPLAYLISTS_AVAILABLE, OSG_GL_VERTEX_FUNCS_AVAILABLE
|
||||
* Enable OSG_GLES1_AVAILABLE *OR* OSG_GLES2_AVAILABLE
|
||||
* Ensure OSG_WINDOWING_SYSTEM is set to IOS
|
||||
* Change FREETYPE include and library paths to an iPhone version
|
||||
* Change FREETYPE include and library paths to an iPhone version
|
||||
(OpenFrameworks has one bundled with its distribution)
|
||||
* Ensure that CMake_OSX_SYSROOT points to your iOS SDK.
|
||||
* Generate the Xcode project
|
||||
@@ -206,9 +202,9 @@ $ cmake -G Xcode \
|
||||
|
||||
|
||||
Known issues:
|
||||
* When Linking final app against ive plugin, you need to add -lz to
|
||||
* When Linking final app against ive plugin, you need to add -lz to
|
||||
the 'Other linker flags' list.
|
||||
* Apps and exes don't get created
|
||||
* You can only select Simulator, or Device projects. In the XCode
|
||||
project you will see both types but the sdk they link will
|
||||
* You can only select Simulator, or Device projects. In the XCode
|
||||
project you will see both types but the sdk they link will
|
||||
be the same.
|
||||
|
||||
@@ -557,6 +557,7 @@ int main( int argc, char **argv )
|
||||
// if user request help write it out to cout.
|
||||
if (arguments.read("-h") || arguments.read("--help"))
|
||||
{
|
||||
osg::setNotifyLevel(osg::NOTICE);
|
||||
usage( arguments.getApplicationName().c_str(), 0 );
|
||||
//arguments.getApplicationUsage()->write(std::cout);
|
||||
return 1;
|
||||
|
||||
@@ -254,7 +254,12 @@ const char* invalidNames[] =
|
||||
"GraphicsContext*",
|
||||
"Apple",
|
||||
"GeometryNew",
|
||||
"FrameBufferObject"
|
||||
"FrameBufferObject",
|
||||
"Lua",
|
||||
"VolumeTile",
|
||||
"PushStackValueVisitor",
|
||||
"RayIntersector",
|
||||
"OpenSceneGraph-Data"
|
||||
};
|
||||
|
||||
|
||||
@@ -454,7 +459,16 @@ TypoCorrection typoCorrections[] =
|
||||
{"Eskland","Ekstrand"},
|
||||
{"Baeuerele","Baeuerle"},
|
||||
{"Bauerle","Baeuerle"},
|
||||
{"Baeurele","Baeuerle"}
|
||||
{"Baeurele","Baeuerle"},
|
||||
{"Nillson","Nilsson"},
|
||||
{"Bjorn","Bj<EFBFBD>rn"},
|
||||
{"Björn","Bj<EFBFBD>rn"},
|
||||
{"Stepan","Stephan"},
|
||||
{"Kristoger","Kristofer"},
|
||||
{"Blessing","Blissing"},
|
||||
{"Dannahuer","Dannhauer"},
|
||||
{"Chebeav", "Chebaev"},
|
||||
{"Messershmidt","Messerschmidt"}
|
||||
};
|
||||
|
||||
|
||||
@@ -594,6 +608,8 @@ NameCorrection nameCorrections[] =
|
||||
"Romano", "Jos<EFBFBD> Magacho da Silva"},
|
||||
{"Rommano", "Silva",
|
||||
"Romano", "Jos<EFBFBD> Magacho da Silva"},
|
||||
{"Romano", "Magacho",
|
||||
"Romano", "Jos<EFBFBD> Magacho da Silva"},
|
||||
{"Leandro", "Motta",
|
||||
"Leandro", "Motta Barros"},
|
||||
{"Leandro", "Motto",
|
||||
@@ -619,7 +635,9 @@ NameCorrection nameCorrections[] =
|
||||
{"Tyge", "",
|
||||
"Tyge", "L<EFBFBD>vset"},
|
||||
{"Ricard", "Schmidt",
|
||||
"Richard", "Schmidt"}
|
||||
"Richard", "Schmidt"},
|
||||
{"Matthias", "Helsing",
|
||||
"Mattias", "Helsing"}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <osgGA/Device>
|
||||
|
||||
#include <iostream>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <osg/GLExtensions>
|
||||
|
||||
@@ -90,7 +91,7 @@ public:
|
||||
if (!_extensionInitialized) setUpExtensions();
|
||||
|
||||
if (_glClientWaitSync)
|
||||
{
|
||||
{
|
||||
if (_previousSync)
|
||||
{
|
||||
unsigned int num_seconds = 1;
|
||||
@@ -126,7 +127,7 @@ public:
|
||||
typedef void (GL_APIENTRY * PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
|
||||
|
||||
bool _extensionInitialized;
|
||||
|
||||
|
||||
PFNGLFENCESYNCPROC _glFenceSync;
|
||||
PFNGLISSYNCPROC _glIsSync;
|
||||
PFNGLDELETESYNCPROC _glDeleteSync;
|
||||
@@ -187,7 +188,7 @@ int main(int argc, char** argv)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
std::string device;
|
||||
while(arguments.read("--device", device))
|
||||
{
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
|
||||
/* -*-c++-*- Present3D - Copyright (C) 1999-2006 Robert Osfield
|
||||
*
|
||||
* This software is open source and may be redistributed and/or modified under
|
||||
* This software is open source and may be redistributed and/or modified under
|
||||
* the terms of the GNU General Public License (GPL) version 2.0.
|
||||
* The full license is in LICENSE.txt file included with this distribution,.
|
||||
*
|
||||
*
|
||||
* This software is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* include LICENSE.txt for more details.
|
||||
*/
|
||||
|
||||
@@ -135,14 +135,14 @@ void setViewer(osgViewer::Viewer& viewer, float width, float height, float dista
|
||||
class ForwardToDeviceEventHandler : public osgGA::GUIEventHandler {
|
||||
public:
|
||||
ForwardToDeviceEventHandler(osgGA::Device* device) : osgGA::GUIEventHandler(), _device(device) {}
|
||||
|
||||
|
||||
virtual bool handle (const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa, osg::Object *, osg::NodeVisitor *)
|
||||
{
|
||||
OSG_INFO<<"ForwardToDeviceEventHandler::setEvent("<<ea.getKey()<<")"<<std::endl;
|
||||
_device->sendEvent(ea);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
osg::ref_ptr<osgGA::Device> _device;
|
||||
};
|
||||
@@ -161,7 +161,7 @@ class FollowMouseCallback: public osgGA::GUIEventHandler
|
||||
if (!transform) return false;
|
||||
|
||||
osg::NotifySeverity level = osg::INFO;
|
||||
|
||||
|
||||
switch(ea.getEventType())
|
||||
{
|
||||
case(osgGA::GUIEventAdapter::PUSH):
|
||||
@@ -284,7 +284,7 @@ enum P3DApplicationType
|
||||
void processLoadedModel(osg::ref_ptr<osg::Node>& loadedModel, int optimizer_options, const std::string& cursorFileName)
|
||||
{
|
||||
if (!loadedModel) return;
|
||||
|
||||
|
||||
#if !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GL3_AVAILABLE)
|
||||
|
||||
// add back in enabling of the GL_ALPHA_TEST to get around the core OSG no longer setting it by default for opaque bins.
|
||||
@@ -312,7 +312,7 @@ void addDeviceTo(osgViewer::Viewer& viewer, const std::string& device_name)
|
||||
{
|
||||
OSG_INFO << "Adding Device : " << device_name << std::endl;
|
||||
viewer.addDevice(dev.get());
|
||||
|
||||
|
||||
if (dev->getCapabilities() & osgGA::Device::SEND_EVENTS)
|
||||
viewer.getEventHandlers().push_front(new ForwardToDeviceEventHandler(dev.get()));
|
||||
}
|
||||
@@ -327,7 +327,7 @@ int main( int argc, char **argv )
|
||||
{
|
||||
// use an ArgumentParser object to manage the program arguments.
|
||||
osg::ArgumentParser arguments(&argc,argv);
|
||||
|
||||
|
||||
// set up the usage document, in case we need to print out how to use this program.
|
||||
arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName());
|
||||
arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is the application for presenting 3D interactive slide shows.");
|
||||
@@ -386,10 +386,10 @@ int main( int argc, char **argv )
|
||||
|
||||
#ifdef USE_SDL
|
||||
SDLIntegration sdlIntegration;
|
||||
|
||||
|
||||
osg::notify(osg::INFO)<<"USE_SDL"<<std::endl;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
bool doSetViewer = true;
|
||||
std::string configurationFile;
|
||||
|
||||
@@ -402,7 +402,7 @@ int main( int argc, char **argv )
|
||||
while (arguments.read("-c",configurationFile)) {}
|
||||
|
||||
osg::Vec4 clearColor(0.0f,0.0f,0.0f,0.0f);
|
||||
|
||||
|
||||
while (arguments.read("--clear-color",clearColor[0],clearColor[1],clearColor[2],clearColor[3])) {}
|
||||
|
||||
std::string filename;
|
||||
@@ -441,7 +441,7 @@ int main( int argc, char **argv )
|
||||
|
||||
// construct the viewer.
|
||||
osgViewer::Viewer viewer(arguments);
|
||||
|
||||
|
||||
// set clear colour to black by default.
|
||||
viewer.getCamera()->setClearColor(clearColor);
|
||||
|
||||
@@ -467,12 +467,12 @@ int main( int argc, char **argv )
|
||||
while (arguments.read("--device", device))
|
||||
{
|
||||
addDeviceTo(viewer, device);
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (arguments.read("--http-control"))
|
||||
{
|
||||
|
||||
|
||||
std::string server_address = "localhost";
|
||||
std::string server_port = "8080";
|
||||
std::string document_root = "htdocs";
|
||||
@@ -489,11 +489,21 @@ int main( int argc, char **argv )
|
||||
viewer.addDevice(rest_http_device.get());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// set up stereo masks
|
||||
viewer.getCamera()->setCullMask(0xffffffff);
|
||||
|
||||
viewer.getCamera()->setCullMaskLeft(0x00000001);
|
||||
viewer.getCamera()->setCullMaskRight(0x00000002);
|
||||
viewer.getCamera()->setCullMaskRight(0x00000002);
|
||||
|
||||
bool assignLeftCullMaskForMono = true;
|
||||
if (assignLeftCullMaskForMono)
|
||||
{
|
||||
viewer.getCamera()->setCullMask(viewer.getCamera()->getCullMaskLeft());
|
||||
}
|
||||
else
|
||||
{
|
||||
viewer.getCamera()->setCullMask(0xffffffff);
|
||||
}
|
||||
|
||||
// set up the camera manipulators.
|
||||
{
|
||||
@@ -509,7 +519,7 @@ int main( int argc, char **argv )
|
||||
while (arguments.read("-p",pathfile))
|
||||
{
|
||||
osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile);
|
||||
if (apm || !apm->valid())
|
||||
if (apm || !apm->valid())
|
||||
{
|
||||
unsigned int num = keyswitchManipulator->getNumMatrixManipulators();
|
||||
keyswitchManipulator->addMatrixManipulator( keyForAnimationPath, "Path", apm );
|
||||
@@ -547,12 +557,12 @@ int main( int argc, char **argv )
|
||||
bool hideCursor = (showCursor=="No" || showCursor=="NO" || showCursor=="no");
|
||||
|
||||
while (arguments.read("--set-viewer")) { doSetViewer = true; }
|
||||
|
||||
|
||||
while (arguments.read("--no-set-viewer")) { doSetViewer = false; }
|
||||
|
||||
// if we want to hide the cursor override the custom cursor.
|
||||
if (hideCursor) cursorFileName.clear();
|
||||
|
||||
|
||||
|
||||
// cluster related entries.
|
||||
int socketNumber=8100;
|
||||
@@ -599,7 +609,7 @@ int main( int argc, char **argv )
|
||||
viewer.getUpdateVisitor()->setTraversalMode(updateTraversalMode);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// register the slide event handler - which moves the presentation from slide to slide, layer to layer.
|
||||
osg::ref_ptr<osgPresentation::SlideEventHandler> seh = new osgPresentation::SlideEventHandler(&viewer);
|
||||
viewer.addEventHandler(seh.get());
|
||||
@@ -620,7 +630,7 @@ int main( int argc, char **argv )
|
||||
// set up optimizer options
|
||||
unsigned int optimizer_options = osgUtil::Optimizer::DEFAULT_OPTIMIZATIONS;
|
||||
bool relase_and_compile = false;
|
||||
while (arguments.read("--release-and-compile"))
|
||||
while (arguments.read("--release-and-compile"))
|
||||
{
|
||||
relase_and_compile = true;
|
||||
}
|
||||
@@ -631,7 +641,7 @@ int main( int argc, char **argv )
|
||||
viewer.getDatabasePager()->setUnrefImageDataAfterApplyPolicy(true,false);
|
||||
optimizer_options &= ~osgUtil::Optimizer::OPTIMIZE_TEXTURE_SETTINGS;
|
||||
}
|
||||
//
|
||||
//
|
||||
// osgDB::Registry::instance()->getOrCreateDatabasePager()->setUnrefImageDataAfterApplyPolicy(true,false);
|
||||
// optimizer_options &= ~osgUtil::Optimizer::OPTIMIZE_TEXTURE_SETTINGS;
|
||||
// osg::Texture::getTextureObjectManager()->setExpiryDelay(0.0f);
|
||||
@@ -657,7 +667,7 @@ int main( int argc, char **argv )
|
||||
float width = osg::DisplaySettings::instance()->getScreenWidth();
|
||||
float height = osg::DisplaySettings::instance()->getScreenHeight();
|
||||
float distance = osg::DisplaySettings::instance()->getScreenDistance();
|
||||
while (arguments.read("-s", width, height, distance))
|
||||
while (arguments.read("-s", width, height, distance))
|
||||
{
|
||||
osg::DisplaySettings::instance()->setScreenDistance(distance);
|
||||
osg::DisplaySettings::instance()->setScreenHeight(height);
|
||||
@@ -687,11 +697,11 @@ int main( int argc, char **argv )
|
||||
else if (strcmp(str,"master")==0) P3DApplicationType = MASTER;
|
||||
else if (strcmp(str,"slave")==0) P3DApplicationType = SLAVE;
|
||||
}
|
||||
|
||||
|
||||
while (arguments.read("--viewer")) { P3DApplicationType = VIEWER; }
|
||||
while (arguments.read("--master")) { P3DApplicationType = MASTER; }
|
||||
while (arguments.read("--slave")) { P3DApplicationType = SLAVE; }
|
||||
|
||||
|
||||
while (arguments.read("--version"))
|
||||
{
|
||||
std::string appTypeName = "invalid";
|
||||
@@ -780,7 +790,7 @@ int main( int argc, char **argv )
|
||||
|
||||
|
||||
// if no model has been successfully loaded report failure.
|
||||
if (!loadedModel)
|
||||
if (!loadedModel)
|
||||
{
|
||||
osg::notify(osg::INFO) << arguments.getApplicationName() <<": No data loaded" << std::endl;
|
||||
return 1;
|
||||
@@ -796,12 +806,12 @@ int main( int argc, char **argv )
|
||||
for(unsigned int i=0; i<loadedModel->getNumDescriptions(); ++i)
|
||||
{
|
||||
const std::string& desc = loadedModel->getDescription(i);
|
||||
if (desc=="loop")
|
||||
if (desc=="loop")
|
||||
{
|
||||
osg::notify(osg::NOTICE)<<"Enabling looping"<<std::endl;
|
||||
seh->setLoopPresentation(true);
|
||||
}
|
||||
else if (desc=="auto")
|
||||
else if (desc=="auto")
|
||||
{
|
||||
osg::notify(osg::NOTICE)<<"Enabling auto run"<<std::endl;
|
||||
seh->setAutoSteppingActive(true);
|
||||
@@ -830,7 +840,7 @@ int main( int argc, char **argv )
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// pass the model to the slide event handler so it knows which to manipulate.
|
||||
seh->set(loadedModel.get());
|
||||
@@ -843,7 +853,7 @@ int main( int argc, char **argv )
|
||||
osgDB::writeNodeFile(*loadedModel,outputFileName);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (!cursorFileName.empty() || hideCursor)
|
||||
{
|
||||
@@ -865,7 +875,7 @@ int main( int argc, char **argv )
|
||||
|
||||
osg::Timer_t startOfFrameTick = osg::Timer::instance()->tick();
|
||||
double targetFrameTime = 1.0/targetFrameRate;
|
||||
|
||||
|
||||
if (exportName.empty())
|
||||
{
|
||||
// objects for managing the broadcasting and recieving of camera packets.
|
||||
@@ -894,7 +904,7 @@ int main( int argc, char **argv )
|
||||
|
||||
startOfFrameTick = osg::Timer::instance()->tick();
|
||||
|
||||
#if 0
|
||||
#if 0
|
||||
if (kmcb)
|
||||
{
|
||||
double time = kmcb->getTime();
|
||||
@@ -910,9 +920,9 @@ int main( int argc, char **argv )
|
||||
{
|
||||
// take camera zero as the guide.
|
||||
osg::Matrix modelview(viewer.getCamera()->getViewMatrix());
|
||||
|
||||
|
||||
cp.setPacket(modelview,viewer.getFrameStamp());
|
||||
|
||||
|
||||
// cp.readEventQueue(viewer);
|
||||
|
||||
scratchPad.reset();
|
||||
@@ -922,7 +932,7 @@ int main( int argc, char **argv )
|
||||
scratchPad.read(cp);
|
||||
|
||||
bc.setBuffer(scratchPad.startPtr(), scratchPad.numBytes());
|
||||
|
||||
|
||||
std::cout << "bc.sync()"<<scratchPad.numBytes()<<std::endl;
|
||||
|
||||
bc.sync();
|
||||
@@ -932,13 +942,13 @@ int main( int argc, char **argv )
|
||||
rc.setBuffer(scratchPad.startPtr(), scratchPad.numBytes());
|
||||
|
||||
rc.sync();
|
||||
|
||||
|
||||
scratchPad.reset();
|
||||
scratchPad.read(cp);
|
||||
|
||||
|
||||
// cp.writeEventQueue(viewer);
|
||||
|
||||
if (cp.getMasterKilled())
|
||||
if (cp.getMasterKilled())
|
||||
{
|
||||
std::cout << "Received master killed."<<std::endl;
|
||||
// break out of while (!done) loop since we've now want to shut down.
|
||||
@@ -972,7 +982,7 @@ int main( int argc, char **argv )
|
||||
seh->selectSlide(previous_ActiveSlide, previous_ActiveLayer);
|
||||
|
||||
continue;
|
||||
|
||||
|
||||
}
|
||||
|
||||
// update the scene by traversing it with the the update visitor which will
|
||||
@@ -996,7 +1006,7 @@ int main( int argc, char **argv )
|
||||
{
|
||||
ExportHTML::write(seh.get(), viewer, exportName);
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
static const char* computeSrc = {
|
||||
"#version 430\n"
|
||||
"uniform float osg_FrameTime;\n"
|
||||
"uniform image2D targetTex;\n"
|
||||
"layout (r32f, binding =0) uniform image2D targetTex;\n"
|
||||
"layout (local_size_x = 16, local_size_y = 16) in;\n"
|
||||
"void main() {\n"
|
||||
" ivec2 storePos = ivec2(gl_GlobalInvocationID.xy);\n"
|
||||
|
||||
@@ -99,12 +99,14 @@ Node *makeTerrain( void )
|
||||
|
||||
for( i = 0; i < m * n; i++ )
|
||||
{
|
||||
v[i][0] = vertex[i][0] - dbcenter[0];
|
||||
v[i][1] = vertex[i][1] - dbcenter[1];
|
||||
v[i][2] = vertex[i][2];
|
||||
float* vc = vertex[i];
|
||||
v[i][0] = vc[0] - dbcenter[0];
|
||||
v[i][1] = vc[1] - dbcenter[1];
|
||||
v[i][2] = vc[2];
|
||||
|
||||
t[i][0] = texcoord[i][0] + 0.025;
|
||||
t[i][1] = texcoord[i][1];
|
||||
float* tc = texcoord[i];
|
||||
t[i][0] = tc[0];
|
||||
t[i][1] = tc[1];
|
||||
}
|
||||
|
||||
Geometry *geom = new Geometry;
|
||||
|
||||
@@ -1,14 +1,3 @@
|
||||
# INCLUDE_DIRECTORIES( ${OPENAL_INCLUDE_DIR} )
|
||||
# SET(TARGET_EXTERNAL_LIBRARIES ${OPENAL_LIBRARY} alut)
|
||||
|
||||
IF (SDL_FOUND)
|
||||
SET(TARGET_EXTERNAL_LIBRARIES ${SDL_LIBRARY} )
|
||||
INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR} )
|
||||
ADD_DEFINITIONS(-DUSE_SDL)
|
||||
IF (MINGW)
|
||||
SET(TARGET_EXTERNAL_LIBRARIES ${TARGET_EXTERNAL_LIBRARIES} winmm dinput ddraw dxguid)
|
||||
ENDIF()
|
||||
ENDIF(SDL_FOUND)
|
||||
|
||||
SET(TARGET_SRC osgmultiplemovies.cpp )
|
||||
SET(TARGET_ADDED_LIBRARIES osgGA )
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
FILE(GLOB ui_files_1 "English.lproj/*.strings")
|
||||
FILE(GLOB ui_files_2 "English.lproj/MainMenu.nib/*.nib")
|
||||
SET(TARGET_SRC ViewerCocoa.mm main.m Info.plist ${ui_files_1} ${ui_files_2})
|
||||
SET(TARGET_SRC ViewerCocoa.mm main.mm Info.plist ${ui_files_1} ${ui_files_2})
|
||||
|
||||
SET(TARGET_EXTERNAL_LIBRARIES osg ${COCOA_LIBRARY})
|
||||
SET_SOURCE_FILES_PROPERTIES(Info.plist PROPERTIES MACOSX_PACKAGE_LOCATION .)
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
//
|
||||
// main.m
|
||||
// main.mm
|
||||
// osgsimpleviewerCocoa
|
||||
//
|
||||
// Created by Eric Wing on 11/13/06.
|
||||
@@ -1,17 +1,19 @@
|
||||
SET(TARGET_SRC
|
||||
iphoneViewerAppDelegate.h
|
||||
SET(TARGET_SRC
|
||||
iphoneViewerAppDelegate.h
|
||||
iphoneViewerAppDelegate.mm
|
||||
main.m
|
||||
osgPlugins.h
|
||||
osgIPhoneViewer-Info.plist
|
||||
)
|
||||
|
||||
SET(TARGET_ADDED_LIBRARIES osgdb_osg osgdb_freetype osgdb_imageio)
|
||||
SET(TARGET_ADDED_LIBRARIES osgdb_osg osgdb_imageio osgdb_avfoundation)
|
||||
|
||||
#backup setting
|
||||
SET(TMP_OSG_BUILD_APPLICATION_BUNDLES {$OSG_BUILD_APPLICATION_BUNDLES})
|
||||
SET(OSG_BUILD_APPLICATION_BUNDLES TRUE)
|
||||
SETUP_EXAMPLE(osgViewerIPhone)
|
||||
SET_TARGET_PROPERTIES(example_osgViewerIPhone PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer")
|
||||
|
||||
#restore setting
|
||||
SET(OSG_BUILD_APPLICATION_BUNDLES {$TMP_OSG_BUILD_APPLICATION_BUNDLES})
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "-framework QuartzCore -framework Foundation -framework OpenGLES -framework UIKit")
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "-framework QuartzCore -framework Foundation -framework OpenGLES -framework UIKit -framework ImageIO -framework CoreImage -framework MobileCoreServices -framework CoreGraphics")
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
#include <osgDB/ReadFile>
|
||||
#include <osg/MatrixTransform>
|
||||
#include <osg/CameraNode>
|
||||
#include <osgText/Text>
|
||||
#include <osgViewer/Viewer>
|
||||
|
||||
@@ -17,7 +16,7 @@
|
||||
|
||||
UIWindow* _window; //main application window
|
||||
|
||||
UIAccelerationValue accel[3];
|
||||
CADisplayLink* _displayLink;
|
||||
|
||||
osg::ref_ptr<osgViewer::Viewer> _viewer;
|
||||
osg::ref_ptr<osg::MatrixTransform> _root;
|
||||
|
||||
@@ -1,39 +1,243 @@
|
||||
//Created by Thomas Hogarth 2009
|
||||
// Created by Thomas Hogarth 2009
|
||||
// cleaned up by Stephan Huber 2013
|
||||
//
|
||||
|
||||
//
|
||||
//This exampe shows how to render osg into an existing windw. Apple recommends apps only have one window on IPhone so this
|
||||
// will be your best bet.
|
||||
//
|
||||
// this example will create a fullscreen window showing a grey box. You can interact with it via
|
||||
// multi-touch gestures.
|
||||
|
||||
#import "iphoneViewerAppDelegate.h"
|
||||
#include <osgGA/TrackballManipulator>
|
||||
#include <osgGA/MultiTouchTrackballManipulator>
|
||||
#include <osg/ShapeDrawable>
|
||||
//inckude the iphone specific windowing stuff
|
||||
|
||||
//include the iphone specific windowing stuff
|
||||
#include <osgViewer/api/IOS/GraphicsWindowIOS>
|
||||
|
||||
|
||||
#define kAccelerometerFrequency 30.0 // Hz
|
||||
#define kFilteringFactor 0.1
|
||||
|
||||
@implementation iphoneViewerAppDelegate
|
||||
|
||||
@synthesize _window;
|
||||
|
||||
|
||||
osg::Camera* createHUD(unsigned int w, unsigned int h)
|
||||
{
|
||||
// create a camera to set up the projection and model view matrices, and the subgraph to draw in the HUD
|
||||
osg::Camera* camera = new osg::Camera;
|
||||
|
||||
// set the projection matrix
|
||||
camera->setProjectionMatrix(osg::Matrix::ortho2D(0,w,0,h));
|
||||
|
||||
// set the view matrix
|
||||
camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
|
||||
camera->setViewMatrix(osg::Matrix::identity());
|
||||
|
||||
// only clear the depth buffer
|
||||
camera->setClearMask(GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
// draw subgraph after main camera view.
|
||||
camera->setRenderOrder(osg::Camera::POST_RENDER);
|
||||
|
||||
// we don't want the camera to grab event focus from the viewers main camera(s).
|
||||
camera->setAllowEventFocus(false);
|
||||
|
||||
|
||||
|
||||
// add to this camera a subgraph to render
|
||||
{
|
||||
|
||||
osg::Geode* geode = new osg::Geode();
|
||||
|
||||
std::string timesFont("fonts/arial.ttf");
|
||||
|
||||
// turn lighting off for the text and disable depth test to ensure it's always ontop.
|
||||
osg::StateSet* stateset = geode->getOrCreateStateSet();
|
||||
stateset->setMode(GL_LIGHTING,osg::StateAttribute::OFF);
|
||||
|
||||
osg::Vec3 position(50.0f,h-50,0.0f);
|
||||
|
||||
{
|
||||
osgText::Text* text = new osgText::Text;
|
||||
geode->addDrawable( text );
|
||||
|
||||
text->setFont(timesFont);
|
||||
text->setPosition(position);
|
||||
text->setText("A simple multi-touch-example\n1 touch = rotate, \n2 touches = drag + scale, \n3 touches = home");
|
||||
}
|
||||
|
||||
camera->addChild(geode);
|
||||
}
|
||||
|
||||
return camera;
|
||||
}
|
||||
|
||||
|
||||
class TestMultiTouchEventHandler : public osgGA::GUIEventHandler {
|
||||
public:
|
||||
TestMultiTouchEventHandler(osg::Group* parent_group)
|
||||
: osgGA::GUIEventHandler(),
|
||||
_cleanupOnNextFrame(false)
|
||||
{
|
||||
createTouchRepresentations(parent_group, 10);
|
||||
}
|
||||
|
||||
private:
|
||||
void createTouchRepresentations(osg::Group* parent_group, unsigned int num_objects)
|
||||
{
|
||||
// create some geometry which is shown for every touch-point
|
||||
for(unsigned int i = 0; i != num_objects; ++i)
|
||||
{
|
||||
std::ostringstream ss;
|
||||
|
||||
osg::Geode* geode = new osg::Geode();
|
||||
|
||||
osg::ShapeDrawable* drawable = new osg::ShapeDrawable(new osg::Box(osg::Vec3(0,0,0), 100));
|
||||
drawable->setColor(osg::Vec4(0.5, 0.5, 0.5,1));
|
||||
geode->addDrawable(drawable);
|
||||
|
||||
ss << "Touch " << i;
|
||||
|
||||
osgText::Text* text = new osgText::Text;
|
||||
geode->addDrawable( text );
|
||||
drawable->setDataVariance(osg::Object::DYNAMIC);
|
||||
_drawables.push_back(drawable);
|
||||
|
||||
|
||||
text->setFont("fonts/arial.ttf");
|
||||
text->setPosition(osg::Vec3(110,0,0));
|
||||
text->setText(ss.str());
|
||||
_texts.push_back(text);
|
||||
text->setDataVariance(osg::Object::DYNAMIC);
|
||||
|
||||
|
||||
|
||||
osg::MatrixTransform* mat = new osg::MatrixTransform();
|
||||
mat->addChild(geode);
|
||||
mat->setNodeMask(0x0);
|
||||
|
||||
_mats.push_back(mat);
|
||||
|
||||
parent_group->addChild(mat);
|
||||
}
|
||||
|
||||
parent_group->getOrCreateStateSet()->setMode(GL_LIGHTING, osg::StateAttribute::OFF);
|
||||
}
|
||||
|
||||
virtual bool handle (const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa, osg::Object *, osg::NodeVisitor *)
|
||||
{
|
||||
switch(ea.getEventType())
|
||||
{
|
||||
case osgGA::GUIEventAdapter::FRAME:
|
||||
if (_cleanupOnNextFrame) {
|
||||
cleanup(0);
|
||||
_cleanupOnNextFrame = false;
|
||||
}
|
||||
break;
|
||||
|
||||
case osgGA::GUIEventAdapter::PUSH:
|
||||
case osgGA::GUIEventAdapter::DRAG:
|
||||
case osgGA::GUIEventAdapter::RELEASE:
|
||||
{
|
||||
// is this a multi-touch event?
|
||||
if (!ea.isMultiTouchEvent())
|
||||
return false;
|
||||
|
||||
unsigned int j(0);
|
||||
|
||||
// iterate over all touch-points and update the geometry
|
||||
unsigned num_touch_ended(0);
|
||||
|
||||
for(osgGA::GUIEventAdapter::TouchData::iterator i = ea.getTouchData()->begin(); i != ea.getTouchData()->end(); ++i, ++j)
|
||||
{
|
||||
const osgGA::GUIEventAdapter::TouchData::TouchPoint& tp = (*i);
|
||||
_mats[j]->setMatrix(osg::Matrix::translate(tp.x, ea.getWindowHeight() - tp.y, 0));
|
||||
_mats[j]->setNodeMask(0xffff);
|
||||
|
||||
std::ostringstream ss;
|
||||
ss << "Touch " << tp.id;
|
||||
_texts[j]->setText(ss.str());
|
||||
|
||||
switch (tp.phase)
|
||||
{
|
||||
case osgGA::GUIEventAdapter::TOUCH_BEGAN:
|
||||
_drawables[j]->setColor(osg::Vec4(0,1,0,1));
|
||||
std::cout << "touch began: " << ss.str() << std::endl;
|
||||
break;
|
||||
|
||||
case osgGA::GUIEventAdapter::TOUCH_MOVED:
|
||||
//std::cout << "touch moved: " << ss.str() << std::endl;
|
||||
_drawables[j]->setColor(osg::Vec4(1,1,1,1));
|
||||
break;
|
||||
|
||||
case osgGA::GUIEventAdapter::TOUCH_ENDED:
|
||||
_drawables[j]->setColor(osg::Vec4(1,0,0,1));
|
||||
std::cout << "touch ended: " << ss.str() << std::endl;
|
||||
++num_touch_ended;
|
||||
break;
|
||||
|
||||
case osgGA::GUIEventAdapter::TOUCH_STATIONERY:
|
||||
_drawables[j]->setColor(osg::Vec4(0.8,0.8,0.8,1));
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// hide unused geometry
|
||||
cleanup(j);
|
||||
|
||||
//check if all touches ended
|
||||
if ((ea.getTouchData()->getNumTouchPoints() > 0) && (ea.getTouchData()->getNumTouchPoints() == num_touch_ended))
|
||||
{
|
||||
_cleanupOnNextFrame = true;
|
||||
}
|
||||
|
||||
// reposition mouse-pointer
|
||||
aa.requestWarpPointer((ea.getWindowX() + ea.getWindowWidth()) / 2.0, (ea.getWindowY() + ea.getWindowHeight()) / 2.0);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void cleanup(unsigned int j)
|
||||
{
|
||||
for(unsigned k = j; k < _mats.size(); ++k) {
|
||||
_mats[k]->setNodeMask(0x0);
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<osg::ShapeDrawable*> _drawables;
|
||||
std::vector<osg::MatrixTransform*> _mats;
|
||||
std::vector<osgText::Text*> _texts;
|
||||
bool _cleanupOnNextFrame;
|
||||
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
//Called once app has finished launching, create the viewer then realize. Can't call viewer->run as will
|
||||
//Called once app has finished launching, create the viewer then realize. Can't call viewer->run as will
|
||||
//block the final inialization of the windowing system
|
||||
//
|
||||
- (void)applicationDidFinishLaunching:(UIApplication *)application {
|
||||
|
||||
std::string test_string;
|
||||
test_string = "huhu";
|
||||
|
||||
//get the screen size
|
||||
CGRect lFrame = [[UIScreen mainScreen] bounds];
|
||||
unsigned int w = lFrame.size.width;
|
||||
unsigned int h = lFrame.size.height;
|
||||
|
||||
//create the viewer
|
||||
_viewer = new osgViewer::Viewer();
|
||||
|
||||
|
||||
/*
|
||||
|
||||
// If you want full control over the graphics context / window creation, please uncomment this section
|
||||
|
||||
// create the main window at screen size
|
||||
self._window = [[UIWindow alloc] initWithFrame: lFrame];
|
||||
|
||||
@@ -41,7 +245,7 @@
|
||||
[_window makeKeyAndVisible];
|
||||
|
||||
|
||||
//create our graphics context directly so we can pass our own window
|
||||
//create our graphics context directly so we can pass our own window
|
||||
osg::ref_ptr<osg::GraphicsContext::Traits> traits = new osg::GraphicsContext::Traits;
|
||||
|
||||
// Init the Windata Variable that holds the handle for the Window to display OSG in.
|
||||
@@ -53,97 +257,65 @@
|
||||
traits->width = w;
|
||||
traits->height = h;
|
||||
traits->depth = 16; //keep memory down, default is currently 24
|
||||
//traits->alpha = 8;
|
||||
//traits->stencil = 8;
|
||||
traits->windowDecoration = false;
|
||||
traits->doubleBuffer = true;
|
||||
traits->sharedContext = 0;
|
||||
traits->setInheritedWindowPixelFormat = true;
|
||||
//traits->windowName = "osgViewer";
|
||||
|
||||
traits->samples = 4;
|
||||
traits->sampleBuffers = 1;
|
||||
|
||||
traits->inheritedWindowData = windata;
|
||||
|
||||
// Create the Graphics Context
|
||||
osg::ref_ptr<osg::GraphicsContext> graphicsContext = osg::GraphicsContext::createGraphicsContext(traits.get());
|
||||
|
||||
//create the viewer
|
||||
_viewer = new osgViewer::Viewer();
|
||||
//if the context was created then attach to our viewer
|
||||
|
||||
// if the context was created then attach to our viewer
|
||||
if(graphicsContext)
|
||||
{
|
||||
_viewer->getCamera()->setGraphicsContext(graphicsContext);
|
||||
_viewer->getCamera()->setViewport(new osg::Viewport(0, 0, traits->width, traits->height));
|
||||
}
|
||||
*/
|
||||
|
||||
//create scene and attch to viewer
|
||||
|
||||
//create root
|
||||
_root = new osg::MatrixTransform();
|
||||
|
||||
//load and attach scene model
|
||||
osg::ref_ptr<osg::Node> model = (osgDB::readNodeFile("hog.osg"));
|
||||
_root->addChild(model);
|
||||
if (model) {
|
||||
_root->addChild(model);
|
||||
}
|
||||
else {
|
||||
osg::Geode* geode = new osg::Geode();
|
||||
osg::ShapeDrawable* drawable = new osg::ShapeDrawable(new osg::Box(osg::Vec3(1,1,1), 1));
|
||||
geode->addDrawable(drawable);
|
||||
_root->addChild(geode);
|
||||
}
|
||||
|
||||
osg::Geode* geode = new osg::Geode();
|
||||
osg::ShapeDrawable* drawable = new osg::ShapeDrawable(new osg::Box(osg::Vec3(1,1,1), 1));
|
||||
geode->addDrawable(drawable);
|
||||
_root->addChild(geode);
|
||||
|
||||
osg::Camera* hud_camera = createHUD(w,h);
|
||||
_root->addChild(hud_camera);
|
||||
|
||||
//create and attach ortho camera for hud text
|
||||
osg::ref_ptr<osg::CameraNode> _hudCamera = new osg::CameraNode;
|
||||
|
||||
// set the projection matrix
|
||||
_hudCamera->setProjectionMatrix(osg::Matrix::ortho2D(0,w,0,h));
|
||||
|
||||
// set the view matrix
|
||||
_hudCamera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
|
||||
_hudCamera->setViewMatrix(osg::Matrix::identity());
|
||||
|
||||
// only clear the depth buffer
|
||||
_hudCamera->setClearMask(GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
// draw subgraph after main camera view.
|
||||
_hudCamera->setRenderOrder(osg::CameraNode::POST_RENDER);
|
||||
_root->addChild(_hudCamera.get());
|
||||
|
||||
//attcg text to hud
|
||||
/*osg::ref_ptr<osgText::Text> text = new osgText::Text;
|
||||
osg::ref_ptr<osg::Geode> textGeode = new osg::Geode();
|
||||
osg::StateSet* stateset = textGeode->getOrCreateStateSet();
|
||||
stateset->setMode(GL_LIGHTING,osg::StateAttribute::OFF);
|
||||
|
||||
textGeode->addDrawable( text );
|
||||
_hudCamera->addChild(textGeode.get());
|
||||
std::string timesFont("arial.ttf");
|
||||
osg::Vec3 position = osg::Vec3(w/2.0f, h/2.0f, 0.0f);
|
||||
osg::Vec3 delta(0.0f,-120.0f,0.0f);
|
||||
|
||||
|
||||
text->setFont(timesFont);
|
||||
text->setCharacterSize(20.0,1.0);
|
||||
text->setColor(osg::Vec4(0.8,0.8,0.8,1.0));
|
||||
text->setPosition(position);
|
||||
text->setMaximumHeight(480);
|
||||
text->setMaximumWidth(320);
|
||||
text->setAlignment(osgText::Text::CENTER_CENTER );
|
||||
text->setText("It's a Hogs life...");*/
|
||||
|
||||
|
||||
_viewer->setSceneData(_root.get());
|
||||
_viewer->setCameraManipulator(new osgGA::TrackballManipulator);
|
||||
_viewer->setThreadingModel(osgViewer::Viewer::SingleThreaded);//SingleThreaded DrawThreadPerContext
|
||||
_viewer->setCameraManipulator(new osgGA::MultiTouchTrackballManipulator());
|
||||
|
||||
//
|
||||
//_viewer->realize();
|
||||
_viewer->addEventHandler(new TestMultiTouchEventHandler(hud_camera));
|
||||
|
||||
|
||||
osg::setNotifyLevel(osg::DEBUG_FP);
|
||||
// sun single-threaded
|
||||
_viewer->setThreadingModel(osgViewer::Viewer::SingleThreaded);
|
||||
|
||||
[NSTimer scheduledTimerWithTimeInterval:1.0/30.0 target:self selector:@selector(updateScene) userInfo:nil repeats:YES];
|
||||
_viewer->realize();
|
||||
|
||||
// render a frame so the window-manager shows some content and not only an empty + black window
|
||||
_viewer->frame();
|
||||
|
||||
|
||||
// create a display link, which will update our scene on every screen-refresh
|
||||
_displayLink = [application.keyWindow.screen displayLinkWithTarget:self selector:@selector(updateScene)];
|
||||
[_displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
|
||||
|
||||
//Configure and start accelerometer
|
||||
[[UIAccelerometer sharedAccelerometer] setUpdateInterval:(1.0 / kAccelerometerFrequency)];
|
||||
[[UIAccelerometer sharedAccelerometer] setDelegate:self];
|
||||
}
|
||||
|
||||
|
||||
@@ -165,21 +337,15 @@
|
||||
}
|
||||
|
||||
|
||||
-(void)applicationWillTerminate:(UIApplication *)application{
|
||||
-(void)applicationWillTerminate:(UIApplication *)application {
|
||||
if (_displayLink)
|
||||
[_displayLink invalidate];
|
||||
_displayLink = NULL;
|
||||
_root = NULL;
|
||||
_viewer = NULL;
|
||||
}
|
||||
|
||||
//
|
||||
//Accelorometer
|
||||
//
|
||||
- (void)accelerometer:(UIAccelerometer*)accelerometer didAccelerate:(UIAcceleration*)acceleration
|
||||
{
|
||||
//Use a basic low-pass filter to only keep the gravity in the accelerometer values
|
||||
accel[0] = acceleration.x * kFilteringFactor + accel[0] * (1.0 - kFilteringFactor);
|
||||
accel[1] = acceleration.y * kFilteringFactor + accel[1] * (1.0 - kFilteringFactor);
|
||||
accel[2] = acceleration.z * kFilteringFactor + accel[2] * (1.0 - kFilteringFactor);
|
||||
}
|
||||
|
||||
|
||||
|
||||
- (void)dealloc {
|
||||
|
||||
@@ -14,6 +14,6 @@ USE_GRAPICSWINDOW_IMPLEMENTATION(IOS)
|
||||
USE_OSGPLUGIN(osg)
|
||||
|
||||
USE_OSGPLUGIN(imageio)
|
||||
|
||||
USE_OSGPLUGIN(freetype)
|
||||
USE_OSGPLUGIN(avfoundation)
|
||||
//USE_OSGPLUGIN(freetype)
|
||||
|
||||
|
||||
@@ -97,8 +97,8 @@ void cOSG::InitCameraConfig(void)
|
||||
// Create the Graphics Context
|
||||
osg::GraphicsContext* gc = osg::GraphicsContext::createGraphicsContext(traits.get());
|
||||
|
||||
// Init a new Camera (Master for this View)
|
||||
osg::ref_ptr<osg::Camera> camera = new osg::Camera;
|
||||
// Init Master Camera for this View
|
||||
osg::ref_ptr<osg::Camera> camera = mViewer->getCamera();
|
||||
|
||||
// Assign Graphics Context to the Camera
|
||||
camera->setGraphicsContext(gc);
|
||||
|
||||
@@ -93,7 +93,13 @@ int main( int argc, char** argv )
|
||||
{
|
||||
osg::ArgumentParser arguments(&argc, argv);
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
// Qt5 is currently crashing and reporting "Cannot make QOpenGLContext current in a different thread" when the viewer is run multi-threaded, this is regression from Qt4
|
||||
osgViewer::ViewerBase::ThreadingModel threadingModel = osgViewer::ViewerBase::SingleThreaded;
|
||||
#else
|
||||
osgViewer::ViewerBase::ThreadingModel threadingModel = osgViewer::ViewerBase::CullDrawThreadPerContext;
|
||||
#endif
|
||||
|
||||
while (arguments.read("--SingleThreaded")) threadingModel = osgViewer::ViewerBase::SingleThreaded;
|
||||
while (arguments.read("--CullDrawThreadPerContext")) threadingModel = osgViewer::ViewerBase::CullDrawThreadPerContext;
|
||||
while (arguments.read("--DrawThreadPerContext")) threadingModel = osgViewer::ViewerBase::DrawThreadPerContext;
|
||||
|
||||
@@ -1115,7 +1115,8 @@ int main( int argc, char **argv )
|
||||
if (image_3d.valid())
|
||||
{
|
||||
image_3d->setFileName(name_no_ext + ".dds");
|
||||
osgDB::writeImageFile(*image_3d, image_3d->getFileName());
|
||||
osg::ref_ptr<osgDB::Options> options = new osgDB::Options("ddsNoAutoFlipWrite");;
|
||||
osgDB::writeImageFile(*image_3d, image_3d->getFileName(), options.get());
|
||||
}
|
||||
osgDB::writeNodeFile(*volume, outputFile);
|
||||
}
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
|
||||
extern "C" {
|
||||
|
||||
#define OPENTHREADS_MAJOR_VERSION 2
|
||||
#define OPENTHREADS_MINOR_VERSION 6
|
||||
#define OPENTHREADS_PATCH_VERSION 0
|
||||
#define OPENTHREADS_SOVERSION 12
|
||||
#define OPENTHREADS_MAJOR_VERSION 3
|
||||
#define OPENTHREADS_MINOR_VERSION 2
|
||||
#define OPENTHREADS_PATCH_VERSION 1
|
||||
#define OPENTHREADS_SOVERSION 20
|
||||
|
||||
/** OpenThreadsGetVersion() returns the library version number.
|
||||
* Numbering convention : OpenThreads-1.0 will return 1.0 from OpenThreadsGetVersion. */
|
||||
|
||||
@@ -51,6 +51,12 @@ class BoundingBoxImpl
|
||||
-FLT_MAX)
|
||||
{}
|
||||
|
||||
template<typename BT>
|
||||
inline BoundingBoxImpl(const BoundingBoxImpl<BT>& bb) :
|
||||
_min(bb._min),
|
||||
_max(bb._max)
|
||||
{}
|
||||
|
||||
/** Creates a bounding box initialized to the given extents. */
|
||||
inline BoundingBoxImpl(value_type xmin, value_type ymin, value_type zmin,
|
||||
value_type xmax, value_type ymax, value_type zmax) :
|
||||
@@ -73,6 +79,9 @@ class BoundingBoxImpl
|
||||
-FLT_MAX);
|
||||
}
|
||||
|
||||
inline bool operator == (const BoundingBoxImpl& rhs) const { return _min==rhs._min && _max==rhs._max; }
|
||||
inline bool operator != (const BoundingBoxImpl& rhs) const { return _min!=rhs._min || _max!=rhs._max; }
|
||||
|
||||
/** Returns true if the bounding box extents are valid, false otherwise. */
|
||||
inline bool valid() const
|
||||
{
|
||||
@@ -189,7 +198,8 @@ class BoundingBoxImpl
|
||||
|
||||
/** Expands this bounding box to include the given sphere.
|
||||
* If this box is uninitialized, set it to include sh. */
|
||||
void expandBy(const BoundingSphereImpl<VT>& sh)
|
||||
template<typename BST>
|
||||
void expandBy(const BoundingSphereImpl<BST>& sh)
|
||||
{
|
||||
if (!sh.valid()) return;
|
||||
|
||||
@@ -227,6 +237,15 @@ class BoundingBoxImpl
|
||||
(v.y()>=_min.y() && v.y()<=_max.y()) &&
|
||||
(v.z()>=_min.z() && v.z()<=_max.z());
|
||||
}
|
||||
|
||||
/** Returns true if this bounding box contains the specified coordinate allowing for specific epsilon. */
|
||||
inline bool contains(const vec_type& v, value_type epsilon) const
|
||||
{
|
||||
return valid() &&
|
||||
((v.x()+epsilon)>=_min.x() && (v.x()-epsilon)<=_max.x()) &&
|
||||
((v.y()+epsilon)>=_min.y() && (v.y()-epsilon)<=_max.y()) &&
|
||||
((v.z()+epsilon)>=_min.z() && (v.z()-epsilon)<=_max.z());
|
||||
}
|
||||
};
|
||||
|
||||
typedef BoundingBoxImpl<Vec3f> BoundingBoxf;
|
||||
|
||||
@@ -63,6 +63,9 @@ class BoundingSphereImpl
|
||||
* otherwise. */
|
||||
inline bool valid() const { return _radius>=0.0; }
|
||||
|
||||
inline bool operator == (const BoundingSphereImpl& rhs) const { return _center==rhs._center && _radius==rhs._radius; }
|
||||
inline bool operator != (const BoundingSphereImpl& rhs) const { return _center!=rhs._center || _radius==rhs._radius; }
|
||||
|
||||
/** Set the bounding sphere to the given center/radius using floats. */
|
||||
inline void set(const vec_type& center,value_type radius)
|
||||
{
|
||||
@@ -110,11 +113,13 @@ class BoundingSphereImpl
|
||||
|
||||
/** Expands the sphere to encompass the given box. Repositions the
|
||||
* sphere center to minimize the radius increase. */
|
||||
void expandBy(const BoundingBoxImpl<VT>& bb);
|
||||
template<typename BBT>
|
||||
void expandBy(const BoundingBoxImpl<BBT>& bb);
|
||||
|
||||
/** Expands the sphere to encompass the given box. Does not
|
||||
* repositions the sphere center. */
|
||||
void expandRadiusBy(const BoundingBoxImpl<VT>& bb);
|
||||
template<typename BBT>
|
||||
void expandRadiusBy(const BoundingBoxImpl<BBT>& bb);
|
||||
|
||||
/** Returns true if v is within the sphere. */
|
||||
inline bool contains(const vec_type& v) const
|
||||
@@ -135,12 +140,12 @@ class BoundingSphereImpl
|
||||
|
||||
|
||||
template<typename VT>
|
||||
template<typename vector_type>
|
||||
template<typename vector_type>
|
||||
void BoundingSphereImpl<VT>::expandBy(const vector_type& v)
|
||||
{
|
||||
if (valid())
|
||||
{
|
||||
vec_type dv = v-_center;
|
||||
vec_type dv = vec_type(v)-_center;
|
||||
value_type r = dv.length();
|
||||
if (r>_radius)
|
||||
{
|
||||
@@ -157,12 +162,12 @@ void BoundingSphereImpl<VT>::expandBy(const vector_type& v)
|
||||
}
|
||||
|
||||
template<typename VT>
|
||||
template<typename vector_type>
|
||||
template<typename vector_type>
|
||||
void BoundingSphereImpl<VT>::expandRadiusBy(const vector_type& v)
|
||||
{
|
||||
if (valid())
|
||||
{
|
||||
value_type r = (v-_center).length();
|
||||
value_type r = (vec_type(v)-_center).length();
|
||||
if (r>_radius) _radius = r;
|
||||
// else do nothing as vertex is within sphere.
|
||||
}
|
||||
@@ -244,7 +249,8 @@ void BoundingSphereImpl<VT>::expandRadiusBy(const BoundingSphereImpl& sh)
|
||||
}
|
||||
|
||||
template<typename VT>
|
||||
void BoundingSphereImpl<VT>::expandBy(const BoundingBoxImpl<VT>& bb)
|
||||
template<typename BBT>
|
||||
void BoundingSphereImpl<VT>::expandBy(const BoundingBoxImpl<BBT>& bb)
|
||||
{
|
||||
if (bb.valid())
|
||||
{
|
||||
@@ -274,7 +280,8 @@ void BoundingSphereImpl<VT>::expandBy(const BoundingBoxImpl<VT>& bb)
|
||||
}
|
||||
|
||||
template<typename VT>
|
||||
void BoundingSphereImpl<VT>::expandRadiusBy(const BoundingBoxImpl<VT>& bb)
|
||||
template<typename BBT>
|
||||
void BoundingSphereImpl<VT>::expandRadiusBy(const BoundingBoxImpl<BBT>& bb)
|
||||
{
|
||||
if (bb.valid())
|
||||
{
|
||||
|
||||
@@ -680,6 +680,19 @@ class OSG_EXPORT Camera : public Transform, public CullSettings
|
||||
ref_ptr<DrawCallback> _finalDrawCallback;
|
||||
};
|
||||
|
||||
|
||||
/** Functor to assist with ordering camers in the order they should be rendered in.*/
|
||||
struct CameraRenderOrderSortOp
|
||||
{
|
||||
inline bool operator() (const Camera* lhs,const Camera* rhs) const
|
||||
{
|
||||
if (lhs->getRenderOrder()<rhs->getRenderOrder()) return true;
|
||||
if (rhs->getRenderOrder()<lhs->getRenderOrder()) return false;
|
||||
return lhs->getRenderOrderNum()<rhs->getRenderOrderNum();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -400,7 +400,7 @@ namespace osg
|
||||
FrameBufferObject();
|
||||
FrameBufferObject(const FrameBufferObject& copy, const CopyOp& copyop = CopyOp::SHALLOW_COPY);
|
||||
|
||||
META_StateAttribute(osg, FrameBufferObject, (StateAttribute::Type)0x101010/*FrameBufferObject*/);
|
||||
META_StateAttribute(osg, FrameBufferObject, FRAME_BUFFER_OBJECT);
|
||||
|
||||
inline const AttachmentMap& getAttachmentMap() const;
|
||||
|
||||
@@ -418,6 +418,11 @@ namespace osg
|
||||
|
||||
void apply(State &state) const;
|
||||
|
||||
inline GLuint getHandle(unsigned int contextID) const
|
||||
{
|
||||
return _fboID[contextID];
|
||||
}
|
||||
|
||||
enum BindTarget
|
||||
{
|
||||
READ_FRAMEBUFFER = GL_READ_FRAMEBUFFER_EXT,
|
||||
|
||||
@@ -385,8 +385,6 @@ typedef char GLchar;
|
||||
#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6
|
||||
#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7
|
||||
#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8
|
||||
#define GL_RED_SNORM 0x8F90
|
||||
#define GL_RG_SNORM 0x8F91
|
||||
#define GL_RGB_SNORM 0x8F92
|
||||
#define GL_RGBA_SNORM 0x8F93
|
||||
#define GL_R8_SNORM 0x8F94
|
||||
@@ -402,6 +400,14 @@ typedef char GLchar;
|
||||
#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E
|
||||
#endif
|
||||
|
||||
#ifndef GL_RED_SNORM
|
||||
#define GL_RED_SNORM 0x8F90
|
||||
#endif
|
||||
#ifndef GL_RG_SNORM
|
||||
#define GL_RG_SNORM 0x8F91
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef GL_VERSION_4_0
|
||||
#define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C
|
||||
#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D
|
||||
@@ -530,6 +536,8 @@ class OSG_EXPORT GL2Extensions : public osg::Referenced
|
||||
void setShaderAtomicCounterSupported(bool flag) { _isShaderAtomicCountersSupported = flag; }
|
||||
bool isShaderAtomicCounterSupported() const {return _isShaderAtomicCountersSupported; }
|
||||
|
||||
bool isDrawBuffersSupported() const { return _glDrawBuffers!=0; }
|
||||
|
||||
/** Function to call to get the extension of a specified context.
|
||||
* If the Exentsion object for that context has not yet been created then
|
||||
* and the 'createIfNotInitalized' flag been set to false then returns NULL.
|
||||
|
||||
@@ -302,13 +302,13 @@ class OSG_EXPORT Image : public BufferData
|
||||
* take care to access the data per row rather than treating the whole data as a single block. */
|
||||
inline const unsigned char* data() const { return _data; }
|
||||
|
||||
inline unsigned char* data(int column, int row=0,int image=0)
|
||||
inline unsigned char* data(unsigned int column, unsigned int row = 0, unsigned int image = 0)
|
||||
{
|
||||
if (!_data) return NULL;
|
||||
return _data+(column*getPixelSizeInBits())/8+row*getRowStepInBytes()+image*getImageSizeInBytes();
|
||||
}
|
||||
|
||||
inline const unsigned char* data(int column, int row=0,int image=0) const
|
||||
inline const unsigned char* data(unsigned int column, unsigned int row = 0, unsigned int image = 0) const
|
||||
{
|
||||
if (!_data) return NULL;
|
||||
return _data+(column*getPixelSizeInBits())/8+row*getRowStepInBytes()+image*getImageSizeInBytes();
|
||||
|
||||
@@ -34,10 +34,6 @@ const double LN_2 = 0.69314718055994530942;
|
||||
const double INVLN_2 = 1.0 / LN_2;
|
||||
|
||||
|
||||
/** return the minimum of two values, equivalent to std::min.
|
||||
* std::min not used because of STL implementation under IRIX not
|
||||
* containing std::min.
|
||||
*/
|
||||
template<typename T>
|
||||
inline T absolute(T v) { return v<(T)0?-v:v; }
|
||||
|
||||
|
||||
@@ -201,7 +201,11 @@ class OSG_EXPORT Node : public Object
|
||||
/** Convenience method that removes a given callback from a node, even if that callback is nested. There is no error return in case the given callback is not found. */
|
||||
inline void removeUpdateCallback(NodeCallback* nc) {
|
||||
if (nc != NULL && _updateCallback.valid()) {
|
||||
if (_updateCallback == nc) setUpdateCallback(nc->getNestedCallback()); // replace the callback by the nested one
|
||||
if (_updateCallback == nc)
|
||||
{
|
||||
setUpdateCallback(nc->getNestedCallback()); // replace the callback by the nested one
|
||||
nc->setNestedCallback(0);
|
||||
}
|
||||
else _updateCallback->removeNestedCallback(nc);
|
||||
}
|
||||
}
|
||||
@@ -231,7 +235,11 @@ class OSG_EXPORT Node : public Object
|
||||
/** Convenience method that removes a given callback from a node, even if that callback is nested. There is no error return in case the given callback is not found. */
|
||||
inline void removeEventCallback(NodeCallback* nc) {
|
||||
if (nc != NULL && _eventCallback.valid()) {
|
||||
if (_eventCallback == nc) setEventCallback(nc->getNestedCallback()); // replace the callback by the nested one
|
||||
if (_eventCallback == nc)
|
||||
{
|
||||
setEventCallback(nc->getNestedCallback()); // replace the callback by the nested one
|
||||
nc->setNestedCallback(0);
|
||||
}
|
||||
else _eventCallback->removeNestedCallback(nc);
|
||||
}
|
||||
}
|
||||
@@ -261,7 +269,11 @@ class OSG_EXPORT Node : public Object
|
||||
/** Convenience method that removes a given callback from a node, even if that callback is nested. There is no error return in case the given callback is not found. */
|
||||
inline void removeCullCallback(NodeCallback* nc) {
|
||||
if (nc != NULL && _cullCallback.valid()) {
|
||||
if (_cullCallback == nc) setCullCallback(nc->getNestedCallback()); // replace the callback by the nested one
|
||||
if (_cullCallback == nc)
|
||||
{
|
||||
setCullCallback(nc->getNestedCallback()); // replace the callback by the nested one
|
||||
nc->setNestedCallback(0);
|
||||
}
|
||||
else _cullCallback->removeNestedCallback(nc);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1203,6 +1203,13 @@ class OSG_EXPORT State : public Referenced, public Observer
|
||||
}
|
||||
|
||||
|
||||
/// For GL>=2.0 uses GL_MAX_TEXTURE_COORDS, for GL<2 uses GL_MAX_TEXTURE_UNITS
|
||||
inline GLint getMaxTextureCoords() const { return _glMaxTextureCoords; }
|
||||
|
||||
/// For GL>=2.0 uses GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, for GL<2 uses GL_MAX_TEXTURE_UNITS
|
||||
inline GLint getMaxTextureUnits() const { return _glMaxTextureUnits; }
|
||||
|
||||
|
||||
/** Set the current texture unit, return true if selected,
|
||||
* false if selection failed such as when multi texturing is not supported.
|
||||
* note, only updates values that change.*/
|
||||
|
||||
@@ -192,8 +192,10 @@ class OSG_EXPORT StateAttribute : public Object
|
||||
TRANSFORMFEEDBACKBUFFERBINDING,
|
||||
|
||||
ATOMICCOUNTERBUFFERBINDING,
|
||||
|
||||
PATCH_PARAMETER
|
||||
|
||||
PATCH_PARAMETER,
|
||||
|
||||
FRAME_BUFFER_OBJECT
|
||||
};
|
||||
|
||||
/** Simple pairing between an attribute type and the member within that attribute type group.*/
|
||||
|
||||
@@ -20,8 +20,8 @@ extern "C" {
|
||||
|
||||
#define OPENSCENEGRAPH_MAJOR_VERSION 3
|
||||
#define OPENSCENEGRAPH_MINOR_VERSION 2
|
||||
#define OPENSCENEGRAPH_PATCH_VERSION 0
|
||||
#define OPENSCENEGRAPH_SOVERSION 99
|
||||
#define OPENSCENEGRAPH_PATCH_VERSION 1
|
||||
#define OPENSCENEGRAPH_SOVERSION 100
|
||||
|
||||
/* Convenience macro that can be used to decide whether a feature is present or not i.e.
|
||||
* #if OSG_MIN_VERSION_REQUIRED(2,9,5)
|
||||
|
||||
@@ -89,6 +89,7 @@ public:
|
||||
// Serialization related functions
|
||||
OutputStream& operator<<( bool b ) { _out->writeBool(b); return *this; }
|
||||
OutputStream& operator<<( char c ) { _out->writeChar(c); return *this; }
|
||||
OutputStream& operator<<( signed char c) { _out->writeChar(c); return *this; }
|
||||
OutputStream& operator<<( unsigned char c ) { _out->writeUChar(c); return *this; }
|
||||
OutputStream& operator<<( short s ) { _out->writeShort(s); return *this; }
|
||||
OutputStream& operator<<( unsigned short s ) { _out->writeUShort(s); return *this; }
|
||||
|
||||
@@ -21,8 +21,7 @@
|
||||
namespace osgManipulator {
|
||||
|
||||
/**
|
||||
* Tab plane dragger consists of a plane with tabs on it's corners and edges
|
||||
* for scaling. And the plane is used as a 2D translate dragger.
|
||||
* Translate plane dragger consists of a wireframe box representing a plane that can be dragged to translate along the plane.
|
||||
*/
|
||||
class OSGMANIPULATOR_EXPORT TranslatePlaneDragger : public CompositeDragger
|
||||
{
|
||||
|
||||
@@ -38,7 +38,7 @@ class OSGSHADOW_EXPORT ShadowSettings : public osg::Object
|
||||
void setComputeNearFarModeOverride(osg::CullSettings::ComputeNearFarMode cnfn) { _computeNearFearModeOverride = cnfn; }
|
||||
osg::CullSettings::ComputeNearFarMode getComputeNearFarModeOverride() const { return _computeNearFearModeOverride; }
|
||||
|
||||
|
||||
|
||||
/** Set the LightNum of the light in the scene to assign a shadow for.
|
||||
* Default value is -1, which signifies that shadow technique should automatically select an active light
|
||||
* to assign a shadow, typically this will be the first active light found. */
|
||||
@@ -67,7 +67,7 @@ class OSGSHADOW_EXPORT ShadowSettings : public osg::Object
|
||||
|
||||
void setMaximumShadowMapDistance(double distance) { _maximumShadowMapDistance = distance; }
|
||||
double getMaximumShadowMapDistance() const { return _maximumShadowMapDistance; }
|
||||
|
||||
|
||||
|
||||
enum ShadowMapProjectionHint
|
||||
{
|
||||
@@ -144,4 +144,4 @@ class OSGSHADOW_EXPORT ShadowSettings : public osg::Object
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -51,7 +51,7 @@ class OSGUTIL_EXPORT SceneView : public osg::Object, public osg::CullSettings
|
||||
SKY_LIGHT = 0x2,
|
||||
COMPILE_GLOBJECTS_AT_INIT = 0x4,
|
||||
APPLY_GLOBAL_DEFAULTS = 0x8,
|
||||
CLEAR_GLOBAL_STATESET = 0x16,
|
||||
CLEAR_GLOBAL_STATESET = 0x10,
|
||||
STANDARD_SETTINGS = HEADLIGHT |
|
||||
COMPILE_GLOBJECTS_AT_INIT |
|
||||
APPLY_GLOBAL_DEFAULTS |
|
||||
@@ -495,7 +495,7 @@ class OSGUTIL_EXPORT SceneView : public osg::Object, public osg::CullSettings
|
||||
bool getAutomaticFlush() const { return _automaticFlush; }
|
||||
|
||||
void setResetColorMaskToAllOn(bool enable) { _resetColorMaskToAllEnabled = enable; }
|
||||
bool setResetColorMaskToAllOn() const { return _resetColorMaskToAllEnabled; }
|
||||
bool getResetColorMaskToAllOn() const { return _resetColorMaskToAllEnabled; }
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
@@ -207,6 +207,7 @@ class OSGUTIL_EXPORT StateGraph : public osg::Referenced
|
||||
|
||||
// use return path to trace back steps to sg_new.
|
||||
std::vector<StateGraph*> return_path;
|
||||
return_path.reserve(sg_new->_depth+1);
|
||||
|
||||
// need to pop back root render graph.
|
||||
do
|
||||
@@ -248,6 +249,7 @@ class OSGUTIL_EXPORT StateGraph : public osg::Referenced
|
||||
|
||||
// use return path to trace back steps to sg_new.
|
||||
std::vector<StateGraph*> return_path;
|
||||
return_path.reserve(sg_new->_depth+1);
|
||||
|
||||
// need to pop back up to the same depth as the curr state group.
|
||||
while (sg_new->_depth>sg_curr->_depth)
|
||||
|
||||
@@ -24,23 +24,23 @@
|
||||
|
||||
namespace osgViewer
|
||||
{
|
||||
|
||||
|
||||
class OSGVIEWER_EXPORT Keystone : public osg::Object
|
||||
{
|
||||
public:
|
||||
Keystone();
|
||||
|
||||
Keystone(const Keystone& rhs, const osg::CopyOp& copop=osg::CopyOp::SHALLOW_COPY);
|
||||
|
||||
|
||||
META_Object(osgViewer, Keystone)
|
||||
|
||||
void reset();
|
||||
|
||||
Keystone& operator = (const Keystone& rhs);
|
||||
|
||||
|
||||
void setKeystoneEditingEnabled(bool flag) { keystoneEditingEnabled = flag; }
|
||||
bool getKeystoneEditingEnabled() const { return keystoneEditingEnabled; }
|
||||
|
||||
|
||||
void setGridColor(const osg::Vec4& color) { gridColour = color; }
|
||||
osg::Vec4& getGridColor() { return gridColour; }
|
||||
const osg::Vec4& getGridColor() const { return gridColour; }
|
||||
@@ -61,23 +61,23 @@ public:
|
||||
osg::Vec2d& getTopRight() { return top_right; }
|
||||
const osg::Vec2d& getTopRight() const { return top_right; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void compute3DPositions(osg::DisplaySettings* ds, osg::Vec3& tl, osg::Vec3& tr, osg::Vec3& br, osg::Vec3& bl) const;
|
||||
|
||||
|
||||
osg::Geode* createKeystoneDistortionMesh();
|
||||
|
||||
|
||||
osg::Node* createGrid();
|
||||
|
||||
|
||||
/** Write the file specified by the "filename" user value field. Return true if file successfully written. */
|
||||
bool writeToFile();
|
||||
|
||||
|
||||
/** convinience function that loads and assigns any keystone files specified in the DisplaySettings::KeystoneFileNames list, return true if Keystone's assigned to DisplaySettings.*/
|
||||
static bool loadKeystoneFiles(osg::DisplaySettings* ds);
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
protected:
|
||||
|
||||
bool keystoneEditingEnabled;
|
||||
|
||||
osg::Vec4 gridColour;
|
||||
@@ -91,8 +91,8 @@ protected:
|
||||
protected:
|
||||
|
||||
virtual ~Keystone() {}
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
class OSGVIEWER_EXPORT KeystoneHandler : public osgGA::GUIEventHandler
|
||||
@@ -125,7 +125,7 @@ public:
|
||||
osg::Vec2d incrementScale(const osgGA::GUIEventAdapter& ea) const;
|
||||
Region computeRegion(const osgGA::GUIEventAdapter& ea) const;
|
||||
void move(Region region, const osg::Vec2d& delta);
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ protected:
|
||||
|
||||
osg::Vec2d _startPosition;
|
||||
osg::ref_ptr<Keystone> _startControlPoints;
|
||||
|
||||
|
||||
Region _selectedRegion;
|
||||
osg::ref_ptr<Keystone> _currentControlPoints;
|
||||
|
||||
@@ -146,4 +146,4 @@ protected:
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -314,6 +314,11 @@ class OSGWIDGET_EXPORT EventInterface
|
||||
return _eventMask;
|
||||
}
|
||||
|
||||
typedef std::list<osg::ref_ptr<Callback> > CallbackList;
|
||||
|
||||
inline CallbackList& getCallbacks() { return _callbacks; }
|
||||
inline const CallbackList& getCallbacks() const { return _callbacks; }
|
||||
|
||||
void addCallback(Callback* cb) {
|
||||
_callbacks.push_back(cb);
|
||||
}
|
||||
@@ -400,7 +405,6 @@ class OSGWIDGET_EXPORT EventInterface
|
||||
bool canKeyUp () const { return (_eventMask & EVENT_KEY_UP) != 0; }
|
||||
|
||||
private:
|
||||
typedef std::list<osg::ref_ptr<Callback> > CallbackList;
|
||||
|
||||
unsigned int _eventMask;
|
||||
CallbackList _callbacks;
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
# what to do with it.
|
||||
ADD_DEFINITIONS(-DOPENTHREADS_EXPORTS)
|
||||
|
||||
SET(OPENTHREADS_MAJOR_VERSION 2)
|
||||
SET(OPENTHREADS_MINOR_VERSION 6)
|
||||
SET(OPENTHREADS_PATCH_VERSION 0)
|
||||
SET(OPENTHREADS_SOVERSION 12)
|
||||
SET(OPENTHREADS_MAJOR_VERSION 3)
|
||||
SET(OPENTHREADS_MINOR_VERSION 2)
|
||||
SET(OPENTHREADS_PATCH_VERSION 1)
|
||||
SET(OPENTHREADS_SOVERSION 20)
|
||||
|
||||
SET(OPENTHREADS_VERSION ${OPENTHREADS_MAJOR_VERSION}.${OPENTHREADS_MINOR_VERSION}.${OPENTHREADS_PATCH_VERSION})
|
||||
|
||||
@@ -55,10 +55,10 @@ SET(OpenThreads_PUBLIC_HEADERS
|
||||
${HEADER_PATH}/Block
|
||||
${HEADER_PATH}/Condition
|
||||
${HEADER_PATH}/Exports
|
||||
${HEADER_PATH}/Mutex
|
||||
${HEADER_PATH}/ReadWriteMutex
|
||||
${HEADER_PATH}/ReentrantMutex
|
||||
${HEADER_PATH}/ScopedLock
|
||||
${HEADER_PATH}/Mutex
|
||||
${HEADER_PATH}/ReadWriteMutex
|
||||
${HEADER_PATH}/ReentrantMutex
|
||||
${HEADER_PATH}/ScopedLock
|
||||
${HEADER_PATH}/Thread
|
||||
${HEADER_PATH}/Version
|
||||
${OPENTHREADS_CONFIG_HEADER}
|
||||
@@ -96,7 +96,7 @@ ELSEIF(WIN32)
|
||||
SUBDIRS(pthreads)
|
||||
ELSE()
|
||||
# Everybody else including Msys should probably go here
|
||||
SUBDIRS(win32)
|
||||
SUBDIRS(win32)
|
||||
# examples)
|
||||
ENDIF()
|
||||
ELSE()
|
||||
|
||||
@@ -149,7 +149,30 @@ private:
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
#if defined(HAVE_PTHREAD_SETAFFINITY_NP) || defined(HAVE_THREE_PARAM_SCHED_SETAFFINITY) || defined(HAVE_TWO_PARAM_SCHED_SETAFFINITY)
|
||||
else
|
||||
{
|
||||
// BUG-fix for linux:
|
||||
// Each thread inherits the processor affinity mask from its parent thread.
|
||||
// We need to explicitly set it to all CPUs, if no affinity was specified.
|
||||
|
||||
cpu_set_t cpumask;
|
||||
CPU_ZERO( &cpumask );
|
||||
|
||||
for (int i = 0; i < OpenThreads::GetNumberOfProcessors(); ++i)
|
||||
{
|
||||
CPU_SET( i, &cpumask );
|
||||
}
|
||||
|
||||
#if defined(HAVE_PTHREAD_SETAFFINITY_NP)
|
||||
pthread_setaffinity_np( pthread_self(), sizeof(cpumask), &cpumask);
|
||||
#elif defined(HAVE_THREE_PARAM_SCHED_SETAFFINITY)
|
||||
sched_setaffinity( 0, sizeof(cpumask), &cpumask );
|
||||
#elif defined(HAVE_TWO_PARAM_SCHED_SETAFFINITY)
|
||||
sched_setaffinity( 0, &cpumask );
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
ThreadCleanupStruct tcs;
|
||||
tcs.thread = thread;
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include <string.h>
|
||||
|
||||
#include <osg/ApplicationUsage>
|
||||
#include <osg/Object>
|
||||
#include <osg/Math>
|
||||
#include <osg/ref_ptr>
|
||||
|
||||
@@ -33,6 +34,8 @@ ApplicationUsage* ApplicationUsage::instance()
|
||||
return s_applicationUsage.get();
|
||||
}
|
||||
|
||||
OSG_INIT_SINGLETON_PROXY(ApplicationUsageSingletonProxy, ApplicationUsage::instance())
|
||||
|
||||
void ApplicationUsage::addUsageExplanation(Type type,const std::string& option,const std::string& explanation)
|
||||
{
|
||||
switch(type)
|
||||
@@ -69,7 +72,7 @@ void ApplicationUsage::addKeyboardMouseBinding(const std::string& prefix, int ke
|
||||
{
|
||||
std::ostringstream ostr;
|
||||
ostr<<prefix;
|
||||
|
||||
|
||||
if (key==' ')
|
||||
{
|
||||
ostr<<"Space";
|
||||
|
||||
@@ -225,21 +225,26 @@ void CollectOccludersVisitor::removeOccludedOccluders()
|
||||
break;
|
||||
}
|
||||
|
||||
// now check all the holes in the occludee against the occluder,
|
||||
// do so in reverse order so that the iterators remain valid.
|
||||
for(ShadowVolumeOccluder::HoleList::reverse_iterator holeItr=holeList.rbegin();
|
||||
holeItr!=holeList.rend();
|
||||
)
|
||||
// now check all the holes in the occludee against the occluder, and remove the ones that won't be valid
|
||||
unsigned int previous_valid_hole_i = 0;
|
||||
for(unsigned int i=0; i<holeList.size(); ++i)
|
||||
{
|
||||
if (occluder->contains((*holeItr).getReferenceVertexList()))
|
||||
if (!occluder->contains(holeList[i].getReferenceVertexList()))
|
||||
{
|
||||
holeList.erase((++holeItr).base());
|
||||
}
|
||||
else
|
||||
{
|
||||
++holeItr;
|
||||
}
|
||||
if (previous_valid_hole_i<i)
|
||||
{
|
||||
// copy valid holes into gaps left by invalid ones
|
||||
holeList[previous_valid_hole_i] = holeList[i];
|
||||
}
|
||||
|
||||
previous_valid_hole_i++;
|
||||
}
|
||||
}
|
||||
|
||||
// remove the tail of the holeList if holes have been removed.
|
||||
if (previous_valid_hole_i<holeList.size())
|
||||
{
|
||||
holeList.erase(holeList.begin()+previous_valid_hole_i,holeList.end());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ void DisplaySettings::setDisplaySettings(const DisplaySettings& vs)
|
||||
_glContextFlags = vs._glContextFlags;
|
||||
_glContextProfileMask = vs._glContextProfileMask;
|
||||
_swapMethod = vs._swapMethod;
|
||||
|
||||
|
||||
_keystoneHint = vs._keystoneHint;
|
||||
_keystoneFileNames = vs._keystoneFileNames;
|
||||
_keystones = vs._keystones;
|
||||
@@ -137,7 +137,7 @@ void DisplaySettings::merge(const DisplaySettings& vs)
|
||||
_swapMethod = vs._swapMethod;
|
||||
|
||||
_keystoneHint = _keystoneHint | vs._keystoneHint;
|
||||
|
||||
|
||||
// insert any unique filenames into the local list
|
||||
for(FileNames::const_iterator itr = vs._keystoneFileNames.begin();
|
||||
itr != vs._keystoneFileNames.end();
|
||||
@@ -146,7 +146,7 @@ void DisplaySettings::merge(const DisplaySettings& vs)
|
||||
const std::string& filename = *itr;
|
||||
FileNames::iterator found_itr = std::find(_keystoneFileNames.begin(), _keystoneFileNames.end(), filename);
|
||||
if (found_itr == _keystoneFileNames.end()) _keystoneFileNames.push_back(filename);
|
||||
}
|
||||
}
|
||||
|
||||
// insert unique Keystone object into local list
|
||||
for(Objects::const_iterator itr = vs._keystones.begin();
|
||||
@@ -156,7 +156,7 @@ void DisplaySettings::merge(const DisplaySettings& vs)
|
||||
const osg::Object* object = itr->get();
|
||||
Objects::iterator found_itr = std::find(_keystones.begin(), _keystones.end(), object);
|
||||
if (found_itr == _keystones.end()) _keystones.push_back(const_cast<osg::Object*>(object));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DisplaySettings::setDefaults()
|
||||
@@ -197,7 +197,7 @@ void DisplaySettings::setDefaults()
|
||||
#endif
|
||||
|
||||
_compileContextsHint = false;
|
||||
_serializeDrawDispatch = true;
|
||||
_serializeDrawDispatch = false;
|
||||
_useSceneViewForStereoHint = true;
|
||||
|
||||
_numDatabaseThreadsHint = 2;
|
||||
@@ -633,7 +633,7 @@ void DisplaySettings::readEnvironmentalVariables()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ((ptr = getenv("OSG_KEYSTONE_FILES")) != 0)
|
||||
{
|
||||
#if defined(WIN32) && !defined(__CYGWIN__)
|
||||
@@ -641,7 +641,7 @@ void DisplaySettings::readEnvironmentalVariables()
|
||||
#else
|
||||
char delimitor = ':';
|
||||
#endif
|
||||
|
||||
|
||||
std::string paths(ptr);
|
||||
if (!paths.empty())
|
||||
{
|
||||
@@ -743,10 +743,10 @@ void DisplaySettings::readCommandLine(ArgumentParser& arguments)
|
||||
if (arguments.read("--keystone",str))
|
||||
{
|
||||
_keystoneHint = true;
|
||||
|
||||
|
||||
if (!_keystoneFileNames.empty()) _keystoneFileNames.clear();
|
||||
_keystoneFileNames.push_back(str);
|
||||
|
||||
|
||||
while(arguments.read("--keystone",str))
|
||||
{
|
||||
_keystoneFileNames.push_back(str);
|
||||
|
||||
@@ -105,7 +105,8 @@ FBOExtensions::FBOExtensions(unsigned int contextID)
|
||||
#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE)
|
||||
_supported = _supported &&
|
||||
glFramebufferTexture1D != 0 &&
|
||||
glFramebufferTexture3D != 0;
|
||||
glFramebufferTexture3D != 0 &&
|
||||
isGLExtensionOrVersionSupported(contextID, "GL_EXT_framebuffer_object",3.0f);
|
||||
#endif
|
||||
|
||||
LOAD_FBO_EXT(glBlitFramebuffer);
|
||||
@@ -913,12 +914,19 @@ void FrameBufferObject::apply(State &state, BindTarget target) const
|
||||
ext->glBindFramebuffer(target, fboID);
|
||||
|
||||
// enable drawing buffers to render the result to fbo
|
||||
if (_drawBuffers.size() > 0)
|
||||
if ( (target == READ_DRAW_FRAMEBUFFER) || (target == DRAW_FRAMEBUFFER) )
|
||||
{
|
||||
GL2Extensions *gl2e = GL2Extensions::Get(state.getContextID(), true );
|
||||
if (gl2e)
|
||||
if (_drawBuffers.size() > 0)
|
||||
{
|
||||
gl2e->glDrawBuffers(_drawBuffers.size(), &(_drawBuffers[0]));
|
||||
GL2Extensions *gl2e = GL2Extensions::Get(state.getContextID(), true );
|
||||
if (gl2e && gl2e->isDrawBuffersSupported())
|
||||
{
|
||||
gl2e->glDrawBuffers(_drawBuffers.size(), &(_drawBuffers[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
OSG_WARN <<"Warning: FrameBufferObject: could not set draw buffers, glDrawBuffers is not supported!" << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -939,7 +947,7 @@ void FrameBufferObject::apply(State &state, BindTarget target) const
|
||||
{
|
||||
OSG_WARN <<
|
||||
"Warning: FrameBufferObject: could not attach PACKED_DEPTH_STENCIL_BUFFER, "
|
||||
"EXT_packed_depth_stencil is not supported !" << std::endl;
|
||||
"EXT_packed_depth_stencil is not supported!" << std::endl;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -161,12 +161,14 @@ void Geometry::setTexCoordArray(unsigned int index,Array* array, osg::Array::Bin
|
||||
if (_texCoordList.size()<=index)
|
||||
_texCoordList.resize(index+1);
|
||||
|
||||
if (array && binding!=osg::Array::BIND_UNDEFINED) array->setBinding(binding);
|
||||
if (array)
|
||||
{
|
||||
if (binding!=osg::Array::BIND_UNDEFINED) array->setBinding(binding);
|
||||
else array->setBinding(osg::Array::BIND_PER_VERTEX);
|
||||
}
|
||||
|
||||
_texCoordList[index] = array;
|
||||
|
||||
// do we set to array BIND_PER_VERTEX?
|
||||
|
||||
dirtyDisplayList();
|
||||
|
||||
if (_useVertexBufferObjects && array)
|
||||
@@ -1425,7 +1427,7 @@ void Geometry::fixDeprecatedData()
|
||||
case(PrimitiveSet::DrawArraysPrimitiveType):
|
||||
{
|
||||
const DrawArrays* drawArray = static_cast<const DrawArrays*>(primitiveset);
|
||||
numVertices = drawArray->getCount();
|
||||
numVertices += drawArray->getCount();
|
||||
break;
|
||||
}
|
||||
case(PrimitiveSet::DrawArrayLengthsPrimitiveType):
|
||||
@@ -1437,7 +1439,6 @@ void Geometry::fixDeprecatedData()
|
||||
{
|
||||
unsigned int localNumVertices = *primItr;
|
||||
numVertices += localNumVertices;
|
||||
primItr += localNumVertices;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1538,7 +1539,8 @@ void Geometry::fixDeprecatedData()
|
||||
|
||||
// start the primitiveNum at -1 as we increment it the first time through when
|
||||
// we start processing the primitive sets.
|
||||
int primitiveNum = -1;
|
||||
int target_vindex = 0;
|
||||
int source_pindex = -1; // equals primitiveNum
|
||||
for(PrimitiveSetList::iterator itr = _primitives.begin();
|
||||
itr != _primitives.end();
|
||||
++itr)
|
||||
@@ -1557,27 +1559,27 @@ void Geometry::fixDeprecatedData()
|
||||
}
|
||||
|
||||
// copy the vertex data across to the new arays
|
||||
int source_pindex = -1;
|
||||
int target_vindex = 0;
|
||||
switch(primitiveset->getType())
|
||||
{
|
||||
case(PrimitiveSet::DrawArraysPrimitiveType):
|
||||
{
|
||||
if (primLength==0) primLength=primitiveset->getNumIndices();
|
||||
|
||||
const DrawArrays* drawArray = static_cast<const DrawArrays*>(primitiveset);
|
||||
DrawArrays* drawArray = static_cast<DrawArrays*>(primitiveset);
|
||||
|
||||
if (primLength==0) primLength = drawArray->getCount();
|
||||
|
||||
unsigned int primCount=0;
|
||||
unsigned int indexEnd = drawArray->getFirst()+drawArray->getCount();
|
||||
for(unsigned int vindex=drawArray->getFirst();
|
||||
unsigned int startindex=drawArray->getFirst();
|
||||
drawArray->setFirst(target_vindex);
|
||||
unsigned int indexEnd = startindex+drawArray->getCount();
|
||||
for(unsigned int vindex=startindex;
|
||||
vindex<indexEnd;
|
||||
++vindex, ++target_vindex, ++primCount)
|
||||
{
|
||||
if ((primCount%primLength)==0) ++source_pindex;
|
||||
|
||||
// copy bind per primitive from primitiveNum
|
||||
// copy bind per vertex from vindex
|
||||
for(PtrList::iterator itr = perVertexPtrs.begin();
|
||||
itr != perVertexPtrs.end();
|
||||
++itr)
|
||||
@@ -1591,7 +1593,7 @@ void Geometry::fixDeprecatedData()
|
||||
}
|
||||
}
|
||||
|
||||
// copy bind per vertex from vindex
|
||||
// copy bind per primitive from source_pindex
|
||||
for(PtrList::iterator itr = perPrimitivePtrs.begin();
|
||||
itr != perPrimitivePtrs.end();
|
||||
++itr)
|
||||
@@ -1609,23 +1611,22 @@ void Geometry::fixDeprecatedData()
|
||||
}
|
||||
case(PrimitiveSet::DrawArrayLengthsPrimitiveType):
|
||||
{
|
||||
const DrawArrayLengths* drawArrayLengths = static_cast<const DrawArrayLengths*>(primitiveset);
|
||||
DrawArrayLengths* drawArrayLengths = static_cast<DrawArrayLengths*>(primitiveset);
|
||||
unsigned int vindex=drawArrayLengths->getFirst();
|
||||
for(DrawArrayLengths::const_iterator primItr=drawArrayLengths->begin();
|
||||
for(DrawArrayLengths::iterator primItr=drawArrayLengths->begin();
|
||||
primItr!=drawArrayLengths->end();
|
||||
++primItr)
|
||||
{
|
||||
unsigned int localPrimLength;
|
||||
if (primLength==0) localPrimLength=*primItr;
|
||||
else localPrimLength=primLength;
|
||||
|
||||
drawArrayLengths->setFirst(target_vindex);
|
||||
for(GLsizei primCount=0;
|
||||
primCount<*primItr;
|
||||
++vindex, ++target_vindex, ++primCount)
|
||||
{
|
||||
if ((primCount%localPrimLength)==0) ++source_pindex;
|
||||
|
||||
// copy bind per primitive from primitiveNum
|
||||
// copy bind per vertex from vindex
|
||||
for(PtrList::iterator itr = perVertexPtrs.begin();
|
||||
itr != perVertexPtrs.end();
|
||||
++itr)
|
||||
@@ -1639,7 +1640,7 @@ void Geometry::fixDeprecatedData()
|
||||
}
|
||||
}
|
||||
|
||||
// copy bind per vertex from vindex
|
||||
// copy bind per primitive from source_pindex
|
||||
for(PtrList::iterator itr = perPrimitivePtrs.begin();
|
||||
itr != perPrimitivePtrs.end();
|
||||
++itr)
|
||||
@@ -1660,16 +1661,17 @@ void Geometry::fixDeprecatedData()
|
||||
{
|
||||
if (primLength==0) primLength=primitiveset->getNumIndices();
|
||||
|
||||
const DrawElementsUByte* drawElements = static_cast<const DrawElementsUByte*>(primitiveset);
|
||||
DrawElementsUByte* drawElements = static_cast<DrawElementsUByte*>(primitiveset);
|
||||
unsigned int primCount=0;
|
||||
for(DrawElementsUByte::const_iterator primItr=drawElements->begin();
|
||||
for(DrawElementsUByte::iterator primItr=drawElements->begin();
|
||||
primItr!=drawElements->end();
|
||||
++primCount, ++target_vindex, ++primItr)
|
||||
{
|
||||
if ((primCount%primLength)==0) ++source_pindex;
|
||||
unsigned int vindex=*primItr;
|
||||
*primItr=target_vindex;
|
||||
|
||||
// copy bind per primitive from primitiveNum
|
||||
// copy bind per vertex from vindex
|
||||
for(PtrList::iterator itr = perVertexPtrs.begin();
|
||||
itr != perVertexPtrs.end();
|
||||
++itr)
|
||||
@@ -1683,7 +1685,7 @@ void Geometry::fixDeprecatedData()
|
||||
}
|
||||
}
|
||||
|
||||
// copy bind per vertex from vindex
|
||||
// copy bind per primitive from source_pindex
|
||||
for(PtrList::iterator itr = perPrimitivePtrs.begin();
|
||||
itr != perPrimitivePtrs.end();
|
||||
++itr)
|
||||
@@ -1703,16 +1705,17 @@ void Geometry::fixDeprecatedData()
|
||||
{
|
||||
if (primLength==0) primLength=primitiveset->getNumIndices();
|
||||
|
||||
const DrawElementsUShort* drawElements = static_cast<const DrawElementsUShort*>(primitiveset);
|
||||
DrawElementsUShort* drawElements = static_cast<DrawElementsUShort*>(primitiveset);
|
||||
unsigned int primCount=0;
|
||||
for(DrawElementsUShort::const_iterator primItr=drawElements->begin();
|
||||
for(DrawElementsUShort::iterator primItr=drawElements->begin();
|
||||
primItr!=drawElements->end();
|
||||
++primCount, ++target_vindex, ++primItr)
|
||||
{
|
||||
if ((primCount%primLength)==0) ++primitiveNum;
|
||||
if ((primCount%primLength)==0) ++source_pindex;
|
||||
unsigned int vindex=*primItr;
|
||||
*primItr=target_vindex;
|
||||
|
||||
// copy bind per primitive from primitiveNum
|
||||
// copy bind per vertex from vindex
|
||||
for(PtrList::iterator itr = perVertexPtrs.begin();
|
||||
itr != perVertexPtrs.end();
|
||||
++itr)
|
||||
@@ -1725,8 +1728,7 @@ void Geometry::fixDeprecatedData()
|
||||
*target++ = *source++;
|
||||
}
|
||||
}
|
||||
|
||||
// copy bind per vertex from vindex
|
||||
// copy bind per primitive from source_pindex
|
||||
for(PtrList::iterator itr = perPrimitivePtrs.begin();
|
||||
itr != perPrimitivePtrs.end();
|
||||
++itr)
|
||||
@@ -1746,16 +1748,17 @@ void Geometry::fixDeprecatedData()
|
||||
{
|
||||
if (primLength==0) primLength=primitiveset->getNumIndices();
|
||||
|
||||
const DrawElementsUInt* drawElements = static_cast<const DrawElementsUInt*>(primitiveset);
|
||||
DrawElementsUInt* drawElements = static_cast<DrawElementsUInt*>(primitiveset);
|
||||
unsigned int primCount=0;
|
||||
for(DrawElementsUInt::const_iterator primItr=drawElements->begin();
|
||||
for(DrawElementsUInt::iterator primItr=drawElements->begin();
|
||||
primItr!=drawElements->end();
|
||||
++primCount, ++target_vindex, ++primItr)
|
||||
{
|
||||
if ((primCount%primLength)==0) ++primitiveNum;
|
||||
if ((primCount%primLength)==0) ++source_pindex;
|
||||
unsigned int vindex=*primItr;
|
||||
*primItr=target_vindex;
|
||||
|
||||
// copy bind per primitive from primitiveNum
|
||||
// copy bind per vertex from vindex
|
||||
for(PtrList::iterator itr = perVertexPtrs.begin();
|
||||
itr != perVertexPtrs.end();
|
||||
++itr)
|
||||
@@ -1769,7 +1772,7 @@ void Geometry::fixDeprecatedData()
|
||||
}
|
||||
}
|
||||
|
||||
// copy bind per vertex from vindex
|
||||
// copy bind per primitive from source_pindex
|
||||
for(PtrList::iterator itr = perPrimitivePtrs.begin();
|
||||
itr != perPrimitivePtrs.end();
|
||||
++itr)
|
||||
|
||||
@@ -547,6 +547,9 @@ void GraphicsContext::close(bool callCloseImplementation)
|
||||
}
|
||||
|
||||
|
||||
bool contextIDValid = _state.valid();
|
||||
unsigned int contextID = _state.valid() ? _state->getContextID() : ~0U;
|
||||
|
||||
if (callCloseImplementation && _state.valid() && isRealized())
|
||||
{
|
||||
OSG_INFO<<"Closing still viable window "<<sharedContextExists<<" _state->getContextID()="<<_state->getContextID()<<std::endl;
|
||||
@@ -557,7 +560,14 @@ void GraphicsContext::close(bool callCloseImplementation)
|
||||
{
|
||||
OSG_INFO<<"Doing delete of GL objects"<<std::endl;
|
||||
|
||||
osg::deleteAllGLObjects(_state->getContextID());
|
||||
_state->reset();
|
||||
|
||||
// Kill the State now so all the (directly or indirectly) referenced GLObjects can make it into delete cache in time.
|
||||
// That way osg::deleteAllGLObjects won't miss them and left them to be deleted afterwards in a new GraphicsContext
|
||||
// that happens to have the same contextID (see SceneView::draw() and _requiresFlush flag).
|
||||
_state = 0;
|
||||
|
||||
osg::deleteAllGLObjects(contextID);
|
||||
|
||||
OSG_INFO<<"Done delete of GL objects"<<std::endl;
|
||||
}
|
||||
@@ -567,9 +577,9 @@ void GraphicsContext::close(bool callCloseImplementation)
|
||||
// which have already been deleted
|
||||
|
||||
osg::flushAllDeletedGLObjects(_state->getContextID());
|
||||
}
|
||||
|
||||
_state->reset();
|
||||
_state->reset();
|
||||
}
|
||||
|
||||
releaseContext();
|
||||
}
|
||||
@@ -585,18 +595,18 @@ void GraphicsContext::close(bool callCloseImplementation)
|
||||
// now discard any deleted deleted OpenGL objects that the are still hanging around - such as due to
|
||||
// the the flushDelete*() methods not being invoked, such as when using GraphicContextEmbedded where makeCurrent
|
||||
// does not work.
|
||||
if ( !sharedContextExists && _state.valid())
|
||||
if ( !sharedContextExists && contextIDValid)
|
||||
{
|
||||
OSG_INFO<<"Doing discard of deleted OpenGL objects."<<std::endl;
|
||||
|
||||
osg::discardAllGLObjects(_state->getContextID());
|
||||
osg::discardAllGLObjects(contextID);
|
||||
}
|
||||
|
||||
if (_state.valid())
|
||||
if (contextIDValid)
|
||||
{
|
||||
decrementContextIDUsageCount(_state->getContextID());
|
||||
decrementContextIDUsageCount(contextID);
|
||||
|
||||
_state = 0;
|
||||
if (_state.valid()) _state = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -752,18 +762,6 @@ void GraphicsContext::removeAllOperations()
|
||||
_operationsBlock->set(false);
|
||||
}
|
||||
|
||||
|
||||
struct CameraRenderOrderSortOp
|
||||
{
|
||||
inline bool operator() (const Camera* lhs,const Camera* rhs) const
|
||||
{
|
||||
if (lhs->getRenderOrder()<rhs->getRenderOrder()) return true;
|
||||
if (rhs->getRenderOrder()<lhs->getRenderOrder()) return false;
|
||||
return lhs->getRenderOrderNum()<rhs->getRenderOrderNum();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
void GraphicsContext::runOperations()
|
||||
{
|
||||
// sort the cameras into order
|
||||
|
||||
@@ -239,7 +239,7 @@ Image::Image(const Image& image,const CopyOp& copyop):
|
||||
{
|
||||
if (image._data)
|
||||
{
|
||||
int size = image.getTotalSizeInBytesIncludingMipmaps();
|
||||
unsigned int size = image.getTotalSizeInBytesIncludingMipmaps();
|
||||
setData(new unsigned char [size],USE_NEW_DELETE);
|
||||
unsigned char* dest_ptr = _data;
|
||||
for(DataIterator itr(&image); itr.valid(); ++itr)
|
||||
|
||||
@@ -396,17 +396,8 @@ void ImageSequence::update(osg::NodeVisitor* nv)
|
||||
if (startLoadIndex<0) startLoadIndex = 0;
|
||||
|
||||
int endLoadIndex = int(preLoadTime/_timePerImage);
|
||||
if (endLoadIndex>=int(_imageDataList.size()))
|
||||
{
|
||||
if (looping)
|
||||
{
|
||||
endLoadIndex -= int(_imageDataList.size());
|
||||
}
|
||||
else
|
||||
{
|
||||
endLoadIndex = int(_imageDataList.size())-1;
|
||||
}
|
||||
}
|
||||
if (looping && (endLoadIndex>=int(_imageDataList.size()))) endLoadIndex -= int(_imageDataList.size());
|
||||
if (endLoadIndex>=int(_imageDataList.size())) endLoadIndex = int(_imageDataList.size())-1;
|
||||
if (endLoadIndex<0) endLoadIndex = 0;
|
||||
|
||||
double requestTime = time;
|
||||
|
||||
@@ -71,7 +71,7 @@ struct TriangleIndicesCollector
|
||||
const osg::Vec3& v2 = (*(_buildKdTree->_kdTree.getVertices()))[p2];
|
||||
|
||||
// discard degenerate points
|
||||
if (v0==v1 || v1==v2 || v1==v2)
|
||||
if (v0==v1 || v1==v2 || v2==v0)
|
||||
{
|
||||
//OSG_NOTICE<<"Disgarding degenerate triangle"<<std::endl;
|
||||
return;
|
||||
|
||||
@@ -475,7 +475,11 @@ bool Node::containsOccluderNodes() const
|
||||
|
||||
void Node::setDescriptions(const DescriptionList& descriptions)
|
||||
{
|
||||
getOrCreateUserDataContainer()->setDescriptions(descriptions);
|
||||
// only assign a description list (and associated UseDataContainer) if we need to.
|
||||
if (!descriptions.empty() || getUserDataContainer())
|
||||
{
|
||||
getOrCreateUserDataContainer()->setDescriptions(descriptions);
|
||||
}
|
||||
}
|
||||
|
||||
Node::DescriptionList& Node::getDescriptions()
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace osg
|
||||
class NullStreamBuffer : public std::streambuf
|
||||
{
|
||||
private:
|
||||
std::streamsize xsputn(const std::streambuf::char_type */*str*/, std::streamsize n)
|
||||
std::streamsize xsputn(const std::streambuf::char_type * /*str*/, std::streamsize n)
|
||||
{
|
||||
return n;
|
||||
}
|
||||
|
||||
@@ -44,17 +44,31 @@ bool PointSprite::checkValidityOfAssociatedModes(osg::State& state) const
|
||||
{
|
||||
|
||||
bool modeValid = isPointSpriteSupported(state.getContextID());
|
||||
state.setModeValidity(GL_POINT_SPRITE_ARB, modeValid);
|
||||
|
||||
#if defined( OSG_GLES1_AVAILABLE ) //point sprites don't exist on es 2.0
|
||||
state.setModeValidity(GL_POINT_SPRITE_OES, modeValid);
|
||||
#else
|
||||
state.setModeValidity(GL_POINT_SPRITE_ARB, modeValid);
|
||||
#endif
|
||||
|
||||
return modeValid;
|
||||
}
|
||||
|
||||
void PointSprite::apply(osg::State& state) const
|
||||
{
|
||||
#if defined( OSG_GL3_AVAILABLE )
|
||||
|
||||
const Point::Extensions* extensions = Point::getExtensions(state.getContextID(),true);
|
||||
extensions->glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN,_coordOriginMode);
|
||||
|
||||
#elif defined( OSG_GLES1_AVAILABLE ) //point sprites don't exist on es 2.0
|
||||
|
||||
if(!isPointSpriteSupported(state.getContextID())) return;
|
||||
|
||||
glTexEnvi(GL_POINT_SPRITE_OES, GL_COORD_REPLACE_OES, 1);
|
||||
|
||||
#elif defined( OSG_GL_FIXED_FUNCTION_AVAILABLE )
|
||||
|
||||
if(!isPointSpriteSupported(state.getContextID())) return;
|
||||
|
||||
glTexEnvi(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, 1);
|
||||
@@ -63,8 +77,10 @@ void PointSprite::apply(osg::State& state) const
|
||||
|
||||
if (extensions->isPointSpriteCoordOriginSupported())
|
||||
extensions->glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN,_coordOriginMode);
|
||||
|
||||
#else
|
||||
OSG_NOTICE<<"Warning: PointSprite::apply(State&) - not supported."<<std::endl;
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -86,7 +102,7 @@ bool PointSprite::isPointSpriteSupported(unsigned int contextID)
|
||||
if (!s_extensions[contextID].initialized)
|
||||
{
|
||||
s_extensions[contextID].initialized = true;
|
||||
s_extensions[contextID].supported = OSG_GL3_FEATURES || isGLExtensionSupported(contextID, "GL_ARB_point_sprite") || isGLExtensionSupported(contextID, "GL_NV_point_sprite");
|
||||
s_extensions[contextID].supported = OSG_GL3_FEATURES || isGLExtensionSupported(contextID, "GL_ARB_point_sprite") || isGLExtensionSupported(contextID, "GL_OES_point_sprite") || isGLExtensionSupported(contextID, "GL_NV_point_sprite");
|
||||
}
|
||||
|
||||
return s_extensions[contextID].supported;
|
||||
|
||||
@@ -515,8 +515,8 @@ const Program::UniformBlockMap& Program::getUniformBlocks(unsigned contextID) co
|
||||
|
||||
Program::PerContextProgram::PerContextProgram(const Program* program, unsigned int contextID, GLuint programHandle ) :
|
||||
osg::Referenced(),
|
||||
_loadedBinary(false),
|
||||
_glProgramHandle(programHandle),
|
||||
_loadedBinary(false),
|
||||
_contextID( contextID ),
|
||||
_ownsProgramHandle(false)
|
||||
{
|
||||
@@ -674,7 +674,7 @@ void Program::PerContextProgram::linkProgram(osg::State& state)
|
||||
_extensions->glGetProgramiv(_glProgramHandle, GL_ACTIVE_UNIFORM_BLOCKS,
|
||||
reinterpret_cast<GLint*>(&activeUniformBlocks));
|
||||
_extensions->glGetProgramiv(_glProgramHandle,
|
||||
GL_ACTIVE_UNIFORM_MAX_LENGTH,
|
||||
GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH,
|
||||
&maxBlockNameLen);
|
||||
if (maxBlockNameLen > 0)
|
||||
{
|
||||
|
||||
@@ -402,7 +402,7 @@ int Sequence::_getNextValue()
|
||||
int _sbegin = osg::minimum(_ubegin,_uend);
|
||||
int _send = osg::maximum(_ubegin,_uend);
|
||||
|
||||
int v = _value + _step;
|
||||
int v = _value + _step * static_cast<int>(osg::sign(_speed));
|
||||
|
||||
if (_sbegin==_send)
|
||||
{
|
||||
|
||||
@@ -484,12 +484,18 @@ void State::apply(const StateSet* dstate)
|
||||
else if (unit<_textureAttributeMapList.size()) applyAttributeMapOnTexUnit(unit,_textureAttributeMapList[unit]);
|
||||
}
|
||||
|
||||
const Program::PerContextProgram* previousLastAppliedProgramObject = _lastAppliedProgramObject;
|
||||
|
||||
applyModeList(_modeMap,dstate->getModeList());
|
||||
applyAttributeList(_attributeMap,dstate->getAttributeList());
|
||||
|
||||
if (_shaderCompositionEnabled)
|
||||
{
|
||||
applyShaderComposition();
|
||||
if (previousLastAppliedProgramObject == _lastAppliedProgramObject || _lastAppliedProgramObject==0)
|
||||
{
|
||||
// No program has been applied by the StateSet stack so assume shader composition is required
|
||||
applyShaderComposition();
|
||||
}
|
||||
}
|
||||
|
||||
if (dstate->getUniformList().empty())
|
||||
@@ -911,7 +917,10 @@ void State::initializeExtensionProcs()
|
||||
if ( osg::getGLVersionNumber() >= 2.0 || osg::isGLExtensionSupported(_contextID,"GL_ARB_vertex_shader") || OSG_GLES2_FEATURES)
|
||||
{
|
||||
glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS,&_glMaxTextureUnits);
|
||||
glGetIntegerv(GL_MAX_TEXTURE_COORDS,&_glMaxTextureCoords);
|
||||
if(OSG_GLES2_FEATURES)
|
||||
_glMaxTextureCoords = _glMaxTextureUnits;
|
||||
else
|
||||
glGetIntegerv(GL_MAX_TEXTURE_COORDS,&_glMaxTextureCoords);
|
||||
}
|
||||
else if ( osg::getGLVersionNumber() >= 1.3 ||
|
||||
osg::isGLExtensionSupported(_contextID,"GL_ARB_multitexture") ||
|
||||
@@ -1322,6 +1331,9 @@ namespace State_Utils
|
||||
{
|
||||
bool replace(std::string& str, const std::string& original_phrase, const std::string& new_phrase)
|
||||
{
|
||||
// Prevent infinite loop : if original_phrase is empty, do nothing and return false
|
||||
if (original_phrase.empty()) return false;
|
||||
|
||||
bool replacedStr = false;
|
||||
std::string::size_type pos = 0;
|
||||
while((pos=str.find(original_phrase, pos))!=std::string::npos)
|
||||
@@ -1360,9 +1372,6 @@ bool State::convertVertexShaderSourceToOsgBuiltIns(std::string& source) const
|
||||
|
||||
OSG_INFO<<"++Before Converted source "<<std::endl<<source<<std::endl<<"++++++++"<<std::endl;
|
||||
|
||||
// replace ftransform as it only works with built-ins
|
||||
State_Utils::replace(source, "ftransform()", "gl_ModelViewProjectionMatrix * gl_Vertex");
|
||||
|
||||
// find the first legal insertion point for replacement declarations. GLSL requires that nothing
|
||||
// precede a "#verson" compiler directive, so we must insert new declarations after it.
|
||||
std::string::size_type declPos = source.rfind( "#version " );
|
||||
@@ -1377,22 +1386,31 @@ bool State::convertVertexShaderSourceToOsgBuiltIns(std::string& source) const
|
||||
declPos = 0;
|
||||
}
|
||||
|
||||
State_Utils::replaceAndInsertDeclaration(source, declPos, _vertexAlias._glName, _vertexAlias._osgName, _vertexAlias._declaration);
|
||||
State_Utils::replaceAndInsertDeclaration(source, declPos, _normalAlias._glName, _normalAlias._osgName, _normalAlias._declaration);
|
||||
State_Utils::replaceAndInsertDeclaration(source, declPos, _colorAlias._glName, _colorAlias._osgName, _colorAlias._declaration);
|
||||
State_Utils::replaceAndInsertDeclaration(source, declPos, _secondaryColorAlias._glName, _secondaryColorAlias._osgName, _secondaryColorAlias._declaration);
|
||||
State_Utils::replaceAndInsertDeclaration(source, declPos, _fogCoordAlias._glName, _fogCoordAlias._osgName, _fogCoordAlias._declaration);
|
||||
for (size_t i=0; i<_texCoordAliasList.size(); i++)
|
||||
if (_useVertexAttributeAliasing)
|
||||
{
|
||||
const VertexAttribAlias& texCoordAlias = _texCoordAliasList[i];
|
||||
State_Utils::replaceAndInsertDeclaration(source, declPos, texCoordAlias._glName, texCoordAlias._osgName, texCoordAlias._declaration);
|
||||
State_Utils::replaceAndInsertDeclaration(source, declPos, _vertexAlias._glName, _vertexAlias._osgName, _vertexAlias._declaration);
|
||||
State_Utils::replaceAndInsertDeclaration(source, declPos, _normalAlias._glName, _normalAlias._osgName, _normalAlias._declaration);
|
||||
State_Utils::replaceAndInsertDeclaration(source, declPos, _colorAlias._glName, _colorAlias._osgName, _colorAlias._declaration);
|
||||
State_Utils::replaceAndInsertDeclaration(source, declPos, _secondaryColorAlias._glName, _secondaryColorAlias._osgName, _secondaryColorAlias._declaration);
|
||||
State_Utils::replaceAndInsertDeclaration(source, declPos, _fogCoordAlias._glName, _fogCoordAlias._osgName, _fogCoordAlias._declaration);
|
||||
for (size_t i=0; i<_texCoordAliasList.size(); i++)
|
||||
{
|
||||
const VertexAttribAlias& texCoordAlias = _texCoordAliasList[i];
|
||||
State_Utils::replaceAndInsertDeclaration(source, declPos, texCoordAlias._glName, texCoordAlias._osgName, texCoordAlias._declaration);
|
||||
}
|
||||
}
|
||||
|
||||
// replace built in uniform
|
||||
State_Utils::replaceAndInsertDeclaration(source, declPos, "gl_ModelViewMatrix", "osg_ModelViewMatrix", "uniform mat4 ");
|
||||
State_Utils::replaceAndInsertDeclaration(source, declPos, "gl_ModelViewProjectionMatrix", "osg_ModelViewProjectionMatrix", "uniform mat4 ");
|
||||
State_Utils::replaceAndInsertDeclaration(source, declPos, "gl_ProjectionMatrix", "osg_ProjectionMatrix", "uniform mat4 ");
|
||||
State_Utils::replaceAndInsertDeclaration(source, declPos, "gl_NormalMatrix", "osg_NormalMatrix", "uniform mat3 ");
|
||||
if (_useModelViewAndProjectionUniforms)
|
||||
{
|
||||
// replace ftransform as it only works with built-ins
|
||||
State_Utils::replace(source, "ftransform()", "gl_ModelViewProjectionMatrix * gl_Vertex");
|
||||
|
||||
// replace built in uniform
|
||||
State_Utils::replaceAndInsertDeclaration(source, declPos, "gl_ModelViewMatrix", "osg_ModelViewMatrix", "uniform mat4 ");
|
||||
State_Utils::replaceAndInsertDeclaration(source, declPos, "gl_ModelViewProjectionMatrix", "osg_ModelViewProjectionMatrix", "uniform mat4 ");
|
||||
State_Utils::replaceAndInsertDeclaration(source, declPos, "gl_ProjectionMatrix", "osg_ProjectionMatrix", "uniform mat4 ");
|
||||
State_Utils::replaceAndInsertDeclaration(source, declPos, "gl_NormalMatrix", "osg_NormalMatrix", "uniform mat3 ");
|
||||
}
|
||||
|
||||
OSG_INFO<<"-------- Converted source "<<std::endl<<source<<std::endl<<"----------------"<<std::endl;
|
||||
|
||||
|
||||
@@ -54,6 +54,7 @@ class TextureGLModeSet
|
||||
_textureModeSet.insert(GL_TEXTURE_CUBE_MAP);
|
||||
_textureModeSet.insert(GL_TEXTURE_RECTANGLE_NV);
|
||||
_textureModeSet.insert(GL_TEXTURE_2D_ARRAY_EXT);
|
||||
_textureModeSet.insert(GL_TEXTURE_2D_MULTISAMPLE);
|
||||
|
||||
_textureModeSet.insert(GL_TEXTURE_GEN_Q);
|
||||
_textureModeSet.insert(GL_TEXTURE_GEN_R);
|
||||
@@ -274,6 +275,32 @@ int StateSet::compare(const StateSet& rhs,bool compareAttributeContents) const
|
||||
if (_textureAttributeList.size()<rhs._textureAttributeList.size()) return -1;
|
||||
if (_textureAttributeList.size()>rhs._textureAttributeList.size()) return 1;
|
||||
|
||||
if (_textureModeList.size()<rhs._textureModeList.size()) return -1;
|
||||
if (_textureModeList.size()>rhs._textureModeList.size()) return 1;
|
||||
|
||||
if (_attributeList.size()<rhs._attributeList.size()) return -1;
|
||||
if (_attributeList.size()>rhs._attributeList.size()) return 1;
|
||||
|
||||
if (_modeList.size()<rhs._modeList.size()) return -1;
|
||||
if (_modeList.size()>rhs._modeList.size()) return 1;
|
||||
|
||||
if (_uniformList.size()<rhs._uniformList.size()) return -1;
|
||||
if (_uniformList.size()>rhs._uniformList.size()) return 1;
|
||||
|
||||
// check render bin details
|
||||
|
||||
if ( _binMode < rhs._binMode ) return -1;
|
||||
else if ( _binMode > rhs._binMode ) return 1;
|
||||
|
||||
if ( _binMode != INHERIT_RENDERBIN_DETAILS )
|
||||
{
|
||||
if ( _binNum < rhs._binNum ) return -1;
|
||||
else if ( _binNum > rhs._binNum ) return 1;
|
||||
|
||||
if ( _binName < rhs._binName ) return -1;
|
||||
else if ( _binName > rhs._binName ) return 1;
|
||||
}
|
||||
|
||||
for(unsigned int ai=0;ai<_textureAttributeList.size();++ai)
|
||||
{
|
||||
const AttributeList& rhs_attributeList = _textureAttributeList[ai];
|
||||
@@ -373,10 +400,6 @@ int StateSet::compare(const StateSet& rhs,bool compareAttributeContents) const
|
||||
|
||||
// we've got here so attributes must be equal...
|
||||
|
||||
|
||||
if (_textureModeList.size()<rhs._textureModeList.size()) return -1;
|
||||
if (_textureModeList.size()>rhs._textureModeList.size()) return 1;
|
||||
|
||||
// check to see how the modes compare.
|
||||
// first check the rest of the texture modes
|
||||
for(unsigned int ti=0;ti<_textureModeList.size();++ti)
|
||||
@@ -441,20 +464,6 @@ int StateSet::compare(const StateSet& rhs,bool compareAttributeContents) const
|
||||
}
|
||||
else if (rhs_uniform_itr == rhs._uniformList.end()) return 1;
|
||||
|
||||
// check render bin details
|
||||
|
||||
if ( _binMode < rhs._binMode ) return -1;
|
||||
else if ( _binMode > rhs._binMode ) return 1;
|
||||
|
||||
if ( _binMode != INHERIT_RENDERBIN_DETAILS )
|
||||
{
|
||||
if ( _binNum < rhs._binNum ) return -1;
|
||||
else if ( _binNum > rhs._binNum ) return 1;
|
||||
|
||||
if ( _binName < rhs._binName ) return -1;
|
||||
else if ( _binName > rhs._binName ) return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -2351,7 +2351,7 @@ bool Texture::isHardwareMipmapGenerationEnabled(const State& state) const
|
||||
|
||||
const FBOExtensions* fbo_ext = FBOExtensions::instance(contextID,true);
|
||||
|
||||
if (fbo_ext->glGenerateMipmap)
|
||||
if (fbo_ext->isSupported() && fbo_ext->glGenerateMipmap)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -2368,7 +2368,8 @@ Texture::GenerateMipmapMode Texture::mipmapBeforeTexImage(const State& state, bo
|
||||
return GENERATE_MIPMAP;
|
||||
#else
|
||||
|
||||
bool useGenerateMipMap = FBOExtensions::instance(state.getContextID(), true)->glGenerateMipmap!=0;
|
||||
FBOExtensions* fbo_ext = FBOExtensions::instance(state.getContextID(),true);
|
||||
bool useGenerateMipMap = fbo_ext->isSupported() && fbo_ext->glGenerateMipmap;
|
||||
|
||||
if (useGenerateMipMap)
|
||||
{
|
||||
@@ -2440,7 +2441,7 @@ void Texture::generateMipmap(State& state) const
|
||||
osg::FBOExtensions* fbo_ext = osg::FBOExtensions::instance(state.getContextID(), true);
|
||||
|
||||
// check if the function is supported
|
||||
if (fbo_ext->glGenerateMipmap)
|
||||
if (fbo_ext->isSupported() && fbo_ext->glGenerateMipmap)
|
||||
{
|
||||
textureObject->bind();
|
||||
fbo_ext->glGenerateMipmap(textureObject->target());
|
||||
|
||||
@@ -249,7 +249,7 @@ void Texture2DArray::apply(State& state) const
|
||||
// compute the dimensions of the texture.
|
||||
computeRequiredTextureDimensions(state, *image, new_width, new_height, new_numMipmapLevels);
|
||||
|
||||
if (!textureObject->match(GL_TEXTURE_2D_ARRAY_EXT, new_numMipmapLevels, _internalFormat, new_width, new_height, 1, _borderWidth))
|
||||
if (!textureObject->match(GL_TEXTURE_2D_ARRAY_EXT, new_numMipmapLevels, _internalFormat, new_width, new_height, _textureDepth, _borderWidth))
|
||||
{
|
||||
Texture::releaseTextureObject(contextID, _textureObjectBuffer[contextID].get());
|
||||
_textureObjectBuffer[contextID] = 0;
|
||||
|
||||
@@ -2153,7 +2153,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix2& m2 ) const
|
||||
{
|
||||
if( index>=getNumElements() || !isCompatibleType(FLOAT_MAT2) ) return false;
|
||||
unsigned int j = index * getTypeNumComponents(getType());
|
||||
m2.base_class::set( &((*_floatArray)[j]) );
|
||||
m2.Matrix2::base_class::set( &((*_floatArray)[j]) );
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2161,7 +2161,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix3& m3 ) const
|
||||
{
|
||||
if( index>=getNumElements() || !isCompatibleType(FLOAT_MAT3) ) return false;
|
||||
unsigned int j = index * getTypeNumComponents(getType());
|
||||
m3.base_class::set( &((*_floatArray)[j]) );
|
||||
m3.Matrix3::base_class::set( &((*_floatArray)[j]) );
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2177,7 +2177,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix2x3& m2x3 ) const
|
||||
{
|
||||
if( index>=getNumElements() || !isCompatibleType(FLOAT_MAT2x3) ) return false;
|
||||
unsigned int j = index * getTypeNumComponents(getType());
|
||||
m2x3.base_class::set( &((*_floatArray)[j]) );
|
||||
m2x3.Matrix2x3::base_class::set( &((*_floatArray)[j]) );
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2185,7 +2185,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix2x4& m2x4 ) const
|
||||
{
|
||||
if( index>=getNumElements() || !isCompatibleType(FLOAT_MAT2x4) ) return false;
|
||||
unsigned int j = index * getTypeNumComponents(getType());
|
||||
m2x4.base_class::set( &((*_floatArray)[j]) );
|
||||
m2x4.Matrix2x4::base_class::set( &((*_floatArray)[j]) );
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2193,7 +2193,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix3x2& m3x2 ) const
|
||||
{
|
||||
if( index>=getNumElements() || !isCompatibleType(FLOAT_MAT3x2) ) return false;
|
||||
unsigned int j = index * getTypeNumComponents(getType());
|
||||
m3x2.base_class::set( &((*_floatArray)[j]) );
|
||||
m3x2.Matrix3x2::base_class::set( &((*_floatArray)[j]) );
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2201,7 +2201,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix3x4& m3x4 ) const
|
||||
{
|
||||
if( index>=getNumElements() || !isCompatibleType(FLOAT_MAT3x4) ) return false;
|
||||
unsigned int j = index * getTypeNumComponents(getType());
|
||||
m3x4.base_class::set( &((*_floatArray)[j]) );
|
||||
m3x4.Matrix3x4::base_class::set( &((*_floatArray)[j]) );
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2209,7 +2209,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix4x2& m4x2 ) const
|
||||
{
|
||||
if( index>=getNumElements() || !isCompatibleType(FLOAT_MAT4x2) ) return false;
|
||||
unsigned int j = index * getTypeNumComponents(getType());
|
||||
m4x2.base_class::set( &((*_floatArray)[j]) );
|
||||
m4x2.Matrix4x2::base_class::set( &((*_floatArray)[j]) );
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2217,7 +2217,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix4x3& m4x3 ) const
|
||||
{
|
||||
if( index>=getNumElements() || !isCompatibleType(FLOAT_MAT4x3) ) return false;
|
||||
unsigned int j = index * getTypeNumComponents(getType());
|
||||
m4x3.base_class::set( &((*_floatArray)[j]) );
|
||||
m4x3.Matrix4x3::base_class::set( &((*_floatArray)[j]) );
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2263,7 +2263,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix2d& m2 ) const
|
||||
{
|
||||
if( index>=getNumElements() || !isCompatibleType(DOUBLE_MAT2) ) return false;
|
||||
unsigned int j = index * getTypeNumComponents(getType());
|
||||
m2.base_class::set( &((*_doubleArray)[j]) );
|
||||
m2.Matrix2d::base_class::set( &((*_doubleArray)[j]) );
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2271,7 +2271,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix3d& m3 ) const
|
||||
{
|
||||
if( index>=getNumElements() || !isCompatibleType(DOUBLE_MAT3) ) return false;
|
||||
unsigned int j = index * getTypeNumComponents(getType());
|
||||
m3.base_class::set( &((*_doubleArray)[j]) );
|
||||
m3.Matrix3d::base_class::set( &((*_doubleArray)[j]) );
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2291,7 +2291,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix2x3d& m2x3 ) const
|
||||
{
|
||||
if( index>=getNumElements() || !isCompatibleType(DOUBLE_MAT2x3) ) return false;
|
||||
unsigned int j = index * getTypeNumComponents(getType());
|
||||
m2x3.base_class::set( &((*_doubleArray)[j]) );
|
||||
m2x3.Matrix2x3d::base_class::set( &((*_doubleArray)[j]) );
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2299,7 +2299,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix2x4d& m2x4 ) const
|
||||
{
|
||||
if( index>=getNumElements() || !isCompatibleType(DOUBLE_MAT2x4) ) return false;
|
||||
unsigned int j = index * getTypeNumComponents(getType());
|
||||
m2x4.base_class::set( &((*_doubleArray)[j]) );
|
||||
m2x4.Matrix2x4d::base_class::set( &((*_doubleArray)[j]) );
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2307,7 +2307,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix3x2d& m3x2 ) const
|
||||
{
|
||||
if( index>=getNumElements() || !isCompatibleType(DOUBLE_MAT3x2) ) return false;
|
||||
unsigned int j = index * getTypeNumComponents(getType());
|
||||
m3x2.base_class::set( &((*_doubleArray)[j]) );
|
||||
m3x2.Matrix3x2d::base_class::set( &((*_doubleArray)[j]) );
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2315,7 +2315,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix3x4d& m3x4 ) const
|
||||
{
|
||||
if( index>=getNumElements() || !isCompatibleType(DOUBLE_MAT3x4) ) return false;
|
||||
unsigned int j = index * getTypeNumComponents(getType());
|
||||
m3x4.base_class::set( &((*_doubleArray)[j]) );
|
||||
m3x4.Matrix3x4d::base_class::set( &((*_doubleArray)[j]) );
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2323,7 +2323,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix4x2d& m4x2 ) const
|
||||
{
|
||||
if( index>=getNumElements() || !isCompatibleType(DOUBLE_MAT4x2) ) return false;
|
||||
unsigned int j = index * getTypeNumComponents(getType());
|
||||
m4x2.base_class::set( &((*_doubleArray)[j]) );
|
||||
m4x2.Matrix4x2d::base_class::set( &((*_doubleArray)[j]) );
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2331,7 +2331,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix4x3d& m4x3 ) const
|
||||
{
|
||||
if( index>=getNumElements() || !isCompatibleType(DOUBLE_MAT4x3) ) return false;
|
||||
unsigned int j = index * getTypeNumComponents(getType());
|
||||
m4x3.base_class::set( &((*_doubleArray)[j]) );
|
||||
m4x3.Matrix4x3d::base_class::set( &((*_doubleArray)[j]) );
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -150,4 +150,4 @@ const GLubyte* gluErrorString(GLenum errorCode)
|
||||
return (const GLubyte *) 0;
|
||||
}
|
||||
|
||||
} // end of namespace osg
|
||||
} // end of namespace osg
|
||||
|
||||
@@ -908,10 +908,11 @@ static void halveImage_uint(GLint components, GLuint width, GLuint height,
|
||||
for (j = 0; j < newwidth; j++) {
|
||||
for (k = 0; k < components; k++) {
|
||||
/* need to cast to double to hold large unsigned ints */
|
||||
s[0] = ((double)*(const GLuint*)t +
|
||||
(double)*(const GLuint*)(t+group_size) +
|
||||
(double)*(const GLuint*)(t+ysize) +
|
||||
(double)*(const GLuint*)(t+ysize+group_size))/4 + 0.5;
|
||||
GLdouble buf = (double)*(const GLuint*)t +
|
||||
(double)*(const GLuint*)(t+group_size) +
|
||||
(double)*(const GLuint*)(t+ysize) +
|
||||
(double)*(const GLuint*)(t+ysize+group_size);
|
||||
s[0] = (GLuint)(buf/4.0 + 0.5);
|
||||
s++; t += element_size;
|
||||
|
||||
}
|
||||
@@ -925,12 +926,11 @@ static void halveImage_uint(GLint components, GLuint width, GLuint height,
|
||||
for (j = 0; j < newwidth; j++) {
|
||||
for (k = 0; k < components; k++) {
|
||||
/* need to cast to double to hold large unsigned ints */
|
||||
GLdouble buf;
|
||||
buf = (GLdouble)__GLU_SWAP_4_BYTES(t) +
|
||||
(GLdouble)__GLU_SWAP_4_BYTES(t+group_size) +
|
||||
(GLdouble)__GLU_SWAP_4_BYTES(t+ysize) +
|
||||
(GLdouble)__GLU_SWAP_4_BYTES(t+ysize+group_size);
|
||||
s[0] = (GLuint)(buf/4 + 0.5);
|
||||
GLdouble buf = (GLdouble)__GLU_SWAP_4_BYTES(t) +
|
||||
(GLdouble)__GLU_SWAP_4_BYTES(t+group_size) +
|
||||
(GLdouble)__GLU_SWAP_4_BYTES(t+ysize) +
|
||||
(GLdouble)__GLU_SWAP_4_BYTES(t+ysize+group_size);
|
||||
s[0] = (GLuint)(buf/4.0 + 0.5);
|
||||
|
||||
s++; t += element_size;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ void LinkVisitor::link(AnimationUpdateCallbackBase* cb)
|
||||
result += cb->link(_animations[i].get());
|
||||
_nbLinkedTarget += result;
|
||||
}
|
||||
OSG_NOTICE << "LinkVisitor links " << result << " for \"" << cb->getName() << '"' << std::endl;
|
||||
OSG_DEBUG << "LinkVisitor links " << result << " for \"" << cb->getName() << '"' << std::endl;
|
||||
}
|
||||
|
||||
void LinkVisitor::handle_stateset(osg::StateSet* stateset)
|
||||
|
||||
@@ -109,7 +109,7 @@ void RigGeometry::buildVertexInfluenceSet()
|
||||
|
||||
_vertexInfluenceSet.buildVertex2BoneList();
|
||||
_vertexInfluenceSet.buildUniqVertexSetToBoneSetList();
|
||||
OSG_NOTICE << "uniq groups " << _vertexInfluenceSet.getUniqVertexSetToBoneSetList().size() << " for " << getName() << std::endl;
|
||||
OSG_DEBUG << "uniq groups " << _vertexInfluenceSet.getUniqVertexSetToBoneSetList().size() << " for " << getName() << std::endl;
|
||||
}
|
||||
|
||||
void RigGeometry::computeMatrixFromRootSkeleton()
|
||||
|
||||
@@ -152,7 +152,7 @@ RigTransformHardware::BoneWeightAttribList RigTransformHardware::createVertexAtt
|
||||
arrayList.resize(nbArray);
|
||||
for (int i = 0; i < nbArray; i++)
|
||||
{
|
||||
osg::ref_ptr<osg::Vec4Array> array = new osg::Vec4Array;
|
||||
osg::ref_ptr<osg::Vec4Array> array = new osg::Vec4Array(osg::Array::BIND_PER_VERTEX);
|
||||
arrayList[i] = array;
|
||||
int nbVertexes = getNumVertexes();
|
||||
array->resize(nbVertexes);
|
||||
|
||||
@@ -18,8 +18,7 @@ using namespace osgAnimation;
|
||||
|
||||
StackedTransform::StackedTransform() {}
|
||||
|
||||
StackedTransform::StackedTransform(const StackedTransform& rhs, const osg::CopyOp& co):
|
||||
osg::MixinVector<osg::ref_ptr<StackedTransformElement> >(rhs)
|
||||
StackedTransform::StackedTransform(const StackedTransform& rhs, const osg::CopyOp& co)
|
||||
{
|
||||
reserve(rhs.size());
|
||||
for (StackedTransform::const_iterator it = rhs.begin(); it != rhs.end(); ++it)
|
||||
|
||||
@@ -124,7 +124,7 @@ SET(TARGET_SRC
|
||||
IF(APPLE AND NOT ANDROID)
|
||||
IF(NOT OSG_BUILD_PLATFORM_IPHONE AND NOT OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
|
||||
# Needs CoreFoundation calls and a Carbon function
|
||||
SET(OSGDB_PLATFORM_SPECIFIC_LIBRARIES ${CARBON_LIBRARY})
|
||||
SET(OSGDB_PLATFORM_SPECIFIC_LIBRARIES ${CARBON_LIBRARY} ${COCOA_LIBRARY})
|
||||
ENDIF()
|
||||
|
||||
IF(OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX STREQUAL "quicktime")
|
||||
|
||||
@@ -209,8 +209,13 @@ bool osgDB::makeDirectory( const std::string &path )
|
||||
if( mkdir( dir.c_str(), 0755 )< 0 )
|
||||
#endif
|
||||
{
|
||||
OSG_DEBUG << "osgDB::makeDirectory(): " << strerror(errno) << std::endl;
|
||||
return false;
|
||||
// Only return an error if the directory actually doesn't exist. It's possible that the directory was created
|
||||
// by another thread or process
|
||||
if (!osgDB::fileExists(dir))
|
||||
{
|
||||
OSG_DEBUG << "osgDB::makeDirectory(): " << strerror(errno) << std::endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
paths.pop();
|
||||
}
|
||||
|
||||
@@ -639,7 +639,7 @@ osg::Image* InputStream::readImage(bool readFromExternal)
|
||||
image = new osg::Image;
|
||||
image->setOrigin( (osg::Image::Origin)origin );
|
||||
image->setImage( s, t, r, internalFormat, pixelFormat, dataType,
|
||||
(unsigned char*)data, (osg::Image::AllocationMode)mode, packing );
|
||||
(unsigned char*)data, osg::Image::USE_NEW_DELETE, packing );
|
||||
}
|
||||
|
||||
// _mipmapData
|
||||
|
||||
@@ -379,6 +379,9 @@ ObjectWrapperManager::ObjectWrapperManager()
|
||||
glTable.add( "GL_LIGHT6", GL_LIGHT6 );
|
||||
glTable.add( "GL_LIGHT7", GL_LIGHT7 );
|
||||
|
||||
glTable.add("GL_VERTEX_PROGRAM_POINT_SIZE", GL_VERTEX_PROGRAM_POINT_SIZE);
|
||||
glTable.add("GL_VERTEX_PROGRAM_TWO_SIDE", GL_VERTEX_PROGRAM_TWO_SIDE);
|
||||
|
||||
// Functions
|
||||
glTable.add( "NEVER", GL_NEVER );
|
||||
glTable.add( "LESS", GL_LESS );
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <osgDB/ObjectWrapper>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include <stdlib.h>
|
||||
|
||||
using namespace osgDB;
|
||||
|
||||
|
||||
@@ -414,7 +414,7 @@ Registry::Registry()
|
||||
addFileExtensionAlias("cid", "freetype"); // Postscript CID-Fonts
|
||||
addFileExtensionAlias("cff", "freetype"); // OpenType
|
||||
addFileExtensionAlias("cef", "freetype"); // OpenType
|
||||
addFileExtensionAlias("fon", "freetype"); // Windows bitmap fonts
|
||||
addFileExtensionAlias("fon", "freetype"); // Windows bitmap fonts
|
||||
addFileExtensionAlias("fnt", "freetype"); // Windows bitmap fonts
|
||||
addFileExtensionAlias("text3d", "freetype"); // use 3D Font instead of 2D Font
|
||||
|
||||
@@ -1040,7 +1040,7 @@ std::string Registry::findDataFileImplementation(const std::string& filename, co
|
||||
|
||||
if(fileExists(simpleFileName))
|
||||
{
|
||||
OSG_DEBUG << "FindFileInPath(" << filename << "): returning " << filename << std::endl;
|
||||
OSG_DEBUG << "FindFileInPath(" << filename << "): returning " << simpleFileName << std::endl;
|
||||
return simpleFileName;
|
||||
}
|
||||
|
||||
@@ -1249,9 +1249,21 @@ ReaderWriter::ReadResult Registry::readImplementation(const ReadFunctor& readFun
|
||||
ReaderWriter::ReadResult rr = read(readFunctor);
|
||||
if (rr.validObject())
|
||||
{
|
||||
// update cache with new entry.
|
||||
OSG_INFO<<"Adding to object cache "<<file<<std::endl;
|
||||
addEntryToObjectCache(file,rr.getObject());
|
||||
// search AGAIN for entry in the object cache.
|
||||
{
|
||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_objectCacheMutex);
|
||||
ObjectCache::iterator oitr = _objectCache.find(file);
|
||||
if (oitr != _objectCache.end())
|
||||
{
|
||||
OSG_INFO << "returning cached instanced of " << file << std::endl;
|
||||
if (readFunctor.isValid(oitr->second.first.get())) return ReaderWriter::ReadResult(oitr->second.first.get(), ReaderWriter::ReadResult::FILE_LOADED_FROM_CACHE);
|
||||
else return ReaderWriter::ReadResult("Error file does not contain an osg::Object");
|
||||
}
|
||||
// update cache with new entry.
|
||||
OSG_INFO<<"Adding to object cache "<<file<<std::endl;
|
||||
//addEntryToObjectCache(file,rr.getObject()); //copy implementation: we already have the _objectCacheMutex lock
|
||||
_objectCache[file] = ObjectTimeStampPair(rr.getObject(), 0.0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -49,10 +49,12 @@ std::string osgDB::trimEnclosingSpaces(const std::string& str)
|
||||
{
|
||||
if (str.empty()) return str;
|
||||
|
||||
std::string::size_type start = str.find_first_not_of(' ');
|
||||
const std::string whitespaces(" \t\f\v\n\r");
|
||||
|
||||
std::string::size_type start = str.find_first_not_of(whitespaces);
|
||||
if (start==std::string::npos) return std::string();
|
||||
|
||||
std::string::size_type end = str.find_last_not_of(' ');
|
||||
std::string::size_type end = str.find_last_not_of(whitespaces);
|
||||
if (end==std::string::npos) return std::string();
|
||||
|
||||
return std::string(str, start, (end-start)+1);
|
||||
|
||||
@@ -28,15 +28,15 @@ WriterCompareTriangle::operator()(const std::pair<Triangle, int> & t1,
|
||||
}
|
||||
|
||||
void
|
||||
WriterCompareTriangle::setMaxMin(unsigned int & nbVerticesX,
|
||||
unsigned int & nbVerticesY,
|
||||
unsigned int & nbVerticesZ) const
|
||||
WriterCompareTriangle::setMaxMin(int & nbVerticesX,
|
||||
int & nbVerticesY,
|
||||
int & nbVerticesZ) const
|
||||
{
|
||||
static const unsigned int min = 1;
|
||||
static const unsigned int max = 5; // Number of blocks used to divide the scene (arbitrary but seems ok)
|
||||
nbVerticesX = osg::clampBetween<unsigned int>(nbVerticesX, min, max);
|
||||
nbVerticesY = osg::clampBetween<unsigned int>(nbVerticesY, min, max);
|
||||
nbVerticesZ = osg::clampBetween<unsigned int>(nbVerticesZ, min, max);
|
||||
static const int min = 1;
|
||||
static const int max = 5; // Number of blocks used to divide the scene (arbitrary but seems ok)
|
||||
nbVerticesX = osg::clampBetween<int>(nbVerticesX, min, max);
|
||||
nbVerticesY = osg::clampBetween<int>(nbVerticesY, min, max);
|
||||
nbVerticesZ = osg::clampBetween<int>(nbVerticesZ, min, max);
|
||||
}
|
||||
|
||||
void WriterCompareTriangle::cutscene(int nbVertices, const osg::BoundingBox & sceneBox)
|
||||
@@ -45,9 +45,9 @@ void WriterCompareTriangle::cutscene(int nbVertices, const osg::BoundingBox & sc
|
||||
|
||||
static const float k = 1.3f; // Arbitrary constant multiplier for density computation ("simulates" non-uniform point distributions)
|
||||
// Computes "density" of points, and thus the number of blocks to divide the mesh into
|
||||
unsigned int nbVerticesX = static_cast<unsigned int>( (nbVertices * k) / (length.z() * length.y()) );
|
||||
unsigned int nbVerticesY = static_cast<unsigned int>( (nbVertices * k) / (length.z() * length.x()) );
|
||||
unsigned int nbVerticesZ = static_cast<unsigned int>( (nbVertices * k) / (length.x() * length.y()) );
|
||||
int nbVerticesX = static_cast<int>( (nbVertices * k) / (length.z() * length.y()) );
|
||||
int nbVerticesY = static_cast<int>( (nbVertices * k) / (length.z() * length.x()) );
|
||||
int nbVerticesZ = static_cast<int>( (nbVertices * k) / (length.x() * length.y()) );
|
||||
|
||||
setMaxMin (nbVerticesX, nbVerticesY, nbVerticesZ); // This function prevent from cutting the scene in too many blocs
|
||||
|
||||
@@ -63,9 +63,9 @@ void WriterCompareTriangle::cutscene(int nbVertices, const osg::BoundingBox & sc
|
||||
boxList.reserve(nbVerticesX * nbVerticesY * nbVerticesZ);
|
||||
short yinc = 1;
|
||||
short xinc = 1;
|
||||
unsigned int y = 0;
|
||||
unsigned int x = 0;
|
||||
for (unsigned int z = 0; z < nbVerticesZ; ++z)
|
||||
int y = 0;
|
||||
int x = 0;
|
||||
for (int z = 0; z < nbVerticesZ; ++z)
|
||||
{
|
||||
while (x < nbVerticesX && x >= 0)
|
||||
{
|
||||
|
||||
@@ -21,9 +21,9 @@ public:
|
||||
const std::pair<Triangle, int> & t2) const;
|
||||
private:
|
||||
void // This function prevent from cut scene in too many blocs
|
||||
setMaxMin(unsigned int & nbVerticesX,
|
||||
unsigned int & nbVerticesY,
|
||||
unsigned int & nbVerticesZ) const;
|
||||
setMaxMin(int & nbVerticesX,
|
||||
int & nbVerticesY,
|
||||
int & nbVerticesZ) const;
|
||||
|
||||
/**
|
||||
* Cut the scene in different bloc to sort.
|
||||
|
||||
@@ -242,6 +242,7 @@ typedef struct Lib3dsMaterial {
|
||||
int soften; /* bool */
|
||||
int face_map; /* bool */
|
||||
int two_sided; /* Material visible from back */
|
||||
int transparency_falloff; /* Transparency falloff in/out */
|
||||
int map_decal; /* bool */
|
||||
int use_wire;
|
||||
int use_wire_abs;
|
||||
|
||||
@@ -86,6 +86,7 @@ static Lib3dsChunkTable lib3ds_chunk_table[] = {
|
||||
{CHK_MAT_SELF_ILPCT, "MAT_SELF_ILPCT"},
|
||||
{CHK_MAT_WIRE, "MAT_WIRE"},
|
||||
{CHK_MAT_FACEMAP, "MAT_FACEMAP"},
|
||||
{CHK_MAT_TRANSPARENCY_FALLOFF, "MAT_TRANSPARENCY_FALLOFF"},
|
||||
{CHK_MAT_PHONGSOFT, "MAT_PHONGSOFT"},
|
||||
{CHK_MAT_WIREABS, "MAT_WIREABS"},
|
||||
{CHK_MAT_WIRE_SIZE, "MAT_WIRE_SIZE"},
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
/*
|
||||
Copyright (C) 1996-2008 by Jan Eric Kyprianidis <www.kyprianidis.com>
|
||||
All rights reserved.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published
|
||||
by the Free Software Foundation, either version 2.1 of the License, or
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published
|
||||
by the Free Software Foundation, either version 2.1 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Thisprogram is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
Thisprogram is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program; If not, see <http://www.gnu.org/licenses/>.
|
||||
along with this program; If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "lib3ds_impl.h"
|
||||
|
||||
@@ -231,7 +231,7 @@ named_object_read(Lib3dsFile *file, Lib3dsIo *io) {
|
||||
uint32_t object_flags;
|
||||
|
||||
lib3ds_chunk_read_start(&c, CHK_NAMED_OBJECT, io);
|
||||
|
||||
|
||||
lib3ds_io_read_string(io, name, 64);
|
||||
lib3ds_io_log(io, LIB3DS_LOG_INFO, " NAME=%s", name);
|
||||
lib3ds_chunk_read_tell(&c, io);
|
||||
@@ -444,13 +444,13 @@ mdata_read(Lib3dsFile *file, Lib3dsIo *io) {
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
static int
|
||||
compare_node_id( const void *a, const void *b ) {
|
||||
return (int)((*((Lib3dsNode**)a))->node_id) - (int)((*((Lib3dsNode**)b))->node_id);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
static int
|
||||
compare_node_id2( const void *a, const void *b ) {
|
||||
// not a is a pointer in the calling bsearch routine the user_id is an unsigned, while the node_id is an unsigned short?!
|
||||
return (int)(*((unsigned*)a)) - (int)((*((Lib3dsNode**)b))->node_id);
|
||||
@@ -494,33 +494,33 @@ kfdata_read(Lib3dsFile *file, Lib3dsIo *io) {
|
||||
break;
|
||||
}
|
||||
|
||||
case CHK_AMBIENT_NODE_TAG:
|
||||
case CHK_OBJECT_NODE_TAG:
|
||||
case CHK_CAMERA_NODE_TAG:
|
||||
case CHK_TARGET_NODE_TAG:
|
||||
case CHK_LIGHT_NODE_TAG:
|
||||
case CHK_SPOTLIGHT_NODE_TAG:
|
||||
case CHK_AMBIENT_NODE_TAG:
|
||||
case CHK_OBJECT_NODE_TAG:
|
||||
case CHK_CAMERA_NODE_TAG:
|
||||
case CHK_TARGET_NODE_TAG:
|
||||
case CHK_LIGHT_NODE_TAG:
|
||||
case CHK_SPOTLIGHT_NODE_TAG:
|
||||
case CHK_L_TARGET_NODE_TAG: {
|
||||
Lib3dsNodeType type = 0;
|
||||
Lib3dsNode *node;
|
||||
|
||||
switch (chunk) {
|
||||
case CHK_AMBIENT_NODE_TAG:
|
||||
case CHK_AMBIENT_NODE_TAG:
|
||||
type = LIB3DS_NODE_AMBIENT_COLOR;
|
||||
break;
|
||||
case CHK_OBJECT_NODE_TAG:
|
||||
case CHK_OBJECT_NODE_TAG:
|
||||
type = LIB3DS_NODE_MESH_INSTANCE;
|
||||
break;
|
||||
case CHK_CAMERA_NODE_TAG:
|
||||
case CHK_CAMERA_NODE_TAG:
|
||||
type = LIB3DS_NODE_CAMERA;
|
||||
break;
|
||||
case CHK_TARGET_NODE_TAG:
|
||||
case CHK_TARGET_NODE_TAG:
|
||||
type = LIB3DS_NODE_CAMERA_TARGET;
|
||||
break;
|
||||
case CHK_LIGHT_NODE_TAG:
|
||||
case CHK_LIGHT_NODE_TAG:
|
||||
type = LIB3DS_NODE_OMNILIGHT;
|
||||
break;
|
||||
case CHK_SPOTLIGHT_NODE_TAG:
|
||||
case CHK_SPOTLIGHT_NODE_TAG:
|
||||
type = LIB3DS_NODE_SPOTLIGHT;
|
||||
break;
|
||||
case CHK_L_TARGET_NODE_TAG:
|
||||
@@ -565,7 +565,7 @@ kfdata_read(Lib3dsFile *file, Lib3dsIo *io) {
|
||||
if (p->user_id != 65535) {
|
||||
parent = *(Lib3dsNode**)bsearch(&p->user_id, nodes, num_nodes, sizeof(Lib3dsNode*), compare_node_id2);
|
||||
if (parent) {
|
||||
q->next = p->next;
|
||||
q->next = p->next;
|
||||
p->next = parent->childs;
|
||||
p->parent = parent;
|
||||
parent->childs = p;
|
||||
@@ -927,7 +927,7 @@ lib3ds_file_write(Lib3dsFile *file, Lib3dsIo *io) {
|
||||
|
||||
void lib3ds_file_reserve_materials(Lib3dsFile *file, int size, int force) {
|
||||
assert(file);
|
||||
lib3ds_util_reserve_array((void***)&file->materials, &file->nmaterials, &file->materials_size,
|
||||
lib3ds_util_reserve_array((void***)&file->materials, &file->nmaterials, &file->materials_size,
|
||||
size, force, (Lib3dsFreeFunc)lib3ds_material_free);
|
||||
}
|
||||
|
||||
@@ -960,10 +960,10 @@ lib3ds_file_material_by_name(Lib3dsFile *file, const char *name) {
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
void
|
||||
lib3ds_file_reserve_cameras(Lib3dsFile *file, int size, int force) {
|
||||
assert(file);
|
||||
lib3ds_util_reserve_array((void***)&file->cameras, &file->ncameras, &file->cameras_size,
|
||||
lib3ds_util_reserve_array((void***)&file->cameras, &file->ncameras, &file->cameras_size,
|
||||
size, force, (Lib3dsFreeFunc)lib3ds_camera_free);
|
||||
}
|
||||
|
||||
@@ -996,10 +996,10 @@ lib3ds_file_camera_by_name(Lib3dsFile *file, const char *name) {
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
void
|
||||
lib3ds_file_reserve_lights(Lib3dsFile *file, int size, int force) {
|
||||
assert(file);
|
||||
lib3ds_util_reserve_array((void***)&file->lights, &file->nlights, &file->lights_size,
|
||||
lib3ds_util_reserve_array((void***)&file->lights, &file->nlights, &file->lights_size,
|
||||
size, force, (Lib3dsFreeFunc)lib3ds_light_free);
|
||||
}
|
||||
|
||||
@@ -1032,10 +1032,10 @@ lib3ds_file_light_by_name(Lib3dsFile *file, const char *name) {
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
void
|
||||
lib3ds_file_reserve_meshes(Lib3dsFile *file, int size, int force) {
|
||||
assert(file);
|
||||
lib3ds_util_reserve_array((void***)&file->meshes, &file->nmeshes, &file->meshes_size,
|
||||
lib3ds_util_reserve_array((void***)&file->meshes, &file->nmeshes, &file->meshes_size,
|
||||
size, force, (Lib3dsFreeFunc)lib3ds_mesh_free);
|
||||
}
|
||||
|
||||
@@ -1068,7 +1068,7 @@ lib3ds_file_mesh_by_name(Lib3dsFile *file, const char *name) {
|
||||
}
|
||||
|
||||
|
||||
Lib3dsMesh*
|
||||
Lib3dsMesh*
|
||||
lib3ds_file_mesh_for_node(Lib3dsFile *file, Lib3dsNode *node) {
|
||||
int index;
|
||||
Lib3dsMeshInstanceNode *n;
|
||||
@@ -1162,7 +1162,7 @@ lib3ds_file_append_node(Lib3dsFile *file, Lib3dsNode *node, Lib3dsNode *parent)
|
||||
parent->childs = node;
|
||||
} else {
|
||||
file->nodes = node;
|
||||
}
|
||||
}
|
||||
}
|
||||
node->parent = parent;
|
||||
node->next = NULL;
|
||||
@@ -1249,12 +1249,12 @@ lib3ds_file_remove_node(Lib3dsFile *file, Lib3dsNode *node) {
|
||||
static void
|
||||
file_minmax_node_id_impl(Lib3dsFile *file, Lib3dsNode *node, uint16_t *min_id, uint16_t *max_id) {
|
||||
Lib3dsNode *p;
|
||||
|
||||
|
||||
if (min_id && (*min_id > node->node_id))
|
||||
*min_id = node->node_id;
|
||||
if (max_id && (*max_id < node->node_id))
|
||||
*max_id = node->node_id;
|
||||
|
||||
|
||||
p = node->childs;
|
||||
while (p) {
|
||||
file_minmax_node_id_impl(file, p, min_id, max_id);
|
||||
@@ -1263,10 +1263,10 @@ file_minmax_node_id_impl(Lib3dsFile *file, Lib3dsNode *node, uint16_t *min_id, u
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
void
|
||||
lib3ds_file_minmax_node_id(Lib3dsFile *file, uint16_t *min_id, uint16_t *max_id) {
|
||||
Lib3dsNode *p;
|
||||
|
||||
|
||||
if (min_id)
|
||||
*min_id = 65535;
|
||||
if (max_id)
|
||||
@@ -1281,7 +1281,7 @@ lib3ds_file_minmax_node_id(Lib3dsFile *file, uint16_t *min_id, uint16_t *max_id)
|
||||
|
||||
|
||||
void
|
||||
lib3ds_file_bounding_box_of_objects(Lib3dsFile *file, int
|
||||
lib3ds_file_bounding_box_of_objects(Lib3dsFile *file, int
|
||||
include_meshes, int include_cameras, int include_lights,
|
||||
float bmin[3], float bmax[3]) {
|
||||
bmin[0] = bmin[1] = bmin[2] = FLT_MAX;
|
||||
@@ -1320,10 +1320,13 @@ lib3ds_file_bounding_box_of_objects(Lib3dsFile *file, int
|
||||
|
||||
|
||||
static void
|
||||
file_bounding_box_of_nodes_impl(Lib3dsNode *node, Lib3dsFile *file,
|
||||
file_bounding_box_of_nodes_impl(Lib3dsNode *node, Lib3dsFile *file,
|
||||
int include_meshes, int include_cameras, int include_lights,
|
||||
float bmin[3], float bmax[3], float matrix[4][4]) {
|
||||
switch (node->type) {
|
||||
case LIB3DS_NODE_AMBIENT_COLOR:
|
||||
break;
|
||||
|
||||
case LIB3DS_NODE_MESH_INSTANCE:
|
||||
if (include_meshes) {
|
||||
int index;
|
||||
@@ -1392,7 +1395,7 @@ file_bounding_box_of_nodes_impl(Lib3dsNode *node, Lib3dsFile *file,
|
||||
|
||||
|
||||
void
|
||||
lib3ds_file_bounding_box_of_nodes(Lib3dsFile *file,
|
||||
lib3ds_file_bounding_box_of_nodes(Lib3dsFile *file,
|
||||
int include_meshes, int include_cameras,int include_lights,
|
||||
float bmin[3], float bmax[3], float matrix[4][4]) {
|
||||
Lib3dsNode *p;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
by the Free Software Foundation, either version 2.1 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Thisprogram is distributed in the hope that it will be useful,
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
@@ -132,6 +132,7 @@ typedef enum Lib3dsChunks {
|
||||
CHK_MAT_SELF_ILPCT =0xA084,
|
||||
CHK_MAT_WIRE =0xA085,
|
||||
CHK_MAT_FACEMAP =0xA088,
|
||||
CHK_MAT_TRANSPARENCY_FALLOFF =0xA08A,
|
||||
CHK_MAT_PHONGSOFT =0xA08C,
|
||||
CHK_MAT_WIREABS =0xA08E,
|
||||
CHK_MAT_WIRE_SIZE =0xA087,
|
||||
|
||||
@@ -371,6 +371,11 @@ lib3ds_material_read(Lib3dsMaterial *material, Lib3dsIo *io) {
|
||||
break;
|
||||
}
|
||||
|
||||
case CHK_MAT_TRANSPARENCY_FALLOFF: {
|
||||
material->transparency_falloff = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
case CHK_MAT_PHONGSOFT: {
|
||||
material->soften = TRUE;
|
||||
break;
|
||||
@@ -492,7 +497,7 @@ lib3ds_material_read(Lib3dsMaterial *material, Lib3dsIo *io) {
|
||||
material->autorefl_map_frame_step = lib3ds_io_read_intd(io);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
default:
|
||||
lib3ds_chunk_unknown(chunk, io);
|
||||
}
|
||||
@@ -821,6 +826,13 @@ lib3ds_material_write(Lib3dsMaterial *material, Lib3dsIo *io) {
|
||||
lib3ds_chunk_write(&c, io);
|
||||
}
|
||||
|
||||
if (material->transparency_falloff) { /*---- CHK_MAT_TRANSPARENCY_FALLOFF ----*/
|
||||
Lib3dsChunk c;
|
||||
c.chunk = CHK_MAT_TRANSPARENCY_FALLOFF;
|
||||
c.size = 6;
|
||||
lib3ds_chunk_write(&c, io);
|
||||
}
|
||||
|
||||
if (material->soften) { /*---- CHK_MAT_PHONGSOFT ----*/
|
||||
Lib3dsChunk c;
|
||||
c.chunk = CHK_MAT_PHONGSOFT;
|
||||
|
||||
@@ -756,6 +756,38 @@ ConvertFromInventor::postLOD(void* data, SoCallbackAction* action,
|
||||
|
||||
return SoCallbackAction::CONTINUE;
|
||||
}
|
||||
|
||||
// g++ (at least) guarantees thread-safe method-local static initialization, so moving construction of these maps to exploit
|
||||
class NormBindingMap : public std::map<SoNormalBinding::Binding, deprecated_osg::Geometry::AttributeBinding>
|
||||
{
|
||||
public:
|
||||
NormBindingMap()
|
||||
{
|
||||
(*this)[SoNormalBinding::OVERALL] = deprecated_osg::Geometry::BIND_OVERALL;
|
||||
(*this)[SoNormalBinding::PER_PART] = deprecated_osg::Geometry::BIND_PER_PRIMITIVE;
|
||||
(*this)[SoNormalBinding::PER_PART_INDEXED] = deprecated_osg::Geometry::BIND_PER_PRIMITIVE;
|
||||
(*this)[SoNormalBinding::PER_FACE] = deprecated_osg::Geometry::BIND_PER_PRIMITIVE;
|
||||
(*this)[SoNormalBinding::PER_FACE_INDEXED] = deprecated_osg::Geometry::BIND_PER_PRIMITIVE;
|
||||
(*this)[SoNormalBinding::PER_VERTEX] = deprecated_osg::Geometry::BIND_PER_VERTEX;
|
||||
(*this)[SoNormalBinding::PER_VERTEX_INDEXED] = deprecated_osg::Geometry::BIND_PER_VERTEX;
|
||||
}
|
||||
};
|
||||
|
||||
class ColBindingMap : public std::map<SoMaterialBinding::Binding, deprecated_osg::Geometry::AttributeBinding>
|
||||
{
|
||||
public:
|
||||
ColBindingMap()
|
||||
{
|
||||
(*this)[SoMaterialBinding::OVERALL] = deprecated_osg::Geometry::BIND_OVERALL;
|
||||
(*this)[SoMaterialBinding::PER_PART] = deprecated_osg::Geometry::BIND_PER_PRIMITIVE;
|
||||
(*this)[SoMaterialBinding::PER_PART_INDEXED] = deprecated_osg::Geometry::BIND_PER_PRIMITIVE;
|
||||
(*this)[SoMaterialBinding::PER_FACE] = deprecated_osg::Geometry::BIND_PER_PRIMITIVE;
|
||||
(*this)[SoMaterialBinding::PER_FACE_INDEXED] = deprecated_osg::Geometry::BIND_PER_PRIMITIVE;
|
||||
(*this)[SoMaterialBinding::PER_VERTEX] = deprecated_osg::Geometry::BIND_PER_VERTEX;
|
||||
(*this)[SoMaterialBinding::PER_VERTEX_INDEXED] = deprecated_osg::Geometry::BIND_PER_VERTEX;
|
||||
}
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
SoCallbackAction::Response
|
||||
ConvertFromInventor::preShape(void* data, SoCallbackAction* action,
|
||||
@@ -769,45 +801,8 @@ ConvertFromInventor::preShape(void* data, SoCallbackAction* action,
|
||||
ConvertFromInventor* thisPtr = (ConvertFromInventor *) (data);
|
||||
|
||||
// Normal and color binding map from Inventor to OSG
|
||||
static std::map<SoNormalBinding::Binding, deprecated_osg::Geometry::AttributeBinding>
|
||||
normBindingMap;
|
||||
static std::map<SoMaterialBinding::Binding, deprecated_osg::Geometry::AttributeBinding>
|
||||
colBindingMap;
|
||||
static bool firstTime = true;
|
||||
if (firstTime)
|
||||
{
|
||||
normBindingMap[SoNormalBinding::OVERALL]
|
||||
= deprecated_osg::Geometry::BIND_OVERALL;
|
||||
normBindingMap[SoNormalBinding::PER_PART]
|
||||
= deprecated_osg::Geometry::BIND_PER_PRIMITIVE;
|
||||
normBindingMap[SoNormalBinding::PER_PART_INDEXED]
|
||||
= deprecated_osg::Geometry::BIND_PER_PRIMITIVE;
|
||||
normBindingMap[SoNormalBinding::PER_FACE]
|
||||
= deprecated_osg::Geometry::BIND_PER_PRIMITIVE;
|
||||
normBindingMap[SoNormalBinding::PER_FACE_INDEXED]
|
||||
= deprecated_osg::Geometry::BIND_PER_PRIMITIVE;
|
||||
normBindingMap[SoNormalBinding::PER_VERTEX]
|
||||
= deprecated_osg::Geometry::BIND_PER_VERTEX;
|
||||
normBindingMap[SoNormalBinding::PER_VERTEX_INDEXED]
|
||||
= deprecated_osg::Geometry::BIND_PER_VERTEX;
|
||||
|
||||
colBindingMap[SoMaterialBinding::OVERALL]
|
||||
= deprecated_osg::Geometry::BIND_OVERALL;
|
||||
colBindingMap[SoMaterialBinding::PER_PART]
|
||||
= deprecated_osg::Geometry::BIND_PER_PRIMITIVE;
|
||||
colBindingMap[SoMaterialBinding::PER_PART_INDEXED]
|
||||
= deprecated_osg::Geometry::BIND_PER_PRIMITIVE;
|
||||
colBindingMap[SoMaterialBinding::PER_FACE]
|
||||
= deprecated_osg::Geometry::BIND_PER_PRIMITIVE;
|
||||
colBindingMap[SoMaterialBinding::PER_FACE_INDEXED]
|
||||
= deprecated_osg::Geometry::BIND_PER_PRIMITIVE;
|
||||
colBindingMap[SoMaterialBinding::PER_VERTEX]
|
||||
= deprecated_osg::Geometry::BIND_PER_VERTEX;
|
||||
colBindingMap[SoMaterialBinding::PER_VERTEX_INDEXED]
|
||||
= deprecated_osg::Geometry::BIND_PER_VERTEX;
|
||||
|
||||
firstTime = false;
|
||||
}
|
||||
static NormBindingMap normBindingMap;
|
||||
static ColBindingMap colBindingMap;
|
||||
|
||||
// Get normal and color binding
|
||||
if (node->isOfType(SoVertexShape::getClassTypeId()))
|
||||
@@ -1877,6 +1872,17 @@ update: The mentioned bug is probably just for very old NVidia drivers (commit t
|
||||
|
||||
return stateSet;
|
||||
}
|
||||
|
||||
class TexWrapMap : public std::map<SoTexture2::Wrap, osg::Texture2D::WrapMode>
|
||||
{
|
||||
public:
|
||||
TexWrapMap()
|
||||
{
|
||||
(*this)[SoTexture2::CLAMP] = osg::Texture2D::CLAMP;
|
||||
(*this)[SoTexture2::REPEAT] = osg::Texture2D::REPEAT;
|
||||
}
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
osg::Texture2D*
|
||||
ConvertFromInventor::convertIVTexToOSGTex(const SoNode* soNode,
|
||||
@@ -1946,14 +1952,7 @@ ConvertFromInventor::convertIVTexToOSGTex(const SoNode* soNode,
|
||||
// Set name
|
||||
osgTex->setName(soNode->getName().getString());
|
||||
|
||||
static std::map<SoTexture2::Wrap, osg::Texture2D::WrapMode> texWrapMap;
|
||||
static bool firstTime = true;
|
||||
if (firstTime)
|
||||
{
|
||||
texWrapMap[SoTexture2::CLAMP] = osg::Texture2D::CLAMP;
|
||||
texWrapMap[SoTexture2::REPEAT] = osg::Texture2D::REPEAT;
|
||||
firstTime = false;
|
||||
}
|
||||
static TexWrapMap texWrapMap;
|
||||
|
||||
// Set texture wrap mode
|
||||
#ifdef __COIN__
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
*/
|
||||
|
||||
//
|
||||
// OpenFlight<EFBFBD> loader for OpenSceneGraph
|
||||
// OpenFlight loader for OpenSceneGraph
|
||||
//
|
||||
// Copyright (C) 2005-2007 Brede Johansen
|
||||
//
|
||||
@@ -1030,9 +1030,9 @@ protected:
|
||||
if ((w==0.0) || (light->getSpotCutoff()<180.0))
|
||||
{
|
||||
// assume yaw is zero along y axis, increase positive clockwise
|
||||
// assume patch is zero along xy plane, increase positive upwards
|
||||
float cos_yaw = cosf(osg::inDegrees(yaw));
|
||||
float sin_yaw = sinf(osg::inDegrees(yaw));
|
||||
// assume pitch is zero along xy plane, increase positive upwards
|
||||
float cos_yaw = cosf(osg::inDegrees(-yaw));
|
||||
float sin_yaw = sinf(osg::inDegrees(-yaw));
|
||||
float cos_pitch = cosf(osg::inDegrees(pitch));
|
||||
float sin_pitch = sinf(osg::inDegrees(pitch));
|
||||
light->setDirection(osg::Vec3(sin_yaw*cos_pitch, cos_yaw*cos_pitch, sin_pitch));
|
||||
|
||||
@@ -267,6 +267,11 @@ RestHttpDevice::RestHttpDevice(const std::string& listening_address, const std::
|
||||
, _firstEventLocalTimeStamp()
|
||||
, _firstEventRemoteTimeStamp(-1)
|
||||
, _lastEventRemoteTimeStamp(0)
|
||||
, _currentMouseX(0.0f)
|
||||
, _currentMouseY(0.0f)
|
||||
, _targetMouseX(0.0f)
|
||||
, _targetMouseY(0.0f)
|
||||
, _targetMouseChanged(false)
|
||||
{
|
||||
setCapabilities(RECEIVE_EVENTS);
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@ public:
|
||||
|
||||
virtual bool checkEvents()
|
||||
{
|
||||
if ((fabs(_currentMouseX - _targetMouseY) > 0.1f) || (fabs(_currentMouseY - _targetMouseY) > 0.1))
|
||||
if (_targetMouseChanged && (fabs(_currentMouseX - _targetMouseY) > 0.1f) || (fabs(_currentMouseY - _targetMouseY) > 0.1))
|
||||
{
|
||||
static const float scalar = 0.2f;
|
||||
_currentMouseX = (1.0f - scalar) * _currentMouseX + scalar * _targetMouseX;
|
||||
@@ -183,6 +183,7 @@ public:
|
||||
|
||||
void setTargetMousePosition(float x, float y, bool force = false)
|
||||
{
|
||||
_targetMouseChanged = true;
|
||||
_targetMouseX = x; _targetMouseY = y;
|
||||
if (force) {
|
||||
_currentMouseX = x; _currentMouseY = y;
|
||||
@@ -200,6 +201,7 @@ private:
|
||||
double _firstEventRemoteTimeStamp;
|
||||
double _lastEventRemoteTimeStamp;
|
||||
float _currentMouseX, _currentMouseY, _targetMouseX, _targetMouseY;
|
||||
bool _targetMouseChanged;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -68,10 +68,8 @@
|
||||
|
||||
@property (readonly, retain) NSMutableArray *services;
|
||||
@property (readwrite, retain) NSString *type;
|
||||
@property (readwrite, assign) BOOL isConnected;
|
||||
|
||||
@property (readwrite, retain) NSNetServiceBrowser *browser;
|
||||
@property (readwrite, retain) NSNetService *connectedService;
|
||||
|
||||
@end
|
||||
|
||||
@@ -80,15 +78,12 @@
|
||||
@synthesize browser;
|
||||
@synthesize type;
|
||||
@synthesize services;
|
||||
@synthesize isConnected;
|
||||
@synthesize connectedService;
|
||||
|
||||
-(id)initWithType: (NSString*) in_type withImpl:(AutoDiscoveryClientImpl*) in_impl {
|
||||
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
|
||||
services = [NSMutableArray new];
|
||||
self.browser = [[NSNetServiceBrowser new] init];
|
||||
self.browser.delegate = self;
|
||||
self.isConnected = NO;
|
||||
self.type = in_type;
|
||||
impl = in_impl;
|
||||
[self.browser searchForServicesOfType:in_type inDomain:@""];
|
||||
@@ -97,9 +92,15 @@
|
||||
}
|
||||
|
||||
-(void)dealloc {
|
||||
self.connectedService = nil;
|
||||
|
||||
[self.browser stop];
|
||||
self.browser.delegate = nil;
|
||||
|
||||
self.browser = nil;
|
||||
[services makeObjectsPerformSelector:@selector(setDelegate:) withObject:nil];
|
||||
[services makeObjectsPerformSelector:@selector(stop)];
|
||||
[services release];
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@@ -118,16 +119,11 @@
|
||||
{
|
||||
int ndx = [services indexOfObject: aService];
|
||||
impl->servicesRemoved([services objectAtIndex: ndx]);
|
||||
|
||||
aService.delegate = nil;
|
||||
[services removeObject:aService];
|
||||
if ( aService == self.connectedService ) self.isConnected = NO;
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void)netServiceDidResolveAddress:(NSNetService *)service {
|
||||
self.isConnected = YES;
|
||||
self.connectedService = service;
|
||||
|
||||
//NSLog(@"hostname: %@", [service hostName]);
|
||||
|
||||
@@ -220,4 +216,4 @@ void AutoDiscoveryClientImpl::servicesRemoved(void* key)
|
||||
AutoDiscoveryClientImpl::~AutoDiscoveryClientImpl()
|
||||
{
|
||||
[_controller release];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
INCLUDE_DIRECTORIES( ${AV_FOUNDATION_INCLUDE_DIR} )
|
||||
|
||||
SET(TARGET_SRC
|
||||
SET(TARGET_SRC
|
||||
OSXAVFoundationVideo.mm
|
||||
OSXAVFoundationVideo.h
|
||||
../QTKit/VideoFrameDispatcher.h
|
||||
../QTKIt/VideoFrameDispatcher.cpp
|
||||
../QTKit/VideoFrameDispatcher.cpp
|
||||
OSXAVFoundationCoreVideoTexture.h
|
||||
OSXAVFoundationCoreVideoTexture.cpp
|
||||
ReaderWriterAVFoundation.cpp
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#endif
|
||||
|
||||
#include "OSXAVFoundationCoreVideoTexture.h"
|
||||
#include "OSXAVFoundationVideo.H"
|
||||
#include "OSXAVFoundationVideo.h"
|
||||
#include <CoreVideo/CoreVideo.h>
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user