I’m messing with LWJGL 0.96 and trying to change the display modes in my game. I’m starting with a 800x600 window and trying to change to a 1024x768 window, and having horrible and complicated results. Rather than go through the long and arduous process of trying to convey all that I’ve tried and what all mess I’ve gotten out of it, would someone just be kind enough to explain to me the proper way to do it?
Thanks!
When switching to a winow you use the DisplayMode constructor:
DisplayMode newDisplayMode = new DisplayMode(w, h);
Display.setDisplayMode(newDisplayMode);
heh, I wish it worked that easily. Using the api you’ve given me, tom, I tried that and it resizes my window to a 1024x768 frame, but inside it I’m stuck at the bottom left 800x600 pixels, and the top and right sides are just garbage.
Untested Guess: Maybe try calling reshape(). I noticed there is one in interface DisplayImplementation.
I tried
Display.getImplementation().reshape(0, 0, newMode.getWidth(), newMode.getHeight());
But it didn’t make a difference
Of course, you have to update the viewport after changing resolution like this:
GL11.glViewport(0, 0, w, h);
Changing the viewport can also be useful when you only wan’t to render inside a rectangle of a screen. Like inside your home made Frame or Button.
That was perfect, thank you! Now I have the coords converted properly… except now it seems when I do that the window is a little short… like by about half the height of the title bar. Fullscreen mode works fine, but trying to make a 1024x768 window on a 1024x768 desktop gives me a window that’s about 10 pixels short. Perhaps I shouldn’t even be trying this 
Also - we’re making a couple of little tweaks to the handling of displays which should make it all a little smoother and intuitive.
Cas 
When will that be? I’m having more issues. A friend played Conquer on a 1024x768 Windows machine, and he changed from 800x600 windowed mode to 1024x768 windowed mode and got the following:
http://www.gamelizard.com/images/temp/bad_res_change.PNG
Any ideas what’s going on here? I can’t imagine my method for display mode switching is fundamentally flawed because no one else has had problems switching windowed modes around so far.
He says: “i am using a intel extreme chipset”, “shared memory…non agp”.
when you change to that 1024x768, do you also change bpp ? - 16->24/32 ?
Looks fine to me, just looks like someone forgot to call glViewPort after changing the window size…
Cas 
@Mazon: I checked that, it’s not changing.
@Cas: I checked that too, but it’s being called and it works for everyone else… except this guy 