user2848971
user2848971

Reputation:

Can a renderbuffer be copied without being attached to a framebuffer?

I am writing a renderbuffer class, and need to define the copy constructor. I also have a framebuffer class that allows you to attach textures or renderbuffers to it. Does OpenGL allow you to copy renderbuffer data from one to the other without first attaching it to a framebuffer and reading from / writing to that?

Upvotes: 0

Views: 520

Answers (1)

Andon M. Coleman
Andon M. Coleman

Reputation: 43369

No, renderbuffers are pretty useless without being attached to an FBO.

The only way to copy them would be to glBlitFramebuffer (...) between one draw buffer and another. If this ability did exist, you might see something like glBlitNamedFramebuffer (...) in the Direct State Access extension, but alas, it does not.

Is your complaint that you do not want to disrupt the state of your FBO in order to copy the contents? DSA solves that sort of thing ordinarily, but since this is not something DSA covers, you will have to take care of any binding state restoration yourself.

Upvotes: 1

Related Questions