Skip to content

Instantly share code, notes, and snippets.

View larsenglund's full-sized avatar

Lars Englund larsenglund

View GitHub Profile
@d7samurai
d7samurai / .readme.md
Last active December 19, 2025 03:40
Minimal D3D11 pt3
@d7samurai
d7samurai / .readme.md
Last active December 18, 2025 01:13
Minimal D3D11 pt2

Minimal D3D11 part 2

Follow-up to Minimal D3D11, adding instanced rendering. As before: An uncluttered Direct3D 11 setup & basic rendering primer / API familiarizer. Complete, runnable Windows application contained in a single function and laid out in a linear, step-by-step fashion. No modern C++ / OOP / obscuring cruft.

The main difference here is that the hollow cube is rendered using instancing (which saves a lot of vertices compared to the original, so geometry data is now small enough to be included in the source without being too much in the way), but also all trigonometry and matrix math is moved to the vertex shader, further simplifying the main code.

In this case, each instance is merely this piece of geometry, consisting of 4 triangles:

[![instance

@d7samurai
d7samurai / .readme.md
Last active December 19, 2025 17:15
Minimal D3D11

Minimal D3D11

Minimal D3D11 reference implementation: An uncluttered Direct3D 11 setup + basic rendering primer and API familiarizer. Complete, runnable Windows application contained in a single function and laid out in a linear, step-by-step fashion that should be easy to follow from the code alone. ~200 LOC. No modern C++, OOP or (other) obscuring cruft. View on YouTube

hollowcube

Other gists in this series: