Jump to content
  • Advertisement
Sign in to follow this  

[Fixed] [D3D9] Quad won't render

This topic is 2768 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 need some ideas as to why my quad won't render. I checked it out in PIX and for all I know, it *should* be drawing but it's not.

PIX verified for me that the post-transformed vertices (I'm using the fixed function pipe for now) show up in the middle of the viewport, right where they should be.
The culling mode is currently set to D3DCULL_NONE.
A texture is set (R8G8B8A8 texture with all opaque alpha) and alpha blending is disabled.
Fillmode is solid.
The write mask is RED | BLUE | GREEN | ALPHA.
Lighting, fogging are disabled.
ZENABLE is false.

Vertex decl is:
static const D3DVERTEXELEMENT9 _terrain_2D[] =

Both D3DTS_VIEW and D3DTS_PROJECTION matrices are set to the identity matrix (because I am drawing 2D objects on the screen).

I am using this code to perform my quad drawing:
DrawIndexedPrimitive(D3DPT_TRIANGLESTRIP, 0, 0, 4, 0, 2);

The vertices are (positions first, then texcoords):
0: (0.0f, 0.0f, 1.0f) (0.0f, 0.0f)
1: (1.0f, 0.0f, 1.0f) (1.0f, 0.0f)
2: (0.0f, 1.0f, 1.0f) (0.0f, 1.0f)
3: (1.0f, 1.0f, 1.0f) (1.0f, 1.0f)

And my index buffer is:
0, 1, 2, 3

So does anyone have any ideas that I could check out as to why I'm not seeing anything on the screen?

Edit: Well this is the third time this week that I've managed to rubberducky myself on GameDev. The problem was that I had clipping planes enabled which quickly became invalid after I changed my projection matrix to the identity. I disabled them and that fixed it.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • 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!