Page 1 of 1

Irrlicht and windows multi-touch

Posted: Tue Apr 02, 2013 10:00 am
by Granyte
Any one tried using irrlicht with a windows multitouch device?

Because for a few weeks my only computer has been a surface pro and i noticed irrlicht react poorly to touch input

And i.m trying to identifie where irrlicht handle event from the os to see if i can make it a little more touch friendly

Re: Irrlicht and windows multi-touch

Posted: Tue Apr 02, 2013 8:44 pm
by Nadro
You can check OGL-ES branch (it supports multi-touch support for iOS and Android, so we can implement Windows version in a similar way, but I'm not too much familiar with WinRT, so I can't help in this case).

Re: Irrlicht and windows multi-touch

Posted: Tue Apr 02, 2013 8:57 pm
by luthyr
I've played around with it for Windows 7/8 using WM_TOUCH. So far, we just added a new type of event separate from mouse. We have not finished working on it, but perhaps this will help get you started.

A few things we have not solved very well yet:
  • Hiding/showing the cursor with multi-touch is problematic because the OS wants to force it hidden in touch, causing an endless loop. This is the reason for the CIrrDeviceWin32.h change.
  • You need to switch to the Windows 7 SDK to build, which I believe stops your program from working in older versions of windows. I'm not sure if there's a way around this.
  • Irrlicht is in the process of adding its own Touch Events, I think, for android/iOS, so I would watch the ogl-es branch and model the events after that if you want less hassle updating Irrlicht later.
In any case, here are the changes I made to add touch (Irrlicht 1.8.0): https://mega.co.nz/#!rZ1AlZCa!CFDv_ir-k ... CFj_x50zUU
Windows 7 SDK: http://www.microsoft.com/en-us/download ... px?id=8279

Re: Irrlicht and windows multi-touch

Posted: Thu Apr 04, 2013 12:08 am
by Granyte
I just tried this patch it works nicely for my purpose as it stop the app from simply freezing

i don't thing using the windows 7 sdk stops your program from running on older version of windows unless you call some of the specific windows 7 functions


Nadro we are not talking about winRT yet just the touch function of the win32 api

Also is there a plan to introduce the multitouch changes back to the trunk or the shader-pipeline branch ?

Re: Irrlicht and windows multi-touch

Posted: Thu Apr 04, 2013 8:05 am
by hybrid
We are currently working on integration of the ogl-es branch into main trunk development. So all those changes will be available for the upcoming 1.9 release.

Re: Irrlicht and windows multi-touch

Posted: Thu Apr 04, 2013 8:40 am
by Granyte
alright until then can some of the changes luthyr made be integrated it could at least avoid the freezing and some time crash we were getting if you touched a irrlicht window without them

Re: Irrlicht and windows multi-touch

Posted: Thu Apr 04, 2013 9:04 am
by hybrid
Well, the loop break is useless as it is right now - well, the loop is now useless. So we have to fix this otherwise. Either the loopis not necessary, or we have to break out on touch surfaces. I hope we can simply check somehow else for the cursor visibility feature.

Re: Irrlicht and windows multi-touch

Posted: Fri Apr 05, 2013 11:06 am
by hybrid
Ok, found this one: http://msdn.microsoft.com/de-de/library ... 85%29.aspx
There's a new flag for Windows 8, which recognizes the situation where the cursor is forced hidden. I guess I can add this easily. Should solve the problem even better.

Re: Irrlicht and windows multi-touch

Posted: Fri Apr 05, 2013 11:21 am
by hybrid
Ok, bug fix added in the 1.8 branch, will be merged to other versions soon. Please have a look here if you are interested in testing this patch: http://irrlicht.svn.sourceforge.net/vie ... threv=4496

Re: Irrlicht and windows multi-touch

Posted: Fri Jul 05, 2013 8:28 am
by luckstar77
Hi hybrid

i'm use the code and compile

and then touch has work

but can not fullscreen

can help me?

Re: Irrlicht and windows multi-touch

Posted: Mon Jul 29, 2013 2:47 pm
by luthyr
If you are using some DPI scaling (such as the default on the Surface Pro), you may need to disable it. Here is some code that will accomplish that from your main project/exe.

Code: Select all

typedef bool (WINAPI *SetProcessDPIAwareType)();
SetProcessDPIAwareType SetProcessDPIAwareFunc;
 
int main()
{
   // Disable DPI auto-scaling.
   SetProcessDPIAwareFunc = (SetProcessDPIAwareType) GetProcAddress(GetModuleHandle(TEXT("user32")), "SetProcessDPIAware");
   if (SetProcessDPIAwareFunc)
   {
      SetProcessDPIAwareFunc();
   }
}
I have our latest Win32 device code here if you want additional reference for Irrlicht, though I wouldn't advise using it as is since we have extra code in there for other things (like filtering XInput devices from DirectInput).
https://mega.co.nz/#!qVl0nIIL!OvO4RlNP0 ... Z1U_hdDOak

I had to add code similar to other parts of Irrlicht that don't directly call the touch function, otherwise the exe will fail to run on Vista, XP.