I’m trying to port a game built using SDL2 to Sailfish OS. So far, most things are working, but I’m having a few issues so I thought I’d post them over here, maybe other people might know how to solve these.
First of all, the sound is being problematic. The game uses SDL2 to play back sound, but it completely ignores the system volume and plays back on full volume. A port of TuxRacer to SailfishOS has exactly the same problem. When the application runs on a Linux desktop, it respects the system volume as it should. Is there some additional code needed for Sailfish OS?
Another issue I have is with the screen rotation. The game I’m porting is best played in landscape mode, is there a nice way to have SDL or the compositor to render the window in a landscape orientation or should I modify the game itself to render with an angle of 90 degrees? All I could find is
SDL_SetHint(SDL_HINT_QTWAYLAND_CONTENT_ORIENTATION, "landscape");, which tells the compositor the window is in landscape and it will move the top menu and swipe gestures to the right locations, but it does not rotate the window.
Touch input is broken as well, but I suspect that probably is due to the game not handling touch input properly in general. Edit: it seems that the touch coordinates are not ranging from 0.0 to 1.0 on both the X-axis and Y-axis as the game seems to expect.