Class Graphics

java.lang.Object
rosequartz.gfx.Graphics

public final class Graphics extends Object
Class for general method calls and errors in the 'rosequartz.graphics'-package.
  • Method Details

    • _setMainThread

      public static void _setMainThread() throws CallerNotEngineRuntimeException
      Sets the calling thread to be the graphics thread.
      Throws:
      CallerNotEngineRuntimeException
    • _requireGraphicsPipeline

      public static Object _requireGraphicsPipeline() throws CallerNotEngineRuntimeException
      Tells this class that the main class finished execution and usage of a GraphicsPipeline is now needed. May only be called once by the engine runtime.
      Returns:
      object used to identify engine runtime
      Throws:
      CallerNotEngineRuntimeException
    • _setInGraphicsPipeline

      public static void _setInGraphicsPipeline(Object identification, boolean inGraphicsPipeline) throws CallerNotEngineRuntimeException
      Tells this class if the executed code is in a graphics pipeline.
      Parameters:
      identification - object used to identify engine runtime
      inGraphicsPipeline - in graphics pipeline
      Throws:
      CallerNotEngineRuntimeException
    • requireMainThread

      public static void requireMainThread() throws NotOnGraphicsThreadException
      Requires the current thread to be the main thread.
      Throws:
      NotOnGraphicsThreadException - if not on graphics thread
    • _initializeStatics

      public static void _initializeStatics() throws CallerNotEngineRuntimeException
      Initializes static variables used in the graphics classes.
      Throws:
      CallerNotEngineRuntimeException
    • windowWidth

      public static float windowWidth()
      Gets the width of the game window.
      Returns:
      window width
    • windowHeight

      public static float windowHeight()
      Gets the height of the game window.
      Returns:
      window height
    • windowSize

      public static Vec2 windowSize()
      Gets the size of the game window/
      Returns:
      window size
    • windowInFocus

      public static boolean windowInFocus()
      Gets if the window is currently in focus.
      Returns:
      window in focus
    • screenWidth

      public static float screenWidth()
      Gets the width of the device display.
      Returns:
      device display width
    • screenHeight

      public static float screenHeight()
      Gets the height of the device display.
      Returns:
      device display height
    • screenSize

      public static Vec2 screenSize()
      Gets the size of the device display.
      Returns:
      device display size
    • stateToString

      public static String stateToString()
      Returns a summary of the current state of the OpenGL-Pipeline. Should something render incorrectly (or not at all), it's useful to look at the output for debugging. Simple and easy mistakes like forgetting to upload or render a VertexArray, forgetting to disable / enable depth testing and so on are easily noticeable here.
      Returns:
      current state of the OpenGL-Pipeline