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

SDL3 window implementation that also exposes the SDL GPU context. More...

#include <flint/window/sdl-window.h>

+ Inheritance diagram for Flint::SdlWindow:
+ Collaboration diagram for Flint::SdlWindow:

Public Member Functions

 SdlWindow (const ApplicationConfig &config, GRAPHICS_BACKEND backend)
 Create and show an SDL window.
 
void display () override
 Present the current frame to the screen.
 
bool isOpen () const override
 Return true if the window is open and the application should keep running.
 
void setMouseCursor (CursorType type) override
 Set the mouse cursor shape.
 
void pollEvents (const std::function< void(const AppEvent &)> &handler) override
 Poll all pending OS events and dispatch them to handler.
 
void setTitle (const std::string &name) override
 Set the window title.
 
void close () override
 Signal that the window should close at the end of the current frame.
 
Flint::Vec2i getSize () const override
 Return the current window size in pixels.
 
Flint::Vec2f getMousePosition () const override
 Return the current mouse cursor position in window-space pixels.
 
Flint::Vec2f mapPixelToCoords (Flint::Vec2f pixel) const override
 Pass-through pixel-to-coord mapping (no scaling applied).
 
void addGlobalEventListener (std::function< void(const AppEvent &)> callback) override
 Register a global event listener that receives every polled event.
 
bool hasFocus () const override
 Return true if the window currently has input focus.
 
void * getNativeHandle () const override
 Return the platform-native window handle (e.g. HWND, SDL_Window*).
 
void setGPUDevice (SDL_GPUDevice *device) override
 Store the SDL GPU device created by the renderer (IGPUContext).
 
SDL_GPUDevice * getGPUDevice () override
 Return the SDL GPU device (IGPUContext).
 
SDL_GPUCommandBuffer * getCommandBuffer () override
 Return the current frame's command buffer (IGPUContext).
 
SDL_GPURenderPass * getRenderPass () override
 Return the current frame's render pass (IGPUContext).
 
bool isFullscreen () const override
 Return true if the window is in fullscreen mode.
 
void setFullscreen (bool fullscreen) override
 Enter or exit fullscreen mode.
 
- Public Member Functions inherited from Flint::IWindow
- Public Member Functions inherited from Flint::IGPUContext

Detailed Description

SDL3 window implementation that also exposes the SDL GPU context.

Implements both IWindow (for event polling and presentation) and IGPUContext (for GPU device, command buffer, and render pass access). The Application and GPURenderer obtain GPU handles through this class without depending on any other platform type.

Definition at line 23 of file sdl-window.h.


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