- Fixed issues with randomly crash at resume on Android platform.

- Fixed issues with Multi Touch events on Android platform.

Missing log to rev4591:
- Restored OGLES2 support for Android platform.
- Improved log system on Android Platform.

git-svn-id: http://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@4592 dfc29bdd-3216-0410-991c-e03cc46cb475
master
nadro 2013-10-23 16:30:40 +00:00
parent 5c20d58b9e
commit eef94cf07e
2 changed files with 9 additions and 6 deletions

View File

@ -252,14 +252,17 @@ s32 CIrrDeviceAndroid::handleInput(android_app* app, AInputEvent* androidEvent)
s32 EventAction = AMotionEvent_getAction(androidEvent);
bool MultiTouchEvent = true;
bool Touched = false;
switch (EventAction)
{
case AMOTION_EVENT_ACTION_DOWN:
Event.MultiTouchInput.Event = EMTIE_PRESSED_DOWN;
Touched = true;
break;
case AMOTION_EVENT_ACTION_MOVE:
Event.MultiTouchInput.Event = EMTIE_MOVED;
Touched = true;
break;
case AMOTION_EVENT_ACTION_UP:
Event.MultiTouchInput.Event = EMTIE_LEFT_UP;
@ -282,9 +285,9 @@ s32 CIrrDeviceAndroid::handleInput(android_app* app, AInputEvent* androidEvent)
Event.MultiTouchInput.PrevX[i] = 0; // TODO
Event.MultiTouchInput.PrevY[i] = 0; // TODO
Event.MultiTouchInput.X[i] = AMotionEvent_getX(androidEvent, i);
Event.MultiTouchInput.Y[i] = AMotionEvent_getX(androidEvent, i);
Event.MultiTouchInput.Y[i] = AMotionEvent_getY(androidEvent, i);
Event.MultiTouchInput.Touched[i] = true;
Event.MultiTouchInput.Touched[i] = Touched;
}
Device->postEventFromUser(Event);

View File

@ -111,6 +111,10 @@ bool CEGLManager::createSurface()
if (EglSurface != EGL_NO_SURFACE)
return true;
#if defined(_IRR_COMPILE_WITH_ANDROID_DEVICE_)
EglWindow = (ANativeWindow*)Data->OGLESAndroid.window;
#endif
EGLint EglOpenGLBIT = 0;
switch (Params.DriverType)
@ -229,10 +233,6 @@ bool CEGLManager::createSurface()
os::Printer::log("No full color buffer.");
#if defined(_IRR_COMPILE_WITH_ANDROID_DEVICE_)
/* EGL_NATIVE_VISUAL_ID is an attribute of the EGLConfig that is
* guaranteed to be accepted by ANativeWindow_setBuffersGeometry().
* As soon as we picked a EGLConfig, we can safely reconfigure the
* ANativeWindow buffers to match, using EGL_NATIVE_VISUAL_ID. */
EGLint Format = 0;
eglGetConfigAttrib(EglDisplay, EglConfig, EGL_NATIVE_VISUAL_ID, &Format);