Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Using SFML just as a pure GUI tool  (Read 10985 times)

0 Members and 1 Guest are viewing this topic.

Isamu

  • Newbie
  • *
  • Posts: 9
  • Hello, you can call me Isamu.
    • View Profile
    • QLogie
Using SFML just as a pure GUI tool
« on: August 29, 2014, 02:00:30 pm »
Would it make sense to use SFML if you just want to create a GUI application?
Or is SFML too resource heavy?
I thought about decreasing the frame rate limit but maybe SFML is not even that resource heavy..
Imagine you run an SFML application on over 20 clients(server is intended for 30~ clients), I would be surprised if it wouldn't start lagging anytime..

ChronicRat

  • Sr. Member
  • ****
  • Posts: 327
  • C++ programmer
    • View Profile
    • My blog
Re: Using SFML just as a pure GUI tool
« Reply #1 on: August 29, 2014, 02:10:01 pm »
Bad idea.

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Using SFML just as a pure GUI tool
« Reply #2 on: August 29, 2014, 02:18:49 pm »
Quote
Would it make sense to use SFML if you just want to create a GUI application?

No, not really. If all you want is a GUI there is much better libraries out there that are intended to be used as GUI toolkits. SFML is intended for 2d rendering, so if you need that you are probably better off embedding SFML inside one of those other GUI toolkits.

Quote
Or is SFML too resource heavy?

SFML is as heavy (or light) as you make it out to be, if you tell SFML to load 100 textures then it will.   ;)

Quote
I thought about decreasing the frame rate limit but maybe SFML is not even that resource heavy..

Frame rate doesn't really affect how "resource heavy" SFML is. Sure a higher FPS will use a bit more CPU, but I doubt you would notice a difference between 60 FPS and 30 FPS on the CPU usage.

Quote
Imagine you run an SFML application on over 20 clients(server is intended for 30~ clients)

Are you talking running 20 instances of an SFML application on a single machine? Or are you talking networking here meaning a server handling 20 simultaneous network connections?

Bad idea.

Please post something more relevant to the discussion instead of just two words that don't mean that much.
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

Isamu

  • Newbie
  • *
  • Posts: 9
  • Hello, you can call me Isamu.
    • View Profile
    • QLogie
Re: Using SFML just as a pure GUI tool
« Reply #3 on: August 29, 2014, 02:27:37 pm »
Thanks for the answers so far.  :)

I know that there are many other libraries and frameworks that are supposed for GUI, but I think with SFML you just have so much more flexibility. E.g. animations, design, and so on.. Correct me if I am wrong. :)

Are you talking running 20 instances of an SFML application on a single machine? Or are you talking networking here meaning a server handling 20 simultaneous network connections?

I mean a server handling 20~ connections.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Using SFML just as a pure GUI tool
« Reply #4 on: August 29, 2014, 02:29:49 pm »
If you want an OpenGL based GUI toolkit with built-in support for fancy effects, animations, etc. and even a designer and many other tools, have a look at QtQuick and the QML language (it's all part of the Qt framework). I can't see any area where SFML would be better (except if you plan is to rewrite everything from scratch...).
Laurent Gomila - SFML developer

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Using SFML just as a pure GUI tool
« Reply #5 on: August 29, 2014, 02:30:55 pm »
Quote
I mean a server handling 20~ connections.

Depends on what you are doing and how you code your server, but SFML's networking is definitely capable of handing that many connections.
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

Isamu

  • Newbie
  • *
  • Posts: 9
  • Hello, you can call me Isamu.
    • View Profile
    • QLogie
Re: Using SFML just as a pure GUI tool
« Reply #6 on: August 29, 2014, 02:45:41 pm »
If you want an OpenGL based GUI toolkit with built-in support for fancy effects, animations, etc. and even a designer and many other tools, have a look at QtQuick and the QML language (it's all part of the Qt framework). I can't see any area where SFML would be better (except if you plan is to rewrite everything from scratch...).

Thanks for the answer :), I've already used the Qt framework and I've also heard of QML.
Actually, I prefer writing my code in C++. Besides that I feel like QML is not stable yet, but still, I will give it a look. (again)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Using SFML just as a pure GUI tool
« Reply #7 on: August 29, 2014, 03:08:53 pm »
QML is just for the description of the UI. Core components, models, logic, etc. is still written in C++. I use QML at work for professional applications (that run on PC, tablets and smartphones), and I can say that QtQuick and QML are stable enough for creating commercial products.
Laurent Gomila - SFML developer

Isamu

  • Newbie
  • *
  • Posts: 9
  • Hello, you can call me Isamu.
    • View Profile
    • QLogie
Re: Using SFML just as a pure GUI tool
« Reply #8 on: August 29, 2014, 04:18:09 pm »
QML is just for the description of the UI. Core components, models, logic, etc. is still written in C++.

I think I got something wrong there. Are the things you mentioned written in C++ and accessed by QML or can you write C++ code in your QML code?

Quote
I can say that QtQuick and QML are stable enough for creating commercial products.

Your statement makes me kinda feel better about QML and QtQuick now, but still, don't you think that your pool of tools is limited?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Using SFML just as a pure GUI tool
« Reply #9 on: August 29, 2014, 04:56:03 pm »
Quote
I think I got something wrong there. Are the things you mentioned written in C++ and accessed by QML or can you write C++ code in your QML code?
Your whole application can still be written in C++. The QML files just describe some UI that you can load and display with a QtQuick view in your application.

Quote
Your statement makes me kinda feel better about QML and QtQuick now, but still, don't you think that your pool of tools is limited?
I wouldn't say that Qt (even QtQuick alone) is limited compared to SFML...
« Last Edit: August 29, 2014, 04:58:22 pm by Laurent »
Laurent Gomila - SFML developer

ChronicRat

  • Sr. Member
  • ****
  • Posts: 327
  • C++ programmer
    • View Profile
    • My blog
Re: Using SFML just as a pure GUI tool
« Reply #10 on: August 29, 2014, 07:37:37 pm »
Please post something more relevant to the discussion instead of just two words that don't mean that much.
These two words mean all. =)
But if you wish, SFML surely can be used to creation usual application, like the assembler can be used to create games. For example, some users likes light colour theme, some users - dark. In case of using wxWidgets(Qt, etc) application looks like the user want. And the most important - speed of developing such application (based on GUI library) will be faster, much faster, very much faster.

paupav

  • Full Member
  • ***
  • Posts: 156
    • View Profile
    • Email
Re: Using SFML just as a pure GUI tool
« Reply #11 on: August 31, 2014, 10:08:57 pm »
Use GTK+
GTK for the victory!
That's what Elementary OS developers are using. It is backed up by Gnome foundation:



More about GTK:
http://www.gtk.org/tutorial1.2/gtk_tut-1.html

EDIT:
If you are interested gtk+ c++ bindings is called gtkmm.
« Last Edit: September 01, 2014, 01:55:22 am by paupav »

 

anything