Qt 5.7 | Qt 3D | C++ Classes | QForwardRenderer

Qt 5.7.1 Reference Documentation

# QForwardRenderer Class

(Qt3DExtras::QForwardRenderer)

The QForwardRenderer provides a default FrameGraph implementation of a forward renderer. More...

Header: | #include <QForwardRenderer>
qmake: | QT += 3dextras
Since: | Qt 5.7
Instantiated By: | ForwardRenderer
Inherits: | Qt3DRender::QTechniqueFilter

- List of all members, including inherited members

## Properties

- camera : Qt3DCore::QEntity *
- clearColor : QColor
- surface : QObject *
- viewportRect : QRectF

- 2 properties inherited from Qt3DCore::QNode

## Public Functions

| QForwardRenderer(Qt3DCore::QNode *parent = nullptr)
| ~QForwardRenderer()
Qt3DCore::QEntity * | camera() const
QColor | clearColor() const
QObject * | surface() const
QRectF | viewportRect() const

- 6 public functions inherited from Qt3DRender::QTechniqueFilter
- 1 public function inherited from Qt3DRender::QFrameGraphNode
- 6 public functions inherited from Qt3DCore::QNode

## Public Slots

void | setCamera(Qt3DCore::QEntity *camera)
void | setClearColor(const QColor &clearColor)
void | setSurface(QObject *surface)
void | setViewportRect(const QRectF &viewportRect)

- 2 public slots inherited from Qt3DCore::QNode

## Signals

void | cameraChanged(Qt3DCore::QEntity *camera)
void | clearColorChanged(const QColor &clearColor)
void | surfaceChanged(QObject *surface)
void | viewportRectChanged(const QRectF &viewportRect)

- 3 signals inherited from Qt3DCore::QNode

### Additional Inherited Members

- 2 protected functions inherited from Qt3DCore::QNode

## Detailed Description

The QForwardRenderer provides a default FrameGraph implementation of a forward renderer.

Forward rendering is what OpenGL traditionally uses. It renders directly to the backbuffer one object at a time shading each one as it goes.

QForwardRenderer is a single leaf FrameGraph tree which contains a Qt3DRender::QViewport, a Qt3DRender::QCameraSelector, and a Qt3DRender::QClearBuffers. The QForwardRenderer has a default requirement filter key whose name is "renderingStyle" and value "forward". If you need to filter out your techniques, you should do so based on that filter key.

By default the viewport occupies the whole screen and the clear color is white. Frustum culling is also enabled.

## Property Documentation

### camera : Qt3DCore::QEntity *

Holds the current camera entity used to render the scene.

Note: A camera is a QEntity that has a QCameraLens as one of its components.

Access functions:

Qt3DCore::QEntity * | camera() const
void | setCamera(Qt3DCore::QEntity *camera)

Notifier signal:

void | cameraChanged(Qt3DCore::QEntity *camera)

### clearColor : QColor

Holds the current clear color of the scene. The frame buffer is initialized to the clear color before rendering.

Access functions:

QColor | clearColor() const
void | setClearColor(const QColor &clearColor)

Notifier signal:

void | clearColorChanged(const QColor &clearColor)

### surface : QObject *

Holds the current render surface.

Access functions:

QObject * | surface() const
void | setSurface(QObject *surface)

Notifier signal:

void | surfaceChanged(QObject *surface)

### viewportRect : QRectF

Holds the current normalized viewport rectangle.

Access functions:

QRectF | viewportRect() const
void | setViewportRect(const QRectF &viewportRect)

Notifier signal:

void | viewportRectChanged(const QRectF &viewportRect)

## Member Function Documentation

### QForwardRenderer::QForwardRenderer(Qt3DCore::QNode *parent = nullptr)

Default constructs an instance of QForwardRenderer.

### QForwardRenderer::~QForwardRenderer()

Destroys the instance of QForwardRenderer.