texture.h

Go to the documentation of this file.
00001 #ifndef _ANTI_TEXTURE_
00002 #define _ANTI_TEXTURE_
00003 
00004 #include "antistd.h"
00005 
00006 typedef struct aeImage
00007 {
00008         uint width;
00009         uint height;
00010         uint components;
00011         GLenum format;
00012         GLenum type;
00013         void* data;
00014 } aeImage;
00015 
00016 typedef enum
00017 {
00018         AE_TEX2D,
00019         AE_TEX1D,       
00020         //AE_TEX3D,     //
00021         //AE_NORMAL,    // http://www.paulsprojects.net/tutorials/simplebump/simplebump.html
00022         //AE_BUMP,      // http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=22
00023         AE_SPHERE,      // http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=23
00024         //AE_CUBE,      // http://www.cs.ualberta.ca/~ghali/courses/texts/redbook/html/09-07-cubemap.c.html
00025         //AE_PARALLAX,  // does it need to be separate from normal mapping?
00026         AE_SHADER       // 
00027 } aeTextureType;
00028 
00029 typedef struct aeTexture
00030 {
00031         uint width;
00032         uint height;
00033         uint components;
00034         GLenum format;
00035         GLenum type;
00036         uint id;
00037         aeTextureType textype;
00038 } aeTexture;
00039 
00040 typedef struct aeTextureEntry
00041 {
00042         char* name;
00043         aeTexture* tex;
00044         struct aeTextureEntry* next;
00045 } aeTextureEntry;
00046 
00047 typedef struct aeBMPHeader
00048 {
00049         uint size;
00050         uint rsv;
00051         uint offset;
00052         uint hdrSize;
00053         uint width;
00054         uint height;
00055         short planes;
00056         short bitcount;
00057         uint compression;
00058         uint imageSize;
00059         uint xRes;
00060         uint yRes;
00061         uint clrUsed;
00062         uint clrImpt;
00063 } aeBMPHeader;
00064 
00065 typedef struct aePCXHeader
00066 {
00067         byte id;
00068         byte ver;
00069         byte enc;
00070         byte bpp;
00071         short xmin;
00072         short ymin;
00073         short xmax;
00074         short ymax;
00075         short hdpi;
00076         short vdpi;
00077         byte cmap[48];
00078         byte rsv;
00079         byte planes;
00080         short linesize;
00081         short palette;
00082         short hssize;
00083         short vssize;
00084         byte filler[54];
00085 } aePCXHeader;
00086 
00087 typedef struct aeTGAHeader
00088 {
00089         byte idsize;
00090         byte cmapType;
00091         byte imType;
00092         ushort cmapStart;
00093         ushort cmapLen;
00094         byte cmapBits;
00095         short xstart;
00096         short ystart;
00097         ushort width;
00098         ushort height;
00099         byte bits;
00100         byte descriptor;
00101 } aeTGAHeader;
00102 
00103 typedef struct aeWALHeader
00104 {
00105         char name[32];
00106         uint width;
00107         uint height;
00108         int offset[4];
00109         char next_name[32];
00110         uint flags;
00111         uint contents;
00112         uint value;
00113 } aeWALHeader;
00114 
00115 aeTexture* aeLoadTexture(const char*);
00116 aeTexture* aeLoadGLSLShader(const char*, const char*);
00117 aeTexture* aeLoadMgdTexture(const char*);
00118 aeTexture* aeLoadNamedMgdTexture(const char*,const char*);
00119 aeTexture* aeGetNamedTexture(const char*);
00120 void aeUnloadTexture(aeTexture*);
00121 void aeUnloadNamedTexture(const char*);
00122 void aeUnloadAllTextures();
00123 
00124 void aeRenderToTexture(aeTexture*,void(*)(void));
00125 void aeRenderToSubtexture(aeTexture*,void(*)(void),uint,uint,uint,uint);
00126 
00127 #ifdef _ANTI_SDL_IMAGE
00128 aeImage aeLoadSDL(const char*);
00129 #endif
00130 aeImage aeLoadPNG(const char*);
00131 aeImage aeLoadBMP(const char*);
00132 aeImage aeLoadPCX(const char*);
00133 aeImage aeLoadTGA(const char*);
00134 aeImage aeLoadJPG(const char*);
00135 aeImage aeLoadWAL(const char*);
00136 aeImage aeLoadRaw(const char*,uint,uint,uint); // width,height,bpp
00137 aeTexture* aeMakeTexture(byte,byte,byte,byte);
00138 aeTexture* __aeBuildMipmaps(aeImage*,aeTextureType);
00139 
00140 void aeBindTexture(aeTexture*);
00141 void aeUnbindTexture(aeTexture*);
00142 void aeUnloadTextureData(aeTexture*);
00143 
00144 aeTextureEntry* __aeTexRoot;
00145 aeTextureEntry* __aeTexEnd;
00146 
00147 #endif

Generated on Fri Jun 1 09:08:55 2007 for Antigone by  doxygen 1.4.7