diff options
| author | David Reid <mackron@gmail.com> | 2018-07-05 22:33:16 +1000 |
|---|---|---|
| committer | David Reid <mackron@gmail.com> | 2018-07-05 22:33:16 +1000 |
| commit | 1d354bc7045f14ed47c153c031d68641a80fc6fe (patch) | |
| tree | 9affe50bcb06515d6cbd123df37b6a30a4c7518a /src/external | |
| parent | 63cf43b72947e80791c2a74d98a20e4a96c9af9e (diff) | |
| parent | 7c362370488d740ec89cbdd0803b85ee8336711e (diff) | |
| download | raylib-1d354bc7045f14ed47c153c031d68641a80fc6fe.tar.gz raylib-1d354bc7045f14ed47c153c031d68641a80fc6fe.zip | |
Merge branch 'master' of https://github.com/raysan5/raylib into dr/mini_al
Diffstat (limited to 'src/external')
| -rw-r--r-- | src/external/glfw/CMake/modules/FindVulkan.cmake | 5 | ||||
| -rw-r--r-- | src/external/glfw/CMakeLists.txt | 4 | ||||
| -rw-r--r-- | src/external/glfw/README.md | 2 | ||||
| -rw-r--r-- | src/external/glfw/include/GLFW/glfw3.h | 20 | ||||
| -rw-r--r-- | src/external/glfw/src/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | src/external/glfw/src/input.c | 5 | ||||
| -rw-r--r-- | src/external/glfw/src/internal.h | 2 | ||||
| -rw-r--r-- | src/external/glfw/src/win32_platform.h | 4 | ||||
| -rw-r--r-- | src/external/glfw/src/window.c | 13 | ||||
| -rw-r--r-- | src/external/glfw/src/x11_window.c | 5 | ||||
| -rw-r--r-- | src/external/jar_xm.h | 2 |
11 files changed, 46 insertions, 17 deletions
diff --git a/src/external/glfw/CMake/modules/FindVulkan.cmake b/src/external/glfw/CMake/modules/FindVulkan.cmake index 103554bb..5004356b 100644 --- a/src/external/glfw/CMake/modules/FindVulkan.cmake +++ b/src/external/glfw/CMake/modules/FindVulkan.cmake @@ -27,11 +27,6 @@ if (WIN32) "$ENV{VULKAN_SDK}/Bin32" "$ENV{VK_SDK_PATH}/Bin32") endif() -elseif (APPLE) - find_library(VULKAN_LIBRARY vulkan.1 HINTS - "$ENV{VULKAN_SDK}/macOS/lib") - find_path(VULKAN_INCLUDE_DIR NAMES vulkan/vulkan.h HINTS - "$ENV{VULKAN_SDK}/macOS/include") else() find_path(VULKAN_INCLUDE_DIR NAMES vulkan/vulkan.h HINTS "$ENV{VULKAN_SDK}/include") diff --git a/src/external/glfw/CMakeLists.txt b/src/external/glfw/CMakeLists.txt index 4f9dbcf7..0eb7e7ea 100644 --- a/src/external/glfw/CMakeLists.txt +++ b/src/external/glfw/CMakeLists.txt @@ -327,10 +327,10 @@ endif() # Export GLFW library dependencies #-------------------------------------------------------------------- foreach(arg ${glfw_PKG_DEPS}) - set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} ${arg}") + set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} ${arg}" PARENT_SCOPE) endforeach() foreach(arg ${glfw_PKG_LIBS}) - set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} ${arg}") + set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} ${arg}" PARENT_SCOPE) endforeach() #-------------------------------------------------------------------- diff --git a/src/external/glfw/README.md b/src/external/glfw/README.md index 0573dcd9..82d4806a 100644 --- a/src/external/glfw/README.md +++ b/src/external/glfw/README.md @@ -165,6 +165,8 @@ information on what to include when reporting a bug. - Added `GLFW_HOVERED` window attribute for polling cursor hover state (#1166) - Added `GLFW_CENTER_CURSOR` window hint for controlling cursor centering (#749,#842) +- Added `GLFW_FOCUS_ON_SHOW` window hint and attribute to control input focus + on calling show window (#1189) - Added `GLFW_JOYSTICK_HAT_BUTTONS` init hint (#889) - Added `GLFW_LOCK_KEY_MODS` input mode and `GLFW_MOD_*_LOCK` mod bits (#946) - Added macOS specific `GLFW_COCOA_RETINA_FRAMEBUFFER` window hint diff --git a/src/external/glfw/include/GLFW/glfw3.h b/src/external/glfw/include/GLFW/glfw3.h index 00256d4d..990fe3f7 100644 --- a/src/external/glfw/include/GLFW/glfw3.h +++ b/src/external/glfw/include/GLFW/glfw3.h @@ -819,6 +819,12 @@ extern "C" { * Mouse cursor hover [window attribute](@ref GLFW_HOVERED_attrib). */ #define GLFW_HOVERED 0x0002000B +/*! @brief Input focus on calling show window hint and attribute + * + * Input focus [window hint](@ref GLFW_FOCUS_ON_SHOW_hint) or + * [window attribute](@ref GLFW_FOCUS_ON_SHOW_attrib). + */ +#define GLFW_FOCUS_ON_SHOW 0x0002000C /*! @brief Framebuffer bit depth hint. * @@ -3085,6 +3091,11 @@ GLFWAPI void glfwMaximizeWindow(GLFWwindow* window); * hidden. If the window is already visible or is in full screen mode, this * function does nothing. * + * By default, windowed mode windows are focused when shown + * Set the [GLFW_FOCUS_ON_SHOW](@ref GLFW_FOCUS_ON_SHOW_hint) window hint + * to change this behavior for all newly created windows, or change the + * behavior for an existing window with @ref glfwSetWindowAttrib. + * * @param[in] window The window to make visible. * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref @@ -3132,6 +3143,10 @@ GLFWAPI void glfwHideWindow(GLFWwindow* window); * initially created. Set the [GLFW_FOCUSED](@ref GLFW_FOCUSED_hint) to * disable this behavior. * + * Also by default, windowed mode windows are focused when shown + * with @ref glfwShowWindow. Set the + * [GLFW_FOCUS_ON_SHOW](@ref GLFW_FOCUS_ON_SHOW_hint) to disable this behavior. + * * __Do not use this function__ to steal focus from other applications unless * you are certain that is what the user wants. Focus stealing can be * extremely disruptive. @@ -3306,8 +3321,9 @@ GLFWAPI int glfwGetWindowAttrib(GLFWwindow* window, int attrib); * * The supported attributes are [GLFW_DECORATED](@ref GLFW_DECORATED_attrib), * [GLFW_RESIZABLE](@ref GLFW_RESIZABLE_attrib), - * [GLFW_FLOATING](@ref GLFW_FLOATING_attrib) and - * [GLFW_AUTO_ICONIFY](@ref GLFW_AUTO_ICONIFY_attrib). + * [GLFW_FLOATING](@ref GLFW_FLOATING_attrib), + * [GLFW_AUTO_ICONIFY](@ref GLFW_AUTO_ICONIFY_attrib) and + * [GLFW_FOCUS_ON_SHOW](@ref GLFW_FOCUS_ON_SHOW_attrib). * * Some of these attributes are ignored for full screen windows. The new * value will take effect if the window is later made windowed. diff --git a/src/external/glfw/src/CMakeLists.txt b/src/external/glfw/src/CMakeLists.txt index 6d3e33a5..fe060844 100644 --- a/src/external/glfw/src/CMakeLists.txt +++ b/src/external/glfw/src/CMakeLists.txt @@ -163,4 +163,3 @@ if (GLFW_INSTALL) ARCHIVE DESTINATION "lib${LIB_SUFFIX}" LIBRARY DESTINATION "lib${LIB_SUFFIX}") endif() - diff --git a/src/external/glfw/src/input.c b/src/external/glfw/src/input.c index 42975452..b0bb3de4 100644 --- a/src/external/glfw/src/input.c +++ b/src/external/glfw/src/input.c @@ -32,7 +32,6 @@ #include <math.h> #include <stdlib.h> #include <string.h> -#include <ctype.h> // Internal key state used for sticky keys #define _GLFW_STICK 3 @@ -1086,7 +1085,9 @@ GLFWAPI int glfwUpdateGamepadMappings(const char* string) while (*c) { - if (isxdigit(*c)) + if ((*c >= '0' && *c <= '9') || + (*c >= 'a' && *c <= 'f') || + (*c >= 'A' && *c <= 'F')) { char line[1024]; diff --git a/src/external/glfw/src/internal.h b/src/external/glfw/src/internal.h index 92bbfcce..9fc626dd 100644 --- a/src/external/glfw/src/internal.h +++ b/src/external/glfw/src/internal.h @@ -267,6 +267,7 @@ struct _GLFWwndconfig GLFWbool floating; GLFWbool maximized; GLFWbool centerCursor; + GLFWbool focusOnShow; struct { GLFWbool retina; char frameName[256]; @@ -372,6 +373,7 @@ struct _GLFWwindow GLFWbool decorated; GLFWbool autoIconify; GLFWbool floating; + GLFWbool focusOnShow; GLFWbool shouldClose; void* userPointer; GLFWvidmode videoMode; diff --git a/src/external/glfw/src/win32_platform.h b/src/external/glfw/src/win32_platform.h index 9a669215..59815146 100644 --- a/src/external/glfw/src/win32_platform.h +++ b/src/external/glfw/src/win32_platform.h @@ -242,7 +242,9 @@ typedef VkBool32 (APIENTRY *PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR)( #include "egl_context.h" #include "osmesa_context.h" -#define _GLFW_WNDCLASSNAME L"GLFW30" +#if !defined(_GLFW_WNDCLASSNAME) + #define _GLFW_WNDCLASSNAME L"GLFW30" +#endif #define _glfw_dlopen(name) LoadLibraryA(name) #define _glfw_dlclose(handle) FreeLibrary((HMODULE) handle) diff --git a/src/external/glfw/src/window.c b/src/external/glfw/src/window.c index 38a8982b..4ed415ca 100644 --- a/src/external/glfw/src/window.c +++ b/src/external/glfw/src/window.c @@ -201,6 +201,7 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height, window->decorated = wndconfig.decorated; window->autoIconify = wndconfig.autoIconify; window->floating = wndconfig.floating; + window->focusOnShow = wndconfig.focusOnShow; window->cursorMode = GLFW_CURSOR_NORMAL; window->minwidth = GLFW_DONT_CARE; @@ -267,6 +268,7 @@ void glfwDefaultWindowHints(void) _glfw.hints.window.focused = GLFW_TRUE; _glfw.hints.window.autoIconify = GLFW_TRUE; _glfw.hints.window.centerCursor = GLFW_TRUE; + _glfw.hints.window.focusOnShow = GLFW_TRUE; // The default is 24 bits of color, 24 bits of depth and 8 bits of stencil, // double buffered @@ -370,6 +372,9 @@ GLFWAPI void glfwWindowHint(int hint, int value) case GLFW_CENTER_CURSOR: _glfw.hints.window.centerCursor = value ? GLFW_TRUE : GLFW_FALSE; return; + case GLFW_FOCUS_ON_SHOW: + _glfw.hints.window.focusOnShow = value ? GLFW_TRUE : GLFW_FALSE; + return; case GLFW_CLIENT_API: _glfw.hints.context.client = value; return; @@ -755,7 +760,9 @@ GLFWAPI void glfwShowWindow(GLFWwindow* handle) return; _glfwPlatformShowWindow(window); - _glfwPlatformFocusWindow(window); + + if (window->focusOnShow) + _glfwPlatformFocusWindow(window); } GLFWAPI void glfwRequestWindowAttention(GLFWwindow* handle) @@ -810,6 +817,8 @@ GLFWAPI int glfwGetWindowAttrib(GLFWwindow* handle, int attrib) return _glfwPlatformWindowMaximized(window); case GLFW_HOVERED: return _glfwPlatformWindowHovered(window); + case GLFW_FOCUS_ON_SHOW: + return window->focusOnShow; case GLFW_TRANSPARENT_FRAMEBUFFER: return _glfwPlatformFramebufferTransparent(window); case GLFW_RESIZABLE: @@ -886,6 +895,8 @@ GLFWAPI void glfwSetWindowAttrib(GLFWwindow* handle, int attrib, int value) if (!window->monitor) _glfwPlatformSetWindowFloating(window, value); } + else if (attrib == GLFW_FOCUS_ON_SHOW) + window->focusOnShow = value; else _glfwInputError(GLFW_INVALID_ENUM, "Invalid window attribute 0x%08X", attrib); } diff --git a/src/external/glfw/src/x11_window.c b/src/external/glfw/src/x11_window.c index fc24f285..1c4e9c3c 100644 --- a/src/external/glfw/src/x11_window.c +++ b/src/external/glfw/src/x11_window.c @@ -2672,8 +2672,9 @@ void _glfwPlatformPollEvents(void) #if defined(__linux__) _glfwDetectJoystickConnectionLinux(); #endif - int count = XPending(_glfw.x11.display); - while (count--) + XPending(_glfw.x11.display); + + while (XQLength(_glfw.x11.display)) { XEvent event; XNextEvent(_glfw.x11.display, &event); diff --git a/src/external/jar_xm.h b/src/external/jar_xm.h index 9d4f5b5b..c8c9e3c9 100644 --- a/src/external/jar_xm.h +++ b/src/external/jar_xm.h @@ -2365,7 +2365,7 @@ static void jar_xm_tick(jar_xm_context_t* ctx) { float panning, volume; panning = ch->panning + - (ch->panning_envelope_panning - .5f) * (.5f - fabsf(ch->panning - .5f)) * 2.0f; + (ch->panning_envelope_panning - .5f) * (.5f - fabs(ch->panning - .5f)) * 2.0f; if(ch->tremor_on) { volume = .0f; |
