2015-05-24 06:55:12 +02:00
|
|
|
// Copyright 2008 Dolphin Emulator Project
|
2015-05-18 01:08:10 +02:00
|
|
|
// Licensed under GPLv2+
|
2014-02-10 13:54:46 -05:00
|
|
|
// Refer to the license.txt file included.
|
2012-12-17 15:01:52 -06:00
|
|
|
|
2014-02-10 13:54:46 -05:00
|
|
|
#pragma once
|
2012-12-17 15:01:52 -06:00
|
|
|
|
2014-03-12 15:33:41 -04:00
|
|
|
#include <string>
|
2014-03-27 20:26:52 -04:00
|
|
|
#include <EGL/egl.h>
|
2016-01-22 10:58:19 -06:00
|
|
|
#include <EGL/eglext.h>
|
2014-02-17 05:18:15 -05:00
|
|
|
|
2015-09-19 04:40:00 +12:00
|
|
|
#include "Common/GL/GLInterfaceBase.h"
|
2012-12-17 15:01:52 -06:00
|
|
|
|
|
|
|
class cInterfaceEGL : public cInterfaceBase
|
|
|
|
{
|
2016-01-10 12:28:05 -06:00
|
|
|
private:
|
|
|
|
EGLConfig m_config;
|
|
|
|
bool m_has_handle;
|
|
|
|
EGLNativeWindowType m_host_window;
|
|
|
|
bool m_supports_surfaceless = false;
|
|
|
|
|
2016-01-21 19:03:58 -06:00
|
|
|
bool CreateWindowSurface();
|
2016-01-10 12:28:05 -06:00
|
|
|
void DestroyWindowSurface();
|
|
|
|
|
2014-08-09 10:31:27 -04:00
|
|
|
protected:
|
2014-01-18 04:11:59 +00:00
|
|
|
void DetectMode();
|
2014-08-09 09:49:45 -04:00
|
|
|
EGLSurface egl_surf;
|
|
|
|
EGLContext egl_ctx;
|
|
|
|
EGLDisplay egl_dpy;
|
2014-08-09 10:31:27 -04:00
|
|
|
|
2016-01-21 19:03:58 -06:00
|
|
|
virtual EGLDisplay OpenDisplay() { return EGL_NO_DISPLAY; }
|
|
|
|
virtual EGLNativeWindowType InitializePlatform(EGLNativeWindowType host_window, EGLConfig config) { return (EGLNativeWindowType)EGL_DEFAULT_DISPLAY; }
|
|
|
|
virtual void ShutdownPlatform() {}
|
2016-01-10 12:28:05 -06:00
|
|
|
|
2012-12-17 15:01:52 -06:00
|
|
|
public:
|
2016-01-02 14:12:32 -05:00
|
|
|
void Swap() override;
|
|
|
|
void SwapInterval(int interval) override;
|
2016-01-02 14:19:28 -05:00
|
|
|
void SetMode(GLInterfaceMode mode) override { s_opengl_mode = mode; }
|
2016-01-02 14:12:32 -05:00
|
|
|
void* GetFuncAddress(const std::string& name) override;
|
|
|
|
bool Create(void* window_handle, bool core) override;
|
2016-01-21 19:03:58 -06:00
|
|
|
bool Create(cInterfaceBase* main_context) override;
|
2016-01-02 14:12:32 -05:00
|
|
|
bool MakeCurrent() override;
|
|
|
|
bool ClearCurrent() override;
|
|
|
|
void Shutdown() override;
|
2016-01-10 12:28:05 -06:00
|
|
|
void UpdateHandle(void* window_handle) override;
|
|
|
|
void UpdateSurface() override;
|
2016-01-21 19:03:58 -06:00
|
|
|
std::unique_ptr<cInterfaceBase> CreateSharedContext() override;
|
2012-12-17 15:01:52 -06:00
|
|
|
};
|