00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00024 #ifndef __ze_zimage_h__
00025 #define __ze_zimage_h__
00026 
00027 #include "ZE_ZObject.h"
00028 
00029 namespace ZE
00030 {
00031 
00037 class ZImage : public ZObject
00038 {
00039     protected:
00041         GLfloat rTexMinX;
00043         GLfloat rTexMinY;
00045         GLfloat rTexMaxX;
00047         GLfloat rTexMaxY;
00049         SDL_Surface *rImage;
00051         unsigned int rTexID;
00053         unsigned int rWidth;
00055         unsigned int rHeight;
00056     
00057     public:
00058 
00064         ZImage();
00065 
00072         ZImage::ZImage(const ZImage &rhs);
00073 
00080         ZImage(string filename);
00081 
00088         ZImage(SDL_Surface *surface);
00089 
00101         ZImage(SDL_Surface *img, Sint16 x, Sint16 y, Sint16 w, Sint16 h);
00102 
00108         ~ZImage();
00109 
00111         
00113 
00120         void Open(string filename);
00121 
00133         void OpenFromImage(SDL_Surface *img, Sint16 x, Sint16 y, Sint16 w, Sint16 h);
00134 
00141         void Attach(SDL_Surface *surface);
00142 
00148         void Reload();
00149 
00155         void Release();
00156 
00158         
00160 
00169         void SetColorKey(Uint8 red, Uint8 green, Uint8 blue);
00170 
00178         void Flip(bool horizontal, bool vertical);
00179 
00187         void Stretch(float xFactor, float yFactor);
00188 
00196         void Resize(unsigned int width, unsigned int height);
00197 
00204         void Bind() const;
00205 
00213         void Draw(float x, float y) const;
00214 
00223         void DrawRotated(int x, int y, float angle) const;
00224 
00226         
00228 
00235         bool IsLoaded() const;
00236 
00242         SDL_Surface *Surface() const;
00243 
00250         int Width() const;
00251 
00258         int Height() const;
00259 };
00260 
00261 }
00262 
00263 #endif