From 14a3d61ea37c0b0a2bf211a12118e592c3e0677b Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Wed, 28 Jul 2010 10:33:27 -0700 Subject: Avoid compiler warning for unused glx_dpy variable. My earlier attempt to eliminate this warning (c0ca2bfb2ad8c) was invalid as it removed the variable declaration. Jerome correctly reverted that (600c85efdb0ff) since the variable is used when X_DRI2SwapBuffers is defined. Here, instead of removing the declaration, we move it to inside the correct #ifdef. --- src/glx/dri2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/glx') diff --git a/src/glx/dri2.c b/src/glx/dri2.c index d53431c19a..f288ab8183 100644 --- a/src/glx/dri2.c +++ b/src/glx/dri2.c @@ -88,7 +88,6 @@ static Bool DRI2WireToEvent(Display *dpy, XEvent *event, xEvent *wire) { XExtDisplayInfo *info = DRI2FindDisplay(dpy); - __GLXdisplayPrivate *glx_dpy = __glXInitialize(dpy); XextCheckExtension(dpy, info, dri2ExtensionName, False); @@ -100,6 +99,7 @@ DRI2WireToEvent(Display *dpy, XEvent *event, xEvent *wire) GLXBufferSwapComplete *aevent = (GLXBufferSwapComplete *)event; xDRI2BufferSwapComplete *awire = (xDRI2BufferSwapComplete *)wire; __GLXDRIdrawable *pdraw; + __GLXdisplayPrivate *glx_dpy = __glXInitialize(dpy); /* Ignore swap events if we're not looking for them */ pdraw = dri2GetGlxDrawableFromXDrawableId(dpy, awire->drawable); -- cgit v1.2.3 From db011c8141d7b01b67f2ded4e634657b92ed707a Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Wed, 28 Jul 2010 10:42:46 -0700 Subject: Avoid a compiler warning about a potentially unused variable. There is no assignment to the "ret" variable if X_DRI2SwapBuffers is not defined. In this case, the earlier explicit "return 0" is likely to be used, but the compiler can't be sure of that, (nor can I for that matter). We cover this case by explicitly initializing "ret" to 0. --- src/glx/dri2_glx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/glx') diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c index 49c7ce7502..a2c2b9785e 100644 --- a/src/glx/dri2_glx.c +++ b/src/glx/dri2_glx.c @@ -494,7 +494,7 @@ dri2SwapBuffers(__GLXDRIdrawable *pdraw, int64_t target_msc, int64_t divisor, struct dri2_screen *psc = (struct dri2_screen *) priv->base.psc; struct dri2_display *pdp = (struct dri2_display *)dpyPriv->dri2Display; - CARD64 ret; + CARD64 ret = 0; #ifdef __DRI2_FLUSH if (psc->f) -- cgit v1.2.3 From 38765fe4c2ba96e642510eaed0c2f8c44f0c2b1d Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Wed, 28 Jul 2010 09:08:32 -0400 Subject: glx: Stop using glcore.h and glxint.h in glx We'd like to get rid of these header files. --- src/glx/glcontextmodes.c | 88 --------------------------------------------- src/glx/glcontextmodes.h | 92 ++++++++++++++++++++++++++++++++++++++++++++++-- src/glx/glxclient.h | 3 +- 3 files changed, 90 insertions(+), 93 deletions(-) (limited to 'src/glx') diff --git a/src/glx/glcontextmodes.c b/src/glx/glcontextmodes.c index cdc16f8330..7778eea199 100644 --- a/src/glx/glcontextmodes.c +++ b/src/glx/glcontextmodes.c @@ -84,94 +84,6 @@ _gl_convert_to_x_visual_type(int visualType) } -/** - * Copy a GLX visual config structure to a GL context mode structure. All - * of the fields in \c config are copied to \c mode. Additional fields in - * \c mode that can be derrived from the fields of \c config (i.e., - * \c haveDepthBuffer) are also filled in. The remaining fields in \c mode - * that cannot be derived are set to default values. - * - * \param mode Destination GL context mode. - * \param config Source GLX visual config. - * - * \note - * The \c fbconfigID and \c visualID fields of the \c __GLcontextModes - * structure will be set to the \c vid of the \c __GLXvisualConfig structure. - */ -void -_gl_copy_visual_to_context_mode(__GLcontextModes * mode, - const __GLXvisualConfig * config) -{ - __GLcontextModes *const next = mode->next; - - (void) memset(mode, 0, sizeof(__GLcontextModes)); - mode->next = next; - - mode->visualID = config->vid; - mode->visualType = _gl_convert_from_x_visual_type(config->class); - mode->xRenderable = GL_TRUE; - mode->fbconfigID = config->vid; - mode->drawableType = GLX_WINDOW_BIT | GLX_PIXMAP_BIT; - - mode->rgbMode = (config->rgba != 0); - mode->renderType = (mode->rgbMode) ? GLX_RGBA_BIT : GLX_COLOR_INDEX_BIT; - - mode->colorIndexMode = !(mode->rgbMode); - mode->doubleBufferMode = (config->doubleBuffer != 0); - mode->stereoMode = (config->stereo != 0); - - mode->haveAccumBuffer = ((config->accumRedSize + - config->accumGreenSize + - config->accumBlueSize + - config->accumAlphaSize) > 0); - mode->haveDepthBuffer = (config->depthSize > 0); - mode->haveStencilBuffer = (config->stencilSize > 0); - - mode->redBits = config->redSize; - mode->greenBits = config->greenSize; - mode->blueBits = config->blueSize; - mode->alphaBits = config->alphaSize; - mode->redMask = config->redMask; - mode->greenMask = config->greenMask; - mode->blueMask = config->blueMask; - mode->alphaMask = config->alphaMask; - mode->rgbBits = mode->rgbMode ? config->bufferSize : 0; - mode->indexBits = mode->colorIndexMode ? config->bufferSize : 0; - - mode->accumRedBits = config->accumRedSize; - mode->accumGreenBits = config->accumGreenSize; - mode->accumBlueBits = config->accumBlueSize; - mode->accumAlphaBits = config->accumAlphaSize; - mode->depthBits = config->depthSize; - mode->stencilBits = config->stencilSize; - - mode->numAuxBuffers = config->auxBuffers; - mode->level = config->level; - - mode->visualRating = config->visualRating; - mode->transparentPixel = config->transparentPixel; - mode->transparentRed = config->transparentRed; - mode->transparentGreen = config->transparentGreen; - mode->transparentBlue = config->transparentBlue; - mode->transparentAlpha = config->transparentAlpha; - mode->transparentIndex = config->transparentIndex; - mode->samples = config->multiSampleSize; - mode->sampleBuffers = config->nMultiSampleBuffers; - /* mode->visualSelectGroup = config->visualSelectGroup; ? */ - - mode->swapMethod = GLX_SWAP_UNDEFINED_OML; - - mode->bindToTextureRgb = (mode->rgbMode) ? GL_TRUE : GL_FALSE; - mode->bindToTextureRgba = (mode->rgbMode && mode->alphaBits) ? - GL_TRUE : GL_FALSE; - mode->bindToMipmapTexture = mode->rgbMode ? GL_TRUE : GL_FALSE; - mode->bindToTextureTargets = mode->rgbMode ? - GLX_TEXTURE_1D_BIT_EXT | GLX_TEXTURE_2D_BIT_EXT | - GLX_TEXTURE_RECTANGLE_BIT_EXT : 0; - mode->yInverted = GL_FALSE; -} - - /** * Get data from a GL context mode. * diff --git a/src/glx/glcontextmodes.h b/src/glx/glcontextmodes.h index ecf0280cba..7e6590624b 100644 --- a/src/glx/glcontextmodes.h +++ b/src/glx/glcontextmodes.h @@ -30,12 +30,98 @@ #ifndef GLCONTEXTMODES_H #define GLCONTEXTMODES_H -#include "GL/internal/glcore.h" +typedef struct __GLcontextModesRec { + struct __GLcontextModesRec * next; + + GLboolean rgbMode; + GLboolean floatMode; + GLboolean colorIndexMode; + GLuint doubleBufferMode; + GLuint stereoMode; + + GLboolean haveAccumBuffer; + GLboolean haveDepthBuffer; + GLboolean haveStencilBuffer; + + GLint redBits, greenBits, blueBits, alphaBits; /* bits per comp */ + GLuint redMask, greenMask, blueMask, alphaMask; + GLint rgbBits; /* total bits for rgb */ + GLint indexBits; /* total bits for colorindex */ + + GLint accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits; + GLint depthBits; + GLint stencilBits; + + GLint numAuxBuffers; + + GLint level; + + GLint pixmapMode; + + /* GLX */ + GLint visualID; + GLint visualType; /**< One of the GLX X visual types. (i.e., + * \c GLX_TRUE_COLOR, etc.) + */ + + /* EXT_visual_rating / GLX 1.2 */ + GLint visualRating; + + /* EXT_visual_info / GLX 1.2 */ + GLint transparentPixel; + /* colors are floats scaled to ints */ + GLint transparentRed, transparentGreen, transparentBlue, transparentAlpha; + GLint transparentIndex; + + /* ARB_multisample / SGIS_multisample */ + GLint sampleBuffers; + GLint samples; + + /* SGIX_fbconfig / GLX 1.3 */ + GLint drawableType; + GLint renderType; + GLint xRenderable; + GLint fbconfigID; + + /* SGIX_pbuffer / GLX 1.3 */ + GLint maxPbufferWidth; + GLint maxPbufferHeight; + GLint maxPbufferPixels; + GLint optimalPbufferWidth; /* Only for SGIX_pbuffer. */ + GLint optimalPbufferHeight; /* Only for SGIX_pbuffer. */ + + /* SGIX_visual_select_group */ + GLint visualSelectGroup; + + /* OML_swap_method */ + GLint swapMethod; + + GLint screen; + + /* EXT_texture_from_pixmap */ + GLint bindToTextureRgb; + GLint bindToTextureRgba; + GLint bindToMipmapTexture; + GLint bindToTextureTargets; + GLint yInverted; +} __GLcontextModes; + +#define __GLX_MIN_CONFIG_PROPS 18 +#define __GLX_MAX_CONFIG_PROPS 500 +#define __GLX_EXT_CONFIG_PROPS 10 + +/* +** Since we send all non-core visual properties as token, value pairs, +** we require 2 words across the wire. In order to maintain backwards +** compatibility, we need to send the total number of words that the +** VisualConfigs are sent back in so old libraries can simply "ignore" +** the new properties. +*/ +#define __GLX_TOTAL_CONFIG \ + (__GLX_MIN_CONFIG_PROPS + 2 * __GLX_EXT_CONFIG_PROPS) extern GLint _gl_convert_from_x_visual_type(int visualType); extern GLint _gl_convert_to_x_visual_type(int visualType); -extern void _gl_copy_visual_to_context_mode(__GLcontextModes * mode, - const __GLXvisualConfig * config); extern int _gl_get_context_mode_data(const __GLcontextModes * mode, int attribute, int *value_return); diff --git a/src/glx/glxclient.h b/src/glx/glxclient.h index 48b5501fe9..01087d035f 100644 --- a/src/glx/glxclient.h +++ b/src/glx/glxclient.h @@ -49,10 +49,9 @@ #ifdef WIN32 #include #endif -#include "GL/glxint.h" #include "GL/glxproto.h" -#include "GL/internal/glcore.h" #include "glapi/glapitable.h" +#include "glcontextmodes.h" #include "glxhash.h" #if defined( PTHREADS ) # include -- cgit v1.2.3 From 4f9f066485d93cd6bb0e21fec0775ceed96d14de Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Wed, 28 Jul 2010 09:14:55 -0400 Subject: glx: Delete unused glcontextmodes.c functions --- src/glx/glcontextmodes.c | 86 ------------------------------------------------ src/glx/glcontextmodes.h | 8 ----- src/glx/glxext.c | 7 ---- 3 files changed, 101 deletions(-) (limited to 'src/glx') diff --git a/src/glx/glcontextmodes.c b/src/glx/glcontextmodes.c index 7778eea199..18c45d59d7 100644 --- a/src/glx/glcontextmodes.c +++ b/src/glx/glcontextmodes.c @@ -61,29 +61,6 @@ _gl_convert_from_x_visual_type(int visualType) ? glx_visual_types[visualType] : GLX_NONE; } - -/** - * Convert a GLX visual type to an X visual type. - * - * \param visualType GLX visual type (i.e., \c GLX_TRUE_COLOR, - * \c GLX_STATIC_GRAY, etc.) to be converted. - * \return If \c visualType is a valid GLX visual type, an X visual type will - * be returned. Otherwise -1 will be returned. - */ -GLint -_gl_convert_to_x_visual_type(int visualType) -{ - static const int x_visual_types[NUM_VISUAL_TYPES] = { - TrueColor, DirectColor, - PseudoColor, StaticColor, - GrayScale, StaticGray - }; - - return ((unsigned) (visualType - GLX_TRUE_COLOR) < NUM_VISUAL_TYPES) - ? x_visual_types[visualType - GLX_TRUE_COLOR] : -1; -} - - /** * Get data from a GL context mode. * @@ -365,66 +342,3 @@ _gl_context_modes_find_fbconfig(__GLcontextModes * modes, int fbid) return NULL; } - -/** - * Determine if two context-modes are the same. This is intended to be used - * by libGL implementations to compare to sets of driver generated FBconfigs. - * - * \param a Context-mode to be compared. - * \param b Context-mode to be compared. - * \returns \c GL_TRUE if the two context-modes are the same. \c GL_FALSE is - * returned otherwise. - */ -GLboolean -_gl_context_modes_are_same(const __GLcontextModes * a, - const __GLcontextModes * b) -{ - return ((a->rgbMode == b->rgbMode) && - (a->floatMode == b->floatMode) && - (a->colorIndexMode == b->colorIndexMode) && - (a->doubleBufferMode == b->doubleBufferMode) && - (a->stereoMode == b->stereoMode) && - (a->redBits == b->redBits) && - (a->greenBits == b->greenBits) && - (a->blueBits == b->blueBits) && (a->alphaBits == b->alphaBits) && -#if 0 /* For some reason these don't get set on the client-side in libGL. */ - (a->redMask == b->redMask) && - (a->greenMask == b->greenMask) && - (a->blueMask == b->blueMask) && (a->alphaMask == b->alphaMask) && -#endif - (a->rgbBits == b->rgbBits) && - (a->indexBits == b->indexBits) && - (a->accumRedBits == b->accumRedBits) && - (a->accumGreenBits == b->accumGreenBits) && - (a->accumBlueBits == b->accumBlueBits) && - (a->accumAlphaBits == b->accumAlphaBits) && - (a->depthBits == b->depthBits) && - (a->stencilBits == b->stencilBits) && - (a->numAuxBuffers == b->numAuxBuffers) && - (a->level == b->level) && - (a->pixmapMode == b->pixmapMode) && - (a->visualRating == b->visualRating) && - (a->transparentPixel == b->transparentPixel) && - ((a->transparentPixel != GLX_TRANSPARENT_RGB) || - ((a->transparentRed == b->transparentRed) && - (a->transparentGreen == b->transparentGreen) && - (a->transparentBlue == b->transparentBlue) && - (a->transparentAlpha == b->transparentAlpha))) && - ((a->transparentPixel != GLX_TRANSPARENT_INDEX) || - (a->transparentIndex == b->transparentIndex)) && - (a->sampleBuffers == b->sampleBuffers) && - (a->samples == b->samples) && - ((a->drawableType & b->drawableType) != 0) && - (a->renderType == b->renderType) && - (a->maxPbufferWidth == b->maxPbufferWidth) && - (a->maxPbufferHeight == b->maxPbufferHeight) && - (a->maxPbufferPixels == b->maxPbufferPixels) && - (a->optimalPbufferWidth == b->optimalPbufferWidth) && - (a->optimalPbufferHeight == b->optimalPbufferHeight) && - (a->swapMethod == b->swapMethod) && - (a->bindToTextureRgb == b->bindToTextureRgb) && - (a->bindToTextureRgba == b->bindToTextureRgba) && - (a->bindToMipmapTexture == b->bindToMipmapTexture) && - (a->bindToTextureTargets == b->bindToTextureTargets) && - (a->yInverted == b->yInverted)); -} diff --git a/src/glx/glcontextmodes.h b/src/glx/glcontextmodes.h index 7e6590624b..be2b29a195 100644 --- a/src/glx/glcontextmodes.h +++ b/src/glx/glcontextmodes.h @@ -39,10 +39,6 @@ typedef struct __GLcontextModesRec { GLuint doubleBufferMode; GLuint stereoMode; - GLboolean haveAccumBuffer; - GLboolean haveDepthBuffer; - GLboolean haveStencilBuffer; - GLint redBits, greenBits, blueBits, alphaBits; /* bits per comp */ GLuint redMask, greenMask, blueMask, alphaMask; GLint rgbBits; /* total bits for rgb */ @@ -121,10 +117,8 @@ typedef struct __GLcontextModesRec { (__GLX_MIN_CONFIG_PROPS + 2 * __GLX_EXT_CONFIG_PROPS) extern GLint _gl_convert_from_x_visual_type(int visualType); -extern GLint _gl_convert_to_x_visual_type(int visualType); extern int _gl_get_context_mode_data(const __GLcontextModes * mode, int attribute, int *value_return); - extern __GLcontextModes *_gl_context_modes_create(unsigned count, size_t minimum_size); extern void _gl_context_modes_destroy(__GLcontextModes * modes); @@ -132,7 +126,5 @@ extern __GLcontextModes *_gl_context_modes_find_visual(__GLcontextModes * modes, int vid); extern __GLcontextModes *_gl_context_modes_find_fbconfig(__GLcontextModes * modes, int fbid); -extern GLboolean _gl_context_modes_are_same(const __GLcontextModes * a, - const __GLcontextModes * b); #endif /* GLCONTEXTMODES_H */ diff --git a/src/glx/glxext.c b/src/glx/glxext.c index 4a9c9d499e..7612e5e834 100644 --- a/src/glx/glxext.c +++ b/src/glx/glxext.c @@ -573,13 +573,6 @@ __glXInitializeVisualConfigFromTags(__GLcontextModes * config, int count, config->renderType = (config->rgbMode) ? GLX_RGBA_BIT : GLX_COLOR_INDEX_BIT; - - config->haveAccumBuffer = ((config->accumRedBits + - config->accumGreenBits + - config->accumBlueBits + - config->accumAlphaBits) > 0); - config->haveDepthBuffer = (config->depthBits > 0); - config->haveStencilBuffer = (config->stencilBits > 0); } static __GLcontextModes * -- cgit v1.2.3 From 6ddf66e9230ee862ac341c4767cf6b3b2dd2552b Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Wed, 28 Jul 2010 10:07:52 -0400 Subject: glx: Rename __GLcontextModes to struct glx_config With this rename, we use 'config' consitently to refer to GLX configurations instead of the modes/configs/visual mess before. --- src/glx/apple/apple_glx_drawable.h | 2 +- src/glx/apple/apple_glx_pbuffer.c | 2 +- src/glx/apple/apple_glx_pixmap.c | 2 +- src/glx/apple/apple_visual.c | 2 +- src/glx/apple/apple_visual.h | 2 +- src/glx/dri2_glx.c | 10 +- src/glx/dri_common.c | 50 +++++---- src/glx/dri_common.h | 6 +- src/glx/dri_glx.c | 14 +-- src/glx/drisw_glx.c | 8 +- src/glx/glcontextmodes.c | 106 ++++++------------- src/glx/glcontextmodes.h | 27 ++--- src/glx/glx_pbuffer.c | 60 +++++------ src/glx/glxclient.h | 18 ++-- src/glx/glxcmds.c | 205 ++++++++++++++++++------------------- src/glx/glxcurrent.c | 2 +- src/glx/glxext.c | 31 ++++-- 17 files changed, 258 insertions(+), 289 deletions(-) (limited to 'src/glx') diff --git a/src/glx/apple/apple_glx_drawable.h b/src/glx/apple/apple_glx_drawable.h index e49eae355e..af79e0590e 100644 --- a/src/glx/apple/apple_glx_drawable.h +++ b/src/glx/apple/apple_glx_drawable.h @@ -211,7 +211,7 @@ bool apple_glx_pbuffer_get_event_mask(GLXDrawable d, unsigned long *mask); /* Pixmaps */ -/* mode is a __GLcontextModes * */ +/* mode is a struct glx_config * */ /* Returns true if an error occurred. */ bool apple_glx_pixmap_create(Display * dpy, int screen, Pixmap pixmap, const void *mode); diff --git a/src/glx/apple/apple_glx_pbuffer.c b/src/glx/apple/apple_glx_pbuffer.c index 1466fea487..a5ef59ccf8 100644 --- a/src/glx/apple/apple_glx_pbuffer.c +++ b/src/glx/apple/apple_glx_pbuffer.c @@ -128,7 +128,7 @@ apple_glx_pbuffer_create(Display * dpy, GLXFBConfig config, Window root; int screen; Pixmap xid; - __GLcontextModes *modes = (__GLcontextModes *) config; + struct glx_config *modes = (__GLcontextModes *) config; root = DefaultRootWindow(dpy); screen = DefaultScreen(dpy); diff --git a/src/glx/apple/apple_glx_pixmap.c b/src/glx/apple/apple_glx_pixmap.c index af1791afb7..fec05e02de 100644 --- a/src/glx/apple/apple_glx_pixmap.c +++ b/src/glx/apple/apple_glx_pixmap.c @@ -125,7 +125,7 @@ apple_glx_pixmap_create(Display * dpy, int screen, Pixmap pixmap, bool double_buffered; bool uses_stereo; CGLError error; - const __GLcontextModes *cmodes = mode; + const struct glx_config *cmodes = mode; if (apple_glx_drawable_create(dpy, screen, pixmap, &d, &callbacks)) return true; diff --git a/src/glx/apple/apple_visual.c b/src/glx/apple/apple_visual.c index da5aa05fd5..7a9525e817 100644 --- a/src/glx/apple/apple_visual.c +++ b/src/glx/apple/apple_visual.c @@ -61,7 +61,7 @@ apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const void *mode, bool offscreen) { CGLPixelFormatAttribute attr[MAX_ATTR]; - const __GLcontextModes *c = mode; + const struct glx_config *c = mode; int numattr = 0; GLint vsref = 0; CGLError error = 0; diff --git a/src/glx/apple/apple_visual.h b/src/glx/apple/apple_visual.h index ebfafa340b..2cf9a9e251 100644 --- a/src/glx/apple/apple_visual.h +++ b/src/glx/apple/apple_visual.h @@ -33,7 +33,7 @@ #include #include -/* mode is expected to be of type __GLcontextModes. */ +/* mode is expected to be of type struct glx_config. */ void apple_visual_create_pfobj(CGLPixelFormatObj * pfobj, const void *mode, bool * double_buffered, bool * uses_stereo, bool offscreen); diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c index a2c2b9785e..2429e0df03 100644 --- a/src/glx/dri2_glx.c +++ b/src/glx/dri2_glx.c @@ -156,12 +156,12 @@ dri2UnbindContext(__GLXcontext *context) static __GLXcontext * dri2_create_context(__GLXscreenConfigs *base, - const __GLcontextModes * mode, + struct glx_config *config_base, GLXContext shareList, int renderType) { struct dri2_context *pcp, *pcp_shared; struct dri2_screen *psc = (struct dri2_screen *) base; - __GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) mode; + __GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) config_base; __DRIcontext *shared = NULL; if (shareList) { @@ -174,7 +174,7 @@ dri2_create_context(__GLXscreenConfigs *base, return NULL; memset(pcp, 0, sizeof *pcp); - if (!glx_context_init(&pcp->base, &psc->base, mode)) { + if (!glx_context_init(&pcp->base, &psc->base, &config->base)) { Xfree(pcp); return NULL; } @@ -212,11 +212,11 @@ dri2DestroyDrawable(__GLXDRIdrawable *base) static __GLXDRIdrawable * dri2CreateDrawable(__GLXscreenConfigs *base, XID xDrawable, - GLXDrawable drawable, const __GLcontextModes * modes) + GLXDrawable drawable, struct glx_config *config_base) { struct dri2_drawable *pdraw; struct dri2_screen *psc = (struct dri2_screen *) base; - __GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) modes; + __GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) config_base; __GLXdisplayPrivate *dpyPriv; struct dri2_display *pdp; GLint vblank_mode = DRI_CONF_VBLANK_DEF_INTERVAL_1; diff --git a/src/glx/dri_common.c b/src/glx/dri_common.c index 9b7da3e7df..7866521e42 100644 --- a/src/glx/dri_common.c +++ b/src/glx/dri_common.c @@ -176,7 +176,7 @@ _X_HIDDEN const __DRIsystemTimeExtension systemTimeExtension = { }; #define __ATTRIB(attrib, field) \ - { attrib, offsetof(__GLcontextModes, field) } + { attrib, offsetof(struct glx_config, field) } static const struct { @@ -225,10 +225,8 @@ __ATTRIB(__DRI_ATTRIB_BIND_TO_TEXTURE_RGB, bindToTextureRgb), bindToMipmapTexture), __ATTRIB(__DRI_ATTRIB_YINVERTED, yInverted),}; -#define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0])) - static int -scalarEqual(__GLcontextModes * mode, unsigned int attrib, unsigned int value) +scalarEqual(struct glx_config *mode, unsigned int attrib, unsigned int value) { unsigned int glxValue; int i; @@ -243,8 +241,8 @@ scalarEqual(__GLcontextModes * mode, unsigned int attrib, unsigned int value) } static int -driConfigEqual(const __DRIcoreExtension * core, - __GLcontextModes * modes, const __DRIconfig * driConfig) +driConfigEqual(const __DRIcoreExtension *core, + struct glx_config *config, const __DRIconfig *driConfig) { unsigned int attrib, value, glxValue; int i; @@ -260,7 +258,7 @@ driConfigEqual(const __DRIcoreExtension * core, else if (value & __DRI_ATTRIB_COLOR_INDEX_BIT) { glxValue |= GLX_COLOR_INDEX_BIT; } - if (glxValue != modes->renderType) + if (glxValue != config->renderType) return GL_FALSE; break; @@ -271,7 +269,7 @@ driConfigEqual(const __DRIcoreExtension * core, glxValue = GLX_SLOW_CONFIG; else glxValue = GLX_NONE; - if (glxValue != modes->visualRating) + if (glxValue != config->visualRating) return GL_FALSE; break; @@ -283,13 +281,13 @@ driConfigEqual(const __DRIcoreExtension * core, glxValue |= GLX_TEXTURE_2D_BIT_EXT; if (value & __DRI_ATTRIB_TEXTURE_RECTANGLE_BIT) glxValue |= GLX_TEXTURE_RECTANGLE_BIT_EXT; - if (modes->bindToTextureTargets != GLX_DONT_CARE && - glxValue != modes->bindToTextureTargets) + if (config->bindToTextureTargets != GLX_DONT_CARE && + glxValue != config->bindToTextureTargets) return GL_FALSE; break; default: - if (!scalarEqual(modes, attrib, value)) + if (!scalarEqual(config, attrib, value)) return GL_FALSE; } } @@ -297,41 +295,41 @@ driConfigEqual(const __DRIcoreExtension * core, return GL_TRUE; } -static __GLcontextModes * +static struct glx_config * createDriMode(const __DRIcoreExtension * core, - __GLcontextModes * modes, const __DRIconfig ** driConfigs) + struct glx_config *config, const __DRIconfig **driConfigs) { - __GLXDRIconfigPrivate *config; + __GLXDRIconfigPrivate *driConfig; int i; for (i = 0; driConfigs[i]; i++) { - if (driConfigEqual(core, modes, driConfigs[i])) + if (driConfigEqual(core, config, driConfigs[i])) break; } if (driConfigs[i] == NULL) return NULL; - config = Xmalloc(sizeof *config); - if (config == NULL) + driConfig = Xmalloc(sizeof *driConfig); + if (driConfig == NULL) return NULL; - config->modes = *modes; - config->driConfig = driConfigs[i]; + driConfig->base = *config; + driConfig->driConfig = driConfigs[i]; - return &config->modes; + return &driConfig->base; } -_X_HIDDEN __GLcontextModes * +_X_HIDDEN struct glx_config * driConvertConfigs(const __DRIcoreExtension * core, - __GLcontextModes * modes, const __DRIconfig ** configs) + struct glx_config *configs, const __DRIconfig **driConfigs) { - __GLcontextModes head, *tail, *m; + struct glx_config head, *tail, *m; tail = &head; head.next = NULL; - for (m = modes; m; m = m->next) { - tail->next = createDriMode(core, m, configs); + for (m = configs; m; m = m->next) { + tail->next = createDriMode(core, m, driConfigs); if (tail->next == NULL) { /* no matching dri config for m */ continue; @@ -341,7 +339,7 @@ driConvertConfigs(const __DRIcoreExtension * core, tail = tail->next; } - _gl_context_modes_destroy(modes); + glx_config_destroy_list(configs); return head.next; } diff --git a/src/glx/dri_common.h b/src/glx/dri_common.h index f3da50ecf0..32d98ed3c1 100644 --- a/src/glx/dri_common.h +++ b/src/glx/dri_common.h @@ -42,12 +42,12 @@ typedef struct __GLXDRIconfigPrivateRec __GLXDRIconfigPrivate; struct __GLXDRIconfigPrivateRec { - __GLcontextModes modes; + struct glx_config base; const __DRIconfig *driConfig; }; -extern __GLcontextModes *driConvertConfigs(const __DRIcoreExtension * core, - __GLcontextModes * modes, +extern struct glx_config *driConvertConfigs(const __DRIcoreExtension * core, + struct glx_config * modes, const __DRIconfig ** configs); extern void driDestroyConfigs(const __DRIconfig **configs); diff --git a/src/glx/dri_glx.c b/src/glx/dri_glx.c index fd14285a48..291b9aacaf 100644 --- a/src/glx/dri_glx.c +++ b/src/glx/dri_glx.c @@ -337,7 +337,7 @@ CallCreateNewScreen(Display *dpy, int scrn, struct dri_screen *psc, drm_handle_t hFB; int junk; const __DRIconfig **driver_configs; - __GLcontextModes *visual; + struct glx_config *visual; /* DRI protocol version. */ dri_version.major = driDpy->driMajor; @@ -551,14 +551,14 @@ static const struct glx_context_vtable dri_context_vtable = { static __GLXcontext * dri_create_context(__GLXscreenConfigs *base, - const __GLcontextModes *mode, + struct glx_config *config_base, GLXContext shareList, int renderType) { struct dri_context *pcp, *pcp_shared; struct dri_screen *psc = (struct dri_screen *) base; drm_context_t hwContext; __DRIcontext *shared = NULL; - __GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) mode; + __GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) config_base; if (!psc->base.driScreen) return NULL; @@ -573,13 +573,13 @@ dri_create_context(__GLXscreenConfigs *base, return NULL; memset(pcp, 0, sizeof *pcp); - if (!glx_context_init(&pcp->base, &psc->base, mode)) { + if (!glx_context_init(&pcp->base, &psc->base, &config->base)) { Xfree(pcp); return NULL; } if (!XF86DRICreateContextWithConfig(psc->base.dpy, psc->base.scr, - mode->visualID, + config->base.visualID, &pcp->hwContextID, &hwContext)) { Xfree(pcp); return NULL; @@ -617,11 +617,11 @@ driDestroyDrawable(__GLXDRIdrawable * pdraw) static __GLXDRIdrawable * driCreateDrawable(__GLXscreenConfigs *base, XID xDrawable, - GLXDrawable drawable, const __GLcontextModes * modes) + GLXDrawable drawable, struct glx_config *config_base) { drm_drawable_t hwDrawable; void *empty_attribute_list = NULL; - __GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) modes; + __GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) config_base; struct dri_screen *psc = (struct dri_screen *) base; struct dri_drawable *pdp; diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c index 5f7185de4c..39d71513a8 100644 --- a/src/glx/drisw_glx.c +++ b/src/glx/drisw_glx.c @@ -291,11 +291,11 @@ static const struct glx_context_vtable drisw_context_vtable = { static __GLXcontext * drisw_create_context(__GLXscreenConfigs *base, - const __GLcontextModes *mode, + struct glx_config *config_base, GLXContext shareList, int renderType) { struct drisw_context *pcp, *pcp_shared; - __GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) mode; + __GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) config_base; struct drisw_screen *psc = (struct drisw_screen *) base; __DRIcontext *shared = NULL; @@ -312,7 +312,7 @@ drisw_create_context(__GLXscreenConfigs *base, return NULL; memset(pcp, 0, sizeof *pcp); - if (!glx_context_init(&pcp->base, &psc->base, mode)) { + if (!glx_context_init(&pcp->base, &psc->base, &config->base)) { Xfree(pcp); return NULL; } @@ -347,7 +347,7 @@ driDestroyDrawable(__GLXDRIdrawable * pdraw) static __GLXDRIdrawable * driCreateDrawable(__GLXscreenConfigs *base, XID xDrawable, - GLXDrawable drawable, const __GLcontextModes * modes) + GLXDrawable drawable, struct glx_config *modes) { struct drisw_drawable *pdp; __GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) modes; diff --git a/src/glx/glcontextmodes.c b/src/glx/glcontextmodes.c index 18c45d59d7..186de485ff 100644 --- a/src/glx/glcontextmodes.c +++ b/src/glx/glcontextmodes.c @@ -24,7 +24,7 @@ /** * \file glcontextmodes.c - * Utility routines for working with \c __GLcontextModes structures. At + * Utility routines for working with \c struct glx_config structures. At * some point most or all of these functions will be moved to the Mesa * code base. * @@ -41,28 +41,7 @@ #define NUM_VISUAL_TYPES 6 /** - * Convert an X visual type to a GLX visual type. - * - * \param visualType X visual type (i.e., \c TrueColor, \c StaticGray, etc.) - * to be converted. - * \return If \c visualType is a valid X visual type, a GLX visual type will - * be returned. Otherwise \c GLX_NONE will be returned. - */ -GLint -_gl_convert_from_x_visual_type(int visualType) -{ - static const int glx_visual_types[NUM_VISUAL_TYPES] = { - GLX_STATIC_GRAY, GLX_GRAY_SCALE, - GLX_STATIC_COLOR, GLX_PSEUDO_COLOR, - GLX_TRUE_COLOR, GLX_DIRECT_COLOR - }; - - return ((unsigned) visualType < NUM_VISUAL_TYPES) - ? glx_visual_types[visualType] : GLX_NONE; -} - -/** - * Get data from a GL context mode. + * Get data from a GLX config * * \param mode GL context mode whose data is to be returned. * \param attribute Attribute of \c mode that is to be returned. @@ -70,9 +49,8 @@ _gl_convert_from_x_visual_type(int visualType) * \return If \c attribute is a valid attribute of \c mode, zero is * returned. Otherwise \c GLX_BAD_ATTRIBUTE is returned. */ -int -_gl_get_context_mode_data(const __GLcontextModes * mode, int attribute, - int *value_return) +_X_HIDDEN int +glx_config_get(struct glx_config * mode, int attribute, int *value_return) { switch (attribute) { case GLX_USE_GL: @@ -222,7 +200,7 @@ _gl_get_context_mode_data(const __GLcontextModes * mode, int attribute, /** - * Allocate a linked list of \c __GLcontextModes structures. The fields of + * Allocate a linked list of \c struct glx_config structures. The fields of * each structure will be initialized to "reasonable" default values. In * most cases this is the default value defined by table 3.4 of the GLX * 1.3 specification. This means that most values are either initialized to @@ -233,36 +211,26 @@ _gl_get_context_mode_data(const __GLcontextModes * mode, int attribute, * \param count Number of structures to allocate. * \param minimum_size Minimum size of a structure to allocate. This allows * for differences in the version of the - * \c __GLcontextModes stucture used in libGL and in a + * \c struct glx_config stucture used in libGL and in a * DRI-based driver. * \returns A pointer to the first element in a linked list of \c count * stuctures on success, or \c NULL on failure. - * - * \warning Use of \c minimum_size does \b not guarantee binary compatibility. - * The fundamental assumption is that if the \c minimum_size - * specified by the driver and the size of the \c __GLcontextModes - * structure in libGL is the same, then the meaning of each byte in - * the structure is the same in both places. \b Be \b careful! - * Basically this means that fields have to be added in libGL and - * then propagated to drivers. Drivers should \b never arbitrarilly - * extend the \c __GLcontextModes data-structure. */ -__GLcontextModes * -_gl_context_modes_create(unsigned count, size_t minimum_size) +_X_HIDDEN struct glx_config * +glx_config_create_list(unsigned count) { - const size_t size = (minimum_size > sizeof(__GLcontextModes)) - ? minimum_size : sizeof(__GLcontextModes); - __GLcontextModes *base = NULL; - __GLcontextModes **next; + const size_t size = sizeof(struct glx_config); + struct glx_config *base = NULL; + struct glx_config **next; unsigned i; next = &base; for (i = 0; i < count; i++) { - *next = (__GLcontextModes *) malloc(size); + *next = (struct glx_config *) malloc(size); if (*next == NULL) { - _gl_context_modes_destroy(base); - base = NULL; - break; + glx_config_destroy_list(base); + base = NULL; + break; } (void) memset(*next, 0, size); @@ -290,22 +258,14 @@ _gl_context_modes_create(unsigned count, size_t minimum_size) return base; } - -/** - * Destroy a linked list of \c __GLcontextModes structures created by - * \c _gl_context_modes_create. - * - * \param modes Linked list of structures to be destroyed. All structres - * in the list will be freed. - */ -void -_gl_context_modes_destroy(__GLcontextModes * modes) +_X_HIDDEN void +glx_config_destroy_list(struct glx_config *configs) { - while (modes != NULL) { - __GLcontextModes *const next = modes->next; + while (configs != NULL) { + struct glx_config *const next = configs->next; - free(modes); - modes = next; + free(configs); + configs = next; } } @@ -319,26 +279,26 @@ _gl_context_modes_destroy(__GLcontextModes * modes) * the list, or \c NULL if it was not. */ -__GLcontextModes * -_gl_context_modes_find_visual(__GLcontextModes * modes, int vid) +_X_HIDDEN struct glx_config * +glx_config_find_visual(struct glx_config *configs, int vid) { - __GLcontextModes *m; + struct glx_config *c; - for (m = modes; m != NULL; m = m->next) - if (m->visualID == vid) - return m; + for (c = configs; c != NULL; c = c->next) + if (c->visualID == vid) + return c; return NULL; } -__GLcontextModes * -_gl_context_modes_find_fbconfig(__GLcontextModes * modes, int fbid) +_X_HIDDEN struct glx_config * +glx_config_find_fbconfig(struct glx_config *configs, int fbid) { - __GLcontextModes *m; + struct glx_config *c; - for (m = modes; m != NULL; m = m->next) - if (m->fbconfigID == fbid) - return m; + for (c = configs; c != NULL; c = c->next) + if (c->fbconfigID == fbid) + return c; return NULL; } diff --git a/src/glx/glcontextmodes.h b/src/glx/glcontextmodes.h index be2b29a195..f7ee958e4b 100644 --- a/src/glx/glcontextmodes.h +++ b/src/glx/glcontextmodes.h @@ -30,8 +30,8 @@ #ifndef GLCONTEXTMODES_H #define GLCONTEXTMODES_H -typedef struct __GLcontextModesRec { - struct __GLcontextModesRec * next; +struct glx_config { + struct glx_config * next; GLboolean rgbMode; GLboolean floatMode; @@ -100,7 +100,7 @@ typedef struct __GLcontextModesRec { GLint bindToMipmapTexture; GLint bindToTextureTargets; GLint yInverted; -} __GLcontextModes; +}; #define __GLX_MIN_CONFIG_PROPS 18 #define __GLX_MAX_CONFIG_PROPS 500 @@ -117,14 +117,17 @@ typedef struct __GLcontextModesRec { (__GLX_MIN_CONFIG_PROPS + 2 * __GLX_EXT_CONFIG_PROPS) extern GLint _gl_convert_from_x_visual_type(int visualType); -extern int _gl_get_context_mode_data(const __GLcontextModes * mode, - int attribute, int *value_return); -extern __GLcontextModes *_gl_context_modes_create(unsigned count, - size_t minimum_size); -extern void _gl_context_modes_destroy(__GLcontextModes * modes); -extern __GLcontextModes *_gl_context_modes_find_visual(__GLcontextModes * - modes, int vid); -extern __GLcontextModes *_gl_context_modes_find_fbconfig(__GLcontextModes * - modes, int fbid); + +extern int +glx_config_get(struct glx_config * mode, int attribute, int *value_return); +extern struct glx_config * +glx_config_create_list(unsigned count); +extern void +glx_config_destroy_list(struct glx_config *configs); +extern struct glx_config * +glx_config_find_visual(struct glx_config *configs, int vid); +extern struct glx_config * +glx_config_find_fbconfig(struct glx_config *configs, int fbid); #endif /* GLCONTEXTMODES_H */ + diff --git a/src/glx/glx_pbuffer.c b/src/glx/glx_pbuffer.c index 02809aacfa..abe618ddb3 100644 --- a/src/glx/glx_pbuffer.c +++ b/src/glx/glx_pbuffer.c @@ -183,7 +183,7 @@ determineTextureFormat(const int *attribs, int numAttribs) } static void -CreateDRIDrawable(Display *dpy, const __GLcontextModes *fbconfig, +CreateDRIDrawable(Display *dpy, struct glx_config *config, XID drawable, XID glxdrawable, const int *attrib_list, size_t num_attribs) { @@ -191,12 +191,12 @@ CreateDRIDrawable(Display *dpy, const __GLcontextModes *fbconfig, __GLXDRIdrawable *pdraw; __GLXscreenConfigs *psc; - psc = priv->screenConfigs[fbconfig->screen]; + psc = priv->screenConfigs[config->screen]; if (psc->driScreen == NULL) return; pdraw = psc->driScreen->createDrawable(psc, drawable, - glxdrawable, fbconfig); + glxdrawable, config); if (pdraw == NULL) { fprintf(stderr, "failed to create drawable\n"); return; @@ -228,7 +228,7 @@ DestroyDRIDrawable(Display *dpy, GLXDrawable drawable, int destroy_xdrawable) #else static void -CreateDRIDrawable(Display *dpy, const __GLcontextModes * fbconfig, +CreateDRIDrawable(Display *dpy, const struct glx_config * fbconfig, XID drawable, XID glxdrawable, const int *attrib_list, size_t num_attribs) { @@ -367,7 +367,7 @@ GetDrawableAttribute(Display * dpy, GLXDrawable drawable, * This function needs to be modified to work with direct-rendering drivers. */ static GLXDrawable -CreateDrawable(Display * dpy, const __GLcontextModes * fbconfig, +CreateDrawable(Display *dpy, struct glx_config *config, Drawable drawable, const int *attrib_list, CARD8 glxCode) { xGLXCreateWindowReq *req; @@ -391,11 +391,11 @@ CreateDrawable(Display * dpy, const __GLcontextModes * fbconfig, req->reqType = opcode; req->glxCode = glxCode; - req->screen = (CARD32) fbconfig->screen; - req->fbconfig = fbconfig->fbconfigID; - req->window = (CARD32) drawable; - req->glxwindow = (GLXWindow) XAllocID(dpy); - req->numAttribs = (CARD32) i; + req->screen = config->screen; + req->fbconfig = config->fbconfigID; + req->window = drawable; + req->glxwindow = XAllocID(dpy); + req->numAttribs = i; if (attrib_list) memcpy(data, attrib_list, 8 * i); @@ -403,9 +403,9 @@ CreateDrawable(Display * dpy, const __GLcontextModes * fbconfig, UnlockDisplay(dpy); SyncHandle(); - CreateDRIDrawable(dpy, fbconfig, drawable, req->glxwindow, attrib_list, i); + CreateDRIDrawable(dpy, config, drawable, req->glxwindow, attrib_list, i); - return (GLXDrawable) req->glxwindow; + return req->glxwindow; } @@ -457,7 +457,7 @@ DestroyDrawable(Display * dpy, GLXDrawable drawable, CARD32 glxCode) * This function needs to be modified to work with direct-rendering drivers. */ static GLXDrawable -CreatePbuffer(Display * dpy, const __GLcontextModes * fbconfig, +CreatePbuffer(Display * dpy, struct glx_config *config, unsigned int width, unsigned int height, const int *attrib_list, GLboolean size_in_attribs) { @@ -490,10 +490,10 @@ CreatePbuffer(Display * dpy, const __GLcontextModes * fbconfig, req->reqType = opcode; req->glxCode = X_GLXCreatePbuffer; - req->screen = (CARD32) fbconfig->screen; - req->fbconfig = fbconfig->fbconfigID; - req->pbuffer = (GLXPbuffer) id; - req->numAttribs = (CARD32) (i + extra); + req->screen = config->screen; + req->fbconfig = config->fbconfigID; + req->pbuffer = id; + req->numAttribs = i + extra; if (!size_in_attribs) { data[(2 * i) + 0] = GLX_PBUFFER_WIDTH; @@ -513,11 +513,11 @@ CreatePbuffer(Display * dpy, const __GLcontextModes * fbconfig, vpreq->glxCode = X_GLXVendorPrivate; vpreq->vendorCode = X_GLXvop_CreateGLXPbufferSGIX; - data[0] = (CARD32) fbconfig->screen; - data[1] = (CARD32) fbconfig->fbconfigID; - data[2] = (CARD32) id; - data[3] = (CARD32) width; - data[4] = (CARD32) height; + data[0] = config->screen; + data[1] = config->fbconfigID; + data[2] = id; + data[3] = width; + data[4] = height; data += 5; } @@ -526,10 +526,10 @@ CreatePbuffer(Display * dpy, const __GLcontextModes * fbconfig, UnlockDisplay(dpy); SyncHandle(); - pixmap = XCreatePixmap(dpy, RootWindow(dpy, fbconfig->screen), - width, height, fbconfig->rgbBits); + pixmap = XCreatePixmap(dpy, RootWindow(dpy, config->screen), + width, height, config->rgbBits); - CreateDRIDrawable(dpy, fbconfig, pixmap, id, attrib_list, i); + CreateDRIDrawable(dpy, config, pixmap, id, attrib_list, i); return id; } @@ -598,7 +598,7 @@ glXCreateGLXPbufferSGIX(Display * dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list) { - return (GLXPbufferSGIX) CreatePbuffer(dpy, (__GLcontextModes *) config, + return (GLXPbufferSGIX) CreatePbuffer(dpy, (struct glx_config *) config, width, height, attrib_list, GL_FALSE); } @@ -674,7 +674,7 @@ glXCreatePbuffer(Display * dpy, GLXFBConfig config, const int *attrib_list) } } - return (GLXPbuffer) CreatePbuffer(dpy, (__GLcontextModes *) config, + return (GLXPbuffer) CreatePbuffer(dpy, (struct glx_config *) config, width, height, attrib_list, GL_TRUE); #endif } @@ -836,14 +836,14 @@ glXCreatePixmap(Display * dpy, GLXFBConfig config, Pixmap pixmap, WARN_ONCE_GLX_1_3(dpy, __func__); #ifdef GLX_USE_APPLEGL - const __GLcontextModes *modes = (const __GLcontextModes *) config; + const struct glx_config *modes = (const __GLcontextModes *) config; if (apple_glx_pixmap_create(dpy, modes->screen, pixmap, modes)) return None; return pixmap; #else - return CreateDrawable(dpy, (__GLcontextModes *) config, + return CreateDrawable(dpy, (struct glx_config *) config, (Drawable) pixmap, attrib_list, X_GLXCreatePixmap); #endif } @@ -878,7 +878,7 @@ glXCreateWindow(Display * dpy, GLXFBConfig config, Window win, return win; #else - return CreateDrawable(dpy, (__GLcontextModes *) config, + return CreateDrawable(dpy, (struct glx_config *) config, (Drawable) win, attrib_list, X_GLXCreateWindow); #endif } diff --git a/src/glx/glxclient.h b/src/glx/glxclient.h index 01087d035f..3a8d294dab 100644 --- a/src/glx/glxclient.h +++ b/src/glx/glxclient.h @@ -74,7 +74,7 @@ # define USED #endif - +#define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0])) #define GLX_MAJOR_VERSION 1 /* current version numbers */ #define GLX_MINOR_VERSION 4 @@ -127,13 +127,13 @@ struct __GLXDRIscreenRec { void (*destroyScreen)(__GLXscreenConfigs *psc); __GLXcontext *(*createContext)(__GLXscreenConfigs *psc, - const __GLcontextModes *mode, + struct glx_config *config, GLXContext shareList, int renderType); __GLXDRIdrawable *(*createDrawable)(__GLXscreenConfigs *psc, XID drawable, GLXDrawable glxDrawable, - const __GLcontextModes *modes); + struct glx_config *config); int64_t (*swapBuffers)(__GLXDRIdrawable *pdraw, int64_t target_msc, int64_t divisor, int64_t remainder); @@ -403,9 +403,9 @@ struct __GLXcontextRec GLint majorOpcode; /** - * Pointer to the mode used to create this context. + * Pointer to the config used to create this context. */ - const __GLcontextModes *mode; + struct glx_config *config; #ifdef GLX_DIRECT_RENDERING #ifdef GLX_USE_APPLEGL @@ -462,7 +462,7 @@ struct __GLXcontextRec extern Bool glx_context_init(__GLXcontext *gc, - __GLXscreenConfigs *psc, const __GLcontextModes *fbconfig); + __GLXscreenConfigs *psc, struct glx_config *fbconfig); #define __glXSetError(gc,code) \ if (!(gc)->error) { \ @@ -505,7 +505,7 @@ extern void __glFreeAttributeState(__GLXcontext *); */ struct glx_screen_vtable { __GLXcontext *(*create_context)(__GLXscreenConfigs *psc, - const __GLcontextModes *mode, + struct glx_config *config, GLXContext shareList, int renderType); }; @@ -539,7 +539,7 @@ struct __GLXscreenConfigsRec /** * Linked list of glx visuals and fbconfigs for this screen. */ - __GLcontextModes *visuals, *configs; + struct glx_config *visuals, *configs; /** * Per-screen dynamic GLX extension tracking. The \c direct_support @@ -766,7 +766,7 @@ extern void _XSend(Display *, const void *, long); #endif -extern void __glXInitializeVisualConfigFromTags(__GLcontextModes * config, +extern void __glXInitializeVisualConfigFromTags(struct glx_config * config, int count, const INT32 * bp, Bool tagged_only, Bool fbconfig_style_tags); diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c index 0782b1d70f..85bfa657e0 100644 --- a/src/glx/glxcmds.c +++ b/src/glx/glxcmds.c @@ -208,26 +208,25 @@ GetGLXPrivScreenConfig(Display * dpy, int scrn, __GLXdisplayPrivate ** ppriv, * \param config Application supplied \c GLXFBConfig. * * \returns If the \c GLXFBConfig is valid, the a pointer to the matching - * \c __GLcontextModes structure is returned. Otherwise, \c NULL + * \c struct glx_config structure is returned. Otherwise, \c NULL * is returned. */ -static __GLcontextModes * -ValidateGLXFBConfig(Display * dpy, GLXFBConfig config) +static struct glx_config * +ValidateGLXFBConfig(Display * dpy, GLXFBConfig fbconfig) { __GLXdisplayPrivate *const priv = __glXInitialize(dpy); - const unsigned num_screens = ScreenCount(dpy); + int num_screens = ScreenCount(dpy); unsigned i; - const __GLcontextModes *modes; - + struct glx_config *config; if (priv != NULL) { for (i = 0; i < num_screens; i++) { - for (modes = priv->screenConfigs[i]->configs; modes != NULL; - modes = modes->next) { - if (modes == (__GLcontextModes *) config) { - return (__GLcontextModes *) config; - } - } + for (config = priv->screenConfigs[i]->configs; config != NULL; + config = config->next) { + if (config == (struct glx_config *) fbconfig) { + return config; + } + } } } @@ -240,8 +239,8 @@ static const struct glx_context_vtable applegl_context_vtable; static __GLcontext * applegl_create_context(__GLXscreenConfigs *psc, - const __GLcontextModes *mode, - GLXContext shareList, int renderType) + struct glx_config *mode, + GLXContext shareList, int renderType) { __GLXcontext *gc; int errorcode; @@ -296,7 +295,7 @@ applegl_create_context(__GLXscreenConfigs *psc, */ static GLXContext indirect_create_context(__GLXscreenConfigs *psc, - const __GLcontextModes *mode, + struct glx_config *mode, GLXContext shareList, int renderType) { GLXContext gc; @@ -416,7 +415,7 @@ indirect_create_screen(int screen, __GLXdisplayPrivate * priv) _X_HIDDEN Bool glx_context_init(__GLXcontext *gc, - __GLXscreenConfigs *psc, const __GLcontextModes *fbconfig) + __GLXscreenConfigs *psc, struct glx_config *config) { gc->majorOpcode = __glXSetupForCommand(psc->display->dpy); if (!gc->majorOpcode) @@ -424,7 +423,7 @@ glx_context_init(__GLXcontext *gc, gc->screen = psc->scr; gc->psc = psc; - gc->mode = fbconfig; + gc->config = config; gc->isDirect = GL_TRUE; return GL_TRUE; @@ -442,7 +441,7 @@ glx_context_init(__GLXcontext *gc, static GLXContext CreateContext(Display * dpy, int generic_id, - const __GLcontextModes * const fbconfig, + struct glx_config *config, GLXContext shareList, Bool allowDirect, unsigned code, int renderType, int screen) @@ -458,10 +457,9 @@ CreateContext(Display * dpy, int generic_id, gc = NULL; if (allowDirect && psc->vtable->create_context) - gc = psc->vtable->create_context(psc, fbconfig, - shareList, renderType); + gc = psc->vtable->create_context(psc, config, shareList, renderType); if (!gc) - gc = indirect_create_context(psc, fbconfig, shareList, renderType); + gc = indirect_create_context(psc, config, shareList, renderType); if (!gc) return NULL; @@ -539,14 +537,14 @@ PUBLIC GLXContext glXCreateContext(Display * dpy, XVisualInfo * vis, GLXContext shareList, Bool allowDirect) { - const __GLcontextModes *mode = NULL; + struct glx_config *config = NULL; int renderType = 0; #if defined(GLX_DIRECT_RENDERING) || defined(GLX_USE_APPLEGL) __GLXscreenConfigs *const psc = GetGLXScreenConfigs(dpy, vis->screen); - mode = _gl_context_modes_find_visual(psc->visuals, vis->visualid); - if (mode == NULL) { + config = glx_config_find_visual(psc->visuals, vis->visualid); + if (config == NULL) { xError error; error.errorCode = BadValue; @@ -559,10 +557,10 @@ glXCreateContext(Display * dpy, XVisualInfo * vis, return None; } - renderType = mode->rgbMode ? GLX_RGBA_TYPE : GLX_COLOR_INDEX_TYPE; + renderType = config->rgbMode ? GLX_RGBA_TYPE : GLX_COLOR_INDEX_TYPE; #endif - return CreateContext(dpy, vis->visualid, mode, shareList, allowDirect, + return CreateContext(dpy, vis->visualid, config, shareList, allowDirect, X_GLXCreateContext, renderType, vis->screen); } @@ -942,11 +940,11 @@ glXCreateGLXPixmap(Display * dpy, XVisualInfo * vis, Pixmap pixmap) #ifdef GLX_USE_APPLEGL int screen = vis->screen; __GLXscreenConfigs *const psc = GetGLXScreenConfigs(dpy, screen); - const __GLcontextModes *modes; + const struct glx_config *config; - modes = _gl_context_modes_find_visual(psc->visuals, vis->visualid); + config = _gl_context_modes_find_visual(psc->visuals, vis->visualid); - if(apple_glx_pixmap_create(dpy, vis->screen, pixmap, modes)) + if(apple_glx_pixmap_create(dpy, vis->screen, pixmap, config)) return None; return pixmap; @@ -980,13 +978,13 @@ glXCreateGLXPixmap(Display * dpy, XVisualInfo * vis, Pixmap pixmap) __GLXdisplayPrivate *const priv = __glXInitialize(dpy); __GLXDRIdrawable *pdraw; __GLXscreenConfigs *psc; - __GLcontextModes *modes; + struct glx_config *config; psc = priv->screenConfigs[vis->screen]; if (psc->driScreen == NULL) break; - modes = _gl_context_modes_find_visual(psc->visuals, vis->visualid); - pdraw = psc->driScreen->createDrawable(psc, pixmap, req->glxpixmap, modes); + config = glx_config_find_visual(psc->visuals, vis->visualid); + pdraw = psc->driScreen->createDrawable(psc, pixmap, req->glxpixmap, config); if (pdraw == NULL) { fprintf(stderr, "failed to create pixmap\n"); break; @@ -1123,16 +1121,16 @@ glXGetConfig(Display * dpy, XVisualInfo * vis, int attribute, { __GLXdisplayPrivate *priv; __GLXscreenConfigs *psc; - __GLcontextModes *modes; + struct glx_config *config; int status; status = GetGLXPrivScreenConfig(dpy, vis->screen, &priv, &psc); if (status == Success) { - modes = _gl_context_modes_find_visual(psc->visuals, vis->visualid); + config = glx_config_find_visual(psc->visuals, vis->visualid); /* Lookup attribute after first finding a match on the visual */ - if (modes != NULL) { - return _gl_get_context_mode_data(modes, attribute, value_return); + if (config != NULL) { + return glx_config_get(config, attribute, value_return); } status = GLX_BAD_VISUAL; @@ -1153,10 +1151,10 @@ glXGetConfig(Display * dpy, XVisualInfo * vis, int attribute, /************************************************************************/ static void -init_fbconfig_for_chooser(__GLcontextModes * config, +init_fbconfig_for_chooser(struct glx_config * config, GLboolean fbconfig_style_tags) { - memset(config, 0, sizeof(__GLcontextModes)); + memset(config, 0, sizeof(struct glx_config)); config->visualID = (XID) GLX_DONT_CARE; config->visualType = GLX_DONT_CARE; @@ -1222,8 +1220,8 @@ init_fbconfig_for_chooser(__GLcontextModes * config, * \param b Server specified config to test against \c a. */ static Bool -fbconfigs_compatible(const __GLcontextModes * const a, - const __GLcontextModes * const b) +fbconfigs_compatible(const struct glx_config * const a, + const struct glx_config * const b) { MATCH_DONT_CARE(doubleBufferMode); MATCH_DONT_CARE(visualType); @@ -1342,8 +1340,7 @@ fbconfigs_compatible(const __GLcontextModes * const a, * \sa qsort, glXChooseVisual, glXChooseFBConfig, glXChooseFBConfigSGIX */ static int -fbconfig_compare(const __GLcontextModes * const *const a, - const __GLcontextModes * const *const b) +fbconfig_compare(struct glx_config **a, struct glx_config **b) { /* The order of these comparisons must NOT change. It is defined by * the GLX 1.3 spec and ARB_multisample. @@ -1428,10 +1425,10 @@ fbconfig_compare(const __GLcontextModes * const *const a, * \sa glXChooseVisual, glXChooseFBConfig, glXChooseFBConfigSGIX */ static int -choose_visual(__GLcontextModes ** configs, int num_configs, +choose_visual(struct glx_config ** configs, int num_configs, const int *attribList, GLboolean fbconfig_style_tags) { - __GLcontextModes test_config; + struct glx_config test_config; int base; int i; @@ -1467,7 +1464,7 @@ choose_visual(__GLcontextModes ** configs, int num_configs, * specifications. */ - qsort(configs, base, sizeof(__GLcontextModes *), + qsort(configs, base, sizeof(struct glx_config *), (int (*)(const void *, const void *)) fbconfig_compare); return base; } @@ -1485,9 +1482,9 @@ glXChooseVisual(Display * dpy, int screen, int *attribList) XVisualInfo *visualList = NULL; __GLXdisplayPrivate *priv; __GLXscreenConfigs *psc; - __GLcontextModes test_config; - __GLcontextModes *modes; - const __GLcontextModes *best_config = NULL; + struct glx_config test_config; + struct glx_config *config; + struct glx_config *best_config = NULL; /* ** Get a list of all visuals, return if list is empty @@ -1514,26 +1511,23 @@ glXChooseVisual(Display * dpy, int screen, int *attribList) ** Otherwise, create an XVisualInfo list with just the selected X visual ** and return this. */ - for (modes = psc->visuals; modes != NULL; modes = modes->next) { - if (fbconfigs_compatible(&test_config, modes) - && ((best_config == NULL) - || - (fbconfig_compare - ((const __GLcontextModes * const *const) &modes, - &best_config) < 0))) { + for (config = psc->visuals; config != NULL; config = config->next) { + if (fbconfigs_compatible(&test_config, config) + && ((best_config == NULL) || + (fbconfig_compare (&config, &best_config) < 0))) { XVisualInfo visualTemplate; XVisualInfo *newList; int i; visualTemplate.screen = screen; - visualTemplate.visualid = modes->visualID; + visualTemplate.visualid = config->visualID; newList = XGetVisualInfo(dpy, VisualScreenMask | VisualIDMask, &visualTemplate, &i); if (newList) { Xfree(visualList); visualList = newList; - best_config = modes; + best_config = config; } } } @@ -1689,7 +1683,7 @@ glXImportContextEXT(Display *dpy, GLXContextID contextID) int propList[__GLX_MAX_CONTEXT_PROPS * 2], *pProp, nPropListBytes; int i, renderType; XID share; - __GLcontextModes *mode; + struct glx_config *mode; if (contextID == None || __glXIsDirect(dpy, contextID)) return NULL; @@ -1753,10 +1747,10 @@ glXImportContextEXT(Display *dpy, GLXContextID contextID) share = pProp[1]; break; case GLX_VISUAL_ID_EXT: - mode = _gl_context_modes_find_visual(psc->visuals, pProp[1]); + mode = glx_config_find_visual(psc->visuals, pProp[1]); break; case GLX_FBCONFIG_ID: - mode = _gl_context_modes_find_fbconfig(psc->configs, pProp[1]); + mode = glx_config_find_fbconfig(psc->configs, pProp[1]); break; case GLX_RENDER_TYPE: renderType = pProp[1]; @@ -1787,13 +1781,13 @@ glXQueryContext(Display * dpy, GLXContext ctx, int attribute, int *value) *value = ctx->share_xid; break; case GLX_VISUAL_ID_EXT: - *value = ctx->mode ? ctx->mode->visualID : None; + *value = ctx->config ? ctx->config->visualID : None; break; case GLX_SCREEN: *value = ctx->screen; break; case GLX_FBCONFIG_ID: - *value = ctx->mode ? ctx->mode->fbconfigID : None; + *value = ctx->config ? ctx->config->fbconfigID : None; break; case GLX_RENDER_TYPE: *value = ctx->renderType; @@ -1825,11 +1819,11 @@ PUBLIC GLXFBConfig * glXChooseFBConfig(Display * dpy, int screen, const int *attribList, int *nitems) { - __GLcontextModes **config_list; + struct glx_config **config_list; int list_size; - config_list = (__GLcontextModes **) + config_list = (struct glx_config **) glXGetFBConfigs(dpy, screen, &list_size); if ((config_list != NULL) && (list_size > 0) && (attribList != NULL)) { @@ -1846,15 +1840,14 @@ glXChooseFBConfig(Display * dpy, int screen, PUBLIC GLXContext -glXCreateNewContext(Display * dpy, GLXFBConfig config, +glXCreateNewContext(Display * dpy, GLXFBConfig fbconfig, int renderType, GLXContext shareList, Bool allowDirect) { - const __GLcontextModes *const fbconfig = - (const __GLcontextModes *const) config; + struct glx_config *config = (struct glx_config *) fbconfig; - return CreateContext(dpy, fbconfig->fbconfigID, fbconfig, shareList, - allowDirect, X_GLXCreateNewContext, renderType, - fbconfig->screen); + return CreateContext(dpy, config->fbconfigID, config, shareList, + allowDirect, X_GLXCreateNewContext, renderType, + config->screen); } @@ -1870,7 +1863,9 @@ PUBLIC GLXFBConfig * glXGetFBConfigs(Display * dpy, int screen, int *nelements) { __GLXdisplayPrivate *priv = __glXInitialize(dpy); - __GLcontextModes **config = NULL; + struct glx_config **config_list = NULL; + struct glx_config *config; + unsigned num_configs = 0; int i; *nelements = 0; @@ -1879,58 +1874,56 @@ glXGetFBConfigs(Display * dpy, int screen, int *nelements) && (priv->screenConfigs[screen]->configs != NULL) && (priv->screenConfigs[screen]->configs->fbconfigID != (int) GLX_DONT_CARE)) { - unsigned num_configs = 0; - __GLcontextModes *modes; - - for (modes = priv->screenConfigs[screen]->configs; modes != NULL; - modes = modes->next) { - if (modes->fbconfigID != (int) GLX_DONT_CARE) { + for (config = priv->screenConfigs[screen]->configs; config != NULL; + config = config->next) { + if (config->fbconfigID != (int) GLX_DONT_CARE) { num_configs++; } } - config = (__GLcontextModes **) Xmalloc(sizeof(__GLcontextModes *) - * num_configs); - if (config != NULL) { + config_list = Xmalloc(num_configs * sizeof *config_list); + if (config_list != NULL) { *nelements = num_configs; i = 0; - for (modes = priv->screenConfigs[screen]->configs; modes != NULL; - modes = modes->next) { - if (modes->fbconfigID != (int) GLX_DONT_CARE) { - config[i] = modes; + for (config = priv->screenConfigs[screen]->configs; config != NULL; + config = config->next) { + if (config->fbconfigID != (int) GLX_DONT_CARE) { + config_list[i] = config; i++; } } } } - return (GLXFBConfig *) config; + + return (GLXFBConfig *) config_list; } PUBLIC int -glXGetFBConfigAttrib(Display * dpy, GLXFBConfig config, +glXGetFBConfigAttrib(Display * dpy, GLXFBConfig fbconfig, int attribute, int *value) { - __GLcontextModes *const modes = ValidateGLXFBConfig(dpy, config); + struct glx_config *config = ValidateGLXFBConfig(dpy, fbconfig); + + if (config == NULL) + return GLXBadFBConfig; - return (modes != NULL) - ? _gl_get_context_mode_data(modes, attribute, value) - : GLXBadFBConfig; + return glx_config_get(config, attribute, value); } PUBLIC XVisualInfo * -glXGetVisualFromFBConfig(Display * dpy, GLXFBConfig config) +glXGetVisualFromFBConfig(Display * dpy, GLXFBConfig fbconfig) { XVisualInfo visualTemplate; - __GLcontextModes *fbconfig = (__GLcontextModes *) config; + struct glx_config *config = (struct glx_config *) fbconfig; int count; /* ** Get a list of all visuals, return if list is empty */ - visualTemplate.visualid = fbconfig->visualID; + visualTemplate.visualid = config->visualID; return XGetVisualInfo(dpy, VisualIDMask, &visualTemplate, &count); } @@ -2144,7 +2137,7 @@ PUBLIC GLX_ALIAS(XVisualInfo *, glXGetVisualFromFBConfigSGIX, PUBLIC GLXPixmap glXCreateGLXPixmapWithConfigSGIX(Display * dpy, - GLXFBConfigSGIX config, + GLXFBConfigSGIX fbconfig, Pixmap pixmap) { #ifndef GLX_USE_APPLEGL @@ -2154,19 +2147,19 @@ glXCreateGLXPixmapWithConfigSGIX(Display * dpy, CARD8 opcode; __GLXscreenConfigs *psc; #endif - const __GLcontextModes *const fbconfig = (__GLcontextModes *) config; + struct glx_config *config = (struct glx_config *) fbconfig; if ((dpy == NULL) || (config == NULL)) { return None; } #ifdef GLX_USE_APPLEGL - if(apple_glx_pixmap_create(dpy, fbconfig->screen, pixmap, fbconfig)) + if(apple_glx_pixmap_create(dpy, config->screen, pixmap, config)) return None; return pixmap; #else - psc = GetGLXScreenConfigs(dpy, fbconfig->screen); + psc = GetGLXScreenConfigs(dpy, config->screen); if ((psc != NULL) && __glXExtensionBitIsEnabled(psc, SGIX_fbconfig_bit)) { opcode = __glXSetupForCommand(dpy); @@ -2183,8 +2176,8 @@ glXCreateGLXPixmapWithConfigSGIX(Display * dpy, req->reqType = opcode; req->glxCode = X_GLXVendorPrivateWithReply; req->vendorCode = X_GLXvop_CreateGLXPixmapWithConfigSGIX; - req->screen = fbconfig->screen; - req->fbconfig = fbconfig->fbconfigID; + req->screen = config->screen; + req->fbconfig = config->fbconfigID; req->pixmap = pixmap; req->glxpixmap = xid = XAllocID(dpy); UnlockDisplay(dpy); @@ -2197,11 +2190,11 @@ glXCreateGLXPixmapWithConfigSGIX(Display * dpy, PUBLIC GLXContext glXCreateContextWithConfigSGIX(Display * dpy, - GLXFBConfigSGIX config, int renderType, + GLXFBConfigSGIX fbconfig, int renderType, GLXContext shareList, Bool allowDirect) { GLXContext gc = NULL; - const __GLcontextModes *const fbconfig = (__GLcontextModes *) config; + struct glx_config *config = (struct glx_config *) fbconfig; __GLXscreenConfigs *psc; @@ -2209,13 +2202,13 @@ glXCreateContextWithConfigSGIX(Display * dpy, return None; } - psc = GetGLXScreenConfigs(dpy, fbconfig->screen); + psc = GetGLXScreenConfigs(dpy, config->screen); if ((psc != NULL) && __glXExtensionBitIsEnabled(psc, SGIX_fbconfig_bit)) { - gc = CreateContext(dpy, fbconfig->fbconfigID, fbconfig, shareList, + gc = CreateContext(dpy, config->fbconfigID, config, shareList, allowDirect, X_GLXvop_CreateContextWithConfigSGIX, renderType, - fbconfig->screen); + config->screen); } return gc; @@ -2231,8 +2224,8 @@ glXGetFBConfigFromVisualSGIX(Display * dpy, XVisualInfo * vis) if ((GetGLXPrivScreenConfig(dpy, vis->screen, &priv, &psc) != Success) && __glXExtensionBitIsEnabled(psc, SGIX_fbconfig_bit) && (psc->configs->fbconfigID != (int) GLX_DONT_CARE)) { - return (GLXFBConfigSGIX) _gl_context_modes_find_visual(psc->configs, - vis->visualid); + return (GLXFBConfigSGIX) glx_config_find_visual(psc->configs, + vis->visualid); } return NULL; diff --git a/src/glx/glxcurrent.c b/src/glx/glxcurrent.c index e8649b6765..416e9c42c5 100644 --- a/src/glx/glxcurrent.c +++ b/src/glx/glxcurrent.c @@ -303,7 +303,7 @@ FetchDRIDrawable(Display * dpy, GLXDrawable glxDrawable, GLXContext gc) return pdraw; pdraw = psc->driScreen->createDrawable(psc, glxDrawable, - glxDrawable, gc->mode); + glxDrawable, gc->config); if (__glxHashInsert(priv->drawHash, glxDrawable, pdraw)) { (*pdraw->destroyDrawable) (pdraw); return NULL; diff --git a/src/glx/glxext.c b/src/glx/glxext.c index 7612e5e834..8e8b362d10 100644 --- a/src/glx/glxext.c +++ b/src/glx/glxext.c @@ -208,14 +208,14 @@ FreeScreenConfigs(__GLXdisplayPrivate * priv) for (i = 0; i < screens; i++) { psc = priv->screenConfigs[i]; if (psc->configs) { - _gl_context_modes_destroy(psc->configs); + glx_config_destroy_list(psc->configs); if (psc->effectiveGLXexts) Xfree(psc->effectiveGLXexts); psc->configs = NULL; /* NOTE: just for paranoia */ } if (psc->visuals) { - _gl_context_modes_destroy(psc->visuals); - psc->visuals = NULL; /* NOTE: just for paranoia */ + glx_config_destroy_list(psc->visuals); + psc->visuals = NULL; /* NOTE: just for paranoia */ } Xfree((char *) psc->serverGLXexts); @@ -349,12 +349,27 @@ enum { }; +static GLint +convert_from_x_visual_type(int visualType) +{ + static const int glx_visual_types[] = { + GLX_STATIC_GRAY, GLX_GRAY_SCALE, + GLX_STATIC_COLOR, GLX_PSEUDO_COLOR, + GLX_TRUE_COLOR, GLX_DIRECT_COLOR + }; + + if (visualType < ARRAY_SIZE(glx_visual_types)) + return glx_visual_types[visualType]; + + return GLX_NONE; +} + /* * getVisualConfigs uses the !tagged_only path. * getFBConfigs uses the tagged_only path. */ _X_HIDDEN void -__glXInitializeVisualConfigFromTags(__GLcontextModes * config, int count, +__glXInitializeVisualConfigFromTags(struct glx_config * config, int count, const INT32 * bp, Bool tagged_only, Bool fbconfig_style_tags) { @@ -364,7 +379,7 @@ __glXInitializeVisualConfigFromTags(__GLcontextModes * config, int count, /* Copy in the first set of properties */ config->visualID = *bp++; - config->visualType = _gl_convert_from_x_visual_type(*bp++); + config->visualType = convert_from_x_visual_type(*bp++); config->rgbMode = *bp++; @@ -575,13 +590,13 @@ __glXInitializeVisualConfigFromTags(__GLcontextModes * config, int count, (config->rgbMode) ? GLX_RGBA_BIT : GLX_COLOR_INDEX_BIT; } -static __GLcontextModes * +static struct glx_config * createConfigsFromProperties(Display * dpy, int nvisuals, int nprops, int screen, GLboolean tagged_only) { INT32 buf[__GLX_TOTAL_CONFIG], *props; unsigned prop_size; - __GLcontextModes *modes, *m; + struct glx_config *modes, *m; int i; if (nprops == 0) @@ -594,7 +609,7 @@ createConfigsFromProperties(Display * dpy, int nvisuals, int nprops, return NULL; /* Allocate memory for our config structure */ - modes = _gl_context_modes_create(nvisuals, sizeof(__GLcontextModes)); + modes = glx_config_create_list(nvisuals); if (!modes) return NULL; -- cgit v1.2.3 From 65d98e25770487456eb3d7eb8ec3ec8272f170b1 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Wed, 28 Jul 2010 10:13:44 -0400 Subject: glx: Rename glcontextmodes.[ch] to glxconfig.[ch] --- src/glx/Makefile | 2 +- src/glx/dri_common.c | 1 - src/glx/glcontextmodes.c | 304 ----------------------------------------------- src/glx/glcontextmodes.h | 133 --------------------- src/glx/glxclient.h | 2 +- src/glx/glxcmds.c | 1 - src/glx/glxconfig.c | 304 +++++++++++++++++++++++++++++++++++++++++++++++ src/glx/glxconfig.h | 133 +++++++++++++++++++++ src/glx/glxext.c | 1 - 9 files changed, 439 insertions(+), 442 deletions(-) delete mode 100644 src/glx/glcontextmodes.c delete mode 100644 src/glx/glcontextmodes.h create mode 100644 src/glx/glxconfig.c create mode 100644 src/glx/glxconfig.h (limited to 'src/glx') diff --git a/src/glx/Makefile b/src/glx/Makefile index 48d901fb89..70def7a2fb 100644 --- a/src/glx/Makefile +++ b/src/glx/Makefile @@ -5,10 +5,10 @@ EXTRA_DEFINES = -DXF86VIDMODE -D_REENTRANT \ -DDEFAULT_DRIVER_DIR=\"$(DRI_DRIVER_SEARCH_DIR)\" SOURCES = \ - glcontextmodes.c \ clientattrib.c \ compsize.c \ eval.c \ + glxconfig.c \ glxcmds.c \ glxcurrent.c \ glxext.c \ diff --git a/src/glx/dri_common.c b/src/glx/dri_common.c index 7866521e42..812fb2eb08 100644 --- a/src/glx/dri_common.c +++ b/src/glx/dri_common.c @@ -39,7 +39,6 @@ #include #include #include "glxclient.h" -#include "glcontextmodes.h" #include "dri_common.h" #ifndef RTLD_NOW diff --git a/src/glx/glcontextmodes.c b/src/glx/glcontextmodes.c deleted file mode 100644 index 186de485ff..0000000000 --- a/src/glx/glcontextmodes.c +++ /dev/null @@ -1,304 +0,0 @@ -/* - * (C) Copyright IBM Corporation 2003 - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * on the rights to use, copy, modify, merge, publish, distribute, sub - * license, and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL - * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - * USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/** - * \file glcontextmodes.c - * Utility routines for working with \c struct glx_config structures. At - * some point most or all of these functions will be moved to the Mesa - * code base. - * - * \author Ian Romanick - */ - -#include -#include "GL/glxint.h" -#include -#include - -#include "glcontextmodes.h" - -#define NUM_VISUAL_TYPES 6 - -/** - * Get data from a GLX config - * - * \param mode GL context mode whose data is to be returned. - * \param attribute Attribute of \c mode that is to be returned. - * \param value_return Location to store the data member of \c mode. - * \return If \c attribute is a valid attribute of \c mode, zero is - * returned. Otherwise \c GLX_BAD_ATTRIBUTE is returned. - */ -_X_HIDDEN int -glx_config_get(struct glx_config * mode, int attribute, int *value_return) -{ - switch (attribute) { - case GLX_USE_GL: - *value_return = GL_TRUE; - return 0; - case GLX_BUFFER_SIZE: - *value_return = mode->rgbBits; - return 0; - case GLX_RGBA: - *value_return = mode->rgbMode; - return 0; - case GLX_RED_SIZE: - *value_return = mode->redBits; - return 0; - case GLX_GREEN_SIZE: - *value_return = mode->greenBits; - return 0; - case GLX_BLUE_SIZE: - *value_return = mode->blueBits; - return 0; - case GLX_ALPHA_SIZE: - *value_return = mode->alphaBits; - return 0; - case GLX_DOUBLEBUFFER: - *value_return = mode->doubleBufferMode; - return 0; - case GLX_STEREO: - *value_return = mode->stereoMode; - return 0; - case GLX_AUX_BUFFERS: - *value_return = mode->numAuxBuffers; - return 0; - case GLX_DEPTH_SIZE: - *value_return = mode->depthBits; - return 0; - case GLX_STENCIL_SIZE: - *value_return = mode->stencilBits; - return 0; - case GLX_ACCUM_RED_SIZE: - *value_return = mode->accumRedBits; - return 0; - case GLX_ACCUM_GREEN_SIZE: - *value_return = mode->accumGreenBits; - return 0; - case GLX_ACCUM_BLUE_SIZE: - *value_return = mode->accumBlueBits; - return 0; - case GLX_ACCUM_ALPHA_SIZE: - *value_return = mode->accumAlphaBits; - return 0; - case GLX_LEVEL: - *value_return = mode->level; - return 0; -#ifndef GLX_USE_APPLEGL /* This isn't supported by CGL. */ - case GLX_TRANSPARENT_TYPE_EXT: - *value_return = mode->transparentPixel; - return 0; -#endif - case GLX_TRANSPARENT_RED_VALUE: - *value_return = mode->transparentRed; - return 0; - case GLX_TRANSPARENT_GREEN_VALUE: - *value_return = mode->transparentGreen; - return 0; - case GLX_TRANSPARENT_BLUE_VALUE: - *value_return = mode->transparentBlue; - return 0; - case GLX_TRANSPARENT_ALPHA_VALUE: - *value_return = mode->transparentAlpha; - return 0; - case GLX_TRANSPARENT_INDEX_VALUE: - *value_return = mode->transparentIndex; - return 0; - case GLX_X_VISUAL_TYPE: - *value_return = mode->visualType; - return 0; - case GLX_CONFIG_CAVEAT: - *value_return = mode->visualRating; - return 0; - case GLX_VISUAL_ID: - *value_return = mode->visualID; - return 0; - case GLX_DRAWABLE_TYPE: - *value_return = mode->drawableType; - return 0; - case GLX_RENDER_TYPE: - *value_return = mode->renderType; - return 0; - case GLX_X_RENDERABLE: - *value_return = mode->xRenderable; - return 0; - case GLX_FBCONFIG_ID: - *value_return = mode->fbconfigID; - return 0; - case GLX_MAX_PBUFFER_WIDTH: - *value_return = mode->maxPbufferWidth; - return 0; - case GLX_MAX_PBUFFER_HEIGHT: - *value_return = mode->maxPbufferHeight; - return 0; - case GLX_MAX_PBUFFER_PIXELS: - *value_return = mode->maxPbufferPixels; - return 0; -#ifndef GLX_USE_APPLEGL /* These aren't supported by CGL. */ - case GLX_OPTIMAL_PBUFFER_WIDTH_SGIX: - *value_return = mode->optimalPbufferWidth; - return 0; - case GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX: - *value_return = mode->optimalPbufferHeight; - return 0; - case GLX_SWAP_METHOD_OML: - *value_return = mode->swapMethod; - return 0; -#endif - case GLX_SAMPLE_BUFFERS_SGIS: - *value_return = mode->sampleBuffers; - return 0; - case GLX_SAMPLES_SGIS: - *value_return = mode->samples; - return 0; - case GLX_BIND_TO_TEXTURE_RGB_EXT: - *value_return = mode->bindToTextureRgb; - return 0; - case GLX_BIND_TO_TEXTURE_RGBA_EXT: - *value_return = mode->bindToTextureRgba; - return 0; - case GLX_BIND_TO_MIPMAP_TEXTURE_EXT: - *value_return = mode->bindToMipmapTexture == GL_TRUE ? GL_TRUE : - GL_FALSE; - return 0; - case GLX_BIND_TO_TEXTURE_TARGETS_EXT: - *value_return = mode->bindToTextureTargets; - return 0; - case GLX_Y_INVERTED_EXT: - *value_return = mode->yInverted; - return 0; - - /* Applications are NOT allowed to query GLX_VISUAL_SELECT_GROUP_SGIX. - * It is ONLY for communication between the GLX client and the GLX - * server. - */ - case GLX_VISUAL_SELECT_GROUP_SGIX: - default: - return GLX_BAD_ATTRIBUTE; - } -} - - -/** - * Allocate a linked list of \c struct glx_config structures. The fields of - * each structure will be initialized to "reasonable" default values. In - * most cases this is the default value defined by table 3.4 of the GLX - * 1.3 specification. This means that most values are either initialized to - * zero or \c GLX_DONT_CARE (which is -1). As support for additional - * extensions is added, the new values will be initialized to appropriate - * values from the extension specification. - * - * \param count Number of structures to allocate. - * \param minimum_size Minimum size of a structure to allocate. This allows - * for differences in the version of the - * \c struct glx_config stucture used in libGL and in a - * DRI-based driver. - * \returns A pointer to the first element in a linked list of \c count - * stuctures on success, or \c NULL on failure. - */ -_X_HIDDEN struct glx_config * -glx_config_create_list(unsigned count) -{ - const size_t size = sizeof(struct glx_config); - struct glx_config *base = NULL; - struct glx_config **next; - unsigned i; - - next = &base; - for (i = 0; i < count; i++) { - *next = (struct glx_config *) malloc(size); - if (*next == NULL) { - glx_config_destroy_list(base); - base = NULL; - break; - } - - (void) memset(*next, 0, size); - (*next)->visualID = GLX_DONT_CARE; - (*next)->visualType = GLX_DONT_CARE; - (*next)->visualRating = GLX_NONE; - (*next)->transparentPixel = GLX_NONE; - (*next)->transparentRed = GLX_DONT_CARE; - (*next)->transparentGreen = GLX_DONT_CARE; - (*next)->transparentBlue = GLX_DONT_CARE; - (*next)->transparentAlpha = GLX_DONT_CARE; - (*next)->transparentIndex = GLX_DONT_CARE; - (*next)->xRenderable = GLX_DONT_CARE; - (*next)->fbconfigID = GLX_DONT_CARE; - (*next)->swapMethod = GLX_SWAP_UNDEFINED_OML; - (*next)->bindToTextureRgb = GLX_DONT_CARE; - (*next)->bindToTextureRgba = GLX_DONT_CARE; - (*next)->bindToMipmapTexture = GLX_DONT_CARE; - (*next)->bindToTextureTargets = GLX_DONT_CARE; - (*next)->yInverted = GLX_DONT_CARE; - - next = &((*next)->next); - } - - return base; -} - -_X_HIDDEN void -glx_config_destroy_list(struct glx_config *configs) -{ - while (configs != NULL) { - struct glx_config *const next = configs->next; - - free(configs); - configs = next; - } -} - - -/** - * Find a context mode matching a Visual ID. - * - * \param modes List list of context-mode structures to be searched. - * \param vid Visual ID to be found. - * \returns A pointer to a context-mode in \c modes if \c vid was found in - * the list, or \c NULL if it was not. - */ - -_X_HIDDEN struct glx_config * -glx_config_find_visual(struct glx_config *configs, int vid) -{ - struct glx_config *c; - - for (c = configs; c != NULL; c = c->next) - if (c->visualID == vid) - return c; - - return NULL; -} - -_X_HIDDEN struct glx_config * -glx_config_find_fbconfig(struct glx_config *configs, int fbid) -{ - struct glx_config *c; - - for (c = configs; c != NULL; c = c->next) - if (c->fbconfigID == fbid) - return c; - - return NULL; -} diff --git a/src/glx/glcontextmodes.h b/src/glx/glcontextmodes.h deleted file mode 100644 index f7ee958e4b..0000000000 --- a/src/glx/glcontextmodes.h +++ /dev/null @@ -1,133 +0,0 @@ -/* - * (C) Copyright IBM Corporation 2003 - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * on the rights to use, copy, modify, merge, publish, distribute, sub - * license, and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL - * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - * USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/** - * \file glcontextmodes.h - * \author Ian Romanick - */ - -#ifndef GLCONTEXTMODES_H -#define GLCONTEXTMODES_H - -struct glx_config { - struct glx_config * next; - - GLboolean rgbMode; - GLboolean floatMode; - GLboolean colorIndexMode; - GLuint doubleBufferMode; - GLuint stereoMode; - - GLint redBits, greenBits, blueBits, alphaBits; /* bits per comp */ - GLuint redMask, greenMask, blueMask, alphaMask; - GLint rgbBits; /* total bits for rgb */ - GLint indexBits; /* total bits for colorindex */ - - GLint accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits; - GLint depthBits; - GLint stencilBits; - - GLint numAuxBuffers; - - GLint level; - - GLint pixmapMode; - - /* GLX */ - GLint visualID; - GLint visualType; /**< One of the GLX X visual types. (i.e., - * \c GLX_TRUE_COLOR, etc.) - */ - - /* EXT_visual_rating / GLX 1.2 */ - GLint visualRating; - - /* EXT_visual_info / GLX 1.2 */ - GLint transparentPixel; - /* colors are floats scaled to ints */ - GLint transparentRed, transparentGreen, transparentBlue, transparentAlpha; - GLint transparentIndex; - - /* ARB_multisample / SGIS_multisample */ - GLint sampleBuffers; - GLint samples; - - /* SGIX_fbconfig / GLX 1.3 */ - GLint drawableType; - GLint renderType; - GLint xRenderable; - GLint fbconfigID; - - /* SGIX_pbuffer / GLX 1.3 */ - GLint maxPbufferWidth; - GLint maxPbufferHeight; - GLint maxPbufferPixels; - GLint optimalPbufferWidth; /* Only for SGIX_pbuffer. */ - GLint optimalPbufferHeight; /* Only for SGIX_pbuffer. */ - - /* SGIX_visual_select_group */ - GLint visualSelectGroup; - - /* OML_swap_method */ - GLint swapMethod; - - GLint screen; - - /* EXT_texture_from_pixmap */ - GLint bindToTextureRgb; - GLint bindToTextureRgba; - GLint bindToMipmapTexture; - GLint bindToTextureTargets; - GLint yInverted; -}; - -#define __GLX_MIN_CONFIG_PROPS 18 -#define __GLX_MAX_CONFIG_PROPS 500 -#define __GLX_EXT_CONFIG_PROPS 10 - -/* -** Since we send all non-core visual properties as token, value pairs, -** we require 2 words across the wire. In order to maintain backwards -** compatibility, we need to send the total number of words that the -** VisualConfigs are sent back in so old libraries can simply "ignore" -** the new properties. -*/ -#define __GLX_TOTAL_CONFIG \ - (__GLX_MIN_CONFIG_PROPS + 2 * __GLX_EXT_CONFIG_PROPS) - -extern GLint _gl_convert_from_x_visual_type(int visualType); - -extern int -glx_config_get(struct glx_config * mode, int attribute, int *value_return); -extern struct glx_config * -glx_config_create_list(unsigned count); -extern void -glx_config_destroy_list(struct glx_config *configs); -extern struct glx_config * -glx_config_find_visual(struct glx_config *configs, int vid); -extern struct glx_config * -glx_config_find_fbconfig(struct glx_config *configs, int fbid); - -#endif /* GLCONTEXTMODES_H */ - diff --git a/src/glx/glxclient.h b/src/glx/glxclient.h index 3a8d294dab..f8691433a6 100644 --- a/src/glx/glxclient.h +++ b/src/glx/glxclient.h @@ -51,7 +51,7 @@ #endif #include "GL/glxproto.h" #include "glapi/glapitable.h" -#include "glcontextmodes.h" +#include "glxconfig.h" #include "glxhash.h" #if defined( PTHREADS ) # include diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c index 85bfa657e0..55a736ce47 100644 --- a/src/glx/glxcmds.c +++ b/src/glx/glxcmds.c @@ -36,7 +36,6 @@ #include "glxclient.h" #include "glapi.h" #include "glxextensions.h" -#include "glcontextmodes.h" #ifdef GLX_DIRECT_RENDERING #ifdef GLX_USE_APPLEGL diff --git a/src/glx/glxconfig.c b/src/glx/glxconfig.c new file mode 100644 index 0000000000..1d9678f48c --- /dev/null +++ b/src/glx/glxconfig.c @@ -0,0 +1,304 @@ +/* + * (C) Copyright IBM Corporation 2003 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * \file glxconfig.c + * Utility routines for working with \c struct glx_config structures. At + * some point most or all of these functions will be moved to the Mesa + * code base. + * + * \author Ian Romanick + */ + +#include +#include "GL/glxint.h" +#include +#include + +#include "glxconfig.h" + +#define NUM_VISUAL_TYPES 6 + +/** + * Get data from a GLX config + * + * \param mode GL context mode whose data is to be returned. + * \param attribute Attribute of \c mode that is to be returned. + * \param value_return Location to store the data member of \c mode. + * \return If \c attribute is a valid attribute of \c mode, zero is + * returned. Otherwise \c GLX_BAD_ATTRIBUTE is returned. + */ +_X_HIDDEN int +glx_config_get(struct glx_config * mode, int attribute, int *value_return) +{ + switch (attribute) { + case GLX_USE_GL: + *value_return = GL_TRUE; + return 0; + case GLX_BUFFER_SIZE: + *value_return = mode->rgbBits; + return 0; + case GLX_RGBA: + *value_return = mode->rgbMode; + return 0; + case GLX_RED_SIZE: + *value_return = mode->redBits; + return 0; + case GLX_GREEN_SIZE: + *value_return = mode->greenBits; + return 0; + case GLX_BLUE_SIZE: + *value_return = mode->blueBits; + return 0; + case GLX_ALPHA_SIZE: + *value_return = mode->alphaBits; + return 0; + case GLX_DOUBLEBUFFER: + *value_return = mode->doubleBufferMode; + return 0; + case GLX_STEREO: + *value_return = mode->stereoMode; + return 0; + case GLX_AUX_BUFFERS: + *value_return = mode->numAuxBuffers; + return 0; + case GLX_DEPTH_SIZE: + *value_return = mode->depthBits; + return 0; + case GLX_STENCIL_SIZE: + *value_return = mode->stencilBits; + return 0; + case GLX_ACCUM_RED_SIZE: + *value_return = mode->accumRedBits; + return 0; + case GLX_ACCUM_GREEN_SIZE: + *value_return = mode->accumGreenBits; + return 0; + case GLX_ACCUM_BLUE_SIZE: + *value_return = mode->accumBlueBits; + return 0; + case GLX_ACCUM_ALPHA_SIZE: + *value_return = mode->accumAlphaBits; + return 0; + case GLX_LEVEL: + *value_return = mode->level; + return 0; +#ifndef GLX_USE_APPLEGL /* This isn't supported by CGL. */ + case GLX_TRANSPARENT_TYPE_EXT: + *value_return = mode->transparentPixel; + return 0; +#endif + case GLX_TRANSPARENT_RED_VALUE: + *value_return = mode->transparentRed; + return 0; + case GLX_TRANSPARENT_GREEN_VALUE: + *value_return = mode->transparentGreen; + return 0; + case GLX_TRANSPARENT_BLUE_VALUE: + *value_return = mode->transparentBlue; + return 0; + case GLX_TRANSPARENT_ALPHA_VALUE: + *value_return = mode->transparentAlpha; + return 0; + case GLX_TRANSPARENT_INDEX_VALUE: + *value_return = mode->transparentIndex; + return 0; + case GLX_X_VISUAL_TYPE: + *value_return = mode->visualType; + return 0; + case GLX_CONFIG_CAVEAT: + *value_return = mode->visualRating; + return 0; + case GLX_VISUAL_ID: + *value_return = mode->visualID; + return 0; + case GLX_DRAWABLE_TYPE: + *value_return = mode->drawableType; + return 0; + case GLX_RENDER_TYPE: + *value_return = mode->renderType; + return 0; + case GLX_X_RENDERABLE: + *value_return = mode->xRenderable; + return 0; + case GLX_FBCONFIG_ID: + *value_return = mode->fbconfigID; + return 0; + case GLX_MAX_PBUFFER_WIDTH: + *value_return = mode->maxPbufferWidth; + return 0; + case GLX_MAX_PBUFFER_HEIGHT: + *value_return = mode->maxPbufferHeight; + return 0; + case GLX_MAX_PBUFFER_PIXELS: + *value_return = mode->maxPbufferPixels; + return 0; +#ifndef GLX_USE_APPLEGL /* These aren't supported by CGL. */ + case GLX_OPTIMAL_PBUFFER_WIDTH_SGIX: + *value_return = mode->optimalPbufferWidth; + return 0; + case GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX: + *value_return = mode->optimalPbufferHeight; + return 0; + case GLX_SWAP_METHOD_OML: + *value_return = mode->swapMethod; + return 0; +#endif + case GLX_SAMPLE_BUFFERS_SGIS: + *value_return = mode->sampleBuffers; + return 0; + case GLX_SAMPLES_SGIS: + *value_return = mode->samples; + return 0; + case GLX_BIND_TO_TEXTURE_RGB_EXT: + *value_return = mode->bindToTextureRgb; + return 0; + case GLX_BIND_TO_TEXTURE_RGBA_EXT: + *value_return = mode->bindToTextureRgba; + return 0; + case GLX_BIND_TO_MIPMAP_TEXTURE_EXT: + *value_return = mode->bindToMipmapTexture == GL_TRUE ? GL_TRUE : + GL_FALSE; + return 0; + case GLX_BIND_TO_TEXTURE_TARGETS_EXT: + *value_return = mode->bindToTextureTargets; + return 0; + case GLX_Y_INVERTED_EXT: + *value_return = mode->yInverted; + return 0; + + /* Applications are NOT allowed to query GLX_VISUAL_SELECT_GROUP_SGIX. + * It is ONLY for communication between the GLX client and the GLX + * server. + */ + case GLX_VISUAL_SELECT_GROUP_SGIX: + default: + return GLX_BAD_ATTRIBUTE; + } +} + + +/** + * Allocate a linked list of \c struct glx_config structures. The fields of + * each structure will be initialized to "reasonable" default values. In + * most cases this is the default value defined by table 3.4 of the GLX + * 1.3 specification. This means that most values are either initialized to + * zero or \c GLX_DONT_CARE (which is -1). As support for additional + * extensions is added, the new values will be initialized to appropriate + * values from the extension specification. + * + * \param count Number of structures to allocate. + * \param minimum_size Minimum size of a structure to allocate. This allows + * for differences in the version of the + * \c struct glx_config stucture used in libGL and in a + * DRI-based driver. + * \returns A pointer to the first element in a linked list of \c count + * stuctures on success, or \c NULL on failure. + */ +_X_HIDDEN struct glx_config * +glx_config_create_list(unsigned count) +{ + const size_t size = sizeof(struct glx_config); + struct glx_config *base = NULL; + struct glx_config **next; + unsigned i; + + next = &base; + for (i = 0; i < count; i++) { + *next = (struct glx_config *) malloc(size); + if (*next == NULL) { + glx_config_destroy_list(base); + base = NULL; + break; + } + + (void) memset(*next, 0, size); + (*next)->visualID = GLX_DONT_CARE; + (*next)->visualType = GLX_DONT_CARE; + (*next)->visualRating = GLX_NONE; + (*next)->transparentPixel = GLX_NONE; + (*next)->transparentRed = GLX_DONT_CARE; + (*next)->transparentGreen = GLX_DONT_CARE; + (*next)->transparentBlue = GLX_DONT_CARE; + (*next)->transparentAlpha = GLX_DONT_CARE; + (*next)->transparentIndex = GLX_DONT_CARE; + (*next)->xRenderable = GLX_DONT_CARE; + (*next)->fbconfigID = GLX_DONT_CARE; + (*next)->swapMethod = GLX_SWAP_UNDEFINED_OML; + (*next)->bindToTextureRgb = GLX_DONT_CARE; + (*next)->bindToTextureRgba = GLX_DONT_CARE; + (*next)->bindToMipmapTexture = GLX_DONT_CARE; + (*next)->bindToTextureTargets = GLX_DONT_CARE; + (*next)->yInverted = GLX_DONT_CARE; + + next = &((*next)->next); + } + + return base; +} + +_X_HIDDEN void +glx_config_destroy_list(struct glx_config *configs) +{ + while (configs != NULL) { + struct glx_config *const next = configs->next; + + free(configs); + configs = next; + } +} + + +/** + * Find a context mode matching a Visual ID. + * + * \param modes List list of context-mode structures to be searched. + * \param vid Visual ID to be found. + * \returns A pointer to a context-mode in \c modes if \c vid was found in + * the list, or \c NULL if it was not. + */ + +_X_HIDDEN struct glx_config * +glx_config_find_visual(struct glx_config *configs, int vid) +{ + struct glx_config *c; + + for (c = configs; c != NULL; c = c->next) + if (c->visualID == vid) + return c; + + return NULL; +} + +_X_HIDDEN struct glx_config * +glx_config_find_fbconfig(struct glx_config *configs, int fbid) +{ + struct glx_config *c; + + for (c = configs; c != NULL; c = c->next) + if (c->fbconfigID == fbid) + return c; + + return NULL; +} diff --git a/src/glx/glxconfig.h b/src/glx/glxconfig.h new file mode 100644 index 0000000000..f7ee958e4b --- /dev/null +++ b/src/glx/glxconfig.h @@ -0,0 +1,133 @@ +/* + * (C) Copyright IBM Corporation 2003 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * VA LINUX SYSTEM, IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * \file glcontextmodes.h + * \author Ian Romanick + */ + +#ifndef GLCONTEXTMODES_H +#define GLCONTEXTMODES_H + +struct glx_config { + struct glx_config * next; + + GLboolean rgbMode; + GLboolean floatMode; + GLboolean colorIndexMode; + GLuint doubleBufferMode; + GLuint stereoMode; + + GLint redBits, greenBits, blueBits, alphaBits; /* bits per comp */ + GLuint redMask, greenMask, blueMask, alphaMask; + GLint rgbBits; /* total bits for rgb */ + GLint indexBits; /* total bits for colorindex */ + + GLint accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits; + GLint depthBits; + GLint stencilBits; + + GLint numAuxBuffers; + + GLint level; + + GLint pixmapMode; + + /* GLX */ + GLint visualID; + GLint visualType; /**< One of the GLX X visual types. (i.e., + * \c GLX_TRUE_COLOR, etc.) + */ + + /* EXT_visual_rating / GLX 1.2 */ + GLint visualRating; + + /* EXT_visual_info / GLX 1.2 */ + GLint transparentPixel; + /* colors are floats scaled to ints */ + GLint transparentRed, transparentGreen, transparentBlue, transparentAlpha; + GLint transparentIndex; + + /* ARB_multisample / SGIS_multisample */ + GLint sampleBuffers; + GLint samples; + + /* SGIX_fbconfig / GLX 1.3 */ + GLint drawableType; + GLint renderType; + GLint xRenderable; + GLint fbconfigID; + + /* SGIX_pbuffer / GLX 1.3 */ + GLint maxPbufferWidth; + GLint maxPbufferHeight; + GLint maxPbufferPixels; + GLint optimalPbufferWidth; /* Only for SGIX_pbuffer. */ + GLint optimalPbufferHeight; /* Only for SGIX_pbuffer. */ + + /* SGIX_visual_select_group */ + GLint visualSelectGroup; + + /* OML_swap_method */ + GLint swapMethod; + + GLint screen; + + /* EXT_texture_from_pixmap */ + GLint bindToTextureRgb; + GLint bindToTextureRgba; + GLint bindToMipmapTexture; + GLint bindToTextureTargets; + GLint yInverted; +}; + +#define __GLX_MIN_CONFIG_PROPS 18 +#define __GLX_MAX_CONFIG_PROPS 500 +#define __GLX_EXT_CONFIG_PROPS 10 + +/* +** Since we send all non-core visual properties as token, value pairs, +** we require 2 words across the wire. In order to maintain backwards +** compatibility, we need to send the total number of words that the +** VisualConfigs are sent back in so old libraries can simply "ignore" +** the new properties. +*/ +#define __GLX_TOTAL_CONFIG \ + (__GLX_MIN_CONFIG_PROPS + 2 * __GLX_EXT_CONFIG_PROPS) + +extern GLint _gl_convert_from_x_visual_type(int visualType); + +extern int +glx_config_get(struct glx_config * mode, int attribute, int *value_return); +extern struct glx_config * +glx_config_create_list(unsigned count); +extern void +glx_config_destroy_list(struct glx_config *configs); +extern struct glx_config * +glx_config_find_visual(struct glx_config *configs, int vid); +extern struct glx_config * +glx_config_find_fbconfig(struct glx_config *configs, int fbid); + +#endif /* GLCONTEXTMODES_H */ + diff --git a/src/glx/glxext.c b/src/glx/glxext.c index 8e8b362d10..b02755a6c2 100644 --- a/src/glx/glxext.c +++ b/src/glx/glxext.c @@ -47,7 +47,6 @@ #include "apple_visual.h" #endif #include "glxextensions.h" -#include "glcontextmodes.h" #ifdef USE_XCB #include -- cgit v1.2.3 From 38c51a76533a90cf2c9381c99247cfac45fe70eb Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Wed, 28 Jul 2010 10:20:41 -0400 Subject: glx: Use _X_EXPORT instead of our own PUBLIC macro We're an X client library, so we can use Xfuncproto.h. --- src/glx/XF86dri.c | 12 +------- src/glx/apple/glx_empty.c | 24 +++++++-------- src/glx/dri_glx.c | 4 +-- src/glx/glx_pbuffer.c | 28 ++++++++--------- src/glx/glxclient.h | 19 +----------- src/glx/glxcmds.c | 78 +++++++++++++++++++++++------------------------ src/glx/glxcurrent.c | 10 +++--- 7 files changed, 74 insertions(+), 101 deletions(-) (limited to 'src/glx') diff --git a/src/glx/XF86dri.c b/src/glx/XF86dri.c index 36b43f0f84..5c181d6db9 100644 --- a/src/glx/XF86dri.c +++ b/src/glx/XF86dri.c @@ -39,21 +39,11 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) #include +#include #include #include #include "xf86dristr.h" - -#if defined(__GNUC__) -# define PUBLIC __attribute__((visibility("default"))) -# define USED __attribute__((used)) -#else -# define PUBLIC -# define USED -#endif - - - static XExtensionInfo _xf86dri_info_data; static XExtensionInfo *xf86dri_info = &_xf86dri_info_data; static char xf86dri_extension_name[] = XF86DRINAME; diff --git a/src/glx/apple/glx_empty.c b/src/glx/apple/glx_empty.c index 1569679c71..5967ecabc1 100644 --- a/src/glx/apple/glx_empty.c +++ b/src/glx/apple/glx_empty.c @@ -152,7 +152,7 @@ glXReleaseBuffersMESA(Display * dpy, GLXDrawable d) } -PUBLIC GLXPixmap +_X_EXPORT GLXPixmap glXCreateGLXPixmapMESA(Display * dpy, XVisualInfo * visual, Pixmap pixmap, Colormap cmap) { @@ -180,7 +180,7 @@ glXCopySubBufferMESA(Display * dpy, GLXDrawable drawable, } -PUBLIC int +_X_EXPORT int glXQueryGLXPbufferSGIX(Display * dpy, GLXDrawable drawable, int attribute, unsigned int *value) { @@ -191,7 +191,7 @@ glXQueryGLXPbufferSGIX(Display * dpy, GLXDrawable drawable, return 0; } -PUBLIC GLXDrawable +_X_EXPORT GLXDrawable glXCreateGLXPbufferSGIX(Display * dpy, GLXFBConfig config, unsigned int width, unsigned int height, int *attrib_list) @@ -206,7 +206,7 @@ glXCreateGLXPbufferSGIX(Display * dpy, GLXFBConfig config, #if 0 /* GLX_SGIX_fbconfig */ -PUBLIC int +_X_EXPORT int glXGetFBConfigAttribSGIX(Display * dpy, void *config, int a, int *b) { (void) dpy; @@ -216,7 +216,7 @@ glXGetFBConfigAttribSGIX(Display * dpy, void *config, int a, int *b) return 0; } -PUBLIC void * +_X_EXPORT void * glXChooseFBConfigSGIX(Display * dpy, int a, int *b, int *c) { (void) dpy; @@ -226,7 +226,7 @@ glXChooseFBConfigSGIX(Display * dpy, int a, int *b, int *c) return NULL; } -PUBLIC GLXPixmap +_X_EXPORT GLXPixmap glXCreateGLXPixmapWithConfigSGIX(Display * dpy, void *config, Pixmap p) { (void) dpy; @@ -235,7 +235,7 @@ glXCreateGLXPixmapWithConfigSGIX(Display * dpy, void *config, Pixmap p) return None; } -PUBLIC GLXContext +_X_EXPORT GLXContext glXCreateContextWithConfigSGIX(Display * dpy, void *config, int a, GLXContext b, Bool c) { @@ -247,7 +247,7 @@ glXCreateContextWithConfigSGIX(Display * dpy, void *config, int a, return NULL; } -PUBLIC XVisualInfo * +_X_EXPORT XVisualInfo * glXGetVisualFromFBConfigSGIX(Display * dpy, void *config) { (void) dpy; @@ -255,7 +255,7 @@ glXGetVisualFromFBConfigSGIX(Display * dpy, void *config) return NULL; } -PUBLIC void * +_X_EXPORT void * glXGetFBConfigFromVisualSGIX(Display * dpy, XVisualInfo * visinfo) { (void) dpy; @@ -265,17 +265,17 @@ glXGetFBConfigFromVisualSGIX(Display * dpy, XVisualInfo * visinfo) #endif -PUBLIC +_X_EXPORT GLX_ALIAS_VOID(glXDestroyGLXPbufferSGIX, (Display * dpy, GLXDrawable pbuf), (dpy, pbuf), glXDestroyPbuffer) - PUBLIC GLX_ALIAS_VOID(glXSelectEventSGIX, + _X_EXPORT GLX_ALIAS_VOID(glXSelectEventSGIX, (Display * dpy, GLXDrawable drawable, unsigned long mask), (dpy, drawable, mask), glXSelectEvent) - PUBLIC GLX_ALIAS_VOID(glXGetSelectedEventSGIX, + _X_EXPORT GLX_ALIAS_VOID(glXGetSelectedEventSGIX, (Display * dpy, GLXDrawable drawable, unsigned long *mask), (dpy, drawable, mask), glXGetSelectedEvent) diff --git a/src/glx/dri_glx.c b/src/glx/dri_glx.c index 291b9aacaf..7afdc86682 100644 --- a/src/glx/dri_glx.c +++ b/src/glx/dri_glx.c @@ -151,7 +151,7 @@ driGetDriverName(Display * dpy, int scrNum, char **driverName) * The returned char pointer points to a static array that will be * overwritten by subsequent calls. */ -PUBLIC const char * +_X_EXPORT const char * glXGetScreenDriver(Display * dpy, int scrNum) { static char ret[32]; @@ -181,7 +181,7 @@ glXGetScreenDriver(Display * dpy, int scrNum) * * Note: The driver remains opened after this function returns. */ -PUBLIC const char * +_X_EXPORT const char * glXGetDriverConfig(const char *driverName) { void *handle = driOpenDriver(driverName); diff --git a/src/glx/glx_pbuffer.c b/src/glx/glx_pbuffer.c index abe618ddb3..b56dce3ef7 100644 --- a/src/glx/glx_pbuffer.c +++ b/src/glx/glx_pbuffer.c @@ -593,7 +593,7 @@ DestroyPbuffer(Display * dpy, GLXDrawable drawable) /** * Create a new pbuffer. */ -PUBLIC GLXPbufferSGIX +_X_EXPORT GLXPbufferSGIX glXCreateGLXPbufferSGIX(Display * dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list) @@ -608,7 +608,7 @@ glXCreateGLXPbufferSGIX(Display * dpy, GLXFBConfigSGIX config, /** * Create a new pbuffer. */ -PUBLIC GLXPbuffer +_X_EXPORT GLXPbuffer glXCreatePbuffer(Display * dpy, GLXFBConfig config, const int *attrib_list) { int i, width, height; @@ -683,7 +683,7 @@ glXCreatePbuffer(Display * dpy, GLXFBConfig config, const int *attrib_list) /** * Destroy an existing pbuffer. */ -PUBLIC void +_X_EXPORT void glXDestroyPbuffer(Display * dpy, GLXPbuffer pbuf) { #ifdef GLX_USE_APPLEGL @@ -699,7 +699,7 @@ glXDestroyPbuffer(Display * dpy, GLXPbuffer pbuf) /** * Query an attribute of a drawable. */ -PUBLIC void +_X_EXPORT void glXQueryDrawable(Display * dpy, GLXDrawable drawable, int attribute, unsigned int *value) { @@ -748,7 +748,7 @@ glXQueryDrawable(Display * dpy, GLXDrawable drawable, /** * Query an attribute of a pbuffer. */ -PUBLIC int +_X_EXPORT int glXQueryGLXPbufferSGIX(Display * dpy, GLXPbufferSGIX drawable, int attribute, unsigned int *value) { @@ -759,7 +759,7 @@ glXQueryGLXPbufferSGIX(Display * dpy, GLXPbufferSGIX drawable, /** * Select the event mask for a drawable. */ -PUBLIC void +_X_EXPORT void glXSelectEvent(Display * dpy, GLXDrawable drawable, unsigned long mask) { #ifdef GLX_USE_APPLEGL @@ -792,7 +792,7 @@ glXSelectEvent(Display * dpy, GLXDrawable drawable, unsigned long mask) /** * Get the selected event mask for a drawable. */ -PUBLIC void +_X_EXPORT void glXGetSelectedEvent(Display * dpy, GLXDrawable drawable, unsigned long *mask) { #ifdef GLX_USE_APPLEGL @@ -829,7 +829,7 @@ glXGetSelectedEvent(Display * dpy, GLXDrawable drawable, unsigned long *mask) } -PUBLIC GLXPixmap +_X_EXPORT GLXPixmap glXCreatePixmap(Display * dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list) { @@ -849,7 +849,7 @@ glXCreatePixmap(Display * dpy, GLXFBConfig config, Pixmap pixmap, } -PUBLIC GLXWindow +_X_EXPORT GLXWindow glXCreateWindow(Display * dpy, GLXFBConfig config, Window win, const int *attrib_list) { @@ -884,7 +884,7 @@ glXCreateWindow(Display * dpy, GLXFBConfig config, Window win, } -PUBLIC void +_X_EXPORT void glXDestroyPixmap(Display * dpy, GLXPixmap pixmap) { WARN_ONCE_GLX_1_3(dpy, __func__); @@ -897,7 +897,7 @@ glXDestroyPixmap(Display * dpy, GLXPixmap pixmap) } -PUBLIC void +_X_EXPORT void glXDestroyWindow(Display * dpy, GLXWindow win) { WARN_ONCE_GLX_1_3(dpy, __func__); @@ -907,17 +907,17 @@ glXDestroyWindow(Display * dpy, GLXWindow win) } #ifndef GLX_USE_APPLEGL -PUBLIC +_X_EXPORT GLX_ALIAS_VOID(glXDestroyGLXPbufferSGIX, (Display * dpy, GLXPbufferSGIX pbuf), (dpy, pbuf), glXDestroyPbuffer) -PUBLIC +_X_EXPORT GLX_ALIAS_VOID(glXSelectEventSGIX, (Display * dpy, GLXDrawable drawable, unsigned long mask), (dpy, drawable, mask), glXSelectEvent) -PUBLIC +_X_EXPORT GLX_ALIAS_VOID(glXGetSelectedEventSGIX, (Display * dpy, GLXDrawable drawable, unsigned long *mask), (dpy, drawable, mask), diff --git a/src/glx/glxclient.h b/src/glx/glxclient.h index f8691433a6..d6c9afc81b 100644 --- a/src/glx/glxclient.h +++ b/src/glx/glxclient.h @@ -39,6 +39,7 @@ #define _GLX_client_h_ #include #include +#include #include #define GLX_GLXEXT_PROTOTYPES #include @@ -59,21 +60,6 @@ #include "glxextensions.h" - -/* If we build the library with gcc's -fvisibility=hidden flag, we'll - * use the PUBLIC macro to mark functions that are to be exported. - * - * We also need to define a USED attribute, so the optimizer doesn't - * inline a static function that we later use in an alias. - ajax - */ -#if defined(__GNUC__) -# define PUBLIC __attribute__((visibility("default"))) -# define USED __attribute__((used)) -#else -# define PUBLIC -# define USED -#endif - #define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0])) #define GLX_MAJOR_VERSION 1 /* current version numbers */ @@ -91,9 +77,6 @@ typedef struct _glapi_table __GLapi; #ifdef GLX_DIRECT_RENDERING -#define containerOf(ptr, type, member) \ - (type *)( (char *)ptr - offsetof(type,member) ) - extern void DRI_glXUseXFont(GLXContext CC, Font font, int first, int count, int listbase); diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c index 55a736ce47..5de39f6a8d 100644 --- a/src/glx/glxcmds.c +++ b/src/glx/glxcmds.c @@ -532,7 +532,7 @@ CreateContext(Display * dpy, int generic_id, return gc; } -PUBLIC GLXContext +_X_EXPORT GLXContext glXCreateContext(Display * dpy, XVisualInfo * vis, GLXContext shareList, Bool allowDirect) { @@ -628,7 +628,7 @@ DestroyContext(Display * dpy, GLXContext gc) gc->vtable->destroy(gc); } -PUBLIC void +_X_EXPORT void glXDestroyContext(Display * dpy, GLXContext gc) { DestroyContext(dpy, gc); @@ -637,7 +637,7 @@ glXDestroyContext(Display * dpy, GLXContext gc) /* ** Return the major and minor version #s for the GLX extension */ -PUBLIC Bool +_X_EXPORT Bool glXQueryVersion(Display * dpy, int *major, int *minor) { __GLXdisplayPrivate *priv; @@ -657,7 +657,7 @@ glXQueryVersion(Display * dpy, int *major, int *minor) /* ** Query the existance of the GLX extension */ -PUBLIC Bool +_X_EXPORT Bool glXQueryExtension(Display * dpy, int *errorBase, int *eventBase) { int major_op, erb, evb; @@ -696,7 +696,7 @@ indirect_wait_gl(__GLXcontext *gc) ** Put a barrier in the token stream that forces the GL to finish its ** work before X can proceed. */ -PUBLIC void +_X_EXPORT void glXWaitGL(void) { GLXContext gc = __glXGetCurrentContext(); @@ -727,7 +727,7 @@ indirect_wait_x(__GLXcontext *gc) ** Put a barrier in the token stream that forces X to finish its ** work before GL can proceed. */ -PUBLIC void +_X_EXPORT void glXWaitX(void) { GLXContext gc = __glXGetCurrentContext(); @@ -791,7 +791,7 @@ static const struct glx_context_vtable applegl_context_vtable = { #endif -PUBLIC void +_X_EXPORT void glXUseXFont(Font font, int first, int count, int listBase) { GLXContext gc = __glXGetCurrentContext(); @@ -806,7 +806,7 @@ glXUseXFont(Font font, int first, int count, int listBase) ** Copy the source context to the destination context using the ** attribute "mask". */ -PUBLIC void +_X_EXPORT void glXCopyContext(Display * dpy, GLXContext source, GLXContext dest, unsigned long mask) { @@ -917,7 +917,7 @@ __glXIsDirect(Display * dpy, GLXContextID contextID) * \c GLX_DIRECT_RENDERING is not defined? Do we really need to bother with * the GLX protocol here at all? */ -PUBLIC Bool +_X_EXPORT Bool glXIsDirect(Display * dpy, GLXContext gc) { if (!gc) { @@ -933,7 +933,7 @@ glXIsDirect(Display * dpy, GLXContext gc) #endif } -PUBLIC GLXPixmap +_X_EXPORT GLXPixmap glXCreateGLXPixmap(Display * dpy, XVisualInfo * vis, Pixmap pixmap) { #ifdef GLX_USE_APPLEGL @@ -1003,7 +1003,7 @@ glXCreateGLXPixmap(Display * dpy, XVisualInfo * vis, Pixmap pixmap) /* ** Destroy the named pixmap */ -PUBLIC void +_X_EXPORT void glXDestroyGLXPixmap(Display * dpy, GLXPixmap glxpixmap) { #ifdef GLX_USE_APPLEGL @@ -1041,7 +1041,7 @@ glXDestroyGLXPixmap(Display * dpy, GLXPixmap glxpixmap) #endif /* GLX_USE_APPLEGL */ } -PUBLIC void +_X_EXPORT void glXSwapBuffers(Display * dpy, GLXDrawable drawable) { #ifdef GLX_USE_APPLEGL @@ -1114,7 +1114,7 @@ glXSwapBuffers(Display * dpy, GLXDrawable drawable) ** Return configuration information for the given display, screen and ** visual combination. */ -PUBLIC int +_X_EXPORT int glXGetConfig(Display * dpy, XVisualInfo * vis, int attribute, int *value_return) { @@ -1475,7 +1475,7 @@ choose_visual(struct glx_config ** configs, int num_configs, ** Return the visual that best matches the template. Return None if no ** visual matches the template. */ -PUBLIC XVisualInfo * +_X_EXPORT XVisualInfo * glXChooseVisual(Display * dpy, int screen, int *attribList) { XVisualInfo *visualList = NULL; @@ -1541,7 +1541,7 @@ glXChooseVisual(Display * dpy, int screen, int *attribList) } -PUBLIC const char * +_X_EXPORT const char * glXQueryExtensionsString(Display * dpy, int screen) { __GLXscreenConfigs *psc; @@ -1570,7 +1570,7 @@ glXQueryExtensionsString(Display * dpy, int screen) return psc->effectiveGLXexts; } -PUBLIC const char * +_X_EXPORT const char * glXGetClientString(Display * dpy, int name) { (void) dpy; @@ -1587,7 +1587,7 @@ glXGetClientString(Display * dpy, int name) } } -PUBLIC const char * +_X_EXPORT const char * glXQueryServerString(Display * dpy, int screen, int name) { __GLXscreenConfigs *psc; @@ -1657,7 +1657,7 @@ __glXClientInfo(Display * dpy, int opcode) ** EXT_import_context */ -PUBLIC Display * +_X_EXPORT Display * glXGetCurrentDisplay(void) { GLXContext gc = __glXGetCurrentContext(); @@ -1666,12 +1666,12 @@ glXGetCurrentDisplay(void) return gc->currentDpy; } -PUBLIC +_X_EXPORT GLX_ALIAS(Display *, glXGetCurrentDisplayEXT, (void), (), glXGetCurrentDisplay) #ifndef GLX_USE_APPLEGL -PUBLIC GLXContext +_X_EXPORT GLXContext glXImportContextEXT(Display *dpy, GLXContextID contextID) { __GLXdisplayPrivate *priv = __glXInitialize(dpy); @@ -1772,7 +1772,7 @@ glXImportContextEXT(Display *dpy, GLXContextID contextID) #endif -PUBLIC int +_X_EXPORT int glXQueryContext(Display * dpy, GLXContext ctx, int attribute, int *value) { switch (attribute) { @@ -1797,24 +1797,24 @@ glXQueryContext(Display * dpy, GLXContext ctx, int attribute, int *value) return Success; } -PUBLIC +_X_EXPORT GLX_ALIAS(int, glXQueryContextInfoEXT, (Display * dpy, GLXContext ctx, int attribute, int *value), (dpy, ctx, attribute, value), glXQueryContext) -PUBLIC GLXContextID glXGetContextIDEXT(const GLXContext ctx) +_X_EXPORT GLXContextID glXGetContextIDEXT(const GLXContext ctx) { return ctx->xid; } -PUBLIC void +_X_EXPORT void glXFreeContextEXT(Display * dpy, GLXContext ctx) { DestroyContext(dpy, ctx); } -PUBLIC GLXFBConfig * +_X_EXPORT GLXFBConfig * glXChooseFBConfig(Display * dpy, int screen, const int *attribList, int *nitems) { @@ -1838,7 +1838,7 @@ glXChooseFBConfig(Display * dpy, int screen, } -PUBLIC GLXContext +_X_EXPORT GLXContext glXCreateNewContext(Display * dpy, GLXFBConfig fbconfig, int renderType, GLXContext shareList, Bool allowDirect) { @@ -1850,7 +1850,7 @@ glXCreateNewContext(Display * dpy, GLXFBConfig fbconfig, } -PUBLIC GLXDrawable +_X_EXPORT GLXDrawable glXGetCurrentReadDrawable(void) { GLXContext gc = __glXGetCurrentContext(); @@ -1858,7 +1858,7 @@ glXGetCurrentReadDrawable(void) } -PUBLIC GLXFBConfig * +_X_EXPORT GLXFBConfig * glXGetFBConfigs(Display * dpy, int screen, int *nelements) { __GLXdisplayPrivate *priv = __glXInitialize(dpy); @@ -1899,7 +1899,7 @@ glXGetFBConfigs(Display * dpy, int screen, int *nelements) } -PUBLIC int +_X_EXPORT int glXGetFBConfigAttrib(Display * dpy, GLXFBConfig fbconfig, int attribute, int *value) { @@ -1912,7 +1912,7 @@ glXGetFBConfigAttrib(Display * dpy, GLXFBConfig fbconfig, } -PUBLIC XVisualInfo * +_X_EXPORT XVisualInfo * glXGetVisualFromFBConfig(Display * dpy, GLXFBConfig fbconfig) { XVisualInfo visualTemplate; @@ -2120,21 +2120,21 @@ __glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count) ** GLX_functions table. */ -PUBLIC +_X_EXPORT GLX_ALIAS(int, glXGetFBConfigAttribSGIX, (Display * dpy, GLXFBConfigSGIX config, int attribute, int *value), (dpy, config, attribute, value), glXGetFBConfigAttrib) -PUBLIC GLX_ALIAS(GLXFBConfigSGIX *, glXChooseFBConfigSGIX, +_X_EXPORT GLX_ALIAS(GLXFBConfigSGIX *, glXChooseFBConfigSGIX, (Display * dpy, int screen, int *attrib_list, int *nelements), (dpy, screen, attrib_list, nelements), glXChooseFBConfig) -PUBLIC GLX_ALIAS(XVisualInfo *, glXGetVisualFromFBConfigSGIX, +_X_EXPORT GLX_ALIAS(XVisualInfo *, glXGetVisualFromFBConfigSGIX, (Display * dpy, GLXFBConfigSGIX config), (dpy, config), glXGetVisualFromFBConfig) -PUBLIC GLXPixmap +_X_EXPORT GLXPixmap glXCreateGLXPixmapWithConfigSGIX(Display * dpy, GLXFBConfigSGIX fbconfig, Pixmap pixmap) @@ -2187,7 +2187,7 @@ glXCreateGLXPixmapWithConfigSGIX(Display * dpy, #endif } -PUBLIC GLXContext +_X_EXPORT GLXContext glXCreateContextWithConfigSGIX(Display * dpy, GLXFBConfigSGIX fbconfig, int renderType, GLXContext shareList, Bool allowDirect) @@ -2214,7 +2214,7 @@ glXCreateContextWithConfigSGIX(Display * dpy, } -PUBLIC GLXFBConfigSGIX +_X_EXPORT GLXFBConfigSGIX glXGetFBConfigFromVisualSGIX(Display * dpy, XVisualInfo * vis) { __GLXdisplayPrivate *priv; @@ -2538,7 +2538,7 @@ __glXReleaseBuffersMESA(Display * dpy, GLXDrawable d) } -PUBLIC GLXPixmap +_X_EXPORT GLXPixmap glXCreateGLXPixmapMESA(Display * dpy, XVisualInfo * visual, Pixmap pixmap, Colormap cmap) { @@ -2932,7 +2932,7 @@ get_glx_proc_address(const char *funcName) * * \sa glXGetProcAddress */ -PUBLIC void (*glXGetProcAddressARB(const GLubyte * procName)) (void) +_X_EXPORT void (*glXGetProcAddressARB(const GLubyte * procName)) (void) { typedef void (*gl_function) (void); gl_function f; @@ -2965,7 +2965,7 @@ PUBLIC void (*glXGetProcAddressARB(const GLubyte * procName)) (void) * * \sa glXGetProcAddressARB */ -PUBLIC void (*glXGetProcAddress(const GLubyte * procName)) (void) +_X_EXPORT void (*glXGetProcAddress(const GLubyte * procName)) (void) #if defined(__GNUC__) && !defined(GLX_ALIAS_UNSUPPORTED) __attribute__ ((alias("glXGetProcAddressARB"))); #else diff --git a/src/glx/glxcurrent.c b/src/glx/glxcurrent.c index 416e9c42c5..99930f691c 100644 --- a/src/glx/glxcurrent.c +++ b/src/glx/glxcurrent.c @@ -179,7 +179,7 @@ __glXSetCurrentContextNull(void) /************************************************************************/ -PUBLIC GLXContext +_X_EXPORT GLXContext glXGetCurrentContext(void) { GLXContext cx = __glXGetCurrentContext(); @@ -192,7 +192,7 @@ glXGetCurrentContext(void) } } -PUBLIC GLXDrawable +_X_EXPORT GLXDrawable glXGetCurrentDrawable(void) { GLXContext gc = __glXGetCurrentContext(); @@ -518,18 +518,18 @@ MakeContextCurrent(Display * dpy, GLXDrawable draw, } -PUBLIC Bool +_X_EXPORT Bool glXMakeCurrent(Display * dpy, GLXDrawable draw, GLXContext gc) { return MakeContextCurrent(dpy, draw, draw, gc); } -PUBLIC +_X_EXPORT GLX_ALIAS(Bool, glXMakeCurrentReadSGI, (Display * dpy, GLXDrawable d, GLXDrawable r, GLXContext ctx), (dpy, d, r, ctx), MakeContextCurrent) -PUBLIC +_X_EXPORT GLX_ALIAS(Bool, glXMakeContextCurrent, (Display * dpy, GLXDrawable d, GLXDrawable r, GLXContext ctx), (dpy, d, r, ctx), MakeContextCurrent) -- cgit v1.2.3 From 66fc35cde9ed68a09920ad6a28de794dd1d3aa8c Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Wed, 28 Jul 2010 10:28:43 -0400 Subject: glx: Rename __GLXscreenConfigs to struct glx_screen Because double underscores in private type names is painful. --- src/glx/dri2_glx.c | 12 ++++---- src/glx/dri_glx.c | 16 +++++----- src/glx/drisw_glx.c | 10 +++--- src/glx/glx_pbuffer.c | 4 +-- src/glx/glxclient.h | 31 +++++++++---------- src/glx/glxcmds.c | 82 ++++++++++++++++++++++++------------------------- src/glx/glxcurrent.c | 4 +-- src/glx/glxext.c | 22 ++++++------- src/glx/glxextensions.c | 10 +++--- src/glx/glxextensions.h | 9 +++--- 10 files changed, 99 insertions(+), 101 deletions(-) (limited to 'src/glx') diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c index 2429e0df03..6bd5d3646a 100644 --- a/src/glx/dri2_glx.c +++ b/src/glx/dri2_glx.c @@ -76,7 +76,7 @@ struct dri2_display }; struct dri2_screen { - __GLXscreenConfigs base; + struct glx_screen base; __DRIscreen *driScreen; __GLXDRIscreen vtable; @@ -155,7 +155,7 @@ dri2UnbindContext(__GLXcontext *context) } static __GLXcontext * -dri2_create_context(__GLXscreenConfigs *base, +dri2_create_context(struct glx_screen *base, struct glx_config *config_base, GLXContext shareList, int renderType) { @@ -211,7 +211,7 @@ dri2DestroyDrawable(__GLXDRIdrawable *base) } static __GLXDRIdrawable * -dri2CreateDrawable(__GLXscreenConfigs *base, XID xDrawable, +dri2CreateDrawable(struct glx_screen *base, XID xDrawable, GLXDrawable drawable, struct glx_config *config_base) { struct dri2_drawable *pdraw; @@ -288,7 +288,7 @@ dri2CreateDrawable(__GLXscreenConfigs *base, XID xDrawable, #ifdef X_DRI2GetMSC static int -dri2DrawableGetMSC(__GLXscreenConfigs *psc, __GLXDRIdrawable *pdraw, +dri2DrawableGetMSC(struct glx_screen *psc, __GLXDRIdrawable *pdraw, int64_t *ust, int64_t *msc, int64_t *sbc) { CARD64 dri2_ust, dri2_msc, dri2_sbc; @@ -442,7 +442,7 @@ dri2FlushFrontBuffer(__DRIdrawable *driDrawable, void *loaderPrivate) static void -dri2DestroyScreen(__GLXscreenConfigs *base) +dri2DestroyScreen(struct glx_screen *base) { struct dri2_screen *psc = (struct dri2_screen *) base; @@ -724,7 +724,7 @@ static const struct glx_screen_vtable dri2_screen_vtable = { dri2_create_context }; -static __GLXscreenConfigs * +static struct glx_screen * dri2CreateScreen(int screen, __GLXdisplayPrivate * priv) { const __DRIconfig **driver_configs; diff --git a/src/glx/dri_glx.c b/src/glx/dri_glx.c index 7afdc86682..b487f414dc 100644 --- a/src/glx/dri_glx.c +++ b/src/glx/dri_glx.c @@ -61,7 +61,7 @@ struct dri_display struct dri_screen { - __GLXscreenConfigs base; + struct glx_screen base; __DRIscreen *driScreen; __GLXDRIscreen vtable; @@ -226,7 +226,7 @@ __glXReportDamage(__DRIdrawable * driDraw, int i; int x_off, y_off; __GLXDRIdrawable *glxDraw = loaderPrivate; - __GLXscreenConfigs *psc = glxDraw->psc; + struct glx_screen *psc = glxDraw->psc; Display *dpy = psc->dpy; Drawable drawable; @@ -278,7 +278,7 @@ __glXDRIGetDrawableInfo(__DRIdrawable * drawable, void *loaderPrivate) { __GLXDRIdrawable *glxDraw = loaderPrivate; - __GLXscreenConfigs *psc = glxDraw->psc; + struct glx_screen *psc = glxDraw->psc; Display *dpy = psc->dpy; return XF86DRIGetDrawableInfo(dpy, psc->scr, glxDraw->drawable, @@ -550,7 +550,7 @@ static const struct glx_context_vtable dri_context_vtable = { }; static __GLXcontext * -dri_create_context(__GLXscreenConfigs *base, +dri_create_context(struct glx_screen *base, struct glx_config *config_base, GLXContext shareList, int renderType) { @@ -615,7 +615,7 @@ driDestroyDrawable(__GLXDRIdrawable * pdraw) } static __GLXDRIdrawable * -driCreateDrawable(__GLXscreenConfigs *base, +driCreateDrawable(struct glx_screen *base, XID xDrawable, GLXDrawable drawable, struct glx_config *config_base) { @@ -685,7 +685,7 @@ driCopySubBuffer(__GLXDRIdrawable * pdraw, } static void -driDestroyScreen(__GLXscreenConfigs *base) +driDestroyScreen(struct glx_screen *base) { struct dri_screen *psc = (struct dri_screen *) base; @@ -701,7 +701,7 @@ driDestroyScreen(__GLXscreenConfigs *base) #ifdef __DRI_SWAP_BUFFER_COUNTER static int -driDrawableGetMSC(__GLXscreenConfigs *base, __GLXDRIdrawable *pdraw, +driDrawableGetMSC(struct glx_screen *base, __GLXDRIdrawable *pdraw, int64_t *ust, int64_t *msc, int64_t *sbc) { struct dri_screen *psc = (struct dri_screen *) base; @@ -826,7 +826,7 @@ static const struct glx_screen_vtable dri_screen_vtable = { dri_create_context }; -static __GLXscreenConfigs * +static struct glx_screen * driCreateScreen(int screen, __GLXdisplayPrivate *priv) { struct dri_display *pdp; diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c index 39d71513a8..9d4bee91ab 100644 --- a/src/glx/drisw_glx.c +++ b/src/glx/drisw_glx.c @@ -43,7 +43,7 @@ struct drisw_context struct drisw_screen { - __GLXscreenConfigs base; + struct glx_screen base; __DRIscreen *driScreen; __GLXDRIscreen vtable; @@ -290,7 +290,7 @@ static const struct glx_context_vtable drisw_context_vtable = { }; static __GLXcontext * -drisw_create_context(__GLXscreenConfigs *base, +drisw_create_context(struct glx_screen *base, struct glx_config *config_base, GLXContext shareList, int renderType) { @@ -346,7 +346,7 @@ driDestroyDrawable(__GLXDRIdrawable * pdraw) } static __GLXDRIdrawable * -driCreateDrawable(__GLXscreenConfigs *base, XID xDrawable, +driCreateDrawable(struct glx_screen *base, XID xDrawable, GLXDrawable drawable, struct glx_config *modes) { struct drisw_drawable *pdp; @@ -402,7 +402,7 @@ driSwapBuffers(__GLXDRIdrawable * pdraw, } static void -driDestroyScreen(__GLXscreenConfigs *base) +driDestroyScreen(struct glx_screen *base) { struct drisw_screen *psc = (struct drisw_screen *) base; @@ -432,7 +432,7 @@ static const struct glx_screen_vtable drisw_screen_vtable = { drisw_create_context }; -static __GLXscreenConfigs * +static struct glx_screen * driCreateScreen(int screen, __GLXdisplayPrivate *priv) { __GLXDRIscreen *psp; diff --git a/src/glx/glx_pbuffer.c b/src/glx/glx_pbuffer.c index b56dce3ef7..bc2f1cc6c7 100644 --- a/src/glx/glx_pbuffer.c +++ b/src/glx/glx_pbuffer.c @@ -189,9 +189,9 @@ CreateDRIDrawable(Display *dpy, struct glx_config *config, { __GLXdisplayPrivate *const priv = __glXInitialize(dpy); __GLXDRIdrawable *pdraw; - __GLXscreenConfigs *psc; + struct glx_screen *psc; - psc = priv->screenConfigs[config->screen]; + psc = priv->screens[config->screen]; if (psc->driScreen == NULL) return; diff --git a/src/glx/glxclient.h b/src/glx/glxclient.h index d6c9afc81b..bde454b3e1 100644 --- a/src/glx/glxclient.h +++ b/src/glx/glxclient.h @@ -67,7 +67,6 @@ #define __GLX_MAX_TEXTURE_UNITS 32 -typedef struct __GLXscreenConfigsRec __GLXscreenConfigs; typedef struct __GLXcontextRec __GLXcontext; typedef struct __GLXdrawableRec __GLXdrawable; typedef struct __GLXdisplayPrivateRec __GLXdisplayPrivate; @@ -102,18 +101,18 @@ struct __GLXDRIdisplayRec */ void (*destroyDisplay) (__GLXDRIdisplay * display); - __GLXscreenConfigs *(*createScreen)(int screen, __GLXdisplayPrivate * priv); + struct glx_screen *(*createScreen)(int screen, __GLXdisplayPrivate * priv); }; struct __GLXDRIscreenRec { - void (*destroyScreen)(__GLXscreenConfigs *psc); + void (*destroyScreen)(struct glx_screen *psc); - __GLXcontext *(*createContext)(__GLXscreenConfigs *psc, + __GLXcontext *(*createContext)(struct glx_screen *psc, struct glx_config *config, GLXContext shareList, int renderType); - __GLXDRIdrawable *(*createDrawable)(__GLXscreenConfigs *psc, + __GLXDRIdrawable *(*createDrawable)(struct glx_screen *psc, XID drawable, GLXDrawable glxDrawable, struct glx_config *config); @@ -122,7 +121,7 @@ struct __GLXDRIscreenRec { int64_t divisor, int64_t remainder); void (*copySubBuffer)(__GLXDRIdrawable *pdraw, int x, int y, int width, int height); - int (*getDrawableMSC)(__GLXscreenConfigs *psc, __GLXDRIdrawable *pdraw, + int (*getDrawableMSC)(struct glx_screen *psc, __GLXDRIdrawable *pdraw, int64_t *ust, int64_t *msc, int64_t *sbc); int (*waitForMSC)(__GLXDRIdrawable *pdraw, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t *ust, @@ -146,7 +145,7 @@ struct __GLXDRIdrawableRec XID xDrawable; XID drawable; - __GLXscreenConfigs *psc; + struct glx_screen *psc; GLenum textureTarget; GLenum textureFormat; /* EXT_texture_from_pixmap support */ unsigned long eventMask; @@ -284,7 +283,7 @@ struct __GLXcontextRec * Screen number. */ GLint screen; - __GLXscreenConfigs *psc; + struct glx_screen *psc; /** * \c GL_TRUE if the context was created with ImportContext, which @@ -445,7 +444,7 @@ struct __GLXcontextRec extern Bool glx_context_init(__GLXcontext *gc, - __GLXscreenConfigs *psc, struct glx_config *fbconfig); + struct glx_screen *psc, struct glx_config *fbconfig); #define __glXSetError(gc,code) \ if (!(gc)->error) { \ @@ -487,12 +486,12 @@ extern void __glFreeAttributeState(__GLXcontext *); * a pointer to the config data for that screen (if the screen supports GL). */ struct glx_screen_vtable { - __GLXcontext *(*create_context)(__GLXscreenConfigs *psc, + __GLXcontext *(*create_context)(struct glx_screen *psc, struct glx_config *config, GLXContext shareList, int renderType); }; -struct __GLXscreenConfigsRec +struct glx_screen { const struct glx_screen_vtable *vtable; @@ -528,7 +527,7 @@ struct __GLXscreenConfigsRec * Per-screen dynamic GLX extension tracking. The \c direct_support * field only contains enough bits for 64 extensions. Should libGL * ever need to track more than 64 GLX extensions, we can safely grow - * this field. The \c __GLXscreenConfigs structure is not used outside + * this field. The \c struct glx_screen structure is not used outside * libGL. */ /*@{ */ @@ -584,7 +583,7 @@ struct __GLXdisplayPrivateRec * Also, per screen data which now includes the server \c GLX_EXTENSION * string. */ - __GLXscreenConfigs **screenConfigs; + struct glx_screen **screens; #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) __glxHashTable *drawHash; @@ -599,7 +598,7 @@ struct __GLXdisplayPrivateRec }; extern int -glx_screen_init(__GLXscreenConfigs *psc, +glx_screen_init(struct glx_screen *psc, int screen, __GLXdisplayPrivate * priv); #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) @@ -782,14 +781,14 @@ __glxGetMscRate(__GLXDRIdrawable *glxDraw, XExtDisplayInfo *__glXFindDisplay (Display *dpy); extern void -GarbageCollectDRIDrawables(__GLXscreenConfigs *psc); +GarbageCollectDRIDrawables(struct glx_screen *psc); extern __GLXDRIdrawable * GetGLXDRIDrawable(Display *dpy, GLXDrawable drawable); #endif -extern __GLXscreenConfigs * +extern struct glx_screen * indirect_create_screen(int screen, __GLXdisplayPrivate * priv); #endif /* !__GLX_client_h__ */ diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c index 5de39f6a8d..f418ef4a04 100644 --- a/src/glx/glxcmds.c +++ b/src/glx/glxcmds.c @@ -85,7 +85,7 @@ windowExistsErrorHandler(Display * dpy, XErrorEvent * xerr) * \param screen Screen number to destroy drawables for */ _X_HIDDEN void -GarbageCollectDRIDrawables(__GLXscreenConfigs * sc) +GarbageCollectDRIDrawables(struct glx_screen * sc) { XID draw; __GLXDRIdrawable *pdraw; @@ -156,20 +156,20 @@ GetGLXDRIDrawable(Display * dpy, GLXDrawable drawable) * number range for \c dpy? */ -static __GLXscreenConfigs * +static struct glx_screen * GetGLXScreenConfigs(Display * dpy, int scrn) { __GLXdisplayPrivate *const priv = __glXInitialize(dpy); return (priv - && priv->screenConfigs != - NULL) ? priv->screenConfigs[scrn] : NULL; + && priv->screens != + NULL) ? priv->screens[scrn] : NULL; } static int GetGLXPrivScreenConfig(Display * dpy, int scrn, __GLXdisplayPrivate ** ppriv, - __GLXscreenConfigs ** ppsc) + struct glx_screen ** ppsc) { /* Initialize the extension, if needed . This has the added value * of initializing/allocating the display private @@ -190,7 +190,7 @@ GetGLXPrivScreenConfig(Display * dpy, int scrn, __GLXdisplayPrivate ** ppriv, } /* Check to see if the GL is supported on this screen */ - *ppsc = (*ppriv)->screenConfigs[scrn]; + *ppsc = (*ppriv)->screens[scrn]; if ((*ppsc)->configs == NULL) { /* No support for GL on this screen regardless of visual */ return GLX_BAD_VISUAL; @@ -220,7 +220,7 @@ ValidateGLXFBConfig(Display * dpy, GLXFBConfig fbconfig) if (priv != NULL) { for (i = 0; i < num_screens; i++) { - for (config = priv->screenConfigs[i]->configs; config != NULL; + for (config = priv->screens[i]->configs; config != NULL; config = config->next) { if (config == (struct glx_config *) fbconfig) { return config; @@ -237,7 +237,7 @@ ValidateGLXFBConfig(Display * dpy, GLXFBConfig fbconfig) static const struct glx_context_vtable applegl_context_vtable; static __GLcontext * -applegl_create_context(__GLXscreenConfigs *psc, +applegl_create_context(struct glx_screen *psc, struct glx_config *mode, GLXContext shareList, int renderType) { @@ -293,7 +293,7 @@ applegl_create_context(__GLXscreenConfigs *psc, * does all the initialization (including the pixel pack / unpack). */ static GLXContext -indirect_create_context(__GLXscreenConfigs *psc, +indirect_create_context(struct glx_screen *psc, struct glx_config *mode, GLXContext shareList, int renderType) { @@ -395,10 +395,10 @@ struct glx_screen_vtable indirect_screen_vtable = { indirect_create_context }; -_X_HIDDEN __GLXscreenConfigs * +_X_HIDDEN struct glx_screen * indirect_create_screen(int screen, __GLXdisplayPrivate * priv) { - __GLXscreenConfigs *psc; + struct glx_screen *psc; psc = Xmalloc(sizeof *psc); if (psc == NULL) @@ -414,7 +414,7 @@ indirect_create_screen(int screen, __GLXdisplayPrivate * priv) _X_HIDDEN Bool glx_context_init(__GLXcontext *gc, - __GLXscreenConfigs *psc, struct glx_config *config) + struct glx_screen *psc, struct glx_config *config) { gc->majorOpcode = __glXSetupForCommand(psc->display->dpy); if (!gc->majorOpcode) @@ -446,7 +446,7 @@ CreateContext(Display * dpy, int generic_id, unsigned code, int renderType, int screen) { GLXContext gc = NULL; - __GLXscreenConfigs *const psc = GetGLXScreenConfigs(dpy, screen); + struct glx_screen *const psc = GetGLXScreenConfigs(dpy, screen); if (dpy == NULL) return NULL; @@ -540,7 +540,7 @@ glXCreateContext(Display * dpy, XVisualInfo * vis, int renderType = 0; #if defined(GLX_DIRECT_RENDERING) || defined(GLX_USE_APPLEGL) - __GLXscreenConfigs *const psc = GetGLXScreenConfigs(dpy, vis->screen); + struct glx_screen *const psc = GetGLXScreenConfigs(dpy, vis->screen); config = glx_config_find_visual(psc->visuals, vis->visualid); if (config == NULL) { @@ -938,7 +938,7 @@ glXCreateGLXPixmap(Display * dpy, XVisualInfo * vis, Pixmap pixmap) { #ifdef GLX_USE_APPLEGL int screen = vis->screen; - __GLXscreenConfigs *const psc = GetGLXScreenConfigs(dpy, screen); + struct glx_screen *const psc = GetGLXScreenConfigs(dpy, screen); const struct glx_config *config; config = _gl_context_modes_find_visual(psc->visuals, vis->visualid); @@ -976,10 +976,10 @@ glXCreateGLXPixmap(Display * dpy, XVisualInfo * vis, Pixmap pixmap) __GLXdisplayPrivate *const priv = __glXInitialize(dpy); __GLXDRIdrawable *pdraw; - __GLXscreenConfigs *psc; + struct glx_screen *psc; struct glx_config *config; - psc = priv->screenConfigs[vis->screen]; + psc = priv->screens[vis->screen]; if (psc->driScreen == NULL) break; config = glx_config_find_visual(psc->visuals, vis->visualid); @@ -1119,7 +1119,7 @@ glXGetConfig(Display * dpy, XVisualInfo * vis, int attribute, int *value_return) { __GLXdisplayPrivate *priv; - __GLXscreenConfigs *psc; + struct glx_screen *psc; struct glx_config *config; int status; @@ -1480,7 +1480,7 @@ glXChooseVisual(Display * dpy, int screen, int *attribList) { XVisualInfo *visualList = NULL; __GLXdisplayPrivate *priv; - __GLXscreenConfigs *psc; + struct glx_screen *psc; struct glx_config test_config; struct glx_config *config; struct glx_config *best_config = NULL; @@ -1544,7 +1544,7 @@ glXChooseVisual(Display * dpy, int screen, int *attribList) _X_EXPORT const char * glXQueryExtensionsString(Display * dpy, int screen) { - __GLXscreenConfigs *psc; + struct glx_screen *psc; __GLXdisplayPrivate *priv; if (GetGLXPrivScreenConfig(dpy, screen, &priv, &psc) != Success) { @@ -1590,7 +1590,7 @@ glXGetClientString(Display * dpy, int name) _X_EXPORT const char * glXQueryServerString(Display * dpy, int screen, int name) { - __GLXscreenConfigs *psc; + struct glx_screen *psc; __GLXdisplayPrivate *priv; const char **str; @@ -1675,7 +1675,7 @@ _X_EXPORT GLXContext glXImportContextEXT(Display *dpy, GLXContextID contextID) { __GLXdisplayPrivate *priv = __glXInitialize(dpy); - __GLXscreenConfigs *psc; + struct glx_screen *psc; xGLXQueryContextReply reply; CARD8 opcode; GLXContext ctx; @@ -1868,13 +1868,13 @@ glXGetFBConfigs(Display * dpy, int screen, int *nelements) int i; *nelements = 0; - if (priv && (priv->screenConfigs != NULL) + if (priv && (priv->screens != NULL) && (screen >= 0) && (screen <= ScreenCount(dpy)) - && (priv->screenConfigs[screen]->configs != NULL) - && (priv->screenConfigs[screen]->configs->fbconfigID + && (priv->screens[screen]->configs != NULL) + && (priv->screens[screen]->configs->fbconfigID != (int) GLX_DONT_CARE)) { - for (config = priv->screenConfigs[screen]->configs; config != NULL; + for (config = priv->screens[screen]->configs; config != NULL; config = config->next) { if (config->fbconfigID != (int) GLX_DONT_CARE) { num_configs++; @@ -1885,7 +1885,7 @@ glXGetFBConfigs(Display * dpy, int screen, int *nelements) if (config_list != NULL) { *nelements = num_configs; i = 0; - for (config = priv->screenConfigs[screen]->configs; config != NULL; + for (config = priv->screens[screen]->configs; config != NULL; config = config->next) { if (config->fbconfigID != (int) GLX_DONT_CARE) { config_list[i] = config; @@ -1935,7 +1935,7 @@ __glXSwapIntervalSGI(int interval) { xGLXVendorPrivateReq *req; GLXContext gc = __glXGetCurrentContext(); - __GLXscreenConfigs *psc; + struct glx_screen *psc; Display *dpy; CARD32 *interval_ptr; CARD8 opcode; @@ -1994,7 +1994,7 @@ __glXSwapIntervalMESA(unsigned int interval) GLXContext gc = __glXGetCurrentContext(); if (gc != NULL && gc->driContext) { - __GLXscreenConfigs *psc; + struct glx_screen *psc; psc = GetGLXScreenConfigs( gc->currentDpy, gc->screen); if (psc->driScreen && psc->driScreen->setSwapInterval) { @@ -2016,7 +2016,7 @@ __glXGetSwapIntervalMESA(void) GLXContext gc = __glXGetCurrentContext(); if (gc != NULL && gc->driContext) { - __GLXscreenConfigs *psc; + struct glx_screen *psc; psc = GetGLXScreenConfigs( gc->currentDpy, gc->screen); if (psc->driScreen && psc->driScreen->getSwapInterval) { @@ -2040,7 +2040,7 @@ __glXGetVideoSyncSGI(unsigned int *count) int64_t ust, msc, sbc; int ret; GLXContext gc = __glXGetCurrentContext(); - __GLXscreenConfigs *psc; + struct glx_screen *psc; #ifdef GLX_DIRECT_RENDERING __GLXDRIdrawable *pdraw; #endif @@ -2077,7 +2077,7 @@ static int __glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count) { GLXContext gc = __glXGetCurrentContext(); - __GLXscreenConfigs *psc; + struct glx_screen *psc; #ifdef GLX_DIRECT_RENDERING __GLXDRIdrawable *pdraw; #endif @@ -2144,7 +2144,7 @@ glXCreateGLXPixmapWithConfigSGIX(Display * dpy, xGLXCreateGLXPixmapWithConfigSGIXReq *req; GLXPixmap xid = None; CARD8 opcode; - __GLXscreenConfigs *psc; + struct glx_screen *psc; #endif struct glx_config *config = (struct glx_config *) fbconfig; @@ -2194,7 +2194,7 @@ glXCreateContextWithConfigSGIX(Display * dpy, { GLXContext gc = NULL; struct glx_config *config = (struct glx_config *) fbconfig; - __GLXscreenConfigs *psc; + struct glx_screen *psc; if ((dpy == NULL) || (config == NULL)) { @@ -2218,7 +2218,7 @@ _X_EXPORT GLXFBConfigSGIX glXGetFBConfigFromVisualSGIX(Display * dpy, XVisualInfo * vis) { __GLXdisplayPrivate *priv; - __GLXscreenConfigs *psc = NULL; + struct glx_screen *psc = NULL; if ((GetGLXPrivScreenConfig(dpy, vis->screen, &priv, &psc) != Success) && __glXExtensionBitIsEnabled(psc, SGIX_fbconfig_bit) @@ -2277,7 +2277,7 @@ __glXGetSyncValuesOML(Display * dpy, GLXDrawable drawable, #ifdef GLX_DIRECT_RENDERING __GLXDRIdrawable *pdraw; #endif - __GLXscreenConfigs *psc; + struct glx_screen *psc; if (!priv) return False; @@ -2300,7 +2300,7 @@ __glxGetMscRate(__GLXDRIdrawable *glxDraw, int32_t * numerator, int32_t * denominator) { #ifdef XF86VIDMODE - __GLXscreenConfigs *psc; + struct glx_screen *psc; XF86VidModeModeLine mode_line; int dot_clock; int i; @@ -2405,7 +2405,7 @@ __glXSwapBuffersMscOML(Display * dpy, GLXDrawable drawable, GLXContext gc = __glXGetCurrentContext(); #ifdef GLX_DIRECT_RENDERING __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable); - __GLXscreenConfigs *psc = pdraw ? pdraw->psc : NULL; + struct glx_screen *psc = pdraw ? pdraw->psc : NULL; #endif if (!gc) /* no GLX for this */ @@ -2448,7 +2448,7 @@ __glXWaitForMscOML(Display * dpy, GLXDrawable drawable, #ifdef GLX_DIRECT_RENDERING __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable); #endif - __GLXscreenConfigs *psc = pdraw ? pdraw->psc : NULL; + struct glx_screen *psc = pdraw ? pdraw->psc : NULL; int ret; @@ -2480,7 +2480,7 @@ __glXWaitForSbcOML(Display * dpy, GLXDrawable drawable, #ifdef GLX_DIRECT_RENDERING __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable); #endif - __GLXscreenConfigs *psc = pdraw ? pdraw->psc : NULL; + struct glx_screen *psc = pdraw ? pdraw->psc : NULL; int ret; /* The OML_sync_control spec says this should "generate a GLX_BAD_VALUE @@ -2570,7 +2570,7 @@ __glXCopySubBufferMESA(Display * dpy, GLXDrawable drawable, #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable); if (pdraw != NULL) { - __GLXscreenConfigs *psc = pdraw->psc; + struct glx_screen *psc = pdraw->psc; if (psc->driScreen->copySubBuffer != NULL) { glFlush(); (*psc->driScreen->copySubBuffer) (pdraw, x, y, width, height); diff --git a/src/glx/glxcurrent.c b/src/glx/glxcurrent.c index 99930f691c..f4d4f2ea29 100644 --- a/src/glx/glxcurrent.c +++ b/src/glx/glxcurrent.c @@ -290,12 +290,12 @@ FetchDRIDrawable(Display * dpy, GLXDrawable glxDrawable, GLXContext gc) { __GLXdisplayPrivate *const priv = __glXInitialize(dpy); __GLXDRIdrawable *pdraw; - __GLXscreenConfigs *psc; + struct glx_screen *psc; if (priv == NULL) return NULL; - psc = priv->screenConfigs[gc->screen]; + psc = priv->screens[gc->screen]; if (priv->drawHash == NULL) return NULL; diff --git a/src/glx/glxext.c b/src/glx/glxext.c index b02755a6c2..930709bd20 100644 --- a/src/glx/glxext.c +++ b/src/glx/glxext.c @@ -199,13 +199,13 @@ __glXEventToWire(Display *dpy, XEvent *event, xEvent *wire) static void FreeScreenConfigs(__GLXdisplayPrivate * priv) { - __GLXscreenConfigs *psc; + struct glx_screen *psc; GLint i, screens; /* Free screen configuration information */ screens = ScreenCount(priv->dpy); for (i = 0; i < screens; i++) { - psc = priv->screenConfigs[i]; + psc = priv->screens[i]; if (psc->configs) { glx_config_destroy_list(psc->configs); if (psc->effectiveGLXexts) @@ -228,8 +228,8 @@ FreeScreenConfigs(__GLXdisplayPrivate * priv) Xfree(psc); #endif } - XFree((char *) priv->screenConfigs); - priv->screenConfigs = NULL; + XFree((char *) priv->screens); + priv->screens = NULL; } /* @@ -646,7 +646,7 @@ createConfigsFromProperties(Display * dpy, int nvisuals, int nprops, } static GLboolean -getVisualConfigs(__GLXscreenConfigs *psc, +getVisualConfigs(struct glx_screen *psc, __GLXdisplayPrivate *priv, int screen) { xGLXGetVisualConfigsReq *req; @@ -675,7 +675,7 @@ getVisualConfigs(__GLXscreenConfigs *psc, } static GLboolean -getFBConfigs(__GLXscreenConfigs *psc, __GLXdisplayPrivate *priv, int screen) +getFBConfigs(struct glx_screen *psc, __GLXdisplayPrivate *priv, int screen) { xGLXGetFBConfigsReq *fb_req; xGLXGetFBConfigsSGIXReq *sgi_req; @@ -722,7 +722,7 @@ getFBConfigs(__GLXscreenConfigs *psc, __GLXdisplayPrivate *priv, int screen) } _X_HIDDEN Bool -glx_screen_init(__GLXscreenConfigs *psc, +glx_screen_init(struct glx_screen *psc, int screen, __GLXdisplayPrivate * priv) { /* Initialize per screen dynamic client GLX extensions */ @@ -744,15 +744,15 @@ glx_screen_init(__GLXscreenConfigs *psc, static Bool AllocAndFetchScreenConfigs(Display * dpy, __GLXdisplayPrivate * priv) { - __GLXscreenConfigs *psc; + struct glx_screen *psc; GLint i, screens; /* ** First allocate memory for the array of per screen configs. */ screens = ScreenCount(dpy); - priv->screenConfigs = Xmalloc(screens * sizeof *priv->screenConfigs); - if (!priv->screenConfigs) + priv->screens = Xmalloc(screens * sizeof *priv->screens); + if (!priv->screens) return GL_FALSE; priv->serverGLXversion = @@ -774,7 +774,7 @@ AllocAndFetchScreenConfigs(Display * dpy, __GLXdisplayPrivate * priv) #endif if (psc == NULL) psc = indirect_create_screen(i, priv); - priv->screenConfigs[i] = psc; + priv->screens[i] = psc; } SyncHandle(); return GL_TRUE; diff --git a/src/glx/glxextensions.c b/src/glx/glxextensions.c index 4eb6a5536a..c5ca77374f 100644 --- a/src/glx/glxextensions.c +++ b/src/glx/glxextensions.c @@ -312,7 +312,7 @@ static const unsigned gl_minor = 4; static const char *__glXGLXClientExtensions = NULL; static void __glXExtensionsCtr(void); -static void __glXExtensionsCtrScreen(__GLXscreenConfigs * psc); +static void __glXExtensionsCtrScreen(struct glx_screen * psc); static void __glXProcessServerString(const struct extension_info *ext, const char *server_string, unsigned char *server_support); @@ -396,7 +396,7 @@ __glXProcessServerString(const struct extension_info *ext, } void -__glXEnableDirectExtension(__GLXscreenConfigs * psc, const char *name) +__glXEnableDirectExtension(struct glx_screen * psc, const char *name) { __glXExtensionsCtr(); __glXExtensionsCtrScreen(psc); @@ -474,7 +474,7 @@ __glXExtensionsCtr(void) */ static void -__glXExtensionsCtrScreen(__GLXscreenConfigs * psc) +__glXExtensionsCtrScreen(struct glx_screen * psc) { if (psc->ext_list_first_time) { psc->ext_list_first_time = GL_FALSE; @@ -494,7 +494,7 @@ __glXExtensionsCtrScreen(__GLXscreenConfigs * psc) * \c NULL, then \c GL_FALSE is returned. */ GLboolean -__glXExtensionBitIsEnabled(__GLXscreenConfigs * psc, unsigned bit) +__glXExtensionBitIsEnabled(struct glx_screen * psc, unsigned bit) { GLboolean enabled = GL_FALSE; @@ -594,7 +594,7 @@ __glXGetClientExtensions(void) */ void -__glXCalculateUsableExtensions(__GLXscreenConfigs * psc, +__glXCalculateUsableExtensions(struct glx_screen * psc, GLboolean display_is_direct_capable, int minor_version) { diff --git a/src/glx/glxextensions.h b/src/glx/glxextensions.h index 4f1b6619d6..e5f0b448ef 100644 --- a/src/glx/glxextensions.h +++ b/src/glx/glxextensions.h @@ -234,13 +234,13 @@ enum #define __GL_EXT_BYTES ((__NUM_GL_EXTS + 7) / 8) -struct __GLXscreenConfigsRec; +struct glx_screen; struct __GLXcontextRec; -extern GLboolean __glXExtensionBitIsEnabled(struct __GLXscreenConfigsRec *psc, +extern GLboolean __glXExtensionBitIsEnabled(struct glx_screen *psc, unsigned bit); extern const char *__glXGetClientExtensions(void); -extern void __glXCalculateUsableExtensions(struct __GLXscreenConfigsRec *psc, +extern void __glXCalculateUsableExtensions(struct glx_screen *psc, GLboolean display_is_direct_capable, int server_minor_version); @@ -256,8 +256,7 @@ extern GLboolean __glExtensionBitIsEnabled(const struct __GLXcontextRec *gc, unsigned bit); extern void -__glXEnableDirectExtension(struct __GLXscreenConfigsRec *psc, - const char *name); +__glXEnableDirectExtension(struct glx_screen *psc, const char *name); /* Source-level backwards compatibility with old drivers. They won't * find the respective functions, though. -- cgit v1.2.3 From c356f5867f2c1fad7155df538b9affa8dbdcf869 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Wed, 28 Jul 2010 11:16:00 -0400 Subject: glx: Rename __GLXcontext and __GLXdisplayPrivate to struct types. --- src/glx/apple/glxreply.c | 6 +- src/glx/clientattrib.c | 8 +- src/glx/dri2.c | 2 +- src/glx/dri2_glx.c | 34 +- src/glx/dri_glx.c | 18 +- src/glx/drisw_glx.c | 14 +- src/glx/glx_pbuffer.c | 14 +- src/glx/glxclient.h | 78 +-- src/glx/glxcmds.c | 141 ++--- src/glx/glxcurrent.c | 34 +- src/glx/glxext.c | 38 +- src/glx/glxextensions.c | 4 +- src/glx/glxextensions.h | 6 +- src/glx/indirect.c | 1000 +++++++++++++++++----------------- src/glx/indirect.h | 6 +- src/glx/indirect_init.c | 6 +- src/glx/indirect_init.h | 2 +- src/glx/indirect_vertex_array.c | 64 +-- src/glx/indirect_vertex_program.c | 14 +- src/glx/packrender.h | 2 +- src/glx/packsingle.h | 2 +- src/glx/pixel.c | 8 +- src/glx/pixelstore.c | 6 +- src/glx/renderpix.c | 2 +- src/glx/single2.c | 12 +- src/glx/singlepix.c | 2 +- src/glx/vertarr.c | 2 +- src/glx/xfont.c | 2 +- src/mapi/glapi/gen/glX_proto_recv.py | 4 +- src/mapi/glapi/gen/glX_proto_send.py | 18 +- 30 files changed, 781 insertions(+), 768 deletions(-) (limited to 'src/glx') diff --git a/src/glx/apple/glxreply.c b/src/glx/apple/glxreply.c index 7280bc9715..f17ebe6b40 100644 --- a/src/glx/apple/glxreply.c +++ b/src/glx/apple/glxreply.c @@ -55,7 +55,7 @@ __glXReadReply(Display * dpy, size_t size, void *dest, } void -__glXReadPixelReply(Display * dpy, __GLXcontext * gc, unsigned max_dim, +__glXReadPixelReply(Display * dpy, struct glx_context * gc, unsigned max_dim, GLint width, GLint height, GLint depth, GLenum format, GLenum type, void *dest, GLboolean dimensions_in_reply) { @@ -101,7 +101,7 @@ __glXReadPixelReply(Display * dpy, __GLXcontext * gc, unsigned max_dim, #if 0 GLubyte * -__glXSetupSingleRequest(__GLXcontext * gc, GLint sop, GLint cmdlen) +__glXSetupSingleRequest(struct glx_context * gc, GLint sop, GLint cmdlen) { xGLXSingleReq *req; Display *const dpy = gc->currentDpy; @@ -117,7 +117,7 @@ __glXSetupSingleRequest(__GLXcontext * gc, GLint sop, GLint cmdlen) #endif GLubyte * -__glXSetupVendorRequest(__GLXcontext * gc, GLint code, GLint vop, +__glXSetupVendorRequest(struct glx_context * gc, GLint code, GLint vop, GLint cmdlen) { xGLXVendorPrivateReq *req; diff --git a/src/glx/clientattrib.c b/src/glx/clientattrib.c index b26c17938d..7792fa31f9 100644 --- a/src/glx/clientattrib.c +++ b/src/glx/clientattrib.c @@ -39,7 +39,7 @@ static void do_enable_disable(GLenum array, GLboolean val) { - __GLXcontext *gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); unsigned index = 0; @@ -69,7 +69,7 @@ __indirect_glDisableClientState(GLenum array) void __indirect_glPushClientAttrib(GLuint mask) { - __GLXcontext *gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); __GLXattribute **spp = gc->attributes.stackPointer, *sp; @@ -97,7 +97,7 @@ __indirect_glPushClientAttrib(GLuint mask) void __indirect_glPopClientAttrib(void) { - __GLXcontext *gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); __GLXattribute **spp = gc->attributes.stackPointer, *sp; GLuint mask; @@ -127,7 +127,7 @@ __indirect_glPopClientAttrib(void) #endif void -__glFreeAttributeState(__GLXcontext * gc) +__glFreeAttributeState(struct glx_context * gc) { __GLXattribute *sp, **spp; diff --git a/src/glx/dri2.c b/src/glx/dri2.c index f288ab8183..d70ec5a3ec 100644 --- a/src/glx/dri2.c +++ b/src/glx/dri2.c @@ -99,7 +99,7 @@ DRI2WireToEvent(Display *dpy, XEvent *event, xEvent *wire) GLXBufferSwapComplete *aevent = (GLXBufferSwapComplete *)event; xDRI2BufferSwapComplete *awire = (xDRI2BufferSwapComplete *)wire; __GLXDRIdrawable *pdraw; - __GLXdisplayPrivate *glx_dpy = __glXInitialize(dpy); + struct glx_display *glx_dpy = __glXInitialize(dpy); /* Ignore swap events if we're not looking for them */ pdraw = dri2GetGlxDrawableFromXDrawableId(dpy, awire->drawable); diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c index 6bd5d3646a..8ad0e339ed 100644 --- a/src/glx/dri2_glx.c +++ b/src/glx/dri2_glx.c @@ -94,7 +94,7 @@ struct dri2_screen { struct dri2_context { - __GLXcontext base; + struct glx_context base; __GLXDRIcontext dri_vtable; __DRIcontext *driContext; }; @@ -114,7 +114,7 @@ struct dri2_drawable static const struct glx_context_vtable dri2_context_vtable; static void -dri2_destroy_context(__GLXcontext *context) +dri2_destroy_context(struct glx_context *context) { struct dri2_context *pcp = (struct dri2_context *) context; struct dri2_screen *psc = (struct dri2_screen *) context->psc; @@ -133,7 +133,7 @@ dri2_destroy_context(__GLXcontext *context) } static Bool -dri2BindContext(__GLXcontext *context, +dri2BindContext(struct glx_context *context, __GLXDRIdrawable *draw, __GLXDRIdrawable *read) { struct dri2_context *pcp = (struct dri2_context *) context; @@ -146,7 +146,7 @@ dri2BindContext(__GLXcontext *context, } static void -dri2UnbindContext(__GLXcontext *context) +dri2UnbindContext(struct glx_context *context) { struct dri2_context *pcp = (struct dri2_context *) context; struct dri2_screen *psc = (struct dri2_screen *) pcp->base.psc; @@ -154,10 +154,10 @@ dri2UnbindContext(__GLXcontext *context) (*psc->core->unbindContext) (pcp->driContext); } -static __GLXcontext * +static struct glx_context * dri2_create_context(struct glx_screen *base, struct glx_config *config_base, - GLXContext shareList, int renderType) + struct glx_context *shareList, int renderType) { struct dri2_context *pcp, *pcp_shared; struct dri2_screen *psc = (struct dri2_screen *) base; @@ -201,7 +201,7 @@ dri2DestroyDrawable(__GLXDRIdrawable *base) { struct dri2_screen *psc = (struct dri2_screen *) base->psc; struct dri2_drawable *pdraw = (struct dri2_drawable *) base; - __GLXdisplayPrivate *dpyPriv = psc->base.display; + struct glx_display *dpyPriv = psc->base.display; struct dri2_display *pdp = (struct dri2_display *)dpyPriv->dri2Display; __glxHashDelete(pdp->dri2Hash, pdraw->base.xDrawable); @@ -217,7 +217,7 @@ dri2CreateDrawable(struct glx_screen *base, XID xDrawable, struct dri2_drawable *pdraw; struct dri2_screen *psc = (struct dri2_screen *) base; __GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) config_base; - __GLXdisplayPrivate *dpyPriv; + struct glx_display *dpyPriv; struct dri2_display *pdp; GLint vblank_mode = DRI_CONF_VBLANK_DEF_INTERVAL_1; @@ -402,7 +402,7 @@ dri2_copy_drawable(struct dri2_drawable *priv, int dest, int src) } static void -dri2_wait_x(__GLXcontext *gc) +dri2_wait_x(struct glx_context *gc) { struct dri2_drawable *priv = (struct dri2_drawable *) GetGLXDRIDrawable(gc->currentDpy, gc->currentDrawable); @@ -414,7 +414,7 @@ dri2_wait_x(__GLXcontext *gc) } static void -dri2_wait_gl(__GLXcontext *gc) +dri2_wait_gl(struct glx_context *gc) { struct dri2_drawable *priv = (struct dri2_drawable *) GetGLXDRIDrawable(gc->currentDpy, gc->currentDrawable); @@ -429,9 +429,9 @@ static void dri2FlushFrontBuffer(__DRIdrawable *driDrawable, void *loaderPrivate) { struct dri2_drawable *pdraw = loaderPrivate; - __GLXdisplayPrivate *priv = __glXInitialize(pdraw->base.psc->dpy); + struct glx_display *priv = __glXInitialize(pdraw->base.psc->dpy); struct dri2_display *pdp = (struct dri2_display *)priv->dri2Display; - GLXContext gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); /* Old servers don't send invalidate events */ if (!pdp->invalidateAvailable) @@ -490,7 +490,7 @@ dri2SwapBuffers(__GLXDRIdrawable *pdraw, int64_t target_msc, int64_t divisor, int64_t remainder) { struct dri2_drawable *priv = (struct dri2_drawable *) pdraw; - __GLXdisplayPrivate *dpyPriv = __glXInitialize(priv->base.psc->dpy); + struct glx_display *dpyPriv = __glXInitialize(priv->base.psc->dpy); struct dri2_screen *psc = (struct dri2_screen *) priv->base.psc; struct dri2_display *pdp = (struct dri2_display *)dpyPriv->dri2Display; @@ -646,10 +646,10 @@ dri2_bind_tex_image(Display * dpy, GLXDrawable drawable, int buffer, const int *attrib_list) { - GLXContext gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); struct dri2_context *pcp = (struct dri2_context *) gc; __GLXDRIdrawable *base = GetGLXDRIDrawable(dpy, drawable); - __GLXdisplayPrivate *dpyPriv = __glXInitialize(dpy); + struct glx_display *dpyPriv = __glXInitialize(dpy); struct dri2_drawable *pdraw = (struct dri2_drawable *) base; struct dri2_display *pdp = (struct dri2_display *) dpyPriv->dri2Display; @@ -725,7 +725,7 @@ static const struct glx_screen_vtable dri2_screen_vtable = { }; static struct glx_screen * -dri2CreateScreen(int screen, __GLXdisplayPrivate * priv) +dri2CreateScreen(int screen, struct glx_display * priv) { const __DRIconfig **driver_configs; const __DRIextension **extensions; @@ -876,7 +876,7 @@ dri2DestroyDisplay(__GLXDRIdisplay * dpy) _X_HIDDEN __GLXDRIdrawable * dri2GetGlxDrawableFromXDrawableId(Display *dpy, XID id) { - __GLXdisplayPrivate *d = __glXInitialize(dpy); + struct glx_display *d = __glXInitialize(dpy); struct dri2_display *pdp = (struct dri2_display *) d->dri2Display; __GLXDRIdrawable *pdraw; diff --git a/src/glx/dri_glx.c b/src/glx/dri_glx.c index b487f414dc..70281f663e 100644 --- a/src/glx/dri_glx.c +++ b/src/glx/dri_glx.c @@ -78,7 +78,7 @@ struct dri_screen struct dri_context { - __GLXcontext base; + struct glx_context base; __GLXDRIcontext dri_vtable; __DRIcontext *driContext; XID hwContextID; @@ -499,7 +499,7 @@ CallCreateNewScreen(Display *dpy, int scrn, struct dri_screen *psc, } static void -dri_destroy_context(__GLXcontext * context) +dri_destroy_context(struct glx_context * context) { struct dri_context *pcp = (struct dri_context *) context; struct dri_screen *psc = (struct dri_screen *) context->psc; @@ -519,7 +519,7 @@ dri_destroy_context(__GLXcontext * context) } static Bool -driBindContext(__GLXcontext *context, +driBindContext(struct glx_context *context, __GLXDRIdrawable *draw, __GLXDRIdrawable *read) { struct dri_context *pcp = (struct dri_context *) context; @@ -532,7 +532,7 @@ driBindContext(__GLXcontext *context, } static void -driUnbindContext(__GLXcontext * context) +driUnbindContext(struct glx_context * context) { struct dri_context *pcp = (struct dri_context *) context; struct dri_screen *psc = (struct dri_screen *) pcp->base.psc; @@ -549,10 +549,10 @@ static const struct glx_context_vtable dri_context_vtable = { NULL, }; -static __GLXcontext * +static struct glx_context * dri_create_context(struct glx_screen *base, struct glx_config *config_base, - GLXContext shareList, int renderType) + struct glx_context *shareList, int renderType) { struct dri_context *pcp, *pcp_shared; struct dri_screen *psc = (struct dri_screen *) base; @@ -756,7 +756,7 @@ driWaitForSBC(__GLXDRIdrawable *pdraw, int64_t target_sbc, int64_t *ust, static int driSetSwapInterval(__GLXDRIdrawable *pdraw, int interval) { - GLXContext gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); struct dri_drawable *pdp = (struct dri_drawable *) pdraw; struct dri_screen *psc; @@ -775,7 +775,7 @@ driSetSwapInterval(__GLXDRIdrawable *pdraw, int interval) static int driGetSwapInterval(__GLXDRIdrawable *pdraw) { - GLXContext gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); struct dri_drawable *pdp = (struct dri_drawable *) pdraw; struct dri_screen *psc; @@ -827,7 +827,7 @@ static const struct glx_screen_vtable dri_screen_vtable = { }; static struct glx_screen * -driCreateScreen(int screen, __GLXdisplayPrivate *priv) +driCreateScreen(int screen, struct glx_display *priv) { struct dri_display *pdp; __GLXDRIscreen *psp; diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c index 9d4bee91ab..070c9d612b 100644 --- a/src/glx/drisw_glx.c +++ b/src/glx/drisw_glx.c @@ -35,7 +35,7 @@ struct drisw_display struct drisw_context { - __GLXcontext base; + struct glx_context base; __GLXDRIcontext dri_vtable; __DRIcontext *driContext; @@ -240,7 +240,7 @@ static const __DRIextension *loader_extensions[] = { */ static void -drisw_destroy_context(__GLXcontext *context) +drisw_destroy_context(struct glx_context *context) { struct drisw_context *pcp = (struct drisw_context *) context; struct drisw_screen *psc = (struct drisw_screen *) context->psc; @@ -259,7 +259,7 @@ drisw_destroy_context(__GLXcontext *context) } static Bool -driBindContext(__GLXcontext * context, +driBindContext(struct glx_context * context, __GLXDRIdrawable * draw, __GLXDRIdrawable * read) { struct drisw_context *pcp = (struct drisw_context *) context; @@ -272,7 +272,7 @@ driBindContext(__GLXcontext * context, } static void -driUnbindContext(__GLXcontext * context) +driUnbindContext(struct glx_context * context) { struct drisw_context *pcp = (struct drisw_context *) context; struct drisw_screen *psc = (struct drisw_screen *) pcp->base.psc; @@ -289,10 +289,10 @@ static const struct glx_context_vtable drisw_context_vtable = { NULL, }; -static __GLXcontext * +static struct glx_context * drisw_create_context(struct glx_screen *base, struct glx_config *config_base, - GLXContext shareList, int renderType) + struct glx_context *shareList, int renderType) { struct drisw_context *pcp, *pcp_shared; __GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) config_base; @@ -433,7 +433,7 @@ static const struct glx_screen_vtable drisw_screen_vtable = { }; static struct glx_screen * -driCreateScreen(int screen, __GLXdisplayPrivate *priv) +driCreateScreen(int screen, struct glx_display *priv) { __GLXDRIscreen *psp; const __DRIconfig **driver_configs; diff --git a/src/glx/glx_pbuffer.c b/src/glx/glx_pbuffer.c index bc2f1cc6c7..15bfb15919 100644 --- a/src/glx/glx_pbuffer.c +++ b/src/glx/glx_pbuffer.c @@ -57,7 +57,7 @@ static void warn_GLX_1_3(Display * dpy, const char *function_name) { - __GLXdisplayPrivate *priv = __glXInitialize(dpy); + struct glx_display *priv = __glXInitialize(dpy); if (priv->minorVersion < 3) { fprintf(stderr, @@ -85,7 +85,7 @@ static void ChangeDrawableAttribute(Display * dpy, GLXDrawable drawable, const CARD32 * attribs, size_t num_attribs) { - __GLXdisplayPrivate *priv = __glXInitialize(dpy); + struct glx_display *priv = __glXInitialize(dpy); __GLXDRIdrawable *pdraw; CARD32 *output; CARD8 opcode; @@ -187,7 +187,7 @@ CreateDRIDrawable(Display *dpy, struct glx_config *config, XID drawable, XID glxdrawable, const int *attrib_list, size_t num_attribs) { - __GLXdisplayPrivate *const priv = __glXInitialize(dpy); + struct glx_display *const priv = __glXInitialize(dpy); __GLXDRIdrawable *pdraw; struct glx_screen *psc; @@ -214,7 +214,7 @@ CreateDRIDrawable(Display *dpy, struct glx_config *config, static void DestroyDRIDrawable(Display *dpy, GLXDrawable drawable, int destroy_xdrawable) { - __GLXdisplayPrivate *const priv = __glXInitialize(dpy); + struct glx_display *const priv = __glXInitialize(dpy); __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable); if (pdraw != NULL) { @@ -263,7 +263,7 @@ static int GetDrawableAttribute(Display * dpy, GLXDrawable drawable, int attribute, unsigned int *value) { - __GLXdisplayPrivate *priv; + struct glx_display *priv; xGLXGetDrawableAttributesReply reply; CARD32 *data; CARD8 opcode; @@ -461,7 +461,7 @@ CreatePbuffer(Display * dpy, struct glx_config *config, unsigned int width, unsigned int height, const int *attrib_list, GLboolean size_in_attribs) { - __GLXdisplayPrivate *priv = __glXInitialize(dpy); + struct glx_display *priv = __glXInitialize(dpy); GLXDrawable id = 0; CARD32 *data; CARD8 opcode; @@ -547,7 +547,7 @@ CreatePbuffer(Display * dpy, struct glx_config *config, static void DestroyPbuffer(Display * dpy, GLXDrawable drawable) { - __GLXdisplayPrivate *priv = __glXInitialize(dpy); + struct glx_display *priv = __glXInitialize(dpy); CARD8 opcode; if ((dpy == NULL) || (drawable == 0)) { diff --git a/src/glx/glxclient.h b/src/glx/glxclient.h index bde454b3e1..4f5c02fc34 100644 --- a/src/glx/glxclient.h +++ b/src/glx/glxclient.h @@ -67,16 +67,14 @@ #define __GLX_MAX_TEXTURE_UNITS 32 -typedef struct __GLXcontextRec __GLXcontext; -typedef struct __GLXdrawableRec __GLXdrawable; -typedef struct __GLXdisplayPrivateRec __GLXdisplayPrivate; -typedef struct _glapi_table __GLapi; +struct glx_display; +struct glx_context; /************************************************************************/ #ifdef GLX_DIRECT_RENDERING -extern void DRI_glXUseXFont(GLXContext CC, +extern void DRI_glXUseXFont(struct glx_context *ctx, Font font, int first, int count, int listbase); #endif @@ -101,16 +99,17 @@ struct __GLXDRIdisplayRec */ void (*destroyDisplay) (__GLXDRIdisplay * display); - struct glx_screen *(*createScreen)(int screen, __GLXdisplayPrivate * priv); + struct glx_screen *(*createScreen)(int screen, struct glx_display * priv); }; struct __GLXDRIscreenRec { void (*destroyScreen)(struct glx_screen *psc); - __GLXcontext *(*createContext)(struct glx_screen *psc, - struct glx_config *config, - GLXContext shareList, int renderType); + struct glx_context *(*createContext)(struct glx_screen *psc, + struct glx_config *config, + struct glx_context *shareList, + int renderType); __GLXDRIdrawable *(*createDrawable)(struct glx_screen *psc, XID drawable, @@ -134,9 +133,9 @@ struct __GLXDRIscreenRec { struct __GLXDRIcontextRec { - Bool(*bindContext) (__GLXcontext *context, __GLXDRIdrawable *pdraw, + Bool(*bindContext) (struct glx_context *context, __GLXDRIdrawable *pdraw, __GLXDRIdrawable *pread); - void (*unbindContext) (__GLXcontext *context); + void (*unbindContext) (struct glx_context *context); }; struct __GLXDRIdrawableRec @@ -221,10 +220,10 @@ typedef struct __GLXattributeMachineRec } __GLXattributeMachine; struct glx_context_vtable { - void (*destroy)(__GLXcontext *ctx); - void (*wait_gl)(__GLXcontext *ctx); - void (*wait_x)(__GLXcontext *ctx); - void (*use_x_font)(__GLXcontext *ctx, + void (*destroy)(struct glx_context *ctx); + void (*wait_gl)(struct glx_context *ctx); + void (*wait_x)(struct glx_context *ctx); + void (*use_x_font)(struct glx_context *ctx, Font font, int first, int count, int listBase); void (*bind_tex_image)(Display * dpy, GLXDrawable drawable, @@ -240,7 +239,7 @@ glx_send_destroy_context(Display *dpy, XID xid); * 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. */ -struct __GLXcontextRec +struct glx_context { /** * \name Drawing command buffer. @@ -326,7 +325,7 @@ struct __GLXcontextRec * Fill newImage with the unpacked form of \c oldImage getting it * ready for transport to the server. */ - void (*fillImage) (__GLXcontext *, GLint, GLint, GLint, GLint, GLenum, + void (*fillImage) (struct glx_context *, GLint, GLint, GLint, GLint, GLenum, GLenum, const GLvoid *, GLubyte *, GLubyte *); /** @@ -443,7 +442,7 @@ struct __GLXcontextRec }; extern Bool -glx_context_init(__GLXcontext *gc, +glx_context_init(struct glx_context *gc, struct glx_screen *psc, struct glx_config *fbconfig); #define __glXSetError(gc,code) \ @@ -451,7 +450,7 @@ glx_context_init(__GLXcontext *gc, (gc)->error = code; \ } -extern void __glFreeAttributeState(__GLXcontext *); +extern void __glFreeAttributeState(struct glx_context *); /************************************************************************/ @@ -486,9 +485,10 @@ extern void __glFreeAttributeState(__GLXcontext *); * a pointer to the config data for that screen (if the screen supports GL). */ struct glx_screen_vtable { - __GLXcontext *(*create_context)(struct glx_screen *psc, - struct glx_config *config, - GLXContext shareList, int renderType); + struct glx_context *(*create_context)(struct glx_screen *psc, + struct glx_config *config, + struct glx_context *shareList, + int renderType); }; struct glx_screen @@ -506,7 +506,7 @@ struct glx_screen */ char *effectiveGLXexts; - __GLXdisplayPrivate *display; + struct glx_display *display; #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) /** @@ -541,11 +541,11 @@ struct glx_screen * Per display private data. One of these records exists for each display * that is using the OpenGL (GLX) extension. */ -struct __GLXdisplayPrivateRec +struct glx_display { /* The extension protocol codes */ XExtCodes *codes; - struct __GLXdisplayPrivateRec *next; + struct glx_display *next; /** * Back pointer to the display @@ -599,24 +599,24 @@ struct __GLXdisplayPrivateRec extern int glx_screen_init(struct glx_screen *psc, - int screen, __GLXdisplayPrivate * priv); + int screen, struct glx_display * priv); #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) extern __GLXDRIdrawable * dri2GetGlxDrawableFromXDrawableId(Display *dpy, XID id); #endif -extern GLubyte *__glXFlushRenderBuffer(__GLXcontext *, GLubyte *); +extern GLubyte *__glXFlushRenderBuffer(struct glx_context *, GLubyte *); -extern void __glXSendLargeChunk(__GLXcontext * gc, GLint requestNumber, +extern void __glXSendLargeChunk(struct glx_context * gc, GLint requestNumber, GLint totalRequests, const GLvoid * data, GLint dataLen); -extern void __glXSendLargeCommand(__GLXcontext *, const GLvoid *, GLint, +extern void __glXSendLargeCommand(struct glx_context *, const GLvoid *, GLint, const GLvoid *, GLint); /* Initialize the GLX extension for dpy */ -extern __GLXdisplayPrivate *__glXInitialize(Display *); +extern struct glx_display *__glXInitialize(Display *); extern void __glXPreferEGL(int state); @@ -627,7 +627,7 @@ extern int __glXDebug; /* This is per-thread storage in an MT environment */ #if defined( PTHREADS ) -extern void __glXSetCurrentContext(__GLXcontext * c); +extern void __glXSetCurrentContext(struct glx_context * c); # if defined( GLX_USE_TLS ) @@ -638,13 +638,13 @@ extern __thread void *__glX_tls_Context # else -extern __GLXcontext *__glXGetCurrentContext(void); +extern struct glx_context *__glXGetCurrentContext(void); # endif /* defined( GLX_USE_TLS ) */ #else -extern __GLXcontext *__glXcurrentContext; +extern struct glx_context *__glXcurrentContext; #define __glXGetCurrentContext() __glXcurrentContext #define __glXSetCurrentContext(gc) __glXcurrentContext = gc @@ -680,7 +680,7 @@ extern CARD8 __glXSetupForCommand(Display * dpy); extern const GLuint __glXDefaultPixelStore[9]; /* Send an image to the server using RenderLarge. */ -extern void __glXSendLargeImage(__GLXcontext * gc, GLint compsize, GLint dim, +extern void __glXSendLargeImage(struct glx_context * gc, GLint compsize, GLint dim, GLint width, GLint height, GLint depth, GLenum format, GLenum type, const GLvoid * src, GLubyte * pc, @@ -704,7 +704,7 @@ extern GLint __glBytesPerElement(GLenum type); ** updated to contain the modes needed by the server to decode the ** sent data. */ -extern void __glFillImage(__GLXcontext *, GLint, GLint, GLint, GLint, GLenum, +extern void __glFillImage(struct glx_context *, GLint, GLint, GLint, GLint, GLenum, GLenum, const GLvoid *, GLubyte *, GLubyte *); /* Copy map data with a stride into a packed buffer */ @@ -719,15 +719,15 @@ extern void __glFillMap2d(GLint, GLint, GLint, GLint, GLint, ** Empty an image out of the reply buffer into the clients memory applying ** the pack modes to pack back into the clients requested format. */ -extern void __glEmptyImage(__GLXcontext *, GLint, GLint, GLint, GLint, GLenum, +extern void __glEmptyImage(struct glx_context *, GLint, GLint, GLint, GLint, GLenum, GLenum, const GLubyte *, GLvoid *); /* ** Allocate and Initialize Vertex Array client state, and free. */ -extern void __glXInitVertexArrayState(__GLXcontext *); -extern void __glXFreeVertexArrayState(__GLXcontext *); +extern void __glXInitVertexArrayState(struct glx_context *); +extern void __glXFreeVertexArrayState(struct glx_context *); /* ** Inform the Server of the major and minor numbers and of the client @@ -789,6 +789,6 @@ GetGLXDRIDrawable(Display *dpy, GLXDrawable drawable); #endif extern struct glx_screen * -indirect_create_screen(int screen, __GLXdisplayPrivate * priv); +indirect_create_screen(int screen, struct glx_display * priv); #endif /* !__GLX_client_h__ */ diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c index f418ef4a04..f2081fdd2c 100644 --- a/src/glx/glxcmds.c +++ b/src/glx/glxcmds.c @@ -89,7 +89,7 @@ GarbageCollectDRIDrawables(struct glx_screen * sc) { XID draw; __GLXDRIdrawable *pdraw; - __GLXdisplayPrivate *priv = sc->display; + struct glx_display *priv = sc->display; XWindowAttributes xwa; int (*oldXErrorHandler) (Display *, XErrorEvent *); @@ -127,7 +127,7 @@ GarbageCollectDRIDrawables(struct glx_screen * sc) _X_HIDDEN __GLXDRIdrawable * GetGLXDRIDrawable(Display * dpy, GLXDrawable drawable) { - __GLXdisplayPrivate *priv = __glXInitialize(dpy); + struct glx_display *priv = __glXInitialize(dpy); __GLXDRIdrawable *pdraw; if (priv == NULL) @@ -159,7 +159,7 @@ GetGLXDRIDrawable(Display * dpy, GLXDrawable drawable) static struct glx_screen * GetGLXScreenConfigs(Display * dpy, int scrn) { - __GLXdisplayPrivate *const priv = __glXInitialize(dpy); + struct glx_display *const priv = __glXInitialize(dpy); return (priv && priv->screens != @@ -168,7 +168,7 @@ GetGLXScreenConfigs(Display * dpy, int scrn) static int -GetGLXPrivScreenConfig(Display * dpy, int scrn, __GLXdisplayPrivate ** ppriv, +GetGLXPrivScreenConfig(Display * dpy, int scrn, struct glx_display ** ppriv, struct glx_screen ** ppsc) { /* Initialize the extension, if needed . This has the added value @@ -213,7 +213,7 @@ GetGLXPrivScreenConfig(Display * dpy, int scrn, __GLXdisplayPrivate ** ppriv, static struct glx_config * ValidateGLXFBConfig(Display * dpy, GLXFBConfig fbconfig) { - __GLXdisplayPrivate *const priv = __glXInitialize(dpy); + struct glx_display *const priv = __glXInitialize(dpy); int num_screens = ScreenCount(dpy); unsigned i; struct glx_config *config; @@ -236,17 +236,17 @@ ValidateGLXFBConfig(Display * dpy, GLXFBConfig fbconfig) static const struct glx_context_vtable applegl_context_vtable; -static __GLcontext * +static struct glx_context * applegl_create_context(struct glx_screen *psc, struct glx_config *mode, - GLXContext shareList, int renderType) + struct glx_context *shareList, int renderType) { - __GLXcontext *gc; + struct glx_context *gc; int errorcode; bool x11error; /* TODO: Integrate this with apple_glx_create_context and make - * struct apple_glx_context inherit from __GLXcontext. */ + * struct apple_glx_context inherit from struct glx_context. */ gc = Xmalloc(sizeof *gc); if (pcp == NULL) @@ -292,12 +292,12 @@ applegl_create_context(struct glx_screen *psc, * function called \c __glXAllocateClientState that allocates the memory and * does all the initialization (including the pixel pack / unpack). */ -static GLXContext +static struct glx_context * indirect_create_context(struct glx_screen *psc, struct glx_config *mode, - GLXContext shareList, int renderType) + struct glx_context *shareList, int renderType) { - GLXContext gc; + struct glx_context *gc; int bufSize; CARD8 opcode; __GLXattribute *state; @@ -308,12 +308,12 @@ indirect_create_context(struct glx_screen *psc, } /* Allocate our context record */ - gc = (GLXContext) Xmalloc(sizeof(struct __GLXcontextRec)); + gc = Xmalloc(sizeof *gc); if (!gc) { /* Out of memory */ return NULL; } - memset(gc, 0, sizeof(struct __GLXcontextRec)); + memset(gc, 0, sizeof *gc); glx_context_init(gc, psc, mode); gc->isDirect = GL_FALSE; @@ -396,7 +396,7 @@ struct glx_screen_vtable indirect_screen_vtable = { }; _X_HIDDEN struct glx_screen * -indirect_create_screen(int screen, __GLXdisplayPrivate * priv) +indirect_create_screen(int screen, struct glx_display * priv) { struct glx_screen *psc; @@ -413,7 +413,7 @@ indirect_create_screen(int screen, __GLXdisplayPrivate * priv) _X_HIDDEN Bool -glx_context_init(__GLXcontext *gc, +glx_context_init(struct glx_context *gc, struct glx_screen *psc, struct glx_config *config) { gc->majorOpcode = __glXSetupForCommand(psc->display->dpy); @@ -441,13 +441,13 @@ glx_context_init(__GLXcontext *gc, static GLXContext CreateContext(Display * dpy, int generic_id, struct glx_config *config, - GLXContext shareList, + GLXContext shareList_user, Bool allowDirect, unsigned code, int renderType, int screen) { - GLXContext gc = NULL; + struct glx_context *gc = NULL; struct glx_screen *const psc = GetGLXScreenConfigs(dpy, screen); - + struct glx_context *shareList = (struct glx_context *) shareList_user; if (dpy == NULL) return NULL; @@ -529,7 +529,7 @@ CreateContext(Display * dpy, int generic_id, gc->imported = GL_FALSE; gc->renderType = renderType; - return gc; + return (GLXContext) gc; } _X_EXPORT GLXContext @@ -579,7 +579,7 @@ glx_send_destroy_context(Display *dpy, XID xid) } static void -indirect_destroy_context(__GLXcontext *gc) +indirect_destroy_context(struct glx_context *gc) { if (!gc->imported && gc->xid) glx_send_destroy_context(gc->psc->dpy, gc->xid); @@ -604,8 +604,10 @@ indirect_destroy_context(__GLXcontext *gc) ** Destroy the named context */ static void -DestroyContext(Display * dpy, GLXContext gc) +DestroyContext(Display * dpy, GLXContext ctx) { + struct glx_context *gc = (struct glx_context *) ctx; + if (!gc) return; @@ -640,7 +642,7 @@ glXDestroyContext(Display * dpy, GLXContext gc) _X_EXPORT Bool glXQueryVersion(Display * dpy, int *major, int *minor) { - __GLXdisplayPrivate *priv; + struct glx_display *priv; /* Init the extension. This fetches the major and minor version. */ priv = __glXInitialize(dpy); @@ -674,7 +676,7 @@ glXQueryExtension(Display * dpy, int *errorBase, int *eventBase) } static void -indirect_wait_gl(__GLXcontext *gc) +indirect_wait_gl(struct glx_context *gc) { xGLXWaitGLReq *req; Display *dpy = gc->currentDpy; @@ -699,14 +701,14 @@ indirect_wait_gl(__GLXcontext *gc) _X_EXPORT void glXWaitGL(void) { - GLXContext gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); if (gc && gc->vtable->use_x_font) gc->vtable->wait_gl(gc); } static void -indirect_wait_x(__GLXcontext *gc) +indirect_wait_x(struct glx_context *gc) { xGLXWaitXReq *req; Display *dpy = gc->currentDpy; @@ -730,14 +732,14 @@ indirect_wait_x(__GLXcontext *gc) _X_EXPORT void glXWaitX(void) { - GLXContext gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); if (gc && gc->vtable->use_x_font) gc->vtable->wait_x(gc); } static void -indirect_use_x_font(__GLXcontext *gc, +indirect_use_x_font(struct glx_context *gc, Font font, int first, int count, int listBase) { xGLXUseXFontReq *req; @@ -763,19 +765,19 @@ indirect_use_x_font(__GLXcontext *gc, #ifdef GLX_USE_APPLEGL static void -applegl_destroy_context(__GLXcontext *gc) +applegl_destroy_context(struct glx_context *gc) { apple_glx_destroy_context(&gc->driContext, gc->currentDpy); } static void -applegl_wait_gl(__GLXcontext *gc) +applegl_wait_gl(struct glx_context *gc) { glFinish(); } static void -applegl_wait_x(__GLXcontext *gc) +applegl_wait_x(struct glx_context *gc) { apple_glx_waitx(gc->dpy, gc->driContext); } @@ -794,7 +796,7 @@ static const struct glx_context_vtable applegl_context_vtable = { _X_EXPORT void glXUseXFont(Font font, int first, int count, int listBase) { - GLXContext gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); if (gc && gc->vtable->use_x_font) gc->vtable->use_x_font(gc, font, first, count, listBase); @@ -807,11 +809,13 @@ glXUseXFont(Font font, int first, int count, int listBase) ** attribute "mask". */ _X_EXPORT void -glXCopyContext(Display * dpy, GLXContext source, - GLXContext dest, unsigned long mask) +glXCopyContext(Display * dpy, GLXContext source_user, + GLXContext dest_user, unsigned long mask) { + struct glx_context *source = (struct glx_context *) source_user; + struct glx_context *dest = (struct glx_context *) dest_user; #ifdef GLX_USE_APPLEGL - GLXContext gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); int errorcode; bool x11error; @@ -822,7 +826,7 @@ glXCopyContext(Display * dpy, GLXContext source, #else xGLXCopyContextReq *req; - GLXContext gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); GLXContextTag tag; CARD8 opcode; @@ -918,8 +922,10 @@ __glXIsDirect(Display * dpy, GLXContextID contextID) * the GLX protocol here at all? */ _X_EXPORT Bool -glXIsDirect(Display * dpy, GLXContext gc) +glXIsDirect(Display * dpy, GLXContext gc_user) { + struct glx_context *gc = (struct glx_context *) gc_user; + if (!gc) { return GL_FALSE; } @@ -974,7 +980,7 @@ glXCreateGLXPixmap(Display * dpy, XVisualInfo * vis, Pixmap pixmap) /* FIXME: Maybe delay __DRIdrawable creation until the drawable * is actually bound to a context... */ - __GLXdisplayPrivate *const priv = __glXInitialize(dpy); + struct glx_display *const priv = __glXInitialize(dpy); __GLXDRIdrawable *pdraw; struct glx_screen *psc; struct glx_config *config; @@ -1029,7 +1035,7 @@ glXDestroyGLXPixmap(Display * dpy, GLXPixmap glxpixmap) #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) { - __GLXdisplayPrivate *const priv = __glXInitialize(dpy); + struct glx_display *const priv = __glXInitialize(dpy); __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, glxpixmap); if (pdraw != NULL) { @@ -1052,7 +1058,7 @@ glXSwapBuffers(Display * dpy, GLXDrawable drawable) __glXSendError(dpy, GLXBadCurrentWindow, 0, X_GLXSwapBuffers, false); } #else - GLXContext gc; + struct glx_context *gc; GLXContextTag tag; CARD8 opcode; #ifdef USE_XCB @@ -1118,7 +1124,7 @@ _X_EXPORT int glXGetConfig(Display * dpy, XVisualInfo * vis, int attribute, int *value_return) { - __GLXdisplayPrivate *priv; + struct glx_display *priv; struct glx_screen *psc; struct glx_config *config; int status; @@ -1479,7 +1485,7 @@ _X_EXPORT XVisualInfo * glXChooseVisual(Display * dpy, int screen, int *attribList) { XVisualInfo *visualList = NULL; - __GLXdisplayPrivate *priv; + struct glx_display *priv; struct glx_screen *psc; struct glx_config test_config; struct glx_config *config; @@ -1545,7 +1551,7 @@ _X_EXPORT const char * glXQueryExtensionsString(Display * dpy, int screen) { struct glx_screen *psc; - __GLXdisplayPrivate *priv; + struct glx_display *priv; if (GetGLXPrivScreenConfig(dpy, screen, &priv, &psc) != Success) { return NULL; @@ -1591,7 +1597,7 @@ _X_EXPORT const char * glXQueryServerString(Display * dpy, int screen, int name) { struct glx_screen *psc; - __GLXdisplayPrivate *priv; + struct glx_display *priv; const char **str; @@ -1660,7 +1666,7 @@ __glXClientInfo(Display * dpy, int opcode) _X_EXPORT Display * glXGetCurrentDisplay(void) { - GLXContext gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); if (NULL == gc) return NULL; return gc->currentDpy; @@ -1674,11 +1680,11 @@ GLX_ALIAS(Display *, glXGetCurrentDisplayEXT, (void), (), _X_EXPORT GLXContext glXImportContextEXT(Display *dpy, GLXContextID contextID) { - __GLXdisplayPrivate *priv = __glXInitialize(dpy); + struct glx_display *priv = __glXInitialize(dpy); struct glx_screen *psc; xGLXQueryContextReply reply; CARD8 opcode; - GLXContext ctx; + struct glx_context *ctx; int propList[__GLX_MAX_CONTEXT_PROPS * 2], *pProp, nPropListBytes; int i, renderType; XID share; @@ -1767,14 +1773,16 @@ glXImportContextEXT(Display *dpy, GLXContextID contextID) ctx->imported = GL_TRUE; ctx->share_xid = share; - return ctx; + return (GLXContext) ctx; } #endif _X_EXPORT int -glXQueryContext(Display * dpy, GLXContext ctx, int attribute, int *value) +glXQueryContext(Display * dpy, GLXContext ctx_user, int attribute, int *value) { + struct glx_context *ctx = (struct glx_context *) ctx_user; + switch (attribute) { case GLX_SHARE_CONTEXT_EXT: *value = ctx->share_xid; @@ -1802,8 +1810,10 @@ GLX_ALIAS(int, glXQueryContextInfoEXT, (Display * dpy, GLXContext ctx, int attribute, int *value), (dpy, ctx, attribute, value), glXQueryContext) -_X_EXPORT GLXContextID glXGetContextIDEXT(const GLXContext ctx) +_X_EXPORT GLXContextID glXGetContextIDEXT(const GLXContext ctx_user) { + struct glx_context *ctx = (struct glx_context *) ctx_user; + return ctx->xid; } @@ -1853,7 +1863,8 @@ glXCreateNewContext(Display * dpy, GLXFBConfig fbconfig, _X_EXPORT GLXDrawable glXGetCurrentReadDrawable(void) { - GLXContext gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); + return gc->currentReadable; } @@ -1861,7 +1872,7 @@ glXGetCurrentReadDrawable(void) _X_EXPORT GLXFBConfig * glXGetFBConfigs(Display * dpy, int screen, int *nelements) { - __GLXdisplayPrivate *priv = __glXInitialize(dpy); + struct glx_display *priv = __glXInitialize(dpy); struct glx_config **config_list = NULL; struct glx_config *config; unsigned num_configs = 0; @@ -1934,7 +1945,7 @@ static int __glXSwapIntervalSGI(int interval) { xGLXVendorPrivateReq *req; - GLXContext gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); struct glx_screen *psc; Display *dpy; CARD32 *interval_ptr; @@ -1991,7 +2002,7 @@ static int __glXSwapIntervalMESA(unsigned int interval) { #ifdef GLX_DIRECT_RENDERING - GLXContext gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); if (gc != NULL && gc->driContext) { struct glx_screen *psc; @@ -2013,7 +2024,7 @@ static int __glXGetSwapIntervalMESA(void) { #ifdef GLX_DIRECT_RENDERING - GLXContext gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); if (gc != NULL && gc->driContext) { struct glx_screen *psc; @@ -2039,7 +2050,7 @@ __glXGetVideoSyncSGI(unsigned int *count) { int64_t ust, msc, sbc; int ret; - GLXContext gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); struct glx_screen *psc; #ifdef GLX_DIRECT_RENDERING __GLXDRIdrawable *pdraw; @@ -2076,7 +2087,7 @@ __glXGetVideoSyncSGI(unsigned int *count) static int __glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count) { - GLXContext gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); struct glx_screen *psc; #ifdef GLX_DIRECT_RENDERING __GLXDRIdrawable *pdraw; @@ -2217,7 +2228,7 @@ glXCreateContextWithConfigSGIX(Display * dpy, _X_EXPORT GLXFBConfigSGIX glXGetFBConfigFromVisualSGIX(Display * dpy, XVisualInfo * vis) { - __GLXdisplayPrivate *priv; + struct glx_display *priv; struct glx_screen *psc = NULL; if ((GetGLXPrivScreenConfig(dpy, vis->screen, &priv, &psc) != Success) @@ -2272,7 +2283,7 @@ static Bool __glXGetSyncValuesOML(Display * dpy, GLXDrawable drawable, int64_t * ust, int64_t * msc, int64_t * sbc) { - __GLXdisplayPrivate * const priv = __glXInitialize(dpy); + struct glx_display * const priv = __glXInitialize(dpy); int ret; #ifdef GLX_DIRECT_RENDERING __GLXDRIdrawable *pdraw; @@ -2402,7 +2413,7 @@ static int64_t __glXSwapBuffersMscOML(Display * dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder) { - GLXContext gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); #ifdef GLX_DIRECT_RENDERING __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable); struct glx_screen *psc = pdraw ? pdraw->psc : NULL; @@ -2561,7 +2572,7 @@ __glXCopySubBufferMESA(Display * dpy, GLXDrawable drawable, int x, int y, int width, int height) { xGLXVendorPrivateReq *req; - GLXContext gc; + struct glx_context *gc; GLXContextTag tag; CARD32 *drawable_ptr; INT32 *x_ptr, *y_ptr, *w_ptr, *h_ptr; @@ -2631,7 +2642,7 @@ indirect_bind_tex_image(Display * dpy, int buffer, const int *attrib_list) { xGLXVendorPrivateReq *req; - GLXContext gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); CARD32 *drawable_ptr; INT32 *buffer_ptr; CARD32 *num_attrib_ptr; @@ -2682,7 +2693,7 @@ static void indirect_release_tex_image(Display * dpy, GLXDrawable drawable, int buffer) { xGLXVendorPrivateReq *req; - GLXContext gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); CARD32 *drawable_ptr; INT32 *buffer_ptr; CARD8 opcode; @@ -2722,7 +2733,7 @@ static void __glXBindTexImageEXT(Display * dpy, GLXDrawable drawable, int buffer, const int *attrib_list) { - GLXContext gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); if (gc == NULL || gc->vtable->bind_tex_image == NULL) return; @@ -2733,7 +2744,7 @@ __glXBindTexImageEXT(Display * dpy, static void __glXReleaseTexImageEXT(Display * dpy, GLXDrawable drawable, int buffer) { - GLXContext gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); if (gc == NULL || gc->vtable->release_tex_image == NULL) return; diff --git a/src/glx/glxcurrent.c b/src/glx/glxcurrent.c index f4d4f2ea29..c293af30c2 100644 --- a/src/glx/glxcurrent.c +++ b/src/glx/glxcurrent.c @@ -61,7 +61,7 @@ static GLubyte dummyBuffer[__GLX_BUFFER_LIMIT_SIZE]; ** gl and glx entry points are designed to operate as nop's when using ** the dummy context structure. */ -static __GLXcontext dummyContext = { +static struct glx_context dummyContext = { &dummyBuffer[0], &dummyBuffer[0], &dummyBuffer[0], @@ -74,7 +74,7 @@ static __GLXcontext dummyContext = { /* ** All indirect rendering contexts will share the same indirect dispatch table. */ -static __GLapi *IndirectAPI = NULL; +static struct _glapi_table *IndirectAPI = NULL; #endif /* @@ -98,7 +98,7 @@ __thread void *__glX_tls_Context __attribute__ ((tls_model("initial-exec"))) = &dummyContext; _X_HIDDEN void -__glXSetCurrentContext(__GLXcontext * c) +__glXSetCurrentContext(struct glx_context * c) { __glX_tls_Context = (c != NULL) ? c : &dummyContext; } @@ -133,13 +133,13 @@ init_thread_data(void) } _X_HIDDEN void -__glXSetCurrentContext(__GLXcontext * c) +__glXSetCurrentContext(struct glx_context * c) { pthread_once(&once_control, init_thread_data); pthread_setspecific(ContextTSD, c); } -_X_HIDDEN __GLXcontext * +_X_HIDDEN struct glx_context * __glXGetCurrentContext(void) { void *v; @@ -147,7 +147,7 @@ __glXGetCurrentContext(void) pthread_once(&once_control, init_thread_data); v = pthread_getspecific(ContextTSD); - return (v == NULL) ? &dummyContext : (__GLXcontext *) v; + return (v == NULL) ? &dummyContext : (struct glx_context *) v; } # endif /* defined( GLX_USE_TLS ) */ @@ -159,7 +159,7 @@ __glXGetCurrentContext(void) #else /* not thread safe */ -_X_HIDDEN __GLXcontext *__glXcurrentContext = &dummyContext; +_X_HIDDEN struct glx_context *__glXcurrentContext = &dummyContext; #endif @@ -182,20 +182,20 @@ __glXSetCurrentContextNull(void) _X_EXPORT GLXContext glXGetCurrentContext(void) { - GLXContext cx = __glXGetCurrentContext(); + struct glx_context *cx = __glXGetCurrentContext(); if (cx == &dummyContext) { return NULL; } else { - return cx; + return (GLXContext) cx; } } _X_EXPORT GLXDrawable glXGetCurrentDrawable(void) { - GLXContext gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); return gc->currentDrawable; } @@ -239,7 +239,7 @@ SendMakeCurrentRequest(Display * dpy, CARD8 opcode, req->oldContextTag = gc_tag; } else { - __GLXdisplayPrivate *priv = __glXInitialize(dpy); + struct glx_display *priv = __glXInitialize(dpy); /* If the server can support the GLX 1.3 version, we should * perfer that. Not only that, some servers support GLX 1.3 but @@ -286,9 +286,10 @@ SendMakeCurrentRequest(Display * dpy, CARD8 opcode, #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) static __GLXDRIdrawable * -FetchDRIDrawable(Display * dpy, GLXDrawable glxDrawable, GLXContext gc) +FetchDRIDrawable(Display * dpy, + GLXDrawable glxDrawable, struct glx_context *gc) { - __GLXdisplayPrivate *const priv = __glXInitialize(dpy); + struct glx_display *const priv = __glXInitialize(dpy); __GLXDRIdrawable *pdraw; struct glx_screen *psc; @@ -314,7 +315,7 @@ FetchDRIDrawable(Display * dpy, GLXDrawable glxDrawable, GLXContext gc) #endif /* GLX_DIRECT_RENDERING */ static void -__glXGenerateError(Display * dpy, GLXContext gc, XID resource, +__glXGenerateError(Display * dpy, struct glx_context *gc, XID resource, BYTE errorCode, CARD16 minorCode) { xError error; @@ -337,9 +338,10 @@ __glXGenerateError(Display * dpy, GLXContext gc, XID resource, */ static Bool MakeContextCurrent(Display * dpy, GLXDrawable draw, - GLXDrawable read, GLXContext gc) + GLXDrawable read, GLXContext gc_user) { - const GLXContext oldGC = __glXGetCurrentContext(); + struct glx_context *gc = (struct glx_context *) gc_user; + struct glx_context *oldGC = __glXGetCurrentContext(); #ifdef GLX_USE_APPLEGL bool error = apple_glx_make_current_context(dpy, (oldGC && oldGC != &dummyContext) ? oldGC->driContext : NULL, diff --git a/src/glx/glxext.c b/src/glx/glxext.c index 930709bd20..5930d7d5a8 100644 --- a/src/glx/glxext.c +++ b/src/glx/glxext.c @@ -56,7 +56,7 @@ #ifdef DEBUG -void __glXDumpDrawBuffer(__GLXcontext * ctx); +void __glXDumpDrawBuffer(struct glx_context * ctx); #endif /* @@ -68,7 +68,7 @@ _X_HIDDEN int __glXDebug = 0; /* Extension required boiler plate */ static const char __glXExtensionName[] = GLX_EXTENSION_NAME; -static __GLXdisplayPrivate *glx_displays; + static struct glx_display *glx_displays; static /* const */ char *error_list[] = { "GLXBadContext", @@ -107,7 +107,7 @@ XEXT_GENERATE_ERROR_STRING(__glXErrorString, __glXExtensionName, static Bool __glXWireToEvent(Display *dpy, XEvent *event, xEvent *wire) { - __GLXdisplayPrivate *glx_dpy = __glXInitialize(dpy); + struct glx_display *glx_dpy = __glXInitialize(dpy); if (glx_dpy == NULL) return False; @@ -167,7 +167,7 @@ __glXWireToEvent(Display *dpy, XEvent *event, xEvent *wire) static Status __glXEventToWire(Display *dpy, XEvent *event, xEvent *wire) { - __GLXdisplayPrivate *glx_dpy = __glXInitialize(dpy); + struct glx_display *glx_dpy = __glXInitialize(dpy); if (glx_dpy == NULL) return False; @@ -197,7 +197,7 @@ __glXEventToWire(Display *dpy, XEvent *event, xEvent *wire) ** __glXScreenConfigs. */ static void -FreeScreenConfigs(__GLXdisplayPrivate * priv) + FreeScreenConfigs(struct glx_display * priv) { struct glx_screen *psc; GLint i, screens; @@ -239,8 +239,8 @@ FreeScreenConfigs(__GLXdisplayPrivate * priv) static int __glXCloseDisplay(Display * dpy, XExtCodes * codes) { - __GLXdisplayPrivate *priv, **prev; - GLXContext gc; + struct glx_display *priv, **prev; + struct glx_context *gc; _XLockMutex(_Xglobal_lock); prev = &glx_displays; @@ -647,7 +647,7 @@ createConfigsFromProperties(Display * dpy, int nvisuals, int nprops, static GLboolean getVisualConfigs(struct glx_screen *psc, - __GLXdisplayPrivate *priv, int screen) + struct glx_display *priv, int screen) { xGLXGetVisualConfigsReq *req; xGLXGetVisualConfigsReply reply; @@ -675,7 +675,7 @@ getVisualConfigs(struct glx_screen *psc, } static GLboolean -getFBConfigs(struct glx_screen *psc, __GLXdisplayPrivate *priv, int screen) + getFBConfigs(struct glx_screen *psc, struct glx_display *priv, int screen) { xGLXGetFBConfigsReq *fb_req; xGLXGetFBConfigsSGIXReq *sgi_req; @@ -723,7 +723,7 @@ getFBConfigs(struct glx_screen *psc, __GLXdisplayPrivate *priv, int screen) _X_HIDDEN Bool glx_screen_init(struct glx_screen *psc, - int screen, __GLXdisplayPrivate * priv) + int screen, struct glx_display * priv) { /* Initialize per screen dynamic client GLX extensions */ psc->ext_list_first_time = GL_TRUE; @@ -742,7 +742,7 @@ glx_screen_init(struct glx_screen *psc, ** If that works then fetch the per screen configs data. */ static Bool -AllocAndFetchScreenConfigs(Display * dpy, __GLXdisplayPrivate * priv) + AllocAndFetchScreenConfigs(Display * dpy, struct glx_display * priv) { struct glx_screen *psc; GLint i, screens; @@ -783,10 +783,10 @@ AllocAndFetchScreenConfigs(Display * dpy, __GLXdisplayPrivate * priv) /* ** Initialize the client side extension code. */ -_X_HIDDEN __GLXdisplayPrivate * + _X_HIDDEN struct glx_display * __glXInitialize(Display * dpy) { - __GLXdisplayPrivate *dpyPriv; + struct glx_display *dpyPriv; #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) Bool glx_direct, glx_accel; #endif @@ -881,8 +881,8 @@ __glXInitialize(Display * dpy) _X_HIDDEN CARD8 __glXSetupForCommand(Display * dpy) { - GLXContext gc; - __GLXdisplayPrivate *priv; + struct glx_context *gc; + struct glx_display *priv; /* If this thread has a current context, flush its rendering commands */ gc = __glXGetCurrentContext(); @@ -921,7 +921,7 @@ __glXSetupForCommand(Display * dpy) * \c pc parameter. */ _X_HIDDEN GLubyte * -__glXFlushRenderBuffer(__GLXcontext * ctx, GLubyte * pc) +__glXFlushRenderBuffer(struct glx_context * ctx, GLubyte * pc) { Display *const dpy = ctx->currentDpy; #ifdef USE_XCB @@ -972,7 +972,7 @@ __glXFlushRenderBuffer(__GLXcontext * ctx, GLubyte * pc) * \param dataLen Size, in bytes, of the command data. */ _X_HIDDEN void -__glXSendLargeChunk(__GLXcontext * gc, GLint requestNumber, +__glXSendLargeChunk(struct glx_context * gc, GLint requestNumber, GLint totalRequests, const GLvoid * data, GLint dataLen) { Display *dpy = gc->currentDpy; @@ -1021,7 +1021,7 @@ __glXSendLargeChunk(__GLXcontext * gc, GLint requestNumber, * \param dataLen Size, in bytes, of the command data. */ _X_HIDDEN void -__glXSendLargeCommand(__GLXcontext * ctx, +__glXSendLargeCommand(struct glx_context * ctx, const GLvoid * header, GLint headerLen, const GLvoid * data, GLint dataLen) { @@ -1063,7 +1063,7 @@ __glXSendLargeCommand(__GLXcontext * ctx, #ifdef DEBUG _X_HIDDEN void -__glXDumpDrawBuffer(__GLXcontext * ctx) +__glXDumpDrawBuffer(struct glx_context * ctx) { GLubyte *p = ctx->buf; GLubyte *end = ctx->pc; diff --git a/src/glx/glxextensions.c b/src/glx/glxextensions.c index c5ca77374f..23161ef49a 100644 --- a/src/glx/glxextensions.c +++ b/src/glx/glxextensions.c @@ -513,7 +513,7 @@ __glXExtensionBitIsEnabled(struct glx_screen * psc, unsigned bit) * */ GLboolean -__glExtensionBitIsEnabled(const __GLXcontext * gc, unsigned bit) +__glExtensionBitIsEnabled(struct glx_context *gc, unsigned bit) { GLboolean enabled = GL_FALSE; @@ -675,7 +675,7 @@ __glXCalculateUsableExtensions(struct glx_screen * psc, */ void -__glXCalculateUsableGLExtensions(__GLXcontext * gc, +__glXCalculateUsableGLExtensions(struct glx_context * gc, const char *server_string, int major_version, int minor_version) { diff --git a/src/glx/glxextensions.h b/src/glx/glxextensions.h index e5f0b448ef..a11fe88ffc 100644 --- a/src/glx/glxextensions.h +++ b/src/glx/glxextensions.h @@ -235,7 +235,7 @@ enum #define __GL_EXT_BYTES ((__NUM_GL_EXTS + 7) / 8) struct glx_screen; -struct __GLXcontextRec; +struct glx_context; extern GLboolean __glXExtensionBitIsEnabled(struct glx_screen *psc, unsigned bit); @@ -245,14 +245,14 @@ extern void __glXCalculateUsableExtensions(struct glx_screen *psc, display_is_direct_capable, int server_minor_version); -extern void __glXCalculateUsableGLExtensions(struct __GLXcontextRec *gc, +extern void __glXCalculateUsableGLExtensions(struct glx_context *gc, const char *server_string, int major_version, int minor_version); extern void __glXGetGLVersion(int *major_version, int *minor_version); extern char *__glXGetClientGLExtensionString(void); -extern GLboolean __glExtensionBitIsEnabled(const struct __GLXcontextRec *gc, +extern GLboolean __glExtensionBitIsEnabled(struct glx_context *gc, unsigned bit); extern void diff --git a/src/glx/indirect.c b/src/glx/indirect.c index 172727860e..0dea8e9f5a 100644 --- a/src/glx/indirect.c +++ b/src/glx/indirect.c @@ -91,7 +91,7 @@ __glXReadReply(Display * dpy, size_t size, void *dest, } NOINLINE void -__glXReadPixelReply(Display * dpy, __GLXcontext * gc, unsigned max_dim, +__glXReadPixelReply(Display * dpy, struct glx_context * gc, unsigned max_dim, GLint width, GLint height, GLint depth, GLenum format, GLenum type, void *dest, GLboolean dimensions_in_reply) { @@ -138,7 +138,7 @@ __glXReadPixelReply(Display * dpy, __GLXcontext * gc, unsigned max_dim, #define X_GLXSingle 0 NOINLINE FASTCALL GLubyte * -__glXSetupSingleRequest(__GLXcontext * gc, GLint sop, GLint cmdlen) +__glXSetupSingleRequest(struct glx_context * gc, GLint sop, GLint cmdlen) { xGLXSingleReq *req; Display *const dpy = gc->currentDpy; @@ -153,7 +153,7 @@ __glXSetupSingleRequest(__GLXcontext * gc, GLint sop, GLint cmdlen) } NOINLINE FASTCALL GLubyte * -__glXSetupVendorRequest(__GLXcontext * gc, GLint code, GLint vop, +__glXSetupVendorRequest(struct glx_context * gc, GLint code, GLint vop, GLint cmdlen) { xGLXVendorPrivateReq *req; @@ -185,7 +185,7 @@ const GLuint __glXDefaultPixelStore[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 1 }; static FASTCALL NOINLINE void generic_3_byte(GLint rop, const void *ptr) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, rop, cmdlen); @@ -199,7 +199,7 @@ generic_3_byte(GLint rop, const void *ptr) static FASTCALL NOINLINE void generic_4_byte(GLint rop, const void *ptr) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, rop, cmdlen); @@ -213,7 +213,7 @@ generic_4_byte(GLint rop, const void *ptr) static FASTCALL NOINLINE void generic_6_byte(GLint rop, const void *ptr) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, rop, cmdlen); @@ -227,7 +227,7 @@ generic_6_byte(GLint rop, const void *ptr) static FASTCALL NOINLINE void generic_8_byte(GLint rop, const void *ptr) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, rop, cmdlen); @@ -241,7 +241,7 @@ generic_8_byte(GLint rop, const void *ptr) static FASTCALL NOINLINE void generic_12_byte(GLint rop, const void *ptr) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, rop, cmdlen); @@ -255,7 +255,7 @@ generic_12_byte(GLint rop, const void *ptr) static FASTCALL NOINLINE void generic_16_byte(GLint rop, const void *ptr) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, rop, cmdlen); @@ -269,7 +269,7 @@ generic_16_byte(GLint rop, const void *ptr) static FASTCALL NOINLINE void generic_24_byte(GLint rop, const void *ptr) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 28; emit_header(gc->pc, rop, cmdlen); @@ -283,7 +283,7 @@ generic_24_byte(GLint rop, const void *ptr) static FASTCALL NOINLINE void generic_32_byte(GLint rop, const void *ptr) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 36; emit_header(gc->pc, rop, cmdlen); @@ -298,7 +298,7 @@ generic_32_byte(GLint rop, const void *ptr) void __indirect_glNewList(GLuint list, GLenum mode) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; #ifndef USE_XCB const GLuint cmdlen = 8; @@ -324,7 +324,7 @@ __indirect_glNewList(GLuint list, GLenum mode) void __indirect_glEndList(void) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; #ifndef USE_XCB const GLuint cmdlen = 0; @@ -347,7 +347,7 @@ __indirect_glEndList(void) void __indirect_glCallList(GLuint list) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_CallList, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&list), 4); @@ -361,7 +361,7 @@ __indirect_glCallList(GLuint list) void __indirect_glCallLists(GLsizei n, GLenum type, const GLvoid * lists) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint compsize = __glCallLists_size(type); const GLuint cmdlen = 12 + __GLX_PAD((compsize * n)); if (n < 0) { @@ -399,7 +399,7 @@ __indirect_glCallLists(GLsizei n, GLenum type, const GLvoid * lists) void __indirect_glDeleteLists(GLuint list, GLsizei range) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; #ifndef USE_XCB const GLuint cmdlen = 8; @@ -425,7 +425,7 @@ __indirect_glDeleteLists(GLuint list, GLsizei range) GLuint __indirect_glGenLists(GLsizei range) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; GLuint retval = (GLuint) 0; #ifndef USE_XCB @@ -458,7 +458,7 @@ __indirect_glGenLists(GLsizei range) void __indirect_glListBase(GLuint base) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_ListBase, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&base), 4); @@ -472,7 +472,7 @@ __indirect_glListBase(GLuint base) void __indirect_glBegin(GLenum mode) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_Begin, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&mode), 4); @@ -488,7 +488,7 @@ __indirect_glBitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint compsize = (bitmap != NULL) ? __glImageSize(width, height, 1, GL_COLOR_INDEX, GL_BITMAP, 0) : 0; @@ -539,7 +539,7 @@ __indirect_glBitmap(GLsizei width, GLsizei height, GLfloat xorig, void __indirect_glColor3b(GLbyte red, GLbyte green, GLbyte blue) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_Color3bv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 1); @@ -562,7 +562,7 @@ __indirect_glColor3bv(const GLbyte *v) void __indirect_glColor3d(GLdouble red, GLdouble green, GLdouble blue) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 28; emit_header(gc->pc, X_GLrop_Color3dv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 8); @@ -585,7 +585,7 @@ __indirect_glColor3dv(const GLdouble * v) void __indirect_glColor3f(GLfloat red, GLfloat green, GLfloat blue) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_Color3fv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 4); @@ -608,7 +608,7 @@ __indirect_glColor3fv(const GLfloat * v) void __indirect_glColor3i(GLint red, GLint green, GLint blue) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_Color3iv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 4); @@ -631,7 +631,7 @@ __indirect_glColor3iv(const GLint * v) void __indirect_glColor3s(GLshort red, GLshort green, GLshort blue) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_Color3sv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 2); @@ -654,7 +654,7 @@ __indirect_glColor3sv(const GLshort * v) void __indirect_glColor3ub(GLubyte red, GLubyte green, GLubyte blue) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_Color3ubv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 1); @@ -677,7 +677,7 @@ __indirect_glColor3ubv(const GLubyte *v) void __indirect_glColor3ui(GLuint red, GLuint green, GLuint blue) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_Color3uiv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 4); @@ -700,7 +700,7 @@ __indirect_glColor3uiv(const GLuint * v) void __indirect_glColor3us(GLushort red, GLushort green, GLushort blue) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_Color3usv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 2); @@ -723,7 +723,7 @@ __indirect_glColor3usv(const GLushort * v) void __indirect_glColor4b(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_Color4bv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 1); @@ -748,7 +748,7 @@ void __indirect_glColor4d(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 36; emit_header(gc->pc, X_GLrop_Color4dv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 8); @@ -772,7 +772,7 @@ __indirect_glColor4dv(const GLdouble * v) void __indirect_glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_Color4fv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 4); @@ -796,7 +796,7 @@ __indirect_glColor4fv(const GLfloat * v) void __indirect_glColor4i(GLint red, GLint green, GLint blue, GLint alpha) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_Color4iv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 4); @@ -820,7 +820,7 @@ __indirect_glColor4iv(const GLint * v) void __indirect_glColor4s(GLshort red, GLshort green, GLshort blue, GLshort alpha) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_Color4sv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 2); @@ -844,7 +844,7 @@ __indirect_glColor4sv(const GLshort * v) void __indirect_glColor4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_Color4ubv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 1); @@ -868,7 +868,7 @@ __indirect_glColor4ubv(const GLubyte *v) void __indirect_glColor4ui(GLuint red, GLuint green, GLuint blue, GLuint alpha) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_Color4uiv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 4); @@ -893,7 +893,7 @@ void __indirect_glColor4us(GLushort red, GLushort green, GLushort blue, GLushort alpha) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_Color4usv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 2); @@ -917,7 +917,7 @@ __indirect_glColor4usv(const GLushort * v) void __indirect_glEdgeFlag(GLboolean flag) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_EdgeFlagv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&flag), 1); @@ -931,7 +931,7 @@ __indirect_glEdgeFlag(GLboolean flag) void __indirect_glEdgeFlagv(const GLboolean * flag) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_EdgeFlagv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (flag), 1); @@ -945,7 +945,7 @@ __indirect_glEdgeFlagv(const GLboolean * flag) void __indirect_glEnd(void) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 4; emit_header(gc->pc, X_GLrop_End, cmdlen); gc->pc += cmdlen; @@ -958,7 +958,7 @@ __indirect_glEnd(void) void __indirect_glIndexd(GLdouble c) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_Indexdv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&c), 8); @@ -979,7 +979,7 @@ __indirect_glIndexdv(const GLdouble * c) void __indirect_glIndexf(GLfloat c) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_Indexfv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&c), 4); @@ -1000,7 +1000,7 @@ __indirect_glIndexfv(const GLfloat * c) void __indirect_glIndexi(GLint c) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_Indexiv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&c), 4); @@ -1021,7 +1021,7 @@ __indirect_glIndexiv(const GLint * c) void __indirect_glIndexs(GLshort c) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_Indexsv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&c), 2); @@ -1035,7 +1035,7 @@ __indirect_glIndexs(GLshort c) void __indirect_glIndexsv(const GLshort * c) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_Indexsv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (c), 2); @@ -1049,7 +1049,7 @@ __indirect_glIndexsv(const GLshort * c) void __indirect_glNormal3b(GLbyte nx, GLbyte ny, GLbyte nz) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_Normal3bv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&nx), 1); @@ -1072,7 +1072,7 @@ __indirect_glNormal3bv(const GLbyte *v) void __indirect_glNormal3d(GLdouble nx, GLdouble ny, GLdouble nz) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 28; emit_header(gc->pc, X_GLrop_Normal3dv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&nx), 8); @@ -1095,7 +1095,7 @@ __indirect_glNormal3dv(const GLdouble * v) void __indirect_glNormal3f(GLfloat nx, GLfloat ny, GLfloat nz) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_Normal3fv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&nx), 4); @@ -1118,7 +1118,7 @@ __indirect_glNormal3fv(const GLfloat * v) void __indirect_glNormal3i(GLint nx, GLint ny, GLint nz) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_Normal3iv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&nx), 4); @@ -1141,7 +1141,7 @@ __indirect_glNormal3iv(const GLint * v) void __indirect_glNormal3s(GLshort nx, GLshort ny, GLshort nz) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_Normal3sv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&nx), 2); @@ -1164,7 +1164,7 @@ __indirect_glNormal3sv(const GLshort * v) void __indirect_glRasterPos2d(GLdouble x, GLdouble y) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_RasterPos2dv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 8); @@ -1186,7 +1186,7 @@ __indirect_glRasterPos2dv(const GLdouble * v) void __indirect_glRasterPos2f(GLfloat x, GLfloat y) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_RasterPos2fv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); @@ -1208,7 +1208,7 @@ __indirect_glRasterPos2fv(const GLfloat * v) void __indirect_glRasterPos2i(GLint x, GLint y) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_RasterPos2iv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); @@ -1230,7 +1230,7 @@ __indirect_glRasterPos2iv(const GLint * v) void __indirect_glRasterPos2s(GLshort x, GLshort y) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_RasterPos2sv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 2); @@ -1252,7 +1252,7 @@ __indirect_glRasterPos2sv(const GLshort * v) void __indirect_glRasterPos3d(GLdouble x, GLdouble y, GLdouble z) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 28; emit_header(gc->pc, X_GLrop_RasterPos3dv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 8); @@ -1275,7 +1275,7 @@ __indirect_glRasterPos3dv(const GLdouble * v) void __indirect_glRasterPos3f(GLfloat x, GLfloat y, GLfloat z) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_RasterPos3fv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); @@ -1298,7 +1298,7 @@ __indirect_glRasterPos3fv(const GLfloat * v) void __indirect_glRasterPos3i(GLint x, GLint y, GLint z) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_RasterPos3iv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); @@ -1321,7 +1321,7 @@ __indirect_glRasterPos3iv(const GLint * v) void __indirect_glRasterPos3s(GLshort x, GLshort y, GLshort z) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_RasterPos3sv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 2); @@ -1344,7 +1344,7 @@ __indirect_glRasterPos3sv(const GLshort * v) void __indirect_glRasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 36; emit_header(gc->pc, X_GLrop_RasterPos4dv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 8); @@ -1368,7 +1368,7 @@ __indirect_glRasterPos4dv(const GLdouble * v) void __indirect_glRasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_RasterPos4fv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); @@ -1392,7 +1392,7 @@ __indirect_glRasterPos4fv(const GLfloat * v) void __indirect_glRasterPos4i(GLint x, GLint y, GLint z, GLint w) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_RasterPos4iv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); @@ -1416,7 +1416,7 @@ __indirect_glRasterPos4iv(const GLint * v) void __indirect_glRasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_RasterPos4sv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 2); @@ -1440,7 +1440,7 @@ __indirect_glRasterPos4sv(const GLshort * v) void __indirect_glRectd(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 36; emit_header(gc->pc, X_GLrop_Rectdv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&x1), 8); @@ -1457,7 +1457,7 @@ __indirect_glRectd(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2) void __indirect_glRectdv(const GLdouble * v1, const GLdouble * v2) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 36; emit_header(gc->pc, X_GLrop_Rectdv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (v1), 16); @@ -1472,7 +1472,7 @@ __indirect_glRectdv(const GLdouble * v1, const GLdouble * v2) void __indirect_glRectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_Rectfv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&x1), 4); @@ -1489,7 +1489,7 @@ __indirect_glRectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2) void __indirect_glRectfv(const GLfloat * v1, const GLfloat * v2) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_Rectfv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (v1), 8); @@ -1504,7 +1504,7 @@ __indirect_glRectfv(const GLfloat * v1, const GLfloat * v2) void __indirect_glRecti(GLint x1, GLint y1, GLint x2, GLint y2) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_Rectiv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&x1), 4); @@ -1521,7 +1521,7 @@ __indirect_glRecti(GLint x1, GLint y1, GLint x2, GLint y2) void __indirect_glRectiv(const GLint * v1, const GLint * v2) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_Rectiv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (v1), 8); @@ -1536,7 +1536,7 @@ __indirect_glRectiv(const GLint * v1, const GLint * v2) void __indirect_glRects(GLshort x1, GLshort y1, GLshort x2, GLshort y2) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_Rectsv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&x1), 2); @@ -1553,7 +1553,7 @@ __indirect_glRects(GLshort x1, GLshort y1, GLshort x2, GLshort y2) void __indirect_glRectsv(const GLshort * v1, const GLshort * v2) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_Rectsv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (v1), 4); @@ -1568,7 +1568,7 @@ __indirect_glRectsv(const GLshort * v1, const GLshort * v2) void __indirect_glTexCoord1d(GLdouble s) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_TexCoord1dv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 8); @@ -1589,7 +1589,7 @@ __indirect_glTexCoord1dv(const GLdouble * v) void __indirect_glTexCoord1f(GLfloat s) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_TexCoord1fv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 4); @@ -1610,7 +1610,7 @@ __indirect_glTexCoord1fv(const GLfloat * v) void __indirect_glTexCoord1i(GLint s) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_TexCoord1iv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 4); @@ -1631,7 +1631,7 @@ __indirect_glTexCoord1iv(const GLint * v) void __indirect_glTexCoord1s(GLshort s) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_TexCoord1sv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 2); @@ -1645,7 +1645,7 @@ __indirect_glTexCoord1s(GLshort s) void __indirect_glTexCoord1sv(const GLshort * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_TexCoord1sv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (v), 2); @@ -1659,7 +1659,7 @@ __indirect_glTexCoord1sv(const GLshort * v) void __indirect_glTexCoord2d(GLdouble s, GLdouble t) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_TexCoord2dv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 8); @@ -1681,7 +1681,7 @@ __indirect_glTexCoord2dv(const GLdouble * v) void __indirect_glTexCoord2f(GLfloat s, GLfloat t) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_TexCoord2fv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 4); @@ -1703,7 +1703,7 @@ __indirect_glTexCoord2fv(const GLfloat * v) void __indirect_glTexCoord2i(GLint s, GLint t) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_TexCoord2iv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 4); @@ -1725,7 +1725,7 @@ __indirect_glTexCoord2iv(const GLint * v) void __indirect_glTexCoord2s(GLshort s, GLshort t) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_TexCoord2sv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 2); @@ -1747,7 +1747,7 @@ __indirect_glTexCoord2sv(const GLshort * v) void __indirect_glTexCoord3d(GLdouble s, GLdouble t, GLdouble r) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 28; emit_header(gc->pc, X_GLrop_TexCoord3dv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 8); @@ -1770,7 +1770,7 @@ __indirect_glTexCoord3dv(const GLdouble * v) void __indirect_glTexCoord3f(GLfloat s, GLfloat t, GLfloat r) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_TexCoord3fv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 4); @@ -1793,7 +1793,7 @@ __indirect_glTexCoord3fv(const GLfloat * v) void __indirect_glTexCoord3i(GLint s, GLint t, GLint r) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_TexCoord3iv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 4); @@ -1816,7 +1816,7 @@ __indirect_glTexCoord3iv(const GLint * v) void __indirect_glTexCoord3s(GLshort s, GLshort t, GLshort r) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_TexCoord3sv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 2); @@ -1839,7 +1839,7 @@ __indirect_glTexCoord3sv(const GLshort * v) void __indirect_glTexCoord4d(GLdouble s, GLdouble t, GLdouble r, GLdouble q) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 36; emit_header(gc->pc, X_GLrop_TexCoord4dv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 8); @@ -1863,7 +1863,7 @@ __indirect_glTexCoord4dv(const GLdouble * v) void __indirect_glTexCoord4f(GLfloat s, GLfloat t, GLfloat r, GLfloat q) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_TexCoord4fv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 4); @@ -1887,7 +1887,7 @@ __indirect_glTexCoord4fv(const GLfloat * v) void __indirect_glTexCoord4i(GLint s, GLint t, GLint r, GLint q) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_TexCoord4iv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 4); @@ -1911,7 +1911,7 @@ __indirect_glTexCoord4iv(const GLint * v) void __indirect_glTexCoord4s(GLshort s, GLshort t, GLshort r, GLshort q) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_TexCoord4sv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 2); @@ -1935,7 +1935,7 @@ __indirect_glTexCoord4sv(const GLshort * v) void __indirect_glVertex2d(GLdouble x, GLdouble y) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_Vertex2dv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 8); @@ -1957,7 +1957,7 @@ __indirect_glVertex2dv(const GLdouble * v) void __indirect_glVertex2f(GLfloat x, GLfloat y) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_Vertex2fv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); @@ -1979,7 +1979,7 @@ __indirect_glVertex2fv(const GLfloat * v) void __indirect_glVertex2i(GLint x, GLint y) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_Vertex2iv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); @@ -2001,7 +2001,7 @@ __indirect_glVertex2iv(const GLint * v) void __indirect_glVertex2s(GLshort x, GLshort y) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_Vertex2sv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 2); @@ -2023,7 +2023,7 @@ __indirect_glVertex2sv(const GLshort * v) void __indirect_glVertex3d(GLdouble x, GLdouble y, GLdouble z) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 28; emit_header(gc->pc, X_GLrop_Vertex3dv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 8); @@ -2046,7 +2046,7 @@ __indirect_glVertex3dv(const GLdouble * v) void __indirect_glVertex3f(GLfloat x, GLfloat y, GLfloat z) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_Vertex3fv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); @@ -2069,7 +2069,7 @@ __indirect_glVertex3fv(const GLfloat * v) void __indirect_glVertex3i(GLint x, GLint y, GLint z) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_Vertex3iv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); @@ -2092,7 +2092,7 @@ __indirect_glVertex3iv(const GLint * v) void __indirect_glVertex3s(GLshort x, GLshort y, GLshort z) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_Vertex3sv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 2); @@ -2115,7 +2115,7 @@ __indirect_glVertex3sv(const GLshort * v) void __indirect_glVertex4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 36; emit_header(gc->pc, X_GLrop_Vertex4dv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 8); @@ -2139,7 +2139,7 @@ __indirect_glVertex4dv(const GLdouble * v) void __indirect_glVertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_Vertex4fv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); @@ -2163,7 +2163,7 @@ __indirect_glVertex4fv(const GLfloat * v) void __indirect_glVertex4i(GLint x, GLint y, GLint z, GLint w) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_Vertex4iv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); @@ -2187,7 +2187,7 @@ __indirect_glVertex4iv(const GLint * v) void __indirect_glVertex4s(GLshort x, GLshort y, GLshort z, GLshort w) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_Vertex4sv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 2); @@ -2211,7 +2211,7 @@ __indirect_glVertex4sv(const GLshort * v) void __indirect_glClipPlane(GLenum plane, const GLdouble * equation) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 40; emit_header(gc->pc, X_GLrop_ClipPlane, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (equation), 32); @@ -2226,7 +2226,7 @@ __indirect_glClipPlane(GLenum plane, const GLdouble * equation) void __indirect_glColorMaterial(GLenum face, GLenum mode) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_ColorMaterial, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&face), 4); @@ -2241,7 +2241,7 @@ __indirect_glColorMaterial(GLenum face, GLenum mode) void __indirect_glCullFace(GLenum mode) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_CullFace, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&mode), 4); @@ -2255,7 +2255,7 @@ __indirect_glCullFace(GLenum mode) void __indirect_glFogf(GLenum pname, GLfloat param) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_Fogf, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&pname), 4); @@ -2270,7 +2270,7 @@ __indirect_glFogf(GLenum pname, GLfloat param) void __indirect_glFogfv(GLenum pname, const GLfloat * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint compsize = __glFogfv_size(pname); const GLuint cmdlen = 8 + __GLX_PAD((compsize * 4)); emit_header(gc->pc, X_GLrop_Fogfv, cmdlen); @@ -2286,7 +2286,7 @@ __indirect_glFogfv(GLenum pname, const GLfloat * params) void __indirect_glFogi(GLenum pname, GLint param) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_Fogi, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&pname), 4); @@ -2301,7 +2301,7 @@ __indirect_glFogi(GLenum pname, GLint param) void __indirect_glFogiv(GLenum pname, const GLint * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint compsize = __glFogiv_size(pname); const GLuint cmdlen = 8 + __GLX_PAD((compsize * 4)); emit_header(gc->pc, X_GLrop_Fogiv, cmdlen); @@ -2317,7 +2317,7 @@ __indirect_glFogiv(GLenum pname, const GLint * params) void __indirect_glFrontFace(GLenum mode) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_FrontFace, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&mode), 4); @@ -2331,7 +2331,7 @@ __indirect_glFrontFace(GLenum mode) void __indirect_glHint(GLenum target, GLenum mode) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_Hint, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -2346,7 +2346,7 @@ __indirect_glHint(GLenum target, GLenum mode) void __indirect_glLightf(GLenum light, GLenum pname, GLfloat param) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_Lightf, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&light), 4); @@ -2362,7 +2362,7 @@ __indirect_glLightf(GLenum light, GLenum pname, GLfloat param) void __indirect_glLightfv(GLenum light, GLenum pname, const GLfloat * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint compsize = __glLightfv_size(pname); const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4)); emit_header(gc->pc, X_GLrop_Lightfv, cmdlen); @@ -2379,7 +2379,7 @@ __indirect_glLightfv(GLenum light, GLenum pname, const GLfloat * params) void __indirect_glLighti(GLenum light, GLenum pname, GLint param) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_Lighti, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&light), 4); @@ -2395,7 +2395,7 @@ __indirect_glLighti(GLenum light, GLenum pname, GLint param) void __indirect_glLightiv(GLenum light, GLenum pname, const GLint * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint compsize = __glLightiv_size(pname); const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4)); emit_header(gc->pc, X_GLrop_Lightiv, cmdlen); @@ -2412,7 +2412,7 @@ __indirect_glLightiv(GLenum light, GLenum pname, const GLint * params) void __indirect_glLightModelf(GLenum pname, GLfloat param) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_LightModelf, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&pname), 4); @@ -2427,7 +2427,7 @@ __indirect_glLightModelf(GLenum pname, GLfloat param) void __indirect_glLightModelfv(GLenum pname, const GLfloat * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint compsize = __glLightModelfv_size(pname); const GLuint cmdlen = 8 + __GLX_PAD((compsize * 4)); emit_header(gc->pc, X_GLrop_LightModelfv, cmdlen); @@ -2443,7 +2443,7 @@ __indirect_glLightModelfv(GLenum pname, const GLfloat * params) void __indirect_glLightModeli(GLenum pname, GLint param) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_LightModeli, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&pname), 4); @@ -2458,7 +2458,7 @@ __indirect_glLightModeli(GLenum pname, GLint param) void __indirect_glLightModeliv(GLenum pname, const GLint * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint compsize = __glLightModeliv_size(pname); const GLuint cmdlen = 8 + __GLX_PAD((compsize * 4)); emit_header(gc->pc, X_GLrop_LightModeliv, cmdlen); @@ -2474,7 +2474,7 @@ __indirect_glLightModeliv(GLenum pname, const GLint * params) void __indirect_glLineStipple(GLint factor, GLushort pattern) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_LineStipple, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&factor), 4); @@ -2489,7 +2489,7 @@ __indirect_glLineStipple(GLint factor, GLushort pattern) void __indirect_glLineWidth(GLfloat width) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_LineWidth, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&width), 4); @@ -2503,7 +2503,7 @@ __indirect_glLineWidth(GLfloat width) void __indirect_glMaterialf(GLenum face, GLenum pname, GLfloat param) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_Materialf, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&face), 4); @@ -2519,7 +2519,7 @@ __indirect_glMaterialf(GLenum face, GLenum pname, GLfloat param) void __indirect_glMaterialfv(GLenum face, GLenum pname, const GLfloat * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint compsize = __glMaterialfv_size(pname); const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4)); emit_header(gc->pc, X_GLrop_Materialfv, cmdlen); @@ -2536,7 +2536,7 @@ __indirect_glMaterialfv(GLenum face, GLenum pname, const GLfloat * params) void __indirect_glMateriali(GLenum face, GLenum pname, GLint param) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_Materiali, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&face), 4); @@ -2552,7 +2552,7 @@ __indirect_glMateriali(GLenum face, GLenum pname, GLint param) void __indirect_glMaterialiv(GLenum face, GLenum pname, const GLint * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint compsize = __glMaterialiv_size(pname); const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4)); emit_header(gc->pc, X_GLrop_Materialiv, cmdlen); @@ -2569,7 +2569,7 @@ __indirect_glMaterialiv(GLenum face, GLenum pname, const GLint * params) void __indirect_glPointSize(GLfloat size) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_PointSize, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&size), 4); @@ -2583,7 +2583,7 @@ __indirect_glPointSize(GLfloat size) void __indirect_glPolygonMode(GLenum face, GLenum mode) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_PolygonMode, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&face), 4); @@ -2598,7 +2598,7 @@ __indirect_glPolygonMode(GLenum face, GLenum mode) void __indirect_glPolygonStipple(const GLubyte *mask) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint compsize = (mask != NULL) ? __glImageSize(32, 32, 1, GL_COLOR_INDEX, GL_BITMAP, 0) : 0; @@ -2621,7 +2621,7 @@ __indirect_glPolygonStipple(const GLubyte *mask) void __indirect_glScissor(GLint x, GLint y, GLsizei width, GLsizei height) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_Scissor, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); @@ -2638,7 +2638,7 @@ __indirect_glScissor(GLint x, GLint y, GLsizei width, GLsizei height) void __indirect_glShadeModel(GLenum mode) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_ShadeModel, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&mode), 4); @@ -2652,7 +2652,7 @@ __indirect_glShadeModel(GLenum mode) void __indirect_glTexParameterf(GLenum target, GLenum pname, GLfloat param) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_TexParameterf, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -2669,7 +2669,7 @@ void __indirect_glTexParameterfv(GLenum target, GLenum pname, const GLfloat * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint compsize = __glTexParameterfv_size(pname); const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4)); emit_header(gc->pc, X_GLrop_TexParameterfv, cmdlen); @@ -2686,7 +2686,7 @@ __indirect_glTexParameterfv(GLenum target, GLenum pname, void __indirect_glTexParameteri(GLenum target, GLenum pname, GLint param) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_TexParameteri, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -2702,7 +2702,7 @@ __indirect_glTexParameteri(GLenum target, GLenum pname, GLint param) void __indirect_glTexParameteriv(GLenum target, GLenum pname, const GLint * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint compsize = __glTexParameteriv_size(pname); const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4)); emit_header(gc->pc, X_GLrop_TexParameteriv, cmdlen); @@ -2721,7 +2721,7 @@ __glx_TexImage_1D2D(unsigned opcode, unsigned dim, GLenum target, GLint level, GLint border, GLenum format, GLenum type, const GLvoid * pixels) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint compsize = __glImageSize(width, height, 1, format, type, target); const GLuint cmdlen = 56 + __GLX_PAD(compsize); @@ -2795,7 +2795,7 @@ __indirect_glTexImage2D(GLenum target, GLint level, GLint internalformat, void __indirect_glTexEnvf(GLenum target, GLenum pname, GLfloat param) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_TexEnvf, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -2811,7 +2811,7 @@ __indirect_glTexEnvf(GLenum target, GLenum pname, GLfloat param) void __indirect_glTexEnvfv(GLenum target, GLenum pname, const GLfloat * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint compsize = __glTexEnvfv_size(pname); const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4)); emit_header(gc->pc, X_GLrop_TexEnvfv, cmdlen); @@ -2828,7 +2828,7 @@ __indirect_glTexEnvfv(GLenum target, GLenum pname, const GLfloat * params) void __indirect_glTexEnvi(GLenum target, GLenum pname, GLint param) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_TexEnvi, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -2844,7 +2844,7 @@ __indirect_glTexEnvi(GLenum target, GLenum pname, GLint param) void __indirect_glTexEnviv(GLenum target, GLenum pname, const GLint * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint compsize = __glTexEnviv_size(pname); const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4)); emit_header(gc->pc, X_GLrop_TexEnviv, cmdlen); @@ -2861,7 +2861,7 @@ __indirect_glTexEnviv(GLenum target, GLenum pname, const GLint * params) void __indirect_glTexGend(GLenum coord, GLenum pname, GLdouble param) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_TexGend, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (¶m), 8); @@ -2877,7 +2877,7 @@ __indirect_glTexGend(GLenum coord, GLenum pname, GLdouble param) void __indirect_glTexGendv(GLenum coord, GLenum pname, const GLdouble * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint compsize = __glTexGendv_size(pname); const GLuint cmdlen = 12 + __GLX_PAD((compsize * 8)); emit_header(gc->pc, X_GLrop_TexGendv, cmdlen); @@ -2894,7 +2894,7 @@ __indirect_glTexGendv(GLenum coord, GLenum pname, const GLdouble * params) void __indirect_glTexGenf(GLenum coord, GLenum pname, GLfloat param) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_TexGenf, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&coord), 4); @@ -2910,7 +2910,7 @@ __indirect_glTexGenf(GLenum coord, GLenum pname, GLfloat param) void __indirect_glTexGenfv(GLenum coord, GLenum pname, const GLfloat * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint compsize = __glTexGenfv_size(pname); const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4)); emit_header(gc->pc, X_GLrop_TexGenfv, cmdlen); @@ -2927,7 +2927,7 @@ __indirect_glTexGenfv(GLenum coord, GLenum pname, const GLfloat * params) void __indirect_glTexGeni(GLenum coord, GLenum pname, GLint param) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_TexGeni, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&coord), 4); @@ -2943,7 +2943,7 @@ __indirect_glTexGeni(GLenum coord, GLenum pname, GLint param) void __indirect_glTexGeniv(GLenum coord, GLenum pname, const GLint * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint compsize = __glTexGeniv_size(pname); const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4)); emit_header(gc->pc, X_GLrop_TexGeniv, cmdlen); @@ -2960,7 +2960,7 @@ __indirect_glTexGeniv(GLenum coord, GLenum pname, const GLint * params) void __indirect_glInitNames(void) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 4; emit_header(gc->pc, X_GLrop_InitNames, cmdlen); gc->pc += cmdlen; @@ -2973,7 +2973,7 @@ __indirect_glInitNames(void) void __indirect_glLoadName(GLuint name) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_LoadName, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&name), 4); @@ -2987,7 +2987,7 @@ __indirect_glLoadName(GLuint name) void __indirect_glPassThrough(GLfloat token) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_PassThrough, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&token), 4); @@ -3001,7 +3001,7 @@ __indirect_glPassThrough(GLfloat token) void __indirect_glPopName(void) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 4; emit_header(gc->pc, X_GLrop_PopName, cmdlen); gc->pc += cmdlen; @@ -3014,7 +3014,7 @@ __indirect_glPopName(void) void __indirect_glPushName(GLuint name) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_PushName, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&name), 4); @@ -3028,7 +3028,7 @@ __indirect_glPushName(GLuint name) void __indirect_glDrawBuffer(GLenum mode) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_DrawBuffer, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&mode), 4); @@ -3042,7 +3042,7 @@ __indirect_glDrawBuffer(GLenum mode) void __indirect_glClear(GLbitfield mask) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_Clear, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&mask), 4); @@ -3057,7 +3057,7 @@ void __indirect_glClearAccum(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_ClearAccum, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 4); @@ -3074,7 +3074,7 @@ __indirect_glClearAccum(GLfloat red, GLfloat green, GLfloat blue, void __indirect_glClearIndex(GLfloat c) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_ClearIndex, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&c), 4); @@ -3089,7 +3089,7 @@ void __indirect_glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_ClearColor, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 4); @@ -3106,7 +3106,7 @@ __indirect_glClearColor(GLclampf red, GLclampf green, GLclampf blue, void __indirect_glClearStencil(GLint s) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_ClearStencil, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 4); @@ -3120,7 +3120,7 @@ __indirect_glClearStencil(GLint s) void __indirect_glClearDepth(GLclampd depth) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_ClearDepth, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&depth), 8); @@ -3134,7 +3134,7 @@ __indirect_glClearDepth(GLclampd depth) void __indirect_glStencilMask(GLuint mask) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_StencilMask, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&mask), 4); @@ -3149,7 +3149,7 @@ void __indirect_glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_ColorMask, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 1); @@ -3166,7 +3166,7 @@ __indirect_glColorMask(GLboolean red, GLboolean green, GLboolean blue, void __indirect_glDepthMask(GLboolean flag) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_DepthMask, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&flag), 1); @@ -3180,7 +3180,7 @@ __indirect_glDepthMask(GLboolean flag) void __indirect_glIndexMask(GLuint mask) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_IndexMask, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&mask), 4); @@ -3194,7 +3194,7 @@ __indirect_glIndexMask(GLuint mask) void __indirect_glAccum(GLenum op, GLfloat value) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_Accum, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&op), 4); @@ -3209,7 +3209,7 @@ __indirect_glAccum(GLenum op, GLfloat value) void __indirect_glPopAttrib(void) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 4; emit_header(gc->pc, X_GLrop_PopAttrib, cmdlen); gc->pc += cmdlen; @@ -3222,7 +3222,7 @@ __indirect_glPopAttrib(void) void __indirect_glPushAttrib(GLbitfield mask) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_PushAttrib, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&mask), 4); @@ -3236,7 +3236,7 @@ __indirect_glPushAttrib(GLbitfield mask) void __indirect_glMapGrid1d(GLint un, GLdouble u1, GLdouble u2) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_MapGrid1d, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&u1), 8); @@ -3252,7 +3252,7 @@ __indirect_glMapGrid1d(GLint un, GLdouble u1, GLdouble u2) void __indirect_glMapGrid1f(GLint un, GLfloat u1, GLfloat u2) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_MapGrid1f, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&un), 4); @@ -3269,7 +3269,7 @@ void __indirect_glMapGrid2d(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 44; emit_header(gc->pc, X_GLrop_MapGrid2d, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&u1), 8); @@ -3289,7 +3289,7 @@ void __indirect_glMapGrid2f(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 28; emit_header(gc->pc, X_GLrop_MapGrid2f, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&un), 4); @@ -3308,7 +3308,7 @@ __indirect_glMapGrid2f(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, void __indirect_glEvalCoord1d(GLdouble u) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_EvalCoord1dv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&u), 8); @@ -3329,7 +3329,7 @@ __indirect_glEvalCoord1dv(const GLdouble * u) void __indirect_glEvalCoord1f(GLfloat u) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_EvalCoord1fv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&u), 4); @@ -3350,7 +3350,7 @@ __indirect_glEvalCoord1fv(const GLfloat * u) void __indirect_glEvalCoord2d(GLdouble u, GLdouble v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_EvalCoord2dv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&u), 8); @@ -3372,7 +3372,7 @@ __indirect_glEvalCoord2dv(const GLdouble * u) void __indirect_glEvalCoord2f(GLfloat u, GLfloat v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_EvalCoord2fv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&u), 4); @@ -3394,7 +3394,7 @@ __indirect_glEvalCoord2fv(const GLfloat * u) void __indirect_glEvalMesh1(GLenum mode, GLint i1, GLint i2) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_EvalMesh1, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&mode), 4); @@ -3410,7 +3410,7 @@ __indirect_glEvalMesh1(GLenum mode, GLint i1, GLint i2) void __indirect_glEvalPoint1(GLint i) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_EvalPoint1, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&i), 4); @@ -3424,7 +3424,7 @@ __indirect_glEvalPoint1(GLint i) void __indirect_glEvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_EvalMesh2, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&mode), 4); @@ -3442,7 +3442,7 @@ __indirect_glEvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2) void __indirect_glEvalPoint2(GLint i, GLint j) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_EvalPoint2, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&i), 4); @@ -3457,7 +3457,7 @@ __indirect_glEvalPoint2(GLint i, GLint j) void __indirect_glAlphaFunc(GLenum func, GLclampf ref) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_AlphaFunc, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&func), 4); @@ -3472,7 +3472,7 @@ __indirect_glAlphaFunc(GLenum func, GLclampf ref) void __indirect_glBlendFunc(GLenum sfactor, GLenum dfactor) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_BlendFunc, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&sfactor), 4); @@ -3487,7 +3487,7 @@ __indirect_glBlendFunc(GLenum sfactor, GLenum dfactor) void __indirect_glLogicOp(GLenum opcode) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_LogicOp, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&opcode), 4); @@ -3501,7 +3501,7 @@ __indirect_glLogicOp(GLenum opcode) void __indirect_glStencilFunc(GLenum func, GLint ref, GLuint mask) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_StencilFunc, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&func), 4); @@ -3517,7 +3517,7 @@ __indirect_glStencilFunc(GLenum func, GLint ref, GLuint mask) void __indirect_glStencilOp(GLenum fail, GLenum zfail, GLenum zpass) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_StencilOp, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&fail), 4); @@ -3533,7 +3533,7 @@ __indirect_glStencilOp(GLenum fail, GLenum zfail, GLenum zpass) void __indirect_glDepthFunc(GLenum func) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_DepthFunc, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&func), 4); @@ -3547,7 +3547,7 @@ __indirect_glDepthFunc(GLenum func) void __indirect_glPixelZoom(GLfloat xfactor, GLfloat yfactor) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_PixelZoom, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&xfactor), 4); @@ -3562,7 +3562,7 @@ __indirect_glPixelZoom(GLfloat xfactor, GLfloat yfactor) void __indirect_glPixelTransferf(GLenum pname, GLfloat param) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_PixelTransferf, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&pname), 4); @@ -3577,7 +3577,7 @@ __indirect_glPixelTransferf(GLenum pname, GLfloat param) void __indirect_glPixelTransferi(GLenum pname, GLint param) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_PixelTransferi, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&pname), 4); @@ -3592,7 +3592,7 @@ __indirect_glPixelTransferi(GLenum pname, GLint param) void __indirect_glPixelMapfv(GLenum map, GLsizei mapsize, const GLfloat * values) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12 + __GLX_PAD((mapsize * 4)); if (mapsize < 0) { __glXSetError(gc, GL_INVALID_VALUE); @@ -3629,7 +3629,7 @@ __indirect_glPixelMapfv(GLenum map, GLsizei mapsize, const GLfloat * values) void __indirect_glPixelMapuiv(GLenum map, GLsizei mapsize, const GLuint * values) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12 + __GLX_PAD((mapsize * 4)); if (mapsize < 0) { __glXSetError(gc, GL_INVALID_VALUE); @@ -3666,7 +3666,7 @@ __indirect_glPixelMapuiv(GLenum map, GLsizei mapsize, const GLuint * values) void __indirect_glPixelMapusv(GLenum map, GLsizei mapsize, const GLushort * values) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12 + __GLX_PAD((mapsize * 2)); if (mapsize < 0) { __glXSetError(gc, GL_INVALID_VALUE); @@ -3703,7 +3703,7 @@ __indirect_glPixelMapusv(GLenum map, GLsizei mapsize, const GLushort * values) void __indirect_glReadBuffer(GLenum mode) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_ReadBuffer, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&mode), 4); @@ -3718,7 +3718,7 @@ void __indirect_glCopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_CopyPixels, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); @@ -3737,7 +3737,7 @@ void __indirect_glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * pixels) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const __GLXattribute *const state = gc->client_state_private; Display *const dpy = gc->currentDpy; #ifndef USE_XCB @@ -3786,7 +3786,7 @@ void __indirect_glDrawPixels(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint compsize = (pixels != NULL) ? __glImageSize(width, height, 1, format, type, 0) : 0; @@ -3832,7 +3832,7 @@ __indirect_glDrawPixels(GLsizei width, GLsizei height, GLenum format, void __indirect_glGetClipPlane(GLenum plane, GLdouble * equation) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; #ifndef USE_XCB const GLuint cmdlen = 4; @@ -3867,7 +3867,7 @@ __indirect_glGetClipPlane(GLenum plane, GLdouble * equation) void __indirect_glGetLightfv(GLenum light, GLenum pname, GLfloat * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; #ifndef USE_XCB const GLuint cmdlen = 8; @@ -3907,7 +3907,7 @@ __indirect_glGetLightfv(GLenum light, GLenum pname, GLfloat * params) void __indirect_glGetLightiv(GLenum light, GLenum pname, GLint * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; #ifndef USE_XCB const GLuint cmdlen = 8; @@ -3947,7 +3947,7 @@ __indirect_glGetLightiv(GLenum light, GLenum pname, GLint * params) void __indirect_glGetMapdv(GLenum target, GLenum query, GLdouble * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; #ifndef USE_XCB const GLuint cmdlen = 8; @@ -3985,7 +3985,7 @@ __indirect_glGetMapdv(GLenum target, GLenum query, GLdouble * v) void __indirect_glGetMapfv(GLenum target, GLenum query, GLfloat * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; #ifndef USE_XCB const GLuint cmdlen = 8; @@ -4023,7 +4023,7 @@ __indirect_glGetMapfv(GLenum target, GLenum query, GLfloat * v) void __indirect_glGetMapiv(GLenum target, GLenum query, GLint * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; #ifndef USE_XCB const GLuint cmdlen = 8; @@ -4061,7 +4061,7 @@ __indirect_glGetMapiv(GLenum target, GLenum query, GLint * v) void __indirect_glGetMaterialfv(GLenum face, GLenum pname, GLfloat * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; #ifndef USE_XCB const GLuint cmdlen = 8; @@ -4101,7 +4101,7 @@ __indirect_glGetMaterialfv(GLenum face, GLenum pname, GLfloat * params) void __indirect_glGetMaterialiv(GLenum face, GLenum pname, GLint * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; #ifndef USE_XCB const GLuint cmdlen = 8; @@ -4141,7 +4141,7 @@ __indirect_glGetMaterialiv(GLenum face, GLenum pname, GLint * params) void __indirect_glGetPixelMapfv(GLenum map, GLfloat * values) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; #ifndef USE_XCB const GLuint cmdlen = 4; @@ -4179,7 +4179,7 @@ __indirect_glGetPixelMapfv(GLenum map, GLfloat * values) void __indirect_glGetPixelMapuiv(GLenum map, GLuint * values) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; #ifndef USE_XCB const GLuint cmdlen = 4; @@ -4218,7 +4218,7 @@ __indirect_glGetPixelMapuiv(GLenum map, GLuint * values) void __indirect_glGetPixelMapusv(GLenum map, GLushort * values) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; #ifndef USE_XCB const GLuint cmdlen = 4; @@ -4257,7 +4257,7 @@ __indirect_glGetPixelMapusv(GLenum map, GLushort * values) void __indirect_glGetPolygonStipple(GLubyte *mask) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; #ifndef USE_XCB const GLuint cmdlen = 4; @@ -4294,7 +4294,7 @@ __indirect_glGetPolygonStipple(GLubyte *mask) void __indirect_glGetTexEnvfv(GLenum target, GLenum pname, GLfloat * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; #ifndef USE_XCB const GLuint cmdlen = 8; @@ -4334,7 +4334,7 @@ __indirect_glGetTexEnvfv(GLenum target, GLenum pname, GLfloat * params) void __indirect_glGetTexEnviv(GLenum target, GLenum pname, GLint * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; #ifndef USE_XCB const GLuint cmdlen = 8; @@ -4374,7 +4374,7 @@ __indirect_glGetTexEnviv(GLenum target, GLenum pname, GLint * params) void __indirect_glGetTexGendv(GLenum coord, GLenum pname, GLdouble * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; #ifndef USE_XCB const GLuint cmdlen = 8; @@ -4414,7 +4414,7 @@ __indirect_glGetTexGendv(GLenum coord, GLenum pname, GLdouble * params) void __indirect_glGetTexGenfv(GLenum coord, GLenum pname, GLfloat * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; #ifndef USE_XCB const GLuint cmdlen = 8; @@ -4454,7 +4454,7 @@ __indirect_glGetTexGenfv(GLenum coord, GLenum pname, GLfloat * params) void __indirect_glGetTexGeniv(GLenum coord, GLenum pname, GLint * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; #ifndef USE_XCB const GLuint cmdlen = 8; @@ -4495,7 +4495,7 @@ void __indirect_glGetTexImage(GLenum target, GLint level, GLenum format, GLenum type, GLvoid * pixels) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const __GLXattribute *const state = gc->client_state_private; Display *const dpy = gc->currentDpy; #ifndef USE_XCB @@ -4542,7 +4542,7 @@ __indirect_glGetTexImage(GLenum target, GLint level, GLenum format, void __indirect_glGetTexParameterfv(GLenum target, GLenum pname, GLfloat * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; #ifndef USE_XCB const GLuint cmdlen = 8; @@ -4583,7 +4583,7 @@ __indirect_glGetTexParameterfv(GLenum target, GLenum pname, GLfloat * params) void __indirect_glGetTexParameteriv(GLenum target, GLenum pname, GLint * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; #ifndef USE_XCB const GLuint cmdlen = 8; @@ -4625,7 +4625,7 @@ void __indirect_glGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; #ifndef USE_XCB const GLuint cmdlen = 12; @@ -4668,7 +4668,7 @@ void __indirect_glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; #ifndef USE_XCB const GLuint cmdlen = 12; @@ -4710,7 +4710,7 @@ __indirect_glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLboolean __indirect_glIsList(GLuint list) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; GLboolean retval = (GLboolean) 0; #ifndef USE_XCB @@ -4742,7 +4742,7 @@ __indirect_glIsList(GLuint list) void __indirect_glDepthRange(GLclampd zNear, GLclampd zFar) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_DepthRange, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&zNear), 8); @@ -4758,7 +4758,7 @@ void __indirect_glFrustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 52; emit_header(gc->pc, X_GLrop_Frustum, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&left), 8); @@ -4777,7 +4777,7 @@ __indirect_glFrustum(GLdouble left, GLdouble right, GLdouble bottom, void __indirect_glLoadIdentity(void) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 4; emit_header(gc->pc, X_GLrop_LoadIdentity, cmdlen); gc->pc += cmdlen; @@ -4790,7 +4790,7 @@ __indirect_glLoadIdentity(void) void __indirect_glLoadMatrixf(const GLfloat * m) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 68; emit_header(gc->pc, X_GLrop_LoadMatrixf, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (m), 64); @@ -4804,7 +4804,7 @@ __indirect_glLoadMatrixf(const GLfloat * m) void __indirect_glLoadMatrixd(const GLdouble * m) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 132; emit_header(gc->pc, X_GLrop_LoadMatrixd, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (m), 128); @@ -4818,7 +4818,7 @@ __indirect_glLoadMatrixd(const GLdouble * m) void __indirect_glMatrixMode(GLenum mode) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_MatrixMode, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&mode), 4); @@ -4832,7 +4832,7 @@ __indirect_glMatrixMode(GLenum mode) void __indirect_glMultMatrixf(const GLfloat * m) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 68; emit_header(gc->pc, X_GLrop_MultMatrixf, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (m), 64); @@ -4846,7 +4846,7 @@ __indirect_glMultMatrixf(const GLfloat * m) void __indirect_glMultMatrixd(const GLdouble * m) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 132; emit_header(gc->pc, X_GLrop_MultMatrixd, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (m), 128); @@ -4861,7 +4861,7 @@ void __indirect_glOrtho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 52; emit_header(gc->pc, X_GLrop_Ortho, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&left), 8); @@ -4880,7 +4880,7 @@ __indirect_glOrtho(GLdouble left, GLdouble right, GLdouble bottom, void __indirect_glPopMatrix(void) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 4; emit_header(gc->pc, X_GLrop_PopMatrix, cmdlen); gc->pc += cmdlen; @@ -4893,7 +4893,7 @@ __indirect_glPopMatrix(void) void __indirect_glPushMatrix(void) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 4; emit_header(gc->pc, X_GLrop_PushMatrix, cmdlen); gc->pc += cmdlen; @@ -4906,7 +4906,7 @@ __indirect_glPushMatrix(void) void __indirect_glRotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 36; emit_header(gc->pc, X_GLrop_Rotated, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&angle), 8); @@ -4923,7 +4923,7 @@ __indirect_glRotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z) void __indirect_glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_Rotatef, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&angle), 4); @@ -4940,7 +4940,7 @@ __indirect_glRotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z) void __indirect_glScaled(GLdouble x, GLdouble y, GLdouble z) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 28; emit_header(gc->pc, X_GLrop_Scaled, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 8); @@ -4956,7 +4956,7 @@ __indirect_glScaled(GLdouble x, GLdouble y, GLdouble z) void __indirect_glScalef(GLfloat x, GLfloat y, GLfloat z) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_Scalef, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); @@ -4972,7 +4972,7 @@ __indirect_glScalef(GLfloat x, GLfloat y, GLfloat z) void __indirect_glTranslated(GLdouble x, GLdouble y, GLdouble z) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 28; emit_header(gc->pc, X_GLrop_Translated, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 8); @@ -4988,7 +4988,7 @@ __indirect_glTranslated(GLdouble x, GLdouble y, GLdouble z) void __indirect_glTranslatef(GLfloat x, GLfloat y, GLfloat z) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_Translatef, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); @@ -5004,7 +5004,7 @@ __indirect_glTranslatef(GLfloat x, GLfloat y, GLfloat z) void __indirect_glViewport(GLint x, GLint y, GLsizei width, GLsizei height) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_Viewport, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); @@ -5021,7 +5021,7 @@ __indirect_glViewport(GLint x, GLint y, GLsizei width, GLsizei height) void __indirect_glBindTexture(GLenum target, GLuint texture) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_BindTexture, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -5036,7 +5036,7 @@ __indirect_glBindTexture(GLenum target, GLuint texture) void __indirect_glIndexub(GLubyte c) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_Indexubv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&c), 1); @@ -5050,7 +5050,7 @@ __indirect_glIndexub(GLubyte c) void __indirect_glIndexubv(const GLubyte *c) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_Indexubv, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (c), 1); @@ -5064,7 +5064,7 @@ __indirect_glIndexubv(const GLubyte *c) void __indirect_glPolygonOffset(GLfloat factor, GLfloat units) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_PolygonOffset, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&factor), 4); @@ -5080,7 +5080,7 @@ void __indirect_glCopyTexImage1D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 32; emit_header(gc->pc, X_GLrop_CopyTexImage1D, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -5102,7 +5102,7 @@ __indirect_glCopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 36; emit_header(gc->pc, X_GLrop_CopyTexImage2D, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -5124,7 +5124,7 @@ void __indirect_glCopyTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 28; emit_header(gc->pc, X_GLrop_CopyTexSubImage1D, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -5145,7 +5145,7 @@ __indirect_glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 36; emit_header(gc->pc, X_GLrop_CopyTexSubImage2D, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -5166,7 +5166,7 @@ __indirect_glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, void __indirect_glDeleteTextures(GLsizei n, const GLuint * textures) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; #ifndef USE_XCB const GLuint cmdlen = 4 + __GLX_PAD((n * 4)); @@ -5196,7 +5196,7 @@ __indirect_glDeleteTextures(GLsizei n, const GLuint * textures) void glDeleteTexturesEXT(GLsizei n, const GLuint * textures) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) if (gc->driContext) { @@ -5204,7 +5204,7 @@ glDeleteTexturesEXT(GLsizei n, const GLuint * textures) } else #endif { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; const GLuint cmdlen = 4 + __GLX_PAD((n * 4)); if (n < 0) { @@ -5228,7 +5228,7 @@ glDeleteTexturesEXT(GLsizei n, const GLuint * textures) void __indirect_glGenTextures(GLsizei n, GLuint * textures) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; #ifndef USE_XCB const GLuint cmdlen = 4; @@ -5267,7 +5267,7 @@ __indirect_glGenTextures(GLsizei n, GLuint * textures) void glGenTexturesEXT(GLsizei n, GLuint * textures) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) if (gc->driContext) { @@ -5275,7 +5275,7 @@ glGenTexturesEXT(GLsizei n, GLuint * textures) } else #endif { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; const GLuint cmdlen = 4; if (n < 0) { @@ -5299,7 +5299,7 @@ glGenTexturesEXT(GLsizei n, GLuint * textures) GLboolean __indirect_glIsTexture(GLuint texture) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; GLboolean retval = (GLboolean) 0; #ifndef USE_XCB @@ -5332,7 +5332,7 @@ __indirect_glIsTexture(GLuint texture) GLboolean glIsTextureEXT(GLuint texture) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) if (gc->driContext) { @@ -5340,7 +5340,7 @@ glIsTextureEXT(GLuint texture) } else #endif { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; GLboolean retval = (GLboolean) 0; const GLuint cmdlen = 4; @@ -5362,7 +5362,7 @@ void __indirect_glPrioritizeTextures(GLsizei n, const GLuint * textures, const GLclampf * priorities) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8 + __GLX_PAD((n * 4)) + __GLX_PAD((n * 4)); if (n < 0) { __glXSetError(gc, GL_INVALID_VALUE); @@ -5387,7 +5387,7 @@ __glx_TexSubImage_1D2D(unsigned opcode, unsigned dim, GLenum target, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint compsize = (pixels != NULL) ? __glImageSize(width, height, 1, format, type, target) : 0; @@ -5464,7 +5464,7 @@ void __indirect_glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_BlendColor, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 4); @@ -5481,7 +5481,7 @@ __indirect_glBlendColor(GLclampf red, GLclampf green, GLclampf blue, void __indirect_glBlendEquation(GLenum mode) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_BlendEquation, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&mode), 4); @@ -5496,7 +5496,7 @@ void __indirect_glColorTable(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint compsize = (table != NULL) ? __glImageSize(width, 1, 1, format, type, target) : 0; @@ -5546,7 +5546,7 @@ void __indirect_glColorTableParameterfv(GLenum target, GLenum pname, const GLfloat * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint compsize = __glColorTableParameterfv_size(pname); const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4)); emit_header(gc->pc, X_GLrop_ColorTableParameterfv, cmdlen); @@ -5564,7 +5564,7 @@ void __indirect_glColorTableParameteriv(GLenum target, GLenum pname, const GLint * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint compsize = __glColorTableParameteriv_size(pname); const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4)); emit_header(gc->pc, X_GLrop_ColorTableParameteriv, cmdlen); @@ -5582,7 +5582,7 @@ void __indirect_glCopyColorTable(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_CopyColorTable, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -5601,7 +5601,7 @@ void __indirect_glGetColorTable(GLenum target, GLenum format, GLenum type, GLvoid * table) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const __GLXattribute *const state = gc->client_state_private; Display *const dpy = gc->currentDpy; #ifndef USE_XCB @@ -5648,7 +5648,7 @@ __indirect_glGetColorTable(GLenum target, GLenum format, GLenum type, void glGetColorTableEXT(GLenum target, GLenum format, GLenum type, GLvoid * table) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) if (gc->driContext) { @@ -5656,7 +5656,7 @@ glGetColorTableEXT(GLenum target, GLenum format, GLenum type, GLvoid * table) } else #endif { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const __GLXattribute *const state = gc->client_state_private; Display *const dpy = gc->currentDpy; const GLuint cmdlen = 16; @@ -5683,7 +5683,7 @@ void __indirect_glGetColorTableParameterfv(GLenum target, GLenum pname, GLfloat * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; #ifndef USE_XCB const GLuint cmdlen = 8; @@ -5724,7 +5724,7 @@ __indirect_glGetColorTableParameterfv(GLenum target, GLenum pname, void glGetColorTableParameterfvEXT(GLenum target, GLenum pname, GLfloat * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) if (gc->driContext) { @@ -5733,7 +5733,7 @@ glGetColorTableParameterfvEXT(GLenum target, GLenum pname, GLfloat * params) } else #endif { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { @@ -5756,7 +5756,7 @@ void __indirect_glGetColorTableParameteriv(GLenum target, GLenum pname, GLint * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; #ifndef USE_XCB const GLuint cmdlen = 8; @@ -5797,7 +5797,7 @@ __indirect_glGetColorTableParameteriv(GLenum target, GLenum pname, void glGetColorTableParameterivEXT(GLenum target, GLenum pname, GLint * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) if (gc->driContext) { @@ -5806,7 +5806,7 @@ glGetColorTableParameterivEXT(GLenum target, GLenum pname, GLint * params) } else #endif { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { @@ -5829,7 +5829,7 @@ void __indirect_glColorSubTable(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint compsize = (data != NULL) ? __glImageSize(count, 1, 1, format, type, target) : 0; const GLuint cmdlen = 44 + __GLX_PAD(compsize); @@ -5877,7 +5877,7 @@ void __indirect_glCopyColorSubTable(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_CopyColorSubTable, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -5897,7 +5897,7 @@ __glx_ConvolutionFilter_1D2D(unsigned opcode, unsigned dim, GLenum target, GLsizei height, GLenum format, GLenum type, const GLvoid * image) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint compsize = (image != NULL) ? __glImageSize(width, height, 1, format, type, target) : 0; @@ -5971,7 +5971,7 @@ void __indirect_glConvolutionParameterf(GLenum target, GLenum pname, GLfloat params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_ConvolutionParameterf, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -5988,7 +5988,7 @@ void __indirect_glConvolutionParameterfv(GLenum target, GLenum pname, const GLfloat * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint compsize = __glConvolutionParameterfv_size(pname); const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4)); emit_header(gc->pc, X_GLrop_ConvolutionParameterfv, cmdlen); @@ -6005,7 +6005,7 @@ __indirect_glConvolutionParameterfv(GLenum target, GLenum pname, void __indirect_glConvolutionParameteri(GLenum target, GLenum pname, GLint params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_ConvolutionParameteri, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -6022,7 +6022,7 @@ void __indirect_glConvolutionParameteriv(GLenum target, GLenum pname, const GLint * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint compsize = __glConvolutionParameteriv_size(pname); const GLuint cmdlen = 12 + __GLX_PAD((compsize * 4)); emit_header(gc->pc, X_GLrop_ConvolutionParameteriv, cmdlen); @@ -6040,7 +6040,7 @@ void __indirect_glCopyConvolutionFilter1D(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_CopyConvolutionFilter1D, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -6060,7 +6060,7 @@ __indirect_glCopyConvolutionFilter2D(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 28; emit_header(gc->pc, X_GLrop_CopyConvolutionFilter2D, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -6080,7 +6080,7 @@ void __indirect_glGetConvolutionFilter(GLenum target, GLenum format, GLenum type, GLvoid * image) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const __GLXattribute *const state = gc->client_state_private; Display *const dpy = gc->currentDpy; #ifndef USE_XCB @@ -6123,7 +6123,7 @@ void gl_dispatch_stub_356(GLenum target, GLenum format, GLenum type, GLvoid * image) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) if (gc->driContext) { @@ -6132,7 +6132,7 @@ gl_dispatch_stub_356(GLenum target, GLenum format, GLenum type, } else #endif { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const __GLXattribute *const state = gc->client_state_private; Display *const dpy = gc->currentDpy; const GLuint cmdlen = 16; @@ -6160,7 +6160,7 @@ void __indirect_glGetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; #ifndef USE_XCB const GLuint cmdlen = 8; @@ -6201,7 +6201,7 @@ __indirect_glGetConvolutionParameterfv(GLenum target, GLenum pname, void gl_dispatch_stub_357(GLenum target, GLenum pname, GLfloat * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) if (gc->driContext) { @@ -6210,7 +6210,7 @@ gl_dispatch_stub_357(GLenum target, GLenum pname, GLfloat * params) } else #endif { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { @@ -6233,7 +6233,7 @@ void __indirect_glGetConvolutionParameteriv(GLenum target, GLenum pname, GLint * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; #ifndef USE_XCB const GLuint cmdlen = 8; @@ -6274,7 +6274,7 @@ __indirect_glGetConvolutionParameteriv(GLenum target, GLenum pname, void gl_dispatch_stub_358(GLenum target, GLenum pname, GLint * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) if (gc->driContext) { @@ -6283,7 +6283,7 @@ gl_dispatch_stub_358(GLenum target, GLenum pname, GLint * params) } else #endif { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { @@ -6306,7 +6306,7 @@ void __indirect_glGetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const __GLXattribute *const state = gc->client_state_private; Display *const dpy = gc->currentDpy; #ifndef USE_XCB @@ -6354,7 +6354,7 @@ void gl_dispatch_stub_361(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) if (gc->driContext) { @@ -6363,7 +6363,7 @@ gl_dispatch_stub_361(GLenum target, GLboolean reset, GLenum format, } else #endif { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const __GLXattribute *const state = gc->client_state_private; Display *const dpy = gc->currentDpy; const GLuint cmdlen = 16; @@ -6391,7 +6391,7 @@ void __indirect_glGetHistogramParameterfv(GLenum target, GLenum pname, GLfloat * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; #ifndef USE_XCB const GLuint cmdlen = 8; @@ -6431,7 +6431,7 @@ __indirect_glGetHistogramParameterfv(GLenum target, GLenum pname, void gl_dispatch_stub_362(GLenum target, GLenum pname, GLfloat * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) if (gc->driContext) { @@ -6439,7 +6439,7 @@ gl_dispatch_stub_362(GLenum target, GLenum pname, GLfloat * params) } else #endif { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { @@ -6462,7 +6462,7 @@ void __indirect_glGetHistogramParameteriv(GLenum target, GLenum pname, GLint * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; #ifndef USE_XCB const GLuint cmdlen = 8; @@ -6502,7 +6502,7 @@ __indirect_glGetHistogramParameteriv(GLenum target, GLenum pname, void gl_dispatch_stub_363(GLenum target, GLenum pname, GLint * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) if (gc->driContext) { @@ -6510,7 +6510,7 @@ gl_dispatch_stub_363(GLenum target, GLenum pname, GLint * params) } else #endif { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { @@ -6533,7 +6533,7 @@ void __indirect_glGetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const __GLXattribute *const state = gc->client_state_private; Display *const dpy = gc->currentDpy; #ifndef USE_XCB @@ -6577,7 +6577,7 @@ void gl_dispatch_stub_364(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) if (gc->driContext) { @@ -6585,7 +6585,7 @@ gl_dispatch_stub_364(GLenum target, GLboolean reset, GLenum format, } else #endif { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const __GLXattribute *const state = gc->client_state_private; Display *const dpy = gc->currentDpy; const GLuint cmdlen = 16; @@ -6613,7 +6613,7 @@ void __indirect_glGetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; #ifndef USE_XCB const GLuint cmdlen = 8; @@ -6651,7 +6651,7 @@ __indirect_glGetMinmaxParameterfv(GLenum target, GLenum pname, void gl_dispatch_stub_365(GLenum target, GLenum pname, GLfloat * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) if (gc->driContext) { @@ -6659,7 +6659,7 @@ gl_dispatch_stub_365(GLenum target, GLenum pname, GLfloat * params) } else #endif { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { @@ -6681,7 +6681,7 @@ gl_dispatch_stub_365(GLenum target, GLenum pname, GLfloat * params) void __indirect_glGetMinmaxParameteriv(GLenum target, GLenum pname, GLint * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; #ifndef USE_XCB const GLuint cmdlen = 8; @@ -6719,7 +6719,7 @@ __indirect_glGetMinmaxParameteriv(GLenum target, GLenum pname, GLint * params) void gl_dispatch_stub_366(GLenum target, GLenum pname, GLint * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) if (gc->driContext) { @@ -6727,7 +6727,7 @@ gl_dispatch_stub_366(GLenum target, GLenum pname, GLint * params) } else #endif { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { @@ -6750,7 +6750,7 @@ void __indirect_glHistogram(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_Histogram, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -6767,7 +6767,7 @@ __indirect_glHistogram(GLenum target, GLsizei width, GLenum internalformat, void __indirect_glMinmax(GLenum target, GLenum internalformat, GLboolean sink) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_Minmax, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -6783,7 +6783,7 @@ __indirect_glMinmax(GLenum target, GLenum internalformat, GLboolean sink) void __indirect_glResetHistogram(GLenum target) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_ResetHistogram, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -6797,7 +6797,7 @@ __indirect_glResetHistogram(GLenum target) void __indirect_glResetMinmax(GLenum target) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_ResetMinmax, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -6813,7 +6813,7 @@ __glx_TexImage_3D4D(unsigned opcode, unsigned dim, GLenum target, GLint level, GLsizei depth, GLsizei extent, GLint border, GLenum format, GLenum type, const GLvoid * pixels) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint compsize = (pixels != NULL) ? __glImageSize(width, height, depth, format, type, target) : 0; @@ -6890,7 +6890,7 @@ __glx_TexSubImage_3D4D(unsigned opcode, unsigned dim, GLenum target, GLsizei height, GLsizei depth, GLsizei extent, GLenum format, GLenum type, const GLvoid * pixels) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint compsize = (pixels != NULL) ? __glImageSize(width, height, depth, format, type, target) : 0; @@ -6968,7 +6968,7 @@ __indirect_glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 40; emit_header(gc->pc, X_GLrop_CopyTexSubImage3D, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -6990,7 +6990,7 @@ __indirect_glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, void __indirect_glActiveTextureARB(GLenum texture) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_ActiveTextureARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&texture), 4); @@ -7004,7 +7004,7 @@ __indirect_glActiveTextureARB(GLenum texture) void __indirect_glMultiTexCoord1dARB(GLenum target, GLdouble s) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_MultiTexCoord1dvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 8); @@ -7019,7 +7019,7 @@ __indirect_glMultiTexCoord1dARB(GLenum target, GLdouble s) void __indirect_glMultiTexCoord1dvARB(GLenum target, const GLdouble * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_MultiTexCoord1dvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (v), 8); @@ -7034,7 +7034,7 @@ __indirect_glMultiTexCoord1dvARB(GLenum target, const GLdouble * v) void __indirect_glMultiTexCoord1fARB(GLenum target, GLfloat s) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_MultiTexCoord1fvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -7049,7 +7049,7 @@ __indirect_glMultiTexCoord1fARB(GLenum target, GLfloat s) void __indirect_glMultiTexCoord1fvARB(GLenum target, const GLfloat * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_MultiTexCoord1fvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -7064,7 +7064,7 @@ __indirect_glMultiTexCoord1fvARB(GLenum target, const GLfloat * v) void __indirect_glMultiTexCoord1iARB(GLenum target, GLint s) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_MultiTexCoord1ivARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -7079,7 +7079,7 @@ __indirect_glMultiTexCoord1iARB(GLenum target, GLint s) void __indirect_glMultiTexCoord1ivARB(GLenum target, const GLint * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_MultiTexCoord1ivARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -7094,7 +7094,7 @@ __indirect_glMultiTexCoord1ivARB(GLenum target, const GLint * v) void __indirect_glMultiTexCoord1sARB(GLenum target, GLshort s) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_MultiTexCoord1svARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -7109,7 +7109,7 @@ __indirect_glMultiTexCoord1sARB(GLenum target, GLshort s) void __indirect_glMultiTexCoord1svARB(GLenum target, const GLshort * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_MultiTexCoord1svARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -7124,7 +7124,7 @@ __indirect_glMultiTexCoord1svARB(GLenum target, const GLshort * v) void __indirect_glMultiTexCoord2dARB(GLenum target, GLdouble s, GLdouble t) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_MultiTexCoord2dvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 8); @@ -7140,7 +7140,7 @@ __indirect_glMultiTexCoord2dARB(GLenum target, GLdouble s, GLdouble t) void __indirect_glMultiTexCoord2dvARB(GLenum target, const GLdouble * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_MultiTexCoord2dvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (v), 16); @@ -7155,7 +7155,7 @@ __indirect_glMultiTexCoord2dvARB(GLenum target, const GLdouble * v) void __indirect_glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_MultiTexCoord2fvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -7171,7 +7171,7 @@ __indirect_glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t) void __indirect_glMultiTexCoord2fvARB(GLenum target, const GLfloat * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_MultiTexCoord2fvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -7186,7 +7186,7 @@ __indirect_glMultiTexCoord2fvARB(GLenum target, const GLfloat * v) void __indirect_glMultiTexCoord2iARB(GLenum target, GLint s, GLint t) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_MultiTexCoord2ivARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -7202,7 +7202,7 @@ __indirect_glMultiTexCoord2iARB(GLenum target, GLint s, GLint t) void __indirect_glMultiTexCoord2ivARB(GLenum target, const GLint * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_MultiTexCoord2ivARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -7217,7 +7217,7 @@ __indirect_glMultiTexCoord2ivARB(GLenum target, const GLint * v) void __indirect_glMultiTexCoord2sARB(GLenum target, GLshort s, GLshort t) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_MultiTexCoord2svARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -7233,7 +7233,7 @@ __indirect_glMultiTexCoord2sARB(GLenum target, GLshort s, GLshort t) void __indirect_glMultiTexCoord2svARB(GLenum target, const GLshort * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_MultiTexCoord2svARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -7249,7 +7249,7 @@ void __indirect_glMultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 32; emit_header(gc->pc, X_GLrop_MultiTexCoord3dvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 8); @@ -7266,7 +7266,7 @@ __indirect_glMultiTexCoord3dARB(GLenum target, GLdouble s, GLdouble t, void __indirect_glMultiTexCoord3dvARB(GLenum target, const GLdouble * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 32; emit_header(gc->pc, X_GLrop_MultiTexCoord3dvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (v), 24); @@ -7282,7 +7282,7 @@ void __indirect_glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_MultiTexCoord3fvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -7299,7 +7299,7 @@ __indirect_glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, void __indirect_glMultiTexCoord3fvARB(GLenum target, const GLfloat * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_MultiTexCoord3fvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -7314,7 +7314,7 @@ __indirect_glMultiTexCoord3fvARB(GLenum target, const GLfloat * v) void __indirect_glMultiTexCoord3iARB(GLenum target, GLint s, GLint t, GLint r) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_MultiTexCoord3ivARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -7331,7 +7331,7 @@ __indirect_glMultiTexCoord3iARB(GLenum target, GLint s, GLint t, GLint r) void __indirect_glMultiTexCoord3ivARB(GLenum target, const GLint * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_MultiTexCoord3ivARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -7347,7 +7347,7 @@ void __indirect_glMultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, GLshort r) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_MultiTexCoord3svARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -7364,7 +7364,7 @@ __indirect_glMultiTexCoord3sARB(GLenum target, GLshort s, GLshort t, void __indirect_glMultiTexCoord3svARB(GLenum target, const GLshort * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_MultiTexCoord3svARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -7380,7 +7380,7 @@ void __indirect_glMultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 40; emit_header(gc->pc, X_GLrop_MultiTexCoord4dvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&s), 8); @@ -7398,7 +7398,7 @@ __indirect_glMultiTexCoord4dARB(GLenum target, GLdouble s, GLdouble t, void __indirect_glMultiTexCoord4dvARB(GLenum target, const GLdouble * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 40; emit_header(gc->pc, X_GLrop_MultiTexCoord4dvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (v), 32); @@ -7414,7 +7414,7 @@ void __indirect_glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_MultiTexCoord4fvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -7432,7 +7432,7 @@ __indirect_glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, void __indirect_glMultiTexCoord4fvARB(GLenum target, const GLfloat * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_MultiTexCoord4fvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -7448,7 +7448,7 @@ void __indirect_glMultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, GLint q) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_MultiTexCoord4ivARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -7466,7 +7466,7 @@ __indirect_glMultiTexCoord4iARB(GLenum target, GLint s, GLint t, GLint r, void __indirect_glMultiTexCoord4ivARB(GLenum target, const GLint * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_MultiTexCoord4ivARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -7482,7 +7482,7 @@ void __indirect_glMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_MultiTexCoord4svARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -7500,7 +7500,7 @@ __indirect_glMultiTexCoord4sARB(GLenum target, GLshort s, GLshort t, void __indirect_glMultiTexCoord4svARB(GLenum target, const GLshort * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_MultiTexCoord4svARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -7515,7 +7515,7 @@ __indirect_glMultiTexCoord4svARB(GLenum target, const GLshort * v) void __indirect_glSampleCoverageARB(GLclampf value, GLboolean invert) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_SampleCoverageARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&value), 4); @@ -7530,7 +7530,7 @@ __indirect_glSampleCoverageARB(GLclampf value, GLboolean invert) void __indirect_glGetProgramStringARB(GLenum target, GLenum pname, GLvoid * string) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { @@ -7550,7 +7550,7 @@ __indirect_glGetProgramStringARB(GLenum target, GLenum pname, GLvoid * string) void __indirect_glGetProgramivARB(GLenum target, GLenum pname, GLint * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { @@ -7571,7 +7571,7 @@ void __indirect_glProgramEnvParameter4dARB(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 44; emit_header(gc->pc, X_GLrop_ProgramEnvParameter4dvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -7591,7 +7591,7 @@ void __indirect_glProgramEnvParameter4dvARB(GLenum target, GLuint index, const GLdouble * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 44; emit_header(gc->pc, X_GLrop_ProgramEnvParameter4dvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -7608,7 +7608,7 @@ void __indirect_glProgramEnvParameter4fARB(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 28; emit_header(gc->pc, X_GLrop_ProgramEnvParameter4fvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -7628,7 +7628,7 @@ void __indirect_glProgramEnvParameter4fvARB(GLenum target, GLuint index, const GLfloat * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 28; emit_header(gc->pc, X_GLrop_ProgramEnvParameter4fvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -7646,7 +7646,7 @@ __indirect_glProgramLocalParameter4dARB(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 44; emit_header(gc->pc, X_GLrop_ProgramLocalParameter4dvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -7666,7 +7666,7 @@ void __indirect_glProgramLocalParameter4dvARB(GLenum target, GLuint index, const GLdouble * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 44; emit_header(gc->pc, X_GLrop_ProgramLocalParameter4dvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -7684,7 +7684,7 @@ __indirect_glProgramLocalParameter4fARB(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 28; emit_header(gc->pc, X_GLrop_ProgramLocalParameter4fvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -7704,7 +7704,7 @@ void __indirect_glProgramLocalParameter4fvARB(GLenum target, GLuint index, const GLfloat * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 28; emit_header(gc->pc, X_GLrop_ProgramLocalParameter4fvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -7721,7 +7721,7 @@ void __indirect_glProgramStringARB(GLenum target, GLenum format, GLsizei len, const GLvoid * string) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16 + __GLX_PAD(len); if (len < 0) { __glXSetError(gc, GL_INVALID_VALUE); @@ -7759,7 +7759,7 @@ __indirect_glProgramStringARB(GLenum target, GLenum format, GLsizei len, void __indirect_glVertexAttrib1dARB(GLuint index, GLdouble x) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_VertexAttrib1dvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -7774,7 +7774,7 @@ __indirect_glVertexAttrib1dARB(GLuint index, GLdouble x) void __indirect_glVertexAttrib1dvARB(GLuint index, const GLdouble * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_VertexAttrib1dvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -7789,7 +7789,7 @@ __indirect_glVertexAttrib1dvARB(GLuint index, const GLdouble * v) void __indirect_glVertexAttrib1fARB(GLuint index, GLfloat x) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_VertexAttrib1fvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -7804,7 +7804,7 @@ __indirect_glVertexAttrib1fARB(GLuint index, GLfloat x) void __indirect_glVertexAttrib1fvARB(GLuint index, const GLfloat * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_VertexAttrib1fvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -7819,7 +7819,7 @@ __indirect_glVertexAttrib1fvARB(GLuint index, const GLfloat * v) void __indirect_glVertexAttrib1sARB(GLuint index, GLshort x) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_VertexAttrib1svARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -7834,7 +7834,7 @@ __indirect_glVertexAttrib1sARB(GLuint index, GLshort x) void __indirect_glVertexAttrib1svARB(GLuint index, const GLshort * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_VertexAttrib1svARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -7849,7 +7849,7 @@ __indirect_glVertexAttrib1svARB(GLuint index, const GLshort * v) void __indirect_glVertexAttrib2dARB(GLuint index, GLdouble x, GLdouble y) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_VertexAttrib2dvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -7865,7 +7865,7 @@ __indirect_glVertexAttrib2dARB(GLuint index, GLdouble x, GLdouble y) void __indirect_glVertexAttrib2dvARB(GLuint index, const GLdouble * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_VertexAttrib2dvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -7880,7 +7880,7 @@ __indirect_glVertexAttrib2dvARB(GLuint index, const GLdouble * v) void __indirect_glVertexAttrib2fARB(GLuint index, GLfloat x, GLfloat y) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_VertexAttrib2fvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -7896,7 +7896,7 @@ __indirect_glVertexAttrib2fARB(GLuint index, GLfloat x, GLfloat y) void __indirect_glVertexAttrib2fvARB(GLuint index, const GLfloat * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_VertexAttrib2fvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -7911,7 +7911,7 @@ __indirect_glVertexAttrib2fvARB(GLuint index, const GLfloat * v) void __indirect_glVertexAttrib2sARB(GLuint index, GLshort x, GLshort y) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_VertexAttrib2svARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -7927,7 +7927,7 @@ __indirect_glVertexAttrib2sARB(GLuint index, GLshort x, GLshort y) void __indirect_glVertexAttrib2svARB(GLuint index, const GLshort * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_VertexAttrib2svARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -7943,7 +7943,7 @@ void __indirect_glVertexAttrib3dARB(GLuint index, GLdouble x, GLdouble y, GLdouble z) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 32; emit_header(gc->pc, X_GLrop_VertexAttrib3dvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -7960,7 +7960,7 @@ __indirect_glVertexAttrib3dARB(GLuint index, GLdouble x, GLdouble y, void __indirect_glVertexAttrib3dvARB(GLuint index, const GLdouble * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 32; emit_header(gc->pc, X_GLrop_VertexAttrib3dvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -7975,7 +7975,7 @@ __indirect_glVertexAttrib3dvARB(GLuint index, const GLdouble * v) void __indirect_glVertexAttrib3fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_VertexAttrib3fvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -7992,7 +7992,7 @@ __indirect_glVertexAttrib3fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z) void __indirect_glVertexAttrib3fvARB(GLuint index, const GLfloat * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_VertexAttrib3fvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -8007,7 +8007,7 @@ __indirect_glVertexAttrib3fvARB(GLuint index, const GLfloat * v) void __indirect_glVertexAttrib3sARB(GLuint index, GLshort x, GLshort y, GLshort z) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_VertexAttrib3svARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -8024,7 +8024,7 @@ __indirect_glVertexAttrib3sARB(GLuint index, GLshort x, GLshort y, GLshort z) void __indirect_glVertexAttrib3svARB(GLuint index, const GLshort * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_VertexAttrib3svARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -8039,7 +8039,7 @@ __indirect_glVertexAttrib3svARB(GLuint index, const GLshort * v) void __indirect_glVertexAttrib4NbvARB(GLuint index, const GLbyte *v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_VertexAttrib4NbvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -8054,7 +8054,7 @@ __indirect_glVertexAttrib4NbvARB(GLuint index, const GLbyte *v) void __indirect_glVertexAttrib4NivARB(GLuint index, const GLint * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_VertexAttrib4NivARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -8069,7 +8069,7 @@ __indirect_glVertexAttrib4NivARB(GLuint index, const GLint * v) void __indirect_glVertexAttrib4NsvARB(GLuint index, const GLshort * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_VertexAttrib4NsvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -8085,7 +8085,7 @@ void __indirect_glVertexAttrib4NubARB(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_VertexAttrib4NubvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -8103,7 +8103,7 @@ __indirect_glVertexAttrib4NubARB(GLuint index, GLubyte x, GLubyte y, void __indirect_glVertexAttrib4NubvARB(GLuint index, const GLubyte *v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_VertexAttrib4NubvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -8118,7 +8118,7 @@ __indirect_glVertexAttrib4NubvARB(GLuint index, const GLubyte *v) void __indirect_glVertexAttrib4NuivARB(GLuint index, const GLuint * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_VertexAttrib4NuivARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -8133,7 +8133,7 @@ __indirect_glVertexAttrib4NuivARB(GLuint index, const GLuint * v) void __indirect_glVertexAttrib4NusvARB(GLuint index, const GLushort * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_VertexAttrib4NusvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -8148,7 +8148,7 @@ __indirect_glVertexAttrib4NusvARB(GLuint index, const GLushort * v) void __indirect_glVertexAttrib4bvARB(GLuint index, const GLbyte *v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_VertexAttrib4bvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -8164,7 +8164,7 @@ void __indirect_glVertexAttrib4dARB(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 40; emit_header(gc->pc, X_GLrop_VertexAttrib4dvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -8182,7 +8182,7 @@ __indirect_glVertexAttrib4dARB(GLuint index, GLdouble x, GLdouble y, void __indirect_glVertexAttrib4dvARB(GLuint index, const GLdouble * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 40; emit_header(gc->pc, X_GLrop_VertexAttrib4dvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -8198,7 +8198,7 @@ void __indirect_glVertexAttrib4fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_VertexAttrib4fvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -8216,7 +8216,7 @@ __indirect_glVertexAttrib4fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z, void __indirect_glVertexAttrib4fvARB(GLuint index, const GLfloat * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_VertexAttrib4fvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -8231,7 +8231,7 @@ __indirect_glVertexAttrib4fvARB(GLuint index, const GLfloat * v) void __indirect_glVertexAttrib4ivARB(GLuint index, const GLint * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_VertexAttrib4ivARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -8247,7 +8247,7 @@ void __indirect_glVertexAttrib4sARB(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_VertexAttrib4svARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -8265,7 +8265,7 @@ __indirect_glVertexAttrib4sARB(GLuint index, GLshort x, GLshort y, GLshort z, void __indirect_glVertexAttrib4svARB(GLuint index, const GLshort * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_VertexAttrib4svARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -8280,7 +8280,7 @@ __indirect_glVertexAttrib4svARB(GLuint index, const GLshort * v) void __indirect_glVertexAttrib4ubvARB(GLuint index, const GLubyte *v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_VertexAttrib4ubvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -8295,7 +8295,7 @@ __indirect_glVertexAttrib4ubvARB(GLuint index, const GLubyte *v) void __indirect_glVertexAttrib4uivARB(GLuint index, const GLuint * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_VertexAttrib4uivARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -8310,7 +8310,7 @@ __indirect_glVertexAttrib4uivARB(GLuint index, const GLuint * v) void __indirect_glVertexAttrib4usvARB(GLuint index, const GLushort * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_VertexAttrib4usvARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -8325,7 +8325,7 @@ __indirect_glVertexAttrib4usvARB(GLuint index, const GLushort * v) void __indirect_glBeginQueryARB(GLenum target, GLuint id) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_BeginQueryARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -8340,7 +8340,7 @@ __indirect_glBeginQueryARB(GLenum target, GLuint id) void __indirect_glDeleteQueriesARB(GLsizei n, const GLuint * ids) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; #ifndef USE_XCB const GLuint cmdlen = 4 + __GLX_PAD((n * 4)); @@ -8370,7 +8370,7 @@ __indirect_glDeleteQueriesARB(GLsizei n, const GLuint * ids) void __indirect_glEndQueryARB(GLenum target) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_EndQueryARB, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -8384,7 +8384,7 @@ __indirect_glEndQueryARB(GLenum target) void __indirect_glGenQueriesARB(GLsizei n, GLuint * ids) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; #ifndef USE_XCB const GLuint cmdlen = 4; @@ -8423,7 +8423,7 @@ __indirect_glGenQueriesARB(GLsizei n, GLuint * ids) void __indirect_glGetQueryObjectivARB(GLuint id, GLenum pname, GLint * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; #ifndef USE_XCB const GLuint cmdlen = 8; @@ -8461,7 +8461,7 @@ __indirect_glGetQueryObjectivARB(GLuint id, GLenum pname, GLint * params) void __indirect_glGetQueryObjectuivARB(GLuint id, GLenum pname, GLuint * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; #ifndef USE_XCB const GLuint cmdlen = 8; @@ -8499,7 +8499,7 @@ __indirect_glGetQueryObjectuivARB(GLuint id, GLenum pname, GLuint * params) void __indirect_glGetQueryivARB(GLenum target, GLenum pname, GLint * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; #ifndef USE_XCB const GLuint cmdlen = 8; @@ -8540,7 +8540,7 @@ __indirect_glGetQueryivARB(GLenum target, GLenum pname, GLint * params) GLboolean __indirect_glIsQueryARB(GLuint id) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; GLboolean retval = (GLboolean) 0; #ifndef USE_XCB @@ -8574,7 +8574,7 @@ __indirect_glIsQueryARB(GLuint id) void __indirect_glDrawBuffersARB(GLsizei n, const GLenum * bufs) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8 + __GLX_PAD((n * 4)); if (n < 0) { __glXSetError(gc, GL_INVALID_VALUE); @@ -8610,7 +8610,7 @@ __indirect_glRenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_RenderbufferStorageMultisample, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -8628,7 +8628,7 @@ __indirect_glRenderbufferStorageMultisample(GLenum target, GLsizei samples, void __indirect_glSampleMaskSGIS(GLclampf value, GLboolean invert) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_SampleMaskSGIS, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&value), 4); @@ -8643,7 +8643,7 @@ __indirect_glSampleMaskSGIS(GLclampf value, GLboolean invert) void __indirect_glSamplePatternSGIS(GLenum pattern) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_SamplePatternSGIS, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&pattern), 4); @@ -8657,7 +8657,7 @@ __indirect_glSamplePatternSGIS(GLenum pattern) void __indirect_glPointParameterfEXT(GLenum pname, GLfloat param) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_PointParameterfEXT, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&pname), 4); @@ -8672,7 +8672,7 @@ __indirect_glPointParameterfEXT(GLenum pname, GLfloat param) void __indirect_glPointParameterfvEXT(GLenum pname, const GLfloat * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint compsize = __glPointParameterfvEXT_size(pname); const GLuint cmdlen = 8 + __GLX_PAD((compsize * 4)); emit_header(gc->pc, X_GLrop_PointParameterfvEXT, cmdlen); @@ -8688,7 +8688,7 @@ __indirect_glPointParameterfvEXT(GLenum pname, const GLfloat * params) void __indirect_glSecondaryColor3bEXT(GLbyte red, GLbyte green, GLbyte blue) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_SecondaryColor3bvEXT, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 1); @@ -8711,7 +8711,7 @@ __indirect_glSecondaryColor3bvEXT(const GLbyte *v) void __indirect_glSecondaryColor3dEXT(GLdouble red, GLdouble green, GLdouble blue) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 28; emit_header(gc->pc, X_GLrop_SecondaryColor3dvEXT, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 8); @@ -8734,7 +8734,7 @@ __indirect_glSecondaryColor3dvEXT(const GLdouble * v) void __indirect_glSecondaryColor3fEXT(GLfloat red, GLfloat green, GLfloat blue) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_SecondaryColor3fvEXT, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 4); @@ -8757,7 +8757,7 @@ __indirect_glSecondaryColor3fvEXT(const GLfloat * v) void __indirect_glSecondaryColor3iEXT(GLint red, GLint green, GLint blue) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_SecondaryColor3ivEXT, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 4); @@ -8780,7 +8780,7 @@ __indirect_glSecondaryColor3ivEXT(const GLint * v) void __indirect_glSecondaryColor3sEXT(GLshort red, GLshort green, GLshort blue) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_SecondaryColor3svEXT, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 2); @@ -8803,7 +8803,7 @@ __indirect_glSecondaryColor3svEXT(const GLshort * v) void __indirect_glSecondaryColor3ubEXT(GLubyte red, GLubyte green, GLubyte blue) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_SecondaryColor3ubvEXT, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 1); @@ -8826,7 +8826,7 @@ __indirect_glSecondaryColor3ubvEXT(const GLubyte *v) void __indirect_glSecondaryColor3uiEXT(GLuint red, GLuint green, GLuint blue) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_SecondaryColor3uivEXT, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 4); @@ -8849,7 +8849,7 @@ __indirect_glSecondaryColor3uivEXT(const GLuint * v) void __indirect_glSecondaryColor3usEXT(GLushort red, GLushort green, GLushort blue) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_SecondaryColor3usvEXT, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 2); @@ -8872,7 +8872,7 @@ __indirect_glSecondaryColor3usvEXT(const GLushort * v) void __indirect_glFogCoorddEXT(GLdouble coord) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_FogCoorddvEXT, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&coord), 8); @@ -8893,7 +8893,7 @@ __indirect_glFogCoorddvEXT(const GLdouble * coord) void __indirect_glFogCoordfEXT(GLfloat coord) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_FogCoordfvEXT, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&coord), 4); @@ -8915,7 +8915,7 @@ void __indirect_glBlendFuncSeparateEXT(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_BlendFuncSeparateEXT, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&sfactorRGB), 4); @@ -8932,7 +8932,7 @@ __indirect_glBlendFuncSeparateEXT(GLenum sfactorRGB, GLenum dfactorRGB, void __indirect_glWindowPos3fMESA(GLfloat x, GLfloat y, GLfloat z) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_WindowPos3fvMESA, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&x), 4); @@ -8956,7 +8956,7 @@ GLboolean __indirect_glAreProgramsResidentNV(GLsizei n, const GLuint * ids, GLboolean * residences) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; GLboolean retval = (GLboolean) 0; const GLuint cmdlen = 4 + __GLX_PAD((n * 4)); @@ -8981,7 +8981,7 @@ __indirect_glAreProgramsResidentNV(GLsizei n, const GLuint * ids, void __indirect_glBindProgramNV(GLenum target, GLuint program) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_BindProgramNV, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -8996,7 +8996,7 @@ __indirect_glBindProgramNV(GLenum target, GLuint program) void __indirect_glDeleteProgramsNV(GLsizei n, const GLuint * programs) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; const GLuint cmdlen = 4 + __GLX_PAD((n * 4)); if (n < 0) { @@ -9020,7 +9020,7 @@ void __indirect_glExecuteProgramNV(GLenum target, GLuint id, const GLfloat * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 28; emit_header(gc->pc, X_GLrop_ExecuteProgramNV, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -9036,7 +9036,7 @@ __indirect_glExecuteProgramNV(GLenum target, GLuint id, void __indirect_glGenProgramsNV(GLsizei n, GLuint * programs) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; const GLuint cmdlen = 4; if (n < 0) { @@ -9060,7 +9060,7 @@ void __indirect_glGetProgramParameterdvNV(GLenum target, GLuint index, GLenum pname, GLdouble * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; const GLuint cmdlen = 12; if (__builtin_expect(dpy != NULL, 1)) { @@ -9082,7 +9082,7 @@ void __indirect_glGetProgramParameterfvNV(GLenum target, GLuint index, GLenum pname, GLfloat * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; const GLuint cmdlen = 12; if (__builtin_expect(dpy != NULL, 1)) { @@ -9103,7 +9103,7 @@ __indirect_glGetProgramParameterfvNV(GLenum target, GLuint index, void __indirect_glGetProgramStringNV(GLuint id, GLenum pname, GLubyte *program) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { @@ -9123,7 +9123,7 @@ __indirect_glGetProgramStringNV(GLuint id, GLenum pname, GLubyte *program) void __indirect_glGetProgramivNV(GLuint id, GLenum pname, GLint * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { @@ -9144,7 +9144,7 @@ void __indirect_glGetTrackMatrixivNV(GLenum target, GLuint address, GLenum pname, GLint * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; const GLuint cmdlen = 12; if (__builtin_expect(dpy != NULL, 1)) { @@ -9166,7 +9166,7 @@ void __indirect_glGetVertexAttribdvNV(GLuint index, GLenum pname, GLdouble * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { @@ -9186,7 +9186,7 @@ __indirect_glGetVertexAttribdvNV(GLuint index, GLenum pname, void __indirect_glGetVertexAttribfvNV(GLuint index, GLenum pname, GLfloat * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { @@ -9206,7 +9206,7 @@ __indirect_glGetVertexAttribfvNV(GLuint index, GLenum pname, GLfloat * params) void __indirect_glGetVertexAttribivNV(GLuint index, GLenum pname, GLint * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { @@ -9226,7 +9226,7 @@ __indirect_glGetVertexAttribivNV(GLuint index, GLenum pname, GLint * params) GLboolean __indirect_glIsProgramNV(GLuint program) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; GLboolean retval = (GLboolean) 0; const GLuint cmdlen = 4; @@ -9247,7 +9247,7 @@ void __indirect_glLoadProgramNV(GLenum target, GLuint id, GLsizei len, const GLubyte *program) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16 + __GLX_PAD(len); if (len < 0) { __glXSetError(gc, GL_INVALID_VALUE); @@ -9271,7 +9271,7 @@ void __indirect_glProgramParameters4dvNV(GLenum target, GLuint index, GLuint num, const GLdouble * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16 + __GLX_PAD((num * 32)); if (num < 0) { __glXSetError(gc, GL_INVALID_VALUE); @@ -9295,7 +9295,7 @@ void __indirect_glProgramParameters4fvNV(GLenum target, GLuint index, GLuint num, const GLfloat * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16 + __GLX_PAD((num * 16)); if (num < 0) { __glXSetError(gc, GL_INVALID_VALUE); @@ -9318,7 +9318,7 @@ __indirect_glProgramParameters4fvNV(GLenum target, GLuint index, GLuint num, void __indirect_glRequestResidentProgramsNV(GLsizei n, const GLuint * ids) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8 + __GLX_PAD((n * 4)); if (n < 0) { __glXSetError(gc, GL_INVALID_VALUE); @@ -9340,7 +9340,7 @@ void __indirect_glTrackMatrixNV(GLenum target, GLuint address, GLenum matrix, GLenum transform) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_TrackMatrixNV, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -9357,7 +9357,7 @@ __indirect_glTrackMatrixNV(GLenum target, GLuint address, GLenum matrix, void __indirect_glVertexAttrib1dNV(GLuint index, GLdouble x) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_VertexAttrib1dvNV, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -9372,7 +9372,7 @@ __indirect_glVertexAttrib1dNV(GLuint index, GLdouble x) void __indirect_glVertexAttrib1dvNV(GLuint index, const GLdouble * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_VertexAttrib1dvNV, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -9387,7 +9387,7 @@ __indirect_glVertexAttrib1dvNV(GLuint index, const GLdouble * v) void __indirect_glVertexAttrib1fNV(GLuint index, GLfloat x) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_VertexAttrib1fvNV, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -9402,7 +9402,7 @@ __indirect_glVertexAttrib1fNV(GLuint index, GLfloat x) void __indirect_glVertexAttrib1fvNV(GLuint index, const GLfloat * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_VertexAttrib1fvNV, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -9417,7 +9417,7 @@ __indirect_glVertexAttrib1fvNV(GLuint index, const GLfloat * v) void __indirect_glVertexAttrib1sNV(GLuint index, GLshort x) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_VertexAttrib1svNV, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -9432,7 +9432,7 @@ __indirect_glVertexAttrib1sNV(GLuint index, GLshort x) void __indirect_glVertexAttrib1svNV(GLuint index, const GLshort * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_VertexAttrib1svNV, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -9447,7 +9447,7 @@ __indirect_glVertexAttrib1svNV(GLuint index, const GLshort * v) void __indirect_glVertexAttrib2dNV(GLuint index, GLdouble x, GLdouble y) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_VertexAttrib2dvNV, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -9463,7 +9463,7 @@ __indirect_glVertexAttrib2dNV(GLuint index, GLdouble x, GLdouble y) void __indirect_glVertexAttrib2dvNV(GLuint index, const GLdouble * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_VertexAttrib2dvNV, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -9478,7 +9478,7 @@ __indirect_glVertexAttrib2dvNV(GLuint index, const GLdouble * v) void __indirect_glVertexAttrib2fNV(GLuint index, GLfloat x, GLfloat y) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_VertexAttrib2fvNV, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -9494,7 +9494,7 @@ __indirect_glVertexAttrib2fNV(GLuint index, GLfloat x, GLfloat y) void __indirect_glVertexAttrib2fvNV(GLuint index, const GLfloat * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_VertexAttrib2fvNV, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -9509,7 +9509,7 @@ __indirect_glVertexAttrib2fvNV(GLuint index, const GLfloat * v) void __indirect_glVertexAttrib2sNV(GLuint index, GLshort x, GLshort y) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_VertexAttrib2svNV, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -9525,7 +9525,7 @@ __indirect_glVertexAttrib2sNV(GLuint index, GLshort x, GLshort y) void __indirect_glVertexAttrib2svNV(GLuint index, const GLshort * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_VertexAttrib2svNV, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -9541,7 +9541,7 @@ void __indirect_glVertexAttrib3dNV(GLuint index, GLdouble x, GLdouble y, GLdouble z) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 32; emit_header(gc->pc, X_GLrop_VertexAttrib3dvNV, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -9558,7 +9558,7 @@ __indirect_glVertexAttrib3dNV(GLuint index, GLdouble x, GLdouble y, void __indirect_glVertexAttrib3dvNV(GLuint index, const GLdouble * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 32; emit_header(gc->pc, X_GLrop_VertexAttrib3dvNV, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -9573,7 +9573,7 @@ __indirect_glVertexAttrib3dvNV(GLuint index, const GLdouble * v) void __indirect_glVertexAttrib3fNV(GLuint index, GLfloat x, GLfloat y, GLfloat z) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_VertexAttrib3fvNV, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -9590,7 +9590,7 @@ __indirect_glVertexAttrib3fNV(GLuint index, GLfloat x, GLfloat y, GLfloat z) void __indirect_glVertexAttrib3fvNV(GLuint index, const GLfloat * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_VertexAttrib3fvNV, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -9605,7 +9605,7 @@ __indirect_glVertexAttrib3fvNV(GLuint index, const GLfloat * v) void __indirect_glVertexAttrib3sNV(GLuint index, GLshort x, GLshort y, GLshort z) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_VertexAttrib3svNV, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -9622,7 +9622,7 @@ __indirect_glVertexAttrib3sNV(GLuint index, GLshort x, GLshort y, GLshort z) void __indirect_glVertexAttrib3svNV(GLuint index, const GLshort * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_VertexAttrib3svNV, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -9638,7 +9638,7 @@ void __indirect_glVertexAttrib4dNV(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 40; emit_header(gc->pc, X_GLrop_VertexAttrib4dvNV, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -9656,7 +9656,7 @@ __indirect_glVertexAttrib4dNV(GLuint index, GLdouble x, GLdouble y, void __indirect_glVertexAttrib4dvNV(GLuint index, const GLdouble * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 40; emit_header(gc->pc, X_GLrop_VertexAttrib4dvNV, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -9672,7 +9672,7 @@ void __indirect_glVertexAttrib4fNV(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_VertexAttrib4fvNV, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -9690,7 +9690,7 @@ __indirect_glVertexAttrib4fNV(GLuint index, GLfloat x, GLfloat y, GLfloat z, void __indirect_glVertexAttrib4fvNV(GLuint index, const GLfloat * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_VertexAttrib4fvNV, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -9706,7 +9706,7 @@ void __indirect_glVertexAttrib4sNV(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_VertexAttrib4svNV, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -9724,7 +9724,7 @@ __indirect_glVertexAttrib4sNV(GLuint index, GLshort x, GLshort y, GLshort z, void __indirect_glVertexAttrib4svNV(GLuint index, const GLshort * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 16; emit_header(gc->pc, X_GLrop_VertexAttrib4svNV, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -9740,7 +9740,7 @@ void __indirect_glVertexAttrib4ubNV(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_VertexAttrib4ubvNV, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -9758,7 +9758,7 @@ __indirect_glVertexAttrib4ubNV(GLuint index, GLubyte x, GLubyte y, GLubyte z, void __indirect_glVertexAttrib4ubvNV(GLuint index, const GLubyte *v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_VertexAttrib4ubvNV, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&index), 4); @@ -9773,7 +9773,7 @@ __indirect_glVertexAttrib4ubvNV(GLuint index, const GLubyte *v) void __indirect_glVertexAttribs1dvNV(GLuint index, GLsizei n, const GLdouble * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12 + __GLX_PAD((n * 8)); if (n < 0) { __glXSetError(gc, GL_INVALID_VALUE); @@ -9795,7 +9795,7 @@ __indirect_glVertexAttribs1dvNV(GLuint index, GLsizei n, const GLdouble * v) void __indirect_glVertexAttribs1fvNV(GLuint index, GLsizei n, const GLfloat * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12 + __GLX_PAD((n * 4)); if (n < 0) { __glXSetError(gc, GL_INVALID_VALUE); @@ -9817,7 +9817,7 @@ __indirect_glVertexAttribs1fvNV(GLuint index, GLsizei n, const GLfloat * v) void __indirect_glVertexAttribs1svNV(GLuint index, GLsizei n, const GLshort * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12 + __GLX_PAD((n * 2)); if (n < 0) { __glXSetError(gc, GL_INVALID_VALUE); @@ -9839,7 +9839,7 @@ __indirect_glVertexAttribs1svNV(GLuint index, GLsizei n, const GLshort * v) void __indirect_glVertexAttribs2dvNV(GLuint index, GLsizei n, const GLdouble * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12 + __GLX_PAD((n * 16)); if (n < 0) { __glXSetError(gc, GL_INVALID_VALUE); @@ -9861,7 +9861,7 @@ __indirect_glVertexAttribs2dvNV(GLuint index, GLsizei n, const GLdouble * v) void __indirect_glVertexAttribs2fvNV(GLuint index, GLsizei n, const GLfloat * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12 + __GLX_PAD((n * 8)); if (n < 0) { __glXSetError(gc, GL_INVALID_VALUE); @@ -9883,7 +9883,7 @@ __indirect_glVertexAttribs2fvNV(GLuint index, GLsizei n, const GLfloat * v) void __indirect_glVertexAttribs2svNV(GLuint index, GLsizei n, const GLshort * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12 + __GLX_PAD((n * 4)); if (n < 0) { __glXSetError(gc, GL_INVALID_VALUE); @@ -9905,7 +9905,7 @@ __indirect_glVertexAttribs2svNV(GLuint index, GLsizei n, const GLshort * v) void __indirect_glVertexAttribs3dvNV(GLuint index, GLsizei n, const GLdouble * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12 + __GLX_PAD((n * 24)); if (n < 0) { __glXSetError(gc, GL_INVALID_VALUE); @@ -9927,7 +9927,7 @@ __indirect_glVertexAttribs3dvNV(GLuint index, GLsizei n, const GLdouble * v) void __indirect_glVertexAttribs3fvNV(GLuint index, GLsizei n, const GLfloat * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12 + __GLX_PAD((n * 12)); if (n < 0) { __glXSetError(gc, GL_INVALID_VALUE); @@ -9949,7 +9949,7 @@ __indirect_glVertexAttribs3fvNV(GLuint index, GLsizei n, const GLfloat * v) void __indirect_glVertexAttribs3svNV(GLuint index, GLsizei n, const GLshort * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12 + __GLX_PAD((n * 6)); if (n < 0) { __glXSetError(gc, GL_INVALID_VALUE); @@ -9971,7 +9971,7 @@ __indirect_glVertexAttribs3svNV(GLuint index, GLsizei n, const GLshort * v) void __indirect_glVertexAttribs4dvNV(GLuint index, GLsizei n, const GLdouble * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12 + __GLX_PAD((n * 32)); if (n < 0) { __glXSetError(gc, GL_INVALID_VALUE); @@ -9993,7 +9993,7 @@ __indirect_glVertexAttribs4dvNV(GLuint index, GLsizei n, const GLdouble * v) void __indirect_glVertexAttribs4fvNV(GLuint index, GLsizei n, const GLfloat * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12 + __GLX_PAD((n * 16)); if (n < 0) { __glXSetError(gc, GL_INVALID_VALUE); @@ -10015,7 +10015,7 @@ __indirect_glVertexAttribs4fvNV(GLuint index, GLsizei n, const GLfloat * v) void __indirect_glVertexAttribs4svNV(GLuint index, GLsizei n, const GLshort * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12 + __GLX_PAD((n * 8)); if (n < 0) { __glXSetError(gc, GL_INVALID_VALUE); @@ -10037,7 +10037,7 @@ __indirect_glVertexAttribs4svNV(GLuint index, GLsizei n, const GLshort * v) void __indirect_glVertexAttribs4ubvNV(GLuint index, GLsizei n, const GLubyte *v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12 + __GLX_PAD((n * 4)); if (n < 0) { __glXSetError(gc, GL_INVALID_VALUE); @@ -10059,7 +10059,7 @@ __indirect_glVertexAttribs4ubvNV(GLuint index, GLsizei n, const GLubyte *v) void __indirect_glPointParameteriNV(GLenum pname, GLint param) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_PointParameteriNV, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&pname), 4); @@ -10074,7 +10074,7 @@ __indirect_glPointParameteriNV(GLenum pname, GLint param) void __indirect_glPointParameterivNV(GLenum pname, const GLint * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint compsize = __glPointParameterivNV_size(pname); const GLuint cmdlen = 8 + __GLX_PAD((compsize * 4)); emit_header(gc->pc, X_GLrop_PointParameterivNV, cmdlen); @@ -10090,7 +10090,7 @@ __indirect_glPointParameterivNV(GLenum pname, const GLint * params) void __indirect_glActiveStencilFaceEXT(GLenum face) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_ActiveStencilFaceEXT, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&face), 4); @@ -10106,7 +10106,7 @@ __indirect_glGetProgramNamedParameterdvNV(GLuint id, GLsizei len, const GLubyte *name, GLdouble * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8 + __GLX_PAD(len); if (len < 0) { @@ -10134,7 +10134,7 @@ __indirect_glGetProgramNamedParameterfvNV(GLuint id, GLsizei len, const GLubyte *name, GLfloat * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8 + __GLX_PAD(len); if (len < 0) { @@ -10162,7 +10162,7 @@ __indirect_glProgramNamedParameter4dNV(GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 44 + __GLX_PAD(len); if (len < 0) { __glXSetError(gc, GL_INVALID_VALUE); @@ -10190,7 +10190,7 @@ __indirect_glProgramNamedParameter4dvNV(GLuint id, GLsizei len, const GLubyte *name, const GLdouble * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 44 + __GLX_PAD(len); if (len < 0) { __glXSetError(gc, GL_INVALID_VALUE); @@ -10215,7 +10215,7 @@ __indirect_glProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 28 + __GLX_PAD(len); if (len < 0) { __glXSetError(gc, GL_INVALID_VALUE); @@ -10243,7 +10243,7 @@ __indirect_glProgramNamedParameter4fvNV(GLuint id, GLsizei len, const GLubyte *name, const GLfloat * v) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 28 + __GLX_PAD(len); if (len < 0) { __glXSetError(gc, GL_INVALID_VALUE); @@ -10266,7 +10266,7 @@ __indirect_glProgramNamedParameter4fvNV(GLuint id, GLsizei len, void __indirect_glBlendEquationSeparateEXT(GLenum modeRGB, GLenum modeA) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_BlendEquationSeparateEXT, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&modeRGB), 4); @@ -10281,7 +10281,7 @@ __indirect_glBlendEquationSeparateEXT(GLenum modeRGB, GLenum modeA) void __indirect_glBindFramebufferEXT(GLenum target, GLuint framebuffer) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_BindFramebufferEXT, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -10296,7 +10296,7 @@ __indirect_glBindFramebufferEXT(GLenum target, GLuint framebuffer) void __indirect_glBindRenderbufferEXT(GLenum target, GLuint renderbuffer) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 12; emit_header(gc->pc, X_GLrop_BindRenderbufferEXT, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -10311,7 +10311,7 @@ __indirect_glBindRenderbufferEXT(GLenum target, GLuint renderbuffer) GLenum __indirect_glCheckFramebufferStatusEXT(GLenum target) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; GLenum retval = (GLenum) 0; const GLuint cmdlen = 4; @@ -10332,7 +10332,7 @@ __indirect_glCheckFramebufferStatusEXT(GLenum target) void __indirect_glDeleteFramebuffersEXT(GLsizei n, const GLuint * framebuffers) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8 + __GLX_PAD((n * 4)); if (n < 0) { __glXSetError(gc, GL_INVALID_VALUE); @@ -10354,7 +10354,7 @@ __indirect_glDeleteFramebuffersEXT(GLsizei n, const GLuint * framebuffers) void __indirect_glDeleteRenderbuffersEXT(GLsizei n, const GLuint * renderbuffers) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8 + __GLX_PAD((n * 4)); if (n < 0) { __glXSetError(gc, GL_INVALID_VALUE); @@ -10378,7 +10378,7 @@ __indirect_glFramebufferRenderbufferEXT(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_FramebufferRenderbufferEXT, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -10397,7 +10397,7 @@ __indirect_glFramebufferTexture1DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_FramebufferTexture1DEXT, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -10417,7 +10417,7 @@ __indirect_glFramebufferTexture2DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_FramebufferTexture2DEXT, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -10437,7 +10437,7 @@ __indirect_glFramebufferTexture3DEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 28; emit_header(gc->pc, X_GLrop_FramebufferTexture3DEXT, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -10456,7 +10456,7 @@ __indirect_glFramebufferTexture3DEXT(GLenum target, GLenum attachment, void __indirect_glGenFramebuffersEXT(GLsizei n, GLuint * framebuffers) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; const GLuint cmdlen = 4; if (n < 0) { @@ -10479,7 +10479,7 @@ __indirect_glGenFramebuffersEXT(GLsizei n, GLuint * framebuffers) void __indirect_glGenRenderbuffersEXT(GLsizei n, GLuint * renderbuffers) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; const GLuint cmdlen = 4; if (n < 0) { @@ -10502,7 +10502,7 @@ __indirect_glGenRenderbuffersEXT(GLsizei n, GLuint * renderbuffers) void __indirect_glGenerateMipmapEXT(GLenum target) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 8; emit_header(gc->pc, X_GLrop_GenerateMipmapEXT, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -10519,7 +10519,7 @@ __indirect_glGetFramebufferAttachmentParameterivEXT(GLenum target, GLenum pname, GLint * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; const GLuint cmdlen = 12; if (__builtin_expect(dpy != NULL, 1)) { @@ -10542,7 +10542,7 @@ void __indirect_glGetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; const GLuint cmdlen = 8; if (__builtin_expect(dpy != NULL, 1)) { @@ -10563,7 +10563,7 @@ __indirect_glGetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLboolean __indirect_glIsFramebufferEXT(GLuint framebuffer) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; GLboolean retval = (GLboolean) 0; const GLuint cmdlen = 4; @@ -10583,7 +10583,7 @@ __indirect_glIsFramebufferEXT(GLuint framebuffer) GLboolean __indirect_glIsRenderbufferEXT(GLuint renderbuffer) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; GLboolean retval = (GLboolean) 0; const GLuint cmdlen = 4; @@ -10604,7 +10604,7 @@ void __indirect_glRenderbufferStorageEXT(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 20; emit_header(gc->pc, X_GLrop_RenderbufferStorageEXT, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); @@ -10624,7 +10624,7 @@ __indirect_glBlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 44; emit_header(gc->pc, X_GLrop_BlitFramebufferEXT, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&srcX0), 4); @@ -10649,7 +10649,7 @@ __indirect_glFramebufferTextureLayerEXT(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); const GLuint cmdlen = 24; emit_header(gc->pc, X_GLrop_FramebufferTextureLayerEXT, cmdlen); (void) memcpy((void *) (gc->pc + 4), (void *) (&target), 4); diff --git a/src/glx/indirect.h b/src/glx/indirect.h index b09b61aae7..36d68b066c 100644 --- a/src/glx/indirect.h +++ b/src/glx/indirect.h @@ -59,15 +59,15 @@ extern HIDDEN NOINLINE CARD32 __glXReadReply( Display *dpy, size_t size, void * dest, GLboolean reply_is_always_array ); extern HIDDEN NOINLINE void __glXReadPixelReply( Display *dpy, - __GLXcontext * gc, unsigned max_dim, GLint width, GLint height, + struct glx_context * gc, unsigned max_dim, GLint width, GLint height, GLint depth, GLenum format, GLenum type, void * dest, GLboolean dimensions_in_reply ); extern HIDDEN NOINLINE FASTCALL GLubyte * __glXSetupSingleRequest( - __GLXcontext * gc, GLint sop, GLint cmdlen ); + struct glx_context * gc, GLint sop, GLint cmdlen ); extern HIDDEN NOINLINE FASTCALL GLubyte * __glXSetupVendorRequest( - __GLXcontext * gc, GLint code, GLint vop, GLint cmdlen ); + struct glx_context * gc, GLint code, GLint vop, GLint cmdlen ); extern HIDDEN void __indirect_glNewList(GLuint list, GLenum mode); extern HIDDEN void __indirect_glEndList(void); diff --git a/src/glx/indirect_init.c b/src/glx/indirect_init.c index 73ca993027..ea05188398 100644 --- a/src/glx/indirect_init.c +++ b/src/glx/indirect_init.c @@ -53,13 +53,13 @@ static int NoOp(void) * Create and initialize a new GL dispatch table. The table is initialized * with GLX indirect rendering protocol functions. */ -__GLapi * __glXNewIndirectAPI( void ) +struct _glapi_table *__glXNewIndirectAPI( void ) { - __GLapi *glAPI; + struct _glapi_table *glAPI; GLuint entries; entries = _glapi_get_dispatch_table_size(); - glAPI = (__GLapi *) Xmalloc(entries * sizeof(void *)); + glAPI = (struct _glapi_table *) Xmalloc(entries * sizeof(void *)); /* first, set all entries to point to no-op functions */ { diff --git a/src/glx/indirect_init.h b/src/glx/indirect_init.h index 72255f1301..2ba01f56c3 100644 --- a/src/glx/indirect_init.h +++ b/src/glx/indirect_init.h @@ -36,6 +36,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "glxclient.h" -extern __GLapi *__glXNewIndirectAPI(void); +extern struct _glapi_table *__glXNewIndirectAPI(void); #endif /* _INDIRECT_INIT_H_ */ diff --git a/src/glx/indirect_vertex_array.c b/src/glx/indirect_vertex_array.c index ec0e654cea..372618de4f 100644 --- a/src/glx/indirect_vertex_array.c +++ b/src/glx/indirect_vertex_array.c @@ -84,9 +84,9 @@ static struct array_state *get_array_entry(const struct array_state_vector *arrays, GLenum key, unsigned index); static void fill_array_info_cache(struct array_state_vector *arrays); -static GLboolean validate_mode(__GLXcontext * gc, GLenum mode); -static GLboolean validate_count(__GLXcontext * gc, GLsizei count); -static GLboolean validate_type(__GLXcontext * gc, GLenum type); +static GLboolean validate_mode(struct glx_context * gc, GLenum mode); +static GLboolean validate_count(struct glx_context * gc, GLsizei count); +static GLboolean validate_type(struct glx_context * gc, GLenum type); /** @@ -109,7 +109,7 @@ const GLuint __glXTypeSize_table[16] = { * __glXInitVertexArrayState(). */ void -__glXFreeVertexArrayState(__GLXcontext * gc) +__glXFreeVertexArrayState(struct glx_context * gc) { __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); struct array_state_vector *arrays = state->array_state; @@ -135,8 +135,8 @@ __glXFreeVertexArrayState(__GLXcontext * gc) * \param gc GLX context whose vertex array state is to be initialized. * * \warning - * This function may only be called after __GLXcontext::gl_extension_bits, - * __GLXcontext::server_minor, and __GLXcontext::server_major have been + * This function may only be called after struct glx_context::gl_extension_bits, + * struct glx_context::server_minor, and __GLXcontext::server_major have been * initialized. These values are used to determine what vertex arrays are * supported. * @@ -144,7 +144,7 @@ __glXFreeVertexArrayState(__GLXcontext * gc) * Return values from malloc are not properly tested. */ void -__glXInitVertexArrayState(__GLXcontext * gc) +__glXInitVertexArrayState(struct glx_context * gc) { __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); struct array_state_vector *arrays; @@ -487,7 +487,7 @@ fill_array_info_cache(struct array_state_vector *arrays) void emit_DrawArrays_none(GLenum mode, GLint first, GLsizei count) { - __GLXcontext *gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); const __GLXattribute *state = (const __GLXattribute *) (gc->client_state_private); struct array_state_vector *arrays = state->array_state; @@ -549,7 +549,7 @@ emit_DrawArrays_none(GLenum mode, GLint first, GLsizei count) * A pointer to the buffer for array data. */ static GLubyte * -emit_DrawArrays_header_old(__GLXcontext * gc, +emit_DrawArrays_header_old(struct glx_context * gc, struct array_state_vector *arrays, size_t * elements_per_request, unsigned int *total_requests, @@ -658,7 +658,7 @@ emit_DrawArrays_header_old(__GLXcontext * gc, void emit_DrawArrays_old(GLenum mode, GLint first, GLsizei count) { - __GLXcontext *gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); const __GLXattribute *state = (const __GLXattribute *) (gc->client_state_private); struct array_state_vector *arrays = state->array_state; @@ -720,7 +720,7 @@ void emit_DrawElements_none(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices) { - __GLXcontext *gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); const __GLXattribute *state = (const __GLXattribute *) (gc->client_state_private); struct array_state_vector *arrays = state->array_state; @@ -787,7 +787,7 @@ void emit_DrawElements_old(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices) { - __GLXcontext *gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); const __GLXattribute *state = (const __GLXattribute *) (gc->client_state_private); struct array_state_vector *arrays = state->array_state; @@ -875,7 +875,7 @@ emit_DrawElements_old(GLenum mode, GLsizei count, GLenum type, * \c GL_TRUE if the argument is valid, \c GL_FALSE if is not. */ static GLboolean -validate_mode(__GLXcontext * gc, GLenum mode) +validate_mode(struct glx_context * gc, GLenum mode) { switch (mode) { case GL_POINTS: @@ -908,7 +908,7 @@ validate_mode(__GLXcontext * gc, GLenum mode) * \c GL_TRUE if the argument is valid, \c GL_FALSE if it is not. */ static GLboolean -validate_count(__GLXcontext * gc, GLsizei count) +validate_count(struct glx_context * gc, GLsizei count) { if (count < 0) { __glXSetError(gc, GL_INVALID_VALUE); @@ -927,7 +927,7 @@ validate_count(__GLXcontext * gc, GLsizei count) * \c GL_TRUE if the argument is valid, \c GL_FALSE if it is not. */ static GLboolean -validate_type(__GLXcontext * gc, GLenum type) +validate_type(struct glx_context * gc, GLenum type) { switch (type) { case GL_UNSIGNED_INT: @@ -944,7 +944,7 @@ validate_type(__GLXcontext * gc, GLenum type) void __indirect_glDrawArrays(GLenum mode, GLint first, GLsizei count) { - __GLXcontext *gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); const __GLXattribute *state = (const __GLXattribute *) (gc->client_state_private); struct array_state_vector *arrays = state->array_state; @@ -963,7 +963,7 @@ __indirect_glDrawArrays(GLenum mode, GLint first, GLsizei count) void __indirect_glArrayElement(GLint index) { - __GLXcontext *gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); const __GLXattribute *state = (const __GLXattribute *) (gc->client_state_private); struct array_state_vector *arrays = state->array_state; @@ -989,7 +989,7 @@ void __indirect_glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices) { - __GLXcontext *gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); const __GLXattribute *state = (const __GLXattribute *) (gc->client_state_private); struct array_state_vector *arrays = state->array_state; @@ -1011,7 +1011,7 @@ __indirect_glDrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices) { - __GLXcontext *gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); const __GLXattribute *state = (const __GLXattribute *) (gc->client_state_private); struct array_state_vector *arrays = state->array_state; @@ -1037,7 +1037,7 @@ void __indirect_glMultiDrawArraysEXT(GLenum mode, GLint * first, GLsizei * count, GLsizei primcount) { - __GLXcontext *gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); const __GLXattribute *state = (const __GLXattribute *) (gc->client_state_private); struct array_state_vector *arrays = state->array_state; @@ -1063,7 +1063,7 @@ __indirect_glMultiDrawElementsEXT(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount) { - __GLXcontext *gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); const __GLXattribute *state = (const __GLXattribute *) (gc->client_state_private); struct array_state_vector *arrays = state->array_state; @@ -1119,7 +1119,7 @@ __indirect_glVertexPointer(GLint size, GLenum type, GLsizei stride, 0, 0, X_GLrop_Vertex2dv, X_GLrop_Vertex3dv, X_GLrop_Vertex4dv }; uint16_t opcode; - __GLXcontext *gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); struct array_state_vector *arrays = state->array_state; struct array_state *a; @@ -1164,7 +1164,7 @@ __indirect_glNormalPointer(GLenum type, GLsizei stride, const GLvoid * pointer) { uint16_t opcode; - __GLXcontext *gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); struct array_state_vector *arrays = state->array_state; struct array_state *a; @@ -1235,7 +1235,7 @@ __indirect_glColorPointer(GLint size, GLenum type, GLsizei stride, 0, 0, 0, X_GLrop_Color3dv, X_GLrop_Color4dv }; uint16_t opcode; - __GLXcontext *gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); struct array_state_vector *arrays = state->array_state; struct array_state *a; @@ -1290,7 +1290,7 @@ void __indirect_glIndexPointer(GLenum type, GLsizei stride, const GLvoid * pointer) { uint16_t opcode; - __GLXcontext *gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); struct array_state_vector *arrays = state->array_state; struct array_state *a; @@ -1335,7 +1335,7 @@ __indirect_glIndexPointer(GLenum type, GLsizei stride, const GLvoid * pointer) void __indirect_glEdgeFlagPointer(GLsizei stride, const GLvoid * pointer) { - __GLXcontext *gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); struct array_state_vector *arrays = state->array_state; struct array_state *a; @@ -1397,7 +1397,7 @@ __indirect_glTexCoordPointer(GLint size, GLenum type, GLsizei stride, }; uint16_t opcode; - __GLXcontext *gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); struct array_state_vector *arrays = state->array_state; struct array_state *a; @@ -1470,7 +1470,7 @@ __indirect_glSecondaryColorPointerEXT(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer) { uint16_t opcode; - __GLXcontext *gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); struct array_state_vector *arrays = state->array_state; struct array_state *a; @@ -1530,7 +1530,7 @@ __indirect_glFogCoordPointerEXT(GLenum type, GLsizei stride, const GLvoid * pointer) { uint16_t opcode; - __GLXcontext *gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); struct array_state_vector *arrays = state->array_state; struct array_state *a; @@ -1577,7 +1577,7 @@ __indirect_glVertexAttribPointerARB(GLuint index, GLint size, static const uint16_t double_ops[5] = { 0, 4197, 4198, 4199, 4200 }; uint16_t opcode; - __GLXcontext *gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); struct array_state_vector *arrays = state->array_state; struct array_state *a; @@ -1690,7 +1690,7 @@ __indirect_glVertexAttribPointerNV(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer) { - __GLXcontext *gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); GLboolean normalized = GL_FALSE; @@ -1718,7 +1718,7 @@ __indirect_glVertexAttribPointerNV(GLuint index, GLint size, void __indirect_glClientActiveTextureARB(GLenum texture) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); __GLXattribute *const state = (__GLXattribute *) (gc->client_state_private); struct array_state_vector *const arrays = state->array_state; diff --git a/src/glx/indirect_vertex_program.c b/src/glx/indirect_vertex_program.c index d822a7ee56..d955fdfa93 100644 --- a/src/glx/indirect_vertex_program.c +++ b/src/glx/indirect_vertex_program.c @@ -37,7 +37,7 @@ static void do_vertex_attrib_enable(GLuint index, GLboolean val) { - __GLXcontext *gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); if (!__glXSetArrayEnable(state, GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB, @@ -65,7 +65,7 @@ static void get_parameter(unsigned opcode, unsigned size, GLenum target, GLuint index, void *params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; const GLuint cmdlen = 12; @@ -122,7 +122,7 @@ void __indirect_glGetVertexAttribPointervNV(GLuint index, GLenum pname, GLvoid ** pointer) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); if (pname != GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB) { @@ -177,7 +177,7 @@ get_attrib_array_data(__GLXattribute * state, GLuint index, GLenum cap, static void -get_vertex_attrib(__GLXcontext * gc, unsigned vop, +get_vertex_attrib(struct glx_context * gc, unsigned vop, GLuint index, GLenum pname, xReply * reply) { Display *const dpy = gc->currentDpy; @@ -195,7 +195,7 @@ get_vertex_attrib(__GLXcontext * gc, unsigned vop, void __indirect_glGetVertexAttribivARB(GLuint index, GLenum pname, GLint * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); xGLXSingleReply reply; @@ -229,7 +229,7 @@ void __indirect_glGetVertexAttribfvARB(GLuint index, GLenum pname, GLfloat * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); xGLXSingleReply reply; @@ -263,7 +263,7 @@ void __indirect_glGetVertexAttribdvARB(GLuint index, GLenum pname, GLdouble * params) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); xGLXSingleReply reply; diff --git a/src/glx/packrender.h b/src/glx/packrender.h index 30f6d44bbd..4266d5cc67 100644 --- a/src/glx/packrender.h +++ b/src/glx/packrender.h @@ -54,7 +54,7 @@ /* Setup for all commands */ #define __GLX_DECLARE_VARIABLES() \ - __GLXcontext *gc; \ + struct glx_context *gc; \ GLubyte *pc, *pixelHeaderPC; \ GLuint compsize, cmdlen diff --git a/src/glx/packsingle.h b/src/glx/packsingle.h index f33a873f3a..037265a767 100644 --- a/src/glx/packsingle.h +++ b/src/glx/packsingle.h @@ -49,7 +49,7 @@ /* Declare common variables used during a single command */ #define __GLX_SINGLE_DECLARE_VARIABLES() \ - __GLXcontext *gc = __glXGetCurrentContext(); \ + struct glx_context *gc = __glXGetCurrentContext(); \ GLubyte *pc, *pixelHeaderPC; \ GLuint compsize, cmdlen; \ Display *dpy = gc->currentDpy; \ diff --git a/src/glx/pixel.c b/src/glx/pixel.c index d36ca31e7d..d508d62073 100644 --- a/src/glx/pixel.c +++ b/src/glx/pixel.c @@ -80,7 +80,7 @@ static const GLubyte HighBitsMask[9] = { ** set of pixel modes that are to be done by the server. */ static void -FillBitmap(__GLXcontext * gc, GLint width, GLint height, +FillBitmap(struct glx_context * gc, GLint width, GLint height, GLenum format, const GLvoid * userdata, GLubyte * destImage) { const __GLXattribute *state = gc->client_state_private; @@ -161,7 +161,7 @@ FillBitmap(__GLXcontext * gc, GLint width, GLint height, ** ALIGNMENT = 1. */ void -__glFillImage(__GLXcontext * gc, GLint dim, GLint width, GLint height, +__glFillImage(struct glx_context * gc, GLint dim, GLint width, GLint height, GLint depth, GLenum format, GLenum type, const GLvoid * userdata, GLubyte * newimage, GLubyte * modes) { @@ -268,7 +268,7 @@ __glFillImage(__GLXcontext * gc, GLint dim, GLint width, GLint height, ** into the clients memory using the pixel store PACK modes. */ static void -EmptyBitmap(__GLXcontext * gc, GLint width, GLint height, +EmptyBitmap(struct glx_context * gc, GLint width, GLint height, GLenum format, const GLubyte * sourceImage, GLvoid * userdata) { const __GLXattribute *state = gc->client_state_private; @@ -388,7 +388,7 @@ EmptyBitmap(__GLXcontext * gc, GLint width, GLint height, */ /* ARGSUSED */ void -__glEmptyImage(__GLXcontext * gc, GLint dim, GLint width, GLint height, +__glEmptyImage(struct glx_context * gc, GLint dim, GLint width, GLint height, GLint depth, GLenum format, GLenum type, const GLubyte * sourceImage, GLvoid * userdata) { diff --git a/src/glx/pixelstore.c b/src/glx/pixelstore.c index dc193b9f74..1d776b817e 100644 --- a/src/glx/pixelstore.c +++ b/src/glx/pixelstore.c @@ -46,7 +46,7 @@ * \sa __indirect_glPixelStorei, __indirect_glPixelStoref */ static void -send_PixelStore(__GLXcontext * gc, unsigned sop, GLenum pname, +send_PixelStore(struct glx_context * gc, unsigned sop, GLenum pname, const void *param) { Display *const dpy = gc->currentDpy; @@ -67,7 +67,7 @@ send_PixelStore(__GLXcontext * gc, unsigned sop, GLenum pname, void __indirect_glPixelStoref(GLenum pname, GLfloat param) { - __GLXcontext *gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); __GLXattribute *state = gc->client_state_private; Display *dpy = gc->currentDpy; GLuint a; @@ -217,7 +217,7 @@ __indirect_glPixelStoref(GLenum pname, GLfloat param) void __indirect_glPixelStorei(GLenum pname, GLint param) { - __GLXcontext *gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); __GLXattribute *state = gc->client_state_private; Display *dpy = gc->currentDpy; diff --git a/src/glx/renderpix.c b/src/glx/renderpix.c index 9919bbcde3..8234bbe21f 100644 --- a/src/glx/renderpix.c +++ b/src/glx/renderpix.c @@ -82,7 +82,7 @@ * broken. */ void -__glXSendLargeImage(__GLXcontext * gc, GLint compsize, GLint dim, +__glXSendLargeImage(struct glx_context * gc, GLint compsize, GLint dim, GLint width, GLint height, GLint depth, GLenum format, GLenum type, const GLvoid * src, GLubyte * pc, GLubyte * modes) diff --git a/src/glx/single2.c b/src/glx/single2.c index a1461956b9..318d18e555 100644 --- a/src/glx/single2.c +++ b/src/glx/single2.c @@ -156,7 +156,7 @@ __indirect_glGetError(void) * On success \c GL_TRUE is returned. Otherwise, \c GL_FALSE is returned. */ static GLboolean -get_client_data(__GLXcontext * gc, GLenum cap, GLintptr * data) +get_client_data(struct glx_context * gc, GLenum cap, GLintptr * data) { GLboolean retval = GL_TRUE; __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); @@ -646,7 +646,7 @@ version_from_string(const char *ver, int *major_version, int *minor_version) const GLubyte * __indirect_glGetString(GLenum name) { - __GLXcontext *gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); Display *dpy = gc->currentDpy; GLubyte *s = NULL; @@ -837,7 +837,7 @@ __indirect_glIsEnabled(GLenum cap) void __indirect_glGetPointerv(GLenum pname, void **params) { - __GLXcontext *gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); Display *dpy = gc->currentDpy; @@ -885,7 +885,7 @@ GLboolean __indirect_glAreTexturesResident(GLsizei n, const GLuint * textures, GLboolean * residences) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; GLboolean retval = (GLboolean) 0; const GLuint cmdlen = 4 + __GLX_PAD((n * 4)); @@ -941,14 +941,14 @@ GLboolean glAreTexturesResidentEXT(GLsizei n, const GLuint * textures, GLboolean * residences) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); if (gc->isDirect) { return CALL_AreTexturesResident(GET_DISPATCH(), (n, textures, residences)); } else { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); Display *const dpy = gc->currentDpy; GLboolean retval = (GLboolean) 0; const GLuint cmdlen = 4 + __GLX_PAD((n * 4)); diff --git a/src/glx/singlepix.c b/src/glx/singlepix.c index c4010d79bd..edb8858d7a 100644 --- a/src/glx/singlepix.c +++ b/src/glx/singlepix.c @@ -117,7 +117,7 @@ void NAME(_gloffset_GetSeparableFilter) (GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span) { - __GLXcontext *const gc = __glXGetCurrentContext(); + struct glx_context *const gc = __glXGetCurrentContext(); #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) if (gc->driContext) { diff --git a/src/glx/vertarr.c b/src/glx/vertarr.c index 398cfb1e79..609cafac2b 100644 --- a/src/glx/vertarr.c +++ b/src/glx/vertarr.c @@ -101,7 +101,7 @@ void __indirect_glInterleavedArrays(GLenum format, GLsizei stride, const GLvoid * pointer) { - __GLXcontext *gc = __glXGetCurrentContext(); + struct glx_context *gc = __glXGetCurrentContext(); __GLXattribute *state = (__GLXattribute *) (gc->client_state_private); #define NONE {0, 0, 0} diff --git a/src/glx/xfont.c b/src/glx/xfont.c index db3a570110..4ca2c8f868 100644 --- a/src/glx/xfont.c +++ b/src/glx/xfont.c @@ -212,7 +212,7 @@ isvalid(XFontStruct * fs, int which) } _X_HIDDEN void -DRI_glXUseXFont(GLXContext CC, Font font, int first, int count, int listbase) +DRI_glXUseXFont(struct glx_context *CC, Font font, int first, int count, int listbase) { Display *dpy; Window win; diff --git a/src/mapi/glapi/gen/glX_proto_recv.py b/src/mapi/glapi/gen/glX_proto_recv.py index 31745fcef7..887f63191d 100644 --- a/src/mapi/glapi/gen/glX_proto_recv.py +++ b/src/mapi/glapi/gen/glX_proto_recv.py @@ -384,9 +384,9 @@ class PrintGlxDispatchFunctions(glX_proto_common.glx_print_proto): print ' int error;' if self.do_swap: - print ' __GLXcontext * const cx = __glXForceCurrent(cl, bswap_CARD32( &req->contextTag ), &error);' + print ' struct glx_context * const cx = __glXForceCurrent(cl, bswap_CARD32( &req->contextTag ), &error);' else: - print ' __GLXcontext * const cx = __glXForceCurrent(cl, req->contextTag, &error);' + print ' struct glx_context * const cx = __glXForceCurrent(cl, req->contextTag, &error);' print '' if name not in f.glx_vendorpriv_names: diff --git a/src/mapi/glapi/gen/glX_proto_send.py b/src/mapi/glapi/gen/glX_proto_send.py index e732282073..08f332f504 100644 --- a/src/mapi/glapi/gen/glX_proto_send.py +++ b/src/mapi/glapi/gen/glX_proto_send.py @@ -220,7 +220,7 @@ __glXReadReply( Display *dpy, size_t size, void * dest, GLboolean reply_is_alway } NOINLINE void -__glXReadPixelReply( Display *dpy, __GLXcontext * gc, unsigned max_dim, +__glXReadPixelReply( Display *dpy, struct glx_context * gc, unsigned max_dim, GLint width, GLint height, GLint depth, GLenum format, GLenum type, void * dest, GLboolean dimensions_in_reply ) { @@ -264,7 +264,7 @@ __glXReadPixelReply( Display *dpy, __GLXcontext * gc, unsigned max_dim, #define X_GLXSingle 0 NOINLINE FASTCALL GLubyte * -__glXSetupSingleRequest( __GLXcontext * gc, GLint sop, GLint cmdlen ) +__glXSetupSingleRequest( struct glx_context * gc, GLint sop, GLint cmdlen ) { xGLXSingleReq * req; Display * const dpy = gc->currentDpy; @@ -279,7 +279,7 @@ __glXSetupSingleRequest( __GLXcontext * gc, GLint sop, GLint cmdlen ) } NOINLINE FASTCALL GLubyte * -__glXSetupVendorRequest( __GLXcontext * gc, GLint code, GLint vop, GLint cmdlen ) +__glXSetupVendorRequest( struct glx_context * gc, GLint code, GLint vop, GLint cmdlen ) { xGLXVendorPrivateReq * req; Display * const dpy = gc->currentDpy; @@ -371,7 +371,7 @@ const GLuint __glXDefaultPixelStore[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 1 }; print '#define %s %d' % (func.opcode_vendor_name(name), func.glx_vendorpriv) print '%s gl%s(%s)' % (func.return_type, func_name, func.get_parameter_string()) print '{' - print ' __GLXcontext * const gc = __glXGetCurrentContext();' + print ' struct glx_context * const gc = __glXGetCurrentContext();' print '' print '#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)' print ' if (gc->driContext) {' @@ -408,7 +408,7 @@ const GLuint __glXDefaultPixelStore[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 1 }; print """static FASTCALL NOINLINE void generic_%u_byte( GLint rop, const void * ptr ) { - __GLXcontext * const gc = __glXGetCurrentContext(); + struct glx_context * const gc = __glXGetCurrentContext(); const GLuint cmdlen = %u; emit_header(gc->pc, rop, cmdlen); @@ -523,7 +523,7 @@ generic_%u_byte( GLint rop, const void * ptr ) def common_func_print_just_start(self, f, name): - print ' __GLXcontext * const gc = __glXGetCurrentContext();' + print ' struct glx_context * const gc = __glXGetCurrentContext();' # The only reason that single and vendor private commands need # a variable called 'dpy' is becuase they use the SyncHandle @@ -971,15 +971,15 @@ extern HIDDEN NOINLINE CARD32 __glXReadReply( Display *dpy, size_t size, void * dest, GLboolean reply_is_always_array ); extern HIDDEN NOINLINE void __glXReadPixelReply( Display *dpy, - __GLXcontext * gc, unsigned max_dim, GLint width, GLint height, + struct glx_context * gc, unsigned max_dim, GLint width, GLint height, GLint depth, GLenum format, GLenum type, void * dest, GLboolean dimensions_in_reply ); extern HIDDEN NOINLINE FASTCALL GLubyte * __glXSetupSingleRequest( - __GLXcontext * gc, GLint sop, GLint cmdlen ); + struct glx_context * gc, GLint sop, GLint cmdlen ); extern HIDDEN NOINLINE FASTCALL GLubyte * __glXSetupVendorRequest( - __GLXcontext * gc, GLint code, GLint vop, GLint cmdlen ); + struct glx_context * gc, GLint code, GLint vop, GLint cmdlen ); """ -- cgit v1.2.3 From c491e585e43d48a2aeec96ccc4008da6c443fb42 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Wed, 28 Jul 2010 15:33:09 -0400 Subject: glx: Move bind and unbind to context vtable --- src/glx/dri2_glx.c | 28 ++-- src/glx/dri_common.c | 27 ++++ src/glx/dri_common.h | 3 + src/glx/dri_glx.c | 57 ++++---- src/glx/drisw_glx.c | 32 +++-- src/glx/glxclient.h | 25 ++-- src/glx/glxcmds.c | 28 ++-- src/glx/glxcurrent.c | 246 +++++++++++------------------------ src/glx/glxext.c | 2 +- src/glx/indirect.c | 30 ++--- src/glx/singlepix.c | 2 +- src/mapi/glapi/gen/glX_proto_send.py | 2 +- 12 files changed, 206 insertions(+), 276 deletions(-) (limited to 'src/glx') diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c index 8ad0e339ed..e57d10f091 100644 --- a/src/glx/dri2_glx.c +++ b/src/glx/dri2_glx.c @@ -95,7 +95,6 @@ struct dri2_screen { struct dri2_context { struct glx_context base; - __GLXDRIcontext dri_vtable; __DRIcontext *driContext; }; @@ -133,20 +132,28 @@ dri2_destroy_context(struct glx_context *context) } static Bool -dri2BindContext(struct glx_context *context, - __GLXDRIdrawable *draw, __GLXDRIdrawable *read) +dri2_bind_context(struct glx_context *context, struct glx_context *old, + GLXDrawable draw, GLXDrawable read) { struct dri2_context *pcp = (struct dri2_context *) context; struct dri2_screen *psc = (struct dri2_screen *) pcp->base.psc; - struct dri2_drawable *pdr = (struct dri2_drawable *) draw; - struct dri2_drawable *prd = (struct dri2_drawable *) read; + struct dri2_drawable *pdraw, *pread; - return (*psc->core->bindContext) (pcp->driContext, - pdr->driDrawable, prd->driDrawable); + pdraw = (struct dri2_drawable *) driFetchDrawable(context, draw); + pread = (struct dri2_drawable *) driFetchDrawable(context, read); + + if (pdraw == NULL || pread == NULL) + return GLXBadDrawable; + + if ((*psc->core->bindContext) (pcp->driContext, + pdraw->driDrawable, pread->driDrawable)) + return Success; + + return GLXBadContext; } static void -dri2UnbindContext(struct glx_context *context) +dri2_unbind_context(struct glx_context *context, struct glx_context *new) { struct dri2_context *pcp = (struct dri2_context *) context; struct dri2_screen *psc = (struct dri2_screen *) pcp->base.psc; @@ -189,9 +196,6 @@ dri2_create_context(struct glx_screen *base, } pcp->base.vtable = &dri2_context_vtable; - pcp->base.driContext = &pcp->dri_vtable; - pcp->dri_vtable.bindContext = dri2BindContext; - pcp->dri_vtable.unbindContext = dri2UnbindContext; return &pcp->base; } @@ -684,6 +688,8 @@ dri2_release_tex_image(Display * dpy, GLXDrawable drawable, int buffer) static const struct glx_context_vtable dri2_context_vtable = { dri2_destroy_context, + dri2_bind_context, + dri2_unbind_context, dri2_wait_gl, dri2_wait_x, DRI_glXUseXFont, diff --git a/src/glx/dri_common.c b/src/glx/dri_common.c index 812fb2eb08..a7fb4c6424 100644 --- a/src/glx/dri_common.c +++ b/src/glx/dri_common.c @@ -353,4 +353,31 @@ driDestroyConfigs(const __DRIconfig **configs) free(configs); } +_X_HIDDEN __GLXDRIdrawable * +driFetchDrawable(struct glx_context *gc, GLXDrawable glxDrawable) +{ + struct glx_display *const priv = __glXInitialize(gc->psc->dpy); + __GLXDRIdrawable *pdraw; + struct glx_screen *psc; + + if (priv == NULL) + return NULL; + + psc = priv->screens[gc->screen]; + if (priv->drawHash == NULL) + return NULL; + + if (__glxHashLookup(priv->drawHash, glxDrawable, (void *) &pdraw) == 0) + return pdraw; + + pdraw = psc->driScreen->createDrawable(psc, glxDrawable, + glxDrawable, gc->config); + if (__glxHashInsert(priv->drawHash, glxDrawable, pdraw)) { + (*pdraw->destroyDrawable) (pdraw); + return NULL; + } + + return pdraw; +} + #endif /* GLX_DIRECT_RENDERING */ diff --git a/src/glx/dri_common.h b/src/glx/dri_common.h index 32d98ed3c1..846a905a88 100644 --- a/src/glx/dri_common.h +++ b/src/glx/dri_common.h @@ -52,6 +52,9 @@ extern struct glx_config *driConvertConfigs(const __DRIcoreExtension * core, extern void driDestroyConfigs(const __DRIconfig **configs); +extern __GLXDRIdrawable * +driFetchDrawable(struct glx_context *gc, GLXDrawable glxDrawable); + extern const __DRIsystemTimeExtension systemTimeExtension; extern void InfoMessageF(const char *f, ...); diff --git a/src/glx/dri_glx.c b/src/glx/dri_glx.c index 70281f663e..43a2aa495a 100644 --- a/src/glx/dri_glx.c +++ b/src/glx/dri_glx.c @@ -79,7 +79,6 @@ struct dri_screen struct dri_context { struct glx_context base; - __GLXDRIcontext dri_vtable; __DRIcontext *driContext; XID hwContextID; }; @@ -518,21 +517,29 @@ dri_destroy_context(struct glx_context * context) Xfree(pcp); } -static Bool -driBindContext(struct glx_context *context, - __GLXDRIdrawable *draw, __GLXDRIdrawable *read) +static int +dri_bind_context(struct glx_context *context, struct glx_context *old, + GLXDrawable draw, GLXDrawable read) { struct dri_context *pcp = (struct dri_context *) context; struct dri_screen *psc = (struct dri_screen *) pcp->base.psc; - struct dri_drawable *pdr = (struct dri_drawable *) draw; - struct dri_drawable *prd = (struct dri_drawable *) read; + struct dri_drawable *pdraw, *pread; + + pdraw = (struct dri_drawable *) driFetchDrawable(context, draw); + pread = (struct dri_drawable *) driFetchDrawable(context, read); + + if (pdraw == NULL || pread == NULL) + return GLXBadDrawable; - return (*psc->core->bindContext) (pcp->driContext, - pdr->driDrawable, prd->driDrawable); + if ((*psc->core->bindContext) (pcp->driContext, + pdraw->driDrawable, pread->driDrawable)) + return Success; + + return GLXBadContext; } static void -driUnbindContext(struct glx_context * context) +dri_unbind_context(struct glx_context *context, struct glx_context *new) { struct dri_context *pcp = (struct dri_context *) context; struct dri_screen *psc = (struct dri_screen *) pcp->base.psc; @@ -542,6 +549,8 @@ driUnbindContext(struct glx_context * context) static const struct glx_context_vtable dri_context_vtable = { dri_destroy_context, + dri_bind_context, + dri_unbind_context, NULL, NULL, DRI_glXUseXFont, @@ -564,7 +573,7 @@ dri_create_context(struct glx_screen *base, return NULL; if (shareList) { - pcp_shared = (struct dri_context *) shareList->driContext; + pcp_shared = (struct dri_context *) shareList; shared = pcp_shared->driContext; } @@ -596,9 +605,6 @@ dri_create_context(struct glx_screen *base, } pcp->base.vtable = &dri_context_vtable; - pcp->base.driContext = &pcp->dri_vtable; - pcp->dri_vtable.bindContext = driBindContext; - pcp->dri_vtable.unbindContext = driUnbindContext; return &pcp->base; } @@ -756,17 +762,12 @@ driWaitForSBC(__GLXDRIdrawable *pdraw, int64_t target_sbc, int64_t *ust, static int driSetSwapInterval(__GLXDRIdrawable *pdraw, int interval) { - struct glx_context *gc = __glXGetCurrentContext(); struct dri_drawable *pdp = (struct dri_drawable *) pdraw; - struct dri_screen *psc; - - if (gc->driContext) { - psc = (struct dri_screen *) pdraw->psc; + struct dri_screen *psc = (struct dri_screen *) pdraw->psc; - if (psc->swapControl != NULL && pdraw != NULL) { - psc->swapControl->setSwapInterval(pdp->driDrawable, interval); - return 0; - } + if (psc->swapControl != NULL && pdraw != NULL) { + psc->swapControl->setSwapInterval(pdp->driDrawable, interval); + return 0; } return GLX_BAD_CONTEXT; @@ -775,17 +776,11 @@ driSetSwapInterval(__GLXDRIdrawable *pdraw, int interval) static int driGetSwapInterval(__GLXDRIdrawable *pdraw) { - struct glx_context *gc = __glXGetCurrentContext(); struct dri_drawable *pdp = (struct dri_drawable *) pdraw; - struct dri_screen *psc; - - if (gc != NULL && gc->driContext) { - psc = (struct dri_screen *) pdraw->psc; + struct dri_screen *psc = (struct dri_screen *) pdraw->psc; - if (psc->swapControl != NULL && pdraw != NULL) { - return psc->swapControl->getSwapInterval(pdp->driDrawable); - } - } + if (psc->swapControl != NULL && pdraw != NULL) + return psc->swapControl->getSwapInterval(pdp->driDrawable); return 0; } diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c index 070c9d612b..46c56066e6 100644 --- a/src/glx/drisw_glx.c +++ b/src/glx/drisw_glx.c @@ -36,7 +36,6 @@ struct drisw_display struct drisw_context { struct glx_context base; - __GLXDRIcontext dri_vtable; __DRIcontext *driContext; }; @@ -258,21 +257,29 @@ drisw_destroy_context(struct glx_context *context) Xfree(pcp); } -static Bool -driBindContext(struct glx_context * context, - __GLXDRIdrawable * draw, __GLXDRIdrawable * read) +static int +drisw_bind_context(struct glx_context *context, struct glx_context *old, + GLXDrawable draw, GLXDrawable read) { struct drisw_context *pcp = (struct drisw_context *) context; struct drisw_screen *psc = (struct drisw_screen *) pcp->base.psc; - struct drisw_drawable *pdr = (struct drisw_drawable *) draw; - struct drisw_drawable *prd = (struct drisw_drawable *) read; + struct drisw_drawable *pdraw, *pread; + + pdraw = (struct drisw_drawable *) driFetchDrawable(context, draw); + pread = (struct drisw_drawable *) driFetchDrawable(context, read); + + if (pdraw == NULL || pread == NULL) + return GLXBadDrawable; + + if ((*psc->core->bindContext) (pcp->driContext, + pdraw->driDrawable, pread->driDrawable)) + return Success; - return (*psc->core->bindContext) (pcp->driContext, - pdr->driDrawable, prd->driDrawable); + return GLXBadContext; } static void -driUnbindContext(struct glx_context * context) +drisw_unbind_context(struct glx_context *context, struct glx_context *new) { struct drisw_context *pcp = (struct drisw_context *) context; struct drisw_screen *psc = (struct drisw_screen *) pcp->base.psc; @@ -282,6 +289,8 @@ driUnbindContext(struct glx_context * context) static const struct glx_context_vtable drisw_context_vtable = { drisw_destroy_context, + drisw_bind_context, + drisw_unbind_context, NULL, NULL, DRI_glXUseXFont, @@ -303,7 +312,7 @@ drisw_create_context(struct glx_screen *base, return NULL; if (shareList) { - pcp_shared = (struct drisw_context *) shareList->driContext; + pcp_shared = (struct drisw_context *) shareList; shared = pcp_shared->driContext; } @@ -326,9 +335,6 @@ drisw_create_context(struct glx_screen *base, } pcp->base.vtable = &drisw_context_vtable; - pcp->base.driContext = &pcp->dri_vtable; - pcp->dri_vtable.bindContext = driBindContext; - pcp->dri_vtable.unbindContext = driUnbindContext; return &pcp->base; } diff --git a/src/glx/glxclient.h b/src/glx/glxclient.h index 4f5c02fc34..b13cc81b57 100644 --- a/src/glx/glxclient.h +++ b/src/glx/glxclient.h @@ -88,7 +88,6 @@ extern void DRI_glXUseXFont(struct glx_context *ctx, typedef struct __GLXDRIdisplayRec __GLXDRIdisplay; typedef struct __GLXDRIscreenRec __GLXDRIscreen; typedef struct __GLXDRIdrawableRec __GLXDRIdrawable; -typedef struct __GLXDRIcontextRec __GLXDRIcontext; #include "glxextensions.h" @@ -131,13 +130,6 @@ struct __GLXDRIscreenRec { int (*getSwapInterval)(__GLXDRIdrawable *pdraw); }; -struct __GLXDRIcontextRec -{ - Bool(*bindContext) (struct glx_context *context, __GLXDRIdrawable *pdraw, - __GLXDRIdrawable *pread); - void (*unbindContext) (struct glx_context *context); -}; - struct __GLXDRIdrawableRec { void (*destroyDrawable) (__GLXDRIdrawable * drawable); @@ -221,6 +213,9 @@ typedef struct __GLXattributeMachineRec struct glx_context_vtable { void (*destroy)(struct glx_context *ctx); + int (*bind)(struct glx_context *context, struct glx_context *old, + GLXDrawable draw, GLXDrawable read); + void (*unbind)(struct glx_context *context, struct glx_context *new); void (*wait_gl)(struct glx_context *ctx); void (*wait_x)(struct glx_context *ctx); void (*use_x_font)(struct glx_context *ctx, @@ -388,15 +383,6 @@ struct glx_context */ struct glx_config *config; -#ifdef GLX_DIRECT_RENDERING -#ifdef GLX_USE_APPLEGL - void *driContext; - Bool do_destroy; -#else - __GLXDRIcontext *driContext; -#endif -#endif - /** * The current read-drawable for this context. Will be None if this * context is not current to any drawable. @@ -790,5 +776,10 @@ GetGLXDRIDrawable(Display *dpy, GLXDrawable drawable); extern struct glx_screen * indirect_create_screen(int screen, struct glx_display * priv); +extern int +indirect_bind_context(struct glx_context *gc, struct glx_context *old, + GLXDrawable draw, GLXDrawable read); +extern void +indirect_unbind_context(struct glx_context *gc, struct glx_context *new); #endif /* !__GLX_client_h__ */ diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c index f2081fdd2c..717108e2fc 100644 --- a/src/glx/glxcmds.c +++ b/src/glx/glxcmds.c @@ -42,15 +42,12 @@ #include "apple_glx_context.h" #include "apple_glx.h" #include "glx_error.h" -#define GC_IS_DIRECT(gc) ((gc)->isDirect) #else #include #include #include "xf86dri.h" -#define GC_IS_DIRECT(gc) ((gc)->driContext != NULL) #endif #else -#define GC_IS_DIRECT(gc) (0) #endif #if defined(USE_XCB) @@ -424,6 +421,7 @@ glx_context_init(struct glx_context *gc, gc->psc = psc; gc->config = config; gc->isDirect = GL_TRUE; + gc->currentContextTag = -1; return GL_TRUE; } @@ -475,7 +473,7 @@ CreateContext(Display * dpy, int generic_id, req->visual = generic_id; req->screen = screen; req->shareList = shareList ? shareList->xid : None; - req->isDirect = GC_IS_DIRECT(gc); + req->isDirect = gc->isDirect; break; } @@ -491,7 +489,7 @@ CreateContext(Display * dpy, int generic_id, req->screen = screen; req->renderType = renderType; req->shareList = shareList ? shareList->xid : None; - req->isDirect = GC_IS_DIRECT(gc); + req->isDirect = gc->isDirect; break; } @@ -512,7 +510,7 @@ CreateContext(Display * dpy, int generic_id, req->screen = screen; req->renderType = renderType; req->shareList = shareList ? shareList->xid : None; - req->isDirect = GC_IS_DIRECT(gc); + req->isDirect = gc->isDirect; break; } @@ -836,7 +834,7 @@ glXCopyContext(Display * dpy, GLXContext source_user, } #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) - if (gc->driContext) { + if (gc->isDirect) { /* NOT_DONE: This does not work yet */ } #endif @@ -929,7 +927,7 @@ glXIsDirect(Display * dpy, GLXContext gc_user) if (!gc) { return GL_FALSE; } - else if (GC_IS_DIRECT(gc)) { + else if (gc->isDirect) { return GL_TRUE; } #ifdef GLX_USE_APPLEGL /* TODO: indirect on darwin */ @@ -1962,7 +1960,7 @@ __glXSwapIntervalSGI(int interval) psc = GetGLXScreenConfigs( gc->currentDpy, gc->screen); #ifdef GLX_DIRECT_RENDERING - if (gc->driContext && psc->driScreen && psc->driScreen->setSwapInterval) { + if (gc->isDirect && psc->driScreen && psc->driScreen->setSwapInterval) { __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(gc->currentDpy, gc->currentDrawable); psc->driScreen->setSwapInterval(pdraw, interval); @@ -2004,7 +2002,7 @@ __glXSwapIntervalMESA(unsigned int interval) #ifdef GLX_DIRECT_RENDERING struct glx_context *gc = __glXGetCurrentContext(); - if (gc != NULL && gc->driContext) { + if (gc != NULL && gc->isDirect) { struct glx_screen *psc; psc = GetGLXScreenConfigs( gc->currentDpy, gc->screen); @@ -2026,7 +2024,7 @@ __glXGetSwapIntervalMESA(void) #ifdef GLX_DIRECT_RENDERING struct glx_context *gc = __glXGetCurrentContext(); - if (gc != NULL && gc->driContext) { + if (gc != NULL && gc->isDirect) { struct glx_screen *psc; psc = GetGLXScreenConfigs( gc->currentDpy, gc->screen); @@ -2060,7 +2058,7 @@ __glXGetVideoSyncSGI(unsigned int *count) return GLX_BAD_CONTEXT; #ifdef GLX_DIRECT_RENDERING - if (!gc->driContext) + if (!gc->isDirect) return GLX_BAD_CONTEXT; #endif @@ -2102,7 +2100,7 @@ __glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count) return GLX_BAD_CONTEXT; #ifdef GLX_DIRECT_RENDERING - if (!gc->driContext) + if (!gc->isDirect) return GLX_BAD_CONTEXT; #endif @@ -2423,7 +2421,7 @@ __glXSwapBuffersMscOML(Display * dpy, GLXDrawable drawable, return -1; #ifdef GLX_DIRECT_RENDERING - if (!pdraw || !gc->driContext) + if (!pdraw || !gc->isDirect) return -1; #endif @@ -2721,6 +2719,8 @@ indirect_release_tex_image(Display * dpy, GLXDrawable drawable, int buffer) static const struct glx_context_vtable indirect_context_vtable = { indirect_destroy_context, + indirect_bind_context, + indirect_unbind_context, indirect_wait_gl, indirect_wait_x, indirect_use_x_font, diff --git a/src/glx/glxcurrent.c b/src/glx/glxcurrent.c index c293af30c2..5955860494 100644 --- a/src/glx/glxcurrent.c +++ b/src/glx/glxcurrent.c @@ -283,37 +283,6 @@ SendMakeCurrentRequest(Display * dpy, CARD8 opcode, return ret; } - -#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) -static __GLXDRIdrawable * -FetchDRIDrawable(Display * dpy, - GLXDrawable glxDrawable, struct glx_context *gc) -{ - struct glx_display *const priv = __glXInitialize(dpy); - __GLXDRIdrawable *pdraw; - struct glx_screen *psc; - - if (priv == NULL) - return NULL; - - psc = priv->screens[gc->screen]; - if (priv->drawHash == NULL) - return NULL; - - if (__glxHashLookup(priv->drawHash, glxDrawable, (void *) &pdraw) == 0) - return pdraw; - - pdraw = psc->driScreen->createDrawable(psc, glxDrawable, - glxDrawable, gc->config); - if (__glxHashInsert(priv->drawHash, glxDrawable, pdraw)) { - (*pdraw->destroyDrawable) (pdraw); - return NULL; - } - - return pdraw; -} -#endif /* GLX_DIRECT_RENDERING */ - static void __glXGenerateError(Display * dpy, struct glx_context *gc, XID resource, BYTE errorCode, CARD16 minorCode) @@ -331,6 +300,55 @@ __glXGenerateError(Display * dpy, struct glx_context *gc, XID resource, #endif /* GLX_USE_APPLEGL */ +_X_HIDDEN int +indirect_bind_context(struct glx_context *gc, struct glx_context *old, + GLXDrawable draw, GLXDrawable read) +{ + xGLXMakeCurrentReply reply; + GLXContextTag tag; + __GLXattribute *state; + Display *dpy = gc->psc->dpy; + int opcode = __glXSetupForCommand(dpy); + + if (old && !old->isDirect && old->psc->dpy == dpy) + tag = old->currentContextTag; + else + tag = None; + + SendMakeCurrentRequest(dpy, opcode, gc->xid, tag, draw, read, &reply); + + if (!IndirectAPI) + IndirectAPI = __glXNewIndirectAPI(); + _glapi_set_dispatch(IndirectAPI); + + gc->currentContextTag = reply.contextTag; + state = gc->client_state_private; + if (state->array_state == NULL) { + glGetString(GL_EXTENSIONS); + glGetString(GL_VERSION); + __glXInitVertexArrayState(gc); + } + + return Success; +} + +_X_HIDDEN void +indirect_unbind_context(struct glx_context *gc, struct glx_context *new) +{ + Display *dpy = gc->psc->dpy; + int opcode = __glXSetupForCommand(dpy); + xGLXMakeCurrentReply reply; + + /* We are either switching to no context, away from a indirect + * context to a direct context or from one dpy to another and have + * to send a request to the dpy to unbind the previous context. + */ + if (!new || new->isDirect || new->psc->dpy != dpy) + SendMakeCurrentRequest(dpy, opcode, None, + gc->currentContextTag, None, None, &reply); + gc->currentContextTag = 0; +} + /** * Make a particular context current. * @@ -342,25 +360,7 @@ MakeContextCurrent(Display * dpy, GLXDrawable draw, { struct glx_context *gc = (struct glx_context *) gc_user; struct glx_context *oldGC = __glXGetCurrentContext(); -#ifdef GLX_USE_APPLEGL - bool error = apple_glx_make_current_context(dpy, - (oldGC && oldGC != &dummyContext) ? oldGC->driContext : NULL, - gc ? gc->driContext : NULL, draw); - - apple_glx_diagnostic("%s: error %s\n", __func__, error ? "YES" : "NO"); - if(error) - return GL_FALSE; -#else - xGLXMakeCurrentReply reply; - const CARD8 opcode = __glXSetupForCommand(dpy); - const CARD8 oldOpcode = ((gc == oldGC) || (oldGC == &dummyContext)) - ? opcode : __glXSetupForCommand(oldGC->currentDpy); - Bool bindReturnValue; - __GLXattribute *state; - - if (!opcode || !oldOpcode) { - return GL_FALSE; - } + int ret = Success; /* Make sure that the new context has a nonzero ID. In the request, * a zero context ID is used only to mean that we bind to no current @@ -388,134 +388,36 @@ MakeContextCurrent(Display * dpy, GLXDrawable draw, return False; } -#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) - /* Bind the direct rendering context to the drawable */ - if (gc && gc->driContext) { - __GLXDRIdrawable *pdraw = FetchDRIDrawable(dpy, draw, gc); - __GLXDRIdrawable *pread = FetchDRIDrawable(dpy, read, gc); - - if ((pdraw == NULL) || (pread == NULL)) { - __glXGenerateError(dpy, gc, (pdraw == NULL) ? draw : read, - GLXBadDrawable, X_GLXMakeContextCurrent); - return False; - } - - bindReturnValue = - (gc->driContext->bindContext) (gc, pdraw, pread); + if (oldGC != &dummyContext && oldGC != gc) { + oldGC->vtable->unbind(oldGC, gc); + oldGC->currentDpy = 0; + oldGC->currentDrawable = None; + oldGC->currentReadable = None; + oldGC->thread_id = 0; + if (oldGC->xid == None) + /* We are switching away from a context that was + * previously destroyed, so we need to free the memory + * for the old handle. + */ + oldGC->vtable->destroy(oldGC); } - else if (!gc && oldGC && oldGC->driContext) { - bindReturnValue = True; - } - else -#endif - { - /* Send a glXMakeCurrent request to bind the new context. */ - bindReturnValue = - SendMakeCurrentRequest(dpy, opcode, gc ? gc->xid : None, - ((dpy != oldGC->currentDpy) - || oldGC->isDirect) - ? None : oldGC->currentContextTag, draw, read, - &reply); - } - - if (!bindReturnValue) { - return False; + if (gc) { + ret = gc->vtable->bind(gc, oldGC, draw, read); + gc->currentDpy = dpy; + gc->currentDrawable = draw; + gc->currentReadable = read; + gc->thread_id = _glthread_GetID(); + __glXSetCurrentContext(gc); + } else { + __glXSetCurrentContextNull(); } -#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) - if ((dpy != oldGC->currentDpy || (gc && gc->driContext)) && - !oldGC->isDirect && oldGC != &dummyContext) { -#else - if ((dpy != oldGC->currentDpy) && oldGC != &dummyContext) { -#endif - xGLXMakeCurrentReply dummy_reply; - - /* We are either switching from one dpy to another and have to - * send a request to the previous dpy to unbind the previous - * context, or we are switching away from a indirect context to - * a direct context and have to send a request to the dpy to - * unbind the previous context. - */ - (void) SendMakeCurrentRequest(oldGC->currentDpy, oldOpcode, None, - oldGC->currentContextTag, None, None, - &dummy_reply); - } -#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) - else if (oldGC->driContext && oldGC != gc) { - oldGC->driContext->unbindContext(oldGC); - } -#endif - -#endif /* GLX_USE_APPLEGL */ - - /* Update our notion of what is current */ - __glXLock(); - if (gc == oldGC) { - /* Even though the contexts are the same the drawable might have - * changed. Note that gc cannot be the dummy, and that oldGC - * cannot be NULL, therefore if they are the same, gc is not - * NULL and not the dummy. - */ - if(gc) { - gc->currentDrawable = draw; - gc->currentReadable = read; - } + if (ret) { + __glXGenerateError(dpy, gc, None, ret, X_GLXMakeContextCurrent); + return GL_FALSE; } - else { - if (oldGC != &dummyContext) { - /* Old current context is no longer current to anybody */ - oldGC->currentDpy = 0; - oldGC->currentDrawable = None; - oldGC->currentReadable = None; - oldGC->currentContextTag = 0; - oldGC->thread_id = 0; - - if (oldGC->xid == None) { - /* We are switching away from a context that was - * previously destroyed, so we need to free the memory - * for the old handle. - */ - oldGC->vtable->destroy(oldGC); - } - } - if (gc) { - __glXSetCurrentContext(gc); - - gc->currentDpy = dpy; - gc->currentDrawable = draw; - gc->currentReadable = read; -#ifndef GLX_USE_APPLEGL - gc->thread_id = _glthread_GetID(); -#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) - if (!gc->driContext) { -#endif - if (!IndirectAPI) - IndirectAPI = __glXNewIndirectAPI(); - _glapi_set_dispatch(IndirectAPI); - - state = (__GLXattribute *) (gc->client_state_private); - - gc->currentContextTag = reply.contextTag; - if (state->array_state == NULL) { - (void) glGetString(GL_EXTENSIONS); - (void) glGetString(GL_VERSION); - __glXInitVertexArrayState(gc); - } -#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) - } - else { - gc->currentContextTag = -1; - } -#endif -#endif /* GLX_USE_APPLEGL */ - } - else { - __glXSetCurrentContextNull(); - } - } - __glXUnlock(); return GL_TRUE; } diff --git a/src/glx/glxext.c b/src/glx/glxext.c index 5930d7d5a8..e48c4c289c 100644 --- a/src/glx/glxext.c +++ b/src/glx/glxext.c @@ -742,7 +742,7 @@ glx_screen_init(struct glx_screen *psc, ** If that works then fetch the per screen configs data. */ static Bool - AllocAndFetchScreenConfigs(Display * dpy, struct glx_display * priv) +AllocAndFetchScreenConfigs(Display * dpy, struct glx_display * priv) { struct glx_screen *psc; GLint i, screens; diff --git a/src/glx/indirect.c b/src/glx/indirect.c index 0dea8e9f5a..c0fff6c4dc 100644 --- a/src/glx/indirect.c +++ b/src/glx/indirect.c @@ -5199,7 +5199,7 @@ glDeleteTexturesEXT(GLsizei n, const GLuint * textures) struct glx_context *const gc = __glXGetCurrentContext(); #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) - if (gc->driContext) { + if (gc->isDirect) { CALL_DeleteTextures(GET_DISPATCH(), (n, textures)); } else #endif @@ -5270,7 +5270,7 @@ glGenTexturesEXT(GLsizei n, GLuint * textures) struct glx_context *const gc = __glXGetCurrentContext(); #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) - if (gc->driContext) { + if (gc->isDirect) { CALL_GenTextures(GET_DISPATCH(), (n, textures)); } else #endif @@ -5335,7 +5335,7 @@ glIsTextureEXT(GLuint texture) struct glx_context *const gc = __glXGetCurrentContext(); #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) - if (gc->driContext) { + if (gc->isDirect) { return CALL_IsTexture(GET_DISPATCH(), (texture)); } else #endif @@ -5651,7 +5651,7 @@ glGetColorTableEXT(GLenum target, GLenum format, GLenum type, GLvoid * table) struct glx_context *const gc = __glXGetCurrentContext(); #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) - if (gc->driContext) { + if (gc->isDirect) { CALL_GetColorTable(GET_DISPATCH(), (target, format, type, table)); } else #endif @@ -5727,7 +5727,7 @@ glGetColorTableParameterfvEXT(GLenum target, GLenum pname, GLfloat * params) struct glx_context *const gc = __glXGetCurrentContext(); #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) - if (gc->driContext) { + if (gc->isDirect) { CALL_GetColorTableParameterfv(GET_DISPATCH(), (target, pname, params)); } else @@ -5800,7 +5800,7 @@ glGetColorTableParameterivEXT(GLenum target, GLenum pname, GLint * params) struct glx_context *const gc = __glXGetCurrentContext(); #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) - if (gc->driContext) { + if (gc->isDirect) { CALL_GetColorTableParameteriv(GET_DISPATCH(), (target, pname, params)); } else @@ -6126,7 +6126,7 @@ gl_dispatch_stub_356(GLenum target, GLenum format, GLenum type, struct glx_context *const gc = __glXGetCurrentContext(); #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) - if (gc->driContext) { + if (gc->isDirect) { CALL_GetConvolutionFilter(GET_DISPATCH(), (target, format, type, image)); } else @@ -6204,7 +6204,7 @@ gl_dispatch_stub_357(GLenum target, GLenum pname, GLfloat * params) struct glx_context *const gc = __glXGetCurrentContext(); #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) - if (gc->driContext) { + if (gc->isDirect) { CALL_GetConvolutionParameterfv(GET_DISPATCH(), (target, pname, params)); } else @@ -6277,7 +6277,7 @@ gl_dispatch_stub_358(GLenum target, GLenum pname, GLint * params) struct glx_context *const gc = __glXGetCurrentContext(); #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) - if (gc->driContext) { + if (gc->isDirect) { CALL_GetConvolutionParameteriv(GET_DISPATCH(), (target, pname, params)); } else @@ -6357,7 +6357,7 @@ gl_dispatch_stub_361(GLenum target, GLboolean reset, GLenum format, struct glx_context *const gc = __glXGetCurrentContext(); #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) - if (gc->driContext) { + if (gc->isDirect) { CALL_GetHistogram(GET_DISPATCH(), (target, reset, format, type, values)); } else @@ -6434,7 +6434,7 @@ gl_dispatch_stub_362(GLenum target, GLenum pname, GLfloat * params) struct glx_context *const gc = __glXGetCurrentContext(); #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) - if (gc->driContext) { + if (gc->isDirect) { CALL_GetHistogramParameterfv(GET_DISPATCH(), (target, pname, params)); } else #endif @@ -6505,7 +6505,7 @@ gl_dispatch_stub_363(GLenum target, GLenum pname, GLint * params) struct glx_context *const gc = __glXGetCurrentContext(); #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) - if (gc->driContext) { + if (gc->isDirect) { CALL_GetHistogramParameteriv(GET_DISPATCH(), (target, pname, params)); } else #endif @@ -6580,7 +6580,7 @@ gl_dispatch_stub_364(GLenum target, GLboolean reset, GLenum format, struct glx_context *const gc = __glXGetCurrentContext(); #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) - if (gc->driContext) { + if (gc->isDirect) { CALL_GetMinmax(GET_DISPATCH(), (target, reset, format, type, values)); } else #endif @@ -6654,7 +6654,7 @@ gl_dispatch_stub_365(GLenum target, GLenum pname, GLfloat * params) struct glx_context *const gc = __glXGetCurrentContext(); #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) - if (gc->driContext) { + if (gc->isDirect) { CALL_GetMinmaxParameterfv(GET_DISPATCH(), (target, pname, params)); } else #endif @@ -6722,7 +6722,7 @@ gl_dispatch_stub_366(GLenum target, GLenum pname, GLint * params) struct glx_context *const gc = __glXGetCurrentContext(); #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) - if (gc->driContext) { + if (gc->isDirect) { CALL_GetMinmaxParameteriv(GET_DISPATCH(), (target, pname, params)); } else #endif diff --git a/src/glx/singlepix.c b/src/glx/singlepix.c index edb8858d7a..b61f26b2f3 100644 --- a/src/glx/singlepix.c +++ b/src/glx/singlepix.c @@ -120,7 +120,7 @@ void NAME(_gloffset_GetSeparableFilter) (GLenum target, GLenum format, struct glx_context *const gc = __glXGetCurrentContext(); #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) - if (gc->driContext) { + if (gc->isDirect) { CALL_GetSeparableFilter(GET_DISPATCH(), (target, format, type, row, column, span)); return; diff --git a/src/mapi/glapi/gen/glX_proto_send.py b/src/mapi/glapi/gen/glX_proto_send.py index 08f332f504..0ca0ff92a6 100644 --- a/src/mapi/glapi/gen/glX_proto_send.py +++ b/src/mapi/glapi/gen/glX_proto_send.py @@ -374,7 +374,7 @@ const GLuint __glXDefaultPixelStore[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 1 }; print ' struct glx_context * const gc = __glXGetCurrentContext();' print '' print '#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)' - print ' if (gc->driContext) {' + print ' if (gc->isDirect) {' print ' %sCALL_%s(GET_DISPATCH(), (%s));' % (ret_string, func.name, func.get_called_parameter_string()) print ' } else' print '#endif' -- cgit v1.2.3 From 6849916170c0275c13510251a7b217c20f2b993e Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Wed, 28 Jul 2010 16:40:43 -0400 Subject: glx: Split indirect and applegl implementations into different files --- src/glx/Makefile | 5 +- src/glx/applegl_glx.c | 155 +++++++++++++++++ src/glx/glxclient.h | 9 +- src/glx/glxcmds.c | 393 ------------------------------------------ src/glx/glxcurrent.c | 147 ---------------- src/glx/glxext.c | 6 +- src/glx/indirect_glx.c | 456 +++++++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 624 insertions(+), 547 deletions(-) create mode 100644 src/glx/applegl_glx.c create mode 100644 src/glx/indirect_glx.c (limited to 'src/glx') diff --git a/src/glx/Makefile b/src/glx/Makefile index 70def7a2fb..9a22d0c547 100644 --- a/src/glx/Makefile +++ b/src/glx/Makefile @@ -13,6 +13,7 @@ SOURCES = \ glxcurrent.c \ glxext.c \ glxextensions.c \ + indirect_glx.c \ indirect.c \ indirect_init.c \ indirect_size.c \ @@ -37,7 +38,9 @@ SOURCES = \ XF86dri.c \ glxhash.c \ dri2_glx.c \ - dri2.c + dri2.c \ + applegl_glx.c + GLAPI_LIB = $(TOP)/src/mapi/glapi/libglapi.a diff --git a/src/glx/applegl_glx.c b/src/glx/applegl_glx.c new file mode 100644 index 0000000000..3da1f19323 --- /dev/null +++ b/src/glx/applegl_glx.c @@ -0,0 +1,155 @@ +/* + * Copyright © 2010 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Soft- + * ware"), to deal in the Software without restriction, including without + * limitation the rights to use, copy, modify, merge, publish, distribute, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, provided that the above copyright + * notice(s) and this permission notice appear in all copies of the Soft- + * ware and that both the above copyright notice(s) and this permission + * notice appear in supporting documentation. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- + * ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY + * RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN + * THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSE- + * QUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFOR- + * MANCE OF THIS SOFTWARE. + * + * Except as contained in this notice, the name of a copyright holder shall + * not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization of + * the copyright holder. + * + * Authors: + * Kristian Høgsberg (krh@bitplanet.net) + */ + +#if defined(GLX_USE_APPLEGL) + +static void +applegl_destroy_context(struct glx_context *gc) +{ + apple_glx_destroy_context(&gc->driContext, gc->currentDpy); +} + +static int +applegl_bind_context(struct glx_context *gc, struct glx_context *old, + GLXDrawable draw, GLXDrawable read) +{ + bool error = apple_glx_make_current_context(dpy, + (oldGC && oldGC != &dummyContext) ? oldGC->driContext : NUL~ + gc ? gc->driContext : NULL, draw); + + apple_glx_diagnostic("%s: error %s\n", __func__, error ? "YES" : "NO"); + if (error) + return GLXBadContext; + + return Success; +} + +static void +applegl_unbind_context(struct glx_context *gc, struct glx_context *new) +{ +} + +static void +applegl_wait_gl(struct glx_context *gc) +{ + glFinish(); +} + +static void +applegl_wait_x(struct glx_context *gc) +{ + apple_glx_waitx(gc->dpy, gc->driContext); +} + +static const struct glx_context_vtable applegl_context_vtable = { + applegl_destroy_context, + applegl_bind_context, + applegl_unbind_context, + applegl_wait_gl, + applegl_wait_x, + DRI_glXUseXFont, + NULL, /* bind_tex_image, */ + NULL, /* release_tex_image, */ +}; + +static struct glx_context * +applegl_create_context(struct glx_screen *psc, + struct glx_config *mode, + struct glx_context *shareList, int renderType) +{ + struct glx_context *gc; + int errorcode; + bool x11error; + + /* TODO: Integrate this with apple_glx_create_context and make + * struct apple_glx_context inherit from struct glx_context. */ + + gc = Xmalloc(sizeof *gc); + if (pcp == NULL) + return NULL; + + memset(gc, 0, sizeof *gc); + if (!glx_context_init(&gc->base, &psc->base, mode)) { + Xfree(gc); + return NULL; + } + + gc->vtable = &applegl_context_vtable; + gc->driContext = NULL; + gc->do_destroy = False; + + /* TODO: darwin: Integrate with above to do indirect */ + if(apple_glx_create_context(&gc->driContext, dpy, screen, fbconfig, + shareList ? shareList->driContext : NULL, + &errorcode, &x11error)) { + __glXSendError(dpy, errorcode, 0, X_GLXCreateContext, x11error); + gc->vtable->destroy(gc); + return NULL; + } + + gc->currentContextTag = -1; + gc->mode = fbconfig; + gc->isDirect = allowDirect; + gc->xid = 1; /* Just something not None, so we know when to destroy + * it in MakeContextCurrent. */ + + return gc; +} + +struct glx_screen_vtable appegl_screen_vtable = { + applegl_create_context +}; + +_X_HIDDEN struct glx_screen * +applegl_create_screen(int screen, struct glx_display * priv) +{ + struct glx_screen *psc; + + psc = Xmalloc(sizeof *psc); + if (psc == NULL) + return NULL; + + memset(psc, 0, sizeof *psc); + glx_screen_init(psc, screen, priv); + psc->vtable = &applegl_screen_vtable; + + return psc; +} + +_X_HIDDEN int +applegl_create_display(struct glx_display *display) +{ + /* create applegl display and stuff in display->appleglDisplay */ + apple_init_glx(display); +} + +#endif diff --git a/src/glx/glxclient.h b/src/glx/glxclient.h index b13cc81b57..84e1742dcb 100644 --- a/src/glx/glxclient.h +++ b/src/glx/glxclient.h @@ -776,10 +776,9 @@ GetGLXDRIDrawable(Display *dpy, GLXDrawable drawable); extern struct glx_screen * indirect_create_screen(int screen, struct glx_display * priv); -extern int -indirect_bind_context(struct glx_context *gc, struct glx_context *old, - GLXDrawable draw, GLXDrawable read); -extern void -indirect_unbind_context(struct glx_context *gc, struct glx_context *new); +extern struct glx_context * +indirect_create_context(struct glx_screen *psc, + struct glx_config *mode, + struct glx_context *shareList, int renderType); #endif /* !__GLX_client_h__ */ diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c index 717108e2fc..7513ebd19e 100644 --- a/src/glx/glxcmds.c +++ b/src/glx/glxcmds.c @@ -58,7 +58,6 @@ static const char __glXGLXClientVendorName[] = "Mesa Project and SGI"; static const char __glXGLXClientVersion[] = "1.4"; -static const struct glx_context_vtable indirect_context_vtable; #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) @@ -229,186 +228,6 @@ ValidateGLXFBConfig(Display * dpy, GLXFBConfig fbconfig) return NULL; } -#ifdef GLX_USE_APPLEGL - -static const struct glx_context_vtable applegl_context_vtable; - -static struct glx_context * -applegl_create_context(struct glx_screen *psc, - struct glx_config *mode, - struct glx_context *shareList, int renderType) -{ - struct glx_context *gc; - int errorcode; - bool x11error; - - /* TODO: Integrate this with apple_glx_create_context and make - * struct apple_glx_context inherit from struct glx_context. */ - - gc = Xmalloc(sizeof *gc); - if (pcp == NULL) - return NULL; - - memset(gc, 0, sizeof *gc); - if (!glx_context_init(&gc->base, &psc->base, mode)) { - Xfree(gc); - return NULL; - } - - gc->vtable = &applegl_context_vtable; - gc->driContext = NULL; - gc->do_destroy = False; - - /* TODO: darwin: Integrate with above to do indirect */ - if(apple_glx_create_context(&gc->driContext, dpy, screen, fbconfig, - shareList ? shareList->driContext : NULL, - &errorcode, &x11error)) { - __glXSendError(dpy, errorcode, 0, X_GLXCreateContext, x11error); - gc->vtable->destroy(gc); - return NULL; - } - - gc->currentContextTag = -1; - gc->mode = fbconfig; - gc->isDirect = allowDirect; - gc->xid = 1; /* Just something not None, so we know when to destroy - * it in MakeContextCurrent. */ - - return gc; -} -#endif - - -/** - * \todo It should be possible to move the allocate of \c client_state_private - * later in the function for direct-rendering contexts. Direct-rendering - * contexts don't need to track client state, so they don't need that memory - * at all. - * - * \todo Eliminate \c __glXInitVertexArrayState. Replace it with a new - * function called \c __glXAllocateClientState that allocates the memory and - * does all the initialization (including the pixel pack / unpack). - */ -static struct glx_context * -indirect_create_context(struct glx_screen *psc, - struct glx_config *mode, - struct glx_context *shareList, int renderType) -{ - struct glx_context *gc; - int bufSize; - CARD8 opcode; - __GLXattribute *state; - - opcode = __glXSetupForCommand(psc->dpy); - if (!opcode) { - return NULL; - } - - /* Allocate our context record */ - gc = Xmalloc(sizeof *gc); - if (!gc) { - /* Out of memory */ - return NULL; - } - memset(gc, 0, sizeof *gc); - - glx_context_init(gc, psc, mode); - gc->isDirect = GL_FALSE; - gc->vtable = &indirect_context_vtable; - state = Xmalloc(sizeof(struct __GLXattributeRec)); - if (state == NULL) { - /* Out of memory */ - Xfree(gc); - return NULL; - } - gc->client_state_private = state; - memset(gc->client_state_private, 0, sizeof(struct __GLXattributeRec)); - state->NoDrawArraysProtocol = (getenv("LIBGL_NO_DRAWARRAYS") != NULL); - - /* - ** Create a temporary buffer to hold GLX rendering commands. The size - ** of the buffer is selected so that the maximum number of GLX rendering - ** commands can fit in a single X packet and still have room in the X - ** packet for the GLXRenderReq header. - */ - - bufSize = (XMaxRequestSize(psc->dpy) * 4) - sz_xGLXRenderReq; - gc->buf = (GLubyte *) Xmalloc(bufSize); - if (!gc->buf) { - Xfree(gc->client_state_private); - Xfree(gc); - return NULL; - } - gc->bufSize = bufSize; - - /* Fill in the new context */ - gc->renderMode = GL_RENDER; - - state->storePack.alignment = 4; - state->storeUnpack.alignment = 4; - - gc->attributes.stackPointer = &gc->attributes.stack[0]; - - /* - ** PERFORMANCE NOTE: A mode dependent fill image can speed things up. - ** Other code uses the fastImageUnpack bit, but it is never set - ** to GL_TRUE. - */ - gc->fastImageUnpack = GL_FALSE; - gc->fillImage = __glFillImage; - gc->pc = gc->buf; - gc->bufEnd = gc->buf + bufSize; - gc->isDirect = GL_FALSE; - if (__glXDebug) { - /* - ** Set limit register so that there will be one command per packet - */ - gc->limit = gc->buf; - } - else { - gc->limit = gc->buf + bufSize - __GLX_BUFFER_LIMIT_SIZE; - } - gc->majorOpcode = opcode; - - /* - ** Constrain the maximum drawing command size allowed to be - ** transfered using the X_GLXRender protocol request. First - ** constrain by a software limit, then constrain by the protocl - ** limit. - */ - if (bufSize > __GLX_RENDER_CMD_SIZE_LIMIT) { - bufSize = __GLX_RENDER_CMD_SIZE_LIMIT; - } - if (bufSize > __GLX_MAX_RENDER_CMD_SIZE) { - bufSize = __GLX_MAX_RENDER_CMD_SIZE; - } - gc->maxSmallRenderCommandSize = bufSize; - - - return gc; -} - -struct glx_screen_vtable indirect_screen_vtable = { - indirect_create_context -}; - -_X_HIDDEN struct glx_screen * -indirect_create_screen(int screen, struct glx_display * priv) -{ - struct glx_screen *psc; - - psc = Xmalloc(sizeof *psc); - if (psc == NULL) - return NULL; - - memset(psc, 0, sizeof *psc); - glx_screen_init(psc, screen, priv); - psc->vtable = &indirect_screen_vtable; - - return psc; -} - - _X_HIDDEN Bool glx_context_init(struct glx_context *gc, struct glx_screen *psc, struct glx_config *config) @@ -576,28 +395,6 @@ glx_send_destroy_context(Display *dpy, XID xid) SyncHandle(); } -static void -indirect_destroy_context(struct glx_context *gc) -{ - if (!gc->imported && gc->xid) - glx_send_destroy_context(gc->psc->dpy, gc->xid); - - __glXFreeVertexArrayState(gc); - - if (gc->vendor) - XFree((char *) gc->vendor); - if (gc->renderer) - XFree((char *) gc->renderer); - if (gc->version) - XFree((char *) gc->version); - if (gc->extensions) - XFree((char *) gc->extensions); - __glFreeAttributeState(gc); - XFree((char *) gc->buf); - Xfree((char *) gc->client_state_private); - XFree((char *) gc); -} - /* ** Destroy the named context */ @@ -673,25 +470,6 @@ glXQueryExtension(Display * dpy, int *errorBase, int *eventBase) return rv; } -static void -indirect_wait_gl(struct glx_context *gc) -{ - xGLXWaitGLReq *req; - Display *dpy = gc->currentDpy; - - /* Flush any pending commands out */ - __glXFlushRenderBuffer(gc, gc->pc); - - /* Send the glXWaitGL request */ - LockDisplay(dpy); - GetReq(GLXWaitGL, req); - req->reqType = gc->majorOpcode; - req->glxCode = X_GLXWaitGL; - req->contextTag = gc->currentContextTag; - UnlockDisplay(dpy); - SyncHandle(); -} - /* ** Put a barrier in the token stream that forces the GL to finish its ** work before X can proceed. @@ -705,24 +483,6 @@ glXWaitGL(void) gc->vtable->wait_gl(gc); } -static void -indirect_wait_x(struct glx_context *gc) -{ - xGLXWaitXReq *req; - Display *dpy = gc->currentDpy; - - /* Flush any pending commands out */ - __glXFlushRenderBuffer(gc, gc->pc); - - LockDisplay(dpy); - GetReq(GLXWaitX, req); - req->reqType = gc->majorOpcode; - req->glxCode = X_GLXWaitX; - req->contextTag = gc->currentContextTag; - UnlockDisplay(dpy); - SyncHandle(); -} - /* ** Put a barrier in the token stream that forces X to finish its ** work before GL can proceed. @@ -736,61 +496,6 @@ glXWaitX(void) gc->vtable->wait_x(gc); } -static void -indirect_use_x_font(struct glx_context *gc, - Font font, int first, int count, int listBase) -{ - xGLXUseXFontReq *req; - Display *dpy = gc->currentDpy; - - /* Flush any pending commands out */ - __glXFlushRenderBuffer(gc, gc->pc); - - /* Send the glXUseFont request */ - LockDisplay(dpy); - GetReq(GLXUseXFont, req); - req->reqType = gc->majorOpcode; - req->glxCode = X_GLXUseXFont; - req->contextTag = gc->currentContextTag; - req->font = font; - req->first = first; - req->count = count; - req->listBase = listBase; - UnlockDisplay(dpy); - SyncHandle(); -} - -#ifdef GLX_USE_APPLEGL - -static void -applegl_destroy_context(struct glx_context *gc) -{ - apple_glx_destroy_context(&gc->driContext, gc->currentDpy); -} - -static void -applegl_wait_gl(struct glx_context *gc) -{ - glFinish(); -} - -static void -applegl_wait_x(struct glx_context *gc) -{ - apple_glx_waitx(gc->dpy, gc->driContext); -} - -static const struct glx_context_vtable applegl_context_vtable = { - applegl_destroy_context, - applegl_wait_gl, - applegl_wait_x, - DRI_glXUseXFont, - NULL, /* bind_tex_image, */ - NULL, /* release_tex_image, */ -}; - -#endif - _X_EXPORT void glXUseXFont(Font font, int first, int count, int listBase) { @@ -2630,104 +2335,6 @@ __glXCopySubBufferMESA(Display * dpy, GLXDrawable drawable, SyncHandle(); } - -/** - * GLX_EXT_texture_from_pixmap - */ -static void -indirect_bind_tex_image(Display * dpy, - GLXDrawable drawable, - int buffer, const int *attrib_list) -{ - xGLXVendorPrivateReq *req; - struct glx_context *gc = __glXGetCurrentContext(); - CARD32 *drawable_ptr; - INT32 *buffer_ptr; - CARD32 *num_attrib_ptr; - CARD32 *attrib_ptr; - CARD8 opcode; - unsigned int i; - - i = 0; - if (attrib_list) { - while (attrib_list[i * 2] != None) - i++; - } - - opcode = __glXSetupForCommand(dpy); - if (!opcode) - return; - - LockDisplay(dpy); - GetReqExtra(GLXVendorPrivate, 12 + 8 * i, req); - req->reqType = opcode; - req->glxCode = X_GLXVendorPrivate; - req->vendorCode = X_GLXvop_BindTexImageEXT; - req->contextTag = gc->currentContextTag; - - drawable_ptr = (CARD32 *) (req + 1); - buffer_ptr = (INT32 *) (drawable_ptr + 1); - num_attrib_ptr = (CARD32 *) (buffer_ptr + 1); - attrib_ptr = (CARD32 *) (num_attrib_ptr + 1); - - *drawable_ptr = drawable; - *buffer_ptr = buffer; - *num_attrib_ptr = (CARD32) i; - - i = 0; - if (attrib_list) { - while (attrib_list[i * 2] != None) { - *attrib_ptr++ = (CARD32) attrib_list[i * 2 + 0]; - *attrib_ptr++ = (CARD32) attrib_list[i * 2 + 1]; - i++; - } - } - - UnlockDisplay(dpy); - SyncHandle(); -} - -static void -indirect_release_tex_image(Display * dpy, GLXDrawable drawable, int buffer) -{ - xGLXVendorPrivateReq *req; - struct glx_context *gc = __glXGetCurrentContext(); - CARD32 *drawable_ptr; - INT32 *buffer_ptr; - CARD8 opcode; - - opcode = __glXSetupForCommand(dpy); - if (!opcode) - return; - - LockDisplay(dpy); - GetReqExtra(GLXVendorPrivate, sizeof(CARD32) + sizeof(INT32), req); - req->reqType = opcode; - req->glxCode = X_GLXVendorPrivate; - req->vendorCode = X_GLXvop_ReleaseTexImageEXT; - req->contextTag = gc->currentContextTag; - - drawable_ptr = (CARD32 *) (req + 1); - buffer_ptr = (INT32 *) (drawable_ptr + 1); - - *drawable_ptr = drawable; - *buffer_ptr = buffer; - - UnlockDisplay(dpy); - SyncHandle(); -} - -static const struct glx_context_vtable indirect_context_vtable = { - indirect_destroy_context, - indirect_bind_context, - indirect_unbind_context, - indirect_wait_gl, - indirect_wait_x, - indirect_use_x_font, - indirect_bind_tex_image, - indirect_release_tex_image, -}; - /*@{*/ static void __glXBindTexImageEXT(Display * dpy, diff --git a/src/glx/glxcurrent.c b/src/glx/glxcurrent.c index 5955860494..0eccc9f765 100644 --- a/src/glx/glxcurrent.c +++ b/src/glx/glxcurrent.c @@ -45,7 +45,6 @@ #include "apple_glx_context.h" #else #include "glapi.h" -#include "indirect_init.h" #endif /* @@ -69,14 +68,6 @@ static struct glx_context dummyContext = { sizeof(dummyBuffer), }; - -#ifndef GLX_USE_APPLEGL -/* -** All indirect rendering contexts will share the same indirect dispatch table. -*/ -static struct _glapi_table *IndirectAPI = NULL; -#endif - /* * Current context management and locking */ @@ -176,9 +167,6 @@ __glXSetCurrentContextNull(void) #endif } - -/************************************************************************/ - _X_EXPORT GLXContext glXGetCurrentContext(void) { @@ -199,90 +187,6 @@ glXGetCurrentDrawable(void) return gc->currentDrawable; } - -#ifndef GLX_USE_APPLEGL -/************************************************************************/ - -/** - * Sends a GLX protocol message to the specified display to make the context - * and the drawables current. - * - * \param dpy Display to send the message to. - * \param opcode Major opcode value for the display. - * \param gc_id Context tag for the context to be made current. - * \param draw Drawable ID for the "draw" drawable. - * \param read Drawable ID for the "read" drawable. - * \param reply Space to store the X-server's reply. - * - * \warning - * This function assumes that \c dpy is locked with \c LockDisplay on entry. - */ -static Bool -SendMakeCurrentRequest(Display * dpy, CARD8 opcode, - GLXContextID gc_id, GLXContextTag gc_tag, - GLXDrawable draw, GLXDrawable read, - xGLXMakeCurrentReply * reply) -{ - Bool ret; - - - LockDisplay(dpy); - - if (draw == read) { - xGLXMakeCurrentReq *req; - - GetReq(GLXMakeCurrent, req); - req->reqType = opcode; - req->glxCode = X_GLXMakeCurrent; - req->drawable = draw; - req->context = gc_id; - req->oldContextTag = gc_tag; - } - else { - struct glx_display *priv = __glXInitialize(dpy); - - /* If the server can support the GLX 1.3 version, we should - * perfer that. Not only that, some servers support GLX 1.3 but - * not the SGI extension. - */ - - if ((priv->majorVersion > 1) || (priv->minorVersion >= 3)) { - xGLXMakeContextCurrentReq *req; - - GetReq(GLXMakeContextCurrent, req); - req->reqType = opcode; - req->glxCode = X_GLXMakeContextCurrent; - req->drawable = draw; - req->readdrawable = read; - req->context = gc_id; - req->oldContextTag = gc_tag; - } - else { - xGLXVendorPrivateWithReplyReq *vpreq; - xGLXMakeCurrentReadSGIReq *req; - - GetReqExtra(GLXVendorPrivateWithReply, - sz_xGLXMakeCurrentReadSGIReq - - sz_xGLXVendorPrivateWithReplyReq, vpreq); - req = (xGLXMakeCurrentReadSGIReq *) vpreq; - req->reqType = opcode; - req->glxCode = X_GLXVendorPrivateWithReply; - req->vendorCode = X_GLXvop_MakeCurrentReadSGI; - req->drawable = draw; - req->readable = read; - req->context = gc_id; - req->oldContextTag = gc_tag; - } - } - - ret = _XReply(dpy, (xReply *) reply, 0, False); - - UnlockDisplay(dpy); - SyncHandle(); - - return ret; -} - static void __glXGenerateError(Display * dpy, struct glx_context *gc, XID resource, BYTE errorCode, CARD16 minorCode) @@ -298,57 +202,6 @@ __glXGenerateError(Display * dpy, struct glx_context *gc, XID resource, _XError(dpy, &error); } -#endif /* GLX_USE_APPLEGL */ - -_X_HIDDEN int -indirect_bind_context(struct glx_context *gc, struct glx_context *old, - GLXDrawable draw, GLXDrawable read) -{ - xGLXMakeCurrentReply reply; - GLXContextTag tag; - __GLXattribute *state; - Display *dpy = gc->psc->dpy; - int opcode = __glXSetupForCommand(dpy); - - if (old && !old->isDirect && old->psc->dpy == dpy) - tag = old->currentContextTag; - else - tag = None; - - SendMakeCurrentRequest(dpy, opcode, gc->xid, tag, draw, read, &reply); - - if (!IndirectAPI) - IndirectAPI = __glXNewIndirectAPI(); - _glapi_set_dispatch(IndirectAPI); - - gc->currentContextTag = reply.contextTag; - state = gc->client_state_private; - if (state->array_state == NULL) { - glGetString(GL_EXTENSIONS); - glGetString(GL_VERSION); - __glXInitVertexArrayState(gc); - } - - return Success; -} - -_X_HIDDEN void -indirect_unbind_context(struct glx_context *gc, struct glx_context *new) -{ - Display *dpy = gc->psc->dpy; - int opcode = __glXSetupForCommand(dpy); - xGLXMakeCurrentReply reply; - - /* We are either switching to no context, away from a indirect - * context to a direct context or from one dpy to another and have - * to send a request to the dpy to unbind the previous context. - */ - if (!new || new->isDirect || new->psc->dpy != dpy) - SendMakeCurrentRequest(dpy, opcode, None, - gc->currentContextTag, None, None, &reply); - gc->currentContextTag = 0; -} - /** * Make a particular context current. * diff --git a/src/glx/glxext.c b/src/glx/glxext.c index e48c4c289c..c227215d32 100644 --- a/src/glx/glxext.c +++ b/src/glx/glxext.c @@ -771,6 +771,10 @@ AllocAndFetchScreenConfigs(Display * dpy, struct glx_display * priv) psc = (*priv->driDisplay->createScreen) (i, priv); if (psc == NULL && priv->driswDisplay) psc = (*priv->driswDisplay->createScreen) (i, priv); +#endif +#if defined(GLX_USE_APPLEGL) + if (psc == NULL && priv->appleglDisplay) + psc = (*priv->appleglDisplay->createScreen) (i, priv); #endif if (psc == NULL) psc = indirect_create_screen(i, priv); @@ -853,7 +857,7 @@ __glXInitialize(Display * dpy) #endif #ifdef GLX_USE_APPLEGL - if (apple_init_glx(dpy)) { + if (!applegl_create_display(dpyPriv)) { Xfree(dpyPriv); return NULL; } diff --git a/src/glx/indirect_glx.c b/src/glx/indirect_glx.c new file mode 100644 index 0000000000..cbc3129a5b --- /dev/null +++ b/src/glx/indirect_glx.c @@ -0,0 +1,456 @@ +/* + * Copyright © 2010 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Soft- + * ware"), to deal in the Software without restriction, including without + * limitation the rights to use, copy, modify, merge, publish, distribute, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, provided that the above copyright + * notice(s) and this permission notice appear in all copies of the Soft- + * ware and that both the above copyright notice(s) and this permission + * notice appear in supporting documentation. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- + * ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY + * RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN + * THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSE- + * QUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFOR- + * MANCE OF THIS SOFTWARE. + * + * Except as contained in this notice, the name of a copyright holder shall + * not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization of + * the copyright holder. + * + * Authors: + * Kristian Høgsberg (krh@bitplanet.net) + */ + +#include "glapi.h" +#include "glxclient.h" + +extern struct _glapi_table *__glXNewIndirectAPI(void); + +/* +** All indirect rendering contexts will share the same indirect dispatch table. +*/ +static struct _glapi_table *IndirectAPI = NULL; + +static void +indirect_destroy_context(struct glx_context *gc) +{ + if (!gc->imported && gc->xid) + glx_send_destroy_context(gc->psc->dpy, gc->xid); + + __glXFreeVertexArrayState(gc); + + if (gc->vendor) + XFree((char *) gc->vendor); + if (gc->renderer) + XFree((char *) gc->renderer); + if (gc->version) + XFree((char *) gc->version); + if (gc->extensions) + XFree((char *) gc->extensions); + __glFreeAttributeState(gc); + XFree((char *) gc->buf); + Xfree((char *) gc->client_state_private); + XFree((char *) gc); +} + +static Bool +SendMakeCurrentRequest(Display * dpy, CARD8 opcode, + GLXContextID gc_id, GLXContextTag gc_tag, + GLXDrawable draw, GLXDrawable read, + xGLXMakeCurrentReply * reply) +{ + Bool ret; + + LockDisplay(dpy); + + if (draw == read) { + xGLXMakeCurrentReq *req; + + GetReq(GLXMakeCurrent, req); + req->reqType = opcode; + req->glxCode = X_GLXMakeCurrent; + req->drawable = draw; + req->context = gc_id; + req->oldContextTag = gc_tag; + } + else { + struct glx_display *priv = __glXInitialize(dpy); + + /* If the server can support the GLX 1.3 version, we should + * perfer that. Not only that, some servers support GLX 1.3 but + * not the SGI extension. + */ + + if ((priv->majorVersion > 1) || (priv->minorVersion >= 3)) { + xGLXMakeContextCurrentReq *req; + + GetReq(GLXMakeContextCurrent, req); + req->reqType = opcode; + req->glxCode = X_GLXMakeContextCurrent; + req->drawable = draw; + req->readdrawable = read; + req->context = gc_id; + req->oldContextTag = gc_tag; + } + else { + xGLXVendorPrivateWithReplyReq *vpreq; + xGLXMakeCurrentReadSGIReq *req; + + GetReqExtra(GLXVendorPrivateWithReply, + sz_xGLXMakeCurrentReadSGIReq - + sz_xGLXVendorPrivateWithReplyReq, vpreq); + req = (xGLXMakeCurrentReadSGIReq *) vpreq; + req->reqType = opcode; + req->glxCode = X_GLXVendorPrivateWithReply; + req->vendorCode = X_GLXvop_MakeCurrentReadSGI; + req->drawable = draw; + req->readable = read; + req->context = gc_id; + req->oldContextTag = gc_tag; + } + } + + ret = _XReply(dpy, (xReply *) reply, 0, False); + + UnlockDisplay(dpy); + SyncHandle(); + + return ret; +} + +static int +indirect_bind_context(struct glx_context *gc, struct glx_context *old, + GLXDrawable draw, GLXDrawable read) +{ + xGLXMakeCurrentReply reply; + GLXContextTag tag; + __GLXattribute *state; + Display *dpy = gc->psc->dpy; + int opcode = __glXSetupForCommand(dpy); + + if (old && !old->isDirect && old->psc->dpy == dpy) + tag = old->currentContextTag; + else + tag = None; + + SendMakeCurrentRequest(dpy, opcode, gc->xid, tag, draw, read, &reply); + + if (!IndirectAPI) + IndirectAPI = __glXNewIndirectAPI(); + _glapi_set_dispatch(IndirectAPI); + + gc->currentContextTag = reply.contextTag; + state = gc->client_state_private; + if (state->array_state == NULL) { + glGetString(GL_EXTENSIONS); + glGetString(GL_VERSION); + __glXInitVertexArrayState(gc); + } + + return Success; +} + +static void +indirect_unbind_context(struct glx_context *gc, struct glx_context *new) +{ + Display *dpy = gc->psc->dpy; + int opcode = __glXSetupForCommand(dpy); + xGLXMakeCurrentReply reply; + + /* We are either switching to no context, away from a indirect + * context to a direct context or from one dpy to another and have + * to send a request to the dpy to unbind the previous context. + */ + if (!new || new->isDirect || new->psc->dpy != dpy) + SendMakeCurrentRequest(dpy, opcode, None, + gc->currentContextTag, None, None, &reply); + gc->currentContextTag = 0; +} + +static void +indirect_wait_gl(struct glx_context *gc) +{ + xGLXWaitGLReq *req; + Display *dpy = gc->currentDpy; + + /* Flush any pending commands out */ + __glXFlushRenderBuffer(gc, gc->pc); + + /* Send the glXWaitGL request */ + LockDisplay(dpy); + GetReq(GLXWaitGL, req); + req->reqType = gc->majorOpcode; + req->glxCode = X_GLXWaitGL; + req->contextTag = gc->currentContextTag; + UnlockDisplay(dpy); + SyncHandle(); +} + +static void +indirect_wait_x(struct glx_context *gc) +{ + xGLXWaitXReq *req; + Display *dpy = gc->currentDpy; + + /* Flush any pending commands out */ + __glXFlushRenderBuffer(gc, gc->pc); + + LockDisplay(dpy); + GetReq(GLXWaitX, req); + req->reqType = gc->majorOpcode; + req->glxCode = X_GLXWaitX; + req->contextTag = gc->currentContextTag; + UnlockDisplay(dpy); + SyncHandle(); +} + +static void +indirect_use_x_font(struct glx_context *gc, + Font font, int first, int count, int listBase) +{ + xGLXUseXFontReq *req; + Display *dpy = gc->currentDpy; + + /* Flush any pending commands out */ + __glXFlushRenderBuffer(gc, gc->pc); + + /* Send the glXUseFont request */ + LockDisplay(dpy); + GetReq(GLXUseXFont, req); + req->reqType = gc->majorOpcode; + req->glxCode = X_GLXUseXFont; + req->contextTag = gc->currentContextTag; + req->font = font; + req->first = first; + req->count = count; + req->listBase = listBase; + UnlockDisplay(dpy); + SyncHandle(); +} + +static void +indirect_bind_tex_image(Display * dpy, + GLXDrawable drawable, + int buffer, const int *attrib_list) +{ + xGLXVendorPrivateReq *req; + struct glx_context *gc = __glXGetCurrentContext(); + CARD32 *drawable_ptr; + INT32 *buffer_ptr; + CARD32 *num_attrib_ptr; + CARD32 *attrib_ptr; + CARD8 opcode; + unsigned int i; + + i = 0; + if (attrib_list) { + while (attrib_list[i * 2] != None) + i++; + } + + opcode = __glXSetupForCommand(dpy); + if (!opcode) + return; + + LockDisplay(dpy); + GetReqExtra(GLXVendorPrivate, 12 + 8 * i, req); + req->reqType = opcode; + req->glxCode = X_GLXVendorPrivate; + req->vendorCode = X_GLXvop_BindTexImageEXT; + req->contextTag = gc->currentContextTag; + + drawable_ptr = (CARD32 *) (req + 1); + buffer_ptr = (INT32 *) (drawable_ptr + 1); + num_attrib_ptr = (CARD32 *) (buffer_ptr + 1); + attrib_ptr = (CARD32 *) (num_attrib_ptr + 1); + + *drawable_ptr = drawable; + *buffer_ptr = buffer; + *num_attrib_ptr = (CARD32) i; + + i = 0; + if (attrib_list) { + while (attrib_list[i * 2] != None) { + *attrib_ptr++ = (CARD32) attrib_list[i * 2 + 0]; + *attrib_ptr++ = (CARD32) attrib_list[i * 2 + 1]; + i++; + } + } + + UnlockDisplay(dpy); + SyncHandle(); +} + +static void +indirect_release_tex_image(Display * dpy, GLXDrawable drawable, int buffer) +{ + xGLXVendorPrivateReq *req; + struct glx_context *gc = __glXGetCurrentContext(); + CARD32 *drawable_ptr; + INT32 *buffer_ptr; + CARD8 opcode; + + opcode = __glXSetupForCommand(dpy); + if (!opcode) + return; + + LockDisplay(dpy); + GetReqExtra(GLXVendorPrivate, sizeof(CARD32) + sizeof(INT32), req); + req->reqType = opcode; + req->glxCode = X_GLXVendorPrivate; + req->vendorCode = X_GLXvop_ReleaseTexImageEXT; + req->contextTag = gc->currentContextTag; + + drawable_ptr = (CARD32 *) (req + 1); + buffer_ptr = (INT32 *) (drawable_ptr + 1); + + *drawable_ptr = drawable; + *buffer_ptr = buffer; + + UnlockDisplay(dpy); + SyncHandle(); +} + +static const struct glx_context_vtable indirect_context_vtable = { + indirect_destroy_context, + indirect_bind_context, + indirect_unbind_context, + indirect_wait_gl, + indirect_wait_x, + indirect_use_x_font, + indirect_bind_tex_image, + indirect_release_tex_image, +}; + +/** + * \todo Eliminate \c __glXInitVertexArrayState. Replace it with a new + * function called \c __glXAllocateClientState that allocates the memory and + * does all the initialization (including the pixel pack / unpack). + */ +_X_HIDDEN struct glx_context * +indirect_create_context(struct glx_screen *psc, + struct glx_config *mode, + struct glx_context *shareList, int renderType) +{ + struct glx_context *gc; + int bufSize; + CARD8 opcode; + __GLXattribute *state; + + opcode = __glXSetupForCommand(psc->dpy); + if (!opcode) { + return NULL; + } + + /* Allocate our context record */ + gc = Xmalloc(sizeof *gc); + if (!gc) { + /* Out of memory */ + return NULL; + } + memset(gc, 0, sizeof *gc); + + glx_context_init(gc, psc, mode); + gc->isDirect = GL_FALSE; + gc->vtable = &indirect_context_vtable; + state = Xmalloc(sizeof(struct __GLXattributeRec)); + if (state == NULL) { + /* Out of memory */ + Xfree(gc); + return NULL; + } + gc->client_state_private = state; + memset(gc->client_state_private, 0, sizeof(struct __GLXattributeRec)); + state->NoDrawArraysProtocol = (getenv("LIBGL_NO_DRAWARRAYS") != NULL); + + /* + ** Create a temporary buffer to hold GLX rendering commands. The size + ** of the buffer is selected so that the maximum number of GLX rendering + ** commands can fit in a single X packet and still have room in the X + ** packet for the GLXRenderReq header. + */ + + bufSize = (XMaxRequestSize(psc->dpy) * 4) - sz_xGLXRenderReq; + gc->buf = (GLubyte *) Xmalloc(bufSize); + if (!gc->buf) { + Xfree(gc->client_state_private); + Xfree(gc); + return NULL; + } + gc->bufSize = bufSize; + + /* Fill in the new context */ + gc->renderMode = GL_RENDER; + + state->storePack.alignment = 4; + state->storeUnpack.alignment = 4; + + gc->attributes.stackPointer = &gc->attributes.stack[0]; + + /* + ** PERFORMANCE NOTE: A mode dependent fill image can speed things up. + ** Other code uses the fastImageUnpack bit, but it is never set + ** to GL_TRUE. + */ + gc->fastImageUnpack = GL_FALSE; + gc->fillImage = __glFillImage; + gc->pc = gc->buf; + gc->bufEnd = gc->buf + bufSize; + gc->isDirect = GL_FALSE; + if (__glXDebug) { + /* + ** Set limit register so that there will be one command per packet + */ + gc->limit = gc->buf; + } + else { + gc->limit = gc->buf + bufSize - __GLX_BUFFER_LIMIT_SIZE; + } + gc->majorOpcode = opcode; + + /* + ** Constrain the maximum drawing command size allowed to be + ** transfered using the X_GLXRender protocol request. First + ** constrain by a software limit, then constrain by the protocl + ** limit. + */ + if (bufSize > __GLX_RENDER_CMD_SIZE_LIMIT) { + bufSize = __GLX_RENDER_CMD_SIZE_LIMIT; + } + if (bufSize > __GLX_MAX_RENDER_CMD_SIZE) { + bufSize = __GLX_MAX_RENDER_CMD_SIZE; + } + gc->maxSmallRenderCommandSize = bufSize; + + + return gc; +} + +struct glx_screen_vtable indirect_screen_vtable = { + indirect_create_context +}; + +_X_HIDDEN struct glx_screen * +indirect_create_screen(int screen, struct glx_display * priv) +{ + struct glx_screen *psc; + + psc = Xmalloc(sizeof *psc); + if (psc == NULL) + return NULL; + + memset(psc, 0, sizeof *psc); + glx_screen_init(psc, screen, priv); + psc->vtable = &indirect_screen_vtable; + + return psc; +} -- cgit v1.2.3 From cd601513f5ff4f488a6f6527bb033e39ee62ffda Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Thu, 29 Jul 2010 16:01:39 -0400 Subject: glx: Fix linked list deletion in __glXCloseDisplay() I hate single linked lists. --- src/glx/glxext.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/glx') diff --git a/src/glx/glxext.c b/src/glx/glxext.c index c227215d32..22fb61ac21 100644 --- a/src/glx/glxext.c +++ b/src/glx/glxext.c @@ -246,7 +246,7 @@ __glXCloseDisplay(Display * dpy, XExtCodes * codes) prev = &glx_displays; for (priv = glx_displays; priv; prev = &priv->next, priv = priv->next) { if (priv->dpy == dpy) { - (*prev)->next = priv->next; + (*prev) = priv->next; break; } } -- cgit v1.2.3 From f485ee724d1f1bb57a5c8931f28e7a45ceb5b5d5 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Thu, 29 Jul 2010 18:44:26 -0400 Subject: glx: Compare old ctx against dummyCtx, not NULL https://bugs.freedesktop.org/show_bug.cgi?id=29302 --- src/glx/glxclient.h | 2 ++ src/glx/glxcurrent.c | 2 +- src/glx/indirect_glx.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src/glx') diff --git a/src/glx/glxclient.h b/src/glx/glxclient.h index 84e1742dcb..81c9a26669 100644 --- a/src/glx/glxclient.h +++ b/src/glx/glxclient.h @@ -774,6 +774,8 @@ GetGLXDRIDrawable(Display *dpy, GLXDrawable drawable); #endif +extern struct glx_context dummyContext; + extern struct glx_screen * indirect_create_screen(int screen, struct glx_display * priv); extern struct glx_context * diff --git a/src/glx/glxcurrent.c b/src/glx/glxcurrent.c index 0eccc9f765..e2569974c2 100644 --- a/src/glx/glxcurrent.c +++ b/src/glx/glxcurrent.c @@ -60,7 +60,7 @@ static GLubyte dummyBuffer[__GLX_BUFFER_LIMIT_SIZE]; ** gl and glx entry points are designed to operate as nop's when using ** the dummy context structure. */ -static struct glx_context dummyContext = { +struct glx_context dummyContext = { &dummyBuffer[0], &dummyBuffer[0], &dummyBuffer[0], diff --git a/src/glx/indirect_glx.c b/src/glx/indirect_glx.c index cbc3129a5b..f0598409cd 100644 --- a/src/glx/indirect_glx.c +++ b/src/glx/indirect_glx.c @@ -137,7 +137,7 @@ indirect_bind_context(struct glx_context *gc, struct glx_context *old, Display *dpy = gc->psc->dpy; int opcode = __glXSetupForCommand(dpy); - if (old && !old->isDirect && old->psc->dpy == dpy) + if (old != &dummyContext && !old->isDirect && old->psc->dpy == dpy) tag = old->currentContextTag; else tag = None; -- cgit v1.2.3 From e3e25dee2019b2c75acadeaf4358cd9a8d93db0b Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Thu, 29 Jul 2010 18:48:51 -0400 Subject: glx: Fix copy/paste bug in glXWaitX and glXWaitGL https://bugs.freedesktop.org/show_bug.cgi?id=29304 --- src/glx/glxcmds.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/glx') diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c index 7513ebd19e..d4aa8b5866 100644 --- a/src/glx/glxcmds.c +++ b/src/glx/glxcmds.c @@ -479,7 +479,7 @@ glXWaitGL(void) { struct glx_context *gc = __glXGetCurrentContext(); - if (gc && gc->vtable->use_x_font) + if (gc && gc->vtable->wait_gl) gc->vtable->wait_gl(gc); } @@ -492,7 +492,7 @@ glXWaitX(void) { struct glx_context *gc = __glXGetCurrentContext(); - if (gc && gc->vtable->use_x_font) + if (gc && gc->vtable->wait_x) gc->vtable->wait_x(gc); } -- cgit v1.2.3 From 1f1928db001527c3dcf1d78d6a5d2ef8f519327b Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Mon, 2 Aug 2010 09:47:44 -0400 Subject: glx: Drop _Xglobal_lock while we create and initialize glx display --- src/glx/glxext.c | 60 ++++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 39 insertions(+), 21 deletions(-) (limited to 'src/glx') diff --git a/src/glx/glxext.c b/src/glx/glxext.c index 22fb61ac21..9e42d83c4d 100644 --- a/src/glx/glxext.c +++ b/src/glx/glxext.c @@ -197,7 +197,7 @@ __glXEventToWire(Display *dpy, XEvent *event, xEvent *wire) ** __glXScreenConfigs. */ static void - FreeScreenConfigs(struct glx_display * priv) +FreeScreenConfigs(struct glx_display * priv) { struct glx_screen *psc; GLint i, screens; @@ -232,28 +232,13 @@ static void priv->screens = NULL; } -/* -** Release the private memory referred to in a display private -** structure. The caller will free the extension structure. -*/ -static int -__glXCloseDisplay(Display * dpy, XExtCodes * codes) +static void +glx_display_free(struct glx_display *priv) { - struct glx_display *priv, **prev; - struct glx_context *gc; - - _XLockMutex(_Xglobal_lock); - prev = &glx_displays; - for (priv = glx_displays; priv; prev = &priv->next, priv = priv->next) { - if (priv->dpy == dpy) { - (*prev) = priv->next; - break; - } - } - _XUnlockMutex(_Xglobal_lock); + struct glx_context *gc; gc = __glXGetCurrentContext(); - if (dpy == gc->currentDpy) { + if (priv->dpy == gc->currentDpy) { gc->vtable->destroy(gc); __glXSetCurrentContextNull(); } @@ -282,6 +267,24 @@ __glXCloseDisplay(Display * dpy, XExtCodes * codes) #endif Xfree((char *) priv); +} + +static int +__glXCloseDisplay(Display * dpy, XExtCodes * codes) +{ + struct glx_display *priv, **prev; + + _XLockMutex(_Xglobal_lock); + prev = &glx_displays; + for (priv = glx_displays; priv; prev = &priv->next, priv = priv->next) { + if (priv->dpy == dpy) { + (*prev) = priv->next; + break; + } + } + _XUnlockMutex(_Xglobal_lock); + + glx_display_free(priv); return 1; } @@ -790,7 +793,7 @@ AllocAndFetchScreenConfigs(Display * dpy, struct glx_display * priv) _X_HIDDEN struct glx_display * __glXInitialize(Display * dpy) { - struct glx_display *dpyPriv; + struct glx_display *dpyPriv, *d; #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) Bool glx_direct, glx_accel; #endif @@ -805,6 +808,9 @@ __glXInitialize(Display * dpy) } } + /* Drop the lock while we create the display private. */ + _XUnlockMutex(_Xglobal_lock); + dpyPriv = Xcalloc(1, sizeof *dpyPriv); if (!dpyPriv) return NULL; @@ -870,6 +876,18 @@ __glXInitialize(Display * dpy) if (dpyPriv->majorVersion == 1 && dpyPriv->minorVersion >= 1) __glXClientInfo(dpy, dpyPriv->majorOpcode); + /* Grab the lock again and add the dispay private, unless somebody + * beat us to initializing on this display in the meantime. */ + _XLockMutex(_Xglobal_lock); + + for (d = glx_displays; d; d = d->next) { + if (d->dpy == dpy) { + _XUnlockMutex(_Xglobal_lock); + glx_display_free(dpyPriv); + return d; + } + } + dpyPriv->next = glx_displays; glx_displays = dpyPriv; -- cgit v1.2.3 From 9da1c9da139327132dea57b18048a4eb386b6bad Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Wed, 4 Aug 2010 08:43:08 -0400 Subject: glx: dri2InvalidateBuffers() needs the X drawable XID not the GLX one This never ceases to entertain. --- src/glx/dri2_glx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/glx') diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c index e57d10f091..99384f8c37 100644 --- a/src/glx/dri2_glx.c +++ b/src/glx/dri2_glx.c @@ -439,7 +439,7 @@ dri2FlushFrontBuffer(__DRIdrawable *driDrawable, void *loaderPrivate) /* Old servers don't send invalidate events */ if (!pdp->invalidateAvailable) - dri2InvalidateBuffers(priv->dpy, pdraw->base.drawable); + dri2InvalidateBuffers(priv->dpy, pdraw->base.xDrawable); dri2_wait_gl(gc); } @@ -507,7 +507,7 @@ dri2SwapBuffers(__GLXDRIdrawable *pdraw, int64_t target_msc, int64_t divisor, /* Old servers don't send invalidate events */ if (!pdp->invalidateAvailable) - dri2InvalidateBuffers(dpyPriv->dpy, pdraw->drawable); + dri2InvalidateBuffers(dpyPriv->dpy, pdraw->xDrawable); /* Old servers can't handle swapbuffers */ if (!pdp->swapAvailable) { -- cgit v1.2.3 From e71c44cedd6d22930bf873504d89faf68d93e1cc Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Wed, 4 Aug 2010 08:51:43 -0400 Subject: glx: We no longer need screen extensions for drisw https://bugs.freedesktop.org/show_bug.cgi?id=29177 --- src/glx/drisw_glx.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/glx') diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c index 46c56066e6..66a60430e8 100644 --- a/src/glx/drisw_glx.c +++ b/src/glx/drisw_glx.c @@ -485,8 +485,6 @@ driCreateScreen(int screen, struct glx_display *priv) goto handle_error; } - extensions = psc->core->getExtensions(psc->driScreen); - psc->base.configs = driConvertConfigs(psc->core, psc->base.configs, driver_configs); psc->base.visuals = -- cgit v1.2.3 From e3a0e468bc67e4169406bb4c96b5ab483dc48a28 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Wed, 4 Aug 2010 08:57:02 -0400 Subject: glx: Fix use after free in drisw error path --- src/glx/drisw_glx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/glx') diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c index 66a60430e8..c5b179157b 100644 --- a/src/glx/drisw_glx.c +++ b/src/glx/drisw_glx.c @@ -502,10 +502,9 @@ driCreateScreen(int screen, struct glx_display *priv) return &psc->base; handle_error: - Xfree(psc); - if (psc->driver) dlclose(psc->driver); + Xfree(psc); ErrorMessageF("reverting to indirect rendering\n"); -- cgit v1.2.3 From 2542d8e0c2ec3eb4de266c0b2ad93dba918cb89c Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Wed, 4 Aug 2010 12:50:36 -0400 Subject: glx: Move deref after NULL check --- src/glx/dri2_glx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/glx') diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c index 99384f8c37..ff48c79c27 100644 --- a/src/glx/dri2_glx.c +++ b/src/glx/dri2_glx.c @@ -657,9 +657,10 @@ dri2_bind_tex_image(Display * dpy, struct dri2_drawable *pdraw = (struct dri2_drawable *) base; struct dri2_display *pdp = (struct dri2_display *) dpyPriv->dri2Display; - struct dri2_screen *psc = (struct dri2_screen *) base->psc; + struct dri2_screen *psc; if (pdraw != NULL) { + psc = (struct dri2_screen *) base->psc; #if __DRI2_FLUSH_VERSION >= 3 if (!pdp->invalidateAvailable && psc->f) -- cgit v1.2.3