00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00020 #ifndef SH_GLTEXTURESTORAGE_HPP
00021 #define SH_GLTEXTURESTORAGE_HPP
00022
00023 #include "ShVariableType.hpp"
00024 #include "ShMemory.hpp"
00025 #include "GlBackend.hpp"
00026 #include "GlTextureName.hpp"
00027
00028 namespace shgl {
00029
00030 class GlTextureStorage : public SH::ShStorage {
00031 public:
00032 GlTextureStorage(SH::ShMemory* memory, GLenum target,
00033 GLenum format, GLint internalFormat,
00034 SH::ShValueType valueType,
00035 int width, int height, int depth, int tuplesize,
00036 int count, GlTextureNamePtr name, GLint mipmap_level);
00037
00038 ~GlTextureStorage();
00039
00040 std::string id() const { return "opengl:texture"; }
00041
00042 GLuint name() const { return m_name->value(); }
00043 const GlTextureNamePtr& texName() const { return m_name; }
00044 GLenum target() const { return m_target; }
00045 GLenum format() const { return m_format; }
00046 GLint internalFormat() const { return m_internalFormat; }
00047 int width() const { return m_width; }
00048 int height() const { return m_height; }
00049 int depth() const { return m_depth; }
00050 int tuplesize() const { return m_tuplesize; }
00051 int count() const { return (m_count != -1) ? m_count : m_width * m_height * m_depth; }
00052 GLint mipmap_level() const { return m_mipmap_level; }
00053
00054 private:
00055 GlTextureNamePtr m_name;
00056
00057
00058 GLenum m_target;
00059 GLenum m_format;
00060 GLint m_internalFormat;
00061
00062 int m_width, m_height, m_depth, m_tuplesize, m_count;
00063
00064 unsigned int m_params;
00065
00066 GlTextureStorage(const GlTextureStorage&);
00067 GlTextureStorage& operator=(const GlTextureStorage&);
00068
00069 GLint m_mipmap_level;
00070 };
00071
00072 typedef SH::ShPointer<GlTextureStorage> GlTextureStoragePtr;
00073
00074 }
00075
00076 #endif