Pārlūkot izejas kodu

Monitor utilites (#1485)

* Added a new utility function to get the current monitor.

Some of the other functions rely on passing on a monitor id but we only have a function for querying the count of monitors available.

* Updated the comment to correctly reflect the function action
pull/1487/head
hristo pirms 4 gadiem
committed by GitHub
vecāks
revīzija
75c6fd047b
Šim parakstam datu bāzē netika atrasta zināma atslēga GPG atslēgas ID: 4AEE18F83AFDEB23
2 mainītis faili ar 11 papildinājumiem un 0 dzēšanām
  1. +10
    -0
      src/core.c
  2. +1
    -0
      src/raylib.h

+ 10
- 0
src/core.c Parādīt failu

@ -1452,6 +1452,16 @@ int GetMonitorCount(void)
#endif
}
// Get number of monitors
int GetCurrentMonitor(void)
{
#if defined(PLATFORM_DESKTOP)
return glfwGetWindowMonitor(CORE.Window.handle);
#else
return 0;
#endif
}
// Get selected monitor width
Vector2 GetMonitorPosition(int monitor)
{

+ 1
- 0
src/raylib.h Parādīt failu

@ -916,6 +916,7 @@ RLAPI void *GetWindowHandle(void); // Get native
RLAPI int GetScreenWidth(void); // Get current screen width
RLAPI int GetScreenHeight(void); // Get current screen height
RLAPI int GetMonitorCount(void); // Get number of connected monitors
RLAPI int GetCurrentMonitor(void); // Get current connected monitor
RLAPI Vector2 GetMonitorPosition(int monitor); // Get specified monitor position
RLAPI int GetMonitorWidth(int monitor); // Get specified monitor width
RLAPI int GetMonitorHeight(int monitor); // Get specified monitor height

Notiek ielāde…
Atcelt
Saglabāt