Updates to main()
helios » Devlog
In the spirit of yesterday’s refactoring efforts…
main() serves as a great example of yesterday’s restructuring in practice: The OpenGLDevice is created, then passed to a GLFWApplication which manages window creation and the main loop. The ultimate goal is for the application to own and provide the input system, further simplifying the program’s entry point and properly encapsulating platform-specific details within the appropriate module.
int main() {
// 1. create the rendering device
const auto opengl = std::make_unique<heliosOpenGl::OpenGLDevice>();
// 2. create the config for the main window
auto cfg = heliosGLFWUtil::GLFWFactory::makeWindowCfg("helios - Simple Cube Renderer");
// 3. create the app.
const auto app = heliosGLFWUtil::GLFWFactory::makeApplication(opengl.get());
// 4. create the main window
heliosWinGlfw::GLFWWindow& win = app->createWindow(cfg);
// 5. initialize the app
app->init();
// ... and set focus to the window
app->focus(win);
// get the InputManager
auto& inputManager = app->inputManager();
while (!win.shouldClose()) {
inputManager.tick(0.0f);
if (inputManager.isKeyPressed(heliosInput::Key::ESC)) {
std::cout << "Key Pressed [ESC]" << std::endl;
}
win.swapBuffers();
}
return EXIT_SUCCESS;
}
Tickable
A small milestone has been reached - the first tick() is now alive in the main loop, marking the first rhythmic pulse in helios’s engine (heh!). The clock (i.e. float deltaTime) has officially started.
helios
helios is a custom game framework built from first principles, written in C++.
| Status | Prototype |
| Category | Tool |
| Author | GarageCraft Games |
| Tags | cpp, eductational, engine, gamedev, linearalgebra, programming, software-architecture |
More posts
- ImGui Integration and Breaking Changes2 days ago
- helios: Design and prototypical implementation of a C++ game framework26 days ago
- Just make it exist first!48 days ago
- Onwards to the rendering model69 days ago
- Event Queue and Application Controllers75 days ago
- From Camera- to Clip-Space, to NDCs and z-Fighting80 days ago
- The Great Modular Restructuring84 days ago
- Layer Abstraction initiated89 days ago
- inb4 Clip Space91 days ago

Leave a comment
Log in with itch.io to leave a comment.