Package org.xjge.core

Class Monitor

java.lang.Object
org.xjge.core.Monitor

public final class Monitor
extends java.lang.Object
Represents a visual display device such as a computer monitor or television.
Since:
2.0.0
  • Field Summary

    Fields
    Modifier and Type Field Description
    long handle  
    java.lang.String name  
  • Method Summary

    Modifier and Type Method Description
    java.lang.String getAspectRatio()
    Obtains the aspect ratio of the monitors current video mode.
    int getHeight()
    Obtains the height of the monitors current video mode.
    java.lang.String getInfo()
    Generates a string that provides information about the monitors current video mode.
    int getRefreshRate()
    Obtains the refresh rate of the monitors current video mode.
    java.util.Map<java.lang.String,​org.lwjgl.glfw.GLFWVidMode> getVideoModes()
    Provides an immutable collection of all the video modes available to this monitor that are supported by the engine.
    int getWidth()
    Obtains the width of the monitors current video mode.
    void setVideoMode​(java.lang.String operation)
    Sets the video mode the monitor will use.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • handle

      public final long handle
    • name

      public final java.lang.String name
  • Method Details

    • getAspectRatio

      public java.lang.String getAspectRatio()
      Obtains the aspect ratio of the monitors current video mode.
      Returns:
      an aspect ratio represented as a string
    • getInfo

      public java.lang.String getInfo()
      Generates a string that provides information about the monitors current video mode.
      Returns:
      a human-readable string detailing the video modes resolution, aspect ratio, and refresh rate
    • getWidth

      public int getWidth()
      Obtains the width of the monitors current video mode.
      Returns:
      the width of the video mode in pixels
    • getHeight

      public int getHeight()
      Obtains the height of the monitors current video mode.
      Returns:
      the height of the video mode in pixels
    • getRefreshRate

      public int getRefreshRate()
      Obtains the refresh rate of the monitors current video mode.
      Returns:
      the refresh rate of the video mode in hertz
    • getVideoModes

      public java.util.Map<java.lang.String,​org.lwjgl.glfw.GLFWVidMode> getVideoModes()
      Provides an immutable collection of all the video modes available to this monitor that are supported by the engine.
      Returns:
      a collection of GLFW video mode objects
    • setVideoMode

      public void setVideoMode​(java.lang.String operation)
      Sets the video mode the monitor will use.
      Parameters:
      operation - the method of traversal to use. Either explicitly as the ID number of the monitor or "prev/next" to move between the previous and next video modes available to the monitor respectively.