Stellarium 0.15.2
|
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... | |
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... | |
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 74 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 85 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 89 of file StelTexture.hpp.
|
inline |
Return texture memory size.
Definition at line 95 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 81 of file StelTexture.hpp.
|
inline |
Return whether the image is currently being loaded.
Definition at line 92 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 |