Alby
Alby

Reputation: 61

SFML vs Qt in C++

I decided to switch from console to windowed programs, so I did a search for the best graphical libraries for C++, and of the many I found, I liked the following ones:

I have to decide which one to use, so having some doubts only I ask you the following questions

  1. When to use Qt and when SFML?

  2. Is SFML only suitable for creating vidiogames or can it also be used to create dekstop apps, or is it better to use Qt for this purpose?

  3. Does SFML already include constructs for desktop apps like buttons?

  4. If I created the same desktop app once with Qt and the other with SFML:

    • which would be faster in execution.

    • which would be lighter in terms of memory usage.

Imagine a simple programme with an input text and a button, where you enter a path to a file to be encrypted, and clicking the button below the input text starts the encryption process

  1. As far as legal terms are concerned:

    • If I were to sell my software realised with the SFML library, would I have to pay them anything?

    • Same question but with Qt

Upvotes: 3

Views: 2771

Answers (1)

nvoigt
nvoigt

Reputation: 77285

When to use Qt and when SFML?

Qt is for any kind of Desktop app that uses a rather standard GUI. SFML is for creating games with their own non-standard GUI.

Is SFML only suitable for creating vidiogames or can it also be used to create dekstop apps, or is it better to use Qt for this purpose?

While you can create a standard desktop application with SFML, it's kinda like creating a model of the river Kwai bridge from toothpicks. Certainly an interesting hobby, but you will need to invest an extraordinary amount of time and patience to create something people will judge an interesting oddity.

Does SFML already include constructs for desktop apps like buttons?

Not in a way you would expect. Not like Qt.

If I created the same desktop app once with Qt and the other with SFML:

which would be faster in execution.

The SFML app.

which would be lighter in terms of memory usage.

The SFML app.

Please note that programming the SFML app to a standard of the Qt app would also probably take 100 to 1000 times as long and much higher skill. So those questions above do not make sense without this context.

It is a little like asking what is more fuel efficient, flying to Sydney or running to Sydney? Well, since running uses zero kerosene, running is more efficient. Just takes a pretty good runner and a lot of time. Well, assuming you are in Australia, otherwise, good luck. So you are not asking the right question here, nobody would run to Sydney based on how much kerosene they save. That is not the correct measurement to base your decision on.

Imagine a simple programme with an input text and a button, where you enter a path to a file to be encrypted, and clicking the button below the input text starts the encryption process

Yes, that is the job of frameworks like Qt, not full screen renderers like SFML. If you don't want 3d fireballs exploding while you do your encryption, stay with Qt.

If I were to sell my software realised with the SFML library, would I have to pay them anything?

No.

Same question but with Qt

No.

Upvotes: 10

Related Questions