Hello everybody,
In redisplaying a window, I made this function. It gives me two errors, and I'm wondering if it's because I'm just using these functions wrongly. I'm new(ish) to Xcode, so I'm probably just using the functions from my old compiler. Please just tell me what is wrong so I can fix it, write notes, and know what to do in the future. arr_tetris_screen is an array that holds the values for the conditions of a Tetris screen, and box means that a box has been put in that square (box is a constant which equals 1).
void redisplay() { for (GLfloat redisp = 0; redisp <= 7; redisp ++) { for (GLfloat redisp2 = 0; redisp2 <= 14; redisp ++) { switch (arr_tetris_screen [redisp] [redisp2]) { case box: { glBegin(GL_QUADS); glColor3f(1.0, 0.0, 0.0); glVertex3f(redisp+1, redisp2+1, 0.0); glVertex3f(redisp, redisp2+1, 0.0); glVertex3f(redisp, redisp2+1, 0.0); glVertex3f(redisp, redisp2, 0.0); } default: exit(1234); } } } glutPostRedisplay(); }
This gives me two errors: "jam exited with exit code 1" "invalid types 'GLfloat[7][14][GLfloat]' for array subscript"
I know this has OpenGL code in it, but this isn't GL-specific, so I felt that these lists are more appropriate for this question.
All help is appreciated and thanks in advance.
~ < [ / Adam-o \ ] > ~
+-------------------------------------------+ | My computer's Stats | | Mac OS 10.4.8 | | 1 Ghz Apple Powerbook G4 | | Xcode v. 2.4.1 | +-------------------------------------------+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Please keep your posts straight and to the point. Also please comment the code you use as I am still learning OpenGL and Xcode and may not yet understand the meaning of the command. Thank you. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|