Skip to content

Commit 6ccf34a

Browse files
committed
Screen shots
1 parent 85c0999 commit 6ccf34a

File tree

3 files changed

+31
-3
lines changed

3 files changed

+31
-3
lines changed

examples_tests/21.DynamicTextureIndexing/main.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
#include "nbl/asset/utils/CCPUMeshPackerV1.h"
1313

14+
#include "nbl/ext/ScreenShot/ScreenShot.h"
15+
1416
using namespace nbl;
1517
using namespace core;
1618
using namespace asset;
@@ -626,6 +628,24 @@ class DynamicTextureIndexingApp : public ApplicationBase
626628
queues[CommonAPI::InitOutput::EQT_GRAPHICS], renderFinished[resourceIx].get(), acquiredNextFBO);
627629
}
628630

631+
void onAppTerminated_impl() override
632+
{
633+
const auto& fboCreationParams = fbo[acquiredNextFBO]->getCreationParameters();
634+
auto gpuSourceImageView = fboCreationParams.attachments[0];
635+
636+
bool status = ext::ScreenShot::createScreenShot(
637+
logicalDevice.get(),
638+
queues[CommonAPI::InitOutput::EQT_TRANSFER_UP],
639+
renderFinished[resourceIx].get(),
640+
gpuSourceImageView.get(),
641+
assetManager.get(),
642+
"ScreenShot.png",
643+
asset::EIL_PRESENT_SRC,
644+
static_cast<asset::E_ACCESS_FLAGS>(0u));
645+
646+
assert(status);
647+
}
648+
629649
bool keepRunning() override
630650
{
631651
return windowCb->isWindowOpen();

examples_tests/27.PLYSTLDemo/main.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,16 @@ APP_CONSTRUCTOR(PLYSTLDemo)
391391
auto gpuSourceImageView = fboCreationParams.attachments[0];
392392

393393
//TODO:
394-
//bool status = ext::ScreenShot::createScreenShot(logicalDevice.get(), queues[CommonAPI::InitOutput<1u>::EQT_TRANSFER_UP], renderFinished[resourceIx].get(), gpuSourceImageView.get(), assetManager.get(), "ScreenShot.png");
395-
//assert(status);
394+
bool status = ext::ScreenShot::createScreenShot(
395+
logicalDevice.get(),
396+
queues[CommonAPI::InitOutput::EQT_TRANSFER_UP],
397+
renderFinished[resourceIx].get(),
398+
gpuSourceImageView.get(),
399+
assetManager.get(),
400+
"ScreenShot.png",
401+
asset::EIL_PRESENT_SRC,
402+
static_cast<asset::E_ACCESS_FLAGS>(0u));
403+
assert(status);
396404
}
397405

398406
void workLoopBody() override

examples_tests/48.ArithmeticUnitTest/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ class ArythmeticUnitTestApp : public NonGraphicalApplicationBase
300300
void onAppInitialized_impl() override
301301
{
302302
CommonAPI::InitOutput initOutput;
303-
CommonAPI::InitWithNoExt(initOutput, nbl::video::EAT_VULKAN, "Subgroup Arithmetic Test");
303+
CommonAPI::InitWithNoExt(initOutput, nbl::video::EAT_OPENGL, "Subgroup Arithmetic Test");
304304
gl = std::move(initOutput.apiConnection);
305305
gpuPhysicalDevice = std::move(initOutput.physicalDevice);
306306
logicalDevice = std::move(initOutput.logicalDevice);

0 commit comments

Comments
 (0)