MinecraftCanvasRenderer

Owns custom native drawing resources for one attachment resource generation.

A factory lazily creates a separate instance during each attachment's first capture, even when a source is shared, and a replacement after resource reload. Initialization uploads share the first capture's completion fence; an attachment closed before native preparation creates no renderer. Calls are confined to the Minecraft render thread and target only the borrowed offscreen target. Drawing directly to the current GUI or window framebuffer is outside this contract. Pixel row zero of the finished target must represent the top image row, with ordinary RGBA8 straight alpha. Instances must not retain the context or target beyond render.

Functions

Link copied to clipboard
abstract override fun close()

Releases renderer-owned resources after its final GPU work has completed.

Link copied to clipboard
abstract fun render(context: MinecraftCanvasContext): DrawImage?

Draws one complete presentation after the target has been cleared to transparent.