r/cpp_questions • • 14d ago

Question wanna get into sfml.

how do i start coding in sfml? which version is the best? i want to use visual studio but i don't like how hardware expensive it is and that it doesn't give easy descriptions of code before i use it. I think using code::blocks is good for me but i want to hear your opinion on which IDE i should use.

Also what is best i start learning using sfml? i already know basic things like shapes, .move, keyboard commands, and textures but where to learn more physique base code and make games similar to factorio and rollercoaster tycoon, sandbox games with a lot of work bts.

5 Upvotes

8 comments sorted by

7

u/YT__ 14d ago

Use whatever ide you want. It doesn't matter.

Just use the latest version of sfml.

Where to learn? On projects. Recreate a (simple) game you like. Build from there. Try new techniques.

1

u/boss123219 14d ago

do you know where i could get step by step guids on making a game project whilst i learn new things?

2

u/YT__ 14d ago

Github for projects using it, sfml subreddit, sfml discord

2

u/saxbophone 14d ago

Happy cake day!

2

u/saxbophone 14d ago

I don't know about tutorials for SFML, but I know both SFML and SDL and "LazyFoo" has a bunch of extensive SDL tutorials. Once I knew a bit of SDL, I found SFML a lot easier as SDL is very low-level, SFML features less boilerplate whilst still allowing you to be expressive and performant.

If I could give one piece of advice about SFML: the drawing routines are deliberately low-level by design. You can do a lot of stuff out of the box, but if you want to draw curved lines, you need to calculate them yourself. That's where the fun comes in!

1

u/the_poope 13d ago

Here are some tutorials for how to use PyGame which is basically a Python wrapper around SDL - a C library very similar to SFML. The concepts are the same, just the language is different. Try to go through the tutorials and examples but using C++ instead.

1

u/HeeTrouse51847 13d ago

I just use SFML 3.0.2 because thats the newest version available on conan lol

3

u/Discordbothost 13d ago

the official tutorials cover window/input/drawing: https://www.sfml-dev.org/tutorials/ . for the Factorio direction, start with a tile grid, camera panning and placing/removing one machine. smaller than a factory sim, but the work carries over.