Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "SMenu.h"
- #include "../engine/gameengine.h"
- #include <SFML/Graphics.hpp>
- #include <assert.h>
- #include <iostream>
- SMenu SMenu::m_self;
- SMenu::SMenu()
- {
- }
- SMenu::~SMenu()
- {
- }
- void SMenu::Init()
- {
- if (!mov.openFromFile("rsc//mov//enders_game_rsc.mp4"))
- {
- exit(-33);
- }
- mov.play();
- }
- void SMenu::Cleanup()
- {
- }
- void SMenu::Pause()
- {
- mov.pause();
- }
- void SMenu::Resume()
- {
- mov.play();
- }
- void SMenu::HandleEvents(CGameEngine* game)
- {
- sf::Event event;
- while (game->m_window->pollEvent(event))
- {
- if (event.type == sf::Event::Closed)
- {
- game->m_window->close();
- this->Cleanup();
- game->Quit();
- exit(0);
- }
- if (sf::Keyboard::isKeyPressed(sf::Keyboard::Escape))
- {
- game->m_window->close();
- this->Cleanup();
- game->Quit();
- exit(0);
- }
- }
- }
- void SMenu::Update(CGameEngine* game)
- {
- mov.update();
- }
- void SMenu::Draw(CGameEngine* game)
- {
- game->m_window->clear(BLACK);
- game->m_window->draw(mov);
- game->m_window->display();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement