Skip to main content
gamedev.net
🔒 Locked

glDrawPixels + EXT_framebuffer_object

Started by dimensionX 3 replies 600+ views
Original Post
dimensionX
dimensionX
Has anyone tried "glDrawPixels() + EXT_framebuffer_object combination ? For example:- ----------- -> create a texture. -> create fbo. -> Bind texture to fbo. -> call glDrawPixels(). -> Texture map the contents of the texture to check if the contents are correct. When I create a texture should I call the glTexImage2D() or will the driver automatically allocate the memory on the GPU ?
_the_phantom_
_the_phantom_
you need to call glTexImage2D() so the driver knows how big you want the texture to be as well as what format you want. However, you can specify NULL for the data address so you dont need to upload data to it.
dimensionX
dimensionX
When I made the call glTexImage2D and try to texture map the result of glDrawPixels, I get a black screen.
JSoftware
JSoftware
remember to unbind the framebufferobject again?

glbindframebufferobjectext(gl_framebuffer_ext, 0);

this will do the same as swapbuffers do. if you don't the texture will just be black
dimensionX
dimensionX
Silly me, forgot to set glRasterPos2i();

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.