Jump to content
  • Advertisement

Archived

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

cybrgeek

Problem with D3DXSprite

This topic is 5882 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''ve stopped using D3DXSprite, and wrote my own code that does the exact same thing, but everything is batched, and when a texture or renderstate change is made that change is added to a link list, and every vertex between the two changes is drawn using DrawPrimitive and the current texture texture and renderstate. None of my code uses the D3DXSprite functions anymore, but when I removed the code I start getting problems. The problem occurs when I remove the begin and end calls with the sprite interface. With the calls in the graphic engine everything draws fine. With out those calls only 1 of the 2 triangles for each textured quad is drawn. Does anybody know why this is happening, and how to fix it?

Share this post


Link to post
Share on other sites
Advertisement
G''day!

It''s hard to guess based on what you''ve said. My first guess would be that you have culling turned on and your quad isn''t set up properly, does D3DXSprite turn off culling? I can''t remember.
Anyway, try turning of culling and see if your quad shows up.

Stay Casual,

Ken
Drunken Hyena

Share this post


Link to post
Share on other sites
quote:
does D3DXSprite turn off culling? I can''t remember.
It realy dosent have culling at all.
Instead, if your width/height vars overlap your X/Y vars, the sprite would be drawn upside down, umm, like ; everything would be mirrored on the axis that overlaped.

[ my engine ][ my game ][ my email ]
SPAM

Share this post


Link to post
Share on other sites
Wait, not width/eight -- but if say scaling was (-1.0,1.0) then the sprite would be mirrored on the X axis, and if scaling was (1.0,-1.0) it would be mirrored on the Y axis and mirrored completly if it was (-1.0, -1.0).

[ my engine ][ my game ][ my email ]
SPAM

Share this post


Link to post
Share on other sites
Given that he said he has stopped using ID3DXSprite, he will have to turn culling off manually.

Render states etc are important - make sure that you've:
+ Turned culling off (D3DRS_CULLMODE, D3DCULL_NONE)
+ Turned lighting off (D3DRS_LIGHTING, 0)
+ Got the projection, view and world matrices set up correctly.
+ Got your texture stages set up right.

EDIT :: I basically agree with Drunken Hyena - it sounds like a culling problem.

John B

[edited by - JohnBSmall on April 17, 2002 4:38:37 PM]

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!