Sfoglia il codice sorgente

Add FramebufferSize to IWindow

George Dobrovolsky 7 anni fa
parent
commit
eb4f426229
2 ha cambiato i file con 6 aggiunte e 1 eliminazioni
  1. 5 1
      window/glfw.go
  2. 1 0
      window/window.go

+ 5 - 1
window/glfw.go

@@ -278,10 +278,14 @@ func (w *glfwWindow) SwapBuffers() {
 
 // Size returns this window size in screen coordinates
 func (w *glfwWindow) Size() (width int, height int) {
-
 	return w.win.GetSize()
 }
 
+// FramebufferSize returns framebuffer size of this window
+func (w *glfwWindow) FramebufferSize() (width int, height int) {
+	return w.win.GetFramebufferSize()
+}
+
 // SetSize sets the size, in screen coordinates, of the client area of this window
 func (w *glfwWindow) SetSize(width int, height int) {
 

+ 1 - 0
window/window.go

@@ -24,6 +24,7 @@ type IWindowManager interface {
 type IWindow interface {
 	core.IDispatcher
 	MakeContextCurrent()
+	FramebufferSize() (width int, height int)
 	Size() (width int, height int)
 	SetSize(width int, height int)
 	Pos() (xpos, ypos int)