[SDL] Are there any working SDL Android examples?

William Dyce wilbefast at gmail.com
Mon Jul 25 09:59:34 PDT 2011


Hi Manuel,

I've been trying to avoid using OpenGL directly and I've stuck to software
rendering so far - basically just high-level SDL stuff for the application
itself. I had a go at writing a fairly basic test program which should just
draw a small red rectangle on the screen. It runs on the emulator and on
Linux, but on the hardware -you guessed it- no red rectangle, just "called
unimplemented OpenGL ES API".

Attached is the source, makefile and extract from the logs that should cover
the whole execution, except for a few hundred repetitions of the above error
that I removed for convenience - you can probably skip down to about line 74
for the main thread of execution.

I'll check out the other stuff tomorrow - it 3am, I should probably get some
sleep :-S

Thanks for the help :)

William

On 26 July 2011 01:46, Manuel Massing <m.massing at warped-space.de> wrote:

> Hi William,
>
> The alien project is probably using either the OpenGL ES 1.1
> or OpenGL ES 2.0 accelerated SDL renderer (for blitting etc.).
>
> Make sure _that only one of the renderers is registered or the correct one
> selected_, and take note if it is the gles or gles 2.0 renderer (e.g.
> by looking into the SDL source code, in particular renderer/SDL_render.c
> and
> the SDL_config.h used for your build!).
>
> Anyway, I would suggest you start from scratch with a minimal SDL project
> instead (lots of sample code), and move up from there.
>
> 1) Create your minimal project based on $SDLDIR/android-project.
> Put your source in android-project/jni/src/YourSource.cpp and edit the
> Android.mk accordingly.
>
> 2) invoke "ndk-build" then "ant debug" to build it.
>
> In your program, first try creating a simple window and GL context. If
> you require GLES 2.0, use the modifications suggested by Forest Hale, or
> use
> the patch I sent you previously (use my patch in conjunction with
>
>        SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
>        SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);
> or
>        SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 1);
>        SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);
>
> depending on whether you want to create an OpenGL ES 1.1 or OpenGL ES 2.0
> context)
>
> If video init succeeds, test simple OpenGL functionality (e.g. a
> framebuffer
> clear: glClearColor(1,0,0,1); glClear(GL_COLOR_BUFFER_BIT); ).
>
> If you need further suggestions, provide the "logcat *:V" output of
> your application startup.
>
> bye,
>
>        Manuel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20110726/2d3c803d/attachment-0008.htm>
-------------- next part --------------
I/Launcher(  251): onResume(). mIsNewIntent : true
E/Launcher(  251): MTP-LAUNCHER: media scanning not yet finished. 
I/Launcher(  251): onResume() ended
I/Launcher(  251): onWindowFocusChanged(true)
D/Launcher(  251): setWallpaperDimension() called
D/Launcher(  251): USE_NON_SCROLLABLE_IMAGE_WALLPAPER is true
D/Launcher(  251): It's image wallpaper. suggestDesiredDimensions(-1,-1)
I/Launcher(  251): onPause()
I/Launcher(  251): onResume(). mIsNewIntent : true
E/Launcher(  251): MTP-LAUNCHER: media scanning not yet finished. 
I/Launcher(  251): onResume() ended
D/ScreenCaptureService( 1571): Starting #2: Bundle[mParcelledData.dataSize=60]
D/ScreenCaptureService( 1571): mType = long_keydown isLongKey = true onCapture = false
D/ScreenCaptureService( 1571): Starting #3: Bundle[mParcelledData.dataSize=56]
D/ScreenCaptureService( 1571): mType = long_keyup isLongKey = false onCapture = false
W/KeyCharacterMap(  251): No keyboard for id 65536
W/KeyCharacterMap(  251): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
D/Launcher(  251): dispatchKeyEvent DOWN KEYCODE_BACK / MainMenu isOpened=false Info=false
D/Launcher(  251): KEYCODE_BACK launcher 2
D/Launcher(  251): dispatchKeyEvent UP KEYCODE_BACK / MainMenu isOpened=false Info=false
V/AudioFlinger(   94): Track constructor name 4098, calling thread 179
V/AudioFlinger(   94): start(4098), calling thread 179
V/AudioFlinger(   94): ? => ACTIVE (4098) on thread 0x18770
V/AudioPolicyManager(   94): startOutput() output 1, stream 1
E/AudioPolicyManagerBase(   94): unknown stream type
E/AudioPolicyManagerBase(   94): unknown stream type
E/AudioPolicyManagerBase(   94): unknown stream type
V/AudioPolicyManager(   94): getDeviceForStrategy() from cache strategy 0, device 2
V/AudioPolicyManager(   94): getNewDevice() selected device 2
V/AudioPolicyManager(   94): setOutputDevice() output 1 device 2 force 0 delayMs 0
V/AudioPolicyManager(   94): setOutputDevice() setting same device 2 or null device for output 1
V/AudioFlinger(   94): mWaitWorkCV.broadcast
V/AudioFlinger(   94): MixerThread 0xbb38 TID 151 waking up
V/AudioPolicyManager(   94): releaseOutput() 1
V/AudioFlinger(   94): remove track (4097) and delete from mixer
V/AudioFlinger(   94): PlaybackThread::Track destructor
E/ATK     ( 1562): widget kill start
V/AudioHardwareMSM72XX(   94): open driver
V/AudioHardwareMSM72XX(   94): get config
V/AudioHardwareMSM72XX(   94): set config
V/AudioHardwareMSM72XX(   94): buffer_size: 4800
V/AudioHardwareMSM72XX(   94): buffer_count: 2
V/AudioHardwareMSM72XX(   94): channel_count: 2
V/AudioHardwareMSM72XX(   94): sample_rate: 44100
E/ATK     ( 1562): com.google.android.googlequicksearchbox
W/AudioFlinger(   94): write blocked for 166 msecs, 10 delayed writes, thread 0xbb38
E/ATK     ( 1562): org.jtb.alogcat
E/ATK     ( 1562): com.android.vending
E/ATK     ( 1562): com.sec.android.app.unifiedinbox
E/ATK     ( 1562): com.android.music
V/AudioFlinger(   94): getNextBuffer() no more data for track 4098 on thread 0xbb38
V/AudioFlinger(   94): stop(4098), calling thread 179
V/AudioFlinger(   94): (> STOPPED) => STOPPED (4098) on thread 0xbb38
V/AudioPolicyManager(   94): stopOutput() output 1, stream 1
E/AudioPolicyManagerBase(   94): unknown stream type
E/AudioPolicyManagerBase(   94): unknown stream type
E/AudioPolicyManagerBase(   94): unknown stream type
E/AudioPolicyManagerBase(   94): unknown stream type
V/AudioPolicyManager(   94): getNewDevice() selected device 0
V/AudioPolicyManager(   94): setOutputDevice() output 1 device 0 force 0 delayMs 150
V/AudioPolicyManager(   94): setOutputDevice() setting same device 0 or null device for output 1
V/AudioFlinger(   94): TrackBase::reset
E/ATK     ( 1562): widget kill end
V/AudioFlinger(   94): Audio hardware entering standby, mixer 0xbb38, mSuspended 0
V/AudioFlinger(   94): MixerThread 0xbb38 TID 151 going to sleep
E/AndroidRuntime( 1595): /system/csc/feature.xml ==> cannot open file
E/AndroidRuntime( 1604): /system/csc/feature.xml ==> cannot open file
I/Launcher(  251): onPause()
D/PhoneApp(  247): updateProximitySensorMode: lock already released.
I/Launcher(  251): onWindowFocusChanged(false)
D/Launcher(  251): setWallpaperDimension() called
D/Launcher(  251): USE_NON_SCROLLABLE_IMAGE_WALLPAPER is true
D/Launcher(  251): It's image wallpaper. suggestDesiredDimensions(-1,-1)
D/SensorManager( 1612): ====>>>>>Num Sensor: 1
D/SensorManager( 1612): ====>>>>>Num Sensor: 2
D/SensorManager( 1612): ====>>>>>Num Sensor: 3
D/SensorManager( 1612): ====>>>>>Num Sensor: 0
W/IInputConnectionWrapper(  251): showStatusIcon on inactive InputConnection
E/SensorManager( 1612): registerListener :: handle = 0  name= BMA220 delay= 60 Listener= org.libsdl.app.SDLSurface at 4a523e18
E/SensorHAL(  179): Sensor Input open fd_compass=95 fd_accel=96
E/SensorManager( 1612): =======>>>Sensor Thread RUNNING <<<========
E/SensorHAL( 1612): __data_data_open  32 34
E/SensorHAL(  179): Write acc delay /sys/class/input/input3/poll_delay <---60
V/SDL     ( 1612): pixel format unknown -1
I/SDL     ( 1612): SDL_Android_Init()
I/APPLICATION( 1612): >>>>>Initialising SDL video: Okay
I/SDL     ( 1612): [STUB] GL_LoadLibrary
V/SDL     ( 1612): Starting up OpenGL ES 2.0
I/ActivityManager(  179): Displayed activity org.libsdl.app/.SDLActivity: 482 ms (total 482 ms)
I/SDL     ( 1612): [STUB] GL_SetSwapInterval
I/SDL     ( 1612): [STUB] GL_GetSwapInterval
E/libEGL  ( 1612): called unimplemented OpenGL ES API
E/libEGL  ( 1612): called unimplemented OpenGL ES API
E/libEGL  ( 1612): called unimplemented OpenGL ES API
E/libEGL  ( 1612): called unimplemented OpenGL ES API
E/libEGL  ( 1612): called unimplemented OpenGL ES API
E/libEGL  ( 1612): called unimplemented OpenGL ES API
E/libEGL  ( 1612): called unimplemented OpenGL ES API
E/libEGL  ( 1612): called unimplemented OpenGL ES API
I/APPLICATION( 1612): >>>>>Creating window: Okay
I/APPLICATION( 1612): >>>>>Main initialisations: Okay
E/libEGL  ( 1612): called unimplemented OpenGL ES API
E/libEGL  ( 1612): called unimplemented OpenGL ES API

** REPEATED THOUSAND OF TIMES

E/libEGL  ( 1612): called unimplemented OpenGL ES API
E/libEGL  ( 1612): called unimplemented OpenGL ES API
D/PhoneApp(  247): updateProximitySensorMode: lock already released.
D/PhoneWindow( 1612): couldn't save which view has focus because the focused view org.libsdl.app.SDLSurface at 4a523e18 has no id.
I/SDL     ( 1612): [STUB] GL_UnloadLibrary
I/APPLICATION( 1612): >>>>>Shutting down: Okay
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.cpp
Type: text/x-c++src
Size: 2960 bytes
Desc: not available
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20110726/2d3c803d/attachment-0008.cpp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Android.mk
Type: application/octet-stream
Size: 450 bytes
Desc: not available
URL: <http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20110726/2d3c803d/attachment-0008.obj>


More information about the SDL mailing list