pollEvent

Wraps SDL_PollEvent which returns the latest event in queue

@safe @trusted
pollEvent
()

Return Value

Type: Event

dsdl2.Event if there's an event, otherwise null

Examples

// Polls every upcoming event in queue
dsdl2.pumpEvents();
while (auto event = dsdl2.pollEvent()){
    if (cast(dsdl2.QuitEvent)event) {
        dsdl2.quit();
    }
}

Meta