Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

/include/ZE_ZImage.h

Go to the documentation of this file.
00001 /*******************************************************************************
00002         This file is Part of the ZEngine Library for 2D game development.
00003                    Copyright (C) 2002, 2003 James Turk
00004 
00005                      Licensed under a BSD-style license.
00006 
00007     The maintainer of this library is James Turk (james@conceptofzero.net) 
00008      and the home of this Library is http://www.zengine.sourceforge.net
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;
00057         Uint8 rAlpha;
00058     
00059     public:
00060 
00066         ZImage();
00067 
00074         ZImage(const ZImage &rhs);
00075 
00082         ZImage(string filename);
00083 
00090         ZImage(SDL_Surface *surface);
00091 
00103         ZImage(SDL_Surface *img, Sint16 x, Sint16 y, Sint16 w, Sint16 h);
00104 
00110         ~ZImage();
00111 
00113         //Opening and Closing//
00115 
00122         void Open(string filename);
00123 
00135         void OpenFromImage(SDL_Surface *img, Sint16 x, Sint16 y, Sint16 w, Sint16 h);
00136 
00143         void Attach(SDL_Surface *surface);
00144 
00150         void Reload();
00151 
00157         void Release();
00158 
00160         //Graphics//
00162 
00170         void SetAlpha(Uint8 alpha);
00171 
00180         void SetColorKey(Uint8 red, Uint8 green, Uint8 blue);
00181 
00189         void Flip(bool horizontal, bool vertical);
00190 
00198         void Stretch(float xFactor, float yFactor);
00199 
00207         void Resize(unsigned int width, unsigned int height);
00208 
00215         void Bind() const;
00216 
00224         void Draw(float x, float y) const;
00225 
00234         void DrawRotated(int x, int y, float angle) const;
00235 
00237         //Accessors//
00239 
00246         bool IsLoaded() const;
00247 
00253         SDL_Surface *Surface() const;
00254 
00261         int Width() const;
00262 
00269         int Height() const;
00270 
00278         Uint8 Alpha() const;
00279 };
00280 
00281 }
00282 
00283 #endif

Generated on Tue Jan 28 16:31:28 2003 for ZEngine by doxygen1.3-rc2