Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

display.h

Go to the documentation of this file.
00001 #ifndef __DISPLAY_H
00002 #define __DISPLAY_H
00003 
00004 #define   ALPHA_NONE                    0
00005 #define   ALPHA_BLACK                   1
00006 #define   ALPHA_WHITE                   2
00007 #define   ALPHA_RED                     3
00008 #define   ALPHA_GREEN                   4
00009 #define   ALPHA_BLUE                    5
00010 #define   ALPHA_PIXEL_TOPLEFT           6
00011 #define   ALPHA_PIXEL_TOPRIGHT          7
00012 #define   ALPHA_PIXEL_BOTTOMRIGHT       8
00013 #define   ALPHA_PIXEL_BOTTOMLEFT        9
00014 
00015 #define FONT_COLOR_NORMAL               0
00016 #define FONT_COLOR_SELECTED             1
00017 
00018 /* Stores the data and provides the interface to
00019  * working with the display.
00020  */
00021  
00022 class Display
00023 {
00024 private:
00025   bool fullscreen; 
00026   int width; 
00027   int height; 
00028   /* title plane */
00029   /* screen 
00030    * NOTE: "screen" should never be freed, as explained
00031    * in the manual.  http://sdldoc.csn.ul.ie/sdlsetvideomode.php
00032    */
00033   SDL_Surface   *screen;
00034   SDL_Surface   *font; 
00035   SFont_FontInfo *font_sel; 
00036   SDL_Surface *title_plane;
00037   void SetVideoMode();
00038   void SetFonts();
00039 
00040 public:
00041   Display();
00042   ~Display();
00043   SDL_Surface *GetScreen();
00044   SDL_Surface *CreateSurface( int w, int h );
00045   SDL_Surface *CreateSurfaceFromFile( string filename, int alpha );
00046   SDL_Surface *LoadImage( string filename );
00047   void SetFullScreen( bool );
00048   void DrawText( int x, int y, string text_str, int font_color );
00049   void DrawTextCentered( int y, string text_str, int font_color );
00050   void DrawGameMessage ( string text, int alpha);
00051   void DrawTitlePlane();
00052   void DrawRect( int x, int y, int w, int h,
00053                  Uint8 r, Uint8 g, Uint8 b, int alpha );
00054   void DrawBlackPlane(int alpha);
00055   void DrawInfo(list<string> info);
00056   void Flip();
00057   int Width();
00058   int Height();
00059   int WidthHalf();
00060   int HeightHalf();
00061   int WidthInTiles();
00062   int HeightInTiles();
00063   void SetWidthHeightInTiles( int w, int h );
00064 };
00065 
00066 #endif /* __DISPLAY_H */

Generated on Sun Mar 2 18:50:27 2003 for eounicorn by doxygen1.3-rc3