Rally X
ELEN3009 Project by Justin Wernick and David Schneider
source/presentation/Screen.h
Go to the documentation of this file.
00001 #ifndef SCREEN_H
00002 #define SCREEN_H
00003 
00004 #include <list>
00005 #include <algorithm>
00006 #include <sstream>
00007 using namespace std;
00008 
00009 #include <allegro5/allegro.h>
00010 #include <allegro5/allegro_native_dialog.h>
00011 
00012 #include "../logic/Maze.h"
00013 #include "../logic/GameObject.h"
00014 #include "../logic/PlayerCar.h"
00015 #include "../logic/EnemyCar.h"
00016 #include "../logic/Checkpoint.h"
00017 #include "../logic/Rock.h"
00018 #include "../logic/Smokescreen.h"
00019 #include "../logic/DestroyedObjectPopup.h"
00020 #include "../logic/AllegroWrappers.h"
00021 
00022 #include "../presentation/GamePanel.h"
00023 #include "../presentation/InfoPanel.h"
00024 
00031 class BadResolution{};
00032 
00044 class Screen
00045 {
00046     public:
00054         Screen(unsigned int screenWidth, unsigned int screenHeight, bool fullscreen);
00055 
00059         ~Screen();
00060 
00069         string getLevel();
00070 
00085         void draw(const Maze& maze, const list<PlayerCar>& players, const list<EnemyCar>& enemies, const list<Checkpoint>& checkpoints, const list<Rock>& rocks, const list<Smokescreen>& smokescreens, const list<DestroyedObjectPopup>& popups);
00086 
00095         bool exitClicked();
00096 
00100         void drawWin();
00104         void drawLoss();
00105 
00106     private:
00112         Screen(const Screen& ref);
00118         Screen& operator=(const Screen& rhs);
00119 
00123         void flip();
00124 
00132         bool resolutionSupported();
00133 
00134         AllegroInit _allegro; 
00135         AllegroKeyboardInit _keyboard; 
00136         AllegroDrawingInit _drawing; 
00137 
00138         bool _exitClicked; 
00139 
00140         unsigned int _screenWidth; 
00141         unsigned int _screenHeight; 
00142 
00143         unsigned int _gameAreaWidth; 
00144         unsigned int _infoPanelWidth; 
00145 
00146         ALLEGRO_DISPLAY* _display; 
00147         ALLEGRO_EVENT_QUEUE* _windowEvents; 
00148         ALLEGRO_FONT* _font; 
00149 
00156         vector<ScreenPanel*> _panels;
00157 };
00158 
00159 #endif // SCREEN_H
 All Classes Files Functions Variables Typedefs Enumerations Enumerator