SQC-15_online #1

Merged
memartel_loc merged 349 commits from SQC-15_online into master 2023-12-10 17:41:26 -05:00
2 changed files with 20 additions and 3 deletions
Showing only changes of commit e5189f437c - Show all commits

View File

@ -239,7 +239,7 @@ void Engine::DrawPause()
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
MenuBGTexture.Bind();
PauseBGTexture.Bind();
glLoadIdentity();
glBegin(GL_QUADS);
glTexCoord2f(0, 0);
@ -251,6 +251,14 @@ void Engine::DrawPause()
glTexCoord2f(0, 1);
glVertex2i(0, 600);
glEnd();
glDisable(GL_BLEND);
glEnable(GL_DEPTH_TEST);
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
ShowCursor();
}
void Engine::Init() {
@ -329,6 +337,7 @@ void Engine::LoadResource() {
LoadTexture(MenuTitleTexture, MENU_ITEM_PATH "test.png");
LoadTexture(MenuBGTexture, MENU_ITEM_PATH "test.png");
LoadTexture(PauseBGTexture, MENU_ITEM_PATH "test.png");
LoadTexture(MenuQuitTexture, MENU_ITEM_PATH "BasicQuit.png");
LoadTexture(MenuOptionsTexture, MENU_ITEM_PATH "test.png");
LoadTexture(MenuStartTexture, MENU_ITEM_PATH "BasicPlay.png");
@ -801,7 +810,7 @@ void Engine::Render(float elapsedTime) {
}
else if (m_gamestate == GameState::PAUSE)
{
DrawPause();
}
else if (m_gamestate == GameState::QUIT)
Stop();
@ -830,7 +839,14 @@ void Engine::KeyPressEvent(unsigned char key) {
}
break;
case 36: // ESC - Quitter
m_gamestate = GameState::MAIN_MENU;
if (m_gamestate == GameState::PLAY)
{
m_gamestate = GameState::PAUSE;
}
else if (m_gamestate == GameState::PAUSE)
{
m_gamestate = GameState::PLAY;
}
//Stop();
break;
case 57: // Space - Sauter

View File

@ -88,6 +88,7 @@ private:
Texture MenuStartTexture;
Texture MenuQuitTexture;
Texture MenuOptionsTexture;
Texture PauseBGTexture;
float m_scale;
float m_time = 0;