WCGE — Custom Game Engine

Project Type: Personal Project
Frameworks Used: OpenGL, GLFW
Languages Used: Modern C++
Roles: Developer
WCGE preview

About

WCGE (W Custom Game Engine) is a Windows-only game engine written from scratch in modern C++ with OpenGL as its renderer. It ships as a DLL consumed by a separate Sandbox client app, owns its own main entry point, and is built around a hand-rolled math library, an OpenGL abstraction layer, and an entity-component architecture. It is also the showcase target for my custom STL (WSTL).

Roles

Developer

As the only developer, I'm responsible for the making of it.

Modules

The engine owns main, not the client. Clients subclass WCGE::Application, implement the free function WCGE::CreateApplication(), and include EntryPoint.hpp in exactly one translation unit. Application::Run() drives the engine loop and dispatches Start(), Update(), and LateUpdate() virtuals that subclasses override. The engine builds as a DLL: public symbols are tagged with the WCGE_API macro, which expands to __declspec(dllexport) on the engine side and __declspec(dllimport) on the client side.

class Sandbox : public WCGE::Application {
    void Start() override { /* ... */ }
    void Update() override { /* ... */ }
};

WCGE::Application* WCGE::CreateApplication() {
    return new Sandbox();
}

The foundation the rest of the engine sits on. Split across three fronts:

  • MathHand-rolled Vector2/3/4, Matrix3/4, Rect, plus Random and generic Util helpers — no GLM, no external dependencies
  • LoggingA logger for engine and client channels with severity levels, used across every subsystem
  • TimeFrame timing and delta-time tracking that the engine loop feeds into Update calls
using namespace WCGE::Math;
Vector3 position{ 0.0f, 1.0f, 0.0f };
Matrix4 model = Matrix4::Translate(position);
float dt = WCGE::Time::DeltaTime();

An OpenGL abstraction layer that hides the boilerplate (VAO/VBO/EBO management, shader compilation, texture binding) and exposes a much easier-to-use graphics API. Built on GLFW for windowing and GLAD for loading GL function pointers. Components:

  • WindowGLFW-backed window with input forwarding and GL context creation
  • RendererThe draw-call entry point — issues commands against bound meshes, materials, and the active camera
  • ShaderVertex/fragment program loading, compilation, linking, and uniform setters
  • TextureImage loading via stb_image, wrapping/filtering options, and GPU upload
  • MeshVertex and index buffer management with attribute layouts
  • MaterialPairs a shader with its uniforms and bound textures so it can be applied as a unit

Keyboard and mouse polling exposed as a static API. Every frame the input system pulls state from the active Window and lets gameplay code query it through a simple, namespaced interface.

if (WCGE::Input::GetKey(WCGE::Key::W)) {
    transform.position += Vector3::Forward * speed * dt;
}

if (WCGE::Input::GetMouseButtonDown(0)) { /* ... */ }

Game objects are Entities composed of IComponent subclasses. Components are looked up by type via a templated accessor, and the engine ships aggregator headers (Components.hpp, Entities.hpp) so client code can pull in the full set with a single include.

auto* transform = entity.GetComponent<Transform>();
auto* renderer  = entity.GetComponent<MeshRenderer>();

if (transform && renderer) {
    transform->rotation += Vector3::Up * dt;
}

A ResourceManager that loads and caches shaders, textures, and meshes by key, so the same asset isn't re-parsed or re-uploaded to the GPU when multiple entities reference it. Acts as the single owner of GPU resource lifetimes for the engine.

Early-stage physics module. Currently scaffolded with Physics.hpp and a 2DCollisions.hpp header — the groundwork for collision queries against the engine's Rect and vector types. Bodies, integration, and a broadphase are still to come.

Vendored directly into ThirdParty/ — no package manager, all referenced from the .vcxproj files:

  • GLFWCross-platform windowing and GL context creation
  • GLADOpenGL function pointer loader
  • FastNoiseLiteProcedural noise for terrain and generation experiments
  • stb_imageHeader-only image loader, lives inside Graphics/
Source Code