Page 1 of 1

iOS - TouchInput.ID

Posted: Thu Mar 29, 2018 4:23 am
by LunaRebirth
Hi,

In my EventReceiver class in Android, I am using event.TouchInput.ID in order to work with multi-touch features.
This works fine.

During my port to iPhone, I am a receiving a crash. The debugger shows that event.TouchInput.ID is a large junk number.

Code: Select all

bool MyEventReceiver::OnEvent(const SEvent& event)
{
    if (event.EventType == EET_TOUCH_INPUT_EVENT)
    {
        Game::log(event.TouchInput.ID); // prints some large, random, junk, number in iOS. prints correctly in Android.
    }
}
Is there some other method I should be using to get the Touch ID for iOS?

Thanks

EDIT:
I also needed to modify the CIrrDevicesiOS.mm file to remove the "Scale" variable, otherwise the TouchInput.X and TouchInput.Y values are way off.
I'm unsure whether this is a bug or a feature for something I'm missing.

Re: iOS - TouchInput.ID

Posted: Fri Mar 30, 2018 3:30 pm
by Arclamp
Since its been here a few days... I've not ported to IPhone yet, but on Android I use the following to gather all events for later use. I was wondering if you're getting an errant signal and if checking the touchinput event may filter the issue (maybe not since in IEventReceiver.h there are no more types except count)

Code: Select all

 
#ifdef _IRR_ANDROID_PLATFORM_
    if (event.EventType == EET_TOUCH_INPUT_EVENT)
    {
        switch (event.TouchInput.Event)
        {
            case ETIE_PRESSED_DOWN:
            {
                touch_list.push_back(new NUBMultiTouchEvent(event.TouchInput.X, event.TouchInput.Y, event.TouchInput.ID, TOUCH_STATE_DOWN));
                break;
            }
            case ETIE_MOVED:
            {
                touch_list.push_back(new NUBMultiTouchEvent(event.TouchInput.X, event.TouchInput.Y, event.TouchInput.ID, TOUCH_STATE_MOVED));
                break;
            }
            case ETIE_LEFT_UP:
            {
                touch_list.push_back(new NUBMultiTouchEvent(event.TouchInput.X, event.TouchInput.Y, event.TouchInput.ID, TOUCH_STATE_UP));
                break;
            }
            default:
                break;
        }
    }
#else
 

Re: iOS - TouchInput.ID

Posted: Fri Apr 06, 2018 2:50 pm
by LunaRebirth
Arclamp wrote:Since its been here a few days... I've not ported to IPhone yet, but on Android I use the following to gather all events for later use. I was wondering if you're getting an errant signal and if checking the touchinput event may filter the issue (maybe not since in IEventReceiver.h there are no more types except count)

Code: Select all

 
#ifdef _IRR_ANDROID_PLATFORM_
    if (event.EventType == EET_TOUCH_INPUT_EVENT)
    {
        switch (event.TouchInput.Event)
        {
            case ETIE_PRESSED_DOWN:
            {
                touch_list.push_back(new NUBMultiTouchEvent(event.TouchInput.X, event.TouchInput.Y, event.TouchInput.ID, TOUCH_STATE_DOWN));
                break;
            }
            case ETIE_MOVED:
            {
                touch_list.push_back(new NUBMultiTouchEvent(event.TouchInput.X, event.TouchInput.Y, event.TouchInput.ID, TOUCH_STATE_MOVED));
                break;
            }
            case ETIE_LEFT_UP:
            {
                touch_list.push_back(new NUBMultiTouchEvent(event.TouchInput.X, event.TouchInput.Y, event.TouchInput.ID, TOUCH_STATE_UP));
                break;
            }
            default:
                break;
        }
    }
#else
 
Hmm, nope, that isn't the issue.
I notice a lot of these things for iOS, such as when accessing the keyboard, the double-quote and single-quote keys crash the program, having Event.KeyInput.Key equal to -30, and Event.KeyInput.SystemKeyCode being a large junk number.
Looks like Irrlicht isn't very much ready for iPhone use yet.

Re: iOS - TouchInput.ID

Posted: Fri Apr 06, 2018 4:25 pm
by CuteAlien
Yeah, missing maintainers for that currently :-(

Re: iOS - TouchInput.ID

Posted: Fri Apr 06, 2018 4:51 pm
by LunaRebirth
I'll piece together some tutorials and examples for setting up iOS this week.

The OGL ES example doesn't include touch or keyboard events, they took me longer than I intended to set them up on my own.
I'll see if I contribute to the iOS development.

Re: iOS - TouchInput.ID

Posted: Thu Apr 12, 2018 8:47 am
by LunaRebirth
Quick question,

Do either of you (or anyone) know how to get the window context in iOS? Basically the equivalent of Android's JNI environment.

I believe it is externalView in CIrrDeviceiOS.mm in the ogl es source, but I'm not sure that I'm right.

I'm trying to set up Admob for iOS.
The function for Android is

Code: Select all

banner->Initialize(androidApp->activity->clazz, bannerUnit, bannerSize);
but I can't figure out the equivalent of androidApp->activity->clazz to use.