#ifdef G_OS_WIN32 #define WIN32_LEAN_AND_MEAN 1 #include #endif #include #include "button.h" #include "bitmap.h" #define BUTTON_CLICK_HEIGHT 50 enum ButtonType { BUTTON_CLICK, BUTTON_RADIO, BUTTON_LABEL }; void ButtonClickRender(struct ButtonStruct *f_sButton) { char l_pcTitle[BUTTON_MAX_TITLE]; double l_dWidth = f_sButton->m_dWidth; double l_dXPos = f_sButton->m_dXPos; double l_dYPos = f_sButton->m_dYPos; int l_iType = f_sButton->m_iType; 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: ButtonClickRender(f_sButton); break; case BUTTON_RADIO: case BUTTON_LABEL: default: break; } } // ButtonRender