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

Author Topic: Resolution  (Read 1020 times)

0 Members and 1 Guest are viewing this topic.

antuan

  • Newbie
  • *
  • Posts: 1
    • View Profile
Resolution
« on: August 26, 2016, 02:24:10 pm »
hy i have a Big problem  i was making my game and when i finished i played on another pc not the one that i made it and a lot of stuff was offscreen how can i fix it.

[rect.setSize(sf::Vector2f(screensize - 600 )]

How can i find the size of the screen i want my game to run on any screen..

Brax

  • Newbie
  • *
  • Posts: 39
  • Wannabe C++ Game Developer
    • View Profile
Re: Resolution
« Reply #1 on: August 26, 2016, 02:52:42 pm »
I am not 100% sure I understood what you ask, but if you want to know how many fullscreen resolutions can a monitor support, try this:


//  inside a class:
std::vector<sf::VideoMode>      mVideo_Modes

// In a function:
mVideo_Modes = sf::VideoMode::getFullscreenModes();

 

This will give you the list of all resolutions and all bits per pixel (8-bit, 16-bit, 32-bit) a monitor can support.
( you might do a bit to kick out all 8-bit and 16-bit resolutions  ;) )

If you have a windowed screen mode, then just make sure that the width and height of the window are not greater than the desktop resolution.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10819
    • View Profile
    • development blog
    • Email
Re: Resolution
« Reply #2 on: August 26, 2016, 03:29:16 pm »
There's also the getDesktopMode() which gives you the current video mode.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything