darwin: Write errors in choosing the pixel format to the crash log
[mesa.git] / src / glx / apple / apple_glx.c
index d94c1e0fb16c0ed6b1a766cce971fb90bd86397c..3b570882572f198f0df8ef2855eed236c497f23e 100644 (file)
@@ -33,6 +33,8 @@
 #include <assert.h>
 #include <stdarg.h>
 #include <dlfcn.h>
+#include <pthread.h>
+#include <inttypes.h>
 #include "appledri.h"
 #include "apple_glx.h"
 #include "apple_glx_context.h"
 static bool initialized = false;
 static int dri_event_base = 0;
 
-const GLuint __glXDefaultPixelStore[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 1 };
-
-static bool diagnostic = false;
-
-void
-apple_glx_diagnostic(const char *fmt, ...)
-{
-   va_list vl;
-
-   if (diagnostic) {
-      fprintf(stderr, "DIAG: ");
-
-      va_start(vl, fmt);
-      vfprintf(stderr, fmt, vl);
-      va_end(vl);
-   }
-}
-
 int
 apple_get_dri_event_base(void)
 {
@@ -125,10 +109,9 @@ apple_init_glx(Display * dpy)
    if (initialized)
       return false;
 
-   if (getenv("LIBGL_DIAGNOSTIC")) {
-      printf("initializing libGL in %s\n", __func__);
-      diagnostic = true;
-   }
+   apple_glx_log_init();
+
+   apple_glx_log(ASL_LEVEL_INFO, "Initializing libGL.");
 
    apple_cgl_init();
    (void) apple_glx_get_client_id();
@@ -147,8 +130,6 @@ apple_glx_swap_buffers(void *ptr)
 {
    struct apple_glx_context *ac = ptr;
 
-   /* This may not be needed with CGLFlushDrawable: */
-   glFlush();
    apple_cgl.flush_drawable(ac->context_obj);
 }