Skip to content

GlBorrowedTextureBackend

final class GlBorrowedTextureBackend
Implements: IBorrowedTextureBackend
Package: dev.joid.base.opengl.snapshot · Module: base-opengl · Source: GlBorrowedTextureBackend.java
Backends: LWJGL 2 LWJGL 3

The borrowed texture backend of any OpenGL context, over a snapshot backend and a binding.

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
GlBorrowedTextureBackend(ISnapshotBackend backend, Supplier bindings)Creates the backend over that snapshot backend; the supplier gives the binding once the snapshot backend has created its context.

ReturnsSignatureSummary
voidcreate(int width, int height)Creates the surface of the snapshot backend, then takes the binding.
voiddestroy()Deletes the textures it created, then destroys the surface.
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.
ITextureborrow(Supplier texture)Returns a GlBorrowedTexture over the texture names that the supplier gives.
booleanisBorrowableTexture(Object texture)If true, the object is an Integer that names a texture of the context.
ObjectcreateBorrowableTexture(int width, int height, int color, boolean mipmapped)Creates an RGBA8 texture of that size in that color, with nearest filtering and repeat wrapping, and every mip level when the boolean is true; the texture bound before stays bound.
Map<String,String>readBorrowableParameters(Object texture)Returns the filters and the wraps of the texture as MIN_FILTER, MAG_FILTER, WRAP_S and WRAP_T; the texture bound before stays bound.

GlBorrowedTextureBackend(ISnapshotBackend backend, Supplier<IGlBinding> bindings)

Creates the backend over that snapshot backend; the supplier gives the binding once the snapshot backend has created its context.

void create(int width, int height)

Creates the surface of the snapshot backend, then takes the binding.

void destroy()

Deletes the textures it created, then destroys the surface.

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.

ITexture borrow(Supplier<Object> texture)

Returns a GlBorrowedTexture over the texture names that the supplier gives.

boolean isBorrowableTexture(Object texture)

If true, the object is an Integer that names a texture of the context.

Object createBorrowableTexture(int width, int height, int color, boolean mipmapped)

Creates an RGBA8 texture of that size in that color, with nearest filtering and repeat wrapping, and every mip level when the boolean is true; the texture bound before stays bound.

Map<String,String> readBorrowableParameters(Object texture)

Returns the filters and the wraps of the texture as MIN_FILTER, MAG_FILTER, WRAP_S and WRAP_T; the texture bound before stays bound.


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