PDA

View Full Version : problem about the glTexImage2D



kamimail
11-10-2009, 11:00 PM
my opengl version is 2.0.
i want to render a scene into a win32 dibsection and there is a RGBA texture whose size is 256*170 , when i set the 32bits image as a texture using the glTexImage2D, it reports 1282 error code,but when i change the bitmap to windows ,it works well.who can tell me how to upload an non-pow-of-2 image as a texture when rendering into a bitmap

ZbuffeR
11-11-2009, 05:19 AM
Problem is that "win32 dibsection" does not use hardware acceleration, only old software GL.
See the wiki page on FBO for modern render to texture (http://www.opengl.org/wiki/GL_EXT_framebuffer_object).

kamimail
11-11-2009, 10:27 PM
thanks for reply , but there is still a problem
here is my procedure about using fbo for the offscreen rendering:
1 create fbo in initialization stage
2 switch framebuffer to my new fbo
3 rendering scene
4 readpixel from fbo to the dibsection

but i find that in the every time between two frames ,the client area of windows show some rubbish content in a short time , is there any approach can avoid this dirty flash? thanks

kamimail
11-11-2009, 11:54 PM
thanks the above problem has been resolved, this is caused by a swapbuffer call