summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian <[email protected]>2008-04-09 22:29:33 -0600
committerBrian <[email protected]>2008-04-09 22:30:42 -0600
commit26f0b8f5068bcaa8269030c86e0ab493bdc9f2e8 (patch)
tree973f976a10d641fb7a58ee325dd015502a4e847f
parent2dca3373ae6207d2deb375148f4dce1817cfd5b7 (diff)
use InitUniforms()
-rw-r--r--progs/glsl/mandelbrot.c25
1 files changed, 1 insertions, 24 deletions
diff --git a/progs/glsl/mandelbrot.c b/progs/glsl/mandelbrot.c
index a15aad981cb..fa67a3c2cae 100644
--- a/progs/glsl/mandelbrot.c
+++ b/progs/glsl/mandelbrot.c
@@ -154,8 +154,6 @@ SpecialKey(int key, int x, int y)
static void
Init(void)
{
- GLint i;
-
if (!ShadersSupported())
exit(1);
@@ -167,28 +165,7 @@ Init(void)
glUseProgram_func(program);
- for (i = 0; Uniforms[i].name; i++) {
- Uniforms[i].location
- = glGetUniformLocation_func(program, Uniforms[i].name);
- printf("Uniform %s location: %d\n", Uniforms[i].name,
- Uniforms[i].location);
- switch (Uniforms[i].size) {
- case 1:
- glUniform1fv_func(Uniforms[i].location, 1, Uniforms[i].value);
- break;
- case 2:
- glUniform2fv_func(Uniforms[i].location, 1, Uniforms[i].value);
- break;
- case 3:
- glUniform3fv_func(Uniforms[i].location, 1, Uniforms[i].value);
- break;
- case 4:
- glUniform4fv_func(Uniforms[i].location, 1, Uniforms[i].value);
- break;
- default:
- abort();
- }
- }
+ InitUniforms(program, Uniforms);
uZoom = glGetUniformLocation_func(program, "Zoom");
uXcenter = glGetUniformLocation_func(program, "Xcenter");