From 06e95693fb51d5776619b9ede04a7c13fd200e03 Mon Sep 17 00:00:00 2001 From: Jesse Natalie Date: Wed, 8 Sep 2021 12:54:17 -0700 Subject: [PATCH] egl: Detect Windows platform using GDI Reviewed-by: Eric Engestrom Reviewed By: Bill Kristiansen Acked-by: Roland Scheidegger Part-of: --- src/egl/main/egldisplay.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/egl/main/egldisplay.c b/src/egl/main/egldisplay.c index 739d7d0aac3..131fc22786f 100644 --- a/src/egl/main/egldisplay.c +++ b/src/egl/main/egldisplay.c @@ -64,6 +64,9 @@ #ifdef HAVE_DRM_PLATFORM #include #endif +#ifdef HAVE_WINDOWS_PLATFORM +#include +#endif /** @@ -128,6 +131,11 @@ _eglNativePlatformDetectNativeDisplay(void *nativeDisplay) if (nativeDisplay == EGL_DEFAULT_DISPLAY) return _EGL_INVALID_PLATFORM; +#ifdef HAVE_WINDOWS_PLATFORM + if (GetObjectType(nativeDisplay) == OBJ_DC) + return _EGL_PLATFORM_WINDOWS; +#endif + #if defined(HAVE_WAYLAND_PLATFORM) || defined(HAVE_DRM_PLATFORM) if (_eglPointerIsDereferencable(nativeDisplay)) { void *first_pointer = *(void **) nativeDisplay;