   [XNA] DrawSubset emulation
  Hello, I'm trying to write an API-independent engine and while writing XNA graphic part I found out that there is no ModelMesh.DrawSubset() method. Instead it has ModelMesh.Draw() which seem to run through all the subsets changing effect states on it's own. And that is definitely what I don't want it to do. So I decided to write DrawSubset myself and here's the code:   public override void DrawSubset(int index)   {  ModelMeshPart subset = nativeMesh.MeshParts[index];  GraphicsDevice device = nativeMesh.VertexBuffer.GraphicsDevice;  VertexDeclaration subsetVertexDeclaration = subset.VertexDeclaration;  PrimitiveType primitiveType;    int vertsToPrims = subset.NumVertices / subset.PrimitiveCount;  primitiveType = (vertsToPrims == 0) && (vertsToPrims*subset.PrimitiveCount == subset.NumVertices) ?  PrimitiveType.TriangleList : PrimitiveType.TriangleStrip;    if (device.VertexDeclaration != subsetVertexDeclaration)  { device.VertexDeclaration = subsetVertexDeclaration;  }  device.Vertices[0].SetSource(nativeMesh.VertexBuffer, subset.StreamOffset, subset.VertexStride);  if (nativeMesh.IndexBuffer != null)  { device.Indices = nativeMesh.IndexBuffer; device.DrawIndexedPrimitives(primitiveType, subset.BaseVertex, 0,subset.NumVertices, subset.StartIndex, subset.PrimitiveCount);  }  else  { device.DrawPrimitives(primitiveType, subset.StartIndex, subset.PrimitiveCount);  }   }What I want to ask is have I done it right? :) Is there something I missed or something that can be skipped?   