Olive.c: a simple graphics library that does not have any dependencies
21–30 of 96 posts
Re: Olive.c: a simple graphics library that does not have any dependencies
#22I added -I/usr/include/SDL2 to build.sh, made sure wasm-ld is in place, and it builds and runs smoothly.
Re: Olive.c: a simple graphics library that does not have any dependencies
#23this is very impressive, how is this done? the executable is only a few hundred KB and it runs for me, wasm is doing the magic here but I don't know too much about how the process works. I added -I/usr/include/SDL2 to build.sh, made sure wasm-ld is in place, and it builds and runs smoothly.
Re: Olive.c: a simple graphics library that does not have any dependencies
#24Re: Olive.c: a simple graphics library that does not have any dependencies
#25Re: Olive.c: a simple graphics library that does not have any dependencies
#26Re: Olive.c: a simple graphics library that does not have any dependencies
#27Earlier quoted context omitted.
The function declarations and definitions are all commingled in a single file. So if you want to use this library in a project that contains multiple source files, you have to include a duplicate copy of the implementation (including e.g. the static font data) in every single compilation unit. It's possible that your linker would be smart enough to identify and remove the duplicates, but it's still inelegant, unidiom…
gcc or clang would crash on the linking step complaining about duplicate symbols. This library is only good for a project that is built in a single .c file.
Re: Olive.c: a simple graphics library that does not have any dependencies
#28this is very impressive, how is this done? the executable is only a few hundred KB and it runs for me, wasm is doing the magic here but I don't know too much about how the process works. I added -I/usr/include/SDL2 to build.sh, made sure wasm-ld is in place, and it builds and runs smoothly.
It's a simple software rasterizer. If you're interested in writing your own, I've written a tutorial explaining the basics. https://magcius.github.io/xplain/article/rast1.html
By the way, quake.exe for DOS was 404,480 bytes.
Re: Olive.c: a simple graphics library that does not have any dependencies
#29Re: Olive.c: a simple graphics library that does not have any dependencies
#30It pains me to see #include at the top of the file. It makes the project feel like a toy.
const char *s =
#include "test.txt"
;