Skip to content

Lwjgl2SnapshotBackend

final class Lwjgl2SnapshotBackend
Implements: ISnapshotBackend
Package: dev.joid.backend.lwjgl2.snapshot · Module: backend-lwjgl2 · Source: Lwjgl2SnapshotBackend.java
Backends: LWJGL 2

The snapshot backend of LWJGL 2, which renders in an offscreen OpenGL context.

It renders into a pixel buffer, or into a Display on Linux, and ships in the dev and demo jars of the backend.

ReturnsSignatureSummary
Lwjgl2SnapshotBackend()Creates the snapshot backend; the window and the surface are created when a run starts.

ReturnsSignatureSummary
voidcreate(int width, int height)Installs the natives, creates the OpenGL context of that size in pixels, with 24-bit depth and 8-bit stencil, and registers the backend without audio.
voiddestroy()Destroys the context and gives the registries back the bridges they had before create.
voidpresent()Does nothing: the capture reads the back buffer.
SnapshotImagecapture(int width, int height)Returns the pixels of the back buffer.
StringgetRenderer()Returns the renderer string of the driver.
PbuffergetBuffer()Returns the pixel buffer of the context, or null when it renders into the Display.
GlRenderBridgegetBridge()Returns the OpenGL render bridge.

Lwjgl2SnapshotBackend()

Creates the snapshot backend; the window and the surface are created when a run starts.

void create(int width, int height)

Throws:

  • IllegalStateException: LWJGL 2 cannot create the …x… OpenGL context of the snapshots (…), check that the graphics driver supports OpenGL

Installs the natives, creates the OpenGL context of that size in pixels, with 24-bit depth and 8-bit stencil, and registers the backend without audio. Throws an IllegalStateException when LWJGL 2 cannot create the context.

void destroy()

Destroys the context and gives the registries back the bridges they had before create.

void present()

Does nothing: the capture reads the back buffer.

SnapshotImage capture(int width, int height)

Returns the pixels of the back buffer.

String getRenderer()

Returns the renderer string of the driver.

Pbuffer getBuffer()

Returns the pixel buffer of the context, or null when it renders into the Display.

GlRenderBridge getBridge()

Returns the OpenGL render bridge.


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