com.threerings.opengl.renderer
Class Framebuffer

java.lang.Object
  extended by com.threerings.opengl.renderer.Framebuffer

public class Framebuffer
extends Object

An OpenGL frame buffer object.


Constructor Summary
Framebuffer(Renderer renderer)
          Creates a frame buffer object for the specified renderer.
 
Method Summary
 int checkStatus()
          Checks the status of the frame buffer.
 void delete()
          Deletes this frame buffer, rendering it unusable.
 Object getColorAttachment()
          Returns a reference to the color target of this frame buffer (either a Texture or a Renderbuffer, or null).
 Object getDepthAttachment()
          Returns a reference to the depth target of this frame buffer (either a Texture or a Renderbuffer, or null).
 int getId()
          Returns this frame buffer's OpenGL identifier.
 Object getStencilAttachment()
          Returns a reference to the stencil target of this frame buffer (either a Texture or a Renderbuffer, or null).
 boolean isComplete()
          Checks whether the frame buffer is "complete."
 void setColorAttachment(Renderbuffer renderbuffer)
          Attaches a render buffer to the color target of this frame buffer.
 void setColorAttachment(Texture texture)
          Attaches a texture to the color target of this frame buffer.
 void setColorAttachment(Texture texture, int level, int param)
          Attaches a texture to the color target of this frame buffer.
 void setDepthAttachment(Renderbuffer renderbuffer)
          Attaches a render buffer to the depth target of this frame buffer.
 void setDepthAttachment(Texture texture)
          Attaches a texture to the depth target of this frame buffer.
 void setDepthAttachment(Texture texture, int level, int param)
          Attaches a texture to the depth target of this frame buffer.
 void setStencilAttachment(Renderbuffer renderbuffer)
          Attaches a render buffer to the stencil target of this frame buffer.
 void setStencilAttachment(Texture texture)
          Attaches a texture to the stencil target of this frame buffer.
 void setStencilAttachment(Texture texture, int level, int param)
          Attaches a texture to the stencil target of this frame buffer.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Framebuffer

public Framebuffer(Renderer renderer)
Creates a frame buffer object for the specified renderer.

Method Detail

getId

public final int getId()
Returns this frame buffer's OpenGL identifier.


setColorAttachment

public void setColorAttachment(Texture texture)
Attaches a texture to the color target of this frame buffer.


setColorAttachment

public void setColorAttachment(Texture texture,
                               int level,
                               int param)
Attaches a texture to the color target of this frame buffer.

Parameters:
level - the mipmap level.
param - for depth textures, the z offset; for cube map textures, the face index.

setColorAttachment

public void setColorAttachment(Renderbuffer renderbuffer)
Attaches a render buffer to the color target of this frame buffer.


getColorAttachment

public Object getColorAttachment()
Returns a reference to the color target of this frame buffer (either a Texture or a Renderbuffer, or null).


setDepthAttachment

public void setDepthAttachment(Texture texture)
Attaches a texture to the depth target of this frame buffer.


setDepthAttachment

public void setDepthAttachment(Texture texture,
                               int level,
                               int param)
Attaches a texture to the depth target of this frame buffer.

Parameters:
level - the mipmap level.
param - for depth textures, the z offset; for cube map textures, the face index.

setDepthAttachment

public void setDepthAttachment(Renderbuffer renderbuffer)
Attaches a render buffer to the depth target of this frame buffer.


getDepthAttachment

public Object getDepthAttachment()
Returns a reference to the depth target of this frame buffer (either a Texture or a Renderbuffer, or null).


setStencilAttachment

public void setStencilAttachment(Texture texture)
Attaches a texture to the stencil target of this frame buffer.


setStencilAttachment

public void setStencilAttachment(Texture texture,
                                 int level,
                                 int param)
Attaches a texture to the stencil target of this frame buffer.

Parameters:
level - the mipmap level.
param - for depth textures, the z offset; for cube map textures, the face index.

setStencilAttachment

public void setStencilAttachment(Renderbuffer renderbuffer)
Attaches a render buffer to the stencil target of this frame buffer.


getStencilAttachment

public Object getStencilAttachment()
Returns a reference to the stencil target of this frame buffer (either a Texture or a Renderbuffer, or null).


isComplete

public boolean isComplete()
Checks whether the frame buffer is "complete."


checkStatus

public int checkStatus()
Checks the status of the frame buffer.


delete

public void delete()
Deletes this frame buffer, rendering it unusable.



Copyright © 2011. All Rights Reserved.