Click to See Complete Forum and Search --> : Problem with color shading in D3D9


Alluminitti
March 25th, 2005, 01:26 PM
Hello,
I'd like to make a couple of notes before I post my code. The D3D9 object interface and the device interface are freed elsewhere(they're not presented in the code). Also please note that safeRelease is defined elsewhere aswell.
I'm following the book, Intro to 3D game programming w/ DirectX 9.0, and I must say its a great book. So far so good. I'm using vertex and index buffers for this small example. All this does is render two triangles where two of their vertices are shared(this is where the usage of an index buffer comes into play). But unfortunately my code produces this :

Screenshot
http://talitha.qhacks.com/Shade.jpg

And without further ado here is the source :

Source
Code... (http://rafb.net/paste/results/o79BBc17.html)

Please note that I've reviewed my code numerous times before posting here. By the life of me I can't seem to find the source of the problem. Everything looks A-OK from here. Any help would be greatly appreciated.