3 Commits

Author SHA1 Message Date
fafa2cea97 [raymath] Fix MatrixCompose() rotating vectors with already overwritten components (#6187) 2026-09-25 07:45:50 +02:00
0152c69b95 [rcore][SDL] define DROP_EVENT_DATA in sdl (#6185)
* define DROP_EVENT_DATA in sdl

* drop the define entirely and use event.drop directly
2026-09-25 07:42:58 +02:00
5c41230605 [rcore][win32] Fix IsWindowResized always returning true (#6186) 2026-09-25 07:39:56 +02:00
3 changed files with 22 additions and 15 deletions

View File

@ -1506,14 +1506,14 @@ void PollInputEvents(void)
if (CORE.Window.dropFilepaths[CORE.Window.dropFileCount] != NULL)
{
// Copy the path data from SDL to our internal list
snprintf(CORE.Window.dropFilepaths[CORE.Window.dropFileCount], MAX_FILEPATH_LENGTH, "%s", DROP_EVENT_DATA);
#if defined(USING_VERSION_SDL3)
snprintf(CORE.Window.dropFilepaths[CORE.Window.dropFileCount], MAX_FILEPATH_LENGTH, "%s", event.drop.data);
#else
snprintf(CORE.Window.dropFilepaths[CORE.Window.dropFileCount], MAX_FILEPATH_LENGTH, "%s", event.drop.file);
SDL_free(event.drop.file); // Only SDL2 needs to free, SDL3 keeps track internally
#endif
CORE.Window.dropFileCount++;
}
// NOTE: SDL3 will handle path freeing internally
#ifndef USING_VERSION_SDL3
SDL_free(event.drop.file);
#endif
}
} break;

View File

@ -1383,6 +1383,8 @@ void PollInputEvents(void)
// Register previous mouse position
CORE.Input.Mouse.previousPosition = CORE.Input.Mouse.currentPosition;
CORE.Window.resizedLastFrame = false;
// Process windows messages
MSG msg = { 0 };
while (PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE))
@ -1676,6 +1678,7 @@ int InitPlatform(void)
// Update flags (in case of deferred state change required)
UpdateFlags(platform.hwnd, platform.desiredFlags, platform.appScreenWidth, platform.appScreenHeight);
CORE.Window.resizedLastFrame = false;
CORE.Window.render.width = CORE.Window.screen.width;
CORE.Window.render.height = CORE.Window.screen.height;
CORE.Window.currentFbo.width = CORE.Window.render.width;

View File

