SFML community forums

General => General discussions => Topic started by: eXpl0it3r on April 24, 2014, 01:37:42 pm

Title: SFML 3 - What is your vision?
Post by: eXpl0it3r on April 24, 2014, 01:37:42 pm
As promised we as the new team, would like to be more open towards the community especially regarding the current development. We're currently discussing on how to approach things after SFML 2.2 and as such, we need to figure out what SFML 3.0 should actually be about.

Keep in mind this shouldn't really be about simple feature requests, for that we have dedicated forum, this should be more about what SFML 3 should offer besides a few new feature. For example: How the graphics API should be changed/opened/advanced, or whether C++11 should be non-optional, or should we change the way window states are handled, or etc...
We won't make any decisions here, we simply want to hear the ideas from all community members.

What is your vision of SFML 3?
Title: Re: SFML 3 - What is your vision?
Post by: Oldie on April 24, 2014, 02:21:17 pm
C++11 is by now almost entirely supported by major compilers. Also SFML 3 is still far away, which means there is more time for the last C++11 features to be supported. With this in mind, I think there is no doubt that SFML 3 should be using C++11 in its implementation as well as in its public API, and therefore make it not optional.
C++1y should wait though, as the norm is not definitive yet.
Title: Re: SFML 3 - What is your vision?
Post by: infinitebox on April 24, 2014, 02:56:15 pm
Things I could think of on top of my head:
Pretty please! :)

updated: I remembered more!
Title: Re: SFML 3 - What is your vision?
Post by: Veltas on April 24, 2014, 03:46:13 pm
Okay, I hope this doesn't count as off-topic.

Firstly, how exactly does optional C++11 work? You could insert new features that define code better or swap-out with older style code, like override, or nullptr etc.?

And then secondly, if there's discussion to be had on
Quote from: eXpl0it3r
whether C++11 should be non-optional,
then what advantages could there be in designing the library around the latest C++ standard?

Also, C++14 is due soon enough, and VS, GCC and clang will also support it soon enough (if Herb Sutter's projections for VS weren't too optimistic). Would it be worth using C++14 in place of C++11?
Title: Re: SFML 3 - What is your vision?
Post by: Doodlemeat on April 24, 2014, 03:55:56 pm
You can take a look at the Kinetic framework (http://kineticjs.com) which is written in JavaScript.
It has really nice features like transitions, tweening, group/layer -rendering and neat on-events like onClick, onHover and so on... This clearly fits within the multimedia limit.
Title: Re: SFML 3 - What is your vision?
Post by: eXpl0it3r on April 24, 2014, 04:09:25 pm
Firstly, how exactly does optional C++11 work? You could insert new features that define code better or swap-out with older style code, like override, or nullptr etc.?
Not sure, moste likely with a lot of ugly #ifdef, I just add the non-optional thing to make it clear and since currently there's optional C++11 support (https://github.com/SFML/SFML/issues/129) targeted for 2.x - which ofc could change.

Also, C++14 is due soon enough, and VS, GCC and clang will also support it soon enough (if Herb Sutter's projections for VS weren't too optimistic). Would it be worth using C++14 in place of C++11?
It's really to early to tell for sure, C++14 is still just a draft and how fast compiler vendors will implement the proposal is also an open question.
However since the proposed features are not very complex, they most likely won't have an influence on designing SFML 3, thus it's not very important at the moment and we can decide once we get there.

You can take a look at the Kinetic framework (http://kineticjs.com) which is written in JavaScript.
It has really nice features like transitions, tweening, group/layer -rendering and neat on-events like onClick, onHover and so on... This clearly fits within the multimedia limit.
It would be nice, if you could elaborate on things a bit more, especially given that JavaScript and C++ aren't easily comparable in certain regions. It would be especially interesting to hear your thoughts on the event things that you mentioned.
Title: Re: SFML 3 - What is your vision?
Post by: Jesper Juhl on April 24, 2014, 04:31:48 pm
My personal wish list (at least the bits I can remember right now):

- C++11 non-optional.
- Integrate parts of Thor into SFML proper (stuff like the vectors, big texture, clock and math bits).
- Improved iOS and Android support.
- Official support for FreeBSD.
- Get something like BuildBot or Jenkins up and running so we can get continuous integration up and running (build every commit on all supported platforms + run tests for each build).
- Native support for playing video.
Title: Re: SFML 3 - What is your vision?
Post by: ChronicRat on April 24, 2014, 04:41:20 pm
I need only shaders in OpenGL ES port. =) And, i think, base support of 3D may be? I see slogan - SFML3 is SFML3D! =)
Title: Re: SFML 3 - What is your vision?
Post by: Ricky on April 24, 2014, 07:21:27 pm
Since I don't really feel limited by SFML (yet) I don't really know what I can say but I think these ideas would be cool:
Use modern openGL under the hood and expose more openGL through the API for advanced users
Incorporate community projects that I feel should have been part of SFML from the start (SFNUL, 3DEE)

I'm glad to see my favorite open source project receive a second life! Goodluck guys!
Title: Re: SFML 3 - What is your vision?
Post by: AbelToy on April 24, 2014, 07:57:41 pm
A way to make sprite batching easier to use and more integrated with SFML.
Title: Re: SFML 3 - What is your vision?
Post by: therocode on April 24, 2014, 09:17:09 pm
Two things that I'd find awesome are these:

1.
If possible, render and audio context management. In other words, separate the contexts out from the Window and wherever it is stored for the audio into sf::RenderContext and sf::AudioContext and provide an API for using custom contexts. This would make it way easier to integrate SFML in certain situations and would mean better ownership-based design with less magic stuff going on. That magic stuff is sure arguably easier and more simple but I find that in the long run, it is a drawback.

2.
I am a fan of Emscripten and I have written some code in my own game framework to make it compatible with emscripten out of the box. This means that any game I make with my framework, I can easily compile to have it run in the browser. Some silly examples: bladepit (http://pallkars.net/~zagabar/bladepit/)  ants (http://kim.pallkars.net/ants/)   space (http://pallkars.net/~zagabar/theoperation/). As you can see they run with good framerates and it is just javascript and webgl so will work on pretty much any browser that supports that. :) Would be neat to have web-compile capabilities for SFML as well!

For emscripten support, what is required is a special way of handling the main loop so that the browser doesn't freeze, and compiling all the dependencies, and tieing browser events to the SFML events. It could be hard to support _all_ the features of the Window module since the browser app acts pretty different to a desktop application but that can be alright imo as long as it is well documented.
Title: Re: SFML 3 - What is your vision?
Post by: Laurent on April 24, 2014, 11:36:33 pm
Quote
If possible, render and audio context management. In other words, separate the contexts out from the Window and wherever it is stored for the audio into sf::RenderContext and sf::AudioContext and provide an API for using custom contexts. This would make it way easier to integrate SFML in certain situations and would mean better ownership-based design with less magic stuff going on. That magic stuff is sure arguably easier and more simple but I find that in the long run, it is a drawback.
I totally agree with that.

Quote
Would be neat to have web-compile capabilities for SFML as well!
This is less likely to happen. But if someone provides an implementation, why not.
Title: Re: SFML 3 - What is your vision?
Post by: eigenbom on April 25, 2014, 12:45:49 am
C++11 required
Filesystem api
Opengles
Support for all modern platforms including Xbox, ps4, and web via emscripten
More interesting suite of demos

I can dream right? :)
Title: Re: SFML 3 - What is your vision?
Post by: therocode on April 25, 2014, 07:42:39 am
Quote
Context stuff.
I totally agree with that.
Awesome! :D

Quote
Would be neat to have web-compile capabilities for SFML as well!
This is less likely to happen. But if someone provides an implementation, why not.
Ah, any particular reason why it is not likely to happen? Running things in the browser is all the rage these days.
Title: Re: SFML 3 - What is your vision?
Post by: Tank on April 25, 2014, 08:33:50 am
Quote
Ah, any particular reason why it is not likely to happen? Running things in the browser is all the rage these days.
I think because nobody on the team has a single clue of how that's going to work. Perhaps we can elaborate what changes are exactly needed to make this happen. With help from someone who has a good knowledge of emscripten we can probably work something out.
Title: Re: SFML 3 - What is your vision?
Post by: MorleyDev 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 (https://github.com/kripken/emscripten/wiki/OpenGL-support) (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.
Title: Re: SFML 3 - What is your vision?
Post by: therocode 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
Title: Re: SFML 3 - What is your vision?
Post by: MorleyDev 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 (https://github.com/kripken/emscripten/wiki/EGL-Support-in-Emscripten) (+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.
Title: Re: SFML 3 - What is your vision?
Post by: eXpl0it3r 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
Title: Re: SFML 3 - What is your vision?
Post by: therocode 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 (https://github.com/kripken/emscripten/wiki/EGL-Support-in-Emscripten) (+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.
Title: Re: SFML 3 - What is your vision?
Post by: eike 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

Title: Re: SFML 3 - What is your vision?
Post by: Nexus 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?
Title: Re: SFML 3 - What is your vision?
Post by: select_this 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.
Title: Re: SFML 3 - What is your vision?
Post by: MorleyDev 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.
Title: Re: SFML 3 - What is your vision?
Post by: infinitebox 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.
Title: Re: SFML 3 - What is your vision?
Post by: eike 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
    }
...
Title: Re: SFML 3 - What is your vision?
Post by: MorleyDev 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.
Title: Re: SFML 3 - What is your vision?
Post by: AxelRantila 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
Title: Re: SFML 3 - What is your vision?
Post by: Rosme 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 (http://www.bromeon.ch/libraries/thor/v1.1/doc/classthor_1_1_triggering_timer.html)
Title: Re: SFML 3 - What is your vision?
Post by: Cornstalks on April 25, 2014, 09:51:32 pm
Things I really want:

Things that would be awesome (but that I can live without):

Things that I think are cool ideas, but I haven't thought about enough to think if they're bad ideas:
Title: Re: SFML 3 - What is your vision?
Post by: infinitebox on April 26, 2014, 03:38:22 am
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-
You are right. Personally I use std::thread and have never used sf::Thread.
I think I confused sf::Thread with some other API that exposes functionalities such as setting priority, and pause and resume :P
The sf::Thread's delayed thread launch looks nice though.

Title: Re: SFML 3 - What is your vision?
Post by: therocode on April 26, 2014, 09:03:54 am
Things I really want:
  • Enhanced math library (more vector/matrix stuff, up to 4D, and including things like quaternions)

IMO there are absolutely no reasons to add advanced maths stuff since there are other libraries doing that and being focussed on it. GLM for example is headers only and has heaps of functionality related to 3D graphics maths. Adding a maths module to SFML would only mean more maintenance and reinventing the wheel.
Title: Re: SFML 3 - What is your vision?
Post by: Lambert on April 26, 2014, 04:33:54 pm
Simple and Fast Multimedia Library

By downloading and using such named thing, I would expect simple and fast coding. SFML is one of few good libraries known to me that support full OOP (and by fully I mean it's really simple to use, for example Qt is unintuitive, especially with main function design), which is insanely helpful. However your library should be scalable. It should be as good for newbies as for pros. That's why you should add simple demos and free stuff for first-time-use. Some free music, textures etc. Also default font would be nice improvement. I never understood why original author didn't include it.
 
As it goes for pros, I think that adding 3D support is obligatory. I don't know any fully OOP libraries (with such good API as SFML) supporting 3D and it isn't so hard I think, it just need good packing OpenGL functions into classes and a bit of optimization.

Native supports for widgets. I know I can import another library or create my own GUI, but neither is simple nor fast.

As it comes for C++11 and C++14 I don't see any reason to not make them obligatory. Compilers that won't support these features when SFML 3 would be released will be greatly outdated and there is no reason to outdate SFML itself because of it.

Advanced functions, like mentioned above mathematical operations on vectors in etc. should be also included. "Fast" means for me not only that program itself will be fast, but also that I won't have to waste my time looking for additional dependencies, while "Simple" means that everything what is needed to create game or application (from programming side ofc, not resources) will be provided to me in an easy, simple way. It won't affect library efficiency as everything is modular and I include only these files I want to include.


Worst you can do is to expect people to install hundreds of additional libraries to make their games and apps work, just because "they can do it". We are not talking about SFML 2.x, but SFML 3 and it's long-time project, so there is no reason to reject any idea just because it's "time wasting" and "it is already done in XYZ library".
Title: Re: SFML 3 - What is your vision?
Post by: Nexus on April 26, 2014, 04:56:59 pm
That's why you should add simple demos and free stuff for first-time-use. Some free music, textures etc. Also default font would be nice improvement. I never understood why original author didn't include it.
There are many code examples to show the various parts, so what do you mean? SFML provided a default font in earlier versions, but it was removed (if you're interested in the reasons, search the forum, there was a discussion about it).
Title: Re: SFML 3 - What is your vision?
Post by: therocode on April 26, 2014, 05:05:58 pm
Worst you can do is to expect people to install hundreds of additional libraries to make their games and apps work, just because "they can do it". We are not talking about SFML 2.x, but SFML 3 and it's long-time project, so there is no reason to reject any idea just because it's "time wasting" and "it is already done in XYZ library".

By this logic you would expect SFML to ship AI, state management, path-finding, physics, scenegraph management, dynamic resource loading, a whole set of GUI components, astrophysics simulation, car assembly algorithm, face recognition, and who knows where we'd stop.

SFML is a multimedia library, not a game development suite. I don't believe there are enough developers to cover up for all the time and management that would be needed if SFML would greatly increase its scope. Also, just because SFML doesn't include everything does not make you need "hundreds" of dependencies. You only need to grab the ones you want.

I would rather see that time is put into refining what the concept of SFML is, make the API great, extend its feature set within the scope and do it well like no other multimedia library out there.
Title: Re: SFML 3 - What is your vision?
Post by: Cornstalks on April 26, 2014, 10:21:32 pm
IMO there are absolutely no reasons to add advanced maths stuff since there are other libraries doing that and being focussed on it. GLM for example is headers only and has heaps of functionality related to 3D graphics maths. Adding a maths module to SFML would only mean more maintenance and reinventing the wheel.
I'm not asking for the whole kitchen sink (I said "enhanced," not "advanced"). The thing is SFML already provides vectors and matrices. And these aren't things that can be stripped out of SFML, as coordinates and transforms need to be specified for SFML to do its work. But these things SFML provides have no support for basic linear operations (dot/cross products, projections, etc.). It would be nice if common operations and data types (i.e. quaternions, particularly if 3D support is added) were supported.
Title: Re: SFML 3 - What is your vision?
Post by: Njifra on April 27, 2014, 12:33:38 am
Hmmmm... Maybe there should be enum sf::DriverType, something like in Irrlicht 3D Engine...

Definition:
enum DriverType
{
        OpenGL,
        DirectX9
};
 

Usage:
window.create(sf::DriverType::OpenGL, ...\*other params*\);
 

I can help with it(if help is needed) since im expirienced with DirectX9...
Please reply

Title: Re: SFML 3 - What is your vision?
Post by: zsbzsb on April 27, 2014, 01:43:56 am
You are talking different backends, this isn't as simple as you think and would require a complete redesign of SFML internally.
Title: Re: SFML 3 - What is your vision?
Post by: therocode on April 27, 2014, 07:31:32 am
I'm not asking for the whole kitchen sink (I said "enhanced," not "advanced"). The thing is SFML already provides vectors and matrices. And these aren't things that can be stripped out of SFML, as coordinates and transforms need to be specified for SFML to do its work. But these things SFML provides have no support for basic linear operations (dot/cross products, projections, etc.). It would be nice if common operations and data types (i.e. quaternions, particularly if 3D support is added) were supported.

Still, it seems to me that SFML's math classes are there to make SFML work on the inside, not to provide advanced maths functionality to the user. If maths is needed in your project it is still super easy to grab GLM, it is a very light dependency being headers only.

Although, in my opinion the best alternative would be to discard the SFML maths classes and instead use GLM directly. That way you can do all the maths you want and it would still integrate well with SFML and you would not have to rewrite a lot of maths.
Title: Re: SFML 3 - What is your vision?
Post by: Njifra on April 27, 2014, 11:14:54 pm
You are talking different backends, this isn't as simple as you think and would require a complete redesign of SFML internally.

Thats why I offered my help. Im making multimedia library with DirectX and I did almost everything(except sound). Now im working on mesh loading. So im pretty sure I could help(if its needed xD).

Soon, my lib will be SFML's rival ;)
Title: Re: SFML 3 - What is your vision?
Post by: stoleks on April 27, 2014, 11:35:55 pm
multimedia library with DirectX
In fact I don't see the point of using DirectX (especially with an obsolete version like directX9, I'm not very familiar with directX, but this version is almost 6 year old, no ?), and in my mind OpenGL is faster and cross platform (perhaps I'm wrong..).
Title: Re: SFML 3 - What is your vision?
Post by: Njifra on April 27, 2014, 11:57:44 pm
DirectX 10 and 11 also exist.
DirectX 12 is coming soon.
;)
Title: Re: SFML 3 - What is your vision?
Post by: Ixrec on April 28, 2014, 12:00:45 am
I guess we'll need DirectX if SFML ever gets ported to the Xbox and Windows Phone.

Maybe in SFML 10.
Title: Re: SFML 3 - What is your vision?
Post by: NoobsArePeople2 on April 28, 2014, 01:08:55 am
I feel that SFML 2.x does a good job of covering the basics. Want to open a window? Use the keyboard and mouse? Draw some stuff to the screen? All that stuff just works and is simple to use. I'm not saying these things can't be improved but I feel that the core of SFML is pretty good.

I think one place where SFML drops the ball a bit is when it comes to scenarios that aren't clearly part of the core of a multimedia library. Another problem is that SFML becomes a lot less simple once you start on a non-trivial app.

For example, it's simple and fast and easy to load up a texture and display it with a sprite but once you start having a lot of sprites and performance falls into the gutter you have to fall back to sf::VertexArray and really get your hands dirty in managing all your sprites to optimize drawing, which is pretty low-level and not something typically characterized as "simple" ;). Adding something like sf::SpriteBatch that would take sf::Sprites as children could allow for quick an easy batching of draw calls reducing the friction of using SFML for a common task.

The things I'd like to see are about expanding utility and making SFML simpler and easier to use as apps become more complex.


These are community related but I think worth mentioning for a "vision" of what SFML can become:

Another thing that I think would be informative is to try to find people who have used SFML in the past but moved away from it for one reason or another. Finding out what lead them to drop SFML for ____ will likely shed some additional light on SFML's deficiences. You might have to look them up and contact them directly but I do see people in the forums and github tracker stating things along the lines of, "oh, it's cool you finally fixed this but I've since switched to SDL."
Title: Re: SFML 3 - What is your vision?
Post by: Canadadry on April 28, 2014, 10:00:42 am
You are talking different backends, this isn't as simple as you think and would require a complete redesign of SFML internally.

You can use ANGLE to do that, Qt is using it to provide OpenGL ES or DirectX on Windows http://qt-project.org/wiki/Qt-5-on-Windows-ANGLE-and-OpenGL (http://qt-project.org/wiki/Qt-5-on-Windows-ANGLE-and-OpenGL)

I also like to have some of QML (from Qt) capabilities ie : (Which are also present in JavaFX take a look)
For game purpose I see everyone re-developping the same thing :

This is the few thing I've been rewriting over and over again from the past years, for every game I made.
To illustrate the SceneGraph stuff take a look at one of my last project I'm working on https://github.com/Canadadry/PineApple/blob/master/src/main.cpp (https://github.com/Canadadry/PineApple/blob/master/src/main.cpp)
Title: Re: SFML 3 - What is your vision?
Post by: therocode on April 28, 2014, 10:13:10 am
Support texture packer.

The other week I tried using texture packer but it is not a free product. You have to pay to use it and the trial version makes some sprites red with the text "trial version" on them. IMO SFML which is a free library should not integrate with non-free products.
Title: Re: SFML 3 - What is your vision?
Post by: Deathbeam on April 28, 2014, 11:36:23 am
I think SpriteBatch would be great addition for SFML 3 and it is even not that hard to do.
Title: Re: SFML 3 - What is your vision?
Post by: eXpl0it3r on April 28, 2014, 11:49:33 am
It's nice seeing all this feedback, rest assure we'll be discussing most of the points and some have already been kind of agreed on before this thread started. ;)

As for sprite batching, you suggest it as addition to the normal sprite rendering, but is there any advantage not to batch all sprites or what's the difference between batching and non-batching?
Title: Re: SFML 3 - What is your vision?
Post by: Deathbeam on April 28, 2014, 04:13:13 pm
It's nice seeing all this feedback, rest assure we'll be discussing most of the points and some have already been kind of agreed on before this thread started. ;)

As for sprite batching, you suggest it as addition to the normal sprite rendering, but is there any advantage not to batch all sprites or what's the difference between batching and non-batching?
You can sort them, pass same values easily to large group of sprites (for example, when user do not want to use views becouse it is corrupting drawing of his GUI - yep that is my case - you can do it like XNA, and so passing camera with transformation matrix to sprite batch), pass blending to large group of sprites easily and so. Imo, sprite batch is better for bigger projects, and for small ones, it is better to use normal rendering (becouse it is pointless to create new spritebatch f.e. for 2 sprites). Look for example at my implementation of SpriteBatch to my engine. It is working exactly like drawing sprites to RenderWindow, you can pass there IDrawable (for example Sprite) and spritebatch will enqueue it. It is highly modified version of krzat´s spritebatch https://bitbucket.org/krzat/sfml.utils/src/ce2ec1656e13424141b23583b495197b60bd2fcf/SpriteBatch.cs?at=master

P.S Sorry for my english ;)
Title: Re: SFML 3 - What is your vision?
Post by: eXpl0it3r on April 28, 2014, 04:26:20 pm
Isn't that mixing two different concepts? What has been discussed here before was sprite batching as in making something like a vertex array more automated/accessible. While what you describe sounds more like a node system. Is that the same?

(for example, when user do not want to use views becouse it is corrupting drawing of his GUI - yep that is my case - you can do it like XNA, and so passing camera with transformation matrix to sprite batch)
Sounds like you didn't understand how to use views properly. You can use multiple views to render things independently without "corrupting drawing", unless you meant something else.
Title: Re: SFML 3 - What is your vision?
Post by: Deathbeam on April 28, 2014, 04:44:40 pm
Isn't that mixing two different concepts? What has been discussed here before was sprite batching as in making something like a vertex array more automated/accessible. While what you describe sounds more like a node system. Is that the same?

(for example, when user do not want to use views becouse it is corrupting drawing of his GUI - yep that is my case - you can do it like XNA, and so passing camera with transformation matrix to sprite batch)
Sounds like you didn't understand how to use views properly. You can use multiple views to render things independently without "corrupting drawing", unless you meant something else.

I think it isn´t mixing different concepts. You can imagine SpriteBatch like another drawable (your example with VertexArray is perfect). Some pseudo-codes
You can use (for single sprite)
Code: [Select]
RenderWindow.Draw(Sprite);
For multiple sprites:
Code: [Select]
SpriteBatch.Begin();
SpriteBatch.Draw(Sprite1);
SpriteBatch.Draw(Sprite2);
SpriteBatch.Draw(Sprite3);
SpriteBatch.Draw(Sprite4);
SpriteBatch.Draw(Sprite5);
SpriteBatch.End();
RenderWindow.Draw(SpriteBatch);

And for sorting and other fancy stuff you can overhaul Begin (or End, idk where it belong better, for demonstration, let´s say begin)
Code: [Select]
SpriteBatch.Begin(Sort.Inverse, TransformMatrix, Blending.Add)

And for views, I mean using for example
Code: [Select]
RenderWindow.SetView()
For scaling, zooming, moving entire screen. And I do not want to create new render textures just for using 2 different views. Correct me if I do not got views functionality correctly.
Title: Re: SFML 3 - What is your vision?
Post by: Haze on April 28, 2014, 04:48:17 pm
One feature I would love to see added in the Graphics module is rendering masks, especially texture-based masks.
There's already a task in the tracker: issue #1 - Implement rendering masks (https://github.com/SFML/SFML/issues/1)
I understand this is something quite big but it's been 3 years already, and some user has already proposed a working implementation. Please see this post (http://en.sfml-dev.org/forums/index.php?topic=3108), you can see in the screenshots what kind of neat tricks you can achieve with this feature.

Title: Re: SFML 3 - What is your vision?
Post by: Jebbs on April 28, 2014, 04:51:04 pm
As for sprite batching, you suggest it as addition to the normal sprite rendering, but is there any advantage not to batch all sprites or dwhat's the difference between batching and non-batching?


A sprite batch is just a way to reduce the number of draw call for things that use the same texture.

This code for example:
Code: [Select]
SpriteBatch.Begin();
SpriteBatch.Draw(Sprite1);
SpriteBatch.Draw(Sprite2);
SpriteBatch.Draw(Sprite3);
SpriteBatch.Draw(Sprite4);
SpriteBatch.Draw(Sprite5);
SpriteBatch.End();
RenderWindow.Draw(SpriteBatch);

If all of those sprites used the same texture, it would essentially create a vertex array and then draw everything with one draw call internally.
Title: Re: SFML 3 - What is your vision?
Post by: Deathbeam on April 28, 2014, 04:55:21 pm
A sprite batch is just a way to reduce the number of draw call for things that use the same texture.

This code for example:
Code: [Select]
SpriteBatch.Begin();
SpriteBatch.Draw(Sprite1);
SpriteBatch.Draw(Sprite2);
SpriteBatch.Draw(Sprite3);
SpriteBatch.Draw(Sprite4);
SpriteBatch.Draw(Sprite5);
SpriteBatch.End();
RenderWindow.Draw(SpriteBatch);

If all of those sprites used the same texture, it would essentially create a vertex array and then draw everything with one draw call internally.

For such thing, you can simply create vertex array. If I would wanna use spritebatches only for drawing sprites with same texture, I wouldn´t use them. Yes, spritebatch should reduce draw calls, but imo efficient spritebatch reduces it to number of different textures what are added to it. Example directly copied from SpriteBatch in my engine:
Code: [Select]
                ////////////////////////////////////////////////////////////
/// <summary>
/// Draws all queued sprites for this vertex batch. Call
/// this only after calling End().
/// </summary>
////////////////////////////////////////////////////////////
public void Draw(SFML.Graphics.RenderTarget target, SFML.Graphics.RenderStates states)
{
uint index = 0;
foreach (var item in _textures)
{
states.Texture = item.Texture;

target.Draw(_vertices, index, item.Count, SFML.Graphics.PrimitiveType.Quads, states);
index += item.Count;
}
}
Title: Re: SFML 3 - What is your vision?
Post by: Jebbs on April 28, 2014, 05:06:20 pm
A sprite batch is just a way to reduce the number of draw call for things that use the same texture.

This code for example:
Code: [Select]
SpriteBatch.Begin();
SpriteBatch.Draw(Sprite1);
SpriteBatch.Draw(Sprite2);
SpriteBatch.Draw(Sprite3);
SpriteBatch.Draw(Sprite4);
SpriteBatch.Draw(Sprite5);
SpriteBatch.End();
RenderWindow.Draw(SpriteBatch);

If all of those sprites used the same texture, it would essentially create a vertex array and then draw everything with one draw call internally.

For such thing, you can simply create vertex array. If I would wanna use spritebatches only for drawing sprites with same texture, I wouldn´t use them. Yes, spritebatch should reduce draw calls, but imo efficient spritebatch reduces it to number of different textures what are added to it.

Perhaps I oversimplified it by mentioning only one texture, but yeah, sprite batches should work regardless of the thing being drawn has the same texture as anything else in the batch. That was just supposed to be a basic example to explain the underlying concept to eXpl0it3r. ;)
Title: Re: SFML 3 - What is your vision?
Post by: Carlitox on April 28, 2014, 05:45:29 pm
- Change the developement direction to a game programming framework not being only a media layer.
- Integrate thor library
- Create an entity system
- Create a TiledMap class
- Messaging systems
- Lua scripting class that exposes entities, camera and the map
- Scripted quest system


