#ifndef _GLX_client_h_
#define _GLX_client_h_
-#define NEED_REPLIES
-#define NEED_EVENTS
#include <X11/Xproto.h>
#include <X11/Xlibint.h>
#include <X11/extensions/extutil.h>
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
-#include <GL/internal/dri_interface.h>
-
/**
* Display dependent methods. This structure is initialized during the
* \c driCreateDisplay call.
*/
void (*destroyDisplay) (__GLXDRIdisplay * display);
- __GLXDRIscreen *(*createScreen) (__GLXscreenConfigs * psc, int screen,
- __GLXdisplayPrivate * priv);
+ __GLXscreenConfigs *(*createScreen)(int screen, __GLXdisplayPrivate * priv);
};
struct __GLXDRIscreenRec {
int64_t *msc, int64_t *sbc);
int (*waitForSBC)(__GLXDRIdrawable *pdraw, int64_t target_sbc, int64_t *ust,
int64_t *msc, int64_t *sbc);
- void (*setSwapInterval)(__GLXDRIdrawable *pdraw, int interval);
+ int (*setSwapInterval)(__GLXDRIdrawable *pdraw, int interval);
int (*getSwapInterval)(__GLXDRIdrawable *pdraw);
};
XID drawable;
__GLXscreenConfigs *psc;
GLenum textureTarget;
- __DRIdrawable *driDrawable;
GLenum textureFormat; /* EXT_texture_from_pixmap support */
+ unsigned long eventMask;
};
/*
__GLXattribute **stackPointer;
} __GLXattributeMachine;
+struct glx_context_vtable {
+ void (*bind_tex_image)(Display * dpy,
+ GLXDrawable drawable,
+ int buffer, const int *attrib_list);
+ void (*release_tex_image)(Display * dpy, GLXDrawable drawable, int buffer);
+
+};
+
/**
* GLX state that needs to be kept on the client. One of these records
* exist for each context that has been made current by this client.
Bool do_destroy;
#else
__GLXDRIcontext *driContext;
- __DRIcontext *__driContext;
#endif
#endif
unsigned long thread_id;
char gl_extension_bits[__GL_EXT_BYTES];
+
+ const struct glx_context_vtable *vtable;
};
#define __glXSetError(gc,code) \
*/
char *effectiveGLXexts;
+ /**
+ * Context vtable to use for direct contexts on this screen
+ */
+ const struct glx_context_vtable *direct_context_vtable;
+
+ __GLXdisplayPrivate *display;
+
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
/**
* Per screen direct rendering interface functions and data.
*/
- __DRIscreen *__driScreen;
- const __DRIcoreExtension *core;
- const __DRIlegacyExtension *legacy;
- const __DRIswrastExtension *swrast;
- const __DRIdri2Extension *dri2;
- __glxHashTable *drawHash;
Display *dpy;
- int scr, fd;
- void *driver;
+ int scr;
__GLXDRIscreen *driScreen;
-
- const __DRIconfig **driver_configs;
-
-#ifdef __DRI_COPY_SUB_BUFFER
- const __DRIcopySubBufferExtension *driCopySubBuffer;
-#endif
-
-#ifdef __DRI_SWAP_CONTROL
- const __DRIswapControlExtension *swapControl;
-#endif
-
-#ifdef __DRI_ALLOCATE
- const __DRIallocateExtension *allocate;
-#endif
-
-#ifdef __DRI_FRAME_TRACKING
- const __DRIframeTrackingExtension *frameTracking;
-#endif
-
-#ifdef __DRI_MEDIA_STREAM_COUNTER
- const __DRImediaStreamCounterExtension *msc;
-#endif
-
-#ifdef __DRI_TEX_BUFFER
- const __DRItexBufferExtension *texBuffer;
-#endif
-
-#ifdef __DRI2_FLUSH
- const __DRI2flushExtension *f;
-#endif
-
-#ifdef __DRI2_CONFIG_QUERY
- const __DRI2configQueryExtension *config;
-#endif
-
#endif
/**
*/
struct __GLXdisplayPrivateRec
{
+ /* The extension protocol codes */
+ XExtCodes *codes;
+ struct __GLXdisplayPrivateRec *next;
+
/**
* Back pointer to the display
*/
* Also, per screen data which now includes the server \c GLX_EXTENSION
* string.
*/
- __GLXscreenConfigs *screenConfigs;
+ __GLXscreenConfigs **screenConfigs;
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
+ __glxHashTable *drawHash;
+
/**
* Per display direct rendering interface functions and data.
*/
#endif
};
+extern int
+glx_screen_init(__GLXscreenConfigs *psc,
+ int screen, __GLXdisplayPrivate * priv);
+
+#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
+extern __GLXDRIdrawable *
+dri2GetGlxDrawableFromXDrawableId(Display *dpy, XID id);
+#endif
extern GLubyte *__glXFlushRenderBuffer(__GLXcontext *, GLubyte *);
int32_t * denominator);
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
-GLboolean
-__driGetMscRateOML(__DRIdrawable * draw,
- int32_t * numerator, int32_t * denominator, void *private);
+extern GLboolean
+__glxGetMscRate(__GLXDRIdrawable *glxDraw,
+ int32_t * numerator, int32_t * denominator);
/* So that dri2.c:DRI2WireToEvent() can access
* glx_info->codes->first_event */