00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00020 #ifndef SHARRAY_HPP
00021 #define SHARRAY_HPP
00022
00023 namespace SH {
00024
00025 template<typename T> class ShBaseTexture1D;
00026 template<typename T> class ShBaseTexture2D;
00027 template<typename T> class ShBaseTexture3D;
00028 template<typename T> class ShBaseTextureRect;
00029 template<typename T> class ShBaseTextureCube;
00030
00034 struct
00035 ShArrayTraits : public ShTextureTraits {
00036 ShArrayTraits()
00037 : ShTextureTraits(0, SH_FILTER_NONE, SH_WRAP_CLAMP_TO_EDGE)
00038 {}
00039 };
00040
00041 template<typename T> class ShArrayRect;
00044 template<typename T>
00045 class ShArray1D
00046 : public ShBaseTexture1D<T> {
00047 public:
00048 ShArray1D()
00049 : ShBaseTexture1D<T>(ShArrayTraits())
00050 {}
00051 ShArray1D(int width)
00052 : ShBaseTexture1D<T>(width, ShArrayTraits())
00053 {}
00054 typedef ShArrayRect<T> rectangular_type;
00055 typedef ShBaseTexture1D<T> base_type;
00056 typedef T return_type;
00057 };
00058
00061 template<typename T>
00062 class ShArray2D
00063 : public ShBaseTexture2D<T> {
00064 public:
00065 ShArray2D()
00066 : ShBaseTexture2D<T>(ShArrayTraits())
00067 {}
00068 ShArray2D(int width, int height)
00069 : ShBaseTexture2D<T>(width, height, ShArrayTraits())
00070 {}
00071 typedef ShArrayRect<T> rectangular_type;
00072 typedef ShBaseTexture2D<T> base_type;
00073 typedef T return_type;
00074 };
00075
00078 template<typename T>
00079 class ShArrayRect
00080 : public ShBaseTextureRect<T> {
00081 public:
00082 ShArrayRect()
00083 : ShBaseTextureRect<T>(ShArrayTraits())
00084 {}
00085 ShArrayRect(int width, int height)
00086 : ShBaseTextureRect<T>(width, height, ShArrayTraits())
00087 {}
00088 typedef ShArrayRect<T> rectangular_type;
00089 typedef ShBaseTextureRect<T> base_type;
00090 typedef T return_type;
00091 };
00092
00095 template<typename T>
00096 class ShArray3D
00097 : public ShBaseTexture3D<T> {
00098 public:
00099 ShArray3D()
00100 : ShBaseTexture3D<T>(ShArrayTraits())
00101 {}
00102 ShArray3D(int width, int height, int depth)
00103 : ShBaseTexture3D<T>(width, height, depth, ShArrayTraits())
00104 {}
00105 typedef ShArrayRect<T> rectangular_type;
00106 typedef ShBaseTexture3D<T> base_type;
00107 typedef T return_type;
00108 };
00109
00114 template<typename T>
00115 class ShArrayCube
00116 : public ShBaseTextureCube<T> {
00117 public:
00118 ShArrayCube()
00119 : ShBaseTextureCube<T>(ShArrayTraits())
00120 {}
00121 ShArrayCube(int width, int height)
00122 : ShBaseTextureCube<T>(width, height, ShArrayTraits())
00123 {}
00124 typedef ShArrayRect<T> rectangular_type;
00125 typedef ShBaseTextureCube<T> base_type;
00126 typedef T return_type;
00127 };
00128
00129 }
00130
00131 #endif