Hello Guest

Best way to toggle to/from fullscreen, multiple windows and sharing contexts?

  • 1 Replies
  • 3462 Views
Since we're on 3.1.2 and supposedly the earliest version we will have support for fullscreen toggling with an existing window in GLFW is 3.2 (if at all), I assume no such feature is in the current stable branch for LWJGL. If there is, point me to it and this is an easily solved thread.

The only way I'm able to think of allowing the users to change to fullscreen is to - upon getting the 'go fullscreen' command from the user - to kill the current window, create a new window and set it to fullscreen, and then just recreate everything (VBO/VAO/recompile shaders/reload textures/etc). This is sort of annoying, but do I have a choice? My code is abstracted and modularized enough that this is possible to do, but it's still annoying and slow... but if I have no choice then I have to do this.

I was thinking of context switching but it looks like from reading http://www.glfw.org/docs/latest/context.html and on here/stack-overflow/etc that you still have to set things anyways.

I'm not looking for code to do this, I just want a high level approach on if the above is correct. Even after reading the link above and browsing a lot online I'm not 100% confident with the GLContext and that I'm doing this the right way. Any insight?

*

Offline spasi

  • *****
  • 2261
    • WebHotelier
The LWJGL version is not related to the GLFW version:

- LWJGL 3.1.2 includes a pre-release version of GLFW 3.3.
- LWJGL 3.0.0 included GLFW 3.2, which was released on Jun 02 2016.

The function you're looking for is glfwSetWindowMonitor.