mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 17:40:39 +00:00
Fix qrenderdoc examples for latest API
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
filename = "test.rdc"
|
||||
formatter = "float3 pos; half norms[16]; uint flags;"
|
||||
|
||||
pyrenderdoc.LoadCapture(filename, filename, False, True)
|
||||
pyrenderdoc.LoadCapture(filename, renderdoc.ReplayOptions(), filename, False, True)
|
||||
|
||||
mybuf = renderdoc.ResourceId.Null()
|
||||
|
||||
@@ -15,8 +15,9 @@ for buf in pyrenderdoc.GetBuffers():
|
||||
|
||||
print("selected %s" % pyrenderdoc.GetResourceName(mybuf))
|
||||
|
||||
# Open a new buffer viewer for this buffer, with the given format
|
||||
bufview = pyrenderdoc.ViewBuffer(0, 0, mybuf, formatter)
|
||||
if mybuf != renderdoc.ResourceId.Null():
|
||||
# Open a new buffer viewer for this buffer, with the given format
|
||||
bufview = pyrenderdoc.ViewBuffer(0, 0, mybuf, formatter)
|
||||
|
||||
# Show the buffer viewer on the main tool area
|
||||
pyrenderdoc.AddDockWindow(bufview.Widget(), qrenderdoc.DockReference.MainToolArea, None)
|
||||
# Show the buffer viewer on the main tool area
|
||||
pyrenderdoc.AddDockWindow(bufview.Widget(), qrenderdoc.DockReference.MainToolArea, None)
|
||||
|
||||
@@ -10,7 +10,7 @@ First the code opens a specified file, although this step could be omitted if th
|
||||
|
||||
filename = "test.rdc"
|
||||
|
||||
pyrenderdoc.LoadCapture(filename, filename, False, True)
|
||||
pyrenderdoc.LoadCapture(filename, renderdoc.ReplayOptions(), filename, False, True)
|
||||
|
||||
Next we iterate through the list of buffers to find the one we want. The selection criteria are up to you, in this case we look at the name provided and identify the buffer by that, however it could also be a particular size, or the buffer bound at a given event.
|
||||
|
||||
@@ -47,4 +47,4 @@ Example Source
|
||||
|
||||
:download:`Download the example script <show_buffer.py>`.
|
||||
|
||||
.. literalinclude:: show_buffer.py
|
||||
.. literalinclude:: show_buffer.py
|
||||
|
||||
Reference in New Issue
Block a user