Let developers provide an optional filename for dumping main texture contents.

This commit is contained in:
Kai Blaschke
2023-01-25 14:15:58 +01:00
parent 45d05b71d0
commit 2b41fa256a
6 changed files with 64 additions and 39 deletions

View File

@ -32,13 +32,23 @@ extern "C" {
#endif
/**
* @brief Writes a .bmp framedump after rendering the next main texture, before shaders are applied.
* @brief Writes a .bmp main texture dump after rendering the next main texture, before shaders are applied.
*
* The image is written to the current working directory and is named "frame_texture_contents-[date].bmp".
* If no file name is given, the image is written to the current working directory
* and will be named named "frame_texture_contents-YYYY-mm-dd-HH:MM:SS-frame.bmp".
*
* Note this is the main texture contents, not the final rendering result. If the active preset
* uses a composite shader, the dumped image will not have it applied. The main texture is what is
* passed over to the next frame, the composite shader is only applied to the display framebuffer
* after updating the main texture.
*
* To capture the actual output, dump the contents of the main framebuffer after calling
* @a projectm_render_frame() on the application side.
*
* @param instance The projectM instance handle.
* @param output_file The filename to write the dump to or NULL.
*/
PROJECTM_EXPORT void projectm_write_debug_image_on_next_frame(projectm_handle instance);
PROJECTM_EXPORT void projectm_write_debug_image_on_next_frame(projectm_handle instance, const char* output_file);
#ifdef __cplusplus
} // extern "C"