mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-19 09:48:15 +00:00
removed redundant call to eglGetConfig (https://github.com/raysan5/raylib/issues/1550) (#1567)
This commit is contained in:
13
src/core.c
13
src/core.c
@@ -3845,7 +3845,7 @@ static bool InitGraphicsDevice(int width, int height)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined(PLATFORM_DRM)
|
#if defined(PLATFORM_DRM)
|
||||||
if (!eglGetConfigs(CORE.Window.device, NULL, 0, &numConfigs))
|
if (!eglChooseConfig(CORE.Window.device, NULL, NULL, 0, &numConfigs))
|
||||||
{
|
{
|
||||||
TRACELOG(LOG_WARNING, "DISPLAY: Failed to get EGL config count: 0x%x", eglGetError());
|
TRACELOG(LOG_WARNING, "DISPLAY: Failed to get EGL config count: 0x%x", eglGetError());
|
||||||
return false;
|
return false;
|
||||||
@@ -3861,15 +3861,6 @@ static bool InitGraphicsDevice(int width, int height)
|
|||||||
}
|
}
|
||||||
|
|
||||||
EGLint matchingNumConfigs = 0;
|
EGLint matchingNumConfigs = 0;
|
||||||
if (!eglGetConfigs(CORE.Window.device, configs, numConfigs, &matchingNumConfigs))
|
|
||||||
{
|
|
||||||
TRACELOG(LOG_WARNING, "DISPLAY: Failed to get EGL configs: 0x%x", eglGetError());
|
|
||||||
free(configs);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
TRACELOG(LOG_TRACE, "DISPLAY: EGL matching configs available: %d", matchingNumConfigs);
|
|
||||||
|
|
||||||
if (!eglChooseConfig(CORE.Window.device, framebufferAttribs, configs, numConfigs, &matchingNumConfigs))
|
if (!eglChooseConfig(CORE.Window.device, framebufferAttribs, configs, numConfigs, &matchingNumConfigs))
|
||||||
{
|
{
|
||||||
TRACELOG(LOG_WARNING, "DISPLAY: Failed to choose EGL config: 0x%x", eglGetError());
|
TRACELOG(LOG_WARNING, "DISPLAY: Failed to choose EGL config: 0x%x", eglGetError());
|
||||||
@@ -3877,6 +3868,8 @@ static bool InitGraphicsDevice(int width, int height)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TRACELOG(LOG_TRACE, "DISPLAY: EGL matching configs available: %d", matchingNumConfigs);
|
||||||
|
|
||||||
// find the EGL config that matches the previously setup GBM format
|
// find the EGL config that matches the previously setup GBM format
|
||||||
int found = 0;
|
int found = 0;
|
||||||
for (EGLint i = 0; i < matchingNumConfigs; ++i)
|
for (EGLint i = 0; i < matchingNumConfigs; ++i)
|
||||||
|
Reference in New Issue
Block a user