One way to do it it's create another layer.
Title: Re: SFML 3 - What is your vision?
Post by: select_this on April 28, 2014, 05:52:08 pm
- Scripted quest system

I think this is way too specific for a library. I can think of many games (let alone applications) that would never, ever need this. A lot of game engines (which SFML is not) don't even go to these sorts of lengths.
Title: Re: SFML 3 - What is your vision?
Post by: Carlitox on April 28, 2014, 06:02:07 pm
- Scripted quest system

I think this is way too specific for a library. I can think of many games (let alone applications) that would never, ever need this. A lot of game engines (which SFML is not) don't even go to these sorts of lengths.


Yes it is.

Abstract that could be difficult but challenging,
Title: Re: SFML 3 - What is your vision?
Post by: ChronicRat on April 28, 2014, 06:16:41 pm
Don't forget that SFML by the first is SIMPLE. And library. Not an engine. SFML does not need any engine features, but crossplatform interfaces. I think that current of I/O routines are necessarily need to improve and extend.
Title: Re: SFML 3 - What is your vision?
Post by: Deathbeam on April 28, 2014, 07:07:51 pm
- Change the developement direction to a game programming framework not being only a media layer.
- Integrate thor library
- Create an entity system
- Create a TiledMap class
- Messaging systems
- Lua scripting class that exposes entities, camera and the map
- Scripted quest system


One way to do it it's create another layer.

You must remember that SFML is multimedia library, NOT game engine :D Most of things what you listed are not even essential for game framework, you cannot think that with SFML you will have "pre-made" game ;)

A sprite batch is just a way to reduce the number of draw call for things that use the same texture.

This code for example:
Code: [Select]
SpriteBatch.Begin();
SpriteBatch.Draw(Sprite1);
SpriteBatch.Draw(Sprite2);
SpriteBatch.Draw(Sprite3);
SpriteBatch.Draw(Sprite4);
SpriteBatch.Draw(Sprite5);
SpriteBatch.End();
RenderWindow.Draw(SpriteBatch);

If all of those sprites used the same texture, it would essentially create a vertex array and then draw everything with one draw call internally.

For such thing, you can simply create vertex array. If I would wanna use spritebatches only for drawing sprites with same texture, I wouldn´t use them. Yes, spritebatch should reduce draw calls, but imo efficient spritebatch reduces it to number of different textures what are added to it.

Perhaps I oversimplified it by mentioning only one texture, but yeah, sprite batches should work regardless of the thing being drawn has the same texture as anything else in the batch. That was just supposed to be a basic example to explain the underlying concept to eXpl0it3r. ;)
Yep, you oversimplified it :D
Title: Re: SFML 3 - What is your vision?
Post by: eXpl0it3r on April 28, 2014, 07:19:57 pm
There's no need to quote 3 other quotes...

Anyways, my question was more going into the direction of: Is there any disadvantage in not having sprite batching for all sprites?

Also yes SFML will not turn into a game engine, but we still like to hear what people want, but again as I said in the beginning, we'd like to hear less about specific features and more about what changes SFML should get to make it a better library. What is currently bothering you most with SFML and would like to see changed?
Title: Re: SFML 3 - What is your vision?
Post by: Deathbeam on April 28, 2014, 07:51:42 pm
There's no need to quote 3 other quotes...

Anyways, my question was more going into the direction of: Is there any disadvantage in not having sprite batching for all sprites?

Also yes SFML will not turn into a game engine, but we still like to hear what people want, but again as I said in the beginning, we'd like to hear less about specific features and more about what changes SFML should get to make it a better library. What is currently bothering you most with SFML and would like to see changed?
What is really bothering me? Different rectangle and vector types, that is really annoying...
Title: Re: SFML 3 - What is your vision?
Post by: Laurent on April 28, 2014, 07:57:08 pm
Quote
Different rectangle and vector types, that is really annoying...
Would you mind explaining what you mean?
Title: Re: SFML 3 - What is your vision?
Post by: Njifra on April 28, 2014, 07:57:57 pm
Sorry giving this idea again, but, I really would like SFML Team to implement DirectX as beckend.
I did some testing with my lib(Simple Tool For Games[STFG] - its not published yet...) and SFML.
DirectX is 10x times faster.
I tested this with drawing some number of rectangles.

[1. TEST]
When I was drawing 10 rects with STFG, fps was from 70 to 80.
When I was drawing 10 rects with SFML, fps was from 320 to 330. (Seems awesome?)

[2. TEST]
When I was drawing 100 rects with STFG, fps was from 70 to 80.
When I was drawing 100 rects with SFML, fps was from 40 to 50. (Getting bad, ey?)

[3. TEST]
When I was drawing 1000 rects with STFG, fps was from 70 to 80.
When I was drawing 1000 rects with SFML, fps was from 5 to 6. (Bad, eh?)

[4. TEST]
When I was drawing 10000 rects with STFG, fps was from 10 to 15.
Didn't want to test SFML with 10000 rects.

[5. TEST - FINAL TEST]
When I was drawing 100000 rects with STFG, fps was 1.
Didn't want to test SFML with 100000 rects.

I don't see why not implementing DirectX as beckend.

Btw, it would be nice to have sf::Array in SFML System Module
Title: Re: SFML 3 - What is your vision?
Post by: Deathbeam on April 28, 2014, 08:14:13 pm
Quote
Different rectangle and vector types, that is really annoying...
Would you mind explaining what you mean?
It is uncomfortable for me (and I think I am not alone) to have 3 different vector types (Vector2u, Vector2f, Vector2i) and 2 different rectangle types (FloatRect, IntRect). Imo, Vector2f and IntRect are enought, before I started working on my framework, I was using only that 2 and used casts to convert from rest of rectangle and vector types.
Title: Re: SFML 3 - What is your vision?
Post by: binary1248 on April 28, 2014, 08:41:48 pm
Sorry giving this idea again, but, I really would like SFML Team to implement DirectX as beckend.
I did some testing with my lib(Simple Tool For Games[STFG] - its not published yet...) and SFML.
DirectX is 10x times faster.
I tested this with drawing some number of rectangles.
You write your own lib using DirectX, don't publish the code, come up with a very synthetic benchmark and claim that DirectX is 10x faster than OpenGL?

First of all... unless you implemented your drawing exactly as SFML did, it already isn't a fair comparison, because SFML might be able to do things that your lib doesn't and you wrote the test so it would run using both libraries.

Second of all... I don't know where you got this 10x faster from, but there are other things that are happening which probably have nothing to do with either DirectX or OpenGL. There might be more internal call overhead, driver optimizations, SFML might have more safety checks, perform more housekeeping and so many other things that don't even have to do with OpenGL. Unless you can show that raw DirectX performs any bit better than raw OpenGL, don't claim that one is better than the other based on 2 probably very differently implemented libraries using different APIs.

What people seem to forget when comparing DirectX and OpenGL is that in the former case, you choose which API to use before writing even your first line of code. What happens if your library uses DirectX 11 and you have 10 year old hardware? Yeah... it doesn't work anymore. SFML will work on hardware that runs OpenGL 1.5 which dates all the way back to the last millenium. To make your comparison a bit more fair, you would have to make it use DirectX 7.

