From 85563047a854445b1a16d794045d4c7d49b7abbd Mon Sep 17 00:00:00 2001 From: Duy Tran Khanh Date: Tue, 6 Dec 2022 18:41:09 +0700 Subject: [PATCH] GLFW.java: add glfwExtensionSupported --- JavaApp/src/main/java/org/lwjgl/glfw/GLFW.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/JavaApp/src/main/java/org/lwjgl/glfw/GLFW.java b/JavaApp/src/main/java/org/lwjgl/glfw/GLFW.java index b3a8a7c34f..791a7bd96f 100644 --- a/JavaApp/src/main/java/org/lwjgl/glfw/GLFW.java +++ b/JavaApp/src/main/java/org/lwjgl/glfw/GLFW.java @@ -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.*; @@ -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); + } }