Graphics::IRenderer class

This class manages the rendering process in the game.

It can be used to add IRenderable objects to the render queue. When added, an index in the queue must be specified; this index is important since defines at which moment the object is rendered. The minimum index is defined as Graphics::kRenderQueueMain; lower indices are used to render the user interface and might cause problems.

//TODO Real name: Renderer

Public types

struct cLayerInfo

Public static functions

static auto Get() -> IRenderer*
Gets the active renderer.

Constructors, destructors, conversion operators

~IRenderer() pure virtual

Public functions

auto AddRef() -> int pure virtual
auto Release() -> int pure virtual
auto Initialize() -> bool pure virtual
auto Dispose() -> bool pure virtual
auto Start(int windowWidth, int windowHeight, bool, int) -> bool pure virtual
auto Flip(bool, int, int, int) -> void pure virtual
auto GetScreenInfo() -> cScreenInfo& pure virtual
auto GetNumDisplays() -> int pure virtual
auto func24h() -> void* pure virtual
auto func28h(int adapter) -> int pure virtual
auto SetViewer(int viewerType, App::cViewer* viewer) -> void pure virtual
auto GetViewer(int viewerType) -> App::cViewer* pure virtual
auto Update(int) -> void pure virtual
auto func38h(bool) -> void pure virtual
auto Render(int) -> void pure virtual
auto SubRender(const RenderStatistics& stats, int startLayer, int endLayer, App::cViewer** viewers, bool, int flags) -> void pure virtual
auto func44h() -> int pure virtual
auto GetRenderStats() -> RenderStatistics pure virtual
auto RegisterLayer(ILayer* layer, int layerIndex, int flags = 0) -> void pure virtual
Adds an ILayer object to the specified layer index; the same renderable can be assigned to multiple layers.
auto RegisterLayer(LambdaLayer::Render_t renderFunction, int layerIndex, int flags = 0) -> void
Adds a renderable function to the specified layer index; the same renderable can be assigned to multiple layers.
auto UnregisterLayer(int layerIndex) -> bool pure virtual
Removes the IRenderable object assigned to the specified layer index.
auto ClearAllLayers() -> void pure virtual
Removes all renderables from the manager.
auto Layer(int layerIndex) -> ILayer* pure virtual
Returns the renderable assigned to the given layer, or nullptr if there is none.
auto SetInfoFlags(int layerIndex, int flags) -> int pure virtual
auto ClearInfoFlags(int layerIndex, int flags) -> int pure virtual
auto InfoFlags(int layerIndex) -> int pure virtual
auto NumLayers() const -> int pure virtual
auto LayerAtIndex(int index) -> ILayer* pure virtual
auto LayerInfoAtIndex(int index) -> cLayerInfo& pure virtual
auto AddPostRenderJob(ILayer* layer, int arg = 0, const cRenderJobInfo& jobInfo = cRenderJobInfo()) -> uint32_t pure virtual
Creates a job that renders the given layer after all layers have been rendered.
auto AddPreRenderJob(ILayer* layer, int arg = 0, const cRenderJobInfo& jobInfo = cRenderJobInfo()) -> uint32_t pure virtual
Creates a job that renders the given layer before any layers have been rendered.
auto RemovePreRenderJob(uint32_t jobID) -> void pure virtual
auto RemovePostRenderJob(uint32_t jobID) -> void pure virtual
auto BoostRenderJobBudget(int budget) -> void pure virtual
auto func88h() -> void pure virtual
auto func8Ch() -> void pure virtual

Function documentation

void Graphics::IRenderer::RegisterLayer(ILayer* layer, int layerIndex, int flags = 0) pure virtual

Adds an ILayer object to the specified layer index; the same renderable can be assigned to multiple layers.

Parameters
layer Pointer to the renderable layer object
layerIndex The index of the layer the given object renders.
flags

If there already was a renderable there, it will get removed.

void Graphics::IRenderer::RegisterLayer(LambdaLayer::Render_t renderFunction, int layerIndex, int flags = 0)

Adds a renderable function to the specified layer index; the same renderable can be assigned to multiple layers.

Parameters
renderFunction Renderable function, can be a lambdas
layerIndex The index of the layer the given object renders.
flags

If there already was a renderable there, it will get removed.

bool Graphics::IRenderer::UnregisterLayer(int layerIndex) pure virtual

Removes the IRenderable object assigned to the specified layer index.

Parameters
layerIndex

ILayer* Graphics::IRenderer::Layer(int layerIndex) pure virtual

Returns the renderable assigned to the given layer, or nullptr if there is none.

Parameters
layerIndex

uint32_t Graphics::IRenderer::AddPostRenderJob(ILayer* layer, int arg = 0, const cRenderJobInfo& jobInfo = cRenderJobInfo()) pure virtual

Creates a job that renders the given layer after all layers have been rendered.

Parameters
layer
arg
jobInfo
Returns ID of the created job

uint32_t Graphics::IRenderer::AddPreRenderJob(ILayer* layer, int arg = 0, const cRenderJobInfo& jobInfo = cRenderJobInfo()) pure virtual

Creates a job that renders the given layer before any layers have been rendered.

Parameters
layer
arg
jobInfo
Returns ID of the created job