00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00024 #ifndef SHNIBBLES_HPP
00025 #define SHNIBBLES_HPP
00026
00032 #include "ShBaseTexture.hpp"
00033 #include "ShProgram.hpp"
00034 #include "ShMatrix.hpp"
00035
00036 namespace SH {
00037
00042 template<typename T>
00043 ShProgram keep(const std::string & name = "");
00044
00049 template<typename T>
00050 ShProgram dup(const std::string & name = "var");
00051
00056 template<typename T>
00057 ShProgram lose(const std::string & name = "");
00058
00062 template<typename T>
00063 ShProgram access(const ShBaseTexture1D<T> &tex, const std::string & tcname = "texcoord", const std::string & name = "result");
00064
00068 template<typename T>
00069 ShProgram access(const ShBaseTexture2D<T> &tex, const std::string & tcname = "texcoord", const std::string & name = "result");
00070
00074 template<typename T>
00075 ShProgram access(const ShBaseTextureRect<T> &tex, const std::string & tcname = "texcoord", const std::string & name = "result");
00076
00080 template<typename T>
00081 ShProgram access(const ShBaseTexture3D<T> &tex, const std::string & tcname = "texcoord", const std::string & name = "result");
00082
00086 template<typename T>
00087 ShProgram access(const ShBaseTextureCube<T> &tex, const std::string & tcname = "texcoord", const std::string & name = "result");
00088
00095 template<typename T, int Rows, int Cols, ShBindingType Binding, typename T2>
00096 ShProgram transform(const ShMatrix<Rows, Cols, Binding, T2> &m, const std::string & name = "result");
00097
00106 template<typename T, typename T2>
00107 ShProgram cast(const std::string & name = "result");
00108
00117 template<typename T, typename T2>
00118 ShProgram fillcast(const std::string & name = "result");
00119
00124 template<typename T> ShProgram abs(const std::string & name = "result");
00125 template<typename T> ShProgram acos(const std::string & name = "result");
00126 template<typename T> ShProgram asin(const std::string & name = "result");
00127 template<typename T> ShProgram cos(const std::string & name = "result");
00128 template<typename T> ShProgram frac(const std::string & name = "result");
00129 template<typename T> ShProgram sin(const std::string & name = "result");
00130 template<typename T> ShProgram sqrt(const std::string & name = "result");
00131 template<typename T> ShProgram normalize(const std::string & name = "result");
00132 template<typename T> ShProgram pos(const std::string & name = "result");
00134
00140 #define SHNIBBLE_BINARY_OP_DECL(opname) \
00141 template<typename T1, typename T2> ShProgram opname(const std::string & output_name = "result",\
00142 const std::string & input_name0 = "x", const std::string & input_name1 = "y"); \
00143 template<typename T1> ShProgram opname(const std::string & output_name = "result",\
00144 const std::string & input_name0 = "x", const std::string & input_name1 = "y");
00145 SHNIBBLE_BINARY_OP_DECL(add);
00146 SHNIBBLE_BINARY_OP_DECL(sub);
00147 SHNIBBLE_BINARY_OP_DECL(mul);
00148 SHNIBBLE_BINARY_OP_DECL(div);
00149 SHNIBBLE_BINARY_OP_DECL(pow);
00150 SHNIBBLE_BINARY_OP_DECL(slt);
00151 SHNIBBLE_BINARY_OP_DECL(sle);
00152 SHNIBBLE_BINARY_OP_DECL(sgt);
00153 SHNIBBLE_BINARY_OP_DECL(sge);
00154 SHNIBBLE_BINARY_OP_DECL(seq);
00155 SHNIBBLE_BINARY_OP_DECL(sne);
00156 SHNIBBLE_BINARY_OP_DECL(max);
00157 SHNIBBLE_BINARY_OP_DECL(min);
00158 SHNIBBLE_BINARY_OP_DECL(mod);
00159
00165 template<typename T> ShProgram dot(const std::string & name = "result");
00167
00174 template<typename T1, typename T2>
00175 ShProgram lerp(const std::string & name = "result");
00176
00177 template<typename T1>
00178 ShProgram lerp(const std::string & name = "result");
00180
00181 }
00182
00183
00184 #include "ShNibblesImpl.hpp"
00185
00186 #endif