[Android] Fixed invalid drawable error

This commit is contained in:
Jonathan De Wachter 2014-02-27 11:32:22 +01:00
parent 2caec961ee
commit 595df2a1a9
2 changed files with 21 additions and 4 deletions

View File

@ -176,8 +176,11 @@ void WindowImplAndroid::setMouseCursorVisible(bool visible)
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void WindowImplAndroid::setKeyRepeatEnabled(bool enabled) void WindowImplAndroid::setKeyRepeatEnabled(bool enabled)
{ {
// Not applicable
} }
////////////////////////////////////////////////////////////
int WindowImplAndroid::processEvent(int fd, int events, void* data) int WindowImplAndroid::processEvent(int fd, int events, void* data)
{ {
ActivityStates* states = getActivity(NULL); ActivityStates* states = getActivity(NULL);
@ -189,7 +192,7 @@ int WindowImplAndroid::processEvent(int fd, int events, void* data)
{ {
if (AInputQueue_preDispatchEvent(states->inputQueue, _event)) if (AInputQueue_preDispatchEvent(states->inputQueue, _event))
return 1; return 1;
int32_t handled = 0; int32_t handled = 0;
int32_t type = AInputEvent_getType(_event); int32_t type = AInputEvent_getType(_event);
@ -248,6 +251,8 @@ int WindowImplAndroid::processEvent(int fd, int events, void* data)
return 1; return 1;
} }
////////////////////////////////////////////////////////////
void WindowImplAndroid::processScrollEvent(AInputEvent* _event, ActivityStates* states) void WindowImplAndroid::processScrollEvent(AInputEvent* _event, ActivityStates* states)
{ {
// Prepare the java virtual machine // Prepare the java virtual machine
@ -300,6 +305,8 @@ void WindowImplAndroid::processScrollEvent(AInputEvent* _event, ActivityStates*
states->pendingEvents.push_back(event); states->pendingEvents.push_back(event);
} }
////////////////////////////////////////////////////////////
void WindowImplAndroid::processKeyEvent(AInputEvent* _event, ActivityStates* states) void WindowImplAndroid::processKeyEvent(AInputEvent* _event, ActivityStates* states)
{ {
int32_t device = AInputEvent_getSource(_event); int32_t device = AInputEvent_getSource(_event);
@ -326,6 +333,8 @@ void WindowImplAndroid::processKeyEvent(AInputEvent* _event, ActivityStates* sta
} }
} }
////////////////////////////////////////////////////////////
void WindowImplAndroid::processMotionEvent(AInputEvent* _event, ActivityStates* states) void WindowImplAndroid::processMotionEvent(AInputEvent* _event, ActivityStates* states)
{ {
int32_t device = AInputEvent_getSource(_event); 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) void WindowImplAndroid::processPointerEvent(bool isDown, AInputEvent* _event, ActivityStates* states)
{ {
int32_t device = AInputEvent_getSource(_event); int32_t device = AInputEvent_getSource(_event);
@ -430,6 +441,7 @@ void WindowImplAndroid::processPointerEvent(bool isDown, AInputEvent* _event, Ac
states->pendingEvents.push_back(event); states->pendingEvents.push_back(event);
} }
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
Keyboard::Key WindowImplAndroid::androidKeyToSF(int32_t key) Keyboard::Key WindowImplAndroid::androidKeyToSF(int32_t key)
{ {
@ -549,6 +561,8 @@ Keyboard::Key WindowImplAndroid::androidKeyToSF(int32_t key)
} }
} }
////////////////////////////////////////////////////////////
int WindowImplAndroid::getUnicode(AInputEvent* event) int WindowImplAndroid::getUnicode(AInputEvent* event)
{ {
// Retrieve activity states // Retrieve activity states
@ -596,6 +610,5 @@ int WindowImplAndroid::getUnicode(AInputEvent* event)
return unicode; return unicode;
} }
} // namespace priv } // namespace priv
} // namespace sf } // namespace sf

View File

@ -84,8 +84,12 @@ m_config (NULL)
// Note: The EGL specs say that attrib_list can be NULL when passed to eglCreatePbufferSurface, // 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? // 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)); m_surface = eglCheck(eglCreatePbufferSurface(m_display, m_config, attrib_list));
// Create EGL context // Create EGL context