https://github.com/xyproto/tinytriangle
:small_red_triangle_down: OpenGL and audio in less than 4k on Linux
https://github.com/xyproto/tinytriangle
Last synced: 5 months ago
JSON representation
:small_red_triangle_down: OpenGL and audio in less than 4k on Linux
- Host: GitHub
- URL: https://github.com/xyproto/tinytriangle
- Owner: xyproto
- License: zlib
- Created: 2012-12-14T13:07:51.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2014-03-25T09:31:59.000Z (over 11 years ago)
- Last Synced: 2025-01-11T00:53:27.972Z (9 months ago)
- Language: C
- Homepage:
- Size: 211 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Tiny Triangle
=============A skeleton for 4k intros on Linux
Uses ALSA for audio and SDL+OpenGL for graphics.
Executable ends up at 1378 bytes at the time of writing.
(Slightly larger if compiled with gcc instead of clang).Resources:
http://www.int21.de/linux4k/
http://ftp.kameli.net/pub/fit/misc/presis_asm06.pdf
http://glprogramming.com/red/chapter07.html
http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.htmlBuilding the 32-bit version on x86_64 for x86_64:
To build with make:
make m32on64
Requirements:
elfkicker (only used in the build process)
xz
lib32-sdl
lib32-glibc
lib32-nvidia-utils (or lib32-libgl)
lib32-alsa-libBuilding the native version (32-bit for i686, 64-bit for x86_64):
To build with make:
make native
Requirements:
elfkicker (only used in the build process)
xz
sdl
glibc
nvidia-utils (or libgl)
alsa-libAbout unpackme.sh:
x=/dev/shm/x
prepares to write the uncompressed elf file to shared memory as "x"
dd bs=1 skip=82 if=$0 of=$x.xz 2>$x
dd reads from "if": $0, which is the file with the shellscript + compressed elf file combined
and writes to "of": $x.xz, which is a file in shared memory (/dev/shm/x.xz)
bs=1 and skip=82 sets byte size to 1 and skips the 82 first bytes (the shell code)
2>$x gets rid of the output from dd by piping from stderr to $x (/dev/shm/x).
The reason why $x is used instead of /dev/null is because it's shorter to write and
since /dev/shm/x will be overwritten by the next command in any case.
xz -df $x.xz
extracts the compressed elf file in in /dev/shm/x.xz and writes the result
to /dev/shm/x. It overwrites /dev/shm/x because of the "f" flag.
-d is for decompress
chmod +x $x
makes the uncompressed ELF at /dev/shm/x executable
$x
runs the executable ELF at /dev/shm/xZLIB licensed
Improvements? Comments? Send me an e-mail or create an issue
Alexander Rødseth