Skip to content

Conversation

@revmischa
Copy link
Member

Adds option to skip the initial texture copy when transitioning to new presets.

When enabled via projectm_set_preset_start_clean(true), the previous
frame's texture is not drawn as the initial state for the new preset.
This provides a clean black canvas instead, which some applications may prefer.

Fixes #298

Adds projectm_set_preset_start_clean() and projectm_get_preset_start_clean()
functions to control whether new presets start with a black canvas or inherit
the previous preset's last frame.

Default behavior remains unchanged (copy previous frame), but applications
can now opt-in to clean starts by setting this flag to true.

Fixes #298
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a configurable flag to control whether newly loaded presets start from a clean black canvas instead of seeding from the previous frame, exposed through both the C++ and C APIs.

Changes:

  • Introduces an internal m_presetStartClean flag in ProjectM, with corresponding setter/getter, defaulting to false.
  • Updates ProjectM::StartPresetTransition so the initial texture copy from the previous preset is skipped when m_presetStartClean is enabled.
  • Exposes this behavior through new C API functions projectm_set_preset_start_clean / projectm_get_preset_start_clean in the public header and C wrapper.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/libprojectM/ProjectMCWrapper.cpp Adds C wrapper functions mapping the new preset-start-clean flag to the underlying ProjectM instance.
src/libprojectM/ProjectM.hpp Declares the SetPresetStartClean/PresetStartClean API and adds the m_presetStartClean member with documentation.
src/libprojectM/ProjectM.cpp Implements the new setter/getter and gates the initial texture copy in StartPresetTransition on m_presetStartClean.
src/api/include/projectM-4/parameters.h Extends the public C API with documented functions to set/get the preset-start-clean behavior, including @since 4.2.0 tags.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Add flag to C API to start newly loaded presets with a clean canvas if set

1 participant