Skip to content

Commit

Permalink
GLFW.java: add glfwExtensionSupported
Browse files Browse the repository at this point in the history
  • Loading branch information
khanhduytran0 committed Dec 6, 2022
1 parent a0cb1c0 commit 8556304
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions JavaApp/src/main/java/org/lwjgl/glfw/GLFW.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.lwjgl.system.*;
import org.lwjgl.system.macosx.*;

import static org.lwjgl.opengl.GL20.*;
import static org.lwjgl.system.APIUtil.*;
import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.JNI.*;
Expand Down Expand Up @@ -1393,4 +1394,10 @@ public static void glfwGetCursorPos(@NativeType("GLFWwindow *") long window, @Nu
xpos[0] = mGLFWCursorX;
ypos[0] = mGLFWCursorY;
}

public static boolean glfwExtensionSupported(String ext) {
//return Arrays.stream(glGetString(GL_EXTENSIONS).split(" ")).anyMatch(ext::equals);
// Fast path, but will return true if one has the same prefix
return glGetString(GL_EXTENSIONS).contains(ext);
}
}

0 comments on commit 8556304

Please sign in to comment.