GLFW.java: add glfwExtensionSupported

This commit is contained in:
Duy Tran Khanh 2022-12-06 18:41:21 +07:00 committed by GitHub
parent ef36c96edc
commit ebb69fd554
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,6 +14,7 @@ import javax.annotation.*;
import org.lwjgl.*;
import org.lwjgl.system.*;
import static org.lwjgl.opengl.GL20.*;
import static org.lwjgl.system.APIUtil.*;
import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.JNI.*;
@ -1418,4 +1419,10 @@ public class GLFW
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);
}
}