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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // example how to set up D3D11 rendering on Windows in C | |
| #define COBJMACROS | |
| #define WIN32_LEAN_AND_MEAN | |
| #include <windows.h> | |
| #include <d3d11.h> | |
| #include <dxgi1_3.h> | |
| #include <d3dcompiler.h> | |
| #include <dxgidebug.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // --- Library -------------------------------------------------------------------------- | |
| #include <string.h> | |
| #include <assert.h> | |
| struct ui_box {int x,y,w,h;}; | |
| typedef unsigned long long ui_id; | |
| struct ui_node { | |
| int parent; | |
| int lst, end, nxt; | |
| int siz[2]; |
