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