@ -2675,20 +2675,24 @@ RMAPI Matrix MatrixCompose(Vector3 translation, Quaternion rotation, Vector3 sca
forward.z *= scale.z;
// Rotate vectors
// NOTE: A copy of each vector is required, every rotated component depends on all original components
Vector3 temp = right;
//right = Vector3RotateByQuaternion(right, rotation);
right.x = right.x*(rotation.x*rotation.x + rotation.w*rotation.w - rotation.y*rotation.y - rotation.z*rotation.z) + right.y*(2*rotation.x*rotation.y - 2*rotation.w*rotation.z) + right.z*(2*rotation.x*rotation.z + 2*rotation.w*rotation.y);
right.y = right.x*(2*rotation.w*rotation.z + 2*rotation.x*rotation.y) + right.y*(rotation.w*rotation.w - rotation.x*rotation.x + rotation.y*rotation.y - rotation.z*rotation.z) + right.z*(-2*rotation.w*rotation.x + 2*rotation.y*rotation.z);
right.z = right.x*(-2*rotation.w*rotation.y + 2*rotation.x*rotation.z) + right.y*(2*rotation.w*rotation.x + 2*rotation.y*rotation.z)+ right.z*(rotation.w*rotation.w - rotation.x*rotation.x - rotation.y*rotation.y + rotation.z*rotation.z);
right.x = temp.x*(rotation.x*rotation.x + rotation.w*rotation.w - rotation.y*rotation.y - rotation.z*rotation.z) + temp.y*(2*rotation.x*rotation.y - 2*rotation.w*rotation.z) + temp.z*(2*rotation.x*rotation.z + 2*rotation.w*rotation.y);
right.y = temp.x*(2*rotation.w*rotation.z + 2*rotation.x*rotation.y) + temp.y*(rotation.w*rotation.w - rotation.x*rotation.x + rotation.y*rotation.y - rotation.z*rotation.z) + temp.z*(-2*rotation.w*rotation.x + 2*rotation.y*rotation.z);
right.z = temp.x*(-2*rotation.w*rotation.y + 2*rotation.x*rotation.z) + temp.y*(2*rotation.w*rotation.x + 2*rotation.y*rotation.z)+ temp.z*(rotation.w*rotation.w - rotation.x*rotation.x - rotation.y*rotation.y + rotation.z*rotation.z);
temp = up;
//up = Vector3RotateByQuaternion(up, rotation);
up.x = up.x*(rotation.x*rotation.x + rotation.w*rotation.w - rotation.y*rotation.y - rotation.z*rotation.z) + up.y*(2*rotation.x*rotation.y - 2*rotation.w*rotation.z) + up.z*(2*rotation.x*rotation.z + 2*rotation.w*rotation.y);
up.y = up.x*(2*rotation.w*rotation.z + 2*rotation.x*rotation.y) + up.y*(rotation.w*rotation.w - rotation.x*rotation.x + rotation.y*rotation.y - rotation.z*rotation.z) + up.z*(-2*rotation.w*rotation.x + 2*rotation.y*rotation.z);
up.z = up.x*(-2*rotation.w*rotation.y + 2*rotation.x*rotation.z) + up.y*(2*rotation.w*rotation.x + 2*rotation.y*rotation.z)+ up.z*(rotation.w*rotation.w - rotation.x*rotation.x - rotation.y*rotation.y + rotation.z*rotation.z);
up.x = temp.x*(rotation.x*rotation.x + rotation.w*rotation.w - rotation.y*rotation.y - rotation.z*rotation.z) + temp.y*(2*rotation.x*rotation.y - 2*rotation.w*rotation.z) + temp.z*(2*rotation.x*rotation.z + 2*rotation.w*rotation.y);
up.y = temp.x*(2*rotation.w*rotation.z + 2*rotation.x*rotation.y) + temp.y*(rotation.w*rotation.w - rotation.x*rotation.x + rotation.y*rotation.y - rotation.z*rotation.z) + temp.z*(-2*rotation.w*rotation.x + 2*rotation.y*rotation.z);
up.z = temp.x*(-2*rotation.w*rotation.y + 2*rotation.x*rotation.z) + temp.y*(2*rotation.w*rotation.x + 2*rotation.y*rotation.z)+ temp.z*(rotation.w*rotation.w - rotation.x*rotation.x - rotation.y*rotation.y + rotation.z*rotation.z);
temp = forward;
//forward = Vector3RotateByQuaternion(forward, rotation);
forward.x = forward.x*(rotation.x*rotation.x + rotation.w*rotation.w - rotation.y*rotation.y - rotation.z*rotation.z) + forward.y*(2*rotation.x*rotation.y - 2*rotation.w*rotation.z) + forward.z*(2*rotation.x*rotation.z + 2*rotation.w*rotation.y);
forward.y = forward.x*(2*rotation.w*rotation.z + 2*rotation.x*rotation.y) + forward.y*(rotation.w*rotation.w - rotation.x*rotation.x + rotation.y*rotation.y - rotation.z*rotation.z) + forward.z*(-2*rotation.w*rotation.x + 2*rotation.y*rotation.z);
forward.z = forward.x*(-2*rotation.w*rotation.y + 2*rotation.x*rotation.z) + forward.y*(2*rotation.w*rotation.x + 2*rotation.y*rotation.z)+ forward.z*(rotation.w*rotation.w - rotation.x*rotation.x - rotation.y*rotation.y + rotation.z*rotation.z);
forward.x = temp.x*(rotation.x*rotation.x + rotation.w*rotation.w - rotation.y*rotation.y - rotation.z*rotation.z) + temp.y*(2*rotation.x*rotation.y - 2*rotation.w*rotation.z) + temp.z*(2*rotation.x*rotation.z + 2*rotation.w*rotation.y);
forward.y = temp.x*(2*rotation.w*rotation.z + 2*rotation.x*rotation.y) + temp.y*(rotation.w*rotation.w - rotation.x*rotation.x + rotation.y*rotation.y - rotation.z*rotation.z) + temp.z*(-2*rotation.w*rotation.x + 2*rotation.y*rotation.z);
forward.z = temp.x*(-2*rotation.w*rotation.y + 2*rotation.x*rotation.z) + temp.y*(2*rotation.w*rotation.x + 2*rotation.y*rotation.z)+ temp.z*(rotation.w*rotation.w - rotation.x*rotation.x - rotation.y*rotation.y + rotation.z*rotation.z);
// Set result matrix output
Matrix result = {