Capycore Engine  0.1.0
A simple and lightweight game engine written in C++ based on the Unity API architecture.
Loading...
Searching...
No Matches
system_service.h
Go to the documentation of this file.
1#pragma once
2
3#include <functional>
4#include <memory>
5#include <string>
6#include <unordered_map>
7
11
13 public:
14 explicit SystemService();
15
16 using EventCallback = std::function<void(void* event)>;
17
18 int add_listener(SystemEvent event, EventCallback callback); // NOLINT
19 void remove_listener(SystemEvent event, int listener_id); // NOLINT
20
21 void update();
22
23 [[nodiscard]] std::string get_clipboard_text();
24
30
32 void update_frame_time(float time_scale);
33 [[nodiscard]] float delta_time() const;
34 [[nodiscard]] float frames_per_second() const;
35
36 private:
37 std::unique_ptr<IBackendSystem> backend_system_;
38 std::unordered_map<SystemEvent, std::vector<EventCallback>> listeners_;
39};
Definition iEngineService.h:4
Definition system_service.h:12
void set_cursor_to_arrow()
void update_frame_time(float time_scale)
float frames_per_second() const
void init_frame_timer()
void set_cursor_to_hand()
void set_cursor_to_crosshair()
float delta_time() const
void set_cursor_to_ibeam()
std::function< void(void *event)> EventCallback
Definition system_service.h:16
void remove_listener(SystemEvent event, int listener_id)
std::string get_clipboard_text()
int add_listener(SystemEvent event, EventCallback callback)
void set_cursor_to_wait()
SystemEvent
Definition system_event.h:5