private static void switchDisplayMode() throws LWJGLException {
   if (!current_mode.isFullscreenCapable()) {
     throw new IllegalStateException(
         "Only modes acquired from getAvailableDisplayModes() can be used for fullscreen display");
   }
   display_impl.switchDisplayMode(current_mode);
 }
 /** @return whether the Display is in fullscreen mode */
 public static boolean isFullscreen() {
   synchronized (GlobalLock.lock) {
     return fullscreen && current_mode.isFullscreenCapable();
   }
 }
 /**
  * Set the mode of the context. If no context has been created through create(), the mode will
  * apply when create() is called. If mode.isFullscreenCapable() is true, the context will become a
  * fullscreen context and the display mode is switched to the mode given by getDisplayMode(). If
  * mode.isFullscreenCapable() is false, the context will become a windowed context with the
  * dimensions given in the mode returned by getDisplayMode(). The native cursor position is also
  * reset.
  *
  * @param mode The new display mode to set. Must be non-null.
  * @throws LWJGLException If the mode switch fails.
  */
 public static void setDisplayModeAndFullscreen(DisplayMode mode) throws LWJGLException {
   setDisplayModeAndFullscreenInternal(mode.isFullscreenCapable(), mode);
 }