|
|
@ -253,7 +253,7 @@ bool WindowShouldClose(void) |
|
|
|
|
|
|
|
// Toggle fullscreen mode
|
|
|
|
void ToggleFullscreen(void) |
|
|
|
{ |
|
|
|
{ |
|
|
|
RGFW_window_maximize(platform.window); |
|
|
|
ToggleBorderlessWindowed(); |
|
|
|
} |
|
|
@ -594,7 +594,7 @@ Vector2 GetMonitorPosition(int monitor) |
|
|
|
{ |
|
|
|
RGFW_monitor *mons = RGFW_getMonitors(); |
|
|
|
|
|
|
|
return (Vector2){p">(float)mons[monitor].rect.x, (float)mons[monitor].rect.y}; |
|
|
|
return (Vector2){mons[monitor].rect.x, mons[monitor].rect.y}; |
|
|
|
} |
|
|
|
|
|
|
|
// Get selected monitor width (currently used by monitor)
|
|
|
@ -618,7 +618,7 @@ int GetMonitorPhysicalWidth(int monitor) |
|
|
|
{ |
|
|
|
RGFW_monitor* mons = RGFW_getMonitors(); |
|
|
|
|
|
|
|
return p">(int)mons[monitor].physW; |
|
|
|
return mons[monitor].physW; |
|
|
|
} |
|
|
|
|
|
|
|
// Get selected monitor physical height in millimetres
|
|
|
@ -626,7 +626,7 @@ int GetMonitorPhysicalHeight(int monitor) |
|
|
|
{ |
|
|
|
RGFW_monitor *mons = RGFW_getMonitors(); |
|
|
|
|
|
|
|
return p">(int)mons[monitor].physH; |
|
|
|
return mons[monitor].physH; |
|
|
|
} |
|
|
|
|
|
|
|
// Get selected monitor refresh rate
|
|
|
@ -647,7 +647,7 @@ const char *GetMonitorName(int monitor) |
|
|
|
// Get window position XY on monitor
|
|
|
|
Vector2 GetWindowPosition(void) |
|
|
|
{ |
|
|
|
return (Vector2){ p">(float)platform.window->r.x, (float)platform.window->r.y }; |
|
|
|
return (Vector2){ platform.window->r.x, platform.window->r.y }; |
|
|
|
} |
|
|
|
|
|
|
|
// Get window scale DPI factor for current monitor
|
|
|
@ -661,7 +661,7 @@ Vector2 GetWindowScaleDPI(void) |
|
|
|
// Set clipboard text content
|
|
|
|
void SetClipboardText(const char *text) |
|
|
|
{ |
|
|
|
RGFW_writeClipboard(text, p">(u32)strlen(text)); |
|
|
|
RGFW_writeClipboard(text, strlen(text)); |
|
|
|
} |
|
|
|
|
|
|
|
// Get clipboard text content
|
|
|
@ -671,39 +671,42 @@ const char *GetClipboardText(void) |
|
|
|
return RGFW_readClipboard(NULL); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#if defined(SUPPORT_CLIPBOARD_IMAGE)
|
|
|
|
#if defined(_WIN32)
|
|
|
|
#define WIN32_CLIPBOARD_IMPLEMENTATION
|
|
|
|
#define WINUSER_ALREADY_INCLUDED
|
|
|
|
#define WINBASE_ALREADY_INCLUDED
|
|
|
|
#define WINGDI_ALREADY_INCLUDED
|
|
|
|
#include "../external/win32_clipboard.h"
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
# define WIN32_CLIPBOARD_IMPLEMENTATION
|
|
|
|
# define WINUSER_ALREADY_INCLUDED
|
|
|
|
# define WINBASE_ALREADY_INCLUDED
|
|
|
|
# define WINGDI_ALREADY_INCLUDED
|
|
|
|
# include "../external/win32_clipboard.h"
|
|
|
|
#endif
|
|
|
|
#endif // SUPPORT_CLIPBOARD_IMAGE
|
|
|
|
|
|
|
|
// Get clipboard image
|
|
|
|
Image GetClipboardImage(void) |
|
|
|
{ |
|
|
|
Image image = { 0 }; |
|
|
|
|
|
|
|
#if defined(SUPPORT_CLIPBOARD_IMAGE)
|
|
|
|
#if defined(_WIN32)
|
|
|
|
Image image = {0}; |
|
|
|
unsigned long long int dataSize = 0; |
|
|
|
void *fileData = NULL; |
|
|
|
int width = 0; |
|
|
|
int height = 0; |
|
|
|
void* fileData = NULL; |
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
int width, height; |
|
|
|
fileData = (void*)Win32GetClipboardImageData(&width, &height, &dataSize); |
|
|
|
|
|
|
|
if (fileData == NULL) TRACELOG(LOG_WARNING, "Clipboard image: Couldn't get clipboard data."); |
|
|
|
else image = LoadImageFromMemory(".bmp", fileData, (int)dataSize); |
|
|
|
#else
|
|
|
|
TRACELOG(LOG_WARNING, "GetClipboardImage() not implemented on target platform"); |
|
|
|
TRACELOG(LOG_WARNING, "Clipboard image: PLATFORM_DESKTOP_RGFW doesn't implement `GetClipboardImage` for this OS"); |
|
|
|
#endif
|
|
|
|
#endif // SUPPORT_CLIPBOARD_IMAGE
|
|
|
|
|
|
|
|
if (fileData == NULL) |
|
|
|
{ |
|
|
|
TRACELOG(LOG_WARNING, "Clipboard image: Couldn't get clipboard data."); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
image = LoadImageFromMemory(".bmp", fileData, dataSize); |
|
|
|
} |
|
|
|
return image; |
|
|
|
} |
|
|
|
#endif // SUPPORT_CLIPBOARD_IMAGE
|
|
|
|
|
|
|
|
// Show mouse cursor
|
|
|
|
void ShowCursor(void) |
|
|
@ -976,7 +979,7 @@ void PollInputEvents(void) |
|
|
|
case RGFW_quit: CORE.Window.shouldClose = true; break; |
|
|
|
case RGFW_dnd: // Dropped file
|
|
|
|
{ |
|
|
|
for (n">u32 i = 0; i < event->droppedFilesCount; i++) |
|
|
|
for (kt">int i = 0; i < event->droppedFilesCount; i++) |
|
|
|
{ |
|
|
|
if (CORE.Window.dropFileCount == 0) |
|
|
|
{ |
|
|
@ -1060,7 +1063,7 @@ void PollInputEvents(void) |
|
|
|
if ((event->button == RGFW_mouseScrollUp) || (event->button == RGFW_mouseScrollDown)) |
|
|
|
{ |
|
|
|
|
|
|
|
CORE.Input.Mouse.currentWheelMove.y = p">(float)event->scroll; |
|
|
|
CORE.Input.Mouse.currentWheelMove.y = event->scroll; |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
@ -1078,7 +1081,7 @@ void PollInputEvents(void) |
|
|
|
{ |
|
|
|
if ((event->button == RGFW_mouseScrollUp) || (event->button == RGFW_mouseScrollDown)) |
|
|
|
{ |
|
|
|
CORE.Input.Mouse.currentWheelMove.y = p">(float)event->scroll; |
|
|
|
CORE.Input.Mouse.currentWheelMove.y = event->scroll; |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|