Public Types | Public Member Functions | Public Attributes | Static Public Attributes

xl7::direct3d::State Class Reference

#include <State.h>

List of all members.

Public Types

enum  Category {
  NO_STATE = 0, _1st_STD_VAL_STATES = 1, _2nd_FLC_VAL_STATES = 2, _3rd_EXP_VAL_STATES = 4,
  ALL_STATES = 7
}

Public Member Functions

 State (void)
 ~State (void)
 State (const State &rhs)
Stateoperator= (const State &rhs)
const ml7::Matrix4x4GetWorldTransform () const
const ml7::Matrix4x4GetViewTransform () const
const ml7::Matrix4x4GetProjectionTransform () const
const D3DVIEWPORT9 & GetViewport () const
const IDirect3DSurface9 * GetColorRenderTarget () const
const IDirect3DSurface9 * GetColorRenderTarget (unsigned index) const
const IDirect3DSurface9 * GetDepthStencilTarget () const
unsigned long GetFVF () const
unsigned long GetRenderState (D3DRENDERSTATETYPE rst) const
unsigned long GetTextureState (unsigned stage, D3DTEXTURESTAGESTATETYPE tss) const
unsigned long GetSamplerState (unsigned stage, D3DSAMPLERSTATETYPE ss) const
float GetRenderStateF (D3DRENDERSTATETYPE rst) const
float GetTextureStateF (unsigned stage, D3DTEXTURESTAGESTATETYPE tss) const
float GetSamplerStateF (unsigned stage, D3DSAMPLERSTATETYPE ss) const
const IDirect3DBaseTexture9 * GetTexture (unsigned stage) const
const D3DMATERIAL9 & GetMaterial () const
const IDirect3DVertexBuffer9 * GetVertices () const
const IDirect3DVertexBuffer9 * GetVertices (unsigned index) const
const IDirect3DIndexBuffer9 * GetIndices () const
const IDirect3DVertexShader9 * GetVertexShader () const
const IDirect3DPixelShader9 * GetPixelShader () const
const IDirect3DVertexDeclaration9 * GetVertexDeclaration () const
bool SetWorldTransform (const ml7::Matrix4x4 &world)
bool SetViewTransform (const ml7::Matrix4x4 &view)
bool SetProjectionTransform (const ml7::Matrix4x4 &projection)
bool SetViewport (const D3DVIEWPORT9 &viewport)
bool SetColorRenderTarget (IDirect3DSurface9 *color_render_target)
bool SetColorRenderTarget (unsigned index, IDirect3DSurface9 *color_render_target)
bool SetDepthStencilTarget (IDirect3DSurface9 *depth_stencil_target)
bool SetFVF (unsigned long fvf)
bool SetRenderState (D3DRENDERSTATETYPE rst, unsigned long value)
bool SetTextureState (unsigned stage, D3DTEXTURESTAGESTATETYPE tss, unsigned long value)
bool SetSamplerState (unsigned stage, D3DSAMPLERSTATETYPE ss, unsigned long value)
bool SetRenderStateF (D3DRENDERSTATETYPE rst, float value)
bool SetTextureStateF (unsigned stage, D3DTEXTURESTAGESTATETYPE tss, float value)
bool SetSamplerStateF (unsigned stage, D3DSAMPLERSTATETYPE ss, float value)
bool SetTexture (unsigned stage, IDirect3DBaseTexture9 *texture)
bool SetMaterial (const D3DMATERIAL9 &material)
bool SetVertices (IDirect3DVertexBuffer9 *vertices, unsigned stride)
bool SetVertices (unsigned index, IDirect3DVertexBuffer9 *vertices, unsigned stride)
bool SetIndices (IDirect3DIndexBuffer9 *indices)
bool SetVertexShader (IDirect3DVertexShader9 *vertex_shader)
bool SetPixelShader (IDirect3DPixelShader9 *pixel_shader)
bool SetVertexDeclaration (IDirect3DVertexDeclaration9 *vertex_decl)

Public Attributes

friend StateMachine
friend RenderDevice

Static Public Attributes

