Avancement Page Option

This commit is contained in:
Rynort 2023-11-20 17:34:39 -05:00
parent 75a32270b5
commit 83e438583f
2 changed files with 51 additions and 0 deletions

View File

@ -275,6 +275,50 @@ void Engine::DrawMenu()
ShowCursor();
}
void Engine::DrawOption()
{
static const int sTitle = 400;
static const int sButton = 225;
glDisable(GL_LIGHTING);
glDisable(GL_DEPTH_TEST);
glDisable(GL_STENCIL_TEST);
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
glOrtho(0, Width(), 0, Height(), -1, 1);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
MenuOptionsTexture.Bind();
glLoadIdentity();
glBegin(GL_QUADS);
glTexCoord2f(0, 0);
glVertex2i(0, 0);
glTexCoord2f(1, 0);
glVertex2i(Width(), 0); //
glTexCoord2f(1, 1);
glVertex2i(Width(), Height());
glTexCoord2f(0, 1);
glVertex2i(0, Height());
glEnd();
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glBlendEquation(GL_FUNC_ADD);
glEnable(GL_BLEND);
//glEnable(GL_LIGHTING);
glDisable(GL_BLEND);
glEnable(GL_DEPTH_TEST);
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
ShowCursor();
}
void Engine::Init() {
@ -1129,6 +1173,10 @@ void Engine::Render(float elapsedTime) {
}
else if (m_gamestate == GameState::SINGLEMULTI)
DisplaySingleOrMultiplayerMenu();
else if (m_gamestate == GameState::MAIN_MENU)
{
DrawOption();
}
else if (m_gamestate == GameState::QUIT)
Stop();
}
@ -1322,6 +1370,8 @@ void Engine::MousePressEvent(const MOUSE_BUTTON& button, int x, int y) {
m_gamestate = GameState::SINGLEMULTI;
if ((m_mousemx >= 305 && m_mousemx <= 450) && (m_mousemy >= 300 && m_mousemy <= 400))
m_gamestate = GameState::OPTIONS;
if ((m_mousemx >= 305 && m_mousemx <= 450) && (m_mousemy >= 450 && m_mousemy <= 500))
m_gamestate = GameState::QUIT;
}
else if (m_gamestate == GameState::SINGLEMULTI)
{

View File

@ -26,6 +26,7 @@ public:
Engine();
virtual ~Engine();
virtual void DrawMenu();
virtual void DrawOption();
virtual void DrawSplachScreen();
virtual void Init();
virtual void DeInit();