From 4626e95491495e0fbdbfe9f41b80058bd6224618 Mon Sep 17 00:00:00 2001 From: Jonathan De Wachter Date: Sat, 26 Oct 2013 14:02:23 +0200 Subject: [PATCH] [Android] Fixed WindowHandle and getSystemHandle() --- include/SFML/Window/WindowHandle.hpp | 2 +- src/SFML/Window/Android/WindowImplAndroid.cpp | 5 ++++- src/SFML/Window/Window.cpp | 4 ---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/include/SFML/Window/WindowHandle.hpp b/include/SFML/Window/WindowHandle.hpp index 12e17018b..b7c67a5b4 100644 --- a/include/SFML/Window/WindowHandle.hpp +++ b/include/SFML/Window/WindowHandle.hpp @@ -63,7 +63,7 @@ namespace sf #elif defined(SFML_SYSTEM_ANDROID) - // Window handle doesn't exist on Android + // Window handle is ANativeWindow (void*) on Android typedef void* WindowHandle; #endif diff --git a/src/SFML/Window/Android/WindowImplAndroid.cpp b/src/SFML/Window/Android/WindowImplAndroid.cpp index ca2f9342b..cb34b06c9 100644 --- a/src/SFML/Window/Android/WindowImplAndroid.cpp +++ b/src/SFML/Window/Android/WindowImplAndroid.cpp @@ -61,7 +61,10 @@ WindowImplAndroid::~WindowImplAndroid() //////////////////////////////////////////////////////////// WindowHandle WindowImplAndroid::getSystemHandle() const { - return NULL; + ActivityStates* states = getActivity(NULL); + sf::Lock lock(states->mutex); + + return states->window; } diff --git a/src/SFML/Window/Window.cpp b/src/SFML/Window/Window.cpp index 939dd3f3e..6fd7cb6b3 100644 --- a/src/SFML/Window/Window.cpp +++ b/src/SFML/Window/Window.cpp @@ -30,10 +30,6 @@ #include #include #include -#ifdef SFML_SYSTEM_ANDROID - #include - #include -#endif namespace