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

Author Topic: Question about fullscreen  (Read 3843 times)

0 Members and 1 Guest are viewing this topic.

waxx

  • Newbie
  • *
  • Posts: 26
    • View Profile
Question about fullscreen
« 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.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11053
    • View Profile
    • development blog
    • Email
Re: Question about fullscreen
« Reply #1 on: June 21, 2012, 04:44:37 pm »
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(...) function from the sf::Window/sf::RenderWindow.
The documentation, the tutorials and the examples explain this pretty well... ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Celtic Minstrel

  • Jr. Member
  • **
  • Posts: 80
    • View Profile
Re: Question about fullscreen
« Reply #2 on: June 21, 2012, 04:49:34 pm »
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?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11053
    • View Profile
    • development blog
    • Email
Re: Question about fullscreen
« Reply #3 on: June 21, 2012, 04:56:58 pm »
Ah sorry then I didn't understand it right. ::)

This can be easily achieved with changes in the sf::View.
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
« Last Edit: June 22, 2012, 09:33:40 pm by eXpl0it3r »
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

waxx

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: Question about fullscreen
« Reply #4 on: June 21, 2012, 04:57:52 pm »
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(...) 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.

waxx

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: Question about fullscreen
« Reply #5 on: June 22, 2012, 07:52:51 pm »
I read your article.
There's no SetViewport in SFML 1.6 for sf::View though. What do?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11053
    • View Profile
    • development blog
    • Email
Re: Question about fullscreen
« Reply #6 on: June 22, 2012, 09:32:34 pm »
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)
If I had to guess, I'd go with SetFromRect(...)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Question about fullscreen
« Reply #7 on: June 22, 2012, 09:40:31 pm »
There's no viewport in SFML 1.6, you must more or less hack to simulate the same result.
Laurent Gomila - SFML developer