+#include <list>
+#include "screen.h"
+#include "vector.h"
+
+SDL_Surface* sdl_surface_from_sdl_surface(SDL_Surface* sdl_surf, int use_alpha);
+
+class SurfaceImpl;
+class SurfaceSDL;
+class SurfaceOpenGL;
+
+/** This class holds all the data necessary to construct a surface */
+class SurfaceData
+{
+public:
+ enum ConstructorType { LOAD, LOAD_PART, SURFACE };
+ ConstructorType type;
+ SDL_Surface* surface;
+ std::string file;
+ int use_alpha;
+ int x;
+ int y;
+ int w;
+ int h;
+
+ SurfaceData(SDL_Surface* surf, int use_alpha_);
+ SurfaceData(const std::string& file_, int use_alpha_);
+ SurfaceData(const std::string& file_, int x_, int y_, int w_, int h_, int use_alpha_);
+ ~SurfaceData();
+
+ SurfaceSDL* create_SurfaceSDL();
+ SurfaceOpenGL* create_SurfaceOpenGL();
+ SurfaceImpl* create();
+};
+
+/** Container class that holds a surface, necessary so that we can
+ switch Surface implementations (OpenGL, SDL) on the fly */
+class Surface
+{
+public:
+ SurfaceData data;
+ SurfaceImpl* impl;
+ int w;
+ int h;
+
+ typedef std::list<Surface*> Surfaces;
+ static Surfaces surfaces;
+public:
+ static void reload_all();
+ static void debug_check();
+
+ Surface(SDL_Surface* surf, int use_alpha);
+ Surface(const std::string& file, int use_alpha);
+ Surface(const std::string& file, int x, int y, int w, int h, int use_alpha);
+ ~Surface();
+
+ /** Captures the screen and returns it as Surface*, the user is expected to call the destructor. */
+ static Surface* CaptureScreen();
+
+ /** Reload the surface, which is necesarry in case of a mode swich */
+ void reload();
+
+ void draw(float x, float y, Uint8 alpha = 255, bool upside_down = false, bool update = false);
+ void draw_bg(Uint8 alpha = 255, bool update = false);
+ void draw_part(float sx, float sy, float x, float y, float w, float h, Uint8 alpha = 255, bool update = false);
+ void draw_stretched(float x, float y, int w, int h, Uint8 alpha, bool update = false);
+ void resize(int w_, int h_);
+
+ /// conveniance function
+ void draw(const Vector& pos, Uint8 alpha = 255, bool upside_down = false, bool update = false)