glx: no graphics context during initialization

This commit is contained in:
RALOVICH, Kristóf 2008-11-04 11:31:53 +01:00 committed by Brian Paul
parent 9c7aaa7afb
commit 6d1d157606
5 changed files with 15 additions and 11 deletions

View File

@ -44,6 +44,7 @@
*/
char *
__glXQueryServerString(Display* dpy,
int opcode,
CARD32 screen,
CARD32 name)
{
@ -70,6 +71,7 @@ __glXQueryServerString(Display* dpy,
*/
char *
__glXGetString(Display* dpy,
int opcode,
CARD32 contextTag,
CARD32 name)
{
@ -166,22 +168,22 @@ __glXGetStringFromServer(Display * dpy, int opcode, CARD32 glxCode,
char *
__glXQueryServerString(Display* dpy,
int opcode,
CARD32 screen,
CARD32 name)
{
GLXContext gc = __glXGetCurrentContext();
return __glXGetStringFromServer(dpy, gc->majorOpcode,
return __glXGetStringFromServer(dpy, opcode,
X_GLXQueryServerString,
screen, name);
}
char *
__glXGetString(Display* dpy,
int opcode,
CARD32 contextTag,
CARD32 name)
{
GLXContext gc = __glXGetCurrentContext();
return __glXGetStringFromServer(dpy, gc->majorOpcode, X_GLsop_GetString,
return __glXGetStringFromServer(dpy, opcode, X_GLsop_GetString,
contextTag, name);
}

View File

@ -739,8 +739,10 @@ extern void _XSend(Display*, const void*, long);
extern void __glXInitializeVisualConfigFromTags( __GLcontextModes *config,
int count, const INT32 *bp, Bool tagged_only, Bool fbconfig_style_tags );
extern char * __glXQueryServerString(Display* dpy, CARD32 screen, CARD32 name);
extern char * __glXGetString(Display* dpy, CARD32 screen, CARD32 name);
extern char * __glXQueryServerString(Display* dpy, int opcode,
CARD32 screen, CARD32 name);
extern char * __glXGetString(Display* dpy, int opcode,
CARD32 screen, CARD32 name);
extern char *__glXstrdup(const char *str);

View File

@ -1336,7 +1336,7 @@ PUBLIC const char *glXQueryExtensionsString( Display *dpy, int screen )
if (!psc->effectiveGLXexts) {
if (!psc->serverGLXexts) {
psc->serverGLXexts =
__glXQueryServerString(dpy, screen, GLX_EXTENSIONS);
__glXQueryServerString(dpy, priv->majorOpcode, screen, GLX_EXTENSIONS);
}
__glXCalculateUsableExtensions(psc,
@ -1391,7 +1391,7 @@ PUBLIC const char *glXQueryServerString( Display *dpy, int screen, int name )
}
if ( *str == NULL ) {
*str = __glXQueryServerString(dpy, screen, name);
*str = __glXQueryServerString(dpy, priv->majorOpcode, screen, name);
}
return *str;

View File

@ -550,7 +550,7 @@ getFBConfigs(Display * dpy, __GLXdisplayPrivate * priv, int screen)
__GLXscreenConfigs *psc;
psc = priv->screenConfigs + screen;
psc->serverGLXexts = __glXQueryServerString(dpy, screen, GLX_EXTENSIONS);
psc->serverGLXexts = __glXQueryServerString(dpy, priv->majorOpcode, screen, GLX_EXTENSIONS);
LockDisplay(dpy);
@ -608,7 +608,7 @@ AllocAndFetchScreenConfigs(Display * dpy, __GLXdisplayPrivate * priv)
memset(psc, 0, screens * sizeof(__GLXscreenConfigs));
priv->screenConfigs = psc;
priv->serverGLXversion = __glXQueryServerString(dpy, 0, GLX_VERSION);
priv->serverGLXversion = __glXQueryServerString(dpy, priv->majorOpcode, 0, GLX_VERSION);
if (priv->serverGLXversion == NULL) {
FreeScreenConfigs(priv);
return GL_FALSE;

View File

@ -679,7 +679,7 @@ __indirect_glGetString(GLenum name)
*/
(void) __glXFlushRenderBuffer(gc, gc->pc);
s = (GLubyte *) __glXGetString(dpy, gc->currentContextTag, name);
s = (GLubyte *) __glXGetString(dpy, gc->majorOpcode, gc->currentContextTag, name);
if (!s) {
/* Throw data on the floor */
__glXSetError(gc, GL_OUT_OF_MEMORY);