mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
ui: Fix wrong comment
This commit is contained in:
parent
7d236950c2
commit
d7b7aac6e4
@ -409,29 +409,28 @@ func (u *userInterface) setScreenSize(width, height int, scale float64, fullscre
|
|||||||
|
|
||||||
u.fullscreen = fullscreen
|
u.fullscreen = fullscreen
|
||||||
|
|
||||||
window := u.window
|
|
||||||
if u.fullscreen {
|
if u.fullscreen {
|
||||||
if u.origPosX < 0 && u.origPosY < 0 {
|
if u.origPosX < 0 && u.origPosY < 0 {
|
||||||
u.origPosX, u.origPosY = window.GetPos()
|
u.origPosX, u.origPosY = u.window.GetPos()
|
||||||
}
|
}
|
||||||
m := glfw.GetPrimaryMonitor()
|
m := glfw.GetPrimaryMonitor()
|
||||||
v := m.GetVideoMode()
|
v := m.GetVideoMode()
|
||||||
window.SetMonitor(m, 0, 0, v.Width, v.Height, v.RefreshRate)
|
u.window.SetMonitor(m, 0, 0, v.Width, v.Height, v.RefreshRate)
|
||||||
} else {
|
} else {
|
||||||
if u.origPosX >= 0 && u.origPosY >= 0 {
|
if u.origPosX >= 0 && u.origPosY >= 0 {
|
||||||
x := u.origPosX
|
x := u.origPosX
|
||||||
y := u.origPosY
|
y := u.origPosY
|
||||||
window.SetMonitor(nil, x, y, 16, 16, 0)
|
u.window.SetMonitor(nil, x, y, 16, 16, 0)
|
||||||
u.origPosX = -1
|
u.origPosX = -1
|
||||||
u.origPosY = -1
|
u.origPosY = -1
|
||||||
}
|
}
|
||||||
ch := make(chan struct{})
|
ch := make(chan struct{})
|
||||||
window.SetFramebufferSizeCallback(func(_ *glfw.Window, width, height int) {
|
u.window.SetFramebufferSizeCallback(func(_ *glfw.Window, width, height int) {
|
||||||
window.SetFramebufferSizeCallback(nil)
|
u.window.SetFramebufferSizeCallback(nil)
|
||||||
close(ch)
|
close(ch)
|
||||||
})
|
})
|
||||||
w, h := u.glfwSize()
|
w, h := u.glfwSize()
|
||||||
window.SetSize(w, h)
|
u.window.SetSize(w, h)
|
||||||
event:
|
event:
|
||||||
for {
|
for {
|
||||||
glfw.PollEvents()
|
glfw.PollEvents()
|
||||||
@ -446,7 +445,7 @@ func (u *userInterface) setScreenSize(width, height int, scale float64, fullscre
|
|||||||
}
|
}
|
||||||
// SwapInterval is affected by the current monitor of the window.
|
// SwapInterval is affected by the current monitor of the window.
|
||||||
// This needs to be called at least after SetMonitor.
|
// This needs to be called at least after SetMonitor.
|
||||||
// Without SwapInterval after SetMonitor, vsynch doesn't work (#357).
|
// Without SwapInterval after SetMonitor, vsynch doesn't work (#375).
|
||||||
glfw.SwapInterval(1)
|
glfw.SwapInterval(1)
|
||||||
// TODO: Rename this variable?
|
// TODO: Rename this variable?
|
||||||
u.sizeChanged = true
|
u.sizeChanged = true
|
||||||
|
Loading…
Reference in New Issue
Block a user