mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 01:20:42 +00:00
Sample code should take the capture to load as an argument
* This makes it easier to run the examples from the command line without editing them
This commit is contained in:
@@ -275,7 +275,11 @@ def loadCapture(filename):
|
||||
if 'pyrenderdoc' in globals():
|
||||
pyrenderdoc.Replay().BlockInvoke(sampleCode)
|
||||
else:
|
||||
cap,controller = loadCapture('test.rdc')
|
||||
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)
|
||||
|
||||
|
||||
@@ -33,7 +33,11 @@ def loadCapture(filename):
|
||||
if 'pyrenderdoc' in globals():
|
||||
raise RuntimeError("This sample should not be run within the RenderDoc UI")
|
||||
else:
|
||||
cap,controller = loadCapture('test.rdc')
|
||||
if len(sys.argv) <= 1:
|
||||
print('Usage: python3 {} filename.rdc'.format(sys.argv[0]))
|
||||
sys.exit(0)
|
||||
|
||||
cap,controller = loadCapture(sys.argv[1])
|
||||
|
||||
# Use tkinter to create windows
|
||||
import tkinter
|
||||
|
||||
@@ -90,7 +90,11 @@ def loadCapture(filename):
|
||||
if 'pyrenderdoc' in globals():
|
||||
pyrenderdoc.Replay().BlockInvoke(sampleCode)
|
||||
else:
|
||||
cap,controller = loadCapture('test.rdc')
|
||||
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)
|
||||
|
||||
|
||||
@@ -81,7 +81,11 @@ def loadCapture(filename):
|
||||
if 'pyrenderdoc' in globals():
|
||||
pyrenderdoc.Replay().BlockInvoke(sampleCode)
|
||||
else:
|
||||
cap,controller = loadCapture('test.rdc')
|
||||
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)
|
||||
|
||||
|
||||
@@ -84,7 +84,11 @@ def loadCapture(filename):
|
||||
if 'pyrenderdoc' in globals():
|
||||
pyrenderdoc.Replay().BlockInvoke(sampleCode)
|
||||
else:
|
||||
cap,controller = loadCapture('test.rdc')
|
||||
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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user