We just managed to track down a very painful little bug in some code we
had that used PassiveWindow in OpenSG2. The problem manifested itself
as what looked like corrupted textures. It took quite a while to track
down, but the problem ended up being that the OSGWindow::setupGL method
was not getting called. This call sets up the OpenGL pixelStore state
to something that OpenSG expects:
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glPixelStorei(GL_PACK_ALIGNMENT, 1);
Because of this call, every application that uses a window in OpenSG 2.0
(passive, glut, or other) must remember to call the window init() method
which will in turn call setupGL. If the developer forgets that call,
the application will appear to work but the OpenGL state machine will
not be setup correctly for OpenSG.
After we tracked this down I started wondering if there may be a way to
prevent this type of thing from happening in the future to other users.
The more I thought about it, the more I wondered why the user ever has
to call init(). Why can't OpenSG simply detect that it hasn't been
called when the window is activated (OSGWindow::activate()) and call
init() when needed. This would remove the potential for this bug
entirely.
Any thoughts?
-Allen
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users