Issue#130 (#546)

* Fixes issue projectM-visualizer/projectm#130

Adds functionality of writing a rendered frame to file
as requested by the issue https://github.com/projectM-visualizer/projectm/issues/130.

Keyhandler.cpp has been updated to handle the keydown of 'd',
which triggers writeNextFrameToFile to be set to true, which means
at the end of Renderer::FinishPass1 we write the texture contents to file.

Renderer::debugWriteMainTextureToFile() const contains the functionality
of writing the contents of the main texture.

* Addition to commit that fixes projectM-visualizer/projectm#130

Safe file write, making sure we don't overflow while creating
the filename. If c++20 features was enabled, this could
look so, so much better.

* Added keybinding to README doc

* Formatting
Fixed snake_case to camelCase
Changed delete to delete[]
Turned magic constant to a named variable
This commit is contained in:
theIDinside
2021-10-23 21:22:49 +02:00
committed by GitHub
parent 844678472e
commit e2d265f038
4 changed files with 130 additions and 59 deletions

View File

@ -311,6 +311,9 @@ void projectM::default_key_handler( projectMEvent event, projectMKeycode keycode
renderer->studio = !renderer->studio;
case PROJECTM_K_i:
break;
case PROJECTM_K_d: // d stands for write DEBUG output.
renderer->writeNextFrameToFile = true;
break;
case PROJECTM_K_RETURN:
renderer->toggleSearchText();
if (renderer->showsearch) {