Compare commits
289 Commits
OpenSceneG
...
OpenSceneG
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9c384664af | ||
|
|
c1f083a67e | ||
|
|
23d582fef5 | ||
|
|
074d470fa5 | ||
|
|
ee71c5a63f | ||
|
|
fc77489239 | ||
|
|
6fa7dd27f3 | ||
|
|
32366f0489 | ||
|
|
30fff3106d | ||
|
|
23458666b8 | ||
|
|
c91bfcee21 | ||
|
|
d763feddda | ||
|
|
3b789fc6b0 | ||
|
|
110cf64c3b | ||
|
|
9d326917f0 | ||
|
|
5ead09215e | ||
|
|
60838d0c42 | ||
|
|
bddbdfdefe | ||
|
|
0744b6881f | ||
|
|
3371ce640a | ||
|
|
dff397f647 | ||
|
|
1c833e2e4d | ||
|
|
cf268b4cfd | ||
|
|
1d628eebfb | ||
|
|
20401947bf | ||
|
|
16ac602824 | ||
|
|
4f830fb0e2 | ||
|
|
d4fc0ceba3 | ||
|
|
825882be19 | ||
|
|
bc473c4e0e | ||
|
|
a430566596 | ||
|
|
3d77abc06d | ||
|
|
033e52b8ef | ||
|
|
785ce9f679 | ||
|
|
f26be0155c | ||
|
|
9eb02084a6 | ||
|
|
bd82047acb | ||
|
|
f9a20d017a | ||
|
|
5878a70ede | ||
|
|
57d04290ab | ||
|
|
ceda86b31b | ||
|
|
499e38ff98 | ||
|
|
3461d9e8b5 | ||
|
|
4a535fe426 | ||
|
|
fc7302ccba | ||
|
|
7f4d116391 | ||
|
|
edf27e36ed | ||
|
|
c8d8a051ad | ||
|
|
4c9e17fcc7 | ||
|
|
95853370e1 | ||
|
|
c90cc658a0 | ||
|
|
7c8ab128a6 | ||
|
|
1185fbda34 | ||
|
|
005e52144d | ||
|
|
b6f05114dc | ||
|
|
8bb91a5265 | ||
|
|
13f2cb3f47 | ||
|
|
dab3efadce | ||
|
|
6f004ef7db | ||
|
|
6895e29417 | ||
|
|
6cf1db199c | ||
|
|
d4e5c72ebc | ||
|
|
3dd2816414 | ||
|
|
eeadbae72d | ||
|
|
b203faaa22 | ||
|
|
324dc573a0 | ||
|
|
750cd78178 | ||
|
|
b5179e247f | ||
|
|
84ec88cc25 | ||
|
|
7a9e97877c | ||
|
|
0bedd4c43a | ||
|
|
d1b9bdbbbe | ||
|
|
c923584158 | ||
|
|
c789f7bced | ||
|
|
18810de975 | ||
|
|
e3ba4c82e4 | ||
|
|
ce82cfd25f | ||
|
|
9c42d8f0da | ||
|
|
2b4221c211 | ||
|
|
7d04c3457a | ||
|
|
166a8b6ccf | ||
|
|
5cc425cf99 | ||
|
|
f19a63e50d | ||
|
|
506f26d292 | ||
|
|
c8d3571efd | ||
|
|
1fa34dbbcc | ||
|
|
3cabbb5a5a | ||
|
|
0c052ce2ed | ||
|
|
60bafc2050 | ||
|
|
0dd978df7a | ||
|
|
0ec0b79d6c | ||
|
|
9f0f107c66 | ||
|
|
cceb63ed12 | ||
|
|
e5185937c8 | ||
|
|
9221cab9c5 | ||
|
|
4b687b7a86 | ||
|
|
f32d30d033 | ||
|
|
c931140eaf | ||
|
|
21a2cf6ff1 | ||
|
|
3416f91704 | ||
|
|
7126619e40 | ||
|
|
12cf202cfc | ||
|
|
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 |
107
AUTHORS.txt
107
AUTHORS.txt
@@ -1,6 +1,6 @@
|
|||||||
OpenSceneGraph Library 3.2.0
|
OpenSceneGraph Library 3.2.2
|
||||||
|
|
||||||
510 Contributors:
|
529 Contributors:
|
||||||
|
|
||||||
Firstname Surname
|
Firstname Surname
|
||||||
-----------------
|
-----------------
|
||||||
@@ -9,14 +9,14 @@ Don Burns
|
|||||||
Stephan Huber
|
Stephan Huber
|
||||||
Paul Martz
|
Paul Martz
|
||||||
Mathias Fr<46>hlich
|
Mathias Fr<46>hlich
|
||||||
Marco Jez
|
|
||||||
Farshid Lashkari
|
Farshid Lashkari
|
||||||
|
Marco Jez
|
||||||
Wang Rui
|
Wang Rui
|
||||||
Jean-S<>bastien Guay
|
Jean-S<>bastien Guay
|
||||||
Mike Weiblen
|
|
||||||
Ulrich Hertlein
|
Ulrich Hertlein
|
||||||
Eric Wing
|
Mike Weiblen
|
||||||
Sukender
|
Sukender
|
||||||
|
Eric Wing
|
||||||
Cedric Pinson
|
Cedric Pinson
|
||||||
Brede Johansen
|
Brede Johansen
|
||||||
Bob Kuehne
|
Bob Kuehne
|
||||||
@@ -25,58 +25,59 @@ Geoff Michel
|
|||||||
Wojciech Lewandowski
|
Wojciech Lewandowski
|
||||||
Eric Sokolowsky
|
Eric Sokolowsky
|
||||||
David Callu
|
David Callu
|
||||||
Trajce Nikolov
|
Laurens Voerman
|
||||||
Colin McDonald
|
Colin McDonald
|
||||||
|
Trajce Nikolov
|
||||||
Tim Moore
|
Tim Moore
|
||||||
Martin Lavery
|
Martin Lavery
|
||||||
Laurens Voerman
|
|
||||||
Tree
|
Tree
|
||||||
Luigi Calori
|
Luigi Calori
|
||||||
Mike Wittman
|
Mike Wittman
|
||||||
|
Jason Beverage
|
||||||
Chris Hanson
|
Chris Hanson
|
||||||
Roland Smeenk
|
Roland Smeenk
|
||||||
Roger James
|
Roger James
|
||||||
Jeremy Moles
|
|
||||||
Jason Beverage
|
|
||||||
Jan Peciva
|
|
||||||
J.P. Delport
|
|
||||||
Mattias Helsing
|
Mattias Helsing
|
||||||
|
Jeremy Moles
|
||||||
|
Jan Peciva
|
||||||
|
Alberto Luaces
|
||||||
|
J.P. Delport
|
||||||
Magnus Kessler
|
Magnus Kessler
|
||||||
David Fries
|
David Fries
|
||||||
Andy Skinner
|
Andy Skinner
|
||||||
Paul Melis
|
|
||||||
Alberto Luaces
|
|
||||||
Luc Frauciel
|
|
||||||
Tom Jolley
|
Tom Jolley
|
||||||
|
Paul Melis
|
||||||
|
Luc Frauciel
|
||||||
Pavel Moloshtan
|
Pavel Moloshtan
|
||||||
Brad Christiansen
|
Brad Christiansen
|
||||||
Olaf Flebbe
|
Olaf Flebbe
|
||||||
Mathieu Marache
|
Mathieu Marache
|
||||||
Jason Daly
|
Jason Daly
|
||||||
|
Aurelien Albert
|
||||||
Art Tevs
|
Art Tevs
|
||||||
Philip Lowman
|
Philip Lowman
|
||||||
Per Fahlberg
|
Per Fahlberg
|
||||||
Norman Vine
|
Norman Vine
|
||||||
|
Lionel Lagarde
|
||||||
Terry Welsh
|
Terry Welsh
|
||||||
Serge Lages
|
Serge Lages
|
||||||
Lionel Lagarde
|
Romano Jos<6F> Magacho da Silva
|
||||||
|
Pjotr Svetachov
|
||||||
Chris Denham
|
Chris Denham
|
||||||
Alberto Farre
|
Alberto Farre
|
||||||
|
Torben Dannhauer
|
||||||
Sherman Wilcox
|
Sherman Wilcox
|
||||||
Robert Michael
|
Robert Michael
|
||||||
Mourad Boufarguine
|
Mourad Boufarguine
|
||||||
|
Glenn Waldron
|
||||||
Andr<EFBFBD> Garneau
|
Andr<EFBFBD> Garneau
|
||||||
Adrian Egli
|
Adrian Egli
|
||||||
Ruben Lopez
|
Ruben Lopez
|
||||||
Randall Hopper
|
Randall Hopper
|
||||||
Jan Ciger
|
Jan Ciger
|
||||||
Glenn Waldron
|
|
||||||
Gideon May
|
Gideon May
|
||||||
Don Tidrow
|
Don Tidrow
|
||||||
Aurelien Albert
|
|
||||||
Torben Dannhauer
|
|
||||||
Stephane Lamoliatte
|
Stephane Lamoliatte
|
||||||
Romano Jos<6F> Magacho da Silva
|
|
||||||
Michael Gronager
|
Michael Gronager
|
||||||
Martin Naylor
|
Martin Naylor
|
||||||
Joakim Simonsson
|
Joakim Simonsson
|
||||||
@@ -84,11 +85,13 @@ David Spilling
|
|||||||
Daniel Sj<53>lie
|
Daniel Sj<53>lie
|
||||||
Bryan Thrall
|
Bryan Thrall
|
||||||
Fabien Lavignotte
|
Fabien Lavignotte
|
||||||
|
Andreas Ekstrand
|
||||||
|
Riccardo Corsi
|
||||||
Mike Connell
|
Mike Connell
|
||||||
Melchior Franz
|
Melchior Franz
|
||||||
Johannes Baeuerle
|
Johannes Baeuerle
|
||||||
Andreas Ekstrand
|
Thomas Hogarth
|
||||||
Riccardo Corsi
|
Sebastian Messerschmidt
|
||||||
Rafa Gaitan
|
Rafa Gaitan
|
||||||
Neil Hughes
|
Neil Hughes
|
||||||
Martin Beckett
|
Martin Beckett
|
||||||
@@ -101,7 +104,6 @@ Cory Riddell
|
|||||||
Chuck Seberino
|
Chuck Seberino
|
||||||
Boris Bralo
|
Boris Bralo
|
||||||
Yefei He
|
Yefei He
|
||||||
Thomas Hogarth
|
|
||||||
Sondra Iverson
|
Sondra Iverson
|
||||||
Simon Julier
|
Simon Julier
|
||||||
Rune Schmidt Jensen
|
Rune Schmidt Jensen
|
||||||
@@ -119,13 +121,16 @@ Thibault Genessay
|
|||||||
Sasa Bistrovic
|
Sasa Bistrovic
|
||||||
Ravi Mathur
|
Ravi Mathur
|
||||||
Ralf Habacker
|
Ralf Habacker
|
||||||
Pjotr Svetachov
|
|
||||||
Neil Groves
|
Neil Groves
|
||||||
|
Mikhail Izmestev
|
||||||
Markus Trenkwalder
|
Markus Trenkwalder
|
||||||
Loic Dachary
|
Loic Dachary
|
||||||
Joseph Steel
|
Joseph Steel
|
||||||
|
Jordi Torres
|
||||||
John Shue
|
John Shue
|
||||||
Brad Colbert
|
Brad Colbert
|
||||||
|
Bj<EFBFBD>rn Blissing
|
||||||
|
Alexander Sinditskiy
|
||||||
Vivek Rajan
|
Vivek Rajan
|
||||||
Uwe Woessner
|
Uwe Woessner
|
||||||
Tony Horrobin
|
Tony Horrobin
|
||||||
@@ -133,6 +138,7 @@ Thom DeCarlo
|
|||||||
Tatsuhiro Nishioka
|
Tatsuhiro Nishioka
|
||||||
Tanguy Fautr<74>
|
Tanguy Fautr<74>
|
||||||
Sean Spicer
|
Sean Spicer
|
||||||
|
Ryan Kawicki
|
||||||
Richard Schmidt
|
Richard Schmidt
|
||||||
Peter Hrenka
|
Peter Hrenka
|
||||||
Paul de Repentigny
|
Paul de Repentigny
|
||||||
@@ -141,25 +147,24 @@ Neil Salter
|
|||||||
Mihai Radu
|
Mihai Radu
|
||||||
Michael Hartman
|
Michael Hartman
|
||||||
Martins Innus
|
Martins Innus
|
||||||
|
Marc Helbling
|
||||||
Maciej Krol
|
Maciej Krol
|
||||||
Lilin Xiong
|
Lilin Xiong
|
||||||
Leandro Motta Barros
|
Leandro Motta Barros
|
||||||
Jordi Torres
|
|
||||||
Johan Nouvel
|
Johan Nouvel
|
||||||
Hartwig Wiesmann
|
Hartwig Wiesmann
|
||||||
Donn Mielcarek
|
Donn Mielcarek
|
||||||
Corbin Holtz
|
Corbin Holtz
|
||||||
Blasius Czink
|
Blasius Czink
|
||||||
Alexander Sinditskiy
|
|
||||||
Alexander Irion
|
Alexander Irion
|
||||||
Toshiyuki Takahei
|
Toshiyuki Takahei
|
||||||
Sebastien Grignard
|
Sebastien Grignard
|
||||||
Ryan Kawicki
|
|
||||||
Rudolf Wiedemann
|
Rudolf Wiedemann
|
||||||
Romano Magacho
|
Robert Milharcic
|
||||||
Mikhail Izmestev
|
|
||||||
Maria Ten
|
Maria Ten
|
||||||
Liang Aibin
|
Liang Aibin
|
||||||
|
Kristofer Tingdahl
|
||||||
|
Konstantin Matveyev
|
||||||
Katharina Plugge
|
Katharina Plugge
|
||||||
John Vidar Larring
|
John Vidar Larring
|
||||||
John Kelso
|
John Kelso
|
||||||
@@ -177,14 +182,13 @@ Alok Priyadarshi
|
|||||||
Alberto Barbati
|
Alberto Barbati
|
||||||
Alan Dickinson
|
Alan Dickinson
|
||||||
Vladimir Shabanov
|
Vladimir Shabanov
|
||||||
|
Vladimir Chebaev
|
||||||
Tugkan Calapoglu
|
Tugkan Calapoglu
|
||||||
Tim Daoust
|
Tim Daoust
|
||||||
Sohey Yamamoto
|
Sohey Yamamoto
|
||||||
Sergey Leontyev
|
Sergey Leontyev
|
||||||
Sebastian Messerschmidt
|
|
||||||
Santosh Gaikwad
|
Santosh Gaikwad
|
||||||
Ryan Pavlik
|
Ryan Pavlik
|
||||||
Robert Milharcic
|
|
||||||
Rene Molenaar
|
Rene Molenaar
|
||||||
Piotr Domagalski
|
Piotr Domagalski
|
||||||
Phil Atkin
|
Phil Atkin
|
||||||
@@ -194,6 +198,7 @@ Mattias Linde
|
|||||||
Mark Sciabica
|
Mark Sciabica
|
||||||
Marcin Prus
|
Marcin Prus
|
||||||
Lee Butler
|
Lee Butler
|
||||||
|
Lars Nilsson
|
||||||
Konstantin Sinitsyn
|
Konstantin Sinitsyn
|
||||||
Ken Sewell
|
Ken Sewell
|
||||||
Julian Ortiz
|
Julian Ortiz
|
||||||
@@ -211,6 +216,7 @@ Doug McCorkle
|
|||||||
Donald Cipperly
|
Donald Cipperly
|
||||||
Don Leich
|
Don Leich
|
||||||
Dietmar Funck
|
Dietmar Funck
|
||||||
|
Colin Cochran
|
||||||
Christian Buchner
|
Christian Buchner
|
||||||
Charles Cole
|
Charles Cole
|
||||||
Blake Williams
|
Blake Williams
|
||||||
@@ -224,7 +230,6 @@ Zach Deedler
|
|||||||
Yuzhong Shen
|
Yuzhong Shen
|
||||||
Wee See
|
Wee See
|
||||||
Warren Macchi
|
Warren Macchi
|
||||||
Vladimir Chebaev
|
|
||||||
Vincent Bourdier
|
Vincent Bourdier
|
||||||
Terrex
|
Terrex
|
||||||
Tassilo Glander
|
Tassilo Glander
|
||||||
@@ -242,6 +247,7 @@ Perry Miller
|
|||||||
Pawel Ksiezopolski
|
Pawel Ksiezopolski
|
||||||
Paul Palumbo
|
Paul Palumbo
|
||||||
Paul Obermeier
|
Paul Obermeier
|
||||||
|
Patrick Neary
|
||||||
Nguyen Van Truong
|
Nguyen Van Truong
|
||||||
Nathan Cournia
|
Nathan Cournia
|
||||||
Morten Haukness
|
Morten Haukness
|
||||||
@@ -258,11 +264,11 @@ Martin Lambers
|
|||||||
Martijn Kragtwijk
|
Martijn Kragtwijk
|
||||||
Marius Heise
|
Marius Heise
|
||||||
Marcin Hajder
|
Marcin Hajder
|
||||||
|
Marcel Pursche
|
||||||
Lilith Bryant
|
Lilith Bryant
|
||||||
Lars Nilsson
|
|
||||||
Kristofer Tingdahl
|
|
||||||
Kevin Moiule
|
Kevin Moiule
|
||||||
Keith Steffen
|
Keith Steffen
|
||||||
|
Julien Valentin
|
||||||
Julen Garcia
|
Julen Garcia
|
||||||
Joseph Winston
|
Joseph Winston
|
||||||
John Aughey
|
John Aughey
|
||||||
@@ -270,6 +276,8 @@ Johannes Scholz
|
|||||||
Joachim Pouderoux
|
Joachim Pouderoux
|
||||||
Jean-Christophe Lombardo
|
Jean-Christophe Lombardo
|
||||||
Javier Taibo
|
Javier Taibo
|
||||||
|
Jannik Heller
|
||||||
|
Jan Klimke
|
||||||
James Moliere
|
James Moliere
|
||||||
Jaap Glas
|
Jaap Glas
|
||||||
Igor Kravtchenko
|
Igor Kravtchenko
|
||||||
@@ -279,6 +287,7 @@ Guy Volckaert
|
|||||||
Gustavo Wagner
|
Gustavo Wagner
|
||||||
Guillaume Taze
|
Guillaume Taze
|
||||||
Guillaume Chouvenc
|
Guillaume Chouvenc
|
||||||
|
Giuseppe Donvito
|
||||||
Gill Peacegood
|
Gill Peacegood
|
||||||
Gerrick Bivins
|
Gerrick Bivins
|
||||||
George Tarantilis
|
George Tarantilis
|
||||||
@@ -287,14 +296,17 @@ Eric Buehler
|
|||||||
Eduardo Poyart
|
Eduardo Poyart
|
||||||
Edgar Ellis
|
Edgar Ellis
|
||||||
Dimi Christopoulos
|
Dimi Christopoulos
|
||||||
Diane Delallée
|
Diane Delall<EFBFBD>e
|
||||||
David Longest
|
David Longest
|
||||||
David Ergo
|
David Ergo
|
||||||
Daniel Trstenjak
|
Daniel Trstenjak
|
||||||
Craig Bosma
|
Craig Bosma
|
||||||
Claus Scheiblauer
|
Claus Scheiblauer
|
||||||
Christophe Loustaunau
|
Christophe Loustaunau
|
||||||
|
Christian Ruzicka
|
||||||
|
Bradley Baker Searles
|
||||||
Brad Anderegg
|
Brad Anderegg
|
||||||
|
Bj<EFBFBD>rn Hein
|
||||||
Aric Aumann
|
Aric Aumann
|
||||||
Andrew Sampson
|
Andrew Sampson
|
||||||
Andrew Lorino
|
Andrew Lorino
|
||||||
@@ -321,6 +333,7 @@ Tomas Hnilica
|
|||||||
Todd Furlong
|
Todd Furlong
|
||||||
Tobias Ottenweller
|
Tobias Ottenweller
|
||||||
Tino Schwarze
|
Tino Schwarze
|
||||||
|
Tim George
|
||||||
Thorsten Brehm
|
Thorsten Brehm
|
||||||
Thomas Weidner
|
Thomas Weidner
|
||||||
Tan Dunning
|
Tan Dunning
|
||||||
@@ -333,6 +346,7 @@ Simon Buckley
|
|||||||
Sid Byce
|
Sid Byce
|
||||||
Shuxing Xiao
|
Shuxing Xiao
|
||||||
Shane Arnott
|
Shane Arnott
|
||||||
|
Sergey Kurdakov
|
||||||
Sebastien Kuntz
|
Sebastien Kuntz
|
||||||
Ruth Lang
|
Ruth Lang
|
||||||
Ruben Smelik
|
Ruben Smelik
|
||||||
@@ -340,12 +354,14 @@ Ross Anderson
|
|||||||
Ronny Krueger
|
Ronny Krueger
|
||||||
Ronald van Maarseveen
|
Ronald van Maarseveen
|
||||||
Romain Charbit
|
Romain Charbit
|
||||||
|
Rocco Martino
|
||||||
Robert Swain
|
Robert Swain
|
||||||
Rob Smith
|
Rob Smith
|
||||||
Rob Radtke
|
Rob Radtke
|
||||||
Rob Bloemkool
|
Rob Bloemkool
|
||||||
Rick Pingry
|
Rick Pingry
|
||||||
Rick Appleton
|
Rick Appleton
|
||||||
|
Remo Eichenberger
|
||||||
Reinhard Sainitzer
|
Reinhard Sainitzer
|
||||||
Rein Kadijk
|
Rein Kadijk
|
||||||
Ragnar Hammarqvist
|
Ragnar Hammarqvist
|
||||||
@@ -375,18 +391,20 @@ Nicolas Brodu
|
|||||||
Nick Black
|
Nick Black
|
||||||
Mojtaba Fathi
|
Mojtaba Fathi
|
||||||
Mirko Viviani
|
Mirko Viviani
|
||||||
Mikkel Gjøl
|
Mikkel Gj<EFBFBD>l
|
||||||
|
Mike Krus
|
||||||
Mike Garrity
|
Mike Garrity
|
||||||
Miha Ravsel
|
Miha Rav<EFBFBD>elj
|
||||||
|
Michael Schanne
|
||||||
Michael Polak
|
Michael Polak
|
||||||
Michael Morrison
|
Michael Morrison
|
||||||
|
Michael Mc Donnell
|
||||||
Michael Logan
|
Michael Logan
|
||||||
Michael Kapelko
|
Michael Kapelko
|
||||||
Michael Bach Jensen
|
Michael Bach Jensen
|
||||||
Max Rhiener
|
Max Rhiener
|
||||||
Max Behensky
|
Max Behensky
|
||||||
Mauricio Hofmam
|
Mauricio Hofmam
|
||||||
Matthias Helsing
|
|
||||||
Matthew May
|
Matthew May
|
||||||
Matthew Johnson-Roberson
|
Matthew Johnson-Roberson
|
||||||
Matt Green
|
Matt Green
|
||||||
@@ -401,7 +419,6 @@ Marius Kintel
|
|||||||
Mario Guimaraes
|
Mario Guimaraes
|
||||||
Marco Sciabica
|
Marco Sciabica
|
||||||
Marco Lehmann
|
Marco Lehmann
|
||||||
Marcel Pursche
|
|
||||||
Maik Keller
|
Maik Keller
|
||||||
Lukas Diduch
|
Lukas Diduch
|
||||||
Louis Hamilton
|
Louis Hamilton
|
||||||
@@ -409,10 +426,8 @@ Lewis Harmon
|
|||||||
Leigh Stivers
|
Leigh Stivers
|
||||||
Laurence Muller
|
Laurence Muller
|
||||||
Laura Cerritelli
|
Laura Cerritelli
|
||||||
Lars Nillson
|
|
||||||
Kyle Centers
|
Kyle Centers
|
||||||
Kristopher Bixler
|
Kristopher Bixler
|
||||||
Konstantin Matveyev
|
|
||||||
Kim Seokhwan
|
Kim Seokhwan
|
||||||
Kim Bale
|
Kim Bale
|
||||||
Karsten Weiss
|
Karsten Weiss
|
||||||
@@ -435,7 +450,6 @@ Jeroen den Dekker
|
|||||||
Jay Zuckerman
|
Jay Zuckerman
|
||||||
Jason Howlett
|
Jason Howlett
|
||||||
Jason Ballenger
|
Jason Ballenger
|
||||||
Jan Klimke
|
|
||||||
James Turner
|
James Turner
|
||||||
James Killian
|
James Killian
|
||||||
James Athey
|
James Athey
|
||||||
@@ -470,6 +484,7 @@ Duvan Cope
|
|||||||
Duncan Cavens
|
Duncan Cavens
|
||||||
Drew Whitehouse
|
Drew Whitehouse
|
||||||
Douglas A. Pouk
|
Douglas A. Pouk
|
||||||
|
Dmitry Marakasov
|
||||||
Dean Iverson
|
Dean Iverson
|
||||||
David Jung
|
David Jung
|
||||||
Danny Valente
|
Danny Valente
|
||||||
@@ -477,11 +492,13 @@ Daniel Stien
|
|||||||
Dan Minor
|
Dan Minor
|
||||||
C<EFBFBD>sar L. B. Silveira
|
C<EFBFBD>sar L. B. Silveira
|
||||||
Cyril Brulebois
|
Cyril Brulebois
|
||||||
|
Cl<EFBFBD>ment B<>sch
|
||||||
Clay Fowler
|
Clay Fowler
|
||||||
|
Claus Steuer
|
||||||
Chuck Sembroski
|
Chuck Sembroski
|
||||||
Christopher Blaesius
|
Christopher Blaesius
|
||||||
|
Christopher Baker
|
||||||
Christophe Herreman
|
Christophe Herreman
|
||||||
Christian Ruzicka
|
|
||||||
Christian Noon
|
Christian Noon
|
||||||
Christian Kaser
|
Christian Kaser
|
||||||
Christian Ehrlicher
|
Christian Ehrlicher
|
||||||
@@ -492,8 +509,6 @@ Bruno Herbelin
|
|||||||
Brian Keener
|
Brian Keener
|
||||||
Brandon Hamm
|
Brandon Hamm
|
||||||
Bora Utka
|
Bora Utka
|
||||||
Bj<EFBFBD>rn Hein
|
|
||||||
Bjorn Blissing
|
|
||||||
Bill Prendergast
|
Bill Prendergast
|
||||||
Bernardt Duvenhage
|
Bernardt Duvenhage
|
||||||
Benoit Laniel
|
Benoit Laniel
|
||||||
@@ -501,7 +516,9 @@ Benjamin Wasty
|
|||||||
Ben van Basten
|
Ben van Basten
|
||||||
Bart Gallet
|
Bart Gallet
|
||||||
Axel Volley
|
Axel Volley
|
||||||
|
Arjun Ramamurthy
|
||||||
Anthousis Andreadis
|
Anthousis Andreadis
|
||||||
|
Anish Thomas
|
||||||
Andy Preece
|
Andy Preece
|
||||||
Andrew Reyonolds
|
Andrew Reyonolds
|
||||||
Andreas Roth
|
Andreas Roth
|
||||||
@@ -513,4 +530,6 @@ Alberto Jaspe
|
|||||||
Alan Purvis
|
Alan Purvis
|
||||||
Alan Ott
|
Alan Ott
|
||||||
Alan Harris
|
Alan Harris
|
||||||
|
Adrien Grandemange
|
||||||
|
Adrian Clark
|
||||||
Adam Richard
|
Adam Richard
|
||||||
|
|||||||
100
CMakeLists.txt
100
CMakeLists.txt
@@ -22,25 +22,30 @@ if(COMMAND cmake_policy)
|
|||||||
|
|
||||||
# tell CMake to prefer CMake's own CMake modules when available
|
# tell CMake to prefer CMake's own CMake modules when available
|
||||||
# only available from cmake-2.8.4
|
# only available from cmake-2.8.4
|
||||||
if(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 8 AND ${CMAKE_PATCH_VERSION} GREATER 3)
|
if(${CMAKE_MAJOR_VERSION} GREATER 2 OR
|
||||||
|
(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 8) OR
|
||||||
|
(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 8 AND ${CMAKE_PATCH_VERSION} GREATER 3))
|
||||||
cmake_policy(SET CMP0017 NEW)
|
cmake_policy(SET CMP0017 NEW)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# cmake-2.6.1 introduces policy cmp0008 decide how to treat full path libraries that do not appear to be valid library file names
|
# cmake-2.6.1 introduces policy cmp0008 decide how to treat full path libraries that do not appear to be valid library file names
|
||||||
# quote from cvslog "Such libraries worked by accident in the VS IDE and Xcode generators in CMake 2.4 and below."
|
# quote from cvslog "Such libraries worked by accident in the VS IDE and Xcode generators in CMake 2.4 and below."
|
||||||
if(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4 AND ${CMAKE_PATCH_VERSION} GREATER 0)
|
if(${CMAKE_MAJOR_VERSION} GREATER 2 OR
|
||||||
|
(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 6) OR
|
||||||
|
(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 6 AND ${CMAKE_PATCH_VERSION} GREATER 0))
|
||||||
cmake_policy(SET CMP0008 OLD)
|
cmake_policy(SET CMP0008 OLD)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# disable autolinking to qtmain as we have our own main() functions (new in Qt 5.1)
|
# disable autolinking to qtmain as we have our own main() functions (new in Qt 5.1)
|
||||||
if((${CMAKE_MAJOR_VERSION} EQUAL 2 OR ${CMAKE_MAJOR_VERSION} GREATER 2) AND
|
if(${CMAKE_MAJOR_VERSION} GREATER 2 OR
|
||||||
(${CMAKE_MINOR_VERSION} EQUAL 8 OR ${CMAKE_MINOR_VERSION} GREATER 8) AND
|
(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 8) OR
|
||||||
${CMAKE_PATCH_VERSION} GREATER 10)
|
(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 8 AND ${CMAKE_PATCH_VERSION} GREATER 10))
|
||||||
cmake_policy(SET CMP0020 OLD)
|
cmake_policy(SET CMP0020 OLD)
|
||||||
endif()
|
endif()
|
||||||
# nicer version check - but needs at least CMake 2.6.2? Worth upgrading the requirements?
|
# nicer version check - but needs at least CMake 2.6.2? Worth upgrading the requirements?
|
||||||
#if("${CMAKE_VERSION}" VERSION_GREATER 2.8.10)
|
#if("${CMAKE_VERSION}" VERSION_GREATER 2.8.10)
|
||||||
|
# or even easier (available in cmake-2.6)
|
||||||
|
#if(POLICY CMPxyzw)
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -48,12 +53,12 @@ PROJECT(OpenSceneGraph)
|
|||||||
|
|
||||||
SET(OPENSCENEGRAPH_MAJOR_VERSION 3)
|
SET(OPENSCENEGRAPH_MAJOR_VERSION 3)
|
||||||
SET(OPENSCENEGRAPH_MINOR_VERSION 2)
|
SET(OPENSCENEGRAPH_MINOR_VERSION 2)
|
||||||
SET(OPENSCENEGRAPH_PATCH_VERSION 0)
|
SET(OPENSCENEGRAPH_PATCH_VERSION 3)
|
||||||
SET(OPENSCENEGRAPH_SOVERSION 99)
|
SET(OPENSCENEGRAPH_SOVERSION 100)
|
||||||
|
|
||||||
# set to 0 when not a release candidate, non zero means that any generated
|
# set to 0 when not a release candidate, non zero means that any generated
|
||||||
# svn tags will be treated as release candidates of given number
|
# 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})
|
SET(OPENSCENEGRAPH_VERSION ${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION})
|
||||||
|
|
||||||
@@ -80,6 +85,13 @@ SET(OpenThreads_SOURCE_DIR ${OpenSceneGraph_SOURCE_DIR})
|
|||||||
# Maybe this can be used override existing behavior if needed?
|
# Maybe this can be used override existing behavior if needed?
|
||||||
SET(CMAKE_MODULE_PATH "${OpenSceneGraph_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}")
|
SET(CMAKE_MODULE_PATH "${OpenSceneGraph_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}")
|
||||||
|
|
||||||
|
|
||||||
|
# Change the default build type to Release
|
||||||
|
IF(NOT CMAKE_BUILD_TYPE)
|
||||||
|
SET(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
|
||||||
|
ENDIF(NOT CMAKE_BUILD_TYPE)
|
||||||
|
|
||||||
|
|
||||||
## Option to enable Android build using AndroidNDK
|
## Option to enable Android build using AndroidNDK
|
||||||
OPTION(OSG_BUILD_PLATFORM_ANDROID OFF)
|
OPTION(OSG_BUILD_PLATFORM_ANDROID OFF)
|
||||||
IF(OSG_BUILD_PLATFORM_ANDROID)
|
IF(OSG_BUILD_PLATFORM_ANDROID)
|
||||||
@@ -174,8 +186,8 @@ ENDIF()
|
|||||||
OPTION(OSG_MAINTAINER "Enable OpenSceneGraph maintainer build methods, such as making svn branches, tags, updating ChangeLog." OFF)
|
OPTION(OSG_MAINTAINER "Enable OpenSceneGraph maintainer build methods, such as making svn branches, tags, updating ChangeLog." OFF)
|
||||||
IF (OSG_MAINTAINER)
|
IF (OSG_MAINTAINER)
|
||||||
|
|
||||||
SET(OPENSCENEGRAPH_SVN "trunk")
|
#SET(OPENSCENEGRAPH_SVN "trunk")
|
||||||
#SET(OPENSCENEGRAPH_SVN "branches")
|
SET(OPENSCENEGRAPH_SVN "branches")
|
||||||
SET(OPENSCENEGRAPH_BRANCH OpenSceneGraph-${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION})
|
SET(OPENSCENEGRAPH_BRANCH OpenSceneGraph-${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION})
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -234,8 +246,12 @@ IF(APPLE)
|
|||||||
EXECUTE_PROCESS(COMMAND "/usr/bin/sw_vers" "-productVersion"
|
EXECUTE_PROCESS(COMMAND "/usr/bin/sw_vers" "-productVersion"
|
||||||
OUTPUT_VARIABLE OSG_OSX_SDK_NAME
|
OUTPUT_VARIABLE OSG_OSX_SDK_NAME
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
STRING(SUBSTRING "${OSG_OSX_SDK_NAME}" 0 4 OSG_OSX_SDK_NAME)
|
STRING(REPLACE "." ";" MACOS_VERSION_LIST ${OSG_OSX_SDK_NAME})
|
||||||
SET(OSG_OSX_SDK_NAME "macosx${OSG_OSX_SDK_NAME}")
|
LIST(GET MACOS_VERSION_LIST 0 MACOS_VERSION_MAJOR)
|
||||||
|
LIST(GET MACOS_VERSION_LIST 1 MACOS_VERSION_MINOR)
|
||||||
|
LIST(GET MACOS_VERSION_LIST 2 MACOS_VERSION_PATCH)
|
||||||
|
|
||||||
|
SET(OSG_OSX_SDK_NAME "macosx${MACOS_VERSION_MAJOR}.${MACOS_VERSION_MINOR}")
|
||||||
|
|
||||||
# Trying to get CMake to generate an XCode IPhone project, current efforts are to get iphoneos sdk 3.1 working
|
# Trying to get CMake to generate an XCode IPhone project, current efforts are to get iphoneos sdk 3.1 working
|
||||||
# Added option which needs manually setting to select the IPhone SDK for building. We can only have one of the below
|
# Added option which needs manually setting to select the IPhone SDK for building. We can only have one of the below
|
||||||
@@ -247,13 +263,16 @@ IF(APPLE)
|
|||||||
|
|
||||||
#you need to manually set the default sdk version here
|
#you need to manually set the default sdk version here
|
||||||
SET (IPHONE_SDKVER "6.0" CACHE STRING "IOS SDK-Version")
|
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
|
#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
|
# Force gcc <= 4.2 on iPhone
|
||||||
include(CMakeForceCompiler)
|
IF(IPHONE_VERSION_MIN LESS "6.0")
|
||||||
CMAKE_FORCE_C_COMPILER(llvm-gcc-4.2 GNU)
|
include(CMakeForceCompiler)
|
||||||
CMAKE_FORCE_CXX_COMPILER(llvm-gcc-4.2 GNU)
|
CMAKE_FORCE_C_COMPILER(llvm-gcc-4.2 GNU)
|
||||||
SET(GCC_THUMB_SUPPORT NO)
|
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
|
#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)
|
IF(OSG_BUILD_PLATFORM_IPHONE)
|
||||||
@@ -508,11 +527,17 @@ IF(WIN32 AND NOT ANDROID)
|
|||||||
INCLUDE(Find3rdPartyDependencies)
|
INCLUDE(Find3rdPartyDependencies)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
#
|
||||||
|
# If you want to prevent CMake from picking up on any of the following optional 3rd Party dependencies in CMake 2.8 onwards
|
||||||
|
# you can use the following style of command line option when invoking Cmake (here illustrating ignoring PythonLibs) :
|
||||||
|
# cmake -DCMAKE_DISABLE_FIND_PACKAGE_PythonLibs=1 .
|
||||||
|
#
|
||||||
|
|
||||||
IF(ANDROID)
|
IF(ANDROID)
|
||||||
ANDROID_3RD_PARTY()
|
ANDROID_3RD_PARTY()
|
||||||
ELSE()
|
ELSE()
|
||||||
# Common to all platforms except android:
|
# Common to all platforms except android:
|
||||||
FIND_PACKAGE(FreeType)
|
FIND_PACKAGE(Freetype)
|
||||||
FIND_PACKAGE(Inventor)
|
FIND_PACKAGE(Inventor)
|
||||||
FIND_PACKAGE(Jasper)
|
FIND_PACKAGE(Jasper)
|
||||||
FIND_PACKAGE(OpenEXR)
|
FIND_PACKAGE(OpenEXR)
|
||||||
@@ -535,7 +560,9 @@ ELSE()
|
|||||||
FIND_PACKAGE(GtkGl)
|
FIND_PACKAGE(GtkGl)
|
||||||
FIND_PACKAGE(DirectInput)
|
FIND_PACKAGE(DirectInput)
|
||||||
FIND_PACKAGE(NVTT)
|
FIND_PACKAGE(NVTT)
|
||||||
FIND_PACKAGE(Asio)
|
IF (NOT WIN32)
|
||||||
|
FIND_PACKAGE(Asio)
|
||||||
|
ENDIF()
|
||||||
FIND_PACKAGE(ZeroConf)
|
FIND_PACKAGE(ZeroConf)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
@@ -590,7 +617,14 @@ IF(OSG_USE_QT AND NOT ANDROID)
|
|||||||
|
|
||||||
#If we have found Qt5, let's try to top off by getting the webkit as well
|
#If we have found Qt5, let's try to top off by getting the webkit as well
|
||||||
IF ( Qt5Widgets_FOUND )
|
IF ( Qt5Widgets_FOUND )
|
||||||
FIND_PACKAGE(Qt5WebKitWidgets)
|
FIND_PACKAGE(Qt5WebKitWidgets QUIET)
|
||||||
|
|
||||||
|
IF(COMMAND cmake_policy)
|
||||||
|
IF(${CMAKE_MAJOR_VERSION} GREATER 2)
|
||||||
|
# Qt5 qt5_use_modules usage was causing "Policy CMP0043 is not set: Ignore COMPILE_DEFINITIONS_<Config> properties." warnings
|
||||||
|
cmake_policy(SET CMP0043 NEW)
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
@@ -790,11 +824,7 @@ IF(CMAKE_COMPILER_IS_GNUCXX)
|
|||||||
# returns too many hits.
|
# returns too many hits.
|
||||||
# FYI, if we do implement GNUCC, then -Wmissing-prototypes in another
|
# FYI, if we do implement GNUCC, then -Wmissing-prototypes in another
|
||||||
# interesting C-specific flag.
|
# interesting C-specific flag.
|
||||||
# Also, there is a bug in gcc 4.0. Under C++, -pedantic will create
|
SET(OSG_AGGRESSIVE_WARNING_FLAGS -Wall -Wparentheses -Wno-long-long -Wno-import -pedantic -Wreturn-type -Wmissing-braces -Wunknown-pragmas -Wunused)
|
||||||
# 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)
|
|
||||||
|
|
||||||
# Previous included -Wformat=2 in OSG_AGGRESSIVE_WARNING_FLAGS but had to remove it due to standard library errors
|
# Previous included -Wformat=2 in OSG_AGGRESSIVE_WARNING_FLAGS but had to remove it due to standard library errors
|
||||||
|
|
||||||
@@ -811,6 +841,14 @@ ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
|||||||
# CMake lacks an elseif, so other non-gcc, non-VS compilers need
|
# CMake lacks an elseif, so other non-gcc, non-VS compilers need
|
||||||
# to be listed below. If unhandled, OSG_AGGRESSIVE_WARNING_FLAGS should
|
# to be listed below. If unhandled, OSG_AGGRESSIVE_WARNING_FLAGS should
|
||||||
# remain unset.
|
# 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()
|
ENDIF()
|
||||||
|
|
||||||
# This part is for the CMake menu option to toggle the warnings on/off.
|
# This part is for the CMake menu option to toggle the warnings on/off.
|
||||||
@@ -870,8 +908,14 @@ IF(APPLE AND NOT ANDROID)
|
|||||||
|
|
||||||
#set iphone arch and flags taken from http://sites.google.com/site/michaelsafyan/coding/resources/how-to-guides/cross-compile-for-the-iphone/how-to-cross-compile-for-the-iphone-using-cmake
|
#set iphone arch and flags taken from http://sites.google.com/site/michaelsafyan/coding/resources/how-to-guides/cross-compile-for-the-iphone/how-to-cross-compile-for-the-iphone-using-cmake
|
||||||
IF(OSG_BUILD_PLATFORM_IPHONE)
|
IF(OSG_BUILD_PLATFORM_IPHONE)
|
||||||
SET(CMAKE_OSX_ARCHITECTURES "armv6;armv7" CACHE STRING "Build architectures for iOS" FORCE)
|
IF(${IPHONE_VERSION_MIN} LESS "7.0")
|
||||||
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)
|
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()
|
ELSE()
|
||||||
#simulator uses i386 architectures
|
#simulator uses i386 architectures
|
||||||
SET(CMAKE_OSX_ARCHITECTURES "i386" CACHE STRING "Build architectures for iOS Simulator" FORCE)
|
SET(CMAKE_OSX_ARCHITECTURES "i386" CACHE STRING "Build architectures for iOS Simulator" FORCE)
|
||||||
@@ -903,7 +947,7 @@ IF(APPLE AND NOT ANDROID)
|
|||||||
# FORCE is used because the options are not reflected in the UI otherwise.
|
# 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.
|
# Seems like a good place to add version specific compiler flags too.
|
||||||
IF(NOT OSG_CONFIG_HAS_BEEN_RUN_BEFORE)
|
IF(NOT OSG_CONFIG_HAS_BEEN_RUN_BEFORE)
|
||||||
IF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.8")
|
IF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.8" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.9" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.10")
|
||||||
SET(OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX "imageio" CACHE STRING "Forced imageio default image plugin for OSX" FORCE)
|
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
|
# 64 Bit Works, i386,ppc is not supported any more
|
||||||
SET(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "Build architectures for OSX" FORCE)
|
SET(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "Build architectures for OSX" FORCE)
|
||||||
|
|||||||
@@ -15,123 +15,143 @@ IF (OPENTHREADS_ATOMIC_USE_MUTEX)
|
|||||||
SET(_OPENTHREADS_ATOMIC_USE_MUTEX 1)
|
SET(_OPENTHREADS_ATOMIC_USE_MUTEX 1)
|
||||||
|
|
||||||
ELSE()
|
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,
|
ELSE()
|
||||||
CHECK_CXX_SOURCE_RUNS("
|
INCLUDE(CheckCXXSourceRuns)
|
||||||
#include <cstdlib>
|
|
||||||
|
|
||||||
int main()
|
# Do step by step checking,
|
||||||
{
|
CHECK_CXX_SOURCE_RUNS("
|
||||||
unsigned value = 0;
|
#include <cstdlib>
|
||||||
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;
|
|
||||||
|
|
||||||
if (!__sync_bool_compare_and_swap(&ptr, ptr, ptr))
|
int main()
|
||||||
return EXIT_FAILURE;
|
{
|
||||||
|
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;
|
if (!__sync_bool_compare_and_swap(&ptr, ptr, ptr))
|
||||||
}
|
return EXIT_FAILURE;
|
||||||
" _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS)
|
|
||||||
|
|
||||||
CHECK_CXX_SOURCE_RUNS("
|
return EXIT_SUCCESS;
|
||||||
#include <stdlib.h>
|
}
|
||||||
|
" _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS)
|
||||||
|
|
||||||
int main(int, const char**)
|
CHECK_CXX_SOURCE_RUNS("
|
||||||
{
|
#include <stdlib.h>
|
||||||
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;
|
|
||||||
|
|
||||||
if (!__compare_and_swap((unsigned long*)&ptr, (unsigned long)ptr, (unsigned long)ptr))
|
int main(int, const char**)
|
||||||
return EXIT_FAILURE;
|
{
|
||||||
|
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;
|
if (!__compare_and_swap((unsigned long*)&ptr, (unsigned long)ptr, (unsigned long)ptr))
|
||||||
}
|
return EXIT_FAILURE;
|
||||||
" _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS)
|
|
||||||
|
|
||||||
CHECK_CXX_SOURCE_RUNS("
|
return EXIT_SUCCESS;
|
||||||
#include <atomic.h>
|
}
|
||||||
#include <cstdlib>
|
" _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS)
|
||||||
|
|
||||||
int main(int, const char**)
|
CHECK_CXX_SOURCE_RUNS("
|
||||||
{
|
#include <atomic.h>
|
||||||
uint_t value = 0;
|
#include <cstdlib>
|
||||||
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;
|
|
||||||
|
|
||||||
if (ptr != atomic_cas_ptr(&ptr, ptr, ptr))
|
int main(int, const char**)
|
||||||
return EXIT_FAILURE;
|
{
|
||||||
|
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;
|
if (ptr != atomic_cas_ptr(&ptr, ptr, ptr))
|
||||||
}
|
return EXIT_FAILURE;
|
||||||
" _OPENTHREADS_ATOMIC_USE_SUN)
|
|
||||||
|
|
||||||
CHECK_CXX_SOURCE_RUNS("
|
return EXIT_SUCCESS;
|
||||||
#include <windows.h>
|
}
|
||||||
#include <intrin.h>
|
" _OPENTHREADS_ATOMIC_USE_SUN)
|
||||||
#include <cstdlib>
|
|
||||||
|
|
||||||
#pragma intrinsic(_InterlockedAnd)
|
CHECK_CXX_SOURCE_RUNS("
|
||||||
#pragma intrinsic(_InterlockedOr)
|
#include <windows.h>
|
||||||
#pragma intrinsic(_InterlockedXor)
|
#include <intrin.h>
|
||||||
|
#include <cstdlib>
|
||||||
|
|
||||||
int main(int, const char**)
|
#pragma intrinsic(_InterlockedAnd)
|
||||||
{
|
#pragma intrinsic(_InterlockedOr)
|
||||||
volatile long value = 0;
|
#pragma intrinsic(_InterlockedXor)
|
||||||
long data = 0;
|
|
||||||
long* volatile ptr = &data;
|
|
||||||
|
|
||||||
InterlockedIncrement(&value);
|
int main(int, const char**)
|
||||||
MemoryBarrier();
|
{
|
||||||
InterlockedDecrement(&value);
|
volatile long value = 0;
|
||||||
|
long data = 0;
|
||||||
|
long* volatile ptr = &data;
|
||||||
|
|
||||||
if (0 != InterlockedCompareExchange(&value, 1, 0))
|
InterlockedIncrement(&value);
|
||||||
return EXIT_FAILURE;
|
MemoryBarrier();
|
||||||
|
InterlockedDecrement(&value);
|
||||||
|
|
||||||
if (ptr != InterlockedCompareExchangePointer((PVOID volatile*)&ptr, (PVOID)ptr, (PVOID)ptr))
|
if (0 != InterlockedCompareExchange(&value, 1, 0))
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
if (ptr != InterlockedCompareExchangePointer((PVOID volatile*)&ptr, (PVOID)ptr, (PVOID)ptr))
|
||||||
}
|
return EXIT_FAILURE;
|
||||||
" _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED)
|
|
||||||
|
|
||||||
CHECK_CXX_SOURCE_RUNS("
|
return EXIT_SUCCESS;
|
||||||
#include <libkern/OSAtomic.h>
|
}
|
||||||
|
" _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED)
|
||||||
|
|
||||||
int main()
|
CHECK_CXX_SOURCE_RUNS("
|
||||||
{
|
#include <libkern/OSAtomic.h>
|
||||||
volatile int32_t value = 0;
|
|
||||||
long data = 0;
|
|
||||||
long * volatile ptr = &data;
|
|
||||||
|
|
||||||
OSAtomicIncrement32(&value);
|
int main()
|
||||||
OSMemoryBarrier();
|
{
|
||||||
OSAtomicDecrement32(&value);
|
volatile int32_t value = 0;
|
||||||
OSAtomicCompareAndSwapInt(value, 1, &value);
|
long data = 0;
|
||||||
OSAtomicCompareAndSwapPtr(ptr, ptr, (void * volatile *)&ptr);
|
long * volatile ptr = &data;
|
||||||
}
|
|
||||||
" _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC)
|
OSAtomicIncrement32(&value);
|
||||||
|
OSMemoryBarrier();
|
||||||
|
OSAtomicDecrement32(&value);
|
||||||
|
OSAtomicCompareAndSwapInt(value, 1, &value);
|
||||||
|
OSAtomicCompareAndSwapPtr(ptr, ptr, (void * volatile *)&ptr);
|
||||||
|
}
|
||||||
|
" _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC)
|
||||||
|
|
||||||
|
IF(NOT _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS AND
|
||||||
|
NOT _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS AND
|
||||||
|
NOT _OPENTHREADS_ATOMIC_USE_SUN AND
|
||||||
|
NOT _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED AND
|
||||||
|
NOT _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC)
|
||||||
|
SET(_OPENTHREADS_ATOMIC_USE_MUTEX 1)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
|
||||||
|
# MinGW can set both WIN32_INTERLOCKED and GCC_BUILTINS to true which results in compliation errors
|
||||||
|
IF (_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS AND _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED)
|
||||||
|
# In this case we prefer the GCC_BUILTINS
|
||||||
|
SET(_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS 1)
|
||||||
|
SET(_OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED 0)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
IF(NOT _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS AND
|
|
||||||
NOT _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS AND
|
|
||||||
NOT _OPENTHREADS_ATOMIC_USE_SUN AND
|
|
||||||
NOT _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED AND
|
|
||||||
NOT _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC)
|
|
||||||
SET(_OPENTHREADS_ATOMIC_USE_MUTEX 1)
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
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)
|
MACRO(SEARCH_3RDPARTY OSG_3RDPARTY_BIN)
|
||||||
@@ -86,7 +86,7 @@ MACRO(SEARCH_3RDPARTY OSG_3RDPARTY_BIN)
|
|||||||
MARK_AS_ADVANCED(PNG_PNG_INCLUDE_DIR)
|
MARK_AS_ADVANCED(PNG_PNG_INCLUDE_DIR)
|
||||||
ENDIF(PNG_FOUND)
|
ENDIF(PNG_FOUND)
|
||||||
ENDIF(ZLIB_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)
|
IF(LIBXML2_FOUND)
|
||||||
# The CMAKE find libxml module uses LIBXML2_LIBRARIES -> fill it.... kind of a hack
|
# The CMAKE find libxml module uses LIBXML2_LIBRARIES -> fill it.... kind of a hack
|
||||||
SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARY} CACHE FILEPATH "" FORCE)
|
SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARY} CACHE FILEPATH "" FORCE)
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
# This module defines
|
# This module defines
|
||||||
# AV_FOUNDATION_LIBRARY
|
# AV_FOUNDATION_LIBRARY
|
||||||
# AV_FOUNDATION_FOUND, if false, do not try to link to gdal
|
# AV_FOUNDATION_FOUND, if false, do not try to link to gdal
|
||||||
# AV_FOUNDATION_INCLUDE_DIR, where to find the headers
|
|
||||||
#
|
#
|
||||||
# $AV_FOUNDATION_DIR is an environment variable that would
|
# $AV_FOUNDATION_DIR is an environment variable that would
|
||||||
# correspond to the ./configure --prefix=$AV_FOUNDATION_DIR
|
# correspond to the ./configure --prefix=$AV_FOUNDATION_DIR
|
||||||
@@ -11,12 +10,11 @@
|
|||||||
|
|
||||||
|
|
||||||
IF(APPLE)
|
IF(APPLE)
|
||||||
FIND_PATH(AV_FOUNDATION_INCLUDE_DIR AVFoundation/AVFoundation.h)
|
|
||||||
FIND_LIBRARY(AV_FOUNDATION_LIBRARY AVFoundation)
|
FIND_LIBRARY(AV_FOUNDATION_LIBRARY AVFoundation)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
SET(AV_FOUNDATION_FOUND "NO")
|
SET(AV_FOUNDATION_FOUND "NO")
|
||||||
IF(AV_FOUNDATION_LIBRARY AND AV_FOUNDATION_INCLUDE_DIR)
|
IF(AV_FOUNDATION_LIBRARY)
|
||||||
SET(AV_FOUNDATION_FOUND "YES")
|
SET(AV_FOUNDATION_FOUND "YES")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
@@ -32,7 +30,7 @@ ELSE()
|
|||||||
# AVFoundation exists since 10.7, but only 10.8 has all features necessary for OSG
|
# AVFoundation exists since 10.7, but only 10.8 has all features necessary for OSG
|
||||||
# so check the SDK-setting
|
# so check the SDK-setting
|
||||||
|
|
||||||
IF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.8")
|
IF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.8" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.9" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.10")
|
||||||
# nothing special here ;-)
|
# nothing special here ;-)
|
||||||
ELSE()
|
ELSE()
|
||||||
MESSAGE("AVFoundation disabled for SDK < 10.8")
|
MESSAGE("AVFoundation disabled for SDK < 10.8")
|
||||||
|
|||||||
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")
|
SET(COLLADA_BUILDNAME "mac")
|
||||||
ELSEIF(MINGW)
|
ELSEIF(MINGW)
|
||||||
SET(COLLADA_BUILDNAME "mingw")
|
SET(COLLADA_BUILDNAME "mingw")
|
||||||
|
ELSEIF(MSVC12)
|
||||||
|
SET(COLLADA_BUILDNAME "vc12")
|
||||||
|
ELSEIF(MSVC11)
|
||||||
|
SET(COLLADA_BUILDNAME "vc11")
|
||||||
ELSEIF(MSVC10)
|
ELSEIF(MSVC10)
|
||||||
SET(COLLADA_BUILDNAME "vc10")
|
SET(COLLADA_BUILDNAME "vc10")
|
||||||
ELSEIF(MSVC90)
|
ELSEIF(MSVC90)
|
||||||
@@ -238,7 +242,7 @@ FIND_LIBRARY(COLLADA_STATIC_LIBRARY_DEBUG
|
|||||||
)
|
)
|
||||||
|
|
||||||
FIND_LIBRARY(COLLADA_BOOST_FILESYSTEM_LIBRARY
|
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
|
PATHS
|
||||||
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
|
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
|
||||||
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
|
${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
|
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
|
PATHS
|
||||||
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
|
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
|
||||||
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
|
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
|
||||||
@@ -254,7 +258,7 @@ FIND_LIBRARY(COLLADA_STATIC_LIBRARY_DEBUG
|
|||||||
)
|
)
|
||||||
|
|
||||||
FIND_LIBRARY(COLLADA_BOOST_SYSTEM_LIBRARY
|
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
|
PATHS
|
||||||
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
|
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
|
||||||
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
|
${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
|
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
|
PATHS
|
||||||
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
|
${COLLADA_DOM_ROOT}/external-libs/boost/lib/${COLLADA_BUILDNAME}
|
||||||
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
|
${COLLADA_DOM_ROOT}/external-libs/boost/lib/mingw
|
||||||
|
|||||||
@@ -18,8 +18,10 @@ ELSEIF(MSVC90)
|
|||||||
SET(FBX_LIBDIR "vs2008")
|
SET(FBX_LIBDIR "vs2008")
|
||||||
ELSEIF(MSVC10)
|
ELSEIF(MSVC10)
|
||||||
SET(FBX_LIBDIR "vs2010")
|
SET(FBX_LIBDIR "vs2010")
|
||||||
ELSEIF(MSVC11 OR MSVC_VERSION>1700)
|
ELSEIF(MSVC11)
|
||||||
SET(FBX_LIBDIR "vs2012")
|
SET(FBX_LIBDIR "vs2012")
|
||||||
|
ELSEIF(MSVC12 OR MSVC_VERSION>1800)
|
||||||
|
SET(FBX_LIBDIR "vs2013")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(APPLE)
|
IF(APPLE)
|
||||||
@@ -32,6 +34,8 @@ ELSE()
|
|||||||
SET(FBX_LIBDIR ${FBX_LIBDIR}/x86)
|
SET(FBX_LIBDIR ${FBX_LIBDIR}/x86)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
#try to use 2015.1 or 2014.2 version
|
||||||
|
|
||||||
IF(APPLE)
|
IF(APPLE)
|
||||||
SET(FBX_LIBNAME "libfbxsdk")
|
SET(FBX_LIBNAME "libfbxsdk")
|
||||||
ELSEIF(CMAKE_COMPILER_IS_GNUCXX)
|
ELSEIF(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
@@ -44,10 +48,15 @@ SET(FBX_LIBNAME_DEBUG ${FBX_LIBNAME}d)
|
|||||||
|
|
||||||
SET( FBX_SEARCH_PATHS
|
SET( FBX_SEARCH_PATHS
|
||||||
$ENV{FBX_DIR}
|
$ENV{FBX_DIR}
|
||||||
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2014.1"
|
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2015.1"
|
||||||
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2014.1"
|
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2015.1"
|
||||||
|
/Applications/Autodesk/FBXSDK20151
|
||||||
|
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2014.2"
|
||||||
|
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2014.2"
|
||||||
|
/Applications/Autodesk/FBXSDK20142
|
||||||
/Applications/Autodesk/FBXSDK20141
|
/Applications/Autodesk/FBXSDK20141
|
||||||
)
|
)
|
||||||
|
#I think the last line in the search path is an old typo, but let's search for 2014.1 anyway - LV
|
||||||
|
|
||||||
# search for headers & debug/release libraries
|
# search for headers & debug/release libraries
|
||||||
FIND_PATH(FBX_INCLUDE_DIR "fbxsdk.h"
|
FIND_PATH(FBX_INCLUDE_DIR "fbxsdk.h"
|
||||||
@@ -74,21 +83,21 @@ ELSE()
|
|||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(NOT FBX_FOUND)
|
IF(NOT FBX_FOUND)
|
||||||
#try to use 2013.3 version
|
#try to use 2014.1 version
|
||||||
IF(APPLE)
|
IF(APPLE)
|
||||||
SET(FBX_LIBNAME "fbxsdk-2013.3-static")
|
SET(FBX_LIBNAME "fbxsdk-2014.1")
|
||||||
ELSEIF(CMAKE_COMPILER_IS_GNUCXX)
|
ELSEIF(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
SET(FBX_LIBNAME "fbxsdk-2013.3-static")
|
SET(FBX_LIBNAME "fbxsdk-2014.1")
|
||||||
ELSE()
|
ELSE()
|
||||||
SET(FBX_LIBNAME "fbxsdk-2013.3-md")
|
SET(FBX_LIBNAME "fbxsdk-2014.1")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
SET(FBX_LIBNAME_DEBUG ${FBX_LIBNAME}d)
|
SET(FBX_LIBNAME_DEBUG ${FBX_LIBNAME}d)
|
||||||
|
|
||||||
SET( FBX_SEARCH_PATHS
|
SET( FBX_SEARCH_PATHS
|
||||||
$ENV{FBX_DIR}
|
$ENV{FBX_DIR}
|
||||||
$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2013.3
|
$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2014.1
|
||||||
$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2013.3
|
$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2014.1
|
||||||
/Applications/Autodesk/FBXSDK20141
|
/Applications/Autodesk/FBXSDK20141
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -110,3 +119,41 @@ IF(NOT FBX_FOUND)
|
|||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
IF(NOT FBX_FOUND)
|
||||||
|
#try to use 2013.3 version
|
||||||
|
IF(APPLE)
|
||||||
|
SET(FBX_LIBNAME "fbxsdk-2013.3-static")
|
||||||
|
ELSEIF(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
SET(FBX_LIBNAME "fbxsdk-2013.3-static")
|
||||||
|
ELSE()
|
||||||
|
SET(FBX_LIBNAME "fbxsdk-2013.3-md")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
SET(FBX_LIBNAME_DEBUG ${FBX_LIBNAME}d)
|
||||||
|
|
||||||
|
SET( FBX_SEARCH_PATHS
|
||||||
|
$ENV{FBX_DIR}
|
||||||
|
$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2013.3
|
||||||
|
$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2013.3
|
||||||
|
/Applications/Autodesk/FBXSDK20133
|
||||||
|
)
|
||||||
|
|
||||||
|
# search for headers & debug/release libraries
|
||||||
|
FIND_PATH(FBX_INCLUDE_DIR "fbxsdk.h"
|
||||||
|
PATHS ${FBX_SEARCH_PATHS}
|
||||||
|
PATH_SUFFIXES "include")
|
||||||
|
FIND_LIBRARY( FBX_LIBRARY ${FBX_LIBNAME}
|
||||||
|
PATHS ${FBX_SEARCH_PATHS}
|
||||||
|
PATH_SUFFIXES "lib/${FBX_LIBDIR}")
|
||||||
|
|
||||||
|
FIND_LIBRARY( FBX_LIBRARY_DEBUG ${FBX_LIBNAME_DEBUG}
|
||||||
|
PATHS ${FBX_SEARCH_PATHS}
|
||||||
|
PATH_SUFFIXES "lib/${FBX_LIBDIR}")
|
||||||
|
IF(FBX_LIBRARY AND FBX_LIBRARY_DEBUG AND FBX_INCLUDE_DIR)
|
||||||
|
SET(FBX_FOUND "YES")
|
||||||
|
ELSE()
|
||||||
|
SET(FBX_FOUND "NO")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
ENDIF()
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ FIND_PATH(FREETYPE_INCLUDE_DIR_ft2build ft2build.h
|
|||||||
/opt/csw
|
/opt/csw
|
||||||
/opt
|
/opt
|
||||||
/usr/freeware
|
/usr/freeware
|
||||||
PATH_SUFFIXES include
|
PATH_SUFFIXES include include/freetype2
|
||||||
)
|
)
|
||||||
|
|
||||||
FIND_PATH(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h
|
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
|
/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
|
FIND_LIBRARY(FREETYPE_LIBRARY
|
||||||
NAMES freetype libfreetype freetype219
|
NAMES freetype libfreetype freetype219
|
||||||
PATHS
|
PATHS
|
||||||
@@ -15,6 +15,7 @@ FIND_PATH(NVTT_INCLUDE_DIR nvtt/nvtt.h
|
|||||||
PATH_SUFFIXES include
|
PATH_SUFFIXES include
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# NVTT
|
||||||
FIND_LIBRARY(NVTT_LIBRARY
|
FIND_LIBRARY(NVTT_LIBRARY
|
||||||
NAMES nvtt
|
NAMES nvtt
|
||||||
PATHS
|
PATHS
|
||||||
@@ -25,6 +26,17 @@ FIND_LIBRARY(NVTT_LIBRARY
|
|||||||
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
|
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
|
FIND_LIBRARY(NVIMAGE_LIBRARY
|
||||||
NAMES nvimage
|
NAMES nvimage
|
||||||
PATHS
|
PATHS
|
||||||
@@ -35,6 +47,17 @@ FIND_LIBRARY(NVIMAGE_LIBRARY
|
|||||||
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
|
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
|
FIND_LIBRARY(NVMATH_LIBRARY
|
||||||
NAMES nvmath
|
NAMES nvmath
|
||||||
PATHS
|
PATHS
|
||||||
@@ -45,6 +68,17 @@ FIND_LIBRARY(NVMATH_LIBRARY
|
|||||||
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
|
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
|
FIND_LIBRARY(NVCORE_LIBRARY
|
||||||
NAMES nvcore
|
NAMES nvcore
|
||||||
PATHS
|
PATHS
|
||||||
@@ -54,6 +88,18 @@ FIND_LIBRARY(NVCORE_LIBRARY
|
|||||||
${3rdPartyRoot}
|
${3rdPartyRoot}
|
||||||
PATH_SUFFIXES lib64 lib lib/shared lib/static lib64/static
|
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")
|
SET(NVTT_FOUND "NO")
|
||||||
IF(NVTT_LIBRARY AND NVTT_INCLUDE_DIR)
|
IF(NVTT_LIBRARY AND NVTT_INCLUDE_DIR)
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ FIND_OSG_LIBRARY(OSGANIMATION_LIBRARY osgAnimation)
|
|||||||
FIND_OSG_LIBRARY(OSGPARTICLE_LIBRARY osgParticle)
|
FIND_OSG_LIBRARY(OSGPARTICLE_LIBRARY osgParticle)
|
||||||
FIND_OSG_LIBRARY(OSGSHADOW_LIBRARY osgShadow)
|
FIND_OSG_LIBRARY(OSGSHADOW_LIBRARY osgShadow)
|
||||||
FIND_OSG_LIBRARY(OSGPRESENTATION_LIBRARY osgPresentation)
|
FIND_OSG_LIBRARY(OSGPRESENTATION_LIBRARY osgPresentation)
|
||||||
FIND_OSG_LIBRARY(OSGSIM osgSim)
|
FIND_OSG_LIBRARY(OSGSIM_LIBRARY osgSim)
|
||||||
FIND_OSG_LIBRARY(OPENTHREADS_LIBRARY OpenThreads)
|
FIND_OSG_LIBRARY(OPENTHREADS_LIBRARY OpenThreads)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ ELSE()
|
|||||||
ENDIF()
|
ENDIF()
|
||||||
# Disable quicktime for >= 10.7, as it's officially deprecated
|
# Disable quicktime for >= 10.7, as it's officially deprecated
|
||||||
|
|
||||||
IF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.7" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.8" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.9")
|
IF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.7" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.8" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.9" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.10")
|
||||||
MESSAGE("disabling quicktime because it's not supported by the selected SDK ${OSG_OSX_SDK_NAME}")
|
MESSAGE("disabling quicktime because it's not supported by the selected SDK ${OSG_OSX_SDK_NAME}")
|
||||||
SET(QUICKTIME_FOUND "NO")
|
SET(QUICKTIME_FOUND "NO")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|||||||
@@ -5,7 +5,9 @@ IF(PKG_CONFIG_FOUND)
|
|||||||
|
|
||||||
INCLUDE(FindPkgConfig)
|
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)
|
PKG_CHECK_MODULES(CAIRO cairo)
|
||||||
|
|
||||||
IF (RSVG_FOUND AND NOT CAIRO_FOUND)
|
IF (RSVG_FOUND AND NOT CAIRO_FOUND)
|
||||||
|
|||||||
0
CMakeModules/FindZeroConf.cmake
Executable file → Normal file
0
CMakeModules/FindZeroConf.cmake
Executable file → Normal file
@@ -224,6 +224,9 @@ MACRO(SETUP_LIBRARY LIB_NAME)
|
|||||||
${TARGET_SRC}
|
${TARGET_SRC}
|
||||||
)
|
)
|
||||||
SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES FOLDER "OSG Core")
|
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)
|
IF(TARGET_LABEL)
|
||||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PROJECT_LABEL "${TARGET_LABEL}")
|
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PROJECT_LABEL "${TARGET_LABEL}")
|
||||||
ENDIF(TARGET_LABEL)
|
ENDIF(TARGET_LABEL)
|
||||||
@@ -279,12 +282,7 @@ MACRO(SETUP_PLUGIN PLUGIN_NAME)
|
|||||||
ADD_LIBRARY(${TARGET_TARGETNAME} STATIC ${TARGET_SRC} ${TARGET_H})
|
ADD_LIBRARY(${TARGET_TARGETNAME} STATIC ${TARGET_SRC} ${TARGET_H})
|
||||||
ENDIF(DYNAMIC_OPENSCENEGRAPH)
|
ENDIF(DYNAMIC_OPENSCENEGRAPH)
|
||||||
|
|
||||||
#not sure if needed, but for plugins only Msvc need the d suffix
|
IF(MSVC)
|
||||||
IF(NOT MSVC)
|
|
||||||
IF(NOT UNIX)
|
|
||||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES DEBUG_POSTFIX "")
|
|
||||||
ENDIF(NOT UNIX)
|
|
||||||
ELSE(NOT MSVC)
|
|
||||||
IF(NOT CMAKE24)
|
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
|
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)
|
ELSE(NOT CMAKE24)
|
||||||
@@ -313,11 +311,13 @@ MACRO(SETUP_PLUGIN PLUGIN_NAME)
|
|||||||
ENDIF(OSG_MSVC_VERSIONED_DLL)
|
ENDIF(OSG_MSVC_VERSIONED_DLL)
|
||||||
|
|
||||||
ENDIF(NOT CMAKE24)
|
ENDIF(NOT CMAKE24)
|
||||||
ENDIF(NOT MSVC)
|
ENDIF(MSVC)
|
||||||
|
|
||||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PROJECT_LABEL "${TARGET_LABEL}")
|
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PROJECT_LABEL "${TARGET_LABEL}")
|
||||||
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES FOLDER "Plugins")
|
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES FOLDER "Plugins")
|
||||||
|
IF(APPLE)
|
||||||
|
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_WARNING_CFLAGS "")
|
||||||
|
ENDIF()
|
||||||
SETUP_LINK_LIBRARIES()
|
SETUP_LINK_LIBRARIES()
|
||||||
|
|
||||||
#the installation path are differentiated for win32 that install in bib versus other architecture that install in lib${LIB_POSTFIX}/${OSG_PLUGINS}
|
#the installation path are differentiated for win32 that install in bib versus other architecture that install in lib${LIB_POSTFIX}/${OSG_PLUGINS}
|
||||||
@@ -363,6 +363,8 @@ MACRO(SETUP_EXE IS_COMMANDLINE_APP)
|
|||||||
# Bundle version is the version the OS looks at.
|
# 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_BUNDLE_VERSION "${OPENSCENEGRAPH_MAJOR_VERSION}.${OPENSCENEGRAPH_MINOR_VERSION}.${OPENSCENEGRAPH_PATCH_VERSION}")
|
||||||
SET(MACOSX_BUNDLE_GUI_IDENTIFIER "org.openscenegraph.${TARGET_TARGETNAME}" )
|
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_BUNDLE_NAME "${TARGET_NAME}" )
|
||||||
# SET(MACOSX_BUNDLE_ICON_FILE "myicon.icns")
|
# SET(MACOSX_BUNDLE_ICON_FILE "myicon.icns")
|
||||||
# SET(MACOSX_BUNDLE_COPYRIGHT "")
|
# SET(MACOSX_BUNDLE_COPYRIGHT "")
|
||||||
@@ -396,6 +398,10 @@ MACRO(SETUP_EXE IS_COMMANDLINE_APP)
|
|||||||
SET_OUTPUT_DIR_PROPERTY_260(${TARGET_TARGETNAME} "") # Ensure the /Debug /Release are removed
|
SET_OUTPUT_DIR_PROPERTY_260(${TARGET_TARGETNAME} "") # Ensure the /Debug /Release are removed
|
||||||
ENDIF(MSVC_IDE AND OSG_MSVC_VERSIONED_DLL)
|
ENDIF(MSVC_IDE AND OSG_MSVC_VERSIONED_DLL)
|
||||||
|
|
||||||
|
IF(APPLE)
|
||||||
|
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES XCODE_ATTRIBUTE_WARNING_CFLAGS "")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
SETUP_LINK_LIBRARIES()
|
SETUP_LINK_LIBRARIES()
|
||||||
|
|
||||||
ENDMACRO(SETUP_EXE)
|
ENDMACRO(SETUP_EXE)
|
||||||
@@ -521,3 +527,7 @@ MACRO(HANDLE_MSVC_DLL)
|
|||||||
# SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../../bin/osg${OPENSCENEGRAPH_SOVERSION}-")
|
# SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../../bin/osg${OPENSCENEGRAPH_SOVERSION}-")
|
||||||
# SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES IMPORT_PREFIX "../")
|
# SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES IMPORT_PREFIX "../")
|
||||||
ENDMACRO(HANDLE_MSVC_DLL)
|
ENDMACRO(HANDLE_MSVC_DLL)
|
||||||
|
|
||||||
|
MACRO(REMOVE_CXX_FLAG flag)
|
||||||
|
STRING(REPLACE "${flag}" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||||
|
ENDMACRO()
|
||||||
|
|||||||
108
NEWS.txt
108
NEWS.txt
@@ -1,6 +1,114 @@
|
|||||||
OSG News
|
OSG News
|
||||||
========
|
========
|
||||||
|
|
||||||
|
|
||||||
|
= OpenSceneGraph 3.2.2 maintance release provides a number of bug and build fixes over the 3.2.1 stable release
|
||||||
|
|
||||||
|
PERTHSHIRE, Scotland - 4th August 2015 - OpenSceneGraph Professional Services announces the release of OpenSceneGraph 3.2.2, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. OpenSceneGraph 3.2.2 is written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modeling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. OpenSceneGraph 3.2.2 runs on all Microsoft Windows platforms, Apple OS/X, IOS, GNU/Linux, Android, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems.
|
||||||
|
|
||||||
|
=== Open-source development delivers industry-leading features and performance ===
|
||||||
|
The OpenSceneGraph 3.2.2 stable release is the culmination of 16 years of work by the open-source community that has grown up around the project. This point release is fully binary compatible with the 3.2.0 and 3.2.1 stable releases. The changes made are focused on addressing bugs and improving build support for latest compilers, OS updates and 3rd changes to Party Libraries.
|
||||||
|
|
||||||
|
=== Downloads and Licensing ===
|
||||||
|
OpenSceneGraph is open-source, so full source code is provided, and can be copied, modified and used free of charge for commercial and non-commercial use. Access to the source allows end users greater flexibility in how they develop, debug and deploy their applications. They gain productivity and freedom by being able to leverage the tool chain in accordance with their own release cycles. Downloads of binaries and source can be found in the [http://www.openscenegraph.org/index.php/download-section/stable-releases Downloads] section of the openscenegraph.org website.
|
||||||
|
|
||||||
|
OpenSceneGraph is released under the [http://www.openscenegraph.org/projects/osg/wiki/Legal OpenSceneGraph Public License], which is based on the Lesser GNU Public License (LGPL), permitting the software to be used free of charge across the full spectrum of commercial and open-source applications. Furthermore, it allows both static and dynamic linking of the OpenSceneGraph libraries without restricting the licensing of the user's software.
|
||||||
|
|
||||||
|
=== Professional support and services ===
|
||||||
|
OpenSceneGraph project is backed up with professional services by [http://www.openscenegraph.com OpenSceneGraph Professional Services], based in Scotland, and [http://www.alphapixel.com AlphaPixel] based in the USA, and a range of [wiki:Community/Contractors Contractors] from around the world. Services available include:
|
||||||
|
|
||||||
|
* Confidential Professional Support
|
||||||
|
* Bespoke development
|
||||||
|
* Consultancy
|
||||||
|
* Training
|
||||||
|
|
||||||
|
=== Community support and contributions ===
|
||||||
|
The diverse and growing community of over 5000 developers is centred around the public osg-users mailing list/forum, where members discuss how best to use OpenSceneGraph, provide mutual support, and coordinate development of new features and bug fixes. Members of this community come from many different countries with backgrounds ranging from some of the world's largest aerospace companies, game companies, and visual simulation specialists to university researchers, students and hobbyists.
|
||||||
|
|
||||||
|
The OpenSceneGraph project owes a great deal to the community for its development and support, in particular we wish to thank the [http://www.openscenegraph.org/index.php/about/197-contributors-to-openscenegraph-3-2-2 individuals] from around the world that have directly contributed to the development and refinement of the OpenSceneGraph code base.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
= OpenSceneGraph 3.2.1 stable release provides a number of bug and build fixes to the 3.2.0 stable release
|
||||||
|
|
||||||
|
PERTHSHIRE, Scotland - 4th July 2014 - OpenSceneGraph Professional Services announces the release of OpenSceneGraph 3.2.1, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. OpenSceneGraph 3.2 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modeling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. OpenSceneGraph 3.2 runs on all Microsoft Windows platforms, Apple OS/X, IOS, GNU/Linux, Android, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems.
|
||||||
|
|
||||||
|
=== Open-source development delivers industry-leading features and performance ===
|
||||||
|
The OpenSceneGraph 3.2.1 stable release is the culmination of 15 years of work by the open-source community that has grown up around the project. This point release is fully binary compatible with the 3.2.0 stable release. The changes made are focused on addressing bugs and improving build support for latest compilers, OS updates and 3rd changes to Party Libraries.
|
||||||
|
|
||||||
|
=== Downloads and Licensing ===
|
||||||
|
OpenSceneGraph is open-source, so full source code is provided, and can be copied, modified and used free of charge for commercial and non-commercial use. Access to the source allows end users greater flexibility in how they develop, debug and deploy their applications. They gain productivity and freedom by being able to leverage the tool chain in accordance with their own release cycles. Downloads of binaries and source can be found in the [http://www.openscenegraph.org/index.php/download-section/stable-releases Downloads] section of the openscenegraph.org website.
|
||||||
|
|
||||||
|
OpenSceneGraph is released under the [http://www.openscenegraph.org/projects/osg/wiki/Legal OpenSceneGraph Public License], which is based on the Lesser GNU Public License (LGPL), permitting the software to be used free of charge across the full spectrum of commercial and open-source applications. Furthermore, it allows both static and dynamic linking of the OpenSceneGraph libraries without restricting the licensing of the user's software.
|
||||||
|
|
||||||
|
=== Professional support and services ===
|
||||||
|
OpenSceneGraph project is backed up with professional services by [http://www.openscenegraph.com OpenSceneGraph Professional Services], based in Scotland, and [http://www.skew-matrix.com Skew-Matrix] and [http://www.alphapixel.com AlphaPixel] both based in the USA, and a range of [wiki:Community/Contractors Contractors] from around the world. Services available include:
|
||||||
|
|
||||||
|
* Confidential Professional Support
|
||||||
|
* Bespoke development
|
||||||
|
* Consultancy
|
||||||
|
* Training
|
||||||
|
|
||||||
|
=== Community support and contributions ===
|
||||||
|
The diverse and growing community of over 5000 developers is centred around the public osg-users mailing list/forum, where members discuss how best to use OpenSceneGraph, provide mutual support, and coordinate development of new features and bug fixes. Members of this community come from many different countries with backgrounds ranging from some of the world's largest aerospace companies, game companies, and visual simulation specialists to university researchers, students and hobbyists.
|
||||||
|
|
||||||
|
The OpenSceneGraph project owes a great deal to the community for its development and support, in particular we wish to thank the [http://www.openscenegraph.org/index.php/about/56-contributors/162-contributors-to-openscenegraph-3-2-1 individuals] from around the world that have directly contributed to the development and refinement of the OpenSceneGraph code base.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
= !OpenSceneGraph 3.2 release improves support iOS and Android, supports a range of new OpenGL features much more.
|
||||||
|
|
||||||
|
PERTHSHIRE, Scotland - 24th July 2013 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 3.2, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 3.2 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modeling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 3.2 runs on all Microsoft Windows platforms, Apple OS/X, IOS, GNU/Linux, Android, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems.
|
||||||
|
|
||||||
|
=== Open-source development delivers industry-leading features and performance ===
|
||||||
|
The !OpenSceneGraph 3.2 release is the culmination of 14 years of work by the open-source community that has grown up around the project. The real-time graphics industry and academia embraced it from the very beginning, deploying it in real-world applications, and actively participating in its development, testing and refinement. The end result is a high-quality library with a feature set relevant to application developers' needs in both the desktop and mobile space.
|
||||||
|
|
||||||
|
=== Updates include: ===
|
||||||
|
|
||||||
|
* Improvements to OpenGL ES 1.1 and 2.0 support, including platform specific extensions
|
||||||
|
* Revamped QTKit, imageio and quicktime plugins for improved support of iOS and OSX
|
||||||
|
* New avfoundation plugin for reading video on iOS and OSX
|
||||||
|
* New ktx plugin for reading Khronos Texture Files
|
||||||
|
* New OpenGL extensions support including compute shaders, tessellation shaders, integer array formats and associated Vec* classes, primitive restart
|
||||||
|
* Improvements to osgManipulator NodeKit that introduce new manipulators and improve flexibility and customizability
|
||||||
|
* Updates to osgQt to support Qt5 and provide better support for Qt4
|
||||||
|
* New osgGA::Device base class for recieving from and sending events to both real and virtual devices in a generic, extensible way
|
||||||
|
* New ZeroConf, RestHTTP and OSC plugins to enable remote control of applications such as controlling desktop systems from tablets and phones
|
||||||
|
* Improvements to osgVolume NodeKit and DICOM plugin for better medical visualization
|
||||||
|
* New TrackVis .trk track files plugin for the visualization of brain scans.
|
||||||
|
* Improvements to osgPresentation NodeKit and Present3D application to make it possible to create non-linear interactive, remote controlled shows
|
||||||
|
* New osgViewer::ViewConfig class with range of implementations to make it easier to configure viewers for advanced rendering support
|
||||||
|
* Support for GPU based Keystone correction with onscreen editing making it possible to use low cost projectors in off axis setups
|
||||||
|
* Clean up of osg::Geometry class removing all deprecated slow path API's resulting in a smaller and faster Geometry class
|
||||||
|
* Addition of deprecated_osg namespace and deprecated_osg::Geometry class that provides deprecated BIND_PER_PRIMITIVE and array indices APIs to add with porting
|
||||||
|
* New ViewDependentShadowMap shadow rendering class that combines enables robust combining of parallel split and perspective shadow map techniques
|
||||||
|
* Updates of plugins to work with the latest FBX, ffmpeg, NVTT, OpenVRML, LibVNCServer releases
|
||||||
|
|
||||||
|
|
||||||
|
=== Downloads and Licensing ===
|
||||||
|
!OpenSceneGraph is open-source, so full source code is provided, and can be copied, modified and used free of charge for commercial and non-commercial use. Access to the source allows end users greater flexibility in how they develop, debug and deploy their applications. They gain productivity and freedom by being able to leverage the tool chain in accordance with their own release cycles. Downloads of binaries and source can be found in the [http://www.openscenegraph.org/index.php/download-section/stable-releases Downloads] section of the openscenegraph.org website.
|
||||||
|
|
||||||
|
!OpenSceneGraph is released under the [http://www.openscenegraph.org/projects/osg/wiki/Legal OpenSceneGraph Public License], which is based on the Lesser GNU Public License (LGPL), permitting the software to be used free of charge across the full spectrum of commercial and open-source applications. Furthermore, it allows both static and dynamic linking of the !OpenSceneGraph libraries without restricting the licensing of the user's software.
|
||||||
|
|
||||||
|
=== Professional support and services ===
|
||||||
|
!OpenSceneGraph project is backed up with professional services by [http://www.openscenegraph.com OpenSceneGraph Professional Services], based in Scotland, and [http://www.skew-matrix.com Skew-Matrix] and [http://www.alphapixel.com AlphaPixel] both based in the USA, and a range of [wiki:Community/Contractors Contractors] from around the world. Services available include:
|
||||||
|
|
||||||
|
* Confidential Professional Support
|
||||||
|
* Bespoke development
|
||||||
|
* Consultancy
|
||||||
|
* Training
|
||||||
|
|
||||||
|
=== Community support and contributions ===
|
||||||
|
The diverse and growing community of over 5000 developers is centred around the public osg-users mailing list/forum, where members discuss how best to use !OpenSceneGraph, provide mutual support, and coordinate development of new features and bug fixes. Members of this community come from many different countries with backgrounds ranging from some of the world's largest aerospace companies, game companies, and visual simulation specialists to university researchers, students and hobbyists.
|
||||||
|
|
||||||
|
The !OpenSceneGraph project owes a great deal to the community for its development and support, in particular we wish to thank the [http://www.openscenegraph.org/index.php/about/http:/www.openscenegraph.org/index.php/about/142-contributors-to-openscenegraph-3-2-0 511 individuals] from around the world that have directly contributed to the development and refinement of the !OpenSceneGraph code base.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
= !OpenSceneGraph 3.0 release adds support OpenGL ES 1.1, OpenGL ES 2.0, OpenGL 3.x to 4.0, support for Andoid and IOS platforms and much more.
|
= !OpenSceneGraph 3.0 release adds support OpenGL ES 1.1, OpenGL ES 2.0, OpenGL 3.x to 4.0, support for Andoid and IOS platforms and much more.
|
||||||
|
|
||||||
PERTHSHIRE, Scotland - 28th June 2011 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 3.0, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 3.0 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modeling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 3.0 runs on all Microsoft Windows platforms, Apple OS/X, IOS, GNU/Linux, Android, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems.
|
PERTHSHIRE, Scotland - 28th June 2011 - !OpenSceneGraph Professional Services announces the release of !OpenSceneGraph 3.0, the industry's leading open-source scene graph technology, designed to accelerate application development and improve 3D graphics performance. !OpenSceneGraph 3.0 written entirely in Standard C++ and built upon OpenGL, offers developers working in the visual simulation, game development, virtual reality, scientific visualization and modeling markets - a real-time visualization tool which eclipses commercial scene graph toolkits in functionality, stability and performance. !OpenSceneGraph 3.0 runs on all Microsoft Windows platforms, Apple OS/X, IOS, GNU/Linux, Android, IRIX, Solaris, HP-UX, AIX and FreeBSD operating systems.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ APP_PROJECT_PATH := $(call my-dir)
|
|||||||
|
|
||||||
APP_OPTIM := ${ANDROID_RELEASE_OPTIM}
|
APP_OPTIM := ${ANDROID_RELEASE_OPTIM}
|
||||||
|
|
||||||
APP_PLATFORM := ${ANDROID_PLATFORM}
|
APP_PLATFORM := android-${ANDROID_PLATFORM}
|
||||||
APP_STL := ${ANDROID_STL}
|
APP_STL := ${ANDROID_STL}
|
||||||
APP_CPPFLAGS := -fexceptions -frtti
|
APP_CPPFLAGS := -fexceptions -frtti
|
||||||
#APP_CPPFLAGS := -Os -mthumb-interwork -fno-short-enums
|
#APP_CPPFLAGS := -Os -mthumb-interwork -fno-short-enums
|
||||||
|
|||||||
16
README.txt
16
README.txt
@@ -4,15 +4,11 @@ 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
|
compile and run libraries and examples, see the documentation on the
|
||||||
OpenSceneGraph website:
|
OpenSceneGraph website:
|
||||||
|
|
||||||
http://www.openscenegraph.org
|
http://www.openscenegraph.org/index.php/documentation
|
||||||
|
|
||||||
For support subscribe to our public mailing list:
|
For support subscribe to our public mailing list or forum, details at:
|
||||||
|
|
||||||
http://www.openscenegraph.org/projects/osg/wiki/MailingLists
|
http://www.openscenegraph.org/index.php/support
|
||||||
|
|
||||||
or forum:
|
|
||||||
|
|
||||||
http://forum.openscenegraph.org/
|
|
||||||
|
|
||||||
For the impatient, we've included quick build instructions below, these
|
For the impatient, we've included quick build instructions below, these
|
||||||
are are broken down is three parts:
|
are are broken down is three parts:
|
||||||
@@ -27,7 +23,7 @@ more indepth instructions.
|
|||||||
|
|
||||||
Robert Osfield.
|
Robert Osfield.
|
||||||
Project Lead.
|
Project Lead.
|
||||||
26th April 2013.
|
12th August 2015.
|
||||||
|
|
||||||
--
|
--
|
||||||
|
|
||||||
@@ -74,7 +70,7 @@ Under Windows use the GUI tool CMakeSetup to build your VisualStudio
|
|||||||
files. The following page on our wiki dedicated to the CMake build
|
files. The following page on our wiki dedicated to the CMake build
|
||||||
system should help guide you through the process:
|
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
|
Under OSX you can either use the CMake build system above, or use the
|
||||||
Xcode projects that you will find in the OpenSceneGraph/Xcode
|
Xcode projects that you will find in the OpenSceneGraph/Xcode
|
||||||
@@ -83,7 +79,7 @@ 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:
|
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
|
Section 2. Release notes on OSX build, by Eric Sokolowsky, August 5, 2008
|
||||||
|
|||||||
@@ -557,6 +557,7 @@ int main( int argc, char **argv )
|
|||||||
// if user request help write it out to cout.
|
// if user request help write it out to cout.
|
||||||
if (arguments.read("-h") || arguments.read("--help"))
|
if (arguments.read("-h") || arguments.read("--help"))
|
||||||
{
|
{
|
||||||
|
osg::setNotifyLevel(osg::NOTICE);
|
||||||
usage( arguments.getApplicationName().c_str(), 0 );
|
usage( arguments.getApplicationName().c_str(), 0 );
|
||||||
//arguments.getApplicationUsage()->write(std::cout);
|
//arguments.getApplicationUsage()->write(std::cout);
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
@@ -254,7 +254,14 @@ const char* invalidNames[] =
|
|||||||
"GraphicsContext*",
|
"GraphicsContext*",
|
||||||
"Apple",
|
"Apple",
|
||||||
"GeometryNew",
|
"GeometryNew",
|
||||||
"FrameBufferObject"
|
"FrameBufferObject",
|
||||||
|
"Lua",
|
||||||
|
"VolumeTile",
|
||||||
|
"PushStackValueVisitor",
|
||||||
|
"RayIntersector",
|
||||||
|
"OpenSceneGraph-Data",
|
||||||
|
"Node",
|
||||||
|
"AlphaFunc"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -347,6 +354,7 @@ TypoCorrection typoCorrections[] =
|
|||||||
{"Krulthof", "Kruithof"},
|
{"Krulthof", "Kruithof"},
|
||||||
{"Lagrade", "Lagarde"},
|
{"Lagrade", "Lagarde"},
|
||||||
{"Largade", "Lagarde"},
|
{"Largade", "Lagarde"},
|
||||||
|
{"Largarde", "Lagarde"},
|
||||||
{"Larshkari", "Lashkari"},
|
{"Larshkari", "Lashkari"},
|
||||||
{"Lashakari", "Lashkari"},
|
{"Lashakari", "Lashkari"},
|
||||||
{"Lashari", "Lashkari"},
|
{"Lashari", "Lashkari"},
|
||||||
@@ -454,7 +462,29 @@ TypoCorrection typoCorrections[] =
|
|||||||
{"Eskland","Ekstrand"},
|
{"Eskland","Ekstrand"},
|
||||||
{"Baeuerele","Baeuerle"},
|
{"Baeuerele","Baeuerle"},
|
||||||
{"Bauerle","Baeuerle"},
|
{"Bauerle","Baeuerle"},
|
||||||
{"Baeurele","Baeuerle"}
|
{"Baeurele","Baeuerle"},
|
||||||
|
{"Nillson","Nilsson"},
|
||||||
|
{"Bjorn","Bj<EFBFBD>rn"},
|
||||||
|
{"Björn","Bj<EFBFBD>rn"},
|
||||||
|
{"Stepan","Stephan"},
|
||||||
|
{"Kristoger","Kristofer"},
|
||||||
|
{"Blessing","Blissing"},
|
||||||
|
{"Dannahuer","Dannhauer"},
|
||||||
|
{"Chebeav", "Chebaev"},
|
||||||
|
{"Messershmidt","Messerschmidt"},
|
||||||
|
{"Auelien","Aurelien"},
|
||||||
|
{"Aurélien","Aur<EFBFBD>lien"},
|
||||||
|
{"McDonnel","Mc Donnell"},
|
||||||
|
{"McDonnell","Mc Donnell"},
|
||||||
|
{"Delallée","Delall<EFBFBD>e"},
|
||||||
|
{"Gjøl","Gj<EFBFBD>l"},
|
||||||
|
{"Ravšelj","Rav<EFBFBD>elj"},
|
||||||
|
{"Ravsel", "Rav<EFBFBD>elj"},
|
||||||
|
{"Ravselj", "Rav<EFBFBD>elj"},
|
||||||
|
{"Janik", "Jannik"},
|
||||||
|
{"Viganò", "Vigan<EFBFBD>"},
|
||||||
|
{"Vigano", "Vigan<EFBFBD>"},
|
||||||
|
{"Frashud", "Farshid"}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -562,6 +592,8 @@ NameCorrection nameCorrections[] =
|
|||||||
"Melchior", "Franz"},
|
"Melchior", "Franz"},
|
||||||
{"Glen", "Waldon",
|
{"Glen", "Waldon",
|
||||||
"Glenn", "Waldron"},
|
"Glenn", "Waldron"},
|
||||||
|
{"Glen", "Waldron",
|
||||||
|
"Glenn", "Waldron"},
|
||||||
{"Ralf", "Karn",
|
{"Ralf", "Karn",
|
||||||
"Ralf", "Kern"},
|
"Ralf", "Kern"},
|
||||||
{"Donny", "Cipperly",
|
{"Donny", "Cipperly",
|
||||||
@@ -594,6 +626,8 @@ NameCorrection nameCorrections[] =
|
|||||||
"Romano", "Jos<EFBFBD> Magacho da Silva"},
|
"Romano", "Jos<EFBFBD> Magacho da Silva"},
|
||||||
{"Rommano", "Silva",
|
{"Rommano", "Silva",
|
||||||
"Romano", "Jos<EFBFBD> Magacho da Silva"},
|
"Romano", "Jos<EFBFBD> Magacho da Silva"},
|
||||||
|
{"Romano", "Magacho",
|
||||||
|
"Romano", "Jos<EFBFBD> Magacho da Silva"},
|
||||||
{"Leandro", "Motta",
|
{"Leandro", "Motta",
|
||||||
"Leandro", "Motta Barros"},
|
"Leandro", "Motta Barros"},
|
||||||
{"Leandro", "Motto",
|
{"Leandro", "Motto",
|
||||||
@@ -619,7 +653,27 @@ NameCorrection nameCorrections[] =
|
|||||||
{"Tyge", "",
|
{"Tyge", "",
|
||||||
"Tyge", "L<EFBFBD>vset"},
|
"Tyge", "L<EFBFBD>vset"},
|
||||||
{"Ricard", "Schmidt",
|
{"Ricard", "Schmidt",
|
||||||
"Richard", "Schmidt"}
|
"Richard", "Schmidt"},
|
||||||
|
{"Matthias", "Helsing",
|
||||||
|
"Mattias", "Helsing"},
|
||||||
|
{"Clement", "Boesch",
|
||||||
|
"Cl<EFBFBD>ment", "B<EFBFBD>sch"},
|
||||||
|
{"Lauren", "Voerman",
|
||||||
|
"Laurens", "Voerman"},
|
||||||
|
{"Pjotr", "Sventachov",
|
||||||
|
"Pjotr", "Svetachov"},
|
||||||
|
{"Bradley", "Baker",
|
||||||
|
"Bradley", "Baker Searles"},
|
||||||
|
{"PawelKsiezopolski", "",
|
||||||
|
"Pawel", "Ksiezopolski"},
|
||||||
|
{"Albert", "Luaces",
|
||||||
|
"Alberto","Luaces"},
|
||||||
|
{"KOS", "",
|
||||||
|
"Konstantin","Matveyev"},
|
||||||
|
{"WeSee", "",
|
||||||
|
"Alois", "Wismer"},
|
||||||
|
{"We", "See",
|
||||||
|
"Alois", "Wismer"}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -951,7 +1005,9 @@ void printContributors(const std::string& changeLog, bool printNumEntries)
|
|||||||
cout << "-------------------------" << endl;
|
cout << "-------------------------" << endl;
|
||||||
for (SortedNameMap::reverse_iterator sitr = sortedNames.rbegin(); sitr != sortedNames.rend(); ++sitr)
|
for (SortedNameMap::reverse_iterator sitr = sortedNames.rbegin(); sitr != sortedNames.rend(); ++sitr)
|
||||||
{
|
{
|
||||||
cout << sitr->first << "\t" << sitr->second.first << " " << sitr->second.second << endl;
|
cout << sitr->first << "\t" << sitr->second.first;
|
||||||
|
if (!sitr->second.second.empty()) cout << " " << sitr->second.second;
|
||||||
|
cout << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -960,7 +1016,9 @@ void printContributors(const std::string& changeLog, bool printNumEntries)
|
|||||||
cout << "-----------------" << endl;
|
cout << "-----------------" << endl;
|
||||||
for (SortedNameMap::reverse_iterator sitr = sortedNames.rbegin(); sitr != sortedNames.rend(); ++sitr)
|
for (SortedNameMap::reverse_iterator sitr = sortedNames.rbegin(); sitr != sortedNames.rend(); ++sitr)
|
||||||
{
|
{
|
||||||
cout << sitr->second.first << " " << sitr->second.second << endl;
|
cout << sitr->second.first;
|
||||||
|
if (!sitr->second.second.empty()) cout << " " << sitr->second.second;
|
||||||
|
cout << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
#include <osgGA/Device>
|
#include <osgGA/Device>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <osg/GLExtensions>
|
#include <osg/GLExtensions>
|
||||||
|
|
||||||
|
|||||||
@@ -305,14 +305,14 @@ class DataConverter
|
|||||||
inline void writeFloat(float c) { write4((char*)&c); }
|
inline void writeFloat(float c) { write4((char*)&c); }
|
||||||
inline void writeDouble(double c) { write8((char*)&c); }
|
inline void writeDouble(double c) { write8((char*)&c); }
|
||||||
|
|
||||||
inline char readChar() { char c; read1(&c); return c; }
|
inline char readChar() { char c=0; read1(&c); return c; }
|
||||||
inline unsigned char readUChar() { unsigned char c; read1((char*)&c); return c; }
|
inline unsigned char readUChar() { unsigned char c=0; read1((char*)&c); return c; }
|
||||||
inline short readShort() { short c; read2((char*)&c); return c; }
|
inline short readShort() { short c=0; read2((char*)&c); return c; }
|
||||||
inline unsigned short readUShort() { unsigned short c; read2((char*)&c); return c; }
|
inline unsigned short readUShort() { unsigned short c=0; read2((char*)&c); return c; }
|
||||||
inline int readInt() { int c; read4((char*)&c); return c; }
|
inline int readInt() { int c=0; read4((char*)&c); return c; }
|
||||||
inline unsigned int readUInt() { unsigned int c; read4((char*)&c); return c; }
|
inline unsigned int readUInt() { unsigned int c=0; read4((char*)&c); return c; }
|
||||||
inline float readFloat() { float c; read4((char*)&c); return c; }
|
inline float readFloat() { float c=0.0f; read4((char*)&c); return c; }
|
||||||
inline double readDouble() { double c; read8((char*)&c); return c; }
|
inline double readDouble() { double c=0.0; read8((char*)&c); return c; }
|
||||||
|
|
||||||
void write(const osg::FrameStamp& fs);
|
void write(const osg::FrameStamp& fs);
|
||||||
void read(osg::FrameStamp& fs);
|
void read(osg::FrameStamp& fs);
|
||||||
|
|||||||
@@ -491,10 +491,20 @@ int main( int argc, char **argv )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// set up stereo masks
|
// set up stereo masks
|
||||||
viewer.getCamera()->setCullMask(0xffffffff);
|
|
||||||
viewer.getCamera()->setCullMaskLeft(0x00000001);
|
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.
|
// set up the camera manipulators.
|
||||||
{
|
{
|
||||||
osg::ref_ptr<osgGA::KeySwitchMatrixManipulator> keyswitchManipulator = new osgGA::KeySwitchMatrixManipulator;
|
osg::ref_ptr<osgGA::KeySwitchMatrixManipulator> keyswitchManipulator = new osgGA::KeySwitchMatrixManipulator;
|
||||||
|
|||||||
@@ -241,14 +241,14 @@ class DataConverter
|
|||||||
inline void writeFloat(float c) { write4((char*)&c); }
|
inline void writeFloat(float c) { write4((char*)&c); }
|
||||||
inline void writeDouble(double c) { write8((char*)&c); }
|
inline void writeDouble(double c) { write8((char*)&c); }
|
||||||
|
|
||||||
inline char readChar() { char c; read1(&c); return c; }
|
inline char readChar() { char c=0; read1(&c); return c; }
|
||||||
inline unsigned char readUChar() { unsigned char c; read1((char*)&c); return c; }
|
inline unsigned char readUChar() { unsigned char c=0; read1((char*)&c); return c; }
|
||||||
inline short readShort() { short c; read2((char*)&c); return c; }
|
inline short readShort() { short c=0; read2((char*)&c); return c; }
|
||||||
inline unsigned short readUShort() { unsigned short c; read2((char*)&c); return c; }
|
inline unsigned short readUShort() { unsigned short c=0; read2((char*)&c); return c; }
|
||||||
inline int readInt() { int c; read4((char*)&c); return c; }
|
inline int readInt() { int c=0; read4((char*)&c); return c; }
|
||||||
inline unsigned int readUInt() { unsigned int c; read4((char*)&c); return c; }
|
inline unsigned int readUInt() { unsigned int c=0; read4((char*)&c); return c; }
|
||||||
inline float readFloat() { float c; read4((char*)&c); return c; }
|
inline float readFloat() { float c=0.0f; read4((char*)&c); return c; }
|
||||||
inline double readDouble() { double c; read8((char*)&c); return c; }
|
inline double readDouble() { double c=0.0; read8((char*)&c); return c; }
|
||||||
|
|
||||||
void write(const osg::FrameStamp& fs)
|
void write(const osg::FrameStamp& fs)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
static const char* computeSrc = {
|
static const char* computeSrc = {
|
||||||
"#version 430\n"
|
"#version 430\n"
|
||||||
"uniform float osg_FrameTime;\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"
|
"layout (local_size_x = 16, local_size_y = 16) in;\n"
|
||||||
"void main() {\n"
|
"void main() {\n"
|
||||||
" ivec2 storePos = ivec2(gl_GlobalInvocationID.xy);\n"
|
" ivec2 storePos = ivec2(gl_GlobalInvocationID.xy);\n"
|
||||||
|
|||||||
@@ -99,12 +99,14 @@ Node *makeTerrain( void )
|
|||||||
|
|
||||||
for( i = 0; i < m * n; i++ )
|
for( i = 0; i < m * n; i++ )
|
||||||
{
|
{
|
||||||
v[i][0] = vertex[i][0] - dbcenter[0];
|
float* vc = vertex[i];
|
||||||
v[i][1] = vertex[i][1] - dbcenter[1];
|
v[i][0] = vc[0] - dbcenter[0];
|
||||||
v[i][2] = vertex[i][2];
|
v[i][1] = vc[1] - dbcenter[1];
|
||||||
|
v[i][2] = vc[2];
|
||||||
|
|
||||||
t[i][0] = texcoord[i][0] + 0.025;
|
float* tc = texcoord[i];
|
||||||
t[i][1] = texcoord[i][1];
|
t[i][0] = tc[0];
|
||||||
|
t[i][1] = tc[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
Geometry *geom = new Geometry;
|
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_SRC osgmultiplemovies.cpp )
|
||||||
SET(TARGET_ADDED_LIBRARIES osgGA )
|
SET(TARGET_ADDED_LIBRARIES osgGA )
|
||||||
|
|||||||
@@ -90,16 +90,16 @@ int main( int argc, char** argv )
|
|||||||
return( 1 );
|
return( 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
osgViewer::Viewer viewer;
|
||||||
|
|
||||||
// Create a Camera that uses the above OpenGL context.
|
// Create a Camera that uses the above OpenGL context.
|
||||||
osg::Camera* cam = new osg::Camera;
|
osg::Camera* cam = viewer.getCamera();
|
||||||
cam->setGraphicsContext( gc.get() );
|
cam->setGraphicsContext( gc.get() );
|
||||||
// Must set perspective projection for fovy and aspect.
|
// Must set perspective projection for fovy and aspect.
|
||||||
cam->setProjectionMatrix( osg::Matrix::perspective( 30., (double)width/(double)height, 1., 100. ) );
|
cam->setProjectionMatrix( osg::Matrix::perspective( 30., (double)width/(double)height, 1., 100. ) );
|
||||||
// Unlike OpenGL, OSG viewport does *not* default to window dimensions.
|
// Unlike OpenGL, OSG viewport does *not* default to window dimensions.
|
||||||
cam->setViewport( new osg::Viewport( 0, 0, width, height ) );
|
cam->setViewport( new osg::Viewport( 0, 0, width, height ) );
|
||||||
|
|
||||||
osgViewer::Viewer viewer;
|
|
||||||
viewer.setCamera( cam );
|
|
||||||
viewer.setSceneData( root );
|
viewer.setSceneData( root );
|
||||||
|
|
||||||
// for non GL3/GL4 and non GLES2 platforms we need enable the osg_ uniforms that the shaders will use,
|
// for non GL3/GL4 and non GLES2 platforms we need enable the osg_ uniforms that the shaders will use,
|
||||||
@@ -118,7 +118,7 @@ OSG currently support OpenGL 3.x on Windows. This comment block describes the
|
|||||||
necessary configuration steps.
|
necessary configuration steps.
|
||||||
|
|
||||||
Get the draft gl3.h header file from OpenGL.org and put it in a folder called
|
Get the draft gl3.h header file from OpenGL.org and put it in a folder called
|
||||||
<EFBFBD>GL3<EFBFBD> somewhere on your hard drive. OSG includes this header as <GL3/gl3.h>. Get
|
GL3 somewhere on your hard drive. OSG includes this header as <GL3/gl3.h>. Get
|
||||||
gl3.h from here:
|
gl3.h from here:
|
||||||
http://www.opengl.org/registry/
|
http://www.opengl.org/registry/
|
||||||
|
|
||||||
@@ -128,7 +128,7 @@ several changes.
|
|||||||
* Add the path to <GL3/gl3.h> to the CMake compiler flags, CMAKE_CXX_FLAGS and
|
* Add the path to <GL3/gl3.h> to the CMake compiler flags, CMAKE_CXX_FLAGS and
|
||||||
CMAKE_CXX_FLAGS_DEBUG (for release and debug builds; others if you use other
|
CMAKE_CXX_FLAGS_DEBUG (for release and debug builds; others if you use other
|
||||||
build configurations). The text to add should look something like this:
|
build configurations). The text to add should look something like this:
|
||||||
/I <EFBFBD>C:\GLHeader<EFBFBD>
|
/I C:\GLHeader
|
||||||
The folder GLHeader should contain a subfolder GL3, which in turn contains
|
The folder GLHeader should contain a subfolder GL3, which in turn contains
|
||||||
gl3.h.
|
gl3.h.
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,13 @@
|
|||||||
/* A demonstration of Tessellation Shaders in OpenScenegraph.
|
/* A demonstration of Tessellation Shaders in OpenScenegraph.
|
||||||
|
*
|
||||||
|
* Instructions:
|
||||||
|
* Press plus to increase tesselation and minus to decrease it.
|
||||||
|
* Press right arrow to increase inner tesselation and left arrow to decrease it.
|
||||||
|
* Press up arrow to increase outer tesselation and down arrow to decrease it.
|
||||||
|
*
|
||||||
* Original code by Philip Rideout
|
* Original code by Philip Rideout
|
||||||
* Adapted to OpenScenegraph by John Kaniarz
|
* Adapted to OpenScenegraph by John Kaniarz
|
||||||
|
* Additional work by Michael Mc Donnell
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <osg/Program>
|
#include <osg/Program>
|
||||||
@@ -113,7 +120,8 @@ static const char* fragSource = {
|
|||||||
"}\n"
|
"}\n"
|
||||||
};
|
};
|
||||||
|
|
||||||
osg::ref_ptr<osg::Geode> CreateIcosahedron(osg::Program *program){
|
osg::ref_ptr<osg::Geode> CreateIcosahedron(osg::Program *program)
|
||||||
|
{
|
||||||
osg::Geode *geode=new osg::Geode();
|
osg::Geode *geode=new osg::Geode();
|
||||||
osg::Geometry *geometry = new osg::Geometry();
|
osg::Geometry *geometry = new osg::Geometry();
|
||||||
const unsigned int Faces[] = {
|
const unsigned int Faces[] = {
|
||||||
@@ -163,10 +171,16 @@ osg::ref_ptr<osg::Geode> CreateIcosahedron(osg::Program *program){
|
|||||||
geometry->setVertexArray(vertices);
|
geometry->setVertexArray(vertices);
|
||||||
geometry->addPrimitiveSet(new osg::DrawElementsUInt(osg::PrimitiveSet::PATCHES,IndexCount,Faces));
|
geometry->addPrimitiveSet(new osg::DrawElementsUInt(osg::PrimitiveSet::PATCHES,IndexCount,Faces));
|
||||||
|
|
||||||
|
// Expand the bounding box, otherwise the geometry is clipped in front when tessellating.
|
||||||
|
osg::BoundingBox bbox(osg::Vec3(-1.0f, -1.9f, -1.0f), osg::Vec3(1.0f, 1.0f, 1.0f));
|
||||||
|
geometry->setInitialBound(bbox);
|
||||||
|
|
||||||
geode->addDrawable(geometry);
|
geode->addDrawable(geometry);
|
||||||
return geode;
|
return geode;
|
||||||
}
|
}
|
||||||
osg::ref_ptr<osg::Program> createProgram(){
|
|
||||||
|
osg::ref_ptr<osg::Program> createProgram()
|
||||||
|
{
|
||||||
osg::Program *program = new osg::Program();
|
osg::Program *program = new osg::Program();
|
||||||
program->addShader(new osg::Shader(osg::Shader::VERTEX,vertSource));
|
program->addShader(new osg::Shader(osg::Shader::VERTEX,vertSource));
|
||||||
program->addShader(new osg::Shader(osg::Shader::TESSCONTROL,tessControlSource));
|
program->addShader(new osg::Shader(osg::Shader::TESSCONTROL,tessControlSource));
|
||||||
@@ -179,38 +193,74 @@ osg::ref_ptr<osg::Program> createProgram(){
|
|||||||
return program;
|
return program;
|
||||||
}
|
}
|
||||||
|
|
||||||
float tessInner=1.0f;
|
class KeyboardEventHandler : public osgGA::GUIEventHandler
|
||||||
float tessOuter=1.0f;
|
{
|
||||||
osg::ref_ptr<osg::Uniform> tessInnerU = new osg::Uniform("TessLevelInner",tessInner);
|
|
||||||
osg::ref_ptr<osg::Uniform> tessOuterU = new osg::Uniform("TessLevelOuter",tessOuter);
|
|
||||||
|
|
||||||
class KeyboardEventHandler : public osgGA::GUIEventHandler {
|
|
||||||
public:
|
public:
|
||||||
KeyboardEventHandler():osgGA::GUIEventHandler(){}
|
KeyboardEventHandler(osg::ref_ptr<osg::Uniform> tessInnerU, osg::ref_ptr<osg::Uniform> tessOuterU):
|
||||||
virtual bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& gaa){
|
_tessInnerU(tessInnerU),
|
||||||
|
_tessOuterU(tessOuterU)
|
||||||
|
{
|
||||||
|
tessInnerU->get(_tessInner);
|
||||||
|
tessOuterU->get(_tessOuter);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& gaa)
|
||||||
|
{
|
||||||
if(ea.getEventType()==osgGA::GUIEventAdapter::KEYDOWN){
|
if(ea.getEventType()==osgGA::GUIEventAdapter::KEYDOWN){
|
||||||
switch (ea.getKey()){
|
switch (ea.getKey()){
|
||||||
case osgGA::GUIEventAdapter::KEY_Up:
|
case osgGA::GUIEventAdapter::KEY_Up:
|
||||||
tessOuter++;
|
increaseOuterTesselation();
|
||||||
tessOuterU->set(tessOuter);
|
|
||||||
return true;
|
return true;
|
||||||
case osgGA::GUIEventAdapter::KEY_Down:
|
case osgGA::GUIEventAdapter::KEY_Down:
|
||||||
tessOuter--;
|
decreaseOuterTesselation();
|
||||||
tessOuter=std::max(1.0f,tessOuter);
|
|
||||||
tessOuterU->set(tessOuter);
|
|
||||||
return true;
|
return true;
|
||||||
case osgGA::GUIEventAdapter::KEY_Left:
|
case osgGA::GUIEventAdapter::KEY_Left:
|
||||||
tessInner--;
|
decreaseInnerTesselation();
|
||||||
tessInner=std::max(1.0f,tessInner);
|
|
||||||
tessInnerU->set(tessInner);
|
|
||||||
return true;
|
return true;
|
||||||
case osgGA::GUIEventAdapter::KEY_Right:
|
case osgGA::GUIEventAdapter::KEY_Right:
|
||||||
tessInner++;
|
increaseInnerTesselation();
|
||||||
tessInnerU->set(tessInner);
|
return true;
|
||||||
|
case osgGA::GUIEventAdapter::KEY_Plus:
|
||||||
|
case osgGA::GUIEventAdapter::KEY_KP_Add:
|
||||||
|
increaseInnerTesselation();
|
||||||
|
increaseOuterTesselation();
|
||||||
|
return true;
|
||||||
|
case osgGA::GUIEventAdapter::KEY_Minus:
|
||||||
|
case osgGA::GUIEventAdapter::KEY_KP_Subtract:
|
||||||
|
decreaseInnerTesselation();
|
||||||
|
decreaseOuterTesselation();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return osgGA::GUIEventHandler::handle(ea,gaa);
|
return osgGA::GUIEventHandler::handle(ea, gaa);
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
osg::ref_ptr<osg::Uniform> _tessInnerU;
|
||||||
|
osg::ref_ptr<osg::Uniform> _tessOuterU;
|
||||||
|
float _tessInner;
|
||||||
|
float _tessOuter;
|
||||||
|
|
||||||
|
void increaseInnerTesselation()
|
||||||
|
{
|
||||||
|
_tessInnerU->set(++_tessInner);
|
||||||
|
}
|
||||||
|
|
||||||
|
void decreaseInnerTesselation()
|
||||||
|
{
|
||||||
|
_tessInner = std::max(1.0f, _tessInner-1.0f);
|
||||||
|
_tessInnerU->set(_tessInner);
|
||||||
|
}
|
||||||
|
|
||||||
|
void increaseOuterTesselation()
|
||||||
|
{
|
||||||
|
_tessOuterU->set(++_tessOuter);
|
||||||
|
}
|
||||||
|
|
||||||
|
void decreaseOuterTesselation()
|
||||||
|
{
|
||||||
|
_tessOuter = std::max(1.0f, _tessOuter-1.0f);
|
||||||
|
_tessOuterU->set(_tessOuter);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -220,6 +270,9 @@ int main(int argc, char* argv[])
|
|||||||
viewer.setUpViewInWindow(100,100,800,600);
|
viewer.setUpViewInWindow(100,100,800,600);
|
||||||
osg::ref_ptr<osg::Program> program = createProgram();
|
osg::ref_ptr<osg::Program> program = createProgram();
|
||||||
osg::ref_ptr<osg::Geode> geode = CreateIcosahedron(program.get());
|
osg::ref_ptr<osg::Geode> geode = CreateIcosahedron(program.get());
|
||||||
|
osg::ref_ptr<osg::Uniform> tessInnerU = new osg::Uniform("TessLevelInner", 1.0f);
|
||||||
|
osg::ref_ptr<osg::Uniform> tessOuterU = new osg::Uniform("TessLevelOuter", 1.0f);
|
||||||
|
|
||||||
osg::StateSet *state;
|
osg::StateSet *state;
|
||||||
state = geode->getOrCreateStateSet();
|
state = geode->getOrCreateStateSet();
|
||||||
state->addUniform(new osg::Uniform("AmbientMaterial",osg::Vec3(0.04f, 0.04f, 0.04f)));
|
state->addUniform(new osg::Uniform("AmbientMaterial",osg::Vec3(0.04f, 0.04f, 0.04f)));
|
||||||
@@ -242,7 +295,7 @@ int main(int argc, char* argv[])
|
|||||||
s->setUseVertexAttributeAliasing(true);
|
s->setUseVertexAttributeAliasing(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
viewer.addEventHandler(new KeyboardEventHandler());
|
viewer.addEventHandler(new KeyboardEventHandler(tessInnerU, tessOuterU));
|
||||||
viewer.setSceneData(geode.get());
|
viewer.setSceneData(geode.get());
|
||||||
return viewer.run();
|
return viewer.run();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
FILE(GLOB ui_files_1 "English.lproj/*.strings")
|
FILE(GLOB ui_files_1 "English.lproj/*.strings")
|
||||||
FILE(GLOB ui_files_2 "English.lproj/MainMenu.nib/*.nib")
|
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(TARGET_EXTERNAL_LIBRARIES osg ${COCOA_LIBRARY})
|
||||||
SET_SOURCE_FILES_PROPERTIES(Info.plist PROPERTIES MACOSX_PACKAGE_LOCATION .)
|
SET_SOURCE_FILES_PROPERTIES(Info.plist PROPERTIES MACOSX_PACKAGE_LOCATION .)
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
//
|
//
|
||||||
// main.m
|
// main.mm
|
||||||
// osgsimpleviewerCocoa
|
// osgsimpleviewerCocoa
|
||||||
//
|
//
|
||||||
// Created by Eric Wing on 11/13/06.
|
// Created by Eric Wing on 11/13/06.
|
||||||
@@ -6,12 +6,14 @@ SET(TARGET_SRC
|
|||||||
osgIPhoneViewer-Info.plist
|
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
|
#backup setting
|
||||||
SET(TMP_OSG_BUILD_APPLICATION_BUNDLES {$OSG_BUILD_APPLICATION_BUNDLES})
|
SET(TMP_OSG_BUILD_APPLICATION_BUNDLES {$OSG_BUILD_APPLICATION_BUNDLES})
|
||||||
SET(OSG_BUILD_APPLICATION_BUNDLES TRUE)
|
SET(OSG_BUILD_APPLICATION_BUNDLES TRUE)
|
||||||
SETUP_EXAMPLE(osgViewerIPhone)
|
SETUP_EXAMPLE(osgViewerIPhone)
|
||||||
|
SET_TARGET_PROPERTIES(example_osgViewerIPhone PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer")
|
||||||
|
|
||||||
#restore setting
|
#restore setting
|
||||||
SET(OSG_BUILD_APPLICATION_BUNDLES {$TMP_OSG_BUILD_APPLICATION_BUNDLES})
|
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 <osgDB/ReadFile>
|
||||||
#include <osg/MatrixTransform>
|
#include <osg/MatrixTransform>
|
||||||
#include <osg/CameraNode>
|
|
||||||
#include <osgText/Text>
|
#include <osgText/Text>
|
||||||
#include <osgViewer/Viewer>
|
#include <osgViewer/Viewer>
|
||||||
|
|
||||||
@@ -17,7 +16,7 @@
|
|||||||
|
|
||||||
UIWindow* _window; //main application window
|
UIWindow* _window; //main application window
|
||||||
|
|
||||||
UIAccelerationValue accel[3];
|
CADisplayLink* _displayLink;
|
||||||
|
|
||||||
osg::ref_ptr<osgViewer::Viewer> _viewer;
|
osg::ref_ptr<osgViewer::Viewer> _viewer;
|
||||||
osg::ref_ptr<osg::MatrixTransform> _root;
|
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 example will create a fullscreen window showing a grey box. You can interact with it via
|
||||||
//This exampe shows how to render osg into an existing windw. Apple recommends apps only have one window on IPhone so this
|
// multi-touch gestures.
|
||||||
// will be your best bet.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import "iphoneViewerAppDelegate.h"
|
#import "iphoneViewerAppDelegate.h"
|
||||||
#include <osgGA/TrackballManipulator>
|
#include <osgGA/MultiTouchTrackballManipulator>
|
||||||
#include <osg/ShapeDrawable>
|
#include <osg/ShapeDrawable>
|
||||||
//inckude the iphone specific windowing stuff
|
|
||||||
|
//include the iphone specific windowing stuff
|
||||||
#include <osgViewer/api/IOS/GraphicsWindowIOS>
|
#include <osgViewer/api/IOS/GraphicsWindowIOS>
|
||||||
|
|
||||||
|
|
||||||
#define kAccelerometerFrequency 30.0 // Hz
|
|
||||||
#define kFilteringFactor 0.1
|
|
||||||
|
|
||||||
@implementation iphoneViewerAppDelegate
|
@implementation iphoneViewerAppDelegate
|
||||||
|
|
||||||
@synthesize _window;
|
@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
|
//block the final inialization of the windowing system
|
||||||
//
|
//
|
||||||
- (void)applicationDidFinishLaunching:(UIApplication *)application {
|
- (void)applicationDidFinishLaunching:(UIApplication *)application {
|
||||||
|
|
||||||
std::string test_string;
|
|
||||||
test_string = "huhu";
|
|
||||||
|
|
||||||
//get the screen size
|
//get the screen size
|
||||||
CGRect lFrame = [[UIScreen mainScreen] bounds];
|
CGRect lFrame = [[UIScreen mainScreen] bounds];
|
||||||
unsigned int w = lFrame.size.width;
|
unsigned int w = lFrame.size.width;
|
||||||
unsigned int h = lFrame.size.height;
|
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
|
// create the main window at screen size
|
||||||
self._window = [[UIWindow alloc] initWithFrame: lFrame];
|
self._window = [[UIWindow alloc] initWithFrame: lFrame];
|
||||||
|
|
||||||
@@ -41,7 +245,7 @@
|
|||||||
[_window makeKeyAndVisible];
|
[_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;
|
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.
|
// Init the Windata Variable that holds the handle for the Window to display OSG in.
|
||||||
@@ -53,97 +257,65 @@
|
|||||||
traits->width = w;
|
traits->width = w;
|
||||||
traits->height = h;
|
traits->height = h;
|
||||||
traits->depth = 16; //keep memory down, default is currently 24
|
traits->depth = 16; //keep memory down, default is currently 24
|
||||||
//traits->alpha = 8;
|
|
||||||
//traits->stencil = 8;
|
|
||||||
traits->windowDecoration = false;
|
traits->windowDecoration = false;
|
||||||
traits->doubleBuffer = true;
|
traits->doubleBuffer = true;
|
||||||
traits->sharedContext = 0;
|
traits->sharedContext = 0;
|
||||||
traits->setInheritedWindowPixelFormat = true;
|
traits->setInheritedWindowPixelFormat = true;
|
||||||
//traits->windowName = "osgViewer";
|
traits->samples = 4;
|
||||||
|
traits->sampleBuffers = 1;
|
||||||
|
|
||||||
traits->inheritedWindowData = windata;
|
traits->inheritedWindowData = windata;
|
||||||
|
|
||||||
// Create the Graphics Context
|
// Create the Graphics Context
|
||||||
osg::ref_ptr<osg::GraphicsContext> graphicsContext = osg::GraphicsContext::createGraphicsContext(traits.get());
|
osg::ref_ptr<osg::GraphicsContext> graphicsContext = osg::GraphicsContext::createGraphicsContext(traits.get());
|
||||||
|
|
||||||
//create the viewer
|
// if the context was created then attach to our viewer
|
||||||
_viewer = new osgViewer::Viewer();
|
|
||||||
//if the context was created then attach to our viewer
|
|
||||||
if(graphicsContext)
|
if(graphicsContext)
|
||||||
{
|
{
|
||||||
_viewer->getCamera()->setGraphicsContext(graphicsContext);
|
_viewer->getCamera()->setGraphicsContext(graphicsContext);
|
||||||
_viewer->getCamera()->setViewport(new osg::Viewport(0, 0, traits->width, traits->height));
|
_viewer->getCamera()->setViewport(new osg::Viewport(0, 0, traits->width, traits->height));
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
//create scene and attch to viewer
|
|
||||||
|
|
||||||
//create root
|
//create root
|
||||||
_root = new osg::MatrixTransform();
|
_root = new osg::MatrixTransform();
|
||||||
|
|
||||||
//load and attach scene model
|
//load and attach scene model
|
||||||
osg::ref_ptr<osg::Node> model = (osgDB::readNodeFile("hog.osg"));
|
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::Camera* hud_camera = createHUD(w,h);
|
||||||
osg::ShapeDrawable* drawable = new osg::ShapeDrawable(new osg::Box(osg::Vec3(1,1,1), 1));
|
_root->addChild(hud_camera);
|
||||||
geode->addDrawable(drawable);
|
|
||||||
_root->addChild(geode);
|
|
||||||
|
|
||||||
|
|
||||||
//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->setSceneData(_root.get());
|
||||||
_viewer->setCameraManipulator(new osgGA::TrackballManipulator);
|
_viewer->setCameraManipulator(new osgGA::MultiTouchTrackballManipulator());
|
||||||
_viewer->setThreadingModel(osgViewer::Viewer::SingleThreaded);//SingleThreaded DrawThreadPerContext
|
|
||||||
|
|
||||||
//
|
_viewer->addEventHandler(new TestMultiTouchEventHandler(hud_camera));
|
||||||
//_viewer->realize();
|
|
||||||
|
|
||||||
osg::setNotifyLevel(osg::DEBUG_FP);
|
|
||||||
|
|
||||||
[NSTimer scheduledTimerWithTimeInterval:1.0/30.0 target:self selector:@selector(updateScene) userInfo:nil repeats:YES];
|
// sun single-threaded
|
||||||
|
_viewer->setThreadingModel(osgViewer::Viewer::SingleThreaded);
|
||||||
|
|
||||||
|
_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;
|
_root = NULL;
|
||||||
_viewer = 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 {
|
- (void)dealloc {
|
||||||
|
|||||||
@@ -14,6 +14,6 @@ USE_GRAPICSWINDOW_IMPLEMENTATION(IOS)
|
|||||||
USE_OSGPLUGIN(osg)
|
USE_OSGPLUGIN(osg)
|
||||||
|
|
||||||
USE_OSGPLUGIN(imageio)
|
USE_OSGPLUGIN(imageio)
|
||||||
|
USE_OSGPLUGIN(avfoundation)
|
||||||
USE_OSGPLUGIN(freetype)
|
//USE_OSGPLUGIN(freetype)
|
||||||
|
|
||||||
|
|||||||
@@ -97,8 +97,8 @@ void cOSG::InitCameraConfig(void)
|
|||||||
// Create the Graphics Context
|
// Create the Graphics Context
|
||||||
osg::GraphicsContext* gc = osg::GraphicsContext::createGraphicsContext(traits.get());
|
osg::GraphicsContext* gc = osg::GraphicsContext::createGraphicsContext(traits.get());
|
||||||
|
|
||||||
// Init a new Camera (Master for this View)
|
// Init Master Camera for this View
|
||||||
osg::ref_ptr<osg::Camera> camera = new osg::Camera;
|
osg::ref_ptr<osg::Camera> camera = mViewer->getCamera();
|
||||||
|
|
||||||
// Assign Graphics Context to the Camera
|
// Assign Graphics Context to the Camera
|
||||||
camera->setGraphicsContext(gc);
|
camera->setGraphicsContext(gc);
|
||||||
|
|||||||
@@ -93,7 +93,13 @@ int main( int argc, char** argv )
|
|||||||
{
|
{
|
||||||
osg::ArgumentParser arguments(&argc, 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;
|
osgViewer::ViewerBase::ThreadingModel threadingModel = osgViewer::ViewerBase::CullDrawThreadPerContext;
|
||||||
|
#endif
|
||||||
|
|
||||||
while (arguments.read("--SingleThreaded")) threadingModel = osgViewer::ViewerBase::SingleThreaded;
|
while (arguments.read("--SingleThreaded")) threadingModel = osgViewer::ViewerBase::SingleThreaded;
|
||||||
while (arguments.read("--CullDrawThreadPerContext")) threadingModel = osgViewer::ViewerBase::CullDrawThreadPerContext;
|
while (arguments.read("--CullDrawThreadPerContext")) threadingModel = osgViewer::ViewerBase::CullDrawThreadPerContext;
|
||||||
while (arguments.read("--DrawThreadPerContext")) threadingModel = osgViewer::ViewerBase::DrawThreadPerContext;
|
while (arguments.read("--DrawThreadPerContext")) threadingModel = osgViewer::ViewerBase::DrawThreadPerContext;
|
||||||
|
|||||||
@@ -1115,7 +1115,8 @@ int main( int argc, char **argv )
|
|||||||
if (image_3d.valid())
|
if (image_3d.valid())
|
||||||
{
|
{
|
||||||
image_3d->setFileName(name_no_ext + ".dds");
|
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);
|
osgDB::writeNodeFile(*volume, outputFile);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,10 +18,10 @@
|
|||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
||||||
#define OPENTHREADS_MAJOR_VERSION 2
|
#define OPENTHREADS_MAJOR_VERSION 3
|
||||||
#define OPENTHREADS_MINOR_VERSION 6
|
#define OPENTHREADS_MINOR_VERSION 2
|
||||||
#define OPENTHREADS_PATCH_VERSION 0
|
#define OPENTHREADS_PATCH_VERSION 1
|
||||||
#define OPENTHREADS_SOVERSION 12
|
#define OPENTHREADS_SOVERSION 20
|
||||||
|
|
||||||
/** OpenThreadsGetVersion() returns the library version number.
|
/** OpenThreadsGetVersion() returns the library version number.
|
||||||
* Numbering convention : OpenThreads-1.0 will return 1.0 from OpenThreadsGetVersion. */
|
* Numbering convention : OpenThreads-1.0 will return 1.0 from OpenThreadsGetVersion. */
|
||||||
|
|||||||
@@ -51,6 +51,12 @@ class BoundingBoxImpl
|
|||||||
-FLT_MAX)
|
-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. */
|
/** Creates a bounding box initialized to the given extents. */
|
||||||
inline BoundingBoxImpl(value_type xmin, value_type ymin, value_type zmin,
|
inline BoundingBoxImpl(value_type xmin, value_type ymin, value_type zmin,
|
||||||
value_type xmax, value_type ymax, value_type zmax) :
|
value_type xmax, value_type ymax, value_type zmax) :
|
||||||
@@ -73,6 +79,9 @@ class BoundingBoxImpl
|
|||||||
-FLT_MAX);
|
-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. */
|
/** Returns true if the bounding box extents are valid, false otherwise. */
|
||||||
inline bool valid() const
|
inline bool valid() const
|
||||||
{
|
{
|
||||||
@@ -189,7 +198,8 @@ class BoundingBoxImpl
|
|||||||
|
|
||||||
/** Expands this bounding box to include the given sphere.
|
/** Expands this bounding box to include the given sphere.
|
||||||
* If this box is uninitialized, set it to include sh. */
|
* 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;
|
if (!sh.valid()) return;
|
||||||
|
|
||||||
@@ -227,6 +237,15 @@ class BoundingBoxImpl
|
|||||||
(v.y()>=_min.y() && v.y()<=_max.y()) &&
|
(v.y()>=_min.y() && v.y()<=_max.y()) &&
|
||||||
(v.z()>=_min.z() && v.z()<=_max.z());
|
(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;
|
typedef BoundingBoxImpl<Vec3f> BoundingBoxf;
|
||||||
|
|||||||
@@ -63,6 +63,9 @@ class BoundingSphereImpl
|
|||||||
* otherwise. */
|
* otherwise. */
|
||||||
inline bool valid() const { return _radius>=0.0; }
|
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. */
|
/** Set the bounding sphere to the given center/radius using floats. */
|
||||||
inline void set(const vec_type& center,value_type radius)
|
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
|
/** Expands the sphere to encompass the given box. Repositions the
|
||||||
* sphere center to minimize the radius increase. */
|
* 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
|
/** Expands the sphere to encompass the given box. Does not
|
||||||
* repositions the sphere center. */
|
* 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. */
|
/** Returns true if v is within the sphere. */
|
||||||
inline bool contains(const vec_type& v) const
|
inline bool contains(const vec_type& v) const
|
||||||
@@ -135,12 +140,12 @@ class BoundingSphereImpl
|
|||||||
|
|
||||||
|
|
||||||
template<typename VT>
|
template<typename VT>
|
||||||
template<typename vector_type>
|
template<typename vector_type>
|
||||||
void BoundingSphereImpl<VT>::expandBy(const vector_type& v)
|
void BoundingSphereImpl<VT>::expandBy(const vector_type& v)
|
||||||
{
|
{
|
||||||
if (valid())
|
if (valid())
|
||||||
{
|
{
|
||||||
vec_type dv = v-_center;
|
vec_type dv = vec_type(v)-_center;
|
||||||
value_type r = dv.length();
|
value_type r = dv.length();
|
||||||
if (r>_radius)
|
if (r>_radius)
|
||||||
{
|
{
|
||||||
@@ -157,12 +162,12 @@ void BoundingSphereImpl<VT>::expandBy(const vector_type& v)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename VT>
|
template<typename VT>
|
||||||
template<typename vector_type>
|
template<typename vector_type>
|
||||||
void BoundingSphereImpl<VT>::expandRadiusBy(const vector_type& v)
|
void BoundingSphereImpl<VT>::expandRadiusBy(const vector_type& v)
|
||||||
{
|
{
|
||||||
if (valid())
|
if (valid())
|
||||||
{
|
{
|
||||||
value_type r = (v-_center).length();
|
value_type r = (vec_type(v)-_center).length();
|
||||||
if (r>_radius) _radius = r;
|
if (r>_radius) _radius = r;
|
||||||
// else do nothing as vertex is within sphere.
|
// else do nothing as vertex is within sphere.
|
||||||
}
|
}
|
||||||
@@ -244,7 +249,8 @@ void BoundingSphereImpl<VT>::expandRadiusBy(const BoundingSphereImpl& sh)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename VT>
|
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())
|
if (bb.valid())
|
||||||
{
|
{
|
||||||
@@ -274,7 +280,8 @@ void BoundingSphereImpl<VT>::expandBy(const BoundingBoxImpl<VT>& bb)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename VT>
|
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())
|
if (bb.valid())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ inline void clampGEQUAL(T& value,const T minValue,const char* valueName)
|
|||||||
{
|
{
|
||||||
if (value<minValue)
|
if (value<minValue)
|
||||||
{
|
{
|
||||||
notify(WARN) << "Warning: "<<valueName<<" of "<<value<<" is below permitted minimum, clampping to "<<minValue<<"."<< std::endl;
|
notify(WARN) << "Warning: "<<valueName<<" of "<<value<<" is below permitted minimum, clamping to "<<minValue<<"."<< std::endl;
|
||||||
value = minValue;
|
value = minValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -40,7 +40,7 @@ inline void clampLEQUAL(T& value,const T maxValue,const char* valueName)
|
|||||||
{
|
{
|
||||||
if (value>maxValue)
|
if (value>maxValue)
|
||||||
{
|
{
|
||||||
notify(WARN) << "Warning: "<<valueName<<" of "<<value<<" is above permitted maximum, clampping to "<<maxValue<<"."<< std::endl;
|
notify(WARN) << "Warning: "<<valueName<<" of "<<value<<" is above permitted maximum, clamping to "<<maxValue<<"."<< std::endl;
|
||||||
value = maxValue;
|
value = maxValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -55,13 +55,13 @@ inline void clampBetweenRange(T& value,const T minValue,const T maxValue,const c
|
|||||||
{
|
{
|
||||||
if (value<minValue)
|
if (value<minValue)
|
||||||
{
|
{
|
||||||
notify(WARN) << "Warning: "<<valueName<<" of "<<value<<" is below permitted minimum, clampping to "<<minValue<<"."<< std::endl;
|
notify(WARN) << "Warning: "<<valueName<<" of "<<value<<" is below permitted minimum, clamping to "<<minValue<<"."<< std::endl;
|
||||||
value = minValue;
|
value = minValue;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (value>maxValue)
|
if (value>maxValue)
|
||||||
{
|
{
|
||||||
notify(WARN) << "Warning: "<<valueName<<" of "<<value<<" is above permitted maximum, clampping to "<<maxValue<<"."<< std::endl;
|
notify(WARN) << "Warning: "<<valueName<<" of "<<value<<" is above permitted maximum, clamping to "<<maxValue<<"."<< std::endl;
|
||||||
value = maxValue;
|
value = maxValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,7 +75,7 @@ inline void clampArrayElementGEQUAL(A& value,unsigned int i,const T minValue,con
|
|||||||
{
|
{
|
||||||
if (value[i]<minValue)
|
if (value[i]<minValue)
|
||||||
{
|
{
|
||||||
notify(WARN) << "Warning: "<<valueName<<"["<<i<<"] of "<<value[i]<<" is below permitted minimum, clampping to "<<minValue<<"."<< std::endl;
|
notify(WARN) << "Warning: "<<valueName<<"["<<i<<"] of "<<value[i]<<" is below permitted minimum, clamping to "<<minValue<<"."<< std::endl;
|
||||||
value[i] = minValue;
|
value[i] = minValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -88,7 +88,7 @@ inline void clampArrayElementLEQUAL(A& value,unsigned int i,const T maxValue,con
|
|||||||
{
|
{
|
||||||
if (value[i]>maxValue)
|
if (value[i]>maxValue)
|
||||||
{
|
{
|
||||||
notify(WARN) << "Warning: "<<valueName<<"["<<i<<"] of "<<value[i]<<" is above permitted maximum, clampping to "<<maxValue<<"."<< std::endl;
|
notify(WARN) << "Warning: "<<valueName<<"["<<i<<"] of "<<value[i]<<" is above permitted maximum, clamping to "<<maxValue<<"."<< std::endl;
|
||||||
value = maxValue;
|
value = maxValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -103,13 +103,13 @@ inline void clampArrayElementBetweenRange(A& value,unsigned int i,const T minVal
|
|||||||
{
|
{
|
||||||
if (value[i]<minValue)
|
if (value[i]<minValue)
|
||||||
{
|
{
|
||||||
notify(WARN) << "Warning: "<<valueName<<"["<<i<<"] of "<<value[i]<<" is below permitted minimum, clampping to "<<minValue<<"."<< std::endl;
|
notify(WARN) << "Warning: "<<valueName<<"["<<i<<"] of "<<value[i]<<" is below permitted minimum, clamping to "<<minValue<<"."<< std::endl;
|
||||||
value[i] = minValue;
|
value[i] = minValue;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (value[i]>maxValue)
|
if (value[i]>maxValue)
|
||||||
{
|
{
|
||||||
notify(WARN) << "Warning: "<<valueName<<"["<<i<<"] of "<<value[i]<<" is above permitted maximum, clampping to "<<maxValue<<"."<< std::endl;
|
notify(WARN) << "Warning: "<<valueName<<"["<<i<<"] of "<<value[i]<<" is above permitted maximum, clamping to "<<maxValue<<"."<< std::endl;
|
||||||
value[i] = maxValue;
|
value[i] = maxValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -680,6 +680,19 @@ class OSG_EXPORT Camera : public Transform, public CullSettings
|
|||||||
ref_ptr<DrawCallback> _finalDrawCallback;
|
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
|
#endif
|
||||||
|
|||||||
@@ -400,7 +400,7 @@ namespace osg
|
|||||||
FrameBufferObject();
|
FrameBufferObject();
|
||||||
FrameBufferObject(const FrameBufferObject& copy, const CopyOp& copyop = CopyOp::SHALLOW_COPY);
|
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;
|
inline const AttachmentMap& getAttachmentMap() const;
|
||||||
|
|
||||||
@@ -418,6 +418,11 @@ namespace osg
|
|||||||
|
|
||||||
void apply(State &state) const;
|
void apply(State &state) const;
|
||||||
|
|
||||||
|
inline GLuint getHandle(unsigned int contextID) const
|
||||||
|
{
|
||||||
|
return _fboID[contextID];
|
||||||
|
}
|
||||||
|
|
||||||
enum BindTarget
|
enum BindTarget
|
||||||
{
|
{
|
||||||
READ_FRAMEBUFFER = GL_READ_FRAMEBUFFER_EXT,
|
READ_FRAMEBUFFER = GL_READ_FRAMEBUFFER_EXT,
|
||||||
|
|||||||
@@ -96,7 +96,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// XXX This is from Win32's <ctype.h>
|
// XXX This is from Win32's <ctype.h>
|
||||||
#if !defined(_WCHAR_T_DEFINED) && !(defined(__GNUC__)&&((__GNUC__ == 3)||(__GNUC__ == 4)))
|
#if !defined(_WCHAR_T_DEFINED) && !(defined(__GNUC__)&&(__GNUC__ >2))
|
||||||
typedef unsigned short wchar_t;
|
typedef unsigned short wchar_t;
|
||||||
#define _WCHAR_T_DEFINED
|
#define _WCHAR_T_DEFINED
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -385,8 +385,6 @@ typedef char GLchar;
|
|||||||
#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6
|
#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6
|
||||||
#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7
|
#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7
|
||||||
#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8
|
#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8
|
||||||
#define GL_RED_SNORM 0x8F90
|
|
||||||
#define GL_RG_SNORM 0x8F91
|
|
||||||
#define GL_RGB_SNORM 0x8F92
|
#define GL_RGB_SNORM 0x8F92
|
||||||
#define GL_RGBA_SNORM 0x8F93
|
#define GL_RGBA_SNORM 0x8F93
|
||||||
#define GL_R8_SNORM 0x8F94
|
#define GL_R8_SNORM 0x8F94
|
||||||
@@ -402,6 +400,14 @@ typedef char GLchar;
|
|||||||
#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E
|
#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E
|
||||||
#endif
|
#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
|
#ifndef GL_VERSION_4_0
|
||||||
#define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C
|
#define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C
|
||||||
#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D
|
#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; }
|
void setShaderAtomicCounterSupported(bool flag) { _isShaderAtomicCountersSupported = flag; }
|
||||||
bool isShaderAtomicCounterSupported() const {return _isShaderAtomicCountersSupported; }
|
bool isShaderAtomicCounterSupported() const {return _isShaderAtomicCountersSupported; }
|
||||||
|
|
||||||
|
bool isDrawBuffersSupported() const { return _glDrawBuffers!=0; }
|
||||||
|
|
||||||
/** Function to call to get the extension of a specified context.
|
/** Function to call to get the extension of a specified context.
|
||||||
* If the Exentsion object for that context has not yet been created then
|
* If the Exentsion object for that context has not yet been created then
|
||||||
* and the 'createIfNotInitalized' flag been set to false then returns NULL.
|
* 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. */
|
* 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 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;
|
if (!_data) return NULL;
|
||||||
return _data+(column*getPixelSizeInBits())/8+row*getRowStepInBytes()+image*getImageSizeInBytes();
|
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;
|
if (!_data) return NULL;
|
||||||
return _data+(column*getPixelSizeInBits())/8+row*getRowStepInBytes()+image*getImageSizeInBytes();
|
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;
|
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>
|
template<typename T>
|
||||||
inline T absolute(T v) { return v<(T)0?-v:v; }
|
inline T absolute(T v) { return v<(T)0?-v:v; }
|
||||||
|
|
||||||
|
|||||||
@@ -201,7 +201,12 @@ class OSG_EXPORT Node : public Object
|
|||||||
/** Convenience method that removes a given callback from a node, even if that callback is nested. There is no error return in case the given callback is not found. */
|
/** 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) {
|
inline void removeUpdateCallback(NodeCallback* nc) {
|
||||||
if (nc != NULL && _updateCallback.valid()) {
|
if (nc != NULL && _updateCallback.valid()) {
|
||||||
if (_updateCallback == nc) setUpdateCallback(nc->getNestedCallback()); // replace the callback by the nested one
|
if (_updateCallback == nc)
|
||||||
|
{
|
||||||
|
ref_ptr<NodeCallback> new_nested_callback = nc->getNestedCallback();
|
||||||
|
nc->setNestedCallback(0);
|
||||||
|
setUpdateCallback(new_nested_callback.get());
|
||||||
|
}
|
||||||
else _updateCallback->removeNestedCallback(nc);
|
else _updateCallback->removeNestedCallback(nc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -231,7 +236,12 @@ class OSG_EXPORT Node : public Object
|
|||||||
/** Convenience method that removes a given callback from a node, even if that callback is nested. There is no error return in case the given callback is not found. */
|
/** 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) {
|
inline void removeEventCallback(NodeCallback* nc) {
|
||||||
if (nc != NULL && _eventCallback.valid()) {
|
if (nc != NULL && _eventCallback.valid()) {
|
||||||
if (_eventCallback == nc) setEventCallback(nc->getNestedCallback()); // replace the callback by the nested one
|
if (_eventCallback == nc)
|
||||||
|
{
|
||||||
|
ref_ptr<NodeCallback> new_nested_callback = nc->getNestedCallback();
|
||||||
|
nc->setNestedCallback(0);
|
||||||
|
setEventCallback(new_nested_callback.get()); // replace the callback by the nested one
|
||||||
|
}
|
||||||
else _eventCallback->removeNestedCallback(nc);
|
else _eventCallback->removeNestedCallback(nc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -261,7 +271,12 @@ class OSG_EXPORT Node : public Object
|
|||||||
/** Convenience method that removes a given callback from a node, even if that callback is nested. There is no error return in case the given callback is not found. */
|
/** 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) {
|
inline void removeCullCallback(NodeCallback* nc) {
|
||||||
if (nc != NULL && _cullCallback.valid()) {
|
if (nc != NULL && _cullCallback.valid()) {
|
||||||
if (_cullCallback == nc) setCullCallback(nc->getNestedCallback()); // replace the callback by the nested one
|
if (_cullCallback == nc)
|
||||||
|
{
|
||||||
|
ref_ptr<NodeCallback> new_nested_callback = nc->getNestedCallback();
|
||||||
|
nc->setNestedCallback(0);
|
||||||
|
setCullCallback(new_nested_callback.get()); // replace the callback by the nested one
|
||||||
|
}
|
||||||
else _cullCallback->removeNestedCallback(nc);
|
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,
|
/** Set the current texture unit, return true if selected,
|
||||||
* false if selection failed such as when multi texturing is not supported.
|
* false if selection failed such as when multi texturing is not supported.
|
||||||
* note, only updates values that change.*/
|
* note, only updates values that change.*/
|
||||||
@@ -1329,11 +1336,6 @@ class OSG_EXPORT State : public Referenced, public Observer
|
|||||||
if (_lastAppliedProgramObject!=program)
|
if (_lastAppliedProgramObject!=program)
|
||||||
{
|
{
|
||||||
_lastAppliedProgramObject = program;
|
_lastAppliedProgramObject = program;
|
||||||
if (program && _appliedProgramObjectSet.count(program)==0)
|
|
||||||
{
|
|
||||||
_appliedProgramObjectSet.insert(program);
|
|
||||||
program->addObserver(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
inline const Program::PerContextProgram* getLastAppliedProgramObject() const { return _lastAppliedProgramObject; }
|
inline const Program::PerContextProgram* getLastAppliedProgramObject() const { return _lastAppliedProgramObject; }
|
||||||
|
|||||||
@@ -193,7 +193,9 @@ class OSG_EXPORT StateAttribute : public Object
|
|||||||
|
|
||||||
ATOMICCOUNTERBUFFERBINDING,
|
ATOMICCOUNTERBUFFERBINDING,
|
||||||
|
|
||||||
PATCH_PARAMETER
|
PATCH_PARAMETER,
|
||||||
|
|
||||||
|
FRAME_BUFFER_OBJECT
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Simple pairing between an attribute type and the member within that attribute type group.*/
|
/** Simple pairing between an attribute type and the member within that attribute type group.*/
|
||||||
|
|||||||
@@ -305,6 +305,25 @@
|
|||||||
#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E
|
#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef GL_VERSION_1_1
|
||||||
|
#define GL_R3_G3_B2 0x2A10
|
||||||
|
#define GL_RGB4 0x804F
|
||||||
|
#define GL_RGB5 0x8050
|
||||||
|
#define GL_RGB8 0x8051
|
||||||
|
#define GL_RGB10 0x8052
|
||||||
|
#define GL_RGB12 0x8053
|
||||||
|
#define GL_RGB16 0x8054
|
||||||
|
#define GL_RGBA2 0x8055
|
||||||
|
#define GL_RGBA4 0x8056
|
||||||
|
#define GL_RGB5_A1 0x8057
|
||||||
|
#define GL_RGBA8 0x8058
|
||||||
|
#define GL_RGB10_A2 0x8059
|
||||||
|
#define GL_RGBA12 0x805A
|
||||||
|
#define GL_RGBA16 0x805B
|
||||||
|
#define GL_BGR_EXT 0x80E0
|
||||||
|
#define GL_BGRA_EXT 0x80E1
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef GL_ARB_texture_rg
|
#ifndef GL_ARB_texture_rg
|
||||||
#define GL_RG 0x8227
|
#define GL_RG 0x8227
|
||||||
#define GL_RG_INTEGER 0x8228
|
#define GL_RG_INTEGER 0x8228
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ extern "C" {
|
|||||||
|
|
||||||
#define OPENSCENEGRAPH_MAJOR_VERSION 3
|
#define OPENSCENEGRAPH_MAJOR_VERSION 3
|
||||||
#define OPENSCENEGRAPH_MINOR_VERSION 2
|
#define OPENSCENEGRAPH_MINOR_VERSION 2
|
||||||
#define OPENSCENEGRAPH_PATCH_VERSION 0
|
#define OPENSCENEGRAPH_PATCH_VERSION 3
|
||||||
#define OPENSCENEGRAPH_SOVERSION 99
|
#define OPENSCENEGRAPH_SOVERSION 100
|
||||||
|
|
||||||
/* Convenience macro that can be used to decide whether a feature is present or not i.e.
|
/* 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)
|
* #if OSG_MIN_VERSION_REQUIRED(2,9,5)
|
||||||
|
|||||||
@@ -94,6 +94,10 @@ class ref_ptr
|
|||||||
bool operator!() const { return _ptr==0; } // not required
|
bool operator!() const { return _ptr==0; } // not required
|
||||||
bool valid() const { return _ptr!=0; }
|
bool valid() const { return _ptr!=0; }
|
||||||
|
|
||||||
|
/** release the pointer from ownership by this ref_ptr<>, decrementing the objects refencedCount() via unref_nodelete() to prevent the Object
|
||||||
|
* object from being deleted even if the reference count goes to zero. Use when using a local ref_ptr<> to an Object that you want to return
|
||||||
|
* from a function/method via a C pointer, whilst preventing the normal ref_ptr<> destructor from cleaning up the object. When using release()
|
||||||
|
* you are implicitly expecting other code to take over managment of the object, otherwise a memory leak will result. */
|
||||||
T* release() { T* tmp=_ptr; if (_ptr) _ptr->unref_nodelete(); _ptr=0; return tmp; }
|
T* release() { T* tmp=_ptr; if (_ptr) _ptr->unref_nodelete(); _ptr=0; return tmp; }
|
||||||
|
|
||||||
void swap(ref_ptr& rp) { T* tmp=_ptr; _ptr=rp._ptr; rp._ptr=tmp; }
|
void swap(ref_ptr& rp) { T* tmp=_ptr; _ptr=rp._ptr; rp._ptr=tmp; }
|
||||||
|
|||||||
@@ -89,6 +89,7 @@ public:
|
|||||||
// Serialization related functions
|
// Serialization related functions
|
||||||
OutputStream& operator<<( bool b ) { _out->writeBool(b); return *this; }
|
OutputStream& operator<<( bool b ) { _out->writeBool(b); return *this; }
|
||||||
OutputStream& operator<<( char c ) { _out->writeChar(c); 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<<( unsigned char c ) { _out->writeUChar(c); return *this; }
|
||||||
OutputStream& operator<<( short s ) { _out->writeShort(s); return *this; }
|
OutputStream& operator<<( short s ) { _out->writeShort(s); return *this; }
|
||||||
OutputStream& operator<<( unsigned short s ) { _out->writeUShort(s); return *this; }
|
OutputStream& operator<<( unsigned short s ) { _out->writeUShort(s); return *this; }
|
||||||
|
|||||||
@@ -21,8 +21,7 @@
|
|||||||
namespace osgManipulator {
|
namespace osgManipulator {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tab plane dragger consists of a plane with tabs on it's corners and edges
|
* Translate plane dragger consists of a wireframe box representing a plane that can be dragged to translate along the plane.
|
||||||
* for scaling. And the plane is used as a 2D translate dragger.
|
|
||||||
*/
|
*/
|
||||||
class OSGMANIPULATOR_EXPORT TranslatePlaneDragger : public CompositeDragger
|
class OSGMANIPULATOR_EXPORT TranslatePlaneDragger : public CompositeDragger
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ class OSGUTIL_EXPORT SceneView : public osg::Object, public osg::CullSettings
|
|||||||
SKY_LIGHT = 0x2,
|
SKY_LIGHT = 0x2,
|
||||||
COMPILE_GLOBJECTS_AT_INIT = 0x4,
|
COMPILE_GLOBJECTS_AT_INIT = 0x4,
|
||||||
APPLY_GLOBAL_DEFAULTS = 0x8,
|
APPLY_GLOBAL_DEFAULTS = 0x8,
|
||||||
CLEAR_GLOBAL_STATESET = 0x16,
|
CLEAR_GLOBAL_STATESET = 0x10,
|
||||||
STANDARD_SETTINGS = HEADLIGHT |
|
STANDARD_SETTINGS = HEADLIGHT |
|
||||||
COMPILE_GLOBJECTS_AT_INIT |
|
COMPILE_GLOBJECTS_AT_INIT |
|
||||||
APPLY_GLOBAL_DEFAULTS |
|
APPLY_GLOBAL_DEFAULTS |
|
||||||
@@ -495,7 +495,7 @@ class OSGUTIL_EXPORT SceneView : public osg::Object, public osg::CullSettings
|
|||||||
bool getAutomaticFlush() const { return _automaticFlush; }
|
bool getAutomaticFlush() const { return _automaticFlush; }
|
||||||
|
|
||||||
void setResetColorMaskToAllOn(bool enable) { _resetColorMaskToAllEnabled = enable; }
|
void setResetColorMaskToAllOn(bool enable) { _resetColorMaskToAllEnabled = enable; }
|
||||||
bool setResetColorMaskToAllOn() const { return _resetColorMaskToAllEnabled; }
|
bool getResetColorMaskToAllOn() const { return _resetColorMaskToAllEnabled; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|||||||
@@ -207,6 +207,7 @@ class OSGUTIL_EXPORT StateGraph : public osg::Referenced
|
|||||||
|
|
||||||
// use return path to trace back steps to sg_new.
|
// use return path to trace back steps to sg_new.
|
||||||
std::vector<StateGraph*> return_path;
|
std::vector<StateGraph*> return_path;
|
||||||
|
return_path.reserve(sg_new->_depth+1);
|
||||||
|
|
||||||
// need to pop back root render graph.
|
// need to pop back root render graph.
|
||||||
do
|
do
|
||||||
@@ -248,6 +249,7 @@ class OSGUTIL_EXPORT StateGraph : public osg::Referenced
|
|||||||
|
|
||||||
// use return path to trace back steps to sg_new.
|
// use return path to trace back steps to sg_new.
|
||||||
std::vector<StateGraph*> return_path;
|
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.
|
// need to pop back up to the same depth as the curr state group.
|
||||||
while (sg_new->_depth>sg_curr->_depth)
|
while (sg_new->_depth>sg_curr->_depth)
|
||||||
|
|||||||
@@ -335,6 +335,12 @@ class OSGVIEWER_EXPORT ViewerBase : public virtual osg::Object
|
|||||||
osg::ref_ptr<osgUtil::IncrementalCompileOperation> _incrementalCompileOperation;
|
osg::ref_ptr<osgUtil::IncrementalCompileOperation> _incrementalCompileOperation;
|
||||||
|
|
||||||
osg::observer_ptr<osg::GraphicsContext> _currentContext;
|
osg::observer_ptr<osg::GraphicsContext> _currentContext;
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// Define private copy constructor
|
||||||
|
// otherwsie VS2015 will construct it's own which will call the private copy operator from osg::Object resulting in an compile error.
|
||||||
|
ViewerBase& operator = (const ViewerBase&) { return *this; }
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -314,6 +314,11 @@ class OSGWIDGET_EXPORT EventInterface
|
|||||||
return _eventMask;
|
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) {
|
void addCallback(Callback* cb) {
|
||||||
_callbacks.push_back(cb);
|
_callbacks.push_back(cb);
|
||||||
}
|
}
|
||||||
@@ -400,7 +405,6 @@ class OSGWIDGET_EXPORT EventInterface
|
|||||||
bool canKeyUp () const { return (_eventMask & EVENT_KEY_UP) != 0; }
|
bool canKeyUp () const { return (_eventMask & EVENT_KEY_UP) != 0; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef std::list<osg::ref_ptr<Callback> > CallbackList;
|
|
||||||
|
|
||||||
unsigned int _eventMask;
|
unsigned int _eventMask;
|
||||||
CallbackList _callbacks;
|
CallbackList _callbacks;
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
# what to do with it.
|
# what to do with it.
|
||||||
ADD_DEFINITIONS(-DOPENTHREADS_EXPORTS)
|
ADD_DEFINITIONS(-DOPENTHREADS_EXPORTS)
|
||||||
|
|
||||||
SET(OPENTHREADS_MAJOR_VERSION 2)
|
SET(OPENTHREADS_MAJOR_VERSION 3)
|
||||||
SET(OPENTHREADS_MINOR_VERSION 6)
|
SET(OPENTHREADS_MINOR_VERSION 2)
|
||||||
SET(OPENTHREADS_PATCH_VERSION 0)
|
SET(OPENTHREADS_PATCH_VERSION 1)
|
||||||
SET(OPENTHREADS_SOVERSION 12)
|
SET(OPENTHREADS_SOVERSION 20)
|
||||||
|
|
||||||
SET(OPENTHREADS_VERSION ${OPENTHREADS_MAJOR_VERSION}.${OPENTHREADS_MINOR_VERSION}.${OPENTHREADS_PATCH_VERSION})
|
SET(OPENTHREADS_VERSION ${OPENTHREADS_MAJOR_VERSION}.${OPENTHREADS_MINOR_VERSION}.${OPENTHREADS_PATCH_VERSION})
|
||||||
|
|
||||||
|
|||||||
@@ -149,7 +149,30 @@ private:
|
|||||||
#endif
|
#endif
|
||||||
#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;
|
ThreadCleanupStruct tcs;
|
||||||
tcs.thread = thread;
|
tcs.thread = thread;
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include <osg/ApplicationUsage>
|
#include <osg/ApplicationUsage>
|
||||||
|
#include <osg/Object>
|
||||||
#include <osg/Math>
|
#include <osg/Math>
|
||||||
#include <osg/ref_ptr>
|
#include <osg/ref_ptr>
|
||||||
|
|
||||||
@@ -33,6 +34,8 @@ ApplicationUsage* ApplicationUsage::instance()
|
|||||||
return s_applicationUsage.get();
|
return s_applicationUsage.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OSG_INIT_SINGLETON_PROXY(ApplicationUsageSingletonProxy, ApplicationUsage::instance())
|
||||||
|
|
||||||
void ApplicationUsage::addUsageExplanation(Type type,const std::string& option,const std::string& explanation)
|
void ApplicationUsage::addUsageExplanation(Type type,const std::string& option,const std::string& explanation)
|
||||||
{
|
{
|
||||||
switch(type)
|
switch(type)
|
||||||
|
|||||||
@@ -225,21 +225,26 @@ void CollectOccludersVisitor::removeOccludedOccluders()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// now check all the holes in the occludee against the occluder,
|
// now check all the holes in the occludee against the occluder, and remove the ones that won't be valid
|
||||||
// do so in reverse order so that the iterators remain valid.
|
unsigned int previous_valid_hole_i = 0;
|
||||||
for(ShadowVolumeOccluder::HoleList::reverse_iterator holeItr=holeList.rbegin();
|
for(unsigned int i=0; i<holeList.size(); ++i)
|
||||||
holeItr!=holeList.rend();
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
if (occluder->contains((*holeItr).getReferenceVertexList()))
|
if (!occluder->contains(holeList[i].getReferenceVertexList()))
|
||||||
{
|
{
|
||||||
holeList.erase((++holeItr).base());
|
if (previous_valid_hole_i<i)
|
||||||
}
|
{
|
||||||
else
|
// copy valid holes into gaps left by invalid ones
|
||||||
{
|
holeList[previous_valid_hole_i] = holeList[i];
|
||||||
++holeItr;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
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());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ void DisplaySettings::setDefaults()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
_compileContextsHint = false;
|
_compileContextsHint = false;
|
||||||
_serializeDrawDispatch = true;
|
_serializeDrawDispatch = false;
|
||||||
_useSceneViewForStereoHint = true;
|
_useSceneViewForStereoHint = true;
|
||||||
|
|
||||||
_numDatabaseThreadsHint = 2;
|
_numDatabaseThreadsHint = 2;
|
||||||
|
|||||||
@@ -105,7 +105,8 @@ FBOExtensions::FBOExtensions(unsigned int contextID)
|
|||||||
#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE)
|
#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE)
|
||||||
_supported = _supported &&
|
_supported = _supported &&
|
||||||
glFramebufferTexture1D != 0 &&
|
glFramebufferTexture1D != 0 &&
|
||||||
glFramebufferTexture3D != 0;
|
glFramebufferTexture3D != 0 &&
|
||||||
|
isGLExtensionOrVersionSupported(contextID, "GL_EXT_framebuffer_object",3.0f);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
LOAD_FBO_EXT(glBlitFramebuffer);
|
LOAD_FBO_EXT(glBlitFramebuffer);
|
||||||
@@ -913,12 +914,19 @@ void FrameBufferObject::apply(State &state, BindTarget target) const
|
|||||||
ext->glBindFramebuffer(target, fboID);
|
ext->glBindFramebuffer(target, fboID);
|
||||||
|
|
||||||
// enable drawing buffers to render the result to fbo
|
// 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 (_drawBuffers.size() > 0)
|
||||||
if (gl2e)
|
|
||||||
{
|
{
|
||||||
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 <<
|
OSG_WARN <<
|
||||||
"Warning: FrameBufferObject: could not attach PACKED_DEPTH_STENCIL_BUFFER, "
|
"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;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -161,12 +161,14 @@ void Geometry::setTexCoordArray(unsigned int index,Array* array, osg::Array::Bin
|
|||||||
if (_texCoordList.size()<=index)
|
if (_texCoordList.size()<=index)
|
||||||
_texCoordList.resize(index+1);
|
_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;
|
_texCoordList[index] = array;
|
||||||
|
|
||||||
// do we set to array BIND_PER_VERTEX?
|
|
||||||
|
|
||||||
dirtyDisplayList();
|
dirtyDisplayList();
|
||||||
|
|
||||||
if (_useVertexBufferObjects && array)
|
if (_useVertexBufferObjects && array)
|
||||||
@@ -1425,7 +1427,7 @@ void Geometry::fixDeprecatedData()
|
|||||||
case(PrimitiveSet::DrawArraysPrimitiveType):
|
case(PrimitiveSet::DrawArraysPrimitiveType):
|
||||||
{
|
{
|
||||||
const DrawArrays* drawArray = static_cast<const DrawArrays*>(primitiveset);
|
const DrawArrays* drawArray = static_cast<const DrawArrays*>(primitiveset);
|
||||||
numVertices = drawArray->getCount();
|
numVertices += drawArray->getCount();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case(PrimitiveSet::DrawArrayLengthsPrimitiveType):
|
case(PrimitiveSet::DrawArrayLengthsPrimitiveType):
|
||||||
@@ -1437,7 +1439,6 @@ void Geometry::fixDeprecatedData()
|
|||||||
{
|
{
|
||||||
unsigned int localNumVertices = *primItr;
|
unsigned int localNumVertices = *primItr;
|
||||||
numVertices += localNumVertices;
|
numVertices += localNumVertices;
|
||||||
primItr += localNumVertices;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1538,7 +1539,8 @@ void Geometry::fixDeprecatedData()
|
|||||||
|
|
||||||
// start the primitiveNum at -1 as we increment it the first time through when
|
// start the primitiveNum at -1 as we increment it the first time through when
|
||||||
// we start processing the primitive sets.
|
// 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();
|
for(PrimitiveSetList::iterator itr = _primitives.begin();
|
||||||
itr != _primitives.end();
|
itr != _primitives.end();
|
||||||
++itr)
|
++itr)
|
||||||
@@ -1557,27 +1559,27 @@ void Geometry::fixDeprecatedData()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// copy the vertex data across to the new arays
|
// copy the vertex data across to the new arays
|
||||||
int source_pindex = -1;
|
|
||||||
int target_vindex = 0;
|
|
||||||
switch(primitiveset->getType())
|
switch(primitiveset->getType())
|
||||||
{
|
{
|
||||||
case(PrimitiveSet::DrawArraysPrimitiveType):
|
case(PrimitiveSet::DrawArraysPrimitiveType):
|
||||||
{
|
{
|
||||||
if (primLength==0) primLength=primitiveset->getNumIndices();
|
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();
|
if (primLength==0) primLength = drawArray->getCount();
|
||||||
|
|
||||||
unsigned int primCount=0;
|
unsigned int primCount=0;
|
||||||
unsigned int indexEnd = drawArray->getFirst()+drawArray->getCount();
|
unsigned int startindex=drawArray->getFirst();
|
||||||
for(unsigned int vindex=drawArray->getFirst();
|
drawArray->setFirst(target_vindex);
|
||||||
|
unsigned int indexEnd = startindex+drawArray->getCount();
|
||||||
|
for(unsigned int vindex=startindex;
|
||||||
vindex<indexEnd;
|
vindex<indexEnd;
|
||||||
++vindex, ++target_vindex, ++primCount)
|
++vindex, ++target_vindex, ++primCount)
|
||||||
{
|
{
|
||||||
if ((primCount%primLength)==0) ++source_pindex;
|
if ((primCount%primLength)==0) ++source_pindex;
|
||||||
|
|
||||||
// copy bind per primitive from primitiveNum
|
// copy bind per vertex from vindex
|
||||||
for(PtrList::iterator itr = perVertexPtrs.begin();
|
for(PtrList::iterator itr = perVertexPtrs.begin();
|
||||||
itr != perVertexPtrs.end();
|
itr != perVertexPtrs.end();
|
||||||
++itr)
|
++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();
|
for(PtrList::iterator itr = perPrimitivePtrs.begin();
|
||||||
itr != perPrimitivePtrs.end();
|
itr != perPrimitivePtrs.end();
|
||||||
++itr)
|
++itr)
|
||||||
@@ -1609,23 +1611,22 @@ void Geometry::fixDeprecatedData()
|
|||||||
}
|
}
|
||||||
case(PrimitiveSet::DrawArrayLengthsPrimitiveType):
|
case(PrimitiveSet::DrawArrayLengthsPrimitiveType):
|
||||||
{
|
{
|
||||||
const DrawArrayLengths* drawArrayLengths = static_cast<const DrawArrayLengths*>(primitiveset);
|
DrawArrayLengths* drawArrayLengths = static_cast<DrawArrayLengths*>(primitiveset);
|
||||||
unsigned int vindex=drawArrayLengths->getFirst();
|
unsigned int vindex=drawArrayLengths->getFirst();
|
||||||
for(DrawArrayLengths::const_iterator primItr=drawArrayLengths->begin();
|
for(DrawArrayLengths::iterator primItr=drawArrayLengths->begin();
|
||||||
primItr!=drawArrayLengths->end();
|
primItr!=drawArrayLengths->end();
|
||||||
++primItr)
|
++primItr)
|
||||||
{
|
{
|
||||||
unsigned int localPrimLength;
|
unsigned int localPrimLength;
|
||||||
if (primLength==0) localPrimLength=*primItr;
|
if (primLength==0) localPrimLength=*primItr;
|
||||||
else localPrimLength=primLength;
|
else localPrimLength=primLength;
|
||||||
|
drawArrayLengths->setFirst(target_vindex);
|
||||||
for(GLsizei primCount=0;
|
for(GLsizei primCount=0;
|
||||||
primCount<*primItr;
|
primCount<*primItr;
|
||||||
++vindex, ++target_vindex, ++primCount)
|
++vindex, ++target_vindex, ++primCount)
|
||||||
{
|
{
|
||||||
if ((primCount%localPrimLength)==0) ++source_pindex;
|
if ((primCount%localPrimLength)==0) ++source_pindex;
|
||||||
|
// copy bind per vertex from vindex
|
||||||
// copy bind per primitive from primitiveNum
|
|
||||||
for(PtrList::iterator itr = perVertexPtrs.begin();
|
for(PtrList::iterator itr = perVertexPtrs.begin();
|
||||||
itr != perVertexPtrs.end();
|
itr != perVertexPtrs.end();
|
||||||
++itr)
|
++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();
|
for(PtrList::iterator itr = perPrimitivePtrs.begin();
|
||||||
itr != perPrimitivePtrs.end();
|
itr != perPrimitivePtrs.end();
|
||||||
++itr)
|
++itr)
|
||||||
@@ -1660,16 +1661,17 @@ void Geometry::fixDeprecatedData()
|
|||||||
{
|
{
|
||||||
if (primLength==0) primLength=primitiveset->getNumIndices();
|
if (primLength==0) primLength=primitiveset->getNumIndices();
|
||||||
|
|
||||||
const DrawElementsUByte* drawElements = static_cast<const DrawElementsUByte*>(primitiveset);
|
DrawElementsUByte* drawElements = static_cast<DrawElementsUByte*>(primitiveset);
|
||||||
unsigned int primCount=0;
|
unsigned int primCount=0;
|
||||||
for(DrawElementsUByte::const_iterator primItr=drawElements->begin();
|
for(DrawElementsUByte::iterator primItr=drawElements->begin();
|
||||||
primItr!=drawElements->end();
|
primItr!=drawElements->end();
|
||||||
++primCount, ++target_vindex, ++primItr)
|
++primCount, ++target_vindex, ++primItr)
|
||||||
{
|
{
|
||||||
if ((primCount%primLength)==0) ++source_pindex;
|
if ((primCount%primLength)==0) ++source_pindex;
|
||||||
unsigned int vindex=*primItr;
|
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();
|
for(PtrList::iterator itr = perVertexPtrs.begin();
|
||||||
itr != perVertexPtrs.end();
|
itr != perVertexPtrs.end();
|
||||||
++itr)
|
++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();
|
for(PtrList::iterator itr = perPrimitivePtrs.begin();
|
||||||
itr != perPrimitivePtrs.end();
|
itr != perPrimitivePtrs.end();
|
||||||
++itr)
|
++itr)
|
||||||
@@ -1703,16 +1705,17 @@ void Geometry::fixDeprecatedData()
|
|||||||
{
|
{
|
||||||
if (primLength==0) primLength=primitiveset->getNumIndices();
|
if (primLength==0) primLength=primitiveset->getNumIndices();
|
||||||
|
|
||||||
const DrawElementsUShort* drawElements = static_cast<const DrawElementsUShort*>(primitiveset);
|
DrawElementsUShort* drawElements = static_cast<DrawElementsUShort*>(primitiveset);
|
||||||
unsigned int primCount=0;
|
unsigned int primCount=0;
|
||||||
for(DrawElementsUShort::const_iterator primItr=drawElements->begin();
|
for(DrawElementsUShort::iterator primItr=drawElements->begin();
|
||||||
primItr!=drawElements->end();
|
primItr!=drawElements->end();
|
||||||
++primCount, ++target_vindex, ++primItr)
|
++primCount, ++target_vindex, ++primItr)
|
||||||
{
|
{
|
||||||
if ((primCount%primLength)==0) ++primitiveNum;
|
if ((primCount%primLength)==0) ++source_pindex;
|
||||||
unsigned int vindex=*primItr;
|
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();
|
for(PtrList::iterator itr = perVertexPtrs.begin();
|
||||||
itr != perVertexPtrs.end();
|
itr != perVertexPtrs.end();
|
||||||
++itr)
|
++itr)
|
||||||
@@ -1725,8 +1728,7 @@ void Geometry::fixDeprecatedData()
|
|||||||
*target++ = *source++;
|
*target++ = *source++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// copy bind per primitive from source_pindex
|
||||||
// copy bind per vertex from vindex
|
|
||||||
for(PtrList::iterator itr = perPrimitivePtrs.begin();
|
for(PtrList::iterator itr = perPrimitivePtrs.begin();
|
||||||
itr != perPrimitivePtrs.end();
|
itr != perPrimitivePtrs.end();
|
||||||
++itr)
|
++itr)
|
||||||
@@ -1746,16 +1748,17 @@ void Geometry::fixDeprecatedData()
|
|||||||
{
|
{
|
||||||
if (primLength==0) primLength=primitiveset->getNumIndices();
|
if (primLength==0) primLength=primitiveset->getNumIndices();
|
||||||
|
|
||||||
const DrawElementsUInt* drawElements = static_cast<const DrawElementsUInt*>(primitiveset);
|
DrawElementsUInt* drawElements = static_cast<DrawElementsUInt*>(primitiveset);
|
||||||
unsigned int primCount=0;
|
unsigned int primCount=0;
|
||||||
for(DrawElementsUInt::const_iterator primItr=drawElements->begin();
|
for(DrawElementsUInt::iterator primItr=drawElements->begin();
|
||||||
primItr!=drawElements->end();
|
primItr!=drawElements->end();
|
||||||
++primCount, ++target_vindex, ++primItr)
|
++primCount, ++target_vindex, ++primItr)
|
||||||
{
|
{
|
||||||
if ((primCount%primLength)==0) ++primitiveNum;
|
if ((primCount%primLength)==0) ++source_pindex;
|
||||||
unsigned int vindex=*primItr;
|
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();
|
for(PtrList::iterator itr = perVertexPtrs.begin();
|
||||||
itr != perVertexPtrs.end();
|
itr != perVertexPtrs.end();
|
||||||
++itr)
|
++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();
|
for(PtrList::iterator itr = perPrimitivePtrs.begin();
|
||||||
itr != perPrimitivePtrs.end();
|
itr != perPrimitivePtrs.end();
|
||||||
++itr)
|
++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())
|
if (callCloseImplementation && _state.valid() && isRealized())
|
||||||
{
|
{
|
||||||
OSG_INFO<<"Closing still viable window "<<sharedContextExists<<" _state->getContextID()="<<_state->getContextID()<<std::endl;
|
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_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;
|
OSG_INFO<<"Done delete of GL objects"<<std::endl;
|
||||||
}
|
}
|
||||||
@@ -567,9 +577,9 @@ void GraphicsContext::close(bool callCloseImplementation)
|
|||||||
// which have already been deleted
|
// which have already been deleted
|
||||||
|
|
||||||
osg::flushAllDeletedGLObjects(_state->getContextID());
|
osg::flushAllDeletedGLObjects(_state->getContextID());
|
||||||
}
|
|
||||||
|
|
||||||
_state->reset();
|
_state->reset();
|
||||||
|
}
|
||||||
|
|
||||||
releaseContext();
|
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
|
// 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
|
// the the flushDelete*() methods not being invoked, such as when using GraphicContextEmbedded where makeCurrent
|
||||||
// does not work.
|
// does not work.
|
||||||
if ( !sharedContextExists && _state.valid())
|
if ( !sharedContextExists && contextIDValid)
|
||||||
{
|
{
|
||||||
OSG_INFO<<"Doing discard of deleted OpenGL objects."<<std::endl;
|
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);
|
_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()
|
void GraphicsContext::runOperations()
|
||||||
{
|
{
|
||||||
// sort the cameras into order
|
// sort the cameras into order
|
||||||
|
|||||||
@@ -239,7 +239,7 @@ Image::Image(const Image& image,const CopyOp& copyop):
|
|||||||
{
|
{
|
||||||
if (image._data)
|
if (image._data)
|
||||||
{
|
{
|
||||||
int size = image.getTotalSizeInBytesIncludingMipmaps();
|
unsigned int size = image.getTotalSizeInBytesIncludingMipmaps();
|
||||||
setData(new unsigned char [size],USE_NEW_DELETE);
|
setData(new unsigned char [size],USE_NEW_DELETE);
|
||||||
unsigned char* dest_ptr = _data;
|
unsigned char* dest_ptr = _data;
|
||||||
for(DataIterator itr(&image); itr.valid(); ++itr)
|
for(DataIterator itr(&image); itr.valid(); ++itr)
|
||||||
@@ -425,6 +425,8 @@ GLenum Image::computeFormatDataType(GLenum pixelFormat)
|
|||||||
{
|
{
|
||||||
switch (pixelFormat)
|
switch (pixelFormat)
|
||||||
{
|
{
|
||||||
|
case GL_R32F:
|
||||||
|
case GL_RG32F:
|
||||||
case GL_LUMINANCE32F_ARB:
|
case GL_LUMINANCE32F_ARB:
|
||||||
case GL_LUMINANCE16F_ARB:
|
case GL_LUMINANCE16F_ARB:
|
||||||
case GL_LUMINANCE_ALPHA32F_ARB:
|
case GL_LUMINANCE_ALPHA32F_ARB:
|
||||||
@@ -466,6 +468,8 @@ GLenum Image::computeFormatDataType(GLenum pixelFormat)
|
|||||||
|
|
||||||
case GL_RGBA:
|
case GL_RGBA:
|
||||||
case GL_RGB:
|
case GL_RGB:
|
||||||
|
case GL_RED:
|
||||||
|
case GL_RG:
|
||||||
case GL_LUMINANCE:
|
case GL_LUMINANCE:
|
||||||
case GL_LUMINANCE_ALPHA:
|
case GL_LUMINANCE_ALPHA:
|
||||||
case GL_ALPHA: return GL_UNSIGNED_BYTE;
|
case GL_ALPHA: return GL_UNSIGNED_BYTE;
|
||||||
@@ -515,6 +519,9 @@ unsigned int Image::computeNumComponents(GLenum pixelFormat)
|
|||||||
case(GL_ALPHA32UI_EXT): return 1;
|
case(GL_ALPHA32UI_EXT): return 1;
|
||||||
case(GL_ALPHA16F_ARB): return 1;
|
case(GL_ALPHA16F_ARB): return 1;
|
||||||
case(GL_ALPHA32F_ARB): return 1;
|
case(GL_ALPHA32F_ARB): return 1;
|
||||||
|
case(GL_R32F): return 1;
|
||||||
|
case(GL_RG): return 2;
|
||||||
|
case(GL_RG32F): return 2;
|
||||||
case(GL_RGB): return 3;
|
case(GL_RGB): return 3;
|
||||||
case(GL_BGR): return 3;
|
case(GL_BGR): return 3;
|
||||||
case(GL_RGB8I_EXT): return 3;
|
case(GL_RGB8I_EXT): return 3;
|
||||||
@@ -799,7 +806,11 @@ int Image::computeNumberOfMipmapLevels(int s,int t, int r)
|
|||||||
{
|
{
|
||||||
int w = maximum(s, t);
|
int w = maximum(s, t);
|
||||||
w = maximum(w, r);
|
w = maximum(w, r);
|
||||||
return 1 + static_cast<int>(floor(logf(w)/logf(2.0f)));
|
|
||||||
|
int n = 0;
|
||||||
|
while (w >>= 1)
|
||||||
|
++n;
|
||||||
|
return n+1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Image::isCompressed() const
|
bool Image::isCompressed() const
|
||||||
@@ -1510,16 +1521,18 @@ void Image::flipVertical()
|
|||||||
{
|
{
|
||||||
if (!dxtc_tool::VerticalFlip(s,t,_pixelFormat,_data+_mipmapData[i]))
|
if (!dxtc_tool::VerticalFlip(s,t,_pixelFormat,_data+_mipmapData[i]))
|
||||||
{
|
{
|
||||||
OSG_NOTICE << "Notice Image::flipVertical(): Vertical flip do not succeed" << std::endl;
|
OSG_NOTICE << "Notice Image::flipVertical(): Vertical flip did not succeed" << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// its not a compressed image, so implement flip oursleves.
|
// it's not a compressed image, so implement flip ourselves.
|
||||||
|
unsigned int mipRowSize = computeRowWidthInBytes(s, _pixelFormat, _dataType, _packing);
|
||||||
|
unsigned int mipRowStep = mipRowSize;
|
||||||
unsigned char* top = _data+_mipmapData[i];
|
unsigned char* top = _data+_mipmapData[i];
|
||||||
unsigned char* bottom = top + (t-1)*rowStep;
|
unsigned char* bottom = top + (t-1)*mipRowStep;
|
||||||
|
|
||||||
flipImageVertical(top, bottom, rowSize, rowStep);
|
flipImageVertical(top, bottom, mipRowSize, mipRowStep);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -396,17 +396,8 @@ void ImageSequence::update(osg::NodeVisitor* nv)
|
|||||||
if (startLoadIndex<0) startLoadIndex = 0;
|
if (startLoadIndex<0) startLoadIndex = 0;
|
||||||
|
|
||||||
int endLoadIndex = int(preLoadTime/_timePerImage);
|
int endLoadIndex = int(preLoadTime/_timePerImage);
|
||||||
if (endLoadIndex>=int(_imageDataList.size()))
|
if (looping && (endLoadIndex>=int(_imageDataList.size()))) endLoadIndex -= int(_imageDataList.size());
|
||||||
{
|
if (endLoadIndex>=int(_imageDataList.size())) endLoadIndex = int(_imageDataList.size())-1;
|
||||||
if (looping)
|
|
||||||
{
|
|
||||||
endLoadIndex -= int(_imageDataList.size());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
endLoadIndex = int(_imageDataList.size())-1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (endLoadIndex<0) endLoadIndex = 0;
|
if (endLoadIndex<0) endLoadIndex = 0;
|
||||||
|
|
||||||
double requestTime = time;
|
double requestTime = time;
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ struct TriangleIndicesCollector
|
|||||||
const osg::Vec3& v2 = (*(_buildKdTree->_kdTree.getVertices()))[p2];
|
const osg::Vec3& v2 = (*(_buildKdTree->_kdTree.getVertices()))[p2];
|
||||||
|
|
||||||
// discard degenerate points
|
// discard degenerate points
|
||||||
if (v0==v1 || v1==v2 || v1==v2)
|
if (v0==v1 || v1==v2 || v2==v0)
|
||||||
{
|
{
|
||||||
//OSG_NOTICE<<"Disgarding degenerate triangle"<<std::endl;
|
//OSG_NOTICE<<"Disgarding degenerate triangle"<<std::endl;
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -475,7 +475,11 @@ bool Node::containsOccluderNodes() const
|
|||||||
|
|
||||||
void Node::setDescriptions(const DescriptionList& descriptions)
|
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()
|
Node::DescriptionList& Node::getDescriptions()
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ namespace osg
|
|||||||
class NullStreamBuffer : public std::streambuf
|
class NullStreamBuffer : public std::streambuf
|
||||||
{
|
{
|
||||||
private:
|
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;
|
return n;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,12 @@ bool PointSprite::checkValidityOfAssociatedModes(osg::State& state) const
|
|||||||
{
|
{
|
||||||
|
|
||||||
bool modeValid = isPointSpriteSupported(state.getContextID());
|
bool modeValid = isPointSpriteSupported(state.getContextID());
|
||||||
|
|
||||||
|
#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);
|
state.setModeValidity(GL_POINT_SPRITE_ARB, modeValid);
|
||||||
|
#endif
|
||||||
|
|
||||||
return modeValid;
|
return modeValid;
|
||||||
}
|
}
|
||||||
@@ -52,9 +57,18 @@ bool PointSprite::checkValidityOfAssociatedModes(osg::State& state) const
|
|||||||
void PointSprite::apply(osg::State& state) const
|
void PointSprite::apply(osg::State& state) const
|
||||||
{
|
{
|
||||||
#if defined( OSG_GL3_AVAILABLE )
|
#if defined( OSG_GL3_AVAILABLE )
|
||||||
|
|
||||||
const Point::Extensions* extensions = Point::getExtensions(state.getContextID(),true);
|
const Point::Extensions* extensions = Point::getExtensions(state.getContextID(),true);
|
||||||
extensions->glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN,_coordOriginMode);
|
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 )
|
#elif defined( OSG_GL_FIXED_FUNCTION_AVAILABLE )
|
||||||
|
|
||||||
if(!isPointSpriteSupported(state.getContextID())) return;
|
if(!isPointSpriteSupported(state.getContextID())) return;
|
||||||
|
|
||||||
glTexEnvi(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, 1);
|
glTexEnvi(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, 1);
|
||||||
@@ -63,8 +77,10 @@ void PointSprite::apply(osg::State& state) const
|
|||||||
|
|
||||||
if (extensions->isPointSpriteCoordOriginSupported())
|
if (extensions->isPointSpriteCoordOriginSupported())
|
||||||
extensions->glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN,_coordOriginMode);
|
extensions->glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN,_coordOriginMode);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
OSG_NOTICE<<"Warning: PointSprite::apply(State&) - not supported."<<std::endl;
|
OSG_NOTICE<<"Warning: PointSprite::apply(State&) - not supported."<<std::endl;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,7 +102,7 @@ bool PointSprite::isPointSpriteSupported(unsigned int contextID)
|
|||||||
if (!s_extensions[contextID].initialized)
|
if (!s_extensions[contextID].initialized)
|
||||||
{
|
{
|
||||||
s_extensions[contextID].initialized = true;
|
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;
|
return s_extensions[contextID].supported;
|
||||||
|
|||||||
@@ -68,18 +68,22 @@ PolygonMode::Mode PolygonMode::getMode(Face face) const
|
|||||||
|
|
||||||
void PolygonMode::apply(State&) const
|
void PolygonMode::apply(State&) const
|
||||||
{
|
{
|
||||||
#ifdef OSG_GL1_AVAILABLE
|
#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE)
|
||||||
if (_modeFront==_modeBack)
|
if (_modeFront==_modeBack)
|
||||||
{
|
{
|
||||||
glPolygonMode(GL_FRONT_AND_BACK,(GLenum)_modeFront);
|
glPolygonMode(GL_FRONT_AND_BACK,(GLenum)_modeFront);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
glPolygonMode(GL_FRONT,(GLenum)_modeFront);
|
#ifdef OSG_GL1_AVAILABLE
|
||||||
glPolygonMode(GL_BACK,(GLenum)_modeBack);
|
glPolygonMode(GL_FRONT,(GLenum)_modeFront);
|
||||||
|
glPolygonMode(GL_BACK,(GLenum)_modeBack);
|
||||||
|
#else
|
||||||
|
OSG_NOTICE << "Warning: PolygonMode::apply(State&) - only GL_FRONT_AND_BACK is supported." << std::endl;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
OSG_NOTICE<<"Warning: PolygonMode::apply(State&) - not supported."<<std::endl;
|
OSG_NOTICE << "Warning: PolygonMode::apply(State&) - is not supported." << std::endl;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -515,8 +515,8 @@ const Program::UniformBlockMap& Program::getUniformBlocks(unsigned contextID) co
|
|||||||
|
|
||||||
Program::PerContextProgram::PerContextProgram(const Program* program, unsigned int contextID, GLuint programHandle ) :
|
Program::PerContextProgram::PerContextProgram(const Program* program, unsigned int contextID, GLuint programHandle ) :
|
||||||
osg::Referenced(),
|
osg::Referenced(),
|
||||||
_loadedBinary(false),
|
|
||||||
_glProgramHandle(programHandle),
|
_glProgramHandle(programHandle),
|
||||||
|
_loadedBinary(false),
|
||||||
_contextID( contextID ),
|
_contextID( contextID ),
|
||||||
_ownsProgramHandle(false)
|
_ownsProgramHandle(false)
|
||||||
{
|
{
|
||||||
@@ -674,7 +674,7 @@ void Program::PerContextProgram::linkProgram(osg::State& state)
|
|||||||
_extensions->glGetProgramiv(_glProgramHandle, GL_ACTIVE_UNIFORM_BLOCKS,
|
_extensions->glGetProgramiv(_glProgramHandle, GL_ACTIVE_UNIFORM_BLOCKS,
|
||||||
reinterpret_cast<GLint*>(&activeUniformBlocks));
|
reinterpret_cast<GLint*>(&activeUniformBlocks));
|
||||||
_extensions->glGetProgramiv(_glProgramHandle,
|
_extensions->glGetProgramiv(_glProgramHandle,
|
||||||
GL_ACTIVE_UNIFORM_MAX_LENGTH,
|
GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH,
|
||||||
&maxBlockNameLen);
|
&maxBlockNameLen);
|
||||||
if (maxBlockNameLen > 0)
|
if (maxBlockNameLen > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -402,7 +402,7 @@ int Sequence::_getNextValue()
|
|||||||
int _sbegin = osg::minimum(_ubegin,_uend);
|
int _sbegin = osg::minimum(_ubegin,_uend);
|
||||||
int _send = osg::maximum(_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)
|
if (_sbegin==_send)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -134,25 +134,10 @@ State::~State()
|
|||||||
//_texCoordArrayList.clear();
|
//_texCoordArrayList.clear();
|
||||||
|
|
||||||
//_vertexAttribArrayList.clear();
|
//_vertexAttribArrayList.clear();
|
||||||
|
|
||||||
// OSG_NOTICE<<"State::~State()"<<this<<std::endl;
|
|
||||||
for(AppliedProgramObjectSet::iterator itr = _appliedProgramObjectSet.begin();
|
|
||||||
itr != _appliedProgramObjectSet.end();
|
|
||||||
++itr)
|
|
||||||
{
|
|
||||||
(*itr)->removeObserver(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void State::objectDeleted(void* object)
|
void State::objectDeleted(void* object)
|
||||||
{
|
{
|
||||||
const Program::PerContextProgram* ppcp = reinterpret_cast<const Program::PerContextProgram*>(object);
|
|
||||||
AppliedProgramObjectSet::iterator itr = _appliedProgramObjectSet.find(ppcp);
|
|
||||||
if (itr != _appliedProgramObjectSet.end())
|
|
||||||
{
|
|
||||||
// OSG_NOTICE<<"Removing _appliedProgramObjectSet entry "<<ppcp<<std::endl;
|
|
||||||
_appliedProgramObjectSet.erase(itr);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void State::reset()
|
void State::reset()
|
||||||
@@ -239,17 +224,6 @@ void State::reset()
|
|||||||
|
|
||||||
_lastAppliedProgramObject = 0;
|
_lastAppliedProgramObject = 0;
|
||||||
|
|
||||||
for(AppliedProgramObjectSet::iterator apitr=_appliedProgramObjectSet.begin();
|
|
||||||
apitr!=_appliedProgramObjectSet.end();
|
|
||||||
++apitr)
|
|
||||||
{
|
|
||||||
(*apitr)->resetAppliedUniforms();
|
|
||||||
(*apitr)->removeObserver(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
_appliedProgramObjectSet.clear();
|
|
||||||
|
|
||||||
|
|
||||||
// what about uniforms??? need to clear them too...
|
// what about uniforms??? need to clear them too...
|
||||||
// go through all active Unfirom's, setting to change to force update,
|
// go through all active Unfirom's, setting to change to force update,
|
||||||
// the idea is to leave only the global defaults left.
|
// the idea is to leave only the global defaults left.
|
||||||
@@ -484,12 +458,18 @@ void State::apply(const StateSet* dstate)
|
|||||||
else if (unit<_textureAttributeMapList.size()) applyAttributeMapOnTexUnit(unit,_textureAttributeMapList[unit]);
|
else if (unit<_textureAttributeMapList.size()) applyAttributeMapOnTexUnit(unit,_textureAttributeMapList[unit]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const Program::PerContextProgram* previousLastAppliedProgramObject = _lastAppliedProgramObject;
|
||||||
|
|
||||||
applyModeList(_modeMap,dstate->getModeList());
|
applyModeList(_modeMap,dstate->getModeList());
|
||||||
applyAttributeList(_attributeMap,dstate->getAttributeList());
|
applyAttributeList(_attributeMap,dstate->getAttributeList());
|
||||||
|
|
||||||
if (_shaderCompositionEnabled)
|
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())
|
if (dstate->getUniformList().empty())
|
||||||
@@ -911,7 +891,10 @@ void State::initializeExtensionProcs()
|
|||||||
if ( osg::getGLVersionNumber() >= 2.0 || osg::isGLExtensionSupported(_contextID,"GL_ARB_vertex_shader") || OSG_GLES2_FEATURES)
|
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_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 ||
|
else if ( osg::getGLVersionNumber() >= 1.3 ||
|
||||||
osg::isGLExtensionSupported(_contextID,"GL_ARB_multitexture") ||
|
osg::isGLExtensionSupported(_contextID,"GL_ARB_multitexture") ||
|
||||||
@@ -1322,6 +1305,9 @@ namespace State_Utils
|
|||||||
{
|
{
|
||||||
bool replace(std::string& str, const std::string& original_phrase, const std::string& new_phrase)
|
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;
|
bool replacedStr = false;
|
||||||
std::string::size_type pos = 0;
|
std::string::size_type pos = 0;
|
||||||
while((pos=str.find(original_phrase, pos))!=std::string::npos)
|
while((pos=str.find(original_phrase, pos))!=std::string::npos)
|
||||||
@@ -1360,9 +1346,6 @@ bool State::convertVertexShaderSourceToOsgBuiltIns(std::string& source) const
|
|||||||
|
|
||||||
OSG_INFO<<"++Before Converted source "<<std::endl<<source<<std::endl<<"++++++++"<<std::endl;
|
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
|
// 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.
|
// precede a "#verson" compiler directive, so we must insert new declarations after it.
|
||||||
std::string::size_type declPos = source.rfind( "#version " );
|
std::string::size_type declPos = source.rfind( "#version " );
|
||||||
@@ -1377,22 +1360,31 @@ bool State::convertVertexShaderSourceToOsgBuiltIns(std::string& source) const
|
|||||||
declPos = 0;
|
declPos = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
State_Utils::replaceAndInsertDeclaration(source, declPos, _vertexAlias._glName, _vertexAlias._osgName, _vertexAlias._declaration);
|
if (_useModelViewAndProjectionUniforms)
|
||||||
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];
|
// replace ftransform as it only works with built-ins
|
||||||
State_Utils::replaceAndInsertDeclaration(source, declPos, texCoordAlias._glName, texCoordAlias._osgName, texCoordAlias._declaration);
|
State_Utils::replace(source, "ftransform()", "gl_ModelViewProjectionMatrix * gl_Vertex");
|
||||||
|
|
||||||
|
// replace built in uniform
|
||||||
|
State_Utils::replaceAndInsertDeclaration(source, declPos, "gl_ModelViewMatrix", "osg_ModelViewMatrix", "uniform mat4 ");
|
||||||
|
State_Utils::replaceAndInsertDeclaration(source, declPos, "gl_ModelViewProjectionMatrix", "osg_ModelViewProjectionMatrix", "uniform mat4 ");
|
||||||
|
State_Utils::replaceAndInsertDeclaration(source, declPos, "gl_ProjectionMatrix", "osg_ProjectionMatrix", "uniform mat4 ");
|
||||||
|
State_Utils::replaceAndInsertDeclaration(source, declPos, "gl_NormalMatrix", "osg_NormalMatrix", "uniform mat3 ");
|
||||||
}
|
}
|
||||||
|
|
||||||
// replace built in uniform
|
if (_useVertexAttributeAliasing)
|
||||||
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, _vertexAlias._glName, _vertexAlias._osgName, _vertexAlias._declaration);
|
||||||
State_Utils::replaceAndInsertDeclaration(source, declPos, "gl_ProjectionMatrix", "osg_ProjectionMatrix", "uniform mat4 ");
|
State_Utils::replaceAndInsertDeclaration(source, declPos, _normalAlias._glName, _normalAlias._osgName, _normalAlias._declaration);
|
||||||
State_Utils::replaceAndInsertDeclaration(source, declPos, "gl_NormalMatrix", "osg_NormalMatrix", "uniform mat3 ");
|
State_Utils::replaceAndInsertDeclaration(source, declPos, _colorAlias._glName, _colorAlias._osgName, _colorAlias._declaration);
|
||||||
|
State_Utils::replaceAndInsertDeclaration(source, declPos, _secondaryColorAlias._glName, _secondaryColorAlias._osgName, _secondaryColorAlias._declaration);
|
||||||
|
State_Utils::replaceAndInsertDeclaration(source, declPos, _fogCoordAlias._glName, _fogCoordAlias._osgName, _fogCoordAlias._declaration);
|
||||||
|
for (size_t i=0; i<_texCoordAliasList.size(); i++)
|
||||||
|
{
|
||||||
|
const VertexAttribAlias& texCoordAlias = _texCoordAliasList[i];
|
||||||
|
State_Utils::replaceAndInsertDeclaration(source, declPos, texCoordAlias._glName, texCoordAlias._osgName, texCoordAlias._declaration);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
OSG_INFO<<"-------- Converted source "<<std::endl<<source<<std::endl<<"----------------"<<std::endl;
|
OSG_INFO<<"-------- Converted source "<<std::endl<<source<<std::endl<<"----------------"<<std::endl;
|
||||||
|
|
||||||
@@ -1698,15 +1690,6 @@ void State::print(std::ostream& fout) const
|
|||||||
}
|
}
|
||||||
fout<<"}"<<std::endl;
|
fout<<"}"<<std::endl;
|
||||||
|
|
||||||
#if 0
|
|
||||||
TextureModeMapList _textureModeMapList;
|
|
||||||
TextureAttributeMapList _textureAttributeMapList;
|
|
||||||
|
|
||||||
AppliedProgramObjectSet _appliedProgramObjectSet;
|
|
||||||
const Program::PerContextProgram* _lastAppliedProgramObject;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
fout<<"StateSetStack _stateSetStack {"<<std::endl;
|
fout<<"StateSetStack _stateSetStack {"<<std::endl;
|
||||||
for(StateSetStack::const_iterator itr = _stateStateStack.begin();
|
for(StateSetStack::const_iterator itr = _stateStateStack.begin();
|
||||||
itr != _stateStateStack.end();
|
itr != _stateStateStack.end();
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ class TextureGLModeSet
|
|||||||
_textureModeSet.insert(GL_TEXTURE_CUBE_MAP);
|
_textureModeSet.insert(GL_TEXTURE_CUBE_MAP);
|
||||||
_textureModeSet.insert(GL_TEXTURE_RECTANGLE_NV);
|
_textureModeSet.insert(GL_TEXTURE_RECTANGLE_NV);
|
||||||
_textureModeSet.insert(GL_TEXTURE_2D_ARRAY_EXT);
|
_textureModeSet.insert(GL_TEXTURE_2D_ARRAY_EXT);
|
||||||
|
_textureModeSet.insert(GL_TEXTURE_2D_MULTISAMPLE);
|
||||||
|
|
||||||
_textureModeSet.insert(GL_TEXTURE_GEN_Q);
|
_textureModeSet.insert(GL_TEXTURE_GEN_Q);
|
||||||
_textureModeSet.insert(GL_TEXTURE_GEN_R);
|
_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 (_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)
|
for(unsigned int ai=0;ai<_textureAttributeList.size();++ai)
|
||||||
{
|
{
|
||||||
const AttributeList& rhs_attributeList = _textureAttributeList[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...
|
// 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.
|
// check to see how the modes compare.
|
||||||
// first check the rest of the texture modes
|
// first check the rest of the texture modes
|
||||||
for(unsigned int ti=0;ti<_textureModeList.size();++ti)
|
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;
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2351,7 +2351,7 @@ bool Texture::isHardwareMipmapGenerationEnabled(const State& state) const
|
|||||||
|
|
||||||
const FBOExtensions* fbo_ext = FBOExtensions::instance(contextID,true);
|
const FBOExtensions* fbo_ext = FBOExtensions::instance(contextID,true);
|
||||||
|
|
||||||
if (fbo_ext->glGenerateMipmap)
|
if (fbo_ext->isSupported() && fbo_ext->glGenerateMipmap)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -2368,7 +2368,8 @@ Texture::GenerateMipmapMode Texture::mipmapBeforeTexImage(const State& state, bo
|
|||||||
return GENERATE_MIPMAP;
|
return GENERATE_MIPMAP;
|
||||||
#else
|
#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)
|
if (useGenerateMipMap)
|
||||||
{
|
{
|
||||||
@@ -2440,7 +2441,7 @@ void Texture::generateMipmap(State& state) const
|
|||||||
osg::FBOExtensions* fbo_ext = osg::FBOExtensions::instance(state.getContextID(), true);
|
osg::FBOExtensions* fbo_ext = osg::FBOExtensions::instance(state.getContextID(), true);
|
||||||
|
|
||||||
// check if the function is supported
|
// check if the function is supported
|
||||||
if (fbo_ext->glGenerateMipmap)
|
if (fbo_ext->isSupported() && fbo_ext->glGenerateMipmap)
|
||||||
{
|
{
|
||||||
textureObject->bind();
|
textureObject->bind();
|
||||||
fbo_ext->glGenerateMipmap(textureObject->target());
|
fbo_ext->glGenerateMipmap(textureObject->target());
|
||||||
|
|||||||
@@ -32,15 +32,16 @@ Texture2DArray::Texture2DArray(const Texture2DArray& text,const CopyOp& copyop):
|
|||||||
Texture(text,copyop),
|
Texture(text,copyop),
|
||||||
_textureWidth(text._textureWidth),
|
_textureWidth(text._textureWidth),
|
||||||
_textureHeight(text._textureHeight),
|
_textureHeight(text._textureHeight),
|
||||||
_textureDepth(text._textureDepth),
|
_textureDepth(0),
|
||||||
_numMipmapLevels(text._numMipmapLevels),
|
_numMipmapLevels(text._numMipmapLevels),
|
||||||
_subloadCallback(text._subloadCallback)
|
_subloadCallback(text._subloadCallback)
|
||||||
{
|
{
|
||||||
|
setTextureDepth(text._textureDepth);
|
||||||
|
|
||||||
// copy all images by iterating through all of them
|
// copy all images by iterating through all of them
|
||||||
for (int i=0; i < text._textureDepth; i++)
|
for (int i=0; i < text._textureDepth; i++)
|
||||||
{
|
{
|
||||||
setImage(i, copyop(text._images[i].get()));
|
setImage(i, copyop(text._images[i].get()));
|
||||||
_modifiedCount.push_back(ImageModifiedCount());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -249,7 +250,7 @@ void Texture2DArray::apply(State& state) const
|
|||||||
// compute the dimensions of the texture.
|
// compute the dimensions of the texture.
|
||||||
computeRequiredTextureDimensions(state, *image, new_width, new_height, new_numMipmapLevels);
|
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());
|
Texture::releaseTextureObject(contextID, _textureObjectBuffer[contextID].get());
|
||||||
_textureObjectBuffer[contextID] = 0;
|
_textureObjectBuffer[contextID] = 0;
|
||||||
|
|||||||
@@ -48,14 +48,15 @@ TransferFunction1D::TransferFunction1D(const TransferFunction1D& tf, const CopyO
|
|||||||
TransferFunction(tf,copyop)
|
TransferFunction(tf,copyop)
|
||||||
{
|
{
|
||||||
allocate(tf.getNumberImageCells());
|
allocate(tf.getNumberImageCells());
|
||||||
assign(_colorMap);
|
assign(tf._colorMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TransferFunction1D::allocate(unsigned int numX)
|
void TransferFunction1D::allocate(unsigned int numX)
|
||||||
{
|
{
|
||||||
_image = new osg::Image;
|
_image = new osg::Image;
|
||||||
_image->allocateImage(numX,1,1,GL_RGBA, GL_FLOAT);
|
_image->allocateImage(numX,1,1,GL_RGBA, GL_FLOAT);
|
||||||
if (!_colorMap.empty()) assign(_colorMap);
|
|
||||||
|
updateImage();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TransferFunction1D::clear(const osg::Vec4& color)
|
void TransferFunction1D::clear(const osg::Vec4& color)
|
||||||
@@ -177,7 +178,7 @@ osg::Vec4 TransferFunction1D::getColor(float v) const
|
|||||||
|
|
||||||
void TransferFunction1D::assign(const ColorMap& newColours)
|
void TransferFunction1D::assign(const ColorMap& newColours)
|
||||||
{
|
{
|
||||||
_colorMap = newColours;
|
if (&_colorMap != &newColours) _colorMap = newColours;
|
||||||
|
|
||||||
updateImage();
|
updateImage();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2153,7 +2153,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix2& m2 ) const
|
|||||||
{
|
{
|
||||||
if( index>=getNumElements() || !isCompatibleType(FLOAT_MAT2) ) return false;
|
if( index>=getNumElements() || !isCompatibleType(FLOAT_MAT2) ) return false;
|
||||||
unsigned int j = index * getTypeNumComponents(getType());
|
unsigned int j = index * getTypeNumComponents(getType());
|
||||||
m2.base_class::set( &((*_floatArray)[j]) );
|
m2.Matrix2::base_class::set( &((*_floatArray)[j]) );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2161,7 +2161,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix3& m3 ) const
|
|||||||
{
|
{
|
||||||
if( index>=getNumElements() || !isCompatibleType(FLOAT_MAT3) ) return false;
|
if( index>=getNumElements() || !isCompatibleType(FLOAT_MAT3) ) return false;
|
||||||
unsigned int j = index * getTypeNumComponents(getType());
|
unsigned int j = index * getTypeNumComponents(getType());
|
||||||
m3.base_class::set( &((*_floatArray)[j]) );
|
m3.Matrix3::base_class::set( &((*_floatArray)[j]) );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2177,7 +2177,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix2x3& m2x3 ) const
|
|||||||
{
|
{
|
||||||
if( index>=getNumElements() || !isCompatibleType(FLOAT_MAT2x3) ) return false;
|
if( index>=getNumElements() || !isCompatibleType(FLOAT_MAT2x3) ) return false;
|
||||||
unsigned int j = index * getTypeNumComponents(getType());
|
unsigned int j = index * getTypeNumComponents(getType());
|
||||||
m2x3.base_class::set( &((*_floatArray)[j]) );
|
m2x3.Matrix2x3::base_class::set( &((*_floatArray)[j]) );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2185,7 +2185,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix2x4& m2x4 ) const
|
|||||||
{
|
{
|
||||||
if( index>=getNumElements() || !isCompatibleType(FLOAT_MAT2x4) ) return false;
|
if( index>=getNumElements() || !isCompatibleType(FLOAT_MAT2x4) ) return false;
|
||||||
unsigned int j = index * getTypeNumComponents(getType());
|
unsigned int j = index * getTypeNumComponents(getType());
|
||||||
m2x4.base_class::set( &((*_floatArray)[j]) );
|
m2x4.Matrix2x4::base_class::set( &((*_floatArray)[j]) );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2193,7 +2193,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix3x2& m3x2 ) const
|
|||||||
{
|
{
|
||||||
if( index>=getNumElements() || !isCompatibleType(FLOAT_MAT3x2) ) return false;
|
if( index>=getNumElements() || !isCompatibleType(FLOAT_MAT3x2) ) return false;
|
||||||
unsigned int j = index * getTypeNumComponents(getType());
|
unsigned int j = index * getTypeNumComponents(getType());
|
||||||
m3x2.base_class::set( &((*_floatArray)[j]) );
|
m3x2.Matrix3x2::base_class::set( &((*_floatArray)[j]) );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2201,7 +2201,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix3x4& m3x4 ) const
|
|||||||
{
|
{
|
||||||
if( index>=getNumElements() || !isCompatibleType(FLOAT_MAT3x4) ) return false;
|
if( index>=getNumElements() || !isCompatibleType(FLOAT_MAT3x4) ) return false;
|
||||||
unsigned int j = index * getTypeNumComponents(getType());
|
unsigned int j = index * getTypeNumComponents(getType());
|
||||||
m3x4.base_class::set( &((*_floatArray)[j]) );
|
m3x4.Matrix3x4::base_class::set( &((*_floatArray)[j]) );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2209,7 +2209,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix4x2& m4x2 ) const
|
|||||||
{
|
{
|
||||||
if( index>=getNumElements() || !isCompatibleType(FLOAT_MAT4x2) ) return false;
|
if( index>=getNumElements() || !isCompatibleType(FLOAT_MAT4x2) ) return false;
|
||||||
unsigned int j = index * getTypeNumComponents(getType());
|
unsigned int j = index * getTypeNumComponents(getType());
|
||||||
m4x2.base_class::set( &((*_floatArray)[j]) );
|
m4x2.Matrix4x2::base_class::set( &((*_floatArray)[j]) );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2217,7 +2217,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix4x3& m4x3 ) const
|
|||||||
{
|
{
|
||||||
if( index>=getNumElements() || !isCompatibleType(FLOAT_MAT4x3) ) return false;
|
if( index>=getNumElements() || !isCompatibleType(FLOAT_MAT4x3) ) return false;
|
||||||
unsigned int j = index * getTypeNumComponents(getType());
|
unsigned int j = index * getTypeNumComponents(getType());
|
||||||
m4x3.base_class::set( &((*_floatArray)[j]) );
|
m4x3.Matrix4x3::base_class::set( &((*_floatArray)[j]) );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2263,7 +2263,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix2d& m2 ) const
|
|||||||
{
|
{
|
||||||
if( index>=getNumElements() || !isCompatibleType(DOUBLE_MAT2) ) return false;
|
if( index>=getNumElements() || !isCompatibleType(DOUBLE_MAT2) ) return false;
|
||||||
unsigned int j = index * getTypeNumComponents(getType());
|
unsigned int j = index * getTypeNumComponents(getType());
|
||||||
m2.base_class::set( &((*_doubleArray)[j]) );
|
m2.Matrix2d::base_class::set( &((*_doubleArray)[j]) );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2271,7 +2271,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix3d& m3 ) const
|
|||||||
{
|
{
|
||||||
if( index>=getNumElements() || !isCompatibleType(DOUBLE_MAT3) ) return false;
|
if( index>=getNumElements() || !isCompatibleType(DOUBLE_MAT3) ) return false;
|
||||||
unsigned int j = index * getTypeNumComponents(getType());
|
unsigned int j = index * getTypeNumComponents(getType());
|
||||||
m3.base_class::set( &((*_doubleArray)[j]) );
|
m3.Matrix3d::base_class::set( &((*_doubleArray)[j]) );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2291,7 +2291,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix2x3d& m2x3 ) const
|
|||||||
{
|
{
|
||||||
if( index>=getNumElements() || !isCompatibleType(DOUBLE_MAT2x3) ) return false;
|
if( index>=getNumElements() || !isCompatibleType(DOUBLE_MAT2x3) ) return false;
|
||||||
unsigned int j = index * getTypeNumComponents(getType());
|
unsigned int j = index * getTypeNumComponents(getType());
|
||||||
m2x3.base_class::set( &((*_doubleArray)[j]) );
|
m2x3.Matrix2x3d::base_class::set( &((*_doubleArray)[j]) );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2299,7 +2299,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix2x4d& m2x4 ) const
|
|||||||
{
|
{
|
||||||
if( index>=getNumElements() || !isCompatibleType(DOUBLE_MAT2x4) ) return false;
|
if( index>=getNumElements() || !isCompatibleType(DOUBLE_MAT2x4) ) return false;
|
||||||
unsigned int j = index * getTypeNumComponents(getType());
|
unsigned int j = index * getTypeNumComponents(getType());
|
||||||
m2x4.base_class::set( &((*_doubleArray)[j]) );
|
m2x4.Matrix2x4d::base_class::set( &((*_doubleArray)[j]) );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2307,7 +2307,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix3x2d& m3x2 ) const
|
|||||||
{
|
{
|
||||||
if( index>=getNumElements() || !isCompatibleType(DOUBLE_MAT3x2) ) return false;
|
if( index>=getNumElements() || !isCompatibleType(DOUBLE_MAT3x2) ) return false;
|
||||||
unsigned int j = index * getTypeNumComponents(getType());
|
unsigned int j = index * getTypeNumComponents(getType());
|
||||||
m3x2.base_class::set( &((*_doubleArray)[j]) );
|
m3x2.Matrix3x2d::base_class::set( &((*_doubleArray)[j]) );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2315,7 +2315,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix3x4d& m3x4 ) const
|
|||||||
{
|
{
|
||||||
if( index>=getNumElements() || !isCompatibleType(DOUBLE_MAT3x4) ) return false;
|
if( index>=getNumElements() || !isCompatibleType(DOUBLE_MAT3x4) ) return false;
|
||||||
unsigned int j = index * getTypeNumComponents(getType());
|
unsigned int j = index * getTypeNumComponents(getType());
|
||||||
m3x4.base_class::set( &((*_doubleArray)[j]) );
|
m3x4.Matrix3x4d::base_class::set( &((*_doubleArray)[j]) );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2323,7 +2323,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix4x2d& m4x2 ) const
|
|||||||
{
|
{
|
||||||
if( index>=getNumElements() || !isCompatibleType(DOUBLE_MAT4x2) ) return false;
|
if( index>=getNumElements() || !isCompatibleType(DOUBLE_MAT4x2) ) return false;
|
||||||
unsigned int j = index * getTypeNumComponents(getType());
|
unsigned int j = index * getTypeNumComponents(getType());
|
||||||
m4x2.base_class::set( &((*_doubleArray)[j]) );
|
m4x2.Matrix4x2d::base_class::set( &((*_doubleArray)[j]) );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2331,7 +2331,7 @@ bool Uniform::getElement( unsigned int index, osg::Matrix4x3d& m4x3 ) const
|
|||||||
{
|
{
|
||||||
if( index>=getNumElements() || !isCompatibleType(DOUBLE_MAT4x3) ) return false;
|
if( index>=getNumElements() || !isCompatibleType(DOUBLE_MAT4x3) ) return false;
|
||||||
unsigned int j = index * getTypeNumComponents(getType());
|
unsigned int j = index * getTypeNumComponents(getType());
|
||||||
m4x3.base_class::set( &((*_doubleArray)[j]) );
|
m4x3.Matrix4x3d::base_class::set( &((*_doubleArray)[j]) );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -908,10 +908,11 @@ static void halveImage_uint(GLint components, GLuint width, GLuint height,
|
|||||||
for (j = 0; j < newwidth; j++) {
|
for (j = 0; j < newwidth; j++) {
|
||||||
for (k = 0; k < components; k++) {
|
for (k = 0; k < components; k++) {
|
||||||
/* need to cast to double to hold large unsigned ints */
|
/* need to cast to double to hold large unsigned ints */
|
||||||
s[0] = ((double)*(const GLuint*)t +
|
GLdouble buf = (double)*(const GLuint*)t +
|
||||||
(double)*(const GLuint*)(t+group_size) +
|
(double)*(const GLuint*)(t+group_size) +
|
||||||
(double)*(const GLuint*)(t+ysize) +
|
(double)*(const GLuint*)(t+ysize) +
|
||||||
(double)*(const GLuint*)(t+ysize+group_size))/4 + 0.5;
|
(double)*(const GLuint*)(t+ysize+group_size);
|
||||||
|
s[0] = (GLuint)(buf/4.0 + 0.5);
|
||||||
s++; t += element_size;
|
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 (j = 0; j < newwidth; j++) {
|
||||||
for (k = 0; k < components; k++) {
|
for (k = 0; k < components; k++) {
|
||||||
/* need to cast to double to hold large unsigned ints */
|
/* need to cast to double to hold large unsigned ints */
|
||||||
GLdouble buf;
|
GLdouble buf = (GLdouble)__GLU_SWAP_4_BYTES(t) +
|
||||||
buf = (GLdouble)__GLU_SWAP_4_BYTES(t) +
|
(GLdouble)__GLU_SWAP_4_BYTES(t+group_size) +
|
||||||
(GLdouble)__GLU_SWAP_4_BYTES(t+group_size) +
|
(GLdouble)__GLU_SWAP_4_BYTES(t+ysize) +
|
||||||
(GLdouble)__GLU_SWAP_4_BYTES(t+ysize) +
|
(GLdouble)__GLU_SWAP_4_BYTES(t+ysize+group_size);
|
||||||
(GLdouble)__GLU_SWAP_4_BYTES(t+ysize+group_size);
|
s[0] = (GLuint)(buf/4.0 + 0.5);
|
||||||
s[0] = (GLuint)(buf/4 + 0.5);
|
|
||||||
|
|
||||||
s++; t += element_size;
|
s++; t += element_size;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,7 +107,13 @@ bool Animation::update (double time, int priority)
|
|||||||
{
|
{
|
||||||
case ONCE:
|
case ONCE:
|
||||||
if (t > _originalDuration)
|
if (t > _originalDuration)
|
||||||
|
{
|
||||||
|
for (ChannelList::const_iterator chan = _channels.begin();
|
||||||
|
chan != _channels.end(); ++chan)
|
||||||
|
(*chan)->update(_originalDuration, _weight, priority);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case STAY:
|
case STAY:
|
||||||
if (t > _originalDuration)
|
if (t > _originalDuration)
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ void LinkVisitor::link(AnimationUpdateCallbackBase* cb)
|
|||||||
result += cb->link(_animations[i].get());
|
result += cb->link(_animations[i].get());
|
||||||
_nbLinkedTarget += result;
|
_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)
|
void LinkVisitor::handle_stateset(osg::StateSet* stateset)
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ void RigGeometry::buildVertexInfluenceSet()
|
|||||||
|
|
||||||
_vertexInfluenceSet.buildVertex2BoneList();
|
_vertexInfluenceSet.buildVertex2BoneList();
|
||||||
_vertexInfluenceSet.buildUniqVertexSetToBoneSetList();
|
_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()
|
void RigGeometry::computeMatrixFromRootSkeleton()
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ RigTransformHardware::BoneWeightAttribList RigTransformHardware::createVertexAtt
|
|||||||
arrayList.resize(nbArray);
|
arrayList.resize(nbArray);
|
||||||
for (int i = 0; i < nbArray; i++)
|
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;
|
arrayList[i] = array;
|
||||||
int nbVertexes = getNumVertexes();
|
int nbVertexes = getNumVertexes();
|
||||||
array->resize(nbVertexes);
|
array->resize(nbVertexes);
|
||||||
|
|||||||
@@ -18,8 +18,7 @@ using namespace osgAnimation;
|
|||||||
|
|
||||||
StackedTransform::StackedTransform() {}
|
StackedTransform::StackedTransform() {}
|
||||||
|
|
||||||
StackedTransform::StackedTransform(const StackedTransform& rhs, const osg::CopyOp& co):
|
StackedTransform::StackedTransform(const StackedTransform& rhs, const osg::CopyOp& co)
|
||||||
osg::MixinVector<osg::ref_ptr<StackedTransformElement> >(rhs)
|
|
||||||
{
|
{
|
||||||
reserve(rhs.size());
|
reserve(rhs.size());
|
||||||
for (StackedTransform::const_iterator it = rhs.begin(); it != rhs.end(); ++it)
|
for (StackedTransform::const_iterator it = rhs.begin(); it != rhs.end(); ++it)
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ IF (DYNAMIC_OPENSCENEGRAPH)
|
|||||||
|
|
||||||
IF(OSG_PLUGIN_SEARCH_INSTALL_DIR_FOR_PLUGINS)
|
IF(OSG_PLUGIN_SEARCH_INSTALL_DIR_FOR_PLUGINS)
|
||||||
# Add a default plugin search path component
|
# Add a default plugin search path component
|
||||||
ADD_DEFINITIONS(-DOSG_DEFAULT_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib${LIB_POSTFIX}/${OSG_PLUGINS})
|
ADD_DEFINITIONS(-DOSG_DEFAULT_LIBRARY_PATH=\"${CMAKE_INSTALL_PREFIX}/lib${LIB_POSTFIX}/${OSG_PLUGINS}\")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
# Set the library extension according to what configuration is being built.
|
# Set the library extension according to what configuration is being built.
|
||||||
@@ -124,7 +124,7 @@ SET(TARGET_SRC
|
|||||||
IF(APPLE AND NOT ANDROID)
|
IF(APPLE AND NOT ANDROID)
|
||||||
IF(NOT OSG_BUILD_PLATFORM_IPHONE AND NOT OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
|
IF(NOT OSG_BUILD_PLATFORM_IPHONE AND NOT OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
|
||||||
# Needs CoreFoundation calls and a Carbon function
|
# Needs CoreFoundation calls and a Carbon function
|
||||||
SET(OSGDB_PLATFORM_SPECIFIC_LIBRARIES ${CARBON_LIBRARY})
|
SET(OSGDB_PLATFORM_SPECIFIC_LIBRARIES ${CARBON_LIBRARY} ${COCOA_LIBRARY})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX STREQUAL "quicktime")
|
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 )
|
if( mkdir( dir.c_str(), 0755 )< 0 )
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
OSG_DEBUG << "osgDB::makeDirectory(): " << strerror(errno) << std::endl;
|
// Only return an error if the directory actually doesn't exist. It's possible that the directory was created
|
||||||
return false;
|
// by another thread or process
|
||||||
|
if (!osgDB::fileExists(dir))
|
||||||
|
{
|
||||||
|
OSG_DEBUG << "osgDB::makeDirectory(): " << strerror(errno) << std::endl;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
paths.pop();
|
paths.pop();
|
||||||
}
|
}
|
||||||
@@ -500,7 +505,7 @@ static void appendInstallationLibraryFilePaths(osgDB::FilePathList& filepath)
|
|||||||
#ifdef OSG_DEFAULT_LIBRARY_PATH
|
#ifdef OSG_DEFAULT_LIBRARY_PATH
|
||||||
|
|
||||||
// Append the install prefix path to the library search path if configured
|
// Append the install prefix path to the library search path if configured
|
||||||
filepath.push_back(ADDQUOTES(OSG_DEFAULT_LIBRARY_PATH));
|
filepath.push_back(OSG_DEFAULT_LIBRARY_PATH);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -639,7 +639,7 @@ osg::Image* InputStream::readImage(bool readFromExternal)
|
|||||||
image = new osg::Image;
|
image = new osg::Image;
|
||||||
image->setOrigin( (osg::Image::Origin)origin );
|
image->setOrigin( (osg::Image::Origin)origin );
|
||||||
image->setImage( s, t, r, internalFormat, pixelFormat, dataType,
|
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
|
// _mipmapData
|
||||||
|
|||||||
@@ -379,6 +379,9 @@ ObjectWrapperManager::ObjectWrapperManager()
|
|||||||
glTable.add( "GL_LIGHT6", GL_LIGHT6 );
|
glTable.add( "GL_LIGHT6", GL_LIGHT6 );
|
||||||
glTable.add( "GL_LIGHT7", GL_LIGHT7 );
|
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
|
// Functions
|
||||||
glTable.add( "NEVER", GL_NEVER );
|
glTable.add( "NEVER", GL_NEVER );
|
||||||
glTable.add( "LESS", GL_LESS );
|
glTable.add( "LESS", GL_LESS );
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
#include <osgDB/ObjectWrapper>
|
#include <osgDB/ObjectWrapper>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
using namespace osgDB;
|
using namespace osgDB;
|
||||||
|
|
||||||
|
|||||||
@@ -414,7 +414,7 @@ Registry::Registry()
|
|||||||
addFileExtensionAlias("cid", "freetype"); // Postscript CID-Fonts
|
addFileExtensionAlias("cid", "freetype"); // Postscript CID-Fonts
|
||||||
addFileExtensionAlias("cff", "freetype"); // OpenType
|
addFileExtensionAlias("cff", "freetype"); // OpenType
|
||||||
addFileExtensionAlias("cef", "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("fnt", "freetype"); // Windows bitmap fonts
|
||||||
addFileExtensionAlias("text3d", "freetype"); // use 3D Font instead of 2D Font
|
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))
|
if(fileExists(simpleFileName))
|
||||||
{
|
{
|
||||||
OSG_DEBUG << "FindFileInPath(" << filename << "): returning " << filename << std::endl;
|
OSG_DEBUG << "FindFileInPath(" << filename << "): returning " << simpleFileName << std::endl;
|
||||||
return simpleFileName;
|
return simpleFileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1249,9 +1249,21 @@ ReaderWriter::ReadResult Registry::readImplementation(const ReadFunctor& readFun
|
|||||||
ReaderWriter::ReadResult rr = read(readFunctor);
|
ReaderWriter::ReadResult rr = read(readFunctor);
|
||||||
if (rr.validObject())
|
if (rr.validObject())
|
||||||
{
|
{
|
||||||
// update cache with new entry.
|
// search AGAIN for entry in the object cache.
|
||||||
OSG_INFO<<"Adding to object cache "<<file<<std::endl;
|
{
|
||||||
addEntryToObjectCache(file,rr.getObject());
|
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
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -49,10 +49,12 @@ std::string osgDB::trimEnclosingSpaces(const std::string& str)
|
|||||||
{
|
{
|
||||||
if (str.empty()) return 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();
|
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();
|
if (end==std::string::npos) return std::string();
|
||||||
|
|
||||||
return std::string(str, start, (end-start)+1);
|
return std::string(str, start, (end-start)+1);
|
||||||
|
|||||||
@@ -275,7 +275,7 @@ bool NodeTrackerManipulator::performMovementLeftMouseButton( const double eventT
|
|||||||
} else
|
} else
|
||||||
rotateTrackball( _ga_t0->getXnormalized(), _ga_t0->getYnormalized(),
|
rotateTrackball( _ga_t0->getXnormalized(), _ga_t0->getYnormalized(),
|
||||||
_ga_t1->getXnormalized(), _ga_t1->getYnormalized(),
|
_ga_t1->getXnormalized(), _ga_t1->getYnormalized(),
|
||||||
_thrown ? float( _delta_frame_time / eventTimeDelta ) : 1.f );
|
getThrowScale( eventTimeDelta ) );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -379,12 +379,12 @@ void OrbitManipulator::OrbitAnimationData::start( const osg::Vec3d& movement, co
|
|||||||
Scale parameter is useful, for example, when manipulator is thrown.
|
Scale parameter is useful, for example, when manipulator is thrown.
|
||||||
It scales the amount of rotation based, for example, on the current frame time.*/
|
It scales the amount of rotation based, for example, on the current frame time.*/
|
||||||
void OrbitManipulator::rotateTrackball( const float px0, const float py0,
|
void OrbitManipulator::rotateTrackball( const float px0, const float py0,
|
||||||
const float px1, const float py1, const float /*scale*/ )
|
const float px1, const float py1, const float scale )
|
||||||
{
|
{
|
||||||
osg::Vec3d axis;
|
osg::Vec3d axis;
|
||||||
float angle;
|
float angle;
|
||||||
|
|
||||||
trackball( axis, angle, px1, py1, px0, py0 );
|
trackball( axis, angle, px0 + (px1-px0)*scale, py0 + (py1-py0)*scale, px0, py0 );
|
||||||
|
|
||||||
Quat new_rotate;
|
Quat new_rotate;
|
||||||
new_rotate.makeRotate( angle, axis );
|
new_rotate.makeRotate( angle, axis );
|
||||||
|
|||||||
@@ -154,6 +154,8 @@ bool StandardManipulator::isAnimating() const
|
|||||||
/// Finishes the animation by performing a step that moves it to its final position.
|
/// Finishes the animation by performing a step that moves it to its final position.
|
||||||
void StandardManipulator::finishAnimation()
|
void StandardManipulator::finishAnimation()
|
||||||
{
|
{
|
||||||
|
_thrown = false;
|
||||||
|
|
||||||
if( !isAnimating() )
|
if( !isAnimating() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -586,7 +588,12 @@ void StandardManipulator::setAllowThrow( bool allowThrow )
|
|||||||
events that started the animation.*/
|
events that started the animation.*/
|
||||||
float StandardManipulator::getThrowScale( const double eventTimeDelta ) const
|
float StandardManipulator::getThrowScale( const double eventTimeDelta ) const
|
||||||
{
|
{
|
||||||
if( _thrown ) return float( _delta_frame_time / eventTimeDelta );
|
if( _thrown )
|
||||||
|
{
|
||||||
|
if (eventTimeDelta == 0.f)
|
||||||
|
return 0.f;
|
||||||
|
return float( _delta_frame_time / eventTimeDelta );
|
||||||
|
}
|
||||||
else return 1.f;
|
else return 1.f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user