texture.hpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00027 #ifndef TEXTURE_HPP
00028 #define TEXTURE_HPP
00029
00030 #include "renderstack/rs.h"
00031 #include <vector>
00032
00033 namespace renderstack {
00034
00036 class renderbuffer
00037 {
00038 public:
00039 renderbuffer();
00040 renderbuffer(int gl_renderbuffer_object);
00041 renderbuffer(int width, int height, int gl_format, int sample_count);
00042
00043 void set(int gl_renderbuffer_object);
00044 void set(int width, int height, int gl_format, int sample_count);
00045
00046 unsigned int gl_renderbuffer_object() const { return m_gl_renderbuffer_object; }
00047
00048 private:
00049 unsigned int m_gl_renderbuffer_object;
00050 };
00051
00053 class texture
00054 {
00055 public:
00056 texture();
00057 texture(
00058 int width,
00059 int height,
00060 int gl_bind_target,
00061 int gl_teximage_target,
00062 int gl_minification_filter,
00063 int gl_magnification_filter,
00064 int gl_wrap,
00065 int gl_format
00066 );
00067
00068 public:
00069 void set(
00070 int width,
00071 int height,
00072 int gl_bind_target,
00073 int gl_teximage_target,
00074 int gl_minification_filter,
00075 int gl_magnification_filter,
00076 int gl_wrap,
00077 int gl_format
00078 );
00079
00080 void set_data(std::vector<unsigned char> const &data);
00081 void set_data(int format, unsigned char* data);
00082 void update();
00083
00084 public:
00085 int width () const { return m_width; }
00086 int height () const { return m_height; }
00087 int gl_bind_target () const { return m_gl_bind_target; }
00088 int gl_teximage_target () const { return m_gl_teximage_target; }
00089 int gl_texture_object () const { return m_gl_texture_object; }
00090 int gl_minification_filter () const { return m_gl_minification_filter; }
00091 int gl_magnification_filter () const { return m_gl_magnification_filter; }
00092 int gl_wrap () const { return m_gl_wrap; }
00093 int gl_format () const { return m_gl_format; }
00094
00095 private:
00096 int m_width;
00097 int m_height;
00098 int m_gl_bind_target;
00099 int m_gl_teximage_target;
00100 unsigned int m_gl_texture_object;
00101 int m_gl_minification_filter;
00102 int m_gl_magnification_filter;
00103 int m_gl_wrap;
00104 int m_gl_format;
00105 };
00106
00107 }
00108
00109 #endif
00110