/// <summary>
 /// Get a specific buffer within the chain as any compatible COM interface (similar to QueryInterface)
 /// </summary>
 /// <param name="index">
 /// Specifies the index within the chain to retrieve. Must be between 0 and length (see GetTextureSwapChainLength),
 /// or may pass -1 to get the buffer at the CurrentIndex location. (Saving a call to GetTextureSwapChainCurrentIndex).
 /// </param>
 /// <param name="iid">Specifies the interface ID of the interface pointer to query the buffer for.</param>
 /// <param name="buffer">Returns the COM interface pointer retrieved.</param>
 /// <returns>
 /// Returns an ovrResult indicating success or failure. In the case of failure, use
 /// Wrap.GetLastError to get more information.
 /// </returns>
 public OVRTypes.Result GetBufferDX(int index, Guid iid, out IntPtr buffer)
 {
     buffer = IntPtr.Zero;
     return(OVR.GetTextureSwapChainBufferDX(Session, TextureSwapChainPtr, index, iid, ref buffer));
 }