handmade.network » Forums » What codebases are doing it well?
Muzz
Murry Lancashire
25 posts

Aspiring Polymath.

#6668 What codebases are doing it well?
1 year, 6 months ago

What's a forum without some discussion.

So I have a question to all of the more experienced guys here. What are some of your favorite open source, or available code bases do you know of that you consider to be truly high quality, and make it as easy for other programmers to integrate and build code as possible.

I get that the point of handmade is to build from scratch, but often a great way to learn is to dig into other peoples code. For example, looking around at game engines, everything is OOP to a point where most engines don't even bother to mention that.

So I guess, what are the codebases you look to for inspiration about how you make your own projects, and why is it good?

Is there particular things you prefer to see such as Casey being able to build 4coder straight away with a batch file rather than having to mess with yet another Makefilegeneratorninja3000 that you wish other coders would push to do?
ZedZull
Jay Waggle
10 posts

insobot++

#6700 What codebases are doing it well?
1 year, 6 months ago

It may be an obvious choice (though of course not so obvious if you aren't familiar), but the excellent libraries created by Sean Barrett fit the descriptions of "truly high quality" and "as easy to integrate and build as possible" near perfectly. It's amazing how your quality of life can increase when you don't need to fuss with attempting to configure and build a library before you can even try using it.

Sean also maintains an extensive list of other libraries created in the same fashion.

GingerBill created this collection of general purpose single-header libraries as well.
ZedZull
Jay Waggle
10 posts

insobot++

#6702 What codebases are doing it well?
1 year, 6 months ago

For a non-library project, I want to give a shout out to Martin Cohen's Punity game engine. The absolute minimalism of that project is inspiring to me, and its self-imposed limitations feels like programming for a Game Boy.
ApoorvaJ
Apoorva Joshi
18 posts
1 project

GPU tinkerer

#6711 What codebases are doing it well?
1 year, 6 months ago Edited by Apoorva Joshi on April 30, 2016, 8:58 p.m.


I get that the point of handmade is to build from scratch, but often a great way to learn is to dig into other peoples code.


The point of Handmade (at least as per my interpretation) isn't to build everything yourself from scratch. It is to have an understanding of what is occurring under the hood when your program runs.

If everyone wrote everything from scratch, we wouldn't get anything done. We as programmers already spend too much time independently solving the same problems over and over again. < /rant >

I've been using Omar Cornut's ImGui to make UI for an image editor I'm working on, and I've found the source code to be very readable, and I've also picked up a number of C/C++ tricks from it. I highly recommend you take a look if you haven't already.

Sean's stb libraries are hugely awesome to work with, but they have been optimized for performance and extensibility (e.g. custom allocators and various macro-controlled options), and can be a bit formidable for newcomers to dig into.

None
Muzz
Murry Lancashire
25 posts

Aspiring Polymath.

#6732 What codebases are doing it well?
1 year, 6 months ago


The point of Handmade (at least as per my interpretation) isn't to build everything yourself from scratch. It is to have an understanding of what is occurring under the hood when your program runs.


Ok i like that, seems like a much better definition than what i said.

I had a feeling the stb libraries were going to be mentioned, but they of course should be brought up. I was trying play with punity before martin cleaned up his codebase properly, so I'll need to give it another shot. I shot him a tweet a few days back saying he should get this setup as a handmade project.

Thanks!
strangezak
Zakary Strange
44 posts
3 projects

A C++ Programmer working on Squad professionally, and Proportion during my free time.

#6735 What codebases are doing it well?
1 year, 6 months ago

Ah... Off the top of my head besides GingerBill's and the STB libraries there are no really good public examples of code. This is something we plan on tackling with Ludus (a big project a bunch of people in the handmade community are working on). As we plan on having the source code available, but not for free.

An angry programmer.
Muzz
Murry Lancashire
25 posts

Aspiring Polymath.

#6736 What codebases are doing it well?
1 year, 6 months ago

Oh cool that should be really cool to see come together. How much are you thinking of charging for source code access?
Hjortshoej
Mikkel Hjortshøj
64 posts
1 project

Life is insane... Which is why I spend it with beer <3

#6737 What codebases are doing it well?
1 year, 6 months ago

MILLIONS UPON MILLIONS OF PENNIES! SHIPPED TO DENMARK! (joke obviously)

Give a man a beer, and he is happy... End of story.
Valmar
Kyle Devir
32 posts
#6738 What codebases are doing it well?
1 year, 6 months ago Edited by Kyle Devir on May 1, 2016, 6:21 a.m.

SDL2 (https://www.libsdl.org/) is another excellent codebase. Greatly simplifies some cross-platform stuff. Fast, has very little overhead, not bloated. SDL2's codebase is cleanly laid out. There are games written entirely in SDL2 that have been ported to platforms other than the one it was written for without any changes to the code. There was a particular video that showcased this well, but I can't seem to find it...

Edit: here we go: https://youtu.be/MeMPCSqQ-34?t=1266

I guess there's few who don't know about SDL, but thought I'd throw it out there anyway.
Muzz
Murry Lancashire
25 posts

Aspiring Polymath.

#6739 What codebases are doing it well?
1 year, 6 months ago

I think mentioning what popular codebases are good should be encouraged. Not everyone has had a chance to dig into the code and know what is good.
mmozeiko
Mārtiņš Možeiko
1503 posts
1 project
#6740 What codebases are doing it well?
1 year, 6 months ago

Here's some stuff I can think right off the top of my head.

GLFW is similar to SDL2, but much simpler functionality (no renderer): https://github.com/glfw/glfw
SDL2 and GLFW are two of my favorite libraries for figuring out platform specific bits for windows/events/input.

miniz - single file zip manipulation library: https://github.com/richgel999/miniz

c99-snprintf - single file portable implementation of snprintf function: https://github.com/weiss/c99-snprintf

c4 - pretty cool subset of C interpreter with just 4 functions (it can interpret itself) https://github.com/rswier/c4

webby - two file (h/c) tiny http webserver for game development: https://github.com/deplinenoise/webby

mongoose - two file (h/c) feature rich webserver (http, websockets, json-rpc, and more), useful for embedded environments, unfortunetaly it changed license from MIT to GPL at some point: https://github.com/cesanta/mongoose

xbyak - cool C++ header library to JIT assembly code: https://github.com/herumi/xbyak

asmjit - similar to xbyak, but bigger library: https://github.com/kobalicek/asmjit

nedtries - C and C++ header file that implements efficient in-place bitwise binary Fredkin trie algorithm (std::map/set alternative): https://github.com/ned14/nedtries

jsmn - two file (h/c) super minimalistic C json parser (actually it's more tokenizer than parser), doesn't use any dynamic memory allocations: https://github.com/zserge/jsmn

sxml - same as jsmn, but for xml files: https://github.com/capmar/sxml
Muzz
Murry Lancashire
25 posts

Aspiring Polymath.

#6744 What codebases are doing it well?
1 year, 6 months ago

Hell Yeah, tons of stuff to look at then :D!!!

I'm going to have a busy week reading code.


Has anyone had a play with BGFX, for a rendering library? I've had a play and i like what I see, but again I'm not a good enough coder to judge the codebase.
https://github.com/bkaradzic/bgfx
strangezak
Zakary Strange
44 posts
3 projects

A C++ Programmer working on Squad professionally, and Proportion during my free time.

#6747 What codebases are doing it well?
1 year, 6 months ago

For basic access a very small fee. Think around $5 a month

An angry programmer.
MattHartley
Matt Hartley
19 posts
I like to program the things.
#6752 What codebases are doing it well?
1 year, 6 months ago

I often look at the Quake source code (or any of the old id games really).
https://github.com/id-Software/Quake

Philip Buuck is doing a series of videos called Handmade Quake where he goes though the Quake source code and recreates the game which really interesting. https://www.youtube.com/user/philipbuuck/featured

There's also some games that use the Quake engine that have had their source released, including Jedi Outcast and Jedi Academy which are two of my favorite games.
https://github.com/grayj/Jedi-Academy
https://github.com/grayj/Jedi-Outcast
MattHartley
Matt Hartley
19 posts
I like to program the things.
#6753 What codebases are doing it well?
1 year, 6 months ago Edited by Matt Hartley on May 1, 2016, 7:37 p.m.

Handmade Quake is on this site actually, forgot about that.

https://hmq.handmade.network/