// PeepEvents checks the event queue for messages and optionally return them.
// (https://wiki.libsdl.org/SDL_PeepEvents)
PeepEvents checks the event queue for messages and optionally return them.
// PeepEvents checks the event queue for messages and optionally return them . // ( https : // wiki . libsdl . org / SDL_PeepEvents )
func PeepEvents(events []Event, action EventAction, minType, maxType uint32) (storedEvents int, err error) {
	if events == nil {
		return 0, nil
	}
	var _events []CEvent = make([]CEvent, len(events))
	if action == ADDEVENT { 
		for i := 0; i < len(events); i++ {
			_events[i] = *cEvent(events[i])
		}
	}
	_pevents := (*C.SDL_Event)(unsafe.Pointer(&_events[0]))
	storedEvents = int(C.SDL_PeepEvents(_pevents, C.int(len(events)), action.c(), C.Uint32(minType), C.Uint32(maxType)))
	if action != ADDEVENT { 
		for i := 0; i < storedEvents; i++ {
			events[i] = goEvent(&_events[i])
		}
	}
	if storedEvents < 0 {
		err = GetError()
	}
	return
}
func PeepEvents ( events [ ] Event , action EventAction , minType , maxType uint32 ) ( storedEvents int , err error ) { if events == nil { return 0 , nil } var _events [ ] CEvent = make ( [ ] CEvent , len ( events ) ) if action == ADDEVENT { for i := 0 ; i < len ( events ) ; i ++ { _events [ i ] = * cEvent ( events [ i ] ) } } _pevents := ( * C . SDL_Event ) ( unsafe . Pointer ( & _events [ 0 ] ) ) storedEvents = int ( C . SDL_PeepEvents ( _pevents , C . int ( len ( events ) ) , action . c ( ) , C . Uint32 ( minType ) , C . Uint32 ( maxType ) ) ) if action != ADDEVENT { for i := 0 ; i < storedEvents ; i ++ { events [ i ] = goEvent ( & _events [ i ] ) } } if storedEvents < 0 { err = GetError ( ) } return }
PeepEvents checks the event queue for messages and optionally return them.
PeepEvents checks the event queue for messages and optionally return them .
// the contents of _events matter if they are to be added // put events into slice, events unchanged if action = ADDEVENT