diff options
author | Wilrik de Loose <wilrik@wilrik.nl> | 2008-04-16 13:21:46 (GMT) |
---|---|---|
committer | Wilrik de Loose <wilrik@wilrik.nl> | 2008-04-16 13:21:46 (GMT) |
commit | 3956e14034371e778e7457a344adc66d27f5fc0a (patch) | |
tree | 1eb307157418dd311289e49dcdd6d2b5b28dcf84 /menu_demo/button.c | |
parent | 55b9cf1fef49809656dc065bf4526a843c82846e (diff) | |
download | 2iv55-3956e14034371e778e7457a344adc66d27f5fc0a.zip 2iv55-3956e14034371e778e7457a344adc66d27f5fc0a.tar.gz 2iv55-3956e14034371e778e7457a344adc66d27f5fc0a.tar.bz2 |
Fonts toegevoegd (de files, niet de implementatie)
Diffstat (limited to 'menu_demo/button.c')
-rw-r--r-- | menu_demo/button.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/menu_demo/button.c b/menu_demo/button.c index 2e98286..cafa94a 100644 --- a/menu_demo/button.c +++ b/menu_demo/button.c @@ -16,7 +16,7 @@ enum ButtonType { BUTTON_LABEL
};
-void ButtonRender(struct ButtonStruct *f_sButton)
+void ButtonClickRender(struct ButtonStruct *f_sButton)
{
char l_pcTitle[BUTTON_MAX_TITLE];
@@ -28,15 +28,28 @@ void ButtonRender(struct ButtonStruct *f_sButton) memset(&l_pcTitle, 0, sizeof(l_pcTitle));
memcpy(&l_pcTitle, f_sButton->m_pcTitle, sizeof(f_sButton->m_pcTitle));
+ glBegin(GL_QUADS);
+ glVertex3d(l_dXPos, l_dYPos, 0);
+ glVertex3d(l_dXPos + l_dWidth, l_dYPos, 0);
+ glVertex3d(l_dXPos + l_dWidth, l_dYPos - BUTTON_CLICK_HEIGHT, 0);
+ glVertex3d(l_dXPos, l_dYPos - BUTTON_CLICK_HEIGHT, 0);
+ glEnd();
+
+} // ButtonClickRender
+
+void ButtonRender(struct ButtonStruct *f_sButton)
+{
+ int l_iType = f_sButton->m_iType;
+
switch (l_iType)
{
case BUTTON_CLICK:
- glBegin(GL_QUADS);
- glVertex3d(l_dXPos, l_dYPos, 0);
- glVertex3d(l_dXPos + l_dWidth, l_dYPos, 0);
- glVertex3d(l_dXPos + l_dWidth, l_dYPos - BUTTON_CLICK_HEIGHT, 0);
- glVertex3d(l_dXPos, l_dYPos - BUTTON_CLICK_HEIGHT, 0);
- glEnd();
+ ButtonClickRender(f_sButton);
+ break;
+
+ case BUTTON_RADIO:
+ case BUTTON_LABEL:
+ default:
break;
}
|