コード例 #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
}