Compare commits
60 Commits
OpenSceneG
...
OpenSceneG
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b50d199ded | ||
|
|
806993f3e0 | ||
|
|
8f4c026a85 | ||
|
|
373687b72f | ||
|
|
73026ea973 | ||
|
|
55ff7019a1 | ||
|
|
efa37bd4c4 | ||
|
|
b4a32f6cab | ||
|
|
9ffd6d1dc0 | ||
|
|
701c976495 | ||
|
|
3f7406e903 | ||
|
|
0079c132a7 | ||
|
|
3254630625 | ||
|
|
125fa6d05d | ||
|
|
a92241d40d | ||
|
|
8ea9d68c9c | ||
|
|
1e94ed9fa8 | ||
|
|
cd7dc0f161 | ||
|
|
6779944c0e | ||
|
|
d5f476a822 | ||
|
|
b361047aa0 | ||
|
|
bd2ad48c00 | ||
|
|
e306f27e23 | ||
|
|
26ee7e07d3 | ||
|
|
3660e3a3c3 | ||
|
|
cb627520a7 | ||
|
|
c5867e4957 | ||
|
|
8f20178748 | ||
|
|
c93ef23d2f | ||
|
|
69659ade08 | ||
|
|
d4e68e5d73 | ||
|
|
b29bf3fe06 | ||
|
|
8f23b42ed2 | ||
|
|
17d876f787 | ||
|
|
5cb72e06c2 | ||
|
|
68ac058045 | ||
|
|
75fa5c0555 | ||
|
|
3159b36acd | ||
|
|
893a6365a4 | ||
|
|
e330051cf3 | ||
|
|
672777189a | ||
|
|
1ef313787d | ||
|
|
35c26bb5aa | ||
|
|
8aee244e64 | ||
|
|
12ca59d3e5 | ||
|
|
93156fd2ce | ||
|
|
e9d597b392 | ||
|
|
781e4e259d | ||
|
|
46fa819fa1 | ||
|
|
80e1adfb6c | ||
|
|
ff216c2100 | ||
|
|
7f6938ebad | ||
|
|
1dc91aa355 | ||
|
|
caa9e38d2b | ||
|
|
6402710910 | ||
|
|
b087e0f952 | ||
|
|
98a2ec67a6 | ||
|
|
d5d9f4c082 | ||
|
|
a656e402b7 | ||
|
|
f173ea4224 |
242
AUTHORS.txt
242
AUTHORS.txt
@@ -1,6 +1,6 @@
|
|||||||
OpenSceneGraph Library 3.4.0
|
OpenSceneGraph Library 3.0.0
|
||||||
|
|
||||||
550 Contributors:
|
464 Contributors:
|
||||||
|
|
||||||
Firstname Surname
|
Firstname Surname
|
||||||
-----------------
|
-----------------
|
||||||
@@ -8,141 +8,122 @@ Robert Osfield
|
|||||||
Don Burns
|
Don Burns
|
||||||
Stephan Huber
|
Stephan Huber
|
||||||
Paul Martz
|
Paul Martz
|
||||||
Farshid Lashkari
|
|
||||||
Mathias Fr<46>hlich
|
|
||||||
Marco Jez
|
Marco Jez
|
||||||
Wang Rui
|
Mathias Fr<46>hlich
|
||||||
Jean-S<>bastien Guay
|
|
||||||
Ulrich Hertlein
|
|
||||||
Mike Weiblen
|
Mike Weiblen
|
||||||
Sukender
|
Jean-S<>bastien Guay
|
||||||
|
Farshid Lashkari
|
||||||
Eric Wing
|
Eric Wing
|
||||||
|
Ulrich Hertlein
|
||||||
Cedric Pinson
|
Cedric Pinson
|
||||||
|
Wang Rui
|
||||||
Brede Johansen
|
Brede Johansen
|
||||||
Bob Kuehne
|
Sukender
|
||||||
Michael Platings
|
Michael Platings
|
||||||
|
Bob Kuehne
|
||||||
Geoff Michel
|
Geoff Michel
|
||||||
Wojciech Lewandowski
|
|
||||||
Eric Sokolowsky
|
Eric Sokolowsky
|
||||||
|
Wojciech Lewandowski
|
||||||
David Callu
|
David Callu
|
||||||
Laurens Voerman
|
|
||||||
Colin McDonald
|
|
||||||
Trajce Nikolov
|
Trajce Nikolov
|
||||||
Tim Moore
|
Tim Moore
|
||||||
Martin Lavery
|
Martin Lavery
|
||||||
Mattias Helsing
|
Colin McDonald
|
||||||
Tree
|
Tree
|
||||||
Jason Beverage
|
|
||||||
Pjotr Svetachov
|
|
||||||
Luigi Calori
|
Luigi Calori
|
||||||
Mike Wittman
|
Mike Wittman
|
||||||
Jan Peciva
|
|
||||||
Chris Hanson
|
|
||||||
Alberto Luaces
|
|
||||||
Roland Smeenk
|
Roland Smeenk
|
||||||
Roger James
|
Roger James
|
||||||
Jeremy Moles
|
Jeremy Moles
|
||||||
J.P. Delport
|
Chris Hanson
|
||||||
|
Mattias Helsing
|
||||||
|
Jason Beverage
|
||||||
|
Jan Peciva
|
||||||
Andy Skinner
|
Andy Skinner
|
||||||
Magnus Kessler
|
Paul Melis
|
||||||
|
J.P. Delport
|
||||||
David Fries
|
David Fries
|
||||||
Tom Jolley
|
Tom Jolley
|
||||||
Paul Melis
|
|
||||||
Luc Frauciel
|
|
||||||
Aurelien Albert
|
|
||||||
Pavel Moloshtan
|
Pavel Moloshtan
|
||||||
Brad Christiansen
|
|
||||||
Terry Welsh
|
|
||||||
Olaf Flebbe
|
|
||||||
Mathieu Marache
|
|
||||||
Lionel Lagarde
|
|
||||||
Jason Daly
|
Jason Daly
|
||||||
Art Tevs
|
|
||||||
Philip Lowman
|
Philip Lowman
|
||||||
Per Fahlberg
|
Per Fahlberg
|
||||||
Norman Vine
|
Norman Vine
|
||||||
Jannik Heller
|
Art Tevs
|
||||||
Chris Denham
|
Alberto Luaces
|
||||||
Serge Lages
|
Serge Lages
|
||||||
Romano Jos<6F> Magacho da Silva
|
Magnus Kessler
|
||||||
|
Laurens Voerman
|
||||||
Alberto Farre
|
Alberto Farre
|
||||||
Torben Dannhauer
|
Terry Welsh
|
||||||
Sherman Wilcox
|
Sherman Wilcox
|
||||||
Robert Michael
|
Robert Milharcic
|
||||||
Mourad Boufarguine
|
Olaf Flebbe
|
||||||
Glenn Waldron
|
Mathieu Marache
|
||||||
Andr<EFBFBD> Garneau
|
Andr<EFBFBD> Garneau
|
||||||
Adrian Egli
|
Adrian Egli
|
||||||
Ruben Lopez
|
Ruben Lopez
|
||||||
Randall Hopper
|
Randall Hopper
|
||||||
Jan Ciger
|
Mourad Boufarguine
|
||||||
Sebastian Messerschmidt
|
Brad Christiansen
|
||||||
Kristofer Tingdahl
|
|
||||||
Gideon May
|
Gideon May
|
||||||
Don Tidrow
|
Don Tidrow
|
||||||
|
Chris Denham
|
||||||
Stephane Lamoliatte
|
Stephane Lamoliatte
|
||||||
|
Romano Jos<6F> Magacho da Silva
|
||||||
Michael Gronager
|
Michael Gronager
|
||||||
Martin Naylor
|
|
||||||
Joakim Simonsson
|
Joakim Simonsson
|
||||||
David Spilling
|
David Spilling
|
||||||
Daniel Sj<53>lie
|
Daniel Sj<53>lie
|
||||||
Bryan Thrall
|
Bryan Thrall
|
||||||
Rafa Gaitan
|
Glenn Waldron
|
||||||
Mike Connell
|
|
||||||
Fabien Lavignotte
|
Fabien Lavignotte
|
||||||
Andreas Ekstrand
|
Torben Dannhauer
|
||||||
Thomas Hogarth
|
|
||||||
Riccardo Corsi
|
|
||||||
Melchior Franz
|
Melchior Franz
|
||||||
Konstantin Matveyev
|
Lionel Lagarde
|
||||||
Johannes Baeuerle
|
Jan Ciger
|
||||||
|
Rafa Gaitan
|
||||||
Neil Hughes
|
Neil Hughes
|
||||||
|
Mike Connell
|
||||||
Martin Beckett
|
Martin Beckett
|
||||||
Marc Helbling
|
|
||||||
Joran Jessurun
|
Joran Jessurun
|
||||||
Gino van den Bergen
|
Gino van den Bergen
|
||||||
Frederic Marmond
|
Frederic Marmond
|
||||||
David Guthrie
|
David Guthrie
|
||||||
Csaba Halasz
|
Csaba Halasz
|
||||||
Cory Riddell
|
|
||||||
Chuck Seberino
|
|
||||||
Boris Bralo
|
Boris Bralo
|
||||||
|
Andreas Ekstrand
|
||||||
Yefei He
|
Yefei He
|
||||||
Sondra Iverson
|
Sondra Iverson
|
||||||
Simon Julier
|
Simon Julier
|
||||||
Rune Schmidt Jensen
|
Rune Schmidt Jensen
|
||||||
Rainer Oder
|
Rainer Oder
|
||||||
Nico Kruithof
|
Martin Naylor
|
||||||
Martin Aumueller
|
Martin Aumueller
|
||||||
Mario Valle
|
Mario Valle
|
||||||
Lukasz Izdebski
|
Luc Frauciel
|
||||||
Jorge Izquierdo Ciges
|
|
||||||
Jordi Torres
|
|
||||||
Gordon Tomlinson
|
Gordon Tomlinson
|
||||||
Frederic Bouvier
|
Cory Riddell
|
||||||
Carlo Camporesi
|
Carlo Camporesi
|
||||||
Ben Discoe
|
Ben Discoe
|
||||||
Alexander Sinditskiy
|
|
||||||
Thibault Genessay
|
Thibault Genessay
|
||||||
Sasa Bistrovic
|
Sasa Bistrovic
|
||||||
Ravi Mathur
|
Ravi Mathur
|
||||||
Ralf Habacker
|
Ralf Habacker
|
||||||
Neil Groves
|
Neil Groves
|
||||||
Mikhail Izmestev
|
|
||||||
Markus Trenkwalder
|
Markus Trenkwalder
|
||||||
Loic Dachary
|
Loic Dachary
|
||||||
Joseph Steel
|
Joseph Steel
|
||||||
|
Jorge Izquierdo
|
||||||
John Shue
|
John Shue
|
||||||
|
Chuck Seberino
|
||||||
Brad Colbert
|
Brad Colbert
|
||||||
Bj<EFBFBD>rn Blissing
|
|
||||||
Vivek Rajan
|
Vivek Rajan
|
||||||
Uwe Woessner
|
Uwe Woessner
|
||||||
Tony Horrobin
|
|
||||||
Thom DeCarlo
|
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
|
||||||
@@ -152,142 +133,121 @@ Mihai Radu
|
|||||||
Michael Hartman
|
Michael Hartman
|
||||||
Martins Innus
|
Martins Innus
|
||||||
Maciej Krol
|
Maciej Krol
|
||||||
Lilin Xiong
|
Johannes Baeuerle
|
||||||
Leandro Motta Barros
|
|
||||||
Johan Nouvel
|
Johan Nouvel
|
||||||
Javier Taibo
|
|
||||||
Hartwig Wiesmann
|
Hartwig Wiesmann
|
||||||
|
Frederic Bouvier
|
||||||
Donn Mielcarek
|
Donn Mielcarek
|
||||||
Corbin Holtz
|
Corbin Holtz
|
||||||
Blasius Czink
|
Blasius Czink
|
||||||
Alexander Irion
|
|
||||||
Toshiyuki Takahei
|
Toshiyuki Takahei
|
||||||
|
Tony Horrobin
|
||||||
Sebastien Grignard
|
Sebastien Grignard
|
||||||
Rudolf Wiedemann
|
Ryan Kawicki
|
||||||
|
Romano Magacho
|
||||||
|
Riccardo Corsi
|
||||||
|
Nico Kruithof
|
||||||
|
Mikhail Izmestev
|
||||||
Maria Ten
|
Maria Ten
|
||||||
Liang Aibin
|
Liang Aibin
|
||||||
|
Leandro Motta Barros
|
||||||
Katharina Plugge
|
Katharina Plugge
|
||||||
Julien Valentin
|
|
||||||
John Vidar Larring
|
John Vidar Larring
|
||||||
John Kelso
|
John Kelso
|
||||||
John Ivar
|
John Ivar
|
||||||
Gustav Haapalahti
|
Gustav Haapalahti
|
||||||
Erik den Dekker
|
|
||||||
Emmanuel Roche
|
Emmanuel Roche
|
||||||
Domenico Mangieri
|
|
||||||
Daniel Larimer
|
Daniel Larimer
|
||||||
Colin Dunlop
|
Colin Dunlop
|
||||||
Bruce Clay
|
Bruce Clay
|
||||||
Bradley Anderegg
|
Bradley Anderegg
|
||||||
Andreas Goebel
|
Andreas Goebel
|
||||||
Alok Priyadarshi
|
Alok Priyadarshi
|
||||||
Ali Botorabi
|
|
||||||
Alberto Barbati
|
Alberto Barbati
|
||||||
Alan Dickinson
|
Alan Dickinson
|
||||||
Vladimir Shabanov
|
Vladimir Shabanov
|
||||||
Vladimir Chebaev
|
|
||||||
Tugkan Calapoglu
|
Tugkan Calapoglu
|
||||||
Tim Daoust
|
Tim Daoust
|
||||||
Sylvain Marie
|
Thomas Hogarth
|
||||||
Sohey Yamamoto
|
Sohey Yamamoto
|
||||||
Sergey Leontyev
|
Sergey Leontyev
|
||||||
Santosh Gaikwad
|
Santosh Gaikwad
|
||||||
Ryan Pavlik
|
Rudolf Wiedemann
|
||||||
Robert Milharcic
|
|
||||||
Rene Molenaar
|
Rene Molenaar
|
||||||
Piotr Domagalski
|
|
||||||
Phil Atkin
|
Phil Atkin
|
||||||
Pawel Ksiezopolski
|
|
||||||
Nathan Monteleone
|
Nathan Monteleone
|
||||||
Miha Rav<61>elj
|
|
||||||
Miguel Escriva
|
Miguel Escriva
|
||||||
Mattias Linde
|
Mattias Linde
|
||||||
Mark Sciabica
|
Mark Sciabica
|
||||||
Marcin Prus
|
Lilin Xiong
|
||||||
Lee Butler
|
Lee Butler
|
||||||
Lars Nilsson
|
|
||||||
Konstantin Sinitsyn
|
Konstantin Sinitsyn
|
||||||
Ken Sewell
|
Ken Sewell
|
||||||
Julian Ortiz
|
Julian Ortiz
|
||||||
Julen Garcia
|
|
||||||
John Kaniarz
|
|
||||||
Johannes Scholz
|
|
||||||
Jim Vaughan
|
Jim Vaughan
|
||||||
Jeremy Bell
|
Jeremy Bell
|
||||||
Jaromir Vitek
|
Jaromir Vitek
|
||||||
James French
|
James French
|
||||||
Jaap Glas
|
|
||||||
Guillaume Millet
|
|
||||||
Gary Quinn
|
Gary Quinn
|
||||||
Garrett Potts
|
Garrett Potts
|
||||||
Gabor Dorka
|
Gabor Dorka
|
||||||
Fabio Mierlo
|
Fabio Mierlo
|
||||||
|
Erik den Dekker
|
||||||
Doug McCorkle
|
Doug McCorkle
|
||||||
Donald Cipperly
|
Donald Cipperly
|
||||||
Don Leich
|
Don Leich
|
||||||
Dietmar Funck
|
Domenico Mangieri
|
||||||
Colin Cochran
|
|
||||||
Christian Ruzicka
|
|
||||||
Christian Buchner
|
|
||||||
Charles Cole
|
Charles Cole
|
||||||
Blake Williams
|
Blake Williams
|
||||||
Bj<EFBFBD>rn Hein
|
|
||||||
Aur<EFBFBD>lien Chatelain
|
|
||||||
Antoine Hue
|
Antoine Hue
|
||||||
Andrew Bettison
|
Andrew Bettison
|
||||||
Andreas Henne
|
|
||||||
Anders Backman
|
Anders Backman
|
||||||
|
Ali Botorabi
|
||||||
Alexander Wiebel
|
Alexander Wiebel
|
||||||
Alessandro Terenzi
|
Alexander Irion
|
||||||
Zach Deedler
|
Zach Deedler
|
||||||
Yuzhong Shen
|
Yuzhong Shen
|
||||||
Wee See
|
|
||||||
Warren Macchi
|
Warren Macchi
|
||||||
Vincent Bourdier
|
Vincent Bourdier
|
||||||
Terrex
|
Terrex
|
||||||
Tassilo Glander
|
Tassilo Glander
|
||||||
|
Sylvain Marie
|
||||||
Steve Lunsford
|
Steve Lunsford
|
||||||
Stephane Simon
|
Stephane Simon
|
||||||
Stephan Eilemann
|
Stephan Eilemann
|
||||||
Stanislav Blinov
|
Stanislav Blinov
|
||||||
Sergey Polischuk
|
Sebastian Messerschmidt
|
||||||
Roni Zanolli
|
Ryan Pavlik
|
||||||
Raymond de Vries
|
Raymond de Vries
|
||||||
Ralf Kern
|
Ralf Kern
|
||||||
Piotr Gwiazdowski
|
Piotr Gwiazdowski
|
||||||
Pierre Haritchabalet
|
Pierre Haritchabalet
|
||||||
Philippe Renon
|
|
||||||
Perry Miller
|
Perry Miller
|
||||||
Paul Palumbo
|
|
||||||
Paul Obermeier
|
Paul Obermeier
|
||||||
Patrick Neary
|
|
||||||
Nguyen Van Truong
|
Nguyen Van Truong
|
||||||
Nathan Cournia
|
Nathan Cournia
|
||||||
Morten Haukness
|
|
||||||
Morn<EFBFBD> Pistorius
|
Morn<EFBFBD> Pistorius
|
||||||
Michael Mc Donnell
|
|
||||||
Michael Henheffer
|
Michael Henheffer
|
||||||
Michael Guerrero
|
Michael Guerrero
|
||||||
Maya Leonard
|
Maya Leonard
|
||||||
Max Bandazian
|
Max Bandazian
|
||||||
Mathias Fiedler
|
Mathias Fiedler
|
||||||
Mathew May
|
Mathew May
|
||||||
Martin von Gargern
|
|
||||||
Martin Spott
|
Martin Spott
|
||||||
Martin Lambers
|
|
||||||
Martijn Kragtwijk
|
Martijn Kragtwijk
|
||||||
Marius Heise
|
Marius Heise
|
||||||
Marcin Hajder
|
Marcin Hajder
|
||||||
Marcel Pursche
|
Lukasz Izdebski
|
||||||
Lilith Bryant
|
Lilith Bryant
|
||||||
|
Lars Nilsson
|
||||||
Kevin Moiule
|
Kevin Moiule
|
||||||
Keith Steffen
|
Keith Steffen
|
||||||
|
Julen Garcia
|
||||||
Joseph Winston
|
Joseph Winston
|
||||||
John Aughey
|
John Aughey
|
||||||
Joachim Pouderoux
|
Joachim Pouderoux
|
||||||
Jean-Christophe Lombardo
|
Jean-Christophe Lombardo
|
||||||
Jan Klimke
|
Javier Taibo
|
||||||
James Turner
|
|
||||||
James Moliere
|
James Moliere
|
||||||
Igor Kravtchenko
|
Igor Kravtchenko
|
||||||
Himar Carmona
|
Himar Carmona
|
||||||
@@ -296,37 +256,28 @@ Guy Volckaert
|
|||||||
Gustavo Wagner
|
Gustavo Wagner
|
||||||
Guillaume Taze
|
Guillaume Taze
|
||||||
Guillaume Chouvenc
|
Guillaume Chouvenc
|
||||||
Giuseppe Donvito
|
|
||||||
Gill Peacegood
|
|
||||||
Giampaolo Vigan<61>
|
|
||||||
Gerrick Bivins
|
Gerrick Bivins
|
||||||
George Tarantilis
|
George Tarantilis
|
||||||
Ferdi Smit
|
Ferdi Smit
|
||||||
Eric Buehler
|
Eric Buehler
|
||||||
Eduardo Poyart
|
Eduardo Poyart
|
||||||
Edgar Ellis
|
Edgar Ellis
|
||||||
Dmitry Marakasov
|
|
||||||
Dimi Christopoulos
|
Dimi Christopoulos
|
||||||
Diane Delall<6C>e
|
Dietmar Funck
|
||||||
David Longest
|
|
||||||
David Ergo
|
David Ergo
|
||||||
Daniel Trstenjak
|
Daniel Trstenjak
|
||||||
Craig Bosma
|
Craig Bosma
|
||||||
Claus Scheiblauer
|
|
||||||
Christophe Loustaunau
|
Christophe Loustaunau
|
||||||
Christian Kehl
|
|
||||||
Bradley Baker Searles
|
|
||||||
Brad Anderegg
|
Brad Anderegg
|
||||||
Aric Aumann
|
Aric Aumann
|
||||||
Andrew Sampson
|
Andrew Sampson
|
||||||
Andrew Lorino
|
Andrew Lorino
|
||||||
Alexandre Amalric
|
Alexandre Amalric
|
||||||
Aitor Moreno
|
Alessandro Terenzi
|
||||||
Zbigniew Sroczynski
|
Zbigniew Sroczynski
|
||||||
Yuri Vilmanis
|
Yuri Vilmanis
|
||||||
Xin Li
|
Xin Li
|
||||||
Wang Lam
|
Wang Lam
|
||||||
Wand Rui
|
|
||||||
Walter J. Altice
|
Walter J. Altice
|
||||||
Volker Walkiewicz
|
Volker Walkiewicz
|
||||||
Vladimir Vukicevic
|
Vladimir Vukicevic
|
||||||
@@ -336,30 +287,23 @@ Vincent Vivanloc
|
|||||||
Vincent Gadoury
|
Vincent Gadoury
|
||||||
Vasily Radostev
|
Vasily Radostev
|
||||||
Valery Bickov
|
Valery Bickov
|
||||||
Valeriy Dubov
|
|
||||||
Vaclav Bilek
|
Vaclav Bilek
|
||||||
Tyge L<>vset
|
Tyge L<>vset
|
||||||
Troy Yee
|
Troy Yee
|
||||||
Tomas Hogarth
|
Tomas Hogarth
|
||||||
Tomas Hnilica
|
Tomas Hnilica
|
||||||
Todd Furlong
|
Todd Furlong
|
||||||
Tobias Ottenweller
|
|
||||||
Tino Schwarze
|
Tino Schwarze
|
||||||
Tim George
|
|
||||||
Thorsten Brehm
|
|
||||||
Thomas Weidner
|
Thomas Weidner
|
||||||
Tan Dunning
|
Tan Dunning
|
||||||
Tamer Fahmy
|
|
||||||
Stewart Andreason
|
Stewart Andreason
|
||||||
Steven Thomas
|
Steven Thomas
|
||||||
Stephan Wenglorz
|
|
||||||
Simon Hammett
|
Simon Hammett
|
||||||
Simon Carmody
|
Simon Carmody
|
||||||
Simon Buckley
|
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
|
||||||
@@ -367,14 +311,12 @@ 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
|
||||||
@@ -384,38 +326,29 @@ Pierre Bourdin
|
|||||||
Philipp Svehla
|
Philipp Svehla
|
||||||
Philipp Siemoleit
|
Philipp Siemoleit
|
||||||
Philipp M<>chler
|
Philipp M<>chler
|
||||||
Philip Lamb
|
|
||||||
Petr Salinger
|
Petr Salinger
|
||||||
Peter Bear
|
Peter Bear
|
||||||
Peter Amstutz
|
Peter Amstutz
|
||||||
Per Nordqvist
|
Paul Palumbo
|
||||||
Paul Idstein
|
|
||||||
Paul Fredrikson
|
Paul Fredrikson
|
||||||
Paul Fotheringham
|
Paul Fotheringham
|
||||||
Paul Cheyrou-Lagreze
|
|
||||||
Pau Garcia
|
Pau Garcia
|
||||||
Patrick Hartling
|
Patrick Hartling
|
||||||
Parag Chaudhur
|
Parag Chaudhur
|
||||||
Panagiotis Papadakos
|
Panagiotis Papadakos
|
||||||
Panagiotis Koutsourakis
|
Panagiotis Koutsourakis
|
||||||
Orhun Birsoy
|
Orhun Birsoy
|
||||||
Oren Fromberg
|
|
||||||
Oliver Neumann
|
Oliver Neumann
|
||||||
Ole-Morten Duesund
|
Ole-Morten Duesund
|
||||||
Nicolas Brodu
|
Nicolas Brodu
|
||||||
Nick Black
|
Morten Haukness
|
||||||
Mojtaba Fathi
|
Mojtaba Fathi
|
||||||
Mirko Viviani
|
Mirko Viviani
|
||||||
Mikkel Gj<EFBFBD>l
|
Mikkel Gjøl
|
||||||
Mike Krus
|
|
||||||
Mike Garrity
|
Mike Garrity
|
||||||
Michal Durkovic
|
|
||||||
Michael Schanne
|
|
||||||
Michael Polak
|
Michael Polak
|
||||||
Michael Morrison
|
Michael Morrison
|
||||||
Michael Logan
|
Michael Logan
|
||||||
Michael Kapelko
|
|
||||||
Michael Bach Jensen
|
|
||||||
Max Rhiener
|
Max Rhiener
|
||||||
Max Behensky
|
Max Behensky
|
||||||
Mauricio Hofmam
|
Mauricio Hofmam
|
||||||
@@ -426,35 +359,31 @@ Matt Burke
|
|||||||
Mathias Walker
|
Mathias Walker
|
||||||
Mathias Goldau
|
Mathias Goldau
|
||||||
Mason Menninger
|
Mason Menninger
|
||||||
|
Martin von Gargern
|
||||||
Martin Scheffler
|
Martin Scheffler
|
||||||
|
Martin Lambers
|
||||||
Martin Innus
|
Martin Innus
|
||||||
Martin Beck
|
Martin Beck
|
||||||
Marius Kintel
|
|
||||||
Mario Guimaraes
|
Mario Guimaraes
|
||||||
Marcus Hein
|
|
||||||
Marco Sciabica
|
Marco Sciabica
|
||||||
Marco Lehmann
|
Marco Lehmann
|
||||||
|
Marcin Prus
|
||||||
Maik Keller
|
Maik Keller
|
||||||
Lukas Diduch
|
Lukas Diduch
|
||||||
Louis Hamilton
|
Louis Hamilton
|
||||||
Likasz Izebski
|
|
||||||
Lewis Harmon
|
Lewis Harmon
|
||||||
Leigh Stivers
|
|
||||||
Laurence Muller
|
Laurence Muller
|
||||||
Laura Cerritelli
|
Laura Cerritelli
|
||||||
Kyle Centers
|
Kyle Centers
|
||||||
Kristopher Bixler
|
Kristopher Bixler
|
||||||
|
Konstantin Matveyev
|
||||||
Kim Seokhwan
|
Kim Seokhwan
|
||||||
Kim Bale
|
|
||||||
Karsten Weiss
|
Karsten Weiss
|
||||||
Karl Heijdenberg
|
Karl Heijdenberg
|
||||||
Jutta Sauer
|
Jutta Sauer
|
||||||
Julian Scheid
|
Julian Scheid
|
||||||
Juergen Rensen
|
|
||||||
Juan Manuel Alvarez
|
|
||||||
Juan Hernando
|
Juan Hernando
|
||||||
Josh Portway
|
Josh Portway
|
||||||
Jonathan Greig
|
|
||||||
John Tan
|
John Tan
|
||||||
John Grant
|
John Grant
|
||||||
John Donovan
|
John Donovan
|
||||||
@@ -464,19 +393,17 @@ John Argentieri
|
|||||||
Joan Abadie
|
Joan Abadie
|
||||||
Jim Brooks
|
Jim Brooks
|
||||||
Jeroen den Dekker
|
Jeroen den Dekker
|
||||||
Jeffrey Kinross
|
|
||||||
Jay Zuckerman
|
Jay Zuckerman
|
||||||
Jason Howlett
|
Jason Howlett
|
||||||
Jason Ballenger
|
Jason Ballenger
|
||||||
Jamie Robertson
|
Jan Klimke
|
||||||
James Killian
|
James Killian
|
||||||
James Athey
|
|
||||||
J.E. Hoffmann
|
J.E. Hoffmann
|
||||||
Holger Helmich
|
Holger Helmich
|
||||||
Henrique Bucher
|
Henrique Bucher
|
||||||
Hautio Jari
|
Hautio Jari
|
||||||
Hartmut Seichter
|
|
||||||
Gunter Huber
|
Gunter Huber
|
||||||
|
Guillaume Millet
|
||||||
Gregory Jaegy
|
Gregory Jaegy
|
||||||
Graeme Harkness
|
Graeme Harkness
|
||||||
Gian Lorenzetto
|
Gian Lorenzetto
|
||||||
@@ -484,13 +411,10 @@ George Papagiannakis
|
|||||||
Galen Faidley
|
Galen Faidley
|
||||||
Frida Schlaug
|
Frida Schlaug
|
||||||
Frederic Smith
|
Frederic Smith
|
||||||
Frederic Morin
|
|
||||||
Frank Warmerdam
|
Frank Warmerdam
|
||||||
Frank Midgley
|
Frank Midgley
|
||||||
Frank Lindeman
|
Frank Lindeman
|
||||||
Frank Lichtenheld
|
Frank Lichtenheld
|
||||||
Francois Tigeot
|
|
||||||
Filip Arlet
|
|
||||||
Ferdinand Cornelissen
|
Ferdinand Cornelissen
|
||||||
Fajran Iman
|
Fajran Iman
|
||||||
Fabien Dachicourt
|
Fabien Dachicourt
|
||||||
@@ -502,7 +426,6 @@ Duvan Cope
|
|||||||
Duncan Cavens
|
Duncan Cavens
|
||||||
Drew Whitehouse
|
Drew Whitehouse
|
||||||
Douglas A. Pouk
|
Douglas A. Pouk
|
||||||
Dmitriy Ogalcev
|
|
||||||
Dean Iverson
|
Dean Iverson
|
||||||
David Jung
|
David Jung
|
||||||
Danny Valente
|
Danny Valente
|
||||||
@@ -510,17 +433,12 @@ Daniel Stien
|
|||||||
Dan Minor
|
Dan Minor
|
||||||
C<EFBFBD>sar L. B. Silveira
|
C<EFBFBD>sar L. B. Silveira
|
||||||
Cyril Brulebois
|
Cyril Brulebois
|
||||||
Cory Slep
|
|
||||||
Cl<EFBFBD>ment B<>sch
|
|
||||||
Clay Fowler
|
Clay Fowler
|
||||||
Claus Steuer
|
|
||||||
Chuck Sembroski
|
Chuck Sembroski
|
||||||
Christopher Blaesius
|
Christopher Blaesius
|
||||||
Christopher Baker
|
|
||||||
Christophe Herreman
|
|
||||||
Christian Noon
|
|
||||||
Christian Kaser
|
Christian Kaser
|
||||||
Christian Ehrlicher
|
Christian Ehrlicher
|
||||||
|
Christian Buchner
|
||||||
Chris McGlone
|
Chris McGlone
|
||||||
Carlos Garcea
|
Carlos Garcea
|
||||||
Bryce Eldridge
|
Bryce Eldridge
|
||||||
@@ -528,6 +446,7 @@ Bruno Herbelin
|
|||||||
Brian Keener
|
Brian Keener
|
||||||
Brandon Hamm
|
Brandon Hamm
|
||||||
Bora Utka
|
Bora Utka
|
||||||
|
Bj<EFBFBD>rn Hein
|
||||||
Bill Prendergast
|
Bill Prendergast
|
||||||
Bernardt Duvenhage
|
Bernardt Duvenhage
|
||||||
Benoit Laniel
|
Benoit Laniel
|
||||||
@@ -535,22 +454,17 @@ 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
|
||||||
Andreas Jochens
|
Andreas Jochens
|
||||||
Andre Normann
|
Andre Normann
|
||||||
Alois Wismer
|
|
||||||
Almalric Alexandre
|
Almalric Alexandre
|
||||||
Allen Bierbaum
|
Allen Bierbaum
|
||||||
Alexey Pavlov
|
Alexander Sinditskiy
|
||||||
Alberto Jaspe
|
Alberto Jaspe
|
||||||
Alan Purvis
|
Alan Purvis
|
||||||
Alan Ott
|
Alan Ott
|
||||||
Alan Harris
|
Alan Harris
|
||||||
Adrien Grandemange
|
|
||||||
Adrian Clark
|
|
||||||
Adam Richard
|
Adam Richard
|
||||||
|
|||||||
547
CMakeLists.txt
547
CMakeLists.txt
@@ -20,41 +20,19 @@ if(COMMAND cmake_policy)
|
|||||||
# statements.
|
# statements.
|
||||||
cmake_policy(SET CMP0005 NEW)
|
cmake_policy(SET CMP0005 NEW)
|
||||||
|
|
||||||
# tell CMake to prefer CMake's own CMake modules when available
|
|
||||||
# only available from cmake-2.8.4
|
|
||||||
if(${CMAKE_MAJOR_VERSION} GREATER 2 OR
|
|
||||||
(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 8) OR
|
|
||||||
(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 8 AND ${CMAKE_PATCH_VERSION} GREATER 3))
|
|
||||||
cmake_policy(SET CMP0017 NEW)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# cmake-2.6.1 introduces policy cmp0008 decide how to treat full path libraries that do not appear to be valid library file names
|
# 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} GREATER 2 OR
|
if(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 4 AND ${CMAKE_PATCH_VERSION} GREATER 0)
|
||||||
(${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)
|
|
||||||
if(${CMAKE_MAJOR_VERSION} GREATER 2 OR
|
|
||||||
(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 8) OR
|
|
||||||
(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 8 AND ${CMAKE_PATCH_VERSION} GREATER 10))
|
|
||||||
cmake_policy(SET CMP0020 OLD)
|
|
||||||
endif()
|
|
||||||
# nicer version check - but needs at least CMake 2.6.2? Worth upgrading the requirements?
|
|
||||||
#if("${CMAKE_VERSION}" VERSION_GREATER 2.8.10)
|
|
||||||
# or even easier (available in cmake-2.6)
|
|
||||||
#if(POLICY CMPxyzw)
|
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
PROJECT(OpenSceneGraph)
|
PROJECT(OpenSceneGraph)
|
||||||
|
|
||||||
SET(OPENSCENEGRAPH_MAJOR_VERSION 3)
|
SET(OPENSCENEGRAPH_MAJOR_VERSION 3)
|
||||||
SET(OPENSCENEGRAPH_MINOR_VERSION 4)
|
SET(OPENSCENEGRAPH_MINOR_VERSION 0)
|
||||||
SET(OPENSCENEGRAPH_PATCH_VERSION 0)
|
SET(OPENSCENEGRAPH_PATCH_VERSION 0)
|
||||||
SET(OPENSCENEGRAPH_SOVERSION 130)
|
SET(OPENSCENEGRAPH_SOVERSION 80)
|
||||||
|
|
||||||
# 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
|
||||||
@@ -85,16 +63,47 @@ 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
|
## Option to enable Android build using AndroidNDK
|
||||||
IF(NOT CMAKE_BUILD_TYPE)
|
OPTION(OSG_BUILD_PLATFORM_ANDROID OFF)
|
||||||
SET(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
|
IF(OSG_BUILD_PLATFORM_ANDROID)
|
||||||
ENDIF(NOT CMAKE_BUILD_TYPE)
|
|
||||||
|
|
||||||
|
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR)
|
||||||
|
|
||||||
IF(ANDROID)
|
|
||||||
INCLUDE(OsgAndroidMacroUtils)
|
INCLUDE(OsgAndroidMacroUtils)
|
||||||
|
SET(ANDROID TRUE)
|
||||||
|
SET(ANDROID_PLATFORM 5)
|
||||||
|
FIND_PACKAGE(AndroidNDK REQUIRED)
|
||||||
|
|
||||||
|
SET(OSG_ANDROID_TEMPLATES "${CMAKE_SOURCE_DIR}/PlatformSpecifics/Android")
|
||||||
|
|
||||||
|
SET(J "4" CACHE STRING "how many processes for make -j <J>")
|
||||||
|
|
||||||
|
ADD_CUSTOM_COMMAND(
|
||||||
|
OUTPUT Android-OpenSceneGraph
|
||||||
|
DEPENDS ${CMAKE_BINARY_DIR}/Android.mk
|
||||||
|
COMMAND "${ANDROID_NDK}/ndk-build"
|
||||||
|
ARGS --directory=${CMAKE_BINARY_DIR} NDK_APPLICATION_MK=Application.mk -j${J} NDK_LOG=1
|
||||||
|
)
|
||||||
|
|
||||||
|
ADD_CUSTOM_TARGET(ndk ALL echo
|
||||||
|
DEPENDS Android-OpenSceneGraph
|
||||||
|
)
|
||||||
|
install(DIRECTORY include/ DESTINATION include/
|
||||||
|
PATTERN ".svn" EXCLUDE
|
||||||
|
)
|
||||||
|
install(DIRECTORY ${CMAKE_BINARY_DIR}/include/ DESTINATION include/
|
||||||
|
)
|
||||||
|
install(DIRECTORY ${CMAKE_BINARY_DIR}/obj/ DESTINATION obj/
|
||||||
|
PATTERN ".svn" EXCLUDE
|
||||||
|
PATTERN "objs" EXCLUDE
|
||||||
|
)
|
||||||
|
|
||||||
|
ADD_DEFINITIONS(-DANDROID)
|
||||||
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Okay, here's the problem: On some platforms, linking against OpenThreads
|
# Okay, here's the problem: On some platforms, linking against OpenThreads
|
||||||
# is not enough and explicit linking to the underlying thread library
|
# is not enough and explicit linking to the underlying thread library
|
||||||
# is also required (e.g. FreeBSD). But OpenThreads may be built with different
|
# is also required (e.g. FreeBSD). But OpenThreads may be built with different
|
||||||
@@ -125,9 +134,9 @@ IF (OSG_MAINTAINER)
|
|||||||
# Provide target for tagging a release
|
# Provide target for tagging a release
|
||||||
#
|
#
|
||||||
SET(SVNCOMMAND svn)
|
SET(SVNCOMMAND svn)
|
||||||
SET(SVNTRUNKDIR http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk)
|
SET(SVNTRUNKDIR http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk)
|
||||||
SET(SVNTAGDIR http://svn.openscenegraph.org/osg/OpenSceneGraph/tags)
|
SET(SVNTAGDIR http://www.openscenegraph.org/svn/osg/OpenSceneGraph/tags)
|
||||||
SET(SVNBRANCHDIR http://svn.openscenegraph.org/osg/OpenSceneGraph/branches)
|
SET(SVNBRANCHDIR http://www.openscenegraph.org/svn/osg/OpenSceneGraph/branches)
|
||||||
|
|
||||||
IF (OPENSCENEGRAPH_SVN STREQUAL "trunk")
|
IF (OPENSCENEGRAPH_SVN STREQUAL "trunk")
|
||||||
SET(SVNSOURCEDIR ${SVNTRUNKDIR})
|
SET(SVNSOURCEDIR ${SVNTRUNKDIR})
|
||||||
@@ -173,17 +182,6 @@ ENDIF(OSG_MAINTAINER)
|
|||||||
|
|
||||||
IF(NOT ANDROID)
|
IF(NOT ANDROID)
|
||||||
IF(APPLE)
|
IF(APPLE)
|
||||||
# Determine the canonical name of the selected Platform SDK
|
|
||||||
EXECUTE_PROCESS(COMMAND "/usr/bin/sw_vers" "-productVersion"
|
|
||||||
OUTPUT_VARIABLE OSG_OSX_SDK_NAME
|
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
||||||
STRING(REPLACE "." ";" MACOS_VERSION_LIST ${OSG_OSX_SDK_NAME})
|
|
||||||
LIST(GET MACOS_VERSION_LIST 0 MACOS_VERSION_MAJOR)
|
|
||||||
LIST(GET MACOS_VERSION_LIST 1 MACOS_VERSION_MINOR)
|
|
||||||
LIST(GET MACOS_VERSION_LIST 2 MACOS_VERSION_PATCH)
|
|
||||||
|
|
||||||
SET(OSG_OSX_SDK_NAME "macosx${MACOS_VERSION_MAJOR}.${MACOS_VERSION_MINOR}")
|
|
||||||
|
|
||||||
# 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
|
||||||
# set to true. Should realy have an OSG_BUILD_PLATFORM variable that we set to our desired platform
|
# set to true. Should realy have an OSG_BUILD_PLATFORM variable that we set to our desired platform
|
||||||
@@ -193,24 +191,21 @@ IF(APPLE)
|
|||||||
IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
|
IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
|
||||||
|
|
||||||
#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 "3.2")
|
||||||
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
|
||||||
IF(IPHONE_VERSION_MIN LESS "6.0")
|
include(CMakeForceCompiler)
|
||||||
include(CMakeForceCompiler)
|
CMAKE_FORCE_C_COMPILER(gcc-4.2 GNU)
|
||||||
CMAKE_FORCE_C_COMPILER(llvm-gcc-4.2 GNU)
|
CMAKE_FORCE_CXX_COMPILER(gcc-4.2 GNU)
|
||||||
CMAKE_FORCE_CXX_COMPILER(llvm-gcc-4.2 GNU)
|
SET(GCC_THUMB_SUPPORT NO)
|
||||||
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)
|
||||||
SET (IPHONE_DEVROOT "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer")
|
SET (IPHONE_DEVROOT "/Developer/Platforms/iPhoneOS.platform/Developer")
|
||||||
SET (IPHONE_SDKROOT "${IPHONE_DEVROOT}/SDKs/iPhoneOS${IPHONE_SDKVER}.sdk")
|
SET (IPHONE_SDKROOT "${IPHONE_DEVROOT}/SDKs/iPhoneOS${IPHONE_SDKVER}.sdk")
|
||||||
ELSE()
|
ELSE()
|
||||||
SET (IPHONE_DEVROOT "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer")
|
SET (IPHONE_DEVROOT "/Developer/Platforms/iPhoneSimulator.platform/Developer")
|
||||||
SET (IPHONE_SDKROOT "${IPHONE_DEVROOT}/SDKs/iPhoneSimulator${IPHONE_SDKVER}.sdk")
|
SET (IPHONE_SDKROOT "${IPHONE_DEVROOT}/SDKs/iPhoneSimulator${IPHONE_SDKVER}.sdk")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
@@ -233,10 +228,6 @@ ELSE()
|
|||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
IF(UNIX AND NOT ANDROID)
|
IF(UNIX AND NOT ANDROID)
|
||||||
# Not sure what this will do on Cygwin and Msys
|
# Not sure what this will do on Cygwin and Msys
|
||||||
# Also, remember OS X X11 is a user installed option so it may not exist.
|
# Also, remember OS X X11 is a user installed option so it may not exist.
|
||||||
@@ -311,13 +302,7 @@ IF(WIN32 AND NOT ANDROID)
|
|||||||
STRING(REGEX REPLACE "/STACK:[0-9]+" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
|
STRING(REGEX REPLACE "/STACK:[0-9]+" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
|
||||||
STRING(REGEX REPLACE "/STACK:[0-9]+" "" CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}")
|
STRING(REGEX REPLACE "/STACK:[0-9]+" "" CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}")
|
||||||
ENDIF(MSVC_USE_DEFAULT_STACK_SIZE)
|
ENDIF(MSVC_USE_DEFAULT_STACK_SIZE)
|
||||||
get_filename_component( CMAKE_MAKE_PROGRAM_NAME ${CMAKE_MAKE_PROGRAM} NAME)
|
|
||||||
IF (CMAKE_MAKE_PROGRAM_NAME STREQUAL "VCExpress.exe")
|
|
||||||
OPTION(MSVC_BUILD_USE_SOLUTION_FOLDERS "Enable project grouping in VS - VCExpress detected, not supported in VCExpress )" OFF)
|
|
||||||
ELSE()
|
|
||||||
OPTION(MSVC_BUILD_USE_SOLUTION_FOLDERS "Enable project grouping in VS" ON)
|
|
||||||
ENDIF()
|
|
||||||
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ${MSVC_BUILD_USE_SOLUTION_FOLDERS})
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
#needed for net plugin
|
#needed for net plugin
|
||||||
@@ -400,225 +385,46 @@ MARK_AS_ADVANCED(OSG_DISABLE_MSVC_WARNINGS)
|
|||||||
|
|
||||||
OPTION(OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION "Set to ON to use the ref_ptr<> T* operator() output conversion. " ON)
|
OPTION(OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION "Set to ON to use the ref_ptr<> T* operator() output conversion. " ON)
|
||||||
|
|
||||||
|
OPTION(OSG_GL1_AVAILABLE "Set to OFF to disable use of OpenGL 1.x functions library." ON)
|
||||||
# Map the OPENGL_PROFILE to OSG_GL*_AVAILABLE settings
|
OPTION(OSG_GL2_AVAILABLE "Set to OFF to disable use of OpenGL 2.x functions library." ON)
|
||||||
SET(OPENGL_PROFILE "GL2" CACHE STRING "OpenGL Profile to use, choose from GL1, GL2, GL3, GLES1, GLES2, GLES3")
|
OPTION(OSG_GL3_AVAILABLE "Set to OFF to disable use of OpenGL 3.x functions library." OFF)
|
||||||
|
OPTION(OSG_GLES1_AVAILABLE "Set to OFF to disable use of OpenGL ES 1.x functions library." OFF)
|
||||||
IF ((OPENGL_PROFILE STREQUAL "GL1") OR (OPENGL_PROFILE STREQUAL "GL2"))
|
OPTION(OSG_GLES2_AVAILABLE "Set to OFF to disable use of OpenGL ES 2.x functions library." OFF)
|
||||||
OPTION(OSG_GL1_AVAILABLE "Set to OFF to disable use of OpenGL 1.x functions library." ON )
|
|
||||||
ELSE()
|
|
||||||
OPTION(OSG_GL1_AVAILABLE "Set to OFF to disable use of OpenGL 1.x functions library." OFF )
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
IF ((OPENGL_PROFILE STREQUAL "GL2"))
|
|
||||||
OPTION(OSG_GL2_AVAILABLE "Set to OFF to disable use of OpenGL 2.x functions library." ON )
|
|
||||||
ELSE()
|
|
||||||
OPTION(OSG_GL2_AVAILABLE "Set to OFF to disable use of OpenGL 2.x functions library." OFF )
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
IF ((OPENGL_PROFILE STREQUAL "GL3") OR (OPENGL_PROFILE STREQUAL "GLCORE"))
|
|
||||||
OPTION(OSG_GL3_AVAILABLE "Set to OFF to disable use of OpenGL 3.x functions library." ON )
|
|
||||||
ELSE()
|
|
||||||
OPTION(OSG_GL3_AVAILABLE "Set to OFF to disable use of OpenGL 3.x functions library." OFF )
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
IF ((OPENGL_PROFILE STREQUAL "GLES1"))
|
|
||||||
OPTION(OSG_GLES1_AVAILABLE "Set to OFF to disable use of OpenGL ES 1.x functions library." ON )
|
|
||||||
ELSE()
|
|
||||||
OPTION(OSG_GLES1_AVAILABLE "Set to OFF to disable use of OpenGL ES 1.x functions library." OFF )
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
IF ((OPENGL_PROFILE STREQUAL "GLES2"))
|
|
||||||
OPTION(OSG_GLES2_AVAILABLE "Set to OFF to disable use of OpenGL ES 2.x functions library." ON )
|
|
||||||
ELSEIF ((OPENGL_PROFILE STREQUAL "GLES3"))
|
|
||||||
OPTION(OSG_GLES2_AVAILABLE "Set to OFF to disable use of OpenGL ES 2.x functions library." ON )
|
|
||||||
OPTION(OSG_GLES3_AVAILABLE "Set to OFF to disable use of OpenGL ES 3.x functions library." ON )
|
|
||||||
ELSE()
|
|
||||||
OPTION(OSG_GLES2_AVAILABLE "Set to OFF to disable use of OpenGL ES 2.x functions library." OFF )
|
|
||||||
OPTION(OSG_GLES3_AVAILABLE "Set to OFF to disable use of OpenGL ES 3.x functions library." OFF )
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
|
|
||||||
OPTION(OSG_GL_LIBRARY_STATIC "Set to ON to statically link with OpenGL/GLES library." OFF)
|
OPTION(OSG_GL_LIBRARY_STATIC "Set to ON to statically link with OpenGL/GLES library." OFF)
|
||||||
|
|
||||||
SET(OPENGL_egl_LIBRARY CACHE STRING "Set the OpenGL egl library.")
|
SET(OPENGL_egl_LIBRARY CACHE STRING "Set the OpenGL egl library.")
|
||||||
|
|
||||||
# Map the OSG_GL*_AVAILABLE settings to OSG_GL_* settings
|
# SET(OSG_GL_DISPLAYLISTS_AVAILABLE ${OSG_GL1_AVAILABLE})
|
||||||
IF (OSG_GLES2_AVAILABLE OR OSG_GL3_AVAILABLE)
|
# SET(OSG_GL_MATRICES_AVAILABLE ${OSG_GL1_AVAILABLE})
|
||||||
OPTION(OSG_GL_DISPLAYLISTS_AVAILABLE "Set to OFF to disable use of OpenGL display lists." OFF)
|
# SET(OSG_GL_VERTEX_FUNCS_AVAILABLE ${OSG_GL1_AVAILABLE})
|
||||||
OPTION(OSG_GL_MATRICES_AVAILABLE "Set to OFF to disable use of OpenGL built-in matrices." OFF)
|
# SET(OSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE ${OSG_GL1_AVAILABLE})
|
||||||
OPTION(OSG_GL_VERTEX_FUNCS_AVAILABLE "Set to OFF to disable use of OpenGL vertex functions such as glVertex/glColor etc." OFF)
|
# SET(OSG_GL_FIXED_FUNCTION_AVAILABLE ${OSG_GL1_AVAILABLE})
|
||||||
OPTION(OSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE "Set to OFF to disable use of OpenGL vertex functions such as glVertexPointer/glColorPointer etc." OFF)
|
|
||||||
OPTION(OSG_GL_FIXED_FUNCTION_AVAILABLE "Set to OFF to disable use of OpenGL fixed function pipeline." OFF)
|
|
||||||
ELSEIF (OSG_GLES1_AVAILABLE)
|
|
||||||
OPTION(OSG_GL_DISPLAYLISTS_AVAILABLE "Set to OFF to disable use of OpenGL display lists." OFF)
|
|
||||||
OPTION(OSG_GL_MATRICES_AVAILABLE "Set to OFF to disable use of OpenGL built-in matrices." ON)
|
|
||||||
OPTION(OSG_GL_VERTEX_FUNCS_AVAILABLE "Set to OFF to disable use of OpenGL vertex functions such as glVertex/glColor etc." ON)
|
|
||||||
OPTION(OSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE "Set to OFF to disable use of OpenGL vertex functions such as glVertexPointer/glColorPointer etc." ON)
|
|
||||||
OPTION(OSG_GL_FIXED_FUNCTION_AVAILABLE "Set to OFF to disable use of OpenGL fixed function pipeline." ON)
|
|
||||||
ELSE()
|
|
||||||
OPTION(OSG_GL_DISPLAYLISTS_AVAILABLE "Set to OFF to disable use of OpenGL display lists." ON)
|
|
||||||
OPTION(OSG_GL_MATRICES_AVAILABLE "Set to OFF to disable use of OpenGL built-in matrices." ON)
|
|
||||||
OPTION(OSG_GL_VERTEX_FUNCS_AVAILABLE "Set to OFF to disable use of OpenGL vertex functions such as glVertex/glColor etc." ON)
|
|
||||||
OPTION(OSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE "Set to OFF to disable use of OpenGL vertex functions such as glVertexPointer/glColorPointer etc." ON)
|
|
||||||
OPTION(OSG_GL_FIXED_FUNCTION_AVAILABLE "Set to OFF to disable use of OpenGL fixed function pipeline." ON)
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
IF (OSG_GLES1_AVAILABLE OR OSG_GLES2_AVAILABLE)
|
OPTION(OSG_GL_DISPLAYLISTS_AVAILABLE "Set to OFF to disable use of OpenGL display lists." ${OSG_GL1_AVAILABLE})
|
||||||
OPTION(OSG_CPP_EXCEPTIONS_AVAILABLE "Set to OFF to disable compile of OSG components that use C++ exceptions." OFF)
|
OPTION(OSG_GL_MATRICES_AVAILABLE "Set to OFF to disable use of OpenGL built-in matrices." ${OSG_GL1_AVAILABLE})
|
||||||
ELSE()
|
OPTION(OSG_GL_VERTEX_FUNCS_AVAILABLE "Set to OFF to disable use of OpenGL vertex functions such as glVertex/glColor etc." ${OSG_GL1_AVAILABLE})
|
||||||
OPTION(OSG_CPP_EXCEPTIONS_AVAILABLE "Set to OFF to disable compile of OSG components that use C++ exceptions." ON)
|
OPTION(OSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE "Set to OFF to disable use of OpenGL vertex functions such as glVertex/glColor etc." ${OSG_GL1_AVAILABLE})
|
||||||
ENDIF()
|
OPTION(OSG_GL_FIXED_FUNCTION_AVAILABLE "Set to OFF to disable use of OpenGL fixed function pipeline." ${OSG_GL1_AVAILABLE})
|
||||||
|
|
||||||
|
|
||||||
# Map the OSG_GL*_AVAILABLE settings to OpenGL header settings
|
|
||||||
IF (OSG_GL3_AVAILABLE)
|
|
||||||
IF (APPLE)
|
|
||||||
SET(OPENGL_HEADER1 "#include <OpenGL/gl.h>" CACHE STRING "#include<> line for OpenGL Header")
|
|
||||||
SET(OPENGL_HEADER2 "#include <OpenGL/gl3.h>" CACHE STRING "#include<> line for additional OpenGL Headers if required")
|
|
||||||
ELSE()
|
|
||||||
|
|
||||||
IF (OPENGL_PROFILE STREQUAL "GLCORE")
|
|
||||||
IF(WIN32)
|
|
||||||
FIND_PACKAGE(GLCORE REQUIRED)
|
|
||||||
ENDIF()
|
|
||||||
SET(OPENGL_HEADER1 "#include <GL/glcorearb.h>" CACHE STRING "#include<> line for OpenGL Header")
|
|
||||||
SET(OPENGL_HEADER2 "" CACHE STRING "#include<> line for additional OpenGL Headers if required")
|
|
||||||
ELSE()
|
|
||||||
SET(OPENGL_HEADER1 "#include <GL3/gl3.h>" CACHE STRING "#include<> line for OpenGL Header")
|
|
||||||
SET(OPENGL_HEADER2 "" CACHE STRING "#include<> line for additional OpenGL Headers if required")
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
ENDIF()
|
|
||||||
ELSEIF(OSG_GLES1_AVAILABLE)
|
|
||||||
IF (APPLE AND NOT ANDROID)
|
|
||||||
SET(OPENGL_HEADER1 "#include \"TargetConditionals.h\"" CACHE STRING "#include<> line for OpenGL Header")
|
|
||||||
SET(OPENGL_HEADER2 "#include <OpenGLES/ES1/gl.h>" CACHE STRING "#include<> line for additional OpenGL Headers if required")
|
|
||||||
ELSE()
|
|
||||||
SET(OPENGL_HEADER1 "#include <GLES/gl.h>" CACHE STRING "#include<> line for OpenGL Header")
|
|
||||||
SET(OPENGL_HEADER2 "" CACHE STRING "#include<> line for additional OpenGL Headers if required")
|
|
||||||
ENDIF()
|
|
||||||
ELSEIF(OSG_GLES2_AVAILABLE)
|
|
||||||
IF (APPLE AND NOT ANDROID)
|
|
||||||
SET(OPENGL_HEADER1 "#include \"TargetConditionals.h\"" CACHE STRING "#include<> line for OpenGL Header")
|
|
||||||
SET(OPENGL_HEADER2 "#include <OpenGLES/ES2/gl.h>" CACHE STRING "#include<> line for additional OpenGL Headers if required")
|
|
||||||
# TODO: GLES3
|
|
||||||
ELSE()
|
|
||||||
SET(OPENGL_HEADER1 "#include <GLES2/gl2.h>" CACHE STRING "#include<> line for OpenGL Header")
|
|
||||||
SET(OPENGL_HEADER2 "" CACHE STRING "#include<> line for additional OpenGL Headers if required")
|
|
||||||
# TODO: GLES3
|
|
||||||
ENDIF()
|
|
||||||
ELSE()
|
|
||||||
IF (APPLE)
|
|
||||||
SET(OPENGL_HEADER1 "#include <OpenGL/gl.h>" CACHE STRING "#include<> line for OpenGL Header")
|
|
||||||
SET(OPENGL_HEADER2 "" CACHE STRING "#include<> line for additional OpenGL Headers if required")
|
|
||||||
ELSE()
|
|
||||||
SET(OPENGL_HEADER1 "#include <GL/gl.h>" CACHE STRING "#include<> line for OpenGL Header")
|
|
||||||
SET(OPENGL_HEADER2 "" CACHE STRING "#include<> line for additional OpenGL Headers if required")
|
|
||||||
ENDIF()
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
IF (OSG_GL1_AVAILABLE)
|
|
||||||
SET(OSG_GL1_FEATURES "true")
|
|
||||||
ELSE()
|
|
||||||
SET(OSG_GL1_FEATURES "false")
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
IF (OSG_GL2_AVAILABLE)
|
|
||||||
SET(OSG_GL2_FEATURES "true")
|
|
||||||
ELSE()
|
|
||||||
SET(OSG_GL2_FEATURES "false")
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
IF (OSG_GL3_AVAILABLE)
|
|
||||||
SET(OSG_GL3_FEATURES "true")
|
|
||||||
ELSE()
|
|
||||||
SET(OSG_GL3_FEATURES "false")
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
IF (OSG_GLES1_AVAILABLE)
|
|
||||||
SET(OSG_GLES1_FEATURES "true")
|
|
||||||
ELSE()
|
|
||||||
SET(OSG_GLES1_FEATURES "false")
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
IF (OSG_GLES2_AVAILABLE)
|
|
||||||
SET(OSG_GLES2_FEATURES "true")
|
|
||||||
ELSE()
|
|
||||||
SET(OSG_GLES2_FEATURES "false")
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
IF (OSG_GLES3_AVAILABLE)
|
|
||||||
SET(OSG_GLES3_FEATURES "true")
|
|
||||||
ELSE()
|
|
||||||
SET(OSG_GLES3_FEATURES "false")
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
IF(ANDROID)
|
|
||||||
IF(OSG_GLES1_AVAILABLE)
|
|
||||||
FIND_PATH(OPENGL_INCLUDE_DIR GLES/gl.h
|
|
||||||
PATHS
|
|
||||||
${ANDROID_SYSROOT}/usr/include)
|
|
||||||
FIND_LIBRARY(OPENGL_gl_LIBRARY GLESv1_CM
|
|
||||||
PATHS
|
|
||||||
${ANDROID_SYSROOT}/usr/lib)
|
|
||||||
ELSEIF(OSG_GLES2_AVAILABLE)
|
|
||||||
FIND_PATH(OPENGL_INCLUDE_DIR GLES2/gl2.h
|
|
||||||
PATHS
|
|
||||||
${ANDROID_SYSROOT}/usr/include)
|
|
||||||
FIND_LIBRARY(OPENGL_gl_LIBRARY GLESv2
|
|
||||||
PATHS
|
|
||||||
${ANDROID_SYSROOT}/usr/lib)
|
|
||||||
ENDIF()
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
|
OPTION(OSG_CPP_EXCEPTIONS_AVAILABLE "Set to OFF to disable compile of OSG components that use C++ exceptions." ON)
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Set Config header file
|
# Set Config file
|
||||||
|
|
||||||
SET(OPENSCENEGRAPH_CONFIG_HEADER "${PROJECT_BINARY_DIR}/include/osg/Config")
|
SET(OPENSCENEGRAPH_CONFIG_HEADER "${PROJECT_BINARY_DIR}/include/osg/Config")
|
||||||
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/src/osg/Config.in"
|
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/src/osg/Config.in"
|
||||||
"${OPENSCENEGRAPH_CONFIG_HEADER}")
|
"${OPENSCENEGRAPH_CONFIG_HEADER}")
|
||||||
|
|
||||||
|
SET(OPENSCENEGRAPH_VERSION_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/include/osg/Version")
|
||||||
################################################################################
|
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/src/osg/Version.in"
|
||||||
# Set OpenGL header file
|
"${OPENSCENEGRAPH_VERSION_HEADER}")
|
||||||
|
|
||||||
INCLUDE (CheckCXXSourceCompiles)
|
|
||||||
#SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${OPENGL_INCLUDE_DIR})
|
|
||||||
|
|
||||||
check_cxx_source_compiles(
|
|
||||||
"${OPENGL_HEADER1}
|
|
||||||
${OPENGL_HEADER2}
|
|
||||||
int main() { GLint64 test; return 0; }"
|
|
||||||
GL_HEADER_HAS_GLINT64
|
|
||||||
)
|
|
||||||
|
|
||||||
check_cxx_source_compiles(
|
|
||||||
"${OPENGL_HEADER1}
|
|
||||||
${OPENGL_HEADER2}
|
|
||||||
int main() { GLuint64 test; return 0; }"
|
|
||||||
GL_HEADER_HAS_GLUINT64
|
|
||||||
)
|
|
||||||
|
|
||||||
SET(OPENSCENEGRAPH_OPENGL_HEADER "${PROJECT_BINARY_DIR}/include/osg/GL")
|
|
||||||
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/src/osg/GL.in"
|
|
||||||
"${OPENSCENEGRAPH_OPENGL_HEADER}")
|
|
||||||
|
|
||||||
# INSTALL_FILES(/include/osg/ FILES "${OPENSCENEGRAPH_CONFIG_HEADER}")
|
# INSTALL_FILES(/include/osg/ FILES "${OPENSCENEGRAPH_CONFIG_HEADER}")
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# Set Version header file
|
|
||||||
|
|
||||||
SET(OPENSCENEGRAPH_VERSION_HEADER "${PROJECT_BINARY_DIR}/include/osg/Version")
|
|
||||||
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/src/osg/Version.in"
|
|
||||||
"${OPENSCENEGRAPH_VERSION_HEADER}")
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Set Version Info resource file
|
# Set Version Info resource file
|
||||||
|
|
||||||
|
|
||||||
IF(MSVC)
|
IF(MSVC)
|
||||||
SET(OPENSCENEGRAPH_VERSIONINFO_RC "${PROJECT_BINARY_DIR}/PlatformSpecifics/Windows/OpenSceneGraphVersionInfo.rc")
|
SET(OPENSCENEGRAPH_VERSIONINFO_RC "${PROJECT_BINARY_DIR}/PlatformSpecifics/Windows/OpenSceneGraphVersionInfo.rc")
|
||||||
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/PlatformSpecifics/Windows/OpenSceneGraphVersionInfo.rc.in"
|
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/PlatformSpecifics/Windows/OpenSceneGraphVersionInfo.rc.in"
|
||||||
@@ -640,18 +446,11 @@ IF(WIN32 AND NOT ANDROID)
|
|||||||
INCLUDE(Find3rdPartyDependencies)
|
INCLUDE(Find3rdPartyDependencies)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
OPTION(OSG_USE_LOCAL_LUA_SOURCE "Enable to use local Lua source when building the lua plugin" ON)
|
|
||||||
|
|
||||||
#
|
|
||||||
# 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)
|
||||||
@@ -662,103 +461,45 @@ ELSE()
|
|||||||
FIND_PACKAGE(OpenVRML)
|
FIND_PACKAGE(OpenVRML)
|
||||||
FIND_PACKAGE(Performer)
|
FIND_PACKAGE(Performer)
|
||||||
FIND_PACKAGE(GDAL)
|
FIND_PACKAGE(GDAL)
|
||||||
FIND_PACKAGE(GTA)
|
|
||||||
FIND_PACKAGE(CURL)
|
FIND_PACKAGE(CURL)
|
||||||
|
FIND_PACKAGE(ITK)
|
||||||
FIND_PACKAGE(LibVNCServer)
|
FIND_PACKAGE(LibVNCServer)
|
||||||
FIND_PACKAGE(OurDCMTK)
|
FIND_PACKAGE(OurDCMTK)
|
||||||
|
FIND_PACKAGE(OpenAL)
|
||||||
FIND_PACKAGE(FFmpeg)
|
FIND_PACKAGE(FFmpeg)
|
||||||
FIND_PACKAGE(GStreamer COMPONENTS app pbutils)
|
|
||||||
FIND_PACKAGE(GLIB COMPONENTS gobject)
|
|
||||||
FIND_PACKAGE(DirectShow)
|
FIND_PACKAGE(DirectShow)
|
||||||
FIND_PACKAGE(SDL2)
|
|
||||||
FIND_PACKAGE(SDL)
|
FIND_PACKAGE(SDL)
|
||||||
FIND_PACKAGE(Poppler-glib)
|
FIND_PACKAGE(Poppler-glib)
|
||||||
FIND_PACKAGE(RSVG)
|
FIND_PACKAGE(RSVG)
|
||||||
FIND_PACKAGE(GtkGl)
|
FIND_PACKAGE(GtkGl)
|
||||||
FIND_PACKAGE(DirectInput)
|
FIND_PACKAGE(DirectInput)
|
||||||
FIND_PACKAGE(NVTT)
|
FIND_PACKAGE(NVTT)
|
||||||
IF (NOT WIN32)
|
|
||||||
FIND_PACKAGE(Asio)
|
|
||||||
ENDIF()
|
|
||||||
FIND_PACKAGE(ZeroConf)
|
|
||||||
|
|
||||||
FIND_PACKAGE(LIBLAS)
|
|
||||||
|
|
||||||
IF (NOT(OSG_USE_LOCAL_LUA_SOURCE))
|
|
||||||
FIND_PACKAGE(Lua52)
|
|
||||||
IF (NOT (LUA_LIBRARIES AND LUA_INCLUDE_DIR))
|
|
||||||
FIND_PACKAGE(Lua51)
|
|
||||||
ENDIF()
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
# V8 and Python plugins are tests for linking against these libraries but aren't functionality beyond this.
|
|
||||||
# FIND_PACKAGE(V8)
|
|
||||||
# FIND_PACKAGE(PythonLibs)
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
IF(CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION LESS 8)
|
|
||||||
FIND_PACKAGE(ITK)
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
# Include macro utilities here
|
# Include macro utilities here
|
||||||
INCLUDE(OsgMacroUtils)
|
INCLUDE(OsgMacroUtils)
|
||||||
|
|
||||||
OPTION(OSG_USE_QT "Enable to use Qt (build Qt-dependent libraries, plugins and examples)" ON)
|
IF(NOT ANDROID)
|
||||||
|
|
||||||
IF(OSG_USE_QT AND NOT ANDROID)
|
|
||||||
# To select a specific version of QT define DESIRED_QT_VERSION
|
# To select a specific version of QT define DESIRED_QT_VERSION
|
||||||
# via cmake -DDESIRED_QT_VERSION=5
|
# via cmake -DDESIRED_QT_VERSION=4
|
||||||
# QUIET option disables messages if the package cannot be found.
|
|
||||||
|
|
||||||
IF (DESIRED_QT_VERSION)
|
IF (DESIRED_QT_VERSION)
|
||||||
IF (DESIRED_QT_VERSION MATCHES 5)
|
|
||||||
FIND_PACKAGE(Qt5Widgets)
|
IF (DESIRED_QT_VERSION MATCHES 4)
|
||||||
ELSEIF (DESIRED_QT_VERSION MATCHES 4)
|
FIND_PACKAGE(Qt4)
|
||||||
FIND_PACKAGE(Qt4)
|
|
||||||
ELSE()
|
ELSE()
|
||||||
FIND_PACKAGE(Qt3)
|
FIND_PACKAGE(Qt3)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
ELSE()
|
ELSE()
|
||||||
|
|
||||||
FIND_PACKAGE(Qt5Widgets QUIET)
|
FIND_PACKAGE(Qt4)
|
||||||
|
|
||||||
IF ( Qt5Widgets_FOUND )
|
IF (NOT QT4_FOUND)
|
||||||
# CMake 2.8.8 or greater required
|
FIND_PACKAGE(Qt3)
|
||||||
BUILDER_VERSION_GREATER(2 8 7)
|
|
||||||
IF(NOT VALID_BUILDER_VERSION)
|
|
||||||
MESSAGE(
|
|
||||||
SEND_ERROR
|
|
||||||
"Qt5 requires CMake version 2.8.8 or greater!\n"
|
|
||||||
"Update CMake or set DESIRED_QT_VERSION to less than 5
|
|
||||||
or disable OSG_USE_QT."
|
|
||||||
)
|
|
||||||
ENDIF( )
|
|
||||||
ENDIF( )
|
|
||||||
|
|
||||||
IF ( NOT Qt5Widgets_FOUND )
|
|
||||||
FIND_PACKAGE(Qt4)
|
|
||||||
|
|
||||||
IF (NOT QT4_FOUND)
|
|
||||||
FIND_PACKAGE(Qt3)
|
|
||||||
ENDIF()
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
ENDIF(NOT ANDROID)
|
||||||
#If we have found Qt5, let's try to top off by getting the webkit as well
|
|
||||||
IF ( Qt5Widgets_FOUND )
|
|
||||||
FIND_PACKAGE(Qt5WebKitWidgets 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()
|
|
||||||
|
|
||||||
#optional example related dependencies
|
#optional example related dependencies
|
||||||
IF (BUILD_OSG_EXAMPLES AND NOT ANDROID)
|
IF (BUILD_OSG_EXAMPLES AND NOT ANDROID)
|
||||||
|
|
||||||
@@ -793,19 +534,16 @@ IF(NOT ANDROID)
|
|||||||
FIND_PACKAGE(JPEG)
|
FIND_PACKAGE(JPEG)
|
||||||
FIND_PACKAGE(PNG)
|
FIND_PACKAGE(PNG)
|
||||||
FIND_PACKAGE(TIFF)
|
FIND_PACKAGE(TIFF)
|
||||||
|
|
||||||
# QuickTime is required for OS X, but optional for Windows.
|
# QuickTime is required for OS X, but optional for Windows.
|
||||||
IF(WIN32)
|
IF(WIN32)
|
||||||
FIND_PACKAGE(QuickTime)
|
FIND_PACKAGE(QuickTime)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
ELSE()
|
ELSE()
|
||||||
FIND_PACKAGE(TIFF)
|
|
||||||
FIND_PACKAGE(QuickTime)
|
FIND_PACKAGE(QuickTime)
|
||||||
FIND_PACKAGE(QTKit)
|
FIND_PACKAGE(QTKit)
|
||||||
FIND_PACKAGE(CoreVideo)
|
FIND_PACKAGE(CoreVideo)
|
||||||
FIND_PACKAGE(CoreMedia)
|
|
||||||
FIND_PACKAGE(QuartzCore)
|
|
||||||
FIND_PACKAGE(AVFoundation)
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
@@ -958,53 +696,24 @@ IF(CMAKE_COMPILER_IS_GNUCXX)
|
|||||||
# errors instead of warnings for certain issues, including superfluous
|
# errors instead of warnings for certain issues, including superfluous
|
||||||
# semicolons and commas, and the use of long long. -fpermissive seems
|
# semicolons and commas, and the use of long long. -fpermissive seems
|
||||||
# to be the workaround.
|
# to be the workaround.
|
||||||
SET(OSG_AGGRESSIVE_WARNING_FLAGS -Wall -Wparentheses -Wno-long-long -Wno-import -pedantic -Wreturn-type -Wmissing-braces -Wunknown-pragmas -Wunused)
|
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
|
||||||
|
|
||||||
|
|
||||||
ELSEIF(MSVC)
|
ELSE()
|
||||||
#disable specific warning level 4 warnings:
|
IF(MSVC)
|
||||||
#C4100 'identifier' : unreferenced formal parameter
|
# FIXME: What are good aggressive warning flags for Visual Studio?
|
||||||
#C4127 Error Message conditional expression is constant
|
# And do we need to further subcase this for different versions of VS?
|
||||||
#C4706 assignment within conditional expression
|
# CMake variables: MSVC60, MSVC70, MSVC71, MSVC80, CMAKE_COMPILER_2005
|
||||||
SET(OSG_AGGRESSIVE_WARNING_FLAGS /W4 /wd4706 /wd4127 /wd4100)
|
SET(OSG_AGGRESSIVE_WARNING_FLAGS /W4 /wd4706 /wd4127 /wd4100)
|
||||||
ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
|
||||||
SET(OSG_AGGRESSIVE_WARNING_FLAGS -Wall -Wparentheses -Wno-long-long -Wno-import -pedantic -Wreturn-type -Wmissing-braces -Wunknown-pragmas -Wunused -Wno-overloaded-virtual)
|
|
||||||
|
|
||||||
|
|
||||||
|
ELSE()
|
||||||
# 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.
|
||||||
|
ENDIF()
|
||||||
IF (APPLE)
|
|
||||||
SET(OSG_CXX_LANGUAGE_STANDARD "C++11" CACHE STRING "set the c++ language standard (C++98 / GNU++98 / C++11) for OSG" )
|
|
||||||
MARK_AS_ADVANCED(OSG_CXX_LANGUAGE_STANDARD)
|
|
||||||
# remove existing flags
|
|
||||||
REMOVE_CXX_FLAG(-std=c++98)
|
|
||||||
REMOVE_CXX_FLAG(-std=gnu++98)
|
|
||||||
REMOVE_CXX_FLAG(-std=c++11)
|
|
||||||
REMOVE_CXX_FLAG(-stdlib=libstdc++)
|
|
||||||
REMOVE_CXX_FLAG(-stdlib=libc++)
|
|
||||||
|
|
||||||
IF(${OSG_CXX_LANGUAGE_STANDARD} STREQUAL "c++98" OR ${OSG_CXX_LANGUAGE_STANDARD} STREQUAL "C++98")
|
|
||||||
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++")
|
|
||||||
ELSE()
|
|
||||||
IF(${OSG_CXX_LANGUAGE_STANDARD} STREQUAL "gnu++98" OR ${OSG_CXX_LANGUAGE_STANDARD} STREQUAL "GNU++98")
|
|
||||||
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "gnu++98")
|
|
||||||
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libstdc++")
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++98 -stdlib=libstdc++")
|
|
||||||
ELSE()
|
|
||||||
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11")
|
|
||||||
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++")
|
|
||||||
ENDIF()
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -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.
|
||||||
@@ -1057,30 +766,19 @@ IF (BUILD_OSG_EXAMPLES)
|
|||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
|
||||||
IF(APPLE AND NOT ANDROID)
|
IF(APPLE)
|
||||||
|
|
||||||
#Here we check if the user specified IPhone SDK
|
#Here we check if the user specified IPhone SDK
|
||||||
IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
|
IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
|
||||||
|
|
||||||
#set iphone arch and flags taken from http://sites.google.com/site/michaelsafyan/coding/resources/how-to-guides/cross-compile-for-the-iphone/how-to-cross-compile-for-the-iphone-using-cmake
|
#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)
|
||||||
IF(${IPHONE_VERSION_MIN} LESS "7.0")
|
SET(CMAKE_OSX_ARCHITECTURES "armv6;armv7" CACHE STRING "Build architectures for iOS" FORCE)
|
||||||
SET(CMAKE_OSX_ARCHITECTURES "armv6;armv7" CACHE STRING "Build architectures for iOS" FORCE)
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -miphoneos-version-min=3.1 -mno-thumb -arch armv6 -pipe -no-cpp-precomp" CACHE STRING "Flags used by the compiler during all build types." FORCE)
|
||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mno-thumb -pipe -no-cpp-precomp" CACHE STRING "Flags used by the compiler during all build types." FORCE)
|
|
||||||
ELSE()
|
|
||||||
SET(CMAKE_OSX_ARCHITECTURES "armv7;armv7s;arm64" CACHE STRING "Build architectures for iOS" FORCE)
|
|
||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -no-cpp-precomp" CACHE STRING "Flags used by the compiler during all build types." FORCE)
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -miphoneos-version-min=${IPHONE_VERSION_MIN}" FORCE)
|
|
||||||
|
|
||||||
ELSE()
|
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)
|
||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mno-thumb -arch i386 -pipe -no-cpp-precomp" CACHE STRING "Flags used by the compiler during all build types." FORCE)
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mno-thumb -arch i386 -pipe -no-cpp-precomp" CACHE STRING "Flags used by the compiler during all build types." FORCE)
|
||||||
|
|
||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mios-simulator-version-min=${IPHONE_VERSION_MIN}" FORCE)
|
|
||||||
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
#here we set the specific iphone sdk version. We can only set either device or simulator sdk. So if you want both you currently have to have two seperate projects
|
#here we set the specific iphone sdk version. We can only set either device or simulator sdk. So if you want both you currently have to have two seperate projects
|
||||||
@@ -1108,23 +806,18 @@ 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" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.9" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.10")
|
# This is really fragile, but CMake doesn't provide the OS system
|
||||||
SET(OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX "imageio" CACHE STRING "Forced imageio default image plugin for OSX" FORCE)
|
# version information we need. (Darwin versions can be changed
|
||||||
# 64 Bit Works, i386,ppc is not supported any more
|
# independently of OS X versions.)
|
||||||
SET(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "Build architectures for OSX" FORCE)
|
# It does look like CMake handles the CMAKE_OSX_SYSROOT automatically.
|
||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.8 -fvisibility-inlines-hidden" CACHE STRING "Flags used by the compiler during all build types." FORCE)
|
IF(EXISTS /Developer/SDKs/MacOSX10.5.sdk)
|
||||||
ELSEIF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.7")
|
# 64-bit compiles are not supported with Carbon. We should enable
|
||||||
SET(OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX "imageio" CACHE STRING "Forced imageio default image plugin for OSX" FORCE)
|
# 64-bit compilation by default once osgviewer has been
|
||||||
# 64 Bit Works, PPC is not supported any more
|
# rewritten with Cocoa.
|
||||||
SET(CMAKE_OSX_ARCHITECTURES "i386;x86_64" CACHE STRING "Build architectures for OSX" FORCE)
|
#SET(CMAKE_OSX_ARCHITECTURES "ppc;i386;ppc64;x86_64" CACHE STRING "Build architectures for OSX" FORCE)
|
||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.7 -fvisibility-inlines-hidden" CACHE STRING "Flags used by the compiler during all build types." FORCE)
|
|
||||||
ELSEIF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.6" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.5")
|
|
||||||
SET(OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX "imageio" CACHE STRING "Forced imageio default image plugin for OSX" FORCE)
|
|
||||||
# 64-bit compiles are not supported with Carbon.
|
|
||||||
SET(CMAKE_OSX_ARCHITECTURES "ppc;i386" CACHE STRING "Build architectures for OSX" FORCE)
|
SET(CMAKE_OSX_ARCHITECTURES "ppc;i386" CACHE STRING "Build architectures for OSX" FORCE)
|
||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.5 -ftree-vectorize -fvisibility-inlines-hidden" CACHE STRING "Flags used by the compiler during all build types." FORCE)
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.5 -ftree-vectorize -fvisibility-inlines-hidden" CACHE STRING "Flags used by the compiler during all build types." FORCE)
|
||||||
ELSEIF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.4")
|
ELSEIF(EXISTS /Developer/SDKs/MacOSX10.4u.sdk)
|
||||||
SET(OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX "quicktime" CACHE STRING "Forced imageio default image plugin for OSX" FORCE)
|
|
||||||
SET(CMAKE_OSX_ARCHITECTURES "ppc;i386" CACHE STRING "Build architectures for OSX" FORCE)
|
SET(CMAKE_OSX_ARCHITECTURES "ppc;i386" CACHE STRING "Build architectures for OSX" FORCE)
|
||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.4 -ftree-vectorize -fvisibility-inlines-hidden" CACHE STRING "Flags used by the compiler during all build types." FORCE)
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.4 -ftree-vectorize -fvisibility-inlines-hidden" CACHE STRING "Flags used by the compiler during all build types." FORCE)
|
||||||
ELSE()
|
ELSE()
|
||||||
@@ -1132,21 +825,21 @@ IF(APPLE AND NOT ANDROID)
|
|||||||
# Should break down further to set the -mmacosx-version-min,
|
# Should break down further to set the -mmacosx-version-min,
|
||||||
# but the SDK detection is too unreliable here.
|
# but the SDK detection is too unreliable here.
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF(NOT OSG_CONFIG_HAS_BEEN_RUN_BEFORE)
|
||||||
|
|
||||||
OPTION(OSG_BUILD_APPLICATION_BUNDLES "Enable the building of applications and examples as OSX Bundles" OFF)
|
OPTION(OSG_BUILD_APPLICATION_BUNDLES "Enable the building of applications and examples as OSX Bundles" OFF)
|
||||||
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
ENDIF()
|
ENDIF(APPLE)
|
||||||
|
|
||||||
|
|
||||||
# For Doxygen
|
# For Doxygen
|
||||||
INCLUDE(${CMAKE_ROOT}/Modules/Documentation.cmake OPTIONAL)
|
INCLUDE(${CMAKE_ROOT}/Modules/Documentation.cmake OPTIONAL)
|
||||||
OPTION(BUILD_DOCUMENTATION "Build OpenSceneGraph reference documentation using doxygen (use: make doc_openscenegraph doc_openthreads)" OFF)
|
OPTION(BUILD_DOCUMENTATION "Build OpenSceneGraph reference documentation using doxygen (use: make DoxygenDoc)" OFF)
|
||||||
MARK_AS_ADVANCED(CLEAR BUILD_DOCUMENTATION)
|
MARK_AS_ADVANCED(CLEAR BUILD_DOCUMENTATION)
|
||||||
# To build the documention, you will have to enable it
|
# To build the documention, you will have to enable it
|
||||||
# and then do the equivalent of "make doc_openscenegraph doc_openthreads".
|
# and then do the equivalent of "make DoxygenDoc".
|
||||||
IF(BUILD_DOCUMENTATION)
|
IF(BUILD_DOCUMENTATION)
|
||||||
|
|
||||||
OPTION(BUILD_REF_DOCS_SEARCHENGINE "Enable doxygen's search engine (requires that documentation to be installed on a php enabled web server)" OFF)
|
OPTION(BUILD_REF_DOCS_SEARCHENGINE "Enable doxygen's search engine (requires that documentation to be installed on a php enabled web server)" OFF)
|
||||||
@@ -1172,12 +865,12 @@ IF(BUILD_DOCUMENTATION)
|
|||||||
# If html help generation was requested. DOCUMENTATION_HTML_HELP is defined by Documentation.cmake
|
# If html help generation was requested. DOCUMENTATION_HTML_HELP is defined by Documentation.cmake
|
||||||
SET(GENERATE_HTMLHELP "NO")
|
SET(GENERATE_HTMLHELP "NO")
|
||||||
IF(DOCUMENTATION_HTML_HELP)
|
IF(DOCUMENTATION_HTML_HELP)
|
||||||
# on windows Documentation.cmake finds the html help workshop if it exists. On u*ix we might have it with wine but no way to point it out
|
# on windows Documentation.cmake finds the html help workshop fi it exists. On u*ix we might have it with wine but no way to point it out
|
||||||
IF(NOT WIN32)
|
IF(NOT WIN32)
|
||||||
SET(HTML_HELP_COMPILER "" CACHE FILEPATH "Enter location of the HTML help compiler to let doxygen compile html")
|
SET(HTML_HELP_COMPILER "" CACHE FILEPATH "Enter location of the HTML help compiler to let doxygen compile html")
|
||||||
MARK_AS_ADVANCED(HTML_HELP_COMPILER)
|
MARK_AS_ADVANCED(HTML_HELP_COMPILER)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
# this var sets a proper value in .doxygen files when configuring them below
|
# this var sets a proper value in .doxygen files when coniguring them below
|
||||||
SET(GENERATE_HTMLHELP "YES")
|
SET(GENERATE_HTMLHELP "YES")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -1234,10 +927,10 @@ IF(BUILD_DOCUMENTATION)
|
|||||||
SET_TARGET_PROPERTIES(doc_openthreads PROPERTIES FOLDER "Documentation")
|
SET_TARGET_PROPERTIES(doc_openthreads PROPERTIES FOLDER "Documentation")
|
||||||
ENDIF(BUILD_DOCUMENTATION)
|
ENDIF(BUILD_DOCUMENTATION)
|
||||||
|
|
||||||
OPTION(BUILD_DASHBOARD_REPORTS "Set to ON to activate reporting of OpenSceneGraph builds here http://cdash.openscenegraph.org/index.php?project=OpenSceneGraph" OFF)
|
OPTION(BUILD_DASHBOARD_REPORTS "Set to ON to activate reporting of OpenSceneGraph builds here http://www.cdash.org/CDashPublic/index.php?project=OpenSceneGraph" OFF)
|
||||||
IF(BUILD_DASHBOARD_REPORTS)
|
IF(BUILD_DASHBOARD_REPORTS)
|
||||||
# The following are required to uses Dart and the Cdash dashboard
|
# The following are required to uses Dart and the Cdash dashboard
|
||||||
# viewable here : http://cdash.openscenegraph.org/index.php?project=OpenSceneGraph
|
# viewable here : http://www.cdash.org/CDashPublic/index.php?project=OpenSceneGraph
|
||||||
INCLUDE(Dart)
|
INCLUDE(Dart)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
@@ -1270,9 +963,9 @@ SET(PKGCONFIG_FILES
|
|||||||
openscenegraph-osgVolume
|
openscenegraph-osgVolume
|
||||||
)
|
)
|
||||||
|
|
||||||
IF(QT4_FOUND OR Qt5Widgets_FOUND )
|
IF(QT4_FOUND)
|
||||||
SET(PKGCONFIG_FILES ${PKGCONFIG_FILES} openscenegraph-osgQt)
|
SET(PKGCONFIG_FILES ${PKGCONFIG_FILES} openscenegraph-osgQt)
|
||||||
ENDIF()
|
ENDIF(QT4_FOUND)
|
||||||
|
|
||||||
FOREACH(PKGCONFIG_FILE ${PKGCONFIG_FILES})
|
FOREACH(PKGCONFIG_FILE ${PKGCONFIG_FILES})
|
||||||
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/packaging/pkgconfig/${PKGCONFIG_FILE}.pc.in
|
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/packaging/pkgconfig/${PKGCONFIG_FILE}.pc.in
|
||||||
@@ -1345,4 +1038,10 @@ ADD_CUSTOM_TARGET(uninstall
|
|||||||
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
|
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
|
||||||
|
|
||||||
#
|
#
|
||||||
|
IF(ANDROID)
|
||||||
|
message(STATUS "Creating Android Makefile Master files" )
|
||||||
|
configure_file("${OSG_ANDROID_TEMPLATES}/Android.mk.master.in" "${CMAKE_BINARY_DIR}/Android.mk")
|
||||||
|
configure_file("${OSG_ANDROID_TEMPLATES}/Application.mk.master.in" "${CMAKE_BINARY_DIR}/Application.mk")
|
||||||
|
configure_file("${OSG_ANDROID_TEMPLATES}/AndroidManifest.xml.master.in" "${CMAKE_BINARY_DIR}/AndroidManifest.xml")
|
||||||
|
ENDIF(ANDROID)
|
||||||
|
|
||||||
|
|||||||
@@ -15,143 +15,123 @@ 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)
|
|
||||||
|
|
||||||
SET(_OPENTHREADS_ATOMIC_USE_BSD_ATOMIC 1)
|
INCLUDE(CheckCXXSourceRuns)
|
||||||
|
|
||||||
ELSE()
|
# Do step by step checking,
|
||||||
INCLUDE(CheckCXXSourceRuns)
|
CHECK_CXX_SOURCE_RUNS("
|
||||||
|
#include <cstdlib>
|
||||||
|
|
||||||
# Do step by step checking,
|
int main()
|
||||||
CHECK_CXX_SOURCE_RUNS("
|
{
|
||||||
#include <cstdlib>
|
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;
|
||||||
|
|
||||||
int main()
|
if (!__sync_bool_compare_and_swap(&ptr, ptr, ptr))
|
||||||
{
|
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;
|
|
||||||
|
|
||||||
if (!__sync_bool_compare_and_swap(&ptr, ptr, ptr))
|
return EXIT_SUCCESS;
|
||||||
return EXIT_FAILURE;
|
}
|
||||||
|
" _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS)
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
CHECK_CXX_SOURCE_RUNS("
|
||||||
}
|
#include <stdlib.h>
|
||||||
" _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS)
|
|
||||||
|
|
||||||
CHECK_CXX_SOURCE_RUNS("
|
int main(int, const char**)
|
||||||
#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;
|
||||||
|
|
||||||
int main(int, const char**)
|
if (!__compare_and_swap((unsigned long*)&ptr, (unsigned long)ptr, (unsigned long)ptr))
|
||||||
{
|
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;
|
|
||||||
|
|
||||||
if (!__compare_and_swap((unsigned long*)&ptr, (unsigned long)ptr, (unsigned long)ptr))
|
return EXIT_SUCCESS;
|
||||||
return EXIT_FAILURE;
|
}
|
||||||
|
" _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS)
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
CHECK_CXX_SOURCE_RUNS("
|
||||||
}
|
#include <atomic.h>
|
||||||
" _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS)
|
#include <cstdlib>
|
||||||
|
|
||||||
CHECK_CXX_SOURCE_RUNS("
|
int main(int, const char**)
|
||||||
#include <atomic.h>
|
{
|
||||||
#include <cstdlib>
|
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;
|
||||||
|
|
||||||
int main(int, const char**)
|
if (ptr != atomic_cas_ptr(&ptr, ptr, ptr))
|
||||||
{
|
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;
|
|
||||||
|
|
||||||
if (ptr != atomic_cas_ptr(&ptr, ptr, ptr))
|
return EXIT_SUCCESS;
|
||||||
return EXIT_FAILURE;
|
}
|
||||||
|
" _OPENTHREADS_ATOMIC_USE_SUN)
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
CHECK_CXX_SOURCE_RUNS("
|
||||||
}
|
#include <windows.h>
|
||||||
" _OPENTHREADS_ATOMIC_USE_SUN)
|
#include <intrin.h>
|
||||||
|
#include <cstdlib>
|
||||||
|
|
||||||
CHECK_CXX_SOURCE_RUNS("
|
#pragma intrinsic(_InterlockedAnd)
|
||||||
#include <windows.h>
|
#pragma intrinsic(_InterlockedOr)
|
||||||
#include <intrin.h>
|
#pragma intrinsic(_InterlockedXor)
|
||||||
#include <cstdlib>
|
|
||||||
|
|
||||||
#pragma intrinsic(_InterlockedAnd)
|
int main(int, const char**)
|
||||||
#pragma intrinsic(_InterlockedOr)
|
{
|
||||||
#pragma intrinsic(_InterlockedXor)
|
volatile long value = 0;
|
||||||
|
long data = 0;
|
||||||
|
long* volatile ptr = &data;
|
||||||
|
|
||||||
int main(int, const char**)
|
InterlockedIncrement(&value);
|
||||||
{
|
MemoryBarrier();
|
||||||
volatile long value = 0;
|
InterlockedDecrement(&value);
|
||||||
long data = 0;
|
|
||||||
long* volatile ptr = &data;
|
|
||||||
|
|
||||||
InterlockedIncrement(&value);
|
if (0 != InterlockedCompareExchange(&value, 1, 0))
|
||||||
MemoryBarrier();
|
return EXIT_FAILURE;
|
||||||
InterlockedDecrement(&value);
|
|
||||||
|
|
||||||
if (0 != InterlockedCompareExchange(&value, 1, 0))
|
if (ptr != InterlockedCompareExchangePointer((PVOID volatile*)&ptr, (PVOID)ptr, (PVOID)ptr))
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
|
||||||
if (ptr != InterlockedCompareExchangePointer((PVOID volatile*)&ptr, (PVOID)ptr, (PVOID)ptr))
|
return EXIT_SUCCESS;
|
||||||
return EXIT_FAILURE;
|
}
|
||||||
|
" _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED)
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
CHECK_CXX_SOURCE_RUNS("
|
||||||
}
|
#include <libkern/OSAtomic.h>
|
||||||
" _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED)
|
|
||||||
|
|
||||||
CHECK_CXX_SOURCE_RUNS("
|
int main()
|
||||||
#include <libkern/OSAtomic.h>
|
{
|
||||||
|
volatile int32_t value = 0;
|
||||||
|
long data = 0;
|
||||||
|
long * volatile ptr = &data;
|
||||||
|
|
||||||
int main()
|
OSAtomicIncrement32(&value);
|
||||||
{
|
OSMemoryBarrier();
|
||||||
volatile int32_t value = 0;
|
OSAtomicDecrement32(&value);
|
||||||
long data = 0;
|
OSAtomicCompareAndSwapInt(value, 1, &value);
|
||||||
long * volatile ptr = &data;
|
OSAtomicCompareAndSwapPtr(ptr, ptr, (void * volatile *)&ptr);
|
||||||
|
}
|
||||||
OSAtomicIncrement32(&value);
|
" _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC)
|
||||||
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,12 +54,12 @@ ENDMACRO(FIND_DEPENDENCY DEPNAME INCLUDEFILE LIBRARY_NAMES_BASE SEARCHPATHLIST D
|
|||||||
|
|
||||||
|
|
||||||
################################################################################################
|
################################################################################################
|
||||||
# this Macro is tailored to Mike and Torbens dependencies
|
# this Macro is tailored to Mike dependencies
|
||||||
################################################################################################
|
################################################################################################
|
||||||
|
|
||||||
MACRO(SEARCH_3RDPARTY OSG_3RDPARTY_BIN)
|
MACRO(SEARCH_3RDPARTY OSG_3RDPARTY_BIN)
|
||||||
FIND_DEPENDENCY(TIFF tiff.h libtiff ${OSG_3RDPARTY_BIN} "D" "_i")
|
FIND_DEPENDENCY(TIFF tiff.h libtiff ${OSG_3RDPARTY_BIN} "D" "_i")
|
||||||
FIND_DEPENDENCY(FREETYPE ft2build.h "freetype;freetype2311MT;freetype234;freetype234MT;freetype235;freetype237;freetype238;freetype244;freetype250;" ${OSG_3RDPARTY_BIN} "d" "")
|
FIND_DEPENDENCY(FREETYPE ft2build.h "freetype;freetype2311MT;freetype234;freetype234MT;freetype235;freetype237;freetype238;freetype244;" ${OSG_3RDPARTY_BIN} "d" "")
|
||||||
IF(FREETYPE_FOUND)
|
IF(FREETYPE_FOUND)
|
||||||
#forcing subsequent FindFreeType stuff to not search for other variables.... kind of a hack
|
#forcing subsequent FindFreeType stuff to not search for other variables.... kind of a hack
|
||||||
SET(FREETYPE_INCLUDE_DIR_ft2build ${FREETYPE_INCLUDE_DIR} CACHE PATH "" FORCE)
|
SET(FREETYPE_INCLUDE_DIR_ft2build ${FREETYPE_INCLUDE_DIR} CACHE PATH "" FORCE)
|
||||||
@@ -79,14 +79,14 @@ MACRO(SEARCH_3RDPARTY OSG_3RDPARTY_BIN)
|
|||||||
FIND_DEPENDENCY(GIFLIB gif_lib.h "ungif;libungif;giflib" ${OSG_3RDPARTY_BIN} "D" "")
|
FIND_DEPENDENCY(GIFLIB gif_lib.h "ungif;libungif;giflib" ${OSG_3RDPARTY_BIN} "D" "")
|
||||||
FIND_DEPENDENCY(ZLIB zlib.h "z;zlib;zlib1" ${OSG_3RDPARTY_BIN} "D" "")
|
FIND_DEPENDENCY(ZLIB zlib.h "z;zlib;zlib1" ${OSG_3RDPARTY_BIN} "D" "")
|
||||||
IF(ZLIB_FOUND)
|
IF(ZLIB_FOUND)
|
||||||
FIND_DEPENDENCY(PNG png.h "libpng;libpng13;libpng15;libpng16" ${OSG_3RDPARTY_BIN} "D" "")
|
FIND_DEPENDENCY(PNG png.h "libpng;libpng13;libpng15" ${OSG_3RDPARTY_BIN} "D" "")
|
||||||
IF(PNG_FOUND)
|
IF(PNG_FOUND)
|
||||||
#forcing subsequent FindPNG stuff to not search for other variables.... kind of a hack
|
#forcing subsequent FindPNG stuff to not search for other variables.... kind of a hack
|
||||||
SET(PNG_PNG_INCLUDE_DIR ${PNG_INCLUDE_DIR} CACHE FILEPATH "")
|
SET(PNG_PNG_INCLUDE_DIR ${PNG_INCLUDE_DIR} CACHE FILEPATH "")
|
||||||
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 libxml2 "libxml2" ${OSG_3RDPARTY_BIN} "D" "")
|
FIND_DEPENDENCY(LIBXML2 libxml "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)
|
||||||
|
|||||||
@@ -1,40 +0,0 @@
|
|||||||
# Locate Apple AVFoundation (next-generation QTKit)
|
|
||||||
# This module defines
|
|
||||||
# AV_FOUNDATION_LIBRARY
|
|
||||||
# AV_FOUNDATION_FOUND, if false, do not try to link to gdal
|
|
||||||
#
|
|
||||||
# $AV_FOUNDATION_DIR is an environment variable that would
|
|
||||||
# correspond to the ./configure --prefix=$AV_FOUNDATION_DIR
|
|
||||||
#
|
|
||||||
# Created by Stephan Maximilian Huber
|
|
||||||
|
|
||||||
|
|
||||||
IF(APPLE)
|
|
||||||
FIND_LIBRARY(AV_FOUNDATION_LIBRARY AVFoundation)
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
SET(AV_FOUNDATION_FOUND "NO")
|
|
||||||
IF(AV_FOUNDATION_LIBRARY)
|
|
||||||
SET(AV_FOUNDATION_FOUND "YES")
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
|
|
||||||
# AVFoundation exists ON iOS, too -- good support for SDK 6.0 and greater
|
|
||||||
IF(${IPHONE_SDKVER} LESS "6.0")
|
|
||||||
SET(AV_FOUNDATION_FOUND "NO")
|
|
||||||
ELSE()
|
|
||||||
SET(AV_FOUNDATION_FOUND "YES")
|
|
||||||
ENDIF()
|
|
||||||
ELSE()
|
|
||||||
IF(APPLE)
|
|
||||||
# AVFoundation exists since 10.7, but only 10.8 has all features necessary for OSG
|
|
||||||
# so check the SDK-setting
|
|
||||||
|
|
||||||
IF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.8" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.9" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.10")
|
|
||||||
# nothing special here ;-)
|
|
||||||
ELSE()
|
|
||||||
MESSAGE("AVFoundation disabled for SDK < 10.8")
|
|
||||||
SET(AV_FOUNDATION_FOUND "NO")
|
|
||||||
ENDIF()
|
|
||||||
ENDIF()
|
|
||||||
ENDIF()
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
# Locate ASIO-headers (http://think-async.com/Asio)
|
|
||||||
# This module defines
|
|
||||||
# ASIO_FOUND, if false, do not try to link to gdal
|
|
||||||
# ASIO_INCLUDE_DIR, where to find the headers
|
|
||||||
#
|
|
||||||
# Created by Stephan Maximilian Huber
|
|
||||||
|
|
||||||
FIND_PATH(ASIO_INCLUDE_DIR
|
|
||||||
NAMES
|
|
||||||
asio.hpp
|
|
||||||
PATHS
|
|
||||||
/usr/include
|
|
||||||
/usr/local/include
|
|
||||||
)
|
|
||||||
|
|
||||||
SET(ASIO_FOUND "NO")
|
|
||||||
IF(ASIO_INCLUDE_DIR)
|
|
||||||
FIND_PACKAGE( Boost 1.37 )
|
|
||||||
IF(Boost_FOUND)
|
|
||||||
SET(ASIO_FOUND "YES")
|
|
||||||
ENDIF()
|
|
||||||
ENDIF()
|
|
||||||
@@ -18,9 +18,9 @@
|
|||||||
SET( COLLADA_ENV_VAR_AVAILABLE $ENV{COLLADA_DIR} )
|
SET( COLLADA_ENV_VAR_AVAILABLE $ENV{COLLADA_DIR} )
|
||||||
IF ( COLLADA_ENV_VAR_AVAILABLE )
|
IF ( COLLADA_ENV_VAR_AVAILABLE )
|
||||||
SET(COLLADA_DOM_ROOT "$ENV{COLLADA_DIR}/dom" CACHE PATH "Location of Collada DOM directory" FORCE)
|
SET(COLLADA_DOM_ROOT "$ENV{COLLADA_DIR}/dom" CACHE PATH "Location of Collada DOM directory" FORCE)
|
||||||
ELSE ()
|
ELSE ( COLLADA_ENV_VAR_AVAILABLE )
|
||||||
SET(COLLADA_DOM_ROOT "${ACTUAL_3DPARTY_DIR}/include/1.4/dom" CACHE PATH "Location of Collada DOM directory" FORCE)
|
SET(COLLADA_DOM_ROOT "${ACTUAL_3DPARTY_DIR}/include/1.4/dom" CACHE PATH "Location of Collada DOM directory" FORCE)
|
||||||
ENDIF()
|
ENDIF( COLLADA_ENV_VAR_AVAILABLE )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -28,12 +28,6 @@ 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)
|
|
||||||
SET(COLLADA_BUILDNAME "vc10")
|
|
||||||
ELSEIF(MSVC90)
|
ELSEIF(MSVC90)
|
||||||
SET(COLLADA_BUILDNAME "vc9")
|
SET(COLLADA_BUILDNAME "vc9")
|
||||||
ELSEIF(MSVC80)
|
ELSEIF(MSVC80)
|
||||||
@@ -53,7 +47,6 @@ FIND_PATH(COLLADA_INCLUDE_DIR dae.h
|
|||||||
/usr/local/include
|
/usr/local/include
|
||||||
/usr/local/include/colladadom
|
/usr/local/include/colladadom
|
||||||
/usr/local/include/collada-dom
|
/usr/local/include/collada-dom
|
||||||
/opt/local/include/collada-dom
|
|
||||||
/usr/include/
|
/usr/include/
|
||||||
/usr/include/colladadom
|
/usr/include/colladadom
|
||||||
/usr/include/collada-dom
|
/usr/include/collada-dom
|
||||||
@@ -66,10 +59,9 @@ FIND_PATH(COLLADA_INCLUDE_DIR dae.h
|
|||||||
)
|
)
|
||||||
|
|
||||||
FIND_LIBRARY(COLLADA_DYNAMIC_LIBRARY
|
FIND_LIBRARY(COLLADA_DYNAMIC_LIBRARY
|
||||||
NAMES collada_dom collada14dom Collada14Dom libcollada14dom21 libcollada14dom22 collada-dom2.4-dp
|
NAMES collada_dom collada14dom Collada14Dom libcollada14dom21 libcollada14dom22
|
||||||
PATHS
|
PATHS
|
||||||
${COLLADA_DOM_ROOT}/build/${COLLADA_BUILDNAME}-1.4
|
${COLLADA_DOM_ROOT}/build/${COLLADA_BUILDNAME}-1.4
|
||||||
${COLLADA_DOM_ROOT}
|
|
||||||
$ENV{COLLADA_DIR}/build/${COLLADA_BUILDNAME}-1.4
|
$ENV{COLLADA_DIR}/build/${COLLADA_BUILDNAME}-1.4
|
||||||
$ENV{COLLADA_DIR}/lib
|
$ENV{COLLADA_DIR}/lib
|
||||||
$ENV{COLLADA_DIR}/lib-dbg
|
$ENV{COLLADA_DIR}/lib-dbg
|
||||||
@@ -90,10 +82,9 @@ FIND_LIBRARY(COLLADA_DYNAMIC_LIBRARY
|
|||||||
)
|
)
|
||||||
|
|
||||||
FIND_LIBRARY(COLLADA_DYNAMIC_LIBRARY_DEBUG
|
FIND_LIBRARY(COLLADA_DYNAMIC_LIBRARY_DEBUG
|
||||||
NAMES collada_dom-d collada14dom-d Collada14Dom-d libcollada14dom21-d libcollada14dom22-d collada-dom2.4-dp-d
|
NAMES collada_dom-d collada14dom-d Collada14Dom-d libcollada14dom21-d libcollada14dom22-d
|
||||||
PATHS
|
PATHS
|
||||||
${COLLADA_DOM_ROOT}/build/${COLLADA_BUILDNAME}-1.4-d
|
${COLLADA_DOM_ROOT}/build/${COLLADA_BUILDNAME}-1.4-d
|
||||||
${COLLADA_DOM_ROOT}
|
|
||||||
$ENV{COLLADA_DIR}/build/${COLLADA_BUILDNAME}-1.4-d
|
$ENV{COLLADA_DIR}/build/${COLLADA_BUILDNAME}-1.4-d
|
||||||
$ENV{COLLADA_DIR}/lib
|
$ENV{COLLADA_DIR}/lib
|
||||||
$ENV{COLLADA_DIR}/lib-dbg
|
$ENV{COLLADA_DIR}/lib-dbg
|
||||||
@@ -244,7 +235,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-${COLLADA_BUILDNAME}0-mt libboost_filesystem-${COLLADA_BUILDNAME}0-mt-1_54 libboost_filesystem-${COLLADA_BUILDNAME}0-mt-1_55
|
NAMES libboost_filesystem boost_filesystem libboost_filesystem-vc90-mt libboost_filesystem-vc100-mt
|
||||||
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
|
||||||
@@ -252,7 +243,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-${COLLADA_BUILDNAME}0-mt-gd libboost_filesystem-${COLLADA_BUILDNAME}0-mt-gd-1_54 libboost_filesystem-${COLLADA_BUILDNAME}0-mt-gd-1_55
|
NAMES libboost_filesystem-d boost_filesystem-d libboost_filesystem-vc90-mt-gd libboost_filesystem-vc100-mt-gd
|
||||||
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
|
||||||
@@ -260,7 +251,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-${COLLADA_BUILDNAME}0-mt libboost_system-${COLLADA_BUILDNAME}0-mt-1_54 libboost_system-${COLLADA_BUILDNAME}0-mt-1_55
|
NAMES libboost_system boost_system libboost_system-vc90-mt libboost_system-vc100-mt
|
||||||
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
|
||||||
@@ -268,7 +259,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-${COLLADA_BUILDNAME}0-mt-gd libboost_system-${COLLADA_BUILDNAME}0-mt-gd-1_54 libboost_system-${COLLADA_BUILDNAME}0-mt-gd-1_55
|
NAMES libboost_system-d boost_system-d libboost_system-vc90-mt-gd libboost_system-vc100-mt-gd
|
||||||
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
|
||||||
@@ -279,20 +270,6 @@ FIND_LIBRARY(COLLADA_STATIC_LIBRARY_DEBUG
|
|||||||
SET(COLLADA_FOUND "NO")
|
SET(COLLADA_FOUND "NO")
|
||||||
IF(COLLADA_DYNAMIC_LIBRARY OR COLLADA_STATIC_LIBRARY)
|
IF(COLLADA_DYNAMIC_LIBRARY OR COLLADA_STATIC_LIBRARY)
|
||||||
IF (COLLADA_INCLUDE_DIR)
|
IF (COLLADA_INCLUDE_DIR)
|
||||||
|
|
||||||
SET(COLLADA_FOUND "YES")
|
SET(COLLADA_FOUND "YES")
|
||||||
|
ENDIF(COLLADA_INCLUDE_DIR)
|
||||||
FIND_PATH(COLLADA_INCLUDE_DOMANY_DIR 1.4/dom/domAny.h
|
ENDIF(COLLADA_DYNAMIC_LIBRARY OR COLLADA_STATIC_LIBRARY)
|
||||||
${COLLADA_INCLUDE_DIR}
|
|
||||||
)
|
|
||||||
|
|
||||||
IF (COLLADA_INCLUDE_DOMANY_DIR)
|
|
||||||
SET(COLLADA_DOM_2_4_OR_LATER TRUE)
|
|
||||||
ELSEIF()
|
|
||||||
SET(COLLADA_DOM_2_4_OR_LATER FALSE)
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
ENDIF()
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
# Locate Apple CoreMedia
|
|
||||||
# This module defines
|
|
||||||
# COREMEDIA_LIBRARY
|
|
||||||
# COREMEDIA_FOUND, if false, do not try to link to gdal
|
|
||||||
# COREMEDIA_INCLUDE_DIR, where to find the headers
|
|
||||||
#
|
|
||||||
# $COREMEDIA_DIR is an environment variable that would
|
|
||||||
# correspond to the ./configure --prefix=$COREMEDIA_DIR
|
|
||||||
#
|
|
||||||
# Created by Stephan Maximilian Huber.
|
|
||||||
|
|
||||||
|
|
||||||
IF(APPLE)
|
|
||||||
FIND_PATH(COREMEDIA_INCLUDE_DIR CoreMedia/CoreMedia.h)
|
|
||||||
FIND_LIBRARY(COREMEDIA_LIBRARY CoreMedia)
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
|
|
||||||
SET(COREMEDIA_FOUND "NO")
|
|
||||||
IF(COREMEDIA_LIBRARY AND COREMEDIA_INCLUDE_DIR)
|
|
||||||
SET(COREMEDIA_FOUND "YES")
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
@@ -16,12 +16,8 @@ ELSEIF(MSVC80)
|
|||||||
SET(FBX_LIBDIR "vs2005")
|
SET(FBX_LIBDIR "vs2005")
|
||||||
ELSEIF(MSVC90)
|
ELSEIF(MSVC90)
|
||||||
SET(FBX_LIBDIR "vs2008")
|
SET(FBX_LIBDIR "vs2008")
|
||||||
ELSEIF(MSVC10)
|
ELSEIF(MSVC100 OR MSVC_VER>1600)
|
||||||
SET(FBX_LIBDIR "vs2010")
|
SET(FBX_LIBDIR "vs2010")
|
||||||
ELSEIF(MSVC11)
|
|
||||||
SET(FBX_LIBDIR "vs2012")
|
|
||||||
ELSEIF(MSVC12 OR MSVC_VERSION>1800)
|
|
||||||
SET(FBX_LIBDIR "vs2013")
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(APPLE)
|
IF(APPLE)
|
||||||
@@ -34,29 +30,22 @@ 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 "fbxsdk-2012.1-static")
|
||||||
ELSEIF(CMAKE_COMPILER_IS_GNUCXX)
|
ELSEIF(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
SET(FBX_LIBNAME "fbxsdk")
|
SET(FBX_LIBNAME "fbxsdk-2012.1-static")
|
||||||
ELSE()
|
ELSE()
|
||||||
SET(FBX_LIBNAME "libfbxsdk-md")
|
SET(FBX_LIBNAME "fbxsdk-2012.1-md")
|
||||||
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/2015.1"
|
$ENV{ProgramW6432}/Autodesk/FBX/FbxSdk/2012.1
|
||||||
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2015.1"
|
$ENV{PROGRAMFILES}/Autodesk/FBX/FbxSdk/2012.1
|
||||||
/Applications/Autodesk/FBXSDK20151
|
/Applications/Autodesk/FBXSDK20121
|
||||||
"$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2014.2"
|
|
||||||
"$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2014.2"
|
|
||||||
/Applications/Autodesk/FBXSDK20142
|
|
||||||
/Applications/Autodesk/FBXSDK20141
|
|
||||||
)
|
)
|
||||||
#I think the last line in the search path is an old typo, but let's search for 2014.1 anyway - LV
|
|
||||||
|
|
||||||
# search for headers & debug/release libraries
|
# search for headers & debug/release libraries
|
||||||
FIND_PATH(FBX_INCLUDE_DIR "fbxsdk.h"
|
FIND_PATH(FBX_INCLUDE_DIR "fbxsdk.h"
|
||||||
@@ -64,14 +53,7 @@ FIND_PATH(FBX_INCLUDE_DIR "fbxsdk.h"
|
|||||||
PATH_SUFFIXES "include")
|
PATH_SUFFIXES "include")
|
||||||
FIND_LIBRARY( FBX_LIBRARY ${FBX_LIBNAME}
|
FIND_LIBRARY( FBX_LIBRARY ${FBX_LIBNAME}
|
||||||
PATHS ${FBX_SEARCH_PATHS}
|
PATHS ${FBX_SEARCH_PATHS}
|
||||||
PATH_SUFFIXES "lib/${FBX_LIBDIR}/release" "lib/${FBX_LIBDIR}")
|
PATH_SUFFIXES "lib/${FBX_LIBDIR}")
|
||||||
|
|
||||||
#Once one of the calls succeeds the result variable will be set and stored in the cache so that no call will search again.
|
|
||||||
|
|
||||||
#no debug d suffix, search in debug folder only
|
|
||||||
FIND_LIBRARY( FBX_LIBRARY_DEBUG ${FBX_LIBNAME}
|
|
||||||
PATHS ${FBX_SEARCH_PATHS}
|
|
||||||
PATH_SUFFIXES "lib/${FBX_LIBDIR}/debug")
|
|
||||||
FIND_LIBRARY( FBX_LIBRARY_DEBUG ${FBX_LIBNAME_DEBUG}
|
FIND_LIBRARY( FBX_LIBRARY_DEBUG ${FBX_LIBNAME_DEBUG}
|
||||||
PATHS ${FBX_SEARCH_PATHS}
|
PATHS ${FBX_SEARCH_PATHS}
|
||||||
PATH_SUFFIXES "lib/${FBX_LIBDIR}")
|
PATH_SUFFIXES "lib/${FBX_LIBDIR}")
|
||||||
@@ -81,79 +63,3 @@ IF(FBX_LIBRARY AND FBX_LIBRARY_DEBUG AND FBX_INCLUDE_DIR)
|
|||||||
ELSE()
|
ELSE()
|
||||||
SET(FBX_FOUND "NO")
|
SET(FBX_FOUND "NO")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(NOT FBX_FOUND)
|
|
||||||
#try to use 2014.1 version
|
|
||||||
IF(APPLE)
|
|
||||||
SET(FBX_LIBNAME "fbxsdk-2014.1")
|
|
||||||
ELSEIF(CMAKE_COMPILER_IS_GNUCXX)
|
|
||||||
SET(FBX_LIBNAME "fbxsdk-2014.1")
|
|
||||||
ELSE()
|
|
||||||
SET(FBX_LIBNAME "fbxsdk-2014.1")
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
SET(FBX_LIBNAME_DEBUG ${FBX_LIBNAME}d)
|
|
||||||
|
|
||||||
SET( FBX_SEARCH_PATHS
|
|
||||||
$ENV{FBX_DIR}
|
|
||||||
$ENV{ProgramW6432}/Autodesk/FBX/FBX SDK/2014.1
|
|
||||||
$ENV{PROGRAMFILES}/Autodesk/FBX/FBX SDK/2014.1
|
|
||||||
/Applications/Autodesk/FBXSDK20141
|
|
||||||
)
|
|
||||||
|
|
||||||
# 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()
|
|
||||||
|
|
||||||
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()
|
|
||||||
|
|||||||
@@ -11,11 +11,10 @@
|
|||||||
|
|
||||||
|
|
||||||
#In ffmpeg code, old version use "#include <header.h>" and newer use "#include <libname/header.h>"
|
#In ffmpeg code, old version use "#include <header.h>" and newer use "#include <libname/header.h>"
|
||||||
#In OSG ffmpeg plugin, we used "#include <header.h>" for compatibility with old version of ffmpeg
|
#In OSG ffmpeg plugin, we use "#include <header.h>" for compatibility with old version of ffmpeg
|
||||||
#With the new version of FFmpeg, a file named "time.h" was added that breaks compatability with the old version of ffmpeg.
|
|
||||||
|
|
||||||
#We have to search the path which contain the header.h (useful for old version)
|
#We have to search the path which contain the header.h (usefull for old version)
|
||||||
#and search the path which contain the libname/header.h (useful for new version)
|
#and search the path which contain the libname/header.h (usefull for new version)
|
||||||
|
|
||||||
#Then we need to include ${FFMPEG_libname_INCLUDE_DIRS} (in old version case, use by ffmpeg header and osg plugin code)
|
#Then we need to include ${FFMPEG_libname_INCLUDE_DIRS} (in old version case, use by ffmpeg header and osg plugin code)
|
||||||
# (in new version case, use by ffmpeg header)
|
# (in new version case, use by ffmpeg header)
|
||||||
@@ -32,8 +31,6 @@ MACRO(FFMPEG_FIND varname shortname headername)
|
|||||||
PATHS
|
PATHS
|
||||||
${FFMPEG_ROOT}/include
|
${FFMPEG_ROOT}/include
|
||||||
$ENV{FFMPEG_DIR}/include
|
$ENV{FFMPEG_DIR}/include
|
||||||
${FFMPEG_ROOT}
|
|
||||||
$ENV{FFMPEG_DIR}
|
|
||||||
~/Library/Frameworks
|
~/Library/Frameworks
|
||||||
/Library/Frameworks
|
/Library/Frameworks
|
||||||
/usr/local/include
|
/usr/local/include
|
||||||
@@ -51,8 +48,6 @@ MACRO(FFMPEG_FIND varname shortname headername)
|
|||||||
PATHS
|
PATHS
|
||||||
${FFMPEG_ROOT}/include
|
${FFMPEG_ROOT}/include
|
||||||
$ENV{FFMPEG_DIR}/include
|
$ENV{FFMPEG_DIR}/include
|
||||||
${FFMPEG_ROOT}
|
|
||||||
$ENV{FFMPEG_DIR}
|
|
||||||
~/Library/Frameworks
|
~/Library/Frameworks
|
||||||
/Library/Frameworks
|
/Library/Frameworks
|
||||||
/usr/local/include
|
/usr/local/include
|
||||||
@@ -71,8 +66,6 @@ MACRO(FFMPEG_FIND varname shortname headername)
|
|||||||
PATHS
|
PATHS
|
||||||
${FFMPEG_ROOT}/lib
|
${FFMPEG_ROOT}/lib
|
||||||
$ENV{FFMPEG_DIR}/lib
|
$ENV{FFMPEG_DIR}/lib
|
||||||
${FFMPEG_ROOT}/lib${shortname}
|
|
||||||
$ENV{FFMPEG_DIR}/lib${shortname}
|
|
||||||
~/Library/Frameworks
|
~/Library/Frameworks
|
||||||
/Library/Frameworks
|
/Library/Frameworks
|
||||||
/usr/local/lib
|
/usr/local/lib
|
||||||
@@ -129,29 +122,29 @@ FFMPEG_FIND(LIBAVFORMAT avformat avformat.h)
|
|||||||
FFMPEG_FIND(LIBAVDEVICE avdevice avdevice.h)
|
FFMPEG_FIND(LIBAVDEVICE avdevice avdevice.h)
|
||||||
FFMPEG_FIND(LIBAVCODEC avcodec avcodec.h)
|
FFMPEG_FIND(LIBAVCODEC avcodec avcodec.h)
|
||||||
FFMPEG_FIND(LIBAVUTIL avutil avutil.h)
|
FFMPEG_FIND(LIBAVUTIL avutil avutil.h)
|
||||||
FFMPEG_FIND(LIBSWRESAMPLE swresample swresample.h)
|
|
||||||
FFMPEG_FIND(LIBAVRESAMPLE avresample avresample.h)
|
|
||||||
FFMPEG_FIND(LIBSWSCALE swscale swscale.h) # not sure about the header to look for here.
|
FFMPEG_FIND(LIBSWSCALE swscale swscale.h) # not sure about the header to look for here.
|
||||||
|
|
||||||
SET(FFMPEG_FOUND "NO")
|
SET(FFMPEG_FOUND "NO")
|
||||||
# Note we don't check FFMPEG_LIBSWSCALE_FOUND here, it's optional.
|
# Note we don't check FFMPEG_LIBSWSCALE_FOUND here, it's optional.
|
||||||
IF (FFMPEG_LIBAVFORMAT_FOUND AND FFMPEG_LIBAVDEVICE_FOUND AND FFMPEG_LIBAVCODEC_FOUND AND FFMPEG_LIBAVUTIL_FOUND AND STDINT_OK
|
IF (FFMPEG_LIBAVFORMAT_FOUND AND FFMPEG_LIBAVDEVICE_FOUND AND FFMPEG_LIBAVCODEC_FOUND AND FFMPEG_LIBAVUTIL_FOUND AND STDINT_OK)
|
||||||
AND ( FFMPEG_LIBSWRESAMPLE_FOUND OR FFMPEG_LIBAVRESAMPLE_FOUND ) )
|
|
||||||
|
|
||||||
SET(FFMPEG_FOUND "YES")
|
SET(FFMPEG_FOUND "YES")
|
||||||
|
|
||||||
SET(FFMPEG_INCLUDE_DIRS
|
SET(FFMPEG_INCLUDE_DIRS
|
||||||
${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS}
|
${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS} ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS}/libavformat
|
||||||
${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS}
|
${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS} ${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS}/libavdevice
|
||||||
${FFMPEG_LIBAVCODEC_INCLUDE_DIRS}
|
${FFMPEG_LIBAVCODEC_INCLUDE_DIRS} ${FFMPEG_LIBAVCODEC_INCLUDE_DIRS}/libavcodec
|
||||||
${FFMPEG_LIBAVUTIL_INCLUDE_DIRS}
|
${FFMPEG_LIBAVUTIL_INCLUDE_DIRS} ${FFMPEG_LIBAVUTIL_INCLUDE_DIRS}/libavutil
|
||||||
)
|
)
|
||||||
|
|
||||||
# Using the new include style for FFmpeg prevents issues with #include <time.h>
|
|
||||||
IF (FFMPEG_STDINT_INCLUDE_DIR)
|
IF (FFMPEG_STDINT_INCLUDE_DIR)
|
||||||
SET(FFMPEG_INCLUDE_DIRS
|
SET(FFMPEG_INCLUDE_DIRS
|
||||||
${FFMPEG_INCLUDE_DIRS}
|
${FFMPEG_INCLUDE_DIRS}
|
||||||
${FFMPEG_STDINT_INCLUDE_DIR}
|
${FFMPEG_STDINT_INCLUDE_DIR}
|
||||||
|
${FFMPEG_STDINT_INCLUDE_DIR}/libavformat
|
||||||
|
${FFMPEG_STDINT_INCLUDE_DIR}/libavdevice
|
||||||
|
${FFMPEG_STDINT_INCLUDE_DIR}/libavcodec
|
||||||
|
${FFMPEG_STDINT_INCLUDE_DIR}/libavutil
|
||||||
)
|
)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
|||||||
@@ -9,15 +9,6 @@
|
|||||||
#
|
#
|
||||||
# Created by Robert Osfield.
|
# Created by Robert Osfield.
|
||||||
|
|
||||||
# prefer FindFLTK from cmake distribution
|
|
||||||
if(EXISTS ${CMAKE_ROOT}/Modules/FindFLTK.cmake)
|
|
||||||
include(${CMAKE_ROOT}/Modules/FindFLTK.cmake)
|
|
||||||
|
|
||||||
if(FLTK_FOUND)
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
FIND_PATH(FLTK_INCLUDE_DIR Fl/Fl.H Fl/Fl.h
|
FIND_PATH(FLTK_INCLUDE_DIR Fl/Fl.H Fl/Fl.h
|
||||||
$ENV{FLTK_DIR}/include
|
$ENV{FLTK_DIR}/include
|
||||||
$ENV{FLTK_DIR}
|
$ENV{FLTK_DIR}
|
||||||
|
|||||||
@@ -12,15 +12,6 @@
|
|||||||
# used in building FREETYPE.
|
# used in building FREETYPE.
|
||||||
# Created by Eric Wing.
|
# Created by Eric Wing.
|
||||||
|
|
||||||
# prefer FindFreetype from cmake distribution
|
|
||||||
if(EXISTS ${CMAKE_ROOT}/Modules/FindFreetype.cmake)
|
|
||||||
include(${CMAKE_ROOT}/Modules/FindFreetype.cmake)
|
|
||||||
|
|
||||||
if(FREETYPE_FOUND)
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Ugh, FreeType seems to use some #include trickery which
|
# Ugh, FreeType seems to use some #include trickery which
|
||||||
# makes this harder than it should be. It looks like they
|
# makes this harder than it should be. It looks like they
|
||||||
# put ft2build.h in a common/easier-to-find location which
|
# put ft2build.h in a common/easier-to-find location which
|
||||||
@@ -33,7 +24,6 @@ endif()
|
|||||||
# wants explicit full paths and this trickery doesn't work too well.
|
# wants explicit full paths and this trickery doesn't work too well.
|
||||||
# I'm going to attempt to cut out the middleman and hope
|
# I'm going to attempt to cut out the middleman and hope
|
||||||
# everything still works.
|
# everything still works.
|
||||||
|
|
||||||
FIND_PATH(FREETYPE_INCLUDE_DIR_ft2build ft2build.h
|
FIND_PATH(FREETYPE_INCLUDE_DIR_ft2build ft2build.h
|
||||||
PATHS
|
PATHS
|
||||||
$ENV{FREETYPE_DIR}
|
$ENV{FREETYPE_DIR}
|
||||||
@@ -58,7 +48,7 @@ FIND_PATH(FREETYPE_INCLUDE_DIR_ft2build ft2build.h
|
|||||||
/opt/csw
|
/opt/csw
|
||||||
/opt
|
/opt
|
||||||
/usr/freeware
|
/usr/freeware
|
||||||
PATH_SUFFIXES include include/freetype2
|
PATH_SUFFIXES include
|
||||||
)
|
)
|
||||||
|
|
||||||
FIND_PATH(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h
|
FIND_PATH(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h
|
||||||
@@ -84,20 +74,6 @@ 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
|
||||||
@@ -19,15 +19,6 @@
|
|||||||
# This makes the presumption that you are include gdal.h like
|
# This makes the presumption that you are include gdal.h like
|
||||||
# #include "gdal.h"
|
# #include "gdal.h"
|
||||||
|
|
||||||
# prefer FindGDAL from cmake distribution
|
|
||||||
if(EXISTS ${CMAKE_ROOT}/Modules/FindGDAL.cmake)
|
|
||||||
include(${CMAKE_ROOT}/Modules/FindGDAL.cmake)
|
|
||||||
|
|
||||||
if(GDAL_FOUND)
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
FIND_PATH(GDAL_INCLUDE_DIR gdal.h
|
FIND_PATH(GDAL_INCLUDE_DIR gdal.h
|
||||||
PATHS
|
PATHS
|
||||||
$ENV{GDAL_DIR}
|
$ENV{GDAL_DIR}
|
||||||
|
|||||||
@@ -1,36 +0,0 @@
|
|||||||
# Finds the OpenGL Core Profile (cp) header file.
|
|
||||||
# Looks for glcorearb.h
|
|
||||||
#
|
|
||||||
# This script defines the following:
|
|
||||||
# GLCORE_FOUND // Set to TRUE if glcorearb.h is found
|
|
||||||
# GLCORE_INCLUDE_DIR // Parent directory of directory (gl, GL3, or OpenGL) containing the CP header.
|
|
||||||
# GLCORE_GLCOREARB_HEADER // advanced
|
|
||||||
#
|
|
||||||
# GLCORE_ROOT can be set as an environment variable or a CMake variable,
|
|
||||||
# to the parent directory of the gl, GL3, or OpenGL directory containing the CP header.
|
|
||||||
#
|
|
||||||
|
|
||||||
|
|
||||||
FIND_PATH( GLCORE_GLCOREARB_HEADER
|
|
||||||
NAMES GL/glcorearb.h GL3/glcorearb.h OpenGL/glcorearb.h gl/glcorearb.h
|
|
||||||
HINTS ${GLCORE_ROOT}
|
|
||||||
PATHS ENV GLCORE_ROOT
|
|
||||||
)
|
|
||||||
|
|
||||||
set( GLCORE_INCLUDE_DIR )
|
|
||||||
if( GLCORE_GLCOREARB_HEADER )
|
|
||||||
set( GLCORE_INCLUDE_DIR ${GLCORE_GLCOREARB_HEADER} )
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
# handle the QUIETLY and REQUIRED arguments and set
|
|
||||||
# GLCORE_FOUND to TRUE as appropriate
|
|
||||||
INCLUDE( FindPackageHandleStandardArgs )
|
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS( GLCORE
|
|
||||||
"Set GLCORE_ROOT as the parent of the directory containing the OpenGL core profile header."
|
|
||||||
GLCORE_INCLUDE_DIR )
|
|
||||||
|
|
||||||
MARK_AS_ADVANCED(
|
|
||||||
GLCORE_INCLUDE_DIR
|
|
||||||
GLCORE_GLCOREARB_HEADER
|
|
||||||
)
|
|
||||||
@@ -1,142 +0,0 @@
|
|||||||
# - Try to find Glib and its components (gio, gobject etc)
|
|
||||||
# Once done, this will define
|
|
||||||
#
|
|
||||||
# GLIB_FOUND - system has Glib
|
|
||||||
# GLIB_INCLUDE_DIRS - the Glib include directories
|
|
||||||
# GLIB_LIBRARIES - link these to use Glib
|
|
||||||
#
|
|
||||||
# Optionally, the COMPONENTS keyword can be passed to find_package()
|
|
||||||
# and Glib components can be looked for. Currently, the following
|
|
||||||
# components can be used, and they define the following variables if
|
|
||||||
# found:
|
|
||||||
#
|
|
||||||
# gio: GLIB_GIO_LIBRARIES
|
|
||||||
# gobject: GLIB_GOBJECT_LIBRARIES
|
|
||||||
# gmodule: GLIB_GMODULE_LIBRARIES
|
|
||||||
# gthread: GLIB_GTHREAD_LIBRARIES
|
|
||||||
#
|
|
||||||
# Note that the respective _INCLUDE_DIR variables are not set, since
|
|
||||||
# all headers are in the same directory as GLIB_INCLUDE_DIRS.
|
|
||||||
#
|
|
||||||
# Copyright (C) 2012 Raphael Kubo da Costa <rakuco@webkit.org>
|
|
||||||
#
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
|
||||||
# modification, are permitted provided that the following conditions
|
|
||||||
# are met:
|
|
||||||
# 1. Redistributions of source code must retain the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
# 2. Redistributions in binary form must reproduce the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer in the
|
|
||||||
# documentation and/or other materials provided with the distribution.
|
|
||||||
#
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS
|
|
||||||
# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS
|
|
||||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
if (WIN32)
|
|
||||||
find_library(GLIB_LIBRARIES
|
|
||||||
NAMES glib-2.0
|
|
||||||
PATHS C:/gstreamer/1.0/x86_64/lib
|
|
||||||
)
|
|
||||||
|
|
||||||
else ()
|
|
||||||
find_package(PkgConfig)
|
|
||||||
pkg_check_modules(PC_GLIB QUIET glib-2.0)
|
|
||||||
|
|
||||||
find_library(GLIB_LIBRARIES
|
|
||||||
NAMES glib-2.0
|
|
||||||
HINTS ${PC_GLIB_LIBDIR}
|
|
||||||
${PC_GLIB_LIBRARY_DIRS}
|
|
||||||
)
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
# Files in glib's main include path may include glibconfig.h, which,
|
|
||||||
# for some odd reason, is normally in $LIBDIR/glib-2.0/include.
|
|
||||||
get_filename_component(_GLIB_LIBRARY_DIR ${GLIB_LIBRARIES} PATH)
|
|
||||||
|
|
||||||
find_path(GLIBCONFIG_INCLUDE_DIR
|
|
||||||
NAMES glibconfig.h
|
|
||||||
HINTS ${PC_LIBDIR} ${PC_LIBRARY_DIRS} ${_GLIB_LIBRARY_DIR}
|
|
||||||
PATH_SUFFIXES glib-2.0/include
|
|
||||||
)
|
|
||||||
|
|
||||||
if (WIN32)
|
|
||||||
find_path(GLIB_INCLUDE_DIR
|
|
||||||
NAMES glib.h
|
|
||||||
PATHS C:/gstreamer/1.0/x86_64/include
|
|
||||||
PATH_SUFFIXES glib-2.0
|
|
||||||
)
|
|
||||||
else()
|
|
||||||
find_path(GLIB_INCLUDE_DIR
|
|
||||||
NAMES glib.h
|
|
||||||
HINTS ${PC_GLIB_INCLUDEDIR}
|
|
||||||
${PC_GLIB_INCLUDE_DIRS}
|
|
||||||
PATH_SUFFIXES glib-2.0
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (GLIBCONFIG_INCLUDE_DIR)
|
|
||||||
|
|
||||||
set(GLIB_INCLUDE_DIRS ${GLIB_INCLUDE_DIR} ${GLIBCONFIG_INCLUDE_DIR})
|
|
||||||
|
|
||||||
# Version detection
|
|
||||||
file(READ "${GLIBCONFIG_INCLUDE_DIR}/glibconfig.h" GLIBCONFIG_H_CONTENTS)
|
|
||||||
string(REGEX MATCH "#define GLIB_MAJOR_VERSION ([0-9]+)" _dummy "${GLIBCONFIG_H_CONTENTS}")
|
|
||||||
set(GLIB_VERSION_MAJOR "${CMAKE_MATCH_1}")
|
|
||||||
string(REGEX MATCH "#define GLIB_MINOR_VERSION ([0-9]+)" _dummy "${GLIBCONFIG_H_CONTENTS}")
|
|
||||||
set(GLIB_VERSION_MINOR "${CMAKE_MATCH_1}")
|
|
||||||
string(REGEX MATCH "#define GLIB_MICRO_VERSION ([0-9]+)" _dummy "${GLIBCONFIG_H_CONTENTS}")
|
|
||||||
set(GLIB_VERSION_MICRO "${CMAKE_MATCH_1}")
|
|
||||||
set(GLIB_VERSION "${GLIB_VERSION_MAJOR}.${GLIB_VERSION_MINOR}.${GLIB_VERSION_MICRO}")
|
|
||||||
|
|
||||||
# Additional Glib components. We only look for libraries, as not all of them
|
|
||||||
# have corresponding headers and all headers are installed alongside the main
|
|
||||||
# glib ones.
|
|
||||||
foreach (_component ${GLIB_FIND_COMPONENTS})
|
|
||||||
if (${_component} STREQUAL "gio")
|
|
||||||
find_library(GLIB_GIO_LIBRARIES NAMES gio-2.0 HINTS ${_GLIB_LIBRARY_DIR})
|
|
||||||
set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GIO_LIBRARIES)
|
|
||||||
elseif (${_component} STREQUAL "gobject")
|
|
||||||
find_library(GLIB_GOBJECT_LIBRARIES NAMES gobject-2.0 HINTS ${_GLIB_LIBRARY_DIR})
|
|
||||||
set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GOBJECT_LIBRARIES)
|
|
||||||
elseif (${_component} STREQUAL "gmodule")
|
|
||||||
find_library(GLIB_GMODULE_LIBRARIES NAMES gmodule-2.0 HINTS ${_GLIB_LIBRARY_DIR})
|
|
||||||
set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GMODULE_LIBRARIES)
|
|
||||||
elseif (${_component} STREQUAL "gthread")
|
|
||||||
find_library(GLIB_GTHREAD_LIBRARIES NAMES gthread-2.0 HINTS ${_GLIB_LIBRARY_DIR})
|
|
||||||
set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GTHREAD_LIBRARIES)
|
|
||||||
elseif (${_component} STREQUAL "gio-unix")
|
|
||||||
# gio-unix is compiled as part of the gio library, but the include paths
|
|
||||||
# are separate from the shared glib ones. Since this is currently only used
|
|
||||||
# by WebKitGTK+ we don't go to extraordinary measures beyond pkg-config.
|
|
||||||
pkg_check_modules(GIO_UNIX QUIET gio-unix-2.0)
|
|
||||||
endif ()
|
|
||||||
endforeach ()
|
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLIB REQUIRED_VARS GLIB_INCLUDE_DIRS GLIB_LIBRARIES ${ADDITIONAL_REQUIRED_VARS}
|
|
||||||
VERSION_VAR GLIB_VERSION)
|
|
||||||
|
|
||||||
mark_as_advanced(
|
|
||||||
GLIBCONFIG_INCLUDE_DIR
|
|
||||||
GLIB_GIO_LIBRARIES
|
|
||||||
GLIB_GIO_UNIX_LIBRARIES
|
|
||||||
GLIB_GMODULE_LIBRARIES
|
|
||||||
GLIB_GOBJECT_LIBRARIES
|
|
||||||
GLIB_GTHREAD_LIBRARIES
|
|
||||||
GLIB_INCLUDE_DIR
|
|
||||||
GLIB_INCLUDE_DIRS
|
|
||||||
GLIB_LIBRARIES
|
|
||||||
)
|
|
||||||
|
|
||||||
else()
|
|
||||||
|
|
||||||
endif ()
|
|
||||||
@@ -1,174 +0,0 @@
|
|||||||
# - Try to find GStreamer and its plugins
|
|
||||||
# Once done, this will define
|
|
||||||
#
|
|
||||||
# GSTREAMER_FOUND - system has GStreamer
|
|
||||||
# GSTREAMER_INCLUDE_DIRS - the GStreamer include directories
|
|
||||||
# GSTREAMER_LIBRARIES - link these to use GStreamer
|
|
||||||
#
|
|
||||||
# Additionally, gstreamer-base is always looked for and required, and
|
|
||||||
# the following related variables are defined:
|
|
||||||
#
|
|
||||||
# GSTREAMER_BASE_INCLUDE_DIRS - gstreamer-base's include directory
|
|
||||||
# GSTREAMER_BASE_LIBRARIES - link to these to use gstreamer-base
|
|
||||||
#
|
|
||||||
# Optionally, the COMPONENTS keyword can be passed to find_package()
|
|
||||||
# and GStreamer plugins can be looked for. Currently, the following
|
|
||||||
# plugins can be searched, and they define the following variables if
|
|
||||||
# found:
|
|
||||||
#
|
|
||||||
# gstreamer-app: GSTREAMER_APP_INCLUDE_DIRS and GSTREAMER_APP_LIBRARIES
|
|
||||||
# gstreamer-audio: GSTREAMER_AUDIO_INCLUDE_DIRS and GSTREAMER_AUDIO_LIBRARIES
|
|
||||||
# gstreamer-fft: GSTREAMER_FFT_INCLUDE_DIRS and GSTREAMER_FFT_LIBRARIES
|
|
||||||
# gstreamer-pbutils: GSTREAMER_PBUTILS_INCLUDE_DIRS and GSTREAMER_PBUTILS_LIBRARIES
|
|
||||||
# gstreamer-video: GSTREAMER_VIDEO_INCLUDE_DIRS and GSTREAMER_VIDEO_LIBRARIES
|
|
||||||
#
|
|
||||||
# Copyright (C) 2012 Raphael Kubo da Costa <rakuco@webkit.org>
|
|
||||||
#
|
|
||||||
# Redistribution and use in source and binary forms, with or without
|
|
||||||
# modification, are permitted provided that the following conditions
|
|
||||||
# are met:
|
|
||||||
# 1. Redistributions of source code must retain the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer.
|
|
||||||
# 2. Redistributions in binary form must reproduce the above copyright
|
|
||||||
# notice, this list of conditions and the following disclaimer in the
|
|
||||||
# documentation and/or other materials provided with the distribution.
|
|
||||||
#
|
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS
|
|
||||||
# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS
|
|
||||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
|
||||||
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
||||||
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
|
||||||
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
|
||||||
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
# Helper macro to find a GStreamer plugin (or GStreamer itself)
|
|
||||||
# _component_prefix is prepended to the _INCLUDE_DIRS and _LIBRARIES variables (eg. "GSTREAMER_AUDIO")
|
|
||||||
# _pkgconfig_name is the component's pkg-config name (eg. "gstreamer-1.0", or "gstreamer-video-1.0").
|
|
||||||
# _header is the component's header, relative to the gstreamer-1.0 directory (eg. "gst/gst.h").
|
|
||||||
# _library is the component's library name (eg. "gstreamer-1.0" or "gstvideo-1.0")
|
|
||||||
#macro(FIND_GSTREAMER_COMPONENT _component_prefix _pkgconfig_name _header _library)
|
|
||||||
# pkg_check_modules(PC_${_component_prefix} QUIET ${_pkgconfig_name})
|
|
||||||
#
|
|
||||||
# find_path(${_component_prefix}_INCLUDE_DIRS
|
|
||||||
# NAMES ${_header}
|
|
||||||
# HINTS ${PC_${_component_prefix}_INCLUDE_DIRS} ${PC_${_component_prefix}_INCLUDEDIR}
|
|
||||||
# PATH_SUFFIXES gstreamer-1.0
|
|
||||||
# )
|
|
||||||
#
|
|
||||||
# find_library(${_component_prefix}_LIBRARIES
|
|
||||||
# NAMES ${_library}
|
|
||||||
# HINTS ${PC_${_component_prefix}_LIBRARY_DIRS} ${PC_${_component_prefix}_LIBDIR}
|
|
||||||
# )
|
|
||||||
#endmacro()
|
|
||||||
|
|
||||||
if (WIN32)
|
|
||||||
macro(FIND_GSTREAMER_COMPONENT _component_prefix _pkgconfig_name _header _library)
|
|
||||||
find_path(${_component_prefix}_INCLUDE_DIRS
|
|
||||||
NAMES ${_header}
|
|
||||||
PATHS C:/gstreamer/1.0/x86_64/include
|
|
||||||
PATH_SUFFIXES gstreamer-1.0
|
|
||||||
)
|
|
||||||
|
|
||||||
find_library(${_component_prefix}_LIBRARIES
|
|
||||||
NAMES ${_library}
|
|
||||||
PATHS C:/gstreamer/1.0/x86_64/lib
|
|
||||||
)
|
|
||||||
endmacro()
|
|
||||||
else ()
|
|
||||||
|
|
||||||
find_package(PkgConfig)
|
|
||||||
|
|
||||||
macro(FIND_GSTREAMER_COMPONENT _component_prefix _pkgconfig_name _header _library)
|
|
||||||
pkg_check_modules(${_component_prefix} QUIET ${_pkgconfig_name})
|
|
||||||
|
|
||||||
# find_path(${_component_prefix}_INCLUDE_DIRS
|
|
||||||
# NAMES ${_header}
|
|
||||||
# HINTS ${PC_${_component_prefix}_INCLUDE_DIRS} ${PC_${_component_prefix}_INCLUDEDIR}
|
|
||||||
# PATH_SUFFIXES gstreamer-1.0
|
|
||||||
# )
|
|
||||||
|
|
||||||
# find_library(${_component_prefix}_LIBRARIES
|
|
||||||
# NAMES ${_library}
|
|
||||||
# HINTS ${PC_${_component_prefix}_LIBRARY_DIRS} ${PC_${_component_prefix}_LIBDIR}
|
|
||||||
# )
|
|
||||||
endmacro()
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
# ------------------------
|
|
||||||
# 1. Find GStreamer itself
|
|
||||||
# ------------------------
|
|
||||||
|
|
||||||
# 1.1. Find headers and libraries
|
|
||||||
FIND_GSTREAMER_COMPONENT(GSTREAMER gstreamer-1.0 gst/gst.h gstreamer-1.0)
|
|
||||||
FIND_GSTREAMER_COMPONENT(GSTREAMER_BASE gstreamer-base-1.0 gst/gst.h gstbase-1.0)
|
|
||||||
|
|
||||||
|
|
||||||
# 1.2. Check GStreamer version
|
|
||||||
if (GSTREAMER_INCLUDE_DIRS)
|
|
||||||
if (EXISTS "${GSTREAMER_INCLUDE_DIRS}/gst/gstversion.h")
|
|
||||||
file(READ "${GSTREAMER_INCLUDE_DIRS}/gst/gstversion.h" GSTREAMER_VERSION_CONTENTS)
|
|
||||||
|
|
||||||
string(REGEX MATCH "#define +GST_VERSION_MAJOR +\\(([0-9]+)\\)" _dummy "${GSTREAMER_VERSION_CONTENTS}")
|
|
||||||
set(GSTREAMER_VERSION_MAJOR "${CMAKE_MATCH_1}")
|
|
||||||
|
|
||||||
string(REGEX MATCH "#define +GST_VERSION_MINOR +\\(([0-9]+)\\)" _dummy "${GSTREAMER_VERSION_CONTENTS}")
|
|
||||||
set(GSTREAMER_VERSION_MINOR "${CMAKE_MATCH_1}")
|
|
||||||
|
|
||||||
string(REGEX MATCH "#define +GST_VERSION_MICRO +\\(([0-9]+)\\)" _dummy "${GSTREAMER_VERSION_CONTENTS}")
|
|
||||||
set(GSTREAMER_VERSION_MICRO "${CMAKE_MATCH_1}")
|
|
||||||
|
|
||||||
set(GSTREAMER_VERSION "${GSTREAMER_VERSION_MAJOR}.${GSTREAMER_VERSION_MINOR}.${GSTREAMER_VERSION_MICRO}")
|
|
||||||
endif ()
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
|
|
||||||
if ("${GStreamer_FIND_VERSION}" VERSION_GREATER "${GSTREAMER_VERSION}")
|
|
||||||
message(FATAL_ERROR "Required version (" ${GStreamer_FIND_VERSION} ") is higher than found version (" ${GSTREAMER_VERSION} ")")
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
# -------------------------
|
|
||||||
# 2. Find GStreamer plugins
|
|
||||||
# -------------------------
|
|
||||||
|
|
||||||
FIND_GSTREAMER_COMPONENT(GSTREAMER_APP gstreamer-app-1.0 gst/app/gstappsink.h gstapp-1.0)
|
|
||||||
FIND_GSTREAMER_COMPONENT(GSTREAMER_AUDIO gstreamer-audio-1.0 gst/audio/audio.h gstaudio-1.0)
|
|
||||||
FIND_GSTREAMER_COMPONENT(GSTREAMER_FFT gstreamer-fft-1.0 gst/fft/gstfft.h gstfft-1.0)
|
|
||||||
FIND_GSTREAMER_COMPONENT(GSTREAMER_PBUTILS gstreamer-pbutils-1.0 gst/pbutils/pbutils.h gstpbutils-1.0)
|
|
||||||
FIND_GSTREAMER_COMPONENT(GSTREAMER_VIDEO gstreamer-video-1.0 gst/video/video.h gstvideo-1.0)
|
|
||||||
|
|
||||||
# ------------------------------------------------
|
|
||||||
# 3. Process the COMPONENTS passed to FIND_PACKAGE
|
|
||||||
# ------------------------------------------------
|
|
||||||
set(_GSTREAMER_REQUIRED_VARS GSTREAMER_INCLUDE_DIRS GSTREAMER_LIBRARIES GSTREAMER_VERSION GSTREAMER_BASE_INCLUDE_DIRS GSTREAMER_BASE_LIBRARIES)
|
|
||||||
|
|
||||||
foreach (_component ${GStreamer_FIND_COMPONENTS})
|
|
||||||
set(_gst_component "GSTREAMER_${_component}")
|
|
||||||
string(TOUPPER ${_gst_component} _UPPER_NAME)
|
|
||||||
|
|
||||||
list(APPEND _GSTREAMER_REQUIRED_VARS ${_UPPER_NAME}_INCLUDE_DIRS ${_UPPER_NAME}_LIBRARIES)
|
|
||||||
endforeach ()
|
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GStreamer REQUIRED_VARS ${_GSTREAMER_REQUIRED_VARS}
|
|
||||||
VERSION_VAR GSTREAMER_VERSION)
|
|
||||||
|
|
||||||
mark_as_advanced(
|
|
||||||
GSTREAMER_APP_INCLUDE_DIRS
|
|
||||||
GSTREAMER_APP_LIBRARIES
|
|
||||||
GSTREAMER_AUDIO_INCLUDE_DIRS
|
|
||||||
GSTREAMER_AUDIO_LIBRARIES
|
|
||||||
GSTREAMER_BASE_INCLUDE_DIRS
|
|
||||||
GSTREAMER_BASE_LIBRARIES
|
|
||||||
GSTREAMER_FFT_INCLUDE_DIRS
|
|
||||||
GSTREAMER_FFT_LIBRARIES
|
|
||||||
GSTREAMER_INCLUDE_DIRS
|
|
||||||
GSTREAMER_LIBRARIES
|
|
||||||
GSTREAMER_PBUTILS_INCLUDE_DIRS
|
|
||||||
GSTREAMER_PBUTILS_LIBRARIES
|
|
||||||
GSTREAMER_VIDEO_INCLUDE_DIRS
|
|
||||||
GSTREAMER_VIDEO_LIBRARIES
|
|
||||||
)
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
# Locate libgta
|
|
||||||
# This module defines
|
|
||||||
# GTA_FOUND, if false, do not try to link to libgta
|
|
||||||
# GTA_INCLUDE_DIRS, where to find the headers
|
|
||||||
# GTA_LIBRARIES
|
|
||||||
#
|
|
||||||
# $GTA_DIR is an environment variable that would
|
|
||||||
# correspond to the ./configure --prefix=$GTA_DIR
|
|
||||||
# used in building libgta.
|
|
||||||
|
|
||||||
INCLUDE(FindPkgConfig OPTIONAL)
|
|
||||||
|
|
||||||
IF(PKG_CONFIG_FOUND)
|
|
||||||
|
|
||||||
INCLUDE(FindPkgConfig)
|
|
||||||
|
|
||||||
PKG_CHECK_MODULES(GTA gta)
|
|
||||||
|
|
||||||
ELSE(PKG_CONFIG_FOUND)
|
|
||||||
|
|
||||||
FIND_PATH(GTA_INCLUDE_DIRS gta/gta.hpp
|
|
||||||
$ENV{GTA_DIR}/include
|
|
||||||
$ENV{GTA_DIR}
|
|
||||||
~/Library/Frameworks
|
|
||||||
/Library/Frameworks
|
|
||||||
/usr/local/include
|
|
||||||
/usr/include
|
|
||||||
/sw/include # Fink
|
|
||||||
/opt/local/include # DarwinPorts
|
|
||||||
/opt/csw/include # Blastwave
|
|
||||||
/opt/include
|
|
||||||
/usr/freeware/include
|
|
||||||
)
|
|
||||||
|
|
||||||
FIND_LIBRARY(GTA_LIBRARIES
|
|
||||||
NAMES gta libgta
|
|
||||||
PATHS
|
|
||||||
$ENV{GTA_DIR}/lib
|
|
||||||
$ENV{GTA_DIR}
|
|
||||||
~/Library/Frameworks
|
|
||||||
/Library/Frameworks
|
|
||||||
/usr/local/lib
|
|
||||||
/usr/lib
|
|
||||||
/sw/lib
|
|
||||||
/opt/local/lib
|
|
||||||
/opt/csw/lib
|
|
||||||
/opt/lib
|
|
||||||
/usr/freeware/lib64
|
|
||||||
)
|
|
||||||
|
|
||||||
SET(GTA_FOUND "NO")
|
|
||||||
IF(GTA_LIBRARIES AND GTA_INCLUDE_DIRS)
|
|
||||||
SET(GTA_FOUND "YES")
|
|
||||||
ENDIF(GTA_LIBRARIES AND GTA_INCLUDE_DIRS)
|
|
||||||
|
|
||||||
ENDIF(PKG_CONFIG_FOUND)
|
|
||||||
@@ -9,15 +9,6 @@
|
|||||||
#
|
#
|
||||||
# Created by Robert Osfield.
|
# Created by Robert Osfield.
|
||||||
|
|
||||||
# prefer FindJasper from cmake distribution
|
|
||||||
if(EXISTS ${CMAKE_ROOT}/Modules/FindJasper.cmake)
|
|
||||||
include(${CMAKE_ROOT}/Modules/FindJasper.cmake)
|
|
||||||
|
|
||||||
if(JASPER_FOUND)
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
FIND_PATH(JASPER_INCLUDE_DIR jasper/jasper.h
|
FIND_PATH(JASPER_INCLUDE_DIR jasper/jasper.h
|
||||||
$ENV{JASPER_DIR}/include
|
$ENV{JASPER_DIR}/include
|
||||||
$ENV{JASPER_DIR}/src/libjasper/include
|
$ENV{JASPER_DIR}/src/libjasper/include
|
||||||
|
|||||||
@@ -1,107 +0,0 @@
|
|||||||
#---
|
|
||||||
# File: FindLIBLAS.cmake
|
|
||||||
#
|
|
||||||
# Find the native LIBLAS includes and library
|
|
||||||
#
|
|
||||||
# LIBLAS_INCLUDE_DIRS - where to find liblas's includes.
|
|
||||||
# LIBLAS_LIBRARIES - List of libraries when using liblas.
|
|
||||||
# LIBLAS_FOUND - True if liblas found.
|
|
||||||
#---
|
|
||||||
|
|
||||||
|
|
||||||
# Set the include dir:
|
|
||||||
find_path(LIBLAS_INCLUDE_DIR liblas/liblas.hpp)
|
|
||||||
|
|
||||||
# Macro for setting libraries:
|
|
||||||
macro(FIND_LIBLAS_LIBRARY MYLIBRARY MYLIBRARYNAME)
|
|
||||||
|
|
||||||
find_library(
|
|
||||||
"${MYLIBRARY}_DEBUG"
|
|
||||||
NAMES "${MYLIBRARYNAME}${CMAKE_DEBUG_POSTFIX}"
|
|
||||||
PATHS
|
|
||||||
${LIBLAS_DIR}/lib/Debug
|
|
||||||
${LIBLAS_DIR}/lib64/Debug
|
|
||||||
${LIBLAS_DIR}/lib
|
|
||||||
${LIBLAS_DIR}/lib64
|
|
||||||
$ENV{LIBLAS_DIR}/lib/debug
|
|
||||||
$ENV{LIBLAS_DIR}/lib64/debug
|
|
||||||
NO_DEFAULT_PATH
|
|
||||||
)
|
|
||||||
|
|
||||||
find_library(
|
|
||||||
"${MYLIBRARY}_DEBUG"
|
|
||||||
NAMES "${MYLIBRARYNAME}${CMAKE_DEBUG_POSTFIX}"
|
|
||||||
PATHS
|
|
||||||
~/Library/Frameworks
|
|
||||||
/Library/Frameworks
|
|
||||||
/usr/local/lib
|
|
||||||
/usr/local/lib64
|
|
||||||
/usr/lib
|
|
||||||
/usr/lib64
|
|
||||||
/sw/lib
|
|
||||||
/opt/local/lib
|
|
||||||
/opt/csw/lib
|
|
||||||
/opt/lib
|
|
||||||
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;LIBLAS_ROOT]/lib
|
|
||||||
/usr/freeware/lib64
|
|
||||||
)
|
|
||||||
|
|
||||||
find_library(
|
|
||||||
${MYLIBRARY}
|
|
||||||
NAMES "${MYLIBRARYNAME}${CMAKE_RELEASE_POSTFIX}"
|
|
||||||
PATHS
|
|
||||||
${LIBLAS_DIR}/lib/Release
|
|
||||||
${LIBLAS_DIR}/lib64/Release
|
|
||||||
${LIBLAS_DIR}/lib
|
|
||||||
${LIBLAS_DIR}/lib64
|
|
||||||
$ENV{LIBLAS_DIR}/lib/Release
|
|
||||||
$ENV{LIBLAS_DIR}/lib64/Release
|
|
||||||
$ENV{LIBLAS_DIR}/lib
|
|
||||||
$ENV{LIBLAS_DIR}/lib64
|
|
||||||
$ENV{LIBLAS_DIR}
|
|
||||||
$ENV{LIBLASDIR}/lib
|
|
||||||
$ENV{LIBLASDIR}/lib64
|
|
||||||
$ENV{LIBLASDIR}
|
|
||||||
$ENV{LIBLAS_ROOT}/lib
|
|
||||||
$ENV{LIBLAS_ROOT}/lib64
|
|
||||||
NO_DEFAULT_PATH
|
|
||||||
)
|
|
||||||
|
|
||||||
find_library(
|
|
||||||
${MYLIBRARY}
|
|
||||||
NAMES "${MYLIBRARYNAME}${CMAKE_RELEASE_POSTFIX}"
|
|
||||||
PATHS
|
|
||||||
~/Library/Frameworks
|
|
||||||
/Library/Frameworks
|
|
||||||
/usr/local/lib
|
|
||||||
/usr/local/lib64
|
|
||||||
/usr/lib
|
|
||||||
/usr/lib64
|
|
||||||
/sw/lib
|
|
||||||
/opt/local/lib
|
|
||||||
/opt/csw/lib
|
|
||||||
/opt/lib
|
|
||||||
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;LIBLAS_ROOT]/lib
|
|
||||||
/usr/freeware/lib64
|
|
||||||
)
|
|
||||||
|
|
||||||
if( NOT ${MYLIBRARY}_DEBUG )
|
|
||||||
if( MYLIBRARY )
|
|
||||||
set( ${MYLIBRARY}_DEBUG ${MYLIBRARY} )
|
|
||||||
endif(MYLIBRARY)
|
|
||||||
endif( NOT ${MYLIBRARY}_DEBUG )
|
|
||||||
|
|
||||||
endmacro(FIND_LIBLAS_LIBRARY LIBRARY LIBRARYNAME)
|
|
||||||
|
|
||||||
FIND_LIBLAS_LIBRARY(LIBLAS_LIBRARY las)
|
|
||||||
FIND_LIBLAS_LIBRARY(LIBLASC_LIBRARY las_c)
|
|
||||||
|
|
||||||
set(LIBLAS_FOUND "NO")
|
|
||||||
if(LIBLAS_LIBRARY AND LIBLASC_LIBRARY AND LIBLAS_INCLUDE_DIR)
|
|
||||||
|
|
||||||
FIND_PACKAGE(Boost) # used by LIBLAS
|
|
||||||
if(Boost_FOUND)
|
|
||||||
set(LIBLAS_LIBRARIES ${LIBLAS_LIBRARY} ${LIBLASC_LIBRARY} )
|
|
||||||
set(LIBLAS_FOUND "YES")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
@@ -1,83 +0,0 @@
|
|||||||
# Locate Lua library
|
|
||||||
# This module defines
|
|
||||||
# LUA51_FOUND, if false, do not try to link to Lua
|
|
||||||
# LUA_LIBRARIES
|
|
||||||
# LUA_INCLUDE_DIR, where to find lua.h
|
|
||||||
# LUA_VERSION_STRING, the version of Lua found (since CMake 2.8.8)
|
|
||||||
#
|
|
||||||
# Note that the expected include convention is
|
|
||||||
# #include "lua.h"
|
|
||||||
# and not
|
|
||||||
# #include <lua/lua.h>
|
|
||||||
# This is because, the lua location is not standardized and may exist
|
|
||||||
# in locations other than lua/
|
|
||||||
|
|
||||||
#=============================================================================
|
|
||||||
# Copyright 2007-2009 Kitware, Inc.
|
|
||||||
#
|
|
||||||
# Distributed under the OSI-approved BSD License (the "License");
|
|
||||||
# see accompanying file Copyright.txt for details.
|
|
||||||
#
|
|
||||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
||||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
# See the License for more information.
|
|
||||||
#=============================================================================
|
|
||||||
# (To distribute this file outside of CMake, substitute the full
|
|
||||||
# License text for the above reference.)
|
|
||||||
|
|
||||||
find_path(LUA_INCLUDE_DIR lua.h
|
|
||||||
HINTS
|
|
||||||
ENV LUA_DIR
|
|
||||||
PATH_SUFFIXES include/lua52 include/lua5.2 include/lua include
|
|
||||||
PATHS
|
|
||||||
~/Library/Frameworks
|
|
||||||
/Library/Frameworks
|
|
||||||
/sw # Fink
|
|
||||||
/opt/local # DarwinPorts
|
|
||||||
/opt/csw # Blastwave
|
|
||||||
/opt
|
|
||||||
)
|
|
||||||
|
|
||||||
find_library(LUA_LIBRARY
|
|
||||||
NAMES lua52 lua5.2 lua-5.2 lua
|
|
||||||
HINTS
|
|
||||||
ENV LUA_DIR
|
|
||||||
PATH_SUFFIXES lib
|
|
||||||
PATHS
|
|
||||||
~/Library/Frameworks
|
|
||||||
/Library/Frameworks
|
|
||||||
/sw
|
|
||||||
/opt/local
|
|
||||||
/opt/csw
|
|
||||||
/opt
|
|
||||||
)
|
|
||||||
|
|
||||||
if(LUA_LIBRARY)
|
|
||||||
# include the math library for Unix
|
|
||||||
if(UNIX AND NOT APPLE)
|
|
||||||
find_library(LUA_MATH_LIBRARY m)
|
|
||||||
set( LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}" CACHE STRING "Lua Libraries")
|
|
||||||
# For Windows and Mac, don't need to explicitly include the math library
|
|
||||||
else()
|
|
||||||
set( LUA_LIBRARIES "${LUA_LIBRARY}" CACHE STRING "Lua Libraries")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h")
|
|
||||||
file(STRINGS "${LUA_INCLUDE_DIR}/lua.h" lua_version_str REGEX "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua .+\"")
|
|
||||||
|
|
||||||
string(REGEX REPLACE "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([^\"]+)\".*" "\\1" LUA_VERSION_STRING "${lua_version_str}")
|
|
||||||
unset(lua_version_str)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
|
||||||
|
|
||||||
# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
|
|
||||||
# all listed variables are TRUE
|
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua52
|
|
||||||
REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR
|
|
||||||
VERSION_VAR LUA_VERSION_STRING)
|
|
||||||
|
|
||||||
mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARIES LUA_LIBRARY LUA_MATH_LIBRARY)
|
|
||||||
|
|
||||||
@@ -15,7 +15,6 @@ 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
|
||||||
@@ -26,17 +25,6 @@ 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
|
||||||
@@ -47,17 +35,6 @@ 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
|
||||||
@@ -68,17 +45,6 @@ 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
|
||||||
@@ -88,18 +54,6 @@ 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)
|
||||||
|
|||||||
@@ -100,13 +100,8 @@ MACRO(FIND_OSG_LIBRARY MYLIBRARY MYLIBRARYNAME)
|
|||||||
IF( NOT ${MYLIBRARY}_DEBUG)
|
IF( NOT ${MYLIBRARY}_DEBUG)
|
||||||
IF(MYLIBRARY)
|
IF(MYLIBRARY)
|
||||||
SET(${MYLIBRARY}_DEBUG ${MYLIBRARY})
|
SET(${MYLIBRARY}_DEBUG ${MYLIBRARY})
|
||||||
ENDIF(MYLIBRARY)
|
ENDIF(MYLIBRARY)
|
||||||
ELSE()
|
ENDIF( NOT ${MYLIBRARY}_DEBUG)
|
||||||
IF( NOT MYLIBRARY )
|
|
||||||
SET(${MYLIBRARY} ${${MYLIBRARY}_DEBUG} )
|
|
||||||
ENDIF(NOT MYLIBRARY)
|
|
||||||
|
|
||||||
ENDIF( NOT ${MYLIBRARY}_DEBUG )
|
|
||||||
|
|
||||||
ENDMACRO(FIND_OSG_LIBRARY LIBRARY LIBRARYNAME)
|
ENDMACRO(FIND_OSG_LIBRARY LIBRARY LIBRARYNAME)
|
||||||
|
|
||||||
@@ -116,20 +111,12 @@ FIND_OSG_LIBRARY(OSGUTIL_LIBRARY osgUtil)
|
|||||||
FIND_OSG_LIBRARY(OSGDB_LIBRARY osgDB)
|
FIND_OSG_LIBRARY(OSGDB_LIBRARY osgDB)
|
||||||
FIND_OSG_LIBRARY(OSGTEXT_LIBRARY osgText)
|
FIND_OSG_LIBRARY(OSGTEXT_LIBRARY osgText)
|
||||||
FIND_OSG_LIBRARY(OSGWIDGET_LIBRARY osgWidget)
|
FIND_OSG_LIBRARY(OSGWIDGET_LIBRARY osgWidget)
|
||||||
FIND_OSG_LIBRARY(OSGQT_LIBRARY osgQt)
|
|
||||||
FIND_OSG_LIBRARY(OSGTERRAIN_LIBRARY osgTerrain)
|
FIND_OSG_LIBRARY(OSGTERRAIN_LIBRARY osgTerrain)
|
||||||
FIND_OSG_LIBRARY(OSGFX_LIBRARY osgFX)
|
FIND_OSG_LIBRARY(OSGFX_LIBRARY osgFX)
|
||||||
FIND_OSG_LIBRARY(OSGVIEWER_LIBRARY osgViewer)
|
FIND_OSG_LIBRARY(OSGVIEWER_LIBRARY osgViewer)
|
||||||
FIND_OSG_LIBRARY(OSGVOLUME_LIBRARY osgVolume)
|
FIND_OSG_LIBRARY(OSGVOLUME_LIBRARY osgVolume)
|
||||||
FIND_OSG_LIBRARY(OSGMANIPULATOR_LIBRARY osgManipulator)
|
|
||||||
FIND_OSG_LIBRARY(OSGANIMATION_LIBRARY osgAnimation)
|
|
||||||
FIND_OSG_LIBRARY(OSGPARTICLE_LIBRARY osgParticle)
|
|
||||||
FIND_OSG_LIBRARY(OSGSHADOW_LIBRARY osgShadow)
|
|
||||||
FIND_OSG_LIBRARY(OSGPRESENTATION_LIBRARY osgPresentation)
|
|
||||||
FIND_OSG_LIBRARY(OSGSIM_LIBRARY osgSim)
|
|
||||||
FIND_OSG_LIBRARY(OPENTHREADS_LIBRARY OpenThreads)
|
FIND_OSG_LIBRARY(OPENTHREADS_LIBRARY OpenThreads)
|
||||||
|
|
||||||
|
|
||||||
SET(OSG_FOUND "NO")
|
SET(OSG_FOUND "NO")
|
||||||
IF(OSG_LIBRARY AND OSG_INCLUDE_DIR)
|
IF(OSG_LIBRARY AND OSG_INCLUDE_DIR)
|
||||||
SET(OSG_FOUND "YES")
|
SET(OSG_FOUND "YES")
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
#
|
#
|
||||||
# Created by Robert Osfield.
|
# Created by Robert Osfield.
|
||||||
|
|
||||||
|
|
||||||
FIND_PATH(OPENEXR_INCLUDE_DIR OpenEXR/ImfIO.h
|
FIND_PATH(OPENEXR_INCLUDE_DIR OpenEXR/ImfIO.h
|
||||||
$ENV{OPENEXR_DIR}/include
|
$ENV{OPENEXR_DIR}/include
|
||||||
$ENV{OPENEXR_DIR}
|
$ENV{OPENEXR_DIR}
|
||||||
@@ -24,41 +23,78 @@ FIND_PATH(OPENEXR_INCLUDE_DIR OpenEXR/ImfIO.h
|
|||||||
/usr/freeware/include
|
/usr/freeware/include
|
||||||
)
|
)
|
||||||
|
|
||||||
# Macro to find exr libraries (deduplicating search paths)
|
FIND_LIBRARY(OPENEXR_IlmIlf_LIBRARY
|
||||||
# example: OPENEXR_FIND_VAR(OPENEXR_IlmImf_LIBRARY IlmImf)
|
NAMES IlmImf
|
||||||
MACRO(OPENEXR_FIND_VAR varname libname)
|
PATHS
|
||||||
FIND_LIBRARY( ${varname}
|
$ENV{OPENEXR_DIR}/lib
|
||||||
NAMES ${libname}
|
$ENV{OPENEXR_DIR}
|
||||||
PATHS
|
~/Library/Frameworks
|
||||||
$ENV{OPENEXR_DIR}/lib
|
/Library/Frameworks
|
||||||
$ENV{OPENEXR_DIR}
|
/usr/local/lib
|
||||||
~/Library/Frameworks
|
/usr/lib
|
||||||
/Library/Frameworks
|
/sw/lib
|
||||||
/usr/local/lib
|
/opt/local/lib
|
||||||
/usr/lib
|
/opt/csw/lib
|
||||||
/sw/lib
|
/opt/lib
|
||||||
/opt/local/lib
|
/usr/freeware/lib64
|
||||||
/opt/csw/lib
|
)
|
||||||
/opt/lib
|
|
||||||
/usr/freeware/lib64
|
|
||||||
)
|
|
||||||
ENDMACRO(OPENEXR_FIND_VAR)
|
|
||||||
|
|
||||||
# Macro to find exr libraries (and debug versions)
|
FIND_LIBRARY(OPENEXR_IlmThread_LIBRARY
|
||||||
# example: OPENEXR_FIND(IlmImf)
|
NAMES IlmThread
|
||||||
MACRO(OPENEXR_FIND libname)
|
PATHS
|
||||||
OPENEXR_FIND_VAR(OPENEXR_${libname}_LIBRARY ${libname})
|
$ENV{OPENEXR_DIR}/lib
|
||||||
OPENEXR_FIND_VAR(OPENEXR_${libname}_LIBRARY_DEBUG ${libname}d)
|
$ENV{OPENEXR_DIR}
|
||||||
ENDMACRO(OPENEXR_FIND)
|
~/Library/Frameworks
|
||||||
|
/Library/Frameworks
|
||||||
|
/usr/local/lib
|
||||||
|
/usr/lib
|
||||||
|
/sw/lib
|
||||||
|
/opt/local/lib
|
||||||
|
/opt/csw/lib
|
||||||
|
/opt/lib
|
||||||
|
/usr/freeware/lib64
|
||||||
|
)
|
||||||
|
|
||||||
OPENEXR_FIND(IlmImf)
|
|
||||||
OPENEXR_FIND(IlmThread)
|
FIND_LIBRARY(OPENEXR_Iex_LIBRARY
|
||||||
OPENEXR_FIND(Iex)
|
NAMES Iex
|
||||||
OPENEXR_FIND(Half)
|
PATHS
|
||||||
|
$ENV{OPENEXR_DIR}/lib
|
||||||
|
$ENV{OPENEXR_DIR}
|
||||||
|
~/Library/Frameworks
|
||||||
|
/Library/Frameworks
|
||||||
|
/usr/local/lib
|
||||||
|
/usr/lib
|
||||||
|
/sw/lib
|
||||||
|
/opt/local/lib
|
||||||
|
/opt/csw/lib
|
||||||
|
/opt/lib
|
||||||
|
/usr/freeware/lib64
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_LIBRARY(OPENEXR_Half_LIBRARY
|
||||||
|
NAMES Half
|
||||||
|
PATHS
|
||||||
|
$ENV{OPENEXR_DIR}/lib
|
||||||
|
$ENV{OPENEXR_DIR}
|
||||||
|
~/Library/Frameworks
|
||||||
|
/Library/Frameworks
|
||||||
|
/usr/local/lib
|
||||||
|
/usr/lib
|
||||||
|
/sw/lib
|
||||||
|
/opt/local/lib
|
||||||
|
/opt/csw/lib
|
||||||
|
/opt/lib
|
||||||
|
/usr/freeware/lib64
|
||||||
|
)
|
||||||
|
|
||||||
SET(OPENEXR_FOUND "NO")
|
SET(OPENEXR_FOUND "NO")
|
||||||
IF(OPENEXR_INCLUDE_DIR AND OPENEXR_IlmImf_LIBRARY AND OPENEXR_IlmThread_LIBRARY AND OPENEXR_Iex_LIBRARY AND OPENEXR_Half_LIBRARY)
|
IF(OPENEXR_INCLUDE_DIR AND OPENEXR_IlmIlf_LIBRARY AND OPENEXR_IlmThread_LIBRARY AND OPENEXR_Iex_LIBRARY AND OPENEXR_Half_LIBRARY)
|
||||||
SET(OPENEXR_LIBRARIES ${OPENEXR_IlmImf_LIBRARY} ${OPENEXR_IlmThread_LIBRARY} ${OPENEXR_Half_LIBRARY} ${OPENEXR_Iex_LIBRARY} )
|
SET(OPENEXR_LIBRARIES
|
||||||
SET(OPENEXR_LIBRARIES_VARS OPENEXR_IlmImf_LIBRARY OPENEXR_IlmThread_LIBRARY OPENEXR_Half_LIBRARY OPENEXR_Iex_LIBRARY )
|
${OPENEXR_IlmIlf_LIBRARY}
|
||||||
|
${OPENEXR_IlmThread_LIBRARY}
|
||||||
|
${OPENEXR_Half_LIBRARY}
|
||||||
|
${OPENEXR_Iex_LIBRARY}
|
||||||
|
)
|
||||||
SET(OPENEXR_FOUND "YES")
|
SET(OPENEXR_FOUND "YES")
|
||||||
ENDIF(OPENEXR_INCLUDE_DIR AND OPENEXR_IlmImf_LIBRARY AND OPENEXR_IlmThread_LIBRARY AND OPENEXR_Iex_LIBRARY AND OPENEXR_Half_LIBRARY)
|
ENDIF(OPENEXR_INCLUDE_DIR AND OPENEXR_IlmIlf_LIBRARY AND OPENEXR_IlmThread_LIBRARY AND OPENEXR_Iex_LIBRARY AND OPENEXR_Half_LIBRARY)
|
||||||
|
|||||||
@@ -17,16 +17,6 @@
|
|||||||
#
|
#
|
||||||
# Created by Eric Wing.
|
# Created by Eric Wing.
|
||||||
|
|
||||||
# prefer FindOpenThreads from cmake distribution
|
|
||||||
if(EXISTS ${CMAKE_ROOT}/Modules/FindOpenThreads.cmake)
|
|
||||||
include(${CMAKE_ROOT}/Modules/FindOpenThreads.cmake)
|
|
||||||
|
|
||||||
if(OPENTHREADS_FOUND)
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
# Header files are presumed to be included like
|
# Header files are presumed to be included like
|
||||||
# #include <OpenThreads/Thread>
|
# #include <OpenThreads/Thread>
|
||||||
|
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
# Locate Apple QuartzCore
|
|
||||||
# This module defines
|
|
||||||
# QUARTZCORE_LIBRARY
|
|
||||||
# QUARTZCORE_FOUND, if false, do not try to link to QUARTZCORE
|
|
||||||
# QUARTZCORE_INCLUDE_DIR, where to find the headers
|
|
||||||
#
|
|
||||||
# $QUARTZCORE_DIR is an environment variable that would
|
|
||||||
# correspond to the ./configure --prefix=$QUARTZCORE_DIR
|
|
||||||
#
|
|
||||||
# Created by Stephan Maximilian Huber.
|
|
||||||
|
|
||||||
|
|
||||||
IF(APPLE)
|
|
||||||
FIND_PATH(QUARTZCORE_INCLUDE_DIR QuartzCore/QuartzCore.h)
|
|
||||||
FIND_LIBRARY(QUARTZCORE_LIBRARY QuartzCore)
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
|
|
||||||
SET(QUARTZCORE_FOUND "NO")
|
|
||||||
IF(QUARTZCORE_LIBRARY AND QUARTZCORE_INCLUDE_DIR)
|
|
||||||
SET(QUARTZCORE_FOUND "YES")
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
@@ -9,7 +9,6 @@
|
|||||||
#
|
#
|
||||||
# Created by Eric Wing.
|
# Created by Eric Wing.
|
||||||
|
|
||||||
|
|
||||||
# QuickTime on OS X looks different than QuickTime for Windows,
|
# QuickTime on OS X looks different than QuickTime for Windows,
|
||||||
# so I am going to case the two.
|
# so I am going to case the two.
|
||||||
|
|
||||||
@@ -50,24 +49,18 @@ ENDIF()
|
|||||||
|
|
||||||
IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
|
IF(OSG_BUILD_PLATFORM_IPHONE OR OSG_BUILD_PLATFORM_IPHONE_SIMULATOR)
|
||||||
SET(QUICKTIME_FOUND "NO")
|
SET(QUICKTIME_FOUND "NO")
|
||||||
ELSE()
|
ENDIF()
|
||||||
IF(APPLE)
|
|
||||||
#Quicktime is not supported under 64bit OSX build so we need to detect it and disable it.
|
IF(APPLE)
|
||||||
#First check to see if we are running with a native 64-bit compiler (10.6 default) and implicit arch
|
#Quicktime is not supported under 64bit OSX build so we need to detect it and disable it.
|
||||||
IF(NOT CMAKE_OSX_ARCHITECTURES AND CMAKE_SIZEOF_VOID_P EQUAL 8)
|
#First check to see if we are running with a native 64-bit compiler (10.6 default) and implicit arch
|
||||||
SET(QUICKTIME_FOUND "NO")
|
IF(NOT CMAKE_OSX_ARCHITECTURES AND CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||||
ELSE()
|
SET(QUICKTIME_FOUND "NO")
|
||||||
#Otherwise check to see if 64-bit is explicitly called for.
|
ELSE()
|
||||||
LIST(FIND CMAKE_OSX_ARCHITECTURES "x86_64" has64Compile)
|
#Otherwise check to see if 64-bit is explicitly called for.
|
||||||
IF(NOT has64Compile EQUAL -1)
|
LIST(FIND CMAKE_OSX_ARCHITECTURES "x86_64" has64Compile)
|
||||||
SET(QUICKTIME_FOUND "NO")
|
IF(NOT has64Compile EQUAL -1)
|
||||||
ENDIF()
|
SET(QUICKTIME_FOUND "NO")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
# Disable quicktime for >= 10.7, as it's officially deprecated
|
ENDIF()
|
||||||
|
|
||||||
IF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.7" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.8" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.9" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.10")
|
|
||||||
MESSAGE("disabling quicktime because it's not supported by the selected SDK ${OSG_OSX_SDK_NAME}")
|
|
||||||
SET(QUICKTIME_FOUND "NO")
|
|
||||||
ENDIF()
|
|
||||||
ENDIF()
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|||||||
@@ -5,9 +5,7 @@ IF(PKG_CONFIG_FOUND)
|
|||||||
|
|
||||||
INCLUDE(FindPkgConfig)
|
INCLUDE(FindPkgConfig)
|
||||||
|
|
||||||
#Version 2.35 introduces the rsvg_cleanup function which is used
|
PKG_CHECK_MODULES(RSVG librsvg-2.0)
|
||||||
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)
|
||||||
|
|||||||
@@ -1,178 +0,0 @@
|
|||||||
# - Locate SDL library
|
|
||||||
# This module defines
|
|
||||||
# SDL2_LIBRARY, the name of the library to link against
|
|
||||||
# SDL2_FOUND, if false, do not try to link to SDL
|
|
||||||
# SDL2_INCLUDE_DIR, where to find SDL.h
|
|
||||||
# SDL2_VERSION_STRING, human-readable string containing the version of SDL
|
|
||||||
#
|
|
||||||
# This module responds to the flag:
|
|
||||||
# SDL2_BUILDING_LIBRARY
|
|
||||||
# If this is defined, then no SDL2_main will be linked in because
|
|
||||||
# only applications need main().
|
|
||||||
# Otherwise, it is assumed you are building an application and this
|
|
||||||
# module will attempt to locate and set the proper link flags
|
|
||||||
# as part of the returned SDL2_LIBRARY variable.
|
|
||||||
#
|
|
||||||
# Don't forget to include SDLmain.h and SDLmain.m your project for the
|
|
||||||
# OS X framework based version. (Other versions link to -lSDLmain which
|
|
||||||
# this module will try to find on your behalf.) Also for OS X, this
|
|
||||||
# module will automatically add the -framework Cocoa on your behalf.
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# Additional Note: If you see an empty SDL2_LIBRARY_TEMP in your configuration
|
|
||||||
# and no SDL2_LIBRARY, it means CMake did not find your SDL library
|
|
||||||
# (SDL.dll, libsdl.so, SDL.framework, etc).
|
|
||||||
# Set SDL2_LIBRARY_TEMP to point to your SDL library, and configure again.
|
|
||||||
# Similarly, if you see an empty SDL2MAIN_LIBRARY, you should set this value
|
|
||||||
# as appropriate. These values are used to generate the final SDL2_LIBRARY
|
|
||||||
# variable, but when these values are unset, SDL2_LIBRARY does not get created.
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# $SDLDIR is an environment variable that would
|
|
||||||
# correspond to the ./configure --prefix=$SDLDIR
|
|
||||||
# used in building SDL.
|
|
||||||
# l.e.galup 9-20-02
|
|
||||||
#
|
|
||||||
# Modified by Eric Wing.
|
|
||||||
# Added code to assist with automated building by using environmental variables
|
|
||||||
# and providing a more controlled/consistent search behavior.
|
|
||||||
# Added new modifications to recognize OS X frameworks and
|
|
||||||
# additional Unix paths (FreeBSD, etc).
|
|
||||||
# Also corrected the header search path to follow "proper" SDL guidelines.
|
|
||||||
# Added a search for SDLmain which is needed by some platforms.
|
|
||||||
# Added a search for threads which is needed by some platforms.
|
|
||||||
# Added needed compile switches for MinGW.
|
|
||||||
#
|
|
||||||
# On OSX, this will prefer the Framework version (if found) over others.
|
|
||||||
# People will have to manually change the cache values of
|
|
||||||
# SDL2_LIBRARY to override this selection or set the CMake environment
|
|
||||||
# CMAKE_INCLUDE_PATH to modify the search paths.
|
|
||||||
#
|
|
||||||
# Note that the header path has changed from SDL/SDL.h to just SDL.h
|
|
||||||
# This needed to change because "proper" SDL convention
|
|
||||||
# is #include "SDL.h", not <SDL/SDL.h>. This is done for portability
|
|
||||||
# reasons because not all systems place things in SDL/ (see FreeBSD).
|
|
||||||
|
|
||||||
#=============================================================================
|
|
||||||
# Copyright 2003-2009 Kitware, Inc.
|
|
||||||
# Copyright 2012 Benjamin Eikel
|
|
||||||
#
|
|
||||||
# Distributed under the OSI-approved BSD License (the "License");
|
|
||||||
# see accompanying file Copyright.txt for details.
|
|
||||||
#
|
|
||||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
||||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
# See the License for more information.
|
|
||||||
#=============================================================================
|
|
||||||
# (To distribute this file outside of CMake, substitute the full
|
|
||||||
# License text for the above reference.)
|
|
||||||
|
|
||||||
find_path(SDL2_INCLUDE_DIR SDL.h
|
|
||||||
HINTS
|
|
||||||
ENV SDL2DIR
|
|
||||||
PATH_SUFFIXES include/SDL2
|
|
||||||
)
|
|
||||||
|
|
||||||
# SDL-1.1 is the name used by FreeBSD ports...
|
|
||||||
# don't confuse it for the version number.
|
|
||||||
find_library(SDL2_LIBRARY_TEMP
|
|
||||||
NAMES SDL2
|
|
||||||
HINTS
|
|
||||||
ENV SDL2DIR
|
|
||||||
PATH_SUFFIXES lib
|
|
||||||
)
|
|
||||||
|
|
||||||
if(NOT SDL2_BUILDING_LIBRARY)
|
|
||||||
if(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework")
|
|
||||||
# Non-OS X framework versions expect you to also dynamically link to
|
|
||||||
# SDLmain. This is mainly for Windows and OS X. Other (Unix) platforms
|
|
||||||
# seem to provide SDLmain for compatibility even though they don't
|
|
||||||
# necessarily need it.
|
|
||||||
find_library(SDL2MAIN_LIBRARY
|
|
||||||
NAMES SDL2main
|
|
||||||
HINTS
|
|
||||||
ENV SDL2DIR
|
|
||||||
PATH_SUFFIXES lib
|
|
||||||
PATHS
|
|
||||||
/sw
|
|
||||||
/opt/local
|
|
||||||
/opt/csw
|
|
||||||
/opt
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# SDL may require threads on your system.
|
|
||||||
# The Apple build may not need an explicit flag because one of the
|
|
||||||
# frameworks may already provide it.
|
|
||||||
# But for non-OSX systems, I will use the CMake Threads package.
|
|
||||||
if(NOT APPLE)
|
|
||||||
find_package(Threads)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# MinGW needs an additional library, mwindows
|
|
||||||
# It's total link flags should look like -lmingw32 -lSDLmain -lSDL -lmwindows
|
|
||||||
# (Actually on second look, I think it only needs one of the m* libraries.)
|
|
||||||
if(MINGW)
|
|
||||||
set(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(SDL2_LIBRARY_TEMP)
|
|
||||||
# For SDLmain
|
|
||||||
if(SDL2MAIN_LIBRARY AND NOT SDL2_BUILDING_LIBRARY)
|
|
||||||
list(FIND SDL2_LIBRARY_TEMP "${SDL2MAIN_LIBRARY}" _SDL2_MAIN_INDEX)
|
|
||||||
if(_SDL2_MAIN_INDEX EQUAL -1)
|
|
||||||
set(SDL2_LIBRARY_TEMP "${SDL2MAIN_LIBRARY}" ${SDL2_LIBRARY_TEMP})
|
|
||||||
endif()
|
|
||||||
unset(_SDL2_MAIN_INDEX)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# For OS X, SDL uses Cocoa as a backend so it must link to Cocoa.
|
|
||||||
# CMake doesn't display the -framework Cocoa string in the UI even
|
|
||||||
# though it actually is there if I modify a pre-used variable.
|
|
||||||
# I think it has something to do with the CACHE STRING.
|
|
||||||
# So I use a temporary variable until the end so I can set the
|
|
||||||
# "real" variable in one-shot.
|
|
||||||
if(APPLE)
|
|
||||||
set(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} "-framework Cocoa")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# For threads, as mentioned Apple doesn't need this.
|
|
||||||
# In fact, there seems to be a problem if I used the Threads package
|
|
||||||
# and try using this line, so I'm just skipping it entirely for OS X.
|
|
||||||
if(NOT APPLE)
|
|
||||||
set(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# For MinGW library
|
|
||||||
if(MINGW)
|
|
||||||
set(SDL2_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL2_LIBRARY_TEMP})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Set the final string here so the GUI reflects the final state.
|
|
||||||
set(SDL2_LIBRARY ${SDL2_LIBRARY_TEMP} CACHE STRING "Where the SDL Library can be found")
|
|
||||||
# Set the temp variable to INTERNAL so it is not seen in the CMake GUI
|
|
||||||
set(SDL2_LIBRARY_TEMP "${SDL2_LIBRARY_TEMP}" CACHE INTERNAL "")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(SDL2_INCLUDE_DIR AND EXISTS "${SDL2_INCLUDE_DIR}/SDL2_version.h")
|
|
||||||
file(STRINGS "${SDL2_INCLUDE_DIR}/SDL2_version.h" SDL2_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL2_MAJOR_VERSION[ \t]+[0-9]+$")
|
|
||||||
file(STRINGS "${SDL2_INCLUDE_DIR}/SDL2_version.h" SDL2_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL2_MINOR_VERSION[ \t]+[0-9]+$")
|
|
||||||
file(STRINGS "${SDL2_INCLUDE_DIR}/SDL2_version.h" SDL2_VERSION_PATCH_LINE REGEX "^#define[ \t]+SDL2_PATCHLEVEL[ \t]+[0-9]+$")
|
|
||||||
string(REGEX REPLACE "^#define[ \t]+SDL2_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL2_VERSION_MAJOR "${SDL2_VERSION_MAJOR_LINE}")
|
|
||||||
string(REGEX REPLACE "^#define[ \t]+SDL2_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL2_VERSION_MINOR "${SDL2_VERSION_MINOR_LINE}")
|
|
||||||
string(REGEX REPLACE "^#define[ \t]+SDL2_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL2_VERSION_PATCH "${SDL2_VERSION_PATCH_LINE}")
|
|
||||||
set(SDL2_VERSION_STRING ${SDL2_VERSION_MAJOR}.${SDL2_VERSION_MINOR}.${SDL2_VERSION_PATCH})
|
|
||||||
unset(SDL2_VERSION_MAJOR_LINE)
|
|
||||||
unset(SDL2_VERSION_MINOR_LINE)
|
|
||||||
unset(SDL2_VERSION_PATCH_LINE)
|
|
||||||
unset(SDL2_VERSION_MAJOR)
|
|
||||||
unset(SDL2_VERSION_MINOR)
|
|
||||||
unset(SDL2_VERSION_PATCH)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
|
||||||
|
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2
|
|
||||||
REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR
|
|
||||||
VERSION_VAR SDL2_VERSION_STRING)
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
# Locate V8
|
|
||||||
# This module defines
|
|
||||||
# V8_LIBRARY
|
|
||||||
# V8_FOUND, if false, do not try to link to gdal
|
|
||||||
# V8_INCLUDE_DIR, where to find the headers
|
|
||||||
#
|
|
||||||
# $V8_DIR is an environment variable that would
|
|
||||||
# correspond to the ./configure --prefix=$V8_DIR
|
|
||||||
#
|
|
||||||
# Created by Robert Osfield (based on FindFLTK.cmake)
|
|
||||||
|
|
||||||
FIND_PATH(V8_INCLUDE_DIR v8.h
|
|
||||||
$ENV{V8_DIR}/include
|
|
||||||
$ENV{V8_DIR}
|
|
||||||
~/Library/Frameworks
|
|
||||||
/Library/Frameworks
|
|
||||||
/usr/local/include
|
|
||||||
/usr/include
|
|
||||||
/sw/include # Fink
|
|
||||||
/opt/local/include # DarwinPorts
|
|
||||||
/opt/csw/include # Blastwave
|
|
||||||
/opt/include
|
|
||||||
/usr/freeware/include
|
|
||||||
)
|
|
||||||
|
|
||||||
FIND_LIBRARY(V8_LIBRARY
|
|
||||||
NAMES v8 libv8
|
|
||||||
PATHS
|
|
||||||
$ENV{V8_DIR}/lib
|
|
||||||
$ENV{V8_DIR}
|
|
||||||
~/Library/Frameworks
|
|
||||||
/Library/Frameworks
|
|
||||||
/usr/local/lib
|
|
||||||
/usr/lib
|
|
||||||
/sw/lib
|
|
||||||
/opt/local/lib
|
|
||||||
/opt/csw/lib
|
|
||||||
/opt/lib
|
|
||||||
/usr/freeware/lib64
|
|
||||||
)
|
|
||||||
|
|
||||||
SET(V8_FOUND "NO")
|
|
||||||
IF(V8_LIBRARY AND V8_INCLUDE_DIR)
|
|
||||||
SET(V8_FOUND "YES")
|
|
||||||
ENDIF()
|
|
||||||
@@ -10,16 +10,6 @@
|
|||||||
#
|
#
|
||||||
# Created by Ulrich Hertlein.
|
# Created by Ulrich Hertlein.
|
||||||
|
|
||||||
# prefer FindZLIB from cmake distribution
|
|
||||||
if(EXISTS ${CMAKE_ROOT}/Modules/FindZLIB.cmake)
|
|
||||||
include(${CMAKE_ROOT}/Modules/FindZLIB.cmake)
|
|
||||||
|
|
||||||
if(ZLIB_FOUND)
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
FIND_PATH(ZLIB_INCLUDE_DIR zlib.h
|
FIND_PATH(ZLIB_INCLUDE_DIR zlib.h
|
||||||
$ENV{ZLIB_DIR}/include
|
$ENV{ZLIB_DIR}/include
|
||||||
$ENV{ZLIB_DIR}
|
$ENV{ZLIB_DIR}
|
||||||
|
|||||||
@@ -1,47 +0,0 @@
|
|||||||
# Locate ZeroConf / Bonjour
|
|
||||||
# This module defines
|
|
||||||
# ZEROCONF_LIBRARY
|
|
||||||
# ZEROCONF_FOUND, if false, do not try to link to gdal
|
|
||||||
# ZEROCONF_INCLUDE_DIR, where to find the headers
|
|
||||||
#
|
|
||||||
# $ZEROCONF_DIR is an environment variable that would
|
|
||||||
# correspond to the ./configure --prefix=$ZEROCONF_DIR
|
|
||||||
|
|
||||||
# Created by Stephan Maximilian Huber
|
|
||||||
|
|
||||||
SET(ZEROCONF_FOUND "NO")
|
|
||||||
|
|
||||||
IF(APPLE)
|
|
||||||
# bonjour is part of the system on os x / ios
|
|
||||||
SET(ZEROCONF_FOUND "YES")
|
|
||||||
ELSE()
|
|
||||||
IF(WIN32)
|
|
||||||
# find the Bonjour SDK
|
|
||||||
FIND_PATH(ZEROCONF_INCLUDE_DIR dnssd.h
|
|
||||||
$ENV{ZEROCONF_DIR}/include
|
|
||||||
$ENV{ZEROCONF_DIR}
|
|
||||||
NO_DEFAULT_PATH
|
|
||||||
)
|
|
||||||
FIND_PATH(ZEROCONF_INCLUDE_DIR dnssd.h
|
|
||||||
PATHS ${CMAKE_PREFIX_PATH} # Unofficial: We are proposing this.
|
|
||||||
NO_DEFAULT_PATH
|
|
||||||
PATH_SUFFIXES include
|
|
||||||
)
|
|
||||||
FIND_PATH(ZEROCONF_INCLUDE_DIR dnssd.h)
|
|
||||||
|
|
||||||
FIND_LIBRARY(ZEROCONF_LIBRARY dnssd
|
|
||||||
PATHS ${CMAKE_PREFIX_PATH} # Unofficial: We are proposing this.
|
|
||||||
NO_DEFAULT_PATH
|
|
||||||
PATH_SUFFIXES lib64 lib
|
|
||||||
)
|
|
||||||
FIND_LIBRARY(ZEROCONF_LIBRARY dnssd)
|
|
||||||
|
|
||||||
SET(ZEROCONF_FOUND "NO")
|
|
||||||
IF(ZEROCONF_LIBRARY AND ZEROCONF_INCLUDE_DIR)
|
|
||||||
SET(ZEROCONF_FOUND "YES")
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
ELSE()
|
|
||||||
# TODO find AVAHI on linux
|
|
||||||
ENDIF()
|
|
||||||
ENDIF()
|
|
||||||
@@ -25,6 +25,14 @@ IF(MSVC AND OSG_MSVC_VERSIONED_DLL)
|
|||||||
HANDLE_MSVC_DLL()
|
HANDLE_MSVC_DLL()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
IF(ANDROID)
|
||||||
|
INSTALL (
|
||||||
|
FILES ${TARGET_H}
|
||||||
|
DESTINATION ${INSTALL_INCDIR}/${LIB_NAME}
|
||||||
|
COMPONENT libopenscenegraph-dev
|
||||||
|
)
|
||||||
|
ELSE(ANDROID)
|
||||||
|
|
||||||
INSTALL(
|
INSTALL(
|
||||||
TARGETS ${LIB_NAME}
|
TARGETS ${LIB_NAME}
|
||||||
RUNTIME DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph
|
RUNTIME DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph
|
||||||
@@ -51,3 +59,4 @@ ELSE()
|
|||||||
# MESSAGE("${OSG_COMPILE_FRAMEWORKS_INSTALL_NAME_DIR}")
|
# MESSAGE("${OSG_COMPILE_FRAMEWORKS_INSTALL_NAME_DIR}")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
ENDIF(ANDROID)
|
||||||
|
|||||||
@@ -1,15 +1,12 @@
|
|||||||
MACRO(SETUP_ANDROID_LIBRARY LIB_NAME)
|
MACRO(SETUP_ANDROID_LIBRARY LIB_NAME)
|
||||||
|
|
||||||
#foreach(arg ${TARGET_LIBRARIES})
|
foreach(arg ${TARGET_LIBRARIES})
|
||||||
# set(MODULE_LIBS "${MODULE_LIBS} -l${arg}")
|
set(MODULE_LIBS "${MODULE_LIBS} -l${arg}")
|
||||||
#endforeach(arg ${TARGET_LIBRARIES})
|
endforeach(arg ${TARGET_LIBRARIES})
|
||||||
|
|
||||||
foreach(arg ${TARGET_SRC})
|
foreach(arg ${TARGET_SRC})
|
||||||
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" n_f ${arg})
|
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" n_f ${arg})
|
||||||
IF ("${arg}" MATCHES ".*\\.c$" OR "${arg}" MATCHES ".*\\.cpp$")
|
set(MODULE_SOURCES "${MODULE_SOURCES} ${n_f}")
|
||||||
#We only include source files, not header files, this removes anoying warnings
|
|
||||||
set(MODULE_SOURCES "${MODULE_SOURCES} ${n_f}")
|
|
||||||
ENDIF()
|
|
||||||
endforeach(arg ${TARGET_SRC})
|
endforeach(arg ${TARGET_SRC})
|
||||||
|
|
||||||
#SET(MODULE_INCLUDES "${CMAKE_SOURCE_DIR}/include include")
|
#SET(MODULE_INCLUDES "${CMAKE_SOURCE_DIR}/include include")
|
||||||
@@ -38,8 +35,7 @@ MACRO(SETUP_ANDROID_LIBRARY LIB_NAME)
|
|||||||
ELSEIF(OSG_GLES2_AVAILABLE)
|
ELSEIF(OSG_GLES2_AVAILABLE)
|
||||||
SET(OPENGLES_LIBRARY -lGLESv2)
|
SET(OPENGLES_LIBRARY -lGLESv2)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
#${MODULE_LIBS}
|
set(MODULE_LIBS "${MODULE_LIBS} ${OPENGLES_LIBRARY} -ldl")
|
||||||
set(MODULE_LIBS_FLAGS "${OPENGLES_LIBRARY} -ldl")
|
|
||||||
if(NOT CPP_EXTENSION)
|
if(NOT CPP_EXTENSION)
|
||||||
set(CPP_EXTENSION "cpp")
|
set(CPP_EXTENSION "cpp")
|
||||||
endif()
|
endif()
|
||||||
@@ -48,12 +44,8 @@ MACRO(SETUP_ANDROID_LIBRARY LIB_NAME)
|
|||||||
ENDIF()
|
ENDIF()
|
||||||
IF("MODULE_USER_STATIC_OR_DYNAMIC" MATCHES "STATIC")
|
IF("MODULE_USER_STATIC_OR_DYNAMIC" MATCHES "STATIC")
|
||||||
SET(MODULE_BUILD_TYPE "\$\(BUILD_STATIC_LIBRARY\)")
|
SET(MODULE_BUILD_TYPE "\$\(BUILD_STATIC_LIBRARY\)")
|
||||||
SET(MODULE_LIBS_SHARED " ")
|
|
||||||
SET(MODULE_LIBS_STATIC ${TARGET_LIBRARIES})
|
|
||||||
ELSE()
|
ELSE()
|
||||||
SET(MODULE_BUILD_TYPE "\$\(BUILD_SHARED_LIBRARY\)")
|
SET(MODULE_BUILD_TYPE "\$\(BUILD_DYNAMIC_LIBRARY\)")
|
||||||
SET(MODULE_LIBS_SHARED ${TARGET_LIBRARIES})
|
|
||||||
SET(MODULE_LIBS_STATIC " ")
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
set(ENV{AND_OSG_LIB_NAMES} "$ENV{AND_OSG_LIB_NAMES} ${LIB_NAME}")
|
set(ENV{AND_OSG_LIB_NAMES} "$ENV{AND_OSG_LIB_NAMES} ${LIB_NAME}")
|
||||||
set(ENV{AND_OSG_LIB_PATHS} "$ENV{AND_OSG_LIB_PATHS}include ${CMAKE_CURRENT_BINARY_DIR}/Android.mk \n")
|
set(ENV{AND_OSG_LIB_PATHS} "$ENV{AND_OSG_LIB_PATHS}include ${CMAKE_CURRENT_BINARY_DIR}/Android.mk \n")
|
||||||
@@ -67,7 +59,7 @@ MACRO(ANDROID_3RD_PARTY)
|
|||||||
#JPEG
|
#JPEG
|
||||||
################################################
|
################################################
|
||||||
FIND_PATH(JPEG_INCLUDE_DIR Android.mk
|
FIND_PATH(JPEG_INCLUDE_DIR Android.mk
|
||||||
${CMAKE_SOURCE_DIR}/3rdparty/libjpeg NO_CMAKE_FIND_ROOT_PATH
|
${CMAKE_SOURCE_DIR}/3rdparty/libjpeg
|
||||||
)
|
)
|
||||||
#set(ENV{AND_OSG_LIB_NAMES} "$ENV{AND_OSG_LIB_NAMES} libjpeg")
|
#set(ENV{AND_OSG_LIB_NAMES} "$ENV{AND_OSG_LIB_NAMES} libjpeg")
|
||||||
#set(ENV{AND_OSG_LIB_PATHS} "$ENV{AND_OSG_LIB_PATHS}include ${JPEG_INCLUDE_DIR}/Android.mk \n")
|
#set(ENV{AND_OSG_LIB_PATHS} "$ENV{AND_OSG_LIB_PATHS}include ${JPEG_INCLUDE_DIR}/Android.mk \n")
|
||||||
@@ -82,7 +74,7 @@ MACRO(ANDROID_3RD_PARTY)
|
|||||||
#PNG
|
#PNG
|
||||||
################################################
|
################################################
|
||||||
FIND_PATH(PNG_INCLUDE_DIR Android.mk
|
FIND_PATH(PNG_INCLUDE_DIR Android.mk
|
||||||
${CMAKE_SOURCE_DIR}/3rdparty/libpng NO_CMAKE_FIND_ROOT_PATH
|
${CMAKE_SOURCE_DIR}/3rdparty/libpng
|
||||||
)
|
)
|
||||||
#set(ENV{AND_OSG_LIB_NAMES} "$ENV{AND_OSG_LIB_NAMES} libpng")
|
#set(ENV{AND_OSG_LIB_NAMES} "$ENV{AND_OSG_LIB_NAMES} libpng")
|
||||||
#set(ENV{AND_OSG_LIB_PATHS} "$ENV{AND_OSG_LIB_PATHS}include ${PNG_INCLUDE_DIR}/Android.mk \n")
|
#set(ENV{AND_OSG_LIB_PATHS} "$ENV{AND_OSG_LIB_PATHS}include ${PNG_INCLUDE_DIR}/Android.mk \n")
|
||||||
@@ -97,7 +89,7 @@ MACRO(ANDROID_3RD_PARTY)
|
|||||||
#GIF
|
#GIF
|
||||||
################################################
|
################################################
|
||||||
FIND_PATH(GIFLIB_INCLUDE_DIR Android.mk
|
FIND_PATH(GIFLIB_INCLUDE_DIR Android.mk
|
||||||
${CMAKE_SOURCE_DIR}/3rdparty/giflib NO_CMAKE_FIND_ROOT_PATH
|
${CMAKE_SOURCE_DIR}/3rdparty/giflib
|
||||||
)
|
)
|
||||||
#set(ENV{AND_OSG_LIB_NAMES} "$ENV{AND_OSG_LIB_NAMES} libgif")
|
#set(ENV{AND_OSG_LIB_NAMES} "$ENV{AND_OSG_LIB_NAMES} libgif")
|
||||||
#set(ENV{AND_OSG_LIB_PATHS} "$ENV{AND_OSG_LIB_PATHS}include ${GIFLIB_INCLUDE_DIR}/Android.mk \n")
|
#set(ENV{AND_OSG_LIB_PATHS} "$ENV{AND_OSG_LIB_PATHS}include ${GIFLIB_INCLUDE_DIR}/Android.mk \n")
|
||||||
@@ -112,7 +104,7 @@ MACRO(ANDROID_3RD_PARTY)
|
|||||||
#TIF
|
#TIF
|
||||||
################################################
|
################################################
|
||||||
FIND_PATH(TIFF_INCLUDE_DIR Android.mk
|
FIND_PATH(TIFF_INCLUDE_DIR Android.mk
|
||||||
${CMAKE_SOURCE_DIR}/3rdparty/libtiff NO_CMAKE_FIND_ROOT_PATH
|
${CMAKE_SOURCE_DIR}/3rdparty/libtiff
|
||||||
)
|
)
|
||||||
#set(ENV{AND_OSG_LIB_NAMES} "$ENV{AND_OSG_LIB_NAMES} libtiff")
|
#set(ENV{AND_OSG_LIB_NAMES} "$ENV{AND_OSG_LIB_NAMES} libtiff")
|
||||||
#set(ENV{AND_OSG_LIB_PATHS} "$ENV{AND_OSG_LIB_PATHS}include ${TIFF_INCLUDE_DIR}/Android.mk \n")
|
#set(ENV{AND_OSG_LIB_PATHS} "$ENV{AND_OSG_LIB_PATHS}include ${TIFF_INCLUDE_DIR}/Android.mk \n")
|
||||||
@@ -142,7 +134,7 @@ MACRO(ANDROID_3RD_PARTY)
|
|||||||
#CURL
|
#CURL
|
||||||
################################################
|
################################################
|
||||||
FIND_PATH(CURL_DIR Android.mk
|
FIND_PATH(CURL_DIR Android.mk
|
||||||
${CMAKE_SOURCE_DIR}/3rdparty/curl NO_CMAKE_FIND_ROOT_PATH
|
${CMAKE_SOURCE_DIR}/3rdparty/curl
|
||||||
)
|
)
|
||||||
#set(ENV{AND_OSG_LIB_NAMES} "$ENV{AND_OSG_LIB_NAMES} libcurl")
|
#set(ENV{AND_OSG_LIB_NAMES} "$ENV{AND_OSG_LIB_NAMES} libcurl")
|
||||||
#set(ENV{AND_OSG_LIB_PATHS} "$ENV{AND_OSG_LIB_PATHS}include ${CURL_DIR}/Android.mk \n")
|
#set(ENV{AND_OSG_LIB_PATHS} "$ENV{AND_OSG_LIB_PATHS}include ${CURL_DIR}/Android.mk \n")
|
||||||
@@ -159,11 +151,11 @@ MACRO(ANDROID_3RD_PARTY)
|
|||||||
#FREETYPE
|
#FREETYPE
|
||||||
################################################
|
################################################
|
||||||
FIND_PATH(FREETYPE_DIR Android.mk
|
FIND_PATH(FREETYPE_DIR Android.mk
|
||||||
${CMAKE_SOURCE_DIR}/3rdparty/freetype NO_CMAKE_FIND_ROOT_PATH
|
${CMAKE_SOURCE_DIR}/3rdparty/freetype
|
||||||
)
|
)
|
||||||
#set(ENV{AND_OSG_LIB_NAMES} "$ENV{AND_OSG_LIB_NAMES} libft2")
|
#set(ENV{AND_OSG_LIB_NAMES} "$ENV{AND_OSG_LIB_NAMES} libft2")
|
||||||
#set(ENV{AND_OSG_LIB_PATHS} "$ENV{AND_OSG_LIB_PATHS}include ${FREETYPE_DIR}/Android.mk \n")
|
#set(ENV{AND_OSG_LIB_PATHS} "$ENV{AND_OSG_LIB_PATHS}include ${FREETYPE_DIR}/Android.mk \n")
|
||||||
set(FREETYPE_INCLUDE_DIRS ${FREETYPE_DIR}/include ${FREETYPE_DIR}/include/freetype/config)
|
set(FREETYPE_INCLUDE_DIRS "${FREETYPE_DIR}/include ${FREETYPE_DIR}/include/freetype/config")
|
||||||
if(FREETYPE_DIR)
|
if(FREETYPE_DIR)
|
||||||
message(STATUS "FREETYPE found ${FREETYPE_DIR}" )
|
message(STATUS "FREETYPE found ${FREETYPE_DIR}" )
|
||||||
set(FREETYPE_FOUND "Yes")
|
set(FREETYPE_FOUND "Yes")
|
||||||
@@ -175,7 +167,7 @@ MACRO(ANDROID_3RD_PARTY)
|
|||||||
#GDAL
|
#GDAL
|
||||||
################################################
|
################################################
|
||||||
FIND_PATH(GDAL_DIR gdal.h
|
FIND_PATH(GDAL_DIR gdal.h
|
||||||
${CMAKE_SOURCE_DIR}/3rdparty/gdal/include NO_CMAKE_FIND_ROOT_PATH
|
${CMAKE_SOURCE_DIR}/3rdparty/gdal/include
|
||||||
)
|
)
|
||||||
set(GDAL_INCLUDE_DIR "${GDAL_DIR}")
|
set(GDAL_INCLUDE_DIR "${GDAL_DIR}")
|
||||||
if(GDAL_DIR)
|
if(GDAL_DIR)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
# full path of the library name. in order to differentiate release and debug, this macro get the
|
# full path of the library name. in order to differentiate release and debug, this macro get the
|
||||||
# NAME of the variables, so the macro gets as arguments the target name and the following list of parameters
|
# NAME of the variables, so the macro gets as arguments the target name and the following list of parameters
|
||||||
# is intended as a list of variable names each one containing the path of the libraries to link to
|
# is intended as a list of variable names each one containing the path of the libraries to link to
|
||||||
# The existence of a variable name with _DEBUG appended is tested and, in case it' s value is used
|
# The existance of a variable name with _DEBUG appended is tested and, in case it' s value is used
|
||||||
# for linking to when in debug mode
|
# for linking to when in debug mode
|
||||||
# the content of this library for linking when in debugging
|
# the content of this library for linking when in debugging
|
||||||
#######################################################################################################
|
#######################################################################################################
|
||||||
@@ -212,10 +212,9 @@ ENDMACRO(SET_OUTPUT_DIR_PROPERTY_260 TARGET_TARGETNAME RELATIVE_OUTDIR)
|
|||||||
##########################################################################################################
|
##########################################################################################################
|
||||||
|
|
||||||
MACRO(SETUP_LIBRARY LIB_NAME)
|
MACRO(SETUP_LIBRARY LIB_NAME)
|
||||||
IF(GLCORE_FOUND)
|
IF(ANDROID)
|
||||||
INCLUDE_DIRECTORIES( ${GLCORE_INCLUDE_DIR} )
|
SETUP_ANDROID_LIBRARY(${LIB_NAME})
|
||||||
ENDIF()
|
ELSE()
|
||||||
|
|
||||||
SET(TARGET_NAME ${LIB_NAME} )
|
SET(TARGET_NAME ${LIB_NAME} )
|
||||||
SET(TARGET_TARGETNAME ${LIB_NAME} )
|
SET(TARGET_TARGETNAME ${LIB_NAME} )
|
||||||
ADD_LIBRARY(${LIB_NAME}
|
ADD_LIBRARY(${LIB_NAME}
|
||||||
@@ -225,9 +224,6 @@ 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)
|
||||||
@@ -243,13 +239,14 @@ MACRO(SETUP_LIBRARY LIB_NAME)
|
|||||||
ENDIF(TARGET_LIBRARIES_VARS)
|
ENDIF(TARGET_LIBRARIES_VARS)
|
||||||
LINK_CORELIB_DEFAULT(${LIB_NAME})
|
LINK_CORELIB_DEFAULT(${LIB_NAME})
|
||||||
|
|
||||||
|
ENDIF()
|
||||||
INCLUDE(ModuleInstall OPTIONAL)
|
INCLUDE(ModuleInstall OPTIONAL)
|
||||||
ENDMACRO(SETUP_LIBRARY LIB_NAME)
|
ENDMACRO(SETUP_LIBRARY LIB_NAME)
|
||||||
|
|
||||||
MACRO(SETUP_PLUGIN PLUGIN_NAME)
|
MACRO(SETUP_PLUGIN PLUGIN_NAME)
|
||||||
IF(GLCORE_FOUND)
|
IF(ANDROID)
|
||||||
INCLUDE_DIRECTORIES( ${GLCORE_INCLUDE_DIR} )
|
SETUP_ANDROID_LIBRARY(${TARGET_DEFAULT_PREFIX}${PLUGIN_NAME})
|
||||||
ENDIF()
|
ELSE()
|
||||||
|
|
||||||
SET(TARGET_NAME ${PLUGIN_NAME} )
|
SET(TARGET_NAME ${PLUGIN_NAME} )
|
||||||
|
|
||||||
@@ -282,7 +279,12 @@ 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)
|
||||||
|
|
||||||
IF(MSVC)
|
#not sure if needed, but for plugins only Msvc need the d suffix
|
||||||
|
IF(NOT MSVC)
|
||||||
|
IF(NOT UNIX)
|
||||||
|
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES DEBUG_POSTFIX "")
|
||||||
|
ENDIF(NOT UNIX)
|
||||||
|
ELSE(NOT MSVC)
|
||||||
IF(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)
|
||||||
@@ -311,13 +313,11 @@ MACRO(SETUP_PLUGIN PLUGIN_NAME)
|
|||||||
ENDIF(OSG_MSVC_VERSIONED_DLL)
|
ENDIF(OSG_MSVC_VERSIONED_DLL)
|
||||||
|
|
||||||
ENDIF(NOT CMAKE24)
|
ENDIF(NOT CMAKE24)
|
||||||
ENDIF(MSVC)
|
ENDIF(NOT 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}
|
||||||
@@ -332,6 +332,7 @@ MACRO(SETUP_PLUGIN PLUGIN_NAME)
|
|||||||
ARCHIVE DESTINATION lib${LIB_POSTFIX}/${OSG_PLUGINS} COMPONENT libopenscenegraph-dev
|
ARCHIVE DESTINATION lib${LIB_POSTFIX}/${OSG_PLUGINS} COMPONENT libopenscenegraph-dev
|
||||||
LIBRARY DESTINATION lib${LIB_POSTFIX}/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT})
|
LIBRARY DESTINATION lib${LIB_POSTFIX}/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT})
|
||||||
ENDIF(WIN32)
|
ENDIF(WIN32)
|
||||||
|
ENDIF()
|
||||||
ENDMACRO(SETUP_PLUGIN)
|
ENDMACRO(SETUP_PLUGIN)
|
||||||
|
|
||||||
|
|
||||||
@@ -341,10 +342,6 @@ ENDMACRO(SETUP_PLUGIN)
|
|||||||
|
|
||||||
MACRO(SETUP_EXE IS_COMMANDLINE_APP)
|
MACRO(SETUP_EXE IS_COMMANDLINE_APP)
|
||||||
#MESSAGE("in -->SETUP_EXE<-- ${TARGET_NAME}-->${TARGET_SRC} <--> ${TARGET_H}<--")
|
#MESSAGE("in -->SETUP_EXE<-- ${TARGET_NAME}-->${TARGET_SRC} <--> ${TARGET_H}<--")
|
||||||
IF(GL3_FOUND)
|
|
||||||
INCLUDE_DIRECTORIES( ${GLCORE_INCLUDE_DIR} )
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
IF(NOT TARGET_TARGETNAME)
|
IF(NOT TARGET_TARGETNAME)
|
||||||
SET(TARGET_TARGETNAME "${TARGET_DEFAULT_PREFIX}${TARGET_NAME}")
|
SET(TARGET_TARGETNAME "${TARGET_DEFAULT_PREFIX}${TARGET_NAME}")
|
||||||
ENDIF(NOT TARGET_TARGETNAME)
|
ENDIF(NOT TARGET_TARGETNAME)
|
||||||
@@ -366,8 +363,6 @@ 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 "")
|
||||||
@@ -401,10 +396,6 @@ 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)
|
||||||
@@ -530,7 +521,3 @@ 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()
|
|
||||||
|
|||||||
51
NEWS.txt
51
NEWS.txt
@@ -1,57 +1,6 @@
|
|||||||
OSG News
|
OSG News
|
||||||
========
|
========
|
||||||
|
|
||||||
= !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.
|
||||||
|
|||||||
@@ -1,36 +1,27 @@
|
|||||||
#ANDROID makefile ${MODULE_NAME}
|
#ANDROID makefile ${MODULE_NAME}
|
||||||
|
|
||||||
LOCAL_PATH := ${MODULE_DIR}
|
LOCAL_PATH := ${MODULE_DIR}
|
||||||
|
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
|
|
||||||
ifeq (${ANDROID_OPTIM_NEON},true)
|
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
|
||||||
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
|
LOCAL_ARM_NEON := true
|
||||||
LOCAL_ARM_NEON := true
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq (${ANDROID_OPTIM_ARM32},true)
|
LOCAL_CPP_EXTENSION := ${CPP_EXTENSION}
|
||||||
LOCAL_ARM_MODE := arm
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
LOCAL_LDLIBS := ${MODULE_LIBS}
|
||||||
|
|
||||||
LOCAL_CPP_EXTENSION := ${CPP_EXTENSION}
|
LOCAL_MODULE := ${MODULE_NAME}
|
||||||
|
|
||||||
LOCAL_LDLIBS := ${MODULE_LIBS_FLAGS}
|
LOCAL_SRC_FILES := ${MODULE_SOURCES}
|
||||||
|
|
||||||
LOCAL_MODULE := ${MODULE_NAME}
|
LOCAL_C_INCLUDES := ${MODULE_INCLUDES}
|
||||||
|
|
||||||
LOCAL_SRC_FILES := ${MODULE_SOURCES}
|
LOCAL_CFLAGS := ${MODULE_FLAGS_C}
|
||||||
|
|
||||||
LOCAL_C_INCLUDES := ${MODULE_INCLUDES}
|
LOCAL_CPPFLAGS := ${MODULE_FLAGS_CPP}
|
||||||
|
|
||||||
LOCAL_CFLAGS := ${MODULE_FLAGS_C}
|
|
||||||
|
|
||||||
LOCAL_CPPFLAGS := ${MODULE_FLAGS_CPP}
|
|
||||||
|
|
||||||
LOCAL_SHARED_LIBRARIES := ${MODULE_LIBS_SHARED}
|
|
||||||
LOCAL_STATIC_LIBRARIES := ${MODULE_LIBS_STATIC}
|
|
||||||
|
|
||||||
|
#include $(BUILD_STATIC_LIBRARY)
|
||||||
include ${MODULE_BUILD_TYPE}
|
include ${MODULE_BUILD_TYPE}
|
||||||
|
|
||||||
|
|||||||
@@ -3,5 +3,5 @@
|
|||||||
package="com.openscenegraph"
|
package="com.openscenegraph"
|
||||||
android:versionCode="1"
|
android:versionCode="1"
|
||||||
android:versionName="1.0">
|
android:versionName="1.0">
|
||||||
<uses-sdk android:minSdkVersion="8" />
|
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|||||||
@@ -2,14 +2,14 @@
|
|||||||
APP_BUILD_SCRIPT := $(call my-dir)/Android.mk
|
APP_BUILD_SCRIPT := $(call my-dir)/Android.mk
|
||||||
APP_PROJECT_PATH := $(call my-dir)
|
APP_PROJECT_PATH := $(call my-dir)
|
||||||
|
|
||||||
APP_OPTIM := ${ANDROID_RELEASE_OPTIM}
|
APP_OPTIM := release
|
||||||
|
|
||||||
APP_PLATFORM := android-${ANDROID_PLATFORM}
|
APP_PLATFORM := android-5
|
||||||
APP_STL := ${ANDROID_STL}
|
APP_STL := gnustl_static
|
||||||
APP_CPPFLAGS := -fexceptions -frtti
|
APP_CPPFLAGS := -fexceptions -frtti
|
||||||
#APP_CPPFLAGS := -Os -mthumb-interwork -fno-short-enums
|
#APP_CPPFLAGS := -Os -mthumb-interwork -fno-short-enums
|
||||||
#APP_CPPFLAGS := -Wl,--no-undefined
|
#APP_CPPFLAGS := -Wl,--no-undefined
|
||||||
|
|
||||||
APP_ABI := ${ANDROID_ABI}
|
APP_ABI := armeabi armeabi-v7a
|
||||||
|
|
||||||
APP_MODULES := $ENV{AND_OSG_LIB_NAMES}
|
APP_MODULES := $ENV{AND_OSG_LIB_NAMES}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
29
README.txt
29
README.txt
@@ -4,11 +4,15 @@ 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/index.php/documentation
|
http://www.openscenegraph.org
|
||||||
|
|
||||||
For support subscribe to our public mailing list or forum, details at:
|
For support subscribe to our public mailing list:
|
||||||
|
|
||||||
http://www.openscenegraph.org/index.php/support
|
http://www.openscenegraph.org/projects/osg/wiki/MailingLists
|
||||||
|
|
||||||
|
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:
|
||||||
@@ -23,7 +27,7 @@ more indepth instructions.
|
|||||||
|
|
||||||
Robert Osfield.
|
Robert Osfield.
|
||||||
Project Lead.
|
Project Lead.
|
||||||
12th August 2015.
|
28th June 2011.
|
||||||
|
|
||||||
--
|
--
|
||||||
|
|
||||||
@@ -43,12 +47,13 @@ OpenSceneGraph's CMake build can be found at:
|
|||||||
http://www.openscenegraph.org/projects/osg/wiki/Build/CMake
|
http://www.openscenegraph.org/projects/osg/wiki/Build/CMake
|
||||||
|
|
||||||
Under unices (i.e. Linux, IRIX, Solaris, Free-BSD, HP-Ux, AIX, OSX)
|
Under unices (i.e. Linux, IRIX, Solaris, Free-BSD, HP-Ux, AIX, OSX)
|
||||||
use the cmake or ccmake command-line utils. Note that cmake . defaults
|
use the cmake or ccmake command-line utils, or use the included tiny
|
||||||
to building Release to ensure that you get the best performance from
|
configure script that'll run cmake for you. The configure script
|
||||||
your final libraries/applications.
|
simply runs 'cmake . -DCMAKE_BUILD_TYPE=Release' to ensure that you
|
||||||
|
get the best performance from your final libraries/applications.
|
||||||
|
|
||||||
cd OpenSceneGraph
|
cd OpenSceneGraph
|
||||||
cmake .
|
./configure
|
||||||
make
|
make
|
||||||
sudo make install
|
sudo make install
|
||||||
|
|
||||||
@@ -61,7 +66,7 @@ directory alongside the OpenSceneGraph use:
|
|||||||
|
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake ../OpenSceneGraph
|
cmake ../OpenSceneGraph -DCMAKE_BUILD_TYPE=Release
|
||||||
make
|
make
|
||||||
sudo make install
|
sudo make install
|
||||||
|
|
||||||
@@ -69,7 +74,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/index.php/documentation/platform-specifics/windows
|
http://www.openscenegraph.org/projects/osg/wiki/Support/PlatformSpecifics/VisualStudio
|
||||||
|
|
||||||
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
|
||||||
@@ -78,7 +83,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/index.php/documentation/10-getting-started
|
http://www.openscenegraph.org/projects/osg/wiki/Support/GettingStarted
|
||||||
|
|
||||||
|
|
||||||
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
|
||||||
@@ -166,7 +171,7 @@ Section 3. Release notes on iOS build, by Thomas Hoghart
|
|||||||
This will give us the static build we need for iPhone.
|
This will give us the static build we need for iPhone.
|
||||||
* Disable OSG_GL1_AVAILABLE, OSG_GL2_AVAILABLE, OSG_GL3_AVAILABLE,
|
* Disable OSG_GL1_AVAILABLE, OSG_GL2_AVAILABLE, OSG_GL3_AVAILABLE,
|
||||||
OSG_GL_DISPLAYLISTS_AVAILABLE, OSG_GL_VERTEX_FUNCS_AVAILABLE
|
OSG_GL_DISPLAYLISTS_AVAILABLE, OSG_GL_VERTEX_FUNCS_AVAILABLE
|
||||||
* Enable OSG_GLES1_AVAILABLE *OR* OSG_GLES2_AVAILABLE *OR* OSG_GLES3_AVAILABLE (GLES3 will enable GLES2 features)
|
* Enable OSG_GLES1_AVAILABLE *OR* OSG_GLES2_AVAILABLE
|
||||||
* Ensure OSG_WINDOWING_SYSTEM is set to IOS
|
* Ensure OSG_WINDOWING_SYSTEM is set to IOS
|
||||||
* Change FREETYPE include and library paths to an iPhone version
|
* Change FREETYPE include and library paths to an iPhone version
|
||||||
(OpenFrameworks has one bundled with its distribution)
|
(OpenFrameworks has one bundled with its distribution)
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ int main( int argc, char **argv )
|
|||||||
|
|
||||||
// set up the usage document, in case we need to print out how to use this program.
|
// set up the usage document, in case we need to print out how to use this program.
|
||||||
arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName());
|
arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName());
|
||||||
arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is an application for collecting a set of separate files into a single archive file that can be later read in OSG applications..");
|
arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is an application for collecting a set of seperate files into a single archive file that can be later read in OSG applications..");
|
||||||
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ...");
|
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ...");
|
||||||
|
|
||||||
// if user request help write it out to cout.
|
// if user request help write it out to cout.
|
||||||
@@ -139,15 +139,7 @@ int main( int argc, char **argv )
|
|||||||
if (obj.valid())
|
if (obj.valid())
|
||||||
{
|
{
|
||||||
std::cout<<" write to archive "<<*itr<<std::endl;
|
std::cout<<" write to archive "<<*itr<<std::endl;
|
||||||
osg::Image* image = dynamic_cast<osg::Image*>(obj.get());
|
archive->writeObject(*obj, *itr);
|
||||||
osg::HeightField* hf = dynamic_cast<osg::HeightField*>(obj.get());
|
|
||||||
osg::Node* node = dynamic_cast<osg::Node*>(obj.get());
|
|
||||||
osg::Shader* shader = dynamic_cast<osg::Shader*>(obj.get());
|
|
||||||
if (image) archive->writeImage(*image, *itr);
|
|
||||||
else if (hf) archive->writeHeightField(*hf, *itr);
|
|
||||||
else if (node) archive->writeNode(*node, *itr);
|
|
||||||
else if (shader) archive->writeShader(*shader, *itr);
|
|
||||||
else archive->writeObject(*obj, *itr);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,7 +95,8 @@ public:
|
|||||||
{
|
{
|
||||||
osg::ref_ptr< osg::Vec3Array > newnormals = new osg::Vec3Array;
|
osg::ref_ptr< osg::Vec3Array > newnormals = new osg::Vec3Array;
|
||||||
newnormals->push_back( osg::Z_AXIS );
|
newnormals->push_back( osg::Z_AXIS );
|
||||||
geometry->setNormalArray( newnormals.get(), osg::Array::BIND_OVERALL );
|
geometry->setNormalArray( newnormals.get() );
|
||||||
|
geometry->setNormalBinding( osg::Geometry::BIND_OVERALL );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -174,7 +175,7 @@ public:
|
|||||||
{
|
{
|
||||||
texture->setInternalFormatMode(_internalFormatMode);
|
texture->setInternalFormatMode(_internalFormatMode);
|
||||||
|
|
||||||
// need to disable the unref after apply, otherwise the image could go out of scope.
|
// need to disable the unref after apply, other the image could go out of scope.
|
||||||
bool unrefImageDataAfterApply = texture->getUnRefImageDataAfterApply();
|
bool unrefImageDataAfterApply = texture->getUnRefImageDataAfterApply();
|
||||||
texture->setUnRefImageDataAfterApply(false);
|
texture->setUnRefImageDataAfterApply(false);
|
||||||
|
|
||||||
@@ -373,6 +374,16 @@ public:
|
|||||||
++_numStateSetRemoved;
|
++_numStateSetRemoved;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for(unsigned int i=0;i<node.getNumDrawables();++i)
|
||||||
|
{
|
||||||
|
osg::Drawable* drawable = node.getDrawable(i);
|
||||||
|
if (drawable && drawable->getStateSet())
|
||||||
|
{
|
||||||
|
drawable->setStateSet(0);
|
||||||
|
++_numStateSetRemoved;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
traverse(node);
|
traverse(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -397,7 +408,8 @@ public:
|
|||||||
{
|
{
|
||||||
osg::Vec4Array* colours = new osg::Vec4Array(1);
|
osg::Vec4Array* colours = new osg::Vec4Array(1);
|
||||||
(*colours)[0].set(1.0f,1.0f,1.0f,1.0f);
|
(*colours)[0].set(1.0f,1.0f,1.0f,1.0f);
|
||||||
geometry->setColorArray(colours, osg::Array::BIND_OVERALL);
|
geometry->setColorArray(colours);
|
||||||
|
geometry->setColorBinding(osg::Geometry::BIND_OVERALL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -547,7 +559,6 @@ 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;
|
||||||
@@ -807,7 +818,7 @@ int main( int argc, char **argv )
|
|||||||
root->accept(av);
|
root->accept(av);
|
||||||
}
|
}
|
||||||
|
|
||||||
// optimize the scene graph, remove redundant nodes and state etc.
|
// optimize the scene graph, remove rendundent nodes and state etc.
|
||||||
osgUtil::Optimizer optimizer;
|
osgUtil::Optimizer optimizer;
|
||||||
optimizer.optimize(root.get());
|
optimizer.optimize(root.get());
|
||||||
|
|
||||||
|
|||||||
@@ -130,6 +130,40 @@ struct Extents
|
|||||||
osg::Vec2d _max;
|
osg::Vec2d _max;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class CheckValidVisitor : public osg::NodeVisitor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
CheckValidVisitor():
|
||||||
|
osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN),
|
||||||
|
_numInvalidGeometries(0) {}
|
||||||
|
|
||||||
|
void apply(osg::Geode& geode)
|
||||||
|
{
|
||||||
|
unsigned int local_numInvalidGeometries = 0;
|
||||||
|
for(unsigned int i=0; i<geode.getNumDrawables(); ++i)
|
||||||
|
{
|
||||||
|
osg::Geometry* geometry = dynamic_cast<osg::Geometry*>(geode.getDrawable(i));
|
||||||
|
if (geometry)
|
||||||
|
{
|
||||||
|
if (!geometry->verifyArrays(_errorReports)) ++local_numInvalidGeometries;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (local_numInvalidGeometries)
|
||||||
|
{
|
||||||
|
_errorReports<<"Geode "<<geode.getName()<<" contains problem geometries"<<std::endl;
|
||||||
|
_numInvalidGeometries += local_numInvalidGeometries;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool valid() const { return _numInvalidGeometries==0; }
|
||||||
|
|
||||||
|
unsigned int _numInvalidGeometries;
|
||||||
|
std::stringstream _errorReports;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
class LoadDataVisitor : public osg::NodeVisitor
|
class LoadDataVisitor : public osg::NodeVisitor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -275,7 +309,7 @@ public:
|
|||||||
osg::Node* readNodeFileAndWriteToCache(const std::string& filename)
|
osg::Node* readNodeFileAndWriteToCache(const std::string& filename)
|
||||||
{
|
{
|
||||||
osg::Node* node = 0;
|
osg::Node* node = 0;
|
||||||
if (_fileCache.valid() )
|
if (_fileCache.valid() && osgDB::containsServerAddress(filename))
|
||||||
{
|
{
|
||||||
if (_fileCache->existsInCache(filename))
|
if (_fileCache->existsInCache(filename))
|
||||||
{
|
{
|
||||||
@@ -300,6 +334,17 @@ public:
|
|||||||
osg::notify(osg::NOTICE)<<"reading : "<<filename<<std::endl;
|
osg::notify(osg::NOTICE)<<"reading : "<<filename<<std::endl;
|
||||||
node = osgDB::readNodeFile(filename);
|
node = osgDB::readNodeFile(filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (node)
|
||||||
|
{
|
||||||
|
CheckValidVisitor cvv;
|
||||||
|
node->accept(cvv);
|
||||||
|
if (!cvv.valid())
|
||||||
|
{
|
||||||
|
OSG_NOTICE<<"Warning, errors in geometry found in file "<<filename<<std::endl;
|
||||||
|
OSG_NOTICE<<cvv._errorReports.str()<<std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -406,7 +451,7 @@ int main( int argc, char **argv )
|
|||||||
|
|
||||||
// set up the usage document, in case we need to print out how to use this program.
|
// set up the usage document, in case we need to print out how to use this program.
|
||||||
arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName());
|
arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName());
|
||||||
arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is an application for collecting a set of separate files into a single archive file that can be later read in OSG applications..");
|
arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is an application for collecting a set of seperate files into a single archive file that can be later read in OSG applications..");
|
||||||
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ...");
|
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ...");
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("-l level","Read down to level across the whole database.");
|
arguments.getApplicationUsage()->addCommandLineOption("-l level","Read down to level across the whole database.");
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("-e level minX minY maxX maxY","Read down to <level> across the extents minX, minY to maxY, maxY. Note, for geocentric datase X and Y are longitude and latitude respectively.");
|
arguments.getApplicationUsage()->addCommandLineOption("-e level minX minY maxX maxY","Read down to <level> across the extents minX, minY to maxY, maxY. Note, for geocentric datase X and Y are longitude and latitude respectively.");
|
||||||
|
|||||||
@@ -122,7 +122,6 @@ const char* invalidNames[] =
|
|||||||
"LineStipple",
|
"LineStipple",
|
||||||
"Logos",
|
"Logos",
|
||||||
"LongIDRecord",
|
"LongIDRecord",
|
||||||
"InputIterator",
|
|
||||||
"Make",
|
"Make",
|
||||||
"Makefile",
|
"Makefile",
|
||||||
"Material",
|
"Material",
|
||||||
@@ -248,20 +247,7 @@ const char* invalidNames[] =
|
|||||||
"UpdateSkeleton",
|
"UpdateSkeleton",
|
||||||
"Vec3",
|
"Vec3",
|
||||||
"Plugin",
|
"Plugin",
|
||||||
"Get",
|
"Get"
|
||||||
"LightSource",
|
|
||||||
"SlideEventHandler",
|
|
||||||
"GraphicsContext*",
|
|
||||||
"Apple",
|
|
||||||
"GeometryNew",
|
|
||||||
"FrameBufferObject",
|
|
||||||
"Lua",
|
|
||||||
"VolumeTile",
|
|
||||||
"PushStackValueVisitor",
|
|
||||||
"RayIntersector",
|
|
||||||
"OpenSceneGraph-Data",
|
|
||||||
"Node",
|
|
||||||
"AlphaFunc"
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -273,7 +259,6 @@ struct TypoCorrection
|
|||||||
|
|
||||||
TypoCorrection typoCorrections[] =
|
TypoCorrection typoCorrections[] =
|
||||||
{
|
{
|
||||||
{"Cheaev", "Chebaev"},
|
|
||||||
{"Alaxandre", "Alexandre"},
|
{"Alaxandre", "Alexandre"},
|
||||||
{"Aderian", "Adrian"},
|
{"Aderian", "Adrian"},
|
||||||
{"Adndre", "Andre"},
|
{"Adndre", "Andre"},
|
||||||
@@ -283,7 +268,6 @@ TypoCorrection typoCorrections[] =
|
|||||||
{"André", "Andr<EFBFBD>"},
|
{"André", "Andr<EFBFBD>"},
|
||||||
{"Antione", "Antoine"},
|
{"Antione", "Antoine"},
|
||||||
{"Antonoine", "Antoine"},
|
{"Antonoine", "Antoine"},
|
||||||
{"Aurelein", "Aurelien"},
|
|
||||||
{"Atr", "Art"},
|
{"Atr", "Art"},
|
||||||
{"Baverage", "Beverage"},
|
{"Baverage", "Beverage"},
|
||||||
{"Bistroviae", "Bistrovic"},
|
{"Bistroviae", "Bistrovic"},
|
||||||
@@ -302,7 +286,6 @@ TypoCorrection typoCorrections[] =
|
|||||||
{"Fabian", "Fabien"},
|
{"Fabian", "Fabien"},
|
||||||
{"Fautre", "Fautr<EFBFBD>"},
|
{"Fautre", "Fautr<EFBFBD>"},
|
||||||
{"Frashid", "Farshid"},
|
{"Frashid", "Farshid"},
|
||||||
{"Farshild", "Farshid"},
|
|
||||||
{"Fred", "Frederic"},
|
{"Fred", "Frederic"},
|
||||||
{"Fredrick", "Frederic"},
|
{"Fredrick", "Frederic"},
|
||||||
{"Fredric", "Frederic"},
|
{"Fredric", "Frederic"},
|
||||||
@@ -328,8 +311,6 @@ TypoCorrection typoCorrections[] =
|
|||||||
{"Happalahti", "Haapalahti"},
|
{"Happalahti", "Haapalahti"},
|
||||||
{"Hertlien", "Hertlein"},
|
{"Hertlien", "Hertlein"},
|
||||||
{"Hatwig", "Hartwig"},
|
{"Hatwig", "Hartwig"},
|
||||||
{"Hauknes", "Haukness"},
|
|
||||||
{"Hunber", "Huber"},
|
|
||||||
{"Hi", "He"},
|
{"Hi", "He"},
|
||||||
{"Hooper", "Hopper"},
|
{"Hooper", "Hopper"},
|
||||||
{"Inverson", "Iverson"},
|
{"Inverson", "Iverson"},
|
||||||
@@ -354,7 +335,6 @@ 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"},
|
||||||
@@ -400,7 +380,6 @@ TypoCorrection typoCorrections[] =
|
|||||||
{"Oritz", "Ortiz"},
|
{"Oritz", "Ortiz"},
|
||||||
{"Osfeld", "Osfield"},
|
{"Osfeld", "Osfield"},
|
||||||
{"Osfied", "Osfield"},
|
{"Osfied", "Osfield"},
|
||||||
{"Paulk", "Paul"},
|
|
||||||
{"Pail", "Paul"},
|
{"Pail", "Paul"},
|
||||||
{"Perciva", "Peciva"},
|
{"Perciva", "Peciva"},
|
||||||
{"Pecvia", "Peciva"},
|
{"Pecvia", "Peciva"},
|
||||||
@@ -461,30 +440,7 @@ TypoCorrection typoCorrections[] =
|
|||||||
{"Jahannes","Johannes"},
|
{"Jahannes","Johannes"},
|
||||||
{"Eskland","Ekstrand"},
|
{"Eskland","Ekstrand"},
|
||||||
{"Baeuerele","Baeuerle"},
|
{"Baeuerele","Baeuerle"},
|
||||||
{"Bauerle","Baeuerle"},
|
{"Bauerle","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"}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -498,28 +454,16 @@ struct NameCorrection
|
|||||||
|
|
||||||
NameCorrection nameCorrections[] =
|
NameCorrection nameCorrections[] =
|
||||||
{
|
{
|
||||||
{"FrancoisTigeot","",
|
|
||||||
"Francois", "Tigeot"},
|
|
||||||
{"Juan","Manuel",
|
|
||||||
"Juan", "Manuel Alvarez"},
|
|
||||||
{"Jaap","Gas",
|
|
||||||
"Jaap", "Glas"},
|
|
||||||
{"Philip","Lamp",
|
|
||||||
"Philip", "Lamb"},
|
|
||||||
{"Dimi","Christop",
|
{"Dimi","Christop",
|
||||||
"Dimi", "Christopoulos"},
|
"Dimi", "Christopoulos"},
|
||||||
{"Jorge","Ciges",
|
{"Jorge","Ciges",
|
||||||
"Jorge", "Izquierdo Ciges"},
|
"Jorge", "Izquierdo"},
|
||||||
{"Jorge","Izquierdo",
|
|
||||||
"Jorge", "Izquierdo Ciges"},
|
|
||||||
{"Rafa","Gata",
|
{"Rafa","Gata",
|
||||||
"Rafa", "Gaitan"},
|
"Rafa", "Gaitan"},
|
||||||
{"Sukender","I",
|
{"Sukender","I",
|
||||||
"Sukender", ""},
|
"Sukender", ""},
|
||||||
{"Sukender","Here",
|
{"Sukender","Here",
|
||||||
"Sukender", ""},
|
"Sukender", ""},
|
||||||
{"Sukender","Fix",
|
|
||||||
"Sukender", ""},
|
|
||||||
{"Ewe","Woessner",
|
{"Ewe","Woessner",
|
||||||
"Uwe", "Woessner"},
|
"Uwe", "Woessner"},
|
||||||
{"Martin","von",
|
{"Martin","von",
|
||||||
@@ -534,8 +478,6 @@ NameCorrection nameCorrections[] =
|
|||||||
"Thomas", "Hogarth"},
|
"Thomas", "Hogarth"},
|
||||||
{"Marin", "Lavery",
|
{"Marin", "Lavery",
|
||||||
"Martin", "Lavery"},
|
"Martin", "Lavery"},
|
||||||
{"Michael", "Bach",
|
|
||||||
"Michael", "Bach Jensen"},
|
|
||||||
{"Nguyen", "Van",
|
{"Nguyen", "Van",
|
||||||
"Nguyen", "Van Truong"},
|
"Nguyen", "Van Truong"},
|
||||||
{"Thom", "Carlo",
|
{"Thom", "Carlo",
|
||||||
@@ -592,8 +534,6 @@ 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",
|
||||||
@@ -626,12 +566,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", "Motta Barros"},
|
|
||||||
{"A", "Botorabi",
|
{"A", "Botorabi",
|
||||||
"Ali", "Botorabi"},
|
"Ali", "Botorabi"},
|
||||||
{"Waltice", "",
|
{"Waltice", "",
|
||||||
@@ -648,32 +584,10 @@ NameCorrection nameCorrections[] =
|
|||||||
"Luc", "Frauciel"},
|
"Luc", "Frauciel"},
|
||||||
{"Alberto", "Lucas",
|
{"Alberto", "Lucas",
|
||||||
"Alberto", "Luaces"},
|
"Alberto", "Luaces"},
|
||||||
{"Alberto", "Luacus",
|
|
||||||
"Alberto", "Luaces"},
|
|
||||||
{"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"}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -1005,9 +919,7 @@ 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;
|
cout << sitr->first << "\t" << sitr->second.first << " " << sitr->second.second << endl;
|
||||||
if (!sitr->second.second.empty()) cout << " " << sitr->second.second;
|
|
||||||
cout << endl;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1016,9 +928,7 @@ 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;
|
cout << sitr->second.first << " " << sitr->second.second << endl;
|
||||||
if (!sitr->second.second.empty()) cout << " " << sitr->second.second;
|
|
||||||
cout << endl;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// The majority of the application is dedicated to building the
|
// The majority of the application is dedicated to building the
|
||||||
// current contributors list by parsing the ChangeLog, it just takes
|
// current contribitors list by parsing the ChangeLog, it just takes
|
||||||
// one line in the main itself to report the version number.
|
// one line in the main itself to report the version number.
|
||||||
|
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|||||||
@@ -14,7 +14,6 @@
|
|||||||
#include <osg/CoordinateSystemNode>
|
#include <osg/CoordinateSystemNode>
|
||||||
|
|
||||||
#include <osg/Switch>
|
#include <osg/Switch>
|
||||||
#include <osg/Types>
|
|
||||||
#include <osgText/Text>
|
#include <osgText/Text>
|
||||||
|
|
||||||
#include <osgViewer/Viewer>
|
#include <osgViewer/Viewer>
|
||||||
@@ -29,11 +28,8 @@
|
|||||||
#include <osgGA/TerrainManipulator>
|
#include <osgGA/TerrainManipulator>
|
||||||
#include <osgGA/SphericalManipulator>
|
#include <osgGA/SphericalManipulator>
|
||||||
|
|
||||||
#include <osgGA/Device>
|
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
// use an ArgumentParser object to manage the program arguments.
|
// use an ArgumentParser object to manage the program arguments.
|
||||||
@@ -45,9 +41,6 @@ int main(int argc, char** argv)
|
|||||||
arguments.getApplicationUsage()->addCommandLineOption("--image <filename>","Load an image and render it on a quad");
|
arguments.getApplicationUsage()->addCommandLineOption("--image <filename>","Load an image and render it on a quad");
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("--dem <filename>","Load an image/DEM and render it on a HeightField");
|
arguments.getApplicationUsage()->addCommandLineOption("--dem <filename>","Load an image/DEM and render it on a HeightField");
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("--login <url> <username> <password>","Provide authentication information for http file access.");
|
arguments.getApplicationUsage()->addCommandLineOption("--login <url> <username> <password>","Provide authentication information for http file access.");
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("-p <filename>","Play specified camera path animation file, previously saved with 'z' key.");
|
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("--speed <factor>","Speed factor for animation playing (1 == normal speed).");
|
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("--device <device-name>","add named device to the viewer");
|
|
||||||
|
|
||||||
osgViewer::Viewer viewer(arguments);
|
osgViewer::Viewer viewer(arguments);
|
||||||
|
|
||||||
@@ -84,16 +77,6 @@ int main(int argc, char** argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string device;
|
|
||||||
while(arguments.read("--device", device))
|
|
||||||
{
|
|
||||||
osg::ref_ptr<osgGA::Device> dev = osgDB::readFile<osgGA::Device>(device);
|
|
||||||
if (dev.valid())
|
|
||||||
{
|
|
||||||
viewer.addDevice(dev.get());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 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;
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
#if defined(__linux)
|
#if defined(__linux)
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <linux/sockios.h>
|
#include <linux/sockios.h>
|
||||||
#elif defined(__FreeBSD__) || defined(__DragonFly__)
|
#elif defined(__FreeBSD__)
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/sockio.h>
|
#include <sys/sockio.h>
|
||||||
#elif defined(__sgi)
|
#elif defined(__sgi)
|
||||||
@@ -202,8 +202,7 @@ void DataConverter::write(CameraPacket& cameraPacket)
|
|||||||
itr != cameraPacket._events.end();
|
itr != cameraPacket._events.end();
|
||||||
++itr)
|
++itr)
|
||||||
{
|
{
|
||||||
osgGA::GUIEventAdapter* event = (*itr)->asGUIEventAdapter();
|
write(*(*itr));
|
||||||
if (event) write(*(event));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -241,7 +240,7 @@ void CameraPacket::readEventQueue(osgViewer::Viewer& viewer)
|
|||||||
|
|
||||||
void CameraPacket::writeEventQueue(osgViewer::Viewer& viewer)
|
void CameraPacket::writeEventQueue(osgViewer::Viewer& viewer)
|
||||||
{
|
{
|
||||||
osg::notify(osg::INFO)<<"received events = "<<_events.size()<<std::endl;
|
osg::notify(osg::INFO)<<"recieved events = "<<_events.size()<<std::endl;
|
||||||
|
|
||||||
// copy the events to osgProducer style events.
|
// copy the events to osgProducer style events.
|
||||||
viewer.getEventQueue()->appendEvents(_events);
|
viewer.getEventQueue()->appendEvents(_events);
|
||||||
@@ -250,7 +249,7 @@ void CameraPacket::writeEventQueue(osgViewer::Viewer& viewer)
|
|||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Receiver
|
// Reciever
|
||||||
//
|
//
|
||||||
Receiver::Receiver( void )
|
Receiver::Receiver( void )
|
||||||
{
|
{
|
||||||
@@ -337,8 +336,7 @@ void Receiver::sync( void )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__linux) || defined(__FreeBSD__) || defined( __APPLE__ ) || \
|
#if defined(__linux) || defined(__FreeBSD__) || defined( __APPLE__ )
|
||||||
defined(__DragonFly__)
|
|
||||||
socklen_t
|
socklen_t
|
||||||
#else
|
#else
|
||||||
int
|
int
|
||||||
|
|||||||
@@ -33,21 +33,21 @@ class Receiver
|
|||||||
{
|
{
|
||||||
public :
|
public :
|
||||||
|
|
||||||
Receiver();
|
Receiver();
|
||||||
~Receiver();
|
~Receiver();
|
||||||
|
|
||||||
// setBuffer defines the buffer into which the broadcasted
|
// setBuffer defines the buffer into which the broadcasted
|
||||||
// message will be received.
|
// message will be received.
|
||||||
void setBuffer( void *buffer, const unsigned int size );
|
void setBuffer( void *buffer, const unsigned int size );
|
||||||
|
|
||||||
// Define what port to listen and bind to
|
// Define what port to listen and bind to
|
||||||
void setPort( const short port );
|
void setPort( const short port );
|
||||||
|
|
||||||
// Sync does a blocking wait to recieve next message
|
// Sync does a blocking wait to recieve next message
|
||||||
void sync( void );
|
void sync( void );
|
||||||
|
|
||||||
private :
|
private :
|
||||||
bool init( void );
|
bool init( void );
|
||||||
|
|
||||||
private :
|
private :
|
||||||
#if defined (WIN32) && !defined(__CYGWIN__)
|
#if defined (WIN32) && !defined(__CYGWIN__)
|
||||||
@@ -72,25 +72,25 @@ class Broadcaster
|
|||||||
{
|
{
|
||||||
public :
|
public :
|
||||||
|
|
||||||
Broadcaster( void );
|
Broadcaster( void );
|
||||||
~Broadcaster( void );
|
~Broadcaster( void );
|
||||||
|
|
||||||
// Set the broadcast port
|
// Set the broadcast port
|
||||||
void setPort( const short port );
|
void setPort( const short port );
|
||||||
|
|
||||||
// Set the buffer to be broadcast
|
// Set the buffer to be broadcast
|
||||||
void setBuffer( void *buffer, const unsigned int buffer_size );
|
void setBuffer( void *buffer, const unsigned int buffer_size );
|
||||||
|
|
||||||
// Set a recipient host. If this is used, the Broadcaster
|
// Set a recipient host. If this is used, the Broadcaster
|
||||||
// no longer broadcasts, but rather directs UDP packets at
|
// no longer broadcasts, but rather directs UDP packets at
|
||||||
// host.
|
// host.
|
||||||
void setHost( const char *hostname );
|
void setHost( const char *hostname );
|
||||||
|
|
||||||
// Sync broadcasts the buffer
|
// Sync broadcasts the buffer
|
||||||
void sync( void );
|
void sync( void );
|
||||||
|
|
||||||
private :
|
private :
|
||||||
bool init( void );
|
bool init( void );
|
||||||
|
|
||||||
private :
|
private :
|
||||||
#if defined(WIN32) && !defined(__CYGWIN__)
|
#if defined(WIN32) && !defined(__CYGWIN__)
|
||||||
@@ -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=0; read1(&c); return c; }
|
inline char readChar() { char c; read1(&c); return c; }
|
||||||
inline unsigned char readUChar() { unsigned char c=0; read1((char*)&c); return c; }
|
inline unsigned char readUChar() { unsigned char c; read1((char*)&c); return c; }
|
||||||
inline short readShort() { short c=0; read2((char*)&c); return c; }
|
inline short readShort() { short c; read2((char*)&c); return c; }
|
||||||
inline unsigned short readUShort() { unsigned short c=0; read2((char*)&c); return c; }
|
inline unsigned short readUShort() { unsigned short c; read2((char*)&c); return c; }
|
||||||
inline int readInt() { int c=0; read4((char*)&c); return c; }
|
inline int readInt() { int c; read4((char*)&c); return c; }
|
||||||
inline unsigned int readUInt() { unsigned int c=0; read4((char*)&c); return c; }
|
inline unsigned int readUInt() { unsigned int c; read4((char*)&c); return c; }
|
||||||
inline float readFloat() { float c=0.0f; read4((char*)&c); return c; }
|
inline float readFloat() { float c; read4((char*)&c); return c; }
|
||||||
inline double readDouble() { double c=0.0; read8((char*)&c); return c; }
|
inline double readDouble() { double c; 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);
|
||||||
|
|||||||
@@ -54,6 +54,11 @@ bool PointsEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActio
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PointsEventHandler::accept(osgGA::GUIEventHandlerVisitor& v)
|
||||||
|
{
|
||||||
|
v.visit(*this);
|
||||||
|
}
|
||||||
|
|
||||||
void PointsEventHandler::getUsage(osg::ApplicationUsage& usage) const
|
void PointsEventHandler::getUsage(osg::ApplicationUsage& usage) const
|
||||||
{
|
{
|
||||||
usage.addKeyboardMouseBinding("+","Increase point size");
|
usage.addKeyboardMouseBinding("+","Increase point size");
|
||||||
|
|||||||
@@ -25,6 +25,8 @@ class PointsEventHandler : public osgGA::GUIEventHandler
|
|||||||
|
|
||||||
virtual bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter&);
|
virtual bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter&);
|
||||||
|
|
||||||
|
virtual void accept(osgGA::GUIEventHandlerVisitor& v);
|
||||||
|
|
||||||
void getUsage(osg::ApplicationUsage& usage) const;
|
void getUsage(osg::ApplicationUsage& usage) const;
|
||||||
|
|
||||||
void setStateSet(osg::StateSet* stateset) { _stateset=stateset; }
|
void setStateSet(osg::StateSet* stateset) { _stateset=stateset; }
|
||||||
|
|||||||
@@ -251,12 +251,8 @@ osg::ref_ptr<osg::Node> p3d::readShowFiles(osg::ArgumentParser& arguments,const
|
|||||||
|
|
||||||
if(node)
|
if(node)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (node->getName().empty()) node->setName( arguments[pos] );
|
if (node->getName().empty()) node->setName( arguments[pos] );
|
||||||
nodeList.push_back(node);
|
nodeList.push_back(node);
|
||||||
|
|
||||||
// make sure that this presentation isn't cached
|
|
||||||
osgDB::Registry::instance()->removeFromObjectCache( arguments[pos] );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,6 +52,12 @@ bool ShowEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionA
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ShowEventHandler::accept(osgGA::GUIEventHandlerVisitor& v)
|
||||||
|
{
|
||||||
|
v.visit(*this);
|
||||||
|
}
|
||||||
|
|
||||||
void ShowEventHandler::getUsage(osg::ApplicationUsage& /*usage*/) const
|
void ShowEventHandler::getUsage(osg::ApplicationUsage& /*usage*/) const
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ class ShowEventHandler : public osgGA::GUIEventHandler
|
|||||||
|
|
||||||
virtual bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa, osg::Object* object, osg::NodeVisitor* nv);
|
virtual bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa, osg::Object* object, osg::NodeVisitor* nv);
|
||||||
|
|
||||||
|
virtual void accept(osgGA::GUIEventHandlerVisitor& v);
|
||||||
|
|
||||||
virtual void getUsage(osg::ApplicationUsage& usage) const;
|
virtual void getUsage(osg::ApplicationUsage& usage) const;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <osg/Geometry>
|
#include <osg/Geometry>
|
||||||
|
#include <osg/CameraNode>
|
||||||
#include <osg/Texture2D>
|
#include <osg/Texture2D>
|
||||||
#include <osg/AutoTransform>
|
#include <osg/AutoTransform>
|
||||||
#include <osg/Notify>
|
#include <osg/Notify>
|
||||||
@@ -27,7 +28,6 @@
|
|||||||
|
|
||||||
#include <OpenThreads/Thread>
|
#include <OpenThreads/Thread>
|
||||||
|
|
||||||
#include <osgGA/GUIEventHandler>
|
|
||||||
#include <osgGA/TrackballManipulator>
|
#include <osgGA/TrackballManipulator>
|
||||||
#include <osgGA/FlightManipulator>
|
#include <osgGA/FlightManipulator>
|
||||||
#include <osgGA/DriveManipulator>
|
#include <osgGA/DriveManipulator>
|
||||||
@@ -36,10 +36,9 @@
|
|||||||
#include <osgGA/TerrainManipulator>
|
#include <osgGA/TerrainManipulator>
|
||||||
#include <osgGA/AnimationPathManipulator>
|
#include <osgGA/AnimationPathManipulator>
|
||||||
#include <osgGA/StateSetManipulator>
|
#include <osgGA/StateSetManipulator>
|
||||||
#include <osgGA/MultiTouchTrackballManipulator>
|
|
||||||
|
|
||||||
#include <osgPresentation/SlideEventHandler>
|
#include <osgPresentation/SlideEventHandler>
|
||||||
#include <osgPresentation/Cursor>
|
#include <osgPresentation/SlideShowConstructor>
|
||||||
|
|
||||||
#include "ReadShowFile.h"
|
#include "ReadShowFile.h"
|
||||||
#include "PointsEventHandler.h"
|
#include "PointsEventHandler.h"
|
||||||
@@ -51,7 +50,6 @@
|
|||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#ifdef USE_SDL
|
#ifdef USE_SDL
|
||||||
@@ -129,104 +127,265 @@ void setViewer(osgViewer::Viewer& viewer, float width, float height, float dista
|
|||||||
// double hfov = osg::RadiansToDegrees(atan2(width/2.0f,distance)*2.0);
|
// double hfov = osg::RadiansToDegrees(atan2(width/2.0f,distance)*2.0);
|
||||||
|
|
||||||
viewer.getCamera()->setProjectionMatrixAsPerspective( vfov, width/height, 0.1, 1000.0);
|
viewer.getCamera()->setProjectionMatrixAsPerspective( vfov, width/height, 0.1, 1000.0);
|
||||||
|
|
||||||
OSG_INFO<<"setProjectionMatrixAsPerspective( "<<vfov<<", "<<width/height<<", "<<0.1<<", "<<1000.0<<");"<<std::endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class ForwardToDeviceEventHandler : public osgGA::GUIEventHandler {
|
#if 1
|
||||||
public:
|
|
||||||
ForwardToDeviceEventHandler(osgGA::Device* device, bool format_mouse_events) : osgGA::GUIEventHandler(), _device(device), _forwardMouseEvents(format_mouse_events) {}
|
|
||||||
|
|
||||||
virtual bool handle (const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa, osg::Object *, osg::NodeVisitor *)
|
class RayFollowsMouseCallback : public osg::Drawable::EventCallback
|
||||||
|
{
|
||||||
|
RayFollowsMouseCallback() {}
|
||||||
|
|
||||||
|
/** do customized Event code. */
|
||||||
|
virtual void event(osg::NodeVisitor* nv, osg::Drawable* drawable)
|
||||||
{
|
{
|
||||||
switch (ea.getEventType())
|
osg::Geometry* geometry = drawable->asGeometry();
|
||||||
{
|
osgGA::EventVisitor* ev = dynamic_cast<osgGA::EventVisitor*>(nv);
|
||||||
case osgGA::GUIEventAdapter::PUSH:
|
|
||||||
case osgGA::GUIEventAdapter::RELEASE:
|
|
||||||
case osgGA::GUIEventAdapter::MOVE:
|
|
||||||
case osgGA::GUIEventAdapter::DRAG:
|
|
||||||
case osgGA::GUIEventAdapter::SCROLL:
|
|
||||||
if (_forwardMouseEvents)
|
|
||||||
_device->sendEvent(ea);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
if (!ev || !geometry) return;
|
||||||
_device->sendEvent(ea);
|
|
||||||
break;
|
osgGA::GUIActionAdapter* aa = ev->getActionAdapter();
|
||||||
|
osgViewer::View* view = dynamic_cast<osgViewer::View*>(aa);
|
||||||
|
if (!view) return;
|
||||||
|
|
||||||
|
osg::Vec3Array* vertices = dynamic_cast<osg::Vec3Array*>(geometry->getVertexArray());
|
||||||
|
if (!vertices) return;
|
||||||
|
|
||||||
|
osg::Camera* camera = view->getCamera();
|
||||||
|
osg::Matrix VP = camera->getViewMatrix() * camera->getProjectionMatrix();
|
||||||
|
|
||||||
|
osg::Matrix inverse_VP;
|
||||||
|
inverse_VP.invert(VP);
|
||||||
|
|
||||||
|
osgGA::EventQueue::Events& events = ev->getEvents();
|
||||||
|
for(osgGA::EventQueue::Events::iterator itr = events.begin();
|
||||||
|
itr != events.end();
|
||||||
|
++itr)
|
||||||
|
{
|
||||||
|
handle(inverse_VP, *(*itr), vertices);
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void handle(const osg::Matrix& inverse_VP, osgGA::GUIEventAdapter& ea, osg::Vec3Array* vertices)
|
||||||
bool handle(osgGA::Event* event, osg::Object* object, osg::NodeVisitor* nv)
|
|
||||||
{
|
{
|
||||||
if (event->asGUIEventAdapter())
|
osg::Vec3d start_eye(ea.getXnormalized(), ea.getYnormalized(), 0.0);
|
||||||
return osgGA::GUIEventHandler::handle(event, object, nv);
|
osg::Vec3d end_eye(ea.getXnormalized(), ea.getYnormalized(), 1.0);
|
||||||
else
|
|
||||||
{
|
osg::Vec3d start_world = start_eye * inverse_VP;
|
||||||
_device->sendEvent(*event);
|
osg::Vec3d end_world = start_eye * inverse_VP;
|
||||||
return false;
|
|
||||||
}
|
osg::notify(osg::NOTICE)<<"start_world="<<start_world<<std::endl;
|
||||||
|
osg::notify(osg::NOTICE)<<"end_world="<<end_world<<std::endl;
|
||||||
|
|
||||||
|
(*vertices)[0] = start_world;
|
||||||
|
(*vertices)[1] = end_world;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
osg::ref_ptr<osgGA::Device> _device;
|
|
||||||
bool _forwardMouseEvents;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class FollowMouseCallback: public osgGA::GUIEventHandler
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
class DumpEventHandler : public osgGA::GUIEventHandler {
|
virtual bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa, osg::Object* object, osg::NodeVisitor* nv)
|
||||||
public:
|
|
||||||
DumpEventHandler() : osgGA::GUIEventHandler() {}
|
|
||||||
|
|
||||||
virtual bool handle (const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa, osg::Object *, osg::NodeVisitor *)
|
|
||||||
{
|
|
||||||
switch (ea.getEventType())
|
|
||||||
{
|
{
|
||||||
case osgGA::GUIEventAdapter::FRAME:
|
osg::AutoTransform* transform = dynamic_cast<osg::AutoTransform*>(object);
|
||||||
return false;
|
if (!transform) return false;
|
||||||
break;
|
|
||||||
case osgGA::GUIEventAdapter::PUSH:
|
|
||||||
std::cout << "PUSH: ";
|
|
||||||
break;
|
|
||||||
case osgGA::GUIEventAdapter::RELEASE:
|
|
||||||
std::cout << "RELEASE: ";
|
|
||||||
break;
|
|
||||||
case osgGA::GUIEventAdapter::MOVE:
|
|
||||||
std::cout << "MOVE: ";
|
|
||||||
break;
|
|
||||||
case osgGA::GUIEventAdapter::DRAG:
|
|
||||||
std::cout << "DRAG: ";
|
|
||||||
break;
|
|
||||||
case osgGA::GUIEventAdapter::SCROLL:
|
|
||||||
std::cout << "SCROLL: ";
|
|
||||||
break;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
switch(ea.getEventType())
|
||||||
std::cout << ea.getEventType() << " ";
|
{
|
||||||
break;
|
case(osgGA::GUIEventAdapter::FRAME):
|
||||||
}
|
//case(osgGA::GUIEventAdapter::MOVE):
|
||||||
std::cout << ea.getX() << "/" << ea.getY() << " " << ea.isMultiTouchEvent() << std::endl;
|
//case(osgGA::GUIEventAdapter::DRAG):
|
||||||
return false;
|
{
|
||||||
}
|
osgViewer::View* view = dynamic_cast<osgViewer::View*>(&aa);
|
||||||
|
|
||||||
|
transform->setNodeMask(0x0);
|
||||||
|
|
||||||
bool handle(osgGA::Event* event, osg::Object* object, osg::NodeVisitor* nv)
|
osg::notify(osg::NOTICE)<<std::endl<<"ea.getGraphicsContext()="<<ea.getGraphicsContext()<<std::endl;
|
||||||
{
|
osg::notify(osg::NOTICE)<<"ea.getWindowWidth()="<<ea.getWindowWidth()<<std::endl;
|
||||||
if (event->asGUIEventAdapter())
|
osg::notify(osg::NOTICE)<<"ea.getWindowHeight()="<<ea.getWindowHeight()<<std::endl;
|
||||||
return osgGA::GUIEventHandler::handle(event, object, nv);
|
osg::notify(osg::NOTICE)<<"ea.getX()="<<ea.getX()<<std::endl;
|
||||||
else
|
osg::notify(osg::NOTICE)<<"ea.getXin()="<<ea.getXmin()<<std::endl;
|
||||||
{
|
osg::notify(osg::NOTICE)<<"ea.getXmax()="<<ea.getXmax()<<std::endl;
|
||||||
|
osg::notify(osg::NOTICE)<<"ea.getY()="<<ea.getY()<<std::endl;
|
||||||
|
osg::notify(osg::NOTICE)<<"ea.getYin()="<<ea.getYmin()<<std::endl;
|
||||||
|
osg::notify(osg::NOTICE)<<"ea.getYmax()="<<ea.getYmax()<<std::endl;
|
||||||
|
|
||||||
|
osg::Camera* camera = view->getCamera();
|
||||||
|
osg::Matrix VP = camera->getViewMatrix() * camera->getProjectionMatrix();
|
||||||
|
|
||||||
|
osg::Matrix inverse_VP;
|
||||||
|
inverse_VP.invert(VP);
|
||||||
|
|
||||||
|
osg::Vec3d start_eye(ea.getXnormalized(), ea.getYnormalized(), 0.0);
|
||||||
|
osg::Vec3d end_eye(ea.getXnormalized(), ea.getYnormalized(), 1.0);
|
||||||
|
|
||||||
|
osg::Vec3d start_world = start_eye * inverse_VP;
|
||||||
|
osg::Vec3d end_world = start_eye * inverse_VP;
|
||||||
|
|
||||||
|
osg::notify(osg::NOTICE)<<"start_world="<<start_world<<std::endl;
|
||||||
|
osg::notify(osg::NOTICE)<<"end_world="<<end_world<<std::endl;
|
||||||
|
|
||||||
|
transform->setPosition(end_world);
|
||||||
|
|
||||||
|
transform->setNodeMask(0xffffffff);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case(osgGA::GUIEventAdapter::KEYDOWN):
|
||||||
|
{
|
||||||
|
if (ea.getKey()=='c')
|
||||||
|
{
|
||||||
|
for(unsigned int i=0; i< transform->getNumChildren(); ++i)
|
||||||
|
{
|
||||||
|
osg::Node* node = transform->getChild(i);
|
||||||
|
node->setNodeMask(
|
||||||
|
node->getNodeMask()!=0 ?
|
||||||
|
0 :
|
||||||
|
0xffffff);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
virtual void accept(osgGA::GUIEventHandlerVisitor& v)
|
||||||
|
{
|
||||||
|
v.visit(*this);
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
osg::Node* createCursorSubgraph(const std::string& filename, float size)
|
||||||
|
{
|
||||||
|
osg::Geode* geode = new osg::Geode;
|
||||||
|
|
||||||
|
size = 20.0f;
|
||||||
|
|
||||||
|
osg::Geometry* geom = osg::createTexturedQuadGeometry(osg::Vec3(-size*0.5f,-size*0.5f,0.0f),osg::Vec3(size,0.0f,0.0f),osg::Vec3(0.0f,size,0.0f));
|
||||||
|
|
||||||
|
osg::Image* image = osgDB::readImageFile(osgDB::findDataFile(filename));
|
||||||
|
if (image)
|
||||||
|
{
|
||||||
|
osg::StateSet* stateset = geom->getOrCreateStateSet();
|
||||||
|
stateset->setTextureAttributeAndModes(0, new osg::Texture2D(image),osg::StateAttribute::ON);
|
||||||
|
stateset->setMode(GL_BLEND,osg::StateAttribute::ON);
|
||||||
|
// stateset->setMode(GL_DEPTH_TEST,osg::StateAttribute::OFF);
|
||||||
|
stateset->setRenderBinDetails(1000, "DepthSortedBin");
|
||||||
|
}
|
||||||
|
|
||||||
|
geode->addDrawable(geom);
|
||||||
|
|
||||||
|
osg::AutoTransform* transform = new osg::AutoTransform;
|
||||||
|
transform->setAutoRotateMode(osg::AutoTransform::ROTATE_TO_CAMERA);
|
||||||
|
transform->setAutoScaleToScreen(true);
|
||||||
|
|
||||||
|
transform->addChild(geode);
|
||||||
|
|
||||||
|
transform->setEventCallback(new FollowMouseCallback());
|
||||||
|
|
||||||
|
return transform;
|
||||||
|
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
class FollowMouseCallback: public osgGA::GUIEventHandler
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
virtual bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter&, osg::Object* object, osg::NodeVisitor*)
|
||||||
|
{
|
||||||
|
|
||||||
|
switch(ea.getEventType())
|
||||||
|
{
|
||||||
|
case(osgGA::GUIEventAdapter::MOVE):
|
||||||
|
case(osgGA::GUIEventAdapter::DRAG):
|
||||||
|
{
|
||||||
|
osg::Camera* camera = dynamic_cast<osg::Camera*>(object);
|
||||||
|
if (camera)
|
||||||
|
{
|
||||||
|
double x = ea.getXnormalized();
|
||||||
|
double y = ea.getYnormalized();
|
||||||
|
|
||||||
|
camera->setViewMatrix(osg::Matrixd::translate(x,y,0.0));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case(osgGA::GUIEventAdapter::KEYDOWN):
|
||||||
|
{
|
||||||
|
if (ea.getKey()=='c')
|
||||||
|
{
|
||||||
|
osg::Camera* camera = dynamic_cast<osg::Camera*>(object);
|
||||||
|
if (camera)
|
||||||
|
{
|
||||||
|
for(unsigned int i=0; i< camera->getNumChildren(); ++i)
|
||||||
|
{
|
||||||
|
osg::Node* node = camera->getChild(i);
|
||||||
|
node->setNodeMask(
|
||||||
|
node->getNodeMask()!=0 ?
|
||||||
|
0 :
|
||||||
|
0xffffff);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void accept(osgGA::GUIEventHandlerVisitor& v)
|
||||||
|
{
|
||||||
|
v.visit(*this);
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
osg::Node* createCursorSubgraph(const std::string& filename, float size)
|
||||||
|
{
|
||||||
|
osg::Geode* geode = new osg::Geode;
|
||||||
|
|
||||||
|
osg::Geometry* geom = osg::createTexturedQuadGeometry(osg::Vec3(-size*0.5f,-size*0.5f,0.0f),osg::Vec3(size,0.0f,0.0f),osg::Vec3(0.0f,size,0.0f));
|
||||||
|
|
||||||
|
osg::Image* image = osgDB::readImageFile(osgDB::findDataFile(filename));
|
||||||
|
if (image)
|
||||||
|
{
|
||||||
|
osg::StateSet* stateset = geom->getOrCreateStateSet();
|
||||||
|
stateset->setTextureAttributeAndModes(0, new osg::Texture2D(image),osg::StateAttribute::ON);
|
||||||
|
stateset->setMode(GL_BLEND,osg::StateAttribute::ON);
|
||||||
|
stateset->setRenderBinDetails(1000, "DepthSortedBin");
|
||||||
|
}
|
||||||
|
|
||||||
|
geode->addDrawable(geom);
|
||||||
|
|
||||||
|
osg::Camera* camera = new osg::Camera;
|
||||||
|
|
||||||
|
// set the projection matrix
|
||||||
|
camera->setProjectionMatrix(osg::Matrix::ortho2D(-1,1,-1,1));
|
||||||
|
|
||||||
|
// 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::CameraNode::NESTED_RENDER);
|
||||||
|
|
||||||
|
camera->addChild(geode);
|
||||||
|
|
||||||
|
camera->setEventCallback(new FollowMouseCallback());
|
||||||
|
|
||||||
|
return camera;
|
||||||
|
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
enum P3DApplicationType
|
enum P3DApplicationType
|
||||||
@@ -237,50 +396,6 @@ enum P3DApplicationType
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
void processLoadedModel(osg::ref_ptr<osg::Node>& loadedModel, int optimizer_options, const std::string& cursorFileName)
|
|
||||||
{
|
|
||||||
if (!loadedModel) return;
|
|
||||||
|
|
||||||
#if !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GL3_AVAILABLE)
|
|
||||||
|
|
||||||
// add back in enabling of the GL_ALPHA_TEST to get around the core OSG no longer setting it by default for opaque bins.
|
|
||||||
// the alpha test is required for the volume rendering alpha clipping to work.
|
|
||||||
loadedModel->getOrCreateStateSet()->setMode(GL_ALPHA_TEST, osg::StateAttribute::ON);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// optimize the scene graph, remove redundant nodes and state etc.
|
|
||||||
osgUtil::Optimizer optimizer;
|
|
||||||
optimizer.optimize(loadedModel.get(), optimizer_options);
|
|
||||||
|
|
||||||
if (!cursorFileName.empty())
|
|
||||||
{
|
|
||||||
osg::ref_ptr<osg::Group> group = new osg::Group;
|
|
||||||
group->addChild(loadedModel.get());
|
|
||||||
|
|
||||||
OSG_NOTICE<<"Creating Cursor"<<std::endl;
|
|
||||||
group->addChild(new osgPresentation::Cursor(cursorFileName, 20.0f));
|
|
||||||
|
|
||||||
loadedModel = group;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void addDeviceTo(osgViewer::Viewer& viewer, const std::string& device_name, bool forward_mouse_events)
|
|
||||||
{
|
|
||||||
osg::ref_ptr<osgGA::Device> dev = osgDB::readFile<osgGA::Device>(device_name);
|
|
||||||
if (dev.valid())
|
|
||||||
{
|
|
||||||
OSG_INFO << "Adding Device : " << device_name << std::endl;
|
|
||||||
viewer.addDevice(dev.get());
|
|
||||||
|
|
||||||
if ((dev->getCapabilities() & osgGA::Device::SEND_EVENTS))
|
|
||||||
viewer.getEventHandlers().push_front(new ForwardToDeviceEventHandler(dev.get(), forward_mouse_events));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
OSG_WARN << "could not open device: " << device_name << std::endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int main( int argc, char **argv )
|
int main( int argc, char **argv )
|
||||||
{
|
{
|
||||||
@@ -307,8 +422,6 @@ int main( int argc, char **argv )
|
|||||||
arguments.getApplicationUsage()->addCommandLineOption("--html <filename>","Print out slides to a series of html & image files.");
|
arguments.getApplicationUsage()->addCommandLineOption("--html <filename>","Print out slides to a series of html & image files.");
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("--loop","Switch on looping of presentation.");
|
arguments.getApplicationUsage()->addCommandLineOption("--loop","Switch on looping of presentation.");
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("--devices","Print the Video input capability via QuickTime and exit.");
|
arguments.getApplicationUsage()->addCommandLineOption("--devices","Print the Video input capability via QuickTime and exit.");
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("--forwardMouseEvents","forward also mouse/touch-events to the devices");
|
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("--suppressEnvTags", "suppresses all found ENV-tags in the presentation");
|
|
||||||
|
|
||||||
// add alias from xml to p3d to provide backwards compatibility for old p3d files.
|
// add alias from xml to p3d to provide backwards compatibility for old p3d files.
|
||||||
osgDB::Registry::instance()->addFileExtensionAlias("xml","p3d");
|
osgDB::Registry::instance()->addFileExtensionAlias("xml","p3d");
|
||||||
@@ -321,32 +434,14 @@ int main( int argc, char **argv )
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool suppress_env_tags = false;
|
|
||||||
if (arguments.read("--suppressEnvTags"))
|
|
||||||
suppress_env_tags = true;
|
|
||||||
|
|
||||||
// read any env vars from presentations before we create viewer to make sure the viewer
|
// read any env vars from presentations before we create viewer to make sure the viewer
|
||||||
// utilises these env vars
|
// utilises these env vars
|
||||||
if (!suppress_env_tags && p3d::readEnvVars(arguments))
|
if (p3d::readEnvVars(arguments))
|
||||||
{
|
{
|
||||||
osg::DisplaySettings::instance()->readEnvironmentalVariables();
|
osg::DisplaySettings::instance()->readEnvironmentalVariables();
|
||||||
}
|
}
|
||||||
|
|
||||||
// set up any logins required for http access
|
|
||||||
std::string url, username, password;
|
|
||||||
while(arguments.read("--login",url, username, password))
|
|
||||||
{
|
|
||||||
if (!osgDB::Registry::instance()->getAuthenticationMap())
|
|
||||||
{
|
|
||||||
osgDB::Registry::instance()->setAuthenticationMap(new osgDB::AuthenticationMap);
|
|
||||||
osgDB::Registry::instance()->getAuthenticationMap()->addAuthenticationDetails(
|
|
||||||
url,
|
|
||||||
new osgDB::AuthenticationDetails(username, password)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef USE_SDL
|
#ifdef USE_SDL
|
||||||
SDLIntegration sdlIntegration;
|
SDLIntegration sdlIntegration;
|
||||||
@@ -415,69 +510,16 @@ int main( int argc, char **argv )
|
|||||||
doSetViewer = false;
|
doSetViewer = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool forwardMouseEvents = false;
|
|
||||||
if (arguments.read("--forwardMouseEvents"))
|
|
||||||
forwardMouseEvents = true;
|
|
||||||
|
|
||||||
const char* p3dDevice = getenv("P3D_DEVICE");
|
|
||||||
if (p3dDevice)
|
|
||||||
{
|
|
||||||
osgDB::StringList devices;
|
|
||||||
osgDB::split(p3dDevice, devices);
|
|
||||||
for(osgDB::StringList::iterator i = devices.begin(); i != devices.end(); ++i)
|
|
||||||
{
|
|
||||||
addDeviceTo(viewer, *i, forwardMouseEvents);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
std::string device;
|
|
||||||
while (arguments.read("--device", device))
|
|
||||||
{
|
|
||||||
addDeviceTo(viewer, device, forwardMouseEvents);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (arguments.read("--http-control"))
|
|
||||||
{
|
|
||||||
|
|
||||||
std::string server_address = "localhost";
|
|
||||||
std::string server_port = "8080";
|
|
||||||
std::string document_root = "htdocs";
|
|
||||||
|
|
||||||
while (arguments.read("--http-server-address", server_address)) {}
|
|
||||||
while (arguments.read("--http-server-port", server_port)) {}
|
|
||||||
while (arguments.read("--http-document-root", document_root)) {}
|
|
||||||
|
|
||||||
osg::ref_ptr<osgDB::Options> device_options = new osgDB::Options("documentRegisteredHandlers");
|
|
||||||
|
|
||||||
osg::ref_ptr<osgGA::Device> rest_http_device = osgDB::readFile<osgGA::Device>(server_address+":"+server_port+"/"+document_root+".resthttp", device_options.get());
|
|
||||||
if (rest_http_device.valid())
|
|
||||||
{
|
|
||||||
viewer.addDevice(rest_http_device.get());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 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;
|
||||||
|
|
||||||
keyswitchManipulator->addMatrixManipulator( '1', "Trackball", new osgGA::MultiTouchTrackballManipulator() );
|
keyswitchManipulator->addMatrixManipulator( '1', "Trackball", new osgGA::TrackballManipulator() );
|
||||||
keyswitchManipulator->addMatrixManipulator( '2', "Flight", new osgGA::FlightManipulator() );
|
keyswitchManipulator->addMatrixManipulator( '2', "Flight", new osgGA::FlightManipulator() );
|
||||||
keyswitchManipulator->addMatrixManipulator( '3', "Drive", new osgGA::DriveManipulator() );
|
keyswitchManipulator->addMatrixManipulator( '3', "Drive", new osgGA::DriveManipulator() );
|
||||||
keyswitchManipulator->addMatrixManipulator( '4', "Terrain", new osgGA::TerrainManipulator() );
|
keyswitchManipulator->addMatrixManipulator( '4', "Terrain", new osgGA::TerrainManipulator() );
|
||||||
@@ -499,12 +541,8 @@ int main( int argc, char **argv )
|
|||||||
viewer.setCameraManipulator( keyswitchManipulator.get() );
|
viewer.setCameraManipulator( keyswitchManipulator.get() );
|
||||||
}
|
}
|
||||||
|
|
||||||
//viewer.getEventHandlers().push_front(new DumpEventHandler());
|
|
||||||
|
|
||||||
// add the state manipulator
|
// add the state manipulator
|
||||||
osg::ref_ptr<osgGA::StateSetManipulator> ssManipulator = new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet());
|
viewer.addEventHandler( new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()) );
|
||||||
ssManipulator->setKeyEventToggleTexturing('e');
|
|
||||||
viewer.addEventHandler( ssManipulator.get() );
|
|
||||||
|
|
||||||
// add the state manipulator
|
// add the state manipulator
|
||||||
viewer.addEventHandler( new osgViewer::StatsHandler() );
|
viewer.addEventHandler( new osgViewer::StatsHandler() );
|
||||||
@@ -519,20 +557,11 @@ int main( int argc, char **argv )
|
|||||||
std::string cursorFileName( p3dCursor ? p3dCursor : "");
|
std::string cursorFileName( p3dCursor ? p3dCursor : "");
|
||||||
while (arguments.read("--cursor",cursorFileName)) {}
|
while (arguments.read("--cursor",cursorFileName)) {}
|
||||||
|
|
||||||
const char* p3dShowCursor = getenv("P3D_SHOW_CURSOR");
|
|
||||||
std::string showCursor( p3dShowCursor ? p3dShowCursor : "YES");
|
|
||||||
while (arguments.read("--show-cursor")) { showCursor="YES"; }
|
|
||||||
while (arguments.read("--hide-cursor")) { showCursor="NO"; }
|
|
||||||
|
|
||||||
bool hideCursor = (showCursor=="No" || showCursor=="NO" || showCursor=="no");
|
|
||||||
|
|
||||||
while (arguments.read("--set-viewer")) { doSetViewer = true; }
|
while (arguments.read("--set-viewer")) { doSetViewer = true; }
|
||||||
|
|
||||||
while (arguments.read("--no-set-viewer")) { doSetViewer = false; }
|
while (arguments.read("--no-set-viewer")) { doSetViewer = false; }
|
||||||
|
|
||||||
// if we want to hide the cursor override the custom cursor.
|
|
||||||
if (hideCursor) cursorFileName.clear();
|
|
||||||
|
|
||||||
|
|
||||||
// cluster related entries.
|
// cluster related entries.
|
||||||
int socketNumber=8100;
|
int socketNumber=8100;
|
||||||
@@ -560,29 +589,10 @@ int main( int argc, char **argv )
|
|||||||
bool loopPresentation = false;
|
bool loopPresentation = false;
|
||||||
while (arguments.read("--loop")) loopPresentation = true;
|
while (arguments.read("--loop")) loopPresentation = true;
|
||||||
|
|
||||||
{
|
|
||||||
// set update hte default traversal mode settings for update visitor
|
|
||||||
// default to osg::NodeVisitor::TRAVERSE_ACTIVE_CHILDREN.
|
|
||||||
osg::NodeVisitor::TraversalMode updateTraversalMode = osg::NodeVisitor::TRAVERSE_ACTIVE_CHILDREN; // viewer.getUpdateVisitor()->getTraversalMode();
|
|
||||||
|
|
||||||
const char* p3dUpdateStr = getenv("P3D_UPDATE");
|
|
||||||
if (p3dUpdateStr)
|
|
||||||
{
|
|
||||||
std::string updateStr(p3dUpdateStr);
|
|
||||||
if (updateStr=="active" || updateStr=="Active" || updateStr=="ACTIVE") updateTraversalMode = osg::NodeVisitor::TRAVERSE_ACTIVE_CHILDREN;
|
|
||||||
else if (updateStr=="all" || updateStr=="All" || updateStr=="ALL") updateTraversalMode = osg::NodeVisitor::TRAVERSE_ALL_CHILDREN;
|
|
||||||
}
|
|
||||||
|
|
||||||
while(arguments.read("--update-active")) updateTraversalMode = osg::NodeVisitor::TRAVERSE_ACTIVE_CHILDREN;
|
|
||||||
while(arguments.read("--update-all")) updateTraversalMode = osg::NodeVisitor::TRAVERSE_ALL_CHILDREN;
|
|
||||||
|
|
||||||
viewer.getUpdateVisitor()->setTraversalMode(updateTraversalMode);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// register the slide event handler - which moves the presentation from slide to slide, layer to layer.
|
// register the slide event handler - which moves the presentation from slide to slide, layer to layer.
|
||||||
osg::ref_ptr<osgPresentation::SlideEventHandler> seh = new osgPresentation::SlideEventHandler(&viewer);
|
osgPresentation::SlideEventHandler* seh = new osgPresentation::SlideEventHandler(&viewer);
|
||||||
viewer.addEventHandler(seh.get());
|
viewer.addEventHandler(seh);
|
||||||
|
|
||||||
seh->setAutoSteppingActive(autoSteppingActive);
|
seh->setAutoSteppingActive(autoSteppingActive);
|
||||||
seh->setTimeDelayBetweenSlides(timeDelayBetweenSlides);
|
seh->setTimeDelayBetweenSlides(timeDelayBetweenSlides);
|
||||||
@@ -599,13 +609,13 @@ int main( int argc, char **argv )
|
|||||||
|
|
||||||
// set up optimizer options
|
// set up optimizer options
|
||||||
unsigned int optimizer_options = osgUtil::Optimizer::DEFAULT_OPTIMIZATIONS;
|
unsigned int optimizer_options = osgUtil::Optimizer::DEFAULT_OPTIMIZATIONS;
|
||||||
bool release_and_compile = false;
|
bool relase_and_compile = false;
|
||||||
while (arguments.read("--release-and-compile"))
|
while (arguments.read("--release-and-compile"))
|
||||||
{
|
{
|
||||||
release_and_compile = true;
|
relase_and_compile = true;
|
||||||
}
|
}
|
||||||
seh->setReleaseAndCompileOnEachNewSlide(release_and_compile);
|
seh->setReleaseAndCompileOnEachNewSlide(relase_and_compile);
|
||||||
if (release_and_compile)
|
if (relase_and_compile)
|
||||||
{
|
{
|
||||||
// make sure that imagery stays around after being applied to textures.
|
// make sure that imagery stays around after being applied to textures.
|
||||||
viewer.getDatabasePager()->setUnrefImageDataAfterApplyPolicy(true,false);
|
viewer.getDatabasePager()->setUnrefImageDataAfterApplyPolicy(true,false);
|
||||||
@@ -618,19 +628,8 @@ int main( int argc, char **argv )
|
|||||||
// osgDB::Registry::instance()->getOrCreateDatabasePager()->setExpiryDelay(1.0f);
|
// osgDB::Registry::instance()->getOrCreateDatabasePager()->setExpiryDelay(1.0f);
|
||||||
|
|
||||||
// register the handler for modifying the point size
|
// register the handler for modifying the point size
|
||||||
osg::ref_ptr<PointsEventHandler> peh = new PointsEventHandler;
|
PointsEventHandler* peh = new PointsEventHandler;
|
||||||
viewer.addEventHandler(peh.get());
|
viewer.addEventHandler(peh);
|
||||||
|
|
||||||
// add the screen capture handler
|
|
||||||
std::string screenCaptureFilename = "screen_shot.jpg";
|
|
||||||
while(arguments.read("--screenshot", screenCaptureFilename)) {}
|
|
||||||
osg::ref_ptr<osgViewer::ScreenCaptureHandler::WriteToFile> writeFile = new osgViewer::ScreenCaptureHandler::WriteToFile(
|
|
||||||
osgDB::getNameLessExtension(screenCaptureFilename),
|
|
||||||
osgDB::getFileExtension(screenCaptureFilename) );
|
|
||||||
osg::ref_ptr<osgViewer::ScreenCaptureHandler> screenCaptureHandler = new osgViewer::ScreenCaptureHandler(writeFile.get());
|
|
||||||
screenCaptureHandler->setKeyEventTakeScreenShot('m');//osgGA::GUIEventAdapter::KEY_Print);
|
|
||||||
screenCaptureHandler->setKeyEventToggleContinuousCapture('M');
|
|
||||||
viewer.addEventHandler(screenCaptureHandler.get());
|
|
||||||
|
|
||||||
// osg::DisplaySettings::instance()->setSplitStereoAutoAjustAspectRatio(false);
|
// osg::DisplaySettings::instance()->setSplitStereoAutoAjustAspectRatio(false);
|
||||||
|
|
||||||
@@ -652,10 +651,9 @@ int main( int argc, char **argv )
|
|||||||
viewer.getUsage(*arguments.getApplicationUsage());
|
viewer.getUsage(*arguments.getApplicationUsage());
|
||||||
|
|
||||||
// if user request help write it out to cout.
|
// if user request help write it out to cout.
|
||||||
unsigned int helpType = 0;
|
if (arguments.read("-h") || arguments.read("--help"))
|
||||||
if ((helpType = arguments.readHelpType()))
|
|
||||||
{
|
{
|
||||||
arguments.getApplicationUsage()->write(std::cout, helpType);
|
arguments.getApplicationUsage()->write(osg::notify(osg::NOTICE));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -750,9 +748,6 @@ int main( int argc, char **argv )
|
|||||||
|
|
||||||
|
|
||||||
osg::ref_ptr<osgDB::ReaderWriter::Options> cacheAllOption = new osgDB::ReaderWriter::Options;
|
osg::ref_ptr<osgDB::ReaderWriter::Options> cacheAllOption = new osgDB::ReaderWriter::Options;
|
||||||
if(suppress_env_tags)
|
|
||||||
cacheAllOption->setPluginStringData("suppressEnvTags", "true");
|
|
||||||
|
|
||||||
cacheAllOption->setObjectCacheHint(osgDB::ReaderWriter::Options::CACHE_ALL);
|
cacheAllOption->setObjectCacheHint(osgDB::ReaderWriter::Options::CACHE_ALL);
|
||||||
osgDB::Registry::instance()->setOptions(cacheAllOption.get());
|
osgDB::Registry::instance()->setOptions(cacheAllOption.get());
|
||||||
|
|
||||||
@@ -794,7 +789,26 @@ int main( int argc, char **argv )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
processLoadedModel(loadedModel, optimizer_options, cursorFileName);
|
#if !defined(OSG_GLES2_AVAILABLE) && !defined(OSG_GL3_AVAILABLE)
|
||||||
|
|
||||||
|
// add back in enabling of the GL_ALPHA_TEST to get around the core OSG no longer setting it by default for opaque bins.
|
||||||
|
// the alpha test is required for the volume rendering alpha clipping to work.
|
||||||
|
loadedModel->getOrCreateStateSet()->setMode(GL_ALPHA_TEST, osg::StateAttribute::ON);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
// optimize the scene graph, remove rendundent nodes and state etc.
|
||||||
|
osgUtil::Optimizer optimizer;
|
||||||
|
optimizer.optimize(loadedModel.get(), optimizer_options);
|
||||||
|
|
||||||
|
if (!cursorFileName.empty())
|
||||||
|
{
|
||||||
|
osg::ref_ptr<osg::Group> group = new osg::Group;
|
||||||
|
group->addChild(loadedModel.get());
|
||||||
|
group->addChild(createCursorSubgraph(cursorFileName, 0.05f));
|
||||||
|
|
||||||
|
loadedModel = group.get();
|
||||||
|
}
|
||||||
|
|
||||||
// set the scene to render
|
// set the scene to render
|
||||||
viewer.setSceneData(loadedModel.get());
|
viewer.setSceneData(loadedModel.get());
|
||||||
@@ -813,23 +827,7 @@ int main( int argc, char **argv )
|
|||||||
viewerInitialized = true;
|
viewerInitialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!cursorFileName.empty())
|
||||||
|
|
||||||
|
|
||||||
// pass the model to the slide event handler so it knows which to manipulate.
|
|
||||||
seh->set(loadedModel.get());
|
|
||||||
seh->selectSlide(0);
|
|
||||||
|
|
||||||
seh->home();
|
|
||||||
|
|
||||||
if (!outputFileName.empty())
|
|
||||||
{
|
|
||||||
osgDB::writeNodeFile(*loadedModel,outputFileName);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!cursorFileName.empty() || hideCursor)
|
|
||||||
{
|
{
|
||||||
// have to add a frame in here to avoid problems with X11 threading issue on switching off the cursor
|
// have to add a frame in here to avoid problems with X11 threading issue on switching off the cursor
|
||||||
// not yet sure why it makes a difference, but it at least fixes the crash that would otherwise occur
|
// not yet sure why it makes a difference, but it at least fixes the crash that would otherwise occur
|
||||||
@@ -847,6 +845,18 @@ int main( int argc, char **argv )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// pass the model to the slide event handler so it knows which to manipulate.
|
||||||
|
seh->set(loadedModel.get());
|
||||||
|
seh->selectSlide(0);
|
||||||
|
|
||||||
|
seh->home();
|
||||||
|
|
||||||
|
if (!outputFileName.empty())
|
||||||
|
{
|
||||||
|
osgDB::writeNodeFile(*loadedModel,outputFileName);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
osg::Timer_t startOfFrameTick = osg::Timer::instance()->tick();
|
osg::Timer_t startOfFrameTick = osg::Timer::instance()->tick();
|
||||||
double targetFrameTime = 1.0/targetFrameRate;
|
double targetFrameTime = 1.0/targetFrameRate;
|
||||||
|
|
||||||
@@ -930,36 +940,11 @@ int main( int argc, char **argv )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// update the scene by traversing it with the update visitor which will
|
// update the scene by traversing it with the the update visitor which will
|
||||||
// call all node update callbacks and animations.
|
// call all node update callbacks and animations.
|
||||||
viewer.eventTraversal();
|
viewer.eventTraversal();
|
||||||
|
|
||||||
if (seh->getRequestReload())
|
// update the scene by traversing it with the the update visitor which will
|
||||||
{
|
|
||||||
OSG_INFO<<"Reload requested"<<std::endl;
|
|
||||||
seh->setRequestReload(false);
|
|
||||||
int previous_ActiveSlide = seh->getActiveSlide();
|
|
||||||
int previous_ActiveLayer = seh->getActiveLayer();
|
|
||||||
|
|
||||||
// reset time so any event key generate
|
|
||||||
|
|
||||||
loadedModel = p3d::readShowFiles(arguments,cacheAllOption.get());
|
|
||||||
processLoadedModel(loadedModel, optimizer_options, cursorFileName);
|
|
||||||
|
|
||||||
if (!loadedModel)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
viewer.setSceneData(loadedModel.get());
|
|
||||||
seh->set(loadedModel.get());
|
|
||||||
seh->selectSlide(previous_ActiveSlide, previous_ActiveLayer);
|
|
||||||
|
|
||||||
continue;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// update the scene by traversing it with the update visitor which will
|
|
||||||
// call all node update callbacks and animations.
|
// call all node update callbacks and animations.
|
||||||
viewer.updateTraversal();
|
viewer.updateTraversal();
|
||||||
|
|
||||||
@@ -978,7 +963,7 @@ int main( int argc, char **argv )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ExportHTML::write(seh.get(), viewer, exportName);
|
ExportHTML::write(seh, viewer, exportName);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ SHORT_NAMES = YES
|
|||||||
JAVADOC_AUTOBRIEF = YES
|
JAVADOC_AUTOBRIEF = YES
|
||||||
QT_AUTOBRIEF = NO
|
QT_AUTOBRIEF = NO
|
||||||
MULTILINE_CPP_IS_BRIEF = NO
|
MULTILINE_CPP_IS_BRIEF = NO
|
||||||
|
DETAILS_AT_TOP = NO
|
||||||
INHERIT_DOCS = YES
|
INHERIT_DOCS = YES
|
||||||
SEPARATE_MEMBER_PAGES = NO
|
SEPARATE_MEMBER_PAGES = NO
|
||||||
TAB_SIZE = 8
|
TAB_SIZE = 8
|
||||||
@@ -75,6 +76,7 @@ GENERATE_DEPRECATEDLIST= YES
|
|||||||
ENABLED_SECTIONS =
|
ENABLED_SECTIONS =
|
||||||
MAX_INITIALIZER_LINES = 30
|
MAX_INITIALIZER_LINES = 30
|
||||||
SHOW_USED_FILES = YES
|
SHOW_USED_FILES = YES
|
||||||
|
SHOW_DIRECTORIES = NO
|
||||||
SHOW_FILES = YES
|
SHOW_FILES = YES
|
||||||
SHOW_NAMESPACES = YES
|
SHOW_NAMESPACES = YES
|
||||||
FILE_VERSION_FILTER =
|
FILE_VERSION_FILTER =
|
||||||
@@ -136,6 +138,7 @@ HTML_FILE_EXTENSION = .html
|
|||||||
HTML_HEADER =
|
HTML_HEADER =
|
||||||
HTML_FOOTER = ${OpenSceneGraph_SOURCE_DIR}/doc/Doxyfiles/custom_Footer.html
|
HTML_FOOTER = ${OpenSceneGraph_SOURCE_DIR}/doc/Doxyfiles/custom_Footer.html
|
||||||
HTML_STYLESHEET =
|
HTML_STYLESHEET =
|
||||||
|
HTML_ALIGN_MEMBERS = YES
|
||||||
GENERATE_HTMLHELP = NO
|
GENERATE_HTMLHELP = NO
|
||||||
GENERATE_DOCSET = NO
|
GENERATE_DOCSET = NO
|
||||||
DOCSET_FEEDNAME = "Doxygen generated docs"
|
DOCSET_FEEDNAME = "Doxygen generated docs"
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ SHORT_NAMES = YES
|
|||||||
JAVADOC_AUTOBRIEF = YES
|
JAVADOC_AUTOBRIEF = YES
|
||||||
QT_AUTOBRIEF = NO
|
QT_AUTOBRIEF = NO
|
||||||
MULTILINE_CPP_IS_BRIEF = NO
|
MULTILINE_CPP_IS_BRIEF = NO
|
||||||
|
DETAILS_AT_TOP = NO
|
||||||
INHERIT_DOCS = YES
|
INHERIT_DOCS = YES
|
||||||
SEPARATE_MEMBER_PAGES = NO
|
SEPARATE_MEMBER_PAGES = NO
|
||||||
TAB_SIZE = 8
|
TAB_SIZE = 8
|
||||||
@@ -75,6 +76,7 @@ GENERATE_DEPRECATEDLIST= YES
|
|||||||
ENABLED_SECTIONS =
|
ENABLED_SECTIONS =
|
||||||
MAX_INITIALIZER_LINES = 30
|
MAX_INITIALIZER_LINES = 30
|
||||||
SHOW_USED_FILES = YES
|
SHOW_USED_FILES = YES
|
||||||
|
SHOW_DIRECTORIES = NO
|
||||||
SHOW_FILES = YES
|
SHOW_FILES = YES
|
||||||
SHOW_NAMESPACES = YES
|
SHOW_NAMESPACES = YES
|
||||||
FILE_VERSION_FILTER =
|
FILE_VERSION_FILTER =
|
||||||
@@ -149,6 +151,7 @@ HTML_FILE_EXTENSION = .html
|
|||||||
HTML_HEADER =
|
HTML_HEADER =
|
||||||
HTML_FOOTER = ${OpenSceneGraph_SOURCE_DIR}/doc/Doxyfiles/custom_Footer.html
|
HTML_FOOTER = ${OpenSceneGraph_SOURCE_DIR}/doc/Doxyfiles/custom_Footer.html
|
||||||
HTML_STYLESHEET =
|
HTML_STYLESHEET =
|
||||||
|
HTML_ALIGN_MEMBERS = YES
|
||||||
GENERATE_HTMLHELP = NO
|
GENERATE_HTMLHELP = NO
|
||||||
GENERATE_DOCSET = NO
|
GENERATE_DOCSET = NO
|
||||||
DOCSET_FEEDNAME = "Doxygen generated docs"
|
DOCSET_FEEDNAME = "Doxygen generated docs"
|
||||||
|
|||||||
@@ -128,6 +128,13 @@ JAVADOC_AUTOBRIEF = NO
|
|||||||
|
|
||||||
MULTILINE_CPP_IS_BRIEF = NO
|
MULTILINE_CPP_IS_BRIEF = NO
|
||||||
|
|
||||||
|
# If the DETAILS_AT_TOP tag is set to YES then Doxygen
|
||||||
|
# will output the detailed description near the top, like JavaDoc.
|
||||||
|
# If set to NO, the detailed description appears after the member
|
||||||
|
# documentation.
|
||||||
|
|
||||||
|
DETAILS_AT_TOP = NO
|
||||||
|
|
||||||
# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
|
# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
|
||||||
# member inherits the documentation from any documented member that it
|
# member inherits the documentation from any documented member that it
|
||||||
# re-implements.
|
# re-implements.
|
||||||
@@ -564,6 +571,12 @@ HTML_FOOTER =
|
|||||||
|
|
||||||
HTML_STYLESHEET =
|
HTML_STYLESHEET =
|
||||||
|
|
||||||
|
# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
|
||||||
|
# files or namespaces will be aligned in HTML using tables. If set to
|
||||||
|
# NO a bullet list will be used.
|
||||||
|
|
||||||
|
HTML_ALIGN_MEMBERS = YES
|
||||||
|
|
||||||
# If the GENERATE_HTMLHELP tag is set to YES, additional index files
|
# If the GENERATE_HTMLHELP tag is set to YES, additional index files
|
||||||
# will be generated that can be used as input for tools like the
|
# will be generated that can be used as input for tools like the
|
||||||
# Microsoft HTML help workshop to generate a compressed HTML help file (.chm)
|
# Microsoft HTML help workshop to generate a compressed HTML help file (.chm)
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ SHORT_NAMES = YES
|
|||||||
JAVADOC_AUTOBRIEF = YES
|
JAVADOC_AUTOBRIEF = YES
|
||||||
QT_AUTOBRIEF = NO
|
QT_AUTOBRIEF = NO
|
||||||
MULTILINE_CPP_IS_BRIEF = NO
|
MULTILINE_CPP_IS_BRIEF = NO
|
||||||
|
DETAILS_AT_TOP = NO
|
||||||
INHERIT_DOCS = YES
|
INHERIT_DOCS = YES
|
||||||
SEPARATE_MEMBER_PAGES = NO
|
SEPARATE_MEMBER_PAGES = NO
|
||||||
TAB_SIZE = 8
|
TAB_SIZE = 8
|
||||||
@@ -65,6 +66,7 @@ GENERATE_DEPRECATEDLIST= YES
|
|||||||
ENABLED_SECTIONS =
|
ENABLED_SECTIONS =
|
||||||
MAX_INITIALIZER_LINES = 30
|
MAX_INITIALIZER_LINES = 30
|
||||||
SHOW_USED_FILES = YES
|
SHOW_USED_FILES = YES
|
||||||
|
SHOW_DIRECTORIES = NO
|
||||||
SHOW_FILES = YES
|
SHOW_FILES = YES
|
||||||
SHOW_NAMESPACES = YES
|
SHOW_NAMESPACES = YES
|
||||||
FILE_VERSION_FILTER =
|
FILE_VERSION_FILTER =
|
||||||
@@ -139,6 +141,7 @@ HTML_FILE_EXTENSION = .html
|
|||||||
HTML_HEADER =
|
HTML_HEADER =
|
||||||
HTML_FOOTER = ${OpenSceneGraph_SOURCE_DIR}/doc/Doxyfiles/custom_Footer.html
|
HTML_FOOTER = ${OpenSceneGraph_SOURCE_DIR}/doc/Doxyfiles/custom_Footer.html
|
||||||
HTML_STYLESHEET =
|
HTML_STYLESHEET =
|
||||||
|
HTML_ALIGN_MEMBERS = YES
|
||||||
GENERATE_HTMLHELP = NO
|
GENERATE_HTMLHELP = NO
|
||||||
GENERATE_DOCSET = NO
|
GENERATE_DOCSET = NO
|
||||||
DOCSET_FEEDNAME = "Doxygen generated docs"
|
DOCSET_FEEDNAME = "Doxygen generated docs"
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ GENERATE_DEPRECATEDLIST= YES
|
|||||||
ENABLED_SECTIONS =
|
ENABLED_SECTIONS =
|
||||||
MAX_INITIALIZER_LINES = 30
|
MAX_INITIALIZER_LINES = 30
|
||||||
SHOW_USED_FILES = YES
|
SHOW_USED_FILES = YES
|
||||||
|
SHOW_DIRECTORIES = YES
|
||||||
SHOW_FILES = YES
|
SHOW_FILES = YES
|
||||||
SHOW_NAMESPACES = YES
|
SHOW_NAMESPACES = YES
|
||||||
FILE_VERSION_FILTER =
|
FILE_VERSION_FILTER =
|
||||||
@@ -140,6 +141,7 @@ HTML_FILE_EXTENSION = .html
|
|||||||
HTML_HEADER =
|
HTML_HEADER =
|
||||||
HTML_FOOTER = "${OpenSceneGraph_SOURCE_DIR}/doc/Doxyfiles/custom_Footer.html"
|
HTML_FOOTER = "${OpenSceneGraph_SOURCE_DIR}/doc/Doxyfiles/custom_Footer.html"
|
||||||
HTML_STYLESHEET =
|
HTML_STYLESHEET =
|
||||||
|
HTML_ALIGN_MEMBERS = YES
|
||||||
HTML_DYNAMIC_SECTIONS = NO
|
HTML_DYNAMIC_SECTIONS = NO
|
||||||
GENERATE_DOCSET = NO
|
GENERATE_DOCSET = NO
|
||||||
DOCSET_FEEDNAME = "Doxygen generated docs"
|
DOCSET_FEEDNAME = "Doxygen generated docs"
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ GENERATE_DEPRECATEDLIST= YES
|
|||||||
ENABLED_SECTIONS =
|
ENABLED_SECTIONS =
|
||||||
MAX_INITIALIZER_LINES = 30
|
MAX_INITIALIZER_LINES = 30
|
||||||
SHOW_USED_FILES = YES
|
SHOW_USED_FILES = YES
|
||||||
|
SHOW_DIRECTORIES = YES
|
||||||
SHOW_FILES = YES
|
SHOW_FILES = YES
|
||||||
SHOW_NAMESPACES = YES
|
SHOW_NAMESPACES = YES
|
||||||
FILE_VERSION_FILTER =
|
FILE_VERSION_FILTER =
|
||||||
@@ -125,6 +126,7 @@ HTML_FILE_EXTENSION = .html
|
|||||||
HTML_HEADER =
|
HTML_HEADER =
|
||||||
HTML_FOOTER = "${OpenSceneGraph_SOURCE_DIR}/doc/Doxyfiles/custom_Footer.html"
|
HTML_FOOTER = "${OpenSceneGraph_SOURCE_DIR}/doc/Doxyfiles/custom_Footer.html"
|
||||||
HTML_STYLESHEET =
|
HTML_STYLESHEET =
|
||||||
|
HTML_ALIGN_MEMBERS = YES
|
||||||
HTML_DYNAMIC_SECTIONS = NO
|
HTML_DYNAMIC_SECTIONS = NO
|
||||||
GENERATE_DOCSET = NO
|
GENERATE_DOCSET = NO
|
||||||
DOCSET_FEEDNAME = "Doxygen generated docs"
|
DOCSET_FEEDNAME = "Doxygen generated docs"
|
||||||
|
|||||||
@@ -23,11 +23,9 @@ IF(DYNAMIC_OPENSCENEGRAPH)
|
|||||||
ADD_SUBDIRECTORY(osg2cpp)
|
ADD_SUBDIRECTORY(osg2cpp)
|
||||||
ADD_SUBDIRECTORY(osganalysis)
|
ADD_SUBDIRECTORY(osganalysis)
|
||||||
ADD_SUBDIRECTORY(osganimate)
|
ADD_SUBDIRECTORY(osganimate)
|
||||||
ADD_SUBDIRECTORY(osgatomiccounter)
|
|
||||||
ADD_SUBDIRECTORY(osgautocapture)
|
ADD_SUBDIRECTORY(osgautocapture)
|
||||||
ADD_SUBDIRECTORY(osgautotransform)
|
ADD_SUBDIRECTORY(osgautotransform)
|
||||||
ADD_SUBDIRECTORY(osgbillboard)
|
ADD_SUBDIRECTORY(osgbillboard)
|
||||||
ADD_SUBDIRECTORY(osgblenddrawbuffers)
|
|
||||||
ADD_SUBDIRECTORY(osgblendequation)
|
ADD_SUBDIRECTORY(osgblendequation)
|
||||||
ADD_SUBDIRECTORY(osgcallback)
|
ADD_SUBDIRECTORY(osgcallback)
|
||||||
ADD_SUBDIRECTORY(osgcamera)
|
ADD_SUBDIRECTORY(osgcamera)
|
||||||
@@ -49,6 +47,7 @@ IF(DYNAMIC_OPENSCENEGRAPH)
|
|||||||
ADD_SUBDIRECTORY(osgfxbrowser)
|
ADD_SUBDIRECTORY(osgfxbrowser)
|
||||||
ADD_SUBDIRECTORY(osgoutline)
|
ADD_SUBDIRECTORY(osgoutline)
|
||||||
ADD_SUBDIRECTORY(osggameoflife)
|
ADD_SUBDIRECTORY(osggameoflife)
|
||||||
|
ADD_SUBDIRECTORY(osggeodemo)
|
||||||
ADD_SUBDIRECTORY(osggeometry)
|
ADD_SUBDIRECTORY(osggeometry)
|
||||||
ADD_SUBDIRECTORY(osggeometryshaders)
|
ADD_SUBDIRECTORY(osggeometryshaders)
|
||||||
ADD_SUBDIRECTORY(osghangglide)
|
ADD_SUBDIRECTORY(osghangglide)
|
||||||
@@ -59,27 +58,22 @@ IF(DYNAMIC_OPENSCENEGRAPH)
|
|||||||
ADD_SUBDIRECTORY(osgkdtree)
|
ADD_SUBDIRECTORY(osgkdtree)
|
||||||
ADD_SUBDIRECTORY(osgkeyboard)
|
ADD_SUBDIRECTORY(osgkeyboard)
|
||||||
ADD_SUBDIRECTORY(osgkeyboardmouse)
|
ADD_SUBDIRECTORY(osgkeyboardmouse)
|
||||||
ADD_SUBDIRECTORY(osgkeystone)
|
|
||||||
ADD_SUBDIRECTORY(osglauncher)
|
ADD_SUBDIRECTORY(osglauncher)
|
||||||
ADD_SUBDIRECTORY(osglight)
|
ADD_SUBDIRECTORY(osglight)
|
||||||
ADD_SUBDIRECTORY(osglightpoint)
|
ADD_SUBDIRECTORY(osglightpoint)
|
||||||
ADD_SUBDIRECTORY(osglogicop)
|
ADD_SUBDIRECTORY(osglogicop)
|
||||||
ADD_SUBDIRECTORY(osglogo)
|
ADD_SUBDIRECTORY(osglogo)
|
||||||
ADD_SUBDIRECTORY(osggpucull)
|
|
||||||
ADD_SUBDIRECTORY(osggpx)
|
ADD_SUBDIRECTORY(osggpx)
|
||||||
ADD_SUBDIRECTORY(osggraphicscost)
|
ADD_SUBDIRECTORY(osggraphicscost)
|
||||||
ADD_SUBDIRECTORY(osgmanipulator)
|
ADD_SUBDIRECTORY(osgmanipulator)
|
||||||
ADD_SUBDIRECTORY(osgmovie)
|
ADD_SUBDIRECTORY(osgmovie)
|
||||||
ADD_SUBDIRECTORY(osgmultiplemovies)
|
|
||||||
ADD_SUBDIRECTORY(osgmultiplerendertargets)
|
ADD_SUBDIRECTORY(osgmultiplerendertargets)
|
||||||
ADD_SUBDIRECTORY(osgmultitexture)
|
ADD_SUBDIRECTORY(osgmultitexture)
|
||||||
ADD_SUBDIRECTORY(osgmultitexturecontrol)
|
ADD_SUBDIRECTORY(osgmultitexturecontrol)
|
||||||
ADD_SUBDIRECTORY(osgmultitouch)
|
|
||||||
ADD_SUBDIRECTORY(osgmultiviewpaging)
|
ADD_SUBDIRECTORY(osgmultiviewpaging)
|
||||||
ADD_SUBDIRECTORY(osgoccluder)
|
ADD_SUBDIRECTORY(osgoccluder)
|
||||||
ADD_SUBDIRECTORY(osgocclusionquery)
|
ADD_SUBDIRECTORY(osgocclusionquery)
|
||||||
ADD_SUBDIRECTORY(osgoit)
|
ADD_SUBDIRECTORY(osgoit)
|
||||||
ADD_SUBDIRECTORY(osgoscdevice)
|
|
||||||
ADD_SUBDIRECTORY(osgpackeddepthstencil)
|
ADD_SUBDIRECTORY(osgpackeddepthstencil)
|
||||||
ADD_SUBDIRECTORY(osgpagedlod)
|
ADD_SUBDIRECTORY(osgpagedlod)
|
||||||
ADD_SUBDIRECTORY(osgparametric)
|
ADD_SUBDIRECTORY(osgparametric)
|
||||||
@@ -96,7 +90,6 @@ IF(DYNAMIC_OPENSCENEGRAPH)
|
|||||||
ADD_SUBDIRECTORY(osgprerendercubemap)
|
ADD_SUBDIRECTORY(osgprerendercubemap)
|
||||||
ADD_SUBDIRECTORY(osgreflect)
|
ADD_SUBDIRECTORY(osgreflect)
|
||||||
ADD_SUBDIRECTORY(osgrobot)
|
ADD_SUBDIRECTORY(osgrobot)
|
||||||
ADD_SUBDIRECTORY(osgSSBO)
|
|
||||||
ADD_SUBDIRECTORY(osgscalarbar)
|
ADD_SUBDIRECTORY(osgscalarbar)
|
||||||
ADD_SUBDIRECTORY(osgscribe)
|
ADD_SUBDIRECTORY(osgscribe)
|
||||||
ADD_SUBDIRECTORY(osgsequence)
|
ADD_SUBDIRECTORY(osgsequence)
|
||||||
@@ -108,7 +101,6 @@ IF(DYNAMIC_OPENSCENEGRAPH)
|
|||||||
ADD_SUBDIRECTORY(osgshadow)
|
ADD_SUBDIRECTORY(osgshadow)
|
||||||
ADD_SUBDIRECTORY(osgshape)
|
ADD_SUBDIRECTORY(osgshape)
|
||||||
ADD_SUBDIRECTORY(osgsharedarray)
|
ADD_SUBDIRECTORY(osgsharedarray)
|
||||||
ADD_SUBDIRECTORY(osgsimpleshaders)
|
|
||||||
ADD_SUBDIRECTORY(osgsimplifier)
|
ADD_SUBDIRECTORY(osgsimplifier)
|
||||||
ADD_SUBDIRECTORY(osgsimulation)
|
ADD_SUBDIRECTORY(osgsimulation)
|
||||||
ADD_SUBDIRECTORY(osgsidebyside)
|
ADD_SUBDIRECTORY(osgsidebyside)
|
||||||
@@ -120,17 +112,14 @@ IF(DYNAMIC_OPENSCENEGRAPH)
|
|||||||
ADD_SUBDIRECTORY(osgstereomatch)
|
ADD_SUBDIRECTORY(osgstereomatch)
|
||||||
ADD_SUBDIRECTORY(osgterrain)
|
ADD_SUBDIRECTORY(osgterrain)
|
||||||
ADD_SUBDIRECTORY(osgthreadedterrain)
|
ADD_SUBDIRECTORY(osgthreadedterrain)
|
||||||
ADD_SUBDIRECTORY(osgtransferfunction)
|
|
||||||
ADD_SUBDIRECTORY(osgtext)
|
ADD_SUBDIRECTORY(osgtext)
|
||||||
ADD_SUBDIRECTORY(osgtext3D)
|
ADD_SUBDIRECTORY(osgtext3D)
|
||||||
ADD_SUBDIRECTORY(osgtexture1D)
|
ADD_SUBDIRECTORY(osgtexture1D)
|
||||||
ADD_SUBDIRECTORY(osgtexture2D)
|
ADD_SUBDIRECTORY(osgtexture2D)
|
||||||
ADD_SUBDIRECTORY(osgtexture2DArray)
|
|
||||||
ADD_SUBDIRECTORY(osgtexture3D)
|
ADD_SUBDIRECTORY(osgtexture3D)
|
||||||
ADD_SUBDIRECTORY(osgtexturerectangle)
|
ADD_SUBDIRECTORY(osgtexturerectangle)
|
||||||
ADD_SUBDIRECTORY(osgtexturecompression)
|
ADD_SUBDIRECTORY(osgtexturecompression)
|
||||||
ADD_SUBDIRECTORY(osgthirdpersonview)
|
ADD_SUBDIRECTORY(osgthirdpersonview)
|
||||||
ADD_SUBDIRECTORY(osgtransformfeedback)
|
|
||||||
ADD_SUBDIRECTORY(osguniformbuffer)
|
ADD_SUBDIRECTORY(osguniformbuffer)
|
||||||
ADD_SUBDIRECTORY(osguserstats)
|
ADD_SUBDIRECTORY(osguserstats)
|
||||||
ADD_SUBDIRECTORY(osgvertexprogram)
|
ADD_SUBDIRECTORY(osgvertexprogram)
|
||||||
@@ -164,9 +153,6 @@ IF(DYNAMIC_OPENSCENEGRAPH)
|
|||||||
ADD_SUBDIRECTORY(osgwidgetwindow)
|
ADD_SUBDIRECTORY(osgwidgetwindow)
|
||||||
ADD_SUBDIRECTORY(osguserdata)
|
ADD_SUBDIRECTORY(osguserdata)
|
||||||
|
|
||||||
# GL3/GL4 example
|
|
||||||
ADD_SUBDIRECTORY(osgsimplegl3)
|
|
||||||
|
|
||||||
IF(OSG_CPP_EXCEPTIONS_AVAILABLE)
|
IF(OSG_CPP_EXCEPTIONS_AVAILABLE)
|
||||||
ADD_SUBDIRECTORY(osgunittests)
|
ADD_SUBDIRECTORY(osgunittests)
|
||||||
ADD_SUBDIRECTORY(osgmemorytest)
|
ADD_SUBDIRECTORY(osgmemorytest)
|
||||||
@@ -184,8 +170,6 @@ IF(DYNAMIC_OPENSCENEGRAPH)
|
|||||||
|
|
||||||
ADD_SUBDIRECTORY(osgphotoalbum)
|
ADD_SUBDIRECTORY(osgphotoalbum)
|
||||||
ADD_SUBDIRECTORY(osgtessellate)
|
ADD_SUBDIRECTORY(osgtessellate)
|
||||||
ADD_SUBDIRECTORY(osgtessellationshaders)
|
|
||||||
ADD_SUBDIRECTORY(osgcomputeshaders)
|
|
||||||
|
|
||||||
ADD_SUBDIRECTORY(osgpdf)
|
ADD_SUBDIRECTORY(osgpdf)
|
||||||
|
|
||||||
@@ -205,29 +189,28 @@ IF(DYNAMIC_OPENSCENEGRAPH)
|
|||||||
ADD_SUBDIRECTORY(osgviewerFOX)
|
ADD_SUBDIRECTORY(osgviewerFOX)
|
||||||
ENDIF(FOX_FOUND)
|
ENDIF(FOX_FOUND)
|
||||||
|
|
||||||
IF (wxWidgets_FOUND AND CMAKE_BUILD_TYPE)
|
IF (wxWidgets_FOUND)
|
||||||
IF (${CMAKE_BUILD_TYPE} STREQUAL "Release")
|
ADD_SUBDIRECTORY(osgviewerWX)
|
||||||
ADD_SUBDIRECTORY(osgviewerWX)
|
ENDIF(wxWidgets_FOUND)
|
||||||
ENDIF()
|
|
||||||
ENDIF()
|
|
||||||
|
|
||||||
IF ( (QT4_FOUND OR Qt5Widgets_FOUND) AND NOT OSG_GLES1_AVAILABLE AND NOT OSG_GLES2_AVAILABLE AND NOT OSG_GL3_AVAILABLE)
|
IF (QT_FOUND AND NOT OSG_GLES1_AVAILABLE AND NOT OSG_GLES2_AVAILABLE AND NOT OSG_GL3_AVAILABLE)
|
||||||
|
OPTION(BUILD_QT_EXAMPLES "Enable the build of the examples that depend on Qt" ON)
|
||||||
|
|
||||||
IF ( QT4_FOUND OR Qt5Widgets_FOUND)
|
IF (BUILD_QT_EXAMPLES AND QT_QTOPENGL_LIBRARY)
|
||||||
ADD_SUBDIRECTORY(osgviewerQt)
|
ADD_SUBDIRECTORY(osgviewerQt)
|
||||||
ADD_SUBDIRECTORY(osgqfont)
|
ADD_SUBDIRECTORY(osgqfont)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF ( (QT4_FOUND AND QT_QTWEBKIT_FOUND) OR Qt5WebKitWidgets_FOUND )
|
IF (BUILD_QT_EXAMPLES AND QT4_FOUND AND QT_QTWEBKIT_FOUND)
|
||||||
ADD_SUBDIRECTORY(osgQtWidgets)
|
ADD_SUBDIRECTORY(osgQtWidgets)
|
||||||
ADD_SUBDIRECTORY(osgQtBrowser)
|
ADD_SUBDIRECTORY(osgQtBrowser)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF (FLTK_FOUND AND FLTK_GL_LIBRARY)
|
IF (FLTK_FOUND)
|
||||||
ADD_SUBDIRECTORY(osgviewerFLTK)
|
ADD_SUBDIRECTORY(osgviewerFLTK)
|
||||||
ENDIF()
|
ENDIF(FLTK_FOUND)
|
||||||
|
|
||||||
IF (WIN32)
|
IF (WIN32)
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
// Search in str for all occurrences of spat and replace them with rpat.
|
// Search in str for all occurences of spat and replace them with rpat.
|
||||||
void searchAndReplace(std::string& str, const std::string& spat, const std::string& rpat)
|
void searchAndReplace(std::string& str, const std::string& spat, const std::string& rpat)
|
||||||
{
|
{
|
||||||
std::string::size_type pos = 0;
|
std::string::size_type pos = 0;
|
||||||
@@ -66,10 +66,9 @@ int main( int argc, char **argv )
|
|||||||
|
|
||||||
// set up the usage document, in case we need to print out how to use this program.
|
// set up the usage document, in case we need to print out how to use this program.
|
||||||
arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName());
|
arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName());
|
||||||
arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is a utility for converting glsl shader files into char arrays that can be compiled into applications.");
|
arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is a utility for converting between various input and output databases formats.");
|
||||||
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ...");
|
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ...");
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("--shader <filename>","Shader file to create a .cpp file for.");
|
arguments.getApplicationUsage()->addCommandLineOption("--shader <filename>","Shader file to create a .cpp file for.");
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("--write-to-source-file-directory","Use the path to the source filename as the directory to write to.");
|
|
||||||
arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display command line parameters");
|
arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display command line parameters");
|
||||||
|
|
||||||
// if user request help write it out to cout.
|
// if user request help write it out to cout.
|
||||||
@@ -79,9 +78,6 @@ int main( int argc, char **argv )
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool useSamePathAsSourceFile = false;
|
|
||||||
if (arguments.read("--write-to-source-file-directory")) useSamePathAsSourceFile = true;
|
|
||||||
|
|
||||||
std::string filename;
|
std::string filename;
|
||||||
if (arguments.read("--shader",filename))
|
if (arguments.read("--shader",filename))
|
||||||
{
|
{
|
||||||
@@ -100,9 +96,7 @@ int main( int argc, char **argv )
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string ext = osgDB::getFileExtension(filename);
|
std::string ext = osgDB::getFileExtension(filename);
|
||||||
std::string cppFileName = name + "_" + ext + ".cpp";
|
std::string cppFileName = osgDB::concatPaths(path, name + "_" + ext + ".cpp");
|
||||||
if (useSamePathAsSourceFile) cppFileName = osgDB::concatPaths(path, cppFileName);
|
|
||||||
|
|
||||||
std::string variableName = name + "_" + ext;
|
std::string variableName = name + "_" + ext;
|
||||||
writeShader(shader.get(), cppFileName, variableName);
|
writeShader(shader.get(), cppFileName, variableName);
|
||||||
|
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ JNIEXPORT void JNICALL Java_osg_AndroidExample_osgNativeLib_setClearColor(JNIEnv
|
|||||||
}
|
}
|
||||||
JNIEXPORT void JNICALL Java_osg_AndroidExample_osgNativeLib_loadObject(JNIEnv * env, jobject obj, jstring address){
|
JNIEXPORT void JNICALL Java_osg_AndroidExample_osgNativeLib_loadObject(JNIEnv * env, jobject obj, jstring address){
|
||||||
//Import Strings from JNI
|
//Import Strings from JNI
|
||||||
const char *nativeAddress = env->GetStringUTFChars(address, JNI_FALSE);
|
const char *nativeAddress = env->GetStringUTFChars(address, false);
|
||||||
|
|
||||||
mainApp.loadObject(std::string(nativeAddress));
|
mainApp.loadObject(std::string(nativeAddress));
|
||||||
|
|
||||||
@@ -84,8 +84,8 @@ JNIEXPORT void JNICALL Java_osg_AndroidExample_osgNativeLib_loadObject(JNIEnv *
|
|||||||
}
|
}
|
||||||
JNIEXPORT void JNICALL Java_osg_AndroidExample_osgNativeLib_loadObject(JNIEnv * env, jobject obj, jstring address, jstring name){
|
JNIEXPORT void JNICALL Java_osg_AndroidExample_osgNativeLib_loadObject(JNIEnv * env, jobject obj, jstring address, jstring name){
|
||||||
//Import Strings from JNI
|
//Import Strings from JNI
|
||||||
const char *nativeAddress = env->GetStringUTFChars(address,JNI_FALSE);
|
const char *nativeAddress = env->GetStringUTFChars(address, false);
|
||||||
const char *nativeName = env->GetStringUTFChars(name, JNI_FALSE);
|
const char *nativeName = env->GetStringUTFChars(name, false);
|
||||||
|
|
||||||
mainApp.loadObject(std::string(nativeName),std::string(nativeAddress));
|
mainApp.loadObject(std::string(nativeName),std::string(nativeAddress));
|
||||||
|
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ JNIEXPORT void JNICALL Java_osg_AndroidExample_osgNativeLib_setClearColor(JNIEnv
|
|||||||
}
|
}
|
||||||
JNIEXPORT void JNICALL Java_osg_AndroidExample_osgNativeLib_loadObject(JNIEnv * env, jobject obj, jstring address){
|
JNIEXPORT void JNICALL Java_osg_AndroidExample_osgNativeLib_loadObject(JNIEnv * env, jobject obj, jstring address){
|
||||||
//Import Strings from JNI
|
//Import Strings from JNI
|
||||||
const char *nativeAddress = env->GetStringUTFChars(address, JNI_FALSE);
|
const char *nativeAddress = env->GetStringUTFChars(address, false);
|
||||||
|
|
||||||
mainApp.loadObject(std::string(nativeAddress));
|
mainApp.loadObject(std::string(nativeAddress));
|
||||||
|
|
||||||
@@ -84,8 +84,8 @@ JNIEXPORT void JNICALL Java_osg_AndroidExample_osgNativeLib_loadObject(JNIEnv *
|
|||||||
}
|
}
|
||||||
JNIEXPORT void JNICALL Java_osg_AndroidExample_osgNativeLib_loadObject(JNIEnv * env, jobject obj, jstring address, jstring name){
|
JNIEXPORT void JNICALL Java_osg_AndroidExample_osgNativeLib_loadObject(JNIEnv * env, jobject obj, jstring address, jstring name){
|
||||||
//Import Strings from JNI
|
//Import Strings from JNI
|
||||||
const char *nativeAddress = env->GetStringUTFChars(address,JNI_FALSE);
|
const char *nativeAddress = env->GetStringUTFChars(address, false);
|
||||||
const char *nativeName = env->GetStringUTFChars(name, JNI_FALSE);
|
const char *nativeName = env->GetStringUTFChars(name, false);
|
||||||
|
|
||||||
mainApp.loadObject(std::string(nativeName),std::string(nativeAddress));
|
mainApp.loadObject(std::string(nativeName),std::string(nativeAddress));
|
||||||
|
|
||||||
|
|||||||
@@ -7,19 +7,10 @@ IF(CMAKE_COMPILER_IS_GNUCXX)
|
|||||||
STRING(REGEX REPLACE "-pedantic" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
STRING(REGEX REPLACE "-pedantic" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
if ( QT4_FOUND )
|
SET(TARGET_EXTERNAL_LIBRARIES ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTOPENGL_LIBRARY} ${QT_QTWEBKIT_LIBRARY})
|
||||||
SET(TARGET_EXTERNAL_LIBRARIES ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTOPENGL_LIBRARY} ${QT_QTWEBKIT_LIBRARY})
|
INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR})
|
||||||
INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR} ${QT_QTOPENGL_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR} ${QT_QTWEBKIT_INCLUDE_DIR} )
|
|
||||||
endif( QT4_FOUND )
|
|
||||||
|
|
||||||
SET(TARGET_ADDED_LIBRARIES osgWidget osgQt)
|
SET(TARGET_ADDED_LIBRARIES osgWidget osgQt)
|
||||||
|
|
||||||
#### end var setup ###
|
#### end var setup ###
|
||||||
SET ( EXAMPLE_NAME osgQtBrowser )
|
SETUP_EXAMPLE(osgQtBrowser)
|
||||||
SETUP_EXAMPLE(${EXAMPLE_NAME})
|
|
||||||
|
|
||||||
IF ( Qt5Widgets_FOUND )
|
|
||||||
qt5_use_modules( example_${EXAMPLE_NAME} Widgets OpenGL WebKitWidgets )
|
|
||||||
ENDIF( Qt5Widgets_FOUND )
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -29,20 +29,14 @@
|
|||||||
#include <osgViewer/ViewerEventHandlers>
|
#include <osgViewer/ViewerEventHandlers>
|
||||||
#include <osgWidget/Browser>
|
#include <osgWidget/Browser>
|
||||||
|
|
||||||
#include <QtGlobal>
|
|
||||||
#if QT_VERSION >= 0x050000
|
|
||||||
# include <QtWebKitWidgets>
|
|
||||||
#else
|
|
||||||
# include <QtWebKit>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <QWebSettings>
|
#include <QtWebKit/QWebSettings>
|
||||||
|
#include <QtWebKit/QtWebKit>
|
||||||
#include <QGraphicsScene>
|
#include <QtGui/QGraphicsScene>
|
||||||
#include <QGraphicsView>
|
#include <QtGui/QGraphicsView>
|
||||||
#include <QApplication>
|
#include <QtGui/QApplication>
|
||||||
#include <QPainter>
|
#include <QtGui/QPainter>
|
||||||
#include <QtEvents>
|
#include <QtGui/QtEvents>
|
||||||
|
|
||||||
#include <osgQt/QGraphicsViewAdapter>
|
#include <osgQt/QGraphicsViewAdapter>
|
||||||
#include <osgQt/QWebViewImage>
|
#include <osgQt/QWebViewImage>
|
||||||
@@ -59,10 +53,10 @@ class ViewerFrameThread : public OpenThreads::Thread
|
|||||||
|
|
||||||
~ViewerFrameThread()
|
~ViewerFrameThread()
|
||||||
{
|
{
|
||||||
if (isRunning())
|
cancel();
|
||||||
|
while(isRunning())
|
||||||
{
|
{
|
||||||
cancel();
|
OpenThreads::Thread::YieldCurrentThread();
|
||||||
join();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,17 +7,10 @@ IF(CMAKE_COMPILER_IS_GNUCXX)
|
|||||||
STRING(REGEX REPLACE "-pedantic" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
STRING(REGEX REPLACE "-pedantic" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
if ( QT4_FOUND )
|
SET(TARGET_EXTERNAL_LIBRARIES ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTOPENGL_LIBRARY} ${QT_QTWEBKIT_LIBRARY})
|
||||||
SET(TARGET_EXTERNAL_LIBRARIES ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTOPENGL_LIBRARY} ${QT_QTWEBKIT_LIBRARY})
|
INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR})
|
||||||
INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR} ${QT_QTOPENGL_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR} ${QT_QTWEBKIT_INCLUDE_DIR} )
|
|
||||||
endif( QT4_FOUND )
|
|
||||||
|
|
||||||
SET(TARGET_ADDED_LIBRARIES osgWidget osgQt)
|
SET(TARGET_ADDED_LIBRARIES osgWidget osgQt)
|
||||||
|
|
||||||
#### end var setup ###
|
#### end var setup ###
|
||||||
SET ( EXAMPLE_NAME osgQtWidgets )
|
SETUP_EXAMPLE(osgQtWidgets)
|
||||||
SETUP_EXAMPLE(${EXAMPLE_NAME})
|
|
||||||
|
|
||||||
IF ( Qt5Widgets_FOUND )
|
|
||||||
qt5_use_modules( example_${EXAMPLE_NAME} OpenGL WebKitWidgets )
|
|
||||||
ENDIF( Qt5Widgets_FOUND )
|
|
||||||
|
|||||||
@@ -36,16 +36,17 @@
|
|||||||
#include <osgWidget/Browser>
|
#include <osgWidget/Browser>
|
||||||
|
|
||||||
|
|
||||||
//#include <QWebSettings>
|
//#include <QtWebKit/QWebSettings>
|
||||||
#include <QGraphicsScene>
|
//#include <QtWebKit/QtWebKit>
|
||||||
#include <QGraphicsView>
|
#include <QtGui/QGraphicsScene>
|
||||||
#include <QApplication>
|
#include <QtGui/QGraphicsView>
|
||||||
#include <QPainter>
|
#include <QtGui/QApplication>
|
||||||
#include <QtEvents>
|
#include <QtGui/QPainter>
|
||||||
#include <QDialog>
|
#include <QtGui/QtEvents>
|
||||||
#include <QVBoxLayout>
|
#include <QtGui/QDialog>
|
||||||
#include <QMainWindow>
|
#include <QtGui/QVBoxLayout>
|
||||||
#include <QtOpenGL>
|
#include <QtGui/QMainWindow>
|
||||||
|
#include <QtOpenGL/QtOpenGL>
|
||||||
|
|
||||||
#include <osgQt/QGraphicsViewAdapter>
|
#include <osgQt/QGraphicsViewAdapter>
|
||||||
#include <osgQt/QWebViewImage>
|
#include <osgQt/QWebViewImage>
|
||||||
@@ -97,11 +98,7 @@ protected:
|
|||||||
virtual void mousePressEvent(QMouseEvent* e)
|
virtual void mousePressEvent(QMouseEvent* e)
|
||||||
{
|
{
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
#if QT_VERSION >= 0x040500
|
|
||||||
int val = QInputDialog::getInt(this, "Get integer", "Please enter an integer between 0 and pi", 0, 0, 3, 1, &ok);
|
|
||||||
#else
|
|
||||||
int val = QInputDialog::getInteger(this, "Get integer", "Please enter an integer between 0 and pi", 0, 0, 3, 1, &ok);
|
int val = QInputDialog::getInteger(this, "Get integer", "Please enter an integer between 0 and pi", 0, 0, 3, 1, &ok);
|
||||||
#endif
|
|
||||||
std::cout << "Ok was " << (ok ? "" : "not") << " pressed, val is " << val << std::endl;
|
std::cout << "Ok was " << (ok ? "" : "not") << " pressed, val is " << val << std::endl;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -193,7 +190,7 @@ int main(int argc, char **argv)
|
|||||||
osg::ref_ptr<osgQt::QWebViewImage> image = new osgQt::QWebViewImage;
|
osg::ref_ptr<osgQt::QWebViewImage> image = new osgQt::QWebViewImage;
|
||||||
|
|
||||||
if (arguments.argc()>1) image->navigateTo((arguments[1]));
|
if (arguments.argc()>1) image->navigateTo((arguments[1]));
|
||||||
else image->navigateTo("http://www.openscenegraph.org/");
|
else image->navigateTo("http://www.youtube.com/");
|
||||||
|
|
||||||
osgWidget::GeometryHints hints(osg::Vec3(0.0f,0.0f,0.0f),
|
osgWidget::GeometryHints hints(osg::Vec3(0.0f,0.0f,0.0f),
|
||||||
osg::Vec3(1.0f,0.0f,0.0f),
|
osg::Vec3(1.0f,0.0f,0.0f),
|
||||||
@@ -218,7 +215,7 @@ int main(int argc, char **argv)
|
|||||||
webView->setPage(webPage);
|
webView->setPage(webPage);
|
||||||
|
|
||||||
if (arguments.argc()>1) webView->load(QUrl(arguments[1]));
|
if (arguments.argc()>1) webView->load(QUrl(arguments[1]));
|
||||||
else webView->load(QUrl("http://www.openscenegraph.org/"));
|
else webView->load(QUrl("http://www.youtube.com/"));
|
||||||
|
|
||||||
QGraphicsScene* graphicsScene = new QGraphicsScene;
|
QGraphicsScene* graphicsScene = new QGraphicsScene;
|
||||||
graphicsScene->addWidget(webView);
|
graphicsScene->addWidget(webView);
|
||||||
@@ -248,8 +245,6 @@ int main(int argc, char **argv)
|
|||||||
// dialog works too. All these cases use QGraphicsViewAdapter
|
// dialog works too. All these cases use QGraphicsViewAdapter
|
||||||
// under the hood, so why do some work and others don't?
|
// under the hood, so why do some work and others don't?
|
||||||
//
|
//
|
||||||
// <<< FIXED, need TextEditorInteraction >>>
|
|
||||||
//
|
|
||||||
// a) osgQtBrowser --useWidgetImage [--fullscreen] (optional)
|
// a) osgQtBrowser --useWidgetImage [--fullscreen] (optional)
|
||||||
// b) Try to click in the QTextEdit and type, or to select text
|
// b) Try to click in the QTextEdit and type, or to select text
|
||||||
// and drag-and-drop it somewhere else in the QTextEdit. These
|
// and drag-and-drop it somewhere else in the QTextEdit. These
|
||||||
@@ -285,8 +280,6 @@ int main(int argc, char **argv)
|
|||||||
// QAbstractScrollArea and it should display scrollbars as soon as
|
// QAbstractScrollArea and it should display scrollbars as soon as
|
||||||
// the scene is too large to fit the view.
|
// the scene is too large to fit the view.
|
||||||
//
|
//
|
||||||
// <<< FIXED >>>
|
|
||||||
//
|
|
||||||
// a) osgQtBrowser --useWidgetImage --fullscreen
|
// a) osgQtBrowser --useWidgetImage --fullscreen
|
||||||
// b) Resize the OSG window so it's smaller than the QTextEdit.
|
// b) Resize the OSG window so it's smaller than the QTextEdit.
|
||||||
// Scrollbars should appear but don't.
|
// Scrollbars should appear but don't.
|
||||||
@@ -350,7 +343,7 @@ int main(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
QTextEdit* textEdit = new QTextEdit(text);
|
QTextEdit* textEdit = new QTextEdit(text);
|
||||||
textEdit->setReadOnly(false);
|
textEdit->setReadOnly(false);
|
||||||
textEdit->setTextInteractionFlags(Qt::TextEditorInteraction);
|
textEdit->setTextInteractionFlags(Qt::TextEditable);
|
||||||
|
|
||||||
QPalette palette = textEdit->palette();
|
QPalette palette = textEdit->palette();
|
||||||
palette.setColor(QPalette::Highlight, Qt::darkBlue);
|
palette.setColor(QPalette::Highlight, Qt::darkBlue);
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
|
|
||||||
SET(TARGET_SRC osgSSBO.cpp )
|
|
||||||
|
|
||||||
SETUP_EXAMPLE(osgSSBO)
|
|
||||||
@@ -1,949 +0,0 @@
|
|||||||
//info : osgSSBO example,testing ShaderStorageBufferObjects ,Markus Hein, 2014, osg-3.2.1
|
|
||||||
//required hardware and driver must support GL >= GL 4.3 or GL ES 3.1 (GL ES not tested, would be nice if someone will test it on a small device)
|
|
||||||
|
|
||||||
//testing osg support for Shader Storage Buffer Objects
|
|
||||||
|
|
||||||
//version: "first take" from last night session..
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <osg/StateAttributeCallback>
|
|
||||||
#include <osg/Texture2D>
|
|
||||||
#include <osg/Geometry>
|
|
||||||
#include <osg/Geode>
|
|
||||||
#include <osgDB/ReadFile>
|
|
||||||
#include <osgGA/StateSetManipulator>
|
|
||||||
#include <osgViewer/Viewer>
|
|
||||||
#include <osgViewer/ViewerEventHandlers>
|
|
||||||
|
|
||||||
#include <osg/Node>
|
|
||||||
#include <osg/PositionAttitudeTransform>
|
|
||||||
#include <osg/Geometry>
|
|
||||||
#include <osg/Notify>
|
|
||||||
#include <osg/MatrixTransform>
|
|
||||||
#include <osg/Texture2D>
|
|
||||||
#include <osg/TextureRectangle>
|
|
||||||
#include <osg/Stencil>
|
|
||||||
#include <osg/Depth>
|
|
||||||
#include <osg/Billboard>
|
|
||||||
#include <osg/Material>
|
|
||||||
#include <osg/AnimationPath>
|
|
||||||
|
|
||||||
#include <osgGA/TrackballManipulator>
|
|
||||||
#include <osgGA/FlightManipulator>
|
|
||||||
#include <osgGA/DriveManipulator>
|
|
||||||
|
|
||||||
#include <osgUtil/SmoothingVisitor>
|
|
||||||
|
|
||||||
#include <osgDB/Registry>
|
|
||||||
#include <osgDB/ReadFile>
|
|
||||||
#include <osgDB/WriteFile>
|
|
||||||
|
|
||||||
#include <osgViewer/Viewer>
|
|
||||||
#include <osgViewer/ViewerEventHandlers>
|
|
||||||
#include <osgViewer/Renderer>
|
|
||||||
|
|
||||||
|
|
||||||
#include <osg/Array>
|
|
||||||
#include <osg/BoundingSphere>
|
|
||||||
#include <osg/BufferIndexBinding>
|
|
||||||
#include <osg/BufferObject>
|
|
||||||
#include <osg/Group>
|
|
||||||
#include <osg/Math>
|
|
||||||
#include <osg/MatrixTransform>
|
|
||||||
#include <osg/Program>
|
|
||||||
#include <osg/Shader>
|
|
||||||
#include <osg/Drawable>
|
|
||||||
#include <osg/CopyOp>
|
|
||||||
#include <osg/State>
|
|
||||||
#include <osg/Matrix>
|
|
||||||
#include <osg/ShapeDrawable>
|
|
||||||
#include <osg/GL>
|
|
||||||
#include <osg/StateSet>
|
|
||||||
#include <osg/Texture2D>
|
|
||||||
#include <osg/BlendFunc>
|
|
||||||
#include <osg/TexEnv>
|
|
||||||
#include <osg/Material>
|
|
||||||
#include <osg/PointSprite>
|
|
||||||
#include <osg/Program>
|
|
||||||
#include <osg/Notify>
|
|
||||||
#include <osg/Point>
|
|
||||||
#include <osg/io_utils>
|
|
||||||
#include <osg/VertexProgram>
|
|
||||||
|
|
||||||
#include <osgText/Font>
|
|
||||||
#include <osgText/Text>
|
|
||||||
|
|
||||||
|
|
||||||
#include <osgDB/ReadFile>
|
|
||||||
#include <osgDB/WriteFile>
|
|
||||||
#include <osgDB/FileNameUtils>
|
|
||||||
#include <osgUtil/Optimizer>
|
|
||||||
#include <iostream>
|
|
||||||
#include <typeinfo>
|
|
||||||
|
|
||||||
|
|
||||||
using namespace osg;
|
|
||||||
|
|
||||||
|
|
||||||
//todo .. #define COMPUTATION_IN_SEPARATE_THREAD
|
|
||||||
|
|
||||||
#define WORK_GROUP_SIZE 16
|
|
||||||
|
|
||||||
|
|
||||||
#define PRERENDER_ANTIALIASINGMULTISAMPLES 16
|
|
||||||
#define PRERENDER_HIGH_QUALITY_ANTIALIASING
|
|
||||||
#define PRERENDER_WIDTH 1920
|
|
||||||
#define PRERENDER_HEIGHT 1080
|
|
||||||
|
|
||||||
|
|
||||||
#define SUB_PLACEMENT_OFFSET_HORIZONTAL 0.5
|
|
||||||
#define SUB_PLACEMENT_OFFSET_VERTICAL 0.5
|
|
||||||
|
|
||||||
enum BufferOffset
|
|
||||||
{
|
|
||||||
POSITION_NOW_OFFSET,
|
|
||||||
POSITION_OLD_OFFSET,
|
|
||||||
POSITION_INIT_OFFSET,
|
|
||||||
|
|
||||||
VELOCITY_NOW_OFFSET,
|
|
||||||
VELOCITY_OLD_OFFSET,
|
|
||||||
VELOCITY_INIT_OFFSET,
|
|
||||||
|
|
||||||
ACCELERATION_OFFSET,
|
|
||||||
PROPERTIES_OFFSET,
|
|
||||||
|
|
||||||
OFFSET_END
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
const int __numDataValuesPerChannel = OFFSET_END;
|
|
||||||
const int __numChannels = 4;
|
|
||||||
|
|
||||||
//512x512x4x7 = 7.340.032 floats in SSBO on GPU
|
|
||||||
const int NUM_ELEMENTS_X = 512;
|
|
||||||
const int NUM_ELEMENTS_Y = 512;
|
|
||||||
|
|
||||||
float random(float min, float max) { return min + (max - min)*(float)rand() / (float)RAND_MAX; }
|
|
||||||
|
|
||||||
|
|
||||||
enum Channel
|
|
||||||
{
|
|
||||||
RED_CHANNEL,
|
|
||||||
GREEN_CHANNEL,
|
|
||||||
BLUE_CHANNEL,
|
|
||||||
ALPHA_CHANNEL,
|
|
||||||
RGB_CHANNEL,
|
|
||||||
RGBA_CHANNEL
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class ShaderStorageBufferCallback : public osg::StateAttributeCallback
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
void operator() (osg::StateAttribute* attr, osg::NodeVisitor* nv)
|
|
||||||
{
|
|
||||||
//if you need to process the data in your app-code , better leaving it on GPU and processing there, uploading per frame will make it slow
|
|
||||||
#if 0
|
|
||||||
osg::ShaderStorageBufferBinding* ssbb = static_cast<osg::ShaderStorageBufferBinding*>(attr);
|
|
||||||
osg::ShaderStorageBufferObject* ssbo
|
|
||||||
= static_cast<osg::ShaderStorageBufferObject*>(ssbb->getBufferObject());
|
|
||||||
|
|
||||||
osg::FloatArray* array = static_cast<osg::FloatArray*>(ssbo->getBufferData(0));
|
|
||||||
|
|
||||||
float someValue = array->at(0);
|
|
||||||
//std::cout << "someValue now: " << someValue << std::endl;
|
|
||||||
//data transfer performance test
|
|
||||||
// array->dirty();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
//do not forget to set OSG_FILE_PATH to default OSG-Data and make sure the new shaders are copied there under"shaders"
|
|
||||||
class ComputeNode : public osg::PositionAttitudeTransform
|
|
||||||
{
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
osg::ref_ptr<osg::Program> _computeProgram;
|
|
||||||
osg::ref_ptr<osg::Shader> _computeShader; //compute and write position data in SSBO
|
|
||||||
|
|
||||||
osg::ref_ptr<osg::Shader> _vertexShader; //reading position data from SSBO (OBS!: make sure glMemoryBuffer() is syncing this)
|
|
||||||
osg::ref_ptr<osg::Shader> _geometryShader; //building a quad looking to the camera
|
|
||||||
osg::ref_ptr<osg::Shader> _fragmentShader; //use false-colors etc. for making your data visible
|
|
||||||
|
|
||||||
osg::ref_ptr<osg::Node> _helperNode; // coordinate system node
|
|
||||||
|
|
||||||
ref_ptr<osg::ShaderStorageBufferObject> _ssbo;
|
|
||||||
ref_ptr<osg::ShaderStorageBufferBinding> _ssbb;
|
|
||||||
|
|
||||||
GLfloat* _data; // some data we upload to GPU, initialised with random values
|
|
||||||
osg::ref_ptr<FloatArray> _dataArray; //
|
|
||||||
|
|
||||||
osg::ref_ptr<osg::Group> _computationResultsRenderGroup;
|
|
||||||
osg::ref_ptr<osg::Program> _computationResultsRenderProgram;
|
|
||||||
osg::ref_ptr<osg::StateSet> _computationResultsRenderStateSet;
|
|
||||||
|
|
||||||
|
|
||||||
std::string _computeShaderSourcePath;
|
|
||||||
std::string _vertexShaderSourcePath;
|
|
||||||
std::string _geometryShaderSourcePath;
|
|
||||||
std::string _fragmentShaderSourcePath;
|
|
||||||
|
|
||||||
|
|
||||||
void addHelperGeometry();
|
|
||||||
void addDataMonitor(osg::Vec3 placement, osg::Vec3 relativePlacement, float scale, Channel channel, BufferOffset shaderBufferOffset, std::string labelcaption, float minDataRange, float maxDataRange);
|
|
||||||
void addComputationResultsRenderTree();
|
|
||||||
void initComputingSetup();
|
|
||||||
|
|
||||||
ComputeNode()
|
|
||||||
{
|
|
||||||
const char* envOsgFilePath = getenv("OSG_FILE_PATH");
|
|
||||||
std::stringstream computeshaderpath; computeshaderpath << envOsgFilePath << "/shaders/osgssboComputeShader.cs";
|
|
||||||
_computeShaderSourcePath = computeshaderpath.str();
|
|
||||||
std::stringstream vertexshaderpath; vertexshaderpath << envOsgFilePath << "/shaders/osgssboVertexShader.vs";
|
|
||||||
_vertexShaderSourcePath = vertexshaderpath.str();
|
|
||||||
std::stringstream geometryshaderpath; geometryshaderpath << envOsgFilePath << "/shaders/osgssboGeometryShader.gs";
|
|
||||||
_geometryShaderSourcePath = geometryshaderpath.str();
|
|
||||||
std::stringstream fragmentshaderpath; fragmentshaderpath << envOsgFilePath << "/shaders/osgssboFragmentShader.fs";
|
|
||||||
_fragmentShaderSourcePath = fragmentshaderpath.str();
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
class ComputeNodeUpdateCallback : public osg::NodeCallback
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
ComputeNode* _computeNode;
|
|
||||||
osg::Timer_t _prevShaderUpdateTime;
|
|
||||||
osg::Timer _timer;
|
|
||||||
|
|
||||||
ComputeNodeUpdateCallback(){}
|
|
||||||
|
|
||||||
ComputeNodeUpdateCallback(ComputeNode* computeNode)
|
|
||||||
{
|
|
||||||
_computeNode = computeNode;
|
|
||||||
_prevShaderUpdateTime = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)
|
|
||||||
{
|
|
||||||
osg::Timer_t currTime = _timer.tick();
|
|
||||||
|
|
||||||
if (_timer.delta_s(_prevShaderUpdateTime, currTime) > 1.0) //one second interval for shader-changed-do-reload check
|
|
||||||
{
|
|
||||||
osg::ref_ptr<osg::Shader> reloadedshader;
|
|
||||||
std::string runningSource;
|
|
||||||
std::string reloadedstring;
|
|
||||||
|
|
||||||
if (_computeNode->_computeShader.valid())
|
|
||||||
{
|
|
||||||
runningSource = _computeNode->_computeShader->getShaderSource();
|
|
||||||
reloadedshader = osg::Shader::readShaderFile(osg::Shader::COMPUTE, _computeNode->_computeShaderSourcePath);
|
|
||||||
|
|
||||||
reloadedstring = reloadedshader->getShaderSource();
|
|
||||||
if (!osgDB::equalCaseInsensitive(runningSource.c_str(), reloadedstring.c_str()))
|
|
||||||
{
|
|
||||||
_computeNode->_computeProgram->removeShader(_computeNode->_computeShader.get());
|
|
||||||
_computeNode->_computeShader = reloadedshader.get();
|
|
||||||
_computeNode->_computeProgram->addShader(_computeNode->_computeShader.get());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_computeNode->_vertexShader.valid())
|
|
||||||
{
|
|
||||||
|
|
||||||
runningSource = _computeNode->_vertexShader->getShaderSource();
|
|
||||||
reloadedshader = osg::Shader::readShaderFile(osg::Shader::VERTEX, _computeNode->_vertexShaderSourcePath);
|
|
||||||
|
|
||||||
reloadedstring = reloadedshader->getShaderSource();
|
|
||||||
if (!osgDB::equalCaseInsensitive(runningSource.c_str(), reloadedstring.c_str()))
|
|
||||||
{
|
|
||||||
_computeNode->_computationResultsRenderProgram->removeShader(_computeNode->_vertexShader.get());
|
|
||||||
_computeNode->_vertexShader = reloadedshader.get();
|
|
||||||
_computeNode->_computationResultsRenderProgram->addShader(_computeNode->_vertexShader.get());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (_computeNode->_geometryShader.valid())
|
|
||||||
{
|
|
||||||
runningSource = _computeNode->_geometryShader->getShaderSource();
|
|
||||||
reloadedshader = osg::Shader::readShaderFile(osg::Shader::GEOMETRY, _computeNode->_geometryShaderSourcePath);
|
|
||||||
|
|
||||||
reloadedstring = reloadedshader->getShaderSource();
|
|
||||||
if (!osgDB::equalCaseInsensitive(runningSource.c_str(), reloadedstring.c_str()))
|
|
||||||
{
|
|
||||||
_computeNode->_computationResultsRenderProgram->removeShader(_computeNode->_geometryShader.get());
|
|
||||||
_computeNode->_geometryShader = reloadedshader.get();
|
|
||||||
_computeNode->_computationResultsRenderProgram->addShader(_computeNode->_geometryShader.get());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_computeNode->_fragmentShader.valid())
|
|
||||||
{
|
|
||||||
runningSource = _computeNode->_fragmentShader->getShaderSource();
|
|
||||||
reloadedshader = osg::Shader::readShaderFile(osg::Shader::FRAGMENT, _computeNode->_fragmentShaderSourcePath);
|
|
||||||
|
|
||||||
reloadedstring = reloadedshader->getShaderSource();
|
|
||||||
if (!osgDB::equalCaseInsensitive(runningSource.c_str(), reloadedstring.c_str()))
|
|
||||||
{
|
|
||||||
_computeNode->_computationResultsRenderProgram->removeShader(_computeNode->_fragmentShader.get());
|
|
||||||
_computeNode->_fragmentShader = reloadedshader.get();
|
|
||||||
_computeNode->_computationResultsRenderProgram->addShader(_computeNode->_fragmentShader.get());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
_prevShaderUpdateTime = _timer.tick();
|
|
||||||
}
|
|
||||||
|
|
||||||
traverse(node, nv);
|
|
||||||
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
//set OSG_FILE_PATH for loading axes.osgt
|
|
||||||
void ComputeNode::addHelperGeometry()
|
|
||||||
{
|
|
||||||
_helperNode = osgDB::readNodeFile("axes.osgt");
|
|
||||||
|
|
||||||
if (_helperNode.valid())
|
|
||||||
{
|
|
||||||
addChild(_helperNode.get());
|
|
||||||
}
|
|
||||||
|
|
||||||
//osg::PositionAttitudeTransform* pat = new osg::PositionAttitudeTransform;
|
|
||||||
//pat->setPosition(osg::Vec3(0.5, 0, 0.5));
|
|
||||||
//osg::Geode *sphereGeode = new osg::Geode;
|
|
||||||
//float radius = 0.5f;
|
|
||||||
//osg::TessellationHints* hints = new osg::TessellationHints;
|
|
||||||
//hints->setDetailRatio(0.9f);
|
|
||||||
//osg::ShapeDrawable* sphere = new osg::ShapeDrawable(new osg::Sphere(osg::Vec3(0.0f, 0.0f, 0.0f), radius), hints);
|
|
||||||
//sphereGeode->addDrawable(sphere);
|
|
||||||
//sphere->setColor(osg::Vec4(0, 1, 0, 0.1));
|
|
||||||
//osg::StateSet* stateset = sphereGeode->getOrCreateStateSet();
|
|
||||||
//osg::BlendFunc *blend = new osg::BlendFunc;
|
|
||||||
//blend->setFunction(osg::BlendFunc::SRC_ALPHA, osg::BlendFunc::ONE_MINUS_SRC_ALPHA);
|
|
||||||
//stateset->setAttributeAndModes(blend, osg::StateAttribute::ON);
|
|
||||||
//pat->addChild(sphereGeode);
|
|
||||||
//addChild(pat);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void ComputeNode::addDataMonitor(osg::Vec3 placement, osg::Vec3 relativePlacement, float scale, Channel colorchannel, BufferOffset shaderStorageBufferOffset, std::string labelCaption, float minDataRange, float maxDataRange)
|
|
||||||
{
|
|
||||||
osg::PositionAttitudeTransform* pat = new osg::PositionAttitudeTransform;
|
|
||||||
pat->setPosition(relativePlacement);
|
|
||||||
addChild(pat);
|
|
||||||
osg::Geometry* geom;
|
|
||||||
|
|
||||||
if (NUM_ELEMENTS_X >= NUM_ELEMENTS_Y)
|
|
||||||
{
|
|
||||||
float ratio = (float)((float)NUM_ELEMENTS_Y / (float)NUM_ELEMENTS_X);
|
|
||||||
geom = osg::createTexturedQuadGeometry(placement, osg::Vec3(1.0f*scale, 0.0f, 0.0f), osg::Vec3(0.0f, 0.0f, ratio*1.0f*scale));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
float ratio = (float)((float)NUM_ELEMENTS_X / (float)NUM_ELEMENTS_Y);
|
|
||||||
geom = osg::createTexturedQuadGeometry(placement, osg::Vec3(ratio*1.0f*scale, 0.0f, 0.0f), osg::Vec3(0.0f, 0.0f, 1.0f*scale));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
geom->setVertexAttribArray(1, geom->getTexCoordArray(0), osg::Array::BIND_PER_VERTEX);
|
|
||||||
|
|
||||||
osg::ref_ptr<osg::Geode> quad = new osg::Geode;
|
|
||||||
quad->addDrawable(geom);
|
|
||||||
quad->setStateSet(getOrCreateStateSet());
|
|
||||||
pat->addChild(quad.get());
|
|
||||||
|
|
||||||
static const char* vertexShaderSrcChannelMonitor = {
|
|
||||||
|
|
||||||
"#version 430 \n"
|
|
||||||
|
|
||||||
"uniform int numRows;\n"
|
|
||||||
"uniform int numCols;\n"
|
|
||||||
"uniform float osg_FrameTime;\n"
|
|
||||||
"uniform mat4 osg_ProjectionMatrix;\n"
|
|
||||||
"uniform mat4 osg_ModelViewMatrix;\n"
|
|
||||||
"out vec2 texCoordFromVertexShader;\n"
|
|
||||||
"struct particle{ float x; float y; float z; float w;};"
|
|
||||||
"layout (location = 0) in vec3 vertexpos;\n"
|
|
||||||
"attribute vec2 tex_coords;\n"
|
|
||||||
"void main() {\n"
|
|
||||||
"texCoordFromVertexShader.xy = tex_coords.xy; gl_Position = ( osg_ProjectionMatrix * osg_ModelViewMatrix * vec4(vertexpos.x,vertexpos.y,vertexpos.z,1) ); \n"
|
|
||||||
"}\n"
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
std::stringstream fragmentshaderstringstreamChannelMonitor;
|
|
||||||
fragmentshaderstringstreamChannelMonitor << "#version 430\n";
|
|
||||||
fragmentshaderstringstreamChannelMonitor << "uniform int numRows;\n";
|
|
||||||
fragmentshaderstringstreamChannelMonitor << "uniform int numCols;\n";
|
|
||||||
fragmentshaderstringstreamChannelMonitor << "uniform float dataRangeMin;\n";
|
|
||||||
fragmentshaderstringstreamChannelMonitor << "uniform float dataRangeMax;\n";
|
|
||||||
fragmentshaderstringstreamChannelMonitor << "in vec2 texCoordFromVertexShader;\n";
|
|
||||||
fragmentshaderstringstreamChannelMonitor << "struct particle{ float x; float y; float z; float w;};";
|
|
||||||
fragmentshaderstringstreamChannelMonitor << "layout(std140, binding=0) coherent buffer particles{particle p[];}; ";
|
|
||||||
fragmentshaderstringstreamChannelMonitor << "\n";
|
|
||||||
fragmentshaderstringstreamChannelMonitor << "void main(void)\n";
|
|
||||||
fragmentshaderstringstreamChannelMonitor << "{\n";
|
|
||||||
fragmentshaderstringstreamChannelMonitor << "ivec2 storePos = ivec2(numRows*texCoordFromVertexShader.x, numCols*texCoordFromVertexShader.y); particle particleData = p[" << shaderStorageBufferOffset * NUM_ELEMENTS_X*NUM_ELEMENTS_Y << " + (storePos.x*numRows + storePos.y)]; ";
|
|
||||||
|
|
||||||
//fragmentshaderstringstreamChannelMonitor << " memoryBarrierBuffer(); \n";
|
|
||||||
fragmentshaderstringstreamChannelMonitor << " float dataRangeMultiplier = 1.0 / abs(dataRangeMax - dataRangeMin); \n";
|
|
||||||
|
|
||||||
switch (colorchannel)
|
|
||||||
{
|
|
||||||
case RED_CHANNEL:
|
|
||||||
{
|
|
||||||
fragmentshaderstringstreamChannelMonitor << " vec4 color; color.x = 0.5+dataRangeMultiplier*particleData.x; color.y =0.0; color.z = 0.0; color.w = 1.0; gl_FragColor = color;\n";
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case GREEN_CHANNEL:
|
|
||||||
{
|
|
||||||
fragmentshaderstringstreamChannelMonitor << " vec4 color; color.x = 0.0; color.y = 0.5+dataRangeMultiplier*particleData.y; color.z = 0.0; color.w = 1.0; gl_FragColor = color;\n";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case BLUE_CHANNEL:
|
|
||||||
{
|
|
||||||
fragmentshaderstringstreamChannelMonitor << " vec4 color; color.x = 0.0; color.y = 0.0; color.z = 0.5+dataRangeMultiplier*particleData.z; color.w = 0.0 ; gl_FragColor = color;\n";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case ALPHA_CHANNEL:
|
|
||||||
{
|
|
||||||
fragmentshaderstringstreamChannelMonitor << " vec4 color; color.x = 0.5+dataRangeMultiplier*particleData.w; color.y = 0.5+dataRangeMultiplier*particleData.w; color.z = 0.5+dataRangeMultiplier*particleData.w; color.w = 0.5+0.5*particleData.w; gl_FragColor = color;\n";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case RGB_CHANNEL:
|
|
||||||
{
|
|
||||||
fragmentshaderstringstreamChannelMonitor << " vec4 color; color.x = 0.5+dataRangeMultiplier*particleData.x; color.y = 0.5+dataRangeMultiplier*particleData.y; color.z = 0.5+dataRangeMultiplier*particleData.z; color.w = 1.0; gl_FragColor = color;\n";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case RGBA_CHANNEL:
|
|
||||||
{
|
|
||||||
fragmentshaderstringstreamChannelMonitor << " vec4 color; color.x = 0.5+dataRangeMultiplier*particleData.x; color.y = 0.5+dataRangeMultiplier*particleData.y; color.z = 0.5+dataRangeMultiplier*particleData.z; color.w = 0.5+0.5*particleData.w; gl_FragColor = color;\n";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
fragmentshaderstringstreamChannelMonitor << "}\n";
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
osg::Program * program = new osg::Program;
|
|
||||||
program->addShader(new osg::Shader(osg::Shader::VERTEX, vertexShaderSrcChannelMonitor));
|
|
||||||
program->addShader(new osg::Shader(osg::Shader::FRAGMENT, fragmentshaderstringstreamChannelMonitor.str().c_str()));
|
|
||||||
program->addBindAttribLocation("tex_coords", 1);
|
|
||||||
|
|
||||||
osg::StateSet* ss = geom->getOrCreateStateSet();
|
|
||||||
ss->setAttributeAndModes(program, osg::StateAttribute::ON);
|
|
||||||
ss->addUniform(new osg::Uniform("numRows", (int)NUM_ELEMENTS_X));
|
|
||||||
ss->addUniform(new osg::Uniform("numCols", (int)NUM_ELEMENTS_Y));
|
|
||||||
|
|
||||||
ss->addUniform(new osg::Uniform("dataRangeMin", (float)minDataRange));
|
|
||||||
ss->addUniform(new osg::Uniform("dataRangeMax", (float)maxDataRange));
|
|
||||||
|
|
||||||
|
|
||||||
ss->setMode(GL_LIGHTING, osg::StateAttribute::OFF);
|
|
||||||
|
|
||||||
//add a label
|
|
||||||
osgText::Text* text = new osgText::Text;
|
|
||||||
osgText::Font* font = osgText::readFontFile("fonts/arial.ttf");
|
|
||||||
text->setFont(font);
|
|
||||||
text->setColor(osg::Vec4(1, 1, 1, 1));
|
|
||||||
text->setCharacterSize(0.1*scale);
|
|
||||||
text->setPosition(placement + osg::Vec3(0.05, 0.05, 0));
|
|
||||||
pat->setName(labelCaption);
|
|
||||||
text->setText(pat->getName());
|
|
||||||
text->setBackdropType(osgText::Text::OUTLINE);
|
|
||||||
text->setBackdropImplementation(osgText::Text::POLYGON_OFFSET);
|
|
||||||
text->setBackdropOffset(0.05f);
|
|
||||||
text->setBackdropColor(osg::Vec4(0.0f, 0.0f, 0.0f, 1.0f));
|
|
||||||
|
|
||||||
quad->addDrawable(text);
|
|
||||||
|
|
||||||
pat->addChild(quad.get());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//compute texture image , taken from osgspotlight
|
|
||||||
osg::Image* createSpotLightImage(const osg::Vec4& centerColour, const osg::Vec4& backgroudColour, unsigned int size, float power)
|
|
||||||
{
|
|
||||||
osg::Image* image = new osg::Image;
|
|
||||||
image->allocateImage(size, size, 1,
|
|
||||||
GL_RGBA, GL_UNSIGNED_BYTE);
|
|
||||||
|
|
||||||
|
|
||||||
float mid = (float(size) - 1)*0.5f;
|
|
||||||
float div = 2.0f / float(size);
|
|
||||||
for (unsigned int r = 0; r < size; ++r)
|
|
||||||
{
|
|
||||||
unsigned char* ptr = image->data(0, r, 0);
|
|
||||||
for (unsigned int c = 0; c < size; ++c)
|
|
||||||
{
|
|
||||||
float dx = (float(c) - mid)*div;
|
|
||||||
float dy = (float(r) - mid)*div;
|
|
||||||
float r = powf(1.0f - sqrtf(dx*dx + dy*dy), power);
|
|
||||||
if (r < 0.0f) r = 0.0f;
|
|
||||||
osg::Vec4 color = centerColour*r + backgroudColour*(1.0f - r);
|
|
||||||
*ptr++ = (unsigned char)((color[0])*255.0f);
|
|
||||||
*ptr++ = (unsigned char)((color[1])*255.0f);
|
|
||||||
*ptr++ = (unsigned char)((color[2])*255.0f);
|
|
||||||
*ptr++ = (unsigned char)((color[3])*255.0f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return image;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void ComputeNode::addComputationResultsRenderTree()
|
|
||||||
{
|
|
||||||
|
|
||||||
_computationResultsRenderProgram = new osg::Program;
|
|
||||||
|
|
||||||
_vertexShader = osg::Shader::readShaderFile(osg::Shader::VERTEX, _vertexShaderSourcePath);
|
|
||||||
_computationResultsRenderProgram->addShader(_vertexShader.get());
|
|
||||||
|
|
||||||
_geometryShader = osg::Shader::readShaderFile(osg::Shader::GEOMETRY, _geometryShaderSourcePath);
|
|
||||||
_computationResultsRenderProgram->addShader(_geometryShader.get());
|
|
||||||
|
|
||||||
_fragmentShader = osg::Shader::readShaderFile(osg::Shader::FRAGMENT, _fragmentShaderSourcePath);
|
|
||||||
_computationResultsRenderProgram->addShader(_fragmentShader.get());
|
|
||||||
|
|
||||||
|
|
||||||
_computationResultsRenderProgram->addBindAttribLocation("tex_coords", 1);
|
|
||||||
|
|
||||||
_computationResultsRenderGroup = new osg::Group;
|
|
||||||
_computationResultsRenderGroup->setDataVariance(osg::Object::DYNAMIC);
|
|
||||||
_computationResultsRenderStateSet = _computationResultsRenderGroup->getOrCreateStateSet();
|
|
||||||
_computationResultsRenderStateSet->setRenderingHint(osg::StateSet::TRANSPARENT_BIN);
|
|
||||||
|
|
||||||
osg::PointSprite *sprite = new osg::PointSprite;
|
|
||||||
int texture_unit = 0;
|
|
||||||
_computationResultsRenderStateSet->setTextureAttributeAndModes(texture_unit, sprite, osg::StateAttribute::ON);
|
|
||||||
_computationResultsRenderStateSet->setAttributeAndModes(_computationResultsRenderProgram.get(), osg::StateAttribute::ON);
|
|
||||||
_computationResultsRenderStateSet->addUniform(new osg::Uniform("particleTexture", texture_unit));
|
|
||||||
_computationResultsRenderStateSet->addUniform(new osg::Uniform("numRows", (int)NUM_ELEMENTS_X));
|
|
||||||
_computationResultsRenderStateSet->addUniform(new osg::Uniform("numCols", (int)NUM_ELEMENTS_Y));
|
|
||||||
|
|
||||||
|
|
||||||
_computationResultsRenderStateSet->setMode(GL_POINT_SMOOTH, osg::StateAttribute::ON);
|
|
||||||
_computationResultsRenderStateSet->setMode(GL_VERTEX_PROGRAM_POINT_SIZE_ARB, osg::StateAttribute::ON);
|
|
||||||
_computationResultsRenderStateSet->setMode(GL_ALPHA_TEST, osg::StateAttribute::ON);
|
|
||||||
_computationResultsRenderStateSet->setMode(GL_LIGHTING, osg::StateAttribute::OFF);
|
|
||||||
|
|
||||||
osg::Texture2D *tex = new osg::Texture2D();
|
|
||||||
|
|
||||||
osg::Image* particleImage = createSpotLightImage(osg::Vec4(1, 0, 0, 1), osg::Vec4(0.5, 0, 0, 0.0), 32, 0.7);
|
|
||||||
if (particleImage)
|
|
||||||
{
|
|
||||||
tex->setImage(particleImage);
|
|
||||||
}
|
|
||||||
_computationResultsRenderStateSet->setTextureAttributeAndModes(texture_unit, tex, osg::StateAttribute::ON);
|
|
||||||
|
|
||||||
|
|
||||||
osg::BlendFunc *blend = new osg::BlendFunc;
|
|
||||||
if (false) //emissive particles
|
|
||||||
{
|
|
||||||
blend->setFunction(osg::BlendFunc::SRC_ALPHA, osg::BlendFunc::ONE);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
blend->setFunction(osg::BlendFunc::SRC_ALPHA, osg::BlendFunc::ONE_MINUS_SRC_ALPHA);
|
|
||||||
}
|
|
||||||
|
|
||||||
_computationResultsRenderStateSet->setAttributeAndModes(blend, osg::StateAttribute::ON);
|
|
||||||
|
|
||||||
|
|
||||||
osg::Depth* depth = new osg::Depth;
|
|
||||||
depth->setRange(0.0f, 0.0f);
|
|
||||||
depth->setFunction(osg::Depth::ALWAYS);
|
|
||||||
depth->setWriteMask(false);
|
|
||||||
depth->setFunction(osg::Depth::ALWAYS);
|
|
||||||
|
|
||||||
_computationResultsRenderStateSet->setAttributeAndModes(depth, osg::StateAttribute::OFF);
|
|
||||||
|
|
||||||
|
|
||||||
osg::Geode* particleGeode = new osg::Geode;
|
|
||||||
unsigned int numVertices = NUM_ELEMENTS_X*NUM_ELEMENTS_Y;
|
|
||||||
|
|
||||||
osg::Geometry* particleGeometry = new osg::Geometry;
|
|
||||||
particleGeometry->setUseDisplayList(false);
|
|
||||||
particleGeometry->setUseVertexBufferObjects(true);
|
|
||||||
|
|
||||||
osg::Vec3Array* vertexarray = new osg::Vec3Array;
|
|
||||||
osg::Vec2Array* tcoords = new osg::Vec2Array;
|
|
||||||
|
|
||||||
osg::Vec2 bottom_texcoord(0.0f, 0.0f);
|
|
||||||
|
|
||||||
osg::Vec2 dx_texcoord(1.0f / (float)(NUM_ELEMENTS_X), 0.0f);
|
|
||||||
osg::Vec2 dy_texcoord(0.0f, 1.0f / (float)(NUM_ELEMENTS_Y));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for (int i = 0; i < NUM_ELEMENTS_X; i++)
|
|
||||||
{
|
|
||||||
osg::Vec2 texcoord = bottom_texcoord + dy_texcoord*(float)i;
|
|
||||||
|
|
||||||
for (int j = 0; j < NUM_ELEMENTS_Y; j++)
|
|
||||||
{
|
|
||||||
vertexarray->push_back(osg::Vec3(texcoord.x(), texcoord.y(), 0.0));
|
|
||||||
tcoords->push_back(osg::Vec2(texcoord.x(), texcoord.y()));
|
|
||||||
texcoord += dx_texcoord;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
particleGeometry->setVertexArray(vertexarray);
|
|
||||||
particleGeometry->addPrimitiveSet(new osg::DrawArrays(GL_POINTS, 0, numVertices));
|
|
||||||
particleGeometry->setTexCoordArray(0, tcoords);
|
|
||||||
//this glMemoryBarrier thing... not sure if we could better do instanced drawing? all the data is in Shader Storage Buffer..
|
|
||||||
particleGeometry->setVertexAttribArray(1, particleGeometry->getTexCoordArray(0), osg::Array::BIND_PER_VERTEX);
|
|
||||||
|
|
||||||
_computationResultsRenderGroup->addChild(particleGeode);
|
|
||||||
particleGeode->addDrawable(particleGeometry);
|
|
||||||
|
|
||||||
addChild(_computationResultsRenderGroup.get());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void ComputeNode::initComputingSetup()
|
|
||||||
{
|
|
||||||
|
|
||||||
_computeProgram = new osg::Program;
|
|
||||||
_computeProgram->setComputeGroups((NUM_ELEMENTS_X / WORK_GROUP_SIZE) <= 1 ? 1 : (NUM_ELEMENTS_X / WORK_GROUP_SIZE), (NUM_ELEMENTS_Y / WORK_GROUP_SIZE) <= 1 ? 1 : (NUM_ELEMENTS_Y / WORK_GROUP_SIZE), 1);
|
|
||||||
_computeShader = osg::Shader::readShaderFile(osg::Shader::COMPUTE, _computeShaderSourcePath);
|
|
||||||
_computeProgram->addShader(_computeShader.get());
|
|
||||||
|
|
||||||
setDataVariance(osg::Object::DYNAMIC);
|
|
||||||
osg::StateSet* statesetComputation = getOrCreateStateSet();
|
|
||||||
statesetComputation->setAttributeAndModes(_computeProgram.get());
|
|
||||||
statesetComputation->addUniform(new osg::Uniform("numCols", (int)NUM_ELEMENTS_X));
|
|
||||||
statesetComputation->addUniform(new osg::Uniform("numRows", (int)NUM_ELEMENTS_Y));
|
|
||||||
statesetComputation->setMode(GL_LIGHTING, osg::StateAttribute::OFF);
|
|
||||||
|
|
||||||
//blocksize
|
|
||||||
int numParticles = NUM_ELEMENTS_X * NUM_ELEMENTS_Y;
|
|
||||||
const unsigned blockSize = numParticles * __numChannels * __numDataValuesPerChannel* sizeof(GLfloat);
|
|
||||||
|
|
||||||
//init all the particle data array
|
|
||||||
int idx = 0;
|
|
||||||
_data = new GLfloat[NUM_ELEMENTS_X * NUM_ELEMENTS_Y * __numChannels * __numDataValuesPerChannel];
|
|
||||||
_dataArray = new FloatArray;
|
|
||||||
|
|
||||||
//init the data array somehow, this way all is stored in one BufferObject. maybe better using multiple buffers instead? not sure what is faster and better for threading
|
|
||||||
for (int d = 0; d < __numDataValuesPerChannel; ++d)
|
|
||||||
{
|
|
||||||
for (int i = 0; i < NUM_ELEMENTS_X; ++i)
|
|
||||||
{
|
|
||||||
|
|
||||||
for (int j = 0; j < NUM_ELEMENTS_Y; ++j)
|
|
||||||
{
|
|
||||||
|
|
||||||
for (int k = 0; k < __numChannels; ++k)
|
|
||||||
{
|
|
||||||
switch (k)
|
|
||||||
{
|
|
||||||
|
|
||||||
case (RED_CHANNEL) :
|
|
||||||
{
|
|
||||||
if ((d == POSITION_NOW_OFFSET) || (d == POSITION_OLD_OFFSET) || (d == POSITION_INIT_OFFSET))//position
|
|
||||||
{
|
|
||||||
*_data = random(0.25, 0.75);
|
|
||||||
}
|
|
||||||
if ((d == VELOCITY_NOW_OFFSET) || (d == VELOCITY_OLD_OFFSET) || (d == VELOCITY_INIT_OFFSET))//velocity
|
|
||||||
{
|
|
||||||
*_data = random(-2.4, 2.4);
|
|
||||||
}
|
|
||||||
if (d == ACCELERATION_OFFSET) //acceleration
|
|
||||||
{
|
|
||||||
*_data = random(-3.0, 3.0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (d == PROPERTIES_OFFSET) //property particle mass (compute shader is computing sphere mass from radius instead)
|
|
||||||
{
|
|
||||||
*_data = random(0.2, 15.0);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case (GREEN_CHANNEL) :
|
|
||||||
{
|
|
||||||
if ((d == POSITION_NOW_OFFSET) || (d == POSITION_OLD_OFFSET) || (d == POSITION_INIT_OFFSET))//position
|
|
||||||
{
|
|
||||||
*_data = random(0.25, 0.75);
|
|
||||||
}
|
|
||||||
if ((d == VELOCITY_NOW_OFFSET) || (d == VELOCITY_OLD_OFFSET) || (d == VELOCITY_INIT_OFFSET))//velocity
|
|
||||||
{
|
|
||||||
*_data = random(-2.4, 2.4);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (d == ACCELERATION_OFFSET)//acceleration
|
|
||||||
{
|
|
||||||
*_data = random(-3.0, 3.0);
|
|
||||||
}
|
|
||||||
if (d == PROPERTIES_OFFSET) //property particle radius
|
|
||||||
{
|
|
||||||
*_data = random(0.07, 0.219);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case (BLUE_CHANNEL) :
|
|
||||||
{
|
|
||||||
if ((d == POSITION_NOW_OFFSET) || (d == POSITION_OLD_OFFSET) || (d == POSITION_INIT_OFFSET))//position
|
|
||||||
{
|
|
||||||
*_data = random(0.25, 0.75);
|
|
||||||
}
|
|
||||||
if ((d == VELOCITY_NOW_OFFSET) || (d == VELOCITY_OLD_OFFSET) || (d == VELOCITY_INIT_OFFSET))//velocity
|
|
||||||
{
|
|
||||||
*_data = random(-2.4, 2.4);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (d == ACCELERATION_OFFSET)//acceleration
|
|
||||||
{
|
|
||||||
*_data = random(-3.0, 3.0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (d == PROPERTIES_OFFSET) //place for some other property
|
|
||||||
{
|
|
||||||
*_data = random(0.0, 0.0);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case (ALPHA_CHANNEL) :
|
|
||||||
{
|
|
||||||
if ((d == POSITION_NOW_OFFSET) || (d == POSITION_OLD_OFFSET) || (d == POSITION_INIT_OFFSET))//position
|
|
||||||
{
|
|
||||||
*_data = random(1.0, 1.0);
|
|
||||||
}
|
|
||||||
if ((d == VELOCITY_NOW_OFFSET) || (d == VELOCITY_OLD_OFFSET) || (d == VELOCITY_INIT_OFFSET))//velocity
|
|
||||||
{
|
|
||||||
*_data = random(-2.4, 2.4);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (d == ACCELERATION_OFFSET) //acceleration
|
|
||||||
{
|
|
||||||
//*_data = random(1.0, 1.0);
|
|
||||||
*_data = random(0.0, 0.0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (d == PROPERTIES_OFFSET) //place for some other property
|
|
||||||
{
|
|
||||||
*_data = random(0.3, 0.3);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
_dataArray->push_back(*_data);
|
|
||||||
_data++;
|
|
||||||
idx++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
_ssbo = new osg::ShaderStorageBufferObject;
|
|
||||||
_dataArray->setBufferObject(_ssbo.get());
|
|
||||||
|
|
||||||
|
|
||||||
_ssbb = new osg::ShaderStorageBufferBinding(0, _ssbo.get(), 0, blockSize);
|
|
||||||
statesetComputation->setAttributeAndModes(_ssbb.get(), osg::StateAttribute::ON);
|
|
||||||
|
|
||||||
|
|
||||||
//option, do something useful with data or test the transfer speed
|
|
||||||
//_ssbb->setUpdateCallback(new ShaderStorageBufferCallback);
|
|
||||||
|
|
||||||
//adding a quad , visualizing data in buffer
|
|
||||||
addDataMonitor(osg::Vec3(0, -1, 0), osg::Vec3(SUB_PLACEMENT_OFFSET_HORIZONTAL * 0, -SUB_PLACEMENT_OFFSET_VERTICAL * -2.0, SUB_PLACEMENT_OFFSET_HORIZONTAL * 0), 1.0, RGB_CHANNEL, POSITION_NOW_OFFSET, "X,Y,Z - PositionNow", -1.0, 1.0);
|
|
||||||
|
|
||||||
//the coord from default dataset
|
|
||||||
addHelperGeometry();
|
|
||||||
|
|
||||||
|
|
||||||
addComputationResultsRenderTree();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//taken from osgdistorsion example for getting it nice on screen with antialiasing
|
|
||||||
osg::Node* createPrerenderSubgraph(osg::Node* subgraph, const osg::Vec4& clearColour)
|
|
||||||
{
|
|
||||||
osg::Group* prerenderNode = new osg::Group;
|
|
||||||
|
|
||||||
unsigned int tex_width = PRERENDER_WIDTH;
|
|
||||||
unsigned int tex_height = PRERENDER_HEIGHT;
|
|
||||||
|
|
||||||
osg::Texture2D* texture = new osg::Texture2D;
|
|
||||||
texture->setTextureSize(tex_width, tex_height);
|
|
||||||
texture->setInternalFormat(GL_RGBA);
|
|
||||||
texture->setFilter(osg::Texture2D::MIN_FILTER, osg::Texture2D::LINEAR);
|
|
||||||
texture->setFilter(osg::Texture2D::MAG_FILTER, osg::Texture2D::LINEAR);
|
|
||||||
|
|
||||||
{
|
|
||||||
osg::Camera* prerenderCamera = new osg::Camera;
|
|
||||||
prerenderCamera->setClearColor(clearColour);
|
|
||||||
prerenderCamera->setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
|
||||||
prerenderCamera->setReferenceFrame(osg::Transform::RELATIVE_RF);
|
|
||||||
prerenderCamera->setProjectionMatrix(osg::Matrixd::identity());
|
|
||||||
prerenderCamera->setViewMatrix(osg::Matrixd::identity());
|
|
||||||
prerenderCamera->setViewport(0, 0, tex_width, tex_height);
|
|
||||||
prerenderCamera->setRenderOrder(osg::Camera::PRE_RENDER);
|
|
||||||
prerenderCamera->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);
|
|
||||||
prerenderCamera->attach(osg::Camera::COLOR_BUFFER0, texture, 0, 0, false, PRERENDER_ANTIALIASINGMULTISAMPLES, PRERENDER_ANTIALIASINGMULTISAMPLES);
|
|
||||||
prerenderCamera->addChild(subgraph);
|
|
||||||
prerenderNode->addChild(prerenderCamera);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
osg::Geometry* polyGeom = new osg::Geometry();
|
|
||||||
|
|
||||||
polyGeom->setSupportsDisplayList(false);
|
|
||||||
|
|
||||||
osg::Vec3 origin(0.0f, 0.0f, 0.0f);
|
|
||||||
osg::Vec3 xAxis(1.0f, 0.0f, 0.0f);
|
|
||||||
osg::Vec3 yAxis(0.0f, 1.0f, 0.0f);
|
|
||||||
|
|
||||||
float height = 1024.0f;
|
|
||||||
float width = 1280.0f;
|
|
||||||
int noSteps = 3;
|
|
||||||
|
|
||||||
osg::Vec3Array* vertices = new osg::Vec3Array;
|
|
||||||
osg::Vec2Array* texcoords = new osg::Vec2Array;
|
|
||||||
osg::Vec4Array* colors = new osg::Vec4Array;
|
|
||||||
|
|
||||||
osg::Vec3 bottom = origin;
|
|
||||||
osg::Vec3 dx = xAxis*(width / ((float)(noSteps - 1)));
|
|
||||||
osg::Vec3 dy = yAxis*(height / ((float)(noSteps - 1)));
|
|
||||||
|
|
||||||
osg::Vec2 bottom_texcoord(0.0f, 0.0f);
|
|
||||||
osg::Vec2 dx_texcoord(1.0f / (float)(noSteps - 1), 0.0f);
|
|
||||||
osg::Vec2 dy_texcoord(0.0f, 1.0f / (float)(noSteps - 1));
|
|
||||||
|
|
||||||
int i, j;
|
|
||||||
for (i = 0; i < noSteps; ++i)
|
|
||||||
{
|
|
||||||
osg::Vec3 cursor = bottom + dy*(float)i;
|
|
||||||
osg::Vec2 texcoord = bottom_texcoord + dy_texcoord*(float)i;
|
|
||||||
for (j = 0; j < noSteps; ++j)
|
|
||||||
{
|
|
||||||
vertices->push_back(cursor);
|
|
||||||
texcoords->push_back(osg::Vec2((sin(texcoord.x()*osg::PI - osg::PI*0.5) + 1.0f)*0.5f, (sin(texcoord.y()*osg::PI - osg::PI*0.5) + 1.0f)*0.5f));
|
|
||||||
colors->push_back(osg::Vec4(1.0f, 1.0f, 1.0f, 1.0f));
|
|
||||||
cursor += dx;
|
|
||||||
texcoord += dx_texcoord;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
polyGeom->setVertexArray(vertices);
|
|
||||||
polyGeom->setColorArray(colors, osg::Array::BIND_PER_VERTEX);
|
|
||||||
polyGeom->setTexCoordArray(0, texcoords);
|
|
||||||
|
|
||||||
for (i = 0; i < noSteps - 1; ++i)
|
|
||||||
{
|
|
||||||
osg::DrawElementsUShort* elements = new osg::DrawElementsUShort(osg::PrimitiveSet::QUAD_STRIP);
|
|
||||||
for (j = 0; j < noSteps; ++j)
|
|
||||||
{
|
|
||||||
elements->push_back(j + (i + 1)*noSteps);
|
|
||||||
elements->push_back(j + (i)*noSteps);
|
|
||||||
}
|
|
||||||
polyGeom->addPrimitiveSet(elements);
|
|
||||||
}
|
|
||||||
|
|
||||||
osg::StateSet* stateset = polyGeom->getOrCreateStateSet();
|
|
||||||
stateset->setTextureAttributeAndModes(0, texture, osg::StateAttribute::ON);
|
|
||||||
stateset->setMode(GL_LIGHTING, osg::StateAttribute::OFF);
|
|
||||||
|
|
||||||
osg::Geode* geode = new osg::Geode();
|
|
||||||
geode->addDrawable(polyGeom);
|
|
||||||
|
|
||||||
osg::Camera* nestedRenderCamera = new osg::Camera;
|
|
||||||
nestedRenderCamera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
|
|
||||||
nestedRenderCamera->setViewMatrix(osg::Matrix::identity());
|
|
||||||
nestedRenderCamera->setProjectionMatrixAsOrtho2D(0, 1280, 0, 1024);
|
|
||||||
nestedRenderCamera->setRenderOrder(osg::Camera::NESTED_RENDER);
|
|
||||||
nestedRenderCamera->addChild(geode);
|
|
||||||
|
|
||||||
prerenderNode->addChild(nestedRenderCamera);
|
|
||||||
}
|
|
||||||
|
|
||||||
return prerenderNode;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
|
||||||
{
|
|
||||||
osg::ArgumentParser arguments(&argc, argv);
|
|
||||||
|
|
||||||
osgViewer::Viewer viewer;
|
|
||||||
|
|
||||||
osg::ref_ptr<osg::Group> scene = new osg::Group;
|
|
||||||
|
|
||||||
|
|
||||||
viewer.addEventHandler(new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()));
|
|
||||||
viewer.addEventHandler(new osgViewer::StatsHandler);
|
|
||||||
viewer.addEventHandler(new osgViewer::WindowSizeHandler);
|
|
||||||
viewer.addEventHandler(new osgViewer::ThreadingHandler);
|
|
||||||
viewer.getCamera()->setProjectionMatrixAsPerspective(60.0f, 1.33333, 0.01, 100.0);
|
|
||||||
viewer.setCameraManipulator(new osgGA::TrackballManipulator());
|
|
||||||
|
|
||||||
viewer.setUpViewInWindow(11, 11, 800 + 11, 600 + 11);
|
|
||||||
//viewer.setUpViewOnSingleScreen(0); // !!
|
|
||||||
|
|
||||||
viewer.getCamera()->setClearColor(osg::Vec4(0.3, 0.3, 0.3, 1.0));
|
|
||||||
viewer.setThreadingModel(osgViewer::Viewer::SingleThreaded);// we can play with threading models later
|
|
||||||
|
|
||||||
osg::ref_ptr<ComputeNode> computeNode = new ComputeNode();
|
|
||||||
computeNode->setPosition(osg::Vec3(0, 0, 0));
|
|
||||||
computeNode->setUpdateCallback(new ComputeNodeUpdateCallback(computeNode.get())); // on-the-fly reloading the shaders if shader source on disk is changed
|
|
||||||
computeNode->initComputingSetup();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
scene->addChild(computeNode.get());
|
|
||||||
scene->addChild(computeNode->_computationResultsRenderGroup.get());
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef PRERENDER_HIGH_QUALITY_ANTIALIASING
|
|
||||||
viewer.setSceneData(createPrerenderSubgraph(scene.get(), osg::Vec4(0.3, 0.4, 0.6, 1)));
|
|
||||||
#else
|
|
||||||
viewer.setSceneData(scene.get());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
viewer.realize();
|
|
||||||
|
|
||||||
viewer.getCamera()->getGraphicsContext()->getState()->setUseModelViewAndProjectionUniforms(true);
|
|
||||||
|
|
||||||
viewer.run();
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
@@ -56,7 +56,18 @@ public:
|
|||||||
traverse(node);
|
traverse(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
void apply(osg::Drawable& drawable)
|
void apply(osg::Geode& node)
|
||||||
|
{
|
||||||
|
if (!_useStateSets && node.getStateSet()) node.setStateSet(0);
|
||||||
|
for(unsigned int i = 0; i<node.getNumDrawables(); ++i)
|
||||||
|
{
|
||||||
|
process(*node.getDrawable(i));
|
||||||
|
}
|
||||||
|
|
||||||
|
traverse(node);
|
||||||
|
}
|
||||||
|
|
||||||
|
void process(osg::Drawable& drawable)
|
||||||
{
|
{
|
||||||
if (!_useStateSets && drawable.getStateSet())
|
if (!_useStateSets && drawable.getStateSet())
|
||||||
{
|
{
|
||||||
@@ -123,11 +134,11 @@ public:
|
|||||||
|
|
||||||
if (_imageProcessor.valid())
|
if (_imageProcessor.valid())
|
||||||
{
|
{
|
||||||
OSG_NOTICE<<"Will be using ImageProcessor to process image "<<image->getFileName()<<std::endl;
|
OSG_NOTICE<<"Will be using ImageProcessor to proces image "<<image->getFileName()<<std::endl;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
OSG_NOTICE<<"No ImageProcessor to process image "<<image->getFileName()<<std::endl;
|
OSG_NOTICE<<"No ImageProcessor to proces image "<<image->getFileName()<<std::endl;
|
||||||
}
|
}
|
||||||
OSG_NOTICE<<" compressImage "<<_compressImages<<std::endl;
|
OSG_NOTICE<<" compressImage "<<_compressImages<<std::endl;
|
||||||
OSG_NOTICE<<" generateMipmaps "<<_generateMipmaps<<std::endl;
|
OSG_NOTICE<<" generateMipmaps "<<_generateMipmaps<<std::endl;
|
||||||
@@ -540,7 +551,6 @@ public:
|
|||||||
const std::string& outputFilename,
|
const std::string& outputFilename,
|
||||||
SceneGraphProcessor* sceneGraphProcessor,
|
SceneGraphProcessor* sceneGraphProcessor,
|
||||||
osgUtil::IncrementalCompileOperation* ico):
|
osgUtil::IncrementalCompileOperation* ico):
|
||||||
osg::Referenced(true),
|
|
||||||
Operation("DatabasePaging Operation", false),
|
Operation("DatabasePaging Operation", false),
|
||||||
_filename(filename),
|
_filename(filename),
|
||||||
_outputFilename(outputFilename),
|
_outputFilename(outputFilename),
|
||||||
|
|||||||
@@ -93,36 +93,45 @@ osg::Node* createBase(const osg::Vec3& center,float radius)
|
|||||||
osg::Vec4Array* colors = new osg::Vec4Array;
|
osg::Vec4Array* colors = new osg::Vec4Array;
|
||||||
colors->push_back(osg::Vec4(1.0f,1.0f,1.0f,1.0f)); // white
|
colors->push_back(osg::Vec4(1.0f,1.0f,1.0f,1.0f)); // white
|
||||||
colors->push_back(osg::Vec4(0.0f,0.0f,0.0f,1.0f)); // black
|
colors->push_back(osg::Vec4(0.0f,0.0f,0.0f,1.0f)); // black
|
||||||
|
int numColors=colors->size();
|
||||||
|
|
||||||
osg::ref_ptr<osg::DrawElementsUShort> whitePrimitives = new osg::DrawElementsUShort(GL_QUADS);
|
|
||||||
osg::ref_ptr<osg::DrawElementsUShort> blackPrimitives = new osg::DrawElementsUShort(GL_QUADS);
|
|
||||||
|
|
||||||
int numIndicesPerRow=numTilesX+1;
|
int numIndicesPerRow=numTilesX+1;
|
||||||
|
osg::UByteArray* coordIndices = new osg::UByteArray; // assumes we are using less than 256 points...
|
||||||
|
osg::UByteArray* colorIndices = new osg::UByteArray;
|
||||||
for(iy=0;iy<numTilesY;++iy)
|
for(iy=0;iy<numTilesY;++iy)
|
||||||
{
|
{
|
||||||
for(int ix=0;ix<numTilesX;++ix)
|
for(int ix=0;ix<numTilesX;++ix)
|
||||||
{
|
{
|
||||||
osg::DrawElementsUShort* primitives = ((iy+ix)%2==0) ? whitePrimitives.get() : blackPrimitives.get();
|
// four vertices per quad.
|
||||||
primitives->push_back(ix +(iy+1)*numIndicesPerRow);
|
coordIndices->push_back(ix +(iy+1)*numIndicesPerRow);
|
||||||
primitives->push_back(ix +iy*numIndicesPerRow);
|
coordIndices->push_back(ix +iy*numIndicesPerRow);
|
||||||
primitives->push_back((ix+1)+iy*numIndicesPerRow);
|
coordIndices->push_back((ix+1)+iy*numIndicesPerRow);
|
||||||
primitives->push_back((ix+1)+(iy+1)*numIndicesPerRow);
|
coordIndices->push_back((ix+1)+(iy+1)*numIndicesPerRow);
|
||||||
|
|
||||||
|
// one color per quad
|
||||||
|
colorIndices->push_back((ix+iy)%numColors);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// set up a single normal
|
// set up a single normal
|
||||||
osg::Vec3Array* normals = new osg::Vec3Array;
|
osg::Vec3Array* normals = new osg::Vec3Array;
|
||||||
normals->push_back(osg::Vec3(0.0f,0.0f,1.0f));
|
normals->push_back(osg::Vec3(0.0f,0.0f,1.0f));
|
||||||
|
|
||||||
|
|
||||||
osg::Geometry* geom = new osg::Geometry;
|
osg::Geometry* geom = new osg::Geometry;
|
||||||
geom->setVertexArray(coords);
|
geom->setVertexArray(coords);
|
||||||
|
geom->setVertexIndices(coordIndices);
|
||||||
|
|
||||||
geom->setColorArray(colors, osg::Array::BIND_PER_PRIMITIVE_SET);
|
geom->setColorArray(colors);
|
||||||
|
geom->setColorIndices(colorIndices);
|
||||||
|
geom->setColorBinding(osg::Geometry::BIND_PER_PRIMITIVE);
|
||||||
|
|
||||||
geom->setNormalArray(normals, osg::Array::BIND_OVERALL);
|
geom->setNormalArray(normals);
|
||||||
|
geom->setNormalBinding(osg::Geometry::BIND_OVERALL);
|
||||||
|
|
||||||
geom->addPrimitiveSet(whitePrimitives.get());
|
geom->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::QUADS,0,coordIndices->size()));
|
||||||
geom->addPrimitiveSet(blackPrimitives.get());
|
|
||||||
|
|
||||||
osg::Geode* geode = new osg::Geode;
|
osg::Geode* geode = new osg::Geode;
|
||||||
geode->addDrawable(geom);
|
geode->addDrawable(geom);
|
||||||
|
|||||||
@@ -50,7 +50,8 @@ osg::Geometry* createEaseMotionGeometry(osgAnimation::Motion* motion) {
|
|||||||
|
|
||||||
geom->setUseDisplayList(false);
|
geom->setUseDisplayList(false);
|
||||||
geom->setVertexArray(v);
|
geom->setVertexArray(v);
|
||||||
geom->setColorArray(cols, osg::Array::BIND_OVERALL);
|
geom->setColorArray(cols);
|
||||||
|
geom->setColorBinding(osg::Geometry::BIND_OVERALL);
|
||||||
geom->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::LINE_STRIP, 0, v->size()));
|
geom->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::LINE_STRIP, 0, v->size()));
|
||||||
|
|
||||||
return geom;
|
return geom;
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ struct MyRigTransformHardware : public osgAnimation::RigTransformHardware
|
|||||||
{
|
{
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
ss << "boneWeight" << i;
|
ss << "boneWeight" << i;
|
||||||
geom.setVertexAttribArray(attribIndex + i, getVertexAttrib(i));
|
geom.setVertexAttribData(attribIndex + i, osg::Geometry::ArrayData(getVertexAttrib(i),osg::Geometry::BIND_PER_VERTEX));
|
||||||
}
|
}
|
||||||
|
|
||||||
osg::ref_ptr<osg::StateSet> ss = new osg::StateSet;
|
osg::ref_ptr<osg::StateSet> ss = new osg::StateSet;
|
||||||
|
|||||||
@@ -168,7 +168,9 @@ osg::Geode* createAxis()
|
|||||||
colors->push_back (osg::Vec4 (0.0f, 1.0f, 0.0f, 1.0f));
|
colors->push_back (osg::Vec4 (0.0f, 1.0f, 0.0f, 1.0f));
|
||||||
colors->push_back (osg::Vec4 (0.0f, 0.0f, 1.0f, 1.0f));
|
colors->push_back (osg::Vec4 (0.0f, 0.0f, 1.0f, 1.0f));
|
||||||
colors->push_back (osg::Vec4 (0.0f, 0.0f, 1.0f, 1.0f));
|
colors->push_back (osg::Vec4 (0.0f, 0.0f, 1.0f, 1.0f));
|
||||||
geometry->setColorArray (colors.get(), osg::Array::BIND_PER_VERTEX);
|
geometry->setColorArray (colors.get());
|
||||||
|
|
||||||
|
geometry->setColorBinding (osg::Geometry::BIND_PER_VERTEX);
|
||||||
geometry->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::LINES,0,6));
|
geometry->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::LINES,0,6));
|
||||||
|
|
||||||
geode->addDrawable( geometry.get() );
|
geode->addDrawable( geometry.get() );
|
||||||
|
|||||||
@@ -53,7 +53,9 @@ osg::Geode* createAxis()
|
|||||||
colors->push_back (osg::Vec4 (0.0f, 1.0f, 0.0f, 1.0f));
|
colors->push_back (osg::Vec4 (0.0f, 1.0f, 0.0f, 1.0f));
|
||||||
colors->push_back (osg::Vec4 (0.0f, 0.0f, 1.0f, 1.0f));
|
colors->push_back (osg::Vec4 (0.0f, 0.0f, 1.0f, 1.0f));
|
||||||
colors->push_back (osg::Vec4 (0.0f, 0.0f, 1.0f, 1.0f));
|
colors->push_back (osg::Vec4 (0.0f, 0.0f, 1.0f, 1.0f));
|
||||||
geometry->setColorArray (colors, osg::Array::BIND_PER_VERTEX);
|
geometry->setColorArray (colors);
|
||||||
|
|
||||||
|
geometry->setColorBinding (osg::Geometry::BIND_PER_VERTEX);
|
||||||
geometry->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::LINES,0,6));
|
geometry->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::LINES,0,6));
|
||||||
|
|
||||||
geode->addDrawable( geometry );
|
geode->addDrawable( geometry );
|
||||||
@@ -68,7 +70,8 @@ osgAnimation::RigGeometry* createTesselatedBox(int nsplit, float size)
|
|||||||
osg::ref_ptr<osg::Vec3Array> vertices (new osg::Vec3Array());
|
osg::ref_ptr<osg::Vec3Array> vertices (new osg::Vec3Array());
|
||||||
osg::ref_ptr<osg::Vec3Array> colors (new osg::Vec3Array());
|
osg::ref_ptr<osg::Vec3Array> colors (new osg::Vec3Array());
|
||||||
geometry->setVertexArray (vertices.get());
|
geometry->setVertexArray (vertices.get());
|
||||||
geometry->setColorArray (colors.get(), osg::Array::BIND_PER_VERTEX);
|
geometry->setColorArray (colors.get());
|
||||||
|
geometry->setColorBinding (osg::Geometry::BIND_PER_VERTEX);
|
||||||
|
|
||||||
float step = size / static_cast<float>(nsplit);
|
float step = size / static_cast<float>(nsplit);
|
||||||
float s = 0.5f/4.0f;
|
float s = 0.5f/4.0f;
|
||||||
|
|||||||
@@ -49,7 +49,9 @@ osg::ref_ptr<osg::Geode> createAxis()
|
|||||||
colors->push_back (osg::Vec4 (0.0f, 1.0f, 0.0f, 1.0f));
|
colors->push_back (osg::Vec4 (0.0f, 1.0f, 0.0f, 1.0f));
|
||||||
colors->push_back (osg::Vec4 (0.0f, 0.0f, 1.0f, 1.0f));
|
colors->push_back (osg::Vec4 (0.0f, 0.0f, 1.0f, 1.0f));
|
||||||
colors->push_back (osg::Vec4 (0.0f, 0.0f, 1.0f, 1.0f));
|
colors->push_back (osg::Vec4 (0.0f, 0.0f, 1.0f, 1.0f));
|
||||||
geometry->setColorArray (colors.get(), osg::Array::BIND_PER_VERTEX);
|
geometry->setColorArray (colors.get());
|
||||||
|
|
||||||
|
geometry->setColorBinding (osg::Geometry::BIND_PER_VERTEX);
|
||||||
geometry->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::LINES,0,6));
|
geometry->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::LINES,0,6));
|
||||||
|
|
||||||
geode->addDrawable( geometry.get() );
|
geode->addDrawable( geometry.get() );
|
||||||
@@ -71,7 +73,7 @@ int main (int argc, char* argv[])
|
|||||||
osg::ref_ptr<osg::Geode> geode = new osg::Geode;
|
osg::ref_ptr<osg::Geode> geode = new osg::Geode;
|
||||||
geode->addDrawable(new osg::ShapeDrawable(new osg::Box(osg::Vec3(0.0f,0.0f,0.0f),0.5)));
|
geode->addDrawable(new osg::ShapeDrawable(new osg::Box(osg::Vec3(0.0f,0.0f,0.0f),0.5)));
|
||||||
|
|
||||||
//Transformation to be manipulated by the animation
|
//Tranformation to be manipulated by the animation
|
||||||
osg::ref_ptr<osg::MatrixTransform> trans = new osg::MatrixTransform();
|
osg::ref_ptr<osg::MatrixTransform> trans = new osg::MatrixTransform();
|
||||||
trans->setName("AnimatedNode");
|
trans->setName("AnimatedNode");
|
||||||
//Dynamic object, has to be updated during update traversal
|
//Dynamic object, has to be updated during update traversal
|
||||||
@@ -84,7 +86,7 @@ int main (int argc, char* argv[])
|
|||||||
//The second element modifies the rotation around x-axis
|
//The second element modifies the rotation around x-axis
|
||||||
updatecb->getStackedTransforms().push_back(new osgAnimation::StackedTranslateElement("position"));
|
updatecb->getStackedTransforms().push_back(new osgAnimation::StackedTranslateElement("position"));
|
||||||
updatecb->getStackedTransforms().push_back(new osgAnimation::StackedRotateAxisElement("euler",osg::Vec3(1,0,0),0));
|
updatecb->getStackedTransforms().push_back(new osgAnimation::StackedRotateAxisElement("euler",osg::Vec3(1,0,0),0));
|
||||||
//connect the UpdateMatrixTransform callback to the MatrixTransform
|
//connect the UpdateMatrixTransform callback to the MatrixTRanform
|
||||||
trans->setUpdateCallback(updatecb);
|
trans->setUpdateCallback(updatecb);
|
||||||
//initialize MatrixTranform
|
//initialize MatrixTranform
|
||||||
trans->setMatrix(osg::Matrix::identity());
|
trans->setMatrix(osg::Matrix::identity());
|
||||||
@@ -102,7 +104,7 @@ int main (int argc, char* argv[])
|
|||||||
//add the rest of the scene to the grp node
|
//add the rest of the scene to the grp node
|
||||||
grp->addChild(root);
|
grp->addChild(root);
|
||||||
|
|
||||||
// And we finally define our channel for linear Vector interpolation
|
// And we finaly define our channel for linear Vector interpolation
|
||||||
osgAnimation::Vec3LinearChannel* channelAnimation1 = new osgAnimation::Vec3LinearChannel;
|
osgAnimation::Vec3LinearChannel* channelAnimation1 = new osgAnimation::Vec3LinearChannel;
|
||||||
//name of the AnimationUpdateCallback
|
//name of the AnimationUpdateCallback
|
||||||
channelAnimation1->setTargetName("AnimatedCallback");
|
channelAnimation1->setTargetName("AnimatedCallback");
|
||||||
|
|||||||
@@ -98,9 +98,9 @@ struct ExampleTimelineUsage : public osgGA::GUIEventHandler
|
|||||||
{
|
{
|
||||||
// we add a scratch head priority 1 each 10 second
|
// we add a scratch head priority 1 each 10 second
|
||||||
// note:
|
// note:
|
||||||
// it's possible to add the same instance more than once on the timeline
|
// it's possible to add the same instance more then once on the timeline
|
||||||
// the only things you need to take care is if you remove it. It will remove
|
// the only things you need to take care is if you remove it. It will remove
|
||||||
// all instance that exist on the timeline. If you need to differentiate
|
// all instance that exist on the timeline. If you need to differtiate
|
||||||
// it's better to create a new instance
|
// it's better to create a new instance
|
||||||
tml->addActionAt(5.0 + 10.0 * i, _scratchHead.get(), 1);
|
tml->addActionAt(5.0 + 10.0 * i, _scratchHead.get(), 1);
|
||||||
}
|
}
|
||||||
@@ -139,12 +139,21 @@ struct ExampleTimelineUsage : public osgGA::GUIEventHandler
|
|||||||
}
|
}
|
||||||
_releaseKey = false;
|
_releaseKey = false;
|
||||||
}
|
}
|
||||||
traverse(node, nv);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
osgGA::GUIEventHandler::operator()(node, nv);
|
osgGA::EventVisitor* ev = dynamic_cast<osgGA::EventVisitor*>(nv);
|
||||||
|
if (ev && ev->getActionAdapter() && !ev->getEvents().empty())
|
||||||
|
{
|
||||||
|
for(osgGA::EventQueue::Events::iterator itr = ev->getEvents().begin();
|
||||||
|
itr != ev->getEvents().end();
|
||||||
|
++itr)
|
||||||
|
{
|
||||||
|
handleWithCheckAgainstIgnoreHandledEventsMask(*(*itr), *(ev->getActionAdapter()), node, nv);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
traverse(node, nv);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
#include <osg/Geometry>
|
#include <osg/Geometry>
|
||||||
#include <osg/MatrixTransform>
|
#include <osg/MatrixTransform>
|
||||||
#include <osg/Geode>
|
#include <osg/Geode>
|
||||||
#include <osgDB/FileNameUtils>
|
|
||||||
#include <osgViewer/Viewer>
|
#include <osgViewer/Viewer>
|
||||||
#include <osgViewer/ViewerEventHandlers>
|
#include <osgViewer/ViewerEventHandlers>
|
||||||
#include <osgWidget/ViewerEventHandlers>
|
#include <osgWidget/ViewerEventHandlers>
|
||||||
@@ -60,7 +59,8 @@ osg::Geode* createAxis()
|
|||||||
colors->push_back(osg::Vec4(0.0f, 0.0f, 1.0f, 1.0f));
|
colors->push_back(osg::Vec4(0.0f, 0.0f, 1.0f, 1.0f));
|
||||||
|
|
||||||
geometry->setVertexArray(vertices);
|
geometry->setVertexArray(vertices);
|
||||||
geometry->setColorArray(colors, osg::Array::BIND_PER_VERTEX);
|
geometry->setColorArray(colors);
|
||||||
|
geometry->setColorBinding(osg::Geometry::BIND_PER_VERTEX);
|
||||||
geometry->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::LINES, 0, 6));
|
geometry->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::LINES, 0, 6));
|
||||||
geometry->getOrCreateStateSet()->setMode(GL_LIGHTING, false);
|
geometry->getOrCreateStateSet()->setMode(GL_LIGHTING, false);
|
||||||
|
|
||||||
@@ -137,30 +137,10 @@ int main(int argc, char** argv)
|
|||||||
// Set our Singleton's model.
|
// Set our Singleton's model.
|
||||||
AnimationManagerFinder finder;
|
AnimationManagerFinder finder;
|
||||||
node->accept(finder);
|
node->accept(finder);
|
||||||
if (finder._am.valid())
|
if (finder._am.valid()) {
|
||||||
{
|
|
||||||
|
|
||||||
std::string playModeOpt;
|
|
||||||
if (arguments.read("--play-mode", playModeOpt))
|
|
||||||
{
|
|
||||||
osgAnimation::Animation::PlayMode playMode = osgAnimation::Animation::LOOP;
|
|
||||||
if (osgDB::equalCaseInsensitive(playModeOpt, "ONCE")) playMode = osgAnimation::Animation::ONCE;
|
|
||||||
else if (osgDB::equalCaseInsensitive(playModeOpt, "STAY")) playMode = osgAnimation::Animation::STAY;
|
|
||||||
else if (osgDB::equalCaseInsensitive(playModeOpt, "LOOP")) playMode = osgAnimation::Animation::LOOP;
|
|
||||||
else if (osgDB::equalCaseInsensitive(playModeOpt, "PPONG")) playMode = osgAnimation::Animation::PPONG;
|
|
||||||
|
|
||||||
for (osgAnimation::AnimationList::const_iterator animIter = finder._am->getAnimationList().begin();
|
|
||||||
animIter != finder._am->getAnimationList().end(); ++animIter)
|
|
||||||
{
|
|
||||||
(*animIter)->setPlayMode(playMode);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
node->setUpdateCallback(finder._am.get());
|
node->setUpdateCallback(finder._am.get());
|
||||||
AnimtkViewerModelController::setModel(finder._am.get());
|
AnimtkViewerModelController::setModel(finder._am.get());
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
osg::notify(osg::WARN) << "no osgAnimation::AnimationManagerBase found in the subgraph, no animations available" << std::endl;
|
osg::notify(osg::WARN) << "no osgAnimation::AnimationManagerBase found in the subgraph, no animations available" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
SET(TARGET_SRC osgatomiccounter.cpp)
|
|
||||||
|
|
||||||
#### end var setup ###
|
|
||||||
SETUP_EXAMPLE(osgatomiccounter)
|
|
||||||
@@ -1,238 +0,0 @@
|
|||||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 2012-2012 David Callu
|
|
||||||
*
|
|
||||||
* This application is open source and may be redistributed and/or modified
|
|
||||||
* freely and without restriction, both in commercial and non commercial applications,
|
|
||||||
* as long as this copyright notice is maintained.
|
|
||||||
*
|
|
||||||
* This application is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <osg/BufferIndexBinding>
|
|
||||||
#include <osg/BufferObject>
|
|
||||||
#include <osg/Camera>
|
|
||||||
#include <osg/Program>
|
|
||||||
|
|
||||||
#include <osgDB/ReadFile>
|
|
||||||
#include <osgUtil/Optimizer>
|
|
||||||
|
|
||||||
#include <osgViewer/Viewer>
|
|
||||||
#include <osgViewer/ViewerEventHandlers>
|
|
||||||
|
|
||||||
#include <osgGA/TrackballManipulator>
|
|
||||||
#include <osgGA/FlightManipulator>
|
|
||||||
#include <osgGA/DriveManipulator>
|
|
||||||
#include <osgGA/KeySwitchMatrixManipulator>
|
|
||||||
#include <osgGA/StateSetManipulator>
|
|
||||||
#include <osgGA/AnimationPathManipulator>
|
|
||||||
#include <osgGA/TerrainManipulator>
|
|
||||||
#include <osgGA/SphericalManipulator>
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
|
|
||||||
class AdaptNumPixelUniform : public osg::Camera::DrawCallback
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
AdaptNumPixelUniform()
|
|
||||||
{
|
|
||||||
_atomicCounterArray = new osg::UIntArray;
|
|
||||||
_atomicCounterArray->push_back(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual void operator () (osg::RenderInfo& renderInfo) const
|
|
||||||
{
|
|
||||||
_acbb->readData(*renderInfo.getState(), *_atomicCounterArray);
|
|
||||||
unsigned int numPixel = osg::maximum(1u, _atomicCounterArray->front());
|
|
||||||
|
|
||||||
if ((renderInfo.getView()->getFrameStamp()->getFrameNumber() % 10) == 0)
|
|
||||||
{
|
|
||||||
OSG_INFO << "osgatomiccounter : draw " << numPixel << " pixels." << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
_invNumPixelUniform->set( 1.0f / static_cast<float>(numPixel) );
|
|
||||||
}
|
|
||||||
|
|
||||||
osg::ref_ptr<osg::Uniform> _invNumPixelUniform;
|
|
||||||
osg::ref_ptr<osg::UIntArray> _atomicCounterArray;
|
|
||||||
osg::ref_ptr<osg::AtomicCounterBufferBinding> _acbb;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
osg::Program * createProgram()
|
|
||||||
{
|
|
||||||
|
|
||||||
std::stringstream vp;
|
|
||||||
vp << "#version 420 compatibility\n"
|
|
||||||
<< "\n"
|
|
||||||
<< "void main(void)\n"
|
|
||||||
<< "{\n"
|
|
||||||
<< " gl_Position = ftransform();\n"
|
|
||||||
<< "}\n";
|
|
||||||
osg::Shader * vpShader = new osg::Shader( osg::Shader::VERTEX, vp.str() );
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
std::stringstream fp;
|
|
||||||
fp << "#version 420 compatibility\n"
|
|
||||||
<< "\n"
|
|
||||||
<< "layout(binding = 0) uniform atomic_uint acRed;\n"
|
|
||||||
<< "layout(binding = 0, offset = 4) uniform atomic_uint acGreen;\n"
|
|
||||||
<< "layout(binding = 2) uniform atomic_uint acBlue;\n"
|
|
||||||
<< "\n"
|
|
||||||
<< "uniform float invNumPixel;\n"
|
|
||||||
<< "\n"
|
|
||||||
<< "void main(void)\n"
|
|
||||||
<< "{\n"
|
|
||||||
<< " float r = float(atomicCounterIncrement(acRed)) * invNumPixel;\n"
|
|
||||||
<< " float g = float(atomicCounterIncrement(acGreen)) * invNumPixel;\n"
|
|
||||||
<< " float b = float(atomicCounterIncrement(acBlue)) * invNumPixel;\n"
|
|
||||||
<< " gl_FragColor = vec4(r, g, b, 1.0);\n"
|
|
||||||
<< "}\n"
|
|
||||||
<< "\n";
|
|
||||||
osg::Shader * fpShader = new osg::Shader( osg::Shader::FRAGMENT, fp.str() );
|
|
||||||
|
|
||||||
osg::Program * program = new osg::Program;
|
|
||||||
program->addShader(vpShader);
|
|
||||||
program->addShader(fpShader);
|
|
||||||
|
|
||||||
return program;
|
|
||||||
}
|
|
||||||
|
|
||||||
class ResetAtomicCounter : public osg::StateAttributeCallback
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual void operator () (osg::StateAttribute* sa, osg::NodeVisitor*)
|
|
||||||
{
|
|
||||||
osg::AtomicCounterBufferBinding * acbb = dynamic_cast<osg::AtomicCounterBufferBinding *>(sa);
|
|
||||||
if (acbb)
|
|
||||||
{
|
|
||||||
osg::AtomicCounterBufferObject * acbo = dynamic_cast<osg::AtomicCounterBufferObject*>(acbb->getBufferObject());
|
|
||||||
if (acbo && acbo->getBufferData(0))
|
|
||||||
{
|
|
||||||
acbo->getBufferData(0)->dirty();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
|
||||||
{
|
|
||||||
// use an ArgumentParser object to manage the program arguments.
|
|
||||||
osg::ArgumentParser arguments(&argc,argv);
|
|
||||||
|
|
||||||
arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName());
|
|
||||||
arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is a simple example which show draw order of pixel.");
|
|
||||||
arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ...");
|
|
||||||
|
|
||||||
osgViewer::Viewer viewer(arguments);
|
|
||||||
|
|
||||||
unsigned int helpType = 0;
|
|
||||||
if ((helpType = arguments.readHelpType()))
|
|
||||||
{
|
|
||||||
arguments.getApplicationUsage()->write(std::cout, helpType);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// report any errors if they have occurred when parsing the program arguments.
|
|
||||||
if (arguments.errors())
|
|
||||||
{
|
|
||||||
arguments.writeErrorMessages(std::cout);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// set up the camera manipulators.
|
|
||||||
viewer.setCameraManipulator( new osgGA::TrackballManipulator() );
|
|
||||||
|
|
||||||
// add the state manipulator
|
|
||||||
viewer.addEventHandler( new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()) );
|
|
||||||
|
|
||||||
// add the thread model handler
|
|
||||||
viewer.addEventHandler(new osgViewer::ThreadingHandler);
|
|
||||||
|
|
||||||
// add the window size toggle handler
|
|
||||||
viewer.addEventHandler(new osgViewer::WindowSizeHandler);
|
|
||||||
|
|
||||||
// add the stats handler
|
|
||||||
viewer.addEventHandler(new osgViewer::StatsHandler);
|
|
||||||
|
|
||||||
// add the help handler
|
|
||||||
viewer.addEventHandler(new osgViewer::HelpHandler(arguments.getApplicationUsage()));
|
|
||||||
|
|
||||||
// add the screen capture handler
|
|
||||||
viewer.addEventHandler(new osgViewer::ScreenCaptureHandler);
|
|
||||||
|
|
||||||
// load the data
|
|
||||||
osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments);
|
|
||||||
if (!loadedModel)
|
|
||||||
{
|
|
||||||
osg::Geometry * quad = osg::createTexturedQuadGeometry(osg::Vec3f(-2.0f, 0.0f, -2.0f),
|
|
||||||
osg::Vec3f(2.0f, 0.0f, 0.0f),
|
|
||||||
osg::Vec3f(0.0f, 0.0f, 2.0f) );
|
|
||||||
|
|
||||||
osg::Geode * geode = new osg::Geode;
|
|
||||||
geode->addDrawable(quad);
|
|
||||||
loadedModel = geode;
|
|
||||||
}
|
|
||||||
|
|
||||||
// any option left unread are converted into errors to write out later.
|
|
||||||
arguments.reportRemainingOptionsAsUnrecognized();
|
|
||||||
|
|
||||||
// report any errors if they have occurred when parsing the program arguments.
|
|
||||||
if (arguments.errors())
|
|
||||||
{
|
|
||||||
arguments.writeErrorMessages(std::cout);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
osg::StateSet * ss = loadedModel->asGeode()->getDrawable(0)->getOrCreateStateSet();
|
|
||||||
ss->setAttributeAndModes( createProgram(), osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE | osg::StateAttribute::PROTECTED );
|
|
||||||
|
|
||||||
ss = loadedModel->getOrCreateStateSet();
|
|
||||||
osg::ref_ptr<osg::UIntArray> atomicCounterArrayRedAndGreen = new osg::UIntArray;
|
|
||||||
atomicCounterArrayRedAndGreen->push_back(0);
|
|
||||||
atomicCounterArrayRedAndGreen->push_back(0);
|
|
||||||
|
|
||||||
osg::ref_ptr<osg::UIntArray> atomicCounterArrayBlue = new osg::UIntArray;
|
|
||||||
atomicCounterArrayBlue->push_back(0);
|
|
||||||
|
|
||||||
osg::ref_ptr<osg::AtomicCounterBufferObject> acboRedAndGreen = new osg::AtomicCounterBufferObject;
|
|
||||||
acboRedAndGreen->setUsage(GL_STREAM_COPY);
|
|
||||||
atomicCounterArrayRedAndGreen->setBufferObject(acboRedAndGreen.get());
|
|
||||||
|
|
||||||
osg::ref_ptr<osg::AtomicCounterBufferObject> acboBlue = new osg::AtomicCounterBufferObject;
|
|
||||||
acboBlue->setUsage(GL_STREAM_COPY);
|
|
||||||
atomicCounterArrayBlue->setBufferObject(acboBlue.get());
|
|
||||||
|
|
||||||
osg::ref_ptr<osg::AtomicCounterBufferBinding> acbbRedAndGreen = new osg::AtomicCounterBufferBinding(0, acboRedAndGreen.get(), 0, sizeof(GLuint)*3);
|
|
||||||
ss->setAttributeAndModes(acbbRedAndGreen.get());
|
|
||||||
|
|
||||||
osg::ref_ptr<osg::AtomicCounterBufferBinding> acbbBlue = new osg::AtomicCounterBufferBinding(2, acboBlue.get(), 0, sizeof(GLuint));
|
|
||||||
ss->setAttributeAndModes(acbbBlue.get());
|
|
||||||
|
|
||||||
acbbRedAndGreen->setUpdateCallback(new ResetAtomicCounter);
|
|
||||||
acbbBlue->setUpdateCallback(new ResetAtomicCounter);
|
|
||||||
|
|
||||||
osg::ref_ptr<osg::Uniform> invNumPixelUniform = new osg::Uniform("invNumPixel", 1.0f/(800.0f*600.0f));
|
|
||||||
ss->addUniform( invNumPixelUniform.get() );
|
|
||||||
|
|
||||||
AdaptNumPixelUniform * drawCallback = new AdaptNumPixelUniform;
|
|
||||||
drawCallback->_invNumPixelUniform = invNumPixelUniform;
|
|
||||||
drawCallback->_acbb = acbbBlue;
|
|
||||||
|
|
||||||
viewer.getCamera()->setFinalDrawCallback(drawCallback);
|
|
||||||
|
|
||||||
// optimize the scene graph, remove redundant nodes and state etc.
|
|
||||||
osgUtil::Optimizer optimizer;
|
|
||||||
optimizer.optimize(loadedModel.get());
|
|
||||||
|
|
||||||
viewer.setSceneData( loadedModel.get() );
|
|
||||||
|
|
||||||
viewer.realize();
|
|
||||||
|
|
||||||
return viewer.run();
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -348,8 +348,6 @@ int main( int argc, char **argv )
|
|||||||
keyswitchManipulator->addMatrixManipulator( '2', "Flight", new osgGA::FlightManipulator() );
|
keyswitchManipulator->addMatrixManipulator( '2', "Flight", new osgGA::FlightManipulator() );
|
||||||
keyswitchManipulator->addMatrixManipulator( '3', "Drive", new osgGA::DriveManipulator() );
|
keyswitchManipulator->addMatrixManipulator( '3', "Drive", new osgGA::DriveManipulator() );
|
||||||
keyswitchManipulator->addMatrixManipulator( '4', "Terrain", new osgGA::TerrainManipulator() );
|
keyswitchManipulator->addMatrixManipulator( '4', "Terrain", new osgGA::TerrainManipulator() );
|
||||||
|
|
||||||
viewer.setCameraManipulator( keyswitchManipulator.get() );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -406,7 +404,7 @@ int main( int argc, char **argv )
|
|||||||
viewer.renderingTraversals();
|
viewer.renderingTraversals();
|
||||||
|
|
||||||
osg::Timer_t afterRenderTick = osg::Timer::instance()->tick();
|
osg::Timer_t afterRenderTick = osg::Timer::instance()->tick();
|
||||||
std::cout<<"Rendering time = "<<osg::Timer::instance()->delta_s(beforeRenderTick, afterRenderTick) <<" seconds"<<std::endl;
|
std::cout<<"Rendring time = "<<osg::Timer::instance()->delta_s(beforeRenderTick, afterRenderTick) <<" seconds"<<std::endl;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,7 +113,8 @@ osg::Node* createAxis(const osg::Vec3& s, const osg::Vec3& e, int numReps, osg::
|
|||||||
|
|
||||||
osg::Geometry* geom = new osg::Geometry;
|
osg::Geometry* geom = new osg::Geometry;
|
||||||
geom->setVertexArray(vertices);
|
geom->setVertexArray(vertices);
|
||||||
geom->setColorArray(colors, osg::Array::BIND_OVERALL);
|
geom->setColorArray(colors);
|
||||||
|
geom->setColorBinding(osg::Geometry::BIND_OVERALL);
|
||||||
geom->addPrimitiveSet(new osg::DrawArrays(GL_LINE_STRIP,0,vertices->size()));
|
geom->addPrimitiveSet(new osg::DrawArrays(GL_LINE_STRIP,0,vertices->size()));
|
||||||
|
|
||||||
osg::Geode* geode = new osg::Geode;
|
osg::Geode* geode = new osg::Geode;
|
||||||
@@ -139,7 +140,8 @@ osg::Node* createAxis(const osg::Vec3& s, const osg::Vec3& e, int numReps, osg::
|
|||||||
|
|
||||||
osg::Geometry* geom = new osg::Geometry;
|
osg::Geometry* geom = new osg::Geometry;
|
||||||
geom->setVertexArray(vertices);
|
geom->setVertexArray(vertices);
|
||||||
geom->setColorArray(colors, osg::Array::BIND_OVERALL);
|
geom->setColorArray(colors);
|
||||||
|
geom->setColorBinding(osg::Geometry::BIND_OVERALL);
|
||||||
geom->addPrimitiveSet(new osg::DrawArrays(GL_LINE_STRIP,0,vertices->size()));
|
geom->addPrimitiveSet(new osg::DrawArrays(GL_LINE_STRIP,0,vertices->size()));
|
||||||
|
|
||||||
osg::Geode* geode = new osg::Geode;
|
osg::Geode* geode = new osg::Geode;
|
||||||
|
|||||||
@@ -60,7 +60,8 @@ osg::Drawable* createSquare(const osg::Vec3& corner,const osg::Vec3& width,const
|
|||||||
(*norms)[0] = width^height;
|
(*norms)[0] = width^height;
|
||||||
(*norms)[0].normalize();
|
(*norms)[0].normalize();
|
||||||
|
|
||||||
geom->setNormalArray(norms, osg::Array::BIND_OVERALL);
|
geom->setNormalArray(norms);
|
||||||
|
geom->setNormalBinding(osg::Geometry::BIND_OVERALL);
|
||||||
|
|
||||||
osg::Vec2Array* tcoords = new osg::Vec2Array(4);
|
osg::Vec2Array* tcoords = new osg::Vec2Array(4);
|
||||||
(*tcoords)[0].set(0.0f,0.0f);
|
(*tcoords)[0].set(0.0f,0.0f);
|
||||||
@@ -110,7 +111,8 @@ osg::Drawable* createAxis(const osg::Vec3& corner,const osg::Vec3& xdir,const os
|
|||||||
(*color)[4] = z_color;
|
(*color)[4] = z_color;
|
||||||
(*color)[5] = z_color;
|
(*color)[5] = z_color;
|
||||||
|
|
||||||
geom->setColorArray(color, osg::Array::BIND_PER_VERTEX);
|
geom->setColorArray(color);
|
||||||
|
geom->setColorBinding(osg::Geometry::BIND_PER_VERTEX);
|
||||||
|
|
||||||
geom->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::LINES,0,6));
|
geom->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::LINES,0,6));
|
||||||
|
|
||||||
@@ -130,7 +132,7 @@ osg::Node* createModel()
|
|||||||
// create the root node which will hold the model.
|
// create the root node which will hold the model.
|
||||||
osg::Group* root = new osg::Group();
|
osg::Group* root = new osg::Group();
|
||||||
|
|
||||||
// add the drawable into a single geode to be shared...
|
// add the drawable into a single goede to be shared...
|
||||||
osg::Billboard* center = new osg::Billboard();
|
osg::Billboard* center = new osg::Billboard();
|
||||||
center->setMode(osg::Billboard::POINT_ROT_EYE);
|
center->setMode(osg::Billboard::POINT_ROT_EYE);
|
||||||
center->addDrawable(
|
center->addDrawable(
|
||||||
|
|||||||
@@ -1,147 +0,0 @@
|
|||||||
/* OpenSceneGraph example, osgblenddrawbuffers.
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
* THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <osg/Geometry>
|
|
||||||
#include <osg/Geode>
|
|
||||||
#include <osg/Camera>
|
|
||||||
#include <osg/Texture2D>
|
|
||||||
#include <osg/BlendFunci>
|
|
||||||
#include <osg/ColorMaski>
|
|
||||||
#include <osg/Capability>
|
|
||||||
#include <osgDB/ReadFile>
|
|
||||||
#include <osgViewer/Viewer>
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
osg::Camera* createMRTCamera( std::vector<osg::Texture*>& attachedTextures )
|
|
||||||
{
|
|
||||||
osg::ref_ptr<osg::Camera> camera = new osg::Camera;
|
|
||||||
camera->setClearColor( osg::Vec4(0.0f, 0.0f, 0.0f, 1.0f) );
|
|
||||||
camera->setClearMask( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT );
|
|
||||||
camera->setRenderTargetImplementation( osg::Camera::FRAME_BUFFER_OBJECT );
|
|
||||||
camera->setRenderOrder( osg::Camera::PRE_RENDER );
|
|
||||||
|
|
||||||
for ( int i=0; i<4; ++i )
|
|
||||||
{
|
|
||||||
osg::Texture2D* tex = new osg::Texture2D;
|
|
||||||
tex->setTextureSize( 1024, 1024 );
|
|
||||||
tex->setInternalFormat( GL_RGBA );
|
|
||||||
tex->setFilter( osg::Texture2D::MIN_FILTER, osg::Texture2D::LINEAR );
|
|
||||||
tex->setFilter( osg::Texture2D::MAG_FILTER, osg::Texture2D::LINEAR );
|
|
||||||
attachedTextures.push_back( tex );
|
|
||||||
|
|
||||||
camera->setViewport( 0, 0, tex->getTextureWidth(), tex->getTextureHeight() );
|
|
||||||
camera->attach( osg::Camera::BufferComponent(osg::Camera::COLOR_BUFFER0+i), tex );
|
|
||||||
}
|
|
||||||
return camera.release();
|
|
||||||
}
|
|
||||||
|
|
||||||
osg::Camera* createHUDCamera( double left, double right, double bottom, double top )
|
|
||||||
{
|
|
||||||
osg::ref_ptr<osg::Camera> camera = new osg::Camera;
|
|
||||||
camera->setReferenceFrame( osg::Transform::ABSOLUTE_RF );
|
|
||||||
camera->setClearMask( GL_DEPTH_BUFFER_BIT );
|
|
||||||
camera->setRenderOrder( osg::Camera::POST_RENDER );
|
|
||||||
camera->setAllowEventFocus( false );
|
|
||||||
camera->setProjectionMatrix( osg::Matrix::ortho2D(left, right, bottom, top) );
|
|
||||||
camera->getOrCreateStateSet()->setMode( GL_LIGHTING, osg::StateAttribute::OFF );
|
|
||||||
return camera.release();
|
|
||||||
}
|
|
||||||
|
|
||||||
int main( int argc, char **argv )
|
|
||||||
{
|
|
||||||
osg::ArgumentParser arguments(&argc, argv);
|
|
||||||
arguments.getApplicationUsage()->setDescription(arguments.getApplicationName() + " is the example which demonstrates how to enable/disable blending on specified draw buffers in multi-rendering-target cases.");
|
|
||||||
|
|
||||||
std::vector<osg::Texture*> textures;
|
|
||||||
bool useGlobalBlending = false;
|
|
||||||
if ( arguments.read("--no-draw-buffers") ) useGlobalBlending = true;
|
|
||||||
|
|
||||||
// Create a camera to output multi-rendering-targets (MRT)
|
|
||||||
osg::Camera* mrtCam = createMRTCamera( textures );
|
|
||||||
mrtCam->addChild( osgDB::readNodeFile("cessna.osgt") );
|
|
||||||
|
|
||||||
// Create shader program to be used
|
|
||||||
const char* mrtFragmentCode = {
|
|
||||||
"void main() {\n"
|
|
||||||
" gl_FragData[0] = gl_Color * vec4(1.0, 1.0, 1.0, 0.7);\n"
|
|
||||||
" gl_FragData[1] = vec4(0.0, 1.0, 1.0, 0.0);\n"
|
|
||||||
" gl_FragData[2] = vec4(1.0, 0.0, 1.0, 0.3);\n"
|
|
||||||
" gl_FragData[3] = vec4(1.0, 1.0, 0.0, 1.0);\n"
|
|
||||||
"}\n"
|
|
||||||
};
|
|
||||||
osg::ref_ptr<osg::Program> program = new osg::Program;
|
|
||||||
program->addShader( new osg::Shader(osg::Shader::FRAGMENT, mrtFragmentCode) );
|
|
||||||
|
|
||||||
osg::StateSet* ss = mrtCam->getOrCreateStateSet();
|
|
||||||
ss->setAttributeAndModes( program.get() );
|
|
||||||
|
|
||||||
// Apply blending to the original scene in MRT
|
|
||||||
if ( !useGlobalBlending )
|
|
||||||
{
|
|
||||||
// Only enable blending on the first draw buffer so other three outputs are
|
|
||||||
// totally opaque, which is important for MRT cases
|
|
||||||
ss->setAttribute( new osg::Enablei(GL_BLEND, 0) );
|
|
||||||
ss->setAttribute( new osg::Disablei(GL_BLEND, 1) );
|
|
||||||
ss->setAttribute( new osg::Disablei(GL_BLEND, 2) );
|
|
||||||
ss->setAttribute( new osg::Disablei(GL_BLEND, 3) );
|
|
||||||
|
|
||||||
// Accept different blend/colormask attributes on multiple render targets
|
|
||||||
osg::ref_ptr<osg::BlendFunci> blend0 = new osg::BlendFunci(0, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
|
||||||
osg::ref_ptr<osg::ColorMaski> colormask3 = new osg::ColorMaski(3, false, true, false, true);
|
|
||||||
ss->setAttribute( blend0.get() );
|
|
||||||
ss->setAttributeAndModes( colormask3.get() );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// When separated blending is disabled, all rendering targets will be affected
|
|
||||||
// by its alpha channel and you will see each output blended with the background.
|
|
||||||
//
|
|
||||||
// This causes a big program in situations like deferred shading because we may
|
|
||||||
// have to save different scene data to MRT 'GBuffer', in which alpha channels are
|
|
||||||
// used to store certain attributes rather than opacity. These attributes can be
|
|
||||||
// reused in following post-processing steps.
|
|
||||||
//
|
|
||||||
// For such targets, alpha blending must be disabled; otherwise it will mess the
|
|
||||||
// output. That is why this example exists!
|
|
||||||
osg::ref_ptr<osg::BlendFunc> blend = new osg::BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
|
||||||
ss->setAttributeAndModes( blend.get() );
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create some quads to be shown on screen to contain the MRT result
|
|
||||||
osg::ref_ptr<osg::Geode> quad = new osg::Geode;
|
|
||||||
for ( unsigned int i=0; i<textures.size(); ++i )
|
|
||||||
{
|
|
||||||
osg::Geometry* geom = osg::createTexturedQuadGeometry(
|
|
||||||
osg::Vec3((float)i/(float)textures.size(), 0.0f, 0.0f),
|
|
||||||
osg::Vec3(1.0f/(float)textures.size()-0.01f,0.0f,0.0f), osg::Vec3(0.0f,1.0f,0.0f) );
|
|
||||||
geom->getOrCreateStateSet()->setTextureAttributeAndModes( 0, textures[i] );
|
|
||||||
quad->addDrawable( geom );
|
|
||||||
}
|
|
||||||
|
|
||||||
osg::Camera* hudCam = createHUDCamera( 0.0, 1.0, 0.0, 1.0 );
|
|
||||||
hudCam->addChild( quad.get() );
|
|
||||||
|
|
||||||
// Construct scene graph and viewer
|
|
||||||
osg::ref_ptr<osg::Group> root = new osg::Group;
|
|
||||||
root->addChild( mrtCam );
|
|
||||||
root->addChild( hudCam );
|
|
||||||
|
|
||||||
osgViewer::Viewer viewer;
|
|
||||||
viewer.setSceneData( root.get() );
|
|
||||||
return viewer.run();
|
|
||||||
}
|
|
||||||
@@ -104,7 +104,7 @@ bool TechniqueEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIAc
|
|||||||
_eq_index--;
|
_eq_index--;
|
||||||
if (_eq_index<0) _eq_index=_eq_nb-1;
|
if (_eq_index<0) _eq_index=_eq_nb-1;
|
||||||
_blendEq->setEquation(_equations[_eq_index]);
|
_blendEq->setEquation(_equations[_eq_index]);
|
||||||
std::cout<<"Equation name = "<<_equations_name[_eq_index]<<std::endl;
|
std::cout<<"Operation name = "<<_equations_name[_eq_index]<<std::endl;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -157,28 +157,6 @@ class CameraEventCallback : public osg::NodeCallback
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
struct TestDrawableUpdateCallback : public osg::Drawable::UpdateCallback
|
|
||||||
{
|
|
||||||
TestDrawableUpdateCallback(const std::string &message): _message(message) {}
|
|
||||||
|
|
||||||
virtual void update(osg::NodeVisitor*, osg::Drawable* drw) {
|
|
||||||
printf("%s\n", _message.c_str());
|
|
||||||
}
|
|
||||||
std::string _message;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct TestNodeUpdateCallback : public osg::NodeCallback
|
|
||||||
{
|
|
||||||
TestNodeUpdateCallback(const std::string &message): _message(message) {}
|
|
||||||
|
|
||||||
virtual void operator()(osg::Node* node, osg::NodeVisitor* nv) {
|
|
||||||
printf("%s\n", _message.c_str());
|
|
||||||
}
|
|
||||||
std::string _message;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
int main( int argc, char **argv )
|
int main( int argc, char **argv )
|
||||||
{
|
{
|
||||||
// use an ArgumentParser object to manage the program arguments.
|
// use an ArgumentParser object to manage the program arguments.
|
||||||
@@ -191,90 +169,31 @@ int main( int argc, char **argv )
|
|||||||
osgViewer::Viewer viewer;
|
osgViewer::Viewer viewer;
|
||||||
|
|
||||||
// load the nodes from the commandline arguments.
|
// load the nodes from the commandline arguments.
|
||||||
osg::ref_ptr<osg::Node> rootnode;
|
osg::Node* rootnode = osgDB::readNodeFiles(arguments);
|
||||||
|
|
||||||
if (arguments.read("--test"))
|
// if not loaded assume no arguments passed in, try use default mode instead.
|
||||||
|
if (!rootnode) rootnode = osgDB::readNodeFile("cow.osgt");
|
||||||
|
|
||||||
|
if (!rootnode)
|
||||||
{
|
{
|
||||||
osg::ref_ptr<osg::Group> root = new osg::Group();
|
osg::notify(osg::NOTICE)<<"Please specify a file on the command line"<<std::endl;
|
||||||
rootnode = root;
|
|
||||||
|
|
||||||
osg::Node *test1 = new osg::Node();
|
|
||||||
test1->setUpdateCallback(new TestNodeUpdateCallback("test1"));
|
|
||||||
root->addChild(test1);
|
|
||||||
|
|
||||||
osg::Drawable *test2 = new osg::Drawable();
|
|
||||||
test2->osg::Node::setUpdateCallback(new TestNodeUpdateCallback("test2"));
|
|
||||||
root->addChild(test2);
|
|
||||||
|
|
||||||
osg::Drawable *test3 = new osg::Drawable();
|
|
||||||
test3->setUpdateCallback(new TestDrawableUpdateCallback("test3"));
|
|
||||||
root->addChild(test3);
|
|
||||||
|
|
||||||
osg::Geode *test4 = new osg::Geode();
|
|
||||||
osg::Drawable *drawable1 = new osg::Drawable();
|
|
||||||
drawable1->osg::Node::setUpdateCallback(new TestNodeUpdateCallback("test4"));
|
|
||||||
test4->addDrawable(drawable1);
|
|
||||||
root->addChild(test4);
|
|
||||||
|
|
||||||
osg::Geode *test5 = new osg::Geode();
|
|
||||||
osg::Drawable *drawable2 = new osg::Drawable();
|
|
||||||
drawable2->setUpdateCallback(new TestDrawableUpdateCallback("test5"));
|
|
||||||
test5->addDrawable(drawable2);
|
|
||||||
root->addChild(test5);
|
|
||||||
|
|
||||||
osg::Geode *test6 = new osg::Geode();
|
|
||||||
osg::Drawable *drawable3 = new osg::Drawable();
|
|
||||||
drawable3->setUpdateCallback(new TestDrawableUpdateCallback("test6"));
|
|
||||||
test6->addChild(drawable3);
|
|
||||||
root->addChild(test6);
|
|
||||||
|
|
||||||
osg::Geode *test7 = new osg::Geode();
|
|
||||||
osg::Drawable *drawable4 = new osg::Drawable();
|
|
||||||
drawable4->osg::Node::setUpdateCallback(new TestNodeUpdateCallback("test7"));
|
|
||||||
test7->addChild(drawable4);
|
|
||||||
root->addChild(test7);
|
|
||||||
|
|
||||||
printf("Numchildren with updates %u\n", rootnode->getNumChildrenRequiringUpdateTraversal());
|
|
||||||
|
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
rootnode = osgDB::readNodeFiles(arguments);
|
|
||||||
|
|
||||||
// if not loaded assume no arguments passed in, try use default mode instead.
|
// run optimization over the scene graph
|
||||||
if (!rootnode) rootnode = osgDB::readNodeFile("cow.osgt");
|
osgUtil::Optimizer optimzer;
|
||||||
|
optimzer.optimize(rootnode);
|
||||||
|
|
||||||
if (!rootnode)
|
// insert all the callbacks
|
||||||
{
|
InsertCallbacksVisitor icv;
|
||||||
osg::notify(osg::NOTICE)<<"Please specify a file on the command line"<<std::endl;
|
rootnode->accept(icv);
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// run optimization over the scene graph
|
|
||||||
osgUtil::Optimizer optimzer;
|
|
||||||
optimzer.optimize(rootnode.get());
|
|
||||||
|
|
||||||
// insert all the callbacks
|
|
||||||
InsertCallbacksVisitor icv;
|
|
||||||
rootnode->accept(icv);
|
|
||||||
}
|
|
||||||
|
|
||||||
viewer.getCamera()->setUpdateCallback(new CameraUpdateCallback());
|
viewer.getCamera()->setUpdateCallback(new CameraUpdateCallback());
|
||||||
viewer.getCamera()->setEventCallback(new CameraEventCallback());
|
viewer.getCamera()->setEventCallback(new CameraEventCallback());
|
||||||
|
|
||||||
// set the scene to render
|
// set the scene to render
|
||||||
viewer.setSceneData(rootnode.get());
|
viewer.setSceneData(rootnode);
|
||||||
|
|
||||||
viewer.setCameraManipulator(new osgGA::TrackballManipulator);
|
return viewer.run();
|
||||||
|
|
||||||
viewer.realize();
|
|
||||||
|
|
||||||
while(!viewer.done())
|
|
||||||
{
|
|
||||||
OSG_NOTICE<<std::endl<<"New Frame"<<std::endl;
|
|
||||||
viewer.frame();
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -304,7 +304,7 @@ int main( int argc, char **argv )
|
|||||||
osgViewer::View* view = dynamic_cast<osgViewer::View*>(object.get());
|
osgViewer::View* view = dynamic_cast<osgViewer::View*>(object.get());
|
||||||
if (view)
|
if (view)
|
||||||
{
|
{
|
||||||
osg::notify(osg::NOTICE)<<"Read config file successfully"<<std::endl;
|
osg::notify(osg::NOTICE)<<"Read config file succesfully"<<std::endl;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1366,7 +1366,6 @@ class CompileStateCallback : public osg::Operation
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CompileStateCallback(GameEventHandler* eh):
|
CompileStateCallback(GameEventHandler* eh):
|
||||||
osg::Referenced(true),
|
|
||||||
osg::Operation("CompileStateCallback", false),
|
osg::Operation("CompileStateCallback", false),
|
||||||
_gameEventHandler(eh) {}
|
_gameEventHandler(eh) {}
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ osg::Node* decorate_with_clip_node(osg::Node* subgraph)
|
|||||||
rootnode->addChild(wireframe_subgraph);
|
rootnode->addChild(wireframe_subgraph);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// simple approach to adding a clipnode above a subgraph.
|
// simple approach to adding a clipnode above a subrgaph.
|
||||||
|
|
||||||
// create clipped part.
|
// create clipped part.
|
||||||
osg::ClipNode* clipped_subgraph = new osg::ClipNode;
|
osg::ClipNode* clipped_subgraph = new osg::ClipNode;
|
||||||
@@ -78,7 +78,7 @@ osg::Node* decorate_with_clip_node(osg::Node* subgraph)
|
|||||||
|
|
||||||
|
|
||||||
// more complex approach to managing ClipNode, allowing
|
// more complex approach to managing ClipNode, allowing
|
||||||
// ClipNode node to be transformed independently from the subgraph
|
// ClipNode node to be transformed independantly from the subgraph
|
||||||
// that it is clipping.
|
// that it is clipping.
|
||||||
|
|
||||||
osg::MatrixTransform* transform= new osg::MatrixTransform;
|
osg::MatrixTransform* transform= new osg::MatrixTransform;
|
||||||
@@ -126,7 +126,7 @@ int main( int argc, char **argv )
|
|||||||
|
|
||||||
if (!loadedModel)
|
if (!loadedModel)
|
||||||
{
|
{
|
||||||
osg::notify(osg::NOTICE)<<"Please specify a filename on the command line"<<std::endl;
|
osg::notify(osg::NOTICE)<<"Please specifiy a filename and the command line"<<std::endl;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,7 @@
|
|||||||
#include "broadcaster.h"
|
#include "broadcaster.h"
|
||||||
|
|
||||||
|
|
||||||
|
const unsigned int MAX_NUM_EVENTS = 10;
|
||||||
const unsigned int SWAP_BYTES_COMPARE = 0x12345678;
|
const unsigned int SWAP_BYTES_COMPARE = 0x12345678;
|
||||||
class CameraPacket {
|
class CameraPacket {
|
||||||
public:
|
public:
|
||||||
@@ -240,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=0; read1(&c); return c; }
|
inline char readChar() { char c; read1(&c); return c; }
|
||||||
inline unsigned char readUChar() { unsigned char c=0; read1((char*)&c); return c; }
|
inline unsigned char readUChar() { unsigned char c; read1((char*)&c); return c; }
|
||||||
inline short readShort() { short c=0; read2((char*)&c); return c; }
|
inline short readShort() { short c; read2((char*)&c); return c; }
|
||||||
inline unsigned short readUShort() { unsigned short c=0; read2((char*)&c); return c; }
|
inline unsigned short readUShort() { unsigned short c; read2((char*)&c); return c; }
|
||||||
inline int readInt() { int c=0; read4((char*)&c); return c; }
|
inline int readInt() { int c; read4((char*)&c); return c; }
|
||||||
inline unsigned int readUInt() { unsigned int c=0; read4((char*)&c); return c; }
|
inline unsigned int readUInt() { unsigned int c; read4((char*)&c); return c; }
|
||||||
inline float readFloat() { float c=0.0f; read4((char*)&c); return c; }
|
inline float readFloat() { float c; read4((char*)&c); return c; }
|
||||||
inline double readDouble() { double c=0.0; read8((char*)&c); return c; }
|
inline double readDouble() { double c; read8((char*)&c); return c; }
|
||||||
|
|
||||||
void write(const osg::FrameStamp& fs)
|
void write(const osg::FrameStamp& fs)
|
||||||
{
|
{
|
||||||
@@ -375,8 +376,7 @@ class DataConverter
|
|||||||
itr != cameraPacket._events.end();
|
itr != cameraPacket._events.end();
|
||||||
++itr)
|
++itr)
|
||||||
{
|
{
|
||||||
osgGA::GUIEventAdapter* event = (*itr)->asGUIEventAdapter();
|
write(*(*itr));
|
||||||
if (event) write(*event);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -614,7 +614,7 @@ int main( int argc, char **argv )
|
|||||||
|
|
||||||
osg::notify(osg::INFO)<<"Time to do cluster sync "<<osg::Timer::instance()->delta_m(startTick,endTick)<<std::endl;
|
osg::notify(osg::INFO)<<"Time to do cluster sync "<<osg::Timer::instance()->delta_m(startTick,endTick)<<std::endl;
|
||||||
|
|
||||||
// update the scene by traversing it with the update visitor which will
|
// update the scene by traversing it with the the update visitor which will
|
||||||
// call all node update callbacks and animations.
|
// call all node update callbacks and animations.
|
||||||
viewer.eventTraversal();
|
viewer.eventTraversal();
|
||||||
viewer.updateTraversal();
|
viewer.updateTraversal();
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ public:
|
|||||||
|
|
||||||
~PickHandler() {}
|
~PickHandler() {}
|
||||||
|
|
||||||
bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa)
|
bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa)
|
||||||
{
|
{
|
||||||
osgViewer::View* view = dynamic_cast<osgViewer::View*>(&aa);
|
osgViewer::View* view = dynamic_cast<osgViewer::View*>(&aa);
|
||||||
if (!view) return false;
|
if (!view) return false;
|
||||||
@@ -71,7 +71,7 @@ public:
|
|||||||
{
|
{
|
||||||
if (_mx==ea.getX() && _my==ea.getY())
|
if (_mx==ea.getX() && _my==ea.getY())
|
||||||
{
|
{
|
||||||
pick(view, ea);
|
pick(view, ea.getX(), ea.getY());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -81,13 +81,13 @@ public:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void pick(osgViewer::View* view, const osgGA::GUIEventAdapter& event)
|
void pick(osgViewer::View* view, float x, float y)
|
||||||
{
|
{
|
||||||
osg::Node* node = 0;
|
osg::Node* node = 0;
|
||||||
osg::Group* parent = 0;
|
osg::Group* parent = 0;
|
||||||
|
|
||||||
osgUtil::LineSegmentIntersector::Intersections intersections;
|
osgUtil::LineSegmentIntersector::Intersections intersections;
|
||||||
if (view->computeIntersections(event, intersections))
|
if (view->computeIntersections(x, y, intersections))
|
||||||
{
|
{
|
||||||
osgUtil::LineSegmentIntersector::Intersection intersection = *intersections.begin();
|
osgUtil::LineSegmentIntersector::Intersection intersection = *intersections.begin();
|
||||||
osg::NodePath& nodePath = intersection.nodePath;
|
osg::NodePath& nodePath = intersection.nodePath;
|
||||||
@@ -98,6 +98,7 @@ public:
|
|||||||
// now we try to decorate the hit node by the osgFX::Scribe to show that its been "picked"
|
// now we try to decorate the hit node by the osgFX::Scribe to show that its been "picked"
|
||||||
if (parent && node)
|
if (parent && node)
|
||||||
{
|
{
|
||||||
|
|
||||||
osgFX::Scribe* parentAsScribe = dynamic_cast<osgFX::Scribe*>(parent);
|
osgFX::Scribe* parentAsScribe = dynamic_cast<osgFX::Scribe*>(parent);
|
||||||
if (!parentAsScribe)
|
if (!parentAsScribe)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
SET(TARGET_SRC osgcomputeshaders.cpp)
|
|
||||||
SETUP_EXAMPLE(osgcomputeshaders)
|
|
||||||
@@ -1,92 +0,0 @@
|
|||||||
/* -*-c++-*- OpenSceneGraph example, osgcomputeshaders.
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
* THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Written by Wang Rui
|
|
||||||
// This example can work only if GL version is 4.3 or greater
|
|
||||||
|
|
||||||
#include <osg/Texture2D>
|
|
||||||
#include <osg/Geometry>
|
|
||||||
#include <osg/Geode>
|
|
||||||
#include <osgDB/ReadFile>
|
|
||||||
#include <osgGA/StateSetManipulator>
|
|
||||||
#include <osgViewer/Viewer>
|
|
||||||
#include <osgViewer/ViewerEventHandlers>
|
|
||||||
|
|
||||||
static const char* computeSrc = {
|
|
||||||
"#version 430\n"
|
|
||||||
"uniform float osg_FrameTime;\n"
|
|
||||||
"layout (r32f, binding =0) uniform image2D targetTex;\n"
|
|
||||||
"layout (local_size_x = 16, local_size_y = 16) in;\n"
|
|
||||||
"void main() {\n"
|
|
||||||
" ivec2 storePos = ivec2(gl_GlobalInvocationID.xy);\n"
|
|
||||||
" float coeffcient = 0.5*sin(float(gl_WorkGroupID.x + gl_WorkGroupID.y)*0.1 + osg_FrameTime);\n"
|
|
||||||
" coeffcient *= length(vec2(ivec2(gl_LocalInvocationID.xy) - ivec2(8)) / vec2(8.0));\n"
|
|
||||||
" imageStore(targetTex, storePos, vec4(1.0-coeffcient, 0.0, 0.0, 0.0));\n"
|
|
||||||
"}\n"
|
|
||||||
};
|
|
||||||
|
|
||||||
int main( int argc, char** argv )
|
|
||||||
{
|
|
||||||
osg::ArgumentParser arguments( &argc, argv );
|
|
||||||
|
|
||||||
// Create the texture as both the output of compute shader and the input of a normal quad
|
|
||||||
osg::ref_ptr<osg::Texture2D> tex2D = new osg::Texture2D;
|
|
||||||
tex2D->setTextureSize( 512, 512 );
|
|
||||||
tex2D->setFilter( osg::Texture2D::MIN_FILTER, osg::Texture2D::LINEAR );
|
|
||||||
tex2D->setFilter( osg::Texture2D::MAG_FILTER, osg::Texture2D::LINEAR );
|
|
||||||
tex2D->setInternalFormat( GL_R32F );
|
|
||||||
tex2D->setSourceFormat( GL_RED );
|
|
||||||
tex2D->setSourceType( GL_FLOAT );
|
|
||||||
tex2D->bindToImageUnit( 0, osg::Texture::WRITE_ONLY ); // So we can use 'image2D' in the compute shader
|
|
||||||
|
|
||||||
// The compute shader can't work with other kinds of shaders
|
|
||||||
// It also requires the work group numbers. Setting them to 0 will disable the compute shader
|
|
||||||
osg::ref_ptr<osg::Program> computeProg = new osg::Program;
|
|
||||||
computeProg->setComputeGroups( 512/16, 512/16, 1 );
|
|
||||||
computeProg->addShader( new osg::Shader(osg::Shader::COMPUTE, computeSrc) );
|
|
||||||
|
|
||||||
// Create a node for outputting to the texture.
|
|
||||||
// It is OK to have just an empty node here, but seems inbuilt uniforms like osg_FrameTime won't work then.
|
|
||||||
// TODO: maybe we can have a custom drawable which also will implement glMemoryBarrier?
|
|
||||||
osg::Node* sourceNode = osgDB::readNodeFile("axes.osgt");
|
|
||||||
if ( !sourceNode ) sourceNode = new osg::Node;
|
|
||||||
sourceNode->setDataVariance( osg::Object::DYNAMIC );
|
|
||||||
sourceNode->getOrCreateStateSet()->setAttributeAndModes( computeProg.get() );
|
|
||||||
sourceNode->getOrCreateStateSet()->addUniform( new osg::Uniform("targetTex", (int)0) );
|
|
||||||
sourceNode->getOrCreateStateSet()->setTextureAttributeAndModes( 0, tex2D.get() );
|
|
||||||
|
|
||||||
// Display the texture on a quad. We will also be able to operate on the data if reading back to CPU side
|
|
||||||
osg::Geometry* geom = osg::createTexturedQuadGeometry(
|
|
||||||
osg::Vec3(), osg::Vec3(1.0f,0.0f,0.0f), osg::Vec3(0.0f,0.0f,1.0f) );
|
|
||||||
osg::ref_ptr<osg::Geode> quad = new osg::Geode;
|
|
||||||
quad->addDrawable( geom );
|
|
||||||
quad->getOrCreateStateSet()->setMode( GL_LIGHTING, osg::StateAttribute::OFF );
|
|
||||||
quad->getOrCreateStateSet()->setTextureAttributeAndModes( 0, tex2D.get() );
|
|
||||||
|
|
||||||
// Create the scene graph and start the viewer
|
|
||||||
osg::ref_ptr<osg::Group> scene = new osg::Group;
|
|
||||||
scene->addChild( sourceNode );
|
|
||||||
scene->addChild( quad.get() );
|
|
||||||
|
|
||||||
osgViewer::Viewer viewer;
|
|
||||||
viewer.addEventHandler( new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()) );
|
|
||||||
viewer.addEventHandler( new osgViewer::StatsHandler );
|
|
||||||
viewer.addEventHandler( new osgViewer::WindowSizeHandler );
|
|
||||||
viewer.setSceneData( scene.get() );
|
|
||||||
return viewer.run();
|
|
||||||
}
|
|
||||||
@@ -211,7 +211,7 @@ int main( int argc, char **argv )
|
|||||||
|
|
||||||
// ------------- Start of copy specific code -------------------------------------------------------
|
// ------------- Start of copy specific code -------------------------------------------------------
|
||||||
|
|
||||||
// do a deep copy, using MyCopyOp to reveal whats going on under the hood,
|
// do a deep copy, using MyCopyOp to reveal whats going on under the good,
|
||||||
// in your own code you'd typically just use the basic osg::CopyOp something like
|
// in your own code you'd typically just use the basic osg::CopyOp something like
|
||||||
osg::ref_ptr<osg::Node> mycopy = dynamic_cast<osg::Node*>(rootnode->clone(osg::CopyOp::DEEP_COPY_ALL));
|
osg::ref_ptr<osg::Node> mycopy = dynamic_cast<osg::Node*>(rootnode->clone(osg::CopyOp::DEEP_COPY_ALL));
|
||||||
std::cout << "Doing a deep copy of scene graph"<<std::endl;
|
std::cout << "Doing a deep copy of scene graph"<<std::endl;
|
||||||
|
|||||||
@@ -119,5 +119,21 @@ int main(int argc, char *argv[])
|
|||||||
// create the windows and run the threads.
|
// create the windows and run the threads.
|
||||||
viewer.realize();
|
viewer.realize();
|
||||||
|
|
||||||
|
// now check to see if texture cube map is supported.
|
||||||
|
for(unsigned int contextID = 0;
|
||||||
|
contextID<osg::DisplaySettings::instance()->getMaxNumberOfGraphicsContexts();
|
||||||
|
++contextID)
|
||||||
|
{
|
||||||
|
osg::TextureCubeMap::Extensions* tcmExt = osg::TextureCubeMap::getExtensions(contextID,false);
|
||||||
|
if (tcmExt)
|
||||||
|
{
|
||||||
|
if (!tcmExt->isCubeMapSupported())
|
||||||
|
{
|
||||||
|
std::cout<<"Warning: texture_cube_map not supported by OpenGL drivers, unable to run application."<<std::endl;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return viewer.run();
|
return viewer.run();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,10 +113,10 @@ public:
|
|||||||
|
|
||||||
/** return a geometry that fills the constraint.
|
/** return a geometry that fills the constraint.
|
||||||
*/
|
*/
|
||||||
virtual deprecated_osg::Geometry * makeAreal( osg::Vec3Array *points);
|
virtual osg::Geometry * makeAreal( osg::Vec3Array *points);
|
||||||
|
|
||||||
/** or create a wall around the constraint area: */
|
/** or create a wall around the constraint area: */
|
||||||
virtual deprecated_osg::Geometry * makeWallGeometry( osg::Vec3Array *points) ;
|
virtual osg::Geometry * makeWallGeometry( osg::Vec3Array *points) ;
|
||||||
|
|
||||||
/** for basic purposes, you can call these routines to make simple fill in geometries */
|
/** for basic purposes, you can call these routines to make simple fill in geometries */
|
||||||
virtual osg::DrawArrays* makeWall(void ) const;
|
virtual osg::DrawArrays* makeWall(void ) const;
|
||||||
@@ -166,7 +166,7 @@ public:
|
|||||||
|
|
||||||
/** return a geometry that fills the constraint.
|
/** return a geometry that fills the constraint.
|
||||||
*/
|
*/
|
||||||
virtual deprecated_osg::Geometry *makeGeometry(const osg::Vec3Array *points) ;
|
virtual osg::Geometry *makeGeometry(const osg::Vec3Array *points) ;
|
||||||
|
|
||||||
/** return normals array - flat shaded */
|
/** return normals array - flat shaded */
|
||||||
osg::Vec3Array* getNormals(const osg::Vec3Array *points);
|
osg::Vec3Array* getNormals(const osg::Vec3Array *points);
|
||||||
@@ -203,7 +203,7 @@ public:
|
|||||||
{
|
{
|
||||||
// create pyramid geometry. Centre plus points around base
|
// create pyramid geometry. Centre plus points around base
|
||||||
const osg::Vec3Array *_line= dynamic_cast<const osg::Vec3Array*>(getVertexArray());
|
const osg::Vec3Array *_line= dynamic_cast<const osg::Vec3Array*>(getVertexArray());
|
||||||
deprecated_osg::Geometry *gm=new deprecated_osg::Geometry;
|
osg::Geometry *gm=new osg::Geometry;
|
||||||
osg::Vec3Array *pts=new osg::Vec3Array;
|
osg::Vec3Array *pts=new osg::Vec3Array;
|
||||||
osg::Vec3Array *norms=new osg::Vec3Array;
|
osg::Vec3Array *norms=new osg::Vec3Array;
|
||||||
osg::Vec2Array *tcoords=new osg::Vec2Array;
|
osg::Vec2Array *tcoords=new osg::Vec2Array;
|
||||||
@@ -219,7 +219,7 @@ public:
|
|||||||
norms->push_back(nrm);
|
norms->push_back(nrm);
|
||||||
}
|
}
|
||||||
|
|
||||||
gm->setNormalBinding(deprecated_osg::Geometry::BIND_PER_PRIMITIVE);
|
gm->setNormalBinding(osg::Geometry::BIND_PER_PRIMITIVE);
|
||||||
gm->setVertexArray(pts);
|
gm->setVertexArray(pts);
|
||||||
osg::StateSet *dstate= gm->getOrCreateStateSet( );
|
osg::StateSet *dstate= gm->getOrCreateStateSet( );
|
||||||
dstate->setMode( GL_LIGHTING, osg::StateAttribute::ON );
|
dstate->setMode( GL_LIGHTING, osg::StateAttribute::ON );
|
||||||
@@ -615,7 +615,7 @@ osg::Group *makedelaunay(const int ndcs)
|
|||||||
|
|
||||||
// Calculate the texture coordinates after triangulation as
|
// Calculate the texture coordinates after triangulation as
|
||||||
//the points may get disordered by the triangulate function
|
//the points may get disordered by the triangulate function
|
||||||
osg::ref_ptr<deprecated_osg::Geometry> gm=new deprecated_osg::Geometry;
|
osg::ref_ptr<osg::Geometry> gm=new osg::Geometry;
|
||||||
gm->setVertexArray(points); // points may have been modified in order by triangulation.
|
gm->setVertexArray(points); // points may have been modified in order by triangulation.
|
||||||
/** calculate texture coords for terrain points */
|
/** calculate texture coords for terrain points */
|
||||||
if (image) {
|
if (image) {
|
||||||
@@ -629,7 +629,7 @@ osg::Group *makedelaunay(const int ndcs)
|
|||||||
}
|
}
|
||||||
gm->addPrimitiveSet(trig->getTriangles());
|
gm->addPrimitiveSet(trig->getTriangles());
|
||||||
gm->setNormalArray(trig->getOutputNormalArray());
|
gm->setNormalArray(trig->getOutputNormalArray());
|
||||||
gm->setNormalBinding(deprecated_osg::Geometry::BIND_PER_PRIMITIVE);
|
gm->setNormalBinding(osg::Geometry::BIND_PER_PRIMITIVE);
|
||||||
geode->addDrawable(gm.get());
|
geode->addDrawable(gm.get());
|
||||||
if (ndcs>0) {
|
if (ndcs>0) {
|
||||||
for ( std::vector < pyramid* >::iterator itr=pyrlist.begin(); itr!=pyrlist.end(); itr++) {
|
for ( std::vector < pyramid* >::iterator itr=pyrlist.begin(); itr!=pyrlist.end(); itr++) {
|
||||||
@@ -836,7 +836,8 @@ osg::Geometry *WallConstraint::makeWallGeometry() const
|
|||||||
gm->setVertexArray(getWall(height));
|
gm->setVertexArray(getWall(height));
|
||||||
gm->addPrimitiveSet(makeWall());
|
gm->addPrimitiveSet(makeWall());
|
||||||
gm->setTexCoordArray(0,getWallTexcoords(height));
|
gm->setTexCoordArray(0,getWallTexcoords(height));
|
||||||
gm->setNormalArray(getWallNormals(), osg::Array::BIND_PER_VERTEX); // this creates normals to walls
|
gm->setNormalBinding(osg::Geometry::BIND_PER_VERTEX);
|
||||||
|
gm->setNormalArray(getWallNormals()); // this creates normals to walls
|
||||||
|
|
||||||
return gm.release();
|
return gm.release();
|
||||||
}
|
}
|
||||||
@@ -987,10 +988,10 @@ osg::DrawArrays * ArealConstraint::makeWall(void) const
|
|||||||
return (new osg::DrawArrays(osg::PrimitiveSet::QUAD_STRIP,0,2+2*_line->size()));
|
return (new osg::DrawArrays(osg::PrimitiveSet::QUAD_STRIP,0,2+2*_line->size()));
|
||||||
}
|
}
|
||||||
|
|
||||||
deprecated_osg::Geometry *ArealConstraint::makeWallGeometry( osg::Vec3Array *pt)
|
osg::Geometry *ArealConstraint::makeWallGeometry( osg::Vec3Array *pt)
|
||||||
{
|
{
|
||||||
osg::ref_ptr<deprecated_osg::Geometry> gm=new deprecated_osg::Geometry; // the wall
|
osg::ref_ptr<osg::Geometry> gm=new osg::Geometry; // the wall
|
||||||
osg::ref_ptr<deprecated_osg::Geometry> edges=new deprecated_osg::Geometry; // edges of bounds
|
osg::ref_ptr<osg::Geometry> edges=new osg::Geometry; // edges of bounds
|
||||||
edges->setVertexArray(pt);
|
edges->setVertexArray(pt);
|
||||||
osg::DrawElementsUInt *trgeom=getTriangles();
|
osg::DrawElementsUInt *trgeom=getTriangles();
|
||||||
edges->addPrimitiveSet(trgeom);
|
edges->addPrimitiveSet(trgeom);
|
||||||
@@ -1051,16 +1052,16 @@ deprecated_osg::Geometry *ArealConstraint::makeWallGeometry( osg::Vec3Array *pt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
deprecated_osg::Geometry * ArealConstraint::makeAreal( osg::Vec3Array *points)
|
osg::Geometry * ArealConstraint::makeAreal( osg::Vec3Array *points)
|
||||||
{
|
{
|
||||||
osg::ref_ptr<deprecated_osg::Geometry> gm; // the fill in area
|
osg::ref_ptr<osg::Geometry> gm; // the fill in area
|
||||||
if (_interiorTris.size()>0) {
|
if (_interiorTris.size()>0) {
|
||||||
gm =new deprecated_osg::Geometry; // the forest roof
|
gm =new osg::Geometry; // the forest roof
|
||||||
gm->setVertexArray(points);
|
gm->setVertexArray(points);
|
||||||
osg::DrawElementsUInt *trgeom=getTriangles();
|
osg::DrawElementsUInt *trgeom=getTriangles();
|
||||||
gm->addPrimitiveSet(trgeom);
|
gm->addPrimitiveSet(trgeom);
|
||||||
gm->setNormalArray(getCanopyNormals(points));
|
gm->setNormalArray(getCanopyNormals(points));
|
||||||
gm->setNormalBinding(deprecated_osg::Geometry::BIND_PER_PRIMITIVE);
|
gm->setNormalBinding(osg::Geometry::BIND_PER_PRIMITIVE);
|
||||||
gm->setTexCoordArray(0,getCanopyTexcoords(points));
|
gm->setTexCoordArray(0,getCanopyTexcoords(points));
|
||||||
osg::Image* image = osgDB::readImageFile(texture);
|
osg::Image* image = osgDB::readImageFile(texture);
|
||||||
if (image)
|
if (image)
|
||||||
@@ -1232,9 +1233,9 @@ osg::Vec3Array * LinearConstraint::getNormals(const osg::Vec3Array *points)
|
|||||||
return norms.release();
|
return norms.release();
|
||||||
}
|
}
|
||||||
|
|
||||||
deprecated_osg::Geometry * LinearConstraint::makeGeometry(const osg::Vec3Array *points)
|
osg::Geometry * LinearConstraint::makeGeometry(const osg::Vec3Array *points)
|
||||||
{
|
{
|
||||||
osg::ref_ptr<deprecated_osg::Geometry> gm=new deprecated_osg::Geometry; // the fill in road/railway
|
osg::ref_ptr<osg::Geometry> gm=new osg::Geometry; // the fill in road/railway
|
||||||
if (_midline->size()>0) {
|
if (_midline->size()>0) {
|
||||||
osg::ref_ptr<osg::Vec3Array> locpts=getPoints(points);
|
osg::ref_ptr<osg::Vec3Array> locpts=getPoints(points);
|
||||||
if (texture!="") {
|
if (texture!="") {
|
||||||
@@ -1257,7 +1258,7 @@ deprecated_osg::Geometry * LinearConstraint::makeGeometry(const osg::Vec3Array *
|
|||||||
}
|
}
|
||||||
gm->setVertexArray(locpts.get());
|
gm->setVertexArray(locpts.get());
|
||||||
gm->setNormalArray(getNormals(locpts.get()));
|
gm->setNormalArray(getNormals(locpts.get()));
|
||||||
gm->setNormalBinding(deprecated_osg::Geometry::BIND_PER_PRIMITIVE);
|
gm->setNormalBinding(osg::Geometry::BIND_PER_PRIMITIVE);
|
||||||
gm->addPrimitiveSet(getTriangles());
|
gm->addPrimitiveSet(getTriangles());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,8 @@ osg::Node* createScene()
|
|||||||
{
|
{
|
||||||
osg::Vec4Array * colours = new osg::Vec4Array(1);
|
osg::Vec4Array * colours = new osg::Vec4Array(1);
|
||||||
(*colours)[0] = osg::Vec4d(1.0,1.0,1.0,1.0);
|
(*colours)[0] = osg::Vec4d(1.0,1.0,1.0,1.0);
|
||||||
unitCircle->setColorArray(colours, osg::Array::BIND_OVERALL);
|
unitCircle->setColorArray(colours);
|
||||||
|
unitCircle->setColorBinding(osg::Geometry::BIND_OVERALL);
|
||||||
const unsigned int n_points = 1024;
|
const unsigned int n_points = 1024;
|
||||||
osg::Vec3Array * coords = new osg::Vec3Array(n_points);
|
osg::Vec3Array * coords = new osg::Vec3Array(n_points);
|
||||||
const double dx = 2.0*osg::PI/n_points;
|
const double dx = 2.0*osg::PI/n_points;
|
||||||
@@ -87,7 +88,8 @@ osg::Node* createScene()
|
|||||||
{
|
{
|
||||||
osg::Vec4Array *colours = new osg::Vec4Array(1);
|
osg::Vec4Array *colours = new osg::Vec4Array(1);
|
||||||
(*colours)[0] = osg::Vec4d(1.0,0.0,0.0,1.0);
|
(*colours)[0] = osg::Vec4d(1.0,0.0,0.0,1.0);
|
||||||
axes->setColorArray(colours, osg::Array::BIND_OVERALL);
|
axes->setColorArray(colours);
|
||||||
|
axes->setColorBinding(osg::Geometry::BIND_OVERALL);
|
||||||
osg::Vec3Array *coords = new osg::Vec3Array(6);
|
osg::Vec3Array *coords = new osg::Vec3Array(6);
|
||||||
(*coords)[0].set(osg::Vec3d(0.0, 0.0, 0.0));
|
(*coords)[0].set(osg::Vec3d(0.0, 0.0, 0.0));
|
||||||
(*coords)[1].set(osg::Vec3d(0.5, 0.0, 0.0));
|
(*coords)[1].set(osg::Vec3d(0.5, 0.0, 0.0));
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user