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) {
|
if (RGFW_XInput_dll) {
|
||||||
XInputGetStateSRC = (PFN_XInputGetState)(void*)GetProcAddress(RGFW_XInput_dll, "XInputGetState");
|
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");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (XInputGetStateSRC == NULL)
|
||||||
|
printf("RGFW ERR: Failed to load XInputGetState\n");
|
||||||
|
if (XInputGetKeystrokeSRC == NULL)
|
||||||
|
printf("RGFW ERR: Failed to load XInputGetKeystroke\n");
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#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) {
|
static i32 RGFW_checkXInput(RGFW_window* win, RGFW_Event* e) {
|
||||||
RGFW_UNUSED(win)
|
RGFW_UNUSED(win)
|
||||||
|
|
||||||
size_t i;
|
size_t i;
|
||||||
for (i = 0; i < 4; i++) {
|
for (i = 0; i < 4; i++) {
|
||||||
XINPUT_KEYSTROKE keystroke;
|
XINPUT_KEYSTROKE keystroke;
|
||||||
|
|
|
||||||
|
|
@ -594,7 +594,7 @@ Vector2 GetMonitorPosition(int monitor)
|
||||||
{
|
{
|
||||||
RGFW_monitor *mons = RGFW_getMonitors();
|
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)
|
// Get selected monitor width (currently used by monitor)
|
||||||
|
|
@ -618,7 +618,7 @@ int GetMonitorPhysicalWidth(int monitor)
|
||||||
{
|
{
|
||||||
RGFW_monitor* mons = RGFW_getMonitors();
|
RGFW_monitor* mons = RGFW_getMonitors();
|
||||||
|
|
||||||
return (int)mons[monitor].physW;
|
return mons[monitor].physW;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get selected monitor physical height in millimetres
|
// Get selected monitor physical height in millimetres
|
||||||
|
|
@ -626,7 +626,7 @@ int GetMonitorPhysicalHeight(int monitor)
|
||||||
{
|
{
|
||||||
RGFW_monitor *mons = RGFW_getMonitors();
|
RGFW_monitor *mons = RGFW_getMonitors();
|
||||||
|
|
||||||
return (int)mons[monitor].physH;
|
return mons[monitor].physH;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get selected monitor refresh rate
|
// Get selected monitor refresh rate
|
||||||
|
|
@ -647,7 +647,7 @@ const char *GetMonitorName(int monitor)
|
||||||
// Get window position XY on monitor
|
// Get window position XY on monitor
|
||||||
Vector2 GetWindowPosition(void)
|
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
|
// Get window scale DPI factor for current monitor
|
||||||
|
|
@ -661,7 +661,7 @@ Vector2 GetWindowScaleDPI(void)
|
||||||
// Set clipboard text content
|
// Set clipboard text content
|
||||||
void SetClipboardText(const char *text)
|
void SetClipboardText(const char *text)
|
||||||
{
|
{
|
||||||
RGFW_writeClipboard(text, (u32)strlen(text));
|
RGFW_writeClipboard(text, strlen(text));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get clipboard text content
|
// Get clipboard text content
|
||||||
|
|
@ -671,39 +671,42 @@ const char *GetClipboardText(void)
|
||||||
return RGFW_readClipboard(NULL);
|
return RGFW_readClipboard(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if defined(SUPPORT_CLIPBOARD_IMAGE)
|
#if defined(SUPPORT_CLIPBOARD_IMAGE)
|
||||||
#if defined(_WIN32)
|
|
||||||
#define WIN32_CLIPBOARD_IMPLEMENTATION
|
#ifdef _WIN32
|
||||||
#define WINUSER_ALREADY_INCLUDED
|
# define WIN32_CLIPBOARD_IMPLEMENTATION
|
||||||
#define WINBASE_ALREADY_INCLUDED
|
# define WINUSER_ALREADY_INCLUDED
|
||||||
#define WINGDI_ALREADY_INCLUDED
|
# define WINBASE_ALREADY_INCLUDED
|
||||||
#include "../external/win32_clipboard.h"
|
# define WINGDI_ALREADY_INCLUDED
|
||||||
|
# include "../external/win32_clipboard.h"
|
||||||
#endif
|
#endif
|
||||||
#endif // SUPPORT_CLIPBOARD_IMAGE
|
|
||||||
|
|
||||||
// Get clipboard image
|
// Get clipboard image
|
||||||
Image GetClipboardImage(void)
|
Image GetClipboardImage(void)
|
||||||
{
|
{
|
||||||
Image image = { 0 };
|
Image image = {0};
|
||||||
|
|
||||||
#if defined(SUPPORT_CLIPBOARD_IMAGE)
|
|
||||||
#if defined(_WIN32)
|
|
||||||
unsigned long long int dataSize = 0;
|
unsigned long long int dataSize = 0;
|
||||||
void *fileData = NULL;
|
void* fileData = NULL;
|
||||||
int width = 0;
|
|
||||||
int height = 0;
|
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
int width, height;
|
||||||
fileData = (void*)Win32GetClipboardImageData(&width, &height, &dataSize);
|
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
|
#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
|
||||||
#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;
|
return image;
|
||||||
}
|
}
|
||||||
|
#endif // SUPPORT_CLIPBOARD_IMAGE
|
||||||
|
|
||||||
// Show mouse cursor
|
// Show mouse cursor
|
||||||
void ShowCursor(void)
|
void ShowCursor(void)
|
||||||
|
|
@ -976,7 +979,7 @@ void PollInputEvents(void)
|
||||||
case RGFW_quit: CORE.Window.shouldClose = true; break;
|
case RGFW_quit: CORE.Window.shouldClose = true; break;
|
||||||
case RGFW_dnd: // Dropped file
|
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)
|
if (CORE.Window.dropFileCount == 0)
|
||||||
{
|
{
|
||||||
|
|
@ -1060,7 +1063,7 @@ void PollInputEvents(void)
|
||||||
if ((event->button == RGFW_mouseScrollUp) || (event->button == RGFW_mouseScrollDown))
|
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;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1078,7 +1081,7 @@ void PollInputEvents(void)
|
||||||
{
|
{
|
||||||
if ((event->button == RGFW_mouseScrollUp) || (event->button == RGFW_mouseScrollDown))
|
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;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user