[LWJGL] strange things with Display.create

If I try to change display mode after the display has been created, it seems that everything is rendered in some kind of strange space. Here are some ss of what I mean.

Here is how everything looks when you set display mode before initializing display.

Here are 2 images with different displaymode width,height which were set after display has been created.

960x720

640x480

maybe i’m supposed to call some method from display after changing display mode?
any ideas would be helpful…

You are not taking into consideration that you are reducing the total pixels on the screen, resulting in less room?

If you look, the origin seems to be bottom left, presuming you have those buttons in some sort of table for positioning, it always sits in the exact same place regardless of resolution.

Roughly same amount of pixels from the right and bottom.

I’m not reducing anything.


			Display.setDisplayMode(new DisplayMode(960, 720));
			Display.create();

#image1


			Display.create();
			Display.setDisplayMode(new DisplayMode(960, 720));

#image2

Recalculate your GL_PROJECTION matrix and specify the new bounds in glViewport

Ahhhhhhhhhhhhh I didn’t know about the viewport part :slight_smile: tyvm