From 595df2a1a9d5ee650fe4f529709375d63ef02c68 Mon Sep 17 00:00:00 2001 From: Jonathan De Wachter Date: Thu, 27 Feb 2014 11:32:22 +0100 Subject: [PATCH] [Android] Fixed invalid drawable error --- src/SFML/Window/Android/WindowImplAndroid.cpp | 17 +++++++++++++++-- src/SFML/Window/EglContext.cpp | 8 ++++++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/SFML/Window/Android/WindowImplAndroid.cpp b/src/SFML/Window/Android/WindowImplAndroid.cpp index f4725282..57a5bed0 100644 --- a/src/SFML/Window/Android/WindowImplAndroid.cpp +++ b/src/SFML/Window/Android/WindowImplAndroid.cpp @@ -176,8 +176,11 @@ void WindowImplAndroid::setMouseCursorVisible(bool visible) //////////////////////////////////////////////////////////// void WindowImplAndroid::setKeyRepeatEnabled(bool enabled) { + // Not applicable } + +//////////////////////////////////////////////////////////// int WindowImplAndroid::processEvent(int fd, int events, void* data) { ActivityStates* states = getActivity(NULL); @@ -189,7 +192,7 @@ int WindowImplAndroid::processEvent(int fd, int events, void* data) { if (AInputQueue_preDispatchEvent(states->inputQueue, _event)) return 1; - + int32_t handled = 0; int32_t type = AInputEvent_getType(_event); @@ -248,6 +251,8 @@ int WindowImplAndroid::processEvent(int fd, int events, void* data) return 1; } + +//////////////////////////////////////////////////////////// void WindowImplAndroid::processScrollEvent(AInputEvent* _event, ActivityStates* states) { // Prepare the java virtual machine @@ -300,6 +305,8 @@ void WindowImplAndroid::processScrollEvent(AInputEvent* _event, ActivityStates* states->pendingEvents.push_back(event); } + +//////////////////////////////////////////////////////////// void WindowImplAndroid::processKeyEvent(AInputEvent* _event, ActivityStates* states) { int32_t device = AInputEvent_getSource(_event); @@ -326,6 +333,8 @@ void WindowImplAndroid::processKeyEvent(AInputEvent* _event, ActivityStates* sta } } + +//////////////////////////////////////////////////////////// void WindowImplAndroid::processMotionEvent(AInputEvent* _event, ActivityStates* states) { int32_t device = AInputEvent_getSource(_event); @@ -369,6 +378,8 @@ void WindowImplAndroid::processMotionEvent(AInputEvent* _event, ActivityStates* } } + +//////////////////////////////////////////////////////////// void WindowImplAndroid::processPointerEvent(bool isDown, AInputEvent* _event, ActivityStates* states) { int32_t device = AInputEvent_getSource(_event); @@ -430,6 +441,7 @@ void WindowImplAndroid::processPointerEvent(bool isDown, AInputEvent* _event, Ac states->pendingEvents.push_back(event); } + //////////////////////////////////////////////////////////// Keyboard::Key WindowImplAndroid::androidKeyToSF(int32_t key) { @@ -549,6 +561,8 @@ Keyboard::Key WindowImplAndroid::androidKeyToSF(int32_t key) } } + +//////////////////////////////////////////////////////////// int WindowImplAndroid::getUnicode(AInputEvent* event) { // Retrieve activity states @@ -596,6 +610,5 @@ int WindowImplAndroid::getUnicode(AInputEvent* event) return unicode; } - } // namespace priv } // namespace sf diff --git a/src/SFML/Window/EglContext.cpp b/src/SFML/Window/EglContext.cpp index 8ae5f09a..671a64db 100644 --- a/src/SFML/Window/EglContext.cpp +++ b/src/SFML/Window/EglContext.cpp @@ -84,8 +84,12 @@ m_config (NULL) // Note: The EGL specs say that attrib_list can be NULL when passed to eglCreatePbufferSurface, // but this is resulting in a segfault. Bug in Android? - EGLint attrib_list[] = { EGL_NONE }; - + EGLint attrib_list[] = { + EGL_WIDTH, 1, + EGL_HEIGHT,1, + EGL_NONE + }; + m_surface = eglCheck(eglCreatePbufferSurface(m_display, m_config, attrib_list)); // Create EGL context