If you want to see some more believable numbers, from a bit more credible people have a look at the slides presented at the GDC 2014 in regards to OpenGL overhead (http://www.geeks3d.com/20140321/opengl-approaching-zero-driver-overhead/). In particular the benchmark results towards the end of the presentation. It seems like... OpenGL can be faster than DirectX... by almost an order of magnitude? You know... in the end both are really just APIs... and when talking about performance, what you really mean is API overhead. More often than not, the API overhead isn't even the limiting factor, it's the code that makes use of the API. It's just that the API has been used as a scapegoat for really horrible code. When people say "XYZ isn't fast enough, we need a better API", what they mean to say is "XYZ doesn't optimize my horribly written code as much as I'd like, please give me a version that optimizes better".

If you get an experienced DirectX programmer and an experienced OpenGL programmer and tell them both to write a high performance application, there won't be that much performance difference, because if you minimize API overhead it will be limited to what the graphics hardware can do in a set amount of time. There is no separate DirectX section and OpenGL section on the GPU although that might be what many laypeople might think... everything goes through the same pipeline.

Now that I have countered yet more OpenGL FUD (http://en.wikipedia.org/wiki/Fear,_uncertainty_and_doubt), I can explain the SFML situation in peace.

Basically, SFML is using some very ancient OpenGL code. It doesn't perform as fast as modern OpenGL code might, but it stays compatible with older hardware, which is of higher priority at the moment. At some point, we might consider modernizing the implementation and even the public interface, but there are more pressing issues at the moment and we want to save API breaking for a major version bump.

I don't see why not implementing DirectX as other beckend.
Sonkun is already working on an experimental DirectX implementation. Whether this is necessary is still up for discussion. The one advantage I can think of is enabling future support for platforms that are prevented from providing OpenGL support (http://en.wikipedia.org/wiki/Xbox). Other than that, I don't see any real advantage DirectX would provide when OpenGL can be used as well.

Btw, it would be nice to have sf::Array in SFML System Module
Have you heard of the standard template library? In particular the containers library (http://en.cppreference.com/w/cpp/container). Doing a bit of research before suggesting something that is already a language library feature helps sometimes...
Title: Re: SFML 3 - What is your vision?
Post by: eXpl0it3r on April 28, 2014, 08:46:08 pm
It is uncomfortable for me (and I think I am not alone) to have 3 different vector types (Vector2u, Vector2f, Vector2i) and 2 different rectangle types (FloatRect, IntRect).
You're pretty much alone in that regard, I'd say. On the one hand there's just one template version of Vector2 and the ones you listed are just typedefs, on the other hand unsigned integers, floats and integers are not the same types and can't be treated as such, if you care about the precision and most of the people do care about that. So again the integer vector is used for when there are only integers values, float vectors are used for when something can have a decimal part (e.g. a position) and unsigned integer vectors are used when a value can't get negative and is an integer (e.g. window size). The same goes for rectangles.
Title: Re: SFML 3 - What is your vision?
Post by: Laurent on April 28, 2014, 08:52:51 pm
We are indeed investigating (even testing) the DirectX backend, so you guys don't need to put so much pressure on it. And more important than enabling XBox development, it will make possible a Windows Phone port.

All high-level game features: I don't think SFML should evolve in this direction. It's goal is to provide a generic abstraction on top of platform specific multimedia capabilities. It's not a game engine, and I think it will never be. However this idea is not irrelevant, since most people here write games and would love to see a SFML-like implementation of their favorite features. But this is rather a job for an extension (I have always wanted to write SFGL, the true Simple and Fast Game Library), or at worst for a separate SFML module.

Quote
It is uncomfortable for me (and I think I am not alone) to have 3 different vector types (Vector2u, Vector2f, Vector2i) and 2 different rectangle types (FloatRect, IntRect).
There are several types of vectors and rectangles for the same reason that there are several types for numbers. Because each type is suitable in a given situation.
Title: Re: SFML 3 - What is your vision?
Post by: Njifra on April 28, 2014, 09:13:03 pm
Sorry giving this idea again, but, I really would like SFML Team to implement DirectX as beckend.
I did some testing with my lib(Simple Tool For Games[STFG] - its not published yet...) and SFML.
DirectX is 10x times faster.
I tested this with drawing some number of rectangles.
You write your own lib using DirectX, don't publish the code, come up with a very synthetic benchmark and claim that DirectX is 10x faster than OpenGL?

First of all... unless you implemented your drawing exactly as SFML did, it already isn't a fair comparison, because SFML might be able to do things that your lib doesn't and you wrote the test so it would run using both libraries.

You can have part that renders rectangle. I'm not sure if this is anything similar to SFML Code beacuse im not inrested in SFML stuff or even OGL.
Code:
void Window::draw(st::g2d::RectangleShape& recta)
{
        if (this->m_opened)
        {
                VOID* pStored;
                st::Color fillColor(recta.getFillColor().r, recta.getFillColor().g, recta.getFillColor().b,
recta.getFillColor().a);
                        DWORD clr = D3DCOLOR_RGBA(fillColor.r, fillColor.g, fillColor.b, fillColor.a);
                        float m_x = recta.getPosition().x;
                        float m_y = recta.getPosition().y;
                        float m_width = recta.getSize().x;
                        float m_height = recta.getSize().y;

                        D3DXMATRIX trans;
                        D3DXMatrixTransformation2D(&trans,
                                &D3DXVECTOR2(recta.getOrigin().x + recta.getPosition().x, recta.getOrigin().y + recta.getPosition().y),
                                0.0f,
                                &D3DXVECTOR2(recta.getScale().x, recta.getScale().y),
                                &D3DXVECTOR2(recta.getOrigin().x + recta.getPosition().x, recta.getOrigin().y + recta.getPosition().y),
                                recta.getRotation(),
                                &D3DXVECTOR2(NULL, NULL));
                        this->m_device->SetTransform(D3DTS_WORLD, &(trans));
                        st::Vertex drawRect[] =
                        {
                                { m_x, m_y, 0.0f, clr, },
                                { m_x + m_width, m_y, 0.0f, clr, },
                                { m_x, m_y + m_height, 0.0f, clr, },
                                { m_x + m_width, m_y, 0.0f, clr, },
                                { m_x + m_width, m_y + m_height, 0.0f, clr, },
                                { m_x, m_y + m_height, 0.0f, clr, }
                        };
                        this->m_vBufferQuad->Lock(NULL, NULL, (void**)&pStored, NULL);
                        memcpy(pStored, drawRect, sizeof(drawRect));
                        this->m_vBufferQuad->Unlock();
                        this->m_device->SetStreamSource(NULL, this->m_vBufferQuad, NULL, sizeof(st::Vertex));
                        this->m_device->DrawPrimitive(D3DPT_TRIANGLELIST, 0, 2);
                }
        }
 
(I deleted all comments :P)
And there were two projects... Not all in one... Derp...
One used STFG and one SFML, I can post source for both projects if its rly needed...

What people seem to forget when comparing DirectX and OpenGL is that in the former case, you choose which API to use before writing even your first line of code. What happens if your library uses DirectX 11 and you have 10 year old hardware? Yeah... it doesn't work anymore. SFML will work on hardware that runs OpenGL 1.5 which dates all the way back to the last millenium. To make your comparison a bit more fair, you would have to make it use DirectX 7.
It's really easy to check if DirectX 9 or 10 or 11 or whatever is supported. :)

I don't see why not implementing DirectX as other beckend.
Sonkun is already working on an experimental DirectX implementation. Whether this is necessary is still up for discussion. The one advantage I can think of is enabling future support for platforms that are prevented from providing OpenGL support (http://en.wikipedia.org/wiki/Xbox). Other than that, I don't see any real advantage DirectX would provide when OpenGL can be used as well.

Btw, it would be nice to have sf::Array in SFML System Module
Have you heard of the standard template library? In particular the containers library (http://en.cppreference.com/w/cpp/container). Doing a bit of research before suggesting something that is already a language library feature helps sometimes...
You must be joking!!! (sarcastic, of course I know that...)
But this really is cool:

#ifndef STFG_ARRAY_H
#define STFG_ARRAY_H

#include <assert.h>

namespace st
{
        template <typename TYPE>
        class Array
        {
        public:
                Array()
                {
                        m_data = NULL;
                        m_size = 0;
                        m_maxSize = 0;
                }
                Array(const Array <TYPE>& a)
                {
                        for(int i = 0; i < a.m_size; i++)
                                this->add(a.m_data[i]);
                }
                ~Array()
                {
                        this->removeAll();
                }
                const TYPE& operator[](int nIndex) const
                {
                        return this->getAt(nIndex);
                }
                TYPE& operator[](int nIndex)
                {
                        return this->getAt(nIndex);
                }
                Array& operator=(const Array <TYPE>& a)
                {
                        if(this == &a)
                                return *this;
                        this->removeAll();
                        for(int i = 0; i < a.m_size; i++)
                                this->add( a.m_data[i] );
                        return *this;
                }
                HRESULT setSize(int nNewMaxSize)
                {
                        int nOldSize = m_size;
                        if(nOldSize > nNewMaxSize)
                        {
                                assert(m_data);
                                if(m_data)
                                {
                                        for(int i = nNewMaxSize; i < nOldSize; ++i)
                                                m_data[i].~TYPE();
                                }
                        }
                        HRESULT hr = this->setSizeInternal(nNewMaxSize);
                        if(nOldSize < nNewMaxSize)
                        {
                                assert(m_data);
                                if(m_data)
                                {
                                        for(int i = nOldSize; i < nNewMaxSize; ++i)
                                                ::new(&m_data[i]) TYPE;
                                }
                        }
                        return hr;
                }
                HRESULT add(const TYPE& value)
                {
                        HRESULT hr;
                        if(FAILED(hr = this->setSizeInternal(m_size + 1)))
                                return hr;
                        assert(m_data != NULL);
                        ::new(&m_data[m_size])TYPE;
                        m_data[m_size] = value;
                        ++m_size;
                        return S_OK;
                }
                HRESULT insert(int nIndex, const TYPE& value)
                {
                        HRESULT hr;
                        if(nIndex < 0 || nIndex > m_size )
                        {
                                assert(false);
                                return E_INVALIDARG;
                        }
                        if(FAILED(hr = this->setSizeInternal(m_size + 1)))
                                return hr;
                        MoveMemory(&m_data[nIndex + 1], &m_data[nIndex], sizeof(TYPE) * (m_size - nIndex));
                        ::new(&m_data[nIndex])TYPE;
                        m_data[nIndex] = value;
                        ++m_size;
                        return S_OK:
                }
                HRESULT setAt(int nIndex, const TYPE& value)
                {
                        //Validate arguments
                        if(nIndex < 0 || nIndex >= m_size )
                        {
                                assert(false);
                                return E_INVALIDARG;
                        }

                        m_data[nIndex] = value;
                        return S_OK;
                }
                TYPE& getAt(int nIndex) const
                {
                        assert(nIndex >= 0 && nIndex < m_size);
                        return m_data[nIndex];
                }
                int getSize() const
                {
                        return m_size;
                }
                TYPE* getData()
                {
                        return this->m_data;
                }
                bool contains(const TYPE& value)
                {
                        return (-1 != this->indexOf(value));
                }
                int indexOf(const TYPE& value)
                {
                        return (m_nSize > 0) ? this->indexOf(value, 0, m_nSize) : -1;
                }
                int indexOf(const TYPE& value, int iStart)
                {
                        return this->indexOf(value, iStart, m_size - iStart);
                }
                int indexOf(const TYPE& value, int nIndex, int nNumElements)
                {
                        if(iStart < 0 || iStart >= m_size || nNumElements < 0 || iStart + nNumElements > m_size)
                        {
                                assert(false);
                                return -1;
                        }
                        for(int i = iStart; i < (iStart + nNumElements); i++)
                        {
                                if(value == m_data[i])
                                        return i;
                        }
                        return -1;
                }
                int lastIndexOf(const TYPE& value)
                {
                        return (this->m_size > 0) ? this->lastIndexOf(value, m_nSize - 1, m_nSize) : -1;
                }
                int lastIndexOf(const TYPE& value, int nIndex)
                {
                        return this->lastIndexOf(value, nIndex, nIndex + 1);
                }
                int lastIndexOf(const TYPE& value, int nIndex, int nNumElements)
                {
                        if(iEnd < 0 || iEnd >= m_size || nNumElements < 0 || iEnd - nNumElements < 0)
                        {
                                assert(false);
                                return -1;
                        }
                        for(int i = iEnd; i > (iEnd - nNumElements); i--)
                        {
                                if(value == m_data[i])
                                        return i;
                        }
                        return -1;
                }
                HRESULT remove(int nIndex)
                {
                        if(nIndex < 0 || nIndex >= m_size)
                        {
                                assert(false);
                                return E_INVALIDARG;
                        }
                        m_data[nIndex].~TYPE();
                        MoveMemory(&m_data[nIndex], &m_data[nIndex + 1], sizeof(TYPE) * (m_size - (nIndex + 1)));
                        --m_size;
                        return S_OK;
                }
                void removeAll()
                {
                        this->setSize(0);
                }
                void reset()
                {
                        this->m_size = 0;
                }
        protected:
                TYPE* m_data;
                int m_size;
                int m_maxSize;
                HRESULT setSizeInternal(int nNewMaxSize)
                {
                        if(nNewMaxSize < 0 || (nNewMaxSize > INT_MAX / sizeof(TYPE)))
                        {
                                assert(false);
                                return E_INVALIDARG;
                        }
                        if(nNewMaxSize == 0)
                        {
                                if(m_data)
                                {
                                        free(m_data);
                                        m_data = NULL;
                                }
                                m_maxSize = 0;
                                m_size = 0;
                        }
                        else if(m_data == NULL || nNewMaxSize > m_maxSize)
                        {
                                int nGrowBy = (m_maxSize == 0) ? 16 : m_maxSize;
                                if((UINT)m_maxSize + (UINT)nGrowBy > (UINT)INT_MAX)
                                        nGrowBy = INT_MAX - m_maxSize;
                                nNewMaxSize = __max(nNewMaxSize, m_maxSize + nGrowBy);
                                if(sizeof(TYPE) > UINT_MAX / (UINT)nNewMaxSize)
                                        return E_INVALIDARG;
                                TYPE* pDataNew = (TYPE*)realloc(m_data, nNewMaxSize * sizeof(TYPE));
                                if(pDataNew == NULL)
                                        return E_OUTOFMEMORY;
                                m_data = pDataNew;
                                m_maxSize = nNewMaxSize;
                        }
                        return S_OK;
                }
        };
}

#endif //STFG_ARRAY_H
 
(Again I removed all comments)
This STFG_Array.h is actually made by my friend who is also in the STFG Team.
Title: Re: SFML 3 - What is your vision?
Post by: ChronicRat on April 28, 2014, 09:16:48 pm
But this really is cool:
This does not look cool. Well, for me. =)
Title: Re: SFML 3 - What is your vision?
Post by: Nexus on April 28, 2014, 09:27:11 pm
To be honest, that Array class is very badly abstracted -- it doesn't use existing containers, it is non-portable without a good reason, the used types are questionable (int for indices?), it works only for PODs thanks to the raw memory operations, it's not exception-safe (which is less important since we can't use it with classes anyway), it has no iterator support, and the overall implementation looks extremely complicated and error-prone for a dynamic array -- the most simple data structure ever.

Given the methods indexOf, removeAll, setAt, it looks like someone tried to port Java collections to C++ without understanding the latter's concepts. You should really take a look at the STL. std::vector is ten times more reusable, efficient and safe.
Title: Re: SFML 3 - What is your vision?
Post by: Njifra on April 28, 2014, 09:32:53 pm
Whatever you say
[EDIT] Deleted.
Title: Re: SFML 3 - What is your vision?
Post by: Hiura on April 28, 2014, 09:33:57 pm
I guess it's also 10x faster than std::vector?

anyway, let's get back to the topic, shall we?  ;)
Title: Re: SFML 3 - What is your vision?
Post by: binary1248 on April 28, 2014, 09:56:24 pm
void Window::draw(st::g2d::RectangleShape& recta)
{
...
}
 
This method is used only to draw a quad, with no textures, no support for binding shaders. If SFML wanted to write separate draw() methods for each and every possible scenario there would be more of them than all the other methods in RenderTarget put together. SFML is designed to be generic. Like I already predicted before, your code is optimized with certain use cases in mind and your benchmark is thus very very synthetic. I highly doubt you will get such a big performance difference in a real world scenario, let alone allow real world usage without having to duplicate code a lot more than is actually required if you tried to stay generic.

Another thing about the way you pass vertex data to DirectX is the fact that you already combine it all into a single buffer. SFML does not do this (yet). SFML passes separate data streams to OpenGL in their own calls which incurs a bit more overhead. This is just one of the many differences between your drawing and SFML's drawing. You can have a look at SFML's draw code (https://github.com/SFML/SFML/blob/master/src/SFML/Graphics/RenderTarget.cpp#L190) to figure out why your lib probably runs much faster in scenarios such as these, but it is still no reason to mandate supporting DirectX purely for a performance increase.

It's really easy to check if DirectX 9 or 10 or 11 or whatever is supported. :)
It is less easy to restrain yourself to an ancient API version just to stay compatible with older hardware. The code you posted probably wouldn't work if you went ahead and made it compatible with DirectX 7 hardware like I suggested.

But this really is cool:

#ifndef STFG_ARRAY_H
#define STFG_ARRAY_H

#include <assert.h>

namespace st
{
        template <typename TYPE>
        class Array
        {
        ...
        };
}

#endif //STFG_ARRAY_H
 
std::vector is way cooler.

If your only intent is to suggest things to make SFML "more like your lib", then this thread probably isn't the right place to post. We care about providing facilities that benefit everyone, even the fans of std::vector. The burden of proof lies on you to show that your lib is usable to a wider audience before coming here and saying SFML should do things that your lib can and SFML can't. The first step of course, would be to make it public... but when that will happen, I don't know.

anyway, let's get back to the topic, shall we?  ;)
Agreed.
Title: Re: SFML 3 - What is your vision?
Post by: Njifra on April 28, 2014, 10:02:36 pm
This method is used only to draw a quad, with no textures, no support for binding shaders. If SFML wanted to write separate draw() methods for each and every possible scenario there would be more of them than all the other methods in RenderTarget put together. SFML is designed to be generic. Like I already predicted before, your code is optimized with certain use cases in mind and your benchmark is thus very very synthetic. I highly doubt you will get such a big performance difference in a real world scenario, let alone allow real world usage without having to duplicate code a lot more than is actually required if you tried to stay generic.
There is already st::Drawable class. ;)

The first step of course, would be to make it public... but when that will happen, I don't know.
It will happen soon, currently I'm making 3D Shapes(already added cuboid, cylinder...)
After that I have to fix Sound module...
That's all!
Title: Re: SFML 3 - What is your vision?
Post by: Laurent on April 28, 2014, 11:03:28 pm
Oh, so now this thread is about your library. Nice.

From now on, any post not talking seriously about SFML 3 will just be removed. We open public discussions to get relevant feedback. If you want to discuss in detail a particular feature, or talk about your own project, feel free to open a new thread, everybody will be happy to contribute to the discussion. But not here, this is just not the right place.
Title: Re: SFML 3 - What is your vision?
Post by: Carlitox on April 29, 2014, 03:18:52 pm
There was a problem with sf::sleep. Some programs like Chrome modify the FPS.

http://en.sfml-dev.org/forums/index.php?topic=10231.0 (http://en.sfml-dev.org/forums/index.php?topic=10231.0)

I had the same problem using sf::sleep to wait in the main loop. This should be solved in SFML 3.0
Title: Re: SFML 3 - What is your vision?
Post by: Laurent on April 29, 2014, 03:25:08 pm
Quote
There was a problem with sf::sleep. Some programs like Chrome modify the FPS.
This is already fixed.
Title: Re: SFML 3 - What is your vision?
Post by: Foaly on April 29, 2014, 07:01:05 pm
I have to say I really like the ideas in NoobsArePeople2's post (http://en.sfml-dev.org/forums/index.php?topic=15027.msg106486#msg106486). Especially Sprite batching, texture atlasing and a System Info class (eventhough I'm not sure if it should be part of SFML... but never the less I would love to see that class :D ). And of course a list of contributors!

Another thing that I would also love to see is features for the sf::Text class. I love the simplicity and power of this class. But still I would love to see thing like support for non-western texts/fonts, different styles and layouts.

I'm not 100% sure about C++11 being required for SFML 3. It sounds really nice, but one of Laurents main concerns has always been backwards compatibility and support for "old" (i.e. not brand new) platforms and setups. So I don't know... But conditional support is probably not a good idea either, because it will lead to things like binary incompatibilities. I know C++11 support has been request quiet a lot in this thread, but I think we should put priority on adding and improving fuctionality. But of course this all depends on when SFML 3 is released and how succesfull C++11 has turned out untill then.

And I hope that the SFML 3 API is still clean and simple and not cluttered with things unrelated to a multimedia library/layer. After all this is one of the things that makes SFML so great.

One of my dreams for SFML 3 has already become true. That is more community driven development! And that is what's happening right here right now! I hope we can keep up the great work and keep on making SFML better and better!
Title: Re: SFML 3 - What is your vision?
Post by: Laurent on April 29, 2014, 07:14:58 pm
Quote
I would love to see thing like support for non-western texts/fonts
??

Quote
different styles
??
Title: Re: SFML 3 - What is your vision?
Post by: Foaly on April 29, 2014, 09:52:30 pm
I am sorry if I wasn't clear. Now that I read it again it seems rather confusing. :D
What I meant was different writing directions like right to left or top to bottom. Also things like ligatures would be nice. They are necessary in some languages, but they can also make quiet a good looking effect. With styles I meant stuff like line spacing or strikethough.
I know some of these things already have a ticket on the tracker. I just wanted to state that I would be happy to see them integrated.
Sorry for my bad wording.
Title: Re: SFML 3 - What is your vision?
Post by: Canadadry on April 30, 2014, 12:07:39 am
Quote
It is uncomfortable for me (and I think I am not alone) to have 3 different vector types (Vector2u, Vector2f, Vector2i) and 2 different rectangle types (FloatRect, IntRect).
There are several types of vectors and rectangles for the same reason that there are several types for numbers. Because each type is suitable in a given situation.

Yeah I find it really annoying too. I get what you're saying Laurent, but most of the time I only use/care about the float version. Could you at least provide cast facilities ? something like that (if you don't have a better ideas):

sf::Vector2i exactPos = floatPos.to<int>();
Title: Re: SFML 3 - What is your vision?
Post by: Nexus on April 30, 2014, 12:08:52 am
Please read the documentation. There are conversion constructors between different vector types...

And different types are not "annoying", their existence is crucial.
Title: Re: SFML 3 - What is your vision?
Post by: Laurent on April 30, 2014, 07:52:37 am
Describing pixel coordinates with floats would be just wrong (what is 0.1 pixel??).
Describing world coordinates with integers would be stupid ;)

So yeah, we need different types, it's not just to annoy people. Moreover, when you need to cast between vector types, then you most likely did something wrong (forgot to call the function which maps from one coordinates system to the other).
Title: Re: SFML 3 - What is your vision?
Post by: Canadadry on April 30, 2014, 08:08:08 am
Don't try to teach me the good coding behavior, I know them, this is my work to know that. But I'll tried to explain what I do with SFML.

I'm mainly using SFML to make games. And for making games is not about perfect code, with perfect architecture and perfect respect of all programming matter such as choosing the right type. For me is about prototyping and fast development and trashing.  You're right in everything you said but in that special case I couldn't care less about coding right. I just want to make a prototype and work on the gameplay. Maybe I should not use SFML for that purpose and using something like unity or gamemaker. But I like C++ and SFML  ;D

I always use float, and it's wrong but it work fine.

You're asking what's battering us, I'm just answering.

PS: I've read this class so many times... I don't know how I could not see that constructor. ^^

Edit: I'm not sure you will have good answer with this question (about our vision) I find more interesting to know what people are doing with SFML. And then you will know what SFML is lacking. If everyone is making 2D game, maybe it's wise to help them with a game module.
Title: Re: SFML 3 - What is your vision?
Post by: Laurent on April 30, 2014, 08:47:21 am
Having to cast between vector types is not only not-perfect, it's also most likely wrong. As I said, it's often (always?) a strong hint that you've forgotten to call the conversion function that maps one coordinates system to another. Sure it won't make any difference if you only use the default view and never resize your window... ;)
Title: Re: SFML 3 - What is your vision?
Post by: Tank on April 30, 2014, 08:59:06 am
Quote
Don't try to teach me the good coding behavior, I know them, this is my work to know that.
Too bad it's not your job to follow them, unfortunately. :D Just kidding.

You said it yourself: "I always use float, and it's wrong but it work fine. ". I think you agree that we don't want to force things that are wrong. If you only use SFML for prototyping, that's fine, but we don't want to exclude people who want to create serious projects that care more about code safety and design.
Title: Re: SFML 3 - What is your vision?
Post by: Carlitox on April 30, 2014, 03:47:04 pm
For me is about prototyping and fast development and trashing.  .....  Maybe I should not use SFML for that purpose and using something like unity or gamemaker. But I like C++ and SFML  ;D

For protoypes it's better to use a lua based framework. My favorite one is gideros mobile.
Title: Re: SFML 3 - What is your vision?
Post by: dk123 on April 30, 2014, 04:47:35 pm
- c++11 addition
- more text flexibility
- emscripten

I just want to point out if someone can get a emscripten backend in place, then people can wrap things in Phonegap or Crosswalk and also get things running on mobile.

As for flexibility with text:
- Ability to define colours within the text
- Ability to change size within the text
- Ability to change style within the text (bold/italic,etc)
- Automatic changing of line when text passes a certain width
- Vertical text output

These are the features that initially come to mind. Changing colours/size/style of parts within text can currently only be done by chopping strings up, applying the styles, and sticking them together in appropriate screen locations.

It would be great if SFML could do these internally without any external fuss.

Anyway, it's great that people are discussing about the future.
Good to see all the conversations freely going about.
Title: Re: SFML 3 - What is your vision?
Post by: Oldie on April 30, 2014, 05:16:01 pm
An issue I am dealing with in my own project:
The application allows the user to switch language on the fly in a settings screen. Most sf::Text instances display some text in the current language. Whenever the language is changed, all of these instances have to apply the sf::Text::setString() method with the reference to the new localized string. Said string, a sf::String, is always at the same address, stored in a std::map.
Would it be possible to let a sf::Text instance hold a pointer-like member to an external sf::String, so that nothing has to be applied when that string changes? Basically the class Text must know that the string has changed somehow, so as to display the updated string.
Title: Re: SFML 3 - What is your vision?
Post by: dabbertorres on April 30, 2014, 05:37:45 pm
There's been a few times for myself that having the sf::Text hold a reference to a string rather than a value would've been nice. I'd be a fan of the change if it was done.

Was there a design decision as to why it holds a value? I mean, most of the API holds references rather than values.
Title: Re: SFML 3 - What is your vision?
Post by: ChronicRat on April 30, 2014, 05:43:55 pm
There's been a few times for myself that having the sf::Text hold a reference to a string rather than a value would've been nice. I'd be a fan of the change if it was done.

Was there a design decision as to why it holds a value? I mean, most of the API holds references rather than values.
How good it will be in multithreaded app?
Title: Re: SFML 3 - What is your vision?
Post by: zsbzsb on April 30, 2014, 05:47:53 pm
There's been a few times for myself that having the sf::Text hold a reference to a string rather than a value would've been nice.

Until you realize that there would be not any clean solution for the text object to know if the reference it points at has changed its string and internal states need to be updated.
Title: Re: SFML 3 - What is your vision?
Post by: Oldie on April 30, 2014, 06:00:09 pm
Until you realize that there would be not any clean solution for the text object to know if the reference it points at has changed its string and internal states need to be updated.
That is what I thought, more or less. Until very recently I had a utility struct acting as a wrapper on top of sf::Text, which also held a container of sf::String*. The idea was to give the needed strings to the Text instance once, and then forget about them. But even this way, whenever the language changed, I had to do myOwnText::update(), with no argument, so as to apply sf::Text::setString() internally.
I got rid of myOwnText today, and now only rely on sf::Text again and store the needed strings case by case. ;)
Title: Re: SFML 3 - What is your vision?
Post by: zsbzsb on April 30, 2014, 06:02:31 pm
That is what I thought, more or less. Until very recently I had a utility struct acting as a wrapper on top of sf::Text, which also held a container of sf::String*. The idea was to give the needed strings to the Text instance once, and then forget about them. But even this way, whenever the language changed, I had to do myOwnText::update(), with no argument, so as to apply sf::Text::setString() internally.

My point exactly  :D either way a function needs to be called on the sf::Text object.  :P
Title: Re: SFML 3 - What is your vision?
Post by: dabbertorres on April 30, 2014, 06:04:38 pm
Heh, well that was painfully obvious.
Title: Re: SFML 3 - What is your vision?
Post by: heishe on April 30, 2014, 10:15:04 pm
Haven't logged in in a long time, but this is important to me since I love SFML as a library, but meta-topics keep me and my team from using it at work.

What's an absolute must is cross platform support that also covers mobile platforms, namely android, ios, and windows phone. Would be helpful if you went a way similar to Cocos2D, which now includes a cross-platform project management and build tool, but I guess that's never been the focus of SFML so I don't suspect you will look into it.
Title: Re: SFML 3 - What is your vision?
Post by: Nexus on April 30, 2014, 10:31:31 pm
Quote from: dabbertorres
Was there a design decision as to why it holds a value? I mean, most of the API holds references rather than values.
In general, value semantics are more transparent, less surprising and easier to use than reference semantics. For example, sf::RenderWindow::setView() was changed to store a copy because of that.

I wouldn't say most of the API holds references, it's only a small part. Except for places where a copy is clearly inappropriate (mostly resources), setters store the passed value in the class.
Title: Re: SFML 3 - What is your vision?
Post by: StDH on May 01, 2014, 03:08:02 pm
- C++11: std::to_string ...
- Network: nat hole punching, define packets ttl, timestamp
- Graphics: motion blur shader, shake screen
- Global: "inline" for short functions [like getPosition(), getRotation() ...etc]
- System: add precise clock: std::chrono
Title: Re: SFML 3 - What is your vision?
Post by: binary1248 on May 01, 2014, 04:05:54 pm
SDH, I can't tell what you really meant with all the things you listed.
- C++11: std::to_string ...
So, why can't you just use std::to_string then?

- Network: nat hole punching, define packets ttl, timestamp
NAT hole punching isn't something you can just "enable" between 2 parties, it always consists of at least one party that doesn't require hole punching e.g. an internet server and the parties that do. So in case the 2 parties who are both trying to communicate behind each other are behind NAT gateways, you will need a publicly accessible server somewhere in the internet. This is really not a feature any more, but rather a concrete use case.

I don't see any reason to be able to define a packets TTL. TTL is meant to prevent packets from travelling the internet forever. Besides that, the only reason to be able to manually set it is for diagnostic purposes e.g. traceroute. In normal cases, you can rely on the operating system setting the TTL value properly.

I also don't understand what you mean by "timestamp". If you want to add a timestamp to your packets, then you can already do so. What does this have to do with being a new feature?

- Graphics: motion blur shader, shake screen
These are post-processing effects which are already possible with sf::Shader.

- Global: "inline" for short functions [like getPosition(), getRotation() ...etc]
If you enable optimizations, you will find that more often than not, the compiler is smart enough to inline calls where they make sense. The opposite is also true, they don't inline where it doesn't make sense, even if the function is marked inline by the programmer. In the end it is only a hint, and a good optimizer shouldn't need that many hints to produce a program that runs fast, even without explicit inlines.

- System: add precise clock: std::chrono
So, do you want SFML to replicate std::chrono? Is there a reason you would rather use SFML's sf::Clock rather than std::chrono? Currently, SFML's clock might even have a higher resolution than std::chrono's high_resolution_clock, so I don't understand what exactly you are requesting.
Title: Re: SFML 3 - What is your vision?
Post by: StDH on May 01, 2014, 04:26:50 pm
i dont want to replace it with chrono just add something like sf::PreciseClock
Title: Re: SFML 3 - What is your vision?
Post by: binary1248 on May 01, 2014, 04:29:43 pm
i dont want to replace it with chrono just add something like sf::PreciseClock
But sf::Clock already has maximum precision. ???
Title: Re: SFML 3 - What is your vision?
Post by: StDH on May 01, 2014, 04:35:39 pm
i am sorry......
now i see: asMicroseconds
Title: Re: SFML 3 - What is your vision?
Post by: magneonx on May 02, 2014, 01:58:18 am
I wish there would be a class called Camera. That could be very handy... Panning, Viewing, Zooming, etc. Although I know you can do it on sf::View, but I think its a cool idea to add Camera.

Also, SFML should also go 3D. Maybe on SFML4 or 5?
Title: Re: SFML 3 - What is your vision?
Post by: Nexus on May 02, 2014, 07:03:55 am
I wish there would be a class called Camera. That could be very handy... Panning, Viewing, Zooming, etc. Although I know you can do it on sf::View, but I think its a cool idea to add Camera.
So you want to add a second class that does the same as sf::View but with another name? ???

Or what functionality is missing in sf::View?
Title: Re: SFML 3 - What is your vision?
Post by: therocode on May 02, 2014, 05:25:39 pm
Easy solution: using Camera = sf::View;

:D
Title: Re: SFML 3 - What is your vision?
Post by: NoobsArePeople2 on May 02, 2014, 07:58:44 pm
So you want to add a second class that does the same as sf::View but with another name? ???

The tutorial on Views is called Controlling the 2D camera with views (http://sfml-dev.org/tutorials/2.1/graphics-view.php) which implies that View is the camera but doesn't explicitly state it (the word "camera" is only used in the title"). Maybe adding a sentence in the opening section that states something along the lines of, "a View is what you use for a camera in SFML" would clear this up?
Title: Re: SFML 3 - What is your vision?
Post by: Ricky on May 03, 2014, 01:13:13 am
Maybe what he meant was a multi purpose "view" for 2d and 3d perspectives? Though this is not what sf::View is currently, not even close to being similar.

Maybe in the future if SFML moves towards 3d but I still think sf::View will have it's purpose because a view is not a camera. Or maybe I'm the one confused?  ???
Title: Re: SFML 3 - What is your vision?
Post by: gabrieljt on May 03, 2014, 10:11:08 am
Thor integration and then SFML Game Development Book Reloaded.

Title: Re: SFML 3 - What is your vision?
Post by: Deathbeam on May 03, 2014, 11:44:56 am
I am not sure if this should be added in 3 or 2.2, but in SFML.NET there is no way to check if creating RenderTexture was succesfull or not. It is usefull when target PC do not supports that large render texture as programm is trying to create. I am sure that in original SFML it is possible to check it, but in .NET binding I do not found any way to do it.
Title: Re: SFML 3 - What is your vision?
Post by: Laurent on May 03, 2014, 12:25:55 pm
Quote
I am not sure if this should be added in 3 or 2.2, but in SFML.NET there is no way to check if creating RenderTexture was succesfull or not.
This is just a small issue that needs to be addressed quickly. Here we'd rather like to hear about your vision of what SFML 3 should be ;)
Title: Re: SFML 3 - What is your vision?
Post by: Deathbeam on May 03, 2014, 12:53:36 pm
Quote
I am not sure if this should be added in 3 or 2.2, but in SFML.NET there is no way to check if creating RenderTexture was succesfull or not.
This is just a small issue that needs to be addressed quickly. Here we'd rather like to hear about your vision of what SFML 3 should be ;)
I already stated that I would like to see SpriteBatch in SFML 3, and it is not very small issue, becouse for example I am using rendertexture for my lighting system, and when it fails to create it, no lights are displaying :D
Title: Re: SFML 3 - What is your vision?
Post by: Nexus on May 03, 2014, 12:57:52 pm
Thor integration
What features do you have in mind? And don't say "everything", I'd really like to know which parts of Thor you (and others) use most.
Title: Re: SFML 3 - What is your vision?
Post by: Laurent on May 03, 2014, 01:37:21 pm
Quote
it is not very small issue, becouse for example I am using rendertexture for my lighting system, and when it fails to create it, no lights are displaying
Yes of course it is an important bug... but it's probably fixed in 5 minutes. You understand that it is not this kind of feedback we're expecting in this thread, do you? :P
Title: Re: SFML 3 - What is your vision?
Post by: gabrieljt on May 03, 2014, 08:25:44 pm
Thor integration
What features do you have in mind? And don't say "everything", I'd really like to know which parts of Thor you (and others) use most.

haha, i get it.

mainly the graphics module for animations, particles and the necessary tools to create a GUI with more ease.

but i must admit that i didn't use Thor very much (yet) so i cant give a more precise answer.
Title: Re: SFML 3 - What is your vision?
Post by: dixondean25 on May 04, 2014, 01:39:32 am
maybe integrating the functionality projects of SFML into just one thing.
Title: Re: SFML 3 - What is your vision?
Post by: metsuro on May 04, 2014, 01:56:35 am
maybe integrating the functionality projects of SFML into just one thing.

So what like taking Thor, SFGUI, SFNUL or whatever and just making one SFML-Extended project?
Title: Re: SFML 3 - What is your vision?
Post by: Ixrec on May 05, 2014, 11:32:19 pm
It just hit me: no one has brought up whether SFML 3 should switch to using exceptions for its errors or not.

Personally, I would like SFML 3 to use exceptions.  I've read about the arguments people have against them many times in the past, and I've never found them very persuasive.  The advantages of exceptions vastly outweigh the disadvantages in my mind.

Alternatively, it'd also be cool if SFML 3 offered the option to toggle between error codes and exceptions, though I'm not sure if that's feasible.  If it matters, I like the scheme used by boost filesystem where you pass an error code object to the function if you don't want it to throw exceptions.

Oh, and if sf::err continues to exist in SFML 3, at the very least it should be made more obvious in the tutorials.  I literally didn't know it existed for the first few months I was using the library.  I only started looking for it because I needed to get at shader compilation errors.
Title: Re: SFML 3 - What is your vision?
Post by: MorleyDev on May 05, 2014, 11:55:24 pm
Lately I've found the more I avoid the exception approach, the more I dislike the exception approach, the more I start to think that if recovery is probably, exceptions aren't the correct way to go.

Error condition resolving seems to have several approaches:
* Return object and throw exception on error. Immutable, but causes exceptions to be handled in an "expected" code path. Dislike.
* Return error code and emit value as an out parameter. Requires mutability for out parameters. Dislike.
* Return nullable/falsable data and use some other error reporting. Difficult in multithreaded scenarios as whilst values are immutable the errors mutable, and requires all returns to be checked despite that need being non-obvious. Dislike.
* Returning an explicit type that contains error details when error occurs, and the value when success occurs.  Still requires the check, but that need is more explicit. So far, the best approach I've found for when failure is an expected code path.

So loading a texture could look more like:
Code: [Select]
sf::Result<sf::Texture> texture = sf::Texture::loadFromFile("file.png");
if (!texture)
   std::cerr << texture.err() << std::endl;
sf::Texture actualTexture = *texture;

But exceptions are a common way of handling this, and I've even argued for them before. It comes down to the implied preconditions of the function. If the precondition doesn't specify that the file exists, then the response should reflect that and the optional pattern is the correct choice in my mind. An implied pre-condition to loadFromFile is that the file exists, so an exception is the correct response to trying to load when the file does not exist.
Title: Re: SFML 3 - What is your vision?
Post by: Tank on May 06, 2014, 08:54:18 am
MorleyDev, I find that very ugly. :P For me it's simple: loadFromFile() returns a texture, and if it can't, it throws, because that's not supposed to happen.
Title: Re: SFML 3 - What is your vision?
Post by: Nexus on May 06, 2014, 09:29:11 am
There's an important advantages of exceptions, that may sound counter-intuitive at first. When employing exceptions in the right scenarios, you end up with less error handling than with any other technique. The reason is that you can separate code that possibly throws and code that catches exceptions. Code that does something that may throw doesn't have to care, things can be handled at a much higher layer. Exception handling in C++ requires usually very few try-catch statements; this paradigm is fundamentally different from languages like Java, for example.

On the other hand, exceptions disrupt the program flow. In critical situations, this is intended, but they should not be overused in situations where no actual exceptional situation is present. And in my opinion, assert should be preferred for logic errors.

The pattern used by MorleyDev also exists, and it will be introduced in the C++ standard as std::optional. It's similar to boolean return types in the handling (which definitely have their use cases). But you're performing a heavy and unnecessary copy, a mistake that might be made by many people.
Title: Re: SFML 3 - What is your vision?
Post by: dk123 on May 06, 2014, 04:06:18 pm
I added a few opinions in a previous post, but I'd like to also add one thing:

- movie playback (desktop + android/ios)

With narrative becoming a key part in modern day games, movie insertion in games are becoming more and more an important element. It would be great if SFML could get this internally done and also on mobile platforms for SFML 3.
Title: Re: SFML 3 - What is your vision?
Post by: migizi on May 06, 2014, 06:46:22 pm
I'm just getting started with SFML but I'll put in my 2 cents so far.

C++11 required
OpenGL 3.2+ Core Profile (for desktop OGL).

Both of those offer performance improvements right off the bat. Mesa already has OGL 3.3 support so I think it's getting to that time when we drop legacy OGL and compatibility profiles.
Title: Re: SFML 3 - What is your vision?
Post by: Ixrec on May 06, 2014, 07:51:02 pm
@dk123: There is an extension called sfeMovie for playing videos with SFML.
Title: Re: SFML 3 - What is your vision?
Post by: slotdev on May 06, 2014, 08:32:48 pm
My vision is: not breaking the codebase on which I have done many, many projects which need maintaining ;)



Title: Re: SFML 3 - What is your vision?
Post by: slotdev on May 06, 2014, 08:35:34 pm
I'm just getting started with SFML but I'll put in my 2 cents so far.

C++11 required
OpenGL 3.2+ Core Profile (for desktop OGL).

Both of those offer performance improvements right off the bat. Mesa already has OGL 3.3 support so I think it's getting to that time when we drop legacy OGL and compatibility profiles.

I disagree - there are still a huge number of PCs out there with "legacy" OGL. Implement the new features of 3.3+ by all means, and allow people to use them, but don't break it for people who don't have modern systems.
Title: Re: SFML 3 - What is your vision?
Post by: migizi on May 06, 2014, 09:09:21 pm
I disagree - there are still a huge number of PCs out there with "legacy" OGL. Implement the new features of 3.3+ by all means, and allow people to use them, but don't break it for people who don't have modern systems.

If you watch Valve during the Steam Dev Days their hardware survey shows very little legacy hardware out there. Unless you are dealing with Intel cards that are pre 2012 then you'll have core profile support.

If SFML does hardware acceleration off the bat then I'm guessing they have OGL code in use. If you allow the foundation to switch between core profile and legacy then they need to maintain multiple back-ends. Why wouldn't it work to just use SFML < 3.0 for legacy stuff?

It's also been stated that SFML 3.0 is a ways out. Are you saying that by the time 3.0 comes out you are still going to be dealing with a "huge" number of people who can only run OGL 2.1?

To me it doesn't make sense to push for newer technology but leave some parts old because some people might need it. I would think it would be easier to back port some bug fixes to the 2.x branch and make 3.x completely modern.

I realize right now there is probably a lot of people with pre 2012 Intel GPUs, but we are talking the future. It would be naive to think people won't ever upgrade their hardware, let alone people who play games.

If SFML doesn't have any OGL code in use then specifying the context is good enough. It only matters if they use OGL code for the graphics module. If they don't then this whole post is moot.
Title: Re: SFML 3 - What is your vision?
Post by: binary1248 on May 06, 2014, 10:44:34 pm
I think people are jumping to conclusions too fast regarding legacy OpenGL support.

It is clear that restraining SFML purely to legacy OpenGL is probably not a good idea going forward, but that doesn't mean that SFML will have to completely drop legacy OpenGL support. The nice thing about OpenGL is that it has a (more or less) simple way of probing the hardware for capabilities. Most of the rendering currently done by SFML is agnostic of which API (legacy or modern) it is using. It will work with both.

This does not mean that using the modern API will not be better (faster) than the legacy API. I know from experience that AMD themselves are replacing hardware support for legacy API calls with software emulation, which is the reason why many older OpenGL games (e.g. older Id Tech games) show horrible performance with the latest drivers, requiring workarounds to restore the original performance.

That is one reason (even if a really stupid one) to slowly move forward with adoption of a more modern rendering implementation. Vendors will eventually cease to support the legacy API performance-wise. This is however not a problem for older hardware because chances are, they will use old drivers as well because newer drivers don't support them any more anyway.

The question people might be asking: How can SFML support the same uniform feature set regardless of the underlying rendering implementation?
The answer is simple: The features that SFML currently supports are so general that they are supported regardless of what API is used (this includes a possible DirectX implementation as well). SFML will never have to support any of the more "advanced" features that are only possible with modern APIs because such features are too specific to actually benefit enough users to justify supporting them in mainline SFML. This doesn't rule out any extensions that people might write, but those will come with their own requirements.

The message is: Don't worry about SFML dropping legacy OpenGL support. If we go ahead and abstract the rendering a bit more, whether it uses legacy OpenGL, modern OpenGL or even DirectX it won't make too much of a difference that we will have to even consider dropping support for legacy OpenGL. These things can all co-exist as support for them is not mutually exclusive in contrast to what certain big-name vendors might have you believe (looking at Microsoft's policy of only rolling out support for newer DirectX with newer versions of Windows ::)).
Title: Re: SFML 3 - What is your vision?
Post by: slotdev on May 06, 2014, 11:18:37 pm
Quote
If you watch Valve during the Steam Dev Days their hardware survey shows very little legacy hardware out there. Unless you are dealing with Intel cards that are pre 2012 then you'll have core profile support.

But this is SFML, and unless I am mistaken (I hope that I am!), it is not used for high end games such as you would get from proper game studios?

Quote
Why wouldn't it work to just use SFML < 3.0 for legacy stuff?

Because the maintainance of the library becomes an issue - who is spend time fixing bugs on 2.1?

Quote
It's also been stated that SFML 3.0 is a ways out. Are you saying that by the time 3.0 comes out you are still going to be dealing with a "huge" number of people who can only run OGL 2.1?

Yes, on nearly 63,000 systems to be precise. Some very old systems (Intel Extreme Graphics!) can only use OGL 1.0! We use SFML commercially, and need to support these legacy systems. Sure, they will be phased out over time, but we are talking maybe 3 years from now - minimum.

Quote
I realize right now there is probably a lot of people with pre 2012 Intel GPUs, but we are talking the future. It would be naive to think people won't ever upgrade their hardware, let alone people who play games.

There are a heck of a lot. You're forgetting that SFML lends itself very well to automated systems, and I know for a fact that it is used in kiosk, ATM & vending applications.
Title: Re: SFML 3 - What is your vision?
Post by: migizi on May 06, 2014, 11:36:15 pm
Well slotdev you pointed out the flaw in my assumptions. I don't think about all the industries that some of these libraries are used in. I tend to stay in my confined game programming bubble.

When you step outside the boundaries of game development then the range of hardware you have to support varies greatly.

But I think binary1248 put the argument to rest by saying that the man power and work required to abstract out the graphics section isn't a concern. I just want to make sure that we can continue to advance without stretching the resources too thin.

If I can have the option to use the core profile for the graphics module I'll be happy (not just creating the context but the built in hardware acceleration as well). For me legacy support isn't a concern like it would be for developers like slotdev.
Title: Re: SFML 3 - What is your vision?
Post by: Nexus on May 06, 2014, 11:47:52 pm
slotdev, those applications sound really interesting. Do you see other SFML modifications that could affect the mentioned systems, such as moving from C++98 to C++11?

Maybe in general, are there many people bound to compilers that don't even support basic C++11 (i.e. VS <2010, g++ <4.6)?
Title: Re: SFML 3 - What is your vision?
Post by: Tank on May 07, 2014, 10:57:53 am
I can understand that old systems have to be maintained, but what's wrong with staying at an older SFML version if that's what's already working?
Title: Re: SFML 3 - What is your vision?
Post by: slotdev on May 07, 2014, 11:00:39 am
slotdev, those applications sound really interesting. Do you see other SFML modifications that could affect the mentioned systems, such as moving from C++98 to C++11?

Maybe in general, are there many people bound to compilers that don't even support basic C++11 (i.e. VS <2010, g++ <4.6)?

There are for sure, in more industrial/commercial environments, a lot of people still use VS2008. Personally, I still use VS2005 for "systems" development and VS2010 for actual application (game..) development. So, enforcing C++11 could be a problem.

I worry we will lose the "S" in SFML.

Talking about industrial applications; you have to remember that replacing many thousands of PCs is very expensive - not only in the cost of the hardware, but the time and people required to do it. That is why it takes many years to update. Our oldest system we have to support is an Intel Celeron II based PC with 32mb VRAM. This is a nightmare, but we must do it.

Tank - the problem is more of a support one. If there is a major bug discovered, who is going to fix it? There is no incentive for people to work on 2.1 or whatever when 3.0 is the focus.
Title: Re: SFML 3 - What is your vision?
Post by: eXpl0it3r on May 07, 2014, 11:54:53 am
There are for sure, in more industrial/commercial environments, a lot of people still use VS2008. Personally, I still use VS2005 for "systems" development and VS2010 for actual application (game..) development. So, enforcing C++11 could be a problem.

I worry we will lose the "S" in SFML.
The "S" in SFML stands for "Simple" and the "Simple" stands for simplicity in usage. It's not meant as "simply backwards compatible with 10+ years old hardware".
C++11 has changed C++ itself a lot, but at best it simplifies programming with C++ itself. As such a move to C++11 will enforce the "S" even more.

Talking about industrial applications; you have to remember that replacing many thousands of PCs is very expensive - not only in the cost of the hardware, but the time and people required to do it. That is why it takes many years to update. Our oldest system we have to support is an Intel Celeron II based PC with 32mb VRAM. This is a nightmare, but we must do it.
To be honest, it's not SFML's concern at all, how a company spends their money and whether it's too expensive to upgrade or not. SFML is free and open source, it's nice that it gets used in various commercial products, but it's not something that needs to constrain the software itself. The "problem" here is not that SFML is moving forward, but the problem is that a company is trying to save money (nothing against you or company of course! :) ).
If SFML was owned/developed by your company everything would look different, but as in the past SFML will go its way in-depended of the needs of corporation.

Tank - the problem is more of a support one. If there is a major bug discovered, who is going to fix it?
At one point we as an SFML Team will move on, as it has happened with SFML 1.6. When this happens there won't be anyone that fixes issues of old versions for free, especially not if it's for a company.
Is it particularly nice? Probably not. Will it upset some people? Probably yes. Keep in mind however that's how things work all over the world. As an example just take Windows XP. Guess how many million machines still run on XP and yet Microsoft has cut-off support for it. Companies have offered millions of dollars to keep up support for Windows XP, but Microsoft declined.
With SFML as being open source you get a lot more options once you hit an issue:
Overall, you should not forget that everything we do here, is done for free.

There is no incentive for people to work on 2.1 or whatever when 3.0 is the focus.
The focus is still on SFML 2.x, this thread is merely here to gather what people envision SFML 3 to be, so we can create some sort of roadmap for SFML 2.x as well as SFML 3.x. As such it's kind of pointless discussing that new versions of SFML wouldn't work for you. First we need to figure out what the new version of SFML will be. :)
Title: Re: SFML 3 - What is your vision?
Post by: Tank on May 07, 2014, 12:50:47 pm
Quote
Tank - the problem is more of a support one. If there is a major bug discovered, who is going to fix it? There is no incentive for people to work on 2.1 or whatever when 3.0 is the focus.
I can perfectly understand that, however it's important to also understand that SFML does not offer any guaranteed support. You will have to choose between options eXpl0it3r mentioned.

Though we try hard to maintain backwards-compatible as much as it makes sense, of course.
Title: Re: SFML 3 - What is your vision?
Post by: slotdev on May 07, 2014, 01:08:43 pm
Quote
As such a move to C++11 will enforce the "S" even more.

..and people who don't use C++11 will have to go and learn a whole new set of skills. A good thing, but you're only going to get questions from people who don't know it inside out. Allow it, but don't enforce it.

Quote
To be honest, it's not SFML's concern at all, how a company spends their money and whether it's too expensive to upgrade or not.

Indeed. But there are real people who want to make games or whatever using SFML, who maybe don't have much money, and so buying new hardware also isn't an option.

Quote
Overall, you should not forget that everything we do here, is done for free.

I know, but also remember that there are companies and individuals who donate hundreds, if not thousands of Euros every year to allow the purchase of hardware, etc, which also allows the project to continue... ;)
Title: Re: SFML 3 - What is your vision?
Post by: select_this on May 07, 2014, 01:19:51 pm
I know, but also remember that there are companies and individuals who donate hundreds, if not thousands of Euros every year to allow the purchase of hardware, etc, which also allows the project to continue... ;)

