Gondwana Game Engine Development (master) - 2.6.1
Gondwana is a cross-platform 2.5D game and rendering engine written in C#/.NET 8. It provides fine-grained control over rendering, timing, and scene composition, with built-in support for parallax, z-ordering, pixel overhang, collision detection, and particle effects. Gondwana targets desktop and web platforms using SkiaSharp for graphics and pluggable audio backends for desktop and browser targets.
Loading...
Searching...
No Matches
Gondwana.Extensibility.IEnginePlugin Interface Reference

Defines lifecycle hooks for extending engine startup, simulation, rendering, and shutdown behavior. More...

Public Member Functions

void OnInitialize (Engine engine)
 Called when the engine is initializing.
void OnPreCycle (Engine engine, double deltaSeconds)
 Called before each simulation cycle.
void OnPreFrameRender (Engine engine, double deltaSeconds)
 Called before a frame is rendered.
void OnPostFrameRender (Engine engine, double deltaSeconds)
 Called after a frame has been rendered.
void OnPostCycle (Engine engine, double deltaSeconds)
 Called after each simulation cycle completes.
void OnPostRenderCanvas (Engine engine, RenderSurfaceHostBase host, SKCanvas canvas)
 Called after all scene content for a surface has been drawn to the backbuffer canvas, but before the frame is finalised and presented to the display adapter.
void OnShutdown (Engine engine)
 Called when the engine is shutting down.

Properties

string Name [get]
 Gets the display name of the plugin.
string Version [get]
 Gets the plugin version string.

Detailed Description

Defines lifecycle hooks for extending engine startup, simulation, rendering, and shutdown behavior.

Implementations can register with EnginePluginRegistry to observe engine events and run custom logic before or after key phases of engine execution.

Cycle hooks correspond to simulation updates, while frame-render hooks correspond to presentation frames. In timer-driven mode, a single external Engine.Tick may execute zero or more simulation cycles but no more than one rendered frame.

Definition at line 20 of file IEnginePlugin.cs.

Member Function Documentation

◆ OnInitialize()

void Gondwana.Extensibility.IEnginePlugin.OnInitialize ( Engine engine)

Called when the engine is initializing.

Parameters
engineThe engine being initialized.

◆ OnPostCycle()

void Gondwana.Extensibility.IEnginePlugin.OnPostCycle ( Engine engine,
double deltaSeconds )

Called after each simulation cycle completes.

Parameters
engineThe engine that completed the simulation cycle.
deltaSecondsThe simulation delta for this cycle, in seconds. In timer-driven mode this is the fixed-step duration; in the normal desktop loop it is the elapsed wall-clock time since the previous cycle.

◆ OnPostFrameRender()

void Gondwana.Extensibility.IEnginePlugin.OnPostFrameRender ( Engine engine,
double deltaSeconds )

Called after a frame has been rendered.

Parameters
engineThe engine that rendered the frame.
deltaSecondsThe elapsed wall-clock time since the previous frame render, in seconds.

◆ OnPostRenderCanvas()

void Gondwana.Extensibility.IEnginePlugin.OnPostRenderCanvas ( Engine engine,
RenderSurfaceHostBase host,
SKCanvas canvas )

Called after all scene content for a surface has been drawn to the backbuffer canvas, but before the frame is finalised and presented to the display adapter.

Parameters
engineThe engine that rendered the frame.
hostThe render surface host whose backbuffer canvas has just been fully populated. Cast to RenderSurfaceHost<TBackbuffer> if you need access to typed backbuffer properties.
canvasThe SKCanvas for the backbuffer, ready to receive post-scene drawing (overlay effects, color grading, debug annotations, etc.). The canvas matrix is reset to identity and the clip covers the full surface. Callers must save and restore canvas state around any operations that change the matrix or clip region.

This hook fires on the thread that owns the canvas:

  • CPU/bitmap surfaces — called on the engine thread. In the normal desktop loop this is the engine background thread; in timer-driven mode it is the thread driving Engine.Tick.
  • Desktop GPU surfaces — called on the Engine thread with a recording canvas. Use the supplied canvas and CPU resources; GRContext and canvas.Surface are unavailable. Browser WebGL retains synchronous GL execution.

This hook is not called when a frame is skipped (scene not dirty) or when the surface has no configured views.

Definition at line 110 of file IEnginePlugin.cs.

◆ OnPreCycle()

void Gondwana.Extensibility.IEnginePlugin.OnPreCycle ( Engine engine,
double deltaSeconds )

Called before each simulation cycle.

Parameters
engineThe engine running the simulation cycle.
deltaSecondsThe simulation delta for this cycle, in seconds. In timer-driven mode this is the fixed-step duration; in the normal desktop loop it is the elapsed wall-clock time since the previous cycle.

◆ OnPreFrameRender()

void Gondwana.Extensibility.IEnginePlugin.OnPreFrameRender ( Engine engine,
double deltaSeconds )

Called before a frame is rendered.

Parameters
engineThe engine preparing to render.
deltaSecondsThe elapsed wall-clock time since the previous frame render, in seconds.

◆ OnShutdown()

void Gondwana.Extensibility.IEnginePlugin.OnShutdown ( Engine engine)

Called when the engine is shutting down.

Parameters
engineThe engine being shut down.

Property Documentation

◆ Name

string Gondwana.Extensibility.IEnginePlugin.Name
get

Gets the display name of the plugin.

Definition at line 25 of file IEnginePlugin.cs.

◆ Version

string Gondwana.Extensibility.IEnginePlugin.Version
get

Gets the plugin version string.

Definition at line 30 of file IEnginePlugin.cs.