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

ShWrap.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 SHWRAP_HPP
00025 #define SHWRAP_HPP
00026 
00027 namespace SH {
00028 
00034 template<typename T>
00035 class ShWrapClamp : public T {
00036 public:
00037   ShWrapClamp()
00038     : T()
00039   {
00040     this->m_node->traits().wrapping(ShTextureTraits::SH_WRAP_CLAMP);
00041   }
00042   ShWrapClamp(int width)
00043     : T(width)
00044   {
00045     this->m_node->traits().wrapping(ShTextureTraits::SH_WRAP_CLAMP);
00046   }
00047   ShWrapClamp(int width, int height)
00048     : T(width, height)
00049   {
00050     this->m_node->traits().wrapping(ShTextureTraits::SH_WRAP_CLAMP);
00051   }
00052   ShWrapClamp(int width, int height, int depth)
00053     : T(width, height, depth)
00054   {
00055     this->m_node->traits().wrapping(ShTextureTraits::SH_WRAP_CLAMP);
00056   }
00057 
00058   typedef ShWrapClamp<typename T::rectangular_type> rectangular_type;
00059   typedef typename T::base_type base_type;
00060   typedef typename T::return_type return_type;
00061 };
00062 
00068 template<typename T>
00069 class ShWrapClampToEdge : public T {
00070 public:
00071   ShWrapClampToEdge()
00072     : T()
00073   {
00074     this->m_node->traits().wrapping(ShTextureTraits::SH_WRAP_CLAMP_TO_EDGE);
00075   }
00076   ShWrapClampToEdge(int width)
00077     : T(width)
00078   {
00079     this->m_node->traits().wrapping(ShTextureTraits::SH_WRAP_CLAMP_TO_EDGE);
00080   }
00081   ShWrapClampToEdge(int width, int height)
00082     : T(width, height)
00083   {
00084     this->m_node->traits().wrapping(ShTextureTraits::SH_WRAP_CLAMP_TO_EDGE);
00085   }
00086   ShWrapClampToEdge(int width, int height, int depth)
00087     : T(width, height, depth)
00088   {
00089     this->m_node->traits().wrapping(ShTextureTraits::SH_WRAP_CLAMP_TO_EDGE);
00090   }
00091 
00092   typedef ShWrapClampToEdge<typename T::rectangular_type> rectangular_type;
00093   typedef typename T::base_type base_type;
00094   typedef typename T::return_type return_type;
00095 };
00096 
00102 template<typename T>
00103 class ShWrapRepeat : public T {
00104 public:
00105   ShWrapRepeat()
00106     : T()
00107   {
00108     this->m_node->traits().wrapping(ShTextureTraits::SH_WRAP_REPEAT);
00109   }
00110   ShWrapRepeat(int width)
00111     : T(width)
00112   {
00113     this->m_node->traits().wrapping(ShTextureTraits::SH_WRAP_REPEAT);
00114   }
00115   ShWrapRepeat(int width, int height)
00116     : T(width, height)
00117   {
00118     this->m_node->traits().wrapping(ShTextureTraits::SH_WRAP_REPEAT);
00119   }
00120   ShWrapRepeat(int width, int height, int depth)
00121     : T(width, height, depth)
00122   {
00123     this->m_node->traits().wrapping(ShTextureTraits::SH_WRAP_REPEAT);
00124   }
00125 
00126   typedef ShWrapRepeat<typename T::rectangular_type> rectangular_type;
00127   typedef typename T::base_type base_type;
00128   typedef typename T::return_type return_type;
00129 };
00130 
00131 }
00132 
00133 #endif

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