Skip to content

Commit

Permalink
[OpenGL] Fix function alias
Browse files Browse the repository at this point in the history
  • Loading branch information
squid233 committed May 19, 2024
1 parent 4cfd9f0 commit 9277e69
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9277e69

Please sign in to comment.