{"action":"created","issue":{"url":"https://api.github.com/repos/postmarketOS/osk-sdl/issues/78","repository_url":"https://api.github.com/repos/postmarketOS/osk-sdl","labels_url":"https://api.github.com/repos/postmarketOS/osk-sdl/issues/78/labels{/name}","comments_url":"https://api.github.com/repos/postmarketOS/osk-sdl/issues/78/comments","events_url":"https://api.github.com/repos/postmarketOS/osk-sdl/issues/78/events","html_url":"https://github.com/postmarketOS/osk-sdl/pull/78","id":310329365,"number":78,"title":"Fix Makefile; replace surface by renderer API","user":{"login":"michitux","id":198317,"avatar_url":"https://avatars3.githubusercontent.com/u/198317?v=4","gravatar_id":"","url":"https://api.github.com/users/michitux","html_url":"https://github.com/michitux","followers_url":"https://api.github.com/users/michitux/followers","following_url":"https://api.github.com/users/michitux/following{/other_user}","gists_url":"https://api.github.com/users/michitux/gists{/gist_id}","starred_url":"https://api.github.com/users/michitux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michitux/subscriptions","organizations_url":"https://api.github.com/users/michitux/orgs","repos_url":"https://api.github.com/users/michitux/repos","events_url":"https://api.github.com/users/michitux/events{/privacy}","received_events_url":"https://api.github.com/users/michitux/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-01T14:54:50Z","updated_at":"2018-04-02T00:24:19Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/postmarketOS/osk-sdl/pulls/78","html_url":"https://github.com/postmarketOS/osk-sdl/pull/78","diff_url":"https://github.com/postmarketOS/osk-sdl/pull/78.diff","patch_url":"https://github.com/postmarketOS/osk-sdl/pull/78.patch"},"body":"This contains one major and two small fixes (please tell me if you want separate PRs):\r\n\r\n* In the Makefile, the `{obj,bin}` notation did not work under Alpine Linux which lead to a failing build. This replaces it by two lines.\r\n* According to the documentation of [SDL_GetWindowSurface](https://wiki.libsdl.org/SDL_GetWindowSurface), the surface API and the renderer API must not be used at the same time. For me, this lead to errors because the function to create a renderer was called twice on the same window and the second call failed. I have fixed this by replacing the use of the surface API by the renderer API. This only concerns drawing the background which was trivial to replace.\r\n* I do not see the advantage of using the software renderer when a hardware renderer like DirectFB is available. For me, the hint to use software rendering leads to having two renderers initialized: directfb and software. Removing the hint, the software renderer seems to not be used anymore. Unfortunately, the DirectFB renderer is not in the renderer list by default. This needs the following patch to SDL2:\r\n\r\n```patch\r\ndiff --git a/src/render/SDL_render.c b/src/render/SDL_render.c\r\nindex 8cd3a7b..eacc7e2 100644\r\n--- a/src/render/SDL_render.c\r\n+++ b/src/render/SDL_render.c\r\n@@ -89,9 +89,7 @@ static const SDL_RenderDriver *render_drivers[] = {\r\n #if SDL_VIDEO_RENDER_OGL_ES\r\n     &GLES_RenderDriver,\r\n #endif\r\n-#if SDL_VIDEO_RENDER_DIRECTFB\r\n     &DirectFB_RenderDriver,\r\n-#endif\r\n #if SDL_VIDEO_RENDER_METAL\r\n     &METAL_RenderDriver,\r\n #endif\r\n```\r\n\r\nUnfortunately, I couldn't figure out how to initialize the `DirectFB_RenderDriver` on my device (Samsung Note 8.0 (WiFi) n5110) without that patch. Unfortunately, there is also no way to set this define using the configure script (there are flags for some of the other renderers). If you don't have a better idea I would suggest to try to either get this patch into the Alpine package or alternatively to try to upstream a change that adds a flag to cleanly enable it using the configure script. Note that the directfb renderer is always compiled when directfb is enabled, it is only missing from the list of renderer drivers. Manually e.g. setting it e.g. as first item of the array using gdb also works."},"comment":{"url":"https://api.github.com/repos/postmarketOS/osk-sdl/issues/comments/377828416","html_url":"https://github.com/postmarketOS/osk-sdl/pull/78#issuecomment-377828416","issue_url":"https://api.github.com/repos/postmarketOS/osk-sdl/issues/78","id":377828416,"user":{"login":"ollieparanoid","id":6033024,"avatar_url":"https://avatars1.githubusercontent.com/u/6033024?v=4","gravatar_id":"","url":"https://api.github.com/users/ollieparanoid","html_url":"https://github.com/ollieparanoid","followers_url":"https://api.github.com/users/ollieparanoid/followers","following_url":"https://api.github.com/users/ollieparanoid/following{/other_user}","gists_url":"https://api.github.com/users/ollieparanoid/gists{/gist_id}","starred_url":"https://api.github.com/users/ollieparanoid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ollieparanoid/subscriptions","organizations_url":"https://api.github.com/users/ollieparanoid/orgs","repos_url":"https://api.github.com/users/ollieparanoid/repos","events_url":"https://api.github.com/users/ollieparanoid/events{/privacy}","received_events_url":"https://api.github.com/users/ollieparanoid/received_events","type":"User","site_admin":false},"created_at":"2018-04-02T00:24:19Z","updated_at":"2018-04-02T00:24:19Z","author_association":"OWNER","body":"> Note that the directfb renderer is always compiled when directfb is enabled, it is only missing from the list of renderer drivers.\r\n\r\nThis sounds like an upstream bug in SDL2 then. Could you send a patch to SDL2?\r\n\r\nThe changes look good, and your explanations make sense. I think we should test this on a device where `osk-sdl` is already working though, just to make sure we don't have any regression. I'll probably be able to test this myself tomorrow (but if someone can do it before me, I would not mind at all :wink:).\r\n\r\nThanks for this amazing work @michitux! \\o/"}}
{"actor":{"display_login":"ollieparanoid"}}