Sign in to follow this  
aqrit

PBO to GL_BACK

Recommended Posts

aqrit    119

Why is uploading to a texture then rendering a quad recommended over glDrawPixels?

edit: looks like glDrawPixels takes twice the time to run as glTexSubImage2D->render quad does in my tests :(

 

 

Why does glCopyBufferSubData not work for this?

//glDrawPixels( 640, 480, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, 0 ); // works

glBindBuffer( GL_COPY_WRITE_BUFFER, GL_BACK_LEFT ) ;
glCopyBufferSubData( GL_PIXEL_UNPACK_BUFFER, GL_COPY_WRITE_BUFFER, 0, 0, 256 ); // fails 0x501
Edited by aqrit

Share this post


Link to post
Share on other sites
Dark Helmet    173
GL_BACK_LEFT is a component buffer of the default (system) framebuffer. It is not the name of a buffer object.

I can easily see why you made this mistake though. Components of a framebuffer are historically called buffers (e.g. color buffers, depth buffer, stencil buffer; thus glDrawBuffer/glReadBuffer/etc.). These are different than buffer objects (arbitrary blocks of driver memory you can create).

With framebuffer objects, these component buffers are called "attachment points" to help disambiguate these concepts.

Share this post


Link to post
Share on other sites
aqrit    119

Is there any way to upload an image to the back buffer with out an extra copy step? ( other than glDrawPixels )

 -- maybe get the handle of the texture the back buffer is using?

 

edit: glGetFramebufferAttachmentParameteriv doesn't work on the default frame buffer sad.png

I see some disussion of about this topic

http://www.opengl.org/discussion_boards/showthread.php/178863-Lock-the-Default-Framebuffer?p=1241817&viewfull=1#post1241817

http://www.opengl.org/discussion_boards/showthread.php/182610-Request-FBO-can-use-default-color-depth-and-stencil-buffers?p=1254401&viewfull=1#post1254401

 

that seems to suggest it is currently impossible because the screen size can change without notice ( or something )

Edited by aqrit

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this