Kaynağa Gözat

Added additional functions

Min 6 yıl önce
ebeveyn
işleme
7ece3f26c0
3 değiştirilmiş dosya ile 6 ekleme ve 7 silme
  1. 1 7
      app/app-desktop.go
  2. 4 0
      window/glfw.go
  3. 1 0
      window/window.go

+ 1 - 7
app/app-desktop.go

@@ -15,12 +15,6 @@ import (
 	"time"
 )
 
-// Desktop application defaults
-const (
-	title  = "G3N Application"
-	width  = 800
-	height = 600
-)
 
 // Application
 type Application struct {
@@ -34,7 +28,7 @@ type Application struct {
 }
 
 // App returns the Application singleton, creating it the first time.
-func App() *Application {
+func App(width, height int, title string) *Application {
 
 	// Return singleton if already created
 	if a != nil {

+ 4 - 0
window/glfw.go

@@ -495,6 +495,10 @@ func (w *GlfwWindow) DisposeAllCustomCursors() {
 	w.lastCursorKey = CursorLast
 }
 
+func (w *GlfwWindow) SetCursorMode(cm CursorMode) {
+	w.SetInputMode(glfw.CursorMode, int(cm))
+}
+
 // Center centers the window on the screen.
 //func (w *GlfwWindow) Center() {
 //

+ 1 - 0
window/window.go

@@ -39,6 +39,7 @@ type IWindow interface {
 	SetCursor(cursor Cursor)
 	DisposeAllCustomCursors()
 	Destroy()
+	SetCursorMode(cm CursorMode)
 }
 
 // Key corresponds to a keyboard key.