Browse Source

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.
pull/650/head
ChrisDill 6 years ago
parent
commit
ed95337eb8
1 changed files with 18 additions and 0 deletions
  1. +18
    -0
      src/core.c

+ 18
- 0
src/core.c View File

@ -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

Loading…
Cancel
Save