├── baked_font ├── info.txt ├── NOTICE.md └── Profontwindows-axBMx.ttf ├── screenshot.png ├── src ├── external │ ├── raylib │ │ ├── src │ │ │ ├── raylib.ico │ │ │ ├── raylib.rc.data │ │ │ ├── raylib.dll.rc.data │ │ │ ├── external │ │ │ │ ├── glfw │ │ │ │ │ ├── CMake │ │ │ │ │ │ ├── glfw3Config.cmake.in │ │ │ │ │ │ ├── glfw3.pc.in │ │ │ │ │ │ ├── modules │ │ │ │ │ │ │ ├── FindOSMesa.cmake │ │ │ │ │ │ │ └── FindEpollShim.cmake │ │ │ │ │ │ ├── i686-w64-mingw32.cmake │ │ │ │ │ │ ├── x86_64-w64-mingw32.cmake │ │ │ │ │ │ ├── i686-w64-mingw32-clang.cmake │ │ │ │ │ │ ├── x86_64-w64-mingw32-clang.cmake │ │ │ │ │ │ ├── cmake_uninstall.cmake.in │ │ │ │ │ │ ├── Info.plist.in │ │ │ │ │ │ └── GenerateMappings.cmake │ │ │ │ │ ├── .mailmap │ │ │ │ │ ├── src │ │ │ │ │ │ ├── glfw.rc.in │ │ │ │ │ │ ├── xkb_unicode.h │ │ │ │ │ │ ├── cocoa_time.h │ │ │ │ │ │ ├── null_joystick.h │ │ │ │ │ │ ├── posix_poll.h │ │ │ │ │ │ ├── win32_time.h │ │ │ │ │ │ ├── posix_time.h │ │ │ │ │ │ ├── posix_thread.h │ │ │ │ │ │ ├── win32_thread.h │ │ │ │ │ │ ├── cocoa_joystick.h │ │ │ │ │ │ ├── win32_module.c │ │ │ │ │ │ ├── posix_module.c │ │ │ │ │ │ ├── win32_joystick.h │ │ │ │ │ │ ├── null_joystick.c │ │ │ │ │ │ ├── cocoa_time.c │ │ │ │ │ │ ├── win32_time.c │ │ │ │ │ │ ├── posix_time.c │ │ │ │ │ │ ├── linux_joystick.h │ │ │ │ │ │ ├── posix_poll.c │ │ │ │ │ │ ├── win32_thread.c │ │ │ │ │ │ ├── posix_thread.c │ │ │ │ │ │ ├── null_init.c │ │ │ │ │ │ ├── mappings.h.in │ │ │ │ │ │ ├── platform.h │ │ │ │ │ │ ├── null_monitor.c │ │ │ │ │ │ ├── platform.c │ │ │ │ │ │ ├── null_platform.h │ │ │ │ │ │ └── wl_monitor.c │ │ │ │ │ ├── LICENSE.md │ │ │ │ │ ├── deps │ │ │ │ │ │ ├── getopt.h │ │ │ │ │ │ ├── mingw │ │ │ │ │ │ │ ├── _mingw_dxhelper.h │ │ │ │ │ │ │ └── xinput.h │ │ │ │ │ │ ├── vs2008 │ │ │ │ │ │ │ └── stdint.h │ │ │ │ │ │ └── getopt.c │ │ │ │ │ ├── CONTRIBUTORS.md │ │ │ │ │ └── CMakeLists.txt │ │ │ │ ├── dirent.h │ │ │ │ ├── qoaplay.c │ │ │ │ └── rprand.h │ │ │ ├── raylib.dll.rc │ │ │ ├── raylib.rc │ │ │ ├── utils.h │ │ │ ├── minshell.html │ │ │ └── rglfw.c │ │ ├── MODIFICATION_NOTICE.md │ │ └── LICENSE │ ├── deque.h │ └── stack.h ├── util.h ├── util.c ├── canvas.h └── menu.h ├── .gitignore ├── README.md ├── LICENSE └── Makefile /baked_font/info.txt: -------------------------------------------------------------------------------- 1 | license: Freeware 2 | link: https://www.fontspace.com/profontwindows-font-f1796 -------------------------------------------------------------------------------- /baked_font/NOTICE.md: -------------------------------------------------------------------------------- 1 | This font is baked into src/font.h 2 | (This directory is not needed for compilation) 3 | -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LievenPetersen/image-maker-for-angry-programmers/HEAD/screenshot.png -------------------------------------------------------------------------------- /src/external/raylib/src/raylib.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LievenPetersen/image-maker-for-angry-programmers/HEAD/src/external/raylib/src/raylib.ico -------------------------------------------------------------------------------- /baked_font/Profontwindows-axBMx.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LievenPetersen/image-maker-for-angry-programmers/HEAD/baked_font/Profontwindows-axBMx.ttf -------------------------------------------------------------------------------- /src/external/raylib/src/raylib.rc.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LievenPetersen/image-maker-for-angry-programmers/HEAD/src/external/raylib/src/raylib.rc.data -------------------------------------------------------------------------------- /src/external/raylib/src/raylib.dll.rc.data: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LievenPetersen/image-maker-for-angry-programmers/HEAD/src/external/raylib/src/raylib.dll.rc.data -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/CMake/glfw3Config.cmake.in: -------------------------------------------------------------------------------- 1 | include(CMakeFindDependencyMacro) 2 | find_dependency(Threads) 3 | include("${CMAKE_CURRENT_LIST_DIR}/glfw3Targets.cmake") 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .clangd 2 | 3 | # executables 4 | imfap 5 | **.exe 6 | **.wasm 7 | **.wat 8 | 9 | # build artifacts 10 | *.o 11 | 12 | # ignore all images, with specific exceptions 13 | **.png 14 | **.bmp 15 | **.qoi 16 | **.raw 17 | !screenshot.png 18 | -------------------------------------------------------------------------------- /src/external/raylib/MODIFICATION_NOTICE.md: -------------------------------------------------------------------------------- 1 | This file was added to comply with the LICENSE of Raylib and is not provided by Raylib. 2 | 3 | # Origin 4 | The source files of the Raylib library can be found here: [https://github.com/raysan5/raylib](https://github.com/raysan5/raylib) 5 | 6 | # Modifications 7 | - This file was added 8 | - Many files and directories have been deleted 9 | 10 | - Values in src/config.h were changed. 11 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/.mailmap: -------------------------------------------------------------------------------- 1 | Camilla Löwy 2 | Camilla Löwy 3 | Camilla Löwy 4 | 5 | Emmanuel Gil Peyrot 6 | 7 | Marcus Geelnard 8 | Marcus Geelnard 9 | Marcus Geelnard 10 | 11 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/CMake/glfw3.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=${prefix} 3 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ 4 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ 5 | 6 | Name: GLFW 7 | Description: A multi-platform library for OpenGL, window and input 8 | Version: @GLFW_VERSION@ 9 | URL: https://www.glfw.org/ 10 | Requires.private: @GLFW_PKG_CONFIG_REQUIRES_PRIVATE@ 11 | Libs: -L${libdir} -l@GLFW_LIB_NAME@ 12 | Libs.private: @GLFW_PKG_CONFIG_LIBS_PRIVATE@ 13 | Cflags: -I${includedir} 14 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/CMake/modules/FindOSMesa.cmake: -------------------------------------------------------------------------------- 1 | # Try to find OSMesa on a Unix system 2 | # 3 | # This will define: 4 | # 5 | # OSMESA_LIBRARIES - Link these to use OSMesa 6 | # OSMESA_INCLUDE_DIR - Include directory for OSMesa 7 | # 8 | # Copyright (c) 2014 Brandon Schaefer 9 | 10 | if (NOT WIN32) 11 | 12 | find_package (PkgConfig) 13 | pkg_check_modules (PKG_OSMESA QUIET osmesa) 14 | 15 | set (OSMESA_INCLUDE_DIR ${PKG_OSMESA_INCLUDE_DIRS}) 16 | set (OSMESA_LIBRARIES ${PKG_OSMESA_LIBRARIES}) 17 | 18 | endif () 19 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/CMake/i686-w64-mingw32.cmake: -------------------------------------------------------------------------------- 1 | # Define the environment for cross-compiling with 32-bit MinGW-w64 GCC 2 | SET(CMAKE_SYSTEM_NAME Windows) # Target system name 3 | SET(CMAKE_SYSTEM_VERSION 1) 4 | SET(CMAKE_C_COMPILER "i686-w64-mingw32-gcc") 5 | SET(CMAKE_CXX_COMPILER "i686-w64-mingw32-g++") 6 | SET(CMAKE_RC_COMPILER "i686-w64-mingw32-windres") 7 | SET(CMAKE_RANLIB "i686-w64-mingw32-ranlib") 8 | 9 | # Configure the behaviour of the find commands 10 | SET(CMAKE_FIND_ROOT_PATH "/usr/i686-w64-mingw32") 11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 14 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/CMake/x86_64-w64-mingw32.cmake: -------------------------------------------------------------------------------- 1 | # Define the environment for cross-compiling with 64-bit MinGW-w64 GCC 2 | SET(CMAKE_SYSTEM_NAME Windows) # Target system name 3 | SET(CMAKE_SYSTEM_VERSION 1) 4 | SET(CMAKE_C_COMPILER "x86_64-w64-mingw32-gcc") 5 | SET(CMAKE_CXX_COMPILER "x86_64-w64-mingw32-g++") 6 | SET(CMAKE_RC_COMPILER "x86_64-w64-mingw32-windres") 7 | SET(CMAKE_RANLIB "x86_64-w64-mingw32-ranlib") 8 | 9 | # Configure the behaviour of the find commands 10 | SET(CMAKE_FIND_ROOT_PATH "/usr/x86_64-w64-mingw32") 11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 14 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/CMake/i686-w64-mingw32-clang.cmake: -------------------------------------------------------------------------------- 1 | # Define the environment for cross-compiling with 32-bit MinGW-w64 Clang 2 | SET(CMAKE_SYSTEM_NAME Windows) # Target system name 3 | SET(CMAKE_SYSTEM_VERSION 1) 4 | SET(CMAKE_C_COMPILER "i686-w64-mingw32-clang") 5 | SET(CMAKE_CXX_COMPILER "i686-w64-mingw32-clang++") 6 | SET(CMAKE_RC_COMPILER "i686-w64-mingw32-windres") 7 | SET(CMAKE_RANLIB "i686-w64-mingw32-ranlib") 8 | 9 | # Configure the behaviour of the find commands 10 | SET(CMAKE_FIND_ROOT_PATH "/usr/i686-w64-mingw32") 11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 14 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/CMake/x86_64-w64-mingw32-clang.cmake: -------------------------------------------------------------------------------- 1 | # Define the environment for cross-compiling with 64-bit MinGW-w64 Clang 2 | SET(CMAKE_SYSTEM_NAME Windows) # Target system name 3 | SET(CMAKE_SYSTEM_VERSION 1) 4 | SET(CMAKE_C_COMPILER "x86_64-w64-mingw32-clang") 5 | SET(CMAKE_CXX_COMPILER "x86_64-w64-mingw32-clang++") 6 | SET(CMAKE_RC_COMPILER "x86_64-w64-mingw32-windres") 7 | SET(CMAKE_RANLIB "x86_64-w64-mingw32-ranlib") 8 | 9 | # Configure the behaviour of the find commands 10 | SET(CMAKE_FIND_ROOT_PATH "/usr/x86_64-w64-mingw32") 11 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 12 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 13 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 14 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/CMake/modules/FindEpollShim.cmake: -------------------------------------------------------------------------------- 1 | # Find EpollShim 2 | # Once done, this will define 3 | # 4 | # EPOLLSHIM_FOUND - System has EpollShim 5 | # EPOLLSHIM_INCLUDE_DIRS - The EpollShim include directories 6 | # EPOLLSHIM_LIBRARIES - The libraries needed to use EpollShim 7 | 8 | find_path(EPOLLSHIM_INCLUDE_DIRS NAMES sys/epoll.h sys/timerfd.h HINTS /usr/local/include/libepoll-shim) 9 | find_library(EPOLLSHIM_LIBRARIES NAMES epoll-shim libepoll-shim HINTS /usr/local/lib) 10 | 11 | if (EPOLLSHIM_INCLUDE_DIRS AND EPOLLSHIM_LIBRARIES) 12 | set(EPOLLSHIM_FOUND TRUE) 13 | endif (EPOLLSHIM_INCLUDE_DIRS AND EPOLLSHIM_LIBRARIES) 14 | 15 | include(FindPackageHandleStandardArgs) 16 | find_package_handle_standard_args(EpollShim DEFAULT_MSG EPOLLSHIM_LIBRARIES EPOLLSHIM_INCLUDE_DIRS) 17 | mark_as_advanced(EPOLLSHIM_INCLUDE_DIRS EPOLLSHIM_LIBRARIES) 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # basic pixel art tool 2 | 3 | The idea is to provide a simple image making tool with relatively short loading times for slow potatoes. 4 | 5 | 6 | - uses raylib + raygui and tinyfiledialogs 7 | - runs on Linux (/Unix?) and Windows 8 | - all dependencies are included 9 | - **build**: 10 | - `make`: build with provided raylib version. 11 | - use `make build_from_global` to use globally installed raylib version. 12 | 13 | (make is not configured to run on Windows) 14 | - to run: `make run` or `./imfap` 15 | 16 | --- 17 | 18 | - supported formats: `.png` `.bmp` `.qoi` `.raw (rgba)` 19 | - can load image from command line argument 20 | 21 | 22 | ## preconfigured for ease of use: 23 | 24 | ![a screenshot showing the default configuration](screenshot.png?raw=true) 25 | 26 | ## why? 27 | 28 | [trying to ease the suffering](https://youtu.be/K7hWqxC_7Mw?t=6303) 29 | 30 | -------------------------------------------------------------------------------- /src/external/raylib/src/raylib.dll.rc: -------------------------------------------------------------------------------- 1 | GLFW_ICON ICON "raylib.ico" 2 | 3 | 1 VERSIONINFO 4 | FILEVERSION 5,0,0,0 5 | PRODUCTVERSION 5,0,0,0 6 | BEGIN 7 | BLOCK "StringFileInfo" 8 | BEGIN 9 | //BLOCK "080904E4" // English UK 10 | BLOCK "040904E4" // English US 11 | BEGIN 12 | //VALUE "CompanyName", "raylib technologies" 13 | VALUE "FileDescription", "raylib dynamic library (www.raylib.com)" 14 | VALUE "FileVersion", "5.0.0" 15 | VALUE "InternalName", "raylib.dll" 16 | VALUE "LegalCopyright", "(c) 2023 Ramon Santamaria (@raysan5)" 17 | VALUE "OriginalFilename", "raylib.dll" 18 | VALUE "ProductName", "raylib" 19 | VALUE "ProductVersion", "5.0.0" 20 | END 21 | END 22 | BLOCK "VarFileInfo" 23 | BEGIN 24 | //VALUE "Translation", 0x809, 1252 // English UK 25 | VALUE "Translation", 0x409, 1252 // English US 26 | END 27 | END 28 | -------------------------------------------------------------------------------- /src/external/raylib/src/raylib.rc: -------------------------------------------------------------------------------- 1 | GLFW_ICON ICON "raylib.ico" 2 | 3 | 1 VERSIONINFO 4 | FILEVERSION 5,0,0,0 5 | PRODUCTVERSION 5,0,0,0 6 | BEGIN 7 | BLOCK "StringFileInfo" 8 | BEGIN 9 | //BLOCK "080904E4" // English UK 10 | BLOCK "040904E4" // English US 11 | BEGIN 12 | //VALUE "CompanyName", "raylib technologies" 13 | VALUE "FileDescription", "raylib application (www.raylib.com)" 14 | VALUE "FileVersion", "5.0.0" 15 | VALUE "InternalName", "raylib app" 16 | VALUE "LegalCopyright", "(c) 2023 Ramon Santamaria (@raysan5)" 17 | //VALUE "OriginalFilename", "raylib_app.exe" 18 | VALUE "ProductName", "raylib app" 19 | VALUE "ProductVersion", "5.0.0" 20 | END 21 | END 22 | BLOCK "VarFileInfo" 23 | BEGIN 24 | //VALUE "Translation", 0x809, 1252 // English UK 25 | VALUE "Translation", 0x409, 1252 // English US 26 | END 27 | END 28 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2024 Lieven Petersen 2 | 3 | This software is provided 'as-is', without any express or implied 4 | warranty. In no event will the authors be held liable for any damages 5 | arising from the use of this software. 6 | 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it 9 | freely, subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not 12 | claim that you wrote the original software. If you use this software 13 | in a product, an acknowledgment in the product documentation would be 14 | appreciated but is not required. 15 | 2. Altered source versions must be plainly marked as such, and must not be 16 | misrepresented as being the original software. 17 | 3. This notice may not be removed or altered from any source distribution. 18 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/src/glfw.rc.in: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | VS_VERSION_INFO VERSIONINFO 5 | FILEVERSION @GLFW_VERSION_MAJOR@,@GLFW_VERSION_MINOR@,@GLFW_VERSION_PATCH@,0 6 | PRODUCTVERSION @GLFW_VERSION_MAJOR@,@GLFW_VERSION_MINOR@,@GLFW_VERSION_PATCH@,0 7 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 8 | FILEFLAGS 0 9 | FILEOS VOS_NT_WINDOWS32 10 | FILETYPE VFT_DLL 11 | FILESUBTYPE 0 12 | { 13 | BLOCK "StringFileInfo" 14 | { 15 | BLOCK "040904B0" 16 | { 17 | VALUE "CompanyName", "GLFW" 18 | VALUE "FileDescription", "GLFW @GLFW_VERSION@ DLL" 19 | VALUE "FileVersion", "@GLFW_VERSION@" 20 | VALUE "OriginalFilename", "glfw3.dll" 21 | VALUE "ProductName", "GLFW" 22 | VALUE "ProductVersion", "@GLFW_VERSION@" 23 | } 24 | } 25 | BLOCK "VarFileInfo" 26 | { 27 | VALUE "Translation", 0x409, 1200 28 | } 29 | } 30 | 31 | -------------------------------------------------------------------------------- /src/external/raylib/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-2023 Ramon Santamaria (@raysan5) 2 | 3 | This software is provided "as-is", without any express or implied warranty. In no event 4 | will the authors be held liable for any damages arising from the use of this software. 5 | 6 | Permission is granted to anyone to use this software for any purpose, including commercial 7 | applications, and to alter it and redistribute it freely, subject to the following restrictions: 8 | 9 | 1. The origin of this software must not be misrepresented; you must not claim that you 10 | wrote the original software. If you use this software in a product, an acknowledgment 11 | in the product documentation would be appreciated but is not required. 12 | 13 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented 14 | as being the original software. 15 | 16 | 3. This notice may not be removed or altered from any source distribution. 17 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2002-2006 Marcus Geelnard 2 | 3 | Copyright (c) 2006-2019 Camilla Löwy 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would 16 | be appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not 19 | be misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | 24 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/CMake/cmake_uninstall.cmake.in: -------------------------------------------------------------------------------- 1 | 2 | if (NOT EXISTS "@GLFW_BINARY_DIR@/install_manifest.txt") 3 | message(FATAL_ERROR "Cannot find install manifest: \"@GLFW_BINARY_DIR@/install_manifest.txt\"") 4 | endif() 5 | 6 | file(READ "@GLFW_BINARY_DIR@/install_manifest.txt" files) 7 | string(REGEX REPLACE "\n" ";" files "${files}") 8 | 9 | foreach (file ${files}) 10 | message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") 11 | if (EXISTS "$ENV{DESTDIR}${file}") 12 | exec_program("@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" 13 | OUTPUT_VARIABLE rm_out 14 | RETURN_VALUE rm_retval) 15 | if (NOT "${rm_retval}" STREQUAL 0) 16 | MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") 17 | endif() 18 | elseif (IS_SYMLINK "$ENV{DESTDIR}${file}") 19 | EXEC_PROGRAM("@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" 20 | OUTPUT_VARIABLE rm_out 21 | RETURN_VALUE rm_retval) 22 | if (NOT "${rm_retval}" STREQUAL 0) 23 | message(FATAL_ERROR "Problem when removing symlink \"$ENV{DESTDIR}${file}\"") 24 | endif() 25 | else() 26 | message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") 27 | endif() 28 | endforeach() 29 | 30 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/src/xkb_unicode.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.4 Linux - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2014 Jonas Ådahl 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #define GLFW_INVALID_CODEPOINT 0xffffffffu 28 | 29 | uint32_t _glfwKeySym2Unicode(unsigned int keysym); 30 | 31 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/CMake/Info.plist.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${MACOSX_BUNDLE_EXECUTABLE_NAME} 9 | CFBundleGetInfoString 10 | ${MACOSX_BUNDLE_INFO_STRING} 11 | CFBundleIconFile 12 | ${MACOSX_BUNDLE_ICON_FILE} 13 | CFBundleIdentifier 14 | ${MACOSX_BUNDLE_GUI_IDENTIFIER} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleLongVersionString 18 | ${MACOSX_BUNDLE_LONG_VERSION_STRING} 19 | CFBundleName 20 | ${MACOSX_BUNDLE_BUNDLE_NAME} 21 | CFBundlePackageType 22 | APPL 23 | CFBundleShortVersionString 24 | ${MACOSX_BUNDLE_SHORT_VERSION_STRING} 25 | CFBundleSignature 26 | ???? 27 | CFBundleVersion 28 | ${MACOSX_BUNDLE_BUNDLE_VERSION} 29 | CSResourcesFileMapped 30 | 31 | LSRequiresCarbon 32 | 33 | NSHumanReadableCopyright 34 | ${MACOSX_BUNDLE_COPYRIGHT} 35 | NSHighResolutionCapable 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/src/cocoa_time.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.4 macOS - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2009-2021 Camilla Löwy 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #define GLFW_COCOA_LIBRARY_TIMER_STATE _GLFWtimerNS ns; 28 | 29 | // Cocoa-specific global timer data 30 | // 31 | typedef struct _GLFWtimerNS 32 | { 33 | uint64_t frequency; 34 | } _GLFWtimerNS; 35 | 36 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/src/null_joystick.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.4 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2006-2017 Camilla Löwy 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | GLFWbool _glfwInitJoysticksNull(void); 28 | void _glfwTerminateJoysticksNull(void); 29 | GLFWbool _glfwPollJoystickNull(_GLFWjoystick* js, int mode); 30 | const char* _glfwGetMappingNameNull(void); 31 | void _glfwUpdateGamepadGUIDNull(char* guid); 32 | 33 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/src/posix_poll.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.4 POSIX - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2022 Camilla Löwy 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | // It is fine to use C99 in this file because it will not be built with VS 27 | //======================================================================== 28 | 29 | #include 30 | 31 | GLFWbool _glfwPollPOSIX(struct pollfd* fds, nfds_t count, double* timeout); 32 | 33 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/src/win32_time.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.4 Win32 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2002-2006 Marcus Geelnard 5 | // Copyright (c) 2006-2017 Camilla Löwy 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | 28 | #include 29 | 30 | #define GLFW_WIN32_LIBRARY_TIMER_STATE _GLFWtimerWin32 win32; 31 | 32 | // Win32-specific global timer data 33 | // 34 | typedef struct _GLFWtimerWin32 35 | { 36 | uint64_t frequency; 37 | } _GLFWtimerWin32; 38 | 39 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/src/posix_time.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.4 POSIX - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2002-2006 Marcus Geelnard 5 | // Copyright (c) 2006-2017 Camilla Löwy 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | 28 | #define GLFW_POSIX_LIBRARY_TIMER_STATE _GLFWtimerPOSIX posix; 29 | 30 | #include 31 | #include 32 | 33 | 34 | // POSIX-specific global timer data 35 | // 36 | typedef struct _GLFWtimerPOSIX 37 | { 38 | clockid_t clock; 39 | uint64_t frequency; 40 | } _GLFWtimerPOSIX; 41 | 42 | -------------------------------------------------------------------------------- /src/util.h: -------------------------------------------------------------------------------- 1 | /* 2 | * zlib license: 3 | * 4 | * Copyright (c) 2024 Lieven Petersen 5 | * 6 | * This software is provided 'as-is', without any express or implied 7 | * warranty. In no event will the authors be held liable for any damages 8 | * arising from the use of this software. 9 | * 10 | * Permission is granted to anyone to use this software for any purpose, 11 | * including commercial applications, and to alter it and redistribute it 12 | * freely, subject to the following restrictions: 13 | * 14 | * 1. The origin of this software must not be misrepresented; you must not 15 | * claim that you wrote the original software. If you use this software 16 | * in a product, an acknowledgment in the product documentation would be 17 | * appreciated but is not required. 18 | * 2. Altered source versions must be plainly marked as such, and must not be 19 | * misrepresented as being the original software. 20 | * 3. This notice may not be removed or altered from any source distribution. 21 | */ 22 | 23 | #ifndef __UTIL_H 24 | #define __UTIL_H 25 | 26 | #include "external/raylib/src/raylib.h" 27 | 28 | // fields are READONLY 29 | typedef struct color_t{ 30 | Color rgba; // READONLY 31 | Vector3 hsv; // READONLY 32 | }color_t; 33 | 34 | Color HSVToColor(Vector3 hsv, unsigned char alpha); 35 | void setFromRGBA(color_t *color, Color rgba); 36 | void setFromHSV(color_t *color, Vector3 hsv); 37 | 38 | enum CURSOR_MODE{ 39 | CURSOR_DEFAULT, 40 | CURSOR_PIPETTE, 41 | CURSOR_COLOR_FILL, 42 | }; 43 | 44 | void toggleTool(enum CURSOR_MODE *cursor, enum CURSOR_MODE tool); 45 | 46 | void setWindowTitleToPath(const char *image_path); 47 | 48 | #endif // __UTIL_H 49 | -------------------------------------------------------------------------------- /src/util.c: -------------------------------------------------------------------------------- 1 | /* 2 | * zlib license: 3 | * 4 | * Copyright (c) 2024 Lieven Petersen 5 | * 6 | * This software is provided 'as-is', without any express or implied 7 | * warranty. In no event will the authors be held liable for any damages 8 | * arising from the use of this software. 9 | * 10 | * Permission is granted to anyone to use this software for any purpose, 11 | * including commercial applications, and to alter it and redistribute it 12 | * freely, subject to the following restrictions: 13 | * 14 | * 1. The origin of this software must not be misrepresented; you must not 15 | * claim that you wrote the original software. If you use this software 16 | * in a product, an acknowledgment in the product documentation would be 17 | * appreciated but is not required. 18 | * 2. Altered source versions must be plainly marked as such, and must not be 19 | * misrepresented as being the original software. 20 | * 3. This notice may not be removed or altered from any source distribution. 21 | */ 22 | 23 | #include 24 | 25 | #include "util.h" 26 | 27 | 28 | Color HSVToColor(Vector3 hsv, unsigned char alpha){ 29 | Color color = ColorFromHSV(hsv.x, hsv.y, hsv.z); 30 | color.a = alpha; 31 | return color; 32 | } 33 | 34 | void setFromRGBA(color_t *color, Color rgba){ 35 | color->rgba = rgba; 36 | color->hsv = ColorToHSV(rgba); 37 | } 38 | 39 | void setFromHSV(color_t *color, Vector3 hsv){ 40 | color->hsv = hsv; 41 | color->rgba = HSVToColor(hsv, color->rgba.a); 42 | } 43 | 44 | void toggleTool(enum CURSOR_MODE *cursor, enum CURSOR_MODE tool){ 45 | if (*cursor != tool) *cursor = tool; 46 | else *cursor = CURSOR_DEFAULT; 47 | } 48 | 49 | void setWindowTitleToPath(const char *image_path){ 50 | char title[300]; 51 | sprintf(title, "%s - Image maker for angry programmers", image_path); 52 | SetWindowTitle(title); 53 | } 54 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/CMake/GenerateMappings.cmake: -------------------------------------------------------------------------------- 1 | # Usage: 2 | # cmake -P GenerateMappings.cmake 3 | 4 | set(source_url "https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt") 5 | set(source_path "${CMAKE_CURRENT_BINARY_DIR}/gamecontrollerdb.txt") 6 | set(template_path "${CMAKE_ARGV3}") 7 | set(target_path "${CMAKE_ARGV4}") 8 | 9 | if (NOT EXISTS "${template_path}") 10 | message(FATAL_ERROR "Failed to find template file ${template_path}") 11 | endif() 12 | 13 | file(DOWNLOAD "${source_url}" "${source_path}" 14 | STATUS download_status 15 | TLS_VERIFY on) 16 | 17 | list(GET download_status 0 status_code) 18 | list(GET download_status 1 status_message) 19 | 20 | if (status_code) 21 | message(FATAL_ERROR "Failed to download ${source_url}: ${status_message}") 22 | endif() 23 | 24 | file(STRINGS "${source_path}" lines) 25 | foreach(line ${lines}) 26 | if (line MATCHES "^[0-9a-fA-F]") 27 | if (line MATCHES "platform:Windows") 28 | if (GLFW_WIN32_MAPPINGS) 29 | string(APPEND GLFW_WIN32_MAPPINGS "\n") 30 | endif() 31 | string(APPEND GLFW_WIN32_MAPPINGS "\"${line}\",") 32 | elseif (line MATCHES "platform:Mac OS X") 33 | if (GLFW_COCOA_MAPPINGS) 34 | string(APPEND GLFW_COCOA_MAPPINGS "\n") 35 | endif() 36 | string(APPEND GLFW_COCOA_MAPPINGS "\"${line}\",") 37 | elseif (line MATCHES "platform:Linux") 38 | if (GLFW_LINUX_MAPPINGS) 39 | string(APPEND GLFW_LINUX_MAPPINGS "\n") 40 | endif() 41 | string(APPEND GLFW_LINUX_MAPPINGS "\"${line}\",") 42 | endif() 43 | endif() 44 | endforeach() 45 | 46 | configure_file("${template_path}" "${target_path}" @ONLY NEWLINE_STYLE UNIX) 47 | file(REMOVE "${source_path}") 48 | 49 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/src/posix_thread.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.4 POSIX - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2002-2006 Marcus Geelnard 5 | // Copyright (c) 2006-2017 Camilla Löwy 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | 28 | #include 29 | 30 | #define GLFW_POSIX_TLS_STATE _GLFWtlsPOSIX posix; 31 | #define GLFW_POSIX_MUTEX_STATE _GLFWmutexPOSIX posix; 32 | 33 | 34 | // POSIX-specific thread local storage data 35 | // 36 | typedef struct _GLFWtlsPOSIX 37 | { 38 | GLFWbool allocated; 39 | pthread_key_t key; 40 | } _GLFWtlsPOSIX; 41 | 42 | // POSIX-specific mutex data 43 | // 44 | typedef struct _GLFWmutexPOSIX 45 | { 46 | GLFWbool allocated; 47 | pthread_mutex_t handle; 48 | } _GLFWmutexPOSIX; 49 | 50 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/src/win32_thread.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.4 Win32 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2002-2006 Marcus Geelnard 5 | // Copyright (c) 2006-2017 Camilla Löwy 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | 28 | #include 29 | 30 | #define GLFW_WIN32_TLS_STATE _GLFWtlsWin32 win32; 31 | #define GLFW_WIN32_MUTEX_STATE _GLFWmutexWin32 win32; 32 | 33 | // Win32-specific thread local storage data 34 | // 35 | typedef struct _GLFWtlsWin32 36 | { 37 | GLFWbool allocated; 38 | DWORD index; 39 | } _GLFWtlsWin32; 40 | 41 | // Win32-specific mutex data 42 | // 43 | typedef struct _GLFWmutexWin32 44 | { 45 | GLFWbool allocated; 46 | CRITICAL_SECTION section; 47 | } _GLFWmutexWin32; 48 | 49 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/src/cocoa_joystick.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.4 Cocoa - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2006-2017 Camilla Löwy 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | #define GLFW_COCOA_JOYSTICK_STATE _GLFWjoystickNS ns; 32 | #define GLFW_COCOA_LIBRARY_JOYSTICK_STATE 33 | 34 | #define GLFW_BUILD_COCOA_MAPPINGS 35 | 36 | // Cocoa-specific per-joystick data 37 | // 38 | typedef struct _GLFWjoystickNS 39 | { 40 | IOHIDDeviceRef device; 41 | CFMutableArrayRef axes; 42 | CFMutableArrayRef buttons; 43 | CFMutableArrayRef hats; 44 | } _GLFWjoystickNS; 45 | 46 | GLFWbool _glfwInitJoysticksCocoa(void); 47 | void _glfwTerminateJoysticksCocoa(void); 48 | GLFWbool _glfwPollJoystickCocoa(_GLFWjoystick* js, int mode); 49 | const char* _glfwGetMappingNameCocoa(void); 50 | void _glfwUpdateGamepadGUIDCocoa(char* guid); 51 | 52 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/src/win32_module.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.4 Win32 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2021 Camilla Löwy 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | // Please use C89 style variable declarations in this file because VS 2010 27 | //======================================================================== 28 | 29 | #include "internal.h" 30 | 31 | ////////////////////////////////////////////////////////////////////////// 32 | ////// GLFW platform API ////// 33 | ////////////////////////////////////////////////////////////////////////// 34 | 35 | void* _glfwPlatformLoadModule(const char* path) 36 | { 37 | return LoadLibraryA(path); 38 | } 39 | 40 | void _glfwPlatformFreeModule(void* module) 41 | { 42 | FreeLibrary((HMODULE) module); 43 | } 44 | 45 | GLFWproc _glfwPlatformGetModuleSymbol(void* module, const char* name) 46 | { 47 | return (GLFWproc) GetProcAddress((HMODULE) module, name); 48 | } 49 | 50 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/src/posix_module.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.4 POSIX - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2021 Camilla Löwy 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | // It is fine to use C99 in this file because it will not be built with VS 27 | //======================================================================== 28 | 29 | #include "internal.h" 30 | 31 | #include 32 | 33 | ////////////////////////////////////////////////////////////////////////// 34 | ////// GLFW platform API ////// 35 | ////////////////////////////////////////////////////////////////////////// 36 | 37 | void* _glfwPlatformLoadModule(const char* path) 38 | { 39 | return dlopen(path, RTLD_LAZY | RTLD_LOCAL); 40 | } 41 | 42 | void _glfwPlatformFreeModule(void* module) 43 | { 44 | dlclose(module); 45 | } 46 | 47 | GLFWproc _glfwPlatformGetModuleSymbol(void* module, const char* name) 48 | { 49 | return dlsym(module, name); 50 | } 51 | 52 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/src/win32_joystick.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.4 Win32 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2006-2017 Camilla Löwy 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #define GLFW_WIN32_JOYSTICK_STATE _GLFWjoystickWin32 win32; 28 | #define GLFW_WIN32_LIBRARY_JOYSTICK_STATE 29 | 30 | #define GLFW_BUILD_WIN32_MAPPINGS 31 | 32 | // Joystick element (axis, button or slider) 33 | // 34 | typedef struct _GLFWjoyobjectWin32 35 | { 36 | int offset; 37 | int type; 38 | } _GLFWjoyobjectWin32; 39 | 40 | // Win32-specific per-joystick data 41 | // 42 | typedef struct _GLFWjoystickWin32 43 | { 44 | _GLFWjoyobjectWin32* objects; 45 | int objectCount; 46 | IDirectInputDevice8W* device; 47 | DWORD index; 48 | GUID guid; 49 | } _GLFWjoystickWin32; 50 | 51 | void _glfwDetectJoystickConnectionWin32(void); 52 | void _glfwDetectJoystickDisconnectionWin32(void); 53 | 54 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/src/null_joystick.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.4 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2016-2017 Camilla Löwy 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | // It is fine to use C99 in this file because it will not be built with VS 27 | //======================================================================== 28 | 29 | #include "internal.h" 30 | 31 | 32 | ////////////////////////////////////////////////////////////////////////// 33 | ////// GLFW platform API ////// 34 | ////////////////////////////////////////////////////////////////////////// 35 | 36 | GLFWbool _glfwInitJoysticksNull(void) 37 | { 38 | return GLFW_TRUE; 39 | } 40 | 41 | void _glfwTerminateJoysticksNull(void) 42 | { 43 | } 44 | 45 | GLFWbool _glfwPollJoystickNull(_GLFWjoystick* js, int mode) 46 | { 47 | return GLFW_FALSE; 48 | } 49 | 50 | const char* _glfwGetMappingNameNull(void) 51 | { 52 | return ""; 53 | } 54 | 55 | void _glfwUpdateGamepadGUIDNull(char* guid) 56 | { 57 | } 58 | 59 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/src/cocoa_time.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.4 macOS - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2009-2016 Camilla Löwy 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | // It is fine to use C99 in this file because it will not be built with VS 27 | //======================================================================== 28 | 29 | #include "internal.h" 30 | 31 | #include 32 | 33 | 34 | ////////////////////////////////////////////////////////////////////////// 35 | ////// GLFW platform API ////// 36 | ////////////////////////////////////////////////////////////////////////// 37 | 38 | void _glfwPlatformInitTimer(void) 39 | { 40 | mach_timebase_info_data_t info; 41 | mach_timebase_info(&info); 42 | 43 | _glfw.timer.ns.frequency = (info.denom * 1e9) / info.numer; 44 | } 45 | 46 | uint64_t _glfwPlatformGetTimerValue(void) 47 | { 48 | return mach_absolute_time(); 49 | } 50 | 51 | uint64_t _glfwPlatformGetTimerFrequency(void) 52 | { 53 | return _glfw.timer.ns.frequency; 54 | } 55 | 56 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/src/win32_time.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.4 Win32 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2002-2006 Marcus Geelnard 5 | // Copyright (c) 2006-2017 Camilla Löwy 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | // Please use C89 style variable declarations in this file because VS 2010 28 | //======================================================================== 29 | 30 | #include "internal.h" 31 | 32 | 33 | ////////////////////////////////////////////////////////////////////////// 34 | ////// GLFW platform API ////// 35 | ////////////////////////////////////////////////////////////////////////// 36 | 37 | void _glfwPlatformInitTimer(void) 38 | { 39 | QueryPerformanceFrequency((LARGE_INTEGER*) &_glfw.timer.win32.frequency); 40 | } 41 | 42 | uint64_t _glfwPlatformGetTimerValue(void) 43 | { 44 | uint64_t value; 45 | QueryPerformanceCounter((LARGE_INTEGER*) &value); 46 | return value; 47 | } 48 | 49 | uint64_t _glfwPlatformGetTimerFrequency(void) 50 | { 51 | return _glfw.timer.win32.frequency; 52 | } 53 | 54 | -------------------------------------------------------------------------------- /src/canvas.h: -------------------------------------------------------------------------------- 1 | /* 2 | * zlib license: 3 | * 4 | * Copyright (c) 2024 Lieven Petersen 5 | * 6 | * This software is provided 'as-is', without any express or implied 7 | * warranty. In no event will the authors be held liable for any damages 8 | * arising from the use of this software. 9 | * 10 | * Permission is granted to anyone to use this software for any purpose, 11 | * including commercial applications, and to alter it and redistribute it 12 | * freely, subject to the following restrictions: 13 | * 14 | * 1. The origin of this software must not be misrepresented; you must not 15 | * claim that you wrote the original software. If you use this software 16 | * in a product, an acknowledgment in the product documentation would be 17 | * appreciated but is not required. 18 | * 2. Altered source versions must be plainly marked as such, and must not be 19 | * misrepresented as being the original software. 20 | * 3. This notice may not be removed or altered from any source distribution. 21 | */ 22 | 23 | #ifndef __CANVAS_H 24 | #define __CANVAS_H 25 | 26 | #include "external/raylib/src/raylib.h" 27 | 28 | // all fields are readonly 29 | typedef struct canvas_t canvas_t; 30 | 31 | canvas_t *canvas_new(Image content); 32 | void canvas_free(canvas_t *canvas); 33 | 34 | // do not modify or unload the returned texture. it is still owned by the canvas! 35 | Texture2D canvas_nextFrame(canvas_t *canvas); 36 | 37 | void canvas_setToImage(canvas_t *canvas, Image image); 38 | void canvas_setPixel(canvas_t *canvas, Vector2 pixel, Color color); 39 | 40 | Image canvas_getContent(canvas_t *canvas); 41 | Vector2 canvas_getSize(canvas_t *canvas); 42 | Color canvas_getPixel(canvas_t *canvas, Vector2 pixel); 43 | 44 | void canvas_nextPixelStroke(canvas_t *canvas); 45 | 46 | // return true if the size of the canvas changed 47 | bool canvas_undo(canvas_t *canvas); 48 | bool canvas_redo(canvas_t *canvas); 49 | 50 | void canvas_resize(canvas_t *canvas, Vector2 new_size, Color fill); 51 | // factor > 1 increases resolution, factor < 1 decreases resolution. 52 | void canvas_changeResolution(canvas_t *canvas, float factor); 53 | 54 | void canvas_blendPixel(canvas_t *canvas, Vector2 pixel, Color color); 55 | void canvas_colorFlood(canvas_t *canvas, Vector2 source, Color flood); 56 | 57 | bool canvas_saveAsImage(canvas_t *canvas, const char *path); 58 | 59 | #endif // __CANVAS_H 60 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/deps/getopt.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012, Kim Gräsman 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * * Redistributions of source code must retain the above copyright notice, 7 | * this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above copyright notice, 9 | * this list of conditions and the following disclaimer in the documentation 10 | * and/or other materials provided with the distribution. 11 | * * Neither the name of Kim Gräsman nor the names of contributors may be used 12 | * to endorse or promote products derived from this software without specific 13 | * prior written permission. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | * ARE DISCLAIMED. IN NO EVENT SHALL KIM GRÄSMAN BE LIABLE FOR ANY DIRECT, 19 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #ifndef INCLUDED_GETOPT_PORT_H 28 | #define INCLUDED_GETOPT_PORT_H 29 | 30 | #if defined(__cplusplus) 31 | extern "C" { 32 | #endif 33 | 34 | extern const int no_argument; 35 | extern const int required_argument; 36 | extern const int optional_argument; 37 | 38 | extern char* optarg; 39 | extern int optind, opterr, optopt; 40 | 41 | struct option { 42 | const char* name; 43 | int has_arg; 44 | int* flag; 45 | int val; 46 | }; 47 | 48 | int getopt(int argc, char* const argv[], const char* optstring); 49 | 50 | int getopt_long(int argc, char* const argv[], 51 | const char* optstring, const struct option* longopts, int* longindex); 52 | 53 | #if defined(__cplusplus) 54 | } 55 | #endif 56 | 57 | #endif // INCLUDED_GETOPT_PORT_H 58 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # available targets: Linux, Windows, WEB 2 | # (all build on Linux) 3 | TARGET ?= Linux 4 | 5 | CC = cc 6 | PLATFORM = -DPLATFORM_DESKTOP 7 | ifeq ($(TARGET), Windows) 8 | CC = x86_64-w64-mingw32-gcc 9 | else ifeq ($(TARGET), WEB) 10 | CC = clang 11 | PLATFORM = -DPLATFORM_WASM 12 | endif 13 | 14 | 15 | # options given via environment variables. 16 | # for ex.: 'TARGET=Windows FONT=0 make' 17 | OPTIONS = 18 | ifeq ($(FONT), 0) 19 | OPTIONS += -DDISABLE_CUSTOM_FONT 20 | endif 21 | 22 | # flags for building imFAP 23 | FLAGS := -Wall -Wextra -pedantic -ggdb 24 | ifeq ($(TARGET), WEB) 25 | STDLIB_32_INC = -I/usr/include/ 26 | WASM_CFLAGS := --target=wasm32 $(STDLIB_32_INC) -nostdlib -O2 27 | WASM_LDFLAGS := -Wl,--allow-undefined -Wl,--no-entry -Wl,--lto-O2 -Wl,--export=maine # note: main function can't be exported(?) 28 | FLAGS := $(WASM_CFLAGS) $(WASM_LDFLAGS) 29 | endif 30 | 31 | SRC_DIR = src 32 | SRCS = $(wildcard $(SRC_DIR)/*.c) $(SRC_DIR)/external/tinyfiledialogs/tinyfiledialogs.c 33 | 34 | OUTPUT_LIN = imfap 35 | OUTPUT_WIN = imfap.exe 36 | OUTPUT_WEB = imfap.wasm 37 | 38 | OUTPUT = $(OUTPUT_LIN) 39 | ifeq ($(TARGET), Windows) 40 | OUTPUT = $(OUTPUT_WIN) 41 | else ifeq ($(TARGET), WEB) 42 | OUTPUT = $(OUTPUT_WEB) 43 | endif 44 | 45 | LIBS = -lm 46 | ifeq ($(TARGET), Windows) 47 | LIBS = -lopengl32 -lgdi32 -lwinmm -lcomdlg32 -lole32 48 | # lcomdlg32 and lol32 are for tinyfiledialogs 49 | else ifeq ($(TARGET), WEB) 50 | LIBS = 51 | endif 52 | 53 | RAY_PATH = $(SRC_DIR)/external/raylib/src/ 54 | RAY_SRCS = $(wildcard $(addsuffix *.c, $(RAY_PATH))) 55 | ifeq ($(TARGET), WEB) 56 | RAY_SRCS := $(filter-out $(RAY_PATH)rglfw.c, $(RAY_SRCS)) 57 | endif 58 | RAY_OBJS = $(RAY_SRCS:c=o) 59 | 60 | # flags for building raylib locally 61 | CFLAGS = $(PLATFORM) -I$(RAY_PATH)external/glfw/include 62 | ifeq ($(TARGET), WEB) 63 | CFLAGS := $(PLATFORM) $(WASM_CFLAGS) 64 | endif 65 | 66 | all: build 67 | 68 | run: build 69 | ifeq ($(TARGET), Windows) 70 | wine $(OUTPUT) 71 | else 72 | ./$(OUTPUT) 73 | endif 74 | 75 | # build from globally installed raylib library 76 | build_from_global: $(SRCS) 77 | $(CC) -o $(OUTPUT) $(SRCS) $(FLAGS) $(OPTIONS) -lraylib $(LIBS) 78 | 79 | # build with provided version of raylib 80 | build: $(SRCS) $(RAY_OBJS) 81 | $(CC) -o $(OUTPUT) $(SRCS) $(RAY_OBJS) -I$(RAY_PATH) $(FLAGS) $(OPTIONS) $(LIBS) 82 | 83 | clean: 84 | rm -f $(OUTPUT_LIN) 85 | rm -f $(OUTPUT_WIN) 86 | rm -f $(OUTPUT_WEB) 87 | rm -f $(RAY_OBJS) 88 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/src/posix_time.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.4 POSIX - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2002-2006 Marcus Geelnard 5 | // Copyright (c) 2006-2017 Camilla Löwy 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | // It is fine to use C99 in this file because it will not be built with VS 28 | //======================================================================== 29 | 30 | #include "internal.h" 31 | 32 | #include 33 | #include 34 | 35 | 36 | ////////////////////////////////////////////////////////////////////////// 37 | ////// GLFW platform API ////// 38 | ////////////////////////////////////////////////////////////////////////// 39 | 40 | void _glfwPlatformInitTimer(void) 41 | { 42 | _glfw.timer.posix.clock = CLOCK_REALTIME; 43 | _glfw.timer.posix.frequency = 1000000000; 44 | 45 | #if defined(_POSIX_MONOTONIC_CLOCK) 46 | struct timespec ts; 47 | if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) 48 | _glfw.timer.posix.clock = CLOCK_MONOTONIC; 49 | #endif 50 | } 51 | 52 | uint64_t _glfwPlatformGetTimerValue(void) 53 | { 54 | struct timespec ts; 55 | clock_gettime(_glfw.timer.posix.clock, &ts); 56 | return (uint64_t) ts.tv_sec * _glfw.timer.posix.frequency + (uint64_t) ts.tv_nsec; 57 | } 58 | 59 | uint64_t _glfwPlatformGetTimerFrequency(void) 60 | { 61 | return _glfw.timer.posix.frequency; 62 | } 63 | 64 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/src/linux_joystick.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.4 Linux - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2014 Jonas Ådahl 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | #define GLFW_LINUX_JOYSTICK_STATE _GLFWjoystickLinux linjs; 32 | #define GLFW_LINUX_LIBRARY_JOYSTICK_STATE _GLFWlibraryLinux linjs; 33 | 34 | #define GLFW_BUILD_LINUX_MAPPINGS 35 | 36 | // Linux-specific joystick data 37 | // 38 | typedef struct _GLFWjoystickLinux 39 | { 40 | int fd; 41 | char path[PATH_MAX]; 42 | int keyMap[KEY_CNT - BTN_MISC]; 43 | int absMap[ABS_CNT]; 44 | struct input_absinfo absInfo[ABS_CNT]; 45 | int hats[4][2]; 46 | } _GLFWjoystickLinux; 47 | 48 | // Linux-specific joystick API data 49 | // 50 | typedef struct _GLFWlibraryLinux 51 | { 52 | int inotify; 53 | int watch; 54 | regex_t regex; 55 | GLFWbool dropped; 56 | } _GLFWlibraryLinux; 57 | 58 | void _glfwDetectJoystickConnectionLinux(void); 59 | 60 | GLFWbool _glfwInitJoysticksLinux(void); 61 | void _glfwTerminateJoysticksLinux(void); 62 | GLFWbool _glfwPollJoystickLinux(_GLFWjoystick* js, int mode); 63 | const char* _glfwGetMappingNameLinux(void); 64 | void _glfwUpdateGamepadGUIDLinux(char* guid); 65 | 66 | -------------------------------------------------------------------------------- /src/menu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * zlib license: 3 | * 4 | * Copyright (c) 2024 Lieven Petersen 5 | * 6 | * This software is provided 'as-is', without any express or implied 7 | * warranty. In no event will the authors be held liable for any damages 8 | * arising from the use of this software. 9 | * 10 | * Permission is granted to anyone to use this software for any purpose, 11 | * including commercial applications, and to alter it and redistribute it 12 | * freely, subject to the following restrictions: 13 | * 14 | * 1. The origin of this software must not be misrepresented; you must not 15 | * claim that you wrote the original software. If you use this software 16 | * in a product, an acknowledgment in the product documentation would be 17 | * appreciated but is not required. 18 | * 2. Altered source versions must be plainly marked as such, and must not be 19 | * misrepresented as being the original software. 20 | * 3. This notice may not be removed or altered from any source distribution. 21 | */ 22 | 23 | #ifndef __MENU_H 24 | #define __MENU_H 25 | 26 | #include "external/raylib/src/raylib.h" 27 | 28 | 29 | #include "canvas.h" 30 | #include "util.h" 31 | 32 | #define FAV_COLOR ((Color){0x18, 0x18, 0x18, 0xFF}) // sorry, but AA is a bit impractical 33 | #define STD_COLOR ((Color){0xFF, 0x00, 0x00, 0xFF}) 34 | #define DFT_COLOR ((Color){0xFF, 0xD7, 0x00, 0xFF}) 35 | 36 | #ifndef DEFAULT_FONT_SIZE 37 | #define DEFAULT_FONT_SIZE 30 38 | #endif //DEFAULT_FONT_SIZE 39 | 40 | // DIM_STRLEN-1 digits can be entered when resizing the canvas 41 | #define DIM_STRLEN 4 42 | 43 | #define MAX_FILENAME_SIZE 200 44 | 45 | 46 | typedef struct shared_state_t{ 47 | color_t active_color; 48 | canvas_t *canvas; 49 | Rectangle menu_rect; 50 | enum CURSOR_MODE cursor; 51 | Rectangle dragger; 52 | bool forceImageResize; 53 | bool forceMenuReset; 54 | bool forceWindowResize; 55 | bool showGrid; 56 | bool isUsingMouse; 57 | }shared_state_t; 58 | 59 | typedef struct menu_state_t{ 60 | // TODO: make field + isEditing abstraction 61 | char *hex_field, *x_field, *y_field, *filename, *filename_old; 62 | bool isEditingHexField, isEditingFileName, isEditingXField, isEditingYField; 63 | int font_size; 64 | #ifndef DISABLE_CUSTOM_FONT 65 | Font *fonts; 66 | Font font; 67 | #endif 68 | Vector2 dragOffset; 69 | Vector2 dragOrigin; 70 | int originalMenuWidth; 71 | bool isDragging; 72 | bool isClick; 73 | }menu_state_t; 74 | 75 | menu_state_t initMenu(char *image_name); 76 | void drawMenu(shared_state_t *s, menu_state_t *ms); 77 | void unloadMenu(menu_state_t *ms); 78 | 79 | // utils 80 | #define MIN(a, b) (ab? (a) : (b)) 82 | 83 | #endif // __MENU_H 84 | -------------------------------------------------------------------------------- /src/external/raylib/src/utils.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************************** 2 | * 3 | * raylib.utils - Some common utility functions 4 | * 5 | * 6 | * LICENSE: zlib/libpng 7 | * 8 | * Copyright (c) 2014-2023 Ramon Santamaria (@raysan5) 9 | * 10 | * This software is provided "as-is", without any express or implied warranty. In no event 11 | * will the authors be held liable for any damages arising from the use of this software. 12 | * 13 | * Permission is granted to anyone to use this software for any purpose, including commercial 14 | * applications, and to alter it and redistribute it freely, subject to the following restrictions: 15 | * 16 | * 1. The origin of this software must not be misrepresented; you must not claim that you 17 | * wrote the original software. If you use this software in a product, an acknowledgment 18 | * in the product documentation would be appreciated but is not required. 19 | * 20 | * 2. Altered source versions must be plainly marked as such, and must not be misrepresented 21 | * as being the original software. 22 | * 23 | * 3. This notice may not be removed or altered from any source distribution. 24 | * 25 | **********************************************************************************************/ 26 | 27 | #ifndef UTILS_H 28 | #define UTILS_H 29 | 30 | #if defined(PLATFORM_ANDROID) 31 | #include // Required for: FILE 32 | #include // Required for: AAssetManager 33 | #endif 34 | 35 | #if defined(SUPPORT_TRACELOG) 36 | #define TRACELOG(level, ...) TraceLog(level, __VA_ARGS__) 37 | 38 | #if defined(SUPPORT_TRACELOG_DEBUG) 39 | #define TRACELOGD(...) TraceLog(LOG_DEBUG, __VA_ARGS__) 40 | #else 41 | #define TRACELOGD(...) (void)0 42 | #endif 43 | #else 44 | #define TRACELOG(level, ...) (void)0 45 | #define TRACELOGD(...) (void)0 46 | #endif 47 | 48 | //---------------------------------------------------------------------------------- 49 | // Some basic Defines 50 | //---------------------------------------------------------------------------------- 51 | #if defined(PLATFORM_ANDROID) 52 | #define fopen(name, mode) android_fopen(name, mode) 53 | #endif 54 | 55 | //---------------------------------------------------------------------------------- 56 | // Types and Structures Definition 57 | //---------------------------------------------------------------------------------- 58 | //... 59 | 60 | //---------------------------------------------------------------------------------- 61 | // Global Variables Definition 62 | //---------------------------------------------------------------------------------- 63 | // Nop... 64 | 65 | //---------------------------------------------------------------------------------- 66 | // Module Functions Declaration 67 | //---------------------------------------------------------------------------------- 68 | #if defined(__cplusplus) 69 | extern "C" { // Prevents name mangling of functions 70 | #endif 71 | 72 | #if defined(PLATFORM_ANDROID) 73 | void InitAssetManager(AAssetManager *manager, const char *dataPath); // Initialize asset manager from android app 74 | FILE *android_fopen(const char *fileName, const char *mode); // Replacement for fopen() -> Read-only! 75 | #endif 76 | 77 | #if defined(__cplusplus) 78 | } 79 | #endif 80 | 81 | #endif // UTILS_H 82 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/src/posix_poll.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.4 POSIX - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2022 Camilla Löwy 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | // It is fine to use C99 in this file because it will not be built with VS 27 | //======================================================================== 28 | 29 | #define _GNU_SOURCE 30 | 31 | #include "internal.h" 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | GLFWbool _glfwPollPOSIX(struct pollfd* fds, nfds_t count, double* timeout) 38 | { 39 | for (;;) 40 | { 41 | if (timeout) 42 | { 43 | const uint64_t base = _glfwPlatformGetTimerValue(); 44 | 45 | #if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__CYGWIN__) 46 | const time_t seconds = (time_t) *timeout; 47 | const long nanoseconds = (long) ((*timeout - seconds) * 1e9); 48 | const struct timespec ts = { seconds, nanoseconds }; 49 | const int result = ppoll(fds, count, &ts, NULL); 50 | #elif defined(__NetBSD__) 51 | const time_t seconds = (time_t) *timeout; 52 | const long nanoseconds = (long) ((*timeout - seconds) * 1e9); 53 | const struct timespec ts = { seconds, nanoseconds }; 54 | const int result = pollts(fds, count, &ts, NULL); 55 | #else 56 | const int milliseconds = (int) (*timeout * 1e3); 57 | const int result = poll(fds, count, milliseconds); 58 | #endif 59 | const int error = errno; // clock_gettime may overwrite our error 60 | 61 | *timeout -= (_glfwPlatformGetTimerValue() - base) / 62 | (double) _glfwPlatformGetTimerFrequency(); 63 | 64 | if (result > 0) 65 | return GLFW_TRUE; 66 | else if (result == -1 && error != EINTR && error != EAGAIN) 67 | return GLFW_FALSE; 68 | else if (*timeout <= 0.0) 69 | return GLFW_FALSE; 70 | } 71 | else 72 | { 73 | const int result = poll(fds, count, -1); 74 | if (result > 0) 75 | return GLFW_TRUE; 76 | else if (result == -1 && errno != EINTR && errno != EAGAIN) 77 | return GLFW_FALSE; 78 | } 79 | } 80 | } 81 | 82 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/src/win32_thread.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.4 Win32 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2002-2006 Marcus Geelnard 5 | // Copyright (c) 2006-2017 Camilla Löwy 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | // Please use C89 style variable declarations in this file because VS 2010 28 | //======================================================================== 29 | 30 | #include "internal.h" 31 | 32 | #include 33 | 34 | 35 | ////////////////////////////////////////////////////////////////////////// 36 | ////// GLFW platform API ////// 37 | ////////////////////////////////////////////////////////////////////////// 38 | 39 | GLFWbool _glfwPlatformCreateTls(_GLFWtls* tls) 40 | { 41 | assert(tls->win32.allocated == GLFW_FALSE); 42 | 43 | tls->win32.index = TlsAlloc(); 44 | if (tls->win32.index == TLS_OUT_OF_INDEXES) 45 | { 46 | _glfwInputError(GLFW_PLATFORM_ERROR, "Win32: Failed to allocate TLS index"); 47 | return GLFW_FALSE; 48 | } 49 | 50 | tls->win32.allocated = GLFW_TRUE; 51 | return GLFW_TRUE; 52 | } 53 | 54 | void _glfwPlatformDestroyTls(_GLFWtls* tls) 55 | { 56 | if (tls->win32.allocated) 57 | TlsFree(tls->win32.index); 58 | memset(tls, 0, sizeof(_GLFWtls)); 59 | } 60 | 61 | void* _glfwPlatformGetTls(_GLFWtls* tls) 62 | { 63 | assert(tls->win32.allocated == GLFW_TRUE); 64 | return TlsGetValue(tls->win32.index); 65 | } 66 | 67 | void _glfwPlatformSetTls(_GLFWtls* tls, void* value) 68 | { 69 | assert(tls->win32.allocated == GLFW_TRUE); 70 | TlsSetValue(tls->win32.index, value); 71 | } 72 | 73 | GLFWbool _glfwPlatformCreateMutex(_GLFWmutex* mutex) 74 | { 75 | assert(mutex->win32.allocated == GLFW_FALSE); 76 | InitializeCriticalSection(&mutex->win32.section); 77 | return mutex->win32.allocated = GLFW_TRUE; 78 | } 79 | 80 | void _glfwPlatformDestroyMutex(_GLFWmutex* mutex) 81 | { 82 | if (mutex->win32.allocated) 83 | DeleteCriticalSection(&mutex->win32.section); 84 | memset(mutex, 0, sizeof(_GLFWmutex)); 85 | } 86 | 87 | void _glfwPlatformLockMutex(_GLFWmutex* mutex) 88 | { 89 | assert(mutex->win32.allocated == GLFW_TRUE); 90 | EnterCriticalSection(&mutex->win32.section); 91 | } 92 | 93 | void _glfwPlatformUnlockMutex(_GLFWmutex* mutex) 94 | { 95 | assert(mutex->win32.allocated == GLFW_TRUE); 96 | LeaveCriticalSection(&mutex->win32.section); 97 | } 98 | 99 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/deps/mingw/_mingw_dxhelper.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the mingw-w64 runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | 7 | #if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS) 8 | #define NONAMELESSUNION 1 9 | #endif 10 | #if defined(NONAMELESSSTRUCT) && \ 11 | !defined(NONAMELESSUNION) 12 | #define NONAMELESSUNION 1 13 | #endif 14 | #if defined(NONAMELESSUNION) && \ 15 | !defined(NONAMELESSSTRUCT) 16 | #define NONAMELESSSTRUCT 1 17 | #endif 18 | #if !defined(__GNU_EXTENSION) 19 | #if defined(__GNUC__) || defined(__GNUG__) 20 | #define __GNU_EXTENSION __extension__ 21 | #else 22 | #define __GNU_EXTENSION 23 | #endif 24 | #endif /* __extension__ */ 25 | 26 | #ifndef __ANONYMOUS_DEFINED 27 | #define __ANONYMOUS_DEFINED 28 | #if defined(__GNUC__) || defined(__GNUG__) 29 | #define _ANONYMOUS_UNION __extension__ 30 | #define _ANONYMOUS_STRUCT __extension__ 31 | #else 32 | #define _ANONYMOUS_UNION 33 | #define _ANONYMOUS_STRUCT 34 | #endif 35 | #ifndef NONAMELESSUNION 36 | #define _UNION_NAME(x) 37 | #define _STRUCT_NAME(x) 38 | #else /* NONAMELESSUNION */ 39 | #define _UNION_NAME(x) x 40 | #define _STRUCT_NAME(x) x 41 | #endif 42 | #endif /* __ANONYMOUS_DEFINED */ 43 | 44 | #ifndef DUMMYUNIONNAME 45 | # ifdef NONAMELESSUNION 46 | # define DUMMYUNIONNAME u 47 | # define DUMMYUNIONNAME1 u1 /* Wine uses this variant */ 48 | # define DUMMYUNIONNAME2 u2 49 | # define DUMMYUNIONNAME3 u3 50 | # define DUMMYUNIONNAME4 u4 51 | # define DUMMYUNIONNAME5 u5 52 | # define DUMMYUNIONNAME6 u6 53 | # define DUMMYUNIONNAME7 u7 54 | # define DUMMYUNIONNAME8 u8 55 | # define DUMMYUNIONNAME9 u9 56 | # else /* NONAMELESSUNION */ 57 | # define DUMMYUNIONNAME 58 | # define DUMMYUNIONNAME1 /* Wine uses this variant */ 59 | # define DUMMYUNIONNAME2 60 | # define DUMMYUNIONNAME3 61 | # define DUMMYUNIONNAME4 62 | # define DUMMYUNIONNAME5 63 | # define DUMMYUNIONNAME6 64 | # define DUMMYUNIONNAME7 65 | # define DUMMYUNIONNAME8 66 | # define DUMMYUNIONNAME9 67 | # endif 68 | #endif /* DUMMYUNIONNAME */ 69 | 70 | #if !defined(DUMMYUNIONNAME1) /* MinGW does not define this one */ 71 | # ifdef NONAMELESSUNION 72 | # define DUMMYUNIONNAME1 u1 /* Wine uses this variant */ 73 | # else 74 | # define DUMMYUNIONNAME1 /* Wine uses this variant */ 75 | # endif 76 | #endif /* DUMMYUNIONNAME1 */ 77 | 78 | #ifndef DUMMYSTRUCTNAME 79 | # ifdef NONAMELESSUNION 80 | # define DUMMYSTRUCTNAME s 81 | # define DUMMYSTRUCTNAME1 s1 /* Wine uses this variant */ 82 | # define DUMMYSTRUCTNAME2 s2 83 | # define DUMMYSTRUCTNAME3 s3 84 | # define DUMMYSTRUCTNAME4 s4 85 | # define DUMMYSTRUCTNAME5 s5 86 | # else 87 | # define DUMMYSTRUCTNAME 88 | # define DUMMYSTRUCTNAME1 /* Wine uses this variant */ 89 | # define DUMMYSTRUCTNAME2 90 | # define DUMMYSTRUCTNAME3 91 | # define DUMMYSTRUCTNAME4 92 | # define DUMMYSTRUCTNAME5 93 | # endif 94 | #endif /* DUMMYSTRUCTNAME */ 95 | 96 | /* These are for compatibility with the Wine source tree */ 97 | 98 | #ifndef WINELIB_NAME_AW 99 | # ifdef __MINGW_NAME_AW 100 | # define WINELIB_NAME_AW __MINGW_NAME_AW 101 | # else 102 | # ifdef UNICODE 103 | # define WINELIB_NAME_AW(func) func##W 104 | # else 105 | # define WINELIB_NAME_AW(func) func##A 106 | # endif 107 | # endif 108 | #endif /* WINELIB_NAME_AW */ 109 | 110 | #ifndef DECL_WINELIB_TYPE_AW 111 | # ifdef __MINGW_TYPEDEF_AW 112 | # define DECL_WINELIB_TYPE_AW __MINGW_TYPEDEF_AW 113 | # else 114 | # define DECL_WINELIB_TYPE_AW(type) typedef WINELIB_NAME_AW(type) type; 115 | # endif 116 | #endif /* DECL_WINELIB_TYPE_AW */ 117 | 118 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/src/posix_thread.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.4 POSIX - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2002-2006 Marcus Geelnard 5 | // Copyright (c) 2006-2017 Camilla Löwy 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | // It is fine to use C99 in this file because it will not be built with VS 28 | //======================================================================== 29 | 30 | #include "internal.h" 31 | 32 | #include 33 | #include 34 | 35 | 36 | ////////////////////////////////////////////////////////////////////////// 37 | ////// GLFW platform API ////// 38 | ////////////////////////////////////////////////////////////////////////// 39 | 40 | GLFWbool _glfwPlatformCreateTls(_GLFWtls* tls) 41 | { 42 | assert(tls->posix.allocated == GLFW_FALSE); 43 | 44 | if (pthread_key_create(&tls->posix.key, NULL) != 0) 45 | { 46 | _glfwInputError(GLFW_PLATFORM_ERROR, 47 | "POSIX: Failed to create context TLS"); 48 | return GLFW_FALSE; 49 | } 50 | 51 | tls->posix.allocated = GLFW_TRUE; 52 | return GLFW_TRUE; 53 | } 54 | 55 | void _glfwPlatformDestroyTls(_GLFWtls* tls) 56 | { 57 | if (tls->posix.allocated) 58 | pthread_key_delete(tls->posix.key); 59 | memset(tls, 0, sizeof(_GLFWtls)); 60 | } 61 | 62 | void* _glfwPlatformGetTls(_GLFWtls* tls) 63 | { 64 | assert(tls->posix.allocated == GLFW_TRUE); 65 | return pthread_getspecific(tls->posix.key); 66 | } 67 | 68 | void _glfwPlatformSetTls(_GLFWtls* tls, void* value) 69 | { 70 | assert(tls->posix.allocated == GLFW_TRUE); 71 | pthread_setspecific(tls->posix.key, value); 72 | } 73 | 74 | GLFWbool _glfwPlatformCreateMutex(_GLFWmutex* mutex) 75 | { 76 | assert(mutex->posix.allocated == GLFW_FALSE); 77 | 78 | if (pthread_mutex_init(&mutex->posix.handle, NULL) != 0) 79 | { 80 | _glfwInputError(GLFW_PLATFORM_ERROR, "POSIX: Failed to create mutex"); 81 | return GLFW_FALSE; 82 | } 83 | 84 | return mutex->posix.allocated = GLFW_TRUE; 85 | } 86 | 87 | void _glfwPlatformDestroyMutex(_GLFWmutex* mutex) 88 | { 89 | if (mutex->posix.allocated) 90 | pthread_mutex_destroy(&mutex->posix.handle); 91 | memset(mutex, 0, sizeof(_GLFWmutex)); 92 | } 93 | 94 | void _glfwPlatformLockMutex(_GLFWmutex* mutex) 95 | { 96 | assert(mutex->posix.allocated == GLFW_TRUE); 97 | pthread_mutex_lock(&mutex->posix.handle); 98 | } 99 | 100 | void _glfwPlatformUnlockMutex(_GLFWmutex* mutex) 101 | { 102 | assert(mutex->posix.allocated == GLFW_TRUE); 103 | pthread_mutex_unlock(&mutex->posix.handle); 104 | } 105 | 106 | -------------------------------------------------------------------------------- /src/external/raylib/src/minshell.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | raylib web game 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 40 | 41 | 59 | 60 | 61 | 62 |

