![]() |
Stellarium
0.16.1
|
Base texture class. More...
#include <StelTexture.hpp>
Classes | |
struct | StelTextureParams |
Contains the parameters defining how a texture is created. More... | |
Signals | |
void | loadingProcessFinished (bool error) |
Emitted when the texture is ready to be bind(), i.e. More... | |
Public Member Functions | |
virtual | ~StelTexture () |
Destructor. More... | |
bool | bind (int slot=0) |
Bind the texture so that it can be used for openGL drawing (calls glBindTexture). More... | |
void | release () const |
Releases the currently bound texture without testing if it is currently bound, i.e. More... | |
void | waitForLoaded () |
Waits until the texture data is ready for usage (i.e. More... | |
bool | canBind () const |
Return whether the texture can be binded, i.e. it is fully loaded. More... | |
bool | getDimensions (int &width, int &height) |
Return the width and heigth of the texture in pixels. More... | |
bool | hasAlphaChannel () const |
Returns whether the texture has an alpha channel (GL_RGBA or GL_LUMINANCE_ALPHA format) This only returns valid information after the texture is fully loaded. More... | |
const QString & | getErrorMessage () const |
Get the error message which caused the texture loading to fail. More... | |
bool | hasError () const |
Returns true if a loading error occurred. More... | |
const QString & | getFullPath () const |
Return the full path to the image file. More... | |
bool | isLoading () const |
Return whether the image is currently being loaded. More... | |
unsigned int | getGlSize () const |
Return texture memory size. More... | |
Friends | |
class | StelTextureMgr |
Base texture class.
For creating an instance, use StelTextureMgr::createTexture() and StelTextureMgr::createTextureThread()
Definition at line 41 of file StelTexture.hpp.
|
virtual |
Destructor.
bool StelTexture::bind | ( | int | slot = 0 | ) |
Bind the texture so that it can be used for openGL drawing (calls glBindTexture).
If the texture is lazyly loaded, this starts the loading and return false immediately.
|
inline |
Return whether the texture can be binded, i.e. it is fully loaded.
Definition at line 81 of file StelTexture.hpp.
bool StelTexture::getDimensions | ( | int & | width, |
int & | height | ||
) |
Return the width and heigth of the texture in pixels.
|
inline |
Get the error message which caused the texture loading to fail.
Definition at line 92 of file StelTexture.hpp.
|
inline |
Return the full path to the image file.
If the texture was downloaded from a remote location, this function return the full URL.
Definition at line 99 of file StelTexture.hpp.
|
inline |
Return texture memory size.
Definition at line 105 of file StelTexture.hpp.
|
inline |
Returns whether the texture has an alpha channel (GL_RGBA or GL_LUMINANCE_ALPHA format) This only returns valid information after the texture is fully loaded.
Definition at line 88 of file StelTexture.hpp.
|
inline |
Returns true if a loading error occurred.
Definition at line 95 of file StelTexture.hpp.
|
inline |
Return whether the image is currently being loaded.
Definition at line 102 of file StelTexture.hpp.
|
signal |
Emitted when the texture is ready to be bind(), i.e.
when downloaded, imageLoading and glLoading is over or when an error occured and the texture will never be available In case of error, you can query what the problem was by calling getErrorMessage()
error | is equal to true if an error occured while loading the texture |
|
inline |
Releases the currently bound texture without testing if it is currently bound, i.e.
it simply calls glBindTexture(GL_TEXTURE_2D, 0)
Definition at line 74 of file StelTexture.hpp.
void StelTexture::waitForLoaded | ( | ) |
Waits until the texture data is ready for usage (i.e.
bind will return true after this). Do not use this for potentially network loaded textures.