00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00027 #ifndef SHNIBBLES_HPP
00028 #define SHNIBBLES_HPP
00029
00035 #include "ShBaseTexture.hpp"
00036 #include "ShProgram.hpp"
00037 #include "ShMatrix.hpp"
00038
00039 namespace SH {
00040
00045 template<typename T>
00046 ShProgram keep(const std::string & name = "");
00047
00052 template<typename T>
00053 ShProgram dup(const std::string & name = "var");
00054
00059 template<typename T>
00060 ShProgram lose(const std::string & name = "");
00061
00065 template<typename T>
00066 ShProgram access(const ShBaseTexture1D<T> &tex, const std::string & tcname = "texcoord", const std::string & name = "result");
00067
00071 template<typename T>
00072 ShProgram access(const ShBaseTexture2D<T> &tex, const std::string & tcname = "texcoord", const std::string & name = "result");
00073
00077 template<typename T>
00078 ShProgram access(const ShBaseTextureRect<T> &tex, const std::string & tcname = "texcoord", const std::string & name = "result");
00079
00083 template<typename T>
00084 ShProgram access(const ShBaseTexture3D<T> &tex, const std::string & tcname = "texcoord", const std::string & name = "result");
00085
00089 template<typename T>
00090 ShProgram access(const ShBaseTextureCube<T> &tex, const std::string & tcname = "texcoord", const std::string & name = "result");
00091
00098 template<typename T, int Rows, int Cols, ShBindingType Binding, typename T2>
00099 ShProgram transform(const ShMatrix<Rows, Cols, Binding, T2> &m, const std::string & name = "result");
00100
00109 template<typename T, typename T2>
00110 ShProgram cast(const std::string & name = "result");
00111
00120 template<typename T, typename T2>
00121 ShProgram fillcast(const std::string & name = "result");
00122
00127 template<typename T> ShProgram abs(const std::string & name = "result");
00128 template<typename T> ShProgram acos(const std::string & name = "result");
00129 template<typename T> ShProgram asin(const std::string & name = "result");
00130 template<typename T> ShProgram cos(const std::string & name = "result");
00131 template<typename T> ShProgram frac(const std::string & name = "result");
00132 template<typename T> ShProgram sin(const std::string & name = "result");
00133 template<typename T> ShProgram sqrt(const std::string & name = "result");
00134 template<typename T> ShProgram normalize(const std::string & name = "result");
00135 template<typename T> ShProgram pos(const std::string & name = "result");
00137
00143 #define SHNIBBLE_BINARY_OP_DECL(opname) \
00144 template<typename T1, typename T2> ShProgram opname(const std::string & output_name = "result",\
00145 const std::string & input_name0 = "x", const std::string & input_name1 = "y"); \
00146 template<typename T1> ShProgram opname(const std::string & output_name = "result",\
00147 const std::string & input_name0 = "x", const std::string & input_name1 = "y");
00148 SHNIBBLE_BINARY_OP_DECL(add);
00149 SHNIBBLE_BINARY_OP_DECL(sub);
00150 SHNIBBLE_BINARY_OP_DECL(mul);
00151 SHNIBBLE_BINARY_OP_DECL(div);
00152 SHNIBBLE_BINARY_OP_DECL(pow);
00153 SHNIBBLE_BINARY_OP_DECL(slt);
00154 SHNIBBLE_BINARY_OP_DECL(sle);
00155 SHNIBBLE_BINARY_OP_DECL(sgt);
00156 SHNIBBLE_BINARY_OP_DECL(sge);
00157 SHNIBBLE_BINARY_OP_DECL(seq);
00158 SHNIBBLE_BINARY_OP_DECL(sne);
00159 SHNIBBLE_BINARY_OP_DECL(max);
00160 SHNIBBLE_BINARY_OP_DECL(min);
00161 SHNIBBLE_BINARY_OP_DECL(mod);
00162
00168 template<typename T> ShProgram dot(const std::string & name = "result");
00170
00177 template<typename T1, typename T2>
00178 ShProgram lerp(const std::string & name = "result");
00179
00180 template<typename T1>
00181 ShProgram lerp(const std::string & name = "result");
00183
00184 }
00185
00186
00187 #include "ShNibblesImpl.hpp"
00188
00189 #endif