Eulerian Smoke Simulation on the GPU
|
00001 #ifndef __TEXTURE_H__ 00002 #define __TEXTURE_H__ 00003 00004 //--------------------------------------------------------------------- 00007 //--------------------------------------------------------------------- 00008 00009 #include <string> 00010 #include "GLUtil.h" 00011 00019 class Texture 00020 { 00021 public: 00027 Texture( 00028 GLenum _target, 00029 GLenum _format, 00030 GLenum _dataType, 00031 int _samplerIndex 00032 ); 00033 00035 ~Texture(); 00036 00041 void setTextureParameter( 00042 GLenum _target, 00043 GLenum _paramName, 00044 GLfloat _paramValue 00045 ); 00046 00051 void setTextureParameter( 00052 GLenum _target, 00053 GLenum _paramName, 00054 GLint _paramValue 00055 ); 00056 00063 void read( 00064 GLenum _target, 00065 GLint _mipLevel, 00066 GLenum _format, 00067 GLenum _dataType, 00068 void* _readData 00069 ); 00070 00072 void bind(); 00074 void unbind(); 00076 inline bool isBound() const {return m_isBound;} 00077 00079 inline GLenum getTarget() const {return m_target;} 00081 inline GLenum getFormat() const {return m_format;} 00083 inline GLenum getDataType() const {return m_dataType;} 00085 inline GLuint getHandle() const {return m_handle;} 00087 inline GLenum getImageUnit() const {return m_imageUnit;} 00089 inline int getSamplerIndex() const {return m_samplerIndex;} 00090 00091 protected: 00094 GLenum m_target; 00095 00097 GLenum m_format; 00099 GLenum m_dataType; 00101 GLuint m_handle; 00103 GLenum m_imageUnit; 00105 int m_samplerIndex; 00106 00108 bool m_isBound; 00109 }; 00110 00111 #endif // __TEXTURE_H__