gl_glsl_shader_system.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00033 #ifndef __gl_glsl_shader_system__header__
00034 #define __gl_glsl_shader_system__header__
00035
00036 #include "gl_glsl_shader_system/gl_glsl_uniform.h"
00037
00038 #include "gpucalc/shader_system.h"
00039 #include "gpucalc/graphic_core.h"
00040
00041 namespace gpucalc
00042 {
00043 const char _GLGLSLShaderSystemObjectName [] = "GLGLSLShaderSystem";
00044
00045
00046 class _GpuCalcPrivate GLGLSLShaderSystem: public ShaderSystem
00047 {
00048
00049
00050 OBJ_DISABLE_COPY(GLGLSLShaderSystem)
00051
00052
00053
00054 public:
00055
00056 GLGLSLShaderSystem();
00057
00058
00059 ~GLGLSLShaderSystem();
00060
00061
00062 Shader * create(const std::string & ShaderName);
00063
00064
00065 Shader * getShaderByName(const std::string & Shadername) const;
00066
00067
00068 bool isShaderCreated(const std::string & ShaderName) const;
00069
00070
00071 void destroy(Shader * shader);
00072
00073
00074
00075 Uniform * create(const Data & data);
00076
00077
00078 Uniform * create(Texture * texture);
00079
00080
00081 Uniform * getUniformByName(const std::string & UniformName) const;
00082
00083
00084 bool isUniformCreated(const std::string & Uniformname) const;
00085
00086
00087 void destroy(Uniform * uniform);
00088
00089
00090 void bind(Shader * shader);
00091
00092
00093 void unbind(Shader * shader);
00094
00095
00096 Shader * getActiveShader() const
00097 {
00098 return mActiveShader;
00099 }
00100
00101
00102 void start();
00103
00104
00105 void stop();
00106
00107
00108 bool isAcceptCore(const GraphicCore * Core) const;
00109
00110
00111 bool isAcceptFileExtension(const std::string & FileExtension) const;
00112
00113
00114 void addAcceptableGraphicCoreID(const std::string & GraphicCoreID);
00115
00116
00117 debugger::CodeInstructor * getCodeInstructor() const;
00118
00119
00120 private:
00121
00122
00123 typedef std::map<std::string, Shader *> ShaderMap;
00124 ShaderMap mShaderMap;
00125
00126
00127 typedef std::map<std::string, Uniform *> UniformMap;
00128 UniformMap mUniformMap;
00129
00130
00131 typedef std::set<std::string> AcceptableGraphicCoreIDset;
00132 AcceptableGraphicCoreIDset mAcceptableGraphicCoreIDset;
00133
00134
00135 bool mIsStarted;
00136
00137
00138 Shader * mActiveShader;
00139
00140
00141 debugger::CodeInstructor * mCodeInstructor;
00142 };
00143 }
00144
00145 #endif