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-03-28 00:26:52 +00:00
|
|
|
#include <EGL/egl.h>
|
2016-01-22 16:58:19 +00:00
|
|
|
#include <EGL/eglext.h>
|
2014-03-12 19:33:41 +00:00
|
|
|
#include <string>
|
2017-07-27 01:57:32 +00:00
|
|
|
#include <vector>
|
2014-02-17 10:18:15 +00:00
|
|
|
|
2018-10-03 13:02:45 +00:00
|
|
|
#include "Common/GL/GLContext.h"
|
2012-12-17 21:01:52 +00:00
|
|
|
|
2018-10-03 13:02:45 +00:00
|
|
|
class GLContextEGL : 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
|
|
|
virtual ~GLContextEGL() override;
|
2016-01-10 18:28:05 +00:00
|
|
|
|
2018-10-03 13:02:45 +00:00
|
|
|
bool IsHeadless() const override;
|
2016-01-10 18:28:05 +00:00
|
|
|
|
2018-10-03 13:02:45 +00:00
|
|
|
std::unique_ptr<GLContext> CreateSharedContext() override;
|
|
|
|
|
|
|
|
bool MakeCurrent() override;
|
|
|
|
bool ClearCurrent() override;
|
|
|
|
|
|
|
|
void UpdateSurface(void* window_handle) override;
|
2018-04-12 12:18:04 +00:00
|
|
|
|
2016-01-02 19:12:32 +00:00
|
|
|
void Swap() override;
|
|
|
|
void SwapInterval(int interval) override;
|
2018-10-03 13:02:45 +00:00
|
|
|
|
2016-01-02 19:12:32 +00:00
|
|
|
void* GetFuncAddress(const std::string& name) override;
|
2018-10-03 13:02:45 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual EGLDisplay OpenEGLDisplay();
|
|
|
|
virtual EGLNativeWindowType GetEGLNativeWindow(EGLConfig config);
|
|
|
|
|
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
|
|
|
|
|
|
|
bool CreateWindowSurface();
|
|
|
|
void DestroyWindowSurface();
|
2019-04-10 14:40:19 +00:00
|
|
|
void DetectMode();
|
2018-10-03 13:03:33 +00:00
|
|
|
void DestroyContext();
|
2018-10-03 13:02:45 +00:00
|
|
|
|
2019-04-10 14:40:19 +00:00
|
|
|
WindowSystemInfo m_wsi = {};
|
2018-10-03 13:02:45 +00:00
|
|
|
|
|
|
|
EGLConfig m_config;
|
|
|
|
bool m_supports_surfaceless = false;
|
|
|
|
std::vector<int> m_attribs;
|
|
|
|
|
2018-10-03 13:03:33 +00:00
|
|
|
EGLSurface m_egl_surface = EGL_NO_SURFACE;
|
|
|
|
EGLContext m_egl_context = EGL_NO_CONTEXT;
|
|
|
|
EGLDisplay m_egl_display = EGL_NO_DISPLAY;
|
2012-12-17 21:01:52 +00:00
|
|
|
};
|