mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-27 14:29:37 -05:00
Update SGCT to enable taking screenshots of individual windows
This commit is contained in:
+1
-1
Submodule apps/OpenSpace/ext/sgct updated: 5e74f324e4...138e0b2065
@@ -865,11 +865,11 @@ void setSgctDelegateFunctions() {
|
||||
currentWindow->viewports().front()->nonLinearProjection()
|
||||
) != nullptr;
|
||||
};
|
||||
sgctDelegate.takeScreenshot = [](bool applyWarping) {
|
||||
sgctDelegate.takeScreenshot = [](bool applyWarping, std::vector<int> windowIds) {
|
||||
ZoneScoped
|
||||
|
||||
Settings::instance().setCaptureFromBackBuffer(applyWarping);
|
||||
Engine::instance().takeScreenshot();
|
||||
Engine::instance().takeScreenshot(std::move(windowIds));
|
||||
return Engine::instance().screenShotNumber();
|
||||
};
|
||||
sgctDelegate.swapBuffer = []() {
|
||||
|
||||
@@ -76,7 +76,8 @@ struct WindowDelegate {
|
||||
|
||||
bool (*isFisheyeRendering)() = []() { return false; };
|
||||
|
||||
unsigned int (*takeScreenshot)(bool applyWarping) = [](bool) { return 0u; };
|
||||
unsigned int (*takeScreenshot)(bool applyWarping, std::vector<int> windowIds) =
|
||||
[](bool, std::vector<int>) { return 0u; };
|
||||
|
||||
void (*swapBuffer)() = []() {};
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <openspace/properties/propertyowner.h>
|
||||
|
||||
#include <openspace/properties/optionproperty.h>
|
||||
#include <openspace/properties/list/intlistproperty.h>
|
||||
#include <openspace/properties/scalar/boolproperty.h>
|
||||
#include <openspace/properties/scalar/intproperty.h>
|
||||
#include <openspace/properties/scalar/floatproperty.h>
|
||||
@@ -177,6 +178,7 @@ private:
|
||||
properties::BoolProperty _showVersionInfo;
|
||||
properties::BoolProperty _showCameraInfo;
|
||||
|
||||
properties::IntListProperty _screenshotWindowIds;
|
||||
properties::BoolProperty _applyWarping;
|
||||
properties::BoolProperty _screenshotUseDate;
|
||||
properties::BoolProperty _showFrameInformation;
|
||||
|
||||
@@ -130,6 +130,14 @@ namespace {
|
||||
"shown on the screen"
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo ScreenshotWindowIdsInfo = {
|
||||
"ScreenshotWindowId",
|
||||
"Screenshow Window Ids",
|
||||
"The list of window identifiers whose screenshot will be taken the next time "
|
||||
"anyone triggers a screenshot. If this list is empty (the default), all windows "
|
||||
"will have their screenshot taken. Id's that do not exist are silently ignored."
|
||||
};
|
||||
|
||||
constexpr openspace::properties::Property::PropertyInfo ApplyWarpingInfo = {
|
||||
"ApplyWarpingScreenshot",
|
||||
"Apply Warping to Screenshots",
|
||||
@@ -277,6 +285,7 @@ RenderEngine::RenderEngine()
|
||||
, _verticalLogOffset(VerticalLogOffsetInfo, 0.f, 0.f, 1.f)
|
||||
, _showVersionInfo(ShowVersionInfo, true)
|
||||
, _showCameraInfo(ShowCameraInfo, true)
|
||||
, _screenshotWindowIds(ScreenshotWindowIdsInfo)
|
||||
, _applyWarping(ApplyWarpingInfo, false)
|
||||
, _screenshotUseDate(ScreenshotUseDateInfo, false)
|
||||
, _showFrameInformation(ShowFrameNumberInfo, false)
|
||||
@@ -342,6 +351,7 @@ RenderEngine::RenderEngine()
|
||||
addProperty(_value);
|
||||
|
||||
addProperty(_globalBlackOutFactor);
|
||||
addProperty(_screenshotWindowIds);
|
||||
addProperty(_applyWarping);
|
||||
|
||||
_screenshotUseDate.onChange([this]() {
|
||||
@@ -1046,7 +1056,10 @@ void RenderEngine::takeScreenshot() {
|
||||
std::filesystem::create_directories(absPath("${SCREENSHOTS}"));
|
||||
}
|
||||
|
||||
_latestScreenshotNumber = global::windowDelegate->takeScreenshot(_applyWarping);
|
||||
_latestScreenshotNumber = global::windowDelegate->takeScreenshot(
|
||||
_applyWarping,
|
||||
_screenshotWindowIds
|
||||
);
|
||||
}
|
||||
|
||||
unsigned int RenderEngine::latestScreenshotNumber() const {
|
||||
|
||||
Reference in New Issue
Block a user