2014-08-09 14:31:27 +00:00
|
|
|
// Copyright 2014 Dolphin Emulator Project
|
2021-07-05 01:22:19 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2014-08-09 14:31:27 +00:00
|
|
|
|
2015-09-18 16:40:00 +00:00
|
|
|
#include "Common/GL/GLInterface/EGLAndroid.h"
|
2021-12-10 02:22:16 +00:00
|
|
|
|
2018-10-03 13:02:45 +00:00
|
|
|
#include <android/native_window.h>
|
2014-08-09 14:31:27 +00:00
|
|
|
|
2018-10-03 13:02:45 +00:00
|
|
|
EGLDisplay GLContextEGLAndroid::OpenEGLDisplay()
|
2014-08-09 14:31:27 +00:00
|
|
|
{
|
|
|
|
return eglGetDisplay(EGL_DEFAULT_DISPLAY);
|
|
|
|
}
|
|
|
|
|
2018-10-03 13:02:45 +00:00
|
|
|
EGLNativeWindowType GLContextEGLAndroid::GetEGLNativeWindow(EGLConfig config)
|
2014-08-09 14:31:27 +00:00
|
|
|
{
|
|
|
|
EGLint format;
|
2018-10-03 13:02:45 +00:00
|
|
|
eglGetConfigAttrib(m_egl_display, config, EGL_NATIVE_VISUAL_ID, &format);
|
2019-04-10 14:40:19 +00:00
|
|
|
ANativeWindow_setBuffersGeometry(static_cast<ANativeWindow*>(m_wsi.render_surface), 0, 0, format);
|
|
|
|
m_backbuffer_width = ANativeWindow_getWidth(static_cast<ANativeWindow*>(m_wsi.render_surface));
|
|
|
|
m_backbuffer_height = ANativeWindow_getHeight(static_cast<ANativeWindow*>(m_wsi.render_surface));
|
|
|
|
return static_cast<EGLNativeWindowType>(m_wsi.render_surface);
|
2014-08-09 14:31:27 +00:00
|
|
|
}
|