diff options
author | Brian Paul <brianp@vmware.com> | 2009-07-17 13:23:11 -0600 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2009-07-17 13:23:11 -0600 |
commit | ee0b1bc7d3fe659e0ed2f34a61b322f2bd2b8843 (patch) | |
tree | 7b171b2a4465d170f02f12306e55db90b0e0a868 /progs | |
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')
-rw-r--r-- | progs/glsl/array.c | 16 | ||||
-rw-r--r-- | progs/glsl/bitmap.c | 27 | ||||
-rw-r--r-- | progs/glsl/brick.c | 19 | ||||
-rw-r--r-- | progs/glsl/bump.c | 24 | ||||
-rw-r--r-- | progs/glsl/deriv.c | 19 | ||||
-rw-r--r-- | progs/glsl/fragcoord.c | 19 | ||||
-rw-r--r-- | progs/glsl/identity.c | 19 | ||||
-rw-r--r-- | progs/glsl/linktest.c | 53 | ||||
-rw-r--r-- | progs/glsl/mandelbrot.c | 31 | ||||
-rw-r--r-- | progs/glsl/multinoise.c | 39 | ||||
-rw-r--r-- | progs/glsl/multitex.c | 35 | ||||
-rw-r--r-- | progs/glsl/noise.c | 21 | ||||
-rw-r--r-- | progs/glsl/pointcoord.c | 23 | ||||
-rw-r--r-- | progs/glsl/points.c | 23 | ||||
-rw-r--r-- | progs/glsl/samplers.c | 9 | ||||
-rw-r--r-- | progs/glsl/shadow_sampler.c | 49 | ||||
-rw-r--r-- | progs/glsl/skinning.c | 27 | ||||
-rw-r--r-- | progs/glsl/texaaline.c | 5 | ||||
-rw-r--r-- | progs/glsl/texdemo1.c | 9 | ||||
-rw-r--r-- | progs/glsl/toyball.c | 13 | ||||
-rw-r--r-- | progs/glsl/trirast.c | 31 | ||||
-rw-r--r-- | progs/glsl/twoside.c | 27 | ||||
-rw-r--r-- | progs/glsl/vert-or-frag-only.c | 25 | ||||
-rw-r--r-- | progs/glsl/vert-tex.c | 13 |
24 files changed, 232 insertions, 344 deletions
diff --git a/progs/glsl/array.c b/progs/glsl/array.c index 6da15b2fcc..4ed18485ea 100644 --- a/progs/glsl/array.c +++ b/progs/glsl/array.c @@ -10,9 +10,7 @@ #include <stdlib.h> #include <math.h> #include <GL/glew.h> -#include <GL/gl.h> #include <GL/glut.h> -#include "extfuncs.h" #include "shaderutil.h" @@ -144,9 +142,9 @@ Reshape(int width, int height) static void CleanUp(void) { - glDeleteShader_func(fragShader); - glDeleteShader_func(vertShader); - glDeleteProgram_func(program); + glDeleteShader(fragShader); + glDeleteShader(vertShader); + glDeleteProgram(program); glutDestroyWindow(win); } @@ -219,19 +217,17 @@ Init(void) if (!ShadersSupported()) exit(1); - GetExtensionFuncs(); - vertShader = CompileShaderText(GL_VERTEX_SHADER, VertShaderText); fragShader = CompileShaderText(GL_FRAGMENT_SHADER, FragShaderText); program = LinkShaders(vertShader, fragShader); - glUseProgram_func(program); + glUseProgram(program); /* Setup the HeightArray[] uniform */ for (i = 0; i < 20; i++) HeightArray[i] = i / 20.0; - u = glGetUniformLocation_func(program, "HeightArray"); - glUniform1fv_func(u, 20, HeightArray); + u = glGetUniformLocation(program, "HeightArray"); + glUniform1fv(u, 20, HeightArray); assert(glGetError() == 0); diff --git a/progs/glsl/bitmap.c b/progs/glsl/bitmap.c index 08fac15c89..8b1853d9ab 100644 --- a/progs/glsl/bitmap.c +++ b/progs/glsl/bitmap.c @@ -10,10 +10,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" #include "shaderutil.h" @@ -79,11 +76,11 @@ Redisplay(void) BitmapText("-X"); } else { - glUseProgram_func(Program); + glUseProgram(Program); /* vertex positions (deltas) depend on texture size and window size */ if (uScale != -1) { - glUniform2f_func(uScale, + glUniform2f(uScale, 2.0 * TEX_WIDTH / WinWidth, 2.0 * TEX_HEIGHT / WinHeight); } @@ -106,7 +103,7 @@ Redisplay(void) glTexCoord2f(0, 1); glVertex3fv(nx); glEnd(); - glUseProgram_func(0); + glUseProgram(0); } glPopMatrix(); @@ -161,9 +158,9 @@ Key(unsigned char key, int x, int y) printf("Using billboard texture\n"); break; case 27: - glDeleteShader_func(FragShader); - glDeleteShader_func(VertShader); - glDeleteProgram_func(Program); + glDeleteShader(FragShader); + glDeleteShader(VertShader); + glDeleteProgram(Program); glutDestroyWindow(Win); exit(0); } @@ -278,21 +275,19 @@ Init(void) if (!ShadersSupported()) exit(1); - GetExtensionFuncs(); - VertShader = CompileShaderText(GL_VERTEX_SHADER, vertShaderText); FragShader = CompileShaderText(GL_FRAGMENT_SHADER, fragShaderText); Program = LinkShaders(VertShader, FragShader); - glUseProgram_func(Program); + glUseProgram(Program); - uScale = glGetUniformLocation_func(Program, "scale"); - uTex = glGetUniformLocation_func(Program, "tex2d"); + uScale = glGetUniformLocation(Program, "scale"); + uTex = glGetUniformLocation(Program, "tex2d"); if (uTex != -1) { - glUniform1i_func(uTex, 0); /* tex unit 0 */ + glUniform1i(uTex, 0); /* tex unit 0 */ } - glUseProgram_func(0); + glUseProgram(0); glClearColor(0.3f, 0.3f, 0.3f, 0.0f); glEnable(GL_DEPTH_TEST); diff --git a/progs/glsl/brick.c b/progs/glsl/brick.c index 607acd0597..1d08b231e7 100644 --- a/progs/glsl/brick.c +++ b/progs/glsl/brick.c @@ -10,10 +10,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" #include "shaderutil.h" @@ -83,9 +80,9 @@ Reshape(int width, int height) static void CleanUp(void) { - glDeleteShader_func(fragShader); - glDeleteShader_func(vertShader); - glDeleteProgram_func(program); + glDeleteShader(fragShader); + glDeleteShader(vertShader); + glDeleteProgram(program); glutDestroyWindow(win); } @@ -145,13 +142,11 @@ Init(void) if (!ShadersSupported()) exit(1); - GetExtensionFuncs(); - vertShader = CompileShaderFile(GL_VERTEX_SHADER, VertProgFile); fragShader = CompileShaderFile(GL_FRAGMENT_SHADER, FragProgFile); program = LinkShaders(vertShader, fragShader); - glUseProgram_func(program); + glUseProgram(program); InitUniforms(program, Uniforms); @@ -161,9 +156,9 @@ Init(void) printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER)); - assert(glIsProgram_func(program)); - assert(glIsShader_func(fragShader)); - assert(glIsShader_func(vertShader)); + assert(glIsProgram(program)); + assert(glIsShader(fragShader)); + assert(glIsShader(vertShader)); glColor3f(1, 0, 0); } diff --git a/progs/glsl/bump.c b/progs/glsl/bump.c index c401e590f7..ddb986abcb 100644 --- a/progs/glsl/bump.c +++ b/progs/glsl/bump.c @@ -9,10 +9,8 @@ #include <stdio.h> #include <stdlib.h> #include <math.h> +#include <GL/glew.h> #include <GL/glut.h> -#include <GL/glu.h> -#include <GL/glext.h> -#include "extfuncs.h" #include "shaderutil.h" @@ -60,7 +58,7 @@ static void Square(GLfloat size) { glNormal3f(0, 0, 1); - glVertexAttrib3f_func(tangentAttrib, 1, 0, 0); + glVertexAttrib3f(tangentAttrib, 1, 0, 0); glBegin(GL_POLYGON); glTexCoord2f(0, 0); glVertex2f(-size, -size); glTexCoord2f(1, 0); glVertex2f( size, -size); @@ -164,9 +162,9 @@ Reshape(int width, int height) static void CleanUp(void) { - glDeleteShader_func(fragShader); - glDeleteShader_func(vertShader); - glDeleteProgram_func(program); + glDeleteShader(fragShader); + glDeleteShader(vertShader); + glDeleteProgram(program); glutDestroyWindow(win); } @@ -230,17 +228,15 @@ Init(void) if (!ShadersSupported()) exit(1); - GetExtensionFuncs(); - vertShader = CompileShaderFile(GL_VERTEX_SHADER, VertProgFile); fragShader = CompileShaderFile(GL_FRAGMENT_SHADER, FragProgFile); program = LinkShaders(vertShader, fragShader); - glUseProgram_func(program); + glUseProgram(program); - assert(glIsProgram_func(program)); - assert(glIsShader_func(fragShader)); - assert(glIsShader_func(vertShader)); + assert(glIsProgram(program)); + assert(glIsShader(fragShader)); + assert(glIsShader(vertShader)); assert(glGetError() == 0); @@ -250,7 +246,7 @@ Init(void) CheckError(__LINE__); - tangentAttrib = glGetAttribLocation_func(program, "Tangent"); + tangentAttrib = glGetAttribLocation(program, "Tangent"); printf("Tangent Attrib: %d\n", tangentAttrib); assert(tangentAttrib >= 0); diff --git a/progs/glsl/deriv.c b/progs/glsl/deriv.c index 3fd674c331..9cf1e40e3e 100644 --- a/progs/glsl/deriv.c +++ b/progs/glsl/deriv.c @@ -14,10 +14,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" #include "shaderutil.h" @@ -71,9 +68,9 @@ Reshape(int width, int height) static void CleanUp(void) { - glDeleteShader_func(fragShader); - glDeleteShader_func(vertShader); - glDeleteProgram_func(program); + glDeleteShader(fragShader); + glDeleteShader(vertShader); + glDeleteProgram(program); glutDestroyWindow(win); } @@ -178,13 +175,11 @@ Init(void) if (!ShadersSupported()) exit(1); - GetExtensionFuncs(); - vertShader = CompileShaderText(GL_VERTEX_SHADER, vertShaderText); fragShader = CompileShaderText(GL_FRAGMENT_SHADER, fragShaderText); program = LinkShaders(vertShader, fragShader); - glUseProgram_func(program); + glUseProgram(program); /*assert(glGetError() == 0);*/ @@ -198,9 +193,9 @@ Init(void) printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER)); - assert(glIsProgram_func(program)); - assert(glIsShader_func(fragShader)); - assert(glIsShader_func(vertShader)); + assert(glIsProgram(program)); + assert(glIsShader(fragShader)); + assert(glIsShader(vertShader)); glColor3f(1, 0, 0); } diff --git a/progs/glsl/fragcoord.c b/progs/glsl/fragcoord.c index 509ad47e7f..9f56a038c9 100644 --- a/progs/glsl/fragcoord.c +++ b/progs/glsl/fragcoord.c @@ -13,10 +13,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" #include "shaderutil.h" @@ -86,9 +83,9 @@ Reshape(int width, int height) static void CleanUp(void) { - glDeleteShader_func(fragShader); - glDeleteShader_func(vertShader); - glDeleteProgram_func(program); + glDeleteShader(fragShader); + glDeleteShader(vertShader); + glDeleteProgram(program); glutDestroyWindow(win); } @@ -130,13 +127,11 @@ Init(void) if (!ShadersSupported()) exit(1); - GetExtensionFuncs(); - vertShader = CompileShaderText(GL_VERTEX_SHADER, vertShaderText); fragShader = CompileShaderText(GL_FRAGMENT_SHADER, fragShaderText); program = LinkShaders(vertShader, fragShader); - glUseProgram_func(program); + glUseProgram(program); /*assert(glGetError() == 0);*/ @@ -144,9 +139,9 @@ Init(void) printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER)); - assert(glIsProgram_func(program)); - assert(glIsShader_func(fragShader)); - assert(glIsShader_func(vertShader)); + assert(glIsProgram(program)); + assert(glIsShader(fragShader)); + assert(glIsShader(vertShader)); glColor3f(1, 0, 0); } diff --git a/progs/glsl/identity.c b/progs/glsl/identity.c index 5ba7468cc4..a772ccd716 100644 --- a/progs/glsl/identity.c +++ b/progs/glsl/identity.c @@ -10,10 +10,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" #include "shaderutil.h" @@ -70,9 +67,9 @@ Reshape(int width, int height) static void CleanUp(void) { - glDeleteShader_func(fragShader); - glDeleteShader_func(vertShader); - glDeleteProgram_func(program); + glDeleteShader(fragShader); + glDeleteShader(vertShader); + glDeleteProgram(program); glutDestroyWindow(win); } @@ -142,8 +139,6 @@ Init(void) if (!ShadersSupported()) exit(1); - GetExtensionFuncs(); - if (FragProgFile) fragShader = CompileShaderFile(GL_FRAGMENT_SHADER, FragProgFile); else @@ -156,7 +151,7 @@ Init(void) program = LinkShaders(vertShader, fragShader); - glUseProgram_func(program); + glUseProgram(program); /*assert(glGetError() == 0);*/ @@ -165,9 +160,9 @@ Init(void) printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER)); - assert(glIsProgram_func(program)); - assert(glIsShader_func(fragShader)); - assert(glIsShader_func(vertShader)); + assert(glIsProgram(program)); + assert(glIsShader(fragShader)); + assert(glIsShader(vertShader)); glColor3f(1, 0, 0); } diff --git a/progs/glsl/linktest.c b/progs/glsl/linktest.c index fe5d1564e0..ec3fffbf9c 100644 --- a/progs/glsl/linktest.c +++ b/progs/glsl/linktest.c @@ -10,10 +10,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" #include "shaderutil.h" @@ -133,11 +130,11 @@ Reshape(int width, int height) static void CleanUp(void) { - glDeleteShader_func(VertShader1); - glDeleteShader_func(VertShader2); - glDeleteShader_func(FragShader1); - glDeleteShader_func(FragShader2); - glDeleteProgram_func(Program); + glDeleteShader(VertShader1); + glDeleteShader(VertShader2); + glDeleteShader(FragShader1); + glDeleteShader(FragShader2); + glDeleteProgram(Program); glutDestroyWindow(Win); } @@ -176,11 +173,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); } } @@ -192,8 +189,6 @@ Init(void) if (!ShadersSupported()) exit(1); - GetExtensionFuncs(); - printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER)); VertShader1 = CompileShaderText(GL_VERTEX_SHADER, VertShaderSource1); @@ -201,26 +196,26 @@ Init(void) FragShader1 = CompileShaderText(GL_FRAGMENT_SHADER, FragShaderSource1); FragShader2 = CompileShaderText(GL_FRAGMENT_SHADER, FragShaderSource2); - Program = glCreateProgram_func(); - glAttachShader_func(Program, VertShader1); - glAttachShader_func(Program, VertShader2); - glAttachShader_func(Program, FragShader1); - glAttachShader_func(Program, FragShader2); + Program = glCreateProgram(); + glAttachShader(Program, VertShader1); + glAttachShader(Program, VertShader2); + glAttachShader(Program, FragShader1); + glAttachShader(Program, FragShader2); - glLinkProgram_func(Program); + glLinkProgram(Program); CheckLink(Program); - glUseProgram_func(Program); + glUseProgram(Program); - uDiffuse = glGetUniformLocation_func(Program, "diffuse"); - uSpecular = glGetUniformLocation_func(Program, "specular"); - uTexture = glGetUniformLocation_func(Program, "texture"); + uDiffuse = glGetUniformLocation(Program, "diffuse"); + uSpecular = glGetUniformLocation(Program, "specular"); + uTexture = glGetUniformLocation(Program, "texture"); printf("DiffusePos %d SpecularPos %d TexturePos %d\n", uDiffuse, uSpecular, uTexture); - glUniform4fv_func(uDiffuse, 1, diffuse); - glUniform4fv_func(uSpecular, 1, specular); + glUniform4fv(uDiffuse, 1, diffuse); + glUniform4fv(uSpecular, 1, specular); glClearColor(0.3f, 0.3f, 0.3f, 0.0f); glEnable(GL_DEPTH_TEST); @@ -229,11 +224,11 @@ Init(void) glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, specular); glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, 10.0f); - assert(glIsProgram_func(Program)); - assert(glIsShader_func(VertShader1)); - assert(glIsShader_func(VertShader2)); - assert(glIsShader_func(FragShader1)); - assert(glIsShader_func(FragShader2)); + assert(glIsProgram(Program)); + assert(glIsShader(VertShader1)); + assert(glIsShader(VertShader2)); + assert(glIsShader(FragShader1)); + assert(glIsShader(FragShader2)); glColor3f(1, 0, 0); } diff --git a/progs/glsl/mandelbrot.c b/progs/glsl/mandelbrot.c index eeea4eb52a..38dffc3e74 100644 --- a/progs/glsl/mandelbrot.c +++ b/progs/glsl/mandelbrot.c @@ -10,10 +10,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" #include "shaderutil.h" @@ -57,9 +54,9 @@ Redisplay(void) glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); /* set interactive uniform parameters */ - glUniform1fv_func(uZoom, 1, &zoom); - glUniform1fv_func(uXcenter, 1, &xCenter); - glUniform1fv_func(uYcenter, 1, &yCenter); + glUniform1fv(uZoom, 1, &zoom); + glUniform1fv(uXcenter, 1, &xCenter); + glUniform1fv(uYcenter, 1, &yCenter); glPushMatrix(); glRotatef(xRot, 1.0f, 0.0f, 0.0f); @@ -95,9 +92,9 @@ Reshape(int width, int height) static void CleanUp(void) { - glDeleteShader_func(fragShader); - glDeleteShader_func(vertShader); - glDeleteProgram_func(program); + glDeleteShader(fragShader); + glDeleteShader(vertShader); + glDeleteProgram(program); glutDestroyWindow(win); } @@ -156,19 +153,17 @@ Init(void) if (!ShadersSupported()) exit(1); - GetExtensionFuncs(); - vertShader = CompileShaderFile(GL_VERTEX_SHADER, VertProgFile); fragShader = CompileShaderFile(GL_FRAGMENT_SHADER, FragProgFile); program = LinkShaders(vertShader, fragShader); - glUseProgram_func(program); + glUseProgram(program); InitUniforms(program, Uniforms); - uZoom = glGetUniformLocation_func(program, "Zoom"); - uXcenter = glGetUniformLocation_func(program, "Xcenter"); - uYcenter = glGetUniformLocation_func(program, "Ycenter"); + uZoom = glGetUniformLocation(program, "Zoom"); + uXcenter = glGetUniformLocation(program, "Xcenter"); + uYcenter = glGetUniformLocation(program, "Ycenter"); assert(glGetError() == 0); @@ -176,9 +171,9 @@ Init(void) printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER)); - assert(glIsProgram_func(program)); - assert(glIsShader_func(fragShader)); - assert(glIsShader_func(vertShader)); + assert(glIsProgram(program)); + assert(glIsShader(fragShader)); + assert(glIsShader(vertShader)); glColor3f(1, 0, 0); } diff --git a/progs/glsl/multinoise.c b/progs/glsl/multinoise.c index 400511508e..0afe230801 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); diff --git a/progs/glsl/multitex.c b/progs/glsl/multitex.c index 724f15e1a3..913f73be17 100644 --- a/progs/glsl/multitex.c +++ b/progs/glsl/multitex.c @@ -31,7 +31,6 @@ #include <GL/glew.h> #include "GL/glut.h" #include "readtex.h" -#include "extfuncs.h" #include "shaderutil.h" static const char *Demo = "multitex"; @@ -81,22 +80,22 @@ static void DrawPolygonArray(void) { if (VertCoord_attr >= 0) { - glVertexAttribPointer_func(VertCoord_attr, 2, GL_FLOAT, GL_FALSE, + glVertexAttribPointer(VertCoord_attr, 2, GL_FLOAT, GL_FALSE, 0, VertCoords); - glEnableVertexAttribArray_func(VertCoord_attr); + glEnableVertexAttribArray(VertCoord_attr); } else { glVertexPointer(2, GL_FLOAT, 0, VertCoords); glEnable(GL_VERTEX_ARRAY); } - glVertexAttribPointer_func(TexCoord0_attr, 2, GL_FLOAT, GL_FALSE, + glVertexAttribPointer(TexCoord0_attr, 2, GL_FLOAT, GL_FALSE, 0, Tex0Coords); - glEnableVertexAttribArray_func(TexCoord0_attr); + glEnableVertexAttribArray(TexCoord0_attr); - glVertexAttribPointer_func(TexCoord1_attr, 2, GL_FLOAT, GL_FALSE, + glVertexAttribPointer(TexCoord1_attr, 2, GL_FLOAT, GL_FALSE, 0, Tex1Coords); - glEnableVertexAttribArray_func(TexCoord1_attr); + glEnableVertexAttribArray(TexCoord1_attr); glDrawArrays(GL_TRIANGLE_FAN, 0, 4); } @@ -110,11 +109,11 @@ DrawPolygonVert(void) glBegin(GL_TRIANGLE_FAN); for (i = 0; i < 4; i++) { - glVertexAttrib2fv_func(TexCoord0_attr, Tex0Coords[i]); - glVertexAttrib2fv_func(TexCoord1_attr, Tex1Coords[i]); + glVertexAttrib2fv(TexCoord0_attr, Tex0Coords[i]); + glVertexAttrib2fv(TexCoord1_attr, Tex1Coords[i]); if (VertCoord_attr >= 0) - glVertexAttrib2fv_func(VertCoord_attr, VertCoords[i]); + glVertexAttrib2fv(VertCoord_attr, VertCoords[i]); else glVertex2fv(VertCoords[i]); } @@ -268,27 +267,27 @@ CreateProgram(const char *vertProgFile, const char *fragProgFile, assert(vertShader); program = LinkShaders(vertShader, fragShader); - glUseProgram_func(program); + glUseProgram(program); InitUniforms(program, uniforms); - VertCoord_attr = glGetAttribLocation_func(program, "VertCoord"); + VertCoord_attr = glGetAttribLocation(program, "VertCoord"); if (VertCoord_attr > 0) { /* We want the VertCoord attrib to have position zero so that * the call to glVertexAttrib(0, xyz) triggers vertex processing. * Otherwise, if TexCoord0 or TexCoord1 gets position 0 we'd have * to set that attribute last (which is a PITA to manage). */ - glBindAttribLocation_func(program, 0, "VertCoord"); + glBindAttribLocation(program, 0, "VertCoord"); /* re-link */ - glLinkProgram_func(program); + glLinkProgram(program); /* VertCoord_attr should be zero now */ - VertCoord_attr = glGetAttribLocation_func(program, "VertCoord"); + VertCoord_attr = glGetAttribLocation(program, "VertCoord"); assert(VertCoord_attr == 0); } - TexCoord0_attr = glGetAttribLocation_func(program, "TexCoord0"); - TexCoord1_attr = glGetAttribLocation_func(program, "TexCoord1"); + TexCoord0_attr = glGetAttribLocation(program, "TexCoord0"); + TexCoord1_attr = glGetAttribLocation(program, "TexCoord1"); printf("TexCoord0_attr = %d\n", TexCoord0_attr); printf("TexCoord1_attr = %d\n", TexCoord1_attr); @@ -316,8 +315,6 @@ InitGL(void) } printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER)); - GetExtensionFuncs(); - InitTextures(); InitPrograms(); diff --git a/progs/glsl/noise.c b/progs/glsl/noise.c index 83e4696fc9..59f594e78b 100644 --- a/progs/glsl/noise.c +++ b/progs/glsl/noise.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" #include "shaderutil.h" @@ -68,7 +65,7 @@ Redisplay(void) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - glUniform1fv_func(Uniforms[2].location, 1, &Slice); + glUniform1fv(Uniforms[2].location, 1, &Slice); glPushMatrix(); glRotatef(xRot, 1.0f, 0.0f, 0.0f); @@ -104,9 +101,9 @@ Reshape(int width, int height) static void CleanUp(void) { - glDeleteShader_func(fragShader); - glDeleteShader_func(vertShader); - glDeleteProgram_func(program); + glDeleteShader(fragShader); + glDeleteShader(vertShader); + glDeleteProgram(program); glutDestroyWindow(win); } @@ -176,13 +173,11 @@ Init(void) if (!ShadersSupported()) exit(1); - GetExtensionFuncs(); - vertShader = CompileShaderText(GL_VERTEX_SHADER, VertShaderText); fragShader = CompileShaderText(GL_FRAGMENT_SHADER, FragShaderText); program = LinkShaders(vertShader, fragShader); - glUseProgram_func(program); + glUseProgram(program); InitUniforms(program, Uniforms); @@ -192,9 +187,9 @@ Init(void) printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER)); - assert(glIsProgram_func(program)); - assert(glIsShader_func(fragShader)); - assert(glIsShader_func(vertShader)); + assert(glIsProgram(program)); + assert(glIsShader(fragShader)); + assert(glIsShader(vertShader)); glColor3f(1, 0, 0); } diff --git a/progs/glsl/pointcoord.c b/progs/glsl/pointcoord.c index aa01e2166d..27b73a05de 100644 --- a/progs/glsl/pointcoord.c +++ b/progs/glsl/pointcoord.c @@ -11,10 +11,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" #include "shaderutil.h" @@ -65,9 +62,9 @@ Reshape(int width, int height) static void CleanUp(void) { - glDeleteShader_func(fragShader); - glDeleteShader_func(vertShader); - glDeleteProgram_func(program); + glDeleteShader(fragShader); + glDeleteShader(vertShader); + glDeleteProgram(program); glutDestroyWindow(win); } @@ -142,18 +139,16 @@ Init(void) if (!ShadersSupported()) exit(1); - GetExtensionFuncs(); - vertShader = CompileShaderText(GL_VERTEX_SHADER, vertShaderText); fragShader = CompileShaderText(GL_FRAGMENT_SHADER, fragShaderText); program = LinkShaders(vertShader, fragShader); - glUseProgram_func(program); + glUseProgram(program); - tex0 = glGetUniformLocation_func(program, "tex0"); + tex0 = glGetUniformLocation(program, "tex0"); printf("Uniforms: tex0: %d\n", tex0); - glUniform1i_func(tex0, 0); /* tex unit 0 */ + glUniform1i(tex0, 0); /* tex unit 0 */ /*assert(glGetError() == 0);*/ @@ -161,9 +156,9 @@ Init(void) printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER)); - assert(glIsProgram_func(program)); - assert(glIsShader_func(fragShader)); - assert(glIsShader_func(vertShader)); + assert(glIsProgram(program)); + assert(glIsShader(fragShader)); + assert(glIsShader(vertShader)); MakeTexture(); diff --git a/progs/glsl/points.c b/progs/glsl/points.c index 1b346228aa..e5ee38c449 100644 --- a/progs/glsl/points.c +++ b/progs/glsl/points.c @@ -11,10 +11,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" #include "shaderutil.h" @@ -100,7 +97,7 @@ Redisplay(void) */ glPushMatrix(); glTranslatef(0, 1.2, 0); - glUseProgram_func(0); + glUseProgram(0); DrawPoints(GL_FALSE); glPopMatrix(); @@ -109,9 +106,9 @@ Redisplay(void) */ glPushMatrix(); glTranslatef(0, -1.2, 0); - glUseProgram_func(Program); + glUseProgram(Program); if (uViewportInv != -1) { - glUniform2f_func(uViewportInv, 1.0 / WinWidth, 1.0 / WinHeight); + glUniform2f(uViewportInv, 1.0 / WinWidth, 1.0 / WinHeight); } DrawPoints(GL_TRUE); glPopMatrix(); @@ -151,9 +148,9 @@ Key(unsigned char key, int x, int y) Smooth = !Smooth; break; case 27: - glDeleteShader_func(FragShader); - glDeleteShader_func(VertShader); - glDeleteProgram_func(Program); + glDeleteShader(FragShader); + glDeleteShader(VertShader); + glDeleteProgram(Program); glutDestroyWindow(Win); exit(0); } @@ -226,17 +223,15 @@ Init(void) if (!ShadersSupported()) exit(1); - GetExtensionFuncs(); - VertShader = CompileShaderText(GL_VERTEX_SHADER, vertShaderText); FragShader = CompileShaderText(GL_FRAGMENT_SHADER, fragShaderText); Program = LinkShaders(VertShader, FragShader); - glUseProgram_func(Program); + glUseProgram(Program); - uViewportInv = glGetUniformLocation_func(Program, "viewportInv"); + uViewportInv = glGetUniformLocation(Program, "viewportInv"); - glUseProgram_func(0); + glUseProgram(0); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); } diff --git a/progs/glsl/samplers.c b/progs/glsl/samplers.c index cbb264dad1..113e5bbeff 100644 --- a/progs/glsl/samplers.c +++ b/progs/glsl/samplers.c @@ -42,7 +42,6 @@ #include <GL/glew.h> #include "GL/glut.h" #include "readtex.h" -#include "extfuncs.h" #include "shaderutil.h" @@ -291,7 +290,7 @@ CreateProgram(void) assert(vertShader); program = LinkShaders(vertShader, fragShader); - glUseProgram_func(program); + glUseProgram(program); free(fragShaderText); @@ -316,10 +315,10 @@ InitProgram(void) #else sprintf(uname, "tex[%d]", s); #endif - loc = glGetUniformLocation_func(Program, uname); + loc = glGetUniformLocation(Program, uname); assert(loc >= 0); - glUniform1i_func(loc, s); + glUniform1i(loc, s); } } @@ -334,8 +333,6 @@ InitGL(void) printf("GL_RENDERER = %s\n", (const char *) glGetString(GL_RENDERER)); - GetExtensionFuncs(); - glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &NumSamplers); if (NumSamplers > MAX_SAMPLERS) NumSamplers = MAX_SAMPLERS; diff --git a/progs/glsl/shadow_sampler.c b/progs/glsl/shadow_sampler.c index 673ad465ad..0a4d04dd8c 100644 --- a/progs/glsl/shadow_sampler.c +++ b/progs/glsl/shadow_sampler.c @@ -11,10 +11,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" /** Use GL_RECTANGLE texture (with projective texcoords)? */ @@ -67,7 +64,7 @@ Redisplay(void) glPushMatrix(); CheckError(__LINE__); - glUseProgram_func(program); + glUseProgram(program); CheckError(__LINE__); glBegin(GL_POLYGON); @@ -87,7 +84,7 @@ Redisplay(void) glPopMatrix(); - glUseProgram_func(0); + glUseProgram(0); glWindowPos2iARB(80, 20); PrintString("white black white black"); @@ -111,9 +108,9 @@ Reshape(int width, int height) static void CleanUp(void) { - glDeleteShader_func(fragShader); - glDeleteShader_func(vertShader); - glDeleteProgram_func(program); + glDeleteShader(fragShader); + glDeleteShader(vertShader); + glDeleteProgram(program); glutDestroyWindow(win); } @@ -179,13 +176,13 @@ static void LoadAndCompileShader(GLuint shader, const char *text) { GLint stat; - glShaderSource_func(shader, 1, (const GLchar **) &text, NULL); - glCompileShader_func(shader); - glGetShaderiv_func(shader, GL_COMPILE_STATUS, &stat); + glShaderSource(shader, 1, (const GLchar **) &text, NULL); + glCompileShader(shader); + 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, "fslight: problem compiling shader:\n%s\n", log); exit(1); } @@ -223,11 +220,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); } } @@ -267,35 +264,33 @@ Init(void) } printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER)); - GetExtensionFuncs(); - - fragShader = glCreateShader_func(GL_FRAGMENT_SHADER); + fragShader = glCreateShader(GL_FRAGMENT_SHADER); if (FragProgFile) ReadShader(fragShader, FragProgFile); else LoadAndCompileShader(fragShader, fragShaderText); - vertShader = glCreateShader_func(GL_VERTEX_SHADER); + vertShader = glCreateShader(GL_VERTEX_SHADER); if (VertProgFile) ReadShader(vertShader, VertProgFile); else LoadAndCompileShader(vertShader, vertShaderText); - program = glCreateProgram_func(); - glAttachShader_func(program, fragShader); - glAttachShader_func(program, vertShader); - glLinkProgram_func(program); + program = glCreateProgram(); + glAttachShader(program, fragShader); + glAttachShader(program, vertShader); + glLinkProgram(program); CheckLink(program); - glUseProgram_func(program); + glUseProgram(program); - uTexture2D = glGetUniformLocation_func(program, "shadowTex2D"); - uTextureRect = glGetUniformLocation_func(program, "shadowTexRect"); + uTexture2D = glGetUniformLocation(program, "shadowTex2D"); + uTextureRect = glGetUniformLocation(program, "shadowTexRect"); printf("uTexture2D %d uTextureRect %d\n", uTexture2D, uTextureRect); if (uTexture2D >= 0) { - glUniform1i_func(uTexture2D, 0); /* use texture unit 0 */ + glUniform1i(uTexture2D, 0); /* use texture unit 0 */ } if (uTextureRect >= 0) { - glUniform1i_func(uTextureRect, 1); /* use texture unit 0 */ + glUniform1i(uTextureRect, 1); /* use texture unit 0 */ } CheckError(__LINE__); diff --git a/progs/glsl/skinning.c b/progs/glsl/skinning.c index d7b968fed0..65ba98348b 100644 --- a/progs/glsl/skinning.c +++ b/progs/glsl/skinning.c @@ -13,10 +13,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" #include "shaderutil.h" @@ -65,11 +62,11 @@ Cylinder(GLfloat length, GLfloat radius, GLint slices, GLint stacks) float a = (float) i / (slices - 1) * M_PI * 2.0; float x = radius * cos(a); float y = radius * sin(a); - glVertexAttrib1f_func(WeightAttr, w0); + glVertexAttrib1f(WeightAttr, w0); glNormal3f(x, y, 0.0); glVertex3f(x, y, z0); - glVertexAttrib1f_func(WeightAttr, w0 + dw); + glVertexAttrib1f(WeightAttr, w0 + dw); glNormal3f(x, y, 0.0); glVertex3f(x, y, z0 + dz); } @@ -107,8 +104,8 @@ Redisplay(void) { UpdateMatrices(); - glUniformMatrix4fv_func(uMat0, 1, GL_FALSE, Matrices[0]); - glUniformMatrix4fv_func(uMat1, 1, GL_FALSE, Matrices[1]); + glUniformMatrix4fv(uMat0, 1, GL_FALSE, Matrices[0]); + glUniformMatrix4fv(uMat1, 1, GL_FALSE, Matrices[1]); if (WireFrame) glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); @@ -149,9 +146,9 @@ Reshape(int width, int height) static void CleanUp(void) { - glDeleteShader_func(fragShader); - glDeleteShader_func(vertShader); - glDeleteProgram_func(program); + glDeleteShader(fragShader); + glDeleteShader(vertShader); + glDeleteProgram(program); glutDestroyWindow(win); } @@ -222,18 +219,16 @@ Init(void) if (!ShadersSupported()) exit(1); - GetExtensionFuncs(); - vertShader = CompileShaderFile(GL_VERTEX_SHADER, VertProgFile); fragShader = CompileShaderFile(GL_FRAGMENT_SHADER, FragProgFile); program = LinkShaders(vertShader, fragShader); - glUseProgram_func(program); + glUseProgram(program); - uMat0 = glGetUniformLocation_func(program, "mat0"); - uMat1 = glGetUniformLocation_func(program, "mat1"); + uMat0 = glGetUniformLocation(program, "mat0"); + uMat1 = glGetUniformLocation(program, "mat1"); - WeightAttr = glGetAttribLocation_func(program, "weight"); + WeightAttr = glGetAttribLocation(program, "weight"); assert(glGetError() == 0); diff --git a/progs/glsl/texaaline.c b/progs/glsl/texaaline.c index 6720941a6e..1f566c86a6 100644 --- a/progs/glsl/texaaline.c +++ b/progs/glsl/texaaline.c @@ -12,10 +12,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 GLint WinWidth = 300, WinHeight = 300; @@ -329,8 +326,6 @@ Init(void) exit(1); } - GetExtensionFuncs(); - glClearColor(0.3f, 0.3f, 0.3f, 0.0f); printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER)); diff --git a/progs/glsl/texdemo1.c b/progs/glsl/texdemo1.c index 08a87a5152..d55f9e7dd9 100644 --- a/progs/glsl/texdemo1.c +++ b/progs/glsl/texdemo1.c @@ -31,7 +31,6 @@ #include <GL/glew.h> #include "GL/glut.h" #include "readtex.h" -#include "extfuncs.h" #include "shaderutil.h" static const char *Demo = "texdemo1"; @@ -98,7 +97,7 @@ draw(void) /* sphere w/ reflection map */ glPushMatrix(); glTranslatef(0, 1, 0); - glUseProgram_func(Program1); + glUseProgram(Program1); /* setup texture matrix */ glActiveTexture(GL_TEXTURE0); @@ -117,7 +116,7 @@ draw(void) glPopMatrix(); /* ground */ - glUseProgram_func(Program2); + glUseProgram(Program2); glTranslatef(0, -1.0, 0); DrawGround(5); @@ -381,7 +380,7 @@ CreateProgram(const char *vertProgFile, const char *fragProgFile, fragShader = CompileShaderFile(GL_FRAGMENT_SHADER, fragProgFile); program = LinkShaders(vertShader, fragShader); - glUseProgram_func(program); + glUseProgram(program); InitUniforms(program, uniforms); @@ -408,8 +407,6 @@ Init(GLboolean useImageFiles) } printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER)); - GetExtensionFuncs(); - InitTextures(useImageFiles); InitPrograms(); diff --git a/progs/glsl/toyball.c b/progs/glsl/toyball.c index 2b644acb6d..7fe27aebfe 100644 --- a/progs/glsl/toyball.c +++ b/progs/glsl/toyball.c @@ -10,10 +10,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" #include "shaderutil.h" @@ -100,9 +97,9 @@ Reshape(int width, int height) static void CleanUp(void) { - glDeleteShader_func(fragShader); - glDeleteShader_func(vertShader); - glDeleteProgram_func(program); + glDeleteShader(fragShader); + glDeleteShader(vertShader); + glDeleteProgram(program); glutDestroyWindow(win); } @@ -170,13 +167,11 @@ Init(void) if (!ShadersSupported()) exit(1); - GetExtensionFuncs(); - vertShader = CompileShaderFile(GL_VERTEX_SHADER, VertProgFile); fragShader = CompileShaderFile(GL_FRAGMENT_SHADER, FragProgFile); program = LinkShaders(vertShader, fragShader); - glUseProgram_func(program); + glUseProgram(program); InitUniforms(program, Uniforms); diff --git a/progs/glsl/trirast.c b/progs/glsl/trirast.c index 3d4decaa2f..f7546f25a2 100644 --- a/progs/glsl/trirast.c +++ b/progs/glsl/trirast.c @@ -16,10 +16,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" #include "shaderutil.h" @@ -86,9 +83,9 @@ Redisplay(void) RotateVerts(Zrot, 3, TriVerts, v); ComputeBounds(3, v, &xmin, &ymin, &xmax, &ymax); - glUniform2fv_func(uv0, 1, v[0]); - glUniform2fv_func(uv1, 1, v[1]); - glUniform2fv_func(uv2, 1, v[2]); + glUniform2fv(uv0, 1, v[0]); + glUniform2fv(uv1, 1, v[1]); + glUniform2fv(uv2, 1, v[2]); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); @@ -133,9 +130,9 @@ Reshape(int width, int height) static void CleanUp(void) { - glDeleteShader_func(fragShader); - glDeleteShader_func(vertShader); - glDeleteProgram_func(program); + glDeleteShader(fragShader); + glDeleteShader(vertShader); + glDeleteProgram(program); glutDestroyWindow(win); } @@ -197,17 +194,15 @@ Init(void) if (!ShadersSupported()) exit(1); - GetExtensionFuncs(); - vertShader = CompileShaderText(GL_VERTEX_SHADER, vertShaderText); fragShader = CompileShaderText(GL_FRAGMENT_SHADER, fragShaderText); program = LinkShaders(vertShader, fragShader); - glUseProgram_func(program); + glUseProgram(program); - uv0 = glGetUniformLocation_func(program, "v0"); - uv1 = glGetUniformLocation_func(program, "v1"); - uv2 = glGetUniformLocation_func(program, "v2"); + uv0 = glGetUniformLocation(program, "v0"); + uv1 = glGetUniformLocation(program, "v1"); + uv2 = glGetUniformLocation(program, "v2"); printf("Uniforms: %d %d %d\n", uv0, uv1, uv2); /*assert(glGetError() == 0);*/ @@ -217,9 +212,9 @@ Init(void) printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER)); - assert(glIsProgram_func(program)); - assert(glIsShader_func(fragShader)); - assert(glIsShader_func(vertShader)); + assert(glIsProgram(program)); + assert(glIsShader(fragShader)); + assert(glIsShader(vertShader)); glColor3f(1, 0, 0); } diff --git a/progs/glsl/twoside.c b/progs/glsl/twoside.c index 9ebc4ec360..b6c1b477dd 100644 --- a/progs/glsl/twoside.c +++ b/progs/glsl/twoside.c @@ -13,10 +13,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" #include "shaderutil.h" @@ -60,11 +57,11 @@ Redisplay(void) glFrontFace(FrontWinding); if (DetermineFacingInFragProg) { - glUniform1i_func(u_fragface, 1); + glUniform1i(u_fragface, 1); glDisable(GL_VERTEX_PROGRAM_TWO_SIDE); } else { - glUniform1i_func(u_fragface, 0); + glUniform1i(u_fragface, 0); glEnable(GL_VERTEX_PROGRAM_TWO_SIDE); } @@ -76,7 +73,7 @@ Redisplay(void) /* Draw a tristrip ring */ glBegin(GL_TRIANGLE_STRIP); glColor4fv(Red); - glSecondaryColor3fv_func(Green); + glSecondaryColor3fv(Green); for (i = 0; i <= sections; i++) { float a = (float) i / (sections) * M_PI * 2.0; float x = radius * cos(a); @@ -126,9 +123,9 @@ Reshape(int width, int height) static void CleanUp(void) { - glDeleteShader_func(fragShader); - glDeleteShader_func(vertShader); - glDeleteProgram_func(program); + glDeleteShader(fragShader); + glDeleteShader(vertShader); + glDeleteProgram(program); glutDestroyWindow(win); } @@ -230,15 +227,13 @@ Init(void) if (!ShadersSupported()) exit(1); - GetExtensionFuncs(); - vertShader = CompileShaderText(GL_VERTEX_SHADER, vertShaderText); fragShader = CompileShaderText(GL_FRAGMENT_SHADER, fragShaderText); program = LinkShaders(vertShader, fragShader); - glUseProgram_func(program); + glUseProgram(program); - u_fragface = glGetUniformLocation_func(program, "fragface"); + u_fragface = glGetUniformLocation(program, "fragface"); printf("Uniforms: %d\n", u_fragface); /*assert(glGetError() == 0);*/ @@ -247,9 +242,9 @@ Init(void) printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER)); - assert(glIsProgram_func(program)); - assert(glIsShader_func(fragShader)); - assert(glIsShader_func(vertShader)); + assert(glIsProgram(program)); + assert(glIsShader(fragShader)); + assert(glIsShader(vertShader)); glEnable(GL_DEPTH_TEST); diff --git a/progs/glsl/vert-or-frag-only.c b/progs/glsl/vert-or-frag-only.c index 8e1612aca4..81fcab8c5b 100644 --- a/progs/glsl/vert-or-frag-only.c +++ b/progs/glsl/vert-or-frag-only.c @@ -12,10 +12,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" #include "shaderutil.h" @@ -59,14 +56,14 @@ Redisplay(void) glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); /* render with vertex shader only */ - glUseProgram_func(VertProgram); + glUseProgram(VertProgram); glPushMatrix(); glTranslatef(-1.5, 0, 0); DrawQuadTex(); glPopMatrix(); /* render with fragment shader only */ - glUseProgram_func(FragProgram); + glUseProgram(FragProgram); glPushMatrix(); glTranslatef(+1.5, 0, 0); DrawQuadColor(); @@ -91,10 +88,10 @@ Reshape(int width, int height) static void CleanUp(void) { - glDeleteShader_func(FragShader); - glDeleteShader_func(VertShader); - glDeleteProgram_func(VertProgram); - glDeleteProgram_func(FragProgram); + glDeleteShader(FragShader); + glDeleteShader(VertShader); + glDeleteProgram(VertProgram); + glDeleteProgram(FragProgram); glutDestroyWindow(Win); } @@ -130,8 +127,6 @@ Init(void) if (!ShadersSupported()) exit(1); - GetExtensionFuncs(); - if (FragProgFile) FragShader = CompileShaderFile(GL_FRAGMENT_SHADER, FragProgFile); else @@ -150,10 +145,10 @@ Init(void) printf("GL_RENDERER = %s\n",(const char *) glGetString(GL_RENDERER)); - assert(glIsProgram_func(VertProgram)); - assert(glIsProgram_func(FragProgram)); - assert(glIsShader_func(FragShader)); - assert(glIsShader_func(VertShader)); + assert(glIsProgram(VertProgram)); + assert(glIsProgram(FragProgram)); + assert(glIsShader(FragShader)); + assert(glIsShader(VertShader)); glColor3f(1, 0, 0); } diff --git a/progs/glsl/vert-tex.c b/progs/glsl/vert-tex.c index b74bf50679..e791a5759a 100644 --- a/progs/glsl/vert-tex.c +++ b/progs/glsl/vert-tex.c @@ -10,10 +10,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" #include "shaderutil.h" @@ -134,9 +131,9 @@ Reshape(int width, int height) static void CleanUp(void) { - glDeleteShader_func(fragShader); - glDeleteShader_func(vertShader); - glDeleteProgram_func(program); + glDeleteShader(fragShader); + glDeleteShader(vertShader); + glDeleteProgram(program); glutDestroyWindow(win); } @@ -240,13 +237,11 @@ Init(void) if (!ShadersSupported()) exit(1); - GetExtensionFuncs(); - vertShader = CompileShaderText(GL_VERTEX_SHADER, VertShaderText); fragShader = CompileShaderText(GL_FRAGMENT_SHADER, FragShaderText); program = LinkShaders(vertShader, fragShader); - glUseProgram_func(program); + glUseProgram(program); assert(glGetError() == 0); |