Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Commit

Permalink
[fix] force initialize our gLSL shaders as version 110
Browse files Browse the repository at this point in the history
  • Loading branch information
nopjmp authored and zeroeightysix committed Mar 4, 2021
1 parent f5ac8ec commit 5b7f71f
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions src/main/kotlin/me/zeroeightsix/kami/gui/KamiImgui.kt
Original file line number Diff line number Diff line change
Expand Up @@ -92,22 +92,11 @@ object KamiImgui {
val defaultFontName = fontNames.getOrElse(Settings.font) { fontNames.first() }
ImGui.getIO().setFontDefault(fonts[defaultFontName])

val caps = GL.getCapabilities()
// TODO: check if this works on macOS properly.
val glslVersion = when {
caps.OpenGL32 -> {
150
}
caps.OpenGL30 -> { // apparently we might have to skip this one?
130
}
else -> 110
}

ImGui.getIO().addConfigFlags(ImGuiConfigFlags.DockingEnable)

imguiGlfw.init(mc.window.handle, false)
imguiGl.init("#version $glslVersion")
// Force 110 shaders since this is what base Minecraft uses to avoid bugs in Intel drivers.
imguiGl.init("#version 110")
}

internal fun frame(matrices: MatrixStack, block: () -> Unit) {
Expand Down

0 comments on commit 5b7f71f

Please sign in to comment.