Package limn.backend

Record Class GraphicsInfo

java.lang.Object
java.lang.Record
limn.backend.GraphicsInfo
Record Components:
windowPlatform - the windowing system in use: Cocoa, Win32, X11, Wayland or Null. Chosen when the process starts and not when it was built, so one binary reports different values on one machine depending on the session it was launched from
windowLibrary - version string of the native windowing library
api - client API and version the context reports, such as OpenGL 3.3 core; read back from the context, not from what was requested
contextApi - how the context was created: native, EGL or OSMesa. EGL on a desktop platform means the context came from a translation layer rather than the platform's own driver
vendor - driver's vendor string, verbatim
renderer - driver's device string, verbatim. It names the emulation rather than a GPU when there is one: llvmpipe for software, a Direct3D or Vulkan device name for a translation layer
version - driver's version string, verbatim
shadingLanguage - highest shading-language version the context accepts
maxSamples - largest multisample count the context accepts; multisample requests are clamped to it
timerQueries - whether GPU-side durations can be measured. Without it a performance monitor has no GPU figure to show; nothing else changes
floatColorBuffer - whether a 16-bit float colour buffer can be rendered to. The 3D subsystem renders to one and has no 8-bit fallback, so it does not run where this is false
norm16Textures - whether 16-bit normalized single-channel textures exist. A 10-bit video plane is uploaded as one
extensions - every extension the context advertises, sorted; empty when there is no context
failure - why no context exists, or null when one does

public record GraphicsInfo(String windowPlatform, String windowLibrary, String api, String contextApi, String vendor, String renderer, String version, String shadingLanguage, int maxSamples, boolean timerQueries, boolean floatColorBuffer, boolean norm16Textures, List<String> extensions, String failure) extends Record
Which graphics context a backend actually obtained, and which of the optional capabilities the toolkit uses are present on it. Read it with Backend.graphicsInfo().

This exists because "it will not start on that machine" and "it is slow on that machine" cannot be answered from a stack trace. An OpenGL above 1.1 is not part of Windows (it arrives with the GPU vendor's driver), so the same application meets vendor drivers, translation layers over Direct3D, and pure software rasterizers, and nothing but the strings below tells them apart.

When failure() is non-null no context was obtained: only windowPlatform() and windowLibrary() carry an answer, and every other field is empty, zero or false.

  • Field Details

    • NONE

      public static final GraphicsInfo NONE
      What a backend that cannot describe its graphics stack reports.
  • Constructor Details

    • GraphicsInfo

      public GraphicsInfo(String windowPlatform, String windowLibrary, String api, String contextApi, String vendor, String renderer, String version, String shadingLanguage, int maxSamples, boolean timerQueries, boolean floatColorBuffer, boolean norm16Textures, List<String> extensions, String failure)
      Creates an instance of a GraphicsInfo record class.
      Parameters:
      windowPlatform - the value for the windowPlatform record component
      windowLibrary - the value for the windowLibrary record component
      api - the value for the api record component
      contextApi - the value for the contextApi record component
      vendor - the value for the vendor record component
      renderer - the value for the renderer record component
      version - the value for the version record component
      shadingLanguage - the value for the shadingLanguage record component
      maxSamples - the value for the maxSamples record component
      timerQueries - the value for the timerQueries record component
      floatColorBuffer - the value for the floatColorBuffer record component
      norm16Textures - the value for the norm16Textures record component
      extensions - the value for the extensions record component
      failure - the value for the failure record component
  • Method Details

    • unavailable

      public static GraphicsInfo unavailable(String windowPlatform, String windowLibrary, String failure)
      A report for a machine that gave no context, carrying what is knowable without one.
    • available

      public boolean available()
      Returns:
      whether a graphics context was obtained at all
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • windowPlatform

      public String windowPlatform()
      Returns the value of the windowPlatform record component.
      Returns:
      the value of the windowPlatform record component
    • windowLibrary

      public String windowLibrary()
      Returns the value of the windowLibrary record component.
      Returns:
      the value of the windowLibrary record component
    • api

      public String api()
      Returns the value of the api record component.
      Returns:
      the value of the api record component
    • contextApi

      public String contextApi()
      Returns the value of the contextApi record component.
      Returns:
      the value of the contextApi record component
    • vendor

      public String vendor()
      Returns the value of the vendor record component.
      Returns:
      the value of the vendor record component
    • renderer

      public String renderer()
      Returns the value of the renderer record component.
      Returns:
      the value of the renderer record component
    • version

      public String version()
      Returns the value of the version record component.
      Returns:
      the value of the version record component
    • shadingLanguage

      public String shadingLanguage()
      Returns the value of the shadingLanguage record component.
      Returns:
      the value of the shadingLanguage record component
    • maxSamples

      public int maxSamples()
      Returns the value of the maxSamples record component.
      Returns:
      the value of the maxSamples record component
    • timerQueries

      public boolean timerQueries()
      Returns the value of the timerQueries record component.
      Returns:
      the value of the timerQueries record component
    • floatColorBuffer

      public boolean floatColorBuffer()
      Returns the value of the floatColorBuffer record component.
      Returns:
      the value of the floatColorBuffer record component
    • norm16Textures

      public boolean norm16Textures()
      Returns the value of the norm16Textures record component.
      Returns:
      the value of the norm16Textures record component
    • extensions

      public List<String> extensions()
      Returns the value of the extensions record component.
      Returns:
      the value of the extensions record component
    • failure

      public String failure()
      Returns the value of the failure record component.
      Returns:
      the value of the failure record component