We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1243 - Android: no Non-GLES contexts/surfaces work
Summary: Android: no Non-GLES contexts/surfaces work
Status: RESOLVED WORKSFORME
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: ARM Android (All)
: P2 blocker
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-03 12:28 UTC by paines
Modified: 2012-02-03 19:35 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description paines 2011-07-03 12:28:56 UTC
I pulled the latest sources and set it up like recommended in README.android .

I managed to get the testgles.c compiled, installed and running on my Xperia Play (Android 2.3.3). I see a gouraud shaded cube rotating with no issues.

However setting up a non-gles surface  like in testsprite.c does not work.
The app will crash with lots of "E/libEGL  ( 7023): called unimplemented OpenGL ES API" messages.

Same is happening with the "aliens" demo Sam proposed here: 
http://forums.libsdl.org/viewtopic.php?t=6831

This seems to me like an issue in SDL 1.3.
Other SDL games based on 1.2 like "warmux" or "opentyrian" run without problems on my device.
Comment 1 Gabriel Jacobo 2011-10-15 16:09:03 UTC
It seems to me that testsprite.c uses SDL's 1.2 API, which AFAIK doesn't quite work under Android. I can tell you for sure that non GL ES surface do work with SDL 1.3, I use them via SDL_image to load images and then copy them to a texture with http://wiki.libsdl.org/moin.cgi/SDL_CreateTextureFromSurface .
Comment 2 paines 2011-10-19 06:06:18 UTC
Gabriel, thanks for commenting.

After your comment I started to look into this again, and realized that my app was failing because of SDL_RWops being unable to read from /sdcard.
This is now fixed.

However I still have visual issues. I simply don't see a thing on the screen !

Return codes for SDL_SetVideoMode (surface is != null) and blitting and flip/update are okay (return code 0).  

Also a simple SDL_FillRect with e.g. red and updating the whole rect doesn't show anything. Screen stays black.
Comment 3 Gabriel Jacobo 2011-10-19 06:23:46 UTC
I can't say what your problem is, but a quick glance over the SDL_compat.c code (which is what you are probably using, and is known to be buggy) seems to indicate that there's no ready made way to go from the surface you obtain from SDL_SetVideoMode to the screen. I would suggest creating a renderer, converting your surfaces to textures and using SDL_RenderCopy to show them.
Comment 4 paines 2011-10-19 06:33:22 UTC
Okay, I will try that. Thanks Gabriel

Just one more info: 2 Hardware devices fail (Xperia Play, Desire HD2) while Emulator works like a charme.
Comment 5 Sam Lantinga 2012-01-07 22:24:16 UTC
Any luck using the render API?
Comment 6 paines 2012-01-08 02:24:10 UTC
I managed to get it running by disabling GLES 2.0 via
#define SDL_VIDEO_RENDER_OGL_ES2 0
in SDL/include/SDL_config_android.h

To be honest, I tried the render api, but I cannot remember if it worked any good.

You can close the ticket now, if you like.
Thanks and BR