PDA

View Full Version : how to present the renderbuffer?



killpig
11-19-2010, 10:43 PM
I use opengl es 2.0 to draw some picture,and create the FBOs,
but how to present the renderbuffer on the screen? I develop on android with nexus one.
-------------code like this------------------
glGenFramebuffers(1, &viewFramebuffer);
glGenRenderbuffers(1, &viewRenderbuffer);
glBindFramebuffer(GL_FRAMEBUFFER, viewFramebuffer);
glBindRenderbuffer(GL_RENDERBUFFER, viewRenderbuffer);
glRenderbufferStorage (GL_RENDERBUFFER, GL_RGB565, g_WindowsWidth,
g_WindowsHeight);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
GL_RENDERBUFFER, viewRenderbuffer);
GLenum status=glCheckFramebufferStatus(GL_FRAMEBUFFER);
//draw something,like glTexImage
//but how to present the renderbuffer on the screen?

Alfonse Reinheart
11-19-2010, 11:22 PM
but how to present the renderbuffer on the screen?

Generally, renderbuffers are for images you don't intend to directly show to the user. OpenGL ES is not the same thing as OpenGL, so I don't know if blitting is available to you. It would probably be better to create a texture and render to that. Or, if you intend to simply display the image, just render to the regular framebuffer.