Skip to content

GlStateGuardBackend

abstract class GlStateGuardBackend
Implements: IStateGuardBackend
Known subtypes: Lwjgl2StateGuardBackend, Lwjgl3StateGuardBackend
Package: dev.joid.base.opengl.snapshot · Module: base-opengl · Source: GlStateGuardBackend.java
Backends: LWJGL 2 LWJGL 3

The base of the state guard backends of OpenGL: the surface of a snapshot backend, the traps each context supports and the state read through a binding.

A subclass sets the traps and draws like a host with the OpenGL functions of its library; Lwjgl2StateGuardBackend and Lwjgl3StateGuardBackend are the two official ones. It ships in the snapshot jar of base-opengl and in the dev and demo jars of the backends; the published joid-base-opengl jar does not hold it.

ReturnsSignatureSummary
GlStateGuardBackend(ISnapshotBackend backend, Supplier bindings) protectedCreates the backend over that snapshot backend; the supplier gives the binding through which it reads the state, once the snapshot backend has created its context.

ReturnsSignatureSummary
voidcreate(int width, int height)Creates the surface of the snapshot backend.
voiddestroy()Destroys the surface of the snapshot backend.
voidpresent()Presents the surface of the snapshot backend.
SnapshotImagecapture(int width, int height)Captures the surface of the snapshot backend.
StringgetRenderer()Returns the renderer of the snapshot backend.
voidinject(StateTrap trap)Sets that trap through injectTrap; EVERYTHING sets every trap that the context supports.
booleansupports(StateTrap trap)If true, the context can set the trap: the fixed-function traps need a compatibility context, the others the capability they use, read from the GlRenderBridge registered.
Map<String,String>readState()Returns the state of the context, read by GlStateSnapshot with the materials of readMaterial.
booleanisCompatibility() protectedIf true, the context has a compatibility profile.
GlCapabilitiesgetCapabilities() protectedReturns the capabilities of the GlRenderBridge registered.
ReturnsSignatureSummary
voidinjectTrap(StateTrap trap) hook abstract protectedSets that trap, never EVERYTHING, in the state of the context.
voidreadMaterial(int face, int name, float[] values) hook abstract protectedWrites the four values of that material parameter of that face into the array.

GlStateGuardBackend(ISnapshotBackend backend, Supplier<IGlBinding> bindings) protected

Creates the backend over that snapshot backend; the supplier gives the binding through which it reads the state, once the snapshot backend has created its context.

void create(int width, int height)

Creates the surface of the snapshot backend.

void destroy()

Destroys the surface of the snapshot backend.

void present()

Presents the surface of the snapshot backend.

SnapshotImage capture(int width, int height)

Captures the surface of the snapshot backend.

String getRenderer()

Returns the renderer of the snapshot backend.

void inject(StateTrap trap)

Sets that trap through injectTrap; EVERYTHING sets every trap that the context supports.

boolean supports(StateTrap trap)

If true, the context can set the trap: the fixed-function traps need a compatibility context, the others the capability they use, read from the GlRenderBridge registered.

Map<String,String> readState()

Returns the state of the context, read by GlStateSnapshot with the materials of readMaterial.

boolean isCompatibility() protected

If true, the context has a compatibility profile.

GlCapabilities getCapabilities() protected

Returns the capabilities of the GlRenderBridge registered.

void injectTrap(StateTrap trap) hook abstract protected

Sets that trap, never EVERYTHING, in the state of the context.

void readMaterial(int face, int name, float[] values) hook abstract protected

Writes the four values of that material parameter of that face into the array.


fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses

Report a problem with this page