Capycore Engine  0.1.0
A simple and lightweight game engine written in C++ based on the Unity API architecture.
Loading...
Searching...
No Matches
SDLBackendSystem Class Reference

SDL-based implementation of the backend system interface. More...

#include <sdl_backend_system.h>

Inheritance diagram for SDLBackendSystem:
[legend]

Public Member Functions

 SDLBackendSystem ()=default
 
void initialize_listeners (std::unordered_map< SystemEvent, std::vector< BackendCallback > > *listeners) override
 
void poll_events () override
 Polls for new events from the backend system.
 
void init_frame_timer () override
 Initializes the internal timer for frame time calculation.
 
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.
 
float frames_per_second () const override
 Retrieves the frames per second (FPS) based on the updated frame time.
 
std::string get_clipboard_text () override
 Gets the current text from the system clipboard.
 
void set_cursor_to_arrow () override
 Sets the cursor to the standard arrow shape.
 
void set_cursor_to_hand () override
 Sets the cursor to the hand shape.
 
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 set_cursor_to_wait () override
 Sets the cursor to the wait (hourglass) shape.
 
- Public Member Functions inherited from IBackendSystem
virtual ~IBackendSystem ()=default
 

Additional Inherited Members

- Protected Attributes inherited from IBackendSystem
uint64_t last_ {0}
 
double freq_ {0.0f}
 
float delta_time_ {0.0f}
 
int frame_count_ {0}
 
float fps_ {0.0f}
 
float accumulated_time_ {0.0f}
 

Detailed Description

SDL-based implementation of the backend system interface.

Handles event polling and frame timing using SDL functions.

Constructor & Destructor Documentation

◆ SDLBackendSystem()

SDLBackendSystem::SDLBackendSystem ( )
default

Member Function Documentation

◆ delta_time()

float SDLBackendSystem::delta_time ( ) const
overridevirtual

Retrieves the time elapsed since the last frame.

Returns
The delta time in seconds.

Implements IBackendSystem.

◆ frames_per_second()

float SDLBackendSystem::frames_per_second ( ) const
overridevirtual

Retrieves the frames per second (FPS) based on the updated frame time.

Returns
The current frames per second.

Implements IBackendSystem.

◆ get_clipboard_text()

std::string SDLBackendSystem::get_clipboard_text ( )
overridevirtual

Gets the current text from the system clipboard.

Returns
The text from the clipboard.

Implements IBackendSystem.

◆ init_frame_timer()

void SDLBackendSystem::init_frame_timer ( )
overridevirtual

Initializes the internal timer for frame time calculation.

Note
This method must be called before using update_frame_time or delta_time.

Implements IBackendSystem.

◆ initialize_listeners()

void SDLBackendSystem::initialize_listeners ( std::unordered_map< SystemEvent, std::vector< BackendCallback > > *  listeners)
overridevirtual

Implements IBackendSystem.

◆ poll_events()

void SDLBackendSystem::poll_events ( )
overridevirtual

Polls for new events from the backend system.

Should invoke registered callbacks for each event type as events are received and reinterpreted from SDL events.

Implements IBackendSystem.

◆ set_cursor_to_arrow()

void SDLBackendSystem::set_cursor_to_arrow ( )
overridevirtual

Sets the cursor to the standard arrow shape.

Implements IBackendSystem.

◆ set_cursor_to_crosshair()

void SDLBackendSystem::set_cursor_to_crosshair ( )
overridevirtual

Sets the cursor to the crosshair shape.

Implements IBackendSystem.

◆ set_cursor_to_hand()

void SDLBackendSystem::set_cursor_to_hand ( )
overridevirtual

Sets the cursor to the hand shape.

Implements IBackendSystem.

◆ set_cursor_to_ibeam()

void SDLBackendSystem::set_cursor_to_ibeam ( )
overridevirtual

Sets the cursor to the I-beam shape.

Implements IBackendSystem.

◆ set_cursor_to_wait()

void SDLBackendSystem::set_cursor_to_wait ( )
overridevirtual

Sets the cursor to the wait (hourglass) shape.

Implements IBackendSystem.

◆ update_frame_time()

void SDLBackendSystem::update_frame_time ( float  time_scale)
overridevirtual

Updates the frame time based on the elapsed time since the last frame.

Parameters
time_scaleA modifier to scale the delta time, useful for implementing slow-motion or speed-up effects.

Implements IBackendSystem.


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