Android Port

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Post Reply
kine
Posts: 18
Joined: Tue Mar 23, 2010 9:40 am

Post by kine »

sorry but I don't have time now to mess into ellis's depot for the moment , maybe he'll recover a previous es 1.0 version. Anyway if you prefer an opengl es 2.0 version here it is :
http://www.megaupload.com/?d=AUV9R1L4

but this version is open gl es 2.0 only, based on irrlicht 1.7.1.

Be sure to update your android drivers, and place the directory "data" at your sdcard root path, for the rest apply the 1.0 version procedure.
Kalango
Posts: 157
Joined: Thu Apr 26, 2007 12:46 am

Post by Kalango »

Any plans on updating the code to NDK r5?
ellis2323
Posts: 37
Joined: Fri Feb 05, 2010 5:33 pm

OGLES 2.x support

Post by ellis2323 »

The OGLES 2.x is only available with SDK 6. And i use a java function to select EGL 2.x context available in SDK 8 only. so you need to select 8. If you want use OGLES 1.x only drivers you can. just remove EGL 2.x switch and select DRIVER OGLES1.
ellis2323
Posts: 37
Joined: Fri Feb 05, 2010 5:33 pm

NDK r5 issue ?

Post by ellis2323 »

What's the problem. it works fine with ndk-build
hejeon
Posts: 1
Joined: Fri Feb 11, 2011 4:05 am
Location: Seoul , Korea

test result with emulator

Post by hejeon »

I tried test current source.
compile with ndk-r4b and ndk-r5b
both of these are all succeed (compile)
but runtime, it is not work.

so I change some code in android-activity.cpp.

