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

Author Topic: SFML 3 - What is your vision?  (Read 273230 times)

0 Members and 4 Guests are viewing this topic.

MorleyDev

  • Full Member
  • ***
  • Posts: 219
  • "It is not enough for code to work."
    • View Profile
    • http://www.morleydev.co.uk/
Re: SFML 3 - What is your vision?
« Reply #15 on: April 25, 2014, 11:14:01 am »
Perhaps we can elaborate what changes are exactly needed to make this happen.

Of the top of my head:
The Windowing API would need to support EGL, GLFW or SDL 1.2 for creating windows.
The Graphics API needs to support the WebGL subset of OpenGL (which is a subset of OpenGL ES 2).
Audio API.
Networking would need porting to WebSockets/WebRTC. Probably easier to drop support of it for Emscripten.
« Last Edit: April 25, 2014, 11:26:11 am by MorleyDev »
UnitTest11 - A unit testing library in C++ written to take advantage of C++11.

All code is guilty until proven innocent, unworthy until tested, and pointless without singular and well-defined purpose.

therocode

  • Full Member
  • ***
  • Posts: 125
    • View Profile
    • Development blog
Re: SFML 3 - What is your vision?
« Reply #16 on: April 25, 2014, 11:17:59 am »
Perhaps we can elaborate what changes are exactly needed to make this happen.
Of the top of my head:
The Windowing API would need to use GLEW to create the window and handle events without any OS specific code (or at least the OS specific stuff is #ifdef'd away).
The Graphics API needs to support the WebGL subset of OpenGL (which is basically OpenGL ES 2).
Audio API.
Networking would need porting to WebSockets/WebRTC. Probably easier to drop support of it for Emscripten.

GLEW or any manual extension loading is not required for emscripten. All supported GL calls work out of the box. The graphics API needs to be ported to work with OpenGL ES 2. Many OpenAL functionalities are supported out of the box by emscripten. Events and windows can be managed using SDL's API out of the box and that could be written as a backend for the window stuff. Networking I have no knowledge about. :D

MorleyDev

  • Full Member
  • ***
  • Posts: 219
  • "It is not enough for code to work."
    • View Profile
    • http://www.morleydev.co.uk/
Re: SFML 3 - What is your vision?
« Reply #17 on: April 25, 2014, 11:21:44 am »
GLEW or any manual extension loading is not required for emscripten. All supported GL calls work out of the box. The graphics API needs to be ported to work with OpenGL ES 2.

Damnit Brain-fart, GLFW. not GLEW xD argh, those aren't confusing similar names at all

As I understood it you have to use EGL (+X11), GLFW, or SDL to create a window for OpenGL. I edited to list them, but doesn't SFML already use GLFW in parts?

Also the Android port I'm guessing uses EGL, so there's already that code available.
« Last Edit: April 25, 2014, 11:26:55 am by MorleyDev »
UnitTest11 - A unit testing library in C++ written to take advantage of C++11.

All code is guilty until proven innocent, unworthy until tested, and pointless without singular and well-defined purpose.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: SFML 3 - What is your vision?
« Reply #18 on: April 25, 2014, 11:28:12 am »
I'm a bit confused. What role is SDL playing in this all? Because I don't think it's really an option to have SDL or GLFW as dependency of SFML... ;D
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

therocode

  • Full Member
  • ***
  • Posts: 125
    • View Profile
    • Development blog
Re: SFML 3 - What is your vision?
« Reply #19 on: April 25, 2014, 11:30:57 am »
GLEW or any manual extension loading is not required for emscripten. All supported GL calls work out of the box. The graphics API needs to be ported to work with OpenGL ES 2.

Damnit Brain-fart, GLFW. not GLEW xD argh, those aren't confusing similar names at all

As I understood it you have to use EGL (+X11), GLFW, or SDL to create a window for OpenGL. I edited to list them, but doesn't SFML already use GLFW in parts?

Also the Android port I'm guessing uses EGL, so there's already that code available.

Aah, then it makes sense :D and yeah you need to use them to create a window, but that can be separated easily into a backend probably. Not sure about GLFW in SFML.

I'm a bit confused. What role is SDL playing in this all? Because I don't think it's really an option to have SDL or GLFW as dependency of SFML... ;D

No, not as a dependency. Emscripten provides that automatically when you compile using it. So you would use the SDL/GLFW API in the emscripten backend as an underlying base for window/event stuff and then you can compile it with emscripten. No need to grab or install SDL or anything.

eike

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: SFML 3 - What is your vision?
« Reply #20 on: April 25, 2014, 11:33:21 am »
Hi,

* I vote for C++-11
* removing sf::clock and sf::thread and friends in favour of the C++-versions of it.
* a technique to insert an event (example: my_triple_mouse_click) to the event loop
* timer events


Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: SFML 3 - What is your vision?
« Reply #21 on: April 25, 2014, 11:38:05 am »
* a technique to insert an event (example: my_triple_mouse_click) to the event loop
Why would you need that? You can easily have a custom event queue on top of SFML's...

* timer events
Can you elaborate?
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

select_this

  • Full Member
  • ***
  • Posts: 130
  • Current mood: just ate a pinecone
    • View Profile
    • darrenferrie.com
Re: SFML 3 - What is your vision?
« Reply #22 on: April 25, 2014, 11:50:40 am »
I'll also throw my hat in for using C++11 where possible, for what it's worth.

I'd like to see some 3D getting in too - not for me, specifically, since I'm a sucker for rolling my own stuff, but because I have a sneaking suspicion that the user base of the library would grow significantly.

Support for more file formats would be great as well. Other than that, I don't really have anything specific to add.
Follow me on Twitter, why don'tcha? @select_this

MorleyDev

  • Full Member
  • ***
  • Posts: 219
  • "It is not enough for code to work."
    • View Profile
    • http://www.morleydev.co.uk/
Re: SFML 3 - What is your vision?
« Reply #23 on: April 25, 2014, 12:31:05 pm »
I'm a bit confused. What role is SDL playing in this all? Because I don't think it's really an option to have SDL or GLFW as dependency of SFML... ;D

You don't need to link them, Emscripten does that automatically. So they're just another part of the #ifdef chain. Emscripten doesn't specify most of it's own window creation functions (it all gets compiled down to canvas HTML and Javascript in the end), but hijacks/reuses a few existing and common cross-platform libraries to provide the hook between canvas and code. There are some emscripten does provide, like getting the size of the canvas.

Going away from Emscripten, C++11. C++11. All of the C++11.

And maybe the ability to hook into the file loading to add custom type support.
« Last Edit: April 25, 2014, 12:46:47 pm by MorleyDev »
UnitTest11 - A unit testing library in C++ written to take advantage of C++11.

All code is guilty until proven innocent, unworthy until tested, and pointless without singular and well-defined purpose.

infinitebox

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: SFML 3 - What is your vision?
« Reply #24 on: April 25, 2014, 12:55:40 pm »
* removing sf::clock and sf::thread and friends in favour of the C++-versions of it.
sf::thread, maybe.
Removing sf::clock is definitely a no no for me. It's a useful utility class and provide higher precision than VC12's std::chrono::high_resolution_clock due to the library not using native high precision API.
Quote
* a technique to insert an event (example: my_triple_mouse_click) to the event loop
* timer events
These could all be done by implementing your own event system on top of SFML's event facilities, which would be more flexible and far superior for your game logic needs. I think sf::Event should be kept to what it is now, for window and input related events.

eike

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: SFML 3 - What is your vision?
« Reply #25 on: April 25, 2014, 01:07:37 pm »
* a technique to insert an event (example: my_triple_mouse_click) to the event loop
Why would you need that? You can easily have a custom event queue on top of SFML's...

There is a little overhead in adding an own event queue. Just call window.pushEvent(myEvent) would be nice.

* timer events
Can you elaborate?

Lets say, you would like to close a window after some seconds, check for network after some time, save a game state on disk every hour and so on. I know, that these things can be done by a thread or checking for the clock every iteration. But I think, that would by a nice to have.


// start timer numer 3, just once after 60 ms
timer3.start(60, false);

...
    if (event.type == sf::Event::Closed)
        window.close();
    else if(event.type == sf::Event::Timer)
    {
        // which timer?
        // do something
    }
...

MorleyDev

  • Full Member
  • ***
  • Posts: 219
  • "It is not enough for code to work."
    • View Profile
    • http://www.morleydev.co.uk/
Re: SFML 3 - What is your vision?
« Reply #26 on: April 25, 2014, 01:23:16 pm »
There is a little overhead in adding an own event queue. Just call window.pushEvent(myEvent) would be nice.

If SFML were to implement a more complex event system, it would be prescribing more details about how the consumers of SFML are to interact with it. Allowing generics to be pushed onto the system would require a callback system of some kind.

Lets say, you would like to close a window after some seconds, check for network after some time, save a game state on disk every hour and so on.

There are other C++ libraries that provide this functionality, and implementing it yourself is not difficult but details are quite dependent on your own current system. Whilst the OS does provide some timer behaviour SFML could hook this into, it seems like a 'Game Framework' feature, not an SFML feature, to me.
« Last Edit: April 25, 2014, 01:34:00 pm by MorleyDev »
UnitTest11 - A unit testing library in C++ written to take advantage of C++11.

All code is guilty until proven innocent, unworthy until tested, and pointless without singular and well-defined purpose.

AxelRantila

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Twitter
Re: SFML 3 - What is your vision?
« Reply #27 on: April 25, 2014, 07:58:06 pm »
* removing sf::clock and sf::thread and friends in favour of the C++-versions of it.
sf::thread, maybe.
Removing sf::clock is definitely a no no for me. It's a useful utility class and provide higher precision than VC12's std::chrono::high_resolution_clock due to the library not using native high precision API.
Doesn't even the SFML tutorial say that you should use C++ 11 threads where possible? If SFML 3.0 makes C++11 fully required, then I could see why it's being removed-

I haven't worked with C++ standard library clocks, but I really think that the sf::clock class should stay

Rosme

  • Full Member
  • ***
  • Posts: 169
  • Proud member of the shoe club
    • View Profile
    • Code-Concept
Re: SFML 3 - What is your vision?
« Reply #28 on: April 25, 2014, 08:54:17 pm »
Lets say, you would like to close a window after some seconds, check for network after some time, save a game state on disk every hour and so on.

There are other C++ libraries that provide this functionality, and implementing it yourself is not difficult but details are quite dependent on your own current system. Whilst the OS does provide some timer behaviour SFML could hook this into, it seems like a 'Game Framework' feature, not an SFML feature, to me.

Plus, if SFML goes full C++11, std::bind, std::function and lambda makes it really easy to do this. And if really you don't want to do it yourself, you can always use Thor TriggeringTimer
GitHub
Code Concept
Twitter
Rosme on IRC/Discord

Cornstalks

  • Full Member
  • ***
  • Posts: 180
    • View Profile
    • My Website
Re: SFML 3 - What is your vision?
« Reply #29 on: April 25, 2014, 09:51:32 pm »
Things I really want:
  • C++11 (non-optional) (C++14 is cool and all, but would have very little impact on SFML's API)
  • Pure OpenGL ES 2.0 back-end
  • Support for OpenGL ES 3.0 context creation (particularly on Android)
  • Enhanced math library (more vector/matrix stuff, up to 4D, and including things like quaternions)
  • Improved HiDPI support (across all OSes)
  • The context stuff mentioned earlier
  • Focused on multitouch rather than mouse
  • Multiple windows
  • More platform introspection (# of logical and physical cores, CPU/GPU type, etc.)
  • Radians, not degrees
  • (Not related to SFML 3, but would be nice to pair with it) Forums that support markdown

Things that would be awesome (but that I can live without):
  • Web/emscripten back-end

Things that I think are cool ideas, but I haven't thought about enough to think if they're bad ideas:
  • Basic 3D graphics support
  • SSL/TSL/SSH support i.e. HTTPS, SFTP, etc.
  • Bluetooth support
  • File I/O stuff? Perhaps just until C++17
« Last Edit: April 25, 2014, 10:02:58 pm by Cornstalks »