00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef OPENGLGRAPHICS_H
00023 #define OPENGLGRAPHICS_H
00024
00025 #include "graphics.h"
00026
00027 class OpenGLGraphics : public Graphics
00028 {
00029 public:
00030 OpenGLGraphics();
00031
00032 ~OpenGLGraphics();
00033
00038 void setSync(bool sync);
00039 bool getSync() const { return mSync; }
00040
00041 bool setVideoMode(int w, int h, int bpp, bool fs, bool hwaccel);
00042
00043 bool drawImage(Image *image,
00044 int srcX, int srcY,
00045 int dstX, int dstY,
00046 int width, int height,
00047 bool useColor);
00048
00049 void drawImagePattern(Image *image,
00050 int x, int y,
00051 int w, int h);
00052
00053 void updateScreen();
00054
00055 void _beginDraw();
00056 void _endDraw();
00057
00058 bool pushClipArea(gcn::Rectangle area);
00059 void popClipArea();
00060
00061 void setColor(const gcn::Color &color);
00062
00063 void drawPoint(int x, int y);
00064
00065 void drawLine(int x1, int y1, int x2, int y2);
00066
00067 void drawRectangle(const gcn::Rectangle &rect, bool filled);
00068
00069 void drawRectangle(const gcn::Rectangle &rect);
00070
00071 void fillRectangle(const gcn::Rectangle &rect);
00072
00073 void setTargetPlane(int width, int height);
00074
00078 SDL_Surface *getScreenshot();
00079
00080 protected:
00081 void setTexturingAndBlending(bool enable);
00082
00083 private:
00084 bool mAlpha, mTexture;
00085 bool mColorAlpha;
00086 bool mSync;
00087 };
00088
00089 #endif