SDL Android: "Call to unimplemented OpenGL ES API"

Hi there,

I’m just making a start trying to port an SDL project to Android. I managed
to get the Alien Shooter example
projecthttp://www.libsdl.org/tmp/android-project.ziprunning on an
emulator, but when I try it on my actual hardware device
(identical to the emulator, in theory) I get no image, only music and sound.
The log, meanwhile, fills up with *“Call to unimplemented OpenGL ES
API”*entries. Does anybody know why this might be? I’m using a Samsung
Galaxy Fit http://en.wikipedia.org/wiki/Samsung_Galaxy_Fit, so Android
2.2. Any help would be most welcome!

Thanks,

William

PS - yes, I did remember to load the data on the sd card :wink:

Some functions in OpenGL ES 1 are not implemented in OpenGL ES 2, and of course the opposite is also true.

Make sure you’re asking for the right type of context.

I had to fix a bug in the Java EGL setup code where it was asking for an OpenGL ES 1 context after picking a config that supports both, where my code requires an OpenGL ES 2 context, so it was giving
this same error message because I was making OpenGL ES 2 calls on an OpenGL ES 1 context…On 07/21/2011 11:20 PM, William Dyce wrote:

Hi there,

I’m just making a start trying to port an SDL project to Android. I managed to get the Alien Shooter example project http://www.libsdl.org/tmp/android-project.zip running on an emulator, but when I
try it on my actual hardware device (identical to the emulator, in theory) I get no image, only music and sound. The log, meanwhile, fills up with /“Call to unimplemented OpenGL ES API”/ entries.
Does anybody know why this might be? I’m using a Samsung Galaxy Fit http://en.wikipedia.org/wiki/Samsung_Galaxy_Fit, so Android 2.2. Any help would be most welcome!

Thanks,

William

PS - yes, I did remember to load the data on the sd card :wink:


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

Thanks for the reply Forest - where is the context specified, do you know?
There are a lot of source files in the port - I’m guessing one of the Java
glue files, right? I’ve used the SDK before but this is my first NDK project

  • guess I’m not going to avoid hacking around with things…

WilliamOn 22 July 2011 17:02, Forest Hale wrote:

Some functions in OpenGL ES 1 are not implemented in OpenGL ES 2, and of
course the opposite is also true.

Make sure you’re asking for the right type of context.

I had to fix a bug in the Java EGL setup code where it was asking for an
OpenGL ES 1 context after picking a config that supports both, where my code
requires an OpenGL ES 2 context, so it was giving this same error message
because I was making OpenGL ES 2 calls on an OpenGL ES 1 context…

On 07/21/2011 11:20 PM, William Dyce wrote:

Hi there,

I’m just making a start trying to port an SDL project to Android. I
managed to get the Alien Shooter example project <
http://www.libsdl.org/tmp/**android-project.ziphttp://www.libsdl.org/tmp/android-project.zip>
running on an emulator, but when I

try it on my actual hardware device (identical to the emulator, in theory)
I get no image, only music and sound. The log, meanwhile, fills up with
/“Call to unimplemented OpenGL ES API”/ entries.
Does anybody know why this might be? I’m using a Samsung Galaxy Fit <
http://en.wikipedia.org/wiki/**Samsung_Galaxy_Fithttp://en.wikipedia.org/wiki/Samsung_Galaxy_Fit>,
so Android 2.2. Any help would be most welcome!

Thanks,

William

PS - yes, I did remember to load the data on the sd card :wink:

_____________**
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.orghttp://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
http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.orghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Hi William,

Thanks for the reply Forest - where is the context specified, do you know?
There are a lot of source files in the port - I’m guessing one of the Java
glue files, right? I’ve used the SDK before but this is my first NDK
project - guess I’m not going to avoid hacking around with things…

you will find the OpenGL ES context initialization code inside

android-project/src/org/libsdl/app/SDLActivity.java

but as you have noticed, it is fairly limited (it does not support OpenGL ES
2.0 correctly).

To support more general context intialization, I have used the
EGLConfigChooser from GLSurfaceView.java (which is part of the
offical android opengl framework so it should be well tested on actual
devices) - see the attached patch.

Caveat: although easily remedied, the patch currently uses hardcoded values
for preferred rgb and depth-buffer bit depths (mirroring the default preferred
config in GLSurfaceView).

Select the EGL version using SDL_GL_SetAttribute, e.g. for OpenGL ES 2.0:

SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);

It would be great if someone could submit this patch.

cheers,

Manuel

-------------- next part --------------
A non-text attachment was scrubbed…
Name: SDL-GLESv2-android.diff
Type: text/x-patch
Size: 9133 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20110722/f68fd8b6/attachment.bin

Hi Manuel,

To support more general context intialization, I have used the

EGLConfigChooser from GLSurfaceView.java (which is part of the
offical android opengl framework so it should be well tested on actual
devices) - see the attached patch.

No luck with the patch I’m afraid - in fact the app now instantly crashes
rather than simply running without any graphics. No sound, I get the error*:*

“AudioPolicyManagerBase: Unknown stream type”

That’s on the HW: everything still works fine on the emulator. That said the
aliens.c example doesn’t use SDL_OPENGL, so I don’t think adding
SDL_GL_SetAttribute would do anything.
Are there any complete apps using this code-base that I could try out? I
really just want to get something, anything, to actually run on the hardware

  • then I can work from there. So far though even the simplest example
    available just vibrates and crashes.

Well, I did manage to get OpenTyrian working the other day on the real
device, but that uses Peyla’s SDL1.6
porthttp://www.anddev.org/sdl_port_for_android_sdk-ndk_16-t9218.htmlrather
than this one.

William

On 23 July 2011 03:52, Manuel Massing <m.massing at warped-space.de> wrote:

Hi William,

Thanks for the reply Forest - where is the context specified, do you
know?
There are a lot of source files in the port - I’m guessing one of the
Java
glue files, right? I’ve used the SDK before but this is my first NDK
project - guess I’m not going to avoid hacking around with things…

you will find the OpenGL ES context initialization code inside

   android-project/src/org/libsdl/app/SDLActivity.java

but as you have noticed, it is fairly limited (it does not support OpenGL
ES
2.0 correctly).

To support more general context intialization, I have used the
EGLConfigChooser from GLSurfaceView.java (which is part of the
offical android opengl framework so it should be well tested on actual
devices) - see the attached patch.

Caveat: although easily remedied, the patch currently uses hardcoded values
for preferred rgb and depth-buffer bit depths (mirroring the default
preferred
config in GLSurfaceView).

Select the EGL version using SDL_GL_SetAttribute, e.g. for OpenGL ES 2.0:

   SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
   SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);

It would be great if someone could submit this patch.

cheers,

   Manuel

Sorry, that’s SDL 1.2, not 1.6 ;)On 23 July 2011 12:41, William Dyce <@William_Dyce> wrote:

Hi Manuel,

To support more general context intialization, I have used the

EGLConfigChooser from GLSurfaceView.java (which is part of the
offical android opengl framework so it should be well tested on actual
devices) - see the attached patch.

No luck with the patch I’m afraid - in fact the app now instantly crashes
rather than simply running without any graphics. No sound, I get the error
*:

“AudioPolicyManagerBase: Unknown stream type”

That’s on the HW: everything still works fine on the emulator. That said
the aliens.c example doesn’t use SDL_OPENGL, so I don’t think adding
SDL_GL_SetAttribute would do anything.
Are there any complete apps using this code-base that I could try out? I
really just want to get something, anything, to actually run on the hardware

  • then I can work from there. So far though even the simplest example
    available just vibrates and crashes.

Well, I did manage to get OpenTyrian working the other day on the real
device, but that uses Peyla’s SDL1.6 porthttp://www.anddev.org/sdl_port_for_android_sdk-ndk_16-t9218.htmlrather than this one.

William

On 23 July 2011 03:52, Manuel Massing <m.massing at warped-space.de> wrote:

Hi William,

Thanks for the reply Forest - where is the context specified, do you
know?
There are a lot of source files in the port - I’m guessing one of the
Java
glue files, right? I’ve used the SDK before but this is my first NDK
project - guess I’m not going to avoid hacking around with things…

you will find the OpenGL ES context initialization code inside

   android-project/src/org/libsdl/app/SDLActivity.java

but as you have noticed, it is fairly limited (it does not support OpenGL
ES
2.0 correctly).

To support more general context intialization, I have used the
EGLConfigChooser from GLSurfaceView.java (which is part of the
offical android opengl framework so it should be well tested on actual
devices) - see the attached patch.

Caveat: although easily remedied, the patch currently uses hardcoded
values
for preferred rgb and depth-buffer bit depths (mirroring the default
preferred
config in GLSurfaceView).

Select the EGL version using SDL_GL_SetAttribute, e.g. for OpenGL ES 2.0:

   SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
   SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);

It would be great if someone could submit this patch.

cheers,

   Manuel