hi. i’ve search through the forums and found some code for saving the screen canvas into bitmap using glReadPixels, and i’ve tried it.
one weird problem is that the code can save a clean blank canvas, i.e. all black (my starting canvas is black), but once i draw something on it, the file cannot be saved. is it some double buffer problem, or am i just using the wrong dc? does Invalidate(FALSE) do anything to it other than flushing the old one out? i’m not too good in this, hope you all can help. thanks!
it doesn’t work in the sense that the bitmap file is not created at all. in the previous case (when nothing is drawn) a blank black bitmap file can be created.
regarding the active rendering context… do you mean the dc? i’m rather confused by the DCs and such… bleah
thanks for the tip abt glGetError anyway! will go try it
it doesn’t work in the sense that the bitmap file is not created at all. in the previous case (when nothing is drawn) a blank black bitmap file can be created.
regarding the active rendering context… do you mean the dc? i’m rather confused by the DCs and such… bleah
thanks for the tip abt glGetError anyway! will go try it
it doesn’t work in the sense that the bitmap file is not created at all. in the previous case (when nothing is drawn) a blank black bitmap file can be created.
regarding the active rendering context… do you mean the dc? i’m rather confused by the DCs and such… bleah
thanks for the tip abt glGetError anyway! will go try it
A rendering context must be active for any OpenGL functions to work, in win32 you use wglMakeCurrent(…) to do this, in glut it is done for you in the display callback and so on.
Originally posted by chowiela:
[b]hi. i’ve search through the forums and found some code for saving the screen canvas into bitmap using glReadPixels, and i’ve tried it.
[/b]
[This message has been edited by 39smooth (edited 03-14-2004).]