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

ShTexture.hpp

00001 // Sh: A GPU metaprogramming language.
00002 //
00003 // Copyright 2003-2005 Serious Hack Inc.
00004 // 
00005 // This software is provided 'as-is', without any express or implied
00006 // warranty. In no event will the authors be held liable for any damages
00007 // arising from the use of this software.
00008 // 
00009 // Permission is granted to anyone to use this software for any purpose,
00010 // including commercial applications, and to alter it and redistribute it
00011 // freely, subject to the following restrictions:
00012 // 
00013 // 1. The origin of this software must not be misrepresented; you must
00014 // not claim that you wrote the original software. If you use this
00015 // software in a product, an acknowledgment in the product documentation
00016 // would be appreciated but is not required.
00017 // 
00018 // 2. Altered source versions must be plainly marked as such, and must
00019 // not be misrepresented as being the original software.
00020 // 
00021 // 3. This notice may not be removed or altered from any source
00022 // distribution.
00024 #ifndef SHTEXTURE_HPP
00025 #define SHTEXTURE_HPP
00026 
00027 #include "ShBaseTexture.hpp"
00028 
00029 namespace SH {
00030 
00033 struct 
00034 ShFilteredTextureTraits : public ShTextureTraits {
00035   ShFilteredTextureTraits()
00036     : ShTextureTraits(1, SH_FILTER_MIPMAP, SH_WRAP_CLAMP_TO_EDGE, SH_CLAMPED)
00037   {
00038   }
00039 };
00040 
00041 template<typename T> class ShTextureRect;
00042 
00045 template<typename T>
00046 class ShTexture1D
00047   : public ShBaseTexture1D<T> {
00048 public:
00049   ShTexture1D()
00050     : ShBaseTexture1D<T>(ShFilteredTextureTraits())
00051   {}
00052   ShTexture1D(int width)
00053     : ShBaseTexture1D<T>(width, ShFilteredTextureTraits())
00054   {}
00055         typedef ShTextureRect<T> rectangular_type;
00056         typedef ShBaseTexture1D<T> base_type;
00057   typedef T return_type;
00058 };
00059 
00062 template<typename T>
00063 class ShTexture2D
00064   : public ShBaseTexture2D<T> {
00065 public:
00066   ShTexture2D()
00067     : ShBaseTexture2D<T>(ShFilteredTextureTraits())
00068   {}
00069   ShTexture2D(int width, int height)
00070     : ShBaseTexture2D<T>(width, height, ShFilteredTextureTraits())
00071   {}
00072 //    ShTexture2D(int width, int height, ShTextureTraits& traits)
00073 //     : ShBaseTexture2D<T>(width, height, traits)
00074 //   {}
00075         typedef ShTextureRect<T> rectangular_type;
00076         typedef ShBaseTexture2D<T> base_type;
00077   typedef T return_type;
00078 };
00079 
00082 template<typename T>
00083 class ShTextureRect
00084   : public ShBaseTextureRect<T> {
00085 public:
00086   ShTextureRect()
00087     : ShBaseTextureRect<T>(ShFilteredTextureTraits())
00088   {}
00089   ShTextureRect(int width, int height)
00090     : ShBaseTextureRect<T>(width, height, ShFilteredTextureTraits())
00091   {}
00092 //    ShTextureRect(int width, int height, ShTextureTraits& traits)
00093 //     : ShBaseTextureRect<T>(width, height, traits)
00094 //   {}
00095         typedef ShTextureRect<T> rectangular_type;
00096         typedef ShBaseTextureRect<T> base_type;
00097   typedef T return_type;
00098 };
00099 
00102 template<typename T>
00103 class ShTexture3D
00104   : public ShBaseTexture3D<T> {
00105 public:
00106   ShTexture3D()
00107     : ShBaseTexture3D<T>(ShFilteredTextureTraits())
00108   {}
00109   ShTexture3D(int width, int height, int depth)
00110     : ShBaseTexture3D<T>(width, height, depth, ShFilteredTextureTraits())
00111   {}
00112         typedef ShTextureRect<T> rectangular_type;
00113         typedef ShBaseTexture3D<T> base_type;
00114   typedef T return_type;
00115 };
00116 
00122 template<typename T>
00123 class ShTextureCube
00124   : public ShBaseTextureCube<T> {
00125 public:
00126   ShTextureCube()
00127     : ShBaseTextureCube<T>(ShFilteredTextureTraits())
00128   {}
00129   ShTextureCube(int width, int height)
00130     : ShBaseTextureCube<T>(width, height, ShFilteredTextureTraits())
00131   {}
00132         typedef ShTextureRect<T> rectangular_type;
00133         typedef ShBaseTextureCube<T> base_type;
00134   typedef T return_type;
00135 };
00136 
00137 }
00138 
00139 #endif

Generated on Thu Apr 21 17:32:49 2005 for Sh by  doxygen 1.4.2