summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/egl_helpers.h
blob: ea751d4c5edbedc2050b5cc78333cebf3e2cd46b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#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