Skip to content

Commit 02d97bf

Browse files
committed
al;l of the stuff is worky hooray
1 parent cdafb2b commit 02d97bf

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ kotlinx-coroutines = "1.10.2"
77
kotlinx-atomicfu = "0.29.0"
88
fabric-language-kotlin = "1.13.8+kotlin.2.3.0"
99
google-ksp = "2.2.10-2.0.2"
10-
polyui = "2.0.7"
10+
polyui = "2.1.1"
1111
annotations = "24.1.0"
1212
hypixel-modapi = "1.0.1"
1313
hypixel-data = "0.2.0" # Dep of hypixel-modapi

modules/ui/src/main/java/org/polyfrost/oneconfig/api/ui/v1/UIManager.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
import org.polyfrost.polyui.data.Font;
6060
import org.polyfrost.polyui.renderer.Renderer;
6161
import org.polyfrost.polyui.renderer.Window;
62+
import org.polyfrost.polyui.unit.Vec2;
6263

6364
import java.util.ServiceLoader;
6465
import java.util.function.Consumer;
@@ -190,7 +191,12 @@ default PolyUI createDefault() {
190191
EventManager.register(ResizeEvent.class, event -> {
191192
float ratio = Platform.screen().pixelRatio();
192193
polyUI.resize(event.newWidth, event.newHeight, false);
193-
framebuffer.resize((int) (polyUI.getMaster().getWidth() * ratio), (int) (polyUI.getMaster().getHeight() * ratio));
194+
195+
long visibleSize = polyUI.getVisibleSize();
196+
int polyUiWidth = (int) Vec2.getX(visibleSize);
197+
int polyUiHeight = (int) Vec2.getY(visibleSize);
198+
System.out.println("Resizing to: " + polyUiWidth + "x" + polyUiHeight + " with ratio " + ratio);
199+
framebuffer.resize(polyUiWidth, polyUiHeight);
194200
polyUI.getWindow().setPixelRatio(ratio);
195201
});
196202

modules/ui/src/main/kotlin/org/polyfrost/oneconfig/api/ui/v1/internal/GLRendererImpl.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import org.lwjgl.opengl.GL13.*
1616
import org.lwjgl.opengl.GL14.*
1717
import org.lwjgl.opengl.GL15.*
1818
import org.lwjgl.opengl.GL20.*
19+
import org.lwjgl.opengl.GL33.glBindSampler
1920
import org.polyfrost.oneconfig.api.platform.v1.Platform
2021
import org.polyfrost.oneconfig.api.ui.v1.UIManager
2122
import org.polyfrost.oneconfig.api.ui.v1.api.NanoSvgApi
@@ -502,6 +503,7 @@ class GLRendererImpl(private val nsvg: NanoSvgApi, private val stb: StbApi) : Re
502503

503504
glActiveTexture(GL_TEXTURE0)
504505
glBindTexture(GL_TEXTURE_2D, atlas)
506+
glBindSampler(0, 0)
505507

506508
// asm: on VAO the state is stored, so we only need to set it up once
507509
if (!GlCapabilities.isGl3Available) {

0 commit comments

Comments
 (0)