zahirtezcan's picture

ColorAttachment enums on ReadBufferMode?

I tried using FrameBuffers for rendering to a bitmap file. the idea is first rendering to a texture via framebuffer and then reading pixels from framebuffer for IO. It sufficed to set draw buffer to colorattachment_zero and render to framebuffer. But while setting read buffer (GL.ReadBuffer(ReadBufferMode)) Front, left etc. all resulted in InvalidEnum error(using OpenTK in debug mode). however (ReadBufferMode)(int)DrawBufferMode.ColorAttachment0 gave the desired result. Is non-existance of attachments on ReadBufferMode is intended? (So, am i doing something wrong?) Or is it forgotten?


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

This is a bug, ReadBufferMode should contain the ColorAttachment[n] tokens according to ARB_framebuffer_object:

ARB_framebuffer_object wrote:

Table 10.nnn: Arguments to DrawBuffer(s) and ReadBuffer when the context is bound to a framebuffer object, and the buffers they indicate. i in COLOR_ATTACHMENTi may range from zero to the value of MAX_COLOR_ATTACHMENTS - 1.

Could you please file a bug report so this issue doesn't get lost?

zahirtezcan's picture
the Fiddler's picture

Thank you.