Class Monitor

java.lang.Object
icyllis.modernui.core.Monitor

@MainThread public final class Monitor extends Object
Represents a currently connected Monitor (sometimes known as Display). All methods must be called on the main thread and after GLFW initialization. This class can only be used when the application runs independently.
  • Method Details

    • get

      @Nullable public static Monitor get(long handle)
    • getPrimary

      @Nullable public static Monitor getPrimary()
    • getAll

      public static @UnmodifiableView Collection<Monitor> getAll()
    • addMonitorEventListener

      public static void addMonitorEventListener(@NonNull Monitor.MonitorEventListener listener)
    • removeMonitorEventListener

      public static void removeMonitorEventListener(@NonNull Monitor.MonitorEventListener listener)
    • getHandle

      public long getHandle()
    • getXPos

      public int getXPos()
      Get the x position of this monitor in virtual screen coordinates.
      Returns:
      the x position
    • getYPos

      public int getYPos()
      Get the y position of this monitor in virtual screen coordinates.
      Returns:
      the y position
    • getCurrentMode

      @NonNull public VideoMode getCurrentMode()
    • getName

      @NonNull public String getName()
    • getModeCount

      public int getModeCount()
      Return the number of supported video modes for this Monitor.
      Returns:
      the number of supported video modes
    • getModeAt

      @NonNull public VideoMode getModeAt(int index)
    • findBestMode

      @NonNull public VideoMode findBestMode(int width, int height)