diff options
author | Chia-I Wu <olvaffe@gmail.com> | 2009-09-15 14:16:22 +0800 |
---|---|---|
committer | Chia-I Wu <olvaffe@gmail.com> | 2009-09-15 14:16:22 +0800 |
commit | e2ba90a9cc762cf00a168f0a59d31e7dc52fc42e (patch) | |
tree | fe3206d7602ad935296884742980f3c4d30bd867 /progs/glsl/twoside.c | |
parent | 11a4292d4eb515813b82b8d688a318adef66b3e6 (diff) | |
parent | b4b8800315637d9218a81c76f09df7d601710d29 (diff) |
Merge commit 'eee/mesa-es' into android
Diffstat (limited to 'progs/glsl/twoside.c')
-rw-r--r-- | progs/glsl/twoside.c | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/progs/glsl/twoside.c b/progs/glsl/twoside.c index 06488bd175..a57484f96c 100644 --- a/progs/glsl/twoside.c +++ b/progs/glsl/twoside.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" @@ -59,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); } @@ -75,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); @@ -125,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); } @@ -229,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);*/ @@ -246,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); @@ -289,10 +285,10 @@ int main(int argc, char *argv[]) { glutInit(&argc, argv); - glutInitWindowPosition( 0, 0); glutInitWindowSize(WinWidth, WinHeight); glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE); win = glutCreateWindow(argv[0]); + glewInit(); glutReshapeFunc(Reshape); glutKeyboardFunc(Key); glutDisplayFunc(Redisplay); |