1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-10 00:49:32 +00:00
mpv/video/out/opengl/egl_helpers.h
wm4 c9d3a79187 vo_opengl: add a generic EGL function loader function
This is pretty trivial, but also quite annoying due to details like
mismatching eglGetProcAddress() function signature (most callers just
cast the function pointer), and ARM/Linux hacks. So move them all to one
place.
2017-04-06 14:50:19 +02:00

34 lines
929 B
C

#ifndef MP_GL_EGL_HELPERS_H
#define MP_GL_EGL_HELPERS_H
#include <stdbool.h>
#include <EGL/egl.h>
#include <EGL/eglext.h>
struct mp_log;
bool mpegl_create_context(EGLDisplay display, struct mp_log *log, int vo_flags,
EGLContext *out_context, EGLConfig *out_config);
struct mpegl_opts {
// combination of VOFLAG_* values.
int vo_flags;
// for callbacks
void *user_data;
// if set, pick the desired config from the given list and return its index
// defaults to 0 (they are sorted by eglChooseConfig)
int (*refine_config)(void *user_data, EGLConfig *configs, int num_configs);
};
bool mpegl_create_context_opts(EGLDisplay display, struct mp_log *log,
struct mpegl_opts *opts,
EGLContext *out_context, EGLConfig *out_config);
struct GL;
void mpegl_load_functions(struct GL *gl, struct mp_log *log);
#endif