Drawing a line in DD with C++

Started by
11 comments, last by Doddler 23 years, 11 months ago
Thanks for the help everyone! I''ve been trying to impliment what the tutorial said, but it doesn''t display anything. I think I got everyting down except for creating the viewport. Creating the viewport is allot different in DX7 than it is in DX6. If anyone knows how to set the viewport for such an app I''d really like to hear it! Anyways, here''s my rendering code... Mabe there''s something wrong with it.

D3DTLVERTEX square[4];

square[0].sx = 10;
square[0].sy = 10;
square[0].rhw = 1;
square[0].color = D3DRGB(1.0f, 1.0f, 1.0f);

square[1].sx = 20;
square[1].sy = 10;
square[1].rhw = 1;
square[1].color = D3DRGB(1.0f, 1.0f, 1.0f);

square[2].sx = 10;
square[2].sy = 20;
square[2].rhw = 1;
square[2].color = D3DRGB(1.0f, 1.0f, 1.0f);

square[3].sx = 20;
square[3].sy = 20;
square[3].rhw = 1;
square[3].color = D3DRGB(1.0f, 1.0f, 1.0f);


lpD3DDev->BeginScene();

lpD3DDev->SetRenderState(D3DRENDERSTATE_FILLMODE,D3DFILL_WIREFRAME);

lpD3DDev->DrawPrimitive(D3DPT_TRIANGLESTRIP,D3DFVF_TLVERTEX,square,4,D3DDP_DONOTLIGHT / D3DDP_DONOTCLIP );

lpD3DDev->EndScene();

lpFrontBuffer->Flip(NULL, DDFLIP_WAIT );

And of course, I cleared the back buffer before drawing. Anyways, If anyone spots the problem, I''d like to hear it .

Well, thanks everyone for the input!

-Doddler
Advertisement
Well, I fixed it. It seems that I wasn''t doing anything wrong, just that my 3D card (the POS one) doesn''t draw the lines. Don''t ask me why not, but it just doesn''t do it. It works on any other comp though.

Anyways, I''d like to thank everyone for helping me out!

-Doddler
Well, I fixed it. It seems that I wasn''t doing anything wrong, just that my 3D card (the POS one) doesn''t draw the lines. Don''t ask me why not, but it just doesn''t do it. It works on any other comp though.

Anyways, I''d like to thank everyone for helping me out!

-Doddler

This topic is closed to new replies.

Advertisement