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

StelQGL2Renderer Class Reference

Renderer backend using OpenGL 2.1 or GLSL 2.0 with Qt. More...

#include <StelQGL2Renderer.hpp>

List of all members.

Public Member Functions

 StelQGL2Renderer (QGraphicsView *parent, bool pvrSupported)
 Construct a StelQGL2Renderer.
virtual bool init ()
 Initialize the renderer.
virtual bool areFloatTexturesSupported () const
 Returns true if floating point textures are supported, false otherwise.
virtual bool areNonPowerOfTwoTexturesSupported () const
 Returns true if non-power-of-two textures are supported, false otherwise.
virtual StelGLSLShadercreateGLSLShader ()
 Create a GLSL shader.
virtual bool isGLSLSupported () const
 Are GLSL shaders supported?
StelQGLGLSLShadergetShader (const StelVertexAttribute *const attributes, const int attributeCount)
 Get shader corresponding to specified vertex format.
void bindCustomShader (StelQGLGLSLShader *shader)
 Use a custom shader program, overriding builtin shader programs.
void releaseCustomShader (StelQGLGLSLShader *shader)
 Release a custom shader program, allowing use of builtin shader programs.

Protected Member Functions

virtual StelVertexBufferBackendcreateVertexBufferBackend (const PrimitiveType primitiveType, const QVector< StelVertexAttribute > &attributes)
 Create a vertex buffer backend.
virtual void drawVertexBufferBackend (StelVertexBufferBackend *vertexBuffer, StelIndexBuffer *indexBuffer=NULL, StelProjector *projector=NULL, bool dontProject=false)
 Draw contents of a vertex buffer (backend).
virtual int getTextureUnitCountBackend ()
 Return the number of texture units (implementation).
virtual void invariant () const
 Asserts that we're in a valid state.

Detailed Description

Renderer backend using OpenGL 2.1 or GLSL 2.0 with Qt.

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

Definition at line 40 of file StelQGL2Renderer.hpp.


Constructor & Destructor Documentation

StelQGL2Renderer::StelQGL2Renderer ( QGraphicsView *  parent,
bool  pvrSupported 
) [inline]

Construct a StelQGL2Renderer.

Parameters:
parent Parent widget for the renderer's GL widget.
pvrSupported Are .pvr (PVRTC - PowerVR hardware) textures supported on this platform? This should be true for mobile platforms with PowerVR GPUs.

Definition at line 42 of file StelQGL2Renderer.hpp.


Member Function Documentation

virtual bool StelQGL2Renderer::areFloatTexturesSupported (  )  const [inline, virtual]

Returns true if floating point textures are supported, false otherwise.

Implements StelRenderer.

Definition at line 281 of file StelQGL2Renderer.hpp.

virtual bool StelQGL2Renderer::areNonPowerOfTwoTexturesSupported (  )  const [inline, virtual]

Returns true if non-power-of-two textures are supported, false otherwise.

Implements StelQGLRenderer.

Definition at line 287 of file StelQGL2Renderer.hpp.

void StelQGL2Renderer::bindCustomShader ( StelQGLGLSLShader shader  )  [inline]

Use a custom shader program, overriding builtin shader programs.

This can only be called when no custom shader is bound already (any previously bound custom shader must be released).

Used by StelQGLGLSLShader.

Parameters:
shader Shader to use.

Definition at line 361 of file StelQGL2Renderer.hpp.

virtual StelGLSLShader* StelQGL2Renderer::createGLSLShader (  )  [inline, virtual]

Create a GLSL shader.

This can only be called if isGLSLSupported() is true.

The constructed shader must be deleted before the StelRenderer is destroyed.

Reimplemented from StelRenderer.

Definition at line 289 of file StelQGL2Renderer.hpp.

virtual StelVertexBufferBackend* StelQGL2Renderer::createVertexBufferBackend ( const PrimitiveType  primitiveType,
const QVector< StelVertexAttribute > &  attributes 
) [inline, protected, virtual]

Create a vertex buffer backend.

Used by createVertexBuffer.

This allows each Renderer backend to create its own vertex buffer backend.

Parameters:
primitiveType Graphics primitive type stored in the buffer.
attributes Descriptions of all attributes of the vertex type stored in the buffer.
Returns:
Pointer to a vertex buffer backend specific to the Renderer backend.

Implements StelRenderer.

Definition at line 389 of file StelQGL2Renderer.hpp.

virtual void StelQGL2Renderer::drawVertexBufferBackend ( StelVertexBufferBackend vertexBuffer,
StelIndexBuffer indexBuffer = NULL,
StelProjector projector = NULL,
bool  dontProject = false 
) [inline, protected, virtual]

Draw contents of a vertex buffer (backend).

Used by drawVertexBuffer.

See also:
drawVertexBuffer

Implements StelRenderer.

Definition at line 396 of file StelQGL2Renderer.hpp.

StelQGLGLSLShader* StelQGL2Renderer::getShader ( const StelVertexAttribute *const   attributes,
const int  attributeCount 
) [inline]

Get shader corresponding to specified vertex format.

If the user binds a custom shader (StelGLSLShader, in this case StelQGLGLSLShader), this shader is returned instead. (I.e. custom shader programs override builtin ones.)

Parameters:
attributes Vertex attributes used in the vertex format.
attributeCount Number of vertex attributes.
Returns:
Pointer to the shader.

Definition at line 304 of file StelQGL2Renderer.hpp.

virtual int StelQGL2Renderer::getTextureUnitCountBackend (  )  [inline, protected, virtual]

Return the number of texture units (implementation).

Implements StelQGLRenderer.

Definition at line 511 of file StelQGL2Renderer.hpp.

virtual bool StelQGL2Renderer::init (  )  [inline, virtual]

Initialize the renderer.

Must be called before any other methods.

Returns:
true on success, false if there was an error.

Reimplemented from StelQGLRenderer.

Definition at line 64 of file StelQGL2Renderer.hpp.

virtual void StelQGL2Renderer::invariant (  )  const [inline, protected, virtual]

Asserts that we're in a valid state.

Overriding methods should also call StelQGLRenderer::invariant().

Reimplemented from StelQGLRenderer.

Definition at line 521 of file StelQGL2Renderer.hpp.

virtual bool StelQGL2Renderer::isGLSLSupported (  )  const [inline, virtual]

Are GLSL shaders supported?

Implements StelRenderer.

Definition at line 294 of file StelQGL2Renderer.hpp.

void StelQGL2Renderer::releaseCustomShader ( StelQGLGLSLShader shader  )  [inline]

Release a custom shader program, allowing use of builtin shader programs.

The released shader must match the currently bound one.

Used by StelQGLGLSLShader.

Parameters:
shader Shader assumed to be bound, for error checking.

Definition at line 376 of file StelQGL2Renderer.hpp.


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