texture.h

Go to the documentation of this file.
00001 #ifndef __UTIL__TEXTURE_HPP__
00002 #define __UTIL__TEXTURE_HPP__
00003 
00009 #include <config.h>
00010 #include <string>
00011 #include <qgl.h>
00012 
00013 namespace util {
00018   class Texture1D {
00019   public:
00020     Texture1D();
00021     Texture1D(const Texture1D& texture);
00022     Texture1D(std::string filename);
00023     ~Texture1D();
00024 
00025     const Texture1D& operator=(const Texture1D& texture);
00026 
00027     void bind();
00028 
00029     // tex parameter functions
00030     static void clamp(bool enable = true);
00031     static void filter(bool enable = true);
00032 
00033     // tex environment functions
00034     static void modulate();
00035     static void decal();
00036     static void blend();
00037     static void replace();
00038 
00039   private:
00040     GLubyte*     data;
00041     unsigned int size;
00042     GLuint       tex_name;
00043 
00044     bool clamped;
00045   };
00046 
00051   class Texture2D {
00052   public:
00053     Texture2D();
00054     Texture2D(const Texture2D& texture);
00055     Texture2D(std::string filename);
00056     ~Texture2D();
00057 
00058     const Texture2D& operator=(const Texture2D& texture);
00059 
00060     void bind();
00061 
00062     // tex parameter functions
00063     static void clamp(bool enable = true);
00064     static void filter(bool enable = true);
00065 
00066     // tex environment functions
00067     static void modulate();
00068     static void decal();
00069     static void blend();
00070     static void replace();
00071 
00072   private:
00073     GLubyte*     data;
00074     unsigned int size;
00075     unsigned int width;
00076     unsigned int height;
00077     GLuint       tex_name;
00078 
00079     bool clamped;
00080   };
00081 }
00082 
00083 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Fri May 31 15:37:53 2013 for VVE by  doxygen 1.6.3