How can I render my OpenGL scene to file? I prefer to use standart Windows Bitmap. I generally use Delphi, and there is very convienient object TCanvas. I tried to use bitmap flag PFD_DRAW_TO_BITMAP, but it doesnt work. All I have done I gave TBitmap Device Context to functions wglCreateContext etc. May be I missed something important?
What about doing the copy by hand using glReadPixels ?
Then you can write the pixel array in any file format you need.
no. what if I want resolution more than is seen on the screen? why if my screen has only 256 colors and I want TrueColor? why if I even dont want to display anything?
PFD_DRAW_TO_BITMAP works just fine, the “bitmap” must be a DIB (Device Independant Bitmap) with the correct color depth.
Make sure you don’t try to use it with doublebuffering or anything like that.