Problem with z-buffer

Started by
0 comments, last by Zen42 24 years, 6 months ago
Hi everybody!

I am just starting to learn Direct3D (Immediate Mode) and did the first tutorial in MS DirectX SDK 6 (The triangle tutorial).

Besides the fact, that this tutorial is worse than anything I have ever seen before (I liked the DirectDraw tutorials much better), I went through it. I made some changes (Fullscreen mode with backbuffer and flipchain).

Then I tried the second tutorial (z-buffer) and everything went fine until I started what I coded. If I turn on the z-buffer with g_pD3DDevice->SetRenderState() I can just see some lines moving across the screen. When I turn it off all is fine except that z-buffering is off and so the output is without hidden surface removal.

(Maybe this can be helpful: Like in the first tutorial I made some changes like fullscreen mode, backbuffer in VIDMEM and a flipping chain)

I can't get, what I did wrong, so I am trying my luck in this message board. As posting my sourcecode would be not such a good idea (it's simply too long) I put a link in here, where you can find it.
http://www.rzuser.uni-heidelberg.de/~tpastuch/code/d3d.txt

If someone has the time to have look at it and could analyze it, I would be very glad. (I can understand, if you don't want to, since my coding style is not the best )

Many thanks in advance...

...Bye

Advertisement
Clear your z-buffer.

g_pD3DViewport->Clear2(1UL, &ViewportRect, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0x000000ff, 1.0f, 0L);

This topic is closed to new replies.

Advertisement