"L. Spiro Engine"
|
00001 00018 #ifndef __LSG_COMPILEDSHADERBASE_H__ 00019 #define __LSG_COMPILEDSHADERBASE_H__ 00020 00021 #include "../LSGGraphicsLib.h" 00022 #include "LSGShaderLanguageParser.h" 00023 #include "String/LSTLString.h" 00024 00025 namespace lsg { 00026 00027 class CShader; 00028 00037 class CCompiledShaderBase { 00038 public : 00039 // == Various constructors. 00040 LSE_CALLCTOR CCompiledShaderBase(); 00041 virtual LSE_CALLCTOR ~CCompiledShaderBase(); 00042 00043 00044 // == Functions. 00048 virtual LSVOID LSE_CALL Reset(); 00049 00055 CShaderLanguageParser::LSG_SHADER_TYPES GetType() const; 00056 00062 LSUINT64 LSE_CALL GetId() const; 00063 00069 LSE_INLINE LSUINT32 LSE_CALL GetRef() const; 00070 00074 LSVOID LSE_CALL IncRef(); 00075 00079 LSVOID LSE_CALL DecRef(); 00080 00091 virtual LSBOOL LSE_CALL Compile( const CString &_sShaderText, CShaderLanguageParser::LSG_SHADER_TYPES _stShaderType, CString &_sError ) = 0; 00092 00093 00094 protected : 00095 // == Members. 00099 LSUINT32 m_ui32Id; 00100 00104 CShaderLanguageParser::LSG_SHADER_TYPES m_stType; 00105 00109 LSUINT32 m_ui32Ref; 00110 00114 static LSUINT32 m_ui32IdCounter; 00115 00116 00117 private : 00118 friend class CShader; 00119 }; 00120 00121 00122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00123 // DEFINITIONS 00124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00125 // == Functions. 00131 LSE_INLINE LSUINT32 LSE_CALL CCompiledShaderBase::GetRef() const { 00132 return m_ui32Ref; 00133 } 00134 00135 } // namespace lsg 00136 00137 #endif // __LSG_COMPILEDSHADERBASE_H__