1
SFML projects / Swoosh 2 alpha release
« on: December 02, 2022, 11:35:33 pm »
Swoosh 2 is ready for use but not yet merged into master. Use branch feature/swoosh2 for the latest changes.
What is Swoosh?
See More:
Swoosh 2 changes the way we render graphics. Traditionally, SFML sprites are drawn directly to the target surface or window. With Swoosh 2, we submit render events with data in them and let the user-defined renderer decide how to draw. It's convenient to think of render events for sfml drawables as "tags". By tagging the drawables, we can tell the renderer how we'd like to draw them.
Swoosh 2 comes with a simple composite renderer, SimpleRenderer, and a few event types to begin migrating from the previous version:
Having multiple render options for SFML projects is powerful and brings a lot of utility.
One render option can be used to increase performance on embedded machines by discarding some events entirely, especially since SFML 2 is still very behind on modern graphics support on PC and mobile.
Another renderer can be used for debugging your application. Or you can get creative and make the renderer an in-game effect that changes how your player sees the world around them.
The most powerful aspect about Swoosh 2's new renderer pipeline is that you do not need to change what you submit to draw so all of your scene's code stays the same.
See the Example Project draw step source code to see this fact in action.
What is Swoosh?
See More:
(click to show/hide)
Swoosh 2 changes the way we render graphics. Traditionally, SFML sprites are drawn directly to the target surface or window. With Swoosh 2, we submit render events with data in them and let the user-defined renderer decide how to draw. It's convenient to think of render events for sfml drawables as "tags". By tagging the drawables, we can tell the renderer how we'd like to draw them.
Swoosh 2 comes with a simple composite renderer, SimpleRenderer, and a few event types to begin migrating from the previous version:
- struct Immediate → used by swoosh internals to draw directly to the final output buffer
- Clone(...) → a utility function that makes a copy of your sfml primitive before submitting. Useful for migration.
- renderer.submit(sf::drawable*, sf::RenderStates) → overload to replace the previous draw calls will wrap sfml primitives into RenderSource events.
Click the image to go to the YouTube video
Having multiple render options for SFML projects is powerful and brings a lot of utility.
One render option can be used to increase performance on embedded machines by discarding some events entirely, especially since SFML 2 is still very behind on modern graphics support on PC and mobile.
Another renderer can be used for debugging your application. Or you can get creative and make the renderer an in-game effect that changes how your player sees the world around them.
The most powerful aspect about Swoosh 2's new renderer pipeline is that you do not need to change what you submit to draw so all of your scene's code stays the same.
See the Example Project draw step source code to see this fact in action.