Hi Dirk, Dirk Reiners wrote: > Hi Toni, > > Antonio Bleile wrote: > > Hi, > > > > I've some problems when my context get's renewed due > > to pixelformat changes e.g. the user selected stereo > > etc. I'm using qt 4.2.3 and I use it's setFormat method. > > Qt recreates a new context behind the scenes and informs > > the QGLWidget about the change by calling initializeGL. > > So I'm ok OpenGL-context-wise. I'm not quite sure what > > I'm supposed to do OpenSG-wise for getting the transition > > right. After some experiments I figured out that it's > > a good thing to recreate the PassiveWindow associated > > to the context. See the code posted below. I get > > some problems trying to cleanup the old passive > > window though (crash, segfault, sorry no decent stack trace > > at hand). But it get's more weird. When I comment > > the lines that do the cleanup, the program seems > > to work correctly on the first switch mono->stereo. > > After switching back and forth for a while, my lighting > > get's screwed, the light source seems to be black. > > All this might be caused by an error inside > > my program, but as this one was the last modification > > I made to the code I suspect it's OpenSG's fault. Just > > want to ask if the code below has some obvious errors.. > > If you create/use a new context OpenSG needs to recreate the internal > display lists, texture objects and shaders etc. > > AFAIR just calling Window::reinitializeAllGLObjects(); should be enough > for that.
I tried to reproduce the problem within a smaller program. I modified the QtArOpenSG sample (removing the AR stuff). When you press "s" or click on the tool button, the context is recreated using qt's setFormat method. The example just visualizes a torus: http://www.seac02.it/contextswitch/beforestereoswitch.jpg that's what I see when I switch to a stereo context: http://www.seac02.it/contextswitch/aftersteeoswitch.jpg I used the reinitializeAllGLObjects() method as you suggested. Looks like a messed up depth.... But the effects seem to be quite random. In this sample, the light colors seem to be ok, but in our production software we experience quite different problems as I described in my previous mail. Here's the code (windows only, sorry): http://www.seac02.it/contextswitch/QtArOpenSG.zip Kind regards, Toni ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Opensg-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensg-users
