Просмотр исходного кода

REVIEWED: Variable scope #5485

pull/5486/head
Ray 3 недель назад
Родитель
Сommit
4badbe2b17
1 измененных файлов: 8 добавлений и 13 удалений
  1. +8
    -13
      src/platforms/rcore_drm.c

+ 8
- 13
src/platforms/rcore_drm.c Просмотреть файл

@ -1415,6 +1415,7 @@ int InitPlatform(void)
};
EGLint numConfigs = 0;
const char *eglClientExtensions = NULL;
// Get an EGL device connection
// NOTE: eglGetPlatformDisplay() is preferred over eglGetDisplay() legacy call
@ -1424,14 +1425,12 @@ int InitPlatform(void)
#else
// Check if extension is available for eglGetPlatformDisplayEXT()
// 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
@ -1520,13 +1519,9 @@ int InitPlatform(void)
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)

Загрузка…
Отмена
Сохранить