diff options
author | Michal Krol <michal@vmware.com> | 2009-09-04 15:38:43 +0200 |
---|---|---|
committer | Michal Krol <michal@vmware.com> | 2009-09-04 15:38:43 +0200 |
commit | ecd8d638c423b71c2e09713f60274ccb389f9be1 (patch) | |
tree | bf911cd1349bb91e1804b46b5594620e3bead4ab /progs/glsl/skinning.c | |
parent | c2670f621e6ea338cef2a955cf15cea2ad0525f8 (diff) | |
parent | 4ba872b49bf9412a4b285169381255978d2ccec5 (diff) |
Merge branch 'master' into glsl-pp-rework-1glsl-pp-rework-1
Diffstat (limited to 'progs/glsl/skinning.c')
-rw-r--r-- | progs/glsl/skinning.c | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/progs/glsl/skinning.c b/progs/glsl/skinning.c index 8a65d0667c..65ba98348b 100644 --- a/progs/glsl/skinning.c +++ b/progs/glsl/skinning.c @@ -12,10 +12,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" @@ -64,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); } @@ -106,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); @@ -148,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); } @@ -221,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); @@ -266,6 +262,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); |