Class OffscreenRenderer
java.lang.Object
de.luckymcdev.foundryengine.client.imgui.OffscreenRenderer
Owns a reusable offscreen framebuffer and provides a general API for rendering
arbitrary content into a
NativeImage that can then be turned into a texture.
GPU readbacks are async; results are queued and must be drained on the render thread
by calling
at the start of each frame.invalid reference
#drainPendingResults()
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic interface -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidDrains all GPU readback results that have arrived since the last call.voidrenderAsync(int size, String key, OffscreenRenderer.RenderJob job) Renders content into the offscreen framebuffer and schedules a GPU readback.
-
Constructor Details
-
OffscreenRenderer
public OffscreenRenderer()
-
-
Method Details
-
renderAsync
Renders content into the offscreen framebuffer and schedules a GPU readback. The resultingNativeImagewill appear inon the next frame where the GPU has finished.invalid reference
#drainPendingResults()- Parameters:
size- the pixel dimensions of the render target (square)key- an opaque key forwarded to the pending result for identificationjob- the render job; receives the active color/depth views and proj buffer
-
drainPendingResults
Drains all GPU readback results that have arrived since the last call. Must be called on the render thread at the start of each frame, before any texture uploads or ImGui rendering.- Parameters:
consumer- receives each completedOffscreenRenderer.PendingResult
-
close
public void close()
-