#include "glxclient.h"
#include <stdio.h>
-#include <Xext.h>
-#include <extutil.h>
+#include <X11/extensions/Xext.h>
+#include <X11/extensions/extutil.h>
#include <assert.h>
#include "indirect_init.h"
#include "glapi.h"
-#ifdef XTHREADS
-# include "Xthreads.h"
-#elif defined(PTHREADS)
-# include <pthread.h>
-#endif
#include "glxextensions.h"
#include "glcontextmodes.h"
#include "glheader.h"
#define INIT_MESA_SPARC
#endif
+#ifdef GLX_DIRECT_RENDERING
+static __DRIscreen *__glXFindDRIScreen(__DRInativeDisplay *dpy, int scrn);
+#endif /* GLX_DIRECT_RENDERING */
+
static Bool MakeContextCurrent(Display *dpy, GLXDrawable draw,
GLXDrawable read, GLXContext gc);
* Current context management and locking
*/
-#if defined( XTHREADS )
+#if defined( USE_XTHREADS )
/* thread safe */
static GLboolean TSDinitialized = GL_FALSE;
}
+/**
+ * Implement \c __DRIinterfaceMethods::getProcAddress.
+ */
+static __DRIfuncPtr get_proc_address( const char * proc_name )
+{
+ if (strcmp( proc_name, "glxEnableExtension" ) == 0) {
+ return (__DRIfuncPtr) __glXScrEnableExtension;
+ }
+
+ return NULL;
+}
+
+
+/**
+ * Table of functions exported by the loader to the driver.
+ */
+static const __DRIinterfaceMethods interface_methods = {
+ get_proc_address,
+
+ _gl_context_modes_create,
+ _gl_context_modes_destroy,
+
+ __glXFindDRIScreen,
+ __glXWindowExists,
+
+ XF86DRICreateContextWithConfig,
+ XF86DRIDestroyContext,
+
+ XF86DRICreateDrawable,
+ XF86DRIDestroyDrawable,
+ XF86DRIGetDrawableInfo,
+
+ __glXGetUST,
+ glXGetMscRateOML,
+};
+
/**
* Perform the required libGL-side initialization and call the client-side
static void *
CallCreateNewScreen(Display *dpy, int scrn, __DRIscreen *psc,
__DRIdisplay * driDpy,
- CreateNewScreenFunc createNewScreen)
+ PFNCREATENEWSCREENFUNC createNewScreen)
{
__DRIscreenPrivate *psp = NULL;
#ifndef GLX_USE_APPLEGL
drm_handle_t hSAREA;
- drmAddress pSAREA;
+ drmAddress pSAREA = MAP_FAILED;
char *BusID;
__DRIversion ddx_version;
__DRIversion dri_version;
err_msg = "XF86DRIOpenConnection";
err_extra = NULL;
+ framebuffer.base = MAP_FAILED;
framebuffer.dev_priv = NULL;
if (XF86DRIOpenConnection(dpy, scrn, &hSAREA, &BusID)) {
pSAREA,
fd,
api_ver,
+ & interface_methods,
& driver_modes );
filter_modes( & configs->configs,
XEDataObject dataObj;
int major, minor;
-#if defined(XTHREADS)
+#if defined(USE_XTHREADS)
{
static int firstCall = 1;
if (firstCall) {
oldGC->currentContextTag = 0;
}
-
+
+ _glapi_check_multithread();
+
#ifdef GLX_DIRECT_RENDERING
/* Unbind the old direct rendering context */
if (oldGC->isDirect) {
}
} else {
#endif
- _glapi_check_multithread();
/* Send a glXMakeCurrent request to bind the new context. */
LockDisplay(dpy);
}
-PUBLIC Bool GLX_PREFIX(glXMakeCurrent)(Display *dpy, GLXDrawable draw,
- GLXContext gc)
+PUBLIC Bool glXMakeCurrent(Display *dpy, GLXDrawable draw, GLXContext gc)
{
return MakeContextCurrent( dpy, draw, draw, gc );
}