home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 February / Chip_2001-02_cd1.bin / bonus / demos / CS / exp / SOURCES / GLENGINE / texture.h < prev    next >
C/C++ Source or Header  |  2000-07-16  |  1KB  |  76 lines

  1. #ifndef __OGL2_TEXTURE__
  2. #define __OGL2_TEXTURE__
  3.  
  4. #include "types.h"
  5. #include "entity.h"
  6. #include "image.h"
  7.  
  8. extern "C++" {
  9.  
  10. class Texture : public Entity
  11. {
  12. protected:
  13.   GLuint texture;
  14.   GLint wrap_s;
  15.   GLint wrap_t;
  16.   GLint min_filter;
  17.   GLint mag_filter;
  18.   GLfloat border_color[4];
  19.   GLfloat priority;
  20.   GLenum env_mode;
  21.   GLfloat env_color[4];
  22.  
  23.   bool transferred;
  24.   bool altered;
  25.  
  26. public:
  27.  
  28.   Texture();
  29.   virtual ~Texture ();
  30.  
  31.   virtual void GL () = 0;
  32.  
  33.   void WrapS (GLint n),
  34.        WrapT (GLint n),
  35.        MinFilter (GLint n),
  36.        MagFilter (GLint n),
  37.        Priority (GLfloat f),
  38.        BorderColor4fv (GLfloat *v),
  39.        EnvMode (GLenum e),
  40.        EnvColor4f (GLfloat r, GLfloat g, GLfloat b, GLfloat a),
  41.        EnvColor4fv (GLfloat *v);
  42.  
  43.   // Feedback 
  44.   GLint WrapS (),
  45.         WrapT (),
  46.         MinFilter (),
  47.         MagFilter ();
  48.   GLfloat Priority ();
  49.   GLenum EnvMode ();
  50.   const GLfloat* BorderColor4fv ();
  51.   const GLfloat* EnvColor4fv ();
  52.  
  53. };
  54.  
  55. template class EntityList<Texture>;
  56. typedef EntityList<Texture> Textures;
  57.  
  58.  
  59. class TextureGL : public Texture {
  60. public:
  61.   void GL ();
  62.   void TexImage2D (GLenum target, GLint level, GLint internalformat,
  63.                    GLsizei width, GLsizei height, GLint border,
  64.                    GLenum format, GLenum type, void *data);
  65. };
  66.  
  67. class TextureFile : public Texture {
  68. public:
  69.   void GL ();
  70. };
  71.  
  72. } // extern "C++"
  73.  
  74. #endif
  75.  
  76.