diff options
Diffstat (limited to 'menu_demo/menu.c')
-rw-r--r-- | menu_demo/menu.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/menu_demo/menu.c b/menu_demo/menu.c index 9159d13..9a3c081 100644 --- a/menu_demo/menu.c +++ b/menu_demo/menu.c @@ -80,26 +80,26 @@ void MenuRender(void) glDisable(GL_DEPTH_TEST);
glEnable(GL_TEXTURE_2D);
- glColor3d(1, 1, 1); - - glMatrixMode(GL_PROJECTION); - glPushMatrix(); - - glLoadIdentity(); - glOrtho(0, (GLfloat)g_iWinWidth, (GLfloat)g_iWinHeight, 0, 0, 1); - glMatrixMode(GL_MODELVIEW); - - // render the buttons on the current menu + glColor3d(1, 1, 1);
+
+ glMatrixMode(GL_PROJECTION);
+ glPushMatrix();
+
+ glLoadIdentity();
+ glOrtho(0, (GLfloat)g_iWinWidth, (GLfloat)g_iWinHeight, 0, 0, 1);
+ glMatrixMode(GL_MODELVIEW);
+
+ // render the buttons on the current menu
while (i < g_pCurMenu->m_iButtonCount)
{
ButtonRender(&g_pCurMenu->m_sButtons[i]);
i++;
- } - - //restore the previous projection matrix - glMatrixMode(GL_PROJECTION); - - glPopMatrix(); + }
+
+ //restore the previous projection matrix
+ glMatrixMode(GL_PROJECTION);
+
+ glPopMatrix();
glMatrixMode(GL_MODELVIEW);
} // MenuRender
@@ -120,8 +120,8 @@ void MenuMouseHandle(int f_iGlutButton, int f_iGlutState, int f_iXPos, int f_iYP // f_iGlutState
// # GLUT_DOWN
// # GLUT_UP
- - // check if any button needs attention from the mouse +
+ // check if any button needs attention from the mouse
while (i < g_pCurMenu->m_iButtonCount)
{
l_dXPos = g_pCurMenu->m_sButtons[i].m_dXPos;
|