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

Author Topic: mismatch of desktop resolution and RenderWindow resolution  (Read 2772 times)

0 Members and 1 Guest are viewing this topic.

plusb

  • Newbie
  • *
  • Posts: 2
    • View Profile
mismatch of desktop resolution and RenderWindow resolution
« on: September 01, 2013, 09:22:15 am »
hi,

I had to test the example of SFML2.0,

when i going to full screen

I found a problem that resolution of desktop (PC) and VideoMode of SFML RenderWindow do not match .

I use a tablet pc, I was changing the UI scale of Windows

resolution of Device(PC) : 1080p modifyed resolution : 720p (Maybe..,expected)

I change the Text Size and ui items in this options(window 8):  Control Panel > Display

and modifyed text size to 150%

-
code:

const int gameWidth = 1920;
const int gameHeight = 1080;
const VideoMode gameDisplay = VideoMode::getDesktopMode();
. . .

sf::RenderWindow window(sf::VideoMode(gameDisplay.width,gameDisplay.height,gameDisplay.bitsPerPixel), "Pong",sf::Style::Fullscreen);
//window.setVerticalSyncEnabled(true);

result :

redpaddle is the view outside

image :
-

in other games(ex:Osu!) support the auto resolution scaling , please give me some solutions.
« Last Edit: September 12, 2013, 04:39:54 pm by plusb »

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: mismatch of desktop resolution and RenderWindow resolution
« Reply #1 on: September 01, 2013, 09:37:15 am »
I honestly can't figure out what the problem is because your post is just so confusing.  It sounds like you're saying you want the game to be in fullscreen at the same size as the desktop, but you don't seem to be saying that it isn't the same size.  All your screenshots show is that some paddles ended up outside the screen, but that's far more likely to be wrong paddle coordinates than a wrong window size.

Did you simply set the red paddle's x-coordinate to the width of your screen?  Because that puts the left edge of the paddle at the right edge of your screen, which means the paddle appearing off-screen is the correct behavior.

Also, what's the point of gameWidth and gameHeight?  You don't appear to do anything with them in the code you pasted.

plusb

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: mismatch of desktop resolution and RenderWindow resolution
« Reply #2 on: September 01, 2013, 10:08:21 am »



Sorry for causing confusion .
(Because im korean, My English is poor. )

Want to say I ,

I lowered the resolution of my computer , but I do not know how to find the exact resolution SFML.

BaneTrapper

  • Full Member
  • ***
  • Posts: 213
  • Do you even see this, i dont need it.
    • View Profile
    • Email
Re: mismatch of desktop resolution and RenderWindow resolution
« Reply #3 on: September 01, 2013, 10:44:54 am »
There is a way to grab all possible resolutions supported by your GPU.
Chose one that is most fitting to your screen resolution.
Or just print them all out to see if you have one that is in your desktop if not... i would say its a bug/error.
BaneTrapperDev@hotmail.com Programing, Coding
Projects: Not in development(unfinished/playable):
http://en.sfml-dev.org/forums/index.php?topic=11073.msg76266#msg76266
UP and in Development: The Wanderer - Lost in time
http://en.sfml-dev.org/forums/index.php?topic=14563.0

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: mismatch of desktop resolution and RenderWindow resolution
« Reply #4 on: September 01, 2013, 11:06:18 am »
I lowered the resolution of my computer , but I do not know how to find the exact resolution SFML.

Are you saying that the return value of getDesktopMode() doesn't reflect changes you make to your desktop resolution?

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: mismatch of desktop resolution and RenderWindow resolution
« Reply #5 on: September 01, 2013, 12:17:01 pm »
The settings in #2 aren't changing the resolution.
« Last Edit: September 01, 2013, 12:18:34 pm by Ixrec »