Lua
C++
Edit

WaitEvent

This function waits until an event is available in the event queue and returns the oldest event.

Syntax

function WaitEvent() -> Event

Returns

Returns the oldest event in the queue.

Remarks

Use PeekEvent to check if any events are available before calling this function, if you don't want the application to pause.

Example

--Get the displays
local displays = GetDisplays()

--Create window
local window = CreateWindow("Ultra Engine", 0, 0, 800, 600, displays[1])

--Create user interface
local ui = CreateInterface(window)

while true do
    local ev = WaitEvent()
    if ev.id == EVENT_WINDOWCLOSE then
        if ev.source == window then
            return 0
        end
    end
end
Copyright © 2024 Ultra Software.
All rights reserved.