"L. Spiro Engine"
Public Member Functions | Protected Attributes | Static Protected Attributes | Friends

lsg::CCompiledShaderBase Class Reference

A base class for compiled shaders, providing a generic interface for setting and getting data from shaders. More...

#include <LSGCompiledShaderBase.h>

Inheritance diagram for lsg::CCompiledShaderBase:
lsg::CDirectX11CompiledShader lsg::CDirectX11PixelShader lsg::CDirectX11VertexShader

List of all members.

Public Member Functions

virtual LSVOID LSE_CALL Reset ()
CShaderLanguageParser::LSG_SHADER_TYPES GetType () const
LSUINT64 LSE_CALL GetId () const
LSE_INLINE LSUINT32 LSE_CALL GetRef () const
LSVOID LSE_CALL IncRef ()
LSVOID LSE_CALL DecRef ()
virtual LSBOOL LSE_CALL Compile (const CString &_sShaderText, CShaderLanguageParser::LSG_SHADER_TYPES _stShaderType, CString &_sError)=0

Protected Attributes

LSUINT32 m_ui32Id
CShaderLanguageParser::LSG_SHADER_TYPES m_stType
LSUINT32 m_ui32Ref

Static Protected Attributes

static LSUINT32 m_ui32IdCounter

Friends

class CShader

Detailed Description

A base class for compiled shaders, providing a generic interface for setting and getting data from shaders.

Class CCompiledShaderBase Description: A base class for compiled shaders, providing a generic interface for setting and getting data from shaders. A CShader object will have one of these per shader part (vertex, pixel, goemetry, etc.) This is overridden by classes that specialize it for OpenGL GLSL, DirectX HLSL, etc.


Member Function Documentation

virtual LSBOOL LSE_CALL lsg::CCompiledShaderBase::Compile ( const CString &  _sShaderText,
CShaderLanguageParser::LSG_SHADER_TYPES  _stShaderType,
CString &  _sError 
) [pure virtual]

Compile to the given platform. Must be overridden. The shader text must be syntactically correct for whatever the target graphics API is. GLSL, HLSL, Cg, etc. This function will register the shader with the hardware after compilation.

Parameters:
_sShaderTextThe shader text to compile. The syntax depends on the target graphics API.
_stShaderTypeThe shader type.
_sErrorHolds returned errors.
Returns:
Returns true if the text compiles on the current graphics API.

Implemented in lsg::CDirectX11PixelShader, and lsg::CDirectX11VertexShader.

LSVOID LSE_CALL lsg::CCompiledShaderBase::DecRef ( )

Decrease the reference count on this object.

LSUINT64 LSE_CALL lsg::CCompiledShaderBase::GetId ( ) const

Get the unique shader ID.

Returns:
Returns the shader ID.
LSE_INLINE LSUINT32 LSE_CALL lsg::CCompiledShaderBase::GetRef ( ) const

Get the reference count.

Returns:
Returns the reference count for this object.
CShaderLanguageParser::LSG_SHADER_TYPES lsg::CCompiledShaderBase::GetType ( ) const

Get the shader type.

Returns:
Returns the shader type.
LSVOID LSE_CALL lsg::CCompiledShaderBase::IncRef ( )

Increase the reference count on this object.

virtual LSVOID LSE_CALL lsg::CCompiledShaderBase::Reset ( ) [virtual]

Reset everything to scratch.

Reimplemented in lsg::CDirectX11CompiledShader, lsg::CDirectX11PixelShader, and lsg::CDirectX11VertexShader.


Member Data Documentation

The shader type.

LSUINT32 lsg::CCompiledShaderBase::m_ui32Id [protected]

The unique ID of this compiled shader.

LSUINT32 lsg::CCompiledShaderBase::m_ui32IdCounter [static, protected]

Unique ID counter.

Reference counter.


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator