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

Author Topic: Resolutions... Yes that topic!  (Read 1674 times)

0 Members and 1 Guest are viewing this topic.

Roose Bolton of the Dreadfort

  • Full Member
  • ***
  • Posts: 113
  • Full-time Procrastinator, Part-time programmer.
    • View Profile
    • Personal Portfolio/Website/Blog
Resolutions... Yes that topic!
« on: October 23, 2012, 02:42:21 pm »
Hey All..

Been working on my SFML Physics game and I am wanting to make it fullscreen!

I understand that the best way to do this is to build the game to a set resolution (which I have done)

so say I have built the game on 1600x900, and someone joins the game with a resolutions of 1900x1080 do I just divide 1900 by 1600 & 1080 by 900 to find the scale factor, then just scale the sf::view by the scale factors of the Width & Height?

is there any other way that is prefered?
Trying so very hard to finish at-least one project.

Watch out for the RAII police, they will get you.

www.bantersaurus-games.com

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Resolutions... Yes that topic!
« Reply #1 on: October 23, 2012, 04:53:00 pm »
It depends on what you want to achieve.
If you adjust the view to match the window resolution you'll get more actual space to fill and others with a smaller resolution won't see as much as you do.
If you just scale the view, but keep the resolution ratio the same between all clients, then everyone one will see the same thing, some just a bit more scaled up/down.
The third option is to adjust the view, but scale the content. But this gives you more work, since you'll also have to use scaled coordinates vector etc.

As a note: When scaling things you lose quality of the image/texture thus you may want to have different resolutions and swap them at a certain points so you'd get a nicer result.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/