SFML community forums
Help => Window => Topic started by: waxx on June 21, 2012, 04:38:13 pm
-
Hi. My question will be about SFML 1.6
Here's what I want to achieve:
Orginal window: 1024x768
After fullscreen: 1920x1080 window with 1440x1080 (keeping orginal 4:3) game in the middle with two black vertical bars on top of which I'll render fillers.
This is prettty common resizing option for many casual games found in bigfishgames. Wondering how can I achieve it in SFML. Thanks.
-
My question will be about SFML 1.6
Why? Use SFML 2.0rc it has only advantages! :D
Wondering how can I achieve it in SFML. Thanks.
Have you even taken a look at the documentation/tutorials? To change from window mode to fullscreen or the other way around you just need the Create(...) (http://www.sfml-dev.org/documentation/1.6/classsf_1_1Window.php#aa891f1cbd7d77c4dc02ac950b6e76f61) function from the sf::Window/sf::RenderWindow.
The documentation, the tutorials and the examples explain this pretty well... ;)
-
I think he's asking how he can change the aspect ratio of the window while preserving the aspect ratio of the main viewport. I don't really know how it would be done; might it involve glScissors?
-
Ah sorry then I didn't understand it right. ::)
This can be easily achieved with changes in the sf::View (http://www.sfml-dev.org/documentation/1.6/classsf_1_1View.php).
I'll soon publish a tutorial on sf::View if you don't understand how it works or how you'd have to use it. ;)
Edit: Article can be found here (http://dev.my-gate.net/2012/06/using-sfview/)
-
My question will be about SFML 1.6
Why? Use SFML 2.0rc it has only advantages! :D
Wondering how can I achieve it in SFML. Thanks.
Have you even taken a look at the documentation/tutorials? To change from window mode to fullscreen or the other way around you just need the Create(...) (http://www.sfml-dev.org/documentation/1.6/classsf_1_1Window.php#aa891f1cbd7d77c4dc02ac950b6e76f61) function from the sf::Window/sf::RenderWindow.
The documentation, the tutorials and the examples explain this pretty well... ;)
I'm glad you read my therad and you answered my question.
Not.
My project is already big so I can't move to 2.0 >.>
@up
That's cool. Looking forward to it.
-
I read your article.
There's no SetViewport in SFML 1.6 for sf::View though. What do?
-
Use SFML 2.0! :P
Those that fear refactoring are already doomed. ;)
No joking aside, I've no idea which function has the same effect in SFML 1.6, but there aren't too many functions. (Doc (http://www.sfml-dev.org/documentation/1.6/classsf_1_1View.php))
If I had to guess, I'd go with SetFromRect(...)
-
There's no viewport in SFML 1.6, you must more or less hack to simulate the same result.