PDA

View Full Version : Fast buffer resizing



tiberiu11
05-01-2014, 07:44 AM
Hello,

I need to obtain bitmap data from an OpenGL 2 program. The program that draws a basic opengl window, but it is ratio bound, so I can't stretch it to suit my destination rectangle.
What I do is that I obtain the pixel data right before I swap buffers with glReadPixels. Then I resize with StretchBlt before I blit to my app. Unfortunately there is no way for me to modify the source of the project to make it resize the correct ratio, but I can hook to it to read the pixel data.
My question is this: can I resize the backbuffer inside the video card before I call glReadPixels? Does OpenGL do this fast?
My main program is speed and the StretchBlt function is too slow for what I need.

Thank you for your help in advance.