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