The Nebula Device 3: Direct3D9::D3D9ShaderServer Class Reference

The Nebula Device 3

Direct3D9::D3D9ShaderServer Class Reference

#include <d3d9shaderserver.h>

Inheritance diagram for Direct3D9::D3D9ShaderServer:

Base::ShaderServerBase Core::RefCounted CoreGraphics::ShaderServer


Detailed Description

D3D9 implementation of ShaderServer.

(C) 2007 Radon Labs GmbH

Public Types

enum  ShaderParamBindMode
 shader parameter bind modes

Public Member Functions

 D3D9ShaderServer ()
 constructor
virtual ~D3D9ShaderServer ()
 destructor
bool Open ()
 open the shader server
void Close ()
 close the shader server
bool HasSharedVariableByName (const CoreGraphics::ShaderVariable::Name &name) const
 return true if a shared variable exists by name
bool HasSharedVariableBySemantic (const CoreGraphics::ShaderVariable::Semantic &sem) const
 return true if a shared variable exists by semantic
SizeT GetNumSharedVariables () const
 get number of shared variables
const Ptr
< CoreGraphics::ShaderVariable > & 
GetSharedVariableByIndex (IndexT i) const
 get a shared variable by index
const Ptr
< CoreGraphics::ShaderVariable > & 
GetSharedVariableByName (const CoreGraphics::ShaderVariable::Name &name) const
 get a shared variable by name
const Ptr
< CoreGraphics::ShaderVariable > & 
GetSharedVariableBySemantic (const CoreGraphics::ShaderVariable::Semantic &sem) const
 get a shared variable by semantic
ID3DXEffectPool * GetD3D9EffectPool () const
 get pointer to global effect pool
void SetShaderParamBindMode (ShaderParamBindMode m)
 set shader param bind mode (by name or by semantic, default is by semantic)
ShaderParamBindMode GetShaderParamBindMode () const
 get shader param bind mode
bool IsOpen () const
 return true if the shader server is open
bool HasShader (const Resources::ResourceId &resId) const
 return true if a shader exists
Ptr
< CoreGraphics::ShaderInstance
CreateShaderInstance (const Resources::ResourceId &resId)
 create a new shader instance
const
Util::Dictionary
< Resources::ResourceId,
Ptr
< CoreGraphics::Shader > > & 
GetAllShaders () const
 get all loaded shaders
void SetActiveShaderInstance (const Ptr< CoreGraphics::ShaderInstance > &shaderInst)
 set currently active shader instance
const Ptr
< CoreGraphics::ShaderInstance > & 
GetActiveShaderInstance () const
 get currently active shader instance
void ResetFeatureBits ()
 reset the current feature bits
void SetFeatureBits (CoreGraphics::ShaderFeature::Mask m)
 set shader feature by bit mask
void ClearFeatureBits (CoreGraphics::ShaderFeature::Mask m)
 clear shader feature by bit mask
CoreGraphics::ShaderFeature::Mask GetFeatureBits () const
 get the current feature mask
CoreGraphics::ShaderFeature::Mask FeatureStringToMask (const Util::String &str)
 convert a shader feature string into a feature bit mask
Util::String FeatureMaskToString (CoreGraphics::ShaderFeature::Mask mask)
 convert shader feature bit mask into string
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!)

Member Function Documentation

Ptr< ShaderInstance > Base::ShaderServerBase::CreateShaderInstance ( const Resources::ResourceId resId  )  [inherited]

create a new shader instance

This creates a clone of a template shader. This is the only method to create a new shader object. When the shader instance is no longer needed, call UnregisterShaderInstance() for proper cleanup.

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.