minor patch for the opengl-system
Christoph Frick
frick at SC-Networks.de
Sun Apr 7 16:41:29 CDT 2002
Hi!
I reached the limit of the MAX_PIXELFORMATS ("Maximum number of visuals
reached !") within the game "Grand Prix Legends" using OpenGL for
visualisation. I applied a quick hack to deal with this. I also activated the
code to support the stencil buffer within games. I tested this with
JediKnight2 (shadows now work in mode 2/3). This are just quick hacks that
wokr for me - i not really into X11 programming, so i do not know, if the way
i handle the stuff is correct. I works fine for me on Nvidia 28.80 drivers
under linux 2.4.18.
Thanks BTW for your great work!
CU!
-------------- next part --------------
? patch.diff
? graphics/x11drv/patch.diff
Index: graphics/x11drv/opengl.c
===================================================================
RCS file: /home/wine/wine/graphics/x11drv/opengl.c,v
retrieving revision 1.5
diff -r1.5 opengl.c
97a98
> int i;
105,112d105
< /* For the moment, we are dumb : we always allocate a new XVisualInfo structure,
< we do not try to find an already found that could match */
< if (physDev->used_visuals == MAX_PIXELFORMATS) {
< ERR("Maximum number of visuals reached !\n");
< /* Should SetError here... */
< return 0;
< }
<
129,131c122,124
< ADD2(GLX_ACCUM_SIZE, ppfd->cAccumBits);
< ADD2(GLX_STENCIL_SIZE, ppfd->cStencilBits);
< ADD2(GLX_AUX_BUFFERS, ppfd->cAuxBuffers); */
---
> ADD2(GLX_ACCUM_SIZE, ppfd->cAccumBits); */
> ADD2(GLX_STENCIL_SIZE, ppfd->cStencilBits); /* now suported */
> /* ADD2(GLX_AUX_BUFFERS, ppfd->cAuxBuffers); */
138c131
<
---
>
155a149,161
> /* try to find the visualid in the already created visuals */
> for( i=0; i<physDev->used_visuals; i++ ) {
> if ( vis->visualid == physDev->visuals[i]->visualid ) {
> XFree(vis);
> return i+1;
> }
> }
> /* now give up, if the maximum is reached */
> if (physDev->used_visuals == MAX_PIXELFORMATS) {
> ERR("Maximum number of visuals reached !\n");
> /* Should SetError here... */
> return 0;
> }
260a267,271
>
> /* stencil bits */
> glXGetConfig( gdi_display, vis, GLX_STENCIL_SIZE, &value );
> ppfd->cStencilBits = value;
>
263c274
< /* Aux, stencil : to do ... */
---
> /* Aux : to do ... */
More information about the wine-patches
mailing list