• Igor Demin's avatar
    Fix crash on Windows machines without OpenGL (#811) · 2fac6861
    Igor Demin authored
    * Fix crash on Windows machines without OpenGL
    
    Some Windows CI machines don't contain OpenGL, so Skiko/Compose will crash on them. It shouldn't crash, it should fallback to Software rendering
    
    To properly fallback, we need to load opengl32.dll dynamically in runtime.
    
    Fixes https://github.com/JetBrains/compose-multiplatform/issues/3243
    
    # Test 1
    - `gradlew publishToMavenLocal` is successful (if we use functions directly, it fails with "error LNK2019: unresolved external symbol")
    - `SkiaLayerTest` is successful (it tests OpenGL as well)
    
    # Test 2
    1. Remove `C:\Windows\System32\opengl32.dll`
    2. `SkiaLayerTest` still should be successful, but logs should contain that it fallbacks to Software rendering.
    
    # Test 3
    1. Compile local skiko
    2. Run Compose run1 and tests
    
    * Refactor
    
    * Discussions
    
    * Discussions
    
    * Split throwJavaRenderException
    
    It isn't valid to use FormatMessage for code from GetLastError
    2fac6861
Name
Last commit
Last update
.github/workflows Loading commit data...
.run Loading commit data...
gradle/wrapper Loading commit data...
samples Loading commit data...
skiko Loading commit data...
.gitignore Loading commit data...
DEVELOPMENT.md Loading commit data...
LICENSE Loading commit data...
README.md Loading commit data...
gradle.properties Loading commit data...
gradlew Loading commit data...
gradlew.bat Loading commit data...
settings.gradle.kts Loading commit data...