android non-native

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
kaliber
Posts: 117
Joined: Sat Jan 17, 2009 12:51 pm

android non-native

Post by kaliber »

hi all, i try to create live wallpaper using irrlicht.
but live wallpaper use the draw iteration inside java.
how to make the draw iteratiin inside java and not using native activity ?

thanks in advance :)
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: android non-native

Post by Nadro »

Irrlicht use NDK, but you can mix JAVA and C++ via jni calls, so you will be able to do iteration in JAVA and use Irrlicht for rendering.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
kaliber
Posts: 117
Joined: Sat Jan 17, 2009 12:51 pm

Re: android non-native

Post by kaliber »

well yes i understand that irrlicht use NDK 8) ,
my problem is in the example 08 the IrrlichtDevice need an android_app object which passed from native android_main function.

Code: Select all

 
void android_main(struct android_app* app)
{
    app_dummy();
 
    struct irr::SIrrlichtCreationParameters p;
    p.DriverType = video::EDT_OGLES2;
    
    // The android app object is needed by the irrlicht device.
    p.PrivateData = app;
        
    p.WindowSize = core::dimension2d<u32>(1280,800);
    IrrlichtDevice *device = createDeviceEx(p);
    
}
 
and if i use JNI how to create IrrlichtDevice with android_app object.... :? :?
here is what i try :

Code: Select all

 
void load()
{
    __android_log_print(ANDROID_LOG_VERBOSE, APPNAME, "Before Create Device");
        
       device=createDevice( video::EDT_OGLES2, core::dimension2d<u32>(320, 240), 16, false, false, false, 0);
    
    __android_log_print(ANDROID_LOG_VERBOSE, APPNAME, "After Create Device");
    
    driver = device->getVideoDriver();
    smgr = device->getSceneManager();
    
}
and the code stopped at createDevice... :? any help ... ?? :D
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: android non-native

Post by Nadro »

In your jni code p.PrivateData is empty. It must include android_app data. Currently iOS and Android require createDeviceEx call for create device, simple createDevice doesn't work.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
kaliber
Posts: 117
Joined: Sat Jan 17, 2009 12:51 pm

Re: android non-native

Post by kaliber »

ok, is that mean i can't use irrlicht for android live wallpaper, yet? or there is another way ? :)
because android_app data only exist on native activity... CMIIW
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: android non-native

Post by Nadro »

You can't use Irrlicht on Android without native activity (we don't have plans to change this state - support without ndk, even in future). Anyway you can still use some jni calls tricks, but I'm not sure if it's possible for features like a live wallpapers.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Post Reply