Skip to content

Commit

Permalink
Fixed a few warnings in cubegeom tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmind committed Oct 9, 2013
1 parent 0a229cf commit 95c9e61
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 32 deletions.
35 changes: 19 additions & 16 deletions tests/cubegeom.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ REDISTRIBUTION OF THIS SOFTWARE.

int main(int argc, char *argv[])
{
int temp; // testing
// testing
GLint tempInt;
GLboolean tempBool;
void *tempPtr;

SDL_Surface *screen;
if ( SDL_Init(SDL_INIT_VIDEO) != 0 ) {
Expand Down Expand Up @@ -112,9 +115,9 @@ int main(int argc, char *argv[])

glActiveTexture(GL_TEXTURE0);

glGetBooleanv(GL_VERTEX_ARRAY, &temp); assert(!temp);
glGetBooleanv(GL_VERTEX_ARRAY, &tempBool); assert(!tempBool);
glEnableClientState(GL_VERTEX_ARRAY);
glGetBooleanv(GL_VERTEX_ARRAY, &temp); assert(temp);
glGetBooleanv(GL_VERTEX_ARRAY, &tempBool); assert(tempBool);

GLuint arrayBuffer, elementBuffer;
glGenBuffers(1, &arrayBuffer);
Expand Down Expand Up @@ -197,19 +200,19 @@ int main(int argc, char *argv[])
glNormalPointer(GL_BYTE, 32, (void*)12);
glColorPointer(4, GL_UNSIGNED_BYTE, 32, (void*)28);

glGetPointerv(GL_VERTEX_ARRAY_POINTER, &temp); assert(temp == 0);
glGetPointerv(GL_COLOR_ARRAY_POINTER, &temp); assert(temp == 28);
glGetPointerv(GL_TEXTURE_COORD_ARRAY_POINTER, &temp); assert(temp == 16);
glGetIntegerv(GL_VERTEX_ARRAY_SIZE, &temp); assert(temp == 3);
glGetIntegerv(GL_VERTEX_ARRAY_TYPE, &temp); assert(temp == GL_FLOAT);
glGetIntegerv(GL_VERTEX_ARRAY_STRIDE, &temp); assert(temp == 32);
glGetIntegerv(GL_COLOR_ARRAY_SIZE, &temp); assert(temp == 4);
glGetIntegerv(GL_COLOR_ARRAY_TYPE, &temp); assert(temp == GL_UNSIGNED_BYTE);
glGetIntegerv(GL_COLOR_ARRAY_STRIDE, &temp); assert(temp == 32);
glGetIntegerv(GL_TEXTURE_COORD_ARRAY_SIZE, &temp); assert(temp == 2);
glGetIntegerv(GL_TEXTURE_COORD_ARRAY_TYPE, &temp); assert(temp == GL_FLOAT);
glGetIntegerv(GL_TEXTURE_COORD_ARRAY_STRIDE, &temp); assert(temp == 32);
glGetBooleanv(GL_VERTEX_ARRAY, &temp); assert(temp);
glGetPointerv(GL_VERTEX_ARRAY_POINTER, &tempPtr); assert(tempPtr == (void *)0);
glGetPointerv(GL_COLOR_ARRAY_POINTER, &tempPtr); assert(tempPtr == (void *)28);
glGetPointerv(GL_TEXTURE_COORD_ARRAY_POINTER, &tempPtr); assert(tempPtr == (void *)16);
glGetIntegerv(GL_VERTEX_ARRAY_SIZE, &tempInt); assert(tempInt == 3);
glGetIntegerv(GL_VERTEX_ARRAY_TYPE, &tempInt); assert(tempInt == GL_FLOAT);
glGetIntegerv(GL_VERTEX_ARRAY_STRIDE, &tempInt); assert(tempInt == 32);
glGetIntegerv(GL_COLOR_ARRAY_SIZE, &tempInt); assert(tempInt == 4);
glGetIntegerv(GL_COLOR_ARRAY_TYPE, &tempInt); assert(tempInt == GL_UNSIGNED_BYTE);
glGetIntegerv(GL_COLOR_ARRAY_STRIDE, &tempInt); assert(tempInt == 32);
glGetIntegerv(GL_TEXTURE_COORD_ARRAY_SIZE, &tempInt); assert(tempInt == 2);
glGetIntegerv(GL_TEXTURE_COORD_ARRAY_TYPE, &tempInt); assert(tempInt == GL_FLOAT);
glGetIntegerv(GL_TEXTURE_COORD_ARRAY_STRIDE, &tempInt); assert(tempInt == 32);
glGetBooleanv(GL_VERTEX_ARRAY, &tempBool); assert(tempBool);

glBindTexture(GL_TEXTURE_2D, texture); // diffuse?
glActiveTexture(GL_TEXTURE0);
Expand Down
35 changes: 19 additions & 16 deletions tests/cubegeom_glew.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ REDISTRIBUTION OF THIS SOFTWARE.

int main(int argc, char *argv[])
{
int temp; // testing
// testing
GLint tempInt;
GLboolean tempBool;
void *tempPtr;

SDL_Surface *screen;
if ( SDL_Init(SDL_INIT_VIDEO) != 0 ) {
Expand Down Expand Up @@ -100,9 +103,9 @@ int main(int argc, char *argv[])

glActiveTexture(GL_TEXTURE0);

glGetBooleanv(GL_VERTEX_ARRAY, &temp); assert(!temp);
glGetBooleanv(GL_VERTEX_ARRAY, &tempBool); assert(!tempBool);
glEnableClientState(GL_VERTEX_ARRAY);
glGetBooleanv(GL_VERTEX_ARRAY, &temp); assert(temp);
glGetBooleanv(GL_VERTEX_ARRAY, &tempBool); assert(tempBool);

GLuint arrayBuffer, elementBuffer;
glGenBuffers(1, &arrayBuffer);
Expand Down Expand Up @@ -185,19 +188,19 @@ int main(int argc, char *argv[])
glNormalPointer(GL_BYTE, 32, (void*)12);
glColorPointer(4, GL_UNSIGNED_BYTE, 32, (void*)28);

glGetPointerv(GL_VERTEX_ARRAY_POINTER, &temp); assert(temp == 0);
glGetPointerv(GL_COLOR_ARRAY_POINTER, &temp); assert(temp == 28);
glGetPointerv(GL_TEXTURE_COORD_ARRAY_POINTER, &temp); assert(temp == 16);
glGetIntegerv(GL_VERTEX_ARRAY_SIZE, &temp); assert(temp == 3);
glGetIntegerv(GL_VERTEX_ARRAY_TYPE, &temp); assert(temp == GL_FLOAT);
glGetIntegerv(GL_VERTEX_ARRAY_STRIDE, &temp); assert(temp == 32);
glGetIntegerv(GL_COLOR_ARRAY_SIZE, &temp); assert(temp == 4);
glGetIntegerv(GL_COLOR_ARRAY_TYPE, &temp); assert(temp == GL_UNSIGNED_BYTE);
glGetIntegerv(GL_COLOR_ARRAY_STRIDE, &temp); assert(temp == 32);
glGetIntegerv(GL_TEXTURE_COORD_ARRAY_SIZE, &temp); assert(temp == 2);
glGetIntegerv(GL_TEXTURE_COORD_ARRAY_TYPE, &temp); assert(temp == GL_FLOAT);
glGetIntegerv(GL_TEXTURE_COORD_ARRAY_STRIDE, &temp); assert(temp == 32);
glGetBooleanv(GL_VERTEX_ARRAY, &temp); assert(temp);
glGetPointerv(GL_VERTEX_ARRAY_POINTER, &tempPtr); assert(tempPtr == (void *)0);
glGetPointerv(GL_COLOR_ARRAY_POINTER, &tempPtr); assert(tempPtr == (void *)28);
glGetPointerv(GL_TEXTURE_COORD_ARRAY_POINTER, &tempPtr); assert(tempPtr == (void *)16);
glGetIntegerv(GL_VERTEX_ARRAY_SIZE, &tempInt); assert(tempInt == 3);
glGetIntegerv(GL_VERTEX_ARRAY_TYPE, &tempInt); assert(tempInt == GL_FLOAT);
glGetIntegerv(GL_VERTEX_ARRAY_STRIDE, &tempInt); assert(tempInt == 32);
glGetIntegerv(GL_COLOR_ARRAY_SIZE, &tempInt); assert(tempInt == 4);
glGetIntegerv(GL_COLOR_ARRAY_TYPE, &tempInt); assert(tempInt == GL_UNSIGNED_BYTE);
glGetIntegerv(GL_COLOR_ARRAY_STRIDE, &tempInt); assert(tempInt == 32);
glGetIntegerv(GL_TEXTURE_COORD_ARRAY_SIZE, &tempInt); assert(tempInt == 2);
glGetIntegerv(GL_TEXTURE_COORD_ARRAY_TYPE, &tempInt); assert(tempInt == GL_FLOAT);
glGetIntegerv(GL_TEXTURE_COORD_ARRAY_STRIDE, &tempInt); assert(tempInt == 32);
glGetBooleanv(GL_VERTEX_ARRAY, &tempBool); assert(tempBool);

glBindTexture(GL_TEXTURE_2D, texture); // diffuse?
glActiveTexture(GL_TEXTURE0);
Expand Down

0 comments on commit 95c9e61

Please sign in to comment.