GUI Events (Android)

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
Arclamp
Posts: 71
Joined: Thu Oct 10, 2013 7:45 pm

GUI Events (Android)

Post by Arclamp »

Hi,

Using example 27, I add a statement for the GUI but it doesn't receive events. Is this expected as it doesn't handle the GUI events or am I missing something?

Thanks



I'm using the Android branch found here: https://github.com/kexplo/irrlicht_ogl-es

Code: Select all

 
#include <android/log.h>
 
    virtual bool OnEvent(const SEvent& event)
    {
        if (event.EventType == EET_GUI_EVENT)
        {
            __android_log_print(ANDROID_LOG_WARN, "Irrlicht", "LOG(A) GUI EVENT ******************************");
        }
 
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: GUI Events (Android)

Post by CuteAlien »

No idea who maintains that branch, but it's not ours. To have gui-events you currently have to create mouse-events for the touch-events you get. See the example in our official branch.
It can be found at: https://sourceforge.net/p/irrlicht/code ... es/ogl-es/
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Arclamp
Posts: 71
Joined: Thu Oct 10, 2013 7:45 pm

Re: GUI Events (Android)

Post by Arclamp »

Oooh, that looks better, thankyou.
Arclamp
Posts: 71
Joined: Thu Oct 10, 2013 7:45 pm

Re: GUI Events (Android)

Post by Arclamp »

Bootefull

Editbox with native keyboard, exactly what the doctor ordered! Cheers


There's use of a size_t in CAndroidAssetReaders' read function declaration that caught on my linux environment.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: GUI Events (Android)

Post by CuteAlien »

Hm, unfortunately native keyboard is not without problems. In landscape mode it messes up on newer Android versions (since later 4.x versions). And I couldn't find any newer workaround to get it working again. Google's stance is simply - they do not support using SDK functions from within the NDK. And they also do not care that the NDK functions are broken since ever and simply ignore all bugreports on that. Meaning... I no longer recommend using native keyboard. When using NDK you are better off writing your own keyboard.

Not sure what the problem with size_t is you are having... a compiler problem? Please give us the exact error you get (just copy/paste it in here).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Arclamp
Posts: 71
Joined: Thu Oct 10, 2013 7:45 pm

Re: GUI Events (Android)

Post by Arclamp »

Hmmm, I didn't make notes, so recreated...

Code: Select all

 
$ ndk-build
[armeabi] Compile++ thumb: Irrlicht <= CIrrDeviceAndroid.cpp
In file included from jni/../../Android/CIrrDeviceAndroid.cpp:12:0:
jni/../../Android/CAndroidAssetReader.h:36:18: error: conflicting return type specified for 'virtual size_t irr::io::CAndroidAssetReader::read(void*, size_t)'
   virtual size_t read(void* buffer, size_t sizeToRead);
                  ^
In file included from ../../../include/IFileArchive.h:8:0,
                 from ../../../include/IFileSystem.h:10,
                 from jni/../../CFileSystem.h:8,
                 from jni/../../Android/CIrrDeviceAndroid.cpp:11:
../../../include/IReadFile.h:24:15: error:   overriding 'virtual irr::s32 irr::io::IReadFile::read(void*, irr::u32)'
   virtual s32 read(void* buffer, u32 sizeToRead) = 0;
               ^
make: *** [obj/local/armeabi/objs/Irrlicht/Android/CIrrDeviceAndroid.o] Error 1
 
If I remember right I just changed the size_t to u32, all was good...
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: GUI Events (Android)

Post by CuteAlien »

That looks to me like it finds the wrong headers while compiling. Because that function was also updated in the current header so you should not get that error. You probably have more than one Irrlicht version on your system and it compiles mixing in headers from another place. Try to find that - because this can lead to really messed up bugs which seem to make no sense at all when coding!
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply