Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: glDrawBuffer/glReadBuffer framebuffer state

  1. #1
    Junior Member Newbie
    Join Date
    Nov 2011
    Posts
    23

    Question glDrawBuffer/glReadBuffer framebuffer state

    Hello,

    are changes made with glDrawBuffer or glDrawBuffers stored in the state of current GL_DRAW_FRAMEBUFFER
    and changes made with glReadBuffer stored in the state of current GL_READ_FRAMEBUFFER?

    So for example this code
    Code :
    glBindFramebuffer(GL_READ_FRAMEBUFFER, BufferA);
    glBindFramebuffer(GL_DRAW_FRAMEBUFFER, BufferB);
    glReadBuffer(GL_FRONT);
    would only change the state of BufferA?

    Thanks!
    ++i--;

  2. #2
    Intern Contributor
    Join Date
    May 2013
    Posts
    69
    glWriteBuffer/glWriteBuffers/glReadBuffer are global states and are not bound to framebuffer objects.

  3. #3
    Advanced Member Frequent Contributor arekkusu's Avatar
    Join Date
    Nov 2003
    Posts
    783
    Quote Originally Posted by Osbios View Post
    glWriteBuffer/glWriteBuffers/glReadBuffer are global states and are not bound to framebuffer objects.
    This is incorrect.

    glDrawBuffer/glReadBuffer state is tracked in framebuffer objects. Open your spec and check the state table near the end. Look at the "Framebuffer (state per framebuffer object)" table.


    Quote Originally Posted by RealtimeSlave View Post
    are changes made with glDrawBuffer or glDrawBuffers stored in the state of current GL_DRAW_FRAMEBUFFER
    and changes made with glReadBuffer stored in the state of current GL_READ_FRAMEBUFFER?
    Correct.

    You can quickly verify this, binding different frame buffers, changing state, and introspecting with glGetIntegerv.

  4. #4
    Junior Member Newbie
    Join Date
    Nov 2011
    Posts
    23
    Thanks for the clarification!
    ++i--;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •