1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-25 09:03:15 +00:00
mpv/video/out/opengl/egl_helpers.h
wm4 7033a4334b vo_opengl: egl_helpers: add a way to override config selection
Preparation for the following commits. Since at least theoretically the
config selection depends on the context type (EGL_RENDERABLE_TYPE has
separate bits for ES 2, ES 3, and desktop GL), doing it any other way
would be too painful.
2016-12-30 20:03:50 +01:00

31 lines
855 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);
#endif