Browse Source

vlc_opengl: document vlc_gl_GetProcAddress

Document that the function must be called with a context enabled. Even
if most low-level implementation will allow getting an address without
a context, so as to keep the same symbol across contexts, some other
common implementations like glfw[^1] will require an active context.

[^1]: https://www.glfw.org/docs/3.3/group__context.html#ga35f1837e6f666781842483937612f163
pull/136/head
Alexandre Janniaux 4 years ago
committed by Steve Lhomme
parent
commit
c0b2f318ce
  1. 18
      include/vlc_opengl.h

18
include/vlc_opengl.h

@ -134,6 +134,24 @@ static inline picture_t *vlc_gl_SwapOffscreen(vlc_gl_t *gl)
return gl->ops->swap_offscreen(gl);
}
/**
* Fetch a symbol or pointer function from the OpenGL implementation.
*
* Return a pointer from the OpenGL implementation, which can be part of
* either the underlying OpenGL provider or an OpenGL function matching
* the version requested.
*
* If the symbol name is not matching the underlying implementation of
* OpenGL, an invalid pointer or NULL can be returned.
*
* @note This function must be called between MakeCurrent and ReleaseCurrent.
*
* @param gl the OpenGL provider to fetch the function from
* @param name the symbol name to fetch from the implementation
*
* @return A pointer corresponding to the symbol, or a potentially invalid
* value or NULL in case of error.
*/
static inline void *vlc_gl_GetProcAddress(vlc_gl_t *gl, const char *name)
{
return gl->ops->get_proc_address(gl, name);

Loading…
Cancel
Save