what is wrong with it ?

Started by
2 comments, last by cyberkid 21 years, 11 months ago
i am trying to draw a simple texture polygon farthest away. but it does not work properly. the code is below; ////////// v[0].sx := 0.0; v[0].sy := 480.0; v[0].color := $ffff0000; v[1].sx := 0.0; v[1].sy := 0.0; v[1].color := $ffff0000; // the blue corner v[2].sx := 640.0; v[2].sy := 480.0; v[2].color := $ffff0000; v[3].sx := 640.0; v[3].sy := 0.0; v[3].color :=$ffff0000; v[0].sz := 0.99999; v[1].sz := 0.99999; v[2].sz := 0.99999; v[3].sz := 0.99999; v[0].tu:=0; v[0].tv:=1; v[1].tu:=0; v[1].tv:=0; v[2].tu:=1; v[2].tv:=1; v[3].tu:=1; v[3].tv:=0; pd3ddev.BeginScene; pd3ddev.SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE,0); pd3ddev.setrenderstate(d3drenderstate_zenable,1); pd3ddev.SetTextureStageState(0,D3DTSS_COLORARG1,D3DTA_TEXTURE); pd3ddev.SetTextureStageState(0,D3DTSS_COLOROP,DWORD(D3DTOP_selectarg1)); pd3ddev.SetTexture(0,psurf); pd3ddev.DrawPrimitive(D3DPT_TRIANGLESTRIP,D3DFVF_TLVERTEX,v,4,0); pd3ddev.EndScene; ///////////////// what is wrong ?
Advertisement
What language is that...Thought it was C++ but, pd3ddev. would have to be pd3ddev-> right?

anyway, some things I see that might be wrong...

somethings are in the wrong case or using the wrong label
d3drenderstate_zenable -> D3DRS_ZENABLE ?
setrenderstate -> SetRenderState
D3DTOP_selectarg1?

You didn''t set the vertex shader (Using DirectX 8?)
didn''t set your Vertex Streams..
don''t know about those Z values...
didn''t set your world matrix (depending on your FVF)

is this a joke...if not, time to go back to the SDK tutorials

AP:
It's almost certainly Delphi code. Which means that it isn't case sensitive.

EDIT :: Just realised - as the AP said, your "d3drenderstate_zenable" should be "d3drs_zenable"
and your "d3drenderstate_alphablendenable" should be "d3drs_aplhablendenable".
Check the docs for more of the render state constants.

Another thing that I noticed was that you've put a comment "the blue corner", but all of the colour values are red.

And I'm assuming that you're setting the Vertex Shader, and Stream Source in some other function.

John B

[edited by - JohnBSmall on May 3, 2002 6:34:48 PM]
The best thing about the internet is the way people with no experience or qualifications can pretend to be completely superior to other people who have no experience or qualifications.
thanks Johnn,

all things messed up by rhw component of tlvertex.
making it 1 is solved my problem.

This topic is closed to new replies.

Advertisement