Merge branch 'new-frag-attribs'
[mesa.git] / progs / util / shaderutil.h
1 #ifndef SHADER_UTIL_H
2 #define SHADER_UTIL_H
3
4
5
6 struct uniform_info
7 {
8 const char *name;
9 GLuint size; /**< number of value[] elements: 1, 2, 3 or 4 */
10 GLenum type; /**< GL_FLOAT, GL_FLOAT_VEC4, GL_INT, etc */
11 GLfloat value[4];
12 GLint location; /**< filled in by InitUniforms() */
13 };
14
15 #define END_OF_UNIFORMS { NULL, 0, GL_NONE, { 0, 0, 0, 0 }, -1 }
16
17
18 struct attrib_info
19 {
20 const char *name;
21 GLuint size; /**< number of value[] elements: 1, 2, 3 or 4 */
22 GLenum type; /**< GL_FLOAT, GL_FLOAT_VEC4, GL_INT, etc */
23 GLint location;
24 };
25
26
27 extern GLboolean
28 ShadersSupported(void);
29
30 extern GLuint
31 CompileShaderText(GLenum shaderType, const char *text);
32
33 extern GLuint
34 CompileShaderFile(GLenum shaderType, const char *filename);
35
36 extern GLuint
37 LinkShaders(GLuint vertShader, GLuint fragShader);
38
39 extern void
40 SetUniformValues(GLuint program, struct uniform_info uniforms[]);
41
42 extern GLuint
43 GetUniforms(GLuint program, struct uniform_info uniforms[]);
44
45 extern void
46 PrintUniforms(const struct uniform_info uniforms[]);
47
48 extern GLuint
49 GetAttribs(GLuint program, struct attrib_info attribs[]);
50
51 extern void
52 PrintAttribs(const struct attrib_info attribs[]);
53
54 #endif /* SHADER_UTIL_H */