Flint Engine
Modular C++20 2D game engine powered by SDL3
Loading...
Searching...
No Matches
Flint::IGPUContext Class Referenceabstract

Interface that exposes low-level SDL GPU objects from a window implementation. More...

#include <flint/graphics/gpu/gpu-context.h>

+ Inheritance diagram for Flint::IGPUContext:
+ Collaboration diagram for Flint::IGPUContext:

Public Member Functions

virtual void setGPUDevice (SDL_GPUDevice *device)=0
 Store the SDL GPU device created by the renderer.
 
virtual SDL_GPUDevice * getGPUDevice ()=0
 Return the SDL GPU device associated with this context.
 
virtual SDL_GPUCommandBuffer * getCommandBuffer ()=0
 Return the current frame's command buffer.
 
virtual SDL_GPURenderPass * getRenderPass ()=0
 Return the current frame's render pass.
 

Detailed Description

Interface that exposes low-level SDL GPU objects from a window implementation.

SdlWindow implements both IWindow and IGPUContext, allowing the renderer to obtain the GPU device, command buffer, and render pass without depending on a concrete window type.

Definition at line 14 of file gpu-context.h.

Member Function Documentation

◆ getCommandBuffer()

virtual SDL_GPUCommandBuffer * Flint::IGPUContext::getCommandBuffer ( )
pure virtual

Return the current frame's command buffer.

Valid only between GPURenderer::beginFrame() and endFrame().

Returns
Non-owning pointer to the command buffer.

Implemented in Flint::SdlWindow.

◆ getGPUDevice()

virtual SDL_GPUDevice * Flint::IGPUContext::getGPUDevice ( )
pure virtual

Return the SDL GPU device associated with this context.

Returns
Non-owning pointer to the device, or nullptr if not yet set.

Implemented in Flint::SdlWindow.

◆ getRenderPass()

virtual SDL_GPURenderPass * Flint::IGPUContext::getRenderPass ( )
pure virtual

Return the current frame's render pass.

Valid only while a render pass is active.

Returns
Non-owning pointer to the render pass.

Implemented in Flint::SdlWindow.

◆ setGPUDevice()

virtual void Flint::IGPUContext::setGPUDevice ( SDL_GPUDevice * device)
pure virtual

Store the SDL GPU device created by the renderer.

Parameters
deviceOwning SDL_GPUDevice pointer.

Implemented in Flint::SdlWindow.


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