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

Author Topic: GLFW 3  (Read 18632 times)

0 Members and 1 Guest are viewing this topic.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
GLFW 3
« on: July 13, 2013, 05:08:34 pm »
Hello

I just saw that GLFW 3 was released a few weeks ago, it is quite different from earlier versions. Have you ever considered using it or parts of it for SFML? It provides a lot of features you currently use or you might add in the future:
  • OpenGL and OpenGL ES context creation
  • Very sophisticated window management
  • Input handling: Keyboard, mouse, joystick (might solve the keyboard issue)
  • Support for multiple monitors
  • Clipboard text support
  • High-resolution timer
It would mean another dependency, but you could drastically reduce your code and wouldn't need to reinvent the wheel. Also, GLFW is a pretty lightweight C library.

On the other hand, I might imagine that over the years, you have found specific workarounds and code to handle functionality uniformly across operating systems. There might also be crucial features it does not provide. Anyway, just wanted to bring this into discussion, no need to decide soon :)
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

mateandmetal

  • Full Member
  • ***
  • Posts: 171
  • The bird is the word
    • View Profile
    • my blog
Re: GLFW 3
« Reply #1 on: July 15, 2013, 02:06:10 am »
Another cool feature:

Quote
The window title is a regular C string using the UTF-8 encoding. This means for example that, as long as your source file is encoded as UTF-8, you can use any Unicode characters.

glfwSetWindowTitle(window, "さよなら絶望先生");
- Mate (beverage) addict
- Heavy metal addict _lml
- SFML 2 addict
- My first (and free) game: BichingISH!

FRex

  • Hero Member
  • *****
  • Posts: 1845
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: GLFW 3
« Reply #2 on: July 15, 2013, 02:18:10 am »
You can set sf::Window title to sf::String and you can get sf::String from utf8 encoded const char * or std::string easily.
Back to C++ gamedev with SFML in May 2023

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10801
    • View Profile
    • development blog
    • Email
Re: GLFW 3
« Reply #3 on: July 16, 2013, 02:34:52 pm »
Hmm looks definitely interesting. Maybe if I ever get around to OpenGL, I'll give it a try. :P
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: GLFW 3
« Reply #4 on: July 16, 2013, 02:51:47 pm »
Using it in SFML? No, I think both libraries are at the same level, they are more in competition than complementary ;)

But it's very interesting, now I have a new reference library to add to my list (after SDL and Allegro) ;)
Laurent Gomila - SFML developer

FRex

  • Hero Member
  • *****
  • Posts: 1845
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: GLFW 3
« Reply #5 on: July 16, 2013, 02:58:52 pm »
Really? :(
What about clipboard and open-file-with-default-app? :'(
Or at least the clipboard.
Back to C++ gamedev with SFML in May 2023

Hanmac

  • Newbie
  • *
  • Posts: 20
    • View Profile
    • Email
Re: GLFW 3
« Reply #6 on: July 16, 2013, 03:20:44 pm »
imo the coolest way would be if glfw is an optional depence from sfml,
if glfw exist it uses its features, if not use the allready existing native features

imo it would short the code if sfml uses glfw

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: GLFW 3
« Reply #7 on: July 16, 2013, 03:42:32 pm »
It would be even shorter if SFML used SDL... Seriously, that's really not what SFML is (a thin interface on top of big libraries). SFML uses the lowest possible level of implementation to provide the same stuff that SDL, Allegro, GLFW, etc. provide.

I don't understand why suddenly everyone wants me to use GLFW. It's just another library like SDL and Allegro. And like SFML.
Laurent Gomila - SFML developer

FRex

  • Hero Member
  • *****
  • Posts: 1845
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: GLFW 3
« Reply #8 on: July 16, 2013, 03:46:24 pm »
What about getting clipboard and default app open in SFML?
Back to C++ gamedev with SFML in May 2023

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: GLFW 3
« Reply #9 on: July 16, 2013, 04:03:33 pm »
Quote
What about getting clipboard and default app open in SFML?
What about creating proper feature requests for them? :P
Laurent Gomila - SFML developer

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: GLFW 3
« Reply #10 on: July 16, 2013, 04:27:36 pm »
I don't understand why suddenly everyone wants me to use GLFW. It's just another library like SDL and Allegro. And like SFML.
Because they don't understand what the aim of GLFW/SDL/SFML/Allegro is. They just see these libraries as a set of features, and for a beginner it seems like to include a feature you need to make use of the library itself instead of just reimplementing it yourself. Either you just silently ignore them, or explain to them in a calm manner for the 59273087th time what you just said :). Or you could confuse them even further by asking them what would happen if all libraries just depended on each other to provide functionality :P.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: GLFW 3
« Reply #11 on: July 16, 2013, 04:54:21 pm »
Quote
Or you could confuse them even further by asking them what would happen if all libraries just depended on each other to provide functionality
;D
Laurent Gomila - SFML developer

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Re: GLFW 3
« Reply #12 on: July 16, 2013, 06:44:30 pm »
But it's very interesting, now I have a new reference library to add to my list (after SDL and Allegro) ;)
Okay, good to hear my idea is not useless ;)

Note that I mentioned "the library or parts of it", meaning that for very specific features, you could use their code inline (if the license allows it) or use it as inspiration for your own implementation.

imo the coolest way would be if glfw is an optional depence from sfml,
if glfw exist it uses its features, if not use the allready existing native features

imo it would short the code if sfml uses glfw
Shorten the code? No, because of "if not, use the existing native features". Doing it this way would combine the disadvantages of both approaches and lead to more code, a case differentiation and two incompatible versions of the library.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Re: GLFW 3
« Reply #13 on: July 17, 2013, 11:45:52 am »
Quote
Or you could confuse them even further by asking them what would happen if all libraries just depended on each other to provide functionality
;D

You awaken Cthulhu from his slumber. Good going there!
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

 

anything