|blackle 6ecfc7a26e make switch statement an if statement||9 months ago|
|Section-Header-Stripper @ a4c7aea4f0||1 year ago|
|noelfver @ 3022b4ef8b||9 months ago|
|vondehi @ 859c6c11d0||1 year ago|
|.gitignore||9 months ago|
|.gitmodules||9 months ago|
|Makefile||9 months ago|
|README.md||9 months ago|
|gtk-opengl.c||9 months ago|
|index.html||1 year ago|
|index.html.inc||1 year ago|
|sdl2-opengl.c||9 months ago|
|shader.frag||1 year ago|
|shader_minifier.exe||1 year ago|
|xlib-opengl.c||1 year ago|
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.
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. (note, unlike all the other programs that close with the window manager's quit key combination, this program must be closed with ESC.)
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.
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.)