From f4839d71580058c7ce04bd865c3b4eabec70b7ba Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sat, 4 Sep 2004 09:22:26 +0000 Subject: [PATCH] Updates to controlling maximum texture size --- examples/osgvolume/osgvolume.cpp | 48 +++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/examples/osgvolume/osgvolume.cpp b/examples/osgvolume/osgvolume.cpp index 55303f70c..f714d9ba9 100644 --- a/examples/osgvolume/osgvolume.cpp +++ b/examples/osgvolume/osgvolume.cpp @@ -22,8 +22,6 @@ #include -const int maximumTextureSize = 256; - typedef std::vector< osg::ref_ptr > ImageList; struct PassThroughTransformFunction @@ -257,7 +255,11 @@ struct ProcessRow }; -osg::Image* createTexture3D(ImageList& imageList, ProcessRow& processRow, unsigned int numComponentsDesired=0) +osg::Image* createTexture3D(ImageList& imageList, ProcessRow& processRow, + unsigned int numComponentsDesired, + int s_maximumTextureSize, + int t_maximumTextureSize, + int r_maximumTextureSize ) { int max_s = 0; int max_t = 0; @@ -313,13 +315,13 @@ osg::Image* createTexture3D(ImageList& imageList, ProcessRow& processRow, unsign // compute nearest powers of two for each axis. int s_nearestPowerOfTwo = 1; - while(s_nearestPowerOfTwo image_3d; @@ -806,7 +822,7 @@ int main( int argc, char **argv ) // pack the textures into a single texture. ProcessRow processRow; - image_3d = createTexture3D(imageList, processRow); + image_3d = createTexture3D(imageList, processRow, 0, s_maximumTextureSize, t_maximumTextureSize, r_maximumTextureSize); }