Irrlicht and windows multi-touch

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
Granyte
Posts: 850
Joined: Tue Jan 25, 2011 11:07 pm
Contact:

Irrlicht and windows multi-touch

Post 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
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: Irrlicht and windows multi-touch

Post 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).
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
luthyr
Posts: 69
Joined: Wed Dec 30, 2009 5:47 pm

Re: Irrlicht and windows multi-touch

Post 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
Granyte
Posts: 850
Joined: Tue Jan 25, 2011 11:07 pm
Contact:

Re: Irrlicht and windows multi-touch

Post 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 ?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Irrlicht and windows multi-touch

Post 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.
Granyte
Posts: 850
Joined: Tue Jan 25, 2011 11:07 pm
Contact:

Re: Irrlicht and windows multi-touch

Post 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
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Irrlicht and windows multi-touch

Post 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.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Irrlicht and windows multi-touch

Post 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.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Irrlicht and windows multi-touch

Post 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
luckstar77
Posts: 1
Joined: Fri Jul 05, 2013 8:24 am

Re: Irrlicht and windows multi-touch

Post by luckstar77 »

Hi hybrid

i'm use the code and compile

and then touch has work

but can not fullscreen

can help me?
luthyr
Posts: 69
Joined: Wed Dec 30, 2009 5:47 pm

Re: Irrlicht and windows multi-touch

Post 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.
Post Reply