Author Topic: VideoModes that don't fit into screen  (Read 1361 times)

Offline raft

  • quad
  • ******
  • Posts: 1974
    • View Profile
    • http://www.aptalkarga.com
VideoModes that don't fit into screen
« on: March 10, 2013, 08:35:38 pm »
FrameBuffer.getVideoModes may return a mode that does not fit into current screen. for example my screen is 1920x1080 but 1600x1200 is returned in list. or even if I set my screen resolution to something lower, 1600x1200 and 1920x1080 are still in list. I guess, there is nothing wrong with this, since my video card supports that modes.

after setting video mode, I end up with a FrameBuffer that just doesn't fit into screen.

Display.getWidth()/getHeight() returns the invalid value just after calling Display.setDisplayMode(..) but later on returns the corrected values.

so, how to handle this?
* filter modes that does not fit (based on what? awt toolkit?)
* in render loop, check Display.width/height matches FrameBuffer.width/height and correct if required

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: VideoModes that don't fit into screen
« Reply #1 on: March 10, 2013, 09:45:03 pm »
This is on Linux, i assume? IIRC, the modes reported by LWJGL somehow relate to the configuration of X. Do you have these modes in your X configuration?

Offline raft

  • quad
  • ******
  • Posts: 1974
    • View Profile
    • http://www.aptalkarga.com
Re: VideoModes that don't fit into screen
« Reply #2 on: March 10, 2013, 09:46:41 pm »
windows 7

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: VideoModes that don't fit into screen
« Reply #3 on: March 10, 2013, 09:49:39 pm »
Well, that's strange. My Windows 7 doesn't do this. The modes are taken directly from what LWJGL returns which is what the driver returns. Which gpu are you using?

Offline raft

  • quad
  • ******
  • Posts: 1974
    • View Profile
    • http://www.aptalkarga.com
Re: VideoModes that don't fit into screen
« Reply #4 on: March 10, 2013, 09:55:25 pm »
ATI Mobility FireGL V5700.

I dont get it, since gpu supports these modes, doesnt it make sense these modes should be in list? some dont fit screen in windowed mode but all are valid for fullscreen mode.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: VideoModes that don't fit into screen
« Reply #5 on: March 10, 2013, 10:00:12 pm »
Yes, it makes sense that they are in the list IF the monitor can handle them in full screen. There shouldn't be any modes available that your monitor can't handle. But your desktop's actual resolution doesn't matter.

Offline raft

  • quad
  • ******
  • Posts: 1974
    • View Profile
    • http://www.aptalkarga.com
Re: VideoModes that don't fit into screen
« Reply #6 on: March 10, 2013, 10:11:18 pm »
i cant follow, my monitor can handle all of these modes so it makes sense these modes will be in the list. so, what does not your windows 7 do then?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: VideoModes that don't fit into screen
« Reply #7 on: March 10, 2013, 10:20:57 pm »
Nothing... ;) It's does the same thing as yours. I somehow thought that you monitor doesn't support that resolution but the driver still reports it. With current LCDs, i'm thinking of monitors as single-resolution devices, so that you'll always use the highest, native resolution anyway.

Offline raft

  • quad
  • ******
  • Posts: 1974
    • View Profile
    • http://www.aptalkarga.com
Re: VideoModes that don't fit into screen
« Reply #8 on: March 10, 2013, 10:31:02 pm »
np :) returning to original question, what would you suggest to handle this?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: VideoModes that don't fit into screen
« Reply #9 on: March 10, 2013, 10:38:32 pm »
Honestly? I wouldn't handle that at all. Today, almost everybody uses a LCD device running in one, the native resolution. The driver shouldn't report any modes larger than this, so it will be fine. Apart from that, nobody runs a game in windowed mode... ;)

Just make sure that the resolution can still be adjusted if one has picked the wrong mode (not that the buttons are out of view...).

Offline raft

  • quad
  • ******
  • Posts: 1974
    • View Profile
    • http://www.aptalkarga.com
Re: VideoModes that don't fit into screen
« Reply #10 on: March 10, 2013, 10:47:16 pm »
got it :)

i guess i'll stick to comparing FrameBuffer.width/height to Display.width/height every frame, that seems to be the easiest way to make sure everything is visible.