From 90caba3d766406db32e51387f830ce55836f0709 Mon Sep 17 00:00:00 2001 From: Brian Date: Wed, 9 Apr 2008 22:27:36 -0600 Subject: shader utility functions --- progs/util/shaderutil.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 progs/util/shaderutil.h (limited to 'progs/util/shaderutil.h') diff --git a/progs/util/shaderutil.h b/progs/util/shaderutil.h new file mode 100644 index 00000000000..cfb8c1f3b06 --- /dev/null +++ b/progs/util/shaderutil.h @@ -0,0 +1,34 @@ +#ifndef SHADER_UTIL_H +#define SHADER_UTIL_H + + + +struct uniform_info +{ + const char *name; + GLuint size; + GLenum type; /**< GL_FLOAT or GL_INT */ + GLfloat value[4]; + GLint location; /**< filled in by InitUniforms() */ +}; + +#define END_OF_UNIFORMS { NULL, 0, GL_NONE, { 0, 0, 0, 0 }, -1 } + + +extern GLboolean +ShadersSupported(void); + +extern GLuint +CompileShaderText(GLenum shaderType, const char *text); + +extern GLuint +CompileShaderFile(GLenum shaderType, const char *filename); + +extern GLuint +LinkShaders(GLuint vertShader, GLuint fragShader); + +extern void +InitUniforms(GLuint program, struct uniform_info uniforms[]); + + +#endif /* SHADER_UTIL_H */ -- cgit v1.2.3