d3d three more renderstates for n2002

Lionel Ulmer lionel.ulmer at free.fr
Fri Dec 27 10:00:36 CST 2002


> 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.

For the documentation, do a Google search on the .CHM files from the various
DirectX SDKs (as the relevant documentations are not to be found anymore on
MSDN's site, only DX8 / 9 is still there).

I have them all but think it's not very legal to redistribute them. I could
though give you the file names so you can Google them :-)

> 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.

Well, I really wonder what 'the lot of functions' are that is lacking... Do
you have a tree with all the patches recently sent applied to or a plain CVS
tree ? From my experience, the only stuff missing is the
SetTextureStageState stuff. I doubt that other 'important' features are
still missing.

> 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.

Well, the Mesa name in the Wine source tree is historic (at the time these
files were created, the only OpenGL code for Linux was Mesa and it was using
the OSMesa extension to run). And as it's a pain to rename files in CVS, it
was never done.

The day we will move the files around to a d3dgl.dll library to ease
packaging, the files will be renamed.

> +           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;

Well, did you add also the code creating these clipping planes ? Otherwise,
it's not such a good idea to enable them :-)

I will have to reboot in Windows (or pester Endy to give me his CHM file
viewer :-) ) to tell exactly what that should do and how these clipping
planes are created.

> +
> +           case D3DRENDERSTATE_EXTENTS:
> +               /* boolean 
> +                * dont have a clue what this does */
> +               FIXME("What is D3DRENDERSTATE_EXTENTS supposed to do?\n");
> +               break;

Why not keep the standard 'not supported' instead of adding a case ?

> +
> +           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;
> +

This looks fine... Except that I have no real idea after reading the OpenGL
man page exactly what GL_POLYGON_SMOOTH does :-)

And I think you could enable it for lines too (but well, I do not know any
game using lines though).

Anyway, welcome on board :-)

                    Lionel

PS: I updated the d3d_status.html page.

-- 
		 Lionel Ulmer - http://www.bbrox.org/



More information about the wine-devel mailing list