C# Class NewTOAPIA.GL.GLRenderTarget

A GLRenderTarget is the encapsulation of a simple frame buffer object. The simplest frame buffer has a color buffer, and a depth buffer. It is constructed given a width and height in pixels. Usage: GLRenderTarget myTarget = new GLRenderTarget(width, height); myTarget.Bind(); // Do whatever rendering you want myTarget.Unbind(); The ColorBuffer property will contain the rendered color information.
Inheritance: IBindable
Mostra file Open project: Wiladams/NewTOAPIA Class Usage Examples

Public Methods

Method Description
AttachColorBuffer ( GLTexture2D colorbuffer, ColorBufferAttachPoint attachPosition ) : void
Bind ( ) : void

Make the RenderTarget the current target of rendering.

CreateDepthBuffer ( ) : void
GLRenderTarget ( GLTexture2D texture ) : System.Collections.Generic

This is the easiest constructor to use when you already have a texture, and you want to draw into it. Just pass the texture in, and the RenderTarget will be constructed to match the size.

GLRenderTarget ( GraphicsInterface gi ) : System.Collections.Generic
GLRenderTarget ( GraphicsInterface gi, int width, int height ) : System.Collections.Generic

Create a render target with the specified width and height in pixels. A color buffer and depth buffer will be attached.

GetColorBuffer ( ColorBufferAttachPoint attachPoint ) : GLTexture2D
Unbind ( ) : void

Switch back to the regular drawing context (typically the screen).

Private Methods

Method Description
CreateDepthBuffer ( int width, int height ) : void

Method Details

AttachColorBuffer() public method

public AttachColorBuffer ( GLTexture2D colorbuffer, ColorBufferAttachPoint attachPosition ) : void
colorbuffer GLTexture2D
attachPosition ColorBufferAttachPoint
return void

Bind() public method

Make the RenderTarget the current target of rendering.
public Bind ( ) : void
return void

CreateDepthBuffer() public method

public CreateDepthBuffer ( ) : void
return void

GLRenderTarget() public method

This is the easiest constructor to use when you already have a texture, and you want to draw into it. Just pass the texture in, and the RenderTarget will be constructed to match the size.
public GLRenderTarget ( GLTexture2D texture ) : System.Collections.Generic
texture GLTexture2D
return System.Collections.Generic

GLRenderTarget() public method

public GLRenderTarget ( GraphicsInterface gi ) : System.Collections.Generic
gi GraphicsInterface
return System.Collections.Generic

GLRenderTarget() public method

Create a render target with the specified width and height in pixels. A color buffer and depth buffer will be attached.
public GLRenderTarget ( GraphicsInterface gi, int width, int height ) : System.Collections.Generic
gi GraphicsInterface The graphics interface used to construct the components.
width int The width of the RenderTarget in pixels.
height int The height of the RenderTarget in pixels.
return System.Collections.Generic

GetColorBuffer() public method

public GetColorBuffer ( ColorBufferAttachPoint attachPoint ) : GLTexture2D
attachPoint ColorBufferAttachPoint
return GLTexture2D

Unbind() public method

Switch back to the regular drawing context (typically the screen).
public Unbind ( ) : void
return void