Record ALLEGRO_USER_EVENT

Hierarchy
Methods
Properties

Unit

Declaration

type ALLEGRO_USER_EVENT = record

Description

An event structure that can be emitted by user event sources. These are the public fields:

source: ALLEGRO_EVENT_SOURCE;
data1: AL_DATA_INTPTR_T;
data2: AL_DATA_INTPTR_T;
data3: AL_DATA_INTPTR_T;
data4: AL_DATA_INTPTR_T;

Like all other event types this structure is a part of the ALLEGRO_EVENT union. To access the fields in an ALLEGRO_EVENT variable ev, you would use:

ev.user.source
ev.user.data1
ev.user.data2
ev.user.data3
ev.user.data4

To create a new user event you would do this:

VAR
  MyEventSource: ALLEGRO_EVENT_SOURCE;
  MyEvent: ALLEGRO_EVENT;
  SomeVar: REAL;
BEGIN
  al_init_user_event_source (@MyEventSource);
  MyEvent.user.ftype := ALLEGRO_GET_EVENT_TYPE ('MINE');
  MyEvent.user.data1.int_value := 1;
  MyEvent.user.data2.ptr_value := @SomeVar;
  al_emit_user_event (MyEventSource, MyEvent, NIL)
END;

Event type identifiers for user events are assigned by the user. Please see the documentation for ALLEGRO_GET_EVENT_TYPE for the rules you should follow when assigning identifiers.

See also
al_emit_user_event
Emits an event from a user event source.
ALLEGRO_GET_EVENT_TYPE
Makes an event type identifier, which is a 32-bit integer.
al_init_user_event_source
Initialices an event source for emitting user events.

Overview

Fields

ftype: ALLEGRO_EVENT_TYPE;
source: AL_POINTER;
timestamp: AL_DOUBLE;
data1: AL_DATA_PTR_T;
data2: AL_DATA_PTR_T;
data3: AL_DATA_PTR_T;
data4: AL_DATA_PTR_T;

Description

Fields

ftype: ALLEGRO_EVENT_TYPE;

Event identifier.

source: AL_POINTER;

Pointer to the event source.

timestamp: AL_DOUBLE;

When the event was emited.

data1: AL_DATA_PTR_T;

Extra data.

data2: AL_DATA_PTR_T;

Extra data.

data3: AL_DATA_PTR_T;

Extra data.

data4: AL_DATA_PTR_T;

Extra data.


Generated by PasDoc 0.15.0. Generated on 2024-11-10 15:15:06.