*x11errorptr = false;
}
- if (env_var_as_boolean("LIBGL_DIAGNOSTIC", false))
- fprintf(stderr, "error: %s\n", apple_cgl.error_string(error));
+ DebugMessageF("error: %s\n", apple_cgl.error_string(error));
return true;
}
#include "apple_glx_log.h"
#include "util/debug.h"
-static bool diagnostic = false;
static aslclient aslc;
void apple_glx_log_init(void) {
- if (env_var_as_boolean("LIBGL_DIAGNOSTIC", false)) {
- diagnostic = true;
- }
-
aslc = asl_open(NULL, NULL, 0);
}
#endif
}
- if (diagnostic) {
- va_list args2;
- va_copy(args2, args);
-
- fprintf(stderr, "%-9s %24s:%-4d %s(%"PRIu64"): ",
- _asl_level_string(level), file, line, function, thread);
- vfprintf(stderr, fmt, args2);
- va_end(args2);
- }
+ DebugMessageF("%-9s %24s:%-4d %s(%"PRIu64"): ",
+ _asl_level_string(level), file, line, function, thread);
msg = asl_new(ASL_TYPE_MSG);
if (msg) {
err = apple_cgl.choose_pixel_format(attr, &pfobj, &vsref);
if (kCGLNoError != err) {
- if (env_var_as_boolean("LIBGL_DIAGNOSTIC", false)) {
- printf("choose_pixel_format error in %s: %s\n", __func__,
- apple_cgl.error_string(err));
- }
+ DebugMessageF("choose_pixel_format error in %s: %s\n", __func__,
+ apple_cgl.error_string(err));
return true;
}
err = apple_cgl.create_context(pfobj, NULL, &newcontext);
if (kCGLNoError != err) {
- if (env_var_as_boolean("LIBGL_DIAGNOSTIC", false)) {
- printf("create_context error in %s: %s\n", __func__,
- apple_cgl.error_string(err));
- }
+ DebugMessageF("create_context error in %s: %s\n", __func__,
+ apple_cgl.error_string(err));
apple_cgl.destroy_pixel_format(pfobj);
err = apple_cgl.set_current_context(newcontext);
if (kCGLNoError != err) {
- printf("set_current_context error in %s: %s\n", __func__,
- apple_cgl.error_string(err));
+ DebugMessageF("set_current_context error in %s: %s\n", __func__,
+ apple_cgl.error_string(err));
return true;
}
case None:
i = count;
break;
- default:
- if(env_var_as_boolean("LIBGL_DIAGNOSTIC", false)) {
- long int tagvalue = *bp++;
- fprintf(stderr, "WARNING: unknown GLX tag from server: "
- "tag 0x%lx value 0x%lx\n", tag, tagvalue);
- } else {
- /* Ignore the unrecognized tag's value */
- bp++;
+ default: {
+ long int tagvalue = *bp++;
+ DebugMessageF("WARNING: unknown GLX tag from server: "
+ "tag 0x%lx value 0x%lx\n", tag, tagvalue);
+ break;
}
- break;
}
}