Click to See Complete Forum and Search --> : Some problems related to SetIndices() in DX8 and DX9


sakurazuka
June 8th, 2007, 11:39 AM
I have this little problem. I'm going through this direct x course book and everything would be fine exept the examples in this book use d3d8/d3dx8 whereas I'm using d3d9/d3dx9. In one of the examples the author shows a way of rendering indexed primitives after setting their indexes with the SetIndices() method which, in DX8, takes 2 params and not 1 as of DX9. The problem is that the second parameter is essential because all the vertexes are defined in one array and I can't control the start of indexing without it. Is there another method to set the offset for the vertices?

(PS. I hope anyone understood what I'm trying to say... It doesn't seem too obvious to me when I'm reading it again...)

Zaccheus
June 8th, 2007, 12:04 PM
You could try the following:


#define DIRECT3D_VERSION 0x0800
#include <d3d.h>


In other words, if you define DIRECT3D_VERSION to be 0x0800 before including the Direct3D header files then the DirectX 9 SDK should allow you to compile DirectX 8 code.

sakurazuka
June 11th, 2007, 04:23 PM
Well i guess it's worth a shot but I was rather looking for a solution in DX9 - like a similiar function to SetIndices() in DirectX 9...

Mike Harnad
June 15th, 2007, 09:28 AM
If you're using DX9, why are you using a book that teaches DX8? You've already found out that the API has changed significantly from DX8 to DX9. It would be worth your while to get a book like Direct3D Programming (http://www.amazon.com/Direct3D-Programming-Start-Clayton-Walnum/dp/0672324989) instead.