gl_glsl_shader_system.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2008 by Kutumov Alexey                                  *
00003  *   ru.pixel@gmail.com                                                    *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
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

Generated on Thu Mar 5 22:36:42 2009 for gpucalc by  doxygen 1.5.6