If someone was bankrolling the development of SFML I'd sympathise with this argument, but as it stands it's a little too indirect.

I'm not even sure how you'd enforce the end user to use C++11 anyway; SFML's ultimately a library, not a framework.

EDIT: forgot to mention that overall I'm sympathetic to your viewpoint, though I don't share the same concerns.
Title: Re: SFML 3 - What is your vision?
Post by: Laurent on May 07, 2014, 01:41:33 pm
Supporting C++11 will allow nice additions, but it won't replace many things. After this change, I think you'll still be able to write a program that uses mostly C++98, if you want to.

Regarding backward compatibility and maintenance of older versions, it's true that we'll move forward and focus on improving the latest versions, but I think it would be wise to spend some time back-porting bug fixes to the latest revision of the previous major version (i.e. 2.x after 3.0 is out). If we want SFML to be used in the real world, and not only for short-term small projects, we have to care a minimum about backward compatibility, and not abandon users who would not stick to the latest version. So where should the limit be? I don't know, but this should definitely be discussed.
Title: Re: SFML 3 - What is your vision?
Post by: eXpl0it3r on May 07, 2014, 02:00:51 pm
Supporting C++11 will allow nice additions, but it won't replace many things. After this change, I think you'll still be able to write a program that uses mostly C++98, if you want to.

Regarding backward compatibility and maintenance of older versions, it's true that we'll move forward and focus on improving the latest versions, but I think it would be wise to spend some time back-porting bug fixes to the latest revision of the previous major version (i.e. 2.x after 3.0 is out). If we want SFML to be used in the real world, and not only for short-term small projects, we have to care a minimum about backward compatibility, and not abandon users who would not stick to the latest version. So where should the limit be? I don't know, but this should definitely be discussed.
If it can be done easily/nicely then sure. So yeah we'll have to discuss this in detail.

..and people who don't use C++11 will have to go and learn a whole new set of skills. A good thing, but you're only going to get questions from people who don't know it inside out. Allow it, but don't enforce it.
The discussion around C++11 is only whether the compiler has to support it or not. As for using SFML's public API you most likely won't have to know C++11, but if you do, you might be able to write more performant and nicer code.

Indeed. But there are real people who want to make games or whatever using SFML, who maybe don't have much money, and so buying new hardware also isn't an option.
Yes, unfortunately we can't limit innovation to support someone's old hardware. I mean we're working for free and try to listen as much to the community as possible, so if there's anything specific that wouldn't work for someone, we'll try to find a satisfying solution for both sides.
If you think that's not enough, then I might point you to the commercial sector, where everything is done based on profit. Have you seen AMD, Nvidia or Intel releasing new drivers for dead old hardware? ;)

I know, but also remember that there are companies and individuals who donate hundreds, if not thousands of Euros every year to allow the purchase of hardware, etc, which also allows the project to continue... ;)
Again, not really a concern regarding SFML's development. If we would calculate all the time Laurent and all other developers of SFML spent on developing and supporting this project and multiply it with a "normal" senior developer salary, the cost on hardware would rather quickly shrink in comparison.

Just out of curiosity, if you're allowed/willing to tell us. Which company do you work for? In what kind of kiosks does SFML get used?
I mean in the end, one could always discuss/think about something like a partnership - libraries that are backed by companies often gain in popularity and over all code quality. Not that this is in any way my decision to make, just thought I throw it out there. :D
Title: Re: SFML 3 - What is your vision?
Post by: slotdev on May 08, 2014, 10:22:42 am
Quote
Just out of curiosity, if you're allowed/willing to tell us. Which company do you work for? In what kind of kiosks does SFML get used?
I mean in the end, one could always discuss/think about something like a partnership - libraries that are backed by companies often gain in popularity and over all code quality. Not that this is in any way my decision to make, just thought I throw it out there. :D

I'm the CTO of Betdigital in the UK. We're a small team - 5 coders (inc myself) and 4 artists. We develop casino style games for gaming terminals and online casinos, etc. Google us :)

We would almost certainly support SFML financially on a more permanant basis. Laurent and I have kind of discussed this in the past, and it's something I have on my list to sort out this year, especially since we are moving towards mobile games more and more. With the port to Android and iOS, it makes SFML even more attractive for commercial use, and so we have an obligation to support it as best we can.
Title: Re: SFML 3 - What is your vision?
Post by: migizi on May 08, 2014, 04:21:37 pm
I think that commercial support would greatly help, even if it isn't on the scale of Valve and SDL. Competition is healthy and SDL and SFML do similar things but with different goals. I was using GLFW before I came to SFML but I made the switch because SFML will save me some time on my current project.

I don't know how popular https://www.bountysource.com/ is but it could benefit SFML if people are willing to put bounties on bugs and features. Might get us to version 3.0 a little sooner :D
Title: Re: SFML 3 - What is your vision?
Post by: eXpl0it3r on May 08, 2014, 04:30:08 pm
I don't know how popular https://www.bountysource.com/ is but it could benefit SFML if people are willing to put bounties on bugs and features. Might get us to version 3.0 a little sooner :D
As seen here (http://en.sfml-dev.org/forums/index.php?topic=15168.0) we don't have the money to do that. ;)
Title: Re: SFML 3 - What is your vision?
Post by: migizi on May 08, 2014, 04:54:23 pm
As seen here (http://en.sfml-dev.org/forums/index.php?topic=15168.0) we don't have the money to do that. ;)

I didn't mean SFML do it directly. I'm mean people outside the dev team put out bounties, just like the commercial support option. We obviously can't enforce any of that but maybe by mentioning it in the forum it will be brought to the attention of people who are looking for certain fixes or features.
Title: Re: SFML 3 - What is your vision?
Post by: slotdev on May 08, 2014, 05:14:09 pm
I think this thread is going a bit OT (probably my fault in a lot of ways) but its a good debate to have.

If the SFML community can get its heads together and decide what it wants, with some solid reasons *why* it wants it and what it needs (both in time and money) to achieve the goals, then I can certainly look to get some funding in place.

..and no, buying everyone a new tablet isn't an option. Buying core developers one, however, certainly is.

;)
Title: Re: SFML 3 - What is your vision?
Post by: migizi on May 08, 2014, 05:29:08 pm
I'm wondering if it wouldn't be helpful to find another way to gather all the feature requests into an area people can vote on. Like GOG.com does with their community. It would still be up to the developers but I think that would help point the library in a direction that benefits the most people.
Title: Re: SFML 3 - What is your vision?
Post by: Nexus on May 08, 2014, 05:37:51 pm
I personally prefer the current way of publicly discussing features and bringing rational arguments for or against it -- number of people (or clicks, even worse) is not the best indicator of the importance of a feature. Furthermore, voting systems tend to be biased (either by rewarding high ranked entries and punishing low ranked ones, or by leading to political rather than rational campaigns, or by not accounting for the fact that number of votes and number of actual people interested need not be equal).
Title: Re: SFML 3 - What is your vision?
Post by: binary1248 on May 08, 2014, 06:14:16 pm
For those who are interested, Epic recently made public their UE4 Roadmap (https://trello.com/b/gHooNW9I/ue4-roadmap) and enabled voting to gauge community interest in certain features. According to them, voting alone doesn't directly influence what gets higher priority but it does factor into their planning updates.

While I do agree with Nexus that voting for features shouldn't be the dominant metric, it would provide feedback where it is needed. Right now, we only have this thread to gauge what people want to see in SFML 3, but there is no way to tell what the people who didn't post here might want or be interested in. They might support some of the points already mentioned here but just didn't voice it for fear of making a redundant post (it is coming to the point where most of the new posts mention things that were already mentioned before). Forums aren't a good way to tally the support for certain things anyway, unless a poll is opened. But with this many things to vote on, a poll will also become overly complex.

And about the second point: Voting always tries to be representative. Just like elections in real life, not everybody goes and votes. It takes way more effort than voting for something online, and most of the time your vote doesn't seem to make a difference to your daily life anyway ;D. This would not be the case if we went ahead and tried something for SFML. Surely not everybody using SFML will vote, but the same applies: we can only hope it will be representative. If you think you are part of a minority group, then the best thing to do to show your interests is go and vote ;).

Disclaimer: The fact that I encourage voting has nothing to do with me being Swiss.
Title: Re: SFML 3 - What is your vision?
Post by: migizi on May 08, 2014, 06:54:29 pm
If you've seen GOG.com and their community voting each idea has a vote counter and then comments. I don't know if there are any easy to deploy options for this but it may be an option. It gives people the ability to easily search and add features and discuss them.

With that option each feature would have it's own discussion so that items are not lost in the shuffle.

But in the end it's about creating a useful tool within the constraints of the development teams time and effort. Even GOG has features that have been sitting at number one for a long time but they haven't had the time, power (man or influence), or some other reason to add them. I'm sure we all understand that we are using a library created by people volunteering their time and effort.

I'll admit when I looked at this thread I only looked at the first couple of a pages before replying. It's become rather larger and hard to get started on if you jump into the mix now.
Title: Re: SFML 3 - What is your vision?
Post by: Jebbs on May 09, 2014, 04:29:12 am
I'm not sure how beneficial this would be, but after reading some of the suggestions here, and reading many of the ones found in the regular Feature Request area, I was thinking that it might be useful to have some sort of structured way of suggesting features. People seem to just keep shouting out "feature xyz" and that's about it. That's cool and all, but it sometimes leaves the devs thinking, "what the heck is xyz?" or maybe, "who would need such a feature?" We all like to see complete and minimal code examples, why not complete and minimal feature requests? Something like:

Name of the feature.

What it is(if it might not be self explanatory by the name).

Why you think it should be added and/or a use case scenario.

Having all this information will probably be beneficial for a lot of reasons. Just my two cents.
Title: Re: SFML 3 - What is your vision?
Post by: Nexus on May 09, 2014, 09:51:56 am
I totally agree with you, Jebbs. We're currently developing some general guidelines for contribution. This concerns not only the feature request, but the whole process: suggest, discuss, submit pull request, edit, etc.
Title: Re: SFML 3 - What is your vision?
Post by: Tank on May 09, 2014, 10:28:54 am
There really should be a way of managing the requests better. Personally I have the problem that I quickly lose overview in a forum, because current stuff gets mixed with old stuff. And once you have read the threads marked with "New posts!", it's difficult to remember what's still important and what not.

Just like with this thread: One has to go through *all* posts for collecting all the ideas etc. GitHub's issue tracker would work, however then ideas would be mixed with actual issues, which is not an option as well.

I agree to Nexus that a 100% free-form voting would end up in SFML becoming a 2D game engine with a world editor, tons of effects and a class "sf::GameGenerator" -- probably not what this library is intended for. ;) However a mixture might be interesting, i.e. feature requests are made, everybody discusses them, based on arguments it's accepted or declined, and if it's accepted, people might vote for influencing priority/severity (is that what you meant, binary1248?).
Title: Re: SFML 3 - What is your vision?
Post by: binary1248 on May 09, 2014, 12:43:06 pm
However a mixture might be interesting, i.e. feature requests are made, everybody discusses them, based on arguments it's accepted or declined, and if it's accepted, people might vote for influencing priority/severity (is that what you meant, binary1248?).
This is what I understood when I saw the UE4 roadmap. They took requests into consideration and only put up the ones they thought made sense. Then they let the community decide which ones were most important to them (i.e. should be done first) by enabling voting. Voting only influences the priority already confirmed features get, not what new features are going to be implemented.
Title: Re: SFML 3 - What is your vision?
Post by: Rosme on May 12, 2014, 08:09:55 pm
For the voting system, you folks might be interested in UserVoice (https://www.uservoice.com/). Everyone gets a limited amount of vote and you can discuss whatever feature you want.
Title: Re: SFML 3 - What is your vision?
Post by: Kojay on May 15, 2014, 02:42:11 pm
Perhaps SFML 3 can feature genuinely modern C++. Currently, the only sense in which this is true is that it is not C, ie it is object-oriented and employs RAII. Other than that, it has little to do with the STL, the Boost libraries or Alexandrescu's book bearing that title.


That said, these are merely observations and do not indicate whether the library should go down this road. As Stepanov said, go look at people's code. In SFML's case that's almost certainly indie games. Ideally, code from such projects should be scrutinized to abstract data structures and/or algorithms from. New features added through this method are bound to be useful.
Title: Re: SFML 3 - What is your vision?
Post by: select_this on May 15, 2014, 03:26:12 pm
Perhaps SFML 3 can feature genuinely modern C++...

Irritating buzzword at the beginning aside (and I'm not blaming you for that :)) I concur that scouring other projects for ideas and inspiration could generate interesting discussion. My only reservation is we could end up with a 'wouldn't it be great if...' scenario and the library could become hideously bloated, or even end up accidentally specializing in certain application types / genres.

As for the API and implementation details, anything that simplifies and / or clarifies the API would of course be most welcome. I don't know if the team plan to have an 'anything goes' attitude to breaking the API between versions 2 and 3, though.
Title: Re: SFML 3 - What is your vision?
Post by: Nexus on May 15, 2014, 04:08:49 pm
To be honest, I don't think "Modern C++ Design" as explained by Alexandrescu or implementations in the Boost libraries are the best examples of modern productive C++ code. They show the borders of the programming language and what is theoretically possible, but it's not always a good idea to use those techniques in practice.

For a functionality-focused library like SFML (rather than one that provides features for the language itself), these concepts complicate everything. Concepts require code to be written as templates, i.e. forcing definitions in headers, delaying/hiding compile errors, exposing internals and making compile times explode. Concepts make interfaces implicit; one must read the documentation in order to know an API can be used. They abstract from the obvious parts and make APIs less simple to use.

There are cases where this is appropriate, such as Boost libraries that aim to be usable with all sorts of existing code. However, this genericity comes at a high cost. In my personal opinion, various parts of Boost are overengineered beyond hope; Boost.Graph is such an example. Just compare it with LEMON -- another graph library that is still very generic and uses modern C++ code, but it's way simpler to use, exactly because the developers found a reasonable trade-off between genericity and user-friendliness.
Title: Re: SFML 3 - What is your vision?
Post by: select_this on May 15, 2014, 04:15:14 pm
That was a point I was going to mention, actually - I would implore to all and sundry that we don't end up with anything resembling Boost and its template hell in any way.
Title: Re: SFML 3 - What is your vision?
Post by: Laurent on May 15, 2014, 04:25:26 pm
Quote
I would implore to all and sundry that we don't end up with anything resembling Boost and its template hell in any way
Do you really think I would allow such things, after 7 years of efforts to keep SFML clean? ;)
Title: Re: SFML 3 - What is your vision?
Post by: select_this on May 15, 2014, 05:12:14 pm
Do you really think I would allow such things, after 7 years of efforts to keep SFML clean? ;)

You're not the only big fish in the pond now ;). However, from what I've seen the team buy into the same philosophy (as do I). The post was more of an addendum to my previous one about the vagaries of 'modern C++' (ugh, I hate that buzzword so so so much).

EDIT: Bad Darren forgot to remove the nested quote...
Title: Re: SFML 3 - What is your vision?
Post by: binary1248 on May 15, 2014, 06:44:57 pm
I think we can all agree on the fact that when SFML takes advantage of C++11, it should focus solely on making the developers' lives easier through use of the new language features. I too don't want SFML to become yet another boost-like C++ demo "just because" it is possible. This is also the reason why I tend to stay away from boost as best I can, some of it is useful (shared_ptr, regex, etc.) but most of it is still over-engineered by people who really have nothing productive to do with the language ;).
Title: Re: SFML 3 - What is your vision?
Post by: Kojay on May 15, 2014, 10:54:25 pm
For a functionality-focused library like SFML (rather than one that provides features for the language itself), these concepts complicate everything. Concepts require code to be written as templates, i.e. forcing definitions in headers, delaying/hiding compile errors, exposing internals and making compile times explode. Concepts make interfaces implicit; one must read the documentation in order to know an API can be used. They abstract from the obvious parts and make APIs less simple to use.

These are shortcomings of the language, not a case against generic programming. Concepts are not currently a feature of the language, hence the obscure errors and lack of helpful intellisense. There is a discussion group and eventually they will be included in the standard; they are the cutting edge, whereas oop and RAII are as old as C++ itself.

Cleanliness, the design of specific libraries... not going to argue over such things.  I stated in the previous post what I think is the ideal method to determine new features.
Title: Re: SFML 3 - What is your vision?
Post by: Nexus on May 15, 2014, 11:11:56 pm
Concepts are not currently a feature of the language, hence the obscure errors and lack of helpful intellisense.
You're right that these specific issues are mitigated when concepts are integrated as a language feature, but many of the problems I stated will remain as a result of the template-based implementation.

they are the cutting edge, whereas oop and RAII are as old as C++ itself.
Being new doesn't imply meaningful applicability to all code. For example, a lot of C++11 features are only interesting for designers of generic, language-focused libraries. C++ has always been a language with a wide range of paradigms, and most applications make only use of a specific subset.

By the way, while basic RAII has existed since C++98, resource handling has become more powerful with new language features, e.g. move semantics for unique ownership or noexcept for strict exception guarantees.

Anyway, until C++17 it's a long time. It takes even longer until concepts are fully supported on major compilers, and yet longer until they're adopted by the C++ community.
Title: Re: SFML 3 - What is your vision?
Post by: Ixrec on May 15, 2014, 11:56:54 pm
sf::Vector is a template but this genericity is mostly wasted as sf::Vector2f is the bread-and-butter point throughout the library. While the case could be made that OpenGL handles floats anyway, a whole host of other classes could fulfill the float-coordinate Point concept.

What exactly do you mean by "wasted"?  Vector2f, Vector2i and Vector2u are used pretty much everywhere in SFML where it would make any sense to do so.  The fact that Vector2f makes sense the most often has more to do with the way graphics work than the way SFML is designed.

More importantly, the Vector2<T> template is such an incredibly simple class that using it and converting to/from it is effortless, so the benefit of replacing it with a "Point concept" seems negligible at best.  We'd still need separate concepts for float, integer and unsigned points anyway, so it wouldn't make things any simpler.

Quote
Adapting SFML's classes to Boost.Geometry's concepts makes evident that sf::Shape, sf::Sprite and sf::VertexArray are effectively ranges of points - additionally associated with colors and/or a texture. Conceivably, a std::vector<std::complex<float>> could serve just as well.

sf::Shape::getPoint, sf::VertexArray::operator[] and sf::Image::getPixel are essentially methods of iteration, yet require additional work to apply generic algorithms on them.

SFML already allows you to use an array of sf::Vertex instead of shapes and sprites, which would get you a lot of that genericity.  I can definitely see an argument for making sf::VertexArray behave more like an STL container with proper iterators (especially since it calls itself an array), but for something like sf::Image, sf::Sprite or sf::Shape, it seems like anyone who wants that level of genericity shouldn't be using such high-level abstractions to begin with.
Title: Re: SFML 3 - What is your vision?
Post by: eXpl0it3r on May 16, 2014, 12:01:08 am
I can definitely see an argument for making sf::VertexArray behave more like an STL container with proper iterators (especially since it calls itself an array)
This would be a total waste. sf::VertexArray is nothing else than a std::vector<sf::VertexArray>, adding more std::vector "features" would only lead to useless code duplication. If you want iterators etc. just role your own vector of vertices. ;)
Title: Re: SFML 3 - What is your vision?
Post by: Ixrec on May 16, 2014, 12:15:19 am
This would be a total waste. sf::VertexArray is nothing else than a std::vector<sf::VertexArray>

Not quite.  The main difference is sf::VertexArray is a Drawable so it lets you simply do window.draw(myVertexArray) without worrying about all the render states.

It'd be nice if there was a way to make it so window.draw() could take a std::vector of sf::Vertex, but a complete solution to that minor problem would probably end up resembling one of those over-engineered boost libraries, so it's fine the way it is.


