BGRABitmap Thread Problem in Android lazarus / 39-Graphics ---------------------------------------------------------------------- mercury · 2017-08-17 03:52 Using BGRABitmap to load png file and SDL for display. Everything is good with or without thread on Windows. But with thread on Android, only get a whole black bitmap. Both emulator and real device show the same result. Please help. Tools: FPC 3.0.2 BGRABitmap 9.5 Binutils 2.24.90 SDL 2.0.5 ---------------------------------------------------------------------- mercury · 2017-08-17 03:53 source code here ---------------------------------------------------------------------- DonAlfredo · 2017-08-17 08:57 Would you mind also make the libSDL2.a (and libSDL2.so for dynamic linking) available ? I tried your app (with some SDL2 libs found on the I-net) on my Samsung S3. Did not work. But also did not crash or error out ! ---------------------------------------------------------------------- mercury · 2017-08-18 08:57 Quote from: DonAlfredo on August 17, 2017, 10:57:19 amWould you mind also make the libSDL2.a (and libSDL2.so for dynamic linking) available ? It’s not so hard to compile SDL for android. Download NDK and run ndk-build in SDL source code directory. Even no need configure (which always get really annoying problem). NDK : https://developer.android.com/ndk/downloads/index.html SDL : https://libsdl.org/release/SDL2-2.0.5.tar.gz Quote from: DonAlfredo on August 17, 2017, 10:57:19 amI tried your app (with some SDL2 libs found on the I-net) on my Samsung S3. Did not work. But also did not crash or error out ! What is I-net? If you don’t want to use adb on your phone, you can check app.log in SDCard root directory. Anyway, here is the lib I compiled, include armeabi, armeabi-v7a and x86. Don’t download them all, three mirrors are the same. https://bdupload.info/segx2ih44ico https://uploadocean.com/25akurfhuw6w https://www.sendspace.com/file/ta5c6q ---------------------------------------------------------------------- DonAlfredo · 2017-08-18 09:50 I-net = Internet  I know that its not that hard to compile. I just want to use what you are using. The less differences there are between our setups, the more likely an error is also shared between us. Another question. When compiling for Windows, compilation failed due to linking errors. I solved them by adding some standard functions from here: https://github.com/BeRo1985/pasvulkan/blob/master/src/PasVulkan.Static Linking.pas I was wondering if the archive you included with your first post compiles out-of-the-box on your system for Windows ? If not, please include a fully functional project. Again, to prevent differences between our setups. Thanks. ---------------------------------------------------------------------- mercury · 2017-08-18 11:55 Quote from: DonAlfredo on August 18, 2017, 11:50:08 amI-net = Internet  Is this abbreviate really used commonly? Quote from: DonAlfredo on August 18, 2017, 11:50:08 amWhen compiling for Windows, compilation failed due to linking errors. I solved them by adding some standard functions from here: https://github.com/BeRo1985/pasvulkan/blob/master/src/PasVulkan.Static Linking.pas I was wondering if the archive you included with your first post compiles out-of-the-box on your system for Windows ? If not, please include a fully functional project. Again, to prevent differences between our setups. Maybe you used a different compiler (change the static linked libs to fit compile you used should work). What I used is download from here: https://sourceforge.net/projects/mingw-w64/files/Toolchains targetting Win32/Personal Builds/mingw-builds/4.9.3/threads-posix/dwarf/ The source code I uploaded is fully functional project (yet not finished like sound/draw/etc.). I uploaded the lib+bin I compiled for win32. (Three mirrors are the same.) https://uploadocean.com/33gu9fh5ptro https://www.sendspace.com/file/brb5aq https://bdupload.info/udtquqau6z5p With these libs you should compile the same binary as mine (and with FPC 3.0.2). ---------------------------------------------------------------------- mercury · 2017-08-18 12:28 Quote from: DonAlfredo on August 18, 2017, 11:50:08 amI solved them by adding some standard functions from here: https://github.com/BeRo1985/pasvulkan/blob/master/src/PasVulkan.Static Linking.pas This pasvulkan project is amazing! All thing I want -- cross-platform framework with Sprites/Audio/Canvas/Font/GUI. But I think neither my computer nor android device support vulkan. And I guest most people don’t have any device support it. May I can use this framework several years later. As now I better stuck with SDL2 which gives most compatibility (DirectX/OpenGL). ---------------------------------------------------------------------- DonAlfredo · 2017-08-18 12:57 QuoteThis pasvulkan project is amazing! Yes. To be honest, with the Vulkan-link I was also hoping that you would have a look at the Vulkan project. BeRo is an amazing programmer. And the structuring of his software is also very good ! You could use his SDL2 bindings and build your work upon them. Later, you could easily switch over towards using Vulkan itself. Thanks for sending the win32 project itself. I will have another look. edit There are also other alternatives: Castle Game Engine : https://github.com/castle-engine PXL: https://sourceforge.net/projects/asphyre/ ---------------------------------------------------------------------- mercury · 2017-08-19 02:39 Quote from: DonAlfredo on August 18, 2017, 02:57:26 pmBeRo is an amazing programmer. And the structuring of his software is also very good ! You could use his SDL2 bindings and build your work upon them. Later, you could easily switch over towards using Vulkan itself. I use this one (with modify): https://github.com/ev1313/Pascal-SDL-2-Headers And, why vulkan need SDL? Quote from: DonAlfredo on August 18, 2017, 02:57:26 pmThere are also other alternatives: Castle Game Engine : https://github.com/castle-engine PXL: https://sourceforge.net/projects/asphyre/ Castle Game Engine is good, I had used once. But finally I fell it’s very OO and highly coupling. Too hard to modify. And some functions are not cross-platform consistent. As for PXL, Asphyre has several generations of game engine, but none of them support audio. I even wondering PXL is inactive like ZenGL. = = ---------------------------------------------------------------------- DonAlfredo · 2017-08-19 08:16 I think I cannot help you any further unfortunately. Two reasons. 1. Your SDL static lib for Android ARMV7 gives an error while linking: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i libSDL2.a(SDL_android.o): In function `JNI_OnLoad':Debug: D:/develop/SDL2/SDL2-2.0.5/src/core/android/SDL_android.c:94: multiple definition of `JNI_OnLoad'project1\lib\android-arm- debug\project1.o:project1.lpr:(.text.n_JNI_OnLoad+0x0): first defined here  2. If I use a working SDL lib, the app dies on my phone without doing anything: Quote08-19 10:05:54.135  8989  8989 D SDL     : command: logcat -f /sdcard/app.log -v time *:V 08-19 10:05:54.155  8989  8989 V SDL     : Device: m0 08-19 10:05:54.155  8989  8989 V SDL     : Model: GT-I9300 08-19 10:05:54.155  8989  8989 V SDL     : onCreate(): null 08-19 10:05:54.155  8989  8989 D dalvikvm: Trying to load lib /data/app-lib/net.sourceforge.app-2/libapp.so 0x425f98a0 08-19 10:05:54.160  8989  8989 D dalvikvm: Added shared lib /data/app- lib/net.sourceforge.app-2/libapp.so 0x425f98a0 08-19 10:05:54.230  8989  8989 I SDL/APP : initialization Main 08-19 10:05:54.230  8989  8989 I SDL/APP : ====== application begin ====== 08-19 10:05:54.715  1941  1941 D Zygote  : Process 8989 exited cleanly (211) 08-19 10:05:54.715  2349  2360 I ActivityManager: Process net.sourceforge.app (pid 8989) (adj 0) has died. 08-19 10:05:54.715  2349  2360 W ActivityManager: Force removing ActivityRecord{439b49f0 u0 net.sourceforge.app/org.libsdl.app.SDLActivity}: app died, no saved state Sorry about this. I hope you will succeed in the end. ---------------------------------------------------------------------- mercury · 2017-08-19 12:16 Quote from: DonAlfredo on August 19, 2017, 10:16:32 amI think I cannot help you any further unfortunately. It’s ok. Thanks anyway.