diff options
author | Brian Paul <brianp@vmware.com> | 2009-07-17 22:00:47 -0600 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2009-07-17 22:00:47 -0600 |
commit | b96ae1b2c463d6d99ee0418083ef68f4027b7cd7 (patch) | |
tree | f34f89c267b940eb7408475bd0c2ff57c7fbe992 /progs/util | |
parent | f81f57e25db18b1c69f2f8076380603340fa2cda (diff) | |
parent | cd10996d4f517c69e306eaf6dfb0654432651b3a (diff) |
Merge branch 'mesa_7_5_branch'
Conflicts:
Makefile
progs/glsl/multitex.c
src/mesa/main/enums.c
src/mesa/main/state.c
src/mesa/main/texenvprogram.c
src/mesa/main/version.h
Diffstat (limited to 'progs/util')
-rw-r--r-- | progs/util/shaderutil.c | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/progs/util/shaderutil.c b/progs/util/shaderutil.c index 5cef84eb49..13b68d90e0 100644 --- a/progs/util/shaderutil.c +++ b/progs/util/shaderutil.c @@ -11,7 +11,6 @@ #include <stdlib.h> #include <GL/glew.h> #include <GL/glut.h> -#include "extfuncs.h" #include "shaderutil.h" @@ -20,7 +19,6 @@ Init(void) { static GLboolean firstCall = GL_TRUE; if (firstCall) { - GetExtensionFuncs(); firstCall = GL_FALSE; } } @@ -51,14 +49,14 @@ CompileShaderText(GLenum shaderType, const char *text) Init(); - shader = glCreateShader_func(shaderType); - glShaderSource_func(shader, 1, (const GLchar **) &text, NULL); - glCompileShader_func(shader); - glGetShaderiv_func(shader, GL_COMPILE_STATUS, &stat); + shader = glCreateShader(shaderType); + 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, "Error: problem compiling shader: %s\n", log); exit(1); } @@ -110,24 +108,24 @@ CompileShaderFile(GLenum shaderType, const char *filename) GLuint LinkShaders(GLuint vertShader, GLuint fragShader) { - GLuint program = glCreateProgram_func(); + GLuint program = glCreateProgram(); assert(vertShader || fragShader); if (fragShader) - glAttachShader_func(program, fragShader); + glAttachShader(program, fragShader); if (vertShader) - glAttachShader_func(program, vertShader); - glLinkProgram_func(program); + glAttachShader(program, vertShader); + glLinkProgram(program); /* check link */ { GLint stat; - glGetProgramiv_func(program, GL_LINK_STATUS, &stat); + glGetProgramiv(program, GL_LINK_STATUS, &stat); if (!stat) { GLchar log[1000]; GLsizei len; - glGetProgramInfoLog_func(program, 1000, &len, log); + glGetProgramInfoLog(program, 1000, &len, log); fprintf(stderr, "Shader link error:\n%s\n", log); return 0; } @@ -144,7 +142,7 @@ InitUniforms(GLuint program, struct uniform_info uniforms[]) for (i = 0; uniforms[i].name; i++) { uniforms[i].location - = glGetUniformLocation_func(program, uniforms[i].name); + = glGetUniformLocation(program, uniforms[i].name); printf("Uniform %s location: %d\n", uniforms[i].name, uniforms[i].location); @@ -152,19 +150,19 @@ InitUniforms(GLuint program, struct uniform_info uniforms[]) switch (uniforms[i].size) { case 1: if (uniforms[i].type == GL_INT) - glUniform1i_func(uniforms[i].location, + glUniform1i(uniforms[i].location, (GLint) uniforms[i].value[0]); else - glUniform1fv_func(uniforms[i].location, 1, uniforms[i].value); + glUniform1fv(uniforms[i].location, 1, uniforms[i].value); break; case 2: - glUniform2fv_func(uniforms[i].location, 1, uniforms[i].value); + glUniform2fv(uniforms[i].location, 1, uniforms[i].value); break; case 3: - glUniform3fv_func(uniforms[i].location, 1, uniforms[i].value); + glUniform3fv(uniforms[i].location, 1, uniforms[i].value); break; case 4: - glUniform4fv_func(uniforms[i].location, 1, uniforms[i].value); + glUniform4fv(uniforms[i].location, 1, uniforms[i].value); break; default: abort(); |