Gel2D - The free/open source game creation suite

gelTexture.h
Go to the documentation of this file.
00001 /*
00002 Gel2D Game Engine - Cross-platform 2D gaming middleware
00003 Copyright (C) 2010-2011 Mark D. Procarione
00004 
00005 Gel2D is free software: you can redistribute it and/or modify
00006 it under the terms of the GNU General Public License as published by
00007 the Free Software Foundation, either version 3 of the License, or
00008 (at your option) any later version.
00009 
00010 Gel2D is distributed in the hope that it will be useful,
00011 but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00013 GNU General Public License for more details.
00014 */
00015 
00016 #ifndef __GELTEXTURE_H__
00017 #define __GELTEXTURE_H__
00018 
00019 #include "gel.h"
00020 #include "gelImage.h"
00021 
00022 namespace gel
00023 {
00024         class GelTexture
00025     {
00026         public:
00028             GelTexture();
00029 
00031 
00033             GelTexture( const GelString &filename, ImageType type, TextureFilter filter = GEL_LINEAR, TextureWrap wrap = GEL_NO_REPEAT );
00034 
00036 
00038             GelTexture( GelImageData *image, TextureFilter filter = GEL_LINEAR, TextureWrap wrap = GEL_NO_REPEAT );
00039 
00041             ~GelTexture();
00042 
00044 
00051             void load( const GelString &filename, ImageType type, TextureFilter filter = GEL_LINEAR, TextureWrap wrap = GEL_NO_REPEAT );
00052 
00054 
00060             void loadOverlay( const GelString &filename, ImageType type, int xoffset, int yoffset );
00061 
00063 
00072             void load( GelImageData *image, TextureFilter filter = GEL_LINEAR, TextureWrap wrap = GEL_NO_REPEAT );
00073 
00075 
00078             void setFilterMode( TextureFilter mode );
00079 
00081 
00084             void setWrapMode( TextureWrap mode );
00085 
00087 
00089             void setTexFunc( TextureFunction mode );
00090 
00092 
00093             int getWidth() const { return width; }
00094 
00096 
00097             int getHeight() const { return height; }
00098 
00100 
00101             int getRealWidth() const { return rwidth; }
00102 
00104 
00105             int getRealHeight() const { return rheight; }
00106 
00108 
00109             ColorMode getFormat() const { return format; }
00110 
00112 
00113             int getBpp() const { return bpp; }
00114 
00116 
00117             GELuint getID() const { return texID; }
00118 
00119         private:
00120             int width;
00121             int height;
00122             int rwidth;
00123             int rheight;
00124             int bpp;
00125             ColorMode format;
00126             GELuint texID;
00127     };
00128 }
00129 
00130 #endif // __GELTEXTURE_H__