Stellarium 0.12.0
Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · Plugins · Renderer · File Structure

StelQGLTextureBackend Class Reference

Texture backend based on QGL, usable with both GL1 and GL2. More...

#include <StelQGLTextureBackend.hpp>

List of all members.

Public Member Functions

 ~StelQGLTextureBackend ()
 Destroy the StelQGLTextureBackend. Must be called before the Renderer is destroyed.
void bind (const int textureUnit)
 Called by QGLRenderer to bind the texture to specified texture unit.
void startAsynchronousLoading ()
 Start asynchrounously loading the texture in a separate thread.

Static Public Member Functions

static StelQGLTextureBackendconstructFromImage (class StelQGLRenderer *renderer, const QString &path, const TextureParams &params, QImage &image)
 Construct a StelQGLTextureBackend from an image.
static StelQGLTextureBackendconstructFromPVR (class StelQGLRenderer *renderer, const QString &path, const TextureParams &params)
 Construct a StelQGLTextureBackend from a PVR (compressed texture on some mobile platforms) file.
static StelQGLTextureBackendconstructAsynchronous (class StelQGLRenderer *renderer, const QString &path, const TextureParams &params)
 Construct a StelQGLTextureBackend asynchronously (in a separate thread).
static StelQGLTextureBackendfromFBO (StelQGLRenderer *renderer, class QGLFramebufferObject *fbo)
 Construct a StelQGLTextureBackend from a framebuffer object.
static StelQGLTextureBackendfromViewport (StelQGLRenderer *renderer, const QSize viewportSize, const QGLFormat &viewportFormat)
 Construct a StelQGLTextureBackend from the viewport.
static StelQGLTextureBackendfromRawData (StelQGLRenderer *renderer, const void *data, const QSize size, const TextureDataFormat format, const TextureParams &params)
 Construct a texture from raw data.

Detailed Description

Texture backend based on QGL, usable with both GL1 and GL2.

Note:
This is an internal class of the Renderer subsystem and should not be used elsewhere.

Definition at line 31 of file StelQGLTextureBackend.hpp.


Constructor & Destructor Documentation

StelQGLTextureBackend::~StelQGLTextureBackend (  ) 

Destroy the StelQGLTextureBackend. Must be called before the Renderer is destroyed.


Member Function Documentation

void StelQGLTextureBackend::bind ( const int  textureUnit  ) 

Called by QGLRenderer to bind the texture to specified texture unit.

static StelQGLTextureBackend* StelQGLTextureBackend::constructAsynchronous ( class StelQGLRenderer renderer,
const QString &  path,
const TextureParams params 
) [static]

Construct a StelQGLTextureBackend asynchronously (in a separate thread).

Will return a StelQGLTextureBackend in Uninitialized state - if not lazy loading, caller must start loading themselves.

Parameters:
renderer Renderer this texture belongs to.
path Full path of image file in the file system (or a URL pointing to the image).
params Texture parameters (e.g. filtering, wrapping, etc.).
Returns:
Pointer to the new StelQGLTextureBackend.
static StelQGLTextureBackend* StelQGLTextureBackend::constructFromImage ( class StelQGLRenderer renderer,
const QString &  path,
const TextureParams params,
QImage &  image 
) [static]

Construct a StelQGLTextureBackend from an image.

Parameters:
renderer Renderer this texture belongs to.
path Full path of the image file in the filesystem.
params Texture parameters (e.g. filtering, wrapping, etc.).
image Image to load from.
Returns:
Pointer to the new StelQGLTextureBackend.
static StelQGLTextureBackend* StelQGLTextureBackend::constructFromPVR ( class StelQGLRenderer renderer,
const QString &  path,
const TextureParams params 
) [static]

Construct a StelQGLTextureBackend from a PVR (compressed texture on some mobile platforms) file.

This includes loading the texture from file, which might fail if the file does not exist, creating a texture with Error status.

Parameters:
renderer Renderer this texture belongs to.
path Full path of the PVR image file in the filesystem.
params Texture parameters (e.g. filtering, wrapping, etc.).
Returns:
Pointer to the new StelQGLTextureBackend.
static StelQGLTextureBackend* StelQGLTextureBackend::fromFBO ( StelQGLRenderer renderer,
class QGLFramebufferObject *  fbo 
) [static]

Construct a StelQGLTextureBackend from a framebuffer object.

This will simply wrap a texture of a framebuffer object in a StelQGLTextureBackend and return it. The texture itself will still be owned by the framebuffer object, and destroyed with the framebuffer objects, not with the StelQGLTextureBackend.

Parameters:
renderer Renderer this texture belongs to.
fbo Framebuffer object to get the texture from.
Returns:
Pointer to the new StelQGLTextureBackend.
static StelQGLTextureBackend* StelQGLTextureBackend::fromRawData ( StelQGLRenderer renderer,
const void *  data,
const QSize  size,
const TextureDataFormat  format,
const TextureParams params 
) [static]

Construct a texture from raw data.

Used to create textures from data Qt does not support, e.g. floating point textures.

Parameters:
renderer Renderer this texture belongs to.
data Pointer to the texture data.
size Texture size in pixels.
format Format of texture pixels stored in data.
params Texture parameters (e.g. filtering, wrapping, etc.)
static StelQGLTextureBackend* StelQGLTextureBackend::fromViewport ( StelQGLRenderer renderer,
const QSize  viewportSize,
const QGLFormat &  viewportFormat 
) [static]

Construct a StelQGLTextureBackend from the viewport.

Used to get a texture of the viewport. The returned texture will be power-of-two containing the image data in area matching viewport size.

Note:
This only works when FBOs are not used. When using FBOs, use fromFBO on the front buffer instead.
Parameters:
renderer Renderer this texture belongs to.
viewportSize Size of the viewport in pixels.
viewportFormat Pixel format of the viewport.
Returns:
Pointer to the new StelQGLTextureBackend.
void StelQGLTextureBackend::startAsynchronousLoading (  ) 

Start asynchrounously loading the texture in a separate thread.

Can only be called on a StelQGLTextureBackend returned by constructAsynchronous.

Changes status from Uninitialized to Loading.


The documentation for this class was generated from the following file:
Generated on Thu Jan 31 14:05:46 2013 for Stellarium by  doxygen 1.6.3