This method never fails, but the texture returned might have the Error status. Even in that case, the texture can be bound, but a placeholder texture will be used internally instead.

Parameters

filename

File name or URL of the image to load the texture from. If it's a file and it's not found, it's searched for in the textures/ directory. Some renderer backends might also support compressed textures with custom file formats. These backend-specific files should not be specified by filename - instead, if a compressed texture with the same file name but different extension exists, it will be used. E.g. the GLES backend prefers a .pvr version of a texture if PVR is supported and it exists.

params

Texture parameters, such as filtering, wrapping, etc.

loadingMode

Texture loading mode to use. Normal immediately loads the texture, Asynchronous starts loading it in a background thread and LazyAsynchronous starts loading it when it's first needed.

Returns

New texture.

Note

Some renderer backends only support textures with power of two dimensions (e.g. 512x512 or 2048x256). On these backends, loading a texture with non-power-of-two dimensions will fail and result in a StelTextureNew with status of TextureStatus_Error.

This method never fails, but the texture returned might have the Error status. Even in that case, the texture can be bound, but a placeholder texture will be used internally instead.

The texture is created immediately, as with TextureLoadingMode_Normal.

Parameters

image

Image to load the texture from.

params

Texture parameters, such as filtering, wrapping, etc.

Returns

New texture.

Note

Some renderer backends only support textures with power of two dimensions (e.g. 512x512 or 2048x256). On these backends, loading a texture with non-power-of-two dimensions will fail and result in a StelTextureNew with status of TextureStatus_Error.

This method never fails, but the texture returned might have the Error status. Even in that case, the texture can be bound, but a placeholder texture will be used internally instead.

The texture is created immediately, as with TextureLoadingMode_Normal.

Parameters

data

Pointer to raw image data. Size of the data must be size.width() * size.height() * pixelSize, where pixelSize is size of a pixel of specified format.

size

Size of the texture in pixels.

format

Format of pixels in data.

params

Texture parameters, such as filtering, wrapping, etc.

Returns

New texture.

Note

Some renderer backends only support textures with power of two dimensions (e.g. 512x512 or 2048x256). On these backends, loading a texture with non-power-of-two dimensions will fail and result in a StelTextureNew with status of TextureStatus_Error.

Index buffer specifying which vertices from the buffer to draw. If NULL, indexing will not be used and vertices will be drawn directly in order they are in the buffer.

projector

Projector to project vertices' positions before drawing. Also determines viewport to draw in. If NULL, no projection will be done and the vertices will be drawn directly.

dontProject

Disable vertex position projection. (Projection matrix and viewport information of the projector are still used) This is a hack to support StelSkyDrawer, which already projects the star positions before drawing them. Avoid using this if possible. StelSkyDrawer might be refactored in future to remove the need for dontProject, in which case it should be removed.

Note

When drawing with a custom StelProjector only 3D vertex positions are supported.

This version takes a StelProjector* instead of StelProjectorP - this is not a problem, as the renderer subsystem doesn't store or delete the projector.

Parameters

vertexBuffer

Vertex buffer to draw.

indexBuffer

Index buffer specifying which vertices from the buffer to draw. If NULL, indexing will not be used and vertices will be drawn directly in order they are in the buffer.

projector

Projector to project vertices' positions before drawing. Also determines viewport to draw in. If NULL, no projection will be done and the vertices will be drawn directly.

dontProject

Disable vertex position projection. (Projection matrix and viewport information of the projector are still used) This is a hack to support StelSkyDrawer, which already projects the star positions before drawing them. Avoid using this if possible. StelSkyDrawer might be refactored in future to remove the need for dontProject, in which case it should be removed.

Note

When drawing with a custom StelProjector only 3D vertex positions are supported.

Get a texture of the viewport, with everything drawn to the viewport so far.

Note

Since some backends only support textures with power of two dimensions, the returned texture might be larger than the viewport in which case only the part of the texture matching viewport size (returned by getViewportSize) will be taken up by the viewport.

Front faces are usually those whose vertices are in counter-clockwise order, but a StelProjector might flip this order after projection. If such a StelProjector is used with StelRenderer::drawVertexBuffer(), front faces will be clock wise. This doesn't affect the user in any way as the projection is done inside renderer.

However, if doing manual projection and sending the already projected vertices for drawing, this order will be flipped, so previously counter-clockwise(front) faces will be clock-wise (back) faces, so if culling is used, opposite face should be used with setCulledFaces().

Depth test is implemented to be as specific as possible, only supporting what Stellarium needs. This might be counterintuitive, as much of the power of OpenGL is removed. However, this makes it easier to implement different Renderer backends that might not necessarily be based on OpenGL.

Stencil test is implemented to be as specific as possible, only supporting what Stellarium needs. This might be counterintuitive, as much of the power of OpenGL is removed. However, this makes it easier to implement different Renderer backends that might not necessarily be based on OpenGL.