#include "GL/glxproto.h"
#include "GL/internal/glcore.h"
#include "glapitable.h"
-#include "glxextensions.h"
#include "glxhash.h"
#if defined( USE_XTHREADS )
# include <X11/Xthreads.h>
# include <pthread.h>
#endif
+#include "glxextensions.h"
+
#define GLX_MAJOR_VERSION 1 /* current version numbers */
#define GLX_MINOR_VERSION 4
* Display dependent methods. This structure is initialized during the
* \c driCreateDisplay call.
*/
-struct __DRIdisplayRec {
+typedef struct __GLXDRIdisplayRec __GLXDRIdisplay;
+typedef struct __GLXDRIscreenRec __GLXDRIscreen;
+typedef struct __GLXDRIdrawableRec __GLXDRIdrawable;
+typedef struct __GLXDRIcontextRec __GLXDRIcontext;
+
+#include "glxextensions.h"
+
+struct __GLXDRIdisplayRec {
/**
* Method to destroy the private DRI display data.
*/
- void (*destroyDisplay)(Display *dpy, void *displayPrivate);
+ void (*destroyDisplay)(__GLXDRIdisplay *display);
- /**
- * Opaque pointer to private per display direct rendering data.
- * \c NULL if direct rendering is not supported on this display.
- */
- struct __DRIdisplayPrivateRec *private;
+ __GLXDRIscreen *(*createScreen)(__GLXscreenConfigs *psc, int screen,
+ __GLXdisplayPrivate *priv);
+};
- /**
- * Array of pointers to methods to create and initialize the private DRI
- * screen data.
- */
- PFNCREATENEWSCREENFUNC * createNewScreen;
+struct __GLXDRIscreenRec {
+
+ void (*destroyScreen)(__GLXscreenConfigs *psc);
+
+ __GLXDRIcontext *(*createContext)(__GLXscreenConfigs *psc,
+ const __GLcontextModes *mode,
+ GLXContext gc,
+ GLXContext shareList, int renderType);
+
+ __GLXDRIdrawable *(*createDrawable)(__GLXscreenConfigs *psc,
+ XID drawable,
+ GLXDrawable glxDrawable,
+ const __GLcontextModes *modes);
+
+ void (*swapBuffers)(__GLXDRIdrawable *pdraw);
};
+struct __GLXDRIcontextRec {
+ void (*destroyContext)(__GLXDRIcontext *context, __GLXscreenConfigs *psc,
+ Display *dpy);
+ Bool (*bindContext)(__GLXDRIcontext *context,
+ __GLXDRIdrawable *pdraw,
+ __GLXDRIdrawable *pread);
+
+ void (*unbindContext)(__GLXDRIcontext *context);
+};
-/*
-** We keep a linked list of these structures, one per DRI device driver.
-*/
-struct __DRIdriverRec {
- const char *name;
- const char *libpath;
- void *handle;
- PFNCREATENEWSCREENFUNC createNewScreenFunc;
- struct __DRIdriverRec *next;
+struct __GLXDRIdrawableRec {
+ void (*destroyDrawable)(__GLXDRIdrawable *drawable);
+
+ XID xDrawable;
+ XID drawable;
+ __GLXscreenConfigs *psc;
+ GLenum textureTarget;
+ __DRIdrawable *driDrawable;
};
/*
** Function to create and DRI display data and initialize the display
** dependent methods.
*/
-extern void *driCreateDisplay(Display *dpy, __DRIdisplay *pdisp);
-
-extern __DRIdriver *driGetDriver(Display *dpy, int scrNum);
+extern __GLXDRIdisplay *driswCreateDisplay(Display *dpy);
+extern __GLXDRIdisplay *driCreateDisplay(Display *dpy);
+extern __GLXDRIdisplay *dri2CreateDisplay(Display *dpy);
extern void DRI_glXUseXFont( Font font, int first, int count, int listbase );
extern const char *glXGetDriverConfig (const char *driverName);
-extern Bool __glXWindowExists(Display *dpy, GLXDrawable draw);
-
#endif
/************************************************************************/
const __GLcontextModes * mode;
#ifdef GLX_DIRECT_RENDERING
- /**
- * Per context direct rendering interface functions and data.
- */
- __DRIcontext driContext;
-
- /**
- * XID for the server side drm_context_t
- */
- XID hwContextID;
+ __GLXDRIcontext *driContext;
+ __DRIcontext *__driContext;
#endif
/**
/**
* Per screen direct rendering interface functions and data.
*/
- __DRIscreen driScreen;
+ __DRIscreen *__driScreen;
+ const __DRIcoreExtension *core;
+ const __DRIlegacyExtension *legacy;
+ const __DRIswrastExtension *swrast;
+ const __DRIdri2Extension *dri2;
__glxHashTable *drawHash;
Display *dpy;
- int scr;
+ int scr, fd;
+ void *driver;
+
+ __GLXDRIscreen *driScreen;
#ifdef __DRI_COPY_SUB_BUFFER
- __DRIcopySubBufferExtension *copySubBuffer;
+ const __DRIcopySubBufferExtension *copySubBuffer;
#endif
#ifdef __DRI_SWAP_CONTROL
- __DRIswapControlExtension *swapControl;
+ const __DRIswapControlExtension *swapControl;
#endif
#ifdef __DRI_ALLOCATE
- __DRIallocateExtension *allocate;
+ const __DRIallocateExtension *allocate;
#endif
#ifdef __DRI_FRAME_TRACKING
- __DRIframeTrackingExtension *frameTracking;
+ const __DRIframeTrackingExtension *frameTracking;
#endif
#ifdef __DRI_MEDIA_STREAM_COUNTER
- __DRImediaStreamCounterExtension *msc;
+ const __DRImediaStreamCounterExtension *msc;
+#endif
+
+#ifdef __DRI_TEX_BUFFER
+ const __DRItexBufferExtension *texBuffer;
#endif
#endif
/**
* Per display direct rendering interface functions and data.
*/
- __DRIdisplay driDisplay;
+ __GLXDRIdisplay *driswDisplay;
+ __GLXDRIdisplay *driDisplay;
+ __GLXDRIdisplay *dri2Display;
#endif
};
-#ifdef GLX_DIRECT_RENDERING
-
-struct __GLXdrawableRec {
- XID drawable;
- __GLXscreenConfigs *psc;
- __DRIdrawable driDrawable;
-};
-
-#endif
-
-
-
-void __glXFreeContext(__GLXcontext*);
extern GLubyte *__glXFlushRenderBuffer(__GLXcontext*, GLubyte*);
#endif /* defined( USE_XTHREADS ) || defined( PTHREADS ) */
+extern void __glXSetCurrentContextNull(void);
+
+extern void __glXFreeContext(__GLXcontext*);
+
/*
** Global lock for all threads in this address space using the GLX
/*
-** Allocate and Initialize Vertex Array client state
+** Allocate and Initialize Vertex Array client state, and free.
*/
-extern void __glXInitVertexArrayState(__GLXcontext*);
+extern void __glXInitVertexArrayState(__GLXcontext *);
+extern void __glXFreeVertexArrayState(__GLXcontext *);
/*
** Inform the Server of the major and minor numbers and of the client
#ifdef GLX_DIRECT_RENDERING
GLboolean
-__driGetMscRateOML(__DRIdrawable *draw, int32_t *numerator, int32_t *denominator);
+__driGetMscRateOML(__DRIdrawable *draw,
+ int32_t *numerator, int32_t *denominator, void *private);
#endif
#endif /* !__GLX_client_h__ */