mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-25 05:23:39 +01:00

This is being implemented here first under EGL since the infrastructure is already in place for this due to the Android code requiring some bits. The rest of the interfaces will come in a little bit. This will be required for threaded shader compiling in the near future.
47 lines
1.3 KiB
C++
47 lines
1.3 KiB
C++
// Copyright 2008 Dolphin Emulator Project
|
|
// Licensed under GPLv2+
|
|
// Refer to the license.txt file included.
|
|
|
|
#pragma once
|
|
|
|
#include <string>
|
|
#include <EGL/egl.h>
|
|
|
|
#include "Common/GL/GLInterfaceBase.h"
|
|
|
|
class cInterfaceEGL : public cInterfaceBase
|
|
{
|
|
private:
|
|
EGLConfig m_config;
|
|
bool m_has_handle;
|
|
EGLNativeWindowType m_host_window;
|
|
bool m_supports_surfaceless = false;
|
|
|
|
bool CreateWindowSurface();
|
|
void DestroyWindowSurface();
|
|
|
|
protected:
|
|
void DetectMode();
|
|
EGLSurface egl_surf;
|
|
EGLContext egl_ctx;
|
|
EGLDisplay egl_dpy;
|
|
|
|
virtual EGLDisplay OpenDisplay() { return EGL_NO_DISPLAY; }
|
|
virtual EGLNativeWindowType InitializePlatform(EGLNativeWindowType host_window, EGLConfig config) { return (EGLNativeWindowType)EGL_DEFAULT_DISPLAY; }
|
|
virtual void ShutdownPlatform() {}
|
|
|
|
public:
|
|
void Swap() override;
|
|
void SwapInterval(int interval) override;
|
|
void SetMode(GLInterfaceMode mode) override { s_opengl_mode = mode; }
|
|
void* GetFuncAddress(const std::string& name) override;
|
|
bool Create(void* window_handle, bool core) override;
|
|
bool Create(cInterfaceBase* main_context) override;
|
|
bool MakeCurrent() override;
|
|
bool ClearCurrent() override;
|
|
void Shutdown() override;
|
|
void UpdateHandle(void* window_handle) override;
|
|
void UpdateSurface() override;
|
|
std::unique_ptr<cInterfaceBase> CreateSharedContext() override;
|
|
};
|