From ee47232fc17f31ef2bd95ca480372216a79def56 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Fri, 4 May 2018 12:00:53 -0400 Subject: Use Surface for screen capture in Renderer interface (#551) * Remove serialization of screen captures from a renderer implementation, capture now writes to a Surface. Then client code can decide to serialize (or use as needed). * Improved comment for captureScreenSurface. --- tools/render-test/render.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tools/render-test/render.h') diff --git a/tools/render-test/render.h b/tools/render-test/render.h index ba76f795d..f66454712 100644 --- a/tools/render-test/render.h +++ b/tools/render-test/render.h @@ -15,6 +15,9 @@ namespace renderer_test { typedef intptr_t Int; typedef uintptr_t UInt; +// pre declare types +class Surface; + // Declare opaque type class InputLayout: public Slang::RefObject { @@ -552,7 +555,8 @@ public: /// Create a buffer resource virtual BufferResource* createBufferResource(Resource::Usage initialUsage, const BufferResource::Desc& desc, const void* initData = nullptr) { return nullptr; } - virtual SlangResult captureScreenShot(const char* outputPath) = 0; + /// Captures the back buffer and stores the result in surfaceOut. If the surface contains data - it will either be overwritten (if same size and format), or freed and a re-allocated. + virtual SlangResult captureScreenSurface(Surface& surfaceOut) = 0; virtual InputLayout* createInputLayout(const InputElementDesc* inputElements, UInt inputElementCount) = 0; virtual BindingState* createBindingState(const BindingState::Desc& desc) { return nullptr; } -- cgit v1.2.3