00001 #pragma once 00002 00003 class Texture1D; 00004 00005 #include "Vis.hpp" 00006 #include <vector> 00007 00011 class Texture1D 00012 { 00016 GLuint texture_name; 00017 00021 GLenum wrap; 00022 00026 GLenum mag_filter; 00027 00031 GLenum min_filter; 00032 00036 GLuint size; 00037 00038 public: 00039 00043 float* pixels; 00044 00053 Texture1D(GLuint sizeT, 00054 float* color = NULL, 00055 GLenum wrap = GL_CLAMP, 00056 GLenum mag_filter = GL_LINEAR, 00057 GLenum min_filter = GL_LINEAR_MIPMAP_LINEAR); 00058 00059 virtual ~Texture1D() { 00060 glDeleteTextures(1, &texture_name); 00061 }; 00062 00066 void updateColor(float* color); 00067 00071 GLuint getTrSize(); 00072 00076 void send_to_GPU(); 00077 00081 void build_mipmaps(); 00082 00086 void bind(GLuint texUnit); 00087 00091 GLuint get_texture_name() 00092 { 00093 return texture_name; 00094 }; 00095 };