Ember
A C++ 20 'game engine' built with SDL3 with wide platform support.
Functions | Variables
engine.cpp File Reference
#include "core/engine.h"
#include "core/ember_core.h"
#include "core/renderer/metal/ember_mtl.h"
#include "core/renderer/opengl/ember_gl.h"
#include <stb_image.h>

Functions

b2Vec2 pixels_to_world (const glm::vec2 &pixel_pos)
 Convert pixel coordinates to Physics world coordinates. More...
 
glm::vec2 world_to_pixels (const b2Vec2 &world_pos)
 Convert pixel coordinates to Physics world coordinates. More...
 

Variables

std::unique_ptr< EngineGEngine = std::make_unique<Engine>()
 
ma_engine audio_engine
 
constexpr double FIXED_TIMESTEP = 1.0 / 60.0
 
constexpr double MAX_FRAME_TIME = 0.25
 

Function Documentation

◆ pixels_to_world()

b2Vec2 pixels_to_world ( const glm::vec2 &  pixel_pos)

Convert pixel coordinates to Physics world coordinates.

Parameters
pixel_posPosition in pixels.
Returns
b2Vec2 Position in Physics world units.

◆ world_to_pixels()

glm::vec2 world_to_pixels ( const b2Vec2 &  world_pos)

Convert pixel coordinates to Physics world coordinates.

Returns
b2Vec2 Position in Physics world units.

Variable Documentation

◆ audio_engine

ma_engine audio_engine

◆ FIXED_TIMESTEP

constexpr double FIXED_TIMESTEP = 1.0 / 60.0
constexpr

◆ GEngine

std::unique_ptr<Engine> GEngine = std::make_unique<Engine>()

◆ MAX_FRAME_TIME

constexpr double MAX_FRAME_TIME = 0.25
constexpr