Class GPUManager

Class Documentation

class GPUManager

The centralized GPU interaction system.

Warning

Wild usage of this system is not recommended since you will end up fighting with the world renderer. For this reason, you should only access this interface during the pre- and post-render hooks in the FrameProcessor (not yet implemented).

Public Functions

void Start()

Start the GPU manager.

Throws:
  • BadInitStateException – If the GPU manager is already running

  • BadInitStateException – If the thread pool is not running

  • BadStateException – If the graphics backend and window are not connected

void Stop()

Stop the GPU manager.

Throws:

BadInitStateException – If the GPU manager is not running

inline bool IsRunning() const

Check if the GPU manager is running.

Returns:

Whether the GPU manager is running

std::shared_future<void> Submit(CommandBuffer &&cmd)

Submit a task to the GPU for processing.

Parameters:

cmd – The CommandBuffer containing the task to execute

Returns:

A future that will resolve when the task has finished executing

void SetVSync(bool newState)

Set the V-Sync state.

Parameters:

newState – Whether V-Sync should be enabled

Throws:

BadInitStateException – If the GPU manager is not running

Public Static Functions

static GPUManager &Get()

Get the instance and create one if there isn’t one.

Returns:

The instance