Getting Started with SFML

Published August 21, 2019
Advertisement

So far, things are looking just fine trying out SFML.  (Though I'm wondering why there isn't a tag for it here...)

The Visual Studio setup tutorial over on their website strongly cautions that you need to match the download version to your version of Visual C++.  As of this moment, their latest download version is labeled "Visual C++ 15 (2017)".  So far, I have had no problem getting this to work with Visual Studio 2019.  I chose to use static linking, meaning I won't need to include the SFML DLL's in my release.  The only catch to this is with the audio module, which does require "openal32.dll" (one of SFML's dependencies on an external library).

To allow the use of a regular "main" function (instead of "WinMain" or whatever Windows wants these days), there are two steps:

  • You need "sfml-main.lib" (or "sfml-main-d.lib") as a linker input.
  • To ensure that the console doesn't appear, change "SubSystem" to "Windows (/SUBSYSTEM:WINDOWS) under Linker -> System.

Once I get all of the project setup done, I was able to do a few simple tests creating windows, drawing graphics, playing sound, and accepting user input.  I'm feeling ready to go for my "Snake" clone! ?

1 likes 0 comments

Comments

Rutin

I personally love using SFML. I've used Allegro, SDL 1 and 2, and others but I always come back to SFML. :) If I'm working on a quick 2D game I find SFML extremely easy to work with, plus I can just include any custom C++ classes I've made for quick development.

Looking forward to seeing your snake clone! :) 

August 21, 2019 01:01 AM
rileyman

Nice, sounds like I made a decent choice. :)  A friend of mine had mentioned SDL, Cocos, and Godot.  Somehow when I looked around, SFML seemed like a good starting point...

A while back I booked vacation time at the end of August, and it's now upon me.  And this is how I'm going to spend my 3 days off.  LOL ?

August 21, 2019 01:19 AM
Rutin
26 minutes ago, rileyman said:

Nice, sounds like I made a decent choice. :)  A friend of mine had mentioned SDL, Cocos, and Godot.  Somehow when I looked around, SFML seemed like a good starting point...

A while back I booked vacation time at the end of August, and it's now upon me.  And this is how I'm going to spend my 3 days off.  LOL ?

Yep, there are a lot of options out there. The most important thing is to pick something and get started. So many people get caught up in the "which is 'best'" debate forever, or swap around so often they never make progress.

Best of luck!

August 21, 2019 01:47 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement