#include <sglTextureCubeMap.hpp>
Inheritance diagram for sglTextureCubeMap::
Public Methods | |
sglTextureCubeMap () | |
virtual | ~sglTextureCubeMap () |
bool | setImage (void *px_image, void *nx_image, void *py_image, void *ny_image, void *pz_image, void *nz_image, ExternalFormatEnum format, TypeEnum type, unsigned int size, bool border=false) |
void | getImage (void *&px_image, void *&nx_image, void *&py_image, void *&ny_image, void *&pz_image, void *&nz_image, ExternalFormatEnum &format, TypeEnum &type, unsigned int &size, bool &border) const |
bool | setMipmapLevels (const vector< void *> &) |
unsigned int | getSize () const |
virtual unsigned int | getIdealInternalSize () const |
virtual unsigned int | getLikelyInternalSize () const |
void | setWrapMode (WrapEnum s_repeat_flag, WrapEnum t_repeat_flag) |
void | getWrapMode (WrapEnum &s_repeat_flag, WrapEnum &t_repeat_flag) const |
void | setMaxAnisotropy (float max) |
float | getMaxAnisotropy () const |
virtual bool | checkProxy () |
virtual void | bind () |
virtual bool | replaceImage (void *, GLint) |
virtual bool | buildMipmaps (vector< void *> &) |
Static Public Methods | |
float | getMaxSupportedMaxAnisotropy () |
positive X (px): z <----+ | right | V y negative X (nx): +----> z | | left V y positive Z (pz): +----> x | | front V y negative Z (pz): x <----+ | back | V y positive Y (py): z ^ | bottom | +----> x negative Y (ny): +----> x | | top V z
Note that all six images must be the same size (square) and have the same type and external format.
Example:
// all six images must be the same size (and square) format and type sglTextureCubeMap *cube_map = new sglTextureCubeMap; if (!cube_map->setImage(image[0], image[1], image[2], image[3], image[4], image[5], format, type, size, false)) { cerr << "Warning: sglTextureCubeMap::setImage() failed" << endl; } sglTexGen *tgen = new sglTexGen; tgen->setMode(sglTexGen::eS, sglTexGen::eREFLECTION_MAP); tgen->setMode(sglTexGen::eT, sglTexGen::eREFLECTION_MAP); tgen->setMode(sglTexGen::eR, sglTexGen::eREFLECTION_MAP); // used to account for view position. tmat = new sglTextureMatrix(NULL); vector<sglStatelet*> state; state.push_back(cube_map); state.push_back(tgen); state.push_back(tmat);
Definition at line 114 of file sglTextureCubeMap.hpp.
|
Default constructor. Creates an empty, invalid texture.
|
|
Virtual destructor.
|
|
Set the six images in the cube map. All must be same square size and in the same format. Note: this will not free the memory from the previous image. Note: this will clear the mipmap levels if not automatic.
|
|
Query the current cube map data. If the valid flag is false the image pointers will be set to NULL.
|
|
Set the mipmap images. This feature is currently disabled for cube maps. Reimplemented from sglTexture. Definition at line 182 of file sglTextureCubeMap.hpp. |
|
Query the current size of the level zero images.
Definition at line 187 of file sglTextureCubeMap.hpp. |
|
Returns the number of bytes of texture memory this texture will use if the requested internal format was honored. Reimplemented from sglTexture. |
|
Returns the number of bytes of texture memory this texture is most likely using. Must be called by a thread with a current rendering context. Reimplemented from sglTexture. |
|
Set whether the texture repeats or is stretched by tex coords > 1.
|
|
Query the current texture wrap mode.
|
|
Get/set the maximum degree of anisotropy to account for in texture filtering (if supported). A value of 1.0f disables anisotropic filtering. default: 1.0f Reimplemented from sglTexture. |
|
Get the maximum max-anisotropy supported on this system. Returns 1.0f if anisotropic filtering is not supported. Reimplemented from sglTexture. Definition at line 226 of file sglTextureCubeMap.hpp. |
|
Use the GL_PROXY_TEXTURE_CUBE_MAP_ARB mechanism to check if the texture is capable of being loaded into texture memory. Returns false if the texture is too large. Must be called by a thread with a current rendering context. Reimplemented from sglTexture. |
|
Copy texture (and changes) into texture memory. If (getAutoBind() == false), this method must be called before before the texture can be applied. Must be called by a thread with a current rendering context. Reimplemented from sglTexture. |
|
Helper function to replace an entire image via subtexload funtionality. A previous image must first have been set with the setImage or setMipmapLevels methods. The new_image data must be the same size as the original image, and the pointer to the old image data is lost. The level parameter specifies which mipmap level to replace. Reimplemented from sglTexture. Definition at line 243 of file sglTextureCubeMap.hpp. |
|
Generates a set of mipmaps from the level 0 image in this texture. Existing images in the given mipmaps vector will be resized (via realloc) and excess images will be free()'d. Returns false if the mipmaps could not be built. Reimplemented from sglTexture. Definition at line 244 of file sglTextureCubeMap.hpp. |