Skip to content

Commit

Permalink
Fixes casting warnings with RGFW platform. (#4534)
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffM2501 authored Nov 24, 2024
1 parent e494c54 commit 6141489
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/platforms/rcore_desktop_rgfw.c
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ Vector2 GetMonitorPosition(int monitor)
{
RGFW_monitor *mons = RGFW_getMonitors();

return (Vector2){mons[monitor].rect.x, mons[monitor].rect.y};
return (Vector2){(float)mons[monitor].rect.x, (float)mons[monitor].rect.y};
}

// Get selected monitor width (currently used by monitor)
Expand All @@ -611,15 +611,15 @@ int GetMonitorPhysicalWidth(int monitor)
{
RGFW_monitor* mons = RGFW_getMonitors();

return mons[monitor].physW;
return (int)mons[monitor].physW;
}

// Get selected monitor physical height in millimetres
int GetMonitorPhysicalHeight(int monitor)
{
RGFW_monitor *mons = RGFW_getMonitors();

return mons[monitor].physH;
return (int)mons[monitor].physH;
}

// Get selected monitor refresh rate
Expand All @@ -640,7 +640,7 @@ const char *GetMonitorName(int monitor)
// Get window position XY on monitor
Vector2 GetWindowPosition(void)
{
return (Vector2){ platform.window->r.x, platform.window->r.y };
return (Vector2){ (float)platform.window->r.x, (float)platform.window->r.y };
}

// Get window scale DPI factor for current monitor
Expand All @@ -654,7 +654,7 @@ Vector2 GetWindowScaleDPI(void)
// Set clipboard text content
void SetClipboardText(const char *text)
{
RGFW_writeClipboard(text, strlen(text));
RGFW_writeClipboard(text, (u32)strlen(text));
}

// Get clipboard text content
Expand Down Expand Up @@ -947,7 +947,7 @@ void PollInputEvents(void)
case RGFW_quit: CORE.Window.shouldClose = true; break;
case RGFW_dnd: // Dropped file
{
for (int i = 0; i < event->droppedFilesCount; i++)
for (u32 i = 0; i < event->droppedFilesCount; i++)
{
if (CORE.Window.dropFileCount == 0)
{
Expand Down Expand Up @@ -1031,7 +1031,7 @@ void PollInputEvents(void)
{
if ((event->button == RGFW_mouseScrollUp) || (event->button == RGFW_mouseScrollDown))
{
CORE.Input.Mouse.currentWheelMove.y = event->scroll;
CORE.Input.Mouse.currentWheelMove.y = (float)event->scroll;
break;
}

Expand All @@ -1050,7 +1050,7 @@ void PollInputEvents(void)

if ((event->button == RGFW_mouseScrollUp) || (event->button == RGFW_mouseScrollDown))
{
CORE.Input.Mouse.currentWheelMove.y = event->scroll;
CORE.Input.Mouse.currentWheelMove.y = (float)event->scroll;
break;
}

Expand Down

0 comments on commit 6141489

Please sign in to comment.