unsigned int faces[] = {0, 1, 2}; unsigned int num_faces = sizeof(faces) / 3; Does this do what you want? As far as I can see you want ARRAY_SIZE(faces) /
On Wednesday 08 June 2011 18:51:41 Michael Mc Donnell wrote: 3.
+ struct { + D3DXVECTOR3 position0; + D3DXVECTOR3 position1; + D3DXVECTOR3 normal; + DWORD color; + } vertices[] = { ... Another style nitpick: Bracket placing.
+ /* Two null pointers. Setting only the mesh to null will result in an + * exception on Windows. + */ + hr = mesh->lpVtbl->UpdateSemantics(NULL, NULL); I think setting the instance pointer to NULL when invoking a method doesn't need a test, it will give you odd results. What you show here is that native checks the only method parameter before it accesses the object instance.
Remember, usually apps will invoke this via C++: mesh->UpdateSemantics(declaration); Similarly it isn't necessary to check iface or This against NULL in the implementations. Otherwise this looks OK