[SDL] Are there any working SDL Android examples?

Scott Smith pickle136 at sbcglobal.net
Mon Jul 25 08:33:59 PDT 2011


I have not done anything specific in regards to android, but i have used 
Opengl-ES on linux distros.

Are you getting a window surface? (Are you using SDL or EGL?)
EGL is basically the same for both 1.1 and 2.0. The process of getting surface 
is the same. The main difference is the attrib bits. SDL 1.3 should hide this 
part. You wont get a surface to draw to if this doesnt work.

Which GLES lib are you linking to? Typically they are called GLES_CM.so and 
GLESv2.so. Make sure your using the right lib for the API your going to use.

Check out this link, it gives some good examples and give some good explanations 
on the differences between 1.X ES and 2.0 ES.
http://pandorawiki.org/GLESGAE:Setting_Up_A_Window_and_Context




________________________________
From: William Dyce <wilbefast at gmail.com>
To: SDL Development List <sdl at lists.libsdl.org>
Sent: Mon, July 25, 2011 11:10:03 AM
Subject: Re: [SDL] Are there any working SDL Android examples?

I think that this is more or less where the problem is: something to do with the 
differences between GLES 1.1 and 2.0. Trouble is it's not *my* GLES code. I 
started out trying to get my own SDL project working on Android, but  now I'm 
just trying to get someone else's to work so I can examine *how*  it works and, 
hopefully, apply the same logic to my original project. 


So what I'm trying to run on the Galaxy is actually 100% code taken from the SDL 
website, specifically /tmp/android-project.zip Alien Shooter game :-/ Trouble 
is, since I didn't write the code in question I don't know exactly what I'm 
looking for or where to find it. It doesn't help that I'm not really experienced 
with OpenGL, let alone GLES. 


To sum up (if I understand correctly) it would appear that, somewhere something 
has been hard-coded to a set of assumptions that disagree with my specific 
hardware/software configuration. Most likely it's a call to some function in 
GLES 2.0 that isn't in GLES 1.1 or vice-versa. 

Hmm... okay, can you think of a sub-set of source files where such a bug might 
be hiding, and/or a sub-set of API features that might be causing it? You just 
mentioned glMatrixMode and glTexEnv for example...

William


On 26 July 2011 00:33, Forest Hale <havoc at ghdigital.com> wrote:

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

_______________________________________________
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20110725/a43da1e7/attachment-0008.htm>


More information about the SDL mailing list