diff options
author | Brian Paul <[email protected]> | 2009-07-17 13:23:11 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-07-17 13:23:11 -0600 |
commit | ee0b1bc7d3fe659e0ed2f34a61b322f2bd2b8843 (patch) | |
tree | 7b171b2a4465d170f02f12306e55db90b0e0a868 /progs/glsl/multinoise.c | |
parent | a77b455af05c9987bd0d94084dadb61fe69b17d0 (diff) |
progs/glsl: finish conversion to GLEW
This is a follow-on to b799af91d5ffbee1481161fec29eb4c92b161272.
Remove _func function suffix and unneeded #includes.
Diffstat (limited to 'progs/glsl/multinoise.c')
-rw-r--r-- | progs/glsl/multinoise.c | 39 |
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); |