The Nikola Game Engine

Mohamed

Mohamed Gadalla

Nikola

Nikola is a cross-platform framework for window creation, input handling, audio playback, and rendering using OpenGL 4.5+, designed for your game development and prototyping needs. Inspired by classic game engines like Doom, Quake, and the Source Engine, it is lightweight yet robust and flexible. A game engine creation tool, if you will.

Dependencies

Engine Dependencies:

NBR Tool Dependencies:

Features

A fully documented, single-header implementation for each library module.
Cross-platform window creation with OpenGL 4.5+.
Gamepad, keyboard, and mouse input support.
A flexible, configurable rendering API.
A simple resource manager with a custom resource format (NBR) that supports hot-reloading of resources.
Support for multiple image formats including JPEG, PNG, BMP, TGA, and more.
3D model loading with support for OBJ, FBX, and GLTF formats.
Integrated ImGui support, featuring an abstracted editor layer for editing engine-specific types through a GUI.
A versitile lighting system using the Blinn-Phong shading model with built-in HDR support.
A fully-fledged audio system with both 2D audio and 3D spatialized audio, supporting multiple formats such as MP3, WAV, and OGG.
A simple but powerful physics system that supports collision detection, collision resolution, ray-casting, and rigid body dynamics.

Hello, Nikola

Here's a simple example of the core library working in action. The example below will open a basic window and initialze a graphics context.
#include <nikola/nikola.h>

int main() {
// Initialze the library
if(!nikola::init()) {
return -1;
}

// Openinig the window
nikola::i32 win_flags = nikola::WINDOW_FLAGS_FOCUS_ON_CREATE | nikola::WINDOW_FLAGS_GFX_HARDWARE;
nikola::Window* window = nikola::window_open("Hello, Nikola", 1366, 768, win_flags);
if(!window) {
return -1;
}

// Creating a graphics context
nikola::GfxContextDesc gfx_desc = {
.window = window,
.states = nikola::GFX_STATE_DEPTH | nikola::GFX_STATE_STENCIL,
};
nikola::GfxContext* gfx = nikola::gfx_context_init(gfx_desc);
if(!gfx) {
return -1;
}

// Main loop
while(nikola::window_is_open(window)) {
// Will stop the application when F1 is pressed
if(nikola::input_key_pressed(nikola::KEY_F1)) {
break;
}

// Clear the screen to black
nikola::gfx_context_clear(gfx, 0.0f, 0.0f, 0.0f, 1.0f);

// Swap the internal window buffer
nikola::gfx_context_present(gfx);

// Poll the window events
nikola::window_poll_events(window);
}

// De-initialze
nikola::gfx_context_shutdown(gfx);
nikola::window_close(window);
nikola::shutdown();
}

Like this project

Posted Jun 30, 2025

A cross-platform framework for window creation, input handling, and rendering using OpenGL 4.5+