3 ms·
Not entirely related to the subject of OpenGL, but I really like how the author has decided to lay out this project. It's pretty hard to beat the convenience of
by mnurzia 5y ago
Not entirely related to the subject of OpenGL, but I really like how the author has decided to lay out this project. It's pretty hard to beat the convenience of a single header (or single header/single source) distribution for C libraries, but library development gets progressively harder as the project gets bigger as more code is added to the (usually hard to navigate) header file. Here, the author does their development with multiple files as one normally would, but when a new version is released they run the generate_gl_h[1] script that concatenates everything into a .h file for distribution. Simple yet flexible! This is also how SQLite[2] distributes its builds. It's a pattern that I'm using myself in some unreleased projects.
[1] https://github.com/rswinkle/PortableGL/blob/master/src/generate_gl_h.py https://github.com/rswinkle/PortableGL/blob/master/src/gener...
[2] https://www.sqlite.org/amalgamation.html https://www.sqlite.org/amalgamation.html
- blondin 5y agothe original stb libraries did the same. single header doesn't mean you have to develop in one file, although you totally can.
- mnurzia 5y agoJust because I was curious, I did a little digging: A cursory look at Sean Barrett's website on the Internet Archive lists Dec. 2006 as the first date where stb_image was published (but looking at the file, versions go back much further than that) https://web.archive.org/web/20061205030342/http://nothings.org/ https://web.archive.org/web/20061205030342/http://nothings.o... That means for 15+ years, he's been iterating on the same file. It certainly works as a development style, but I personally feel that it's easier to edit a set of smaller files.
- tom_ 5y agoOriginal forum thread suggesting the first release was in Nov 2006: http://web.archive.org/web/20120419172714/https://mollyrocket.com/forums/viewtopic.php?t=315&sid=1e1583d6149ac8698ea35e20a6333a91 http://web.archive.org/web/20120419172714/https://mollyrocke...
- nmfisher 5y agoI recently discovered this pattern in cgltf (https://github.com/jkuhlmann/cgltf https://github.com/jkuhlmann/cgltf), and I agree, it makes deployment so much nicer.
- johnisgood 5y agoI just love the "Dependencies: None" bits so much! I prefer this as opposed to 900 dependencies.