The Nebula Device 3: Base::RenderTargetBase Class Reference

The Nebula Device 3

Base::RenderTargetBase Class Reference

#include <rendertargetbase.h>

Inheritance diagram for Base::RenderTargetBase:

Core::RefCounted Direct3D9::D3D9RenderTarget CoreGraphics::RenderTarget


Detailed Description

Base class for render targets. A render targets wraps up to 4 color buffers and an optional depth/stencil buffer into a C++ object. The special default render target represents the backbuffer and default depth/stencil surface.

(C) 2007 Radon Labs GmbH

Public Member Functions

 RenderTargetBase ()
 constructor
virtual ~RenderTargetBase ()
 destructor
bool IsDefaultRenderTarget () const
 get default render target flag
bool HasColorBuffer (IndexT colorBufferIndex) const
 return true if color buffer exists
bool HasDepthStencilBuffer () const
 return true if the render target has a depth/stencil buffer
bool IsValid () const
 return true if valid (has been setup)
void SetWidth (SizeT w)
 set render target width
SizeT GetWidth () const
 get width of render target in pixels
void SetHeight (SizeT h)
 set render target height
SizeT GetHeight () const
 get height of render target in pixels
void SetAntiAliasQuality (CoreGraphics::AntiAliasQuality::Code c)
 set antialias quality
CoreGraphics::AntiAliasQuality::Code GetAntiAliasQuality () const
 get anti-alias-quality
void AddColorBuffer (CoreGraphics::PixelFormat::Code colorFormat)
 add a color buffer
SizeT GetNumColorBuffers () const
 get number of color buffers
CoreGraphics::PixelFormat::Code GetColorBufferFormat (IndexT colorBufferIndex) const
 get color buffer format at index
void AddDepthStencilBuffer ()
 add a depth/stencil buffer
void SetMipMapsEnabled (bool b)
 enable mipmap generation for this render target
bool AreMipMapsEnabled () const
 get mipmap generation flag
void SetResolveTextureResourceId (const Resources::ResourceId &resId)
 set resolve texture resource id
const
Resources::ResourceId
GetResolveTextureResourceId () const
 get resolve texture resource id
void SetResolveTextureWidth (SizeT w)
 set resolve texture width
SizeT GetResolveTextureWidth () const
 get resolve texture width
void SetResolveTextureHeight (SizeT h)
 set resolve texture height
SizeT GetResolveTextureHeight () const
 get resolve texture height
void SetClearColor (const Math::float4 &c)
 set clear color
const Math::float4GetClearColor () const
 get clear color
void SetClearDepth (float d)
 set clear depth
float GetClearDepth () const
 get clear depth
void SetClearStencil (uchar s)
 set clear stencil value
uchar GetClearStencil () const
 get clear stencil value
void SetResolveRect (const Math::rectangle< uint > &r)
 set the current resolve rectangle (in pixels)
const
Math::rectangle
< uint > & 
GetResolveRect () const
 get resolve rectangle
void Setup ()
 setup the render target object
void Discard ()
 discard the render target object
void BeginPass ()
 begin rendering to the render target
void BeginBatch (CoreGraphics::BatchType::Code batchType)
 begin a batch
void EndBatch ()
 end current batch
void EndPass ()
 end current render pass
void GenerateMipLevels ()
 generate mipmap levels
bool HasResolveTexture () const
 return true if resolve texture is valid
const Ptr
< CoreGraphics::Texture > & 
GetResolveTexture () const
 get the resolve texture as Nebula texture object
int GetRefCount () const
 get the current refcount
void AddRef ()
 increment refcount by one
void Release ()
 decrement refcount and destroy object if refcount is zero
bool IsInstanceOf (const Rtti &rtti) const
 return true if this object is instance of given class
bool IsInstanceOf (const Util::String &className) const
 return true if this object is instance of given class by string
bool IsInstanceOf (const Util::FourCC &classFourCC) const
 return true if this object is instance of given class by fourcc
bool IsA (const Rtti &rtti) const
 return true if this object is instance of given class, or a derived class
bool IsA (const Util::String &rttiName) const
 return true if this object is instance of given class, or a derived class, by string
bool IsA (const Util::FourCC &rttiFourCC) const
 return true if this object is instance of given class, or a derived class, by fourcc
const Util::StringGetClassName () const
 get the class name
Util::FourCC GetClassFourCC () const
 get the class FourCC code

Static Public Member Functions

static void DumpRefCountingLeaks ()
 dump refcounting leaks, call at end of application (NEBULA3_DEBUG builds only!)

Static Public Attributes

static const IndexT MaxNumColorBuffers = 4
 max number of color buffers

Protected Member Functions

void SetDefaultRenderTarget (bool b)
 set to true if default render target

Member Function Documentation

int Core::RefCounted::GetRefCount (  )  const [inline, inherited]

get the current refcount

Return the current refcount of the object.

void Core::RefCounted::AddRef (  )  [inline, inherited]

increment refcount by one

Increment the refcount of the object.

void Core::RefCounted::Release (  )  [inline, inherited]

decrement refcount and destroy object if refcount is zero

Decrement the refcount and destroy object if refcount is zero.

const Util::String & Core::RefCounted::GetClassName (  )  const [inline, inherited]

get the class name

Get the class name of the object.

Util::FourCC Core::RefCounted::GetClassFourCC (  )  const [inline, inherited]

get the class FourCC code

Get the class FourCC of the object.

void Core::RefCounted::DumpRefCountingLeaks (  )  [static, inherited]

dump refcounting leaks, call at end of application (NEBULA3_DEBUG builds only!)

This method should be called as the very last before an application exits.