OpenGL Fast Redrawing
-
Using OpenGl I have spent some time trying to devise a method of using what is already in the front buffer (in a double buffered context) for fast redraws. This is useful when the window has finished rendering (maybe waiting for further user input) and a redraw message is sent to the application for some other reason (maybe the user has moved the window). It is a waste of time performing a full render because the final image will be identical to that prior to the redraw. And if the redraw is lengthy then the user cannot do anything until the redraw has finished (which could become annoying to the user). I have tried using glFlush()/glFinish() instead of swapbuffers() and this appears to work on the generic implementation, but with a Voodoo 3500 it doesn't work (who knows what they do with the front and back buffers). I do not want to use extensions that may not exist in a generic implementation or accelerated environment (PFD_SWAP_COPY, AUX buffer etc). I have also tried rendering to a bitmap then using BitBlt() in a single buffer context, but this is incredibly slow. What can I do?
-
Using OpenGl I have spent some time trying to devise a method of using what is already in the front buffer (in a double buffered context) for fast redraws. This is useful when the window has finished rendering (maybe waiting for further user input) and a redraw message is sent to the application for some other reason (maybe the user has moved the window). It is a waste of time performing a full render because the final image will be identical to that prior to the redraw. And if the redraw is lengthy then the user cannot do anything until the redraw has finished (which could become annoying to the user). I have tried using glFlush()/glFinish() instead of swapbuffers() and this appears to work on the generic implementation, but with a Voodoo 3500 it doesn't work (who knows what they do with the front and back buffers). I do not want to use extensions that may not exist in a generic implementation or accelerated environment (PFD_SWAP_COPY, AUX buffer etc). I have also tried rendering to a bitmap then using BitBlt() in a single buffer context, but this is incredibly slow. What can I do?
A few suggestions : 1) have you tried glReadPixels() / glDrawPixels() ? 2) The accumulation buffer is guaranteed to exist in all openGL implementations ... maybe you can use it somehow ? What "windowing" system are you using ? AUX ? GLUT ? wgl ?
-
A few suggestions : 1) have you tried glReadPixels() / glDrawPixels() ? 2) The accumulation buffer is guaranteed to exist in all openGL implementations ... maybe you can use it somehow ? What "windowing" system are you using ? AUX ? GLUT ? wgl ?
Thanks for the suggestions. Your suggestion to use the accumulator seems to work. It is still a little slow, but at least it is a constant redraw time for a set screen size. This means that I should be able to do some dynamic calculations in software and when the redrawing using normal rendering takes too long I could switch to the accumulator buffer method (for the next redraw of course).