public void RenderMsgPackCommands(D3D11Device device, Scene scene, ArraySegment <byte> commands) { m_backbuffer.Begin(device, scene, m_clear); while (commands.Count > 0) { try { m_parsed.Clear(); var parsed = MsgPackParser.Parse(m_parsed, commands); m_dispatcher.Dispatch(parsed); commands = Skip(commands, parsed.Value.Bytes.Count); } catch (Exception ex) { Console.WriteLine(ex); break; } } m_backbuffer.End(); m_swapchain.Present(); }