mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-16 10:55:01 -04:00
glfw: properly fire initial window resize
on mac os custom os scaling is used, thus the initial viewport is wrong. #29
This commit is contained in:
parent
a197fa90d9
commit
b5f6f0777c
@ -13,7 +13,6 @@
|
|||||||
|
|
||||||
package de.bixilon.minosoft.gui.rendering
|
package de.bixilon.minosoft.gui.rendering
|
||||||
|
|
||||||
import de.bixilon.kotlinglm.vec2.Vec2i
|
|
||||||
import de.bixilon.kutil.exception.ExceptionUtil.ignoreAll
|
import de.bixilon.kutil.exception.ExceptionUtil.ignoreAll
|
||||||
import de.bixilon.kutil.latch.AbstractLatch
|
import de.bixilon.kutil.latch.AbstractLatch
|
||||||
import de.bixilon.kutil.latch.ParentLatch
|
import de.bixilon.kutil.latch.ParentLatch
|
||||||
@ -23,7 +22,6 @@ import de.bixilon.kutil.primitive.BooleanUtil.decide
|
|||||||
import de.bixilon.kutil.reflection.ReflectionUtil.forceSet
|
import de.bixilon.kutil.reflection.ReflectionUtil.forceSet
|
||||||
import de.bixilon.kutil.unit.UnitFormatter.formatNanos
|
import de.bixilon.kutil.unit.UnitFormatter.formatNanos
|
||||||
import de.bixilon.minosoft.gui.rendering.RenderUtil.pause
|
import de.bixilon.minosoft.gui.rendering.RenderUtil.pause
|
||||||
import de.bixilon.minosoft.gui.rendering.events.ResizeWindowEvent
|
|
||||||
import de.bixilon.minosoft.gui.rendering.font.manager.FontManager
|
import de.bixilon.minosoft.gui.rendering.font.manager.FontManager
|
||||||
import de.bixilon.minosoft.gui.rendering.input.key.DebugKeyBindings
|
import de.bixilon.minosoft.gui.rendering.input.key.DebugKeyBindings
|
||||||
import de.bixilon.minosoft.gui.rendering.input.key.DefaultKeyBindings
|
import de.bixilon.minosoft.gui.rendering.input.key.DefaultKeyBindings
|
||||||
@ -132,7 +130,7 @@ object RenderLoader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
connection.events.fire(ResizeWindowEvent(this, previousSize = Vec2i(0, 0), size = window.size))
|
window.postInit()
|
||||||
|
|
||||||
textures.dynamicTextures.activate()
|
textures.dynamicTextures.activate()
|
||||||
textures.staticTextures.activate()
|
textures.staticTextures.activate()
|
||||||
|
@ -64,6 +64,8 @@ interface BaseWindow {
|
|||||||
maxSize = DEFAULT_MAXIMUM_WINDOW_SIZE
|
maxSize = DEFAULT_MAXIMUM_WINDOW_SIZE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun postInit()
|
||||||
|
|
||||||
fun destroy()
|
fun destroy()
|
||||||
|
|
||||||
fun close()
|
fun close()
|
||||||
|
@ -245,6 +245,10 @@ class GLFWWindow(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun postInit() {
|
||||||
|
fireGLFWEvent(ResizeWindowEvent(context, previousSize = Vec2i(0, 0), size = unscalePosition(size)))
|
||||||
|
}
|
||||||
|
|
||||||
override fun destroy() {
|
override fun destroy() {
|
||||||
glfwFreeCallbacks(window)
|
glfwFreeCallbacks(window)
|
||||||
glfwDestroyWindow(window)
|
glfwDestroyWindow(window)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user