[SDL] Are there any working SDL Android examples?

Forest Hale havoc at ghdigital.com
Mon Jul 25 07:33:20 PDT 2011


To be clear I am testing on real hardware too (on a Tegra2 chip in this case), and have the same code running on iOS just as well.

No observed issues with SDL 1.3 other than the context creation versioning and single touch limitation (as described) and the fact I'm not sure how to activate the Android virtual keyboard (likely 
need to patch up that too).

I have no experience with SDL 1.2 on android so I can't speak to that.

Are you quite sure your GLES code is written correctly?  There are vast differences between GLES1 and GLES2, is it GLES1 code running on a GLES1 context (as intended)?  Or do you have GLES2 code as 
well which might be bugged (for example making use of fixed function API features like glMatrixMode and glTexEnv that are present in desktop GL and GLES1 but not in GLES2)?

On 07/25/2011 06:10 AM, René Dudfield wrote:
> The Peyla's 1.2 branch worked for me on real hardware.  I used it through pygame subset for android.
>
> Good luck!
>
> On Mon, Jul 25, 2011 at 1:03 PM, William Dyce <wilbefast at gmail.com <mailto:wilbefast at gmail.com>> wrote:
>
>     Sorry Forest, I've got the exact same result for the emulator and an instant crash for the hardware (rather than sound but no images). The difference between the two seems to be that one runs EGL
>     1.1 and the other run EGL 2.0, or at least tries and fail to do so.
>
>     There's a lot at stake here for me: I managed to convince my employers that C++ with SDL would be a better bet than Unity3D (Free Software FTW!) so if I'm wrong I'll most likely lose my summer
>     job, such as it is :-S
>
>     I'll keep digging: I know it has to have something to do with the different EGL versions: if only I could force the hw to use version 1.1... doing so seems to make everything crash though.
>
>     So nobody has any example they're willing to expose to the public eye?
>
>
>
>     On 25 July 2011 19:59, Forest Hale <havoc at ghdigital.com <mailto:havoc at ghdigital.com>> wrote:
>
>         I'm not at liberty to show my current work on this, but I can assure you it does work in SDL 1.3...
>
>         The Unimplemented OpenGL ES API notices *always* indicate you have the incorrect context version, which has to be fixed in SDLActivity.java .
>
>         Make sure the initEGL function in SDLActivity.java has this code where it calls CreateContext:
>                     int EGL_CONTEXT_CLIENT_VERSION=__0x3098;
>                     int contextAttrs[] = new int[]
>                     {
>                     EGL_CONTEXT_CLIENT_VERSION, majorVersion,
>                     EGL10.EGL_NONE
>                     };
>                     EGLContext ctx = egl.eglCreateContext(dpy, config, EGL10.EGL_NO_CONTEXT, contextAttrs);
>                     if (ctx == EGL10.EGL_NO_CONTEXT) {
>                         Log.e("SDL", "Couldn't create context");
>                         return false;
>                     }
>
>         The version I pulled from hg seems to pass null instead of contextAttrs (and does not have the contextAttrs array itself).
>
>         Another issue I have come across is lack of multitouch input, all touch events are being passed as mouse events not finger events, I'll be looking at this issue in the coming days.
>
>
>         On 07/25/2011 12:19 AM, William Dyce wrote:
>
>             Hi again,
>
>             Still no real success with either this port or Peyla's 1.2 branch. I'm considering switching to OpenGL instead, which will be a real pain, but if I can't trust the middle-ware there's very
>             little I
>             can do as an application programmer. No offence - I really like SDL but... well, it's just not working.
>             Just to be sure though: are there actually any applications at all, with source, that use the port? That is, aside from the "Alien Shooter" example which won't display graphics on my
>             hardware ("called
>             unimplemented Open GL ES API"). If I could just get hold of one program that functions correctly I could figure out what's going wrong here.
>
>             Has anybody succeeded in making this work on real hardware?
>
>             William
>
>
>
>             _________________________________________________
>             SDL mailing list
>             SDL at lists.libsdl.org <mailto:SDL at lists.libsdl.org>
>             http://lists.libsdl.org/__listinfo.cgi/sdl-libsdl.org <http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org>
>
>
>
>         --
>         LordHavoc
>         Author of DarkPlaces Quake1 engine - http://icculus.org/twilight/__darkplaces <http://icculus.org/twilight/darkplaces>
>         Co-designer of Nexuiz - http://alientrap.org/nexuiz
>         "War does not prove who is right, it proves who is left." - Unknown
>         "Any sufficiently advanced technology is indistinguishable from a rigged demo." - James Klass
>         "A game is a series of interesting choices." - Sid Meier
>
>         _________________________________________________
>         SDL mailing list
>         SDL at lists.libsdl.org <mailto:SDL at lists.libsdl.org>
>         http://lists.libsdl.org/__listinfo.cgi/sdl-libsdl.org <http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org>
>
>
>
>     _______________________________________________
>     SDL mailing list
>     SDL at lists.libsdl.org <mailto: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


-- 
LordHavoc
Author of DarkPlaces Quake1 engine - http://icculus.org/twilight/darkplaces
Co-designer of Nexuiz - http://alientrap.org/nexuiz
"War does not prove who is right, it proves who is left." - Unknown
"Any sufficiently advanced technology is indistinguishable from a rigged demo." - James Klass
"A game is a series of interesting choices." - Sid Meier




More information about the SDL mailing list