Exemple #1
0
//SetScrollCallback sets the scroll callback which is called when a scrolling
//device is used, such as a mouse wheel or scrolling area of a touchpad.
func (w *Window) SetScrollCallback(cbfun func(w *Window, xoff float64, yoff float64)) {
	if cbfun == nil {
		C.glfwSetScrollCallback(w.data, nil)
	} else {
		w.fScrollHolder = cbfun
		C.glfwSetScrollCallbackCB(w.data)
	}
}
Exemple #2
0
// SetScrollCallback sets the scroll callback which is called when a scrolling
// device is used, such as a mouse wheel or scrolling area of a touchpad.
func (w *Window) SetScrollCallback(cbfun ScrollCallback) (previous ScrollCallback) {
	previous = w.fScrollHolder
	w.fScrollHolder = cbfun
	if cbfun == nil {
		C.glfwSetScrollCallback(w.data, nil)
	} else {
		C.glfwSetScrollCallbackCB(w.data)
	}
	panicError()
	return previous
}