static const unsigned long MAX_RENDER_TARGETS = 4
static const unsigned long MAX_TEXTURE_STAGES = 8
static const unsigned long MAX_DATA_STREAMS = 16
static const unsigned long MAX_RENDER_STATES = 210
static const unsigned long MAX_TEXTURE_STATES = 33
static const unsigned long MAX_SAMPLER_STATES = 14
static const bool RENDER_STATES_FLAGS [MAX_RENDER_STATES]
static const bool TEXTURE_STATES_FLAGS [MAX_TEXTURE_STATES]
static const bool SAMPLER_STATES_FLAGS [MAX_SAMPLER_STATES]
static const Category RENDER_STATES_CATEGORIES [MAX_RENDER_STATES]
static const Category TEXTURE_STATES_CATEGORIES [MAX_TEXTURE_STATES]
static const Category SAMPLER_STATES_CATEGORIES [MAX_SAMPLER_STATES]

Detailed Description

Represents the state of a render device.


Member Enumeration Documentation

The state categories (for detailed explanation have a look at "Shader X4: Advanced Rendering Techniques", Wolfang Engel (ed.), Charles River Media, 2006).

Enumerator:
NO_STATE 

Dummy value for states being not allocated.

_1st_STD_VAL_STATES 

States that need to have "standard" values. These states need to be restored to the standard values after any effect that modified them.

_2nd_FLC_VAL_STATES 

States that must be set by every technique in each effect. These states do not need to be restored because the next effect will set them anyway.

_3rd_EXP_VAL_STATES 

States that do not affect rendering in "standard" situations. When used, these render states must be set; this usually coincides with setting first-category states to non-default values.

ALL_STATES 

All states of any state category.


Constructor & Destructor Documentation

xl7::direct3d::State::State ( void   ) 

Default constructor.

xl7::direct3d::State::~State ( void   ) 

Destructor.

xl7::direct3d::State::State ( const State rhs  ) 

Copy constructor.


Member Function Documentation

const IDirect3DSurface9 * xl7::direct3d::State::GetColorRenderTarget (  )  const

Returns the current color render target.

const IDirect3DSurface9 * xl7::direct3d::State::GetColorRenderTarget ( unsigned  index  )  const

Returns the current color render target.

const IDirect3DSurface9 * xl7::direct3d::State::GetDepthStencilTarget (  )  const

Returns the current depth render target.

unsigned long xl7::direct3d::State::GetFVF (  )  const

Returns the current flexible vertex format.

const IDirect3DIndexBuffer9 * xl7::direct3d::State::GetIndices (  )  const

Returns the current index buffer.

const D3DMATERIAL9 & xl7::direct3d::State::GetMaterial (  )  const

Returns the current material.

const IDirect3DPixelShader9 * xl7::direct3d::State::GetPixelShader (  )  const

Returns the current pixel shader.

const ml7::Matrix4x4 & xl7::direct3d::State::GetProjectionTransform (  )  const

Returns the current projection transform matrix.

unsigned long xl7::direct3d::State::GetRenderState ( D3DRENDERSTATETYPE  rst  )  const

Returns the current value of a given render state.

float xl7::direct3d::State::GetRenderStateF ( D3DRENDERSTATETYPE  rst  )  const

Returns the current (float) value of a given render state.

unsigned long xl7::direct3d::State::GetSamplerState ( unsigned  stage,
D3DSAMPLERSTATETYPE  ss 
) const

Returns the current value of a given sampler state.

float xl7::direct3d::State::GetSamplerStateF ( unsigned  stage,
D3DSAMPLERSTATETYPE  ss 
) const

Returns the current (float) value of a given sampler state.

const IDirect3DBaseTexture9 * xl7::direct3d::State::GetTexture ( unsigned  stage  )  const

Returns the current texture of a given stage.

unsigned long xl7::direct3d::State::GetTextureState ( unsigned  stage,
D3DTEXTURESTAGESTATETYPE  tss 
) const

Returns the current value of a given texture stage state.

