1 //==============================================================================
2 // This program is free software; you can redistribute it and/or modify
3 // it under the terms of the GNU General Public License as published by
4 // the Free Software Foundation; either version 2 of the License, or
5 // (at your option) any later version.
6 //
7 // This program is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10 // GNU Library General Public License for more details.
11 //
12 // You should have received a copy of the GNU General Public License
13 // along with this program; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
15 // USA.
16 //==============================================================================
17 
18 //==============================================================================
19 //File: cDisplayManager.hpp
20 //Project: Shooting Star
21 //Author: Tuomas Peippo <tuomas.peippo@2ndpoint.fi>
22 //Copyrights (c) 2003 2ndPoint ry (www.2ndpoint.fi)
23 //------------------------------------------------------------------------------
24 //Revision history
25 //=============================================================================
26 #ifndef cDisplayManager_hpp
27 #define cDisplayManager_hpp
28 
29 //============================================================================
30 // Includes
31 #include "Types.hpp"
32 #include "Debug.hpp"
33 #include <SDL.h>
34 #include <GL/gl.h>
35 #include <GL/glu.h>
36 #include <stdexcept>
37 #include <string>
38 //------------------------------------------------------------------------------
39 // Namespaces
40 using namespace std;
41 namespace ShootingStar	{
42 //============================================================================
43 
44 class cDisplayManager
45 {
46 	// Constructor & Destructor
47 	public:
48 		//! Constructor
49 		cDisplayManager (void);
50 		//! Desturctor
51 		~cDisplayManager (void);
52 
53 	// Public methods
54 	public:
55 		static cDisplayManager &GetInstance (void);
56 		void SetVideoMode( int width, int height, int bpp, Uint32 flags );
57 		void SetViewport(  GLint x, GLint y, GLsizei width, GLsizei height );
58 		void SetOrtho( GLdouble left, GLdouble right, GLdouble bottom, GLdouble top );
GetScreenWidth(void)59 		Uint16 GetScreenWidth (void) { return mpScreen->w; };
GetScreenHeight(void)60 		Uint16 GetScreenHeight (void) { return mpScreen->h; };
61 		Uint16 GetViewportWidth (void);
62 		Uint16 GetViewportHeight (void);
63 		Uint16 GetOrthoWidth (void);
64 		Uint16 GetOrthoHeight (void);
65 		void BeginFrame (bool clear = true);
66 		void EndFrame (void);
67 
68 	// Member variables
69 	private:
70 		SDL_Surface *mpScreen;	//!< The video framebuffer
71 };
72 
73 //==============================================================================
74 }	// End of the ShootingStar namespace
75 #endif // cDisplayManager_hpp
76 //------------------------------------------------------------------------------
77 // EOF
78 //==============================================================================
79