File indexing completed on 2024-11-10 04:56:34
0001 /* 0002 KWin - the KDE window manager 0003 This file is part of the KDE project. 0004 0005 SPDX-FileCopyrightText: 2023 Xaver Hugl <xaver.hugl@gmail.com> 0006 0007 SPDX-License-Identifier: GPL-2.0-or-later 0008 */ 0009 #pragma once 0010 #include "opengl/openglcontext.h" 0011 #include "x11_standalone_glx_backend.h" 0012 0013 #include <epoxy/glx.h> 0014 0015 namespace KWin 0016 { 0017 0018 class GlxContext : public OpenGlContext 0019 { 0020 public: 0021 GlxContext(::Display *display, GLXWindow window, GLXContext handle); 0022 ~GlxContext() override; 0023 0024 bool makeCurrent() const; 0025 bool doneCurrent() const; 0026 0027 static std::unique_ptr<GlxContext> create(GlxBackend *backend, GLXFBConfig fbconfig, GLXWindow glxWindow); 0028 0029 private: 0030 ::Display *const m_display; 0031 const GLXWindow m_window; 0032 const GLXContext m_handle; 0033 uint32_t m_vao = 0; 0034 }; 0035 0036 }