From 9277e69a0da1a2106892c480f73473f892c7d041 Mon Sep 17 00:00:00 2001 From: squid233 <60126026+squid233@users.noreply.github.com> Date: Sun, 19 May 2024 16:05:22 +0800 Subject: [PATCH] [OpenGL] Fix function alias --- .../src/main/java/overrungl/opengl/GLAliasResolver.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLAliasResolver.java b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLAliasResolver.java index 92375613..569de60f 100644 --- a/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLAliasResolver.java +++ b/modules/overrungl.opengl/src/main/java/overrungl/opengl/GLAliasResolver.java @@ -899,14 +899,15 @@ static MemorySegment resolve(GLLoadFunc load, String name) { case "glWindowPos3sv" -> resolve(load, name, "glWindowPos3svARB", "glWindowPos3svMESA"); case "glWindowPos3svARB" -> resolve(load, name, "glWindowPos3sv", "glWindowPos3svMESA"); case "glWindowPos3svMESA" -> resolve(load, name, "glWindowPos3sv", "glWindowPos3svARB"); - case null, default -> MemorySegment.NULL; + case null -> MemorySegment.NULL; + default -> load.invoke(name); }; } private static MemorySegment resolve(GLLoadFunc load, String name, String... aliases) { final MemorySegment segment = load.invoke(name); if (!Unmarshal.isNullPointer(segment)) { - return MemorySegment.NULL; + return segment; } for (String alias : aliases) { final MemorySegment aliasSeg = load.invoke(alias);