Merge branch 'raysan5:master' into cmake-config.h

This commit is contained in:
Lázaro Albuquerque 2024-06-08 20:10:39 -04:00 committed by GitHub
commit 06a47011f1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 565 additions and 333 deletions

View File

@ -20,7 +20,7 @@ cmake_policy(SET CMP0063 NEW)
# Directory for easier includes # Directory for easier includes
# Anywhere you see include(...) you can check <root>/cmake for that file # Anywhere you see include(...) you can check <root>/cmake for that file
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
# RAYLIB_IS_MAIN determines whether the project is being used from root # RAYLIB_IS_MAIN determines whether the project is being used from root
# or if it is added as a dependency (through add_subdirectory for example). # or if it is added as a dependency (through add_subdirectory for example).
@ -51,7 +51,7 @@ add_subdirectory(src raylib)
# Uninstall target # Uninstall target
if(NOT TARGET uninstall) if(NOT TARGET uninstall)
configure_file( configure_file(
"${CMAKE_MODULE_PATH}/Uninstall.cmake" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Uninstall.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY) IMMEDIATE @ONLY)

View File

@ -22,7 +22,7 @@
// NOTE: Gamepad name ID depends on drivers and OS // NOTE: Gamepad name ID depends on drivers and OS
#define XBOX360_LEGACY_NAME_ID "Xbox Controller" #define XBOX360_LEGACY_NAME_ID "Xbox Controller"
#define XBOX360_NAME_ID "Xbox 360 Controller" #define XBOX360_NAME_ID "Xbox 360 Controller"
#define PS3_NAME_ID "PLAYSTATION(R)3 Controller" #define PS3_NAME_ID "Sony PLAYSTATION(R)3 Controller"
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
// Program main entry point // Program main entry point
@ -67,7 +67,7 @@ int main(void)
{ {
DrawText(TextFormat("GP%d: %s", gamepad, GetGamepadName(gamepad)), 10, 10, 10, BLACK); DrawText(TextFormat("GP%d: %s", gamepad, GetGamepadName(gamepad)), 10, 10, 10, BLACK);
if (true) if (TextIsEqual(GetGamepadName(gamepad), XBOX360_LEGACY_NAME_ID) || TextIsEqual(GetGamepadName(gamepad), XBOX360_NAME_ID))
{ {
DrawTexture(texXboxPad, 0, 0, DARKGRAY); DrawTexture(texXboxPad, 0, 0, DARKGRAY);

872
src/external/RGFW.h vendored

File diff suppressed because it is too large Load Diff

View File

@ -431,7 +431,11 @@ void SetWindowFocused(void)
// Get native window handle // Get native window handle
void *GetWindowHandle(void) void *GetWindowHandle(void)
{ {
return platform.window->src.window; #ifndef RGFW_WINDOWS
return (void*)platform.window->src.window;
#else
return platform.window->src.hwnd;
#endif
} }
// Get number of monitors // Get number of monitors
@ -890,8 +894,6 @@ void PollInputEvents(void)
CORE.Input.Mouse.currentPosition.x = (event->point.x - (platform.window->r.w / 2)) * 2; CORE.Input.Mouse.currentPosition.x = (event->point.x - (platform.window->r.w / 2)) * 2;
CORE.Input.Mouse.currentPosition.y = (event->point.y - (platform.window->r.h / 2)) * 2; CORE.Input.Mouse.currentPosition.y = (event->point.y - (platform.window->r.h / 2)) * 2;
RGFW_window_showMouse(platform.window, 1);
} }
else { else {
CORE.Input.Mouse.previousPosition = CORE.Input.Mouse.currentPosition; CORE.Input.Mouse.previousPosition = CORE.Input.Mouse.currentPosition;