summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/hwdec_dxva2egl.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-05-11 12:33:49 +0200
committerwm4 <wm4@nowhere>2016-05-11 15:39:29 +0200
commitfde20d10bcacebf61aff42ab1f48ac72023a2aa5 (patch)
tree32208ac416db568fa7286f83a69b7c225df05f04 /video/out/opengl/hwdec_dxva2egl.c
parentbea76753078c2602c2fc67dc06ce13141560cf0d (diff)
downloadmpv-fde20d10bcacebf61aff42ab1f48ac72023a2aa5.tar.bz2
mpv-fde20d10bcacebf61aff42ab1f48ac72023a2aa5.tar.xz
vo_opengl: angle: dynamically load ANGLE
ANGLE is _really_ annoying to build. (Requires special toolchain and a recent MSVC version.) This results in various issues with people having trouble to build mpv against ANGLE (apparently linking it against a prebuilt binary doesn't count, or using binaries from potentially untrusted sources is not wanted). Dynamically loading ANGLE is going to be a huge convenience. This commit implements this, with special focus on keeping it source compatible to a normal build with ANGLE linked at build-time.
Diffstat (limited to 'video/out/opengl/hwdec_dxva2egl.c')
-rw-r--r--video/out/opengl/hwdec_dxva2egl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/video/out/opengl/hwdec_dxva2egl.c b/video/out/opengl/hwdec_dxva2egl.c
index 3a4ee6089f..be4c4d78ea 100644
--- a/video/out/opengl/hwdec_dxva2egl.c
+++ b/video/out/opengl/hwdec_dxva2egl.c
@@ -22,6 +22,8 @@
#include <EGL/egl.h>
#include <EGL/eglext.h>
+#include "angle_dynamic.h"
+
#include "common/common.h"
#include "osdep/timer.h"
#include "osdep/windows_utils.h"
@@ -95,6 +97,9 @@ static void destroy(struct gl_hwdec *hw)
static int create(struct gl_hwdec *hw)
{
+ if (!angle_load())
+ return -1;
+
EGLDisplay egl_display = eglGetCurrentDisplay();
if (!egl_display)
return -1;