-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrors.h
More file actions
30 lines (20 loc) · 1.35 KB
/
errors.h
File metadata and controls
30 lines (20 loc) · 1.35 KB
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
#ifndef ERRORS_H
#define ERRORS_H
#include <CoreFoundation/CoreFoundation.h>
#include <OpenGL/OpenGL.h>
void reportGenericError(char* file, const char* func, unsigned long line, char* msg, char* detail);
#define ERR(msg, detail) reportGenericError(__FILE__, __func__, __LINE__, (msg), (detail))
#define CHK_SYSCALL(fn, msg, detail) if ((fn) == -1) ERR(msg, detail)
#define CHK_NULL(ptr, msg, detail) if ((ptr) == NULL) ERR(msg, detail)
void checkCGLError(CGLContextObj cgl_ctx, char* file, const char* func, unsigned long line, CGLError error);
#define CHK_CGL(fn) (checkCGLError(cgl_ctx, __FILE__, __func__, __LINE__, (fn)))
void checkOGLError(CGLContextObj cgl_ctx, char* file, const char* func, unsigned long line);
#define CHK_OGL (checkOGLError(cgl_ctx, __FILE__, __func__, __LINE__))
void checkFramebufferError(CGLContextObj cgl_ctx, char* file, const char* func, unsigned long line);
#define CHK_FBO (checkFramebufferError(cgl_ctx, __FILE__, __func__, __LINE__))
void dumpPixFmt(CGLContextObj cgl_ctx, CGLPixelFormatObj pix);
void printProgramInfoLog(CGLContextObj cgl_ctx, GLuint obj);
void printShaderInfoLog(CGLContextObj cgl_ctx, GLuint obj);
void checkCFURLError(char* file, const char* func, unsigned long line, Boolean success, SInt32 errorCode);
#define CHK_CFURL(success, errorCode) (checkCFURLError(__FILE__, __func__, __LINE__, (success), (errorCode)))
#endif