BambooIsland: C:/Users/easterbunny/Desktop/Echtzeitgraphik-LU/trunk/src/ShaderManager.h Source File

BambooIsland Abgabe 2

- Main Page
- Related Pages
- Classes
- Files

- File List

# C:/Users/easterbunny/Desktop/Echtzeitgraphik-LU/trunk/src/ShaderManager.h

    00001 /*
    00002  * header file for ShaderManager class
    00003  * written by: christian moellinger <ch.moellinger@gmail.com>
    00004  * 10/2010
    00005  */
    00006
    00007 #pragma once
    00008
    00009 #ifndef __realtime_lu_shadermanager_class
    00010 #define __realtime_lu_shadermanager_class
    00011
    00012 #include <vector>
    00013 #include <string>
    00014 #include <stack>
    00015 #include "common_gl.h"
    00016 #include "Shader.h"
    00017
    00019
    00027 class ShaderManager
    00028 {
    00029 private:
    00030     unsigned int                current_active;
    00031
    00032     std::vector<Shader *>       shaders;
    00033     std::vector<std::string>    shader_names;
    00034     std::stack<unsigned int>    active_shader_stack;
    00035
    00036     bool                        shader_lock;
    00037
    00038 public:
    00039     ShaderManager();
    00040     static ShaderManager *instance();
    00041
    00043     void addShader(std::string name, std::string filename_vertex_shader, std::string filename_fragment_shader);
    00044
    00046     void addShader(std::string name, std::string filename_vertex_shader, std::string filename_fragment_shader, std::string filename_geometry_shader);
    00047
    00048     bool activateShader(std::string name);
    00049     GLint getUniform(std::string uniform_name);
    00050     GLint getAttribute(std::string attribute_name);
    00051
    00053     void pushActiveShader();
    00054
    00056     void popActiveShader();
    00057
    00059     void lockActiveShader();
    00060
    00062     void unlockActiveShader();
    00063
    00065     bool isActiveShaderLocked();
    00066 };
    00067
    00068 #endif

All Classes Functions Variables Enumerations Enumerator