summaryrefslogtreecommitdiffstats
path: root/progs/util/shaderutil.h
diff options
context:
space:
mode:
authorBrian <[email protected]>2008-04-09 22:27:36 -0600
committerBrian <[email protected]>2008-04-09 22:30:42 -0600
commit90caba3d766406db32e51387f830ce55836f0709 (patch)
treeaeda8950247a00f3b6d307481492a3a48a00880c /progs/util/shaderutil.h
parentf9c8af31c5a46d176c732f71259a460753276ef6 (diff)
shader utility functions
Diffstat (limited to 'progs/util/shaderutil.h')
-rw-r--r--progs/util/shaderutil.h34
1 files changed, 34 insertions, 0 deletions
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 */