internal/glfw: Clean up the code

Updates #1672
This commit is contained in:
Hajime Hoshi 2021-06-13 22:43:56 +09:00
parent 3c2d562967
commit ed6756662a
2 changed files with 3 additions and 8 deletions

View File

@ -22,11 +22,6 @@ import (
) )
var ( var (
/*charModsCallbacks = map[CharModsCallback]func(window *Window, char rune, mods ModifierKey){}
framebufferSizeCallbacks = map[FramebufferSizeCallback]func(window *Window, width int, height int){}
scrollCallbacks = map[ScrollCallback]func(window *Window, xoff float64, yoff float64){}
sizeCallbacks = map[SizeCallback]func(window *Window, width int, height int){}*/
charModsCallbacks = map[CharModsCallback]glfw.CharModsCallback{} charModsCallbacks = map[CharModsCallback]glfw.CharModsCallback{}
framebufferSizeCallbacks = map[FramebufferSizeCallback]glfw.FramebufferSizeCallback{} framebufferSizeCallbacks = map[FramebufferSizeCallback]glfw.FramebufferSizeCallback{}
scrollCallbacks = map[ScrollCallback]glfw.ScrollCallback{} scrollCallbacks = map[ScrollCallback]glfw.ScrollCallback{}

View File

@ -163,7 +163,7 @@ func (w *Window) SetAttrib(attrib Hint, value int) {
func (w *Window) SetCharModsCallback(cbfun CharModsCallback) (previous CharModsCallback) { func (w *Window) SetCharModsCallback(cbfun CharModsCallback) (previous CharModsCallback) {
w.w.SetCharModsCallback(charModsCallbacks[cbfun]) w.w.SetCharModsCallback(charModsCallbacks[cbfun])
return 0 // TODO return ToCharModsCallback(nil) // TODO
} }
func (w *Window) SetCursor(cursor *Cursor) { func (w *Window) SetCursor(cursor *Cursor) {
@ -176,12 +176,12 @@ func (w *Window) SetCursor(cursor *Cursor) {
func (w *Window) SetFramebufferSizeCallback(cbfun FramebufferSizeCallback) (previous FramebufferSizeCallback) { func (w *Window) SetFramebufferSizeCallback(cbfun FramebufferSizeCallback) (previous FramebufferSizeCallback) {
w.w.SetFramebufferSizeCallback(framebufferSizeCallbacks[cbfun]) w.w.SetFramebufferSizeCallback(framebufferSizeCallbacks[cbfun])
return 0 // TODO return ToFramebufferSizeCallback(nil) // TODO
} }
func (w *Window) SetScrollCallback(cbfun ScrollCallback) (previous ScrollCallback) { func (w *Window) SetScrollCallback(cbfun ScrollCallback) (previous ScrollCallback) {
w.w.SetScrollCallback(scrollCallbacks[cbfun]) w.w.SetScrollCallback(scrollCallbacks[cbfun])
return 0 // TODO return ToScrollCallback(nil) // TODO
} }
func (w *Window) SetSizeCallback(cbfun SizeCallback) (previous SizeCallback) { func (w *Window) SetSizeCallback(cbfun SizeCallback) (previous SizeCallback) {