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,WaylandorNull. 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 fromwindowLibrary- version string of the native windowing libraryapi- client API and version the context reports, such asOpenGL 3.3 core; read back from the context, not from what was requestedcontextApi- how the context was created:native,EGLorOSMesa. EGL on a desktop platform means the context came from a translation layer rather than the platform's own drivervendor- driver's vendor string, verbatimrenderer- driver's device string, verbatim. It names the emulation rather than a GPU when there is one:llvmpipefor software, a Direct3D or Vulkan device name for a translation layerversion- driver's version string, verbatimshadingLanguage- highest shading-language version the context acceptsmaxSamples- largest multisample count the context accepts; multisample requests are clamped to ittimerQueries- whether GPU-side durations can be measured. Without it a performance monitor has no GPU figure to show; nothing else changesfloatColorBuffer- 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 falsenorm16Textures- whether 16-bit normalized single-channel textures exist. A 10-bit video plane is uploaded as oneextensions- every extension the context advertises, sorted; empty when there is no contextfailure- why no context exists, ornullwhen 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 Summary
FieldsModifier and TypeFieldDescriptionstatic final GraphicsInfoWhat a backend that cannot describe its graphics stack reports. -
Constructor Summary
ConstructorsConstructorDescriptionGraphicsInfo(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 aGraphicsInforecord class. -
Method Summary
Modifier and TypeMethodDescriptionapi()Returns the value of theapirecord component.booleanReturns the value of thecontextApirecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theextensionsrecord component.failure()Returns the value of thefailurerecord component.booleanReturns the value of thefloatColorBufferrecord component.final inthashCode()Returns a hash code value for this object.intReturns the value of themaxSamplesrecord component.booleanReturns the value of thenorm16Texturesrecord component.renderer()Returns the value of therendererrecord component.Returns the value of theshadingLanguagerecord component.booleanReturns the value of thetimerQueriesrecord component.final StringtoString()Returns a string representation of this record class.static GraphicsInfounavailable(String windowPlatform, String windowLibrary, String failure) A report for a machine that gave no context, carrying what is knowable without one.vendor()Returns the value of thevendorrecord component.version()Returns the value of theversionrecord component.Returns the value of thewindowLibraryrecord component.Returns the value of thewindowPlatformrecord component.
-
Field Details
-
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 aGraphicsInforecord class.- Parameters:
windowPlatform- the value for thewindowPlatformrecord componentwindowLibrary- the value for thewindowLibraryrecord componentapi- the value for theapirecord componentcontextApi- the value for thecontextApirecord componentvendor- the value for thevendorrecord componentrenderer- the value for therendererrecord componentversion- the value for theversionrecord componentshadingLanguage- the value for theshadingLanguagerecord componentmaxSamples- the value for themaxSamplesrecord componenttimerQueries- the value for thetimerQueriesrecord componentfloatColorBuffer- the value for thefloatColorBufferrecord componentnorm16Textures- the value for thenorm16Texturesrecord componentextensions- the value for theextensionsrecord componentfailure- the value for thefailurerecord component
-
-
Method Details
-
available
public boolean available()- Returns:
- whether a graphics context was obtained at all
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
windowPlatform
Returns the value of thewindowPlatformrecord component.- Returns:
- the value of the
windowPlatformrecord component
-
windowLibrary
Returns the value of thewindowLibraryrecord component.- Returns:
- the value of the
windowLibraryrecord component
-
api
Returns the value of theapirecord component.- Returns:
- the value of the
apirecord component
-
contextApi
Returns the value of thecontextApirecord component.- Returns:
- the value of the
contextApirecord component
-
vendor
Returns the value of thevendorrecord component.- Returns:
- the value of the
vendorrecord component
-
renderer
Returns the value of therendererrecord component.- Returns:
- the value of the
rendererrecord component
-
version
Returns the value of theversionrecord component.- Returns:
- the value of the
versionrecord component
-
shadingLanguage
Returns the value of theshadingLanguagerecord component.- Returns:
- the value of the
shadingLanguagerecord component
-
maxSamples
public int maxSamples()Returns the value of themaxSamplesrecord component.- Returns:
- the value of the
maxSamplesrecord component
-
timerQueries
public boolean timerQueries()Returns the value of thetimerQueriesrecord component.- Returns:
- the value of the
timerQueriesrecord component
-
floatColorBuffer
public boolean floatColorBuffer()Returns the value of thefloatColorBufferrecord component.- Returns:
- the value of the
floatColorBufferrecord component
-
norm16Textures
public boolean norm16Textures()Returns the value of thenorm16Texturesrecord component.- Returns:
- the value of the
norm16Texturesrecord component
-
extensions
Returns the value of theextensionsrecord component.- Returns:
- the value of the
extensionsrecord component
-
failure
Returns the value of thefailurerecord component.- Returns:
- the value of the
failurerecord component