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.Rendering.RenderSurfaceAdapterBase Class Referenceabstract

Represents the abstract base class for render surface adapters that present backbuffer output to a destination surface. More...

Inheritance diagram for Gondwana.Rendering.RenderSurfaceAdapterBase:
Gondwana.Avalonia.Rendering.AvaloniaBitmapRenderSurfaceAdapter Gondwana.Avalonia.Rendering.AvaloniaGpuRenderSurfaceAdapter Gondwana.Blazor.Rendering.BlazorBitmapRenderSurfaceAdapter Gondwana.Blazor.Rendering.BlazorGpuRenderSurfaceAdapter Gondwana.WinForms.Rendering.WinFormBitmapRenderSurfaceAdapter Gondwana.WinForms.Rendering.WinFormGpuRenderSurfaceAdapter

Public Member Functions

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.

Protected Member Functions

 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.

Properties

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.

Events

Action< RenderSurfaceAdapterResizedEventArgs >? Resized
 Occurs when the render surface adapter is resized.

Detailed Description

Represents the abstract base class for render surface adapters that present backbuffer output to a destination surface.

Definition at line 10 of file RenderSurfaceAdapterBase.cs.

Constructor & Destructor Documentation

◆ RenderSurfaceAdapterBase() [1/2]

Gondwana.Rendering.RenderSurfaceAdapterBase.RenderSurfaceAdapterBase ( int destWidth,
int destHeight )
protected

Initializes a new instance of the RenderSurfaceAdapterBase class with the specified dimensions.

Parameters
destWidthThe initial width of the render surface in pixels.
destHeightThe initial height of the render surface in pixels.

Definition at line 102 of file RenderSurfaceAdapterBase.cs.

◆ RenderSurfaceAdapterBase() [2/2]

Gondwana.Rendering.RenderSurfaceAdapterBase.RenderSurfaceAdapterBase ( int destWidth,
int destHeight,
bool initialSizeAvailable )
protected

Constructs an adapter whose initial layout may still be pending.

Parameters
destWidthInitial or placeholder adapter width.
destHeightInitial or placeholder adapter height.
initialSizeAvailableFalse for hosts constructed before layout; the first valid size establishes resolution once.

Definition at line 109 of file RenderSurfaceAdapterBase.cs.

Member Function Documentation

◆ AdapterPxToScreenPx()

Point Gondwana.Rendering.RenderSurfaceAdapterBase.AdapterPxToScreenPx ( PointF adapterPx)

Converts adapter input to logical ScreenPx, retaining outside coordinates for capture/leave.

Parameters
adapterPxThe adapter px.
Returns
The point in logical backbuffer screen pixels.

Definition at line 41 of file RenderSurfaceAdapterBase.cs.

◆ DrawImage()

void Gondwana.Rendering.RenderSurfaceAdapterBase.DrawImage ( SKCanvas canvas,
SKImage image,
SKColor clearColor )

Presents a complete image using the same transform as pointer normalization.

Parameters
canvasThe canvas.
imageThe image.
clearColorThe clear color.

Definition at line 52 of file RenderSurfaceAdapterBase.cs.

◆ Present()

void Gondwana.Rendering.RenderSurfaceAdapterBase.Present ( SKImage bufferImage,
SKRectI bufferRect,
SKRect destRect )
abstract

Presents the specified portion of the Backbuffer image to the destination rectangle on the RenderSurfaceAdapter.

The method maps the specified region of the buffer image to the destination rectangle, scaling or transforming as necessary. Callers must ensure that the dimensions and coordinates of bufferRect and destRect are valid.

Parameters
bufferImageThe source image from which to present. Cannot be null.
bufferRectThe rectangular region of the buffer image to present. Coordinates are in the buffer image's space.
destRectThe rectangular region in the destination space where the presented content will be drawn.

◆ SetDestinationSize()

void Gondwana.Rendering.RenderSurfaceAdapterBase.SetDestinationSize ( int destWidth,
int destHeight )
protected

Sets the destination size of the render surface and raises the Resized event if the dimensions have changed.

Parameters
destWidthThe new width of the render surface in pixels.
destHeightThe new height of the render surface in pixels.

If dimensions and size availability are unchanged, this method returns without raising Resized. The first valid layout raises the event even if it matches the placeholder dimensions.

Definition at line 124 of file RenderSurfaceAdapterBase.cs.

Property Documentation

◆ Height

int Gondwana.Rendering.RenderSurfaceAdapterBase.Height
getprotected set

Gets the current height of the render surface in pixels.

The height of the render surface.

Definition at line 91 of file RenderSurfaceAdapterBase.cs.

◆ Presentation

PresentationTransform Gondwana.Rendering.RenderSurfaceAdapterBase.Presentation
get

Current immutable aspect-preserving mapping of Backbuffer ScreenPx to adapter pixels.

Definition at line 24 of file RenderSurfaceAdapterBase.cs.

◆ PresentationScale

float Gondwana.Rendering.RenderSurfaceAdapterBase.PresentationScale
get

Current derived presentation scale; adapter resize does not resize the Backbuffer.

Definition at line 27 of file RenderSurfaceAdapterBase.cs.

◆ Width

int Gondwana.Rendering.RenderSurfaceAdapterBase.Width
getprotected set

Gets the current width of the render surface in pixels.

The width of the render surface.

Definition at line 81 of file RenderSurfaceAdapterBase.cs.

Event Documentation

◆ Resized

Action<RenderSurfaceAdapterResizedEventArgs>? Gondwana.Rendering.RenderSurfaceAdapterBase.Resized

Occurs when the render surface adapter is resized.

This event is raised when the Width or Height properties change, providing both the old and new dimensions in the event arguments.

Definition at line 75 of file RenderSurfaceAdapterBase.cs.