Klasse OffscreenRenderer

java.lang.Object
de.luckymcdev.foundryengine.client.imgui.OffscreenRenderer

public class OffscreenRenderer extends Object
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

Ungültige Referenz
#drainPendingResults()
at the start of each frame.
  • Konstruktordetails

    • OffscreenRenderer

      public OffscreenRenderer()
  • Methodendetails

    • renderAsync

      public void renderAsync(int size, String key, OffscreenRenderer.RenderJob job)
      Renders content into the offscreen framebuffer and schedules a GPU readback. The resulting NativeImage will appear in
      Ungültige Referenz
      #drainPendingResults()
      on the next frame where the GPU has finished.
      Parameter:
      size - the pixel dimensions of the render target (square)
      key - an opaque key forwarded to the pending result for identification
      job - the render job; receives the active color/depth views and proj buffer
    • drainPendingResults

      public void drainPendingResults(Consumer<OffscreenRenderer.PendingResult> consumer)
      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.
      Parameter:
      consumer - receives each completed OffscreenRenderer.PendingResult
    • close

      public void close()