Base class anything that renders a scene.
#include <Rendering/SceneComponents/scenerenderer.h>
◆ getContext()
◆ getTypeId()
◆ renderOverlays()
void renderOverlays |
( |
QPainter & |
painter, |
|
|
Scene & |
scene, |
|
|
const Camera & |
camera |
|
) |
| |
|
static |
- Parameters
-
painter | The QPainter with which to draw the image overlays. |
scene | The scene whose image overlays are to be drawn. |
camera | The camera that was used to render the scene. This will be used to decide whether or not to show any camera-specific overlays. |
This is a convenience function which draws each of the image overlays in scene using the specified painter. Because of implementation details and bugs in Qt, the painting is done using drawTiledPixmap() which can only be called from the main thread. To handle this, drawOverlays() blocks the calling thread and performs the drawing actions in the main thread instead. Once the drawing is done, then drawOverlays() will unblock and return. For most scenarios, this is safe unless the main thread tries to do something which would result in thread lock (eg calling a function which somehow leads to a blocking wait on the drawOverlays() calling thread). Such behavior is not generally advisable, since it would potentially lock up the main thread under other scenarios, so we consider this an acceptable risk. See the documentation for the BlockingTask class for more details.
◆ renderOverlaysUnthreaded()
bool renderOverlaysUnthreaded |
( |
QPainter & |
painter, |
|
|
Scene & |
scene, |
|
|
const Camera & |
camera |
|
) |
| |
|
static |