Texture backend based on QGL, usable with both GL1 and GL2.
More...
#include <StelQGLTextureBackend.hpp>
|
static StelQGLTextureBackend * | constructFromImage (class StelQGLRenderer *renderer, const QString &path, const TextureParams ¶ms, QImage &image) |
| Construct a StelQGLTextureBackend from an image. More...
|
|
static StelQGLTextureBackend * | constructFromPVR (class StelQGLRenderer *renderer, const QString &path, const TextureParams ¶ms) |
| Construct a StelQGLTextureBackend from a PVR (compressed texture on some mobile platforms) file. More...
|
|
static StelQGLTextureBackend * | constructAsynchronous (class StelQGLRenderer *renderer, const QString &path, const TextureParams ¶ms) |
| Construct a StelQGLTextureBackend asynchronously (in a separate thread). More...
|
|
static StelQGLTextureBackend * | fromFBO (StelQGLRenderer *renderer, class QGLFramebufferObject *fbo) |
| Construct a StelQGLTextureBackend from a framebuffer object. More...
|
|
static StelQGLTextureBackend * | fromViewport (StelQGLRenderer *renderer, const QSize viewportSize, const QGLFormat &viewportFormat) |
| Construct a StelQGLTextureBackend from the viewport. More...
|
|
static StelQGLTextureBackend * | fromRawData (StelQGLRenderer *renderer, const void *data, const QSize size, const TextureDataFormat format, const TextureParams ¶ms) |
| Construct a texture from raw data. More...
|
|
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.
StelQGLTextureBackend::~StelQGLTextureBackend |
( |
| ) |
|
void StelQGLTextureBackend::bind |
( |
const int |
textureUnit | ) |
|
Called by QGLRenderer to bind the texture to specified texture unit.
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.
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.
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.
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.
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.) |
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: