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

Abstract interface for a platform window. More...

#include <flint/window/IWindow.h>

+ Inheritance diagram for Flint::IWindow:
+ Collaboration diagram for Flint::IWindow:

Public Member Functions

virtual void display ()=0
 Present the current frame to the screen.
 
virtual void setMouseCursor (CursorType type)=0
 Set the mouse cursor shape.
 
virtual bool isOpen () const =0
 Return true if the window is open and the application should keep running.
 
virtual void pollEvents (const std::function< void(const AppEvent &)> &handler)=0
 Poll all pending OS events and dispatch them to handler.
 
virtual void setTitle (const std::string &name)=0
 Set the window title bar text.
 
virtual void close ()=0
 Request that the window close.
 
virtual Vec2f getMousePosition () const =0
 Return the current mouse cursor position in window-space pixels.
 
virtual Vec2f mapPixelToCoords (Vec2f pixel) const =0
 Return the current mouse cursor position in window-space pixels.
 
virtual Vec2i getSize () const =0
 Return the current window size in pixels.
 
virtual void addGlobalEventListener (std::function< void(const AppEvent &)> callback)=0
 Register a global event listener that receives every polled event.
 
virtual bool hasFocus () const =0
 Return true if the window currently has input focus.
 
virtual void * getNativeHandle () const =0
 Return the platform-native window handle (e.g. HWND, SDL_Window*).
 
virtual bool isFullscreen () const =0
 Return true if the window is currently in fullscreen mode.
 
virtual void setFullscreen (bool fullscreen)=0
 Enter or exit fullscreen mode.
 

Detailed Description

Abstract interface for a platform window.

Provides event polling, display/present, mouse queries, and window manipulation. The concrete implementation (SdlWindow) also implements IGPUContext so the renderer can obtain GPU handles through this interface.

Definition at line 27 of file IWindow.h.


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