summaryrefslogtreecommitdiff
path: root/progs/glsl/array.c
diff options
context:
space:
mode:
Diffstat (limited to 'progs/glsl/array.c')
-rw-r--r--progs/glsl/array.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/progs/glsl/array.c b/progs/glsl/array.c
index 46ef8043bc..4ed18485ea 100644
--- a/progs/glsl/array.c
+++ b/progs/glsl/array.c
@@ -9,10 +9,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/gl.h>
+#include <GL/glew.h>
#include <GL/glut.h>
-#include <GL/glext.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);
@@ -248,6 +244,7 @@ main(int argc, char *argv[])
glutInitWindowSize(500, 500);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
win = glutCreateWindow(argv[0]);
+ glewInit();
glutReshapeFunc(Reshape);
glutKeyboardFunc(Key);
glutSpecialFunc(SpecialKey);