mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 00:59:44 -06:00
Remove support for EGL under X11
Now, the only supported EGL platform is Android. We might eventually add back support for EGL/X11 or EGL/Wayland, but it will have to be architected differently.
This commit is contained in:
@ -6,104 +6,6 @@
|
||||
#include "DolphinWX/GLInterface/GLInterface.h"
|
||||
#include "VideoCommon/VideoConfig.h"
|
||||
|
||||
#if USE_EGL
|
||||
bool cXInterface::ServerConnect(void)
|
||||
{
|
||||
GLWin.dpy = XOpenDisplay(nullptr);
|
||||
|
||||
if (!GLWin.dpy)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool cXInterface::Initialize(void *config, void *window_handle)
|
||||
{
|
||||
XVisualInfo visTemplate;
|
||||
int num_visuals;
|
||||
EGLint vid;
|
||||
|
||||
if (!GLWin.dpy) {
|
||||
printf("Error: couldn't open X display\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!eglGetConfigAttrib(GLWin.egl_dpy, config, EGL_NATIVE_VISUAL_ID, &vid)) {
|
||||
printf("Error: eglGetConfigAttrib() failed\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* The X window visual must match the EGL config */
|
||||
visTemplate.visualid = vid;
|
||||
GLWin.vi = XGetVisualInfo(GLWin.dpy, VisualIDMask, &visTemplate, &num_visuals);
|
||||
if (!GLWin.vi) {
|
||||
printf("Error: couldn't get X visual\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
GLWin.evdpy = XOpenDisplay(nullptr);
|
||||
GLWin.parent = (Window) window_handle;
|
||||
GLWin.screen = DefaultScreen(GLWin.dpy);
|
||||
|
||||
if (GLWin.parent == 0)
|
||||
GLWin.parent = RootWindow(GLWin.dpy, GLWin.screen);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void *cXInterface::EGLGetDisplay(void)
|
||||
{
|
||||
return eglGetDisplay(GLWin.dpy);
|
||||
}
|
||||
|
||||
void *cXInterface::CreateWindow(void)
|
||||
{
|
||||
Atom wmProtocols[1];
|
||||
|
||||
// Setup window attributes
|
||||
GLWin.attr.colormap = XCreateColormap(GLWin.evdpy,
|
||||
GLWin.parent, GLWin.vi->visual, AllocNone);
|
||||
GLWin.attr.event_mask = KeyPressMask | StructureNotifyMask | FocusChangeMask;
|
||||
GLWin.attr.background_pixel = BlackPixel(GLWin.evdpy, GLWin.screen);
|
||||
GLWin.attr.border_pixel = 0;
|
||||
|
||||
// Create the window
|
||||
GLWin.win = XCreateWindow(GLWin.evdpy, GLWin.parent,
|
||||
0, 0, 1, 1, 0,
|
||||
GLWin.vi->depth, InputOutput, GLWin.vi->visual,
|
||||
CWBorderPixel | CWBackPixel | CWColormap | CWEventMask, &GLWin.attr);
|
||||
wmProtocols[0] = XInternAtom(GLWin.evdpy, "WM_DELETE_WINDOW", True);
|
||||
XSetWMProtocols(GLWin.evdpy, GLWin.win, wmProtocols, 1);
|
||||
XSetStandardProperties(GLWin.evdpy, GLWin.win, "GPU", "GPU", None, nullptr, 0, nullptr);
|
||||
XMapRaised(GLWin.evdpy, GLWin.win);
|
||||
XSync(GLWin.evdpy, True);
|
||||
|
||||
GLWin.xEventThread = std::thread(&cXInterface::XEventThread, this);
|
||||
|
||||
return (void *) GLWin.win;
|
||||
}
|
||||
|
||||
void cXInterface::DestroyWindow(void)
|
||||
{
|
||||
XDestroyWindow(GLWin.evdpy, GLWin.win);
|
||||
GLWin.win = 0;
|
||||
if (GLWin.xEventThread.joinable())
|
||||
GLWin.xEventThread.join();
|
||||
XFreeColormap(GLWin.evdpy, GLWin.attr.colormap);
|
||||
}
|
||||
|
||||
void cXInterface::UpdateFPSDisplay(const std::string& text)
|
||||
{
|
||||
XStoreName(GLWin.evdpy, GLWin.win, text.c_str());
|
||||
}
|
||||
|
||||
void cXInterface::SwapBuffers()
|
||||
{
|
||||
eglSwapBuffers(GLWin.egl_dpy, GLWin.egl_surf);
|
||||
}
|
||||
|
||||
void cXInterface::XEventThread()
|
||||
#else
|
||||
void cX11Window::CreateXWindow(void)
|
||||
{
|
||||
Atom wmProtocols[1];
|
||||
@ -139,7 +41,6 @@ void cX11Window::DestroyXWindow(void)
|
||||
}
|
||||
|
||||
void cX11Window::XEventThread()
|
||||
#endif
|
||||
{
|
||||
while (GLWin.win)
|
||||
{
|
||||
|
Reference in New Issue
Block a user