private unsafe uint _getVsyncResponse(ushort id) { var responseStruct = new VsyncResponse(); _control.Receive(new Span <byte>(responseStruct.rawData, sizeof(VsyncResponse))); return(responseStruct.frameNumber); }
private unsafe void Vsync(ushort id, ReadOnlySpan <ushort> payload) { PruManager.WaitForVsync(); var response = new VsyncResponse { id = id, frameNumber = PruManager.GetFrameNumber(), buttons = PruManager.GetButtons() }; Socket.Send(new ReadOnlySpan <byte>(response.rawData, sizeof(VsyncResponse))); }