Ember
A C++ 20 'game engine' built with SDL3 with wide platform support.
Classes | Functions | Variables
engine.h File Reference
#include "core/engine_config.h"
#include "core/io/file_system.h"
#include "systems/audio_manager.h"
#include "systems/input_manager.h"
#include "systems/time_manager.h"
#include "core/systems/physics_sys.h"
#include "core/systems/thread_pool.h"
#include <random>

Go to the source code of this file.

Classes

class  Engine
 Core Engine singleton. More...
 

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...
 
template<typename T >
random (T min, T max)
 Generate a random number between min and max. More...
 

Variables

constexpr float PIXELS_PER_METER = 32.0f
 
constexpr float METERS_PER_PIXEL = 1.0f / PIXELS_PER_METER
 
std::unique_ptr< EngineGEngine
 
ma_engine audio_engine
 

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.

◆ random()

template<typename T >
T random ( min,
max 
)

Generate a random number between min and max.

◆ 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
extern

◆ GEngine

std::unique_ptr<Engine> GEngine
extern

◆ METERS_PER_PIXEL

constexpr float METERS_PER_PIXEL = 1.0f / PIXELS_PER_METER
constexpr

◆ PIXELS_PER_METER

constexpr float PIXELS_PER_METER = 32.0f
constexpr