47 lines
1.3 KiB
Kotlin
47 lines
1.3 KiB
Kotlin
package codes.som.hibiscus.gui
|
|
|
|
import codes.som.hibiscus.mc
|
|
import imgui.ImGui
|
|
import imgui.flag.ImGuiConfigFlags
|
|
import imgui.gl3.ImGuiImplGl3
|
|
import imgui.glfw.ImGuiImplGlfw
|
|
import net.minecraft.client.gui.screen.Screen
|
|
import net.minecraft.client.util.math.MatrixStack
|
|
import net.minecraft.text.Text
|
|
import org.lwjgl.glfw.GLFW
|
|
|
|
|
|
object ImGuiScreen : Screen(Text.of("hacker_menu")) {
|
|
private val imGuiGlfw = ImGuiImplGlfw()
|
|
private val imGuiGl3 = ImGuiImplGl3()
|
|
|
|
init {
|
|
ImGui.createContext()
|
|
imGuiGlfw.init(mc.window.handle, true)
|
|
imGuiGl3.init()
|
|
}
|
|
|
|
override fun render(matrices: MatrixStack?, mouseX: Int, mouseY: Int, delta: Float) {
|
|
super.render(matrices, mouseX, mouseY, delta)
|
|
|
|
imGuiGlfw.newFrame()
|
|
ImGui.newFrame()
|
|
|
|
ImGui.begin("hello")
|
|
ImGui.text("you just got hacked by didi @ digitalgangster")
|
|
ImGui.end()
|
|
|
|
ImGui.render()
|
|
imGuiGl3.renderDrawData(ImGui.getDrawData())
|
|
|
|
if (ImGui.getIO().hasConfigFlags(ImGuiConfigFlags.ViewportsEnable)) {
|
|
val backupWindowPtr = GLFW.glfwGetCurrentContext()
|
|
ImGui.updatePlatformWindows()
|
|
ImGui.renderPlatformWindowsDefault()
|
|
GLFW.glfwMakeContextCurrent(backupWindowPtr)
|
|
}
|
|
}
|
|
|
|
override fun shouldPause() = false
|
|
}
|