fixed selection of a game_object in IsObject mode
[supertux.git] / src / texture.h
index c3d7cd7..3ba0e58 100644 (file)
@@ -30,6 +30,8 @@
 #include <list>
 #include "screen.h"
 
+SDL_Surface* sdl_surface_from_sdl_surface(SDL_Surface* sdl_surf, int use_alpha);
+
 class SurfaceImpl;
 class SurfaceSDL;
 class SurfaceOpenGL;
@@ -79,12 +81,17 @@ public:
   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 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_);
 };
 
 /** Surface implementation, all implementation have to inherit from
@@ -106,6 +113,8 @@ public:
   virtual int draw(float x, float y, Uint8 alpha, bool update) = 0;
   virtual int draw_bg(Uint8 alpha, bool update) = 0;
   virtual int draw_part(float sx, float sy, float x, float y, float w, float h,  Uint8 alpha, bool update) = 0;
+  virtual int draw_stretched(float x, float y, int w, int h, Uint8 alpha, bool update) = 0;
+  int resize(int w_, int h_);
 
   SDL_Surface* get_sdl_surface() const; // @evil@ try to avoid this function
 };
@@ -121,8 +130,10 @@ public:
   int draw(float x, float y, Uint8 alpha, bool update);
   int draw_bg(Uint8 alpha, bool update);
   int draw_part(float sx, float sy, float x, float y, float w, float h,  Uint8 alpha, bool update);
+  int draw_stretched(float x, float y, int w, int h, Uint8 alpha, bool update);
 };
 
+#ifndef NOOPENGL
 class SurfaceOpenGL : public SurfaceImpl
 {
 public:
@@ -137,10 +148,12 @@ public:
   int draw(float x, float y, Uint8 alpha, bool update);
   int draw_bg(Uint8 alpha, bool update);
   int draw_part(float sx, float sy, float x, float y, float w, float h,  Uint8 alpha, bool update);
+  int draw_stretched(float x, float y, int w, int h, Uint8 alpha, bool update);
 
 private:
   void create_gl(SDL_Surface * surf, GLuint * tex);
 };
+#endif 
 
 #endif /*SUPERTUX_TEXTURE_H*/