lavd/opengl_enc: simplify opengl_load_procedures usage
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
This commit is contained in:
@@ -459,6 +459,11 @@ static int av_cold opengl_load_procedures(OpenGLContext *opengl)
|
|||||||
{
|
{
|
||||||
FFOpenGLFunctions *procs = &opengl->glprocs;
|
FFOpenGLFunctions *procs = &opengl->glprocs;
|
||||||
|
|
||||||
|
#if HAVE_SDL
|
||||||
|
if (!opengl->no_window)
|
||||||
|
return opengl_sdl_load_procedures(opengl);
|
||||||
|
#endif
|
||||||
|
|
||||||
procs->glActiveTexture = glActiveTexture;
|
procs->glActiveTexture = glActiveTexture;
|
||||||
procs->glGenBuffers = glGenBuffers;
|
procs->glGenBuffers = glGenBuffers;
|
||||||
procs->glDeleteBuffers = glDeleteBuffers;
|
procs->glDeleteBuffers = glDeleteBuffers;
|
||||||
@@ -504,6 +509,11 @@ static int av_cold opengl_load_procedures(OpenGLContext *opengl)
|
|||||||
return AVERROR(ENOSYS); \
|
return AVERROR(ENOSYS); \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if HAVE_SDL
|
||||||
|
if (!opengl->no_window)
|
||||||
|
return opengl_sdl_load_procedures(opengl);
|
||||||
|
#endif
|
||||||
|
|
||||||
LOAD_OPENGL_FUN(glActiveTexture, FF_PFNGLACTIVETEXTUREPROC)
|
LOAD_OPENGL_FUN(glActiveTexture, FF_PFNGLACTIVETEXTUREPROC)
|
||||||
LOAD_OPENGL_FUN(glGenBuffers, FF_PFNGLGENBUFFERSPROC)
|
LOAD_OPENGL_FUN(glGenBuffers, FF_PFNGLGENBUFFERSPROC)
|
||||||
LOAD_OPENGL_FUN(glDeleteBuffers, FF_PFNGLDELETEBUFFERSPROC)
|
LOAD_OPENGL_FUN(glDeleteBuffers, FF_PFNGLDELETEBUFFERSPROC)
|
||||||
@@ -1064,12 +1074,7 @@ static av_cold int opengl_write_header(AVFormatContext *h)
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!opengl->no_window) {
|
if ((ret = opengl_load_procedures(opengl)) < 0)
|
||||||
#if HAVE_SDL
|
|
||||||
if ((ret = opengl_sdl_load_procedures(opengl)) < 0)
|
|
||||||
goto fail;
|
|
||||||
#endif
|
|
||||||
} else if ((ret = opengl_load_procedures(opengl)) < 0)
|
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
opengl_fill_color_map(opengl);
|
opengl_fill_color_map(opengl);
|
||||||
|
|||||||
Reference in New Issue
Block a user