Added osgViewerGetVersion() into context creation code as a means of forcing windows to link in osgViewer properly.

This commit is contained in:
Robert Osfield 2008-11-12 10:30:17 +00:00
parent c1568bb735
commit 89829f8153

View File

@ -17,13 +17,15 @@
*/ */
#include <osg/Notify> #include <osg/Notify>
#include <osg/Timer>
#include <osg/ArgumentParser> #include <osg/ArgumentParser>
#include <osg/Texture1D> #include <osg/Texture1D>
#include <osg/Texture2D> #include <osg/Texture2D>
#include <osg/Texture3D> #include <osg/Texture3D>
#include <osg/Geometry> #include <osg/Geometry>
#include <osg/FrameBufferObject>
#include <osgViewer/Viewer> #include <osgViewer/Version>
#include <stdio.h> #include <stdio.h>
#include <iostream> #include <iostream>
@ -79,6 +81,8 @@ class ContextTest : public MemoryTest
} }
else else
{ {
std::cerr<<"Error: Unable to create graphis context, problem with running osgViewer-"<<osgViewerGetVersion()<<", cannot create windows/pbuffers."<<std::endl;
if (_pbuffer) throw "Failed to create PixelBuffer"; if (_pbuffer) throw "Failed to create PixelBuffer";
else throw "Failed to create GraphicsWindow"; else throw "Failed to create GraphicsWindow";
} }
@ -417,7 +421,6 @@ int main( int argc, char **argv )
osg::Timer_t startTick = osg::Timer::instance()->tick(); osg::Timer_t startTick = osg::Timer::instance()->tick();
// use printf's below as C++'s ostream classes use more memory and are more likely to fail when everything // use printf's below as C++'s ostream classes use more memory and are more likely to fail when everything
// goes wrong with memory allocations. // goes wrong with memory allocations.