Vireo  0.0
Vireo 3D Rendering Hardware Interface
SwapChain Class Referenceabstract

Detailed Description

Presentation swap chain managing a set of back buffers for a window. Created by Vireo.create_swap_chain().

Lua full name: vireo.SwapChain

Public Member Functions

nil next_frame_index ()
 Advances the internal frame index to the next frame slot. More...
 
boolean acquire (fence: Fence)
 Acquires the next available back buffer. Returns false if the swap chain must be recreated (window resized). More...
 
nil present ()
 Presents the current back buffer to the display. More...
 
nil recreate ()
 Recreates the swap chain and all back buffers (call after a window resize). More...
 
nil wait_idle ()
 Blocks the CPU until all pending present operations for this swap chain have completed. More...
 

Properties

Extent extent
 Current back-buffer size in pixels. (read-only)
 
number aspect_ratio
 Width divided by height of the current back buffer. (read-only)
 
integer current_frame_index
 Index of the currently acquired back buffer (0 to frames_in_flight-1). (read-only)
 
integer frames_in_flight
 Number of back buffers in the swap chain. (read-only)
 
ImageFormat format
 Pixel format of the back buffers. (read-only)
 

Member Function Documentation

nil next_frame_index ( )

Advances the internal frame index to the next frame slot.

boolean acquire ( Fence  fence)

Acquires the next available back buffer. Returns false if the swap chain must be recreated (window resized).

Parameters
fenceFence
Returns
boolean
nil present ( )

Presents the current back buffer to the display.

nil recreate ( )

Recreates the swap chain and all back buffers (call after a window resize).

nil wait_idle ( )

Blocks the CPU until all pending present operations for this swap chain have completed.

Property Documentation

Extent extent

Current back-buffer size in pixels. (read-only)

number aspect_ratio

Width divided by height of the current back buffer. (read-only)

integer current_frame_index

Index of the currently acquired back buffer (0 to frames_in_flight-1). (read-only)

integer frames_in_flight

Number of back buffers in the swap chain. (read-only)

ImageFormat format

Pixel format of the back buffers. (read-only)