Page principale | Hiérarchie des classes | Liste par ordre alphabétique | Liste des composants | Liste des fichiers | Composants | Déclarations | Pages associées

texture.h

Aller à la documentation de ce fichier.
00001 /* ***********************************************************************************
00002         Writer:         Sebastien Bloc
00003         Copyright:      2004
00004         eMail:          sebastien.bloc@free.fr
00005         URL:            http://mignonsoft.free.fr
00006 
00007         This program is free software; you can redistribute it and/or
00008         modify it under the terms of the GNU General Public License
00009         as published by the Free Software Foundation; either version 2
00010         of the License, or (at your option) any later version.
00011 
00012         This program is distributed in the hope that it will be useful,
00013         but WITHOUT ANY WARRANTY; without even the implied warranty of
00014         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015         GNU General Public License for more details.
00016         http://www.gnu.org/copyleft/gpl.html
00017 *********************************************************************************** */
00018 
00023 #ifndef INCLUDE_3D_TEXTURE_H
00024 #define INCLUDE_3D_TEXTURE_H
00025 
00026 #include "3d.h"
00027 #include "color.h"
00028 
00029 typedef enum
00030 {
00031         texture1D = GL_TEXTURE_1D , 
00032         texture2D = GL_TEXTURE_2D,
00033         texture3D = GL_TEXTURE_3D
00034 } TextureTarget; // a caster en GLint pour switch
00035 
00036 typedef enum
00037 {
00038         clamp = GL_CLAMP,
00039         repeat = GL_REPEAT
00040 } TextureWrap; // a caster en GLint pour switch
00041 
00042 typedef enum
00043 {
00044         nearest = GL_NEAREST,
00045         linear = GL_LINEAR
00046 } TextureFilter; // a caster en GLint pour switch
00047 
00048 typedef enum 
00049 {
00050         modulate = GL_MODULATE, 
00051         decal = GL_DECAL,
00052         blend = GL_BLEND, 
00053         replace = GL_REPLACE,
00054 } TextureEnvMode; // a caster en GLint pour switch
00055 
00063 class Texture
00064 {
00065 public:
00066         static MyList<Texture *> list;
00067         GLint id;
00068         MyString name;
00069         MyString source;
00070         BOOL useResizing;
00071         GLdouble xScale,yScale;
00072         int xSize,ySize;
00073         TextureTarget target;                           
00074         TextureWrap wrapT,wrapS;                        
00075         TextureFilter magFilter,minFilter;
00076         TextureEnvMode envMode;                          
00077         Color envColor;
00078         Color border;
00079 
00080 public: // membre static
00081         static Texture * Find(char *name);
00082         static BOOL Delete(Texture *texture);
00083 
00084 public:
00085         void VerifyId();
00086         void Config(); 
00087         void ConfigPixelStore();
00088         GLubyte * ConfigSize (int _xSize,int _ySize,BOOL allocate,BOOL resizeIt);
00089         void SetCoord(double x,double y);
00090         BOOL Delete();
00091 
00092 public:
00093         Texture();
00094         ~Texture();
00095         void Zero();
00096         void operator =(Texture &src);
00097         BOOL CreateNull();
00098         BOOL CreateFromBitmap(char *_name,char *fileName,BOOL resizeIt=FALSE);
00099         BOOL CreateFromText(char *_name,char *text,COLORREF color,COLORREF background,COLORREF background2,COLORREF contour,int xFormat=0,int yFormat=0);
00100         operator GLuint () const { return id; }
00101 };
00102 
00103 #endif

Généré le Thu Apr 8 18:52:15 2004 pour 3D Controls par doxygen 1.3.6