From 5c7f16837076bdff16883b47d4090df5db51d9ac Mon Sep 17 00:00:00 2001 From: Quantum Date: Tue, 28 Sep 2021 21:02:28 -0400 Subject: [PATCH] [client] egl_dynprocs: use official prototypes from system headers --- client/include/egl_dynprocs.h | 32 ++++++++++---------------------- client/include/eglutil.h | 4 ++-- client/src/egl_dynprocs.c | 16 ++++++++-------- 3 files changed, 20 insertions(+), 32 deletions(-) diff --git a/client/include/egl_dynprocs.h b/client/include/egl_dynprocs.h index 4d9bfd30..43190ce1 100644 --- a/client/include/egl_dynprocs.h +++ b/client/include/egl_dynprocs.h @@ -23,33 +23,21 @@ #ifdef ENABLE_EGL #include +#include +#undef GL_KHR_debug #include #include -typedef EGLDisplay (*eglGetPlatformDisplayEXT_t)(EGLenum platform, - void *native_display, const EGLint *attrib_list); -typedef EGLBoolean (*eglSwapBuffersWithDamageKHR_t)(EGLDisplay dpy, - EGLSurface surface, const EGLint *rects, EGLint n_rects); -typedef void (*glEGLImageTargetTexture2DOES_t)(GLenum target, - GLeglImageOES image); -typedef void (*DEBUGPROC_t)(GLenum source, - GLenum type, GLuint id, GLenum severity, GLsizei length, - const GLchar *message, const void *userParam); -typedef void (*glDebugMessageCallback_t)(DEBUGPROC_t callback, - const void * userParam); -typedef void (*glBufferStorageEXT_t)(GLenum target, GLsizeiptr size, - const void * data, GLbitfield flags); - struct EGLDynProcs { - eglGetPlatformDisplayEXT_t eglGetPlatformDisplay; - eglGetPlatformDisplayEXT_t eglGetPlatformDisplayEXT; - eglSwapBuffersWithDamageKHR_t eglSwapBuffersWithDamageKHR; - eglSwapBuffersWithDamageKHR_t eglSwapBuffersWithDamageEXT; - glEGLImageTargetTexture2DOES_t glEGLImageTargetTexture2DOES; - glDebugMessageCallback_t glDebugMessageCallback; - glDebugMessageCallback_t glDebugMessageCallbackKHR; - glBufferStorageEXT_t glBufferStorageEXT; + PFNEGLGETPLATFORMDISPLAYPROC eglGetPlatformDisplay; + PFNEGLGETPLATFORMDISPLAYPROC eglGetPlatformDisplayEXT; + PFNEGLSWAPBUFFERSWITHDAMAGEKHRPROC eglSwapBuffersWithDamageKHR; + PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC eglSwapBuffersWithDamageEXT; + PFNGLEGLIMAGETARGETTEXTURE2DOESPROC glEGLImageTargetTexture2DOES; + PFNGLDEBUGMESSAGECALLBACKKHRPROC glDebugMessageCallback; + PFNGLDEBUGMESSAGECALLBACKKHRPROC glDebugMessageCallbackKHR; + PFNGLBUFFERSTORAGEEXTPROC glBufferStorageEXT; }; extern struct EGLDynProcs g_egl_dynProcs; diff --git a/client/include/eglutil.h b/client/include/eglutil.h index d39056ab..1f99e676 100644 --- a/client/include/eglutil.h +++ b/client/include/eglutil.h @@ -23,14 +23,14 @@ #include #include +#include #include "common/types.h" -#include "egl_dynprocs.h" struct SwapWithDamageData { bool init; - eglSwapBuffersWithDamageKHR_t func; + PFNEGLSWAPBUFFERSWITHDAMAGEKHRPROC func; }; void swapWithDamageInit(struct SwapWithDamageData * data, EGLDisplay display); diff --git a/client/src/egl_dynprocs.c b/client/src/egl_dynprocs.c index 3df6fbec..804f503f 100644 --- a/client/src/egl_dynprocs.c +++ b/client/src/egl_dynprocs.c @@ -26,21 +26,21 @@ struct EGLDynProcs g_egl_dynProcs = {0}; void egl_dynProcsInit(void) { - g_egl_dynProcs.eglGetPlatformDisplay = (eglGetPlatformDisplayEXT_t) + g_egl_dynProcs.eglGetPlatformDisplay = (PFNEGLGETPLATFORMDISPLAYPROC) eglGetProcAddress("eglGetPlatformDisplay"); - g_egl_dynProcs.eglGetPlatformDisplayEXT = (eglGetPlatformDisplayEXT_t) + g_egl_dynProcs.eglGetPlatformDisplayEXT = (PFNEGLGETPLATFORMDISPLAYPROC) eglGetProcAddress("eglGetPlatformDisplayEXT"); - g_egl_dynProcs.glEGLImageTargetTexture2DOES = (glEGLImageTargetTexture2DOES_t) + g_egl_dynProcs.glEGLImageTargetTexture2DOES = (PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) eglGetProcAddress("glEGLImageTargetTexture2DOES"); - g_egl_dynProcs.eglSwapBuffersWithDamageKHR = (eglSwapBuffersWithDamageKHR_t) + g_egl_dynProcs.eglSwapBuffersWithDamageKHR = (PFNEGLSWAPBUFFERSWITHDAMAGEKHRPROC) eglGetProcAddress("eglSwapBuffersWithDamageKHR"); - g_egl_dynProcs.eglSwapBuffersWithDamageEXT = (eglSwapBuffersWithDamageKHR_t) + g_egl_dynProcs.eglSwapBuffersWithDamageEXT = (PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC) eglGetProcAddress("eglSwapBuffersWithDamageEXT"); - g_egl_dynProcs.glDebugMessageCallback = (glDebugMessageCallback_t) + g_egl_dynProcs.glDebugMessageCallback = (PFNGLDEBUGMESSAGECALLBACKKHRPROC) eglGetProcAddress("glDebugMessageCallback"); - g_egl_dynProcs.glDebugMessageCallbackKHR = (glDebugMessageCallback_t) + g_egl_dynProcs.glDebugMessageCallbackKHR = (PFNGLDEBUGMESSAGECALLBACKKHRPROC) eglGetProcAddress("glDebugMessageCallbackKHR"); - g_egl_dynProcs.glBufferStorageEXT = (glBufferStorageEXT_t) + g_egl_dynProcs.glBufferStorageEXT = (PFNGLBUFFERSTORAGEEXTPROC) eglGetProcAddress("glBufferStorageEXT"); };