00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef GRAPHICS_H
00023 #define GRAPHICS_H
00024
00025 #include <guichan/sdl/sdlgraphics.hpp>
00026
00027 class Image;
00028 class ImageRect;
00029
00030 struct SDL_Surface;
00031
00049 struct ImageRect
00050 {
00051 enum ImagePosition
00052 {
00053 UPPER_LEFT = 0,
00054 UPPER_CENTER = 1,
00055 UPPER_RIGHT = 2,
00056 LEFT = 3,
00057 CENTER = 4,
00058 RIGHT = 5,
00059 LOWER_LEFT = 6,
00060 LOWER_CENTER = 7,
00061 LOWER_RIGHT = 8
00062 };
00063
00064 Image *grid[9];
00065 };
00066
00070 class Graphics : public gcn::SDLGraphics
00071 {
00072 public:
00076 Graphics();
00077
00081 virtual ~Graphics();
00082
00086 virtual bool setVideoMode(int w, int h, int bpp, bool fs, bool hwaccel);
00087
00091 bool setFullscreen(bool fs);
00092
00099 bool drawImage(Image *image, int x, int y);
00100
00104 void drawImage(gcn::Image const *image, int srcX, int srcY,
00105 int dstX, int dstY, int width, int height);
00106
00113 virtual bool drawImage(Image *image,
00114 int srcX, int srcY,
00115 int dstX, int dstY,
00116 int width, int height,
00117 bool useColor = false);
00118
00119 virtual void drawImagePattern(Image *image,
00120 int x, int y,
00121 int w, int h);
00122
00127 void drawImageRect(
00128 int x, int y, int w, int h,
00129 Image *topLeft, Image *topRight,
00130 Image *bottomLeft, Image *bottomRight,
00131 Image *top, Image *right,
00132 Image *bottom, Image *left,
00133 Image *center);
00134
00139 void drawImageRect(
00140 int x, int y, int w, int h,
00141 const ImageRect &imgRect);
00142
00147 virtual void updateScreen();
00148
00152 int getWidth() const;
00153
00157 int getHeight() const;
00158
00162 virtual SDL_Surface *getScreenshot();
00163
00164 protected:
00165 SDL_Surface *mScreen;
00166 bool mFullscreen, mHWAccel;
00167 };
00168
00169 extern Graphics *graphics;
00170
00171 #endif