Feature/serve screenshots (#1003)

* Take screnshots using lua function, returning screenshot number. Add screenshot endpoint.
* Change capitalization from screenShot to screenshot
* Fix screenshot filename collision bug when using multiple windows.
This commit is contained in:
Emil Axelsson
2019-11-01 10:41:59 +01:00
committed by GitHub
parent c96794bf27
commit afb889ff82
10 changed files with 89 additions and 54 deletions
+1 -1
View File
@@ -107,7 +107,7 @@ struct WindowDelegate {
bool (*isFisheyeRendering)() = []() { return false; };
void (*takeScreenshot)(bool applyWarping) = [](bool) { };
unsigned int(*takeScreenshot)(bool applyWarping) = [](bool) { return 0u; };
void (*swapBuffer)() = []() {};
+8 -4
View File
@@ -142,9 +142,14 @@ public:
void setResolveData(ghoul::Dictionary resolveData);
/**
* Mark that one screenshot should be taken
* Take a screenshot and store in the ${SCREENSHOTS} directory
*/
void takeScreenShot();
void takeScreenshot();
/**
* Get the filename of the latest screenshot
*/
unsigned int latestScreenshotNumber() const;
/**
* Returns the Lua library that contains all Lua functions available to affect the
@@ -187,8 +192,6 @@ private:
properties::BoolProperty _showVersionInfo;
properties::BoolProperty _showCameraInfo;
properties::TriggerProperty _takeScreenshot;
bool _shouldTakeScreenshot = false;
properties::BoolProperty _applyWarping;
properties::BoolProperty _showFrameInformation;
#ifdef OPENSPACE_WITH_INSTRUMENTATION
@@ -226,6 +229,7 @@ private:
properties::Vec3Property _masterRotation;
uint64_t _frameNumber = 0;
unsigned int _latestScreenshotNumber = 0;
std::vector<ghoul::opengl::ProgramObject*> _programs;