Even more EGL logging

This commit is contained in:
Henrik Rydgard 2016-01-23 18:41:29 +01:00
parent 7aebff0efb
commit 1d6e48b817
3 changed files with 21 additions and 19 deletions

View file

@ -7,20 +7,6 @@
#include "Common/GL/GLInterface/EGL.h"
#ifdef ANDROID
// On Android, EGL creation is so early that our regular logging system is not
// up and running yet. Use Android logging.
#include "base/logging.h"
#define EGL_ILOG(...) ILOG(__VA_ARGS__)
#define EGL_ELOG(...) ELOG(__VA_ARGS__)
#else
#define EGL_ILOG(...) EGL_ILOG(__VA_ARGS__)
#define EGL_ELOG(...) EGL_ELOG(__VA_ARGS__)
#endif
#include "Common/Log.h"
// Show the current FPS
@ -234,17 +220,17 @@ bool cInterfaceEGL::Create(void *window_handle, bool core, bool use565) {
switch (s_opengl_mode) {
case MODE_OPENGL:
EGL_ELOG("Setting RENDERABLE_TYPE to EGL_OPENGL_BIT");
EGL_ILOG("Setting RENDERABLE_TYPE to EGL_OPENGL_BIT");
attribs[1] = EGL_OPENGL_BIT;
ctx_attribs[0] = EGL_NONE;
break;
case MODE_OPENGLES2:
EGL_ELOG("Setting RENDERABLE_TYPE to EGL_OPENGL_ES2_BIT");
EGL_ILOG("Setting RENDERABLE_TYPE to EGL_OPENGL_ES2_BIT");
attribs[1] = EGL_OPENGL_ES2_BIT;
ctx_attribs[1] = 2;
break;
case MODE_OPENGLES3:
EGL_ELOG("Setting RENDERABLE_TYPE to EGL_OPENGL_ES3_BIT_KHR");
EGL_ILOG("Setting RENDERABLE_TYPE to EGL_OPENGL_ES3_BIT_KHR");
attribs[1] = (1 << 6); /* EGL_OPENGL_ES3_BIT_KHR */
ctx_attribs[1] = 3;
break;

View file

@ -9,6 +9,21 @@
#include "Common/GL/GLInterfaceBase.h"
#ifdef ANDROID
// On Android, EGL creation is so early that our regular logging system is not
// up and running yet. Use Android logging.
#include "base/logging.h"
#define EGL_ILOG(...) ILOG(__VA_ARGS__)
#define EGL_ELOG(...) ELOG(__VA_ARGS__)
#else
#define EGL_ILOG(...) INFO_LOG(G3D, __VA_ARGS__)
#define EGL_ELOG(...) INFO_LOG(G3D, __VA_ARGS__)
#endif
class cInterfaceEGL : public cInterfaceBase
{
protected:

View file

@ -12,11 +12,12 @@ EGLDisplay cInterfaceEGLAndroid::OpenDisplay() {
EGLNativeWindowType cInterfaceEGLAndroid::InitializePlatform(EGLNativeWindowType host_window, EGLConfig config) {
EGLint format;
if (EGL_FALSE == eglGetConfigAttrib(egl_dpy, config, EGL_NATIVE_VISUAL_ID, &format)) {
ERROR_LOG(G3D, "Failed getting EGL_NATIVE_VISUAL_ID: error %s", EGLGetErrorString(eglGetError()));
EGL_ELOG("Failed getting EGL_NATIVE_VISUAL_ID: error %s", EGLGetErrorString(eglGetError()));
return NULL;
}
ANativeWindow_setBuffersGeometry(host_window, internalWidth_, internalHeight_, format);
int32_t result = ANativeWindow_setBuffersGeometry(host_window, internalWidth_, internalHeight_, format);
EGL_ILOG("ANativeWindow_setBuffersGeometry returned %d", result);
const int width = ANativeWindow_getWidth(host_window);
const int height = ANativeWindow_getHeight(host_window);