From 0b288fc721f5e47b703e541a957f6f35437d0784 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 22 Jul 2004 12:10:53 +0000 Subject: [PATCH] Added support for compressing textures to osgconv, can be accessed by running --compressed when outputting to a .ive file. --- VisualStudio/VisualStudio.dsw | 3 +++ VisualStudio/examples/osgconv/osgconv.dsp | 4 ++-- examples/osgconv/osgconv.cpp | 18 ++++++++++++------ 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/VisualStudio/VisualStudio.dsw b/VisualStudio/VisualStudio.dsw index 0db5e5e22..cabe82bee 100644 --- a/VisualStudio/VisualStudio.dsw +++ b/VisualStudio/VisualStudio.dsw @@ -422,6 +422,9 @@ Package=<4> Begin Project Dependency Project_Dep_Name Core osgUtil End Project Dependency + Begin Project Dependency + Project_Dep_Name Core osgProducer + End Project Dependency }}} ############################################################################### diff --git a/VisualStudio/examples/osgconv/osgconv.dsp b/VisualStudio/examples/osgconv/osgconv.dsp index 689e779b8..9c216a53c 100755 --- a/VisualStudio/examples/osgconv/osgconv.dsp +++ b/VisualStudio/examples/osgconv/osgconv.dsp @@ -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 /machine:I386 -# ADD LINK32 /nologo /subsystem:console /pdb:none /machine:I386 /out:"../../../bin/osgconv.exe" /libpath:"../../../lib" +# ADD LINK32 opengl32.lib Producer.lib OpenThreadsWin32.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../../../bin/osgconv.exe" /libpath:"../../../lib" !ELSEIF "$(CFG)" == "Example osgconv - Win32 Debug" @@ -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 /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"libcmt" /out:"../../../bin/osgconvd.exe" /pdbtype:sept /libpath:"../../../lib" +# ADD LINK32opengl32.lib Producerd.lib OpenThreadsWin32d.lib /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"libcmt" /out:"../../../bin/osgconvd.exe" /pdbtype:sept /libpath:"../../../lib" # SUBTRACT LINK32 /incremental:no !ENDIF diff --git a/examples/osgconv/osgconv.cpp b/examples/osgconv/osgconv.cpp index f7fb9bb6d..0efc534e2 100644 --- a/examples/osgconv/osgconv.cpp +++ b/examples/osgconv/osgconv.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -360,12 +361,17 @@ int main( int argc, char **argv ) if (compressTextures) { - osg::notify(osg::NOTICE)<<"Need to implement compressed textures."<< std::endl; - - CompressTexturesVisitor ctv; - root->accept(ctv); - ctv.compress(); - + std::string ext = osgDB::getFileExtension(fileNameOut); + if (ext=="ive") + { + CompressTexturesVisitor ctv; + root->accept(ctv); + ctv.compress(); + } + else + { + std::cout<<"Warning: compressing texture only supported when outputing to .ive"<