...
void Java_com_ellismarkov_irrlicht_IrrlichtTest_nativeInitGL( JNIEnv* env )
{
importGLInit();
device = createDevice( video::EDT_OGLES1, dimension2d<u32>
(gWindowWidth, gWindowHeight), 16, false, false, false, 0);
...

original code is set video::EDT_OGLES2.

if set video::EDT_OGLES1, sydney is run well on emulator ( both of r4b, r5b)
-----------------------------------------------------
send e-mail to me : jeonhoeun@nate.com
-----------------------------------------------------
gururise
Posts: 4
Joined: Mon Feb 14, 2011 7:23 pm

Post by gururise »

Kalango wrote:Any plans on updating the code to NDK r5?
I too am wondering if there are any plans on using the new features of NDK r5? It seems like there are some things that might be useful, and possibly get rid of many/most JNI calls:
  • * Adds support for native activities, which allows you to implement the Android application lifecycle in native code.
    * Input subsystem (such as the keyboard and touch screen)
    * Access to sensor data (accelerometer, compass, gyroscope, etc)
    * Event loop APIs to wait for things such as input and sensor events.
    * Window and surface subsystem
    * Audio APIs based on the OpenSL ES standard that support playback and recording as well as control over platform audio effects
    * Access to assets packaged in an .apk file.
gavin_pugh
Posts: 3
Joined: Wed Feb 16, 2011 8:02 am
Location: Los Angeles, CA.
Contact:

Post by gavin_pugh »

Hi,

Curious about the status of this port, specifically the one here:
http://gitorious.org/irrlichtandroid/

As-is, the code wasn't working for me. I am using vs-android http://code.google.com/p/vs-android/ instead of ndk-build though, possibly there's other issues introduced here.

The OpenGL ES 1 driver though works fine if I switch to it, hejeon details it a few posts above.

With adding a little more Java code to correctly setup GLES2, I was able to at least get it to run with ES2, but Sydney appears untextured. Anyone else getting the same problem?

The ES1 version though works just great, so I'm continuing along tinkering with that for now. Thanks a lot for putting this port together!

Oh, the other thing I noticed with ES2 is that a couple of shader files were missing from the /sdcard directory, these two:
- COGLES2ParallaxMap.fsh
- COGLES2ParallaxMap.vsh
The app won't boot without them. I grabbed both from the archive that kine posted instead:
http://www.megaupload.com/?d=AUV9R1L4
gururise
Posts: 4
Joined: Mon Feb 14, 2011 7:23 pm

Post by gururise »

I changed to OGL ES 1.0 in the android-activity.cpp file via video::EDT_OGLES1; however, with the latest git running on the 2.1 emulator, I get the following error:

Code: Select all

02-16 13:35:05.542: INFO/log(782): Irrlicht Engine version 1.7.0-beta
02-16 13:35:05.552: INFO/Irrlicht(782): CIrrDeviceAndroid::CIrrDeviceAndroid
02-16 13:35:05.552: INFO/Irrlicht(782): CIrrDeviceAndroid::createDriver
02-16 13:35:05.562: INFO/log(782): OpenGL-ES2 initialized
02-16 13:35:05.571: INFO/Irrlicht(782): OGLES2 initialized
02-16 13:35:05.581: INFO/log(782): Using renderer: OpenGL ES-CM 1.0
02-16 13:35:05.581: INFO/log(782): Android
02-16 13:35:05.593: INFO/log(782): GL_OES_byte_coordinates GL_OES_fixed_point GL_OES_single_precision GL_OES_read_format GL_OES_compressed_paletted_texture GL_OES_draw_texture GL_OES_matrix_get GL_OES_query_matrix GL_OES_EGL_image GL_ARB_texture_compression GL_ARB_texture_non_power_of_two GL_ANDROID_user_clip_plane GL_ANDROID_vertex_buffer_object GL_ANDROID_generate_mipmap 
02-16 13:35:05.593: INFO/log(782): load shader: /mnt/sdcard/Irrlicht/COGLES2FixedPipeline.vsh
02-16 13:35:05.593: ERROR/libEGL(782): called unimplemented OpenGL ES API
02-16 13:35:05.603: INFO/log(782): C
02-16 13:35:05.613: INFO/log(782): Error reading fixed pipeline vertex shader.
02-16 13:35:05.622: INFO/log(782): C
02-16 13:35:05.622: INFO/log(782): Error reading fixed pipeline fragment shader.
02-16 13:35:05.622: ERROR/libEGL(782): called unimplemented OpenGL ES API
02-16 13:35:05.622: ERROR/libEGL(782): called unimplemented OpenGL ES API
02-16 13:35:05.622: ERROR/libEGL(782): called unimplemented OpenGL ES API
02-16 13:35:05.622: ERROR/libEGL(782): called unimplemented OpenGL ES API
02-16 13:35:05.632: ERROR/libEGL(782): called unimplemented OpenGL ES API
02-16 13:35:05.632: ERROR/libEGL(782): called unimplemented OpenGL ES API
02-16 13:35:05.632: ERROR/libEGL(782): called unimplemented OpenGL ES API
02-16 13:35:05.632: ERROR/libEGL(782): called unimplemented OpenGL ES API
02-16 13:35:05.642: ERROR/libEGL(782): called unimplemented OpenGL ES API
02-16 13:35:05.642: INFO/log(782): GLSL shader program failed to link
02-16 13:35:05.642: ERROR/libEGL(782): called unimplemented OpenGL ES API
02-16 13:35:05.652: ERROR/libEGL(782): called unimplemented OpenGL ES API
02-16 13:35:05.652: INFO/log(782): ????
02-16 13:35:05.652: INFO/log(782): Error linking fixed pipeline shader program.
02-16 13:35:05.652: INFO/log(782): Shader loaded
02-16 13:35:05.652: ERROR/libEGL(782): called unimplemented OpenGL ES API
02-16 13:35:05.652: INFO/log(782): load shader: /mnt/sdcard/Irrlicht/COGLES2Renderer2D.vsh
02-16 13:35:05.652: ERROR/libEGL(782): called unimplemented OpenGL ES API
02-16 13:35:05.652: INFO/log(782): C0C
02-16 13:35:05.652: INFO/log(782): Error reading fixed pipeline vertex shader.
02-16 13:35:05.652: INFO/log(782): C0C
02-16 13:35:05.652: INFO/log(782): Error reading fixed pipeline fragment shader.
02-16 13:35:05.652: ERROR/libEGL(782): called unimplemented OpenGL ES API
02-16 13:35:05.661: ERROR/libEGL(782): called unimplemented OpenGL ES API
02-16 13:35:05.673: ERROR/libEGL(782): called unimplemented OpenGL ES API
02-16 13:35:05.673: ERROR/libEGL(782): called unimplemented OpenGL ES API
02-16 13:35:05.673: ERROR/libEGL(782): called unimplemented OpenGL ES API
02-16 13:35:05.673: ERROR/libEGL(782): called unimplemented OpenGL ES API
02-16 13:35:05.673: ERROR/libEGL(782): called unimplemented OpenGL ES API
02-16 13:35:05.673: ERROR/libEGL(782): called unimplemented OpenGL ES API
02-16 13:35:05.673: ERROR/libEGL(782): called unimplemented OpenGL ES API
02-16 13:35:05.673: INFO/log(782): GLSL shader program failed to link
02-16 13:35:05.673: ERROR/libEGL(782): called unimplemented OpenGL ES API
02-16 13:35:05.673: ERROR/libEGL(782): called unimplemented OpenGL ES API
02-16 13:35:05.673: INFO/log(782): ????
02-16 13:35:05.673: INFO/log(782): Error linking fixed pipeline shader program.
02-16 13:35:05.673: INFO/log(782): Shader loaded
02-16 13:35:05.673: ERROR/libEGL(782): called unimplemented OpenGL ES API
02-16 13:35:05.833: INFO/DEBUG(28): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
02-16 13:35:05.833: INFO/DEBUG(28): Build fingerprint: 'generic/sdk/generic/:2.1-update1/ECLAIR/35983:eng/test-keys'
Any suggestions??
gavin_pugh
Posts: 3
Joined: Wed Feb 16, 2011 8:02 am
Location: Los Angeles, CA.
Contact:

Post by gavin_pugh »

Are you sure it recompiled correctly? Did ndk-build show that it recompiled that particular file without error?

These two lines:
02-16 13:35:05.562: INFO/log(782): OpenGL-ES2 initialized
02-16 13:35:05.571: INFO/Irrlicht(782): OGLES2 initialized
Show that it's still trying to use the ES2 driver.
gururise
Posts: 4
Joined: Mon Feb 14, 2011 7:23 pm

Post by gururise »

gavin_pugh wrote:Are you sure it recompiled correctly? Did ndk-build show that it recompiled that particular file without error?

These two lines:
02-16 13:35:05.562: INFO/log(782): OpenGL-ES2 initialized
02-16 13:35:05.571: INFO/Irrlicht(782): OGLES2 initialized
Show that it's still trying to use the ES2 driver.
I did an:
> ndk-build clean
> ndk-build

and it seems to have rebuilt everything. I saw those two lines, but just under it, it says:
Using renderer: OpenGL ES-CM 1.0

in the nativeInitGL function, I have the following:

Code: Select all

importGLInit();
device = createDevice( video::EDT_OGLES1, dimension2d<u32>(gWindowWidth, gWindowHeight), 16, false, false, false, 0);
driver = device->getVideoDriver();
...
gavin_pugh
Posts: 3
Joined: Wed Feb 16, 2011 8:02 am
Location: Los Angeles, CA.
Contact:

Post by gavin_pugh »

Yeah, this line:
Using renderer: OpenGL ES-CM 1.0
Also appears when I try and use GL2; the call to check the 'GL_VERSION' returns 1.0. The issue is to how the Java code sets things up. If you borrow the Java init code from the NDK GL2 example, you can get Irrlicht to boot up in GL2. However as I mention a few posts up, Sydney appears untextured.

Essentially your output is exactly what I get when I compiled the 'virgin' code from git. To lend further proof to it using the 2.0 driver, most of the rest of your output is trying to load shader files. :)

