From c25672bd63cce049e931030f70629eb689cf43eb Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 29 Apr 2012 16:28:15 +0300 Subject: Add graphicsmanager class and move some code to it. --- src/graphics.h | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'src/graphics.h') diff --git a/src/graphics.h b/src/graphics.h index 1779a14a5..9b69f2f60 100644 --- a/src/graphics.h +++ b/src/graphics.h @@ -254,11 +254,7 @@ class Graphics : public gcn::SDLGraphics virtual void prepareScreenshot() { } - virtual int getMemoryUsage() - { return 0; } - - virtual void updateTextureFormat() - { } + int getMemoryUsage(); virtual bool drawNet(int x1, int y1, int x2, int y2, int width, int height); @@ -299,12 +295,26 @@ class Graphics : public gcn::SDLGraphics void setNoFrame(bool n) { mNoFrame = n; } - bool videoInfo(); + const std::string &getName() + { return mName; } int mWidth; int mHeight; protected: + void setMainFlags(int w, int h, int bpp, bool fs, + bool hwaccel, bool resize, bool noFrame); + + int getOpenGLFlags(); + + int getSoftwareFlags(); + + bool setOpenGLMode(); + + void updateMemoryInfo(); + + bool videoInfo(); + int SDL_FakeUpperBlit(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect); @@ -321,6 +331,8 @@ class Graphics : public gcn::SDLGraphics bool mNoFrame; Uint32 mOldPixel; int mOldAlpha; + std::string mName; + int mStartFreeMem; }; extern Graphics *mainGraphics; -- cgit v1.2.3-70-g09d2