[client] egl_dynprocs: use official prototypes from system headers

This commit is contained in:
Quantum 2021-09-28 21:02:28 -04:00 committed by Geoffrey McRae
parent 778d27f08a
commit 5c7f168370
3 changed files with 20 additions and 32 deletions

View File

@ -23,33 +23,21 @@
#ifdef ENABLE_EGL
#include <EGL/egl.h>
#include <EGL/eglext.h>
#undef GL_KHR_debug
#include <GLES3/gl3.h>
#include <GLES2/gl2ext.h>
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;

View File

@ -23,14 +23,14 @@
#include <stdbool.h>
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include "common/types.h"
#include "egl_dynprocs.h"
struct SwapWithDamageData
{
bool init;
eglSwapBuffersWithDamageKHR_t func;
PFNEGLSWAPBUFFERSWITHDAMAGEKHRPROC func;
};
void swapWithDamageInit(struct SwapWithDamageData * data, EGLDisplay display);

View File

@ -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");
};