From 877a32c3eb90515701a52c373fec2bc8c5aaeddf Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 10 Jan 2007 21:05:26 +0000 Subject: [PATCH] Ported following examples to osgViewer: osgshaders osgshaderterrain osgshadow osgshadowtexture --- VisualStudio/OpenSceneGraph.dsw | 8 +- .../examples/osgshaders/osgshaders.dsp | 8 +- .../osgshaderterrain/osgshaderterrain.dsp | 8 +- .../examples/osgshadow/example_osgshadow.dsp | 8 +- .../osgshadowtexture/osgshadowtexture.dsp | 8 +- examples/osgshaders/GNUmakefile | 2 +- examples/osgshaders/GNUmakefile.inst | 5 +- examples/osgshaders/osgshaders.cpp | 53 ++---------- examples/osgshaderterrain/GNUmakefile | 2 +- examples/osgshaderterrain/GNUmakefile.inst | 9 +-- .../osgshaderterrain/osgshaderterrain.cpp | 74 ++++------------- examples/osgshadow/GNUmakefile | 2 +- examples/osgshadow/GNUmakefile.inst | 5 +- examples/osgshadow/osgshadow.cpp | 46 ++++------- examples/osgshadowtexture/GNUmakefile | 2 +- examples/osgshadowtexture/GNUmakefile.inst | 5 +- .../osgshadowtexture/osgshadowtexture.cpp | 81 ++----------------- 17 files changed, 72 insertions(+), 254 deletions(-) diff --git a/VisualStudio/OpenSceneGraph.dsw b/VisualStudio/OpenSceneGraph.dsw index 464e3268a..ec6e7096c 100644 --- a/VisualStudio/OpenSceneGraph.dsw +++ b/VisualStudio/OpenSceneGraph.dsw @@ -1851,7 +1851,7 @@ Package=<4> Project_Dep_Name Core osgText End Project Dependency Begin Project Dependency - Project_Dep_Name Core osgProducer + Project_Dep_Name Core osgViewer End Project Dependency Begin Project Dependency Project_Dep_Name Core osgUtil @@ -1878,7 +1878,7 @@ Package=<4> Project_Dep_Name Core osgGA End Project Dependency Begin Project Dependency - Project_Dep_Name Core osgProducer + Project_Dep_Name Core osgViewer End Project Dependency Begin Project Dependency Project_Dep_Name Core osgUtil @@ -1905,7 +1905,7 @@ Package=<4> Project_Dep_Name Core osgGA End Project Dependency Begin Project Dependency - Project_Dep_Name Core osgProducer + Project_Dep_Name Core osgViewer End Project Dependency Begin Project Dependency Project_Dep_Name Core osgUtil @@ -1932,7 +1932,7 @@ Package=<4> Project_Dep_Name Core osgGA End Project Dependency Begin Project Dependency - Project_Dep_Name Core osgProducer + Project_Dep_Name Core osgViewer End Project Dependency Begin Project Dependency Project_Dep_Name Core osgUtil diff --git a/VisualStudio/examples/osgshaders/osgshaders.dsp b/VisualStudio/examples/osgshaders/osgshaders.dsp index c6198f13f..59ae422d3 100644 --- a/VisualStudio/examples/osgshaders/osgshaders.dsp +++ b/VisualStudio/examples/osgshaders/osgshaders.dsp @@ -43,7 +43,7 @@ RSC=rc.exe # PROP Target_Dir "" MTL=midl.exe # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GR /GX /O2 /I "../../../include" /I "../../../../OpenThreads/include" /I "../../../../Producer/include" /I "../../../../3rdParty/include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_CRT_SECURE_NO_DEPRECATE" /YX /FD /Zm200 /c +# ADD CPP /nologo /MD /W3 /GR /GX /O2 /I "../../../include" /I "../../../../OpenThreads/include" /I "../../../../3rdParty/include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_CRT_SECURE_NO_DEPRECATE" /YX /FD /Zm200 /c # ADD BASE RSC /l 0x809 /d "NDEBUG" # ADD RSC /l 0x809 /d "NDEBUG" BSC32=bscmake.exe @@ -51,7 +51,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 OpenThreadsWin32.lib opengl32.lib /nologo /subsystem:console /debug /machine:I386 /opt:ref /opt:icf /out:"$(OutDir)/osgshaders.exe" /libpath:"../../../lib/$(PlatformName)" /libpath:"../../../../OpenThreads/lib/$(PlatformName)" /libpath:"../../../../Producer/lib/$(PlatformName)" /libpath:"../../../../3rdParty/lib/$(PlatformName)" /libpath:"../../../../3rdParty/lib" +# ADD LINK32 OpenThreadsWin32.lib opengl32.lib /nologo /subsystem:console /debug /machine:I386 /opt:ref /opt:icf /out:"$(OutDir)/osgshaders.exe" /libpath:"../../../lib/$(PlatformName)" /libpath:"../../../../OpenThreads/lib/$(PlatformName)" /libpath:"../../../../3rdParty/lib/$(PlatformName)" /libpath:"../../../../3rdParty/lib" !ELSEIF "$(CFG)" == "Example osgshaders - Win32 Debug" @@ -68,7 +68,7 @@ LINK32=link.exe # PROP Target_Dir "" MTL=midl.exe # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GR /GX /Zi /Od /I "../../../include" /I "../../../../OpenThreads/include" /I "../../../../Producer/include" /I "../../../../3rdParty/include" /D "_CONSOLE" /D "_MBCS" /D "FL_DLL" /D "WIN32" /D "_DEBUG" /D "_CRT_SECURE_NO_DEPRECATE" /FR /YX /FD /Zm200 /c +# ADD CPP /nologo /MDd /W3 /Gm /GR /GX /Zi /Od /I "../../../include" /I "../../../../OpenThreads/include" /I "../../../../3rdParty/include" /D "_CONSOLE" /D "_MBCS" /D "FL_DLL" /D "WIN32" /D "_DEBUG" /D "_CRT_SECURE_NO_DEPRECATE" /FR /YX /FD /Zm200 /c # ADD BASE RSC /l 0x809 /d "_DEBUG" # ADD RSC /l 0x809 /d "_DEBUG" BSC32=bscmake.exe @@ -76,7 +76,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 OpenThreadsWin32d.lib opengl32.lib /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"libcmt" /out:"$(OutDir)/osgshadersd.exe" /pdbtype:sept /libpath:"../../../lib/$(PlatformName)" /libpath:"../../../../OpenThreads/lib/$(PlatformName)" /libpath:"../../../../Producer/lib/$(PlatformName)" /libpath:"../../../../3rdParty/lib/$(PlatformName)" /libpath:"../../../../3rdParty/lib" +# ADD LINK32 OpenThreadsWin32d.lib opengl32.lib /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"libcmt" /out:"$(OutDir)/osgshadersd.exe" /pdbtype:sept /libpath:"../../../lib/$(PlatformName)" /libpath:"../../../../OpenThreads/lib/$(PlatformName)" /libpath:"../../../../3rdParty/lib/$(PlatformName)" /libpath:"../../../../3rdParty/lib" # SUBTRACT LINK32 /incremental:no !ENDIF diff --git a/VisualStudio/examples/osgshaderterrain/osgshaderterrain.dsp b/VisualStudio/examples/osgshaderterrain/osgshaderterrain.dsp index 40322aefe..ba1eb2d15 100644 --- a/VisualStudio/examples/osgshaderterrain/osgshaderterrain.dsp +++ b/VisualStudio/examples/osgshaderterrain/osgshaderterrain.dsp @@ -43,7 +43,7 @@ RSC=rc.exe # PROP Target_Dir "" MTL=midl.exe # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GR /GX /O2 /I "../../../include" /I "../../../../OpenThreads/include" /I "../../../../Producer/include" /I "../../../../3rdParty/include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_CRT_SECURE_NO_DEPRECATE" /YX /FD /Zm200 /c +# ADD CPP /nologo /MD /W3 /GR /GX /O2 /I "../../../include" /I "../../../../OpenThreads/include" /I "../../../../3rdParty/include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_CRT_SECURE_NO_DEPRECATE" /YX /FD /Zm200 /c # ADD BASE RSC /l 0x809 /d "NDEBUG" # ADD RSC /l 0x809 /d "NDEBUG" BSC32=bscmake.exe @@ -51,7 +51,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 OpenThreadsWin32.lib opengl32.lib /nologo /subsystem:console /debug /machine:I386 /opt:ref /opt:icf /out:"$(OutDir)/osgshaderterrain.exe" /libpath:"../../../lib/$(PlatformName)" /libpath:"../../../../OpenThreads/lib/$(PlatformName)" /libpath:"../../../../Producer/lib/$(PlatformName)" /libpath:"../../../../3rdParty/lib/$(PlatformName)" /libpath:"../../../../3rdParty/lib" +# ADD LINK32 OpenThreadsWin32.lib opengl32.lib /nologo /subsystem:console /debug /machine:I386 /opt:ref /opt:icf /out:"$(OutDir)/osgshaderterrain.exe" /libpath:"../../../lib/$(PlatformName)" /libpath:"../../../../OpenThreads/lib/$(PlatformName)" /libpath:"../../../../3rdParty/lib/$(PlatformName)" /libpath:"../../../../3rdParty/lib" !ELSEIF "$(CFG)" == "Example osgshaderterrain - Win32 Debug" @@ -68,7 +68,7 @@ LINK32=link.exe # PROP Target_Dir "" MTL=midl.exe # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GR /GX /Zi /Od /I "../../../include" /I "../../../../OpenThreads/include" /I "../../../../Producer/include" /I "../../../../3rdParty/include" /D "_CONSOLE" /D "_MBCS" /D "FL_DLL" /D "WIN32" /D "_DEBUG" /D "_CRT_SECURE_NO_DEPRECATE" /FR /YX /FD /Zm200 /c +# ADD CPP /nologo /MDd /W3 /Gm /GR /GX /Zi /Od /I "../../../include" /I "../../../../OpenThreads/include" /I "../../../../3rdParty/include" /D "_CONSOLE" /D "_MBCS" /D "FL_DLL" /D "WIN32" /D "_DEBUG" /D "_CRT_SECURE_NO_DEPRECATE" /FR /YX /FD /Zm200 /c # ADD BASE RSC /l 0x809 /d "_DEBUG" # ADD RSC /l 0x809 /d "_DEBUG" BSC32=bscmake.exe @@ -76,7 +76,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 OpenThreadsWin32d.lib glu32.lib opengl32.lib /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"libcmt" /out:"$(OutDir)/osgshaderterraind.exe" /pdbtype:sept /libpath:"../../../lib/$(PlatformName)" /libpath:"../../../../OpenThreads/lib/$(PlatformName)" /libpath:"../../../../Producer/lib/$(PlatformName)" /libpath:"../../../../3rdParty/lib/$(PlatformName)" /libpath:"../../../../3rdParty/lib" +# ADD LINK32 OpenThreadsWin32d.lib glu32.lib opengl32.lib /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"libcmt" /out:"$(OutDir)/osgshaderterraind.exe" /pdbtype:sept /libpath:"../../../lib/$(PlatformName)" /libpath:"../../../../OpenThreads/lib/$(PlatformName)" /libpath:"../../../../3rdParty/lib/$(PlatformName)" /libpath:"../../../../3rdParty/lib" # SUBTRACT LINK32 /incremental:no !ENDIF diff --git a/VisualStudio/examples/osgshadow/example_osgshadow.dsp b/VisualStudio/examples/osgshadow/example_osgshadow.dsp index a2625c944..7d340f95f 100644 --- a/VisualStudio/examples/osgshadow/example_osgshadow.dsp +++ b/VisualStudio/examples/osgshadow/example_osgshadow.dsp @@ -43,7 +43,7 @@ RSC=rc.exe # PROP Target_Dir "" MTL=midl.exe # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GR /GX /O2 /I "../../../include" /I "../../../../OpenThreads/include" /I "../../../../Producer/include" /I "../../../../3rdParty/include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_CRT_SECURE_NO_DEPRECATE" /YX /FD /Zm200 /c +# ADD CPP /nologo /MD /W3 /GR /GX /O2 /I "../../../include" /I "../../../../OpenThreads/include" /I "../../../../3rdParty/include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_CRT_SECURE_NO_DEPRECATE" /YX /FD /Zm200 /c # ADD BASE RSC /l 0x809 /d "NDEBUG" # ADD RSC /l 0x809 /d "NDEBUG" BSC32=bscmake.exe @@ -51,7 +51,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 OpenThreadsWin32.lib opengl32.lib /nologo /subsystem:console /debug /machine:I386 /opt:ref /opt:icf /out:"$(OutDir)/osgshadow.exe" /libpath:"../../../lib/$(PlatformName)" /libpath:"../../../../OpenThreads/lib/$(PlatformName)" /libpath:"../../../../Producer/lib/$(PlatformName)" /libpath:"../../../../3rdParty/lib/$(PlatformName)" /libpath:"../../../../3rdParty/lib" +# ADD LINK32 OpenThreadsWin32.lib opengl32.lib /nologo /subsystem:console /debug /machine:I386 /opt:ref /opt:icf /out:"$(OutDir)/osgshadow.exe" /libpath:"../../../lib/$(PlatformName)" /libpath:"../../../../OpenThreads/lib/$(PlatformName)" /libpath:"../../../../3rdParty/lib/$(PlatformName)" /libpath:"../../../../3rdParty/lib" !ELSEIF "$(CFG)" == "Example osgshadow - Win32 Debug" @@ -68,7 +68,7 @@ LINK32=link.exe # PROP Target_Dir "" MTL=midl.exe # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GR /GX /Zi /Od /I "../../../include" /I "../../../../OpenThreads/include" /I "../../../../Producer/include" /I "../../../../3rdParty/include" /D "_CONSOLE" /D "_MBCS" /D "FL_DLL" /D "WIN32" /D "_DEBUG" /D "_CRT_SECURE_NO_DEPRECATE" /YX /FD /Zm200 /c +# ADD CPP /nologo /MDd /W3 /Gm /GR /GX /Zi /Od /I "../../../include" /I "../../../../OpenThreads/include" /I "../../../../3rdParty/include" /D "_CONSOLE" /D "_MBCS" /D "FL_DLL" /D "WIN32" /D "_DEBUG" /D "_CRT_SECURE_NO_DEPRECATE" /YX /FD /Zm200 /c # SUBTRACT CPP /Fr # ADD BASE RSC /l 0x809 /d "_DEBUG" # ADD RSC /l 0x809 /d "_DEBUG" @@ -77,7 +77,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 OpenThreadsWin32d.lib opengl32.lib /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"libcmt" /out:"$(OutDir)/osgshadowd.exe" /pdbtype:sept /libpath:"../../../lib/$(PlatformName)" /libpath:"../../../../OpenThreads/lib/$(PlatformName)" /libpath:"../../../../Producer/lib/$(PlatformName)" /libpath:"../../../../3rdParty/lib/$(PlatformName)" /libpath:"../../../../3rdParty/lib" +# ADD LINK32 OpenThreadsWin32d.lib opengl32.lib /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"libcmt" /out:"$(OutDir)/osgshadowd.exe" /pdbtype:sept /libpath:"../../../lib/$(PlatformName)" /libpath:"../../../../OpenThreads/lib/$(PlatformName)" /libpath:"../../../../3rdParty/lib/$(PlatformName)" /libpath:"../../../../3rdParty/lib" # SUBTRACT LINK32 /incremental:no !ENDIF diff --git a/VisualStudio/examples/osgshadowtexture/osgshadowtexture.dsp b/VisualStudio/examples/osgshadowtexture/osgshadowtexture.dsp index fe874426b..8b3b6c357 100644 --- a/VisualStudio/examples/osgshadowtexture/osgshadowtexture.dsp +++ b/VisualStudio/examples/osgshadowtexture/osgshadowtexture.dsp @@ -43,7 +43,7 @@ RSC=rc.exe # PROP Target_Dir "" MTL=midl.exe # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GR /GX /O2 /I "../../../include" /I "../../../../OpenThreads/include" /I "../../../../Producer/include" /I "../../../../3rdParty/include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_CRT_SECURE_NO_DEPRECATE" /YX /FD /Zm200 /c +# ADD CPP /nologo /MD /W3 /GR /GX /O2 /I "../../../include" /I "../../../../OpenThreads/include" /I "../../../../3rdParty/include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_CRT_SECURE_NO_DEPRECATE" /YX /FD /Zm200 /c # ADD BASE RSC /l 0x809 /d "NDEBUG" # ADD RSC /l 0x809 /d "NDEBUG" BSC32=bscmake.exe @@ -51,7 +51,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 OpenThreadsWin32.lib opengl32.lib /nologo /subsystem:console /debug /machine:I386 /opt:ref /opt:icf /out:"$(OutDir)/osgshadowtexture.exe" /libpath:"../../../lib/$(PlatformName)" /libpath:"../../../../OpenThreads/lib/$(PlatformName)" /libpath:"../../../../Producer/lib/$(PlatformName)" /libpath:"../../../../3rdParty/lib/$(PlatformName)" /libpath:"../../../../3rdParty/lib" +# ADD LINK32 OpenThreadsWin32.lib opengl32.lib /nologo /subsystem:console /debug /machine:I386 /opt:ref /opt:icf /out:"$(OutDir)/osgshadowtexture.exe" /libpath:"../../../lib/$(PlatformName)" /libpath:"../../../../OpenThreads/lib/$(PlatformName)" /libpath:"../../../../3rdParty/lib/$(PlatformName)" /libpath:"../../../../3rdParty/lib" !ELSEIF "$(CFG)" == "Example osgshadowtexture - Win32 Debug" @@ -68,7 +68,7 @@ LINK32=link.exe # PROP Target_Dir "" MTL=midl.exe # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GR /GX /Zi /Od /I "../../../include" /I "../../../../OpenThreads/include" /I "../../../../Producer/include" /I "../../../../3rdParty/include" /D "_CONSOLE" /D "_MBCS" /D "FL_DLL" /D "WIN32" /D "_DEBUG" /D "_CRT_SECURE_NO_DEPRECATE" /YX /FD /Zm200 /c +# ADD CPP /nologo /MDd /W3 /Gm /GR /GX /Zi /Od /I "../../../include" /I "../../../../OpenThreads/include" /I "../../../../3rdParty/include" /D "_CONSOLE" /D "_MBCS" /D "FL_DLL" /D "WIN32" /D "_DEBUG" /D "_CRT_SECURE_NO_DEPRECATE" /YX /FD /Zm200 /c # ADD BASE RSC /l 0x809 /d "_DEBUG" # ADD RSC /l 0x809 /d "_DEBUG" BSC32=bscmake.exe @@ -76,7 +76,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 OpenThreadsWin32d.lib opengl32.lib /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"libcmt" /out:"$(OutDir)/osgshadowtextured.exe" /pdbtype:sept /libpath:"../../../lib/$(PlatformName)" /libpath:"../../../../OpenThreads/lib/$(PlatformName)" /libpath:"../../../../Producer/lib/$(PlatformName)" /libpath:"../../../../3rdParty/lib/$(PlatformName)" /libpath:"../../../../3rdParty/lib" +# ADD LINK32 OpenThreadsWin32d.lib opengl32.lib /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"libcmt" /out:"$(OutDir)/osgshadowtextured.exe" /pdbtype:sept /libpath:"../../../lib/$(PlatformName)" /libpath:"../../../../OpenThreads/lib/$(PlatformName)" /libpath:"../../../../3rdParty/lib/$(PlatformName)" /libpath:"../../../../3rdParty/lib" # SUBTRACT LINK32 /incremental:no !ENDIF diff --git a/examples/osgshaders/GNUmakefile b/examples/osgshaders/GNUmakefile index 275835997..8cafe4142 100644 --- a/examples/osgshaders/GNUmakefile +++ b/examples/osgshaders/GNUmakefile @@ -6,7 +6,7 @@ CXXFILES =\ Noise.cpp \ osgshaders.cpp -LIBS += -losgProducer -lProducer -losgText -losgGA -losgDB -losgUtil -losg $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS) +LIBS += -losgViewer -losgText -losgGA -losgDB -losgUtil -losg $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS) INSTFILES = \ $(CXXFILES)\ diff --git a/examples/osgshaders/GNUmakefile.inst b/examples/osgshaders/GNUmakefile.inst index b8ad0782f..6e3037f67 100644 --- a/examples/osgshaders/GNUmakefile.inst +++ b/examples/osgshaders/GNUmakefile.inst @@ -5,11 +5,8 @@ CXXFILES =\ GL2Scene.cpp \ osgshaders.cpp -LIBS += -losgProducer -lProducer -losgDB -losgText -losgUtil -losg $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS) +LIBS += -losgViewer -losgDB -losgText -losgUtil -losg $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS) EXEC = osgshaders -INC += $(PRODUCER_INCLUDE_DIR) $(X_INC) -LDFLAGS += $(PRODUCER_LIB_DIR) - include $(TOPDIR)/Make/makerules diff --git a/examples/osgshaders/osgshaders.cpp b/examples/osgshaders/osgshaders.cpp index 91b8b03f3..547c11fee 100644 --- a/examples/osgshaders/osgshaders.cpp +++ b/examples/osgshaders/osgshaders.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include "GL2Scene.h" @@ -62,62 +62,19 @@ class KeyHandler: public osgGA::GUIEventHandler /////////////////////////////////////////////////////////////////////////// -int main( int argc, char **argv ) +int main(int, char **) { - // use an ArgumentParser object to manage the program arguments. - osg::ArgumentParser args(&argc,argv); - - // set up the usage document - args.getApplicationUsage()->setApplicationName(args.getApplicationName()); - args.getApplicationUsage()->setDescription(args.getApplicationName() + - " demonstrates the OpenGL Shading Language using core OSG"); - args.getApplicationUsage()->setCommandLineUsage(args.getApplicationName()); - args.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information"); - - args.getApplicationUsage()->addKeyboardMouseBinding( "x", "Reload and recompile shader source files." ); - args.getApplicationUsage()->addKeyboardMouseBinding( "y", "Toggle shader enable" ); - // construct the viewer. - osgProducer::Viewer viewer(args); - viewer.setUpViewer( osgProducer::Viewer::STANDARD_SETTINGS ); - viewer.getUsage( *args.getApplicationUsage() ); - - if( args.read("-h") || args.read("--help") ) - { - args.getApplicationUsage()->write(std::cout); - return 1; - } - - // any option left unread are converted into errors to write out later. - args.reportRemainingOptionsAsUnrecognized(); - if( args.errors() ) - { - args.writeErrorMessages(std::cout); - return 1; - } + osgViewer::Viewer viewer; // create the scene GL2ScenePtr gl2Scene = new GL2Scene; viewer.setSceneData( gl2Scene->getRootNode().get() ); - viewer.getEventHandlerList().push_front( new KeyHandler(gl2Scene) ); - viewer.realize(); - while( !viewer.done() ) - { - viewer.sync(); - viewer.update(); - viewer.frame(); - } - - // wait for all cull and draw threads to complete. - viewer.sync(); - // run a clean up frame to delete all OpenGL objects. - viewer.cleanup_frame(); + viewer.addEventHandler( new KeyHandler(gl2Scene) ); - // wait for all the clean up frame to complete. - viewer.sync(); - return 0; + return viewer.run(); } /*EOF*/ diff --git a/examples/osgshaderterrain/GNUmakefile b/examples/osgshaderterrain/GNUmakefile index a58445cdd..d9fcaeb63 100644 --- a/examples/osgshaderterrain/GNUmakefile +++ b/examples/osgshaderterrain/GNUmakefile @@ -4,7 +4,7 @@ include $(TOPDIR)/Make/makedefs CXXFILES =\ osgshaderterrain.cpp\ -LIBS += -losgProducer -lProducer -losgText -losgGA -losgDB -losgUtil -losg $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS) +LIBS += -losgViewer -losgText -losgGA -losgDB -losgUtil -losg $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS) INSTFILES = \ $(CXXFILES)\ diff --git a/examples/osgshaderterrain/GNUmakefile.inst b/examples/osgshaderterrain/GNUmakefile.inst index 035a78152..c174cdd6f 100644 --- a/examples/osgshaderterrain/GNUmakefile.inst +++ b/examples/osgshaderterrain/GNUmakefile.inst @@ -2,13 +2,10 @@ TOPDIR = ../.. include $(TOPDIR)/Make/makedefs CXXFILES =\ - osgforest.cpp\ + osgshaderterrain.cpp\ -LIBS += -losgProducer -lProducer -losgText -losgDB -losgUtil -losg $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS) +LIBS += -losgViewer -losgText -losgDB -losgUtil -losg $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS) -EXEC = osgforest - -INC += $(PRODUCER_INCLUDE_DIR) $(X_INC) -LDFLAGS += $(PRODUCER_LIB_DIR) +EXEC = osgshaderterrain include $(TOPDIR)/Make/makerules diff --git a/examples/osgshaderterrain/osgshaderterrain.cpp b/examples/osgshaderterrain/osgshaderterrain.cpp index b6ea65d88..d8f756e7c 100644 --- a/examples/osgshaderterrain/osgshaderterrain.cpp +++ b/examples/osgshaderterrain/osgshaderterrain.cpp @@ -26,7 +26,9 @@ #include -#include +#include + +#include // for the grid data.. #include "../osghangglide/terrain_coords.h" @@ -122,7 +124,7 @@ osg::Node* createScene() osg::Program* program = new osg::Program; stateset->setAttribute(program); -#if 0 +#if 1 // use inline shaders /////////////////////////////////////////////////////////////////// @@ -141,7 +143,7 @@ osg::Node* createScene() " texcoord.x *= terrainScaleDown.x;\n" " texcoord.y *= terrainScaleDown.y;\n" "\n" - " vec4 position;\n"ttm-> + " vec4 position;\n" " position.x = gl_Vertex.x;\n" " position.y = gl_Vertex.y;\n" " position.z = texture2D(terrainTexture, texcoord).r;\n" @@ -239,6 +241,7 @@ osg::Node* createScene() return scene; } +#if 0 class TestSupportCallback : public osgProducer::OsgCameraGroup::RealizeCallback { public: @@ -277,54 +280,22 @@ class TestSupportCallback : public osgProducer::OsgCameraGroup::RealizeCallback std::string _errorMessage; }; +#endif -int main( int argc, char **argv ) +int main(int, char **) { - - // use an ArgumentParser object to manage the program arguments. - osg::ArgumentParser arguments(&argc,argv); - - // set up the usage document, in case we need to print out how to use this program. - arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is the example which demonstrates the osg::Shape classes."); - arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ..."); - arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information"); - arguments.getApplicationUsage()->addCommandLineOption("--trees ","Set the number of trees to create"); - // construct the viewer. - osgProducer::Viewer viewer(arguments); + osgViewer::Viewer viewer; - // set up the value with sensible default event handlers. - viewer.setUpViewer(osgProducer::Viewer::STANDARD_SETTINGS); - - // get details on keyboard and mouse bindings used by the viewer. - viewer.getUsage(*arguments.getApplicationUsage()); - - // if user request help write it out to cout. - if (arguments.read("-h") || arguments.read("--help")) - { - arguments.getApplicationUsage()->write(std::cout); - return 1; - } - - // any option left unread are converted into errors to write out later. - arguments.reportRemainingOptionsAsUnrecognized(); - - // report any errors if they have occured when parsing the program aguments. - if (arguments.errors()) - { - arguments.writeErrorMessages(std::cout); - return 1; - } - osg::Node* node = createScene(); // add model to viewer. viewer.setSceneData( node ); +#if 0 // register a test extension callback to be called when app realizes and gets a valid graphics context osg::ref_ptr testSupportCallback = new TestSupportCallback(); viewer.setRealizeCallback(testSupportCallback.get()); - // create the windows and run the threads. viewer.realize(); @@ -335,29 +306,12 @@ int main( int argc, char **argv ) exit(1); } +#else - while( !viewer.done() ) - { - // wait for all cull and draw threads to complete. - viewer.sync(); - - // update the scene by traversing it with the the update visitor which will - // call all node update callbacks and animations. - viewer.update(); - - // fire off the cull and draw traversals of the scene. - viewer.frame(); - - } + osg::notify(osg::NOTICE)<<"osgshaderterrain OpenGL support test not implemented yet"< #include #include +#include -#include +#include + +#include #include #include +#include class ComputeBoundingBoxVisitor : public osg::NodeVisitor { @@ -124,13 +128,7 @@ int main(int argc, char** argv) arguments.getApplicationUsage()->addCommandLineOption("--no-base-texture", "Adde base texture to shadowed model."); // construct the viewer. - osgProducer::Viewer viewer(arguments); - - // set up the value with sensible default event handlers. - viewer.setUpViewer(osgProducer::Viewer::STANDARD_SETTINGS); - - // get details on keyboard and mouse bindings used by the viewer. - viewer.getUsage(*arguments. getApplicationUsage()); + osgViewer::Viewer viewer; // if user request help write it out to cout. if (arguments.read("-h") || arguments.read("--help")) @@ -189,8 +187,8 @@ int main(int argc, char** argv) osg::Vec3 depthVec(0.0f, bb.radius(), 0.0f); osg::Vec3 centerBase( (bb.xMin()+bb.xMax())*0.5f, (bb.yMin()+bb.yMax())*0.5f, bb.zMin()-bb.radius()*0.1f ); - geode->addDrawable( createTexturedQuadGeometry( centerBase-widthVec*1.5f-depthVec*1.5f, - widthVec*3.0f, depthVec*3.0f) ); + geode->addDrawable( osg::createTexturedQuadGeometry( centerBase-widthVec*1.5f-depthVec*1.5f, + widthVec*3.0f, depthVec*3.0f) ); newGroup->addChild(geode); model = newGroup.get(); @@ -381,14 +379,18 @@ int main(int argc, char** argv) viewer.setSceneData(group.get()); + + viewer.setCameraManipulator(new osgGA::TrackballManipulator()); + + + osg::notify(osg::NOTICE)<<"Warning: Stencil buffer required, but not yet switched on."<getReferenceTime(); @@ -402,24 +404,10 @@ int main(int argc, char** argv) } light->setPosition(lightpos); occluder->computeShadowVolumeGeometry(lightpos, *shadowVolume); - } + } - // update the scene by traversing it with the the update visitor which will - // call all node update callbacks and animations. - viewer.update(); - - // fire off the cull and draw traversals of the scene. - viewer.frame(); + viewer.frame(); } - // wait for all cull and draw threads to complete. - viewer.sync(); - - // run a clean up frame to delete all OpenGL objects. - viewer.cleanup_frame(); - - // wait for all the clean up frame to complete. - viewer.sync(); - return 0; } diff --git a/examples/osgshadowtexture/GNUmakefile b/examples/osgshadowtexture/GNUmakefile index 69ad8fa40..7a0c797dd 100644 --- a/examples/osgshadowtexture/GNUmakefile +++ b/examples/osgshadowtexture/GNUmakefile @@ -5,7 +5,7 @@ CXXFILES =\ CreateShadowedScene.cpp\ osgshadowtexture.cpp\ -LIBS += -losgProducer -lProducer -losgText -losgGA -losgDB -losgUtil -losg $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS) +LIBS += -losgViewer -losgText -losgGA -losgDB -losgUtil -losg $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS) INSTFILES = \ $(CXXFILES)\ diff --git a/examples/osgshadowtexture/GNUmakefile.inst b/examples/osgshadowtexture/GNUmakefile.inst index 8d2865ba0..4e8224851 100644 --- a/examples/osgshadowtexture/GNUmakefile.inst +++ b/examples/osgshadowtexture/GNUmakefile.inst @@ -5,11 +5,8 @@ CXXFILES =\ CreateShadowedScene.cpp\ osgshadowtexture.cpp\ -LIBS += -losgProducer -lProducer -losgDB -losgText -losgUtil -losg $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS) +LIBS += -losgViewer -losgDB -losgText -losgUtil -losg $(GL_LIBS) $(X_LIBS) $(OTHER_LIBS) EXEC = osgshadowtexture -INC += $(PRODUCER_INCLUDE_DIR) $(X_INC) -LDFLAGS += $(PRODUCER_LIB_DIR) - include $(TOPDIR)/Make/makerules diff --git a/examples/osgshadowtexture/osgshadowtexture.cpp b/examples/osgshadowtexture/osgshadowtexture.cpp index c1582eda8..b694f08bf 100644 --- a/examples/osgshadowtexture/osgshadowtexture.cpp +++ b/examples/osgshadowtexture/osgshadowtexture.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include // include the call which creates the shadowed subgraph. @@ -164,82 +164,13 @@ osg::Node* createModel() } -int main( int argc, char **argv ) +int main(int, char **) { - - // use an ArgumentParser object to manage the program arguments. - osg::ArgumentParser arguments(&argc,argv); - - // set up the usage document, in case we need to print out how to use this program. - arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+" is the example which demonstrates use of pre rendering to texture to create a shadow effect.."); - arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+" [options] filename ..."); - arguments.getApplicationUsage()->addCommandLineOption("-h or --help","Display this information"); - // construct the viewer. - osgProducer::Viewer viewer(arguments); - - // set up the value with sensible default event handlers. - viewer.setUpViewer(osgProducer::Viewer::STANDARD_SETTINGS); - - // get details on keyboard and mouse bindings used by the viewer. - viewer.getUsage(*arguments.getApplicationUsage()); - - // if user request help write it out to cout. - if (arguments.read("-h") || arguments.read("--help")) - { - arguments.getApplicationUsage()->write(std::cout); - return 1; - } - - // any option left unread are converted into errors to write out later. - arguments.reportRemainingOptionsAsUnrecognized(); - - // report any errors if they have occured when parsing the program aguments. - if (arguments.errors()) - { - arguments.writeErrorMessages(std::cout); - return 1; - } - - // load the nodes from the commandline arguments. - osg::Node* model = createModel(); - if (!model) - { - return 1; - } - - // comment out optimization over the scene graph right now as it optimizers away the shadow... will look into this.. - //osgUtil::Optimizer optimzer; - //optimzer.optimize(rootnode); - - // add a viewport to the viewer and attach the scene graph. - viewer.setSceneData( model ); - - // create the windows and run the threads. - viewer.realize(); - - while( !viewer.done() ) - { - // wait for all cull and draw threads to complete. - viewer.sync(); - - // update the scene by traversing it with the the update visitor which will - // call all node update callbacks and animations. - viewer.update(); + osgViewer::Viewer viewer; - // fire off the cull and draw traversals of the scene. - viewer.frame(); - - } + // pass the model to the viewer. + viewer.setSceneData( createModel() ); - // wait for all cull and draw threads to complete. - viewer.sync(); - - // run a clean up frame to delete all OpenGL objects. - viewer.cleanup_frame(); - - // wait for all the clean up frame to complete. - viewer.sync(); - - return 0; + return viewer.run(); }