I'd suggest adding some calls to:
__android_log_print()
Around your change to use the GL1 driver. So you can at least see that you're able to see that you can make changes to the code.

Remember you need to rebuild the apk afterwards, ndk-build doesn't do that for you.
ellis2323
Posts: 37
Joined: Fri Feb 05, 2010 5:33 pm

NDK r5

Post by ellis2323 »

I have no interest in NativeActivity because it requires android 2.3 devices. But it is an easy task. I recommend this method for a good port.

Otherwise, if my last push add the OGLES 2.x driver, if you need the OGLES 1.x code juste use the previous revision with git.
skreamz_
Posts: 24
Joined: Sun Jan 17, 2010 9:56 pm

Post by skreamz_ »

hi there, hoping someone could help me.

im using ellis2323 android port. when my game loses focus either through the use of home button, back button or some other way. when the app gets refocused i get a black screen with white areas where my textures were.
ive tried reloading the textures without any luck, was just wondering how you all handle the loss and regain of focus?

Thank you.
Sfortza
Posts: 39
Joined: Thu Mar 17, 2011 12:40 pm
Location: 184

Device dimensions

Post by Sfortza »

I try to create device with dimensions as on my physical device (Nexus One - 480x800).

// global variables
int gWindowWidth = 480;
int gWindowHeight = 800;

