Thanks! Have not saw your previous posting... i will give it a try... (however i have not added crinkler to VS2008. I just copy the created *.obj to a temp folder and then running crinkler by hand (a batch file i created).
The easiest way to use crinkler with VS is to get the crinkler exe, rename it to link.exe and put it in the folder along with your .vcproj file.
Then go in to
Project->Properties->Configuration Properties->Linker->Command Line
and add
/CRINKLER
to the Additional Options box.
You might also need to set
C/C++->Optimization->Whole Program Optimization to 'No'
Linker->Optimization->Link Time Code Generation to 'Default'
otherwise crinkler will barf.
That way, no need for any batch files or anything, crinkler gets run as part of the ordinary build process. If you remove the /CRINKLER option, the crinkler exe will just call the original Microsoft linker and you get a normal uncrinkled exe.
For drawing gouraud rectangles with the minimum of fuss, I suggest using the DrawPrimitiveUP() function.
You can then do something like
MYVERTEX vertices[4];
d3d_device->DrawPrimitiveUP(D3DPT_TRIANGLEFAN, 2, vertices, sizeof(MYVERTEX))
That will draw a quad (two triangles in a fan) from the 4 vertices.
You might define MYVERTEX like this
typedef struct
{
float x,y,z,w;
D3DCOLOR rgb;
} MYVERTEX;
Then you need to tell Direct3D what your vertex looks like - you've got a post-transformed coordinate (you want to use 2d screen coordinates, and not have d3d do any rotations, right?) and a diffuse colour, so, once, before you draw anything
d3d_device->SetFVF(D3DFVF_XYZRHW | D3DFVF_DIFFUSE);
You probably want to set the z to be in front of your clipping plane, and w to be 1/z.
Your 4 rgb values will be the 4 colours at the corners of your rectangle. There are some D3D macros you might want to use.
Jim