Panel Graphics Retained Drawing
These routines let you record a sequence of panel graphics drawing commands and replay them efficiently on subsequent frames. This is useful for static or infrequently changing parts of a display: record once, then replay each frame without reissuing individual draw calls.
WARNING: A retained drawing captures references to the texture atlases and fonts used during recording. If you destroy a texture atlas or font that was used in a retained drawing, you must also destroy that retained drawing - replaying it will reference invalid resources.
XPLMRetainedDrawing_t
typedef
An opaque handle to a recorded sequence of drawing commands. Create one by bracketing draw calls between XPLMBeginRetainedDrawing and XPLMEndRetainedDrawing. Destroy it with XPLMDestroyRetainedDrawing when it is no longer needed.
local my_retainedDrawing_t = nil -- XPLMRetainedDrawing_t
Used by:
XPLMBeginRetainedDrawing
function
This function begins recording drawing commands. All panel graphics calls made after this function and before XPLMEndRetainedDrawing are captured into a retained drawing instead of being rendered immediately.
NOTE: Do not nest retained drawing sessions.
XPLMBeginRetainedDrawing(
)
XPLMEndRetainedDrawing
function
This function ends recording and returns a handle to the captured drawing commands. Subsequent panel graphics calls are once again rendered immediately.
Returns an opaque handle to the retained drawing.
-- returns see XPLMRetainedDrawing_t -> assign to local/var
local my_retainedDrawing_t = XPLMEndRetainedDrawing(
)
XPLMDrawRetained
function
This function replays a previously recorded sequence of drawing commands. You can call this multiple times per frame and across multiple frames to efficiently re-draw the same content.
XPLMDrawRetained(
drawing -- see XPLMRetainedDrawing_t
)
See associated types:
XPLMDestroyRetainedDrawing
function
This function destroys a retained drawing and frees its resources.
XPLMDestroyRetainedDrawing(
drawing -- see XPLMRetainedDrawing_t
)
See associated types: