Changeset 5323 in orxonox.OLD for trunk/src/lib/graphics
- Timestamp:
- Oct 8, 2005, 5:27:22 PM (19 years ago)
- Location:
- trunk/src/lib/graphics
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/shader.cc
r5322 r5323 23 23 #include "debug.h" 24 24 #include "array.h" 25 26 #include "resource_manager.h" 25 27 26 28 … … 102 104 } 103 105 106 Shader* Shader::getShader(const char* vertexShaderFile, const char* fragmentShaderFile) 107 { 108 return (Shader*)ResourceManager::getInstance()->load(vertexShaderFile, SHADER, RP_LEVEL, (void*)fragmentShaderFile); 109 } 110 111 bool Shader::unload(Shader* shader) 112 { 113 return ResourceManager::getInstance()->unload(shader); 114 } 115 104 116 Shader* Shader::storedShader = NULL; 105 117 -
trunk/src/lib/graphics/shader.h
r5319 r5323 26 26 class Shader : public BaseObject { 27 27 28 public:28 public: 29 29 Shader(const char* vertexShaderFile = NULL, const char* fragmentShaderFile = NULL); 30 30 virtual ~Shader(); 31 static Shader* getShader(const char* vertexShaderFile, const char* fragmentShaderFile); 32 static bool unload(Shader* shader); 31 33 32 34 bool loadShaderProgramm(SHADER_TYPE type, const char* fileName); … … 41 43 42 44 inline static bool shaderActive() { return (Shader::storedShader != NULL)?true:false; }; 45 inline static Shader* getActiveShader() { return Shader::storedShader; }; 43 46 inline static void suspendShader() { Shader* currShader = storedShader; if (storedShader!= NULL) { Shader::deactivateShader(); Shader::storedShader = currShader;} }; 44 47 inline static void restoreShader() { if (storedShader != NULL) storedShader->activateShader(); storedShader = NULL; };
Note: See TracChangeset
for help on using the changeset viewer.