3dphotoshoot
diff src/shader.h @ 22:d7fe157c402d
fonts
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 13 Jun 2015 05:32:07 +0300 |
parents | 4ca4e3c5a754 |
children |
line diff
1.1 --- a/src/shader.h Thu Jun 11 04:56:33 2015 +0300 1.2 +++ b/src/shader.h Sat Jun 13 05:32:07 2015 +0300 1.3 @@ -2,6 +2,7 @@ 1.4 #define SHADER_H_ 1.5 1.6 #include <vector> 1.7 +#include "vmath/vmath.h" 1.8 1.9 enum SdrDefaultAttrib { 1.10 SDR_ATTR_VERTEX, 1.11 @@ -42,6 +43,25 @@ 1.12 1.13 bool bind() const; 1.14 1.15 + // helper functions for setting uniforms 1.16 + void set_uniform(const char *name, int count, const int *val) const; 1.17 + void set_uniform(const char *name, int count, const float *val) const; 1.18 + void set_uniform(const char *name, const Vector4 &v) const; 1.19 + 1.20 + void set_uniform1i(const char *name, int x) const; 1.21 + void set_uniform2i(const char *name, int x, int y) const; 1.22 + void set_uniform3i(const char *name, int x, int y, int z) const; 1.23 + void set_uniform4i(const char *name, int x, int y, int z, int w) const; 1.24 + 1.25 + void set_uniform1f(const char *name, float x) const; 1.26 + void set_uniform2f(const char *name, float x, float y) const; 1.27 + void set_uniform3f(const char *name, float x, float y, float z) const; 1.28 + void set_uniform4f(const char *name, float x, float y, float z, float w) const; 1.29 + 1.30 + void set_uniform_matrix(const char *name, const float *m) const; 1.31 + void set_uniform_matrix(const char *name, const Matrix4x4 &m) const; 1.32 + 1.33 + 1.34 unsigned int get_globj() const { return prog; } 1.35 }; 1.36