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

ShArray.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 SHARRAY_HPP
00025 #define SHARRAY_HPP
00026 
00027 #include "ShBaseTexture.hpp"
00028 
00029 namespace SH {
00030 
00034 struct
00035 ShArrayTraits : public ShTextureTraits {
00036   ShArrayTraits()
00037     : ShTextureTraits(0, SH_FILTER_NONE, SH_WRAP_CLAMP_TO_EDGE, SH_CLAMPED)
00038   {
00039   }
00040 };
00041 
00042 template<typename T> class ShArrayRect;
00043 
00046 template<typename T>
00047 class ShArray1D
00048   : public ShBaseTexture1D<T> {
00049 public:
00050   ShArray1D()
00051     : ShBaseTexture1D<T>(ShArrayTraits())
00052   {}
00053   ShArray1D(int width)
00054     : ShBaseTexture1D<T>(width, ShArrayTraits())
00055   {}
00056         typedef ShArrayRect<T> rectangular_type;
00057         typedef ShBaseTexture1D<T> base_type;
00058   typedef T return_type;
00059 };
00060 
00063 template<typename T>
00064 class ShArray2D
00065   : public ShBaseTexture2D<T> {
00066 public:
00067   ShArray2D()
00068     : ShBaseTexture2D<T>(ShArrayTraits())
00069   {}
00070   ShArray2D(int width, int height)
00071     : ShBaseTexture2D<T>(width, height, ShArrayTraits())
00072   {}
00073         typedef ShArrayRect<T> rectangular_type;
00074         typedef ShBaseTexture2D<T> base_type;
00075   typedef T return_type;
00076 };
00077 
00080 template<typename T>
00081 class ShArrayRect
00082   : public ShBaseTextureRect<T> {
00083 public:
00084   ShArrayRect()
00085     : ShBaseTextureRect<T>(ShArrayTraits())
00086   {}
00087   ShArrayRect(int width, int height)
00088     : ShBaseTextureRect<T>(width, height, ShArrayTraits())
00089   {}
00090         typedef ShArrayRect<T> rectangular_type;
00091         typedef ShBaseTextureRect<T> base_type;
00092   typedef T return_type;
00093 };
00094 
00097 template<typename T>
00098 class ShArray3D
00099   : public ShBaseTexture3D<T> {
00100 public:
00101   ShArray3D()
00102     : ShBaseTexture3D<T>(ShArrayTraits())
00103   {}
00104   ShArray3D(int width, int height, int depth)
00105     : ShBaseTexture3D<T>(width, height, depth, ShArrayTraits())
00106   {}
00107         typedef ShArrayRect<T> rectangular_type;
00108         typedef ShBaseTexture3D<T> base_type;
00109   typedef T return_type;
00110 };
00111 
00116 template<typename T>
00117 class ShArrayCube
00118   : public ShBaseTextureCube<T> {
00119 public:
00120   ShArrayCube()
00121     : ShBaseTextureCube<T>(ShArrayTraits())
00122   {}
00123   ShArrayCube(int width, int height)
00124     : ShBaseTextureCube<T>(width, height, ShArrayTraits())
00125   {}
00126         typedef ShArrayRect<T> rectangular_type;
00127         typedef ShBaseTextureCube<T> base_type;
00128   typedef T return_type;
00129 };
00130 
00131 }
00132 
00133 #endif

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