Package limn.graphics
Interface GpuSurface
- All Known Subinterfaces:
ReadableSurface,RenderTarget,VideoSurface
public interface GpuSurface
An offscreen GPU render target owned by the backend: a texture (with its own
depth buffer) that something can draw into off-screen and that the 2D
Canvas can then composite as one layer via
Canvas.drawSurface(limn.graphics.GpuSurface, float, float, float, float). This is how 3D content (or any non-2D rendering)
participates in the scene: it renders into a surface, and the surface is drawn
as an ordinary quad in the 2D paint order, so overlays, dialogs, tooltips and
clipping all apply to it automatically.
Neutral by design (no GL here): the concrete surface lives in the backend.
The 3D subsystem's limn.render3d.RenderTarget extends this. Sizes are in
device pixels.
-
Method Summary
-
Method Details
-
widthPx
int widthPx()Current width in physical pixels. -
heightPx
int heightPx()Current height in physical pixels. -
resize
void resize(int widthPx, int heightPx) Resizes the target if the size changed (no-op otherwise). UI thread, in a frame.A surface whose size is dictated by its own content (a decoded picture, say) ignores this entirely and says so on its own declaration. Scale such a surface by drawing it into the rectangle you want instead.
-
dispose
void dispose()Releases the GPU resources. UI thread, with the owning context current.
-