Skip to content

Instantly share code, notes, and snippets.

@quou
quou / loadfile.c
Last active November 8, 2020 22:43
Load text file using PhysFS
PHYSFS_init(NULL);
PHYSFS_mount("Data.zip "/", 1);
const char* filePath = "Data/testFile.txt";
PHYSFS_file* file = PHYSFS_openRead(filePath);
if (file == NULL) {
printf("Failed to load file: %s.\n", filePath);
abort();
}
@quou
quou / postprocessing.glsl
Last active May 29, 2021 10:41
GLSL outline post processing shader with FXAA and outlining.
/* How to use
* Supply a texture (probably from a framebuffer) and a depth
* texture to the uniforms `u_input' and `u_depth'. Supply the
* framebuffer's width and height to `u_width' and `u_height'.
* Use this shader to draw the framebuffer output to a fullscreen
* quad. */
#begin VERTEX
#version 430 core
@quou
quou / datexport.js
Created September 10, 2021 06:45
Binary tiled exporter
var dat_format = {
name: "Binary",
extension: "dat",
write:function(map, filename) {
var file = new BinaryFile(filename, BinaryFile.WriteOnly);
var tilesets = map.usedTilesets();
/* Write the amount of tilesets. */