ソースを参照

added window Destroy()

leonsal 8 年 前
コミット
a112006452
2 ファイル変更7 行追加0 行削除
  1. 6 0
      window/glfw.go
  2. 1 0
      window/window.go

+ 6 - 0
window/glfw.go

@@ -245,6 +245,12 @@ func (w *GLFW) SwapBuffers() {
 	w.win.SwapBuffers()
 }
 
+func (w *GLFW) Destroy() {
+
+	w.win.Destroy()
+	w.win = nil
+}
+
 func (w *GLFW) PollEvents() {
 
 	glfw.PollEvents()

+ 1 - 0
window/window.go

@@ -30,6 +30,7 @@ type IWindow interface {
 	SwapBuffers()
 	ShouldClose() bool
 	SetShouldClose(bool)
+	Destroy()
 	PollEvents()
 	GetTime() float64
 }