Adding requested changes

This commit is contained in:
Curi0 2017-10-17 18:44:16 +05:30
parent 57dd782d2a
commit a0d99c8b59
9 changed files with 37 additions and 31 deletions

View File

@ -333,6 +333,13 @@ if (_GLFW_COCOA)
set(glfw_PKG_LIBS "-framework Cocoa -framework IOKit -framework CoreFoundation -framework CoreVideo")
endif()
#--------------------------------------------------------------------
# Use Android APIs for window creation
#--------------------------------------------------------------------
if (_GLFW_ANDROID)
list(APPEND glfw_INCLUDE_DIRS "${ANDROID_NDK}/sources/android/native_app_glue/")
endif()
#--------------------------------------------------------------------
# Export GLFW library dependencies
#--------------------------------------------------------------------

View File

@ -197,7 +197,7 @@ extern "C" {
#include <OpenGL/glu.h>
#endif
#elif !defined(ANDROID) /*__APPLE__*/
#else /*__APPLE__*/
#include <GL/gl.h>
#if defined(GLFW_INCLUDE_GLEXT)

View File

@ -123,6 +123,9 @@ extern "C" {
#include <GL/osmesa.h>
#endif
#if defined(GLFW_EXPOSE_NATIVE_ANDROID)
#include <android_native_app_glue.h>
#endif
/*************************************************************************
* Functions

View File

@ -100,8 +100,7 @@ target_include_directories(glfw PUBLIC
target_include_directories(glfw PRIVATE
"${GLFW_SOURCE_DIR}/src"
"${GLFW_BINARY_DIR}/src"
${glfw_INCLUDE_DIRS}
${ANDROID_NDK}/sources/android/native_app_glue/)
${glfw_INCLUDE_DIRS})
# HACK: When building on MinGW, WINVER and UNICODE need to be defined before
# the inclusion of stddef.h (by glfw3.h), which is itself included before

View File

@ -82,6 +82,6 @@ void _glfwPlatformTerminate(void)
const char* _glfwPlatformGetVersionString(void)
{
return _GLFW_VERSION_NUMBER " Android";
return _GLFW_VERSION_NUMBER " Android EGL";
}

View File

@ -47,10 +47,10 @@
#define _GLFW_PLATFORM_CONTEXT_STATE
#define _GLFW_PLATFORM_LIBRARY_CONTEXT_STATE
#define _GLFW_EGL_NATIVE_DISPLAY EGL_DEFAULT_DISPLAY
struct android_app *app;
typedef VkFlags VkAndroidSurfaceCreateFlagsKHR;
typedef struct VkAndroidSurfaceCreateInfoKHR {

View File

@ -393,11 +393,8 @@ GLFWbool _glfwInitEGL(void)
_glfwTerminateEGL();
return GLFW_FALSE;
}
#if !defined(ANDROID)
_glfw.egl.display = eglGetDisplay(_GLFW_EGL_NATIVE_DISPLAY);
#else
_glfw.egl.display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
#endif
if (_glfw.egl.display == EGL_NO_DISPLAY)
{