16 lines
269 B
Swift
16 lines
269 B
Swift
import CSDL3
|
|
|
|
public class EventHandler {
|
|
var handle: SDL_Event
|
|
|
|
public init() {
|
|
handle = SDL_Event()
|
|
}
|
|
|
|
public func pump(handler: (SDL_Event) -> ()) {
|
|
while SDL_PollEvent(&handle) == true {
|
|
handler(handle)
|
|
}
|
|
}
|
|
}
|