14#include <initializer_list>
77 int windowWidth = 800,
78 int windowHeight = 600,
79 std::string windowTitle =
"cangine window",
80 bool fullscreen =
false,
82 std::string defaultShaderName =
"default"
103 template <
typename T,
typename... Args>
105 static_assert(std::is_base_of<GameObject, T>::value,
106 "Instantiated object is not a GameObject");
107 return new T(std::forward<Args>(args)...);
Singleton class that manages audio playback.
Definition audiomanager.hpp:20
Base application class that owns the window and main loop.
Definition cangine.hpp:43
virtual void onFrame(double dt)
Override to run per-frame game logic.
Definition cangine.hpp:92
RenderSystem * _rs
Owned render system.
Definition cangine.hpp:47
~CangineApp()
Definition cangine.cpp:85
Window * window
The application window.
Definition cangine.hpp:64
void initObjectManager()
Creates the object manager.
Definition cangine.cpp:44
void initShader(std::string name)
Loads and initializes the default shader.
Definition cangine.cpp:30
T * instantiateObject(Args &&... args)
Instantiates a game object of a derived type.
Definition cangine.hpp:104
void initAudioManager()
Creates the audio manager.
Definition cangine.cpp:48
ObjectManager * _om
Owned object manager.
Definition cangine.hpp:48
AudioManager * audioMan
Owned audio manager.
Definition cangine.hpp:65
void initRenderSystem()
Creates the render system.
Definition cangine.cpp:40
virtual void onFirstFrame()
Override to run setup logic on the first frame.
Definition cangine.hpp:87
void run()
Runs the main loop until the window is closed.
Definition cangine.cpp:52
Color windowFillColor
Color the window is cleared to each frame.
Definition cangine.hpp:63
bool isFirstFrame
Whether the next frame is the first one.
Definition cangine.hpp:45
Shader * shader
Default shader used for rendering.
Definition cangine.hpp:46
Singleton registry that owns and updates all game objects.
Definition object_manager.hpp:17
Singleton aggregating the engine's renderers.
Definition render_system.hpp:15
Wraps a compiled and linked OpenGL shader program.
Definition shader.hpp:61
Owns the application window, OpenGL context and the frame loop.
Definition window.hpp:34
const Color BLACK(0, 0, 0)
Black.
Definition audiomanager.cpp:4
void init()
Initializes engine-wide state (must be called before use).
Definition cangine.cpp:10
void terminate()
Tears down engine-wide state.
Definition cangine.cpp:23
RGBA color stored as normalized floating-point components.
Definition color.hpp:12