예제 #1
0
파일: window.go 프로젝트: juturnas/glfw3
//SetFramebufferSizeCallback sets the framebuffer resize callback of the specified
//window, which is called when the framebuffer of the specified window is resized.
func (w *Window) SetFramebufferSizeCallback(cbfun func(w *Window, width int, height int)) {
	if cbfun == nil {
		C.glfwSetFramebufferSizeCallback(w.data, nil)
	} else {
		w.fFramebufferSizeHolder = cbfun
		C.glfwSetFramebufferSizeCallbackCB(w.data)
	}
}
예제 #2
0
파일: window.go 프로젝트: godispy/glfw
// SetFramebufferSizeCallback sets the framebuffer resize callback of the specified
// window, which is called when the framebuffer of the specified window is resized.
func (w *Window) SetFramebufferSizeCallback(cbfun FramebufferSizeCallback) (previous FramebufferSizeCallback) {
	previous = w.fFramebufferSizeHolder
	w.fFramebufferSizeHolder = cbfun
	if cbfun == nil {
		C.glfwSetFramebufferSizeCallback(w.data, nil)
	} else {
		C.glfwSetFramebufferSizeCallbackCB(w.data)
	}
	panicError()
	return previous
}