blob: 95ffadb8dedb78cdf6f1413b4ee9e418084d4aa0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
#ifndef GLES_MACROS_H
#define GLES_MACROS_H
#define GET_CTX() \
if(!s_eglIface) return; \
GLEScontext *ctx = s_eglIface->getGLESContext(); \
#define GET_CTX_CM() \
if(!s_eglIface) return; \
GLEScmContext *ctx = static_cast<GLEScmContext *>(s_eglIface->getGLESContext()); \
if(!ctx) return;
#define GET_CTX_V2() \
if(!s_eglIface) return; \
GLESv2Context *ctx = static_cast<GLESv2Context *>(s_eglIface->getGLESContext()); \
if(!ctx) return;
#define GET_CTX_RET(failure_ret) \
if(!s_eglIface) return failure_ret; \
GLEScontext *ctx = s_eglIface->getGLESContext(); \
if(!ctx) return failure_ret;
#define GET_CTX_CM_RET(failure_ret) \
if(!s_eglIface) return failure_ret; \
GLEScmContext *ctx = static_cast<GLEScmContext *>(s_eglIface->getGLESContext()); \
if(!ctx) return failure_ret;
#define GET_CTX_V2_RET(failure_ret) \
if(!s_eglIface) return failure_ret; \
GLESv2Context *ctx = static_cast<GLESv2Context *>(s_eglIface->getGLESContext()); \
if(!ctx) return failure_ret;
#define SET_ERROR_IF(condition,err) if((condition)) { \
fprintf(stderr, "%s:%s:%d error 0x%x\n", __FILE__, __FUNCTION__, __LINE__, err); \
ctx->setGLerror(err); \
return; \
}
#define RET_AND_SET_ERROR_IF(condition,err,ret) if((condition)) { \
fprintf(stderr, "%s:%s:%d error 0x%x\n", __FILE__, __FUNCTION__, __LINE__, err); \
ctx->setGLerror(err); \
return ret; \
}
#endif
|