![]() |
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.
|
Provides a GPU-accelerated render surface adapter for Avalonia, backed by global::Avalonia.OpenGL.Controls.OpenGlControlBase. More...
Public Member Functions | |
| override void | Present (SKImage bufferImage, SKRectI bufferRect, SKRect destRect) |
| Not used in the GL-thread path. The image is disposed immediately to avoid a leak. | |
| void | Dispose () |
| Releases all resources used by the AvaloniaGpuRenderSurfaceAdapter. | |
| Public Member Functions inherited from Gondwana.Rendering.RenderSurfaceAdapterBase | |
| Point | AdapterPxToScreenPx (PointF adapterPx) |
| Converts adapter input to logical ScreenPx, retaining outside coordinates for capture/leave. | |
| void | DrawImage (SKCanvas canvas, SKImage image, SKColor clearColor) |
| Presents a complete image using the same transform as pointer normalization. | |
| void | Present (SKImage bufferImage, SKRectI bufferRect, SKRect destRect) |
| Presents the specified portion of the Backbuffer image to the destination rectangle on the RenderSurfaceAdapter. | |
Properties | |
| SKColor | ClearColor = SKColors.Black [get, set] |
| Gets or sets the color used to clear the surface before rendering. | |
| Properties inherited from Gondwana.Rendering.RenderSurfaceAdapterBase | |
| PresentationTransform | Presentation [get] |
| Current immutable aspect-preserving mapping of Backbuffer ScreenPx to adapter pixels. | |
| float | PresentationScale [get] |
| Current derived presentation scale; adapter resize does not resize the Backbuffer. | |
| int | Width [get, protected set] |
| Gets the current width of the render surface in pixels. | |
| int | Height [get, protected set] |
| Gets the current height of the render surface in pixels. | |
Additional Inherited Members | |
| Protected Member Functions inherited from Gondwana.Rendering.RenderSurfaceAdapterBase | |
| RenderSurfaceAdapterBase (int destWidth, int destHeight) | |
| Initializes a new instance of the RenderSurfaceAdapterBase class with the specified dimensions. | |
| RenderSurfaceAdapterBase (int destWidth, int destHeight, bool initialSizeAvailable) | |
| Constructs an adapter whose initial layout may still be pending. | |
| void | SetDestinationSize (int destWidth, int destHeight) |
| Sets the destination size of the render surface and raises the Resized event if the dimensions have changed. | |
| Events inherited from Gondwana.Rendering.RenderSurfaceAdapterBase | |
| Action< RenderSurfaceAdapterResizedEventArgs >? | Resized |
| Occurs when the render surface adapter is resized. | |
Provides a GPU-accelerated render surface adapter for Avalonia, backed by global::Avalonia.OpenGL.Controls.OpenGlControlBase.
The adapter's primary role is to track the physical-pixel dimensions of the render target (used to fit the logical Backbuffer into the physical presentation surface) and to post RequestNextFrameRendering() to the UI thread after each engine foreground cycle. All actual GL operations — surface creation, rendering, and presentation — are handled by AvaloniaGpuRenderSurfaceControl.
VSync: The GpuBackbuffer.VSync property has no effect when used with this adapter; swap-interval control is delegated to Avalonia's compositor.
Platform support: Requires a GPU-capable Avalonia backend (Windows/macOS/Linux desktop). Not suitable for WebAssembly (WASM) targets; use AvaloniaBitmapRenderSurfaceAdapter for cross-platform / WASM scenarios.
Definition at line 29 of file AvaloniaGpuRenderSurfaceAdapter.cs.
| void Gondwana.Avalonia.Rendering.AvaloniaGpuRenderSurfaceAdapter.Dispose | ( | ) |
Releases all resources used by the AvaloniaGpuRenderSurfaceAdapter.
Definition at line 93 of file AvaloniaGpuRenderSurfaceAdapter.cs.
| override void Gondwana.Avalonia.Rendering.AvaloniaGpuRenderSurfaceAdapter.Present | ( | SKImage | bufferImage, |
| SKRectI | bufferRect, | ||
| SKRect | destRect ) |
Not used in the GL-thread path. The image is disposed immediately to avoid a leak.
| bufferImage | The rendered image to present. |
| bufferRect | The source rectangle within the rendered image. |
| destRect | The destination rectangle on the render surface. |
Definition at line 85 of file AvaloniaGpuRenderSurfaceAdapter.cs.
|
getset |
Gets or sets the color used to clear the surface before rendering.
Definition at line 37 of file AvaloniaGpuRenderSurfaceAdapter.cs.