float xl7::direct3d::State::GetTextureStateF ( unsigned  stage,
D3DTEXTURESTAGESTATETYPE  tss 
) const

Returns the current (float) value of a given texture stage state.

const IDirect3DVertexDeclaration9 * xl7::direct3d::State::GetVertexDeclaration (  )  const

Returns the current vertex declaration.

const IDirect3DVertexShader9 * xl7::direct3d::State::GetVertexShader (  )  const

Returns the current vertex shader.

const IDirect3DVertexBuffer9 * xl7::direct3d::State::GetVertices (  )  const

Returns the current vertex buffer.

const IDirect3DVertexBuffer9 * xl7::direct3d::State::GetVertices ( unsigned  index  )  const

Returns the current vertex buffer.

const D3DVIEWPORT9 & xl7::direct3d::State::GetViewport (  )  const

Returns the current viewport.

const ml7::Matrix4x4 & xl7::direct3d::State::GetViewTransform (  )  const

Returns the current view transform matrix.

const ml7::Matrix4x4 & xl7::direct3d::State::GetWorldTransform (  )  const

Returns the current world transform matrix.

State & xl7::direct3d::State::operator= ( const State rhs  ) 

Copy assignment operator.

bool xl7::direct3d::State::SetColorRenderTarget ( IDirect3DSurface9 *  color_render_target  ) 

Sets the current color render target.

bool xl7::direct3d::State::SetColorRenderTarget ( unsigned  index,
IDirect3DSurface9 *  color_render_target 
)

Sets the current color render target.

bool xl7::direct3d::State::SetDepthStencilTarget ( IDirect3DSurface9 *  depth_stencil_target  ) 

Sets the current depth render target.

bool xl7::direct3d::State::SetFVF ( unsigned long  fvf  ) 

Sets the current flexible vertex format.

bool xl7::direct3d::State::SetIndices ( IDirect3DIndexBuffer9 *  indices  ) 

Sets the current index buffer.

bool xl7::direct3d::State::SetMaterial ( const D3DMATERIAL9 &  material  ) 

Sets the current material.

bool xl7::direct3d::State::SetPixelShader ( IDirect3DPixelShader9 *  pixel_shader  ) 

Sets the current pixel shader.

bool xl7::direct3d::State::SetProjectionTransform ( const ml7::Matrix4x4 projection  ) 

Sets the current projection transform matrix.

bool xl7::direct3d::State::SetRenderState ( D3DRENDERSTATETYPE  rst,
unsigned long  value 
)

Sets the current value of a given render state.

bool xl7::direct3d::State::SetRenderStateF ( D3DRENDERSTATETYPE  rst,
float  value 
)

Sets the current (float) value of a given render state.

bool xl7::direct3d::State::SetSamplerState ( unsigned  stage,
D3DSAMPLERSTATETYPE  ss,
unsigned long  value 
)

Sets the current value of a given sampler state.

bool xl7::direct3d::State::SetSamplerStateF ( unsigned  stage,
D3DSAMPLERSTATETYPE  ss,
float  value 
)

Sets the current (float) value of a given sampler state.

bool xl7::direct3d::State::SetTexture ( unsigned  stage,
IDirect3DBaseTexture9 *  texture 
)

Sets the current texture of a given stage.

bool xl7::direct3d::State::SetTextureState ( unsigned  stage,
D3DTEXTURESTAGESTATETYPE  tss,
unsigned long  value 
)

Sets the current value of a given texture stage state.

bool xl7::direct3d::State::SetTextureStateF ( unsigned  stage,
D3DTEXTURESTAGESTATETYPE  tss,
float  value 
)

Sets the current (float) value of a given texture stage state.

bool xl7::direct3d::State::SetVertexDeclaration ( IDirect3DVertexDeclaration9 *  vertex_decl  ) 

Sets the current vertex declaration.

bool xl7::direct3d::State::SetVertexShader ( IDirect3DVertexShader9 *  vertex_shader  ) 

Sets the current vertex shader.

bool xl7::direct3d::State::SetVertices ( unsigned  index,
IDirect3DVertexBuffer9 *  vertices,
unsigned  stride 
)

