vkmEngine 1.0.0
A C++ game engine · vkmengine.com
Loading...
Searching...
No Matches
Vkm::Engine::RenderSystem Class Reference

The engine's entry point into rendering. More...

#include <render_system.h>

Inheritance diagram for Vkm::Engine::RenderSystem:
Vkm::Engine::System

Public Member Functions

void update (FrameContext &ctx) override
 Run one frame of rendering.
void setBackend (std::unique_ptr< RenderBackend > backend, WindowManager &window)
 Bring a backend up against the window and draw through it.
void releaseUploadedPixels (bool release)
 Free each texture's CPU pixels once the backend holds them.
BackendInfo backendInfo () const
 Identity of the active backend, for status displays.
uint32_t maxAnisotropy () const
 The active backend's anisotropic-filtering ceiling.
RenderBackend * backend () const
 The active backend, or nullptr before setBackend().
Public Member Functions inherited from Vkm::Engine::System
virtual bool isReplayed () const
 Whether this system may be re-run over a tick that already happened.
virtual void init (FrameContext &ctx)
 Called once after all systems are registered, before the first update.
virtual void shutdown ()
 Called once on engine shutdown.
virtual void fixedUpdate (FrameContext &ctx)
 Execute this system at the fixed simulation rate.

Detailed Description

The engine's entry point into rendering.

Runs after Visibility, whose product it draws. Builds the RenderView each frame and hands it to the backend it owns; nothing here is API-specific.

Member Function Documentation

◆ update()

void Vkm::Engine::RenderSystem::update ( FrameContext & ctx)
overridevirtual

Run one frame of rendering.

A no-op with no backend. Writes any screenshot requested via WindowManager::saveScreenshot.

Parameters
ctxThe frame: its scene, Visibility product and window.

Reimplemented from Vkm::Engine::System.

◆ setBackend()

void Vkm::Engine::RenderSystem::setBackend ( std::unique_ptr< RenderBackend > backend,
WindowManager & window )

Bring a backend up against the window and draw through it.

Called once, at startup, with the window's API context current. Throws std::runtime_error when init fails, so the host exits rather than run a black window.

Parameters
backendThe backend to install.
windowThe window it draws into.

◆ releaseUploadedPixels()

void Vkm::Engine::RenderSystem::releaseUploadedPixels ( bool release)
inline

Free each texture's CPU pixels once the backend holds them.

For a host that never reads pixels after upload (a cooking host keeps them). After each frame, textures the backend holdsPixels for are released; params stay.

Parameters
releaseWhether to release them.

◆ backendInfo()

BackendInfo Vkm::Engine::RenderSystem::backendInfo ( ) const
inline

Identity of the active backend, for status displays.

Returns
Empty strings until one is installed.

◆ maxAnisotropy()

uint32_t Vkm::Engine::RenderSystem::maxAnisotropy ( ) const
inline

The active backend's anisotropic-filtering ceiling.

Returns
Maximum degree; 1 with no backend or no support.

◆ backend()

RenderBackend * Vkm::Engine::RenderSystem::backend ( ) const
inline

The active backend, or nullptr before setBackend().

Returns
The backend (non-owning), or nullptr.

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