summaryrefslogtreecommitdiffstats
path: root/DOCS
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-02-24 23:31:57 +0100
committerwm4 <wm4@nowhere>2013-02-26 02:00:53 +0100
commitc61f1ff61b8282d9938671543fa6a63d25cf5fc0 (patch)
treefbd63e42315516b1e6841db9482d3768bd86a06f /DOCS
parent281e10f05d02d1afe24f644a2d8b1672113630fd (diff)
downloadmpv-c61f1ff61b8282d9938671543fa6a63d25cf5fc0.tar.bz2
mpv-c61f1ff61b8282d9938671543fa6a63d25cf5fc0.tar.xz
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.
Diffstat (limited to 'DOCS')
0 files changed, 0 insertions, 0 deletions