| 1 |
/* |
| 2 |
* Copyright (C) 2005-2018 Team Kodi |
| 3 |
* This file is part of Kodi - https://kodi.tv |
| 4 |
* |
| 5 |
* SPDX-License-Identifier: GPL-2.0-or-later |
| 6 |
* See LICENSES/README.md for more information. |
| 7 |
*/ |
| 8 |
|
| 9 |
#pragma once |
| 10 |
|
| 11 |
#include <cstdint> |
| 12 |
#include <string> |
| 13 |
|
| 14 |
#include <X11/Xlib.h> |
| 15 |
|
| 16 |
class CGLContext |
| 17 |
{ |
| 18 |
public: |
| 19 |
explicit CGLContext(Display *dpy) |
| 20 |
{ |
| 21 |
m_dpy = dpy; |
| 22 |
} |
| 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 uint64_t GetVblankTiming(uint64_t& msc, uint64_t& interval) { return 0; } |
| 32 |
bool IsExtSupported(const char* extension) const; |
| 33 |
|
| 34 |
std::string ExtPrefix() { return m_extPrefix; } |
| 35 |
std::string m_extPrefix; |
| 36 |
std::string m_extensions; |
| 37 |
|
| 38 |
Display *m_dpy; |
| 39 |
|
| 40 |
protected: |
| 41 |
bool m_omlSync = true; |
| 42 |
}; |