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 #ifndef __SGL_TEXTURE_CUBE_MAP_HPP
00026 #define __SGL_TEXTURE_CUBE_MAP_HPP
00027
00028 #include <sgl.h>
00029 #include <vector>
00030 #include <sglObject.hpp>
00031 #include <sglVector.hpp>
00032 #include <sglTexture.hpp>
00033
00034
00035
00114 class SGL_DLL_API sglTextureCubeMap : public sglTexture
00115 {
00116 public:
00118 sglTextureCubeMap();
00119
00121 virtual ~sglTextureCubeMap();
00122
00144 bool setImage(void *px_image,
00145 void *nx_image,
00146 void *py_image,
00147 void *ny_image,
00148 void *pz_image,
00149 void *nz_image,
00150 ExternalFormatEnum format,
00151 TypeEnum type,
00152 unsigned int size,
00153 bool border = false);
00154
00168 void getImage(void *&px_image,
00169 void *&nx_image,
00170 void *&py_image,
00171 void *&ny_image,
00172 void *&pz_image,
00173 void *&nz_image,
00174 ExternalFormatEnum &format,
00175 TypeEnum &type,
00176 unsigned int &size,
00177 bool &border) const;
00178
00182 bool setMipmapLevels(const vector<void *> &) { return false; }
00183
00187 inline unsigned int getSize() const { return m_size; }
00188
00192 virtual unsigned int getIdealInternalSize() const;
00197 virtual unsigned int getLikelyInternalSize() const;
00198
00204 void setWrapMode(WrapEnum s_repeat_flag, WrapEnum t_repeat_flag);
00205
00212 void getWrapMode(WrapEnum &s_repeat_flag, WrapEnum &t_repeat_flag) const;
00213
00219 void setMaxAnisotropy(float max);
00221 float getMaxAnisotropy() const { return m_max_anisotropy; }
00222
00226 static float getMaxSupportedMaxAnisotropy()
00227 { return sgl::s_max_texture_max_anisotropy; }
00228
00234 virtual bool checkProxy();
00235
00241 virtual void bind();
00242
00243 virtual bool replaceImage(void *, GLint) { return false; }
00244 virtual bool buildMipmaps(vector<void*> &) { return false; }
00245
00246 private:
00247 sglTextureCubeMap(const sglTextureCubeMap&);
00248 sglTextureCubeMap& operator=(const sglTextureCubeMap &);
00249
00250
00251 unsigned int getNumTexels() const;
00252
00253 private:
00254 void *m_images[6];
00255
00256 unsigned int m_size;
00257 GLint m_repeat_flag[2];
00258 float m_max_anisotropy;
00259 GLint m_power;
00260 };
00261
00262 #endif