summaryrefslogtreecommitdiffhomepage
path: root/src/core.c
diff options
context:
space:
mode:
authorraysan5 <[email protected]>2021-02-07 20:47:40 +0100
committerraysan5 <[email protected]>2021-02-07 20:47:40 +0100
commit090c790e50a0e3607197538882d35628329be297 (patch)
tree7ade002b63e7713fbe422a19eacf3e2fec72322e /src/core.c
parent6be1be4573f18e39976308a41603289f90d712f3 (diff)
downloadraylib-090c790e50a0e3607197538882d35628329be297.tar.gz
raylib-090c790e50a0e3607197538882d35628329be297.zip
Review formating for latest PR
Diffstat (limited to 'src/core.c')
-rw-r--r--src/core.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/core.c b/src/core.c
index 8efb900c..1696c41e 100644
--- a/src/core.c
+++ b/src/core.c
@@ -1528,7 +1528,7 @@ Vector2 GetMonitorPosition(int monitor)
return (Vector2){ 0, 0 };
}
-// Get selected monitor width
+// Get selected monitor width (max available by monitor)
int GetMonitorWidth(int monitor)
{
#if defined(PLATFORM_DESKTOP)
@@ -1540,17 +1540,16 @@ int GetMonitorWidth(int monitor)
int count = 0;
const GLFWvidmode *modes = glfwGetVideoModes(monitors[monitor], &count);
- if(count > 0)
- {
- return modes[count - 1].width;
- } else TRACELOG(LOG_WARNING, "GLFW: Failed to find video mode for selected monitor");
+ // We return the maximum resolution available, the last one in the modes array
+ if (count > 0) return modes[count - 1].width;
+ else TRACELOG(LOG_WARNING, "GLFW: Failed to find video mode for selected monitor");
}
else TRACELOG(LOG_WARNING, "GLFW: Failed to find selected monitor");
#endif
return 0;
}
-// Get selected monitor width
+// Get selected monitor width (max available by monitor)
int GetMonitorHeight(int monitor)
{
#if defined(PLATFORM_DESKTOP)
@@ -1562,10 +1561,9 @@ int GetMonitorHeight(int monitor)
int count = 0;
const GLFWvidmode *modes = glfwGetVideoModes(monitors[monitor], &count);
- if(count > 0)
- {
- return modes[count - 1].height;
- } else TRACELOG(LOG_WARNING, "GLFW: Failed to find video mode for selected monitor");
+ // We return the maximum resolution available, the last one in the modes array
+ if (count > 0) return modes[count - 1].height;
+ else TRACELOG(LOG_WARNING, "GLFW: Failed to find video mode for selected monitor");
}
else TRACELOG(LOG_WARNING, "GLFW: Failed to find selected monitor");
#endif