// SPDX-FileCopyrightText: 2019-2024 Connor McLaughlin // SPDX-License-Identifier: CC-BY-NC-ND-4.0 #pragma once #include "opengl_context_egl.h" #include "x11_tools.h" #include class OpenGLContextEGLXCB final : public OpenGLContextEGL { public: OpenGLContextEGLXCB(); ~OpenGLContextEGLXCB() override; static std::unique_ptr Create(WindowInfo& wi, SurfaceHandle* surface, std::span versions_to_try, Error* error); std::unique_ptr CreateSharedContext(WindowInfo& wi, SurfaceHandle* surface, Error* error) override; void ResizeSurface(WindowInfo& wi, SurfaceHandle handle) override; protected: EGLDisplay GetPlatformDisplay(const WindowInfo& wi, Error* error) override; EGLSurface CreatePlatformSurface(EGLConfig config, const WindowInfo& wi, Error* error) override; void DestroyPlatformSurface(EGLSurface surface) override; private: using X11WindowMap = std::unordered_map; X11WindowMap m_x11_windows; bool m_using_platform_display = false; };