From 6c047f7abe82699b28ffc9a94b20e0e272250ec3 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 25 Aug 2008 11:37:53 +0000 Subject: [PATCH] Added testing of max texture size using a realize operation --- examples/osgvolume/osgvolume.cpp | 34 +++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/examples/osgvolume/osgvolume.cpp b/examples/osgvolume/osgvolume.cpp index 7feaa2414..723ed190f 100644 --- a/examples/osgvolume/osgvolume.cpp +++ b/examples/osgvolume/osgvolume.cpp @@ -1488,6 +1488,33 @@ void doColourSpaceConversion(ColourSpaceOperation op, osg::Image* image, osg::Ve } } +class TestSupportOperation: public osg::GraphicsOperation +{ +public: + + TestSupportOperation(): + osg::GraphicsOperation("TestSupportOperation",false), + supported(true), + errorMessage(), + maximumTextureSize(256) {} + + virtual void operator () (osg::GraphicsContext* gc) + { + OpenThreads::ScopedLock lock(mutex); + + glGetIntegerv( GL_MAX_3D_TEXTURE_SIZE, &maximumTextureSize ); + + osg::notify(osg::NOTICE)<<"Max texture size="< testSupportOperation = new TestSupportOperation; + viewer.setRealizeOperation(testSupportOperation.get()); + + viewer.realize(); + + int maximumTextureSize = testSupportOperation->maximumTextureSize; int s_maximumTextureSize = 256; int t_maximumTextureSize = 256; int r_maximumTextureSize = 256; - int maximumTextureSize = 256; while(arguments.read("--maxTextureSize",maximumTextureSize)) { s_maximumTextureSize = maximumTextureSize;