Sets the current vertex buffer.

bool xl7::direct3d::State::SetVertices ( IDirect3DVertexBuffer9 *  vertices,
unsigned  stride 
)

Sets the current vertex buffer.

bool xl7::direct3d::State::SetViewport ( const D3DVIEWPORT9 &  viewport  ) 

Sets the current viewport.

bool xl7::direct3d::State::SetViewTransform ( const ml7::Matrix4x4 view  ) 

Sets the current view transform matrix.

bool xl7::direct3d::State::SetWorldTransform ( const ml7::Matrix4x4 world  ) 

Sets the current world transform matrix.


Member Data Documentation

const unsigned long xl7::direct3d::State::MAX_DATA_STREAMS = 16 [static]

The maximum number of concurrent data streams (ignoring hardware capabilities).

const unsigned long xl7::direct3d::State::MAX_RENDER_STATES = 210 [static]

The maximum number of render states.

const unsigned long xl7::direct3d::State::MAX_RENDER_TARGETS = 4 [static]

The maximum number of simultaneous render targets (ignoring hardware capabilities).

const unsigned long xl7::direct3d::State::MAX_SAMPLER_STATES = 14 [static]

The maximum number of sampler states.

const unsigned long xl7::direct3d::State::MAX_TEXTURE_STAGES = 8 [static]

The maximum number of texture stages (ignoring hardware capabilities).

const unsigned long xl7::direct3d::State::MAX_TEXTURE_STATES = 33 [static]

The maximum number of texture stage states.

The categories of all render states.

The flags specifying which "states" indeed are render states.

Initial value:
    {
         NO_STATE,
         _2nd_FLC_VAL_STATES, 
         _2nd_FLC_VAL_STATES, 
         _2nd_FLC_VAL_STATES, 
         _2nd_FLC_VAL_STATES, 
         _2nd_FLC_VAL_STATES, 
         _2nd_FLC_VAL_STATES, 
         _2nd_FLC_VAL_STATES, 
         _2nd_FLC_VAL_STATES, 
         _2nd_FLC_VAL_STATES, 
         _2nd_FLC_VAL_STATES, 
         _2nd_FLC_VAL_STATES, 
         _2nd_FLC_VAL_STATES, 
         _2nd_FLC_VAL_STATES, 
    }

The categories of all sampler states.

Initial value:
    {
         false,
         true, true, true, true, true, true, true, true, true, true,
                        true, true, true
    }

The flags specifying which "states" indeed are sampler states.

Initial value:
    {
         NO_STATE,
         _2nd_FLC_VAL_STATES, 
         _2nd_FLC_VAL_STATES, 
         _2nd_FLC_VAL_STATES, 
         _2nd_FLC_VAL_STATES, 
         _2nd_FLC_VAL_STATES, 
         _2nd_FLC_VAL_STATES, 
         _2nd_FLC_VAL_STATES, 
         _2nd_FLC_VAL_STATES, 
         _2nd_FLC_VAL_STATES, 
         _2nd_FLC_VAL_STATES, 
         _1st_STD_VAL_STATES, 
         NO_STATE, NO_STATE, NO_STATE, NO_STATE, NO_STATE, NO_STATE, NO_STATE, NO_STATE, NO_STATE, NO_STATE,
         _2nd_FLC_VAL_STATES, 
         _2nd_FLC_VAL_STATES, 
         _1st_STD_VAL_STATES, 
         NO_STATE,
         _2nd_FLC_VAL_STATES, 
         _2nd_FLC_VAL_STATES, 
         _2nd_FLC_VAL_STATES, 
         NO_STATE, NO_STATE, NO_STATE,
         _2nd_FLC_VAL_STATES, 
    }

The categories of all texture stage states.

Initial value:
    {
         false,
         true, true, true, true, true, true, true, true, true, true,
                        true,
         false, false, false, false, false, false, false, false, false, false,
         true, true, true,
         false,
         true, true, true,
         false, false, false,
         true
    }

The flags specifying which "states" indeed are texture stage states.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines