Main Page | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals

/Users/blackie/Documents/myRepository/phobosengine-vc2005/phobosengine/phobosengine/SDLApplication.h

Go to the documentation of this file.
00001 
00002 
00003 #ifndef SDLAPPLICATION_H
00004 #define SDLAPPLICATION_H
00005 
00006 
00007 #include "glew.h"
00008 #include "SDL.h"
00009 
00010 #include <string>
00011 
00012 
00013 namespace pge {
00014 
00015 
00016   class SDLApplication {
00017     public:
00018       //************************************************************************
00019       //
00020       // Data structures
00021       //
00022       //************************************************************************
00023       typedef struct MouseCoordinate {
00024         int x;
00025         int y;
00026           } MouseCoordinate;
00027 
00028 
00029       //************************************************************************
00030       //
00031       // Destructor
00032       //
00033       //************************************************************************
00035       virtual ~SDLApplication(void);
00036 
00037 
00038       //************************************************************************
00039       //
00040       // Functions
00041       //
00042       //************************************************************************
00043           virtual void initCall(void) = 0;
00044       virtual void reshapeCall(GLsizei width, GLsizei height) = 0;
00045       virtual void keyDownCall(int key) = 0;
00046       virtual void keyUpCall(int key) = 0;
00047       virtual void mousePressCall(int button, int x, int y) = 0;
00048       virtual void mouseReleaseCall(int button, int x, int y) = 0;
00049       virtual void mainLoopCall(void) = 0;
00050       void execute(void);
00051       void shutdown(void);
00052       void sleep(unsigned int delay);
00053       void swapBuffer(void);
00054       unsigned int getTicks(void);
00055       void setMousePointer(int x, int y);
00056       void setMousePointer(const MouseCoordinate &coord);
00057       MouseCoordinate getMousePointer(void);
00058       int getResolutionWidth(void);
00059       int getResolutionHeight(void);
00060       int getDisplayDepth(void);
00061       bool isFullscreen(void);
00062       std::string getTitle(void);
00063 
00064 
00065 
00066     protected:
00067       //************************************************************************
00068       //
00069       // Functions
00070       //
00071       //************************************************************************
00072       bool openWindow(int resX, int resY, int bits, bool fullScreen, const std::string &title);
00073 
00074 
00075     private:
00076       //************************************************************************
00077       //
00078       // Variables
00079       //
00080       //************************************************************************
00081       // window variables
00082       int m_resX;
00083       int m_resY;
00084       int m_bits;
00085       bool m_fullscreen;
00086       std::string m_title;
00087       SDL_Surface *m_surface;
00088       int m_videoFlags;
00089       bool m_running;
00090   };
00091 };
00092 
00093 #endif

Generated on Mon Oct 16 12:08:11 2006 for Phobosengine by doxygen 1.3.4