VideoModes that don't fit into screen

Started by raft, March 10, 2013, 08:35:38 PM

Previous topic - Next topic

raft

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

EgonOlsen

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?

raft


EgonOlsen

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?

raft

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.

EgonOlsen

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.

raft

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?

EgonOlsen

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.

raft

np :) returning to original question, what would you suggest to handle this?

EgonOlsen

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...).

raft

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.