Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to not throw RenderException when use OpenGL on macOS #915

Merged
merged 1 commit into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ internal actual fun loadOpenGLLibrary() {
Library.staticLoad()
loadOpenGLLibraryWindows()
}
// it was deprecated in macOS 10.14 and isn't supported in Skiko
// it was deprecated in macOS 10.14
// see https://developer.apple.com/library/archive/documentation/GraphicsImaging/Conceptual/OpenGL-MacProgGuide/opengl_intro/opengl_intro.html
hostOs.isMacOS -> throw RenderException("OpenGL on macOS isn't supported")
hostOs.isMacOS -> {
if (!SkikoProperties.macOsOpenGLEnabled) {
throw RenderException("OpenGL on macOS is deprecated. To enable its support, call System.setProperty(\"skiko.macos.opengl.enabled\", \"true\")")
}
}
// Do nothing as we don't know for sure which OS supports OpenGL.
// If there is support, we assume that it is already linked.
// If there is no support, there will be a native crash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ object SkikoProperties {
return value?.let(GpuPriority::parseOrNull) ?: GpuPriority.Auto
}

val macOsOpenGLEnabled: Boolean get() = getProperty("skiko.macos.opengl.enabled")?.toBoolean() ?: false

internal fun parseRenderApi(text: String?): GraphicsApi {
when(text) {
"SOFTWARE_COMPAT" -> return GraphicsApi.SOFTWARE_COMPAT
Expand Down
Loading