RaeptorCogs¶
Main RaeptorCogs library header.
Overview¶
Typical use cases:
Including all RaeptorCogs functionalities in a single header
Accessing core engine features such as rendering, resource management, input handling, and timing
Header¶
<RaeptorCogs/RaeptorCogs.hpp>
Metadata¶
- Author
Estorc
- Version
v1.0
- Copyright
Copyright (c) 2025 Estorc MIT License.
Functions¶
Function |
Description |
|---|---|
|
Destroy the RaeptorCogs engine and clean up resources. |
|
Get the current screen height. |
|
Get the current screen width. |
|
Initialize the RaeptorCogs engine. |
|
Access the global Input singleton. |
|
Check if the application is exiting. |
|
Main application loop. |
|
Access the global MainWorker singleton. |
|
Access the global Mouse singleton. |
|
Access the global Platform singleton. |
|
Access the global Random singleton. |
|
Access the global Renderer singleton. |
|
Access the global ResourceManager singleton for a specific resource type. |
|
Access the global ResourceWorker singleton. |
|
Start the main application loop. |
|
Access the global TextureAtlasManager singleton. |
|
Access the global Time singleton. |
|
No description. |
-
void RaeptorCogs::Destroy()¶
Destroy the RaeptorCogs engine and clean up resources.
RaeptorCogs::Destroy();
-
double RaeptorCogs::GetScreenHeight()¶
Get the current screen height.
double height = RaeptorCogs::GetScreenHeight();
- Returns:
Current screen height in pixels.
-
double RaeptorCogs::GetScreenWidth()¶
Get the current screen width.
double width = RaeptorCogs::GetScreenWidth();
- Returns:
Current screen width in pixels.
-
void RaeptorCogs::Initialize()¶
Initialize the RaeptorCogs engine.
Sets up necessary subsystems and prepares the engine for use.
RaeptorCogs::Initialize();
-
Singletons::Input &RaeptorCogs::Input()¶
Access the global Input singleton.
if (RaeptorCogs::Input().isKeyPressed(RaeptorCogs::Key::A)) { // 'A' key is currently pressed }
- Returns:
Reference to the Input singleton.
-
bool RaeptorCogs::IsExiting()¶
Check if the application is exiting.
if (RaeptorCogs::IsExiting()) { // Handle exiting logic }
- Returns:
true if the application is in the process of exiting, false otherwise.
-
void RaeptorCogs::MainLoop(std::function<void(Window&)> updateFunction, Window &window)¶
Main application loop.
Continuously calls the provided update function, processes input, and renders frames until the application exits.
- Parameters:
updateFunction – Function to be called each frame for updates.
window – Pointer to the main application window.
-
Singletons::MainWorker &RaeptorCogs::MainWorker()¶
Access the global MainWorker singleton.
RaeptorCogs::MainWorker().addJob([](){ // Job logic here });
- Returns:
Reference to the MainWorker singleton (Main thread).
-
Singletons::Mouse &RaeptorCogs::Mouse()¶
Access the global Mouse singleton.
if (RaeptorCogs::Mouse().isButtonPressed(RaeptorCogs::MouseButton::LEFT)) { // Left mouse button is currently pressed }
- Returns:
Reference to the Mouse singleton.
-
Singletons::Platform &RaeptorCogs::Platform()¶
Access the global Platform singleton.
RaeptorCogs::Window* window = RaeptorCogs::Platform().createWindow(800, 600, "My Window");
- Returns:
Reference to the Platform singleton.
-
Singletons::Random &RaeptorCogs::Random()¶
Access the global Random singleton.
int randInt = RaeptorCogs::Random().getInt(1, 10);
- Returns:
Reference to the Random singleton.
-
Singletons::Renderer &RaeptorCogs::Renderer()¶
Access the global Renderer singleton.
auto &renderer = RaeptorCogs::Renderer(); renderer.render(window);
- Returns:
Reference to the Renderer singleton.
-
template<typename T>
Singletons::ResourceManager<T> &RaeptorCogs::ResourceManager()¶ Access the global ResourceManager singleton for a specific resource type.
auto &textureManager = RaeptorCogs::ResourceManager<RaeptorCogs::Texture>(); Texture &tex = textureManager.get_or_create("path/to/texture.png");
- Template Parameters:
T – The type of resource managed by the ResourceManager.
- Returns:
Reference to the ResourceManager singleton for the specified resource type.
-
Worker &RaeptorCogs::ResourceWorker()¶
Access the global ResourceWorker singleton.
RaeptorCogs::ResourceWorker().addJob([](){ // Job logic here });
- Returns:
Reference to the ResourceWorker singleton (Parallel thread).
-
void RaeptorCogs::StartLoop(std::function<void(Window&)> updateFunction, Window &window)¶
Start the main application loop.
RaeptorCogs::StartLoop([](RaeptorCogs::Window* mainWindow) { // Update logic here }, mainWindow);
- Parameters:
updateFunction – Function to be called each frame for updates.
window – Reference to the main application window.
-
Singletons::TextureAtlasManager &RaeptorCogs::TextureAtlasManager()¶
Access the global TextureAtlasManager singleton.
auto &atlasManager = RaeptorCogs::TextureAtlasManager(); auto atlas = atlasManager.getAtlas(someKey);
- Returns:
Reference to the TextureAtlasManager singleton.
-
Singletons::Time &RaeptorCogs::Time()¶
Access the global Time singleton.
double deltaTime = RaeptorCogs::Time().getDeltaTime();
- Returns:
Reference to the Time singleton.
-
static void RaeptorCogs::exitHandler()¶
Variables¶
-
static std::atomic<bool> RaeptorCogs::_exiting = false¶