Hello Guest

Lwjgl controlling the Display

  • 2 Replies
  • 2735 Views
Lwjgl controlling the Display
« on: June 30, 2014, 11:30:04 »
Hi everyone.

Is there a way we can;

1. Bring the Display window to the front programically? I'd like to do this because I have a button that lets users log in with their Google account using OAuth, which opens a tab in the browser - once a user logs in Google's login page then redirects to a local port - my game is listening on that port. I want the game to then bring itself back into focus.

2. Reposition the Display window programically? I'd like to do this as I have added a 'fullscreen' toggle. When a user resizes and repositions the Display window manually, and then clicks 'fullscreen' and then clicks back to 'windowed' I want to be able to set the Display back to the same position and size it was before it went to fullscreen.

Thanks for your help.

*

Offline Cornix

  • *****
  • 488
Re: Lwjgl controlling the Display
« Reply #1 on: June 30, 2014, 12:47:40 »
Read the Display API, there are methods to set the position. But I cant remember if there were any methods for changing the window focus.

*

Offline basil

  • **
  • 81
Re: Lwjgl controlling the Display
« Reply #2 on: June 30, 2014, 15:55:35 »
if you use swing, you can use the swing api. position, minimize, maximize, scale and focus (bring-to-front, bring-to-back). without swing you have position, size and fullscreen-yes-no, no focus i think.