# PBO to GL_BACK

## Recommended Posts

aqrit    119

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 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 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

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

Edited by aqrit