diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2018-05-03 18:42:13 -0400 |
|---|---|---|
| committer | Tim Foley <tfoleyNV@users.noreply.github.com> | 2018-05-03 15:42:13 -0700 |
| commit | f8472940229e8582ec9f941069fc9576bd09b94c (patch) | |
| tree | 9b387a65abc42094e7a1e0687b793cb0fc5c5eaa /tools/render-test/main.cpp | |
| parent | c216f00f1eaff368229cb8430422972fcac801b7 (diff) | |
Added Surface type - as a simple value type to hold a 2d collection of pixels. (#548)
Added PngSerializeUtil allows currently for just writing Surface of RGBA format.
Removes dependency on stbi_image except for in PngSerializeUtil.
Removed use of gWindowWidth/Height globals - pass the height into initialize or Renderer.
Diffstat (limited to 'tools/render-test/main.cpp')
| -rw-r--r-- | tools/render-test/main.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tools/render-test/main.cpp b/tools/render-test/main.cpp index 7dcb9af95..df9220b58 100644 --- a/tools/render-test/main.cpp +++ b/tools/render-test/main.cpp @@ -430,7 +430,11 @@ SlangResult innerMain(int argc, char** argv) return SLANG_FAIL; } - SLANG_RETURN_ON_FAIL(renderer->initialize(windowHandle)); + Renderer::Desc desc; + desc.width = gWindowWidth; + desc.height = gWindowHeight; + + SLANG_RETURN_ON_FAIL(renderer->initialize(desc, windowHandle)); auto shaderCompiler = renderer->getShaderCompiler(); switch (gOptions.inputLanguageID) @@ -500,7 +504,12 @@ SlangResult innerMain(int argc, char** argv) } else { - SLANG_RETURN_ON_FAIL(renderer->captureScreenShot(gOptions.outputPath)); + Result res = renderer->captureScreenShot(gOptions.outputPath); + if (SLANG_FAILED(res)) + { + fprintf(stderr, "ERROR: failed to write screen capture to file\n"); + return res; + } } return SLANG_OK; } |
