neo::render::RenderTexture Class Reference

#include <render/rendertexture.h>

Inheritance diagram for neo::render::RenderTexture:

Inheritance graph
[legend]
Collaboration diagram for neo::render::RenderTexture:

Collaboration graph
[legend]
List of all members.

Detailed Description

Renderable texture object. The RenderTexture object can be used as a render target and as a texture. If a generator is associated with a renderable texture, the generator will be responsible for rendering the texture data when it is used. Textures are reference counted and must always be accessed through a smart pointer!
Author:
Mattias Jansson (mattias@realityrift.com)


Public Member Functions

virtual void setType (Type type)=0
 Set texture type.
virtual void setPixelFormat (const image::PixelFormat &format)=0
 Set pixel format type.
virtual void setSize (unsigned int width, unsigned int height, unsigned int depth=0)=0
 Set texture size.
void setActiveSurface (unsigned int index)
 Set active surface.
unsigned int getWidth () const
 Get width.
unsigned int getHeight () const
 Get height.
const image::PixelFormatgetPixelFormat () const
 Get color buffer pixel format.

Protected Member Functions

 RenderTexture (const std::string &name="")
virtual ~RenderTexture ()
 Free resources.

Protected Attributes

unsigned int _surface
 Active surface.


Constructor & Destructor Documentation

neo::render::RenderTexture::RenderTexture ( const std::string &  name = ""  )  [protected]

Protected, renderable textures are created by render device, not directly

Parameters:
name Texture name

virtual neo::render::RenderTexture::~RenderTexture (  )  [protected, virtual]

Free resources. Textures are reference counted and not deallocated directly


Member Function Documentation

virtual void neo::render::RenderTexture::setType ( Type  type  )  [pure virtual]

Set the texture type. You must do this prior to rendering to the texture. An upload to the texture also sets the texture type

Parameters:
type Texture type

virtual void neo::render::RenderTexture::setPixelFormat ( const image::PixelFormat format  )  [pure virtual]

Set the desired pixel format. You must do this prior to rendering to the texture. An upload to the texture also sets the pixel format

Parameters:
format Pixel format

virtual void neo::render::RenderTexture::setSize ( unsigned int  width,
unsigned int  height,
unsigned int  depth = 0 
) [pure virtual]

Set the texture size. The width or height cannot be larger than the size of the current frame buffer on the device (arguments will be clamped to this size). You must set the size prior to rendering to the texture. An upload to the texture also sets the texture size.

Parameters:
width Width
height Height
depth Depth (for 3D textures)

void neo::render::RenderTexture::setActiveSurface ( unsigned int  index  ) 

Set the active surface index (must be done while texture is not the current render target). This only has a meaning for cubemap textures and 3D textures. For cubemaps it denotes which of the six cubemap faces is active, and for 3D textures it indicates which z slice is active.

Parameters:
index Surface index

unsigned int neo::render::RenderTexture::getWidth (  )  const [inline]

Returns:
Width of render target surface

Reimplemented from neo::render::RenderTarget.

unsigned int neo::render::RenderTexture::getHeight (  )  const [inline]

Returns:
Height of render target surface

Reimplemented from neo::render::RenderTarget.

const image::PixelFormat & neo::render::RenderTexture::getPixelFormat (  )  const [inline]

Returns:
Pixel format of render target color buffer

Reimplemented from neo::render::RenderTarget.


The documentation for this class was generated from the following file:
Generated on Sat Feb 17 20:51:06 2007 for NeoEngine 2 - Evolution by  doxygen 1.5.1