Jump to content
  • Advertisement

Archived

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

Blah2

DX9: My code doesn't work on some cards

This topic is 5544 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

Hi, I have a question...I''ve written some simple code for Directx 9 that draws some simple 2d and 3d textures. (Just basic DrawPrimitive and DrawIndexedPrimitive calls, using textures loaded by D3DX calls). I use a z-buffer for the 3d stuff. The code works fine on two cards that I''ve tested...a GeForce3 and a GeForce2. However, my code doesn''t seem to work on a Riva TNT2 and a Rage 128 Pro. On both of these cards, the 2d stuff is drawn fine, but the 3d things don''t show up properly. On the Rage card, the 3d polygons don''t show up unless I look at certain angles (which seem random) and none of the 3d stuff shows up on the TNT2. Does anyone have any ideas for stuff I could try differently? I''ve updated the drivers for both cards, but it doesn''t seem to help.

Share this post


Link to post
Share on other sites
Advertisement
Most likely because those cards dont meet the requirements for directx 9. I believe that only cards built for dx7 and higher can run dx9 stuff. I could be way off base here though. Either way I dont think dx9 is the best choice if aaiming for a lowend old vid card market. I''d stick with 8 for compatibility.

Share this post


Link to post
Share on other sites
Well I doubt the problem is specifically with DX9 -- it sounds like it''s a transformation problem. 2D vertices aren''t transformed but 3D ones are. Explicitly set software vertex processing, set the z-buffer depth to 16 bits, and maybe even make all buffers in D3DPOOL_SYSTEMMEM for debugging. (On non-T&L cards, dynamic buffers are always in system memory.)

~CGameProgrammer( );
DevImg.net - Post screenshots, comment on others.
Town 3D Engine - A city-rendering 3D engine. Download the demo.

Share this post


Link to post
Share on other sites
Thanks for your help guys. None of those things were the problem, but they lead me on the right track. It turns out when I created my index buffer for the DrawIndexedPrimitive call, I used ''D3DFMT_INDEX32'' (just because I was used to working with integers, not because I needed it). The GeForce cards let me get away with that, but it turns out that if the card''s MaxVertexIndex <= 0x0000FFFF, the index buffer will still be created, but nothing will be rendered. I changed it to D3DFMT_INDEX16...problem solved!

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!