Advertisement
Guest User

Untitled

a guest
Jun 6th, 2017
63
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #pragma once
  2.  
  3. #include "GameScreen.h"
  4. #include "SplashScreen.h"
  5. #include "TitleScreen.h"
  6. #include "FadeAnimation.h"
  7. #include "Texture.h"
  8. #include "FileManager.h"
  9.  
  10. #define ScreenWidth 1280
  11. #define ScreenHeight 720
  12.  
  13. class ScreenManager
  14. {
  15. public:
  16.     ~ScreenManager();
  17.     static ScreenManager &GetInstance();
  18.  
  19.     void Initialize(SDL_Renderer *renderer);
  20.     void LoadContent(SDL_Renderer *renderer);
  21.     void UnloadContent();
  22.     void Update(SDL_Renderer *renderer, SDL_Event &event);
  23.     void Draw (SDL_Renderer *renderer);
  24.     void SetScreen(GameScreen *newScreen);
  25.  
  26.     Texture GetSplashText(void) const { return SplashText; }
  27.     Texture GetTitleText(void) const { return TitleText; }
  28.  
  29.     GameScreen* GetSplashScreen(void) const { return SplashScreen; }
  30.     GameScreen* GetTitleScreen(void) const { return TitleScreen; }
  31.  
  32.     Uint8 GetAlpha();
  33.  
  34. private:
  35.  
  36.     GameScreen *SplashScreen;
  37.     GameScreen *TitleScreen;
  38.     //GameScreen *MainMenuScreen; <-- exaple state
  39.     //GameScreen *GamePlayScreen; <-- exaple state
  40.     GameScreen *currentScreen;
  41.  
  42.     Texture SplashText;
  43.     Texture TitleText;
  44.        
  45.     FileManager file;
  46.     std::vector<std::vector<std::string>> attributes;
  47.     std::vector<std::vector<std::string>> contents;
  48.  
  49.     void Transition(SDL_Renderer *renderer);
  50.     bool transition;
  51.  
  52.     FadeAnimation fade;
  53.  
  54.     ScreenManager();
  55.     ScreenManager(ScreenManager const&);
  56.     void operator = (ScreenManager const&);
  57. };
Advertisement
RAW Paste Data Copied
Advertisement