Something wrong with Android mouse event?

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
sirnodin
Posts: 2
Joined: Wed Jun 19, 2013 7:47 am

Something wrong with Android mouse event?

Post by sirnodin »

I notice that, it seems, in ogl-es branch for Android, the X and Y value of a mouse event is absolute coordinate, which is different from the irr component and is not convenient.
Am I supposed to do something about it?
porcus
Posts: 149
Joined: Sun May 27, 2007 6:24 pm
Location: Germany

Re: Something wrong with Android mouse event?

Post by porcus »

Yes, I noticed that too.
If you add the follwing to the CIrrDeviceAndroid constructor (after waiting for the activity window creation), the render "window" will be aligned with the native window if passing a screen resolution of 0,0 in the device creation parameters:

Code: Select all

    if(CreationParams.WindowSize.Width==0 || CreationParams.WindowSize.Height==0){
        CreationParams.WindowSize.Width = ANativeWindow_getWidth(Android->window);
        CreationParams.WindowSize.Height = ANativeWindow_getHeight(Android->window);
    }
When the render "window" is aligned with the native window the mouse coordinates are correct.
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: Something wrong with Android mouse event?

Post by Nadro »

Do you mean mouse coordinates or touch? Mouse events are disabled for now, just multi touch events are working. I use these events in my apps and it works properly.

BTW. Please update your ogl-es branch, I fixed some Android issues at last time.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Post Reply