"L. Spiro Engine"
|
A base class for compiled shaders, providing a generic interface for setting and getting data from shaders. More...
#include <LSGCompiledShaderBase.h>
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 |
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.
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.
_sShaderText | The shader text to compile. The syntax depends on the target graphics API. |
_stShaderType | The shader type. |
_sError | Holds returned errors. |
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.
LSE_INLINE LSUINT32 LSE_CALL lsg::CCompiledShaderBase::GetRef | ( | ) | const |
Get the reference count.
CShaderLanguageParser::LSG_SHADER_TYPES lsg::CCompiledShaderBase::GetType | ( | ) | const |
Get 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.
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.
LSUINT32 lsg::CCompiledShaderBase::m_ui32Ref [protected] |
Reference counter.