Stellarium
24.3
|
Base texture class. More...
#include <StelTexture.hpp>
Data Structures | |
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. | |
bool | bind (uint 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. | |
bool | getDimensions (int &width, int &height) |
Return the width and height of the texture in pixels. | |
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. | |
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. | |
const QString & | getFullPath () const |
Return the full path to the image file. More... | |
bool | isLoading () const |
Return whether the image is currently being loaded. | |
unsigned int | getGlSize () const |
Return texture memory size. | |
Friends | |
class | StelTextureMgr |
Base texture class.
For creating an instance, use StelTextureMgr::createTexture() and StelTextureMgr::createTextureThread()
bool StelTexture::bind | ( | uint | 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 |
Get the error message which caused the texture loading to fail.
|
inline |
Return the full path to the image file.
If the texture was downloaded from a remote location, this function return the full URL.
|
signal |
Emitted when the texture is ready to be bind(), i.e.
when downloaded, imageLoading and glLoading is over or when an error occurred 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 occurred 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)
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.