Skip to content

Commit a326da2

Browse files
committed
fix fullscreen on OS X: wtf?
1 parent 672eb20 commit a326da2

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

engi_glfw.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,13 @@ func run(title string, width, height int, fullscreen bool) {
8383
gl.Viewport(0, 0, width, height)
8484

8585
window.SetFramebufferSizeCallback(func(window *glfw.Window, w, h int) {
86-
log.Println("RESIZE", width, height, "=>", w, h)
8786
oldWidth, oldHeight := width, height
8887
width, height = window.GetFramebufferSize()
89-
log.Println("BUFSIZE", width, height)
90-
if oldWidth == 0 && oldHeight == 0 {
91-
gl.Viewport(0, 0, w, h)
92-
} else {
93-
// this fixes Intel drivers on OS X, idk why
88+
if runtime.GOOS == "darwin" && oldWidth/2 == w && oldHeight/2 == h {
89+
// I have no idea why, but this fixes fullscreen on OS X w/ retina
9490
gl.Viewport(0, h, w, h)
91+
} else {
92+
gl.Viewport(0, 0, w, h)
9593
}
9694
responder.Resize(w, h)
9795
})

0 commit comments

Comments
 (0)