Never mind, that was dumb.
Title: Re: SFML 3 - What is your vision?
Post by: G. on May 16, 2014, 12:19:26 am
It'd be nice if there was a way to make it so window.draw() could take a std::vector of sf::Vertex
?
It already does (http://www.sfml-dev.org/documentation/2.1/classsf_1_1RenderTarget.php#ab636d7363f6681077361ee274ba89a8d). It's even shown at the end of this chapter in the vertex array tutorial (http://www.sfml-dev.org/tutorials/2.0/graphics-vertex-array.php#a-simple-vertex-array). :p
Title: Re: SFML 3 - What is your vision?
Post by: myl on May 26, 2014, 11:46:28 pm
Maybe it's time to introduce the SFML Video module? I'm not even sure it would be that much work if based on ffmpeg :P

Shouldn't video playback be a basic component of a Simple and Fast Multimedia Library ?

myl
Title: Re: SFML 3 - What is your vision?
Post by: Jebbs on May 27, 2014, 05:32:59 am
Maybe it's time to introduce the SFML Video module? I'm not even sure it would be that much work if based on ffmpeg :P

Shouldn't video playback be a basic component of a Simple and Fast Multimedia Library ?

myl

I've always thought the same. I feel like video playback is definitely in the scope of a multimedia library. I think I remember seeing the reasoning behind it once, but when and where escapes me.
Title: Re: SFML 3 - What is your vision?
Post by: Laurent on May 27, 2014, 07:31:42 am
Yes, I think it would fit. But ffmpeg (which is the only reasonable backend to implement such a module), is a huge dependency, and apparently a pain to build.

This can be investigated though. We have a former member of the SFML team who has already developed such an extension (sfeMovie), that could be a good starting point.
Title: Re: SFML 3 - What is your vision?
Post by: Lolilolight on May 27, 2014, 08:16:27 am
Ha yeah it would be nice for games cinematic and history.
Can't wait until SFML 3.  :D
Title: Re: SFML 3 - What is your vision?
Post by: Syntactic Fructose on May 30, 2014, 04:10:17 pm
Some C++11/14 integration would be pretty cool to see in SFML  ;D. I've been a huge fan of the project since it's birth, and would love to be able to give a talk on SFML in the upcoming C++Now 2015 or Cppcon 2015
Title: Re: SFML 3 - What is your vision?
Post by: Jabberwocky on May 30, 2014, 06:32:00 pm
My SFML 3.0 priorities would be:
1.  continued focus on porting to new platforms
2.  performance enhancements (batching, atlases, etc)

I'm excited about the mobile device ports.  Anything that might help out with a console port would be equally awesome.  There's been a pretty big push from the console makers (especially PS4) to become more indie inclusive.

Thank you Laurent and the SFML Team for your great work.
Title: Re: SFML 3 - What is your vision?
Post by: Jabberwocky on May 30, 2014, 06:47:01 pm
Lower priorities, but still worth consideration would be:
1.  Particles
2.  Animation

I see Thor offers both these, but I haven't looked into it too much yet.

I think Particles would just be an overall win, and would find widespread use among SFML users.

Animation is tricky, because different folks will want to do it differently (e.g. sprite sequences vs 2D skeletons).  I suspect a lot of advanced users may end up coding their own anyway.  Still, a simple default implementation might do a lot to further increase the popularity of the library.
Title: Re: SFML 3 - What is your vision?
Post by: Ruckamongus on May 31, 2014, 02:45:02 am
There really should be a way of managing the requests better. Personally I have the problem that I quickly lose overview in a forum, because current stuff gets mixed with old stuff. And once you have read the threads marked with "New posts!", it's difficult to remember what's still important and what not.

Just like with this thread: One has to go through *all* posts for collecting all the ideas etc. GitHub's issue tracker would work, however then ideas would be mixed with actual issues, which is not an option as well.

I agree to Nexus that a 100% free-form voting would end up in SFML becoming a 2D game engine with a world editor, tons of effects and a class "sf::GameGenerator" -- probably not what this library is intended for. ;) However a mixture might be interesting, i.e. feature requests are made, everybody discusses them, based on arguments it's accepted or declined, and if it's accepted, people might vote for influencing priority/severity (is that what you meant, binary1248?).

Tello might be something worth looking into. Here's the feature tour and an example:
https://trello.com/tour (https://trello.com/tour)
https://trello.com/b/nC8QJJoZ/trello-development (https://trello.com/b/nC8QJJoZ/trello-development)
Title: Re: SFML 3 - What is your vision?
Post by: infinitebox on May 31, 2014, 07:13:39 am
Quote
Tello might be something worth looking into. Here's the feature tour and an example:
https://trello.com/tour
https://trello.com/b/nC8QJJoZ/trello-development

This might work!

Nate, the author of Spine (a skeletal 2D animation tool for games) uses it for the Spine editor and runtimes. There are several running list of tasks/features and stuff that he's working on and everyone can comment and vote for features.
https://trello.com/b/dle5mTBW/spine-runtimes (https://trello.com/b/dle5mTBW/spine-runtimes)
https://trello.com/b/frGlgsF7/spine-editor (https://trello.com/b/frGlgsF7/spine-editor)
Title: Re: SFML 3 - What is your vision?
Post by: Juhani on June 01, 2014, 05:57:49 pm
As promised we as the new team, would like to be more open towards the community especially regarding the current development. We're currently discussing on how to approach things after SFML 2.2 and as such, we need to figure out what SFML 3.0 should actually be about.

Keep in mind this shouldn't really be about simple feature requests, for that we have dedicated forum, this should be more about what SFML 3 should offer besides a few new feature. For example: How the graphics API should be changed/opened/advanced, or whether C++11 should be non-optional, or should we change the way window states are handled, or etc...
We won't make any decisions here, we simply want to hear the ideas from all community members.

What is your vision of SFML 3?

Basically all computer programs receive information and send information; just the source/destination varies. The source may be user input (not just mouse+keyboard, but microphone and webcam), any mass storage, the clipboard or something else. The destination may be the monitor, speakers, printer, any writable storage, the clipboard, or something else.

SFML's job is to provide a simple & fast multiplatform interface to receive that information, and send it. That's what I call a multimedia library.

I don't see a reason to avoid C++11 if that is useful.
Title: Re: SFML 3 - What is your vision?
Post by: Jesper Juhl on June 08, 2014, 06:59:18 pm
Add this to what I've already posted as my 3.0 wish-list:

- IPv6 support.
- Support for multiple monitors.
- Use of modern OpenGL.
- HTTPS support.
Title: Re: SFML 3 - What is your vision?
Post by: achpile on June 24, 2014, 01:07:22 am
All I want is a Line class >.<
Yup, the line is a rectangle shape with height = 1, but everytime I need to draw line, I have to calculate length and angle =)

(It was too hard to draw lightnings with rectangles  ;D)

Title: Re: SFML 3 - What is your vision?
Post by: eXpl0it3r on June 24, 2014, 01:54:36 am
Depending on what exactly you want to do, you can also just use a vertex array with the primitive type "Lines" or "LinesStrip". ;)
Title: Re: SFML 3 - What is your vision?
Post by: Ganado on June 24, 2014, 02:11:48 am
Very small feature:
Just as a sf::Transformable has a setPosition(float x, float y) as well as a setPosition(const sf::Vector2f& position),
it'd be nice if the setSize(const sf::Vector2f& position) function could also be setSize(float x, float y).
Title: Re: SFML 3 - What is your vision?
Post by: Laurent on June 24, 2014, 07:52:00 am
setSize in which class?
Title: Re: SFML 3 - What is your vision?
Post by: Peteck on June 24, 2014, 10:20:56 am
- Support for multiple monitors.
I'm curious, what do you mean by multiple monitor support? :-)
Title: Re: SFML 3 - What is your vision?
Post by: eXpl0it3r on June 24, 2014, 11:01:08 am
I'm curious, what do you mean by multiple monitor support? :-)
Currently it's not possible to specify on which monitor a window should be created. Actually SFML doesn't even "know" that there are multiple monitors, it always just assume the primary monitor is the only monitor in existence.
I guess "multi monitor" can be split into two categories:

I'm sure the first part will get into SFML at some point, while for the later I've no idea how it works and what would need to be done.
Title: Re: SFML 3 - What is your vision?
Post by: Kojay on June 24, 2014, 04:18:47 pm
All I want is a Line class >.<
Yup, the line is a rectangle shape with height = 1, but everytime I need to draw line, I have to calculate length and angle =)

(It was too hard to draw lightnings with rectangles  ;D)

I concur. Yes it is possible to accomplish with the existing tools but the same could be said of the other shapes. First of all, lines drawn as vertex arrays with the primitive "Lines" are 1 pixel thick and stand apart from other shapes. Then if you decide that you want a line with thickness instead, you switch to rectangle shape - an 'implementation change' that is not seamless. In both cases you 're writing boilerplate; all in all, the absence of a LineShape has always been a very odd omission.

Very small feature:
Just as a sf::Transformable has a setPosition(float x, float y) as well as a setPosition(const sf::Vector2f& position),
it'd be nice if the setSize(const sf::Vector2f& position) function could also be setSize(float x, float y).

Guessing that setSize is from 1.6. setScale() does have such an overload, if anything however I would argue for its removal. One of the strengths of C++ is its emphasis on types, this kind of overloads defeats it. Moreover, in C++11 you may write

setScale({x,y})
 
Title: Re: SFML 3 - What is your vision?
Post by: Laurent on June 24, 2014, 04:49:18 pm
Yes, these overloads will probably be removed when we switch to C++11.
Title: Re: SFML 3 - What is your vision?
Post by: Zephilinox on June 25, 2014, 12:26:06 pm
I'd like Sprite Batching, the ability to modify the style/colour of substrings of sf::Text, and a way of setting an outline for sf::Text.

A Line class would be nice too, I think it was removed from a previous version, I guess for performance issues? Would spite batching resolve those issues?

I'd also like to see more work done on the other areas of SFML, like Audio and Networking, which are generally forgotten. Though I have no specific suggestions in mind. I don't feel like there are any good frameworks out there for audio and networking that are both easy and simple.
Title: Re: SFML 3 - What is your vision?
Post by: MorleyDev on June 25, 2014, 12:35:02 pm
Well UPnP (http://en.wikipedia.org/wiki/Universal_Plug_and_Play) support would be nice for Networking, but I'm not exactly holding my breath for it.

Though with the Android/iOS release, a simple cross-platform UPnP would be neat. Allow for things written in SFML that can detect other players on the WiFi like Minecraft Mobile does.
Title: Re: SFML 3 - What is your vision?
Post by: Ganado on June 25, 2014, 07:24:25 pm
@Kojay
Wait, I still don't get why doing that overload is a bad thing. Why not have give the option to write it either way?
Title: Re: SFML 3 - What is your vision?
Post by: Nexus on June 25, 2014, 10:37:55 pm
Why not have give the option to write it either way?
Having only a vector overload encourages people to use vectors instead of separate components, which is generally a good thing. Also, it is more consistent with the rest of the API... unless you want every function to take separate components, but then also colors and rects.
Title: Re: SFML 3 - What is your vision?
Post by: Kojay on June 26, 2014, 04:06:14 pm
@Kojay
Wait, I still don't get why doing that overload is a bad thing. Why not have give the option to write it either way?

Type safety is one of C++'s crown jewels. If you mean to pass a vector, pass a vector. See this presentation by Bjarne Stroustrup:

http://youtu.be/0iWb_qi2-uI?t=19m7s

It's true these overloads are present in several libraries for ease of use - Qt employs them exensively. But with C++11, there's no excuse.
Title: Re: SFML 3 - What is your vision?
Post by: Tex Killer on June 30, 2014, 09:20:56 pm
Hey guys...

I've been away from the forum for a long time, so I'm sorry if these issues were already taken care of.

The issues I wish were addressed by SFML3 (if not already) would be:

1) Clipping masks, or some way of having polygon-shaped views (http://en.sfml-dev.org/forums/index.php?topic=9877.msg67745#msg67745)
2) Audio listener rotation support (http://en.sfml-dev.org/forums/index.php?topic=7995.0)
3) Optional MIDI support as add-on of instrument banks, that could be plugged to SFML if there was need for it (http://en.sfml-dev.org/forums/index.php?topic=7079.msg46850#msg46850)
4) Support for custom loop points for the audio module, or a way to achieve it without having to hack SFML's sources (https://github.com/SFML/SFML/issues/177 and http://en.sfml-dev.org/forums/index.php?topic=6213)

Thanks
Title: Re: SFML 3 - What is your vision?
Post by: Ixrec on June 30, 2014, 09:33:08 pm
I believe #2 actually happened (https://github.com/Foaly/SFML/commit/a9096c04cbfa5626c6cb5ee661c3287f8755a0ce) and #4 came very close to happening (https://github.com/SFML/SFML/pull/629).  Dunno about the others.
Title: Re: SFML 3 - What is your vision?
Post by: Laurent on June 30, 2014, 09:52:45 pm
Quote
4) Support for custom loop points for the audio module, or a way to achieve it without having to hack SFML's sources
This will at least soon be possible without hacking into SFML sources, with the coming modifications to the audio module.
Title: Re: SFML 3 - What is your vision?
Post by: Arvamer on June 30, 2014, 09:54:46 pm
I want only joystick force feedback.
Title: Re: SFML 3 - What is your vision?
Post by: Tex Killer on June 30, 2014, 10:55:45 pm
My understanding is that https://github.com/SFML/SFML/pull/629 is not integrated on SFML, right?

If it is just one implementation made by users, I've already coded one for my engine and have been using it for a while. I've made a version of it avaliable here: http://en.sfml-dev.org/forums/index.php?topic=6213

Laurent, how will it be done without hacking into SFML sources? Are you going to make SoundFile public?
Title: Re: SFML 3 - What is your vision?
Post by: Laurent on July 01, 2014, 07:45:04 am
Quote
Are you going to make SoundFile public?
Exactly.
Title: Re: SFML 3 - What is your vision?
Post by: Hanmac on July 03, 2014, 02:38:52 pm
what i would like:

Title: Re: SFML 3 - What is your vision?
Post by: Laurent on July 03, 2014, 02:54:40 pm
Quote
Adding Thor ParticleSystem & Animation
SFML is a multimedia library, not a game library ;)
So let's keep these more advanced concepts in add-on libraries like Thor.

Quote
adding more sound formats, specially midi, might be pluginable for other stuff like gstreamer, pulseaudio or JACK
This is something that we'll consider with the new sound file system.

Quote
if thinking about Video, a render video to RenderTarget would be fun
The main blocking point about video is the huge list of dependencies needed, their license and their build system (yes, I have ffmpeg and all its codecs in mind).

Quote
Ogre CompositorChain with that you can have multiple gpu programs/shader for rendering one viewport
This is a bit too high-level.

Quote
sf::Shader add way to get the type of a parameter from the program if possible
I don't think if OpenGL gives this option, and I have no idea why one would have to do that. You're supposed to know what types you've declared in your shader...

Quote
does SDL2 have something we might need?
SDL 2 is always an interesting source of inspiration, but we'd like to avoid "please implement X because SDL has it" ;)

Quote
Have Styleable Text where TextSections can be styled differently
This is also a bit high-level in my opinion. You can easily make your own with what SFML provides.

Quote
add more samples, specially from the new features, but i would also like to see the SoundListener features in action
Feel free to provide a more detailed list of what you'd like to see :)
Title: Re: SFML 3 - What is your vision?
Post by: binary1248 on July 03, 2014, 03:25:25 pm
Quote
sf::Shader add way to get the type of a parameter from the program if possible
I don't think if OpenGL gives this option, and I have no idea why one would have to do that. You're supposed to know what types you've declared in your shader...
This is also the reason why interface blocks were introduced in GL 3.1. The idea is that you declare a shader with a specific interface in mind, which you of course have to reflect in your code. Multiple shaders (even shader stages) can implement the same interface block if they are to be accessed in the same way from the user code. You are the one who writes the interface, for both sides. So anybody writing a custom shader that should work with your code will have to abide by it.

On a side note, I think certain engines/frameworks actually go ahead and perform very thorough inspection of shader code before passing it on to the GL. This is to provide a lot of advanced features that SFML really shouldn't try to cover, of which uniform type inspection is also one. This can probably be implemented in an extension library for SFML if someone really wanted to.

Just a note for all future posters: The main idea is to add features to SFML that extension libraries (like Thor, sfeMovie, SFGUI) wouldn't be able to implement because of a limitation within SFML itself. They are built on top of SFML and provide higher-level functionality as Laurent already said. Suggestions here should be targeted towards lower level things that have to be in core SFML to be made accessible to said higher-level libraries or your own code.
Title: Re: SFML 3 - What is your vision?
Post by: Hanmac on July 03, 2014, 05:22:51 pm
Quote
Adding Thor ParticleSystem & Animation
SFML is a multimedia library, not a game library ;)
So let's keep these more advanced concepts in add-on libraries like Thor.
oh ok i didn't consider it "game libary" only stuff, i thought that would be basic enough for multimedia lib

Quote
Ogre CompositorChain with that you can have multiple gpu programs/shader for rendering one viewport
This is a bit too high-level.
Dammit ok it might be but as far i dont know if it can be emulated with addons for sfml, like binary said:
The main idea is to add features to SFML that extension libraries wouldn't be able to implement because of a limitation within SFML itself.
currently i dont know if it can be done with extension libraries

Quote
does SDL2 have something we might need?
SDL 2 is always an interesting source of inspiration, but we'd like to avoid "please implement X because SDL has it" ;)
i looked myself what we could need ... SDL2 has gamecontroller support (we only have joystick, that might be a bit different), otherwise i didnt find anything what we might need.

Quote
Have Styleable Text where TextSections can be styled differently
This is also a bit high-level in my opinion. You can easily make your own with what SFML provides.
hm okay if its simple to make it might be able to add to thor or similar,
i thought it would be low enough (simple enough) for SFML


Quote
add more samples, specially from the new features, but i would also like to see the SoundListener features in action
Feel free to provide a more detailed list of what you'd like to see :)
i might look what i can do ... mostly currently i am thinking how to combine sf::Sprite with sf::SoundSource
(and maybe with some kind of LightSource too? i was thinking about some fireplace where you could get near)
Title: Re: SFML 3 - What is your vision?
Post by: Laurent on July 03, 2014, 05:40:38 pm
Quote
Dammit ok it might be but as far i dont know if it can be emulated with addons for sfml
I don't know what it is in detail, but if it is a chain of full-screen effects then this can easily be achieved with two sf::RenderTexture.
Title: Re: SFML 3 - What is your vision?
Post by: marcf3 on July 05, 2014, 01:37:31 am
I don't think it has been mentionned before, but adding audio effects and more fine-grained control would be great. It seems to me that the area is often lacking features :p

As the graphics API supports shaders, it would be nice to be able to (at least) apply audio filters to create reverberations, echos, convolutions, 3D effects etc.  :D

I agree to the need for loop points too, especially when streaming audio. Also, if possible, an option for low-latency playing of streamed sounds (preload first chunks on openFromFile())?

Title: Re: SFML 3 - What is your vision?
Post by: binary1248 on July 05, 2014, 02:22:26 am
As the graphics API supports shaders, it would be nice to be able to (at least) apply audio filters to create reverberations, echos, convolutions, 3D effects etc.  :D
This isn't as easy as it seems ;). sf::Shader is built on top of OpenGL shaders. They make use of an own language: GLSL. OpenAL isn't really comparable to OpenGL in that it isn't hardware accelerated and as such doesn't have an equivalent for filters to entail something like an ALFL :P. And if there isn't any free and compatible (license-wise) library to perform filtering, I don't think it will make it into SFML any time soon.
Title: Re: SFML 3 - What is your vision?
Post by: marcf3 on July 05, 2014, 02:47:42 am
I remember there is an EFX extension to OpenAL that handles some effects. But if it can't be hardware-accelerated, could software post-processing be achieved (like many audio softwares do) as well by the ability to write filtering code before the samples to be sent to OpenAL?
Title: Re: SFML 3 - What is your vision?
Post by: binary1248 on July 05, 2014, 02:56:27 am
As I already mentioned here (http://en.sfml-dev.org/forums/index.php?topic=15027.msg111871#msg111871), this belongs to the class of "features" that can be written on top of SFML without making any changes to its core. sf::SoundBuffer already gives you access to the samples of the audio it contains and you are free to modify and reload it back into the buffer after you are done, either in your own code or using an external library.

Most audio processing libraries are proprietary from what I've seen, so there is a very slim chance something like that would make it into SFML if you take what I said above into account as well.
Title: Re: SFML 3 - What is your vision?
Post by: marcf3 on July 05, 2014, 03:23:33 am
Ok, I understand for hardware... :)
For software effects, I actually meant "real-time" ones, those we could tweak while the sound is playing. I don't know how it would be done for sf::Sounds since they are entirely uploaded to OpenAL before playing. But for streams, it would need to override onGetData() and perform the effect before returning the chunk. However, there is a SoundFile class here that is not exposed to the API ^^"
Title: Re: SFML 3 - What is your vision?
Post by: binary1248 on July 05, 2014, 03:38:02 am
If you want to modify the data while it is in-flight, then the data is really a stream. For this sf::SoundStream exists. It is even explained that you would want to derive from it to implement your own class that streams data from whatever source you want, including a filter you wrote:
Quote
sf::SoundStream is a base class that doesn't care about the stream source, which is left to the derived class. SFML provides a built-in specialization for big files (see sf::Music). No network stream source is provided, but you can write your own by combining this class with the network module.
As far as I can tell, everything you described can be achieved with the current API...
Title: Re: SFML 3 - What is your vision?
Post by: marcf3 on July 05, 2014, 04:10:17 am
Quote
It is even explained that you would want to derive from it to implement your own class that streams data from whatever source you want,  including a filter you wrote
I know, but a filter wouldn't be a source here, just some code between the raw samples and the filtered samples. The real source would be a file, and since the SoundFile wrapper is not exposed, it's difficult to stream them simply. I could use sf::SoundBuffers as in the tutorials, but it's not file streaming.
Title: Re: SFML 3 - What is your vision?
Post by: binary1248 on July 05, 2014, 04:20:35 am
But if using an sf::SoundBuffer in conjunction with its loadFromStream() method to partially load in samples to filter for an sf::SoundStream isn't considered streaming, what is for you? You can interface any sort of file stream that adheres to sf::InputStream with an sf::SoundBuffer.
Title: Re: SFML 3 - What is your vision?
Post by: marcf3 on July 05, 2014, 04:44:55 am
How can I tell how many samples to load with soundBuffer.loadFromStream()? It seems to me that it loads the entire sound data too (from a file or a stream that contains an audio entity), and already sends it to OpenAL with alBufferData(). Or am I missing something?
By "audio streaming", I really mean to read a part of an audio entity and play it while the next part is loaded chunk by chunk, wether it is from a file or a C++ input stream (it's a bit ambiguous I guess).
Title: Re: SFML 3 - What is your vision?
Post by: binary1248 on July 05, 2014, 04:59:11 am
It all depends on the underlying audio format... Some formats save their sample count in the header of the file, which is the first thing that gets read by sf::SoundBuffer. It would be able to return the total sample count without having to load the whole file that way. Also, if you have worked with std::fstream before, you would know that it too supports reporting the number of bytes in a file without actually having to load it all into memory. It most probably makes use of lower level filesystem APIs to get this done.

I can assure you that given the right conditions, you can get true sample by sample streaming, even if the file is multiple gigabytes large ;).
Title: Re: SFML 3 - What is your vision?
Post by: Laurent on July 05, 2014, 08:44:56 am
EFX is supported by OpenAL Soft, so it would work on Windows, most Linuxes and Android. But I have no idea if these extensions are supported on Mac OS X and iOS. It could be worth investigating.
Title: Re: SFML 3 - What is your vision?
Post by: achpile on July 15, 2014, 01:06:01 am
The thing I always wanted is z-index for Drawable class  ;D
Title: Re: SFML 3 - What is your vision?
Post by: Hanmac on July 15, 2014, 05:48:43 am
i was thinking a bit about Spites and SoundSource and SoundListener ...
hm first, make a BaseInterface moveable, its for controling the Position and Direction of Sprite/(BigSprite)/SoundSource ... so you can both add Sprites and SoundSources into an Array and move them around ...

then i was thinking about a helper template like SpriteWithSound<sf::Sprite,sf::SoundSource> ... with that you have a moveable sprite and the SoundSource is always connected to the Sprite postion and location, same for SpriteWithSoundListener<sf::Sprite> (because the Listener is some kind of singleton?)

my idea was so that you can move around the WithSound objects and the 3d sound effect is already managed for you?

PS: that was only an idea, i dont know if its to high or low for SFML itself (only the Moveable interface might be interesting, but it might be collide, with Transformable)
Title: Re: SFML 3 - What is your vision?
Post by: Laurent on July 15, 2014, 07:40:41 am
Quote
i was thinking a bit about Spites and SoundSource and SoundListener ...
hm first, make a BaseInterface moveable, its for controling the Position and Direction of Sprite/(BigSprite)/SoundSource ..
No no no... Sounds have 3D positions, sprites have 2D positions. Sounds have no direction. And most important: there's no dependency between the audio and graphics modules, and there will never be. It's up to you to synchronize audio and graphics, this is a high level task.
Title: Re: SFML 3 - What is your vision?
Post by: Flaco on July 15, 2014, 12:25:24 pm
That's a great thread, nice idea here. :)

I don't really know, since I never have been in the depth of SFML and its use.
But here's a little list:


Thanks! :)
Title: Re: SFML 3 - What is your vision?
Post by: Nexus on July 15, 2014, 04:04:37 pm
Integrating some of Tor features directly in SFML functions if there's high-level or "misc." functions, providing them as well in a dedicated module
Just a note for al future posters: The main idea is to add features to SFML that extension libraries (like Thor, sfeMovie, SFGUI) wouldn't be able to implement because of a limitation within SFML itself. They are built on top of SFML and provide higher-level functionality as Laurent already said. Suggestions here should be targeted towards lower level things that have to be in core SFML to be made accessible to said higher-level libraries or your own code.

I have the feeling that this is not the last time we post this here ;)

By the way, Tor is something different :)
Title: Re: SFML 3 - What is your vision?
Post by: Hanmac on July 15, 2014, 04:14:42 pm
Quote
i was thinking a bit about Spites and SoundSource and SoundListener ...
hm first, make a BaseInterface moveable, its for controling the Position and Direction of Sprite/(BigSprite)/SoundSource ..
No no no... Sounds have 3D positions, sprites have 2D positions. Sounds have no direction. And most important: there's no dependency between the audio and graphics modules, and there will never be. It's up to you to synchronize audio and graphics, this is a high level task.

 ??? now i am ashamed ... Listener did had direction, not SoundSource ... and yeah i did think about to connect them, but i did also think about that it might be complications with other stuff like Thor Animation and Particle System i did use so when they should animate the object, the Sound might not follow the Sprite
(i need to experiment a bit with that)

hmmm now i am thinking if SoundSource should have a direction too, so like you can only hear it if the speaker is showing into your direction ...
hmmm2: i also did think there might be some value for the current acceleration of the SoundSourceObject so it might the detect if its moving to you or away from you, (for the Doppler Effect) or is that already managed by AL?

