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

Author Topic: When I create a fullscreen window, it's bigger than my screen  (Read 7231 times)

0 Members and 1 Guest are viewing this topic.

gws923

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
When I create a fullscreen window, it's bigger than my screen
« on: November 04, 2016, 07:32:07 pm »
Hi folks.  I've been developing a project on my desktop for a long time, but when I compiled on my laptop something strange happened.  When I create the renderWindow, it goes into fullscreen (as expected), and outputs the correct size (1920x1080) if I ask for renderWindow->getSize(), but the content of my project doesn't fit on the screen.

Here is the code, as simple as it gets:
_rw = new sf::RenderWindow();
_rw->create(sf::VideoMode::getFullscreenModes()[0], name(), sf::Style::Fullscreen);

And here are some images illustrating the problem:
http://imgur.com/a/bYkKp

Now, I've even tried simply compiling the SFML example app that comes with SFML 2.0 and I get the same problem.  Which means either my computer is doing something weird, or SFML is doing something weird, but not my code.  If the former, any tips on what I may have done? If the latter, are you aware of this issue? (Yes, I know there are newer versions of SFML and I'll upgrade if I have to but....)

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: When I create a fullscreen window, it's bigger than my screen
« Reply #1 on: November 05, 2016, 11:18:37 am »
Which version are you using? Have you tried SFML 2.4?

Are you using a view?
It looks like you are but if it applies to the example that doesn't, it can't be that. It does look like a view has been specified or that the window is just simply larger than the screen. Are you sure it's correctly going into fullscreen mode and not just creating a large window that covers the screen without changing the resolution?
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

gws923

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
Re: When I create a fullscreen window, it's bigger than my screen
« Reply #2 on: November 05, 2016, 06:20:31 pm »
Which version are you using? Have you tried SFML 2.4?

Are you using a view?
It looks like you are but if it applies to the example that doesn't, it can't be that. It does look like a view has been specified or that the window is just simply larger than the screen. Are you sure it's correctly going into fullscreen mode and not just creating a large window that covers the screen without changing the resolution?

I'm using 2.0.  I haven't updated because the project is almost finished and I'm scared to mess with it at this point.

I use a view during actual gameplay, (which suffers the same problem), but for my menu screen I don't.  So that doesn't seem to be the problem either.

I have compiled other SFML 2.0 projects on my laptop before, and even previous versions of this project worked just fine... so it must be something that changed on my computer (I tried checking out an older commit and the problem persisted).

I don't believe it's the compiler either, because if I compile on my desktop and then send the executable to my laptop, this problem still happens.

Blarggggg.... what did I do??


eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
AW: When I create a fullscreen window, it's bigger than my screen
« Reply #3 on: November 05, 2016, 06:32:32 pm »
Make sure you have turned of scaling (or set to 100%) in your GPU options.
« Last Edit: November 05, 2016, 09:16:03 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/

gws923

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
Re: AW: When I create a fullscreen window, it's bigger than my screen
« Reply #4 on: November 05, 2016, 08:52:22 pm »
Make you have turned of scaling (or set to 100%) in your GPU options.

Ah.  Indeed, this is the problem.  My GPU won't let me turn off scaling, though (It even lists it as an option but I can't change it???).  So, the fix is that I can't have my laptop at max resolution (1920x1080) because Intel is stupid.  As long as my laptop is at a lower resolution, it handles this correctly.

*Sigh.*  Thank you for the help, and I'm glad I figured this out, even if it basically means it's not my fault, and if it happens to a user they're going to have to figure it out too.

gws923

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
Re: When I create a fullscreen window, it's bigger than my screen
« Reply #5 on: April 11, 2017, 02:48:13 am »
Sorry to bump an old thread but this issue remains in my program.  May I just re-ask:

Is there nothing I can do about this from my standpoint?  Anybody who plays my game and encounters this problem is going to think the game is broken.  Any tips?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: When I create a fullscreen window, it's bigger than my screen
« Reply #6 on: April 11, 2017, 03:07:53 am »
So have you tried updating to SFML 2.4.2 yet?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

gws923

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
Re: When I create a fullscreen window, it's bigger than my screen
« Reply #7 on: April 11, 2017, 03:30:21 am »
No I haven't.  I'm a little scared to at this point.  Project is supposed to release in about 10 days and I have a billion other things to do BUT if "upgrade to 2.4.2 and it will be fixed" is the answer, then that's perfectly satisfactory to me.  I'll just have to do it then.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: When I create a fullscreen window, it's bigger than my screen
« Reply #8 on: April 11, 2017, 03:49:12 am »
Well there's some DPI awareness added since 2.0 and lots and lots of bugfixes. But I can't give you any guarantees. With SFML 2.x being fully backwards compatible, an update shouldn't be an issue and you had like over 5 months to update. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Re: When I create a fullscreen window, it's bigger than my screen
« Reply #9 on: April 11, 2017, 02:47:55 pm »
DPI awareness on Windows can be a huge mess, especially if you're still trying to support older versions of Windows. Right now SFML 2.x is still supposed to be compatible with Windows XP and Windows Vista, despite both essentially being "dead". Microsoft only really improved on DPI awareness with later versions, most notably Windows 7 (to some extend) and Windows 10. There are still a few issues, but I don't think we can fix all of them under SFML 2.x, at least not without a significant rewrite of some parts of the window handling code.

gws923

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
Re: When I create a fullscreen window, it's bigger than my screen
« Reply #10 on: April 11, 2017, 11:20:08 pm »
Well there's some DPI awareness added since 2.0 and lots and lots of bugfixes. But I can't give you any guarantees. With SFML 2.x being fully backwards compatible, an update shouldn't be an issue and you had like over 5 months to update. ;)

Thank you.  If updating isn't such a big deal I'll give it a shot ;)

And thank you, Mario, for further clarification.  I'll see what I can do.

gws923

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
Re: When I create a fullscreen window, it's bigger than my screen
« Reply #11 on: April 14, 2017, 03:31:55 am »
Upgrading to 2.4.2 fixed the issue.  Thanks everyone!