Sceneview
 All Classes Functions Variables Enumerations Enumerator Groups Pages
Public Member Functions | List of all members
sv::GridRenderer Class Reference

A stock renderer provided as a basic utility and an example. More...

#include <sceneview/grid_renderer.hpp>

Inheritance diagram for sv::GridRenderer:
sv::Renderer

Public Member Functions

 GridRenderer (const QString &name, QObject *parent=0)
 
void InitializeGL () override
 Override to acquire OpenGL resources required by the Renderer. More...
 
void RenderBegin () override
 Called at the start of rendering, just before the scene is rendered. More...
 
- Public Member Functions inherited from sv::Renderer
 Renderer (const QString &name, QObject *parent=0)
 Construct a new renderer with the specified name.
 
 Renderer (const Renderer &)=delete
 
Rendereroperator= (const Renderer &)=delete
 
const QString & Name () const
 Retrieve the renderer name.
 
ViewportGetViewport ()
 Retrieve the viewport that manages this renderer.
 
Scene::Ptr GetScene ()
 Retrieve the Scene graph used by the Sceneview rendering engine.
 
ResourceManager::Ptr GetResources ()
 Retrieve the ResourceManager for the scene.
 
GroupNodeGetBaseNode ()
 Retrieve the group node assigned to this renderer. More...
 
virtual void RenderEnd ()
 Called at the end of rendering, just after the scene has finished rendering. More...
 
virtual void ShutdownGL ()
 Override this to release any OpenGL resources acquired by the renderer. More...
 
virtual QWidget * GetWidget ()
 Override this to provide a custom UI for your renderer.
 
bool Enabled () const
 
virtual QVariant SaveState ()
 Called by the viewport to save the renderer state. More...
 
virtual void LoadState (const QVariant &val)
 Called by the viewport to restore the renderer state. More...
 

Additional Inherited Members

- Public Slots inherited from sv::Renderer
void SetEnabled (bool enabled)
 
- Signals inherited from sv::Renderer
void EnableChanged (bool enabled)
 
- Protected Member Functions inherited from sv::Renderer
virtual void OnEnableChanged (bool enabled)
 

Detailed Description

A stock renderer provided as a basic utility and an example.

Draws a grid in the scene.

Member Function Documentation

void sv::GridRenderer::InitializeGL ( )
overridevirtual

Override to acquire OpenGL resources required by the Renderer.

At the time this method is invoked, the following are true:

  • The OpenGL context is active.
  • The Renderer has a base node.

It is guaranteed that this method will be called exactly once, and before any call to RenderBegin().

Reimplemented from sv::Renderer.

void sv::GridRenderer::RenderBegin ( )
overridevirtual

Called at the start of rendering, just before the scene is rendered.

When this method is called, the following are true:

  • No shader programs are active (i.e., glUseProgram(0) has been called)
  • The projection matrix (GL_PROJECTION) is setup according to the active camera.
  • The modelview matrix stack has a single matrix on it that correspnods to the camera view matrix.
  • The GL_MODELVIEW matrix stack is active.
  • OpenGL lights have been configured according to the lights in the scene graph.

In other words, the matrix stack is setup such that you can render in "world" coordinates.

You can issue legacy fixed-function OpenGL commands (e.g., glColor3f(), glBegin(), glVertex3f(), etc. calls)

You can also use your own vertex and fragment shaders.

Reimplemented from sv::Renderer.


The documentation for this class was generated from the following file: