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
|
|
|
{
|
2016-06-24 08:43:46 +00:00
|
|
|
return eglGetDisplay(EGL_DEFAULT_DISPLAY);
|
2014-08-09 14:31:27 +00:00
|
|
|
}
|
|
|
|
|
2018-10-03 13:02:45 +00:00
|
|
|
EGLNativeWindowType GLContextEGLAndroid::GetEGLNativeWindow(EGLConfig config)
|
2014-08-09 14:31:27 +00:00
|
|
|
{
|
2016-06-24 08:43:46 +00:00
|
|
|
EGLint format;
|
2018-10-03 13:02:45 +00:00
|
|
|
eglGetConfigAttrib(m_egl_display, config, EGL_NATIVE_VISUAL_ID, &format);
|
|
|
|
ANativeWindow_setBuffersGeometry(static_cast<ANativeWindow*>(m_host_window), 0, 0, format);
|
|
|
|
m_backbuffer_width = ANativeWindow_getWidth(static_cast<ANativeWindow*>(m_host_window));
|
|
|
|
m_backbuffer_height = ANativeWindow_getHeight(static_cast<ANativeWindow*>(m_host_window));
|
|
|
|
return static_cast<EGLNativeWindowType>(m_host_window);
|
2014-08-09 14:31:27 +00:00
|
|
|
}
|