PS: thats my thoughts as i did thougt about a 3d-sound sample for SFML itself
Title: Re: SFML 3 - What is your vision?
Post by: Nexus on July 15, 2014, 04:20:53 pm
??? now i am ashamed ... Listener did had direction, not SoundSource ...
It still has, but that doesn't change the fact that it doesn't make sense to store sprites and sounds or sound listeners together. What you actually want is an abstraction layer in between, most likely a scene graph. This is definitely not SFML's task.

but i did also think about that it might be complications with other stuff like Thor Animation and Particle System i did use so when they should animate the object, the Sound might not follow the Sprite
That sounds very confused. Animations, particles and sounds are widely independent components, how you combine them depends entirely on your game's code design. Again not something SFML should care about.

hmmm now i am thinking if SoundSource should have a direction too, so like you can only hear it if the speaker is showing into your direction ...
hmmm2: i also did think there might be some value for the current acceleration of the SoundSourceObject so it might the detect if its moving to you or away from you, (for the Doppler Effect) or is that already managed by AL?
Are you actually requiring those features or are those just spontaneous ideas? I ask because we have enough ideas on what would be possible, but we prefer implementing the useful ones first ;)

(Apart from that, these are also things that depend highly on the game, and can be implemented without modifying SFML; e.g. by changing frequency and volume depending on the position and orientation)
Title: Re: SFML 3 - What is your vision?
Post by: Laurent on July 15, 2014, 04:24:35 pm
Quote
hmmm now i am thinking if SoundSource should have a direction too, so like you can only hear it if the speaker is showing into your direction ...
This doesn't make sense (even in real life), sounds propagate in all directions.

Doppler effect is supported by OpenAL but it is not exposed by SFML.
Title: Re: SFML 3 - What is your vision?
Post by: Hanmac on July 15, 2014, 04:41:54 pm

??? now i am ashamed ... Listener did had direction, not SoundSource ...
It still has, but that doesn't change the fact that it doesn't make sense to store sprites and sounds or sound listeners together. What you actually want is an abstraction layer in between, most likely a scene graph. This is definitely not SFML's task.
i also did thought about some kind of SceneGraph ... currently i dont know if i can get it working right impl drawable into that SceneGraph might not be a problem, but Transformable for sample is, because its functions are not virtual for overloading ... :/
but like i said i need to test stuff until it works right

Quote
hmmm now i am thinking if SoundSource should have a direction too, so like you can only hear it if the speaker is showing into your direction ...
This doesn't make sense (even in real life), sounds propagate in all directions.

Doppler effect is supported by OpenAL but it is not exposed by SFML.
i was thinking in form of PC speakers ... like for them you cant hear them (right) when you are on the wrong end ...
Oh ok if doppler already exist in AL then its okay ... i didnt know that and i thought SFML might need more work than just "exposing"
Title: Re: SFML 3 - What is your vision?
Post by: paupav on July 16, 2014, 07:36:56 am
Blender Support.
Title: Re: SFML 3 - What is your vision?
Post by: Laurent on July 16, 2014, 08:32:45 am
Quote
Blender Support.
Thank you for this amazing contribution.

This "idea" seems to be completely off-topic, but you can explain it with more details if you want...
Title: Re: SFML 3 - What is your vision?
Post by: paupav on July 16, 2014, 12:12:23 pm
Quote
Blender Support.
Thank you for this amazing contribution.

This "idea" seems to be completely off-topic, but you can explain it with more details if you want...
I'm thinking about something like allegro5/Blender.
Also why are you so arrogant?
Title: Re: SFML 3 - What is your vision?
Post by: Laurent on July 16, 2014, 12:46:27 pm
Because I don't like your attitude. In this thread, we try to collect detailed and meaningful ideas for the future of SFML. Posting a reply with only two words in it, that only you understand, is not respectful for the community and the SFML team. You didn't even care to write a proper sentence.

So please explain what you want (ok, Allegro 5 has it... I still don't know what it is) or stop posting. Thank you.
Title: Re: SFML 3 - What is your vision?
Post by: select_this on July 16, 2014, 12:48:15 pm
Having done a quick search through Allegro's docs, I think he means alpha blending as opposed to integration with Blender 3D (which is what I thought he meant first time around).
Title: Re: SFML 3 - What is your vision?
Post by: binary1248 on July 16, 2014, 05:38:33 pm
And... that is exactly what was implemented in the BlendModes branch... So he is asking for something that is already in SFML. I think he gave a lot of effort posting those 2 words.
Title: Re: SFML 3 - What is your vision?
Post by: paupav on July 16, 2014, 09:09:58 pm
Sorry Guys, At first I thought something like create stuff in Blender (open source modeling software) and to import it somehow to the SFML project (and that you could set up from which position object could be shown at particular time (of course you would set it up with sf::time and clock)). I thought that maybe idea is stupid but that was what I meant with first post. I've lowered my expectations with my second post and tried not to look so ungrateful (to expect so much) from developers.
Title: Re: SFML 3 - What is your vision?
Post by: Jesper Juhl on July 16, 2014, 09:20:06 pm
As I see it, SFML is a little too low-level to cater to that.
What you want can be done by higher level libraries that use SFML underneath.
SFML is a multimedia library, that means; get pixels on the screen, get samples onto sound cards, read events from the OS. Higher level stuff like, process this 3D model or handle this collision detection or similar is not SFML's job.
Just how I see it.
Title: Re: SFML 3 - What is your vision?
Post by: paupav on July 16, 2014, 09:23:54 pm
By my opinion it is easier to create blender object that to draw image. Also it would help a lot people that are trying to create 2.5 Dimension games (bird eye perspective games) and it would make unbelievably easier for game devs to create 2.5 D games that could rotate camera. Also maybe it would be possible to create somehow SFML editor like Unity or like some other low level game engine/ editor for non programmers to create games.
Title: Re: SFML 3 - What is your vision?
Post by: Jesper Juhl on July 16, 2014, 09:26:36 pm
SFML is not a game engine/library.
Title: Re: SFML 3 - What is your vision?
Post by: Ricky on July 16, 2014, 09:27:46 pm
(I think he wants something like Assimp or something)

Dude, SFML is not a game engine. You write the engine. Unity is not the same as SFML. SFML is a library you use to prorgam tools like Unity or whatever you desire. You can use OpenGL with SFML to get that 2.5D effect you want or hey, better yet those people that want to make games with something like Unity can go ahead and use Unity!

Anyway enough of that. Moving on?
Title: Re: SFML 3 - What is your vision?
Post by: paupav on July 16, 2014, 09:31:57 pm
As I see it, SFML is a little too low-level to cater to that.
What you want can be done by higher level libraries that use SFML underneath.
SFML is a multimedia library, that means; get pixels on the screen, get samples onto sound cards, read events from the OS. Higher level stuff like, process this 3D model or handle this collision detection or similar is not SFML's job.
Just how I see it.
Ik that, but is it possible to create object import it to the blender and render and show part of that image with pos of camera and rotation. Slow sampling could be solved by showing preview of the object that could be shown, something like preview in the blender and that developers could use  something like window.preview(blenderObjChar); and when they are happy you could use .draw() and it could sample it.
Title: Re: SFML 3 - What is your vision?
Post by: paupav on July 16, 2014, 09:33:21 pm
OK. Let's then just forget about it.
Also I've never said that SFML is engine, I've only said that it should be easier to create one.
Title: Re: SFML 3 - What is your vision?
Post by: select_this on July 16, 2014, 09:44:12 pm
Oh, so you WERE talking about Blender 3D.

That begs the question as to why Allegro named some of its alpha blending functions 'blender', but that's by the by.

Back on topic, I don't think SFML will be, or should be, providing any form of 3D format functionality unless it is to become a library for 3D applications as well. It just doesn't make sense until such a time.

I've only said that it should be easier to create one.

If it were that easy, then no one would be creating engines any more because we'd already have a perfect one.
Title: Re: SFML 3 - What is your vision?
Post by: paupav on July 16, 2014, 09:59:24 pm
Well, OP/ Admin said that we shouldn't post simple feature requests.
Title: Re: SFML 3 - What is your vision?
Post by: Nexus on July 16, 2014, 11:44:33 pm
Since several points seem to be still not clear:

Now there's another 15 posts bringing nothing new to the discussion. In the end it would be nice if we could go through this thread and pick the useful suggestions, but if nobody cares about how to post here, then this is going to be very tedious... :-\
Title: Re: SFML 3 - What is your vision?
Post by: FRex on August 03, 2014, 04:30:55 pm
There is a small issue (might be a false alarm) with how SFML uses OpenAL/decoded samples, it might be of interest for 3.0 since it might require (big/breaking) API changes of sf::SoundBuffer class if it's confirmed: http://en.sfml-dev.org/forums/index.php?topic=15963.0
Title: Re: SFML 3 - What is your vision?
Post by: dk123 on August 10, 2014, 03:53:07 am
Manual Context Management:

- It would be great if something along the lines of allowing the user to create an external sf::Context, and passing in a pointer to SFML for it to use for all its context related operations could be added as a new feature.

I feel that allowing the user to manage their own contexts is a much more safer and reassuring method (to the user) of going about context management than SFML internally creating and holding sole access to its context(s).
Title: Re: SFML 3 - What is your vision?
Post by: danharibo on August 10, 2014, 07:31:31 pm
Platform Library

An additional module in SFML to handle interacting with the current platform and determining the correct location for certain files.

Suggested functionality

Title: Re: SFML 3 - What is your vision?
Post by: AlexAUT on August 24, 2014, 12:13:30 pm
My wishes for SFML3/SFML2.x:



AlexAUT

Title: Re: SFML 3 - What is your vision?
Post by: binary1248 on August 24, 2014, 04:19:33 pm
  • Option to create a core context, maybe only for sf::Window due to the legacy code in sfml-graphics.
  • Drop glew and use glLoadGen (less dependency when linking statically, less typing  8) )
  • Expose the OpenGL ID from textures
