d3d three more renderstates for n2002

Christoph Frick frick at SC-Networks.de
Fri Dec 27 05:54:51 CST 2002


Hi!

with one of the last patches from the cvs the game Nascar 2002 now recognizes
the d3d rasterizer in the config tool. The patch below adds three more
handlers for the D3DRENDERSTATE. As d3d seems to me pretty undocumented i can
only try to find things out using goolgle and see the example code there - a
link to doku would be really appreciated.

Only the D3DRENDERSTATE_CLIPPING stuff seems pretty obvious. I dont have a
clue what the EXTEND stuff does and can also only guess what the EDGEANTIALIAS
does. I also was not able to test it in the game - the d3d stuff seem to lack
a lot of functions this game relies on - i will try to add further functions
step by step.

The d3d7 code looks pretty bound to mesa - i dont use mesa, so i can not say
if this works or not with mesa - only with the opengl provided by nvidia and
what the manpages say.

RFC and CU!

Index: dlls/ddraw/mesa.c
===================================================================
RCS file: /home/wine/wine/dlls/ddraw/mesa.c,v
retrieving revision 1.20
diff -u -r1.20 mesa.c
--- dlls/ddraw/mesa.c   24 Dec 2002 01:03:04 -0000      1.20
+++ dlls/ddraw/mesa.c   27 Dec 2002 11:43:32 -0000
@@ -345,6 +345,39 @@
                    glDisable(GL_LIGHTING);
                break;
 
+           case D3DRENDERSTATE_CLIPPING:
+               /* enables/disables clipping; get the maximal amount of
+                * possible clippling planes in this opengl implementation and
+                * enable/disable em all */
+               {
+                   GLint i, maxclipplanes;
+                   glGetIntegerv(GL_MAX_CLIP_PLANES,&maxclipplanes);
+                   for (i=0; i<maxclipplanes; i++) {
+                       if (dwRenderState) {
+                           glEnable(GL_CLIP_PLANE0+i);
+                       } else {
+                           glDisable(GL_CLIP_PLANE0+i);
+                       }
+                   }
+               }
+               break;
+
+           case D3DRENDERSTATE_EXTENTS:
+               /* boolean 
+                * dont have a clue what this does */
+               FIXME("What is D3DRENDERSTATE_EXTENTS supposed to do?\n");
+               break;
+
+           case D3DRENDERSTATE_EDGEANTIALIAS:
+               /* in opengl the antialiasing of points, lines and polygons can
+                * be set separate - assuming this only actives it for polygons */
+               if (dwRenderState) {
+                   glEnable(GL_POLYGON_SMOOTH);
+               } else {
+                   glDisable(GL_POLYGON_SMOOTH);
+               }
+               break;
+
            default:
                ERR("Unhandled dwRenderStateType %s (%08x) !\n", _get_renderstate(dwRenderStateType), dwRender
StateType);
        }





More information about the wine-devel mailing list