// Initialize three vertices for rendering a triangle
vertices[] =
{
{ 150.0f, 50.0f, 0.5f, 1.0f, 0xffff0000, }, // x, y, z, rhw, color
{ 250.0f, 250.0f, 0.5f, 1.0f, 0xff00ff00, },
{ 50.0f, 250.0f, 0.5f, 1.0f, 0xff00ffff, },
};

I've never really used staically defined structures alot. Three structure name vertices of type CUSTOMVERTEX:


vertices CUSTOMVERTEX {150.0f, 50.0f, 0.5f, 1.0f, 0ffff0000h}

Thats what I got so far, but I need 3 of them. I'm haveing a hard time imagining the syntax with the DUP operator and filling out the feilds.

Thanks.


Edit: Think I figured it out:


vertices CUSTOMVERTEX 3 DUP({150.0,50.0,0.5,1.0,0ffff0000h},\
{250.0,250.0,0.5,1.0,0ff00ff00h},\
{50.0,250.0,0.5,1.0,0ff00ffffh})
Posted on 2003-03-31 07:36:28 by ThoughtCriminal
Afternoon, ThoughtCriminal.

That looks like the vertices array from the vertices "tutorial" of Microsofts.

http://www.scrontsoft.com/win32asmdefault.asp
Go to the DX8.1 "tutorials" page and download the vertices.asm example.

Just in case you haven't realized yet; that example doesn't use world/view/projection matrices, so the coordinates you supply for X,Y,Z are *pixel* coordinates.

Also:
http://www.scrontsoft.com
Go to the "Writing" page, and download the "Win32Asm DirectX 8.1 Book".
It's only a tentative start with very little information, however I plan on improving it over time.

Cheers,
Scronty
Posted on 2003-03-31 16:07:02 by Scronty
Thanks Scronty, I got the vertices tut working under DX9 last night.

Just in case you haven't realized yet; that example doesn't use world/view/projection matrices, so the coordinates you supply for X,Y,Z are *pixel* coordinates.

Hmm, didn't know that.

This is the proper struct for the tut:


vertices CUSTOMVERTEX {150.0,50.0,0.5,1.0,0ffff0000h},\
{250.0,250.0,0.5,1.0,0ff00ff00h},\
{50.0,250.0,0.5,1.0,0ff00ffffh}

No DUP operator. Didn't want 3copies of 3 structures.
Posted on 2003-04-01 02:29:10 by ThoughtCriminal
Afternoon, ThoughtCriminal.

No DUP operator. Didn't want 3copies of 3 structures.


heh.
If you check out the earliest posts in this forum, you'll see that the first example *did* use DUP (and thus, 3 copies of 3 structures;)).
Like yourself, the mistake was found pretty quickly.

Just wondering...
Are you building .inc files from scratch, or only adjusting the DX8.1 files from Caleb or myself? From what I've seen, there's not much different between the versions for most of the COM calls and d3dx8 functions.

I'm not touching DX9 until I can afford a newer vid card. However, since my card is only six months old, I'm not going to upgrade for quite some time:tongue: .

Don't forget to take a look at the other asm DX8.1 examples to help you in translating your DX9 examples.

Cheers,
Scronty
Posted on 2003-04-01 03:59:42 by Scronty
Thanks. My card is a GeForce 2, so no pixel shaders for me.
Posted on 2003-04-01 04:22:52 by ThoughtCriminal