Explorar o código

Add SetInputMode & SetCursorPos

Pavel %!s(int64=7) %!d(string=hai) anos
pai
achega
1c3ef09d9e
Modificáronse 2 ficheiros con 10 adicións e 0 borrados
  1. 8 0
      window/glfw.go
  2. 2 0
      window/window.go

+ 8 - 0
window/glfw.go

@@ -339,3 +339,11 @@ func (w *glfwWindow) SetStandardCursor(cursor StandardCursor) {
 		panic("Invalid cursor")
 	}
 }
+
+func (w *glfwWindow) SetInputMode(mode InputMode, state int) {
+	w.win.SetInputMode(glfw.InputMode(mode), state)
+}
+
+func (w *glfwWindow) SetCursorPos(xpos, ypos float64) {
+	w.win.SetCursorPos(xpos, ypos)
+}

+ 2 - 0
window/window.go

@@ -30,6 +30,8 @@ type IWindow interface {
 	SetPos(xpos, ypos int)
 	SetTitle(title string)
 	SetStandardCursor(cursor StandardCursor)
+	SetInputMode(InputMode, int)
+	SetCursorPos(xpos, ypos float64)
 	ShouldClose() bool
 	SetShouldClose(bool)
 	FullScreen() bool