Merge pull request #26312 from garbear/update-controllers
[xbmc.git] / xbmc / windowing / X11 / GLContext.h
blob1e001699e1eb487c531cf4f9a2d7e788daf0566c
1 /*
2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #pragma once
11 #include <cstdint>
12 #include <string>
14 #include <X11/Xlib.h>
16 class CGLContext
18 public:
19 explicit CGLContext(Display *dpy)
21 m_dpy = dpy;
23 virtual ~CGLContext() = default;
24 virtual bool Refresh(bool force, int screen, Window glWindow, bool &newContext) = 0;
25 virtual bool CreatePB() { return false; }
26 virtual void Destroy() = 0;
27 virtual void Detach() = 0;
28 virtual void SetVSync(bool enable) = 0;
29 virtual void SwapBuffers() = 0;
30 virtual void QueryExtensions() = 0;
31 virtual bool IsBufferAgeSupported() { return false; }
32 virtual uint64_t GetVblankTiming(uint64_t& msc, uint64_t& interval) { return 0; }
33 virtual int GetBufferAge() { return 2; }
34 bool IsExtSupported(const char* extension) const;
36 const std::string& ExtPrefix() const { return m_extPrefix; }
37 std::string m_extPrefix;
38 std::string m_extensions;
40 Display *m_dpy;
42 protected:
43 bool m_omlSync = true;