X-Git-Url: http://git.mutantstargoat.com?a=blobdiff_plain;f=src%2Fshader.h;h=86cfed2e1344db6ec7eba18b9ea2430bc53cce24;hb=32feb79dc3b9ddeeab84a0329d53b8aaff86bb80;hp=abfe36420f5f3b734e4cb13d13c258ed89a06013;hpb=369d75c73bf926a6dbcf4d740c8664bbb401602a;p=demo diff --git a/src/shader.h b/src/shader.h index abfe364..86cfed2 100644 --- a/src/shader.h +++ b/src/shader.h @@ -18,10 +18,12 @@ enum SType { class Shader { protected: + SType type; + std::string name; + virtual bool create(char *buf, unsigned int bsz, const char *fname) = 0; public: - SType type; Shader(); virtual ~Shader() = 0; @@ -47,14 +49,9 @@ public: ShaderProgram(); virtual ~ShaderProgram(); - virtual void cache_uniforms() = 0; - - virtual void add_shader(Shader *sdr); - virtual void delete_shaders() = 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; @@ -63,6 +60,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; @@ -77,6 +75,4 @@ public: virtual void set_uniform_matrix(int location, const Mat4 &mat) = 0; }; -ShaderProgram *get_current_program(); - #endif // SHADER_H_