// WaitEventTimeout (https://wiki.libsdl.org/SDL_WaitEventTimeout) func WaitEventTimeout(timeout int) Event { var cevent CEvent _event := (*C.SDL_Event)(unsafe.Pointer(&cevent)) ok := int(C.SDL_WaitEventTimeout(_event, C.int(timeout))) if ok == 0 { return nil } return goEvent(&cevent) }
func WaitEventTimeout(ev *Event, timeout time.Duration) error { evLock.Lock() defer evLock.Unlock() if C.SDL_WaitEventTimeout(evCache.c(), C.int(timeout/time.Millisecond)) == 0 { return getError() } return nil }
func (event *Event) WaitTimeout(timeout int) bool { ret := C.SDL_WaitEventTimeout((*C.SDL_Event)(cast(event)), C.int(timeout)) return ret != 0 }