update raylib (merge)
This commit is contained in:
parent
dfacae7213
commit
e6d7d0cf23
8
Makefile
Normal file
8
Makefile
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
EXAMPLE = core/core_input_gamepad
|
||||
PLATFORM = PLATOFRM_WEB_RGFW OS=linux
|
||||
|
||||
|
||||
all:
|
||||
rm -f examples/$(EXAMPLE).exe examples/$(EXAMPLE).html examples/$(EXAMPLE).wasm examples/$(EXAMPLE).js src/rcore.o
|
||||
cd src && make PLATFORM=$(PLATFORM)
|
||||
cd examples && make $(EXAMPLE) PLATFORM=$(PLATFORM)
|
||||
11
src/external/RGFW.h
vendored
11
src/external/RGFW.h
vendored
|
|
@ -5209,11 +5209,15 @@ static HMODULE wglinstance = NULL;
|
|||
|
||||
if (RGFW_XInput_dll) {
|
||||
XInputGetStateSRC = (PFN_XInputGetState)(void*)GetProcAddress(RGFW_XInput_dll, "XInputGetState");
|
||||
XInputGetKeystrokeSRC = (PFN_XInputGetKeystroke)(void*)GetProcAddress(RGFW_XInput_dll, "XInputGetKeystroke");
|
||||
}
|
||||
}
|
||||
|
||||
if (XInputGetStateSRC == NULL)
|
||||
printf("Failed to load XInputGetState");
|
||||
}
|
||||
}
|
||||
printf("RGFW ERR: Failed to load XInputGetState\n");
|
||||
if (XInputGetKeystrokeSRC == NULL)
|
||||
printf("RGFW ERR: Failed to load XInputGetKeystroke\n");
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -5656,7 +5660,6 @@ RGFW_UNUSED(win); /*!< if buffer rendering is not being used */
|
|||
|
||||
static i32 RGFW_checkXInput(RGFW_window* win, RGFW_Event* e) {
|
||||
RGFW_UNUSED(win)
|
||||
|
||||
size_t i;
|
||||
for (i = 0; i < 4; i++) {
|
||||
XINPUT_KEYSTROKE keystroke;
|
||||
|
|
|
|||
|
|
@ -594,7 +594,7 @@ Vector2 GetMonitorPosition(int monitor)
|
|||
{
|
||||
RGFW_monitor *mons = RGFW_getMonitors();
|
||||
|
||||
return (Vector2){(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 (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 (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){ (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, (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)
|
||||
|
||||
#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)
|
||||
unsigned long long int dataSize = 0;
|
||||
void* fileData = NULL;
|
||||
int width = 0;
|
||||
int height = 0;
|
||||
|
||||
#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 (u32 i = 0; i < event->droppedFilesCount; i++)
|
||||
for (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 = (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 = (float)event->scroll;
|
||||
CORE.Input.Mouse.currentWheelMove.y = event->scroll;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user