How to know vertex format

Started by
9 comments, last by Illco 18 years, 5 months ago
Quote:Original post by derek7
I mean automaticly create other than manually.

struct vertex {stuff};

Vertex FVFToStruct ( DWORD fvf) {how to do??}

That's what I meant with thinking about what the function should return: in C++ only values can be returned (considering structs and such as values as well) but you cannot return a type (such as some specific struct matching the fvf). You can see that the result of the function should change 'stuff' which is impossible.

The idea behind FVFs is that you define a struct according to what FVF you use. If you don't know the FVF in advance you must define structs for all you expect or use the aforementioned offset calculations.

This is why they are somewhat depricated; currently you should be using vertex declarations. They always work with offsets.

But perhaps it is a good idea to tell what you want to achieve because there are indeed probably easier ways.

Illco

This topic is closed to new replies.

Advertisement