Skip to content

Instantly share code, notes, and snippets.

@alganet
alganet / c89cc.sh
Last active April 14, 2026 14:02
c89cc.sh - standalone C89/ELF64 compiler in pure portable shell
#!/bin/sh
# ISC License
# Copyright (c) 2026 Alexandre Gomes Gaigalas <alganet@gmail.com>
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
@jfuerth
jfuerth / egl_bar.c
Last active October 16, 2025 10:58
Self-contained example of an EGL + X11 OpenGL ES 2.0 rectangle moving across the screen
// egl_bar.c - self-contained example of a vertical bar moving across the screen.
// compile with gcc -Wall -O0 -g -o egl_bar egl_bar.c log.c -lX11 -lEGL -lGLESv2 -lm
#include <stdio.h>
#include <math.h>
#include <malloc.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@kanru
kanru / Makefile
Created September 28, 2012 11:08
X11 EGL
all: egl
egl: egl.cpp
g++ -lX11 -lEGL -lGLESv2 egl.cpp -o egl