https://kotlinlang.org logo
#kotlin-native
Title
# kotlin-native
k

Krystian

09/24/2023, 8:44 PM
Playing around with SDL2 on Mac and I wanted to see if I can get Metal working. I'm sort of stuck with how do I get
CAMetalLayer
out of SDL's internal function that returns it. But in CInterop it returns an
COpaquePointer
. The SDL function is
SDL_RenderGetMetalLayer
I've tried with
reinterpret
but it kept giving errors. How can I convert the returned
COpaquePointer
to be just
CAMetalLayer
that the function should return?
The function is https://wiki.libsdl.org/SDL2/SDL_RenderGetMetalLayer I tried to call this and ‘as CAMetalLayer’ but that resulted in device returning nil definitely not the way around it.
6 Views