Android Port
Re: Android Port
Thank you.
Nadro, you published games that use irrlicht on Google Play, right? Can you share with us your way to get the screen resolution when creating the device in jni?
Nadro, you published games that use irrlicht on Google Play, right? Can you share with us your way to get the screen resolution when creating the device in jni?
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps
Step back! I have a void pointer, and I'm not afraid to use it!
Height2Normal v. 2.1 - convert height maps to normal maps
Step back! I have a void pointer, and I'm not afraid to use it!
Re: Android Port
I published games only on AppStore, we'll publish games on Google Play in future, but currently Android port of our games isn't ready.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Re: Android Port
Oh... so you haven't solved this problem yet? I looked into it, they say the correct way to do this is pass the resolution from java code... no idea how to do that since I only have c++ code.
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps
Step back! I have a void pointer, and I'm not afraid to use it!
Height2Normal v. 2.1 - convert height maps to normal maps
Step back! I have a void pointer, and I'm not afraid to use it!
Re: Android Port
my 5 cents on how to get screen resolution in android as native app: in CIrrDeviceAndroid.cpp, after APP_CMD_INIT_WINDOW is called, the screen size values is available in android_app. Look for the following code:
After IsReady, use something like the following to get the width/height:
i am new here and good to see an active mobile community in irrlicht. cheers
Code: Select all
while( IsReady == false )
Code: Select all
// Check if screen dimension is set. If not, use size of Android->window.
DeviceWidth = (DeviceWidth > 0) ? DeviceWidth : ANativeWindow_getWidth(Android->window);
DeviceHeight = (DeviceHeight > 0) ? DeviceHeight : ANativeWindow_getHeight(Android->window);
Re: Android Port
Thank you, this helped a lot! I now have a way to determine the screen resolution in a few easy steps. It does require a dummy device, but that's quite ok as that's the same approach you use on desktop, no engine changes necessary.
Cheers
The best way would still be to do as you said though, I'll try it out later
Code: Select all
SIrrlichtCreationParameters param;
param.DriverType = EDT_OGLES2;
param.WindowSize = dimension2d<u32>(320, 240);
param.PrivateData = app;
param.Bits = 24;
param.ZBufferBits = 16;
param.AntiAlias = 0;
device = createDeviceEx(param);
int w= ANativeWindow_getWidth(app->window);
int h= ANativeWindow_getHeight(app->window);
device->closeDevice();
param.WindowSize = dimension2d<u32>(w, h);
device = createDeviceEx(param);
The best way would still be to do as you said though, I'll try it out later
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps
Step back! I have a void pointer, and I'm not afraid to use it!
Height2Normal v. 2.1 - convert height maps to normal maps
Step back! I have a void pointer, and I'm not afraid to use it!
Re: Android Port
Definitly we should integrate support for it inside engine.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Re: Android Port
So... after the ISReady line, this code seems to work flawlessly:
Code: Select all
DeviceWidth = (DeviceWidth > 0) ? DeviceWidth : ANativeWindow_getWidth(Android->window);
DeviceHeight = (DeviceHeight > 0) ? DeviceHeight : ANativeWindow_getHeight(Android->window);
CreationParams.WindowSize.Width= DeviceWidth;
CreationParams.WindowSize.Height= DeviceHeight;
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps
Step back! I have a void pointer, and I'm not afraid to use it!
Height2Normal v. 2.1 - convert height maps to normal maps
Step back! I have a void pointer, and I'm not afraid to use it!
Re: Android Port
Any idea when we could get OpenGL ES 3.0 driver?
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps
Step back! I have a void pointer, and I'm not afraid to use it!
Height2Normal v. 2.1 - convert height maps to normal maps
Step back! I have a void pointer, and I'm not afraid to use it!
Handle Andoid EGLContext losing
@Nadro:
When Activity onPause, the EGLContext is lost, and all textures and VBO are invalid. Any way to handle it on Irrlicht? Now the HelloMobile sample is black after press Home key and return to app.
When Activity onPause, the EGLContext is lost, and all textures and VBO are invalid. Any way to handle it on Irrlicht? Now the HelloMobile sample is black after press Home key and return to app.
Re: Android Port
I guess you have to handle it yourself and re-create the whole device. There is a functions you can implement and then set: http://developer.android.com/reference/ ... ivity.html
Code: Select all
android_app* state;
...
static void engine_handle_cmd(struct android_app* app, int32_t cmd)
{
//handle command here
}
...
state->onAppCmd = engine_handle_cmd;
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps
Step back! I have a void pointer, and I'm not afraid to use it!
Height2Normal v. 2.1 - convert height maps to normal maps
Step back! I have a void pointer, and I'm not afraid to use it!
Re: Android Port
@ent1ty
Both OpenGL 3.3 and ES3.0 should be available before end of this year in shader-pipeline branch.
@penguin03
What about context lost on Android? Android 4.0+ is able to hold context, for older Android versions you have to recreate data manually as ent1ty.
Both OpenGL 3.3 and ES3.0 should be available before end of this year in shader-pipeline branch.
@penguin03
What about context lost on Android? Android 4.0+ is able to hold context, for older Android versions you have to recreate data manually as ent1ty.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Re: Android Port
@ent1ty
You are right, we need to re-create the whole device, it's a little tough to restore the game state after re-create the whole device. I'll try it.
@Nadro
The OpenGL es context holding depends on Hardware driver. Not all Android 4.0 + device can support it. I use Samsung Galaxy Note II to test the the HelloMobile sample, it can't support it, its Android version is 4.1.2.
You are right, we need to re-create the whole device, it's a little tough to restore the game state after re-create the whole device. I'll try it.
@Nadro
The OpenGL es context holding depends on Hardware driver. Not all Android 4.0 + device can support it. I use Samsung Galaxy Note II to test the the HelloMobile sample, it can't support it, its Android version is 4.1.2.
Re: Android Port
Nice! Keep up the good workNadro wrote:@ent1ty
Both OpenGL 3.3 and ES3.0 should be available before end of this year in shader-pipeline branch.
Nadro wrote: @penguin03
What about context lost on Android? Android 4.0+ is able to hold context, for older Android versions you have to recreate data manually as ent1ty.
Yeah, same on Nexus 7 with android 4.3penguin03 wrote:The OpenGL es context holding depends on Hardware driver. Not all Android 4.0 + device can support it. I use Samsung Galaxy Note II to test the the HelloMobile sample, it can't support it, its Android version is 4.1.2.
Edit: this looks interesting: http://stackoverflow.com/questions/2112 ... gl-context
Does irrlicht already do this?
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps
Step back! I have a void pointer, and I'm not afraid to use it!
Height2Normal v. 2.1 - convert height maps to normal maps
Step back! I have a void pointer, and I'm not afraid to use it!
Re: Android Port
Irrlicht need some changes to support GLSurfaceView as alternative for EGL window created from C++ code.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Re: Android Port
I'm getting quite horrible seams using the OGLES2 driver:
On desktop there are none to barely noticeable ones(OpenGL), any advice on how to get rid of them?
Edit: my near/far values are 1.0/1800.0, i tried increasing the near value to 100.0, still didn't really help
Edit 2: I tried adding glClearDepthf(1.0); to the if (zBuffer){ ... } block in beginScene, as described here: http://stackoverflow.com/questions/1183 ... sing-glkit (thanks Strong99) but it doesn't seem to help in any way. I'm not feeling particularly 'at home' with editing irrlicht source, am I doing something wrong?
On desktop there are none to barely noticeable ones(OpenGL), any advice on how to get rid of them?
Edit: my near/far values are 1.0/1800.0, i tried increasing the near value to 100.0, still didn't really help
Edit 2: I tried adding glClearDepthf(1.0); to the if (zBuffer){ ... } block in beginScene, as described here: http://stackoverflow.com/questions/1183 ... sing-glkit (thanks Strong99) but it doesn't seem to help in any way. I'm not feeling particularly 'at home' with editing irrlicht source, am I doing something wrong?
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps
Step back! I have a void pointer, and I'm not afraid to use it!
Height2Normal v. 2.1 - convert height maps to normal maps
Step back! I have a void pointer, and I'm not afraid to use it!