So i was looking at the SDL source code and my mind was blown. How long would it ever take a newb to be able write that type of code???
so i took one look at the sdl source code...
Crossbones+ - Reputation: 12813
Posted 18 October 2013 - 05:28 PM
Libraries like that are grown over time - someone didn't set out to code specifically what now exists, but it has grown from version to version, and with each new platform that gets supported.
If you come from a C++ background, have a look at the SFML source code - created mostly by a single person much more recently in history.
Also, what exactly do you mean by "that type of code"? Are you impressed by the number of lines or files? If so, that's not a good measurements for determining the quality of the code.
Because SDL is written in the C programming language, if you use C++ you shouldn't try to mimic the style of the C code, because C++ has different coding styles and recommended guidelines for quality code.
It's perfectly fine to abbreviate my username to 'Servant' rather than copy+pasting it all the time.
All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God. [Need free cloud storage? I personally like DropBox]
Members - Reputation: 859
Posted 19 October 2013 - 12:39 PM
Take comfort in the knowledge that SDL is already written (and open-source) for you to always use rather than having to rewrite something similar yourself.
Also, using SDL with C and C++ is easy. Just like using .NET (C#) is easy whereas if you look through the source code of Mono (or shared source (rotar) versions of Microsoft's .NET) it is incredibly complex.
I tried porting Microsoft's .NET to a modern version of FreeBSD (it originally was created for Windows XP and FreeBSD 4.7). I got as far as the PAL abstraction layer before I started to get the shakes. Now I am writing games until I recover from the experience haha.
Edited by Karsten_, 19 October 2013 - 12:51 PM.
Defile of Eden 2 - FreeBSD and OpenBSD binaries of our latest game.