   Incredibly strange Vertex/Index buffer error.
  There are some incredibly wierd things going on while I am trying to render two colored squares using index and vertex buffers. I will explain the screenshot of the error before I post it. The windows are labeled by me, via photoshop, in the order in which they were opened. The glitch goes away as the program is opened multiple times, which is what is really confusing the hell out of me. The third window is almost perfect aside from the small "scratch" on the bottom square, and the fourth window, of which only the bottom corner can be seen, looks perfect. Anyways, here is the screenshot. Click on it to make it bigger, although I doubt anyone here needs me to say that, just being on the safe side.EDIT: It turns out that the program is acctually not becoming perfect on the fourth time of being opened, and is just randomly better or worse.Any ideas what is causing this?Thanks in advance.   
  Looks like a non-cleared Z buffer, which means you've create a Z buffer, enabled it, but either forgot to clear it, or aren't clearing it properly.Assuming you're asking to clear Z, are you also asking to clear stencil?  Do you have stencil bits in your depth format?  If not, the clear will fail, and won't clear the Z buffer at all.Try the debug runtimes (control panel/DirectX/Direct3D, select debug runtime radio button.  Move the output level slider to somewhere in the middle.  When you run your app, D3D should give errors and warnings in your output window.   ;Direct3D9: :====> ENTER: DLLMAIN(00c8d6e0): Process Attach: 0000054c, tid=0000099cDirect3D9: :====> EXIT: DLLMAIN(00c8d6e0): Process Attach: 0000054cDirect3D9: (INFO) :Direct3D9 Debug Runtime selected.Direct3D9: (INFO) :======================= Hal HWVP Pure device selectedDirect3D9: (INFO) :HalDevice Driver Style 9Direct3D9: :DoneExclusiveModeDirect3D9: (INFO) :Failed to create driver indexbufferDirect3D9: (INFO) :Failed to create driver indexbufferDirect3D9: (WARN) :Ignoring redundant SetRenderState - 8Direct3D9: (WARN) :Ignoring redundant SetRenderState - 9That is the only output I am getting from D3D even with the output level slider all the way to the right.   ;  I agree with Namethatnobodyelsetook. This definitely has the look of the depth buffer not being cleared.   ;  That was the problem. Thanks a lot guys, I had not looked closely enough at the tutorial that I was working from, and hadn't noticed the change from this:m_pd3dDevice->Clear( 0, 0, D3DCLEAR_TARGET, D3DCOLOR_XRGB( 0, 0, 0 ), 1.0f, 0 );To this:m_pd3dDevice->Clear( 0, 0, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB( 0, 0, 0 ), 1.0f, 0 );Thanks again, you guys are quite the help.   