molecular
Public Member Functions | Friends | List of all members
molecular::gfx::GlCommandSink::RenderTarget Class Reference

Allows for rendering to textures. More...

#include <GlCommandSink.h>

Inheritance diagram for molecular::gfx::GlCommandSink::RenderTarget:
molecular::util::NonCopyable

Public Member Functions

void AttachColorBuffer (Texture *texture, unsigned int attachment=0, unsigned int layer=0)
 Set texture to render color to. More...
 
void AttachColorBuffer (unsigned int width, unsigned int height, PixelFormat format, unsigned int attachment=0)
 Enable rendering to a buffer. More...
 
void AttachDepthBuffer (Texture *texture)
 Set texture to render depth to. More...
 
void AttachDepthBuffer (unsigned int width, unsigned int height, PixelFormat format)
 
void AttachStencilBuffer (Texture *texture)
 
void AttachStencilBuffer (unsigned int width, unsigned int height, PixelFormat format)
 
bool ColorBufferAttached () const
 
unsigned int GetWidth () const
 
unsigned int GetHeight () const
 

Friends

class GlCommandSink
 

Detailed Description

Allows for rendering to textures.

See also
CreateRenderTarget
DestroyRenderTarget

Member Function Documentation

void molecular::gfx::GlCommandSink::RenderTarget::AttachColorBuffer ( Texture texture,
unsigned int  attachment = 0,
unsigned int  layer = 0 
)

Set texture to render color to.

Parameters
textureThe texture to render to.
attachmentUse values different from 0 to activate MRTs. Not available on GLES.
layerLayer of the 3D texture to draw to (only applicable to 3D textures).
void molecular::gfx::GlCommandSink::RenderTarget::AttachColorBuffer ( unsigned int  width,
unsigned int  height,
PixelFormat  format,
unsigned int  attachment = 0 
)

Enable rendering to a buffer.

The buffer cannot be used as a texture afterwards. Rarely needed for color targets. Simply don't output a fragmentColor when not needing color output.

void molecular::gfx::GlCommandSink::RenderTarget::AttachDepthBuffer ( Texture texture)

Set texture to render depth to.

Rendering depth to a texture requires OES_depth_texture extension on GLESv2.

void molecular::gfx::GlCommandSink::RenderTarget::AttachDepthBuffer ( unsigned int  width,
unsigned int  height,
PixelFormat  format 
)
void molecular::gfx::GlCommandSink::RenderTarget::AttachStencilBuffer ( Texture texture)
void molecular::gfx::GlCommandSink::RenderTarget::AttachStencilBuffer ( unsigned int  width,
unsigned int  height,
PixelFormat  format 
)
bool molecular::gfx::GlCommandSink::RenderTarget::ColorBufferAttached ( ) const
inline
unsigned int molecular::gfx::GlCommandSink::RenderTarget::GetHeight ( ) const
inline
unsigned int molecular::gfx::GlCommandSink::RenderTarget::GetWidth ( ) const
inline

Friends And Related Function Documentation

friend class GlCommandSink
friend

The documentation for this class was generated from the following files: