Hello everybody,
I have been silent, but still working on my game using Orx. I have some playable demo and I started to fiddle with testing it on Android, and hit a wall.
I downloaded from svn, and followed the
wiki tutorial. Unfortunately, I ran into a couple of errors.
First, not all resources are added to the apk by default which results in a missing class (the superclass of the main class, no less). So I edited the project properties: Java Build Path > Order and Export, and selected NvEvent.jar. Perhaps this should be updated directly in svn so future newcomers don't face this problem? Or was I doing something wrong and only solved this by luck?
Second, this one I have not been able to figure out. I encounter this error while running oxrTest:
(orxDisplay_Android_CompileShader() - include/../plugins/Display/android/orxDisplay.c:678) [Assertion failed] : <eError == GL_NO_ERROR && "OpenGL error code: 0x501">
I saw in another
thread that this error happened, but I do not have large textures... I am just trying to run the demo!
Thanks in advance.
Edit: Oh, I forgot to mention, this happens even if I remove the shader effect from the Ball object.
Comments
inside of orxDisplay_Android_Init(). I, however, have no enough knowledge of Orx to debug effectively.
Help is much appreciated!
Thanks
looks like shaders don't work on your phone. Does it support OpenGL ES 2.0?
I haven't touched the Android version myself so faistoiplaisir and lydesik will be able to give you more info or correct me, but I don't think they support OpenGL ES 1.1 for the Android version (which would be used by old hardware/OS I guess?).
In any case, it would really help if at least this was not needed to run in the emulator, otherwise debugging would be a nightmare if one can only run directly on the device.
Thanks.
I see the emulator recently (last month) introduced support for OpenGL ES 2.0, so maybe things will work if you have your build environment up to date.
I didn't know that the emulator was now supporting OGL ES 2.0, that's a good news!
As for debugging on the device, I guess it's only for debugging Android-specific features as you can still run the game natively on win/linux/osx, so it shouldn't have been that much of a drawback and should hopefully happen pretty late in the development process.
Shader support in orx isn't global, it's defined in every display plugins and those are different for computers, iOS and Android.
On computers, there's no OpenGL ES 1.1 vs 2.0 issue and shaders will only be supported if your hardware support them.
On iOS/Android, there are two versions of OpenGL ES available:
- OpenGL ES 1.1: this version has a fixed pipeline and does not support shaders
- OpenGL ES 2.0: this version doesn't have a fixed pipeline and requires shaders
The current iOS plugin supports both OpenGL ES 1.1 and OpenGL ES 2.0, it'll try to initialize OGL ES 2.0 first and will fallback on 1.1 were it to fail (and ignore shaders).
The current Android plugins only supports OpenGL ES 2.0 as far as I know. However I can't give you the exact reasons, only faistoiplaisir and lydesik would be able to answer that question as they are the authors/maintainers of the current Android plugins.
Why ? Because developpers were lazy to do it ^^
Another point is that shaders aren't supported by opengl es 1.1.
As far as I know, only very old Android device doesn't support Opengl es 2, so this reason contribute to don't support opengl 1.1.
And, because opengl es 1.1 and opengl 2 are not in the same library, there's some additionnal stuff to do.
If someone want to do that, why not
The problem is that I don't know if I have an OpenGL ES 2.0 compatible device. And I cannot see the log in the device, so I don't know where it crashes. I have even removed the offending shader calls from orx and recompiled, and it now gets further before it fails. (It actually makes it to the render part of the MainLoop in orxAndroidSupport.cpp)
I see that the android emulator doesn't support OpenGL ES 2.0 as of now, although they do support GPU emulation and acceleration. I guess if all else fails, I might just go ahead and add compatibility to OpenGL ES 1.1 to orx, but I would probably need a ton of help in getting to know what to do.
For starters, what would be needed to make this happen? What is missing? Can anyone give me a simple roadmap? Would it be very difficult? I have some (as in, I have built a couple of applications for data visualization, so, not much ) experience coding in OpenGL, but I have never used ES.
Thanks a bunch again!
http://android-developers.blogspot.ca/2012/04/faster-emulator-with-better-hardware.html
You either have to pic one at compile time or have to dynamically load the library you need.
But if you manage to pass that hurdle, actually supporting a fixed pipeline shouldn't be too bad and you can use the iOS plugin as an inspiration (which is already an inspiration to the Android OGL ES 2.0 version if I'm not wrong).
search for "opengl extension" in the Android Market from your device (not the website)
If you can see the app in the result, your device supports OpenGL ES 2.0, you can install and test, if you don't see the app, it means the market hides it for you because your device doesn't support it.
As irawain said, it should not be difficult to write an OpenGL ES 1 Display driver for orx.
The easyest way would be to write a completly new driver and new make rules to link against opengles 1 lib instead of opengles 2 lib,
a better but more complex way would be to dynamicaly link to the right lib, and retrieve the functions pointers...
Honestly, I won't do this myself as opengl ES 1 devices represent a few percentage, and I think mainly used by non-gamers users. (sorry for you if you are in that case)
lydesik
- OpenGL ES 1.X doesn't have any shader support at all
- OpenGL ES 2.0 has support for OpenGL ES Shading Language 1.0 (there's no newer version yet).
So I'm not sure what's going wrong with your phone.
/data/data/<packagename>/files/
you can retrieve it with adb pull
but it's not really usefull as everything is already sent to logcat
on which device are you running exaclty? manufacturer / model ?
it might be that the share compiler / linker doesn't like something (like variable name etc...)
lydesik