Let's Make an Engine: Graphics API History

2022-12-28 | #dx12 #engine #graphics #render

We briefly discussed our choice of DirectX 12 in our previous entry. In order to more fully understand how we’re going to proceed to add graphics support to our engine we need to understand a bit of the history and evolution of graphics APIs. A Brief History of Graphics APIs Graphics APIs evolved through the decades. They start in the early 1990s with Iris GL followed by OpenGL. These are fixed-function immediate mode APIs.

Continue reading 


Let's Make an Engine: ImGui

2022-12-27 | #engine #imgui

In the previous entry we converted our app to a GUI window and left our next step open. It’s time to take a big step forward, a forcing function that will set up our next couple of moves. We’re going to integrate our first external library (not counting the OS SDK). Dear ImGui Initially released in only 2014 Dear ImGui has taken the game development industry by storm. It is one of the most widely and rapidly adopted middleware libraries I’ve ever seen.

Continue reading 


Let's Make an Engine: Window

2022-12-26 | #engine #win32 #window

In the previous entry we built a skeleton project with a terminal application. Nothing against text mode games but we want a fully graphical engine. To this end we first need to create a window. To make our window we need to choose our target platform and integrate its SDK. It will be fun eventually to port our engine to other platforms but for now we’re going to focus on Win32, the primay API used to target 2 of the 3 largest game markets (PC & Xbox).

Continue reading 


Let's Make an Engine: Project

2022-12-21 | #engine #project

Series Introduction Welcome to the first entry in a series where we will be creating a modern game engine from scratch using C++. It is the game industry standard and the language I am most comfortable with having used it for over 20 years now. As a professional working on AAA games, it can often feel like the fable of the blind men touching an elephant, where you are only able to see a small part of the project at a time and never really grasp the totality of it.

Continue reading 


Entity Component System: Intro

2018-04-22 | #ECS

This is the start of a series of articles on Entity Component System (ECS) architecture. The posts will be a mix of theory and practical. The goal is to build a functional and efficient library by the end. What is an ECS An ECS or Entity Component System is programming pattern that separates code, data, and relationships. The three pillars of an ECS are unsurprisingly: Entity Component System Entity provides for an identity and the relationship between Components.

Continue reading 


Coroutines: A Million Stacks

2017-10-05 | #coroutine

Can you have 1 million entities and let them all think with stackful coroutines and achieve acceptable frame rates? An unreasonable question, but is it possible? Obviously not and it’s easy to see why with a back-of-the-envelope calculation: 1 million entities * 1 MiB stack per coroutine = 1 TiB of memory My machine has 64 GiB of RAM, a respectable amount, but only 6.4% of the memory requirements just for these coroutine stacks.

Continue reading 


Win32 app without WinMain

2016-01-15 | #win32

WinMain vs main Win32 apps use WinMain as an entry point. Most other platforms use main. For a long time I’ve used one of two patterns for the entry point in cross platform projects. A separate entry point cpp file per platform with the win32 version containing WinMain and the others containing main. Select entry point via preprocessor. #ifdef _WIN32 int APIENTRY WinMain(HINSTANCE, HINSTANCE, LPSTR, int ) #else int main() #endif { // do work return 0; } These solutions are a ugly but acceptable until you start needing to parse command line arguments as well.

Continue reading 