Support Forum G3D Web Page |
Handles screenshot and video capture with managed filename generation and Journal output. More...
Public Member Functions | |
ScreenCapture (const shared_ptr< GuiTheme > &theme, GApp *app) | |
void | endVideoRecording () |
Ends video recording and automatically handles saving and prompting the use for Journal and filename confirmation. More... | |
String | getNextFilenameBase () |
Returns a uniquely generated path in the configured GApp::Settings::ScreenCapture::outputDirectory. More... | |
bool | isVideoRecording () |
void | onAfterGraphics2D (RenderDevice *rd) |
Used internally by GApp to capture frames. More... | |
void | onAfterGraphics3D (RenderDevice *rd) |
Used internally by GApp to capture frames. More... | |
String | saveCaptureAs (const String &path, const String &windowTitle="Save Capture", const shared_ptr< Texture > &preview=nullptr, bool flipPreview=false, const String &caption="") |
Prompts the use for a name to save the image or video as and then renames existing temporary file path to the one selected by the user. More... | |
void | saveImageGridToJournal (const String §ionTitle, const Array< shared_ptr< Texture >> &textureArray, int numColumns=3, bool addToSCM=true) |
Filenames and captions are taken from the textureArray. More... | |
void | startVideoRecording (const VideoOutput::Settings &settings, bool captureUI=true, bool skipFilenameDialog=false, const String &overrideSavePath=String()) |
Starts video recording. More... | |
void | takeScreenshot (const String &type="jpg", bool captureUI=true, bool skipFilenameDialog=false, const String &overrideSavePath=String()) |
Takes a screenshot and automatically handles saving and prompting the user for Journal and filename confirmation. More... | |
Static Public Member Functions | |
static void | checkAppScmRevision (const String &outputDirectory) |
Handles screenshot and video capture with managed filename generation and Journal output.
Allows for easy capture of screenshots and videos to a central directory. Can be safely used separate from the DeveloperWindow GUI to save captures to the same location. Each capture is given a unique generated filename. Allows a single screenshot or video capture at one time.
Will automatically detect a Journal in the output directory and enable saving Journal entries.
Will automatically detect if app is in an svn repository (if configured) and allow including app svn revision to filenames as well as adding captures to the svn repository via the Journal dialog.
|
static |
void G3D::ScreenCapture::endVideoRecording | ( | ) |
String G3D::ScreenCapture::getNextFilenameBase | ( | ) |
Returns a uniquely generated path in the configured GApp::Settings::ScreenCapture::outputDirectory.
Does not contain extension.
bool G3D::ScreenCapture::isVideoRecording | ( | ) |
void G3D::ScreenCapture::onAfterGraphics2D | ( | RenderDevice * | rd | ) |
Used internally by GApp to capture frames.
void G3D::ScreenCapture::onAfterGraphics3D | ( | RenderDevice * | rd | ) |
Used internally by GApp to capture frames.
String G3D::ScreenCapture::saveCaptureAs | ( | const String & | path, |
const String & | windowTitle = "Save Capture" , |
||
const shared_ptr< Texture > & | preview = nullptr , |
||
bool | flipPreview = false , |
||
const String & | caption = "" |
||
) |
Prompts the use for a name to save the image or video as and then renames existing temporary file path to the one selected by the user.
Will modify Journal (if found) and handle source control changes (if selected). Will delete the file if the dialog is cancelled.
If called too soon (less than 1-2 seconds) after startup, s_appScmIsSvn and s_appScmRevision may not yet be initialized, as they are initialized on a detached thread.
void G3D::ScreenCapture::saveImageGridToJournal | ( | const String & | sectionTitle, |
const Array< shared_ptr< Texture >> & | textureArray, | ||
int | numColumns = 3 , |
||
bool | addToSCM = true |
||
) |
Filenames and captions are taken from the textureArray.
void G3D::ScreenCapture::startVideoRecording | ( | const VideoOutput::Settings & | settings, |
bool | captureUI = true , |
||
bool | skipFilenameDialog = false , |
||
const String & | overrideSavePath = String() |
||
) |
Starts video recording.
type | The screenshot file format saved and file extension. Can use file format supported by Image. |
captureUI | Whether to include the 2D GUI in the screenshot. |
skipFilenameDialog | Where to automatically accept the generated filename and skip showing Journal and filename dialog. |
overrideSavePath | Force screenshot to save to this path. Can be used with skipFilenameDialog to avoid changing path. |
void G3D::ScreenCapture::takeScreenshot | ( | const String & | type = "jpg" , |
bool | captureUI = true , |
||
bool | skipFilenameDialog = false , |
||
const String & | overrideSavePath = String() |
||
) |
Takes a screenshot and automatically handles saving and prompting the user for Journal and filename confirmation.
Will modify Journal (if found) and handle source control changes (if selected). Will remove file if dialog was cancelled.
type | The screenshot file format saved and file extension. Can use file format supported by Image. |
captureUI | Whether to include the 2D GUI in the screenshot. |
skipFilenameDialog | Where to automatically accept the generated filename and skip showing Journal and Save As dialog. |
overrideSavePath | Force screenshot to save to this path. Can be used with skipFilenameDialog to avoid changing path. |