63 | 83 | {{{ SCRIPT }}} 84 | 85 | 86 | -------------------------------------------------------------------------------- /src/external/deque.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Zlib license: 3 | * 4 | * Copyright (c) 2024 Lieven Petersen 5 | * 6 | * This software is provided 'as-is', without any express or implied 7 | * warranty. In no event will the authors be held liable for any damages 8 | * arising from the use of this software. 9 | * 10 | * Permission is granted to anyone to use this software for any purpose, 11 | * including commercial applications, and to alter it and redistribute it 12 | * freely, subject to the following restrictions: 13 | * 14 | * 1. The origin of this software must not be misrepresented; you must not 15 | * claim that you wrote the original software. If you use this software 16 | * in a product, an acknowledgment in the product documentation would be 17 | * appreciated but is not required. 18 | * 2. Altered source versions must be plainly marked as such, and must not be 19 | * misrepresented as being the original software. 20 | * 3. This notice may not be removed or altered from any source distribution. 21 | */ 22 | 23 | /* 24 | push, pop, front 25 | append, poll, back 26 | 27 | lpush, lpop, lpeek 28 | rpush, rpop, rpeek 29 | */ 30 | 31 | #ifndef __DEQUE_H 32 | #define __DEQUE_H 33 | 34 | #include 35 | #include 36 | 37 | typedef unsigned long __deq_size_t; 38 | 39 | #define DEQ(type) struct { \ 40 | type *items; __deq_size_t capacity; __deq_size_t size; __deq_size_t tail; \ 41 | } 42 | 43 | #define deq_free(deq) {(deq).size = 0; free((deq).items);} 44 | 45 | #define deq_size(deq) (deq).size 46 | 47 | static int __deq_pop_idx(__deq_size_t *size){ 48 | if (*size > 0 ){ 49 | (*size)--; 50 | return *size; 51 | } 52 | return 0; 53 | } 54 | 55 | static int __deq_poll_idx(__deq_size_t *size, __deq_size_t *tail, __deq_size_t capacity){ 56 | if (*size > 0){ 57 | __deq_size_t idx = *tail; 58 | (*size)--; 59 | (*tail) = ((*tail) + 1) % capacity; 60 | return idx; 61 | } 62 | return 0; 63 | } 64 | 65 | #define deq_front(deq) (deq).items[((deq).tail + (deq).size-1) % (deq).capacity] 66 | #define deq_back(deq) (deq).items[(deq).tail] 67 | 68 | 69 | #define __deq_resize(deq, is_wrapped){ \ 70 | __deq_size_t old_cap = (deq).capacity; \ 71 | (deq).capacity = ((deq).capacity+1) * 2; \ 72 | (deq).items = realloc((deq).items, (deq).capacity * sizeof(*(deq).items)); \ 73 | if (is_wrapped) { \ 74 | __deq_size_t new_tail = (deq).tail + (deq).capacity - old_cap; \ 75 | memmove((deq).items + new_tail , (deq).items + (deq).tail, (old_cap - (deq).tail) * sizeof(*(deq).items)); \ 76 | (deq).tail = new_tail; \ 77 | } \ 78 | } 79 | 80 | #define deq_push(deq, elem) { \ 81 | if ((deq).size == (deq).capacity) { \ 82 | char is_wrapped = (deq).tail > 0; \ 83 | __deq_resize((deq), is_wrapped); \ 84 | } \ 85 | (deq).items[((deq).tail + (deq).size++) % (deq).capacity] = elem;} 86 | 87 | #define deq_append(deq, elem){ \ 88 | if ((deq).size == (deq).capacity) { \ 89 | char is_wrapped = (deq).tail > 0; \ 90 | __deq_resize((deq), is_wrapped); \ 91 | } \ 92 | if ((deq).size > 0) (deq).tail = ((deq).tail - 1) % (deq).capacity; \ 93 | (deq).size++; \ 94 | (deq).items[((deq).tail)] = elem; \ 95 | } 96 | 97 | #define deq_pop(deq) ((deq).items[((deq).tail + __deq_pop_idx(&(deq).size)) % (deq).capacity]) 98 | 99 | #define deq_poll(deq) ((deq).items[__deq_poll_idx(&(deq).size, &(deq).tail, (deq).capacity)]) 100 | 101 | 102 | #endif //__DEQUE_H 103 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/src/null_init.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.4 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2016 Google Inc. 5 | // Copyright (c) 2016-2017 Camilla Löwy 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | // It is fine to use C99 in this file because it will not be built with VS 28 | //======================================================================== 29 | 30 | #include "internal.h" 31 | 32 | #include 33 | 34 | 35 | ////////////////////////////////////////////////////////////////////////// 36 | ////// GLFW platform API ////// 37 | ////////////////////////////////////////////////////////////////////////// 38 | 39 | GLFWbool _glfwConnectNull(int platformID, _GLFWplatform* platform) 40 | { 41 | const _GLFWplatform null = 42 | { 43 | GLFW_PLATFORM_NULL, 44 | _glfwInitNull, 45 | _glfwTerminateNull, 46 | _glfwGetCursorPosNull, 47 | _glfwSetCursorPosNull, 48 | _glfwSetCursorModeNull, 49 | _glfwSetRawMouseMotionNull, 50 | _glfwRawMouseMotionSupportedNull, 51 | _glfwCreateCursorNull, 52 | _glfwCreateStandardCursorNull, 53 | _glfwDestroyCursorNull, 54 | _glfwSetCursorNull, 55 | _glfwGetScancodeNameNull, 56 | _glfwGetKeyScancodeNull, 57 | _glfwSetClipboardStringNull, 58 | _glfwGetClipboardStringNull, 59 | _glfwInitJoysticksNull, 60 | _glfwTerminateJoysticksNull, 61 | _glfwPollJoystickNull, 62 | _glfwGetMappingNameNull, 63 | _glfwUpdateGamepadGUIDNull, 64 | _glfwFreeMonitorNull, 65 | _glfwGetMonitorPosNull, 66 | _glfwGetMonitorContentScaleNull, 67 | _glfwGetMonitorWorkareaNull, 68 | _glfwGetVideoModesNull, 69 | _glfwGetVideoModeNull, 70 | _glfwGetGammaRampNull, 71 | _glfwSetGammaRampNull, 72 | _glfwCreateWindowNull, 73 | _glfwDestroyWindowNull, 74 | _glfwSetWindowTitleNull, 75 | _glfwSetWindowIconNull, 76 | _glfwGetWindowPosNull, 77 | _glfwSetWindowPosNull, 78 | _glfwGetWindowSizeNull, 79 | _glfwSetWindowSizeNull, 80 | _glfwSetWindowSizeLimitsNull, 81 | _glfwSetWindowAspectRatioNull, 82 | _glfwGetFramebufferSizeNull, 83 | _glfwGetWindowFrameSizeNull, 84 | _glfwGetWindowContentScaleNull, 85 | _glfwIconifyWindowNull, 86 | _glfwRestoreWindowNull, 87 | _glfwMaximizeWindowNull, 88 | _glfwShowWindowNull, 89 | _glfwHideWindowNull, 90 | _glfwRequestWindowAttentionNull, 91 | _glfwFocusWindowNull, 92 | _glfwSetWindowMonitorNull, 93 | _glfwWindowFocusedNull, 94 | _glfwWindowIconifiedNull, 95 | _glfwWindowVisibleNull, 96 | _glfwWindowMaximizedNull, 97 | _glfwWindowHoveredNull, 98 | _glfwFramebufferTransparentNull, 99 | _glfwGetWindowOpacityNull, 100 | _glfwSetWindowResizableNull, 101 | _glfwSetWindowDecoratedNull, 102 | _glfwSetWindowFloatingNull, 103 | _glfwSetWindowOpacityNull, 104 | _glfwSetWindowMousePassthroughNull, 105 | _glfwPollEventsNull, 106 | _glfwWaitEventsNull, 107 | _glfwWaitEventsTimeoutNull, 108 | _glfwPostEmptyEventNull, 109 | _glfwGetEGLPlatformNull, 110 | _glfwGetEGLNativeDisplayNull, 111 | _glfwGetEGLNativeWindowNull, 112 | _glfwGetRequiredInstanceExtensionsNull, 113 | _glfwGetPhysicalDevicePresentationSupportNull, 114 | _glfwCreateWindowSurfaceNull, 115 | }; 116 | 117 | *platform = null; 118 | return GLFW_TRUE; 119 | } 120 | 121 | int _glfwInitNull(void) 122 | { 123 | _glfwPollMonitorsNull(); 124 | return GLFW_TRUE; 125 | } 126 | 127 | void _glfwTerminateNull(void) 128 | { 129 | free(_glfw.null.clipboardString); 130 | _glfwTerminateOSMesa(); 131 | _glfwTerminateEGL(); 132 | } 133 | 134 | -------------------------------------------------------------------------------- /src/external/stack.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * zlib license: 4 | * 5 | * Copyright (c) 2024 Lieven Petersen 6 | * 7 | * This software is provided 'as-is', without any express or implied 8 | * warranty. In no event will the authors be held liable for any damages 9 | * arising from the use of this software. 10 | * 11 | * Permission is granted to anyone to use this software for any purpose, 12 | * including commercial applications, and to alter it and redistribute it 13 | * freely, subject to the following restrictions: 14 | * 15 | * 1. The origin of this software must not be misrepresented; you must not 16 | * claim that you wrote the original software. If you use this software 17 | * in a product, an acknowledgment in the product documentation would be 18 | * appreciated but is not required. 19 | * 2. Altered source versions must be plainly marked as such, and must not be 20 | * misrepresented as being the original software. 21 | * 3. This notice may not be removed or altered from any source distribution. 22 | */ 23 | 24 | 25 | #ifndef __STACK_H 26 | #define __STACK_H 27 | 28 | #include 29 | #include 30 | #include 31 | 32 | struct __stack_info{ 33 | void *stack_ptr; 34 | size_t size; 35 | size_t capacity; 36 | }; 37 | 38 | static struct __stack_info *__g_si = NULL; 39 | static size_t __g_sc = 0; 40 | 41 | static struct __stack_info *__get_si(void *stack){ 42 | for (size_t i = 0; i < __g_sc; i++){ 43 | if (__g_si[i].stack_ptr == stack) return &__g_si[i]; 44 | } 45 | // if the stack ptr is unknown, it's probably from uninitialized memory. 46 | if (stack != NULL){ 47 | perror("[STACK] WARNING: given stack was not initialized!\n"); 48 | } 49 | return NULL; 50 | } 51 | 52 | #define __init_stack(stack) do{ \ 53 | __g_si = realloc(__g_si, (++__g_sc) * sizeof(*__g_si)); \ 54 | __g_si[__g_sc-1].stack_ptr = stack; \ 55 | __g_si[__g_sc-1].size = 0; \ 56 | __g_si[__g_sc-1].capacity = 0; \ 57 | }while(0) 58 | 59 | #define stack_free(stack) do{ \ 60 | struct __stack_info *__si = __get_si(stack); \ 61 | if (__si != NULL){ \ 62 | if (__si < __g_si + __g_sc - 1) memmove(__si, __si + 1, (__g_sc - (__si - __g_si) - 1)*sizeof(*__si)); \ 63 | __g_si = realloc(__g_si, (--__g_sc) * sizeof(*__g_si)); \ 64 | free(stack); \ 65 | stack = NULL; \ 66 | } \ 67 | }while(0) 68 | 69 | #define stack_reserve_capacity(stack, new_capacity) do{ \ 70 | if (stack == NULL) __init_stack(stack); \ 71 | struct __stack_info *__si = __get_si(stack); \ 72 | __stack_reserve_capacity(__si, stack, new_capacity); \ 73 | }while(0) 74 | 75 | #define __stack_reserve_capacity(__si, stack, new_capacity) do{ \ 76 | __si->capacity = __si->size < new_capacity? new_capacity : __si->size; \ 77 | stack = realloc(stack, __si->capacity * sizeof(*stack)); \ 78 | __si->stack_ptr = stack; \ 79 | }while(0) 80 | 81 | #define stack_push(stack, ...) do{ \ 82 | if (stack == NULL) __init_stack(stack); \ 83 | struct __stack_info *__si = __get_si(stack); \ 84 | if (__si->size == __si->capacity) { \ 85 | __stack_reserve_capacity(__si, stack, (__si->capacity + 1) * 2); \ 86 | } \ 87 | stack[__si->size++] = __VA_ARGS__; \ 88 | }while(0) 89 | 90 | #define stack_pop(stack) stack[__get_si(stack)->size > 0? --__get_si(stack)->size : 0] 91 | 92 | #define stack_size(stack) (__get_si(stack) == NULL? (size_t)0 : __get_si(stack)->size) 93 | 94 | #endif //__STACK_H 95 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/src/mappings.h.in: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.4 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2006-2018 Camilla Löwy 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | // As mappings.h.in, this file is used by CMake to produce the mappings.h 27 | // header file. If you are adding a GLFW specific gamepad mapping, this is 28 | // where to put it. 29 | //======================================================================== 30 | // As mappings.h, this provides all pre-defined gamepad mappings, including 31 | // all available in SDL_GameControllerDB. Do not edit this file. Any gamepad 32 | // mappings not specific to GLFW should be submitted to SDL_GameControllerDB. 33 | // This file can be re-generated from mappings.h.in and the upstream 34 | // gamecontrollerdb.txt with the 'update_mappings' CMake target. 35 | //======================================================================== 36 | 37 | // All gamepad mappings not labeled GLFW are copied from the 38 | // SDL_GameControllerDB project under the following license: 39 | // 40 | // Simple DirectMedia Layer 41 | // Copyright (C) 1997-2013 Sam Lantinga 42 | // 43 | // This software is provided 'as-is', without any express or implied warranty. 44 | // In no event will the authors be held liable for any damages arising from the 45 | // use of this software. 46 | // 47 | // Permission is granted to anyone to use this software for any purpose, 48 | // including commercial applications, and to alter it and redistribute it 49 | // freely, subject to the following restrictions: 50 | // 51 | // 1. The origin of this software must not be misrepresented; you must not 52 | // claim that you wrote the original software. If you use this software 53 | // in a product, an acknowledgment in the product documentation would 54 | // be appreciated but is not required. 55 | // 56 | // 2. Altered source versions must be plainly marked as such, and must not be 57 | // misrepresented as being the original software. 58 | // 59 | // 3. This notice may not be removed or altered from any source distribution. 60 | 61 | const char* _glfwDefaultMappings[] = 62 | { 63 | #if defined(GLFW_BUILD_WIN32_MAPPINGS) 64 | @GLFW_WIN32_MAPPINGS@ 65 | "78696e70757401000000000000000000,XInput Gamepad (GLFW),platform:Windows,a:b0,b:b1,x:b2,y:b3,leftshoulder:b4,rightshoulder:b5,back:b6,start:b7,leftstick:b8,rightstick:b9,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,dpup:h0.1,dpright:h0.2,dpdown:h0.4,dpleft:h0.8,", 66 | "78696e70757402000000000000000000,XInput Wheel (GLFW),platform:Windows,a:b0,b:b1,x:b2,y:b3,leftshoulder:b4,rightshoulder:b5,back:b6,start:b7,leftstick:b8,rightstick:b9,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,dpup:h0.1,dpright:h0.2,dpdown:h0.4,dpleft:h0.8,", 67 | "78696e70757403000000000000000000,XInput Arcade Stick (GLFW),platform:Windows,a:b0,b:b1,x:b2,y:b3,leftshoulder:b4,rightshoulder:b5,back:b6,start:b7,leftstick:b8,rightstick:b9,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,dpup:h0.1,dpright:h0.2,dpdown:h0.4,dpleft:h0.8,", 68 | "78696e70757404000000000000000000,XInput Flight Stick (GLFW),platform:Windows,a:b0,b:b1,x:b2,y:b3,leftshoulder:b4,rightshoulder:b5,back:b6,start:b7,leftstick:b8,rightstick:b9,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,dpup:h0.1,dpright:h0.2,dpdown:h0.4,dpleft:h0.8,", 69 | "78696e70757405000000000000000000,XInput Dance Pad (GLFW),platform:Windows,a:b0,b:b1,x:b2,y:b3,leftshoulder:b4,rightshoulder:b5,back:b6,start:b7,leftstick:b8,rightstick:b9,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,dpup:h0.1,dpright:h0.2,dpdown:h0.4,dpleft:h0.8,", 70 | "78696e70757406000000000000000000,XInput Guitar (GLFW),platform:Windows,a:b0,b:b1,x:b2,y:b3,leftshoulder:b4,rightshoulder:b5,back:b6,start:b7,leftstick:b8,rightstick:b9,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,dpup:h0.1,dpright:h0.2,dpdown:h0.4,dpleft:h0.8,", 71 | "78696e70757408000000000000000000,XInput Drum Kit (GLFW),platform:Windows,a:b0,b:b1,x:b2,y:b3,leftshoulder:b4,rightshoulder:b5,back:b6,start:b7,leftstick:b8,rightstick:b9,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,dpup:h0.1,dpright:h0.2,dpdown:h0.4,dpleft:h0.8,", 72 | #endif // GLFW_BUILD_WIN32_MAPPINGS 73 | 74 | #if defined(GLFW_BUILD_COCOA_MAPPINGS) 75 | @GLFW_COCOA_MAPPINGS@ 76 | #endif // GLFW_BUILD_COCOA_MAPPINGS 77 | 78 | #if defined(GLFW_BUILD_LINUX_MAPPINGS) 79 | @GLFW_LINUX_MAPPINGS@ 80 | #endif // GLFW_BUILD_LINUX_MAPPINGS 81 | }; 82 | 83 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/src/platform.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.4 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2002-2006 Marcus Geelnard 5 | // Copyright (c) 2006-2018 Camilla Löwy 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | 28 | #include "null_platform.h" 29 | 30 | #if defined(_GLFW_WIN32) 31 | #include "win32_platform.h" 32 | #else 33 | #define GLFW_WIN32_WINDOW_STATE 34 | #define GLFW_WIN32_MONITOR_STATE 35 | #define GLFW_WIN32_CURSOR_STATE 36 | #define GLFW_WIN32_LIBRARY_WINDOW_STATE 37 | #define GLFW_WGL_CONTEXT_STATE 38 | #define GLFW_WGL_LIBRARY_CONTEXT_STATE 39 | #endif 40 | 41 | #if defined(_GLFW_COCOA) 42 | #include "cocoa_platform.h" 43 | #else 44 | #define GLFW_COCOA_WINDOW_STATE 45 | #define GLFW_COCOA_MONITOR_STATE 46 | #define GLFW_COCOA_CURSOR_STATE 47 | #define GLFW_COCOA_LIBRARY_WINDOW_STATE 48 | #define GLFW_NSGL_CONTEXT_STATE 49 | #define GLFW_NSGL_LIBRARY_CONTEXT_STATE 50 | #endif 51 | 52 | #if defined(_GLFW_WAYLAND) 53 | #include "wl_platform.h" 54 | #else 55 | #define GLFW_WAYLAND_WINDOW_STATE 56 | #define GLFW_WAYLAND_MONITOR_STATE 57 | #define GLFW_WAYLAND_CURSOR_STATE 58 | #define GLFW_WAYLAND_LIBRARY_WINDOW_STATE 59 | #endif 60 | 61 | #if defined(_GLFW_X11) 62 | #include "x11_platform.h" 63 | #else 64 | #define GLFW_X11_WINDOW_STATE 65 | #define GLFW_X11_MONITOR_STATE 66 | #define GLFW_X11_CURSOR_STATE 67 | #define GLFW_X11_LIBRARY_WINDOW_STATE 68 | #define GLFW_GLX_CONTEXT_STATE 69 | #define GLFW_GLX_LIBRARY_CONTEXT_STATE 70 | #endif 71 | 72 | #include "null_joystick.h" 73 | 74 | #if defined(_GLFW_WIN32) 75 | #include "win32_joystick.h" 76 | #else 77 | #define GLFW_WIN32_JOYSTICK_STATE 78 | #define GLFW_WIN32_LIBRARY_JOYSTICK_STATE 79 | #endif 80 | 81 | #if defined(_GLFW_COCOA) 82 | #include "cocoa_joystick.h" 83 | #else 84 | #define GLFW_COCOA_JOYSTICK_STATE 85 | #define GLFW_COCOA_LIBRARY_JOYSTICK_STATE 86 | #endif 87 | 88 | #if (defined(_GLFW_X11) || defined(_GLFW_WAYLAND)) && defined(__linux__) 89 | #include "linux_joystick.h" 90 | #else 91 | #define GLFW_LINUX_JOYSTICK_STATE 92 | #define GLFW_LINUX_LIBRARY_JOYSTICK_STATE 93 | #endif 94 | 95 | #define GLFW_PLATFORM_WINDOW_STATE \ 96 | GLFW_WIN32_WINDOW_STATE \ 97 | GLFW_COCOA_WINDOW_STATE \ 98 | GLFW_WAYLAND_WINDOW_STATE \ 99 | GLFW_X11_WINDOW_STATE \ 100 | GLFW_NULL_WINDOW_STATE \ 101 | 102 | #define GLFW_PLATFORM_MONITOR_STATE \ 103 | GLFW_WIN32_MONITOR_STATE \ 104 | GLFW_COCOA_MONITOR_STATE \ 105 | GLFW_WAYLAND_MONITOR_STATE \ 106 | GLFW_X11_MONITOR_STATE \ 107 | GLFW_NULL_MONITOR_STATE \ 108 | 109 | #define GLFW_PLATFORM_CURSOR_STATE \ 110 | GLFW_WIN32_CURSOR_STATE \ 111 | GLFW_COCOA_CURSOR_STATE \ 112 | GLFW_WAYLAND_CURSOR_STATE \ 113 | GLFW_X11_CURSOR_STATE \ 114 | GLFW_NULL_CURSOR_STATE \ 115 | 116 | #define GLFW_PLATFORM_JOYSTICK_STATE \ 117 | GLFW_WIN32_JOYSTICK_STATE \ 118 | GLFW_COCOA_JOYSTICK_STATE \ 119 | GLFW_LINUX_JOYSTICK_STATE 120 | 121 | #define GLFW_PLATFORM_LIBRARY_WINDOW_STATE \ 122 | GLFW_WIN32_LIBRARY_WINDOW_STATE \ 123 | GLFW_COCOA_LIBRARY_WINDOW_STATE \ 124 | GLFW_WAYLAND_LIBRARY_WINDOW_STATE \ 125 | GLFW_X11_LIBRARY_WINDOW_STATE \ 126 | GLFW_NULL_LIBRARY_WINDOW_STATE \ 127 | 128 | #define GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE \ 129 | GLFW_WIN32_LIBRARY_JOYSTICK_STATE \ 130 | GLFW_COCOA_LIBRARY_JOYSTICK_STATE \ 131 | GLFW_LINUX_LIBRARY_JOYSTICK_STATE 132 | 133 | #define GLFW_PLATFORM_CONTEXT_STATE \ 134 | GLFW_WGL_CONTEXT_STATE \ 135 | GLFW_NSGL_CONTEXT_STATE \ 136 | GLFW_GLX_CONTEXT_STATE 137 | 138 | #define GLFW_PLATFORM_LIBRARY_CONTEXT_STATE \ 139 | GLFW_WGL_LIBRARY_CONTEXT_STATE \ 140 | GLFW_NSGL_LIBRARY_CONTEXT_STATE \ 141 | GLFW_GLX_LIBRARY_CONTEXT_STATE 142 | 143 | #if defined(_WIN32) 144 | #include "win32_thread.h" 145 | #define GLFW_PLATFORM_TLS_STATE GLFW_WIN32_TLS_STATE 146 | #define GLFW_PLATFORM_MUTEX_STATE GLFW_WIN32_MUTEX_STATE 147 | #else 148 | #include "posix_thread.h" 149 | #define GLFW_PLATFORM_TLS_STATE GLFW_POSIX_TLS_STATE 150 | #define GLFW_PLATFORM_MUTEX_STATE GLFW_POSIX_MUTEX_STATE 151 | #endif 152 | 153 | #if defined(_WIN32) 154 | #include "win32_time.h" 155 | #define GLFW_PLATFORM_LIBRARY_TIMER_STATE GLFW_WIN32_LIBRARY_TIMER_STATE 156 | #elif defined(__APPLE__) 157 | #include "cocoa_time.h" 158 | #define GLFW_PLATFORM_LIBRARY_TIMER_STATE GLFW_COCOA_LIBRARY_TIMER_STATE 159 | #else 160 | #include "posix_time.h" 161 | #define GLFW_PLATFORM_LIBRARY_TIMER_STATE GLFW_POSIX_LIBRARY_TIMER_STATE 162 | #endif 163 | 164 | -------------------------------------------------------------------------------- /src/external/raylib/src/rglfw.c: -------------------------------------------------------------------------------- 1 | /********************************************************************************************** 2 | * 3 | * rglfw - raylib GLFW single file compilation 4 | * 5 | * This file includes latest GLFW sources (https://github.com/glfw/glfw) to be compiled together 6 | * with raylib for all supported platforms, this way, no external dependencies are required. 7 | * 8 | * LICENSE: zlib/libpng 9 | * 10 | * Copyright (c) 2017-2023 Ramon Santamaria (@raysan5) 11 | * 12 | * This software is provided "as-is", without any express or implied warranty. In no event 13 | * will the authors be held liable for any damages arising from the use of this software. 14 | * 15 | * Permission is granted to anyone to use this software for any purpose, including commercial 16 | * applications, and to alter it and redistribute it freely, subject to the following restrictions: 17 | * 18 | * 1. The origin of this software must not be misrepresented; you must not claim that you 19 | * wrote the original software. If you use this software in a product, an acknowledgment 20 | * in the product documentation would be appreciated but is not required. 21 | * 22 | * 2. Altered source versions must be plainly marked as such, and must not be misrepresented 23 | * as being the original software. 24 | * 25 | * 3. This notice may not be removed or altered from any source distribution. 26 | * 27 | **********************************************************************************************/ 28 | 29 | //#define _GLFW_BUILD_DLL // To build shared version 30 | // Ref: http://www.glfw.org/docs/latest/compile.html#compile_manual 31 | 32 | // Platform options: 33 | // _GLFW_WIN32 to use the Win32 API 34 | // _GLFW_X11 to use the X Window System 35 | // _GLFW_WAYLAND to use the Wayland API (experimental and incomplete) 36 | // _GLFW_COCOA to use the Cocoa frameworks 37 | // _GLFW_OSMESA to use the OSMesa API (headless and non-interactive) 38 | // _GLFW_MIR experimental, not supported at this moment 39 | 40 | #if defined(_WIN32) || defined(__CYGWIN__) 41 | #define _GLFW_WIN32 42 | #endif 43 | #if defined(__linux__) 44 | #if !defined(_GLFW_WAYLAND) // Required for Wayland windowing 45 | #define _GLFW_X11 46 | #endif 47 | #endif 48 | #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) 49 | #define _GLFW_X11 50 | #endif 51 | #if defined(__APPLE__) 52 | #define _GLFW_COCOA 53 | #define _GLFW_USE_MENUBAR // To create and populate the menu bar when the first window is created 54 | #define _GLFW_USE_RETINA // To have windows use the full resolution of Retina displays 55 | #endif 56 | #if defined(__TINYC__) 57 | #define _WIN32_WINNT_WINXP 0x0501 58 | #endif 59 | 60 | // Common modules to all platforms 61 | #include "external/glfw/src/init.c" 62 | #include "external/glfw/src/platform.c" 63 | #include "external/glfw/src/context.c" 64 | #include "external/glfw/src/monitor.c" 65 | #include "external/glfw/src/window.c" 66 | #include "external/glfw/src/input.c" 67 | #include "external/glfw/src/vulkan.c" 68 | 69 | #if defined(_WIN32) || defined(__CYGWIN__) 70 | #include "external/glfw/src/win32_init.c" 71 | #include "external/glfw/src/win32_module.c" 72 | #include "external/glfw/src/win32_monitor.c" 73 | #include "external/glfw/src/win32_window.c" 74 | #include "external/glfw/src/win32_joystick.c" 75 | #include "external/glfw/src/win32_time.c" 76 | #include "external/glfw/src/win32_thread.c" 77 | #include "external/glfw/src/wgl_context.c" 78 | 79 | #include "external/glfw/src/egl_context.c" 80 | #include "external/glfw/src/osmesa_context.c" 81 | #endif 82 | 83 | #if defined(__linux__) 84 | #include "external/glfw/src/posix_module.c" 85 | #include "external/glfw/src/posix_thread.c" 86 | #include "external/glfw/src/posix_time.c" 87 | #include "external/glfw/src/posix_poll.c" 88 | #include "external/glfw/src/linux_joystick.c" 89 | #include "external/glfw/src/xkb_unicode.c" 90 | 91 | #include "external/glfw/src/egl_context.c" 92 | #include "external/glfw/src/osmesa_context.c" 93 | 94 | #if defined(_GLFW_WAYLAND) 95 | #include "external/glfw/src/wl_init.c" 96 | #include "external/glfw/src/wl_monitor.c" 97 | #include "external/glfw/src/wl_window.c" 98 | #endif 99 | #if defined(_GLFW_X11) 100 | #include "external/glfw/src/x11_init.c" 101 | #include "external/glfw/src/x11_monitor.c" 102 | #include "external/glfw/src/x11_window.c" 103 | #include "external/glfw/src/glx_context.c" 104 | #endif 105 | #endif 106 | 107 | #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined( __NetBSD__) || defined(__DragonFly__) 108 | #include "external/glfw/src/posix_module.c" 109 | #include "external/glfw/src/posix_thread.c" 110 | #include "external/glfw/src/posix_time.c" 111 | #include "external/glfw/src/posix_poll.c" 112 | #include "external/glfw/src/null_joystick.c" 113 | #include "external/glfw/src/xkb_unicode.c" 114 | 115 | #include "external/glfw/src/x11_init.c" 116 | #include "external/glfw/src/x11_monitor.c" 117 | #include "external/glfw/src/x11_window.c" 118 | #include "external/glfw/src/glx_context.c" 119 | 120 | #include "external/glfw/src/egl_context.c" 121 | #include "external/glfw/src/osmesa_context.c" 122 | #endif 123 | 124 | #if defined(__APPLE__) 125 | #include "external/glfw/src/posix_module.c" 126 | #include "external/glfw/src/posix_thread.c" 127 | #include "external/glfw/src/cocoa_init.m" 128 | #include "external/glfw/src/cocoa_joystick.m" 129 | #include "external/glfw/src/cocoa_monitor.m" 130 | #include "external/glfw/src/cocoa_window.m" 131 | #include "external/glfw/src/cocoa_time.c" 132 | #include "external/glfw/src/nsgl_context.m" 133 | 134 | #include "external/glfw/src/egl_context.c" 135 | #include "external/glfw/src/osmesa_context.c" 136 | #endif 137 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/dirent.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Declaration of POSIX directory browsing functions and types for Win32. 4 | 5 | Author: Kevlin Henney (kevlin@acm.org, kevlin@curbralan.com) 6 | History: Created March 1997. Updated June 2003. 7 | Reviewed by Ramon Santamaria for raylib on January 2020. 8 | 9 | Copyright Kevlin Henney, 1997, 2003. All rights reserved. 10 | 11 | Permission to use, copy, modify, and distribute this software and its 12 | documentation for any purpose is hereby granted without fee, provided 13 | that this copyright and permissions notice appear in all copies and 14 | derivatives. 15 | 16 | This software is supplied "as is" without express or implied warranty. 17 | 18 | But that said, if there are any problems please get in touch. 19 | 20 | ****************************************************************************/ 21 | 22 | #ifndef DIRENT_H 23 | #define DIRENT_H 24 | 25 | // Allow custom memory allocators 26 | #ifndef DIRENT_MALLOC 27 | #define DIRENT_MALLOC(sz) malloc(sz) 28 | #endif 29 | #ifndef DIRENT_FREE 30 | #define DIRENT_FREE(p) free(p) 31 | #endif 32 | 33 | //---------------------------------------------------------------------------------- 34 | // Types and Structures Definition 35 | //---------------------------------------------------------------------------------- 36 | 37 | // Fordward declaration of DIR, implementation below 38 | typedef struct DIR DIR; 39 | 40 | struct dirent { 41 | char *d_name; 42 | }; 43 | 44 | #ifdef __cplusplus 45 | extern "C" { 46 | #endif 47 | 48 | //------------------------------------------------------------------------------------ 49 | // Functions Declaration 50 | //------------------------------------------------------------------------------------ 51 | DIR *opendir(const char *name); 52 | int closedir(DIR *dir); 53 | struct dirent *readdir(DIR *dir); 54 | void rewinddir(DIR *dir); 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | #endif // DIRENT_H 61 | 62 | /**************************************************************************** 63 | 64 | Implementation of POSIX directory browsing functions and types for Win32. 65 | 66 | Author: Kevlin Henney (kevlin@acm.org, kevlin@curbralan.com) 67 | History: Created March 1997. Updated June 2003. 68 | Reviewed by Ramon Santamaria for raylib on January 2020. 69 | 70 | Copyright Kevlin Henney, 1997, 2003. All rights reserved. 71 | 72 | Permission to use, copy, modify, and distribute this software and its 73 | documentation for any purpose is hereby granted without fee, provided 74 | that this copyright and permissions notice appear in all copies and 75 | derivatives. 76 | 77 | This software is supplied "as is" without express or implied warranty. 78 | 79 | But that said, if there are any problems please get in touch. 80 | 81 | ****************************************************************************/ 82 | 83 | #include // _findfirst and _findnext set errno iff they return -1 84 | #include 85 | #include 86 | #include 87 | 88 | //---------------------------------------------------------------------------------- 89 | // Types and Structures Definition 90 | //---------------------------------------------------------------------------------- 91 | typedef ptrdiff_t handle_type; // C99's intptr_t not sufficiently portable 92 | 93 | struct DIR { 94 | handle_type handle; // -1 for failed rewind 95 | struct _finddata_t info; 96 | struct dirent result; // d_name null iff first time 97 | char *name; // null-terminated char string 98 | }; 99 | 100 | DIR *opendir(const char *name) 101 | { 102 | DIR *dir = 0; 103 | 104 | if (name && name[0]) 105 | { 106 | size_t base_length = strlen(name); 107 | 108 | // Search pattern must end with suitable wildcard 109 | const char *all = strchr("/\\", name[base_length - 1]) ? "*" : "/*"; 110 | 111 | if ((dir = (DIR *)DIRENT_MALLOC(sizeof *dir)) != 0 && 112 | (dir->name = (char *)DIRENT_MALLOC(base_length + strlen(all) + 1)) != 0) 113 | { 114 | strcat(strcpy(dir->name, name), all); 115 | 116 | if ((dir->handle = (handle_type) _findfirst(dir->name, &dir->info)) != -1) 117 | { 118 | dir->result.d_name = 0; 119 | } 120 | else // rollback 121 | { 122 | DIRENT_FREE(dir->name); 123 | DIRENT_FREE(dir); 124 | dir = 0; 125 | } 126 | } 127 | else // rollback 128 | { 129 | DIRENT_FREE(dir); 130 | dir = 0; 131 | errno = ENOMEM; 132 | } 133 | } 134 | else errno = EINVAL; 135 | 136 | return dir; 137 | } 138 | 139 | int closedir(DIR *dir) 140 | { 141 | int result = -1; 142 | 143 | if (dir) 144 | { 145 | if (dir->handle != -1) result = _findclose(dir->handle); 146 | 147 | DIRENT_FREE(dir->name); 148 | DIRENT_FREE(dir); 149 | } 150 | 151 | // NOTE: All errors ampped to EBADF 152 | if (result == -1) errno = EBADF; 153 | 154 | return result; 155 | } 156 | 157 | struct dirent *readdir(DIR *dir) 158 | { 159 | struct dirent *result = 0; 160 | 161 | if (dir && dir->handle != -1) 162 | { 163 | if (!dir->result.d_name || _findnext(dir->handle, &dir->info) != -1) 164 | { 165 | result = &dir->result; 166 | result->d_name = dir->info.name; 167 | } 168 | } 169 | else errno = EBADF; 170 | 171 | return result; 172 | } 173 | 174 | void rewinddir(DIR *dir) 175 | { 176 | if (dir && dir->handle != -1) 177 | { 178 | _findclose(dir->handle); 179 | dir->handle = (handle_type) _findfirst(dir->name, &dir->info); 180 | dir->result.d_name = 0; 181 | } 182 | else errno = EBADF; 183 | } 184 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/src/null_monitor.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.4 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2016 Google Inc. 5 | // Copyright (c) 2016-2019 Camilla Löwy 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | // It is fine to use C99 in this file because it will not be built with VS 28 | //======================================================================== 29 | 30 | #include "internal.h" 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | // The the sole (fake) video mode of our (sole) fake monitor 37 | // 38 | static GLFWvidmode getVideoMode(void) 39 | { 40 | GLFWvidmode mode; 41 | mode.width = 1920; 42 | mode.height = 1080; 43 | mode.redBits = 8; 44 | mode.greenBits = 8; 45 | mode.blueBits = 8; 46 | mode.refreshRate = 60; 47 | return mode; 48 | } 49 | 50 | ////////////////////////////////////////////////////////////////////////// 51 | ////// GLFW internal API ////// 52 | ////////////////////////////////////////////////////////////////////////// 53 | 54 | void _glfwPollMonitorsNull(void) 55 | { 56 | const float dpi = 141.f; 57 | const GLFWvidmode mode = getVideoMode(); 58 | _GLFWmonitor* monitor = _glfwAllocMonitor("Null SuperNoop 0", 59 | (int) (mode.width * 25.4f / dpi), 60 | (int) (mode.height * 25.4f / dpi)); 61 | _glfwInputMonitor(monitor, GLFW_CONNECTED, _GLFW_INSERT_FIRST); 62 | } 63 | 64 | ////////////////////////////////////////////////////////////////////////// 65 | ////// GLFW platform API ////// 66 | ////////////////////////////////////////////////////////////////////////// 67 | 68 | void _glfwFreeMonitorNull(_GLFWmonitor* monitor) 69 | { 70 | _glfwFreeGammaArrays(&monitor->null.ramp); 71 | } 72 | 73 | void _glfwGetMonitorPosNull(_GLFWmonitor* monitor, int* xpos, int* ypos) 74 | { 75 | if (xpos) 76 | *xpos = 0; 77 | if (ypos) 78 | *ypos = 0; 79 | } 80 | 81 | void _glfwGetMonitorContentScaleNull(_GLFWmonitor* monitor, 82 | float* xscale, float* yscale) 83 | { 84 | if (xscale) 85 | *xscale = 1.f; 86 | if (yscale) 87 | *yscale = 1.f; 88 | } 89 | 90 | void _glfwGetMonitorWorkareaNull(_GLFWmonitor* monitor, 91 | int* xpos, int* ypos, 92 | int* width, int* height) 93 | { 94 | const GLFWvidmode mode = getVideoMode(); 95 | 96 | if (xpos) 97 | *xpos = 0; 98 | if (ypos) 99 | *ypos = 10; 100 | if (width) 101 | *width = mode.width; 102 | if (height) 103 | *height = mode.height - 10; 104 | } 105 | 106 | GLFWvidmode* _glfwGetVideoModesNull(_GLFWmonitor* monitor, int* found) 107 | { 108 | GLFWvidmode* mode = _glfw_calloc(1, sizeof(GLFWvidmode)); 109 | *mode = getVideoMode(); 110 | *found = 1; 111 | return mode; 112 | } 113 | 114 | void _glfwGetVideoModeNull(_GLFWmonitor* monitor, GLFWvidmode* mode) 115 | { 116 | *mode = getVideoMode(); 117 | } 118 | 119 | GLFWbool _glfwGetGammaRampNull(_GLFWmonitor* monitor, GLFWgammaramp* ramp) 120 | { 121 | if (!monitor->null.ramp.size) 122 | { 123 | unsigned int i; 124 | 125 | _glfwAllocGammaArrays(&monitor->null.ramp, 256); 126 | 127 | for (i = 0; i < monitor->null.ramp.size; i++) 128 | { 129 | const float gamma = 2.2f; 130 | float value; 131 | value = i / (float) (monitor->null.ramp.size - 1); 132 | value = powf(value, 1.f / gamma) * 65535.f + 0.5f; 133 | value = _glfw_fminf(value, 65535.f); 134 | 135 | monitor->null.ramp.red[i] = (unsigned short) value; 136 | monitor->null.ramp.green[i] = (unsigned short) value; 137 | monitor->null.ramp.blue[i] = (unsigned short) value; 138 | } 139 | } 140 | 141 | _glfwAllocGammaArrays(ramp, monitor->null.ramp.size); 142 | memcpy(ramp->red, monitor->null.ramp.red, sizeof(short) * ramp->size); 143 | memcpy(ramp->green, monitor->null.ramp.green, sizeof(short) * ramp->size); 144 | memcpy(ramp->blue, monitor->null.ramp.blue, sizeof(short) * ramp->size); 145 | return GLFW_TRUE; 146 | } 147 | 148 | void _glfwSetGammaRampNull(_GLFWmonitor* monitor, const GLFWgammaramp* ramp) 149 | { 150 | if (monitor->null.ramp.size != ramp->size) 151 | { 152 | _glfwInputError(GLFW_PLATFORM_ERROR, 153 | "Null: Gamma ramp size must match current ramp size"); 154 | return; 155 | } 156 | 157 | memcpy(monitor->null.ramp.red, ramp->red, sizeof(short) * ramp->size); 158 | memcpy(monitor->null.ramp.green, ramp->green, sizeof(short) * ramp->size); 159 | memcpy(monitor->null.ramp.blue, ramp->blue, sizeof(short) * ramp->size); 160 | } 161 | 162 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/CONTRIBUTORS.md: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | 3 | GLFW exists because people around the world donated their time and lent their 4 | skills. This list only includes contributions to the main repository and 5 | excludes other invaluable contributions like language bindings and text and 6 | video tutorials. 7 | 8 | - Bobyshev Alexander 9 | - Laurent Aphecetche 10 | - Matt Arsenault 11 | - ashishgamedev 12 | - David Avedissian 13 | - Luca Bacci 14 | - Keith Bauer 15 | - John Bartholomew 16 | - Coşku Baş 17 | - Niklas Behrens 18 | - Andrew Belt 19 | - Nevyn Bengtsson 20 | - Niklas Bergström 21 | - Denis Bernard 22 | - BiBi 23 | - Doug Binks 24 | - blanco 25 | - Waris Boonyasiriwat 26 | - Kyle Brenneman 27 | - Rok Breulj 28 | - TheBrokenRail 29 | - Kai Burjack 30 | - Martin Capitanio 31 | - Nicolas Caramelli 32 | - David Carlier 33 | - Arturo Castro 34 | - Chi-kwan Chan 35 | - TheChocolateOre 36 | - Joseph Chua 37 | - Ian Clarkson 38 | - Michał Cichoń 39 | - Lambert Clara 40 | - Anna Clarke 41 | - Josh Codd 42 | - Yaron Cohen-Tal 43 | - Omar Cornut 44 | - Andrew Corrigan 45 | - Bailey Cosier 46 | - Noel Cower 47 | - CuriouserThing 48 | - Jason Daly 49 | - danhambleton 50 | - Jarrod Davis 51 | - Olivier Delannoy 52 | - Paul R. Deppe 53 | - Michael Dickens 54 | - Роман Донченко 55 | - Mario Dorn 56 | - Wolfgang Draxinger 57 | - Jonathan Dummer 58 | - Ralph Eastwood 59 | - Fredrik Ehnbom 60 | - Robin Eklind 61 | - Jan Ekström 62 | - Siavash Eliasi 63 | - Ahmad Fatoum 64 | - Nikita Fediuchin 65 | - Felipe Ferreira 66 | - Michael Fogleman 67 | - Jason Francis 68 | - Gerald Franz 69 | - Mário Freitas 70 | - GeO4d 71 | - Marcus Geelnard 72 | - ghuser404 73 | - Charles Giessen 74 | - Ryan C. Gordon 75 | - Stephen Gowen 76 | - Kovid Goyal 77 | - Kevin Grandemange 78 | - Eloi Marín Gratacós 79 | - Stefan Gustavson 80 | - Andrew Gutekanst 81 | - Stephen Gutekanst 82 | - Jonathan Hale 83 | - hdf89shfdfs 84 | - Sylvain Hellegouarch 85 | - Björn Hempel 86 | - Matthew Henry 87 | - heromyth 88 | - Lucas Hinderberger 89 | - Paul Holden 90 | - Hajime Hoshi 91 | - Warren Hu 92 | - Charles Huber 93 | - Brent Huisman 94 | - illustris 95 | - InKryption 96 | - IntellectualKitty 97 | - Aaron Jacobs 98 | - JannikGM 99 | - Erik S. V. Jansson 100 | - jjYBdx4IL 101 | - Toni Jovanoski 102 | - Arseny Kapoulkine 103 | - Cem Karan 104 | - Osman Keskin 105 | - Koray Kilinc 106 | - Josh Kilmer 107 | - Byunghoon Kim 108 | - Cameron King 109 | - Peter Knut 110 | - Christoph Kubisch 111 | - Yuri Kunde Schlesner 112 | - Rokas Kupstys 113 | - Konstantin Käfer 114 | - Eric Larson 115 | - Francis Lecavalier 116 | - Jong Won Lee 117 | - Robin Leffmann 118 | - Glenn Lewis 119 | - Shane Liesegang 120 | - Anders Lindqvist 121 | - Leon Linhart 122 | - Marco Lizza 123 | - Eyal Lotem 124 | - Aaron Loucks 125 | - Luflosi 126 | - lukect 127 | - Tristam MacDonald 128 | - Hans Mackowiak 129 | - Дмитри Малышев 130 | - Zbigniew Mandziejewicz 131 | - Adam Marcus 132 | - Célestin Marot 133 | - Kyle McDonald 134 | - David V. McKay 135 | - David Medlock 136 | - Bryce Mehring 137 | - Jonathan Mercier 138 | - Marcel Metz 139 | - Liam Middlebrook 140 | - Ave Milia 141 | - Jonathan Miller 142 | - Kenneth Miller 143 | - Bruce Mitchener 144 | - Jack Moffitt 145 | - Ravi Mohan 146 | - Jeff Molofee 147 | - Alexander Monakov 148 | - Pierre Morel 149 | - Jon Morton 150 | - Pierre Moulon 151 | - Martins Mozeiko 152 | - Pascal Muetschard 153 | - James Murphy 154 | - Julian Møller 155 | - ndogxj 156 | - F. Nedelec 157 | - n3rdopolis 158 | - Kristian Nielsen 159 | - Joel Niemelä 160 | - Kamil Nowakowski 161 | - onox 162 | - Denis Ovod 163 | - Ozzy 164 | - Andri Pálsson 165 | - luz paz 166 | - Peoro 167 | - Braden Pellett 168 | - Christopher Pelloux 169 | - Michael Pennington 170 | - Arturo J. Pérez 171 | - Vladimir Perminov 172 | - Olivier Perret 173 | - Anthony Pesch 174 | - Orson Peters 175 | - Emmanuel Gil Peyrot 176 | - Cyril Pichard 177 | - Pilzschaf 178 | - Keith Pitt 179 | - Stanislav Podgorskiy 180 | - Konstantin Podsvirov 181 | - Nathan Poirier 182 | - Alexandre Pretyman 183 | - Pablo Prietz 184 | - przemekmirek 185 | - pthom 186 | - Martin Pulec 187 | - Guillaume Racicot 188 | - Christian Rauch 189 | - Philip Rideout 190 | - Eddie Ringle 191 | - Max Risuhin 192 | - Joe Roback 193 | - Jorge Rodriguez 194 | - Jari Ronkainen 195 | - Luca Rood 196 | - Ed Ropple 197 | - Aleksey Rybalkin 198 | - Mikko Rytkönen 199 | - Riku Salminen 200 | - Brandon Schaefer 201 | - Sebastian Schuberth 202 | - Christian Sdunek 203 | - Matt Sealey 204 | - Steve Sexton 205 | - Arkady Shapkin 206 | - Ali Sherief 207 | - Yoshiki Shibukawa 208 | - Dmitri Shuralyov 209 | - Joao da Silva 210 | - Daniel Sieger 211 | - Daniel Skorupski 212 | - Slemmie 213 | - Anthony Smith 214 | - Bradley Smith 215 | - Cliff Smolinsky 216 | - Patrick Snape 217 | - Erlend Sogge Heggen 218 | - Olivier Sohn 219 | - Julian Squires 220 | - Johannes Stein 221 | - Pontus Stenetorp 222 | - Michael Stocker 223 | - Justin Stoecker 224 | - Elviss Strazdins 225 | - Paul Sultana 226 | - Nathan Sweet 227 | - TTK-Bandit 228 | - Jared Tiala 229 | - Sergey Tikhomirov 230 | - Arthur Tombs 231 | - TronicLabs 232 | - Ioannis Tsakpinis 233 | - Samuli Tuomola 234 | - Matthew Turner 235 | - urraka 236 | - Elias Vanderstuyft 237 | - Stef Velzel 238 | - Jari Vetoniemi 239 | - Ricardo Vieira 240 | - Nicholas Vitovitch 241 | - Simon Voordouw 242 | - Corentin Wallez 243 | - Torsten Walluhn 244 | - Patrick Walton 245 | - Xo Wang 246 | - Jay Weisskopf 247 | - Frank Wille 248 | - Andy Williams 249 | - Joel Winarske 250 | - Richard A. Wilkes 251 | - Tatsuya Yatagawa 252 | - Ryogo Yoshimura 253 | - Lukas Zanner 254 | - Andrey Zholos 255 | - Aihui Zhu 256 | - Santi Zupancic 257 | - Jonas Ådahl 258 | - Lasse Öörni 259 | - Leonard König 260 | - All the unmentioned and anonymous contributors in the GLFW community, for bug 261 | reports, patches, feedback, testing and encouragement 262 | 263 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/src/platform.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.4 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2002-2006 Marcus Geelnard 5 | // Copyright (c) 2006-2018 Camilla Löwy 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | // Please use C89 style variable declarations in this file because VS 2010 28 | //======================================================================== 29 | 30 | #include "internal.h" 31 | 32 | ////////////////////////////////////////////////////////////////////////// 33 | ////// GLFW internal API ////// 34 | ////////////////////////////////////////////////////////////////////////// 35 | 36 | static const struct 37 | { 38 | int ID; 39 | GLFWbool (*connect)(int,_GLFWplatform*); 40 | } supportedPlatforms[] = 41 | { 42 | #if defined(_GLFW_WIN32) 43 | { GLFW_PLATFORM_WIN32, _glfwConnectWin32 }, 44 | #endif 45 | #if defined(_GLFW_COCOA) 46 | { GLFW_PLATFORM_COCOA, _glfwConnectCocoa }, 47 | #endif 48 | #if defined(_GLFW_X11) 49 | { GLFW_PLATFORM_X11, _glfwConnectX11 }, 50 | #endif 51 | #if defined(_GLFW_WAYLAND) 52 | { GLFW_PLATFORM_WAYLAND, _glfwConnectWayland }, 53 | #endif 54 | }; 55 | 56 | GLFWbool _glfwSelectPlatform(int desiredID, _GLFWplatform* platform) 57 | { 58 | const size_t count = sizeof(supportedPlatforms) / sizeof(supportedPlatforms[0]); 59 | size_t i; 60 | 61 | if (desiredID != GLFW_ANY_PLATFORM && 62 | desiredID != GLFW_PLATFORM_WIN32 && 63 | desiredID != GLFW_PLATFORM_COCOA && 64 | desiredID != GLFW_PLATFORM_WAYLAND && 65 | desiredID != GLFW_PLATFORM_X11 && 66 | desiredID != GLFW_PLATFORM_NULL) 67 | { 68 | _glfwInputError(GLFW_INVALID_ENUM, "Invalid platform ID 0x%08X", desiredID); 69 | return GLFW_FALSE; 70 | } 71 | 72 | // Only allow the Null platform if specifically requested 73 | if (desiredID == GLFW_PLATFORM_NULL) 74 | return GLFW_FALSE; //_glfwConnectNull(desiredID, platform); // @raysan5 75 | else if (count == 0) 76 | { 77 | _glfwInputError(GLFW_PLATFORM_UNAVAILABLE, "This binary only supports the Null platform"); 78 | return GLFW_FALSE; 79 | } 80 | 81 | if (desiredID == GLFW_ANY_PLATFORM) 82 | { 83 | // If there is exactly one platform available for auto-selection, let it emit the 84 | // error on failure as the platform-specific error description may be more helpful 85 | if (count == 1) 86 | return supportedPlatforms[0].connect(supportedPlatforms[0].ID, platform); 87 | 88 | for (i = 0; i < count; i++) 89 | { 90 | if (supportedPlatforms[i].connect(desiredID, platform)) 91 | return GLFW_TRUE; 92 | } 93 | 94 | _glfwInputError(GLFW_PLATFORM_UNAVAILABLE, "Failed to detect any supported platform"); 95 | } 96 | else 97 | { 98 | for (i = 0; i < count; i++) 99 | { 100 | if (supportedPlatforms[i].ID == desiredID) 101 | return supportedPlatforms[i].connect(desiredID, platform); 102 | } 103 | 104 | _glfwInputError(GLFW_PLATFORM_UNAVAILABLE, "The requested platform is not supported"); 105 | } 106 | 107 | return GLFW_FALSE; 108 | } 109 | 110 | ////////////////////////////////////////////////////////////////////////// 111 | ////// GLFW public API ////// 112 | ////////////////////////////////////////////////////////////////////////// 113 | 114 | GLFWAPI int glfwGetPlatform(void) 115 | { 116 | _GLFW_REQUIRE_INIT_OR_RETURN(0); 117 | return _glfw.platform.platformID; 118 | } 119 | 120 | GLFWAPI int glfwPlatformSupported(int platformID) 121 | { 122 | const size_t count = sizeof(supportedPlatforms) / sizeof(supportedPlatforms[0]); 123 | size_t i; 124 | 125 | if (platformID != GLFW_PLATFORM_WIN32 && 126 | platformID != GLFW_PLATFORM_COCOA && 127 | platformID != GLFW_PLATFORM_WAYLAND && 128 | platformID != GLFW_PLATFORM_X11 && 129 | platformID != GLFW_PLATFORM_NULL) 130 | { 131 | _glfwInputError(GLFW_INVALID_ENUM, "Invalid platform ID 0x%08X", platformID); 132 | return GLFW_FALSE; 133 | } 134 | 135 | if (platformID == GLFW_PLATFORM_NULL) 136 | return GLFW_TRUE; 137 | 138 | for (i = 0; i < count; i++) 139 | { 140 | if (platformID == supportedPlatforms[i].ID) 141 | return GLFW_TRUE; 142 | } 143 | 144 | return GLFW_FALSE; 145 | } 146 | 147 | GLFWAPI const char* glfwGetVersionString(void) 148 | { 149 | return _GLFW_VERSION_NUMBER 150 | #if defined(_GLFW_WIN32) 151 | " Win32 WGL" 152 | #endif 153 | #if defined(_GLFW_COCOA) 154 | " Cocoa NSGL" 155 | #endif 156 | #if defined(_GLFW_WAYLAND) 157 | " Wayland" 158 | #endif 159 | #if defined(_GLFW_X11) 160 | " X11 GLX" 161 | #endif 162 | " Null" 163 | " EGL" 164 | " OSMesa" 165 | #if defined(__MINGW64_VERSION_MAJOR) 166 | " MinGW-w64" 167 | #elif defined(__MINGW32__) 168 | " MinGW" 169 | #elif defined(_MSC_VER) 170 | " VisualC" 171 | #endif 172 | #if defined(_GLFW_USE_HYBRID_HPG) || defined(_GLFW_USE_OPTIMUS_HPG) 173 | " hybrid-GPU" 174 | #endif 175 | #if defined(_POSIX_MONOTONIC_CLOCK) 176 | " monotonic" 177 | #endif 178 | #if defined(_GLFW_BUILD_DLL) 179 | #if defined(_WIN32) 180 | " DLL" 181 | #elif defined(__APPLE__) 182 | " dynamic" 183 | #else 184 | " shared" 185 | #endif 186 | #endif 187 | ; 188 | } 189 | 190 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.4...3.20 FATAL_ERROR) 2 | 3 | project(GLFW VERSION 3.4.0 LANGUAGES C) 4 | 5 | set(CMAKE_LEGACY_CYGWIN_WIN32 OFF) 6 | 7 | if (POLICY CMP0054) 8 | cmake_policy(SET CMP0054 NEW) 9 | endif() 10 | 11 | if (POLICY CMP0069) 12 | cmake_policy(SET CMP0069 NEW) 13 | endif() 14 | 15 | if (POLICY CMP0077) 16 | cmake_policy(SET CMP0077 NEW) 17 | endif() 18 | 19 | set_property(GLOBAL PROPERTY USE_FOLDERS ON) 20 | 21 | if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) 22 | set(GLFW_STANDALONE TRUE) 23 | endif() 24 | 25 | option(BUILD_SHARED_LIBS "Build shared libraries" OFF) 26 | option(GLFW_BUILD_EXAMPLES "Build the GLFW example programs" ${GLFW_STANDALONE}) 27 | option(GLFW_BUILD_TESTS "Build the GLFW test programs" ${GLFW_STANDALONE}) 28 | option(GLFW_BUILD_DOCS "Build the GLFW documentation" ON) 29 | option(GLFW_INSTALL "Generate installation target" ON) 30 | 31 | include(GNUInstallDirs) 32 | include(CMakeDependentOption) 33 | 34 | if (GLFW_USE_OSMESA) 35 | message(FATAL_ERROR "GLFW_USE_OSMESA has been removed; set the GLFW_PLATFORM init hint") 36 | endif() 37 | 38 | cmake_dependent_option(GLFW_BUILD_WIN32 "Build support for Win32" ON "WIN32" OFF) 39 | cmake_dependent_option(GLFW_BUILD_COCOA "Build support for Cocoa" ON "APPLE" OFF) 40 | cmake_dependent_option(GLFW_BUILD_X11 "Build support for X11" ON "UNIX;NOT APPLE" OFF) 41 | cmake_dependent_option(GLFW_BUILD_WAYLAND "Build support for Wayland" 42 | "${GLFW_USE_WAYLAND}" "UNIX;NOT APPLE" OFF) 43 | 44 | cmake_dependent_option(GLFW_USE_HYBRID_HPG "Force use of high-performance GPU on hybrid systems" OFF 45 | "WIN32" OFF) 46 | cmake_dependent_option(USE_MSVC_RUNTIME_LIBRARY_DLL "Use MSVC runtime library DLL" ON 47 | "MSVC" OFF) 48 | 49 | set(GLFW_LIBRARY_TYPE "${GLFW_LIBRARY_TYPE}" CACHE STRING 50 | "Library type override for GLFW (SHARED, STATIC, OBJECT, or empty to follow BUILD_SHARED_LIBS)") 51 | 52 | if (GLFW_LIBRARY_TYPE) 53 | if (GLFW_LIBRARY_TYPE STREQUAL "SHARED") 54 | set(GLFW_BUILD_SHARED_LIBRARY TRUE) 55 | else() 56 | set(GLFW_BUILD_SHARED_LIBRARY FALSE) 57 | endif() 58 | else() 59 | set(GLFW_BUILD_SHARED_LIBRARY ${BUILD_SHARED_LIBS}) 60 | endif() 61 | 62 | list(APPEND CMAKE_MODULE_PATH "${GLFW_SOURCE_DIR}/CMake/modules") 63 | 64 | find_package(Threads REQUIRED) 65 | 66 | if (GLFW_BUILD_DOCS) 67 | set(DOXYGEN_SKIP_DOT TRUE) 68 | find_package(Doxygen) 69 | endif() 70 | 71 | #-------------------------------------------------------------------- 72 | # Report backend selection 73 | #-------------------------------------------------------------------- 74 | if (GLFW_BUILD_WIN32) 75 | message(STATUS "Including Win32 support") 76 | endif() 77 | if (GLFW_BUILD_COCOA) 78 | message(STATUS "Including Cocoa support") 79 | endif() 80 | if (GLFW_BUILD_WAYLAND) 81 | message(STATUS "Including Wayland support") 82 | endif() 83 | if (GLFW_BUILD_X11) 84 | message(STATUS "Including X11 support") 85 | endif() 86 | 87 | #-------------------------------------------------------------------- 88 | # Apply Microsoft C runtime library option 89 | # This is here because it also applies to tests and examples 90 | #-------------------------------------------------------------------- 91 | if (MSVC AND NOT USE_MSVC_RUNTIME_LIBRARY_DLL) 92 | if (CMAKE_VERSION VERSION_LESS 3.15) 93 | foreach (flag CMAKE_C_FLAGS 94 | CMAKE_C_FLAGS_DEBUG 95 | CMAKE_C_FLAGS_RELEASE 96 | CMAKE_C_FLAGS_MINSIZEREL 97 | CMAKE_C_FLAGS_RELWITHDEBINFO) 98 | 99 | if (flag MATCHES "/MD") 100 | string(REGEX REPLACE "/MD" "/MT" ${flag} "${${flag}}") 101 | endif() 102 | if (flag MATCHES "/MDd") 103 | string(REGEX REPLACE "/MDd" "/MTd" ${flag} "${${flag}}") 104 | endif() 105 | 106 | endforeach() 107 | else() 108 | set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") 109 | endif() 110 | endif() 111 | 112 | #-------------------------------------------------------------------- 113 | # Create generated files 114 | #-------------------------------------------------------------------- 115 | include(CMakePackageConfigHelpers) 116 | 117 | set(GLFW_CONFIG_PATH "${CMAKE_INSTALL_LIBDIR}/cmake/glfw3") 118 | 119 | configure_package_config_file(CMake/glfw3Config.cmake.in 120 | src/glfw3Config.cmake 121 | INSTALL_DESTINATION "${GLFW_CONFIG_PATH}" 122 | NO_CHECK_REQUIRED_COMPONENTS_MACRO) 123 | 124 | write_basic_package_version_file(src/glfw3ConfigVersion.cmake 125 | VERSION ${GLFW_VERSION} 126 | COMPATIBILITY SameMajorVersion) 127 | 128 | #-------------------------------------------------------------------- 129 | # Add subdirectories 130 | #-------------------------------------------------------------------- 131 | add_subdirectory(src) 132 | 133 | if (GLFW_BUILD_EXAMPLES) 134 | add_subdirectory(examples) 135 | endif() 136 | 137 | if (GLFW_BUILD_TESTS) 138 | add_subdirectory(tests) 139 | endif() 140 | 141 | if (DOXYGEN_FOUND AND GLFW_BUILD_DOCS) 142 | add_subdirectory(docs) 143 | endif() 144 | 145 | #-------------------------------------------------------------------- 146 | # Install files other than the library 147 | # The library is installed by src/CMakeLists.txt 148 | #-------------------------------------------------------------------- 149 | if (GLFW_INSTALL) 150 | install(DIRECTORY include/GLFW DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} 151 | FILES_MATCHING PATTERN glfw3.h PATTERN glfw3native.h) 152 | 153 | install(FILES "${GLFW_BINARY_DIR}/src/glfw3Config.cmake" 154 | "${GLFW_BINARY_DIR}/src/glfw3ConfigVersion.cmake" 155 | DESTINATION "${GLFW_CONFIG_PATH}") 156 | 157 | install(EXPORT glfwTargets FILE glfw3Targets.cmake 158 | EXPORT_LINK_INTERFACE_LIBRARIES 159 | DESTINATION "${GLFW_CONFIG_PATH}") 160 | install(FILES "${GLFW_BINARY_DIR}/src/glfw3.pc" 161 | DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") 162 | 163 | if (DOXYGEN_FOUND AND GLFW_BUILD_DOCS) 164 | install(DIRECTORY "${GLFW_BINARY_DIR}/docs/html" 165 | DESTINATION "${CMAKE_INSTALL_DOCDIR}") 166 | endif() 167 | 168 | # Only generate this target if no higher-level project already has 169 | if (NOT TARGET uninstall) 170 | configure_file(CMake/cmake_uninstall.cmake.in 171 | cmake_uninstall.cmake IMMEDIATE @ONLY) 172 | 173 | add_custom_target(uninstall 174 | "${CMAKE_COMMAND}" -P 175 | "${GLFW_BINARY_DIR}/cmake_uninstall.cmake") 176 | set_target_properties(uninstall PROPERTIES FOLDER "GLFW3") 177 | endif() 178 | endif() 179 | 180 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/src/null_platform.h: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.4 - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2016 Google Inc. 5 | // Copyright (c) 2016-2017 Camilla Löwy 6 | // 7 | // This software is provided 'as-is', without any express or implied 8 | // warranty. In no event will the authors be held liable for any damages 9 | // arising from the use of this software. 10 | // 11 | // Permission is granted to anyone to use this software for any purpose, 12 | // including commercial applications, and to alter it and redistribute it 13 | // freely, subject to the following restrictions: 14 | // 15 | // 1. The origin of this software must not be misrepresented; you must not 16 | // claim that you wrote the original software. If you use this software 17 | // in a product, an acknowledgment in the product documentation would 18 | // be appreciated but is not required. 19 | // 20 | // 2. Altered source versions must be plainly marked as such, and must not 21 | // be misrepresented as being the original software. 22 | // 23 | // 3. This notice may not be removed or altered from any source 24 | // distribution. 25 | // 26 | //======================================================================== 27 | 28 | #define GLFW_NULL_WINDOW_STATE _GLFWwindowNull null; 29 | #define GLFW_NULL_LIBRARY_WINDOW_STATE _GLFWlibraryNull null; 30 | #define GLFW_NULL_MONITOR_STATE _GLFWmonitorNull null; 31 | 32 | #define GLFW_NULL_CONTEXT_STATE 33 | #define GLFW_NULL_CURSOR_STATE 34 | #define GLFW_NULL_LIBRARY_CONTEXT_STATE 35 | 36 | 37 | // Null-specific per-window data 38 | // 39 | typedef struct _GLFWwindowNull 40 | { 41 | int xpos; 42 | int ypos; 43 | int width; 44 | int height; 45 | char* title; 46 | GLFWbool visible; 47 | GLFWbool iconified; 48 | GLFWbool maximized; 49 | GLFWbool resizable; 50 | GLFWbool decorated; 51 | GLFWbool floating; 52 | GLFWbool transparent; 53 | float opacity; 54 | } _GLFWwindowNull; 55 | 56 | // Null-specific per-monitor data 57 | // 58 | typedef struct _GLFWmonitorNull 59 | { 60 | GLFWgammaramp ramp; 61 | } _GLFWmonitorNull; 62 | 63 | // Null-specific global data 64 | // 65 | typedef struct _GLFWlibraryNull 66 | { 67 | int xcursor; 68 | int ycursor; 69 | char* clipboardString; 70 | _GLFWwindow* focusedWindow; 71 | } _GLFWlibraryNull; 72 | 73 | void _glfwPollMonitorsNull(void); 74 | 75 | GLFWbool _glfwConnectNull(int platformID, _GLFWplatform* platform); 76 | int _glfwInitNull(void); 77 | void _glfwTerminateNull(void); 78 | 79 | void _glfwFreeMonitorNull(_GLFWmonitor* monitor); 80 | void _glfwGetMonitorPosNull(_GLFWmonitor* monitor, int* xpos, int* ypos); 81 | void _glfwGetMonitorContentScaleNull(_GLFWmonitor* monitor, float* xscale, float* yscale); 82 | void _glfwGetMonitorWorkareaNull(_GLFWmonitor* monitor, int* xpos, int* ypos, int* width, int* height); 83 | GLFWvidmode* _glfwGetVideoModesNull(_GLFWmonitor* monitor, int* found); 84 | void _glfwGetVideoModeNull(_GLFWmonitor* monitor, GLFWvidmode* mode); 85 | GLFWbool _glfwGetGammaRampNull(_GLFWmonitor* monitor, GLFWgammaramp* ramp); 86 | void _glfwSetGammaRampNull(_GLFWmonitor* monitor, const GLFWgammaramp* ramp); 87 | 88 | GLFWbool _glfwCreateWindowNull(_GLFWwindow* window, const _GLFWwndconfig* wndconfig, const _GLFWctxconfig* ctxconfig, const _GLFWfbconfig* fbconfig); 89 | void _glfwDestroyWindowNull(_GLFWwindow* window); 90 | void _glfwSetWindowTitleNull(_GLFWwindow* window, const char* title); 91 | void _glfwSetWindowIconNull(_GLFWwindow* window, int count, const GLFWimage* images); 92 | void _glfwSetWindowMonitorNull(_GLFWwindow* window, _GLFWmonitor* monitor, int xpos, int ypos, int width, int height, int refreshRate); 93 | void _glfwGetWindowPosNull(_GLFWwindow* window, int* xpos, int* ypos); 94 | void _glfwSetWindowPosNull(_GLFWwindow* window, int xpos, int ypos); 95 | void _glfwGetWindowSizeNull(_GLFWwindow* window, int* width, int* height); 96 | void _glfwSetWindowSizeNull(_GLFWwindow* window, int width, int height); 97 | void _glfwSetWindowSizeLimitsNull(_GLFWwindow* window, int minwidth, int minheight, int maxwidth, int maxheight); 98 | void _glfwSetWindowAspectRatioNull(_GLFWwindow* window, int n, int d); 99 | void _glfwGetFramebufferSizeNull(_GLFWwindow* window, int* width, int* height); 100 | void _glfwGetWindowFrameSizeNull(_GLFWwindow* window, int* left, int* top, int* right, int* bottom); 101 | void _glfwGetWindowContentScaleNull(_GLFWwindow* window, float* xscale, float* yscale); 102 | void _glfwIconifyWindowNull(_GLFWwindow* window); 103 | void _glfwRestoreWindowNull(_GLFWwindow* window); 104 | void _glfwMaximizeWindowNull(_GLFWwindow* window); 105 | GLFWbool _glfwWindowMaximizedNull(_GLFWwindow* window); 106 | GLFWbool _glfwWindowHoveredNull(_GLFWwindow* window); 107 | GLFWbool _glfwFramebufferTransparentNull(_GLFWwindow* window); 108 | void _glfwSetWindowResizableNull(_GLFWwindow* window, GLFWbool enabled); 109 | void _glfwSetWindowDecoratedNull(_GLFWwindow* window, GLFWbool enabled); 110 | void _glfwSetWindowFloatingNull(_GLFWwindow* window, GLFWbool enabled); 111 | void _glfwSetWindowMousePassthroughNull(_GLFWwindow* window, GLFWbool enabled); 112 | float _glfwGetWindowOpacityNull(_GLFWwindow* window); 113 | void _glfwSetWindowOpacityNull(_GLFWwindow* window, float opacity); 114 | void _glfwSetRawMouseMotionNull(_GLFWwindow *window, GLFWbool enabled); 115 | GLFWbool _glfwRawMouseMotionSupportedNull(void); 116 | void _glfwShowWindowNull(_GLFWwindow* window); 117 | void _glfwRequestWindowAttentionNull(_GLFWwindow* window); 118 | void _glfwRequestWindowAttentionNull(_GLFWwindow* window); 119 | void _glfwHideWindowNull(_GLFWwindow* window); 120 | void _glfwFocusWindowNull(_GLFWwindow* window); 121 | GLFWbool _glfwWindowFocusedNull(_GLFWwindow* window); 122 | GLFWbool _glfwWindowIconifiedNull(_GLFWwindow* window); 123 | GLFWbool _glfwWindowVisibleNull(_GLFWwindow* window); 124 | void _glfwPollEventsNull(void); 125 | void _glfwWaitEventsNull(void); 126 | void _glfwWaitEventsTimeoutNull(double timeout); 127 | void _glfwPostEmptyEventNull(void); 128 | void _glfwGetCursorPosNull(_GLFWwindow* window, double* xpos, double* ypos); 129 | void _glfwSetCursorPosNull(_GLFWwindow* window, double x, double y); 130 | void _glfwSetCursorModeNull(_GLFWwindow* window, int mode); 131 | GLFWbool _glfwCreateCursorNull(_GLFWcursor* cursor, const GLFWimage* image, int xhot, int yhot); 132 | GLFWbool _glfwCreateStandardCursorNull(_GLFWcursor* cursor, int shape); 133 | void _glfwDestroyCursorNull(_GLFWcursor* cursor); 134 | void _glfwSetCursorNull(_GLFWwindow* window, _GLFWcursor* cursor); 135 | void _glfwSetClipboardStringNull(const char* string); 136 | const char* _glfwGetClipboardStringNull(void); 137 | const char* _glfwGetScancodeNameNull(int scancode); 138 | int _glfwGetKeyScancodeNull(int key); 139 | 140 | EGLenum _glfwGetEGLPlatformNull(EGLint** attribs); 141 | EGLNativeDisplayType _glfwGetEGLNativeDisplayNull(void); 142 | EGLNativeWindowType _glfwGetEGLNativeWindowNull(_GLFWwindow* window); 143 | 144 | void _glfwGetRequiredInstanceExtensionsNull(char** extensions); 145 | GLFWbool _glfwGetPhysicalDevicePresentationSupportNull(VkInstance instance, VkPhysicalDevice device, uint32_t queuefamily); 146 | VkResult _glfwCreateWindowSurfaceNull(VkInstance instance, _GLFWwindow* window, const VkAllocationCallbacks* allocator, VkSurfaceKHR* surface); 147 | 148 | void _glfwPollMonitorsNull(void); 149 | 150 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/deps/vs2008/stdint.h: -------------------------------------------------------------------------------- 1 | // ISO C9x compliant stdint.h for Microsoft Visual Studio 2 | // Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 3 | // 4 | // Copyright (c) 2006-2008 Alexander Chemeris 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions are met: 8 | // 9 | // 1. Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // 2. Redistributions in binary form must reproduce the above copyright 13 | // notice, this list of conditions and the following disclaimer in the 14 | // documentation and/or other materials provided with the distribution. 15 | // 16 | // 3. The name of the author may be used to endorse or promote products 17 | // derived from this software without specific prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 20 | // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 22 | // EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 25 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 26 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 27 | // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 28 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | /////////////////////////////////////////////////////////////////////////////// 31 | 32 | #ifndef _MSC_VER // [ 33 | #error "Use this header only with Microsoft Visual C++ compilers!" 34 | #endif // _MSC_VER ] 35 | 36 | #ifndef _MSC_STDINT_H_ // [ 37 | #define _MSC_STDINT_H_ 38 | 39 | #if _MSC_VER > 1000 40 | #pragma once 41 | #endif 42 | 43 | #include 44 | 45 | // For Visual Studio 6 in C++ mode and for many Visual Studio versions when 46 | // compiling for ARM we should wrap include with 'extern "C++" {}' 47 | // or compiler give many errors like this: 48 | // error C2733: second C linkage of overloaded function 'wmemchr' not allowed 49 | #ifdef __cplusplus 50 | extern "C" { 51 | #endif 52 | # include 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | 57 | // Define _W64 macros to mark types changing their size, like intptr_t. 58 | #ifndef _W64 59 | # if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 60 | # define _W64 __w64 61 | # else 62 | # define _W64 63 | # endif 64 | #endif 65 | 66 | 67 | // 7.18.1 Integer types 68 | 69 | // 7.18.1.1 Exact-width integer types 70 | 71 | // Visual Studio 6 and Embedded Visual C++ 4 doesn't 72 | // realize that, e.g. char has the same size as __int8 73 | // so we give up on __intX for them. 74 | #if (_MSC_VER < 1300) 75 | typedef signed char int8_t; 76 | typedef signed short int16_t; 77 | typedef signed int int32_t; 78 | typedef unsigned char uint8_t; 79 | typedef unsigned short uint16_t; 80 | typedef unsigned int uint32_t; 81 | #else 82 | typedef signed __int8 int8_t; 83 | typedef signed __int16 int16_t; 84 | typedef signed __int32 int32_t; 85 | typedef unsigned __int8 uint8_t; 86 | typedef unsigned __int16 uint16_t; 87 | typedef unsigned __int32 uint32_t; 88 | #endif 89 | typedef signed __int64 int64_t; 90 | typedef unsigned __int64 uint64_t; 91 | 92 | 93 | // 7.18.1.2 Minimum-width integer types 94 | typedef int8_t int_least8_t; 95 | typedef int16_t int_least16_t; 96 | typedef int32_t int_least32_t; 97 | typedef int64_t int_least64_t; 98 | typedef uint8_t uint_least8_t; 99 | typedef uint16_t uint_least16_t; 100 | typedef uint32_t uint_least32_t; 101 | typedef uint64_t uint_least64_t; 102 | 103 | // 7.18.1.3 Fastest minimum-width integer types 104 | typedef int8_t int_fast8_t; 105 | typedef int16_t int_fast16_t; 106 | typedef int32_t int_fast32_t; 107 | typedef int64_t int_fast64_t; 108 | typedef uint8_t uint_fast8_t; 109 | typedef uint16_t uint_fast16_t; 110 | typedef uint32_t uint_fast32_t; 111 | typedef uint64_t uint_fast64_t; 112 | 113 | // 7.18.1.4 Integer types capable of holding object pointers 114 | #ifdef _WIN64 // [ 115 | typedef signed __int64 intptr_t; 116 | typedef unsigned __int64 uintptr_t; 117 | #else // _WIN64 ][ 118 | typedef _W64 signed int intptr_t; 119 | typedef _W64 unsigned int uintptr_t; 120 | #endif // _WIN64 ] 121 | 122 | // 7.18.1.5 Greatest-width integer types 123 | typedef int64_t intmax_t; 124 | typedef uint64_t uintmax_t; 125 | 126 | 127 | // 7.18.2 Limits of specified-width integer types 128 | 129 | #if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259 130 | 131 | // 7.18.2.1 Limits of exact-width integer types 132 | #define INT8_MIN ((int8_t)_I8_MIN) 133 | #define INT8_MAX _I8_MAX 134 | #define INT16_MIN ((int16_t)_I16_MIN) 135 | #define INT16_MAX _I16_MAX 136 | #define INT32_MIN ((int32_t)_I32_MIN) 137 | #define INT32_MAX _I32_MAX 138 | #define INT64_MIN ((int64_t)_I64_MIN) 139 | #define INT64_MAX _I64_MAX 140 | #define UINT8_MAX _UI8_MAX 141 | #define UINT16_MAX _UI16_MAX 142 | #define UINT32_MAX _UI32_MAX 143 | #define UINT64_MAX _UI64_MAX 144 | 145 | // 7.18.2.2 Limits of minimum-width integer types 146 | #define INT_LEAST8_MIN INT8_MIN 147 | #define INT_LEAST8_MAX INT8_MAX 148 | #define INT_LEAST16_MIN INT16_MIN 149 | #define INT_LEAST16_MAX INT16_MAX 150 | #define INT_LEAST32_MIN INT32_MIN 151 | #define INT_LEAST32_MAX INT32_MAX 152 | #define INT_LEAST64_MIN INT64_MIN 153 | #define INT_LEAST64_MAX INT64_MAX 154 | #define UINT_LEAST8_MAX UINT8_MAX 155 | #define UINT_LEAST16_MAX UINT16_MAX 156 | #define UINT_LEAST32_MAX UINT32_MAX 157 | #define UINT_LEAST64_MAX UINT64_MAX 158 | 159 | // 7.18.2.3 Limits of fastest minimum-width integer types 160 | #define INT_FAST8_MIN INT8_MIN 161 | #define INT_FAST8_MAX INT8_MAX 162 | #define INT_FAST16_MIN INT16_MIN 163 | #define INT_FAST16_MAX INT16_MAX 164 | #define INT_FAST32_MIN INT32_MIN 165 | #define INT_FAST32_MAX INT32_MAX 166 | #define INT_FAST64_MIN INT64_MIN 167 | #define INT_FAST64_MAX INT64_MAX 168 | #define UINT_FAST8_MAX UINT8_MAX 169 | #define UINT_FAST16_MAX UINT16_MAX 170 | #define UINT_FAST32_MAX UINT32_MAX 171 | #define UINT_FAST64_MAX UINT64_MAX 172 | 173 | // 7.18.2.4 Limits of integer types capable of holding object pointers 174 | #ifdef _WIN64 // [ 175 | # define INTPTR_MIN INT64_MIN 176 | # define INTPTR_MAX INT64_MAX 177 | # define UINTPTR_MAX UINT64_MAX 178 | #else // _WIN64 ][ 179 | # define INTPTR_MIN INT32_MIN 180 | # define INTPTR_MAX INT32_MAX 181 | # define UINTPTR_MAX UINT32_MAX 182 | #endif // _WIN64 ] 183 | 184 | // 7.18.2.5 Limits of greatest-width integer types 185 | #define INTMAX_MIN INT64_MIN 186 | #define INTMAX_MAX INT64_MAX 187 | #define UINTMAX_MAX UINT64_MAX 188 | 189 | // 7.18.3 Limits of other integer types 190 | 191 | #ifdef _WIN64 // [ 192 | # define PTRDIFF_MIN _I64_MIN 193 | # define PTRDIFF_MAX _I64_MAX 194 | #else // _WIN64 ][ 195 | # define PTRDIFF_MIN _I32_MIN 196 | # define PTRDIFF_MAX _I32_MAX 197 | #endif // _WIN64 ] 198 | 199 | #define SIG_ATOMIC_MIN INT_MIN 200 | #define SIG_ATOMIC_MAX INT_MAX 201 | 202 | #ifndef SIZE_MAX // [ 203 | # ifdef _WIN64 // [ 204 | # define SIZE_MAX _UI64_MAX 205 | # else // _WIN64 ][ 206 | # define SIZE_MAX _UI32_MAX 207 | # endif // _WIN64 ] 208 | #endif // SIZE_MAX ] 209 | 210 | // WCHAR_MIN and WCHAR_MAX are also defined in 211 | #ifndef WCHAR_MIN // [ 212 | # define WCHAR_MIN 0 213 | #endif // WCHAR_MIN ] 214 | #ifndef WCHAR_MAX // [ 215 | # define WCHAR_MAX _UI16_MAX 216 | #endif // WCHAR_MAX ] 217 | 218 | #define WINT_MIN 0 219 | #define WINT_MAX _UI16_MAX 220 | 221 | #endif // __STDC_LIMIT_MACROS ] 222 | 223 | 224 | // 7.18.4 Limits of other integer types 225 | 226 | #if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260 227 | 228 | // 7.18.4.1 Macros for minimum-width integer constants 229 | 230 | #define INT8_C(val) val##i8 231 | #define INT16_C(val) val##i16 232 | #define INT32_C(val) val##i32 233 | #define INT64_C(val) val##i64 234 | 235 | #define UINT8_C(val) val##ui8 236 | #define UINT16_C(val) val##ui16 237 | #define UINT32_C(val) val##ui32 238 | #define UINT64_C(val) val##ui64 239 | 240 | // 7.18.4.2 Macros for greatest-width integer constants 241 | #define INTMAX_C INT64_C 242 | #define UINTMAX_C UINT64_C 243 | 244 | #endif // __STDC_CONSTANT_MACROS ] 245 | 246 | 247 | #endif // _MSC_STDINT_H_ ] 248 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/deps/mingw/xinput.h: -------------------------------------------------------------------------------- 1 | /* 2 | * The Wine project - Xinput Joystick Library 3 | * Copyright 2008 Andrew Fenn 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 18 | */ 19 | 20 | #ifndef __WINE_XINPUT_H 21 | #define __WINE_XINPUT_H 22 | 23 | #include 24 | 25 | /* 26 | * Bitmasks for the joysticks buttons, determines what has 27 | * been pressed on the joystick, these need to be mapped 28 | * to whatever device you're using instead of an xbox 360 29 | * joystick 30 | */ 31 | 32 | #define XINPUT_GAMEPAD_DPAD_UP 0x0001 33 | #define XINPUT_GAMEPAD_DPAD_DOWN 0x0002 34 | #define XINPUT_GAMEPAD_DPAD_LEFT 0x0004 35 | #define XINPUT_GAMEPAD_DPAD_RIGHT 0x0008 36 | #define XINPUT_GAMEPAD_START 0x0010 37 | #define XINPUT_GAMEPAD_BACK 0x0020 38 | #define XINPUT_GAMEPAD_LEFT_THUMB 0x0040 39 | #define XINPUT_GAMEPAD_RIGHT_THUMB 0x0080 40 | #define XINPUT_GAMEPAD_LEFT_SHOULDER 0x0100 41 | #define XINPUT_GAMEPAD_RIGHT_SHOULDER 0x0200 42 | #define XINPUT_GAMEPAD_A 0x1000 43 | #define XINPUT_GAMEPAD_B 0x2000 44 | #define XINPUT_GAMEPAD_X 0x4000 45 | #define XINPUT_GAMEPAD_Y 0x8000 46 | 47 | /* 48 | * Defines the flags used to determine if the user is pushing 49 | * down on a button, not holding a button, etc 50 | */ 51 | 52 | #define XINPUT_KEYSTROKE_KEYDOWN 0x0001 53 | #define XINPUT_KEYSTROKE_KEYUP 0x0002 54 | #define XINPUT_KEYSTROKE_REPEAT 0x0004 55 | 56 | /* 57 | * Defines the codes which are returned by XInputGetKeystroke 58 | */ 59 | 60 | #define VK_PAD_A 0x5800 61 | #define VK_PAD_B 0x5801 62 | #define VK_PAD_X 0x5802 63 | #define VK_PAD_Y 0x5803 64 | #define VK_PAD_RSHOULDER 0x5804 65 | #define VK_PAD_LSHOULDER 0x5805 66 | #define VK_PAD_LTRIGGER 0x5806 67 | #define VK_PAD_RTRIGGER 0x5807 68 | #define VK_PAD_DPAD_UP 0x5810 69 | #define VK_PAD_DPAD_DOWN 0x5811 70 | #define VK_PAD_DPAD_LEFT 0x5812 71 | #define VK_PAD_DPAD_RIGHT 0x5813 72 | #define VK_PAD_START 0x5814 73 | #define VK_PAD_BACK 0x5815 74 | #define VK_PAD_LTHUMB_PRESS 0x5816 75 | #define VK_PAD_RTHUMB_PRESS 0x5817 76 | #define VK_PAD_LTHUMB_UP 0x5820 77 | #define VK_PAD_LTHUMB_DOWN 0x5821 78 | #define VK_PAD_LTHUMB_RIGHT 0x5822 79 | #define VK_PAD_LTHUMB_LEFT 0x5823 80 | #define VK_PAD_LTHUMB_UPLEFT 0x5824 81 | #define VK_PAD_LTHUMB_UPRIGHT 0x5825 82 | #define VK_PAD_LTHUMB_DOWNRIGHT 0x5826 83 | #define VK_PAD_LTHUMB_DOWNLEFT 0x5827 84 | #define VK_PAD_RTHUMB_UP 0x5830 85 | #define VK_PAD_RTHUMB_DOWN 0x5831 86 | #define VK_PAD_RTHUMB_RIGHT 0x5832 87 | #define VK_PAD_RTHUMB_LEFT 0x5833 88 | #define VK_PAD_RTHUMB_UPLEFT 0x5834 89 | #define VK_PAD_RTHUMB_UPRIGHT 0x5835 90 | #define VK_PAD_RTHUMB_DOWNRIGHT 0x5836 91 | #define VK_PAD_RTHUMB_DOWNLEFT 0x5837 92 | 93 | /* 94 | * Deadzones are for analogue joystick controls on the joypad 95 | * which determine when input should be assumed to be in the 96 | * middle of the pad. This is a threshold to stop a joypad 97 | * controlling the game when the player isn't touching the 98 | * controls. 99 | */ 100 | 101 | #define XINPUT_GAMEPAD_LEFT_THUMB_DEADZONE 7849 102 | #define XINPUT_GAMEPAD_RIGHT_THUMB_DEADZONE 8689 103 | #define XINPUT_GAMEPAD_TRIGGER_THRESHOLD 30 104 | 105 | 106 | /* 107 | * Defines what type of abilities the type of joystick has 108 | * DEVTYPE_GAMEPAD is available for all joysticks, however 109 | * there may be more specific identifiers for other joysticks 110 | * which are being used. 111 | */ 112 | 113 | #define XINPUT_DEVTYPE_GAMEPAD 0x01 114 | #define XINPUT_DEVSUBTYPE_GAMEPAD 0x01 115 | #define XINPUT_DEVSUBTYPE_WHEEL 0x02 116 | #define XINPUT_DEVSUBTYPE_ARCADE_STICK 0x03 117 | #define XINPUT_DEVSUBTYPE_FLIGHT_SICK 0x04 118 | #define XINPUT_DEVSUBTYPE_DANCE_PAD 0x05 119 | #define XINPUT_DEVSUBTYPE_GUITAR 0x06 120 | #define XINPUT_DEVSUBTYPE_DRUM_KIT 0x08 121 | 122 | /* 123 | * These are used with the XInputGetCapabilities function to 124 | * determine the abilities to the joystick which has been 125 | * plugged in. 126 | */ 127 | 128 | #define XINPUT_CAPS_VOICE_SUPPORTED 0x0004 129 | #define XINPUT_FLAG_GAMEPAD 0x00000001 130 | 131 | /* 132 | * Defines the status of the battery if one is used in the 133 | * attached joystick. The first two define if the joystick 134 | * supports a battery. Disconnected means that the joystick 135 | * isn't connected. Wired shows that the joystick is a wired 136 | * joystick. 137 | */ 138 | 139 | #define BATTERY_DEVTYPE_GAMEPAD 0x00 140 | #define BATTERY_DEVTYPE_HEADSET 0x01 141 | #define BATTERY_TYPE_DISCONNECTED 0x00 142 | #define BATTERY_TYPE_WIRED 0x01 143 | #define BATTERY_TYPE_ALKALINE 0x02 144 | #define BATTERY_TYPE_NIMH 0x03 145 | #define BATTERY_TYPE_UNKNOWN 0xFF 146 | #define BATTERY_LEVEL_EMPTY 0x00 147 | #define BATTERY_LEVEL_LOW 0x01 148 | #define BATTERY_LEVEL_MEDIUM 0x02 149 | #define BATTERY_LEVEL_FULL 0x03 150 | 151 | /* 152 | * How many joysticks can be used with this library. Games that 153 | * use the xinput library will not go over this number. 154 | */ 155 | 156 | #define XUSER_MAX_COUNT 4 157 | #define XUSER_INDEX_ANY 0x000000FF 158 | 159 | /* 160 | * Defines the structure of an xbox 360 joystick. 161 | */ 162 | 163 | typedef struct _XINPUT_GAMEPAD { 164 | WORD wButtons; 165 | BYTE bLeftTrigger; 166 | BYTE bRightTrigger; 167 | SHORT sThumbLX; 168 | SHORT sThumbLY; 169 | SHORT sThumbRX; 170 | SHORT sThumbRY; 171 | } XINPUT_GAMEPAD, *PXINPUT_GAMEPAD; 172 | 173 | typedef struct _XINPUT_STATE { 174 | DWORD dwPacketNumber; 175 | XINPUT_GAMEPAD Gamepad; 176 | } XINPUT_STATE, *PXINPUT_STATE; 177 | 178 | /* 179 | * Defines the structure of how much vibration is set on both the 180 | * right and left motors in a joystick. If you're not using a 360 181 | * joystick you will have to map these to your device. 182 | */ 183 | 184 | typedef struct _XINPUT_VIBRATION { 185 | WORD wLeftMotorSpeed; 186 | WORD wRightMotorSpeed; 187 | } XINPUT_VIBRATION, *PXINPUT_VIBRATION; 188 | 189 | /* 190 | * Defines the structure for what kind of abilities the joystick has 191 | * such abilities are things such as if the joystick has the ability 192 | * to send and receive audio, if the joystick is in fact a driving 193 | * wheel or perhaps if the joystick is some kind of dance pad or 194 | * guitar. 195 | */ 196 | 197 | typedef struct _XINPUT_CAPABILITIES { 198 | BYTE Type; 199 | BYTE SubType; 200 | WORD Flags; 201 | XINPUT_GAMEPAD Gamepad; 202 | XINPUT_VIBRATION Vibration; 203 | } XINPUT_CAPABILITIES, *PXINPUT_CAPABILITIES; 204 | 205 | /* 206 | * Defines the structure for a joystick input event which is 207 | * retrieved using the function XInputGetKeystroke 208 | */ 209 | typedef struct _XINPUT_KEYSTROKE { 210 | WORD VirtualKey; 211 | WCHAR Unicode; 212 | WORD Flags; 213 | BYTE UserIndex; 214 | BYTE HidCode; 215 | } XINPUT_KEYSTROKE, *PXINPUT_KEYSTROKE; 216 | 217 | typedef struct _XINPUT_BATTERY_INFORMATION 218 | { 219 | BYTE BatteryType; 220 | BYTE BatteryLevel; 221 | } XINPUT_BATTERY_INFORMATION, *PXINPUT_BATTERY_INFORMATION; 222 | 223 | #ifdef __cplusplus 224 | extern "C" { 225 | #endif 226 | 227 | void WINAPI XInputEnable(WINBOOL); 228 | DWORD WINAPI XInputSetState(DWORD, XINPUT_VIBRATION*); 229 | DWORD WINAPI XInputGetState(DWORD, XINPUT_STATE*); 230 | DWORD WINAPI XInputGetKeystroke(DWORD, DWORD, PXINPUT_KEYSTROKE); 231 | DWORD WINAPI XInputGetCapabilities(DWORD, DWORD, XINPUT_CAPABILITIES*); 232 | DWORD WINAPI XInputGetDSoundAudioDeviceGuids(DWORD, GUID*, GUID*); 233 | DWORD WINAPI XInputGetBatteryInformation(DWORD, BYTE, XINPUT_BATTERY_INFORMATION*); 234 | 235 | #ifdef __cplusplus 236 | } 237 | #endif 238 | 239 | #endif /* __WINE_XINPUT_H */ 240 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/deps/getopt.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012, Kim Gräsman 2 | * All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * * Redistributions of source code must retain the above copyright notice, 7 | * this list of conditions and the following disclaimer. 8 | * * Redistributions in binary form must reproduce the above copyright notice, 9 | * this list of conditions and the following disclaimer in the documentation 10 | * and/or other materials provided with the distribution. 11 | * * Neither the name of Kim Gräsman nor the names of contributors may be used 12 | * to endorse or promote products derived from this software without specific 13 | * prior written permission. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | * ARE DISCLAIMED. IN NO EVENT SHALL KIM GRÄSMAN BE LIABLE FOR ANY DIRECT, 19 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | */ 26 | 27 | #include "getopt.h" 28 | 29 | #include 30 | #include 31 | 32 | const int no_argument = 0; 33 | const int required_argument = 1; 34 | const int optional_argument = 2; 35 | 36 | char* optarg; 37 | int optopt; 38 | /* The variable optind [...] shall be initialized to 1 by the system. */ 39 | int optind = 1; 40 | int opterr; 41 | 42 | static char* optcursor = NULL; 43 | 44 | /* Implemented based on [1] and [2] for optional arguments. 45 | optopt is handled FreeBSD-style, per [3]. 46 | Other GNU and FreeBSD extensions are purely accidental. 47 | 48 | [1] http://pubs.opengroup.org/onlinepubs/000095399/functions/getopt.html 49 | [2] http://www.kernel.org/doc/man-pages/online/pages/man3/getopt.3.html 50 | [3] http://www.freebsd.org/cgi/man.cgi?query=getopt&sektion=3&manpath=FreeBSD+9.0-RELEASE 51 | */ 52 | int getopt(int argc, char* const argv[], const char* optstring) { 53 | int optchar = -1; 54 | const char* optdecl = NULL; 55 | 56 | optarg = NULL; 57 | opterr = 0; 58 | optopt = 0; 59 | 60 | /* Unspecified, but we need it to avoid overrunning the argv bounds. */ 61 | if (optind >= argc) 62 | goto no_more_optchars; 63 | 64 | /* If, when getopt() is called argv[optind] is a null pointer, getopt() 65 | shall return -1 without changing optind. */ 66 | if (argv[optind] == NULL) 67 | goto no_more_optchars; 68 | 69 | /* If, when getopt() is called *argv[optind] is not the character '-', 70 | getopt() shall return -1 without changing optind. */ 71 | if (*argv[optind] != '-') 72 | goto no_more_optchars; 73 | 74 | /* If, when getopt() is called argv[optind] points to the string "-", 75 | getopt() shall return -1 without changing optind. */ 76 | if (strcmp(argv[optind], "-") == 0) 77 | goto no_more_optchars; 78 | 79 | /* If, when getopt() is called argv[optind] points to the string "--", 80 | getopt() shall return -1 after incrementing optind. */ 81 | if (strcmp(argv[optind], "--") == 0) { 82 | ++optind; 83 | goto no_more_optchars; 84 | } 85 | 86 | if (optcursor == NULL || *optcursor == '\0') 87 | optcursor = argv[optind] + 1; 88 | 89 | optchar = *optcursor; 90 | 91 | /* FreeBSD: The variable optopt saves the last known option character 92 | returned by getopt(). */ 93 | optopt = optchar; 94 | 95 | /* The getopt() function shall return the next option character (if one is 96 | found) from argv that matches a character in optstring, if there is 97 | one that matches. */ 98 | optdecl = strchr(optstring, optchar); 99 | if (optdecl) { 100 | /* [I]f a character is followed by a colon, the option takes an 101 | argument. */ 102 | if (optdecl[1] == ':') { 103 | optarg = ++optcursor; 104 | if (*optarg == '\0') { 105 | /* GNU extension: Two colons mean an option takes an 106 | optional arg; if there is text in the current argv-element 107 | (i.e., in the same word as the option name itself, for example, 108 | "-oarg"), then it is returned in optarg, otherwise optarg is set 109 | to zero. */ 110 | if (optdecl[2] != ':') { 111 | /* If the option was the last character in the string pointed to by 112 | an element of argv, then optarg shall contain the next element 113 | of argv, and optind shall be incremented by 2. If the resulting 114 | value of optind is greater than argc, this indicates a missing 115 | option-argument, and getopt() shall return an error indication. 116 | 117 | Otherwise, optarg shall point to the string following the 118 | option character in that element of argv, and optind shall be 119 | incremented by 1. 120 | */ 121 | if (++optind < argc) { 122 | optarg = argv[optind]; 123 | } else { 124 | /* If it detects a missing option-argument, it shall return the 125 | colon character ( ':' ) if the first character of optstring 126 | was a colon, or a question-mark character ( '?' ) otherwise. 127 | */ 128 | optarg = NULL; 129 | optchar = (optstring[0] == ':') ? ':' : '?'; 130 | } 131 | } else { 132 | optarg = NULL; 133 | } 134 | } 135 | 136 | optcursor = NULL; 137 | } 138 | } else { 139 | /* If getopt() encounters an option character that is not contained in 140 | optstring, it shall return the question-mark ( '?' ) character. */ 141 | optchar = '?'; 142 | } 143 | 144 | if (optcursor == NULL || *++optcursor == '\0') 145 | ++optind; 146 | 147 | return optchar; 148 | 149 | no_more_optchars: 150 | optcursor = NULL; 151 | return -1; 152 | } 153 | 154 | /* Implementation based on [1]. 155 | 156 | [1] http://www.kernel.org/doc/man-pages/online/pages/man3/getopt.3.html 157 | */ 158 | int getopt_long(int argc, char* const argv[], const char* optstring, 159 | const struct option* longopts, int* longindex) { 160 | const struct option* o = longopts; 161 | const struct option* match = NULL; 162 | int num_matches = 0; 163 | size_t argument_name_length = 0; 164 | const char* current_argument = NULL; 165 | int retval = -1; 166 | 167 | optarg = NULL; 168 | optopt = 0; 169 | 170 | if (optind >= argc) 171 | return -1; 172 | 173 | if (strlen(argv[optind]) < 3 || strncmp(argv[optind], "--", 2) != 0) 174 | return getopt(argc, argv, optstring); 175 | 176 | /* It's an option; starts with -- and is longer than two chars. */ 177 | current_argument = argv[optind] + 2; 178 | argument_name_length = strcspn(current_argument, "="); 179 | for (; o->name; ++o) { 180 | if (strncmp(o->name, current_argument, argument_name_length) == 0) { 181 | match = o; 182 | ++num_matches; 183 | } 184 | } 185 | 186 | if (num_matches == 1) { 187 | /* If longindex is not NULL, it points to a variable which is set to the 188 | index of the long option relative to longopts. */ 189 | if (longindex) 190 | *longindex = (int) (match - longopts); 191 | 192 | /* If flag is NULL, then getopt_long() shall return val. 193 | Otherwise, getopt_long() returns 0, and flag shall point to a variable 194 | which shall be set to val if the option is found, but left unchanged if 195 | the option is not found. */ 196 | if (match->flag) 197 | *(match->flag) = match->val; 198 | 199 | retval = match->flag ? 0 : match->val; 200 | 201 | if (match->has_arg != no_argument) { 202 | optarg = strchr(argv[optind], '='); 203 | if (optarg != NULL) 204 | ++optarg; 205 | 206 | if (match->has_arg == required_argument) { 207 | /* Only scan the next argv for required arguments. Behavior is not 208 | specified, but has been observed with Ubuntu and Mac OSX. */ 209 | if (optarg == NULL && ++optind < argc) { 210 | optarg = argv[optind]; 211 | } 212 | 213 | if (optarg == NULL) 214 | retval = ':'; 215 | } 216 | } else if (strchr(argv[optind], '=')) { 217 | /* An argument was provided to a non-argument option. 218 | I haven't seen this specified explicitly, but both GNU and BSD-based 219 | implementations show this behavior. 220 | */ 221 | retval = '?'; 222 | } 223 | } else { 224 | /* Unknown option or ambiguous match. */ 225 | retval = '?'; 226 | } 227 | 228 | ++optind; 229 | return retval; 230 | } 231 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/glfw/src/wl_monitor.c: -------------------------------------------------------------------------------- 1 | //======================================================================== 2 | // GLFW 3.4 Wayland - www.glfw.org 3 | //------------------------------------------------------------------------ 4 | // Copyright (c) 2014 Jonas Ådahl 5 | // 6 | // This software is provided 'as-is', without any express or implied 7 | // warranty. In no event will the authors be held liable for any damages 8 | // arising from the use of this software. 9 | // 10 | // Permission is granted to anyone to use this software for any purpose, 11 | // including commercial applications, and to alter it and redistribute it 12 | // freely, subject to the following restrictions: 13 | // 14 | // 1. The origin of this software must not be misrepresented; you must not 15 | // claim that you wrote the original software. If you use this software 16 | // in a product, an acknowledgment in the product documentation would 17 | // be appreciated but is not required. 18 | // 19 | // 2. Altered source versions must be plainly marked as such, and must not 20 | // be misrepresented as being the original software. 21 | // 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | // 25 | //======================================================================== 26 | // It is fine to use C99 in this file because it will not be built with VS 27 | //======================================================================== 28 | 29 | #include "internal.h" 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | 37 | #include "wayland-client-protocol.h" 38 | 39 | 40 | static void outputHandleGeometry(void* userData, 41 | struct wl_output* output, 42 | int32_t x, 43 | int32_t y, 44 | int32_t physicalWidth, 45 | int32_t physicalHeight, 46 | int32_t subpixel, 47 | const char* make, 48 | const char* model, 49 | int32_t transform) 50 | { 51 | struct _GLFWmonitor* monitor = userData; 52 | 53 | monitor->wl.x = x; 54 | monitor->wl.y = y; 55 | monitor->widthMM = physicalWidth; 56 | monitor->heightMM = physicalHeight; 57 | 58 | if (strlen(monitor->name) == 0) 59 | snprintf(monitor->name, sizeof(monitor->name), "%s %s", make, model); 60 | } 61 | 62 | static void outputHandleMode(void* userData, 63 | struct wl_output* output, 64 | uint32_t flags, 65 | int32_t width, 66 | int32_t height, 67 | int32_t refresh) 68 | { 69 | struct _GLFWmonitor* monitor = userData; 70 | GLFWvidmode mode; 71 | 72 | mode.width = width; 73 | mode.height = height; 74 | mode.redBits = 8; 75 | mode.greenBits = 8; 76 | mode.blueBits = 8; 77 | mode.refreshRate = (int) round(refresh / 1000.0); 78 | 79 | monitor->modeCount++; 80 | monitor->modes = 81 | _glfw_realloc(monitor->modes, monitor->modeCount * sizeof(GLFWvidmode)); 82 | monitor->modes[monitor->modeCount - 1] = mode; 83 | 84 | if (flags & WL_OUTPUT_MODE_CURRENT) 85 | monitor->wl.currentMode = monitor->modeCount - 1; 86 | } 87 | 88 | static void outputHandleDone(void* userData, struct wl_output* output) 89 | { 90 | struct _GLFWmonitor* monitor = userData; 91 | 92 | if (monitor->widthMM <= 0 || monitor->heightMM <= 0) 93 | { 94 | // If Wayland does not provide a physical size, assume the default 96 DPI 95 | const GLFWvidmode* mode = &monitor->modes[monitor->wl.currentMode]; 96 | monitor->widthMM = (int) (mode->width * 25.4f / 96.f); 97 | monitor->heightMM = (int) (mode->height * 25.4f / 96.f); 98 | } 99 | 100 | for (int i = 0; i < _glfw.monitorCount; i++) 101 | { 102 | if (_glfw.monitors[i] == monitor) 103 | return; 104 | } 105 | 106 | _glfwInputMonitor(monitor, GLFW_CONNECTED, _GLFW_INSERT_LAST); 107 | } 108 | 109 | static void outputHandleScale(void* userData, 110 | struct wl_output* output, 111 | int32_t factor) 112 | { 113 | struct _GLFWmonitor* monitor = userData; 114 | 115 | monitor->wl.scale = factor; 116 | 117 | for (_GLFWwindow* window = _glfw.windowListHead; window; window = window->next) 118 | { 119 | for (int i = 0; i < window->wl.monitorsCount; i++) 120 | { 121 | if (window->wl.monitors[i] == monitor) 122 | { 123 | _glfwUpdateContentScaleWayland(window); 124 | break; 125 | } 126 | } 127 | } 128 | } 129 | 130 | #ifdef WL_OUTPUT_NAME_SINCE_VERSION 131 | 132 | void outputHandleName(void* userData, struct wl_output* wl_output, const char* name) 133 | { 134 | struct _GLFWmonitor* monitor = userData; 135 | 136 | strncpy(monitor->name, name, sizeof(monitor->name) - 1); 137 | } 138 | 139 | void outputHandleDescription(void* userData, 140 | struct wl_output* wl_output, 141 | const char* description) 142 | { 143 | } 144 | 145 | #endif // WL_OUTPUT_NAME_SINCE_VERSION 146 | 147 | static const struct wl_output_listener outputListener = 148 | { 149 | outputHandleGeometry, 150 | outputHandleMode, 151 | outputHandleDone, 152 | outputHandleScale, 153 | #ifdef WL_OUTPUT_NAME_SINCE_VERSION 154 | outputHandleName, 155 | outputHandleDescription, 156 | #endif 157 | }; 158 | 159 | 160 | ////////////////////////////////////////////////////////////////////////// 161 | ////// GLFW internal API ////// 162 | ////////////////////////////////////////////////////////////////////////// 163 | 164 | void _glfwAddOutputWayland(uint32_t name, uint32_t version) 165 | { 166 | if (version < 2) 167 | { 168 | _glfwInputError(GLFW_PLATFORM_ERROR, 169 | "Wayland: Unsupported output interface version"); 170 | return; 171 | } 172 | 173 | #ifdef WL_OUTPUT_NAME_SINCE_VERSION 174 | version = _glfw_min(version, WL_OUTPUT_NAME_SINCE_VERSION); 175 | #else 176 | version = 2; 177 | #endif 178 | 179 | struct wl_output* output = wl_registry_bind(_glfw.wl.registry, 180 | name, 181 | &wl_output_interface, 182 | version); 183 | if (!output) 184 | return; 185 | 186 | // The actual name of this output will be set in the geometry handler 187 | _GLFWmonitor* monitor = _glfwAllocMonitor("", 0, 0); 188 | monitor->wl.scale = 1; 189 | monitor->wl.output = output; 190 | monitor->wl.name = name; 191 | 192 | wl_output_add_listener(output, &outputListener, monitor); 193 | } 194 | 195 | 196 | ////////////////////////////////////////////////////////////////////////// 197 | ////// GLFW platform API ////// 198 | ////////////////////////////////////////////////////////////////////////// 199 | 200 | void _glfwFreeMonitorWayland(_GLFWmonitor* monitor) 201 | { 202 | if (monitor->wl.output) 203 | wl_output_destroy(monitor->wl.output); 204 | } 205 | 206 | void _glfwGetMonitorPosWayland(_GLFWmonitor* monitor, int* xpos, int* ypos) 207 | { 208 | if (xpos) 209 | *xpos = monitor->wl.x; 210 | if (ypos) 211 | *ypos = monitor->wl.y; 212 | } 213 | 214 | void _glfwGetMonitorContentScaleWayland(_GLFWmonitor* monitor, 215 | float* xscale, float* yscale) 216 | { 217 | if (xscale) 218 | *xscale = (float) monitor->wl.scale; 219 | if (yscale) 220 | *yscale = (float) monitor->wl.scale; 221 | } 222 | 223 | void _glfwGetMonitorWorkareaWayland(_GLFWmonitor* monitor, 224 | int* xpos, int* ypos, 225 | int* width, int* height) 226 | { 227 | if (xpos) 228 | *xpos = monitor->wl.x; 229 | if (ypos) 230 | *ypos = monitor->wl.y; 231 | if (width) 232 | *width = monitor->modes[monitor->wl.currentMode].width; 233 | if (height) 234 | *height = monitor->modes[monitor->wl.currentMode].height; 235 | } 236 | 237 | GLFWvidmode* _glfwGetVideoModesWayland(_GLFWmonitor* monitor, int* found) 238 | { 239 | *found = monitor->modeCount; 240 | return monitor->modes; 241 | } 242 | 243 | void _glfwGetVideoModeWayland(_GLFWmonitor* monitor, GLFWvidmode* mode) 244 | { 245 | *mode = monitor->modes[monitor->wl.currentMode]; 246 | } 247 | 248 | GLFWbool _glfwGetGammaRampWayland(_GLFWmonitor* monitor, GLFWgammaramp* ramp) 249 | { 250 | _glfwInputError(GLFW_FEATURE_UNAVAILABLE, 251 | "Wayland: Gamma ramp access is not available"); 252 | return GLFW_FALSE; 253 | } 254 | 255 | void _glfwSetGammaRampWayland(_GLFWmonitor* monitor, const GLFWgammaramp* ramp) 256 | { 257 | _glfwInputError(GLFW_FEATURE_UNAVAILABLE, 258 | "Wayland: Gamma ramp access is not available"); 259 | } 260 | 261 | 262 | ////////////////////////////////////////////////////////////////////////// 263 | ////// GLFW native API ////// 264 | ////////////////////////////////////////////////////////////////////////// 265 | 266 | GLFWAPI struct wl_output* glfwGetWaylandMonitor(GLFWmonitor* handle) 267 | { 268 | _GLFWmonitor* monitor = (_GLFWmonitor*) handle; 269 | _GLFW_REQUIRE_INIT_OR_RETURN(NULL); 270 | return monitor->wl.output; 271 | } 272 | 273 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/qoaplay.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************************* 2 | * 3 | * qoaplay - QOA stream playing helper functions 4 | * 5 | * qoaplay is a tiny abstraction to read and decode a QOA file "on the fly". 6 | * It reads and decodes one frame at a time with minimal memory requirements. 7 | * qoaplay also provides some functions to seek to a specific frame. 8 | * 9 | * LICENSE: MIT License 10 | * 11 | * Copyright (c) 2023 Dominic Szablewski (@phoboslab), reviewed by Ramon Santamaria (@raysan5) 12 | * 13 | * Permission is hereby granted, free of charge, to any person obtaining a copy 14 | * of this software and associated documentation files (the "Software"), to deal 15 | * in the Software without restriction, including without limitation the rights 16 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 17 | * copies of the Software, and to permit persons to whom the Software is 18 | * furnished to do so, subject to the following conditions: 19 | * 20 | * The above copyright notice and this permission notice shall be included in all 21 | * copies or substantial portions of the Software. 22 | * 23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 24 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 25 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 26 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 27 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 28 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 29 | * SOFTWARE. 30 | * 31 | **********************************************************************************************/ 32 | 33 | //---------------------------------------------------------------------------------- 34 | // Types and Structures Definition 35 | //---------------------------------------------------------------------------------- 36 | // QOA streaming data descriptor 37 | typedef struct { 38 | qoa_desc info; // QOA descriptor data 39 | 40 | FILE *file; // QOA file to read, if NULL, using memory buffer -> file_data 41 | unsigned char *file_data; // QOA file data on memory 42 | unsigned int file_data_size; // QOA file data on memory size 43 | unsigned int file_data_offset; // QOA file data on memory offset for next read 44 | 45 | unsigned int first_frame_pos; // First frame position (after QOA header, required for offset) 46 | unsigned int sample_position; // Current streaming sample position 47 | 48 | unsigned char *buffer; // Buffer used to read samples from file/memory (used on decoding) 49 | unsigned int buffer_len; // Buffer length to read samples for streaming 50 | 51 | short *sample_data; // Sample data decoded 52 | unsigned int sample_data_len; // Sample data decoded length 53 | unsigned int sample_data_pos; // Sample data decoded position 54 | 55 | } qoaplay_desc; 56 | 57 | //---------------------------------------------------------------------------------- 58 | // Module Functions Declaration 59 | //---------------------------------------------------------------------------------- 60 | 61 | #if defined(__cplusplus) 62 | extern "C" { // Prevents name mangling of functions 63 | #endif 64 | 65 | qoaplay_desc *qoaplay_open(const char *path); 66 | qoaplay_desc *qoaplay_open_memory(const unsigned char *data, int data_size); 67 | void qoaplay_close(qoaplay_desc *qoa_ctx); 68 | 69 | void qoaplay_rewind(qoaplay_desc *qoa_ctx); 70 | void qoaplay_seek_frame(qoaplay_desc *qoa_ctx, int frame); 71 | unsigned int qoaplay_decode(qoaplay_desc *qoa_ctx, float *sample_data, int num_samples); 72 | unsigned int qoaplay_decode_frame(qoaplay_desc *qoa_ctx); 73 | double qoaplay_get_duration(qoaplay_desc *qoa_ctx); 74 | double qoaplay_get_time(qoaplay_desc *qoa_ctx); 75 | int qoaplay_get_frame(qoaplay_desc *qoa_ctx); 76 | 77 | #if defined(__cplusplus) 78 | } // Prevents name mangling of functions 79 | #endif 80 | 81 | //---------------------------------------------------------------------------------- 82 | // Module Functions Definition 83 | //---------------------------------------------------------------------------------- 84 | 85 | // Open QOA file, keep FILE pointer to keep reading from file 86 | qoaplay_desc *qoaplay_open(const char *path) 87 | { 88 | FILE *file = fopen(path, "rb"); 89 | if (!file) return NULL; 90 | 91 | // Read and decode the file header 92 | unsigned char header[QOA_MIN_FILESIZE]; 93 | int read = fread(header, QOA_MIN_FILESIZE, 1, file); 94 | if (!read) return NULL; 95 | 96 | qoa_desc qoa; 97 | unsigned int first_frame_pos = qoa_decode_header(header, QOA_MIN_FILESIZE, &qoa); 98 | if (!first_frame_pos) return NULL; 99 | 100 | // Rewind the file back to beginning of the first frame 101 | fseek(file, first_frame_pos, SEEK_SET); 102 | 103 | // Allocate one chunk of memory for the qoaplay_desc struct 104 | // + the sample data for one frame 105 | // + a buffer to hold one frame of encoded data 106 | unsigned int buffer_size = qoa_max_frame_size(&qoa); 107 | unsigned int sample_data_size = qoa.channels*QOA_FRAME_LEN*sizeof(short)*2; 108 | qoaplay_desc *qoa_ctx = QOA_MALLOC(sizeof(qoaplay_desc) + buffer_size + sample_data_size); 109 | memset(qoa_ctx, 0, sizeof(qoaplay_desc)); 110 | 111 | qoa_ctx->file = file; 112 | qoa_ctx->file_data = NULL; 113 | qoa_ctx->file_data_size = 0; 114 | qoa_ctx->file_data_offset = 0; 115 | qoa_ctx->first_frame_pos = first_frame_pos; 116 | 117 | // Setup data pointers to previously allocated data 118 | qoa_ctx->buffer = ((unsigned char *)qoa_ctx) + sizeof(qoaplay_desc); 119 | qoa_ctx->sample_data = (short *)(((unsigned char *)qoa_ctx) + sizeof(qoaplay_desc) + buffer_size); 120 | 121 | qoa_ctx->info.channels = qoa.channels; 122 | qoa_ctx->info.samplerate = qoa.samplerate; 123 | qoa_ctx->info.samples = qoa.samples; 124 | 125 | return qoa_ctx; 126 | } 127 | 128 | // Open QOA file from memory, no FILE pointer required 129 | qoaplay_desc *qoaplay_open_memory(const unsigned char *data, int data_size) 130 | { 131 | // Read and decode the file header 132 | unsigned char header[QOA_MIN_FILESIZE]; 133 | memcpy(header, data, QOA_MIN_FILESIZE); 134 | 135 | qoa_desc qoa; 136 | unsigned int first_frame_pos = qoa_decode_header(header, QOA_MIN_FILESIZE, &qoa); 137 | if (!first_frame_pos) return NULL; 138 | 139 | // Allocate one chunk of memory for the qoaplay_desc struct 140 | // + the sample data for one frame 141 | // + a buffer to hold one frame of encoded data 142 | unsigned int buffer_size = qoa_max_frame_size(&qoa); 143 | unsigned int sample_data_size = qoa.channels*QOA_FRAME_LEN*sizeof(short)*2; 144 | qoaplay_desc *qoa_ctx = QOA_MALLOC(sizeof(qoaplay_desc) + buffer_size + sample_data_size); 145 | memset(qoa_ctx, 0, sizeof(qoaplay_desc)); 146 | 147 | qoa_ctx->file = NULL; 148 | 149 | // Keep a copy of file data provided to be managed internally 150 | qoa_ctx->file_data = (unsigned char *)QOA_MALLOC(data_size); 151 | memcpy(qoa_ctx->file_data, data, data_size); 152 | qoa_ctx->file_data_size = data_size; 153 | qoa_ctx->file_data_offset = 0; 154 | qoa_ctx->first_frame_pos = first_frame_pos; 155 | 156 | // Setup data pointers to previously allocated data 157 | qoa_ctx->buffer = ((unsigned char *)qoa_ctx) + sizeof(qoaplay_desc); 158 | qoa_ctx->sample_data = (short *)(((unsigned char *)qoa_ctx) + sizeof(qoaplay_desc) + buffer_size); 159 | 160 | qoa_ctx->info.channels = qoa.channels; 161 | qoa_ctx->info.samplerate = qoa.samplerate; 162 | qoa_ctx->info.samples = qoa.samples; 163 | 164 | return qoa_ctx; 165 | } 166 | 167 | // Close QOA file (if open) and free internal memory 168 | void qoaplay_close(qoaplay_desc *qoa_ctx) 169 | { 170 | if (qoa_ctx->file) fclose(qoa_ctx->file); 171 | 172 | if ((qoa_ctx->file_data) && (qoa_ctx->file_data_size > 0)) 173 | { 174 | QOA_FREE(qoa_ctx->file_data); 175 | qoa_ctx->file_data_size = 0; 176 | } 177 | 178 | QOA_FREE(qoa_ctx); 179 | } 180 | 181 | // Decode one frame from QOA data 182 | unsigned int qoaplay_decode_frame(qoaplay_desc *qoa_ctx) 183 | { 184 | if (qoa_ctx->file) qoa_ctx->buffer_len = fread(qoa_ctx->buffer, 1, qoa_max_frame_size(&qoa_ctx->info), qoa_ctx->file); 185 | else 186 | { 187 | qoa_ctx->buffer_len = qoa_max_frame_size(&qoa_ctx->info); 188 | memcpy(qoa_ctx->buffer, qoa_ctx->file_data + qoa_ctx->file_data_offset, qoa_ctx->buffer_len); 189 | qoa_ctx->file_data_offset += qoa_ctx->buffer_len; 190 | } 191 | 192 | unsigned int frame_len; 193 | qoa_decode_frame(qoa_ctx->buffer, qoa_ctx->buffer_len, &qoa_ctx->info, qoa_ctx->sample_data, &frame_len); 194 | qoa_ctx->sample_data_pos = 0; 195 | qoa_ctx->sample_data_len = frame_len; 196 | 197 | return frame_len; 198 | } 199 | 200 | // Rewind QOA file or memory pointer to beginning 201 | void qoaplay_rewind(qoaplay_desc *qoa_ctx) 202 | { 203 | if (qoa_ctx->file) fseek(qoa_ctx->file, qoa_ctx->first_frame_pos, SEEK_SET); 204 | else qoa_ctx->file_data_offset = 0; 205 | 206 | qoa_ctx->sample_position = 0; 207 | qoa_ctx->sample_data_len = 0; 208 | qoa_ctx->sample_data_pos = 0; 209 | } 210 | 211 | // Decode required QOA frames 212 | unsigned int qoaplay_decode(qoaplay_desc *qoa_ctx, float *sample_data, int num_samples) 213 | { 214 | int src_index = qoa_ctx->sample_data_pos*qoa_ctx->info.channels; 215 | int dst_index = 0; 216 | 217 | for (int i = 0; i < num_samples; i++) 218 | { 219 | // Do we have to decode more samples? 220 | if (qoa_ctx->sample_data_len - qoa_ctx->sample_data_pos == 0) 221 | { 222 | if (!qoaplay_decode_frame(qoa_ctx)) 223 | { 224 | // Loop to the beginning 225 | qoaplay_rewind(qoa_ctx); 226 | qoaplay_decode_frame(qoa_ctx); 227 | } 228 | 229 | src_index = 0; 230 | } 231 | 232 | // Normalize to -1..1 floats and write to dest 233 | for (int c = 0; c < qoa_ctx->info.channels; c++) 234 | { 235 | sample_data[dst_index++] = qoa_ctx->sample_data[src_index++]/32768.0; 236 | } 237 | 238 | qoa_ctx->sample_data_pos++; 239 | qoa_ctx->sample_position++; 240 | } 241 | 242 | return num_samples; 243 | } 244 | 245 | // Get QOA total time duration in seconds 246 | double qoaplay_get_duration(qoaplay_desc *qoa_ctx) 247 | { 248 | return (double)qoa_ctx->info.samples/(double)qoa_ctx->info.samplerate; 249 | } 250 | 251 | // Get QOA current time position in seconds 252 | double qoaplay_get_time(qoaplay_desc *qoa_ctx) 253 | { 254 | return (double)qoa_ctx->sample_position/(double)qoa_ctx->info.samplerate; 255 | } 256 | 257 | // Get QOA current audio frame 258 | int qoaplay_get_frame(qoaplay_desc *qoa_ctx) 259 | { 260 | return qoa_ctx->sample_position/QOA_FRAME_LEN; 261 | } 262 | 263 | // Seek QOA audio frame 264 | void qoaplay_seek_frame(qoaplay_desc *qoa_ctx, int frame) 265 | { 266 | if (frame < 0) frame = 0; 267 | 268 | if (frame > qoa_ctx->info.samples/QOA_FRAME_LEN) frame = qoa_ctx->info.samples/QOA_FRAME_LEN; 269 | 270 | qoa_ctx->sample_position = frame*QOA_FRAME_LEN; 271 | qoa_ctx->sample_data_len = 0; 272 | qoa_ctx->sample_data_pos = 0; 273 | 274 | unsigned int offset = qoa_ctx->first_frame_pos + frame*qoa_max_frame_size(&qoa_ctx->info); 275 | 276 | if (qoa_ctx->file) fseek(qoa_ctx->file, offset, SEEK_SET); 277 | else qoa_ctx->file_data_offset = offset; 278 | } 279 | -------------------------------------------------------------------------------- /src/external/raylib/src/external/rprand.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************************** 2 | * 3 | * rprand v1.0 - A simple and easy-to-use pseudo-random numbers generator (PRNG) 4 | * 5 | * FEATURES: 6 | * - Pseudo-random values generation, 32 bits: [0..4294967295] 7 | * - Sequence generation avoiding duplicate values 8 | * - Using standard and proven prng algorithm (Xoshiro128**) 9 | * - State initialized with a separate generator (SplitMix64) 10 | * 11 | * LIMITATIONS: 12 | * - No negative numbers, up to the user to manage them 13 | * 14 | * POSSIBLE IMPROVEMENTS: 15 | * - Support 64 bits generation 16 | * 17 | * ADDITIONAL NOTES: 18 | * This library implements two pseudo-random number generation algorithms: 19 | * 20 | * - Xoshiro128** : https://prng.di.unimi.it/xoshiro128starstar.c 21 | * - SplitMix64 : https://prng.di.unimi.it/splitmix64.c 22 | * 23 | * SplitMix64 is used to initialize the Xoshiro128** state, from a provided seed 24 | * 25 | * It's suggested to use SplitMix64 to initialize the state of the generators starting from 26 | * a 64-bit seed, as research has shown that initialization must be performed with a generator 27 | * radically different in nature from the one initialized to avoid correlation on similar seeds. 28 | * 29 | * CONFIGURATION: 30 | * #define RPRAND_IMPLEMENTATION 31 | * Generates the implementation of the library into the included file. 32 | * If not defined, the library is in header only mode and can be included in other headers 33 | * or source files without problems. But only ONE file should hold the implementation. 34 | * 35 | * DEPENDENCIES: none 36 | * 37 | * VERSIONS HISTORY: 38 | * 1.0 (01-Jun-2023) First version 39 | * 40 | * 41 | * LICENSE: zlib/libpng 42 | * 43 | * Copyright (c) 2023 Ramon Santamaria (@raysan5) 44 | * 45 | * This software is provided "as-is", without any express or implied warranty. In no event 46 | * will the authors be held liable for any damages arising from the use of this software. 47 | * 48 | * Permission is granted to anyone to use this software for any purpose, including commercial 49 | * applications, and to alter it and redistribute it freely, subject to the following restrictions: 50 | * 51 | * 1. The origin of this software must not be misrepresented; you must not claim that you 52 | * wrote the original software. If you use this software in a product, an acknowledgment 53 | * in the product documentation would be appreciated but is not required. 54 | * 55 | * 2. Altered source versions must be plainly marked as such, and must not be misrepresented 56 | * as being the original software. 57 | * 58 | * 3. This notice may not be removed or altered from any source distribution. 59 | * 60 | **********************************************************************************************/ 61 | 62 | #ifndef RPRAND_H 63 | #define RPRAND_H 64 | 65 | #define RPRAND_VERSION "1.0" 66 | 67 | // Function specifiers in case library is build/used as a shared library (Windows) 68 | // NOTE: Microsoft specifiers to tell compiler that symbols are imported/exported from a .dll 69 | #if defined(_WIN32) 70 | #if defined(BUILD_LIBTYPE_SHARED) 71 | #define RPRAND __declspec(dllexport) // We are building the library as a Win32 shared library (.dll) 72 | #elif defined(USE_LIBTYPE_SHARED) 73 | #define RPRAND __declspec(dllimport) // We are using the library as a Win32 shared library (.dll) 74 | #endif 75 | #endif 76 | 77 | // Function specifiers definition 78 | #ifndef RPRANDAPI 79 | #define RPRANDAPI // Functions defined as 'extern' by default (implicit specifiers) 80 | #endif 81 | 82 | //---------------------------------------------------------------------------------- 83 | // Defines and Macros 84 | //---------------------------------------------------------------------------------- 85 | // Allow custom memory allocators 86 | #ifndef RPRAND_CALLOC 87 | #define RPRAND_CALLOC(ptr,sz) calloc(ptr,sz) 88 | #endif 89 | #ifndef RPRAND_FREE 90 | #define RPRAND_FREE(ptr) free(ptr) 91 | #endif 92 | 93 | // Simple log system to avoid RPNG_LOG() calls if required 94 | // NOTE: Avoiding those calls, also avoids const strings memory usage 95 | #define RPRAND_SHOW_LOG_INFO 96 | #if defined(RPNG_SHOW_LOG_INFO) 97 | #define RPRAND_LOG(...) printf(__VA_ARGS__) 98 | #else 99 | #define RPRAND_LOG(...) 100 | #endif 101 | 102 | //---------------------------------------------------------------------------------- 103 | // Types and Structures Definition 104 | //---------------------------------------------------------------------------------- 105 | //... 106 | 107 | #ifdef __cplusplus 108 | extern "C" { // Prevents name mangling of functions 109 | #endif 110 | 111 | //---------------------------------------------------------------------------------- 112 | // Global Variables Definition 113 | //---------------------------------------------------------------------------------- 114 | //... 115 | 116 | //---------------------------------------------------------------------------------- 117 | // Module Functions Declaration 118 | //---------------------------------------------------------------------------------- 119 | RPRANDAPI void rprand_set_seed(unsigned long long seed); // Set rprand_state for Xoshiro128**, seed is 64bit 120 | RPRANDAPI int rprand_get_value(int min, int max); // Get random value within a range, min and max included 121 | 122 | RPRANDAPI int *rprand_load_sequence(unsigned int count, int min, int max); // Load pseudo-random numbers sequence with no duplicates 123 | RPRANDAPI void rprand_unload_sequence(int *sequence); // Unload pseudo-random numbers sequence 124 | 125 | #ifdef __cplusplus 126 | } 127 | #endif 128 | 129 | #endif // RPRAND_H 130 | 131 | /*********************************************************************************** 132 | * 133 | * RPRAND IMPLEMENTATION 134 | * 135 | ************************************************************************************/ 136 | 137 | #if defined(RPRAND_IMPLEMENTATION) 138 | 139 | #include // Required for: calloc(), free(), abs() 140 | #include // Required for data types: uint32_t, uint64_t 141 | 142 | //---------------------------------------------------------------------------------- 143 | // Types and Structures Definition 144 | //---------------------------------------------------------------------------------- 145 | // ... 146 | 147 | //---------------------------------------------------------------------------------- 148 | // Global Variables Definition 149 | //---------------------------------------------------------------------------------- 150 | static uint64_t rprand_seed = 0; // SplitMix64 actual seed 151 | static uint32_t rprand_state[4] = { 0 }; // Xoshiro128** state, nitialized by SplitMix64 152 | 153 | //---------------------------------------------------------------------------------- 154 | // Module internal functions declaration 155 | //---------------------------------------------------------------------------------- 156 | static uint32_t rprand_xoshiro(void); // Xoshiro128** generator (uses global rprand_state) 157 | static uint64_t rprand_splitmix64(void); // SplitMix64 generator (uses seed to generate rprand_state) 158 | 159 | //---------------------------------------------------------------------------------- 160 | // Module functions definition 161 | //---------------------------------------------------------------------------------- 162 | // Set rprand_state for Xoshiro128** 163 | // NOTE: We use a custom generation algorithm using SplitMix64 164 | void rprand_set_seed(unsigned long long seed) 165 | { 166 | rprand_seed = (uint64_t)seed; // Set SplitMix64 seed for further use 167 | 168 | // To generate the Xoshiro128** state, we use SplitMix64 generator first 169 | // We generate 4 pseudo-random 64bit numbers that we combine using their LSB|MSB 170 | rprand_state[0] = (uint32_t)(rprand_splitmix64() & 0xffffffff); 171 | rprand_state[1] = (uint32_t)((rprand_splitmix64() & 0xffffffff00000000) >> 32); 172 | rprand_state[2] = (uint32_t)(rprand_splitmix64() & 0xffffffff); 173 | rprand_state[3] = (uint32_t)((rprand_splitmix64() & 0xffffffff00000000) >> 32); 174 | } 175 | 176 | // Get random value within a range, min and max included 177 | int rprand_get_value(int min, int max) 178 | { 179 | int value = rprand_xoshiro()%(abs(max - min) + 1) + min; 180 | 181 | return value; 182 | } 183 | 184 | // Load pseudo-random numbers sequence with no duplicates, min and max included 185 | int *rprand_load_sequence(unsigned int count, int min, int max) 186 | { 187 | int *sequence = NULL; 188 | 189 | if (count > (unsigned int)(abs(max - min) + 1)) 190 | { 191 | RPRAND_LOG("WARNING: Sequence count required is greater than range provided\n"); 192 | //count = (max - min); 193 | return sequence; 194 | } 195 | 196 | sequence = (int *)RPRAND_CALLOC(count, sizeof(int)); 197 | 198 | int value = 0; 199 | bool value_is_dup = false; 200 | 201 | for (unsigned int i = 0; i < count;) 202 | { 203 | value = ((int)rprand_xoshiro()%(abs(max - min) + 1)) + min; 204 | value_is_dup = false; 205 | 206 | for (int j = 0; j < i; j++) 207 | { 208 | if (sequence[j] == value) 209 | { 210 | value_is_dup = true; 211 | break; 212 | } 213 | } 214 | 215 | if (!value_is_dup) 216 | { 217 | sequence[i] = value; 218 | i++; 219 | } 220 | } 221 | 222 | return sequence; 223 | } 224 | 225 | // Unload pseudo-random numbers sequence 226 | void rprand_unload_sequence(int *sequence) 227 | { 228 | RPRAND_FREE(sequence); 229 | sequence = NULL; 230 | } 231 | 232 | //---------------------------------------------------------------------------------- 233 | // Module internal functions definition 234 | //---------------------------------------------------------------------------------- 235 | static inline uint32_t rprand_rotate_left(const uint32_t x, int k) 236 | { 237 | return (x << k) | (x >> (32 - k)); 238 | } 239 | 240 | // Xoshiro128** generator info: 241 | // 242 | // Written in 2018 by David Blackman and Sebastiano Vigna (vigna@acm.org) 243 | // 244 | // To the extent possible under law, the author has dedicated all copyright 245 | // and related and neighboring rights to this software to the public domain 246 | // worldwide. This software is distributed without any warranty. 247 | // 248 | // See . 249 | // 250 | // This is xoshiro128** 1.1, one of our 32-bit all-purpose, rock-solid 251 | // generators. It has excellent speed, a state size (128 bits) that is 252 | // large enough for mild parallelism, and it passes all tests we are aware 253 | // of. 254 | // 255 | // Note that version 1.0 had mistakenly s[0] instead of s[1] as state 256 | // word passed to the scrambler. 257 | // 258 | // For generating just single-precision (i.e., 32-bit) floating-point 259 | // numbers, xoshiro128+ is even faster. 260 | // 261 | // The state must be seeded so that it is not everywhere zero. 262 | // 263 | uint32_t rprand_xoshiro(void) 264 | { 265 | const uint32_t result = rprand_rotate_left(rprand_state[1]*5, 7)*9; 266 | const uint32_t t = rprand_state[1] << 9; 267 | 268 | rprand_state[2] ^= rprand_state[0]; 269 | rprand_state[3] ^= rprand_state[1]; 270 | rprand_state[1] ^= rprand_state[2]; 271 | rprand_state[0] ^= rprand_state[3]; 272 | 273 | rprand_state[2] ^= t; 274 | 275 | rprand_state[3] = rprand_rotate_left(rprand_state[3], 11); 276 | 277 | return result; 278 | } 279 | 280 | // SplitMix64 generator info: 281 | // 282 | // Written in 2015 by Sebastiano Vigna (vigna@acm.org) 283 | // 284 | // To the extent possible under law, the author has dedicated all copyright 285 | // and related and neighboring rights to this software to the public domain 286 | // worldwide. This software is distributed without any warranty. 287 | // 288 | // See . 289 | // 290 | // 291 | // This is a fixed-increment version of Java 8's SplittableRandom generator 292 | // See http://dx.doi.org/10.1145/2714064.2660195 and 293 | // http://docs.oracle.com/javase/8/docs/api/java/util/SplittableRandom.html 294 | // 295 | // It is a very fast generator passing BigCrush, and it can be useful if 296 | // for some reason you absolutely want 64 bits of state. 297 | uint64_t rprand_splitmix64() 298 | { 299 | uint64_t z = (rprand_seed += 0x9e3779b97f4a7c15); 300 | z = (z ^ (z >> 30))*0xbf58476d1ce4e5b9; 301 | z = (z ^ (z >> 27))*0x94d049bb133111eb; 302 | return z ^ (z >> 31); 303 | } 304 | 305 | #endif // RPRAND_IMPLEMENTATION --------------------------------------------------------------------------------