X-Git-Url: http://git.mutantstargoat.com?a=blobdiff_plain;f=src%2Fshader.h;h=6e9509a141101de204910ee3d6d4b19dfcdd1139;hb=855c42d8e50fff743fd7b1be5e91cb0db18def77;hp=53f8654453d20bc3624a10b8215e18b71d99afe0;hpb=31bab00bc3b476be9814c1ee06b9a2f0dc77d4e9;p=demo diff --git a/src/shader.h b/src/shader.h index 53f8654..6e9509a 100644 --- a/src/shader.h +++ b/src/shader.h @@ -1,6 +1,8 @@ #ifndef SHADER_H_ #define SHADER_H_ +#include + #include #include @@ -30,6 +32,7 @@ public: virtual bool load(const char *fname, SType type); virtual void destroy() = 0; + virtual SType get_type(); }; /* Shader Program */ @@ -49,11 +52,9 @@ public: ShaderProgram(); virtual ~ShaderProgram(); - virtual void cache_uniforms() = 0; - virtual bool create() = 0; virtual bool link() = 0; - virtual bool use() = 0; + virtual bool use() const = 0; virtual void destroy() = 0; virtual void attach_shader(Shader *shader) = 0; @@ -62,6 +63,7 @@ public: using descriptor sets. The current design is suitable for OpenGL and it *might* have to be rewritten to work with both APIs later */ + virtual int get_uniform_location(const char *name) const = 0; virtual void set_uniformi(int location, int value) = 0; virtual void set_uniformi(int location, int x, int y) = 0; @@ -76,6 +78,4 @@ public: virtual void set_uniform_matrix(int location, const Mat4 &mat) = 0; }; -ShaderProgram *get_current_program(); - #endif // SHADER_H_