fixing allocation issues with texts

This commit is contained in:
2024-01-18 13:57:41 +01:00
parent 208b0e4710
commit dd0599c088
28 changed files with 303 additions and 134 deletions

0
example/build.sh git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/04 17:55:21 by maldavid #+# #+# */
/* Updated: 2024/01/16 08:03:37 by maldavid ### ########.fr */
/* Updated: 2024/01/18 09:58:15 by maldavid ### ########.fr */
/* */
/* ************************************************************************** */
@@ -135,25 +135,25 @@ int main(void)
mlx_on_event(mlx.mlx, mlx.win, MLX_KEYDOWN, key_hook, &mlx);
mlx_on_event(mlx.mlx, mlx.win, MLX_WINDOW_EVENT, window_hook, &mlx);
mlx.logo_png = mlx_png_file_to_image(mlx.mlx, "42_logo.png", &dummy, &dummy);
mlx.logo_bmp = mlx_bmp_file_to_image(mlx.mlx, "42_logo.bmp", &dummy, &dummy);
mlx.logo_jpg = mlx_jpg_file_to_image(mlx.mlx, "42_logo.jpg", &dummy, &dummy);
mlx_pixel_put(mlx.mlx, mlx.win, 200, 10, 0xFFFF00FF);
mlx_put_image_to_window(mlx.mlx, mlx.win, mlx.logo_png, 10, 190);
mlx.img = create_image(&mlx);
mlx_string_put(mlx.mlx, mlx.win, 20, 20, 0xFF0020FF, "that text will disappear");
mlx_set_font_scale(mlx.mlx, mlx.win, "font.ttf", 16.f);
mlx_string_put(mlx.mlx, mlx.win, 20, 20, 0xFF0020FF, "that text will disappear");
mlx_loop_hook(mlx.mlx, update, &mlx);
mlx_loop(mlx.mlx);
mlx_get_screens_size(mlx.mlx, &w, &h);
mlx_get_screens_size(mlx.mlx, mlx.win, &w, &h);
printf("screen size : %dx%d\n", w, h);
mlx_destroy_image(mlx.mlx, mlx.logo_png);
mlx_destroy_image(mlx.mlx, mlx.logo_jpg);
mlx_destroy_image(mlx.mlx, mlx.logo_bmp);

0
example/run.sh git.filemode.changed_filemode%!(EXTRA template.HTML=git.filemode.normal_file, template.HTML=git.filemode.executable_file)
View File