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.
Description
Section titled “Description”It renders into a pixel buffer, or into a Display on Linux, and ships in the dev and demo jars of the backend.
Learn more
Section titled “Learn more”Creation
Section titled “Creation”| Returns | Signature | Summary |
|---|---|---|
| Lwjgl2SnapshotBackend() | Creates the snapshot backend; the window and the surface are created when a run starts. |
Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
void | create(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. |
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. |
Creation details
Section titled “Creation details”Lwjgl2SnapshotBackend
Section titled “Lwjgl2SnapshotBackend”Lwjgl2SnapshotBackend()
Creates the snapshot backend; the window and the surface are created when a run starts.
Method details
Section titled “Method details”create
Section titled “create”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.
destroy
Section titled “destroy”void destroy()
Destroys the context and gives the registries back the bridges they had before create.
present
Section titled “present”void present()
Does nothing: the capture reads the back buffer.
capture
Section titled “capture”SnapshotImage capture(int width, int height)
Returns the pixels of the back buffer.
getRenderer
Section titled “getRenderer”String getRenderer()
Returns the renderer string of the driver.
getBuffer
Section titled “getBuffer”Pbuffer getBuffer()
Returns the pixel buffer of the context, or null when it renders into the Display.
getBridge
Section titled “getBridge”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
