SDL2 Android vulkan question

Danny Arends Danny.Arends at gmail.com
Sun May 2 16:06:10 UTC 2021


On Sunday, 2 May 2021 at 12:35:51 UTC, evilrat wrote:
> On Sunday, 2 May 2021 at 08:58:30 UTC, Danny Arends wrote:
>
>> Any thoughts on why loading the Vulkan library using SDL2 
>> would not work ?
>> thoughts in general about the process ?
>
> Just few tips.
> GC "crashes" since you have custom main, D default main has 
> runtime initialization code so it "just works", in you custom 
> main function try to do this before any call to D code.
>
> https://dlang.org/phobos/core_runtime.html#.Runtime.initialize
>
> ```d
> extern(C) main()
> {
>     import core.runtime;
>     Runtime.initialize();
>     scope(exit)
>       Runtime.terminate();
> }
> ```
>

Yeah, I just use the rt_init() and disable it, no real issue. 
Most of the code is @nogc code anyway.

> 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.

I use the provided android_project (from the sdl zip) and make 
symbolic links in the app/jni folder to:

SDL, SDL2_Image, SDL2_Mixer, Etc

I delete the creation of the libmain.so by removing the src/ 
folder

> Do you have any other Vulkan apps to test if it actually 
> supported by your device?

It's android 10 so it should be, but I could try creating a c 
minimal example in vulkan, although that's gonna be 500 LoC as 
well.



More information about the Digitalmars-d-learn mailing list