-
OpenGL Primitive Drawing
Hello. I'm making a 2d Battleship game, and everything is going well, except for the graphics. I made 2 grids for attack and defense. To position them, I used
Code:
glTranslatef(x, y, 0.0);
But now the plane changed. When I want to position the markers that show where you hit, I position them with glTranslatef as well, and this makes the plane change again, and I don't know where to put my markers now because they run off the grid. Is there a way to reset the plane, so 0,0 is in the middle again, or is there a better way to position the markers. Any help would be appreciated! :)
-
Either use glLoadIdentity(); or use the matrices:
Code:
glPushMatrix(); // Saves the current translations
do all your glTranslates here...
glPopMatrix(); // Resets the old translations
-
Thanks jverkoey, that did it! :)