Main Page   Namespace List   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_ZEngine.h"
00028 
00029 namespace ZE
00030 {
00031 
00037 class ZImage
00038 {
00039     protected:
00041         ZEngine* rEngine;
00043         GLfloat rTexMinX;
00045         GLfloat rTexMinY;
00047         GLfloat rTexMaxX;
00049         GLfloat rTexMaxY;
00051         SDL_Surface *rImage;
00053         unsigned int rTexID;
00055         unsigned int rWidth;
00057         unsigned int rHeight;
00059         Uint8 rAlpha;
00060     
00061     public:
00062 
00068         ZImage();
00069 
00076         ZImage(const ZImage &rhs);
00077 
00084         ZImage(string filename);
00085 
00092         ZImage(SDL_Surface *surface);
00093 
00105         ZImage(SDL_Surface *img, Sint16 x, Sint16 y, Sint16 w, Sint16 h);
00106 
00118         ZImage(const ZImage &img, Sint16 x, Sint16 y, Sint16 w, Sint16 h);
00119 
00125         virtual ~ZImage();
00126 
00128         //Opening and Closing//
00130 
00137         void Open(string filename);
00138 
00150         void OpenFromImage(SDL_Surface *img, Sint16 x, Sint16 y, Sint16 w, Sint16 h);
00151 
00163         void OpenFromImage(const ZImage &img, Sint16 x, Sint16 y, Sint16 w, Sint16 h);
00164 
00171         void Attach(SDL_Surface *surface);
00172 
00178         void Reload();
00179 
00185         void Release();
00186 
00188         //Graphics//
00190 
00198         void SetAlpha(Uint8 alpha);
00199 
00208         void SetColorKey(Uint8 red, Uint8 green, Uint8 blue);
00209 
00217         void Flip(bool horizontal, bool vertical);
00218 
00226         void Stretch(float xFactor, float yFactor);
00227 
00235         void Resize(unsigned int width, unsigned int height);
00236 
00243         void Bind() const;
00244 
00252         void Draw(int x, int y) const;
00253 
00262         void Draw(float x, float y) const;
00263 
00272         void DrawRotated(int x, int y, float angle) const;
00273 
00283         void DrawRotated(float x, float y, float angle) const;
00284 
00286         //Accessors//
00288 
00295         bool IsLoaded() const;
00296 
00302         SDL_Surface *Surface() const;
00303 
00310         int Width() const;
00311 
00318         int Height() const;
00319 
00327         Uint8 Alpha() const;
00328 };
00329 
00330 }
00331 
00332 #endif

Generated on Sun Apr 27 18:14:01 2003 for ZEngine by doxygen1.3-rc2