SDL Android assistance

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?

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:

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 mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

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:

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 <@Owen_Alanzo_Hogarth wrote:

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 mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

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:

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 <@Michael_Labbe> wrote:

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 < gurenchan at gmail.com> wrote:

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 mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

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:

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 <@Owen_Alanzo_Hogarth> wrote:

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:

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 < @Owen_Alanzo_Hogarth> wrote:

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 mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

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 :> 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:

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 <gurenchan at gmail.com wrote:

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:

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 < gurenchan at gmail.com> wrote:

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 mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Gabriel.

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:

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 <@Owen_Alanzo_Hogarth>:

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:

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 < @Owen_Alanzo_Hogarth> wrote:

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:

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 < @Owen_Alanzo_Hogarth> wrote:

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 mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Gabriel.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

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 <@Owen_Alanzo_Hogarth> wrote:

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:

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 <@Owen_Alanzo_Hogarth>:

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:

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 < @Owen_Alanzo_Hogarth> wrote:

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:

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 < @Owen_Alanzo_Hogarth> wrote:

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 mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Gabriel.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

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 :> 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 <@Gabriel_Jacobo> wrote:

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 :

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:

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 < gurenchan at gmail.com> wrote:

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:

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 < gurenchan at gmail.com> wrote:

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 mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Gabriel.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Gabriel.

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:

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 <@Owen_Alanzo_Hogarth>:

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:

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 <@Owen_Alanzo_Hogarth>:

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:

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 < @Owen_Alanzo_Hogarth> wrote:

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:

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 < @Owen_Alanzo_Hogarth> wrote:

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 mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Gabriel.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Gabriel.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org