Plain 2D rendering in D3D11, without the distracting feature set of a complete sprite renderer and allowing arbitrarily placed triangle vertices with absolute pixel coordinate positioning (there's really no need for the sometimes confusing complication of a full-on projection matrix pipeline for UI and 2D games). Like the original Minimal D3D11, this one uses a canonical 1:1 TRIANGLELIST
vertex buffer with input layout, so no fancy manual custom buffer fetching and in-shader in
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
#include <stdio.h> | |
#define MAX 20 | |
#define INF 1000 | |
typedef struct { | |
int predecessor; | |
int distance; | |
int status; | |
int neighbours[MAX]; | |
} Node; |
- 2011 - A trip through the Graphics Pipeline 2011
- 2015 - Life of a triangle - NVIDIA's logical pipeline
- 2015 - Render Hell 2.0
- 2016 - How bad are small triangles on GPU and why?
- 2017 - GPU Performance for Game Artists
- 2019 - Understanding the anatomy of GPUs using Pokémon
- 2020 - GPU ARCHITECTURE RESOURCES
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
#include <time.h> // Robert Nystrom | |
#include <stdio.h> // @munificentbob | |
#include <stdlib.h> // for Ginny | |
#define r return // 2008-2019 | |
#define l(a, b, c, d) for (i y=a;y\ | |
<b; y++) for (int x = c; x < d; x++) | |
typedef int i;const i H=40;const i W | |
=80;i m[40][80];i g(i x){r rand()%x; | |
}void cave(i s){i w=g(10)+5;i h=g(6) | |
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u |
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
#include <stdio.h> | |
#define COUNT(...) (sizeof((int[]){ __VA_ARGS__ })/sizeof(int)) | |
#define __eval(x0, x1, x2, x3, ...) _Generic((x0), \ | |
void*: _Generic((x1), int: _evali, double: _evald), \ | |
int: _evali, \ | |
double: _evald \ | |
)( \ | |
COUNT(__VA_ARGS__) - _Generic((x0), void *: 1, default: 0), \ |
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
// Sample code showing how to create a modern OpenGL window and rendering context on Win32. | |
#include <windows.h> | |
#include <gl/gl.h> | |
#include <stdbool.h> | |
typedef HGLRC WINAPI wglCreateContextAttribsARB_type(HDC hdc, HGLRC hShareContext, | |
const int *attribList); | |
wglCreateContextAttribsARB_type *wglCreateContextAttribsARB; |