(filename)
| 56 | printVar(v) |
| 57 | |
| 58 | def loadCapture(filename): |
| 59 | # Open a capture file handle |
| 60 | cap = rd.OpenCaptureFile() |
| 61 | |
| 62 | # Open a particular file - see also OpenBuffer to load from memory |
| 63 | result = cap.OpenFile(filename, '', None) |
| 64 | |
| 65 | # Make sure the file opened successfully |
| 66 | if result != rd.ResultCode.Succeeded: |
| 67 | raise RuntimeError("Couldn't open file: " + str(result)) |
| 68 | |
| 69 | # Make sure we can replay |
| 70 | if not cap.LocalReplaySupport(): |
| 71 | raise RuntimeError("Capture cannot be replayed") |
| 72 | |
| 73 | # Initialise the replay |
| 74 | result,controller = cap.OpenCapture(rd.ReplayOptions(), None) |
| 75 | |
| 76 | if result != rd.ResultCode.Succeeded: |
| 77 | raise RuntimeError("Couldn't initialise replay: " + str(result)) |
| 78 | |
| 79 | return (cap, controller) |
| 80 | |
| 81 | if 'pyrenderdoc' in globals(): |
| 82 | pyrenderdoc.Replay().BlockInvoke(sampleCode) |
no test coverage detected