Added deprecation for pixel_put functions (OFF BY DEFAULT) as well as warnings in their descriptions

This commit is contained in:
Daemo
2026-08-09 02:56:36 +02:00
parent 83b9f8f9da
commit 0491089463
3 changed files with 29 additions and 0 deletions
+7
View File
@@ -85,7 +85,12 @@ MLX_API void mlx_restore_window(mlx_context mlx, mlx_window win);
* @param y Y coordinate
* @param pixels Array of pixels
* @param pixels_number Number of pixels
*
* Note: it is responsability of the user to make sure the size of `pixels` is
* big enough for the given array.
* WARNING: This function isn't performant, consider drawing to an image beforehand.
*/
MLX_DEPRECATED("Use an image rather than directly communicating with the window")
MLX_API void mlx_pixel_put_array(mlx_context mlx, mlx_window win, int x, int y, mlx_color* pixels, size_t pixels_number);
/**
@@ -101,7 +106,9 @@ MLX_API void mlx_pixel_put_array(mlx_context mlx, mlx_window win, int x, int y,
*
* Note: it is responsability of the user to make sure the size of `pixels` is
* big enough for the given region.
* WARNING: This function isn't performant, consider drawing to an image beforehand.
*/
MLX_DEPRECATED("Use an image rather than directly communicating with the window")
MLX_API void mlx_pixel_put_region(mlx_context mlx, mlx_window win, int x, int y, int w, int h, mlx_color* pixels);