• Advertisement
Sign in to follow this  

SDL Game Programming in C

This topic is 621 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello I am learning C and I want to make games in C with SDL. However I couldn't find any good resource for learning SDL in C except a handful of youtube tutorials. Any advice on how to use SDL with C?

Share this post


Link to post
Share on other sites
Advertisement
I know what you mean. There is a c/SDL game programming tutorial on youtube.
But in any case it's not difficult to translate c++ tutorials to plain C.
It requires effort, mostly because you loose all the nice things of C++ (like classes or standard containers...).
I did the experiment though, I did not complete a full game but I can put my code on github if you wish to read it.

Share this post


Link to post
Share on other sites

SDL is a C API so any SDL tutorial you find is going to be valid, at least so far as the SDL elements are concerned.

 

Maybe you need to improve your C a bit more first...

Share this post


Link to post
Share on other sites

You may want to check out the FLARE engine. This is how I started with SDL a few years back. Not a tutorial per se, but it may help you understand some concepts or how you do certain things. I think it's in C++ but the concept is the same.

Share this post


Link to post
Share on other sites

SDL is a C API so any SDL tutorial you find is going to be valid, at least so far as the SDL elements are concerned.

 

Maybe you need to improve your C a bit more first...

Yes, I am fairly new to C. I am trying to improve but my main goal is to make games so I just want to find places to learn when the time comes 

Share this post


Link to post
Share on other sites

I know what you mean. There is a c/SDL game programming tutorial on youtube.
But in any case it's not difficult to translate c++ tutorials to plain C.
It requires effort, mostly because you loose all the nice things of C++ (like classes or standard containers...).
I did the experiment though, I did not complete a full game but I can put my code on github if you wish to read it.

Yeah I am trying to translate some tutorials but I am not advanced in c or c++ so its hard. I'd love to read your code.

Share this post


Link to post
Share on other sites

You may want to check out the FLARE engine. This is how I started with SDL a few years back. Not a tutorial per se, but it may help you understand some concepts or how you do certain things. I think it's in C++ but the concept is the same.

I will check it out thanks

Share this post


Link to post
Share on other sites
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?

 

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement