예제 #1
0
파일: input.go 프로젝트: jasonrpowers/glfw3
//SetCursorEnterCallback the cursor boundary crossing callback which is called
//when the cursor enters or leaves the client area of the window.
func (w *Window) SetCursorEnterCallback(cbfun func(w *Window, entered bool)) {
	if cbfun == nil {
		C.glfwSetCursorEnterCallback(w.data, nil)
	} else {
		w.fCursorEnterHolder = cbfun
		C.glfwSetCursorEnterCallbackCB(w.data)
	}
}
예제 #2
0
파일: input.go 프로젝트: godispy/glfw
// SetCursorEnterCallback the cursor boundary crossing callback which is called
// when the cursor enters or leaves the client area of the window.
func (w *Window) SetCursorEnterCallback(cbfun CursorEnterCallback) (previous CursorEnterCallback) {
	previous = w.fCursorEnterHolder
	w.fCursorEnterHolder = cbfun
	if cbfun == nil {
		C.glfwSetCursorEnterCallback(w.data, nil)
	} else {
		C.glfwSetCursorEnterCallbackCB(w.data)
	}
	panicError()
	return previous
}