Cool project! What’s the motivation? Since it eschews any graphics API, is it safe to assume this only does CPU-based rendering?
Olive.c: a simple graphics library that does not have any dependencies
41–50 of 96 posts
Re: Olive.c: a simple graphics library that does not have any dependencies
#42Earlier quoted context omitted.
Just wait till you find out that you can do: const char *s = #include "test.txt" ;
Sure, but only if the text file looks like a C string literal, i.e. starts and ends with double quotes (which would make it into a weird text file). Doing const char *s = " #inclued "test.txt" "; won't work, since the preprocessor won't interpret directives inside string literals of course. In many assemblers, there is a directive called "incbin" which pastes in unstructured binary data at the point of usage. I just…
Re: Olive.c: a simple graphics library that does not have any dependencies
#43Earlier quoted context omitted.
Just wait till you find out that you can do: const char *s = #include "test.txt" ;
Sure, but only if the text file looks like a C string literal, i.e. starts and ends with double quotes (which would make it into a weird text file). Doing const char *s = " #inclued "test.txt" "; won't work, since the preprocessor won't interpret directives inside string literals of course. In many assemblers, there is a directive called "incbin" which pastes in unstructured binary data at the point of usage. I just…
Re: Olive.c: a simple graphics library that does not have any dependencies
#44Earlier quoted context omitted.
From demos/triangle.c ( https://github.com/tsoding/olive.c/blob/master/demos/triangl... ) // This idea is that you can take this code and compile it to different platforms with different rendering machanisms: // native with SDL, WebAssembly with HTML5 canvas, etc. The goal seems to be to maximize portability.
Unfortunately only portable to systems with fast CPUs though. Although I guess rendering simple 3d shapes probably runs just fine on low end hardware.
Re: Olive.c: a simple graphics library that does not have any dependencies
#45Earlier quoted context omitted.
Sure, but only if the text file looks like a C string literal, i.e. starts and ends with double quotes (which would make it into a weird text file). Doing const char *s = " #inclued "test.txt" "; won't work, since the preprocessor won't interpret directives inside string literals of course. In many assemblers, there is a directive called "incbin" which pastes in unstructured binary data at the point of usage. I just…
An incbin-like facility is coming to the standard: https://thephd.dev/finally-embed-in-c23
Re: Olive.c: a simple graphics library that does not have any dependencies
#46Earlier quoted context omitted.
Just wait till you find out that you can do: const char *s = #include "test.txt" ;
Sure, but only if the text file looks like a C string literal, i.e. starts and ends with double quotes (which would make it into a weird text file). Doing const char *s = " #inclued "test.txt" "; won't work, since the preprocessor won't interpret directives inside string literals of course. In many assemblers, there is a directive called "incbin" which pastes in unstructured binary data at the point of usage. I just…
float vertices[] = {
#include "stuff.txt"
};Re: Olive.c: a simple graphics library that does not have any dependencies
#47Nice to see tsoding on the top of HN, this guy does amazing streams and youtube video
Re: Olive.c: a simple graphics library that does not have any dependencies
#48Re: Olive.c: a simple graphics library that does not have any dependencies
#49From the readme.