Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
dc2b265
Revert "revert gl renderer thing"
nextdayy Nov 30, 2025
7ed6a9d
Reapply "it works!"
nextdayy Nov 30, 2025
c3d4efa
polyui state v2 + GLRenderer fixes
nextdayy Nov 30, 2025
7ef695f
getting there!
nextdayy Dec 1, 2025
80316fc
fixed GLRenderer yay
nextdayy Dec 1, 2025
0bebd02
port fixes
nextdayy Dec 2, 2025
8c9339f
Merge branch 'v1' into state-v2-and-actually-use-glrenderer
Wyvest Dec 4, 2025
3482454
Fix 1.8 errors
Wyvest Dec 4, 2025
a1865d9
Disable blur everywhere
Wyvest Dec 4, 2025
4c4c052
bump textile and apiDump
Wyvest Dec 4, 2025
70e3917
add more disclaimers in TinyFD usage
Wyvest Dec 4, 2025
89304bd
cleanup and improve font rendering
nextdayy Dec 4, 2025
ca97ebb
drop shadow, improve font rendering when scale is used
nextdayy Dec 7, 2025
58a5fea
fix keying issues (fixes #591)
nextdayy Dec 7, 2025
c0f952a
fix crashes and radii issue
nextdayy Dec 8, 2025
fc1dd0f
fix scissoring on GLRenderer
nextdayy Dec 8, 2025
d72f971
dump
nextdayy Dec 8, 2025
03e0b25
Merge branch 'v1' into state-v2-and-actually-use-glrenderer
Wyvest Dec 9, 2025
62b7959
implement MC text with MC renderer, move Platform.screen().glViewport…
nextdayy Dec 9, 2025
1093ed5
Merge remote-tracking branch 'main/state-v2-and-actually-use-glrender…
nextdayy Dec 9, 2025
cc412aa
bump to 181
Wyvest Dec 10, 2025
8201602
updates and fixes
nextdayy Dec 10, 2025
2969f70
Merge remote-tracking branch 'main/state-v2-and-actually-use-glrender…
nextdayy Dec 10, 2025
954d814
fix transformation matrix
nextdayy Dec 10, 2025
91aedf6
Add 1.21.11 support and bump DGT
Deftu Dec 18, 2025
21dccd0
Bump to DGT revision 4
Deftu Dec 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ private val fabricApiModuleVersions = mapOf(
"api-base-12108" to "0.4.64+9ec45cd8f3", // 1.21.8
"api-base-12109" to "0.5.2+2fa446b294", // 1.21.9
"api-base-12110" to "1.0.0+14b92d8968", // 1.21.10
"api-base-12111" to "1.0.5+4ebb5c0853", // 1.21.11
"lifecycle-events-v1-common" to "1.1.0+2c3f108c81e6", // Common (Legacy Fabric API)
"lifecycle-events-v1-10809" to "1.1.0+1.8.9+2c3f108c81e6", // 1.8.9
"lifecycle-events-v1-11202" to "1.1.0+1.12.2+2c3f108c81e6", // 1.12.2
Expand All @@ -63,6 +64,7 @@ private val fabricApiModuleVersions = mapOf(
"lifecycle-events-v1-12108" to "2.6.3+db4dfd85f3", // 1.21.8
"lifecycle-events-v1-12109" to "2.6.8+33df5e6e94", // 1.21.9
"lifecycle-events-v1-12110" to "2.6.9+33df5e6e68", // 1.21.10
"lifecycle-events-v1-12111" to "2.6.15+4ebb5c0853", // 1.21.11
"keybindings-api-v1-common" to "1.1.1+281301ea81e6", // Common (Legacy Fabric API)
"keybindings-api-v1-10809" to "1.1.1+1.8.9+2c3f108c81e6", // 1.8.9
"keybindings-api-v1-11202" to "1.1.1+1.12.2+2c3f108c81e6", // 1.12.2
Expand All @@ -84,6 +86,7 @@ private val fabricApiModuleVersions = mapOf(
"key-binding-api-v1-12108" to "1.0.65+946bf4c3f3", // 1.21.8
"key-binding-api-v1-12109" to "1.1.0+4ec8267494", // 1.21.9
"key-binding-api-v1-12110" to "1.1.1+b3ba9c4868", // 1.21.10
"key-binding-api-v1-12111" to "1.1.7+4fc5413f53", // 1.21.11
"rendering-api-v1-common" to "1.0.0+7c545fdb81e6", // Common (Legacy Fabric API)
"rendering-api-v1-10809" to "1.0.0+1.8.9+2c3f108c81e6", // 1.8.9
"rendering-api-v1-11202" to "1.0.0+1.8.9+2c3f108c81e6", // 1.12.2
Expand All @@ -105,6 +108,7 @@ private val fabricApiModuleVersions = mapOf(
"rendering-v1-12108" to "12.4.0+e8d43c76f3", // 1.21.8
"rendering-v1-12109" to "15.0.2+9bce411b94", // 1.21.9
"rendering-v1-12110" to "16.0.1+328a75ba68", // 1.21.10
"rendering-v1-12111" to "16.2.5+1fb1cde953", // 1.21.11
"screen-api-v1-11605" to "1.0.1+3cc0f0907d", // 1.16.5
"screen-api-v1-11701" to "1.0.5+cf39a74318", // 1.17.1
"screen-api-v1-11802" to "1.0.11+d882b91560", // 1.18.2
Expand All @@ -123,6 +127,7 @@ private val fabricApiModuleVersions = mapOf(
"screen-api-v1-12108" to "2.1.0+277ecf7df3", // 1.21.8
"screen-api-v1-12109" to "3.0.2+86b3ae5794", // 1.21.9
"screen-api-v1-12110" to "3.1.0+9c82a79868", // 1.21.10
"screen-api-v1-12111" to "3.1.7+4ebb5c0853", // 1.21.11
"command-api-v1-11605" to "1.1.3+3cc0f0907d", // 1.16.5
"command-api-v1-11701" to "1.1.4+cf39a74318", // 1.17.1
"command-api-v1-11802" to "1.1.10+d7c144a860", // 1.18.2
Expand All @@ -141,6 +146,7 @@ private val fabricApiModuleVersions = mapOf(
"command-api-v2-12108" to "2.2.53+946bf4c3f3", // 1.21.8
"command-api-v2-12109" to "2.3.5+33df5e6e94", // 1.21.9
"command-api-v2-12110" to "2.3.7+328a75ba68", // 1.21.10
"command-api-v2-12111" to "2.4.6+4ebb5c0853", // 1.21.11
"transitive-access-wideners-v1-11802" to "1.1.0+e747827960", // 1.18.2
"transitive-access-wideners-v1-11902" to "1.3.3+08b73de490", // 1.19.2
"transitive-access-wideners-v1-11904" to "3.3.0+1b5f819af4", // 1.19.4
Expand All @@ -157,6 +163,7 @@ private val fabricApiModuleVersions = mapOf(
"transitive-access-wideners-v1-12108" to "6.4.1+ac3e15d1f3", // 1.21.8
"transitive-access-wideners-v1-12109" to "6.5.2+5d9dbead94", // 1.21.9
"transitive-access-wideners-v1-12110" to "6.5.3+41eb434368", // 1.21.10
"transitive-access-wideners-v1-12111" to "7.0.7+1fb1cde953", // 1.21.11
)

/**
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ ksp.incremental=false

dgt.java.version=8
dgt.loom.mappings=official-like
dgt.minecraft.revision=3
dgt.minecraft.revision=4

# Project Configuration
project.group=org.polyfrost.oneconfig
project.name=OneConfig
project.version=1.0.0-alpha.180
project.version=1.0.0-alpha.181
8 changes: 4 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ kotlinx-coroutines = "1.10.2"
kotlinx-atomicfu = "0.29.0"
fabric-language-kotlin = "1.13.5+kotlin.2.2.10"
google-ksp = "2.2.10-2.0.2"
polyui = "1.15.2"
polyui = "2.0.7"
annotations = "24.1.0"
hypixel-modapi = "1.0.1"
hypixel-data = "0.2.0" # Dep of hypixel-modapi
Expand All @@ -21,8 +21,8 @@ copycat = "0.1.3"
copycat-image-awt = "0.1.1"

# Per version
textile = "1.0.0-beta.8"
omnicore = "1.0.0-beta.38"
textile = "1.0.0-beta.11"
omnicore = "1.0.0-beta.40"
lwjgl = "3.3.3" # All downloaded by the isolated-lwjgl3-loader

# Legacy only
Expand All @@ -35,7 +35,7 @@ brigadier = "1.0.18"
oneconfig-loader = "1.1.0-alpha.48"

# Gradle
dgt = "2.62.0"
dgt = "2.69.0"
kotlinx-abi = "0.18.1"
licenser = "2.1.1"
jetbrains-idea-ext = "1.3"
Expand Down
11 changes: 8 additions & 3 deletions minecraft/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ if (mcData.isForge) {
toolkitLoomHelper {
disableRunConfigs(GameSide.SERVER)

useDevAuth("+")
if (mcData.version < MinecraftVersions.VERSION_1_21_11) {
useDevAuth("+")
}

useProperty("mixin.debug.export", "true", GameSide.CLIENT)
useProperty("debugBytecode", "true", GameSide.CLIENT)
Expand Down Expand Up @@ -207,7 +209,8 @@ dependencies {
rconfig("1.21.7", "3.7.2"),
rconfig("1.21.8", "3.7.2", "1.21.7"),
rconfig("1.21.9", "3.9.1"),
rconfig("1.21.10", "3.9.1", "1.21.9")
rconfig("1.21.10", "3.9.1", "1.21.9"),
rconfig("1.21.11", "3.9.1", "1.21.9"),
)

compileOnlyCompat(rconfig[mcVersionString])
Expand Down Expand Up @@ -249,7 +252,8 @@ dependencies {
yacl("1.21.7", "3.7.1", "1.21.6"),
yacl("1.21.8", "3.7.1", "1.21.6"),
yacl("1.21.9", "3.8.0", "1.21.6"),
yacl("1.21.10", "3.8.0", "1.21.9")
yacl("1.21.10", "3.8.0", "1.21.9"),
yacl("1.21.11", "3.8.0", "1.21.9"),
)
compileOnlyCompat(yacl[mcVersionString])

Expand All @@ -274,6 +278,7 @@ dependencies {
modMenu("1.21.7", "15.0.0-beta.3"),
modMenu("1.21.8", "15.0.0-beta.3"),
modMenu("1.21.10", "16.0.0-rc.1"),
modMenu("1.21.11", "17.0.0-alpha.1"),
)
compileOnlyCompat(modMenu[mcVersionString])

Expand Down
46 changes: 25 additions & 21 deletions minecraft/root.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,31 @@ preprocess {
strictExtraMappings.set(true)
// FOR ALL NEW VERSIONS ENSURE TO UPDATE settings.gradle.kts !

"1.21.10-neoforge"(1_21_10, "srg") {
"1.21.10-fabric"(1_21_10, "srg") {
"1.21.8-fabric"(1_21_08, "srg") {
"1.21.8-neoforge"(1_21_08, "srg") {
"1.21.5-neoforge"(1_21_05, "srg") {
"1.21.5-fabric"(1_21_05, "srg") {
"1.21.4-fabric"(1_21_04, "srg") {
"1.21.4-neoforge"(1_21_04, "srg") {
"1.21.1-neoforge"(1_21_01, "srg", file("mappings/1.21.4-forge+1.21.1-forge.txt")) {
"1.21.1-fabric"(1_21_01, "srg") {
"1.20.4-fabric"(1_20_04, "srg") {
"1.20.4-neoforge"(1_20_04, "srg") {
"1.20.4-forge"(1_20_04, "srg") {
"1.20.1-forge"(1_20_01, "srg", file("mappings/1.20.4-forge+1.20.1-forge.txt")) {
"1.20.1-fabric"(1_20_01, "srg") {
"1.16.5-fabric"(1_16_05, "srg", file("mappings/1.20.1-fabric+1.16.5-fabric.txt")) {
"1.16.5-forge"(1_16_05, "srg") {
"1.12.2-forge"(1_12_02, "srg", file("mappings/1.16.5-forge+1.12.2-forge.txt")) {
"1.12.2-fabric"(1_12_02, "srg") {
"1.8.9-fabric"(1_08_09, "srg") {
"1.8.9-forge"(1_08_09, "srg")
"1.21.11-fabric"(1_21_11, "srg") {
"1.21.11-neoforge"(1_21_11, "srg") {
"1.21.10-neoforge"(1_21_10, "srg") {
"1.21.10-fabric"(1_21_10, "srg") {
"1.21.8-fabric"(1_21_08, "srg") {
"1.21.8-neoforge"(1_21_08, "srg") {
"1.21.5-neoforge"(1_21_05, "srg") {
"1.21.5-fabric"(1_21_05, "srg") {
"1.21.4-fabric"(1_21_04, "srg") {
"1.21.4-neoforge"(1_21_04, "srg") {
"1.21.1-neoforge"(1_21_01, "srg", file("mappings/1.21.4-forge+1.21.1-forge.txt")) {
"1.21.1-fabric"(1_21_01, "srg") {
"1.20.4-fabric"(1_20_04, "srg") {
"1.20.4-neoforge"(1_20_04, "srg") {
"1.20.4-forge"(1_20_04, "srg") {
"1.20.1-forge"(1_20_01, "srg", file("mappings/1.20.4-forge+1.20.1-forge.txt")) {
"1.20.1-fabric"(1_20_01, "srg") {
"1.16.5-fabric"(1_16_05, "srg", file("mappings/1.20.1-fabric+1.16.5-fabric.txt")) {
"1.16.5-forge"(1_16_05, "srg") {
"1.12.2-forge"(1_12_02, "srg", file("mappings/1.16.5-forge+1.12.2-forge.txt")) {
"1.12.2-fabric"(1_12_02, "srg") {
"1.8.9-fabric"(1_08_09, "srg") {
"1.8.9-forge"(1_08_09, "srg")
}
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,17 @@
package org.polyfrost.oneconfig.api.platform.v1.internal;

import dev.deftu.omnicore.api.client.render.state.OmniRenderStates;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.lwjgl.BufferUtils;
import org.polyfrost.oneconfig.api.platform.v1.GLPlatform;
import org.polyfrost.oneconfig.utils.v1.MHUtils;

import java.nio.Buffer;
import java.nio.IntBuffer;

import static org.lwjgl.opengl.GL11.*;

public class GLPlatformImpl implements GLPlatform {
//@formatter:off
//#if MC <= 1.12.2
Expand All @@ -38,6 +46,14 @@ public class GLPlatformImpl implements GLPlatform {
.logIfErr().getOrElse(v -> 0L);
//#endif

private final IntBuffer VIEWPORT = BufferUtils.createIntBuffer(
//#if MC >= 1.13
//$$ 4
//#else
16
//#endif
);

@Override
public long getFunctionAddress(String addr) {
//#if MC <= 1.12.2
Expand All @@ -53,7 +69,7 @@ public long getFunctionAddress(String addr) {
* to match what NanoVG leaves dropped into the OpenGL context.
*/
@Override
public void updateGameRenderStateAlongsideNanoVG() {
public void syncOpenGLContext() {
OmniRenderStates.syncBlend();
OmniRenderStates.syncDepth();
OmniRenderStates.syncCull();
Expand All @@ -63,4 +79,17 @@ public void updateGameRenderStateAlongsideNanoVG() {
//$$ com.mojang.blaze3d.vertex.BufferUploader.reset();
//#endif
}

@Override
public int @NotNull [] glViewport(int @Nullable [] in) {
((Buffer) VIEWPORT).clear();
//#if MC >= 1.13
//$$ glGetIntegerv(GL_VIEWPORT, VIEWPORT);
//#else
glGetInteger(GL_VIEWPORT, VIEWPORT);
//#endif
int[] out = in != null ? in : new int[4];
VIEWPORT.get(out, 0, 4);
return out;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,11 @@

package org.polyfrost.oneconfig.api.platform.v1.internal;

import dev.deftu.omnicore.api.client.render.OmniRenderingContext;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import org.jetbrains.annotations.Nullable;
import org.polyfrost.oneconfig.api.event.v1.EventDelay;
import org.polyfrost.oneconfig.api.hud.v1.LegacyHud;
import org.polyfrost.oneconfig.api.platform.v1.ScreenPlatform;
import org.polyfrost.oneconfig.api.ui.v1.UIManager;
import org.polyfrost.polyui.PolyUI;
import org.polyfrost.polyui.component.Component;
import org.polyfrost.polyui.component.Drawable;

import java.util.List;

public class ScreenPlatformImpl implements ScreenPlatform {
// //#if MC > 1.13
Expand Down Expand Up @@ -81,18 +73,6 @@ public int windowHeight() {
//#endif
}

public void renderLegacyHuds(OmniRenderingContext ctx) {
PolyUI defaultInstance = UIManager.INSTANCE.getDefaultInstance();
Drawable master = defaultInstance.getMaster();
List<Component> children = master.getChildren();
if (children == null || children.isEmpty()) return;

for (Component child : children) {
if (!(child instanceof LegacyHud.LegacyHudComponent)) continue;
((LegacyHud.LegacyHudComponent) child).renderLegacy(ctx);
}
}

// todo: https://github.com/Polyfrost/OneConfig/issues/478
// this override was removed to avoid the system receiving incorrect/inaccurate pixel ratio values
// while the window was being resized (as it was calculated based on viewport / window size)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,21 @@
import dev.deftu.omnicore.api.client.render.GlCapabilities;
import dev.deftu.omnicore.api.client.render.pipeline.OmniRenderPipeline;
import dev.deftu.omnicore.api.client.render.pipeline.OmniRenderPipelines;
import dev.deftu.omnicore.api.client.render.OmniRenderingContext;
import dev.deftu.omnicore.api.client.render.state.OmniBlendState;
import dev.deftu.omnicore.api.client.screen.OmniScreen;
import net.minecraft.client.Minecraft;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.polyfrost.oneconfig.api.ClassHasOverwrites;
import org.polyfrost.oneconfig.api.ui.v1.api.NanoSvgApi;
import org.polyfrost.oneconfig.api.ui.v1.api.NanoVgApi;
import org.polyfrost.oneconfig.api.ui.v1.api.StbApi;
import org.polyfrost.oneconfig.api.ui.v1.api.TinyFdApi;
import org.polyfrost.oneconfig.api.ui.v1.api.*;
import org.polyfrost.oneconfig.api.ui.v1.UIManager;
import org.polyfrost.oneconfig.api.ui.v1.internal.wrappers.MCWindow;
import org.polyfrost.oneconfig.api.ui.v1.internal.wrappers.PolyUIScreen;
import org.polyfrost.polyui.PolyUI;
import org.polyfrost.polyui.data.Font;
import org.polyfrost.polyui.renderer.Renderer;
import org.polyfrost.polyui.renderer.Window;

Expand All @@ -69,15 +69,18 @@ public class UIManagerImpl implements UIManager {
private static final String LWJGL_API_PACKAGE = "org.polyfrost.oneconfig.api.ui.v1.api.";
private static final String LWJGL_IMPL_PACKAGE = "org.polyfrost.oneconfig.api.ui.v1.internal.";

private static final Font MC_FONT = Font.of("minecraft/assets/fonts/nowhere", null, false, Font.Weight.Regular);

private static final Logger LOGGER = LogManager.getLogger("OneConfig/LWJGL");

private PolyUI ui;
private OmniRenderPipeline pipeline;
private OmniRenderingContext ctx;

private final Set<String> classLoaderInclude = new HashSet<>();
private final Map<String, Class<?>> classCache = new HashMap<>();

private final NanoVgApi nanoVg;
// private final NanoVgApi nanoVg;
private final NanoSvgApi nanoSvg;
private final StbApi stb;
private final TinyFdApi tinyFD;
Expand Down Expand Up @@ -116,24 +119,29 @@ public UIManagerImpl() throws Throwable {
boolean isGl3 = GlCapabilities.isGl3Available();

//#if MC >= 1.16.5
//$$ nanoVg = new NanoVgImpl(isGl3);
// //$$ nanoVg = new NanoVgImpl(isGl3);
//$$ nanoSvg = new NanoSvgImpl();
//$$ stb = new StbImpl();
//$$ tinyFD = new TinyFdImpl();
//#else
nanoVg = Lwjgl3Manager.getIsolated(NanoVgApi.class, LWJGL_IMPL_PACKAGE + "NanoVgImpl", isGl3);
// nanoVg = Lwjgl3Manager.getIsolated(NanoVgApi.class, LWJGL_IMPL_PACKAGE + "NanoVgImpl", isGl3);
nanoSvg = Lwjgl3Manager.getIsolated(NanoSvgApi.class, LWJGL_IMPL_PACKAGE + "NanoSvgImpl");
stb = Lwjgl3Manager.getIsolated(StbApi.class, LWJGL_IMPL_PACKAGE + "StbImpl");
tinyFD = Lwjgl3Manager.getIsolated(TinyFdApi.class, LWJGL_IMPL_PACKAGE + "TinyFdImpl");
//#endif

renderer = new NVGRendererImpl(isGl3, nanoVg, nanoSvg, stb);
// renderer = new GLRendererImpl(nanoSvg, stb);
// renderer = new NVGRendererImpl(isGl3, nanoVg, nanoSvg, stb);
renderer = new GLRendererImpl(nanoSvg, stb);
} catch (Exception e) {
throw new RuntimeException("Failed to get valid rendering implementation", e);
}
}

@Override
public @Nullable RendererExt getRendererExt() {
return (renderer instanceof RendererExt ? (RendererExt) renderer : null);
}

@Override
public Renderer getRenderer() {
return renderer;
Expand Down Expand Up @@ -170,4 +178,19 @@ public OmniRenderPipeline getRenderPipeline() {

return pipeline;
}

@Override
public void __setRenderingContext(OmniRenderingContext renderingContext) {
ctx = renderingContext;
}

@Override
public OmniRenderingContext getRenderingContext() {
return ctx;
}

@Override
public Font getMCFont() {
return MC_FONT;
}
}
Loading