aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChrisDill <chrisdude134@gmail.com>2018-09-29 14:10:29 +0100
committerChrisDill <chrisdude134@gmail.com>2018-09-29 14:10:29 +0100
commited95337eb884baac8de84ae0e973a5ecb0d530e2 (patch)
tree3fffedaca62fbe371fabed2c90afb052f0c4e4a7 /src
parented79d53e1a177596d312453db8db4bc69f2b8656 (diff)
downloadraylib-ed95337eb884baac8de84ae0e973a5ecb0d530e2.tar.gz
raylib-ed95337eb884baac8de84ae0e973a5ecb0d530e2.zip
Added platform check
- Added PLATFORM_DESKTOP check for Monitor functions to try to fix issue on android. - Not sure what return types should be when not on desktop. Added rough guess for now.
Diffstat (limited to 'src')
-rw-r--r--src/core.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/core.c b/src/core.c
index 9086ad65..65c18fec 100644
--- a/src/core.c
+++ b/src/core.c
@@ -773,50 +773,68 @@ int GetScreenHeight(void)
// Get number of monitors
int GetMonitorCount(void)
{
+#if defined(PLATFORM_DESKTOP)
int monitorCount;
glfwGetMonitors(&monitorCount);
return monitorCount;
+#endif
+ return 1;
}
// Get primary monitor width
int GetMonitorWidth(void)
{
+#if defined(PLATFORM_DESKTOP)
GLFWmonitor *monitor = glfwGetPrimaryMonitor();
const GLFWvidmode * mode = glfwGetVideoMode(monitor);
return mode->width;
+#endif
+ return GetScreenWidth();
}
// Get primary monitor height
int GetMonitorHeight(void)
{
+#if defined(PLATFORM_DESKTOP)
GLFWmonitor *monitor = glfwGetPrimaryMonitor();
const GLFWvidmode * mode = glfwGetVideoMode(monitor);
return mode->height;
+#endif
+ return GetScreenHeight();
}
// Get primary montior physical width in millimetres
int GetMonitorPhysicalWidth(void)
{
+#if defined(PLATFORM_DESKTOP)
int physicalWidth;
GLFWmonitor *monitor = glfwGetPrimaryMonitor();
glfwGetMonitorPhysicalSize(monitor, &physicalWidth, NULL);
return physicalWidth;
+#endif
+ return 0;
}
// Get primary monitor physical height in millimetres
int GetMonitorPhysicalHeight(void)
{
+#if defined(PLATFORM_DESKTOP)
int physicalHeight;
GLFWmonitor *monitor = glfwGetPrimaryMonitor();
glfwGetMonitorPhysicalSize(monitor, NULL, &physicalHeight);
return physicalHeight;
+#endif
+ return 0;
}
// Get the human-readable, UTF-8 encoded name of the primary monitor
const char *GetMonitorName(void)
{
+#if defined(PLATFORM_DESKTOP)
GLFWmonitor *monitor = glfwGetPrimaryMonitor();
return glfwGetMonitorName(monitor);
+#endif
+ return "";
}
// Show mouse cursor