1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-05 14:40:43 +00:00
mpv/video/out
wm4 c61f1ff61b gl_common: simplify window/context creation
Allow the backend code to create a GL context on best effort basis,
instead of having to implement separate functions for each variation.
This means there's only a single create_window callback now. Also,
getFunctions() doesn't have the gl3 parameter anymore, which was
confusing and hard to explain.

create_window() tries to create a GL context of any version. The field
MPGLContext.requested_gl_version is taken as a hint whether a GL3 or a
legacy context is preferred. (This should be easy on all platforms.)

The cocoa part always assumes that GL 3 is always available on
OSX 10.7.0 and higher, and miserably fails if it's not. One could try
to put more effort into probing the context, but apparently this
situation never happens, so don't bother. (And even if, mpv should be
able to fall back to vo_corevideo.)

The X11 part doesn't change much, but moving these functions around
makes the diff bigger.

Note about some corner cases:

This doesn't handle CONTEXT_FORWARD_COMPATIBLE_BIT_ARB on OpenGL 3.0
correctly. This was the one thing getFunctions() actually needed the
gl3 parameter, and we just make sure we never use forward compatible
contexts on 3.0. It should work with any version above (e.g. 3.1, 3.2
and 3.3 should be fine). This is because the GL_ARB_compatibility
extension is specified for 3.1 and up only. There doesn't seem to be
any way to detect presence of legacy GL on 3.0 with a forward
compatible context. As a counter measure, remove the FORWARD_COMPATIBLE
flags from the win32 code. Maybe this will go wrong. (Should this
happen, the flag has the be added back, and the win32 will have to
explicitly check for GL 3.0 and add "GL_ARB_compatibility" to the extra
extension string.)

Note about GLX:

Probing GL versions by trying to create a context on an existing window
was (probably) not always possible. Old code used GLX 1.2 to create
legacy contexts, and it required code different from GLX 1.3 even before
creation of the X window (the problem was selections of the X Visual).
That's why there were two functions for window creation (create_window_old
and create_window_gl3). However, the legacy context creation code was
updated to GLX 1.3 in commit b3b20cc, so having different functions for
window creation is not needed anymore.
2013-02-26 02:00:53 +01:00
..
aspect.c options: move -geometry parsing to m_option.c 2013-01-23 10:56:11 +01:00
aspect.h
bitmap_packer.c
bitmap_packer.h
cocoa_common.h
cocoa_common.m gl_common: simplify window/context creation 2013-02-26 02:00:53 +01:00
d3d_shader_yuv.h
d3d_shader_yuv.hlsl vo_direct3d: remove 2ch hack for 10 bit playback 2013-01-13 20:04:14 +01:00
filter_kernels.c
filter_kernels.h
gl_common.c gl_common: simplify window/context creation 2013-02-26 02:00:53 +01:00
gl_common.h gl_common: simplify window/context creation 2013-02-26 02:00:53 +01:00
gl_header_fixes.h clang: fix all warnings except deprecations 2012-11-13 22:19:18 +01:00
gl_osd.c
gl_osd.h
osx_common.h osxbundle: cocoa_common: change playlist on fileopen events 2013-01-16 22:27:04 +01:00
osx_common.m Prefix keycode defines with MP_ 2013-02-12 10:27:00 +01:00
pnm_loader.c
pnm_loader.h
vo_caca.c vo_caca: remove OSD support 2013-02-24 16:15:50 +01:00
vo_corevideo.h
vo_corevideo.m vo_corevideo: make compile with recent changes 2013-01-15 01:00:07 +01:00
vo_direct3d.c vo_direct3d: always clear window before drawing video 2013-02-24 15:40:48 +01:00
vo_image.c options: drop --opt:subopt option names 2013-02-23 00:07:11 +01:00
vo_lavc.c audio/out, video/out: hide encoding VO/AO 2013-02-06 23:04:18 +01:00
vo_null.c video: remove slice based filtering and video output 2013-01-13 17:39:31 +01:00
vo_opengl_old.c options: move -geometry parsing to m_option.c 2013-01-23 10:56:11 +01:00
vo_opengl_shaders.glsl vo_opengl: use more precise gamma for BT.709 with color management 2012-12-28 13:43:24 +01:00
vo_opengl.c vo_opengl: always dither 2013-01-27 13:27:32 +01:00
vo_sdl.c Prefix keycode defines with MP_ 2013-02-12 10:27:00 +01:00
vo_vdpau.c cleanup: replace OPT_FLAG_ON and OPT_MAKE_FLAGS with OPT_FLAG 2013-02-09 00:21:17 +01:00
vo_x11.c vo_x11: fix redrawing on expose events 2013-01-27 13:32:39 +01:00
vo_xv.c vo_xv: fix green border on the right 2013-02-14 20:41:09 +01:00
vo.c Remove --rootwin option and rootwin property 2013-02-24 17:00:52 +01:00
vo.h Remove --rootwin option and rootwin property 2013-02-24 17:00:52 +01:00
w32_common.c core: add fs-screen option for fullscreen display selection 2013-02-21 22:23:08 +01:00
w32_common.h core: add fs-screen option for fullscreen display selection 2013-02-21 22:23:08 +01:00
x11_common.c Remove --rootwin option and rootwin property 2013-02-24 17:00:52 +01:00
x11_common.h core: add fs-screen option for fullscreen display selection 2013-02-21 22:23:08 +01:00