SDL support on Focal with Clickable
-
Is there any plans to have a SDL template in Clickable ? I want to port games that use SDL to Ubuntu Touch, but right now it's hard to make SDL work.
When I try making a simple SDL app with SDL2 as a dependency, it opens a new X11 window and it crashes about half of the time. When I try compiling SDL3 for Wayland support, it works well but I have to compile SDL3 myself and it has many dependencies so I have to install SDL2 to have all the dependencies available and I have to install the library in the click package.
It would help a lot if Clickable can create a basic template to get started.
-
@Plarde At the moment you seem to be the resident SDL expert, seeing you can get something working with SDL3 and Wayland support. I have not heard of anyone getting that far.
So maybe you could make a minimum working project that works, and offer that as a template to be included?MR's for new templates can be made to here.
-
As far as I know, SDL2 has mirclient support but it was dropped so there's a specific build for UT that some apps/games use. If I am not mistaken there are a few SDL and Godot that use this. Try to check Circle Jump. Perhaps SDL3 would indeed be better since it supports wayland.
-
That surprises me though, because I think even the old SDL2 version that used to support Mir before that extension was dropped did contain Wayland support. Can the current Mir version we have actually work with Wayland or is it all XMir? I thought the later but maybe not in which case we could then probably use every SDL version there is.
This SDL2 working with XMir vs SDL3 running directly though Wayland is a bit confusing to me.
-
@arubislander I just use the C++ template and remove all the QML and C++ stuff, then I add the SDL3 source code and add it in CMakeLists.txt with add_subdirectory(SDL3). Then I can use SDL normally in a C or C++ file.
My solution is janky and not very clean and I don't know how to make a template, where can I ask questions about best practices? I saw that Clickable can add a PPA, so I think the easiest solution would be to manage SDL3 in a PPA and use that. Else I have to put all of SDL source code inside the template or make CMake download it at build time somehow.
-
@Plarde I think the best place to ask is the App Dev channel on Telegram.
Does the SDL3 source come from a git repository somewhere? In that case you could configure a git submodule so that you don't have to include the source in the template.