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 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 SHWRAP_HPP
00021 #define SHWRAP_HPP
00022 
00023 namespace SH {
00024 
00030 template<typename T>
00031 class ShWrapClamp : public T {
00032 public:
00033   ShWrapClamp()
00034     : T()
00035   {
00036     this->m_node->traits().wrapping(ShTextureTraits::SH_WRAP_CLAMP);
00037   }
00038   ShWrapClamp(int width)
00039     : T(width)
00040   {
00041     this->m_node->traits().wrapping(ShTextureTraits::SH_WRAP_CLAMP);
00042   }
00043   ShWrapClamp(int width, int height)
00044     : T(width, height)
00045   {
00046     this->m_node->traits().wrapping(ShTextureTraits::SH_WRAP_CLAMP);
00047   }
00048   ShWrapClamp(int width, int height, int depth)
00049     : T(width, height, depth)
00050   {
00051     this->m_node->traits().wrapping(ShTextureTraits::SH_WRAP_CLAMP);
00052   }
00053 
00054   typedef ShWrapClamp<typename T::rectangular_type> rectangular_type;
00055   typedef typename T::base_type base_type;
00056   typedef typename T::return_type return_type;
00057 };
00058 
00064 template<typename T>
00065 class ShWrapClampToEdge : public T {
00066 public:
00067   ShWrapClampToEdge()
00068     : T()
00069   {
00070     this->m_node->traits().wrapping(ShTextureTraits::SH_WRAP_CLAMP_TO_EDGE);
00071   }
00072   ShWrapClampToEdge(int width)
00073     : T(width)
00074   {
00075     this->m_node->traits().wrapping(ShTextureTraits::SH_WRAP_CLAMP_TO_EDGE);
00076   }
00077   ShWrapClampToEdge(int width, int height)
00078     : T(width, height)
00079   {
00080     this->m_node->traits().wrapping(ShTextureTraits::SH_WRAP_CLAMP_TO_EDGE);
00081   }
00082   ShWrapClampToEdge(int width, int height, int depth)
00083     : T(width, height, depth)
00084   {
00085     this->m_node->traits().wrapping(ShTextureTraits::SH_WRAP_CLAMP_TO_EDGE);
00086   }
00087 
00088   typedef ShWrapClampToEdge<typename T::rectangular_type> rectangular_type;
00089   typedef typename T::base_type base_type;
00090   typedef typename T::return_type return_type;
00091 };
00092 
00098 template<typename T>
00099 class ShWrapRepeat : public T {
00100 public:
00101   ShWrapRepeat()
00102     : T()
00103   {
00104     this->m_node->traits().wrapping(ShTextureTraits::SH_WRAP_REPEAT);
00105   }
00106   ShWrapRepeat(int width)
00107     : T(width)
00108   {
00109     this->m_node->traits().wrapping(ShTextureTraits::SH_WRAP_REPEAT);
00110   }
00111   ShWrapRepeat(int width, int height)
00112     : T(width, height)
00113   {
00114     this->m_node->traits().wrapping(ShTextureTraits::SH_WRAP_REPEAT);
00115   }
00116   ShWrapRepeat(int width, int height, int depth)
00117     : T(width, height, depth)
00118   {
00119     this->m_node->traits().wrapping(ShTextureTraits::SH_WRAP_REPEAT);
00120   }
00121 
00122   typedef ShWrapRepeat<typename T::rectangular_type> rectangular_type;
00123   typedef typename T::base_type base_type;
00124   typedef typename T::return_type return_type;
00125 };
00126 
00127 }
00128 
00129 #endif

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