4 Commits
Author SHA1 Message Date
DaemoandGitHub d276899e8b changed mlx_put_transformed_image_to_window to use float position (#243)
Using integer positions (x and y), the displayed image could suffer from
rounding errors with rotation. Leading to jittering on most dynamically
resized images trying to fit the window while rotating (common
optimization done in projects like Cub3D). This PR aims to fix this
issue by using float parameters for positioning in the function
2026-08-12 19:30:53 +02:00
DaemoandGitHub 63fe3088bf Fix inconsistencies with the FPS scheduler (#241)
The current Fps manager will sometime skip the intended delay and start
the next frame immediately, I'm not 100% sure why it happens, but I
rewrote most of it to stay consistent and improved the overall precision
by compensating for OS wake delay after sleep and finishing with a busy
wait
I also changed the behavior of mlx_set_fps_goal to allow zero/negative
values and treat them as uncapped (like most graphics libraries)
2026-08-08 15:45:56 +02:00
DaemoandGitHub c9df651a14 Optimized region drawing and fixed incorrect region clipping (#240)
Made small optimizations to Texture's SetRegion, SetLinearRegion,
GetRegion and Clear. They might not be super effective depending on how
the compiler already optimized them. The optimizations mainly focus on
removing the multiplication when transforming a position to an index by
using the row index rather than the y coordinate during iteration.
Also fixed regions not drawing properly when clipping against the sides
of a window and made GetRegion reject any region that isn't fully inside
of the window (previously accepted regions that clipped outside of the
right and bottom side, possibly leading to incorrect reads on the user
end due to desynchronized region dimensions)
2026-08-07 12:31:13 +02:00
DaemoandGitHub 2d0c02ae7e Fix freeze when resizing a window (#239)
Fixed an annoying bug where the application would freeze when resizing
the window
This pull request made it so the SDL window's resizing event now
broadcasts a new event specifically asking the swapchain to recreate
itself, which will in turn broadcast the original event when done. It
also removed the Event enum specific values, as they were irrelevant.
2026-08-07 00:18:52 +02:00