GpuSurface
- Extends
Resource
A window or the web page's canvas, which a device renders frames into and presents. Configure it with a size, then for each frame render into currentTexture() and call present(). Configure it again when the window is resized.
Properties
final target:SurfaceTargetvar format(default, null):TextureFormatvar width(default, null):Intvar height(default, null):Intvar vsync(default, null):BoolWhether present waits for the display's refresh.
Methods
function preferredFormat():TextureFormatThe format this surface presents best, which configure uses by default.
function configure(width:Int, height:Int, ?format:TextureFormat, ?vsync:Bool = true):VoidSets the size of the frames, in pixels, and their format; again after a resize.
function currentTexture():TextureThe texture of the frame being drawn, which a render pass renders into. It is the same texture until present.
function present():VoidShows the current frame, after the work submitted before.