device = createDevice( video::EDT_OGLES1, dimension2d<u32>(gWindowWidth, gWindowHeight), 16, false, false, false, 0);

But when ...IrrlichtTest_nativeResize( JNIEnv* env, jobject thiz, jint w, jint h ) method is executed window resizes to 320x480...default irrlicht device dimensions?

Why does it happen?

It it right to try create irrlicht device corresponding to my physical device dimensions?

Thank you.
pmtolk
Posts: 8
Joined: Fri Jul 30, 2010 3:51 am

cannot bind texture on android 2.3

Post by pmtolk »

01-07 03:11:10.684: INFO/log(28446): Irrlicht Engine version 1.7.0-beta
01-07 03:11:10.684: INFO/Irrlicht(28446): CIrrDeviceAndroid::CIrrDeviceAndroid
01-07 03:11:10.684: INFO/Irrlicht(28446): CIrrDeviceAndroid::createDriver
01-07 03:11:10.684: INFO/log(28446): Using renderer: OpenGL ES-CM 1.1
01-07 03:11:10.684: INFO/log(28446): Qualcomm
01-07 03:11:10.684: INFO/log(28446): GL_AMD_compressed_3DC_texture GL_AMD_compressed_ATC_texture GL_AMD_performance_monitor GL_APPLE_texture_2D_limited_npot GL_EXT_texture_filter_anisotropic GL_EXT_texture_format_BGRA8888 GL_EXT_texture_type_2_10_10_10_REV GL_OES_blend_equation_separate GL_OES_blend_func_separate GL_OES_blend_subtract GL_OES_compressed_ETC1_RGB8_texture GL_OES_compressed_paletted_texture GL_OES_depth_texture GL_OES_draw_texture GL_OES_framebuffer_object GL_OES_matrix_palette GL_OES_packed_depth_stencil GL_OES_point_size_array GL_OES_point_sprite GL_OES_read_format GL_OES_rgb8_rgba8 GL_OES_stencil_wrap GL_OES_EGL_image GL_OES_texture_cube_map GL_OES_texture_env_crossbar GL_OES_texture_float GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_texture_npot GL_OES_texture_mirrored_repeat GL_QCOM_binning_control GL_QCOM_extended_get GL_QCOM_tiled_rendering
01-07 03:11:10.694: INFO/log(28446): GL_INVALID_ENUM
01-07 03:11:10.694: INFO/log(28446): Could not bind Texture
01-07 03:11:10.694: INFO/Irrlicht(28446): createDevice r=3048792 w=320 h=480
01-07 03:11:10.694: INFO/Irrlicht(28446): getVideoDriver r=3049488
01-07 03:11:10.694: INFO/Irrlicht(28446): resize w=320 h=519
01-07 03:11:11.194: INFO/log(28446): Loaded mesh
01-07 03:11:11.214: INFO/log(28446): Loaded texture
01-07 03:11:11.214: INFO/Irrlicht(28446): add texture
01-07 03:11:11.214: INFO/Irrlicht(28446): beginScene

This is the complete Log Error
Post Reply