leonsal 8 лет назад
Родитель
Сommit
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
 }