Browse Source

Platform: print EGL device count before overwriting the count variable.

Otherwise it would report a wrong count.
pull/454/head
Vladimír Vondruš 6 years ago
parent
commit
ff22cb8758
  1. 11
      src/Magnum/Platform/WindowlessEglApplication.cpp

11
src/Magnum/Platform/WindowlessEglApplication.cpp

@ -201,14 +201,17 @@ WindowlessEglContext::WindowlessEglContext(const Configuration& configuration, G
/* Otherwise just a normal EGL device */
} else {
/* Print the log *before* calling eglQueryDevices() again, as
the `count` gets overwritten by it */
if(magnumContext && (magnumContext->internalFlags() >= GL::Context::InternalFlag::DisplayVerboseInitializationLog)) {
Debug{} << "Platform::WindowlessEglApplication: found" << count << "EGL devices, choosing device" << configuration.device();
}
selectedDevice = configuration.device();
devices = Containers::Array<EGLDeviceEXT>{configuration.device() + 1};
/* Assuming the same thing won't suddenly start failing when
called the second time */
CORRADE_INTERNAL_ASSERT_OUTPUT(eglQueryDevices(configuration.device() + 1, devices, &count));
selectedDevice = configuration.device();
if(magnumContext && (magnumContext->internalFlags() >= GL::Context::InternalFlag::DisplayVerboseInitializationLog)) {
Debug{} << "Platform::WindowlessEglApplication: found" << count << "EGL devices, choosing device" << selectedDevice;
}
}
if(!(_display = reinterpret_cast<EGLDisplay(*)(EGLenum, void*, const EGLint*)>(eglGetProcAddress("eglGetPlatformDisplayEXT"))(EGL_PLATFORM_DEVICE_EXT, devices[selectedDevice], nullptr))) {

Loading…
Cancel
Save