Ejemplo n.º 1
0
func PeepEvents(events []Event, action Eventaction, min, max uint32) (int, error) {
	cevents := make([]cEvent, len(events))
	n := C.SDL_PeepEvents(
		(*C.SDL_Event)(unsafe.Pointer(&cevents[0])),
		C.int(len(cevents)),
		C.SDL_eventaction(action),
		C.Uint32(min),
		C.Uint32(max),
	)
	if n < 0 {
		return 0, getError()
	}

	for i := 0; i < int(n); i++ {
		events[i] = cevents[i].toGo()
	}

	return int(n), nil
}
Ejemplo n.º 2
0
func (action EventAction) c() C.SDL_eventaction {
	return C.SDL_eventaction(action)
}