EGLint LastError;
_EGLContext *CurrentContext;
EGLenum CurrentAPI;
+ EGLLabelKHR Label;
+
+ /**
+ * The name of the EGL function that's being called at the moment. This is
+ * used to report the function name to the EGL_KHR_debug callback.
+ */
+ const char *CurrentFuncName;
+ EGLLabelKHR CurrentObjectLabel;
};
extern EGLBoolean
_eglError(EGLint errCode, const char *msg);
+extern void
+_eglDebugReport(EGLenum error, const char *funcName,
+ EGLint type, const char *message, ...);
+
+#define _eglReportCritical(error, funcName, ...) \
+ _eglDebugReport(error, funcName, EGL_DEBUG_MSG_CRITICAL_KHR, __VA_ARGS__)
+
+#define _eglReportError(error, funcName, ...) \
+ _eglDebugReport(error, funcName, EGL_DEBUG_MSG_ERROR_KHR, __VA_ARGS__)
+
+#define _eglReportWarn(funcName, ...) \
+ _eglDebugReport(EGL_SUCCESS, funcName, EGL_DEBUG_MSG_WARN_KHR, __VA_ARGS__)
+
+#define _eglReportInfo(funcName, ...) \
+ _eglDebugReport(EGL_SUCCESS, funcName, EGL_DEBUG_MSG_INFO_KHR, __VA_ARGS__)
#ifdef __cplusplus
}