Skip to content

Commit fa532ed

Browse files
committed
Add API function for texture burn-in
1 parent e66b110 commit fa532ed

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

src/api/include/projectM-4/render_opengl.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,21 @@ PROJECTM_EXPORT void projectm_opengl_render_frame(projectm_handle instance);
4848
*/
4949
PROJECTM_EXPORT void projectm_opengl_render_frame_fbo(projectm_handle instance, uint32_t framebuffer_object_id);
5050

51+
/**
52+
* @brief Burn-in the provided texture into the active preset(s) main texture.
53+
*
54+
* During transitions, the image is drawn onto both active presets.
55+
*
56+
* @param instance The projectM instance handle.
57+
* @param texture The OpenGL texture ID to draw onto the current preset.
58+
* @param left The left offset in screen coordinates.
59+
* @param top The top offset in screen coordinates.
60+
* @param width The width in screen coordinates. Negative values will flip the image horizontally.
61+
* @param height The height in screen coordinates. Negative values will flip the image vertically.
62+
* @since 4.2.0
63+
*/
64+
PROJECTM_EXPORT void projectm_opengl_burn_texture(projectm_handle instance, uint32_t texture, int left, int top, int width, int height);
65+
5166
#ifdef __cplusplus
5267
} // extern "C"
5368
#endif

src/libprojectM/ProjectMCWrapper.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,12 @@ void projectm_opengl_render_frame_fbo(projectm_handle instance, uint32_t framebu
180180
projectMInstance->RenderFrame(framebuffer_object_id);
181181
}
182182

183+
void projectm_opengl_burn_texture(projectm_handle instance, uint32_t texture, int left, int top, int width, int height)
184+
{
185+
auto projectMInstance = handle_to_instance(instance);
186+
projectMInstance->BurnInTexture(texture, left, top, width, height);
187+
}
188+
183189
void projectm_set_frame_time(projectm_handle instance, double seconds_since_first_frame)
184190
{
185191
auto projectMInstance = handle_to_instance(instance);

0 commit comments

Comments
 (0)