Browse Source

Platform: EGL_EXT_anything isn't on WebGL anyway.

findsdl-include-root
Vladimír Vondruš 7 years ago
parent
commit
3bfec34cec
  1. 16
      src/Magnum/Platform/WindowlessEglApplication.cpp

16
src/Magnum/Platform/WindowlessEglApplication.cpp

@ -41,6 +41,10 @@
#include <Corrade/Containers/ArrayView.h> #include <Corrade/Containers/ArrayView.h>
#endif #endif
/* None of this is in the Emscripten emulation layer, so no need to include
that there */
#ifndef MAGNUM_TARGET_WEBGL
#ifndef EGL_EXT_device_base #ifndef EGL_EXT_device_base
typedef void *EGLDeviceEXT; typedef void *EGLDeviceEXT;
#endif #endif
@ -60,9 +64,11 @@ typedef void* EGLObjectKHR;
typedef void* EGLLabelKHR; typedef void* EGLLabelKHR;
typedef void (APIENTRY *EGLDEBUGPROCKHR)(EGLenum error, const char* command, EGLint messageType, EGLLabelKHR threadLabel, EGLLabelKHR objectLabel, const char* message); typedef void (APIENTRY *EGLDEBUGPROCKHR)(EGLenum error, const char* command, EGLint messageType, EGLLabelKHR threadLabel, EGLLabelKHR objectLabel, const char* message);
#endif #endif
#endif
namespace Magnum { namespace Platform { namespace Magnum { namespace Platform {
#ifndef MAGNUM_TARGET_WEBGL
namespace { namespace {
bool extensionSupported(const char* const extensions, Containers::ArrayView<const char> extension) { bool extensionSupported(const char* const extensions, Containers::ArrayView<const char> extension) {
@ -75,8 +81,10 @@ bool extensionSupported(const char* const extensions, Containers::ArrayView<cons
} }
} }
#endif
WindowlessEglContext::WindowlessEglContext(const Configuration& configuration, GLContext* const magnumContext) { WindowlessEglContext::WindowlessEglContext(const Configuration& configuration, GLContext* const magnumContext) {
#ifndef MAGNUM_TARGET_WEBGL
/* If relevant extensions are supported, try to find some display using /* If relevant extensions are supported, try to find some display using
those APIs, as that works reliably also when running headless. This those APIs, as that works reliably also when running headless. This
would ideally use EGL 1.5 APIs but since we still want to support would ideally use EGL 1.5 APIs but since we still want to support
@ -143,9 +151,11 @@ WindowlessEglContext::WindowlessEglContext(const Configuration& configuration, G
Error{} << "Platform::WindowlessEglApplication::tryCreateContext(): cannot get platform display for a device:" << Implementation::eglErrorString(eglGetError()); Error{} << "Platform::WindowlessEglApplication::tryCreateContext(): cannot get platform display for a device:" << Implementation::eglErrorString(eglGetError());
return; return;
} }
} else
/* Otherwise initialize the classic way */ #endif
} else if(!(_display = eglGetDisplay(EGL_DEFAULT_DISPLAY))) { /* Otherwise initialize the classic way. WebGL doesn't have any of the
above, so no need to compile that at all. */
if(!(_display = eglGetDisplay(EGL_DEFAULT_DISPLAY))) {
Error{} << "Platform::WindowlessEglApplication::tryCreateContext(): cannot get default EGL display:" << Implementation::eglErrorString(eglGetError()); Error{} << "Platform::WindowlessEglApplication::tryCreateContext(): cannot get default EGL display:" << Implementation::eglErrorString(eglGetError());
return; return;
} }

Loading…
Cancel
Save