Skip to content

Commit

Permalink
libobs-opengl: Introduce the X11/EGL winsys
Browse files Browse the repository at this point in the history
Introduce the EGL/X11 winsys, and use it when the OBS_USE_EGL environment
variable is defined. This variable is only temporary, for future commits
will add a proper concept of platform.

All the EGL/X11 code is authored by Ivan Avdeev <[email protected]>.
  • Loading branch information
GeorgesStavracas committed Oct 3, 2020
1 parent 96bbb1d commit 494e753
Show file tree
Hide file tree
Showing 4 changed files with 681 additions and 1 deletion.
1 change: 1 addition & 0 deletions libobs-opengl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ else() #This needs to change to be more specific to get ready for Wayland

set(libobs-opengl_PLATFORM_SOURCES
gl-nix.c
gl-x11-egl.c
gl-x11-glx.c)
endif()

Expand Down
8 changes: 7 additions & 1 deletion libobs-opengl/gl-nix.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,20 @@

#include "gl-nix.h"
#include "gl-x11-glx.h"
#include "gl-x11-egl.h"

static const struct gl_winsys_vtable *gl_vtable = NULL;

static void init_winsys(void)
{
assert(gl_vtable == NULL);

gl_vtable = gl_x11_glx_get_winsys_vtable();
if (getenv("OBS_USE_EGL")) {
gl_vtable = gl_x11_egl_get_winsys_vtable();
blog(LOG_INFO, "Using EGL/X11");
} else {
gl_vtable = gl_x11_glx_get_winsys_vtable();
}

assert(gl_vtable != NULL);
}
Expand Down
Loading

0 comments on commit 494e753

Please sign in to comment.