You might want to try this (https://github.com/SFML/SFML/tree/feature/gl_dev). It's been around for a while. Just hasn't been promoted that much ::).
Title: Re: SFML 3 - What is your vision?
Post by: AlexAUT on August 24, 2014, 05:26:21 pm
Looks nice, thanks for pointing that out!


AlexAUT
Title: Re: SFML 3 - What is your vision?
Post by: Cmdu76 on September 05, 2014, 01:42:29 am
Is there a place to regroup all ideas ?

I mean :
- A place of the features which "will be added" in SFML3
- A place of the features which might be added in SFML3
- A place of the ideas which will not be added in SFML3 (with a short explication why)

So what it's m'y vision for SFML3 :
- C++11 no-obligatory (to allow older platform)
- Filesystem
- GUI (like SFGUI)
- Easier ressources managements with containers (like Thor)

Build SFML, and then each others libraries is a bit boring (and hard for users the first time), thoses projects are "linked" with SFML and are very usefull and stable, why dont add them to SFML3 ?
Title: Re: SFML 3 - What is your vision?
Post by: Ixrec on September 05, 2014, 01:58:50 am
- C++11 no-obligatory (to allow older platform)

I'm pretty sure using C++11/14 only restricts the compilers you can use, not the platforms the final executable will run on.  It's not like OpenGL versions.

Quote
- Filesystem

Considering the C++ proposal for a standard filesystem library has gotten far enough to have a technical specification, is there really a need for SFML to implement this now? (the proposal is based on Boost.Filesystem which is obviously already available)

Quote
- GUI (like SFGUI)
- Easier ressources managements with containers (like Thor)

For SFGUI/Thor/etc, putting them directly into SFML is probably a bad idea (they're really a layer on top of SFML, not additional modules for it), but it would be very nice to see those extensions officially distributed alongside SFML so their build processes could be streamlined and they'd get more exposure/usage.
Title: Re: SFML 3 - What is your vision?
Post by: FRex on September 05, 2014, 02:26:14 am
Quote
I'm pretty sure using C++11/14 only restricts the compilers you can use, not the platforms the final executable will run on.  It's not like OpenGL versions.
Latest visuals had minor issues with deployment onto XP but there is update for that. I know, 'XP is dead' but many people still wanna support it and who knows how long compilers will support building for XP, especially Microsoft's.


Quote
For SFGUI/Thor/etc, putting them directly into SFML is probably a bad idea (they're really a layer on top of SFML, not additional modules for it), but it would be very nice to see those extensions officially distributed alongside SFML so their build processes could be streamlined and they'd get more exposure/usage.
Honestly, every SFML module except system is extension or 'layer on top of' to system (and graphic is also extension to window). There is nothing preventing you from discarding one module and pretending it doesn't exist, they are not internally tied to each other and there is no reason new ones like GUI, Thor, Whatever should be. It was just issue of 'out of our scope of SFML' and API stability so far for not including more stuff.
Title: Re: SFML 3 - What is your vision?
Post by: zsbzsb on September 05, 2014, 04:12:55 am
I really don't understand why you guys insist on discussing things that are clearly marked as off topic to this thread. If someone wants to suggest something like it again just ignore that point and pretend it was never mentioned.

The proposals in this thread should focus on functionality that cannot easily be implemented on top of SFML, because of a limitation within SFML itself. That is, not features that can as well be part of external libraries.
Title: Re: SFML 3 - What is your vision?
Post by: MW2TopTenWORLD on September 06, 2014, 03:26:25 am
I Can't think of much, I've just started using SFML... But one of the reasons I didn't used VS2013... Was because sfTheora was incompatible with 2013....

WHAT I MEAN IS : Let the next SFML Version play video natively :)
Title: Re: SFML 3 - What is your vision?
Post by: zsbzsb on September 06, 2014, 04:03:09 am
WHAT I MEAN IS : Let the next SFML Version play video natively :)

Did you really not just my last post?
Title: Re: SFML 3 - What is your vision?
Post by: lolz123 on September 06, 2014, 04:08:48 am
@zsbzsb: I think his suggestion was perfectly valid. A video player should exist for the same reasons that the audio module exists in my opinion. You say we should only suggest things that cannot be built on top of SFML, but then really what is SFML? It's not a multimedia library anymore. Since graphics, audio, networking are relatively independent, you can always just use another library and add on functionality. They are not so intertwined that you cannot have one without the other. SFML in my eyes is supposed to be a collection of easy to use interfaces to multimedia functionality, and video playback falls under this just like audio playback does.

So, I am for MW2TopTenWORLD's idea.
Title: Re: SFML 3 - What is your vision?
Post by: tyrion on September 12, 2014, 11:57:00 am
Title: Re: SFML 3 - What is your vision?
Post by: Laurent on September 12, 2014, 01:28:59 pm
What would you do with a window with no GL context?
Title: Re: SFML 3 - What is your vision?
Post by: firstep on September 13, 2014, 10:54:26 am
cLion support :D
Title: Re: Re: SFML 3 - What is your vision?
Post by: Strelok on September 13, 2014, 11:16:11 am
cLion support :D
Support an IDE? SFML works with CLion as I've already shown you here (http://en.sfml-dev.org/forums/index.php?topic=16307.msg116790#msg116790)
Title: Re: SFML 3 - What is your vision?
Post by: Tex Killer on September 14, 2014, 06:05:22 am
Laurent, is it possible (and are you planning) to remove all of the dynamic dependencies of SFML?

Another question: Would it be possible to separate all of the platform specific code from the SFML logic code on different files? Like, the OpenGL code separated from the Drawable/Window/Whatever code, in a way that the platform specific code could be easily ported without messing with SFML's logic?
Title: AW: Re: SFML 3 - What is your vision?
Post by: eXpl0it3r on September 14, 2014, 08:28:31 am
Laurent, is it possible (and are you planning) to remove all of the dynamic dependencies of SFML?
Not really. The main problem is, that there's nothing compareable out there to OpenAL. Some similar libraries are even less permissive and others don't support iOS and Android..

Another question: Would it be possible to separate all of the platform specific code from the SFML logic code on different files? Like, the OpenGL code separated from the Drawable/Window/Whatever code, in a way that the platform specific code could be easily ported without messing with SFML's logic?
I'm not sure what you're asking. All platform specific code is usually in separated class (see all the XYZImpl.hpp/cpp files).
As for the rendering/OpenGL code, we might investigate a more detached approach.
Title: Re: AW: Re: SFML 3 - What is your vision?
Post by: Tex Killer on September 14, 2014, 09:21:07 pm
Laurent, is it possible (and are you planning) to remove all of the dynamic dependencies of SFML?
Not really. The main problem is, that there's nothing compareable out there to OpenAL. Some similar libraries are even less permissive and others don't support iOS and Android..
I see... There was talk some time ago about asking for permition to static link OpenAL from the developers, or something like that. Did it go through?

Another question: Would it be possible to separate all of the platform specific code from the SFML logic code on different files? Like, the OpenGL code separated from the Drawable/Window/Whatever code, in a way that the platform specific code could be easily ported without messing with SFML's logic?
I'm not sure what you're asking. All platform specific code is usually in separated class (see all the XYZImpl.hpp/cpp files).
As for the rendering/OpenGL code, we might investigate a more detached approach.

Lets say I want to port my SFML game to Xbox360, for example. As far as I know, Xbox360 has no OpenGL support, only DirectX. With the platform code (in this case, OpenGL) in its separated classes, all I would need to do would be to reimplement the platform classes using DirectX (I would imagine classes like Texture, Polygon, Display, or something like this, very low level), while maintaining the same interfaces, recompile SFML with those new implementations, then SFML would work with DirectX instead of OpenGL. The same if I would want to port my game to a platform that doesn't support OpenAL, for example.
Title: Re: SFML 3 - What is your vision?
Post by: zsbzsb on September 14, 2014, 09:42:25 pm
Quote
I see... There was talk some time ago about asking for permition to static link OpenAL from the developers, or something like that. Did it go through?

It was permission to statically link libsndfile, however we did not get permission to do so. AFAIK dropping libsndfile as a dependency is what we are going to do about that.

Quote
Lets say I want to port my SFML game to Xbox360, for example.

Porting SFML's rendering to DirectX is not really porting to another platform, its just changing the backend. So if you want XBox support you need platform specific code for the XBox and you need to change the rendering backend. That said, allowing multiple backends is unlikely to happen anytime soon. If you want to mess around with porting SFML's rendering to DirectX have fun. It won't be as easy as you make it out to be ;)
Title: Re: SFML 3 - What is your vision?
Post by: Tex Killer on September 14, 2014, 09:53:47 pm
Quote
I see... There was talk some time ago about asking for permition to static link OpenAL from the developers, or something like that. Did it go through?

It was permission to statically link libsndfile, however we did not get permission to do so. AFAIK dropping libsndfile as a dependency is what we are going to do about that.

Ok, I stand corrected. I will be on the lookout for potential OpenAL replacements but, if I understood correctly, SFML 3 would only need 1 dll for OpenAL. Is that right?

Quote
Lets say I want to port my SFML game to Xbox360, for example.

Porting SFML's rendering to DirectX is not really porting to another platform, its just changing the backend. So if you want XBox support you need platform specific code for the XBox and you need to change the rendering backend. That said, allowing multiple backends is unlikely to happen anytime soon. If you want to mess around with porting SFML's rendering to DirectX have fun. It won't be as easy as you make it out to be ;)

I am not saying it is that easy now, but I am asking if it could be, and how hard would it be to redesign SFML to work with platform (or backend, whatever) interfaces instead of directly to facilitate such ports. We are on the SFML 3 vision thread, after all.
Title: Re: AW: Re: SFML 3 - What is your vision?
Post by: eXpl0it3r on September 14, 2014, 09:56:01 pm
I see... There was talk some time ago about asking for permition to static link OpenAL from the developers, or something like that. Did it go through?
You probably confuse this with libsndfile. I asked again and there wasn't any progress after 8+ month - still hasn't. As such the decision was made to drop libsndfile.
OpenAL itself is well supported on all platforms, so there's currently no issue (iOS comes with its own version).

Lets say I want to port my SFML game to Xbox360, for example. As far as I know, Xbox360 has no OpenGL support, only DirectX. With the platform code (in this case, OpenGL) in its separated classes, all I would need to do would be to reimplement the platform classes using DirectX (I would imagine classes like Texture, Polygon, Display, or something like this, very low level), while maintaining the same interfaces, recompile SFML with those new implementations, then SFML would work with DirectX instead of OpenGL. The same if I would want to port my game to a platform that doesn't support OpenAL, for example.
You're misusing the word "platform"; OpenGL isn't "platform code". SFML could currently potentially be ported to any platform supporting OpenGL 2.x-ish or with the upcoming Android port also OpenGL ES 1.something. The fact that Xbox360 doesn't support OpenGL, doesn't make the OpenGL code "platform code", but Xbox360 simply doesn't provide the nessecary dependency.
However there are discussions going on, on how to refactor the graphics code to make it possible, to implement different rendering back-ends, such as DirectX. How and if this will be done, is still in discussion.

Edit: Hrmpf zsbzsb :P
Title: Re: AW: Re: SFML 3 - What is your vision?
Post by: Tex Killer on September 14, 2014, 10:50:40 pm
I see... There was talk some time ago about asking for permition to static link OpenAL from the developers, or something like that. Did it go through?
You probably confuse this with libsndfile. I asked again and there wasn't any progress after 8+ month - still hasn't. As such the decision was made to drop libsndfile.
OpenAL itself is well supported on all platforms, so there's currently no issue (iOS comes with its own version).

I've already answered that to zsbzsb...

Lets say I want to port my SFML game to Xbox360, for example. As far as I know, Xbox360 has no OpenGL support, only DirectX. With the platform code (in this case, OpenGL) in its separated classes, all I would need to do would be to reimplement the platform classes using DirectX (I would imagine classes like Texture, Polygon, Display, or something like this, very low level), while maintaining the same interfaces, recompile SFML with those new implementations, then SFML would work with DirectX instead of OpenGL. The same if I would want to port my game to a platform that doesn't support OpenAL, for example.
You're misusing the word "platform"; OpenGL isn't "platform code". SFML could currently potentially be ported to any platform supporting OpenGL 2.x-ish or with the upcoming Android port also OpenGL ES 1.something. The fact that Xbox360 doesn't support OpenGL, doesn't make the OpenGL code "platform code", but Xbox360 simply doesn't provide the nessecary dependency.
However there are discussions going on, on how to refactor the graphics code to make it possible, to implement different rendering back-ends, such as DirectX. How and if this will be done, is still in discussion.

Edit: Hrmpf zsbzsb :P

I don't know, it seems to me that any code that isn't ANSI C/C++ is to be considered a platform specific code, even if it has ports on multiple platforms. But if you preffer, you could interpret my posts as referring to backends then.
Title: Re: SFML 3 - What is your vision?
Post by: Jabberwocky on September 14, 2014, 11:49:22 pm
However there are discussions going on, on how to refactor the graphics code to make it possible, to implement different rendering back-ends, such as DirectX. How and if this will be done, is still in discussion.

I'm not downplaying the difficulty of this task.  However, this is highly desirable, from an SFML user perspective.

It is a make or break feature for any user or game studio evaluating SFML for use in a console game, or even a PC game with a potential console port down the road.  This is a large user base to turn away from SFML due to lack of necessary cross-platform support. 

It may be worth looking at Ogre3D's (http://www.ogre3d.org/download/source) decoupling of RenderSystems (DirectX, GL, GLES) when considering a similar architecture for SFML. 
Title: Re: AW: Re: SFML 3 - What is your vision?
Post by: eXpl0it3r on September 15, 2014, 12:00:58 am
I don't know, it seems to me that any code that isn't ANSI C/C++ is to be considered a platform specific code, even if it has ports on multiple platforms. But if you preffer, you could interpret my posts as referring to backends then.
Not really. If you use library X one OS K, the library API doesn't become "platform code", the API itself has nothing to do with OS K, it's just an API on it's own. The issue that library X isn't supported on OS J still doesn't make the library API platform specific/platform code.
I can write a library just using standard C++ (it's probably better to use ISO than ANSI, even if ISO stuff is automatically ANSI), like my library has a public function test() which prints out "Hello World". By your definition my standard C++ library would now turn into platform code, since my function test() isn't part of the standard C++. However since my code is written in standard C++, it will work on any platform, thus my API (the test() function) isn't platform code.

OpenGL is also "just" an API (okay it's a bit more tricky than that), it's not platform code, but the API isn't available on all platforms. ;)

Anyways to end this discussion and to repeat the conclusion: Yes, SFML might be getting the possibility to implement different rendering back-ends.

It is a make or break feature for any user or game studio evaluating SFML for use in a console game, or even a PC game with a potential console port down the road.  This is a large user base to turn away from SFML due to lack of necessary cross-platform support.
We're aware of that. However one should also not forget that developing for consoles usually comes with a licensing price to begin with, thus officially porting SFML to such "pay-first-develop-later" platforms probably won't happen, unless there are generous sponsors or something. ;)

It may be worth looking at Ogre3D's (http://www.ogre3d.org/download/source) decoupling of RenderSystems (DirectX, GL, GLES) when considering a similar architecture for SFML.
I don't think, it's worth looking at that too much, then again I don't know it in detail. ;)
Title: Re: AW: Re: SFML 3 - What is your vision?
Post by: Jabberwocky on September 15, 2014, 02:11:19 am
\However one should also not forget that developing for consoles usually comes with a licensing price to begin with, thus officially porting SFML to such "pay-first-develop-later" platforms probably won't happen, unless there are generous sponsors or something. ;)

I understand eXpl0it3r, and that makes sense.
But it only applies to one of the 3 steps involved

Of course console ports may not be realistic for the SFML team (without the generous sponsors).  But the other two steps at least do not have the licensing issue.  One or both would be extremely helpful.

Ogre3D is an open source example (MIT licensed) that does exactly what we're discussing, except in 3D rather than 2D.  I just mention it as a reference.  The sample programs begin with a startup dialog which allows you to select the render system (OpenGL, DirectX).  And the code demonstrates one approach to creating a render system independent graphics API that can hook into different back ends.  Anyway, I am highly encouraged you are considering some work in this area, and just wanted to express my enthusiasm for the idea.  I am sure, given the quality of the SFML code, that should the SFML team pursue this, the code will be very well done.

Regardless, I am highly appreciative of SFML and the team's work.  But since we're discussing the future of SFML, this would probably be the single most important change for SFML to bring in a larger audience of professional studios.  I'm pretty new around here - I'm not sure whether this is important to you or not.

Thanks for your time!
Title: Re: AW: Re: SFML 3 - What is your vision?
Post by: Tex Killer on September 15, 2014, 06:38:00 am
I don't know, it seems to me that any code that isn't ANSI C/C++ is to be considered a platform specific code, even if it has ports on multiple platforms. But if you preffer, you could interpret my posts as referring to backends then.
Not really. If you use library X one OS K, the library API doesn't become "platform code", the API itself has nothing to do with OS K, it's just an API on it's own. The issue that library X isn't supported on OS J still doesn't make the library API platform specific/platform code.
I can write a library just using standard C++ (it's probably better to use ISO than ANSI, even if ISO stuff is automatically ANSI), like my library has a public function test() which prints out "Hello World". By your definition my standard C++ library would now turn into platform code, since my function test() isn't part of the standard C++. However since my code is written in standard C++, it will work on any platform, thus my API (the test() function) isn't platform code.

OpenGL is also "just" an API (okay it's a bit more tricky than that), it's not platform code, but the API isn't available on all platforms. ;)

I might have expressed myself poorly, but that was not what I meant. Your library (with the test() function) would not be platform dependent, since it would work on any platform. I would tell your library is platform independent, since it only deppends on ANSI C++ to work.

On the other hand, if your library required some Windows API (for example) to work properly, I would consider it platform dependent. It is the same for OpenGL: as far as I know, OpenGL is an API that requires an implementation interfacing directly with the platform functions, so it is platform dependent. Any code that uses OpenGL would also be platform-dependent, since it would require the platform's implementation and support for the OpenGL API.

In other words, I consider a code platform independent if and only if it works on any platform that has an ANSI (or ISO, don't realy know the difference) C/C++ compiler, without requiring anything else. My suggestion would be to separate this kind of code from the platform dependent code on SFML, so it would be easier to port it to whatever platform.
Title: Re: SFML 3 - What is your vision?
Post by: Tank on September 15, 2014, 08:45:17 am
Replaceable backends is definitely something that's at least on a "would be nice to have" list.
Title: Re: SFML 3 - What is your vision?
Post by: tyrion on September 15, 2014, 06:36:47 pm
Quote
What would you do with a window with no GL context?
use another context :P
 (actually i am using ogre3d and commented out the glcontext stuff)
//#include <SFML/Window/ContextSettings.hpp>
//#include <SFML/Window/GlContext.hpp>
Title: Re: SFML 3 - What is your vision?
Post by: Zyl on September 28, 2014, 07:25:48 pm
I tried some SDL. I find SFML better for OOP, Documentation and Guides/Tutorials.

2 cents:
- GL core spec should be used by default. Yes I can recompile SFML, but defaults matter.  :)
- http://www.sfml-dev.org/tutorials/2.0/window-window.php says it uses sf:sleep for managing framerate limit, and that sf:sleep's "resolution depends on the underlying OS, and can be as high as 10 or 15 milliseconds". I find it very important to use the best (most accurate) solution on every OS. i.e. Windows has Multimedia Timers (http://msdn.microsoft.com/en-us/library/windows/desktop/dd743609%28v=vs.85%29.aspx). Using an inaccurate thread-sleep in non-v-synced mode kind of defeats the purpose of a non-v-synced mode (reduced input lag).

Cheers.
Title: Re: SFML 3 - What is your vision?
Post by: binary1248 on September 28, 2014, 07:55:22 pm
GL core spec should be used by default. Yes I can recompile SFML, but defaults matter
sfml-graphics is still written to use legacy OpenGL, so as long as you use it, you will have to use a compatibility profile context. Work is already under way in the gl_dev branch (https://github.com/SFML/SFML/tree/feature/gl_dev) to add support for selecting between compatibility and core profiles. If you don't need to use sfml-graphics and only use sfml-window, you will be able to create a core (and debug) context.
Title: Re: SFML 3 - What is your vision?
Post by: eXpl0it3r on September 29, 2014, 06:30:52 pm
- http://www.sfml-dev.org/tutorials/2.0/window-window.php says it uses sf:sleep for managing framerate limit, and that sf:sleep's "resolution depends on the underlying OS, and can be as high as 10 or 15 milliseconds". I find it very important to use the best (most accurate) solution on every OS. i.e. Windows has Multimedia Timers (http://msdn.microsoft.com/en-us/library/windows/desktop/dd743609%28v=vs.85%29.aspx). Using an inaccurate thread-sleep in non-v-synced mode kind of defeats the purpose of a non-v-synced mode (reduced input lag).
The discussion about this, has been moved to this thread (http://en.sfml-dev.org/forums/index.php?topic=16424.0).
Title: Re: SFML 3 - What is your vision?
Post by: Phanoo on October 07, 2014, 08:07:15 am
My vision of SFML is a SFML that follows developer's needs ;D
Title: Re: SFML 3 - What is your vision?
Post by: Tank on October 07, 2014, 08:44:49 am
ratatax: https://github.com/SFML/SFML/fork (https://github.com/SFML/SFML/fork)
Title: Re: SFML 3 - What is your vision?
Post by: Critkeeper on October 10, 2014, 01:06:13 am
Disclaimer:
I'm not a heavy SFML user, I'm not a software professional, I am not even sure I am above the median skill level in the ordered set of skill levels across all users of SFML for this library or game programming in general. I'm just a college student studying software engineering and I tinker with SFML when I can find the time to, and the only complete game I've ever made was a dinky arcade shooter in java that was implemented badly.

That said, from the perspective of someone who's judgement isn't clotted by familiarity and predisposed bias for what SFML is or how "simple" it is, whether in an absolute or relative sense, I have a few opinions about what SFML of any version should be. For those who would dismiss my opinion because I don't fully appreciate the functionality of the current SFML, and assume that this disqualifies me from making general assumptions about the philosophy of SFML, I apologize that I can't be any more constructive or helpful to you or this community.

I only have one significant request for SFML, and that is stratification. By that I mean the complexity and functionality of the library should be stratified. A small subset of its current functionality designed to be as approachable as possible even to people who have zero experience with media handling of any kind and limited experience with programming, could be called Strata 0 SFML, or "Simplest fast multimedia library".

Strata 1 could be for people with moderate experience with multimedia programming and probably contain the functionality that SFML currently contains. "Simpler fast multimedia library".

Strata 2 would be for people who want the most power that they can get with a reasonably succinct API, and would be "Simple fast multimedia library".

The point is that it isn't possible to satisfy everyone with a single library because some design directions are mutually exclusive or atleast mutually inverse, like power and simplicity; furthermore the "perfect balance" for one class of users may not be the same "perfect balance" for another class of users.

I may be mistaken, but stratifying sfml won't fracture your user base or triple your work load as developers IF you CAREFULLY choose how implement it. The question comes down to this:


What is the set of things most of your novice users need out of SFML? What is the preferred ratio of power / simplicity?

What is the set of things most of your average users need out of SFML? What is the preferred ratio of power / simplicity?

What is the set of things most of your advanced users need out of SFML? What is the preferred ratio of power / simplicity?

The first set should be a subset of the second, which should be subset of the third. Obviously if it is possible to replace elements with an equal number of elements that can create more power for basically no decrease in simplicity for any class of users ought to be followed. And if it is possible to replace elements with a fewer number of elements for no decrease in power for any class of users ought to be applied universally to SFML regardless of strata.

But apart from that general design philosphy, what is considered an acceptable loss of power for an increase in simplicity, or loss of simplicity for an increase in power is contingent on the preferred power / simplicity ratio of the Strata in question. It may be that we want to reduce the functionality of a lower strata in order to increase simplicity for example. Furthermore, ensuring that the a subset of things in a lower strata are not subsumed by smaller set  which is NOT a subset of the next higher strata is important because users would generally expect that if they master a lower strata then they should be able to transition to a higher one without "unlearning and relearning"  because there exists concepts that are incompatible between the two strata-- there should be no such incompatibility.
Title: Re: SFML 3 - What is your vision?
Post by: eXpl0it3r on October 10, 2014, 03:41:49 am
Thanks for presenting your view! I really like opinions that aren't clouded by some judgments and aren't just "make it do X", meaning they have more depth to them.

While your idea sounds well logical, I can't really imagine how this would work from an API perspective. Would we have three different APIs where one builds on top of the other? Or would we simply define these "stratas" in the tutorials? Do you have an example of an API that does this?

Besides that, you bring up a good point and that is, we can't have just the good from all the worlds. And it's essentially this balance I wanted to figure out in this thread. By hearing what changes people want to see, we'll try to figure out how far over the advanced line we can push SFML and check whether we can raise the entry level.

However one thing I wouldn't really want to see is Strata 0. Sure we won't be able to prevent it, but for the most time it's really just a lot of wasted effort when people try to use SFML without being able to program the most basic things. We've developed and maintain a library and aren't here to hold introduction to C++ or programming talks. There are dedicated communities which do this kind of thing to some form and they are usually way better equipped with information and teaching material.
Title: Re: SFML 3 - What is your vision?
Post by: Cornstalks on October 10, 2014, 07:09:57 am
However one thing I wouldn't really want to see is Strata 0. Sure we won't be able to prevent it, but for the most time it's really just a lot of wasted effort when people try to use SFML without being able to program the most basic things. We've developed and maintain a library and aren't here to hold introduction to C++ or programming talks. There are dedicated communities which do this kind of thing to some form and they are usually way better equipped with information and teaching material.
This. SFML is written in C++. C++ is not Java/C#/Rust/Scala/Racket/Haskell/Python/JavaScript/etc. It doesn't hold your hand. It gives you a loaded gun, and lets you do whatever you want with it, especially shoot yourself. It's important to keep the target audience in mind: C++ developers. These developers might have a wide range of skill and experience levels, but if they're using SFML and C++, then 1) they aren't (or shouldn't be) total novices to programming, 2) they're in it for the pain, and 3) they're prepared to deal with the fact that they might (and eventually will) blow their leg off. While I think SFML should be as simple and user friendly as possible, it shouldn't coddle users who are woefully unprepared for the tools they're using.

I personally would like to see an SFML that changes the "Simple" from meaning the library is a bare-bones, minimal simple library, to a "simple to use, and simplifies your life" type of meaning. As FRex said, sometimes things move in the "simple to read, simple to write, hard as f**k to use because you need to write 5 helpers for everything" direction. I don't want SFML to be bloated and contain the whole kitchen sink. But I do think many SFML users reinvent the wheel just to use SFML, and I'd like to see more of those redundancies handled in the library.

So I guess I'd like SFML 3 to take the approach of: what to many users do with/to SFML to simplify their life in using it, and how can those common things be incorporated back into SFML?
Title: Re: SFML 3 - What is your vision?
Post by: Ixrec on October 10, 2014, 08:10:35 am
@Critkeeper

To me it seems like SFML already has a lot of implicit stratification, even if there are no formal tiers. For instance:
- Drawing stuff: Use sprites and textures -> Use vertex arrays for batching or custom shapes -> Raw OpenGL
- Playing audio: Load from file and play -> Twiddle the bits in a sf::SoundBuffer yourself -> Raw OpenAL
- Text: Use sf::Text -> Use sf::Font and sf::Glyph and create the sprites/vertices yourself -> Raw Freetype

What I didn't see in your post was any particular reason why formal tiers would be a good thing or (as eXpl0it3r pointed out) what formal tiers would actually mean.  Simple, simpler, simplest isn't really a definition.  The tutorials already make it fairly clear which features are advanced and which aren't.  I can't think of any sweeping statements/guarantees we could sensibly make about one tier and not another (at low tiers...less exception safety? the user manages memory themselves? the user manages contexts themselves?), and I can't come up with any restrictions we would ever want to place on only certain tiers or the interaction of tiers (eg, it makes perfect sense to use sprites/textures alongside vertex arrays and/or raw OpenGL).

Did you have any concrete ideas about how a formal "stratification" would be different from the current SFML or what specific benefits it would have?
Title: Re: SFML 3 - What is your vision?
Post by: Critkeeper on October 10, 2014, 11:23:33 pm
One example of explicit stratification would be a "marquee" interface / abstract class which doesn't exist in strata 0, does exists in strata 1, and perhaps exists with additional switches and options in strata 2.

The interface or abstract class would be inherited by the Sprite and Text classes. Its function is to provide the programmer a way indicate that a specific texture or text should be clipped to a small rectangular region, and that the region is what is being drawn. You could use the state of the marquee to scroll the text side to side or to indicate that the space should be a loop like what you might see on big LED signs that advertise various things. You could also set the state to scroll continuously or discreetly and be commanded by time or call-- so you could implement a sprite sheet with the marquee system, or you could create a very long and narrow sprite that represents hundreds of projectiles and just loop it as described above for looping text.

In strata 1 it would include finer control, so that the region that it is drawn onto isn't specifically a rectangle, but can be any user defined shape and pair of edges belonging to that shape to form a "ribbon". There might be more rendering control so that people can create layered special effects using hardly any texture space or any more overhead than it takes to change local view space coordinates and do some clipping and "stretching" on the texures.

Now that isn't something I necessarily need in SFML or probably something that most people need. I'm just giving an example of what stratification is.

The point is to make MASTERING sfml easier by reducing the skill curve. You reduce the amount of options and you also reduce the complexity. Then people can master a subset of the functionality of SFML proper, and when they are content with that and really are being held back by the lack of options they can move up one stratification level and learn more things and do more things. That increases the rate at which newbie users develop into expert users.

The Stratas do not have differing design philosophies, they just have different audiences. Strata 0 does not try to provide a way to do everything with enough effort, it is supposed to provide an extremely simple interface for doing simple things that allow you to "get a feel" for what SFML is and what the higher stratas do in the general sense.

People who are experts with SFML or who are practicing software engineers probably could just read the documentation and know pretty much instantly what SFML is capable of. What I'm saying is that it isn't necessary to limit your audience because you can have your cake and eat it to. You can please everyone. You can have power for those that want power and simplicity for those that need simplicity above all else, just by stratifying your API. The cost of that design direction is the same as the cost of splitting your userbase into 3 parts, or subcommunities. If there isn't enough motivation in one subcommunity it can fracture the userbase and cause the "pipeline" to fail.

In order to prevent that from happening you would just need to carefully consider what each sub community needs from a media library and carefully design the stratification to meet the needs of the user base. That means writing software for the consumer rather than software for the sake of fulfilling a philosophical idea of what "simple" ought to be.

If software can bring people together, cause them to want to instruct eachother, communicate a tangible sense of achievement (through stratification), endow a sense of responsibility, and be powerful enough to do everything the user could want while being concise enough for the user to comprehend then people will use it regardless of what the word or idea "simple" really means.

As for HOW stratas are implemented, whether by having one API be a subset of another or just artificially through the tutorial is something I consider an implementation detail. It doesn't matter how such a thing is implemented as long as the implementation is effective and it actually organizes the community into discreet classes of users.

The fact is that newbies who ask questions some times get answers that they can't understand because the person answering them presumes an understanding about many different things, when a simple and less accurate explanation which is atleast comprehendable would be infinitely more useful. People iterate. They learn, unlearn, and relearn until they approach an understanding that represents the truth. Giving someone a terse answer that you worked for 3 years to understand may not be appreciated, and this causes a communication breakdown between these classes of users.

By putting people into classes of other people who have roughly the same familiarity with the API, they can work off of eachother's expertise by providing answers and questions that everyone in that subcommunity can understand. By putting incentives to higher strata communities to answer outstanding questions or problems that the lower strata community cannot resolve on its own, you build a positive flow, where some users in a lower community eventually become practiced and familiar enough with one strata to master then next higher one and to contribute to the associated next higher sub community.

The increase in the total number of "SFML Masters" due to the increased flow can cause a wider and more impressive variety of things to be created by SFML users, which can draw in more "newbie" users, and what you have is like a social version of a jet engine where the faster you go the more air you take in and the faster you go.
Title: Re: SFML 3 - What is your vision?
Post by: binary1248 on October 10, 2014, 11:58:17 pm
The point is to make MASTERING sfml easier by reducing the skill curve. You reduce the amount of options and you also reduce the complexity. Then people can master a subset of the functionality of SFML proper, and when they are content with that and really are being held back by the lack of options they can move up one stratification level and learn more things and do more things. That increases the rate at which newbie users develop into expert users.
Isn't that what makes games great? Being easy to learn and hard to master? Given that SFML doesn't aim to keep people "playing the development game" longer than they want to, I don't think it is necessary to give people a "virtual milestone" where they can claim that they have mastered some aspect of SFML. Who knows... maybe they might think that they have mastered something, when in fact they are far from it. As such any such "virtual milestone" doesn't make much sense to me, and gives people more of a reason to falsely assume that they have completed something that has no clear completion conditions.

It might sound like I am implying that you can't master SFML no matter how hard you try, and maybe that has a bit of truth to it. In the end, all software development libraries and languages are nothing more than a means to an end. You resort to them to get things done, whether for fun and/or profit. If people pick SFML up solely as a challenge that they intend to "complete" one day, then power to them, but that is very atypical. If you ask me, it doesn't make sense to give people a reason to claim they have mastered anything in software development. It is not up to them to judge if they have mastered something, it is up to others.

What we should do instead is focus on ways to let people get what they want done faster, both in the short and long term. In the short term, they would find SFML, hopefully read the tutorials and documentation and be able to figure out how to combine things to make what it is they want to make. These people are the ones who probably end up asking really trivial questions on the forum on a daily basis, and are angered when we don't provide them short-term solutions (i.e. copy and paste ready). The people who are interested in getting stuff done in the long term are the ones that read the tutorials, documentation and other forum posts and who are happy for non copy and paste ready feedback. They understand that we are trying to help them improve their practice for the future as well.

If you ask me stratification doesn't solve either of these cases. The short term users will still venture beyond what they are currently comfortable with, and the long term users will treat everything as a single stratum anyway. Dividing it up according to what we think makes sense will end up annoying us as well as the long term users, and the short term users won't even acknowledge that such strata exist anyway.
Title: Re: SFML 3 - What is your vision?
Post by: Lolilolight on October 25, 2014, 12:05:11 pm
Here's my vision :

-A system which allow us to choose between the use of an implicit opengl context, or an explicit opengl context.
-A common interface which allow us to use any library of any os for the different modules by redefining some methods of a common interface used by SFML. (I think that a system to load .dll or .so files on linux and to choose a module to use is a good way.)
So if SFML is not supported by an os we can integrate it easy.

-Support for multiple screens. (It was already proposed and it's already in the program)
-Support for embedded systems. (It was already proposed and It's already in the program too.)

No more visions for the moment but if I've another ones, I post here.
Title: Re: SFML 3 - What is your vision?
Post by: Turbine on November 11, 2014, 02:19:21 pm
More general purpose functionality, such as a fully fleshed vector class.
Title: Re: SFML 3 - What is your vision?
Post by: Gambit on November 11, 2014, 02:23:47 pm
More general purpose functionality, such as a fully fleshed vector class.

SFML is a general purpose multimedia library, and by extension, the vectors are also general purpose. The vectors in SFML do not necessarily have to be used for mathmatical purposes.
Title: Re: SFML 3 - What is your vision?
Post by: Kojay on March 02, 2016, 05:31:17 pm
*bump*

Hope you don't mind me bumping this to bring up a (spontaneous) idea on the age-old radians vs degrees issue.

Already, passing a float as an angle leaves a bad taste, considering C++'s emphasis on types. It would be much more fitting to have a type for it.
Doing that would make it trivial address the degrees vs radians issue by an overload.
Furthermore, thanks to the user-defined literals that SFML 3 will be able to use, it will be possible to write something like

rotate(90_deg);
rotate(1.5708_rad);
 

preserving the simplicity that was Laurent's original intent.
(although unfortunately that last bit doesn't seem to work with the M_PI macros).

Feel free to shoot it down.

The strong type safety itself is important in my view.

addendum: Come to think of it, it's already possible to introduce two types without breaking the API, by making Degrees implicitly convertible to from float, while Radians not.
Title: Re: SFML 3 - What is your vision?
Post by: Nexus on March 03, 2016, 12:16:25 am
@Klaim: We have already discussed those points here (http://en.sfml-dev.org/forums/index.php?topic=12146.msg84751#msg84751) -- a bit of time has passed since then though ;)

There I explained why I consider different angle types and corresponding function overloads a bad idea. User-defined literals can be helpful, and they would work with a sf::Angle class as well.

If you feel there's really something new to add to the discussion, please use the other thread, so we have things in one place. But as mentioned, I believe we've already covered that part -- and don't worry, I won't forget about it :)
Title: Re: SFML 3 - What is your vision?
Post by: Kojay on March 03, 2016, 02:38:40 am
I am not Klaim >:(

Thanks for pointing me to that topic - I suspected that people would have thought of these things but failed to find that one.
On first impressions, I agree with sf::Angle. I 'll be sure to add any further thoughts there.
Title: Re: SFML 3 - What is your vision?
Post by: Nexus on March 03, 2016, 09:08:28 pm
Damn sorry, your ideas sounded so similar that I totally overlooked that ;)
(especially at that late hour)
Title: Re: SFML 3 - What is your vision?
Post by: ast on March 12, 2016, 10:03:04 pm
In rhythm based games it would be important to know with reasonable accuracy what sample is playing right now. If I recall correctly there was some difficulties with that.

Otherwise, I would second what has proposed in a few other messages in this chain that it would be great if there would be more higher level stuff for typical game creating purposes. Not included directly in SFML but with additional libraries that would be shipped with SFML or recommended as to the default way of doing things. Thor would clearly be one of those. Actually this looks like a separate project that would build on SFML.
Title: Re: SFML 3 - What is your vision?
Post by: siordache94 on March 29, 2016, 05:44:32 pm
I'm checkin this post every other day :D!
Any updates / dev on the 3rd version of SFML ?
Title: Re: SFML 3 - What is your vision?
Post by: Hammer55 on April 30, 2016, 02:31:23 pm
One feature I believe would be a great addition is the ability to change the style of the cursor, including options such as hand, waiting, pointer and text selecting. This fits under the S mainly because the concept is obvious and easy to understand at a high level, setCursorStyle(sf::CursorStyle Style). At the low level however this requires using system APIs, which can be difficult to test across multiple operating systems. If you were to do this by simply hiding the cursor and drawing seperate icons you would have consistency issues and SFML drawn cursors and basically any non OS based cursor always lags behind the OS cursor.

It would make it possible to give users consistent cursor styles that go with whatever theme and OS is in use. Being able to do this would be an opportunity to make most GUI elements much more intuitive.
Title: Re: SFML 3 - What is your vision?
Post by: Hiura on April 30, 2016, 02:37:20 pm
This is being worked on. https://github.com/SFML/SFML/pull/827  ;)
Title: Re: SFML 3 - What is your vision?
Post by: scellow on May 20, 2016, 02:13:14 am
For SFML 3.0 i hope you'll still maintain the C# binding :p


It would be nice to have extended features for Vectors, like Lerp/Distance, and an official tweaning api would be great addition i think

EDIT:

Console support would be cool too :p
Title: Re: SFML 3 - What is your vision?
Post by: zsbzsb on May 24, 2016, 01:55:20 pm
For SFML 3.0 i hope you'll still maintain the C# binding :p

Of course that will still happen.  :D

Quote
It would be nice to have extended features for Vectors, like Lerp/Distance, and an official tweaning api would be great addition i think

Highly unlikely as that is a high level API, but everyone can dream...  ;)

Quote
Console support would be cool too :p

What do you mean by that?
Title: Re: SFML 3 - What is your vision?
Post by: Kiecker on July 03, 2016, 05:07:58 am
Personally I LOVE SFML, it is a very simple api with many different uses in the OpenGL scene and does stand as a strong competitor against SDL (whose only advantage is very nice cross-platform support).

However I would like to see
  - Some of the compatibility we do see in SDL, SFML does work against all pc platforms but I would love to use   some of these tools when making android games as SFML has some of the best sprite handling in my opinion
  - This is just a small gripe of mine but if you could getting rid of having to use the different configs with .lib / .a files when there are 2 sets of libraries that are generated. Sadly in that sense that is a win for SDL
  - Some bug fixes with using SFML Textures in OpenGL, this might just be me but when I use sf::Texture::bind() on some objects in opengl there will be an error message in the console that says there was an opengl

however these are all small complaints as SFML is one of the simplest and well documented libraries out there and I can't wait to see how you change it in the future.
Title: Re: SFML 3 - What is your vision?
Post by: Laurent on July 03, 2016, 09:48:28 am
Quote
- Some of the compatibility we do see in SDL, SFML does work against all pc platforms but I would love to use   some of these tools when making android games as SFML has some of the best sprite handling in my opinion
SFML already works on Android and iOS.

Quote
- This is just a small gripe of mine but if you could getting rid of having to use the different configs with .lib / .a files when there are 2 sets of libraries that are generated. Sadly in that sense that is a win for SDL
I'm not sure I understand what you mean here.

Quote
- Some bug fixes with using SFML Textures in OpenGL, this might just be me but when I use sf::Texture::bind() on some objects in opengl there will be an error message in the console that says there was an opengl
I don't think bug fixes belong to the "vision for SFML 3" thread ;)
If the bug has already been reported, then it should be scheduled for a 2.x release. If not, then please open a new thread where you describe your problem.
Title: Re: SFML 3 - What is your vision?
Post by: korczurekk on July 12, 2016, 10:18:49 am
What about getting rid of overriding huge amount of methods like that:
sf::Transformable::move(float x, float y)
sf::Transformable::move(sf::Vector2f vec)
?

With C++11 second one is enough, as you can use brackets to initialise structure:
sprite.setPosition({100, 200});

SFML's code would be much shorter and easier to maintain.
Title: Re: SFML 3 - What is your vision?
Post by: Laurent on July 12, 2016, 10:27:22 am
Quote
What about getting rid of overriding huge amount of methods like that:
sf::Transformable::move(float x, float y)
sf::Transformable::move(sf::Vector2f vec)
?
Yes, we already mentioned this point.
Title: Re: SFML 3 - What is your vision?
Post by: korczurekk on July 12, 2016, 06:27:09 pm
Okay, sorry but I was too lazy to read all those (20?) pages.  :(
Title: Re: SFML 3 - What is your vision?
Post by: korczurekk on December 16, 2016, 01:29:21 am
Maybe remove sf::Time? std::chrono can fit it's position well and you'd have much less code to maintain.

I searched for phrase "time" and didn't find it, sorry if it's a duplicate. :'(
Title: Re: SFML 3 - What is your vision?
Post by: Balnian on December 23, 2016, 09:25:55 am
I kind of agree with korczurekk SF:Time could be replaced with std::chrono
But if we go further we can also remove :
sf::Threads => std::thread
sf::ThreadLocal => no need if sf::Threads become a std::thread ? (not sure what it does)
sf::sleep => std::this_thread::sleep_for
sf::Clock => std::chrono::high_resolution_clock
sf::FileInputStream => std::ifstream (literally the same)
sf::InputStream => std::istream (literally the same)
sf::Lock => std::lock_guard (literally the same ... again)
sf::MemoryInputStream => if sf::InputStream become a std::istream we won't need this anymore
sf::Mutex => std::mutex
...
Well a good part of System could be removed in favor of a Standard implementation  ;D

Also when will the SFML 3 project/branch be started?
Title: Re: SFML 3 - What is your vision?
Post by: victorlevasseur on December 23, 2016, 03:23:09 pm
Quote
sf::FileInputStream => std::ifstream (literally the same)
sf::InputStream => std::istream (literally the same)

I don't know if we can use the i(f)streams with Android and iOS, that's probably why they were created.

Quote
Also when will the SFML 3 project/branch be started?
Same question for me. I would really like to participe in SFML 3 development. ;)
Title: Re: SFML 3 - What is your vision?
Post by: Mario on December 23, 2016, 06:10:58 pm
I don't know if we can use the i(f)streams with Android and iOS, that's probably why they were created.

You can, but not to access assets bundled with the app.
Title: Re: SFML 3 - What is your vision?
Post by: Nexus on December 26, 2016, 11:28:58 am
sf::ThreadLocal => no need if sf::Threads become a std::thread ? (not sure what it does)
Not std::thread, but the thread_local keyword

sf::InputStream => std::istream (literally the same)
If it were literally the same, SFML had used std::istream in the first place, as it's no C++11 feature. Read the documentation to see what it does.

Also, some implementations, while they exist in the standard library, are rather low-level and not always well-supported by all compilers (e.g. it took quite long until high_resolution_clock was adopted by MSVC). This is also a point to consider when changing the implementation.
Title: Re: SFML 3 - What is your vision?
Post by: Balnian on December 28, 2016, 08:23:26 pm
sf::ThreadLocal => no need if sf::Threads become a std::thread ? (not sure what it does)
Not std::thread, but the thread_local keyword
Not sure to understand...are you talking about http://en.cppreference.com/w/cpp/language/storage_duration (http://en.cppreference.com/w/cpp/language/storage_duration)

sf::InputStream => std::istream (literally the same)
If it were literally the same, SFML had used std::istream in the first place, as it's no C++11 feature. Read the documentation to see what it does.
I should not have said (literally the same) on this one, but the fact is that you are using it as the base class for all your input with a focus on file input
Quote
Abstract class for custom file input streams.

This class allows users to define their own file input sources from which SFML can load resources.
By replacing this with std::istream we would have access to all of the standard library type that inherit from std::istream and the future type coming (C++17, C++20,...) like in C++20 there's the standard networking library that should be ready and if it magicaly have a std::isocketstream we could have without change support for loading assets from a network... (this is a crude and simple exemple, but serve it purpose).
My stand is it would be better to use as much standard library as possible, because it's standard behavior across all platform, there's more chance end user will be able to use new language feature without major change to SFML or a ton of wrapper and  finally because if we use the standard library people will have less stuff to learn to start using SFML, because they should understand the base of the Standard Library, and while learning to use SFML they will learn stuff they will be able to reuse outside of SFML.
And for the low level stuff.... well welcom to C++  ;) and let's just make even more awesome tutorial for SFML 3 that will make it easy to learn that stuff and combined with the current style of the Documentation (with exemples) (seriously SFML Tutorials and Documentation Rocks!!!).

Also, some implementations, while they exist in the standard library, are rather low-level and not always well-supported by all compilers (e.g. it took quite long until high_resolution_clock was adopted by MSVC). This is also a point to consider when changing the implementation.
I'm not following you on this one.... there was multiple intervention on this forum thread about SFML 3 using C++11, and all my implementation replacement use at most C++11 and on top of that all major compiler vendor (GCC, Clang, MSVC) now have stable support up to C++14 language features http://en.cppreference.com/w/cpp/compiler_support (http://en.cppreference.com/w/cpp/compiler_support) we're nearly in 2017.... C++17 is nearly here... C++11 use should not even be in debat right now
Title: Re: SFML 3 - What is your vision?
Post by: Laurent on December 28, 2016, 09:01:46 pm
I agree to replace as much as possible with standard stuff.

Using std::istream and std::ostream is something that I really want to do ; it may be harder for people to create specific implementations based on them, but chances are that these implementations already exist (because they are standard), and if needed we could even provide simple wrappers, like boost does.

However...
Quote
like in C++20 there's the standard networking library that should be ready and if it magicaly have a std::isocketstream we could have without change support for loading assets from a network... (this is a crude and simple exemple, but serve it purpose).
Keep in mind that most SFML resources need a seekable stream, that network streams will most likely not be. Things won't be as magical as it seems.

Regarding broken standard stuff, I don't think we should provide a totally new API just to replace it. If a workaround is really needed, we could provide our own (optional) implementation of the broken class(es)/function(s), so that we can remove it when it is no longer needed.
Title: Re: SFML 3 - What is your vision?
Post by: Balnian on December 29, 2016, 12:18:36 am
Laurent when will the SFML 3 repository/branch/project be created? Because right now it's only talk and since the standard commitee started having new release every 3 years we should stop waiting decide the max language feature you want to use (C++11,C++14,C++17,C++20?) and start from here.

Quote
like in C++20 there's the standard networking library that should be ready and if it magicaly have a std::isocketstream we could have without change support for loading assets from a network... (this is a crude and simple exemple, but serve it purpose).
Keep in mind that most SFML resources need a seekable stream, that network streams will most likely not be. Things won't be as magical as it seems.
Yeah... but it was just a simple exemple to illustrate  an advantage (and i didn't knew of another feature coming in the futur that might use an std::istream

BTW std::istream is a seekable stream and every child that inherit from it (except if you do a really messed up implementation overloading and even in this case you would still be able too call seekg)
Title: Re: SFML 3 - What is your vision?
Post by: Mario on December 30, 2016, 08:52:30 am
With all the talk about std::stream, don't forget that there also is still the need for being able to access virtualized file systems as well (at least on Android for assets; not sure about iOS).

Also about "let's use standard stuff instead": I fully agree, but you also have to admit that some standard library stuff feels horribly overcomplicated compared to what SFML provides or provided in regards to simplicity, especially for beginners. I think the former sf::Randomizer (http://www.sfml-dev.org/documentation/1.6/classsf_1_1Randomizer.php) would be a typical example for me compared to what C++11 provides (http://en.cppreference.com/w/cpp/numeric/random).
Title: Re: SFML 3 - What is your vision?
Post by: korczurekk on February 03, 2017, 07:40:33 pm
Also about "let's use standard stuff instead": I fully agree, but you also have to admit that some standard library stuff feels horribly overcomplicated compared to what SFML provides or provided in regards to simplicity, especially for beginners. I think the former sf::Randomizer (http://www.sfml-dev.org/documentation/1.6/classsf_1_1Randomizer.php) would be a typical example for me compared to what C++11 provides (http://en.cppreference.com/w/cpp/numeric/random).

Well, C++11 stuff is way more flexible than that horrible sf::Randomizer. And TBH it isn't really the case we are talking about, C++'s std::random_device, std::default_random_engine and all those distributions are rather small and designed to do one thing each, sf::Randomizer did everything and provided simple interface. I'd actually like to see it rewritten with C++11, somehow like that:
template <class engine_type>
class Randomizer {
        std::uint_fast32_t m_seed;
        engine_type m_engine;

        Randomizer()
                : m_seed { std::random_device{}() }
                , m_engine { m_seed }
        { }

public:
        void setSeed(std::uint_fast32_t seed) {
                m_engine.seed(seed);
                m_seed = seed;
        }

        std::uint_fast32_t getSeed() {
                return m_seed;
        }

        /* Simple, default function */
        float random(float begin, float end) {
                return std::uniform_real_distribution<float>(begin, end)(m_engine);
        }

        /* More flexible alternative */
        template<typename value_type, template<typename T> class distribution_t>
        value_type random(value_type begin, value_type end) {
                return distribution_t<value_type>(begin, end)(m_engine);
        }

        /* Simplified version of code above – takes class
        instead of template as template parameter */

        template<typename value_type, class distribution_t>
        value_type random(value_type begin, value_type end) {
                return distribution_t(begin, end)(m_engine);
        }

        static Randomizer<engine_type>& getInstance() {
                static Randomizer<engine_type> obj;
                return obj;
        }
};

static Randomizer<std::default_random_engine>& getDefaultRandomizer() {
        return Randomizer<std::default_random_engine>::getInstance();
}
Title: Re: SFML 3 - What is your vision?
Post by: Tex Killer on May 04, 2017, 10:11:25 pm
Hey guys, can someone update me on the status of the SoundFile class? Has it been made public yet?

I'm still using the same modified 2013 SFML snapshot to do audio loop points. I think Laurent said once that SoundFile would be made public so that I wouldn't have to modify SFML sources for that.
Title: Re: SFML 3 - What is your vision?
Post by: Laurent on May 05, 2017, 08:00:26 am
Yes, these classes are public now. We even have support for loop points pending (I don't know if it has been merged into master yet).
Title: Re: SFML 3 - What is your vision?
Post by: Tex Killer on May 05, 2017, 06:08:54 pm
Yes, these classes are public now. We even have support for loop points pending (I don't know if it has been merged into master yet).

Cool, thank you Laurent!  ;D
Title: Re: SFML 3 - What is your vision?
Post by: Syndog on June 10, 2017, 10:02:11 pm
I must say, this thread fascinates me. 

It's quite a success, in the sense that I see wishlists and suggestions aplenty over its 300+ posts written over 3 years, many of which I wholeheartedly endorse.  Kudos to those who contributed their thoughts, and to the creators for asking in the first place.

What concerns me is the wealth of time and energy that was spent dismissing suggestions as impractical or beyond scope.  Granted, some fall into these categories for good reason, but in all of these posts, I don't recall seeing anyone in authority publicly saying, "That's brilliant, let's add it to the list."  Not once.  It leaves me with the impression -- rightly or wrongly -- that the powers-that-be are less interested in hearing the community's vision for SFML 3 than maintaining the status quo.  I find that quite distressing.

I've kept a casual eye on SFML for just over 4 years now, and I honestly find it to be one of the best written open source projects I've ever come across, in or out of game development.  I'd love to build a game framework on top of it.  The only thing holding me back is this perpetual holding pattern it seems to be in, and threads like this make it seem as if those in charge just aren't interested in breaking out of it. 

So, I'd like to give the creators an opportunity to address this by turning the thread's question back on them.  What is YOUR vision for SFML 3?  Did you find any worthwhile ideas in this thread?  If so, what are they?  Have they been added to the roadmap for SFML 3?  IS there a roadmap?

Thanks for your time and effort.
Title: Re: SFML 3 - What is your vision?
Post by: Hiura on June 12, 2017, 06:04:44 pm
Glad you like the discussion. :-)

We have some sort of roadmap here: https://en.sfml-dev.org/forums/index.php?topic=21542.msg153137#msg153137 I think you'll find many of the wishes made in this thread on the roadmap. But it's not frozen of course so if you/someone think/s something is missing, let us know. ;)

My personal top 3 priorities for v3 would be: 1) a more modern API & implementation, less platform specific code if a standard version exists; 2) more Input APIs (e.g. Screen, Touch/Pen, ...) -- in other word, a better integration with common input system available with modern OSes; 3) more community PR.

I think this last point would really help make SFML better with faster progress. It's obvious that the core team has many things to do and many other activities besides SFML, so if we could delegate more to the community that'd be awesome.

Quote
It leaves me with the impression -- rightly or wrongly -- that the powers-that-be are less interested in hearing the community's vision for SFML 3 than maintaining the status quo.
That's a fair critic and we should definitely improve on that. For the record though, this impression is incorrect: we really value community feedback -- granted that only extremely convincing and well developed arguments will convince us that a new feature indeed fits SFML scope.
Title: Re: SFML 3 - What is your vision?
Post by: Syndog on June 14, 2017, 02:50:57 pm
We have some sort of roadmap here: https://en.sfml-dev.org/forums/index.php?topic=21542.msg153137#msg153137 I think you'll find many of the wishes made in this thread on the roadmap.
Thank you for the link!  This is exactly what I was hoping to see, mainly because it contrasts with what this thread exhibits.  I'm still feasting on much of the contents under discussion, and expect to be for some time.  Brain food, as it were.   ;D

. . . 3) more community PR.

I think this last point would really help make SFML better with faster progress. It's obvious that the core team has many things to do and many other activities besides SFML, so if we could delegate more to the community that'd be awesome.
I agree.  Do you have anything specific in mind?  How can I help?

Thank you for sharing your thoughts, Hiura.  I appreciate it.
Title: Re: SFML 3 - What is your vision?
Post by: Hiura on June 14, 2017, 04:16:57 pm
It's clear that submitting a PR is a lot of work and therefore requires a lot of free time as well as a deep understanding when it comes to complex bug fix or new feature implementation. So it's not easy for everyone to help with that. However, testing existing PR should be fairly straightforward for anyone. So if you, or anyone else for that matter, want to chip in without spending hours and hours, just pick an open PR (https://github.com/SFML/SFML/pulls) and give some feedback on it. It can be as simple as "it does (not) fix the bug on my system" and this would be already highly welcome. :-)

Then, of course, if one want to really invest themselves into SFML, we have a detailed procedure for contribution: https://www.sfml-dev.org/contribute.php
Title: Re: SFML 3 - What is your vision?
Post by: fastrgv on June 19, 2017, 03:57:15 pm
Just noticed this great thread...
My personal top priority would be for a future SFML to avoid OpenGLv3.3-deprecated functions so that it is possible to use a core profile "modern" OpenGL of at least version 3.3.
Rod
Title: Re: SFML 3 - What is your vision?
Post by: Sub on August 13, 2017, 11:59:46 pm
This is a nice thread.

The only thing I want is better multi-monitor support, as I've run into a few issues with this on both Linux and Windows.   Sounds like this is already on the agenda though. 
Title: Re: SFML 3 - What is your vision?
Post by: silverweed on September 06, 2017, 08:23:27 pm
One thing I'd really like to have is the ability to independently set the translation, scale and rotation origin for sf::Transformable. I know I can use sf::Transform directly, but I think a middle-ground solution would be convenient, as the complication of using sf::Transform is barely justified for such a common1 need IMHO.

1 "common" in my experience, of course. Maybe there are far fewer people than I think who ever need this capability.
Title: Re: SFML 3 - What is your vision?
Post by: eXpl0it3r on September 06, 2017, 08:49:32 pm
Can you elaborate more on your problem?
sf::Transformable has all the set and get functions for transform, scale and rotation.
Or do you mean, you want to access a transform that has only set the scale or only set the transform?

Personally, I would say if such transforms are needed, then your own custom "layer" might be useful that provides such an interface and generates the various transforms.
I mean SFML itself doesn't hold the transforms separately, so they would need to be calculated anyways.
Title: Re: SFML 3 - What is your vision?
Post by: Hapax on September 06, 2017, 11:08:29 pm
It sounds like Silverweed would like to be able to use a separate origin for each transformation.
Title: Re: SFML 3 - What is your vision?
Post by: Sygmei on September 18, 2017, 01:50:12 pm
I do agree, separate origins would be nice, I needed it and had to create a whole class for it.
Title: Re: SFML 3 - What is your vision?
Post by: Phanoo on September 18, 2017, 04:38:04 pm
- Automatic batching of draw calls that use the same texture
- More powerful Text class : set line height, letter spacing, align releative to user defined bounds, automatic wrapping...
- Drag & drop support
- Clipboard support
Title: Re: SFML 3 - What is your vision?
Post by: Laurent on September 18, 2017, 10:42:37 pm
Quote
set line height, letter spacing
Clipboard support
All done (will be released in 2.5). This kind of non-breaking changes don't need to wait for SFML 3, and we can discuss them at any time in the "feature request" sub-forum.

Don't hesitate to have a look at github to be aware of the coming / pending changes.
Title: Re: SFML 3 - What is your vision?
Post by: Phanoo on September 19, 2017, 11:41:08 am
Very nice ! I think i'll get the development version to start using it.
Title: Re: SFML 3 - What is your vision?
Post by: MetalCoder on October 28, 2017, 03:43:53 am
Will there be a C and .NET port of SFML 3?
Title: Re: SFML 3 - What is your vision?
Post by: Laurent on October 28, 2017, 07:44:29 am
Quote
Will there be a C and .NET port of SFML 3?
If someone writes them, yes.
Title: Re: SFML 3 - What is your vision?
Post by: MorleyDev on October 29, 2017, 01:45:59 pm
Not sure if this has been brought up before, probably has, but it occurs to me a current limitation with SFML is that you cannot dynamically swap the underlying rendering platform at runtime. To use Irrlicht as an example, you can create DirectX drivers, OpenGL drivers, and Software Rendering drivers and decide on which one to use at runtime.

If SFML allowed for this, even if it only had one officially supported driver, it would serve to document *how* a person who needs to can modify SFML to support a different rendering platform, which at the moment feels more like going in and 'hacking SFML apart until it works'.

This could aid future efforts for support for new platforms that may not necessarily have any OpenGL access, and would make porting to DirectX, or even back down to older versions of OpenGL, or to Vulkan, or to a chosen version of OpenGL ES easier for people who decide they want to do so for whatever reason.

It would also keep a migration path open for developers if/when SFML moves up to newer OpenGL versions as they come out and settle, allowing for older ones to have official support deprecated without immediately breaking code and requiring a new major release.

Additionally, if SFML was also 'interface-driven' (which fits nicely with the above), then SFML could be easily mocked out when unit testing the graphics code, and that'd also be quite nice. At present you need to write a facade around SFML to accomplish this. Though I admit, not as many people care about unit testing their game rendering code as should darn it :P
Title: Re: SFML 3 - What is your vision?
Post by: Laurent on October 29, 2017, 09:01:01 pm
I'm not in favor in abstracting the graphics back-end. I don't think it has any practical benefit (except the "technical challenge" and "others do it"), and would make the code less maintainable (any addition has to be implemented in all the back-ends) and less optimizable.

However, I know that other team member(s) have a different opinion on this topic, so who knows ;)
Title: Re: SFML 3 - What is your vision?
Post by: Tank on October 30, 2017, 11:06:02 am
I don't like it much because I fear that more projects would use DX because it's more known or "all the other AAA games use it so it must be better". Lots of SFML projects aren't cross-platform already because people use platform-specific path separators ('\' vs '/'), Windows-only headers or case-insensitive filenames. With a DX backend, people might be more tempted to use DX-exlusive features.
Title: Re: SFML 3 - What is your vision?
Post by: DeathRay2K on October 30, 2017, 03:08:34 pm
I think it would only make SFML more flexible to include a layer of abstraction over the graphics back-end. I don't think it makes sense for that to include developing additional back-ends though. There's no reason there should be an official DirectX back-end, but a developer who knows they need such a thing will have the option to create one and ensure it will integrate relatively easily with SFML.

If someone is using SFML more casually, they will surely use the default OpenGL back-end and have the best chance of developing cross-platform code. Besides, with a common abstraction for all graphics back-ends, there's no opportunity for adding DX-specific features without sidestepping the abstraction or building the feature into it.

A clean abstraction should make the code easier to maintain as well, as long as it doesn't mean developing additional back-ends.
Title: Re: SFML 3 - What is your vision?
Post by: MorleyDev on October 31, 2017, 12:50:03 am
Sorry if this wasn't clear, but I wasn't specifically suggesting actually maintaining multiple official backends. The key point was more:
* "If SFML allowed for this, even if it only had one officially supported driver, it would serve to document *how* a person who needs to can modify SFML to support a different rendering platform, which at the moment feels more like going in and 'hacking SFML apart until it works'."

That and the interface-driven point, namely interfaces enabling mocking out of SFML for easier unit testing of code that calls SFML :)
Title: Re: SFML 3 - What is your vision?
Post by: Laurent on October 31, 2017, 07:39:26 am
It's nearly impossible to design a robust abstraction for graphics rendering with only a single back-end in mind. You have to cope with limitations and design philosophy of all back-ends -- at least the two major ones. This also means that your abstraction, being a common denominator, will be less flexible and optimized, compared to what we do currently with the direct OpenGL integration.

Is there any use of interfaces other than for unit testing?
Title: Re: SFML 3 - What is your vision?
Post by: MorleyDev on October 31, 2017, 10:12:00 am
I understand that. I guess what I'm struggling with conceptually is I'm not sure what level of abstraction SFML intends to live at inside a large codebase.

So inside a large project, is it intended that I be calling SFML directly all over a codebase? Or is it intended to be abstracted away and only exist in the code in discrete, easy-to-swap-out abstractions, so it can be replaced with another library, for example SDL2, if I need to target a platform that SFML does not support (not even meaning say consoles. For example, if I intend to compile to Wasm/asm.js).

The former, means SFML is held back by the opaqueness of it's implementation. Parts of it can't be easily swapped out or plugged in, it's a whole package and you take it or leave it. Yes that aids in it's simplicity, but at a cost of flexibility.

If the latter, then fair enough. This is almost always the approach I wind up taking. It can sit behind an abstraction in the code, even the graphics rendering itself can be abstract just have different implementations of "initialise" and "render this game state" functions, and the rest of the system can be none-the-wiser.

I think the thing that exemplifies this confusion for me is sf::Sprite. It's never been entirely clear to me whether the intention with a larger game is that sf::Sprite is used as a part of the representation of entities in a game, or is the intention that sf::Sprites are created at-draw-time given some other representation of an entities state.

Or take image loading. With something much higher-level like MonoGame, you can plug your own asset formats into it's pipeline and it can load them. With SFML, you can't do that. If it's intended to be wrapped up in a facade anyway, that's fine since you'll be abstracting away the image loading into something more general purpose, you'll create your own pipeline for it. If it's not intended to be wrapped, you'd expect it to expose hooks instead.

This is something I've always struggled with when writing things that use SFML, I'm not entirely sure where's it's intended to live. SDL2 is low-level, it feels right to hide it away. SFML is higher-level by it's very nature, it's part of the reason it's easier to start out with, so needing to hide it away like that almost feels a bit like 'missing the point'.

This is all possibly just a result of SFML managing to straddle that sweet-spot of being usable for both smaller and larger projects (which is definitely a good thing), so it's not so much a flaw as it is a result of it providing tools usable for both and leaving the rest to you. But it does result in it dangling somewhat awkwardly between a high-level library and a low-level library in some regards, and that s something that's been bouncing around my head for awhile now about SFML, and I've never been quite sure how to word it xD

=================

On a less dramatic note, I'd love if Image/Audio loading returned an std::future or had a "loadFromFileAsync" variant that returned an std::future :) Embrace the non-blocking file-io of the future (future future)
Title: Re: SFML 3 - What is your vision?
Post by: Laurent on October 31, 2017, 12:09:51 pm
I perfectly understand what you mean. But I think you're wrong:
Quote
SDL2 is low-level, it feels right to hide it away. SFML is higher-level by it's very nature
I'm curious to know what makes SFML higher-level. It is designed to provide the exact same set of features than SDL and other similar frameworks. Maybe SFML just looks higher-level, because it is designed nicely with an object-oriented approach? ;)

Quote
On a less dramatic note, I'd love if Image/Audio loading returned an std::future or had a "loadFromFileAsync" variant that returned an std::future :)
I think it's wrong to ask an asynchronous version of XYZ feature when you can simply do
auto result = std::async([](std::string filename){sf::Image image; image.loadFromFile(filename); return image;}, "blop.png");
Title: Re: SFML 3 - What is your vision?
Post by: binary1248 on October 31, 2017, 12:35:04 pm
I honestly can't think of any reason why we wouldn't be able to support multiple render backends. Sure... it might look like e.g. OpenGL and D3D are by nature incompatible with each other, but considering SFML only makes use of such a small subset of OpenGL (which itself comprises mostly of legacy features), most if not all of the concepts in SFML can be easily represented in the D3D world as well. Most of these concepts come straight out of general computer graphics and so are present in any hardware accelerated graphics API.

On the other hand, if SFML were to seriously one day support "modern" OpenGL, then the differences between OpenGL and D3D or even Vulkan for that matter become so small they aren't even worth mentioning. Just look at DX12 and Vulkan and to some weird extent OpenGL 4.6. The main reason why developer teams choose one over the other (DX vs Vulkan) is because they have a lot of prior experience with the API. The argument "one API supports something that the other doesn't" has become a thing of the past, which is a good thing. What matters more is what level of hardware the developer wants to support and this shouldn't boil down to the question of which graphics API to use.

We aren't doing the future of SFML a favour by artificially pretending that the differences between graphics APIs are too huge to abstract behind a single interface. If that is still a concern then the only sane thing to do is modernize the implementation to the point where there would no longer be any differences anyway. If the big player engines can do it on a large scale then we already know it is theoretically possible.
Title: Re: SFML 3 - What is your vision?
Post by: MorleyDev on October 31, 2017, 12:40:19 pm
Maybe SFML just looks higher-level, because it is designed nicely with an object-oriented approach? ;)

Like I said, sf::Sprite is something of the representation of why SFML confuses me with what level to put it at. sf::Sprite has functions to move it, scale it, rotate it, get global and local boundaries that can be used in simple collision detection. These make it conceptually more than a dumb object passed around to give information to SFML for rendering, it makes it a higher-level of object and even if that's not the intention it encourages people to use it as such.

I know the docs describe these as 'convenience functions', but I'd argue they expand the domain of the object considerably and make it something beyond what a low-level library would, or even maybe should, provide. So perhaps my critique is with the very existence of sf::Sprite as a render-level primitive.

I guess it just feels like using sf::Sprite to simply be a POD to pass a blit of an image, even a scaled and rotated blit, into SFML is a kind of conceptual overkill due to the presence of these functions, which makes me doubt that it's what I should be doing. All doubts flow from that point, I guess.

There are a few other things, like sf::Image having functions to load images from the filesystem that I'd like to see moved outside of sf::Image and into some kind of global function instead. Perhaps even moved out of sfml/Graphics entirely and into new packages that 'higher level functionality' like that can live (though C++'s library system as out-right clunky as it is, that's maybe a step too far).

Separates the loading of an image from the file system straight out of the definition of what an image is, having image loading even as a static function conflates it with the very idea of an Image, and having it as a local function makes sf::Image needlessly stateful. To my mind, Image shouldn't even have a default constructor at all, and should require some kind of data be passed to it for it to even exist.

I'm pretty sure that's been discussed already though.

But this is what I mean by SFML being higher-level, it's got conceptually 'higher' ideas like loading an image from the file system living side-by-side with conceptually 'lower' ideas, like creating an image from a byte array, and that muddies the waters somewhat. Or Sprites, with boundaries and moving, mixed up with Blitting, which is just "here is a texture, here's the section to draw, here's a transformation, have at!".

I guess you could say my vision for SFML 3 is for it to finish the job started all the way back when Image and Texture were separated into two classes: Remove all these mixed concerns from the code, to make it simpler, purer and more streamlined.

On the whole multi-renderer thing, I've found the main thing that makes cross-renderer abstractions tricky is Shaders. DX12 and OpenGL have different shader languages, so how exactly you can abstract that away (not abstracting the existence of the multiple shader languages obviously, but the creation and passing around of those shaders) is a design question that I've not found any really nice answers, just 'somewhat acceptable work-arounds'.

Quote
I think it's wrong to ask an asynchronous version of XYZ feature when you can simply do
auto result = std::async([](std::string filename){sf::Image image; image.loadFromFile(filename); return image;}, "blop.png");

True, file I/O is just the thing other languages have conditioned me to think of as async-by-default, otherwise you're holding up a system thread even if you create a new thread just for loading it. But the more I think about it the idea does not carry over to C++'s async/threading model as well (yet), since most of those languages have the idea of some sort of task pools baked into the language or standard library (even the newer 'low-level' languages like Rust and Go).

Although, if the std filesystem API were ever to go with an async-first design, I'd then argue SFML should follow-suit for file I/O (or if SFML got it's much-suggested Filesystem API, that could declare 'f-u' and go async-based from the ground-up. But C++'s futures API isn't quite there yet, maybe when it inevitably becomes monadic).