X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=progs%2Fdemos%2Fshapes%2Fshapes.c;h=8d69fc09f4005182071344a6fb7f3fa456c9256f;hb=580b9f6bd513a4dab7527538c8e7aeca2daeaed6;hp=520a209d0a495db9141e30e0c0b0b2ecc1b47f0d;hpb=ff7ec6ed2620d67541b5a29dab54c5459e5183c3;p=freeglut diff --git a/progs/demos/shapes/shapes.c b/progs/demos/shapes/shapes.c index 520a209..8d69fc0 100644 --- a/progs/demos/shapes/shapes.c +++ b/progs/demos/shapes/shapes.c @@ -44,6 +44,7 @@ #include #include #include +#include #include "glmatrix.h" @@ -285,6 +286,7 @@ GLint getAttribOrUniformLocation(const char* name, GLuint program, GLboolean isA fprintf(stderr, "Warning: Could not bind attrib %s\n", name); } + checkError ("getAttribOrUniformLocation"); return attrib; } else @@ -295,9 +297,9 @@ GLint getAttribOrUniformLocation(const char* name, GLuint program, GLboolean isA fprintf(stderr, "Warning: Could not bind uniform %s\n", name); } + checkError ("getAttribOrUniformLocation"); return uniform; } - checkError ("getAttribOrUniformLocation"); } GLuint program; @@ -690,6 +692,7 @@ static void display(void) gl_UseProgram (program); glutSetVertexAttribCoord3(attribute_fg_coord); glutSetVertexAttribNormal(attribute_fg_normal); + /* There is also a glutSetVertexAttribTexCoord2, which is used only when drawing the teapot, teacup or teaspoon */ gl_matrix_mode(GL_PROJECTION); gl_load_identity(); @@ -851,10 +854,12 @@ static void special (int key, int x, int y) /* Cuboctahedron can't be shown when in shader mode, skip it */ if (useShader && NUMBEROF (table)-1 == ( unsigned )function_index) + { if (key==GLUT_KEY_PAGE_UP) function_index = 0; else function_index -= 1; + } }