mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 17:40:39 +00:00
Add replay API initialisation/shutdown to python examples
This commit is contained in:
@@ -275,6 +275,8 @@ def loadCapture(filename):
|
||||
if 'pyrenderdoc' in globals():
|
||||
pyrenderdoc.Replay().BlockInvoke(sampleCode)
|
||||
else:
|
||||
rd.InitialiseReplay(rd.GlobalEnvironment(), [])
|
||||
|
||||
if len(sys.argv) <= 1:
|
||||
print('Usage: python3 {} filename.rdc'.format(sys.argv[0]))
|
||||
sys.exit(0)
|
||||
@@ -286,3 +288,5 @@ else:
|
||||
controller.Shutdown()
|
||||
cap.Shutdown()
|
||||
|
||||
rd.ShutdownReplay()
|
||||
|
||||
|
||||
@@ -37,6 +37,8 @@ else:
|
||||
print('Usage: python3 {} filename.rdc'.format(sys.argv[0]))
|
||||
sys.exit(0)
|
||||
|
||||
rd.InitialiseReplay(rd.GlobalEnvironment(), [])
|
||||
|
||||
cap,controller = loadCapture(sys.argv[1])
|
||||
|
||||
# Use tkinter to create windows
|
||||
@@ -139,3 +141,6 @@ window.mainloop()
|
||||
controller.Shutdown()
|
||||
|
||||
cap.Shutdown()
|
||||
|
||||
if 'pyrenderdoc' not in globals():
|
||||
rd.ShutdownReplay()
|
||||
|
||||
@@ -90,6 +90,8 @@ def loadCapture(filename):
|
||||
if 'pyrenderdoc' in globals():
|
||||
pyrenderdoc.Replay().BlockInvoke(sampleCode)
|
||||
else:
|
||||
rd.InitialiseReplay(rd.GlobalEnvironment(), [])
|
||||
|
||||
if len(sys.argv) <= 1:
|
||||
print('Usage: python3 {} filename.rdc'.format(sys.argv[0]))
|
||||
sys.exit(0)
|
||||
@@ -101,3 +103,5 @@ else:
|
||||
controller.Shutdown()
|
||||
cap.Shutdown()
|
||||
|
||||
rd.ShutdownReplay()
|
||||
|
||||
|
||||
@@ -81,6 +81,8 @@ def loadCapture(filename):
|
||||
if 'pyrenderdoc' in globals():
|
||||
pyrenderdoc.Replay().BlockInvoke(sampleCode)
|
||||
else:
|
||||
rd.InitialiseReplay(rd.GlobalEnvironment(), [])
|
||||
|
||||
if len(sys.argv) <= 1:
|
||||
print('Usage: python3 {} filename.rdc'.format(sys.argv[0]))
|
||||
sys.exit(0)
|
||||
@@ -92,3 +94,5 @@ else:
|
||||
controller.Shutdown()
|
||||
cap.Shutdown()
|
||||
|
||||
rd.ShutdownReplay()
|
||||
|
||||
|
||||
@@ -84,6 +84,8 @@ def loadCapture(filename):
|
||||
if 'pyrenderdoc' in globals():
|
||||
pyrenderdoc.Replay().BlockInvoke(sampleCode)
|
||||
else:
|
||||
rd.InitialiseReplay(rd.GlobalEnvironment(), [])
|
||||
|
||||
if len(sys.argv) <= 1:
|
||||
print('Usage: python3 {} filename.rdc'.format(sys.argv[0]))
|
||||
sys.exit(0)
|
||||
@@ -95,3 +97,5 @@ else:
|
||||
controller.Shutdown()
|
||||
cap.Shutdown()
|
||||
|
||||
rd.ShutdownReplay()
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@ import time
|
||||
# the executable and trigger the capture at the desired time
|
||||
raise RuntimeError("This sample should not be run directly, read the source")
|
||||
|
||||
rd.InitialiseReplay(rd.GlobalEnvironment(), [])
|
||||
|
||||
protocols = rd.GetSupportedDeviceProtocols()
|
||||
|
||||
print(f"Supported device protocols: {protocols}")
|
||||
@@ -194,3 +196,5 @@ controller.Shutdown()
|
||||
# save the capture, etc
|
||||
|
||||
remote.ShutdownServerAndConnection()
|
||||
|
||||
rd.ShutdownReplay()
|
||||
|
||||
@@ -99,10 +99,18 @@ def loadCapture(filename):
|
||||
if 'pyrenderdoc' in globals():
|
||||
pyrenderdoc.Replay().BlockInvoke(sampleCode)
|
||||
else:
|
||||
cap,controller = loadCapture('test.rdc')
|
||||
rd.InitialiseReplay(rd.GlobalEnvironment(), [])
|
||||
|
||||
if len(sys.argv) <= 1:
|
||||
print('Usage: python3 {} filename.rdc'.format(sys.argv[0]))
|
||||
sys.exit(0)
|
||||
|
||||
cap,controller = loadCapture(sys.argv[1])
|
||||
|
||||
sampleCode(controller)
|
||||
|
||||
controller.Shutdown()
|
||||
cap.Shutdown()
|
||||
|
||||
rd.ShutdownReplay()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user