vdr-plugin-softhddevice-drm-gles 1.4.0
glhelpers.h
Go to the documentation of this file.
1
20#ifndef __GLHELPERS_H
21#define __GLHELPERS_H
22
23#include <stdio.h>
24#include <stdlib.h>
25
26#include <EGL/egl.h>
27/* Hack:
28 * xlib.h via eglplatform.h: #define Status int
29 * X.h via eglplatform.h: #define CurrentTime 0L
30 *
31 * revert it, because it conflicts with vdr variables.
32 */
33#undef Status
34#undef CurrentTime
35
36#include <GLES2/gl2.h>
37
38#include "logger.h"
39
40/****************************************************************************************
41 * Helpers
42 ***************************************************************************************/
43static inline void glCheckError(const char *stmt, const char *fname, int line) {
44 GLint err = glGetError();
45 if (err != GL_NO_ERROR)
46 LOGERROR("GL Error (0x%08x): %s failed at %s:%i", err, stmt, fname, line);
47}
48
49static inline void eglCheckError(const char *stmt, const char *fname, int line) {
50 EGLint err = eglGetError();
51 if (err != EGL_SUCCESS)
52 LOGERROR("EGL ERROR (0x%08x): %s failed at %s:%i", err, stmt, fname, line);
53}
54
55#define GL_CHECK(stmt) do { \
56 stmt; \
57 glCheckError(#stmt, __FILE__, __LINE__); \
58 } while (0)
59
60#define EGL_CHECK(stmt) do { \
61 stmt; \
62 eglCheckError(#stmt, __FILE__, __LINE__); \
63 } while (0)
64
65#endif
static void glCheckError(const char *stmt, const char *fname, int line)
Definition: glhelpers.h:43
static void eglCheckError(const char *stmt, const char *fname, int line)
Definition: glhelpers.h:49
Logger class header file.
#define LOGERROR
Definition: logger.h:46