PBO to GL_BACK

Started by
1 comment, last by aqrit 10 years, 6 months ago

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

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 )

This topic is closed to new replies.

Advertisement