diff --git a/video/out/gpu_next/context.c b/video/out/gpu_next/context.c index c24a7c197a..b825eab243 100644 --- a/video/out/gpu_next/context.c +++ b/video/out/gpu_next/context.c @@ -148,6 +148,10 @@ struct gpu_ctx *gpu_ctx_create(struct vo *vo, struct gl_video_opts *gl_opts) pl_opengl_params( .debug = ctx_opts->debug, .allow_software = ctx_opts->allow_sw, +# if PL_API_VER >= 215 + .get_proc_addr_ex = (void *) ra_gl_get(ctx->ra_ctx->ra)->get_fn, + .proc_ctx = ra_gl_get(ctx->ra_ctx->ra)->fn_ctx, +# endif # if HAVE_EGL .egl_display = eglGetCurrentDisplay(), .egl_context = eglGetCurrentContext(), diff --git a/video/out/opengl/common.c b/video/out/opengl/common.c index d5883d4a4d..8e8638df9f 100644 --- a/video/out/opengl/common.c +++ b/video/out/opengl/common.c @@ -504,6 +504,8 @@ void mpgl_load_functions2(GL *gl, void *(*get_fn)(void *ctx, const char *n), talloc_free(gl->extensions); *gl = (GL) { .extensions = talloc_strdup(gl, ext2 ? ext2 : ""), + .get_fn = get_fn, + .fn_ctx = fn_ctx, }; gl->GetString = get_fn(fn_ctx, "glGetString"); diff --git a/video/out/opengl/common.h b/video/out/opengl/common.h index 1292be45b2..a9e67d9756 100644 --- a/video/out/opengl/common.h +++ b/video/out/opengl/common.h @@ -87,6 +87,11 @@ struct GL { int mpgl_caps; // Bitfield of MPGL_CAP_* constants bool debug_context; // use of e.g. GLX_CONTEXT_DEBUG_BIT_ARB + // Copy of function pointer used to load GL. + // Caution: Not necessarily valid to use after VO init has completed! + void *(*get_fn)(void *ctx, const char *n); + void *fn_ctx; + void (GLAPIENTRY *Viewport)(GLint, GLint, GLsizei, GLsizei); void (GLAPIENTRY *Clear)(GLbitfield); void (GLAPIENTRY *GenTextures)(GLsizei, GLuint *);