Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


what is wrong with it ?

This topic is 5922 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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 ?

Share this post

Link to post
Share on other sites
Guest Anonymous Poster
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

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

Share this post

Link to post
Share on other sites
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]

Share this post

Link to post
Share on other sites
thanks Johnn,

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

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!