aboutsummaryrefslogtreecommitdiffstats
path: root/progs/glsl/multinoise.c
diff options
context:
space:
mode:
Diffstat (limited to 'progs/glsl/multinoise.c')
-rw-r--r--progs/glsl/multinoise.c39
1 files changed, 17 insertions, 22 deletions
diff --git a/progs/glsl/multinoise.c b/progs/glsl/multinoise.c
index 400511508e1..0afe2308012 100644
--- a/progs/glsl/multinoise.c
+++ b/progs/glsl/multinoise.c
@@ -9,10 +9,7 @@
#include <stdlib.h>
#include <math.h>
#include <GL/glew.h>
-#include <GL/gl.h>
#include <GL/glut.h>
-#include <GL/glext.h>
-#include "extfuncs.h"
static const char *VertShaderText =
"void main() {\n"
@@ -108,10 +105,10 @@ CleanUp(void)
{
GLint i;
- glDeleteShader_func(vertShader);
+ glDeleteShader(vertShader);
for( i = 0; i < 4; i++ ) {
- glDeleteShader_func(fragShader[ i ]);
- glDeleteProgram_func(program[ i ]);
+ glDeleteShader(fragShader[ i ]);
+ glDeleteProgram(program[ i ]);
}
glutDestroyWindow(win);
}
@@ -144,7 +141,7 @@ Key(unsigned char key, int x, int y)
case '2':
case '3':
case '4':
- glUseProgram_func(program[ key - '1' ]);
+ glUseProgram(program[ key - '1' ]);
break;
case 27:
CleanUp();
@@ -187,15 +184,15 @@ LoadAndCompileShader(GLuint shader, const char *text)
{
GLint stat;
- glShaderSource_func(shader, 1, (const GLchar **) &text, NULL);
+ glShaderSource(shader, 1, (const GLchar **) &text, NULL);
- glCompileShader_func(shader);
+ glCompileShader(shader);
- glGetShaderiv_func(shader, GL_COMPILE_STATUS, &stat);
+ glGetShaderiv(shader, GL_COMPILE_STATUS, &stat);
if (!stat) {
GLchar log[1000];
GLsizei len;
- glGetShaderInfoLog_func(shader, 1000, &len, log);
+ glGetShaderInfoLog(shader, 1000, &len, log);
fprintf(stderr, "noise: problem compiling shader: %s\n", log);
exit(1);
}
@@ -209,11 +206,11 @@ static void
CheckLink(GLuint prog)
{
GLint stat;
- glGetProgramiv_func(prog, GL_LINK_STATUS, &stat);
+ glGetProgramiv(prog, GL_LINK_STATUS, &stat);
if (!stat) {
GLchar log[1000];
GLsizei len;
- glGetProgramInfoLog_func(prog, 1000, &len, log);
+ glGetProgramInfoLog(prog, 1000, &len, log);
fprintf(stderr, "Linker error:\n%s\n", log);
}
else {
@@ -234,22 +231,20 @@ Init(void)
/*exit(1);*/
}
- GetExtensionFuncs();
-
- vertShader = glCreateShader_func(GL_VERTEX_SHADER);
+ vertShader = glCreateShader(GL_VERTEX_SHADER);
LoadAndCompileShader(vertShader, VertShaderText);
for( i = 0; i < 4; i++ ) {
- fragShader[ i ] = glCreateShader_func(GL_FRAGMENT_SHADER);
+ fragShader[ i ] = glCreateShader(GL_FRAGMENT_SHADER);
LoadAndCompileShader(fragShader[ i ], FragShaderText[ i ]);
- program[ i ] = glCreateProgram_func();
- glAttachShader_func(program[ i ], fragShader[ i ]);
- glAttachShader_func(program[ i ], vertShader);
- glLinkProgram_func(program[ i ]);
+ program[ i ] = glCreateProgram();
+ glAttachShader(program[ i ], fragShader[ i ]);
+ glAttachShader(program[ i ], vertShader);
+ glLinkProgram(program[ i ]);
CheckLink(program[ i ]);
}
- glUseProgram_func(program[ 0 ]);
+ glUseProgram(program[ 0 ]);
assert(glGetError() == 0);