- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Member Functions

# RenderTarget Class Reference

This reference page is linked to from the following overview topics: Render to Texture and Multi-Target Rendering, System Events.

Search for all occurrences

## Detailed Description

RenderTarget is an abstraction of an OpenGL renderbuffer object.

You can attach multiple textures to the different 'slots' of this RenderTarget, to do multi-target rendering. Textures attached to slot0, slot1, slot2 and slot3 will all get the color; A Texture attached to slotDepth would get the zbuffer.

Definition at line 1039 of file material.h.

`#include <material.h>`

Inheritance diagram for RenderTarget:
[legend]

List of all members.

## Public Member Functions
virtual void | DrawTexture (const class Texture *pTexture)
| Paints the given texture into the rendertarget, stretching or shrinking it to fill the available space.
virtual bool | Attach (mudbox::Texture *pTexture, Slot eSlot=eSlotColor0)
| Attaches a texture to the RenderTarget.
virtual void | Detach (Slot eSlot=eSlotColor0)
| Detaches a texture from a slot in the rendertarget.
virtual mudbox::Texture * | Texture (Slot eSlot=eSlotColor0) const
| Returns the attached texture at a given slot.
virtual unsigned int | Width (void) const
| Returns the width of the rendertarget in pixels.
virtual unsigned int | Height (void) const
| Returns the height of the rendertarget in pixels.
virtual void | SetSize (unsigned int iWidth, unsigned int iHeight)
| Sets the size of the rendertarget in pixels.
virtual void | Activate (void)
| Makes this rendertarget active, but saves the previous one.
virtual void | Restore (void)
| Restores the previous rendertarget.
virtual void | SetMultisampling (bool bMultisampling)

## Member Function Documentation

virtual void DrawTexture | ( | const class Texture * | pTexture | ) | `[virtual]`

Search for all occurrences

Paints the given texture into the rendertarget, stretching or shrinking it to fill the available space.

virtual bool Attach | ( | mudbox::Texture * | pTexture,
|  | Slot | eSlot = `eSlotColor0`
| ) |  | `[virtual]`

Search for all occurrences

Attaches a texture to the RenderTarget.

The texture must have exactly the same size as the target.

Parameters:

  [in] | pTexture | The texture to be attached to the RenderTarget
  [in] | eSlot | The slot to attach it to

virtual void Detach | ( | Slot | eSlot = `eSlotColor0` | ) | `[virtual]`

Search for all occurrences

Detaches a texture from a slot in the rendertarget.

Parameters:

  [in] | eSlot | The slot to detach a texture from

virtual mudbox::Texture* Texture | ( | Slot | eSlot = `eSlotColor0` | ) | const `[virtual]`

Search for all occurrences

Returns the attached texture at a given slot.

Parameters:

  [in] | eSlot | The id for the slot being queried

virtual unsigned int Width | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns the width of the rendertarget in pixels.

virtual unsigned int Height | ( | void |  | ) | const `[virtual]`

Search for all occurrences

Returns the height of the rendertarget in pixels.

virtual void SetSize | ( | unsigned int | iWidth,
|  | unsigned int | iHeight
| ) |  | `[virtual]`

Search for all occurrences

Sets the size of the rendertarget in pixels.

virtual void Activate | ( | void |  | ) | `[virtual]`

Search for all occurrences

Makes this rendertarget active, but saves the previous one.

virtual void Restore | ( | void |  | ) | `[virtual]`

Search for all occurrences

Restores the previous rendertarget.

virtual void SetMultisampling | ( | bool | bMultisampling | ) | `[virtual]`

Search for all occurrences

Set Multisample tag. To be removed.

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

- Mudbox/material.h

RenderTarget RenderTarget RenderTarget RenderTarget RenderTarget RenderTarget RenderTarget RenderTarget RenderTarget RenderTarget
RenderTarget RenderTarget RenderTarget RenderTarget RenderTarget RenderTarget RenderTarget RenderTarget RenderTarget RenderTarget