Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

GlTextureStorage.hpp

00001 // Sh: A GPU metaprogramming language.
00002 //
00003 // Copyright 2003-2005 Serious Hack Inc.
00004 // 
00005 // This library is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU Lesser General Public
00007 // License as published by the Free Software Foundation; either
00008 // version 2.1 of the License, or (at your option) any later version.
00009 //
00010 // This library is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 // Lesser General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU Lesser General Public
00016 // License along with this library; if not, write to the Free Software
00017 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
00018 // MA  02110-1301, USA
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   // OpenGL texture params.  type will be determined by the Transfer function
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

Generated on Thu Jul 28 17:33:00 2005 for Sh by  doxygen 1.4.3-20050530