Android Port
Re: Android Port
Looks as if the floating point precision is too low.
Re: Android Port
Yep, seems like you're using a 16-bit or 8-bit depth buffer. Does your device offer higher precision?
Re: Android Port
The supported depth buffer precision should be at least 16 bits if not 24(nexus 7, nothing ancient), I think that should be quite sufficient for near/far values of 1.0/2000.0(irrlicht default). However it seems like i'm getting a 8-bit one instead. I tried various settings in SIrrlichtCreationParams::ZBufferBits but it seems to have no effect(no difference at all between 8, 16 or 24)
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
Just a small detail, Android.mk in the example 17.HelloWorldMobile shipped with the ogl-es branch links with irrlicht like this:
android ndk(r9) complains about this, warning this is likely to result in incorrect build. It seems to work anyway, but just to be on the safe side, I figured out how you're really supposed to link with prebuilt libs:
Cheers
Code: Select all
LOCAL_LDLIBS := -L$(LOCAL_PATH)/../../lib/Android -lEGL -llog -lGLESv1_CM -lGLESv2 -lz -landroid -lIrrlicht
Code: Select all
LOCAL_PATH := $(call my-dir)/..
IRRLICHT_PROJECT_PATH := $(LOCAL_PATH)
include $(CLEAR_VARS)
LOCAL_MODULE := Irrlicht
LOCAL_SRC_FILES := -L$(LOCAL_PATH)/../irrlicht-4565/lib/Android/libIrrlicht.a
include $(PREBUILT_STATIC_LIBRARY)
#actual config for your app begins here
include $(CLEAR_VARS)
...
...
...
LOCAL_LDLIBS := -lEGL -llog -lGLESv1_CM -lGLESv2 -lz -landroid
LOCAL_STATIC_LIBRARIES := android_native_app_glue Irrlicht
...
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
Thanks for info, it will be improved in next update.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Re: Android Port
In latest commit one major issue was fixed - OpenGL context lost when application was paused and next resumed. Currently only OGLES1 driver is supported, but it'll be fixed tomorrow. In next few days Android support should be improved a lot.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Re: Android Port
Hi Nadro, this is great news for me. Thanks for the work!
Re: Android Port
I found 2 issues with current code:
- Application crash at resume (when Application was locked).
- MultiTouch event UP doesn't work properly.
I'll fix these issues today If you will find some other issues please report it.
- Application crash at resume (when Application was locked).
- MultiTouch event UP doesn't work properly.
I'll fix these issues today If you will find some other issues please report it.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Re: Android Port
Hi Nadro, not really a bug report, but if the following can be added to the constructor of CIrrDeviceAndroid, it will be good.
If user specified w=0 and h=0 when creating the device, the constructor can then use the screen width and height, which is available after the do {…} while loop, to initialise.
Code: Select all
// after do {…} while(!Initialized);
CreationParams.WindowSize.Width = (CreationParams.WindowSize.Width > 0) ? CreationParams.WindowSize.Width : ANativeWindow_getWidth(Android->window);
CreationParams.WindowSize.Height = (CreationParams.WindowSize.Height > 0) ? CreationParams.WindowSize.Width : ANativeWindow_getHeight(Android->window);
Re: Android Port
Yep, I thought about similar functionality. I'll add it in the next commit Currently iOS use similar solution for set native resolution.
BTW. Issues from my previous post are already fixed.
UPDATE:
I already applied changes related to set native window resolution when window size creation params are equals to 0.
BTW. Issues from my previous post are already fixed.
UPDATE:
I already applied changes related to set native window resolution when window size creation params are equals to 0.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Re: Android Port
Hi Nadro, thanks for the good work. I am refactoring my own code a bit with the latest changes and have the following thoughts…
For android onAppCmd callback, my app also needs to be notified (to save state persistently, for example), but the event already handled within CIrrDeviceAndroid. As a work around, I assign a new callback to android_app after CIrrDeviceAndroid is created. CIrrDeviceAndroid still needs to handle the event so I call irr::CIrrDeviceAndroid::handleAndroidCommand within my new callback. See below.
A bit hackish but it works. One last problem is irr::CIrrDeviceAndroid::handleAndroidCommand is private, and I need to change in irrlicht source code to make it public. Hence if this function can be made public, or some other mechanism can be added for our own callback be triggered, it will be great!
Cheers!
For android onAppCmd callback, my app also needs to be notified (to save state persistently, for example), but the event already handled within CIrrDeviceAndroid. As a work around, I assign a new callback to android_app after CIrrDeviceAndroid is created. CIrrDeviceAndroid still needs to handle the event so I call irr::CIrrDeviceAndroid::handleAndroidCommand within my new callback. See below.
Code: Select all
m_pDevice = static_cast<IrrlichtDevice*>(new CIrrDeviceAndroid(param));
// use a custom onAppCmd callback
android_app* android = (android_app*)(param.PrivateData);
android->onAppCmd = customCallback;
…
void customCallback(android_app* app, int32_t cmd)
{
// my code goes here
……
// call original irrlicht callback function
irr::CIrrDeviceAndroid::handleAndroidCommand(app, cmd);
}
Cheers!
Re: Android Port
Hi, In future it should be solbed is some more user friendly way, but at this time this solution looks very well. Thanks for it, I'll change this command to public method in next commit.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Re: Android Port
I marked 2 static methods (input + commands) as public in last commit
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Re: Android Port
I'm providing nightly builds of the ogl-es branch with latest android ndk (r9b) here.
These are untested, so please contact me if anything seems wrong (you can pm me here on the forums, but I also usually hang out in #irrlicht on freenode).
These are untested, so please contact me if anything seems wrong (you can pm me here on the forums, but I also usually hang out in #irrlicht on freenode).
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've started using the android port today on my HTC One, compiling from Windows 7.
A few things:
-By default, you should switch from:
to:
because someone added in CIrrDeviceAndroid:
Regarding jni/Android.mk
-These command don't work because cp doesn't exist on windows (and mkdir doesn't seem to work either).
Question: as stated above, I'm on an HTC One, which is a hdpi device and the fonts are really incredibly small. Is it something that has to be fixed in the irrlicht render or is it something bound to the android view?
A few things:
-By default, you should switch from:
Code: Select all
param.WindowSize = dimension2d<u32>(480,854);
Code: Select all
param.WindowSize = dimension2d<u32>(0,0);
Code: Select all
if (Device->CreationParams.WindowSize.Width == 0 || Device->CreationParams.WindowSize.Height == 0)
{
Device->CreationParams.WindowSize.Width = ANativeWindow_getWidth(app->window);
Device->CreationParams.WindowSize.Height = ANativeWindow_getHeight(app->window);
}
-These command don't work because cp doesn't exist on windows (and mkdir doesn't seem to work either).
Code: Select all
#$(shell mkdir -p $(IRRLICHT_PROJECT_PATH)/assets)
#$(shell mkdir -p $(IRRLICHT_PROJECT_PATH)/assets/media)
#$(shell mkdir -p $(IRRLICHT_PROJECT_PATH)/assets/media/Shaders)
#$(shell mkdir -p $(IRRLICHT_PROJECT_PATH)/src)
#$(shell cp $(IRRLICHT_PROJECT_PATH)/../../media/Shaders/*.* $(IRRLICHT_PROJECT_PATH)/assets/media/Shaders/)
#$(shell cp $(IRRLICHT_PROJECT_PATH)/../../media/irrlichtlogo3.png $(IRRLICHT_PROJECT_PATH)/assets/media/)
#$(shell cp $(IRRLICHT_PROJECT_PATH)/../../media/sydney.md2 $(IRRLICHT_PROJECT_PATH)/assets/media/)
#$(shell cp $(IRRLICHT_PROJECT_PATH)/../../media/sydney.bmp $(IRRLICHT_PROJECT_PATH)/assets/media/)