summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/x11/xfonts.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2000-08-13 03:44:08 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2000-08-13 03:44:08 +0000
commit094e2f1a67b522cc9e8d20add86d31b055e4a9e6 (patch)
tree3e5ab1cc24c116c50e9e6535fd9d30943dd67914 /src/mesa/drivers/x11/xfonts.c
parent7aac6d6b8eea3fe364da0fff0904fdc668fa56ae (diff)
fixed segfault problem when using MESA_GLX_FX
Diffstat (limited to 'src/mesa/drivers/x11/xfonts.c')
-rw-r--r--src/mesa/drivers/x11/xfonts.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/mesa/drivers/x11/xfonts.c b/src/mesa/drivers/x11/xfonts.c
index 0daaa9443f..2dcd2690a0 100644
--- a/src/mesa/drivers/x11/xfonts.c
+++ b/src/mesa/drivers/x11/xfonts.c
@@ -1,4 +1,4 @@
-/* $Id: xfonts.c,v 1.6 2000/04/19 01:44:02 brianp Exp $ */
+/* $Id: xfonts.c,v 1.7 2000/08/13 03:44:08 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -231,26 +231,23 @@ void Fake_glXUseXFont( Font font, int first, int count, int listbase )
XGCValues values;
unsigned long valuemask;
XFontStruct *fs;
-
GLint swapbytes, lsbfirst, rowlength;
GLint skiprows, skippixels, alignment;
-
unsigned int max_width, max_height, max_bm_width, max_bm_height;
GLubyte *bm;
-
int i;
- CC = XMesaGetCurrentContext();
- dpy = CC->display;
- win = CC->xm_buffer->frontbuffer;
+ dpy = glXGetCurrentDisplay();
+ if (!dpy)
+ return; /* I guess glXMakeCurrent wasn't called */
+ win = RootWindow(dpy, DefaultScreen(dpy));
fs = XQueryFont (dpy, font);
- if (!fs)
- {
+ if (!fs) {
gl_error (CC->gl_ctx, GL_INVALID_VALUE,
"Couldn't get font structure information");
return;
- }
+ }
/* Allocate a bitmap that can fit all characters. */
max_width = fs->max_bounds.rbearing - fs->min_bounds.lbearing;
@@ -265,7 +262,7 @@ void Fake_glXUseXFont( Font font, int first, int count, int listbase )
gl_error (CC->gl_ctx, GL_OUT_OF_MEMORY,
"Couldn't allocate bitmap in glXUseXFont()");
return;
- }
+ }
#if 0
/* get the page info */