00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00020 #ifndef SHMIPFILTER_HPP
00021 #define SHMIPFILTER_HPP
00022
00023 namespace SH {
00024
00030 template<typename T, bool interpolated=true>
00031 class ShMIPFilter : public T {
00032 public:
00033 ShMIPFilter()
00034 : T()
00035 {
00036 if (interpolated) {
00037 this->m_node->traits().filtering(ShTextureTraits::SH_FILTER_MIPMAP_LINEAR);
00038 } else {
00039 this->m_node->traits().filtering(ShTextureTraits::SH_FILTER_MIPMAP_NEAREST);
00040 }
00041 }
00042 ShMIPFilter(int width)
00043 : T(width)
00044 {
00045 if (interpolated) {
00046 this->m_node->traits().filtering(ShTextureTraits::SH_FILTER_MIPMAP_LINEAR);
00047 } else {
00048 this->m_node->traits().filtering(ShTextureTraits::SH_FILTER_MIPMAP_NEAREST);
00049 }
00050 }
00051 ShMIPFilter(int width, int height)
00052 : T(width, height)
00053 {
00054 if (interpolated) {
00055 this->m_node->traits().filtering(ShTextureTraits::SH_FILTER_MIPMAP_LINEAR);
00056 } else {
00057 this->m_node->traits().filtering(ShTextureTraits::SH_FILTER_MIPMAP_NEAREST);
00058 }
00059 }
00060 ShMIPFilter(int width, int height, int depth)
00061 : T(width, height, depth)
00062 {
00063 if (interpolated) {
00064 this->m_node->traits().filtering(ShTextureTraits::SH_FILTER_MIPMAP_LINEAR);
00065 } else {
00066 this->m_node->traits().filtering(ShTextureTraits::SH_FILTER_MIPMAP_NEAREST);
00067 }
00068 }
00069
00070 typedef typename T::return_type return_type;
00071
00072 };
00073
00077 template<typename T>
00078 class ShNoMIPFilter : public T {
00079 public:
00080 ShNoMIPFilter()
00081 : T()
00082 {
00083 this->m_node->traits().filtering(ShTextureTraits::SH_FILTER_NONE);
00084 }
00085 ShNoMIPFilter(int width)
00086 : T(width)
00087 {
00088 this->m_node->traits().filtering(ShTextureTraits::SH_FILTER_NONE);
00089 }
00090 ShNoMIPFilter(int width, int height)
00091 : T(width, height)
00092 {
00093 this->m_node->traits().filtering(ShTextureTraits::SH_FILTER_NONE);
00094 }
00095 ShNoMIPFilter(int width, int height, int depth)
00096 : T(width, height, depth)
00097 {
00098 this->m_node->traits().filtering(ShTextureTraits::SH_FILTER_NONE);
00099 }
00100
00101 typedef typename T::return_type return_type;
00102
00103 };
00104
00105 }
00106
00107 #endif