2014-08-09 14:31:27 +00:00
|
|
|
// Copyright 2014 Dolphin Emulator Project
|
2015-05-17 23:08:10 +00:00
|
|
|
// Licensed under GPLv2+
|
2014-08-09 14:31:27 +00:00
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
2015-09-18 16:40:00 +00:00
|
|
|
#include "Common/GL/GLInterface/EGLAndroid.h"
|
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
|
|
|
}
|