Gondwana Game Engine Development (master) - 2.7.0
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.WinForms.Input.Touch.WinFormsTouchAdapter Class Referencesealed

Captures native Windows touchscreen contacts (WM_TOUCH) from a WinForms render control and its child HWNDs for the standard Gondwana touch poller. More...

Inheritance diagram for Gondwana.WinForms.Input.Touch.WinFormsTouchAdapter:
Gondwana.Input.Touch.ITouchAdapter

Public Member Functions

 WinFormsTouchAdapter (Control surface)
 Creates the adapter and registers existing and future child HWNDs.
IReadOnlyList< TouchPoint > ConsumeBeganTouches ()
 Drains and returns all touch contacts that began since the last call. Keeping beginnings in a queue prevents a short tap that begins and ends between two engine polls from being lost. Adapters that do not maintain a beginning queue may rely on the default empty implementation; the poller will still discover active contacts from ActiveTouches.
Returns
The newly begun touch contacts, consumed from the pending collection.

IReadOnlyList< TouchPoint > ConsumeEndedTouches ()
 Drains and returns all touch contacts that ended (lifted or cancelled) since the last call. Each entry preserves the original TouchPhase (TouchPhase.Ended or TouchPhase.Cancelled) so the poller can distinguish between the two. This method is intended to be called once per engine tick by the TouchEventPoller.
Returns
A snapshot of all contacts that ended since the previous call to this method. The returned list is cleared from the adapter's internal queue on each call.

void Dispose ()

Properties

IReadOnlyList< TouchPoint > ActiveTouches [get]
 Gets the list of touch contact points that are currently active (in contact with the surface). This list reflects the state at the most recent platform pointer event. An empty list indicates no fingers are currently in contact.
bool IsRegistered [get]
 Whether a native window has successfully registered for touch.

Detailed Description

Captures native Windows touchscreen contacts (WM_TOUCH) from a WinForms render control and its child HWNDs for the standard Gondwana touch poller.

The UI thread records touch beginnings and endings, including contacts shorter than one engine frame. TouchEventPoller dispatches them on the engine thread. Mouse/pen input continues through the normal WinForms mouse adapter. Dispose on the WinForms thread, or let the engine dispose the touch poller.

Definition at line 17 of file WinFormsTouchAdapter.cs.

Constructor & Destructor Documentation

◆ WinFormsTouchAdapter()

Gondwana.WinForms.Input.Touch.WinFormsTouchAdapter.WinFormsTouchAdapter ( Control surface)

Creates the adapter and registers existing and future child HWNDs.

Definition at line 35 of file WinFormsTouchAdapter.cs.

Member Function Documentation

◆ ConsumeBeganTouches()

IReadOnlyList< TouchPoint > Gondwana.WinForms.Input.Touch.WinFormsTouchAdapter.ConsumeBeganTouches ( )

Drains and returns all touch contacts that began since the last call. Keeping beginnings in a queue prevents a short tap that begins and ends between two engine polls from being lost. Adapters that do not maintain a beginning queue may rely on the default empty implementation; the poller will still discover active contacts from ActiveTouches.

Returns
The newly begun touch contacts, consumed from the pending collection.

Implements Gondwana.Input.Touch.ITouchAdapter.

◆ ConsumeEndedTouches()

IReadOnlyList< TouchPoint > Gondwana.WinForms.Input.Touch.WinFormsTouchAdapter.ConsumeEndedTouches ( )

Drains and returns all touch contacts that ended (lifted or cancelled) since the last call. Each entry preserves the original TouchPhase (TouchPhase.Ended or TouchPhase.Cancelled) so the poller can distinguish between the two. This method is intended to be called once per engine tick by the TouchEventPoller.

Returns
A snapshot of all contacts that ended since the previous call to this method. The returned list is cleared from the adapter's internal queue on each call.

Implements Gondwana.Input.Touch.ITouchAdapter.

◆ Dispose()

void Gondwana.WinForms.Input.Touch.WinFormsTouchAdapter.Dispose ( )

Definition at line 238 of file WinFormsTouchAdapter.cs.

Property Documentation

◆ ActiveTouches

IReadOnlyList<TouchPoint> Gondwana.WinForms.Input.Touch.WinFormsTouchAdapter.ActiveTouches
get

Gets the list of touch contact points that are currently active (in contact with the surface). This list reflects the state at the most recent platform pointer event. An empty list indicates no fingers are currently in contact.

Implements Gondwana.Input.Touch.ITouchAdapter.

Definition at line 48 of file WinFormsTouchAdapter.cs.

◆ IsRegistered

bool Gondwana.WinForms.Input.Touch.WinFormsTouchAdapter.IsRegistered
get

Whether a native window has successfully registered for touch.

Definition at line 57 of file WinFormsTouchAdapter.cs.