Browse Source

ADDED: GetWindowPosition()

pull/963/head
Ray 5 years ago
parent
commit
0a2177b4bc
2 changed files with 12 additions and 0 deletions
  1. +11
    -0
      src/core.c
  2. +1
    -0
      src/raylib.h

+ 11
- 0
src/core.c View File

@ -1064,6 +1064,17 @@ int GetMonitorPhysicalHeight(int monitor)
return 0;
}
// Get window position XY on monitor
Vector2 GetWindowPosition(void)
{
int x = 0;
int y = 0;
#if defined(PLATFORM_DESKTOP)
glfwGetWindowPos(window, &x, &y);
#endif
return (Vector2){ (float)x, (float)y };
}
// Get the human-readable, UTF-8 encoded name of the primary monitor
const char *GetMonitorName(int monitor)
{

+ 1
- 0
src/raylib.h View File

@ -882,6 +882,7 @@ RLAPI int GetMonitorWidth(int monitor); // Get primary
RLAPI int GetMonitorHeight(int monitor); // Get primary monitor height
RLAPI int GetMonitorPhysicalWidth(int monitor); // Get primary monitor physical width in millimetres
RLAPI int GetMonitorPhysicalHeight(int monitor); // Get primary monitor physical height in millimetres
RLAPI Vector2 GetWindowPosition(void); // Get window position XY on monitor
RLAPI const char *GetMonitorName(int monitor); // Get the human-readable, UTF-8 encoded name of the primary monitor
RLAPI const char *GetClipboardText(void); // Get clipboard text content
RLAPI void SetClipboardText(const char *text); // Set clipboard text content

Loading…
Cancel
Save