Login  Register

Re: querying textures bound to default draw/read framebuffers

Posted by ac on Oct 20, 2012; 5:23pm
URL: https://forum.jogamp.org/querying-textures-bound-to-default-draw-read-framebuffers-tp4026564p4026575.html

I found it, I only need to cast the color buffer object as a TextureAttachment:

FBObject fboFront = dr.getFBObject(GL.GL_FRONT);
FBObject.Colorbuffer colorBuf = fboFront.getColorbuffer(0);
FBObject.TextureAttachment texFront = (FBObject.TextureAttachment) colorBuf;
System.out.println("front texture: " + texFront.getName());

which seems to be equivalent to FBObject.TextureAttachment texFront = drawable.getTextureBuffer(GL.GL_FRONT). Which method is preferred?

Also, in terms of API, it seems to me that FBObject should have a getColorAttachment() method which returns a FBO.ColorAttachment. The texture name could be also queried from it, since it has a name property. Although this lead to three different ways of getting the name of the bound texture.

Another question: what should I do if I need to blit the contents of the multisampled back buffer into the front buffer mid-render when using MSAA? Just call swapBuffers()?