From 28665cfc4b568e85c017b71cccbe25bfb913a129 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Wed, 9 Jan 2019 10:34:54 +0900 Subject: [PATCH] glfw: Bug fix: Compilation error on Windows --- internal/glfw/glfw_windows.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/internal/glfw/glfw_windows.go b/internal/glfw/glfw_windows.go index dae189b9e..01e69e101 100644 --- a/internal/glfw/glfw_windows.go +++ b/internal/glfw/glfw_windows.go @@ -203,6 +203,19 @@ func (w *Window) SetScrollCallback(cbfun ScrollCallback) (previous ScrollCallbac return nil // TODO } +func (w *Window) SetSizeCallback(cbfun SizeCallback) (previous FramebufferSizeCallback) { + var gcb uintptr + if cbfun != nil { + gcb = windows.NewCallbackCDecl(func(window uintptr, width int, height int) uintptr { + cbfun(theGLFWWindows.get(window), width, height) + return 0 + }) + } + glfwDLL.call("glfwSetWindowSizeCallback", w.w, gcb) + panicError() + return nil // TODO +} + func (w *Window) SetIcon(images []image.Image) { gimgs := make([]glfwImage, len(images)) defer runtime.KeepAlive(gimgs)