예제 #1
0
파일: window.go 프로젝트: juturnas/glfw3
//SetPositionCallback sets the position callback of the window, which is called
//when the window is moved. The callback is provided with the screen position
//of the upper-left corner of the client area of the window.
func (w *Window) SetPositionCallback(cbfun func(w *Window, xpos int, ypos int)) {
	if cbfun == nil {
		C.glfwSetWindowPosCallback(w.data, nil)
	} else {
		w.fPosHolder = cbfun
		C.glfwSetWindowPosCallbackCB(w.data)
	}
}
예제 #2
0
파일: window.go 프로젝트: godispy/glfw
// SetPosCallback sets the position callback of the window, which is called
// when the window is moved. The callback is provided with the screen position
// of the upper-left corner of the client area of the window.
func (w *Window) SetPosCallback(cbfun PosCallback) (previous PosCallback) {
	previous = w.fPosHolder
	w.fPosHolder = cbfun
	if cbfun == nil {
		C.glfwSetWindowPosCallback(w.data, nil)
	} else {
		C.glfwSetWindowPosCallbackCB(w.data)
	}
	panicError()
	return previous
}