C4 Engine Terathon Software C4 Engine API Documentation

• Graphics Manager

API Links
Developer Links

class DisplayEventHandler

Defined in:  C4Display.h
The DisplayEventHandler class encapsulates a display event handler function.
Definition

class DisplayEventHandler : public ListElement<DisplayEventHandler>

Constructor

DisplayEventHandler(HandlerProc *proc, void *cookie = nullptr);

Parameters
proc The procedure to invoke when a display event occurs.
cookie The cookie that is passed to the event handler as its last parameter.
Description
The DisplayEventHandler class encapsulates a procedure that is invoked when a display event occurs. Once an instance of the DisplayEventHandler class has been constructed, it can be installed by calling the DisplayMgr::InstallDisplayEventHandler function.

When a display event occurs, the procedures corresponding to all installed display event handlers are invoked. The HandlerProc type is defined as follows.

typedef void HandlerProc(const DisplayEventData *eventData, void *cookie);

The eventType field of the DisplayEventData structure specifies what type of display event occurred and can be one of the following values.
kEventDisplayChange The dimensions of the display have changed.
The cookie parameter is the value passed to the DisplayEventHandler constructor.

A display event handler is uninstalled by destroying its associated class instance.
Base Classes
ListElement<DisplayEventHandler> Used internally to store all instances of DisplayEventHandler in a list.