small3dlib uint/magnolia / include / util.h
 1#ifndef UTIL_H
 2#define UTIL_H
 3
 4typedef enum { /* TODO: rename to MG_EC_... */
 5	MG_ERR_EXIT_SUCCESS,
 6	MG_ERR_EXIT_FAILURE,
 7
 8	MG_ERR_SDL_INIT,
 9	MG_ERR_SDL_CREATE_WIN,
10
11	MG_ERR_GL_CTX_CREATE,
12	MG_ERR_GL_CTX_ACTIVATE,
13
14	MG_ERR_SHADER_CREATE,
15
16	MG_ERR_PIPELINE_CREATE,
17
18	MG_ERR_MESH_CREATE,
19
20	MG_ERR_TEXTURE_LOAD,
21	MG_ERR_TEXTURE_CREATE,
22	MG_ERR_SAMPLER_CREATE,
23	MG_ERR_VIEW_CREATE,
24
25	MG_ERR_REN_CREATE,
26
27	MG_ERR_LAST
28} MGErrorCodes;
29
30typedef enum {
31	LOG_INF, /* info */
32	LOG_ERR, /* error */
33	LOG_DBG  /* debug */
34} LogType;
35
36void mg_die(MGErrorCodes ec, const char* fmt, ...);
37void mg_log(LogType lt, const char* fmt, ...);
38
39#endif /* UTIL_H */
40