Programming questions in sfml and c++

Started by
4 comments, last by Captain_black 3 years, 10 months ago

I'm actually new to programming. Well I learnt basic of c++ years back but I don't remember anything now may be within a week I'll learn it. But I want to get into 2d game development. And I think sfml is better for 2d game development and c++. But I've few questions like c++ is pretty big so what are the topics that I should know inorder to develop 2d games with sfml? And any sfml tutorial or websites?

P.s : I'm going to use learncpp.com or A tour of c++ for learning c++.

Advertisement

If you're set on using C++, I suggest you dive right in with some tutorials. You will not need every single language feature to make a game in SFML, but the basics presented by learncpp.com up until chapter 3 (more or less) will need to be covered either way.

Depending on how you learn best (you know this better than anyone else), I can recommend having some smaller personal projects for experimentation, while looking at tutorials and examples. That way, you'll likely have some sort of game before you get around to SFML.

Now SFML is not difficult to use - I use it myself, but there are a number of programming lessons learncpp.com will not teach you.
So keep trying and learning until you get it right.

The official learning resources on SFML are excellent. There are some tutorials elsewhere that are also decent.

@undefined thaks a lot.

C++ is a huge language that is nearly impossible to learn completely, so your objective should be to learn enough for your project, and to learn how to use C++ effectively in a way that you and others can understand.

While you are learning the basics of the language, I think you should stay away from writing your own templates, for example. You'll use a lot of templates from the standard library (std::vector<> is your friend), but you can make all sorts of interesting C++ programs without writing your own templates.

Disclaimer: The rest of this post is not an opinion universally shared by C++ experts.

My own preferred way of learning C++ is to learn C first. C is a small language where a few key ideas allow you to write any program you want. Pretty much everything you learn in C will also work in C++. Then you'll discover that C++ has a lot of very nice features that will make your life easier, including:

  • classes with destructors that are called at well-specified times (this is also known as RAII, which is a terrible name);
  • super-useful containers, like vectors and strings;
  • a neat way of describing interfaces to libraries (and SFML is a great example of how to do this idiomatically in C++, so do imitate its style!);
  • smart pointers,
  • etc.

@undefined thanks

This topic is closed to new replies.

Advertisement