Re: Re: OpenGL/GLUT examples crashing: known problem?
Glynn Clements <[email protected]>
| Newsgroups | gmane.comp.lang.haskell.hopengl |
|---|---|
| Message-ID | <[email protected]> |
Claus Reinke wrote: > > > Btw, is there a way to reset the opengl system to a sane state in > > > software? Or are there some invalid assumptions about default > > > state in the other examples? > > > > If OpenGL is getting "stuck" in a non-functional state, that indicates > > a bug in the driver. > > quite possible. but I'm unlikely to get any driver updates for this model:-) > > still, driver bugs are not uncommon, so one might hope for a function > to reinitialize OpenGL soft- and hardware (when workstations became > less stable, they moved the reset button from the back to the front;). > after all, reboot resets the configuration successfully, so there should > be an easier way.. It's the job of the operating system to ensure that there isn't ;) Less flippantly, the OS (including the driver(s) for the graphics hardware) are supposed to isolate applications from each other. If you create a window and use a particular sequence of OpenGL commands to render into it, you should get the same results regardless of whether any other processes are using OpenGL concurrently, or (especially) whether other processes were using it previously. The OS is effectively reinitialising OpenGL every time it switches between OpenGL contexts. If that doesn't work when the OS is doing it implicitly, there's no reason to believe that it would work if the application did it explicitly. In short: any problems which persist from one process to another are definitely due to driver bugs. Problems which only persist for the lifetime of a single process could be due either to a driver bug or a bug in the libraries. In that situation, you can partially re-initialise OpenGL by discarding the context and creating a new one. But not with GLUT; you would have to use a toolkit which provides lower-level access, i.e. the ability to manage contexts explicitly (wglCreateContext() etc). [Although, with GLUT, you could destroy and re-create the window; I think that GLUT will create a new context in this case.] -- Glynn Clements <[email protected]>