GLFW.java: add glfwExtensionSupported

This commit is contained in:
Duy Tran Khanh committed 2022-12-06 18:41:09 +07:00
1 parent a0cb1c0789
commit 85563047a8
1 file changed
+7
@@ -17,6 +17,7 @@ import org.lwjgl.*;
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 @@ return false;
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);
}
}