Exemplo n.º 1
0
Arquivo: x.go Projeto: sixteng/goGLPro
func (window *XWindow) Peek() bool {
	var xev C.XEvent

	events := C.XCheckWindowEvent(window.dpy)
	fmt.Println(events)
	if events != 0 {
		fmt.Println("Get Event")
		C.XNextEvent(window.dpy, &xev)
		if C.GetEventType(&xev) == C.Expose {
			return false
		}

		window.Callback(window, uint32(C.GetEventType(&xev)), 0, 0)

		return true
	}

	return false

	/*
		ev, xerr := window.x.PollForEvent()
		if(ev != nil) {
			//window.Callback(window, ev.)
			return true;
		}

		if(xerr != nil) {
			return true;
		}
	*/
	return false
}
Exemplo n.º 2
0
func (e *Event) Type() uint32 {
	return uint32(C.GetEventType((*C.ALLEGRO_EVENT)(unsafe.Pointer(e))))
}