From 64034c4fb5c56f63d37faa6f64f3183ca106856a Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Fri, 13 May 2005 11:56:13 +0000 Subject: Remove MAX_VISUAL limitations of 100. If running dual head this can be easily consumed. There are no limitations now and the VisualTable is realloced when necessary. --- src/mesa/drivers/x11/fakeglx.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index 971ca0b55b..3784044bf9 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -105,8 +105,7 @@ struct fake_glx_context { #define DONT_CARE -1 -#define MAX_VISUALS 100 -static XMesaVisual VisualTable[MAX_VISUALS]; +static XMesaVisual *VisualTable = NULL; static int NumVisuals = 0; @@ -331,11 +330,6 @@ save_glx_visual( Display *dpy, XVisualInfo *vinfo, /* Create a new visual and add it to the list. */ - if (NumVisuals >= MAX_VISUALS) { - _mesa_problem(NULL, "GLX Error: maximum number of visuals exceeded"); - return NULL; - } - xmvis = XMesaCreateVisual( dpy, vinfo, rgbFlag, alphaFlag, dbFlag, stereoFlag, ximageFlag, depth_size, stencil_size, @@ -347,6 +341,10 @@ save_glx_visual( Display *dpy, XVisualInfo *vinfo, * if we need to search for it in find_glx_visual(). */ xmvis->vishandle = vinfo; + /* Allocate more space for additional visual */ + VisualTable = _mesa_realloc( VisualTable, + sizeof(XMesaVisual) * NumVisuals, + sizeof(XMesaVisual) * NumVisuals + 1); /* add xmvis to the list */ VisualTable[NumVisuals] = xmvis; NumVisuals++; -- cgit v1.2.3