Capycore Engine  0.1.0
A simple and lightweight game engine written in C++ based on the Unity API architecture.
Loading...
Searching...
No Matches
sdl_backend_system.h
Go to the documentation of this file.
1#pragma once
2
3#include <SDL3/SDL.h>
5
12 public:
13 SDLBackendSystem() = default;
14
16 std::unordered_map<SystemEvent, std::vector<BackendCallback>>* listeners)
17 override;
18
25 void poll_events() override;
26
32 void init_frame_timer() override;
33
40 void update_frame_time(float time_scale) override;
41
46 [[nodiscard]] float delta_time() const override;
47
53 [[nodiscard]] float frames_per_second() const override;
54
59 [[nodiscard]] std::string get_clipboard_text() override;
60
64 void set_cursor_to_arrow() override;
65
69 void set_cursor_to_hand() override;
70
74 void set_cursor_to_ibeam() override;
75
79 void set_cursor_to_crosshair() override;
80
84 void set_cursor_to_wait() override;
85
86 private:
87 std::unordered_map<SystemEvent, std::vector<BackendCallback>>* listeners_{
88 nullptr};
89};
Interface for backend system implementations handling low-level events.
Definition i_backend_system.h:20
SDL-based implementation of the backend system interface.
Definition sdl_backend_system.h:11
float frames_per_second() const override
Retrieves the frames per second (FPS) based on the updated frame time.
void poll_events() override
Polls for new events from the backend system.
void set_cursor_to_arrow() override
Sets the cursor to the standard arrow shape.
SDLBackendSystem()=default
std::string get_clipboard_text() override
Gets the current text from the system clipboard.
void initialize_listeners(std::unordered_map< SystemEvent, std::vector< BackendCallback > > *listeners) override
void set_cursor_to_wait() override
Sets the cursor to the wait (hourglass) shape.
void init_frame_timer() override
Initializes the internal timer for frame time calculation.
void set_cursor_to_ibeam() override
Sets the cursor to the I-beam shape.
void set_cursor_to_crosshair() override
Sets the cursor to the crosshair shape.
void update_frame_time(float time_scale) override
Updates the frame time based on the elapsed time since the last frame.
float delta_time() const override
Retrieves the time elapsed since the last frame.
void set_cursor_to_hand() override
Sets the cursor to the hand shape.
SystemEvent
Definition system_event.h:5