SDL2 Android vulkan question

Danny Arends Danny.Arends at gmail.com
Sun May 2 17:44:32 UTC 2021


On Sunday, 2 May 2021 at 16:42:07 UTC, evilrat wrote:
> On Sunday, 2 May 2021 at 16:06:10 UTC, Danny Arends wrote:
>> On Sunday, 2 May 2021 at 12:35:51 UTC, evilrat wrote:
>>> As for SDL2, are you sure it was built with Vulkan support?
>>
>> That's the thing I worry about, since the SDL2 libraries are 
>> locally build using android studio and I'm kind of a noob in 
>> that.
>>
>
>
> Ok, since this is potentially the case, just to clarify, 
> building C/C++ with CMake for Android these days is basically 
> one extra parameter pointing to CMake toolchain file in your 
> local NDK location when configuring your build.
>
> https://developer.android.com/ndk/guides/cmake#file
>
> (from the docs)
> ```
> $ cmake \
>     
> -DCMAKE_TOOLCHAIN_FILE=$NDK/build/cmake/android.toolchain.cmake 
> \
>     -DANDROID_ABI=$ABI \
>     -DANDROID_NATIVE_API_LEVEL=$MINSDKVERSION \
>     $OTHER_ARGS
>
> ```
>
> Then I would probably use gradle for the rest of the process to 
> produce apk, including copy libraries step.

Thanks, but the APK builds fine, and installs. OpenGLES and SDL 
work like a charm, it's just the SDL_Vulkan_LoadLibrary call 
crashing. I think it might have to do with the bindbc-sdl 
dependency compiling with SDL_201 support, while Vulkan needs 
SDL_206 minimum. Even though I set SDL_2014 in DUB, it seems not 
to get picked up in some way.

I also found this: 
https://developer.android.com/guide/topics/manifest/uses-feature-element

So it might be the manifest needs to be updated as well.
A real puzzle,

Danny







More information about the Digitalmars-d-learn mailing list