A header-only C/C++ framework for making games with thicc pixels.
WARN: WASM build doesn't work.
NOTE: In C++ you need to add -fpermissive
and use a C++ compiler.
On Linux and C:
gcc -lX11 -lXcursor -lGL -ldl -lm -pthread myfile.c
On Windows and Mingw the following should work:
gcc -lkernel32 -luser32 -lshell32 -lgdi32 -ladvapi32 -lopengl32 myfile.c
There's examples in the demo folder. You need to generate the assets with he python script in there.
You can do something similar to this:
#define TPE_FRAGMENT_SHADER myShaderSource
#define TPE_IMPL
#include "tpe.h"
...
int main() {
...
myShaderSource = "#version " TPE_SHADER_VERSION "\n" // + The rest of your source.
tpe_Context ctx;
tpe_init(&ctx, "Game Window");
...
}
The default shader looks like such:
out vec4 FragColor;
in vec2 texPos;
uniform sampler2D screen;
void main() {
FragColor = vec4(texture(screen, texPos).rgb, 1.0f);
}