X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fglx%2Fapple%2Fapple_glx.c;h=3b570882572f198f0df8ef2855eed236c497f23e;hb=cb53aacaa1555b98fa77146492e96a7e3d7631ba;hp=e8f94407ea4469e164dabe0c7ea1241b4a0534b4;hpb=7d215e7c4d0ca8a18d91d4f30f79b97835a6d6c4;p=mesa.git diff --git a/src/glx/apple/apple_glx.c b/src/glx/apple/apple_glx.c index e8f94407ea4..3b570882572 100644 --- a/src/glx/apple/apple_glx.c +++ b/src/glx/apple/apple_glx.c @@ -33,6 +33,8 @@ #include #include #include +#include +#include #include "appledri.h" #include "apple_glx.h" #include "apple_glx_context.h" @@ -41,30 +43,6 @@ static bool initialized = false; static int dri_event_base = 0; -const GLuint __glXDefaultPixelStore[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 1 }; - -#ifndef OPENGL_LIB_PATH -#define OPENGL_LIB_PATH "/System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib" -#endif - -static void *libgl_handle = NULL; - -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) { @@ -131,14 +109,11 @@ 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(); - apple_xgl_init_direct(); - libgl_handle = dlopen(OPENGL_LIB_PATH, RTLD_LAZY); (void) apple_glx_get_client_id(); XAppleDRISetSurfaceNotifyHandler(surface_notify_handler); @@ -155,51 +130,9 @@ 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); } -void * -apple_glx_get_proc_address(const GLubyte * procname) -{ - size_t len; - void *h, *s; - char *pname = (char *) procname; - - assert(NULL != procname); - len = strlen(pname); - - if (len < 3) { - return NULL; - } - - if ((pname != strstr(pname, "glX")) && (pname != strstr(pname, "gl"))) { - fprintf(stderr, - "warning: get proc address request is not for a gl or glX function"); - return NULL; - } - - /* Search using the default symbols first. */ - (void) dlerror(); /*drain dlerror */ - h = dlopen(NULL, RTLD_NOW); - if (NULL == h) { - fprintf(stderr, "warning: get proc address: %s\n", dlerror()); - return NULL; - } - - s = dlsym(h, pname); - - if (NULL == s) { - /* Try the libGL.dylib from the OpenGL.framework. */ - s = dlsym(libgl_handle, pname); - } - - dlclose(h); - - return s; -} - void apple_glx_waitx(Display * dpy, void *ptr) {