projectM-visualizer / projectm

projectM - Cross-platform Music Visualization Library. Open-source and Milkdrop-compatible.
https://discord.gg/mMrxAqaa3W
GNU Lesser General Public License v2.1
3.22k stars 365 forks source link

Add API call to supply a "burn-in" texture for the next frame #794

Open kblaschke opened 3 months ago

kblaschke commented 3 months ago

Milkdrop has two places where it "burns" something into the preset main image:

Displaying of user sprites will be handled by projectM (see #734), but title text display and other effects are not. So it will make sense to add an API call that gives applications the possibility to burn any texture into the current preset image.

As the texture might not be filling the whole screen, the API call should have parameters to provide rectangle coordinates (in texels relative to the drawing surface) where to apply the texture on the preset image.

The new API call should go into the render_opengl.h header, with a signature similar to this:

PROJECTM_EXPORT void projectm_opengl_burn_texture(GLuint texture, int left, int top, int width, int height);

The given texture would then be drawn once onto the active preset(s) main texture during the next call to projectm_opengl_render_frame(), right before the composite shader is applied.