mirror of
https://github.com/mpv-player/mpv
synced 2025-01-21 07:10:52 +00:00
gl_x11: mp_msg conversion
This commit is contained in:
parent
9549746453
commit
df5606afe0
@ -47,12 +47,12 @@ static bool create_context_x11_old(struct MPGLContext *ctx)
|
|||||||
GLXContext new_context = glXCreateContext(display, glx_ctx->vinfo, NULL,
|
GLXContext new_context = glXCreateContext(display, glx_ctx->vinfo, NULL,
|
||||||
True);
|
True);
|
||||||
if (!new_context) {
|
if (!new_context) {
|
||||||
mp_msg(MSGT_VO, MSGL_FATAL, "[gl] Could not create GLX context!\n");
|
MP_FATAL(vo, "Could not create GLX context!\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!glXMakeCurrent(display, ctx->vo->x11->window, new_context)) {
|
if (!glXMakeCurrent(display, ctx->vo->x11->window, new_context)) {
|
||||||
mp_msg(MSGT_VO, MSGL_FATAL, "[gl] Could not set GLX context!\n");
|
MP_FATAL(vo, "Could not set GLX context!\n");
|
||||||
glXDestroyContext(display, new_context);
|
glXDestroyContext(display, new_context);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -73,8 +73,7 @@ static bool create_context_x11_old(struct MPGLContext *ctx)
|
|||||||
gl->version < MPGL_VER(3, 0) &&
|
gl->version < MPGL_VER(3, 0) &&
|
||||||
strstr(gl->GetString(GL_EXTENSIONS), "GL_ARB_vertex_program"))
|
strstr(gl->GetString(GL_EXTENSIONS), "GL_ARB_vertex_program"))
|
||||||
{
|
{
|
||||||
mp_msg(MSGT_VO, MSGL_WARN,
|
MP_WARN(vo, "Broken glXGetProcAddress detected, trying workaround\n");
|
||||||
"Broken glXGetProcAddress detected, trying workaround\n");
|
|
||||||
mpgl_load_functions(gl, NULL, glxstr);
|
mpgl_load_functions(gl, NULL, glxstr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -124,13 +123,13 @@ static bool create_context_x11_gl3(struct MPGLContext *ctx, bool debug)
|
|||||||
glx_ctx->fbc, 0, True,
|
glx_ctx->fbc, 0, True,
|
||||||
context_attribs);
|
context_attribs);
|
||||||
if (!context) {
|
if (!context) {
|
||||||
mp_msg(MSGT_VO, MSGL_FATAL, "[gl] Could not create GLX context!\n");
|
MP_FATAL(vo, "Could not create GLX context!\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// set context
|
// set context
|
||||||
if (!glXMakeCurrent(vo->x11->display, vo->x11->window, context)) {
|
if (!glXMakeCurrent(vo->x11->display, vo->x11->window, context)) {
|
||||||
mp_msg(MSGT_VO, MSGL_FATAL, "[gl] Could not set GLX context!\n");
|
MP_FATAL(vo, "Could not set GLX context!\n");
|
||||||
glXDestroyContext(vo->x11->display, context);
|
glXDestroyContext(vo->x11->display, context);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -211,7 +210,7 @@ static bool config_window_x11(struct MPGLContext *ctx, uint32_t d_width,
|
|||||||
if (!glXQueryVersion(vo->x11->display, &glx_major, &glx_minor) ||
|
if (!glXQueryVersion(vo->x11->display, &glx_major, &glx_minor) ||
|
||||||
(MPGL_VER(glx_major, glx_minor) < MPGL_VER(1, 3)))
|
(MPGL_VER(glx_major, glx_minor) < MPGL_VER(1, 3)))
|
||||||
{
|
{
|
||||||
mp_msg(MSGT_VO, MSGL_ERR, "[gl] GLX version older than 1.3.\n");
|
MP_ERR(vo, "GLX version older than 1.3.\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -238,7 +237,7 @@ static bool config_window_x11(struct MPGLContext *ctx, uint32_t d_width,
|
|||||||
set_glx_attrib(glx_attribs, GLX_STEREO, True);
|
set_glx_attrib(glx_attribs, GLX_STEREO, True);
|
||||||
fbc = select_fb_config(vo, glx_attribs, flags);
|
fbc = select_fb_config(vo, glx_attribs, flags);
|
||||||
if (!fbc) {
|
if (!fbc) {
|
||||||
mp_msg(MSGT_VO, MSGL_ERR, "[gl] Could not find a stereo visual,"
|
MP_ERR(vo, "Could not find a stereo visual,"
|
||||||
" 3D will probably not work!\n");
|
" 3D will probably not work!\n");
|
||||||
set_glx_attrib(glx_attribs, GLX_STEREO, False);
|
set_glx_attrib(glx_attribs, GLX_STEREO, False);
|
||||||
flags &= ~VOFLAG_STEREO;
|
flags &= ~VOFLAG_STEREO;
|
||||||
@ -247,15 +246,14 @@ static bool config_window_x11(struct MPGLContext *ctx, uint32_t d_width,
|
|||||||
if (!fbc)
|
if (!fbc)
|
||||||
fbc = select_fb_config(vo, glx_attribs, flags);
|
fbc = select_fb_config(vo, glx_attribs, flags);
|
||||||
if (!fbc) {
|
if (!fbc) {
|
||||||
mp_msg(MSGT_VO, MSGL_ERR, "[gl] no GLX support present\n");
|
MP_ERR(vo, "no GLX support present\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
glx_ctx->fbc = fbc;
|
glx_ctx->fbc = fbc;
|
||||||
glx_ctx->vinfo = glXGetVisualFromFBConfig(vo->x11->display, fbc);
|
glx_ctx->vinfo = glXGetVisualFromFBConfig(vo->x11->display, fbc);
|
||||||
|
|
||||||
mp_msg(MSGT_VO, MSGL_V, "[gl] GLX chose visual with ID 0x%x\n",
|
MP_VERBOSE(vo, "GLX chose visual with ID 0x%x\n", (int)glx_ctx->vinfo->visualid);
|
||||||
(int)glx_ctx->vinfo->visualid);
|
|
||||||
|
|
||||||
glXGetFBConfigAttrib(vo->x11->display, fbc, GLX_RED_SIZE, &ctx->depth_r);
|
glXGetFBConfigAttrib(vo->x11->display, fbc, GLX_RED_SIZE, &ctx->depth_r);
|
||||||
glXGetFBConfigAttrib(vo->x11->display, fbc, GLX_GREEN_SIZE, &ctx->depth_g);
|
glXGetFBConfigAttrib(vo->x11->display, fbc, GLX_GREEN_SIZE, &ctx->depth_g);
|
||||||
|
Loading…
Reference in New Issue
Block a user