Jump to content

  • Log In with Google      Sign In   
  • Create Account

iGoogleThis

Member Since 31 Aug 2007
Offline Last Active Aug 03 2016 09:18 PM

#5299023 SDL Game Programming in C

Posted by on 04 July 2016 - 10:55 AM

 

They are either not in C or outdated

 

The "not in C" part you'll have to cope with because of your choice to use C rather than C++.  

 

The system by itself is C-based and all that knowledge can be directly used. Tutorials that use C++ stuff should be easily adjusted assuming you actually know C. Note that if you don't know how to program, picking a graphical game system like SDL is not the ideal place to learn the basics.  If you don't already know how to program in the language you should start simple, with 'guess the number', 'tic tac toe', and other simple games instead of complex graphical games.

 

 

 

That out of the way, what specifically do you want to learn about SDL that is not addressed in the links or contents of their wiki (https://wiki.libsdl.org/Tutorials) or documentation?

 

 

 

The way you use SDL does not differ from language to language. If you understand what's going on in a C++ tutorial, you can (usually trivially) write the same program in C (as far as SDL goes). Sure it'd be nice if you could find tutorials that are exactly what you need, but most of the time this won't be the case; you'll always have to change things.

 

One doesn't have pointers as a primary feature, the other does. Hell, both a programmer and a non-programmer can tell you that the syntax in even the classic "Hello World" example does not look the same. I like to use the example that saying "C/C++" in general is like saying "this tutorial is written in Spanish/Italian" while being written in just Spanish. Now imagine people just thought it was "your problem" that you only spoke Italian, really?

 

This debate has been bought up before and on multiple occasions otherwise. It's not much of a discussion since it's fairly obvious, the general consensus is that the two are - surprise - different and should be respected as such. So just because you can learn Portuguese if you know Spanish and vice-versa, doesn't mean you should have to, let alone want to.

 

See: A Raging C/C++ Debate on /r/Programming

 

Now to help out the OP, hint, go back in time. It's possible on the web, read and compile a bunch of those tutorials and go from there.




#5041756 String handling in C

Posted by on 11 March 2013 - 02:29 AM

Could be worse, could be a web of pointers so convoluted that they point to nothing while trying to point to some embedded function, with an over-called string in it that still works for some reason.  *shudders*




PARTNERS