I managed to get the graphic context from the viewer then I set the state of my GLObjectsVisitor using the 1st and only context in my application and, finally, I accept the visitor with my root. But now I see many (acutally infinite, because of app loop I guess) messages like this in the console:
Warning: TextureRectangle::apply(..) failed, texture rectangle is not support by your OpenGL drivers. As result, I cannot see textures anymore except on just one object. Any idea of what's happening? Thanks. Regards. Alessandro On 6/27/07, Robert Osfield <[EMAIL PROTECTED]> wrote:
On 6/27/07, alessandro terenzi <[EMAIL PROTECTED]> wrote: > w.r.t. osgUtil::GLObjectsVisitor usage, I'm looking at how it is used in > Viewer.cpp but I think I cannot understand how to manage it... what I'm > trying to do now is to get a GraphicsContext from the my scene root (but > actually I'm really not sure that this is correct...) then I create a > GLObjectsVisitor and let my root accept it... but actually the > GraphicsContext cannot be acquired so I think the visitor has no effect on > the whole scene... I do everything just before the application's loop > starts... > ...maybe I have to use the visitor on each model I add to the scene? The graphics contexts are managed by your application/viewer code, its not related to the scene graph. To do OpenGL calls like what GLObjectVsitor does you'll need to do them from a thread with a valid graphics context. I'm actually just doing some work on precompile subgraphs via a background thread which runs a shared pbuffer context. > By the way, since I'm using some textures that has sizes not "power of 2" I > see in the console messages concerning rescaling operations... by now I see > those messages as soon as an object is displayed ... if I'll manage to use > GLObjectsVisitor I will see those messages just before displaying those > object, correct? Yes. If you have a modern card then you can probably tweak the texture settings not to resize non power of two textures. Alternatively just resize the images and then write the files back to disk. _______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
_______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
