mpv_opengl_cb_init_gl

Initialize the mpv OpenGL state. This retrieves OpenGL function pointers via get_proc_address, and creates OpenGL objects needed by mpv internally. It will also call APIs needed for rendering hardware decoded video in OpenGL, according to the mpv "hwdec" option.

You must free the associated state at some point by calling the mpv_opengl_cb_uninit_gl() function. Not doing so may result in memory leaks or worse.

@param exts optional _additional_ extension string, can be NULL @param get_proc_address callback used to retrieve function pointers to OpenGL functions. This is used for both standard functions and extension functions. (The extension string is checked whether extensions are really available.) The callback will be called from this function only (it is not stored and never used later). Usually, GL context APIs do this for you (e.g. with glXGetProcAddressARB or wglGetProcAddress), but some APIs do not always return pointers for all standard functions (even if present); in this case you have to compensate by looking up these functions yourself. @param get_proc_address_ctx arbitrary opaque user context passed to the get_proc_address callback @return error code (same as normal mpv_* API), including but not limited to:

More...

Detailed Description

MPV ERROR UNSUPPORTED

the OpenGL version is not supported (or required extensions are missing)

MPV ERROR INVALID PARAMETER

the OpenGL state was already initialized

Meta