Open tumuidle opened 3 days ago
1.86.11
Frames and text become black blocks in Minecraft MCP 1.21 when using custom fonts
Initialize called after game window initialized
createContext() ctx = getCurrentContext() val io = getIO() glfw.init(window, false) gl3.init() val fontAtlas = io.fonts val fontConfig = ImFontConfig() fontConfig.glyphRanges = fontAtlas.glyphRangesChineseFull fontConfig.mergeMode = true fontConfig.pixelSnapH = true fontAtlas.addFontDefault(fontConfig) fontAtlas.addFontFromMemoryTTF(loadResource("assets/h3x/NotoSansSC-Medium.otf")!!, 14f, fontConfig, fontAtlas.glyphRangesChineseFull) fontAtlas.build() fontConfig.destroy()
Render called after a GLFW.glfwPollEvents() call and before GLFW.glfwSwapBuffers
fun render(window: Long) { glfw.newFrame() newFrame() if (begin("test", ImGuiWindowFlags.MenuBar)) { text("test") } end() render() MemoryStack.stackPush().use { val dw = it.mallocInt(1) val dh = it.mallocInt(1) GLFW.glfwGetFramebufferSize(window, dw, dh) RenderSystem.viewport(0, 0, dw.get(), dh.get()) } gl3.renderDrawData(getDrawData()) updatePlatformWindows() renderPlatformWindowsDefault() }
loadResource method
fun loadResource(path: String) = Main.javaClass.classLoader.getResourceAsStream(path)?.readBytes()
No error in log except an asset (icons/icon_16x16.png) does not exists in MCP environment(its normal)
Version
1.86.11
What happened?
Frames and text become black blocks in Minecraft MCP 1.21 when using custom fonts![image](https://github.com/SpaiR/imgui-java/assets/62649962/1a5247d8-0a66-4783-9608-4a5ddf8b28b4)
Reproduction
Initialize called after game window initialized
Render called after a GLFW.glfwPollEvents() call and before GLFW.glfwSwapBuffers
loadResource method
Relevant log output