ShTexture.hpp

00001 // Sh: A GPU metaprogramming language.
00002 //
00003 // Copyright 2003-2006 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 SHTEXTURE_HPP
00021 #define SHTEXTURE_HPP
00022 
00023 #include "ShBaseTexture.hpp"
00024 
00025 namespace SH {
00026 
00029 struct 
00030 ShFilteredTextureTraits : public ShTextureTraits {
00031   ShFilteredTextureTraits()
00032     : ShTextureTraits(1, SH_FILTER_MIPMAP_LINEAR, SH_WRAP_CLAMP_TO_EDGE)
00033   {}
00034 };
00035 
00036 template<typename T> class ShTextureRect;
00037 
00040 template<typename T>
00041 class ShTexture1D
00042   : public ShBaseTexture1D<T> {
00043 public:
00044   ShTexture1D()
00045     : ShBaseTexture1D<T>(ShFilteredTextureTraits())
00046   {}
00047   ShTexture1D(int width)
00048     : ShBaseTexture1D<T>(width, ShFilteredTextureTraits())
00049   {}
00050   typedef ShTextureRect<T> rectangular_type;
00051   typedef ShBaseTexture1D<T> base_type;
00052   typedef T return_type;
00053 };
00054 
00057 template<typename T>
00058 class ShTexture2D
00059   : public ShBaseTexture2D<T> {
00060 public:
00061   ShTexture2D()
00062     : ShBaseTexture2D<T>(ShFilteredTextureTraits())
00063   {}
00064   ShTexture2D(int width, int height)
00065     : ShBaseTexture2D<T>(width, height, ShFilteredTextureTraits())
00066   {}
00067   //    ShTexture2D(int width, int height, ShTextureTraits& traits)
00068   //     : ShBaseTexture2D<T>(width, height, traits)
00069   //   {}
00070   typedef ShTextureRect<T> rectangular_type;
00071   typedef ShBaseTexture2D<T> base_type;
00072   typedef T return_type;
00073 };
00074 
00077 template<typename T>
00078 class ShTextureRect
00079   : public ShBaseTextureRect<T> {
00080 public:
00081   ShTextureRect()
00082     : ShBaseTextureRect<T>(ShFilteredTextureTraits())
00083   {}
00084   ShTextureRect(int width, int height)
00085     : ShBaseTextureRect<T>(width, height, ShFilteredTextureTraits())
00086   {}
00087   //    ShTextureRect(int width, int height, ShTextureTraits& traits)
00088   //     : ShBaseTextureRect<T>(width, height, traits)
00089   //   {}
00090   typedef ShTextureRect<T> rectangular_type;
00091   typedef ShBaseTextureRect<T> base_type;
00092   typedef T return_type;
00093 };
00094 
00097 template<typename T>
00098 class ShTexture3D
00099   : public ShBaseTexture3D<T> {
00100 public:
00101   ShTexture3D()
00102     : ShBaseTexture3D<T>(ShFilteredTextureTraits())
00103   {}
00104   ShTexture3D(int width, int height, int depth)
00105     : ShBaseTexture3D<T>(width, height, depth, ShFilteredTextureTraits())
00106   {}
00107   typedef ShTextureRect<T> rectangular_type;
00108   typedef ShBaseTexture3D<T> base_type;
00109   typedef T return_type;
00110 };
00111 
00117 template<typename T>
00118 class ShTextureCube
00119   : public ShBaseTextureCube<T> {
00120 public:
00121   ShTextureCube()
00122     : ShBaseTextureCube<T>(ShFilteredTextureTraits())
00123   {}
00124   ShTextureCube(int width, int height)
00125     : ShBaseTextureCube<T>(width, height, ShFilteredTextureTraits())
00126   {}
00127   typedef ShTextureRect<T> rectangular_type;
00128   typedef ShBaseTextureCube<T> base_type;
00129   typedef T return_type;
00130 };
00131 
00132 }
00133 
00134 #endif

Generated on Thu Feb 16 14:51:38 2006 for Sh by  doxygen 1.4.6