summaryrefslogtreecommitdiffstats
path: root/video/out/gl_x11.c
Commit message (Collapse)AuthorAgeFilesLines
* vo_opengl: move gl_* files to their own subdirNiklas Haas2015-09-091-307/+0
| | | | | This is mainly just to keep things a bit more organized and separated inside the codebase.
* vo_opengl: X11: don't leak when GL init failswm42015-07-021-1/+4
|
* vo_opengl: hardcode rquested GL version in backendswm42015-05-141-2/+1
| | | | | The requested version field didn't make much sense anymore, and was even partially ignored by some backends.
* x11: use new OpenGL backend APIwm42015-05-141-22/+31
|
* vo_opengl: change user options for requesting GLESwm42015-05-141-9/+1
| | | | | | | | Instead of having separate backends, make use of GLES a flag. This reduces the number of backends and the resulting annoyances. Also, nobody cares about using GLES, so there's no backward compatibility either.
* Update license headersMarcin Kurczewski2015-04-131-4/+5
| | | | Signed-off-by: wm4 <wm4@nowhere>
* vo_opengl: log used GLXFBConfigwm42015-04-091-0/+1
| | | | | Now don't ask me why the GLXFBConfig type is a pointer, but stores an integer ID.
* vo_opengl: remove remnants of dropped stereo buffer supportwm42015-01-241-11/+0
|
* vo_opengl: cleanups after vo_opengl_old removalwm42015-01-211-4/+5
| | | | | | | | | | | | | Don't load all the legacy functions (including ancient extensions). Slightly simplify function loader and context creation, now that legacy GL doesn't need to be handled. Remove the code for drawing OSD in legacy mode. Remove all the header hacks, which were meant for ancient OpenGL headers which didn't even support things like OpenGL 1.3. Instead, adjust the GLX check to make sure we get both OpenGL 3x and 2.1 symbols. For win32 and OSX, we assume that the user has the latest headers anyway. For wayland, we hope that things somehow go right.
* x11: always use glXGetProcAddressARB()wm42015-01-071-1/+1
| | | | | | | | | | glXGetProcAddress() is outdated, and as far as I know doesn't give all the guarantees the "new" ARB function gives. Probably doesn't matter too much, because until now it always appeared to work. On the other hand, since this function is (bogusly) used only on the gl3 code path, it could have happened that users hit this, and just reverted to vo_opengl_old instead.
* vo_opengl: remove pointless glFinish callswm42014-12-191-3/+0
|
* vo_opengl, x11: add ES context creation via GLXwm42014-12-191-8/+28
| | | | | | | | Apparently GLX can do this, so using EGL is not strictly required. This code tries to create an ES context if creating a desktop GL context fails. Also, a "x11es" backend for forcing ES (instead of desktop GL) is added, mostly for testing and debugging.
* vo_opengl: better probe handlingwm42014-12-191-11/+2
| | | | | | | | | | | | | Involve detection of software renderers in the probing properly. Other VOs could handle probing also more gracefully, and e.g. produce less noise if an API is unavailable. (Although other than the OpenGL VOs, only vo_wayland will.) Now the "sw" suboption for vo_opengl[_old] is strictly speaking not needed anymore. Doing "--vo=opengl" disables the probing logic, and will always force it, if possible. Includes some simplifications as well.
* vo_opengl, x11: make legacy context warning not an errorwm42014-12-181-1/+1
| | | | | | Really, this doesn't actually matter. It's printed as error only because it was once thought to be an mostly unneeded fallback, but it turned out this is still frequently needed, and users are getting confused.
* gl_x11: distinguish missing GLX and too old GLX versionswm42014-10-121-3/+5
| | | | | | This probably led to confusing output. CC: @mpv-player/stable
* gl_x11: remove workaround for PPC OSX 10.4wm42014-05-311-7/+0
| | | | | Added in 2010 with commit 4a8486f8 (svn commit 30994). I doubt anyone still uses X11 on OSX, and we probably don't support 10.4 either.
* gl_x11: always require some GLX API functions, avoid dlsym()wm42014-05-311-17/+5
| | | | | | | | | | | | | | The functions glXGetProcAddressARB() and glXQueryExtensionsString() were loaded using dlsym(). This could fail when compiling to libmpv, because then dlopen(NULL, ...) will look in the main program's list of libraries, and the libGL linked to libmpv is never considered. (Don't know if this somehow could be worked around.) The result is that using vo_opengl with libmpv can fail. Avoid this by not using dlsym(). glXGetProcAddressARB() was already used directly in the same file, and that never caused any problems. (Still add it to the configure test.) glXQueryExtensionsString() is documented as added in GLX 1.1 - that's ancient.
* video/out: remove unused config() parameterswm42014-05-071-2/+1
| | | | This was cleaned up yesterday.
* x11: don't use VOCTRL_UPDATE_SCREENINFOwm42014-05-061-2/+2
| | | | See previous commit.
* gl_x11: don't require a X visual for modern GL context creationwm42014-02-061-4/+10
| | | | | | | | Legacy GL context creation (glXCreateContext) explicitly requires a X visual, while the modern one (glXCreateContextAttribsARB) does not for some reason. So fail only on the legacy code path if we don't find a visual. Note that vo_x11_config_vo_window() will select a default visual if a NULL visual is passed to it.
* gl_x11: always request true color visualwm42014-02-061-0/+1
| | | | | | | | | | | | | | | | | | This fixes issue #504. For some reason, glXChooseFBConfig() will return a fbconfig with no associated visual. (I'm not sure if this allowed. They don't always have a visual, but since GLX_X_RENDERABLE is set and GLX_DRAWABLE_TYPE is (implicitly) set to GLX_WINDOW_BIT, why would there be no visual?) Even worse, a test program seems to show that a 16 bit fbconfig is selected (instead of 24/32 bit), which doesn't sound nice at all. Since there _are_ better fbconfigs available, glXChooseFBConfig() should normally sort them by quality, and return the better ones first. It's worth noting that this function should also prefer GLX_TRUE_COLOR over anything else, although this comes last in the sort order. Whatever is going on, requesting GLX_X_VISUAL_TYPE with GLX_TRUE_COLOR seems to fix it.
* vo_opengl: don't assume there'a always 1 fbconfig on successwm42014-01-211-1/+1
| | | | Seems to be a reasonable assumption, but it's probably not guaranteed.
* video/out: remove pointless x/y parameter from vo_x11_config_vo_windowwm42014-01-111-4/+2
| | | | | This never made any real sense; the "backend" has to access vo->dx/dy anyway.
* gl_common: remove unneeded callbackwm42013-11-141-1/+0
| | | | We got rid of this some time ago, but apparently not completely.
* gl_x11: change error message when GL3 context creation failswm42013-10-281-1/+1
| | | | | | | | | | | | | | On systems that provide legacy OpenGL (up to 2.1), but not GL3 and later, creating a GL3 context will fail. We then revert to legacy GL. Apparently the error message printed when the GL3 context creation fails is confusing. We could just silence it, but there's still a X error ("X11 error: GLXBadFBConfig"), which would be quite hard to filter out. For one, it would require messing with the X11 error handler, which doesn't even carry a context pointer (for application private data), so we don't even want to touch it. Instead, change the error message to inform the user what's actually happening: a fallback to an older version of OpenGL.
* gl_x11: fail gracefully if selected FBconfig has no X visualwm42013-10-031-0/+6
| | | | | | | | | | | glXGetVisualFromFBConfig() specifies specifies that it can return NULL if there is no associated X visual. Instead of crashing, let initialization fail. I'm not sure if this is actually supposed to work with a fallback visual (passing a NULL visual to vo_x11_config_vo_window would just do this), but let's play safe for now. Apparently this can happen when trying to use vo_opengl over a remote X display.
* gl_common: complete mp_msg conversionwm42013-09-121-3/+3
| | | | Hopefully this works on Wayland and Cocoa, which I didn't test.
* gl_x11: mp_msg conversionAlexander Preisinger2013-09-111-12/+10
|
* video/out: introduce vo_control for gl_common based VOswm42013-05-261-4/+1
| | | | | | | | | | | | | | | | Instead of having separate callbacks for each backend-handled feature (like MPGLContext.fullscreen, MPGLContext.border, etc.), pass the VOCTRL responsible for this directly to the backend. This allows removing a bunch of callbacks, that currently must be set even for optional/lesser features (like VOCTRL_BORDER). This requires changes to all VOs using gl_common, as well as all backends that support gl_common. Also introduce VOCTRL_CHECK_EVENTS. vo.check_events is now optional. VO backends can use VOCTRL_CHECK_EVENTS instead to implementing check_events. This has the advantage that the event handling code in VOs doesn't have to be duplicated if vo_control() is used.
* vo_opengl: add alpha outputwm42013-03-281-6/+41
| | | | | | | | | | | | | | | | | | | Allows playing video with alpha information on X11, as long as the video contains alpha and the window manager does compositing. See vo.rst. Whether a window can be transparent is decided by the choice of the X Visual used for window creation. Unfortunately, there's no direct way to request such a Visual through the GLX or the X API, and use of the XRender extension is required to find out whether a Visual implies a framebuffer with alpha used by XRender (see for example [1]). Instead of depending on the XRender wrapper library (which would require annoying configure checks, even though XRender is virtually always supported), use a simple heuristics to find out whether a Visual has alpha. Since getting it wrong just means an optional feature will not work as expected, we consider this ok. [1] http://stackoverflow.com/questions/4052940/how-to-make-an-opengl- rendering-context-with-transparent-background/9215724#9215724
* gl_common: split into platform specific fileswm42013-03-281-0/+282
Do this instead of stuffing all x11/cocoa/win32/wayland specific code into gl_common.c. The cocoa specific parts could probably go directly into cocoa_common.m, possibly same with wayland. Also redo how the list of backends is managed. Get rid of the GLTYPE_ constants. Instead of having a big switch() on GLTYPE_, each backend entry has a function pointer to setup the MPGLContext callback (e.g. mpgl_set_backend_x11()).