2015-05-24 04:55:12 +00:00
|
|
|
// Copyright 2008 Dolphin Emulator Project
|
2021-07-05 01:22:19 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2012-12-17 21:01:52 +00:00
|
|
|
|
2014-02-10 18:54:46 +00:00
|
|
|
#pragma once
|
2012-12-17 21:01:52 +00:00
|
|
|
|
2014-08-09 13:49:45 +00:00
|
|
|
#include <GL/glx.h>
|
2016-01-23 10:21:53 +00:00
|
|
|
#include <GL/glxext.h>
|
|
|
|
#include <memory>
|
2014-03-12 19:33:41 +00:00
|
|
|
#include <string>
|
2016-01-23 10:21:53 +00:00
|
|
|
#include <vector>
|
2014-03-12 19:33:41 +00:00
|
|
|
|
2018-10-03 13:02:45 +00:00
|
|
|
#include "Common/GL/GLContext.h"
|
|
|
|
#include "Common/GL/GLX11Window.h"
|
2012-12-17 21:01:52 +00:00
|
|
|
|
2018-10-03 13:03:33 +00:00
|
|
|
class GLContextGLX final : public GLContext
|
2012-12-17 21:01:52 +00:00
|
|
|
{
|
2018-10-03 13:02:45 +00:00
|
|
|
public:
|
2018-10-03 13:03:33 +00:00
|
|
|
~GLContextGLX() override;
|
|
|
|
|
2018-10-03 13:02:45 +00:00
|
|
|
bool IsHeadless() const override;
|
2016-01-23 10:21:53 +00:00
|
|
|
|
2018-10-03 13:02:45 +00:00
|
|
|
std::unique_ptr<GLContext> CreateSharedContext() override;
|
|
|
|
|
|
|
|
bool MakeCurrent() override;
|
|
|
|
bool ClearCurrent() override;
|
2016-06-24 08:43:46 +00:00
|
|
|
|
2018-10-03 13:03:19 +00:00
|
|
|
void Update() override;
|
|
|
|
|
2014-03-08 00:54:44 +00:00
|
|
|
void SwapInterval(int Interval) override;
|
|
|
|
void Swap() override;
|
2018-10-03 13:02:45 +00:00
|
|
|
|
2014-03-17 23:17:12 +00:00
|
|
|
void* GetFuncAddress(const std::string& name) override;
|
2018-10-03 13:02:45 +00:00
|
|
|
|
|
|
|
protected:
|
2019-04-10 14:40:19 +00:00
|
|
|
bool Initialize(const WindowSystemInfo& wsi, bool stereo, bool core) override;
|
2018-10-03 13:02:45 +00:00
|
|
|
|
|
|
|
Display* m_display = nullptr;
|
|
|
|
std::unique_ptr<GLX11Window> m_render_window;
|
|
|
|
|
|
|
|
GLXDrawable m_drawable = {};
|
2018-10-03 13:03:33 +00:00
|
|
|
GLXContext m_context = nullptr;
|
2018-10-03 13:02:45 +00:00
|
|
|
GLXFBConfig m_fbconfig = {};
|
|
|
|
bool m_supports_pbuffer = false;
|
|
|
|
GLXPbufferSGIX m_pbuffer = 0;
|
|
|
|
std::vector<int> m_attribs;
|
|
|
|
|
|
|
|
bool CreateWindowSurface(Window window_handle);
|
|
|
|
void DestroyWindowSurface();
|
2012-12-17 21:01:52 +00:00
|
|
|
};
|