SDL Android assistance |
Owen Alanzo Hogarth
Guest
|
Hi
I am trying to edit the SDLActivity to run inside of a wallpaperservice and wallpaperservice.Engine What i've done so far was remove the code about key input since that won't be needed while running as a livewallpaper. I moved all the code from the SDLActivity to the SDLWallpaperService I kept the SDLSurface class in tact, so most of the editing was done to the main class to remove some functions that aren't necessary. I am running into some issues though. When I try to call SDLMain to launch my SDL application, the code gets stuck in a loop where it keeps calling nativequit and I am unsure why. This is the entire code that I've edited:Â http://pastebin.com/hpGnhRWR There's the Log output at the bottom. If anyone has a good amount of experience with android they could help me sort this out. I have read the sdl livewallpaper code from around 2011 but it seems a lot has changed with sdl between then and now. I have also created similar live wallpapers where I did something similar just w/o these threads. Anyone with SDL2 android experience can offer some tips? |
|||||||||||
|
SDL Android assistance |
Michael Labbe
Guest
|
Hey,
Take a look at the Android readme in the source repo. It identifies an approach for deriving from SDLActivity, rather than modifying it directly. You are possibly beyond the scope of SDL mailing list assistance if you are modifying it directly. On Wed, Aug 26, 2015 at 12:06 PM, Owen Alanzo Hogarth wrote:
|
|||||||||||||
|
SDL Android assistance |
Owen Alanzo Hogarth
Guest
|
I looked at that document and subclassing SDLActivity to change the name is okay, it won't work properly for this situation, at least I am unsure how to make it work properly.
Is there any detailed information about how the SDLSurface class works, especially what needs to be setup correctly before calling the SDLMain class to start the thread? I can load the dynamic libs just fine but when i start the thread the application crashes. On Thu, Aug 27, 2015 at 4:15 AM, Michael Labbe wrote:
|
|||||||||||||||
|
SDL Android assistance |
Michael Labbe
Guest
|
It's not entirely clear what is you ARE trying to do, but perhaps NativeActivity is a closer match for what you are attempting than SDL, which attempts to map intents to a main()-like function?
http://developer.android.com/reference/android/app/NativeActivity.html I am unaware of detailed documentation for SDLSurface, but I was able to understand it pretty well just by reading the source for my needs. On Wed, Aug 26, 2015 at 1:55 PM, Owen Alanzo Hogarth wrote:
|
|||||||||||||||||
|
SDL Android assistance |
Owen Alanzo Hogarth
Guest
|
That's a well documented class, thanks.
But I would really like to keep this as close to SDL's current implementation as possible. It seems that in the SDL android Activity there's two threads, one that gets called to start up the SDL backend, it looks like this:Â final Thread sdlThread = new Thread(new SDLMain(), "SDLThread"); but there's also another thread: protected static Thread mSDLThread; I don't quite understand what mSDLThread is doing, it is defined first. Can anyone point out where SDL for android sets up it's egl contexts? On Thu, Aug 27, 2015 at 6:32 AM, Michael Labbe wrote:
|
|||||||||||||||||||
|
SDL Android assistance |
gabomdq
|
Take a look at this:Â https://bugzilla.libsdl.org/show_bug.cgi?id=1351
It's old and you'll have to do a lot of work to get it up to date, but that's my version of a live wallpaper implemented using SDL. 2015-08-26 19:56 GMT-03:00 Owen Alanzo Hogarth:
-- Gabriel. |
|||||||||||||||||||||
|
SDL Android assistance |
Owen Alanzo Hogarth
Guest
|
I looked at that quite a bit. Question about your code, I wasn't using SDL in the 1.xx days so I am not sure.
You setup your own EGL contexts, etc... Does SDL2 hide that away from you or it was always like that? I don't mind setting up the context if I have to but I would prefer not to. If it's possible I would like to just wrap the current SDLSurface java class inside the WallpaperService.Engine, and control it from there. I've done similar things in the past but not with SDL and the threads really give me a hard time. On Thu, Aug 27, 2015 at 7:22 AM, Gabriel Jacobo wrote:
|
|||||||||||||||||||||||
|
SDL Android assistance |
Owen Alanzo Hogarth
Guest
|
anyone else on this list have any insights on this? I'm not sure where else I can look for answers.
On Thu, Aug 27, 2015 at 7:48 AM, Owen Alanzo Hogarth wrote:
|
|||||||||||||||||||||||||
|
SDL Android assistance |
gabomdq
|
That patch is SDL 2.x based. The EGL context stuff you can safely ignore, we moved it to native code somewhere along the line.
2015-08-26 20:48 GMT-03:00 Owen Alanzo Hogarth:
-- Gabriel. |
|||||||||||||||||||||||||
|
SDL Android assistance |
Owen Alanzo Hogarth
Guest
|
Moving the EGL code to native is the reason why this seems no longer possible or would require a whole lot of reworking.
I'd have to setup some JNI calls to reach into native and pull the context back to java side since the WallpaperService.Engine needs that to work properly and explains why all the crashes. Thanks for the reply, it helped me a bit. On Thu, Aug 27, 2015 at 8:34 PM, Gabriel Jacobo wrote:
|
|||||||||||||||||||||||||||
|