Stellarium 0.11.2
Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · Plugins · File Structure
Classes | Signals | Public Member Functions
StelTexture Class Reference

Base texture class. More...

#include <StelTexture.hpp>

List of all members.


struct  StelTextureParams
 Contains the parameters defining how a texture is created. More...


void loadingProcessFinished (bool error)

Public Member Functions

virtual ~StelTexture ()
bool bind ()
bool canBind () const
bool getDimensions (int &width, int &height)
const QString & getErrorMessage () const
const QString & getFullPath () const
bool isLoading () const
bool glLoad ()

Detailed Description

Base texture class.

For creating an instance, use StelTextureMgr::createTexture() and StelTextureMgr::createTextureThread()

See also:

Member Function Documentation

bool StelTexture::bind ( )

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.

true if the binding successfully occured, false if the texture is not yet loaded.
const QString& StelTexture::getErrorMessage ( ) const [inline]

Get the error message which caused the texture loading to fail.

the human friendly error message or empty string if no errors occured
const QString& StelTexture::getFullPath ( ) const [inline]

Return the full path to the image file.

If the texture was downloaded from a remote location, this function return the full URL.

bool StelTexture::glLoad ( )

Load the texture already in the RAM to the openGL memory This function uses openGL routines and must be called in the main thread.

false if an error occured
void StelTexture::loadingProcessFinished ( bool  error) [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()

erroris equal to true if an error occured while loading the texture