Code examples for opening windows for various purposes in very few bytes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
blackle d317e693b0 Remove gtk-webkit and replace with sdl2-opengl 2 years ago
Section-Header-Stripper@a4c7aea4f0 Add submodules, better make 3 years ago
noelfver@3022b4ef8b Remove gtk-webkit and replace with sdl2-opengl 2 years ago
vondehi@859c6c11d0 Add submodules, better make 3 years ago
.gitignore Remove gtk-webkit and replace with sdl2-opengl 2 years ago
.gitmodules Remove gtk-webkit and replace with sdl2-opengl 2 years ago
Makefile Remove gtk-webkit and replace with sdl2-opengl 2 years ago
README.md Remove gtk-webkit and replace with sdl2-opengl 2 years ago
gtk-opengl.c Remove gtk-webkit and replace with sdl2-opengl 2 years ago
index.html initialize webgl in a really shitty unoptimized way 3 years ago
index.html.inc woops, forgot index.html.inc 3 years ago
sdl2-opengl.c Remove gtk-webkit and replace with sdl2-opengl 2 years ago
shader.frag Remove iTime from shaders, render each only once 3 years ago
shader_minifier.exe Opengl with gtk example 3 years ago
xlib-opengl.c Sizecode xlib a bit 3 years ago

README.md

Linux-OpenGL-Examples

Here are examples of rendering a shader full screen on linux. All of these examples do it in less than 2 kilobytes thanks to vondehi and copious amounts of ELF stripping.

There are three examples, each using a different library to open a window and get an opengl context.

xlib-opengl - 1503 bytes

Vanilla xlib is the largest of the bunch and the most brittle. It is highly not recommended to use xlib in a demo unless you cannot assume these other libraries will be on the system.

gtk-opengl - 1396 bytes

GTK is a step up from xlib, being both smaller and more robust. If the compo you are entering doesn't allow using SDL2, GTK is an ok alternative. Before switching to GCC 8.3.0, this was 100 bytes smaller than it is now. I am not sure why it is larger, but this likely means it can be sizecoded/stripped further.

sdl2-opengl - 1010 bytes

Using SDL2 will give you very small binaries. Use SDL2 whenever you can, as it also has a few other useful subsystems at minimal cost (for example, audio.)