LWJGL Forum

Please login or register.

Login with username, password and session length

Author Topic: LWJGL Display resize limit  (Read 3316 times)

Maykin53

  • Newbie
  • *
  • Offline Offline
  • Posts: 15
LWJGL Display resize limit
« on: October 22, 2013, 13:42:51 »

Hi, would it be much trouble to add the ability to restrict the resizing of the LWJGL Display window to a minimum dimension? (For example, restrict a user so they cannot resize the window less than 1024x768)
A "setMaximised" method would also be very useful (so that a game starting in windowed mode could start maximised, and not 'floating' with the lower part under the task bar).
Logged

quew8

  • Nerdus Imperius
  • *****
  • Offline Offline
  • Posts: 562
  • Because Square Eyes Look More Real
Re: LWJGL Display resize limit
« Reply #1 on: October 22, 2013, 16:38:57 »

The first rfe you could quite easily implement yourself I think:

Code: [Select]
if(Display.wasResized() && ( Display.getWidth() < minWidth || Display.getHeight() < inHeight ) ) {
    Display.setDisplayMode(aDisplayModeOfMinSize);
}

Not sure what you mean by the second. I think you can centre the Display by calling:

Code: [Select]
Display.setLocation(-1, -1);
Logged