|
|
@ -1415,6 +1415,7 @@ int InitPlatform(void) |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
EGLint numConfigs = 0; |
|
|
EGLint numConfigs = 0; |
|
|
|
|
|
const char *eglClientExtensions = NULL; |
|
|
|
|
|
|
|
|
// Get an EGL device connection |
|
|
// Get an EGL device connection |
|
|
// NOTE: eglGetPlatformDisplay() is preferred over eglGetDisplay() legacy call |
|
|
// NOTE: eglGetPlatformDisplay() is preferred over eglGetDisplay() legacy call |
|
|
@ -1424,14 +1425,12 @@ int InitPlatform(void) |
|
|
#else |
|
|
#else |
|
|
// Check if extension is available for eglGetPlatformDisplayEXT() |
|
|
// Check if extension is available for eglGetPlatformDisplayEXT() |
|
|
// NOTE: Better compatibility with some drivers (e.g. Mali Midgard) |
|
|
// NOTE: Better compatibility with some drivers (e.g. Mali Midgard) |
|
|
k">const char *eglClientExtensions = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS); |
|
|
|
|
|
if (eglClientExtensions != NULL) |
|
|
|
|
|
|
|
|
eglClientExtensions = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS); |
|
|
|
|
|
if (p">(eglClientExtensions != NULL) && (strstr(eglClientExtensions, "EGL_EXT_platform_base") != NULL)) |
|
|
{ |
|
|
{ |
|
|
if (strstr(eglClientExtensions, "EGL_EXT_platform_base") != NULL) |
|
|
|
|
|
{ |
|
|
|
|
|
PFNEGLGETPLATFORMDISPLAYEXTPROC eglGetPlatformDisplayEXT = (PFNEGLGETPLATFORMDISPLAYEXTPROC)eglGetProcAddress("eglGetPlatformDisplayEXT"); |
|
|
|
|
|
if (eglGetPlatformDisplayEXT != NULL) platform.device = eglGetPlatformDisplayEXT(EGL_PLATFORM_GBM_KHR, platform.gbmDevice, NULL); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
PFNEGLGETPLATFORMDISPLAYEXTPROC eglGetPlatformDisplayEXT = (PFNEGLGETPLATFORMDISPLAYEXTPROC)eglGetProcAddress("eglGetPlatformDisplayEXT"); |
|
|
|
|
|
|
|
|
|
|
|
if (eglGetPlatformDisplayEXT != NULL) platform.device = eglGetPlatformDisplayEXT(EGL_PLATFORM_GBM_KHR, platform.gbmDevice, NULL); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// In case extension not found or display could not be retrieved, try useing legacy version |
|
|
// In case extension not found or display could not be retrieved, try useing legacy version |
|
|
@ -1520,13 +1519,9 @@ int InitPlatform(void) |
|
|
|
|
|
|
|
|
if ((eglClientExtensions != NULL) && (strstr(eglClientExtensions, "EGL_EXT_platform_base") != NULL)) |
|
|
if ((eglClientExtensions != NULL) && (strstr(eglClientExtensions, "EGL_EXT_platform_base") != NULL)) |
|
|
{ |
|
|
{ |
|
|
PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC eglCreatePlatformWindowSurfaceEXT = |
|
|
|
|
|
(PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC)eglGetProcAddress("eglCreatePlatformWindowSurfaceEXT"); |
|
|
|
|
|
|
|
|
PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC eglCreatePlatformWindowSurfaceEXT = (PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC)eglGetProcAddress("eglCreatePlatformWindowSurfaceEXT"); |
|
|
|
|
|
|
|
|
if (eglCreatePlatformWindowSurfaceEXT != NULL) |
|
|
|
|
|
{ |
|
|
|
|
|
platform.surface = eglCreatePlatformWindowSurfaceEXT(platform.device, platform.config, platform.gbmSurface, NULL); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (eglCreatePlatformWindowSurfaceEXT != NULL) platform.surface = eglCreatePlatformWindowSurfaceEXT(platform.device, platform.config, platform.gbmSurface, NULL); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (platform.surface == EGL_NO_SURFACE) |
|
|
if (platform.surface == EGL_NO_SURFACE) |
|
|
|