Convert printf_* in opengl.h

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2018-12-20 17:24:03 +00:00
parent 24dd8ee120
commit d8198926dc
No known key found for this signature in database
GPG Key ID: 37C999F617EA1A47
1 changed files with 6 additions and 6 deletions

View File

@ -50,14 +50,14 @@ glx_check_err_(session_t *ps, const char *func, int line) {
GLenum err = GL_NO_ERROR;
while (GL_NO_ERROR != (err = glGetError())) {
print_timestamp(ps);
printf("%s():%d: GLX error ", func, line);
const char *errtext = glx_dump_err_str(err);
if (errtext) {
printf_dbg("%s\n", errtext);
log_printf(tls_logger, LOG_LEVEL_ERROR, func, "GLX error at line %d: %s", line,
errtext);
}
else {
printf_dbg("%d\n", err);
log_printf(tls_logger, LOG_LEVEL_ERROR, func, "GLX error at line %d: %d", line,
err);
}
}
}
@ -114,13 +114,13 @@ static inline bool
glx_hasglext(session_t *ps, const char *ext) {
const char *gl_exts = (const char *) glGetString(GL_EXTENSIONS);
if (!gl_exts) {
printf_errf("(): Failed get GL extension list.");
log_error("Failed get GL extension list.");
return false;
}
bool found = wd_is_in_str(gl_exts, ext);
if (!found)
printf_errf("(): Missing GL extension %s.", ext);
log_info("Missing GL extension %s.", ext);
return found;
}