Discussion:
SDL Android assistance
(too old to reply)
Owen Alanzo Hogarth
2015-08-26 19:06:45 UTC
Permalink
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?
Michael Labbe
2015-08-26 20:15:38 UTC
Permalink
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.
Post by Owen Alanzo Hogarth
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
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Owen Alanzo Hogarth
2015-08-26 20:55:11 UTC
Permalink
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.
Post by Michael Labbe
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.
Post by Owen Alanzo Hogarth
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
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Michael Labbe
2015-08-26 22:32:44 UTC
Permalink
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.
Post by Owen Alanzo Hogarth
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.
Post by Michael Labbe
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 <
Post by Owen Alanzo Hogarth
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
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Owen Alanzo Hogarth
2015-08-26 22:56:31 UTC
Permalink
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?
Post by Michael Labbe
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.
Post by Owen Alanzo Hogarth
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.
Post by Michael Labbe
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 <
Post by Owen Alanzo Hogarth
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
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Gabriel Jacobo
2015-08-26 23:22:59 UTC
Permalink
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.
Post by 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
final Thread sdlThread = new Thread(new SDLMain(), "SDLThread");
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?
Post by Michael Labbe
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.
Post by Owen Alanzo Hogarth
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.
Post by Michael Labbe
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 <
Post by Owen Alanzo Hogarth
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
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
--
Gabriel.
Owen Alanzo Hogarth
2015-08-26 23:48:01 UTC
Permalink
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.
Post by Gabriel Jacobo
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.
Post by 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
final Thread sdlThread = new Thread(new SDLMain(), "SDLThread");
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?
Post by Michael Labbe
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 <
Post by Owen Alanzo Hogarth
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.
Post by Michael Labbe
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 <
Post by Owen Alanzo Hogarth
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.
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
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
--
Gabriel.
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Owen Alanzo Hogarth
2015-08-27 05:12:37 UTC
Permalink
anyone else on this list have any insights on this? I'm not sure where else
I can look for answers.
Post by 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.
Post by Gabriel Jacobo
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.
Post by 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
final Thread sdlThread = new Thread(new SDLMain(), "SDLThread");
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?
Post by Michael Labbe
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 <
Post by Owen Alanzo Hogarth
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.
Post by Michael Labbe
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 <
Post by Owen Alanzo Hogarth
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.
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
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
--
Gabriel.
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Gabriel Jacobo
2015-08-27 12:34:35 UTC
Permalink
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.
Post by 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.
Post by Gabriel Jacobo
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.
Post by 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
final Thread sdlThread = new Thread(new SDLMain(), "SDLThread");
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?
Post by Michael Labbe
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 <
Post by Owen Alanzo Hogarth
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.
Post by Michael Labbe
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 <
Post by Owen Alanzo Hogarth
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.
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
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
--
Gabriel.
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
--
Gabriel.
Owen Alanzo Hogarth
2015-08-27 13:12:48 UTC
Permalink
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.
Post by Gabriel Jacobo
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.
Post by 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.
Post by Gabriel Jacobo
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.
Post by 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
final Thread sdlThread = new Thread(new SDLMain(), "SDLThread");
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?
Post by Michael Labbe
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 <
Post by Owen Alanzo Hogarth
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.
Post by Michael Labbe
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 <
Post by Owen Alanzo Hogarth
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.
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
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
--
Gabriel.
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
--
Gabriel.
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Continue reading on narkive:
Loading...