00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef ANNCHIENTA_VIDEOMANAGER_H
00019 #define ANNCHIENTA_VIDEOMANAGER_H
00020
00021 namespace Annchienta
00022 {
00023
00024 class Surface;
00025 class Font;
00026
00030 class VideoManager
00031 {
00032 private:
00033 int screenWidth, screenHeight;
00034 bool fullScreen;
00035 int videoScale;
00036 static const int numberOfBackBuffers = 8;
00037 Surface **backBuffers;
00038
00039 public:
00040 #ifndef SWIG
00041 VideoManager();
00042 ~VideoManager();
00043 #endif
00044
00052 void setVideoMode( int w, int h, const char *title="Annchienta RPG Engine", bool fullScreen=false, int videoScale=1 );
00053
00056 int getScreenWidth() const;
00057
00060 int getScreenHeight() const;
00061
00064 int isFullScreen() const;
00065
00068 int getVideoScale() const;
00069
00072 int getNumberOfBackBuffers() const;
00073
00076 void reset();
00077
00080 void identity() const;
00081
00086 void translate( float x, float y ) const;
00087
00091 void rotate( float degrees ) const;
00092
00097 void scale( float x, float y ) const;
00098
00101 void push() const;
00102
00105 void pop() const;
00106
00109 void clear();
00110
00113 void flip();
00114
00121 void setClearColor( int red=0xff, int green=0xff, int blue=0xff, int alpha=0xff ) const;
00122
00132 void setColor( int red=0xff, int green=0xff, int blue=0xff, int alpha=0xff ) const;
00133
00137 void setAlpha( int alpha=0xff ) const;
00138
00147 void setClippingRectangle( int x1, int y1, int x2, int y2 ) const;
00148
00151 void disableClipping() const;
00152
00159 void drawLine( int x1, int y1, int x2, int y2 ) const;
00160
00169 void drawTriangle( int x1, int y1, int x2, int y2, int x3, int y3 ) const;
00170
00177 void drawRectangle( int x1, int y1, int x2, int y2 ) const;
00178
00189 void drawQuad( int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4 ) const;
00190
00198 void drawSurface( Surface *surface, int x, int y ) const;
00199
00209 void drawSurface( Surface *surface, int dx, int dy, int sx1, int sy1, int sx2, int sy2 ) const;
00210
00218 void drawSurface( Surface *surface, int x1, int y1, int x2, int y2 ) const;
00219
00228 void drawPattern( Surface *surface, int x1, int y1, int x2, int y2 ) const;
00229
00236 void drawString( Font *font, const char *str, int x, int y ) const;
00237
00244 void drawStringCentered( Font *font, const char *str, int x, int y ) const;
00245
00252 void drawStringRight( Font *font, const char *str, int x, int y ) const;
00253
00261 void grabBuffer( Surface *surface ) const;
00262
00274 void grabBuffer( Surface *surface, int x1, int y1, int x2, int y2 ) const;
00275
00283 void storeBuffer( int slot );
00284
00288 void restoreBuffer( int slot ) const;
00289
00301 void boxBlur( int x1, int y1, int x2, int y2, int radius=2 );
00302 };
00303
00304 VideoManager *getVideoManager();
00305
00306 };
00307
00308 #endif