diff --git a/CMakeLists.txt b/CMakeLists.txt
index 36d5dcb..3697575 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8.12)
+cmake_minimum_required(VERSION 3.31)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
project(cis565_project5_vulkan_grass_rendering)
@@ -63,4 +63,4 @@ ENDIF(WIN32)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin/")
add_subdirectory(external)
-add_subdirectory(src)
+add_subdirectory(src)
\ No newline at end of file
diff --git a/README.md b/README.md
index 20ee451..673a36c 100644
--- a/README.md
+++ b/README.md
@@ -3,10 +3,80 @@ Vulkan Grass Rendering
**University of Pennsylvania, CIS 565: GPU Programming and Architecture, Project 5**
-* (TODO) YOUR NAME HERE
-* Tested on: (TODO) Windows 22, i7-2222 @ 2.22GHz 22GB, GTX 222 222MB (Moore 2222 Lab)
+* Caroline Fernandes
+ * [LinkedIn](https://www.linkedin.com/in/caroline-fernandes-0-/), [personal website](https://0cfernandes00.wixsite.com/visualfx)
+* Tested on: Windows 11, i9-14900HX @ 2.20GHz, Nvidia GeForce RTX 4070
-### (TODO: Your README)
+### Overview
-*DO NOT* leave the README to the last minute! It is a crucial part of the
-project, and we will not be able to grade you without a good README.
+The goal of this project was to get comfortable with Vulkan and implement [Responsive Real-Time Grass Rendering for General 3D Scenes](https://www.cg.tuwien.ac.at/research/publications/2017/JAHRMANN-2017-RRTG/JAHRMANN-2017-RRTG-draft.pdf). I am responsible for implementing the grass vertex, grass tessellation control/evaluate, grass fragment, and compute shaders.
+
+In order to build the project, I made updates to CMakeLists.txt and updated the glfw folder to pull in the most recent from this repository https://github.com/glfw/glfw
+
+
+
+## Grass Rendering
+Each blade was represented by a bezier curve and three control points. De Castelajau's algorithm was used to construct the curve, and generate the triangle representation.
+
+
+
+
+
+**Note:** Values have been adjusted for the remaining videos to show off the effect
+
+## Simulating Forces
+These forces were summed and applied in the compute shader of the pipeline.
+
+### Gravity
+Gravity is implemented as the summation of environmental and "front" facing gravity (which is applied to the front viewing vector of the blade).
+
+
+
+
+
+### Recovery
+
+Recovery acts as a targeting force to bring the blade back to its starting position. The paper includes collisions, but my implementation was just influenced by the v2's current position, starting position, and a stiffness coefficient.
+
+
+
+
+### Wind
+
+I simulated wind to be the combination of a wind direction and wind alignment. Blades with a forward vector aligned with the wind direction received more of an impact from the wind. Sin and Cosine waves that change over time were used to produce the waves.
+
+
+
+
+
+## Culling
+
+### Orientation Culling
+Culls the blades with a front vector pointing away from the camera's look vector, because the width will become zero and rendering these pixels will produce rendering artifacts.
+
+
+
+### View Frustum Culling
+Culls the blades that fall outside of the viewing frustum as they will not be visible.
+
+
+
+### Distance Culling
+Culls the blades that are outside a defined range from the camera.
+
+
+
+## Performance Analysis
+I tested using values suggested by the paper, however, the performance results did not match my expectations. Further turning of the parameters could reveal more obvious trends.
+
+Culling Impact
+
+
+
+I tested different scene sizes with all three culling effects applied and compared that without those optimizations. This result was perhaps the most confusing, I had assumed the benefits of culling would outweigh the costs. In smaller scenes especially the opposite was true. In larger scenes the two results were comparable.
+
+Culling Technique Breakdown
+
+
+
+Culling by blade orientation seemed to have the largest impact with smaller scenes, whereas with larger scenes the viewing frustum optimization seemed to be the most impactful.
diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt
index de305bb..0d391ce 100644
--- a/external/CMakeLists.txt
+++ b/external/CMakeLists.txt
@@ -1,4 +1,3 @@
-
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "Build the GLFW example programs")
set(GLFW_BUILD_TESTS OFF CACHE BOOL "Build the GLFW test programs")
set(GLFW_BUILD_DOCS OFF CACHE BOOL "Build the GLFW documentation")
diff --git a/external/GLFW/.editorconfig b/external/GLFW/.editorconfig
new file mode 100644
index 0000000..bbdd901
--- /dev/null
+++ b/external/GLFW/.editorconfig
@@ -0,0 +1,61 @@
+# EditorConfig for GLFW and its internal dependencies
+#
+# All files created by GLFW should indent with four spaces unless their format requires
+# otherwise. A few files still use other indent styles for historical reasons.
+#
+# Dependencies have (what seemed to be) their existing styles described. Those with
+# existing trailing whitespace have it preserved to avoid cluttering future commits.
+
+root = true
+
+[*]
+charset = utf-8
+end_of_line = lf
+
+[include/GLFW/*.h]
+indent_style = space
+indent_size = 4
+
+[{src,examples,tests}/*.{c,m,h,rc,in}]
+indent_style = space
+indent_size = 4
+
+[CMakeLists.txt]
+indent_style = space
+indent_size = 4
+
+[CMake/**.{cmake,in}]
+indent_style = space
+indent_size = 4
+
+[*.{md}]
+indent_style = space
+indent_size = 4
+trim_trailing_whitespace = false
+
+[DoxygenLayout.xml]
+indent_style = space
+indent_size = 2
+
+[docs/*.{scss,html}]
+indent_style = tab
+indent_size = unset
+
+[deps/getopt.{c,h}]
+indent_style = space
+indent_size = 2
+
+[deps/linmath.h]
+indent_style = tab
+tab_width = 4
+indent_size = 4
+trim_trailing_whitespace = false
+
+[deps/nuklear*.h]
+indent_style = space
+indent_size = 4
+
+[deps/tinycthread.{c,h}]
+indent_style = space
+indent_size = 2
+
diff --git a/external/GLFW/.github/CODEOWNERS b/external/GLFW/.github/CODEOWNERS
new file mode 100644
index 0000000..585b209
--- /dev/null
+++ b/external/GLFW/.github/CODEOWNERS
@@ -0,0 +1,8 @@
+
+* @elmindreda
+
+docs/*.css @glfw/webdev
+docs/*.scss @glfw/webdev
+docs/*.html @glfw/webdev
+docs/*.xml @glfw/webdev
+
diff --git a/external/GLFW/.github/workflows/build.yml b/external/GLFW/.github/workflows/build.yml
new file mode 100644
index 0000000..8ef9ed7
--- /dev/null
+++ b/external/GLFW/.github/workflows/build.yml
@@ -0,0 +1,100 @@
+name: Build
+on:
+ pull_request:
+ push:
+ branches: [ ci, master, latest, 3.3-stable ]
+ workflow_dispatch:
+permissions:
+ statuses: write
+ contents: read
+
+jobs:
+ build-linux-clang:
+ name: Linux (Clang)
+ runs-on: ubuntu-latest
+ timeout-minutes: 4
+ env:
+ CC: clang
+ CFLAGS: -Werror
+ steps:
+ - uses: actions/checkout@v4
+ - name: Install dependencies
+ run: |
+ sudo apt update
+ sudo apt install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev libwayland-dev libxkbcommon-dev
+
+ - name: Configure Null shared library
+ run: cmake -B build-null-shared -D GLFW_BUILD_WAYLAND=OFF -D GLFW_BUILD_X11=OFF -D BUILD_SHARED_LIBS=ON
+ - name: Build Null shared library
+ run: cmake --build build-null-shared --parallel
+
+ - name: Configure X11 shared library
+ run: cmake -B build-x11-shared -D GLFW_BUILD_WAYLAND=OFF -D GLFW_BUILD_X11=ON -D BUILD_SHARED_LIBS=ON
+ - name: Build X11 shared library
+ run: cmake --build build-x11-shared --parallel
+
+ - name: Configure Wayland shared library
+ run: cmake -B build-wayland-shared -D GLFW_BUILD_WAYLAND=ON -D GLFW_BUILD_X11=OFF -D BUILD_SHARED_LIBS=ON
+ - name: Build Wayland shared library
+ run: cmake --build build-wayland-shared --parallel
+
+ - name: Configure Wayland+X11 static library
+ run: cmake -B build-full-static -D GLFW_BUILD_WAYLAND=ON -D GLFW_BUILD_X11=ON
+ - name: Build Wayland+X11 static library
+ run: cmake --build build-full-static --parallel
+
+ - name: Configure Wayland+X11 shared library
+ run: cmake -B build-full-shared -D GLFW_BUILD_WAYLAND=ON -D BUILD_SHARED_LIBS=ON -D GLFW_BUILD_X11=ON
+ - name: Build Wayland+X11 shared library
+ run: cmake --build build-full-shared --parallel
+
+ build-macos-clang:
+ name: macOS (Clang)
+ runs-on: macos-latest
+ timeout-minutes: 4
+ env:
+ CFLAGS: -Werror
+ MACOSX_DEPLOYMENT_TARGET: 10.11
+ CMAKE_OSX_ARCHITECTURES: x86_64;arm64
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Configure Null shared library
+ run: cmake -B build-null-shared -D GLFW_BUILD_COCOA=OFF -D BUILD_SHARED_LIBS=ON
+ - name: Build Null shared library
+ run: cmake --build build-null-shared --parallel
+
+ - name: Configure Cocoa static library
+ run: cmake -B build-cocoa-static
+ - name: Build Cocoa static library
+ run: cmake --build build-cocoa-static --parallel
+
+ - name: Configure Cocoa shared library
+ run: cmake -B build-cocoa-shared -D BUILD_SHARED_LIBS=ON
+ - name: Build Cocoa shared library
+ run: cmake --build build-cocoa-shared --parallel
+
+ build-windows-vs2022:
+ name: Windows (VS2022)
+ runs-on: windows-latest
+ timeout-minutes: 4
+ env:
+ CFLAGS: /WX
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Configure Win32 shared x86 library
+ run: cmake -B build-win32-shared-x86 -G "Visual Studio 17 2022" -A Win32 -D BUILD_SHARED_LIBS=ON
+ - name: Build Win32 shared x86 library
+ run: cmake --build build-win32-shared-x86 --parallel
+
+ - name: Configure Win32 static x64 library
+ run: cmake -B build-win32-static-x64 -G "Visual Studio 17 2022" -A x64
+ - name: Build Win32 static x64 library
+ run: cmake --build build-win32-static-x64 --parallel
+
+ - name: Configure Win32 shared x64 library
+ run: cmake -B build-win32-shared-x64 -G "Visual Studio 17 2022" -A x64 -D BUILD_SHARED_LIBS=ON
+ - name: Build Win32 shared x64 library
+ run: cmake --build build-win32-shared-x64 --parallel
+
diff --git a/external/GLFW/.mailmap b/external/GLFW/.mailmap
new file mode 100644
index 0000000..96d8a9b
--- /dev/null
+++ b/external/GLFW/.mailmap
@@ -0,0 +1,10 @@
+Camilla Löwy
+Camilla Löwy
+Camilla Löwy
+
+Emmanuel Gil Peyrot
+
+Marcus Geelnard
+Marcus Geelnard
+Marcus Geelnard
+
diff --git a/external/GLFW/CMake/GenerateMappings.cmake b/external/GLFW/CMake/GenerateMappings.cmake
index 9fb304e..9a95df6 100644
--- a/external/GLFW/CMake/GenerateMappings.cmake
+++ b/external/GLFW/CMake/GenerateMappings.cmake
@@ -1,6 +1,8 @@
# Usage:
# cmake -P GenerateMappings.cmake
+cmake_policy(VERSION 3.16)
+
set(source_url "https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt")
set(source_path "${CMAKE_CURRENT_BINARY_DIR}/gamecontrollerdb.txt")
set(template_path "${CMAKE_ARGV3}")
@@ -22,9 +24,24 @@ if (status_code)
endif()
file(STRINGS "${source_path}" lines)
-foreach(line ${lines})
- if ("${line}" MATCHES "^[0-9a-fA-F].*$")
- set(GLFW_GAMEPAD_MAPPINGS "${GLFW_GAMEPAD_MAPPINGS}\"${line}\\n\"\n")
+list(FILTER lines INCLUDE REGEX "^[0-9a-fA-F]")
+
+foreach(line IN LISTS lines)
+ if (line MATCHES "platform:Windows")
+ if (GLFW_WIN32_MAPPINGS)
+ string(APPEND GLFW_WIN32_MAPPINGS "\n")
+ endif()
+ string(APPEND GLFW_WIN32_MAPPINGS "\"${line}\",")
+ elseif (line MATCHES "platform:Mac OS X")
+ if (GLFW_COCOA_MAPPINGS)
+ string(APPEND GLFW_COCOA_MAPPINGS "\n")
+ endif()
+ string(APPEND GLFW_COCOA_MAPPINGS "\"${line}\",")
+ elseif (line MATCHES "platform:Linux")
+ if (GLFW_LINUX_MAPPINGS)
+ string(APPEND GLFW_LINUX_MAPPINGS "\n")
+ endif()
+ string(APPEND GLFW_LINUX_MAPPINGS "\"${line}\",")
endif()
endforeach()
diff --git a/external/GLFW/CMake/Info.plist.in b/external/GLFW/CMake/Info.plist.in
new file mode 100644
index 0000000..684ad79
--- /dev/null
+++ b/external/GLFW/CMake/Info.plist.in
@@ -0,0 +1,38 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ English
+ CFBundleExecutable
+ ${MACOSX_BUNDLE_EXECUTABLE_NAME}
+ CFBundleGetInfoString
+ ${MACOSX_BUNDLE_INFO_STRING}
+ CFBundleIconFile
+ ${MACOSX_BUNDLE_ICON_FILE}
+ CFBundleIdentifier
+ ${MACOSX_BUNDLE_GUI_IDENTIFIER}
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleLongVersionString
+ ${MACOSX_BUNDLE_LONG_VERSION_STRING}
+ CFBundleName
+ ${MACOSX_BUNDLE_BUNDLE_NAME}
+ CFBundlePackageType
+ APPL
+ CFBundleShortVersionString
+ ${MACOSX_BUNDLE_SHORT_VERSION_STRING}
+ CFBundleSignature
+ ????
+ CFBundleVersion
+ ${MACOSX_BUNDLE_BUNDLE_VERSION}
+ CSResourcesFileMapped
+
+ LSRequiresCarbon
+
+ NSHumanReadableCopyright
+ ${MACOSX_BUNDLE_COPYRIGHT}
+ NSHighResolutionCapable
+
+
+
diff --git a/external/GLFW/CMake/cmake_uninstall.cmake.in b/external/GLFW/CMake/cmake_uninstall.cmake.in
new file mode 100644
index 0000000..5ecc476
--- /dev/null
+++ b/external/GLFW/CMake/cmake_uninstall.cmake.in
@@ -0,0 +1,29 @@
+
+if (NOT EXISTS "@GLFW_BINARY_DIR@/install_manifest.txt")
+ message(FATAL_ERROR "Cannot find install manifest: \"@GLFW_BINARY_DIR@/install_manifest.txt\"")
+endif()
+
+file(READ "@GLFW_BINARY_DIR@/install_manifest.txt" files)
+string(REGEX REPLACE "\n" ";" files "${files}")
+
+foreach (file ${files})
+ message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
+ if (EXISTS "$ENV{DESTDIR}${file}")
+ exec_program("@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
+ OUTPUT_VARIABLE rm_out
+ RETURN_VALUE rm_retval)
+ if (NOT "${rm_retval}" STREQUAL 0)
+ MESSAGE(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
+ endif()
+ elseif (IS_SYMLINK "$ENV{DESTDIR}${file}")
+ EXEC_PROGRAM("@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
+ OUTPUT_VARIABLE rm_out
+ RETURN_VALUE rm_retval)
+ if (NOT "${rm_retval}" STREQUAL 0)
+ message(FATAL_ERROR "Problem when removing symlink \"$ENV{DESTDIR}${file}\"")
+ endif()
+ else()
+ message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
+ endif()
+endforeach()
+
diff --git a/external/GLFW/CMake/glfw3.pc.in b/external/GLFW/CMake/glfw3.pc.in
new file mode 100644
index 0000000..36ee218
--- /dev/null
+++ b/external/GLFW/CMake/glfw3.pc.in
@@ -0,0 +1,13 @@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=${prefix}
+includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
+libdir=@CMAKE_INSTALL_FULL_LIBDIR@
+
+Name: GLFW
+Description: A multi-platform library for OpenGL, window and input
+Version: @GLFW_VERSION@
+URL: https://www.glfw.org/
+Requires.private: @GLFW_PKG_CONFIG_REQUIRES_PRIVATE@
+Libs: -L${libdir} -l@GLFW_LIB_NAME@@GLFW_LIB_NAME_SUFFIX@
+Libs.private: @GLFW_PKG_CONFIG_LIBS_PRIVATE@
+Cflags: -I${includedir}
diff --git a/external/GLFW/CMake/glfw3Config.cmake.in b/external/GLFW/CMake/glfw3Config.cmake.in
new file mode 100644
index 0000000..4a13a88
--- /dev/null
+++ b/external/GLFW/CMake/glfw3Config.cmake.in
@@ -0,0 +1,3 @@
+include(CMakeFindDependencyMacro)
+find_dependency(Threads)
+include("${CMAKE_CURRENT_LIST_DIR}/glfw3Targets.cmake")
diff --git a/external/GLFW/CMake/i686-w64-mingw32-clang.cmake b/external/GLFW/CMake/i686-w64-mingw32-clang.cmake
new file mode 100644
index 0000000..8726b23
--- /dev/null
+++ b/external/GLFW/CMake/i686-w64-mingw32-clang.cmake
@@ -0,0 +1,13 @@
+# Define the environment for cross-compiling with 32-bit MinGW-w64 Clang
+SET(CMAKE_SYSTEM_NAME Windows) # Target system name
+SET(CMAKE_SYSTEM_VERSION 1)
+SET(CMAKE_C_COMPILER "i686-w64-mingw32-clang")
+SET(CMAKE_CXX_COMPILER "i686-w64-mingw32-clang++")
+SET(CMAKE_RC_COMPILER "i686-w64-mingw32-windres")
+SET(CMAKE_RANLIB "i686-w64-mingw32-ranlib")
+
+# Configure the behaviour of the find commands
+SET(CMAKE_FIND_ROOT_PATH "/usr/i686-w64-mingw32")
+SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
diff --git a/external/GLFW/CMake/i686-w64-mingw32.cmake b/external/GLFW/CMake/i686-w64-mingw32.cmake
index 9bd6093..2ca4dcd 100644
--- a/external/GLFW/CMake/i686-w64-mingw32.cmake
+++ b/external/GLFW/CMake/i686-w64-mingw32.cmake
@@ -1,4 +1,4 @@
-# Define the environment for cross compiling from Linux to Win32
+# Define the environment for cross-compiling with 32-bit MinGW-w64 GCC
SET(CMAKE_SYSTEM_NAME Windows) # Target system name
SET(CMAKE_SYSTEM_VERSION 1)
SET(CMAKE_C_COMPILER "i686-w64-mingw32-gcc")
@@ -6,7 +6,7 @@ SET(CMAKE_CXX_COMPILER "i686-w64-mingw32-g++")
SET(CMAKE_RC_COMPILER "i686-w64-mingw32-windres")
SET(CMAKE_RANLIB "i686-w64-mingw32-ranlib")
-# Configure the behaviour of the find commands
+# Configure the behaviour of the find commands
SET(CMAKE_FIND_ROOT_PATH "/usr/i686-w64-mingw32")
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
diff --git a/external/GLFW/CMake/modules/FindEpollShim.cmake b/external/GLFW/CMake/modules/FindEpollShim.cmake
new file mode 100644
index 0000000..f34d070
--- /dev/null
+++ b/external/GLFW/CMake/modules/FindEpollShim.cmake
@@ -0,0 +1,17 @@
+# Find EpollShim
+# Once done, this will define
+#
+# EPOLLSHIM_FOUND - System has EpollShim
+# EPOLLSHIM_INCLUDE_DIRS - The EpollShim include directories
+# EPOLLSHIM_LIBRARIES - The libraries needed to use EpollShim
+
+find_path(EPOLLSHIM_INCLUDE_DIRS NAMES sys/epoll.h sys/timerfd.h HINTS /usr/local/include/libepoll-shim)
+find_library(EPOLLSHIM_LIBRARIES NAMES epoll-shim libepoll-shim HINTS /usr/local/lib)
+
+if (EPOLLSHIM_INCLUDE_DIRS AND EPOLLSHIM_LIBRARIES)
+ set(EPOLLSHIM_FOUND TRUE)
+endif (EPOLLSHIM_INCLUDE_DIRS AND EPOLLSHIM_LIBRARIES)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(EpollShim DEFAULT_MSG EPOLLSHIM_LIBRARIES EPOLLSHIM_INCLUDE_DIRS)
+mark_as_advanced(EPOLLSHIM_INCLUDE_DIRS EPOLLSHIM_LIBRARIES)
diff --git a/external/GLFW/CMake/x86_64-w64-mingw32-clang.cmake b/external/GLFW/CMake/x86_64-w64-mingw32-clang.cmake
new file mode 100644
index 0000000..60f7914
--- /dev/null
+++ b/external/GLFW/CMake/x86_64-w64-mingw32-clang.cmake
@@ -0,0 +1,13 @@
+# Define the environment for cross-compiling with 64-bit MinGW-w64 Clang
+SET(CMAKE_SYSTEM_NAME Windows) # Target system name
+SET(CMAKE_SYSTEM_VERSION 1)
+SET(CMAKE_C_COMPILER "x86_64-w64-mingw32-clang")
+SET(CMAKE_CXX_COMPILER "x86_64-w64-mingw32-clang++")
+SET(CMAKE_RC_COMPILER "x86_64-w64-mingw32-windres")
+SET(CMAKE_RANLIB "x86_64-w64-mingw32-ranlib")
+
+# Configure the behaviour of the find commands
+SET(CMAKE_FIND_ROOT_PATH "/usr/x86_64-w64-mingw32")
+SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
diff --git a/external/GLFW/CMake/x86_64-w64-mingw32.cmake b/external/GLFW/CMake/x86_64-w64-mingw32.cmake
index 84b2c70..063e845 100644
--- a/external/GLFW/CMake/x86_64-w64-mingw32.cmake
+++ b/external/GLFW/CMake/x86_64-w64-mingw32.cmake
@@ -1,4 +1,4 @@
-# Define the environment for cross compiling from Linux to Win32
+# Define the environment for cross-compiling with 64-bit MinGW-w64 GCC
SET(CMAKE_SYSTEM_NAME Windows) # Target system name
SET(CMAKE_SYSTEM_VERSION 1)
SET(CMAKE_C_COMPILER "x86_64-w64-mingw32-gcc")
@@ -6,7 +6,7 @@ SET(CMAKE_CXX_COMPILER "x86_64-w64-mingw32-g++")
SET(CMAKE_RC_COMPILER "x86_64-w64-mingw32-windres")
SET(CMAKE_RANLIB "x86_64-w64-mingw32-ranlib")
-# Configure the behaviour of the find commands
+# Configure the behaviour of the find commands
SET(CMAKE_FIND_ROOT_PATH "/usr/x86_64-w64-mingw32")
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
diff --git a/external/GLFW/CMakeLists.txt b/external/GLFW/CMakeLists.txt
index 56c1f38..398b36e 100644
--- a/external/GLFW/CMakeLists.txt
+++ b/external/GLFW/CMakeLists.txt
@@ -1,365 +1,96 @@
-cmake_minimum_required(VERSION 2.8.12)
+cmake_minimum_required(VERSION 3.16...3.28 FATAL_ERROR)
-project(GLFW C)
-
-set(CMAKE_LEGACY_CYGWIN_WIN32 OFF)
-
-if (NOT CMAKE_VERSION VERSION_LESS "3.0")
- # Until all major package systems have moved to CMake 3,
- # we stick with the older INSTALL_NAME_DIR mechanism
- cmake_policy(SET CMP0042 OLD)
-endif()
-
-if (NOT CMAKE_VERSION VERSION_LESS "3.1")
- cmake_policy(SET CMP0054 NEW)
-endif()
-
-set(GLFW_VERSION_MAJOR "3")
-set(GLFW_VERSION_MINOR "3")
-set(GLFW_VERSION_PATCH "0")
-set(GLFW_VERSION_EXTRA "")
-set(GLFW_VERSION "${GLFW_VERSION_MAJOR}.${GLFW_VERSION_MINOR}")
-set(GLFW_VERSION_FULL "${GLFW_VERSION}.${GLFW_VERSION_PATCH}${GLFW_VERSION_EXTRA}")
-set(LIB_SUFFIX "" CACHE STRING "Takes an empty string or 64. Directory where lib will be installed: lib or lib64")
+project(GLFW VERSION 3.5.0 LANGUAGES C HOMEPAGE_URL "https://www.glfw.org/")
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+string(COMPARE EQUAL "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_SOURCE_DIR}" GLFW_STANDALONE)
+
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
-option(GLFW_BUILD_EXAMPLES "Build the GLFW example programs" ON)
-option(GLFW_BUILD_TESTS "Build the GLFW test programs" ON)
+option(GLFW_BUILD_EXAMPLES "Build the GLFW example programs" ${GLFW_STANDALONE})
+option(GLFW_BUILD_TESTS "Build the GLFW test programs" ${GLFW_STANDALONE})
option(GLFW_BUILD_DOCS "Build the GLFW documentation" ON)
option(GLFW_INSTALL "Generate installation target" ON)
-option(GLFW_VULKAN_STATIC "Use the Vulkan loader statically linked into application" OFF)
-option(GLFW_DOCUMENT_INTERNALS "Include internals in documentation" OFF)
-
-if (UNIX)
- option(GLFW_USE_OSMESA "Use OSMesa for offscreen context creation" OFF)
-endif()
-
-if (WIN32)
- option(GLFW_USE_HYBRID_HPG "Force use of high-performance GPU on hybrid systems" OFF)
-endif()
-
-if (UNIX AND NOT APPLE)
- option(GLFW_USE_WAYLAND "Use Wayland for window creation" OFF)
- option(GLFW_USE_MIR "Use Mir for window creation" OFF)
-endif()
-if (MSVC)
- option(USE_MSVC_RUNTIME_LIBRARY_DLL "Use MSVC runtime library DLL" ON)
-endif()
-
-if (BUILD_SHARED_LIBS)
- set(_GLFW_BUILD_DLL 1)
-endif()
+include(GNUInstallDirs)
+include(CMakeDependentOption)
-if (BUILD_SHARED_LIBS AND UNIX)
- # On Unix-like systems, shared libraries can use the soname system.
- set(GLFW_LIB_NAME glfw)
-else()
- set(GLFW_LIB_NAME glfw3)
+if (GLFW_USE_OSMESA)
+ message(FATAL_ERROR "GLFW_USE_OSMESA has been removed; set the GLFW_PLATFORM init hint")
endif()
-if (GLFW_VULKAN_STATIC)
- set(_GLFW_VULKAN_STATIC 1)
+if (DEFINED GLFW_USE_WAYLAND AND UNIX AND NOT APPLE)
+ message(FATAL_ERROR
+ "GLFW_USE_WAYLAND has been removed; delete the CMake cache and set GLFW_BUILD_WAYLAND and GLFW_BUILD_X11 instead")
endif()
-list(APPEND CMAKE_MODULE_PATH "${GLFW_SOURCE_DIR}/CMake/modules")
-
-find_package(Threads REQUIRED)
-find_package(Vulkan)
+cmake_dependent_option(GLFW_BUILD_WIN32 "Build support for Win32" ON "WIN32" OFF)
+cmake_dependent_option(GLFW_BUILD_COCOA "Build support for Cocoa" ON "APPLE" OFF)
+cmake_dependent_option(GLFW_BUILD_X11 "Build support for X11" ON "UNIX;NOT APPLE" OFF)
+cmake_dependent_option(GLFW_BUILD_WAYLAND "Build support for Wayland" ON "UNIX;NOT APPLE" OFF)
-if (GLFW_BUILD_DOCS)
- set(DOXYGEN_SKIP_DOT TRUE)
- find_package(Doxygen)
-endif()
-
-#--------------------------------------------------------------------
-# Set compiler specific flags
-#--------------------------------------------------------------------
-if (MSVC)
- if (MSVC90)
- # Workaround for VS 2008 not shipping with the DirectX 9 SDK
- include(CheckIncludeFile)
- check_include_file(dinput.h DINPUT_H_FOUND)
- if (NOT DINPUT_H_FOUND)
- message(FATAL_ERROR "DirectX 9 SDK not found")
- endif()
- # Workaround for VS 2008 not shipping with stdint.h
- list(APPEND glfw_INCLUDE_DIRS "${GLFW_SOURCE_DIR}/deps/vs2008")
- endif()
+cmake_dependent_option(GLFW_USE_HYBRID_HPG "Force use of high-performance GPU on hybrid systems" OFF
+ "WIN32" OFF)
+cmake_dependent_option(USE_MSVC_RUNTIME_LIBRARY_DLL "Use MSVC runtime library DLL" ON
+ "MSVC" OFF)
- if (NOT USE_MSVC_RUNTIME_LIBRARY_DLL)
- foreach (flag CMAKE_C_FLAGS
- CMAKE_C_FLAGS_DEBUG
- CMAKE_C_FLAGS_RELEASE
- CMAKE_C_FLAGS_MINSIZEREL
- CMAKE_C_FLAGS_RELWITHDEBINFO)
+set(GLFW_LIBRARY_TYPE "${GLFW_LIBRARY_TYPE}" CACHE STRING
+ "Library type override for GLFW (SHARED, STATIC, OBJECT, or empty to follow BUILD_SHARED_LIBS)")
- if (${flag} MATCHES "/MD")
- string(REGEX REPLACE "/MD" "/MT" ${flag} "${${flag}}")
- endif()
- if (${flag} MATCHES "/MDd")
- string(REGEX REPLACE "/MDd" "/MTd" ${flag} "${${flag}}")
- endif()
-
- endforeach()
- endif()
-endif()
-
-if (MINGW)
- # Workaround for legacy MinGW not providing XInput and DirectInput
- include(CheckIncludeFile)
-
- check_include_file(dinput.h DINPUT_H_FOUND)
- check_include_file(xinput.h XINPUT_H_FOUND)
- if (NOT DINPUT_H_FOUND OR NOT XINPUT_H_FOUND)
- list(APPEND glfw_INCLUDE_DIRS "${GLFW_SOURCE_DIR}/deps/mingw")
- endif()
-
- # Enable link-time exploit mitigation features enabled by default on MSVC
- include(CheckCCompilerFlag)
-
- # Compatibility with data execution prevention (DEP)
- set(CMAKE_REQUIRED_FLAGS "-Wl,--nxcompat")
- check_c_compiler_flag("" _GLFW_HAS_DEP)
- if (_GLFW_HAS_DEP)
- set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--nxcompat ${CMAKE_SHARED_LINKER_FLAGS}")
- endif()
-
- # Compatibility with address space layout randomization (ASLR)
- set(CMAKE_REQUIRED_FLAGS "-Wl,--dynamicbase")
- check_c_compiler_flag("" _GLFW_HAS_ASLR)
- if (_GLFW_HAS_ASLR)
- set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--dynamicbase ${CMAKE_SHARED_LINKER_FLAGS}")
- endif()
-
- # Compatibility with 64-bit address space layout randomization (ASLR)
- set(CMAKE_REQUIRED_FLAGS "-Wl,--high-entropy-va")
- check_c_compiler_flag("" _GLFW_HAS_64ASLR)
- if (_GLFW_HAS_64ASLR)
- set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--high-entropy-va ${CMAKE_SHARED_LINKER_FLAGS}")
- endif()
-endif()
-
-if (APPLE)
- # Dependencies required by the MoltenVK static library
- set(GLFW_VULKAN_DEPS
- "-lc++"
- "-framework Cocoa"
- "-framework Metal"
- "-framework QuartzCore")
-endif()
-
-#--------------------------------------------------------------------
-# Detect and select backend APIs
-#--------------------------------------------------------------------
-if (GLFW_USE_WAYLAND)
- set(_GLFW_WAYLAND 1)
- message(STATUS "Using Wayland for window creation")
-elseif (GLFW_USE_MIR)
- set(_GLFW_MIR 1)
- message(STATUS "Using Mir for window creation")
-elseif (GLFW_USE_OSMESA)
- set(_GLFW_OSMESA 1)
- message(STATUS "Using OSMesa for headless context creation")
-elseif (WIN32)
- set(_GLFW_WIN32 1)
- message(STATUS "Using Win32 for window creation")
-elseif (APPLE)
- set(_GLFW_COCOA 1)
- message(STATUS "Using Cocoa for window creation")
-elseif (UNIX)
- set(_GLFW_X11 1)
- message(STATUS "Using X11 for window creation")
-else()
- message(FATAL_ERROR "No supported platform was detected")
-endif()
-
-#--------------------------------------------------------------------
-# Add Vulkan static library if requested
-#--------------------------------------------------------------------
-if (GLFW_VULKAN_STATIC)
- if (VULKAN_FOUND AND VULKAN_STATIC_LIBRARY)
- list(APPEND glfw_LIBRARIES "${VULKAN_STATIC_LIBRARY}" ${GLFW_VULKAN_DEPS})
- if (BUILD_SHARED_LIBS)
- message(WARNING "Linking Vulkan loader static library into GLFW")
- endif()
+if (GLFW_LIBRARY_TYPE)
+ if (GLFW_LIBRARY_TYPE STREQUAL "SHARED")
+ set(GLFW_BUILD_SHARED_LIBRARY TRUE)
else()
- if (BUILD_SHARED_LIBS OR GLFW_BUILD_EXAMPLES OR GLFW_BUILD_TESTS)
- message(FATAL_ERROR "Vulkan loader static library not found")
- else()
- message(WARNING "Vulkan loader static library not found")
- endif()
- endif()
-endif()
-
-#--------------------------------------------------------------------
-# Find and add Unix math and time libraries
-#--------------------------------------------------------------------
-if (UNIX AND NOT APPLE)
- find_library(RT_LIBRARY rt)
- mark_as_advanced(RT_LIBRARY)
- if (RT_LIBRARY)
- list(APPEND glfw_LIBRARIES "${RT_LIBRARY}")
- list(APPEND glfw_PKG_LIBS "-lrt")
- endif()
-
- find_library(MATH_LIBRARY m)
- mark_as_advanced(MATH_LIBRARY)
- if (MATH_LIBRARY)
- list(APPEND glfw_LIBRARIES "${MATH_LIBRARY}")
- list(APPEND glfw_PKG_LIBS "-lm")
- endif()
-
- if (CMAKE_DL_LIBS)
- list(APPEND glfw_LIBRARIES "${CMAKE_DL_LIBS}")
- list(APPEND glfw_PKG_LIBS "-l${CMAKE_DL_LIBS}")
+ set(GLFW_BUILD_SHARED_LIBRARY FALSE)
endif()
+else()
+ set(GLFW_BUILD_SHARED_LIBRARY ${BUILD_SHARED_LIBS})
endif()
-#--------------------------------------------------------------------
-# Use Win32 for window creation
-#--------------------------------------------------------------------
-if (_GLFW_WIN32)
-
- list(APPEND glfw_PKG_LIBS "-lgdi32")
+list(APPEND CMAKE_MODULE_PATH "${GLFW_SOURCE_DIR}/CMake/modules")
- if (GLFW_USE_HYBRID_HPG)
- set(_GLFW_USE_HYBRID_HPG 1)
- endif()
-endif()
+find_package(Threads REQUIRED)
#--------------------------------------------------------------------
-# Use X11 for window creation
+# Report backend selection
#--------------------------------------------------------------------
-if (_GLFW_X11)
-
- find_package(X11 REQUIRED)
-
- list(APPEND glfw_PKG_DEPS "x11")
-
- # Set up library and include paths
- list(APPEND glfw_INCLUDE_DIRS "${X11_X11_INCLUDE_PATH}")
- list(APPEND glfw_LIBRARIES "${X11_X11_LIB}" "${CMAKE_THREAD_LIBS_INIT}")
-
- # Check for XRandR (modern resolution switching and gamma control)
- if (NOT X11_Xrandr_FOUND)
- message(FATAL_ERROR "The RandR headers were not found")
- endif()
-
- # Check for Xinerama (legacy multi-monitor support)
- if (NOT X11_Xinerama_FOUND)
- message(FATAL_ERROR "The Xinerama headers were not found")
- endif()
-
- # Check for Xkb (X keyboard extension)
- if (NOT X11_Xkb_FOUND)
- message(FATAL_ERROR "The X keyboard extension headers were not found")
- endif()
-
- # Check for Xcursor (cursor creation from RGBA images)
- if (NOT X11_Xcursor_FOUND)
- message(FATAL_ERROR "The Xcursor headers were not found")
- endif()
-
- list(APPEND glfw_INCLUDE_DIRS "${X11_Xrandr_INCLUDE_PATH}"
- "${X11_Xinerama_INCLUDE_PATH}"
- "${X11_Xkb_INCLUDE_PATH}"
- "${X11_Xcursor_INCLUDE_PATH}")
+if (GLFW_BUILD_WIN32)
+ message(STATUS "Including Win32 support")
endif()
-
-#--------------------------------------------------------------------
-# Use Wayland for window creation
-#--------------------------------------------------------------------
-if (_GLFW_WAYLAND)
- find_package(ECM REQUIRED NO_MODULE)
- list(APPEND CMAKE_MODULE_PATH "${ECM_MODULE_PATH}")
-
- find_package(Wayland REQUIRED)
- find_package(WaylandScanner REQUIRED)
- find_package(WaylandProtocols 1.1 REQUIRED)
-
- list(APPEND glfw_PKG_DEPS "wayland-egl")
-
- list(APPEND glfw_INCLUDE_DIRS "${Wayland_INCLUDE_DIR}")
- list(APPEND glfw_LIBRARIES "${Wayland_LIBRARIES}" "${CMAKE_THREAD_LIBS_INIT}")
-
- find_package(XKBCommon REQUIRED)
- list(APPEND glfw_PKG_DEPS "xkbcommon")
- list(APPEND glfw_INCLUDE_DIRS "${XKBCOMMON_INCLUDE_DIRS}")
- list(APPEND glfw_LIBRARIES "${XKBCOMMON_LIBRARY}")
+if (GLFW_BUILD_COCOA)
+ message(STATUS "Including Cocoa support")
endif()
-
-#--------------------------------------------------------------------
-# Use Mir for window creation
-#--------------------------------------------------------------------
-if (_GLFW_MIR)
- find_package(Mir REQUIRED)
- list(APPEND glfw_PKG_DEPS "mirclient")
-
- list(APPEND glfw_INCLUDE_DIRS "${MIR_INCLUDE_DIRS}")
- list(APPEND glfw_LIBRARIES "${MIR_LIBRARIES}" "${CMAKE_THREAD_LIBS_INIT}")
-
- find_package(XKBCommon REQUIRED)
- list(APPEND glfw_PKG_DEPS "xkbcommon")
- list(APPEND glfw_INCLUDE_DIRS "${XKBCOMMON_INCLUDE_DIRS}")
- list(APPEND glfw_LIBRARIES "${XKBCOMMON_LIBRARY}")
+if (GLFW_BUILD_WAYLAND)
+ message(STATUS "Including Wayland support")
endif()
-
-#--------------------------------------------------------------------
-# Use OSMesa for offscreen context creation
-#--------------------------------------------------------------------
-if (_GLFW_OSMESA)
- find_package(OSMesa REQUIRED)
- list(APPEND glfw_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}")
+if (GLFW_BUILD_X11)
+ message(STATUS "Including X11 support")
endif()
#--------------------------------------------------------------------
-# Use Cocoa for window creation and NSOpenGL for context creation
+# Apply Microsoft C runtime library option
+# This is here because it also applies to tests and examples
#--------------------------------------------------------------------
-if (_GLFW_COCOA)
-
- list(APPEND glfw_LIBRARIES
- "-framework Cocoa"
- "-framework IOKit"
- "-framework CoreFoundation"
- "-framework CoreVideo")
-
- set(glfw_PKG_DEPS "")
- set(glfw_PKG_LIBS "-framework Cocoa -framework IOKit -framework CoreFoundation -framework CoreVideo")
+if (MSVC AND NOT USE_MSVC_RUNTIME_LIBRARY_DLL)
+ set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>")
endif()
-#--------------------------------------------------------------------
-# Export GLFW library dependencies
-#--------------------------------------------------------------------
-foreach(arg ${glfw_PKG_DEPS})
- set(GLFW_PKG_DEPS "${GLFW_PKG_DEPS} ${arg}")
-endforeach()
-foreach(arg ${glfw_PKG_LIBS})
- set(GLFW_PKG_LIBS "${GLFW_PKG_LIBS} ${arg}")
-endforeach()
-
#--------------------------------------------------------------------
# Create generated files
#--------------------------------------------------------------------
include(CMakePackageConfigHelpers)
-set(GLFW_CONFIG_PATH "lib${LIB_SUFFIX}/cmake/glfw3")
+set(GLFW_CONFIG_PATH "${CMAKE_INSTALL_LIBDIR}/cmake/glfw3")
-configure_package_config_file(src/glfw3Config.cmake.in
+configure_package_config_file(CMake/glfw3Config.cmake.in
src/glfw3Config.cmake
INSTALL_DESTINATION "${GLFW_CONFIG_PATH}"
NO_CHECK_REQUIRED_COMPONENTS_MACRO)
write_basic_package_version_file(src/glfw3ConfigVersion.cmake
- VERSION ${GLFW_VERSION_FULL}
+ VERSION ${GLFW_VERSION}
COMPATIBILITY SameMajorVersion)
-configure_file(src/glfw_config.h.in src/glfw_config.h @ONLY)
-
-configure_file(src/glfw3.pc.in src/glfw3.pc @ONLY)
-
#--------------------------------------------------------------------
# Add subdirectories
#--------------------------------------------------------------------
@@ -373,7 +104,7 @@ if (GLFW_BUILD_TESTS)
add_subdirectory(tests)
endif()
-if (DOXYGEN_FOUND AND GLFW_BUILD_DOCS)
+if (GLFW_BUILD_DOCS)
add_subdirectory(docs)
endif()
@@ -382,7 +113,7 @@ endif()
# The library is installed by src/CMakeLists.txt
#--------------------------------------------------------------------
if (GLFW_INSTALL)
- install(DIRECTORY include/GLFW DESTINATION include
+ install(DIRECTORY include/GLFW DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
FILES_MATCHING PATTERN glfw3.h PATTERN glfw3native.h)
install(FILES "${GLFW_BINARY_DIR}/src/glfw3Config.cmake"
@@ -393,16 +124,17 @@ if (GLFW_INSTALL)
EXPORT_LINK_INTERFACE_LIBRARIES
DESTINATION "${GLFW_CONFIG_PATH}")
install(FILES "${GLFW_BINARY_DIR}/src/glfw3.pc"
- DESTINATION "lib${LIB_SUFFIX}/pkgconfig")
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
# Only generate this target if no higher-level project already has
if (NOT TARGET uninstall)
- configure_file(cmake_uninstall.cmake.in
+ configure_file(CMake/cmake_uninstall.cmake.in
cmake_uninstall.cmake IMMEDIATE @ONLY)
add_custom_target(uninstall
"${CMAKE_COMMAND}" -P
"${GLFW_BINARY_DIR}/cmake_uninstall.cmake")
+ set_target_properties(uninstall PROPERTIES FOLDER "GLFW3")
endif()
endif()
diff --git a/external/GLFW/CONTRIBUTORS.md b/external/GLFW/CONTRIBUTORS.md
new file mode 100644
index 0000000..cfb4f42
--- /dev/null
+++ b/external/GLFW/CONTRIBUTORS.md
@@ -0,0 +1,304 @@
+# Acknowledgements
+
+GLFW exists because people around the world donated their time and lent their
+skills. This list only includes contributions to the main repository and
+excludes other invaluable contributions like language bindings and text and
+video tutorials.
+
+ - Bobyshev Alexander
+ - Laurent Aphecetche
+ - Matt Arsenault
+ - Takuro Ashie
+ - ashishgamedev
+ - David Avedissian
+ - Luca Bacci
+ - Keith Bauer
+ - John Bartholomew
+ - Coşku Baş
+ - Bayemite
+ - Niklas Behrens
+ - Andrew Belt
+ - Nevyn Bengtsson
+ - Niklas Bergström
+ - Denis Bernard
+ - BiBi
+ - Doug Binks
+ - bitb4ker
+ - blanco
+ - Waris Boonyasiriwat
+ - Kyle Brenneman
+ - Rok Breulj
+ - TheBrokenRail
+ - Kai Burjack
+ - Martin Capitanio
+ - Nicolas Caramelli
+ - David Carlier
+ - Arturo Castro
+ - Jose Luis Cercós Pita
+ - Chi-kwan Chan
+ - Victor Chernyakin
+ - TheChocolateOre
+ - Ali Chraghi
+ - Joseph Chua
+ - Ian Clarkson
+ - Michał Cichoń
+ - Lambert Clara
+ - Anna Clarke
+ - Josh Codd
+ - Yaron Cohen-Tal
+ - Omar Cornut
+ - Andrew Corrigan
+ - Bailey Cosier
+ - Noel Cower
+ - James Cowgill
+ - CuriouserThing
+ - Bill Currie
+ - Jason Daly
+ - danhambleton
+ - Jarrod Davis
+ - decce
+ - Olivier Delannoy
+ - Paul R. Deppe
+ - Michael Dickens
+ - Роман Донченко
+ - Mario Dorn
+ - Wolfgang Draxinger
+ - Jonathan Dummer
+ - Ralph Eastwood
+ - Fredrik Ehnbom
+ - Robin Eklind
+ - Jan Ekström
+ - Siavash Eliasi
+ - er-azh
+ - Jan Hendrik Farr
+ - Ahmad Fatoum
+ - Nikita Fediuchin
+ - Felipe Ferreira
+ - Michael Fogleman
+ - forworldm
+ - Jason Francis
+ - Gerald Franz
+ - Mário Freitas
+ - GeO4d
+ - Marcus Geelnard
+ - Gegy
+ - ghuser404
+ - Charles Giessen
+ - Ryan C. Gordon
+ - Stephen Gowen
+ - Kovid Goyal
+ - Kevin Grandemange
+ - Eloi Marín Gratacós
+ - Grzesiek11
+ - Stefan Gustavson
+ - Andrew Gutekanst
+ - Stephen Gutekanst
+ - Jonathan Hale
+ - Daniel Hauser
+ - hdf89shfdfs
+ - Moritz Heinemann
+ - Sylvain Hellegouarch
+ - Björn Hempel
+ - Matthew Henry
+ - heromyth
+ - Lucas Hinderberger
+ - Paul Holden
+ - Hajime Hoshi
+ - Warren Hu
+ - Charles Huber
+ - Brent Huisman
+ - Florian Hülsmann
+ - illustris
+ - InKryption
+ - IntellectualKitty
+ - Aaron Jacobs
+ - JannikGM
+ - Erik S. V. Jansson
+ - jjYBdx4IL
+ - Peter Johnson
+ - Toni Jovanoski
+ - Arseny Kapoulkine
+ - Cem Karan
+ - Osman Keskin
+ - Koray Kilinc
+ - Josh Kilmer
+ - Byunghoon Kim
+ - Cameron King
+ - knokko
+ - Peter Knut
+ - Christoph Kubisch
+ - Yuri Kunde Schlesner
+ - Rokas Kupstys
+ - Konstantin Käfer
+ - Eric Larson
+ - Guillaume Lebrun
+ - Francis Lecavalier
+ - Jong Won Lee
+ - Robin Leffmann
+ - Glenn Lewis
+ - Shane Liesegang
+ - Anders Lindqvist
+ - Leon Linhart
+ - Marco Lizza
+ - lo-v-ol
+ - Eyal Lotem
+ - Aaron Loucks
+ - Ned Loynd
+ - Luflosi
+ - lukect
+ - Tristam MacDonald
+ - Jean-Luc Mackail
+ - Hans Mackowiak
+ - Ramiro Magno
+ - Дмитри Малышев
+ - Zbigniew Mandziejewicz
+ - Adam Marcus
+ - Célestin Marot
+ - Kyle McDonald
+ - David V. McKay
+ - David Medlock
+ - Bryce Mehring
+ - Jonathan Mercier
+ - Marcel Metz
+ - Liam Middlebrook
+ - mightgoyardstill
+ - Ave Milia
+ - Icyllis Milica
+ - Jonathan Miller
+ - Kenneth Miller
+ - Bruce Mitchener
+ - Jack Moffitt
+ - Ravi Mohan
+ - Jeff Molofee
+ - Alexander Monakov
+ - Pierre Morel
+ - Jon Morton
+ - Pierre Moulon
+ - Martins Mozeiko
+ - Pascal Muetschard
+ - James Murphy
+ - Julian Møller
+ - Julius Häger
+ - Nat!
+ - NateIsStalling
+ - ndogxj
+ - F. Nedelec
+ - n3rdopolis
+ - Kristian Nielsen
+ - Joel Niemelä
+ - Victor Nova
+ - Kamil Nowakowski
+ - onox
+ - Denis Ovod
+ - Ozzy
+ - Andri Pálsson
+ - luz paz
+ - Peoro
+ - Braden Pellett
+ - Christopher Pelloux
+ - Michael Pennington
+ - Arturo J. Pérez
+ - Vladimir Perminov
+ - Olivier Perret
+ - Anthony Pesch
+ - Orson Peters
+ - Emmanuel Gil Peyrot
+ - Cyril Pichard
+ - Pilzschaf
+ - Keith Pitt
+ - Stanislav Podgorskiy
+ - Konstantin Podsvirov
+ - Nathan Poirier
+ - Pokechu22
+ - Alexandre Pretyman
+ - Pablo Prietz
+ - przemekmirek
+ - pthom
+ - Martin Pulec
+ - Guillaume Racicot
+ - Juan Ramos
+ - Christian Rauch
+ - Philip Rideout
+ - Eddie Ringle
+ - Max Risuhin
+ - Joe Roback
+ - Jorge Rodriguez
+ - Jari Ronkainen
+ - Luca Rood
+ - Ed Ropple
+ - Aleksey Rybalkin
+ - Mikko Rytkönen
+ - Riku Salminen
+ - Yoshinori Sano
+ - Brandon Schaefer
+ - Sebastian Schuberth
+ - Scr3amer
+ - Jan Schürkamp
+ - Christian Sdunek
+ - Matt Sealey
+ - Steve Sexton
+ - Arkady Shapkin
+ - Mingjie Shen
+ - Ali Sherief
+ - Yoshiki Shibukawa
+ - Dmitri Shuralyov
+ - Joao da Silva
+ - Daniel Sieger
+ - Daljit Singh
+ - Michael Skec
+ - Daniel Skorupski
+ - Slemmie
+ - Anthony Smith
+ - Bradley Smith
+ - Cliff Smolinsky
+ - Patrick Snape
+ - Erlend Sogge Heggen
+ - Olivier Sohn
+ - Julian Squires
+ - Johannes Stein
+ - Pontus Stenetorp
+ - Michael Stocker
+ - Justin Stoecker
+ - Elviss Strazdins
+ - Paul Sultana
+ - Nathan Sweet
+ - TTK-Bandit
+ - Nuno Teixeira
+ - Jared Tiala
+ - Sergey Tikhomirov
+ - Arthur Tombs
+ - TronicLabs
+ - Ioannis Tsakpinis
+ - Samuli Tuomola
+ - Matthew Turner
+ - urraka
+ - Elias Vanderstuyft
+ - Stef Velzel
+ - Jari Vetoniemi
+ - Ricardo Vieira
+ - Nicholas Vitovitch
+ - Vladimír Vondruš
+ - Simon Voordouw
+ - Corentin Wallez
+ - Torsten Walluhn
+ - Patrick Walton
+ - Jim Wang
+ - Xo Wang
+ - Andre Weissflog
+ - Jay Weisskopf
+ - Frank Wille
+ - Andy Williams
+ - Joel Winarske
+ - Richard A. Wilkes
+ - Tatsuya Yatagawa
+ - Ryogo Yoshimura
+ - Lukas Zanner
+ - Andrey Zholos
+ - Aihui Zhu
+ - Santi Zupancic
+ - Jonas Ådahl
+ - Lasse Öörni
+ - Leonard König
+ - All the unmentioned and anonymous contributors in the GLFW community, for bug
+ reports, patches, feedback, testing and encouragement
+
diff --git a/external/GLFW/LICENSE.md b/external/GLFW/LICENSE.md
index e4c6682..7494a3f 100644
--- a/external/GLFW/LICENSE.md
+++ b/external/GLFW/LICENSE.md
@@ -1,5 +1,6 @@
-Copyright (c) 2002-2006 Marcus Geelnard
-Copyright (c) 2006-2016 Camilla Löwy
+Copyright (c) 2002-2006 Marcus Geelnard
+
+Copyright (c) 2006-2019 Camilla Löwy
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
diff --git a/external/GLFW/README.md b/external/GLFW/README.md
index 01b159c..1c7ced3 100644
--- a/external/GLFW/README.md
+++ b/external/GLFW/README.md
@@ -1,8 +1,7 @@
# GLFW
-[](https://travis-ci.org/glfw/glfw)
+[](https://github.com/glfw/glfw/actions)
[](https://ci.appveyor.com/project/elmindreda/glfw)
-[](https://scan.coverity.com/projects/glfw-glfw)
## Introduction
@@ -10,423 +9,160 @@ GLFW is an Open Source, multi-platform library for OpenGL, OpenGL ES and Vulkan
application development. It provides a simple, platform-independent API for
creating windows, contexts and surfaces, reading input, handling events, etc.
-GLFW natively supports Windows, macOS and Linux and other Unix-like systems.
-Experimental implementations for the Wayland protocol and the Mir display server
-are available but not yet officially supported.
+GLFW is written primarily in C99, with parts of macOS support being written in
+Objective-C.
-GLFW is licensed under the [zlib/libpng
-license](http://www.glfw.org/license.html).
-
-The latest stable release is version 3.2.1.
-
-See the [downloads](http://www.glfw.org/download.html) page for details and
-files, or fetch the `latest` branch, which always points to the latest stable
-release. Each release starting with 3.0 also has a corresponding [annotated
-tag](https://github.com/glfw/glfw/releases) with source and binary archives.
-The [version history](http://www.glfw.org/changelog.html) lists all user-visible
-changes for every release.
-
-This is a development branch for version 3.3, which is _not yet described_.
-Pre-release documentation is available [here](http://www.glfw.org/docs/3.3/).
-
-The `master` branch is the stable integration branch and _should_ always compile
-and run on all supported platforms, although details of newly added features may
-change until they have been included in a release. New features and many bug
-fixes live in [other branches](https://github.com/glfw/glfw/branches/all) until
-they are stable enough to merge.
-
-If you are new to GLFW, you may find the
-[tutorial](http://www.glfw.org/docs/latest/quick.html) for GLFW 3 useful. If
-you have used GLFW 2 in the past, there is a [transition
-guide](http://www.glfw.org/docs/latest/moving.html) for moving to the GLFW
-3 API.
-
-
-## Compiling GLFW
-
-GLFW itself requires only the headers and libraries for your window system. It
-does not need the headers for any context creation API (WGL, GLX, EGL, NSGL,
-OSMesa) or rendering API (OpenGL, OpenGL ES, Vulkan) to enable support for them.
-
-GLFW supports compilation on Windows with Visual C++ 2010 and later, MinGW and
-MinGW-w64, on macOS with Clang and on Linux and other Unix-like systems with GCC
-and Clang. It will likely compile in other environments as well, but this is
-not regularly tested.
-
-There are [pre-compiled Windows binaries](http://www.glfw.org/download.html)
-available for all supported compilers.
-
-See the [compilation guide](http://www.glfw.org/docs/latest/compile.html) for
-more information about how to compile GLFW yourself.
+GLFW supports Windows, macOS and Linux, and also works on many other Unix-like
+systems. On Linux both Wayland and X11 are supported.
+GLFW is licensed under the [zlib/libpng
+license](https://www.glfw.org/license.html).
-## Using GLFW
+You can [download](https://www.glfw.org/download.html) the latest stable release
+as source or Windows and macOS binaries. There are [release
+tags](https://github.com/glfw/glfw/releases) with source and binary archives
+attached for every version since 3.0.
-See the [documentation](http://www.glfw.org/docs/latest/) for tutorials, guides
-and the API reference.
+The [documentation](https://www.glfw.org/docs/latest/) is available online and is
+also included in source and binary archives, except those generated
+automatically by Github. The documentation contains guides, a tutorial and the
+API reference. The [release
+notes](https://www.glfw.org/docs/latest/news.html) list the new features,
+caveats and deprecations in the latest release. The [version
+history](https://www.glfw.org/changelog.html) lists every user-visible change
+for every release.
+GLFW exists because of the contributions of [many people](CONTRIBUTORS.md)
+around the world, whether by reporting bugs, providing community support, adding
+features, reviewing or testing code, debugging, proofreading docs, suggesting
+features or fixing bugs.
-## Contributing to GLFW
-See the [contribution
-guide](https://github.com/glfw/glfw/blob/master/.github/CONTRIBUTING.md) for
-more information.
+## System requirements
+GLFW supports Windows 7 and later and macOS 10.11 and later. On GNOME Wayland,
+window decorations will be very basic unless the
+[libdecor](https://gitlab.freedesktop.org/libdecor/libdecor) package is
+installed. Linux and other Unix-like systems running X11 are supported even
+without a desktop environment or modern extensions, although some features
+require a clipboard manager or a modern window manager.
-## System requirements
+See the [compatibility guide](https://www.glfw.org/docs/latest/compat.html)
+for more detailed information.
-GLFW supports Windows XP and later and macOS 10.7 and later. Linux and other
-Unix-like systems running the X Window System are supported even without
-a desktop environment or modern extensions, although some features require
-a running window or clipboard manager. The OSMesa backend requires Mesa 6.3.
-See the [compatibility guide](http://www.glfw.org/docs/latest/compat.html)
-in the documentation for more information.
+## Compiling GLFW
+GLFW supports compilation with Visual C++ (2013 and later), GCC and Clang. Both
+Clang-CL and MinGW-w64 are supported. Other C99 compilers will likely also
+work, but this is not regularly tested.
-## Dependencies
+There are [pre-compiled binaries](https://www.glfw.org/download.html)
+available for Windows and macOS.
-GLFW itself depends only on the headers and libraries for your window system.
+GLFW itself needs only CMake and the headers and libraries for your operating
+system and window system. No other SDKs are required.
-The (experimental) Wayland backend also depends on the `extra-cmake-modules`
-package, which is used to generated Wayland protocol headers.
+See the [compilation guide](https://www.glfw.org/docs/latest/compile.html) for
+more information about compiling GLFW and the exact dependencies required for
+each window system.
The examples and test programs depend on a number of tiny libraries. These are
-located in the `deps/` directory.
+bundled in the `deps/` directory. The repository has no submodules.
- [getopt\_port](https://github.com/kimgr/getopt_port/) for examples
with command-line options
- [TinyCThread](https://github.com/tinycthread/tinycthread) for threaded
examples
- - An OpenGL 3.2 core loader generated by
- [glad](https://github.com/Dav1dde/glad) for examples using modern OpenGL
+ - [glad2](https://github.com/Dav1dde/glad) for loading OpenGL and Vulkan
+ functions
- [linmath.h](https://github.com/datenwolf/linmath.h) for linear algebra in
examples
- - [Nuklear](https://github.com/vurtun/nuklear) for test and example UI
+ - [Nuklear](https://github.com/Immediate-Mode-UI/Nuklear) for test and example UI
- [stb\_image\_write](https://github.com/nothings/stb) for writing images to disk
- - [Vulkan headers](https://www.khronos.org/registry/vulkan/) for Vulkan tests
-The Vulkan example additionally requires the Vulkan SDK to be installed, or it
-will not be included in the build. On macOS you need to provide the path to the
-MoltenVK SDK manually as it has no standard installation location.
+The documentation is generated with [Doxygen](https://doxygen.org/) when the
+library is built, provided CMake could find a sufficiently new version of it
+during configuration.
+
+
+## Using GLFW
+
+See the [HTML documentation](https://www.glfw.org/docs/latest/) for a tutorial,
+guides and the API reference.
+
+
+## Contributing to GLFW
+
+See the [contribution
+guide](https://github.com/glfw/glfw/blob/master/docs/CONTRIBUTING.md) for
+more information.
+
+The `master` branch is the stable integration branch and _should_ always compile
+and run on all supported platforms. Details of a newly added feature,
+including the public API, may change until it has been included in a release.
+
+The `latest` branch is equivalent to the [highest numbered](https://semver.org/)
+release, although it may not always point to the same commit as the tag for that
+release.
-The documentation is generated with [Doxygen](http://doxygen.org/) if CMake can
-find that tool.
+The `ci` branch is used to trigger continuous integration jobs for code under
+testing and should never be relied on for any purpose.
## Reporting bugs
Bugs are reported to our [issue tracker](https://github.com/glfw/glfw/issues).
Please check the [contribution
-guide](https://github.com/glfw/glfw/blob/master/.github/CONTRIBUTING.md) for
+guide](https://github.com/glfw/glfw/blob/master/docs/CONTRIBUTING.md) for
information on what to include when reporting a bug.
-## Changelog
-
-- Added `glfwGetError` function for querying the last error code and its
- description (#970)
-- Added `glfwUpdateGamepadMappings` function for importing gamepad mappings in
- SDL\_GameControllerDB format (#900)
-- Added `glfwJoystickIsGamepad` function for querying whether a joystick has
- a gamepad mapping (#900)
-- Added `glfwGetJoystickGUID` function for querying the SDL compatible GUID of
- a joystick (#900)
-- Added `glfwGetGamepadName` function for querying the name provided by the
- gamepad mapping (#900)
-- Added `glfwGetGamepadState` function, `GLFW_GAMEPAD_*` and `GLFWgamepadstate`
- for retrieving gamepad input state (#900)
-- Added `glfwRequestWindowAttention` function for requesting attention from the
- user (#732,#988)
-- Added `glfwGetKeyScancode` function that allows retrieving platform dependent
- scancodes for keys (#830)
-- Added `glfwSetWindowMaximizeCallback` and `GLFWwindowmaximizefun` for
- receiving window maximization events (#778)
-- Added `glfwSetWindowAttrib` function for changing window attributes (#537)
-- Added `glfwGetJoystickHats` function for querying joystick hats
- (#889,#906,#934)
-- Added `glfwInitHint` and `glfwInitHintString` for setting initialization hints
-- Added `glfwGetX11SelectionString` and `glfwSetX11SelectionString`
- functions for accessing X11 primary selection (#894,#1056)
-- Added headless [OSMesa](http://mesa3d.org/osmesa.html) backend (#850)
-- Added definition of `GLAPIENTRY` to public header
-- Added `GLFW_TRANSPARENT` window hint for enabling window framebuffer
- transparency (#197,#663,#715,#723,#1078)
-- Added `GLFW_CENTER_CURSOR` window hint for controlling cursor centering
- (#749,#842)
-- Added `GLFW_JOYSTICK_HAT_BUTTONS` init hint (#889)
-- Added macOS specific `GLFW_COCOA_RETINA_FRAMEBUFFER` window hint
-- Added macOS specific `GLFW_COCOA_FRAME_AUTOSAVE` window hint (#195)
-- Added macOS specific `GLFW_COCOA_GRAPHICS_SWITCHING` window hint (#377,#935)
-- Added macOS specific `GLFW_COCOA_CHDIR_RESOURCES` init hint
-- Added macOS specific `GLFW_COCOA_MENUBAR` init hint
-- Added X11 specific `GLFW_X11_WM_CLASS_NAME` and `GLFW_X11_WM_CLASS_CLASS` init
- hints (#893)
-- Added `GLFW_INCLUDE_ES32` for including the OpenGL ES 3.2 header
-- Added `GLFW_OSMESA_CONTEXT_API` for creating OpenGL contexts with
- [OSMesa](https://www.mesa3d.org/osmesa.html) (#281)
-- Added `GenerateMappings.cmake` script for updating gamepad mappings
-- Removed `GLFW_USE_RETINA` compile-time option
-- Removed `GLFW_USE_CHDIR` compile-time option
-- Removed `GLFW_USE_MENUBAR` compile-time option
-- Bugfix: Calling `glfwMaximizeWindow` on a full screen window was not ignored
-- Bugfix: `GLFW_INCLUDE_VULKAN` could not be combined with the corresponding
- OpenGL and OpenGL ES header macros
-- Bugfix: `glfwGetInstanceProcAddress` returned `NULL` for
- `vkGetInstanceProcAddr` when `_GLFW_VULKAN_STATIC` was enabled
-- Bugfix: Invalid library paths were used in test and example CMake files (#930)
-- Bugfix: The scancode for synthetic key release events was always zero
-- Bugfix: The generated Doxyfile did not handle paths with spaces (#1081)
-- [Win32] Added system error strings to relevant GLFW error descriptions (#733)
-- [Win32] Moved to `WM_INPUT` for disabled cursor mode motion input (#125)
-- [Win32] Removed XInput circular deadzone from joystick axis data (#1045)
-- [Win32] Bugfix: Undecorated windows could not be iconified by the user (#861)
-- [Win32] Bugfix: Deadzone logic could underflow with some controllers (#910)
-- [Win32] Bugfix: Bitness test in `FindVulkan.cmake` was VS specific (#928)
-- [Win32] Bugfix: `glfwVulkanSupported` emitted an error on systems with
- a loader but no ICD (#916)
-- [Win32] Bugfix: Non-iconified full sreeen windows did not prevent screen
- blanking or password enabled screensavers (#851)
-- [Win32] Bugfix: Mouse capture logic lost secondary release messages (#954)
-- [Win32] Bugfix: The 32-bit Vulkan loader library static was not searched for
-- [Win32] Bugfix: Vulkan libraries have a new path as of SDK 1.0.42.0 (#956)
-- [Win32] Bugfix: Monitors with no display devices were not enumerated (#960)
-- [Win32] Bugfix: Monitor events were not emitted (#784)
-- [Win32] Bugfix: The Cygwin DLL was installed to the wrong directory (#1035)
-- [Win32] Bugfix: Normalization of axis data via XInput was incorrect (#1045)
-- [Win32] Bugfix: `glfw3native.h` would undefine a foreign `APIENTRY` (#1062)
-- [Win32] Bugfix: Disabled cursor mode prevented use of caption buttons
- (#650,#1071)
-- [Win32] Bugfix: Returned key names did not match other platforms (#943)
-- [X11] Moved to XI2 `XI_RawMotion` for disable cursor mode motion input (#125)
-- [X11] Replaced `_GLFW_HAS_XF86VM` compile-time option with dynamic loading
-- [X11] Bugfix: `glfwGetVideoMode` would segfault on Cygwin/X
-- [X11] Bugfix: Dynamic X11 library loading did not use full sonames (#941)
-- [X11] Bugfix: Window creation on 64-bit would read past top of stack (#951)
-- [X11] Bugfix: XDND support had multiple non-conformance issues (#968)
-- [X11] Bugfix: The RandR monitor path was disabled despite working RandR (#972)
-- [X11] Bugfix: IM-duplicated key events would leak at low polling rates (#747)
-- [X11] Bugfix: Gamma ramp setting via RandR did not validate ramp size
-- [X11] Bugfix: Key name string encoding depended on current locale (#981,#983)
-- [X11] Bugfix: Incremental reading of selections was not supported (#275)
-- [X11] Bugfix: Selection I/O reported but did not support `COMPOUND_TEXT`
-- [X11] Bugfix: Latin-1 text read from selections was not converted to UTF-8
-- [Linux] Moved to evdev for joystick input (#906,#1005)
-- [Linux] Bugfix: Event processing did not detect joystick disconnection (#932)
-- [Linux] Bugfix: The joystick device path could be truncated (#1025)
-- [Linux] Bugfix: `glfwInit` would fail if inotify creation failed (#833)
-- [Linux] Bugfix: `strdup` was used without any required feature macro (#1055)
-- [Cocoa] Added support for Vulkan window surface creation via
- [MoltenVK](https://moltengl.com/moltenvk/) (#870)
-- [Cocoa] Added support for loading a `MainMenu.nib` when available
-- [Cocoa] Bugfix: Disabling window aspect ratio would assert (#852)
-- [Cocoa] Bugfix: Window creation failed to set first responder (#876,#883)
-- [Cocoa] Bugfix: Removed use of deprecated `CGDisplayIOServicePort` function
- (#165,#192,#508,#511)
-- [Cocoa] Bugfix: Disabled use of deprecated `CGDisplayModeCopyPixelEncoding`
- function on macOS 10.12+
-- [Cocoa] Bugfix: Running in AppSandbox would emit warnings (#816,#882)
-- [Cocoa] Bugfix: Windows created after the first were not cascaded (#195)
-- [Cocoa] Bugfix: Leaving video mode with `glfwSetWindowMonitor` would set
- incorrect position and size (#748)
-- [Cocoa] Bugfix: Iconified full screen windows could not be restored (#848)
-- [Cocoa] Bugfix: Value range was ignored for joystick hats and buttons (#888)
-- [Cocoa] Bugfix: Full screen framebuffer was incorrectly sized for some video
- modes (#682)
-- [Cocoa] Bugfix: A string object for IME was updated non-idiomatically (#1050)
-- [Cocoa] Bugfix: A hidden or disabled cursor would become visible when a user
- notification was shown (#971,#1028)
-- [Cocoa] Bugfix: Some characters did not repeat due to Press and Hold (#1010)
-- [Cocoa] Bugfix: Window title was lost when full screen or undecorated (#1082)
-- [WGL] Added support for `WGL_EXT_colorspace` for OpenGL ES contexts
-- [WGL] Added support for `WGL_ARB_create_context_no_error`
-- [GLX] Added support for `GLX_ARB_create_context_no_error`
-- [GLX] Bugfix: Context creation could segfault if no GLXFBConfigs were
- available (#1040)
-- [EGL] Added support for `EGL_KHR_get_all_proc_addresses` (#871)
-- [EGL] Added support for `EGL_KHR_context_flush_control`
-- [EGL] Bugfix: The test for `EGL_RGB_BUFFER` was invalid
+## Changelog since 3.4
+
+ - Added `GLFW_UNLIMITED_MOUSE_BUTTONS` input mode that allows mouse buttons beyond
+ the limit of the mouse button tokens to be reported (#2423)
+ - Added `glfwGetEGLConfig` function to query the `EGLConfig` of a window (#2045)
+ - Added `glfwGetGLXFBConfig` function to query the `GLXFBConfig` of a window (#1925)
+ - Updated minimum CMake version to 3.16 (#2541)
+ - Removed support for building with original MinGW (#2540)
+ - [Win32] Removed support for Windows XP and Vista (#2505)
+ - [Cocoa] Added `QuartzCore` framework as link-time dependency
+ - [Cocoa] Removed support for OS X 10.10 Yosemite and earlier (#2506)
+ - [Wayland] Bugfix: The fractional scaling related objects were not destroyed
+ - [Wayland] Bugfix: `glfwInit` would segfault on compositor with no seat (#2517)
+ - [Wayland] Bugfix: A drag entering a non-GLFW surface could cause a segfault
+ - [Wayland] Bugfix: Ignore key repeat events when no window has keyboard focus (#2727)
+ - [Wayland] Bugfix: Reset key repeat timer when window destroyed (#2741,#2727)
+ - [Wayland] Bugfix: Memory would leak if reading a data offer failed midway
+ - [Wayland] Bugfix: Retrieved cursor position would be incorrect when hovering over
+ fallback decorations
+ - [Wayland] Bugfix: Fallback decorations would report scroll events
+ - [Wayland] Bugfix: Keyboard repeat events halted when any key is released (#2568)
+ - [Wayland] Bugfix: Fallback decorations would show menu at wrong position
+ - [Wayland] Bugfix: The cursor was not updated when clicking through from
+ a modal to a fallback decoration
+ - [Wayland] Bugfix: The cursor position was not updated when clicking through
+ from a modal to the content area
+ - [X11] Bugfix: Running without a WM could trigger an assert (#2593,#2601,#2631)
+ - [Null] Added Vulkan 'window' surface creation via `VK_EXT_headless_surface`
+ - [Null] Added EGL context creation on Mesa via `EGL_MESA_platform_surfaceless`
+ - [EGL] Allowed native access on Wayland with `GLFW_CONTEXT_CREATION_API` set to
+ `GLFW_NATIVE_CONTEXT_API` (#2518)
## Contact
-On [glfw.org](http://www.glfw.org/) you can find the latest version of GLFW, as
+On [glfw.org](https://www.glfw.org/) you can find the latest version of GLFW, as
well as news, documentation and other information about the project.
If you have questions related to the use of GLFW, we have a
-[forum](http://discourse.glfw.org/), and the `#glfw` IRC channel on
-[Freenode](http://freenode.net/).
+[forum](https://discourse.glfw.org/).
If you have a bug to report, a patch to submit or a feature you'd like to
request, please file it in the
[issue tracker](https://github.com/glfw/glfw/issues) on GitHub.
Finally, if you're interested in helping out with the development of GLFW or
-porting it to your favorite platform, join us on the forum, GitHub or IRC.
-
-
-## Acknowledgements
-
-GLFW exists because people around the world donated their time and lent their
-skills.
-
- - Bobyshev Alexander
- - Matt Arsenault
- - David Avedissian
- - Keith Bauer
- - John Bartholomew
- - Niklas Behrens
- - Niklas Bergström
- - Denis Bernard
- - Doug Binks
- - blanco
- - Kyle Brenneman
- - Rok Breulj
- - Martin Capitanio
- - David Carlier
- - Arturo Castro
- - Chi-kwan Chan
- - Ian Clarkson
- - Michał Cichoń
- - Lambert Clara
- - Yaron Cohen-Tal
- - Omar Cornut
- - Andrew Corrigan
- - Bailey Cosier
- - Noel Cower
- - Jason Daly
- - Jarrod Davis
- - Olivier Delannoy
- - Paul R. Deppe
- - Michael Dickens
- - Роман Донченко
- - Mario Dorn
- - Wolfgang Draxinger
- - Jonathan Dummer
- - Ralph Eastwood
- - Fredrik Ehnbom
- - Robin Eklind
- - Siavash Eliasi
- - Felipe Ferreira
- - Michael Fogleman
- - Gerald Franz
- - Mário Freitas
- - GeO4d
- - Marcus Geelnard
- - Eloi Marín Gratacós
- - Stefan Gustavson
- - Jonathan Hale
- - Sylvain Hellegouarch
- - Matthew Henry
- - heromyth
- - Lucas Hinderberger
- - Paul Holden
- - Warren Hu
- - IntellectualKitty
- - Aaron Jacobs
- - Erik S. V. Jansson
- - Toni Jovanoski
- - Arseny Kapoulkine
- - Cem Karan
- - Osman Keskin
- - Josh Kilmer
- - Cameron King
- - Peter Knut
- - Christoph Kubisch
- - Yuri Kunde Schlesner
- - Konstantin Käfer
- - Eric Larson
- - Robin Leffmann
- - Glenn Lewis
- - Shane Liesegang
- - Eyal Lotem
- - Tristam MacDonald
- - Hans Mackowiak
- - Дмитри Малышев
- - Zbigniew Mandziejewicz
- - Célestin Marot
- - Kyle McDonald
- - David Medlock
- - Bryce Mehring
- - Jonathan Mercier
- - Marcel Metz
- - Liam Middlebrook
- - Jonathan Miller
- - Kenneth Miller
- - Bruce Mitchener
- - Jack Moffitt
- - Jeff Molofee
- - Pierre Morel
- - Jon Morton
- - Pierre Moulon
- - Martins Mozeiko
- - Julian Møller
- - ndogxj
- - Kristian Nielsen
- - Kamil Nowakowski
- - Denis Ovod
- - Ozzy
- - Andri Pálsson
- - Peoro
- - Braden Pellett
- - Christopher Pelloux
- - Arturo J. Pérez
- - Anthony Pesch
- - Orson Peters
- - Emmanuel Gil Peyrot
- - Cyril Pichard
- - Keith Pitt
- - Stanislav Podgorskiy
- - Alexandre Pretyman
- - Philip Rideout
- - Eddie Ringle
- - Jorge Rodriguez
- - Ed Ropple
- - Aleksey Rybalkin
- - Riku Salminen
- - Brandon Schaefer
- - Sebastian Schuberth
- - Christian Sdunek
- - Matt Sealey
- - Steve Sexton
- - Arkady Shapkin
- - Yoshiki Shibukawa
- - Dmitri Shuralyov
- - Daniel Skorupski
- - Bradley Smith
- - Patrick Snape
- - Erlend Sogge Heggen
- - Julian Squires
- - Johannes Stein
- - Pontus Stenetorp
- - Michael Stocker
- - Justin Stoecker
- - Elviss Strazdins
- - Paul Sultana
- - Nathan Sweet
- - TTK-Bandit
- - Sergey Tikhomirov
- - Arthur Tombs
- - Ioannis Tsakpinis
- - Samuli Tuomola
- - Matthew Turner
- - urraka
- - Elias Vanderstuyft
- - Stef Velzel
- - Jari Vetoniemi
- - Ricardo Vieira
- - Nicholas Vitovitch
- - Simon Voordouw
- - Torsten Walluhn
- - Patrick Walton
- - Xo Wang
- - Jay Weisskopf
- - Frank Wille
- - Ryogo Yoshimura
- - Andrey Zholos
- - Santi Zupancic
- - Jonas Ådahl
- - Lasse Öörni
- - All the unmentioned and anonymous contributors in the GLFW community, for bug
- reports, patches, feedback, testing and encouragement
+porting it to your favorite platform, join us on the forum or GitHub.
diff --git a/external/GLFW/deps/glad/gl.h b/external/GLFW/deps/glad/gl.h
new file mode 100644
index 0000000..b421fe0
--- /dev/null
+++ b/external/GLFW/deps/glad/gl.h
@@ -0,0 +1,5996 @@
+/**
+ * Loader generated by glad 2.0.0-beta on Tue Aug 24 22:51:07 2021
+ *
+ * Generator: C/C++
+ * Specification: gl
+ * Extensions: 3
+ *
+ * APIs:
+ * - gl:compatibility=3.3
+ *
+ * Options:
+ * - ALIAS = False
+ * - DEBUG = False
+ * - HEADER_ONLY = True
+ * - LOADER = False
+ * - MX = False
+ * - MX_GLOBAL = False
+ * - ON_DEMAND = False
+ *
+ * Commandline:
+ * --api='gl:compatibility=3.3' --extensions='GL_ARB_multisample,GL_ARB_robustness,GL_KHR_debug' c --header-only
+ *
+ * Online:
+ * http://glad.sh/#api=gl%3Acompatibility%3D3.3&extensions=GL_ARB_multisample%2CGL_ARB_robustness%2CGL_KHR_debug&generator=c&options=HEADER_ONLY
+ *
+ */
+
+#ifndef GLAD_GL_H_
+#define GLAD_GL_H_
+
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wreserved-id-macro"
+#endif
+#ifdef __gl_h_
+ #error OpenGL (gl.h) header already included (API: gl), remove previous include!
+#endif
+#define __gl_h_ 1
+#ifdef __gl3_h_
+ #error OpenGL (gl3.h) header already included (API: gl), remove previous include!
+#endif
+#define __gl3_h_ 1
+#ifdef __glext_h_
+ #error OpenGL (glext.h) header already included (API: gl), remove previous include!
+#endif
+#define __glext_h_ 1
+#ifdef __gl3ext_h_
+ #error OpenGL (gl3ext.h) header already included (API: gl), remove previous include!
+#endif
+#define __gl3ext_h_ 1
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+
+#define GLAD_GL
+#define GLAD_OPTION_GL_HEADER_ONLY
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef GLAD_PLATFORM_H_
+#define GLAD_PLATFORM_H_
+
+#ifndef GLAD_PLATFORM_WIN32
+ #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__MINGW32__)
+ #define GLAD_PLATFORM_WIN32 1
+ #else
+ #define GLAD_PLATFORM_WIN32 0
+ #endif
+#endif
+
+#ifndef GLAD_PLATFORM_APPLE
+ #ifdef __APPLE__
+ #define GLAD_PLATFORM_APPLE 1
+ #else
+ #define GLAD_PLATFORM_APPLE 0
+ #endif
+#endif
+
+#ifndef GLAD_PLATFORM_EMSCRIPTEN
+ #ifdef __EMSCRIPTEN__
+ #define GLAD_PLATFORM_EMSCRIPTEN 1
+ #else
+ #define GLAD_PLATFORM_EMSCRIPTEN 0
+ #endif
+#endif
+
+#ifndef GLAD_PLATFORM_UWP
+ #if defined(_MSC_VER) && !defined(GLAD_INTERNAL_HAVE_WINAPIFAMILY)
+ #ifdef __has_include
+ #if __has_include()
+ #define GLAD_INTERNAL_HAVE_WINAPIFAMILY 1
+ #endif
+ #elif _MSC_VER >= 1700 && !_USING_V110_SDK71_
+ #define GLAD_INTERNAL_HAVE_WINAPIFAMILY 1
+ #endif
+ #endif
+
+ #ifdef GLAD_INTERNAL_HAVE_WINAPIFAMILY
+ #include
+ #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
+ #define GLAD_PLATFORM_UWP 1
+ #endif
+ #endif
+
+ #ifndef GLAD_PLATFORM_UWP
+ #define GLAD_PLATFORM_UWP 0
+ #endif
+#endif
+
+#ifdef __GNUC__
+ #define GLAD_GNUC_EXTENSION __extension__
+#else
+ #define GLAD_GNUC_EXTENSION
+#endif
+
+#ifndef GLAD_API_CALL
+ #if defined(GLAD_API_CALL_EXPORT)
+ #if GLAD_PLATFORM_WIN32 || defined(__CYGWIN__)
+ #if defined(GLAD_API_CALL_EXPORT_BUILD)
+ #if defined(__GNUC__)
+ #define GLAD_API_CALL __attribute__ ((dllexport)) extern
+ #else
+ #define GLAD_API_CALL __declspec(dllexport) extern
+ #endif
+ #else
+ #if defined(__GNUC__)
+ #define GLAD_API_CALL __attribute__ ((dllimport)) extern
+ #else
+ #define GLAD_API_CALL __declspec(dllimport) extern
+ #endif
+ #endif
+ #elif defined(__GNUC__) && defined(GLAD_API_CALL_EXPORT_BUILD)
+ #define GLAD_API_CALL __attribute__ ((visibility ("default"))) extern
+ #else
+ #define GLAD_API_CALL extern
+ #endif
+ #else
+ #define GLAD_API_CALL extern
+ #endif
+#endif
+
+#ifdef APIENTRY
+ #define GLAD_API_PTR APIENTRY
+#elif GLAD_PLATFORM_WIN32
+ #define GLAD_API_PTR __stdcall
+#else
+ #define GLAD_API_PTR
+#endif
+
+#ifndef GLAPI
+#define GLAPI GLAD_API_CALL
+#endif
+
+#ifndef GLAPIENTRY
+#define GLAPIENTRY GLAD_API_PTR
+#endif
+
+#define GLAD_MAKE_VERSION(major, minor) (major * 10000 + minor)
+#define GLAD_VERSION_MAJOR(version) (version / 10000)
+#define GLAD_VERSION_MINOR(version) (version % 10000)
+
+#define GLAD_GENERATOR_VERSION "2.0.0-beta"
+
+typedef void (*GLADapiproc)(void);
+
+typedef GLADapiproc (*GLADloadfunc)(const char *name);
+typedef GLADapiproc (*GLADuserptrloadfunc)(void *userptr, const char *name);
+
+typedef void (*GLADprecallback)(const char *name, GLADapiproc apiproc, int len_args, ...);
+typedef void (*GLADpostcallback)(void *ret, const char *name, GLADapiproc apiproc, int len_args, ...);
+
+#endif /* GLAD_PLATFORM_H_ */
+
+#define GL_2D 0x0600
+#define GL_2_BYTES 0x1407
+#define GL_3D 0x0601
+#define GL_3D_COLOR 0x0602
+#define GL_3D_COLOR_TEXTURE 0x0603
+#define GL_3_BYTES 0x1408
+#define GL_4D_COLOR_TEXTURE 0x0604
+#define GL_4_BYTES 0x1409
+#define GL_ACCUM 0x0100
+#define GL_ACCUM_ALPHA_BITS 0x0D5B
+#define GL_ACCUM_BLUE_BITS 0x0D5A
+#define GL_ACCUM_BUFFER_BIT 0x00000200
+#define GL_ACCUM_CLEAR_VALUE 0x0B80
+#define GL_ACCUM_GREEN_BITS 0x0D59
+#define GL_ACCUM_RED_BITS 0x0D58
+#define GL_ACTIVE_ATTRIBUTES 0x8B89
+#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
+#define GL_ACTIVE_TEXTURE 0x84E0
+#define GL_ACTIVE_UNIFORMS 0x8B86
+#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36
+#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35
+#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
+#define GL_ADD 0x0104
+#define GL_ADD_SIGNED 0x8574
+#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
+#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
+#define GL_ALL_ATTRIB_BITS 0xFFFFFFFF
+#define GL_ALPHA 0x1906
+#define GL_ALPHA12 0x803D
+#define GL_ALPHA16 0x803E
+#define GL_ALPHA4 0x803B
+#define GL_ALPHA8 0x803C
+#define GL_ALPHA_BIAS 0x0D1D
+#define GL_ALPHA_BITS 0x0D55
+#define GL_ALPHA_INTEGER 0x8D97
+#define GL_ALPHA_SCALE 0x0D1C
+#define GL_ALPHA_TEST 0x0BC0
+#define GL_ALPHA_TEST_FUNC 0x0BC1
+#define GL_ALPHA_TEST_REF 0x0BC2
+#define GL_ALREADY_SIGNALED 0x911A
+#define GL_ALWAYS 0x0207
+#define GL_AMBIENT 0x1200
+#define GL_AMBIENT_AND_DIFFUSE 0x1602
+#define GL_AND 0x1501
+#define GL_AND_INVERTED 0x1504
+#define GL_AND_REVERSE 0x1502
+#define GL_ANY_SAMPLES_PASSED 0x8C2F
+#define GL_ARRAY_BUFFER 0x8892
+#define GL_ARRAY_BUFFER_BINDING 0x8894
+#define GL_ATTACHED_SHADERS 0x8B85
+#define GL_ATTRIB_STACK_DEPTH 0x0BB0
+#define GL_AUTO_NORMAL 0x0D80
+#define GL_AUX0 0x0409
+#define GL_AUX1 0x040A
+#define GL_AUX2 0x040B
+#define GL_AUX3 0x040C
+#define GL_AUX_BUFFERS 0x0C00
+#define GL_BACK 0x0405
+#define GL_BACK_LEFT 0x0402
+#define GL_BACK_RIGHT 0x0403
+#define GL_BGR 0x80E0
+#define GL_BGRA 0x80E1
+#define GL_BGRA_INTEGER 0x8D9B
+#define GL_BGR_INTEGER 0x8D9A
+#define GL_BITMAP 0x1A00
+#define GL_BITMAP_TOKEN 0x0704
+#define GL_BLEND 0x0BE2
+#define GL_BLEND_COLOR 0x8005
+#define GL_BLEND_DST 0x0BE0
+#define GL_BLEND_DST_ALPHA 0x80CA
+#define GL_BLEND_DST_RGB 0x80C8
+#define GL_BLEND_EQUATION 0x8009
+#define GL_BLEND_EQUATION_ALPHA 0x883D
+#define GL_BLEND_EQUATION_RGB 0x8009
+#define GL_BLEND_SRC 0x0BE1
+#define GL_BLEND_SRC_ALPHA 0x80CB
+#define GL_BLEND_SRC_RGB 0x80C9
+#define GL_BLUE 0x1905
+#define GL_BLUE_BIAS 0x0D1B
+#define GL_BLUE_BITS 0x0D54
+#define GL_BLUE_INTEGER 0x8D96
+#define GL_BLUE_SCALE 0x0D1A
+#define GL_BOOL 0x8B56
+#define GL_BOOL_VEC2 0x8B57
+#define GL_BOOL_VEC3 0x8B58
+#define GL_BOOL_VEC4 0x8B59
+#define GL_BUFFER 0x82E0
+#define GL_BUFFER_ACCESS 0x88BB
+#define GL_BUFFER_ACCESS_FLAGS 0x911F
+#define GL_BUFFER_MAPPED 0x88BC
+#define GL_BUFFER_MAP_LENGTH 0x9120
+#define GL_BUFFER_MAP_OFFSET 0x9121
+#define GL_BUFFER_MAP_POINTER 0x88BD
+#define GL_BUFFER_SIZE 0x8764
+#define GL_BUFFER_USAGE 0x8765
+#define GL_BYTE 0x1400
+#define GL_C3F_V3F 0x2A24
+#define GL_C4F_N3F_V3F 0x2A26
+#define GL_C4UB_V2F 0x2A22
+#define GL_C4UB_V3F 0x2A23
+#define GL_CCW 0x0901
+#define GL_CLAMP 0x2900
+#define GL_CLAMP_FRAGMENT_COLOR 0x891B
+#define GL_CLAMP_READ_COLOR 0x891C
+#define GL_CLAMP_TO_BORDER 0x812D
+#define GL_CLAMP_TO_EDGE 0x812F
+#define GL_CLAMP_VERTEX_COLOR 0x891A
+#define GL_CLEAR 0x1500
+#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1
+#define GL_CLIENT_ALL_ATTRIB_BITS 0xFFFFFFFF
+#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1
+#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001
+#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002
+#define GL_CLIP_DISTANCE0 0x3000
+#define GL_CLIP_DISTANCE1 0x3001
+#define GL_CLIP_DISTANCE2 0x3002
+#define GL_CLIP_DISTANCE3 0x3003
+#define GL_CLIP_DISTANCE4 0x3004
+#define GL_CLIP_DISTANCE5 0x3005
+#define GL_CLIP_DISTANCE6 0x3006
+#define GL_CLIP_DISTANCE7 0x3007
+#define GL_CLIP_PLANE0 0x3000
+#define GL_CLIP_PLANE1 0x3001
+#define GL_CLIP_PLANE2 0x3002
+#define GL_CLIP_PLANE3 0x3003
+#define GL_CLIP_PLANE4 0x3004
+#define GL_CLIP_PLANE5 0x3005
+#define GL_COEFF 0x0A00
+#define GL_COLOR 0x1800
+#define GL_COLOR_ARRAY 0x8076
+#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898
+#define GL_COLOR_ARRAY_POINTER 0x8090
+#define GL_COLOR_ARRAY_SIZE 0x8081
+#define GL_COLOR_ARRAY_STRIDE 0x8083
+#define GL_COLOR_ARRAY_TYPE 0x8082
+#define GL_COLOR_ATTACHMENT0 0x8CE0
+#define GL_COLOR_ATTACHMENT1 0x8CE1
+#define GL_COLOR_ATTACHMENT10 0x8CEA
+#define GL_COLOR_ATTACHMENT11 0x8CEB
+#define GL_COLOR_ATTACHMENT12 0x8CEC
+#define GL_COLOR_ATTACHMENT13 0x8CED
+#define GL_COLOR_ATTACHMENT14 0x8CEE
+#define GL_COLOR_ATTACHMENT15 0x8CEF
+#define GL_COLOR_ATTACHMENT16 0x8CF0
+#define GL_COLOR_ATTACHMENT17 0x8CF1
+#define GL_COLOR_ATTACHMENT18 0x8CF2
+#define GL_COLOR_ATTACHMENT19 0x8CF3
+#define GL_COLOR_ATTACHMENT2 0x8CE2
+#define GL_COLOR_ATTACHMENT20 0x8CF4
+#define GL_COLOR_ATTACHMENT21 0x8CF5
+#define GL_COLOR_ATTACHMENT22 0x8CF6
+#define GL_COLOR_ATTACHMENT23 0x8CF7
+#define GL_COLOR_ATTACHMENT24 0x8CF8
+#define GL_COLOR_ATTACHMENT25 0x8CF9
+#define GL_COLOR_ATTACHMENT26 0x8CFA
+#define GL_COLOR_ATTACHMENT27 0x8CFB
+#define GL_COLOR_ATTACHMENT28 0x8CFC
+#define GL_COLOR_ATTACHMENT29 0x8CFD
+#define GL_COLOR_ATTACHMENT3 0x8CE3
+#define GL_COLOR_ATTACHMENT30 0x8CFE
+#define GL_COLOR_ATTACHMENT31 0x8CFF
+#define GL_COLOR_ATTACHMENT4 0x8CE4
+#define GL_COLOR_ATTACHMENT5 0x8CE5
+#define GL_COLOR_ATTACHMENT6 0x8CE6
+#define GL_COLOR_ATTACHMENT7 0x8CE7
+#define GL_COLOR_ATTACHMENT8 0x8CE8
+#define GL_COLOR_ATTACHMENT9 0x8CE9
+#define GL_COLOR_BUFFER_BIT 0x00004000
+#define GL_COLOR_CLEAR_VALUE 0x0C22
+#define GL_COLOR_INDEX 0x1900
+#define GL_COLOR_INDEXES 0x1603
+#define GL_COLOR_LOGIC_OP 0x0BF2
+#define GL_COLOR_MATERIAL 0x0B57
+#define GL_COLOR_MATERIAL_FACE 0x0B55
+#define GL_COLOR_MATERIAL_PARAMETER 0x0B56
+#define GL_COLOR_SUM 0x8458
+#define GL_COLOR_WRITEMASK 0x0C23
+#define GL_COMBINE 0x8570
+#define GL_COMBINE_ALPHA 0x8572
+#define GL_COMBINE_RGB 0x8571
+#define GL_COMPARE_REF_TO_TEXTURE 0x884E
+#define GL_COMPARE_R_TO_TEXTURE 0x884E
+#define GL_COMPILE 0x1300
+#define GL_COMPILE_AND_EXECUTE 0x1301
+#define GL_COMPILE_STATUS 0x8B81
+#define GL_COMPRESSED_ALPHA 0x84E9
+#define GL_COMPRESSED_INTENSITY 0x84EC
+#define GL_COMPRESSED_LUMINANCE 0x84EA
+#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB
+#define GL_COMPRESSED_RED 0x8225
+#define GL_COMPRESSED_RED_RGTC1 0x8DBB
+#define GL_COMPRESSED_RG 0x8226
+#define GL_COMPRESSED_RGB 0x84ED
+#define GL_COMPRESSED_RGBA 0x84EE
+#define GL_COMPRESSED_RG_RGTC2 0x8DBD
+#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC
+#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE
+#define GL_COMPRESSED_SLUMINANCE 0x8C4A
+#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B
+#define GL_COMPRESSED_SRGB 0x8C48
+#define GL_COMPRESSED_SRGB_ALPHA 0x8C49
+#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
+#define GL_CONDITION_SATISFIED 0x911C
+#define GL_CONSTANT 0x8576
+#define GL_CONSTANT_ALPHA 0x8003
+#define GL_CONSTANT_ATTENUATION 0x1207
+#define GL_CONSTANT_COLOR 0x8001
+#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002
+#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001
+#define GL_CONTEXT_FLAGS 0x821E
+#define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002
+#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x00000001
+#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004
+#define GL_CONTEXT_PROFILE_MASK 0x9126
+#define GL_COORD_REPLACE 0x8862
+#define GL_COPY 0x1503
+#define GL_COPY_INVERTED 0x150C
+#define GL_COPY_PIXEL_TOKEN 0x0706
+#define GL_COPY_READ_BUFFER 0x8F36
+#define GL_COPY_WRITE_BUFFER 0x8F37
+#define GL_CULL_FACE 0x0B44
+#define GL_CULL_FACE_MODE 0x0B45
+#define GL_CURRENT_BIT 0x00000001
+#define GL_CURRENT_COLOR 0x0B00
+#define GL_CURRENT_FOG_COORD 0x8453
+#define GL_CURRENT_FOG_COORDINATE 0x8453
+#define GL_CURRENT_INDEX 0x0B01
+#define GL_CURRENT_NORMAL 0x0B02
+#define GL_CURRENT_PROGRAM 0x8B8D
+#define GL_CURRENT_QUERY 0x8865
+#define GL_CURRENT_RASTER_COLOR 0x0B04
+#define GL_CURRENT_RASTER_DISTANCE 0x0B09
+#define GL_CURRENT_RASTER_INDEX 0x0B05
+#define GL_CURRENT_RASTER_POSITION 0x0B07
+#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08
+#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F
+#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06
+#define GL_CURRENT_SECONDARY_COLOR 0x8459
+#define GL_CURRENT_TEXTURE_COORDS 0x0B03
+#define GL_CURRENT_VERTEX_ATTRIB 0x8626
+#define GL_CW 0x0900
+#define GL_DEBUG_CALLBACK_FUNCTION 0x8244
+#define GL_DEBUG_CALLBACK_USER_PARAM 0x8245
+#define GL_DEBUG_GROUP_STACK_DEPTH 0x826D
+#define GL_DEBUG_LOGGED_MESSAGES 0x9145
+#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243
+#define GL_DEBUG_OUTPUT 0x92E0
+#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242
+#define GL_DEBUG_SEVERITY_HIGH 0x9146
+#define GL_DEBUG_SEVERITY_LOW 0x9148
+#define GL_DEBUG_SEVERITY_MEDIUM 0x9147
+#define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B
+#define GL_DEBUG_SOURCE_API 0x8246
+#define GL_DEBUG_SOURCE_APPLICATION 0x824A
+#define GL_DEBUG_SOURCE_OTHER 0x824B
+#define GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248
+#define GL_DEBUG_SOURCE_THIRD_PARTY 0x8249
+#define GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247
+#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D
+#define GL_DEBUG_TYPE_ERROR 0x824C
+#define GL_DEBUG_TYPE_MARKER 0x8268
+#define GL_DEBUG_TYPE_OTHER 0x8251
+#define GL_DEBUG_TYPE_PERFORMANCE 0x8250
+#define GL_DEBUG_TYPE_POP_GROUP 0x826A
+#define GL_DEBUG_TYPE_PORTABILITY 0x824F
+#define GL_DEBUG_TYPE_PUSH_GROUP 0x8269
+#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR 0x824E
+#define GL_DECAL 0x2101
+#define GL_DECR 0x1E03
+#define GL_DECR_WRAP 0x8508
+#define GL_DELETE_STATUS 0x8B80
+#define GL_DEPTH 0x1801
+#define GL_DEPTH24_STENCIL8 0x88F0
+#define GL_DEPTH32F_STENCIL8 0x8CAD
+#define GL_DEPTH_ATTACHMENT 0x8D00
+#define GL_DEPTH_BIAS 0x0D1F
+#define GL_DEPTH_BITS 0x0D56
+#define GL_DEPTH_BUFFER_BIT 0x00000100
+#define GL_DEPTH_CLAMP 0x864F
+#define GL_DEPTH_CLEAR_VALUE 0x0B73
+#define GL_DEPTH_COMPONENT 0x1902
+#define GL_DEPTH_COMPONENT16 0x81A5
+#define GL_DEPTH_COMPONENT24 0x81A6
+#define GL_DEPTH_COMPONENT32 0x81A7
+#define GL_DEPTH_COMPONENT32F 0x8CAC
+#define GL_DEPTH_FUNC 0x0B74
+#define GL_DEPTH_RANGE 0x0B70
+#define GL_DEPTH_SCALE 0x0D1E
+#define GL_DEPTH_STENCIL 0x84F9
+#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A
+#define GL_DEPTH_TEST 0x0B71
+#define GL_DEPTH_TEXTURE_MODE 0x884B
+#define GL_DEPTH_WRITEMASK 0x0B72
+#define GL_DIFFUSE 0x1201
+#define GL_DISPLAY_LIST 0x82E7
+#define GL_DITHER 0x0BD0
+#define GL_DOMAIN 0x0A02
+#define GL_DONT_CARE 0x1100
+#define GL_DOT3_RGB 0x86AE
+#define GL_DOT3_RGBA 0x86AF
+#define GL_DOUBLE 0x140A
+#define GL_DOUBLEBUFFER 0x0C32
+#define GL_DRAW_BUFFER 0x0C01
+#define GL_DRAW_BUFFER0 0x8825
+#define GL_DRAW_BUFFER1 0x8826
+#define GL_DRAW_BUFFER10 0x882F
+#define GL_DRAW_BUFFER11 0x8830
+#define GL_DRAW_BUFFER12 0x8831
+#define GL_DRAW_BUFFER13 0x8832
+#define GL_DRAW_BUFFER14 0x8833
+#define GL_DRAW_BUFFER15 0x8834
+#define GL_DRAW_BUFFER2 0x8827
+#define GL_DRAW_BUFFER3 0x8828
+#define GL_DRAW_BUFFER4 0x8829
+#define GL_DRAW_BUFFER5 0x882A
+#define GL_DRAW_BUFFER6 0x882B
+#define GL_DRAW_BUFFER7 0x882C
+#define GL_DRAW_BUFFER8 0x882D
+#define GL_DRAW_BUFFER9 0x882E
+#define GL_DRAW_FRAMEBUFFER 0x8CA9
+#define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6
+#define GL_DRAW_PIXEL_TOKEN 0x0705
+#define GL_DST_ALPHA 0x0304
+#define GL_DST_COLOR 0x0306
+#define GL_DYNAMIC_COPY 0x88EA
+#define GL_DYNAMIC_DRAW 0x88E8
+#define GL_DYNAMIC_READ 0x88E9
+#define GL_EDGE_FLAG 0x0B43
+#define GL_EDGE_FLAG_ARRAY 0x8079
+#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B
+#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093
+#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C
+#define GL_ELEMENT_ARRAY_BUFFER 0x8893
+#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
+#define GL_EMISSION 0x1600
+#define GL_ENABLE_BIT 0x00002000
+#define GL_EQUAL 0x0202
+#define GL_EQUIV 0x1509
+#define GL_EVAL_BIT 0x00010000
+#define GL_EXP 0x0800
+#define GL_EXP2 0x0801
+#define GL_EXTENSIONS 0x1F03
+#define GL_EYE_LINEAR 0x2400
+#define GL_EYE_PLANE 0x2502
+#define GL_FALSE 0
+#define GL_FASTEST 0x1101
+#define GL_FEEDBACK 0x1C01
+#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0
+#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1
+#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2
+#define GL_FILL 0x1B02
+#define GL_FIRST_VERTEX_CONVENTION 0x8E4D
+#define GL_FIXED_ONLY 0x891D
+#define GL_FLAT 0x1D00
+#define GL_FLOAT 0x1406
+#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD
+#define GL_FLOAT_MAT2 0x8B5A
+#define GL_FLOAT_MAT2x3 0x8B65
+#define GL_FLOAT_MAT2x4 0x8B66
+#define GL_FLOAT_MAT3 0x8B5B
+#define GL_FLOAT_MAT3x2 0x8B67
+#define GL_FLOAT_MAT3x4 0x8B68
+#define GL_FLOAT_MAT4 0x8B5C
+#define GL_FLOAT_MAT4x2 0x8B69
+#define GL_FLOAT_MAT4x3 0x8B6A
+#define GL_FLOAT_VEC2 0x8B50
+#define GL_FLOAT_VEC3 0x8B51
+#define GL_FLOAT_VEC4 0x8B52
+#define GL_FOG 0x0B60
+#define GL_FOG_BIT 0x00000080
+#define GL_FOG_COLOR 0x0B66
+#define GL_FOG_COORD 0x8451
+#define GL_FOG_COORDINATE 0x8451
+#define GL_FOG_COORDINATE_ARRAY 0x8457
+#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D
+#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456
+#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455
+#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454
+#define GL_FOG_COORDINATE_SOURCE 0x8450
+#define GL_FOG_COORD_ARRAY 0x8457
+#define GL_FOG_COORD_ARRAY_BUFFER_BINDING 0x889D
+#define GL_FOG_COORD_ARRAY_POINTER 0x8456
+#define GL_FOG_COORD_ARRAY_STRIDE 0x8455
+#define GL_FOG_COORD_ARRAY_TYPE 0x8454
+#define GL_FOG_COORD_SRC 0x8450
+#define GL_FOG_DENSITY 0x0B62
+#define GL_FOG_END 0x0B64
+#define GL_FOG_HINT 0x0C54
+#define GL_FOG_INDEX 0x0B61
+#define GL_FOG_MODE 0x0B65
+#define GL_FOG_START 0x0B63
+#define GL_FRAGMENT_DEPTH 0x8452
+#define GL_FRAGMENT_SHADER 0x8B30
+#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B
+#define GL_FRAMEBUFFER 0x8D40
+#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215
+#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214
+#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210
+#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211
+#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216
+#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213
+#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
+#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212
+#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
+#define GL_FRAMEBUFFER_BINDING 0x8CA6
+#define GL_FRAMEBUFFER_COMPLETE 0x8CD5
+#define GL_FRAMEBUFFER_DEFAULT 0x8218
+#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
+#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB
+#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8
+#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56
+#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC
+#define GL_FRAMEBUFFER_SRGB 0x8DB9
+#define GL_FRAMEBUFFER_UNDEFINED 0x8219
+#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
+#define GL_FRONT 0x0404
+#define GL_FRONT_AND_BACK 0x0408
+#define GL_FRONT_FACE 0x0B46
+#define GL_FRONT_LEFT 0x0400
+#define GL_FRONT_RIGHT 0x0401
+#define GL_FUNC_ADD 0x8006
+#define GL_FUNC_REVERSE_SUBTRACT 0x800B
+#define GL_FUNC_SUBTRACT 0x800A
+#define GL_GENERATE_MIPMAP 0x8191
+#define GL_GENERATE_MIPMAP_HINT 0x8192
+#define GL_GEOMETRY_INPUT_TYPE 0x8917
+#define GL_GEOMETRY_OUTPUT_TYPE 0x8918
+#define GL_GEOMETRY_SHADER 0x8DD9
+#define GL_GEOMETRY_VERTICES_OUT 0x8916
+#define GL_GEQUAL 0x0206
+#define GL_GREATER 0x0204
+#define GL_GREEN 0x1904
+#define GL_GREEN_BIAS 0x0D19
+#define GL_GREEN_BITS 0x0D53
+#define GL_GREEN_INTEGER 0x8D95
+#define GL_GREEN_SCALE 0x0D18
+#define GL_GUILTY_CONTEXT_RESET_ARB 0x8253
+#define GL_HALF_FLOAT 0x140B
+#define GL_HINT_BIT 0x00008000
+#define GL_INCR 0x1E02
+#define GL_INCR_WRAP 0x8507
+#define GL_INDEX 0x8222
+#define GL_INDEX_ARRAY 0x8077
+#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899
+#define GL_INDEX_ARRAY_POINTER 0x8091
+#define GL_INDEX_ARRAY_STRIDE 0x8086
+#define GL_INDEX_ARRAY_TYPE 0x8085
+#define GL_INDEX_BITS 0x0D51
+#define GL_INDEX_CLEAR_VALUE 0x0C20
+#define GL_INDEX_LOGIC_OP 0x0BF1
+#define GL_INDEX_MODE 0x0C30
+#define GL_INDEX_OFFSET 0x0D13
+#define GL_INDEX_SHIFT 0x0D12
+#define GL_INDEX_WRITEMASK 0x0C21
+#define GL_INFO_LOG_LENGTH 0x8B84
+#define GL_INNOCENT_CONTEXT_RESET_ARB 0x8254
+#define GL_INT 0x1404
+#define GL_INTENSITY 0x8049
+#define GL_INTENSITY12 0x804C
+#define GL_INTENSITY16 0x804D
+#define GL_INTENSITY4 0x804A
+#define GL_INTENSITY8 0x804B
+#define GL_INTERLEAVED_ATTRIBS 0x8C8C
+#define GL_INTERPOLATE 0x8575
+#define GL_INT_2_10_10_10_REV 0x8D9F
+#define GL_INT_SAMPLER_1D 0x8DC9
+#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE
+#define GL_INT_SAMPLER_2D 0x8DCA
+#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF
+#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109
+#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C
+#define GL_INT_SAMPLER_2D_RECT 0x8DCD
+#define GL_INT_SAMPLER_3D 0x8DCB
+#define GL_INT_SAMPLER_BUFFER 0x8DD0
+#define GL_INT_SAMPLER_CUBE 0x8DCC
+#define GL_INT_VEC2 0x8B53
+#define GL_INT_VEC3 0x8B54
+#define GL_INT_VEC4 0x8B55
+#define GL_INVALID_ENUM 0x0500
+#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
+#define GL_INVALID_INDEX 0xFFFFFFFF
+#define GL_INVALID_OPERATION 0x0502
+#define GL_INVALID_VALUE 0x0501
+#define GL_INVERT 0x150A
+#define GL_KEEP 0x1E00
+#define GL_LAST_VERTEX_CONVENTION 0x8E4E
+#define GL_LEFT 0x0406
+#define GL_LEQUAL 0x0203
+#define GL_LESS 0x0201
+#define GL_LIGHT0 0x4000
+#define GL_LIGHT1 0x4001
+#define GL_LIGHT2 0x4002
+#define GL_LIGHT3 0x4003
+#define GL_LIGHT4 0x4004
+#define GL_LIGHT5 0x4005
+#define GL_LIGHT6 0x4006
+#define GL_LIGHT7 0x4007
+#define GL_LIGHTING 0x0B50
+#define GL_LIGHTING_BIT 0x00000040
+#define GL_LIGHT_MODEL_AMBIENT 0x0B53
+#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8
+#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51
+#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52
+#define GL_LINE 0x1B01
+#define GL_LINEAR 0x2601
+#define GL_LINEAR_ATTENUATION 0x1208
+#define GL_LINEAR_MIPMAP_LINEAR 0x2703
+#define GL_LINEAR_MIPMAP_NEAREST 0x2701
+#define GL_LINES 0x0001
+#define GL_LINES_ADJACENCY 0x000A
+#define GL_LINE_BIT 0x00000004
+#define GL_LINE_LOOP 0x0002
+#define GL_LINE_RESET_TOKEN 0x0707
+#define GL_LINE_SMOOTH 0x0B20
+#define GL_LINE_SMOOTH_HINT 0x0C52
+#define GL_LINE_STIPPLE 0x0B24
+#define GL_LINE_STIPPLE_PATTERN 0x0B25
+#define GL_LINE_STIPPLE_REPEAT 0x0B26
+#define GL_LINE_STRIP 0x0003
+#define GL_LINE_STRIP_ADJACENCY 0x000B
+#define GL_LINE_TOKEN 0x0702
+#define GL_LINE_WIDTH 0x0B21
+#define GL_LINE_WIDTH_GRANULARITY 0x0B23
+#define GL_LINE_WIDTH_RANGE 0x0B22
+#define GL_LINK_STATUS 0x8B82
+#define GL_LIST_BASE 0x0B32
+#define GL_LIST_BIT 0x00020000
+#define GL_LIST_INDEX 0x0B33
+#define GL_LIST_MODE 0x0B30
+#define GL_LOAD 0x0101
+#define GL_LOGIC_OP 0x0BF1
+#define GL_LOGIC_OP_MODE 0x0BF0
+#define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252
+#define GL_LOWER_LEFT 0x8CA1
+#define GL_LUMINANCE 0x1909
+#define GL_LUMINANCE12 0x8041
+#define GL_LUMINANCE12_ALPHA12 0x8047
+#define GL_LUMINANCE12_ALPHA4 0x8046
+#define GL_LUMINANCE16 0x8042
+#define GL_LUMINANCE16_ALPHA16 0x8048
+#define GL_LUMINANCE4 0x803F
+#define GL_LUMINANCE4_ALPHA4 0x8043
+#define GL_LUMINANCE6_ALPHA2 0x8044
+#define GL_LUMINANCE8 0x8040
+#define GL_LUMINANCE8_ALPHA8 0x8045
+#define GL_LUMINANCE_ALPHA 0x190A
+#define GL_MAJOR_VERSION 0x821B
+#define GL_MAP1_COLOR_4 0x0D90
+#define GL_MAP1_GRID_DOMAIN 0x0DD0
+#define GL_MAP1_GRID_SEGMENTS 0x0DD1
+#define GL_MAP1_INDEX 0x0D91
+#define GL_MAP1_NORMAL 0x0D92
+#define GL_MAP1_TEXTURE_COORD_1 0x0D93
+#define GL_MAP1_TEXTURE_COORD_2 0x0D94
+#define GL_MAP1_TEXTURE_COORD_3 0x0D95
+#define GL_MAP1_TEXTURE_COORD_4 0x0D96
+#define GL_MAP1_VERTEX_3 0x0D97
+#define GL_MAP1_VERTEX_4 0x0D98
+#define GL_MAP2_COLOR_4 0x0DB0
+#define GL_MAP2_GRID_DOMAIN 0x0DD2
+#define GL_MAP2_GRID_SEGMENTS 0x0DD3
+#define GL_MAP2_INDEX 0x0DB1
+#define GL_MAP2_NORMAL 0x0DB2
+#define GL_MAP2_TEXTURE_COORD_1 0x0DB3
+#define GL_MAP2_TEXTURE_COORD_2 0x0DB4
+#define GL_MAP2_TEXTURE_COORD_3 0x0DB5
+#define GL_MAP2_TEXTURE_COORD_4 0x0DB6
+#define GL_MAP2_VERTEX_3 0x0DB7
+#define GL_MAP2_VERTEX_4 0x0DB8
+#define GL_MAP_COLOR 0x0D10
+#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010
+#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008
+#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004
+#define GL_MAP_READ_BIT 0x0001
+#define GL_MAP_STENCIL 0x0D11
+#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020
+#define GL_MAP_WRITE_BIT 0x0002
+#define GL_MATRIX_MODE 0x0BA0
+#define GL_MAX 0x8008
+#define GL_MAX_3D_TEXTURE_SIZE 0x8073
+#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF
+#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35
+#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B
+#define GL_MAX_CLIP_DISTANCES 0x0D32
+#define GL_MAX_CLIP_PLANES 0x0D32
+#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF
+#define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E
+#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33
+#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32
+#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
+#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E
+#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
+#define GL_MAX_DEBUG_GROUP_STACK_DEPTH 0x826C
+#define GL_MAX_DEBUG_LOGGED_MESSAGES 0x9144
+#define GL_MAX_DEBUG_MESSAGE_LENGTH 0x9143
+#define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F
+#define GL_MAX_DRAW_BUFFERS 0x8824
+#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC
+#define GL_MAX_ELEMENTS_INDICES 0x80E9
+#define GL_MAX_ELEMENTS_VERTICES 0x80E8
+#define GL_MAX_EVAL_ORDER 0x0D30
+#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125
+#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D
+#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49
+#define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123
+#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124
+#define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0
+#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29
+#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1
+#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C
+#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF
+#define GL_MAX_INTEGER_SAMPLES 0x9110
+#define GL_MAX_LABEL_LENGTH 0x82E8
+#define GL_MAX_LIGHTS 0x0D31
+#define GL_MAX_LIST_NESTING 0x0B31
+#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36
+#define GL_MAX_NAME_STACK_DEPTH 0x0D37
+#define GL_MAX_PIXEL_MAP_TABLE 0x0D34
+#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905
+#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38
+#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8
+#define GL_MAX_RENDERBUFFER_SIZE 0x84E8
+#define GL_MAX_SAMPLES 0x8D57
+#define GL_MAX_SAMPLE_MASK_WORDS 0x8E59
+#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111
+#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B
+#define GL_MAX_TEXTURE_COORDS 0x8871
+#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
+#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD
+#define GL_MAX_TEXTURE_SIZE 0x0D33
+#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39
+#define GL_MAX_TEXTURE_UNITS 0x84E2
+#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A
+#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B
+#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80
+#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30
+#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F
+#define GL_MAX_VARYING_COMPONENTS 0x8B4B
+#define GL_MAX_VARYING_FLOATS 0x8B4B
+#define GL_MAX_VERTEX_ATTRIBS 0x8869
+#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122
+#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
+#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B
+#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A
+#define GL_MAX_VIEWPORT_DIMS 0x0D3A
+#define GL_MIN 0x8007
+#define GL_MINOR_VERSION 0x821C
+#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904
+#define GL_MIRRORED_REPEAT 0x8370
+#define GL_MODELVIEW 0x1700
+#define GL_MODELVIEW_MATRIX 0x0BA6
+#define GL_MODELVIEW_STACK_DEPTH 0x0BA3
+#define GL_MODULATE 0x2100
+#define GL_MULT 0x0103
+#define GL_MULTISAMPLE 0x809D
+#define GL_MULTISAMPLE_ARB 0x809D
+#define GL_MULTISAMPLE_BIT 0x20000000
+#define GL_MULTISAMPLE_BIT_ARB 0x20000000
+#define GL_N3F_V3F 0x2A25
+#define GL_NAME_STACK_DEPTH 0x0D70
+#define GL_NAND 0x150E
+#define GL_NEAREST 0x2600
+#define GL_NEAREST_MIPMAP_LINEAR 0x2702
+#define GL_NEAREST_MIPMAP_NEAREST 0x2700
+#define GL_NEVER 0x0200
+#define GL_NICEST 0x1102
+#define GL_NONE 0
+#define GL_NOOP 0x1505
+#define GL_NOR 0x1508
+#define GL_NORMALIZE 0x0BA1
+#define GL_NORMAL_ARRAY 0x8075
+#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897
+#define GL_NORMAL_ARRAY_POINTER 0x808F
+#define GL_NORMAL_ARRAY_STRIDE 0x807F
+#define GL_NORMAL_ARRAY_TYPE 0x807E
+#define GL_NORMAL_MAP 0x8511
+#define GL_NOTEQUAL 0x0205
+#define GL_NO_ERROR 0
+#define GL_NO_RESET_NOTIFICATION_ARB 0x8261
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
+#define GL_NUM_EXTENSIONS 0x821D
+#define GL_OBJECT_LINEAR 0x2401
+#define GL_OBJECT_PLANE 0x2501
+#define GL_OBJECT_TYPE 0x9112
+#define GL_ONE 1
+#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
+#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
+#define GL_ONE_MINUS_DST_ALPHA 0x0305
+#define GL_ONE_MINUS_DST_COLOR 0x0307
+#define GL_ONE_MINUS_SRC1_ALPHA 0x88FB
+#define GL_ONE_MINUS_SRC1_COLOR 0x88FA
+#define GL_ONE_MINUS_SRC_ALPHA 0x0303
+#define GL_ONE_MINUS_SRC_COLOR 0x0301
+#define GL_OPERAND0_ALPHA 0x8598
+#define GL_OPERAND0_RGB 0x8590
+#define GL_OPERAND1_ALPHA 0x8599
+#define GL_OPERAND1_RGB 0x8591
+#define GL_OPERAND2_ALPHA 0x859A
+#define GL_OPERAND2_RGB 0x8592
+#define GL_OR 0x1507
+#define GL_ORDER 0x0A01
+#define GL_OR_INVERTED 0x150D
+#define GL_OR_REVERSE 0x150B
+#define GL_OUT_OF_MEMORY 0x0505
+#define GL_PACK_ALIGNMENT 0x0D05
+#define GL_PACK_IMAGE_HEIGHT 0x806C
+#define GL_PACK_LSB_FIRST 0x0D01
+#define GL_PACK_ROW_LENGTH 0x0D02
+#define GL_PACK_SKIP_IMAGES 0x806B
+#define GL_PACK_SKIP_PIXELS 0x0D04
+#define GL_PACK_SKIP_ROWS 0x0D03
+#define GL_PACK_SWAP_BYTES 0x0D00
+#define GL_PASS_THROUGH_TOKEN 0x0700
+#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50
+#define GL_PIXEL_MAP_A_TO_A 0x0C79
+#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9
+#define GL_PIXEL_MAP_B_TO_B 0x0C78
+#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8
+#define GL_PIXEL_MAP_G_TO_G 0x0C77
+#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7
+#define GL_PIXEL_MAP_I_TO_A 0x0C75
+#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5
+#define GL_PIXEL_MAP_I_TO_B 0x0C74
+#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4
+#define GL_PIXEL_MAP_I_TO_G 0x0C73
+#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3
+#define GL_PIXEL_MAP_I_TO_I 0x0C70
+#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0
+#define GL_PIXEL_MAP_I_TO_R 0x0C72
+#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2
+#define GL_PIXEL_MAP_R_TO_R 0x0C76
+#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6
+#define GL_PIXEL_MAP_S_TO_S 0x0C71
+#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1
+#define GL_PIXEL_MODE_BIT 0x00000020
+#define GL_PIXEL_PACK_BUFFER 0x88EB
+#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED
+#define GL_PIXEL_UNPACK_BUFFER 0x88EC
+#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF
+#define GL_POINT 0x1B00
+#define GL_POINTS 0x0000
+#define GL_POINT_BIT 0x00000002
+#define GL_POINT_DISTANCE_ATTENUATION 0x8129
+#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128
+#define GL_POINT_SIZE 0x0B11
+#define GL_POINT_SIZE_GRANULARITY 0x0B13
+#define GL_POINT_SIZE_MAX 0x8127
+#define GL_POINT_SIZE_MIN 0x8126
+#define GL_POINT_SIZE_RANGE 0x0B12
+#define GL_POINT_SMOOTH 0x0B10
+#define GL_POINT_SMOOTH_HINT 0x0C51
+#define GL_POINT_SPRITE 0x8861
+#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0
+#define GL_POINT_TOKEN 0x0701
+#define GL_POLYGON 0x0009
+#define GL_POLYGON_BIT 0x00000008
+#define GL_POLYGON_MODE 0x0B40
+#define GL_POLYGON_OFFSET_FACTOR 0x8038
+#define GL_POLYGON_OFFSET_FILL 0x8037
+#define GL_POLYGON_OFFSET_LINE 0x2A02
+#define GL_POLYGON_OFFSET_POINT 0x2A01
+#define GL_POLYGON_OFFSET_UNITS 0x2A00
+#define GL_POLYGON_SMOOTH 0x0B41
+#define GL_POLYGON_SMOOTH_HINT 0x0C53
+#define GL_POLYGON_STIPPLE 0x0B42
+#define GL_POLYGON_STIPPLE_BIT 0x00000010
+#define GL_POLYGON_TOKEN 0x0703
+#define GL_POSITION 0x1203
+#define GL_PREVIOUS 0x8578
+#define GL_PRIMARY_COLOR 0x8577
+#define GL_PRIMITIVES_GENERATED 0x8C87
+#define GL_PRIMITIVE_RESTART 0x8F9D
+#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E
+#define GL_PROGRAM 0x82E2
+#define GL_PROGRAM_PIPELINE 0x82E4
+#define GL_PROGRAM_POINT_SIZE 0x8642
+#define GL_PROJECTION 0x1701
+#define GL_PROJECTION_MATRIX 0x0BA7
+#define GL_PROJECTION_STACK_DEPTH 0x0BA4
+#define GL_PROVOKING_VERTEX 0x8E4F
+#define GL_PROXY_TEXTURE_1D 0x8063
+#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19
+#define GL_PROXY_TEXTURE_2D 0x8064
+#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B
+#define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101
+#define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103
+#define GL_PROXY_TEXTURE_3D 0x8070
+#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B
+#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7
+#define GL_Q 0x2003
+#define GL_QUADRATIC_ATTENUATION 0x1209
+#define GL_QUADS 0x0007
+#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C
+#define GL_QUAD_STRIP 0x0008
+#define GL_QUERY 0x82E3
+#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16
+#define GL_QUERY_BY_REGION_WAIT 0x8E15
+#define GL_QUERY_COUNTER_BITS 0x8864
+#define GL_QUERY_NO_WAIT 0x8E14
+#define GL_QUERY_RESULT 0x8866
+#define GL_QUERY_RESULT_AVAILABLE 0x8867
+#define GL_QUERY_WAIT 0x8E13
+#define GL_R 0x2002
+#define GL_R11F_G11F_B10F 0x8C3A
+#define GL_R16 0x822A
+#define GL_R16F 0x822D
+#define GL_R16I 0x8233
+#define GL_R16UI 0x8234
+#define GL_R16_SNORM 0x8F98
+#define GL_R32F 0x822E
+#define GL_R32I 0x8235
+#define GL_R32UI 0x8236
+#define GL_R3_G3_B2 0x2A10
+#define GL_R8 0x8229
+#define GL_R8I 0x8231
+#define GL_R8UI 0x8232
+#define GL_R8_SNORM 0x8F94
+#define GL_RASTERIZER_DISCARD 0x8C89
+#define GL_READ_BUFFER 0x0C02
+#define GL_READ_FRAMEBUFFER 0x8CA8
+#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA
+#define GL_READ_ONLY 0x88B8
+#define GL_READ_WRITE 0x88BA
+#define GL_RED 0x1903
+#define GL_RED_BIAS 0x0D15
+#define GL_RED_BITS 0x0D52
+#define GL_RED_INTEGER 0x8D94
+#define GL_RED_SCALE 0x0D14
+#define GL_REFLECTION_MAP 0x8512
+#define GL_RENDER 0x1C00
+#define GL_RENDERBUFFER 0x8D41
+#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
+#define GL_RENDERBUFFER_BINDING 0x8CA7
+#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52
+#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
+#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51
+#define GL_RENDERBUFFER_HEIGHT 0x8D43
+#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
+#define GL_RENDERBUFFER_RED_SIZE 0x8D50
+#define GL_RENDERBUFFER_SAMPLES 0x8CAB
+#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
+#define GL_RENDERBUFFER_WIDTH 0x8D42
+#define GL_RENDERER 0x1F01
+#define GL_RENDER_MODE 0x0C40
+#define GL_REPEAT 0x2901
+#define GL_REPLACE 0x1E01
+#define GL_RESCALE_NORMAL 0x803A
+#define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
+#define GL_RETURN 0x0102
+#define GL_RG 0x8227
+#define GL_RG16 0x822C
+#define GL_RG16F 0x822F
+#define GL_RG16I 0x8239
+#define GL_RG16UI 0x823A
+#define GL_RG16_SNORM 0x8F99
+#define GL_RG32F 0x8230
+#define GL_RG32I 0x823B
+#define GL_RG32UI 0x823C
+#define GL_RG8 0x822B
+#define GL_RG8I 0x8237
+#define GL_RG8UI 0x8238
+#define GL_RG8_SNORM 0x8F95
+#define GL_RGB 0x1907
+#define GL_RGB10 0x8052
+#define GL_RGB10_A2 0x8059
+#define GL_RGB10_A2UI 0x906F
+#define GL_RGB12 0x8053
+#define GL_RGB16 0x8054
+#define GL_RGB16F 0x881B
+#define GL_RGB16I 0x8D89
+#define GL_RGB16UI 0x8D77
+#define GL_RGB16_SNORM 0x8F9A
+#define GL_RGB32F 0x8815
+#define GL_RGB32I 0x8D83
+#define GL_RGB32UI 0x8D71
+#define GL_RGB4 0x804F
+#define GL_RGB5 0x8050
+#define GL_RGB5_A1 0x8057
+#define GL_RGB8 0x8051
+#define GL_RGB8I 0x8D8F
+#define GL_RGB8UI 0x8D7D
+#define GL_RGB8_SNORM 0x8F96
+#define GL_RGB9_E5 0x8C3D
+#define GL_RGBA 0x1908
+#define GL_RGBA12 0x805A
+#define GL_RGBA16 0x805B
+#define GL_RGBA16F 0x881A
+#define GL_RGBA16I 0x8D88
+#define GL_RGBA16UI 0x8D76
+#define GL_RGBA16_SNORM 0x8F9B
+#define GL_RGBA2 0x8055
+#define GL_RGBA32F 0x8814
+#define GL_RGBA32I 0x8D82
+#define GL_RGBA32UI 0x8D70
+#define GL_RGBA4 0x8056
+#define GL_RGBA8 0x8058
+#define GL_RGBA8I 0x8D8E
+#define GL_RGBA8UI 0x8D7C
+#define GL_RGBA8_SNORM 0x8F97
+#define GL_RGBA_INTEGER 0x8D99
+#define GL_RGBA_MODE 0x0C31
+#define GL_RGB_INTEGER 0x8D98
+#define GL_RGB_SCALE 0x8573
+#define GL_RG_INTEGER 0x8228
+#define GL_RIGHT 0x0407
+#define GL_S 0x2000
+#define GL_SAMPLER 0x82E6
+#define GL_SAMPLER_1D 0x8B5D
+#define GL_SAMPLER_1D_ARRAY 0x8DC0
+#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3
+#define GL_SAMPLER_1D_SHADOW 0x8B61
+#define GL_SAMPLER_2D 0x8B5E
+#define GL_SAMPLER_2D_ARRAY 0x8DC1
+#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4
+#define GL_SAMPLER_2D_MULTISAMPLE 0x9108
+#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B
+#define GL_SAMPLER_2D_RECT 0x8B63
+#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64
+#define GL_SAMPLER_2D_SHADOW 0x8B62
+#define GL_SAMPLER_3D 0x8B5F
+#define GL_SAMPLER_BINDING 0x8919
+#define GL_SAMPLER_BUFFER 0x8DC2
+#define GL_SAMPLER_CUBE 0x8B60
+#define GL_SAMPLER_CUBE_SHADOW 0x8DC5
+#define GL_SAMPLES 0x80A9
+#define GL_SAMPLES_ARB 0x80A9
+#define GL_SAMPLES_PASSED 0x8914
+#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
+#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE 0x809F
+#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F
+#define GL_SAMPLE_BUFFERS 0x80A8
+#define GL_SAMPLE_BUFFERS_ARB 0x80A8
+#define GL_SAMPLE_COVERAGE 0x80A0
+#define GL_SAMPLE_COVERAGE_ARB 0x80A0
+#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
+#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB
+#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
+#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA
+#define GL_SAMPLE_MASK 0x8E51
+#define GL_SAMPLE_MASK_VALUE 0x8E52
+#define GL_SAMPLE_POSITION 0x8E50
+#define GL_SCISSOR_BIT 0x00080000
+#define GL_SCISSOR_BOX 0x0C10
+#define GL_SCISSOR_TEST 0x0C11
+#define GL_SECONDARY_COLOR_ARRAY 0x845E
+#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C
+#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D
+#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A
+#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C
+#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B
+#define GL_SELECT 0x1C02
+#define GL_SELECTION_BUFFER_POINTER 0x0DF3
+#define GL_SELECTION_BUFFER_SIZE 0x0DF4
+#define GL_SEPARATE_ATTRIBS 0x8C8D
+#define GL_SEPARATE_SPECULAR_COLOR 0x81FA
+#define GL_SET 0x150F
+#define GL_SHADER 0x82E1
+#define GL_SHADER_SOURCE_LENGTH 0x8B88
+#define GL_SHADER_TYPE 0x8B4F
+#define GL_SHADE_MODEL 0x0B54
+#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
+#define GL_SHININESS 0x1601
+#define GL_SHORT 0x1402
+#define GL_SIGNALED 0x9119
+#define GL_SIGNED_NORMALIZED 0x8F9C
+#define GL_SINGLE_COLOR 0x81F9
+#define GL_SLUMINANCE 0x8C46
+#define GL_SLUMINANCE8 0x8C47
+#define GL_SLUMINANCE8_ALPHA8 0x8C45
+#define GL_SLUMINANCE_ALPHA 0x8C44
+#define GL_SMOOTH 0x1D01
+#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23
+#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
+#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13
+#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12
+#define GL_SOURCE0_ALPHA 0x8588
+#define GL_SOURCE0_RGB 0x8580
+#define GL_SOURCE1_ALPHA 0x8589
+#define GL_SOURCE1_RGB 0x8581
+#define GL_SOURCE2_ALPHA 0x858A
+#define GL_SOURCE2_RGB 0x8582
+#define GL_SPECULAR 0x1202
+#define GL_SPHERE_MAP 0x2402
+#define GL_SPOT_CUTOFF 0x1206
+#define GL_SPOT_DIRECTION 0x1204
+#define GL_SPOT_EXPONENT 0x1205
+#define GL_SRC0_ALPHA 0x8588
+#define GL_SRC0_RGB 0x8580
+#define GL_SRC1_ALPHA 0x8589
+#define GL_SRC1_COLOR 0x88F9
+#define GL_SRC1_RGB 0x8581
+#define GL_SRC2_ALPHA 0x858A
+#define GL_SRC2_RGB 0x8582
+#define GL_SRC_ALPHA 0x0302
+#define GL_SRC_ALPHA_SATURATE 0x0308
+#define GL_SRC_COLOR 0x0300
+#define GL_SRGB 0x8C40
+#define GL_SRGB8 0x8C41
+#define GL_SRGB8_ALPHA8 0x8C43
+#define GL_SRGB_ALPHA 0x8C42
+#define GL_STACK_OVERFLOW 0x0503
+#define GL_STACK_UNDERFLOW 0x0504
+#define GL_STATIC_COPY 0x88E6
+#define GL_STATIC_DRAW 0x88E4
+#define GL_STATIC_READ 0x88E5
+#define GL_STENCIL 0x1802
+#define GL_STENCIL_ATTACHMENT 0x8D20
+#define GL_STENCIL_BACK_FAIL 0x8801
+#define GL_STENCIL_BACK_FUNC 0x8800
+#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
+#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
+#define GL_STENCIL_BACK_REF 0x8CA3
+#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
+#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
+#define GL_STENCIL_BITS 0x0D57
+#define GL_STENCIL_BUFFER_BIT 0x00000400
+#define GL_STENCIL_CLEAR_VALUE 0x0B91
+#define GL_STENCIL_FAIL 0x0B94
+#define GL_STENCIL_FUNC 0x0B92
+#define GL_STENCIL_INDEX 0x1901
+#define GL_STENCIL_INDEX1 0x8D46
+#define GL_STENCIL_INDEX16 0x8D49
+#define GL_STENCIL_INDEX4 0x8D47
+#define GL_STENCIL_INDEX8 0x8D48
+#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
+#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
+#define GL_STENCIL_REF 0x0B97
+#define GL_STENCIL_TEST 0x0B90
+#define GL_STENCIL_VALUE_MASK 0x0B93
+#define GL_STENCIL_WRITEMASK 0x0B98
+#define GL_STEREO 0x0C33
+#define GL_STREAM_COPY 0x88E2
+#define GL_STREAM_DRAW 0x88E0
+#define GL_STREAM_READ 0x88E1
+#define GL_SUBPIXEL_BITS 0x0D50
+#define GL_SUBTRACT 0x84E7
+#define GL_SYNC_CONDITION 0x9113
+#define GL_SYNC_FENCE 0x9116
+#define GL_SYNC_FLAGS 0x9115
+#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001
+#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117
+#define GL_SYNC_STATUS 0x9114
+#define GL_T 0x2001
+#define GL_T2F_C3F_V3F 0x2A2A
+#define GL_T2F_C4F_N3F_V3F 0x2A2C
+#define GL_T2F_C4UB_V3F 0x2A29
+#define GL_T2F_N3F_V3F 0x2A2B
+#define GL_T2F_V3F 0x2A27
+#define GL_T4F_C4F_N3F_V4F 0x2A2D
+#define GL_T4F_V4F 0x2A28
+#define GL_TEXTURE 0x1702
+#define GL_TEXTURE0 0x84C0
+#define GL_TEXTURE1 0x84C1
+#define GL_TEXTURE10 0x84CA
+#define GL_TEXTURE11 0x84CB
+#define GL_TEXTURE12 0x84CC
+#define GL_TEXTURE13 0x84CD
+#define GL_TEXTURE14 0x84CE
+#define GL_TEXTURE15 0x84CF
+#define GL_TEXTURE16 0x84D0
+#define GL_TEXTURE17 0x84D1
+#define GL_TEXTURE18 0x84D2
+#define GL_TEXTURE19 0x84D3
+#define GL_TEXTURE2 0x84C2
+#define GL_TEXTURE20 0x84D4
+#define GL_TEXTURE21 0x84D5
+#define GL_TEXTURE22 0x84D6
+#define GL_TEXTURE23 0x84D7
+#define GL_TEXTURE24 0x84D8
+#define GL_TEXTURE25 0x84D9
+#define GL_TEXTURE26 0x84DA
+#define GL_TEXTURE27 0x84DB
+#define GL_TEXTURE28 0x84DC
+#define GL_TEXTURE29 0x84DD
+#define GL_TEXTURE3 0x84C3
+#define GL_TEXTURE30 0x84DE
+#define GL_TEXTURE31 0x84DF
+#define GL_TEXTURE4 0x84C4
+#define GL_TEXTURE5 0x84C5
+#define GL_TEXTURE6 0x84C6
+#define GL_TEXTURE7 0x84C7
+#define GL_TEXTURE8 0x84C8
+#define GL_TEXTURE9 0x84C9
+#define GL_TEXTURE_1D 0x0DE0
+#define GL_TEXTURE_1D_ARRAY 0x8C18
+#define GL_TEXTURE_2D 0x0DE1
+#define GL_TEXTURE_2D_ARRAY 0x8C1A
+#define GL_TEXTURE_2D_MULTISAMPLE 0x9100
+#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102
+#define GL_TEXTURE_3D 0x806F
+#define GL_TEXTURE_ALPHA_SIZE 0x805F
+#define GL_TEXTURE_ALPHA_TYPE 0x8C13
+#define GL_TEXTURE_BASE_LEVEL 0x813C
+#define GL_TEXTURE_BINDING_1D 0x8068
+#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C
+#define GL_TEXTURE_BINDING_2D 0x8069
+#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D
+#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104
+#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105
+#define GL_TEXTURE_BINDING_3D 0x806A
+#define GL_TEXTURE_BINDING_BUFFER 0x8C2C
+#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
+#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6
+#define GL_TEXTURE_BIT 0x00040000
+#define GL_TEXTURE_BLUE_SIZE 0x805E
+#define GL_TEXTURE_BLUE_TYPE 0x8C12
+#define GL_TEXTURE_BORDER 0x1005
+#define GL_TEXTURE_BORDER_COLOR 0x1004
+#define GL_TEXTURE_BUFFER 0x8C2A
+#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D
+#define GL_TEXTURE_COMPARE_FUNC 0x884D
+#define GL_TEXTURE_COMPARE_MODE 0x884C
+#define GL_TEXTURE_COMPONENTS 0x1003
+#define GL_TEXTURE_COMPRESSED 0x86A1
+#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0
+#define GL_TEXTURE_COMPRESSION_HINT 0x84EF
+#define GL_TEXTURE_COORD_ARRAY 0x8078
+#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A
+#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092
+#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088
+#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A
+#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089
+#define GL_TEXTURE_CUBE_MAP 0x8513
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
+#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F
+#define GL_TEXTURE_DEPTH 0x8071
+#define GL_TEXTURE_DEPTH_SIZE 0x884A
+#define GL_TEXTURE_DEPTH_TYPE 0x8C16
+#define GL_TEXTURE_ENV 0x2300
+#define GL_TEXTURE_ENV_COLOR 0x2201
+#define GL_TEXTURE_ENV_MODE 0x2200
+#define GL_TEXTURE_FILTER_CONTROL 0x8500
+#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107
+#define GL_TEXTURE_GEN_MODE 0x2500
+#define GL_TEXTURE_GEN_Q 0x0C63
+#define GL_TEXTURE_GEN_R 0x0C62
+#define GL_TEXTURE_GEN_S 0x0C60
+#define GL_TEXTURE_GEN_T 0x0C61
+#define GL_TEXTURE_GREEN_SIZE 0x805D
+#define GL_TEXTURE_GREEN_TYPE 0x8C11
+#define GL_TEXTURE_HEIGHT 0x1001
+#define GL_TEXTURE_INTENSITY_SIZE 0x8061
+#define GL_TEXTURE_INTENSITY_TYPE 0x8C15
+#define GL_TEXTURE_INTERNAL_FORMAT 0x1003
+#define GL_TEXTURE_LOD_BIAS 0x8501
+#define GL_TEXTURE_LUMINANCE_SIZE 0x8060
+#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14
+#define GL_TEXTURE_MAG_FILTER 0x2800
+#define GL_TEXTURE_MATRIX 0x0BA8
+#define GL_TEXTURE_MAX_LEVEL 0x813D
+#define GL_TEXTURE_MAX_LOD 0x813B
+#define GL_TEXTURE_MIN_FILTER 0x2801
+#define GL_TEXTURE_MIN_LOD 0x813A
+#define GL_TEXTURE_PRIORITY 0x8066
+#define GL_TEXTURE_RECTANGLE 0x84F5
+#define GL_TEXTURE_RED_SIZE 0x805C
+#define GL_TEXTURE_RED_TYPE 0x8C10
+#define GL_TEXTURE_RESIDENT 0x8067
+#define GL_TEXTURE_SAMPLES 0x9106
+#define GL_TEXTURE_SHARED_SIZE 0x8C3F
+#define GL_TEXTURE_STACK_DEPTH 0x0BA5
+#define GL_TEXTURE_STENCIL_SIZE 0x88F1
+#define GL_TEXTURE_SWIZZLE_A 0x8E45
+#define GL_TEXTURE_SWIZZLE_B 0x8E44
+#define GL_TEXTURE_SWIZZLE_G 0x8E43
+#define GL_TEXTURE_SWIZZLE_R 0x8E42
+#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46
+#define GL_TEXTURE_WIDTH 0x1000
+#define GL_TEXTURE_WRAP_R 0x8072
+#define GL_TEXTURE_WRAP_S 0x2802
+#define GL_TEXTURE_WRAP_T 0x2803
+#define GL_TIMEOUT_EXPIRED 0x911B
+#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFF
+#define GL_TIMESTAMP 0x8E28
+#define GL_TIME_ELAPSED 0x88BF
+#define GL_TRANSFORM_BIT 0x00001000
+#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E
+#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F
+#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F
+#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85
+#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84
+#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88
+#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83
+#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76
+#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6
+#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3
+#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4
+#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5
+#define GL_TRIANGLES 0x0004
+#define GL_TRIANGLES_ADJACENCY 0x000C
+#define GL_TRIANGLE_FAN 0x0006
+#define GL_TRIANGLE_STRIP 0x0005
+#define GL_TRIANGLE_STRIP_ADJACENCY 0x000D
+#define GL_TRUE 1
+#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C
+#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42
+#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43
+#define GL_UNIFORM_BLOCK_BINDING 0x8A3F
+#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40
+#define GL_UNIFORM_BLOCK_INDEX 0x8A3A
+#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41
+#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46
+#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45
+#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44
+#define GL_UNIFORM_BUFFER 0x8A11
+#define GL_UNIFORM_BUFFER_BINDING 0x8A28
+#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34
+#define GL_UNIFORM_BUFFER_SIZE 0x8A2A
+#define GL_UNIFORM_BUFFER_START 0x8A29
+#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E
+#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D
+#define GL_UNIFORM_NAME_LENGTH 0x8A39
+#define GL_UNIFORM_OFFSET 0x8A3B
+#define GL_UNIFORM_SIZE 0x8A38
+#define GL_UNIFORM_TYPE 0x8A37
+#define GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255
+#define GL_UNPACK_ALIGNMENT 0x0CF5
+#define GL_UNPACK_IMAGE_HEIGHT 0x806E
+#define GL_UNPACK_LSB_FIRST 0x0CF1
+#define GL_UNPACK_ROW_LENGTH 0x0CF2
+#define GL_UNPACK_SKIP_IMAGES 0x806D
+#define GL_UNPACK_SKIP_PIXELS 0x0CF4
+#define GL_UNPACK_SKIP_ROWS 0x0CF3
+#define GL_UNPACK_SWAP_BYTES 0x0CF0
+#define GL_UNSIGNALED 0x9118
+#define GL_UNSIGNED_BYTE 0x1401
+#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362
+#define GL_UNSIGNED_BYTE_3_3_2 0x8032
+#define GL_UNSIGNED_INT 0x1405
+#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B
+#define GL_UNSIGNED_INT_10_10_10_2 0x8036
+#define GL_UNSIGNED_INT_24_8 0x84FA
+#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
+#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E
+#define GL_UNSIGNED_INT_8_8_8_8 0x8035
+#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
+#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1
+#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6
+#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2
+#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7
+#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A
+#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D
+#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5
+#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3
+#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8
+#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4
+#define GL_UNSIGNED_INT_VEC2 0x8DC6
+#define GL_UNSIGNED_INT_VEC3 0x8DC7
+#define GL_UNSIGNED_INT_VEC4 0x8DC8
+#define GL_UNSIGNED_NORMALIZED 0x8C17
+#define GL_UNSIGNED_SHORT 0x1403
+#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366
+#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
+#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365
+#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
+#define GL_UNSIGNED_SHORT_5_6_5 0x8363
+#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364
+#define GL_UPPER_LEFT 0x8CA2
+#define GL_V2F 0x2A20
+#define GL_V3F 0x2A21
+#define GL_VALIDATE_STATUS 0x8B83
+#define GL_VENDOR 0x1F00
+#define GL_VERSION 0x1F02
+#define GL_VERTEX_ARRAY 0x8074
+#define GL_VERTEX_ARRAY_BINDING 0x85B5
+#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896
+#define GL_VERTEX_ARRAY_POINTER 0x808E
+#define GL_VERTEX_ARRAY_SIZE 0x807A
+#define GL_VERTEX_ARRAY_STRIDE 0x807C
+#define GL_VERTEX_ARRAY_TYPE 0x807B
+#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
+#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE
+#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
+#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD
+#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
+#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
+#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
+#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
+#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
+#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642
+#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643
+#define GL_VERTEX_SHADER 0x8B31
+#define GL_VIEWPORT 0x0BA2
+#define GL_VIEWPORT_BIT 0x00000800
+#define GL_WAIT_FAILED 0x911D
+#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E
+#define GL_WRITE_ONLY 0x88B9
+#define GL_XOR 0x1506
+#define GL_ZERO 0
+#define GL_ZOOM_X 0x0D16
+#define GL_ZOOM_Y 0x0D17
+
+
+#ifndef __khrplatform_h_
+#define __khrplatform_h_
+
+/*
+** Copyright (c) 2008-2018 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+
+/* Khronos platform-specific types and definitions.
+ *
+ * The master copy of khrplatform.h is maintained in the Khronos EGL
+ * Registry repository at https://github.com/KhronosGroup/EGL-Registry
+ * The last semantic modification to khrplatform.h was at commit ID:
+ * 67a3e0864c2d75ea5287b9f3d2eb74a745936692
+ *
+ * Adopters may modify this file to suit their platform. Adopters are
+ * encouraged to submit platform specific modifications to the Khronos
+ * group so that they can be included in future versions of this file.
+ * Please submit changes by filing pull requests or issues on
+ * the EGL Registry repository linked above.
+ *
+ *
+ * See the Implementer's Guidelines for information about where this file
+ * should be located on your system and for more details of its use:
+ * http://www.khronos.org/registry/implementers_guide.pdf
+ *
+ * This file should be included as
+ * #include
+ * by Khronos client API header files that use its types and defines.
+ *
+ * The types in khrplatform.h should only be used to define API-specific types.
+ *
+ * Types defined in khrplatform.h:
+ * khronos_int8_t signed 8 bit
+ * khronos_uint8_t unsigned 8 bit
+ * khronos_int16_t signed 16 bit
+ * khronos_uint16_t unsigned 16 bit
+ * khronos_int32_t signed 32 bit
+ * khronos_uint32_t unsigned 32 bit
+ * khronos_int64_t signed 64 bit
+ * khronos_uint64_t unsigned 64 bit
+ * khronos_intptr_t signed same number of bits as a pointer
+ * khronos_uintptr_t unsigned same number of bits as a pointer
+ * khronos_ssize_t signed size
+ * khronos_usize_t unsigned size
+ * khronos_float_t signed 32 bit floating point
+ * khronos_time_ns_t unsigned 64 bit time in nanoseconds
+ * khronos_utime_nanoseconds_t unsigned time interval or absolute time in
+ * nanoseconds
+ * khronos_stime_nanoseconds_t signed time interval in nanoseconds
+ * khronos_boolean_enum_t enumerated boolean type. This should
+ * only be used as a base type when a client API's boolean type is
+ * an enum. Client APIs which use an integer or other type for
+ * booleans cannot use this as the base type for their boolean.
+ *
+ * Tokens defined in khrplatform.h:
+ *
+ * KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values.
+ *
+ * KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0.
+ * KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0.
+ *
+ * Calling convention macros defined in this file:
+ * KHRONOS_APICALL
+ * KHRONOS_GLAD_API_PTR
+ * KHRONOS_APIATTRIBUTES
+ *
+ * These may be used in function prototypes as:
+ *
+ * KHRONOS_APICALL void KHRONOS_GLAD_API_PTR funcname(
+ * int arg1,
+ * int arg2) KHRONOS_APIATTRIBUTES;
+ */
+
+#if defined(__SCITECH_SNAP__) && !defined(KHRONOS_STATIC)
+# define KHRONOS_STATIC 1
+#endif
+
+/*-------------------------------------------------------------------------
+ * Definition of KHRONOS_APICALL
+ *-------------------------------------------------------------------------
+ * This precedes the return type of the function in the function prototype.
+ */
+#if defined(KHRONOS_STATIC)
+ /* If the preprocessor constant KHRONOS_STATIC is defined, make the
+ * header compatible with static linking. */
+# define KHRONOS_APICALL
+#elif defined(_WIN32)
+# define KHRONOS_APICALL __declspec(dllimport)
+#elif defined (__SYMBIAN32__)
+# define KHRONOS_APICALL IMPORT_C
+#elif defined(__ANDROID__)
+# define KHRONOS_APICALL __attribute__((visibility("default")))
+#else
+# define KHRONOS_APICALL
+#endif
+
+/*-------------------------------------------------------------------------
+ * Definition of KHRONOS_GLAD_API_PTR
+ *-------------------------------------------------------------------------
+ * This follows the return type of the function and precedes the function
+ * name in the function prototype.
+ */
+#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__)
+ /* Win32 but not WinCE */
+# define KHRONOS_GLAD_API_PTR __stdcall
+#else
+# define KHRONOS_GLAD_API_PTR
+#endif
+
+/*-------------------------------------------------------------------------
+ * Definition of KHRONOS_APIATTRIBUTES
+ *-------------------------------------------------------------------------
+ * This follows the closing parenthesis of the function prototype arguments.
+ */
+#if defined (__ARMCC_2__)
+#define KHRONOS_APIATTRIBUTES __softfp
+#else
+#define KHRONOS_APIATTRIBUTES
+#endif
+
+/*-------------------------------------------------------------------------
+ * basic type definitions
+ *-----------------------------------------------------------------------*/
+#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__)
+
+
+/*
+ * Using
+ */
+#include
+typedef int32_t khronos_int32_t;
+typedef uint32_t khronos_uint32_t;
+typedef int64_t khronos_int64_t;
+typedef uint64_t khronos_uint64_t;
+#define KHRONOS_SUPPORT_INT64 1
+#define KHRONOS_SUPPORT_FLOAT 1
+
+#elif defined(__VMS ) || defined(__sgi)
+
+/*
+ * Using
+ */
+#include
+typedef int32_t khronos_int32_t;
+typedef uint32_t khronos_uint32_t;
+typedef int64_t khronos_int64_t;
+typedef uint64_t khronos_uint64_t;
+#define KHRONOS_SUPPORT_INT64 1
+#define KHRONOS_SUPPORT_FLOAT 1
+
+#elif defined(_WIN32) && !defined(__SCITECH_SNAP__)
+
+/*
+ * Win32
+ */
+typedef __int32 khronos_int32_t;
+typedef unsigned __int32 khronos_uint32_t;
+typedef __int64 khronos_int64_t;
+typedef unsigned __int64 khronos_uint64_t;
+#define KHRONOS_SUPPORT_INT64 1
+#define KHRONOS_SUPPORT_FLOAT 1
+
+#elif defined(__sun__) || defined(__digital__)
+
+/*
+ * Sun or Digital
+ */
+typedef int khronos_int32_t;
+typedef unsigned int khronos_uint32_t;
+#if defined(__arch64__) || defined(_LP64)
+typedef long int khronos_int64_t;
+typedef unsigned long int khronos_uint64_t;
+#else
+typedef long long int khronos_int64_t;
+typedef unsigned long long int khronos_uint64_t;
+#endif /* __arch64__ */
+#define KHRONOS_SUPPORT_INT64 1
+#define KHRONOS_SUPPORT_FLOAT 1
+
+#elif 0
+
+/*
+ * Hypothetical platform with no float or int64 support
+ */
+typedef int khronos_int32_t;
+typedef unsigned int khronos_uint32_t;
+#define KHRONOS_SUPPORT_INT64 0
+#define KHRONOS_SUPPORT_FLOAT 0
+
+#else
+
+/*
+ * Generic fallback
+ */
+#include
+typedef int32_t khronos_int32_t;
+typedef uint32_t khronos_uint32_t;
+typedef int64_t khronos_int64_t;
+typedef uint64_t khronos_uint64_t;
+#define KHRONOS_SUPPORT_INT64 1
+#define KHRONOS_SUPPORT_FLOAT 1
+
+#endif
+
+
+/*
+ * Types that are (so far) the same on all platforms
+ */
+typedef signed char khronos_int8_t;
+typedef unsigned char khronos_uint8_t;
+typedef signed short int khronos_int16_t;
+typedef unsigned short int khronos_uint16_t;
+
+/*
+ * Types that differ between LLP64 and LP64 architectures - in LLP64,
+ * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
+ * to be the only LLP64 architecture in current use.
+ */
+#ifdef _WIN64
+typedef signed long long int khronos_intptr_t;
+typedef unsigned long long int khronos_uintptr_t;
+typedef signed long long int khronos_ssize_t;
+typedef unsigned long long int khronos_usize_t;
+#else
+typedef signed long int khronos_intptr_t;
+typedef unsigned long int khronos_uintptr_t;
+typedef signed long int khronos_ssize_t;
+typedef unsigned long int khronos_usize_t;
+#endif
+
+#if KHRONOS_SUPPORT_FLOAT
+/*
+ * Float type
+ */
+typedef float khronos_float_t;
+#endif
+
+#if KHRONOS_SUPPORT_INT64
+/* Time types
+ *
+ * These types can be used to represent a time interval in nanoseconds or
+ * an absolute Unadjusted System Time. Unadjusted System Time is the number
+ * of nanoseconds since some arbitrary system event (e.g. since the last
+ * time the system booted). The Unadjusted System Time is an unsigned
+ * 64 bit value that wraps back to 0 every 584 years. Time intervals
+ * may be either signed or unsigned.
+ */
+typedef khronos_uint64_t khronos_utime_nanoseconds_t;
+typedef khronos_int64_t khronos_stime_nanoseconds_t;
+#endif
+
+/*
+ * Dummy value used to pad enum types to 32 bits.
+ */
+#ifndef KHRONOS_MAX_ENUM
+#define KHRONOS_MAX_ENUM 0x7FFFFFFF
+#endif
+
+/*
+ * Enumerated boolean type
+ *
+ * Values other than zero should be considered to be true. Therefore
+ * comparisons should not be made against KHRONOS_TRUE.
+ */
+typedef enum {
+ KHRONOS_FALSE = 0,
+ KHRONOS_TRUE = 1,
+ KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM
+} khronos_boolean_enum_t;
+
+#endif /* __khrplatform_h_ */
+
+typedef unsigned int GLenum;
+
+typedef unsigned char GLboolean;
+
+typedef unsigned int GLbitfield;
+
+typedef void GLvoid;
+
+typedef khronos_int8_t GLbyte;
+
+typedef khronos_uint8_t GLubyte;
+
+typedef khronos_int16_t GLshort;
+
+typedef khronos_uint16_t GLushort;
+
+typedef int GLint;
+
+typedef unsigned int GLuint;
+
+typedef khronos_int32_t GLclampx;
+
+typedef int GLsizei;
+
+typedef khronos_float_t GLfloat;
+
+typedef khronos_float_t GLclampf;
+
+typedef double GLdouble;
+
+typedef double GLclampd;
+
+typedef void *GLeglClientBufferEXT;
+
+typedef void *GLeglImageOES;
+
+typedef char GLchar;
+
+typedef char GLcharARB;
+
+#ifdef __APPLE__
+typedef void *GLhandleARB;
+#else
+typedef unsigned int GLhandleARB;
+#endif
+
+typedef khronos_uint16_t GLhalf;
+
+typedef khronos_uint16_t GLhalfARB;
+
+typedef khronos_int32_t GLfixed;
+
+#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
+typedef khronos_intptr_t GLintptr;
+#else
+typedef khronos_intptr_t GLintptr;
+#endif
+
+#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
+typedef khronos_intptr_t GLintptrARB;
+#else
+typedef khronos_intptr_t GLintptrARB;
+#endif
+
+#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
+typedef khronos_ssize_t GLsizeiptr;
+#else
+typedef khronos_ssize_t GLsizeiptr;
+#endif
+
+#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
+typedef khronos_ssize_t GLsizeiptrARB;
+#else
+typedef khronos_ssize_t GLsizeiptrARB;
+#endif
+
+typedef khronos_int64_t GLint64;
+
+typedef khronos_int64_t GLint64EXT;
+
+typedef khronos_uint64_t GLuint64;
+
+typedef khronos_uint64_t GLuint64EXT;
+
+typedef struct __GLsync *GLsync;
+
+struct _cl_context;
+
+struct _cl_event;
+
+typedef void (GLAD_API_PTR *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
+
+typedef void (GLAD_API_PTR *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
+
+typedef void (GLAD_API_PTR *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
+
+typedef void (GLAD_API_PTR *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,void *userParam);
+
+typedef unsigned short GLhalfNV;
+
+typedef GLintptr GLvdpauSurfaceNV;
+
+typedef void (GLAD_API_PTR *GLVULKANPROCNV)(void);
+
+
+
+#define GL_VERSION_1_0 1
+GLAD_API_CALL int GLAD_GL_VERSION_1_0;
+#define GL_VERSION_1_1 1
+GLAD_API_CALL int GLAD_GL_VERSION_1_1;
+#define GL_VERSION_1_2 1
+GLAD_API_CALL int GLAD_GL_VERSION_1_2;
+#define GL_VERSION_1_3 1
+GLAD_API_CALL int GLAD_GL_VERSION_1_3;
+#define GL_VERSION_1_4 1
+GLAD_API_CALL int GLAD_GL_VERSION_1_4;
+#define GL_VERSION_1_5 1
+GLAD_API_CALL int GLAD_GL_VERSION_1_5;
+#define GL_VERSION_2_0 1
+GLAD_API_CALL int GLAD_GL_VERSION_2_0;
+#define GL_VERSION_2_1 1
+GLAD_API_CALL int GLAD_GL_VERSION_2_1;
+#define GL_VERSION_3_0 1
+GLAD_API_CALL int GLAD_GL_VERSION_3_0;
+#define GL_VERSION_3_1 1
+GLAD_API_CALL int GLAD_GL_VERSION_3_1;
+#define GL_VERSION_3_2 1
+GLAD_API_CALL int GLAD_GL_VERSION_3_2;
+#define GL_VERSION_3_3 1
+GLAD_API_CALL int GLAD_GL_VERSION_3_3;
+#define GL_ARB_multisample 1
+GLAD_API_CALL int GLAD_GL_ARB_multisample;
+#define GL_ARB_robustness 1
+GLAD_API_CALL int GLAD_GL_ARB_robustness;
+#define GL_KHR_debug 1
+GLAD_API_CALL int GLAD_GL_KHR_debug;
+
+
+typedef void (GLAD_API_PTR *PFNGLACCUMPROC)(GLenum op, GLfloat value);
+typedef void (GLAD_API_PTR *PFNGLACTIVETEXTUREPROC)(GLenum texture);
+typedef void (GLAD_API_PTR *PFNGLALPHAFUNCPROC)(GLenum func, GLfloat ref);
+typedef GLboolean (GLAD_API_PTR *PFNGLARETEXTURESRESIDENTPROC)(GLsizei n, const GLuint * textures, GLboolean * residences);
+typedef void (GLAD_API_PTR *PFNGLARRAYELEMENTPROC)(GLint i);
+typedef void (GLAD_API_PTR *PFNGLATTACHSHADERPROC)(GLuint program, GLuint shader);
+typedef void (GLAD_API_PTR *PFNGLBEGINPROC)(GLenum mode);
+typedef void (GLAD_API_PTR *PFNGLBEGINCONDITIONALRENDERPROC)(GLuint id, GLenum mode);
+typedef void (GLAD_API_PTR *PFNGLBEGINQUERYPROC)(GLenum target, GLuint id);
+typedef void (GLAD_API_PTR *PFNGLBEGINTRANSFORMFEEDBACKPROC)(GLenum primitiveMode);
+typedef void (GLAD_API_PTR *PFNGLBINDATTRIBLOCATIONPROC)(GLuint program, GLuint index, const GLchar * name);
+typedef void (GLAD_API_PTR *PFNGLBINDBUFFERPROC)(GLenum target, GLuint buffer);
+typedef void (GLAD_API_PTR *PFNGLBINDBUFFERBASEPROC)(GLenum target, GLuint index, GLuint buffer);
+typedef void (GLAD_API_PTR *PFNGLBINDBUFFERRANGEPROC)(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+typedef void (GLAD_API_PTR *PFNGLBINDFRAGDATALOCATIONPROC)(GLuint program, GLuint color, const GLchar * name);
+typedef void (GLAD_API_PTR *PFNGLBINDFRAGDATALOCATIONINDEXEDPROC)(GLuint program, GLuint colorNumber, GLuint index, const GLchar * name);
+typedef void (GLAD_API_PTR *PFNGLBINDFRAMEBUFFERPROC)(GLenum target, GLuint framebuffer);
+typedef void (GLAD_API_PTR *PFNGLBINDRENDERBUFFERPROC)(GLenum target, GLuint renderbuffer);
+typedef void (GLAD_API_PTR *PFNGLBINDSAMPLERPROC)(GLuint unit, GLuint sampler);
+typedef void (GLAD_API_PTR *PFNGLBINDTEXTUREPROC)(GLenum target, GLuint texture);
+typedef void (GLAD_API_PTR *PFNGLBINDVERTEXARRAYPROC)(GLuint array);
+typedef void (GLAD_API_PTR *PFNGLBITMAPPROC)(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte * bitmap);
+typedef void (GLAD_API_PTR *PFNGLBLENDCOLORPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+typedef void (GLAD_API_PTR *PFNGLBLENDEQUATIONPROC)(GLenum mode);
+typedef void (GLAD_API_PTR *PFNGLBLENDEQUATIONSEPARATEPROC)(GLenum modeRGB, GLenum modeAlpha);
+typedef void (GLAD_API_PTR *PFNGLBLENDFUNCPROC)(GLenum sfactor, GLenum dfactor);
+typedef void (GLAD_API_PTR *PFNGLBLENDFUNCSEPARATEPROC)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+typedef void (GLAD_API_PTR *PFNGLBLITFRAMEBUFFERPROC)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+typedef void (GLAD_API_PTR *PFNGLBUFFERDATAPROC)(GLenum target, GLsizeiptr size, const void * data, GLenum usage);
+typedef void (GLAD_API_PTR *PFNGLBUFFERSUBDATAPROC)(GLenum target, GLintptr offset, GLsizeiptr size, const void * data);
+typedef void (GLAD_API_PTR *PFNGLCALLLISTPROC)(GLuint list);
+typedef void (GLAD_API_PTR *PFNGLCALLLISTSPROC)(GLsizei n, GLenum type, const void * lists);
+typedef GLenum (GLAD_API_PTR *PFNGLCHECKFRAMEBUFFERSTATUSPROC)(GLenum target);
+typedef void (GLAD_API_PTR *PFNGLCLAMPCOLORPROC)(GLenum target, GLenum clamp);
+typedef void (GLAD_API_PTR *PFNGLCLEARPROC)(GLbitfield mask);
+typedef void (GLAD_API_PTR *PFNGLCLEARACCUMPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+typedef void (GLAD_API_PTR *PFNGLCLEARBUFFERFIPROC)(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
+typedef void (GLAD_API_PTR *PFNGLCLEARBUFFERFVPROC)(GLenum buffer, GLint drawbuffer, const GLfloat * value);
+typedef void (GLAD_API_PTR *PFNGLCLEARBUFFERIVPROC)(GLenum buffer, GLint drawbuffer, const GLint * value);
+typedef void (GLAD_API_PTR *PFNGLCLEARBUFFERUIVPROC)(GLenum buffer, GLint drawbuffer, const GLuint * value);
+typedef void (GLAD_API_PTR *PFNGLCLEARCOLORPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+typedef void (GLAD_API_PTR *PFNGLCLEARDEPTHPROC)(GLdouble depth);
+typedef void (GLAD_API_PTR *PFNGLCLEARINDEXPROC)(GLfloat c);
+typedef void (GLAD_API_PTR *PFNGLCLEARSTENCILPROC)(GLint s);
+typedef void (GLAD_API_PTR *PFNGLCLIENTACTIVETEXTUREPROC)(GLenum texture);
+typedef GLenum (GLAD_API_PTR *PFNGLCLIENTWAITSYNCPROC)(GLsync sync, GLbitfield flags, GLuint64 timeout);
+typedef void (GLAD_API_PTR *PFNGLCLIPPLANEPROC)(GLenum plane, const GLdouble * equation);
+typedef void (GLAD_API_PTR *PFNGLCOLOR3BPROC)(GLbyte red, GLbyte green, GLbyte blue);
+typedef void (GLAD_API_PTR *PFNGLCOLOR3BVPROC)(const GLbyte * v);
+typedef void (GLAD_API_PTR *PFNGLCOLOR3DPROC)(GLdouble red, GLdouble green, GLdouble blue);
+typedef void (GLAD_API_PTR *PFNGLCOLOR3DVPROC)(const GLdouble * v);
+typedef void (GLAD_API_PTR *PFNGLCOLOR3FPROC)(GLfloat red, GLfloat green, GLfloat blue);
+typedef void (GLAD_API_PTR *PFNGLCOLOR3FVPROC)(const GLfloat * v);
+typedef void (GLAD_API_PTR *PFNGLCOLOR3IPROC)(GLint red, GLint green, GLint blue);
+typedef void (GLAD_API_PTR *PFNGLCOLOR3IVPROC)(const GLint * v);
+typedef void (GLAD_API_PTR *PFNGLCOLOR3SPROC)(GLshort red, GLshort green, GLshort blue);
+typedef void (GLAD_API_PTR *PFNGLCOLOR3SVPROC)(const GLshort * v);
+typedef void (GLAD_API_PTR *PFNGLCOLOR3UBPROC)(GLubyte red, GLubyte green, GLubyte blue);
+typedef void (GLAD_API_PTR *PFNGLCOLOR3UBVPROC)(const GLubyte * v);
+typedef void (GLAD_API_PTR *PFNGLCOLOR3UIPROC)(GLuint red, GLuint green, GLuint blue);
+typedef void (GLAD_API_PTR *PFNGLCOLOR3UIVPROC)(const GLuint * v);
+typedef void (GLAD_API_PTR *PFNGLCOLOR3USPROC)(GLushort red, GLushort green, GLushort blue);
+typedef void (GLAD_API_PTR *PFNGLCOLOR3USVPROC)(const GLushort * v);
+typedef void (GLAD_API_PTR *PFNGLCOLOR4BPROC)(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha);
+typedef void (GLAD_API_PTR *PFNGLCOLOR4BVPROC)(const GLbyte * v);
+typedef void (GLAD_API_PTR *PFNGLCOLOR4DPROC)(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha);
+typedef void (GLAD_API_PTR *PFNGLCOLOR4DVPROC)(const GLdouble * v);
+typedef void (GLAD_API_PTR *PFNGLCOLOR4FPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+typedef void (GLAD_API_PTR *PFNGLCOLOR4FVPROC)(const GLfloat * v);
+typedef void (GLAD_API_PTR *PFNGLCOLOR4IPROC)(GLint red, GLint green, GLint blue, GLint alpha);
+typedef void (GLAD_API_PTR *PFNGLCOLOR4IVPROC)(const GLint * v);
+typedef void (GLAD_API_PTR *PFNGLCOLOR4SPROC)(GLshort red, GLshort green, GLshort blue, GLshort alpha);
+typedef void (GLAD_API_PTR *PFNGLCOLOR4SVPROC)(const GLshort * v);
+typedef void (GLAD_API_PTR *PFNGLCOLOR4UBPROC)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
+typedef void (GLAD_API_PTR *PFNGLCOLOR4UBVPROC)(const GLubyte * v);
+typedef void (GLAD_API_PTR *PFNGLCOLOR4UIPROC)(GLuint red, GLuint green, GLuint blue, GLuint alpha);
+typedef void (GLAD_API_PTR *PFNGLCOLOR4UIVPROC)(const GLuint * v);
+typedef void (GLAD_API_PTR *PFNGLCOLOR4USPROC)(GLushort red, GLushort green, GLushort blue, GLushort alpha);
+typedef void (GLAD_API_PTR *PFNGLCOLOR4USVPROC)(const GLushort * v);
+typedef void (GLAD_API_PTR *PFNGLCOLORMASKPROC)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+typedef void (GLAD_API_PTR *PFNGLCOLORMASKIPROC)(GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
+typedef void (GLAD_API_PTR *PFNGLCOLORMATERIALPROC)(GLenum face, GLenum mode);
+typedef void (GLAD_API_PTR *PFNGLCOLORP3UIPROC)(GLenum type, GLuint color);
+typedef void (GLAD_API_PTR *PFNGLCOLORP3UIVPROC)(GLenum type, const GLuint * color);
+typedef void (GLAD_API_PTR *PFNGLCOLORP4UIPROC)(GLenum type, GLuint color);
+typedef void (GLAD_API_PTR *PFNGLCOLORP4UIVPROC)(GLenum type, const GLuint * color);
+typedef void (GLAD_API_PTR *PFNGLCOLORPOINTERPROC)(GLint size, GLenum type, GLsizei stride, const void * pointer);
+typedef void (GLAD_API_PTR *PFNGLCOMPILESHADERPROC)(GLuint shader);
+typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXIMAGE1DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void * data);
+typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXIMAGE2DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void * data);
+typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXIMAGE3DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void * data);
+typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void * data);
+typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void * data);
+typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void * data);
+typedef void (GLAD_API_PTR *PFNGLCOPYBUFFERSUBDATAPROC)(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
+typedef void (GLAD_API_PTR *PFNGLCOPYPIXELSPROC)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type);
+typedef void (GLAD_API_PTR *PFNGLCOPYTEXIMAGE1DPROC)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
+typedef void (GLAD_API_PTR *PFNGLCOPYTEXIMAGE2DPROC)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+typedef void (GLAD_API_PTR *PFNGLCOPYTEXSUBIMAGE1DPROC)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+typedef void (GLAD_API_PTR *PFNGLCOPYTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (GLAD_API_PTR *PFNGLCOPYTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef GLuint (GLAD_API_PTR *PFNGLCREATEPROGRAMPROC)(void);
+typedef GLuint (GLAD_API_PTR *PFNGLCREATESHADERPROC)(GLenum type);
+typedef void (GLAD_API_PTR *PFNGLCULLFACEPROC)(GLenum mode);
+typedef void (GLAD_API_PTR *PFNGLDEBUGMESSAGECALLBACKPROC)(GLDEBUGPROC callback, const void * userParam);
+typedef void (GLAD_API_PTR *PFNGLDEBUGMESSAGECONTROLPROC)(GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint * ids, GLboolean enabled);
+typedef void (GLAD_API_PTR *PFNGLDEBUGMESSAGEINSERTPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar * buf);
+typedef void (GLAD_API_PTR *PFNGLDELETEBUFFERSPROC)(GLsizei n, const GLuint * buffers);
+typedef void (GLAD_API_PTR *PFNGLDELETEFRAMEBUFFERSPROC)(GLsizei n, const GLuint * framebuffers);
+typedef void (GLAD_API_PTR *PFNGLDELETELISTSPROC)(GLuint list, GLsizei range);
+typedef void (GLAD_API_PTR *PFNGLDELETEPROGRAMPROC)(GLuint program);
+typedef void (GLAD_API_PTR *PFNGLDELETEQUERIESPROC)(GLsizei n, const GLuint * ids);
+typedef void (GLAD_API_PTR *PFNGLDELETERENDERBUFFERSPROC)(GLsizei n, const GLuint * renderbuffers);
+typedef void (GLAD_API_PTR *PFNGLDELETESAMPLERSPROC)(GLsizei count, const GLuint * samplers);
+typedef void (GLAD_API_PTR *PFNGLDELETESHADERPROC)(GLuint shader);
+typedef void (GLAD_API_PTR *PFNGLDELETESYNCPROC)(GLsync sync);
+typedef void (GLAD_API_PTR *PFNGLDELETETEXTURESPROC)(GLsizei n, const GLuint * textures);
+typedef void (GLAD_API_PTR *PFNGLDELETEVERTEXARRAYSPROC)(GLsizei n, const GLuint * arrays);
+typedef void (GLAD_API_PTR *PFNGLDEPTHFUNCPROC)(GLenum func);
+typedef void (GLAD_API_PTR *PFNGLDEPTHMASKPROC)(GLboolean flag);
+typedef void (GLAD_API_PTR *PFNGLDEPTHRANGEPROC)(GLdouble n, GLdouble f);
+typedef void (GLAD_API_PTR *PFNGLDETACHSHADERPROC)(GLuint program, GLuint shader);
+typedef void (GLAD_API_PTR *PFNGLDISABLEPROC)(GLenum cap);
+typedef void (GLAD_API_PTR *PFNGLDISABLECLIENTSTATEPROC)(GLenum array);
+typedef void (GLAD_API_PTR *PFNGLDISABLEVERTEXATTRIBARRAYPROC)(GLuint index);
+typedef void (GLAD_API_PTR *PFNGLDISABLEIPROC)(GLenum target, GLuint index);
+typedef void (GLAD_API_PTR *PFNGLDRAWARRAYSPROC)(GLenum mode, GLint first, GLsizei count);
+typedef void (GLAD_API_PTR *PFNGLDRAWARRAYSINSTANCEDPROC)(GLenum mode, GLint first, GLsizei count, GLsizei instancecount);
+typedef void (GLAD_API_PTR *PFNGLDRAWBUFFERPROC)(GLenum buf);
+typedef void (GLAD_API_PTR *PFNGLDRAWBUFFERSPROC)(GLsizei n, const GLenum * bufs);
+typedef void (GLAD_API_PTR *PFNGLDRAWELEMENTSPROC)(GLenum mode, GLsizei count, GLenum type, const void * indices);
+typedef void (GLAD_API_PTR *PFNGLDRAWELEMENTSBASEVERTEXPROC)(GLenum mode, GLsizei count, GLenum type, const void * indices, GLint basevertex);
+typedef void (GLAD_API_PTR *PFNGLDRAWELEMENTSINSTANCEDPROC)(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei instancecount);
+typedef void (GLAD_API_PTR *PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei instancecount, GLint basevertex);
+typedef void (GLAD_API_PTR *PFNGLDRAWPIXELSPROC)(GLsizei width, GLsizei height, GLenum format, GLenum type, const void * pixels);
+typedef void (GLAD_API_PTR *PFNGLDRAWRANGEELEMENTSPROC)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void * indices);
+typedef void (GLAD_API_PTR *PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void * indices, GLint basevertex);
+typedef void (GLAD_API_PTR *PFNGLEDGEFLAGPROC)(GLboolean flag);
+typedef void (GLAD_API_PTR *PFNGLEDGEFLAGPOINTERPROC)(GLsizei stride, const void * pointer);
+typedef void (GLAD_API_PTR *PFNGLEDGEFLAGVPROC)(const GLboolean * flag);
+typedef void (GLAD_API_PTR *PFNGLENABLEPROC)(GLenum cap);
+typedef void (GLAD_API_PTR *PFNGLENABLECLIENTSTATEPROC)(GLenum array);
+typedef void (GLAD_API_PTR *PFNGLENABLEVERTEXATTRIBARRAYPROC)(GLuint index);
+typedef void (GLAD_API_PTR *PFNGLENABLEIPROC)(GLenum target, GLuint index);
+typedef void (GLAD_API_PTR *PFNGLENDPROC)(void);
+typedef void (GLAD_API_PTR *PFNGLENDCONDITIONALRENDERPROC)(void);
+typedef void (GLAD_API_PTR *PFNGLENDLISTPROC)(void);
+typedef void (GLAD_API_PTR *PFNGLENDQUERYPROC)(GLenum target);
+typedef void (GLAD_API_PTR *PFNGLENDTRANSFORMFEEDBACKPROC)(void);
+typedef void (GLAD_API_PTR *PFNGLEVALCOORD1DPROC)(GLdouble u);
+typedef void (GLAD_API_PTR *PFNGLEVALCOORD1DVPROC)(const GLdouble * u);
+typedef void (GLAD_API_PTR *PFNGLEVALCOORD1FPROC)(GLfloat u);
+typedef void (GLAD_API_PTR *PFNGLEVALCOORD1FVPROC)(const GLfloat * u);
+typedef void (GLAD_API_PTR *PFNGLEVALCOORD2DPROC)(GLdouble u, GLdouble v);
+typedef void (GLAD_API_PTR *PFNGLEVALCOORD2DVPROC)(const GLdouble * u);
+typedef void (GLAD_API_PTR *PFNGLEVALCOORD2FPROC)(GLfloat u, GLfloat v);
+typedef void (GLAD_API_PTR *PFNGLEVALCOORD2FVPROC)(const GLfloat * u);
+typedef void (GLAD_API_PTR *PFNGLEVALMESH1PROC)(GLenum mode, GLint i1, GLint i2);
+typedef void (GLAD_API_PTR *PFNGLEVALMESH2PROC)(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2);
+typedef void (GLAD_API_PTR *PFNGLEVALPOINT1PROC)(GLint i);
+typedef void (GLAD_API_PTR *PFNGLEVALPOINT2PROC)(GLint i, GLint j);
+typedef void (GLAD_API_PTR *PFNGLFEEDBACKBUFFERPROC)(GLsizei size, GLenum type, GLfloat * buffer);
+typedef GLsync (GLAD_API_PTR *PFNGLFENCESYNCPROC)(GLenum condition, GLbitfield flags);
+typedef void (GLAD_API_PTR *PFNGLFINISHPROC)(void);
+typedef void (GLAD_API_PTR *PFNGLFLUSHPROC)(void);
+typedef void (GLAD_API_PTR *PFNGLFLUSHMAPPEDBUFFERRANGEPROC)(GLenum target, GLintptr offset, GLsizeiptr length);
+typedef void (GLAD_API_PTR *PFNGLFOGCOORDPOINTERPROC)(GLenum type, GLsizei stride, const void * pointer);
+typedef void (GLAD_API_PTR *PFNGLFOGCOORDDPROC)(GLdouble coord);
+typedef void (GLAD_API_PTR *PFNGLFOGCOORDDVPROC)(const GLdouble * coord);
+typedef void (GLAD_API_PTR *PFNGLFOGCOORDFPROC)(GLfloat coord);
+typedef void (GLAD_API_PTR *PFNGLFOGCOORDFVPROC)(const GLfloat * coord);
+typedef void (GLAD_API_PTR *PFNGLFOGFPROC)(GLenum pname, GLfloat param);
+typedef void (GLAD_API_PTR *PFNGLFOGFVPROC)(GLenum pname, const GLfloat * params);
+typedef void (GLAD_API_PTR *PFNGLFOGIPROC)(GLenum pname, GLint param);
+typedef void (GLAD_API_PTR *PFNGLFOGIVPROC)(GLenum pname, const GLint * params);
+typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERRENDERBUFFERPROC)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERTEXTUREPROC)(GLenum target, GLenum attachment, GLuint texture, GLint level);
+typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERTEXTURE1DPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERTEXTURE2DPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERTEXTURE3DPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERTEXTURELAYERPROC)(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+typedef void (GLAD_API_PTR *PFNGLFRONTFACEPROC)(GLenum mode);
+typedef void (GLAD_API_PTR *PFNGLFRUSTUMPROC)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+typedef void (GLAD_API_PTR *PFNGLGENBUFFERSPROC)(GLsizei n, GLuint * buffers);
+typedef void (GLAD_API_PTR *PFNGLGENFRAMEBUFFERSPROC)(GLsizei n, GLuint * framebuffers);
+typedef GLuint (GLAD_API_PTR *PFNGLGENLISTSPROC)(GLsizei range);
+typedef void (GLAD_API_PTR *PFNGLGENQUERIESPROC)(GLsizei n, GLuint * ids);
+typedef void (GLAD_API_PTR *PFNGLGENRENDERBUFFERSPROC)(GLsizei n, GLuint * renderbuffers);
+typedef void (GLAD_API_PTR *PFNGLGENSAMPLERSPROC)(GLsizei count, GLuint * samplers);
+typedef void (GLAD_API_PTR *PFNGLGENTEXTURESPROC)(GLsizei n, GLuint * textures);
+typedef void (GLAD_API_PTR *PFNGLGENVERTEXARRAYSPROC)(GLsizei n, GLuint * arrays);
+typedef void (GLAD_API_PTR *PFNGLGENERATEMIPMAPPROC)(GLenum target);
+typedef void (GLAD_API_PTR *PFNGLGETACTIVEATTRIBPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name);
+typedef void (GLAD_API_PTR *PFNGLGETACTIVEUNIFORMPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name);
+typedef void (GLAD_API_PTR *PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei * length, GLchar * uniformBlockName);
+typedef void (GLAD_API_PTR *PFNGLGETACTIVEUNIFORMBLOCKIVPROC)(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint * params);
+typedef void (GLAD_API_PTR *PFNGLGETACTIVEUNIFORMNAMEPROC)(GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei * length, GLchar * uniformName);
+typedef void (GLAD_API_PTR *PFNGLGETACTIVEUNIFORMSIVPROC)(GLuint program, GLsizei uniformCount, const GLuint * uniformIndices, GLenum pname, GLint * params);
+typedef void (GLAD_API_PTR *PFNGLGETATTACHEDSHADERSPROC)(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * shaders);
+typedef GLint (GLAD_API_PTR *PFNGLGETATTRIBLOCATIONPROC)(GLuint program, const GLchar * name);
+typedef void (GLAD_API_PTR *PFNGLGETBOOLEANI_VPROC)(GLenum target, GLuint index, GLboolean * data);
+typedef void (GLAD_API_PTR *PFNGLGETBOOLEANVPROC)(GLenum pname, GLboolean * data);
+typedef void (GLAD_API_PTR *PFNGLGETBUFFERPARAMETERI64VPROC)(GLenum target, GLenum pname, GLint64 * params);
+typedef void (GLAD_API_PTR *PFNGLGETBUFFERPARAMETERIVPROC)(GLenum target, GLenum pname, GLint * params);
+typedef void (GLAD_API_PTR *PFNGLGETBUFFERPOINTERVPROC)(GLenum target, GLenum pname, void ** params);
+typedef void (GLAD_API_PTR *PFNGLGETBUFFERSUBDATAPROC)(GLenum target, GLintptr offset, GLsizeiptr size, void * data);
+typedef void (GLAD_API_PTR *PFNGLGETCLIPPLANEPROC)(GLenum plane, GLdouble * equation);
+typedef void (GLAD_API_PTR *PFNGLGETCOMPRESSEDTEXIMAGEPROC)(GLenum target, GLint level, void * img);
+typedef GLuint (GLAD_API_PTR *PFNGLGETDEBUGMESSAGELOGPROC)(GLuint count, GLsizei bufSize, GLenum * sources, GLenum * types, GLuint * ids, GLenum * severities, GLsizei * lengths, GLchar * messageLog);
+typedef void (GLAD_API_PTR *PFNGLGETDOUBLEVPROC)(GLenum pname, GLdouble * data);
+typedef GLenum (GLAD_API_PTR *PFNGLGETERRORPROC)(void);
+typedef void (GLAD_API_PTR *PFNGLGETFLOATVPROC)(GLenum pname, GLfloat * data);
+typedef GLint (GLAD_API_PTR *PFNGLGETFRAGDATAINDEXPROC)(GLuint program, const GLchar * name);
+typedef GLint (GLAD_API_PTR *PFNGLGETFRAGDATALOCATIONPROC)(GLuint program, const GLchar * name);
+typedef void (GLAD_API_PTR *PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)(GLenum target, GLenum attachment, GLenum pname, GLint * params);
+typedef GLenum (GLAD_API_PTR *PFNGLGETGRAPHICSRESETSTATUSARBPROC)(void);
+typedef void (GLAD_API_PTR *PFNGLGETINTEGER64I_VPROC)(GLenum target, GLuint index, GLint64 * data);
+typedef void (GLAD_API_PTR *PFNGLGETINTEGER64VPROC)(GLenum pname, GLint64 * data);
+typedef void (GLAD_API_PTR *PFNGLGETINTEGERI_VPROC)(GLenum target, GLuint index, GLint * data);
+typedef void (GLAD_API_PTR *PFNGLGETINTEGERVPROC)(GLenum pname, GLint * data);
+typedef void (GLAD_API_PTR *PFNGLGETLIGHTFVPROC)(GLenum light, GLenum pname, GLfloat * params);
+typedef void (GLAD_API_PTR *PFNGLGETLIGHTIVPROC)(GLenum light, GLenum pname, GLint * params);
+typedef void (GLAD_API_PTR *PFNGLGETMAPDVPROC)(GLenum target, GLenum query, GLdouble * v);
+typedef void (GLAD_API_PTR *PFNGLGETMAPFVPROC)(GLenum target, GLenum query, GLfloat * v);
+typedef void (GLAD_API_PTR *PFNGLGETMAPIVPROC)(GLenum target, GLenum query, GLint * v);
+typedef void (GLAD_API_PTR *PFNGLGETMATERIALFVPROC)(GLenum face, GLenum pname, GLfloat * params);
+typedef void (GLAD_API_PTR *PFNGLGETMATERIALIVPROC)(GLenum face, GLenum pname, GLint * params);
+typedef void (GLAD_API_PTR *PFNGLGETMULTISAMPLEFVPROC)(GLenum pname, GLuint index, GLfloat * val);
+typedef void (GLAD_API_PTR *PFNGLGETOBJECTLABELPROC)(GLenum identifier, GLuint name, GLsizei bufSize, GLsizei * length, GLchar * label);
+typedef void (GLAD_API_PTR *PFNGLGETOBJECTPTRLABELPROC)(const void * ptr, GLsizei bufSize, GLsizei * length, GLchar * label);
+typedef void (GLAD_API_PTR *PFNGLGETPIXELMAPFVPROC)(GLenum map, GLfloat * values);
+typedef void (GLAD_API_PTR *PFNGLGETPIXELMAPUIVPROC)(GLenum map, GLuint * values);
+typedef void (GLAD_API_PTR *PFNGLGETPIXELMAPUSVPROC)(GLenum map, GLushort * values);
+typedef void (GLAD_API_PTR *PFNGLGETPOINTERVPROC)(GLenum pname, void ** params);
+typedef void (GLAD_API_PTR *PFNGLGETPOLYGONSTIPPLEPROC)(GLubyte * mask);
+typedef void (GLAD_API_PTR *PFNGLGETPROGRAMINFOLOGPROC)(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog);
+typedef void (GLAD_API_PTR *PFNGLGETPROGRAMIVPROC)(GLuint program, GLenum pname, GLint * params);
+typedef void (GLAD_API_PTR *PFNGLGETQUERYOBJECTI64VPROC)(GLuint id, GLenum pname, GLint64 * params);
+typedef void (GLAD_API_PTR *PFNGLGETQUERYOBJECTIVPROC)(GLuint id, GLenum pname, GLint * params);
+typedef void (GLAD_API_PTR *PFNGLGETQUERYOBJECTUI64VPROC)(GLuint id, GLenum pname, GLuint64 * params);
+typedef void (GLAD_API_PTR *PFNGLGETQUERYOBJECTUIVPROC)(GLuint id, GLenum pname, GLuint * params);
+typedef void (GLAD_API_PTR *PFNGLGETQUERYIVPROC)(GLenum target, GLenum pname, GLint * params);
+typedef void (GLAD_API_PTR *PFNGLGETRENDERBUFFERPARAMETERIVPROC)(GLenum target, GLenum pname, GLint * params);
+typedef void (GLAD_API_PTR *PFNGLGETSAMPLERPARAMETERIIVPROC)(GLuint sampler, GLenum pname, GLint * params);
+typedef void (GLAD_API_PTR *PFNGLGETSAMPLERPARAMETERIUIVPROC)(GLuint sampler, GLenum pname, GLuint * params);
+typedef void (GLAD_API_PTR *PFNGLGETSAMPLERPARAMETERFVPROC)(GLuint sampler, GLenum pname, GLfloat * params);
+typedef void (GLAD_API_PTR *PFNGLGETSAMPLERPARAMETERIVPROC)(GLuint sampler, GLenum pname, GLint * params);
+typedef void (GLAD_API_PTR *PFNGLGETSHADERINFOLOGPROC)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog);
+typedef void (GLAD_API_PTR *PFNGLGETSHADERSOURCEPROC)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * source);
+typedef void (GLAD_API_PTR *PFNGLGETSHADERIVPROC)(GLuint shader, GLenum pname, GLint * params);
+typedef const GLubyte * (GLAD_API_PTR *PFNGLGETSTRINGPROC)(GLenum name);
+typedef const GLubyte * (GLAD_API_PTR *PFNGLGETSTRINGIPROC)(GLenum name, GLuint index);
+typedef void (GLAD_API_PTR *PFNGLGETSYNCIVPROC)(GLsync sync, GLenum pname, GLsizei count, GLsizei * length, GLint * values);
+typedef void (GLAD_API_PTR *PFNGLGETTEXENVFVPROC)(GLenum target, GLenum pname, GLfloat * params);
+typedef void (GLAD_API_PTR *PFNGLGETTEXENVIVPROC)(GLenum target, GLenum pname, GLint * params);
+typedef void (GLAD_API_PTR *PFNGLGETTEXGENDVPROC)(GLenum coord, GLenum pname, GLdouble * params);
+typedef void (GLAD_API_PTR *PFNGLGETTEXGENFVPROC)(GLenum coord, GLenum pname, GLfloat * params);
+typedef void (GLAD_API_PTR *PFNGLGETTEXGENIVPROC)(GLenum coord, GLenum pname, GLint * params);
+typedef void (GLAD_API_PTR *PFNGLGETTEXIMAGEPROC)(GLenum target, GLint level, GLenum format, GLenum type, void * pixels);
+typedef void (GLAD_API_PTR *PFNGLGETTEXLEVELPARAMETERFVPROC)(GLenum target, GLint level, GLenum pname, GLfloat * params);
+typedef void (GLAD_API_PTR *PFNGLGETTEXLEVELPARAMETERIVPROC)(GLenum target, GLint level, GLenum pname, GLint * params);
+typedef void (GLAD_API_PTR *PFNGLGETTEXPARAMETERIIVPROC)(GLenum target, GLenum pname, GLint * params);
+typedef void (GLAD_API_PTR *PFNGLGETTEXPARAMETERIUIVPROC)(GLenum target, GLenum pname, GLuint * params);
+typedef void (GLAD_API_PTR *PFNGLGETTEXPARAMETERFVPROC)(GLenum target, GLenum pname, GLfloat * params);
+typedef void (GLAD_API_PTR *PFNGLGETTEXPARAMETERIVPROC)(GLenum target, GLenum pname, GLint * params);
+typedef void (GLAD_API_PTR *PFNGLGETTRANSFORMFEEDBACKVARYINGPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, GLchar * name);
+typedef GLuint (GLAD_API_PTR *PFNGLGETUNIFORMBLOCKINDEXPROC)(GLuint program, const GLchar * uniformBlockName);
+typedef void (GLAD_API_PTR *PFNGLGETUNIFORMINDICESPROC)(GLuint program, GLsizei uniformCount, const GLchar *const* uniformNames, GLuint * uniformIndices);
+typedef GLint (GLAD_API_PTR *PFNGLGETUNIFORMLOCATIONPROC)(GLuint program, const GLchar * name);
+typedef void (GLAD_API_PTR *PFNGLGETUNIFORMFVPROC)(GLuint program, GLint location, GLfloat * params);
+typedef void (GLAD_API_PTR *PFNGLGETUNIFORMIVPROC)(GLuint program, GLint location, GLint * params);
+typedef void (GLAD_API_PTR *PFNGLGETUNIFORMUIVPROC)(GLuint program, GLint location, GLuint * params);
+typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBIIVPROC)(GLuint index, GLenum pname, GLint * params);
+typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBIUIVPROC)(GLuint index, GLenum pname, GLuint * params);
+typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBPOINTERVPROC)(GLuint index, GLenum pname, void ** pointer);
+typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBDVPROC)(GLuint index, GLenum pname, GLdouble * params);
+typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBFVPROC)(GLuint index, GLenum pname, GLfloat * params);
+typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBIVPROC)(GLuint index, GLenum pname, GLint * params);
+typedef void (GLAD_API_PTR *PFNGLGETNCOLORTABLEARBPROC)(GLenum target, GLenum format, GLenum type, GLsizei bufSize, void * table);
+typedef void (GLAD_API_PTR *PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC)(GLenum target, GLint lod, GLsizei bufSize, void * img);
+typedef void (GLAD_API_PTR *PFNGLGETNCONVOLUTIONFILTERARBPROC)(GLenum target, GLenum format, GLenum type, GLsizei bufSize, void * image);
+typedef void (GLAD_API_PTR *PFNGLGETNHISTOGRAMARBPROC)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void * values);
+typedef void (GLAD_API_PTR *PFNGLGETNMAPDVARBPROC)(GLenum target, GLenum query, GLsizei bufSize, GLdouble * v);
+typedef void (GLAD_API_PTR *PFNGLGETNMAPFVARBPROC)(GLenum target, GLenum query, GLsizei bufSize, GLfloat * v);
+typedef void (GLAD_API_PTR *PFNGLGETNMAPIVARBPROC)(GLenum target, GLenum query, GLsizei bufSize, GLint * v);
+typedef void (GLAD_API_PTR *PFNGLGETNMINMAXARBPROC)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void * values);
+typedef void (GLAD_API_PTR *PFNGLGETNPIXELMAPFVARBPROC)(GLenum map, GLsizei bufSize, GLfloat * values);
+typedef void (GLAD_API_PTR *PFNGLGETNPIXELMAPUIVARBPROC)(GLenum map, GLsizei bufSize, GLuint * values);
+typedef void (GLAD_API_PTR *PFNGLGETNPIXELMAPUSVARBPROC)(GLenum map, GLsizei bufSize, GLushort * values);
+typedef void (GLAD_API_PTR *PFNGLGETNPOLYGONSTIPPLEARBPROC)(GLsizei bufSize, GLubyte * pattern);
+typedef void (GLAD_API_PTR *PFNGLGETNSEPARABLEFILTERARBPROC)(GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void * row, GLsizei columnBufSize, void * column, void * span);
+typedef void (GLAD_API_PTR *PFNGLGETNTEXIMAGEARBPROC)(GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void * img);
+typedef void (GLAD_API_PTR *PFNGLGETNUNIFORMDVARBPROC)(GLuint program, GLint location, GLsizei bufSize, GLdouble * params);
+typedef void (GLAD_API_PTR *PFNGLGETNUNIFORMFVARBPROC)(GLuint program, GLint location, GLsizei bufSize, GLfloat * params);
+typedef void (GLAD_API_PTR *PFNGLGETNUNIFORMIVARBPROC)(GLuint program, GLint location, GLsizei bufSize, GLint * params);
+typedef void (GLAD_API_PTR *PFNGLGETNUNIFORMUIVARBPROC)(GLuint program, GLint location, GLsizei bufSize, GLuint * params);
+typedef void (GLAD_API_PTR *PFNGLHINTPROC)(GLenum target, GLenum mode);
+typedef void (GLAD_API_PTR *PFNGLINDEXMASKPROC)(GLuint mask);
+typedef void (GLAD_API_PTR *PFNGLINDEXPOINTERPROC)(GLenum type, GLsizei stride, const void * pointer);
+typedef void (GLAD_API_PTR *PFNGLINDEXDPROC)(GLdouble c);
+typedef void (GLAD_API_PTR *PFNGLINDEXDVPROC)(const GLdouble * c);
+typedef void (GLAD_API_PTR *PFNGLINDEXFPROC)(GLfloat c);
+typedef void (GLAD_API_PTR *PFNGLINDEXFVPROC)(const GLfloat * c);
+typedef void (GLAD_API_PTR *PFNGLINDEXIPROC)(GLint c);
+typedef void (GLAD_API_PTR *PFNGLINDEXIVPROC)(const GLint * c);
+typedef void (GLAD_API_PTR *PFNGLINDEXSPROC)(GLshort c);
+typedef void (GLAD_API_PTR *PFNGLINDEXSVPROC)(const GLshort * c);
+typedef void (GLAD_API_PTR *PFNGLINDEXUBPROC)(GLubyte c);
+typedef void (GLAD_API_PTR *PFNGLINDEXUBVPROC)(const GLubyte * c);
+typedef void (GLAD_API_PTR *PFNGLINITNAMESPROC)(void);
+typedef void (GLAD_API_PTR *PFNGLINTERLEAVEDARRAYSPROC)(GLenum format, GLsizei stride, const void * pointer);
+typedef GLboolean (GLAD_API_PTR *PFNGLISBUFFERPROC)(GLuint buffer);
+typedef GLboolean (GLAD_API_PTR *PFNGLISENABLEDPROC)(GLenum cap);
+typedef GLboolean (GLAD_API_PTR *PFNGLISENABLEDIPROC)(GLenum target, GLuint index);
+typedef GLboolean (GLAD_API_PTR *PFNGLISFRAMEBUFFERPROC)(GLuint framebuffer);
+typedef GLboolean (GLAD_API_PTR *PFNGLISLISTPROC)(GLuint list);
+typedef GLboolean (GLAD_API_PTR *PFNGLISPROGRAMPROC)(GLuint program);
+typedef GLboolean (GLAD_API_PTR *PFNGLISQUERYPROC)(GLuint id);
+typedef GLboolean (GLAD_API_PTR *PFNGLISRENDERBUFFERPROC)(GLuint renderbuffer);
+typedef GLboolean (GLAD_API_PTR *PFNGLISSAMPLERPROC)(GLuint sampler);
+typedef GLboolean (GLAD_API_PTR *PFNGLISSHADERPROC)(GLuint shader);
+typedef GLboolean (GLAD_API_PTR *PFNGLISSYNCPROC)(GLsync sync);
+typedef GLboolean (GLAD_API_PTR *PFNGLISTEXTUREPROC)(GLuint texture);
+typedef GLboolean (GLAD_API_PTR *PFNGLISVERTEXARRAYPROC)(GLuint array);
+typedef void (GLAD_API_PTR *PFNGLLIGHTMODELFPROC)(GLenum pname, GLfloat param);
+typedef void (GLAD_API_PTR *PFNGLLIGHTMODELFVPROC)(GLenum pname, const GLfloat * params);
+typedef void (GLAD_API_PTR *PFNGLLIGHTMODELIPROC)(GLenum pname, GLint param);
+typedef void (GLAD_API_PTR *PFNGLLIGHTMODELIVPROC)(GLenum pname, const GLint * params);
+typedef void (GLAD_API_PTR *PFNGLLIGHTFPROC)(GLenum light, GLenum pname, GLfloat param);
+typedef void (GLAD_API_PTR *PFNGLLIGHTFVPROC)(GLenum light, GLenum pname, const GLfloat * params);
+typedef void (GLAD_API_PTR *PFNGLLIGHTIPROC)(GLenum light, GLenum pname, GLint param);
+typedef void (GLAD_API_PTR *PFNGLLIGHTIVPROC)(GLenum light, GLenum pname, const GLint * params);
+typedef void (GLAD_API_PTR *PFNGLLINESTIPPLEPROC)(GLint factor, GLushort pattern);
+typedef void (GLAD_API_PTR *PFNGLLINEWIDTHPROC)(GLfloat width);
+typedef void (GLAD_API_PTR *PFNGLLINKPROGRAMPROC)(GLuint program);
+typedef void (GLAD_API_PTR *PFNGLLISTBASEPROC)(GLuint base);
+typedef void (GLAD_API_PTR *PFNGLLOADIDENTITYPROC)(void);
+typedef void (GLAD_API_PTR *PFNGLLOADMATRIXDPROC)(const GLdouble * m);
+typedef void (GLAD_API_PTR *PFNGLLOADMATRIXFPROC)(const GLfloat * m);
+typedef void (GLAD_API_PTR *PFNGLLOADNAMEPROC)(GLuint name);
+typedef void (GLAD_API_PTR *PFNGLLOADTRANSPOSEMATRIXDPROC)(const GLdouble * m);
+typedef void (GLAD_API_PTR *PFNGLLOADTRANSPOSEMATRIXFPROC)(const GLfloat * m);
+typedef void (GLAD_API_PTR *PFNGLLOGICOPPROC)(GLenum opcode);
+typedef void (GLAD_API_PTR *PFNGLMAP1DPROC)(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble * points);
+typedef void (GLAD_API_PTR *PFNGLMAP1FPROC)(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat * points);
+typedef void (GLAD_API_PTR *PFNGLMAP2DPROC)(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble * points);
+typedef void (GLAD_API_PTR *PFNGLMAP2FPROC)(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat * points);
+typedef void * (GLAD_API_PTR *PFNGLMAPBUFFERPROC)(GLenum target, GLenum access);
+typedef void * (GLAD_API_PTR *PFNGLMAPBUFFERRANGEPROC)(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
+typedef void (GLAD_API_PTR *PFNGLMAPGRID1DPROC)(GLint un, GLdouble u1, GLdouble u2);
+typedef void (GLAD_API_PTR *PFNGLMAPGRID1FPROC)(GLint un, GLfloat u1, GLfloat u2);
+typedef void (GLAD_API_PTR *PFNGLMAPGRID2DPROC)(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2);
+typedef void (GLAD_API_PTR *PFNGLMAPGRID2FPROC)(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2);
+typedef void (GLAD_API_PTR *PFNGLMATERIALFPROC)(GLenum face, GLenum pname, GLfloat param);
+typedef void (GLAD_API_PTR *PFNGLMATERIALFVPROC)(GLenum face, GLenum pname, const GLfloat * params);
+typedef void (GLAD_API_PTR *PFNGLMATERIALIPROC)(GLenum face, GLenum pname, GLint param);
+typedef void (GLAD_API_PTR *PFNGLMATERIALIVPROC)(GLenum face, GLenum pname, const GLint * params);
+typedef void (GLAD_API_PTR *PFNGLMATRIXMODEPROC)(GLenum mode);
+typedef void (GLAD_API_PTR *PFNGLMULTMATRIXDPROC)(const GLdouble * m);
+typedef void (GLAD_API_PTR *PFNGLMULTMATRIXFPROC)(const GLfloat * m);
+typedef void (GLAD_API_PTR *PFNGLMULTTRANSPOSEMATRIXDPROC)(const GLdouble * m);
+typedef void (GLAD_API_PTR *PFNGLMULTTRANSPOSEMATRIXFPROC)(const GLfloat * m);
+typedef void (GLAD_API_PTR *PFNGLMULTIDRAWARRAYSPROC)(GLenum mode, const GLint * first, const GLsizei * count, GLsizei drawcount);
+typedef void (GLAD_API_PTR *PFNGLMULTIDRAWELEMENTSPROC)(GLenum mode, const GLsizei * count, GLenum type, const void *const* indices, GLsizei drawcount);
+typedef void (GLAD_API_PTR *PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)(GLenum mode, const GLsizei * count, GLenum type, const void *const* indices, GLsizei drawcount, const GLint * basevertex);
+typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD1DPROC)(GLenum target, GLdouble s);
+typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD1DVPROC)(GLenum target, const GLdouble * v);
+typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD1FPROC)(GLenum target, GLfloat s);
+typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD1FVPROC)(GLenum target, const GLfloat * v);
+typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD1IPROC)(GLenum target, GLint s);
+typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD1IVPROC)(GLenum target, const GLint * v);
+typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD1SPROC)(GLenum target, GLshort s);
+typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD1SVPROC)(GLenum target, const GLshort * v);
+typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD2DPROC)(GLenum target, GLdouble s, GLdouble t);
+typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD2DVPROC)(GLenum target, const GLdouble * v);
+typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD2FPROC)(GLenum target, GLfloat s, GLfloat t);
+typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD2FVPROC)(GLenum target, const GLfloat * v);
+typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD2IPROC)(GLenum target, GLint s, GLint t);
+typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD2IVPROC)(GLenum target, const GLint * v);
+typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD2SPROC)(GLenum target, GLshort s, GLshort t);
+typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD2SVPROC)(GLenum target, const GLshort * v);
+typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD3DPROC)(GLenum target, GLdouble s, GLdouble t, GLdouble r);
+typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD3DVPROC)(GLenum target, const GLdouble * v);
+typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD3FPROC)(GLenum target, GLfloat s, GLfloat t, GLfloat r);
+typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD3FVPROC)(GLenum target, const GLfloat * v);
+typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD3IPROC)(GLenum target, GLint s, GLint t, GLint r);
+typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD3IVPROC)(GLenum target, const GLint * v);
+typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD3SPROC)(GLenum target, GLshort s, GLshort t, GLshort r);
+typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD3SVPROC)(GLenum target, const GLshort * v);
+typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD4DPROC)(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD4DVPROC)(GLenum target, const GLdouble * v);
+typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD4FPROC)(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD4FVPROC)(GLenum target, const GLfloat * v);
+typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD4IPROC)(GLenum target, GLint s, GLint t, GLint r, GLint q);
+typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD4IVPROC)(GLenum target, const GLint * v);
+typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD4SPROC)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
+typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORD4SVPROC)(GLenum target, const GLshort * v);
+typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORDP1UIPROC)(GLenum texture, GLenum type, GLuint coords);
+typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORDP1UIVPROC)(GLenum texture, GLenum type, const GLuint * coords);
+typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORDP2UIPROC)(GLenum texture, GLenum type, GLuint coords);
+typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORDP2UIVPROC)(GLenum texture, GLenum type, const GLuint * coords);
+typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORDP3UIPROC)(GLenum texture, GLenum type, GLuint coords);
+typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORDP3UIVPROC)(GLenum texture, GLenum type, const GLuint * coords);
+typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORDP4UIPROC)(GLenum texture, GLenum type, GLuint coords);
+typedef void (GLAD_API_PTR *PFNGLMULTITEXCOORDP4UIVPROC)(GLenum texture, GLenum type, const GLuint * coords);
+typedef void (GLAD_API_PTR *PFNGLNEWLISTPROC)(GLuint list, GLenum mode);
+typedef void (GLAD_API_PTR *PFNGLNORMAL3BPROC)(GLbyte nx, GLbyte ny, GLbyte nz);
+typedef void (GLAD_API_PTR *PFNGLNORMAL3BVPROC)(const GLbyte * v);
+typedef void (GLAD_API_PTR *PFNGLNORMAL3DPROC)(GLdouble nx, GLdouble ny, GLdouble nz);
+typedef void (GLAD_API_PTR *PFNGLNORMAL3DVPROC)(const GLdouble * v);
+typedef void (GLAD_API_PTR *PFNGLNORMAL3FPROC)(GLfloat nx, GLfloat ny, GLfloat nz);
+typedef void (GLAD_API_PTR *PFNGLNORMAL3FVPROC)(const GLfloat * v);
+typedef void (GLAD_API_PTR *PFNGLNORMAL3IPROC)(GLint nx, GLint ny, GLint nz);
+typedef void (GLAD_API_PTR *PFNGLNORMAL3IVPROC)(const GLint * v);
+typedef void (GLAD_API_PTR *PFNGLNORMAL3SPROC)(GLshort nx, GLshort ny, GLshort nz);
+typedef void (GLAD_API_PTR *PFNGLNORMAL3SVPROC)(const GLshort * v);
+typedef void (GLAD_API_PTR *PFNGLNORMALP3UIPROC)(GLenum type, GLuint coords);
+typedef void (GLAD_API_PTR *PFNGLNORMALP3UIVPROC)(GLenum type, const GLuint * coords);
+typedef void (GLAD_API_PTR *PFNGLNORMALPOINTERPROC)(GLenum type, GLsizei stride, const void * pointer);
+typedef void (GLAD_API_PTR *PFNGLOBJECTLABELPROC)(GLenum identifier, GLuint name, GLsizei length, const GLchar * label);
+typedef void (GLAD_API_PTR *PFNGLOBJECTPTRLABELPROC)(const void * ptr, GLsizei length, const GLchar * label);
+typedef void (GLAD_API_PTR *PFNGLORTHOPROC)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+typedef void (GLAD_API_PTR *PFNGLPASSTHROUGHPROC)(GLfloat token);
+typedef void (GLAD_API_PTR *PFNGLPIXELMAPFVPROC)(GLenum map, GLsizei mapsize, const GLfloat * values);
+typedef void (GLAD_API_PTR *PFNGLPIXELMAPUIVPROC)(GLenum map, GLsizei mapsize, const GLuint * values);
+typedef void (GLAD_API_PTR *PFNGLPIXELMAPUSVPROC)(GLenum map, GLsizei mapsize, const GLushort * values);
+typedef void (GLAD_API_PTR *PFNGLPIXELSTOREFPROC)(GLenum pname, GLfloat param);
+typedef void (GLAD_API_PTR *PFNGLPIXELSTOREIPROC)(GLenum pname, GLint param);
+typedef void (GLAD_API_PTR *PFNGLPIXELTRANSFERFPROC)(GLenum pname, GLfloat param);
+typedef void (GLAD_API_PTR *PFNGLPIXELTRANSFERIPROC)(GLenum pname, GLint param);
+typedef void (GLAD_API_PTR *PFNGLPIXELZOOMPROC)(GLfloat xfactor, GLfloat yfactor);
+typedef void (GLAD_API_PTR *PFNGLPOINTPARAMETERFPROC)(GLenum pname, GLfloat param);
+typedef void (GLAD_API_PTR *PFNGLPOINTPARAMETERFVPROC)(GLenum pname, const GLfloat * params);
+typedef void (GLAD_API_PTR *PFNGLPOINTPARAMETERIPROC)(GLenum pname, GLint param);
+typedef void (GLAD_API_PTR *PFNGLPOINTPARAMETERIVPROC)(GLenum pname, const GLint * params);
+typedef void (GLAD_API_PTR *PFNGLPOINTSIZEPROC)(GLfloat size);
+typedef void (GLAD_API_PTR *PFNGLPOLYGONMODEPROC)(GLenum face, GLenum mode);
+typedef void (GLAD_API_PTR *PFNGLPOLYGONOFFSETPROC)(GLfloat factor, GLfloat units);
+typedef void (GLAD_API_PTR *PFNGLPOLYGONSTIPPLEPROC)(const GLubyte * mask);
+typedef void (GLAD_API_PTR *PFNGLPOPATTRIBPROC)(void);
+typedef void (GLAD_API_PTR *PFNGLPOPCLIENTATTRIBPROC)(void);
+typedef void (GLAD_API_PTR *PFNGLPOPDEBUGGROUPPROC)(void);
+typedef void (GLAD_API_PTR *PFNGLPOPMATRIXPROC)(void);
+typedef void (GLAD_API_PTR *PFNGLPOPNAMEPROC)(void);
+typedef void (GLAD_API_PTR *PFNGLPRIMITIVERESTARTINDEXPROC)(GLuint index);
+typedef void (GLAD_API_PTR *PFNGLPRIORITIZETEXTURESPROC)(GLsizei n, const GLuint * textures, const GLfloat * priorities);
+typedef void (GLAD_API_PTR *PFNGLPROVOKINGVERTEXPROC)(GLenum mode);
+typedef void (GLAD_API_PTR *PFNGLPUSHATTRIBPROC)(GLbitfield mask);
+typedef void (GLAD_API_PTR *PFNGLPUSHCLIENTATTRIBPROC)(GLbitfield mask);
+typedef void (GLAD_API_PTR *PFNGLPUSHDEBUGGROUPPROC)(GLenum source, GLuint id, GLsizei length, const GLchar * message);
+typedef void (GLAD_API_PTR *PFNGLPUSHMATRIXPROC)(void);
+typedef void (GLAD_API_PTR *PFNGLPUSHNAMEPROC)(GLuint name);
+typedef void (GLAD_API_PTR *PFNGLQUERYCOUNTERPROC)(GLuint id, GLenum target);
+typedef void (GLAD_API_PTR *PFNGLRASTERPOS2DPROC)(GLdouble x, GLdouble y);
+typedef void (GLAD_API_PTR *PFNGLRASTERPOS2DVPROC)(const GLdouble * v);
+typedef void (GLAD_API_PTR *PFNGLRASTERPOS2FPROC)(GLfloat x, GLfloat y);
+typedef void (GLAD_API_PTR *PFNGLRASTERPOS2FVPROC)(const GLfloat * v);
+typedef void (GLAD_API_PTR *PFNGLRASTERPOS2IPROC)(GLint x, GLint y);
+typedef void (GLAD_API_PTR *PFNGLRASTERPOS2IVPROC)(const GLint * v);
+typedef void (GLAD_API_PTR *PFNGLRASTERPOS2SPROC)(GLshort x, GLshort y);
+typedef void (GLAD_API_PTR *PFNGLRASTERPOS2SVPROC)(const GLshort * v);
+typedef void (GLAD_API_PTR *PFNGLRASTERPOS3DPROC)(GLdouble x, GLdouble y, GLdouble z);
+typedef void (GLAD_API_PTR *PFNGLRASTERPOS3DVPROC)(const GLdouble * v);
+typedef void (GLAD_API_PTR *PFNGLRASTERPOS3FPROC)(GLfloat x, GLfloat y, GLfloat z);
+typedef void (GLAD_API_PTR *PFNGLRASTERPOS3FVPROC)(const GLfloat * v);
+typedef void (GLAD_API_PTR *PFNGLRASTERPOS3IPROC)(GLint x, GLint y, GLint z);
+typedef void (GLAD_API_PTR *PFNGLRASTERPOS3IVPROC)(const GLint * v);
+typedef void (GLAD_API_PTR *PFNGLRASTERPOS3SPROC)(GLshort x, GLshort y, GLshort z);
+typedef void (GLAD_API_PTR *PFNGLRASTERPOS3SVPROC)(const GLshort * v);
+typedef void (GLAD_API_PTR *PFNGLRASTERPOS4DPROC)(GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (GLAD_API_PTR *PFNGLRASTERPOS4DVPROC)(const GLdouble * v);
+typedef void (GLAD_API_PTR *PFNGLRASTERPOS4FPROC)(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (GLAD_API_PTR *PFNGLRASTERPOS4FVPROC)(const GLfloat * v);
+typedef void (GLAD_API_PTR *PFNGLRASTERPOS4IPROC)(GLint x, GLint y, GLint z, GLint w);
+typedef void (GLAD_API_PTR *PFNGLRASTERPOS4IVPROC)(const GLint * v);
+typedef void (GLAD_API_PTR *PFNGLRASTERPOS4SPROC)(GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (GLAD_API_PTR *PFNGLRASTERPOS4SVPROC)(const GLshort * v);
+typedef void (GLAD_API_PTR *PFNGLREADBUFFERPROC)(GLenum src);
+typedef void (GLAD_API_PTR *PFNGLREADPIXELSPROC)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void * pixels);
+typedef void (GLAD_API_PTR *PFNGLREADNPIXELSARBPROC)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void * data);
+typedef void (GLAD_API_PTR *PFNGLRECTDPROC)(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2);
+typedef void (GLAD_API_PTR *PFNGLRECTDVPROC)(const GLdouble * v1, const GLdouble * v2);
+typedef void (GLAD_API_PTR *PFNGLRECTFPROC)(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2);
+typedef void (GLAD_API_PTR *PFNGLRECTFVPROC)(const GLfloat * v1, const GLfloat * v2);
+typedef void (GLAD_API_PTR *PFNGLRECTIPROC)(GLint x1, GLint y1, GLint x2, GLint y2);
+typedef void (GLAD_API_PTR *PFNGLRECTIVPROC)(const GLint * v1, const GLint * v2);
+typedef void (GLAD_API_PTR *PFNGLRECTSPROC)(GLshort x1, GLshort y1, GLshort x2, GLshort y2);
+typedef void (GLAD_API_PTR *PFNGLRECTSVPROC)(const GLshort * v1, const GLshort * v2);
+typedef GLint (GLAD_API_PTR *PFNGLRENDERMODEPROC)(GLenum mode);
+typedef void (GLAD_API_PTR *PFNGLRENDERBUFFERSTORAGEPROC)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GLAD_API_PTR *PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GLAD_API_PTR *PFNGLROTATEDPROC)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
+typedef void (GLAD_API_PTR *PFNGLROTATEFPROC)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
+typedef void (GLAD_API_PTR *PFNGLSAMPLECOVERAGEPROC)(GLfloat value, GLboolean invert);
+typedef void (GLAD_API_PTR *PFNGLSAMPLECOVERAGEARBPROC)(GLfloat value, GLboolean invert);
+typedef void (GLAD_API_PTR *PFNGLSAMPLEMASKIPROC)(GLuint maskNumber, GLbitfield mask);
+typedef void (GLAD_API_PTR *PFNGLSAMPLERPARAMETERIIVPROC)(GLuint sampler, GLenum pname, const GLint * param);
+typedef void (GLAD_API_PTR *PFNGLSAMPLERPARAMETERIUIVPROC)(GLuint sampler, GLenum pname, const GLuint * param);
+typedef void (GLAD_API_PTR *PFNGLSAMPLERPARAMETERFPROC)(GLuint sampler, GLenum pname, GLfloat param);
+typedef void (GLAD_API_PTR *PFNGLSAMPLERPARAMETERFVPROC)(GLuint sampler, GLenum pname, const GLfloat * param);
+typedef void (GLAD_API_PTR *PFNGLSAMPLERPARAMETERIPROC)(GLuint sampler, GLenum pname, GLint param);
+typedef void (GLAD_API_PTR *PFNGLSAMPLERPARAMETERIVPROC)(GLuint sampler, GLenum pname, const GLint * param);
+typedef void (GLAD_API_PTR *PFNGLSCALEDPROC)(GLdouble x, GLdouble y, GLdouble z);
+typedef void (GLAD_API_PTR *PFNGLSCALEFPROC)(GLfloat x, GLfloat y, GLfloat z);
+typedef void (GLAD_API_PTR *PFNGLSCISSORPROC)(GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3BPROC)(GLbyte red, GLbyte green, GLbyte blue);
+typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3BVPROC)(const GLbyte * v);
+typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3DPROC)(GLdouble red, GLdouble green, GLdouble blue);
+typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3DVPROC)(const GLdouble * v);
+typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3FPROC)(GLfloat red, GLfloat green, GLfloat blue);
+typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3FVPROC)(const GLfloat * v);
+typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3IPROC)(GLint red, GLint green, GLint blue);
+typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3IVPROC)(const GLint * v);
+typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3SPROC)(GLshort red, GLshort green, GLshort blue);
+typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3SVPROC)(const GLshort * v);
+typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3UBPROC)(GLubyte red, GLubyte green, GLubyte blue);
+typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3UBVPROC)(const GLubyte * v);
+typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3UIPROC)(GLuint red, GLuint green, GLuint blue);
+typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3UIVPROC)(const GLuint * v);
+typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3USPROC)(GLushort red, GLushort green, GLushort blue);
+typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLOR3USVPROC)(const GLushort * v);
+typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLORP3UIPROC)(GLenum type, GLuint color);
+typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLORP3UIVPROC)(GLenum type, const GLuint * color);
+typedef void (GLAD_API_PTR *PFNGLSECONDARYCOLORPOINTERPROC)(GLint size, GLenum type, GLsizei stride, const void * pointer);
+typedef void (GLAD_API_PTR *PFNGLSELECTBUFFERPROC)(GLsizei size, GLuint * buffer);
+typedef void (GLAD_API_PTR *PFNGLSHADEMODELPROC)(GLenum mode);
+typedef void (GLAD_API_PTR *PFNGLSHADERSOURCEPROC)(GLuint shader, GLsizei count, const GLchar *const* string, const GLint * length);
+typedef void (GLAD_API_PTR *PFNGLSTENCILFUNCPROC)(GLenum func, GLint ref, GLuint mask);
+typedef void (GLAD_API_PTR *PFNGLSTENCILFUNCSEPARATEPROC)(GLenum face, GLenum func, GLint ref, GLuint mask);
+typedef void (GLAD_API_PTR *PFNGLSTENCILMASKPROC)(GLuint mask);
+typedef void (GLAD_API_PTR *PFNGLSTENCILMASKSEPARATEPROC)(GLenum face, GLuint mask);
+typedef void (GLAD_API_PTR *PFNGLSTENCILOPPROC)(GLenum fail, GLenum zfail, GLenum zpass);
+typedef void (GLAD_API_PTR *PFNGLSTENCILOPSEPARATEPROC)(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
+typedef void (GLAD_API_PTR *PFNGLTEXBUFFERPROC)(GLenum target, GLenum internalformat, GLuint buffer);
+typedef void (GLAD_API_PTR *PFNGLTEXCOORD1DPROC)(GLdouble s);
+typedef void (GLAD_API_PTR *PFNGLTEXCOORD1DVPROC)(const GLdouble * v);
+typedef void (GLAD_API_PTR *PFNGLTEXCOORD1FPROC)(GLfloat s);
+typedef void (GLAD_API_PTR *PFNGLTEXCOORD1FVPROC)(const GLfloat * v);
+typedef void (GLAD_API_PTR *PFNGLTEXCOORD1IPROC)(GLint s);
+typedef void (GLAD_API_PTR *PFNGLTEXCOORD1IVPROC)(const GLint * v);
+typedef void (GLAD_API_PTR *PFNGLTEXCOORD1SPROC)(GLshort s);
+typedef void (GLAD_API_PTR *PFNGLTEXCOORD1SVPROC)(const GLshort * v);
+typedef void (GLAD_API_PTR *PFNGLTEXCOORD2DPROC)(GLdouble s, GLdouble t);
+typedef void (GLAD_API_PTR *PFNGLTEXCOORD2DVPROC)(const GLdouble * v);
+typedef void (GLAD_API_PTR *PFNGLTEXCOORD2FPROC)(GLfloat s, GLfloat t);
+typedef void (GLAD_API_PTR *PFNGLTEXCOORD2FVPROC)(const GLfloat * v);
+typedef void (GLAD_API_PTR *PFNGLTEXCOORD2IPROC)(GLint s, GLint t);
+typedef void (GLAD_API_PTR *PFNGLTEXCOORD2IVPROC)(const GLint * v);
+typedef void (GLAD_API_PTR *PFNGLTEXCOORD2SPROC)(GLshort s, GLshort t);
+typedef void (GLAD_API_PTR *PFNGLTEXCOORD2SVPROC)(const GLshort * v);
+typedef void (GLAD_API_PTR *PFNGLTEXCOORD3DPROC)(GLdouble s, GLdouble t, GLdouble r);
+typedef void (GLAD_API_PTR *PFNGLTEXCOORD3DVPROC)(const GLdouble * v);
+typedef void (GLAD_API_PTR *PFNGLTEXCOORD3FPROC)(GLfloat s, GLfloat t, GLfloat r);
+typedef void (GLAD_API_PTR *PFNGLTEXCOORD3FVPROC)(const GLfloat * v);
+typedef void (GLAD_API_PTR *PFNGLTEXCOORD3IPROC)(GLint s, GLint t, GLint r);
+typedef void (GLAD_API_PTR *PFNGLTEXCOORD3IVPROC)(const GLint * v);
+typedef void (GLAD_API_PTR *PFNGLTEXCOORD3SPROC)(GLshort s, GLshort t, GLshort r);
+typedef void (GLAD_API_PTR *PFNGLTEXCOORD3SVPROC)(const GLshort * v);
+typedef void (GLAD_API_PTR *PFNGLTEXCOORD4DPROC)(GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+typedef void (GLAD_API_PTR *PFNGLTEXCOORD4DVPROC)(const GLdouble * v);
+typedef void (GLAD_API_PTR *PFNGLTEXCOORD4FPROC)(GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+typedef void (GLAD_API_PTR *PFNGLTEXCOORD4FVPROC)(const GLfloat * v);
+typedef void (GLAD_API_PTR *PFNGLTEXCOORD4IPROC)(GLint s, GLint t, GLint r, GLint q);
+typedef void (GLAD_API_PTR *PFNGLTEXCOORD4IVPROC)(const GLint * v);
+typedef void (GLAD_API_PTR *PFNGLTEXCOORD4SPROC)(GLshort s, GLshort t, GLshort r, GLshort q);
+typedef void (GLAD_API_PTR *PFNGLTEXCOORD4SVPROC)(const GLshort * v);
+typedef void (GLAD_API_PTR *PFNGLTEXCOORDP1UIPROC)(GLenum type, GLuint coords);
+typedef void (GLAD_API_PTR *PFNGLTEXCOORDP1UIVPROC)(GLenum type, const GLuint * coords);
+typedef void (GLAD_API_PTR *PFNGLTEXCOORDP2UIPROC)(GLenum type, GLuint coords);
+typedef void (GLAD_API_PTR *PFNGLTEXCOORDP2UIVPROC)(GLenum type, const GLuint * coords);
+typedef void (GLAD_API_PTR *PFNGLTEXCOORDP3UIPROC)(GLenum type, GLuint coords);
+typedef void (GLAD_API_PTR *PFNGLTEXCOORDP3UIVPROC)(GLenum type, const GLuint * coords);
+typedef void (GLAD_API_PTR *PFNGLTEXCOORDP4UIPROC)(GLenum type, GLuint coords);
+typedef void (GLAD_API_PTR *PFNGLTEXCOORDP4UIVPROC)(GLenum type, const GLuint * coords);
+typedef void (GLAD_API_PTR *PFNGLTEXCOORDPOINTERPROC)(GLint size, GLenum type, GLsizei stride, const void * pointer);
+typedef void (GLAD_API_PTR *PFNGLTEXENVFPROC)(GLenum target, GLenum pname, GLfloat param);
+typedef void (GLAD_API_PTR *PFNGLTEXENVFVPROC)(GLenum target, GLenum pname, const GLfloat * params);
+typedef void (GLAD_API_PTR *PFNGLTEXENVIPROC)(GLenum target, GLenum pname, GLint param);
+typedef void (GLAD_API_PTR *PFNGLTEXENVIVPROC)(GLenum target, GLenum pname, const GLint * params);
+typedef void (GLAD_API_PTR *PFNGLTEXGENDPROC)(GLenum coord, GLenum pname, GLdouble param);
+typedef void (GLAD_API_PTR *PFNGLTEXGENDVPROC)(GLenum coord, GLenum pname, const GLdouble * params);
+typedef void (GLAD_API_PTR *PFNGLTEXGENFPROC)(GLenum coord, GLenum pname, GLfloat param);
+typedef void (GLAD_API_PTR *PFNGLTEXGENFVPROC)(GLenum coord, GLenum pname, const GLfloat * params);
+typedef void (GLAD_API_PTR *PFNGLTEXGENIPROC)(GLenum coord, GLenum pname, GLint param);
+typedef void (GLAD_API_PTR *PFNGLTEXGENIVPROC)(GLenum coord, GLenum pname, const GLint * params);
+typedef void (GLAD_API_PTR *PFNGLTEXIMAGE1DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void * pixels);
+typedef void (GLAD_API_PTR *PFNGLTEXIMAGE2DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void * pixels);
+typedef void (GLAD_API_PTR *PFNGLTEXIMAGE2DMULTISAMPLEPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
+typedef void (GLAD_API_PTR *PFNGLTEXIMAGE3DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void * pixels);
+typedef void (GLAD_API_PTR *PFNGLTEXIMAGE3DMULTISAMPLEPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
+typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERIIVPROC)(GLenum target, GLenum pname, const GLint * params);
+typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERIUIVPROC)(GLenum target, GLenum pname, const GLuint * params);
+typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERFPROC)(GLenum target, GLenum pname, GLfloat param);
+typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERFVPROC)(GLenum target, GLenum pname, const GLfloat * params);
+typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERIPROC)(GLenum target, GLenum pname, GLint param);
+typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERIVPROC)(GLenum target, GLenum pname, const GLint * params);
+typedef void (GLAD_API_PTR *PFNGLTEXSUBIMAGE1DPROC)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void * pixels);
+typedef void (GLAD_API_PTR *PFNGLTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void * pixels);
+typedef void (GLAD_API_PTR *PFNGLTEXSUBIMAGE3DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void * pixels);
+typedef void (GLAD_API_PTR *PFNGLTRANSFORMFEEDBACKVARYINGSPROC)(GLuint program, GLsizei count, const GLchar *const* varyings, GLenum bufferMode);
+typedef void (GLAD_API_PTR *PFNGLTRANSLATEDPROC)(GLdouble x, GLdouble y, GLdouble z);
+typedef void (GLAD_API_PTR *PFNGLTRANSLATEFPROC)(GLfloat x, GLfloat y, GLfloat z);
+typedef void (GLAD_API_PTR *PFNGLUNIFORM1FPROC)(GLint location, GLfloat v0);
+typedef void (GLAD_API_PTR *PFNGLUNIFORM1FVPROC)(GLint location, GLsizei count, const GLfloat * value);
+typedef void (GLAD_API_PTR *PFNGLUNIFORM1IPROC)(GLint location, GLint v0);
+typedef void (GLAD_API_PTR *PFNGLUNIFORM1IVPROC)(GLint location, GLsizei count, const GLint * value);
+typedef void (GLAD_API_PTR *PFNGLUNIFORM1UIPROC)(GLint location, GLuint v0);
+typedef void (GLAD_API_PTR *PFNGLUNIFORM1UIVPROC)(GLint location, GLsizei count, const GLuint * value);
+typedef void (GLAD_API_PTR *PFNGLUNIFORM2FPROC)(GLint location, GLfloat v0, GLfloat v1);
+typedef void (GLAD_API_PTR *PFNGLUNIFORM2FVPROC)(GLint location, GLsizei count, const GLfloat * value);
+typedef void (GLAD_API_PTR *PFNGLUNIFORM2IPROC)(GLint location, GLint v0, GLint v1);
+typedef void (GLAD_API_PTR *PFNGLUNIFORM2IVPROC)(GLint location, GLsizei count, const GLint * value);
+typedef void (GLAD_API_PTR *PFNGLUNIFORM2UIPROC)(GLint location, GLuint v0, GLuint v1);
+typedef void (GLAD_API_PTR *PFNGLUNIFORM2UIVPROC)(GLint location, GLsizei count, const GLuint * value);
+typedef void (GLAD_API_PTR *PFNGLUNIFORM3FPROC)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+typedef void (GLAD_API_PTR *PFNGLUNIFORM3FVPROC)(GLint location, GLsizei count, const GLfloat * value);
+typedef void (GLAD_API_PTR *PFNGLUNIFORM3IPROC)(GLint location, GLint v0, GLint v1, GLint v2);
+typedef void (GLAD_API_PTR *PFNGLUNIFORM3IVPROC)(GLint location, GLsizei count, const GLint * value);
+typedef void (GLAD_API_PTR *PFNGLUNIFORM3UIPROC)(GLint location, GLuint v0, GLuint v1, GLuint v2);
+typedef void (GLAD_API_PTR *PFNGLUNIFORM3UIVPROC)(GLint location, GLsizei count, const GLuint * value);
+typedef void (GLAD_API_PTR *PFNGLUNIFORM4FPROC)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+typedef void (GLAD_API_PTR *PFNGLUNIFORM4FVPROC)(GLint location, GLsizei count, const GLfloat * value);
+typedef void (GLAD_API_PTR *PFNGLUNIFORM4IPROC)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+typedef void (GLAD_API_PTR *PFNGLUNIFORM4IVPROC)(GLint location, GLsizei count, const GLint * value);
+typedef void (GLAD_API_PTR *PFNGLUNIFORM4UIPROC)(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+typedef void (GLAD_API_PTR *PFNGLUNIFORM4UIVPROC)(GLint location, GLsizei count, const GLuint * value);
+typedef void (GLAD_API_PTR *PFNGLUNIFORMBLOCKBINDINGPROC)(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
+typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX2FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
+typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX2X3FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
+typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX2X4FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
+typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX3FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
+typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX3X2FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
+typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX3X4FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
+typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX4FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
+typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX4X2FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
+typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX4X3FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
+typedef GLboolean (GLAD_API_PTR *PFNGLUNMAPBUFFERPROC)(GLenum target);
+typedef void (GLAD_API_PTR *PFNGLUSEPROGRAMPROC)(GLuint program);
+typedef void (GLAD_API_PTR *PFNGLVALIDATEPROGRAMPROC)(GLuint program);
+typedef void (GLAD_API_PTR *PFNGLVERTEX2DPROC)(GLdouble x, GLdouble y);
+typedef void (GLAD_API_PTR *PFNGLVERTEX2DVPROC)(const GLdouble * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEX2FPROC)(GLfloat x, GLfloat y);
+typedef void (GLAD_API_PTR *PFNGLVERTEX2FVPROC)(const GLfloat * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEX2IPROC)(GLint x, GLint y);
+typedef void (GLAD_API_PTR *PFNGLVERTEX2IVPROC)(const GLint * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEX2SPROC)(GLshort x, GLshort y);
+typedef void (GLAD_API_PTR *PFNGLVERTEX2SVPROC)(const GLshort * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEX3DPROC)(GLdouble x, GLdouble y, GLdouble z);
+typedef void (GLAD_API_PTR *PFNGLVERTEX3DVPROC)(const GLdouble * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEX3FPROC)(GLfloat x, GLfloat y, GLfloat z);
+typedef void (GLAD_API_PTR *PFNGLVERTEX3FVPROC)(const GLfloat * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEX3IPROC)(GLint x, GLint y, GLint z);
+typedef void (GLAD_API_PTR *PFNGLVERTEX3IVPROC)(const GLint * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEX3SPROC)(GLshort x, GLshort y, GLshort z);
+typedef void (GLAD_API_PTR *PFNGLVERTEX3SVPROC)(const GLshort * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEX4DPROC)(GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (GLAD_API_PTR *PFNGLVERTEX4DVPROC)(const GLdouble * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEX4FPROC)(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (GLAD_API_PTR *PFNGLVERTEX4FVPROC)(const GLfloat * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEX4IPROC)(GLint x, GLint y, GLint z, GLint w);
+typedef void (GLAD_API_PTR *PFNGLVERTEX4IVPROC)(const GLint * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEX4SPROC)(GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (GLAD_API_PTR *PFNGLVERTEX4SVPROC)(const GLshort * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1DPROC)(GLuint index, GLdouble x);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1DVPROC)(GLuint index, const GLdouble * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1FPROC)(GLuint index, GLfloat x);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1FVPROC)(GLuint index, const GLfloat * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1SPROC)(GLuint index, GLshort x);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1SVPROC)(GLuint index, const GLshort * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2DPROC)(GLuint index, GLdouble x, GLdouble y);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2DVPROC)(GLuint index, const GLdouble * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2FPROC)(GLuint index, GLfloat x, GLfloat y);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2FVPROC)(GLuint index, const GLfloat * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2SPROC)(GLuint index, GLshort x, GLshort y);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2SVPROC)(GLuint index, const GLshort * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3DPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3DVPROC)(GLuint index, const GLdouble * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3FPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3FVPROC)(GLuint index, const GLfloat * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3SPROC)(GLuint index, GLshort x, GLshort y, GLshort z);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3SVPROC)(GLuint index, const GLshort * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4NBVPROC)(GLuint index, const GLbyte * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4NIVPROC)(GLuint index, const GLint * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4NSVPROC)(GLuint index, const GLshort * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4NUBPROC)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4NUBVPROC)(GLuint index, const GLubyte * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4NUIVPROC)(GLuint index, const GLuint * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4NUSVPROC)(GLuint index, const GLushort * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4BVPROC)(GLuint index, const GLbyte * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4DPROC)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4DVPROC)(GLuint index, const GLdouble * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4FPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4FVPROC)(GLuint index, const GLfloat * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4IVPROC)(GLuint index, const GLint * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4SPROC)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4SVPROC)(GLuint index, const GLshort * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4UBVPROC)(GLuint index, const GLubyte * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4UIVPROC)(GLuint index, const GLuint * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4USVPROC)(GLuint index, const GLushort * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBDIVISORPROC)(GLuint index, GLuint divisor);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI1IPROC)(GLuint index, GLint x);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI1IVPROC)(GLuint index, const GLint * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI1UIPROC)(GLuint index, GLuint x);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI1UIVPROC)(GLuint index, const GLuint * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI2IPROC)(GLuint index, GLint x, GLint y);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI2IVPROC)(GLuint index, const GLint * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI2UIPROC)(GLuint index, GLuint x, GLuint y);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI2UIVPROC)(GLuint index, const GLuint * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI3IPROC)(GLuint index, GLint x, GLint y, GLint z);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI3IVPROC)(GLuint index, const GLint * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI3UIPROC)(GLuint index, GLuint x, GLuint y, GLuint z);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI3UIVPROC)(GLuint index, const GLuint * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4BVPROC)(GLuint index, const GLbyte * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4IPROC)(GLuint index, GLint x, GLint y, GLint z, GLint w);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4IVPROC)(GLuint index, const GLint * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4SVPROC)(GLuint index, const GLshort * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4UBVPROC)(GLuint index, const GLubyte * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4UIPROC)(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4UIVPROC)(GLuint index, const GLuint * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBI4USVPROC)(GLuint index, const GLushort * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBIPOINTERPROC)(GLuint index, GLint size, GLenum type, GLsizei stride, const void * pointer);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBP1UIPROC)(GLuint index, GLenum type, GLboolean normalized, GLuint value);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBP1UIVPROC)(GLuint index, GLenum type, GLboolean normalized, const GLuint * value);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBP2UIPROC)(GLuint index, GLenum type, GLboolean normalized, GLuint value);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBP2UIVPROC)(GLuint index, GLenum type, GLboolean normalized, const GLuint * value);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBP3UIPROC)(GLuint index, GLenum type, GLboolean normalized, GLuint value);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBP3UIVPROC)(GLuint index, GLenum type, GLboolean normalized, const GLuint * value);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBP4UIPROC)(GLuint index, GLenum type, GLboolean normalized, GLuint value);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBP4UIVPROC)(GLuint index, GLenum type, GLboolean normalized, const GLuint * value);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBPOINTERPROC)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void * pointer);
+typedef void (GLAD_API_PTR *PFNGLVERTEXP2UIPROC)(GLenum type, GLuint value);
+typedef void (GLAD_API_PTR *PFNGLVERTEXP2UIVPROC)(GLenum type, const GLuint * value);
+typedef void (GLAD_API_PTR *PFNGLVERTEXP3UIPROC)(GLenum type, GLuint value);
+typedef void (GLAD_API_PTR *PFNGLVERTEXP3UIVPROC)(GLenum type, const GLuint * value);
+typedef void (GLAD_API_PTR *PFNGLVERTEXP4UIPROC)(GLenum type, GLuint value);
+typedef void (GLAD_API_PTR *PFNGLVERTEXP4UIVPROC)(GLenum type, const GLuint * value);
+typedef void (GLAD_API_PTR *PFNGLVERTEXPOINTERPROC)(GLint size, GLenum type, GLsizei stride, const void * pointer);
+typedef void (GLAD_API_PTR *PFNGLVIEWPORTPROC)(GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (GLAD_API_PTR *PFNGLWAITSYNCPROC)(GLsync sync, GLbitfield flags, GLuint64 timeout);
+typedef void (GLAD_API_PTR *PFNGLWINDOWPOS2DPROC)(GLdouble x, GLdouble y);
+typedef void (GLAD_API_PTR *PFNGLWINDOWPOS2DVPROC)(const GLdouble * v);
+typedef void (GLAD_API_PTR *PFNGLWINDOWPOS2FPROC)(GLfloat x, GLfloat y);
+typedef void (GLAD_API_PTR *PFNGLWINDOWPOS2FVPROC)(const GLfloat * v);
+typedef void (GLAD_API_PTR *PFNGLWINDOWPOS2IPROC)(GLint x, GLint y);
+typedef void (GLAD_API_PTR *PFNGLWINDOWPOS2IVPROC)(const GLint * v);
+typedef void (GLAD_API_PTR *PFNGLWINDOWPOS2SPROC)(GLshort x, GLshort y);
+typedef void (GLAD_API_PTR *PFNGLWINDOWPOS2SVPROC)(const GLshort * v);
+typedef void (GLAD_API_PTR *PFNGLWINDOWPOS3DPROC)(GLdouble x, GLdouble y, GLdouble z);
+typedef void (GLAD_API_PTR *PFNGLWINDOWPOS3DVPROC)(const GLdouble * v);
+typedef void (GLAD_API_PTR *PFNGLWINDOWPOS3FPROC)(GLfloat x, GLfloat y, GLfloat z);
+typedef void (GLAD_API_PTR *PFNGLWINDOWPOS3FVPROC)(const GLfloat * v);
+typedef void (GLAD_API_PTR *PFNGLWINDOWPOS3IPROC)(GLint x, GLint y, GLint z);
+typedef void (GLAD_API_PTR *PFNGLWINDOWPOS3IVPROC)(const GLint * v);
+typedef void (GLAD_API_PTR *PFNGLWINDOWPOS3SPROC)(GLshort x, GLshort y, GLshort z);
+typedef void (GLAD_API_PTR *PFNGLWINDOWPOS3SVPROC)(const GLshort * v);
+
+GLAD_API_CALL PFNGLACCUMPROC glad_glAccum;
+#define glAccum glad_glAccum
+GLAD_API_CALL PFNGLACTIVETEXTUREPROC glad_glActiveTexture;
+#define glActiveTexture glad_glActiveTexture
+GLAD_API_CALL PFNGLALPHAFUNCPROC glad_glAlphaFunc;
+#define glAlphaFunc glad_glAlphaFunc
+GLAD_API_CALL PFNGLARETEXTURESRESIDENTPROC glad_glAreTexturesResident;
+#define glAreTexturesResident glad_glAreTexturesResident
+GLAD_API_CALL PFNGLARRAYELEMENTPROC glad_glArrayElement;
+#define glArrayElement glad_glArrayElement
+GLAD_API_CALL PFNGLATTACHSHADERPROC glad_glAttachShader;
+#define glAttachShader glad_glAttachShader
+GLAD_API_CALL PFNGLBEGINPROC glad_glBegin;
+#define glBegin glad_glBegin
+GLAD_API_CALL PFNGLBEGINCONDITIONALRENDERPROC glad_glBeginConditionalRender;
+#define glBeginConditionalRender glad_glBeginConditionalRender
+GLAD_API_CALL PFNGLBEGINQUERYPROC glad_glBeginQuery;
+#define glBeginQuery glad_glBeginQuery
+GLAD_API_CALL PFNGLBEGINTRANSFORMFEEDBACKPROC glad_glBeginTransformFeedback;
+#define glBeginTransformFeedback glad_glBeginTransformFeedback
+GLAD_API_CALL PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation;
+#define glBindAttribLocation glad_glBindAttribLocation
+GLAD_API_CALL PFNGLBINDBUFFERPROC glad_glBindBuffer;
+#define glBindBuffer glad_glBindBuffer
+GLAD_API_CALL PFNGLBINDBUFFERBASEPROC glad_glBindBufferBase;
+#define glBindBufferBase glad_glBindBufferBase
+GLAD_API_CALL PFNGLBINDBUFFERRANGEPROC glad_glBindBufferRange;
+#define glBindBufferRange glad_glBindBufferRange
+GLAD_API_CALL PFNGLBINDFRAGDATALOCATIONPROC glad_glBindFragDataLocation;
+#define glBindFragDataLocation glad_glBindFragDataLocation
+GLAD_API_CALL PFNGLBINDFRAGDATALOCATIONINDEXEDPROC glad_glBindFragDataLocationIndexed;
+#define glBindFragDataLocationIndexed glad_glBindFragDataLocationIndexed
+GLAD_API_CALL PFNGLBINDFRAMEBUFFERPROC glad_glBindFramebuffer;
+#define glBindFramebuffer glad_glBindFramebuffer
+GLAD_API_CALL PFNGLBINDRENDERBUFFERPROC glad_glBindRenderbuffer;
+#define glBindRenderbuffer glad_glBindRenderbuffer
+GLAD_API_CALL PFNGLBINDSAMPLERPROC glad_glBindSampler;
+#define glBindSampler glad_glBindSampler
+GLAD_API_CALL PFNGLBINDTEXTUREPROC glad_glBindTexture;
+#define glBindTexture glad_glBindTexture
+GLAD_API_CALL PFNGLBINDVERTEXARRAYPROC glad_glBindVertexArray;
+#define glBindVertexArray glad_glBindVertexArray
+GLAD_API_CALL PFNGLBITMAPPROC glad_glBitmap;
+#define glBitmap glad_glBitmap
+GLAD_API_CALL PFNGLBLENDCOLORPROC glad_glBlendColor;
+#define glBlendColor glad_glBlendColor
+GLAD_API_CALL PFNGLBLENDEQUATIONPROC glad_glBlendEquation;
+#define glBlendEquation glad_glBlendEquation
+GLAD_API_CALL PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate;
+#define glBlendEquationSeparate glad_glBlendEquationSeparate
+GLAD_API_CALL PFNGLBLENDFUNCPROC glad_glBlendFunc;
+#define glBlendFunc glad_glBlendFunc
+GLAD_API_CALL PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate;
+#define glBlendFuncSeparate glad_glBlendFuncSeparate
+GLAD_API_CALL PFNGLBLITFRAMEBUFFERPROC glad_glBlitFramebuffer;
+#define glBlitFramebuffer glad_glBlitFramebuffer
+GLAD_API_CALL PFNGLBUFFERDATAPROC glad_glBufferData;
+#define glBufferData glad_glBufferData
+GLAD_API_CALL PFNGLBUFFERSUBDATAPROC glad_glBufferSubData;
+#define glBufferSubData glad_glBufferSubData
+GLAD_API_CALL PFNGLCALLLISTPROC glad_glCallList;
+#define glCallList glad_glCallList
+GLAD_API_CALL PFNGLCALLLISTSPROC glad_glCallLists;
+#define glCallLists glad_glCallLists
+GLAD_API_CALL PFNGLCHECKFRAMEBUFFERSTATUSPROC glad_glCheckFramebufferStatus;
+#define glCheckFramebufferStatus glad_glCheckFramebufferStatus
+GLAD_API_CALL PFNGLCLAMPCOLORPROC glad_glClampColor;
+#define glClampColor glad_glClampColor
+GLAD_API_CALL PFNGLCLEARPROC glad_glClear;
+#define glClear glad_glClear
+GLAD_API_CALL PFNGLCLEARACCUMPROC glad_glClearAccum;
+#define glClearAccum glad_glClearAccum
+GLAD_API_CALL PFNGLCLEARBUFFERFIPROC glad_glClearBufferfi;
+#define glClearBufferfi glad_glClearBufferfi
+GLAD_API_CALL PFNGLCLEARBUFFERFVPROC glad_glClearBufferfv;
+#define glClearBufferfv glad_glClearBufferfv
+GLAD_API_CALL PFNGLCLEARBUFFERIVPROC glad_glClearBufferiv;
+#define glClearBufferiv glad_glClearBufferiv
+GLAD_API_CALL PFNGLCLEARBUFFERUIVPROC glad_glClearBufferuiv;
+#define glClearBufferuiv glad_glClearBufferuiv
+GLAD_API_CALL PFNGLCLEARCOLORPROC glad_glClearColor;
+#define glClearColor glad_glClearColor
+GLAD_API_CALL PFNGLCLEARDEPTHPROC glad_glClearDepth;
+#define glClearDepth glad_glClearDepth
+GLAD_API_CALL PFNGLCLEARINDEXPROC glad_glClearIndex;
+#define glClearIndex glad_glClearIndex
+GLAD_API_CALL PFNGLCLEARSTENCILPROC glad_glClearStencil;
+#define glClearStencil glad_glClearStencil
+GLAD_API_CALL PFNGLCLIENTACTIVETEXTUREPROC glad_glClientActiveTexture;
+#define glClientActiveTexture glad_glClientActiveTexture
+GLAD_API_CALL PFNGLCLIENTWAITSYNCPROC glad_glClientWaitSync;
+#define glClientWaitSync glad_glClientWaitSync
+GLAD_API_CALL PFNGLCLIPPLANEPROC glad_glClipPlane;
+#define glClipPlane glad_glClipPlane
+GLAD_API_CALL PFNGLCOLOR3BPROC glad_glColor3b;
+#define glColor3b glad_glColor3b
+GLAD_API_CALL PFNGLCOLOR3BVPROC glad_glColor3bv;
+#define glColor3bv glad_glColor3bv
+GLAD_API_CALL PFNGLCOLOR3DPROC glad_glColor3d;
+#define glColor3d glad_glColor3d
+GLAD_API_CALL PFNGLCOLOR3DVPROC glad_glColor3dv;
+#define glColor3dv glad_glColor3dv
+GLAD_API_CALL PFNGLCOLOR3FPROC glad_glColor3f;
+#define glColor3f glad_glColor3f
+GLAD_API_CALL PFNGLCOLOR3FVPROC glad_glColor3fv;
+#define glColor3fv glad_glColor3fv
+GLAD_API_CALL PFNGLCOLOR3IPROC glad_glColor3i;
+#define glColor3i glad_glColor3i
+GLAD_API_CALL PFNGLCOLOR3IVPROC glad_glColor3iv;
+#define glColor3iv glad_glColor3iv
+GLAD_API_CALL PFNGLCOLOR3SPROC glad_glColor3s;
+#define glColor3s glad_glColor3s
+GLAD_API_CALL PFNGLCOLOR3SVPROC glad_glColor3sv;
+#define glColor3sv glad_glColor3sv
+GLAD_API_CALL PFNGLCOLOR3UBPROC glad_glColor3ub;
+#define glColor3ub glad_glColor3ub
+GLAD_API_CALL PFNGLCOLOR3UBVPROC glad_glColor3ubv;
+#define glColor3ubv glad_glColor3ubv
+GLAD_API_CALL PFNGLCOLOR3UIPROC glad_glColor3ui;
+#define glColor3ui glad_glColor3ui
+GLAD_API_CALL PFNGLCOLOR3UIVPROC glad_glColor3uiv;
+#define glColor3uiv glad_glColor3uiv
+GLAD_API_CALL PFNGLCOLOR3USPROC glad_glColor3us;
+#define glColor3us glad_glColor3us
+GLAD_API_CALL PFNGLCOLOR3USVPROC glad_glColor3usv;
+#define glColor3usv glad_glColor3usv
+GLAD_API_CALL PFNGLCOLOR4BPROC glad_glColor4b;
+#define glColor4b glad_glColor4b
+GLAD_API_CALL PFNGLCOLOR4BVPROC glad_glColor4bv;
+#define glColor4bv glad_glColor4bv
+GLAD_API_CALL PFNGLCOLOR4DPROC glad_glColor4d;
+#define glColor4d glad_glColor4d
+GLAD_API_CALL PFNGLCOLOR4DVPROC glad_glColor4dv;
+#define glColor4dv glad_glColor4dv
+GLAD_API_CALL PFNGLCOLOR4FPROC glad_glColor4f;
+#define glColor4f glad_glColor4f
+GLAD_API_CALL PFNGLCOLOR4FVPROC glad_glColor4fv;
+#define glColor4fv glad_glColor4fv
+GLAD_API_CALL PFNGLCOLOR4IPROC glad_glColor4i;
+#define glColor4i glad_glColor4i
+GLAD_API_CALL PFNGLCOLOR4IVPROC glad_glColor4iv;
+#define glColor4iv glad_glColor4iv
+GLAD_API_CALL PFNGLCOLOR4SPROC glad_glColor4s;
+#define glColor4s glad_glColor4s
+GLAD_API_CALL PFNGLCOLOR4SVPROC glad_glColor4sv;
+#define glColor4sv glad_glColor4sv
+GLAD_API_CALL PFNGLCOLOR4UBPROC glad_glColor4ub;
+#define glColor4ub glad_glColor4ub
+GLAD_API_CALL PFNGLCOLOR4UBVPROC glad_glColor4ubv;
+#define glColor4ubv glad_glColor4ubv
+GLAD_API_CALL PFNGLCOLOR4UIPROC glad_glColor4ui;
+#define glColor4ui glad_glColor4ui
+GLAD_API_CALL PFNGLCOLOR4UIVPROC glad_glColor4uiv;
+#define glColor4uiv glad_glColor4uiv
+GLAD_API_CALL PFNGLCOLOR4USPROC glad_glColor4us;
+#define glColor4us glad_glColor4us
+GLAD_API_CALL PFNGLCOLOR4USVPROC glad_glColor4usv;
+#define glColor4usv glad_glColor4usv
+GLAD_API_CALL PFNGLCOLORMASKPROC glad_glColorMask;
+#define glColorMask glad_glColorMask
+GLAD_API_CALL PFNGLCOLORMASKIPROC glad_glColorMaski;
+#define glColorMaski glad_glColorMaski
+GLAD_API_CALL PFNGLCOLORMATERIALPROC glad_glColorMaterial;
+#define glColorMaterial glad_glColorMaterial
+GLAD_API_CALL PFNGLCOLORP3UIPROC glad_glColorP3ui;
+#define glColorP3ui glad_glColorP3ui
+GLAD_API_CALL PFNGLCOLORP3UIVPROC glad_glColorP3uiv;
+#define glColorP3uiv glad_glColorP3uiv
+GLAD_API_CALL PFNGLCOLORP4UIPROC glad_glColorP4ui;
+#define glColorP4ui glad_glColorP4ui
+GLAD_API_CALL PFNGLCOLORP4UIVPROC glad_glColorP4uiv;
+#define glColorP4uiv glad_glColorP4uiv
+GLAD_API_CALL PFNGLCOLORPOINTERPROC glad_glColorPointer;
+#define glColorPointer glad_glColorPointer
+GLAD_API_CALL PFNGLCOMPILESHADERPROC glad_glCompileShader;
+#define glCompileShader glad_glCompileShader
+GLAD_API_CALL PFNGLCOMPRESSEDTEXIMAGE1DPROC glad_glCompressedTexImage1D;
+#define glCompressedTexImage1D glad_glCompressedTexImage1D
+GLAD_API_CALL PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D;
+#define glCompressedTexImage2D glad_glCompressedTexImage2D
+GLAD_API_CALL PFNGLCOMPRESSEDTEXIMAGE3DPROC glad_glCompressedTexImage3D;
+#define glCompressedTexImage3D glad_glCompressedTexImage3D
+GLAD_API_CALL PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glad_glCompressedTexSubImage1D;
+#define glCompressedTexSubImage1D glad_glCompressedTexSubImage1D
+GLAD_API_CALL PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D;
+#define glCompressedTexSubImage2D glad_glCompressedTexSubImage2D
+GLAD_API_CALL PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glad_glCompressedTexSubImage3D;
+#define glCompressedTexSubImage3D glad_glCompressedTexSubImage3D
+GLAD_API_CALL PFNGLCOPYBUFFERSUBDATAPROC glad_glCopyBufferSubData;
+#define glCopyBufferSubData glad_glCopyBufferSubData
+GLAD_API_CALL PFNGLCOPYPIXELSPROC glad_glCopyPixels;
+#define glCopyPixels glad_glCopyPixels
+GLAD_API_CALL PFNGLCOPYTEXIMAGE1DPROC glad_glCopyTexImage1D;
+#define glCopyTexImage1D glad_glCopyTexImage1D
+GLAD_API_CALL PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D;
+#define glCopyTexImage2D glad_glCopyTexImage2D
+GLAD_API_CALL PFNGLCOPYTEXSUBIMAGE1DPROC glad_glCopyTexSubImage1D;
+#define glCopyTexSubImage1D glad_glCopyTexSubImage1D
+GLAD_API_CALL PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D;
+#define glCopyTexSubImage2D glad_glCopyTexSubImage2D
+GLAD_API_CALL PFNGLCOPYTEXSUBIMAGE3DPROC glad_glCopyTexSubImage3D;
+#define glCopyTexSubImage3D glad_glCopyTexSubImage3D
+GLAD_API_CALL PFNGLCREATEPROGRAMPROC glad_glCreateProgram;
+#define glCreateProgram glad_glCreateProgram
+GLAD_API_CALL PFNGLCREATESHADERPROC glad_glCreateShader;
+#define glCreateShader glad_glCreateShader
+GLAD_API_CALL PFNGLCULLFACEPROC glad_glCullFace;
+#define glCullFace glad_glCullFace
+GLAD_API_CALL PFNGLDEBUGMESSAGECALLBACKPROC glad_glDebugMessageCallback;
+#define glDebugMessageCallback glad_glDebugMessageCallback
+GLAD_API_CALL PFNGLDEBUGMESSAGECONTROLPROC glad_glDebugMessageControl;
+#define glDebugMessageControl glad_glDebugMessageControl
+GLAD_API_CALL PFNGLDEBUGMESSAGEINSERTPROC glad_glDebugMessageInsert;
+#define glDebugMessageInsert glad_glDebugMessageInsert
+GLAD_API_CALL PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers;
+#define glDeleteBuffers glad_glDeleteBuffers
+GLAD_API_CALL PFNGLDELETEFRAMEBUFFERSPROC glad_glDeleteFramebuffers;
+#define glDeleteFramebuffers glad_glDeleteFramebuffers
+GLAD_API_CALL PFNGLDELETELISTSPROC glad_glDeleteLists;
+#define glDeleteLists glad_glDeleteLists
+GLAD_API_CALL PFNGLDELETEPROGRAMPROC glad_glDeleteProgram;
+#define glDeleteProgram glad_glDeleteProgram
+GLAD_API_CALL PFNGLDELETEQUERIESPROC glad_glDeleteQueries;
+#define glDeleteQueries glad_glDeleteQueries
+GLAD_API_CALL PFNGLDELETERENDERBUFFERSPROC glad_glDeleteRenderbuffers;
+#define glDeleteRenderbuffers glad_glDeleteRenderbuffers
+GLAD_API_CALL PFNGLDELETESAMPLERSPROC glad_glDeleteSamplers;
+#define glDeleteSamplers glad_glDeleteSamplers
+GLAD_API_CALL PFNGLDELETESHADERPROC glad_glDeleteShader;
+#define glDeleteShader glad_glDeleteShader
+GLAD_API_CALL PFNGLDELETESYNCPROC glad_glDeleteSync;
+#define glDeleteSync glad_glDeleteSync
+GLAD_API_CALL PFNGLDELETETEXTURESPROC glad_glDeleteTextures;
+#define glDeleteTextures glad_glDeleteTextures
+GLAD_API_CALL PFNGLDELETEVERTEXARRAYSPROC glad_glDeleteVertexArrays;
+#define glDeleteVertexArrays glad_glDeleteVertexArrays
+GLAD_API_CALL PFNGLDEPTHFUNCPROC glad_glDepthFunc;
+#define glDepthFunc glad_glDepthFunc
+GLAD_API_CALL PFNGLDEPTHMASKPROC glad_glDepthMask;
+#define glDepthMask glad_glDepthMask
+GLAD_API_CALL PFNGLDEPTHRANGEPROC glad_glDepthRange;
+#define glDepthRange glad_glDepthRange
+GLAD_API_CALL PFNGLDETACHSHADERPROC glad_glDetachShader;
+#define glDetachShader glad_glDetachShader
+GLAD_API_CALL PFNGLDISABLEPROC glad_glDisable;
+#define glDisable glad_glDisable
+GLAD_API_CALL PFNGLDISABLECLIENTSTATEPROC glad_glDisableClientState;
+#define glDisableClientState glad_glDisableClientState
+GLAD_API_CALL PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray;
+#define glDisableVertexAttribArray glad_glDisableVertexAttribArray
+GLAD_API_CALL PFNGLDISABLEIPROC glad_glDisablei;
+#define glDisablei glad_glDisablei
+GLAD_API_CALL PFNGLDRAWARRAYSPROC glad_glDrawArrays;
+#define glDrawArrays glad_glDrawArrays
+GLAD_API_CALL PFNGLDRAWARRAYSINSTANCEDPROC glad_glDrawArraysInstanced;
+#define glDrawArraysInstanced glad_glDrawArraysInstanced
+GLAD_API_CALL PFNGLDRAWBUFFERPROC glad_glDrawBuffer;
+#define glDrawBuffer glad_glDrawBuffer
+GLAD_API_CALL PFNGLDRAWBUFFERSPROC glad_glDrawBuffers;
+#define glDrawBuffers glad_glDrawBuffers
+GLAD_API_CALL PFNGLDRAWELEMENTSPROC glad_glDrawElements;
+#define glDrawElements glad_glDrawElements
+GLAD_API_CALL PFNGLDRAWELEMENTSBASEVERTEXPROC glad_glDrawElementsBaseVertex;
+#define glDrawElementsBaseVertex glad_glDrawElementsBaseVertex
+GLAD_API_CALL PFNGLDRAWELEMENTSINSTANCEDPROC glad_glDrawElementsInstanced;
+#define glDrawElementsInstanced glad_glDrawElementsInstanced
+GLAD_API_CALL PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC glad_glDrawElementsInstancedBaseVertex;
+#define glDrawElementsInstancedBaseVertex glad_glDrawElementsInstancedBaseVertex
+GLAD_API_CALL PFNGLDRAWPIXELSPROC glad_glDrawPixels;
+#define glDrawPixels glad_glDrawPixels
+GLAD_API_CALL PFNGLDRAWRANGEELEMENTSPROC glad_glDrawRangeElements;
+#define glDrawRangeElements glad_glDrawRangeElements
+GLAD_API_CALL PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC glad_glDrawRangeElementsBaseVertex;
+#define glDrawRangeElementsBaseVertex glad_glDrawRangeElementsBaseVertex
+GLAD_API_CALL PFNGLEDGEFLAGPROC glad_glEdgeFlag;
+#define glEdgeFlag glad_glEdgeFlag
+GLAD_API_CALL PFNGLEDGEFLAGPOINTERPROC glad_glEdgeFlagPointer;
+#define glEdgeFlagPointer glad_glEdgeFlagPointer
+GLAD_API_CALL PFNGLEDGEFLAGVPROC glad_glEdgeFlagv;
+#define glEdgeFlagv glad_glEdgeFlagv
+GLAD_API_CALL PFNGLENABLEPROC glad_glEnable;
+#define glEnable glad_glEnable
+GLAD_API_CALL PFNGLENABLECLIENTSTATEPROC glad_glEnableClientState;
+#define glEnableClientState glad_glEnableClientState
+GLAD_API_CALL PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray;
+#define glEnableVertexAttribArray glad_glEnableVertexAttribArray
+GLAD_API_CALL PFNGLENABLEIPROC glad_glEnablei;
+#define glEnablei glad_glEnablei
+GLAD_API_CALL PFNGLENDPROC glad_glEnd;
+#define glEnd glad_glEnd
+GLAD_API_CALL PFNGLENDCONDITIONALRENDERPROC glad_glEndConditionalRender;
+#define glEndConditionalRender glad_glEndConditionalRender
+GLAD_API_CALL PFNGLENDLISTPROC glad_glEndList;
+#define glEndList glad_glEndList
+GLAD_API_CALL PFNGLENDQUERYPROC glad_glEndQuery;
+#define glEndQuery glad_glEndQuery
+GLAD_API_CALL PFNGLENDTRANSFORMFEEDBACKPROC glad_glEndTransformFeedback;
+#define glEndTransformFeedback glad_glEndTransformFeedback
+GLAD_API_CALL PFNGLEVALCOORD1DPROC glad_glEvalCoord1d;
+#define glEvalCoord1d glad_glEvalCoord1d
+GLAD_API_CALL PFNGLEVALCOORD1DVPROC glad_glEvalCoord1dv;
+#define glEvalCoord1dv glad_glEvalCoord1dv
+GLAD_API_CALL PFNGLEVALCOORD1FPROC glad_glEvalCoord1f;
+#define glEvalCoord1f glad_glEvalCoord1f
+GLAD_API_CALL PFNGLEVALCOORD1FVPROC glad_glEvalCoord1fv;
+#define glEvalCoord1fv glad_glEvalCoord1fv
+GLAD_API_CALL PFNGLEVALCOORD2DPROC glad_glEvalCoord2d;
+#define glEvalCoord2d glad_glEvalCoord2d
+GLAD_API_CALL PFNGLEVALCOORD2DVPROC glad_glEvalCoord2dv;
+#define glEvalCoord2dv glad_glEvalCoord2dv
+GLAD_API_CALL PFNGLEVALCOORD2FPROC glad_glEvalCoord2f;
+#define glEvalCoord2f glad_glEvalCoord2f
+GLAD_API_CALL PFNGLEVALCOORD2FVPROC glad_glEvalCoord2fv;
+#define glEvalCoord2fv glad_glEvalCoord2fv
+GLAD_API_CALL PFNGLEVALMESH1PROC glad_glEvalMesh1;
+#define glEvalMesh1 glad_glEvalMesh1
+GLAD_API_CALL PFNGLEVALMESH2PROC glad_glEvalMesh2;
+#define glEvalMesh2 glad_glEvalMesh2
+GLAD_API_CALL PFNGLEVALPOINT1PROC glad_glEvalPoint1;
+#define glEvalPoint1 glad_glEvalPoint1
+GLAD_API_CALL PFNGLEVALPOINT2PROC glad_glEvalPoint2;
+#define glEvalPoint2 glad_glEvalPoint2
+GLAD_API_CALL PFNGLFEEDBACKBUFFERPROC glad_glFeedbackBuffer;
+#define glFeedbackBuffer glad_glFeedbackBuffer
+GLAD_API_CALL PFNGLFENCESYNCPROC glad_glFenceSync;
+#define glFenceSync glad_glFenceSync
+GLAD_API_CALL PFNGLFINISHPROC glad_glFinish;
+#define glFinish glad_glFinish
+GLAD_API_CALL PFNGLFLUSHPROC glad_glFlush;
+#define glFlush glad_glFlush
+GLAD_API_CALL PFNGLFLUSHMAPPEDBUFFERRANGEPROC glad_glFlushMappedBufferRange;
+#define glFlushMappedBufferRange glad_glFlushMappedBufferRange
+GLAD_API_CALL PFNGLFOGCOORDPOINTERPROC glad_glFogCoordPointer;
+#define glFogCoordPointer glad_glFogCoordPointer
+GLAD_API_CALL PFNGLFOGCOORDDPROC glad_glFogCoordd;
+#define glFogCoordd glad_glFogCoordd
+GLAD_API_CALL PFNGLFOGCOORDDVPROC glad_glFogCoorddv;
+#define glFogCoorddv glad_glFogCoorddv
+GLAD_API_CALL PFNGLFOGCOORDFPROC glad_glFogCoordf;
+#define glFogCoordf glad_glFogCoordf
+GLAD_API_CALL PFNGLFOGCOORDFVPROC glad_glFogCoordfv;
+#define glFogCoordfv glad_glFogCoordfv
+GLAD_API_CALL PFNGLFOGFPROC glad_glFogf;
+#define glFogf glad_glFogf
+GLAD_API_CALL PFNGLFOGFVPROC glad_glFogfv;
+#define glFogfv glad_glFogfv
+GLAD_API_CALL PFNGLFOGIPROC glad_glFogi;
+#define glFogi glad_glFogi
+GLAD_API_CALL PFNGLFOGIVPROC glad_glFogiv;
+#define glFogiv glad_glFogiv
+GLAD_API_CALL PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer;
+#define glFramebufferRenderbuffer glad_glFramebufferRenderbuffer
+GLAD_API_CALL PFNGLFRAMEBUFFERTEXTUREPROC glad_glFramebufferTexture;
+#define glFramebufferTexture glad_glFramebufferTexture
+GLAD_API_CALL PFNGLFRAMEBUFFERTEXTURE1DPROC glad_glFramebufferTexture1D;
+#define glFramebufferTexture1D glad_glFramebufferTexture1D
+GLAD_API_CALL PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D;
+#define glFramebufferTexture2D glad_glFramebufferTexture2D
+GLAD_API_CALL PFNGLFRAMEBUFFERTEXTURE3DPROC glad_glFramebufferTexture3D;
+#define glFramebufferTexture3D glad_glFramebufferTexture3D
+GLAD_API_CALL PFNGLFRAMEBUFFERTEXTURELAYERPROC glad_glFramebufferTextureLayer;
+#define glFramebufferTextureLayer glad_glFramebufferTextureLayer
+GLAD_API_CALL PFNGLFRONTFACEPROC glad_glFrontFace;
+#define glFrontFace glad_glFrontFace
+GLAD_API_CALL PFNGLFRUSTUMPROC glad_glFrustum;
+#define glFrustum glad_glFrustum
+GLAD_API_CALL PFNGLGENBUFFERSPROC glad_glGenBuffers;
+#define glGenBuffers glad_glGenBuffers
+GLAD_API_CALL PFNGLGENFRAMEBUFFERSPROC glad_glGenFramebuffers;
+#define glGenFramebuffers glad_glGenFramebuffers
+GLAD_API_CALL PFNGLGENLISTSPROC glad_glGenLists;
+#define glGenLists glad_glGenLists
+GLAD_API_CALL PFNGLGENQUERIESPROC glad_glGenQueries;
+#define glGenQueries glad_glGenQueries
+GLAD_API_CALL PFNGLGENRENDERBUFFERSPROC glad_glGenRenderbuffers;
+#define glGenRenderbuffers glad_glGenRenderbuffers
+GLAD_API_CALL PFNGLGENSAMPLERSPROC glad_glGenSamplers;
+#define glGenSamplers glad_glGenSamplers
+GLAD_API_CALL PFNGLGENTEXTURESPROC glad_glGenTextures;
+#define glGenTextures glad_glGenTextures
+GLAD_API_CALL PFNGLGENVERTEXARRAYSPROC glad_glGenVertexArrays;
+#define glGenVertexArrays glad_glGenVertexArrays
+GLAD_API_CALL PFNGLGENERATEMIPMAPPROC glad_glGenerateMipmap;
+#define glGenerateMipmap glad_glGenerateMipmap
+GLAD_API_CALL PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib;
+#define glGetActiveAttrib glad_glGetActiveAttrib
+GLAD_API_CALL PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform;
+#define glGetActiveUniform glad_glGetActiveUniform
+GLAD_API_CALL PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC glad_glGetActiveUniformBlockName;
+#define glGetActiveUniformBlockName glad_glGetActiveUniformBlockName
+GLAD_API_CALL PFNGLGETACTIVEUNIFORMBLOCKIVPROC glad_glGetActiveUniformBlockiv;
+#define glGetActiveUniformBlockiv glad_glGetActiveUniformBlockiv
+GLAD_API_CALL PFNGLGETACTIVEUNIFORMNAMEPROC glad_glGetActiveUniformName;
+#define glGetActiveUniformName glad_glGetActiveUniformName
+GLAD_API_CALL PFNGLGETACTIVEUNIFORMSIVPROC glad_glGetActiveUniformsiv;
+#define glGetActiveUniformsiv glad_glGetActiveUniformsiv
+GLAD_API_CALL PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders;
+#define glGetAttachedShaders glad_glGetAttachedShaders
+GLAD_API_CALL PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation;
+#define glGetAttribLocation glad_glGetAttribLocation
+GLAD_API_CALL PFNGLGETBOOLEANI_VPROC glad_glGetBooleani_v;
+#define glGetBooleani_v glad_glGetBooleani_v
+GLAD_API_CALL PFNGLGETBOOLEANVPROC glad_glGetBooleanv;
+#define glGetBooleanv glad_glGetBooleanv
+GLAD_API_CALL PFNGLGETBUFFERPARAMETERI64VPROC glad_glGetBufferParameteri64v;
+#define glGetBufferParameteri64v glad_glGetBufferParameteri64v
+GLAD_API_CALL PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv;
+#define glGetBufferParameteriv glad_glGetBufferParameteriv
+GLAD_API_CALL PFNGLGETBUFFERPOINTERVPROC glad_glGetBufferPointerv;
+#define glGetBufferPointerv glad_glGetBufferPointerv
+GLAD_API_CALL PFNGLGETBUFFERSUBDATAPROC glad_glGetBufferSubData;
+#define glGetBufferSubData glad_glGetBufferSubData
+GLAD_API_CALL PFNGLGETCLIPPLANEPROC glad_glGetClipPlane;
+#define glGetClipPlane glad_glGetClipPlane
+GLAD_API_CALL PFNGLGETCOMPRESSEDTEXIMAGEPROC glad_glGetCompressedTexImage;
+#define glGetCompressedTexImage glad_glGetCompressedTexImage
+GLAD_API_CALL PFNGLGETDEBUGMESSAGELOGPROC glad_glGetDebugMessageLog;
+#define glGetDebugMessageLog glad_glGetDebugMessageLog
+GLAD_API_CALL PFNGLGETDOUBLEVPROC glad_glGetDoublev;
+#define glGetDoublev glad_glGetDoublev
+GLAD_API_CALL PFNGLGETERRORPROC glad_glGetError;
+#define glGetError glad_glGetError
+GLAD_API_CALL PFNGLGETFLOATVPROC glad_glGetFloatv;
+#define glGetFloatv glad_glGetFloatv
+GLAD_API_CALL PFNGLGETFRAGDATAINDEXPROC glad_glGetFragDataIndex;
+#define glGetFragDataIndex glad_glGetFragDataIndex
+GLAD_API_CALL PFNGLGETFRAGDATALOCATIONPROC glad_glGetFragDataLocation;
+#define glGetFragDataLocation glad_glGetFragDataLocation
+GLAD_API_CALL PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetFramebufferAttachmentParameteriv;
+#define glGetFramebufferAttachmentParameteriv glad_glGetFramebufferAttachmentParameteriv
+GLAD_API_CALL PFNGLGETGRAPHICSRESETSTATUSARBPROC glad_glGetGraphicsResetStatusARB;
+#define glGetGraphicsResetStatusARB glad_glGetGraphicsResetStatusARB
+GLAD_API_CALL PFNGLGETINTEGER64I_VPROC glad_glGetInteger64i_v;
+#define glGetInteger64i_v glad_glGetInteger64i_v
+GLAD_API_CALL PFNGLGETINTEGER64VPROC glad_glGetInteger64v;
+#define glGetInteger64v glad_glGetInteger64v
+GLAD_API_CALL PFNGLGETINTEGERI_VPROC glad_glGetIntegeri_v;
+#define glGetIntegeri_v glad_glGetIntegeri_v
+GLAD_API_CALL PFNGLGETINTEGERVPROC glad_glGetIntegerv;
+#define glGetIntegerv glad_glGetIntegerv
+GLAD_API_CALL PFNGLGETLIGHTFVPROC glad_glGetLightfv;
+#define glGetLightfv glad_glGetLightfv
+GLAD_API_CALL PFNGLGETLIGHTIVPROC glad_glGetLightiv;
+#define glGetLightiv glad_glGetLightiv
+GLAD_API_CALL PFNGLGETMAPDVPROC glad_glGetMapdv;
+#define glGetMapdv glad_glGetMapdv
+GLAD_API_CALL PFNGLGETMAPFVPROC glad_glGetMapfv;
+#define glGetMapfv glad_glGetMapfv
+GLAD_API_CALL PFNGLGETMAPIVPROC glad_glGetMapiv;
+#define glGetMapiv glad_glGetMapiv
+GLAD_API_CALL PFNGLGETMATERIALFVPROC glad_glGetMaterialfv;
+#define glGetMaterialfv glad_glGetMaterialfv
+GLAD_API_CALL PFNGLGETMATERIALIVPROC glad_glGetMaterialiv;
+#define glGetMaterialiv glad_glGetMaterialiv
+GLAD_API_CALL PFNGLGETMULTISAMPLEFVPROC glad_glGetMultisamplefv;
+#define glGetMultisamplefv glad_glGetMultisamplefv
+GLAD_API_CALL PFNGLGETOBJECTLABELPROC glad_glGetObjectLabel;
+#define glGetObjectLabel glad_glGetObjectLabel
+GLAD_API_CALL PFNGLGETOBJECTPTRLABELPROC glad_glGetObjectPtrLabel;
+#define glGetObjectPtrLabel glad_glGetObjectPtrLabel
+GLAD_API_CALL PFNGLGETPIXELMAPFVPROC glad_glGetPixelMapfv;
+#define glGetPixelMapfv glad_glGetPixelMapfv
+GLAD_API_CALL PFNGLGETPIXELMAPUIVPROC glad_glGetPixelMapuiv;
+#define glGetPixelMapuiv glad_glGetPixelMapuiv
+GLAD_API_CALL PFNGLGETPIXELMAPUSVPROC glad_glGetPixelMapusv;
+#define glGetPixelMapusv glad_glGetPixelMapusv
+GLAD_API_CALL PFNGLGETPOINTERVPROC glad_glGetPointerv;
+#define glGetPointerv glad_glGetPointerv
+GLAD_API_CALL PFNGLGETPOLYGONSTIPPLEPROC glad_glGetPolygonStipple;
+#define glGetPolygonStipple glad_glGetPolygonStipple
+GLAD_API_CALL PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog;
+#define glGetProgramInfoLog glad_glGetProgramInfoLog
+GLAD_API_CALL PFNGLGETPROGRAMIVPROC glad_glGetProgramiv;
+#define glGetProgramiv glad_glGetProgramiv
+GLAD_API_CALL PFNGLGETQUERYOBJECTI64VPROC glad_glGetQueryObjecti64v;
+#define glGetQueryObjecti64v glad_glGetQueryObjecti64v
+GLAD_API_CALL PFNGLGETQUERYOBJECTIVPROC glad_glGetQueryObjectiv;
+#define glGetQueryObjectiv glad_glGetQueryObjectiv
+GLAD_API_CALL PFNGLGETQUERYOBJECTUI64VPROC glad_glGetQueryObjectui64v;
+#define glGetQueryObjectui64v glad_glGetQueryObjectui64v
+GLAD_API_CALL PFNGLGETQUERYOBJECTUIVPROC glad_glGetQueryObjectuiv;
+#define glGetQueryObjectuiv glad_glGetQueryObjectuiv
+GLAD_API_CALL PFNGLGETQUERYIVPROC glad_glGetQueryiv;
+#define glGetQueryiv glad_glGetQueryiv
+GLAD_API_CALL PFNGLGETRENDERBUFFERPARAMETERIVPROC glad_glGetRenderbufferParameteriv;
+#define glGetRenderbufferParameteriv glad_glGetRenderbufferParameteriv
+GLAD_API_CALL PFNGLGETSAMPLERPARAMETERIIVPROC glad_glGetSamplerParameterIiv;
+#define glGetSamplerParameterIiv glad_glGetSamplerParameterIiv
+GLAD_API_CALL PFNGLGETSAMPLERPARAMETERIUIVPROC glad_glGetSamplerParameterIuiv;
+#define glGetSamplerParameterIuiv glad_glGetSamplerParameterIuiv
+GLAD_API_CALL PFNGLGETSAMPLERPARAMETERFVPROC glad_glGetSamplerParameterfv;
+#define glGetSamplerParameterfv glad_glGetSamplerParameterfv
+GLAD_API_CALL PFNGLGETSAMPLERPARAMETERIVPROC glad_glGetSamplerParameteriv;
+#define glGetSamplerParameteriv glad_glGetSamplerParameteriv
+GLAD_API_CALL PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog;
+#define glGetShaderInfoLog glad_glGetShaderInfoLog
+GLAD_API_CALL PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource;
+#define glGetShaderSource glad_glGetShaderSource
+GLAD_API_CALL PFNGLGETSHADERIVPROC glad_glGetShaderiv;
+#define glGetShaderiv glad_glGetShaderiv
+GLAD_API_CALL PFNGLGETSTRINGPROC glad_glGetString;
+#define glGetString glad_glGetString
+GLAD_API_CALL PFNGLGETSTRINGIPROC glad_glGetStringi;
+#define glGetStringi glad_glGetStringi
+GLAD_API_CALL PFNGLGETSYNCIVPROC glad_glGetSynciv;
+#define glGetSynciv glad_glGetSynciv
+GLAD_API_CALL PFNGLGETTEXENVFVPROC glad_glGetTexEnvfv;
+#define glGetTexEnvfv glad_glGetTexEnvfv
+GLAD_API_CALL PFNGLGETTEXENVIVPROC glad_glGetTexEnviv;
+#define glGetTexEnviv glad_glGetTexEnviv
+GLAD_API_CALL PFNGLGETTEXGENDVPROC glad_glGetTexGendv;
+#define glGetTexGendv glad_glGetTexGendv
+GLAD_API_CALL PFNGLGETTEXGENFVPROC glad_glGetTexGenfv;
+#define glGetTexGenfv glad_glGetTexGenfv
+GLAD_API_CALL PFNGLGETTEXGENIVPROC glad_glGetTexGeniv;
+#define glGetTexGeniv glad_glGetTexGeniv
+GLAD_API_CALL PFNGLGETTEXIMAGEPROC glad_glGetTexImage;
+#define glGetTexImage glad_glGetTexImage
+GLAD_API_CALL PFNGLGETTEXLEVELPARAMETERFVPROC glad_glGetTexLevelParameterfv;
+#define glGetTexLevelParameterfv glad_glGetTexLevelParameterfv
+GLAD_API_CALL PFNGLGETTEXLEVELPARAMETERIVPROC glad_glGetTexLevelParameteriv;
+#define glGetTexLevelParameteriv glad_glGetTexLevelParameteriv
+GLAD_API_CALL PFNGLGETTEXPARAMETERIIVPROC glad_glGetTexParameterIiv;
+#define glGetTexParameterIiv glad_glGetTexParameterIiv
+GLAD_API_CALL PFNGLGETTEXPARAMETERIUIVPROC glad_glGetTexParameterIuiv;
+#define glGetTexParameterIuiv glad_glGetTexParameterIuiv
+GLAD_API_CALL PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv;
+#define glGetTexParameterfv glad_glGetTexParameterfv
+GLAD_API_CALL PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv;
+#define glGetTexParameteriv glad_glGetTexParameteriv
+GLAD_API_CALL PFNGLGETTRANSFORMFEEDBACKVARYINGPROC glad_glGetTransformFeedbackVarying;
+#define glGetTransformFeedbackVarying glad_glGetTransformFeedbackVarying
+GLAD_API_CALL PFNGLGETUNIFORMBLOCKINDEXPROC glad_glGetUniformBlockIndex;
+#define glGetUniformBlockIndex glad_glGetUniformBlockIndex
+GLAD_API_CALL PFNGLGETUNIFORMINDICESPROC glad_glGetUniformIndices;
+#define glGetUniformIndices glad_glGetUniformIndices
+GLAD_API_CALL PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation;
+#define glGetUniformLocation glad_glGetUniformLocation
+GLAD_API_CALL PFNGLGETUNIFORMFVPROC glad_glGetUniformfv;
+#define glGetUniformfv glad_glGetUniformfv
+GLAD_API_CALL PFNGLGETUNIFORMIVPROC glad_glGetUniformiv;
+#define glGetUniformiv glad_glGetUniformiv
+GLAD_API_CALL PFNGLGETUNIFORMUIVPROC glad_glGetUniformuiv;
+#define glGetUniformuiv glad_glGetUniformuiv
+GLAD_API_CALL PFNGLGETVERTEXATTRIBIIVPROC glad_glGetVertexAttribIiv;
+#define glGetVertexAttribIiv glad_glGetVertexAttribIiv
+GLAD_API_CALL PFNGLGETVERTEXATTRIBIUIVPROC glad_glGetVertexAttribIuiv;
+#define glGetVertexAttribIuiv glad_glGetVertexAttribIuiv
+GLAD_API_CALL PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv;
+#define glGetVertexAttribPointerv glad_glGetVertexAttribPointerv
+GLAD_API_CALL PFNGLGETVERTEXATTRIBDVPROC glad_glGetVertexAttribdv;
+#define glGetVertexAttribdv glad_glGetVertexAttribdv
+GLAD_API_CALL PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv;
+#define glGetVertexAttribfv glad_glGetVertexAttribfv
+GLAD_API_CALL PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv;
+#define glGetVertexAttribiv glad_glGetVertexAttribiv
+GLAD_API_CALL PFNGLGETNCOLORTABLEARBPROC glad_glGetnColorTableARB;
+#define glGetnColorTableARB glad_glGetnColorTableARB
+GLAD_API_CALL PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC glad_glGetnCompressedTexImageARB;
+#define glGetnCompressedTexImageARB glad_glGetnCompressedTexImageARB
+GLAD_API_CALL PFNGLGETNCONVOLUTIONFILTERARBPROC glad_glGetnConvolutionFilterARB;
+#define glGetnConvolutionFilterARB glad_glGetnConvolutionFilterARB
+GLAD_API_CALL PFNGLGETNHISTOGRAMARBPROC glad_glGetnHistogramARB;
+#define glGetnHistogramARB glad_glGetnHistogramARB
+GLAD_API_CALL PFNGLGETNMAPDVARBPROC glad_glGetnMapdvARB;
+#define glGetnMapdvARB glad_glGetnMapdvARB
+GLAD_API_CALL PFNGLGETNMAPFVARBPROC glad_glGetnMapfvARB;
+#define glGetnMapfvARB glad_glGetnMapfvARB
+GLAD_API_CALL PFNGLGETNMAPIVARBPROC glad_glGetnMapivARB;
+#define glGetnMapivARB glad_glGetnMapivARB
+GLAD_API_CALL PFNGLGETNMINMAXARBPROC glad_glGetnMinmaxARB;
+#define glGetnMinmaxARB glad_glGetnMinmaxARB
+GLAD_API_CALL PFNGLGETNPIXELMAPFVARBPROC glad_glGetnPixelMapfvARB;
+#define glGetnPixelMapfvARB glad_glGetnPixelMapfvARB
+GLAD_API_CALL PFNGLGETNPIXELMAPUIVARBPROC glad_glGetnPixelMapuivARB;
+#define glGetnPixelMapuivARB glad_glGetnPixelMapuivARB
+GLAD_API_CALL PFNGLGETNPIXELMAPUSVARBPROC glad_glGetnPixelMapusvARB;
+#define glGetnPixelMapusvARB glad_glGetnPixelMapusvARB
+GLAD_API_CALL PFNGLGETNPOLYGONSTIPPLEARBPROC glad_glGetnPolygonStippleARB;
+#define glGetnPolygonStippleARB glad_glGetnPolygonStippleARB
+GLAD_API_CALL PFNGLGETNSEPARABLEFILTERARBPROC glad_glGetnSeparableFilterARB;
+#define glGetnSeparableFilterARB glad_glGetnSeparableFilterARB
+GLAD_API_CALL PFNGLGETNTEXIMAGEARBPROC glad_glGetnTexImageARB;
+#define glGetnTexImageARB glad_glGetnTexImageARB
+GLAD_API_CALL PFNGLGETNUNIFORMDVARBPROC glad_glGetnUniformdvARB;
+#define glGetnUniformdvARB glad_glGetnUniformdvARB
+GLAD_API_CALL PFNGLGETNUNIFORMFVARBPROC glad_glGetnUniformfvARB;
+#define glGetnUniformfvARB glad_glGetnUniformfvARB
+GLAD_API_CALL PFNGLGETNUNIFORMIVARBPROC glad_glGetnUniformivARB;
+#define glGetnUniformivARB glad_glGetnUniformivARB
+GLAD_API_CALL PFNGLGETNUNIFORMUIVARBPROC glad_glGetnUniformuivARB;
+#define glGetnUniformuivARB glad_glGetnUniformuivARB
+GLAD_API_CALL PFNGLHINTPROC glad_glHint;
+#define glHint glad_glHint
+GLAD_API_CALL PFNGLINDEXMASKPROC glad_glIndexMask;
+#define glIndexMask glad_glIndexMask
+GLAD_API_CALL PFNGLINDEXPOINTERPROC glad_glIndexPointer;
+#define glIndexPointer glad_glIndexPointer
+GLAD_API_CALL PFNGLINDEXDPROC glad_glIndexd;
+#define glIndexd glad_glIndexd
+GLAD_API_CALL PFNGLINDEXDVPROC glad_glIndexdv;
+#define glIndexdv glad_glIndexdv
+GLAD_API_CALL PFNGLINDEXFPROC glad_glIndexf;
+#define glIndexf glad_glIndexf
+GLAD_API_CALL PFNGLINDEXFVPROC glad_glIndexfv;
+#define glIndexfv glad_glIndexfv
+GLAD_API_CALL PFNGLINDEXIPROC glad_glIndexi;
+#define glIndexi glad_glIndexi
+GLAD_API_CALL PFNGLINDEXIVPROC glad_glIndexiv;
+#define glIndexiv glad_glIndexiv
+GLAD_API_CALL PFNGLINDEXSPROC glad_glIndexs;
+#define glIndexs glad_glIndexs
+GLAD_API_CALL PFNGLINDEXSVPROC glad_glIndexsv;
+#define glIndexsv glad_glIndexsv
+GLAD_API_CALL PFNGLINDEXUBPROC glad_glIndexub;
+#define glIndexub glad_glIndexub
+GLAD_API_CALL PFNGLINDEXUBVPROC glad_glIndexubv;
+#define glIndexubv glad_glIndexubv
+GLAD_API_CALL PFNGLINITNAMESPROC glad_glInitNames;
+#define glInitNames glad_glInitNames
+GLAD_API_CALL PFNGLINTERLEAVEDARRAYSPROC glad_glInterleavedArrays;
+#define glInterleavedArrays glad_glInterleavedArrays
+GLAD_API_CALL PFNGLISBUFFERPROC glad_glIsBuffer;
+#define glIsBuffer glad_glIsBuffer
+GLAD_API_CALL PFNGLISENABLEDPROC glad_glIsEnabled;
+#define glIsEnabled glad_glIsEnabled
+GLAD_API_CALL PFNGLISENABLEDIPROC glad_glIsEnabledi;
+#define glIsEnabledi glad_glIsEnabledi
+GLAD_API_CALL PFNGLISFRAMEBUFFERPROC glad_glIsFramebuffer;
+#define glIsFramebuffer glad_glIsFramebuffer
+GLAD_API_CALL PFNGLISLISTPROC glad_glIsList;
+#define glIsList glad_glIsList
+GLAD_API_CALL PFNGLISPROGRAMPROC glad_glIsProgram;
+#define glIsProgram glad_glIsProgram
+GLAD_API_CALL PFNGLISQUERYPROC glad_glIsQuery;
+#define glIsQuery glad_glIsQuery
+GLAD_API_CALL PFNGLISRENDERBUFFERPROC glad_glIsRenderbuffer;
+#define glIsRenderbuffer glad_glIsRenderbuffer
+GLAD_API_CALL PFNGLISSAMPLERPROC glad_glIsSampler;
+#define glIsSampler glad_glIsSampler
+GLAD_API_CALL PFNGLISSHADERPROC glad_glIsShader;
+#define glIsShader glad_glIsShader
+GLAD_API_CALL PFNGLISSYNCPROC glad_glIsSync;
+#define glIsSync glad_glIsSync
+GLAD_API_CALL PFNGLISTEXTUREPROC glad_glIsTexture;
+#define glIsTexture glad_glIsTexture
+GLAD_API_CALL PFNGLISVERTEXARRAYPROC glad_glIsVertexArray;
+#define glIsVertexArray glad_glIsVertexArray
+GLAD_API_CALL PFNGLLIGHTMODELFPROC glad_glLightModelf;
+#define glLightModelf glad_glLightModelf
+GLAD_API_CALL PFNGLLIGHTMODELFVPROC glad_glLightModelfv;
+#define glLightModelfv glad_glLightModelfv
+GLAD_API_CALL PFNGLLIGHTMODELIPROC glad_glLightModeli;
+#define glLightModeli glad_glLightModeli
+GLAD_API_CALL PFNGLLIGHTMODELIVPROC glad_glLightModeliv;
+#define glLightModeliv glad_glLightModeliv
+GLAD_API_CALL PFNGLLIGHTFPROC glad_glLightf;
+#define glLightf glad_glLightf
+GLAD_API_CALL PFNGLLIGHTFVPROC glad_glLightfv;
+#define glLightfv glad_glLightfv
+GLAD_API_CALL PFNGLLIGHTIPROC glad_glLighti;
+#define glLighti glad_glLighti
+GLAD_API_CALL PFNGLLIGHTIVPROC glad_glLightiv;
+#define glLightiv glad_glLightiv
+GLAD_API_CALL PFNGLLINESTIPPLEPROC glad_glLineStipple;
+#define glLineStipple glad_glLineStipple
+GLAD_API_CALL PFNGLLINEWIDTHPROC glad_glLineWidth;
+#define glLineWidth glad_glLineWidth
+GLAD_API_CALL PFNGLLINKPROGRAMPROC glad_glLinkProgram;
+#define glLinkProgram glad_glLinkProgram
+GLAD_API_CALL PFNGLLISTBASEPROC glad_glListBase;
+#define glListBase glad_glListBase
+GLAD_API_CALL PFNGLLOADIDENTITYPROC glad_glLoadIdentity;
+#define glLoadIdentity glad_glLoadIdentity
+GLAD_API_CALL PFNGLLOADMATRIXDPROC glad_glLoadMatrixd;
+#define glLoadMatrixd glad_glLoadMatrixd
+GLAD_API_CALL PFNGLLOADMATRIXFPROC glad_glLoadMatrixf;
+#define glLoadMatrixf glad_glLoadMatrixf
+GLAD_API_CALL PFNGLLOADNAMEPROC glad_glLoadName;
+#define glLoadName glad_glLoadName
+GLAD_API_CALL PFNGLLOADTRANSPOSEMATRIXDPROC glad_glLoadTransposeMatrixd;
+#define glLoadTransposeMatrixd glad_glLoadTransposeMatrixd
+GLAD_API_CALL PFNGLLOADTRANSPOSEMATRIXFPROC glad_glLoadTransposeMatrixf;
+#define glLoadTransposeMatrixf glad_glLoadTransposeMatrixf
+GLAD_API_CALL PFNGLLOGICOPPROC glad_glLogicOp;
+#define glLogicOp glad_glLogicOp
+GLAD_API_CALL PFNGLMAP1DPROC glad_glMap1d;
+#define glMap1d glad_glMap1d
+GLAD_API_CALL PFNGLMAP1FPROC glad_glMap1f;
+#define glMap1f glad_glMap1f
+GLAD_API_CALL PFNGLMAP2DPROC glad_glMap2d;
+#define glMap2d glad_glMap2d
+GLAD_API_CALL PFNGLMAP2FPROC glad_glMap2f;
+#define glMap2f glad_glMap2f
+GLAD_API_CALL PFNGLMAPBUFFERPROC glad_glMapBuffer;
+#define glMapBuffer glad_glMapBuffer
+GLAD_API_CALL PFNGLMAPBUFFERRANGEPROC glad_glMapBufferRange;
+#define glMapBufferRange glad_glMapBufferRange
+GLAD_API_CALL PFNGLMAPGRID1DPROC glad_glMapGrid1d;
+#define glMapGrid1d glad_glMapGrid1d
+GLAD_API_CALL PFNGLMAPGRID1FPROC glad_glMapGrid1f;
+#define glMapGrid1f glad_glMapGrid1f
+GLAD_API_CALL PFNGLMAPGRID2DPROC glad_glMapGrid2d;
+#define glMapGrid2d glad_glMapGrid2d
+GLAD_API_CALL PFNGLMAPGRID2FPROC glad_glMapGrid2f;
+#define glMapGrid2f glad_glMapGrid2f
+GLAD_API_CALL PFNGLMATERIALFPROC glad_glMaterialf;
+#define glMaterialf glad_glMaterialf
+GLAD_API_CALL PFNGLMATERIALFVPROC glad_glMaterialfv;
+#define glMaterialfv glad_glMaterialfv
+GLAD_API_CALL PFNGLMATERIALIPROC glad_glMateriali;
+#define glMateriali glad_glMateriali
+GLAD_API_CALL PFNGLMATERIALIVPROC glad_glMaterialiv;
+#define glMaterialiv glad_glMaterialiv
+GLAD_API_CALL PFNGLMATRIXMODEPROC glad_glMatrixMode;
+#define glMatrixMode glad_glMatrixMode
+GLAD_API_CALL PFNGLMULTMATRIXDPROC glad_glMultMatrixd;
+#define glMultMatrixd glad_glMultMatrixd
+GLAD_API_CALL PFNGLMULTMATRIXFPROC glad_glMultMatrixf;
+#define glMultMatrixf glad_glMultMatrixf
+GLAD_API_CALL PFNGLMULTTRANSPOSEMATRIXDPROC glad_glMultTransposeMatrixd;
+#define glMultTransposeMatrixd glad_glMultTransposeMatrixd
+GLAD_API_CALL PFNGLMULTTRANSPOSEMATRIXFPROC glad_glMultTransposeMatrixf;
+#define glMultTransposeMatrixf glad_glMultTransposeMatrixf
+GLAD_API_CALL PFNGLMULTIDRAWARRAYSPROC glad_glMultiDrawArrays;
+#define glMultiDrawArrays glad_glMultiDrawArrays
+GLAD_API_CALL PFNGLMULTIDRAWELEMENTSPROC glad_glMultiDrawElements;
+#define glMultiDrawElements glad_glMultiDrawElements
+GLAD_API_CALL PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC glad_glMultiDrawElementsBaseVertex;
+#define glMultiDrawElementsBaseVertex glad_glMultiDrawElementsBaseVertex
+GLAD_API_CALL PFNGLMULTITEXCOORD1DPROC glad_glMultiTexCoord1d;
+#define glMultiTexCoord1d glad_glMultiTexCoord1d
+GLAD_API_CALL PFNGLMULTITEXCOORD1DVPROC glad_glMultiTexCoord1dv;
+#define glMultiTexCoord1dv glad_glMultiTexCoord1dv
+GLAD_API_CALL PFNGLMULTITEXCOORD1FPROC glad_glMultiTexCoord1f;
+#define glMultiTexCoord1f glad_glMultiTexCoord1f
+GLAD_API_CALL PFNGLMULTITEXCOORD1FVPROC glad_glMultiTexCoord1fv;
+#define glMultiTexCoord1fv glad_glMultiTexCoord1fv
+GLAD_API_CALL PFNGLMULTITEXCOORD1IPROC glad_glMultiTexCoord1i;
+#define glMultiTexCoord1i glad_glMultiTexCoord1i
+GLAD_API_CALL PFNGLMULTITEXCOORD1IVPROC glad_glMultiTexCoord1iv;
+#define glMultiTexCoord1iv glad_glMultiTexCoord1iv
+GLAD_API_CALL PFNGLMULTITEXCOORD1SPROC glad_glMultiTexCoord1s;
+#define glMultiTexCoord1s glad_glMultiTexCoord1s
+GLAD_API_CALL PFNGLMULTITEXCOORD1SVPROC glad_glMultiTexCoord1sv;
+#define glMultiTexCoord1sv glad_glMultiTexCoord1sv
+GLAD_API_CALL PFNGLMULTITEXCOORD2DPROC glad_glMultiTexCoord2d;
+#define glMultiTexCoord2d glad_glMultiTexCoord2d
+GLAD_API_CALL PFNGLMULTITEXCOORD2DVPROC glad_glMultiTexCoord2dv;
+#define glMultiTexCoord2dv glad_glMultiTexCoord2dv
+GLAD_API_CALL PFNGLMULTITEXCOORD2FPROC glad_glMultiTexCoord2f;
+#define glMultiTexCoord2f glad_glMultiTexCoord2f
+GLAD_API_CALL PFNGLMULTITEXCOORD2FVPROC glad_glMultiTexCoord2fv;
+#define glMultiTexCoord2fv glad_glMultiTexCoord2fv
+GLAD_API_CALL PFNGLMULTITEXCOORD2IPROC glad_glMultiTexCoord2i;
+#define glMultiTexCoord2i glad_glMultiTexCoord2i
+GLAD_API_CALL PFNGLMULTITEXCOORD2IVPROC glad_glMultiTexCoord2iv;
+#define glMultiTexCoord2iv glad_glMultiTexCoord2iv
+GLAD_API_CALL PFNGLMULTITEXCOORD2SPROC glad_glMultiTexCoord2s;
+#define glMultiTexCoord2s glad_glMultiTexCoord2s
+GLAD_API_CALL PFNGLMULTITEXCOORD2SVPROC glad_glMultiTexCoord2sv;
+#define glMultiTexCoord2sv glad_glMultiTexCoord2sv
+GLAD_API_CALL PFNGLMULTITEXCOORD3DPROC glad_glMultiTexCoord3d;
+#define glMultiTexCoord3d glad_glMultiTexCoord3d
+GLAD_API_CALL PFNGLMULTITEXCOORD3DVPROC glad_glMultiTexCoord3dv;
+#define glMultiTexCoord3dv glad_glMultiTexCoord3dv
+GLAD_API_CALL PFNGLMULTITEXCOORD3FPROC glad_glMultiTexCoord3f;
+#define glMultiTexCoord3f glad_glMultiTexCoord3f
+GLAD_API_CALL PFNGLMULTITEXCOORD3FVPROC glad_glMultiTexCoord3fv;
+#define glMultiTexCoord3fv glad_glMultiTexCoord3fv
+GLAD_API_CALL PFNGLMULTITEXCOORD3IPROC glad_glMultiTexCoord3i;
+#define glMultiTexCoord3i glad_glMultiTexCoord3i
+GLAD_API_CALL PFNGLMULTITEXCOORD3IVPROC glad_glMultiTexCoord3iv;
+#define glMultiTexCoord3iv glad_glMultiTexCoord3iv
+GLAD_API_CALL PFNGLMULTITEXCOORD3SPROC glad_glMultiTexCoord3s;
+#define glMultiTexCoord3s glad_glMultiTexCoord3s
+GLAD_API_CALL PFNGLMULTITEXCOORD3SVPROC glad_glMultiTexCoord3sv;
+#define glMultiTexCoord3sv glad_glMultiTexCoord3sv
+GLAD_API_CALL PFNGLMULTITEXCOORD4DPROC glad_glMultiTexCoord4d;
+#define glMultiTexCoord4d glad_glMultiTexCoord4d
+GLAD_API_CALL PFNGLMULTITEXCOORD4DVPROC glad_glMultiTexCoord4dv;
+#define glMultiTexCoord4dv glad_glMultiTexCoord4dv
+GLAD_API_CALL PFNGLMULTITEXCOORD4FPROC glad_glMultiTexCoord4f;
+#define glMultiTexCoord4f glad_glMultiTexCoord4f
+GLAD_API_CALL PFNGLMULTITEXCOORD4FVPROC glad_glMultiTexCoord4fv;
+#define glMultiTexCoord4fv glad_glMultiTexCoord4fv
+GLAD_API_CALL PFNGLMULTITEXCOORD4IPROC glad_glMultiTexCoord4i;
+#define glMultiTexCoord4i glad_glMultiTexCoord4i
+GLAD_API_CALL PFNGLMULTITEXCOORD4IVPROC glad_glMultiTexCoord4iv;
+#define glMultiTexCoord4iv glad_glMultiTexCoord4iv
+GLAD_API_CALL PFNGLMULTITEXCOORD4SPROC glad_glMultiTexCoord4s;
+#define glMultiTexCoord4s glad_glMultiTexCoord4s
+GLAD_API_CALL PFNGLMULTITEXCOORD4SVPROC glad_glMultiTexCoord4sv;
+#define glMultiTexCoord4sv glad_glMultiTexCoord4sv
+GLAD_API_CALL PFNGLMULTITEXCOORDP1UIPROC glad_glMultiTexCoordP1ui;
+#define glMultiTexCoordP1ui glad_glMultiTexCoordP1ui
+GLAD_API_CALL PFNGLMULTITEXCOORDP1UIVPROC glad_glMultiTexCoordP1uiv;
+#define glMultiTexCoordP1uiv glad_glMultiTexCoordP1uiv
+GLAD_API_CALL PFNGLMULTITEXCOORDP2UIPROC glad_glMultiTexCoordP2ui;
+#define glMultiTexCoordP2ui glad_glMultiTexCoordP2ui
+GLAD_API_CALL PFNGLMULTITEXCOORDP2UIVPROC glad_glMultiTexCoordP2uiv;
+#define glMultiTexCoordP2uiv glad_glMultiTexCoordP2uiv
+GLAD_API_CALL PFNGLMULTITEXCOORDP3UIPROC glad_glMultiTexCoordP3ui;
+#define glMultiTexCoordP3ui glad_glMultiTexCoordP3ui
+GLAD_API_CALL PFNGLMULTITEXCOORDP3UIVPROC glad_glMultiTexCoordP3uiv;
+#define glMultiTexCoordP3uiv glad_glMultiTexCoordP3uiv
+GLAD_API_CALL PFNGLMULTITEXCOORDP4UIPROC glad_glMultiTexCoordP4ui;
+#define glMultiTexCoordP4ui glad_glMultiTexCoordP4ui
+GLAD_API_CALL PFNGLMULTITEXCOORDP4UIVPROC glad_glMultiTexCoordP4uiv;
+#define glMultiTexCoordP4uiv glad_glMultiTexCoordP4uiv
+GLAD_API_CALL PFNGLNEWLISTPROC glad_glNewList;
+#define glNewList glad_glNewList
+GLAD_API_CALL PFNGLNORMAL3BPROC glad_glNormal3b;
+#define glNormal3b glad_glNormal3b
+GLAD_API_CALL PFNGLNORMAL3BVPROC glad_glNormal3bv;
+#define glNormal3bv glad_glNormal3bv
+GLAD_API_CALL PFNGLNORMAL3DPROC glad_glNormal3d;
+#define glNormal3d glad_glNormal3d
+GLAD_API_CALL PFNGLNORMAL3DVPROC glad_glNormal3dv;
+#define glNormal3dv glad_glNormal3dv
+GLAD_API_CALL PFNGLNORMAL3FPROC glad_glNormal3f;
+#define glNormal3f glad_glNormal3f
+GLAD_API_CALL PFNGLNORMAL3FVPROC glad_glNormal3fv;
+#define glNormal3fv glad_glNormal3fv
+GLAD_API_CALL PFNGLNORMAL3IPROC glad_glNormal3i;
+#define glNormal3i glad_glNormal3i
+GLAD_API_CALL PFNGLNORMAL3IVPROC glad_glNormal3iv;
+#define glNormal3iv glad_glNormal3iv
+GLAD_API_CALL PFNGLNORMAL3SPROC glad_glNormal3s;
+#define glNormal3s glad_glNormal3s
+GLAD_API_CALL PFNGLNORMAL3SVPROC glad_glNormal3sv;
+#define glNormal3sv glad_glNormal3sv
+GLAD_API_CALL PFNGLNORMALP3UIPROC glad_glNormalP3ui;
+#define glNormalP3ui glad_glNormalP3ui
+GLAD_API_CALL PFNGLNORMALP3UIVPROC glad_glNormalP3uiv;
+#define glNormalP3uiv glad_glNormalP3uiv
+GLAD_API_CALL PFNGLNORMALPOINTERPROC glad_glNormalPointer;
+#define glNormalPointer glad_glNormalPointer
+GLAD_API_CALL PFNGLOBJECTLABELPROC glad_glObjectLabel;
+#define glObjectLabel glad_glObjectLabel
+GLAD_API_CALL PFNGLOBJECTPTRLABELPROC glad_glObjectPtrLabel;
+#define glObjectPtrLabel glad_glObjectPtrLabel
+GLAD_API_CALL PFNGLORTHOPROC glad_glOrtho;
+#define glOrtho glad_glOrtho
+GLAD_API_CALL PFNGLPASSTHROUGHPROC glad_glPassThrough;
+#define glPassThrough glad_glPassThrough
+GLAD_API_CALL PFNGLPIXELMAPFVPROC glad_glPixelMapfv;
+#define glPixelMapfv glad_glPixelMapfv
+GLAD_API_CALL PFNGLPIXELMAPUIVPROC glad_glPixelMapuiv;
+#define glPixelMapuiv glad_glPixelMapuiv
+GLAD_API_CALL PFNGLPIXELMAPUSVPROC glad_glPixelMapusv;
+#define glPixelMapusv glad_glPixelMapusv
+GLAD_API_CALL PFNGLPIXELSTOREFPROC glad_glPixelStoref;
+#define glPixelStoref glad_glPixelStoref
+GLAD_API_CALL PFNGLPIXELSTOREIPROC glad_glPixelStorei;
+#define glPixelStorei glad_glPixelStorei
+GLAD_API_CALL PFNGLPIXELTRANSFERFPROC glad_glPixelTransferf;
+#define glPixelTransferf glad_glPixelTransferf
+GLAD_API_CALL PFNGLPIXELTRANSFERIPROC glad_glPixelTransferi;
+#define glPixelTransferi glad_glPixelTransferi
+GLAD_API_CALL PFNGLPIXELZOOMPROC glad_glPixelZoom;
+#define glPixelZoom glad_glPixelZoom
+GLAD_API_CALL PFNGLPOINTPARAMETERFPROC glad_glPointParameterf;
+#define glPointParameterf glad_glPointParameterf
+GLAD_API_CALL PFNGLPOINTPARAMETERFVPROC glad_glPointParameterfv;
+#define glPointParameterfv glad_glPointParameterfv
+GLAD_API_CALL PFNGLPOINTPARAMETERIPROC glad_glPointParameteri;
+#define glPointParameteri glad_glPointParameteri
+GLAD_API_CALL PFNGLPOINTPARAMETERIVPROC glad_glPointParameteriv;
+#define glPointParameteriv glad_glPointParameteriv
+GLAD_API_CALL PFNGLPOINTSIZEPROC glad_glPointSize;
+#define glPointSize glad_glPointSize
+GLAD_API_CALL PFNGLPOLYGONMODEPROC glad_glPolygonMode;
+#define glPolygonMode glad_glPolygonMode
+GLAD_API_CALL PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset;
+#define glPolygonOffset glad_glPolygonOffset
+GLAD_API_CALL PFNGLPOLYGONSTIPPLEPROC glad_glPolygonStipple;
+#define glPolygonStipple glad_glPolygonStipple
+GLAD_API_CALL PFNGLPOPATTRIBPROC glad_glPopAttrib;
+#define glPopAttrib glad_glPopAttrib
+GLAD_API_CALL PFNGLPOPCLIENTATTRIBPROC glad_glPopClientAttrib;
+#define glPopClientAttrib glad_glPopClientAttrib
+GLAD_API_CALL PFNGLPOPDEBUGGROUPPROC glad_glPopDebugGroup;
+#define glPopDebugGroup glad_glPopDebugGroup
+GLAD_API_CALL PFNGLPOPMATRIXPROC glad_glPopMatrix;
+#define glPopMatrix glad_glPopMatrix
+GLAD_API_CALL PFNGLPOPNAMEPROC glad_glPopName;
+#define glPopName glad_glPopName
+GLAD_API_CALL PFNGLPRIMITIVERESTARTINDEXPROC glad_glPrimitiveRestartIndex;
+#define glPrimitiveRestartIndex glad_glPrimitiveRestartIndex
+GLAD_API_CALL PFNGLPRIORITIZETEXTURESPROC glad_glPrioritizeTextures;
+#define glPrioritizeTextures glad_glPrioritizeTextures
+GLAD_API_CALL PFNGLPROVOKINGVERTEXPROC glad_glProvokingVertex;
+#define glProvokingVertex glad_glProvokingVertex
+GLAD_API_CALL PFNGLPUSHATTRIBPROC glad_glPushAttrib;
+#define glPushAttrib glad_glPushAttrib
+GLAD_API_CALL PFNGLPUSHCLIENTATTRIBPROC glad_glPushClientAttrib;
+#define glPushClientAttrib glad_glPushClientAttrib
+GLAD_API_CALL PFNGLPUSHDEBUGGROUPPROC glad_glPushDebugGroup;
+#define glPushDebugGroup glad_glPushDebugGroup
+GLAD_API_CALL PFNGLPUSHMATRIXPROC glad_glPushMatrix;
+#define glPushMatrix glad_glPushMatrix
+GLAD_API_CALL PFNGLPUSHNAMEPROC glad_glPushName;
+#define glPushName glad_glPushName
+GLAD_API_CALL PFNGLQUERYCOUNTERPROC glad_glQueryCounter;
+#define glQueryCounter glad_glQueryCounter
+GLAD_API_CALL PFNGLRASTERPOS2DPROC glad_glRasterPos2d;
+#define glRasterPos2d glad_glRasterPos2d
+GLAD_API_CALL PFNGLRASTERPOS2DVPROC glad_glRasterPos2dv;
+#define glRasterPos2dv glad_glRasterPos2dv
+GLAD_API_CALL PFNGLRASTERPOS2FPROC glad_glRasterPos2f;
+#define glRasterPos2f glad_glRasterPos2f
+GLAD_API_CALL PFNGLRASTERPOS2FVPROC glad_glRasterPos2fv;
+#define glRasterPos2fv glad_glRasterPos2fv
+GLAD_API_CALL PFNGLRASTERPOS2IPROC glad_glRasterPos2i;
+#define glRasterPos2i glad_glRasterPos2i
+GLAD_API_CALL PFNGLRASTERPOS2IVPROC glad_glRasterPos2iv;
+#define glRasterPos2iv glad_glRasterPos2iv
+GLAD_API_CALL PFNGLRASTERPOS2SPROC glad_glRasterPos2s;
+#define glRasterPos2s glad_glRasterPos2s
+GLAD_API_CALL PFNGLRASTERPOS2SVPROC glad_glRasterPos2sv;
+#define glRasterPos2sv glad_glRasterPos2sv
+GLAD_API_CALL PFNGLRASTERPOS3DPROC glad_glRasterPos3d;
+#define glRasterPos3d glad_glRasterPos3d
+GLAD_API_CALL PFNGLRASTERPOS3DVPROC glad_glRasterPos3dv;
+#define glRasterPos3dv glad_glRasterPos3dv
+GLAD_API_CALL PFNGLRASTERPOS3FPROC glad_glRasterPos3f;
+#define glRasterPos3f glad_glRasterPos3f
+GLAD_API_CALL PFNGLRASTERPOS3FVPROC glad_glRasterPos3fv;
+#define glRasterPos3fv glad_glRasterPos3fv
+GLAD_API_CALL PFNGLRASTERPOS3IPROC glad_glRasterPos3i;
+#define glRasterPos3i glad_glRasterPos3i
+GLAD_API_CALL PFNGLRASTERPOS3IVPROC glad_glRasterPos3iv;
+#define glRasterPos3iv glad_glRasterPos3iv
+GLAD_API_CALL PFNGLRASTERPOS3SPROC glad_glRasterPos3s;
+#define glRasterPos3s glad_glRasterPos3s
+GLAD_API_CALL PFNGLRASTERPOS3SVPROC glad_glRasterPos3sv;
+#define glRasterPos3sv glad_glRasterPos3sv
+GLAD_API_CALL PFNGLRASTERPOS4DPROC glad_glRasterPos4d;
+#define glRasterPos4d glad_glRasterPos4d
+GLAD_API_CALL PFNGLRASTERPOS4DVPROC glad_glRasterPos4dv;
+#define glRasterPos4dv glad_glRasterPos4dv
+GLAD_API_CALL PFNGLRASTERPOS4FPROC glad_glRasterPos4f;
+#define glRasterPos4f glad_glRasterPos4f
+GLAD_API_CALL PFNGLRASTERPOS4FVPROC glad_glRasterPos4fv;
+#define glRasterPos4fv glad_glRasterPos4fv
+GLAD_API_CALL PFNGLRASTERPOS4IPROC glad_glRasterPos4i;
+#define glRasterPos4i glad_glRasterPos4i
+GLAD_API_CALL PFNGLRASTERPOS4IVPROC glad_glRasterPos4iv;
+#define glRasterPos4iv glad_glRasterPos4iv
+GLAD_API_CALL PFNGLRASTERPOS4SPROC glad_glRasterPos4s;
+#define glRasterPos4s glad_glRasterPos4s
+GLAD_API_CALL PFNGLRASTERPOS4SVPROC glad_glRasterPos4sv;
+#define glRasterPos4sv glad_glRasterPos4sv
+GLAD_API_CALL PFNGLREADBUFFERPROC glad_glReadBuffer;
+#define glReadBuffer glad_glReadBuffer
+GLAD_API_CALL PFNGLREADPIXELSPROC glad_glReadPixels;
+#define glReadPixels glad_glReadPixels
+GLAD_API_CALL PFNGLREADNPIXELSARBPROC glad_glReadnPixelsARB;
+#define glReadnPixelsARB glad_glReadnPixelsARB
+GLAD_API_CALL PFNGLRECTDPROC glad_glRectd;
+#define glRectd glad_glRectd
+GLAD_API_CALL PFNGLRECTDVPROC glad_glRectdv;
+#define glRectdv glad_glRectdv
+GLAD_API_CALL PFNGLRECTFPROC glad_glRectf;
+#define glRectf glad_glRectf
+GLAD_API_CALL PFNGLRECTFVPROC glad_glRectfv;
+#define glRectfv glad_glRectfv
+GLAD_API_CALL PFNGLRECTIPROC glad_glRecti;
+#define glRecti glad_glRecti
+GLAD_API_CALL PFNGLRECTIVPROC glad_glRectiv;
+#define glRectiv glad_glRectiv
+GLAD_API_CALL PFNGLRECTSPROC glad_glRects;
+#define glRects glad_glRects
+GLAD_API_CALL PFNGLRECTSVPROC glad_glRectsv;
+#define glRectsv glad_glRectsv
+GLAD_API_CALL PFNGLRENDERMODEPROC glad_glRenderMode;
+#define glRenderMode glad_glRenderMode
+GLAD_API_CALL PFNGLRENDERBUFFERSTORAGEPROC glad_glRenderbufferStorage;
+#define glRenderbufferStorage glad_glRenderbufferStorage
+GLAD_API_CALL PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC glad_glRenderbufferStorageMultisample;
+#define glRenderbufferStorageMultisample glad_glRenderbufferStorageMultisample
+GLAD_API_CALL PFNGLROTATEDPROC glad_glRotated;
+#define glRotated glad_glRotated
+GLAD_API_CALL PFNGLROTATEFPROC glad_glRotatef;
+#define glRotatef glad_glRotatef
+GLAD_API_CALL PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage;
+#define glSampleCoverage glad_glSampleCoverage
+GLAD_API_CALL PFNGLSAMPLECOVERAGEARBPROC glad_glSampleCoverageARB;
+#define glSampleCoverageARB glad_glSampleCoverageARB
+GLAD_API_CALL PFNGLSAMPLEMASKIPROC glad_glSampleMaski;
+#define glSampleMaski glad_glSampleMaski
+GLAD_API_CALL PFNGLSAMPLERPARAMETERIIVPROC glad_glSamplerParameterIiv;
+#define glSamplerParameterIiv glad_glSamplerParameterIiv
+GLAD_API_CALL PFNGLSAMPLERPARAMETERIUIVPROC glad_glSamplerParameterIuiv;
+#define glSamplerParameterIuiv glad_glSamplerParameterIuiv
+GLAD_API_CALL PFNGLSAMPLERPARAMETERFPROC glad_glSamplerParameterf;
+#define glSamplerParameterf glad_glSamplerParameterf
+GLAD_API_CALL PFNGLSAMPLERPARAMETERFVPROC glad_glSamplerParameterfv;
+#define glSamplerParameterfv glad_glSamplerParameterfv
+GLAD_API_CALL PFNGLSAMPLERPARAMETERIPROC glad_glSamplerParameteri;
+#define glSamplerParameteri glad_glSamplerParameteri
+GLAD_API_CALL PFNGLSAMPLERPARAMETERIVPROC glad_glSamplerParameteriv;
+#define glSamplerParameteriv glad_glSamplerParameteriv
+GLAD_API_CALL PFNGLSCALEDPROC glad_glScaled;
+#define glScaled glad_glScaled
+GLAD_API_CALL PFNGLSCALEFPROC glad_glScalef;
+#define glScalef glad_glScalef
+GLAD_API_CALL PFNGLSCISSORPROC glad_glScissor;
+#define glScissor glad_glScissor
+GLAD_API_CALL PFNGLSECONDARYCOLOR3BPROC glad_glSecondaryColor3b;
+#define glSecondaryColor3b glad_glSecondaryColor3b
+GLAD_API_CALL PFNGLSECONDARYCOLOR3BVPROC glad_glSecondaryColor3bv;
+#define glSecondaryColor3bv glad_glSecondaryColor3bv
+GLAD_API_CALL PFNGLSECONDARYCOLOR3DPROC glad_glSecondaryColor3d;
+#define glSecondaryColor3d glad_glSecondaryColor3d
+GLAD_API_CALL PFNGLSECONDARYCOLOR3DVPROC glad_glSecondaryColor3dv;
+#define glSecondaryColor3dv glad_glSecondaryColor3dv
+GLAD_API_CALL PFNGLSECONDARYCOLOR3FPROC glad_glSecondaryColor3f;
+#define glSecondaryColor3f glad_glSecondaryColor3f
+GLAD_API_CALL PFNGLSECONDARYCOLOR3FVPROC glad_glSecondaryColor3fv;
+#define glSecondaryColor3fv glad_glSecondaryColor3fv
+GLAD_API_CALL PFNGLSECONDARYCOLOR3IPROC glad_glSecondaryColor3i;
+#define glSecondaryColor3i glad_glSecondaryColor3i
+GLAD_API_CALL PFNGLSECONDARYCOLOR3IVPROC glad_glSecondaryColor3iv;
+#define glSecondaryColor3iv glad_glSecondaryColor3iv
+GLAD_API_CALL PFNGLSECONDARYCOLOR3SPROC glad_glSecondaryColor3s;
+#define glSecondaryColor3s glad_glSecondaryColor3s
+GLAD_API_CALL PFNGLSECONDARYCOLOR3SVPROC glad_glSecondaryColor3sv;
+#define glSecondaryColor3sv glad_glSecondaryColor3sv
+GLAD_API_CALL PFNGLSECONDARYCOLOR3UBPROC glad_glSecondaryColor3ub;
+#define glSecondaryColor3ub glad_glSecondaryColor3ub
+GLAD_API_CALL PFNGLSECONDARYCOLOR3UBVPROC glad_glSecondaryColor3ubv;
+#define glSecondaryColor3ubv glad_glSecondaryColor3ubv
+GLAD_API_CALL PFNGLSECONDARYCOLOR3UIPROC glad_glSecondaryColor3ui;
+#define glSecondaryColor3ui glad_glSecondaryColor3ui
+GLAD_API_CALL PFNGLSECONDARYCOLOR3UIVPROC glad_glSecondaryColor3uiv;
+#define glSecondaryColor3uiv glad_glSecondaryColor3uiv
+GLAD_API_CALL PFNGLSECONDARYCOLOR3USPROC glad_glSecondaryColor3us;
+#define glSecondaryColor3us glad_glSecondaryColor3us
+GLAD_API_CALL PFNGLSECONDARYCOLOR3USVPROC glad_glSecondaryColor3usv;
+#define glSecondaryColor3usv glad_glSecondaryColor3usv
+GLAD_API_CALL PFNGLSECONDARYCOLORP3UIPROC glad_glSecondaryColorP3ui;
+#define glSecondaryColorP3ui glad_glSecondaryColorP3ui
+GLAD_API_CALL PFNGLSECONDARYCOLORP3UIVPROC glad_glSecondaryColorP3uiv;
+#define glSecondaryColorP3uiv glad_glSecondaryColorP3uiv
+GLAD_API_CALL PFNGLSECONDARYCOLORPOINTERPROC glad_glSecondaryColorPointer;
+#define glSecondaryColorPointer glad_glSecondaryColorPointer
+GLAD_API_CALL PFNGLSELECTBUFFERPROC glad_glSelectBuffer;
+#define glSelectBuffer glad_glSelectBuffer
+GLAD_API_CALL PFNGLSHADEMODELPROC glad_glShadeModel;
+#define glShadeModel glad_glShadeModel
+GLAD_API_CALL PFNGLSHADERSOURCEPROC glad_glShaderSource;
+#define glShaderSource glad_glShaderSource
+GLAD_API_CALL PFNGLSTENCILFUNCPROC glad_glStencilFunc;
+#define glStencilFunc glad_glStencilFunc
+GLAD_API_CALL PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate;
+#define glStencilFuncSeparate glad_glStencilFuncSeparate
+GLAD_API_CALL PFNGLSTENCILMASKPROC glad_glStencilMask;
+#define glStencilMask glad_glStencilMask
+GLAD_API_CALL PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate;
+#define glStencilMaskSeparate glad_glStencilMaskSeparate
+GLAD_API_CALL PFNGLSTENCILOPPROC glad_glStencilOp;
+#define glStencilOp glad_glStencilOp
+GLAD_API_CALL PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate;
+#define glStencilOpSeparate glad_glStencilOpSeparate
+GLAD_API_CALL PFNGLTEXBUFFERPROC glad_glTexBuffer;
+#define glTexBuffer glad_glTexBuffer
+GLAD_API_CALL PFNGLTEXCOORD1DPROC glad_glTexCoord1d;
+#define glTexCoord1d glad_glTexCoord1d
+GLAD_API_CALL PFNGLTEXCOORD1DVPROC glad_glTexCoord1dv;
+#define glTexCoord1dv glad_glTexCoord1dv
+GLAD_API_CALL PFNGLTEXCOORD1FPROC glad_glTexCoord1f;
+#define glTexCoord1f glad_glTexCoord1f
+GLAD_API_CALL PFNGLTEXCOORD1FVPROC glad_glTexCoord1fv;
+#define glTexCoord1fv glad_glTexCoord1fv
+GLAD_API_CALL PFNGLTEXCOORD1IPROC glad_glTexCoord1i;
+#define glTexCoord1i glad_glTexCoord1i
+GLAD_API_CALL PFNGLTEXCOORD1IVPROC glad_glTexCoord1iv;
+#define glTexCoord1iv glad_glTexCoord1iv
+GLAD_API_CALL PFNGLTEXCOORD1SPROC glad_glTexCoord1s;
+#define glTexCoord1s glad_glTexCoord1s
+GLAD_API_CALL PFNGLTEXCOORD1SVPROC glad_glTexCoord1sv;
+#define glTexCoord1sv glad_glTexCoord1sv
+GLAD_API_CALL PFNGLTEXCOORD2DPROC glad_glTexCoord2d;
+#define glTexCoord2d glad_glTexCoord2d
+GLAD_API_CALL PFNGLTEXCOORD2DVPROC glad_glTexCoord2dv;
+#define glTexCoord2dv glad_glTexCoord2dv
+GLAD_API_CALL PFNGLTEXCOORD2FPROC glad_glTexCoord2f;
+#define glTexCoord2f glad_glTexCoord2f
+GLAD_API_CALL PFNGLTEXCOORD2FVPROC glad_glTexCoord2fv;
+#define glTexCoord2fv glad_glTexCoord2fv
+GLAD_API_CALL PFNGLTEXCOORD2IPROC glad_glTexCoord2i;
+#define glTexCoord2i glad_glTexCoord2i
+GLAD_API_CALL PFNGLTEXCOORD2IVPROC glad_glTexCoord2iv;
+#define glTexCoord2iv glad_glTexCoord2iv
+GLAD_API_CALL PFNGLTEXCOORD2SPROC glad_glTexCoord2s;
+#define glTexCoord2s glad_glTexCoord2s
+GLAD_API_CALL PFNGLTEXCOORD2SVPROC glad_glTexCoord2sv;
+#define glTexCoord2sv glad_glTexCoord2sv
+GLAD_API_CALL PFNGLTEXCOORD3DPROC glad_glTexCoord3d;
+#define glTexCoord3d glad_glTexCoord3d
+GLAD_API_CALL PFNGLTEXCOORD3DVPROC glad_glTexCoord3dv;
+#define glTexCoord3dv glad_glTexCoord3dv
+GLAD_API_CALL PFNGLTEXCOORD3FPROC glad_glTexCoord3f;
+#define glTexCoord3f glad_glTexCoord3f
+GLAD_API_CALL PFNGLTEXCOORD3FVPROC glad_glTexCoord3fv;
+#define glTexCoord3fv glad_glTexCoord3fv
+GLAD_API_CALL PFNGLTEXCOORD3IPROC glad_glTexCoord3i;
+#define glTexCoord3i glad_glTexCoord3i
+GLAD_API_CALL PFNGLTEXCOORD3IVPROC glad_glTexCoord3iv;
+#define glTexCoord3iv glad_glTexCoord3iv
+GLAD_API_CALL PFNGLTEXCOORD3SPROC glad_glTexCoord3s;
+#define glTexCoord3s glad_glTexCoord3s
+GLAD_API_CALL PFNGLTEXCOORD3SVPROC glad_glTexCoord3sv;
+#define glTexCoord3sv glad_glTexCoord3sv
+GLAD_API_CALL PFNGLTEXCOORD4DPROC glad_glTexCoord4d;
+#define glTexCoord4d glad_glTexCoord4d
+GLAD_API_CALL PFNGLTEXCOORD4DVPROC glad_glTexCoord4dv;
+#define glTexCoord4dv glad_glTexCoord4dv
+GLAD_API_CALL PFNGLTEXCOORD4FPROC glad_glTexCoord4f;
+#define glTexCoord4f glad_glTexCoord4f
+GLAD_API_CALL PFNGLTEXCOORD4FVPROC glad_glTexCoord4fv;
+#define glTexCoord4fv glad_glTexCoord4fv
+GLAD_API_CALL PFNGLTEXCOORD4IPROC glad_glTexCoord4i;
+#define glTexCoord4i glad_glTexCoord4i
+GLAD_API_CALL PFNGLTEXCOORD4IVPROC glad_glTexCoord4iv;
+#define glTexCoord4iv glad_glTexCoord4iv
+GLAD_API_CALL PFNGLTEXCOORD4SPROC glad_glTexCoord4s;
+#define glTexCoord4s glad_glTexCoord4s
+GLAD_API_CALL PFNGLTEXCOORD4SVPROC glad_glTexCoord4sv;
+#define glTexCoord4sv glad_glTexCoord4sv
+GLAD_API_CALL PFNGLTEXCOORDP1UIPROC glad_glTexCoordP1ui;
+#define glTexCoordP1ui glad_glTexCoordP1ui
+GLAD_API_CALL PFNGLTEXCOORDP1UIVPROC glad_glTexCoordP1uiv;
+#define glTexCoordP1uiv glad_glTexCoordP1uiv
+GLAD_API_CALL PFNGLTEXCOORDP2UIPROC glad_glTexCoordP2ui;
+#define glTexCoordP2ui glad_glTexCoordP2ui
+GLAD_API_CALL PFNGLTEXCOORDP2UIVPROC glad_glTexCoordP2uiv;
+#define glTexCoordP2uiv glad_glTexCoordP2uiv
+GLAD_API_CALL PFNGLTEXCOORDP3UIPROC glad_glTexCoordP3ui;
+#define glTexCoordP3ui glad_glTexCoordP3ui
+GLAD_API_CALL PFNGLTEXCOORDP3UIVPROC glad_glTexCoordP3uiv;
+#define glTexCoordP3uiv glad_glTexCoordP3uiv
+GLAD_API_CALL PFNGLTEXCOORDP4UIPROC glad_glTexCoordP4ui;
+#define glTexCoordP4ui glad_glTexCoordP4ui
+GLAD_API_CALL PFNGLTEXCOORDP4UIVPROC glad_glTexCoordP4uiv;
+#define glTexCoordP4uiv glad_glTexCoordP4uiv
+GLAD_API_CALL PFNGLTEXCOORDPOINTERPROC glad_glTexCoordPointer;
+#define glTexCoordPointer glad_glTexCoordPointer
+GLAD_API_CALL PFNGLTEXENVFPROC glad_glTexEnvf;
+#define glTexEnvf glad_glTexEnvf
+GLAD_API_CALL PFNGLTEXENVFVPROC glad_glTexEnvfv;
+#define glTexEnvfv glad_glTexEnvfv
+GLAD_API_CALL PFNGLTEXENVIPROC glad_glTexEnvi;
+#define glTexEnvi glad_glTexEnvi
+GLAD_API_CALL PFNGLTEXENVIVPROC glad_glTexEnviv;
+#define glTexEnviv glad_glTexEnviv
+GLAD_API_CALL PFNGLTEXGENDPROC glad_glTexGend;
+#define glTexGend glad_glTexGend
+GLAD_API_CALL PFNGLTEXGENDVPROC glad_glTexGendv;
+#define glTexGendv glad_glTexGendv
+GLAD_API_CALL PFNGLTEXGENFPROC glad_glTexGenf;
+#define glTexGenf glad_glTexGenf
+GLAD_API_CALL PFNGLTEXGENFVPROC glad_glTexGenfv;
+#define glTexGenfv glad_glTexGenfv
+GLAD_API_CALL PFNGLTEXGENIPROC glad_glTexGeni;
+#define glTexGeni glad_glTexGeni
+GLAD_API_CALL PFNGLTEXGENIVPROC glad_glTexGeniv;
+#define glTexGeniv glad_glTexGeniv
+GLAD_API_CALL PFNGLTEXIMAGE1DPROC glad_glTexImage1D;
+#define glTexImage1D glad_glTexImage1D
+GLAD_API_CALL PFNGLTEXIMAGE2DPROC glad_glTexImage2D;
+#define glTexImage2D glad_glTexImage2D
+GLAD_API_CALL PFNGLTEXIMAGE2DMULTISAMPLEPROC glad_glTexImage2DMultisample;
+#define glTexImage2DMultisample glad_glTexImage2DMultisample
+GLAD_API_CALL PFNGLTEXIMAGE3DPROC glad_glTexImage3D;
+#define glTexImage3D glad_glTexImage3D
+GLAD_API_CALL PFNGLTEXIMAGE3DMULTISAMPLEPROC glad_glTexImage3DMultisample;
+#define glTexImage3DMultisample glad_glTexImage3DMultisample
+GLAD_API_CALL PFNGLTEXPARAMETERIIVPROC glad_glTexParameterIiv;
+#define glTexParameterIiv glad_glTexParameterIiv
+GLAD_API_CALL PFNGLTEXPARAMETERIUIVPROC glad_glTexParameterIuiv;
+#define glTexParameterIuiv glad_glTexParameterIuiv
+GLAD_API_CALL PFNGLTEXPARAMETERFPROC glad_glTexParameterf;
+#define glTexParameterf glad_glTexParameterf
+GLAD_API_CALL PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv;
+#define glTexParameterfv glad_glTexParameterfv
+GLAD_API_CALL PFNGLTEXPARAMETERIPROC glad_glTexParameteri;
+#define glTexParameteri glad_glTexParameteri
+GLAD_API_CALL PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv;
+#define glTexParameteriv glad_glTexParameteriv
+GLAD_API_CALL PFNGLTEXSUBIMAGE1DPROC glad_glTexSubImage1D;
+#define glTexSubImage1D glad_glTexSubImage1D
+GLAD_API_CALL PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D;
+#define glTexSubImage2D glad_glTexSubImage2D
+GLAD_API_CALL PFNGLTEXSUBIMAGE3DPROC glad_glTexSubImage3D;
+#define glTexSubImage3D glad_glTexSubImage3D
+GLAD_API_CALL PFNGLTRANSFORMFEEDBACKVARYINGSPROC glad_glTransformFeedbackVaryings;
+#define glTransformFeedbackVaryings glad_glTransformFeedbackVaryings
+GLAD_API_CALL PFNGLTRANSLATEDPROC glad_glTranslated;
+#define glTranslated glad_glTranslated
+GLAD_API_CALL PFNGLTRANSLATEFPROC glad_glTranslatef;
+#define glTranslatef glad_glTranslatef
+GLAD_API_CALL PFNGLUNIFORM1FPROC glad_glUniform1f;
+#define glUniform1f glad_glUniform1f
+GLAD_API_CALL PFNGLUNIFORM1FVPROC glad_glUniform1fv;
+#define glUniform1fv glad_glUniform1fv
+GLAD_API_CALL PFNGLUNIFORM1IPROC glad_glUniform1i;
+#define glUniform1i glad_glUniform1i
+GLAD_API_CALL PFNGLUNIFORM1IVPROC glad_glUniform1iv;
+#define glUniform1iv glad_glUniform1iv
+GLAD_API_CALL PFNGLUNIFORM1UIPROC glad_glUniform1ui;
+#define glUniform1ui glad_glUniform1ui
+GLAD_API_CALL PFNGLUNIFORM1UIVPROC glad_glUniform1uiv;
+#define glUniform1uiv glad_glUniform1uiv
+GLAD_API_CALL PFNGLUNIFORM2FPROC glad_glUniform2f;
+#define glUniform2f glad_glUniform2f
+GLAD_API_CALL PFNGLUNIFORM2FVPROC glad_glUniform2fv;
+#define glUniform2fv glad_glUniform2fv
+GLAD_API_CALL PFNGLUNIFORM2IPROC glad_glUniform2i;
+#define glUniform2i glad_glUniform2i
+GLAD_API_CALL PFNGLUNIFORM2IVPROC glad_glUniform2iv;
+#define glUniform2iv glad_glUniform2iv
+GLAD_API_CALL PFNGLUNIFORM2UIPROC glad_glUniform2ui;
+#define glUniform2ui glad_glUniform2ui
+GLAD_API_CALL PFNGLUNIFORM2UIVPROC glad_glUniform2uiv;
+#define glUniform2uiv glad_glUniform2uiv
+GLAD_API_CALL PFNGLUNIFORM3FPROC glad_glUniform3f;
+#define glUniform3f glad_glUniform3f
+GLAD_API_CALL PFNGLUNIFORM3FVPROC glad_glUniform3fv;
+#define glUniform3fv glad_glUniform3fv
+GLAD_API_CALL PFNGLUNIFORM3IPROC glad_glUniform3i;
+#define glUniform3i glad_glUniform3i
+GLAD_API_CALL PFNGLUNIFORM3IVPROC glad_glUniform3iv;
+#define glUniform3iv glad_glUniform3iv
+GLAD_API_CALL PFNGLUNIFORM3UIPROC glad_glUniform3ui;
+#define glUniform3ui glad_glUniform3ui
+GLAD_API_CALL PFNGLUNIFORM3UIVPROC glad_glUniform3uiv;
+#define glUniform3uiv glad_glUniform3uiv
+GLAD_API_CALL PFNGLUNIFORM4FPROC glad_glUniform4f;
+#define glUniform4f glad_glUniform4f
+GLAD_API_CALL PFNGLUNIFORM4FVPROC glad_glUniform4fv;
+#define glUniform4fv glad_glUniform4fv
+GLAD_API_CALL PFNGLUNIFORM4IPROC glad_glUniform4i;
+#define glUniform4i glad_glUniform4i
+GLAD_API_CALL PFNGLUNIFORM4IVPROC glad_glUniform4iv;
+#define glUniform4iv glad_glUniform4iv
+GLAD_API_CALL PFNGLUNIFORM4UIPROC glad_glUniform4ui;
+#define glUniform4ui glad_glUniform4ui
+GLAD_API_CALL PFNGLUNIFORM4UIVPROC glad_glUniform4uiv;
+#define glUniform4uiv glad_glUniform4uiv
+GLAD_API_CALL PFNGLUNIFORMBLOCKBINDINGPROC glad_glUniformBlockBinding;
+#define glUniformBlockBinding glad_glUniformBlockBinding
+GLAD_API_CALL PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv;
+#define glUniformMatrix2fv glad_glUniformMatrix2fv
+GLAD_API_CALL PFNGLUNIFORMMATRIX2X3FVPROC glad_glUniformMatrix2x3fv;
+#define glUniformMatrix2x3fv glad_glUniformMatrix2x3fv
+GLAD_API_CALL PFNGLUNIFORMMATRIX2X4FVPROC glad_glUniformMatrix2x4fv;
+#define glUniformMatrix2x4fv glad_glUniformMatrix2x4fv
+GLAD_API_CALL PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv;
+#define glUniformMatrix3fv glad_glUniformMatrix3fv
+GLAD_API_CALL PFNGLUNIFORMMATRIX3X2FVPROC glad_glUniformMatrix3x2fv;
+#define glUniformMatrix3x2fv glad_glUniformMatrix3x2fv
+GLAD_API_CALL PFNGLUNIFORMMATRIX3X4FVPROC glad_glUniformMatrix3x4fv;
+#define glUniformMatrix3x4fv glad_glUniformMatrix3x4fv
+GLAD_API_CALL PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv;
+#define glUniformMatrix4fv glad_glUniformMatrix4fv
+GLAD_API_CALL PFNGLUNIFORMMATRIX4X2FVPROC glad_glUniformMatrix4x2fv;
+#define glUniformMatrix4x2fv glad_glUniformMatrix4x2fv
+GLAD_API_CALL PFNGLUNIFORMMATRIX4X3FVPROC glad_glUniformMatrix4x3fv;
+#define glUniformMatrix4x3fv glad_glUniformMatrix4x3fv
+GLAD_API_CALL PFNGLUNMAPBUFFERPROC glad_glUnmapBuffer;
+#define glUnmapBuffer glad_glUnmapBuffer
+GLAD_API_CALL PFNGLUSEPROGRAMPROC glad_glUseProgram;
+#define glUseProgram glad_glUseProgram
+GLAD_API_CALL PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram;
+#define glValidateProgram glad_glValidateProgram
+GLAD_API_CALL PFNGLVERTEX2DPROC glad_glVertex2d;
+#define glVertex2d glad_glVertex2d
+GLAD_API_CALL PFNGLVERTEX2DVPROC glad_glVertex2dv;
+#define glVertex2dv glad_glVertex2dv
+GLAD_API_CALL PFNGLVERTEX2FPROC glad_glVertex2f;
+#define glVertex2f glad_glVertex2f
+GLAD_API_CALL PFNGLVERTEX2FVPROC glad_glVertex2fv;
+#define glVertex2fv glad_glVertex2fv
+GLAD_API_CALL PFNGLVERTEX2IPROC glad_glVertex2i;
+#define glVertex2i glad_glVertex2i
+GLAD_API_CALL PFNGLVERTEX2IVPROC glad_glVertex2iv;
+#define glVertex2iv glad_glVertex2iv
+GLAD_API_CALL PFNGLVERTEX2SPROC glad_glVertex2s;
+#define glVertex2s glad_glVertex2s
+GLAD_API_CALL PFNGLVERTEX2SVPROC glad_glVertex2sv;
+#define glVertex2sv glad_glVertex2sv
+GLAD_API_CALL PFNGLVERTEX3DPROC glad_glVertex3d;
+#define glVertex3d glad_glVertex3d
+GLAD_API_CALL PFNGLVERTEX3DVPROC glad_glVertex3dv;
+#define glVertex3dv glad_glVertex3dv
+GLAD_API_CALL PFNGLVERTEX3FPROC glad_glVertex3f;
+#define glVertex3f glad_glVertex3f
+GLAD_API_CALL PFNGLVERTEX3FVPROC glad_glVertex3fv;
+#define glVertex3fv glad_glVertex3fv
+GLAD_API_CALL PFNGLVERTEX3IPROC glad_glVertex3i;
+#define glVertex3i glad_glVertex3i
+GLAD_API_CALL PFNGLVERTEX3IVPROC glad_glVertex3iv;
+#define glVertex3iv glad_glVertex3iv
+GLAD_API_CALL PFNGLVERTEX3SPROC glad_glVertex3s;
+#define glVertex3s glad_glVertex3s
+GLAD_API_CALL PFNGLVERTEX3SVPROC glad_glVertex3sv;
+#define glVertex3sv glad_glVertex3sv
+GLAD_API_CALL PFNGLVERTEX4DPROC glad_glVertex4d;
+#define glVertex4d glad_glVertex4d
+GLAD_API_CALL PFNGLVERTEX4DVPROC glad_glVertex4dv;
+#define glVertex4dv glad_glVertex4dv
+GLAD_API_CALL PFNGLVERTEX4FPROC glad_glVertex4f;
+#define glVertex4f glad_glVertex4f
+GLAD_API_CALL PFNGLVERTEX4FVPROC glad_glVertex4fv;
+#define glVertex4fv glad_glVertex4fv
+GLAD_API_CALL PFNGLVERTEX4IPROC glad_glVertex4i;
+#define glVertex4i glad_glVertex4i
+GLAD_API_CALL PFNGLVERTEX4IVPROC glad_glVertex4iv;
+#define glVertex4iv glad_glVertex4iv
+GLAD_API_CALL PFNGLVERTEX4SPROC glad_glVertex4s;
+#define glVertex4s glad_glVertex4s
+GLAD_API_CALL PFNGLVERTEX4SVPROC glad_glVertex4sv;
+#define glVertex4sv glad_glVertex4sv
+GLAD_API_CALL PFNGLVERTEXATTRIB1DPROC glad_glVertexAttrib1d;
+#define glVertexAttrib1d glad_glVertexAttrib1d
+GLAD_API_CALL PFNGLVERTEXATTRIB1DVPROC glad_glVertexAttrib1dv;
+#define glVertexAttrib1dv glad_glVertexAttrib1dv
+GLAD_API_CALL PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f;
+#define glVertexAttrib1f glad_glVertexAttrib1f
+GLAD_API_CALL PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv;
+#define glVertexAttrib1fv glad_glVertexAttrib1fv
+GLAD_API_CALL PFNGLVERTEXATTRIB1SPROC glad_glVertexAttrib1s;
+#define glVertexAttrib1s glad_glVertexAttrib1s
+GLAD_API_CALL PFNGLVERTEXATTRIB1SVPROC glad_glVertexAttrib1sv;
+#define glVertexAttrib1sv glad_glVertexAttrib1sv
+GLAD_API_CALL PFNGLVERTEXATTRIB2DPROC glad_glVertexAttrib2d;
+#define glVertexAttrib2d glad_glVertexAttrib2d
+GLAD_API_CALL PFNGLVERTEXATTRIB2DVPROC glad_glVertexAttrib2dv;
+#define glVertexAttrib2dv glad_glVertexAttrib2dv
+GLAD_API_CALL PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f;
+#define glVertexAttrib2f glad_glVertexAttrib2f
+GLAD_API_CALL PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv;
+#define glVertexAttrib2fv glad_glVertexAttrib2fv
+GLAD_API_CALL PFNGLVERTEXATTRIB2SPROC glad_glVertexAttrib2s;
+#define glVertexAttrib2s glad_glVertexAttrib2s
+GLAD_API_CALL PFNGLVERTEXATTRIB2SVPROC glad_glVertexAttrib2sv;
+#define glVertexAttrib2sv glad_glVertexAttrib2sv
+GLAD_API_CALL PFNGLVERTEXATTRIB3DPROC glad_glVertexAttrib3d;
+#define glVertexAttrib3d glad_glVertexAttrib3d
+GLAD_API_CALL PFNGLVERTEXATTRIB3DVPROC glad_glVertexAttrib3dv;
+#define glVertexAttrib3dv glad_glVertexAttrib3dv
+GLAD_API_CALL PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f;
+#define glVertexAttrib3f glad_glVertexAttrib3f
+GLAD_API_CALL PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv;
+#define glVertexAttrib3fv glad_glVertexAttrib3fv
+GLAD_API_CALL PFNGLVERTEXATTRIB3SPROC glad_glVertexAttrib3s;
+#define glVertexAttrib3s glad_glVertexAttrib3s
+GLAD_API_CALL PFNGLVERTEXATTRIB3SVPROC glad_glVertexAttrib3sv;
+#define glVertexAttrib3sv glad_glVertexAttrib3sv
+GLAD_API_CALL PFNGLVERTEXATTRIB4NBVPROC glad_glVertexAttrib4Nbv;
+#define glVertexAttrib4Nbv glad_glVertexAttrib4Nbv
+GLAD_API_CALL PFNGLVERTEXATTRIB4NIVPROC glad_glVertexAttrib4Niv;
+#define glVertexAttrib4Niv glad_glVertexAttrib4Niv
+GLAD_API_CALL PFNGLVERTEXATTRIB4NSVPROC glad_glVertexAttrib4Nsv;
+#define glVertexAttrib4Nsv glad_glVertexAttrib4Nsv
+GLAD_API_CALL PFNGLVERTEXATTRIB4NUBPROC glad_glVertexAttrib4Nub;
+#define glVertexAttrib4Nub glad_glVertexAttrib4Nub
+GLAD_API_CALL PFNGLVERTEXATTRIB4NUBVPROC glad_glVertexAttrib4Nubv;
+#define glVertexAttrib4Nubv glad_glVertexAttrib4Nubv
+GLAD_API_CALL PFNGLVERTEXATTRIB4NUIVPROC glad_glVertexAttrib4Nuiv;
+#define glVertexAttrib4Nuiv glad_glVertexAttrib4Nuiv
+GLAD_API_CALL PFNGLVERTEXATTRIB4NUSVPROC glad_glVertexAttrib4Nusv;
+#define glVertexAttrib4Nusv glad_glVertexAttrib4Nusv
+GLAD_API_CALL PFNGLVERTEXATTRIB4BVPROC glad_glVertexAttrib4bv;
+#define glVertexAttrib4bv glad_glVertexAttrib4bv
+GLAD_API_CALL PFNGLVERTEXATTRIB4DPROC glad_glVertexAttrib4d;
+#define glVertexAttrib4d glad_glVertexAttrib4d
+GLAD_API_CALL PFNGLVERTEXATTRIB4DVPROC glad_glVertexAttrib4dv;
+#define glVertexAttrib4dv glad_glVertexAttrib4dv
+GLAD_API_CALL PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f;
+#define glVertexAttrib4f glad_glVertexAttrib4f
+GLAD_API_CALL PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv;
+#define glVertexAttrib4fv glad_glVertexAttrib4fv
+GLAD_API_CALL PFNGLVERTEXATTRIB4IVPROC glad_glVertexAttrib4iv;
+#define glVertexAttrib4iv glad_glVertexAttrib4iv
+GLAD_API_CALL PFNGLVERTEXATTRIB4SPROC glad_glVertexAttrib4s;
+#define glVertexAttrib4s glad_glVertexAttrib4s
+GLAD_API_CALL PFNGLVERTEXATTRIB4SVPROC glad_glVertexAttrib4sv;
+#define glVertexAttrib4sv glad_glVertexAttrib4sv
+GLAD_API_CALL PFNGLVERTEXATTRIB4UBVPROC glad_glVertexAttrib4ubv;
+#define glVertexAttrib4ubv glad_glVertexAttrib4ubv
+GLAD_API_CALL PFNGLVERTEXATTRIB4UIVPROC glad_glVertexAttrib4uiv;
+#define glVertexAttrib4uiv glad_glVertexAttrib4uiv
+GLAD_API_CALL PFNGLVERTEXATTRIB4USVPROC glad_glVertexAttrib4usv;
+#define glVertexAttrib4usv glad_glVertexAttrib4usv
+GLAD_API_CALL PFNGLVERTEXATTRIBDIVISORPROC glad_glVertexAttribDivisor;
+#define glVertexAttribDivisor glad_glVertexAttribDivisor
+GLAD_API_CALL PFNGLVERTEXATTRIBI1IPROC glad_glVertexAttribI1i;
+#define glVertexAttribI1i glad_glVertexAttribI1i
+GLAD_API_CALL PFNGLVERTEXATTRIBI1IVPROC glad_glVertexAttribI1iv;
+#define glVertexAttribI1iv glad_glVertexAttribI1iv
+GLAD_API_CALL PFNGLVERTEXATTRIBI1UIPROC glad_glVertexAttribI1ui;
+#define glVertexAttribI1ui glad_glVertexAttribI1ui
+GLAD_API_CALL PFNGLVERTEXATTRIBI1UIVPROC glad_glVertexAttribI1uiv;
+#define glVertexAttribI1uiv glad_glVertexAttribI1uiv
+GLAD_API_CALL PFNGLVERTEXATTRIBI2IPROC glad_glVertexAttribI2i;
+#define glVertexAttribI2i glad_glVertexAttribI2i
+GLAD_API_CALL PFNGLVERTEXATTRIBI2IVPROC glad_glVertexAttribI2iv;
+#define glVertexAttribI2iv glad_glVertexAttribI2iv
+GLAD_API_CALL PFNGLVERTEXATTRIBI2UIPROC glad_glVertexAttribI2ui;
+#define glVertexAttribI2ui glad_glVertexAttribI2ui
+GLAD_API_CALL PFNGLVERTEXATTRIBI2UIVPROC glad_glVertexAttribI2uiv;
+#define glVertexAttribI2uiv glad_glVertexAttribI2uiv
+GLAD_API_CALL PFNGLVERTEXATTRIBI3IPROC glad_glVertexAttribI3i;
+#define glVertexAttribI3i glad_glVertexAttribI3i
+GLAD_API_CALL PFNGLVERTEXATTRIBI3IVPROC glad_glVertexAttribI3iv;
+#define glVertexAttribI3iv glad_glVertexAttribI3iv
+GLAD_API_CALL PFNGLVERTEXATTRIBI3UIPROC glad_glVertexAttribI3ui;
+#define glVertexAttribI3ui glad_glVertexAttribI3ui
+GLAD_API_CALL PFNGLVERTEXATTRIBI3UIVPROC glad_glVertexAttribI3uiv;
+#define glVertexAttribI3uiv glad_glVertexAttribI3uiv
+GLAD_API_CALL PFNGLVERTEXATTRIBI4BVPROC glad_glVertexAttribI4bv;
+#define glVertexAttribI4bv glad_glVertexAttribI4bv
+GLAD_API_CALL PFNGLVERTEXATTRIBI4IPROC glad_glVertexAttribI4i;
+#define glVertexAttribI4i glad_glVertexAttribI4i
+GLAD_API_CALL PFNGLVERTEXATTRIBI4IVPROC glad_glVertexAttribI4iv;
+#define glVertexAttribI4iv glad_glVertexAttribI4iv
+GLAD_API_CALL PFNGLVERTEXATTRIBI4SVPROC glad_glVertexAttribI4sv;
+#define glVertexAttribI4sv glad_glVertexAttribI4sv
+GLAD_API_CALL PFNGLVERTEXATTRIBI4UBVPROC glad_glVertexAttribI4ubv;
+#define glVertexAttribI4ubv glad_glVertexAttribI4ubv
+GLAD_API_CALL PFNGLVERTEXATTRIBI4UIPROC glad_glVertexAttribI4ui;
+#define glVertexAttribI4ui glad_glVertexAttribI4ui
+GLAD_API_CALL PFNGLVERTEXATTRIBI4UIVPROC glad_glVertexAttribI4uiv;
+#define glVertexAttribI4uiv glad_glVertexAttribI4uiv
+GLAD_API_CALL PFNGLVERTEXATTRIBI4USVPROC glad_glVertexAttribI4usv;
+#define glVertexAttribI4usv glad_glVertexAttribI4usv
+GLAD_API_CALL PFNGLVERTEXATTRIBIPOINTERPROC glad_glVertexAttribIPointer;
+#define glVertexAttribIPointer glad_glVertexAttribIPointer
+GLAD_API_CALL PFNGLVERTEXATTRIBP1UIPROC glad_glVertexAttribP1ui;
+#define glVertexAttribP1ui glad_glVertexAttribP1ui
+GLAD_API_CALL PFNGLVERTEXATTRIBP1UIVPROC glad_glVertexAttribP1uiv;
+#define glVertexAttribP1uiv glad_glVertexAttribP1uiv
+GLAD_API_CALL PFNGLVERTEXATTRIBP2UIPROC glad_glVertexAttribP2ui;
+#define glVertexAttribP2ui glad_glVertexAttribP2ui
+GLAD_API_CALL PFNGLVERTEXATTRIBP2UIVPROC glad_glVertexAttribP2uiv;
+#define glVertexAttribP2uiv glad_glVertexAttribP2uiv
+GLAD_API_CALL PFNGLVERTEXATTRIBP3UIPROC glad_glVertexAttribP3ui;
+#define glVertexAttribP3ui glad_glVertexAttribP3ui
+GLAD_API_CALL PFNGLVERTEXATTRIBP3UIVPROC glad_glVertexAttribP3uiv;
+#define glVertexAttribP3uiv glad_glVertexAttribP3uiv
+GLAD_API_CALL PFNGLVERTEXATTRIBP4UIPROC glad_glVertexAttribP4ui;
+#define glVertexAttribP4ui glad_glVertexAttribP4ui
+GLAD_API_CALL PFNGLVERTEXATTRIBP4UIVPROC glad_glVertexAttribP4uiv;
+#define glVertexAttribP4uiv glad_glVertexAttribP4uiv
+GLAD_API_CALL PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer;
+#define glVertexAttribPointer glad_glVertexAttribPointer
+GLAD_API_CALL PFNGLVERTEXP2UIPROC glad_glVertexP2ui;
+#define glVertexP2ui glad_glVertexP2ui
+GLAD_API_CALL PFNGLVERTEXP2UIVPROC glad_glVertexP2uiv;
+#define glVertexP2uiv glad_glVertexP2uiv
+GLAD_API_CALL PFNGLVERTEXP3UIPROC glad_glVertexP3ui;
+#define glVertexP3ui glad_glVertexP3ui
+GLAD_API_CALL PFNGLVERTEXP3UIVPROC glad_glVertexP3uiv;
+#define glVertexP3uiv glad_glVertexP3uiv
+GLAD_API_CALL PFNGLVERTEXP4UIPROC glad_glVertexP4ui;
+#define glVertexP4ui glad_glVertexP4ui
+GLAD_API_CALL PFNGLVERTEXP4UIVPROC glad_glVertexP4uiv;
+#define glVertexP4uiv glad_glVertexP4uiv
+GLAD_API_CALL PFNGLVERTEXPOINTERPROC glad_glVertexPointer;
+#define glVertexPointer glad_glVertexPointer
+GLAD_API_CALL PFNGLVIEWPORTPROC glad_glViewport;
+#define glViewport glad_glViewport
+GLAD_API_CALL PFNGLWAITSYNCPROC glad_glWaitSync;
+#define glWaitSync glad_glWaitSync
+GLAD_API_CALL PFNGLWINDOWPOS2DPROC glad_glWindowPos2d;
+#define glWindowPos2d glad_glWindowPos2d
+GLAD_API_CALL PFNGLWINDOWPOS2DVPROC glad_glWindowPos2dv;
+#define glWindowPos2dv glad_glWindowPos2dv
+GLAD_API_CALL PFNGLWINDOWPOS2FPROC glad_glWindowPos2f;
+#define glWindowPos2f glad_glWindowPos2f
+GLAD_API_CALL PFNGLWINDOWPOS2FVPROC glad_glWindowPos2fv;
+#define glWindowPos2fv glad_glWindowPos2fv
+GLAD_API_CALL PFNGLWINDOWPOS2IPROC glad_glWindowPos2i;
+#define glWindowPos2i glad_glWindowPos2i
+GLAD_API_CALL PFNGLWINDOWPOS2IVPROC glad_glWindowPos2iv;
+#define glWindowPos2iv glad_glWindowPos2iv
+GLAD_API_CALL PFNGLWINDOWPOS2SPROC glad_glWindowPos2s;
+#define glWindowPos2s glad_glWindowPos2s
+GLAD_API_CALL PFNGLWINDOWPOS2SVPROC glad_glWindowPos2sv;
+#define glWindowPos2sv glad_glWindowPos2sv
+GLAD_API_CALL PFNGLWINDOWPOS3DPROC glad_glWindowPos3d;
+#define glWindowPos3d glad_glWindowPos3d
+GLAD_API_CALL PFNGLWINDOWPOS3DVPROC glad_glWindowPos3dv;
+#define glWindowPos3dv glad_glWindowPos3dv
+GLAD_API_CALL PFNGLWINDOWPOS3FPROC glad_glWindowPos3f;
+#define glWindowPos3f glad_glWindowPos3f
+GLAD_API_CALL PFNGLWINDOWPOS3FVPROC glad_glWindowPos3fv;
+#define glWindowPos3fv glad_glWindowPos3fv
+GLAD_API_CALL PFNGLWINDOWPOS3IPROC glad_glWindowPos3i;
+#define glWindowPos3i glad_glWindowPos3i
+GLAD_API_CALL PFNGLWINDOWPOS3IVPROC glad_glWindowPos3iv;
+#define glWindowPos3iv glad_glWindowPos3iv
+GLAD_API_CALL PFNGLWINDOWPOS3SPROC glad_glWindowPos3s;
+#define glWindowPos3s glad_glWindowPos3s
+GLAD_API_CALL PFNGLWINDOWPOS3SVPROC glad_glWindowPos3sv;
+#define glWindowPos3sv glad_glWindowPos3sv
+
+
+
+
+
+GLAD_API_CALL int gladLoadGLUserPtr( GLADuserptrloadfunc load, void *userptr);
+GLAD_API_CALL int gladLoadGL( GLADloadfunc load);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+/* Source */
+#ifdef GLAD_GL_IMPLEMENTATION
+#include
+#include
+#include
+
+#ifndef GLAD_IMPL_UTIL_C_
+#define GLAD_IMPL_UTIL_C_
+
+#ifdef _MSC_VER
+#define GLAD_IMPL_UTIL_SSCANF sscanf_s
+#else
+#define GLAD_IMPL_UTIL_SSCANF sscanf
+#endif
+
+#endif /* GLAD_IMPL_UTIL_C_ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+
+int GLAD_GL_VERSION_1_0 = 0;
+int GLAD_GL_VERSION_1_1 = 0;
+int GLAD_GL_VERSION_1_2 = 0;
+int GLAD_GL_VERSION_1_3 = 0;
+int GLAD_GL_VERSION_1_4 = 0;
+int GLAD_GL_VERSION_1_5 = 0;
+int GLAD_GL_VERSION_2_0 = 0;
+int GLAD_GL_VERSION_2_1 = 0;
+int GLAD_GL_VERSION_3_0 = 0;
+int GLAD_GL_VERSION_3_1 = 0;
+int GLAD_GL_VERSION_3_2 = 0;
+int GLAD_GL_VERSION_3_3 = 0;
+int GLAD_GL_ARB_multisample = 0;
+int GLAD_GL_ARB_robustness = 0;
+int GLAD_GL_KHR_debug = 0;
+
+
+
+PFNGLACCUMPROC glad_glAccum = NULL;
+PFNGLACTIVETEXTUREPROC glad_glActiveTexture = NULL;
+PFNGLALPHAFUNCPROC glad_glAlphaFunc = NULL;
+PFNGLARETEXTURESRESIDENTPROC glad_glAreTexturesResident = NULL;
+PFNGLARRAYELEMENTPROC glad_glArrayElement = NULL;
+PFNGLATTACHSHADERPROC glad_glAttachShader = NULL;
+PFNGLBEGINPROC glad_glBegin = NULL;
+PFNGLBEGINCONDITIONALRENDERPROC glad_glBeginConditionalRender = NULL;
+PFNGLBEGINQUERYPROC glad_glBeginQuery = NULL;
+PFNGLBEGINTRANSFORMFEEDBACKPROC glad_glBeginTransformFeedback = NULL;
+PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation = NULL;
+PFNGLBINDBUFFERPROC glad_glBindBuffer = NULL;
+PFNGLBINDBUFFERBASEPROC glad_glBindBufferBase = NULL;
+PFNGLBINDBUFFERRANGEPROC glad_glBindBufferRange = NULL;
+PFNGLBINDFRAGDATALOCATIONPROC glad_glBindFragDataLocation = NULL;
+PFNGLBINDFRAGDATALOCATIONINDEXEDPROC glad_glBindFragDataLocationIndexed = NULL;
+PFNGLBINDFRAMEBUFFERPROC glad_glBindFramebuffer = NULL;
+PFNGLBINDRENDERBUFFERPROC glad_glBindRenderbuffer = NULL;
+PFNGLBINDSAMPLERPROC glad_glBindSampler = NULL;
+PFNGLBINDTEXTUREPROC glad_glBindTexture = NULL;
+PFNGLBINDVERTEXARRAYPROC glad_glBindVertexArray = NULL;
+PFNGLBITMAPPROC glad_glBitmap = NULL;
+PFNGLBLENDCOLORPROC glad_glBlendColor = NULL;
+PFNGLBLENDEQUATIONPROC glad_glBlendEquation = NULL;
+PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate = NULL;
+PFNGLBLENDFUNCPROC glad_glBlendFunc = NULL;
+PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate = NULL;
+PFNGLBLITFRAMEBUFFERPROC glad_glBlitFramebuffer = NULL;
+PFNGLBUFFERDATAPROC glad_glBufferData = NULL;
+PFNGLBUFFERSUBDATAPROC glad_glBufferSubData = NULL;
+PFNGLCALLLISTPROC glad_glCallList = NULL;
+PFNGLCALLLISTSPROC glad_glCallLists = NULL;
+PFNGLCHECKFRAMEBUFFERSTATUSPROC glad_glCheckFramebufferStatus = NULL;
+PFNGLCLAMPCOLORPROC glad_glClampColor = NULL;
+PFNGLCLEARPROC glad_glClear = NULL;
+PFNGLCLEARACCUMPROC glad_glClearAccum = NULL;
+PFNGLCLEARBUFFERFIPROC glad_glClearBufferfi = NULL;
+PFNGLCLEARBUFFERFVPROC glad_glClearBufferfv = NULL;
+PFNGLCLEARBUFFERIVPROC glad_glClearBufferiv = NULL;
+PFNGLCLEARBUFFERUIVPROC glad_glClearBufferuiv = NULL;
+PFNGLCLEARCOLORPROC glad_glClearColor = NULL;
+PFNGLCLEARDEPTHPROC glad_glClearDepth = NULL;
+PFNGLCLEARINDEXPROC glad_glClearIndex = NULL;
+PFNGLCLEARSTENCILPROC glad_glClearStencil = NULL;
+PFNGLCLIENTACTIVETEXTUREPROC glad_glClientActiveTexture = NULL;
+PFNGLCLIENTWAITSYNCPROC glad_glClientWaitSync = NULL;
+PFNGLCLIPPLANEPROC glad_glClipPlane = NULL;
+PFNGLCOLOR3BPROC glad_glColor3b = NULL;
+PFNGLCOLOR3BVPROC glad_glColor3bv = NULL;
+PFNGLCOLOR3DPROC glad_glColor3d = NULL;
+PFNGLCOLOR3DVPROC glad_glColor3dv = NULL;
+PFNGLCOLOR3FPROC glad_glColor3f = NULL;
+PFNGLCOLOR3FVPROC glad_glColor3fv = NULL;
+PFNGLCOLOR3IPROC glad_glColor3i = NULL;
+PFNGLCOLOR3IVPROC glad_glColor3iv = NULL;
+PFNGLCOLOR3SPROC glad_glColor3s = NULL;
+PFNGLCOLOR3SVPROC glad_glColor3sv = NULL;
+PFNGLCOLOR3UBPROC glad_glColor3ub = NULL;
+PFNGLCOLOR3UBVPROC glad_glColor3ubv = NULL;
+PFNGLCOLOR3UIPROC glad_glColor3ui = NULL;
+PFNGLCOLOR3UIVPROC glad_glColor3uiv = NULL;
+PFNGLCOLOR3USPROC glad_glColor3us = NULL;
+PFNGLCOLOR3USVPROC glad_glColor3usv = NULL;
+PFNGLCOLOR4BPROC glad_glColor4b = NULL;
+PFNGLCOLOR4BVPROC glad_glColor4bv = NULL;
+PFNGLCOLOR4DPROC glad_glColor4d = NULL;
+PFNGLCOLOR4DVPROC glad_glColor4dv = NULL;
+PFNGLCOLOR4FPROC glad_glColor4f = NULL;
+PFNGLCOLOR4FVPROC glad_glColor4fv = NULL;
+PFNGLCOLOR4IPROC glad_glColor4i = NULL;
+PFNGLCOLOR4IVPROC glad_glColor4iv = NULL;
+PFNGLCOLOR4SPROC glad_glColor4s = NULL;
+PFNGLCOLOR4SVPROC glad_glColor4sv = NULL;
+PFNGLCOLOR4UBPROC glad_glColor4ub = NULL;
+PFNGLCOLOR4UBVPROC glad_glColor4ubv = NULL;
+PFNGLCOLOR4UIPROC glad_glColor4ui = NULL;
+PFNGLCOLOR4UIVPROC glad_glColor4uiv = NULL;
+PFNGLCOLOR4USPROC glad_glColor4us = NULL;
+PFNGLCOLOR4USVPROC glad_glColor4usv = NULL;
+PFNGLCOLORMASKPROC glad_glColorMask = NULL;
+PFNGLCOLORMASKIPROC glad_glColorMaski = NULL;
+PFNGLCOLORMATERIALPROC glad_glColorMaterial = NULL;
+PFNGLCOLORP3UIPROC glad_glColorP3ui = NULL;
+PFNGLCOLORP3UIVPROC glad_glColorP3uiv = NULL;
+PFNGLCOLORP4UIPROC glad_glColorP4ui = NULL;
+PFNGLCOLORP4UIVPROC glad_glColorP4uiv = NULL;
+PFNGLCOLORPOINTERPROC glad_glColorPointer = NULL;
+PFNGLCOMPILESHADERPROC glad_glCompileShader = NULL;
+PFNGLCOMPRESSEDTEXIMAGE1DPROC glad_glCompressedTexImage1D = NULL;
+PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D = NULL;
+PFNGLCOMPRESSEDTEXIMAGE3DPROC glad_glCompressedTexImage3D = NULL;
+PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC glad_glCompressedTexSubImage1D = NULL;
+PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D = NULL;
+PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC glad_glCompressedTexSubImage3D = NULL;
+PFNGLCOPYBUFFERSUBDATAPROC glad_glCopyBufferSubData = NULL;
+PFNGLCOPYPIXELSPROC glad_glCopyPixels = NULL;
+PFNGLCOPYTEXIMAGE1DPROC glad_glCopyTexImage1D = NULL;
+PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D = NULL;
+PFNGLCOPYTEXSUBIMAGE1DPROC glad_glCopyTexSubImage1D = NULL;
+PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D = NULL;
+PFNGLCOPYTEXSUBIMAGE3DPROC glad_glCopyTexSubImage3D = NULL;
+PFNGLCREATEPROGRAMPROC glad_glCreateProgram = NULL;
+PFNGLCREATESHADERPROC glad_glCreateShader = NULL;
+PFNGLCULLFACEPROC glad_glCullFace = NULL;
+PFNGLDEBUGMESSAGECALLBACKPROC glad_glDebugMessageCallback = NULL;
+PFNGLDEBUGMESSAGECONTROLPROC glad_glDebugMessageControl = NULL;
+PFNGLDEBUGMESSAGEINSERTPROC glad_glDebugMessageInsert = NULL;
+PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers = NULL;
+PFNGLDELETEFRAMEBUFFERSPROC glad_glDeleteFramebuffers = NULL;
+PFNGLDELETELISTSPROC glad_glDeleteLists = NULL;
+PFNGLDELETEPROGRAMPROC glad_glDeleteProgram = NULL;
+PFNGLDELETEQUERIESPROC glad_glDeleteQueries = NULL;
+PFNGLDELETERENDERBUFFERSPROC glad_glDeleteRenderbuffers = NULL;
+PFNGLDELETESAMPLERSPROC glad_glDeleteSamplers = NULL;
+PFNGLDELETESHADERPROC glad_glDeleteShader = NULL;
+PFNGLDELETESYNCPROC glad_glDeleteSync = NULL;
+PFNGLDELETETEXTURESPROC glad_glDeleteTextures = NULL;
+PFNGLDELETEVERTEXARRAYSPROC glad_glDeleteVertexArrays = NULL;
+PFNGLDEPTHFUNCPROC glad_glDepthFunc = NULL;
+PFNGLDEPTHMASKPROC glad_glDepthMask = NULL;
+PFNGLDEPTHRANGEPROC glad_glDepthRange = NULL;
+PFNGLDETACHSHADERPROC glad_glDetachShader = NULL;
+PFNGLDISABLEPROC glad_glDisable = NULL;
+PFNGLDISABLECLIENTSTATEPROC glad_glDisableClientState = NULL;
+PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray = NULL;
+PFNGLDISABLEIPROC glad_glDisablei = NULL;
+PFNGLDRAWARRAYSPROC glad_glDrawArrays = NULL;
+PFNGLDRAWARRAYSINSTANCEDPROC glad_glDrawArraysInstanced = NULL;
+PFNGLDRAWBUFFERPROC glad_glDrawBuffer = NULL;
+PFNGLDRAWBUFFERSPROC glad_glDrawBuffers = NULL;
+PFNGLDRAWELEMENTSPROC glad_glDrawElements = NULL;
+PFNGLDRAWELEMENTSBASEVERTEXPROC glad_glDrawElementsBaseVertex = NULL;
+PFNGLDRAWELEMENTSINSTANCEDPROC glad_glDrawElementsInstanced = NULL;
+PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC glad_glDrawElementsInstancedBaseVertex = NULL;
+PFNGLDRAWPIXELSPROC glad_glDrawPixels = NULL;
+PFNGLDRAWRANGEELEMENTSPROC glad_glDrawRangeElements = NULL;
+PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC glad_glDrawRangeElementsBaseVertex = NULL;
+PFNGLEDGEFLAGPROC glad_glEdgeFlag = NULL;
+PFNGLEDGEFLAGPOINTERPROC glad_glEdgeFlagPointer = NULL;
+PFNGLEDGEFLAGVPROC glad_glEdgeFlagv = NULL;
+PFNGLENABLEPROC glad_glEnable = NULL;
+PFNGLENABLECLIENTSTATEPROC glad_glEnableClientState = NULL;
+PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray = NULL;
+PFNGLENABLEIPROC glad_glEnablei = NULL;
+PFNGLENDPROC glad_glEnd = NULL;
+PFNGLENDCONDITIONALRENDERPROC glad_glEndConditionalRender = NULL;
+PFNGLENDLISTPROC glad_glEndList = NULL;
+PFNGLENDQUERYPROC glad_glEndQuery = NULL;
+PFNGLENDTRANSFORMFEEDBACKPROC glad_glEndTransformFeedback = NULL;
+PFNGLEVALCOORD1DPROC glad_glEvalCoord1d = NULL;
+PFNGLEVALCOORD1DVPROC glad_glEvalCoord1dv = NULL;
+PFNGLEVALCOORD1FPROC glad_glEvalCoord1f = NULL;
+PFNGLEVALCOORD1FVPROC glad_glEvalCoord1fv = NULL;
+PFNGLEVALCOORD2DPROC glad_glEvalCoord2d = NULL;
+PFNGLEVALCOORD2DVPROC glad_glEvalCoord2dv = NULL;
+PFNGLEVALCOORD2FPROC glad_glEvalCoord2f = NULL;
+PFNGLEVALCOORD2FVPROC glad_glEvalCoord2fv = NULL;
+PFNGLEVALMESH1PROC glad_glEvalMesh1 = NULL;
+PFNGLEVALMESH2PROC glad_glEvalMesh2 = NULL;
+PFNGLEVALPOINT1PROC glad_glEvalPoint1 = NULL;
+PFNGLEVALPOINT2PROC glad_glEvalPoint2 = NULL;
+PFNGLFEEDBACKBUFFERPROC glad_glFeedbackBuffer = NULL;
+PFNGLFENCESYNCPROC glad_glFenceSync = NULL;
+PFNGLFINISHPROC glad_glFinish = NULL;
+PFNGLFLUSHPROC glad_glFlush = NULL;
+PFNGLFLUSHMAPPEDBUFFERRANGEPROC glad_glFlushMappedBufferRange = NULL;
+PFNGLFOGCOORDPOINTERPROC glad_glFogCoordPointer = NULL;
+PFNGLFOGCOORDDPROC glad_glFogCoordd = NULL;
+PFNGLFOGCOORDDVPROC glad_glFogCoorddv = NULL;
+PFNGLFOGCOORDFPROC glad_glFogCoordf = NULL;
+PFNGLFOGCOORDFVPROC glad_glFogCoordfv = NULL;
+PFNGLFOGFPROC glad_glFogf = NULL;
+PFNGLFOGFVPROC glad_glFogfv = NULL;
+PFNGLFOGIPROC glad_glFogi = NULL;
+PFNGLFOGIVPROC glad_glFogiv = NULL;
+PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer = NULL;
+PFNGLFRAMEBUFFERTEXTUREPROC glad_glFramebufferTexture = NULL;
+PFNGLFRAMEBUFFERTEXTURE1DPROC glad_glFramebufferTexture1D = NULL;
+PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D = NULL;
+PFNGLFRAMEBUFFERTEXTURE3DPROC glad_glFramebufferTexture3D = NULL;
+PFNGLFRAMEBUFFERTEXTURELAYERPROC glad_glFramebufferTextureLayer = NULL;
+PFNGLFRONTFACEPROC glad_glFrontFace = NULL;
+PFNGLFRUSTUMPROC glad_glFrustum = NULL;
+PFNGLGENBUFFERSPROC glad_glGenBuffers = NULL;
+PFNGLGENFRAMEBUFFERSPROC glad_glGenFramebuffers = NULL;
+PFNGLGENLISTSPROC glad_glGenLists = NULL;
+PFNGLGENQUERIESPROC glad_glGenQueries = NULL;
+PFNGLGENRENDERBUFFERSPROC glad_glGenRenderbuffers = NULL;
+PFNGLGENSAMPLERSPROC glad_glGenSamplers = NULL;
+PFNGLGENTEXTURESPROC glad_glGenTextures = NULL;
+PFNGLGENVERTEXARRAYSPROC glad_glGenVertexArrays = NULL;
+PFNGLGENERATEMIPMAPPROC glad_glGenerateMipmap = NULL;
+PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib = NULL;
+PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform = NULL;
+PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC glad_glGetActiveUniformBlockName = NULL;
+PFNGLGETACTIVEUNIFORMBLOCKIVPROC glad_glGetActiveUniformBlockiv = NULL;
+PFNGLGETACTIVEUNIFORMNAMEPROC glad_glGetActiveUniformName = NULL;
+PFNGLGETACTIVEUNIFORMSIVPROC glad_glGetActiveUniformsiv = NULL;
+PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders = NULL;
+PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation = NULL;
+PFNGLGETBOOLEANI_VPROC glad_glGetBooleani_v = NULL;
+PFNGLGETBOOLEANVPROC glad_glGetBooleanv = NULL;
+PFNGLGETBUFFERPARAMETERI64VPROC glad_glGetBufferParameteri64v = NULL;
+PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv = NULL;
+PFNGLGETBUFFERPOINTERVPROC glad_glGetBufferPointerv = NULL;
+PFNGLGETBUFFERSUBDATAPROC glad_glGetBufferSubData = NULL;
+PFNGLGETCLIPPLANEPROC glad_glGetClipPlane = NULL;
+PFNGLGETCOMPRESSEDTEXIMAGEPROC glad_glGetCompressedTexImage = NULL;
+PFNGLGETDEBUGMESSAGELOGPROC glad_glGetDebugMessageLog = NULL;
+PFNGLGETDOUBLEVPROC glad_glGetDoublev = NULL;
+PFNGLGETERRORPROC glad_glGetError = NULL;
+PFNGLGETFLOATVPROC glad_glGetFloatv = NULL;
+PFNGLGETFRAGDATAINDEXPROC glad_glGetFragDataIndex = NULL;
+PFNGLGETFRAGDATALOCATIONPROC glad_glGetFragDataLocation = NULL;
+PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetFramebufferAttachmentParameteriv = NULL;
+PFNGLGETGRAPHICSRESETSTATUSARBPROC glad_glGetGraphicsResetStatusARB = NULL;
+PFNGLGETINTEGER64I_VPROC glad_glGetInteger64i_v = NULL;
+PFNGLGETINTEGER64VPROC glad_glGetInteger64v = NULL;
+PFNGLGETINTEGERI_VPROC glad_glGetIntegeri_v = NULL;
+PFNGLGETINTEGERVPROC glad_glGetIntegerv = NULL;
+PFNGLGETLIGHTFVPROC glad_glGetLightfv = NULL;
+PFNGLGETLIGHTIVPROC glad_glGetLightiv = NULL;
+PFNGLGETMAPDVPROC glad_glGetMapdv = NULL;
+PFNGLGETMAPFVPROC glad_glGetMapfv = NULL;
+PFNGLGETMAPIVPROC glad_glGetMapiv = NULL;
+PFNGLGETMATERIALFVPROC glad_glGetMaterialfv = NULL;
+PFNGLGETMATERIALIVPROC glad_glGetMaterialiv = NULL;
+PFNGLGETMULTISAMPLEFVPROC glad_glGetMultisamplefv = NULL;
+PFNGLGETOBJECTLABELPROC glad_glGetObjectLabel = NULL;
+PFNGLGETOBJECTPTRLABELPROC glad_glGetObjectPtrLabel = NULL;
+PFNGLGETPIXELMAPFVPROC glad_glGetPixelMapfv = NULL;
+PFNGLGETPIXELMAPUIVPROC glad_glGetPixelMapuiv = NULL;
+PFNGLGETPIXELMAPUSVPROC glad_glGetPixelMapusv = NULL;
+PFNGLGETPOINTERVPROC glad_glGetPointerv = NULL;
+PFNGLGETPOLYGONSTIPPLEPROC glad_glGetPolygonStipple = NULL;
+PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog = NULL;
+PFNGLGETPROGRAMIVPROC glad_glGetProgramiv = NULL;
+PFNGLGETQUERYOBJECTI64VPROC glad_glGetQueryObjecti64v = NULL;
+PFNGLGETQUERYOBJECTIVPROC glad_glGetQueryObjectiv = NULL;
+PFNGLGETQUERYOBJECTUI64VPROC glad_glGetQueryObjectui64v = NULL;
+PFNGLGETQUERYOBJECTUIVPROC glad_glGetQueryObjectuiv = NULL;
+PFNGLGETQUERYIVPROC glad_glGetQueryiv = NULL;
+PFNGLGETRENDERBUFFERPARAMETERIVPROC glad_glGetRenderbufferParameteriv = NULL;
+PFNGLGETSAMPLERPARAMETERIIVPROC glad_glGetSamplerParameterIiv = NULL;
+PFNGLGETSAMPLERPARAMETERIUIVPROC glad_glGetSamplerParameterIuiv = NULL;
+PFNGLGETSAMPLERPARAMETERFVPROC glad_glGetSamplerParameterfv = NULL;
+PFNGLGETSAMPLERPARAMETERIVPROC glad_glGetSamplerParameteriv = NULL;
+PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog = NULL;
+PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource = NULL;
+PFNGLGETSHADERIVPROC glad_glGetShaderiv = NULL;
+PFNGLGETSTRINGPROC glad_glGetString = NULL;
+PFNGLGETSTRINGIPROC glad_glGetStringi = NULL;
+PFNGLGETSYNCIVPROC glad_glGetSynciv = NULL;
+PFNGLGETTEXENVFVPROC glad_glGetTexEnvfv = NULL;
+PFNGLGETTEXENVIVPROC glad_glGetTexEnviv = NULL;
+PFNGLGETTEXGENDVPROC glad_glGetTexGendv = NULL;
+PFNGLGETTEXGENFVPROC glad_glGetTexGenfv = NULL;
+PFNGLGETTEXGENIVPROC glad_glGetTexGeniv = NULL;
+PFNGLGETTEXIMAGEPROC glad_glGetTexImage = NULL;
+PFNGLGETTEXLEVELPARAMETERFVPROC glad_glGetTexLevelParameterfv = NULL;
+PFNGLGETTEXLEVELPARAMETERIVPROC glad_glGetTexLevelParameteriv = NULL;
+PFNGLGETTEXPARAMETERIIVPROC glad_glGetTexParameterIiv = NULL;
+PFNGLGETTEXPARAMETERIUIVPROC glad_glGetTexParameterIuiv = NULL;
+PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv = NULL;
+PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv = NULL;
+PFNGLGETTRANSFORMFEEDBACKVARYINGPROC glad_glGetTransformFeedbackVarying = NULL;
+PFNGLGETUNIFORMBLOCKINDEXPROC glad_glGetUniformBlockIndex = NULL;
+PFNGLGETUNIFORMINDICESPROC glad_glGetUniformIndices = NULL;
+PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation = NULL;
+PFNGLGETUNIFORMFVPROC glad_glGetUniformfv = NULL;
+PFNGLGETUNIFORMIVPROC glad_glGetUniformiv = NULL;
+PFNGLGETUNIFORMUIVPROC glad_glGetUniformuiv = NULL;
+PFNGLGETVERTEXATTRIBIIVPROC glad_glGetVertexAttribIiv = NULL;
+PFNGLGETVERTEXATTRIBIUIVPROC glad_glGetVertexAttribIuiv = NULL;
+PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv = NULL;
+PFNGLGETVERTEXATTRIBDVPROC glad_glGetVertexAttribdv = NULL;
+PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv = NULL;
+PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv = NULL;
+PFNGLGETNCOLORTABLEARBPROC glad_glGetnColorTableARB = NULL;
+PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC glad_glGetnCompressedTexImageARB = NULL;
+PFNGLGETNCONVOLUTIONFILTERARBPROC glad_glGetnConvolutionFilterARB = NULL;
+PFNGLGETNHISTOGRAMARBPROC glad_glGetnHistogramARB = NULL;
+PFNGLGETNMAPDVARBPROC glad_glGetnMapdvARB = NULL;
+PFNGLGETNMAPFVARBPROC glad_glGetnMapfvARB = NULL;
+PFNGLGETNMAPIVARBPROC glad_glGetnMapivARB = NULL;
+PFNGLGETNMINMAXARBPROC glad_glGetnMinmaxARB = NULL;
+PFNGLGETNPIXELMAPFVARBPROC glad_glGetnPixelMapfvARB = NULL;
+PFNGLGETNPIXELMAPUIVARBPROC glad_glGetnPixelMapuivARB = NULL;
+PFNGLGETNPIXELMAPUSVARBPROC glad_glGetnPixelMapusvARB = NULL;
+PFNGLGETNPOLYGONSTIPPLEARBPROC glad_glGetnPolygonStippleARB = NULL;
+PFNGLGETNSEPARABLEFILTERARBPROC glad_glGetnSeparableFilterARB = NULL;
+PFNGLGETNTEXIMAGEARBPROC glad_glGetnTexImageARB = NULL;
+PFNGLGETNUNIFORMDVARBPROC glad_glGetnUniformdvARB = NULL;
+PFNGLGETNUNIFORMFVARBPROC glad_glGetnUniformfvARB = NULL;
+PFNGLGETNUNIFORMIVARBPROC glad_glGetnUniformivARB = NULL;
+PFNGLGETNUNIFORMUIVARBPROC glad_glGetnUniformuivARB = NULL;
+PFNGLHINTPROC glad_glHint = NULL;
+PFNGLINDEXMASKPROC glad_glIndexMask = NULL;
+PFNGLINDEXPOINTERPROC glad_glIndexPointer = NULL;
+PFNGLINDEXDPROC glad_glIndexd = NULL;
+PFNGLINDEXDVPROC glad_glIndexdv = NULL;
+PFNGLINDEXFPROC glad_glIndexf = NULL;
+PFNGLINDEXFVPROC glad_glIndexfv = NULL;
+PFNGLINDEXIPROC glad_glIndexi = NULL;
+PFNGLINDEXIVPROC glad_glIndexiv = NULL;
+PFNGLINDEXSPROC glad_glIndexs = NULL;
+PFNGLINDEXSVPROC glad_glIndexsv = NULL;
+PFNGLINDEXUBPROC glad_glIndexub = NULL;
+PFNGLINDEXUBVPROC glad_glIndexubv = NULL;
+PFNGLINITNAMESPROC glad_glInitNames = NULL;
+PFNGLINTERLEAVEDARRAYSPROC glad_glInterleavedArrays = NULL;
+PFNGLISBUFFERPROC glad_glIsBuffer = NULL;
+PFNGLISENABLEDPROC glad_glIsEnabled = NULL;
+PFNGLISENABLEDIPROC glad_glIsEnabledi = NULL;
+PFNGLISFRAMEBUFFERPROC glad_glIsFramebuffer = NULL;
+PFNGLISLISTPROC glad_glIsList = NULL;
+PFNGLISPROGRAMPROC glad_glIsProgram = NULL;
+PFNGLISQUERYPROC glad_glIsQuery = NULL;
+PFNGLISRENDERBUFFERPROC glad_glIsRenderbuffer = NULL;
+PFNGLISSAMPLERPROC glad_glIsSampler = NULL;
+PFNGLISSHADERPROC glad_glIsShader = NULL;
+PFNGLISSYNCPROC glad_glIsSync = NULL;
+PFNGLISTEXTUREPROC glad_glIsTexture = NULL;
+PFNGLISVERTEXARRAYPROC glad_glIsVertexArray = NULL;
+PFNGLLIGHTMODELFPROC glad_glLightModelf = NULL;
+PFNGLLIGHTMODELFVPROC glad_glLightModelfv = NULL;
+PFNGLLIGHTMODELIPROC glad_glLightModeli = NULL;
+PFNGLLIGHTMODELIVPROC glad_glLightModeliv = NULL;
+PFNGLLIGHTFPROC glad_glLightf = NULL;
+PFNGLLIGHTFVPROC glad_glLightfv = NULL;
+PFNGLLIGHTIPROC glad_glLighti = NULL;
+PFNGLLIGHTIVPROC glad_glLightiv = NULL;
+PFNGLLINESTIPPLEPROC glad_glLineStipple = NULL;
+PFNGLLINEWIDTHPROC glad_glLineWidth = NULL;
+PFNGLLINKPROGRAMPROC glad_glLinkProgram = NULL;
+PFNGLLISTBASEPROC glad_glListBase = NULL;
+PFNGLLOADIDENTITYPROC glad_glLoadIdentity = NULL;
+PFNGLLOADMATRIXDPROC glad_glLoadMatrixd = NULL;
+PFNGLLOADMATRIXFPROC glad_glLoadMatrixf = NULL;
+PFNGLLOADNAMEPROC glad_glLoadName = NULL;
+PFNGLLOADTRANSPOSEMATRIXDPROC glad_glLoadTransposeMatrixd = NULL;
+PFNGLLOADTRANSPOSEMATRIXFPROC glad_glLoadTransposeMatrixf = NULL;
+PFNGLLOGICOPPROC glad_glLogicOp = NULL;
+PFNGLMAP1DPROC glad_glMap1d = NULL;
+PFNGLMAP1FPROC glad_glMap1f = NULL;
+PFNGLMAP2DPROC glad_glMap2d = NULL;
+PFNGLMAP2FPROC glad_glMap2f = NULL;
+PFNGLMAPBUFFERPROC glad_glMapBuffer = NULL;
+PFNGLMAPBUFFERRANGEPROC glad_glMapBufferRange = NULL;
+PFNGLMAPGRID1DPROC glad_glMapGrid1d = NULL;
+PFNGLMAPGRID1FPROC glad_glMapGrid1f = NULL;
+PFNGLMAPGRID2DPROC glad_glMapGrid2d = NULL;
+PFNGLMAPGRID2FPROC glad_glMapGrid2f = NULL;
+PFNGLMATERIALFPROC glad_glMaterialf = NULL;
+PFNGLMATERIALFVPROC glad_glMaterialfv = NULL;
+PFNGLMATERIALIPROC glad_glMateriali = NULL;
+PFNGLMATERIALIVPROC glad_glMaterialiv = NULL;
+PFNGLMATRIXMODEPROC glad_glMatrixMode = NULL;
+PFNGLMULTMATRIXDPROC glad_glMultMatrixd = NULL;
+PFNGLMULTMATRIXFPROC glad_glMultMatrixf = NULL;
+PFNGLMULTTRANSPOSEMATRIXDPROC glad_glMultTransposeMatrixd = NULL;
+PFNGLMULTTRANSPOSEMATRIXFPROC glad_glMultTransposeMatrixf = NULL;
+PFNGLMULTIDRAWARRAYSPROC glad_glMultiDrawArrays = NULL;
+PFNGLMULTIDRAWELEMENTSPROC glad_glMultiDrawElements = NULL;
+PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC glad_glMultiDrawElementsBaseVertex = NULL;
+PFNGLMULTITEXCOORD1DPROC glad_glMultiTexCoord1d = NULL;
+PFNGLMULTITEXCOORD1DVPROC glad_glMultiTexCoord1dv = NULL;
+PFNGLMULTITEXCOORD1FPROC glad_glMultiTexCoord1f = NULL;
+PFNGLMULTITEXCOORD1FVPROC glad_glMultiTexCoord1fv = NULL;
+PFNGLMULTITEXCOORD1IPROC glad_glMultiTexCoord1i = NULL;
+PFNGLMULTITEXCOORD1IVPROC glad_glMultiTexCoord1iv = NULL;
+PFNGLMULTITEXCOORD1SPROC glad_glMultiTexCoord1s = NULL;
+PFNGLMULTITEXCOORD1SVPROC glad_glMultiTexCoord1sv = NULL;
+PFNGLMULTITEXCOORD2DPROC glad_glMultiTexCoord2d = NULL;
+PFNGLMULTITEXCOORD2DVPROC glad_glMultiTexCoord2dv = NULL;
+PFNGLMULTITEXCOORD2FPROC glad_glMultiTexCoord2f = NULL;
+PFNGLMULTITEXCOORD2FVPROC glad_glMultiTexCoord2fv = NULL;
+PFNGLMULTITEXCOORD2IPROC glad_glMultiTexCoord2i = NULL;
+PFNGLMULTITEXCOORD2IVPROC glad_glMultiTexCoord2iv = NULL;
+PFNGLMULTITEXCOORD2SPROC glad_glMultiTexCoord2s = NULL;
+PFNGLMULTITEXCOORD2SVPROC glad_glMultiTexCoord2sv = NULL;
+PFNGLMULTITEXCOORD3DPROC glad_glMultiTexCoord3d = NULL;
+PFNGLMULTITEXCOORD3DVPROC glad_glMultiTexCoord3dv = NULL;
+PFNGLMULTITEXCOORD3FPROC glad_glMultiTexCoord3f = NULL;
+PFNGLMULTITEXCOORD3FVPROC glad_glMultiTexCoord3fv = NULL;
+PFNGLMULTITEXCOORD3IPROC glad_glMultiTexCoord3i = NULL;
+PFNGLMULTITEXCOORD3IVPROC glad_glMultiTexCoord3iv = NULL;
+PFNGLMULTITEXCOORD3SPROC glad_glMultiTexCoord3s = NULL;
+PFNGLMULTITEXCOORD3SVPROC glad_glMultiTexCoord3sv = NULL;
+PFNGLMULTITEXCOORD4DPROC glad_glMultiTexCoord4d = NULL;
+PFNGLMULTITEXCOORD4DVPROC glad_glMultiTexCoord4dv = NULL;
+PFNGLMULTITEXCOORD4FPROC glad_glMultiTexCoord4f = NULL;
+PFNGLMULTITEXCOORD4FVPROC glad_glMultiTexCoord4fv = NULL;
+PFNGLMULTITEXCOORD4IPROC glad_glMultiTexCoord4i = NULL;
+PFNGLMULTITEXCOORD4IVPROC glad_glMultiTexCoord4iv = NULL;
+PFNGLMULTITEXCOORD4SPROC glad_glMultiTexCoord4s = NULL;
+PFNGLMULTITEXCOORD4SVPROC glad_glMultiTexCoord4sv = NULL;
+PFNGLMULTITEXCOORDP1UIPROC glad_glMultiTexCoordP1ui = NULL;
+PFNGLMULTITEXCOORDP1UIVPROC glad_glMultiTexCoordP1uiv = NULL;
+PFNGLMULTITEXCOORDP2UIPROC glad_glMultiTexCoordP2ui = NULL;
+PFNGLMULTITEXCOORDP2UIVPROC glad_glMultiTexCoordP2uiv = NULL;
+PFNGLMULTITEXCOORDP3UIPROC glad_glMultiTexCoordP3ui = NULL;
+PFNGLMULTITEXCOORDP3UIVPROC glad_glMultiTexCoordP3uiv = NULL;
+PFNGLMULTITEXCOORDP4UIPROC glad_glMultiTexCoordP4ui = NULL;
+PFNGLMULTITEXCOORDP4UIVPROC glad_glMultiTexCoordP4uiv = NULL;
+PFNGLNEWLISTPROC glad_glNewList = NULL;
+PFNGLNORMAL3BPROC glad_glNormal3b = NULL;
+PFNGLNORMAL3BVPROC glad_glNormal3bv = NULL;
+PFNGLNORMAL3DPROC glad_glNormal3d = NULL;
+PFNGLNORMAL3DVPROC glad_glNormal3dv = NULL;
+PFNGLNORMAL3FPROC glad_glNormal3f = NULL;
+PFNGLNORMAL3FVPROC glad_glNormal3fv = NULL;
+PFNGLNORMAL3IPROC glad_glNormal3i = NULL;
+PFNGLNORMAL3IVPROC glad_glNormal3iv = NULL;
+PFNGLNORMAL3SPROC glad_glNormal3s = NULL;
+PFNGLNORMAL3SVPROC glad_glNormal3sv = NULL;
+PFNGLNORMALP3UIPROC glad_glNormalP3ui = NULL;
+PFNGLNORMALP3UIVPROC glad_glNormalP3uiv = NULL;
+PFNGLNORMALPOINTERPROC glad_glNormalPointer = NULL;
+PFNGLOBJECTLABELPROC glad_glObjectLabel = NULL;
+PFNGLOBJECTPTRLABELPROC glad_glObjectPtrLabel = NULL;
+PFNGLORTHOPROC glad_glOrtho = NULL;
+PFNGLPASSTHROUGHPROC glad_glPassThrough = NULL;
+PFNGLPIXELMAPFVPROC glad_glPixelMapfv = NULL;
+PFNGLPIXELMAPUIVPROC glad_glPixelMapuiv = NULL;
+PFNGLPIXELMAPUSVPROC glad_glPixelMapusv = NULL;
+PFNGLPIXELSTOREFPROC glad_glPixelStoref = NULL;
+PFNGLPIXELSTOREIPROC glad_glPixelStorei = NULL;
+PFNGLPIXELTRANSFERFPROC glad_glPixelTransferf = NULL;
+PFNGLPIXELTRANSFERIPROC glad_glPixelTransferi = NULL;
+PFNGLPIXELZOOMPROC glad_glPixelZoom = NULL;
+PFNGLPOINTPARAMETERFPROC glad_glPointParameterf = NULL;
+PFNGLPOINTPARAMETERFVPROC glad_glPointParameterfv = NULL;
+PFNGLPOINTPARAMETERIPROC glad_glPointParameteri = NULL;
+PFNGLPOINTPARAMETERIVPROC glad_glPointParameteriv = NULL;
+PFNGLPOINTSIZEPROC glad_glPointSize = NULL;
+PFNGLPOLYGONMODEPROC glad_glPolygonMode = NULL;
+PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset = NULL;
+PFNGLPOLYGONSTIPPLEPROC glad_glPolygonStipple = NULL;
+PFNGLPOPATTRIBPROC glad_glPopAttrib = NULL;
+PFNGLPOPCLIENTATTRIBPROC glad_glPopClientAttrib = NULL;
+PFNGLPOPDEBUGGROUPPROC glad_glPopDebugGroup = NULL;
+PFNGLPOPMATRIXPROC glad_glPopMatrix = NULL;
+PFNGLPOPNAMEPROC glad_glPopName = NULL;
+PFNGLPRIMITIVERESTARTINDEXPROC glad_glPrimitiveRestartIndex = NULL;
+PFNGLPRIORITIZETEXTURESPROC glad_glPrioritizeTextures = NULL;
+PFNGLPROVOKINGVERTEXPROC glad_glProvokingVertex = NULL;
+PFNGLPUSHATTRIBPROC glad_glPushAttrib = NULL;
+PFNGLPUSHCLIENTATTRIBPROC glad_glPushClientAttrib = NULL;
+PFNGLPUSHDEBUGGROUPPROC glad_glPushDebugGroup = NULL;
+PFNGLPUSHMATRIXPROC glad_glPushMatrix = NULL;
+PFNGLPUSHNAMEPROC glad_glPushName = NULL;
+PFNGLQUERYCOUNTERPROC glad_glQueryCounter = NULL;
+PFNGLRASTERPOS2DPROC glad_glRasterPos2d = NULL;
+PFNGLRASTERPOS2DVPROC glad_glRasterPos2dv = NULL;
+PFNGLRASTERPOS2FPROC glad_glRasterPos2f = NULL;
+PFNGLRASTERPOS2FVPROC glad_glRasterPos2fv = NULL;
+PFNGLRASTERPOS2IPROC glad_glRasterPos2i = NULL;
+PFNGLRASTERPOS2IVPROC glad_glRasterPos2iv = NULL;
+PFNGLRASTERPOS2SPROC glad_glRasterPos2s = NULL;
+PFNGLRASTERPOS2SVPROC glad_glRasterPos2sv = NULL;
+PFNGLRASTERPOS3DPROC glad_glRasterPos3d = NULL;
+PFNGLRASTERPOS3DVPROC glad_glRasterPos3dv = NULL;
+PFNGLRASTERPOS3FPROC glad_glRasterPos3f = NULL;
+PFNGLRASTERPOS3FVPROC glad_glRasterPos3fv = NULL;
+PFNGLRASTERPOS3IPROC glad_glRasterPos3i = NULL;
+PFNGLRASTERPOS3IVPROC glad_glRasterPos3iv = NULL;
+PFNGLRASTERPOS3SPROC glad_glRasterPos3s = NULL;
+PFNGLRASTERPOS3SVPROC glad_glRasterPos3sv = NULL;
+PFNGLRASTERPOS4DPROC glad_glRasterPos4d = NULL;
+PFNGLRASTERPOS4DVPROC glad_glRasterPos4dv = NULL;
+PFNGLRASTERPOS4FPROC glad_glRasterPos4f = NULL;
+PFNGLRASTERPOS4FVPROC glad_glRasterPos4fv = NULL;
+PFNGLRASTERPOS4IPROC glad_glRasterPos4i = NULL;
+PFNGLRASTERPOS4IVPROC glad_glRasterPos4iv = NULL;
+PFNGLRASTERPOS4SPROC glad_glRasterPos4s = NULL;
+PFNGLRASTERPOS4SVPROC glad_glRasterPos4sv = NULL;
+PFNGLREADBUFFERPROC glad_glReadBuffer = NULL;
+PFNGLREADPIXELSPROC glad_glReadPixels = NULL;
+PFNGLREADNPIXELSARBPROC glad_glReadnPixelsARB = NULL;
+PFNGLRECTDPROC glad_glRectd = NULL;
+PFNGLRECTDVPROC glad_glRectdv = NULL;
+PFNGLRECTFPROC glad_glRectf = NULL;
+PFNGLRECTFVPROC glad_glRectfv = NULL;
+PFNGLRECTIPROC glad_glRecti = NULL;
+PFNGLRECTIVPROC glad_glRectiv = NULL;
+PFNGLRECTSPROC glad_glRects = NULL;
+PFNGLRECTSVPROC glad_glRectsv = NULL;
+PFNGLRENDERMODEPROC glad_glRenderMode = NULL;
+PFNGLRENDERBUFFERSTORAGEPROC glad_glRenderbufferStorage = NULL;
+PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC glad_glRenderbufferStorageMultisample = NULL;
+PFNGLROTATEDPROC glad_glRotated = NULL;
+PFNGLROTATEFPROC glad_glRotatef = NULL;
+PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage = NULL;
+PFNGLSAMPLECOVERAGEARBPROC glad_glSampleCoverageARB = NULL;
+PFNGLSAMPLEMASKIPROC glad_glSampleMaski = NULL;
+PFNGLSAMPLERPARAMETERIIVPROC glad_glSamplerParameterIiv = NULL;
+PFNGLSAMPLERPARAMETERIUIVPROC glad_glSamplerParameterIuiv = NULL;
+PFNGLSAMPLERPARAMETERFPROC glad_glSamplerParameterf = NULL;
+PFNGLSAMPLERPARAMETERFVPROC glad_glSamplerParameterfv = NULL;
+PFNGLSAMPLERPARAMETERIPROC glad_glSamplerParameteri = NULL;
+PFNGLSAMPLERPARAMETERIVPROC glad_glSamplerParameteriv = NULL;
+PFNGLSCALEDPROC glad_glScaled = NULL;
+PFNGLSCALEFPROC glad_glScalef = NULL;
+PFNGLSCISSORPROC glad_glScissor = NULL;
+PFNGLSECONDARYCOLOR3BPROC glad_glSecondaryColor3b = NULL;
+PFNGLSECONDARYCOLOR3BVPROC glad_glSecondaryColor3bv = NULL;
+PFNGLSECONDARYCOLOR3DPROC glad_glSecondaryColor3d = NULL;
+PFNGLSECONDARYCOLOR3DVPROC glad_glSecondaryColor3dv = NULL;
+PFNGLSECONDARYCOLOR3FPROC glad_glSecondaryColor3f = NULL;
+PFNGLSECONDARYCOLOR3FVPROC glad_glSecondaryColor3fv = NULL;
+PFNGLSECONDARYCOLOR3IPROC glad_glSecondaryColor3i = NULL;
+PFNGLSECONDARYCOLOR3IVPROC glad_glSecondaryColor3iv = NULL;
+PFNGLSECONDARYCOLOR3SPROC glad_glSecondaryColor3s = NULL;
+PFNGLSECONDARYCOLOR3SVPROC glad_glSecondaryColor3sv = NULL;
+PFNGLSECONDARYCOLOR3UBPROC glad_glSecondaryColor3ub = NULL;
+PFNGLSECONDARYCOLOR3UBVPROC glad_glSecondaryColor3ubv = NULL;
+PFNGLSECONDARYCOLOR3UIPROC glad_glSecondaryColor3ui = NULL;
+PFNGLSECONDARYCOLOR3UIVPROC glad_glSecondaryColor3uiv = NULL;
+PFNGLSECONDARYCOLOR3USPROC glad_glSecondaryColor3us = NULL;
+PFNGLSECONDARYCOLOR3USVPROC glad_glSecondaryColor3usv = NULL;
+PFNGLSECONDARYCOLORP3UIPROC glad_glSecondaryColorP3ui = NULL;
+PFNGLSECONDARYCOLORP3UIVPROC glad_glSecondaryColorP3uiv = NULL;
+PFNGLSECONDARYCOLORPOINTERPROC glad_glSecondaryColorPointer = NULL;
+PFNGLSELECTBUFFERPROC glad_glSelectBuffer = NULL;
+PFNGLSHADEMODELPROC glad_glShadeModel = NULL;
+PFNGLSHADERSOURCEPROC glad_glShaderSource = NULL;
+PFNGLSTENCILFUNCPROC glad_glStencilFunc = NULL;
+PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate = NULL;
+PFNGLSTENCILMASKPROC glad_glStencilMask = NULL;
+PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate = NULL;
+PFNGLSTENCILOPPROC glad_glStencilOp = NULL;
+PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate = NULL;
+PFNGLTEXBUFFERPROC glad_glTexBuffer = NULL;
+PFNGLTEXCOORD1DPROC glad_glTexCoord1d = NULL;
+PFNGLTEXCOORD1DVPROC glad_glTexCoord1dv = NULL;
+PFNGLTEXCOORD1FPROC glad_glTexCoord1f = NULL;
+PFNGLTEXCOORD1FVPROC glad_glTexCoord1fv = NULL;
+PFNGLTEXCOORD1IPROC glad_glTexCoord1i = NULL;
+PFNGLTEXCOORD1IVPROC glad_glTexCoord1iv = NULL;
+PFNGLTEXCOORD1SPROC glad_glTexCoord1s = NULL;
+PFNGLTEXCOORD1SVPROC glad_glTexCoord1sv = NULL;
+PFNGLTEXCOORD2DPROC glad_glTexCoord2d = NULL;
+PFNGLTEXCOORD2DVPROC glad_glTexCoord2dv = NULL;
+PFNGLTEXCOORD2FPROC glad_glTexCoord2f = NULL;
+PFNGLTEXCOORD2FVPROC glad_glTexCoord2fv = NULL;
+PFNGLTEXCOORD2IPROC glad_glTexCoord2i = NULL;
+PFNGLTEXCOORD2IVPROC glad_glTexCoord2iv = NULL;
+PFNGLTEXCOORD2SPROC glad_glTexCoord2s = NULL;
+PFNGLTEXCOORD2SVPROC glad_glTexCoord2sv = NULL;
+PFNGLTEXCOORD3DPROC glad_glTexCoord3d = NULL;
+PFNGLTEXCOORD3DVPROC glad_glTexCoord3dv = NULL;
+PFNGLTEXCOORD3FPROC glad_glTexCoord3f = NULL;
+PFNGLTEXCOORD3FVPROC glad_glTexCoord3fv = NULL;
+PFNGLTEXCOORD3IPROC glad_glTexCoord3i = NULL;
+PFNGLTEXCOORD3IVPROC glad_glTexCoord3iv = NULL;
+PFNGLTEXCOORD3SPROC glad_glTexCoord3s = NULL;
+PFNGLTEXCOORD3SVPROC glad_glTexCoord3sv = NULL;
+PFNGLTEXCOORD4DPROC glad_glTexCoord4d = NULL;
+PFNGLTEXCOORD4DVPROC glad_glTexCoord4dv = NULL;
+PFNGLTEXCOORD4FPROC glad_glTexCoord4f = NULL;
+PFNGLTEXCOORD4FVPROC glad_glTexCoord4fv = NULL;
+PFNGLTEXCOORD4IPROC glad_glTexCoord4i = NULL;
+PFNGLTEXCOORD4IVPROC glad_glTexCoord4iv = NULL;
+PFNGLTEXCOORD4SPROC glad_glTexCoord4s = NULL;
+PFNGLTEXCOORD4SVPROC glad_glTexCoord4sv = NULL;
+PFNGLTEXCOORDP1UIPROC glad_glTexCoordP1ui = NULL;
+PFNGLTEXCOORDP1UIVPROC glad_glTexCoordP1uiv = NULL;
+PFNGLTEXCOORDP2UIPROC glad_glTexCoordP2ui = NULL;
+PFNGLTEXCOORDP2UIVPROC glad_glTexCoordP2uiv = NULL;
+PFNGLTEXCOORDP3UIPROC glad_glTexCoordP3ui = NULL;
+PFNGLTEXCOORDP3UIVPROC glad_glTexCoordP3uiv = NULL;
+PFNGLTEXCOORDP4UIPROC glad_glTexCoordP4ui = NULL;
+PFNGLTEXCOORDP4UIVPROC glad_glTexCoordP4uiv = NULL;
+PFNGLTEXCOORDPOINTERPROC glad_glTexCoordPointer = NULL;
+PFNGLTEXENVFPROC glad_glTexEnvf = NULL;
+PFNGLTEXENVFVPROC glad_glTexEnvfv = NULL;
+PFNGLTEXENVIPROC glad_glTexEnvi = NULL;
+PFNGLTEXENVIVPROC glad_glTexEnviv = NULL;
+PFNGLTEXGENDPROC glad_glTexGend = NULL;
+PFNGLTEXGENDVPROC glad_glTexGendv = NULL;
+PFNGLTEXGENFPROC glad_glTexGenf = NULL;
+PFNGLTEXGENFVPROC glad_glTexGenfv = NULL;
+PFNGLTEXGENIPROC glad_glTexGeni = NULL;
+PFNGLTEXGENIVPROC glad_glTexGeniv = NULL;
+PFNGLTEXIMAGE1DPROC glad_glTexImage1D = NULL;
+PFNGLTEXIMAGE2DPROC glad_glTexImage2D = NULL;
+PFNGLTEXIMAGE2DMULTISAMPLEPROC glad_glTexImage2DMultisample = NULL;
+PFNGLTEXIMAGE3DPROC glad_glTexImage3D = NULL;
+PFNGLTEXIMAGE3DMULTISAMPLEPROC glad_glTexImage3DMultisample = NULL;
+PFNGLTEXPARAMETERIIVPROC glad_glTexParameterIiv = NULL;
+PFNGLTEXPARAMETERIUIVPROC glad_glTexParameterIuiv = NULL;
+PFNGLTEXPARAMETERFPROC glad_glTexParameterf = NULL;
+PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv = NULL;
+PFNGLTEXPARAMETERIPROC glad_glTexParameteri = NULL;
+PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv = NULL;
+PFNGLTEXSUBIMAGE1DPROC glad_glTexSubImage1D = NULL;
+PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D = NULL;
+PFNGLTEXSUBIMAGE3DPROC glad_glTexSubImage3D = NULL;
+PFNGLTRANSFORMFEEDBACKVARYINGSPROC glad_glTransformFeedbackVaryings = NULL;
+PFNGLTRANSLATEDPROC glad_glTranslated = NULL;
+PFNGLTRANSLATEFPROC glad_glTranslatef = NULL;
+PFNGLUNIFORM1FPROC glad_glUniform1f = NULL;
+PFNGLUNIFORM1FVPROC glad_glUniform1fv = NULL;
+PFNGLUNIFORM1IPROC glad_glUniform1i = NULL;
+PFNGLUNIFORM1IVPROC glad_glUniform1iv = NULL;
+PFNGLUNIFORM1UIPROC glad_glUniform1ui = NULL;
+PFNGLUNIFORM1UIVPROC glad_glUniform1uiv = NULL;
+PFNGLUNIFORM2FPROC glad_glUniform2f = NULL;
+PFNGLUNIFORM2FVPROC glad_glUniform2fv = NULL;
+PFNGLUNIFORM2IPROC glad_glUniform2i = NULL;
+PFNGLUNIFORM2IVPROC glad_glUniform2iv = NULL;
+PFNGLUNIFORM2UIPROC glad_glUniform2ui = NULL;
+PFNGLUNIFORM2UIVPROC glad_glUniform2uiv = NULL;
+PFNGLUNIFORM3FPROC glad_glUniform3f = NULL;
+PFNGLUNIFORM3FVPROC glad_glUniform3fv = NULL;
+PFNGLUNIFORM3IPROC glad_glUniform3i = NULL;
+PFNGLUNIFORM3IVPROC glad_glUniform3iv = NULL;
+PFNGLUNIFORM3UIPROC glad_glUniform3ui = NULL;
+PFNGLUNIFORM3UIVPROC glad_glUniform3uiv = NULL;
+PFNGLUNIFORM4FPROC glad_glUniform4f = NULL;
+PFNGLUNIFORM4FVPROC glad_glUniform4fv = NULL;
+PFNGLUNIFORM4IPROC glad_glUniform4i = NULL;
+PFNGLUNIFORM4IVPROC glad_glUniform4iv = NULL;
+PFNGLUNIFORM4UIPROC glad_glUniform4ui = NULL;
+PFNGLUNIFORM4UIVPROC glad_glUniform4uiv = NULL;
+PFNGLUNIFORMBLOCKBINDINGPROC glad_glUniformBlockBinding = NULL;
+PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv = NULL;
+PFNGLUNIFORMMATRIX2X3FVPROC glad_glUniformMatrix2x3fv = NULL;
+PFNGLUNIFORMMATRIX2X4FVPROC glad_glUniformMatrix2x4fv = NULL;
+PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv = NULL;
+PFNGLUNIFORMMATRIX3X2FVPROC glad_glUniformMatrix3x2fv = NULL;
+PFNGLUNIFORMMATRIX3X4FVPROC glad_glUniformMatrix3x4fv = NULL;
+PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv = NULL;
+PFNGLUNIFORMMATRIX4X2FVPROC glad_glUniformMatrix4x2fv = NULL;
+PFNGLUNIFORMMATRIX4X3FVPROC glad_glUniformMatrix4x3fv = NULL;
+PFNGLUNMAPBUFFERPROC glad_glUnmapBuffer = NULL;
+PFNGLUSEPROGRAMPROC glad_glUseProgram = NULL;
+PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram = NULL;
+PFNGLVERTEX2DPROC glad_glVertex2d = NULL;
+PFNGLVERTEX2DVPROC glad_glVertex2dv = NULL;
+PFNGLVERTEX2FPROC glad_glVertex2f = NULL;
+PFNGLVERTEX2FVPROC glad_glVertex2fv = NULL;
+PFNGLVERTEX2IPROC glad_glVertex2i = NULL;
+PFNGLVERTEX2IVPROC glad_glVertex2iv = NULL;
+PFNGLVERTEX2SPROC glad_glVertex2s = NULL;
+PFNGLVERTEX2SVPROC glad_glVertex2sv = NULL;
+PFNGLVERTEX3DPROC glad_glVertex3d = NULL;
+PFNGLVERTEX3DVPROC glad_glVertex3dv = NULL;
+PFNGLVERTEX3FPROC glad_glVertex3f = NULL;
+PFNGLVERTEX3FVPROC glad_glVertex3fv = NULL;
+PFNGLVERTEX3IPROC glad_glVertex3i = NULL;
+PFNGLVERTEX3IVPROC glad_glVertex3iv = NULL;
+PFNGLVERTEX3SPROC glad_glVertex3s = NULL;
+PFNGLVERTEX3SVPROC glad_glVertex3sv = NULL;
+PFNGLVERTEX4DPROC glad_glVertex4d = NULL;
+PFNGLVERTEX4DVPROC glad_glVertex4dv = NULL;
+PFNGLVERTEX4FPROC glad_glVertex4f = NULL;
+PFNGLVERTEX4FVPROC glad_glVertex4fv = NULL;
+PFNGLVERTEX4IPROC glad_glVertex4i = NULL;
+PFNGLVERTEX4IVPROC glad_glVertex4iv = NULL;
+PFNGLVERTEX4SPROC glad_glVertex4s = NULL;
+PFNGLVERTEX4SVPROC glad_glVertex4sv = NULL;
+PFNGLVERTEXATTRIB1DPROC glad_glVertexAttrib1d = NULL;
+PFNGLVERTEXATTRIB1DVPROC glad_glVertexAttrib1dv = NULL;
+PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f = NULL;
+PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv = NULL;
+PFNGLVERTEXATTRIB1SPROC glad_glVertexAttrib1s = NULL;
+PFNGLVERTEXATTRIB1SVPROC glad_glVertexAttrib1sv = NULL;
+PFNGLVERTEXATTRIB2DPROC glad_glVertexAttrib2d = NULL;
+PFNGLVERTEXATTRIB2DVPROC glad_glVertexAttrib2dv = NULL;
+PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f = NULL;
+PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv = NULL;
+PFNGLVERTEXATTRIB2SPROC glad_glVertexAttrib2s = NULL;
+PFNGLVERTEXATTRIB2SVPROC glad_glVertexAttrib2sv = NULL;
+PFNGLVERTEXATTRIB3DPROC glad_glVertexAttrib3d = NULL;
+PFNGLVERTEXATTRIB3DVPROC glad_glVertexAttrib3dv = NULL;
+PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f = NULL;
+PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv = NULL;
+PFNGLVERTEXATTRIB3SPROC glad_glVertexAttrib3s = NULL;
+PFNGLVERTEXATTRIB3SVPROC glad_glVertexAttrib3sv = NULL;
+PFNGLVERTEXATTRIB4NBVPROC glad_glVertexAttrib4Nbv = NULL;
+PFNGLVERTEXATTRIB4NIVPROC glad_glVertexAttrib4Niv = NULL;
+PFNGLVERTEXATTRIB4NSVPROC glad_glVertexAttrib4Nsv = NULL;
+PFNGLVERTEXATTRIB4NUBPROC glad_glVertexAttrib4Nub = NULL;
+PFNGLVERTEXATTRIB4NUBVPROC glad_glVertexAttrib4Nubv = NULL;
+PFNGLVERTEXATTRIB4NUIVPROC glad_glVertexAttrib4Nuiv = NULL;
+PFNGLVERTEXATTRIB4NUSVPROC glad_glVertexAttrib4Nusv = NULL;
+PFNGLVERTEXATTRIB4BVPROC glad_glVertexAttrib4bv = NULL;
+PFNGLVERTEXATTRIB4DPROC glad_glVertexAttrib4d = NULL;
+PFNGLVERTEXATTRIB4DVPROC glad_glVertexAttrib4dv = NULL;
+PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f = NULL;
+PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv = NULL;
+PFNGLVERTEXATTRIB4IVPROC glad_glVertexAttrib4iv = NULL;
+PFNGLVERTEXATTRIB4SPROC glad_glVertexAttrib4s = NULL;
+PFNGLVERTEXATTRIB4SVPROC glad_glVertexAttrib4sv = NULL;
+PFNGLVERTEXATTRIB4UBVPROC glad_glVertexAttrib4ubv = NULL;
+PFNGLVERTEXATTRIB4UIVPROC glad_glVertexAttrib4uiv = NULL;
+PFNGLVERTEXATTRIB4USVPROC glad_glVertexAttrib4usv = NULL;
+PFNGLVERTEXATTRIBDIVISORPROC glad_glVertexAttribDivisor = NULL;
+PFNGLVERTEXATTRIBI1IPROC glad_glVertexAttribI1i = NULL;
+PFNGLVERTEXATTRIBI1IVPROC glad_glVertexAttribI1iv = NULL;
+PFNGLVERTEXATTRIBI1UIPROC glad_glVertexAttribI1ui = NULL;
+PFNGLVERTEXATTRIBI1UIVPROC glad_glVertexAttribI1uiv = NULL;
+PFNGLVERTEXATTRIBI2IPROC glad_glVertexAttribI2i = NULL;
+PFNGLVERTEXATTRIBI2IVPROC glad_glVertexAttribI2iv = NULL;
+PFNGLVERTEXATTRIBI2UIPROC glad_glVertexAttribI2ui = NULL;
+PFNGLVERTEXATTRIBI2UIVPROC glad_glVertexAttribI2uiv = NULL;
+PFNGLVERTEXATTRIBI3IPROC glad_glVertexAttribI3i = NULL;
+PFNGLVERTEXATTRIBI3IVPROC glad_glVertexAttribI3iv = NULL;
+PFNGLVERTEXATTRIBI3UIPROC glad_glVertexAttribI3ui = NULL;
+PFNGLVERTEXATTRIBI3UIVPROC glad_glVertexAttribI3uiv = NULL;
+PFNGLVERTEXATTRIBI4BVPROC glad_glVertexAttribI4bv = NULL;
+PFNGLVERTEXATTRIBI4IPROC glad_glVertexAttribI4i = NULL;
+PFNGLVERTEXATTRIBI4IVPROC glad_glVertexAttribI4iv = NULL;
+PFNGLVERTEXATTRIBI4SVPROC glad_glVertexAttribI4sv = NULL;
+PFNGLVERTEXATTRIBI4UBVPROC glad_glVertexAttribI4ubv = NULL;
+PFNGLVERTEXATTRIBI4UIPROC glad_glVertexAttribI4ui = NULL;
+PFNGLVERTEXATTRIBI4UIVPROC glad_glVertexAttribI4uiv = NULL;
+PFNGLVERTEXATTRIBI4USVPROC glad_glVertexAttribI4usv = NULL;
+PFNGLVERTEXATTRIBIPOINTERPROC glad_glVertexAttribIPointer = NULL;
+PFNGLVERTEXATTRIBP1UIPROC glad_glVertexAttribP1ui = NULL;
+PFNGLVERTEXATTRIBP1UIVPROC glad_glVertexAttribP1uiv = NULL;
+PFNGLVERTEXATTRIBP2UIPROC glad_glVertexAttribP2ui = NULL;
+PFNGLVERTEXATTRIBP2UIVPROC glad_glVertexAttribP2uiv = NULL;
+PFNGLVERTEXATTRIBP3UIPROC glad_glVertexAttribP3ui = NULL;
+PFNGLVERTEXATTRIBP3UIVPROC glad_glVertexAttribP3uiv = NULL;
+PFNGLVERTEXATTRIBP4UIPROC glad_glVertexAttribP4ui = NULL;
+PFNGLVERTEXATTRIBP4UIVPROC glad_glVertexAttribP4uiv = NULL;
+PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer = NULL;
+PFNGLVERTEXP2UIPROC glad_glVertexP2ui = NULL;
+PFNGLVERTEXP2UIVPROC glad_glVertexP2uiv = NULL;
+PFNGLVERTEXP3UIPROC glad_glVertexP3ui = NULL;
+PFNGLVERTEXP3UIVPROC glad_glVertexP3uiv = NULL;
+PFNGLVERTEXP4UIPROC glad_glVertexP4ui = NULL;
+PFNGLVERTEXP4UIVPROC glad_glVertexP4uiv = NULL;
+PFNGLVERTEXPOINTERPROC glad_glVertexPointer = NULL;
+PFNGLVIEWPORTPROC glad_glViewport = NULL;
+PFNGLWAITSYNCPROC glad_glWaitSync = NULL;
+PFNGLWINDOWPOS2DPROC glad_glWindowPos2d = NULL;
+PFNGLWINDOWPOS2DVPROC glad_glWindowPos2dv = NULL;
+PFNGLWINDOWPOS2FPROC glad_glWindowPos2f = NULL;
+PFNGLWINDOWPOS2FVPROC glad_glWindowPos2fv = NULL;
+PFNGLWINDOWPOS2IPROC glad_glWindowPos2i = NULL;
+PFNGLWINDOWPOS2IVPROC glad_glWindowPos2iv = NULL;
+PFNGLWINDOWPOS2SPROC glad_glWindowPos2s = NULL;
+PFNGLWINDOWPOS2SVPROC glad_glWindowPos2sv = NULL;
+PFNGLWINDOWPOS3DPROC glad_glWindowPos3d = NULL;
+PFNGLWINDOWPOS3DVPROC glad_glWindowPos3dv = NULL;
+PFNGLWINDOWPOS3FPROC glad_glWindowPos3f = NULL;
+PFNGLWINDOWPOS3FVPROC glad_glWindowPos3fv = NULL;
+PFNGLWINDOWPOS3IPROC glad_glWindowPos3i = NULL;
+PFNGLWINDOWPOS3IVPROC glad_glWindowPos3iv = NULL;
+PFNGLWINDOWPOS3SPROC glad_glWindowPos3s = NULL;
+PFNGLWINDOWPOS3SVPROC glad_glWindowPos3sv = NULL;
+
+
+static void glad_gl_load_GL_VERSION_1_0( GLADuserptrloadfunc load, void* userptr) {
+ if(!GLAD_GL_VERSION_1_0) return;
+ glad_glAccum = (PFNGLACCUMPROC) load(userptr, "glAccum");
+ glad_glAlphaFunc = (PFNGLALPHAFUNCPROC) load(userptr, "glAlphaFunc");
+ glad_glBegin = (PFNGLBEGINPROC) load(userptr, "glBegin");
+ glad_glBitmap = (PFNGLBITMAPPROC) load(userptr, "glBitmap");
+ glad_glBlendFunc = (PFNGLBLENDFUNCPROC) load(userptr, "glBlendFunc");
+ glad_glCallList = (PFNGLCALLLISTPROC) load(userptr, "glCallList");
+ glad_glCallLists = (PFNGLCALLLISTSPROC) load(userptr, "glCallLists");
+ glad_glClear = (PFNGLCLEARPROC) load(userptr, "glClear");
+ glad_glClearAccum = (PFNGLCLEARACCUMPROC) load(userptr, "glClearAccum");
+ glad_glClearColor = (PFNGLCLEARCOLORPROC) load(userptr, "glClearColor");
+ glad_glClearDepth = (PFNGLCLEARDEPTHPROC) load(userptr, "glClearDepth");
+ glad_glClearIndex = (PFNGLCLEARINDEXPROC) load(userptr, "glClearIndex");
+ glad_glClearStencil = (PFNGLCLEARSTENCILPROC) load(userptr, "glClearStencil");
+ glad_glClipPlane = (PFNGLCLIPPLANEPROC) load(userptr, "glClipPlane");
+ glad_glColor3b = (PFNGLCOLOR3BPROC) load(userptr, "glColor3b");
+ glad_glColor3bv = (PFNGLCOLOR3BVPROC) load(userptr, "glColor3bv");
+ glad_glColor3d = (PFNGLCOLOR3DPROC) load(userptr, "glColor3d");
+ glad_glColor3dv = (PFNGLCOLOR3DVPROC) load(userptr, "glColor3dv");
+ glad_glColor3f = (PFNGLCOLOR3FPROC) load(userptr, "glColor3f");
+ glad_glColor3fv = (PFNGLCOLOR3FVPROC) load(userptr, "glColor3fv");
+ glad_glColor3i = (PFNGLCOLOR3IPROC) load(userptr, "glColor3i");
+ glad_glColor3iv = (PFNGLCOLOR3IVPROC) load(userptr, "glColor3iv");
+ glad_glColor3s = (PFNGLCOLOR3SPROC) load(userptr, "glColor3s");
+ glad_glColor3sv = (PFNGLCOLOR3SVPROC) load(userptr, "glColor3sv");
+ glad_glColor3ub = (PFNGLCOLOR3UBPROC) load(userptr, "glColor3ub");
+ glad_glColor3ubv = (PFNGLCOLOR3UBVPROC) load(userptr, "glColor3ubv");
+ glad_glColor3ui = (PFNGLCOLOR3UIPROC) load(userptr, "glColor3ui");
+ glad_glColor3uiv = (PFNGLCOLOR3UIVPROC) load(userptr, "glColor3uiv");
+ glad_glColor3us = (PFNGLCOLOR3USPROC) load(userptr, "glColor3us");
+ glad_glColor3usv = (PFNGLCOLOR3USVPROC) load(userptr, "glColor3usv");
+ glad_glColor4b = (PFNGLCOLOR4BPROC) load(userptr, "glColor4b");
+ glad_glColor4bv = (PFNGLCOLOR4BVPROC) load(userptr, "glColor4bv");
+ glad_glColor4d = (PFNGLCOLOR4DPROC) load(userptr, "glColor4d");
+ glad_glColor4dv = (PFNGLCOLOR4DVPROC) load(userptr, "glColor4dv");
+ glad_glColor4f = (PFNGLCOLOR4FPROC) load(userptr, "glColor4f");
+ glad_glColor4fv = (PFNGLCOLOR4FVPROC) load(userptr, "glColor4fv");
+ glad_glColor4i = (PFNGLCOLOR4IPROC) load(userptr, "glColor4i");
+ glad_glColor4iv = (PFNGLCOLOR4IVPROC) load(userptr, "glColor4iv");
+ glad_glColor4s = (PFNGLCOLOR4SPROC) load(userptr, "glColor4s");
+ glad_glColor4sv = (PFNGLCOLOR4SVPROC) load(userptr, "glColor4sv");
+ glad_glColor4ub = (PFNGLCOLOR4UBPROC) load(userptr, "glColor4ub");
+ glad_glColor4ubv = (PFNGLCOLOR4UBVPROC) load(userptr, "glColor4ubv");
+ glad_glColor4ui = (PFNGLCOLOR4UIPROC) load(userptr, "glColor4ui");
+ glad_glColor4uiv = (PFNGLCOLOR4UIVPROC) load(userptr, "glColor4uiv");
+ glad_glColor4us = (PFNGLCOLOR4USPROC) load(userptr, "glColor4us");
+ glad_glColor4usv = (PFNGLCOLOR4USVPROC) load(userptr, "glColor4usv");
+ glad_glColorMask = (PFNGLCOLORMASKPROC) load(userptr, "glColorMask");
+ glad_glColorMaterial = (PFNGLCOLORMATERIALPROC) load(userptr, "glColorMaterial");
+ glad_glCopyPixels = (PFNGLCOPYPIXELSPROC) load(userptr, "glCopyPixels");
+ glad_glCullFace = (PFNGLCULLFACEPROC) load(userptr, "glCullFace");
+ glad_glDeleteLists = (PFNGLDELETELISTSPROC) load(userptr, "glDeleteLists");
+ glad_glDepthFunc = (PFNGLDEPTHFUNCPROC) load(userptr, "glDepthFunc");
+ glad_glDepthMask = (PFNGLDEPTHMASKPROC) load(userptr, "glDepthMask");
+ glad_glDepthRange = (PFNGLDEPTHRANGEPROC) load(userptr, "glDepthRange");
+ glad_glDisable = (PFNGLDISABLEPROC) load(userptr, "glDisable");
+ glad_glDrawBuffer = (PFNGLDRAWBUFFERPROC) load(userptr, "glDrawBuffer");
+ glad_glDrawPixels = (PFNGLDRAWPIXELSPROC) load(userptr, "glDrawPixels");
+ glad_glEdgeFlag = (PFNGLEDGEFLAGPROC) load(userptr, "glEdgeFlag");
+ glad_glEdgeFlagv = (PFNGLEDGEFLAGVPROC) load(userptr, "glEdgeFlagv");
+ glad_glEnable = (PFNGLENABLEPROC) load(userptr, "glEnable");
+ glad_glEnd = (PFNGLENDPROC) load(userptr, "glEnd");
+ glad_glEndList = (PFNGLENDLISTPROC) load(userptr, "glEndList");
+ glad_glEvalCoord1d = (PFNGLEVALCOORD1DPROC) load(userptr, "glEvalCoord1d");
+ glad_glEvalCoord1dv = (PFNGLEVALCOORD1DVPROC) load(userptr, "glEvalCoord1dv");
+ glad_glEvalCoord1f = (PFNGLEVALCOORD1FPROC) load(userptr, "glEvalCoord1f");
+ glad_glEvalCoord1fv = (PFNGLEVALCOORD1FVPROC) load(userptr, "glEvalCoord1fv");
+ glad_glEvalCoord2d = (PFNGLEVALCOORD2DPROC) load(userptr, "glEvalCoord2d");
+ glad_glEvalCoord2dv = (PFNGLEVALCOORD2DVPROC) load(userptr, "glEvalCoord2dv");
+ glad_glEvalCoord2f = (PFNGLEVALCOORD2FPROC) load(userptr, "glEvalCoord2f");
+ glad_glEvalCoord2fv = (PFNGLEVALCOORD2FVPROC) load(userptr, "glEvalCoord2fv");
+ glad_glEvalMesh1 = (PFNGLEVALMESH1PROC) load(userptr, "glEvalMesh1");
+ glad_glEvalMesh2 = (PFNGLEVALMESH2PROC) load(userptr, "glEvalMesh2");
+ glad_glEvalPoint1 = (PFNGLEVALPOINT1PROC) load(userptr, "glEvalPoint1");
+ glad_glEvalPoint2 = (PFNGLEVALPOINT2PROC) load(userptr, "glEvalPoint2");
+ glad_glFeedbackBuffer = (PFNGLFEEDBACKBUFFERPROC) load(userptr, "glFeedbackBuffer");
+ glad_glFinish = (PFNGLFINISHPROC) load(userptr, "glFinish");
+ glad_glFlush = (PFNGLFLUSHPROC) load(userptr, "glFlush");
+ glad_glFogf = (PFNGLFOGFPROC) load(userptr, "glFogf");
+ glad_glFogfv = (PFNGLFOGFVPROC) load(userptr, "glFogfv");
+ glad_glFogi = (PFNGLFOGIPROC) load(userptr, "glFogi");
+ glad_glFogiv = (PFNGLFOGIVPROC) load(userptr, "glFogiv");
+ glad_glFrontFace = (PFNGLFRONTFACEPROC) load(userptr, "glFrontFace");
+ glad_glFrustum = (PFNGLFRUSTUMPROC) load(userptr, "glFrustum");
+ glad_glGenLists = (PFNGLGENLISTSPROC) load(userptr, "glGenLists");
+ glad_glGetBooleanv = (PFNGLGETBOOLEANVPROC) load(userptr, "glGetBooleanv");
+ glad_glGetClipPlane = (PFNGLGETCLIPPLANEPROC) load(userptr, "glGetClipPlane");
+ glad_glGetDoublev = (PFNGLGETDOUBLEVPROC) load(userptr, "glGetDoublev");
+ glad_glGetError = (PFNGLGETERRORPROC) load(userptr, "glGetError");
+ glad_glGetFloatv = (PFNGLGETFLOATVPROC) load(userptr, "glGetFloatv");
+ glad_glGetIntegerv = (PFNGLGETINTEGERVPROC) load(userptr, "glGetIntegerv");
+ glad_glGetLightfv = (PFNGLGETLIGHTFVPROC) load(userptr, "glGetLightfv");
+ glad_glGetLightiv = (PFNGLGETLIGHTIVPROC) load(userptr, "glGetLightiv");
+ glad_glGetMapdv = (PFNGLGETMAPDVPROC) load(userptr, "glGetMapdv");
+ glad_glGetMapfv = (PFNGLGETMAPFVPROC) load(userptr, "glGetMapfv");
+ glad_glGetMapiv = (PFNGLGETMAPIVPROC) load(userptr, "glGetMapiv");
+ glad_glGetMaterialfv = (PFNGLGETMATERIALFVPROC) load(userptr, "glGetMaterialfv");
+ glad_glGetMaterialiv = (PFNGLGETMATERIALIVPROC) load(userptr, "glGetMaterialiv");
+ glad_glGetPixelMapfv = (PFNGLGETPIXELMAPFVPROC) load(userptr, "glGetPixelMapfv");
+ glad_glGetPixelMapuiv = (PFNGLGETPIXELMAPUIVPROC) load(userptr, "glGetPixelMapuiv");
+ glad_glGetPixelMapusv = (PFNGLGETPIXELMAPUSVPROC) load(userptr, "glGetPixelMapusv");
+ glad_glGetPolygonStipple = (PFNGLGETPOLYGONSTIPPLEPROC) load(userptr, "glGetPolygonStipple");
+ glad_glGetString = (PFNGLGETSTRINGPROC) load(userptr, "glGetString");
+ glad_glGetTexEnvfv = (PFNGLGETTEXENVFVPROC) load(userptr, "glGetTexEnvfv");
+ glad_glGetTexEnviv = (PFNGLGETTEXENVIVPROC) load(userptr, "glGetTexEnviv");
+ glad_glGetTexGendv = (PFNGLGETTEXGENDVPROC) load(userptr, "glGetTexGendv");
+ glad_glGetTexGenfv = (PFNGLGETTEXGENFVPROC) load(userptr, "glGetTexGenfv");
+ glad_glGetTexGeniv = (PFNGLGETTEXGENIVPROC) load(userptr, "glGetTexGeniv");
+ glad_glGetTexImage = (PFNGLGETTEXIMAGEPROC) load(userptr, "glGetTexImage");
+ glad_glGetTexLevelParameterfv = (PFNGLGETTEXLEVELPARAMETERFVPROC) load(userptr, "glGetTexLevelParameterfv");
+ glad_glGetTexLevelParameteriv = (PFNGLGETTEXLEVELPARAMETERIVPROC) load(userptr, "glGetTexLevelParameteriv");
+ glad_glGetTexParameterfv = (PFNGLGETTEXPARAMETERFVPROC) load(userptr, "glGetTexParameterfv");
+ glad_glGetTexParameteriv = (PFNGLGETTEXPARAMETERIVPROC) load(userptr, "glGetTexParameteriv");
+ glad_glHint = (PFNGLHINTPROC) load(userptr, "glHint");
+ glad_glIndexMask = (PFNGLINDEXMASKPROC) load(userptr, "glIndexMask");
+ glad_glIndexd = (PFNGLINDEXDPROC) load(userptr, "glIndexd");
+ glad_glIndexdv = (PFNGLINDEXDVPROC) load(userptr, "glIndexdv");
+ glad_glIndexf = (PFNGLINDEXFPROC) load(userptr, "glIndexf");
+ glad_glIndexfv = (PFNGLINDEXFVPROC) load(userptr, "glIndexfv");
+ glad_glIndexi = (PFNGLINDEXIPROC) load(userptr, "glIndexi");
+ glad_glIndexiv = (PFNGLINDEXIVPROC) load(userptr, "glIndexiv");
+ glad_glIndexs = (PFNGLINDEXSPROC) load(userptr, "glIndexs");
+ glad_glIndexsv = (PFNGLINDEXSVPROC) load(userptr, "glIndexsv");
+ glad_glInitNames = (PFNGLINITNAMESPROC) load(userptr, "glInitNames");
+ glad_glIsEnabled = (PFNGLISENABLEDPROC) load(userptr, "glIsEnabled");
+ glad_glIsList = (PFNGLISLISTPROC) load(userptr, "glIsList");
+ glad_glLightModelf = (PFNGLLIGHTMODELFPROC) load(userptr, "glLightModelf");
+ glad_glLightModelfv = (PFNGLLIGHTMODELFVPROC) load(userptr, "glLightModelfv");
+ glad_glLightModeli = (PFNGLLIGHTMODELIPROC) load(userptr, "glLightModeli");
+ glad_glLightModeliv = (PFNGLLIGHTMODELIVPROC) load(userptr, "glLightModeliv");
+ glad_glLightf = (PFNGLLIGHTFPROC) load(userptr, "glLightf");
+ glad_glLightfv = (PFNGLLIGHTFVPROC) load(userptr, "glLightfv");
+ glad_glLighti = (PFNGLLIGHTIPROC) load(userptr, "glLighti");
+ glad_glLightiv = (PFNGLLIGHTIVPROC) load(userptr, "glLightiv");
+ glad_glLineStipple = (PFNGLLINESTIPPLEPROC) load(userptr, "glLineStipple");
+ glad_glLineWidth = (PFNGLLINEWIDTHPROC) load(userptr, "glLineWidth");
+ glad_glListBase = (PFNGLLISTBASEPROC) load(userptr, "glListBase");
+ glad_glLoadIdentity = (PFNGLLOADIDENTITYPROC) load(userptr, "glLoadIdentity");
+ glad_glLoadMatrixd = (PFNGLLOADMATRIXDPROC) load(userptr, "glLoadMatrixd");
+ glad_glLoadMatrixf = (PFNGLLOADMATRIXFPROC) load(userptr, "glLoadMatrixf");
+ glad_glLoadName = (PFNGLLOADNAMEPROC) load(userptr, "glLoadName");
+ glad_glLogicOp = (PFNGLLOGICOPPROC) load(userptr, "glLogicOp");
+ glad_glMap1d = (PFNGLMAP1DPROC) load(userptr, "glMap1d");
+ glad_glMap1f = (PFNGLMAP1FPROC) load(userptr, "glMap1f");
+ glad_glMap2d = (PFNGLMAP2DPROC) load(userptr, "glMap2d");
+ glad_glMap2f = (PFNGLMAP2FPROC) load(userptr, "glMap2f");
+ glad_glMapGrid1d = (PFNGLMAPGRID1DPROC) load(userptr, "glMapGrid1d");
+ glad_glMapGrid1f = (PFNGLMAPGRID1FPROC) load(userptr, "glMapGrid1f");
+ glad_glMapGrid2d = (PFNGLMAPGRID2DPROC) load(userptr, "glMapGrid2d");
+ glad_glMapGrid2f = (PFNGLMAPGRID2FPROC) load(userptr, "glMapGrid2f");
+ glad_glMaterialf = (PFNGLMATERIALFPROC) load(userptr, "glMaterialf");
+ glad_glMaterialfv = (PFNGLMATERIALFVPROC) load(userptr, "glMaterialfv");
+ glad_glMateriali = (PFNGLMATERIALIPROC) load(userptr, "glMateriali");
+ glad_glMaterialiv = (PFNGLMATERIALIVPROC) load(userptr, "glMaterialiv");
+ glad_glMatrixMode = (PFNGLMATRIXMODEPROC) load(userptr, "glMatrixMode");
+ glad_glMultMatrixd = (PFNGLMULTMATRIXDPROC) load(userptr, "glMultMatrixd");
+ glad_glMultMatrixf = (PFNGLMULTMATRIXFPROC) load(userptr, "glMultMatrixf");
+ glad_glNewList = (PFNGLNEWLISTPROC) load(userptr, "glNewList");
+ glad_glNormal3b = (PFNGLNORMAL3BPROC) load(userptr, "glNormal3b");
+ glad_glNormal3bv = (PFNGLNORMAL3BVPROC) load(userptr, "glNormal3bv");
+ glad_glNormal3d = (PFNGLNORMAL3DPROC) load(userptr, "glNormal3d");
+ glad_glNormal3dv = (PFNGLNORMAL3DVPROC) load(userptr, "glNormal3dv");
+ glad_glNormal3f = (PFNGLNORMAL3FPROC) load(userptr, "glNormal3f");
+ glad_glNormal3fv = (PFNGLNORMAL3FVPROC) load(userptr, "glNormal3fv");
+ glad_glNormal3i = (PFNGLNORMAL3IPROC) load(userptr, "glNormal3i");
+ glad_glNormal3iv = (PFNGLNORMAL3IVPROC) load(userptr, "glNormal3iv");
+ glad_glNormal3s = (PFNGLNORMAL3SPROC) load(userptr, "glNormal3s");
+ glad_glNormal3sv = (PFNGLNORMAL3SVPROC) load(userptr, "glNormal3sv");
+ glad_glOrtho = (PFNGLORTHOPROC) load(userptr, "glOrtho");
+ glad_glPassThrough = (PFNGLPASSTHROUGHPROC) load(userptr, "glPassThrough");
+ glad_glPixelMapfv = (PFNGLPIXELMAPFVPROC) load(userptr, "glPixelMapfv");
+ glad_glPixelMapuiv = (PFNGLPIXELMAPUIVPROC) load(userptr, "glPixelMapuiv");
+ glad_glPixelMapusv = (PFNGLPIXELMAPUSVPROC) load(userptr, "glPixelMapusv");
+ glad_glPixelStoref = (PFNGLPIXELSTOREFPROC) load(userptr, "glPixelStoref");
+ glad_glPixelStorei = (PFNGLPIXELSTOREIPROC) load(userptr, "glPixelStorei");
+ glad_glPixelTransferf = (PFNGLPIXELTRANSFERFPROC) load(userptr, "glPixelTransferf");
+ glad_glPixelTransferi = (PFNGLPIXELTRANSFERIPROC) load(userptr, "glPixelTransferi");
+ glad_glPixelZoom = (PFNGLPIXELZOOMPROC) load(userptr, "glPixelZoom");
+ glad_glPointSize = (PFNGLPOINTSIZEPROC) load(userptr, "glPointSize");
+ glad_glPolygonMode = (PFNGLPOLYGONMODEPROC) load(userptr, "glPolygonMode");
+ glad_glPolygonStipple = (PFNGLPOLYGONSTIPPLEPROC) load(userptr, "glPolygonStipple");
+ glad_glPopAttrib = (PFNGLPOPATTRIBPROC) load(userptr, "glPopAttrib");
+ glad_glPopMatrix = (PFNGLPOPMATRIXPROC) load(userptr, "glPopMatrix");
+ glad_glPopName = (PFNGLPOPNAMEPROC) load(userptr, "glPopName");
+ glad_glPushAttrib = (PFNGLPUSHATTRIBPROC) load(userptr, "glPushAttrib");
+ glad_glPushMatrix = (PFNGLPUSHMATRIXPROC) load(userptr, "glPushMatrix");
+ glad_glPushName = (PFNGLPUSHNAMEPROC) load(userptr, "glPushName");
+ glad_glRasterPos2d = (PFNGLRASTERPOS2DPROC) load(userptr, "glRasterPos2d");
+ glad_glRasterPos2dv = (PFNGLRASTERPOS2DVPROC) load(userptr, "glRasterPos2dv");
+ glad_glRasterPos2f = (PFNGLRASTERPOS2FPROC) load(userptr, "glRasterPos2f");
+ glad_glRasterPos2fv = (PFNGLRASTERPOS2FVPROC) load(userptr, "glRasterPos2fv");
+ glad_glRasterPos2i = (PFNGLRASTERPOS2IPROC) load(userptr, "glRasterPos2i");
+ glad_glRasterPos2iv = (PFNGLRASTERPOS2IVPROC) load(userptr, "glRasterPos2iv");
+ glad_glRasterPos2s = (PFNGLRASTERPOS2SPROC) load(userptr, "glRasterPos2s");
+ glad_glRasterPos2sv = (PFNGLRASTERPOS2SVPROC) load(userptr, "glRasterPos2sv");
+ glad_glRasterPos3d = (PFNGLRASTERPOS3DPROC) load(userptr, "glRasterPos3d");
+ glad_glRasterPos3dv = (PFNGLRASTERPOS3DVPROC) load(userptr, "glRasterPos3dv");
+ glad_glRasterPos3f = (PFNGLRASTERPOS3FPROC) load(userptr, "glRasterPos3f");
+ glad_glRasterPos3fv = (PFNGLRASTERPOS3FVPROC) load(userptr, "glRasterPos3fv");
+ glad_glRasterPos3i = (PFNGLRASTERPOS3IPROC) load(userptr, "glRasterPos3i");
+ glad_glRasterPos3iv = (PFNGLRASTERPOS3IVPROC) load(userptr, "glRasterPos3iv");
+ glad_glRasterPos3s = (PFNGLRASTERPOS3SPROC) load(userptr, "glRasterPos3s");
+ glad_glRasterPos3sv = (PFNGLRASTERPOS3SVPROC) load(userptr, "glRasterPos3sv");
+ glad_glRasterPos4d = (PFNGLRASTERPOS4DPROC) load(userptr, "glRasterPos4d");
+ glad_glRasterPos4dv = (PFNGLRASTERPOS4DVPROC) load(userptr, "glRasterPos4dv");
+ glad_glRasterPos4f = (PFNGLRASTERPOS4FPROC) load(userptr, "glRasterPos4f");
+ glad_glRasterPos4fv = (PFNGLRASTERPOS4FVPROC) load(userptr, "glRasterPos4fv");
+ glad_glRasterPos4i = (PFNGLRASTERPOS4IPROC) load(userptr, "glRasterPos4i");
+ glad_glRasterPos4iv = (PFNGLRASTERPOS4IVPROC) load(userptr, "glRasterPos4iv");
+ glad_glRasterPos4s = (PFNGLRASTERPOS4SPROC) load(userptr, "glRasterPos4s");
+ glad_glRasterPos4sv = (PFNGLRASTERPOS4SVPROC) load(userptr, "glRasterPos4sv");
+ glad_glReadBuffer = (PFNGLREADBUFFERPROC) load(userptr, "glReadBuffer");
+ glad_glReadPixels = (PFNGLREADPIXELSPROC) load(userptr, "glReadPixels");
+ glad_glRectd = (PFNGLRECTDPROC) load(userptr, "glRectd");
+ glad_glRectdv = (PFNGLRECTDVPROC) load(userptr, "glRectdv");
+ glad_glRectf = (PFNGLRECTFPROC) load(userptr, "glRectf");
+ glad_glRectfv = (PFNGLRECTFVPROC) load(userptr, "glRectfv");
+ glad_glRecti = (PFNGLRECTIPROC) load(userptr, "glRecti");
+ glad_glRectiv = (PFNGLRECTIVPROC) load(userptr, "glRectiv");
+ glad_glRects = (PFNGLRECTSPROC) load(userptr, "glRects");
+ glad_glRectsv = (PFNGLRECTSVPROC) load(userptr, "glRectsv");
+ glad_glRenderMode = (PFNGLRENDERMODEPROC) load(userptr, "glRenderMode");
+ glad_glRotated = (PFNGLROTATEDPROC) load(userptr, "glRotated");
+ glad_glRotatef = (PFNGLROTATEFPROC) load(userptr, "glRotatef");
+ glad_glScaled = (PFNGLSCALEDPROC) load(userptr, "glScaled");
+ glad_glScalef = (PFNGLSCALEFPROC) load(userptr, "glScalef");
+ glad_glScissor = (PFNGLSCISSORPROC) load(userptr, "glScissor");
+ glad_glSelectBuffer = (PFNGLSELECTBUFFERPROC) load(userptr, "glSelectBuffer");
+ glad_glShadeModel = (PFNGLSHADEMODELPROC) load(userptr, "glShadeModel");
+ glad_glStencilFunc = (PFNGLSTENCILFUNCPROC) load(userptr, "glStencilFunc");
+ glad_glStencilMask = (PFNGLSTENCILMASKPROC) load(userptr, "glStencilMask");
+ glad_glStencilOp = (PFNGLSTENCILOPPROC) load(userptr, "glStencilOp");
+ glad_glTexCoord1d = (PFNGLTEXCOORD1DPROC) load(userptr, "glTexCoord1d");
+ glad_glTexCoord1dv = (PFNGLTEXCOORD1DVPROC) load(userptr, "glTexCoord1dv");
+ glad_glTexCoord1f = (PFNGLTEXCOORD1FPROC) load(userptr, "glTexCoord1f");
+ glad_glTexCoord1fv = (PFNGLTEXCOORD1FVPROC) load(userptr, "glTexCoord1fv");
+ glad_glTexCoord1i = (PFNGLTEXCOORD1IPROC) load(userptr, "glTexCoord1i");
+ glad_glTexCoord1iv = (PFNGLTEXCOORD1IVPROC) load(userptr, "glTexCoord1iv");
+ glad_glTexCoord1s = (PFNGLTEXCOORD1SPROC) load(userptr, "glTexCoord1s");
+ glad_glTexCoord1sv = (PFNGLTEXCOORD1SVPROC) load(userptr, "glTexCoord1sv");
+ glad_glTexCoord2d = (PFNGLTEXCOORD2DPROC) load(userptr, "glTexCoord2d");
+ glad_glTexCoord2dv = (PFNGLTEXCOORD2DVPROC) load(userptr, "glTexCoord2dv");
+ glad_glTexCoord2f = (PFNGLTEXCOORD2FPROC) load(userptr, "glTexCoord2f");
+ glad_glTexCoord2fv = (PFNGLTEXCOORD2FVPROC) load(userptr, "glTexCoord2fv");
+ glad_glTexCoord2i = (PFNGLTEXCOORD2IPROC) load(userptr, "glTexCoord2i");
+ glad_glTexCoord2iv = (PFNGLTEXCOORD2IVPROC) load(userptr, "glTexCoord2iv");
+ glad_glTexCoord2s = (PFNGLTEXCOORD2SPROC) load(userptr, "glTexCoord2s");
+ glad_glTexCoord2sv = (PFNGLTEXCOORD2SVPROC) load(userptr, "glTexCoord2sv");
+ glad_glTexCoord3d = (PFNGLTEXCOORD3DPROC) load(userptr, "glTexCoord3d");
+ glad_glTexCoord3dv = (PFNGLTEXCOORD3DVPROC) load(userptr, "glTexCoord3dv");
+ glad_glTexCoord3f = (PFNGLTEXCOORD3FPROC) load(userptr, "glTexCoord3f");
+ glad_glTexCoord3fv = (PFNGLTEXCOORD3FVPROC) load(userptr, "glTexCoord3fv");
+ glad_glTexCoord3i = (PFNGLTEXCOORD3IPROC) load(userptr, "glTexCoord3i");
+ glad_glTexCoord3iv = (PFNGLTEXCOORD3IVPROC) load(userptr, "glTexCoord3iv");
+ glad_glTexCoord3s = (PFNGLTEXCOORD3SPROC) load(userptr, "glTexCoord3s");
+ glad_glTexCoord3sv = (PFNGLTEXCOORD3SVPROC) load(userptr, "glTexCoord3sv");
+ glad_glTexCoord4d = (PFNGLTEXCOORD4DPROC) load(userptr, "glTexCoord4d");
+ glad_glTexCoord4dv = (PFNGLTEXCOORD4DVPROC) load(userptr, "glTexCoord4dv");
+ glad_glTexCoord4f = (PFNGLTEXCOORD4FPROC) load(userptr, "glTexCoord4f");
+ glad_glTexCoord4fv = (PFNGLTEXCOORD4FVPROC) load(userptr, "glTexCoord4fv");
+ glad_glTexCoord4i = (PFNGLTEXCOORD4IPROC) load(userptr, "glTexCoord4i");
+ glad_glTexCoord4iv = (PFNGLTEXCOORD4IVPROC) load(userptr, "glTexCoord4iv");
+ glad_glTexCoord4s = (PFNGLTEXCOORD4SPROC) load(userptr, "glTexCoord4s");
+ glad_glTexCoord4sv = (PFNGLTEXCOORD4SVPROC) load(userptr, "glTexCoord4sv");
+ glad_glTexEnvf = (PFNGLTEXENVFPROC) load(userptr, "glTexEnvf");
+ glad_glTexEnvfv = (PFNGLTEXENVFVPROC) load(userptr, "glTexEnvfv");
+ glad_glTexEnvi = (PFNGLTEXENVIPROC) load(userptr, "glTexEnvi");
+ glad_glTexEnviv = (PFNGLTEXENVIVPROC) load(userptr, "glTexEnviv");
+ glad_glTexGend = (PFNGLTEXGENDPROC) load(userptr, "glTexGend");
+ glad_glTexGendv = (PFNGLTEXGENDVPROC) load(userptr, "glTexGendv");
+ glad_glTexGenf = (PFNGLTEXGENFPROC) load(userptr, "glTexGenf");
+ glad_glTexGenfv = (PFNGLTEXGENFVPROC) load(userptr, "glTexGenfv");
+ glad_glTexGeni = (PFNGLTEXGENIPROC) load(userptr, "glTexGeni");
+ glad_glTexGeniv = (PFNGLTEXGENIVPROC) load(userptr, "glTexGeniv");
+ glad_glTexImage1D = (PFNGLTEXIMAGE1DPROC) load(userptr, "glTexImage1D");
+ glad_glTexImage2D = (PFNGLTEXIMAGE2DPROC) load(userptr, "glTexImage2D");
+ glad_glTexParameterf = (PFNGLTEXPARAMETERFPROC) load(userptr, "glTexParameterf");
+ glad_glTexParameterfv = (PFNGLTEXPARAMETERFVPROC) load(userptr, "glTexParameterfv");
+ glad_glTexParameteri = (PFNGLTEXPARAMETERIPROC) load(userptr, "glTexParameteri");
+ glad_glTexParameteriv = (PFNGLTEXPARAMETERIVPROC) load(userptr, "glTexParameteriv");
+ glad_glTranslated = (PFNGLTRANSLATEDPROC) load(userptr, "glTranslated");
+ glad_glTranslatef = (PFNGLTRANSLATEFPROC) load(userptr, "glTranslatef");
+ glad_glVertex2d = (PFNGLVERTEX2DPROC) load(userptr, "glVertex2d");
+ glad_glVertex2dv = (PFNGLVERTEX2DVPROC) load(userptr, "glVertex2dv");
+ glad_glVertex2f = (PFNGLVERTEX2FPROC) load(userptr, "glVertex2f");
+ glad_glVertex2fv = (PFNGLVERTEX2FVPROC) load(userptr, "glVertex2fv");
+ glad_glVertex2i = (PFNGLVERTEX2IPROC) load(userptr, "glVertex2i");
+ glad_glVertex2iv = (PFNGLVERTEX2IVPROC) load(userptr, "glVertex2iv");
+ glad_glVertex2s = (PFNGLVERTEX2SPROC) load(userptr, "glVertex2s");
+ glad_glVertex2sv = (PFNGLVERTEX2SVPROC) load(userptr, "glVertex2sv");
+ glad_glVertex3d = (PFNGLVERTEX3DPROC) load(userptr, "glVertex3d");
+ glad_glVertex3dv = (PFNGLVERTEX3DVPROC) load(userptr, "glVertex3dv");
+ glad_glVertex3f = (PFNGLVERTEX3FPROC) load(userptr, "glVertex3f");
+ glad_glVertex3fv = (PFNGLVERTEX3FVPROC) load(userptr, "glVertex3fv");
+ glad_glVertex3i = (PFNGLVERTEX3IPROC) load(userptr, "glVertex3i");
+ glad_glVertex3iv = (PFNGLVERTEX3IVPROC) load(userptr, "glVertex3iv");
+ glad_glVertex3s = (PFNGLVERTEX3SPROC) load(userptr, "glVertex3s");
+ glad_glVertex3sv = (PFNGLVERTEX3SVPROC) load(userptr, "glVertex3sv");
+ glad_glVertex4d = (PFNGLVERTEX4DPROC) load(userptr, "glVertex4d");
+ glad_glVertex4dv = (PFNGLVERTEX4DVPROC) load(userptr, "glVertex4dv");
+ glad_glVertex4f = (PFNGLVERTEX4FPROC) load(userptr, "glVertex4f");
+ glad_glVertex4fv = (PFNGLVERTEX4FVPROC) load(userptr, "glVertex4fv");
+ glad_glVertex4i = (PFNGLVERTEX4IPROC) load(userptr, "glVertex4i");
+ glad_glVertex4iv = (PFNGLVERTEX4IVPROC) load(userptr, "glVertex4iv");
+ glad_glVertex4s = (PFNGLVERTEX4SPROC) load(userptr, "glVertex4s");
+ glad_glVertex4sv = (PFNGLVERTEX4SVPROC) load(userptr, "glVertex4sv");
+ glad_glViewport = (PFNGLVIEWPORTPROC) load(userptr, "glViewport");
+}
+static void glad_gl_load_GL_VERSION_1_1( GLADuserptrloadfunc load, void* userptr) {
+ if(!GLAD_GL_VERSION_1_1) return;
+ glad_glAreTexturesResident = (PFNGLARETEXTURESRESIDENTPROC) load(userptr, "glAreTexturesResident");
+ glad_glArrayElement = (PFNGLARRAYELEMENTPROC) load(userptr, "glArrayElement");
+ glad_glBindTexture = (PFNGLBINDTEXTUREPROC) load(userptr, "glBindTexture");
+ glad_glColorPointer = (PFNGLCOLORPOINTERPROC) load(userptr, "glColorPointer");
+ glad_glCopyTexImage1D = (PFNGLCOPYTEXIMAGE1DPROC) load(userptr, "glCopyTexImage1D");
+ glad_glCopyTexImage2D = (PFNGLCOPYTEXIMAGE2DPROC) load(userptr, "glCopyTexImage2D");
+ glad_glCopyTexSubImage1D = (PFNGLCOPYTEXSUBIMAGE1DPROC) load(userptr, "glCopyTexSubImage1D");
+ glad_glCopyTexSubImage2D = (PFNGLCOPYTEXSUBIMAGE2DPROC) load(userptr, "glCopyTexSubImage2D");
+ glad_glDeleteTextures = (PFNGLDELETETEXTURESPROC) load(userptr, "glDeleteTextures");
+ glad_glDisableClientState = (PFNGLDISABLECLIENTSTATEPROC) load(userptr, "glDisableClientState");
+ glad_glDrawArrays = (PFNGLDRAWARRAYSPROC) load(userptr, "glDrawArrays");
+ glad_glDrawElements = (PFNGLDRAWELEMENTSPROC) load(userptr, "glDrawElements");
+ glad_glEdgeFlagPointer = (PFNGLEDGEFLAGPOINTERPROC) load(userptr, "glEdgeFlagPointer");
+ glad_glEnableClientState = (PFNGLENABLECLIENTSTATEPROC) load(userptr, "glEnableClientState");
+ glad_glGenTextures = (PFNGLGENTEXTURESPROC) load(userptr, "glGenTextures");
+ glad_glGetPointerv = (PFNGLGETPOINTERVPROC) load(userptr, "glGetPointerv");
+ glad_glIndexPointer = (PFNGLINDEXPOINTERPROC) load(userptr, "glIndexPointer");
+ glad_glIndexub = (PFNGLINDEXUBPROC) load(userptr, "glIndexub");
+ glad_glIndexubv = (PFNGLINDEXUBVPROC) load(userptr, "glIndexubv");
+ glad_glInterleavedArrays = (PFNGLINTERLEAVEDARRAYSPROC) load(userptr, "glInterleavedArrays");
+ glad_glIsTexture = (PFNGLISTEXTUREPROC) load(userptr, "glIsTexture");
+ glad_glNormalPointer = (PFNGLNORMALPOINTERPROC) load(userptr, "glNormalPointer");
+ glad_glPolygonOffset = (PFNGLPOLYGONOFFSETPROC) load(userptr, "glPolygonOffset");
+ glad_glPopClientAttrib = (PFNGLPOPCLIENTATTRIBPROC) load(userptr, "glPopClientAttrib");
+ glad_glPrioritizeTextures = (PFNGLPRIORITIZETEXTURESPROC) load(userptr, "glPrioritizeTextures");
+ glad_glPushClientAttrib = (PFNGLPUSHCLIENTATTRIBPROC) load(userptr, "glPushClientAttrib");
+ glad_glTexCoordPointer = (PFNGLTEXCOORDPOINTERPROC) load(userptr, "glTexCoordPointer");
+ glad_glTexSubImage1D = (PFNGLTEXSUBIMAGE1DPROC) load(userptr, "glTexSubImage1D");
+ glad_glTexSubImage2D = (PFNGLTEXSUBIMAGE2DPROC) load(userptr, "glTexSubImage2D");
+ glad_glVertexPointer = (PFNGLVERTEXPOINTERPROC) load(userptr, "glVertexPointer");
+}
+static void glad_gl_load_GL_VERSION_1_2( GLADuserptrloadfunc load, void* userptr) {
+ if(!GLAD_GL_VERSION_1_2) return;
+ glad_glCopyTexSubImage3D = (PFNGLCOPYTEXSUBIMAGE3DPROC) load(userptr, "glCopyTexSubImage3D");
+ glad_glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC) load(userptr, "glDrawRangeElements");
+ glad_glTexImage3D = (PFNGLTEXIMAGE3DPROC) load(userptr, "glTexImage3D");
+ glad_glTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC) load(userptr, "glTexSubImage3D");
+}
+static void glad_gl_load_GL_VERSION_1_3( GLADuserptrloadfunc load, void* userptr) {
+ if(!GLAD_GL_VERSION_1_3) return;
+ glad_glActiveTexture = (PFNGLACTIVETEXTUREPROC) load(userptr, "glActiveTexture");
+ glad_glClientActiveTexture = (PFNGLCLIENTACTIVETEXTUREPROC) load(userptr, "glClientActiveTexture");
+ glad_glCompressedTexImage1D = (PFNGLCOMPRESSEDTEXIMAGE1DPROC) load(userptr, "glCompressedTexImage1D");
+ glad_glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC) load(userptr, "glCompressedTexImage2D");
+ glad_glCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC) load(userptr, "glCompressedTexImage3D");
+ glad_glCompressedTexSubImage1D = (PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) load(userptr, "glCompressedTexSubImage1D");
+ glad_glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) load(userptr, "glCompressedTexSubImage2D");
+ glad_glCompressedTexSubImage3D = (PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) load(userptr, "glCompressedTexSubImage3D");
+ glad_glGetCompressedTexImage = (PFNGLGETCOMPRESSEDTEXIMAGEPROC) load(userptr, "glGetCompressedTexImage");
+ glad_glLoadTransposeMatrixd = (PFNGLLOADTRANSPOSEMATRIXDPROC) load(userptr, "glLoadTransposeMatrixd");
+ glad_glLoadTransposeMatrixf = (PFNGLLOADTRANSPOSEMATRIXFPROC) load(userptr, "glLoadTransposeMatrixf");
+ glad_glMultTransposeMatrixd = (PFNGLMULTTRANSPOSEMATRIXDPROC) load(userptr, "glMultTransposeMatrixd");
+ glad_glMultTransposeMatrixf = (PFNGLMULTTRANSPOSEMATRIXFPROC) load(userptr, "glMultTransposeMatrixf");
+ glad_glMultiTexCoord1d = (PFNGLMULTITEXCOORD1DPROC) load(userptr, "glMultiTexCoord1d");
+ glad_glMultiTexCoord1dv = (PFNGLMULTITEXCOORD1DVPROC) load(userptr, "glMultiTexCoord1dv");
+ glad_glMultiTexCoord1f = (PFNGLMULTITEXCOORD1FPROC) load(userptr, "glMultiTexCoord1f");
+ glad_glMultiTexCoord1fv = (PFNGLMULTITEXCOORD1FVPROC) load(userptr, "glMultiTexCoord1fv");
+ glad_glMultiTexCoord1i = (PFNGLMULTITEXCOORD1IPROC) load(userptr, "glMultiTexCoord1i");
+ glad_glMultiTexCoord1iv = (PFNGLMULTITEXCOORD1IVPROC) load(userptr, "glMultiTexCoord1iv");
+ glad_glMultiTexCoord1s = (PFNGLMULTITEXCOORD1SPROC) load(userptr, "glMultiTexCoord1s");
+ glad_glMultiTexCoord1sv = (PFNGLMULTITEXCOORD1SVPROC) load(userptr, "glMultiTexCoord1sv");
+ glad_glMultiTexCoord2d = (PFNGLMULTITEXCOORD2DPROC) load(userptr, "glMultiTexCoord2d");
+ glad_glMultiTexCoord2dv = (PFNGLMULTITEXCOORD2DVPROC) load(userptr, "glMultiTexCoord2dv");
+ glad_glMultiTexCoord2f = (PFNGLMULTITEXCOORD2FPROC) load(userptr, "glMultiTexCoord2f");
+ glad_glMultiTexCoord2fv = (PFNGLMULTITEXCOORD2FVPROC) load(userptr, "glMultiTexCoord2fv");
+ glad_glMultiTexCoord2i = (PFNGLMULTITEXCOORD2IPROC) load(userptr, "glMultiTexCoord2i");
+ glad_glMultiTexCoord2iv = (PFNGLMULTITEXCOORD2IVPROC) load(userptr, "glMultiTexCoord2iv");
+ glad_glMultiTexCoord2s = (PFNGLMULTITEXCOORD2SPROC) load(userptr, "glMultiTexCoord2s");
+ glad_glMultiTexCoord2sv = (PFNGLMULTITEXCOORD2SVPROC) load(userptr, "glMultiTexCoord2sv");
+ glad_glMultiTexCoord3d = (PFNGLMULTITEXCOORD3DPROC) load(userptr, "glMultiTexCoord3d");
+ glad_glMultiTexCoord3dv = (PFNGLMULTITEXCOORD3DVPROC) load(userptr, "glMultiTexCoord3dv");
+ glad_glMultiTexCoord3f = (PFNGLMULTITEXCOORD3FPROC) load(userptr, "glMultiTexCoord3f");
+ glad_glMultiTexCoord3fv = (PFNGLMULTITEXCOORD3FVPROC) load(userptr, "glMultiTexCoord3fv");
+ glad_glMultiTexCoord3i = (PFNGLMULTITEXCOORD3IPROC) load(userptr, "glMultiTexCoord3i");
+ glad_glMultiTexCoord3iv = (PFNGLMULTITEXCOORD3IVPROC) load(userptr, "glMultiTexCoord3iv");
+ glad_glMultiTexCoord3s = (PFNGLMULTITEXCOORD3SPROC) load(userptr, "glMultiTexCoord3s");
+ glad_glMultiTexCoord3sv = (PFNGLMULTITEXCOORD3SVPROC) load(userptr, "glMultiTexCoord3sv");
+ glad_glMultiTexCoord4d = (PFNGLMULTITEXCOORD4DPROC) load(userptr, "glMultiTexCoord4d");
+ glad_glMultiTexCoord4dv = (PFNGLMULTITEXCOORD4DVPROC) load(userptr, "glMultiTexCoord4dv");
+ glad_glMultiTexCoord4f = (PFNGLMULTITEXCOORD4FPROC) load(userptr, "glMultiTexCoord4f");
+ glad_glMultiTexCoord4fv = (PFNGLMULTITEXCOORD4FVPROC) load(userptr, "glMultiTexCoord4fv");
+ glad_glMultiTexCoord4i = (PFNGLMULTITEXCOORD4IPROC) load(userptr, "glMultiTexCoord4i");
+ glad_glMultiTexCoord4iv = (PFNGLMULTITEXCOORD4IVPROC) load(userptr, "glMultiTexCoord4iv");
+ glad_glMultiTexCoord4s = (PFNGLMULTITEXCOORD4SPROC) load(userptr, "glMultiTexCoord4s");
+ glad_glMultiTexCoord4sv = (PFNGLMULTITEXCOORD4SVPROC) load(userptr, "glMultiTexCoord4sv");
+ glad_glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC) load(userptr, "glSampleCoverage");
+}
+static void glad_gl_load_GL_VERSION_1_4( GLADuserptrloadfunc load, void* userptr) {
+ if(!GLAD_GL_VERSION_1_4) return;
+ glad_glBlendColor = (PFNGLBLENDCOLORPROC) load(userptr, "glBlendColor");
+ glad_glBlendEquation = (PFNGLBLENDEQUATIONPROC) load(userptr, "glBlendEquation");
+ glad_glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC) load(userptr, "glBlendFuncSeparate");
+ glad_glFogCoordPointer = (PFNGLFOGCOORDPOINTERPROC) load(userptr, "glFogCoordPointer");
+ glad_glFogCoordd = (PFNGLFOGCOORDDPROC) load(userptr, "glFogCoordd");
+ glad_glFogCoorddv = (PFNGLFOGCOORDDVPROC) load(userptr, "glFogCoorddv");
+ glad_glFogCoordf = (PFNGLFOGCOORDFPROC) load(userptr, "glFogCoordf");
+ glad_glFogCoordfv = (PFNGLFOGCOORDFVPROC) load(userptr, "glFogCoordfv");
+ glad_glMultiDrawArrays = (PFNGLMULTIDRAWARRAYSPROC) load(userptr, "glMultiDrawArrays");
+ glad_glMultiDrawElements = (PFNGLMULTIDRAWELEMENTSPROC) load(userptr, "glMultiDrawElements");
+ glad_glPointParameterf = (PFNGLPOINTPARAMETERFPROC) load(userptr, "glPointParameterf");
+ glad_glPointParameterfv = (PFNGLPOINTPARAMETERFVPROC) load(userptr, "glPointParameterfv");
+ glad_glPointParameteri = (PFNGLPOINTPARAMETERIPROC) load(userptr, "glPointParameteri");
+ glad_glPointParameteriv = (PFNGLPOINTPARAMETERIVPROC) load(userptr, "glPointParameteriv");
+ glad_glSecondaryColor3b = (PFNGLSECONDARYCOLOR3BPROC) load(userptr, "glSecondaryColor3b");
+ glad_glSecondaryColor3bv = (PFNGLSECONDARYCOLOR3BVPROC) load(userptr, "glSecondaryColor3bv");
+ glad_glSecondaryColor3d = (PFNGLSECONDARYCOLOR3DPROC) load(userptr, "glSecondaryColor3d");
+ glad_glSecondaryColor3dv = (PFNGLSECONDARYCOLOR3DVPROC) load(userptr, "glSecondaryColor3dv");
+ glad_glSecondaryColor3f = (PFNGLSECONDARYCOLOR3FPROC) load(userptr, "glSecondaryColor3f");
+ glad_glSecondaryColor3fv = (PFNGLSECONDARYCOLOR3FVPROC) load(userptr, "glSecondaryColor3fv");
+ glad_glSecondaryColor3i = (PFNGLSECONDARYCOLOR3IPROC) load(userptr, "glSecondaryColor3i");
+ glad_glSecondaryColor3iv = (PFNGLSECONDARYCOLOR3IVPROC) load(userptr, "glSecondaryColor3iv");
+ glad_glSecondaryColor3s = (PFNGLSECONDARYCOLOR3SPROC) load(userptr, "glSecondaryColor3s");
+ glad_glSecondaryColor3sv = (PFNGLSECONDARYCOLOR3SVPROC) load(userptr, "glSecondaryColor3sv");
+ glad_glSecondaryColor3ub = (PFNGLSECONDARYCOLOR3UBPROC) load(userptr, "glSecondaryColor3ub");
+ glad_glSecondaryColor3ubv = (PFNGLSECONDARYCOLOR3UBVPROC) load(userptr, "glSecondaryColor3ubv");
+ glad_glSecondaryColor3ui = (PFNGLSECONDARYCOLOR3UIPROC) load(userptr, "glSecondaryColor3ui");
+ glad_glSecondaryColor3uiv = (PFNGLSECONDARYCOLOR3UIVPROC) load(userptr, "glSecondaryColor3uiv");
+ glad_glSecondaryColor3us = (PFNGLSECONDARYCOLOR3USPROC) load(userptr, "glSecondaryColor3us");
+ glad_glSecondaryColor3usv = (PFNGLSECONDARYCOLOR3USVPROC) load(userptr, "glSecondaryColor3usv");
+ glad_glSecondaryColorPointer = (PFNGLSECONDARYCOLORPOINTERPROC) load(userptr, "glSecondaryColorPointer");
+ glad_glWindowPos2d = (PFNGLWINDOWPOS2DPROC) load(userptr, "glWindowPos2d");
+ glad_glWindowPos2dv = (PFNGLWINDOWPOS2DVPROC) load(userptr, "glWindowPos2dv");
+ glad_glWindowPos2f = (PFNGLWINDOWPOS2FPROC) load(userptr, "glWindowPos2f");
+ glad_glWindowPos2fv = (PFNGLWINDOWPOS2FVPROC) load(userptr, "glWindowPos2fv");
+ glad_glWindowPos2i = (PFNGLWINDOWPOS2IPROC) load(userptr, "glWindowPos2i");
+ glad_glWindowPos2iv = (PFNGLWINDOWPOS2IVPROC) load(userptr, "glWindowPos2iv");
+ glad_glWindowPos2s = (PFNGLWINDOWPOS2SPROC) load(userptr, "glWindowPos2s");
+ glad_glWindowPos2sv = (PFNGLWINDOWPOS2SVPROC) load(userptr, "glWindowPos2sv");
+ glad_glWindowPos3d = (PFNGLWINDOWPOS3DPROC) load(userptr, "glWindowPos3d");
+ glad_glWindowPos3dv = (PFNGLWINDOWPOS3DVPROC) load(userptr, "glWindowPos3dv");
+ glad_glWindowPos3f = (PFNGLWINDOWPOS3FPROC) load(userptr, "glWindowPos3f");
+ glad_glWindowPos3fv = (PFNGLWINDOWPOS3FVPROC) load(userptr, "glWindowPos3fv");
+ glad_glWindowPos3i = (PFNGLWINDOWPOS3IPROC) load(userptr, "glWindowPos3i");
+ glad_glWindowPos3iv = (PFNGLWINDOWPOS3IVPROC) load(userptr, "glWindowPos3iv");
+ glad_glWindowPos3s = (PFNGLWINDOWPOS3SPROC) load(userptr, "glWindowPos3s");
+ glad_glWindowPos3sv = (PFNGLWINDOWPOS3SVPROC) load(userptr, "glWindowPos3sv");
+}
+static void glad_gl_load_GL_VERSION_1_5( GLADuserptrloadfunc load, void* userptr) {
+ if(!GLAD_GL_VERSION_1_5) return;
+ glad_glBeginQuery = (PFNGLBEGINQUERYPROC) load(userptr, "glBeginQuery");
+ glad_glBindBuffer = (PFNGLBINDBUFFERPROC) load(userptr, "glBindBuffer");
+ glad_glBufferData = (PFNGLBUFFERDATAPROC) load(userptr, "glBufferData");
+ glad_glBufferSubData = (PFNGLBUFFERSUBDATAPROC) load(userptr, "glBufferSubData");
+ glad_glDeleteBuffers = (PFNGLDELETEBUFFERSPROC) load(userptr, "glDeleteBuffers");
+ glad_glDeleteQueries = (PFNGLDELETEQUERIESPROC) load(userptr, "glDeleteQueries");
+ glad_glEndQuery = (PFNGLENDQUERYPROC) load(userptr, "glEndQuery");
+ glad_glGenBuffers = (PFNGLGENBUFFERSPROC) load(userptr, "glGenBuffers");
+ glad_glGenQueries = (PFNGLGENQUERIESPROC) load(userptr, "glGenQueries");
+ glad_glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC) load(userptr, "glGetBufferParameteriv");
+ glad_glGetBufferPointerv = (PFNGLGETBUFFERPOINTERVPROC) load(userptr, "glGetBufferPointerv");
+ glad_glGetBufferSubData = (PFNGLGETBUFFERSUBDATAPROC) load(userptr, "glGetBufferSubData");
+ glad_glGetQueryObjectiv = (PFNGLGETQUERYOBJECTIVPROC) load(userptr, "glGetQueryObjectiv");
+ glad_glGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC) load(userptr, "glGetQueryObjectuiv");
+ glad_glGetQueryiv = (PFNGLGETQUERYIVPROC) load(userptr, "glGetQueryiv");
+ glad_glIsBuffer = (PFNGLISBUFFERPROC) load(userptr, "glIsBuffer");
+ glad_glIsQuery = (PFNGLISQUERYPROC) load(userptr, "glIsQuery");
+ glad_glMapBuffer = (PFNGLMAPBUFFERPROC) load(userptr, "glMapBuffer");
+ glad_glUnmapBuffer = (PFNGLUNMAPBUFFERPROC) load(userptr, "glUnmapBuffer");
+}
+static void glad_gl_load_GL_VERSION_2_0( GLADuserptrloadfunc load, void* userptr) {
+ if(!GLAD_GL_VERSION_2_0) return;
+ glad_glAttachShader = (PFNGLATTACHSHADERPROC) load(userptr, "glAttachShader");
+ glad_glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC) load(userptr, "glBindAttribLocation");
+ glad_glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC) load(userptr, "glBlendEquationSeparate");
+ glad_glCompileShader = (PFNGLCOMPILESHADERPROC) load(userptr, "glCompileShader");
+ glad_glCreateProgram = (PFNGLCREATEPROGRAMPROC) load(userptr, "glCreateProgram");
+ glad_glCreateShader = (PFNGLCREATESHADERPROC) load(userptr, "glCreateShader");
+ glad_glDeleteProgram = (PFNGLDELETEPROGRAMPROC) load(userptr, "glDeleteProgram");
+ glad_glDeleteShader = (PFNGLDELETESHADERPROC) load(userptr, "glDeleteShader");
+ glad_glDetachShader = (PFNGLDETACHSHADERPROC) load(userptr, "glDetachShader");
+ glad_glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC) load(userptr, "glDisableVertexAttribArray");
+ glad_glDrawBuffers = (PFNGLDRAWBUFFERSPROC) load(userptr, "glDrawBuffers");
+ glad_glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC) load(userptr, "glEnableVertexAttribArray");
+ glad_glGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC) load(userptr, "glGetActiveAttrib");
+ glad_glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC) load(userptr, "glGetActiveUniform");
+ glad_glGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC) load(userptr, "glGetAttachedShaders");
+ glad_glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC) load(userptr, "glGetAttribLocation");
+ glad_glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC) load(userptr, "glGetProgramInfoLog");
+ glad_glGetProgramiv = (PFNGLGETPROGRAMIVPROC) load(userptr, "glGetProgramiv");
+ glad_glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC) load(userptr, "glGetShaderInfoLog");
+ glad_glGetShaderSource = (PFNGLGETSHADERSOURCEPROC) load(userptr, "glGetShaderSource");
+ glad_glGetShaderiv = (PFNGLGETSHADERIVPROC) load(userptr, "glGetShaderiv");
+ glad_glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC) load(userptr, "glGetUniformLocation");
+ glad_glGetUniformfv = (PFNGLGETUNIFORMFVPROC) load(userptr, "glGetUniformfv");
+ glad_glGetUniformiv = (PFNGLGETUNIFORMIVPROC) load(userptr, "glGetUniformiv");
+ glad_glGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC) load(userptr, "glGetVertexAttribPointerv");
+ glad_glGetVertexAttribdv = (PFNGLGETVERTEXATTRIBDVPROC) load(userptr, "glGetVertexAttribdv");
+ glad_glGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC) load(userptr, "glGetVertexAttribfv");
+ glad_glGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC) load(userptr, "glGetVertexAttribiv");
+ glad_glIsProgram = (PFNGLISPROGRAMPROC) load(userptr, "glIsProgram");
+ glad_glIsShader = (PFNGLISSHADERPROC) load(userptr, "glIsShader");
+ glad_glLinkProgram = (PFNGLLINKPROGRAMPROC) load(userptr, "glLinkProgram");
+ glad_glShaderSource = (PFNGLSHADERSOURCEPROC) load(userptr, "glShaderSource");
+ glad_glStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC) load(userptr, "glStencilFuncSeparate");
+ glad_glStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC) load(userptr, "glStencilMaskSeparate");
+ glad_glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC) load(userptr, "glStencilOpSeparate");
+ glad_glUniform1f = (PFNGLUNIFORM1FPROC) load(userptr, "glUniform1f");
+ glad_glUniform1fv = (PFNGLUNIFORM1FVPROC) load(userptr, "glUniform1fv");
+ glad_glUniform1i = (PFNGLUNIFORM1IPROC) load(userptr, "glUniform1i");
+ glad_glUniform1iv = (PFNGLUNIFORM1IVPROC) load(userptr, "glUniform1iv");
+ glad_glUniform2f = (PFNGLUNIFORM2FPROC) load(userptr, "glUniform2f");
+ glad_glUniform2fv = (PFNGLUNIFORM2FVPROC) load(userptr, "glUniform2fv");
+ glad_glUniform2i = (PFNGLUNIFORM2IPROC) load(userptr, "glUniform2i");
+ glad_glUniform2iv = (PFNGLUNIFORM2IVPROC) load(userptr, "glUniform2iv");
+ glad_glUniform3f = (PFNGLUNIFORM3FPROC) load(userptr, "glUniform3f");
+ glad_glUniform3fv = (PFNGLUNIFORM3FVPROC) load(userptr, "glUniform3fv");
+ glad_glUniform3i = (PFNGLUNIFORM3IPROC) load(userptr, "glUniform3i");
+ glad_glUniform3iv = (PFNGLUNIFORM3IVPROC) load(userptr, "glUniform3iv");
+ glad_glUniform4f = (PFNGLUNIFORM4FPROC) load(userptr, "glUniform4f");
+ glad_glUniform4fv = (PFNGLUNIFORM4FVPROC) load(userptr, "glUniform4fv");
+ glad_glUniform4i = (PFNGLUNIFORM4IPROC) load(userptr, "glUniform4i");
+ glad_glUniform4iv = (PFNGLUNIFORM4IVPROC) load(userptr, "glUniform4iv");
+ glad_glUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC) load(userptr, "glUniformMatrix2fv");
+ glad_glUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC) load(userptr, "glUniformMatrix3fv");
+ glad_glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC) load(userptr, "glUniformMatrix4fv");
+ glad_glUseProgram = (PFNGLUSEPROGRAMPROC) load(userptr, "glUseProgram");
+ glad_glValidateProgram = (PFNGLVALIDATEPROGRAMPROC) load(userptr, "glValidateProgram");
+ glad_glVertexAttrib1d = (PFNGLVERTEXATTRIB1DPROC) load(userptr, "glVertexAttrib1d");
+ glad_glVertexAttrib1dv = (PFNGLVERTEXATTRIB1DVPROC) load(userptr, "glVertexAttrib1dv");
+ glad_glVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC) load(userptr, "glVertexAttrib1f");
+ glad_glVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC) load(userptr, "glVertexAttrib1fv");
+ glad_glVertexAttrib1s = (PFNGLVERTEXATTRIB1SPROC) load(userptr, "glVertexAttrib1s");
+ glad_glVertexAttrib1sv = (PFNGLVERTEXATTRIB1SVPROC) load(userptr, "glVertexAttrib1sv");
+ glad_glVertexAttrib2d = (PFNGLVERTEXATTRIB2DPROC) load(userptr, "glVertexAttrib2d");
+ glad_glVertexAttrib2dv = (PFNGLVERTEXATTRIB2DVPROC) load(userptr, "glVertexAttrib2dv");
+ glad_glVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC) load(userptr, "glVertexAttrib2f");
+ glad_glVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC) load(userptr, "glVertexAttrib2fv");
+ glad_glVertexAttrib2s = (PFNGLVERTEXATTRIB2SPROC) load(userptr, "glVertexAttrib2s");
+ glad_glVertexAttrib2sv = (PFNGLVERTEXATTRIB2SVPROC) load(userptr, "glVertexAttrib2sv");
+ glad_glVertexAttrib3d = (PFNGLVERTEXATTRIB3DPROC) load(userptr, "glVertexAttrib3d");
+ glad_glVertexAttrib3dv = (PFNGLVERTEXATTRIB3DVPROC) load(userptr, "glVertexAttrib3dv");
+ glad_glVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC) load(userptr, "glVertexAttrib3f");
+ glad_glVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC) load(userptr, "glVertexAttrib3fv");
+ glad_glVertexAttrib3s = (PFNGLVERTEXATTRIB3SPROC) load(userptr, "glVertexAttrib3s");
+ glad_glVertexAttrib3sv = (PFNGLVERTEXATTRIB3SVPROC) load(userptr, "glVertexAttrib3sv");
+ glad_glVertexAttrib4Nbv = (PFNGLVERTEXATTRIB4NBVPROC) load(userptr, "glVertexAttrib4Nbv");
+ glad_glVertexAttrib4Niv = (PFNGLVERTEXATTRIB4NIVPROC) load(userptr, "glVertexAttrib4Niv");
+ glad_glVertexAttrib4Nsv = (PFNGLVERTEXATTRIB4NSVPROC) load(userptr, "glVertexAttrib4Nsv");
+ glad_glVertexAttrib4Nub = (PFNGLVERTEXATTRIB4NUBPROC) load(userptr, "glVertexAttrib4Nub");
+ glad_glVertexAttrib4Nubv = (PFNGLVERTEXATTRIB4NUBVPROC) load(userptr, "glVertexAttrib4Nubv");
+ glad_glVertexAttrib4Nuiv = (PFNGLVERTEXATTRIB4NUIVPROC) load(userptr, "glVertexAttrib4Nuiv");
+ glad_glVertexAttrib4Nusv = (PFNGLVERTEXATTRIB4NUSVPROC) load(userptr, "glVertexAttrib4Nusv");
+ glad_glVertexAttrib4bv = (PFNGLVERTEXATTRIB4BVPROC) load(userptr, "glVertexAttrib4bv");
+ glad_glVertexAttrib4d = (PFNGLVERTEXATTRIB4DPROC) load(userptr, "glVertexAttrib4d");
+ glad_glVertexAttrib4dv = (PFNGLVERTEXATTRIB4DVPROC) load(userptr, "glVertexAttrib4dv");
+ glad_glVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC) load(userptr, "glVertexAttrib4f");
+ glad_glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC) load(userptr, "glVertexAttrib4fv");
+ glad_glVertexAttrib4iv = (PFNGLVERTEXATTRIB4IVPROC) load(userptr, "glVertexAttrib4iv");
+ glad_glVertexAttrib4s = (PFNGLVERTEXATTRIB4SPROC) load(userptr, "glVertexAttrib4s");
+ glad_glVertexAttrib4sv = (PFNGLVERTEXATTRIB4SVPROC) load(userptr, "glVertexAttrib4sv");
+ glad_glVertexAttrib4ubv = (PFNGLVERTEXATTRIB4UBVPROC) load(userptr, "glVertexAttrib4ubv");
+ glad_glVertexAttrib4uiv = (PFNGLVERTEXATTRIB4UIVPROC) load(userptr, "glVertexAttrib4uiv");
+ glad_glVertexAttrib4usv = (PFNGLVERTEXATTRIB4USVPROC) load(userptr, "glVertexAttrib4usv");
+ glad_glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC) load(userptr, "glVertexAttribPointer");
+}
+static void glad_gl_load_GL_VERSION_2_1( GLADuserptrloadfunc load, void* userptr) {
+ if(!GLAD_GL_VERSION_2_1) return;
+ glad_glUniformMatrix2x3fv = (PFNGLUNIFORMMATRIX2X3FVPROC) load(userptr, "glUniformMatrix2x3fv");
+ glad_glUniformMatrix2x4fv = (PFNGLUNIFORMMATRIX2X4FVPROC) load(userptr, "glUniformMatrix2x4fv");
+ glad_glUniformMatrix3x2fv = (PFNGLUNIFORMMATRIX3X2FVPROC) load(userptr, "glUniformMatrix3x2fv");
+ glad_glUniformMatrix3x4fv = (PFNGLUNIFORMMATRIX3X4FVPROC) load(userptr, "glUniformMatrix3x4fv");
+ glad_glUniformMatrix4x2fv = (PFNGLUNIFORMMATRIX4X2FVPROC) load(userptr, "glUniformMatrix4x2fv");
+ glad_glUniformMatrix4x3fv = (PFNGLUNIFORMMATRIX4X3FVPROC) load(userptr, "glUniformMatrix4x3fv");
+}
+static void glad_gl_load_GL_VERSION_3_0( GLADuserptrloadfunc load, void* userptr) {
+ if(!GLAD_GL_VERSION_3_0) return;
+ glad_glBeginConditionalRender = (PFNGLBEGINCONDITIONALRENDERPROC) load(userptr, "glBeginConditionalRender");
+ glad_glBeginTransformFeedback = (PFNGLBEGINTRANSFORMFEEDBACKPROC) load(userptr, "glBeginTransformFeedback");
+ glad_glBindBufferBase = (PFNGLBINDBUFFERBASEPROC) load(userptr, "glBindBufferBase");
+ glad_glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC) load(userptr, "glBindBufferRange");
+ glad_glBindFragDataLocation = (PFNGLBINDFRAGDATALOCATIONPROC) load(userptr, "glBindFragDataLocation");
+ glad_glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC) load(userptr, "glBindFramebuffer");
+ glad_glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC) load(userptr, "glBindRenderbuffer");
+ glad_glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC) load(userptr, "glBindVertexArray");
+ glad_glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC) load(userptr, "glBlitFramebuffer");
+ glad_glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC) load(userptr, "glCheckFramebufferStatus");
+ glad_glClampColor = (PFNGLCLAMPCOLORPROC) load(userptr, "glClampColor");
+ glad_glClearBufferfi = (PFNGLCLEARBUFFERFIPROC) load(userptr, "glClearBufferfi");
+ glad_glClearBufferfv = (PFNGLCLEARBUFFERFVPROC) load(userptr, "glClearBufferfv");
+ glad_glClearBufferiv = (PFNGLCLEARBUFFERIVPROC) load(userptr, "glClearBufferiv");
+ glad_glClearBufferuiv = (PFNGLCLEARBUFFERUIVPROC) load(userptr, "glClearBufferuiv");
+ glad_glColorMaski = (PFNGLCOLORMASKIPROC) load(userptr, "glColorMaski");
+ glad_glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC) load(userptr, "glDeleteFramebuffers");
+ glad_glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC) load(userptr, "glDeleteRenderbuffers");
+ glad_glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC) load(userptr, "glDeleteVertexArrays");
+ glad_glDisablei = (PFNGLDISABLEIPROC) load(userptr, "glDisablei");
+ glad_glEnablei = (PFNGLENABLEIPROC) load(userptr, "glEnablei");
+ glad_glEndConditionalRender = (PFNGLENDCONDITIONALRENDERPROC) load(userptr, "glEndConditionalRender");
+ glad_glEndTransformFeedback = (PFNGLENDTRANSFORMFEEDBACKPROC) load(userptr, "glEndTransformFeedback");
+ glad_glFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC) load(userptr, "glFlushMappedBufferRange");
+ glad_glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC) load(userptr, "glFramebufferRenderbuffer");
+ glad_glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC) load(userptr, "glFramebufferTexture1D");
+ glad_glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC) load(userptr, "glFramebufferTexture2D");
+ glad_glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC) load(userptr, "glFramebufferTexture3D");
+ glad_glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC) load(userptr, "glFramebufferTextureLayer");
+ glad_glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC) load(userptr, "glGenFramebuffers");
+ glad_glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC) load(userptr, "glGenRenderbuffers");
+ glad_glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC) load(userptr, "glGenVertexArrays");
+ glad_glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC) load(userptr, "glGenerateMipmap");
+ glad_glGetBooleani_v = (PFNGLGETBOOLEANI_VPROC) load(userptr, "glGetBooleani_v");
+ glad_glGetFragDataLocation = (PFNGLGETFRAGDATALOCATIONPROC) load(userptr, "glGetFragDataLocation");
+ glad_glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) load(userptr, "glGetFramebufferAttachmentParameteriv");
+ glad_glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC) load(userptr, "glGetIntegeri_v");
+ glad_glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC) load(userptr, "glGetRenderbufferParameteriv");
+ glad_glGetStringi = (PFNGLGETSTRINGIPROC) load(userptr, "glGetStringi");
+ glad_glGetTexParameterIiv = (PFNGLGETTEXPARAMETERIIVPROC) load(userptr, "glGetTexParameterIiv");
+ glad_glGetTexParameterIuiv = (PFNGLGETTEXPARAMETERIUIVPROC) load(userptr, "glGetTexParameterIuiv");
+ glad_glGetTransformFeedbackVarying = (PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) load(userptr, "glGetTransformFeedbackVarying");
+ glad_glGetUniformuiv = (PFNGLGETUNIFORMUIVPROC) load(userptr, "glGetUniformuiv");
+ glad_glGetVertexAttribIiv = (PFNGLGETVERTEXATTRIBIIVPROC) load(userptr, "glGetVertexAttribIiv");
+ glad_glGetVertexAttribIuiv = (PFNGLGETVERTEXATTRIBIUIVPROC) load(userptr, "glGetVertexAttribIuiv");
+ glad_glIsEnabledi = (PFNGLISENABLEDIPROC) load(userptr, "glIsEnabledi");
+ glad_glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC) load(userptr, "glIsFramebuffer");
+ glad_glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC) load(userptr, "glIsRenderbuffer");
+ glad_glIsVertexArray = (PFNGLISVERTEXARRAYPROC) load(userptr, "glIsVertexArray");
+ glad_glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC) load(userptr, "glMapBufferRange");
+ glad_glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC) load(userptr, "glRenderbufferStorage");
+ glad_glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) load(userptr, "glRenderbufferStorageMultisample");
+ glad_glTexParameterIiv = (PFNGLTEXPARAMETERIIVPROC) load(userptr, "glTexParameterIiv");
+ glad_glTexParameterIuiv = (PFNGLTEXPARAMETERIUIVPROC) load(userptr, "glTexParameterIuiv");
+ glad_glTransformFeedbackVaryings = (PFNGLTRANSFORMFEEDBACKVARYINGSPROC) load(userptr, "glTransformFeedbackVaryings");
+ glad_glUniform1ui = (PFNGLUNIFORM1UIPROC) load(userptr, "glUniform1ui");
+ glad_glUniform1uiv = (PFNGLUNIFORM1UIVPROC) load(userptr, "glUniform1uiv");
+ glad_glUniform2ui = (PFNGLUNIFORM2UIPROC) load(userptr, "glUniform2ui");
+ glad_glUniform2uiv = (PFNGLUNIFORM2UIVPROC) load(userptr, "glUniform2uiv");
+ glad_glUniform3ui = (PFNGLUNIFORM3UIPROC) load(userptr, "glUniform3ui");
+ glad_glUniform3uiv = (PFNGLUNIFORM3UIVPROC) load(userptr, "glUniform3uiv");
+ glad_glUniform4ui = (PFNGLUNIFORM4UIPROC) load(userptr, "glUniform4ui");
+ glad_glUniform4uiv = (PFNGLUNIFORM4UIVPROC) load(userptr, "glUniform4uiv");
+ glad_glVertexAttribI1i = (PFNGLVERTEXATTRIBI1IPROC) load(userptr, "glVertexAttribI1i");
+ glad_glVertexAttribI1iv = (PFNGLVERTEXATTRIBI1IVPROC) load(userptr, "glVertexAttribI1iv");
+ glad_glVertexAttribI1ui = (PFNGLVERTEXATTRIBI1UIPROC) load(userptr, "glVertexAttribI1ui");
+ glad_glVertexAttribI1uiv = (PFNGLVERTEXATTRIBI1UIVPROC) load(userptr, "glVertexAttribI1uiv");
+ glad_glVertexAttribI2i = (PFNGLVERTEXATTRIBI2IPROC) load(userptr, "glVertexAttribI2i");
+ glad_glVertexAttribI2iv = (PFNGLVERTEXATTRIBI2IVPROC) load(userptr, "glVertexAttribI2iv");
+ glad_glVertexAttribI2ui = (PFNGLVERTEXATTRIBI2UIPROC) load(userptr, "glVertexAttribI2ui");
+ glad_glVertexAttribI2uiv = (PFNGLVERTEXATTRIBI2UIVPROC) load(userptr, "glVertexAttribI2uiv");
+ glad_glVertexAttribI3i = (PFNGLVERTEXATTRIBI3IPROC) load(userptr, "glVertexAttribI3i");
+ glad_glVertexAttribI3iv = (PFNGLVERTEXATTRIBI3IVPROC) load(userptr, "glVertexAttribI3iv");
+ glad_glVertexAttribI3ui = (PFNGLVERTEXATTRIBI3UIPROC) load(userptr, "glVertexAttribI3ui");
+ glad_glVertexAttribI3uiv = (PFNGLVERTEXATTRIBI3UIVPROC) load(userptr, "glVertexAttribI3uiv");
+ glad_glVertexAttribI4bv = (PFNGLVERTEXATTRIBI4BVPROC) load(userptr, "glVertexAttribI4bv");
+ glad_glVertexAttribI4i = (PFNGLVERTEXATTRIBI4IPROC) load(userptr, "glVertexAttribI4i");
+ glad_glVertexAttribI4iv = (PFNGLVERTEXATTRIBI4IVPROC) load(userptr, "glVertexAttribI4iv");
+ glad_glVertexAttribI4sv = (PFNGLVERTEXATTRIBI4SVPROC) load(userptr, "glVertexAttribI4sv");
+ glad_glVertexAttribI4ubv = (PFNGLVERTEXATTRIBI4UBVPROC) load(userptr, "glVertexAttribI4ubv");
+ glad_glVertexAttribI4ui = (PFNGLVERTEXATTRIBI4UIPROC) load(userptr, "glVertexAttribI4ui");
+ glad_glVertexAttribI4uiv = (PFNGLVERTEXATTRIBI4UIVPROC) load(userptr, "glVertexAttribI4uiv");
+ glad_glVertexAttribI4usv = (PFNGLVERTEXATTRIBI4USVPROC) load(userptr, "glVertexAttribI4usv");
+ glad_glVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC) load(userptr, "glVertexAttribIPointer");
+}
+static void glad_gl_load_GL_VERSION_3_1( GLADuserptrloadfunc load, void* userptr) {
+ if(!GLAD_GL_VERSION_3_1) return;
+ glad_glBindBufferBase = (PFNGLBINDBUFFERBASEPROC) load(userptr, "glBindBufferBase");
+ glad_glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC) load(userptr, "glBindBufferRange");
+ glad_glCopyBufferSubData = (PFNGLCOPYBUFFERSUBDATAPROC) load(userptr, "glCopyBufferSubData");
+ glad_glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDPROC) load(userptr, "glDrawArraysInstanced");
+ glad_glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDPROC) load(userptr, "glDrawElementsInstanced");
+ glad_glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) load(userptr, "glGetActiveUniformBlockName");
+ glad_glGetActiveUniformBlockiv = (PFNGLGETACTIVEUNIFORMBLOCKIVPROC) load(userptr, "glGetActiveUniformBlockiv");
+ glad_glGetActiveUniformName = (PFNGLGETACTIVEUNIFORMNAMEPROC) load(userptr, "glGetActiveUniformName");
+ glad_glGetActiveUniformsiv = (PFNGLGETACTIVEUNIFORMSIVPROC) load(userptr, "glGetActiveUniformsiv");
+ glad_glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC) load(userptr, "glGetIntegeri_v");
+ glad_glGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC) load(userptr, "glGetUniformBlockIndex");
+ glad_glGetUniformIndices = (PFNGLGETUNIFORMINDICESPROC) load(userptr, "glGetUniformIndices");
+ glad_glPrimitiveRestartIndex = (PFNGLPRIMITIVERESTARTINDEXPROC) load(userptr, "glPrimitiveRestartIndex");
+ glad_glTexBuffer = (PFNGLTEXBUFFERPROC) load(userptr, "glTexBuffer");
+ glad_glUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC) load(userptr, "glUniformBlockBinding");
+}
+static void glad_gl_load_GL_VERSION_3_2( GLADuserptrloadfunc load, void* userptr) {
+ if(!GLAD_GL_VERSION_3_2) return;
+ glad_glClientWaitSync = (PFNGLCLIENTWAITSYNCPROC) load(userptr, "glClientWaitSync");
+ glad_glDeleteSync = (PFNGLDELETESYNCPROC) load(userptr, "glDeleteSync");
+ glad_glDrawElementsBaseVertex = (PFNGLDRAWELEMENTSBASEVERTEXPROC) load(userptr, "glDrawElementsBaseVertex");
+ glad_glDrawElementsInstancedBaseVertex = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) load(userptr, "glDrawElementsInstancedBaseVertex");
+ glad_glDrawRangeElementsBaseVertex = (PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) load(userptr, "glDrawRangeElementsBaseVertex");
+ glad_glFenceSync = (PFNGLFENCESYNCPROC) load(userptr, "glFenceSync");
+ glad_glFramebufferTexture = (PFNGLFRAMEBUFFERTEXTUREPROC) load(userptr, "glFramebufferTexture");
+ glad_glGetBufferParameteri64v = (PFNGLGETBUFFERPARAMETERI64VPROC) load(userptr, "glGetBufferParameteri64v");
+ glad_glGetInteger64i_v = (PFNGLGETINTEGER64I_VPROC) load(userptr, "glGetInteger64i_v");
+ glad_glGetInteger64v = (PFNGLGETINTEGER64VPROC) load(userptr, "glGetInteger64v");
+ glad_glGetMultisamplefv = (PFNGLGETMULTISAMPLEFVPROC) load(userptr, "glGetMultisamplefv");
+ glad_glGetSynciv = (PFNGLGETSYNCIVPROC) load(userptr, "glGetSynciv");
+ glad_glIsSync = (PFNGLISSYNCPROC) load(userptr, "glIsSync");
+ glad_glMultiDrawElementsBaseVertex = (PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) load(userptr, "glMultiDrawElementsBaseVertex");
+ glad_glProvokingVertex = (PFNGLPROVOKINGVERTEXPROC) load(userptr, "glProvokingVertex");
+ glad_glSampleMaski = (PFNGLSAMPLEMASKIPROC) load(userptr, "glSampleMaski");
+ glad_glTexImage2DMultisample = (PFNGLTEXIMAGE2DMULTISAMPLEPROC) load(userptr, "glTexImage2DMultisample");
+ glad_glTexImage3DMultisample = (PFNGLTEXIMAGE3DMULTISAMPLEPROC) load(userptr, "glTexImage3DMultisample");
+ glad_glWaitSync = (PFNGLWAITSYNCPROC) load(userptr, "glWaitSync");
+}
+static void glad_gl_load_GL_VERSION_3_3( GLADuserptrloadfunc load, void* userptr) {
+ if(!GLAD_GL_VERSION_3_3) return;
+ glad_glBindFragDataLocationIndexed = (PFNGLBINDFRAGDATALOCATIONINDEXEDPROC) load(userptr, "glBindFragDataLocationIndexed");
+ glad_glBindSampler = (PFNGLBINDSAMPLERPROC) load(userptr, "glBindSampler");
+ glad_glColorP3ui = (PFNGLCOLORP3UIPROC) load(userptr, "glColorP3ui");
+ glad_glColorP3uiv = (PFNGLCOLORP3UIVPROC) load(userptr, "glColorP3uiv");
+ glad_glColorP4ui = (PFNGLCOLORP4UIPROC) load(userptr, "glColorP4ui");
+ glad_glColorP4uiv = (PFNGLCOLORP4UIVPROC) load(userptr, "glColorP4uiv");
+ glad_glDeleteSamplers = (PFNGLDELETESAMPLERSPROC) load(userptr, "glDeleteSamplers");
+ glad_glGenSamplers = (PFNGLGENSAMPLERSPROC) load(userptr, "glGenSamplers");
+ glad_glGetFragDataIndex = (PFNGLGETFRAGDATAINDEXPROC) load(userptr, "glGetFragDataIndex");
+ glad_glGetQueryObjecti64v = (PFNGLGETQUERYOBJECTI64VPROC) load(userptr, "glGetQueryObjecti64v");
+ glad_glGetQueryObjectui64v = (PFNGLGETQUERYOBJECTUI64VPROC) load(userptr, "glGetQueryObjectui64v");
+ glad_glGetSamplerParameterIiv = (PFNGLGETSAMPLERPARAMETERIIVPROC) load(userptr, "glGetSamplerParameterIiv");
+ glad_glGetSamplerParameterIuiv = (PFNGLGETSAMPLERPARAMETERIUIVPROC) load(userptr, "glGetSamplerParameterIuiv");
+ glad_glGetSamplerParameterfv = (PFNGLGETSAMPLERPARAMETERFVPROC) load(userptr, "glGetSamplerParameterfv");
+ glad_glGetSamplerParameteriv = (PFNGLGETSAMPLERPARAMETERIVPROC) load(userptr, "glGetSamplerParameteriv");
+ glad_glIsSampler = (PFNGLISSAMPLERPROC) load(userptr, "glIsSampler");
+ glad_glMultiTexCoordP1ui = (PFNGLMULTITEXCOORDP1UIPROC) load(userptr, "glMultiTexCoordP1ui");
+ glad_glMultiTexCoordP1uiv = (PFNGLMULTITEXCOORDP1UIVPROC) load(userptr, "glMultiTexCoordP1uiv");
+ glad_glMultiTexCoordP2ui = (PFNGLMULTITEXCOORDP2UIPROC) load(userptr, "glMultiTexCoordP2ui");
+ glad_glMultiTexCoordP2uiv = (PFNGLMULTITEXCOORDP2UIVPROC) load(userptr, "glMultiTexCoordP2uiv");
+ glad_glMultiTexCoordP3ui = (PFNGLMULTITEXCOORDP3UIPROC) load(userptr, "glMultiTexCoordP3ui");
+ glad_glMultiTexCoordP3uiv = (PFNGLMULTITEXCOORDP3UIVPROC) load(userptr, "glMultiTexCoordP3uiv");
+ glad_glMultiTexCoordP4ui = (PFNGLMULTITEXCOORDP4UIPROC) load(userptr, "glMultiTexCoordP4ui");
+ glad_glMultiTexCoordP4uiv = (PFNGLMULTITEXCOORDP4UIVPROC) load(userptr, "glMultiTexCoordP4uiv");
+ glad_glNormalP3ui = (PFNGLNORMALP3UIPROC) load(userptr, "glNormalP3ui");
+ glad_glNormalP3uiv = (PFNGLNORMALP3UIVPROC) load(userptr, "glNormalP3uiv");
+ glad_glQueryCounter = (PFNGLQUERYCOUNTERPROC) load(userptr, "glQueryCounter");
+ glad_glSamplerParameterIiv = (PFNGLSAMPLERPARAMETERIIVPROC) load(userptr, "glSamplerParameterIiv");
+ glad_glSamplerParameterIuiv = (PFNGLSAMPLERPARAMETERIUIVPROC) load(userptr, "glSamplerParameterIuiv");
+ glad_glSamplerParameterf = (PFNGLSAMPLERPARAMETERFPROC) load(userptr, "glSamplerParameterf");
+ glad_glSamplerParameterfv = (PFNGLSAMPLERPARAMETERFVPROC) load(userptr, "glSamplerParameterfv");
+ glad_glSamplerParameteri = (PFNGLSAMPLERPARAMETERIPROC) load(userptr, "glSamplerParameteri");
+ glad_glSamplerParameteriv = (PFNGLSAMPLERPARAMETERIVPROC) load(userptr, "glSamplerParameteriv");
+ glad_glSecondaryColorP3ui = (PFNGLSECONDARYCOLORP3UIPROC) load(userptr, "glSecondaryColorP3ui");
+ glad_glSecondaryColorP3uiv = (PFNGLSECONDARYCOLORP3UIVPROC) load(userptr, "glSecondaryColorP3uiv");
+ glad_glTexCoordP1ui = (PFNGLTEXCOORDP1UIPROC) load(userptr, "glTexCoordP1ui");
+ glad_glTexCoordP1uiv = (PFNGLTEXCOORDP1UIVPROC) load(userptr, "glTexCoordP1uiv");
+ glad_glTexCoordP2ui = (PFNGLTEXCOORDP2UIPROC) load(userptr, "glTexCoordP2ui");
+ glad_glTexCoordP2uiv = (PFNGLTEXCOORDP2UIVPROC) load(userptr, "glTexCoordP2uiv");
+ glad_glTexCoordP3ui = (PFNGLTEXCOORDP3UIPROC) load(userptr, "glTexCoordP3ui");
+ glad_glTexCoordP3uiv = (PFNGLTEXCOORDP3UIVPROC) load(userptr, "glTexCoordP3uiv");
+ glad_glTexCoordP4ui = (PFNGLTEXCOORDP4UIPROC) load(userptr, "glTexCoordP4ui");
+ glad_glTexCoordP4uiv = (PFNGLTEXCOORDP4UIVPROC) load(userptr, "glTexCoordP4uiv");
+ glad_glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISORPROC) load(userptr, "glVertexAttribDivisor");
+ glad_glVertexAttribP1ui = (PFNGLVERTEXATTRIBP1UIPROC) load(userptr, "glVertexAttribP1ui");
+ glad_glVertexAttribP1uiv = (PFNGLVERTEXATTRIBP1UIVPROC) load(userptr, "glVertexAttribP1uiv");
+ glad_glVertexAttribP2ui = (PFNGLVERTEXATTRIBP2UIPROC) load(userptr, "glVertexAttribP2ui");
+ glad_glVertexAttribP2uiv = (PFNGLVERTEXATTRIBP2UIVPROC) load(userptr, "glVertexAttribP2uiv");
+ glad_glVertexAttribP3ui = (PFNGLVERTEXATTRIBP3UIPROC) load(userptr, "glVertexAttribP3ui");
+ glad_glVertexAttribP3uiv = (PFNGLVERTEXATTRIBP3UIVPROC) load(userptr, "glVertexAttribP3uiv");
+ glad_glVertexAttribP4ui = (PFNGLVERTEXATTRIBP4UIPROC) load(userptr, "glVertexAttribP4ui");
+ glad_glVertexAttribP4uiv = (PFNGLVERTEXATTRIBP4UIVPROC) load(userptr, "glVertexAttribP4uiv");
+ glad_glVertexP2ui = (PFNGLVERTEXP2UIPROC) load(userptr, "glVertexP2ui");
+ glad_glVertexP2uiv = (PFNGLVERTEXP2UIVPROC) load(userptr, "glVertexP2uiv");
+ glad_glVertexP3ui = (PFNGLVERTEXP3UIPROC) load(userptr, "glVertexP3ui");
+ glad_glVertexP3uiv = (PFNGLVERTEXP3UIVPROC) load(userptr, "glVertexP3uiv");
+ glad_glVertexP4ui = (PFNGLVERTEXP4UIPROC) load(userptr, "glVertexP4ui");
+ glad_glVertexP4uiv = (PFNGLVERTEXP4UIVPROC) load(userptr, "glVertexP4uiv");
+}
+static void glad_gl_load_GL_ARB_multisample( GLADuserptrloadfunc load, void* userptr) {
+ if(!GLAD_GL_ARB_multisample) return;
+ glad_glSampleCoverageARB = (PFNGLSAMPLECOVERAGEARBPROC) load(userptr, "glSampleCoverageARB");
+}
+static void glad_gl_load_GL_ARB_robustness( GLADuserptrloadfunc load, void* userptr) {
+ if(!GLAD_GL_ARB_robustness) return;
+ glad_glGetGraphicsResetStatusARB = (PFNGLGETGRAPHICSRESETSTATUSARBPROC) load(userptr, "glGetGraphicsResetStatusARB");
+ glad_glGetnColorTableARB = (PFNGLGETNCOLORTABLEARBPROC) load(userptr, "glGetnColorTableARB");
+ glad_glGetnCompressedTexImageARB = (PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC) load(userptr, "glGetnCompressedTexImageARB");
+ glad_glGetnConvolutionFilterARB = (PFNGLGETNCONVOLUTIONFILTERARBPROC) load(userptr, "glGetnConvolutionFilterARB");
+ glad_glGetnHistogramARB = (PFNGLGETNHISTOGRAMARBPROC) load(userptr, "glGetnHistogramARB");
+ glad_glGetnMapdvARB = (PFNGLGETNMAPDVARBPROC) load(userptr, "glGetnMapdvARB");
+ glad_glGetnMapfvARB = (PFNGLGETNMAPFVARBPROC) load(userptr, "glGetnMapfvARB");
+ glad_glGetnMapivARB = (PFNGLGETNMAPIVARBPROC) load(userptr, "glGetnMapivARB");
+ glad_glGetnMinmaxARB = (PFNGLGETNMINMAXARBPROC) load(userptr, "glGetnMinmaxARB");
+ glad_glGetnPixelMapfvARB = (PFNGLGETNPIXELMAPFVARBPROC) load(userptr, "glGetnPixelMapfvARB");
+ glad_glGetnPixelMapuivARB = (PFNGLGETNPIXELMAPUIVARBPROC) load(userptr, "glGetnPixelMapuivARB");
+ glad_glGetnPixelMapusvARB = (PFNGLGETNPIXELMAPUSVARBPROC) load(userptr, "glGetnPixelMapusvARB");
+ glad_glGetnPolygonStippleARB = (PFNGLGETNPOLYGONSTIPPLEARBPROC) load(userptr, "glGetnPolygonStippleARB");
+ glad_glGetnSeparableFilterARB = (PFNGLGETNSEPARABLEFILTERARBPROC) load(userptr, "glGetnSeparableFilterARB");
+ glad_glGetnTexImageARB = (PFNGLGETNTEXIMAGEARBPROC) load(userptr, "glGetnTexImageARB");
+ glad_glGetnUniformdvARB = (PFNGLGETNUNIFORMDVARBPROC) load(userptr, "glGetnUniformdvARB");
+ glad_glGetnUniformfvARB = (PFNGLGETNUNIFORMFVARBPROC) load(userptr, "glGetnUniformfvARB");
+ glad_glGetnUniformivARB = (PFNGLGETNUNIFORMIVARBPROC) load(userptr, "glGetnUniformivARB");
+ glad_glGetnUniformuivARB = (PFNGLGETNUNIFORMUIVARBPROC) load(userptr, "glGetnUniformuivARB");
+ glad_glReadnPixelsARB = (PFNGLREADNPIXELSARBPROC) load(userptr, "glReadnPixelsARB");
+}
+static void glad_gl_load_GL_KHR_debug( GLADuserptrloadfunc load, void* userptr) {
+ if(!GLAD_GL_KHR_debug) return;
+ glad_glDebugMessageCallback = (PFNGLDEBUGMESSAGECALLBACKPROC) load(userptr, "glDebugMessageCallback");
+ glad_glDebugMessageControl = (PFNGLDEBUGMESSAGECONTROLPROC) load(userptr, "glDebugMessageControl");
+ glad_glDebugMessageInsert = (PFNGLDEBUGMESSAGEINSERTPROC) load(userptr, "glDebugMessageInsert");
+ glad_glGetDebugMessageLog = (PFNGLGETDEBUGMESSAGELOGPROC) load(userptr, "glGetDebugMessageLog");
+ glad_glGetObjectLabel = (PFNGLGETOBJECTLABELPROC) load(userptr, "glGetObjectLabel");
+ glad_glGetObjectPtrLabel = (PFNGLGETOBJECTPTRLABELPROC) load(userptr, "glGetObjectPtrLabel");
+ glad_glGetPointerv = (PFNGLGETPOINTERVPROC) load(userptr, "glGetPointerv");
+ glad_glObjectLabel = (PFNGLOBJECTLABELPROC) load(userptr, "glObjectLabel");
+ glad_glObjectPtrLabel = (PFNGLOBJECTPTRLABELPROC) load(userptr, "glObjectPtrLabel");
+ glad_glPopDebugGroup = (PFNGLPOPDEBUGGROUPPROC) load(userptr, "glPopDebugGroup");
+ glad_glPushDebugGroup = (PFNGLPUSHDEBUGGROUPPROC) load(userptr, "glPushDebugGroup");
+}
+
+
+
+#if defined(GL_ES_VERSION_3_0) || defined(GL_VERSION_3_0)
+#define GLAD_GL_IS_SOME_NEW_VERSION 1
+#else
+#define GLAD_GL_IS_SOME_NEW_VERSION 0
+#endif
+
+static int glad_gl_get_extensions( int version, const char **out_exts, unsigned int *out_num_exts_i, char ***out_exts_i) {
+#if GLAD_GL_IS_SOME_NEW_VERSION
+ if(GLAD_VERSION_MAJOR(version) < 3) {
+#else
+ (void) version;
+ (void) out_num_exts_i;
+ (void) out_exts_i;
+#endif
+ if (glad_glGetString == NULL) {
+ return 0;
+ }
+ *out_exts = (const char *)glad_glGetString(GL_EXTENSIONS);
+#if GLAD_GL_IS_SOME_NEW_VERSION
+ } else {
+ unsigned int index = 0;
+ unsigned int num_exts_i = 0;
+ char **exts_i = NULL;
+ if (glad_glGetStringi == NULL || glad_glGetIntegerv == NULL) {
+ return 0;
+ }
+ glad_glGetIntegerv(GL_NUM_EXTENSIONS, (int*) &num_exts_i);
+ if (num_exts_i > 0) {
+ exts_i = (char **) malloc(num_exts_i * (sizeof *exts_i));
+ }
+ if (exts_i == NULL) {
+ return 0;
+ }
+ for(index = 0; index < num_exts_i; index++) {
+ const char *gl_str_tmp = (const char*) glad_glGetStringi(GL_EXTENSIONS, index);
+ size_t len = strlen(gl_str_tmp) + 1;
+
+ char *local_str = (char*) malloc(len * sizeof(char));
+ if(local_str != NULL) {
+ memcpy(local_str, gl_str_tmp, len * sizeof(char));
+ }
+
+ exts_i[index] = local_str;
+ }
+
+ *out_num_exts_i = num_exts_i;
+ *out_exts_i = exts_i;
+ }
+#endif
+ return 1;
+}
+static void glad_gl_free_extensions(char **exts_i, unsigned int num_exts_i) {
+ if (exts_i != NULL) {
+ unsigned int index;
+ for(index = 0; index < num_exts_i; index++) {
+ free((void *) (exts_i[index]));
+ }
+ free((void *)exts_i);
+ exts_i = NULL;
+ }
+}
+static int glad_gl_has_extension(int version, const char *exts, unsigned int num_exts_i, char **exts_i, const char *ext) {
+ if(GLAD_VERSION_MAJOR(version) < 3 || !GLAD_GL_IS_SOME_NEW_VERSION) {
+ const char *extensions;
+ const char *loc;
+ const char *terminator;
+ extensions = exts;
+ if(extensions == NULL || ext == NULL) {
+ return 0;
+ }
+ while(1) {
+ loc = strstr(extensions, ext);
+ if(loc == NULL) {
+ return 0;
+ }
+ terminator = loc + strlen(ext);
+ if((loc == extensions || *(loc - 1) == ' ') &&
+ (*terminator == ' ' || *terminator == '\0')) {
+ return 1;
+ }
+ extensions = terminator;
+ }
+ } else {
+ unsigned int index;
+ for(index = 0; index < num_exts_i; index++) {
+ const char *e = exts_i[index];
+ if(strcmp(e, ext) == 0) {
+ return 1;
+ }
+ }
+ }
+ return 0;
+}
+
+static GLADapiproc glad_gl_get_proc_from_userptr(void *userptr, const char* name) {
+ return (GLAD_GNUC_EXTENSION (GLADapiproc (*)(const char *name)) userptr)(name);
+}
+
+static int glad_gl_find_extensions_gl( int version) {
+ const char *exts = NULL;
+ unsigned int num_exts_i = 0;
+ char **exts_i = NULL;
+ if (!glad_gl_get_extensions(version, &exts, &num_exts_i, &exts_i)) return 0;
+
+ GLAD_GL_ARB_multisample = glad_gl_has_extension(version, exts, num_exts_i, exts_i, "GL_ARB_multisample");
+ GLAD_GL_ARB_robustness = glad_gl_has_extension(version, exts, num_exts_i, exts_i, "GL_ARB_robustness");
+ GLAD_GL_KHR_debug = glad_gl_has_extension(version, exts, num_exts_i, exts_i, "GL_KHR_debug");
+
+ glad_gl_free_extensions(exts_i, num_exts_i);
+
+ return 1;
+}
+
+static int glad_gl_find_core_gl(void) {
+ int i;
+ const char* version;
+ const char* prefixes[] = {
+ "OpenGL ES-CM ",
+ "OpenGL ES-CL ",
+ "OpenGL ES ",
+ "OpenGL SC ",
+ NULL
+ };
+ int major = 0;
+ int minor = 0;
+ version = (const char*) glad_glGetString(GL_VERSION);
+ if (!version) return 0;
+ for (i = 0; prefixes[i]; i++) {
+ const size_t length = strlen(prefixes[i]);
+ if (strncmp(version, prefixes[i], length) == 0) {
+ version += length;
+ break;
+ }
+ }
+
+ GLAD_IMPL_UTIL_SSCANF(version, "%d.%d", &major, &minor);
+
+ GLAD_GL_VERSION_1_0 = (major == 1 && minor >= 0) || major > 1;
+ GLAD_GL_VERSION_1_1 = (major == 1 && minor >= 1) || major > 1;
+ GLAD_GL_VERSION_1_2 = (major == 1 && minor >= 2) || major > 1;
+ GLAD_GL_VERSION_1_3 = (major == 1 && minor >= 3) || major > 1;
+ GLAD_GL_VERSION_1_4 = (major == 1 && minor >= 4) || major > 1;
+ GLAD_GL_VERSION_1_5 = (major == 1 && minor >= 5) || major > 1;
+ GLAD_GL_VERSION_2_0 = (major == 2 && minor >= 0) || major > 2;
+ GLAD_GL_VERSION_2_1 = (major == 2 && minor >= 1) || major > 2;
+ GLAD_GL_VERSION_3_0 = (major == 3 && minor >= 0) || major > 3;
+ GLAD_GL_VERSION_3_1 = (major == 3 && minor >= 1) || major > 3;
+ GLAD_GL_VERSION_3_2 = (major == 3 && minor >= 2) || major > 3;
+ GLAD_GL_VERSION_3_3 = (major == 3 && minor >= 3) || major > 3;
+
+ return GLAD_MAKE_VERSION(major, minor);
+}
+
+int gladLoadGLUserPtr( GLADuserptrloadfunc load, void *userptr) {
+ int version;
+
+ glad_glGetString = (PFNGLGETSTRINGPROC) load(userptr, "glGetString");
+ if(glad_glGetString == NULL) return 0;
+ if(glad_glGetString(GL_VERSION) == NULL) return 0;
+ version = glad_gl_find_core_gl();
+
+ glad_gl_load_GL_VERSION_1_0(load, userptr);
+ glad_gl_load_GL_VERSION_1_1(load, userptr);
+ glad_gl_load_GL_VERSION_1_2(load, userptr);
+ glad_gl_load_GL_VERSION_1_3(load, userptr);
+ glad_gl_load_GL_VERSION_1_4(load, userptr);
+ glad_gl_load_GL_VERSION_1_5(load, userptr);
+ glad_gl_load_GL_VERSION_2_0(load, userptr);
+ glad_gl_load_GL_VERSION_2_1(load, userptr);
+ glad_gl_load_GL_VERSION_3_0(load, userptr);
+ glad_gl_load_GL_VERSION_3_1(load, userptr);
+ glad_gl_load_GL_VERSION_3_2(load, userptr);
+ glad_gl_load_GL_VERSION_3_3(load, userptr);
+
+ if (!glad_gl_find_extensions_gl(version)) return 0;
+ glad_gl_load_GL_ARB_multisample(load, userptr);
+ glad_gl_load_GL_ARB_robustness(load, userptr);
+ glad_gl_load_GL_KHR_debug(load, userptr);
+
+
+
+ return version;
+}
+
+
+int gladLoadGL( GLADloadfunc load) {
+ return gladLoadGLUserPtr( glad_gl_get_proc_from_userptr, GLAD_GNUC_EXTENSION (void*) load);
+}
+
+
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GLAD_GL_IMPLEMENTATION */
+
diff --git a/external/GLFW/deps/glad/gles2.h b/external/GLFW/deps/glad/gles2.h
new file mode 100644
index 0000000..d67f110
--- /dev/null
+++ b/external/GLFW/deps/glad/gles2.h
@@ -0,0 +1,1805 @@
+/**
+ * Loader generated by glad 2.0.0-beta on Tue Aug 24 22:51:42 2021
+ *
+ * Generator: C/C++
+ * Specification: gl
+ * Extensions: 0
+ *
+ * APIs:
+ * - gles2=2.0
+ *
+ * Options:
+ * - ALIAS = False
+ * - DEBUG = False
+ * - HEADER_ONLY = True
+ * - LOADER = False
+ * - MX = False
+ * - MX_GLOBAL = False
+ * - ON_DEMAND = False
+ *
+ * Commandline:
+ * --api='gles2=2.0' --extensions='' c --header-only
+ *
+ * Online:
+ * http://glad.sh/#api=gles2%3D2.0&extensions=&generator=c&options=HEADER_ONLY
+ *
+ */
+
+#ifndef GLAD_GLES2_H_
+#define GLAD_GLES2_H_
+
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wreserved-id-macro"
+#endif
+#ifdef __gl2_h_
+ #error OpenGL ES 2 header already included (API: gles2), remove previous include!
+#endif
+#define __gl2_h_ 1
+#ifdef __gl3_h_
+ #error OpenGL ES 3 header already included (API: gles2), remove previous include!
+#endif
+#define __gl3_h_ 1
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+
+#define GLAD_GLES2
+#define GLAD_OPTION_GLES2_HEADER_ONLY
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef GLAD_PLATFORM_H_
+#define GLAD_PLATFORM_H_
+
+#ifndef GLAD_PLATFORM_WIN32
+ #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__MINGW32__)
+ #define GLAD_PLATFORM_WIN32 1
+ #else
+ #define GLAD_PLATFORM_WIN32 0
+ #endif
+#endif
+
+#ifndef GLAD_PLATFORM_APPLE
+ #ifdef __APPLE__
+ #define GLAD_PLATFORM_APPLE 1
+ #else
+ #define GLAD_PLATFORM_APPLE 0
+ #endif
+#endif
+
+#ifndef GLAD_PLATFORM_EMSCRIPTEN
+ #ifdef __EMSCRIPTEN__
+ #define GLAD_PLATFORM_EMSCRIPTEN 1
+ #else
+ #define GLAD_PLATFORM_EMSCRIPTEN 0
+ #endif
+#endif
+
+#ifndef GLAD_PLATFORM_UWP
+ #if defined(_MSC_VER) && !defined(GLAD_INTERNAL_HAVE_WINAPIFAMILY)
+ #ifdef __has_include
+ #if __has_include()
+ #define GLAD_INTERNAL_HAVE_WINAPIFAMILY 1
+ #endif
+ #elif _MSC_VER >= 1700 && !_USING_V110_SDK71_
+ #define GLAD_INTERNAL_HAVE_WINAPIFAMILY 1
+ #endif
+ #endif
+
+ #ifdef GLAD_INTERNAL_HAVE_WINAPIFAMILY
+ #include
+ #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
+ #define GLAD_PLATFORM_UWP 1
+ #endif
+ #endif
+
+ #ifndef GLAD_PLATFORM_UWP
+ #define GLAD_PLATFORM_UWP 0
+ #endif
+#endif
+
+#ifdef __GNUC__
+ #define GLAD_GNUC_EXTENSION __extension__
+#else
+ #define GLAD_GNUC_EXTENSION
+#endif
+
+#ifndef GLAD_API_CALL
+ #if defined(GLAD_API_CALL_EXPORT)
+ #if GLAD_PLATFORM_WIN32 || defined(__CYGWIN__)
+ #if defined(GLAD_API_CALL_EXPORT_BUILD)
+ #if defined(__GNUC__)
+ #define GLAD_API_CALL __attribute__ ((dllexport)) extern
+ #else
+ #define GLAD_API_CALL __declspec(dllexport) extern
+ #endif
+ #else
+ #if defined(__GNUC__)
+ #define GLAD_API_CALL __attribute__ ((dllimport)) extern
+ #else
+ #define GLAD_API_CALL __declspec(dllimport) extern
+ #endif
+ #endif
+ #elif defined(__GNUC__) && defined(GLAD_API_CALL_EXPORT_BUILD)
+ #define GLAD_API_CALL __attribute__ ((visibility ("default"))) extern
+ #else
+ #define GLAD_API_CALL extern
+ #endif
+ #else
+ #define GLAD_API_CALL extern
+ #endif
+#endif
+
+#ifdef APIENTRY
+ #define GLAD_API_PTR APIENTRY
+#elif GLAD_PLATFORM_WIN32
+ #define GLAD_API_PTR __stdcall
+#else
+ #define GLAD_API_PTR
+#endif
+
+#ifndef GLAPI
+#define GLAPI GLAD_API_CALL
+#endif
+
+#ifndef GLAPIENTRY
+#define GLAPIENTRY GLAD_API_PTR
+#endif
+
+#define GLAD_MAKE_VERSION(major, minor) (major * 10000 + minor)
+#define GLAD_VERSION_MAJOR(version) (version / 10000)
+#define GLAD_VERSION_MINOR(version) (version % 10000)
+
+#define GLAD_GENERATOR_VERSION "2.0.0-beta"
+
+typedef void (*GLADapiproc)(void);
+
+typedef GLADapiproc (*GLADloadfunc)(const char *name);
+typedef GLADapiproc (*GLADuserptrloadfunc)(void *userptr, const char *name);
+
+typedef void (*GLADprecallback)(const char *name, GLADapiproc apiproc, int len_args, ...);
+typedef void (*GLADpostcallback)(void *ret, const char *name, GLADapiproc apiproc, int len_args, ...);
+
+#endif /* GLAD_PLATFORM_H_ */
+
+#define GL_ACTIVE_ATTRIBUTES 0x8B89
+#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
+#define GL_ACTIVE_TEXTURE 0x84E0
+#define GL_ACTIVE_UNIFORMS 0x8B86
+#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
+#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
+#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
+#define GL_ALPHA 0x1906
+#define GL_ALPHA_BITS 0x0D55
+#define GL_ALWAYS 0x0207
+#define GL_ARRAY_BUFFER 0x8892
+#define GL_ARRAY_BUFFER_BINDING 0x8894
+#define GL_ATTACHED_SHADERS 0x8B85
+#define GL_BACK 0x0405
+#define GL_BLEND 0x0BE2
+#define GL_BLEND_COLOR 0x8005
+#define GL_BLEND_DST_ALPHA 0x80CA
+#define GL_BLEND_DST_RGB 0x80C8
+#define GL_BLEND_EQUATION 0x8009
+#define GL_BLEND_EQUATION_ALPHA 0x883D
+#define GL_BLEND_EQUATION_RGB 0x8009
+#define GL_BLEND_SRC_ALPHA 0x80CB
+#define GL_BLEND_SRC_RGB 0x80C9
+#define GL_BLUE_BITS 0x0D54
+#define GL_BOOL 0x8B56
+#define GL_BOOL_VEC2 0x8B57
+#define GL_BOOL_VEC3 0x8B58
+#define GL_BOOL_VEC4 0x8B59
+#define GL_BUFFER_SIZE 0x8764
+#define GL_BUFFER_USAGE 0x8765
+#define GL_BYTE 0x1400
+#define GL_CCW 0x0901
+#define GL_CLAMP_TO_EDGE 0x812F
+#define GL_COLOR_ATTACHMENT0 0x8CE0
+#define GL_COLOR_BUFFER_BIT 0x00004000
+#define GL_COLOR_CLEAR_VALUE 0x0C22
+#define GL_COLOR_WRITEMASK 0x0C23
+#define GL_COMPILE_STATUS 0x8B81
+#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
+#define GL_CONSTANT_ALPHA 0x8003
+#define GL_CONSTANT_COLOR 0x8001
+#define GL_CULL_FACE 0x0B44
+#define GL_CULL_FACE_MODE 0x0B45
+#define GL_CURRENT_PROGRAM 0x8B8D
+#define GL_CURRENT_VERTEX_ATTRIB 0x8626
+#define GL_CW 0x0900
+#define GL_DECR 0x1E03
+#define GL_DECR_WRAP 0x8508
+#define GL_DELETE_STATUS 0x8B80
+#define GL_DEPTH_ATTACHMENT 0x8D00
+#define GL_DEPTH_BITS 0x0D56
+#define GL_DEPTH_BUFFER_BIT 0x00000100
+#define GL_DEPTH_CLEAR_VALUE 0x0B73
+#define GL_DEPTH_COMPONENT 0x1902
+#define GL_DEPTH_COMPONENT16 0x81A5
+#define GL_DEPTH_FUNC 0x0B74
+#define GL_DEPTH_RANGE 0x0B70
+#define GL_DEPTH_TEST 0x0B71
+#define GL_DEPTH_WRITEMASK 0x0B72
+#define GL_DITHER 0x0BD0
+#define GL_DONT_CARE 0x1100
+#define GL_DST_ALPHA 0x0304
+#define GL_DST_COLOR 0x0306
+#define GL_DYNAMIC_DRAW 0x88E8
+#define GL_ELEMENT_ARRAY_BUFFER 0x8893
+#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
+#define GL_EQUAL 0x0202
+#define GL_EXTENSIONS 0x1F03
+#define GL_FALSE 0
+#define GL_FASTEST 0x1101
+#define GL_FIXED 0x140C
+#define GL_FLOAT 0x1406
+#define GL_FLOAT_MAT2 0x8B5A
+#define GL_FLOAT_MAT3 0x8B5B
+#define GL_FLOAT_MAT4 0x8B5C
+#define GL_FLOAT_VEC2 0x8B50
+#define GL_FLOAT_VEC3 0x8B51
+#define GL_FLOAT_VEC4 0x8B52
+#define GL_FRAGMENT_SHADER 0x8B30
+#define GL_FRAMEBUFFER 0x8D40
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
+#define GL_FRAMEBUFFER_BINDING 0x8CA6
+#define GL_FRAMEBUFFER_COMPLETE 0x8CD5
+#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
+#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9
+#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
+#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
+#define GL_FRONT 0x0404
+#define GL_FRONT_AND_BACK 0x0408
+#define GL_FRONT_FACE 0x0B46
+#define GL_FUNC_ADD 0x8006
+#define GL_FUNC_REVERSE_SUBTRACT 0x800B
+#define GL_FUNC_SUBTRACT 0x800A
+#define GL_GENERATE_MIPMAP_HINT 0x8192
+#define GL_GEQUAL 0x0206
+#define GL_GREATER 0x0204
+#define GL_GREEN_BITS 0x0D53
+#define GL_HIGH_FLOAT 0x8DF2
+#define GL_HIGH_INT 0x8DF5
+#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
+#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
+#define GL_INCR 0x1E02
+#define GL_INCR_WRAP 0x8507
+#define GL_INFO_LOG_LENGTH 0x8B84
+#define GL_INT 0x1404
+#define GL_INT_VEC2 0x8B53
+#define GL_INT_VEC3 0x8B54
+#define GL_INT_VEC4 0x8B55
+#define GL_INVALID_ENUM 0x0500
+#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
+#define GL_INVALID_OPERATION 0x0502
+#define GL_INVALID_VALUE 0x0501
+#define GL_INVERT 0x150A
+#define GL_KEEP 0x1E00
+#define GL_LEQUAL 0x0203
+#define GL_LESS 0x0201
+#define GL_LINEAR 0x2601
+#define GL_LINEAR_MIPMAP_LINEAR 0x2703
+#define GL_LINEAR_MIPMAP_NEAREST 0x2701
+#define GL_LINES 0x0001
+#define GL_LINE_LOOP 0x0002
+#define GL_LINE_STRIP 0x0003
+#define GL_LINE_WIDTH 0x0B21
+#define GL_LINK_STATUS 0x8B82
+#define GL_LOW_FLOAT 0x8DF0
+#define GL_LOW_INT 0x8DF3
+#define GL_LUMINANCE 0x1909
+#define GL_LUMINANCE_ALPHA 0x190A
+#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
+#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
+#define GL_MAX_RENDERBUFFER_SIZE 0x84E8
+#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
+#define GL_MAX_TEXTURE_SIZE 0x0D33
+#define GL_MAX_VARYING_VECTORS 0x8DFC
+#define GL_MAX_VERTEX_ATTRIBS 0x8869
+#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
+#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB
+#define GL_MAX_VIEWPORT_DIMS 0x0D3A
+#define GL_MEDIUM_FLOAT 0x8DF1
+#define GL_MEDIUM_INT 0x8DF4
+#define GL_MIRRORED_REPEAT 0x8370
+#define GL_NEAREST 0x2600
+#define GL_NEAREST_MIPMAP_LINEAR 0x2702
+#define GL_NEAREST_MIPMAP_NEAREST 0x2700
+#define GL_NEVER 0x0200
+#define GL_NICEST 0x1102
+#define GL_NONE 0
+#define GL_NOTEQUAL 0x0205
+#define GL_NO_ERROR 0
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
+#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9
+#define GL_ONE 1
+#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
+#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
+#define GL_ONE_MINUS_DST_ALPHA 0x0305
+#define GL_ONE_MINUS_DST_COLOR 0x0307
+#define GL_ONE_MINUS_SRC_ALPHA 0x0303
+#define GL_ONE_MINUS_SRC_COLOR 0x0301
+#define GL_OUT_OF_MEMORY 0x0505
+#define GL_PACK_ALIGNMENT 0x0D05
+#define GL_POINTS 0x0000
+#define GL_POLYGON_OFFSET_FACTOR 0x8038
+#define GL_POLYGON_OFFSET_FILL 0x8037
+#define GL_POLYGON_OFFSET_UNITS 0x2A00
+#define GL_RED_BITS 0x0D52
+#define GL_RENDERBUFFER 0x8D41
+#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
+#define GL_RENDERBUFFER_BINDING 0x8CA7
+#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52
+#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
+#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51
+#define GL_RENDERBUFFER_HEIGHT 0x8D43
+#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
+#define GL_RENDERBUFFER_RED_SIZE 0x8D50
+#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
+#define GL_RENDERBUFFER_WIDTH 0x8D42
+#define GL_RENDERER 0x1F01
+#define GL_REPEAT 0x2901
+#define GL_REPLACE 0x1E01
+#define GL_RGB 0x1907
+#define GL_RGB565 0x8D62
+#define GL_RGB5_A1 0x8057
+#define GL_RGBA 0x1908
+#define GL_RGBA4 0x8056
+#define GL_SAMPLER_2D 0x8B5E
+#define GL_SAMPLER_CUBE 0x8B60
+#define GL_SAMPLES 0x80A9
+#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
+#define GL_SAMPLE_BUFFERS 0x80A8
+#define GL_SAMPLE_COVERAGE 0x80A0
+#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
+#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
+#define GL_SCISSOR_BOX 0x0C10
+#define GL_SCISSOR_TEST 0x0C11
+#define GL_SHADER_BINARY_FORMATS 0x8DF8
+#define GL_SHADER_COMPILER 0x8DFA
+#define GL_SHADER_SOURCE_LENGTH 0x8B88
+#define GL_SHADER_TYPE 0x8B4F
+#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
+#define GL_SHORT 0x1402
+#define GL_SRC_ALPHA 0x0302
+#define GL_SRC_ALPHA_SATURATE 0x0308
+#define GL_SRC_COLOR 0x0300
+#define GL_STATIC_DRAW 0x88E4
+#define GL_STENCIL_ATTACHMENT 0x8D20
+#define GL_STENCIL_BACK_FAIL 0x8801
+#define GL_STENCIL_BACK_FUNC 0x8800
+#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
+#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
+#define GL_STENCIL_BACK_REF 0x8CA3
+#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
+#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
+#define GL_STENCIL_BITS 0x0D57
+#define GL_STENCIL_BUFFER_BIT 0x00000400
+#define GL_STENCIL_CLEAR_VALUE 0x0B91
+#define GL_STENCIL_FAIL 0x0B94
+#define GL_STENCIL_FUNC 0x0B92
+#define GL_STENCIL_INDEX8 0x8D48
+#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
+#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
+#define GL_STENCIL_REF 0x0B97
+#define GL_STENCIL_TEST 0x0B90
+#define GL_STENCIL_VALUE_MASK 0x0B93
+#define GL_STENCIL_WRITEMASK 0x0B98
+#define GL_STREAM_DRAW 0x88E0
+#define GL_SUBPIXEL_BITS 0x0D50
+#define GL_TEXTURE 0x1702
+#define GL_TEXTURE0 0x84C0
+#define GL_TEXTURE1 0x84C1
+#define GL_TEXTURE10 0x84CA
+#define GL_TEXTURE11 0x84CB
+#define GL_TEXTURE12 0x84CC
+#define GL_TEXTURE13 0x84CD
+#define GL_TEXTURE14 0x84CE
+#define GL_TEXTURE15 0x84CF
+#define GL_TEXTURE16 0x84D0
+#define GL_TEXTURE17 0x84D1
+#define GL_TEXTURE18 0x84D2
+#define GL_TEXTURE19 0x84D3
+#define GL_TEXTURE2 0x84C2
+#define GL_TEXTURE20 0x84D4
+#define GL_TEXTURE21 0x84D5
+#define GL_TEXTURE22 0x84D6
+#define GL_TEXTURE23 0x84D7
+#define GL_TEXTURE24 0x84D8
+#define GL_TEXTURE25 0x84D9
+#define GL_TEXTURE26 0x84DA
+#define GL_TEXTURE27 0x84DB
+#define GL_TEXTURE28 0x84DC
+#define GL_TEXTURE29 0x84DD
+#define GL_TEXTURE3 0x84C3
+#define GL_TEXTURE30 0x84DE
+#define GL_TEXTURE31 0x84DF
+#define GL_TEXTURE4 0x84C4
+#define GL_TEXTURE5 0x84C5
+#define GL_TEXTURE6 0x84C6
+#define GL_TEXTURE7 0x84C7
+#define GL_TEXTURE8 0x84C8
+#define GL_TEXTURE9 0x84C9
+#define GL_TEXTURE_2D 0x0DE1
+#define GL_TEXTURE_BINDING_2D 0x8069
+#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
+#define GL_TEXTURE_CUBE_MAP 0x8513
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
+#define GL_TEXTURE_MAG_FILTER 0x2800
+#define GL_TEXTURE_MIN_FILTER 0x2801
+#define GL_TEXTURE_WRAP_S 0x2802
+#define GL_TEXTURE_WRAP_T 0x2803
+#define GL_TRIANGLES 0x0004
+#define GL_TRIANGLE_FAN 0x0006
+#define GL_TRIANGLE_STRIP 0x0005
+#define GL_TRUE 1
+#define GL_UNPACK_ALIGNMENT 0x0CF5
+#define GL_UNSIGNED_BYTE 0x1401
+#define GL_UNSIGNED_INT 0x1405
+#define GL_UNSIGNED_SHORT 0x1403
+#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
+#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
+#define GL_UNSIGNED_SHORT_5_6_5 0x8363
+#define GL_VALIDATE_STATUS 0x8B83
+#define GL_VENDOR 0x1F00
+#define GL_VERSION 0x1F02
+#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
+#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
+#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
+#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
+#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
+#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
+#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
+#define GL_VERTEX_SHADER 0x8B31
+#define GL_VIEWPORT 0x0BA2
+#define GL_ZERO 0
+
+
+#ifndef __khrplatform_h_
+#define __khrplatform_h_
+
+/*
+** Copyright (c) 2008-2018 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+
+/* Khronos platform-specific types and definitions.
+ *
+ * The master copy of khrplatform.h is maintained in the Khronos EGL
+ * Registry repository at https://github.com/KhronosGroup/EGL-Registry
+ * The last semantic modification to khrplatform.h was at commit ID:
+ * 67a3e0864c2d75ea5287b9f3d2eb74a745936692
+ *
+ * Adopters may modify this file to suit their platform. Adopters are
+ * encouraged to submit platform specific modifications to the Khronos
+ * group so that they can be included in future versions of this file.
+ * Please submit changes by filing pull requests or issues on
+ * the EGL Registry repository linked above.
+ *
+ *
+ * See the Implementer's Guidelines for information about where this file
+ * should be located on your system and for more details of its use:
+ * http://www.khronos.org/registry/implementers_guide.pdf
+ *
+ * This file should be included as
+ * #include
+ * by Khronos client API header files that use its types and defines.
+ *
+ * The types in khrplatform.h should only be used to define API-specific types.
+ *
+ * Types defined in khrplatform.h:
+ * khronos_int8_t signed 8 bit
+ * khronos_uint8_t unsigned 8 bit
+ * khronos_int16_t signed 16 bit
+ * khronos_uint16_t unsigned 16 bit
+ * khronos_int32_t signed 32 bit
+ * khronos_uint32_t unsigned 32 bit
+ * khronos_int64_t signed 64 bit
+ * khronos_uint64_t unsigned 64 bit
+ * khronos_intptr_t signed same number of bits as a pointer
+ * khronos_uintptr_t unsigned same number of bits as a pointer
+ * khronos_ssize_t signed size
+ * khronos_usize_t unsigned size
+ * khronos_float_t signed 32 bit floating point
+ * khronos_time_ns_t unsigned 64 bit time in nanoseconds
+ * khronos_utime_nanoseconds_t unsigned time interval or absolute time in
+ * nanoseconds
+ * khronos_stime_nanoseconds_t signed time interval in nanoseconds
+ * khronos_boolean_enum_t enumerated boolean type. This should
+ * only be used as a base type when a client API's boolean type is
+ * an enum. Client APIs which use an integer or other type for
+ * booleans cannot use this as the base type for their boolean.
+ *
+ * Tokens defined in khrplatform.h:
+ *
+ * KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values.
+ *
+ * KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0.
+ * KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0.
+ *
+ * Calling convention macros defined in this file:
+ * KHRONOS_APICALL
+ * KHRONOS_GLAD_API_PTR
+ * KHRONOS_APIATTRIBUTES
+ *
+ * These may be used in function prototypes as:
+ *
+ * KHRONOS_APICALL void KHRONOS_GLAD_API_PTR funcname(
+ * int arg1,
+ * int arg2) KHRONOS_APIATTRIBUTES;
+ */
+
+#if defined(__SCITECH_SNAP__) && !defined(KHRONOS_STATIC)
+# define KHRONOS_STATIC 1
+#endif
+
+/*-------------------------------------------------------------------------
+ * Definition of KHRONOS_APICALL
+ *-------------------------------------------------------------------------
+ * This precedes the return type of the function in the function prototype.
+ */
+#if defined(KHRONOS_STATIC)
+ /* If the preprocessor constant KHRONOS_STATIC is defined, make the
+ * header compatible with static linking. */
+# define KHRONOS_APICALL
+#elif defined(_WIN32)
+# define KHRONOS_APICALL __declspec(dllimport)
+#elif defined (__SYMBIAN32__)
+# define KHRONOS_APICALL IMPORT_C
+#elif defined(__ANDROID__)
+# define KHRONOS_APICALL __attribute__((visibility("default")))
+#else
+# define KHRONOS_APICALL
+#endif
+
+/*-------------------------------------------------------------------------
+ * Definition of KHRONOS_GLAD_API_PTR
+ *-------------------------------------------------------------------------
+ * This follows the return type of the function and precedes the function
+ * name in the function prototype.
+ */
+#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__)
+ /* Win32 but not WinCE */
+# define KHRONOS_GLAD_API_PTR __stdcall
+#else
+# define KHRONOS_GLAD_API_PTR
+#endif
+
+/*-------------------------------------------------------------------------
+ * Definition of KHRONOS_APIATTRIBUTES
+ *-------------------------------------------------------------------------
+ * This follows the closing parenthesis of the function prototype arguments.
+ */
+#if defined (__ARMCC_2__)
+#define KHRONOS_APIATTRIBUTES __softfp
+#else
+#define KHRONOS_APIATTRIBUTES
+#endif
+
+/*-------------------------------------------------------------------------
+ * basic type definitions
+ *-----------------------------------------------------------------------*/
+#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__)
+
+
+/*
+ * Using
+ */
+#include
+typedef int32_t khronos_int32_t;
+typedef uint32_t khronos_uint32_t;
+typedef int64_t khronos_int64_t;
+typedef uint64_t khronos_uint64_t;
+#define KHRONOS_SUPPORT_INT64 1
+#define KHRONOS_SUPPORT_FLOAT 1
+
+#elif defined(__VMS ) || defined(__sgi)
+
+/*
+ * Using
+ */
+#include
+typedef int32_t khronos_int32_t;
+typedef uint32_t khronos_uint32_t;
+typedef int64_t khronos_int64_t;
+typedef uint64_t khronos_uint64_t;
+#define KHRONOS_SUPPORT_INT64 1
+#define KHRONOS_SUPPORT_FLOAT 1
+
+#elif defined(_WIN32) && !defined(__SCITECH_SNAP__)
+
+/*
+ * Win32
+ */
+typedef __int32 khronos_int32_t;
+typedef unsigned __int32 khronos_uint32_t;
+typedef __int64 khronos_int64_t;
+typedef unsigned __int64 khronos_uint64_t;
+#define KHRONOS_SUPPORT_INT64 1
+#define KHRONOS_SUPPORT_FLOAT 1
+
+#elif defined(__sun__) || defined(__digital__)
+
+/*
+ * Sun or Digital
+ */
+typedef int khronos_int32_t;
+typedef unsigned int khronos_uint32_t;
+#if defined(__arch64__) || defined(_LP64)
+typedef long int khronos_int64_t;
+typedef unsigned long int khronos_uint64_t;
+#else
+typedef long long int khronos_int64_t;
+typedef unsigned long long int khronos_uint64_t;
+#endif /* __arch64__ */
+#define KHRONOS_SUPPORT_INT64 1
+#define KHRONOS_SUPPORT_FLOAT 1
+
+#elif 0
+
+/*
+ * Hypothetical platform with no float or int64 support
+ */
+typedef int khronos_int32_t;
+typedef unsigned int khronos_uint32_t;
+#define KHRONOS_SUPPORT_INT64 0
+#define KHRONOS_SUPPORT_FLOAT 0
+
+#else
+
+/*
+ * Generic fallback
+ */
+#include
+typedef int32_t khronos_int32_t;
+typedef uint32_t khronos_uint32_t;
+typedef int64_t khronos_int64_t;
+typedef uint64_t khronos_uint64_t;
+#define KHRONOS_SUPPORT_INT64 1
+#define KHRONOS_SUPPORT_FLOAT 1
+
+#endif
+
+
+/*
+ * Types that are (so far) the same on all platforms
+ */
+typedef signed char khronos_int8_t;
+typedef unsigned char khronos_uint8_t;
+typedef signed short int khronos_int16_t;
+typedef unsigned short int khronos_uint16_t;
+
+/*
+ * Types that differ between LLP64 and LP64 architectures - in LLP64,
+ * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
+ * to be the only LLP64 architecture in current use.
+ */
+#ifdef _WIN64
+typedef signed long long int khronos_intptr_t;
+typedef unsigned long long int khronos_uintptr_t;
+typedef signed long long int khronos_ssize_t;
+typedef unsigned long long int khronos_usize_t;
+#else
+typedef signed long int khronos_intptr_t;
+typedef unsigned long int khronos_uintptr_t;
+typedef signed long int khronos_ssize_t;
+typedef unsigned long int khronos_usize_t;
+#endif
+
+#if KHRONOS_SUPPORT_FLOAT
+/*
+ * Float type
+ */
+typedef float khronos_float_t;
+#endif
+
+#if KHRONOS_SUPPORT_INT64
+/* Time types
+ *
+ * These types can be used to represent a time interval in nanoseconds or
+ * an absolute Unadjusted System Time. Unadjusted System Time is the number
+ * of nanoseconds since some arbitrary system event (e.g. since the last
+ * time the system booted). The Unadjusted System Time is an unsigned
+ * 64 bit value that wraps back to 0 every 584 years. Time intervals
+ * may be either signed or unsigned.
+ */
+typedef khronos_uint64_t khronos_utime_nanoseconds_t;
+typedef khronos_int64_t khronos_stime_nanoseconds_t;
+#endif
+
+/*
+ * Dummy value used to pad enum types to 32 bits.
+ */
+#ifndef KHRONOS_MAX_ENUM
+#define KHRONOS_MAX_ENUM 0x7FFFFFFF
+#endif
+
+/*
+ * Enumerated boolean type
+ *
+ * Values other than zero should be considered to be true. Therefore
+ * comparisons should not be made against KHRONOS_TRUE.
+ */
+typedef enum {
+ KHRONOS_FALSE = 0,
+ KHRONOS_TRUE = 1,
+ KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM
+} khronos_boolean_enum_t;
+
+#endif /* __khrplatform_h_ */
+
+typedef unsigned int GLenum;
+
+typedef unsigned char GLboolean;
+
+typedef unsigned int GLbitfield;
+
+typedef void GLvoid;
+
+typedef khronos_int8_t GLbyte;
+
+typedef khronos_uint8_t GLubyte;
+
+typedef khronos_int16_t GLshort;
+
+typedef khronos_uint16_t GLushort;
+
+typedef int GLint;
+
+typedef unsigned int GLuint;
+
+typedef khronos_int32_t GLclampx;
+
+typedef int GLsizei;
+
+typedef khronos_float_t GLfloat;
+
+typedef khronos_float_t GLclampf;
+
+typedef double GLdouble;
+
+typedef double GLclampd;
+
+typedef void *GLeglClientBufferEXT;
+
+typedef void *GLeglImageOES;
+
+typedef char GLchar;
+
+typedef char GLcharARB;
+
+#ifdef __APPLE__
+typedef void *GLhandleARB;
+#else
+typedef unsigned int GLhandleARB;
+#endif
+
+typedef khronos_uint16_t GLhalf;
+
+typedef khronos_uint16_t GLhalfARB;
+
+typedef khronos_int32_t GLfixed;
+
+#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
+typedef khronos_intptr_t GLintptr;
+#else
+typedef khronos_intptr_t GLintptr;
+#endif
+
+#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
+typedef khronos_intptr_t GLintptrARB;
+#else
+typedef khronos_intptr_t GLintptrARB;
+#endif
+
+#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
+typedef khronos_ssize_t GLsizeiptr;
+#else
+typedef khronos_ssize_t GLsizeiptr;
+#endif
+
+#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ > 1060)
+typedef khronos_ssize_t GLsizeiptrARB;
+#else
+typedef khronos_ssize_t GLsizeiptrARB;
+#endif
+
+typedef khronos_int64_t GLint64;
+
+typedef khronos_int64_t GLint64EXT;
+
+typedef khronos_uint64_t GLuint64;
+
+typedef khronos_uint64_t GLuint64EXT;
+
+typedef struct __GLsync *GLsync;
+
+struct _cl_context;
+
+struct _cl_event;
+
+typedef void (GLAD_API_PTR *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
+
+typedef void (GLAD_API_PTR *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
+
+typedef void (GLAD_API_PTR *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam);
+
+typedef void (GLAD_API_PTR *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,void *userParam);
+
+typedef unsigned short GLhalfNV;
+
+typedef GLintptr GLvdpauSurfaceNV;
+
+typedef void (GLAD_API_PTR *GLVULKANPROCNV)(void);
+
+
+
+#define GL_ES_VERSION_2_0 1
+GLAD_API_CALL int GLAD_GL_ES_VERSION_2_0;
+
+
+typedef void (GLAD_API_PTR *PFNGLACTIVETEXTUREPROC)(GLenum texture);
+typedef void (GLAD_API_PTR *PFNGLATTACHSHADERPROC)(GLuint program, GLuint shader);
+typedef void (GLAD_API_PTR *PFNGLBINDATTRIBLOCATIONPROC)(GLuint program, GLuint index, const GLchar * name);
+typedef void (GLAD_API_PTR *PFNGLBINDBUFFERPROC)(GLenum target, GLuint buffer);
+typedef void (GLAD_API_PTR *PFNGLBINDFRAMEBUFFERPROC)(GLenum target, GLuint framebuffer);
+typedef void (GLAD_API_PTR *PFNGLBINDRENDERBUFFERPROC)(GLenum target, GLuint renderbuffer);
+typedef void (GLAD_API_PTR *PFNGLBINDTEXTUREPROC)(GLenum target, GLuint texture);
+typedef void (GLAD_API_PTR *PFNGLBLENDCOLORPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+typedef void (GLAD_API_PTR *PFNGLBLENDEQUATIONPROC)(GLenum mode);
+typedef void (GLAD_API_PTR *PFNGLBLENDEQUATIONSEPARATEPROC)(GLenum modeRGB, GLenum modeAlpha);
+typedef void (GLAD_API_PTR *PFNGLBLENDFUNCPROC)(GLenum sfactor, GLenum dfactor);
+typedef void (GLAD_API_PTR *PFNGLBLENDFUNCSEPARATEPROC)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
+typedef void (GLAD_API_PTR *PFNGLBUFFERDATAPROC)(GLenum target, GLsizeiptr size, const void * data, GLenum usage);
+typedef void (GLAD_API_PTR *PFNGLBUFFERSUBDATAPROC)(GLenum target, GLintptr offset, GLsizeiptr size, const void * data);
+typedef GLenum (GLAD_API_PTR *PFNGLCHECKFRAMEBUFFERSTATUSPROC)(GLenum target);
+typedef void (GLAD_API_PTR *PFNGLCLEARPROC)(GLbitfield mask);
+typedef void (GLAD_API_PTR *PFNGLCLEARCOLORPROC)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+typedef void (GLAD_API_PTR *PFNGLCLEARDEPTHFPROC)(GLfloat d);
+typedef void (GLAD_API_PTR *PFNGLCLEARSTENCILPROC)(GLint s);
+typedef void (GLAD_API_PTR *PFNGLCOLORMASKPROC)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+typedef void (GLAD_API_PTR *PFNGLCOMPILESHADERPROC)(GLuint shader);
+typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXIMAGE2DPROC)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void * data);
+typedef void (GLAD_API_PTR *PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void * data);
+typedef void (GLAD_API_PTR *PFNGLCOPYTEXIMAGE2DPROC)(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+typedef void (GLAD_API_PTR *PFNGLCOPYTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef GLuint (GLAD_API_PTR *PFNGLCREATEPROGRAMPROC)(void);
+typedef GLuint (GLAD_API_PTR *PFNGLCREATESHADERPROC)(GLenum type);
+typedef void (GLAD_API_PTR *PFNGLCULLFACEPROC)(GLenum mode);
+typedef void (GLAD_API_PTR *PFNGLDELETEBUFFERSPROC)(GLsizei n, const GLuint * buffers);
+typedef void (GLAD_API_PTR *PFNGLDELETEFRAMEBUFFERSPROC)(GLsizei n, const GLuint * framebuffers);
+typedef void (GLAD_API_PTR *PFNGLDELETEPROGRAMPROC)(GLuint program);
+typedef void (GLAD_API_PTR *PFNGLDELETERENDERBUFFERSPROC)(GLsizei n, const GLuint * renderbuffers);
+typedef void (GLAD_API_PTR *PFNGLDELETESHADERPROC)(GLuint shader);
+typedef void (GLAD_API_PTR *PFNGLDELETETEXTURESPROC)(GLsizei n, const GLuint * textures);
+typedef void (GLAD_API_PTR *PFNGLDEPTHFUNCPROC)(GLenum func);
+typedef void (GLAD_API_PTR *PFNGLDEPTHMASKPROC)(GLboolean flag);
+typedef void (GLAD_API_PTR *PFNGLDEPTHRANGEFPROC)(GLfloat n, GLfloat f);
+typedef void (GLAD_API_PTR *PFNGLDETACHSHADERPROC)(GLuint program, GLuint shader);
+typedef void (GLAD_API_PTR *PFNGLDISABLEPROC)(GLenum cap);
+typedef void (GLAD_API_PTR *PFNGLDISABLEVERTEXATTRIBARRAYPROC)(GLuint index);
+typedef void (GLAD_API_PTR *PFNGLDRAWARRAYSPROC)(GLenum mode, GLint first, GLsizei count);
+typedef void (GLAD_API_PTR *PFNGLDRAWELEMENTSPROC)(GLenum mode, GLsizei count, GLenum type, const void * indices);
+typedef void (GLAD_API_PTR *PFNGLENABLEPROC)(GLenum cap);
+typedef void (GLAD_API_PTR *PFNGLENABLEVERTEXATTRIBARRAYPROC)(GLuint index);
+typedef void (GLAD_API_PTR *PFNGLFINISHPROC)(void);
+typedef void (GLAD_API_PTR *PFNGLFLUSHPROC)(void);
+typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERRENDERBUFFERPROC)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+typedef void (GLAD_API_PTR *PFNGLFRAMEBUFFERTEXTURE2DPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (GLAD_API_PTR *PFNGLFRONTFACEPROC)(GLenum mode);
+typedef void (GLAD_API_PTR *PFNGLGENBUFFERSPROC)(GLsizei n, GLuint * buffers);
+typedef void (GLAD_API_PTR *PFNGLGENFRAMEBUFFERSPROC)(GLsizei n, GLuint * framebuffers);
+typedef void (GLAD_API_PTR *PFNGLGENRENDERBUFFERSPROC)(GLsizei n, GLuint * renderbuffers);
+typedef void (GLAD_API_PTR *PFNGLGENTEXTURESPROC)(GLsizei n, GLuint * textures);
+typedef void (GLAD_API_PTR *PFNGLGENERATEMIPMAPPROC)(GLenum target);
+typedef void (GLAD_API_PTR *PFNGLGETACTIVEATTRIBPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name);
+typedef void (GLAD_API_PTR *PFNGLGETACTIVEUNIFORMPROC)(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name);
+typedef void (GLAD_API_PTR *PFNGLGETATTACHEDSHADERSPROC)(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * shaders);
+typedef GLint (GLAD_API_PTR *PFNGLGETATTRIBLOCATIONPROC)(GLuint program, const GLchar * name);
+typedef void (GLAD_API_PTR *PFNGLGETBOOLEANVPROC)(GLenum pname, GLboolean * data);
+typedef void (GLAD_API_PTR *PFNGLGETBUFFERPARAMETERIVPROC)(GLenum target, GLenum pname, GLint * params);
+typedef GLenum (GLAD_API_PTR *PFNGLGETERRORPROC)(void);
+typedef void (GLAD_API_PTR *PFNGLGETFLOATVPROC)(GLenum pname, GLfloat * data);
+typedef void (GLAD_API_PTR *PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)(GLenum target, GLenum attachment, GLenum pname, GLint * params);
+typedef void (GLAD_API_PTR *PFNGLGETINTEGERVPROC)(GLenum pname, GLint * data);
+typedef void (GLAD_API_PTR *PFNGLGETPROGRAMINFOLOGPROC)(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog);
+typedef void (GLAD_API_PTR *PFNGLGETPROGRAMIVPROC)(GLuint program, GLenum pname, GLint * params);
+typedef void (GLAD_API_PTR *PFNGLGETRENDERBUFFERPARAMETERIVPROC)(GLenum target, GLenum pname, GLint * params);
+typedef void (GLAD_API_PTR *PFNGLGETSHADERINFOLOGPROC)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog);
+typedef void (GLAD_API_PTR *PFNGLGETSHADERPRECISIONFORMATPROC)(GLenum shadertype, GLenum precisiontype, GLint * range, GLint * precision);
+typedef void (GLAD_API_PTR *PFNGLGETSHADERSOURCEPROC)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * source);
+typedef void (GLAD_API_PTR *PFNGLGETSHADERIVPROC)(GLuint shader, GLenum pname, GLint * params);
+typedef const GLubyte * (GLAD_API_PTR *PFNGLGETSTRINGPROC)(GLenum name);
+typedef void (GLAD_API_PTR *PFNGLGETTEXPARAMETERFVPROC)(GLenum target, GLenum pname, GLfloat * params);
+typedef void (GLAD_API_PTR *PFNGLGETTEXPARAMETERIVPROC)(GLenum target, GLenum pname, GLint * params);
+typedef GLint (GLAD_API_PTR *PFNGLGETUNIFORMLOCATIONPROC)(GLuint program, const GLchar * name);
+typedef void (GLAD_API_PTR *PFNGLGETUNIFORMFVPROC)(GLuint program, GLint location, GLfloat * params);
+typedef void (GLAD_API_PTR *PFNGLGETUNIFORMIVPROC)(GLuint program, GLint location, GLint * params);
+typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBPOINTERVPROC)(GLuint index, GLenum pname, void ** pointer);
+typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBFVPROC)(GLuint index, GLenum pname, GLfloat * params);
+typedef void (GLAD_API_PTR *PFNGLGETVERTEXATTRIBIVPROC)(GLuint index, GLenum pname, GLint * params);
+typedef void (GLAD_API_PTR *PFNGLHINTPROC)(GLenum target, GLenum mode);
+typedef GLboolean (GLAD_API_PTR *PFNGLISBUFFERPROC)(GLuint buffer);
+typedef GLboolean (GLAD_API_PTR *PFNGLISENABLEDPROC)(GLenum cap);
+typedef GLboolean (GLAD_API_PTR *PFNGLISFRAMEBUFFERPROC)(GLuint framebuffer);
+typedef GLboolean (GLAD_API_PTR *PFNGLISPROGRAMPROC)(GLuint program);
+typedef GLboolean (GLAD_API_PTR *PFNGLISRENDERBUFFERPROC)(GLuint renderbuffer);
+typedef GLboolean (GLAD_API_PTR *PFNGLISSHADERPROC)(GLuint shader);
+typedef GLboolean (GLAD_API_PTR *PFNGLISTEXTUREPROC)(GLuint texture);
+typedef void (GLAD_API_PTR *PFNGLLINEWIDTHPROC)(GLfloat width);
+typedef void (GLAD_API_PTR *PFNGLLINKPROGRAMPROC)(GLuint program);
+typedef void (GLAD_API_PTR *PFNGLPIXELSTOREIPROC)(GLenum pname, GLint param);
+typedef void (GLAD_API_PTR *PFNGLPOLYGONOFFSETPROC)(GLfloat factor, GLfloat units);
+typedef void (GLAD_API_PTR *PFNGLREADPIXELSPROC)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void * pixels);
+typedef void (GLAD_API_PTR *PFNGLRELEASESHADERCOMPILERPROC)(void);
+typedef void (GLAD_API_PTR *PFNGLRENDERBUFFERSTORAGEPROC)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GLAD_API_PTR *PFNGLSAMPLECOVERAGEPROC)(GLfloat value, GLboolean invert);
+typedef void (GLAD_API_PTR *PFNGLSCISSORPROC)(GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (GLAD_API_PTR *PFNGLSHADERBINARYPROC)(GLsizei count, const GLuint * shaders, GLenum binaryFormat, const void * binary, GLsizei length);
+typedef void (GLAD_API_PTR *PFNGLSHADERSOURCEPROC)(GLuint shader, GLsizei count, const GLchar *const* string, const GLint * length);
+typedef void (GLAD_API_PTR *PFNGLSTENCILFUNCPROC)(GLenum func, GLint ref, GLuint mask);
+typedef void (GLAD_API_PTR *PFNGLSTENCILFUNCSEPARATEPROC)(GLenum face, GLenum func, GLint ref, GLuint mask);
+typedef void (GLAD_API_PTR *PFNGLSTENCILMASKPROC)(GLuint mask);
+typedef void (GLAD_API_PTR *PFNGLSTENCILMASKSEPARATEPROC)(GLenum face, GLuint mask);
+typedef void (GLAD_API_PTR *PFNGLSTENCILOPPROC)(GLenum fail, GLenum zfail, GLenum zpass);
+typedef void (GLAD_API_PTR *PFNGLSTENCILOPSEPARATEPROC)(GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
+typedef void (GLAD_API_PTR *PFNGLTEXIMAGE2DPROC)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void * pixels);
+typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERFPROC)(GLenum target, GLenum pname, GLfloat param);
+typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERFVPROC)(GLenum target, GLenum pname, const GLfloat * params);
+typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERIPROC)(GLenum target, GLenum pname, GLint param);
+typedef void (GLAD_API_PTR *PFNGLTEXPARAMETERIVPROC)(GLenum target, GLenum pname, const GLint * params);
+typedef void (GLAD_API_PTR *PFNGLTEXSUBIMAGE2DPROC)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void * pixels);
+typedef void (GLAD_API_PTR *PFNGLUNIFORM1FPROC)(GLint location, GLfloat v0);
+typedef void (GLAD_API_PTR *PFNGLUNIFORM1FVPROC)(GLint location, GLsizei count, const GLfloat * value);
+typedef void (GLAD_API_PTR *PFNGLUNIFORM1IPROC)(GLint location, GLint v0);
+typedef void (GLAD_API_PTR *PFNGLUNIFORM1IVPROC)(GLint location, GLsizei count, const GLint * value);
+typedef void (GLAD_API_PTR *PFNGLUNIFORM2FPROC)(GLint location, GLfloat v0, GLfloat v1);
+typedef void (GLAD_API_PTR *PFNGLUNIFORM2FVPROC)(GLint location, GLsizei count, const GLfloat * value);
+typedef void (GLAD_API_PTR *PFNGLUNIFORM2IPROC)(GLint location, GLint v0, GLint v1);
+typedef void (GLAD_API_PTR *PFNGLUNIFORM2IVPROC)(GLint location, GLsizei count, const GLint * value);
+typedef void (GLAD_API_PTR *PFNGLUNIFORM3FPROC)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+typedef void (GLAD_API_PTR *PFNGLUNIFORM3FVPROC)(GLint location, GLsizei count, const GLfloat * value);
+typedef void (GLAD_API_PTR *PFNGLUNIFORM3IPROC)(GLint location, GLint v0, GLint v1, GLint v2);
+typedef void (GLAD_API_PTR *PFNGLUNIFORM3IVPROC)(GLint location, GLsizei count, const GLint * value);
+typedef void (GLAD_API_PTR *PFNGLUNIFORM4FPROC)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+typedef void (GLAD_API_PTR *PFNGLUNIFORM4FVPROC)(GLint location, GLsizei count, const GLfloat * value);
+typedef void (GLAD_API_PTR *PFNGLUNIFORM4IPROC)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+typedef void (GLAD_API_PTR *PFNGLUNIFORM4IVPROC)(GLint location, GLsizei count, const GLint * value);
+typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX2FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
+typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX3FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
+typedef void (GLAD_API_PTR *PFNGLUNIFORMMATRIX4FVPROC)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value);
+typedef void (GLAD_API_PTR *PFNGLUSEPROGRAMPROC)(GLuint program);
+typedef void (GLAD_API_PTR *PFNGLVALIDATEPROGRAMPROC)(GLuint program);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1FPROC)(GLuint index, GLfloat x);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB1FVPROC)(GLuint index, const GLfloat * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2FPROC)(GLuint index, GLfloat x, GLfloat y);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB2FVPROC)(GLuint index, const GLfloat * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3FPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB3FVPROC)(GLuint index, const GLfloat * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4FPROC)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIB4FVPROC)(GLuint index, const GLfloat * v);
+typedef void (GLAD_API_PTR *PFNGLVERTEXATTRIBPOINTERPROC)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void * pointer);
+typedef void (GLAD_API_PTR *PFNGLVIEWPORTPROC)(GLint x, GLint y, GLsizei width, GLsizei height);
+
+GLAD_API_CALL PFNGLACTIVETEXTUREPROC glad_glActiveTexture;
+#define glActiveTexture glad_glActiveTexture
+GLAD_API_CALL PFNGLATTACHSHADERPROC glad_glAttachShader;
+#define glAttachShader glad_glAttachShader
+GLAD_API_CALL PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation;
+#define glBindAttribLocation glad_glBindAttribLocation
+GLAD_API_CALL PFNGLBINDBUFFERPROC glad_glBindBuffer;
+#define glBindBuffer glad_glBindBuffer
+GLAD_API_CALL PFNGLBINDFRAMEBUFFERPROC glad_glBindFramebuffer;
+#define glBindFramebuffer glad_glBindFramebuffer
+GLAD_API_CALL PFNGLBINDRENDERBUFFERPROC glad_glBindRenderbuffer;
+#define glBindRenderbuffer glad_glBindRenderbuffer
+GLAD_API_CALL PFNGLBINDTEXTUREPROC glad_glBindTexture;
+#define glBindTexture glad_glBindTexture
+GLAD_API_CALL PFNGLBLENDCOLORPROC glad_glBlendColor;
+#define glBlendColor glad_glBlendColor
+GLAD_API_CALL PFNGLBLENDEQUATIONPROC glad_glBlendEquation;
+#define glBlendEquation glad_glBlendEquation
+GLAD_API_CALL PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate;
+#define glBlendEquationSeparate glad_glBlendEquationSeparate
+GLAD_API_CALL PFNGLBLENDFUNCPROC glad_glBlendFunc;
+#define glBlendFunc glad_glBlendFunc
+GLAD_API_CALL PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate;
+#define glBlendFuncSeparate glad_glBlendFuncSeparate
+GLAD_API_CALL PFNGLBUFFERDATAPROC glad_glBufferData;
+#define glBufferData glad_glBufferData
+GLAD_API_CALL PFNGLBUFFERSUBDATAPROC glad_glBufferSubData;
+#define glBufferSubData glad_glBufferSubData
+GLAD_API_CALL PFNGLCHECKFRAMEBUFFERSTATUSPROC glad_glCheckFramebufferStatus;
+#define glCheckFramebufferStatus glad_glCheckFramebufferStatus
+GLAD_API_CALL PFNGLCLEARPROC glad_glClear;
+#define glClear glad_glClear
+GLAD_API_CALL PFNGLCLEARCOLORPROC glad_glClearColor;
+#define glClearColor glad_glClearColor
+GLAD_API_CALL PFNGLCLEARDEPTHFPROC glad_glClearDepthf;
+#define glClearDepthf glad_glClearDepthf
+GLAD_API_CALL PFNGLCLEARSTENCILPROC glad_glClearStencil;
+#define glClearStencil glad_glClearStencil
+GLAD_API_CALL PFNGLCOLORMASKPROC glad_glColorMask;
+#define glColorMask glad_glColorMask
+GLAD_API_CALL PFNGLCOMPILESHADERPROC glad_glCompileShader;
+#define glCompileShader glad_glCompileShader
+GLAD_API_CALL PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D;
+#define glCompressedTexImage2D glad_glCompressedTexImage2D
+GLAD_API_CALL PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D;
+#define glCompressedTexSubImage2D glad_glCompressedTexSubImage2D
+GLAD_API_CALL PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D;
+#define glCopyTexImage2D glad_glCopyTexImage2D
+GLAD_API_CALL PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D;
+#define glCopyTexSubImage2D glad_glCopyTexSubImage2D
+GLAD_API_CALL PFNGLCREATEPROGRAMPROC glad_glCreateProgram;
+#define glCreateProgram glad_glCreateProgram
+GLAD_API_CALL PFNGLCREATESHADERPROC glad_glCreateShader;
+#define glCreateShader glad_glCreateShader
+GLAD_API_CALL PFNGLCULLFACEPROC glad_glCullFace;
+#define glCullFace glad_glCullFace
+GLAD_API_CALL PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers;
+#define glDeleteBuffers glad_glDeleteBuffers
+GLAD_API_CALL PFNGLDELETEFRAMEBUFFERSPROC glad_glDeleteFramebuffers;
+#define glDeleteFramebuffers glad_glDeleteFramebuffers
+GLAD_API_CALL PFNGLDELETEPROGRAMPROC glad_glDeleteProgram;
+#define glDeleteProgram glad_glDeleteProgram
+GLAD_API_CALL PFNGLDELETERENDERBUFFERSPROC glad_glDeleteRenderbuffers;
+#define glDeleteRenderbuffers glad_glDeleteRenderbuffers
+GLAD_API_CALL PFNGLDELETESHADERPROC glad_glDeleteShader;
+#define glDeleteShader glad_glDeleteShader
+GLAD_API_CALL PFNGLDELETETEXTURESPROC glad_glDeleteTextures;
+#define glDeleteTextures glad_glDeleteTextures
+GLAD_API_CALL PFNGLDEPTHFUNCPROC glad_glDepthFunc;
+#define glDepthFunc glad_glDepthFunc
+GLAD_API_CALL PFNGLDEPTHMASKPROC glad_glDepthMask;
+#define glDepthMask glad_glDepthMask
+GLAD_API_CALL PFNGLDEPTHRANGEFPROC glad_glDepthRangef;
+#define glDepthRangef glad_glDepthRangef
+GLAD_API_CALL PFNGLDETACHSHADERPROC glad_glDetachShader;
+#define glDetachShader glad_glDetachShader
+GLAD_API_CALL PFNGLDISABLEPROC glad_glDisable;
+#define glDisable glad_glDisable
+GLAD_API_CALL PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray;
+#define glDisableVertexAttribArray glad_glDisableVertexAttribArray
+GLAD_API_CALL PFNGLDRAWARRAYSPROC glad_glDrawArrays;
+#define glDrawArrays glad_glDrawArrays
+GLAD_API_CALL PFNGLDRAWELEMENTSPROC glad_glDrawElements;
+#define glDrawElements glad_glDrawElements
+GLAD_API_CALL PFNGLENABLEPROC glad_glEnable;
+#define glEnable glad_glEnable
+GLAD_API_CALL PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray;
+#define glEnableVertexAttribArray glad_glEnableVertexAttribArray
+GLAD_API_CALL PFNGLFINISHPROC glad_glFinish;
+#define glFinish glad_glFinish
+GLAD_API_CALL PFNGLFLUSHPROC glad_glFlush;
+#define glFlush glad_glFlush
+GLAD_API_CALL PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer;
+#define glFramebufferRenderbuffer glad_glFramebufferRenderbuffer
+GLAD_API_CALL PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D;
+#define glFramebufferTexture2D glad_glFramebufferTexture2D
+GLAD_API_CALL PFNGLFRONTFACEPROC glad_glFrontFace;
+#define glFrontFace glad_glFrontFace
+GLAD_API_CALL PFNGLGENBUFFERSPROC glad_glGenBuffers;
+#define glGenBuffers glad_glGenBuffers
+GLAD_API_CALL PFNGLGENFRAMEBUFFERSPROC glad_glGenFramebuffers;
+#define glGenFramebuffers glad_glGenFramebuffers
+GLAD_API_CALL PFNGLGENRENDERBUFFERSPROC glad_glGenRenderbuffers;
+#define glGenRenderbuffers glad_glGenRenderbuffers
+GLAD_API_CALL PFNGLGENTEXTURESPROC glad_glGenTextures;
+#define glGenTextures glad_glGenTextures
+GLAD_API_CALL PFNGLGENERATEMIPMAPPROC glad_glGenerateMipmap;
+#define glGenerateMipmap glad_glGenerateMipmap
+GLAD_API_CALL PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib;
+#define glGetActiveAttrib glad_glGetActiveAttrib
+GLAD_API_CALL PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform;
+#define glGetActiveUniform glad_glGetActiveUniform
+GLAD_API_CALL PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders;
+#define glGetAttachedShaders glad_glGetAttachedShaders
+GLAD_API_CALL PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation;
+#define glGetAttribLocation glad_glGetAttribLocation
+GLAD_API_CALL PFNGLGETBOOLEANVPROC glad_glGetBooleanv;
+#define glGetBooleanv glad_glGetBooleanv
+GLAD_API_CALL PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv;
+#define glGetBufferParameteriv glad_glGetBufferParameteriv
+GLAD_API_CALL PFNGLGETERRORPROC glad_glGetError;
+#define glGetError glad_glGetError
+GLAD_API_CALL PFNGLGETFLOATVPROC glad_glGetFloatv;
+#define glGetFloatv glad_glGetFloatv
+GLAD_API_CALL PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetFramebufferAttachmentParameteriv;
+#define glGetFramebufferAttachmentParameteriv glad_glGetFramebufferAttachmentParameteriv
+GLAD_API_CALL PFNGLGETINTEGERVPROC glad_glGetIntegerv;
+#define glGetIntegerv glad_glGetIntegerv
+GLAD_API_CALL PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog;
+#define glGetProgramInfoLog glad_glGetProgramInfoLog
+GLAD_API_CALL PFNGLGETPROGRAMIVPROC glad_glGetProgramiv;
+#define glGetProgramiv glad_glGetProgramiv
+GLAD_API_CALL PFNGLGETRENDERBUFFERPARAMETERIVPROC glad_glGetRenderbufferParameteriv;
+#define glGetRenderbufferParameteriv glad_glGetRenderbufferParameteriv
+GLAD_API_CALL PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog;
+#define glGetShaderInfoLog glad_glGetShaderInfoLog
+GLAD_API_CALL PFNGLGETSHADERPRECISIONFORMATPROC glad_glGetShaderPrecisionFormat;
+#define glGetShaderPrecisionFormat glad_glGetShaderPrecisionFormat
+GLAD_API_CALL PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource;
+#define glGetShaderSource glad_glGetShaderSource
+GLAD_API_CALL PFNGLGETSHADERIVPROC glad_glGetShaderiv;
+#define glGetShaderiv glad_glGetShaderiv
+GLAD_API_CALL PFNGLGETSTRINGPROC glad_glGetString;
+#define glGetString glad_glGetString
+GLAD_API_CALL PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv;
+#define glGetTexParameterfv glad_glGetTexParameterfv
+GLAD_API_CALL PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv;
+#define glGetTexParameteriv glad_glGetTexParameteriv
+GLAD_API_CALL PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation;
+#define glGetUniformLocation glad_glGetUniformLocation
+GLAD_API_CALL PFNGLGETUNIFORMFVPROC glad_glGetUniformfv;
+#define glGetUniformfv glad_glGetUniformfv
+GLAD_API_CALL PFNGLGETUNIFORMIVPROC glad_glGetUniformiv;
+#define glGetUniformiv glad_glGetUniformiv
+GLAD_API_CALL PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv;
+#define glGetVertexAttribPointerv glad_glGetVertexAttribPointerv
+GLAD_API_CALL PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv;
+#define glGetVertexAttribfv glad_glGetVertexAttribfv
+GLAD_API_CALL PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv;
+#define glGetVertexAttribiv glad_glGetVertexAttribiv
+GLAD_API_CALL PFNGLHINTPROC glad_glHint;
+#define glHint glad_glHint
+GLAD_API_CALL PFNGLISBUFFERPROC glad_glIsBuffer;
+#define glIsBuffer glad_glIsBuffer
+GLAD_API_CALL PFNGLISENABLEDPROC glad_glIsEnabled;
+#define glIsEnabled glad_glIsEnabled
+GLAD_API_CALL PFNGLISFRAMEBUFFERPROC glad_glIsFramebuffer;
+#define glIsFramebuffer glad_glIsFramebuffer
+GLAD_API_CALL PFNGLISPROGRAMPROC glad_glIsProgram;
+#define glIsProgram glad_glIsProgram
+GLAD_API_CALL PFNGLISRENDERBUFFERPROC glad_glIsRenderbuffer;
+#define glIsRenderbuffer glad_glIsRenderbuffer
+GLAD_API_CALL PFNGLISSHADERPROC glad_glIsShader;
+#define glIsShader glad_glIsShader
+GLAD_API_CALL PFNGLISTEXTUREPROC glad_glIsTexture;
+#define glIsTexture glad_glIsTexture
+GLAD_API_CALL PFNGLLINEWIDTHPROC glad_glLineWidth;
+#define glLineWidth glad_glLineWidth
+GLAD_API_CALL PFNGLLINKPROGRAMPROC glad_glLinkProgram;
+#define glLinkProgram glad_glLinkProgram
+GLAD_API_CALL PFNGLPIXELSTOREIPROC glad_glPixelStorei;
+#define glPixelStorei glad_glPixelStorei
+GLAD_API_CALL PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset;
+#define glPolygonOffset glad_glPolygonOffset
+GLAD_API_CALL PFNGLREADPIXELSPROC glad_glReadPixels;
+#define glReadPixels glad_glReadPixels
+GLAD_API_CALL PFNGLRELEASESHADERCOMPILERPROC glad_glReleaseShaderCompiler;
+#define glReleaseShaderCompiler glad_glReleaseShaderCompiler
+GLAD_API_CALL PFNGLRENDERBUFFERSTORAGEPROC glad_glRenderbufferStorage;
+#define glRenderbufferStorage glad_glRenderbufferStorage
+GLAD_API_CALL PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage;
+#define glSampleCoverage glad_glSampleCoverage
+GLAD_API_CALL PFNGLSCISSORPROC glad_glScissor;
+#define glScissor glad_glScissor
+GLAD_API_CALL PFNGLSHADERBINARYPROC glad_glShaderBinary;
+#define glShaderBinary glad_glShaderBinary
+GLAD_API_CALL PFNGLSHADERSOURCEPROC glad_glShaderSource;
+#define glShaderSource glad_glShaderSource
+GLAD_API_CALL PFNGLSTENCILFUNCPROC glad_glStencilFunc;
+#define glStencilFunc glad_glStencilFunc
+GLAD_API_CALL PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate;
+#define glStencilFuncSeparate glad_glStencilFuncSeparate
+GLAD_API_CALL PFNGLSTENCILMASKPROC glad_glStencilMask;
+#define glStencilMask glad_glStencilMask
+GLAD_API_CALL PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate;
+#define glStencilMaskSeparate glad_glStencilMaskSeparate
+GLAD_API_CALL PFNGLSTENCILOPPROC glad_glStencilOp;
+#define glStencilOp glad_glStencilOp
+GLAD_API_CALL PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate;
+#define glStencilOpSeparate glad_glStencilOpSeparate
+GLAD_API_CALL PFNGLTEXIMAGE2DPROC glad_glTexImage2D;
+#define glTexImage2D glad_glTexImage2D
+GLAD_API_CALL PFNGLTEXPARAMETERFPROC glad_glTexParameterf;
+#define glTexParameterf glad_glTexParameterf
+GLAD_API_CALL PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv;
+#define glTexParameterfv glad_glTexParameterfv
+GLAD_API_CALL PFNGLTEXPARAMETERIPROC glad_glTexParameteri;
+#define glTexParameteri glad_glTexParameteri
+GLAD_API_CALL PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv;
+#define glTexParameteriv glad_glTexParameteriv
+GLAD_API_CALL PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D;
+#define glTexSubImage2D glad_glTexSubImage2D
+GLAD_API_CALL PFNGLUNIFORM1FPROC glad_glUniform1f;
+#define glUniform1f glad_glUniform1f
+GLAD_API_CALL PFNGLUNIFORM1FVPROC glad_glUniform1fv;
+#define glUniform1fv glad_glUniform1fv
+GLAD_API_CALL PFNGLUNIFORM1IPROC glad_glUniform1i;
+#define glUniform1i glad_glUniform1i
+GLAD_API_CALL PFNGLUNIFORM1IVPROC glad_glUniform1iv;
+#define glUniform1iv glad_glUniform1iv
+GLAD_API_CALL PFNGLUNIFORM2FPROC glad_glUniform2f;
+#define glUniform2f glad_glUniform2f
+GLAD_API_CALL PFNGLUNIFORM2FVPROC glad_glUniform2fv;
+#define glUniform2fv glad_glUniform2fv
+GLAD_API_CALL PFNGLUNIFORM2IPROC glad_glUniform2i;
+#define glUniform2i glad_glUniform2i
+GLAD_API_CALL PFNGLUNIFORM2IVPROC glad_glUniform2iv;
+#define glUniform2iv glad_glUniform2iv
+GLAD_API_CALL PFNGLUNIFORM3FPROC glad_glUniform3f;
+#define glUniform3f glad_glUniform3f
+GLAD_API_CALL PFNGLUNIFORM3FVPROC glad_glUniform3fv;
+#define glUniform3fv glad_glUniform3fv
+GLAD_API_CALL PFNGLUNIFORM3IPROC glad_glUniform3i;
+#define glUniform3i glad_glUniform3i
+GLAD_API_CALL PFNGLUNIFORM3IVPROC glad_glUniform3iv;
+#define glUniform3iv glad_glUniform3iv
+GLAD_API_CALL PFNGLUNIFORM4FPROC glad_glUniform4f;
+#define glUniform4f glad_glUniform4f
+GLAD_API_CALL PFNGLUNIFORM4FVPROC glad_glUniform4fv;
+#define glUniform4fv glad_glUniform4fv
+GLAD_API_CALL PFNGLUNIFORM4IPROC glad_glUniform4i;
+#define glUniform4i glad_glUniform4i
+GLAD_API_CALL PFNGLUNIFORM4IVPROC glad_glUniform4iv;
+#define glUniform4iv glad_glUniform4iv
+GLAD_API_CALL PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv;
+#define glUniformMatrix2fv glad_glUniformMatrix2fv
+GLAD_API_CALL PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv;
+#define glUniformMatrix3fv glad_glUniformMatrix3fv
+GLAD_API_CALL PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv;
+#define glUniformMatrix4fv glad_glUniformMatrix4fv
+GLAD_API_CALL PFNGLUSEPROGRAMPROC glad_glUseProgram;
+#define glUseProgram glad_glUseProgram
+GLAD_API_CALL PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram;
+#define glValidateProgram glad_glValidateProgram
+GLAD_API_CALL PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f;
+#define glVertexAttrib1f glad_glVertexAttrib1f
+GLAD_API_CALL PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv;
+#define glVertexAttrib1fv glad_glVertexAttrib1fv
+GLAD_API_CALL PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f;
+#define glVertexAttrib2f glad_glVertexAttrib2f
+GLAD_API_CALL PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv;
+#define glVertexAttrib2fv glad_glVertexAttrib2fv
+GLAD_API_CALL PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f;
+#define glVertexAttrib3f glad_glVertexAttrib3f
+GLAD_API_CALL PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv;
+#define glVertexAttrib3fv glad_glVertexAttrib3fv
+GLAD_API_CALL PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f;
+#define glVertexAttrib4f glad_glVertexAttrib4f
+GLAD_API_CALL PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv;
+#define glVertexAttrib4fv glad_glVertexAttrib4fv
+GLAD_API_CALL PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer;
+#define glVertexAttribPointer glad_glVertexAttribPointer
+GLAD_API_CALL PFNGLVIEWPORTPROC glad_glViewport;
+#define glViewport glad_glViewport
+
+
+
+
+
+GLAD_API_CALL int gladLoadGLES2UserPtr( GLADuserptrloadfunc load, void *userptr);
+GLAD_API_CALL int gladLoadGLES2( GLADloadfunc load);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+/* Source */
+#ifdef GLAD_GLES2_IMPLEMENTATION
+#include
+#include
+#include
+
+#ifndef GLAD_IMPL_UTIL_C_
+#define GLAD_IMPL_UTIL_C_
+
+#ifdef _MSC_VER
+#define GLAD_IMPL_UTIL_SSCANF sscanf_s
+#else
+#define GLAD_IMPL_UTIL_SSCANF sscanf
+#endif
+
+#endif /* GLAD_IMPL_UTIL_C_ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+
+int GLAD_GL_ES_VERSION_2_0 = 0;
+
+
+
+PFNGLACTIVETEXTUREPROC glad_glActiveTexture = NULL;
+PFNGLATTACHSHADERPROC glad_glAttachShader = NULL;
+PFNGLBINDATTRIBLOCATIONPROC glad_glBindAttribLocation = NULL;
+PFNGLBINDBUFFERPROC glad_glBindBuffer = NULL;
+PFNGLBINDFRAMEBUFFERPROC glad_glBindFramebuffer = NULL;
+PFNGLBINDRENDERBUFFERPROC glad_glBindRenderbuffer = NULL;
+PFNGLBINDTEXTUREPROC glad_glBindTexture = NULL;
+PFNGLBLENDCOLORPROC glad_glBlendColor = NULL;
+PFNGLBLENDEQUATIONPROC glad_glBlendEquation = NULL;
+PFNGLBLENDEQUATIONSEPARATEPROC glad_glBlendEquationSeparate = NULL;
+PFNGLBLENDFUNCPROC glad_glBlendFunc = NULL;
+PFNGLBLENDFUNCSEPARATEPROC glad_glBlendFuncSeparate = NULL;
+PFNGLBUFFERDATAPROC glad_glBufferData = NULL;
+PFNGLBUFFERSUBDATAPROC glad_glBufferSubData = NULL;
+PFNGLCHECKFRAMEBUFFERSTATUSPROC glad_glCheckFramebufferStatus = NULL;
+PFNGLCLEARPROC glad_glClear = NULL;
+PFNGLCLEARCOLORPROC glad_glClearColor = NULL;
+PFNGLCLEARDEPTHFPROC glad_glClearDepthf = NULL;
+PFNGLCLEARSTENCILPROC glad_glClearStencil = NULL;
+PFNGLCOLORMASKPROC glad_glColorMask = NULL;
+PFNGLCOMPILESHADERPROC glad_glCompileShader = NULL;
+PFNGLCOMPRESSEDTEXIMAGE2DPROC glad_glCompressedTexImage2D = NULL;
+PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC glad_glCompressedTexSubImage2D = NULL;
+PFNGLCOPYTEXIMAGE2DPROC glad_glCopyTexImage2D = NULL;
+PFNGLCOPYTEXSUBIMAGE2DPROC glad_glCopyTexSubImage2D = NULL;
+PFNGLCREATEPROGRAMPROC glad_glCreateProgram = NULL;
+PFNGLCREATESHADERPROC glad_glCreateShader = NULL;
+PFNGLCULLFACEPROC glad_glCullFace = NULL;
+PFNGLDELETEBUFFERSPROC glad_glDeleteBuffers = NULL;
+PFNGLDELETEFRAMEBUFFERSPROC glad_glDeleteFramebuffers = NULL;
+PFNGLDELETEPROGRAMPROC glad_glDeleteProgram = NULL;
+PFNGLDELETERENDERBUFFERSPROC glad_glDeleteRenderbuffers = NULL;
+PFNGLDELETESHADERPROC glad_glDeleteShader = NULL;
+PFNGLDELETETEXTURESPROC glad_glDeleteTextures = NULL;
+PFNGLDEPTHFUNCPROC glad_glDepthFunc = NULL;
+PFNGLDEPTHMASKPROC glad_glDepthMask = NULL;
+PFNGLDEPTHRANGEFPROC glad_glDepthRangef = NULL;
+PFNGLDETACHSHADERPROC glad_glDetachShader = NULL;
+PFNGLDISABLEPROC glad_glDisable = NULL;
+PFNGLDISABLEVERTEXATTRIBARRAYPROC glad_glDisableVertexAttribArray = NULL;
+PFNGLDRAWARRAYSPROC glad_glDrawArrays = NULL;
+PFNGLDRAWELEMENTSPROC glad_glDrawElements = NULL;
+PFNGLENABLEPROC glad_glEnable = NULL;
+PFNGLENABLEVERTEXATTRIBARRAYPROC glad_glEnableVertexAttribArray = NULL;
+PFNGLFINISHPROC glad_glFinish = NULL;
+PFNGLFLUSHPROC glad_glFlush = NULL;
+PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer = NULL;
+PFNGLFRAMEBUFFERTEXTURE2DPROC glad_glFramebufferTexture2D = NULL;
+PFNGLFRONTFACEPROC glad_glFrontFace = NULL;
+PFNGLGENBUFFERSPROC glad_glGenBuffers = NULL;
+PFNGLGENFRAMEBUFFERSPROC glad_glGenFramebuffers = NULL;
+PFNGLGENRENDERBUFFERSPROC glad_glGenRenderbuffers = NULL;
+PFNGLGENTEXTURESPROC glad_glGenTextures = NULL;
+PFNGLGENERATEMIPMAPPROC glad_glGenerateMipmap = NULL;
+PFNGLGETACTIVEATTRIBPROC glad_glGetActiveAttrib = NULL;
+PFNGLGETACTIVEUNIFORMPROC glad_glGetActiveUniform = NULL;
+PFNGLGETATTACHEDSHADERSPROC glad_glGetAttachedShaders = NULL;
+PFNGLGETATTRIBLOCATIONPROC glad_glGetAttribLocation = NULL;
+PFNGLGETBOOLEANVPROC glad_glGetBooleanv = NULL;
+PFNGLGETBUFFERPARAMETERIVPROC glad_glGetBufferParameteriv = NULL;
+PFNGLGETERRORPROC glad_glGetError = NULL;
+PFNGLGETFLOATVPROC glad_glGetFloatv = NULL;
+PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC glad_glGetFramebufferAttachmentParameteriv = NULL;
+PFNGLGETINTEGERVPROC glad_glGetIntegerv = NULL;
+PFNGLGETPROGRAMINFOLOGPROC glad_glGetProgramInfoLog = NULL;
+PFNGLGETPROGRAMIVPROC glad_glGetProgramiv = NULL;
+PFNGLGETRENDERBUFFERPARAMETERIVPROC glad_glGetRenderbufferParameteriv = NULL;
+PFNGLGETSHADERINFOLOGPROC glad_glGetShaderInfoLog = NULL;
+PFNGLGETSHADERPRECISIONFORMATPROC glad_glGetShaderPrecisionFormat = NULL;
+PFNGLGETSHADERSOURCEPROC glad_glGetShaderSource = NULL;
+PFNGLGETSHADERIVPROC glad_glGetShaderiv = NULL;
+PFNGLGETSTRINGPROC glad_glGetString = NULL;
+PFNGLGETTEXPARAMETERFVPROC glad_glGetTexParameterfv = NULL;
+PFNGLGETTEXPARAMETERIVPROC glad_glGetTexParameteriv = NULL;
+PFNGLGETUNIFORMLOCATIONPROC glad_glGetUniformLocation = NULL;
+PFNGLGETUNIFORMFVPROC glad_glGetUniformfv = NULL;
+PFNGLGETUNIFORMIVPROC glad_glGetUniformiv = NULL;
+PFNGLGETVERTEXATTRIBPOINTERVPROC glad_glGetVertexAttribPointerv = NULL;
+PFNGLGETVERTEXATTRIBFVPROC glad_glGetVertexAttribfv = NULL;
+PFNGLGETVERTEXATTRIBIVPROC glad_glGetVertexAttribiv = NULL;
+PFNGLHINTPROC glad_glHint = NULL;
+PFNGLISBUFFERPROC glad_glIsBuffer = NULL;
+PFNGLISENABLEDPROC glad_glIsEnabled = NULL;
+PFNGLISFRAMEBUFFERPROC glad_glIsFramebuffer = NULL;
+PFNGLISPROGRAMPROC glad_glIsProgram = NULL;
+PFNGLISRENDERBUFFERPROC glad_glIsRenderbuffer = NULL;
+PFNGLISSHADERPROC glad_glIsShader = NULL;
+PFNGLISTEXTUREPROC glad_glIsTexture = NULL;
+PFNGLLINEWIDTHPROC glad_glLineWidth = NULL;
+PFNGLLINKPROGRAMPROC glad_glLinkProgram = NULL;
+PFNGLPIXELSTOREIPROC glad_glPixelStorei = NULL;
+PFNGLPOLYGONOFFSETPROC glad_glPolygonOffset = NULL;
+PFNGLREADPIXELSPROC glad_glReadPixels = NULL;
+PFNGLRELEASESHADERCOMPILERPROC glad_glReleaseShaderCompiler = NULL;
+PFNGLRENDERBUFFERSTORAGEPROC glad_glRenderbufferStorage = NULL;
+PFNGLSAMPLECOVERAGEPROC glad_glSampleCoverage = NULL;
+PFNGLSCISSORPROC glad_glScissor = NULL;
+PFNGLSHADERBINARYPROC glad_glShaderBinary = NULL;
+PFNGLSHADERSOURCEPROC glad_glShaderSource = NULL;
+PFNGLSTENCILFUNCPROC glad_glStencilFunc = NULL;
+PFNGLSTENCILFUNCSEPARATEPROC glad_glStencilFuncSeparate = NULL;
+PFNGLSTENCILMASKPROC glad_glStencilMask = NULL;
+PFNGLSTENCILMASKSEPARATEPROC glad_glStencilMaskSeparate = NULL;
+PFNGLSTENCILOPPROC glad_glStencilOp = NULL;
+PFNGLSTENCILOPSEPARATEPROC glad_glStencilOpSeparate = NULL;
+PFNGLTEXIMAGE2DPROC glad_glTexImage2D = NULL;
+PFNGLTEXPARAMETERFPROC glad_glTexParameterf = NULL;
+PFNGLTEXPARAMETERFVPROC glad_glTexParameterfv = NULL;
+PFNGLTEXPARAMETERIPROC glad_glTexParameteri = NULL;
+PFNGLTEXPARAMETERIVPROC glad_glTexParameteriv = NULL;
+PFNGLTEXSUBIMAGE2DPROC glad_glTexSubImage2D = NULL;
+PFNGLUNIFORM1FPROC glad_glUniform1f = NULL;
+PFNGLUNIFORM1FVPROC glad_glUniform1fv = NULL;
+PFNGLUNIFORM1IPROC glad_glUniform1i = NULL;
+PFNGLUNIFORM1IVPROC glad_glUniform1iv = NULL;
+PFNGLUNIFORM2FPROC glad_glUniform2f = NULL;
+PFNGLUNIFORM2FVPROC glad_glUniform2fv = NULL;
+PFNGLUNIFORM2IPROC glad_glUniform2i = NULL;
+PFNGLUNIFORM2IVPROC glad_glUniform2iv = NULL;
+PFNGLUNIFORM3FPROC glad_glUniform3f = NULL;
+PFNGLUNIFORM3FVPROC glad_glUniform3fv = NULL;
+PFNGLUNIFORM3IPROC glad_glUniform3i = NULL;
+PFNGLUNIFORM3IVPROC glad_glUniform3iv = NULL;
+PFNGLUNIFORM4FPROC glad_glUniform4f = NULL;
+PFNGLUNIFORM4FVPROC glad_glUniform4fv = NULL;
+PFNGLUNIFORM4IPROC glad_glUniform4i = NULL;
+PFNGLUNIFORM4IVPROC glad_glUniform4iv = NULL;
+PFNGLUNIFORMMATRIX2FVPROC glad_glUniformMatrix2fv = NULL;
+PFNGLUNIFORMMATRIX3FVPROC glad_glUniformMatrix3fv = NULL;
+PFNGLUNIFORMMATRIX4FVPROC glad_glUniformMatrix4fv = NULL;
+PFNGLUSEPROGRAMPROC glad_glUseProgram = NULL;
+PFNGLVALIDATEPROGRAMPROC glad_glValidateProgram = NULL;
+PFNGLVERTEXATTRIB1FPROC glad_glVertexAttrib1f = NULL;
+PFNGLVERTEXATTRIB1FVPROC glad_glVertexAttrib1fv = NULL;
+PFNGLVERTEXATTRIB2FPROC glad_glVertexAttrib2f = NULL;
+PFNGLVERTEXATTRIB2FVPROC glad_glVertexAttrib2fv = NULL;
+PFNGLVERTEXATTRIB3FPROC glad_glVertexAttrib3f = NULL;
+PFNGLVERTEXATTRIB3FVPROC glad_glVertexAttrib3fv = NULL;
+PFNGLVERTEXATTRIB4FPROC glad_glVertexAttrib4f = NULL;
+PFNGLVERTEXATTRIB4FVPROC glad_glVertexAttrib4fv = NULL;
+PFNGLVERTEXATTRIBPOINTERPROC glad_glVertexAttribPointer = NULL;
+PFNGLVIEWPORTPROC glad_glViewport = NULL;
+
+
+static void glad_gl_load_GL_ES_VERSION_2_0( GLADuserptrloadfunc load, void* userptr) {
+ if(!GLAD_GL_ES_VERSION_2_0) return;
+ glad_glActiveTexture = (PFNGLACTIVETEXTUREPROC) load(userptr, "glActiveTexture");
+ glad_glAttachShader = (PFNGLATTACHSHADERPROC) load(userptr, "glAttachShader");
+ glad_glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC) load(userptr, "glBindAttribLocation");
+ glad_glBindBuffer = (PFNGLBINDBUFFERPROC) load(userptr, "glBindBuffer");
+ glad_glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC) load(userptr, "glBindFramebuffer");
+ glad_glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC) load(userptr, "glBindRenderbuffer");
+ glad_glBindTexture = (PFNGLBINDTEXTUREPROC) load(userptr, "glBindTexture");
+ glad_glBlendColor = (PFNGLBLENDCOLORPROC) load(userptr, "glBlendColor");
+ glad_glBlendEquation = (PFNGLBLENDEQUATIONPROC) load(userptr, "glBlendEquation");
+ glad_glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC) load(userptr, "glBlendEquationSeparate");
+ glad_glBlendFunc = (PFNGLBLENDFUNCPROC) load(userptr, "glBlendFunc");
+ glad_glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC) load(userptr, "glBlendFuncSeparate");
+ glad_glBufferData = (PFNGLBUFFERDATAPROC) load(userptr, "glBufferData");
+ glad_glBufferSubData = (PFNGLBUFFERSUBDATAPROC) load(userptr, "glBufferSubData");
+ glad_glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC) load(userptr, "glCheckFramebufferStatus");
+ glad_glClear = (PFNGLCLEARPROC) load(userptr, "glClear");
+ glad_glClearColor = (PFNGLCLEARCOLORPROC) load(userptr, "glClearColor");
+ glad_glClearDepthf = (PFNGLCLEARDEPTHFPROC) load(userptr, "glClearDepthf");
+ glad_glClearStencil = (PFNGLCLEARSTENCILPROC) load(userptr, "glClearStencil");
+ glad_glColorMask = (PFNGLCOLORMASKPROC) load(userptr, "glColorMask");
+ glad_glCompileShader = (PFNGLCOMPILESHADERPROC) load(userptr, "glCompileShader");
+ glad_glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC) load(userptr, "glCompressedTexImage2D");
+ glad_glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) load(userptr, "glCompressedTexSubImage2D");
+ glad_glCopyTexImage2D = (PFNGLCOPYTEXIMAGE2DPROC) load(userptr, "glCopyTexImage2D");
+ glad_glCopyTexSubImage2D = (PFNGLCOPYTEXSUBIMAGE2DPROC) load(userptr, "glCopyTexSubImage2D");
+ glad_glCreateProgram = (PFNGLCREATEPROGRAMPROC) load(userptr, "glCreateProgram");
+ glad_glCreateShader = (PFNGLCREATESHADERPROC) load(userptr, "glCreateShader");
+ glad_glCullFace = (PFNGLCULLFACEPROC) load(userptr, "glCullFace");
+ glad_glDeleteBuffers = (PFNGLDELETEBUFFERSPROC) load(userptr, "glDeleteBuffers");
+ glad_glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC) load(userptr, "glDeleteFramebuffers");
+ glad_glDeleteProgram = (PFNGLDELETEPROGRAMPROC) load(userptr, "glDeleteProgram");
+ glad_glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC) load(userptr, "glDeleteRenderbuffers");
+ glad_glDeleteShader = (PFNGLDELETESHADERPROC) load(userptr, "glDeleteShader");
+ glad_glDeleteTextures = (PFNGLDELETETEXTURESPROC) load(userptr, "glDeleteTextures");
+ glad_glDepthFunc = (PFNGLDEPTHFUNCPROC) load(userptr, "glDepthFunc");
+ glad_glDepthMask = (PFNGLDEPTHMASKPROC) load(userptr, "glDepthMask");
+ glad_glDepthRangef = (PFNGLDEPTHRANGEFPROC) load(userptr, "glDepthRangef");
+ glad_glDetachShader = (PFNGLDETACHSHADERPROC) load(userptr, "glDetachShader");
+ glad_glDisable = (PFNGLDISABLEPROC) load(userptr, "glDisable");
+ glad_glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC) load(userptr, "glDisableVertexAttribArray");
+ glad_glDrawArrays = (PFNGLDRAWARRAYSPROC) load(userptr, "glDrawArrays");
+ glad_glDrawElements = (PFNGLDRAWELEMENTSPROC) load(userptr, "glDrawElements");
+ glad_glEnable = (PFNGLENABLEPROC) load(userptr, "glEnable");
+ glad_glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC) load(userptr, "glEnableVertexAttribArray");
+ glad_glFinish = (PFNGLFINISHPROC) load(userptr, "glFinish");
+ glad_glFlush = (PFNGLFLUSHPROC) load(userptr, "glFlush");
+ glad_glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC) load(userptr, "glFramebufferRenderbuffer");
+ glad_glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC) load(userptr, "glFramebufferTexture2D");
+ glad_glFrontFace = (PFNGLFRONTFACEPROC) load(userptr, "glFrontFace");
+ glad_glGenBuffers = (PFNGLGENBUFFERSPROC) load(userptr, "glGenBuffers");
+ glad_glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC) load(userptr, "glGenFramebuffers");
+ glad_glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC) load(userptr, "glGenRenderbuffers");
+ glad_glGenTextures = (PFNGLGENTEXTURESPROC) load(userptr, "glGenTextures");
+ glad_glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC) load(userptr, "glGenerateMipmap");
+ glad_glGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC) load(userptr, "glGetActiveAttrib");
+ glad_glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC) load(userptr, "glGetActiveUniform");
+ glad_glGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC) load(userptr, "glGetAttachedShaders");
+ glad_glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC) load(userptr, "glGetAttribLocation");
+ glad_glGetBooleanv = (PFNGLGETBOOLEANVPROC) load(userptr, "glGetBooleanv");
+ glad_glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC) load(userptr, "glGetBufferParameteriv");
+ glad_glGetError = (PFNGLGETERRORPROC) load(userptr, "glGetError");
+ glad_glGetFloatv = (PFNGLGETFLOATVPROC) load(userptr, "glGetFloatv");
+ glad_glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) load(userptr, "glGetFramebufferAttachmentParameteriv");
+ glad_glGetIntegerv = (PFNGLGETINTEGERVPROC) load(userptr, "glGetIntegerv");
+ glad_glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC) load(userptr, "glGetProgramInfoLog");
+ glad_glGetProgramiv = (PFNGLGETPROGRAMIVPROC) load(userptr, "glGetProgramiv");
+ glad_glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC) load(userptr, "glGetRenderbufferParameteriv");
+ glad_glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC) load(userptr, "glGetShaderInfoLog");
+ glad_glGetShaderPrecisionFormat = (PFNGLGETSHADERPRECISIONFORMATPROC) load(userptr, "glGetShaderPrecisionFormat");
+ glad_glGetShaderSource = (PFNGLGETSHADERSOURCEPROC) load(userptr, "glGetShaderSource");
+ glad_glGetShaderiv = (PFNGLGETSHADERIVPROC) load(userptr, "glGetShaderiv");
+ glad_glGetString = (PFNGLGETSTRINGPROC) load(userptr, "glGetString");
+ glad_glGetTexParameterfv = (PFNGLGETTEXPARAMETERFVPROC) load(userptr, "glGetTexParameterfv");
+ glad_glGetTexParameteriv = (PFNGLGETTEXPARAMETERIVPROC) load(userptr, "glGetTexParameteriv");
+ glad_glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC) load(userptr, "glGetUniformLocation");
+ glad_glGetUniformfv = (PFNGLGETUNIFORMFVPROC) load(userptr, "glGetUniformfv");
+ glad_glGetUniformiv = (PFNGLGETUNIFORMIVPROC) load(userptr, "glGetUniformiv");
+ glad_glGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC) load(userptr, "glGetVertexAttribPointerv");
+ glad_glGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC) load(userptr, "glGetVertexAttribfv");
+ glad_glGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC) load(userptr, "glGetVertexAttribiv");
+ glad_glHint = (PFNGLHINTPROC) load(userptr, "glHint");
+ glad_glIsBuffer = (PFNGLISBUFFERPROC) load(userptr, "glIsBuffer");
+ glad_glIsEnabled = (PFNGLISENABLEDPROC) load(userptr, "glIsEnabled");
+ glad_glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC) load(userptr, "glIsFramebuffer");
+ glad_glIsProgram = (PFNGLISPROGRAMPROC) load(userptr, "glIsProgram");
+ glad_glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC) load(userptr, "glIsRenderbuffer");
+ glad_glIsShader = (PFNGLISSHADERPROC) load(userptr, "glIsShader");
+ glad_glIsTexture = (PFNGLISTEXTUREPROC) load(userptr, "glIsTexture");
+ glad_glLineWidth = (PFNGLLINEWIDTHPROC) load(userptr, "glLineWidth");
+ glad_glLinkProgram = (PFNGLLINKPROGRAMPROC) load(userptr, "glLinkProgram");
+ glad_glPixelStorei = (PFNGLPIXELSTOREIPROC) load(userptr, "glPixelStorei");
+ glad_glPolygonOffset = (PFNGLPOLYGONOFFSETPROC) load(userptr, "glPolygonOffset");
+ glad_glReadPixels = (PFNGLREADPIXELSPROC) load(userptr, "glReadPixels");
+ glad_glReleaseShaderCompiler = (PFNGLRELEASESHADERCOMPILERPROC) load(userptr, "glReleaseShaderCompiler");
+ glad_glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC) load(userptr, "glRenderbufferStorage");
+ glad_glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC) load(userptr, "glSampleCoverage");
+ glad_glScissor = (PFNGLSCISSORPROC) load(userptr, "glScissor");
+ glad_glShaderBinary = (PFNGLSHADERBINARYPROC) load(userptr, "glShaderBinary");
+ glad_glShaderSource = (PFNGLSHADERSOURCEPROC) load(userptr, "glShaderSource");
+ glad_glStencilFunc = (PFNGLSTENCILFUNCPROC) load(userptr, "glStencilFunc");
+ glad_glStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC) load(userptr, "glStencilFuncSeparate");
+ glad_glStencilMask = (PFNGLSTENCILMASKPROC) load(userptr, "glStencilMask");
+ glad_glStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC) load(userptr, "glStencilMaskSeparate");
+ glad_glStencilOp = (PFNGLSTENCILOPPROC) load(userptr, "glStencilOp");
+ glad_glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC) load(userptr, "glStencilOpSeparate");
+ glad_glTexImage2D = (PFNGLTEXIMAGE2DPROC) load(userptr, "glTexImage2D");
+ glad_glTexParameterf = (PFNGLTEXPARAMETERFPROC) load(userptr, "glTexParameterf");
+ glad_glTexParameterfv = (PFNGLTEXPARAMETERFVPROC) load(userptr, "glTexParameterfv");
+ glad_glTexParameteri = (PFNGLTEXPARAMETERIPROC) load(userptr, "glTexParameteri");
+ glad_glTexParameteriv = (PFNGLTEXPARAMETERIVPROC) load(userptr, "glTexParameteriv");
+ glad_glTexSubImage2D = (PFNGLTEXSUBIMAGE2DPROC) load(userptr, "glTexSubImage2D");
+ glad_glUniform1f = (PFNGLUNIFORM1FPROC) load(userptr, "glUniform1f");
+ glad_glUniform1fv = (PFNGLUNIFORM1FVPROC) load(userptr, "glUniform1fv");
+ glad_glUniform1i = (PFNGLUNIFORM1IPROC) load(userptr, "glUniform1i");
+ glad_glUniform1iv = (PFNGLUNIFORM1IVPROC) load(userptr, "glUniform1iv");
+ glad_glUniform2f = (PFNGLUNIFORM2FPROC) load(userptr, "glUniform2f");
+ glad_glUniform2fv = (PFNGLUNIFORM2FVPROC) load(userptr, "glUniform2fv");
+ glad_glUniform2i = (PFNGLUNIFORM2IPROC) load(userptr, "glUniform2i");
+ glad_glUniform2iv = (PFNGLUNIFORM2IVPROC) load(userptr, "glUniform2iv");
+ glad_glUniform3f = (PFNGLUNIFORM3FPROC) load(userptr, "glUniform3f");
+ glad_glUniform3fv = (PFNGLUNIFORM3FVPROC) load(userptr, "glUniform3fv");
+ glad_glUniform3i = (PFNGLUNIFORM3IPROC) load(userptr, "glUniform3i");
+ glad_glUniform3iv = (PFNGLUNIFORM3IVPROC) load(userptr, "glUniform3iv");
+ glad_glUniform4f = (PFNGLUNIFORM4FPROC) load(userptr, "glUniform4f");
+ glad_glUniform4fv = (PFNGLUNIFORM4FVPROC) load(userptr, "glUniform4fv");
+ glad_glUniform4i = (PFNGLUNIFORM4IPROC) load(userptr, "glUniform4i");
+ glad_glUniform4iv = (PFNGLUNIFORM4IVPROC) load(userptr, "glUniform4iv");
+ glad_glUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC) load(userptr, "glUniformMatrix2fv");
+ glad_glUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC) load(userptr, "glUniformMatrix3fv");
+ glad_glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC) load(userptr, "glUniformMatrix4fv");
+ glad_glUseProgram = (PFNGLUSEPROGRAMPROC) load(userptr, "glUseProgram");
+ glad_glValidateProgram = (PFNGLVALIDATEPROGRAMPROC) load(userptr, "glValidateProgram");
+ glad_glVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC) load(userptr, "glVertexAttrib1f");
+ glad_glVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC) load(userptr, "glVertexAttrib1fv");
+ glad_glVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC) load(userptr, "glVertexAttrib2f");
+ glad_glVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC) load(userptr, "glVertexAttrib2fv");
+ glad_glVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC) load(userptr, "glVertexAttrib3f");
+ glad_glVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC) load(userptr, "glVertexAttrib3fv");
+ glad_glVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC) load(userptr, "glVertexAttrib4f");
+ glad_glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC) load(userptr, "glVertexAttrib4fv");
+ glad_glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC) load(userptr, "glVertexAttribPointer");
+ glad_glViewport = (PFNGLVIEWPORTPROC) load(userptr, "glViewport");
+}
+
+
+
+#if defined(GL_ES_VERSION_3_0) || defined(GL_VERSION_3_0)
+#define GLAD_GL_IS_SOME_NEW_VERSION 1
+#else
+#define GLAD_GL_IS_SOME_NEW_VERSION 0
+#endif
+
+static int glad_gl_get_extensions( int version, const char **out_exts, unsigned int *out_num_exts_i, char ***out_exts_i) {
+#if GLAD_GL_IS_SOME_NEW_VERSION
+ if(GLAD_VERSION_MAJOR(version) < 3) {
+#else
+ (void) version;
+ (void) out_num_exts_i;
+ (void) out_exts_i;
+#endif
+ if (glad_glGetString == NULL) {
+ return 0;
+ }
+ *out_exts = (const char *)glad_glGetString(GL_EXTENSIONS);
+#if GLAD_GL_IS_SOME_NEW_VERSION
+ } else {
+ unsigned int index = 0;
+ unsigned int num_exts_i = 0;
+ char **exts_i = NULL;
+ if (glad_glGetStringi == NULL || glad_glGetIntegerv == NULL) {
+ return 0;
+ }
+ glad_glGetIntegerv(GL_NUM_EXTENSIONS, (int*) &num_exts_i);
+ if (num_exts_i > 0) {
+ exts_i = (char **) malloc(num_exts_i * (sizeof *exts_i));
+ }
+ if (exts_i == NULL) {
+ return 0;
+ }
+ for(index = 0; index < num_exts_i; index++) {
+ const char *gl_str_tmp = (const char*) glad_glGetStringi(GL_EXTENSIONS, index);
+ size_t len = strlen(gl_str_tmp) + 1;
+
+ char *local_str = (char*) malloc(len * sizeof(char));
+ if(local_str != NULL) {
+ memcpy(local_str, gl_str_tmp, len * sizeof(char));
+ }
+
+ exts_i[index] = local_str;
+ }
+
+ *out_num_exts_i = num_exts_i;
+ *out_exts_i = exts_i;
+ }
+#endif
+ return 1;
+}
+static void glad_gl_free_extensions(char **exts_i, unsigned int num_exts_i) {
+ if (exts_i != NULL) {
+ unsigned int index;
+ for(index = 0; index < num_exts_i; index++) {
+ free((void *) (exts_i[index]));
+ }
+ free((void *)exts_i);
+ exts_i = NULL;
+ }
+}
+static int glad_gl_has_extension(int version, const char *exts, unsigned int num_exts_i, char **exts_i, const char *ext) {
+ if(GLAD_VERSION_MAJOR(version) < 3 || !GLAD_GL_IS_SOME_NEW_VERSION) {
+ const char *extensions;
+ const char *loc;
+ const char *terminator;
+ extensions = exts;
+ if(extensions == NULL || ext == NULL) {
+ return 0;
+ }
+ while(1) {
+ loc = strstr(extensions, ext);
+ if(loc == NULL) {
+ return 0;
+ }
+ terminator = loc + strlen(ext);
+ if((loc == extensions || *(loc - 1) == ' ') &&
+ (*terminator == ' ' || *terminator == '\0')) {
+ return 1;
+ }
+ extensions = terminator;
+ }
+ } else {
+ unsigned int index;
+ for(index = 0; index < num_exts_i; index++) {
+ const char *e = exts_i[index];
+ if(strcmp(e, ext) == 0) {
+ return 1;
+ }
+ }
+ }
+ return 0;
+}
+
+static GLADapiproc glad_gl_get_proc_from_userptr(void *userptr, const char* name) {
+ return (GLAD_GNUC_EXTENSION (GLADapiproc (*)(const char *name)) userptr)(name);
+}
+
+static int glad_gl_find_extensions_gles2( int version) {
+ const char *exts = NULL;
+ unsigned int num_exts_i = 0;
+ char **exts_i = NULL;
+ if (!glad_gl_get_extensions(version, &exts, &num_exts_i, &exts_i)) return 0;
+
+ (void) glad_gl_has_extension;
+
+ glad_gl_free_extensions(exts_i, num_exts_i);
+
+ return 1;
+}
+
+static int glad_gl_find_core_gles2(void) {
+ int i;
+ const char* version;
+ const char* prefixes[] = {
+ "OpenGL ES-CM ",
+ "OpenGL ES-CL ",
+ "OpenGL ES ",
+ "OpenGL SC ",
+ NULL
+ };
+ int major = 0;
+ int minor = 0;
+ version = (const char*) glad_glGetString(GL_VERSION);
+ if (!version) return 0;
+ for (i = 0; prefixes[i]; i++) {
+ const size_t length = strlen(prefixes[i]);
+ if (strncmp(version, prefixes[i], length) == 0) {
+ version += length;
+ break;
+ }
+ }
+
+ GLAD_IMPL_UTIL_SSCANF(version, "%d.%d", &major, &minor);
+
+ GLAD_GL_ES_VERSION_2_0 = (major == 2 && minor >= 0) || major > 2;
+
+ return GLAD_MAKE_VERSION(major, minor);
+}
+
+int gladLoadGLES2UserPtr( GLADuserptrloadfunc load, void *userptr) {
+ int version;
+
+ glad_glGetString = (PFNGLGETSTRINGPROC) load(userptr, "glGetString");
+ if(glad_glGetString == NULL) return 0;
+ if(glad_glGetString(GL_VERSION) == NULL) return 0;
+ version = glad_gl_find_core_gles2();
+
+ glad_gl_load_GL_ES_VERSION_2_0(load, userptr);
+
+ if (!glad_gl_find_extensions_gles2(version)) return 0;
+
+
+
+ return version;
+}
+
+
+int gladLoadGLES2( GLADloadfunc load) {
+ return gladLoadGLES2UserPtr( glad_gl_get_proc_from_userptr, GLAD_GNUC_EXTENSION (void*) load);
+}
+
+
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GLAD_GLES2_IMPLEMENTATION */
+
diff --git a/external/GLFW/deps/glad/vulkan.h b/external/GLFW/deps/glad/vulkan.h
new file mode 100644
index 0000000..469ffe5
--- /dev/null
+++ b/external/GLFW/deps/glad/vulkan.h
@@ -0,0 +1,6330 @@
+/**
+ * Loader generated by glad 2.0.0-beta on Thu Jul 7 20:52:04 2022
+ *
+ * Generator: C/C++
+ * Specification: vk
+ * Extensions: 4
+ *
+ * APIs:
+ * - vulkan=1.3
+ *
+ * Options:
+ * - ALIAS = False
+ * - DEBUG = False
+ * - HEADER_ONLY = True
+ * - LOADER = False
+ * - MX = False
+ * - MX_GLOBAL = False
+ * - ON_DEMAND = False
+ *
+ * Commandline:
+ * --api='vulkan=1.3' --extensions='VK_EXT_debug_report,VK_KHR_portability_enumeration,VK_KHR_surface,VK_KHR_swapchain' c --header-only
+ *
+ * Online:
+ * http://glad.sh/#api=vulkan%3D1.3&extensions=VK_EXT_debug_report%2CVK_KHR_portability_enumeration%2CVK_KHR_surface%2CVK_KHR_swapchain&generator=c&options=HEADER_ONLY
+ *
+ */
+
+#ifndef GLAD_VULKAN_H_
+#define GLAD_VULKAN_H_
+
+#ifdef VULKAN_H_
+ #error header already included (API: vulkan), remove previous include!
+#endif
+#define VULKAN_H_ 1
+
+#ifdef VULKAN_CORE_H_
+ #error header already included (API: vulkan), remove previous include!
+#endif
+#define VULKAN_CORE_H_ 1
+
+
+#define GLAD_VULKAN
+#define GLAD_OPTION_VULKAN_HEADER_ONLY
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef GLAD_PLATFORM_H_
+#define GLAD_PLATFORM_H_
+
+#ifndef GLAD_PLATFORM_WIN32
+ #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__MINGW32__)
+ #define GLAD_PLATFORM_WIN32 1
+ #else
+ #define GLAD_PLATFORM_WIN32 0
+ #endif
+#endif
+
+#ifndef GLAD_PLATFORM_APPLE
+ #ifdef __APPLE__
+ #define GLAD_PLATFORM_APPLE 1
+ #else
+ #define GLAD_PLATFORM_APPLE 0
+ #endif
+#endif
+
+#ifndef GLAD_PLATFORM_EMSCRIPTEN
+ #ifdef __EMSCRIPTEN__
+ #define GLAD_PLATFORM_EMSCRIPTEN 1
+ #else
+ #define GLAD_PLATFORM_EMSCRIPTEN 0
+ #endif
+#endif
+
+#ifndef GLAD_PLATFORM_UWP
+ #if defined(_MSC_VER) && !defined(GLAD_INTERNAL_HAVE_WINAPIFAMILY)
+ #ifdef __has_include
+ #if __has_include()
+ #define GLAD_INTERNAL_HAVE_WINAPIFAMILY 1
+ #endif
+ #elif _MSC_VER >= 1700 && !_USING_V110_SDK71_
+ #define GLAD_INTERNAL_HAVE_WINAPIFAMILY 1
+ #endif
+ #endif
+
+ #ifdef GLAD_INTERNAL_HAVE_WINAPIFAMILY
+ #include
+ #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
+ #define GLAD_PLATFORM_UWP 1
+ #endif
+ #endif
+
+ #ifndef GLAD_PLATFORM_UWP
+ #define GLAD_PLATFORM_UWP 0
+ #endif
+#endif
+
+#ifdef __GNUC__
+ #define GLAD_GNUC_EXTENSION __extension__
+#else
+ #define GLAD_GNUC_EXTENSION
+#endif
+
+#ifndef GLAD_API_CALL
+ #if defined(GLAD_API_CALL_EXPORT)
+ #if GLAD_PLATFORM_WIN32 || defined(__CYGWIN__)
+ #if defined(GLAD_API_CALL_EXPORT_BUILD)
+ #if defined(__GNUC__)
+ #define GLAD_API_CALL __attribute__ ((dllexport)) extern
+ #else
+ #define GLAD_API_CALL __declspec(dllexport) extern
+ #endif
+ #else
+ #if defined(__GNUC__)
+ #define GLAD_API_CALL __attribute__ ((dllimport)) extern
+ #else
+ #define GLAD_API_CALL __declspec(dllimport) extern
+ #endif
+ #endif
+ #elif defined(__GNUC__) && defined(GLAD_API_CALL_EXPORT_BUILD)
+ #define GLAD_API_CALL __attribute__ ((visibility ("default"))) extern
+ #else
+ #define GLAD_API_CALL extern
+ #endif
+ #else
+ #define GLAD_API_CALL extern
+ #endif
+#endif
+
+#ifdef APIENTRY
+ #define GLAD_API_PTR APIENTRY
+#elif GLAD_PLATFORM_WIN32
+ #define GLAD_API_PTR __stdcall
+#else
+ #define GLAD_API_PTR
+#endif
+
+#ifndef GLAPI
+#define GLAPI GLAD_API_CALL
+#endif
+
+#ifndef GLAPIENTRY
+#define GLAPIENTRY GLAD_API_PTR
+#endif
+
+#define GLAD_MAKE_VERSION(major, minor) (major * 10000 + minor)
+#define GLAD_VERSION_MAJOR(version) (version / 10000)
+#define GLAD_VERSION_MINOR(version) (version % 10000)
+
+#define GLAD_GENERATOR_VERSION "2.0.0-beta"
+
+typedef void (*GLADapiproc)(void);
+
+typedef GLADapiproc (*GLADloadfunc)(const char *name);
+typedef GLADapiproc (*GLADuserptrloadfunc)(void *userptr, const char *name);
+
+typedef void (*GLADprecallback)(const char *name, GLADapiproc apiproc, int len_args, ...);
+typedef void (*GLADpostcallback)(void *ret, const char *name, GLADapiproc apiproc, int len_args, ...);
+
+#endif /* GLAD_PLATFORM_H_ */
+
+#define VK_ATTACHMENT_UNUSED (~0U)
+#define VK_EXT_DEBUG_REPORT_EXTENSION_NAME "VK_EXT_debug_report"
+#define VK_EXT_DEBUG_REPORT_SPEC_VERSION 10
+#define VK_FALSE 0
+#define VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME "VK_KHR_portability_enumeration"
+#define VK_KHR_PORTABILITY_ENUMERATION_SPEC_VERSION 1
+#define VK_KHR_SURFACE_EXTENSION_NAME "VK_KHR_surface"
+#define VK_KHR_SURFACE_SPEC_VERSION 25
+#define VK_KHR_SWAPCHAIN_EXTENSION_NAME "VK_KHR_swapchain"
+#define VK_KHR_SWAPCHAIN_SPEC_VERSION 70
+#define VK_LOD_CLAMP_NONE 1000.0F
+#define VK_LUID_SIZE 8
+#define VK_MAX_DESCRIPTION_SIZE 256
+#define VK_MAX_DEVICE_GROUP_SIZE 32
+#define VK_MAX_DRIVER_INFO_SIZE 256
+#define VK_MAX_DRIVER_NAME_SIZE 256
+#define VK_MAX_EXTENSION_NAME_SIZE 256
+#define VK_MAX_MEMORY_HEAPS 16
+#define VK_MAX_MEMORY_TYPES 32
+#define VK_MAX_PHYSICAL_DEVICE_NAME_SIZE 256
+#define VK_QUEUE_FAMILY_EXTERNAL (~1U)
+#define VK_QUEUE_FAMILY_IGNORED (~0U)
+#define VK_REMAINING_ARRAY_LAYERS (~0U)
+#define VK_REMAINING_MIP_LEVELS (~0U)
+#define VK_SUBPASS_EXTERNAL (~0U)
+#define VK_TRUE 1
+#define VK_UUID_SIZE 16
+#define VK_WHOLE_SIZE (~0ULL)
+
+
+/* */
+/* File: vk_platform.h */
+/* */
+/*
+** Copyright 2014-2022 The Khronos Group Inc.
+**
+** SPDX-License-Identifier: Apache-2.0
+*/
+
+
+#ifndef VK_PLATFORM_H_
+#define VK_PLATFORM_H_
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/*
+***************************************************************************************************
+* Platform-specific directives and type declarations
+***************************************************************************************************
+*/
+
+/* Platform-specific calling convention macros.
+ *
+ * Platforms should define these so that Vulkan clients call Vulkan commands
+ * with the same calling conventions that the Vulkan implementation expects.
+ *
+ * VKAPI_ATTR - Placed before the return type in function declarations.
+ * Useful for C++11 and GCC/Clang-style function attribute syntax.
+ * VKAPI_CALL - Placed after the return type in function declarations.
+ * Useful for MSVC-style calling convention syntax.
+ * VKAPI_PTR - Placed between the '(' and '*' in function pointer types.
+ *
+ * Function declaration: VKAPI_ATTR void VKAPI_CALL vkCommand(void);
+ * Function pointer type: typedef void (VKAPI_PTR *PFN_vkCommand)(void);
+ */
+#if defined(_WIN32)
+ /* On Windows, Vulkan commands use the stdcall convention */
+ #define VKAPI_ATTR
+ #define VKAPI_CALL __stdcall
+ #define VKAPI_PTR VKAPI_CALL
+#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH < 7
+ #error "Vulkan is not supported for the 'armeabi' NDK ABI"
+#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7 && defined(__ARM_32BIT_STATE)
+ /* On Android 32-bit ARM targets, Vulkan functions use the "hardfloat" */
+ /* calling convention, i.e. float parameters are passed in registers. This */
+ /* is true even if the rest of the application passes floats on the stack, */
+ /* as it does by default when compiling for the armeabi-v7a NDK ABI. */
+ #define VKAPI_ATTR __attribute__((pcs("aapcs-vfp")))
+ #define VKAPI_CALL
+ #define VKAPI_PTR VKAPI_ATTR
+#else
+ /* On other platforms, use the default calling convention */
+ #define VKAPI_ATTR
+ #define VKAPI_CALL
+ #define VKAPI_PTR
+#endif
+
+#if !defined(VK_NO_STDDEF_H)
+ #include
+#endif /* !defined(VK_NO_STDDEF_H) */
+
+#if !defined(VK_NO_STDINT_H)
+ #if defined(_MSC_VER) && (_MSC_VER < 1600)
+ typedef signed __int8 int8_t;
+ typedef unsigned __int8 uint8_t;
+ typedef signed __int16 int16_t;
+ typedef unsigned __int16 uint16_t;
+ typedef signed __int32 int32_t;
+ typedef unsigned __int32 uint32_t;
+ typedef signed __int64 int64_t;
+ typedef unsigned __int64 uint64_t;
+ #else
+ #include
+ #endif
+#endif /* !defined(VK_NO_STDINT_H) */
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif /* __cplusplus */
+
+#endif
+/* DEPRECATED: This define is deprecated. VK_MAKE_API_VERSION should be used instead. */
+#define VK_MAKE_VERSION(major, minor, patch) \
+ ((((uint32_t)(major)) << 22) | (((uint32_t)(minor)) << 12) | ((uint32_t)(patch)))
+/* DEPRECATED: This define is deprecated. VK_API_VERSION_MAJOR should be used instead. */
+#define VK_VERSION_MAJOR(version) ((uint32_t)(version) >> 22)
+/* DEPRECATED: This define is deprecated. VK_API_VERSION_MINOR should be used instead. */
+#define VK_VERSION_MINOR(version) (((uint32_t)(version) >> 12) & 0x3FFU)
+/* DEPRECATED: This define is deprecated. VK_API_VERSION_PATCH should be used instead. */
+#define VK_VERSION_PATCH(version) ((uint32_t)(version) & 0xFFFU)
+#define VK_MAKE_API_VERSION(variant, major, minor, patch) \
+ ((((uint32_t)(variant)) << 29) | (((uint32_t)(major)) << 22) | (((uint32_t)(minor)) << 12) | ((uint32_t)(patch)))
+#define VK_API_VERSION_VARIANT(version) ((uint32_t)(version) >> 29)
+#define VK_API_VERSION_MAJOR(version) (((uint32_t)(version) >> 22) & 0x7FU)
+#define VK_API_VERSION_MINOR(version) (((uint32_t)(version) >> 12) & 0x3FFU)
+#define VK_API_VERSION_PATCH(version) ((uint32_t)(version) & 0xFFFU)
+/* DEPRECATED: This define has been removed. Specific version defines (e.g. VK_API_VERSION_1_0), or the VK_MAKE_VERSION macro, should be used instead. */
+/*#define VK_API_VERSION VK_MAKE_VERSION(1, 0, 0) // Patch version should always be set to 0 */
+/* Vulkan 1.0 version number */
+#define VK_API_VERSION_1_0 VK_MAKE_API_VERSION(0, 1, 0, 0)/* Patch version should always be set to 0 */
+/* Vulkan 1.1 version number */
+#define VK_API_VERSION_1_1 VK_MAKE_API_VERSION(0, 1, 1, 0)/* Patch version should always be set to 0 */
+/* Vulkan 1.2 version number */
+#define VK_API_VERSION_1_2 VK_MAKE_API_VERSION(0, 1, 2, 0)/* Patch version should always be set to 0 */
+/* Vulkan 1.3 version number */
+#define VK_API_VERSION_1_3 VK_MAKE_API_VERSION(0, 1, 3, 0)/* Patch version should always be set to 0 */
+/* Version of this file */
+#define VK_HEADER_VERSION 220
+/* Complete version of this file */
+#define VK_HEADER_VERSION_COMPLETE VK_MAKE_API_VERSION(0, 1, 3, VK_HEADER_VERSION)
+#define VK_DEFINE_HANDLE(object) typedef struct object##_T* object;
+#ifndef VK_USE_64_BIT_PTR_DEFINES
+ #if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__) ) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__)
+ #define VK_USE_64_BIT_PTR_DEFINES 1
+ #else
+ #define VK_USE_64_BIT_PTR_DEFINES 0
+ #endif
+#endif
+#ifndef VK_DEFINE_NON_DISPATCHABLE_HANDLE
+ #if (VK_USE_64_BIT_PTR_DEFINES==1)
+ #if (defined(__cplusplus) && (__cplusplus >= 201103L)) || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201103L))
+ #define VK_NULL_HANDLE nullptr
+ #else
+ #define VK_NULL_HANDLE ((void*)0)
+ #endif
+ #else
+ #define VK_NULL_HANDLE 0ULL
+ #endif
+#endif
+#ifndef VK_NULL_HANDLE
+ #define VK_NULL_HANDLE 0
+#endif
+#ifndef VK_DEFINE_NON_DISPATCHABLE_HANDLE
+ #if (VK_USE_64_BIT_PTR_DEFINES==1)
+ #define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef struct object##_T *object;
+ #else
+ #define VK_DEFINE_NON_DISPATCHABLE_HANDLE(object) typedef uint64_t object;
+ #endif
+#endif
+
+
+
+
+
+
+
+
+VK_DEFINE_HANDLE(VkInstance)
+VK_DEFINE_HANDLE(VkPhysicalDevice)
+VK_DEFINE_HANDLE(VkDevice)
+VK_DEFINE_HANDLE(VkQueue)
+VK_DEFINE_HANDLE(VkCommandBuffer)
+VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDeviceMemory)
+VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCommandPool)
+VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkBuffer)
+VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkBufferView)
+VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkImage)
+VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkImageView)
+VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkShaderModule)
+VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipeline)
+VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipelineLayout)
+VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSampler)
+VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorSet)
+VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorSetLayout)
+VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorPool)
+VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkFence)
+VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSemaphore)
+VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkEvent)
+VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkQueryPool)
+VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkFramebuffer)
+VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkRenderPass)
+VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPipelineCache)
+VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorUpdateTemplate)
+VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSamplerYcbcrConversion)
+VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPrivateDataSlot)
+VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR)
+VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSwapchainKHR)
+VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDebugReportCallbackEXT)
+typedef enum VkAttachmentLoadOp {
+ VK_ATTACHMENT_LOAD_OP_LOAD = 0,
+ VK_ATTACHMENT_LOAD_OP_CLEAR = 1,
+ VK_ATTACHMENT_LOAD_OP_DONT_CARE = 2,
+ VK_ATTACHMENT_LOAD_OP_MAX_ENUM = 0x7FFFFFFF
+} VkAttachmentLoadOp;
+typedef enum VkAttachmentStoreOp {
+ VK_ATTACHMENT_STORE_OP_STORE = 0,
+ VK_ATTACHMENT_STORE_OP_DONT_CARE = 1,
+ VK_ATTACHMENT_STORE_OP_NONE = 1000301000,
+ VK_ATTACHMENT_STORE_OP_MAX_ENUM = 0x7FFFFFFF
+} VkAttachmentStoreOp;
+typedef enum VkBlendFactor {
+ VK_BLEND_FACTOR_ZERO = 0,
+ VK_BLEND_FACTOR_ONE = 1,
+ VK_BLEND_FACTOR_SRC_COLOR = 2,
+ VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR = 3,
+ VK_BLEND_FACTOR_DST_COLOR = 4,
+ VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR = 5,
+ VK_BLEND_FACTOR_SRC_ALPHA = 6,
+ VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = 7,
+ VK_BLEND_FACTOR_DST_ALPHA = 8,
+ VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA = 9,
+ VK_BLEND_FACTOR_CONSTANT_COLOR = 10,
+ VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR = 11,
+ VK_BLEND_FACTOR_CONSTANT_ALPHA = 12,
+ VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA = 13,
+ VK_BLEND_FACTOR_SRC_ALPHA_SATURATE = 14,
+ VK_BLEND_FACTOR_SRC1_COLOR = 15,
+ VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR = 16,
+ VK_BLEND_FACTOR_SRC1_ALPHA = 17,
+ VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA = 18,
+ VK_BLEND_FACTOR_MAX_ENUM = 0x7FFFFFFF
+} VkBlendFactor;
+typedef enum VkBlendOp {
+ VK_BLEND_OP_ADD = 0,
+ VK_BLEND_OP_SUBTRACT = 1,
+ VK_BLEND_OP_REVERSE_SUBTRACT = 2,
+ VK_BLEND_OP_MIN = 3,
+ VK_BLEND_OP_MAX = 4,
+ VK_BLEND_OP_MAX_ENUM = 0x7FFFFFFF
+} VkBlendOp;
+typedef enum VkBorderColor {
+ VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK = 0,
+ VK_BORDER_COLOR_INT_TRANSPARENT_BLACK = 1,
+ VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK = 2,
+ VK_BORDER_COLOR_INT_OPAQUE_BLACK = 3,
+ VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE = 4,
+ VK_BORDER_COLOR_INT_OPAQUE_WHITE = 5,
+ VK_BORDER_COLOR_MAX_ENUM = 0x7FFFFFFF
+} VkBorderColor;
+typedef enum VkFramebufferCreateFlagBits {
+ VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT = 1,
+ VK_FRAMEBUFFER_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkFramebufferCreateFlagBits;
+typedef enum VkPipelineCacheHeaderVersion {
+ VK_PIPELINE_CACHE_HEADER_VERSION_ONE = 1,
+ VK_PIPELINE_CACHE_HEADER_VERSION_MAX_ENUM = 0x7FFFFFFF
+} VkPipelineCacheHeaderVersion;
+typedef enum VkPipelineCacheCreateFlagBits {
+ VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT = 1,
+ VK_PIPELINE_CACHE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkPipelineCacheCreateFlagBits;
+typedef enum VkPipelineShaderStageCreateFlagBits {
+ VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT = 1,
+ VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT = 2,
+ VK_PIPELINE_SHADER_STAGE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkPipelineShaderStageCreateFlagBits;
+typedef enum VkDescriptorSetLayoutCreateFlagBits {
+ VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT = 2,
+ VK_DESCRIPTOR_SET_LAYOUT_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkDescriptorSetLayoutCreateFlagBits;
+typedef enum VkInstanceCreateFlagBits {
+ VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR = 1,
+ VK_INSTANCE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkInstanceCreateFlagBits;
+typedef enum VkDeviceQueueCreateFlagBits {
+ VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT = 1,
+ VK_DEVICE_QUEUE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkDeviceQueueCreateFlagBits;
+typedef enum VkBufferCreateFlagBits {
+ VK_BUFFER_CREATE_SPARSE_BINDING_BIT = 1,
+ VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT = 2,
+ VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 4,
+ VK_BUFFER_CREATE_PROTECTED_BIT = 8,
+ VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT = 16,
+ VK_BUFFER_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkBufferCreateFlagBits;
+typedef enum VkBufferUsageFlagBits {
+ VK_BUFFER_USAGE_TRANSFER_SRC_BIT = 1,
+ VK_BUFFER_USAGE_TRANSFER_DST_BIT = 2,
+ VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT = 4,
+ VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT = 8,
+ VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT = 16,
+ VK_BUFFER_USAGE_STORAGE_BUFFER_BIT = 32,
+ VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 64,
+ VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 128,
+ VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 256,
+ VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT = 131072,
+ VK_BUFFER_USAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkBufferUsageFlagBits;
+typedef enum VkColorComponentFlagBits {
+ VK_COLOR_COMPONENT_R_BIT = 1,
+ VK_COLOR_COMPONENT_G_BIT = 2,
+ VK_COLOR_COMPONENT_B_BIT = 4,
+ VK_COLOR_COMPONENT_A_BIT = 8,
+ VK_COLOR_COMPONENT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkColorComponentFlagBits;
+typedef enum VkComponentSwizzle {
+ VK_COMPONENT_SWIZZLE_IDENTITY = 0,
+ VK_COMPONENT_SWIZZLE_ZERO = 1,
+ VK_COMPONENT_SWIZZLE_ONE = 2,
+ VK_COMPONENT_SWIZZLE_R = 3,
+ VK_COMPONENT_SWIZZLE_G = 4,
+ VK_COMPONENT_SWIZZLE_B = 5,
+ VK_COMPONENT_SWIZZLE_A = 6,
+ VK_COMPONENT_SWIZZLE_MAX_ENUM = 0x7FFFFFFF
+} VkComponentSwizzle;
+typedef enum VkCommandPoolCreateFlagBits {
+ VK_COMMAND_POOL_CREATE_TRANSIENT_BIT = 1,
+ VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT = 2,
+ VK_COMMAND_POOL_CREATE_PROTECTED_BIT = 4,
+ VK_COMMAND_POOL_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkCommandPoolCreateFlagBits;
+typedef enum VkCommandPoolResetFlagBits {
+ VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT = 1,
+ VK_COMMAND_POOL_RESET_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkCommandPoolResetFlagBits;
+typedef enum VkCommandBufferResetFlagBits {
+ VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT = 1,
+ VK_COMMAND_BUFFER_RESET_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkCommandBufferResetFlagBits;
+typedef enum VkCommandBufferLevel {
+ VK_COMMAND_BUFFER_LEVEL_PRIMARY = 0,
+ VK_COMMAND_BUFFER_LEVEL_SECONDARY = 1,
+ VK_COMMAND_BUFFER_LEVEL_MAX_ENUM = 0x7FFFFFFF
+} VkCommandBufferLevel;
+typedef enum VkCommandBufferUsageFlagBits {
+ VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT = 1,
+ VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT = 2,
+ VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 4,
+ VK_COMMAND_BUFFER_USAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkCommandBufferUsageFlagBits;
+typedef enum VkCompareOp {
+ VK_COMPARE_OP_NEVER = 0,
+ VK_COMPARE_OP_LESS = 1,
+ VK_COMPARE_OP_EQUAL = 2,
+ VK_COMPARE_OP_LESS_OR_EQUAL = 3,
+ VK_COMPARE_OP_GREATER = 4,
+ VK_COMPARE_OP_NOT_EQUAL = 5,
+ VK_COMPARE_OP_GREATER_OR_EQUAL = 6,
+ VK_COMPARE_OP_ALWAYS = 7,
+ VK_COMPARE_OP_MAX_ENUM = 0x7FFFFFFF
+} VkCompareOp;
+typedef enum VkCullModeFlagBits {
+ VK_CULL_MODE_NONE = 0,
+ VK_CULL_MODE_FRONT_BIT = 1,
+ VK_CULL_MODE_BACK_BIT = 2,
+ VK_CULL_MODE_FRONT_AND_BACK = 0x00000003,
+ VK_CULL_MODE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkCullModeFlagBits;
+typedef enum VkDescriptorType {
+ VK_DESCRIPTOR_TYPE_SAMPLER = 0,
+ VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER = 1,
+ VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE = 2,
+ VK_DESCRIPTOR_TYPE_STORAGE_IMAGE = 3,
+ VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER = 4,
+ VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER = 5,
+ VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER = 6,
+ VK_DESCRIPTOR_TYPE_STORAGE_BUFFER = 7,
+ VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC = 8,
+ VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC = 9,
+ VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT = 10,
+ VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK = 1000138000,
+ VK_DESCRIPTOR_TYPE_MAX_ENUM = 0x7FFFFFFF
+} VkDescriptorType;
+typedef enum VkDynamicState {
+ VK_DYNAMIC_STATE_VIEWPORT = 0,
+ VK_DYNAMIC_STATE_SCISSOR = 1,
+ VK_DYNAMIC_STATE_LINE_WIDTH = 2,
+ VK_DYNAMIC_STATE_DEPTH_BIAS = 3,
+ VK_DYNAMIC_STATE_BLEND_CONSTANTS = 4,
+ VK_DYNAMIC_STATE_DEPTH_BOUNDS = 5,
+ VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 6,
+ VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 7,
+ VK_DYNAMIC_STATE_STENCIL_REFERENCE = 8,
+ VK_DYNAMIC_STATE_CULL_MODE = 1000267000,
+ VK_DYNAMIC_STATE_FRONT_FACE = 1000267001,
+ VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY = 1000267002,
+ VK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT = 1000267003,
+ VK_DYNAMIC_STATE_SCISSOR_WITH_COUNT = 1000267004,
+ VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE = 1000267005,
+ VK_DYNAMIC_STATE_DEPTH_TEST_ENABLE = 1000267006,
+ VK_DYNAMIC_STATE_DEPTH_WRITE_ENABLE = 1000267007,
+ VK_DYNAMIC_STATE_DEPTH_COMPARE_OP = 1000267008,
+ VK_DYNAMIC_STATE_DEPTH_BOUNDS_TEST_ENABLE = 1000267009,
+ VK_DYNAMIC_STATE_STENCIL_TEST_ENABLE = 1000267010,
+ VK_DYNAMIC_STATE_STENCIL_OP = 1000267011,
+ VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE = 1000377001,
+ VK_DYNAMIC_STATE_DEPTH_BIAS_ENABLE = 1000377002,
+ VK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE = 1000377004,
+ VK_DYNAMIC_STATE_MAX_ENUM = 0x7FFFFFFF
+} VkDynamicState;
+typedef enum VkFenceCreateFlagBits {
+ VK_FENCE_CREATE_SIGNALED_BIT = 1,
+ VK_FENCE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkFenceCreateFlagBits;
+typedef enum VkPolygonMode {
+ VK_POLYGON_MODE_FILL = 0,
+ VK_POLYGON_MODE_LINE = 1,
+ VK_POLYGON_MODE_POINT = 2,
+ VK_POLYGON_MODE_MAX_ENUM = 0x7FFFFFFF
+} VkPolygonMode;
+typedef enum VkFormat {
+ VK_FORMAT_UNDEFINED = 0,
+ VK_FORMAT_R4G4_UNORM_PACK8 = 1,
+ VK_FORMAT_R4G4B4A4_UNORM_PACK16 = 2,
+ VK_FORMAT_B4G4R4A4_UNORM_PACK16 = 3,
+ VK_FORMAT_R5G6B5_UNORM_PACK16 = 4,
+ VK_FORMAT_B5G6R5_UNORM_PACK16 = 5,
+ VK_FORMAT_R5G5B5A1_UNORM_PACK16 = 6,
+ VK_FORMAT_B5G5R5A1_UNORM_PACK16 = 7,
+ VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8,
+ VK_FORMAT_R8_UNORM = 9,
+ VK_FORMAT_R8_SNORM = 10,
+ VK_FORMAT_R8_USCALED = 11,
+ VK_FORMAT_R8_SSCALED = 12,
+ VK_FORMAT_R8_UINT = 13,
+ VK_FORMAT_R8_SINT = 14,
+ VK_FORMAT_R8_SRGB = 15,
+ VK_FORMAT_R8G8_UNORM = 16,
+ VK_FORMAT_R8G8_SNORM = 17,
+ VK_FORMAT_R8G8_USCALED = 18,
+ VK_FORMAT_R8G8_SSCALED = 19,
+ VK_FORMAT_R8G8_UINT = 20,
+ VK_FORMAT_R8G8_SINT = 21,
+ VK_FORMAT_R8G8_SRGB = 22,
+ VK_FORMAT_R8G8B8_UNORM = 23,
+ VK_FORMAT_R8G8B8_SNORM = 24,
+ VK_FORMAT_R8G8B8_USCALED = 25,
+ VK_FORMAT_R8G8B8_SSCALED = 26,
+ VK_FORMAT_R8G8B8_UINT = 27,
+ VK_FORMAT_R8G8B8_SINT = 28,
+ VK_FORMAT_R8G8B8_SRGB = 29,
+ VK_FORMAT_B8G8R8_UNORM = 30,
+ VK_FORMAT_B8G8R8_SNORM = 31,
+ VK_FORMAT_B8G8R8_USCALED = 32,
+ VK_FORMAT_B8G8R8_SSCALED = 33,
+ VK_FORMAT_B8G8R8_UINT = 34,
+ VK_FORMAT_B8G8R8_SINT = 35,
+ VK_FORMAT_B8G8R8_SRGB = 36,
+ VK_FORMAT_R8G8B8A8_UNORM = 37,
+ VK_FORMAT_R8G8B8A8_SNORM = 38,
+ VK_FORMAT_R8G8B8A8_USCALED = 39,
+ VK_FORMAT_R8G8B8A8_SSCALED = 40,
+ VK_FORMAT_R8G8B8A8_UINT = 41,
+ VK_FORMAT_R8G8B8A8_SINT = 42,
+ VK_FORMAT_R8G8B8A8_SRGB = 43,
+ VK_FORMAT_B8G8R8A8_UNORM = 44,
+ VK_FORMAT_B8G8R8A8_SNORM = 45,
+ VK_FORMAT_B8G8R8A8_USCALED = 46,
+ VK_FORMAT_B8G8R8A8_SSCALED = 47,
+ VK_FORMAT_B8G8R8A8_UINT = 48,
+ VK_FORMAT_B8G8R8A8_SINT = 49,
+ VK_FORMAT_B8G8R8A8_SRGB = 50,
+ VK_FORMAT_A8B8G8R8_UNORM_PACK32 = 51,
+ VK_FORMAT_A8B8G8R8_SNORM_PACK32 = 52,
+ VK_FORMAT_A8B8G8R8_USCALED_PACK32 = 53,
+ VK_FORMAT_A8B8G8R8_SSCALED_PACK32 = 54,
+ VK_FORMAT_A8B8G8R8_UINT_PACK32 = 55,
+ VK_FORMAT_A8B8G8R8_SINT_PACK32 = 56,
+ VK_FORMAT_A8B8G8R8_SRGB_PACK32 = 57,
+ VK_FORMAT_A2R10G10B10_UNORM_PACK32 = 58,
+ VK_FORMAT_A2R10G10B10_SNORM_PACK32 = 59,
+ VK_FORMAT_A2R10G10B10_USCALED_PACK32 = 60,
+ VK_FORMAT_A2R10G10B10_SSCALED_PACK32 = 61,
+ VK_FORMAT_A2R10G10B10_UINT_PACK32 = 62,
+ VK_FORMAT_A2R10G10B10_SINT_PACK32 = 63,
+ VK_FORMAT_A2B10G10R10_UNORM_PACK32 = 64,
+ VK_FORMAT_A2B10G10R10_SNORM_PACK32 = 65,
+ VK_FORMAT_A2B10G10R10_USCALED_PACK32 = 66,
+ VK_FORMAT_A2B10G10R10_SSCALED_PACK32 = 67,
+ VK_FORMAT_A2B10G10R10_UINT_PACK32 = 68,
+ VK_FORMAT_A2B10G10R10_SINT_PACK32 = 69,
+ VK_FORMAT_R16_UNORM = 70,
+ VK_FORMAT_R16_SNORM = 71,
+ VK_FORMAT_R16_USCALED = 72,
+ VK_FORMAT_R16_SSCALED = 73,
+ VK_FORMAT_R16_UINT = 74,
+ VK_FORMAT_R16_SINT = 75,
+ VK_FORMAT_R16_SFLOAT = 76,
+ VK_FORMAT_R16G16_UNORM = 77,
+ VK_FORMAT_R16G16_SNORM = 78,
+ VK_FORMAT_R16G16_USCALED = 79,
+ VK_FORMAT_R16G16_SSCALED = 80,
+ VK_FORMAT_R16G16_UINT = 81,
+ VK_FORMAT_R16G16_SINT = 82,
+ VK_FORMAT_R16G16_SFLOAT = 83,
+ VK_FORMAT_R16G16B16_UNORM = 84,
+ VK_FORMAT_R16G16B16_SNORM = 85,
+ VK_FORMAT_R16G16B16_USCALED = 86,
+ VK_FORMAT_R16G16B16_SSCALED = 87,
+ VK_FORMAT_R16G16B16_UINT = 88,
+ VK_FORMAT_R16G16B16_SINT = 89,
+ VK_FORMAT_R16G16B16_SFLOAT = 90,
+ VK_FORMAT_R16G16B16A16_UNORM = 91,
+ VK_FORMAT_R16G16B16A16_SNORM = 92,
+ VK_FORMAT_R16G16B16A16_USCALED = 93,
+ VK_FORMAT_R16G16B16A16_SSCALED = 94,
+ VK_FORMAT_R16G16B16A16_UINT = 95,
+ VK_FORMAT_R16G16B16A16_SINT = 96,
+ VK_FORMAT_R16G16B16A16_SFLOAT = 97,
+ VK_FORMAT_R32_UINT = 98,
+ VK_FORMAT_R32_SINT = 99,
+ VK_FORMAT_R32_SFLOAT = 100,
+ VK_FORMAT_R32G32_UINT = 101,
+ VK_FORMAT_R32G32_SINT = 102,
+ VK_FORMAT_R32G32_SFLOAT = 103,
+ VK_FORMAT_R32G32B32_UINT = 104,
+ VK_FORMAT_R32G32B32_SINT = 105,
+ VK_FORMAT_R32G32B32_SFLOAT = 106,
+ VK_FORMAT_R32G32B32A32_UINT = 107,
+ VK_FORMAT_R32G32B32A32_SINT = 108,
+ VK_FORMAT_R32G32B32A32_SFLOAT = 109,
+ VK_FORMAT_R64_UINT = 110,
+ VK_FORMAT_R64_SINT = 111,
+ VK_FORMAT_R64_SFLOAT = 112,
+ VK_FORMAT_R64G64_UINT = 113,
+ VK_FORMAT_R64G64_SINT = 114,
+ VK_FORMAT_R64G64_SFLOAT = 115,
+ VK_FORMAT_R64G64B64_UINT = 116,
+ VK_FORMAT_R64G64B64_SINT = 117,
+ VK_FORMAT_R64G64B64_SFLOAT = 118,
+ VK_FORMAT_R64G64B64A64_UINT = 119,
+ VK_FORMAT_R64G64B64A64_SINT = 120,
+ VK_FORMAT_R64G64B64A64_SFLOAT = 121,
+ VK_FORMAT_B10G11R11_UFLOAT_PACK32 = 122,
+ VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 = 123,
+ VK_FORMAT_D16_UNORM = 124,
+ VK_FORMAT_X8_D24_UNORM_PACK32 = 125,
+ VK_FORMAT_D32_SFLOAT = 126,
+ VK_FORMAT_S8_UINT = 127,
+ VK_FORMAT_D16_UNORM_S8_UINT = 128,
+ VK_FORMAT_D24_UNORM_S8_UINT = 129,
+ VK_FORMAT_D32_SFLOAT_S8_UINT = 130,
+ VK_FORMAT_BC1_RGB_UNORM_BLOCK = 131,
+ VK_FORMAT_BC1_RGB_SRGB_BLOCK = 132,
+ VK_FORMAT_BC1_RGBA_UNORM_BLOCK = 133,
+ VK_FORMAT_BC1_RGBA_SRGB_BLOCK = 134,
+ VK_FORMAT_BC2_UNORM_BLOCK = 135,
+ VK_FORMAT_BC2_SRGB_BLOCK = 136,
+ VK_FORMAT_BC3_UNORM_BLOCK = 137,
+ VK_FORMAT_BC3_SRGB_BLOCK = 138,
+ VK_FORMAT_BC4_UNORM_BLOCK = 139,
+ VK_FORMAT_BC4_SNORM_BLOCK = 140,
+ VK_FORMAT_BC5_UNORM_BLOCK = 141,
+ VK_FORMAT_BC5_SNORM_BLOCK = 142,
+ VK_FORMAT_BC6H_UFLOAT_BLOCK = 143,
+ VK_FORMAT_BC6H_SFLOAT_BLOCK = 144,
+ VK_FORMAT_BC7_UNORM_BLOCK = 145,
+ VK_FORMAT_BC7_SRGB_BLOCK = 146,
+ VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 147,
+ VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 148,
+ VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 149,
+ VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 150,
+ VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 151,
+ VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 152,
+ VK_FORMAT_EAC_R11_UNORM_BLOCK = 153,
+ VK_FORMAT_EAC_R11_SNORM_BLOCK = 154,
+ VK_FORMAT_EAC_R11G11_UNORM_BLOCK = 155,
+ VK_FORMAT_EAC_R11G11_SNORM_BLOCK = 156,
+ VK_FORMAT_ASTC_4x4_UNORM_BLOCK = 157,
+ VK_FORMAT_ASTC_4x4_SRGB_BLOCK = 158,
+ VK_FORMAT_ASTC_5x4_UNORM_BLOCK = 159,
+ VK_FORMAT_ASTC_5x4_SRGB_BLOCK = 160,
+ VK_FORMAT_ASTC_5x5_UNORM_BLOCK = 161,
+ VK_FORMAT_ASTC_5x5_SRGB_BLOCK = 162,
+ VK_FORMAT_ASTC_6x5_UNORM_BLOCK = 163,
+ VK_FORMAT_ASTC_6x5_SRGB_BLOCK = 164,
+ VK_FORMAT_ASTC_6x6_UNORM_BLOCK = 165,
+ VK_FORMAT_ASTC_6x6_SRGB_BLOCK = 166,
+ VK_FORMAT_ASTC_8x5_UNORM_BLOCK = 167,
+ VK_FORMAT_ASTC_8x5_SRGB_BLOCK = 168,
+ VK_FORMAT_ASTC_8x6_UNORM_BLOCK = 169,
+ VK_FORMAT_ASTC_8x6_SRGB_BLOCK = 170,
+ VK_FORMAT_ASTC_8x8_UNORM_BLOCK = 171,
+ VK_FORMAT_ASTC_8x8_SRGB_BLOCK = 172,
+ VK_FORMAT_ASTC_10x5_UNORM_BLOCK = 173,
+ VK_FORMAT_ASTC_10x5_SRGB_BLOCK = 174,
+ VK_FORMAT_ASTC_10x6_UNORM_BLOCK = 175,
+ VK_FORMAT_ASTC_10x6_SRGB_BLOCK = 176,
+ VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177,
+ VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178,
+ VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179,
+ VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180,
+ VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181,
+ VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182,
+ VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183,
+ VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184,
+ VK_FORMAT_G8B8G8R8_422_UNORM = 1000156000,
+ VK_FORMAT_B8G8R8G8_422_UNORM = 1000156001,
+ VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM = 1000156002,
+ VK_FORMAT_G8_B8R8_2PLANE_420_UNORM = 1000156003,
+ VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM = 1000156004,
+ VK_FORMAT_G8_B8R8_2PLANE_422_UNORM = 1000156005,
+ VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM = 1000156006,
+ VK_FORMAT_R10X6_UNORM_PACK16 = 1000156007,
+ VK_FORMAT_R10X6G10X6_UNORM_2PACK16 = 1000156008,
+ VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16 = 1000156009,
+ VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16 = 1000156010,
+ VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16 = 1000156011,
+ VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16 = 1000156012,
+ VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16 = 1000156013,
+ VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16 = 1000156014,
+ VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16 = 1000156015,
+ VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16 = 1000156016,
+ VK_FORMAT_R12X4_UNORM_PACK16 = 1000156017,
+ VK_FORMAT_R12X4G12X4_UNORM_2PACK16 = 1000156018,
+ VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16 = 1000156019,
+ VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16 = 1000156020,
+ VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16 = 1000156021,
+ VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16 = 1000156022,
+ VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16 = 1000156023,
+ VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16 = 1000156024,
+ VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16 = 1000156025,
+ VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16 = 1000156026,
+ VK_FORMAT_G16B16G16R16_422_UNORM = 1000156027,
+ VK_FORMAT_B16G16R16G16_422_UNORM = 1000156028,
+ VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM = 1000156029,
+ VK_FORMAT_G16_B16R16_2PLANE_420_UNORM = 1000156030,
+ VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM = 1000156031,
+ VK_FORMAT_G16_B16R16_2PLANE_422_UNORM = 1000156032,
+ VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM = 1000156033,
+ VK_FORMAT_G8_B8R8_2PLANE_444_UNORM = 1000330000,
+ VK_FORMAT_G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16 = 1000330001,
+ VK_FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16 = 1000330002,
+ VK_FORMAT_G16_B16R16_2PLANE_444_UNORM = 1000330003,
+ VK_FORMAT_A4R4G4B4_UNORM_PACK16 = 1000340000,
+ VK_FORMAT_A4B4G4R4_UNORM_PACK16 = 1000340001,
+ VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK = 1000066000,
+ VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK = 1000066001,
+ VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK = 1000066002,
+ VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK = 1000066003,
+ VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK = 1000066004,
+ VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK = 1000066005,
+ VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK = 1000066006,
+ VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK = 1000066007,
+ VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK = 1000066008,
+ VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK = 1000066009,
+ VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK = 1000066010,
+ VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK = 1000066011,
+ VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK = 1000066012,
+ VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK = 1000066013,
+ VK_FORMAT_MAX_ENUM = 0x7FFFFFFF
+} VkFormat;
+typedef enum VkFormatFeatureFlagBits {
+ VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT = 1,
+ VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT = 2,
+ VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT = 4,
+ VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT = 8,
+ VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT = 16,
+ VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 32,
+ VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT = 64,
+ VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT = 128,
+ VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT = 256,
+ VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT = 512,
+ VK_FORMAT_FEATURE_BLIT_SRC_BIT = 1024,
+ VK_FORMAT_FEATURE_BLIT_DST_BIT = 2048,
+ VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 4096,
+ VK_FORMAT_FEATURE_TRANSFER_SRC_BIT = 16384,
+ VK_FORMAT_FEATURE_TRANSFER_DST_BIT = 32768,
+ VK_FORMAT_FEATURE_MIDPOINT_CHROMA_SAMPLES_BIT = 131072,
+ VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT = 262144,
+ VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT = 524288,
+ VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT = 1048576,
+ VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT = 2097152,
+ VK_FORMAT_FEATURE_DISJOINT_BIT = 4194304,
+ VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT = 8388608,
+ VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT = 65536,
+ VK_FORMAT_FEATURE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkFormatFeatureFlagBits;
+typedef enum VkFrontFace {
+ VK_FRONT_FACE_COUNTER_CLOCKWISE = 0,
+ VK_FRONT_FACE_CLOCKWISE = 1,
+ VK_FRONT_FACE_MAX_ENUM = 0x7FFFFFFF
+} VkFrontFace;
+typedef enum VkImageAspectFlagBits {
+ VK_IMAGE_ASPECT_COLOR_BIT = 1,
+ VK_IMAGE_ASPECT_DEPTH_BIT = 2,
+ VK_IMAGE_ASPECT_STENCIL_BIT = 4,
+ VK_IMAGE_ASPECT_METADATA_BIT = 8,
+ VK_IMAGE_ASPECT_PLANE_0_BIT = 16,
+ VK_IMAGE_ASPECT_PLANE_1_BIT = 32,
+ VK_IMAGE_ASPECT_PLANE_2_BIT = 64,
+ VK_IMAGE_ASPECT_NONE = 0,
+ VK_IMAGE_ASPECT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkImageAspectFlagBits;
+typedef enum VkImageCreateFlagBits {
+ VK_IMAGE_CREATE_SPARSE_BINDING_BIT = 1,
+ VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT = 2,
+ VK_IMAGE_CREATE_SPARSE_ALIASED_BIT = 4,
+ VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 8,
+ VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT = 16,
+ VK_IMAGE_CREATE_ALIAS_BIT = 1024,
+ VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT = 64,
+ VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT = 32,
+ VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT = 128,
+ VK_IMAGE_CREATE_EXTENDED_USAGE_BIT = 256,
+ VK_IMAGE_CREATE_PROTECTED_BIT = 2048,
+ VK_IMAGE_CREATE_DISJOINT_BIT = 512,
+ VK_IMAGE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkImageCreateFlagBits;
+typedef enum VkImageLayout {
+ VK_IMAGE_LAYOUT_UNDEFINED = 0,
+ VK_IMAGE_LAYOUT_GENERAL = 1,
+ VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL = 2,
+ VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL = 3,
+ VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL = 4,
+ VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL = 5,
+ VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL = 6,
+ VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL = 7,
+ VK_IMAGE_LAYOUT_PREINITIALIZED = 8,
+ VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL = 1000117000,
+ VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL = 1000117001,
+ VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL = 1000241000,
+ VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL = 1000241001,
+ VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL = 1000241002,
+ VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL = 1000241003,
+ VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL = 1000314000,
+ VK_IMAGE_LAYOUT_ATTACHMENT_OPTIMAL = 1000314001,
+ VK_IMAGE_LAYOUT_PRESENT_SRC_KHR = 1000001002,
+ VK_IMAGE_LAYOUT_MAX_ENUM = 0x7FFFFFFF
+} VkImageLayout;
+typedef enum VkImageTiling {
+ VK_IMAGE_TILING_OPTIMAL = 0,
+ VK_IMAGE_TILING_LINEAR = 1,
+ VK_IMAGE_TILING_MAX_ENUM = 0x7FFFFFFF
+} VkImageTiling;
+typedef enum VkImageType {
+ VK_IMAGE_TYPE_1D = 0,
+ VK_IMAGE_TYPE_2D = 1,
+ VK_IMAGE_TYPE_3D = 2,
+ VK_IMAGE_TYPE_MAX_ENUM = 0x7FFFFFFF
+} VkImageType;
+typedef enum VkImageUsageFlagBits {
+ VK_IMAGE_USAGE_TRANSFER_SRC_BIT = 1,
+ VK_IMAGE_USAGE_TRANSFER_DST_BIT = 2,
+ VK_IMAGE_USAGE_SAMPLED_BIT = 4,
+ VK_IMAGE_USAGE_STORAGE_BIT = 8,
+ VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT = 16,
+ VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 32,
+ VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 64,
+ VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 128,
+ VK_IMAGE_USAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkImageUsageFlagBits;
+typedef enum VkImageViewType {
+ VK_IMAGE_VIEW_TYPE_1D = 0,
+ VK_IMAGE_VIEW_TYPE_2D = 1,
+ VK_IMAGE_VIEW_TYPE_3D = 2,
+ VK_IMAGE_VIEW_TYPE_CUBE = 3,
+ VK_IMAGE_VIEW_TYPE_1D_ARRAY = 4,
+ VK_IMAGE_VIEW_TYPE_2D_ARRAY = 5,
+ VK_IMAGE_VIEW_TYPE_CUBE_ARRAY = 6,
+ VK_IMAGE_VIEW_TYPE_MAX_ENUM = 0x7FFFFFFF
+} VkImageViewType;
+typedef enum VkSharingMode {
+ VK_SHARING_MODE_EXCLUSIVE = 0,
+ VK_SHARING_MODE_CONCURRENT = 1,
+ VK_SHARING_MODE_MAX_ENUM = 0x7FFFFFFF
+} VkSharingMode;
+typedef enum VkIndexType {
+ VK_INDEX_TYPE_UINT16 = 0,
+ VK_INDEX_TYPE_UINT32 = 1,
+ VK_INDEX_TYPE_MAX_ENUM = 0x7FFFFFFF
+} VkIndexType;
+typedef enum VkLogicOp {
+ VK_LOGIC_OP_CLEAR = 0,
+ VK_LOGIC_OP_AND = 1,
+ VK_LOGIC_OP_AND_REVERSE = 2,
+ VK_LOGIC_OP_COPY = 3,
+ VK_LOGIC_OP_AND_INVERTED = 4,
+ VK_LOGIC_OP_NO_OP = 5,
+ VK_LOGIC_OP_XOR = 6,
+ VK_LOGIC_OP_OR = 7,
+ VK_LOGIC_OP_NOR = 8,
+ VK_LOGIC_OP_EQUIVALENT = 9,
+ VK_LOGIC_OP_INVERT = 10,
+ VK_LOGIC_OP_OR_REVERSE = 11,
+ VK_LOGIC_OP_COPY_INVERTED = 12,
+ VK_LOGIC_OP_OR_INVERTED = 13,
+ VK_LOGIC_OP_NAND = 14,
+ VK_LOGIC_OP_SET = 15,
+ VK_LOGIC_OP_MAX_ENUM = 0x7FFFFFFF
+} VkLogicOp;
+typedef enum VkMemoryHeapFlagBits {
+ VK_MEMORY_HEAP_DEVICE_LOCAL_BIT = 1,
+ VK_MEMORY_HEAP_MULTI_INSTANCE_BIT = 2,
+ VK_MEMORY_HEAP_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkMemoryHeapFlagBits;
+typedef enum VkAccessFlagBits {
+ VK_ACCESS_INDIRECT_COMMAND_READ_BIT = 1,
+ VK_ACCESS_INDEX_READ_BIT = 2,
+ VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT = 4,
+ VK_ACCESS_UNIFORM_READ_BIT = 8,
+ VK_ACCESS_INPUT_ATTACHMENT_READ_BIT = 16,
+ VK_ACCESS_SHADER_READ_BIT = 32,
+ VK_ACCESS_SHADER_WRITE_BIT = 64,
+ VK_ACCESS_COLOR_ATTACHMENT_READ_BIT = 128,
+ VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT = 256,
+ VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 512,
+ VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 1024,
+ VK_ACCESS_TRANSFER_READ_BIT = 2048,
+ VK_ACCESS_TRANSFER_WRITE_BIT = 4096,
+ VK_ACCESS_HOST_READ_BIT = 8192,
+ VK_ACCESS_HOST_WRITE_BIT = 16384,
+ VK_ACCESS_MEMORY_READ_BIT = 32768,
+ VK_ACCESS_MEMORY_WRITE_BIT = 65536,
+ VK_ACCESS_NONE = 0,
+ VK_ACCESS_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkAccessFlagBits;
+typedef enum VkMemoryPropertyFlagBits {
+ VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 1,
+ VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT = 2,
+ VK_MEMORY_PROPERTY_HOST_COHERENT_BIT = 4,
+ VK_MEMORY_PROPERTY_HOST_CACHED_BIT = 8,
+ VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT = 16,
+ VK_MEMORY_PROPERTY_PROTECTED_BIT = 32,
+ VK_MEMORY_PROPERTY_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkMemoryPropertyFlagBits;
+typedef enum VkPhysicalDeviceType {
+ VK_PHYSICAL_DEVICE_TYPE_OTHER = 0,
+ VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU = 1,
+ VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU = 2,
+ VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU = 3,
+ VK_PHYSICAL_DEVICE_TYPE_CPU = 4,
+ VK_PHYSICAL_DEVICE_TYPE_MAX_ENUM = 0x7FFFFFFF
+} VkPhysicalDeviceType;
+typedef enum VkPipelineBindPoint {
+ VK_PIPELINE_BIND_POINT_GRAPHICS = 0,
+ VK_PIPELINE_BIND_POINT_COMPUTE = 1,
+ VK_PIPELINE_BIND_POINT_MAX_ENUM = 0x7FFFFFFF
+} VkPipelineBindPoint;
+typedef enum VkPipelineCreateFlagBits {
+ VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT = 1,
+ VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT = 2,
+ VK_PIPELINE_CREATE_DERIVATIVE_BIT = 4,
+ VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT = 8,
+ VK_PIPELINE_CREATE_DISPATCH_BASE_BIT = 16,
+ VK_PIPELINE_CREATE_DISPATCH_BASE = VK_PIPELINE_CREATE_DISPATCH_BASE_BIT,
+ VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT = 256,
+ VK_PIPELINE_CREATE_EARLY_RETURN_ON_FAILURE_BIT = 512,
+ VK_PIPELINE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkPipelineCreateFlagBits;
+typedef enum VkPrimitiveTopology {
+ VK_PRIMITIVE_TOPOLOGY_POINT_LIST = 0,
+ VK_PRIMITIVE_TOPOLOGY_LINE_LIST = 1,
+ VK_PRIMITIVE_TOPOLOGY_LINE_STRIP = 2,
+ VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST = 3,
+ VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP = 4,
+ VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN = 5,
+ VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY = 6,
+ VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY = 7,
+ VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY = 8,
+ VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY = 9,
+ VK_PRIMITIVE_TOPOLOGY_PATCH_LIST = 10,
+ VK_PRIMITIVE_TOPOLOGY_MAX_ENUM = 0x7FFFFFFF
+} VkPrimitiveTopology;
+typedef enum VkQueryControlFlagBits {
+ VK_QUERY_CONTROL_PRECISE_BIT = 1,
+ VK_QUERY_CONTROL_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkQueryControlFlagBits;
+typedef enum VkQueryPipelineStatisticFlagBits {
+ VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT = 1,
+ VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT = 2,
+ VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT = 4,
+ VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT = 8,
+ VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT = 16,
+ VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT = 32,
+ VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT = 64,
+ VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT = 128,
+ VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT = 256,
+ VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = 512,
+ VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 1024,
+ VK_QUERY_PIPELINE_STATISTIC_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkQueryPipelineStatisticFlagBits;
+typedef enum VkQueryResultFlagBits {
+ VK_QUERY_RESULT_64_BIT = 1,
+ VK_QUERY_RESULT_WAIT_BIT = 2,
+ VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = 4,
+ VK_QUERY_RESULT_PARTIAL_BIT = 8,
+ VK_QUERY_RESULT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkQueryResultFlagBits;
+typedef enum VkQueryType {
+ VK_QUERY_TYPE_OCCLUSION = 0,
+ VK_QUERY_TYPE_PIPELINE_STATISTICS = 1,
+ VK_QUERY_TYPE_TIMESTAMP = 2,
+ VK_QUERY_TYPE_MAX_ENUM = 0x7FFFFFFF
+} VkQueryType;
+typedef enum VkQueueFlagBits {
+ VK_QUEUE_GRAPHICS_BIT = 1,
+ VK_QUEUE_COMPUTE_BIT = 2,
+ VK_QUEUE_TRANSFER_BIT = 4,
+ VK_QUEUE_SPARSE_BINDING_BIT = 8,
+ VK_QUEUE_PROTECTED_BIT = 16,
+ VK_QUEUE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkQueueFlagBits;
+typedef enum VkSubpassContents {
+ VK_SUBPASS_CONTENTS_INLINE = 0,
+ VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 1,
+ VK_SUBPASS_CONTENTS_MAX_ENUM = 0x7FFFFFFF
+} VkSubpassContents;
+typedef enum VkResult {
+ VK_SUCCESS = 0,
+ VK_NOT_READY = 1,
+ VK_TIMEOUT = 2,
+ VK_EVENT_SET = 3,
+ VK_EVENT_RESET = 4,
+ VK_INCOMPLETE = 5,
+ VK_ERROR_OUT_OF_HOST_MEMORY = -1,
+ VK_ERROR_OUT_OF_DEVICE_MEMORY = -2,
+ VK_ERROR_INITIALIZATION_FAILED = -3,
+ VK_ERROR_DEVICE_LOST = -4,
+ VK_ERROR_MEMORY_MAP_FAILED = -5,
+ VK_ERROR_LAYER_NOT_PRESENT = -6,
+ VK_ERROR_EXTENSION_NOT_PRESENT = -7,
+ VK_ERROR_FEATURE_NOT_PRESENT = -8,
+ VK_ERROR_INCOMPATIBLE_DRIVER = -9,
+ VK_ERROR_TOO_MANY_OBJECTS = -10,
+ VK_ERROR_FORMAT_NOT_SUPPORTED = -11,
+ VK_ERROR_FRAGMENTED_POOL = -12,
+ VK_ERROR_UNKNOWN = -13,
+ VK_ERROR_OUT_OF_POOL_MEMORY = -1000069000,
+ VK_ERROR_INVALID_EXTERNAL_HANDLE = -1000072003,
+ VK_ERROR_FRAGMENTATION = -1000161000,
+ VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS = -1000257000,
+ VK_PIPELINE_COMPILE_REQUIRED = 1000297000,
+ VK_ERROR_SURFACE_LOST_KHR = -1000000000,
+ VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = -1000000001,
+ VK_SUBOPTIMAL_KHR = 1000001003,
+ VK_ERROR_OUT_OF_DATE_KHR = -1000001004,
+ VK_ERROR_VALIDATION_FAILED_EXT = -1000011001,
+ VK_RESULT_MAX_ENUM = 0x7FFFFFFF
+} VkResult;
+typedef enum VkShaderStageFlagBits {
+ VK_SHADER_STAGE_VERTEX_BIT = 1,
+ VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT = 2,
+ VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT = 4,
+ VK_SHADER_STAGE_GEOMETRY_BIT = 8,
+ VK_SHADER_STAGE_FRAGMENT_BIT = 16,
+ VK_SHADER_STAGE_COMPUTE_BIT = 32,
+ VK_SHADER_STAGE_ALL_GRAPHICS = 0x0000001F,
+ VK_SHADER_STAGE_ALL = 0x7FFFFFFF,
+ VK_SHADER_STAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkShaderStageFlagBits;
+typedef enum VkSparseMemoryBindFlagBits {
+ VK_SPARSE_MEMORY_BIND_METADATA_BIT = 1,
+ VK_SPARSE_MEMORY_BIND_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkSparseMemoryBindFlagBits;
+typedef enum VkStencilFaceFlagBits {
+ VK_STENCIL_FACE_FRONT_BIT = 1,
+ VK_STENCIL_FACE_BACK_BIT = 2,
+ VK_STENCIL_FACE_FRONT_AND_BACK = 0x00000003,
+ VK_STENCIL_FRONT_AND_BACK = VK_STENCIL_FACE_FRONT_AND_BACK,
+ VK_STENCIL_FACE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkStencilFaceFlagBits;
+typedef enum VkStencilOp {
+ VK_STENCIL_OP_KEEP = 0,
+ VK_STENCIL_OP_ZERO = 1,
+ VK_STENCIL_OP_REPLACE = 2,
+ VK_STENCIL_OP_INCREMENT_AND_CLAMP = 3,
+ VK_STENCIL_OP_DECREMENT_AND_CLAMP = 4,
+ VK_STENCIL_OP_INVERT = 5,
+ VK_STENCIL_OP_INCREMENT_AND_WRAP = 6,
+ VK_STENCIL_OP_DECREMENT_AND_WRAP = 7,
+ VK_STENCIL_OP_MAX_ENUM = 0x7FFFFFFF
+} VkStencilOp;
+typedef enum VkStructureType {
+ VK_STRUCTURE_TYPE_APPLICATION_INFO = 0,
+ VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 1,
+ VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO = 2,
+ VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO = 3,
+ VK_STRUCTURE_TYPE_SUBMIT_INFO = 4,
+ VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO = 5,
+ VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE = 6,
+ VK_STRUCTURE_TYPE_BIND_SPARSE_INFO = 7,
+ VK_STRUCTURE_TYPE_FENCE_CREATE_INFO = 8,
+ VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = 9,
+ VK_STRUCTURE_TYPE_EVENT_CREATE_INFO = 10,
+ VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = 11,
+ VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 12,
+ VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = 13,
+ VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 14,
+ VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = 15,
+ VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO = 16,
+ VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO = 17,
+ VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = 18,
+ VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO = 19,
+ VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO = 20,
+ VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO = 21,
+ VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO = 22,
+ VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO = 23,
+ VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO = 24,
+ VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO = 25,
+ VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO = 26,
+ VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO = 27,
+ VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = 28,
+ VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = 29,
+ VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = 30,
+ VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO = 31,
+ VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = 32,
+ VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = 33,
+ VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO = 34,
+ VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET = 35,
+ VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET = 36,
+ VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 37,
+ VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 38,
+ VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO = 39,
+ VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO = 40,
+ VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO = 41,
+ VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO = 42,
+ VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO = 43,
+ VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 44,
+ VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 45,
+ VK_STRUCTURE_TYPE_MEMORY_BARRIER = 46,
+ VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO = 47,
+ VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO = 48,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES = 1000094000,
+ VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_INFO = 1000157000,
+ VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_INFO = 1000157001,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES = 1000083000,
+ VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS = 1000127000,
+ VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO = 1000127001,
+ VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO = 1000060000,
+ VK_STRUCTURE_TYPE_DEVICE_GROUP_RENDER_PASS_BEGIN_INFO = 1000060003,
+ VK_STRUCTURE_TYPE_DEVICE_GROUP_COMMAND_BUFFER_BEGIN_INFO = 1000060004,
+ VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO = 1000060005,
+ VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO = 1000060006,
+ VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO = 1000060013,
+ VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO = 1000060014,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES = 1000070000,
+ VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO = 1000070001,
+ VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2 = 1000146000,
+ VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2 = 1000146001,
+ VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2 = 1000146002,
+ VK_STRUCTURE_TYPE_MEMORY_REQUIREMENTS_2 = 1000146003,
+ VK_STRUCTURE_TYPE_SPARSE_IMAGE_MEMORY_REQUIREMENTS_2 = 1000146004,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2 = 1000059000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2 = 1000059001,
+ VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2 = 1000059002,
+ VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2 = 1000059003,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2 = 1000059004,
+ VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2 = 1000059005,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2 = 1000059006,
+ VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2 = 1000059007,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2 = 1000059008,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_POINT_CLIPPING_PROPERTIES = 1000117000,
+ VK_STRUCTURE_TYPE_RENDER_PASS_INPUT_ATTACHMENT_ASPECT_CREATE_INFO = 1000117001,
+ VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO = 1000117002,
+ VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_DOMAIN_ORIGIN_STATE_CREATE_INFO = 1000117003,
+ VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO = 1000053000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES = 1000053001,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES = 1000053002,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES = 1000120000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTER_FEATURES = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VARIABLE_POINTERS_FEATURES,
+ VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO = 1000145000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES = 1000145001,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES = 1000145002,
+ VK_STRUCTURE_TYPE_DEVICE_QUEUE_INFO_2 = 1000145003,
+ VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO = 1000156000,
+ VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO = 1000156001,
+ VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO = 1000156002,
+ VK_STRUCTURE_TYPE_IMAGE_PLANE_MEMORY_REQUIREMENTS_INFO = 1000156003,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES = 1000156004,
+ VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES = 1000156005,
+ VK_STRUCTURE_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_CREATE_INFO = 1000085000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO = 1000071000,
+ VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES = 1000071001,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO = 1000071002,
+ VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES = 1000071003,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES = 1000071004,
+ VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO = 1000072000,
+ VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO = 1000072001,
+ VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO = 1000072002,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_FENCE_INFO = 1000112000,
+ VK_STRUCTURE_TYPE_EXTERNAL_FENCE_PROPERTIES = 1000112001,
+ VK_STRUCTURE_TYPE_EXPORT_FENCE_CREATE_INFO = 1000113000,
+ VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_CREATE_INFO = 1000077000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_SEMAPHORE_INFO = 1000076000,
+ VK_STRUCTURE_TYPE_EXTERNAL_SEMAPHORE_PROPERTIES = 1000076001,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES = 1000168000,
+ VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT = 1000168001,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES = 1000063000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETER_FEATURES = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES = 49,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_PROPERTIES = 50,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_FEATURES = 51,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_2_PROPERTIES = 52,
+ VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO = 1000147000,
+ VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2 = 1000109000,
+ VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2 = 1000109001,
+ VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2 = 1000109002,
+ VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2 = 1000109003,
+ VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2 = 1000109004,
+ VK_STRUCTURE_TYPE_SUBPASS_BEGIN_INFO = 1000109005,
+ VK_STRUCTURE_TYPE_SUBPASS_END_INFO = 1000109006,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES = 1000177000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES = 1000196000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES = 1000180000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES = 1000082000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES = 1000197000,
+ VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_BINDING_FLAGS_CREATE_INFO = 1000161000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES = 1000161001,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_PROPERTIES = 1000161002,
+ VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_ALLOCATE_INFO = 1000161003,
+ VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT = 1000161004,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES = 1000199000,
+ VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE = 1000199001,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES = 1000221000,
+ VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO = 1000246000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES = 1000130000,
+ VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO = 1000130001,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES = 1000211000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGELESS_FRAMEBUFFER_FEATURES = 1000108000,
+ VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENTS_CREATE_INFO = 1000108001,
+ VK_STRUCTURE_TYPE_FRAMEBUFFER_ATTACHMENT_IMAGE_INFO = 1000108002,
+ VK_STRUCTURE_TYPE_RENDER_PASS_ATTACHMENT_BEGIN_INFO = 1000108003,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES = 1000253000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES = 1000175000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES = 1000241000,
+ VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT = 1000241001,
+ VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT = 1000241002,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES = 1000261000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES = 1000207000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES = 1000207001,
+ VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO = 1000207002,
+ VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO = 1000207003,
+ VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO = 1000207004,
+ VK_STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO = 1000207005,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES = 1000257000,
+ VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO = 1000244001,
+ VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO = 1000257002,
+ VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO = 1000257003,
+ VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO = 1000257004,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES = 53,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_PROPERTIES = 54,
+ VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO = 1000192000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES = 1000215000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TOOL_PROPERTIES = 1000245000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES = 1000276000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES = 1000295000,
+ VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO = 1000295001,
+ VK_STRUCTURE_TYPE_PRIVATE_DATA_SLOT_CREATE_INFO = 1000295002,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES = 1000297000,
+ VK_STRUCTURE_TYPE_MEMORY_BARRIER_2 = 1000314000,
+ VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER_2 = 1000314001,
+ VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2 = 1000314002,
+ VK_STRUCTURE_TYPE_DEPENDENCY_INFO = 1000314003,
+ VK_STRUCTURE_TYPE_SUBMIT_INFO_2 = 1000314004,
+ VK_STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO = 1000314005,
+ VK_STRUCTURE_TYPE_COMMAND_BUFFER_SUBMIT_INFO = 1000314006,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES = 1000314007,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES = 1000325000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES = 1000335000,
+ VK_STRUCTURE_TYPE_COPY_BUFFER_INFO_2 = 1000337000,
+ VK_STRUCTURE_TYPE_COPY_IMAGE_INFO_2 = 1000337001,
+ VK_STRUCTURE_TYPE_COPY_BUFFER_TO_IMAGE_INFO_2 = 1000337002,
+ VK_STRUCTURE_TYPE_COPY_IMAGE_TO_BUFFER_INFO_2 = 1000337003,
+ VK_STRUCTURE_TYPE_BLIT_IMAGE_INFO_2 = 1000337004,
+ VK_STRUCTURE_TYPE_RESOLVE_IMAGE_INFO_2 = 1000337005,
+ VK_STRUCTURE_TYPE_BUFFER_COPY_2 = 1000337006,
+ VK_STRUCTURE_TYPE_IMAGE_COPY_2 = 1000337007,
+ VK_STRUCTURE_TYPE_IMAGE_BLIT_2 = 1000337008,
+ VK_STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2 = 1000337009,
+ VK_STRUCTURE_TYPE_IMAGE_RESOLVE_2 = 1000337010,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES = 1000225000,
+ VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO = 1000225001,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES = 1000225002,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES = 1000138000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES = 1000138001,
+ VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK = 1000138002,
+ VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO = 1000138003,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES = 1000066000,
+ VK_STRUCTURE_TYPE_RENDERING_INFO = 1000044000,
+ VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO = 1000044001,
+ VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO = 1000044002,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES = 1000044003,
+ VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO = 1000044004,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES = 1000280000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES = 1000280001,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES = 1000281001,
+ VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3 = 1000360000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES = 1000413000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES = 1000413001,
+ VK_STRUCTURE_TYPE_DEVICE_BUFFER_MEMORY_REQUIREMENTS = 1000413002,
+ VK_STRUCTURE_TYPE_DEVICE_IMAGE_MEMORY_REQUIREMENTS = 1000413003,
+ VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 1000001000,
+ VK_STRUCTURE_TYPE_PRESENT_INFO_KHR = 1000001001,
+ VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHR = 1000060007,
+ VK_STRUCTURE_TYPE_IMAGE_SWAPCHAIN_CREATE_INFO_KHR = 1000060008,
+ VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_SWAPCHAIN_INFO_KHR = 1000060009,
+ VK_STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHR = 1000060010,
+ VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_INFO_KHR = 1000060011,
+ VK_STRUCTURE_TYPE_DEVICE_GROUP_SWAPCHAIN_CREATE_INFO_KHR = 1000060012,
+ VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT = 1000011000,
+ VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT,
+ VK_STRUCTURE_TYPE_MAX_ENUM = 0x7FFFFFFF
+} VkStructureType;
+typedef enum VkSystemAllocationScope {
+ VK_SYSTEM_ALLOCATION_SCOPE_COMMAND = 0,
+ VK_SYSTEM_ALLOCATION_SCOPE_OBJECT = 1,
+ VK_SYSTEM_ALLOCATION_SCOPE_CACHE = 2,
+ VK_SYSTEM_ALLOCATION_SCOPE_DEVICE = 3,
+ VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE = 4,
+ VK_SYSTEM_ALLOCATION_SCOPE_MAX_ENUM = 0x7FFFFFFF
+} VkSystemAllocationScope;
+typedef enum VkInternalAllocationType {
+ VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE = 0,
+ VK_INTERNAL_ALLOCATION_TYPE_MAX_ENUM = 0x7FFFFFFF
+} VkInternalAllocationType;
+typedef enum VkSamplerAddressMode {
+ VK_SAMPLER_ADDRESS_MODE_REPEAT = 0,
+ VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT = 1,
+ VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE = 2,
+ VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER = 3,
+ VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE = 4,
+ VK_SAMPLER_ADDRESS_MODE_MAX_ENUM = 0x7FFFFFFF
+} VkSamplerAddressMode;
+typedef enum VkFilter {
+ VK_FILTER_NEAREST = 0,
+ VK_FILTER_LINEAR = 1,
+ VK_FILTER_MAX_ENUM = 0x7FFFFFFF
+} VkFilter;
+typedef enum VkSamplerMipmapMode {
+ VK_SAMPLER_MIPMAP_MODE_NEAREST = 0,
+ VK_SAMPLER_MIPMAP_MODE_LINEAR = 1,
+ VK_SAMPLER_MIPMAP_MODE_MAX_ENUM = 0x7FFFFFFF
+} VkSamplerMipmapMode;
+typedef enum VkVertexInputRate {
+ VK_VERTEX_INPUT_RATE_VERTEX = 0,
+ VK_VERTEX_INPUT_RATE_INSTANCE = 1,
+ VK_VERTEX_INPUT_RATE_MAX_ENUM = 0x7FFFFFFF
+} VkVertexInputRate;
+typedef enum VkPipelineStageFlagBits {
+ VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 1,
+ VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 2,
+ VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 4,
+ VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 8,
+ VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 16,
+ VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 32,
+ VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 64,
+ VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 128,
+ VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 256,
+ VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 512,
+ VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 1024,
+ VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 2048,
+ VK_PIPELINE_STAGE_TRANSFER_BIT = 4096,
+ VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT = 8192,
+ VK_PIPELINE_STAGE_HOST_BIT = 16384,
+ VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 32768,
+ VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 65536,
+ VK_PIPELINE_STAGE_NONE = 0,
+ VK_PIPELINE_STAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkPipelineStageFlagBits;
+typedef enum VkSparseImageFormatFlagBits {
+ VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT = 1,
+ VK_SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT = 2,
+ VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT = 4,
+ VK_SPARSE_IMAGE_FORMAT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkSparseImageFormatFlagBits;
+typedef enum VkSampleCountFlagBits {
+ VK_SAMPLE_COUNT_1_BIT = 1,
+ VK_SAMPLE_COUNT_2_BIT = 2,
+ VK_SAMPLE_COUNT_4_BIT = 4,
+ VK_SAMPLE_COUNT_8_BIT = 8,
+ VK_SAMPLE_COUNT_16_BIT = 16,
+ VK_SAMPLE_COUNT_32_BIT = 32,
+ VK_SAMPLE_COUNT_64_BIT = 64,
+ VK_SAMPLE_COUNT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkSampleCountFlagBits;
+typedef enum VkAttachmentDescriptionFlagBits {
+ VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT = 1,
+ VK_ATTACHMENT_DESCRIPTION_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkAttachmentDescriptionFlagBits;
+typedef enum VkDescriptorPoolCreateFlagBits {
+ VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 1,
+ VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT = 2,
+ VK_DESCRIPTOR_POOL_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkDescriptorPoolCreateFlagBits;
+typedef enum VkDependencyFlagBits {
+ VK_DEPENDENCY_BY_REGION_BIT = 1,
+ VK_DEPENDENCY_DEVICE_GROUP_BIT = 4,
+ VK_DEPENDENCY_VIEW_LOCAL_BIT = 2,
+ VK_DEPENDENCY_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkDependencyFlagBits;
+typedef enum VkObjectType {
+ VK_OBJECT_TYPE_UNKNOWN = 0,
+ VK_OBJECT_TYPE_INSTANCE = 1,
+ VK_OBJECT_TYPE_PHYSICAL_DEVICE = 2,
+ VK_OBJECT_TYPE_DEVICE = 3,
+ VK_OBJECT_TYPE_QUEUE = 4,
+ VK_OBJECT_TYPE_SEMAPHORE = 5,
+ VK_OBJECT_TYPE_COMMAND_BUFFER = 6,
+ VK_OBJECT_TYPE_FENCE = 7,
+ VK_OBJECT_TYPE_DEVICE_MEMORY = 8,
+ VK_OBJECT_TYPE_BUFFER = 9,
+ VK_OBJECT_TYPE_IMAGE = 10,
+ VK_OBJECT_TYPE_EVENT = 11,
+ VK_OBJECT_TYPE_QUERY_POOL = 12,
+ VK_OBJECT_TYPE_BUFFER_VIEW = 13,
+ VK_OBJECT_TYPE_IMAGE_VIEW = 14,
+ VK_OBJECT_TYPE_SHADER_MODULE = 15,
+ VK_OBJECT_TYPE_PIPELINE_CACHE = 16,
+ VK_OBJECT_TYPE_PIPELINE_LAYOUT = 17,
+ VK_OBJECT_TYPE_RENDER_PASS = 18,
+ VK_OBJECT_TYPE_PIPELINE = 19,
+ VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT = 20,
+ VK_OBJECT_TYPE_SAMPLER = 21,
+ VK_OBJECT_TYPE_DESCRIPTOR_POOL = 22,
+ VK_OBJECT_TYPE_DESCRIPTOR_SET = 23,
+ VK_OBJECT_TYPE_FRAMEBUFFER = 24,
+ VK_OBJECT_TYPE_COMMAND_POOL = 25,
+ VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION = 1000156000,
+ VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE = 1000085000,
+ VK_OBJECT_TYPE_PRIVATE_DATA_SLOT = 1000295000,
+ VK_OBJECT_TYPE_SURFACE_KHR = 1000000000,
+ VK_OBJECT_TYPE_SWAPCHAIN_KHR = 1000001000,
+ VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT = 1000011000,
+ VK_OBJECT_TYPE_MAX_ENUM = 0x7FFFFFFF
+} VkObjectType;
+typedef enum VkEventCreateFlagBits {
+ VK_EVENT_CREATE_DEVICE_ONLY_BIT = 1,
+ VK_EVENT_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkEventCreateFlagBits;
+typedef enum VkDescriptorUpdateTemplateType {
+ VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET = 0,
+ VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_MAX_ENUM = 0x7FFFFFFF
+} VkDescriptorUpdateTemplateType;
+typedef enum VkPointClippingBehavior {
+ VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES = 0,
+ VK_POINT_CLIPPING_BEHAVIOR_USER_CLIP_PLANES_ONLY = 1,
+ VK_POINT_CLIPPING_BEHAVIOR_MAX_ENUM = 0x7FFFFFFF
+} VkPointClippingBehavior;
+typedef enum VkResolveModeFlagBits {
+ VK_RESOLVE_MODE_NONE = 0,
+ VK_RESOLVE_MODE_SAMPLE_ZERO_BIT = 1,
+ VK_RESOLVE_MODE_AVERAGE_BIT = 2,
+ VK_RESOLVE_MODE_MIN_BIT = 4,
+ VK_RESOLVE_MODE_MAX_BIT = 8,
+ VK_RESOLVE_MODE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkResolveModeFlagBits;
+typedef enum VkDescriptorBindingFlagBits {
+ VK_DESCRIPTOR_BINDING_UPDATE_AFTER_BIND_BIT = 1,
+ VK_DESCRIPTOR_BINDING_UPDATE_UNUSED_WHILE_PENDING_BIT = 2,
+ VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT = 4,
+ VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT = 8,
+ VK_DESCRIPTOR_BINDING_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkDescriptorBindingFlagBits;
+typedef enum VkSemaphoreType {
+ VK_SEMAPHORE_TYPE_BINARY = 0,
+ VK_SEMAPHORE_TYPE_TIMELINE = 1,
+ VK_SEMAPHORE_TYPE_MAX_ENUM = 0x7FFFFFFF
+} VkSemaphoreType;
+typedef enum VkPipelineCreationFeedbackFlagBits {
+ VK_PIPELINE_CREATION_FEEDBACK_VALID_BIT = 1,
+ VK_PIPELINE_CREATION_FEEDBACK_VALID_BIT_EXT = VK_PIPELINE_CREATION_FEEDBACK_VALID_BIT,
+ VK_PIPELINE_CREATION_FEEDBACK_APPLICATION_PIPELINE_CACHE_HIT_BIT = 2,
+ VK_PIPELINE_CREATION_FEEDBACK_APPLICATION_PIPELINE_CACHE_HIT_BIT_EXT = VK_PIPELINE_CREATION_FEEDBACK_APPLICATION_PIPELINE_CACHE_HIT_BIT,
+ VK_PIPELINE_CREATION_FEEDBACK_BASE_PIPELINE_ACCELERATION_BIT = 4,
+ VK_PIPELINE_CREATION_FEEDBACK_BASE_PIPELINE_ACCELERATION_BIT_EXT = VK_PIPELINE_CREATION_FEEDBACK_BASE_PIPELINE_ACCELERATION_BIT,
+ VK_PIPELINE_CREATION_FEEDBACK_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkPipelineCreationFeedbackFlagBits;
+typedef enum VkSemaphoreWaitFlagBits {
+ VK_SEMAPHORE_WAIT_ANY_BIT = 1,
+ VK_SEMAPHORE_WAIT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkSemaphoreWaitFlagBits;
+typedef enum VkToolPurposeFlagBits {
+ VK_TOOL_PURPOSE_VALIDATION_BIT = 1,
+ VK_TOOL_PURPOSE_VALIDATION_BIT_EXT = VK_TOOL_PURPOSE_VALIDATION_BIT,
+ VK_TOOL_PURPOSE_PROFILING_BIT = 2,
+ VK_TOOL_PURPOSE_PROFILING_BIT_EXT = VK_TOOL_PURPOSE_PROFILING_BIT,
+ VK_TOOL_PURPOSE_TRACING_BIT = 4,
+ VK_TOOL_PURPOSE_TRACING_BIT_EXT = VK_TOOL_PURPOSE_TRACING_BIT,
+ VK_TOOL_PURPOSE_ADDITIONAL_FEATURES_BIT = 8,
+ VK_TOOL_PURPOSE_ADDITIONAL_FEATURES_BIT_EXT = VK_TOOL_PURPOSE_ADDITIONAL_FEATURES_BIT,
+ VK_TOOL_PURPOSE_MODIFYING_FEATURES_BIT = 16,
+ VK_TOOL_PURPOSE_MODIFYING_FEATURES_BIT_EXT = VK_TOOL_PURPOSE_MODIFYING_FEATURES_BIT,
+ VK_TOOL_PURPOSE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkToolPurposeFlagBits;
+typedef uint64_t VkAccessFlagBits2;
+static const VkAccessFlagBits2 VK_ACCESS_2_NONE = 0;
+static const VkAccessFlagBits2 VK_ACCESS_2_NONE_KHR = 0;
+static const VkAccessFlagBits2 VK_ACCESS_2_INDIRECT_COMMAND_READ_BIT = 1;
+static const VkAccessFlagBits2 VK_ACCESS_2_INDIRECT_COMMAND_READ_BIT_KHR = 1;
+static const VkAccessFlagBits2 VK_ACCESS_2_INDEX_READ_BIT = 2;
+static const VkAccessFlagBits2 VK_ACCESS_2_INDEX_READ_BIT_KHR = 2;
+static const VkAccessFlagBits2 VK_ACCESS_2_VERTEX_ATTRIBUTE_READ_BIT = 4;
+static const VkAccessFlagBits2 VK_ACCESS_2_VERTEX_ATTRIBUTE_READ_BIT_KHR = 4;
+static const VkAccessFlagBits2 VK_ACCESS_2_UNIFORM_READ_BIT = 8;
+static const VkAccessFlagBits2 VK_ACCESS_2_UNIFORM_READ_BIT_KHR = 8;
+static const VkAccessFlagBits2 VK_ACCESS_2_INPUT_ATTACHMENT_READ_BIT = 16;
+static const VkAccessFlagBits2 VK_ACCESS_2_INPUT_ATTACHMENT_READ_BIT_KHR = 16;
+static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_READ_BIT = 32;
+static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_READ_BIT_KHR = 32;
+static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_WRITE_BIT = 64;
+static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_WRITE_BIT_KHR = 64;
+static const VkAccessFlagBits2 VK_ACCESS_2_COLOR_ATTACHMENT_READ_BIT = 128;
+static const VkAccessFlagBits2 VK_ACCESS_2_COLOR_ATTACHMENT_READ_BIT_KHR = 128;
+static const VkAccessFlagBits2 VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT = 256;
+static const VkAccessFlagBits2 VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT_KHR = 256;
+static const VkAccessFlagBits2 VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 512;
+static const VkAccessFlagBits2 VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_READ_BIT_KHR = 512;
+static const VkAccessFlagBits2 VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 1024;
+static const VkAccessFlagBits2 VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT_KHR = 1024;
+static const VkAccessFlagBits2 VK_ACCESS_2_TRANSFER_READ_BIT = 2048;
+static const VkAccessFlagBits2 VK_ACCESS_2_TRANSFER_READ_BIT_KHR = 2048;
+static const VkAccessFlagBits2 VK_ACCESS_2_TRANSFER_WRITE_BIT = 4096;
+static const VkAccessFlagBits2 VK_ACCESS_2_TRANSFER_WRITE_BIT_KHR = 4096;
+static const VkAccessFlagBits2 VK_ACCESS_2_HOST_READ_BIT = 8192;
+static const VkAccessFlagBits2 VK_ACCESS_2_HOST_READ_BIT_KHR = 8192;
+static const VkAccessFlagBits2 VK_ACCESS_2_HOST_WRITE_BIT = 16384;
+static const VkAccessFlagBits2 VK_ACCESS_2_HOST_WRITE_BIT_KHR = 16384;
+static const VkAccessFlagBits2 VK_ACCESS_2_MEMORY_READ_BIT = 32768;
+static const VkAccessFlagBits2 VK_ACCESS_2_MEMORY_READ_BIT_KHR = 32768;
+static const VkAccessFlagBits2 VK_ACCESS_2_MEMORY_WRITE_BIT = 65536;
+static const VkAccessFlagBits2 VK_ACCESS_2_MEMORY_WRITE_BIT_KHR = 65536;
+static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_SAMPLED_READ_BIT = 4294967296;
+static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_SAMPLED_READ_BIT_KHR = 4294967296;
+static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_STORAGE_READ_BIT = 8589934592;
+static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_STORAGE_READ_BIT_KHR = 8589934592;
+static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_STORAGE_WRITE_BIT = 17179869184;
+static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_STORAGE_WRITE_BIT_KHR = 17179869184;
+
+typedef uint64_t VkPipelineStageFlagBits2;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_NONE = 0;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_NONE_KHR = 0;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TOP_OF_PIPE_BIT = 1;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TOP_OF_PIPE_BIT_KHR = 1;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_DRAW_INDIRECT_BIT = 2;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_DRAW_INDIRECT_BIT_KHR = 2;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_VERTEX_INPUT_BIT = 4;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_VERTEX_INPUT_BIT_KHR = 4;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_VERTEX_SHADER_BIT = 8;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_VERTEX_SHADER_BIT_KHR = 8;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TESSELLATION_CONTROL_SHADER_BIT = 16;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TESSELLATION_CONTROL_SHADER_BIT_KHR = 16;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TESSELLATION_EVALUATION_SHADER_BIT = 32;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TESSELLATION_EVALUATION_SHADER_BIT_KHR = 32;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_GEOMETRY_SHADER_BIT = 64;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_GEOMETRY_SHADER_BIT_KHR = 64;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT = 128;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT_KHR = 128;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_EARLY_FRAGMENT_TESTS_BIT = 256;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_EARLY_FRAGMENT_TESTS_BIT_KHR = 256;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT = 512;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT_KHR = 512;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT = 1024;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT_KHR = 1024;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT = 2048;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT_KHR = 2048;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_ALL_TRANSFER_BIT = 4096;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_ALL_TRANSFER_BIT_KHR = 4096;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TRANSFER_BIT = 4096;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TRANSFER_BIT_KHR = 4096;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_BOTTOM_OF_PIPE_BIT = 8192;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_BOTTOM_OF_PIPE_BIT_KHR = 8192;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_HOST_BIT = 16384;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_HOST_BIT_KHR = 16384;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_ALL_GRAPHICS_BIT = 32768;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_ALL_GRAPHICS_BIT_KHR = 32768;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT = 65536;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT_KHR = 65536;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_COPY_BIT = 4294967296;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_COPY_BIT_KHR = 4294967296;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_RESOLVE_BIT = 8589934592;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_RESOLVE_BIT_KHR = 8589934592;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_BLIT_BIT = 17179869184;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_BLIT_BIT_KHR = 17179869184;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_CLEAR_BIT = 34359738368;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_CLEAR_BIT_KHR = 34359738368;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_INDEX_INPUT_BIT = 68719476736;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_INDEX_INPUT_BIT_KHR = 68719476736;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_VERTEX_ATTRIBUTE_INPUT_BIT = 137438953472;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_VERTEX_ATTRIBUTE_INPUT_BIT_KHR = 137438953472;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_PRE_RASTERIZATION_SHADERS_BIT = 274877906944;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_PRE_RASTERIZATION_SHADERS_BIT_KHR = 274877906944;
+
+typedef uint64_t VkFormatFeatureFlagBits2;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT = 1;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT_KHR = 1;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_IMAGE_BIT = 2;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_IMAGE_BIT_KHR = 2;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_IMAGE_ATOMIC_BIT = 4;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_IMAGE_ATOMIC_BIT_KHR = 4;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_UNIFORM_TEXEL_BUFFER_BIT = 8;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_UNIFORM_TEXEL_BUFFER_BIT_KHR = 8;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_BIT = 16;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_BIT_KHR = 16;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 32;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_ATOMIC_BIT_KHR = 32;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_VERTEX_BUFFER_BIT = 64;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_VERTEX_BUFFER_BIT_KHR = 64;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BIT = 128;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BIT_KHR = 128;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BLEND_BIT = 256;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BLEND_BIT_KHR = 256;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_DEPTH_STENCIL_ATTACHMENT_BIT = 512;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_DEPTH_STENCIL_ATTACHMENT_BIT_KHR = 512;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_BLIT_SRC_BIT = 1024;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_BLIT_SRC_BIT_KHR = 1024;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_BLIT_DST_BIT = 2048;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_BLIT_DST_BIT_KHR = 2048;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 4096;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_LINEAR_BIT_KHR = 4096;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_CUBIC_BIT = 8192;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT = 8192;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_TRANSFER_SRC_BIT = 16384;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_TRANSFER_SRC_BIT_KHR = 16384;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_TRANSFER_DST_BIT = 32768;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_TRANSFER_DST_BIT_KHR = 32768;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_MINMAX_BIT = 65536;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_MINMAX_BIT_KHR = 65536;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_MIDPOINT_CHROMA_SAMPLES_BIT = 131072;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_MIDPOINT_CHROMA_SAMPLES_BIT_KHR = 131072;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT = 262144;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT_KHR = 262144;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT = 524288;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT_KHR = 524288;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT = 1048576;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT_KHR = 1048576;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT = 2097152;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT_KHR = 2097152;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_DISJOINT_BIT = 4194304;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_DISJOINT_BIT_KHR = 4194304;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_COSITED_CHROMA_SAMPLES_BIT = 8388608;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_COSITED_CHROMA_SAMPLES_BIT_KHR = 8388608;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT = 2147483648;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT_KHR = 2147483648;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT = 4294967296;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT_KHR = 4294967296;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT = 8589934592;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_DEPTH_COMPARISON_BIT_KHR = 8589934592;
+
+typedef enum VkRenderingFlagBits {
+ VK_RENDERING_CONTENTS_SECONDARY_COMMAND_BUFFERS_BIT = 1,
+ VK_RENDERING_CONTENTS_SECONDARY_COMMAND_BUFFERS_BIT_KHR = VK_RENDERING_CONTENTS_SECONDARY_COMMAND_BUFFERS_BIT,
+ VK_RENDERING_SUSPENDING_BIT = 2,
+ VK_RENDERING_SUSPENDING_BIT_KHR = VK_RENDERING_SUSPENDING_BIT,
+ VK_RENDERING_RESUMING_BIT = 4,
+ VK_RENDERING_RESUMING_BIT_KHR = VK_RENDERING_RESUMING_BIT,
+ VK_RENDERING_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkRenderingFlagBits;
+typedef enum VkColorSpaceKHR {
+ VK_COLOR_SPACE_SRGB_NONLINEAR_KHR = 0,
+ VK_COLORSPACE_SRGB_NONLINEAR_KHR = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR,
+ VK_COLOR_SPACE_MAX_ENUM_KHR = 0x7FFFFFFF
+} VkColorSpaceKHR;
+typedef enum VkCompositeAlphaFlagBitsKHR {
+ VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR = 1,
+ VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR = 2,
+ VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = 4,
+ VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR = 8,
+ VK_COMPOSITE_ALPHA_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF
+} VkCompositeAlphaFlagBitsKHR;
+typedef enum VkPresentModeKHR {
+ VK_PRESENT_MODE_IMMEDIATE_KHR = 0,
+ VK_PRESENT_MODE_MAILBOX_KHR = 1,
+ VK_PRESENT_MODE_FIFO_KHR = 2,
+ VK_PRESENT_MODE_FIFO_RELAXED_KHR = 3,
+ VK_PRESENT_MODE_MAX_ENUM_KHR = 0x7FFFFFFF
+} VkPresentModeKHR;
+typedef enum VkSurfaceTransformFlagBitsKHR {
+ VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR = 1,
+ VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR = 2,
+ VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR = 4,
+ VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR = 8,
+ VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR = 16,
+ VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR = 32,
+ VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR = 64,
+ VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = 128,
+ VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 256,
+ VK_SURFACE_TRANSFORM_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF
+} VkSurfaceTransformFlagBitsKHR;
+typedef enum VkDebugReportFlagBitsEXT {
+ VK_DEBUG_REPORT_INFORMATION_BIT_EXT = 1,
+ VK_DEBUG_REPORT_WARNING_BIT_EXT = 2,
+ VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT = 4,
+ VK_DEBUG_REPORT_ERROR_BIT_EXT = 8,
+ VK_DEBUG_REPORT_DEBUG_BIT_EXT = 16,
+ VK_DEBUG_REPORT_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF
+} VkDebugReportFlagBitsEXT;
+typedef enum VkDebugReportObjectTypeEXT {
+ VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT = 0,
+ VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT = 1,
+ VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT = 2,
+ VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT = 3,
+ VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT = 4,
+ VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT = 5,
+ VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT = 6,
+ VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT = 7,
+ VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT = 8,
+ VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT = 9,
+ VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT = 10,
+ VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT = 11,
+ VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT = 12,
+ VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT = 13,
+ VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT = 14,
+ VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT = 15,
+ VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT = 16,
+ VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT = 17,
+ VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT = 18,
+ VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT = 19,
+ VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT = 20,
+ VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT = 21,
+ VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT = 22,
+ VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT = 23,
+ VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT = 24,
+ VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT = 25,
+ VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT = 26,
+ VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT = 27,
+ VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT_EXT = 28,
+ VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT_EXT,
+ VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT = 29,
+ VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT = 30,
+ VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT = 33,
+ VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT,
+ VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION_EXT = 1000156000,
+ VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_EXT = 1000085000,
+ VK_DEBUG_REPORT_OBJECT_TYPE_MAX_ENUM_EXT = 0x7FFFFFFF
+} VkDebugReportObjectTypeEXT;
+typedef enum VkExternalMemoryHandleTypeFlagBits {
+ VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT = 1,
+ VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT = 2,
+ VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT = 4,
+ VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT = 8,
+ VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT = 16,
+ VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT = 32,
+ VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT = 64,
+ VK_EXTERNAL_MEMORY_HANDLE_TYPE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkExternalMemoryHandleTypeFlagBits;
+typedef enum VkExternalMemoryFeatureFlagBits {
+ VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT = 1,
+ VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT = 2,
+ VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT = 4,
+ VK_EXTERNAL_MEMORY_FEATURE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkExternalMemoryFeatureFlagBits;
+typedef enum VkExternalSemaphoreHandleTypeFlagBits {
+ VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT = 1,
+ VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT = 2,
+ VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT = 4,
+ VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT = 8,
+ VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D11_FENCE_BIT = VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT,
+ VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT = 16,
+ VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkExternalSemaphoreHandleTypeFlagBits;
+typedef enum VkExternalSemaphoreFeatureFlagBits {
+ VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT = 1,
+ VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT = 2,
+ VK_EXTERNAL_SEMAPHORE_FEATURE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkExternalSemaphoreFeatureFlagBits;
+typedef enum VkSemaphoreImportFlagBits {
+ VK_SEMAPHORE_IMPORT_TEMPORARY_BIT = 1,
+ VK_SEMAPHORE_IMPORT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkSemaphoreImportFlagBits;
+typedef enum VkExternalFenceHandleTypeFlagBits {
+ VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT = 1,
+ VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_BIT = 2,
+ VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT = 4,
+ VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT = 8,
+ VK_EXTERNAL_FENCE_HANDLE_TYPE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkExternalFenceHandleTypeFlagBits;
+typedef enum VkExternalFenceFeatureFlagBits {
+ VK_EXTERNAL_FENCE_FEATURE_EXPORTABLE_BIT = 1,
+ VK_EXTERNAL_FENCE_FEATURE_IMPORTABLE_BIT = 2,
+ VK_EXTERNAL_FENCE_FEATURE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkExternalFenceFeatureFlagBits;
+typedef enum VkFenceImportFlagBits {
+ VK_FENCE_IMPORT_TEMPORARY_BIT = 1,
+ VK_FENCE_IMPORT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkFenceImportFlagBits;
+typedef enum VkPeerMemoryFeatureFlagBits {
+ VK_PEER_MEMORY_FEATURE_COPY_SRC_BIT = 1,
+ VK_PEER_MEMORY_FEATURE_COPY_DST_BIT = 2,
+ VK_PEER_MEMORY_FEATURE_GENERIC_SRC_BIT = 4,
+ VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT = 8,
+ VK_PEER_MEMORY_FEATURE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkPeerMemoryFeatureFlagBits;
+typedef enum VkMemoryAllocateFlagBits {
+ VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT = 1,
+ VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT = 2,
+ VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT = 4,
+ VK_MEMORY_ALLOCATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkMemoryAllocateFlagBits;
+typedef enum VkDeviceGroupPresentModeFlagBitsKHR {
+ VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR = 1,
+ VK_DEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHR = 2,
+ VK_DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHR = 4,
+ VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHR = 8,
+ VK_DEVICE_GROUP_PRESENT_MODE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF
+} VkDeviceGroupPresentModeFlagBitsKHR;
+typedef enum VkSwapchainCreateFlagBitsKHR {
+ VK_SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR = 1,
+ VK_SWAPCHAIN_CREATE_PROTECTED_BIT_KHR = 2,
+ VK_SWAPCHAIN_CREATE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF
+} VkSwapchainCreateFlagBitsKHR;
+typedef enum VkSubgroupFeatureFlagBits {
+ VK_SUBGROUP_FEATURE_BASIC_BIT = 1,
+ VK_SUBGROUP_FEATURE_VOTE_BIT = 2,
+ VK_SUBGROUP_FEATURE_ARITHMETIC_BIT = 4,
+ VK_SUBGROUP_FEATURE_BALLOT_BIT = 8,
+ VK_SUBGROUP_FEATURE_SHUFFLE_BIT = 16,
+ VK_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT = 32,
+ VK_SUBGROUP_FEATURE_CLUSTERED_BIT = 64,
+ VK_SUBGROUP_FEATURE_QUAD_BIT = 128,
+ VK_SUBGROUP_FEATURE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkSubgroupFeatureFlagBits;
+typedef enum VkTessellationDomainOrigin {
+ VK_TESSELLATION_DOMAIN_ORIGIN_UPPER_LEFT = 0,
+ VK_TESSELLATION_DOMAIN_ORIGIN_LOWER_LEFT = 1,
+ VK_TESSELLATION_DOMAIN_ORIGIN_MAX_ENUM = 0x7FFFFFFF
+} VkTessellationDomainOrigin;
+typedef enum VkSamplerYcbcrModelConversion {
+ VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY = 0,
+ VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY = 1,
+ VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709 = 2,
+ VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601 = 3,
+ VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020 = 4,
+ VK_SAMPLER_YCBCR_MODEL_CONVERSION_MAX_ENUM = 0x7FFFFFFF
+} VkSamplerYcbcrModelConversion;
+typedef enum VkSamplerYcbcrRange {
+ VK_SAMPLER_YCBCR_RANGE_ITU_FULL = 0,
+ VK_SAMPLER_YCBCR_RANGE_ITU_NARROW = 1,
+ VK_SAMPLER_YCBCR_RANGE_MAX_ENUM = 0x7FFFFFFF
+} VkSamplerYcbcrRange;
+typedef enum VkChromaLocation {
+ VK_CHROMA_LOCATION_COSITED_EVEN = 0,
+ VK_CHROMA_LOCATION_MIDPOINT = 1,
+ VK_CHROMA_LOCATION_MAX_ENUM = 0x7FFFFFFF
+} VkChromaLocation;
+typedef enum VkSamplerReductionMode {
+ VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE = 0,
+ VK_SAMPLER_REDUCTION_MODE_MIN = 1,
+ VK_SAMPLER_REDUCTION_MODE_MAX = 2,
+ VK_SAMPLER_REDUCTION_MODE_MAX_ENUM = 0x7FFFFFFF
+} VkSamplerReductionMode;
+typedef enum VkShaderFloatControlsIndependence {
+ VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_32_BIT_ONLY = 0,
+ VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_ALL = 1,
+ VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_NONE = 2,
+ VK_SHADER_FLOAT_CONTROLS_INDEPENDENCE_MAX_ENUM = 0x7FFFFFFF
+} VkShaderFloatControlsIndependence;
+typedef enum VkSubmitFlagBits {
+ VK_SUBMIT_PROTECTED_BIT = 1,
+ VK_SUBMIT_PROTECTED_BIT_KHR = VK_SUBMIT_PROTECTED_BIT,
+ VK_SUBMIT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkSubmitFlagBits;
+typedef enum VkVendorId {
+ VK_VENDOR_ID_VIV = 0x10001,
+ VK_VENDOR_ID_VSI = 0x10002,
+ VK_VENDOR_ID_KAZAN = 0x10003,
+ VK_VENDOR_ID_CODEPLAY = 0x10004,
+ VK_VENDOR_ID_MESA = 0x10005,
+ VK_VENDOR_ID_POCL = 0x10006,
+ VK_VENDOR_ID_MAX_ENUM = 0x7FFFFFFF
+} VkVendorId;
+typedef enum VkDriverId {
+ VK_DRIVER_ID_AMD_PROPRIETARY = 1,
+ VK_DRIVER_ID_AMD_OPEN_SOURCE = 2,
+ VK_DRIVER_ID_MESA_RADV = 3,
+ VK_DRIVER_ID_NVIDIA_PROPRIETARY = 4,
+ VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS = 5,
+ VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA = 6,
+ VK_DRIVER_ID_IMAGINATION_PROPRIETARY = 7,
+ VK_DRIVER_ID_QUALCOMM_PROPRIETARY = 8,
+ VK_DRIVER_ID_ARM_PROPRIETARY = 9,
+ VK_DRIVER_ID_GOOGLE_SWIFTSHADER = 10,
+ VK_DRIVER_ID_GGP_PROPRIETARY = 11,
+ VK_DRIVER_ID_BROADCOM_PROPRIETARY = 12,
+ VK_DRIVER_ID_MESA_LLVMPIPE = 13,
+ VK_DRIVER_ID_MOLTENVK = 14,
+ VK_DRIVER_ID_COREAVI_PROPRIETARY = 15,
+ VK_DRIVER_ID_JUICE_PROPRIETARY = 16,
+ VK_DRIVER_ID_VERISILICON_PROPRIETARY = 17,
+ VK_DRIVER_ID_MESA_TURNIP = 18,
+ VK_DRIVER_ID_MESA_V3DV = 19,
+ VK_DRIVER_ID_MESA_PANVK = 20,
+ VK_DRIVER_ID_SAMSUNG_PROPRIETARY = 21,
+ VK_DRIVER_ID_MESA_VENUS = 22,
+ VK_DRIVER_ID_MESA_DOZEN = 23,
+ VK_DRIVER_ID_MAX_ENUM = 0x7FFFFFFF
+} VkDriverId;
+typedef void (VKAPI_PTR *PFN_vkInternalAllocationNotification)(
+ void* pUserData,
+ size_t size,
+ VkInternalAllocationType allocationType,
+ VkSystemAllocationScope allocationScope);
+typedef void (VKAPI_PTR *PFN_vkInternalFreeNotification)(
+ void* pUserData,
+ size_t size,
+ VkInternalAllocationType allocationType,
+ VkSystemAllocationScope allocationScope);
+typedef void* (VKAPI_PTR *PFN_vkReallocationFunction)(
+ void* pUserData,
+ void* pOriginal,
+ size_t size,
+ size_t alignment,
+ VkSystemAllocationScope allocationScope);
+typedef void* (VKAPI_PTR *PFN_vkAllocationFunction)(
+ void* pUserData,
+ size_t size,
+ size_t alignment,
+ VkSystemAllocationScope allocationScope);
+typedef void (VKAPI_PTR *PFN_vkFreeFunction)(
+ void* pUserData,
+ void* pMemory);
+typedef void (VKAPI_PTR *PFN_vkVoidFunction)(void);
+typedef struct VkBaseOutStructure {
+ VkStructureType sType;
+ struct VkBaseOutStructure * pNext;
+} VkBaseOutStructure;
+
+typedef struct VkBaseInStructure {
+ VkStructureType sType;
+ const struct VkBaseInStructure * pNext;
+} VkBaseInStructure;
+
+typedef struct VkOffset2D {
+ int32_t x;
+ int32_t y;
+} VkOffset2D;
+
+typedef struct VkOffset3D {
+ int32_t x;
+ int32_t y;
+ int32_t z;
+} VkOffset3D;
+
+typedef struct VkExtent2D {
+ uint32_t width;
+ uint32_t height;
+} VkExtent2D;
+
+typedef struct VkExtent3D {
+ uint32_t width;
+ uint32_t height;
+ uint32_t depth;
+} VkExtent3D;
+
+typedef struct VkViewport {
+ float x;
+ float y;
+ float width;
+ float height;
+ float minDepth;
+ float maxDepth;
+} VkViewport;
+
+typedef struct VkRect2D {
+ VkOffset2D offset;
+ VkExtent2D extent;
+} VkRect2D;
+
+typedef struct VkClearRect {
+ VkRect2D rect;
+ uint32_t baseArrayLayer;
+ uint32_t layerCount;
+} VkClearRect;
+
+typedef struct VkComponentMapping {
+ VkComponentSwizzle r;
+ VkComponentSwizzle g;
+ VkComponentSwizzle b;
+ VkComponentSwizzle a;
+} VkComponentMapping;
+
+typedef struct VkExtensionProperties {
+ char extensionName [ VK_MAX_EXTENSION_NAME_SIZE ];
+ uint32_t specVersion;
+} VkExtensionProperties;
+
+typedef struct VkLayerProperties {
+ char layerName [ VK_MAX_EXTENSION_NAME_SIZE ];
+ uint32_t specVersion;
+ uint32_t implementationVersion;
+ char description [ VK_MAX_DESCRIPTION_SIZE ];
+} VkLayerProperties;
+
+typedef struct VkApplicationInfo {
+ VkStructureType sType;
+ const void * pNext;
+ const char * pApplicationName;
+ uint32_t applicationVersion;
+ const char * pEngineName;
+ uint32_t engineVersion;
+ uint32_t apiVersion;
+} VkApplicationInfo;
+
+typedef struct VkAllocationCallbacks {
+ void * pUserData;
+ PFN_vkAllocationFunction pfnAllocation;
+ PFN_vkReallocationFunction pfnReallocation;
+ PFN_vkFreeFunction pfnFree;
+ PFN_vkInternalAllocationNotification pfnInternalAllocation;
+ PFN_vkInternalFreeNotification pfnInternalFree;
+} VkAllocationCallbacks;
+
+typedef struct VkDescriptorImageInfo {
+ VkSampler sampler;
+ VkImageView imageView;
+ VkImageLayout imageLayout;
+} VkDescriptorImageInfo;
+
+typedef struct VkCopyDescriptorSet {
+ VkStructureType sType;
+ const void * pNext;
+ VkDescriptorSet srcSet;
+ uint32_t srcBinding;
+ uint32_t srcArrayElement;
+ VkDescriptorSet dstSet;
+ uint32_t dstBinding;
+ uint32_t dstArrayElement;
+ uint32_t descriptorCount;
+} VkCopyDescriptorSet;
+
+typedef struct VkDescriptorPoolSize {
+ VkDescriptorType type;
+ uint32_t descriptorCount;
+} VkDescriptorPoolSize;
+
+typedef struct VkDescriptorSetAllocateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkDescriptorPool descriptorPool;
+ uint32_t descriptorSetCount;
+ const VkDescriptorSetLayout * pSetLayouts;
+} VkDescriptorSetAllocateInfo;
+
+typedef struct VkSpecializationMapEntry {
+ uint32_t constantID;
+ uint32_t offset;
+ size_t size;
+} VkSpecializationMapEntry;
+
+typedef struct VkSpecializationInfo {
+ uint32_t mapEntryCount;
+ const VkSpecializationMapEntry * pMapEntries;
+ size_t dataSize;
+ const void * pData;
+} VkSpecializationInfo;
+
+typedef struct VkVertexInputBindingDescription {
+ uint32_t binding;
+ uint32_t stride;
+ VkVertexInputRate inputRate;
+} VkVertexInputBindingDescription;
+
+typedef struct VkVertexInputAttributeDescription {
+ uint32_t location;
+ uint32_t binding;
+ VkFormat format;
+ uint32_t offset;
+} VkVertexInputAttributeDescription;
+
+typedef struct VkStencilOpState {
+ VkStencilOp failOp;
+ VkStencilOp passOp;
+ VkStencilOp depthFailOp;
+ VkCompareOp compareOp;
+ uint32_t compareMask;
+ uint32_t writeMask;
+ uint32_t reference;
+} VkStencilOpState;
+
+typedef struct VkPipelineCacheHeaderVersionOne {
+ uint32_t headerSize;
+ VkPipelineCacheHeaderVersion headerVersion;
+ uint32_t vendorID;
+ uint32_t deviceID;
+ uint8_t pipelineCacheUUID [ VK_UUID_SIZE ];
+} VkPipelineCacheHeaderVersionOne;
+
+typedef struct VkCommandBufferAllocateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkCommandPool commandPool;
+ VkCommandBufferLevel level;
+ uint32_t commandBufferCount;
+} VkCommandBufferAllocateInfo;
+
+typedef union VkClearColorValue {
+ float float32 [4];
+ int32_t int32 [4];
+ uint32_t uint32 [4];
+} VkClearColorValue;
+
+typedef struct VkClearDepthStencilValue {
+ float depth;
+ uint32_t stencil;
+} VkClearDepthStencilValue;
+
+typedef union VkClearValue {
+ VkClearColorValue color;
+ VkClearDepthStencilValue depthStencil;
+} VkClearValue;
+
+typedef struct VkAttachmentReference {
+ uint32_t attachment;
+ VkImageLayout layout;
+} VkAttachmentReference;
+
+typedef struct VkDrawIndirectCommand {
+ uint32_t vertexCount;
+ uint32_t instanceCount;
+ uint32_t firstVertex;
+ uint32_t firstInstance;
+} VkDrawIndirectCommand;
+
+typedef struct VkDrawIndexedIndirectCommand {
+ uint32_t indexCount;
+ uint32_t instanceCount;
+ uint32_t firstIndex;
+ int32_t vertexOffset;
+ uint32_t firstInstance;
+} VkDrawIndexedIndirectCommand;
+
+typedef struct VkDispatchIndirectCommand {
+ uint32_t x;
+ uint32_t y;
+ uint32_t z;
+} VkDispatchIndirectCommand;
+
+typedef struct VkSurfaceFormatKHR {
+ VkFormat format;
+ VkColorSpaceKHR colorSpace;
+} VkSurfaceFormatKHR;
+
+typedef struct VkPresentInfoKHR {
+ VkStructureType sType;
+ const void * pNext;
+ uint32_t waitSemaphoreCount;
+ const VkSemaphore * pWaitSemaphores;
+ uint32_t swapchainCount;
+ const VkSwapchainKHR * pSwapchains;
+ const uint32_t * pImageIndices;
+ VkResult * pResults;
+} VkPresentInfoKHR;
+
+typedef struct VkDevicePrivateDataCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ uint32_t privateDataSlotRequestCount;
+} VkDevicePrivateDataCreateInfo;
+
+typedef struct VkConformanceVersion {
+ uint8_t major;
+ uint8_t minor;
+ uint8_t subminor;
+ uint8_t patch;
+} VkConformanceVersion;
+
+typedef struct VkPhysicalDeviceDriverProperties {
+ VkStructureType sType;
+ void * pNext;
+ VkDriverId driverID;
+ char driverName [ VK_MAX_DRIVER_NAME_SIZE ];
+ char driverInfo [ VK_MAX_DRIVER_INFO_SIZE ];
+ VkConformanceVersion conformanceVersion;
+} VkPhysicalDeviceDriverProperties;
+
+typedef struct VkPhysicalDeviceExternalImageFormatInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkExternalMemoryHandleTypeFlagBits handleType;
+} VkPhysicalDeviceExternalImageFormatInfo;
+
+typedef struct VkPhysicalDeviceExternalSemaphoreInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkExternalSemaphoreHandleTypeFlagBits handleType;
+} VkPhysicalDeviceExternalSemaphoreInfo;
+
+typedef struct VkPhysicalDeviceExternalFenceInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkExternalFenceHandleTypeFlagBits handleType;
+} VkPhysicalDeviceExternalFenceInfo;
+
+typedef struct VkPhysicalDeviceMultiviewProperties {
+ VkStructureType sType;
+ void * pNext;
+ uint32_t maxMultiviewViewCount;
+ uint32_t maxMultiviewInstanceIndex;
+} VkPhysicalDeviceMultiviewProperties;
+
+typedef struct VkRenderPassMultiviewCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ uint32_t subpassCount;
+ const uint32_t * pViewMasks;
+ uint32_t dependencyCount;
+ const int32_t * pViewOffsets;
+ uint32_t correlationMaskCount;
+ const uint32_t * pCorrelationMasks;
+} VkRenderPassMultiviewCreateInfo;
+
+typedef struct VkBindBufferMemoryDeviceGroupInfo {
+ VkStructureType sType;
+ const void * pNext;
+ uint32_t deviceIndexCount;
+ const uint32_t * pDeviceIndices;
+} VkBindBufferMemoryDeviceGroupInfo;
+
+typedef struct VkBindImageMemoryDeviceGroupInfo {
+ VkStructureType sType;
+ const void * pNext;
+ uint32_t deviceIndexCount;
+ const uint32_t * pDeviceIndices;
+ uint32_t splitInstanceBindRegionCount;
+ const VkRect2D * pSplitInstanceBindRegions;
+} VkBindImageMemoryDeviceGroupInfo;
+
+typedef struct VkDeviceGroupRenderPassBeginInfo {
+ VkStructureType sType;
+ const void * pNext;
+ uint32_t deviceMask;
+ uint32_t deviceRenderAreaCount;
+ const VkRect2D * pDeviceRenderAreas;
+} VkDeviceGroupRenderPassBeginInfo;
+
+typedef struct VkDeviceGroupCommandBufferBeginInfo {
+ VkStructureType sType;
+ const void * pNext;
+ uint32_t deviceMask;
+} VkDeviceGroupCommandBufferBeginInfo;
+
+typedef struct VkDeviceGroupSubmitInfo {
+ VkStructureType sType;
+ const void * pNext;
+ uint32_t waitSemaphoreCount;
+ const uint32_t * pWaitSemaphoreDeviceIndices;
+ uint32_t commandBufferCount;
+ const uint32_t * pCommandBufferDeviceMasks;
+ uint32_t signalSemaphoreCount;
+ const uint32_t * pSignalSemaphoreDeviceIndices;
+} VkDeviceGroupSubmitInfo;
+
+typedef struct VkDeviceGroupBindSparseInfo {
+ VkStructureType sType;
+ const void * pNext;
+ uint32_t resourceDeviceIndex;
+ uint32_t memoryDeviceIndex;
+} VkDeviceGroupBindSparseInfo;
+
+typedef struct VkImageSwapchainCreateInfoKHR {
+ VkStructureType sType;
+ const void * pNext;
+ VkSwapchainKHR swapchain;
+} VkImageSwapchainCreateInfoKHR;
+
+typedef struct VkBindImageMemorySwapchainInfoKHR {
+ VkStructureType sType;
+ const void * pNext;
+ VkSwapchainKHR swapchain;
+ uint32_t imageIndex;
+} VkBindImageMemorySwapchainInfoKHR;
+
+typedef struct VkAcquireNextImageInfoKHR {
+ VkStructureType sType;
+ const void * pNext;
+ VkSwapchainKHR swapchain;
+ uint64_t timeout;
+ VkSemaphore semaphore;
+ VkFence fence;
+ uint32_t deviceMask;
+} VkAcquireNextImageInfoKHR;
+
+typedef struct VkDeviceGroupPresentInfoKHR {
+ VkStructureType sType;
+ const void * pNext;
+ uint32_t swapchainCount;
+ const uint32_t * pDeviceMasks;
+ VkDeviceGroupPresentModeFlagBitsKHR mode;
+} VkDeviceGroupPresentInfoKHR;
+
+typedef struct VkDeviceGroupDeviceCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ uint32_t physicalDeviceCount;
+ const VkPhysicalDevice * pPhysicalDevices;
+} VkDeviceGroupDeviceCreateInfo;
+
+typedef struct VkDescriptorUpdateTemplateEntry {
+ uint32_t dstBinding;
+ uint32_t dstArrayElement;
+ uint32_t descriptorCount;
+ VkDescriptorType descriptorType;
+ size_t offset;
+ size_t stride;
+} VkDescriptorUpdateTemplateEntry;
+
+typedef struct VkBufferMemoryRequirementsInfo2 {
+ VkStructureType sType;
+ const void * pNext;
+ VkBuffer buffer;
+} VkBufferMemoryRequirementsInfo2;
+
+typedef struct VkImageMemoryRequirementsInfo2 {
+ VkStructureType sType;
+ const void * pNext;
+ VkImage image;
+} VkImageMemoryRequirementsInfo2;
+
+typedef struct VkImageSparseMemoryRequirementsInfo2 {
+ VkStructureType sType;
+ const void * pNext;
+ VkImage image;
+} VkImageSparseMemoryRequirementsInfo2;
+
+typedef struct VkPhysicalDevicePointClippingProperties {
+ VkStructureType sType;
+ void * pNext;
+ VkPointClippingBehavior pointClippingBehavior;
+} VkPhysicalDevicePointClippingProperties;
+
+typedef struct VkMemoryDedicatedAllocateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkImage image;
+ VkBuffer buffer;
+} VkMemoryDedicatedAllocateInfo;
+
+typedef struct VkPipelineTessellationDomainOriginStateCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkTessellationDomainOrigin domainOrigin;
+} VkPipelineTessellationDomainOriginStateCreateInfo;
+
+typedef struct VkSamplerYcbcrConversionInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkSamplerYcbcrConversion conversion;
+} VkSamplerYcbcrConversionInfo;
+
+typedef struct VkBindImagePlaneMemoryInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkImageAspectFlagBits planeAspect;
+} VkBindImagePlaneMemoryInfo;
+
+typedef struct VkImagePlaneMemoryRequirementsInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkImageAspectFlagBits planeAspect;
+} VkImagePlaneMemoryRequirementsInfo;
+
+typedef struct VkSamplerYcbcrConversionImageFormatProperties {
+ VkStructureType sType;
+ void * pNext;
+ uint32_t combinedImageSamplerDescriptorCount;
+} VkSamplerYcbcrConversionImageFormatProperties;
+
+typedef struct VkSamplerReductionModeCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkSamplerReductionMode reductionMode;
+} VkSamplerReductionModeCreateInfo;
+
+typedef struct VkPhysicalDeviceInlineUniformBlockProperties {
+ VkStructureType sType;
+ void * pNext;
+ uint32_t maxInlineUniformBlockSize;
+ uint32_t maxPerStageDescriptorInlineUniformBlocks;
+ uint32_t maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks;
+ uint32_t maxDescriptorSetInlineUniformBlocks;
+ uint32_t maxDescriptorSetUpdateAfterBindInlineUniformBlocks;
+} VkPhysicalDeviceInlineUniformBlockProperties;
+
+typedef struct VkWriteDescriptorSetInlineUniformBlock {
+ VkStructureType sType;
+ const void * pNext;
+ uint32_t dataSize;
+ const void * pData;
+} VkWriteDescriptorSetInlineUniformBlock;
+
+typedef struct VkDescriptorPoolInlineUniformBlockCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ uint32_t maxInlineUniformBlockBindings;
+} VkDescriptorPoolInlineUniformBlockCreateInfo;
+
+typedef struct VkImageFormatListCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ uint32_t viewFormatCount;
+ const VkFormat * pViewFormats;
+} VkImageFormatListCreateInfo;
+
+typedef struct VkDescriptorSetVariableDescriptorCountAllocateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ uint32_t descriptorSetCount;
+ const uint32_t * pDescriptorCounts;
+} VkDescriptorSetVariableDescriptorCountAllocateInfo;
+
+typedef struct VkDescriptorSetVariableDescriptorCountLayoutSupport {
+ VkStructureType sType;
+ void * pNext;
+ uint32_t maxVariableDescriptorCount;
+} VkDescriptorSetVariableDescriptorCountLayoutSupport;
+
+typedef struct VkSubpassBeginInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkSubpassContents contents;
+} VkSubpassBeginInfo;
+
+typedef struct VkSubpassEndInfo {
+ VkStructureType sType;
+ const void * pNext;
+} VkSubpassEndInfo;
+
+typedef struct VkPhysicalDeviceTimelineSemaphoreProperties {
+ VkStructureType sType;
+ void * pNext;
+ uint64_t maxTimelineSemaphoreValueDifference;
+} VkPhysicalDeviceTimelineSemaphoreProperties;
+
+typedef struct VkSemaphoreTypeCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkSemaphoreType semaphoreType;
+ uint64_t initialValue;
+} VkSemaphoreTypeCreateInfo;
+
+typedef struct VkTimelineSemaphoreSubmitInfo {
+ VkStructureType sType;
+ const void * pNext;
+ uint32_t waitSemaphoreValueCount;
+ const uint64_t * pWaitSemaphoreValues;
+ uint32_t signalSemaphoreValueCount;
+ const uint64_t * pSignalSemaphoreValues;
+} VkTimelineSemaphoreSubmitInfo;
+
+typedef struct VkSemaphoreSignalInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkSemaphore semaphore;
+ uint64_t value;
+} VkSemaphoreSignalInfo;
+
+typedef struct VkBufferDeviceAddressInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkBuffer buffer;
+} VkBufferDeviceAddressInfo;
+
+typedef struct VkBufferOpaqueCaptureAddressCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ uint64_t opaqueCaptureAddress;
+} VkBufferOpaqueCaptureAddressCreateInfo;
+
+typedef struct VkRenderPassAttachmentBeginInfo {
+ VkStructureType sType;
+ const void * pNext;
+ uint32_t attachmentCount;
+ const VkImageView * pAttachments;
+} VkRenderPassAttachmentBeginInfo;
+
+typedef struct VkAttachmentReferenceStencilLayout {
+ VkStructureType sType;
+ void * pNext;
+ VkImageLayout stencilLayout;
+} VkAttachmentReferenceStencilLayout;
+
+typedef struct VkAttachmentDescriptionStencilLayout {
+ VkStructureType sType;
+ void * pNext;
+ VkImageLayout stencilInitialLayout;
+ VkImageLayout stencilFinalLayout;
+} VkAttachmentDescriptionStencilLayout;
+
+typedef struct VkPipelineShaderStageRequiredSubgroupSizeCreateInfo {
+ VkStructureType sType;
+ void * pNext;
+ uint32_t requiredSubgroupSize;
+} VkPipelineShaderStageRequiredSubgroupSizeCreateInfo;
+
+typedef struct VkMemoryOpaqueCaptureAddressAllocateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ uint64_t opaqueCaptureAddress;
+} VkMemoryOpaqueCaptureAddressAllocateInfo;
+
+typedef struct VkDeviceMemoryOpaqueCaptureAddressInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkDeviceMemory memory;
+} VkDeviceMemoryOpaqueCaptureAddressInfo;
+
+typedef struct VkCommandBufferSubmitInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkCommandBuffer commandBuffer;
+ uint32_t deviceMask;
+} VkCommandBufferSubmitInfo;
+
+typedef struct VkPipelineRenderingCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ uint32_t viewMask;
+ uint32_t colorAttachmentCount;
+ const VkFormat * pColorAttachmentFormats;
+ VkFormat depthAttachmentFormat;
+ VkFormat stencilAttachmentFormat;
+} VkPipelineRenderingCreateInfo;
+
+typedef struct VkRenderingAttachmentInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkImageView imageView;
+ VkImageLayout imageLayout;
+ VkResolveModeFlagBits resolveMode;
+ VkImageView resolveImageView;
+ VkImageLayout resolveImageLayout;
+ VkAttachmentLoadOp loadOp;
+ VkAttachmentStoreOp storeOp;
+ VkClearValue clearValue;
+} VkRenderingAttachmentInfo;
+
+typedef uint32_t VkSampleMask;
+typedef uint32_t VkBool32;
+typedef uint32_t VkFlags;
+typedef uint64_t VkFlags64;
+typedef uint64_t VkDeviceSize;
+typedef uint64_t VkDeviceAddress;
+typedef VkFlags VkFramebufferCreateFlags;
+typedef VkFlags VkQueryPoolCreateFlags;
+typedef VkFlags VkRenderPassCreateFlags;
+typedef VkFlags VkSamplerCreateFlags;
+typedef VkFlags VkPipelineLayoutCreateFlags;
+typedef VkFlags VkPipelineCacheCreateFlags;
+typedef VkFlags VkPipelineDepthStencilStateCreateFlags;
+typedef VkFlags VkPipelineDynamicStateCreateFlags;
+typedef VkFlags VkPipelineColorBlendStateCreateFlags;
+typedef VkFlags VkPipelineMultisampleStateCreateFlags;
+typedef VkFlags VkPipelineRasterizationStateCreateFlags;
+typedef VkFlags VkPipelineViewportStateCreateFlags;
+typedef VkFlags VkPipelineTessellationStateCreateFlags;
+typedef VkFlags VkPipelineInputAssemblyStateCreateFlags;
+typedef VkFlags VkPipelineVertexInputStateCreateFlags;
+typedef VkFlags VkPipelineShaderStageCreateFlags;
+typedef VkFlags VkDescriptorSetLayoutCreateFlags;
+typedef VkFlags VkBufferViewCreateFlags;
+typedef VkFlags VkInstanceCreateFlags;
+typedef VkFlags VkDeviceCreateFlags;
+typedef VkFlags VkDeviceQueueCreateFlags;
+typedef VkFlags VkQueueFlags;
+typedef VkFlags VkMemoryPropertyFlags;
+typedef VkFlags VkMemoryHeapFlags;
+typedef VkFlags VkAccessFlags;
+typedef VkFlags VkBufferUsageFlags;
+typedef VkFlags VkBufferCreateFlags;
+typedef VkFlags VkShaderStageFlags;
+typedef VkFlags VkImageUsageFlags;
+typedef VkFlags VkImageCreateFlags;
+typedef VkFlags VkImageViewCreateFlags;
+typedef VkFlags VkPipelineCreateFlags;
+typedef VkFlags VkColorComponentFlags;
+typedef VkFlags VkFenceCreateFlags;
+typedef VkFlags VkSemaphoreCreateFlags;
+typedef VkFlags VkFormatFeatureFlags;
+typedef VkFlags VkQueryControlFlags;
+typedef VkFlags VkQueryResultFlags;
+typedef VkFlags VkShaderModuleCreateFlags;
+typedef VkFlags VkEventCreateFlags;
+typedef VkFlags VkCommandPoolCreateFlags;
+typedef VkFlags VkCommandPoolResetFlags;
+typedef VkFlags VkCommandBufferResetFlags;
+typedef VkFlags VkCommandBufferUsageFlags;
+typedef VkFlags VkQueryPipelineStatisticFlags;
+typedef VkFlags VkMemoryMapFlags;
+typedef VkFlags VkImageAspectFlags;
+typedef VkFlags VkSparseMemoryBindFlags;
+typedef VkFlags VkSparseImageFormatFlags;
+typedef VkFlags VkSubpassDescriptionFlags;
+typedef VkFlags VkPipelineStageFlags;
+typedef VkFlags VkSampleCountFlags;
+typedef VkFlags VkAttachmentDescriptionFlags;
+typedef VkFlags VkStencilFaceFlags;
+typedef VkFlags VkCullModeFlags;
+typedef VkFlags VkDescriptorPoolCreateFlags;
+typedef VkFlags VkDescriptorPoolResetFlags;
+typedef VkFlags VkDependencyFlags;
+typedef VkFlags VkSubgroupFeatureFlags;
+typedef VkFlags VkPrivateDataSlotCreateFlags;
+typedef VkFlags VkDescriptorUpdateTemplateCreateFlags;
+typedef VkFlags VkPipelineCreationFeedbackFlags;
+typedef VkFlags VkSemaphoreWaitFlags;
+typedef VkFlags64 VkAccessFlags2;
+typedef VkFlags64 VkPipelineStageFlags2;
+typedef VkFlags64 VkFormatFeatureFlags2;
+typedef VkFlags VkRenderingFlags;
+typedef VkFlags VkCompositeAlphaFlagsKHR;
+typedef VkFlags VkSurfaceTransformFlagsKHR;
+typedef VkFlags VkSwapchainCreateFlagsKHR;
+typedef VkFlags VkPeerMemoryFeatureFlags;
+typedef VkFlags VkMemoryAllocateFlags;
+typedef VkFlags VkDeviceGroupPresentModeFlagsKHR;
+typedef VkFlags VkDebugReportFlagsEXT;
+typedef VkFlags VkCommandPoolTrimFlags;
+typedef VkFlags VkExternalMemoryHandleTypeFlags;
+typedef VkFlags VkExternalMemoryFeatureFlags;
+typedef VkFlags VkExternalSemaphoreHandleTypeFlags;
+typedef VkFlags VkExternalSemaphoreFeatureFlags;
+typedef VkFlags VkSemaphoreImportFlags;
+typedef VkFlags VkExternalFenceHandleTypeFlags;
+typedef VkFlags VkExternalFenceFeatureFlags;
+typedef VkFlags VkFenceImportFlags;
+typedef VkFlags VkDescriptorBindingFlags;
+typedef VkFlags VkResolveModeFlags;
+typedef VkFlags VkToolPurposeFlags;
+typedef VkFlags VkSubmitFlags;
+typedef VkBool32 (VKAPI_PTR *PFN_vkDebugReportCallbackEXT)(
+ VkDebugReportFlagsEXT flags,
+ VkDebugReportObjectTypeEXT objectType,
+ uint64_t object,
+ size_t location,
+ int32_t messageCode,
+ const char* pLayerPrefix,
+ const char* pMessage,
+ void* pUserData);
+typedef struct VkDeviceQueueCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkDeviceQueueCreateFlags flags;
+ uint32_t queueFamilyIndex;
+ uint32_t queueCount;
+ const float * pQueuePriorities;
+} VkDeviceQueueCreateInfo;
+
+typedef struct VkInstanceCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkInstanceCreateFlags flags;
+ const VkApplicationInfo * pApplicationInfo;
+ uint32_t enabledLayerCount;
+ const char * const* ppEnabledLayerNames;
+ uint32_t enabledExtensionCount;
+ const char * const* ppEnabledExtensionNames;
+} VkInstanceCreateInfo;
+
+typedef struct VkQueueFamilyProperties {
+ VkQueueFlags queueFlags;
+ uint32_t queueCount;
+ uint32_t timestampValidBits;
+ VkExtent3D minImageTransferGranularity;
+} VkQueueFamilyProperties;
+
+typedef struct VkMemoryAllocateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkDeviceSize allocationSize;
+ uint32_t memoryTypeIndex;
+} VkMemoryAllocateInfo;
+
+typedef struct VkMemoryRequirements {
+ VkDeviceSize size;
+ VkDeviceSize alignment;
+ uint32_t memoryTypeBits;
+} VkMemoryRequirements;
+
+typedef struct VkSparseImageFormatProperties {
+ VkImageAspectFlags aspectMask;
+ VkExtent3D imageGranularity;
+ VkSparseImageFormatFlags flags;
+} VkSparseImageFormatProperties;
+
+typedef struct VkSparseImageMemoryRequirements {
+ VkSparseImageFormatProperties formatProperties;
+ uint32_t imageMipTailFirstLod;
+ VkDeviceSize imageMipTailSize;
+ VkDeviceSize imageMipTailOffset;
+ VkDeviceSize imageMipTailStride;
+} VkSparseImageMemoryRequirements;
+
+typedef struct VkMemoryType {
+ VkMemoryPropertyFlags propertyFlags;
+ uint32_t heapIndex;
+} VkMemoryType;
+
+typedef struct VkMemoryHeap {
+ VkDeviceSize size;
+ VkMemoryHeapFlags flags;
+} VkMemoryHeap;
+
+typedef struct VkMappedMemoryRange {
+ VkStructureType sType;
+ const void * pNext;
+ VkDeviceMemory memory;
+ VkDeviceSize offset;
+ VkDeviceSize size;
+} VkMappedMemoryRange;
+
+typedef struct VkFormatProperties {
+ VkFormatFeatureFlags linearTilingFeatures;
+ VkFormatFeatureFlags optimalTilingFeatures;
+ VkFormatFeatureFlags bufferFeatures;
+} VkFormatProperties;
+
+typedef struct VkImageFormatProperties {
+ VkExtent3D maxExtent;
+ uint32_t maxMipLevels;
+ uint32_t maxArrayLayers;
+ VkSampleCountFlags sampleCounts;
+ VkDeviceSize maxResourceSize;
+} VkImageFormatProperties;
+
+typedef struct VkDescriptorBufferInfo {
+ VkBuffer buffer;
+ VkDeviceSize offset;
+ VkDeviceSize range;
+} VkDescriptorBufferInfo;
+
+typedef struct VkWriteDescriptorSet {
+ VkStructureType sType;
+ const void * pNext;
+ VkDescriptorSet dstSet;
+ uint32_t dstBinding;
+ uint32_t dstArrayElement;
+ uint32_t descriptorCount;
+ VkDescriptorType descriptorType;
+ const VkDescriptorImageInfo * pImageInfo;
+ const VkDescriptorBufferInfo * pBufferInfo;
+ const VkBufferView * pTexelBufferView;
+} VkWriteDescriptorSet;
+
+typedef struct VkBufferCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkBufferCreateFlags flags;
+ VkDeviceSize size;
+ VkBufferUsageFlags usage;
+ VkSharingMode sharingMode;
+ uint32_t queueFamilyIndexCount;
+ const uint32_t * pQueueFamilyIndices;
+} VkBufferCreateInfo;
+
+typedef struct VkBufferViewCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkBufferViewCreateFlags flags;
+ VkBuffer buffer;
+ VkFormat format;
+ VkDeviceSize offset;
+ VkDeviceSize range;
+} VkBufferViewCreateInfo;
+
+typedef struct VkImageSubresource {
+ VkImageAspectFlags aspectMask;
+ uint32_t mipLevel;
+ uint32_t arrayLayer;
+} VkImageSubresource;
+
+typedef struct VkImageSubresourceLayers {
+ VkImageAspectFlags aspectMask;
+ uint32_t mipLevel;
+ uint32_t baseArrayLayer;
+ uint32_t layerCount;
+} VkImageSubresourceLayers;
+
+typedef struct VkImageSubresourceRange {
+ VkImageAspectFlags aspectMask;
+ uint32_t baseMipLevel;
+ uint32_t levelCount;
+ uint32_t baseArrayLayer;
+ uint32_t layerCount;
+} VkImageSubresourceRange;
+
+typedef struct VkMemoryBarrier {
+ VkStructureType sType;
+ const void * pNext;
+ VkAccessFlags srcAccessMask;
+ VkAccessFlags dstAccessMask;
+} VkMemoryBarrier;
+
+typedef struct VkBufferMemoryBarrier {
+ VkStructureType sType;
+ const void * pNext;
+ VkAccessFlags srcAccessMask;
+ VkAccessFlags dstAccessMask;
+ uint32_t srcQueueFamilyIndex;
+ uint32_t dstQueueFamilyIndex;
+ VkBuffer buffer;
+ VkDeviceSize offset;
+ VkDeviceSize size;
+} VkBufferMemoryBarrier;
+
+typedef struct VkImageMemoryBarrier {
+ VkStructureType sType;
+ const void * pNext;
+ VkAccessFlags srcAccessMask;
+ VkAccessFlags dstAccessMask;
+ VkImageLayout oldLayout;
+ VkImageLayout newLayout;
+ uint32_t srcQueueFamilyIndex;
+ uint32_t dstQueueFamilyIndex;
+ VkImage image;
+ VkImageSubresourceRange subresourceRange;
+} VkImageMemoryBarrier;
+
+typedef struct VkImageCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkImageCreateFlags flags;
+ VkImageType imageType;
+ VkFormat format;
+ VkExtent3D extent;
+ uint32_t mipLevels;
+ uint32_t arrayLayers;
+ VkSampleCountFlagBits samples;
+ VkImageTiling tiling;
+ VkImageUsageFlags usage;
+ VkSharingMode sharingMode;
+ uint32_t queueFamilyIndexCount;
+ const uint32_t * pQueueFamilyIndices;
+ VkImageLayout initialLayout;
+} VkImageCreateInfo;
+
+typedef struct VkSubresourceLayout {
+ VkDeviceSize offset;
+ VkDeviceSize size;
+ VkDeviceSize rowPitch;
+ VkDeviceSize arrayPitch;
+ VkDeviceSize depthPitch;
+} VkSubresourceLayout;
+
+typedef struct VkImageViewCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkImageViewCreateFlags flags;
+ VkImage image;
+ VkImageViewType viewType;
+ VkFormat format;
+ VkComponentMapping components;
+ VkImageSubresourceRange subresourceRange;
+} VkImageViewCreateInfo;
+
+typedef struct VkBufferCopy {
+ VkDeviceSize srcOffset;
+ VkDeviceSize dstOffset;
+ VkDeviceSize size;
+} VkBufferCopy;
+
+typedef struct VkSparseMemoryBind {
+ VkDeviceSize resourceOffset;
+ VkDeviceSize size;
+ VkDeviceMemory memory;
+ VkDeviceSize memoryOffset;
+ VkSparseMemoryBindFlags flags;
+} VkSparseMemoryBind;
+
+typedef struct VkSparseImageMemoryBind {
+ VkImageSubresource subresource;
+ VkOffset3D offset;
+ VkExtent3D extent;
+ VkDeviceMemory memory;
+ VkDeviceSize memoryOffset;
+ VkSparseMemoryBindFlags flags;
+} VkSparseImageMemoryBind;
+
+typedef struct VkSparseBufferMemoryBindInfo {
+ VkBuffer buffer;
+ uint32_t bindCount;
+ const VkSparseMemoryBind * pBinds;
+} VkSparseBufferMemoryBindInfo;
+
+typedef struct VkSparseImageOpaqueMemoryBindInfo {
+ VkImage image;
+ uint32_t bindCount;
+ const VkSparseMemoryBind * pBinds;
+} VkSparseImageOpaqueMemoryBindInfo;
+
+typedef struct VkSparseImageMemoryBindInfo {
+ VkImage image;
+ uint32_t bindCount;
+ const VkSparseImageMemoryBind * pBinds;
+} VkSparseImageMemoryBindInfo;
+
+typedef struct VkBindSparseInfo {
+ VkStructureType sType;
+ const void * pNext;
+ uint32_t waitSemaphoreCount;
+ const VkSemaphore * pWaitSemaphores;
+ uint32_t bufferBindCount;
+ const VkSparseBufferMemoryBindInfo * pBufferBinds;
+ uint32_t imageOpaqueBindCount;
+ const VkSparseImageOpaqueMemoryBindInfo * pImageOpaqueBinds;
+ uint32_t imageBindCount;
+ const VkSparseImageMemoryBindInfo * pImageBinds;
+ uint32_t signalSemaphoreCount;
+ const VkSemaphore * pSignalSemaphores;
+} VkBindSparseInfo;
+
+typedef struct VkImageCopy {
+ VkImageSubresourceLayers srcSubresource;
+ VkOffset3D srcOffset;
+ VkImageSubresourceLayers dstSubresource;
+ VkOffset3D dstOffset;
+ VkExtent3D extent;
+} VkImageCopy;
+
+typedef struct VkImageBlit {
+ VkImageSubresourceLayers srcSubresource;
+ VkOffset3D srcOffsets [2];
+ VkImageSubresourceLayers dstSubresource;
+ VkOffset3D dstOffsets [2];
+} VkImageBlit;
+
+typedef struct VkBufferImageCopy {
+ VkDeviceSize bufferOffset;
+ uint32_t bufferRowLength;
+ uint32_t bufferImageHeight;
+ VkImageSubresourceLayers imageSubresource;
+ VkOffset3D imageOffset;
+ VkExtent3D imageExtent;
+} VkBufferImageCopy;
+
+typedef struct VkImageResolve {
+ VkImageSubresourceLayers srcSubresource;
+ VkOffset3D srcOffset;
+ VkImageSubresourceLayers dstSubresource;
+ VkOffset3D dstOffset;
+ VkExtent3D extent;
+} VkImageResolve;
+
+typedef struct VkShaderModuleCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkShaderModuleCreateFlags flags;
+ size_t codeSize;
+ const uint32_t * pCode;
+} VkShaderModuleCreateInfo;
+
+typedef struct VkDescriptorSetLayoutBinding {
+ uint32_t binding;
+ VkDescriptorType descriptorType;
+ uint32_t descriptorCount;
+ VkShaderStageFlags stageFlags;
+ const VkSampler * pImmutableSamplers;
+} VkDescriptorSetLayoutBinding;
+
+typedef struct VkDescriptorSetLayoutCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkDescriptorSetLayoutCreateFlags flags;
+ uint32_t bindingCount;
+ const VkDescriptorSetLayoutBinding * pBindings;
+} VkDescriptorSetLayoutCreateInfo;
+
+typedef struct VkDescriptorPoolCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkDescriptorPoolCreateFlags flags;
+ uint32_t maxSets;
+ uint32_t poolSizeCount;
+ const VkDescriptorPoolSize * pPoolSizes;
+} VkDescriptorPoolCreateInfo;
+
+typedef struct VkPipelineShaderStageCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkPipelineShaderStageCreateFlags flags;
+ VkShaderStageFlagBits stage;
+ VkShaderModule module;
+ const char * pName;
+ const VkSpecializationInfo * pSpecializationInfo;
+} VkPipelineShaderStageCreateInfo;
+
+typedef struct VkComputePipelineCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkPipelineCreateFlags flags;
+ VkPipelineShaderStageCreateInfo stage;
+ VkPipelineLayout layout;
+ VkPipeline basePipelineHandle;
+ int32_t basePipelineIndex;
+} VkComputePipelineCreateInfo;
+
+typedef struct VkPipelineVertexInputStateCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkPipelineVertexInputStateCreateFlags flags;
+ uint32_t vertexBindingDescriptionCount;
+ const VkVertexInputBindingDescription * pVertexBindingDescriptions;
+ uint32_t vertexAttributeDescriptionCount;
+ const VkVertexInputAttributeDescription * pVertexAttributeDescriptions;
+} VkPipelineVertexInputStateCreateInfo;
+
+typedef struct VkPipelineInputAssemblyStateCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkPipelineInputAssemblyStateCreateFlags flags;
+ VkPrimitiveTopology topology;
+ VkBool32 primitiveRestartEnable;
+} VkPipelineInputAssemblyStateCreateInfo;
+
+typedef struct VkPipelineTessellationStateCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkPipelineTessellationStateCreateFlags flags;
+ uint32_t patchControlPoints;
+} VkPipelineTessellationStateCreateInfo;
+
+typedef struct VkPipelineViewportStateCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkPipelineViewportStateCreateFlags flags;
+ uint32_t viewportCount;
+ const VkViewport * pViewports;
+ uint32_t scissorCount;
+ const VkRect2D * pScissors;
+} VkPipelineViewportStateCreateInfo;
+
+typedef struct VkPipelineRasterizationStateCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkPipelineRasterizationStateCreateFlags flags;
+ VkBool32 depthClampEnable;
+ VkBool32 rasterizerDiscardEnable;
+ VkPolygonMode polygonMode;
+ VkCullModeFlags cullMode;
+ VkFrontFace frontFace;
+ VkBool32 depthBiasEnable;
+ float depthBiasConstantFactor;
+ float depthBiasClamp;
+ float depthBiasSlopeFactor;
+ float lineWidth;
+} VkPipelineRasterizationStateCreateInfo;
+
+typedef struct VkPipelineMultisampleStateCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkPipelineMultisampleStateCreateFlags flags;
+ VkSampleCountFlagBits rasterizationSamples;
+ VkBool32 sampleShadingEnable;
+ float minSampleShading;
+ const VkSampleMask * pSampleMask;
+ VkBool32 alphaToCoverageEnable;
+ VkBool32 alphaToOneEnable;
+} VkPipelineMultisampleStateCreateInfo;
+
+typedef struct VkPipelineColorBlendAttachmentState {
+ VkBool32 blendEnable;
+ VkBlendFactor srcColorBlendFactor;
+ VkBlendFactor dstColorBlendFactor;
+ VkBlendOp colorBlendOp;
+ VkBlendFactor srcAlphaBlendFactor;
+ VkBlendFactor dstAlphaBlendFactor;
+ VkBlendOp alphaBlendOp;
+ VkColorComponentFlags colorWriteMask;
+} VkPipelineColorBlendAttachmentState;
+
+typedef struct VkPipelineColorBlendStateCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkPipelineColorBlendStateCreateFlags flags;
+ VkBool32 logicOpEnable;
+ VkLogicOp logicOp;
+ uint32_t attachmentCount;
+ const VkPipelineColorBlendAttachmentState * pAttachments;
+ float blendConstants [4];
+} VkPipelineColorBlendStateCreateInfo;
+
+typedef struct VkPipelineDynamicStateCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkPipelineDynamicStateCreateFlags flags;
+ uint32_t dynamicStateCount;
+ const VkDynamicState * pDynamicStates;
+} VkPipelineDynamicStateCreateInfo;
+
+typedef struct VkPipelineDepthStencilStateCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkPipelineDepthStencilStateCreateFlags flags;
+ VkBool32 depthTestEnable;
+ VkBool32 depthWriteEnable;
+ VkCompareOp depthCompareOp;
+ VkBool32 depthBoundsTestEnable;
+ VkBool32 stencilTestEnable;
+ VkStencilOpState front;
+ VkStencilOpState back;
+ float minDepthBounds;
+ float maxDepthBounds;
+} VkPipelineDepthStencilStateCreateInfo;
+
+typedef struct VkGraphicsPipelineCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkPipelineCreateFlags flags;
+ uint32_t stageCount;
+ const VkPipelineShaderStageCreateInfo * pStages;
+ const VkPipelineVertexInputStateCreateInfo * pVertexInputState;
+ const VkPipelineInputAssemblyStateCreateInfo * pInputAssemblyState;
+ const VkPipelineTessellationStateCreateInfo * pTessellationState;
+ const VkPipelineViewportStateCreateInfo * pViewportState;
+ const VkPipelineRasterizationStateCreateInfo * pRasterizationState;
+ const VkPipelineMultisampleStateCreateInfo * pMultisampleState;
+ const VkPipelineDepthStencilStateCreateInfo * pDepthStencilState;
+ const VkPipelineColorBlendStateCreateInfo * pColorBlendState;
+ const VkPipelineDynamicStateCreateInfo * pDynamicState;
+ VkPipelineLayout layout;
+ VkRenderPass renderPass;
+ uint32_t subpass;
+ VkPipeline basePipelineHandle;
+ int32_t basePipelineIndex;
+} VkGraphicsPipelineCreateInfo;
+
+typedef struct VkPipelineCacheCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkPipelineCacheCreateFlags flags;
+ size_t initialDataSize;
+ const void * pInitialData;
+} VkPipelineCacheCreateInfo;
+
+typedef struct VkPushConstantRange {
+ VkShaderStageFlags stageFlags;
+ uint32_t offset;
+ uint32_t size;
+} VkPushConstantRange;
+
+typedef struct VkPipelineLayoutCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkPipelineLayoutCreateFlags flags;
+ uint32_t setLayoutCount;
+ const VkDescriptorSetLayout * pSetLayouts;
+ uint32_t pushConstantRangeCount;
+ const VkPushConstantRange * pPushConstantRanges;
+} VkPipelineLayoutCreateInfo;
+
+typedef struct VkSamplerCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkSamplerCreateFlags flags;
+ VkFilter magFilter;
+ VkFilter minFilter;
+ VkSamplerMipmapMode mipmapMode;
+ VkSamplerAddressMode addressModeU;
+ VkSamplerAddressMode addressModeV;
+ VkSamplerAddressMode addressModeW;
+ float mipLodBias;
+ VkBool32 anisotropyEnable;
+ float maxAnisotropy;
+ VkBool32 compareEnable;
+ VkCompareOp compareOp;
+ float minLod;
+ float maxLod;
+ VkBorderColor borderColor;
+ VkBool32 unnormalizedCoordinates;
+} VkSamplerCreateInfo;
+
+typedef struct VkCommandPoolCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkCommandPoolCreateFlags flags;
+ uint32_t queueFamilyIndex;
+} VkCommandPoolCreateInfo;
+
+typedef struct VkCommandBufferInheritanceInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkRenderPass renderPass;
+ uint32_t subpass;
+ VkFramebuffer framebuffer;
+ VkBool32 occlusionQueryEnable;
+ VkQueryControlFlags queryFlags;
+ VkQueryPipelineStatisticFlags pipelineStatistics;
+} VkCommandBufferInheritanceInfo;
+
+typedef struct VkCommandBufferBeginInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkCommandBufferUsageFlags flags;
+ const VkCommandBufferInheritanceInfo * pInheritanceInfo;
+} VkCommandBufferBeginInfo;
+
+typedef struct VkRenderPassBeginInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkRenderPass renderPass;
+ VkFramebuffer framebuffer;
+ VkRect2D renderArea;
+ uint32_t clearValueCount;
+ const VkClearValue * pClearValues;
+} VkRenderPassBeginInfo;
+
+typedef struct VkClearAttachment {
+ VkImageAspectFlags aspectMask;
+ uint32_t colorAttachment;
+ VkClearValue clearValue;
+} VkClearAttachment;
+
+typedef struct VkAttachmentDescription {
+ VkAttachmentDescriptionFlags flags;
+ VkFormat format;
+ VkSampleCountFlagBits samples;
+ VkAttachmentLoadOp loadOp;
+ VkAttachmentStoreOp storeOp;
+ VkAttachmentLoadOp stencilLoadOp;
+ VkAttachmentStoreOp stencilStoreOp;
+ VkImageLayout initialLayout;
+ VkImageLayout finalLayout;
+} VkAttachmentDescription;
+
+typedef struct VkSubpassDescription {
+ VkSubpassDescriptionFlags flags;
+ VkPipelineBindPoint pipelineBindPoint;
+ uint32_t inputAttachmentCount;
+ const VkAttachmentReference * pInputAttachments;
+ uint32_t colorAttachmentCount;
+ const VkAttachmentReference * pColorAttachments;
+ const VkAttachmentReference * pResolveAttachments;
+ const VkAttachmentReference * pDepthStencilAttachment;
+ uint32_t preserveAttachmentCount;
+ const uint32_t * pPreserveAttachments;
+} VkSubpassDescription;
+
+typedef struct VkSubpassDependency {
+ uint32_t srcSubpass;
+ uint32_t dstSubpass;
+ VkPipelineStageFlags srcStageMask;
+ VkPipelineStageFlags dstStageMask;
+ VkAccessFlags srcAccessMask;
+ VkAccessFlags dstAccessMask;
+ VkDependencyFlags dependencyFlags;
+} VkSubpassDependency;
+
+typedef struct VkRenderPassCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkRenderPassCreateFlags flags;
+ uint32_t attachmentCount;
+ const VkAttachmentDescription * pAttachments;
+ uint32_t subpassCount;
+ const VkSubpassDescription * pSubpasses;
+ uint32_t dependencyCount;
+ const VkSubpassDependency * pDependencies;
+} VkRenderPassCreateInfo;
+
+typedef struct VkEventCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkEventCreateFlags flags;
+} VkEventCreateInfo;
+
+typedef struct VkFenceCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkFenceCreateFlags flags;
+} VkFenceCreateInfo;
+
+typedef struct VkPhysicalDeviceFeatures {
+ VkBool32 robustBufferAccess;
+ VkBool32 fullDrawIndexUint32;
+ VkBool32 imageCubeArray;
+ VkBool32 independentBlend;
+ VkBool32 geometryShader;
+ VkBool32 tessellationShader;
+ VkBool32 sampleRateShading;
+ VkBool32 dualSrcBlend;
+ VkBool32 logicOp;
+ VkBool32 multiDrawIndirect;
+ VkBool32 drawIndirectFirstInstance;
+ VkBool32 depthClamp;
+ VkBool32 depthBiasClamp;
+ VkBool32 fillModeNonSolid;
+ VkBool32 depthBounds;
+ VkBool32 wideLines;
+ VkBool32 largePoints;
+ VkBool32 alphaToOne;
+ VkBool32 multiViewport;
+ VkBool32 samplerAnisotropy;
+ VkBool32 textureCompressionETC2;
+ VkBool32 textureCompressionASTC_LDR;
+ VkBool32 textureCompressionBC;
+ VkBool32 occlusionQueryPrecise;
+ VkBool32 pipelineStatisticsQuery;
+ VkBool32 vertexPipelineStoresAndAtomics;
+ VkBool32 fragmentStoresAndAtomics;
+ VkBool32 shaderTessellationAndGeometryPointSize;
+ VkBool32 shaderImageGatherExtended;
+ VkBool32 shaderStorageImageExtendedFormats;
+ VkBool32 shaderStorageImageMultisample;
+ VkBool32 shaderStorageImageReadWithoutFormat;
+ VkBool32 shaderStorageImageWriteWithoutFormat;
+ VkBool32 shaderUniformBufferArrayDynamicIndexing;
+ VkBool32 shaderSampledImageArrayDynamicIndexing;
+ VkBool32 shaderStorageBufferArrayDynamicIndexing;
+ VkBool32 shaderStorageImageArrayDynamicIndexing;
+ VkBool32 shaderClipDistance;
+ VkBool32 shaderCullDistance;
+ VkBool32 shaderFloat64;
+ VkBool32 shaderInt64;
+ VkBool32 shaderInt16;
+ VkBool32 shaderResourceResidency;
+ VkBool32 shaderResourceMinLod;
+ VkBool32 sparseBinding;
+ VkBool32 sparseResidencyBuffer;
+ VkBool32 sparseResidencyImage2D;
+ VkBool32 sparseResidencyImage3D;
+ VkBool32 sparseResidency2Samples;
+ VkBool32 sparseResidency4Samples;
+ VkBool32 sparseResidency8Samples;
+ VkBool32 sparseResidency16Samples;
+ VkBool32 sparseResidencyAliased;
+ VkBool32 variableMultisampleRate;
+ VkBool32 inheritedQueries;
+} VkPhysicalDeviceFeatures;
+
+typedef struct VkPhysicalDeviceSparseProperties {
+ VkBool32 residencyStandard2DBlockShape;
+ VkBool32 residencyStandard2DMultisampleBlockShape;
+ VkBool32 residencyStandard3DBlockShape;
+ VkBool32 residencyAlignedMipSize;
+ VkBool32 residencyNonResidentStrict;
+} VkPhysicalDeviceSparseProperties;
+
+typedef struct VkPhysicalDeviceLimits {
+ uint32_t maxImageDimension1D;
+ uint32_t maxImageDimension2D;
+ uint32_t maxImageDimension3D;
+ uint32_t maxImageDimensionCube;
+ uint32_t maxImageArrayLayers;
+ uint32_t maxTexelBufferElements;
+ uint32_t maxUniformBufferRange;
+ uint32_t maxStorageBufferRange;
+ uint32_t maxPushConstantsSize;
+ uint32_t maxMemoryAllocationCount;
+ uint32_t maxSamplerAllocationCount;
+ VkDeviceSize bufferImageGranularity;
+ VkDeviceSize sparseAddressSpaceSize;
+ uint32_t maxBoundDescriptorSets;
+ uint32_t maxPerStageDescriptorSamplers;
+ uint32_t maxPerStageDescriptorUniformBuffers;
+ uint32_t maxPerStageDescriptorStorageBuffers;
+ uint32_t maxPerStageDescriptorSampledImages;
+ uint32_t maxPerStageDescriptorStorageImages;
+ uint32_t maxPerStageDescriptorInputAttachments;
+ uint32_t maxPerStageResources;
+ uint32_t maxDescriptorSetSamplers;
+ uint32_t maxDescriptorSetUniformBuffers;
+ uint32_t maxDescriptorSetUniformBuffersDynamic;
+ uint32_t maxDescriptorSetStorageBuffers;
+ uint32_t maxDescriptorSetStorageBuffersDynamic;
+ uint32_t maxDescriptorSetSampledImages;
+ uint32_t maxDescriptorSetStorageImages;
+ uint32_t maxDescriptorSetInputAttachments;
+ uint32_t maxVertexInputAttributes;
+ uint32_t maxVertexInputBindings;
+ uint32_t maxVertexInputAttributeOffset;
+ uint32_t maxVertexInputBindingStride;
+ uint32_t maxVertexOutputComponents;
+ uint32_t maxTessellationGenerationLevel;
+ uint32_t maxTessellationPatchSize;
+ uint32_t maxTessellationControlPerVertexInputComponents;
+ uint32_t maxTessellationControlPerVertexOutputComponents;
+ uint32_t maxTessellationControlPerPatchOutputComponents;
+ uint32_t maxTessellationControlTotalOutputComponents;
+ uint32_t maxTessellationEvaluationInputComponents;
+ uint32_t maxTessellationEvaluationOutputComponents;
+ uint32_t maxGeometryShaderInvocations;
+ uint32_t maxGeometryInputComponents;
+ uint32_t maxGeometryOutputComponents;
+ uint32_t maxGeometryOutputVertices;
+ uint32_t maxGeometryTotalOutputComponents;
+ uint32_t maxFragmentInputComponents;
+ uint32_t maxFragmentOutputAttachments;
+ uint32_t maxFragmentDualSrcAttachments;
+ uint32_t maxFragmentCombinedOutputResources;
+ uint32_t maxComputeSharedMemorySize;
+ uint32_t maxComputeWorkGroupCount [3];
+ uint32_t maxComputeWorkGroupInvocations;
+ uint32_t maxComputeWorkGroupSize [3];
+ uint32_t subPixelPrecisionBits;
+ uint32_t subTexelPrecisionBits;
+ uint32_t mipmapPrecisionBits;
+ uint32_t maxDrawIndexedIndexValue;
+ uint32_t maxDrawIndirectCount;
+ float maxSamplerLodBias;
+ float maxSamplerAnisotropy;
+ uint32_t maxViewports;
+ uint32_t maxViewportDimensions [2];
+ float viewportBoundsRange [2];
+ uint32_t viewportSubPixelBits;
+ size_t minMemoryMapAlignment;
+ VkDeviceSize minTexelBufferOffsetAlignment;
+ VkDeviceSize minUniformBufferOffsetAlignment;
+ VkDeviceSize minStorageBufferOffsetAlignment;
+ int32_t minTexelOffset;
+ uint32_t maxTexelOffset;
+ int32_t minTexelGatherOffset;
+ uint32_t maxTexelGatherOffset;
+ float minInterpolationOffset;
+ float maxInterpolationOffset;
+ uint32_t subPixelInterpolationOffsetBits;
+ uint32_t maxFramebufferWidth;
+ uint32_t maxFramebufferHeight;
+ uint32_t maxFramebufferLayers;
+ VkSampleCountFlags framebufferColorSampleCounts;
+ VkSampleCountFlags framebufferDepthSampleCounts;
+ VkSampleCountFlags framebufferStencilSampleCounts;
+ VkSampleCountFlags framebufferNoAttachmentsSampleCounts;
+ uint32_t maxColorAttachments;
+ VkSampleCountFlags sampledImageColorSampleCounts;
+ VkSampleCountFlags sampledImageIntegerSampleCounts;
+ VkSampleCountFlags sampledImageDepthSampleCounts;
+ VkSampleCountFlags sampledImageStencilSampleCounts;
+ VkSampleCountFlags storageImageSampleCounts;
+ uint32_t maxSampleMaskWords;
+ VkBool32 timestampComputeAndGraphics;
+ float timestampPeriod;
+ uint32_t maxClipDistances;
+ uint32_t maxCullDistances;
+ uint32_t maxCombinedClipAndCullDistances;
+ uint32_t discreteQueuePriorities;
+ float pointSizeRange [2];
+ float lineWidthRange [2];
+ float pointSizeGranularity;
+ float lineWidthGranularity;
+ VkBool32 strictLines;
+ VkBool32 standardSampleLocations;
+ VkDeviceSize optimalBufferCopyOffsetAlignment;
+ VkDeviceSize optimalBufferCopyRowPitchAlignment;
+ VkDeviceSize nonCoherentAtomSize;
+} VkPhysicalDeviceLimits;
+
+typedef struct VkSemaphoreCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkSemaphoreCreateFlags flags;
+} VkSemaphoreCreateInfo;
+
+typedef struct VkQueryPoolCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkQueryPoolCreateFlags flags;
+ VkQueryType queryType;
+ uint32_t queryCount;
+ VkQueryPipelineStatisticFlags pipelineStatistics;
+} VkQueryPoolCreateInfo;
+
+typedef struct VkFramebufferCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkFramebufferCreateFlags flags;
+ VkRenderPass renderPass;
+ uint32_t attachmentCount;
+ const VkImageView * pAttachments;
+ uint32_t width;
+ uint32_t height;
+ uint32_t layers;
+} VkFramebufferCreateInfo;
+
+typedef struct VkSubmitInfo {
+ VkStructureType sType;
+ const void * pNext;
+ uint32_t waitSemaphoreCount;
+ const VkSemaphore * pWaitSemaphores;
+ const VkPipelineStageFlags * pWaitDstStageMask;
+ uint32_t commandBufferCount;
+ const VkCommandBuffer * pCommandBuffers;
+ uint32_t signalSemaphoreCount;
+ const VkSemaphore * pSignalSemaphores;
+} VkSubmitInfo;
+
+typedef struct VkSurfaceCapabilitiesKHR {
+ uint32_t minImageCount;
+ uint32_t maxImageCount;
+ VkExtent2D currentExtent;
+ VkExtent2D minImageExtent;
+ VkExtent2D maxImageExtent;
+ uint32_t maxImageArrayLayers;
+ VkSurfaceTransformFlagsKHR supportedTransforms;
+ VkSurfaceTransformFlagBitsKHR currentTransform;
+ VkCompositeAlphaFlagsKHR supportedCompositeAlpha;
+ VkImageUsageFlags supportedUsageFlags;
+} VkSurfaceCapabilitiesKHR;
+
+typedef struct VkSwapchainCreateInfoKHR {
+ VkStructureType sType;
+ const void * pNext;
+ VkSwapchainCreateFlagsKHR flags;
+ VkSurfaceKHR surface;
+ uint32_t minImageCount;
+ VkFormat imageFormat;
+ VkColorSpaceKHR imageColorSpace;
+ VkExtent2D imageExtent;
+ uint32_t imageArrayLayers;
+ VkImageUsageFlags imageUsage;
+ VkSharingMode imageSharingMode;
+ uint32_t queueFamilyIndexCount;
+ const uint32_t * pQueueFamilyIndices;
+ VkSurfaceTransformFlagBitsKHR preTransform;
+ VkCompositeAlphaFlagBitsKHR compositeAlpha;
+ VkPresentModeKHR presentMode;
+ VkBool32 clipped;
+ VkSwapchainKHR oldSwapchain;
+} VkSwapchainCreateInfoKHR;
+
+typedef struct VkDebugReportCallbackCreateInfoEXT {
+ VkStructureType sType;
+ const void * pNext;
+ VkDebugReportFlagsEXT flags;
+ PFN_vkDebugReportCallbackEXT pfnCallback;
+ void * pUserData;
+} VkDebugReportCallbackCreateInfoEXT;
+
+typedef struct VkPrivateDataSlotCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkPrivateDataSlotCreateFlags flags;
+} VkPrivateDataSlotCreateInfo;
+
+typedef struct VkPhysicalDevicePrivateDataFeatures {
+ VkStructureType sType;
+ void * pNext;
+ VkBool32 privateData;
+} VkPhysicalDevicePrivateDataFeatures;
+
+typedef struct VkPhysicalDeviceFeatures2 {
+ VkStructureType sType;
+ void * pNext;
+ VkPhysicalDeviceFeatures features;
+} VkPhysicalDeviceFeatures2;
+
+typedef struct VkFormatProperties2 {
+ VkStructureType sType;
+ void * pNext;
+ VkFormatProperties formatProperties;
+} VkFormatProperties2;
+
+typedef struct VkImageFormatProperties2 {
+ VkStructureType sType;
+ void * pNext;
+ VkImageFormatProperties imageFormatProperties;
+} VkImageFormatProperties2;
+
+typedef struct VkPhysicalDeviceImageFormatInfo2 {
+ VkStructureType sType;
+ const void * pNext;
+ VkFormat format;
+ VkImageType type;
+ VkImageTiling tiling;
+ VkImageUsageFlags usage;
+ VkImageCreateFlags flags;
+} VkPhysicalDeviceImageFormatInfo2;
+
+typedef struct VkQueueFamilyProperties2 {
+ VkStructureType sType;
+ void * pNext;
+ VkQueueFamilyProperties queueFamilyProperties;
+} VkQueueFamilyProperties2;
+
+typedef struct VkSparseImageFormatProperties2 {
+ VkStructureType sType;
+ void * pNext;
+ VkSparseImageFormatProperties properties;
+} VkSparseImageFormatProperties2;
+
+typedef struct VkPhysicalDeviceSparseImageFormatInfo2 {
+ VkStructureType sType;
+ const void * pNext;
+ VkFormat format;
+ VkImageType type;
+ VkSampleCountFlagBits samples;
+ VkImageUsageFlags usage;
+ VkImageTiling tiling;
+} VkPhysicalDeviceSparseImageFormatInfo2;
+
+typedef struct VkPhysicalDeviceVariablePointersFeatures {
+ VkStructureType sType;
+ void * pNext;
+ VkBool32 variablePointersStorageBuffer;
+ VkBool32 variablePointers;
+} VkPhysicalDeviceVariablePointersFeatures;
+
+typedef struct VkPhysicalDeviceVariablePointersFeatures VkPhysicalDeviceVariablePointerFeatures;
+
+typedef struct VkExternalMemoryProperties {
+ VkExternalMemoryFeatureFlags externalMemoryFeatures;
+ VkExternalMemoryHandleTypeFlags exportFromImportedHandleTypes;
+ VkExternalMemoryHandleTypeFlags compatibleHandleTypes;
+} VkExternalMemoryProperties;
+
+typedef struct VkExternalImageFormatProperties {
+ VkStructureType sType;
+ void * pNext;
+ VkExternalMemoryProperties externalMemoryProperties;
+} VkExternalImageFormatProperties;
+
+typedef struct VkPhysicalDeviceExternalBufferInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkBufferCreateFlags flags;
+ VkBufferUsageFlags usage;
+ VkExternalMemoryHandleTypeFlagBits handleType;
+} VkPhysicalDeviceExternalBufferInfo;
+
+typedef struct VkExternalBufferProperties {
+ VkStructureType sType;
+ void * pNext;
+ VkExternalMemoryProperties externalMemoryProperties;
+} VkExternalBufferProperties;
+
+typedef struct VkPhysicalDeviceIDProperties {
+ VkStructureType sType;
+ void * pNext;
+ uint8_t deviceUUID [ VK_UUID_SIZE ];
+ uint8_t driverUUID [ VK_UUID_SIZE ];
+ uint8_t deviceLUID [ VK_LUID_SIZE ];
+ uint32_t deviceNodeMask;
+ VkBool32 deviceLUIDValid;
+} VkPhysicalDeviceIDProperties;
+
+typedef struct VkExternalMemoryImageCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkExternalMemoryHandleTypeFlags handleTypes;
+} VkExternalMemoryImageCreateInfo;
+
+typedef struct VkExternalMemoryBufferCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkExternalMemoryHandleTypeFlags handleTypes;
+} VkExternalMemoryBufferCreateInfo;
+
+typedef struct VkExportMemoryAllocateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkExternalMemoryHandleTypeFlags handleTypes;
+} VkExportMemoryAllocateInfo;
+
+typedef struct VkExternalSemaphoreProperties {
+ VkStructureType sType;
+ void * pNext;
+ VkExternalSemaphoreHandleTypeFlags exportFromImportedHandleTypes;
+ VkExternalSemaphoreHandleTypeFlags compatibleHandleTypes;
+ VkExternalSemaphoreFeatureFlags externalSemaphoreFeatures;
+} VkExternalSemaphoreProperties;
+
+typedef struct VkExportSemaphoreCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkExternalSemaphoreHandleTypeFlags handleTypes;
+} VkExportSemaphoreCreateInfo;
+
+typedef struct VkExternalFenceProperties {
+ VkStructureType sType;
+ void * pNext;
+ VkExternalFenceHandleTypeFlags exportFromImportedHandleTypes;
+ VkExternalFenceHandleTypeFlags compatibleHandleTypes;
+ VkExternalFenceFeatureFlags externalFenceFeatures;
+} VkExternalFenceProperties;
+
+typedef struct VkExportFenceCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkExternalFenceHandleTypeFlags handleTypes;
+} VkExportFenceCreateInfo;
+
+typedef struct VkPhysicalDeviceMultiviewFeatures {
+ VkStructureType sType;
+ void * pNext;
+ VkBool32 multiview;
+ VkBool32 multiviewGeometryShader;
+ VkBool32 multiviewTessellationShader;
+} VkPhysicalDeviceMultiviewFeatures;
+
+typedef struct VkPhysicalDeviceGroupProperties {
+ VkStructureType sType;
+ void * pNext;
+ uint32_t physicalDeviceCount;
+ VkPhysicalDevice physicalDevices [ VK_MAX_DEVICE_GROUP_SIZE ];
+ VkBool32 subsetAllocation;
+} VkPhysicalDeviceGroupProperties;
+
+typedef struct VkMemoryAllocateFlagsInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkMemoryAllocateFlags flags;
+ uint32_t deviceMask;
+} VkMemoryAllocateFlagsInfo;
+
+typedef struct VkBindBufferMemoryInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkBuffer buffer;
+ VkDeviceMemory memory;
+ VkDeviceSize memoryOffset;
+} VkBindBufferMemoryInfo;
+
+typedef struct VkBindImageMemoryInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkImage image;
+ VkDeviceMemory memory;
+ VkDeviceSize memoryOffset;
+} VkBindImageMemoryInfo;
+
+typedef struct VkDeviceGroupPresentCapabilitiesKHR {
+ VkStructureType sType;
+ void * pNext;
+ uint32_t presentMask [ VK_MAX_DEVICE_GROUP_SIZE ];
+ VkDeviceGroupPresentModeFlagsKHR modes;
+} VkDeviceGroupPresentCapabilitiesKHR;
+
+typedef struct VkDeviceGroupSwapchainCreateInfoKHR {
+ VkStructureType sType;
+ const void * pNext;
+ VkDeviceGroupPresentModeFlagsKHR modes;
+} VkDeviceGroupSwapchainCreateInfoKHR;
+
+typedef struct VkDescriptorUpdateTemplateCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkDescriptorUpdateTemplateCreateFlags flags;
+ uint32_t descriptorUpdateEntryCount;
+ const VkDescriptorUpdateTemplateEntry * pDescriptorUpdateEntries;
+ VkDescriptorUpdateTemplateType templateType;
+ VkDescriptorSetLayout descriptorSetLayout;
+ VkPipelineBindPoint pipelineBindPoint;
+ VkPipelineLayout pipelineLayout;
+ uint32_t set;
+} VkDescriptorUpdateTemplateCreateInfo;
+
+typedef struct VkInputAttachmentAspectReference {
+ uint32_t subpass;
+ uint32_t inputAttachmentIndex;
+ VkImageAspectFlags aspectMask;
+} VkInputAttachmentAspectReference;
+
+typedef struct VkRenderPassInputAttachmentAspectCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ uint32_t aspectReferenceCount;
+ const VkInputAttachmentAspectReference * pAspectReferences;
+} VkRenderPassInputAttachmentAspectCreateInfo;
+
+typedef struct VkPhysicalDevice16BitStorageFeatures {
+ VkStructureType sType;
+ void * pNext;
+ VkBool32 storageBuffer16BitAccess;
+ VkBool32 uniformAndStorageBuffer16BitAccess;
+ VkBool32 storagePushConstant16;
+ VkBool32 storageInputOutput16;
+} VkPhysicalDevice16BitStorageFeatures;
+
+typedef struct VkPhysicalDeviceSubgroupProperties {
+ VkStructureType sType;
+ void * pNext;
+ uint32_t subgroupSize;
+ VkShaderStageFlags supportedStages;
+ VkSubgroupFeatureFlags supportedOperations;
+ VkBool32 quadOperationsInAllStages;
+} VkPhysicalDeviceSubgroupProperties;
+
+typedef struct VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures {
+ VkStructureType sType;
+ void * pNext;
+ VkBool32 shaderSubgroupExtendedTypes;
+} VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures;
+
+typedef struct VkDeviceBufferMemoryRequirements {
+ VkStructureType sType;
+ const void * pNext;
+ const VkBufferCreateInfo * pCreateInfo;
+} VkDeviceBufferMemoryRequirements;
+
+typedef struct VkDeviceImageMemoryRequirements {
+ VkStructureType sType;
+ const void * pNext;
+ const VkImageCreateInfo * pCreateInfo;
+ VkImageAspectFlagBits planeAspect;
+} VkDeviceImageMemoryRequirements;
+
+typedef struct VkMemoryRequirements2 {
+ VkStructureType sType;
+ void * pNext;
+ VkMemoryRequirements memoryRequirements;
+} VkMemoryRequirements2;
+
+typedef struct VkSparseImageMemoryRequirements2 {
+ VkStructureType sType;
+ void * pNext;
+ VkSparseImageMemoryRequirements memoryRequirements;
+} VkSparseImageMemoryRequirements2;
+
+typedef struct VkMemoryDedicatedRequirements {
+ VkStructureType sType;
+ void * pNext;
+ VkBool32 prefersDedicatedAllocation;
+ VkBool32 requiresDedicatedAllocation;
+} VkMemoryDedicatedRequirements;
+
+typedef struct VkImageViewUsageCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkImageUsageFlags usage;
+} VkImageViewUsageCreateInfo;
+
+typedef struct VkSamplerYcbcrConversionCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkFormat format;
+ VkSamplerYcbcrModelConversion ycbcrModel;
+ VkSamplerYcbcrRange ycbcrRange;
+ VkComponentMapping components;
+ VkChromaLocation xChromaOffset;
+ VkChromaLocation yChromaOffset;
+ VkFilter chromaFilter;
+ VkBool32 forceExplicitReconstruction;
+} VkSamplerYcbcrConversionCreateInfo;
+
+typedef struct VkPhysicalDeviceSamplerYcbcrConversionFeatures {
+ VkStructureType sType;
+ void * pNext;
+ VkBool32 samplerYcbcrConversion;
+} VkPhysicalDeviceSamplerYcbcrConversionFeatures;
+
+typedef struct VkProtectedSubmitInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkBool32 protectedSubmit;
+} VkProtectedSubmitInfo;
+
+typedef struct VkPhysicalDeviceProtectedMemoryFeatures {
+ VkStructureType sType;
+ void * pNext;
+ VkBool32 protectedMemory;
+} VkPhysicalDeviceProtectedMemoryFeatures;
+
+typedef struct VkPhysicalDeviceProtectedMemoryProperties {
+ VkStructureType sType;
+ void * pNext;
+ VkBool32 protectedNoFault;
+} VkPhysicalDeviceProtectedMemoryProperties;
+
+typedef struct VkDeviceQueueInfo2 {
+ VkStructureType sType;
+ const void * pNext;
+ VkDeviceQueueCreateFlags flags;
+ uint32_t queueFamilyIndex;
+ uint32_t queueIndex;
+} VkDeviceQueueInfo2;
+
+typedef struct VkPhysicalDeviceSamplerFilterMinmaxProperties {
+ VkStructureType sType;
+ void * pNext;
+ VkBool32 filterMinmaxSingleComponentFormats;
+ VkBool32 filterMinmaxImageComponentMapping;
+} VkPhysicalDeviceSamplerFilterMinmaxProperties;
+
+typedef struct VkPhysicalDeviceInlineUniformBlockFeatures {
+ VkStructureType sType;
+ void * pNext;
+ VkBool32 inlineUniformBlock;
+ VkBool32 descriptorBindingInlineUniformBlockUpdateAfterBind;
+} VkPhysicalDeviceInlineUniformBlockFeatures;
+
+typedef struct VkPhysicalDeviceMaintenance3Properties {
+ VkStructureType sType;
+ void * pNext;
+ uint32_t maxPerSetDescriptors;
+ VkDeviceSize maxMemoryAllocationSize;
+} VkPhysicalDeviceMaintenance3Properties;
+
+typedef struct VkPhysicalDeviceMaintenance4Features {
+ VkStructureType sType;
+ void * pNext;
+ VkBool32 maintenance4;
+} VkPhysicalDeviceMaintenance4Features;
+
+typedef struct VkPhysicalDeviceMaintenance4Properties {
+ VkStructureType sType;
+ void * pNext;
+ VkDeviceSize maxBufferSize;
+} VkPhysicalDeviceMaintenance4Properties;
+
+typedef struct VkDescriptorSetLayoutSupport {
+ VkStructureType sType;
+ void * pNext;
+ VkBool32 supported;
+} VkDescriptorSetLayoutSupport;
+
+typedef struct VkPhysicalDeviceShaderDrawParametersFeatures {
+ VkStructureType sType;
+ void * pNext;
+ VkBool32 shaderDrawParameters;
+} VkPhysicalDeviceShaderDrawParametersFeatures;
+
+typedef struct VkPhysicalDeviceShaderDrawParametersFeatures VkPhysicalDeviceShaderDrawParameterFeatures;
+
+typedef struct VkPhysicalDeviceShaderFloat16Int8Features {
+ VkStructureType sType;
+ void * pNext;
+ VkBool32 shaderFloat16;
+ VkBool32 shaderInt8;
+} VkPhysicalDeviceShaderFloat16Int8Features;
+
+typedef struct VkPhysicalDeviceFloatControlsProperties {
+ VkStructureType sType;
+ void * pNext;
+ VkShaderFloatControlsIndependence denormBehaviorIndependence;
+ VkShaderFloatControlsIndependence roundingModeIndependence;
+ VkBool32 shaderSignedZeroInfNanPreserveFloat16;
+ VkBool32 shaderSignedZeroInfNanPreserveFloat32;
+ VkBool32 shaderSignedZeroInfNanPreserveFloat64;
+ VkBool32 shaderDenormPreserveFloat16;
+ VkBool32 shaderDenormPreserveFloat32;
+ VkBool32 shaderDenormPreserveFloat64;
+ VkBool32 shaderDenormFlushToZeroFloat16;
+ VkBool32 shaderDenormFlushToZeroFloat32;
+ VkBool32 shaderDenormFlushToZeroFloat64;
+ VkBool32 shaderRoundingModeRTEFloat16;
+ VkBool32 shaderRoundingModeRTEFloat32;
+ VkBool32 shaderRoundingModeRTEFloat64;
+ VkBool32 shaderRoundingModeRTZFloat16;
+ VkBool32 shaderRoundingModeRTZFloat32;
+ VkBool32 shaderRoundingModeRTZFloat64;
+} VkPhysicalDeviceFloatControlsProperties;
+
+typedef struct VkPhysicalDeviceHostQueryResetFeatures {
+ VkStructureType sType;
+ void * pNext;
+ VkBool32 hostQueryReset;
+} VkPhysicalDeviceHostQueryResetFeatures;
+
+typedef struct VkPhysicalDeviceDescriptorIndexingFeatures {
+ VkStructureType sType;
+ void * pNext;
+ VkBool32 shaderInputAttachmentArrayDynamicIndexing;
+ VkBool32 shaderUniformTexelBufferArrayDynamicIndexing;
+ VkBool32 shaderStorageTexelBufferArrayDynamicIndexing;
+ VkBool32 shaderUniformBufferArrayNonUniformIndexing;
+ VkBool32 shaderSampledImageArrayNonUniformIndexing;
+ VkBool32 shaderStorageBufferArrayNonUniformIndexing;
+ VkBool32 shaderStorageImageArrayNonUniformIndexing;
+ VkBool32 shaderInputAttachmentArrayNonUniformIndexing;
+ VkBool32 shaderUniformTexelBufferArrayNonUniformIndexing;
+ VkBool32 shaderStorageTexelBufferArrayNonUniformIndexing;
+ VkBool32 descriptorBindingUniformBufferUpdateAfterBind;
+ VkBool32 descriptorBindingSampledImageUpdateAfterBind;
+ VkBool32 descriptorBindingStorageImageUpdateAfterBind;
+ VkBool32 descriptorBindingStorageBufferUpdateAfterBind;
+ VkBool32 descriptorBindingUniformTexelBufferUpdateAfterBind;
+ VkBool32 descriptorBindingStorageTexelBufferUpdateAfterBind;
+ VkBool32 descriptorBindingUpdateUnusedWhilePending;
+ VkBool32 descriptorBindingPartiallyBound;
+ VkBool32 descriptorBindingVariableDescriptorCount;
+ VkBool32 runtimeDescriptorArray;
+} VkPhysicalDeviceDescriptorIndexingFeatures;
+
+typedef struct VkPhysicalDeviceDescriptorIndexingProperties {
+ VkStructureType sType;
+ void * pNext;
+ uint32_t maxUpdateAfterBindDescriptorsInAllPools;
+ VkBool32 shaderUniformBufferArrayNonUniformIndexingNative;
+ VkBool32 shaderSampledImageArrayNonUniformIndexingNative;
+ VkBool32 shaderStorageBufferArrayNonUniformIndexingNative;
+ VkBool32 shaderStorageImageArrayNonUniformIndexingNative;
+ VkBool32 shaderInputAttachmentArrayNonUniformIndexingNative;
+ VkBool32 robustBufferAccessUpdateAfterBind;
+ VkBool32 quadDivergentImplicitLod;
+ uint32_t maxPerStageDescriptorUpdateAfterBindSamplers;
+ uint32_t maxPerStageDescriptorUpdateAfterBindUniformBuffers;
+ uint32_t maxPerStageDescriptorUpdateAfterBindStorageBuffers;
+ uint32_t maxPerStageDescriptorUpdateAfterBindSampledImages;
+ uint32_t maxPerStageDescriptorUpdateAfterBindStorageImages;
+ uint32_t maxPerStageDescriptorUpdateAfterBindInputAttachments;
+ uint32_t maxPerStageUpdateAfterBindResources;
+ uint32_t maxDescriptorSetUpdateAfterBindSamplers;
+ uint32_t maxDescriptorSetUpdateAfterBindUniformBuffers;
+ uint32_t maxDescriptorSetUpdateAfterBindUniformBuffersDynamic;
+ uint32_t maxDescriptorSetUpdateAfterBindStorageBuffers;
+ uint32_t maxDescriptorSetUpdateAfterBindStorageBuffersDynamic;
+ uint32_t maxDescriptorSetUpdateAfterBindSampledImages;
+ uint32_t maxDescriptorSetUpdateAfterBindStorageImages;
+ uint32_t maxDescriptorSetUpdateAfterBindInputAttachments;
+} VkPhysicalDeviceDescriptorIndexingProperties;
+
+typedef struct VkDescriptorSetLayoutBindingFlagsCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ uint32_t bindingCount;
+ const VkDescriptorBindingFlags * pBindingFlags;
+} VkDescriptorSetLayoutBindingFlagsCreateInfo;
+
+typedef struct VkAttachmentDescription2 {
+ VkStructureType sType;
+ const void * pNext;
+ VkAttachmentDescriptionFlags flags;
+ VkFormat format;
+ VkSampleCountFlagBits samples;
+ VkAttachmentLoadOp loadOp;
+ VkAttachmentStoreOp storeOp;
+ VkAttachmentLoadOp stencilLoadOp;
+ VkAttachmentStoreOp stencilStoreOp;
+ VkImageLayout initialLayout;
+ VkImageLayout finalLayout;
+} VkAttachmentDescription2;
+
+typedef struct VkAttachmentReference2 {
+ VkStructureType sType;
+ const void * pNext;
+ uint32_t attachment;
+ VkImageLayout layout;
+ VkImageAspectFlags aspectMask;
+} VkAttachmentReference2;
+
+typedef struct VkSubpassDescription2 {
+ VkStructureType sType;
+ const void * pNext;
+ VkSubpassDescriptionFlags flags;
+ VkPipelineBindPoint pipelineBindPoint;
+ uint32_t viewMask;
+ uint32_t inputAttachmentCount;
+ const VkAttachmentReference2 * pInputAttachments;
+ uint32_t colorAttachmentCount;
+ const VkAttachmentReference2 * pColorAttachments;
+ const VkAttachmentReference2 * pResolveAttachments;
+ const VkAttachmentReference2 * pDepthStencilAttachment;
+ uint32_t preserveAttachmentCount;
+ const uint32_t * pPreserveAttachments;
+} VkSubpassDescription2;
+
+typedef struct VkSubpassDependency2 {
+ VkStructureType sType;
+ const void * pNext;
+ uint32_t srcSubpass;
+ uint32_t dstSubpass;
+ VkPipelineStageFlags srcStageMask;
+ VkPipelineStageFlags dstStageMask;
+ VkAccessFlags srcAccessMask;
+ VkAccessFlags dstAccessMask;
+ VkDependencyFlags dependencyFlags;
+ int32_t viewOffset;
+} VkSubpassDependency2;
+
+typedef struct VkRenderPassCreateInfo2 {
+ VkStructureType sType;
+ const void * pNext;
+ VkRenderPassCreateFlags flags;
+ uint32_t attachmentCount;
+ const VkAttachmentDescription2 * pAttachments;
+ uint32_t subpassCount;
+ const VkSubpassDescription2 * pSubpasses;
+ uint32_t dependencyCount;
+ const VkSubpassDependency2 * pDependencies;
+ uint32_t correlatedViewMaskCount;
+ const uint32_t * pCorrelatedViewMasks;
+} VkRenderPassCreateInfo2;
+
+typedef struct VkPhysicalDeviceTimelineSemaphoreFeatures {
+ VkStructureType sType;
+ void * pNext;
+ VkBool32 timelineSemaphore;
+} VkPhysicalDeviceTimelineSemaphoreFeatures;
+
+typedef struct VkSemaphoreWaitInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkSemaphoreWaitFlags flags;
+ uint32_t semaphoreCount;
+ const VkSemaphore * pSemaphores;
+ const uint64_t * pValues;
+} VkSemaphoreWaitInfo;
+
+typedef struct VkPhysicalDevice8BitStorageFeatures {
+ VkStructureType sType;
+ void * pNext;
+ VkBool32 storageBuffer8BitAccess;
+ VkBool32 uniformAndStorageBuffer8BitAccess;
+ VkBool32 storagePushConstant8;
+} VkPhysicalDevice8BitStorageFeatures;
+
+typedef struct VkPhysicalDeviceVulkanMemoryModelFeatures {
+ VkStructureType sType;
+ void * pNext;
+ VkBool32 vulkanMemoryModel;
+ VkBool32 vulkanMemoryModelDeviceScope;
+ VkBool32 vulkanMemoryModelAvailabilityVisibilityChains;
+} VkPhysicalDeviceVulkanMemoryModelFeatures;
+
+typedef struct VkPhysicalDeviceShaderAtomicInt64Features {
+ VkStructureType sType;
+ void * pNext;
+ VkBool32 shaderBufferInt64Atomics;
+ VkBool32 shaderSharedInt64Atomics;
+} VkPhysicalDeviceShaderAtomicInt64Features;
+
+typedef struct VkPhysicalDeviceDepthStencilResolveProperties {
+ VkStructureType sType;
+ void * pNext;
+ VkResolveModeFlags supportedDepthResolveModes;
+ VkResolveModeFlags supportedStencilResolveModes;
+ VkBool32 independentResolveNone;
+ VkBool32 independentResolve;
+} VkPhysicalDeviceDepthStencilResolveProperties;
+
+typedef struct VkSubpassDescriptionDepthStencilResolve {
+ VkStructureType sType;
+ const void * pNext;
+ VkResolveModeFlagBits depthResolveMode;
+ VkResolveModeFlagBits stencilResolveMode;
+ const VkAttachmentReference2 * pDepthStencilResolveAttachment;
+} VkSubpassDescriptionDepthStencilResolve;
+
+typedef struct VkImageStencilUsageCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkImageUsageFlags stencilUsage;
+} VkImageStencilUsageCreateInfo;
+
+typedef struct VkPhysicalDeviceScalarBlockLayoutFeatures {
+ VkStructureType sType;
+ void * pNext;
+ VkBool32 scalarBlockLayout;
+} VkPhysicalDeviceScalarBlockLayoutFeatures;
+
+typedef struct VkPhysicalDeviceUniformBufferStandardLayoutFeatures {
+ VkStructureType sType;
+ void * pNext;
+ VkBool32 uniformBufferStandardLayout;
+} VkPhysicalDeviceUniformBufferStandardLayoutFeatures;
+
+typedef struct VkPhysicalDeviceBufferDeviceAddressFeatures {
+ VkStructureType sType;
+ void * pNext;
+ VkBool32 bufferDeviceAddress;
+ VkBool32 bufferDeviceAddressCaptureReplay;
+ VkBool32 bufferDeviceAddressMultiDevice;
+} VkPhysicalDeviceBufferDeviceAddressFeatures;
+
+typedef struct VkPhysicalDeviceImagelessFramebufferFeatures {
+ VkStructureType sType;
+ void * pNext;
+ VkBool32 imagelessFramebuffer;
+} VkPhysicalDeviceImagelessFramebufferFeatures;
+
+typedef struct VkFramebufferAttachmentImageInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkImageCreateFlags flags;
+ VkImageUsageFlags usage;
+ uint32_t width;
+ uint32_t height;
+ uint32_t layerCount;
+ uint32_t viewFormatCount;
+ const VkFormat * pViewFormats;
+} VkFramebufferAttachmentImageInfo;
+
+typedef struct VkPhysicalDeviceTextureCompressionASTCHDRFeatures {
+ VkStructureType sType;
+ void * pNext;
+ VkBool32 textureCompressionASTC_HDR;
+} VkPhysicalDeviceTextureCompressionASTCHDRFeatures;
+
+typedef struct VkPipelineCreationFeedback {
+ VkPipelineCreationFeedbackFlags flags;
+ uint64_t duration;
+} VkPipelineCreationFeedback;
+
+typedef struct VkPipelineCreationFeedbackCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkPipelineCreationFeedback * pPipelineCreationFeedback;
+ uint32_t pipelineStageCreationFeedbackCount;
+ VkPipelineCreationFeedback * pPipelineStageCreationFeedbacks;
+} VkPipelineCreationFeedbackCreateInfo;
+
+typedef struct VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures {
+ VkStructureType sType;
+ void * pNext;
+ VkBool32 separateDepthStencilLayouts;
+} VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures;
+
+typedef struct VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures {
+ VkStructureType sType;
+ void * pNext;
+ VkBool32 shaderDemoteToHelperInvocation;
+} VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures;
+
+typedef struct VkPhysicalDeviceTexelBufferAlignmentProperties {
+ VkStructureType sType;
+ void * pNext;
+ VkDeviceSize storageTexelBufferOffsetAlignmentBytes;
+ VkBool32 storageTexelBufferOffsetSingleTexelAlignment;
+ VkDeviceSize uniformTexelBufferOffsetAlignmentBytes;
+ VkBool32 uniformTexelBufferOffsetSingleTexelAlignment;
+} VkPhysicalDeviceTexelBufferAlignmentProperties;
+
+typedef struct VkPhysicalDeviceSubgroupSizeControlFeatures {
+ VkStructureType sType;
+ void * pNext;
+ VkBool32 subgroupSizeControl;
+ VkBool32 computeFullSubgroups;
+} VkPhysicalDeviceSubgroupSizeControlFeatures;
+
+typedef struct VkPhysicalDeviceSubgroupSizeControlProperties {
+ VkStructureType sType;
+ void * pNext;
+ uint32_t minSubgroupSize;
+ uint32_t maxSubgroupSize;
+ uint32_t maxComputeWorkgroupSubgroups;
+ VkShaderStageFlags requiredSubgroupSizeStages;
+} VkPhysicalDeviceSubgroupSizeControlProperties;
+
+typedef struct VkPhysicalDevicePipelineCreationCacheControlFeatures {
+ VkStructureType sType;
+ void * pNext;
+ VkBool32 pipelineCreationCacheControl;
+} VkPhysicalDevicePipelineCreationCacheControlFeatures;
+
+typedef struct VkPhysicalDeviceVulkan11Features {
+ VkStructureType sType;
+ void * pNext;
+ VkBool32 storageBuffer16BitAccess;
+ VkBool32 uniformAndStorageBuffer16BitAccess;
+ VkBool32 storagePushConstant16;
+ VkBool32 storageInputOutput16;
+ VkBool32 multiview;
+ VkBool32 multiviewGeometryShader;
+ VkBool32 multiviewTessellationShader;
+ VkBool32 variablePointersStorageBuffer;
+ VkBool32 variablePointers;
+ VkBool32 protectedMemory;
+ VkBool32 samplerYcbcrConversion;
+ VkBool32 shaderDrawParameters;
+} VkPhysicalDeviceVulkan11Features;
+
+typedef struct VkPhysicalDeviceVulkan11Properties {
+ VkStructureType sType;
+ void * pNext;
+ uint8_t deviceUUID [ VK_UUID_SIZE ];
+ uint8_t driverUUID [ VK_UUID_SIZE ];
+ uint8_t deviceLUID [ VK_LUID_SIZE ];
+ uint32_t deviceNodeMask;
+ VkBool32 deviceLUIDValid;
+ uint32_t subgroupSize;
+ VkShaderStageFlags subgroupSupportedStages;
+ VkSubgroupFeatureFlags subgroupSupportedOperations;
+ VkBool32 subgroupQuadOperationsInAllStages;
+ VkPointClippingBehavior pointClippingBehavior;
+ uint32_t maxMultiviewViewCount;
+ uint32_t maxMultiviewInstanceIndex;
+ VkBool32 protectedNoFault;
+ uint32_t maxPerSetDescriptors;
+ VkDeviceSize maxMemoryAllocationSize;
+} VkPhysicalDeviceVulkan11Properties;
+
+typedef struct VkPhysicalDeviceVulkan12Features {
+ VkStructureType sType;
+ void * pNext;
+ VkBool32 samplerMirrorClampToEdge;
+ VkBool32 drawIndirectCount;
+ VkBool32 storageBuffer8BitAccess;
+ VkBool32 uniformAndStorageBuffer8BitAccess;
+ VkBool32 storagePushConstant8;
+ VkBool32 shaderBufferInt64Atomics;
+ VkBool32 shaderSharedInt64Atomics;
+ VkBool32 shaderFloat16;
+ VkBool32 shaderInt8;
+ VkBool32 descriptorIndexing;
+ VkBool32 shaderInputAttachmentArrayDynamicIndexing;
+ VkBool32 shaderUniformTexelBufferArrayDynamicIndexing;
+ VkBool32 shaderStorageTexelBufferArrayDynamicIndexing;
+ VkBool32 shaderUniformBufferArrayNonUniformIndexing;
+ VkBool32 shaderSampledImageArrayNonUniformIndexing;
+ VkBool32 shaderStorageBufferArrayNonUniformIndexing;
+ VkBool32 shaderStorageImageArrayNonUniformIndexing;
+ VkBool32 shaderInputAttachmentArrayNonUniformIndexing;
+ VkBool32 shaderUniformTexelBufferArrayNonUniformIndexing;
+ VkBool32 shaderStorageTexelBufferArrayNonUniformIndexing;
+ VkBool32 descriptorBindingUniformBufferUpdateAfterBind;
+ VkBool32 descriptorBindingSampledImageUpdateAfterBind;
+ VkBool32 descriptorBindingStorageImageUpdateAfterBind;
+ VkBool32 descriptorBindingStorageBufferUpdateAfterBind;
+ VkBool32 descriptorBindingUniformTexelBufferUpdateAfterBind;
+ VkBool32 descriptorBindingStorageTexelBufferUpdateAfterBind;
+ VkBool32 descriptorBindingUpdateUnusedWhilePending;
+ VkBool32 descriptorBindingPartiallyBound;
+ VkBool32 descriptorBindingVariableDescriptorCount;
+ VkBool32 runtimeDescriptorArray;
+ VkBool32 samplerFilterMinmax;
+ VkBool32 scalarBlockLayout;
+ VkBool32 imagelessFramebuffer;
+ VkBool32 uniformBufferStandardLayout;
+ VkBool32 shaderSubgroupExtendedTypes;
+ VkBool32 separateDepthStencilLayouts;
+ VkBool32 hostQueryReset;
+ VkBool32 timelineSemaphore;
+ VkBool32 bufferDeviceAddress;
+ VkBool32 bufferDeviceAddressCaptureReplay;
+ VkBool32 bufferDeviceAddressMultiDevice;
+ VkBool32 vulkanMemoryModel;
+ VkBool32 vulkanMemoryModelDeviceScope;
+ VkBool32 vulkanMemoryModelAvailabilityVisibilityChains;
+ VkBool32 shaderOutputViewportIndex;
+ VkBool32 shaderOutputLayer;
+ VkBool32 subgroupBroadcastDynamicId;
+} VkPhysicalDeviceVulkan12Features;
+
+typedef struct VkPhysicalDeviceVulkan12Properties {
+ VkStructureType sType;
+ void * pNext;
+ VkDriverId driverID;
+ char driverName [ VK_MAX_DRIVER_NAME_SIZE ];
+ char driverInfo [ VK_MAX_DRIVER_INFO_SIZE ];
+ VkConformanceVersion conformanceVersion;
+ VkShaderFloatControlsIndependence denormBehaviorIndependence;
+ VkShaderFloatControlsIndependence roundingModeIndependence;
+ VkBool32 shaderSignedZeroInfNanPreserveFloat16;
+ VkBool32 shaderSignedZeroInfNanPreserveFloat32;
+ VkBool32 shaderSignedZeroInfNanPreserveFloat64;
+ VkBool32 shaderDenormPreserveFloat16;
+ VkBool32 shaderDenormPreserveFloat32;
+ VkBool32 shaderDenormPreserveFloat64;
+ VkBool32 shaderDenormFlushToZeroFloat16;
+ VkBool32 shaderDenormFlushToZeroFloat32;
+ VkBool32 shaderDenormFlushToZeroFloat64;
+ VkBool32 shaderRoundingModeRTEFloat16;
+ VkBool32 shaderRoundingModeRTEFloat32;
+ VkBool32 shaderRoundingModeRTEFloat64;
+ VkBool32 shaderRoundingModeRTZFloat16;
+ VkBool32 shaderRoundingModeRTZFloat32;
+ VkBool32 shaderRoundingModeRTZFloat64;
+ uint32_t maxUpdateAfterBindDescriptorsInAllPools;
+ VkBool32 shaderUniformBufferArrayNonUniformIndexingNative;
+ VkBool32 shaderSampledImageArrayNonUniformIndexingNative;
+ VkBool32 shaderStorageBufferArrayNonUniformIndexingNative;
+ VkBool32 shaderStorageImageArrayNonUniformIndexingNative;
+ VkBool32 shaderInputAttachmentArrayNonUniformIndexingNative;
+ VkBool32 robustBufferAccessUpdateAfterBind;
+ VkBool32 quadDivergentImplicitLod;
+ uint32_t maxPerStageDescriptorUpdateAfterBindSamplers;
+ uint32_t maxPerStageDescriptorUpdateAfterBindUniformBuffers;
+ uint32_t maxPerStageDescriptorUpdateAfterBindStorageBuffers;
+ uint32_t maxPerStageDescriptorUpdateAfterBindSampledImages;
+ uint32_t maxPerStageDescriptorUpdateAfterBindStorageImages;
+ uint32_t maxPerStageDescriptorUpdateAfterBindInputAttachments;
+ uint32_t maxPerStageUpdateAfterBindResources;
+ uint32_t maxDescriptorSetUpdateAfterBindSamplers;
+ uint32_t maxDescriptorSetUpdateAfterBindUniformBuffers;
+ uint32_t maxDescriptorSetUpdateAfterBindUniformBuffersDynamic;
+ uint32_t maxDescriptorSetUpdateAfterBindStorageBuffers;
+ uint32_t maxDescriptorSetUpdateAfterBindStorageBuffersDynamic;
+ uint32_t maxDescriptorSetUpdateAfterBindSampledImages;
+ uint32_t maxDescriptorSetUpdateAfterBindStorageImages;
+ uint32_t maxDescriptorSetUpdateAfterBindInputAttachments;
+ VkResolveModeFlags supportedDepthResolveModes;
+ VkResolveModeFlags supportedStencilResolveModes;
+ VkBool32 independentResolveNone;
+ VkBool32 independentResolve;
+ VkBool32 filterMinmaxSingleComponentFormats;
+ VkBool32 filterMinmaxImageComponentMapping;
+ uint64_t maxTimelineSemaphoreValueDifference;
+ VkSampleCountFlags framebufferIntegerColorSampleCounts;
+} VkPhysicalDeviceVulkan12Properties;
+
+typedef struct VkPhysicalDeviceVulkan13Features {
+ VkStructureType sType;
+ void * pNext;
+ VkBool32 robustImageAccess;
+ VkBool32 inlineUniformBlock;
+ VkBool32 descriptorBindingInlineUniformBlockUpdateAfterBind;
+ VkBool32 pipelineCreationCacheControl;
+ VkBool32 privateData;
+ VkBool32 shaderDemoteToHelperInvocation;
+ VkBool32 shaderTerminateInvocation;
+ VkBool32 subgroupSizeControl;
+ VkBool32 computeFullSubgroups;
+ VkBool32 synchronization2;
+ VkBool32 textureCompressionASTC_HDR;
+ VkBool32 shaderZeroInitializeWorkgroupMemory;
+ VkBool32 dynamicRendering;
+ VkBool32 shaderIntegerDotProduct;
+ VkBool32 maintenance4;
+} VkPhysicalDeviceVulkan13Features;
+
+typedef struct VkPhysicalDeviceVulkan13Properties {
+ VkStructureType sType;
+ void * pNext;
+ uint32_t minSubgroupSize;
+ uint32_t maxSubgroupSize;
+ uint32_t maxComputeWorkgroupSubgroups;
+ VkShaderStageFlags requiredSubgroupSizeStages;
+ uint32_t maxInlineUniformBlockSize;
+ uint32_t maxPerStageDescriptorInlineUniformBlocks;
+ uint32_t maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks;
+ uint32_t maxDescriptorSetInlineUniformBlocks;
+ uint32_t maxDescriptorSetUpdateAfterBindInlineUniformBlocks;
+ uint32_t maxInlineUniformTotalSize;
+ VkBool32 integerDotProduct8BitUnsignedAccelerated;
+ VkBool32 integerDotProduct8BitSignedAccelerated;
+ VkBool32 integerDotProduct8BitMixedSignednessAccelerated;
+ VkBool32 integerDotProduct4x8BitPackedUnsignedAccelerated;
+ VkBool32 integerDotProduct4x8BitPackedSignedAccelerated;
+ VkBool32 integerDotProduct4x8BitPackedMixedSignednessAccelerated;
+ VkBool32 integerDotProduct16BitUnsignedAccelerated;
+ VkBool32 integerDotProduct16BitSignedAccelerated;
+ VkBool32 integerDotProduct16BitMixedSignednessAccelerated;
+ VkBool32 integerDotProduct32BitUnsignedAccelerated;
+ VkBool32 integerDotProduct32BitSignedAccelerated;
+ VkBool32 integerDotProduct32BitMixedSignednessAccelerated;
+ VkBool32 integerDotProduct64BitUnsignedAccelerated;
+ VkBool32 integerDotProduct64BitSignedAccelerated;
+ VkBool32 integerDotProduct64BitMixedSignednessAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating8BitUnsignedAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating8BitSignedAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating16BitUnsignedAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating16BitSignedAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating32BitUnsignedAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating32BitSignedAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating64BitUnsignedAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating64BitSignedAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated;
+ VkDeviceSize storageTexelBufferOffsetAlignmentBytes;
+ VkBool32 storageTexelBufferOffsetSingleTexelAlignment;
+ VkDeviceSize uniformTexelBufferOffsetAlignmentBytes;
+ VkBool32 uniformTexelBufferOffsetSingleTexelAlignment;
+ VkDeviceSize maxBufferSize;
+} VkPhysicalDeviceVulkan13Properties;
+
+typedef struct VkPhysicalDeviceToolProperties {
+ VkStructureType sType;
+ void * pNext;
+ char name [ VK_MAX_EXTENSION_NAME_SIZE ];
+ char version [ VK_MAX_EXTENSION_NAME_SIZE ];
+ VkToolPurposeFlags purposes;
+ char description [ VK_MAX_DESCRIPTION_SIZE ];
+ char layer [ VK_MAX_EXTENSION_NAME_SIZE ];
+} VkPhysicalDeviceToolProperties;
+
+typedef struct VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures {
+ VkStructureType sType;
+ void * pNext;
+ VkBool32 shaderZeroInitializeWorkgroupMemory;
+} VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures;
+
+typedef struct VkPhysicalDeviceImageRobustnessFeatures {
+ VkStructureType sType;
+ void * pNext;
+ VkBool32 robustImageAccess;
+} VkPhysicalDeviceImageRobustnessFeatures;
+
+typedef struct VkBufferCopy2 {
+ VkStructureType sType;
+ const void * pNext;
+ VkDeviceSize srcOffset;
+ VkDeviceSize dstOffset;
+ VkDeviceSize size;
+} VkBufferCopy2;
+
+typedef struct VkImageCopy2 {
+ VkStructureType sType;
+ const void * pNext;
+ VkImageSubresourceLayers srcSubresource;
+ VkOffset3D srcOffset;
+ VkImageSubresourceLayers dstSubresource;
+ VkOffset3D dstOffset;
+ VkExtent3D extent;
+} VkImageCopy2;
+
+typedef struct VkImageBlit2 {
+ VkStructureType sType;
+ const void * pNext;
+ VkImageSubresourceLayers srcSubresource;
+ VkOffset3D srcOffsets [2];
+ VkImageSubresourceLayers dstSubresource;
+ VkOffset3D dstOffsets [2];
+} VkImageBlit2;
+
+typedef struct VkBufferImageCopy2 {
+ VkStructureType sType;
+ const void * pNext;
+ VkDeviceSize bufferOffset;
+ uint32_t bufferRowLength;
+ uint32_t bufferImageHeight;
+ VkImageSubresourceLayers imageSubresource;
+ VkOffset3D imageOffset;
+ VkExtent3D imageExtent;
+} VkBufferImageCopy2;
+
+typedef struct VkImageResolve2 {
+ VkStructureType sType;
+ const void * pNext;
+ VkImageSubresourceLayers srcSubresource;
+ VkOffset3D srcOffset;
+ VkImageSubresourceLayers dstSubresource;
+ VkOffset3D dstOffset;
+ VkExtent3D extent;
+} VkImageResolve2;
+
+typedef struct VkCopyBufferInfo2 {
+ VkStructureType sType;
+ const void * pNext;
+ VkBuffer srcBuffer;
+ VkBuffer dstBuffer;
+ uint32_t regionCount;
+ const VkBufferCopy2 * pRegions;
+} VkCopyBufferInfo2;
+
+typedef struct VkCopyImageInfo2 {
+ VkStructureType sType;
+ const void * pNext;
+ VkImage srcImage;
+ VkImageLayout srcImageLayout;
+ VkImage dstImage;
+ VkImageLayout dstImageLayout;
+ uint32_t regionCount;
+ const VkImageCopy2 * pRegions;
+} VkCopyImageInfo2;
+
+typedef struct VkBlitImageInfo2 {
+ VkStructureType sType;
+ const void * pNext;
+ VkImage srcImage;
+ VkImageLayout srcImageLayout;
+ VkImage dstImage;
+ VkImageLayout dstImageLayout;
+ uint32_t regionCount;
+ const VkImageBlit2 * pRegions;
+ VkFilter filter;
+} VkBlitImageInfo2;
+
+typedef struct VkCopyBufferToImageInfo2 {
+ VkStructureType sType;
+ const void * pNext;
+ VkBuffer srcBuffer;
+ VkImage dstImage;
+ VkImageLayout dstImageLayout;
+ uint32_t regionCount;
+ const VkBufferImageCopy2 * pRegions;
+} VkCopyBufferToImageInfo2;
+
+typedef struct VkCopyImageToBufferInfo2 {
+ VkStructureType sType;
+ const void * pNext;
+ VkImage srcImage;
+ VkImageLayout srcImageLayout;
+ VkBuffer dstBuffer;
+ uint32_t regionCount;
+ const VkBufferImageCopy2 * pRegions;
+} VkCopyImageToBufferInfo2;
+
+typedef struct VkResolveImageInfo2 {
+ VkStructureType sType;
+ const void * pNext;
+ VkImage srcImage;
+ VkImageLayout srcImageLayout;
+ VkImage dstImage;
+ VkImageLayout dstImageLayout;
+ uint32_t regionCount;
+ const VkImageResolve2 * pRegions;
+} VkResolveImageInfo2;
+
+typedef struct VkPhysicalDeviceShaderTerminateInvocationFeatures {
+ VkStructureType sType;
+ void * pNext;
+ VkBool32 shaderTerminateInvocation;
+} VkPhysicalDeviceShaderTerminateInvocationFeatures;
+
+typedef struct VkMemoryBarrier2 {
+ VkStructureType sType;
+ const void * pNext;
+ VkPipelineStageFlags2 srcStageMask;
+ VkAccessFlags2 srcAccessMask;
+ VkPipelineStageFlags2 dstStageMask;
+ VkAccessFlags2 dstAccessMask;
+} VkMemoryBarrier2;
+
+typedef struct VkImageMemoryBarrier2 {
+ VkStructureType sType;
+ const void * pNext;
+ VkPipelineStageFlags2 srcStageMask;
+ VkAccessFlags2 srcAccessMask;
+ VkPipelineStageFlags2 dstStageMask;
+ VkAccessFlags2 dstAccessMask;
+ VkImageLayout oldLayout;
+ VkImageLayout newLayout;
+ uint32_t srcQueueFamilyIndex;
+ uint32_t dstQueueFamilyIndex;
+ VkImage image;
+ VkImageSubresourceRange subresourceRange;
+} VkImageMemoryBarrier2;
+
+typedef struct VkBufferMemoryBarrier2 {
+ VkStructureType sType;
+ const void * pNext;
+ VkPipelineStageFlags2 srcStageMask;
+ VkAccessFlags2 srcAccessMask;
+ VkPipelineStageFlags2 dstStageMask;
+ VkAccessFlags2 dstAccessMask;
+ uint32_t srcQueueFamilyIndex;
+ uint32_t dstQueueFamilyIndex;
+ VkBuffer buffer;
+ VkDeviceSize offset;
+ VkDeviceSize size;
+} VkBufferMemoryBarrier2;
+
+typedef struct VkDependencyInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkDependencyFlags dependencyFlags;
+ uint32_t memoryBarrierCount;
+ const VkMemoryBarrier2 * pMemoryBarriers;
+ uint32_t bufferMemoryBarrierCount;
+ const VkBufferMemoryBarrier2 * pBufferMemoryBarriers;
+ uint32_t imageMemoryBarrierCount;
+ const VkImageMemoryBarrier2 * pImageMemoryBarriers;
+} VkDependencyInfo;
+
+typedef struct VkSemaphoreSubmitInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkSemaphore semaphore;
+ uint64_t value;
+ VkPipelineStageFlags2 stageMask;
+ uint32_t deviceIndex;
+} VkSemaphoreSubmitInfo;
+
+typedef struct VkSubmitInfo2 {
+ VkStructureType sType;
+ const void * pNext;
+ VkSubmitFlags flags;
+ uint32_t waitSemaphoreInfoCount;
+ const VkSemaphoreSubmitInfo * pWaitSemaphoreInfos;
+ uint32_t commandBufferInfoCount;
+ const VkCommandBufferSubmitInfo * pCommandBufferInfos;
+ uint32_t signalSemaphoreInfoCount;
+ const VkSemaphoreSubmitInfo * pSignalSemaphoreInfos;
+} VkSubmitInfo2;
+
+typedef struct VkPhysicalDeviceSynchronization2Features {
+ VkStructureType sType;
+ void * pNext;
+ VkBool32 synchronization2;
+} VkPhysicalDeviceSynchronization2Features;
+
+typedef struct VkPhysicalDeviceShaderIntegerDotProductFeatures {
+ VkStructureType sType;
+ void * pNext;
+ VkBool32 shaderIntegerDotProduct;
+} VkPhysicalDeviceShaderIntegerDotProductFeatures;
+
+typedef struct VkPhysicalDeviceShaderIntegerDotProductProperties {
+ VkStructureType sType;
+ void * pNext;
+ VkBool32 integerDotProduct8BitUnsignedAccelerated;
+ VkBool32 integerDotProduct8BitSignedAccelerated;
+ VkBool32 integerDotProduct8BitMixedSignednessAccelerated;
+ VkBool32 integerDotProduct4x8BitPackedUnsignedAccelerated;
+ VkBool32 integerDotProduct4x8BitPackedSignedAccelerated;
+ VkBool32 integerDotProduct4x8BitPackedMixedSignednessAccelerated;
+ VkBool32 integerDotProduct16BitUnsignedAccelerated;
+ VkBool32 integerDotProduct16BitSignedAccelerated;
+ VkBool32 integerDotProduct16BitMixedSignednessAccelerated;
+ VkBool32 integerDotProduct32BitUnsignedAccelerated;
+ VkBool32 integerDotProduct32BitSignedAccelerated;
+ VkBool32 integerDotProduct32BitMixedSignednessAccelerated;
+ VkBool32 integerDotProduct64BitUnsignedAccelerated;
+ VkBool32 integerDotProduct64BitSignedAccelerated;
+ VkBool32 integerDotProduct64BitMixedSignednessAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating8BitUnsignedAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating8BitSignedAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating16BitUnsignedAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating16BitSignedAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating32BitUnsignedAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating32BitSignedAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating64BitUnsignedAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating64BitSignedAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated;
+} VkPhysicalDeviceShaderIntegerDotProductProperties;
+
+typedef struct VkFormatProperties3 {
+ VkStructureType sType;
+ void * pNext;
+ VkFormatFeatureFlags2 linearTilingFeatures;
+ VkFormatFeatureFlags2 optimalTilingFeatures;
+ VkFormatFeatureFlags2 bufferFeatures;
+} VkFormatProperties3;
+
+typedef struct VkRenderingInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkRenderingFlags flags;
+ VkRect2D renderArea;
+ uint32_t layerCount;
+ uint32_t viewMask;
+ uint32_t colorAttachmentCount;
+ const VkRenderingAttachmentInfo * pColorAttachments;
+ const VkRenderingAttachmentInfo * pDepthAttachment;
+ const VkRenderingAttachmentInfo * pStencilAttachment;
+} VkRenderingInfo;
+
+typedef struct VkPhysicalDeviceDynamicRenderingFeatures {
+ VkStructureType sType;
+ void * pNext;
+ VkBool32 dynamicRendering;
+} VkPhysicalDeviceDynamicRenderingFeatures;
+
+typedef struct VkCommandBufferInheritanceRenderingInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkRenderingFlags flags;
+ uint32_t viewMask;
+ uint32_t colorAttachmentCount;
+ const VkFormat * pColorAttachmentFormats;
+ VkFormat depthAttachmentFormat;
+ VkFormat stencilAttachmentFormat;
+ VkSampleCountFlagBits rasterizationSamples;
+} VkCommandBufferInheritanceRenderingInfo;
+
+typedef struct VkPhysicalDeviceProperties {
+ uint32_t apiVersion;
+ uint32_t driverVersion;
+ uint32_t vendorID;
+ uint32_t deviceID;
+ VkPhysicalDeviceType deviceType;
+ char deviceName [ VK_MAX_PHYSICAL_DEVICE_NAME_SIZE ];
+ uint8_t pipelineCacheUUID [ VK_UUID_SIZE ];
+ VkPhysicalDeviceLimits limits;
+ VkPhysicalDeviceSparseProperties sparseProperties;
+} VkPhysicalDeviceProperties;
+
+typedef struct VkDeviceCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ VkDeviceCreateFlags flags;
+ uint32_t queueCreateInfoCount;
+ const VkDeviceQueueCreateInfo * pQueueCreateInfos;
+ uint32_t enabledLayerCount;
+ const char * const* ppEnabledLayerNames;
+ uint32_t enabledExtensionCount;
+ const char * const* ppEnabledExtensionNames;
+ const VkPhysicalDeviceFeatures * pEnabledFeatures;
+} VkDeviceCreateInfo;
+
+typedef struct VkPhysicalDeviceMemoryProperties {
+ uint32_t memoryTypeCount;
+ VkMemoryType memoryTypes [ VK_MAX_MEMORY_TYPES ];
+ uint32_t memoryHeapCount;
+ VkMemoryHeap memoryHeaps [ VK_MAX_MEMORY_HEAPS ];
+} VkPhysicalDeviceMemoryProperties;
+
+typedef struct VkPhysicalDeviceProperties2 {
+ VkStructureType sType;
+ void * pNext;
+ VkPhysicalDeviceProperties properties;
+} VkPhysicalDeviceProperties2;
+
+typedef struct VkPhysicalDeviceMemoryProperties2 {
+ VkStructureType sType;
+ void * pNext;
+ VkPhysicalDeviceMemoryProperties memoryProperties;
+} VkPhysicalDeviceMemoryProperties2;
+
+typedef struct VkFramebufferAttachmentsCreateInfo {
+ VkStructureType sType;
+ const void * pNext;
+ uint32_t attachmentImageInfoCount;
+ const VkFramebufferAttachmentImageInfo * pAttachmentImageInfos;
+} VkFramebufferAttachmentsCreateInfo;
+
+
+
+#define VK_VERSION_1_0 1
+GLAD_API_CALL int GLAD_VK_VERSION_1_0;
+#define VK_VERSION_1_1 1
+GLAD_API_CALL int GLAD_VK_VERSION_1_1;
+#define VK_VERSION_1_2 1
+GLAD_API_CALL int GLAD_VK_VERSION_1_2;
+#define VK_VERSION_1_3 1
+GLAD_API_CALL int GLAD_VK_VERSION_1_3;
+#define VK_EXT_debug_report 1
+GLAD_API_CALL int GLAD_VK_EXT_debug_report;
+#define VK_KHR_portability_enumeration 1
+GLAD_API_CALL int GLAD_VK_KHR_portability_enumeration;
+#define VK_KHR_surface 1
+GLAD_API_CALL int GLAD_VK_KHR_surface;
+#define VK_KHR_swapchain 1
+GLAD_API_CALL int GLAD_VK_KHR_swapchain;
+
+
+typedef VkResult (GLAD_API_PTR *PFN_vkAcquireNextImage2KHR)(VkDevice device, const VkAcquireNextImageInfoKHR * pAcquireInfo, uint32_t * pImageIndex);
+typedef VkResult (GLAD_API_PTR *PFN_vkAcquireNextImageKHR)(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, VkFence fence, uint32_t * pImageIndex);
+typedef VkResult (GLAD_API_PTR *PFN_vkAllocateCommandBuffers)(VkDevice device, const VkCommandBufferAllocateInfo * pAllocateInfo, VkCommandBuffer * pCommandBuffers);
+typedef VkResult (GLAD_API_PTR *PFN_vkAllocateDescriptorSets)(VkDevice device, const VkDescriptorSetAllocateInfo * pAllocateInfo, VkDescriptorSet * pDescriptorSets);
+typedef VkResult (GLAD_API_PTR *PFN_vkAllocateMemory)(VkDevice device, const VkMemoryAllocateInfo * pAllocateInfo, const VkAllocationCallbacks * pAllocator, VkDeviceMemory * pMemory);
+typedef VkResult (GLAD_API_PTR *PFN_vkBeginCommandBuffer)(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo * pBeginInfo);
+typedef VkResult (GLAD_API_PTR *PFN_vkBindBufferMemory)(VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset);
+typedef VkResult (GLAD_API_PTR *PFN_vkBindBufferMemory2)(VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo * pBindInfos);
+typedef VkResult (GLAD_API_PTR *PFN_vkBindImageMemory)(VkDevice device, VkImage image, VkDeviceMemory memory, VkDeviceSize memoryOffset);
+typedef VkResult (GLAD_API_PTR *PFN_vkBindImageMemory2)(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo * pBindInfos);
+typedef void (GLAD_API_PTR *PFN_vkCmdBeginQuery)(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags);
+typedef void (GLAD_API_PTR *PFN_vkCmdBeginRenderPass)(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo * pRenderPassBegin, VkSubpassContents contents);
+typedef void (GLAD_API_PTR *PFN_vkCmdBeginRenderPass2)(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo * pRenderPassBegin, const VkSubpassBeginInfo * pSubpassBeginInfo);
+typedef void (GLAD_API_PTR *PFN_vkCmdBeginRendering)(VkCommandBuffer commandBuffer, const VkRenderingInfo * pRenderingInfo);
+typedef void (GLAD_API_PTR *PFN_vkCmdBindDescriptorSets)(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t descriptorSetCount, const VkDescriptorSet * pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t * pDynamicOffsets);
+typedef void (GLAD_API_PTR *PFN_vkCmdBindIndexBuffer)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType);
+typedef void (GLAD_API_PTR *PFN_vkCmdBindPipeline)(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline);
+typedef void (GLAD_API_PTR *PFN_vkCmdBindVertexBuffers)(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer * pBuffers, const VkDeviceSize * pOffsets);
+typedef void (GLAD_API_PTR *PFN_vkCmdBindVertexBuffers2)(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer * pBuffers, const VkDeviceSize * pOffsets, const VkDeviceSize * pSizes, const VkDeviceSize * pStrides);
+typedef void (GLAD_API_PTR *PFN_vkCmdBlitImage)(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageBlit * pRegions, VkFilter filter);
+typedef void (GLAD_API_PTR *PFN_vkCmdBlitImage2)(VkCommandBuffer commandBuffer, const VkBlitImageInfo2 * pBlitImageInfo);
+typedef void (GLAD_API_PTR *PFN_vkCmdClearAttachments)(VkCommandBuffer commandBuffer, uint32_t attachmentCount, const VkClearAttachment * pAttachments, uint32_t rectCount, const VkClearRect * pRects);
+typedef void (GLAD_API_PTR *PFN_vkCmdClearColorImage)(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue * pColor, uint32_t rangeCount, const VkImageSubresourceRange * pRanges);
+typedef void (GLAD_API_PTR *PFN_vkCmdClearDepthStencilImage)(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearDepthStencilValue * pDepthStencil, uint32_t rangeCount, const VkImageSubresourceRange * pRanges);
+typedef void (GLAD_API_PTR *PFN_vkCmdCopyBuffer)(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferCopy * pRegions);
+typedef void (GLAD_API_PTR *PFN_vkCmdCopyBuffer2)(VkCommandBuffer commandBuffer, const VkCopyBufferInfo2 * pCopyBufferInfo);
+typedef void (GLAD_API_PTR *PFN_vkCmdCopyBufferToImage)(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkBufferImageCopy * pRegions);
+typedef void (GLAD_API_PTR *PFN_vkCmdCopyBufferToImage2)(VkCommandBuffer commandBuffer, const VkCopyBufferToImageInfo2 * pCopyBufferToImageInfo);
+typedef void (GLAD_API_PTR *PFN_vkCmdCopyImage)(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageCopy * pRegions);
+typedef void (GLAD_API_PTR *PFN_vkCmdCopyImage2)(VkCommandBuffer commandBuffer, const VkCopyImageInfo2 * pCopyImageInfo);
+typedef void (GLAD_API_PTR *PFN_vkCmdCopyImageToBuffer)(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferImageCopy * pRegions);
+typedef void (GLAD_API_PTR *PFN_vkCmdCopyImageToBuffer2)(VkCommandBuffer commandBuffer, const VkCopyImageToBufferInfo2 * pCopyImageToBufferInfo);
+typedef void (GLAD_API_PTR *PFN_vkCmdCopyQueryPoolResults)(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize stride, VkQueryResultFlags flags);
+typedef void (GLAD_API_PTR *PFN_vkCmdDispatch)(VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ);
+typedef void (GLAD_API_PTR *PFN_vkCmdDispatchBase)(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ);
+typedef void (GLAD_API_PTR *PFN_vkCmdDispatchIndirect)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset);
+typedef void (GLAD_API_PTR *PFN_vkCmdDraw)(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance);
+typedef void (GLAD_API_PTR *PFN_vkCmdDrawIndexed)(VkCommandBuffer commandBuffer, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance);
+typedef void (GLAD_API_PTR *PFN_vkCmdDrawIndexedIndirect)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride);
+typedef void (GLAD_API_PTR *PFN_vkCmdDrawIndexedIndirectCount)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride);
+typedef void (GLAD_API_PTR *PFN_vkCmdDrawIndirect)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride);
+typedef void (GLAD_API_PTR *PFN_vkCmdDrawIndirectCount)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride);
+typedef void (GLAD_API_PTR *PFN_vkCmdEndQuery)(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query);
+typedef void (GLAD_API_PTR *PFN_vkCmdEndRenderPass)(VkCommandBuffer commandBuffer);
+typedef void (GLAD_API_PTR *PFN_vkCmdEndRenderPass2)(VkCommandBuffer commandBuffer, const VkSubpassEndInfo * pSubpassEndInfo);
+typedef void (GLAD_API_PTR *PFN_vkCmdEndRendering)(VkCommandBuffer commandBuffer);
+typedef void (GLAD_API_PTR *PFN_vkCmdExecuteCommands)(VkCommandBuffer commandBuffer, uint32_t commandBufferCount, const VkCommandBuffer * pCommandBuffers);
+typedef void (GLAD_API_PTR *PFN_vkCmdFillBuffer)(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data);
+typedef void (GLAD_API_PTR *PFN_vkCmdNextSubpass)(VkCommandBuffer commandBuffer, VkSubpassContents contents);
+typedef void (GLAD_API_PTR *PFN_vkCmdNextSubpass2)(VkCommandBuffer commandBuffer, const VkSubpassBeginInfo * pSubpassBeginInfo, const VkSubpassEndInfo * pSubpassEndInfo);
+typedef void (GLAD_API_PTR *PFN_vkCmdPipelineBarrier)(VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, uint32_t memoryBarrierCount, const VkMemoryBarrier * pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier * pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier * pImageMemoryBarriers);
+typedef void (GLAD_API_PTR *PFN_vkCmdPipelineBarrier2)(VkCommandBuffer commandBuffer, const VkDependencyInfo * pDependencyInfo);
+typedef void (GLAD_API_PTR *PFN_vkCmdPushConstants)(VkCommandBuffer commandBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, uint32_t offset, uint32_t size, const void * pValues);
+typedef void (GLAD_API_PTR *PFN_vkCmdResetEvent)(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask);
+typedef void (GLAD_API_PTR *PFN_vkCmdResetEvent2)(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags2 stageMask);
+typedef void (GLAD_API_PTR *PFN_vkCmdResetQueryPool)(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount);
+typedef void (GLAD_API_PTR *PFN_vkCmdResolveImage)(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageResolve * pRegions);
+typedef void (GLAD_API_PTR *PFN_vkCmdResolveImage2)(VkCommandBuffer commandBuffer, const VkResolveImageInfo2 * pResolveImageInfo);
+typedef void (GLAD_API_PTR *PFN_vkCmdSetBlendConstants)(VkCommandBuffer commandBuffer, const float blendConstants [4]);
+typedef void (GLAD_API_PTR *PFN_vkCmdSetCullMode)(VkCommandBuffer commandBuffer, VkCullModeFlags cullMode);
+typedef void (GLAD_API_PTR *PFN_vkCmdSetDepthBias)(VkCommandBuffer commandBuffer, float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor);
+typedef void (GLAD_API_PTR *PFN_vkCmdSetDepthBiasEnable)(VkCommandBuffer commandBuffer, VkBool32 depthBiasEnable);
+typedef void (GLAD_API_PTR *PFN_vkCmdSetDepthBounds)(VkCommandBuffer commandBuffer, float minDepthBounds, float maxDepthBounds);
+typedef void (GLAD_API_PTR *PFN_vkCmdSetDepthBoundsTestEnable)(VkCommandBuffer commandBuffer, VkBool32 depthBoundsTestEnable);
+typedef void (GLAD_API_PTR *PFN_vkCmdSetDepthCompareOp)(VkCommandBuffer commandBuffer, VkCompareOp depthCompareOp);
+typedef void (GLAD_API_PTR *PFN_vkCmdSetDepthTestEnable)(VkCommandBuffer commandBuffer, VkBool32 depthTestEnable);
+typedef void (GLAD_API_PTR *PFN_vkCmdSetDepthWriteEnable)(VkCommandBuffer commandBuffer, VkBool32 depthWriteEnable);
+typedef void (GLAD_API_PTR *PFN_vkCmdSetDeviceMask)(VkCommandBuffer commandBuffer, uint32_t deviceMask);
+typedef void (GLAD_API_PTR *PFN_vkCmdSetEvent)(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask);
+typedef void (GLAD_API_PTR *PFN_vkCmdSetEvent2)(VkCommandBuffer commandBuffer, VkEvent event, const VkDependencyInfo * pDependencyInfo);
+typedef void (GLAD_API_PTR *PFN_vkCmdSetFrontFace)(VkCommandBuffer commandBuffer, VkFrontFace frontFace);
+typedef void (GLAD_API_PTR *PFN_vkCmdSetLineWidth)(VkCommandBuffer commandBuffer, float lineWidth);
+typedef void (GLAD_API_PTR *PFN_vkCmdSetPrimitiveRestartEnable)(VkCommandBuffer commandBuffer, VkBool32 primitiveRestartEnable);
+typedef void (GLAD_API_PTR *PFN_vkCmdSetPrimitiveTopology)(VkCommandBuffer commandBuffer, VkPrimitiveTopology primitiveTopology);
+typedef void (GLAD_API_PTR *PFN_vkCmdSetRasterizerDiscardEnable)(VkCommandBuffer commandBuffer, VkBool32 rasterizerDiscardEnable);
+typedef void (GLAD_API_PTR *PFN_vkCmdSetScissor)(VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount, const VkRect2D * pScissors);
+typedef void (GLAD_API_PTR *PFN_vkCmdSetScissorWithCount)(VkCommandBuffer commandBuffer, uint32_t scissorCount, const VkRect2D * pScissors);
+typedef void (GLAD_API_PTR *PFN_vkCmdSetStencilCompareMask)(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t compareMask);
+typedef void (GLAD_API_PTR *PFN_vkCmdSetStencilOp)(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, VkStencilOp failOp, VkStencilOp passOp, VkStencilOp depthFailOp, VkCompareOp compareOp);
+typedef void (GLAD_API_PTR *PFN_vkCmdSetStencilReference)(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t reference);
+typedef void (GLAD_API_PTR *PFN_vkCmdSetStencilTestEnable)(VkCommandBuffer commandBuffer, VkBool32 stencilTestEnable);
+typedef void (GLAD_API_PTR *PFN_vkCmdSetStencilWriteMask)(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t writeMask);
+typedef void (GLAD_API_PTR *PFN_vkCmdSetViewport)(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewport * pViewports);
+typedef void (GLAD_API_PTR *PFN_vkCmdSetViewportWithCount)(VkCommandBuffer commandBuffer, uint32_t viewportCount, const VkViewport * pViewports);
+typedef void (GLAD_API_PTR *PFN_vkCmdUpdateBuffer)(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize dataSize, const void * pData);
+typedef void (GLAD_API_PTR *PFN_vkCmdWaitEvents)(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent * pEvents, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, uint32_t memoryBarrierCount, const VkMemoryBarrier * pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier * pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier * pImageMemoryBarriers);
+typedef void (GLAD_API_PTR *PFN_vkCmdWaitEvents2)(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent * pEvents, const VkDependencyInfo * pDependencyInfos);
+typedef void (GLAD_API_PTR *PFN_vkCmdWriteTimestamp)(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, uint32_t query);
+typedef void (GLAD_API_PTR *PFN_vkCmdWriteTimestamp2)(VkCommandBuffer commandBuffer, VkPipelineStageFlags2 stage, VkQueryPool queryPool, uint32_t query);
+typedef VkResult (GLAD_API_PTR *PFN_vkCreateBuffer)(VkDevice device, const VkBufferCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkBuffer * pBuffer);
+typedef VkResult (GLAD_API_PTR *PFN_vkCreateBufferView)(VkDevice device, const VkBufferViewCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkBufferView * pView);
+typedef VkResult (GLAD_API_PTR *PFN_vkCreateCommandPool)(VkDevice device, const VkCommandPoolCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkCommandPool * pCommandPool);
+typedef VkResult (GLAD_API_PTR *PFN_vkCreateComputePipelines)(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkComputePipelineCreateInfo * pCreateInfos, const VkAllocationCallbacks * pAllocator, VkPipeline * pPipelines);
+typedef VkResult (GLAD_API_PTR *PFN_vkCreateDebugReportCallbackEXT)(VkInstance instance, const VkDebugReportCallbackCreateInfoEXT * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkDebugReportCallbackEXT * pCallback);
+typedef VkResult (GLAD_API_PTR *PFN_vkCreateDescriptorPool)(VkDevice device, const VkDescriptorPoolCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkDescriptorPool * pDescriptorPool);
+typedef VkResult (GLAD_API_PTR *PFN_vkCreateDescriptorSetLayout)(VkDevice device, const VkDescriptorSetLayoutCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkDescriptorSetLayout * pSetLayout);
+typedef VkResult (GLAD_API_PTR *PFN_vkCreateDescriptorUpdateTemplate)(VkDevice device, const VkDescriptorUpdateTemplateCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkDescriptorUpdateTemplate * pDescriptorUpdateTemplate);
+typedef VkResult (GLAD_API_PTR *PFN_vkCreateDevice)(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkDevice * pDevice);
+typedef VkResult (GLAD_API_PTR *PFN_vkCreateEvent)(VkDevice device, const VkEventCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkEvent * pEvent);
+typedef VkResult (GLAD_API_PTR *PFN_vkCreateFence)(VkDevice device, const VkFenceCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkFence * pFence);
+typedef VkResult (GLAD_API_PTR *PFN_vkCreateFramebuffer)(VkDevice device, const VkFramebufferCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkFramebuffer * pFramebuffer);
+typedef VkResult (GLAD_API_PTR *PFN_vkCreateGraphicsPipelines)(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkGraphicsPipelineCreateInfo * pCreateInfos, const VkAllocationCallbacks * pAllocator, VkPipeline * pPipelines);
+typedef VkResult (GLAD_API_PTR *PFN_vkCreateImage)(VkDevice device, const VkImageCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkImage * pImage);
+typedef VkResult (GLAD_API_PTR *PFN_vkCreateImageView)(VkDevice device, const VkImageViewCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkImageView * pView);
+typedef VkResult (GLAD_API_PTR *PFN_vkCreateInstance)(const VkInstanceCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkInstance * pInstance);
+typedef VkResult (GLAD_API_PTR *PFN_vkCreatePipelineCache)(VkDevice device, const VkPipelineCacheCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkPipelineCache * pPipelineCache);
+typedef VkResult (GLAD_API_PTR *PFN_vkCreatePipelineLayout)(VkDevice device, const VkPipelineLayoutCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkPipelineLayout * pPipelineLayout);
+typedef VkResult (GLAD_API_PTR *PFN_vkCreatePrivateDataSlot)(VkDevice device, const VkPrivateDataSlotCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkPrivateDataSlot * pPrivateDataSlot);
+typedef VkResult (GLAD_API_PTR *PFN_vkCreateQueryPool)(VkDevice device, const VkQueryPoolCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkQueryPool * pQueryPool);
+typedef VkResult (GLAD_API_PTR *PFN_vkCreateRenderPass)(VkDevice device, const VkRenderPassCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkRenderPass * pRenderPass);
+typedef VkResult (GLAD_API_PTR *PFN_vkCreateRenderPass2)(VkDevice device, const VkRenderPassCreateInfo2 * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkRenderPass * pRenderPass);
+typedef VkResult (GLAD_API_PTR *PFN_vkCreateSampler)(VkDevice device, const VkSamplerCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkSampler * pSampler);
+typedef VkResult (GLAD_API_PTR *PFN_vkCreateSamplerYcbcrConversion)(VkDevice device, const VkSamplerYcbcrConversionCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkSamplerYcbcrConversion * pYcbcrConversion);
+typedef VkResult (GLAD_API_PTR *PFN_vkCreateSemaphore)(VkDevice device, const VkSemaphoreCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkSemaphore * pSemaphore);
+typedef VkResult (GLAD_API_PTR *PFN_vkCreateShaderModule)(VkDevice device, const VkShaderModuleCreateInfo * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkShaderModule * pShaderModule);
+typedef VkResult (GLAD_API_PTR *PFN_vkCreateSwapchainKHR)(VkDevice device, const VkSwapchainCreateInfoKHR * pCreateInfo, const VkAllocationCallbacks * pAllocator, VkSwapchainKHR * pSwapchain);
+typedef void (GLAD_API_PTR *PFN_vkDebugReportMessageEXT)(VkInstance instance, VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const char * pLayerPrefix, const char * pMessage);
+typedef void (GLAD_API_PTR *PFN_vkDestroyBuffer)(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks * pAllocator);
+typedef void (GLAD_API_PTR *PFN_vkDestroyBufferView)(VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks * pAllocator);
+typedef void (GLAD_API_PTR *PFN_vkDestroyCommandPool)(VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks * pAllocator);
+typedef void (GLAD_API_PTR *PFN_vkDestroyDebugReportCallbackEXT)(VkInstance instance, VkDebugReportCallbackEXT callback, const VkAllocationCallbacks * pAllocator);
+typedef void (GLAD_API_PTR *PFN_vkDestroyDescriptorPool)(VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks * pAllocator);
+typedef void (GLAD_API_PTR *PFN_vkDestroyDescriptorSetLayout)(VkDevice device, VkDescriptorSetLayout descriptorSetLayout, const VkAllocationCallbacks * pAllocator);
+typedef void (GLAD_API_PTR *PFN_vkDestroyDescriptorUpdateTemplate)(VkDevice device, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const VkAllocationCallbacks * pAllocator);
+typedef void (GLAD_API_PTR *PFN_vkDestroyDevice)(VkDevice device, const VkAllocationCallbacks * pAllocator);
+typedef void (GLAD_API_PTR *PFN_vkDestroyEvent)(VkDevice device, VkEvent event, const VkAllocationCallbacks * pAllocator);
+typedef void (GLAD_API_PTR *PFN_vkDestroyFence)(VkDevice device, VkFence fence, const VkAllocationCallbacks * pAllocator);
+typedef void (GLAD_API_PTR *PFN_vkDestroyFramebuffer)(VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks * pAllocator);
+typedef void (GLAD_API_PTR *PFN_vkDestroyImage)(VkDevice device, VkImage image, const VkAllocationCallbacks * pAllocator);
+typedef void (GLAD_API_PTR *PFN_vkDestroyImageView)(VkDevice device, VkImageView imageView, const VkAllocationCallbacks * pAllocator);
+typedef void (GLAD_API_PTR *PFN_vkDestroyInstance)(VkInstance instance, const VkAllocationCallbacks * pAllocator);
+typedef void (GLAD_API_PTR *PFN_vkDestroyPipeline)(VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks * pAllocator);
+typedef void (GLAD_API_PTR *PFN_vkDestroyPipelineCache)(VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks * pAllocator);
+typedef void (GLAD_API_PTR *PFN_vkDestroyPipelineLayout)(VkDevice device, VkPipelineLayout pipelineLayout, const VkAllocationCallbacks * pAllocator);
+typedef void (GLAD_API_PTR *PFN_vkDestroyPrivateDataSlot)(VkDevice device, VkPrivateDataSlot privateDataSlot, const VkAllocationCallbacks * pAllocator);
+typedef void (GLAD_API_PTR *PFN_vkDestroyQueryPool)(VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks * pAllocator);
+typedef void (GLAD_API_PTR *PFN_vkDestroyRenderPass)(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks * pAllocator);
+typedef void (GLAD_API_PTR *PFN_vkDestroySampler)(VkDevice device, VkSampler sampler, const VkAllocationCallbacks * pAllocator);
+typedef void (GLAD_API_PTR *PFN_vkDestroySamplerYcbcrConversion)(VkDevice device, VkSamplerYcbcrConversion ycbcrConversion, const VkAllocationCallbacks * pAllocator);
+typedef void (GLAD_API_PTR *PFN_vkDestroySemaphore)(VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks * pAllocator);
+typedef void (GLAD_API_PTR *PFN_vkDestroyShaderModule)(VkDevice device, VkShaderModule shaderModule, const VkAllocationCallbacks * pAllocator);
+typedef void (GLAD_API_PTR *PFN_vkDestroySurfaceKHR)(VkInstance instance, VkSurfaceKHR surface, const VkAllocationCallbacks * pAllocator);
+typedef void (GLAD_API_PTR *PFN_vkDestroySwapchainKHR)(VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks * pAllocator);
+typedef VkResult (GLAD_API_PTR *PFN_vkDeviceWaitIdle)(VkDevice device);
+typedef VkResult (GLAD_API_PTR *PFN_vkEndCommandBuffer)(VkCommandBuffer commandBuffer);
+typedef VkResult (GLAD_API_PTR *PFN_vkEnumerateDeviceExtensionProperties)(VkPhysicalDevice physicalDevice, const char * pLayerName, uint32_t * pPropertyCount, VkExtensionProperties * pProperties);
+typedef VkResult (GLAD_API_PTR *PFN_vkEnumerateDeviceLayerProperties)(VkPhysicalDevice physicalDevice, uint32_t * pPropertyCount, VkLayerProperties * pProperties);
+typedef VkResult (GLAD_API_PTR *PFN_vkEnumerateInstanceExtensionProperties)(const char * pLayerName, uint32_t * pPropertyCount, VkExtensionProperties * pProperties);
+typedef VkResult (GLAD_API_PTR *PFN_vkEnumerateInstanceLayerProperties)(uint32_t * pPropertyCount, VkLayerProperties * pProperties);
+typedef VkResult (GLAD_API_PTR *PFN_vkEnumerateInstanceVersion)(uint32_t * pApiVersion);
+typedef VkResult (GLAD_API_PTR *PFN_vkEnumeratePhysicalDeviceGroups)(VkInstance instance, uint32_t * pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties * pPhysicalDeviceGroupProperties);
+typedef VkResult (GLAD_API_PTR *PFN_vkEnumeratePhysicalDevices)(VkInstance instance, uint32_t * pPhysicalDeviceCount, VkPhysicalDevice * pPhysicalDevices);
+typedef VkResult (GLAD_API_PTR *PFN_vkFlushMappedMemoryRanges)(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange * pMemoryRanges);
+typedef void (GLAD_API_PTR *PFN_vkFreeCommandBuffers)(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount, const VkCommandBuffer * pCommandBuffers);
+typedef VkResult (GLAD_API_PTR *PFN_vkFreeDescriptorSets)(VkDevice device, VkDescriptorPool descriptorPool, uint32_t descriptorSetCount, const VkDescriptorSet * pDescriptorSets);
+typedef void (GLAD_API_PTR *PFN_vkFreeMemory)(VkDevice device, VkDeviceMemory memory, const VkAllocationCallbacks * pAllocator);
+typedef VkDeviceAddress (GLAD_API_PTR *PFN_vkGetBufferDeviceAddress)(VkDevice device, const VkBufferDeviceAddressInfo * pInfo);
+typedef void (GLAD_API_PTR *PFN_vkGetBufferMemoryRequirements)(VkDevice device, VkBuffer buffer, VkMemoryRequirements * pMemoryRequirements);
+typedef void (GLAD_API_PTR *PFN_vkGetBufferMemoryRequirements2)(VkDevice device, const VkBufferMemoryRequirementsInfo2 * pInfo, VkMemoryRequirements2 * pMemoryRequirements);
+typedef uint64_t (GLAD_API_PTR *PFN_vkGetBufferOpaqueCaptureAddress)(VkDevice device, const VkBufferDeviceAddressInfo * pInfo);
+typedef void (GLAD_API_PTR *PFN_vkGetDescriptorSetLayoutSupport)(VkDevice device, const VkDescriptorSetLayoutCreateInfo * pCreateInfo, VkDescriptorSetLayoutSupport * pSupport);
+typedef void (GLAD_API_PTR *PFN_vkGetDeviceBufferMemoryRequirements)(VkDevice device, const VkDeviceBufferMemoryRequirements * pInfo, VkMemoryRequirements2 * pMemoryRequirements);
+typedef void (GLAD_API_PTR *PFN_vkGetDeviceGroupPeerMemoryFeatures)(VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, VkPeerMemoryFeatureFlags * pPeerMemoryFeatures);
+typedef VkResult (GLAD_API_PTR *PFN_vkGetDeviceGroupPresentCapabilitiesKHR)(VkDevice device, VkDeviceGroupPresentCapabilitiesKHR * pDeviceGroupPresentCapabilities);
+typedef VkResult (GLAD_API_PTR *PFN_vkGetDeviceGroupSurfacePresentModesKHR)(VkDevice device, VkSurfaceKHR surface, VkDeviceGroupPresentModeFlagsKHR * pModes);
+typedef void (GLAD_API_PTR *PFN_vkGetDeviceImageMemoryRequirements)(VkDevice device, const VkDeviceImageMemoryRequirements * pInfo, VkMemoryRequirements2 * pMemoryRequirements);
+typedef void (GLAD_API_PTR *PFN_vkGetDeviceImageSparseMemoryRequirements)(VkDevice device, const VkDeviceImageMemoryRequirements * pInfo, uint32_t * pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2 * pSparseMemoryRequirements);
+typedef void (GLAD_API_PTR *PFN_vkGetDeviceMemoryCommitment)(VkDevice device, VkDeviceMemory memory, VkDeviceSize * pCommittedMemoryInBytes);
+typedef uint64_t (GLAD_API_PTR *PFN_vkGetDeviceMemoryOpaqueCaptureAddress)(VkDevice device, const VkDeviceMemoryOpaqueCaptureAddressInfo * pInfo);
+typedef PFN_vkVoidFunction (GLAD_API_PTR *PFN_vkGetDeviceProcAddr)(VkDevice device, const char * pName);
+typedef void (GLAD_API_PTR *PFN_vkGetDeviceQueue)(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue * pQueue);
+typedef void (GLAD_API_PTR *PFN_vkGetDeviceQueue2)(VkDevice device, const VkDeviceQueueInfo2 * pQueueInfo, VkQueue * pQueue);
+typedef VkResult (GLAD_API_PTR *PFN_vkGetEventStatus)(VkDevice device, VkEvent event);
+typedef VkResult (GLAD_API_PTR *PFN_vkGetFenceStatus)(VkDevice device, VkFence fence);
+typedef void (GLAD_API_PTR *PFN_vkGetImageMemoryRequirements)(VkDevice device, VkImage image, VkMemoryRequirements * pMemoryRequirements);
+typedef void (GLAD_API_PTR *PFN_vkGetImageMemoryRequirements2)(VkDevice device, const VkImageMemoryRequirementsInfo2 * pInfo, VkMemoryRequirements2 * pMemoryRequirements);
+typedef void (GLAD_API_PTR *PFN_vkGetImageSparseMemoryRequirements)(VkDevice device, VkImage image, uint32_t * pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements * pSparseMemoryRequirements);
+typedef void (GLAD_API_PTR *PFN_vkGetImageSparseMemoryRequirements2)(VkDevice device, const VkImageSparseMemoryRequirementsInfo2 * pInfo, uint32_t * pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2 * pSparseMemoryRequirements);
+typedef void (GLAD_API_PTR *PFN_vkGetImageSubresourceLayout)(VkDevice device, VkImage image, const VkImageSubresource * pSubresource, VkSubresourceLayout * pLayout);
+typedef PFN_vkVoidFunction (GLAD_API_PTR *PFN_vkGetInstanceProcAddr)(VkInstance instance, const char * pName);
+typedef void (GLAD_API_PTR *PFN_vkGetPhysicalDeviceExternalBufferProperties)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo * pExternalBufferInfo, VkExternalBufferProperties * pExternalBufferProperties);
+typedef void (GLAD_API_PTR *PFN_vkGetPhysicalDeviceExternalFenceProperties)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo * pExternalFenceInfo, VkExternalFenceProperties * pExternalFenceProperties);
+typedef void (GLAD_API_PTR *PFN_vkGetPhysicalDeviceExternalSemaphoreProperties)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo * pExternalSemaphoreInfo, VkExternalSemaphoreProperties * pExternalSemaphoreProperties);
+typedef void (GLAD_API_PTR *PFN_vkGetPhysicalDeviceFeatures)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures * pFeatures);
+typedef void (GLAD_API_PTR *PFN_vkGetPhysicalDeviceFeatures2)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2 * pFeatures);
+typedef void (GLAD_API_PTR *PFN_vkGetPhysicalDeviceFormatProperties)(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties * pFormatProperties);
+typedef void (GLAD_API_PTR *PFN_vkGetPhysicalDeviceFormatProperties2)(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties2 * pFormatProperties);
+typedef VkResult (GLAD_API_PTR *PFN_vkGetPhysicalDeviceImageFormatProperties)(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties * pImageFormatProperties);
+typedef VkResult (GLAD_API_PTR *PFN_vkGetPhysicalDeviceImageFormatProperties2)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2 * pImageFormatInfo, VkImageFormatProperties2 * pImageFormatProperties);
+typedef void (GLAD_API_PTR *PFN_vkGetPhysicalDeviceMemoryProperties)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties * pMemoryProperties);
+typedef void (GLAD_API_PTR *PFN_vkGetPhysicalDeviceMemoryProperties2)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2 * pMemoryProperties);
+typedef VkResult (GLAD_API_PTR *PFN_vkGetPhysicalDevicePresentRectanglesKHR)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t * pRectCount, VkRect2D * pRects);
+typedef void (GLAD_API_PTR *PFN_vkGetPhysicalDeviceProperties)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties * pProperties);
+typedef void (GLAD_API_PTR *PFN_vkGetPhysicalDeviceProperties2)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2 * pProperties);
+typedef void (GLAD_API_PTR *PFN_vkGetPhysicalDeviceQueueFamilyProperties)(VkPhysicalDevice physicalDevice, uint32_t * pQueueFamilyPropertyCount, VkQueueFamilyProperties * pQueueFamilyProperties);
+typedef void (GLAD_API_PTR *PFN_vkGetPhysicalDeviceQueueFamilyProperties2)(VkPhysicalDevice physicalDevice, uint32_t * pQueueFamilyPropertyCount, VkQueueFamilyProperties2 * pQueueFamilyProperties);
+typedef void (GLAD_API_PTR *PFN_vkGetPhysicalDeviceSparseImageFormatProperties)(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkSampleCountFlagBits samples, VkImageUsageFlags usage, VkImageTiling tiling, uint32_t * pPropertyCount, VkSparseImageFormatProperties * pProperties);
+typedef void (GLAD_API_PTR *PFN_vkGetPhysicalDeviceSparseImageFormatProperties2)(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2 * pFormatInfo, uint32_t * pPropertyCount, VkSparseImageFormatProperties2 * pProperties);
+typedef VkResult (GLAD_API_PTR *PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR * pSurfaceCapabilities);
+typedef VkResult (GLAD_API_PTR *PFN_vkGetPhysicalDeviceSurfaceFormatsKHR)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t * pSurfaceFormatCount, VkSurfaceFormatKHR * pSurfaceFormats);
+typedef VkResult (GLAD_API_PTR *PFN_vkGetPhysicalDeviceSurfacePresentModesKHR)(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t * pPresentModeCount, VkPresentModeKHR * pPresentModes);
+typedef VkResult (GLAD_API_PTR *PFN_vkGetPhysicalDeviceSurfaceSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, VkSurfaceKHR surface, VkBool32 * pSupported);
+typedef VkResult (GLAD_API_PTR *PFN_vkGetPhysicalDeviceToolProperties)(VkPhysicalDevice physicalDevice, uint32_t * pToolCount, VkPhysicalDeviceToolProperties * pToolProperties);
+typedef VkResult (GLAD_API_PTR *PFN_vkGetPipelineCacheData)(VkDevice device, VkPipelineCache pipelineCache, size_t * pDataSize, void * pData);
+typedef void (GLAD_API_PTR *PFN_vkGetPrivateData)(VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlot privateDataSlot, uint64_t * pData);
+typedef VkResult (GLAD_API_PTR *PFN_vkGetQueryPoolResults)(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, size_t dataSize, void * pData, VkDeviceSize stride, VkQueryResultFlags flags);
+typedef void (GLAD_API_PTR *PFN_vkGetRenderAreaGranularity)(VkDevice device, VkRenderPass renderPass, VkExtent2D * pGranularity);
+typedef VkResult (GLAD_API_PTR *PFN_vkGetSemaphoreCounterValue)(VkDevice device, VkSemaphore semaphore, uint64_t * pValue);
+typedef VkResult (GLAD_API_PTR *PFN_vkGetSwapchainImagesKHR)(VkDevice device, VkSwapchainKHR swapchain, uint32_t * pSwapchainImageCount, VkImage * pSwapchainImages);
+typedef VkResult (GLAD_API_PTR *PFN_vkInvalidateMappedMemoryRanges)(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange * pMemoryRanges);
+typedef VkResult (GLAD_API_PTR *PFN_vkMapMemory)(VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void ** ppData);
+typedef VkResult (GLAD_API_PTR *PFN_vkMergePipelineCaches)(VkDevice device, VkPipelineCache dstCache, uint32_t srcCacheCount, const VkPipelineCache * pSrcCaches);
+typedef VkResult (GLAD_API_PTR *PFN_vkQueueBindSparse)(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo * pBindInfo, VkFence fence);
+typedef VkResult (GLAD_API_PTR *PFN_vkQueuePresentKHR)(VkQueue queue, const VkPresentInfoKHR * pPresentInfo);
+typedef VkResult (GLAD_API_PTR *PFN_vkQueueSubmit)(VkQueue queue, uint32_t submitCount, const VkSubmitInfo * pSubmits, VkFence fence);
+typedef VkResult (GLAD_API_PTR *PFN_vkQueueSubmit2)(VkQueue queue, uint32_t submitCount, const VkSubmitInfo2 * pSubmits, VkFence fence);
+typedef VkResult (GLAD_API_PTR *PFN_vkQueueWaitIdle)(VkQueue queue);
+typedef VkResult (GLAD_API_PTR *PFN_vkResetCommandBuffer)(VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags);
+typedef VkResult (GLAD_API_PTR *PFN_vkResetCommandPool)(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags);
+typedef VkResult (GLAD_API_PTR *PFN_vkResetDescriptorPool)(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags);
+typedef VkResult (GLAD_API_PTR *PFN_vkResetEvent)(VkDevice device, VkEvent event);
+typedef VkResult (GLAD_API_PTR *PFN_vkResetFences)(VkDevice device, uint32_t fenceCount, const VkFence * pFences);
+typedef void (GLAD_API_PTR *PFN_vkResetQueryPool)(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount);
+typedef VkResult (GLAD_API_PTR *PFN_vkSetEvent)(VkDevice device, VkEvent event);
+typedef VkResult (GLAD_API_PTR *PFN_vkSetPrivateData)(VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlot privateDataSlot, uint64_t data);
+typedef VkResult (GLAD_API_PTR *PFN_vkSignalSemaphore)(VkDevice device, const VkSemaphoreSignalInfo * pSignalInfo);
+typedef void (GLAD_API_PTR *PFN_vkTrimCommandPool)(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags);
+typedef void (GLAD_API_PTR *PFN_vkUnmapMemory)(VkDevice device, VkDeviceMemory memory);
+typedef void (GLAD_API_PTR *PFN_vkUpdateDescriptorSetWithTemplate)(VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void * pData);
+typedef void (GLAD_API_PTR *PFN_vkUpdateDescriptorSets)(VkDevice device, uint32_t descriptorWriteCount, const VkWriteDescriptorSet * pDescriptorWrites, uint32_t descriptorCopyCount, const VkCopyDescriptorSet * pDescriptorCopies);
+typedef VkResult (GLAD_API_PTR *PFN_vkWaitForFences)(VkDevice device, uint32_t fenceCount, const VkFence * pFences, VkBool32 waitAll, uint64_t timeout);
+typedef VkResult (GLAD_API_PTR *PFN_vkWaitSemaphores)(VkDevice device, const VkSemaphoreWaitInfo * pWaitInfo, uint64_t timeout);
+
+GLAD_API_CALL PFN_vkAcquireNextImage2KHR glad_vkAcquireNextImage2KHR;
+#define vkAcquireNextImage2KHR glad_vkAcquireNextImage2KHR
+GLAD_API_CALL PFN_vkAcquireNextImageKHR glad_vkAcquireNextImageKHR;
+#define vkAcquireNextImageKHR glad_vkAcquireNextImageKHR
+GLAD_API_CALL PFN_vkAllocateCommandBuffers glad_vkAllocateCommandBuffers;
+#define vkAllocateCommandBuffers glad_vkAllocateCommandBuffers
+GLAD_API_CALL PFN_vkAllocateDescriptorSets glad_vkAllocateDescriptorSets;
+#define vkAllocateDescriptorSets glad_vkAllocateDescriptorSets
+GLAD_API_CALL PFN_vkAllocateMemory glad_vkAllocateMemory;
+#define vkAllocateMemory glad_vkAllocateMemory
+GLAD_API_CALL PFN_vkBeginCommandBuffer glad_vkBeginCommandBuffer;
+#define vkBeginCommandBuffer glad_vkBeginCommandBuffer
+GLAD_API_CALL PFN_vkBindBufferMemory glad_vkBindBufferMemory;
+#define vkBindBufferMemory glad_vkBindBufferMemory
+GLAD_API_CALL PFN_vkBindBufferMemory2 glad_vkBindBufferMemory2;
+#define vkBindBufferMemory2 glad_vkBindBufferMemory2
+GLAD_API_CALL PFN_vkBindImageMemory glad_vkBindImageMemory;
+#define vkBindImageMemory glad_vkBindImageMemory
+GLAD_API_CALL PFN_vkBindImageMemory2 glad_vkBindImageMemory2;
+#define vkBindImageMemory2 glad_vkBindImageMemory2
+GLAD_API_CALL PFN_vkCmdBeginQuery glad_vkCmdBeginQuery;
+#define vkCmdBeginQuery glad_vkCmdBeginQuery
+GLAD_API_CALL PFN_vkCmdBeginRenderPass glad_vkCmdBeginRenderPass;
+#define vkCmdBeginRenderPass glad_vkCmdBeginRenderPass
+GLAD_API_CALL PFN_vkCmdBeginRenderPass2 glad_vkCmdBeginRenderPass2;
+#define vkCmdBeginRenderPass2 glad_vkCmdBeginRenderPass2
+GLAD_API_CALL PFN_vkCmdBeginRendering glad_vkCmdBeginRendering;
+#define vkCmdBeginRendering glad_vkCmdBeginRendering
+GLAD_API_CALL PFN_vkCmdBindDescriptorSets glad_vkCmdBindDescriptorSets;
+#define vkCmdBindDescriptorSets glad_vkCmdBindDescriptorSets
+GLAD_API_CALL PFN_vkCmdBindIndexBuffer glad_vkCmdBindIndexBuffer;
+#define vkCmdBindIndexBuffer glad_vkCmdBindIndexBuffer
+GLAD_API_CALL PFN_vkCmdBindPipeline glad_vkCmdBindPipeline;
+#define vkCmdBindPipeline glad_vkCmdBindPipeline
+GLAD_API_CALL PFN_vkCmdBindVertexBuffers glad_vkCmdBindVertexBuffers;
+#define vkCmdBindVertexBuffers glad_vkCmdBindVertexBuffers
+GLAD_API_CALL PFN_vkCmdBindVertexBuffers2 glad_vkCmdBindVertexBuffers2;
+#define vkCmdBindVertexBuffers2 glad_vkCmdBindVertexBuffers2
+GLAD_API_CALL PFN_vkCmdBlitImage glad_vkCmdBlitImage;
+#define vkCmdBlitImage glad_vkCmdBlitImage
+GLAD_API_CALL PFN_vkCmdBlitImage2 glad_vkCmdBlitImage2;
+#define vkCmdBlitImage2 glad_vkCmdBlitImage2
+GLAD_API_CALL PFN_vkCmdClearAttachments glad_vkCmdClearAttachments;
+#define vkCmdClearAttachments glad_vkCmdClearAttachments
+GLAD_API_CALL PFN_vkCmdClearColorImage glad_vkCmdClearColorImage;
+#define vkCmdClearColorImage glad_vkCmdClearColorImage
+GLAD_API_CALL PFN_vkCmdClearDepthStencilImage glad_vkCmdClearDepthStencilImage;
+#define vkCmdClearDepthStencilImage glad_vkCmdClearDepthStencilImage
+GLAD_API_CALL PFN_vkCmdCopyBuffer glad_vkCmdCopyBuffer;
+#define vkCmdCopyBuffer glad_vkCmdCopyBuffer
+GLAD_API_CALL PFN_vkCmdCopyBuffer2 glad_vkCmdCopyBuffer2;
+#define vkCmdCopyBuffer2 glad_vkCmdCopyBuffer2
+GLAD_API_CALL PFN_vkCmdCopyBufferToImage glad_vkCmdCopyBufferToImage;
+#define vkCmdCopyBufferToImage glad_vkCmdCopyBufferToImage
+GLAD_API_CALL PFN_vkCmdCopyBufferToImage2 glad_vkCmdCopyBufferToImage2;
+#define vkCmdCopyBufferToImage2 glad_vkCmdCopyBufferToImage2
+GLAD_API_CALL PFN_vkCmdCopyImage glad_vkCmdCopyImage;
+#define vkCmdCopyImage glad_vkCmdCopyImage
+GLAD_API_CALL PFN_vkCmdCopyImage2 glad_vkCmdCopyImage2;
+#define vkCmdCopyImage2 glad_vkCmdCopyImage2
+GLAD_API_CALL PFN_vkCmdCopyImageToBuffer glad_vkCmdCopyImageToBuffer;
+#define vkCmdCopyImageToBuffer glad_vkCmdCopyImageToBuffer
+GLAD_API_CALL PFN_vkCmdCopyImageToBuffer2 glad_vkCmdCopyImageToBuffer2;
+#define vkCmdCopyImageToBuffer2 glad_vkCmdCopyImageToBuffer2
+GLAD_API_CALL PFN_vkCmdCopyQueryPoolResults glad_vkCmdCopyQueryPoolResults;
+#define vkCmdCopyQueryPoolResults glad_vkCmdCopyQueryPoolResults
+GLAD_API_CALL PFN_vkCmdDispatch glad_vkCmdDispatch;
+#define vkCmdDispatch glad_vkCmdDispatch
+GLAD_API_CALL PFN_vkCmdDispatchBase glad_vkCmdDispatchBase;
+#define vkCmdDispatchBase glad_vkCmdDispatchBase
+GLAD_API_CALL PFN_vkCmdDispatchIndirect glad_vkCmdDispatchIndirect;
+#define vkCmdDispatchIndirect glad_vkCmdDispatchIndirect
+GLAD_API_CALL PFN_vkCmdDraw glad_vkCmdDraw;
+#define vkCmdDraw glad_vkCmdDraw
+GLAD_API_CALL PFN_vkCmdDrawIndexed glad_vkCmdDrawIndexed;
+#define vkCmdDrawIndexed glad_vkCmdDrawIndexed
+GLAD_API_CALL PFN_vkCmdDrawIndexedIndirect glad_vkCmdDrawIndexedIndirect;
+#define vkCmdDrawIndexedIndirect glad_vkCmdDrawIndexedIndirect
+GLAD_API_CALL PFN_vkCmdDrawIndexedIndirectCount glad_vkCmdDrawIndexedIndirectCount;
+#define vkCmdDrawIndexedIndirectCount glad_vkCmdDrawIndexedIndirectCount
+GLAD_API_CALL PFN_vkCmdDrawIndirect glad_vkCmdDrawIndirect;
+#define vkCmdDrawIndirect glad_vkCmdDrawIndirect
+GLAD_API_CALL PFN_vkCmdDrawIndirectCount glad_vkCmdDrawIndirectCount;
+#define vkCmdDrawIndirectCount glad_vkCmdDrawIndirectCount
+GLAD_API_CALL PFN_vkCmdEndQuery glad_vkCmdEndQuery;
+#define vkCmdEndQuery glad_vkCmdEndQuery
+GLAD_API_CALL PFN_vkCmdEndRenderPass glad_vkCmdEndRenderPass;
+#define vkCmdEndRenderPass glad_vkCmdEndRenderPass
+GLAD_API_CALL PFN_vkCmdEndRenderPass2 glad_vkCmdEndRenderPass2;
+#define vkCmdEndRenderPass2 glad_vkCmdEndRenderPass2
+GLAD_API_CALL PFN_vkCmdEndRendering glad_vkCmdEndRendering;
+#define vkCmdEndRendering glad_vkCmdEndRendering
+GLAD_API_CALL PFN_vkCmdExecuteCommands glad_vkCmdExecuteCommands;
+#define vkCmdExecuteCommands glad_vkCmdExecuteCommands
+GLAD_API_CALL PFN_vkCmdFillBuffer glad_vkCmdFillBuffer;
+#define vkCmdFillBuffer glad_vkCmdFillBuffer
+GLAD_API_CALL PFN_vkCmdNextSubpass glad_vkCmdNextSubpass;
+#define vkCmdNextSubpass glad_vkCmdNextSubpass
+GLAD_API_CALL PFN_vkCmdNextSubpass2 glad_vkCmdNextSubpass2;
+#define vkCmdNextSubpass2 glad_vkCmdNextSubpass2
+GLAD_API_CALL PFN_vkCmdPipelineBarrier glad_vkCmdPipelineBarrier;
+#define vkCmdPipelineBarrier glad_vkCmdPipelineBarrier
+GLAD_API_CALL PFN_vkCmdPipelineBarrier2 glad_vkCmdPipelineBarrier2;
+#define vkCmdPipelineBarrier2 glad_vkCmdPipelineBarrier2
+GLAD_API_CALL PFN_vkCmdPushConstants glad_vkCmdPushConstants;
+#define vkCmdPushConstants glad_vkCmdPushConstants
+GLAD_API_CALL PFN_vkCmdResetEvent glad_vkCmdResetEvent;
+#define vkCmdResetEvent glad_vkCmdResetEvent
+GLAD_API_CALL PFN_vkCmdResetEvent2 glad_vkCmdResetEvent2;
+#define vkCmdResetEvent2 glad_vkCmdResetEvent2
+GLAD_API_CALL PFN_vkCmdResetQueryPool glad_vkCmdResetQueryPool;
+#define vkCmdResetQueryPool glad_vkCmdResetQueryPool
+GLAD_API_CALL PFN_vkCmdResolveImage glad_vkCmdResolveImage;
+#define vkCmdResolveImage glad_vkCmdResolveImage
+GLAD_API_CALL PFN_vkCmdResolveImage2 glad_vkCmdResolveImage2;
+#define vkCmdResolveImage2 glad_vkCmdResolveImage2
+GLAD_API_CALL PFN_vkCmdSetBlendConstants glad_vkCmdSetBlendConstants;
+#define vkCmdSetBlendConstants glad_vkCmdSetBlendConstants
+GLAD_API_CALL PFN_vkCmdSetCullMode glad_vkCmdSetCullMode;
+#define vkCmdSetCullMode glad_vkCmdSetCullMode
+GLAD_API_CALL PFN_vkCmdSetDepthBias glad_vkCmdSetDepthBias;
+#define vkCmdSetDepthBias glad_vkCmdSetDepthBias
+GLAD_API_CALL PFN_vkCmdSetDepthBiasEnable glad_vkCmdSetDepthBiasEnable;
+#define vkCmdSetDepthBiasEnable glad_vkCmdSetDepthBiasEnable
+GLAD_API_CALL PFN_vkCmdSetDepthBounds glad_vkCmdSetDepthBounds;
+#define vkCmdSetDepthBounds glad_vkCmdSetDepthBounds
+GLAD_API_CALL PFN_vkCmdSetDepthBoundsTestEnable glad_vkCmdSetDepthBoundsTestEnable;
+#define vkCmdSetDepthBoundsTestEnable glad_vkCmdSetDepthBoundsTestEnable
+GLAD_API_CALL PFN_vkCmdSetDepthCompareOp glad_vkCmdSetDepthCompareOp;
+#define vkCmdSetDepthCompareOp glad_vkCmdSetDepthCompareOp
+GLAD_API_CALL PFN_vkCmdSetDepthTestEnable glad_vkCmdSetDepthTestEnable;
+#define vkCmdSetDepthTestEnable glad_vkCmdSetDepthTestEnable
+GLAD_API_CALL PFN_vkCmdSetDepthWriteEnable glad_vkCmdSetDepthWriteEnable;
+#define vkCmdSetDepthWriteEnable glad_vkCmdSetDepthWriteEnable
+GLAD_API_CALL PFN_vkCmdSetDeviceMask glad_vkCmdSetDeviceMask;
+#define vkCmdSetDeviceMask glad_vkCmdSetDeviceMask
+GLAD_API_CALL PFN_vkCmdSetEvent glad_vkCmdSetEvent;
+#define vkCmdSetEvent glad_vkCmdSetEvent
+GLAD_API_CALL PFN_vkCmdSetEvent2 glad_vkCmdSetEvent2;
+#define vkCmdSetEvent2 glad_vkCmdSetEvent2
+GLAD_API_CALL PFN_vkCmdSetFrontFace glad_vkCmdSetFrontFace;
+#define vkCmdSetFrontFace glad_vkCmdSetFrontFace
+GLAD_API_CALL PFN_vkCmdSetLineWidth glad_vkCmdSetLineWidth;
+#define vkCmdSetLineWidth glad_vkCmdSetLineWidth
+GLAD_API_CALL PFN_vkCmdSetPrimitiveRestartEnable glad_vkCmdSetPrimitiveRestartEnable;
+#define vkCmdSetPrimitiveRestartEnable glad_vkCmdSetPrimitiveRestartEnable
+GLAD_API_CALL PFN_vkCmdSetPrimitiveTopology glad_vkCmdSetPrimitiveTopology;
+#define vkCmdSetPrimitiveTopology glad_vkCmdSetPrimitiveTopology
+GLAD_API_CALL PFN_vkCmdSetRasterizerDiscardEnable glad_vkCmdSetRasterizerDiscardEnable;
+#define vkCmdSetRasterizerDiscardEnable glad_vkCmdSetRasterizerDiscardEnable
+GLAD_API_CALL PFN_vkCmdSetScissor glad_vkCmdSetScissor;
+#define vkCmdSetScissor glad_vkCmdSetScissor
+GLAD_API_CALL PFN_vkCmdSetScissorWithCount glad_vkCmdSetScissorWithCount;
+#define vkCmdSetScissorWithCount glad_vkCmdSetScissorWithCount
+GLAD_API_CALL PFN_vkCmdSetStencilCompareMask glad_vkCmdSetStencilCompareMask;
+#define vkCmdSetStencilCompareMask glad_vkCmdSetStencilCompareMask
+GLAD_API_CALL PFN_vkCmdSetStencilOp glad_vkCmdSetStencilOp;
+#define vkCmdSetStencilOp glad_vkCmdSetStencilOp
+GLAD_API_CALL PFN_vkCmdSetStencilReference glad_vkCmdSetStencilReference;
+#define vkCmdSetStencilReference glad_vkCmdSetStencilReference
+GLAD_API_CALL PFN_vkCmdSetStencilTestEnable glad_vkCmdSetStencilTestEnable;
+#define vkCmdSetStencilTestEnable glad_vkCmdSetStencilTestEnable
+GLAD_API_CALL PFN_vkCmdSetStencilWriteMask glad_vkCmdSetStencilWriteMask;
+#define vkCmdSetStencilWriteMask glad_vkCmdSetStencilWriteMask
+GLAD_API_CALL PFN_vkCmdSetViewport glad_vkCmdSetViewport;
+#define vkCmdSetViewport glad_vkCmdSetViewport
+GLAD_API_CALL PFN_vkCmdSetViewportWithCount glad_vkCmdSetViewportWithCount;
+#define vkCmdSetViewportWithCount glad_vkCmdSetViewportWithCount
+GLAD_API_CALL PFN_vkCmdUpdateBuffer glad_vkCmdUpdateBuffer;
+#define vkCmdUpdateBuffer glad_vkCmdUpdateBuffer
+GLAD_API_CALL PFN_vkCmdWaitEvents glad_vkCmdWaitEvents;
+#define vkCmdWaitEvents glad_vkCmdWaitEvents
+GLAD_API_CALL PFN_vkCmdWaitEvents2 glad_vkCmdWaitEvents2;
+#define vkCmdWaitEvents2 glad_vkCmdWaitEvents2
+GLAD_API_CALL PFN_vkCmdWriteTimestamp glad_vkCmdWriteTimestamp;
+#define vkCmdWriteTimestamp glad_vkCmdWriteTimestamp
+GLAD_API_CALL PFN_vkCmdWriteTimestamp2 glad_vkCmdWriteTimestamp2;
+#define vkCmdWriteTimestamp2 glad_vkCmdWriteTimestamp2
+GLAD_API_CALL PFN_vkCreateBuffer glad_vkCreateBuffer;
+#define vkCreateBuffer glad_vkCreateBuffer
+GLAD_API_CALL PFN_vkCreateBufferView glad_vkCreateBufferView;
+#define vkCreateBufferView glad_vkCreateBufferView
+GLAD_API_CALL PFN_vkCreateCommandPool glad_vkCreateCommandPool;
+#define vkCreateCommandPool glad_vkCreateCommandPool
+GLAD_API_CALL PFN_vkCreateComputePipelines glad_vkCreateComputePipelines;
+#define vkCreateComputePipelines glad_vkCreateComputePipelines
+GLAD_API_CALL PFN_vkCreateDebugReportCallbackEXT glad_vkCreateDebugReportCallbackEXT;
+#define vkCreateDebugReportCallbackEXT glad_vkCreateDebugReportCallbackEXT
+GLAD_API_CALL PFN_vkCreateDescriptorPool glad_vkCreateDescriptorPool;
+#define vkCreateDescriptorPool glad_vkCreateDescriptorPool
+GLAD_API_CALL PFN_vkCreateDescriptorSetLayout glad_vkCreateDescriptorSetLayout;
+#define vkCreateDescriptorSetLayout glad_vkCreateDescriptorSetLayout
+GLAD_API_CALL PFN_vkCreateDescriptorUpdateTemplate glad_vkCreateDescriptorUpdateTemplate;
+#define vkCreateDescriptorUpdateTemplate glad_vkCreateDescriptorUpdateTemplate
+GLAD_API_CALL PFN_vkCreateDevice glad_vkCreateDevice;
+#define vkCreateDevice glad_vkCreateDevice
+GLAD_API_CALL PFN_vkCreateEvent glad_vkCreateEvent;
+#define vkCreateEvent glad_vkCreateEvent
+GLAD_API_CALL PFN_vkCreateFence glad_vkCreateFence;
+#define vkCreateFence glad_vkCreateFence
+GLAD_API_CALL PFN_vkCreateFramebuffer glad_vkCreateFramebuffer;
+#define vkCreateFramebuffer glad_vkCreateFramebuffer
+GLAD_API_CALL PFN_vkCreateGraphicsPipelines glad_vkCreateGraphicsPipelines;
+#define vkCreateGraphicsPipelines glad_vkCreateGraphicsPipelines
+GLAD_API_CALL PFN_vkCreateImage glad_vkCreateImage;
+#define vkCreateImage glad_vkCreateImage
+GLAD_API_CALL PFN_vkCreateImageView glad_vkCreateImageView;
+#define vkCreateImageView glad_vkCreateImageView
+GLAD_API_CALL PFN_vkCreateInstance glad_vkCreateInstance;
+#define vkCreateInstance glad_vkCreateInstance
+GLAD_API_CALL PFN_vkCreatePipelineCache glad_vkCreatePipelineCache;
+#define vkCreatePipelineCache glad_vkCreatePipelineCache
+GLAD_API_CALL PFN_vkCreatePipelineLayout glad_vkCreatePipelineLayout;
+#define vkCreatePipelineLayout glad_vkCreatePipelineLayout
+GLAD_API_CALL PFN_vkCreatePrivateDataSlot glad_vkCreatePrivateDataSlot;
+#define vkCreatePrivateDataSlot glad_vkCreatePrivateDataSlot
+GLAD_API_CALL PFN_vkCreateQueryPool glad_vkCreateQueryPool;
+#define vkCreateQueryPool glad_vkCreateQueryPool
+GLAD_API_CALL PFN_vkCreateRenderPass glad_vkCreateRenderPass;
+#define vkCreateRenderPass glad_vkCreateRenderPass
+GLAD_API_CALL PFN_vkCreateRenderPass2 glad_vkCreateRenderPass2;
+#define vkCreateRenderPass2 glad_vkCreateRenderPass2
+GLAD_API_CALL PFN_vkCreateSampler glad_vkCreateSampler;
+#define vkCreateSampler glad_vkCreateSampler
+GLAD_API_CALL PFN_vkCreateSamplerYcbcrConversion glad_vkCreateSamplerYcbcrConversion;
+#define vkCreateSamplerYcbcrConversion glad_vkCreateSamplerYcbcrConversion
+GLAD_API_CALL PFN_vkCreateSemaphore glad_vkCreateSemaphore;
+#define vkCreateSemaphore glad_vkCreateSemaphore
+GLAD_API_CALL PFN_vkCreateShaderModule glad_vkCreateShaderModule;
+#define vkCreateShaderModule glad_vkCreateShaderModule
+GLAD_API_CALL PFN_vkCreateSwapchainKHR glad_vkCreateSwapchainKHR;
+#define vkCreateSwapchainKHR glad_vkCreateSwapchainKHR
+GLAD_API_CALL PFN_vkDebugReportMessageEXT glad_vkDebugReportMessageEXT;
+#define vkDebugReportMessageEXT glad_vkDebugReportMessageEXT
+GLAD_API_CALL PFN_vkDestroyBuffer glad_vkDestroyBuffer;
+#define vkDestroyBuffer glad_vkDestroyBuffer
+GLAD_API_CALL PFN_vkDestroyBufferView glad_vkDestroyBufferView;
+#define vkDestroyBufferView glad_vkDestroyBufferView
+GLAD_API_CALL PFN_vkDestroyCommandPool glad_vkDestroyCommandPool;
+#define vkDestroyCommandPool glad_vkDestroyCommandPool
+GLAD_API_CALL PFN_vkDestroyDebugReportCallbackEXT glad_vkDestroyDebugReportCallbackEXT;
+#define vkDestroyDebugReportCallbackEXT glad_vkDestroyDebugReportCallbackEXT
+GLAD_API_CALL PFN_vkDestroyDescriptorPool glad_vkDestroyDescriptorPool;
+#define vkDestroyDescriptorPool glad_vkDestroyDescriptorPool
+GLAD_API_CALL PFN_vkDestroyDescriptorSetLayout glad_vkDestroyDescriptorSetLayout;
+#define vkDestroyDescriptorSetLayout glad_vkDestroyDescriptorSetLayout
+GLAD_API_CALL PFN_vkDestroyDescriptorUpdateTemplate glad_vkDestroyDescriptorUpdateTemplate;
+#define vkDestroyDescriptorUpdateTemplate glad_vkDestroyDescriptorUpdateTemplate
+GLAD_API_CALL PFN_vkDestroyDevice glad_vkDestroyDevice;
+#define vkDestroyDevice glad_vkDestroyDevice
+GLAD_API_CALL PFN_vkDestroyEvent glad_vkDestroyEvent;
+#define vkDestroyEvent glad_vkDestroyEvent
+GLAD_API_CALL PFN_vkDestroyFence glad_vkDestroyFence;
+#define vkDestroyFence glad_vkDestroyFence
+GLAD_API_CALL PFN_vkDestroyFramebuffer glad_vkDestroyFramebuffer;
+#define vkDestroyFramebuffer glad_vkDestroyFramebuffer
+GLAD_API_CALL PFN_vkDestroyImage glad_vkDestroyImage;
+#define vkDestroyImage glad_vkDestroyImage
+GLAD_API_CALL PFN_vkDestroyImageView glad_vkDestroyImageView;
+#define vkDestroyImageView glad_vkDestroyImageView
+GLAD_API_CALL PFN_vkDestroyInstance glad_vkDestroyInstance;
+#define vkDestroyInstance glad_vkDestroyInstance
+GLAD_API_CALL PFN_vkDestroyPipeline glad_vkDestroyPipeline;
+#define vkDestroyPipeline glad_vkDestroyPipeline
+GLAD_API_CALL PFN_vkDestroyPipelineCache glad_vkDestroyPipelineCache;
+#define vkDestroyPipelineCache glad_vkDestroyPipelineCache
+GLAD_API_CALL PFN_vkDestroyPipelineLayout glad_vkDestroyPipelineLayout;
+#define vkDestroyPipelineLayout glad_vkDestroyPipelineLayout
+GLAD_API_CALL PFN_vkDestroyPrivateDataSlot glad_vkDestroyPrivateDataSlot;
+#define vkDestroyPrivateDataSlot glad_vkDestroyPrivateDataSlot
+GLAD_API_CALL PFN_vkDestroyQueryPool glad_vkDestroyQueryPool;
+#define vkDestroyQueryPool glad_vkDestroyQueryPool
+GLAD_API_CALL PFN_vkDestroyRenderPass glad_vkDestroyRenderPass;
+#define vkDestroyRenderPass glad_vkDestroyRenderPass
+GLAD_API_CALL PFN_vkDestroySampler glad_vkDestroySampler;
+#define vkDestroySampler glad_vkDestroySampler
+GLAD_API_CALL PFN_vkDestroySamplerYcbcrConversion glad_vkDestroySamplerYcbcrConversion;
+#define vkDestroySamplerYcbcrConversion glad_vkDestroySamplerYcbcrConversion
+GLAD_API_CALL PFN_vkDestroySemaphore glad_vkDestroySemaphore;
+#define vkDestroySemaphore glad_vkDestroySemaphore
+GLAD_API_CALL PFN_vkDestroyShaderModule glad_vkDestroyShaderModule;
+#define vkDestroyShaderModule glad_vkDestroyShaderModule
+GLAD_API_CALL PFN_vkDestroySurfaceKHR glad_vkDestroySurfaceKHR;
+#define vkDestroySurfaceKHR glad_vkDestroySurfaceKHR
+GLAD_API_CALL PFN_vkDestroySwapchainKHR glad_vkDestroySwapchainKHR;
+#define vkDestroySwapchainKHR glad_vkDestroySwapchainKHR
+GLAD_API_CALL PFN_vkDeviceWaitIdle glad_vkDeviceWaitIdle;
+#define vkDeviceWaitIdle glad_vkDeviceWaitIdle
+GLAD_API_CALL PFN_vkEndCommandBuffer glad_vkEndCommandBuffer;
+#define vkEndCommandBuffer glad_vkEndCommandBuffer
+GLAD_API_CALL PFN_vkEnumerateDeviceExtensionProperties glad_vkEnumerateDeviceExtensionProperties;
+#define vkEnumerateDeviceExtensionProperties glad_vkEnumerateDeviceExtensionProperties
+GLAD_API_CALL PFN_vkEnumerateDeviceLayerProperties glad_vkEnumerateDeviceLayerProperties;
+#define vkEnumerateDeviceLayerProperties glad_vkEnumerateDeviceLayerProperties
+GLAD_API_CALL PFN_vkEnumerateInstanceExtensionProperties glad_vkEnumerateInstanceExtensionProperties;
+#define vkEnumerateInstanceExtensionProperties glad_vkEnumerateInstanceExtensionProperties
+GLAD_API_CALL PFN_vkEnumerateInstanceLayerProperties glad_vkEnumerateInstanceLayerProperties;
+#define vkEnumerateInstanceLayerProperties glad_vkEnumerateInstanceLayerProperties
+GLAD_API_CALL PFN_vkEnumerateInstanceVersion glad_vkEnumerateInstanceVersion;
+#define vkEnumerateInstanceVersion glad_vkEnumerateInstanceVersion
+GLAD_API_CALL PFN_vkEnumeratePhysicalDeviceGroups glad_vkEnumeratePhysicalDeviceGroups;
+#define vkEnumeratePhysicalDeviceGroups glad_vkEnumeratePhysicalDeviceGroups
+GLAD_API_CALL PFN_vkEnumeratePhysicalDevices glad_vkEnumeratePhysicalDevices;
+#define vkEnumeratePhysicalDevices glad_vkEnumeratePhysicalDevices
+GLAD_API_CALL PFN_vkFlushMappedMemoryRanges glad_vkFlushMappedMemoryRanges;
+#define vkFlushMappedMemoryRanges glad_vkFlushMappedMemoryRanges
+GLAD_API_CALL PFN_vkFreeCommandBuffers glad_vkFreeCommandBuffers;
+#define vkFreeCommandBuffers glad_vkFreeCommandBuffers
+GLAD_API_CALL PFN_vkFreeDescriptorSets glad_vkFreeDescriptorSets;
+#define vkFreeDescriptorSets glad_vkFreeDescriptorSets
+GLAD_API_CALL PFN_vkFreeMemory glad_vkFreeMemory;
+#define vkFreeMemory glad_vkFreeMemory
+GLAD_API_CALL PFN_vkGetBufferDeviceAddress glad_vkGetBufferDeviceAddress;
+#define vkGetBufferDeviceAddress glad_vkGetBufferDeviceAddress
+GLAD_API_CALL PFN_vkGetBufferMemoryRequirements glad_vkGetBufferMemoryRequirements;
+#define vkGetBufferMemoryRequirements glad_vkGetBufferMemoryRequirements
+GLAD_API_CALL PFN_vkGetBufferMemoryRequirements2 glad_vkGetBufferMemoryRequirements2;
+#define vkGetBufferMemoryRequirements2 glad_vkGetBufferMemoryRequirements2
+GLAD_API_CALL PFN_vkGetBufferOpaqueCaptureAddress glad_vkGetBufferOpaqueCaptureAddress;
+#define vkGetBufferOpaqueCaptureAddress glad_vkGetBufferOpaqueCaptureAddress
+GLAD_API_CALL PFN_vkGetDescriptorSetLayoutSupport glad_vkGetDescriptorSetLayoutSupport;
+#define vkGetDescriptorSetLayoutSupport glad_vkGetDescriptorSetLayoutSupport
+GLAD_API_CALL PFN_vkGetDeviceBufferMemoryRequirements glad_vkGetDeviceBufferMemoryRequirements;
+#define vkGetDeviceBufferMemoryRequirements glad_vkGetDeviceBufferMemoryRequirements
+GLAD_API_CALL PFN_vkGetDeviceGroupPeerMemoryFeatures glad_vkGetDeviceGroupPeerMemoryFeatures;
+#define vkGetDeviceGroupPeerMemoryFeatures glad_vkGetDeviceGroupPeerMemoryFeatures
+GLAD_API_CALL PFN_vkGetDeviceGroupPresentCapabilitiesKHR glad_vkGetDeviceGroupPresentCapabilitiesKHR;
+#define vkGetDeviceGroupPresentCapabilitiesKHR glad_vkGetDeviceGroupPresentCapabilitiesKHR
+GLAD_API_CALL PFN_vkGetDeviceGroupSurfacePresentModesKHR glad_vkGetDeviceGroupSurfacePresentModesKHR;
+#define vkGetDeviceGroupSurfacePresentModesKHR glad_vkGetDeviceGroupSurfacePresentModesKHR
+GLAD_API_CALL PFN_vkGetDeviceImageMemoryRequirements glad_vkGetDeviceImageMemoryRequirements;
+#define vkGetDeviceImageMemoryRequirements glad_vkGetDeviceImageMemoryRequirements
+GLAD_API_CALL PFN_vkGetDeviceImageSparseMemoryRequirements glad_vkGetDeviceImageSparseMemoryRequirements;
+#define vkGetDeviceImageSparseMemoryRequirements glad_vkGetDeviceImageSparseMemoryRequirements
+GLAD_API_CALL PFN_vkGetDeviceMemoryCommitment glad_vkGetDeviceMemoryCommitment;
+#define vkGetDeviceMemoryCommitment glad_vkGetDeviceMemoryCommitment
+GLAD_API_CALL PFN_vkGetDeviceMemoryOpaqueCaptureAddress glad_vkGetDeviceMemoryOpaqueCaptureAddress;
+#define vkGetDeviceMemoryOpaqueCaptureAddress glad_vkGetDeviceMemoryOpaqueCaptureAddress
+GLAD_API_CALL PFN_vkGetDeviceProcAddr glad_vkGetDeviceProcAddr;
+#define vkGetDeviceProcAddr glad_vkGetDeviceProcAddr
+GLAD_API_CALL PFN_vkGetDeviceQueue glad_vkGetDeviceQueue;
+#define vkGetDeviceQueue glad_vkGetDeviceQueue
+GLAD_API_CALL PFN_vkGetDeviceQueue2 glad_vkGetDeviceQueue2;
+#define vkGetDeviceQueue2 glad_vkGetDeviceQueue2
+GLAD_API_CALL PFN_vkGetEventStatus glad_vkGetEventStatus;
+#define vkGetEventStatus glad_vkGetEventStatus
+GLAD_API_CALL PFN_vkGetFenceStatus glad_vkGetFenceStatus;
+#define vkGetFenceStatus glad_vkGetFenceStatus
+GLAD_API_CALL PFN_vkGetImageMemoryRequirements glad_vkGetImageMemoryRequirements;
+#define vkGetImageMemoryRequirements glad_vkGetImageMemoryRequirements
+GLAD_API_CALL PFN_vkGetImageMemoryRequirements2 glad_vkGetImageMemoryRequirements2;
+#define vkGetImageMemoryRequirements2 glad_vkGetImageMemoryRequirements2
+GLAD_API_CALL PFN_vkGetImageSparseMemoryRequirements glad_vkGetImageSparseMemoryRequirements;
+#define vkGetImageSparseMemoryRequirements glad_vkGetImageSparseMemoryRequirements
+GLAD_API_CALL PFN_vkGetImageSparseMemoryRequirements2 glad_vkGetImageSparseMemoryRequirements2;
+#define vkGetImageSparseMemoryRequirements2 glad_vkGetImageSparseMemoryRequirements2
+GLAD_API_CALL PFN_vkGetImageSubresourceLayout glad_vkGetImageSubresourceLayout;
+#define vkGetImageSubresourceLayout glad_vkGetImageSubresourceLayout
+GLAD_API_CALL PFN_vkGetInstanceProcAddr glad_vkGetInstanceProcAddr;
+#define vkGetInstanceProcAddr glad_vkGetInstanceProcAddr
+GLAD_API_CALL PFN_vkGetPhysicalDeviceExternalBufferProperties glad_vkGetPhysicalDeviceExternalBufferProperties;
+#define vkGetPhysicalDeviceExternalBufferProperties glad_vkGetPhysicalDeviceExternalBufferProperties
+GLAD_API_CALL PFN_vkGetPhysicalDeviceExternalFenceProperties glad_vkGetPhysicalDeviceExternalFenceProperties;
+#define vkGetPhysicalDeviceExternalFenceProperties glad_vkGetPhysicalDeviceExternalFenceProperties
+GLAD_API_CALL PFN_vkGetPhysicalDeviceExternalSemaphoreProperties glad_vkGetPhysicalDeviceExternalSemaphoreProperties;
+#define vkGetPhysicalDeviceExternalSemaphoreProperties glad_vkGetPhysicalDeviceExternalSemaphoreProperties
+GLAD_API_CALL PFN_vkGetPhysicalDeviceFeatures glad_vkGetPhysicalDeviceFeatures;
+#define vkGetPhysicalDeviceFeatures glad_vkGetPhysicalDeviceFeatures
+GLAD_API_CALL PFN_vkGetPhysicalDeviceFeatures2 glad_vkGetPhysicalDeviceFeatures2;
+#define vkGetPhysicalDeviceFeatures2 glad_vkGetPhysicalDeviceFeatures2
+GLAD_API_CALL PFN_vkGetPhysicalDeviceFormatProperties glad_vkGetPhysicalDeviceFormatProperties;
+#define vkGetPhysicalDeviceFormatProperties glad_vkGetPhysicalDeviceFormatProperties
+GLAD_API_CALL PFN_vkGetPhysicalDeviceFormatProperties2 glad_vkGetPhysicalDeviceFormatProperties2;
+#define vkGetPhysicalDeviceFormatProperties2 glad_vkGetPhysicalDeviceFormatProperties2
+GLAD_API_CALL PFN_vkGetPhysicalDeviceImageFormatProperties glad_vkGetPhysicalDeviceImageFormatProperties;
+#define vkGetPhysicalDeviceImageFormatProperties glad_vkGetPhysicalDeviceImageFormatProperties
+GLAD_API_CALL PFN_vkGetPhysicalDeviceImageFormatProperties2 glad_vkGetPhysicalDeviceImageFormatProperties2;
+#define vkGetPhysicalDeviceImageFormatProperties2 glad_vkGetPhysicalDeviceImageFormatProperties2
+GLAD_API_CALL PFN_vkGetPhysicalDeviceMemoryProperties glad_vkGetPhysicalDeviceMemoryProperties;
+#define vkGetPhysicalDeviceMemoryProperties glad_vkGetPhysicalDeviceMemoryProperties
+GLAD_API_CALL PFN_vkGetPhysicalDeviceMemoryProperties2 glad_vkGetPhysicalDeviceMemoryProperties2;
+#define vkGetPhysicalDeviceMemoryProperties2 glad_vkGetPhysicalDeviceMemoryProperties2
+GLAD_API_CALL PFN_vkGetPhysicalDevicePresentRectanglesKHR glad_vkGetPhysicalDevicePresentRectanglesKHR;
+#define vkGetPhysicalDevicePresentRectanglesKHR glad_vkGetPhysicalDevicePresentRectanglesKHR
+GLAD_API_CALL PFN_vkGetPhysicalDeviceProperties glad_vkGetPhysicalDeviceProperties;
+#define vkGetPhysicalDeviceProperties glad_vkGetPhysicalDeviceProperties
+GLAD_API_CALL PFN_vkGetPhysicalDeviceProperties2 glad_vkGetPhysicalDeviceProperties2;
+#define vkGetPhysicalDeviceProperties2 glad_vkGetPhysicalDeviceProperties2
+GLAD_API_CALL PFN_vkGetPhysicalDeviceQueueFamilyProperties glad_vkGetPhysicalDeviceQueueFamilyProperties;
+#define vkGetPhysicalDeviceQueueFamilyProperties glad_vkGetPhysicalDeviceQueueFamilyProperties
+GLAD_API_CALL PFN_vkGetPhysicalDeviceQueueFamilyProperties2 glad_vkGetPhysicalDeviceQueueFamilyProperties2;
+#define vkGetPhysicalDeviceQueueFamilyProperties2 glad_vkGetPhysicalDeviceQueueFamilyProperties2
+GLAD_API_CALL PFN_vkGetPhysicalDeviceSparseImageFormatProperties glad_vkGetPhysicalDeviceSparseImageFormatProperties;
+#define vkGetPhysicalDeviceSparseImageFormatProperties glad_vkGetPhysicalDeviceSparseImageFormatProperties
+GLAD_API_CALL PFN_vkGetPhysicalDeviceSparseImageFormatProperties2 glad_vkGetPhysicalDeviceSparseImageFormatProperties2;
+#define vkGetPhysicalDeviceSparseImageFormatProperties2 glad_vkGetPhysicalDeviceSparseImageFormatProperties2
+GLAD_API_CALL PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR glad_vkGetPhysicalDeviceSurfaceCapabilitiesKHR;
+#define vkGetPhysicalDeviceSurfaceCapabilitiesKHR glad_vkGetPhysicalDeviceSurfaceCapabilitiesKHR
+GLAD_API_CALL PFN_vkGetPhysicalDeviceSurfaceFormatsKHR glad_vkGetPhysicalDeviceSurfaceFormatsKHR;
+#define vkGetPhysicalDeviceSurfaceFormatsKHR glad_vkGetPhysicalDeviceSurfaceFormatsKHR
+GLAD_API_CALL PFN_vkGetPhysicalDeviceSurfacePresentModesKHR glad_vkGetPhysicalDeviceSurfacePresentModesKHR;
+#define vkGetPhysicalDeviceSurfacePresentModesKHR glad_vkGetPhysicalDeviceSurfacePresentModesKHR
+GLAD_API_CALL PFN_vkGetPhysicalDeviceSurfaceSupportKHR glad_vkGetPhysicalDeviceSurfaceSupportKHR;
+#define vkGetPhysicalDeviceSurfaceSupportKHR glad_vkGetPhysicalDeviceSurfaceSupportKHR
+GLAD_API_CALL PFN_vkGetPhysicalDeviceToolProperties glad_vkGetPhysicalDeviceToolProperties;
+#define vkGetPhysicalDeviceToolProperties glad_vkGetPhysicalDeviceToolProperties
+GLAD_API_CALL PFN_vkGetPipelineCacheData glad_vkGetPipelineCacheData;
+#define vkGetPipelineCacheData glad_vkGetPipelineCacheData
+GLAD_API_CALL PFN_vkGetPrivateData glad_vkGetPrivateData;
+#define vkGetPrivateData glad_vkGetPrivateData
+GLAD_API_CALL PFN_vkGetQueryPoolResults glad_vkGetQueryPoolResults;
+#define vkGetQueryPoolResults glad_vkGetQueryPoolResults
+GLAD_API_CALL PFN_vkGetRenderAreaGranularity glad_vkGetRenderAreaGranularity;
+#define vkGetRenderAreaGranularity glad_vkGetRenderAreaGranularity
+GLAD_API_CALL PFN_vkGetSemaphoreCounterValue glad_vkGetSemaphoreCounterValue;
+#define vkGetSemaphoreCounterValue glad_vkGetSemaphoreCounterValue
+GLAD_API_CALL PFN_vkGetSwapchainImagesKHR glad_vkGetSwapchainImagesKHR;
+#define vkGetSwapchainImagesKHR glad_vkGetSwapchainImagesKHR
+GLAD_API_CALL PFN_vkInvalidateMappedMemoryRanges glad_vkInvalidateMappedMemoryRanges;
+#define vkInvalidateMappedMemoryRanges glad_vkInvalidateMappedMemoryRanges
+GLAD_API_CALL PFN_vkMapMemory glad_vkMapMemory;
+#define vkMapMemory glad_vkMapMemory
+GLAD_API_CALL PFN_vkMergePipelineCaches glad_vkMergePipelineCaches;
+#define vkMergePipelineCaches glad_vkMergePipelineCaches
+GLAD_API_CALL PFN_vkQueueBindSparse glad_vkQueueBindSparse;
+#define vkQueueBindSparse glad_vkQueueBindSparse
+GLAD_API_CALL PFN_vkQueuePresentKHR glad_vkQueuePresentKHR;
+#define vkQueuePresentKHR glad_vkQueuePresentKHR
+GLAD_API_CALL PFN_vkQueueSubmit glad_vkQueueSubmit;
+#define vkQueueSubmit glad_vkQueueSubmit
+GLAD_API_CALL PFN_vkQueueSubmit2 glad_vkQueueSubmit2;
+#define vkQueueSubmit2 glad_vkQueueSubmit2
+GLAD_API_CALL PFN_vkQueueWaitIdle glad_vkQueueWaitIdle;
+#define vkQueueWaitIdle glad_vkQueueWaitIdle
+GLAD_API_CALL PFN_vkResetCommandBuffer glad_vkResetCommandBuffer;
+#define vkResetCommandBuffer glad_vkResetCommandBuffer
+GLAD_API_CALL PFN_vkResetCommandPool glad_vkResetCommandPool;
+#define vkResetCommandPool glad_vkResetCommandPool
+GLAD_API_CALL PFN_vkResetDescriptorPool glad_vkResetDescriptorPool;
+#define vkResetDescriptorPool glad_vkResetDescriptorPool
+GLAD_API_CALL PFN_vkResetEvent glad_vkResetEvent;
+#define vkResetEvent glad_vkResetEvent
+GLAD_API_CALL PFN_vkResetFences glad_vkResetFences;
+#define vkResetFences glad_vkResetFences
+GLAD_API_CALL PFN_vkResetQueryPool glad_vkResetQueryPool;
+#define vkResetQueryPool glad_vkResetQueryPool
+GLAD_API_CALL PFN_vkSetEvent glad_vkSetEvent;
+#define vkSetEvent glad_vkSetEvent
+GLAD_API_CALL PFN_vkSetPrivateData glad_vkSetPrivateData;
+#define vkSetPrivateData glad_vkSetPrivateData
+GLAD_API_CALL PFN_vkSignalSemaphore glad_vkSignalSemaphore;
+#define vkSignalSemaphore glad_vkSignalSemaphore
+GLAD_API_CALL PFN_vkTrimCommandPool glad_vkTrimCommandPool;
+#define vkTrimCommandPool glad_vkTrimCommandPool
+GLAD_API_CALL PFN_vkUnmapMemory glad_vkUnmapMemory;
+#define vkUnmapMemory glad_vkUnmapMemory
+GLAD_API_CALL PFN_vkUpdateDescriptorSetWithTemplate glad_vkUpdateDescriptorSetWithTemplate;
+#define vkUpdateDescriptorSetWithTemplate glad_vkUpdateDescriptorSetWithTemplate
+GLAD_API_CALL PFN_vkUpdateDescriptorSets glad_vkUpdateDescriptorSets;
+#define vkUpdateDescriptorSets glad_vkUpdateDescriptorSets
+GLAD_API_CALL PFN_vkWaitForFences glad_vkWaitForFences;
+#define vkWaitForFences glad_vkWaitForFences
+GLAD_API_CALL PFN_vkWaitSemaphores glad_vkWaitSemaphores;
+#define vkWaitSemaphores glad_vkWaitSemaphores
+
+
+
+
+
+GLAD_API_CALL int gladLoadVulkanUserPtr( VkPhysicalDevice physical_device, GLADuserptrloadfunc load, void *userptr);
+GLAD_API_CALL int gladLoadVulkan( VkPhysicalDevice physical_device, GLADloadfunc load);
+
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif
+
+/* Source */
+#ifdef GLAD_VULKAN_IMPLEMENTATION
+#include
+#include
+#include
+
+#ifndef GLAD_IMPL_UTIL_C_
+#define GLAD_IMPL_UTIL_C_
+
+#ifdef _MSC_VER
+#define GLAD_IMPL_UTIL_SSCANF sscanf_s
+#else
+#define GLAD_IMPL_UTIL_SSCANF sscanf
+#endif
+
+#endif /* GLAD_IMPL_UTIL_C_ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+
+int GLAD_VK_VERSION_1_0 = 0;
+int GLAD_VK_VERSION_1_1 = 0;
+int GLAD_VK_VERSION_1_2 = 0;
+int GLAD_VK_VERSION_1_3 = 0;
+int GLAD_VK_EXT_debug_report = 0;
+int GLAD_VK_KHR_portability_enumeration = 0;
+int GLAD_VK_KHR_surface = 0;
+int GLAD_VK_KHR_swapchain = 0;
+
+
+
+PFN_vkAcquireNextImage2KHR glad_vkAcquireNextImage2KHR = NULL;
+PFN_vkAcquireNextImageKHR glad_vkAcquireNextImageKHR = NULL;
+PFN_vkAllocateCommandBuffers glad_vkAllocateCommandBuffers = NULL;
+PFN_vkAllocateDescriptorSets glad_vkAllocateDescriptorSets = NULL;
+PFN_vkAllocateMemory glad_vkAllocateMemory = NULL;
+PFN_vkBeginCommandBuffer glad_vkBeginCommandBuffer = NULL;
+PFN_vkBindBufferMemory glad_vkBindBufferMemory = NULL;
+PFN_vkBindBufferMemory2 glad_vkBindBufferMemory2 = NULL;
+PFN_vkBindImageMemory glad_vkBindImageMemory = NULL;
+PFN_vkBindImageMemory2 glad_vkBindImageMemory2 = NULL;
+PFN_vkCmdBeginQuery glad_vkCmdBeginQuery = NULL;
+PFN_vkCmdBeginRenderPass glad_vkCmdBeginRenderPass = NULL;
+PFN_vkCmdBeginRenderPass2 glad_vkCmdBeginRenderPass2 = NULL;
+PFN_vkCmdBeginRendering glad_vkCmdBeginRendering = NULL;
+PFN_vkCmdBindDescriptorSets glad_vkCmdBindDescriptorSets = NULL;
+PFN_vkCmdBindIndexBuffer glad_vkCmdBindIndexBuffer = NULL;
+PFN_vkCmdBindPipeline glad_vkCmdBindPipeline = NULL;
+PFN_vkCmdBindVertexBuffers glad_vkCmdBindVertexBuffers = NULL;
+PFN_vkCmdBindVertexBuffers2 glad_vkCmdBindVertexBuffers2 = NULL;
+PFN_vkCmdBlitImage glad_vkCmdBlitImage = NULL;
+PFN_vkCmdBlitImage2 glad_vkCmdBlitImage2 = NULL;
+PFN_vkCmdClearAttachments glad_vkCmdClearAttachments = NULL;
+PFN_vkCmdClearColorImage glad_vkCmdClearColorImage = NULL;
+PFN_vkCmdClearDepthStencilImage glad_vkCmdClearDepthStencilImage = NULL;
+PFN_vkCmdCopyBuffer glad_vkCmdCopyBuffer = NULL;
+PFN_vkCmdCopyBuffer2 glad_vkCmdCopyBuffer2 = NULL;
+PFN_vkCmdCopyBufferToImage glad_vkCmdCopyBufferToImage = NULL;
+PFN_vkCmdCopyBufferToImage2 glad_vkCmdCopyBufferToImage2 = NULL;
+PFN_vkCmdCopyImage glad_vkCmdCopyImage = NULL;
+PFN_vkCmdCopyImage2 glad_vkCmdCopyImage2 = NULL;
+PFN_vkCmdCopyImageToBuffer glad_vkCmdCopyImageToBuffer = NULL;
+PFN_vkCmdCopyImageToBuffer2 glad_vkCmdCopyImageToBuffer2 = NULL;
+PFN_vkCmdCopyQueryPoolResults glad_vkCmdCopyQueryPoolResults = NULL;
+PFN_vkCmdDispatch glad_vkCmdDispatch = NULL;
+PFN_vkCmdDispatchBase glad_vkCmdDispatchBase = NULL;
+PFN_vkCmdDispatchIndirect glad_vkCmdDispatchIndirect = NULL;
+PFN_vkCmdDraw glad_vkCmdDraw = NULL;
+PFN_vkCmdDrawIndexed glad_vkCmdDrawIndexed = NULL;
+PFN_vkCmdDrawIndexedIndirect glad_vkCmdDrawIndexedIndirect = NULL;
+PFN_vkCmdDrawIndexedIndirectCount glad_vkCmdDrawIndexedIndirectCount = NULL;
+PFN_vkCmdDrawIndirect glad_vkCmdDrawIndirect = NULL;
+PFN_vkCmdDrawIndirectCount glad_vkCmdDrawIndirectCount = NULL;
+PFN_vkCmdEndQuery glad_vkCmdEndQuery = NULL;
+PFN_vkCmdEndRenderPass glad_vkCmdEndRenderPass = NULL;
+PFN_vkCmdEndRenderPass2 glad_vkCmdEndRenderPass2 = NULL;
+PFN_vkCmdEndRendering glad_vkCmdEndRendering = NULL;
+PFN_vkCmdExecuteCommands glad_vkCmdExecuteCommands = NULL;
+PFN_vkCmdFillBuffer glad_vkCmdFillBuffer = NULL;
+PFN_vkCmdNextSubpass glad_vkCmdNextSubpass = NULL;
+PFN_vkCmdNextSubpass2 glad_vkCmdNextSubpass2 = NULL;
+PFN_vkCmdPipelineBarrier glad_vkCmdPipelineBarrier = NULL;
+PFN_vkCmdPipelineBarrier2 glad_vkCmdPipelineBarrier2 = NULL;
+PFN_vkCmdPushConstants glad_vkCmdPushConstants = NULL;
+PFN_vkCmdResetEvent glad_vkCmdResetEvent = NULL;
+PFN_vkCmdResetEvent2 glad_vkCmdResetEvent2 = NULL;
+PFN_vkCmdResetQueryPool glad_vkCmdResetQueryPool = NULL;
+PFN_vkCmdResolveImage glad_vkCmdResolveImage = NULL;
+PFN_vkCmdResolveImage2 glad_vkCmdResolveImage2 = NULL;
+PFN_vkCmdSetBlendConstants glad_vkCmdSetBlendConstants = NULL;
+PFN_vkCmdSetCullMode glad_vkCmdSetCullMode = NULL;
+PFN_vkCmdSetDepthBias glad_vkCmdSetDepthBias = NULL;
+PFN_vkCmdSetDepthBiasEnable glad_vkCmdSetDepthBiasEnable = NULL;
+PFN_vkCmdSetDepthBounds glad_vkCmdSetDepthBounds = NULL;
+PFN_vkCmdSetDepthBoundsTestEnable glad_vkCmdSetDepthBoundsTestEnable = NULL;
+PFN_vkCmdSetDepthCompareOp glad_vkCmdSetDepthCompareOp = NULL;
+PFN_vkCmdSetDepthTestEnable glad_vkCmdSetDepthTestEnable = NULL;
+PFN_vkCmdSetDepthWriteEnable glad_vkCmdSetDepthWriteEnable = NULL;
+PFN_vkCmdSetDeviceMask glad_vkCmdSetDeviceMask = NULL;
+PFN_vkCmdSetEvent glad_vkCmdSetEvent = NULL;
+PFN_vkCmdSetEvent2 glad_vkCmdSetEvent2 = NULL;
+PFN_vkCmdSetFrontFace glad_vkCmdSetFrontFace = NULL;
+PFN_vkCmdSetLineWidth glad_vkCmdSetLineWidth = NULL;
+PFN_vkCmdSetPrimitiveRestartEnable glad_vkCmdSetPrimitiveRestartEnable = NULL;
+PFN_vkCmdSetPrimitiveTopology glad_vkCmdSetPrimitiveTopology = NULL;
+PFN_vkCmdSetRasterizerDiscardEnable glad_vkCmdSetRasterizerDiscardEnable = NULL;
+PFN_vkCmdSetScissor glad_vkCmdSetScissor = NULL;
+PFN_vkCmdSetScissorWithCount glad_vkCmdSetScissorWithCount = NULL;
+PFN_vkCmdSetStencilCompareMask glad_vkCmdSetStencilCompareMask = NULL;
+PFN_vkCmdSetStencilOp glad_vkCmdSetStencilOp = NULL;
+PFN_vkCmdSetStencilReference glad_vkCmdSetStencilReference = NULL;
+PFN_vkCmdSetStencilTestEnable glad_vkCmdSetStencilTestEnable = NULL;
+PFN_vkCmdSetStencilWriteMask glad_vkCmdSetStencilWriteMask = NULL;
+PFN_vkCmdSetViewport glad_vkCmdSetViewport = NULL;
+PFN_vkCmdSetViewportWithCount glad_vkCmdSetViewportWithCount = NULL;
+PFN_vkCmdUpdateBuffer glad_vkCmdUpdateBuffer = NULL;
+PFN_vkCmdWaitEvents glad_vkCmdWaitEvents = NULL;
+PFN_vkCmdWaitEvents2 glad_vkCmdWaitEvents2 = NULL;
+PFN_vkCmdWriteTimestamp glad_vkCmdWriteTimestamp = NULL;
+PFN_vkCmdWriteTimestamp2 glad_vkCmdWriteTimestamp2 = NULL;
+PFN_vkCreateBuffer glad_vkCreateBuffer = NULL;
+PFN_vkCreateBufferView glad_vkCreateBufferView = NULL;
+PFN_vkCreateCommandPool glad_vkCreateCommandPool = NULL;
+PFN_vkCreateComputePipelines glad_vkCreateComputePipelines = NULL;
+PFN_vkCreateDebugReportCallbackEXT glad_vkCreateDebugReportCallbackEXT = NULL;
+PFN_vkCreateDescriptorPool glad_vkCreateDescriptorPool = NULL;
+PFN_vkCreateDescriptorSetLayout glad_vkCreateDescriptorSetLayout = NULL;
+PFN_vkCreateDescriptorUpdateTemplate glad_vkCreateDescriptorUpdateTemplate = NULL;
+PFN_vkCreateDevice glad_vkCreateDevice = NULL;
+PFN_vkCreateEvent glad_vkCreateEvent = NULL;
+PFN_vkCreateFence glad_vkCreateFence = NULL;
+PFN_vkCreateFramebuffer glad_vkCreateFramebuffer = NULL;
+PFN_vkCreateGraphicsPipelines glad_vkCreateGraphicsPipelines = NULL;
+PFN_vkCreateImage glad_vkCreateImage = NULL;
+PFN_vkCreateImageView glad_vkCreateImageView = NULL;
+PFN_vkCreateInstance glad_vkCreateInstance = NULL;
+PFN_vkCreatePipelineCache glad_vkCreatePipelineCache = NULL;
+PFN_vkCreatePipelineLayout glad_vkCreatePipelineLayout = NULL;
+PFN_vkCreatePrivateDataSlot glad_vkCreatePrivateDataSlot = NULL;
+PFN_vkCreateQueryPool glad_vkCreateQueryPool = NULL;
+PFN_vkCreateRenderPass glad_vkCreateRenderPass = NULL;
+PFN_vkCreateRenderPass2 glad_vkCreateRenderPass2 = NULL;
+PFN_vkCreateSampler glad_vkCreateSampler = NULL;
+PFN_vkCreateSamplerYcbcrConversion glad_vkCreateSamplerYcbcrConversion = NULL;
+PFN_vkCreateSemaphore glad_vkCreateSemaphore = NULL;
+PFN_vkCreateShaderModule glad_vkCreateShaderModule = NULL;
+PFN_vkCreateSwapchainKHR glad_vkCreateSwapchainKHR = NULL;
+PFN_vkDebugReportMessageEXT glad_vkDebugReportMessageEXT = NULL;
+PFN_vkDestroyBuffer glad_vkDestroyBuffer = NULL;
+PFN_vkDestroyBufferView glad_vkDestroyBufferView = NULL;
+PFN_vkDestroyCommandPool glad_vkDestroyCommandPool = NULL;
+PFN_vkDestroyDebugReportCallbackEXT glad_vkDestroyDebugReportCallbackEXT = NULL;
+PFN_vkDestroyDescriptorPool glad_vkDestroyDescriptorPool = NULL;
+PFN_vkDestroyDescriptorSetLayout glad_vkDestroyDescriptorSetLayout = NULL;
+PFN_vkDestroyDescriptorUpdateTemplate glad_vkDestroyDescriptorUpdateTemplate = NULL;
+PFN_vkDestroyDevice glad_vkDestroyDevice = NULL;
+PFN_vkDestroyEvent glad_vkDestroyEvent = NULL;
+PFN_vkDestroyFence glad_vkDestroyFence = NULL;
+PFN_vkDestroyFramebuffer glad_vkDestroyFramebuffer = NULL;
+PFN_vkDestroyImage glad_vkDestroyImage = NULL;
+PFN_vkDestroyImageView glad_vkDestroyImageView = NULL;
+PFN_vkDestroyInstance glad_vkDestroyInstance = NULL;
+PFN_vkDestroyPipeline glad_vkDestroyPipeline = NULL;
+PFN_vkDestroyPipelineCache glad_vkDestroyPipelineCache = NULL;
+PFN_vkDestroyPipelineLayout glad_vkDestroyPipelineLayout = NULL;
+PFN_vkDestroyPrivateDataSlot glad_vkDestroyPrivateDataSlot = NULL;
+PFN_vkDestroyQueryPool glad_vkDestroyQueryPool = NULL;
+PFN_vkDestroyRenderPass glad_vkDestroyRenderPass = NULL;
+PFN_vkDestroySampler glad_vkDestroySampler = NULL;
+PFN_vkDestroySamplerYcbcrConversion glad_vkDestroySamplerYcbcrConversion = NULL;
+PFN_vkDestroySemaphore glad_vkDestroySemaphore = NULL;
+PFN_vkDestroyShaderModule glad_vkDestroyShaderModule = NULL;
+PFN_vkDestroySurfaceKHR glad_vkDestroySurfaceKHR = NULL;
+PFN_vkDestroySwapchainKHR glad_vkDestroySwapchainKHR = NULL;
+PFN_vkDeviceWaitIdle glad_vkDeviceWaitIdle = NULL;
+PFN_vkEndCommandBuffer glad_vkEndCommandBuffer = NULL;
+PFN_vkEnumerateDeviceExtensionProperties glad_vkEnumerateDeviceExtensionProperties = NULL;
+PFN_vkEnumerateDeviceLayerProperties glad_vkEnumerateDeviceLayerProperties = NULL;
+PFN_vkEnumerateInstanceExtensionProperties glad_vkEnumerateInstanceExtensionProperties = NULL;
+PFN_vkEnumerateInstanceLayerProperties glad_vkEnumerateInstanceLayerProperties = NULL;
+PFN_vkEnumerateInstanceVersion glad_vkEnumerateInstanceVersion = NULL;
+PFN_vkEnumeratePhysicalDeviceGroups glad_vkEnumeratePhysicalDeviceGroups = NULL;
+PFN_vkEnumeratePhysicalDevices glad_vkEnumeratePhysicalDevices = NULL;
+PFN_vkFlushMappedMemoryRanges glad_vkFlushMappedMemoryRanges = NULL;
+PFN_vkFreeCommandBuffers glad_vkFreeCommandBuffers = NULL;
+PFN_vkFreeDescriptorSets glad_vkFreeDescriptorSets = NULL;
+PFN_vkFreeMemory glad_vkFreeMemory = NULL;
+PFN_vkGetBufferDeviceAddress glad_vkGetBufferDeviceAddress = NULL;
+PFN_vkGetBufferMemoryRequirements glad_vkGetBufferMemoryRequirements = NULL;
+PFN_vkGetBufferMemoryRequirements2 glad_vkGetBufferMemoryRequirements2 = NULL;
+PFN_vkGetBufferOpaqueCaptureAddress glad_vkGetBufferOpaqueCaptureAddress = NULL;
+PFN_vkGetDescriptorSetLayoutSupport glad_vkGetDescriptorSetLayoutSupport = NULL;
+PFN_vkGetDeviceBufferMemoryRequirements glad_vkGetDeviceBufferMemoryRequirements = NULL;
+PFN_vkGetDeviceGroupPeerMemoryFeatures glad_vkGetDeviceGroupPeerMemoryFeatures = NULL;
+PFN_vkGetDeviceGroupPresentCapabilitiesKHR glad_vkGetDeviceGroupPresentCapabilitiesKHR = NULL;
+PFN_vkGetDeviceGroupSurfacePresentModesKHR glad_vkGetDeviceGroupSurfacePresentModesKHR = NULL;
+PFN_vkGetDeviceImageMemoryRequirements glad_vkGetDeviceImageMemoryRequirements = NULL;
+PFN_vkGetDeviceImageSparseMemoryRequirements glad_vkGetDeviceImageSparseMemoryRequirements = NULL;
+PFN_vkGetDeviceMemoryCommitment glad_vkGetDeviceMemoryCommitment = NULL;
+PFN_vkGetDeviceMemoryOpaqueCaptureAddress glad_vkGetDeviceMemoryOpaqueCaptureAddress = NULL;
+PFN_vkGetDeviceProcAddr glad_vkGetDeviceProcAddr = NULL;
+PFN_vkGetDeviceQueue glad_vkGetDeviceQueue = NULL;
+PFN_vkGetDeviceQueue2 glad_vkGetDeviceQueue2 = NULL;
+PFN_vkGetEventStatus glad_vkGetEventStatus = NULL;
+PFN_vkGetFenceStatus glad_vkGetFenceStatus = NULL;
+PFN_vkGetImageMemoryRequirements glad_vkGetImageMemoryRequirements = NULL;
+PFN_vkGetImageMemoryRequirements2 glad_vkGetImageMemoryRequirements2 = NULL;
+PFN_vkGetImageSparseMemoryRequirements glad_vkGetImageSparseMemoryRequirements = NULL;
+PFN_vkGetImageSparseMemoryRequirements2 glad_vkGetImageSparseMemoryRequirements2 = NULL;
+PFN_vkGetImageSubresourceLayout glad_vkGetImageSubresourceLayout = NULL;
+PFN_vkGetInstanceProcAddr glad_vkGetInstanceProcAddr = NULL;
+PFN_vkGetPhysicalDeviceExternalBufferProperties glad_vkGetPhysicalDeviceExternalBufferProperties = NULL;
+PFN_vkGetPhysicalDeviceExternalFenceProperties glad_vkGetPhysicalDeviceExternalFenceProperties = NULL;
+PFN_vkGetPhysicalDeviceExternalSemaphoreProperties glad_vkGetPhysicalDeviceExternalSemaphoreProperties = NULL;
+PFN_vkGetPhysicalDeviceFeatures glad_vkGetPhysicalDeviceFeatures = NULL;
+PFN_vkGetPhysicalDeviceFeatures2 glad_vkGetPhysicalDeviceFeatures2 = NULL;
+PFN_vkGetPhysicalDeviceFormatProperties glad_vkGetPhysicalDeviceFormatProperties = NULL;
+PFN_vkGetPhysicalDeviceFormatProperties2 glad_vkGetPhysicalDeviceFormatProperties2 = NULL;
+PFN_vkGetPhysicalDeviceImageFormatProperties glad_vkGetPhysicalDeviceImageFormatProperties = NULL;
+PFN_vkGetPhysicalDeviceImageFormatProperties2 glad_vkGetPhysicalDeviceImageFormatProperties2 = NULL;
+PFN_vkGetPhysicalDeviceMemoryProperties glad_vkGetPhysicalDeviceMemoryProperties = NULL;
+PFN_vkGetPhysicalDeviceMemoryProperties2 glad_vkGetPhysicalDeviceMemoryProperties2 = NULL;
+PFN_vkGetPhysicalDevicePresentRectanglesKHR glad_vkGetPhysicalDevicePresentRectanglesKHR = NULL;
+PFN_vkGetPhysicalDeviceProperties glad_vkGetPhysicalDeviceProperties = NULL;
+PFN_vkGetPhysicalDeviceProperties2 glad_vkGetPhysicalDeviceProperties2 = NULL;
+PFN_vkGetPhysicalDeviceQueueFamilyProperties glad_vkGetPhysicalDeviceQueueFamilyProperties = NULL;
+PFN_vkGetPhysicalDeviceQueueFamilyProperties2 glad_vkGetPhysicalDeviceQueueFamilyProperties2 = NULL;
+PFN_vkGetPhysicalDeviceSparseImageFormatProperties glad_vkGetPhysicalDeviceSparseImageFormatProperties = NULL;
+PFN_vkGetPhysicalDeviceSparseImageFormatProperties2 glad_vkGetPhysicalDeviceSparseImageFormatProperties2 = NULL;
+PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR glad_vkGetPhysicalDeviceSurfaceCapabilitiesKHR = NULL;
+PFN_vkGetPhysicalDeviceSurfaceFormatsKHR glad_vkGetPhysicalDeviceSurfaceFormatsKHR = NULL;
+PFN_vkGetPhysicalDeviceSurfacePresentModesKHR glad_vkGetPhysicalDeviceSurfacePresentModesKHR = NULL;
+PFN_vkGetPhysicalDeviceSurfaceSupportKHR glad_vkGetPhysicalDeviceSurfaceSupportKHR = NULL;
+PFN_vkGetPhysicalDeviceToolProperties glad_vkGetPhysicalDeviceToolProperties = NULL;
+PFN_vkGetPipelineCacheData glad_vkGetPipelineCacheData = NULL;
+PFN_vkGetPrivateData glad_vkGetPrivateData = NULL;
+PFN_vkGetQueryPoolResults glad_vkGetQueryPoolResults = NULL;
+PFN_vkGetRenderAreaGranularity glad_vkGetRenderAreaGranularity = NULL;
+PFN_vkGetSemaphoreCounterValue glad_vkGetSemaphoreCounterValue = NULL;
+PFN_vkGetSwapchainImagesKHR glad_vkGetSwapchainImagesKHR = NULL;
+PFN_vkInvalidateMappedMemoryRanges glad_vkInvalidateMappedMemoryRanges = NULL;
+PFN_vkMapMemory glad_vkMapMemory = NULL;
+PFN_vkMergePipelineCaches glad_vkMergePipelineCaches = NULL;
+PFN_vkQueueBindSparse glad_vkQueueBindSparse = NULL;
+PFN_vkQueuePresentKHR glad_vkQueuePresentKHR = NULL;
+PFN_vkQueueSubmit glad_vkQueueSubmit = NULL;
+PFN_vkQueueSubmit2 glad_vkQueueSubmit2 = NULL;
+PFN_vkQueueWaitIdle glad_vkQueueWaitIdle = NULL;
+PFN_vkResetCommandBuffer glad_vkResetCommandBuffer = NULL;
+PFN_vkResetCommandPool glad_vkResetCommandPool = NULL;
+PFN_vkResetDescriptorPool glad_vkResetDescriptorPool = NULL;
+PFN_vkResetEvent glad_vkResetEvent = NULL;
+PFN_vkResetFences glad_vkResetFences = NULL;
+PFN_vkResetQueryPool glad_vkResetQueryPool = NULL;
+PFN_vkSetEvent glad_vkSetEvent = NULL;
+PFN_vkSetPrivateData glad_vkSetPrivateData = NULL;
+PFN_vkSignalSemaphore glad_vkSignalSemaphore = NULL;
+PFN_vkTrimCommandPool glad_vkTrimCommandPool = NULL;
+PFN_vkUnmapMemory glad_vkUnmapMemory = NULL;
+PFN_vkUpdateDescriptorSetWithTemplate glad_vkUpdateDescriptorSetWithTemplate = NULL;
+PFN_vkUpdateDescriptorSets glad_vkUpdateDescriptorSets = NULL;
+PFN_vkWaitForFences glad_vkWaitForFences = NULL;
+PFN_vkWaitSemaphores glad_vkWaitSemaphores = NULL;
+
+
+static void glad_vk_load_VK_VERSION_1_0( GLADuserptrloadfunc load, void* userptr) {
+ if(!GLAD_VK_VERSION_1_0) return;
+ glad_vkAllocateCommandBuffers = (PFN_vkAllocateCommandBuffers) load(userptr, "vkAllocateCommandBuffers");
+ glad_vkAllocateDescriptorSets = (PFN_vkAllocateDescriptorSets) load(userptr, "vkAllocateDescriptorSets");
+ glad_vkAllocateMemory = (PFN_vkAllocateMemory) load(userptr, "vkAllocateMemory");
+ glad_vkBeginCommandBuffer = (PFN_vkBeginCommandBuffer) load(userptr, "vkBeginCommandBuffer");
+ glad_vkBindBufferMemory = (PFN_vkBindBufferMemory) load(userptr, "vkBindBufferMemory");
+ glad_vkBindImageMemory = (PFN_vkBindImageMemory) load(userptr, "vkBindImageMemory");
+ glad_vkCmdBeginQuery = (PFN_vkCmdBeginQuery) load(userptr, "vkCmdBeginQuery");
+ glad_vkCmdBeginRenderPass = (PFN_vkCmdBeginRenderPass) load(userptr, "vkCmdBeginRenderPass");
+ glad_vkCmdBindDescriptorSets = (PFN_vkCmdBindDescriptorSets) load(userptr, "vkCmdBindDescriptorSets");
+ glad_vkCmdBindIndexBuffer = (PFN_vkCmdBindIndexBuffer) load(userptr, "vkCmdBindIndexBuffer");
+ glad_vkCmdBindPipeline = (PFN_vkCmdBindPipeline) load(userptr, "vkCmdBindPipeline");
+ glad_vkCmdBindVertexBuffers = (PFN_vkCmdBindVertexBuffers) load(userptr, "vkCmdBindVertexBuffers");
+ glad_vkCmdBlitImage = (PFN_vkCmdBlitImage) load(userptr, "vkCmdBlitImage");
+ glad_vkCmdClearAttachments = (PFN_vkCmdClearAttachments) load(userptr, "vkCmdClearAttachments");
+ glad_vkCmdClearColorImage = (PFN_vkCmdClearColorImage) load(userptr, "vkCmdClearColorImage");
+ glad_vkCmdClearDepthStencilImage = (PFN_vkCmdClearDepthStencilImage) load(userptr, "vkCmdClearDepthStencilImage");
+ glad_vkCmdCopyBuffer = (PFN_vkCmdCopyBuffer) load(userptr, "vkCmdCopyBuffer");
+ glad_vkCmdCopyBufferToImage = (PFN_vkCmdCopyBufferToImage) load(userptr, "vkCmdCopyBufferToImage");
+ glad_vkCmdCopyImage = (PFN_vkCmdCopyImage) load(userptr, "vkCmdCopyImage");
+ glad_vkCmdCopyImageToBuffer = (PFN_vkCmdCopyImageToBuffer) load(userptr, "vkCmdCopyImageToBuffer");
+ glad_vkCmdCopyQueryPoolResults = (PFN_vkCmdCopyQueryPoolResults) load(userptr, "vkCmdCopyQueryPoolResults");
+ glad_vkCmdDispatch = (PFN_vkCmdDispatch) load(userptr, "vkCmdDispatch");
+ glad_vkCmdDispatchIndirect = (PFN_vkCmdDispatchIndirect) load(userptr, "vkCmdDispatchIndirect");
+ glad_vkCmdDraw = (PFN_vkCmdDraw) load(userptr, "vkCmdDraw");
+ glad_vkCmdDrawIndexed = (PFN_vkCmdDrawIndexed) load(userptr, "vkCmdDrawIndexed");
+ glad_vkCmdDrawIndexedIndirect = (PFN_vkCmdDrawIndexedIndirect) load(userptr, "vkCmdDrawIndexedIndirect");
+ glad_vkCmdDrawIndirect = (PFN_vkCmdDrawIndirect) load(userptr, "vkCmdDrawIndirect");
+ glad_vkCmdEndQuery = (PFN_vkCmdEndQuery) load(userptr, "vkCmdEndQuery");
+ glad_vkCmdEndRenderPass = (PFN_vkCmdEndRenderPass) load(userptr, "vkCmdEndRenderPass");
+ glad_vkCmdExecuteCommands = (PFN_vkCmdExecuteCommands) load(userptr, "vkCmdExecuteCommands");
+ glad_vkCmdFillBuffer = (PFN_vkCmdFillBuffer) load(userptr, "vkCmdFillBuffer");
+ glad_vkCmdNextSubpass = (PFN_vkCmdNextSubpass) load(userptr, "vkCmdNextSubpass");
+ glad_vkCmdPipelineBarrier = (PFN_vkCmdPipelineBarrier) load(userptr, "vkCmdPipelineBarrier");
+ glad_vkCmdPushConstants = (PFN_vkCmdPushConstants) load(userptr, "vkCmdPushConstants");
+ glad_vkCmdResetEvent = (PFN_vkCmdResetEvent) load(userptr, "vkCmdResetEvent");
+ glad_vkCmdResetQueryPool = (PFN_vkCmdResetQueryPool) load(userptr, "vkCmdResetQueryPool");
+ glad_vkCmdResolveImage = (PFN_vkCmdResolveImage) load(userptr, "vkCmdResolveImage");
+ glad_vkCmdSetBlendConstants = (PFN_vkCmdSetBlendConstants) load(userptr, "vkCmdSetBlendConstants");
+ glad_vkCmdSetDepthBias = (PFN_vkCmdSetDepthBias) load(userptr, "vkCmdSetDepthBias");
+ glad_vkCmdSetDepthBounds = (PFN_vkCmdSetDepthBounds) load(userptr, "vkCmdSetDepthBounds");
+ glad_vkCmdSetEvent = (PFN_vkCmdSetEvent) load(userptr, "vkCmdSetEvent");
+ glad_vkCmdSetLineWidth = (PFN_vkCmdSetLineWidth) load(userptr, "vkCmdSetLineWidth");
+ glad_vkCmdSetScissor = (PFN_vkCmdSetScissor) load(userptr, "vkCmdSetScissor");
+ glad_vkCmdSetStencilCompareMask = (PFN_vkCmdSetStencilCompareMask) load(userptr, "vkCmdSetStencilCompareMask");
+ glad_vkCmdSetStencilReference = (PFN_vkCmdSetStencilReference) load(userptr, "vkCmdSetStencilReference");
+ glad_vkCmdSetStencilWriteMask = (PFN_vkCmdSetStencilWriteMask) load(userptr, "vkCmdSetStencilWriteMask");
+ glad_vkCmdSetViewport = (PFN_vkCmdSetViewport) load(userptr, "vkCmdSetViewport");
+ glad_vkCmdUpdateBuffer = (PFN_vkCmdUpdateBuffer) load(userptr, "vkCmdUpdateBuffer");
+ glad_vkCmdWaitEvents = (PFN_vkCmdWaitEvents) load(userptr, "vkCmdWaitEvents");
+ glad_vkCmdWriteTimestamp = (PFN_vkCmdWriteTimestamp) load(userptr, "vkCmdWriteTimestamp");
+ glad_vkCreateBuffer = (PFN_vkCreateBuffer) load(userptr, "vkCreateBuffer");
+ glad_vkCreateBufferView = (PFN_vkCreateBufferView) load(userptr, "vkCreateBufferView");
+ glad_vkCreateCommandPool = (PFN_vkCreateCommandPool) load(userptr, "vkCreateCommandPool");
+ glad_vkCreateComputePipelines = (PFN_vkCreateComputePipelines) load(userptr, "vkCreateComputePipelines");
+ glad_vkCreateDescriptorPool = (PFN_vkCreateDescriptorPool) load(userptr, "vkCreateDescriptorPool");
+ glad_vkCreateDescriptorSetLayout = (PFN_vkCreateDescriptorSetLayout) load(userptr, "vkCreateDescriptorSetLayout");
+ glad_vkCreateDevice = (PFN_vkCreateDevice) load(userptr, "vkCreateDevice");
+ glad_vkCreateEvent = (PFN_vkCreateEvent) load(userptr, "vkCreateEvent");
+ glad_vkCreateFence = (PFN_vkCreateFence) load(userptr, "vkCreateFence");
+ glad_vkCreateFramebuffer = (PFN_vkCreateFramebuffer) load(userptr, "vkCreateFramebuffer");
+ glad_vkCreateGraphicsPipelines = (PFN_vkCreateGraphicsPipelines) load(userptr, "vkCreateGraphicsPipelines");
+ glad_vkCreateImage = (PFN_vkCreateImage) load(userptr, "vkCreateImage");
+ glad_vkCreateImageView = (PFN_vkCreateImageView) load(userptr, "vkCreateImageView");
+ glad_vkCreateInstance = (PFN_vkCreateInstance) load(userptr, "vkCreateInstance");
+ glad_vkCreatePipelineCache = (PFN_vkCreatePipelineCache) load(userptr, "vkCreatePipelineCache");
+ glad_vkCreatePipelineLayout = (PFN_vkCreatePipelineLayout) load(userptr, "vkCreatePipelineLayout");
+ glad_vkCreateQueryPool = (PFN_vkCreateQueryPool) load(userptr, "vkCreateQueryPool");
+ glad_vkCreateRenderPass = (PFN_vkCreateRenderPass) load(userptr, "vkCreateRenderPass");
+ glad_vkCreateSampler = (PFN_vkCreateSampler) load(userptr, "vkCreateSampler");
+ glad_vkCreateSemaphore = (PFN_vkCreateSemaphore) load(userptr, "vkCreateSemaphore");
+ glad_vkCreateShaderModule = (PFN_vkCreateShaderModule) load(userptr, "vkCreateShaderModule");
+ glad_vkDestroyBuffer = (PFN_vkDestroyBuffer) load(userptr, "vkDestroyBuffer");
+ glad_vkDestroyBufferView = (PFN_vkDestroyBufferView) load(userptr, "vkDestroyBufferView");
+ glad_vkDestroyCommandPool = (PFN_vkDestroyCommandPool) load(userptr, "vkDestroyCommandPool");
+ glad_vkDestroyDescriptorPool = (PFN_vkDestroyDescriptorPool) load(userptr, "vkDestroyDescriptorPool");
+ glad_vkDestroyDescriptorSetLayout = (PFN_vkDestroyDescriptorSetLayout) load(userptr, "vkDestroyDescriptorSetLayout");
+ glad_vkDestroyDevice = (PFN_vkDestroyDevice) load(userptr, "vkDestroyDevice");
+ glad_vkDestroyEvent = (PFN_vkDestroyEvent) load(userptr, "vkDestroyEvent");
+ glad_vkDestroyFence = (PFN_vkDestroyFence) load(userptr, "vkDestroyFence");
+ glad_vkDestroyFramebuffer = (PFN_vkDestroyFramebuffer) load(userptr, "vkDestroyFramebuffer");
+ glad_vkDestroyImage = (PFN_vkDestroyImage) load(userptr, "vkDestroyImage");
+ glad_vkDestroyImageView = (PFN_vkDestroyImageView) load(userptr, "vkDestroyImageView");
+ glad_vkDestroyInstance = (PFN_vkDestroyInstance) load(userptr, "vkDestroyInstance");
+ glad_vkDestroyPipeline = (PFN_vkDestroyPipeline) load(userptr, "vkDestroyPipeline");
+ glad_vkDestroyPipelineCache = (PFN_vkDestroyPipelineCache) load(userptr, "vkDestroyPipelineCache");
+ glad_vkDestroyPipelineLayout = (PFN_vkDestroyPipelineLayout) load(userptr, "vkDestroyPipelineLayout");
+ glad_vkDestroyQueryPool = (PFN_vkDestroyQueryPool) load(userptr, "vkDestroyQueryPool");
+ glad_vkDestroyRenderPass = (PFN_vkDestroyRenderPass) load(userptr, "vkDestroyRenderPass");
+ glad_vkDestroySampler = (PFN_vkDestroySampler) load(userptr, "vkDestroySampler");
+ glad_vkDestroySemaphore = (PFN_vkDestroySemaphore) load(userptr, "vkDestroySemaphore");
+ glad_vkDestroyShaderModule = (PFN_vkDestroyShaderModule) load(userptr, "vkDestroyShaderModule");
+ glad_vkDeviceWaitIdle = (PFN_vkDeviceWaitIdle) load(userptr, "vkDeviceWaitIdle");
+ glad_vkEndCommandBuffer = (PFN_vkEndCommandBuffer) load(userptr, "vkEndCommandBuffer");
+ glad_vkEnumerateDeviceExtensionProperties = (PFN_vkEnumerateDeviceExtensionProperties) load(userptr, "vkEnumerateDeviceExtensionProperties");
+ glad_vkEnumerateDeviceLayerProperties = (PFN_vkEnumerateDeviceLayerProperties) load(userptr, "vkEnumerateDeviceLayerProperties");
+ glad_vkEnumerateInstanceExtensionProperties = (PFN_vkEnumerateInstanceExtensionProperties) load(userptr, "vkEnumerateInstanceExtensionProperties");
+ glad_vkEnumerateInstanceLayerProperties = (PFN_vkEnumerateInstanceLayerProperties) load(userptr, "vkEnumerateInstanceLayerProperties");
+ glad_vkEnumeratePhysicalDevices = (PFN_vkEnumeratePhysicalDevices) load(userptr, "vkEnumeratePhysicalDevices");
+ glad_vkFlushMappedMemoryRanges = (PFN_vkFlushMappedMemoryRanges) load(userptr, "vkFlushMappedMemoryRanges");
+ glad_vkFreeCommandBuffers = (PFN_vkFreeCommandBuffers) load(userptr, "vkFreeCommandBuffers");
+ glad_vkFreeDescriptorSets = (PFN_vkFreeDescriptorSets) load(userptr, "vkFreeDescriptorSets");
+ glad_vkFreeMemory = (PFN_vkFreeMemory) load(userptr, "vkFreeMemory");
+ glad_vkGetBufferMemoryRequirements = (PFN_vkGetBufferMemoryRequirements) load(userptr, "vkGetBufferMemoryRequirements");
+ glad_vkGetDeviceMemoryCommitment = (PFN_vkGetDeviceMemoryCommitment) load(userptr, "vkGetDeviceMemoryCommitment");
+ glad_vkGetDeviceProcAddr = (PFN_vkGetDeviceProcAddr) load(userptr, "vkGetDeviceProcAddr");
+ glad_vkGetDeviceQueue = (PFN_vkGetDeviceQueue) load(userptr, "vkGetDeviceQueue");
+ glad_vkGetEventStatus = (PFN_vkGetEventStatus) load(userptr, "vkGetEventStatus");
+ glad_vkGetFenceStatus = (PFN_vkGetFenceStatus) load(userptr, "vkGetFenceStatus");
+ glad_vkGetImageMemoryRequirements = (PFN_vkGetImageMemoryRequirements) load(userptr, "vkGetImageMemoryRequirements");
+ glad_vkGetImageSparseMemoryRequirements = (PFN_vkGetImageSparseMemoryRequirements) load(userptr, "vkGetImageSparseMemoryRequirements");
+ glad_vkGetImageSubresourceLayout = (PFN_vkGetImageSubresourceLayout) load(userptr, "vkGetImageSubresourceLayout");
+ glad_vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr) load(userptr, "vkGetInstanceProcAddr");
+ glad_vkGetPhysicalDeviceFeatures = (PFN_vkGetPhysicalDeviceFeatures) load(userptr, "vkGetPhysicalDeviceFeatures");
+ glad_vkGetPhysicalDeviceFormatProperties = (PFN_vkGetPhysicalDeviceFormatProperties) load(userptr, "vkGetPhysicalDeviceFormatProperties");
+ glad_vkGetPhysicalDeviceImageFormatProperties = (PFN_vkGetPhysicalDeviceImageFormatProperties) load(userptr, "vkGetPhysicalDeviceImageFormatProperties");
+ glad_vkGetPhysicalDeviceMemoryProperties = (PFN_vkGetPhysicalDeviceMemoryProperties) load(userptr, "vkGetPhysicalDeviceMemoryProperties");
+ glad_vkGetPhysicalDeviceProperties = (PFN_vkGetPhysicalDeviceProperties) load(userptr, "vkGetPhysicalDeviceProperties");
+ glad_vkGetPhysicalDeviceQueueFamilyProperties = (PFN_vkGetPhysicalDeviceQueueFamilyProperties) load(userptr, "vkGetPhysicalDeviceQueueFamilyProperties");
+ glad_vkGetPhysicalDeviceSparseImageFormatProperties = (PFN_vkGetPhysicalDeviceSparseImageFormatProperties) load(userptr, "vkGetPhysicalDeviceSparseImageFormatProperties");
+ glad_vkGetPipelineCacheData = (PFN_vkGetPipelineCacheData) load(userptr, "vkGetPipelineCacheData");
+ glad_vkGetQueryPoolResults = (PFN_vkGetQueryPoolResults) load(userptr, "vkGetQueryPoolResults");
+ glad_vkGetRenderAreaGranularity = (PFN_vkGetRenderAreaGranularity) load(userptr, "vkGetRenderAreaGranularity");
+ glad_vkInvalidateMappedMemoryRanges = (PFN_vkInvalidateMappedMemoryRanges) load(userptr, "vkInvalidateMappedMemoryRanges");
+ glad_vkMapMemory = (PFN_vkMapMemory) load(userptr, "vkMapMemory");
+ glad_vkMergePipelineCaches = (PFN_vkMergePipelineCaches) load(userptr, "vkMergePipelineCaches");
+ glad_vkQueueBindSparse = (PFN_vkQueueBindSparse) load(userptr, "vkQueueBindSparse");
+ glad_vkQueueSubmit = (PFN_vkQueueSubmit) load(userptr, "vkQueueSubmit");
+ glad_vkQueueWaitIdle = (PFN_vkQueueWaitIdle) load(userptr, "vkQueueWaitIdle");
+ glad_vkResetCommandBuffer = (PFN_vkResetCommandBuffer) load(userptr, "vkResetCommandBuffer");
+ glad_vkResetCommandPool = (PFN_vkResetCommandPool) load(userptr, "vkResetCommandPool");
+ glad_vkResetDescriptorPool = (PFN_vkResetDescriptorPool) load(userptr, "vkResetDescriptorPool");
+ glad_vkResetEvent = (PFN_vkResetEvent) load(userptr, "vkResetEvent");
+ glad_vkResetFences = (PFN_vkResetFences) load(userptr, "vkResetFences");
+ glad_vkSetEvent = (PFN_vkSetEvent) load(userptr, "vkSetEvent");
+ glad_vkUnmapMemory = (PFN_vkUnmapMemory) load(userptr, "vkUnmapMemory");
+ glad_vkUpdateDescriptorSets = (PFN_vkUpdateDescriptorSets) load(userptr, "vkUpdateDescriptorSets");
+ glad_vkWaitForFences = (PFN_vkWaitForFences) load(userptr, "vkWaitForFences");
+}
+static void glad_vk_load_VK_VERSION_1_1( GLADuserptrloadfunc load, void* userptr) {
+ if(!GLAD_VK_VERSION_1_1) return;
+ glad_vkBindBufferMemory2 = (PFN_vkBindBufferMemory2) load(userptr, "vkBindBufferMemory2");
+ glad_vkBindImageMemory2 = (PFN_vkBindImageMemory2) load(userptr, "vkBindImageMemory2");
+ glad_vkCmdDispatchBase = (PFN_vkCmdDispatchBase) load(userptr, "vkCmdDispatchBase");
+ glad_vkCmdSetDeviceMask = (PFN_vkCmdSetDeviceMask) load(userptr, "vkCmdSetDeviceMask");
+ glad_vkCreateDescriptorUpdateTemplate = (PFN_vkCreateDescriptorUpdateTemplate) load(userptr, "vkCreateDescriptorUpdateTemplate");
+ glad_vkCreateSamplerYcbcrConversion = (PFN_vkCreateSamplerYcbcrConversion) load(userptr, "vkCreateSamplerYcbcrConversion");
+ glad_vkDestroyDescriptorUpdateTemplate = (PFN_vkDestroyDescriptorUpdateTemplate) load(userptr, "vkDestroyDescriptorUpdateTemplate");
+ glad_vkDestroySamplerYcbcrConversion = (PFN_vkDestroySamplerYcbcrConversion) load(userptr, "vkDestroySamplerYcbcrConversion");
+ glad_vkEnumerateInstanceVersion = (PFN_vkEnumerateInstanceVersion) load(userptr, "vkEnumerateInstanceVersion");
+ glad_vkEnumeratePhysicalDeviceGroups = (PFN_vkEnumeratePhysicalDeviceGroups) load(userptr, "vkEnumeratePhysicalDeviceGroups");
+ glad_vkGetBufferMemoryRequirements2 = (PFN_vkGetBufferMemoryRequirements2) load(userptr, "vkGetBufferMemoryRequirements2");
+ glad_vkGetDescriptorSetLayoutSupport = (PFN_vkGetDescriptorSetLayoutSupport) load(userptr, "vkGetDescriptorSetLayoutSupport");
+ glad_vkGetDeviceGroupPeerMemoryFeatures = (PFN_vkGetDeviceGroupPeerMemoryFeatures) load(userptr, "vkGetDeviceGroupPeerMemoryFeatures");
+ glad_vkGetDeviceQueue2 = (PFN_vkGetDeviceQueue2) load(userptr, "vkGetDeviceQueue2");
+ glad_vkGetImageMemoryRequirements2 = (PFN_vkGetImageMemoryRequirements2) load(userptr, "vkGetImageMemoryRequirements2");
+ glad_vkGetImageSparseMemoryRequirements2 = (PFN_vkGetImageSparseMemoryRequirements2) load(userptr, "vkGetImageSparseMemoryRequirements2");
+ glad_vkGetPhysicalDeviceExternalBufferProperties = (PFN_vkGetPhysicalDeviceExternalBufferProperties) load(userptr, "vkGetPhysicalDeviceExternalBufferProperties");
+ glad_vkGetPhysicalDeviceExternalFenceProperties = (PFN_vkGetPhysicalDeviceExternalFenceProperties) load(userptr, "vkGetPhysicalDeviceExternalFenceProperties");
+ glad_vkGetPhysicalDeviceExternalSemaphoreProperties = (PFN_vkGetPhysicalDeviceExternalSemaphoreProperties) load(userptr, "vkGetPhysicalDeviceExternalSemaphoreProperties");
+ glad_vkGetPhysicalDeviceFeatures2 = (PFN_vkGetPhysicalDeviceFeatures2) load(userptr, "vkGetPhysicalDeviceFeatures2");
+ glad_vkGetPhysicalDeviceFormatProperties2 = (PFN_vkGetPhysicalDeviceFormatProperties2) load(userptr, "vkGetPhysicalDeviceFormatProperties2");
+ glad_vkGetPhysicalDeviceImageFormatProperties2 = (PFN_vkGetPhysicalDeviceImageFormatProperties2) load(userptr, "vkGetPhysicalDeviceImageFormatProperties2");
+ glad_vkGetPhysicalDeviceMemoryProperties2 = (PFN_vkGetPhysicalDeviceMemoryProperties2) load(userptr, "vkGetPhysicalDeviceMemoryProperties2");
+ glad_vkGetPhysicalDeviceProperties2 = (PFN_vkGetPhysicalDeviceProperties2) load(userptr, "vkGetPhysicalDeviceProperties2");
+ glad_vkGetPhysicalDeviceQueueFamilyProperties2 = (PFN_vkGetPhysicalDeviceQueueFamilyProperties2) load(userptr, "vkGetPhysicalDeviceQueueFamilyProperties2");
+ glad_vkGetPhysicalDeviceSparseImageFormatProperties2 = (PFN_vkGetPhysicalDeviceSparseImageFormatProperties2) load(userptr, "vkGetPhysicalDeviceSparseImageFormatProperties2");
+ glad_vkTrimCommandPool = (PFN_vkTrimCommandPool) load(userptr, "vkTrimCommandPool");
+ glad_vkUpdateDescriptorSetWithTemplate = (PFN_vkUpdateDescriptorSetWithTemplate) load(userptr, "vkUpdateDescriptorSetWithTemplate");
+}
+static void glad_vk_load_VK_VERSION_1_2( GLADuserptrloadfunc load, void* userptr) {
+ if(!GLAD_VK_VERSION_1_2) return;
+ glad_vkCmdBeginRenderPass2 = (PFN_vkCmdBeginRenderPass2) load(userptr, "vkCmdBeginRenderPass2");
+ glad_vkCmdDrawIndexedIndirectCount = (PFN_vkCmdDrawIndexedIndirectCount) load(userptr, "vkCmdDrawIndexedIndirectCount");
+ glad_vkCmdDrawIndirectCount = (PFN_vkCmdDrawIndirectCount) load(userptr, "vkCmdDrawIndirectCount");
+ glad_vkCmdEndRenderPass2 = (PFN_vkCmdEndRenderPass2) load(userptr, "vkCmdEndRenderPass2");
+ glad_vkCmdNextSubpass2 = (PFN_vkCmdNextSubpass2) load(userptr, "vkCmdNextSubpass2");
+ glad_vkCreateRenderPass2 = (PFN_vkCreateRenderPass2) load(userptr, "vkCreateRenderPass2");
+ glad_vkGetBufferDeviceAddress = (PFN_vkGetBufferDeviceAddress) load(userptr, "vkGetBufferDeviceAddress");
+ glad_vkGetBufferOpaqueCaptureAddress = (PFN_vkGetBufferOpaqueCaptureAddress) load(userptr, "vkGetBufferOpaqueCaptureAddress");
+ glad_vkGetDeviceMemoryOpaqueCaptureAddress = (PFN_vkGetDeviceMemoryOpaqueCaptureAddress) load(userptr, "vkGetDeviceMemoryOpaqueCaptureAddress");
+ glad_vkGetSemaphoreCounterValue = (PFN_vkGetSemaphoreCounterValue) load(userptr, "vkGetSemaphoreCounterValue");
+ glad_vkResetQueryPool = (PFN_vkResetQueryPool) load(userptr, "vkResetQueryPool");
+ glad_vkSignalSemaphore = (PFN_vkSignalSemaphore) load(userptr, "vkSignalSemaphore");
+ glad_vkWaitSemaphores = (PFN_vkWaitSemaphores) load(userptr, "vkWaitSemaphores");
+}
+static void glad_vk_load_VK_VERSION_1_3( GLADuserptrloadfunc load, void* userptr) {
+ if(!GLAD_VK_VERSION_1_3) return;
+ glad_vkCmdBeginRendering = (PFN_vkCmdBeginRendering) load(userptr, "vkCmdBeginRendering");
+ glad_vkCmdBindVertexBuffers2 = (PFN_vkCmdBindVertexBuffers2) load(userptr, "vkCmdBindVertexBuffers2");
+ glad_vkCmdBlitImage2 = (PFN_vkCmdBlitImage2) load(userptr, "vkCmdBlitImage2");
+ glad_vkCmdCopyBuffer2 = (PFN_vkCmdCopyBuffer2) load(userptr, "vkCmdCopyBuffer2");
+ glad_vkCmdCopyBufferToImage2 = (PFN_vkCmdCopyBufferToImage2) load(userptr, "vkCmdCopyBufferToImage2");
+ glad_vkCmdCopyImage2 = (PFN_vkCmdCopyImage2) load(userptr, "vkCmdCopyImage2");
+ glad_vkCmdCopyImageToBuffer2 = (PFN_vkCmdCopyImageToBuffer2) load(userptr, "vkCmdCopyImageToBuffer2");
+ glad_vkCmdEndRendering = (PFN_vkCmdEndRendering) load(userptr, "vkCmdEndRendering");
+ glad_vkCmdPipelineBarrier2 = (PFN_vkCmdPipelineBarrier2) load(userptr, "vkCmdPipelineBarrier2");
+ glad_vkCmdResetEvent2 = (PFN_vkCmdResetEvent2) load(userptr, "vkCmdResetEvent2");
+ glad_vkCmdResolveImage2 = (PFN_vkCmdResolveImage2) load(userptr, "vkCmdResolveImage2");
+ glad_vkCmdSetCullMode = (PFN_vkCmdSetCullMode) load(userptr, "vkCmdSetCullMode");
+ glad_vkCmdSetDepthBiasEnable = (PFN_vkCmdSetDepthBiasEnable) load(userptr, "vkCmdSetDepthBiasEnable");
+ glad_vkCmdSetDepthBoundsTestEnable = (PFN_vkCmdSetDepthBoundsTestEnable) load(userptr, "vkCmdSetDepthBoundsTestEnable");
+ glad_vkCmdSetDepthCompareOp = (PFN_vkCmdSetDepthCompareOp) load(userptr, "vkCmdSetDepthCompareOp");
+ glad_vkCmdSetDepthTestEnable = (PFN_vkCmdSetDepthTestEnable) load(userptr, "vkCmdSetDepthTestEnable");
+ glad_vkCmdSetDepthWriteEnable = (PFN_vkCmdSetDepthWriteEnable) load(userptr, "vkCmdSetDepthWriteEnable");
+ glad_vkCmdSetEvent2 = (PFN_vkCmdSetEvent2) load(userptr, "vkCmdSetEvent2");
+ glad_vkCmdSetFrontFace = (PFN_vkCmdSetFrontFace) load(userptr, "vkCmdSetFrontFace");
+ glad_vkCmdSetPrimitiveRestartEnable = (PFN_vkCmdSetPrimitiveRestartEnable) load(userptr, "vkCmdSetPrimitiveRestartEnable");
+ glad_vkCmdSetPrimitiveTopology = (PFN_vkCmdSetPrimitiveTopology) load(userptr, "vkCmdSetPrimitiveTopology");
+ glad_vkCmdSetRasterizerDiscardEnable = (PFN_vkCmdSetRasterizerDiscardEnable) load(userptr, "vkCmdSetRasterizerDiscardEnable");
+ glad_vkCmdSetScissorWithCount = (PFN_vkCmdSetScissorWithCount) load(userptr, "vkCmdSetScissorWithCount");
+ glad_vkCmdSetStencilOp = (PFN_vkCmdSetStencilOp) load(userptr, "vkCmdSetStencilOp");
+ glad_vkCmdSetStencilTestEnable = (PFN_vkCmdSetStencilTestEnable) load(userptr, "vkCmdSetStencilTestEnable");
+ glad_vkCmdSetViewportWithCount = (PFN_vkCmdSetViewportWithCount) load(userptr, "vkCmdSetViewportWithCount");
+ glad_vkCmdWaitEvents2 = (PFN_vkCmdWaitEvents2) load(userptr, "vkCmdWaitEvents2");
+ glad_vkCmdWriteTimestamp2 = (PFN_vkCmdWriteTimestamp2) load(userptr, "vkCmdWriteTimestamp2");
+ glad_vkCreatePrivateDataSlot = (PFN_vkCreatePrivateDataSlot) load(userptr, "vkCreatePrivateDataSlot");
+ glad_vkDestroyPrivateDataSlot = (PFN_vkDestroyPrivateDataSlot) load(userptr, "vkDestroyPrivateDataSlot");
+ glad_vkGetDeviceBufferMemoryRequirements = (PFN_vkGetDeviceBufferMemoryRequirements) load(userptr, "vkGetDeviceBufferMemoryRequirements");
+ glad_vkGetDeviceImageMemoryRequirements = (PFN_vkGetDeviceImageMemoryRequirements) load(userptr, "vkGetDeviceImageMemoryRequirements");
+ glad_vkGetDeviceImageSparseMemoryRequirements = (PFN_vkGetDeviceImageSparseMemoryRequirements) load(userptr, "vkGetDeviceImageSparseMemoryRequirements");
+ glad_vkGetPhysicalDeviceToolProperties = (PFN_vkGetPhysicalDeviceToolProperties) load(userptr, "vkGetPhysicalDeviceToolProperties");
+ glad_vkGetPrivateData = (PFN_vkGetPrivateData) load(userptr, "vkGetPrivateData");
+ glad_vkQueueSubmit2 = (PFN_vkQueueSubmit2) load(userptr, "vkQueueSubmit2");
+ glad_vkSetPrivateData = (PFN_vkSetPrivateData) load(userptr, "vkSetPrivateData");
+}
+static void glad_vk_load_VK_EXT_debug_report( GLADuserptrloadfunc load, void* userptr) {
+ if(!GLAD_VK_EXT_debug_report) return;
+ glad_vkCreateDebugReportCallbackEXT = (PFN_vkCreateDebugReportCallbackEXT) load(userptr, "vkCreateDebugReportCallbackEXT");
+ glad_vkDebugReportMessageEXT = (PFN_vkDebugReportMessageEXT) load(userptr, "vkDebugReportMessageEXT");
+ glad_vkDestroyDebugReportCallbackEXT = (PFN_vkDestroyDebugReportCallbackEXT) load(userptr, "vkDestroyDebugReportCallbackEXT");
+}
+static void glad_vk_load_VK_KHR_surface( GLADuserptrloadfunc load, void* userptr) {
+ if(!GLAD_VK_KHR_surface) return;
+ glad_vkDestroySurfaceKHR = (PFN_vkDestroySurfaceKHR) load(userptr, "vkDestroySurfaceKHR");
+ glad_vkGetPhysicalDeviceSurfaceCapabilitiesKHR = (PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR) load(userptr, "vkGetPhysicalDeviceSurfaceCapabilitiesKHR");
+ glad_vkGetPhysicalDeviceSurfaceFormatsKHR = (PFN_vkGetPhysicalDeviceSurfaceFormatsKHR) load(userptr, "vkGetPhysicalDeviceSurfaceFormatsKHR");
+ glad_vkGetPhysicalDeviceSurfacePresentModesKHR = (PFN_vkGetPhysicalDeviceSurfacePresentModesKHR) load(userptr, "vkGetPhysicalDeviceSurfacePresentModesKHR");
+ glad_vkGetPhysicalDeviceSurfaceSupportKHR = (PFN_vkGetPhysicalDeviceSurfaceSupportKHR) load(userptr, "vkGetPhysicalDeviceSurfaceSupportKHR");
+}
+static void glad_vk_load_VK_KHR_swapchain( GLADuserptrloadfunc load, void* userptr) {
+ if(!GLAD_VK_KHR_swapchain) return;
+ glad_vkAcquireNextImage2KHR = (PFN_vkAcquireNextImage2KHR) load(userptr, "vkAcquireNextImage2KHR");
+ glad_vkAcquireNextImageKHR = (PFN_vkAcquireNextImageKHR) load(userptr, "vkAcquireNextImageKHR");
+ glad_vkCreateSwapchainKHR = (PFN_vkCreateSwapchainKHR) load(userptr, "vkCreateSwapchainKHR");
+ glad_vkDestroySwapchainKHR = (PFN_vkDestroySwapchainKHR) load(userptr, "vkDestroySwapchainKHR");
+ glad_vkGetDeviceGroupPresentCapabilitiesKHR = (PFN_vkGetDeviceGroupPresentCapabilitiesKHR) load(userptr, "vkGetDeviceGroupPresentCapabilitiesKHR");
+ glad_vkGetDeviceGroupSurfacePresentModesKHR = (PFN_vkGetDeviceGroupSurfacePresentModesKHR) load(userptr, "vkGetDeviceGroupSurfacePresentModesKHR");
+ glad_vkGetPhysicalDevicePresentRectanglesKHR = (PFN_vkGetPhysicalDevicePresentRectanglesKHR) load(userptr, "vkGetPhysicalDevicePresentRectanglesKHR");
+ glad_vkGetSwapchainImagesKHR = (PFN_vkGetSwapchainImagesKHR) load(userptr, "vkGetSwapchainImagesKHR");
+ glad_vkQueuePresentKHR = (PFN_vkQueuePresentKHR) load(userptr, "vkQueuePresentKHR");
+}
+
+
+
+static int glad_vk_get_extensions( VkPhysicalDevice physical_device, uint32_t *out_extension_count, char ***out_extensions) {
+ uint32_t i;
+ uint32_t instance_extension_count = 0;
+ uint32_t device_extension_count = 0;
+ uint32_t max_extension_count = 0;
+ uint32_t total_extension_count = 0;
+ char **extensions = NULL;
+ VkExtensionProperties *ext_properties = NULL;
+ VkResult result;
+
+ if (glad_vkEnumerateInstanceExtensionProperties == NULL || (physical_device != NULL && glad_vkEnumerateDeviceExtensionProperties == NULL)) {
+ return 0;
+ }
+
+ result = glad_vkEnumerateInstanceExtensionProperties(NULL, &instance_extension_count, NULL);
+ if (result != VK_SUCCESS) {
+ return 0;
+ }
+
+ if (physical_device != NULL) {
+ result = glad_vkEnumerateDeviceExtensionProperties(physical_device, NULL, &device_extension_count, NULL);
+ if (result != VK_SUCCESS) {
+ return 0;
+ }
+ }
+
+ total_extension_count = instance_extension_count + device_extension_count;
+ if (total_extension_count <= 0) {
+ return 0;
+ }
+
+ max_extension_count = instance_extension_count > device_extension_count
+ ? instance_extension_count : device_extension_count;
+
+ ext_properties = (VkExtensionProperties*) malloc(max_extension_count * sizeof(VkExtensionProperties));
+ if (ext_properties == NULL) {
+ goto glad_vk_get_extensions_error;
+ }
+
+ result = glad_vkEnumerateInstanceExtensionProperties(NULL, &instance_extension_count, ext_properties);
+ if (result != VK_SUCCESS) {
+ goto glad_vk_get_extensions_error;
+ }
+
+ extensions = (char**) calloc(total_extension_count, sizeof(char*));
+ if (extensions == NULL) {
+ goto glad_vk_get_extensions_error;
+ }
+
+ for (i = 0; i < instance_extension_count; ++i) {
+ VkExtensionProperties ext = ext_properties[i];
+
+ size_t extension_name_length = strlen(ext.extensionName) + 1;
+ extensions[i] = (char*) malloc(extension_name_length * sizeof(char));
+ if (extensions[i] == NULL) {
+ goto glad_vk_get_extensions_error;
+ }
+ memcpy(extensions[i], ext.extensionName, extension_name_length * sizeof(char));
+ }
+
+ if (physical_device != NULL) {
+ result = glad_vkEnumerateDeviceExtensionProperties(physical_device, NULL, &device_extension_count, ext_properties);
+ if (result != VK_SUCCESS) {
+ goto glad_vk_get_extensions_error;
+ }
+
+ for (i = 0; i < device_extension_count; ++i) {
+ VkExtensionProperties ext = ext_properties[i];
+
+ size_t extension_name_length = strlen(ext.extensionName) + 1;
+ extensions[instance_extension_count + i] = (char*) malloc(extension_name_length * sizeof(char));
+ if (extensions[instance_extension_count + i] == NULL) {
+ goto glad_vk_get_extensions_error;
+ }
+ memcpy(extensions[instance_extension_count + i], ext.extensionName, extension_name_length * sizeof(char));
+ }
+ }
+
+ free((void*) ext_properties);
+
+ *out_extension_count = total_extension_count;
+ *out_extensions = extensions;
+
+ return 1;
+
+glad_vk_get_extensions_error:
+ free((void*) ext_properties);
+ if (extensions != NULL) {
+ for (i = 0; i < total_extension_count; ++i) {
+ free((void*) extensions[i]);
+ }
+ free(extensions);
+ }
+ return 0;
+}
+
+static void glad_vk_free_extensions(uint32_t extension_count, char **extensions) {
+ uint32_t i;
+
+ for(i = 0; i < extension_count ; ++i) {
+ free((void*) (extensions[i]));
+ }
+
+ free((void*) extensions);
+}
+
+static int glad_vk_has_extension(const char *name, uint32_t extension_count, char **extensions) {
+ uint32_t i;
+
+ for (i = 0; i < extension_count; ++i) {
+ if(extensions[i] != NULL && strcmp(name, extensions[i]) == 0) {
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+static GLADapiproc glad_vk_get_proc_from_userptr(void *userptr, const char* name) {
+ return (GLAD_GNUC_EXTENSION (GLADapiproc (*)(const char *name)) userptr)(name);
+}
+
+static int glad_vk_find_extensions_vulkan( VkPhysicalDevice physical_device) {
+ uint32_t extension_count = 0;
+ char **extensions = NULL;
+ if (!glad_vk_get_extensions(physical_device, &extension_count, &extensions)) return 0;
+
+ GLAD_VK_EXT_debug_report = glad_vk_has_extension("VK_EXT_debug_report", extension_count, extensions);
+ GLAD_VK_KHR_portability_enumeration = glad_vk_has_extension("VK_KHR_portability_enumeration", extension_count, extensions);
+ GLAD_VK_KHR_surface = glad_vk_has_extension("VK_KHR_surface", extension_count, extensions);
+ GLAD_VK_KHR_swapchain = glad_vk_has_extension("VK_KHR_swapchain", extension_count, extensions);
+
+ (void) glad_vk_has_extension;
+
+ glad_vk_free_extensions(extension_count, extensions);
+
+ return 1;
+}
+
+static int glad_vk_find_core_vulkan( VkPhysicalDevice physical_device) {
+ int major = 1;
+ int minor = 0;
+
+#ifdef VK_VERSION_1_1
+ if (glad_vkEnumerateInstanceVersion != NULL) {
+ uint32_t version;
+ VkResult result;
+
+ result = glad_vkEnumerateInstanceVersion(&version);
+ if (result == VK_SUCCESS) {
+ major = (int) VK_VERSION_MAJOR(version);
+ minor = (int) VK_VERSION_MINOR(version);
+ }
+ }
+#endif
+
+ if (physical_device != NULL && glad_vkGetPhysicalDeviceProperties != NULL) {
+ VkPhysicalDeviceProperties properties;
+ glad_vkGetPhysicalDeviceProperties(physical_device, &properties);
+
+ major = (int) VK_VERSION_MAJOR(properties.apiVersion);
+ minor = (int) VK_VERSION_MINOR(properties.apiVersion);
+ }
+
+ GLAD_VK_VERSION_1_0 = (major == 1 && minor >= 0) || major > 1;
+ GLAD_VK_VERSION_1_1 = (major == 1 && minor >= 1) || major > 1;
+ GLAD_VK_VERSION_1_2 = (major == 1 && minor >= 2) || major > 1;
+ GLAD_VK_VERSION_1_3 = (major == 1 && minor >= 3) || major > 1;
+
+ return GLAD_MAKE_VERSION(major, minor);
+}
+
+int gladLoadVulkanUserPtr( VkPhysicalDevice physical_device, GLADuserptrloadfunc load, void *userptr) {
+ int version;
+
+#ifdef VK_VERSION_1_1
+ glad_vkEnumerateInstanceVersion = (PFN_vkEnumerateInstanceVersion) load(userptr, "vkEnumerateInstanceVersion");
+#endif
+ version = glad_vk_find_core_vulkan( physical_device);
+ if (!version) {
+ return 0;
+ }
+
+ glad_vk_load_VK_VERSION_1_0(load, userptr);
+ glad_vk_load_VK_VERSION_1_1(load, userptr);
+ glad_vk_load_VK_VERSION_1_2(load, userptr);
+ glad_vk_load_VK_VERSION_1_3(load, userptr);
+
+ if (!glad_vk_find_extensions_vulkan( physical_device)) return 0;
+ glad_vk_load_VK_EXT_debug_report(load, userptr);
+ glad_vk_load_VK_KHR_surface(load, userptr);
+ glad_vk_load_VK_KHR_swapchain(load, userptr);
+
+
+ return version;
+}
+
+
+int gladLoadVulkan( VkPhysicalDevice physical_device, GLADloadfunc load) {
+ return gladLoadVulkanUserPtr( physical_device, glad_vk_get_proc_from_userptr, GLAD_GNUC_EXTENSION (void*) load);
+}
+
+
+
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GLAD_VULKAN_IMPLEMENTATION */
+
diff --git a/external/GLFW/deps/linmath.h b/external/GLFW/deps/linmath.h
index 9c2e2a0..5c80265 100644
--- a/external/GLFW/deps/linmath.h
+++ b/external/GLFW/deps/linmath.h
@@ -1,70 +1,96 @@
#ifndef LINMATH_H
#define LINMATH_H
+#include
#include
+#include
-#ifdef _MSC_VER
-#define inline __inline
+/* 2021-03-21 Camilla Löwy
+ * - Replaced double constants with float equivalents
+ */
+
+#ifdef LINMATH_NO_INLINE
+#define LINMATH_H_FUNC static
+#else
+#define LINMATH_H_FUNC static inline
#endif
#define LINMATH_H_DEFINE_VEC(n) \
typedef float vec##n[n]; \
-static inline void vec##n##_add(vec##n r, vec##n const a, vec##n const b) \
+LINMATH_H_FUNC void vec##n##_add(vec##n r, vec##n const a, vec##n const b) \
{ \
int i; \
for(i=0; ib[i] ? a[i] : b[i]; \
+} \
+LINMATH_H_FUNC void vec##n##_dup(vec##n r, vec##n const src) \
+{ \
+ int i; \
+ for(i=0; i 1e-4) {
- mat4x4 T, C, S = {{0}};
-
vec3_norm(u, u);
+ mat4x4 T;
mat4x4_from_vec3_mul_outer(T, u, u);
- S[1][2] = u[0];
- S[2][1] = -u[0];
- S[2][0] = u[1];
- S[0][2] = -u[1];
- S[0][1] = u[2];
- S[1][0] = -u[2];
-
+ mat4x4 S = {
+ { 0, u[2], -u[1], 0},
+ {-u[2], 0, u[0], 0},
+ { u[1], -u[0], 0, 0},
+ { 0, 0, 0, 0}
+ };
mat4x4_scale(S, S, s);
+ mat4x4 C;
mat4x4_identity(C);
mat4x4_sub(C, C, T);
@@ -214,13 +237,13 @@ static inline void mat4x4_rotate(mat4x4 R, mat4x4 M, float x, float y, float z,
mat4x4_add(T, T, C);
mat4x4_add(T, T, S);
- T[3][3] = 1.;
+ T[3][3] = 1.f;
mat4x4_mul(R, M, T);
} else {
mat4x4_dup(R, M);
}
}
-static inline void mat4x4_rotate_X(mat4x4 Q, mat4x4 M, float angle)
+LINMATH_H_FUNC void mat4x4_rotate_X(mat4x4 Q, mat4x4 const M, float angle)
{
float s = sinf(angle);
float c = cosf(angle);
@@ -232,19 +255,19 @@ static inline void mat4x4_rotate_X(mat4x4 Q, mat4x4 M, float angle)
};
mat4x4_mul(Q, M, R);
}
-static inline void mat4x4_rotate_Y(mat4x4 Q, mat4x4 M, float angle)
+LINMATH_H_FUNC void mat4x4_rotate_Y(mat4x4 Q, mat4x4 const M, float angle)
{
float s = sinf(angle);
float c = cosf(angle);
mat4x4 R = {
- { c, 0.f, s, 0.f},
+ { c, 0.f, -s, 0.f},
{ 0.f, 1.f, 0.f, 0.f},
- { -s, 0.f, c, 0.f},
+ { s, 0.f, c, 0.f},
{ 0.f, 0.f, 0.f, 1.f}
};
mat4x4_mul(Q, M, R);
}
-static inline void mat4x4_rotate_Z(mat4x4 Q, mat4x4 M, float angle)
+LINMATH_H_FUNC void mat4x4_rotate_Z(mat4x4 Q, mat4x4 const M, float angle)
{
float s = sinf(angle);
float c = cosf(angle);
@@ -256,9 +279,8 @@ static inline void mat4x4_rotate_Z(mat4x4 Q, mat4x4 M, float angle)
};
mat4x4_mul(Q, M, R);
}
-static inline void mat4x4_invert(mat4x4 T, mat4x4 M)
+LINMATH_H_FUNC void mat4x4_invert(mat4x4 T, mat4x4 const M)
{
- float idet;
float s[6];
float c[6];
s[0] = M[0][0]*M[1][1] - M[1][0]*M[0][1];
@@ -274,10 +296,10 @@ static inline void mat4x4_invert(mat4x4 T, mat4x4 M)
c[3] = M[2][1]*M[3][2] - M[3][1]*M[2][2];
c[4] = M[2][1]*M[3][3] - M[3][1]*M[2][3];
c[5] = M[2][2]*M[3][3] - M[3][2]*M[2][3];
-
+
/* Assumes it is invertible */
- idet = 1.0f/( s[0]*c[5]-s[1]*c[4]+s[2]*c[3]+s[3]*c[2]-s[4]*c[1]+s[5]*c[0] );
-
+ float idet = 1.0f/( s[0]*c[5]-s[1]*c[4]+s[2]*c[3]+s[3]*c[2]-s[4]*c[1]+s[5]*c[0] );
+
T[0][0] = ( M[1][1] * c[5] - M[1][2] * c[4] + M[1][3] * c[3]) * idet;
T[0][1] = (-M[0][1] * c[5] + M[0][2] * c[4] - M[0][3] * c[3]) * idet;
T[0][2] = ( M[3][1] * s[5] - M[3][2] * s[4] + M[3][3] * s[3]) * idet;
@@ -298,23 +320,22 @@ static inline void mat4x4_invert(mat4x4 T, mat4x4 M)
T[3][2] = (-M[3][0] * s[3] + M[3][1] * s[1] - M[3][2] * s[0]) * idet;
T[3][3] = ( M[2][0] * s[3] - M[2][1] * s[1] + M[2][2] * s[0]) * idet;
}
-static inline void mat4x4_orthonormalize(mat4x4 R, mat4x4 M)
+LINMATH_H_FUNC void mat4x4_orthonormalize(mat4x4 R, mat4x4 const M)
{
- float s = 1.;
+ mat4x4_dup(R, M);
+ float s = 1.f;
vec3 h;
- mat4x4_dup(R, M);
vec3_norm(R[2], R[2]);
-
+
s = vec3_mul_inner(R[1], R[2]);
vec3_scale(h, R[2], s);
vec3_sub(R[1], R[1], h);
- vec3_norm(R[2], R[2]);
+ vec3_norm(R[1], R[1]);
- s = vec3_mul_inner(R[1], R[2]);
+ s = vec3_mul_inner(R[0], R[2]);
vec3_scale(h, R[2], s);
- vec3_sub(R[1], R[1], h);
- vec3_norm(R[1], R[1]);
+ vec3_sub(R[0], R[0], h);
s = vec3_mul_inner(R[0], R[1]);
vec3_scale(h, R[1], s);
@@ -322,11 +343,11 @@ static inline void mat4x4_orthonormalize(mat4x4 R, mat4x4 M)
vec3_norm(R[0], R[0]);
}
-static inline void mat4x4_frustum(mat4x4 M, float l, float r, float b, float t, float n, float f)
+LINMATH_H_FUNC void mat4x4_frustum(mat4x4 M, float l, float r, float b, float t, float n, float f)
{
M[0][0] = 2.f*n/(r-l);
M[0][1] = M[0][2] = M[0][3] = 0.f;
-
+
M[1][1] = 2.f*n/(t-b);
M[1][0] = M[1][2] = M[1][3] = 0.f;
@@ -334,11 +355,11 @@ static inline void mat4x4_frustum(mat4x4 M, float l, float r, float b, float t,
M[2][1] = (t+b)/(t-b);
M[2][2] = -(f+n)/(f-n);
M[2][3] = -1.f;
-
+
M[3][2] = -2.f*(f*n)/(f-n);
M[3][0] = M[3][1] = M[3][3] = 0.f;
}
-static inline void mat4x4_ortho(mat4x4 M, float l, float r, float b, float t, float n, float f)
+LINMATH_H_FUNC void mat4x4_ortho(mat4x4 M, float l, float r, float b, float t, float n, float f)
{
M[0][0] = 2.f/(r-l);
M[0][1] = M[0][2] = M[0][3] = 0.f;
@@ -348,17 +369,17 @@ static inline void mat4x4_ortho(mat4x4 M, float l, float r, float b, float t, fl
M[2][2] = -2.f/(f-n);
M[2][0] = M[2][1] = M[2][3] = 0.f;
-
+
M[3][0] = -(r+l)/(r-l);
M[3][1] = -(t+b)/(t-b);
M[3][2] = -(f+n)/(f-n);
M[3][3] = 1.f;
}
-static inline void mat4x4_perspective(mat4x4 m, float y_fov, float aspect, float n, float f)
+LINMATH_H_FUNC void mat4x4_perspective(mat4x4 m, float y_fov, float aspect, float n, float f)
{
/* NOTE: Degrees are an unhandy unit to work with.
* linmath.h uses radians for everything! */
- float const a = 1.f / (float) tan(y_fov / 2.f);
+ float const a = 1.f / tanf(y_fov / 2.f);
m[0][0] = a / aspect;
m[0][1] = 0.f;
@@ -380,7 +401,7 @@ static inline void mat4x4_perspective(mat4x4 m, float y_fov, float aspect, float
m[3][2] = -((2.f * f * n) / (f - n));
m[3][3] = 0.f;
}
-static inline void mat4x4_look_at(mat4x4 m, vec3 eye, vec3 center, vec3 up)
+LINMATH_H_FUNC void mat4x4_look_at(mat4x4 m, vec3 const eye, vec3 const center, vec3 const up)
{
/* Adapted from Android's OpenGL Matrix.java. */
/* See the OpenGL GLUT documentation for gluLookAt for a description */
@@ -389,15 +410,14 @@ static inline void mat4x4_look_at(mat4x4 m, vec3 eye, vec3 center, vec3 up)
/* TODO: The negation of of can be spared by swapping the order of
* operands in the following cross products in the right way. */
vec3 f;
+ vec3_sub(f, center, eye);
+ vec3_norm(f, f);
+
vec3 s;
- vec3 t;
-
- vec3_sub(f, center, eye);
- vec3_norm(f, f);
-
vec3_mul_cross(s, f, up);
vec3_norm(s, s);
+ vec3 t;
vec3_mul_cross(t, s, f);
m[0][0] = s[0];
@@ -424,24 +444,18 @@ static inline void mat4x4_look_at(mat4x4 m, vec3 eye, vec3 center, vec3 up)
}
typedef float quat[4];
-static inline void quat_identity(quat q)
+#define quat_add vec4_add
+#define quat_sub vec4_sub
+#define quat_norm vec4_norm
+#define quat_scale vec4_scale
+#define quat_mul_inner vec4_mul_inner
+
+LINMATH_H_FUNC void quat_identity(quat q)
{
q[0] = q[1] = q[2] = 0.f;
q[3] = 1.f;
}
-static inline void quat_add(quat r, quat a, quat b)
-{
- int i;
- for(i=0; i<4; ++i)
- r[i] = a[i] + b[i];
-}
-static inline void quat_sub(quat r, quat a, quat b)
-{
- int i;
- for(i=0; i<4; ++i)
- r[i] = a[i] - b[i];
-}
-static inline void quat_mul(quat r, quat p, quat q)
+LINMATH_H_FUNC void quat_mul(quat r, quat const p, quat const q)
{
vec3 w;
vec3_mul_cross(r, p, q);
@@ -451,56 +465,42 @@ static inline void quat_mul(quat r, quat p, quat q)
vec3_add(r, r, w);
r[3] = p[3]*q[3] - vec3_mul_inner(p, q);
}
-static inline void quat_scale(quat r, quat v, float s)
-{
- int i;
- for(i=0; i<4; ++i)
- r[i] = v[i] * s;
-}
-static inline float quat_inner_product(quat a, quat b)
-{
- float p = 0.f;
- int i;
- for(i=0; i<4; ++i)
- p += b[i]*a[i];
- return p;
-}
-static inline void quat_conj(quat r, quat q)
+LINMATH_H_FUNC void quat_conj(quat r, quat const q)
{
int i;
for(i=0; i<3; ++i)
r[i] = -q[i];
r[3] = q[3];
}
-static inline void quat_rotate(quat r, float angle, vec3 axis) {
- int i;
- vec3 v;
- vec3_scale(v, axis, sinf(angle / 2));
- for(i=0; i<3; ++i)
- r[i] = v[i];
- r[3] = cosf(angle / 2);
+LINMATH_H_FUNC void quat_rotate(quat r, float angle, vec3 const axis) {
+ vec3 axis_norm;
+ vec3_norm(axis_norm, axis);
+ float s = sinf(angle / 2);
+ float c = cosf(angle / 2);
+ vec3_scale(r, axis_norm, s);
+ r[3] = c;
}
-#define quat_norm vec4_norm
-static inline void quat_mul_vec3(vec3 r, quat q, vec3 v)
+LINMATH_H_FUNC void quat_mul_vec3(vec3 r, quat const q, vec3 const v)
{
/*
* Method by Fabian 'ryg' Giessen (of Farbrausch)
t = 2 * cross(q.xyz, v)
v' = v + q.w * t + cross(q.xyz, t)
*/
- vec3 t = {q[0], q[1], q[2]};
+ vec3 t;
+ vec3 q_xyz = {q[0], q[1], q[2]};
vec3 u = {q[0], q[1], q[2]};
- vec3_mul_cross(t, t, v);
+ vec3_mul_cross(t, q_xyz, v);
vec3_scale(t, t, 2);
- vec3_mul_cross(u, u, t);
+ vec3_mul_cross(u, q_xyz, t);
vec3_scale(t, t, q[3]);
vec3_add(r, v, t);
vec3_add(r, r, u);
}
-static inline void mat4x4_from_quat(mat4x4 M, quat q)
+LINMATH_H_FUNC void mat4x4_from_quat(mat4x4 M, quat const q)
{
float a = q[3];
float b = q[0];
@@ -510,7 +510,7 @@ static inline void mat4x4_from_quat(mat4x4 M, quat q)
float b2 = b*b;
float c2 = c*c;
float d2 = d*d;
-
+
M[0][0] = a2 + b2 - c2 - d2;
M[0][1] = 2.f*(b*c + a*d);
M[0][2] = 2.f*(b*d - a*c);
@@ -530,18 +530,21 @@ static inline void mat4x4_from_quat(mat4x4 M, quat q)
M[3][3] = 1.f;
}
-static inline void mat4x4o_mul_quat(mat4x4 R, mat4x4 M, quat q)
+LINMATH_H_FUNC void mat4x4o_mul_quat(mat4x4 R, mat4x4 const M, quat const q)
{
-/* XXX: The way this is written only works for othogonal matrices. */
+/* XXX: The way this is written only works for orthogonal matrices. */
/* TODO: Take care of non-orthogonal case. */
quat_mul_vec3(R[0], q, M[0]);
quat_mul_vec3(R[1], q, M[1]);
quat_mul_vec3(R[2], q, M[2]);
R[3][0] = R[3][1] = R[3][2] = 0.f;
- R[3][3] = 1.f;
+ R[0][3] = M[0][3];
+ R[1][3] = M[1][3];
+ R[2][3] = M[2][3];
+ R[3][3] = M[3][3]; // typically 1.0, but here we make it general
}
-static inline void quat_from_mat4x4(quat q, mat4x4 M)
+LINMATH_H_FUNC void quat_from_mat4x4(quat q, mat4x4 const M)
{
float r=0.f;
int i;
@@ -557,7 +560,7 @@ static inline void quat_from_mat4x4(quat q, mat4x4 M)
p = &perm[i];
}
- r = (float) sqrt(1.f + M[p[0]][p[0]] - M[p[1]][p[1]] - M[p[2]][p[2]] );
+ r = sqrtf(1.f + M[p[0]][p[0]] - M[p[1]][p[1]] - M[p[2]][p[2]] );
if(r < 1e-6) {
q[0] = 1.f;
@@ -571,4 +574,33 @@ static inline void quat_from_mat4x4(quat q, mat4x4 M)
q[3] = (M[p[2]][p[1]] - M[p[1]][p[2]])/(2.f*r);
}
+LINMATH_H_FUNC void mat4x4_arcball(mat4x4 R, mat4x4 const M, vec2 const _a, vec2 const _b, float s)
+{
+ vec2 a; memcpy(a, _a, sizeof(a));
+ vec2 b; memcpy(b, _b, sizeof(b));
+
+ float z_a = 0.f;
+ float z_b = 0.f;
+
+ if(vec2_len(a) < 1.f) {
+ z_a = sqrtf(1.f - vec2_mul_inner(a, a));
+ } else {
+ vec2_norm(a, a);
+ }
+
+ if(vec2_len(b) < 1.f) {
+ z_b = sqrtf(1.f - vec2_mul_inner(b, b));
+ } else {
+ vec2_norm(b, b);
+ }
+
+ vec3 a_ = {a[0], a[1], z_a};
+ vec3 b_ = {b[0], b[1], z_b};
+
+ vec3 c_;
+ vec3_mul_cross(c_, a_, b_);
+
+ float const angle = acos(vec3_mul_inner(a_, b_)) * s;
+ mat4x4_rotate(R, M, c_[0], c_[1], c_[2], angle);
+}
#endif
diff --git a/external/GLFW/deps/nuklear.h b/external/GLFW/deps/nuklear.h
index 333acee..0f534e5 100644
--- a/external/GLFW/deps/nuklear.h
+++ b/external/GLFW/deps/nuklear.h
@@ -1,242 +1,222 @@
/*
- Nuklear - 1.40.0 - public domain
- no warrenty implied; use at your own risk.
- authored from 2015-2017 by Micha Mettke
-
-ABOUT:
- This is a minimal state graphical user interface single header toolkit
- written in ANSI C and licensed under public domain.
- It was designed as a simple embeddable user interface for application and does
- not have any dependencies, a default renderbackend or OS window and input handling
- but instead provides a very modular library approach by using simple input state
- for input and draw commands describing primitive shapes as output.
- So instead of providing a layered library that tries to abstract over a number
- of platform and render backends it only focuses on the actual UI.
-
-VALUES:
- - Graphical user interface toolkit
- - Single header library
- - Written in C89 (a.k.a. ANSI C or ISO C90)
- - Small codebase (~17kLOC)
- - Focus on portability, efficiency and simplicity
- - No dependencies (not even the standard library if not wanted)
- - Fully skinnable and customizable
- - Low memory footprint with total memory control if needed or wanted
- - UTF-8 support
- - No global or hidden state
- - Customizable library modules (you can compile and use only what you need)
- - Optional font baker and vertex buffer output
-
-USAGE:
- This library is self contained in one single header file and can be used either
- in header only mode or in implementation mode. The header only mode is used
- by default when included and allows including this header in other headers
- and does not contain the actual implementation.
-
- The implementation mode requires to define the preprocessor macro
- NK_IMPLEMENTATION in *one* .c/.cpp file before #includeing this file, e.g.:
-
- #define NK_IMPLEMENTATION
- #include "nuklear.h"
-
- Also optionally define the symbols listed in the section "OPTIONAL DEFINES"
- below in header and implementation mode if you want to use additional functionality
- or need more control over the library.
- IMPORTANT: Every time you include "nuklear.h" you have to define the same flags.
- This is very important not doing it either leads to compiler errors
- or even worse stack corruptions.
-
-FEATURES:
- - Absolutely no platform dependend code
- - Memory management control ranging from/to
- - Ease of use by allocating everything from standard library
- - Control every byte of memory inside the library
- - Font handling control ranging from/to
- - Use your own font implementation for everything
- - Use this libraries internal font baking and handling API
- - Drawing output control ranging from/to
- - Simple shapes for more high level APIs which already have drawing capabilities
- - Hardware accessible anti-aliased vertex buffer output
- - Customizable colors and properties ranging from/to
- - Simple changes to color by filling a simple color table
- - Complete control with ability to use skinning to decorate widgets
- - Bendable UI library with widget ranging from/to
- - Basic widgets like buttons, checkboxes, slider, ...
- - Advanced widget like abstract comboboxes, contextual menus,...
- - Compile time configuration to only compile what you need
- - Subset which can be used if you do not want to link or use the standard library
- - Can be easily modified to only update on user input instead of frame updates
-
-OPTIONAL DEFINES:
- NK_PRIVATE
- If defined declares all functions as static, so they can only be accessed
- inside the file that contains the implementation
-
- NK_INCLUDE_FIXED_TYPES
- If defined it will include header for fixed sized types
- otherwise nuklear tries to select the correct type. If that fails it will
- throw a compiler error and you have to select the correct types yourself.
- If used needs to be defined for implementation and header
-
- NK_INCLUDE_DEFAULT_ALLOCATOR
- if defined it will include header and provide additional functions
- to use this library without caring for memory allocation control and therefore
- ease memory management.
- Adds the standard library with malloc and free so don't define if you
- don't want to link to the standard library
- If used needs to be defined for implementation and header
-
- NK_INCLUDE_STANDARD_IO
- if defined it will include header and provide
- additional functions depending on file loading.
- Adds the standard library with fopen, fclose,... so don't define this
- if you don't want to link to the standard library
- If used needs to be defined for implementation and header
-
- NK_INCLUDE_STANDARD_VARARGS
- if defined it will include header and provide
- additional functions depending on variable arguments
- Adds the standard library with va_list and so don't define this if
- you don't want to link to the standard library
- If used needs to be defined for implementation and header
-
- NK_INCLUDE_VERTEX_BUFFER_OUTPUT
- Defining this adds a vertex draw command list backend to this
- library, which allows you to convert queue commands into vertex draw commands.
- This is mainly if you need a hardware accessible format for OpenGL, DirectX,
- Vulkan, Metal,...
- If used needs to be defined for implementation and header
-
- NK_INCLUDE_FONT_BAKING
- Defining this adds `stb_truetype` and `stb_rect_pack` implementation
- to this library and provides font baking and rendering.
- If you already have font handling or do not want to use this font handler
- you don't have to define it.
- If used needs to be defined for implementation and header
-
- NK_INCLUDE_DEFAULT_FONT
- Defining this adds the default font: ProggyClean.ttf into this library
- which can be loaded into a font atlas and allows using this library without
- having a truetype font
- Enabling this adds ~12kb to global stack memory
- If used needs to be defined for implementation and header
-
- NK_INCLUDE_COMMAND_USERDATA
- Defining this adds a userdata pointer into each command. Can be useful for
- example if you want to provide custom shaders depending on the used widget.
- Can be combined with the style structures.
- If used needs to be defined for implementation and header
-
- NK_BUTTON_TRIGGER_ON_RELEASE
- Different platforms require button clicks occuring either on buttons being
- pressed (up to down) or released (down to up).
- By default this library will react on buttons being pressed, but if you
- define this it will only trigger if a button is released.
- If used it is only required to be defined for the implementation part
-
- NK_ZERO_COMMAND_MEMORY
- Defining this will zero out memory for each drawing command added to a
- drawing queue (inside nk_command_buffer_push). Zeroing command memory
- is very useful for fast checking (using memcmp) if command buffers are
- equal and avoid drawing frames when nothing on screen has changed since
- previous frame.
-
- NK_ASSERT
- If you don't define this, nuklear will use with assert().
- Adds the standard library so define to nothing of not wanted
- If used needs to be defined for implementation and header
-
- NK_BUFFER_DEFAULT_INITIAL_SIZE
- Initial buffer size allocated by all buffers while using the default allocator
- functions included by defining NK_INCLUDE_DEFAULT_ALLOCATOR. If you don't
- want to allocate the default 4k memory then redefine it.
- If used needs to be defined for implementation and header
-
- NK_MAX_NUMBER_BUFFER
- Maximum buffer size for the conversion buffer between float and string
- Under normal circumstances this should be more than sufficient.
- If used needs to be defined for implementation and header
-
- NK_INPUT_MAX
- Defines the max number of bytes which can be added as text input in one frame.
- Under normal circumstances this should be more than sufficient.
- If used it is only required to be defined for the implementation part
-
- NK_MEMSET
- You can define this to 'memset' or your own memset implementation
- replacement. If not nuklear will use its own version.
- If used it is only required to be defined for the implementation part
-
- NK_MEMCPY
- You can define this to 'memcpy' or your own memcpy implementation
- replacement. If not nuklear will use its own version.
- If used it is only required to be defined for the implementation part
-
- NK_SQRT
- You can define this to 'sqrt' or your own sqrt implementation
- replacement. If not nuklear will use its own slow and not highly
- accurate version.
- If used it is only required to be defined for the implementation part
-
- NK_SIN
- You can define this to 'sinf' or your own sine implementation
- replacement. If not nuklear will use its own approximation implementation.
- If used it is only required to be defined for the implementation part
-
- NK_COS
- You can define this to 'cosf' or your own cosine implementation
- replacement. If not nuklear will use its own approximation implementation.
- If used it is only required to be defined for the implementation part
-
- NK_STRTOD
- You can define this to `strtod` or your own string to double conversion
- implementation replacement. If not defined nuklear will use its own
- imprecise and possibly unsafe version (does not handle nan or infinity!).
- If used it is only required to be defined for the implementation part
-
- NK_DTOA
- You can define this to `dtoa` or your own double to string conversion
- implementation replacement. If not defined nuklear will use its own
- imprecise and possibly unsafe version (does not handle nan or infinity!).
- If used it is only required to be defined for the implementation part
-
- NK_VSNPRINTF
- If you define `NK_INCLUDE_STANDARD_VARARGS` as well as `NK_INCLUDE_STANDARD_IO`
- and want to be safe define this to `vsnprintf` on compilers supporting
- later versions of C or C++. By default nuklear will check for your stdlib version
- in C as well as compiler version in C++. if `vsnprintf` is available
- it will define it to `vsnprintf` directly. If not defined and if you have
- older versions of C or C++ it will be defined to `vsprintf` which is unsafe.
- If used it is only required to be defined for the implementation part
-
- NK_BYTE
- NK_INT16
- NK_UINT16
- NK_INT32
- NK_UINT32
- NK_SIZE_TYPE
- NK_POINTER_TYPE
- If you compile without NK_USE_FIXED_TYPE then a number of standard types
- will be selected and compile time validated. If they are incorrect you can
- define the correct types by overloading these type defines.
-
-CREDITS:
- Developed by Micha Mettke and every direct or indirect contributor.
-
- Embeds stb_texedit, stb_truetype and stb_rectpack by Sean Barret (public domain)
- Embeds ProggyClean.ttf font by Tristan Grimmer (MIT license).
-
- Big thank you to Omar Cornut (ocornut@github) for his imgui library and
- giving me the inspiration for this library, Casey Muratori for handmade hero
- and his original immediate mode graphical user interface idea and Sean
- Barret for his amazing single header libraries which restored my faith
- in libraries and brought me to create some of my own.
-
-LICENSE:
- This software is dual-licensed to the public domain and under the following
- license: you are granted a perpetual, irrevocable license to copy, modify,
- publish and distribute this file as you see fit.
+/// # Nuklear
+/// 
+///
+/// ## Contents
+/// 1. About section
+/// 2. Highlights section
+/// 3. Features section
+/// 4. Usage section
+/// 1. Flags section
+/// 2. Constants section
+/// 3. Dependencies section
+/// 5. Example section
+/// 6. API section
+/// 1. Context section
+/// 2. Input section
+/// 3. Drawing section
+/// 4. Window section
+/// 5. Layouting section
+/// 6. Groups section
+/// 7. Tree section
+/// 8. Properties section
+/// 7. License section
+/// 8. Changelog section
+/// 9. Gallery section
+/// 10. Credits section
+///
+/// ## About
+/// This is a minimal state immediate mode graphical user interface toolkit
+/// written in ANSI C and licensed under public domain. It was designed as a simple
+/// embeddable user interface for application and does not have any dependencies,
+/// a default renderbackend or OS window and input handling but instead provides a very modular
+/// library approach by using simple input state for input and draw
+/// commands describing primitive shapes as output. So instead of providing a
+/// layered library that tries to abstract over a number of platform and
+/// render backends it only focuses on the actual UI.
+///
+/// ## Highlights
+/// - Graphical user interface toolkit
+/// - Single header library
+/// - Written in C89 (a.k.a. ANSI C or ISO C90)
+/// - Small codebase (~18kLOC)
+/// - Focus on portability, efficiency and simplicity
+/// - No dependencies (not even the standard library if not wanted)
+/// - Fully skinnable and customizable
+/// - Low memory footprint with total memory control if needed or wanted
+/// - UTF-8 support
+/// - No global or hidden state
+/// - Customizable library modules (you can compile and use only what you need)
+/// - Optional font baker and vertex buffer output
+///
+/// ## Features
+/// - Absolutely no platform dependent code
+/// - Memory management control ranging from/to
+/// - Ease of use by allocating everything from standard library
+/// - Control every byte of memory inside the library
+/// - Font handling control ranging from/to
+/// - Use your own font implementation for everything
+/// - Use this libraries internal font baking and handling API
+/// - Drawing output control ranging from/to
+/// - Simple shapes for more high level APIs which already have drawing capabilities
+/// - Hardware accessible anti-aliased vertex buffer output
+/// - Customizable colors and properties ranging from/to
+/// - Simple changes to color by filling a simple color table
+/// - Complete control with ability to use skinning to decorate widgets
+/// - Bendable UI library with widget ranging from/to
+/// - Basic widgets like buttons, checkboxes, slider, ...
+/// - Advanced widget like abstract comboboxes, contextual menus,...
+/// - Compile time configuration to only compile what you need
+/// - Subset which can be used if you do not want to link or use the standard library
+/// - Can be easily modified to only update on user input instead of frame updates
+///
+/// ## Usage
+/// This library is self contained in one single header file and can be used either
+/// in header only mode or in implementation mode. The header only mode is used
+/// by default when included and allows including this header in other headers
+/// and does not contain the actual implementation.
+///
+/// The implementation mode requires to define the preprocessor macro
+/// NK_IMPLEMENTATION in *one* .c/.cpp file before #includeing this file, e.g.:
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~C
+/// #define NK_IMPLEMENTATION
+/// #include "nuklear.h"
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Also optionally define the symbols listed in the section "OPTIONAL DEFINES"
+/// below in header and implementation mode if you want to use additional functionality
+/// or need more control over the library.
+///
+/// !!! WARNING
+/// Every time nuklear is included define the same compiler flags. This very important not doing so could lead to compiler errors or even worse stack corruptions.
+///
+/// ### Flags
+/// Flag | Description
+/// --------------------------------|------------------------------------------
+/// NK_PRIVATE | If defined declares all functions as static, so they can only be accessed inside the file that contains the implementation
+/// NK_INCLUDE_FIXED_TYPES | If defined it will include header `` for fixed sized types otherwise nuklear tries to select the correct type. If that fails it will throw a compiler error and you have to select the correct types yourself.
+/// NK_INCLUDE_DEFAULT_ALLOCATOR | If defined it will include header `` and provide additional functions to use this library without caring for memory allocation control and therefore ease memory management.
+/// NK_INCLUDE_STANDARD_IO | If defined it will include header `` and provide additional functions depending on file loading.
+/// NK_INCLUDE_STANDARD_VARARGS | If defined it will include header and provide additional functions depending on file loading.
+/// NK_INCLUDE_VERTEX_BUFFER_OUTPUT | Defining this adds a vertex draw command list backend to this library, which allows you to convert queue commands into vertex draw commands. This is mainly if you need a hardware accessible format for OpenGL, DirectX, Vulkan, Metal,...
+/// NK_INCLUDE_FONT_BAKING | Defining this adds `stb_truetype` and `stb_rect_pack` implementation to this library and provides font baking and rendering. If you already have font handling or do not want to use this font handler you don't have to define it.
+/// NK_INCLUDE_DEFAULT_FONT | Defining this adds the default font: ProggyClean.ttf into this library which can be loaded into a font atlas and allows using this library without having a truetype font
+/// NK_INCLUDE_COMMAND_USERDATA | Defining this adds a userdata pointer into each command. Can be useful for example if you want to provide custom shaders depending on the used widget. Can be combined with the style structures.
+/// NK_BUTTON_TRIGGER_ON_RELEASE | Different platforms require button clicks occurring either on buttons being pressed (up to down) or released (down to up). By default this library will react on buttons being pressed, but if you define this it will only trigger if a button is released.
+/// NK_ZERO_COMMAND_MEMORY | Defining this will zero out memory for each drawing command added to a drawing queue (inside nk_command_buffer_push). Zeroing command memory is very useful for fast checking (using memcmp) if command buffers are equal and avoid drawing frames when nothing on screen has changed since previous frame.
+/// NK_UINT_DRAW_INDEX | Defining this will set the size of vertex index elements when using NK_VERTEX_BUFFER_OUTPUT to 32bit instead of the default of 16bit
+/// NK_KEYSTATE_BASED_INPUT | Define this if your backend uses key state for each frame rather than key press/release events
+///
+/// !!! WARNING
+/// The following flags will pull in the standard C library:
+/// - NK_INCLUDE_DEFAULT_ALLOCATOR
+/// - NK_INCLUDE_STANDARD_IO
+/// - NK_INCLUDE_STANDARD_VARARGS
+///
+/// !!! WARNING
+/// The following flags if defined need to be defined for both header and implementation:
+/// - NK_INCLUDE_FIXED_TYPES
+/// - NK_INCLUDE_DEFAULT_ALLOCATOR
+/// - NK_INCLUDE_STANDARD_VARARGS
+/// - NK_INCLUDE_VERTEX_BUFFER_OUTPUT
+/// - NK_INCLUDE_FONT_BAKING
+/// - NK_INCLUDE_DEFAULT_FONT
+/// - NK_INCLUDE_STANDARD_VARARGS
+/// - NK_INCLUDE_COMMAND_USERDATA
+/// - NK_UINT_DRAW_INDEX
+///
+/// ### Constants
+/// Define | Description
+/// --------------------------------|---------------------------------------
+/// NK_BUFFER_DEFAULT_INITIAL_SIZE | Initial buffer size allocated by all buffers while using the default allocator functions included by defining NK_INCLUDE_DEFAULT_ALLOCATOR. If you don't want to allocate the default 4k memory then redefine it.
+/// NK_MAX_NUMBER_BUFFER | Maximum buffer size for the conversion buffer between float and string Under normal circumstances this should be more than sufficient.
+/// NK_INPUT_MAX | Defines the max number of bytes which can be added as text input in one frame. Under normal circumstances this should be more than sufficient.
+///
+/// !!! WARNING
+/// The following constants if defined need to be defined for both header and implementation:
+/// - NK_MAX_NUMBER_BUFFER
+/// - NK_BUFFER_DEFAULT_INITIAL_SIZE
+/// - NK_INPUT_MAX
+///
+/// ### Dependencies
+/// Function | Description
+/// ------------|---------------------------------------------------------------
+/// NK_ASSERT | If you don't define this, nuklear will use with assert().
+/// NK_MEMSET | You can define this to 'memset' or your own memset implementation replacement. If not nuklear will use its own version.
+/// NK_MEMCPY | You can define this to 'memcpy' or your own memcpy implementation replacement. If not nuklear will use its own version.
+/// NK_SQRT | You can define this to 'sqrt' or your own sqrt implementation replacement. If not nuklear will use its own slow and not highly accurate version.
+/// NK_SIN | You can define this to 'sinf' or your own sine implementation replacement. If not nuklear will use its own approximation implementation.
+/// NK_COS | You can define this to 'cosf' or your own cosine implementation replacement. If not nuklear will use its own approximation implementation.
+/// NK_STRTOD | You can define this to `strtod` or your own string to double conversion implementation replacement. If not defined nuklear will use its own imprecise and possibly unsafe version (does not handle nan or infinity!).
+/// NK_DTOA | You can define this to `dtoa` or your own double to string conversion implementation replacement. If not defined nuklear will use its own imprecise and possibly unsafe version (does not handle nan or infinity!).
+/// NK_VSNPRINTF| If you define `NK_INCLUDE_STANDARD_VARARGS` as well as `NK_INCLUDE_STANDARD_IO` and want to be safe define this to `vsnprintf` on compilers supporting later versions of C or C++. By default nuklear will check for your stdlib version in C as well as compiler version in C++. if `vsnprintf` is available it will define it to `vsnprintf` directly. If not defined and if you have older versions of C or C++ it will be defined to `vsprintf` which is unsafe.
+///
+/// !!! WARNING
+/// The following dependencies will pull in the standard C library if not redefined:
+/// - NK_ASSERT
+///
+/// !!! WARNING
+/// The following dependencies if defined need to be defined for both header and implementation:
+/// - NK_ASSERT
+///
+/// !!! WARNING
+/// The following dependencies if defined need to be defined only for the implementation part:
+/// - NK_MEMSET
+/// - NK_MEMCPY
+/// - NK_SQRT
+/// - NK_SIN
+/// - NK_COS
+/// - NK_STRTOD
+/// - NK_DTOA
+/// - NK_VSNPRINTF
+///
+/// ## Example
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// // init gui state
+/// enum {EASY, HARD};
+/// static int op = EASY;
+/// static float value = 0.6f;
+/// static int i = 20;
+/// struct nk_context ctx;
+///
+/// nk_init_fixed(&ctx, calloc(1, MAX_MEMORY), MAX_MEMORY, &font);
+/// if (nk_begin(&ctx, "Show", nk_rect(50, 50, 220, 220),
+/// NK_WINDOW_BORDER|NK_WINDOW_MOVABLE|NK_WINDOW_CLOSABLE)) {
+/// // fixed widget pixel width
+/// nk_layout_row_static(&ctx, 30, 80, 1);
+/// if (nk_button_label(&ctx, "button")) {
+/// // event handling
+/// }
+///
+/// // fixed widget window ratio width
+/// nk_layout_row_dynamic(&ctx, 30, 2);
+/// if (nk_option_label(&ctx, "easy", op == EASY)) op = EASY;
+/// if (nk_option_label(&ctx, "hard", op == HARD)) op = HARD;
+///
+/// // custom widget pixel width
+/// nk_layout_row_begin(&ctx, NK_STATIC, 30, 2);
+/// {
+/// nk_layout_row_push(&ctx, 50);
+/// nk_label(&ctx, "Volume:", NK_TEXT_LEFT);
+/// nk_layout_row_push(&ctx, 110);
+/// nk_slider_float(&ctx, 0, &value, 1.0f, 0.1f);
+/// }
+/// nk_layout_row_end(&ctx);
+/// }
+/// nk_end(&ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// 
+///
+/// ## API
+///
*/
+#ifndef NK_SINGLE_FILE
+ #define NK_SINGLE_FILE
+#endif
+
#ifndef NK_NUKLEAR_H_
#define NK_NUKLEAR_H_
@@ -254,13 +234,13 @@ extern "C" {
#define NK_UTF_INVALID 0xFFFD /* internal invalid utf8 rune */
#define NK_UTF_SIZE 4 /* describes the number of bytes a glyph consists of*/
#ifndef NK_INPUT_MAX
-#define NK_INPUT_MAX 16
+ #define NK_INPUT_MAX 16
#endif
#ifndef NK_MAX_NUMBER_BUFFER
-#define NK_MAX_NUMBER_BUFFER 64
+ #define NK_MAX_NUMBER_BUFFER 64
#endif
#ifndef NK_SCROLLBAR_HIDING_TIMEOUT
-#define NK_SCROLLBAR_HIDING_TIMEOUT 4.0f
+ #define NK_SCROLLBAR_HIDING_TIMEOUT 4.0f
#endif
/*
* ==============================================================
@@ -282,6 +262,13 @@ extern "C" {
#define NK_API extern
#endif
#endif
+#ifndef NK_LIB
+ #ifdef NK_SINGLE_FILE
+ #define NK_LIB static
+ #else
+ #define NK_LIB extern
+ #endif
+#endif
#define NK_INTERN static
#define NK_STORAGE static
@@ -295,26 +282,44 @@ extern "C" {
#define NK_STRING_JOIN(arg1, arg2) NK_STRING_JOIN_DELAY(arg1, arg2)
#ifdef _MSC_VER
-#define NK_UNIQUE_NAME(name) NK_STRING_JOIN(name,__COUNTER__)
+ #define NK_UNIQUE_NAME(name) NK_STRING_JOIN(name,__COUNTER__)
#else
-#define NK_UNIQUE_NAME(name) NK_STRING_JOIN(name,__LINE__)
+ #define NK_UNIQUE_NAME(name) NK_STRING_JOIN(name,__LINE__)
#endif
#ifndef NK_STATIC_ASSERT
-#define NK_STATIC_ASSERT(exp) typedef char NK_UNIQUE_NAME(_dummy_array)[(exp)?1:-1]
+ #define NK_STATIC_ASSERT(exp) typedef char NK_UNIQUE_NAME(_dummy_array)[(exp)?1:-1]
#endif
#ifndef NK_FILE_LINE
#ifdef _MSC_VER
-#define NK_FILE_LINE __FILE__ ":" NK_MACRO_STRINGIFY(__COUNTER__)
+ #define NK_FILE_LINE __FILE__ ":" NK_MACRO_STRINGIFY(__COUNTER__)
#else
-#define NK_FILE_LINE __FILE__ ":" NK_MACRO_STRINGIFY(__LINE__)
+ #define NK_FILE_LINE __FILE__ ":" NK_MACRO_STRINGIFY(__LINE__)
#endif
#endif
#define NK_MIN(a,b) ((a) < (b) ? (a) : (b))
#define NK_MAX(a,b) ((a) < (b) ? (b) : (a))
#define NK_CLAMP(i,v,x) (NK_MAX(NK_MIN(v,x), i))
+
+#ifdef NK_INCLUDE_STANDARD_VARARGS
+ #include /* valist, va_start, va_end, ... */
+ #if defined(_MSC_VER) && (_MSC_VER >= 1600) /* VS 2010 and above */
+ #include
+ #define NK_PRINTF_FORMAT_STRING _Printf_format_string_
+ #else
+ #define NK_PRINTF_FORMAT_STRING
+ #endif
+ #if defined(__GNUC__)
+ #define NK_PRINTF_VARARG_FUNC(fmtargnumber) __attribute__((format(__printf__, fmtargnumber, fmtargnumber+1)))
+ #define NK_PRINTF_VALIST_FUNC(fmtargnumber) __attribute__((format(__printf__, fmtargnumber, 0)))
+ #else
+ #define NK_PRINTF_VARARG_FUNC(fmtargnumber)
+ #define NK_PRINTF_VALIST_FUNC(fmtargnumber)
+ #endif
+#endif
+
/*
* ===============================================================
*
@@ -334,7 +339,7 @@ extern "C" {
#define NK_POINTER_TYPE uintptr_t
#else
#ifndef NK_INT8
- #define NK_INT8 char
+ #define NK_INT8 signed char
#endif
#ifndef NK_UINT8
#define NK_UINT8 unsigned char
@@ -418,6 +423,11 @@ NK_STATIC_ASSERT(sizeof(nk_rune) >= 4);
NK_STATIC_ASSERT(sizeof(nk_size) >= sizeof(void*));
NK_STATIC_ASSERT(sizeof(nk_ptr) >= sizeof(void*));
+#if defined(_MSC_VER)
+/* disable `operands are different enum types` warning on MSVC */
+#pragma warning( disable: 5287 )
+#endif
+
/* ============================================================================
*
* API
@@ -507,101 +517,159 @@ enum nk_symbol_type {
* CONTEXT
*
* =============================================================================*/
-/* Contexts are the main entry point and the majestro of nuklear and contain all required state.
- * They are used for window, memory, input, style, stack, commands and time management and need
- * to be passed into all nuklear GUI specific functions.
- *
- * Usage
- * -------------------
- * To use a context it first has to be initialized which can be achieved by calling
- * one of either `nk_init_default`, `nk_init_fixed`, `nk_init`, `nk_init_custom`.
- * Each takes in a font handle and a specific way of handling memory. Memory control
- * hereby ranges from standard library to just specifing a fixed sized block of memory
- * which nuklear has to manage itself from.
- *
- * struct nk_context ctx;
- * nk_init_xxx(&ctx, ...);
- * while (1) {
- * [...]
- * nk_clear(&ctx);
- * }
- * nk_free(&ctx);
- *
- * Reference
- * -------------------
- * nk_init_default - Initializes context with standard library memory alloction (malloc,free)
- * nk_init_fixed - Initializes context from single fixed size memory block
- * nk_init - Initializes context with memory allocator callbacks for alloc and free
- * nk_init_custom - Initializes context from two buffers. One for draw commands the other for window/panel/table allocations
- * nk_clear - Called at the end of the frame to reset and prepare the context for the next frame
- * nk_free - Shutdown and free all memory allocated inside the context
- * nk_set_user_data - Utility function to pass user data to draw command
+/*/// ### Context
+/// Contexts are the main entry point and the majestro of nuklear and contain all required state.
+/// They are used for window, memory, input, style, stack, commands and time management and need
+/// to be passed into all nuklear GUI specific functions.
+///
+/// #### Usage
+/// To use a context it first has to be initialized which can be achieved by calling
+/// one of either `nk_init_default`, `nk_init_fixed`, `nk_init`, `nk_init_custom`.
+/// Each takes in a font handle and a specific way of handling memory. Memory control
+/// hereby ranges from standard library to just specifying a fixed sized block of memory
+/// which nuklear has to manage itself from.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// struct nk_context ctx;
+/// nk_init_xxx(&ctx, ...);
+/// while (1) {
+/// // [...]
+/// nk_clear(&ctx);
+/// }
+/// nk_free(&ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// #### Reference
+/// Function | Description
+/// --------------------|-------------------------------------------------------
+/// __nk_init_default__ | Initializes context with standard library memory allocation (malloc,free)
+/// __nk_init_fixed__ | Initializes context from single fixed size memory block
+/// __nk_init__ | Initializes context with memory allocator callbacks for alloc and free
+/// __nk_init_custom__ | Initializes context from two buffers. One for draw commands the other for window/panel/table allocations
+/// __nk_clear__ | Called at the end of the frame to reset and prepare the context for the next frame
+/// __nk_free__ | Shutdown and free all memory allocated inside the context
+/// __nk_set_user_data__| Utility function to pass user data to draw command
*/
#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
-/* nk_init_default - Initializes a `nk_context` struct with a default standard library allocator.
- * Should be used if you don't want to be bothered with memory management in nuklear.
- * Parameters:
- * @ctx must point to an either stack or heap allocated `nk_context` struct
- * @font must point to a previously initialized font handle for more info look at font documentation
- * Return values:
- * true(1) on success
- * false(0) on failure */
+/*/// #### nk_init_default
+/// Initializes a `nk_context` struct with a default standard library allocator.
+/// Should be used if you don't want to be bothered with memory management in nuklear.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// int nk_init_default(struct nk_context *ctx, const struct nk_user_font *font);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|---------------------------------------------------------------
+/// __ctx__ | Must point to an either stack or heap allocated `nk_context` struct
+/// __font__ | Must point to a previously initialized font handle for more info look at font documentation
+///
+/// Returns either `false(0)` on failure or `true(1)` on success.
+///
+*/
NK_API int nk_init_default(struct nk_context*, const struct nk_user_font*);
#endif
-/* nk_init_fixed - Initializes a `nk_context` struct from a single fixed size memory block
- * Should be used if you want complete control over nuklears memory management.
- * Especially recommended for system with little memory or systems with virtual memory.
- * For the later case you can just allocate for example 16MB of virtual memory
- * and only the required amount of memory will actually be commited.
- * IMPORTANT: make sure the passed memory block is aligned correctly for `nk_draw_commands`
- * Parameters:
- * @ctx must point to an either stack or heap allocated `nk_context` struct
- * @memory must point to a previously allocated memory block
- * @size must contain the total size of @memory
- * @font must point to a previously initialized font handle for more info look at font documentation
- * Return values:
- * true(1) on success
- * false(0) on failure */
+/*/// #### nk_init_fixed
+/// Initializes a `nk_context` struct from single fixed size memory block
+/// Should be used if you want complete control over nuklear's memory management.
+/// Especially recommended for system with little memory or systems with virtual memory.
+/// For the later case you can just allocate for example 16MB of virtual memory
+/// and only the required amount of memory will actually be committed.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// int nk_init_fixed(struct nk_context *ctx, void *memory, nk_size size, const struct nk_user_font *font);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// !!! Warning
+/// make sure the passed memory block is aligned correctly for `nk_draw_commands`.
+///
+/// Parameter | Description
+/// ------------|--------------------------------------------------------------
+/// __ctx__ | Must point to an either stack or heap allocated `nk_context` struct
+/// __memory__ | Must point to a previously allocated memory block
+/// __size__ | Must contain the total size of __memory__
+/// __font__ | Must point to a previously initialized font handle for more info look at font documentation
+///
+/// Returns either `false(0)` on failure or `true(1)` on success.
+*/
NK_API int nk_init_fixed(struct nk_context*, void *memory, nk_size size, const struct nk_user_font*);
-/* nk_init - Initializes a `nk_context` struct with memory allocation callbacks for nuklear to allocate
- * memory from. Used internally for `nk_init_default` and provides a kitchen sink allocation
- * interface to nuklear. Can be useful for cases like monitoring memory consumption.
- * Parameters:
- * @ctx must point to an either stack or heap allocated `nk_context` struct
- * @alloc must point to a previously allocated memory allocator
- * @font must point to a previously initialized font handle for more info look at font documentation
- * Return values:
- * true(1) on success
- * false(0) on failure */
+/*/// #### nk_init
+/// Initializes a `nk_context` struct with memory allocation callbacks for nuklear to allocate
+/// memory from. Used internally for `nk_init_default` and provides a kitchen sink allocation
+/// interface to nuklear. Can be useful for cases like monitoring memory consumption.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// int nk_init(struct nk_context *ctx, struct nk_allocator *alloc, const struct nk_user_font *font);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|---------------------------------------------------------------
+/// __ctx__ | Must point to an either stack or heap allocated `nk_context` struct
+/// __alloc__ | Must point to a previously allocated memory allocator
+/// __font__ | Must point to a previously initialized font handle for more info look at font documentation
+///
+/// Returns either `false(0)` on failure or `true(1)` on success.
+*/
NK_API int nk_init(struct nk_context*, struct nk_allocator*, const struct nk_user_font*);
-/* nk_init_custom - Initializes a `nk_context` struct from two different either fixed or growing
- * buffers. The first buffer is for allocating draw commands while the second buffer is
- * used for allocating windows, panels and state tables.
- * Parameters:
- * @ctx must point to an either stack or heap allocated `nk_context` struct
- * @cmds must point to a previously initialized memory buffer either fixed or dynamic to store draw commands into
- * @pool must point to a previously initialized memory buffer either fixed or dynamic to store windows, panels and tables
- * @font must point to a previously initialized font handle for more info look at font documentation
- * Return values:
- * true(1) on success
- * false(0) on failure */
+/*/// #### nk_init_custom
+/// Initializes a `nk_context` struct from two different either fixed or growing
+/// buffers. The first buffer is for allocating draw commands while the second buffer is
+/// used for allocating windows, panels and state tables.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// int nk_init_custom(struct nk_context *ctx, struct nk_buffer *cmds, struct nk_buffer *pool, const struct nk_user_font *font);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|---------------------------------------------------------------
+/// __ctx__ | Must point to an either stack or heap allocated `nk_context` struct
+/// __cmds__ | Must point to a previously initialized memory buffer either fixed or dynamic to store draw commands into
+/// __pool__ | Must point to a previously initialized memory buffer either fixed or dynamic to store windows, panels and tables
+/// __font__ | Must point to a previously initialized font handle for more info look at font documentation
+///
+/// Returns either `false(0)` on failure or `true(1)` on success.
+*/
NK_API int nk_init_custom(struct nk_context*, struct nk_buffer *cmds, struct nk_buffer *pool, const struct nk_user_font*);
-/* nk_clear - Resets the context state at the end of the frame. This includes mostly
- * garbage collector tasks like removing windows or table not called and therefore
- * used anymore.
- * Parameters:
- * @ctx must point to a previously initialized `nk_context` struct */
+/*/// #### nk_clear
+/// Resets the context state at the end of the frame. This includes mostly
+/// garbage collector tasks like removing windows or table not called and therefore
+/// used anymore.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_clear(struct nk_context *ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to a previously initialized `nk_context` struct
+*/
NK_API void nk_clear(struct nk_context*);
-/* nk_free - Frees all memory allocated by nuklear. Not needed if context was
- * initialized with `nk_init_fixed`.
- * Parameters:
- * @ctx must point to a previously initialized `nk_context` struct */
+/*/// #### nk_free
+/// Frees all memory allocated by nuklear. Not needed if context was
+/// initialized with `nk_init_fixed`.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_free(struct nk_context *ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to a previously initialized `nk_context` struct
+*/
NK_API void nk_free(struct nk_context*);
#ifdef NK_INCLUDE_COMMAND_USERDATA
-/* nk_set_user_data - Sets the currently passed userdata passed down into each draw command.
- * Parameters:
- * @ctx must point to a previously initialized `nk_context` struct
- * @data handle with either pointer or index to be passed into every draw commands */
+/*/// #### nk_set_user_data
+/// Sets the currently passed userdata passed down into each draw command.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_set_user_data(struct nk_context *ctx, nk_handle data);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|--------------------------------------------------------------
+/// __ctx__ | Must point to a previously initialized `nk_context` struct
+/// __data__ | Handle with either pointer or index to be passed into every draw commands
+*/
NK_API void nk_set_user_data(struct nk_context*, nk_handle handle);
#endif
/* =============================================================================
@@ -609,54 +677,67 @@ NK_API void nk_set_user_data(struct nk_context*, nk_handle handle);
* INPUT
*
* =============================================================================*/
-/* The input API is responsible for holding the current input state composed of
- * mouse, key and text input states.
- * It is worth noting that no direct os or window handling is done in nuklear.
- * Instead all input state has to be provided by platform specific code. This in one hand
- * expects more work from the user and complicates usage but on the other hand
- * provides simple abstraction over a big number of platforms, libraries and other
- * already provided functionality.
- *
- * Usage
- * -------------------
- * Input state needs to be provided to nuklear by first calling `nk_input_begin`
- * which resets internal state like delta mouse position and button transistions.
- * After `nk_input_begin` all current input state needs to be provided. This includes
- * mouse motion, button and key pressed and released, text input and scrolling.
- * Both event- or state-based input handling are supported by this API
- * and should work without problems. Finally after all input state has been
- * mirrored `nk_input_end` needs to be called to finish input process.
- *
- * struct nk_context ctx;
- * nk_init_xxx(&ctx, ...);
- * while (1) {
- * Event evt;
- * nk_input_begin(&ctx);
- * while (GetEvent(&evt)) {
- * if (evt.type == MOUSE_MOVE)
- * nk_input_motion(&ctx, evt.motion.x, evt.motion.y);
- * else if (evt.type == ...) {
- * ...
- * }
- * }
- * nk_input_end(&ctx);
- * [...]
- * nk_clear(&ctx);
- * }
- * nk_free(&ctx);
- *
- * Reference
- * -------------------
- * nk_input_begin - Begins the input mirroring process. Needs to be called before all other `nk_input_xxx` calls
- * nk_input_motion - Mirrors mouse cursor position
- * nk_input_key - Mirrors key state with either pressed or released
- * nk_input_button - Mirrors mouse button state with either pressed or released
- * nk_input_scroll - Mirrors mouse scroll values
- * nk_input_char - Adds a single ASCII text character into an internal text buffer
- * nk_input_glyph - Adds a single multi-byte UTF-8 character into an internal text buffer
- * nk_input_unicode - Adds a single unicode rune into an internal text buffer
- * nk_input_end - Ends the input mirroring process by calculating state changes. Don't call any `nk_input_xxx` function referenced above after this call
- */
+/*/// ### Input
+/// The input API is responsible for holding the current input state composed of
+/// mouse, key and text input states.
+/// It is worth noting that no direct OS or window handling is done in nuklear.
+/// Instead all input state has to be provided by platform specific code. This on one hand
+/// expects more work from the user and complicates usage but on the other hand
+/// provides simple abstraction over a big number of platforms, libraries and other
+/// already provided functionality.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// nk_input_begin(&ctx);
+/// while (GetEvent(&evt)) {
+/// if (evt.type == MOUSE_MOVE)
+/// nk_input_motion(&ctx, evt.motion.x, evt.motion.y);
+/// else if (evt.type == [...]) {
+/// // [...]
+/// }
+/// } nk_input_end(&ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// #### Usage
+/// Input state needs to be provided to nuklear by first calling `nk_input_begin`
+/// which resets internal state like delta mouse position and button transistions.
+/// After `nk_input_begin` all current input state needs to be provided. This includes
+/// mouse motion, button and key pressed and released, text input and scrolling.
+/// Both event- or state-based input handling are supported by this API
+/// and should work without problems. Finally after all input state has been
+/// mirrored `nk_input_end` needs to be called to finish input process.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// struct nk_context ctx;
+/// nk_init_xxx(&ctx, ...);
+/// while (1) {
+/// Event evt;
+/// nk_input_begin(&ctx);
+/// while (GetEvent(&evt)) {
+/// if (evt.type == MOUSE_MOVE)
+/// nk_input_motion(&ctx, evt.motion.x, evt.motion.y);
+/// else if (evt.type == [...]) {
+/// // [...]
+/// }
+/// }
+/// nk_input_end(&ctx);
+/// // [...]
+/// nk_clear(&ctx);
+/// } nk_free(&ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// #### Reference
+/// Function | Description
+/// --------------------|-------------------------------------------------------
+/// __nk_input_begin__ | Begins the input mirroring process. Needs to be called before all other `nk_input_xxx` calls
+/// __nk_input_motion__ | Mirrors mouse cursor position
+/// __nk_input_key__ | Mirrors key state with either pressed or released
+/// __nk_input_button__ | Mirrors mouse button state with either pressed or released
+/// __nk_input_scroll__ | Mirrors mouse scroll values
+/// __nk_input_char__ | Adds a single ASCII text character into an internal text buffer
+/// __nk_input_glyph__ | Adds a single multi-byte UTF-8 character into an internal text buffer
+/// __nk_input_unicode__| Adds a single unicode rune into an internal text buffer
+/// __nk_input_end__ | Ends the input mirroring process by calculating state changes. Don't call any `nk_input_xxx` function referenced above after this call
+*/
enum nk_keys {
NK_KEY_NONE,
NK_KEY_SHIFT,
@@ -699,274 +780,371 @@ enum nk_buttons {
NK_BUTTON_DOUBLE,
NK_BUTTON_MAX
};
-/* nk_input_begin - Begins the input mirroring process by resetting text, scroll
- * mouse previous mouse position and movement as well as key state transistions,
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct */
+/*/// #### nk_input_begin
+/// Begins the input mirroring process by resetting text, scroll
+/// mouse, previous mouse position and movement as well as key state transitions,
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_input_begin(struct nk_context*);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to a previously initialized `nk_context` struct
+*/
NK_API void nk_input_begin(struct nk_context*);
-/* nk_input_motion - Mirros current mouse position to nuklear
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct
- * @x must constain an integer describing the current mouse cursor x-position
- * @y must constain an integer describing the current mouse cursor y-position */
+/*/// #### nk_input_motion
+/// Mirrors current mouse position to nuklear
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_input_motion(struct nk_context *ctx, int x, int y);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to a previously initialized `nk_context` struct
+/// __x__ | Must hold an integer describing the current mouse cursor x-position
+/// __y__ | Must hold an integer describing the current mouse cursor y-position
+*/
NK_API void nk_input_motion(struct nk_context*, int x, int y);
-/* nk_input_key - Mirros state of a specific key to nuklear
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct
- * @key must be any value specified in enum `nk_keys` that needs to be mirrored
- * @down must be 0 for key is up and 1 for key is down */
+/*/// #### nk_input_key
+/// Mirrors the state of a specific key to nuklear
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_input_key(struct nk_context*, enum nk_keys key, int down);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to a previously initialized `nk_context` struct
+/// __key__ | Must be any value specified in enum `nk_keys` that needs to be mirrored
+/// __down__ | Must be 0 for key is up and 1 for key is down
+*/
NK_API void nk_input_key(struct nk_context*, enum nk_keys, int down);
-/* nk_input_button - Mirros the state of a specific mouse button to nuklear
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct
- * @nk_buttons must be any value specified in enum `nk_buttons` that needs to be mirrored
- * @x must constain an integer describing mouse cursor x-position on click up/down
- * @y must constain an integer describing mouse cursor y-position on click up/down
- * @down must be 0 for key is up and 1 for key is down */
+/*/// #### nk_input_button
+/// Mirrors the state of a specific mouse button to nuklear
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_input_button(struct nk_context *ctx, enum nk_buttons btn, int x, int y, int down);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to a previously initialized `nk_context` struct
+/// __btn__ | Must be any value specified in enum `nk_buttons` that needs to be mirrored
+/// __x__ | Must contain an integer describing mouse cursor x-position on click up/down
+/// __y__ | Must contain an integer describing mouse cursor y-position on click up/down
+/// __down__ | Must be 0 for key is up and 1 for key is down
+*/
NK_API void nk_input_button(struct nk_context*, enum nk_buttons, int x, int y, int down);
-/* nk_input_char - Copies a single ASCII character into an internal text buffer
- * This is basically a helper function to quickly push ASCII characters into
- * nuklear. Note that you can only push up to NK_INPUT_MAX bytes into
- * struct `nk_input` between `nk_input_begin` and `nk_input_end`.
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct
- * @c must be a single ASCII character preferable one that can be printed */
+/*/// #### nk_input_scroll
+/// Copies the last mouse scroll value to nuklear. Is generally
+/// a scroll value. So does not have to come from mouse and could also originate
+/// TODO finish this sentence
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_input_scroll(struct nk_context *ctx, struct nk_vec2 val);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to a previously initialized `nk_context` struct
+/// __val__ | vector with both X- as well as Y-scroll value
+*/
NK_API void nk_input_scroll(struct nk_context*, struct nk_vec2 val);
-/* nk_input_char - Copies a single ASCII character into an internal text buffer
- * This is basically a helper function to quickly push ASCII characters into
- * nuklear. Note that you can only push up to NK_INPUT_MAX bytes into
- * struct `nk_input` between `nk_input_begin` and `nk_input_end`.
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct
- * @c must be a single ASCII character preferable one that can be printed */
+/*/// #### nk_input_char
+/// Copies a single ASCII character into an internal text buffer
+/// This is basically a helper function to quickly push ASCII characters into
+/// nuklear.
+///
+/// !!! Note
+/// Stores up to NK_INPUT_MAX bytes between `nk_input_begin` and `nk_input_end`.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_input_char(struct nk_context *ctx, char c);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to a previously initialized `nk_context` struct
+/// __c__ | Must be a single ASCII character preferable one that can be printed
+*/
NK_API void nk_input_char(struct nk_context*, char);
-/* nk_input_unicode - Converts a encoded unicode rune into UTF-8 and copies the result
- * into an internal text buffer.
- * Note that you can only push up to NK_INPUT_MAX bytes into
- * struct `nk_input` between `nk_input_begin` and `nk_input_end`.
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct
- * @glyph UTF-32 uncode codepoint */
+/*/// #### nk_input_glyph
+/// Converts an encoded unicode rune into UTF-8 and copies the result into an
+/// internal text buffer.
+///
+/// !!! Note
+/// Stores up to NK_INPUT_MAX bytes between `nk_input_begin` and `nk_input_end`.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_input_glyph(struct nk_context *ctx, const nk_glyph g);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to a previously initialized `nk_context` struct
+/// __g__ | UTF-32 unicode codepoint
+*/
NK_API void nk_input_glyph(struct nk_context*, const nk_glyph);
-/* nk_input_unicode - Converts a unicode rune into UTF-8 and copies the result
- * into an internal text buffer.
- * Note that you can only push up to NK_INPUT_MAX bytes into
- * struct `nk_input` between `nk_input_begin` and `nk_input_end`.
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct
- * @glyph UTF-32 uncode codepoint */
+/*/// #### nk_input_unicode
+/// Converts a unicode rune into UTF-8 and copies the result
+/// into an internal text buffer.
+/// !!! Note
+/// Stores up to NK_INPUT_MAX bytes between `nk_input_begin` and `nk_input_end`.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_input_unicode(struct nk_context*, nk_rune rune);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to a previously initialized `nk_context` struct
+/// __rune__ | UTF-32 unicode codepoint
+*/
NK_API void nk_input_unicode(struct nk_context*, nk_rune);
-/* nk_input_end - End the input mirroring process by resetting mouse grabbing
- * state to ensure the mouse cursor is not grabbed indefinitely.
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct */
+/*/// #### nk_input_end
+/// End the input mirroring process by resetting mouse grabbing
+/// state to ensure the mouse cursor is not grabbed indefinitely.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_input_end(struct nk_context *ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to a previously initialized `nk_context` struct
+*/
NK_API void nk_input_end(struct nk_context*);
/* =============================================================================
*
* DRAWING
*
* =============================================================================*/
-/* This library was designed to be render backend agnostic so it does
- * not draw anything to screen directly. Instead all drawn shapes, widgets
- * are made of, are buffered into memory and make up a command queue.
- * Each frame therefore fills the command buffer with draw commands
- * that then need to be executed by the user and his own render backend.
- * After that the command buffer needs to be cleared and a new frame can be
- * started. It is probably important to note that the command buffer is the main
- * drawing API and the optional vertex buffer API only takes this format and
- * converts it into a hardware accessible format.
- *
- * Usage
- * -------------------
- * To draw all draw commands accumulated over a frame you need your own render
- * backend able to draw a number of 2D primitives. This includes at least
- * filled and stroked rectangles, circles, text, lines, triangles and scissors.
- * As soon as this criterion is met you can iterate over each draw command
- * and execute each draw command in a interpreter like fashion:
- *
- * const struct nk_command *cmd = 0;
- * nk_foreach(cmd, &ctx) {
- * switch (cmd->type) {
- * case NK_COMMAND_LINE:
- * your_draw_line_function(...)
- * break;
- * case NK_COMMAND_RECT
- * your_draw_rect_function(...)
- * break;
- * case ...:
- * [...]
- * }
- *
- * In program flow context draw commands need to be executed after input has been
- * gathered and the complete UI with windows and their contained widgets have
- * been executed and before calling `nk_clear` which frees all previously
- * allocated draw commands.
- *
- * struct nk_context ctx;
- * nk_init_xxx(&ctx, ...);
- * while (1) {
- * Event evt;
- * nk_input_begin(&ctx);
- * while (GetEvent(&evt)) {
- * if (evt.type == MOUSE_MOVE)
- * nk_input_motion(&ctx, evt.motion.x, evt.motion.y);
- * else if (evt.type == [...]) {
- * [...]
- * }
- * }
- * nk_input_end(&ctx);
- *
- * [...]
- *
- * const struct nk_command *cmd = 0;
- * nk_foreach(cmd, &ctx) {
- * switch (cmd->type) {
- * case NK_COMMAND_LINE:
- * your_draw_line_function(...)
- * break;
- * case NK_COMMAND_RECT
- * your_draw_rect_function(...)
- * break;
- * case ...:
- * [...]
- * }
- * nk_clear(&ctx);
- * }
- * nk_free(&ctx);
- *
- * You probably noticed that you have to draw all of the UI each frame which is
- * quite wasteful. While the actual UI updating loop is quite fast rendering
- * without actually needing it is not. So there are multiple things you could do.
- *
- * First is only update on input. This of course is only an option if your
- * application only depends on the UI and does not require any outside calculations.
- * If you actually only update on input make sure to update the UI two times each
- * frame and call `nk_clear` directly after the first pass and only draw in
- * the second pass. In addition it is recommended to also add additional timers
- * to make sure the UI is not drawn more than a fixed number of frames per second.
- *
- * struct nk_context ctx;
- * nk_init_xxx(&ctx, ...);
- * while (1) {
- * [...wait for input ]
- *
- * [...do two UI passes ...]
- * do_ui(...)
- * nk_clear(&ctx);
- * do_ui(...)
- *
- * const struct nk_command *cmd = 0;
- * nk_foreach(cmd, &ctx) {
- * switch (cmd->type) {
- * case NK_COMMAND_LINE:
- * your_draw_line_function(...)
- * break;
- * case NK_COMMAND_RECT
- * your_draw_rect_function(...)
- * break;
- * case ...:
- * [...]
- * }
- * nk_clear(&ctx);
- * }
- * nk_free(&ctx);
- *
- * The second probably more applicable trick is to only draw if anything changed.
- * It is not really useful for applications with continous draw loop but
- * quite useful for desktop applications. To actually get nuklear to only
- * draw on changes you first have to define `NK_ZERO_COMMAND_MEMORY` and
- * allocate a memory buffer that will store each unique drawing output.
- * After each frame you compare the draw command memory inside the library
- * with your allocated buffer by memcmp. If memcmp detects differences
- * you have to copy the command buffer into the allocated buffer
- * and then draw like usual (this example uses fixed memory but you could
- * use dynamically allocated memory).
- *
- * [... other defines ...]
- * #define NK_ZERO_COMMAND_MEMORY
- * #include "nuklear.h"
- *
- * struct nk_context ctx;
- * void *last = calloc(1,64*1024);
- * void *buf = calloc(1,64*1024);
- * nk_init_fixed(&ctx, buf, 64*1024);
- * while (1) {
- * [...input...]
- * [...ui...]
- *
- * void *cmds = nk_buffer_memory(&ctx.memory);
- * if (memcmp(cmds, last, ctx.memory.allocated)) {
- * memcpy(last,cmds,ctx.memory.allocated);
- * const struct nk_command *cmd = 0;
- * nk_foreach(cmd, &ctx) {
- * switch (cmd->type) {
- * case NK_COMMAND_LINE:
- * your_draw_line_function(...)
- * break;
- * case NK_COMMAND_RECT
- * your_draw_rect_function(...)
- * break;
- * case ...:
- * [...]
- * }
- * }
- * }
- * nk_clear(&ctx);
- * }
- * nk_free(&ctx);
- *
- * Finally while using draw commands makes sense for higher abstracted platforms like
- * X11 and Win32 or drawing libraries it is often desirable to use graphics
- * hardware directly. Therefore it is possible to just define
- * `NK_INCLUDE_VERTEX_BUFFER_OUTPUT` which includes optional vertex output.
- * To access the vertex output you first have to convert all draw commands into
- * vertexes by calling `nk_convert` which takes in your prefered vertex format.
- * After successfully converting all draw commands just iterate over and execute all
- * vertex draw commands:
- *
- * struct nk_convert_config cfg = {};
- * static const struct nk_draw_vertex_layout_element vertex_layout[] = {
- * {NK_VERTEX_POSITION, NK_FORMAT_FLOAT, NK_OFFSETOF(struct your_vertex, pos)},
- * {NK_VERTEX_TEXCOORD, NK_FORMAT_FLOAT, NK_OFFSETOF(struct your_vertex, uv)},
- * {NK_VERTEX_COLOR, NK_FORMAT_R8G8B8A8, NK_OFFSETOF(struct your_vertex, col)},
- * {NK_VERTEX_LAYOUT_END}
- * };
- * cfg.shape_AA = NK_ANTI_ALIASING_ON;
- * cfg.line_AA = NK_ANTI_ALIASING_ON;
- * cfg.vertex_layout = vertex_layout;
- * cfg.vertex_size = sizeof(struct your_vertex);
- * cfg.vertex_alignment = NK_ALIGNOF(struct your_vertex);
- * cfg.circle_segment_count = 22;
- * cfg.curve_segment_count = 22;
- * cfg.arc_segment_count = 22;
- * cfg.global_alpha = 1.0f;
- * cfg.null = dev->null;
- *
- * struct nk_buffer cmds, verts, idx;
- * nk_buffer_init_default(&cmds);
- * nk_buffer_init_default(&verts);
- * nk_buffer_init_default(&idx);
- * nk_convert(&ctx, &cmds, &verts, &idx, &cfg);
- * nk_draw_foreach(cmd, &ctx, &cmds) {
- * if (!cmd->elem_count) continue;
- * [...]
- * }
- * nk_buffer_free(&cms);
- * nk_buffer_free(&verts);
- * nk_buffer_free(&idx);
- *
- * Reference
- * -------------------
- * nk__begin - Returns the first draw command in the context draw command list to be drawn
- * nk__next - Increments the draw command iterator to the next command inside the context draw command list
- * nk_foreach - Iteratates over each draw command inside the context draw command list
- *
- * nk_convert - Converts from the abstract draw commands list into a hardware accessable vertex format
- * nk__draw_begin - Returns the first vertex command in the context vertex draw list to be executed
- * nk__draw_next - Increments the vertex command iterator to the next command inside the context vertex command list
- * nk__draw_end - Returns the end of the vertex draw list
- * nk_draw_foreach - Iterates over each vertex draw command inside the vertex draw list
- */
+/*/// ### Drawing
+/// This library was designed to be render backend agnostic so it does
+/// not draw anything to screen directly. Instead all drawn shapes, widgets
+/// are made of, are buffered into memory and make up a command queue.
+/// Each frame therefore fills the command buffer with draw commands
+/// that then need to be executed by the user and his own render backend.
+/// After that the command buffer needs to be cleared and a new frame can be
+/// started. It is probably important to note that the command buffer is the main
+/// drawing API and the optional vertex buffer API only takes this format and
+/// converts it into a hardware accessible format.
+///
+/// #### Usage
+/// To draw all draw commands accumulated over a frame you need your own render
+/// backend able to draw a number of 2D primitives. This includes at least
+/// filled and stroked rectangles, circles, text, lines, triangles and scissors.
+/// As soon as this criterion is met you can iterate over each draw command
+/// and execute each draw command in a interpreter like fashion:
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// const struct nk_command *cmd = 0;
+/// nk_foreach(cmd, &ctx) {
+/// switch (cmd->type) {
+/// case NK_COMMAND_LINE:
+/// your_draw_line_function(...)
+/// break;
+/// case NK_COMMAND_RECT
+/// your_draw_rect_function(...)
+/// break;
+/// case //...:
+/// //[...]
+/// }
+/// }
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// In program flow context draw commands need to be executed after input has been
+/// gathered and the complete UI with windows and their contained widgets have
+/// been executed and before calling `nk_clear` which frees all previously
+/// allocated draw commands.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// struct nk_context ctx;
+/// nk_init_xxx(&ctx, ...);
+/// while (1) {
+/// Event evt;
+/// nk_input_begin(&ctx);
+/// while (GetEvent(&evt)) {
+/// if (evt.type == MOUSE_MOVE)
+/// nk_input_motion(&ctx, evt.motion.x, evt.motion.y);
+/// else if (evt.type == [...]) {
+/// [...]
+/// }
+/// }
+/// nk_input_end(&ctx);
+/// //
+/// // [...]
+/// //
+/// const struct nk_command *cmd = 0;
+/// nk_foreach(cmd, &ctx) {
+/// switch (cmd->type) {
+/// case NK_COMMAND_LINE:
+/// your_draw_line_function(...)
+/// break;
+/// case NK_COMMAND_RECT
+/// your_draw_rect_function(...)
+/// break;
+/// case ...:
+/// // [...]
+/// }
+/// nk_clear(&ctx);
+/// }
+/// nk_free(&ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// You probably noticed that you have to draw all of the UI each frame which is
+/// quite wasteful. While the actual UI updating loop is quite fast rendering
+/// without actually needing it is not. So there are multiple things you could do.
+///
+/// First is only update on input. This of course is only an option if your
+/// application only depends on the UI and does not require any outside calculations.
+/// If you actually only update on input make sure to update the UI two times each
+/// frame and call `nk_clear` directly after the first pass and only draw in
+/// the second pass. In addition it is recommended to also add additional timers
+/// to make sure the UI is not drawn more than a fixed number of frames per second.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// struct nk_context ctx;
+/// nk_init_xxx(&ctx, ...);
+/// while (1) {
+/// // [...wait for input ]
+/// // [...do two UI passes ...]
+/// do_ui(...)
+/// nk_clear(&ctx);
+/// do_ui(...)
+/// //
+/// // draw
+/// const struct nk_command *cmd = 0;
+/// nk_foreach(cmd, &ctx) {
+/// switch (cmd->type) {
+/// case NK_COMMAND_LINE:
+/// your_draw_line_function(...)
+/// break;
+/// case NK_COMMAND_RECT
+/// your_draw_rect_function(...)
+/// break;
+/// case ...:
+/// //[...]
+/// }
+/// nk_clear(&ctx);
+/// }
+/// nk_free(&ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// The second probably more applicable trick is to only draw if anything changed.
+/// It is not really useful for applications with continuous draw loop but
+/// quite useful for desktop applications. To actually get nuklear to only
+/// draw on changes you first have to define `NK_ZERO_COMMAND_MEMORY` and
+/// allocate a memory buffer that will store each unique drawing output.
+/// After each frame you compare the draw command memory inside the library
+/// with your allocated buffer by memcmp. If memcmp detects differences
+/// you have to copy the command buffer into the allocated buffer
+/// and then draw like usual (this example uses fixed memory but you could
+/// use dynamically allocated memory).
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// //[... other defines ...]
+/// #define NK_ZERO_COMMAND_MEMORY
+/// #include "nuklear.h"
+/// //
+/// // setup context
+/// struct nk_context ctx;
+/// void *last = calloc(1,64*1024);
+/// void *buf = calloc(1,64*1024);
+/// nk_init_fixed(&ctx, buf, 64*1024);
+/// //
+/// // loop
+/// while (1) {
+/// // [...input...]
+/// // [...ui...]
+/// void *cmds = nk_buffer_memory(&ctx.memory);
+/// if (memcmp(cmds, last, ctx.memory.allocated)) {
+/// memcpy(last,cmds,ctx.memory.allocated);
+/// const struct nk_command *cmd = 0;
+/// nk_foreach(cmd, &ctx) {
+/// switch (cmd->type) {
+/// case NK_COMMAND_LINE:
+/// your_draw_line_function(...)
+/// break;
+/// case NK_COMMAND_RECT
+/// your_draw_rect_function(...)
+/// break;
+/// case ...:
+/// // [...]
+/// }
+/// }
+/// }
+/// nk_clear(&ctx);
+/// }
+/// nk_free(&ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Finally while using draw commands makes sense for higher abstracted platforms like
+/// X11 and Win32 or drawing libraries it is often desirable to use graphics
+/// hardware directly. Therefore it is possible to just define
+/// `NK_INCLUDE_VERTEX_BUFFER_OUTPUT` which includes optional vertex output.
+/// To access the vertex output you first have to convert all draw commands into
+/// vertexes by calling `nk_convert` which takes in your preferred vertex format.
+/// After successfully converting all draw commands just iterate over and execute all
+/// vertex draw commands:
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// // fill configuration
+/// struct your_vertex
+/// {
+/// float pos[2]; // important to keep it to 2 floats
+/// float uv[2];
+/// unsigned char col[4];
+/// };
+/// struct nk_convert_config cfg = {};
+/// static const struct nk_draw_vertex_layout_element vertex_layout[] = {
+/// {NK_VERTEX_POSITION, NK_FORMAT_FLOAT, NK_OFFSETOF(struct your_vertex, pos)},
+/// {NK_VERTEX_TEXCOORD, NK_FORMAT_FLOAT, NK_OFFSETOF(struct your_vertex, uv)},
+/// {NK_VERTEX_COLOR, NK_FORMAT_R8G8B8A8, NK_OFFSETOF(struct your_vertex, col)},
+/// {NK_VERTEX_LAYOUT_END}
+/// };
+/// cfg.shape_AA = NK_ANTI_ALIASING_ON;
+/// cfg.line_AA = NK_ANTI_ALIASING_ON;
+/// cfg.vertex_layout = vertex_layout;
+/// cfg.vertex_size = sizeof(struct your_vertex);
+/// cfg.vertex_alignment = NK_ALIGNOF(struct your_vertex);
+/// cfg.circle_segment_count = 22;
+/// cfg.curve_segment_count = 22;
+/// cfg.arc_segment_count = 22;
+/// cfg.global_alpha = 1.0f;
+/// cfg.null = dev->null;
+/// //
+/// // setup buffers and convert
+/// struct nk_buffer cmds, verts, idx;
+/// nk_buffer_init_default(&cmds);
+/// nk_buffer_init_default(&verts);
+/// nk_buffer_init_default(&idx);
+/// nk_convert(&ctx, &cmds, &verts, &idx, &cfg);
+/// //
+/// // draw
+/// nk_draw_foreach(cmd, &ctx, &cmds) {
+/// if (!cmd->elem_count) continue;
+/// //[...]
+/// }
+/// nk_buffer_free(&cms);
+/// nk_buffer_free(&verts);
+/// nk_buffer_free(&idx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// #### Reference
+/// Function | Description
+/// --------------------|-------------------------------------------------------
+/// __nk__begin__ | Returns the first draw command in the context draw command list to be drawn
+/// __nk__next__ | Increments the draw command iterator to the next command inside the context draw command list
+/// __nk_foreach__ | Iterates over each draw command inside the context draw command list
+/// __nk_convert__ | Converts from the abstract draw commands list into a hardware accessible vertex format
+/// __nk_draw_begin__ | Returns the first vertex command in the context vertex draw list to be executed
+/// __nk__draw_next__ | Increments the vertex command iterator to the next command inside the context vertex command list
+/// __nk__draw_end__ | Returns the end of the vertex draw list
+/// __nk_draw_foreach__ | Iterates over each vertex draw command inside the vertex draw list
+*/
enum nk_anti_aliasing {NK_ANTI_ALIASING_OFF, NK_ANTI_ALIASING_ON};
enum nk_convert_result {
NK_CONVERT_SUCCESS = 0,
@@ -989,68 +1167,143 @@ struct nk_convert_config {
struct nk_draw_null_texture null; /* handle to texture with a white pixel for shape drawing */
const struct nk_draw_vertex_layout_element *vertex_layout; /* describes the vertex output format and packing */
nk_size vertex_size; /* sizeof one vertex for vertex packing */
- nk_size vertex_alignment; /* vertex alignment: Can be optained by NK_ALIGNOF */
+ nk_size vertex_alignment; /* vertex alignment: Can be obtained by NK_ALIGNOF */
};
-/* nk__begin - Returns a draw command list iterator to iterate all draw
- * commands accumulated over one frame.
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct at the end of a frame
- * Return values:
- * draw command pointer pointing to the first command inside the draw command list */
+/*/// #### nk__begin
+/// Returns a draw command list iterator to iterate all draw
+/// commands accumulated over one frame.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// const struct nk_command* nk__begin(struct nk_context*);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | must point to an previously initialized `nk_context` struct at the end of a frame
+///
+/// Returns draw command pointer pointing to the first command inside the draw command list
+*/
NK_API const struct nk_command* nk__begin(struct nk_context*);
-/* nk__next - Returns a draw command list iterator to iterate all draw
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct at the end of a frame
- * @cmd must point to an previously a draw command either returned by `nk__begin` or `nk__next`
- * Return values:
- * draw command pointer pointing to the next command inside the draw command list */
+/*/// #### nk__next
+/// Returns draw command pointer pointing to the next command inside the draw command list
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// const struct nk_command* nk__next(struct nk_context*, const struct nk_command*);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct at the end of a frame
+/// __cmd__ | Must point to an previously a draw command either returned by `nk__begin` or `nk__next`
+///
+/// Returns draw command pointer pointing to the next command inside the draw command list
+*/
NK_API const struct nk_command* nk__next(struct nk_context*, const struct nk_command*);
-/* nk_foreach - Iterates over each draw command inside the context draw command list
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct at the end of a frame
- * @cmd pointer initialized to NULL */
+/*/// #### nk_foreach
+/// Iterates over each draw command inside the context draw command list
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// #define nk_foreach(c, ctx)
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct at the end of a frame
+/// __cmd__ | Command pointer initialized to NULL
+///
+/// Iterates over each draw command inside the context draw command list
+*/
#define nk_foreach(c, ctx) for((c) = nk__begin(ctx); (c) != 0; (c) = nk__next(ctx,c))
#ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT
-/* nk_convert - converts all internal draw command into vertex draw commands and fills
- * three buffers with vertexes, vertex draw commands and vertex indicies. The vertex format
- * as well as some other configuration values have to be configurated by filling out a
- * `nk_convert_config` struct.
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct at the end of a frame
- * @cmds must point to a previously initialized buffer to hold converted vertex draw commands
- * @vertices must point to a previously initialized buffer to hold all produced verticies
- * @elements must point to a previously initialized buffer to hold all procudes vertex indicies
- * @config must point to a filled out `nk_config` struct to configure the conversion process
- * Returns:
- * returns NK_CONVERT_SUCCESS on success and a enum nk_convert_result error values if not */
+/*/// #### nk_convert
+/// Converts all internal draw commands into vertex draw commands and fills
+/// three buffers with vertexes, vertex draw commands and vertex indices. The vertex format
+/// as well as some other configuration values have to be configured by filling out a
+/// `nk_convert_config` struct.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// nk_flags nk_convert(struct nk_context *ctx, struct nk_buffer *cmds,
+/// struct nk_buffer *vertices, struct nk_buffer *elements, const struct nk_convert_config*);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct at the end of a frame
+/// __cmds__ | Must point to a previously initialized buffer to hold converted vertex draw commands
+/// __vertices__| Must point to a previously initialized buffer to hold all produced vertices
+/// __elements__| Must point to a previously initialized buffer to hold all produced vertex indices
+/// __config__ | Must point to a filled out `nk_config` struct to configure the conversion process
+///
+/// Returns one of enum nk_convert_result error codes
+///
+/// Parameter | Description
+/// --------------------------------|-----------------------------------------------------------
+/// NK_CONVERT_SUCCESS | Signals a successful draw command to vertex buffer conversion
+/// NK_CONVERT_INVALID_PARAM | An invalid argument was passed in the function call
+/// NK_CONVERT_COMMAND_BUFFER_FULL | The provided buffer for storing draw commands is full or failed to allocate more memory
+/// NK_CONVERT_VERTEX_BUFFER_FULL | The provided buffer for storing vertices is full or failed to allocate more memory
+/// NK_CONVERT_ELEMENT_BUFFER_FULL | The provided buffer for storing indicies is full or failed to allocate more memory
+*/
NK_API nk_flags nk_convert(struct nk_context*, struct nk_buffer *cmds, struct nk_buffer *vertices, struct nk_buffer *elements, const struct nk_convert_config*);
-/* nk__draw_begin - Returns a draw vertex command buffer iterator to iterate each the vertex draw command buffer
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct at the end of a frame
- * @buf must point to an previously by `nk_convert` filled out vertex draw command buffer
- * Return values:
- * vertex draw command pointer pointing to the first command inside the vertex draw command buffer */
+/*/// #### nk__draw_begin
+/// Returns a draw vertex command buffer iterator to iterate over the vertex draw command buffer
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// const struct nk_draw_command* nk__draw_begin(const struct nk_context*, const struct nk_buffer*);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct at the end of a frame
+/// __buf__ | Must point to an previously by `nk_convert` filled out vertex draw command buffer
+///
+/// Returns vertex draw command pointer pointing to the first command inside the vertex draw command buffer
+*/
NK_API const struct nk_draw_command* nk__draw_begin(const struct nk_context*, const struct nk_buffer*);
-/* nk__draw_end - Returns the vertex draw command at the end of the vertex draw command buffer
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct at the end of a frame
- * @buf must point to an previously by `nk_convert` filled out vertex draw command buffer
- * Return values:
- * vertex draw command pointer pointing to the end of the last vertex draw command inside the vertex draw command buffer */
+/*/// #### nk__draw_end
+/// Returns the vertex draw command at the end of the vertex draw command buffer
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// const struct nk_draw_command* nk__draw_end(const struct nk_context *ctx, const struct nk_buffer *buf);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct at the end of a frame
+/// __buf__ | Must point to an previously by `nk_convert` filled out vertex draw command buffer
+///
+/// Returns vertex draw command pointer pointing to the end of the last vertex draw command inside the vertex draw command buffer
+*/
NK_API const struct nk_draw_command* nk__draw_end(const struct nk_context*, const struct nk_buffer*);
-/* nk__draw_next - Increments the the vertex draw command buffer iterator
- * Parameters:
- * @cmd must point to an previously either by `nk__draw_begin` or `nk__draw_next` returned vertex draw command
- * @buf must point to an previously by `nk_convert` filled out vertex draw command buffer
- * @ctx must point to an previously initialized `nk_context` struct at the end of a frame
- * Return values:
- * vertex draw command pointer pointing to the end of the last vertex draw command inside the vertex draw command buffer */
+/*/// #### nk__draw_next
+/// Increments the vertex draw command buffer iterator
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// const struct nk_draw_command* nk__draw_next(const struct nk_draw_command*, const struct nk_buffer*, const struct nk_context*);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __cmd__ | Must point to an previously either by `nk__draw_begin` or `nk__draw_next` returned vertex draw command
+/// __buf__ | Must point to an previously by `nk_convert` filled out vertex draw command buffer
+/// __ctx__ | Must point to an previously initialized `nk_context` struct at the end of a frame
+///
+/// Returns vertex draw command pointer pointing to the end of the last vertex draw command inside the vertex draw command buffer
+*/
NK_API const struct nk_draw_command* nk__draw_next(const struct nk_draw_command*, const struct nk_buffer*, const struct nk_context*);
-/* nk_draw_foreach - Iterates over each vertex draw command inside a vertex draw command buffer
- * Parameters:
- * @cmd nk_draw_command pointer set to NULL
- * @buf must point to an previously by `nk_convert` filled out vertex draw command buffer
- * @ctx must point to an previously initialized `nk_context` struct at the end of a frame */
+/*/// #### nk_draw_foreach
+/// Iterates over each vertex draw command inside a vertex draw command buffer
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// #define nk_draw_foreach(cmd,ctx, b)
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __cmd__ | `nk_draw_command`iterator set to NULL
+/// __buf__ | Must point to an previously by `nk_convert` filled out vertex draw command buffer
+/// __ctx__ | Must point to an previously initialized `nk_context` struct at the end of a frame
+*/
#define nk_draw_foreach(cmd,ctx, b) for((cmd)=nk__draw_begin(ctx, b); (cmd)!=0; (cmd)=nk__draw_next(cmd, b, ctx))
#endif
/* =============================================================================
@@ -1058,740 +1311,1718 @@ NK_API const struct nk_draw_command* nk__draw_next(const struct nk_draw_command*
* WINDOW
*
* =============================================================================
- * Windows are the main persistent state used inside nuklear and are life time
- * controlled by simply "retouching" (i.e. calling) each window each frame.
- * All widgets inside nuklear can only be added inside function pair `nk_begin_xxx`
- * and `nk_end`. Calling any widgets outside these two functions will result in an
- * assert in debug or no state change in release mode.
- *
- * Each window holds frame persistent state like position, size, flags, state tables,
- * and some garbage collected internal persistent widget state. Each window
- * is linked into a window stack list which determines the drawing and overlapping
- * order. The topmost window thereby is the currently active window.
- *
- * To change window position inside the stack occurs either automatically by
- * user input by being clicked on or programatically by calling `nk_window_focus`.
- * Windows by default are visible unless explicitly being defined with flag
- * `NK_WINDOW_HIDDEN`, the user clicked the close button on windows with flag
- * `NK_WINDOW_CLOSABLE` or if a window was explicitly hidden by calling
- * `nk_window_show`. To explicitly close and destroy a window call `nk_window_close`.
- *
- * Usage
- * -------------------
- * To create and keep a window you have to call one of the two `nk_begin_xxx`
- * functions to start window declarations and `nk_end` at the end. Furthermore it
- * is recommended to check the return value of `nk_begin_xxx` and only process
- * widgets inside the window if the value is not 0. Either way you have to call
- * `nk_end` at the end of window declarations. Furthmore do not attempt to
- * nest `nk_begin_xxx` calls which will hopefully result in an assert or if not
- * in a segmation fault.
- *
- * if (nk_begin_xxx(...) {
- * [... widgets ...]
- * }
- * nk_end(ctx);
- *
- * In the grand concept window and widget declarations need to occur after input
- * handling and before drawing to screen. Not doing so can result in higher
- * latency or at worst invalid behavior. Furthermore make sure that `nk_clear`
- * is called at the end of the frame. While nuklears default platform backends
- * already call `nk_clear` for you if you write your own backend not calling
- * `nk_clear` can cause asserts or even worse undefined behavior.
- *
- * struct nk_context ctx;
- * nk_init_xxx(&ctx, ...);
- * while (1) {
- * Event evt;
- * nk_input_begin(&ctx);
- * while (GetEvent(&evt)) {
- * if (evt.type == MOUSE_MOVE)
- * nk_input_motion(&ctx, evt.motion.x, evt.motion.y);
- * else if (evt.type == [...]) {
- * nk_input_xxx(...);
- * }
- * }
- * nk_input_end(&ctx);
- *
- * if (nk_begin_xxx(...) {
- * [...]
- * }
- * nk_end(ctx);
- *
- * const struct nk_command *cmd = 0;
- * nk_foreach(cmd, &ctx) {
- * case NK_COMMAND_LINE:
- * your_draw_line_function(...)
- * break;
- * case NK_COMMAND_RECT
- * your_draw_rect_function(...)
- * break;
- * case ...:
- * [...]
- * }
- * nk_clear(&ctx);
- * }
- * nk_free(&ctx);
- *
- * Reference
- * -------------------
- * nk_begin - starts a new window; needs to be called every frame for every window (unless hidden) or otherwise the window gets removed
- * nk_begin_titled - extended window start with seperated title and identifier to allow multiple windows with same name but not title
- * nk_end - needs to be called at the end of the window building process to process scaling, scrollbars and general cleanup
- *
- * nk_window_find - finds and returns the window with give name
- * nk_window_get_bounds - returns a rectangle with screen position and size of the currently processed window.
- * nk_window_get_position - returns the position of the currently processed window
- * nk_window_get_size - returns the size with width and height of the currently processed window
- * nk_window_get_width - returns the width of the currently processed window
- * nk_window_get_height - returns the height of the currently processed window
- * nk_window_get_panel - returns the underlying panel which contains all processing state of the currnet window
- * nk_window_get_content_region - returns the position and size of the currently visible and non-clipped space inside the currently processed window
- * nk_window_get_content_region_min - returns the upper rectangle position of the currently visible and non-clipped space inside the currently processed window
- * nk_window_get_content_region_max - returns the upper rectangle position of the currently visible and non-clipped space inside the currently processed window
- * nk_window_get_content_region_size - returns the size of the currently visible and non-clipped space inside the currently processed window
- * nk_window_get_canvas - returns the draw command buffer. Can be used to draw custom widgets
- *
- * nk_window_has_focus - returns if the currently processed window is currently active
- * nk_window_is_collapsed - returns if the window with given name is currently minimized/collapsed
- * nk_window_is_closed - returns if the currently processed window was closed
- * nk_window_is_hidden - returns if the currently processed window was hidden
- * nk_window_is_active - same as nk_window_has_focus for some reason
- * nk_window_is_hovered - returns if the currently processed window is currently being hovered by mouse
- * nk_window_is_any_hovered - return if any wndow currently hovered
- * nk_item_is_any_active - returns if any window or widgets is currently hovered or active
- *
- * nk_window_set_bounds - updates position and size of the currently processed window
- * nk_window_set_position - updates position of the currently process window
- * nk_window_set_size - updates the size of the currently processed window
- * nk_window_set_focus - set the currently processed window as active window
- *
- * nk_window_close - closes the window with given window name which deletes the window at the end of the frame
- * nk_window_collapse - collapses the window with given window name
- * nk_window_collapse_if - collapses the window with given window name if the given condition was met
- * nk_window_show - hides a visible or reshows a hidden window
- * nk_window_show_if - hides/shows a window depending on condition
- */
+/// ### Window
+/// Windows are the main persistent state used inside nuklear and are life time
+/// controlled by simply "retouching" (i.e. calling) each window each frame.
+/// All widgets inside nuklear can only be added inside the function pair `nk_begin_xxx`
+/// and `nk_end`. Calling any widgets outside these two functions will result in an
+/// assert in debug or no state change in release mode.
+///
+/// Each window holds frame persistent state like position, size, flags, state tables,
+/// and some garbage collected internal persistent widget state. Each window
+/// is linked into a window stack list which determines the drawing and overlapping
+/// order. The topmost window thereby is the currently active window.
+///
+/// To change window position inside the stack occurs either automatically by
+/// user input by being clicked on or programmatically by calling `nk_window_focus`.
+/// Windows by default are visible unless explicitly being defined with flag
+/// `NK_WINDOW_HIDDEN`, the user clicked the close button on windows with flag
+/// `NK_WINDOW_CLOSABLE` or if a window was explicitly hidden by calling
+/// `nk_window_show`. To explicitly close and destroy a window call `nk_window_close`.
+///
+/// #### Usage
+/// To create and keep a window you have to call one of the two `nk_begin_xxx`
+/// functions to start window declarations and `nk_end` at the end. Furthermore it
+/// is recommended to check the return value of `nk_begin_xxx` and only process
+/// widgets inside the window if the value is not 0. Either way you have to call
+/// `nk_end` at the end of window declarations. Furthermore, do not attempt to
+/// nest `nk_begin_xxx` calls which will hopefully result in an assert or if not
+/// in a segmentation fault.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// if (nk_begin_xxx(...) {
+/// // [... widgets ...]
+/// }
+/// nk_end(ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// In the grand concept window and widget declarations need to occur after input
+/// handling and before drawing to screen. Not doing so can result in higher
+/// latency or at worst invalid behavior. Furthermore make sure that `nk_clear`
+/// is called at the end of the frame. While nuklear's default platform backends
+/// already call `nk_clear` for you if you write your own backend not calling
+/// `nk_clear` can cause asserts or even worse undefined behavior.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// struct nk_context ctx;
+/// nk_init_xxx(&ctx, ...);
+/// while (1) {
+/// Event evt;
+/// nk_input_begin(&ctx);
+/// while (GetEvent(&evt)) {
+/// if (evt.type == MOUSE_MOVE)
+/// nk_input_motion(&ctx, evt.motion.x, evt.motion.y);
+/// else if (evt.type == [...]) {
+/// nk_input_xxx(...);
+/// }
+/// }
+/// nk_input_end(&ctx);
+///
+/// if (nk_begin_xxx(...) {
+/// //[...]
+/// }
+/// nk_end(ctx);
+///
+/// const struct nk_command *cmd = 0;
+/// nk_foreach(cmd, &ctx) {
+/// case NK_COMMAND_LINE:
+/// your_draw_line_function(...)
+/// break;
+/// case NK_COMMAND_RECT
+/// your_draw_rect_function(...)
+/// break;
+/// case //...:
+/// //[...]
+/// }
+/// nk_clear(&ctx);
+/// }
+/// nk_free(&ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// #### Reference
+/// Function | Description
+/// ------------------------------------|----------------------------------------
+/// nk_begin | Starts a new window; needs to be called every frame for every window (unless hidden) or otherwise the window gets removed
+/// nk_begin_titled | Extended window start with separated title and identifier to allow multiple windows with same name but not title
+/// nk_end | Needs to be called at the end of the window building process to process scaling, scrollbars and general cleanup
+//
+/// nk_window_find | Finds and returns the window with give name
+/// nk_window_get_bounds | Returns a rectangle with screen position and size of the currently processed window.
+/// nk_window_get_position | Returns the position of the currently processed window
+/// nk_window_get_size | Returns the size with width and height of the currently processed window
+/// nk_window_get_width | Returns the width of the currently processed window
+/// nk_window_get_height | Returns the height of the currently processed window
+/// nk_window_get_panel | Returns the underlying panel which contains all processing state of the current window
+/// nk_window_get_content_region | Returns the position and size of the currently visible and non-clipped space inside the currently processed window
+/// nk_window_get_content_region_min | Returns the upper rectangle position of the currently visible and non-clipped space inside the currently processed window
+/// nk_window_get_content_region_max | Returns the upper rectangle position of the currently visible and non-clipped space inside the currently processed window
+/// nk_window_get_content_region_size | Returns the size of the currently visible and non-clipped space inside the currently processed window
+/// nk_window_get_canvas | Returns the draw command buffer. Can be used to draw custom widgets
+/// nk_window_get_scroll | Gets the scroll offset of the current window
+/// nk_window_has_focus | Returns if the currently processed window is currently active
+/// nk_window_is_collapsed | Returns if the window with given name is currently minimized/collapsed
+/// nk_window_is_closed | Returns if the currently processed window was closed
+/// nk_window_is_hidden | Returns if the currently processed window was hidden
+/// nk_window_is_active | Same as nk_window_has_focus for some reason
+/// nk_window_is_hovered | Returns if the currently processed window is currently being hovered by mouse
+/// nk_window_is_any_hovered | Return if any window currently hovered
+/// nk_item_is_any_active | Returns if any window or widgets is currently hovered or active
+//
+/// nk_window_set_bounds | Updates position and size of the currently processed window
+/// nk_window_set_position | Updates position of the currently process window
+/// nk_window_set_size | Updates the size of the currently processed window
+/// nk_window_set_focus | Set the currently processed window as active window
+/// nk_window_set_scroll | Sets the scroll offset of the current window
+//
+/// nk_window_close | Closes the window with given window name which deletes the window at the end of the frame
+/// nk_window_collapse | Collapses the window with given window name
+/// nk_window_collapse_if | Collapses the window with given window name if the given condition was met
+/// nk_window_show | Hides a visible or reshows a hidden window
+/// nk_window_show_if | Hides/shows a window depending on condition
+*/
+/*
+/// #### nk_panel_flags
+/// Flag | Description
+/// ----------------------------|----------------------------------------
+/// NK_WINDOW_BORDER | Draws a border around the window to visually separate window from the background
+/// NK_WINDOW_MOVABLE | The movable flag indicates that a window can be moved by user input or by dragging the window header
+/// NK_WINDOW_SCALABLE | The scalable flag indicates that a window can be scaled by user input by dragging a scaler icon at the button of the window
+/// NK_WINDOW_CLOSABLE | Adds a closable icon into the header
+/// NK_WINDOW_MINIMIZABLE | Adds a minimize icon into the header
+/// NK_WINDOW_NO_SCROLLBAR | Removes the scrollbar from the window
+/// NK_WINDOW_TITLE | Forces a header at the top at the window showing the title
+/// NK_WINDOW_SCROLL_AUTO_HIDE | Automatically hides the window scrollbar if no user interaction: also requires delta time in `nk_context` to be set each frame
+/// NK_WINDOW_BACKGROUND | Always keep window in the background
+/// NK_WINDOW_SCALE_LEFT | Puts window scaler in the left-bottom corner instead right-bottom
+/// NK_WINDOW_NO_INPUT | Prevents window of scaling, moving or getting focus
+///
+/// #### nk_collapse_states
+/// State | Description
+/// ----------------|-----------------------------------------------------------
+/// __NK_MINIMIZED__| UI section is collased and not visibile until maximized
+/// __NK_MAXIMIZED__| UI section is extended and visibile until minimized
+///
+*/
enum nk_panel_flags {
- NK_WINDOW_BORDER = NK_FLAG(0), /* Draws a border around the window to visually separate window from the background */
- NK_WINDOW_MOVABLE = NK_FLAG(1), /* The movable flag indicates that a window can be moved by user input or by dragging the window header */
- NK_WINDOW_SCALABLE = NK_FLAG(2), /* The scalable flag indicates that a window can be scaled by user input by dragging a scaler icon at the button of the window */
- NK_WINDOW_CLOSABLE = NK_FLAG(3), /* adds a closable icon into the header */
- NK_WINDOW_MINIMIZABLE = NK_FLAG(4), /* adds a minimize icon into the header */
- NK_WINDOW_NO_SCROLLBAR = NK_FLAG(5), /* Removes the scrollbar from the window */
- NK_WINDOW_TITLE = NK_FLAG(6), /* Forces a header at the top at the window showing the title */
- NK_WINDOW_SCROLL_AUTO_HIDE = NK_FLAG(7), /* Automatically hides the window scrollbar if no user interaction: also requires delta time in `nk_context` to be set each frame */
- NK_WINDOW_BACKGROUND = NK_FLAG(8), /* Always keep window in the background */
- NK_WINDOW_SCALE_LEFT = NK_FLAG(9), /* Puts window scaler in the left-ottom corner instead right-bottom*/
- NK_WINDOW_NO_INPUT = NK_FLAG(10) /* Prevents window of scaling, moving or getting focus */
+ NK_WINDOW_BORDER = NK_FLAG(0),
+ NK_WINDOW_MOVABLE = NK_FLAG(1),
+ NK_WINDOW_SCALABLE = NK_FLAG(2),
+ NK_WINDOW_CLOSABLE = NK_FLAG(3),
+ NK_WINDOW_MINIMIZABLE = NK_FLAG(4),
+ NK_WINDOW_NO_SCROLLBAR = NK_FLAG(5),
+ NK_WINDOW_TITLE = NK_FLAG(6),
+ NK_WINDOW_SCROLL_AUTO_HIDE = NK_FLAG(7),
+ NK_WINDOW_BACKGROUND = NK_FLAG(8),
+ NK_WINDOW_SCALE_LEFT = NK_FLAG(9),
+ NK_WINDOW_NO_INPUT = NK_FLAG(10)
};
-/* nk_begin - starts a new window; needs to be called every frame for every window (unless hidden) or otherwise the window gets removed
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct
- * @title window title and identifier. Needs to be persitent over frames to identify the window
- * @bounds initial position and window size. However if you do not define `NK_WINDOW_SCALABLE` or `NK_WINDOW_MOVABLE` you can set window position and size every frame
- * @flags window flags defined in `enum nk_panel_flags` with a number of different window behaviors
- * Return values:
- * returns 1 if the window can be filled up with widgets from this point until `nk_end or 0 otherwise for example if minimized `*/
+/*/// #### nk_begin
+/// Starts a new window; needs to be called every frame for every
+/// window (unless hidden) or otherwise the window gets removed
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// int nk_begin(struct nk_context *ctx, const char *title, struct nk_rect bounds, nk_flags flags);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __title__ | Window title and identifier. Needs to be persistent over frames to identify the window
+/// __bounds__ | Initial position and window size. However if you do not define `NK_WINDOW_SCALABLE` or `NK_WINDOW_MOVABLE` you can set window position and size every frame
+/// __flags__ | Window flags defined in the nk_panel_flags section with a number of different window behaviors
+///
+/// Returns `true(1)` if the window can be filled up with widgets from this point
+/// until `nk_end` or `false(0)` otherwise for example if minimized
+*/
NK_API int nk_begin(struct nk_context *ctx, const char *title, struct nk_rect bounds, nk_flags flags);
-/* nk_begin_titled - extended window start with seperated title and identifier to allow multiple windows with same name but not title
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct
- * @name window identifier. Needs to be persitent over frames to identify the window
- * @title window title displayed inside header if flag `NK_WINDOW_TITLE` or either `NK_WINDOW_CLOSABLE` or `NK_WINDOW_MINIMIZED` was set
- * @bounds initial position and window size. However if you do not define `NK_WINDOW_SCALABLE` or `NK_WINDOW_MOVABLE` you can set window position and size every frame
- * @flags window flags defined in `enum nk_panel_flags` with a number of different window behaviors
- * Return values:
- * returns 1 if the window can be filled up with widgets from this point until `nk_end or 0 otherwise `*/
+/*/// #### nk_begin_titled
+/// Extended window start with separated title and identifier to allow multiple
+/// windows with same title but not name
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// int nk_begin_titled(struct nk_context *ctx, const char *name, const char *title, struct nk_rect bounds, nk_flags flags);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __name__ | Window identifier. Needs to be persistent over frames to identify the window
+/// __title__ | Window title displayed inside header if flag `NK_WINDOW_TITLE` or either `NK_WINDOW_CLOSABLE` or `NK_WINDOW_MINIMIZED` was set
+/// __bounds__ | Initial position and window size. However if you do not define `NK_WINDOW_SCALABLE` or `NK_WINDOW_MOVABLE` you can set window position and size every frame
+/// __flags__ | Window flags defined in the nk_panel_flags section with a number of different window behaviors
+///
+/// Returns `true(1)` if the window can be filled up with widgets from this point
+/// until `nk_end` or `false(0)` otherwise for example if minimized
+*/
NK_API int nk_begin_titled(struct nk_context *ctx, const char *name, const char *title, struct nk_rect bounds, nk_flags flags);
-/* nk_end - needs to be called at the end of the window building process to process scaling, scrollbars and general cleanup.
- * All widget calls after this functions will result in asserts or no state changes
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct */
+/*/// #### nk_end
+/// Needs to be called at the end of the window building process to process scaling, scrollbars and general cleanup.
+/// All widget calls after this functions will result in asserts or no state changes
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_end(struct nk_context *ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+*/
NK_API void nk_end(struct nk_context *ctx);
-/* nk_window_find - finds and returns the window with give name
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct
- * @name window identifier
- * Return values:
- * returns a `nk_window` struct pointing to the idified window or 0 if no window with given name was found */
+/*/// #### nk_window_find
+/// Finds and returns a window from passed name
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// struct nk_window *nk_window_find(struct nk_context *ctx, const char *name);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __name__ | Window identifier
+///
+/// Returns a `nk_window` struct pointing to the identified window or NULL if
+/// no window with the given name was found
+*/
NK_API struct nk_window *nk_window_find(struct nk_context *ctx, const char *name);
-/* nk_window_get_bounds - returns a rectangle with screen position and size of the currently processed window.
- * IMPORTANT: only call this function between calls `nk_begin_xxx` and `nk_end`
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct
- * Return values:
- * returns a `nk_rect` struct with window upper left position and size */
+/*/// #### nk_window_get_bounds
+/// Returns a rectangle with screen position and size of the currently processed window
+///
+/// !!! WARNING
+/// Only call this function between calls `nk_begin_xxx` and `nk_end`
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// struct nk_rect nk_window_get_bounds(const struct nk_context *ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+///
+/// Returns a `nk_rect` struct with window upper left window position and size
+*/
NK_API struct nk_rect nk_window_get_bounds(const struct nk_context *ctx);
-/* nk_window_get_position - returns the position of the currently processed window.
- * IMPORTANT: only call this function between calls `nk_begin_xxx` and `nk_end`
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct
- * Return values:
- * returns a `nk_vec2` struct with window upper left position */
+/*/// #### nk_window_get_position
+/// Returns the position of the currently processed window.
+///
+/// !!! WARNING
+/// Only call this function between calls `nk_begin_xxx` and `nk_end`
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// struct nk_vec2 nk_window_get_position(const struct nk_context *ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+///
+/// Returns a `nk_vec2` struct with window upper left position
+*/
NK_API struct nk_vec2 nk_window_get_position(const struct nk_context *ctx);
-/* nk_window_get_size - returns the size with width and height of the currently processed window.
- * IMPORTANT: only call this function between calls `nk_begin_xxx` and `nk_end`
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct
- * Return values:
- * returns a `nk_vec2` struct with window size */
+/*/// #### nk_window_get_size
+/// Returns the size with width and height of the currently processed window.
+///
+/// !!! WARNING
+/// Only call this function between calls `nk_begin_xxx` and `nk_end`
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// struct nk_vec2 nk_window_get_size(const struct nk_context *ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+///
+/// Returns a `nk_vec2` struct with window width and height
+*/
NK_API struct nk_vec2 nk_window_get_size(const struct nk_context*);
-/* nk_window_get_width - returns the width of the currently processed window.
- * IMPORTANT: only call this function between calls `nk_begin_xxx` and `nk_end`
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct
- * Return values:
- * returns the window width */
+/*/// #### nk_window_get_width
+/// Returns the width of the currently processed window.
+///
+/// !!! WARNING
+/// Only call this function between calls `nk_begin_xxx` and `nk_end`
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// float nk_window_get_width(const struct nk_context *ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+///
+/// Returns the current window width
+*/
NK_API float nk_window_get_width(const struct nk_context*);
-/* nk_window_get_height - returns the height of the currently processed window.
- * IMPORTANT: only call this function between calls `nk_begin_xxx` and `nk_end`
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct
- * Return values:
- * returns the window height */
+/*/// #### nk_window_get_height
+/// Returns the height of the currently processed window.
+///
+/// !!! WARNING
+/// Only call this function between calls `nk_begin_xxx` and `nk_end`
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// float nk_window_get_height(const struct nk_context *ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+///
+/// Returns the current window height
+*/
NK_API float nk_window_get_height(const struct nk_context*);
-/* nk_window_get_panel - returns the underlying panel which contains all processing state of the currnet window.
- * IMPORTANT: only call this function between calls `nk_begin_xxx` and `nk_end`
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct
- * Return values:
- * returns a pointer to window internal `nk_panel` state. DO NOT keep this pointer around it is only valid until `nk_end` */
+/*/// #### nk_window_get_panel
+/// Returns the underlying panel which contains all processing state of the current window.
+///
+/// !!! WARNING
+/// Only call this function between calls `nk_begin_xxx` and `nk_end`
+/// !!! WARNING
+/// Do not keep the returned panel pointer around, it is only valid until `nk_end`
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// struct nk_panel* nk_window_get_panel(struct nk_context *ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+///
+/// Returns a pointer to window internal `nk_panel` state.
+*/
NK_API struct nk_panel* nk_window_get_panel(struct nk_context*);
-/* nk_window_get_content_region - returns the position and size of the currently visible and non-clipped space inside the currently processed window.
- * IMPORTANT: only call this function between calls `nk_begin_xxx` and `nk_end`
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct
- * Return values:
- * returns `nk_rect` struct with screen position and size (no scrollbar offset) of the visible space inside the current window */
+/*/// #### nk_window_get_content_region
+/// Returns the position and size of the currently visible and non-clipped space
+/// inside the currently processed window.
+///
+/// !!! WARNING
+/// Only call this function between calls `nk_begin_xxx` and `nk_end`
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// struct nk_rect nk_window_get_content_region(struct nk_context *ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+///
+/// Returns `nk_rect` struct with screen position and size (no scrollbar offset)
+/// of the visible space inside the current window
+*/
NK_API struct nk_rect nk_window_get_content_region(struct nk_context*);
-/* nk_window_get_content_region_min - returns the upper left position of the currently visible and non-clipped space inside the currently processed window.
- * IMPORTANT: only call this function between calls `nk_begin_xxx` and `nk_end`
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct
- * Return values:
- * returns `nk_vec2` struct with upper left screen position (no scrollbar offset) of the visible space inside the current window */
+/*/// #### nk_window_get_content_region_min
+/// Returns the upper left position of the currently visible and non-clipped
+/// space inside the currently processed window.
+///
+/// !!! WARNING
+/// Only call this function between calls `nk_begin_xxx` and `nk_end`
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// struct nk_vec2 nk_window_get_content_region_min(struct nk_context *ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+///
+/// returns `nk_vec2` struct with upper left screen position (no scrollbar offset)
+/// of the visible space inside the current window
+*/
NK_API struct nk_vec2 nk_window_get_content_region_min(struct nk_context*);
-/* nk_window_get_content_region_max - returns the lower right screen position of the currently visible and non-clipped space inside the currently processed window.
- * IMPORTANT: only call this function between calls `nk_begin_xxx` and `nk_end`
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct
- * Return values:
- * returns `nk_vec2` struct with lower right screen position (no scrollbar offset) of the visible space inside the current window */
+/*/// #### nk_window_get_content_region_max
+/// Returns the lower right screen position of the currently visible and
+/// non-clipped space inside the currently processed window.
+///
+/// !!! WARNING
+/// Only call this function between calls `nk_begin_xxx` and `nk_end`
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// struct nk_vec2 nk_window_get_content_region_max(struct nk_context *ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+///
+/// Returns `nk_vec2` struct with lower right screen position (no scrollbar offset)
+/// of the visible space inside the current window
+*/
NK_API struct nk_vec2 nk_window_get_content_region_max(struct nk_context*);
-/* nk_window_get_content_region_size - returns the size of the currently visible and non-clipped space inside the currently processed window
- * IMPORTANT: only call this function between calls `nk_begin_xxx` and `nk_end`
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct
- * Return values:
- * returns `nk_vec2` struct with size the visible space inside the current window */
+/*/// #### nk_window_get_content_region_size
+/// Returns the size of the currently visible and non-clipped space inside the
+/// currently processed window
+///
+/// !!! WARNING
+/// Only call this function between calls `nk_begin_xxx` and `nk_end`
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// struct nk_vec2 nk_window_get_content_region_size(struct nk_context *ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+///
+/// Returns `nk_vec2` struct with size the visible space inside the current window
+*/
NK_API struct nk_vec2 nk_window_get_content_region_size(struct nk_context*);
-/* nk_window_get_canvas - returns the draw command buffer. Can be used to draw custom widgets
- * IMPORTANT: only call this function between calls `nk_begin_xxx` and `nk_end`
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct
- * Return values:
- * returns a pointer to window internal `nk_command_buffer` struct used as drawing canvas. Can be used to do custom drawing */
+/*/// #### nk_window_get_canvas
+/// Returns the draw command buffer. Can be used to draw custom widgets
+/// !!! WARNING
+/// Only call this function between calls `nk_begin_xxx` and `nk_end`
+/// !!! WARNING
+/// Do not keep the returned command buffer pointer around it is only valid until `nk_end`
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// struct nk_command_buffer* nk_window_get_canvas(struct nk_context *ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+///
+/// Returns a pointer to window internal `nk_command_buffer` struct used as
+/// drawing canvas. Can be used to do custom drawing.
+*/
NK_API struct nk_command_buffer* nk_window_get_canvas(struct nk_context*);
-/* nk_window_has_focus - returns if the currently processed window is currently active
- * IMPORTANT: only call this function between calls `nk_begin_xxx` and `nk_end`
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct
- * Return values:
- * returns 0 if current window is not active or 1 if it is */
+/*/// #### nk_window_get_scroll
+/// Gets the scroll offset for the current window
+/// !!! WARNING
+/// Only call this function between calls `nk_begin_xxx` and `nk_end`
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_window_get_scroll(struct nk_context *ctx, nk_uint *offset_x, nk_uint *offset_y);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// -------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __offset_x__ | A pointer to the x offset output (or NULL to ignore)
+/// __offset_y__ | A pointer to the y offset output (or NULL to ignore)
+*/
+NK_API void nk_window_get_scroll(struct nk_context*, nk_uint *offset_x, nk_uint *offset_y);
+/*/// #### nk_window_has_focus
+/// Returns if the currently processed window is currently active
+/// !!! WARNING
+/// Only call this function between calls `nk_begin_xxx` and `nk_end`
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// int nk_window_has_focus(const struct nk_context *ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+///
+/// Returns `false(0)` if current window is not active or `true(1)` if it is
+*/
NK_API int nk_window_has_focus(const struct nk_context*);
-/* nk_window_is_collapsed - returns if the window with given name is currently minimized/collapsed
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct
- * @name of window you want to check is collapsed
- * Return values:
- * returns 1 if current window is minimized and 0 if window not found or is not minimized */
+/*/// #### nk_window_is_hovered
+/// Return if the current window is being hovered
+/// !!! WARNING
+/// Only call this function between calls `nk_begin_xxx` and `nk_end`
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// int nk_window_is_hovered(struct nk_context *ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+///
+/// Returns `true(1)` if current window is hovered or `false(0)` otherwise
+*/
+NK_API int nk_window_is_hovered(struct nk_context*);
+/*/// #### nk_window_is_collapsed
+/// Returns if the window with given name is currently minimized/collapsed
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// int nk_window_is_collapsed(struct nk_context *ctx, const char *name);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __name__ | Identifier of window you want to check if it is collapsed
+///
+/// Returns `true(1)` if current window is minimized and `false(0)` if window not
+/// found or is not minimized
+*/
NK_API int nk_window_is_collapsed(struct nk_context *ctx, const char *name);
-/* nk_window_is_closed - returns if the window with given name was closed by calling `nk_close`
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct
- * @name of window you want to check is closed
- * Return values:
- * returns 1 if current window was closed or 0 window not found or not closed */
+/*/// #### nk_window_is_closed
+/// Returns if the window with given name was closed by calling `nk_close`
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// int nk_window_is_closed(struct nk_context *ctx, const char *name);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __name__ | Identifier of window you want to check if it is closed
+///
+/// Returns `true(1)` if current window was closed or `false(0)` window not found or not closed
+*/
NK_API int nk_window_is_closed(struct nk_context*, const char*);
-/* nk_window_is_hidden - returns if the window with given name is hidden
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct
- * @name of window you want to check is hidden
- * Return values:
- * returns 1 if current window is hidden or 0 window not found or visible */
+/*/// #### nk_window_is_hidden
+/// Returns if the window with given name is hidden
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// int nk_window_is_hidden(struct nk_context *ctx, const char *name);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __name__ | Identifier of window you want to check if it is hidden
+///
+/// Returns `true(1)` if current window is hidden or `false(0)` window not found or visible
+*/
NK_API int nk_window_is_hidden(struct nk_context*, const char*);
-/* nk_window_is_active - same as nk_window_has_focus for some reason
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct
- * @name of window you want to check is hidden
- * Return values:
- * returns 1 if current window is active or 0 window not found or not active */
+/*/// #### nk_window_is_active
+/// Same as nk_window_has_focus for some reason
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// int nk_window_is_active(struct nk_context *ctx, const char *name);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __name__ | Identifier of window you want to check if it is active
+///
+/// Returns `true(1)` if current window is active or `false(0)` window not found or not active
+*/
NK_API int nk_window_is_active(struct nk_context*, const char*);
-/* nk_window_is_hovered - return if the current window is being hovered
- * IMPORTANT: only call this function between calls `nk_begin_xxx` and `nk_end`
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct
- * Return values:
- * returns 1 if current window is hovered or 0 otherwise */
-NK_API int nk_window_is_hovered(struct nk_context*);
-/* nk_window_is_any_hovered - returns if the any window is being hovered
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct
- * Return values:
- * returns 1 if any window is hovered or 0 otherwise */
+/*/// #### nk_window_is_any_hovered
+/// Returns if the any window is being hovered
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// int nk_window_is_any_hovered(struct nk_context*);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+///
+/// Returns `true(1)` if any window is hovered or `false(0)` otherwise
+*/
NK_API int nk_window_is_any_hovered(struct nk_context*);
-/* nk_item_is_any_active - returns if the any window is being hovered or any widget is currently active.
- * Can be used to decide if input should be processed by UI or your specific input handling.
- * Example could be UI and 3D camera to move inside a 3D space.
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct
- * Return values:
- * returns 1 if any window is hovered or any item is active or 0 otherwise */
+/*/// #### nk_item_is_any_active
+/// Returns if the any window is being hovered or any widget is currently active.
+/// Can be used to decide if input should be processed by UI or your specific input handling.
+/// Example could be UI and 3D camera to move inside a 3D space.
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// int nk_item_is_any_active(struct nk_context*);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+///
+/// Returns `true(1)` if any window is hovered or any item is active or `false(0)` otherwise
+*/
NK_API int nk_item_is_any_active(struct nk_context*);
-/* nk_window_set_bounds - updates position and size of the currently processed window
- * IMPORTANT: only call this function between calls `nk_begin_xxx` and `nk_end`
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct
- * @bounds points to a `nk_rect` struct with the new position and size of currently active window */
-NK_API void nk_window_set_bounds(struct nk_context*, struct nk_rect bounds);
-/* nk_window_set_position - updates position of the currently processed window
- * IMPORTANT: only call this function between calls `nk_begin_xxx` and `nk_end`
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct
- * @pos points to a `nk_vec2` struct with the new position of currently active window */
-NK_API void nk_window_set_position(struct nk_context*, struct nk_vec2 pos);
-/* nk_window_set_size - updates size of the currently processed window
- * IMPORTANT: only call this function between calls `nk_begin_xxx` and `nk_end`
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct
- * @bounds points to a `nk_vec2` struct with the new size of currently active window */
-NK_API void nk_window_set_size(struct nk_context*, struct nk_vec2);
-/* nk_window_set_focus - sets the window with given name as active
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct
- * @name of the window to be set active */
+/*/// #### nk_window_set_bounds
+/// Updates position and size of window with passed in name
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_window_set_bounds(struct nk_context*, const char *name, struct nk_rect bounds);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __name__ | Identifier of the window to modify both position and size
+/// __bounds__ | Must point to a `nk_rect` struct with the new position and size
+*/
+NK_API void nk_window_set_bounds(struct nk_context*, const char *name, struct nk_rect bounds);
+/*/// #### nk_window_set_position
+/// Updates position of window with passed name
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_window_set_position(struct nk_context*, const char *name, struct nk_vec2 pos);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __name__ | Identifier of the window to modify both position
+/// __pos__ | Must point to a `nk_vec2` struct with the new position
+*/
+NK_API void nk_window_set_position(struct nk_context*, const char *name, struct nk_vec2 pos);
+/*/// #### nk_window_set_size
+/// Updates size of window with passed in name
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_window_set_size(struct nk_context*, const char *name, struct nk_vec2);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __name__ | Identifier of the window to modify both window size
+/// __size__ | Must point to a `nk_vec2` struct with new window size
+*/
+NK_API void nk_window_set_size(struct nk_context*, const char *name, struct nk_vec2);
+/*/// #### nk_window_set_focus
+/// Sets the window with given name as active
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_window_set_focus(struct nk_context*, const char *name);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __name__ | Identifier of the window to set focus on
+*/
NK_API void nk_window_set_focus(struct nk_context*, const char *name);
-/* nk_window_close - closed a window and marks it for being freed at the end of the frame
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct
- * @name of the window to be closed */
+/*/// #### nk_window_set_scroll
+/// Sets the scroll offset for the current window
+/// !!! WARNING
+/// Only call this function between calls `nk_begin_xxx` and `nk_end`
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_window_set_scroll(struct nk_context *ctx, nk_uint offset_x, nk_uint offset_y);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// -------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __offset_x__ | The x offset to scroll to
+/// __offset_y__ | The y offset to scroll to
+*/
+NK_API void nk_window_set_scroll(struct nk_context*, nk_uint offset_x, nk_uint offset_y);
+/*/// #### nk_window_close
+/// Closes a window and marks it for being freed at the end of the frame
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_window_close(struct nk_context *ctx, const char *name);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __name__ | Identifier of the window to close
+*/
NK_API void nk_window_close(struct nk_context *ctx, const char *name);
-/* nk_window_collapse - updates collapse state of a window with given name
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct
- * @name of the window to be either collapse or maximize */
+/*/// #### nk_window_collapse
+/// Updates collapse state of a window with given name
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_window_collapse(struct nk_context*, const char *name, enum nk_collapse_states state);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __name__ | Identifier of the window to close
+/// __state__ | value out of nk_collapse_states section
+*/
NK_API void nk_window_collapse(struct nk_context*, const char *name, enum nk_collapse_states state);
-/* nk_window_collapse - updates collapse state of a window with given name if given condition is met
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct
- * @name of the window to be either collapse or maximize
- * @state the window should be put into
- * @condition that has to be true to actually commit the collsage state change */
+/*/// #### nk_window_collapse_if
+/// Updates collapse state of a window with given name if given condition is met
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_window_collapse_if(struct nk_context*, const char *name, enum nk_collapse_states, int cond);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __name__ | Identifier of the window to either collapse or maximize
+/// __state__ | value out of nk_collapse_states section the window should be put into
+/// __cond__ | condition that has to be met to actually commit the collapse state change
+*/
NK_API void nk_window_collapse_if(struct nk_context*, const char *name, enum nk_collapse_states, int cond);
-/* nk_window_show - updates visibility state of a window with given name
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct
- * @name of the window to be either collapse or maximize
- * @state with either visible or hidden to modify the window with */
+/*/// #### nk_window_show
+/// updates visibility state of a window with given name
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_window_show(struct nk_context*, const char *name, enum nk_show_states);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __name__ | Identifier of the window to either collapse or maximize
+/// __state__ | state with either visible or hidden to modify the window with
+*/
NK_API void nk_window_show(struct nk_context*, const char *name, enum nk_show_states);
-/* nk_window_show_if - updates visibility state of a window with given name if a given condition is met
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct
- * @name of the window to be either collapse or maximize
- * @state with either visible or hidden to modify the window with
- * @condition that has to be true to actually commit the visible state change */
+/*/// #### nk_window_show_if
+/// Updates visibility state of a window with given name if a given condition is met
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_window_show_if(struct nk_context*, const char *name, enum nk_show_states, int cond);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __name__ | Identifier of the window to either hide or show
+/// __state__ | state with either visible or hidden to modify the window with
+/// __cond__ | condition that has to be met to actually commit the visbility state change
+*/
NK_API void nk_window_show_if(struct nk_context*, const char *name, enum nk_show_states, int cond);
/* =============================================================================
*
* LAYOUT
*
- * ============================================================================= */
-/* Layouting in general describes placing widget inside a window with position and size.
- * While in this particular implementation there are five different APIs for layouting
- * each with different trade offs between control and ease of use.
- *
- * All layouting methodes in this library are based around the concept of a row.
- * A row has a height the window content grows by and a number of columns and each
- * layouting method specifies how each widget is placed inside the row.
- * After a row has been allocated by calling a layouting functions and then
- * filled with widgets will advance an internal pointer over the allocated row.
- *
- * To acually define a layout you just call the appropriate layouting function
- * and each subsequnetial widget call will place the widget as specified. Important
- * here is that if you define more widgets then columns defined inside the layout
- * functions it will allocate the next row without you having to make another layouting
- * call.
- *
- * Biggest limitation with using all these APIs outside the `nk_layout_space_xxx` API
- * is that you have to define the row height for each. However the row height
- * often depends on the height of the font.
- *
- * To fix that internally nuklear uses a minimum row height that is set to the
- * height plus padding of currently active font and overwrites the row height
- * value if zero.
- *
- * If you manually want to change the minimum row height then
- * use nk_layout_set_min_row_height, and use nk_layout_reset_min_row_height to
- * reset it back to be derived from font height.
- *
- * Also if you change the font in nuklear it will automatically change the minimum
- * row height for you and. This means if you change the font but still want
- * a minimum row height smaller than the font you have to repush your value.
- *
- * For actually more advanced UI I would even recommend using the `nk_layout_space_xxx`
- * layouting method in combination with a cassowary constraint solver (there are
- * some versions on github with permissive license model) to take over all control over widget
- * layouting yourself. However for quick and dirty layouting using all the other layouting
- * functions should be fine.
- *
- * Usage
- * -------------------
- * 1.) nk_layout_row_dynamic
- * The easiest layouting function is `nk_layout_row_dynamic`. It provides each
- * widgets with same horizontal space inside the row and dynamically grows
- * if the owning window grows in width. So the number of columns dictates
- * the size of each widget dynamically by formula:
- *
- * widget_width = (window_width - padding - spacing) * (1/colum_count)
- *
- * Just like all other layouting APIs if you define more widget than columns this
- * library will allocate a new row and keep all layouting parameters previously
- * defined.
- *
- * if (nk_begin_xxx(...) {
- * // first row with height: 30 composed of two widgets
- * nk_layout_row_dynamic(&ctx, 30, 2);
- * nk_widget(...);
- * nk_widget(...);
- *
- * // second row with same parameter as defined above
- * nk_widget(...);
- * nk_widget(...);
- *
- * // third row uses 0 for height which will use auto layouting
- * nk_layout_row_dynamic(&ctx, 0, 2);
- * nk_widget(...);
- * nk_widget(...);
- * }
- * nk_end(...);
- *
- * 2.) nk_layout_row_static
- * Another easy layouting function is `nk_layout_row_static`. It provides each
- * widget with same horizontal pixel width inside the row and does not grow
- * if the owning window scales smaller or bigger.
- *
- * if (nk_begin_xxx(...) {
- * // first row with height: 30 composed of two widgets with width: 80
- * nk_layout_row_static(&ctx, 30, 80, 2);
- * nk_widget(...);
- * nk_widget(...);
- *
- * // second row with same parameter as defined above
- * nk_widget(...);
- * nk_widget(...);
- *
- * // third row uses 0 for height which will use auto layouting
- * nk_layout_row_static(&ctx, 0, 80, 2);
- * nk_widget(...);
- * nk_widget(...);
- * }
- * nk_end(...);
- *
- * 3.) nk_layout_row_xxx
- * A little bit more advanced layouting API are functions `nk_layout_row_begin`,
- * `nk_layout_row_push` and `nk_layout_row_end`. They allow to directly
- * specify each column pixel or window ratio in a row. It supports either
- * directly setting per column pixel width or widget window ratio but not
- * both. Furthermore it is a immediate mode API so each value is directly
- * pushed before calling a widget. Therefore the layout is not automatically
- * repeating like the last two layouting functions.
- *
- * if (nk_begin_xxx(...) {
- * // first row with height: 25 composed of two widgets with width 60 and 40
- * nk_layout_row_begin(ctx, NK_STATIC, 25, 2);
- * nk_layout_row_push(ctx, 60);
- * nk_widget(...);
- * nk_layout_row_push(ctx, 40);
- * nk_widget(...);
- * nk_layout_row_end(ctx);
- *
- * // second row with height: 25 composed of two widgets with window ratio 0.25 and 0.75
- * nk_layout_row_begin(ctx, NK_DYNAMIC, 25, 2);
- * nk_layout_row_push(ctx, 0.25f);
- * nk_widget(...);
- * nk_layout_row_push(ctx, 0.75f);
- * nk_widget(...);
- * nk_layout_row_end(ctx);
- *
- * // third row with auto generated height: composed of two widgets with window ratio 0.25 and 0.75
- * nk_layout_row_begin(ctx, NK_DYNAMIC, 0, 2);
- * nk_layout_row_push(ctx, 0.25f);
- * nk_widget(...);
- * nk_layout_row_push(ctx, 0.75f);
- * nk_widget(...);
- * nk_layout_row_end(ctx);
- * }
- * nk_end(...);
- *
- * 4.) nk_layout_row
- * The array counterpart to API nk_layout_row_xxx is the single nk_layout_row
- * functions. Instead of pushing either pixel or window ratio for every widget
- * it allows to define it by array. The trade of for less control is that
- * `nk_layout_row` is automatically repeating. Otherwise the behavior is the
- * same.
- *
- * if (nk_begin_xxx(...) {
- * // two rows with height: 30 composed of two widgets with width 60 and 40
- * const float size[] = {60,40};
- * nk_layout_row(ctx, NK_STATIC, 30, 2, ratio);
- * nk_widget(...);
- * nk_widget(...);
- * nk_widget(...);
- * nk_widget(...);
- *
- * // two rows with height: 30 composed of two widgets with window ratio 0.25 and 0.75
- * const float ratio[] = {0.25, 0.75};
- * nk_layout_row(ctx, NK_DYNAMIC, 30, 2, ratio);
- * nk_widget(...);
- * nk_widget(...);
- * nk_widget(...);
- * nk_widget(...);
- *
- * // two rows with auto generated height composed of two widgets with window ratio 0.25 and 0.75
- * const float ratio[] = {0.25, 0.75};
- * nk_layout_row(ctx, NK_DYNAMIC, 30, 2, ratio);
- * nk_widget(...);
- * nk_widget(...);
- * nk_widget(...);
- * nk_widget(...);
- * }
- * nk_end(...);
- *
- * 5.) nk_layout_row_template_xxx
- * The most complex and second most flexible API is a simplified flexbox version without
- * line wrapping and weights for dynamic widgets. It is an immediate mode API but
- * unlike `nk_layout_row_xxx` it has auto repeat behavior and needs to be called
- * before calling the templated widgets.
- * The row template layout has three different per widget size specifier. The first
- * one is the static widget size specifier with fixed widget pixel width. They do
- * not grow if the row grows and will always stay the same. The second size
- * specifier is nk_layout_row_template_push_variable which defines a
- * minumum widget size but it also can grow if more space is available not taken
- * by other widgets. Finally there are dynamic widgets which are completly flexible
- * and unlike variable widgets can even shrink to zero if not enough space
- * is provided.
- *
- * if (nk_begin_xxx(...) {
- * // two rows with height: 30 composed of three widgets
- * nk_layout_row_template_begin(ctx, 30);
- * nk_layout_row_template_push_dynamic(ctx);
- * nk_layout_row_template_push_variable(ctx, 80);
- * nk_layout_row_template_push_static(ctx, 80);
- * nk_layout_row_template_end(ctx);
- *
- * nk_widget(...); // dynamic widget can go to zero if not enough space
- * nk_widget(...); // variable widget with min 80 pixel but can grow bigger if enough space
- * nk_widget(...); // static widget with fixed 80 pixel width
- *
- * // second row same layout
- * nk_widget(...);
- * nk_widget(...);
- * nk_widget(...);
- * }
- * nk_end(...);
- *
- * 6.) nk_layout_space_xxx
- * Finally the most flexible API directly allows you to place widgets inside the
- * window. The space layout API is an immediate mode API which does not support
- * row auto repeat and directly sets position and size of a widget. Position
- * and size hereby can be either specified as ratio of alloated space or
- * allocated space local position and pixel size. Since this API is quite
- * powerfull there are a number of utility functions to get the available space
- * and convert between local allocated space and screen space.
- *
- * if (nk_begin_xxx(...) {
- * // static row with height: 500 (you can set column count to INT_MAX if you don't want to be bothered)
- * nk_layout_space_begin(ctx, NK_STATIC, 500, INT_MAX);
- * nk_layout_space_push(ctx, nk_rect(0,0,150,200));
- * nk_widget(...);
- * nk_layout_space_push(ctx, nk_rect(200,200,100,200));
- * nk_widget(...);
- * nk_layout_space_end(ctx);
- *
- * // dynamic row with height: 500 (you can set column count to INT_MAX if you don't want to be bothered)
- * nk_layout_space_begin(ctx, NK_DYNAMIC, 500, INT_MAX);
- * nk_layout_space_push(ctx, nk_rect(0.5,0.5,0.1,0.1));
- * nk_widget(...);
- * nk_layout_space_push(ctx, nk_rect(0.7,0.6,0.1,0.1));
- * nk_widget(...);
- * }
- * nk_end(...);
- *
- * Reference
- * -------------------
- * nk_layout_set_min_row_height - set the currently used minimum row height to a specified value
- * nk_layout_reset_min_row_height - resets the currently used minimum row height to font height
- *
- * nk_layout_widget_bounds - calculates current width a static layout row can fit inside a window
- * nk_layout_ratio_from_pixel - utility functions to calculate window ratio from pixel size
- *
- * nk_layout_row_dynamic - current layout is divided into n same sized gowing columns
- * nk_layout_row_static - current layout is divided into n same fixed sized columns
- * nk_layout_row_begin - starts a new row with given height and number of columns
- * nk_layout_row_push - pushes another column with given size or window ratio
- * nk_layout_row_end - finished previously started row
- * nk_layout_row - specifies row columns in array as either window ratio or size
- *
- * nk_layout_row_template_begin - begins the row template declaration
- * nk_layout_row_template_push_dynamic - adds a dynamic column that dynamically grows and can go to zero if not enough space
- * nk_layout_row_template_push_variable - adds a variable column that dynamically grows but does not shrink below specified pixel width
- * nk_layout_row_template_push_static - adds a static column that does not grow and will always have the same size
- * nk_layout_row_template_end - marks the end of the row template
- *
- * nk_layout_space_begin - begins a new layouting space that allows to specify each widgets position and size
- * nk_layout_space_push - pushes position and size of the next widget in own coordiante space either as pixel or ratio
- * nk_layout_space_end - marks the end of the layouting space
- *
- * nk_layout_space_bounds - callable after nk_layout_space_begin and returns total space allocated
- * nk_layout_space_to_screen - convertes vector from nk_layout_space coordiant space into screen space
- * nk_layout_space_to_local - convertes vector from screem space into nk_layout_space coordinates
- * nk_layout_space_rect_to_screen - convertes rectangle from nk_layout_space coordiant space into screen space
- * nk_layout_space_rect_to_local - convertes rectangle from screem space into nk_layout_space coordinates
- */
-/* nk_layout_set_min_row_height - sets the currently used minimum row height.
- * IMPORTANT: The passed height needs to include both your prefered row height
- * as well as padding. No internal padding is added.
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
- * @height new minimum row height to be used for auto generating the row height */
+ * =============================================================================
+/// ### Layouting
+/// Layouting in general describes placing widget inside a window with position and size.
+/// While in this particular implementation there are five different APIs for layouting
+/// each with different trade offs between control and ease of use.
+///
+/// All layouting methods in this library are based around the concept of a row.
+/// A row has a height the window content grows by and a number of columns and each
+/// layouting method specifies how each widget is placed inside the row.
+/// After a row has been allocated by calling a layouting functions and then
+/// filled with widgets will advance an internal pointer over the allocated row.
+///
+/// To actually define a layout you just call the appropriate layouting function
+/// and each subsequent widget call will place the widget as specified. Important
+/// here is that if you define more widgets then columns defined inside the layout
+/// functions it will allocate the next row without you having to make another layouting
+/// call.
+///
+/// Biggest limitation with using all these APIs outside the `nk_layout_space_xxx` API
+/// is that you have to define the row height for each. However the row height
+/// often depends on the height of the font.
+///
+/// To fix that internally nuklear uses a minimum row height that is set to the
+/// height plus padding of currently active font and overwrites the row height
+/// value if zero.
+///
+/// If you manually want to change the minimum row height then
+/// use nk_layout_set_min_row_height, and use nk_layout_reset_min_row_height to
+/// reset it back to be derived from font height.
+///
+/// Also if you change the font in nuklear it will automatically change the minimum
+/// row height for you and. This means if you change the font but still want
+/// a minimum row height smaller than the font you have to repush your value.
+///
+/// For actually more advanced UI I would even recommend using the `nk_layout_space_xxx`
+/// layouting method in combination with a cassowary constraint solver (there are
+/// some versions on github with permissive license model) to take over all control over widget
+/// layouting yourself. However for quick and dirty layouting using all the other layouting
+/// functions should be fine.
+///
+/// #### Usage
+/// 1. __nk_layout_row_dynamic__
+/// The easiest layouting function is `nk_layout_row_dynamic`. It provides each
+/// widgets with same horizontal space inside the row and dynamically grows
+/// if the owning window grows in width. So the number of columns dictates
+/// the size of each widget dynamically by formula:
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// widget_width = (window_width - padding - spacing) * (1/colum_count)
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Just like all other layouting APIs if you define more widget than columns this
+/// library will allocate a new row and keep all layouting parameters previously
+/// defined.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// if (nk_begin_xxx(...) {
+/// // first row with height: 30 composed of two widgets
+/// nk_layout_row_dynamic(&ctx, 30, 2);
+/// nk_widget(...);
+/// nk_widget(...);
+/// //
+/// // second row with same parameter as defined above
+/// nk_widget(...);
+/// nk_widget(...);
+/// //
+/// // third row uses 0 for height which will use auto layouting
+/// nk_layout_row_dynamic(&ctx, 0, 2);
+/// nk_widget(...);
+/// nk_widget(...);
+/// }
+/// nk_end(...);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// 2. __nk_layout_row_static__
+/// Another easy layouting function is `nk_layout_row_static`. It provides each
+/// widget with same horizontal pixel width inside the row and does not grow
+/// if the owning window scales smaller or bigger.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// if (nk_begin_xxx(...) {
+/// // first row with height: 30 composed of two widgets with width: 80
+/// nk_layout_row_static(&ctx, 30, 80, 2);
+/// nk_widget(...);
+/// nk_widget(...);
+/// //
+/// // second row with same parameter as defined above
+/// nk_widget(...);
+/// nk_widget(...);
+/// //
+/// // third row uses 0 for height which will use auto layouting
+/// nk_layout_row_static(&ctx, 0, 80, 2);
+/// nk_widget(...);
+/// nk_widget(...);
+/// }
+/// nk_end(...);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// 3. __nk_layout_row_xxx__
+/// A little bit more advanced layouting API are functions `nk_layout_row_begin`,
+/// `nk_layout_row_push` and `nk_layout_row_end`. They allow to directly
+/// specify each column pixel or window ratio in a row. It supports either
+/// directly setting per column pixel width or widget window ratio but not
+/// both. Furthermore it is a immediate mode API so each value is directly
+/// pushed before calling a widget. Therefore the layout is not automatically
+/// repeating like the last two layouting functions.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// if (nk_begin_xxx(...) {
+/// // first row with height: 25 composed of two widgets with width 60 and 40
+/// nk_layout_row_begin(ctx, NK_STATIC, 25, 2);
+/// nk_layout_row_push(ctx, 60);
+/// nk_widget(...);
+/// nk_layout_row_push(ctx, 40);
+/// nk_widget(...);
+/// nk_layout_row_end(ctx);
+/// //
+/// // second row with height: 25 composed of two widgets with window ratio 0.25 and 0.75
+/// nk_layout_row_begin(ctx, NK_DYNAMIC, 25, 2);
+/// nk_layout_row_push(ctx, 0.25f);
+/// nk_widget(...);
+/// nk_layout_row_push(ctx, 0.75f);
+/// nk_widget(...);
+/// nk_layout_row_end(ctx);
+/// //
+/// // third row with auto generated height: composed of two widgets with window ratio 0.25 and 0.75
+/// nk_layout_row_begin(ctx, NK_DYNAMIC, 0, 2);
+/// nk_layout_row_push(ctx, 0.25f);
+/// nk_widget(...);
+/// nk_layout_row_push(ctx, 0.75f);
+/// nk_widget(...);
+/// nk_layout_row_end(ctx);
+/// }
+/// nk_end(...);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// 4. __nk_layout_row__
+/// The array counterpart to API nk_layout_row_xxx is the single nk_layout_row
+/// functions. Instead of pushing either pixel or window ratio for every widget
+/// it allows to define it by array. The trade of for less control is that
+/// `nk_layout_row` is automatically repeating. Otherwise the behavior is the
+/// same.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// if (nk_begin_xxx(...) {
+/// // two rows with height: 30 composed of two widgets with width 60 and 40
+/// const float size[] = {60,40};
+/// nk_layout_row(ctx, NK_STATIC, 30, 2, ratio);
+/// nk_widget(...);
+/// nk_widget(...);
+/// nk_widget(...);
+/// nk_widget(...);
+/// //
+/// // two rows with height: 30 composed of two widgets with window ratio 0.25 and 0.75
+/// const float ratio[] = {0.25, 0.75};
+/// nk_layout_row(ctx, NK_DYNAMIC, 30, 2, ratio);
+/// nk_widget(...);
+/// nk_widget(...);
+/// nk_widget(...);
+/// nk_widget(...);
+/// //
+/// // two rows with auto generated height composed of two widgets with window ratio 0.25 and 0.75
+/// const float ratio[] = {0.25, 0.75};
+/// nk_layout_row(ctx, NK_DYNAMIC, 30, 2, ratio);
+/// nk_widget(...);
+/// nk_widget(...);
+/// nk_widget(...);
+/// nk_widget(...);
+/// }
+/// nk_end(...);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// 5. __nk_layout_row_template_xxx__
+/// The most complex and second most flexible API is a simplified flexbox version without
+/// line wrapping and weights for dynamic widgets. It is an immediate mode API but
+/// unlike `nk_layout_row_xxx` it has auto repeat behavior and needs to be called
+/// before calling the templated widgets.
+/// The row template layout has three different per widget size specifier. The first
+/// one is the `nk_layout_row_template_push_static` with fixed widget pixel width.
+/// They do not grow if the row grows and will always stay the same.
+/// The second size specifier is `nk_layout_row_template_push_variable`
+/// which defines a minimum widget size but it also can grow if more space is available
+/// not taken by other widgets.
+/// Finally there are dynamic widgets with `nk_layout_row_template_push_dynamic`
+/// which are completely flexible and unlike variable widgets can even shrink
+/// to zero if not enough space is provided.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// if (nk_begin_xxx(...) {
+/// // two rows with height: 30 composed of three widgets
+/// nk_layout_row_template_begin(ctx, 30);
+/// nk_layout_row_template_push_dynamic(ctx);
+/// nk_layout_row_template_push_variable(ctx, 80);
+/// nk_layout_row_template_push_static(ctx, 80);
+/// nk_layout_row_template_end(ctx);
+/// //
+/// // first row
+/// nk_widget(...); // dynamic widget can go to zero if not enough space
+/// nk_widget(...); // variable widget with min 80 pixel but can grow bigger if enough space
+/// nk_widget(...); // static widget with fixed 80 pixel width
+/// //
+/// // second row same layout
+/// nk_widget(...);
+/// nk_widget(...);
+/// nk_widget(...);
+/// }
+/// nk_end(...);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// 6. __nk_layout_space_xxx__
+/// Finally the most flexible API directly allows you to place widgets inside the
+/// window. The space layout API is an immediate mode API which does not support
+/// row auto repeat and directly sets position and size of a widget. Position
+/// and size hereby can be either specified as ratio of allocated space or
+/// allocated space local position and pixel size. Since this API is quite
+/// powerful there are a number of utility functions to get the available space
+/// and convert between local allocated space and screen space.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// if (nk_begin_xxx(...) {
+/// // static row with height: 500 (you can set column count to INT_MAX if you don't want to be bothered)
+/// nk_layout_space_begin(ctx, NK_STATIC, 500, INT_MAX);
+/// nk_layout_space_push(ctx, nk_rect(0,0,150,200));
+/// nk_widget(...);
+/// nk_layout_space_push(ctx, nk_rect(200,200,100,200));
+/// nk_widget(...);
+/// nk_layout_space_end(ctx);
+/// //
+/// // dynamic row with height: 500 (you can set column count to INT_MAX if you don't want to be bothered)
+/// nk_layout_space_begin(ctx, NK_DYNAMIC, 500, INT_MAX);
+/// nk_layout_space_push(ctx, nk_rect(0.5,0.5,0.1,0.1));
+/// nk_widget(...);
+/// nk_layout_space_push(ctx, nk_rect(0.7,0.6,0.1,0.1));
+/// nk_widget(...);
+/// }
+/// nk_end(...);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// #### Reference
+/// Function | Description
+/// ----------------------------------------|------------------------------------
+/// nk_layout_set_min_row_height | Set the currently used minimum row height to a specified value
+/// nk_layout_reset_min_row_height | Resets the currently used minimum row height to font height
+/// nk_layout_widget_bounds | Calculates current width a static layout row can fit inside a window
+/// nk_layout_ratio_from_pixel | Utility functions to calculate window ratio from pixel size
+//
+/// nk_layout_row_dynamic | Current layout is divided into n same sized growing columns
+/// nk_layout_row_static | Current layout is divided into n same fixed sized columns
+/// nk_layout_row_begin | Starts a new row with given height and number of columns
+/// nk_layout_row_push | Pushes another column with given size or window ratio
+/// nk_layout_row_end | Finished previously started row
+/// nk_layout_row | Specifies row columns in array as either window ratio or size
+//
+/// nk_layout_row_template_begin | Begins the row template declaration
+/// nk_layout_row_template_push_dynamic | Adds a dynamic column that dynamically grows and can go to zero if not enough space
+/// nk_layout_row_template_push_variable | Adds a variable column that dynamically grows but does not shrink below specified pixel width
+/// nk_layout_row_template_push_static | Adds a static column that does not grow and will always have the same size
+/// nk_layout_row_template_end | Marks the end of the row template
+//
+/// nk_layout_space_begin | Begins a new layouting space that allows to specify each widgets position and size
+/// nk_layout_space_push | Pushes position and size of the next widget in own coordinate space either as pixel or ratio
+/// nk_layout_space_end | Marks the end of the layouting space
+//
+/// nk_layout_space_bounds | Callable after nk_layout_space_begin and returns total space allocated
+/// nk_layout_space_to_screen | Converts vector from nk_layout_space coordinate space into screen space
+/// nk_layout_space_to_local | Converts vector from screen space into nk_layout_space coordinates
+/// nk_layout_space_rect_to_screen | Converts rectangle from nk_layout_space coordinate space into screen space
+/// nk_layout_space_rect_to_local | Converts rectangle from screen space into nk_layout_space coordinates
+*/
+/*/// #### nk_layout_set_min_row_height
+/// Sets the currently used minimum row height.
+/// !!! WARNING
+/// The passed height needs to include both your preferred row height
+/// as well as padding. No internal padding is added.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_layout_set_min_row_height(struct nk_context*, float height);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
+/// __height__ | New minimum row height to be used for auto generating the row height
+*/
NK_API void nk_layout_set_min_row_height(struct nk_context*, float height);
-/* nk_layout_reset_min_row_height - Reset the currently used minimum row height
- * back to font height + text padding + additional padding (style_window.min_row_height_padding)
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct after call `nk_begin_xxx` */
+/*/// #### nk_layout_reset_min_row_height
+/// Reset the currently used minimum row height back to `font_height + text_padding + padding`
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_layout_reset_min_row_height(struct nk_context*);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
+*/
NK_API void nk_layout_reset_min_row_height(struct nk_context*);
-/* nk_layout_widget_bounds - returns the width of the next row allocate by one of the layouting functions
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` */
+/*/// #### nk_layout_widget_bounds
+/// Returns the width of the next row allocate by one of the layouting functions
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// struct nk_rect nk_layout_widget_bounds(struct nk_context*);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
+///
+/// Return `nk_rect` with both position and size of the next row
+*/
NK_API struct nk_rect nk_layout_widget_bounds(struct nk_context*);
-/* nk_layout_ratio_from_pixel - utility functions to calculate window ratio from pixel size
- * Parameters:
- * @ctx must point to an previously initialized `nk_context`
- * @pixel_width to convert to window ratio */
+/*/// #### nk_layout_ratio_from_pixel
+/// Utility functions to calculate window ratio from pixel size
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// float nk_layout_ratio_from_pixel(struct nk_context*, float pixel_width);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
+/// __pixel__ | Pixel_width to convert to window ratio
+///
+/// Returns `nk_rect` with both position and size of the next row
+*/
NK_API float nk_layout_ratio_from_pixel(struct nk_context*, float pixel_width);
-/* nk_layout_row_dynamic - Sets current row layout to share horizontal space
- * between @cols number of widgets evenly. Once called all subsequent widget
- * calls greater than @cols will allocate a new row with same layout.
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
- * @row_height holds height of each widget in row or zero for auto layouting
- * @cols number of widget inside row */
+/*/// #### nk_layout_row_dynamic
+/// Sets current row layout to share horizontal space
+/// between @cols number of widgets evenly. Once called all subsequent widget
+/// calls greater than @cols will allocate a new row with same layout.
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_layout_row_dynamic(struct nk_context *ctx, float height, int cols);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
+/// __height__ | Holds height of each widget in row or zero for auto layouting
+/// __columns__ | Number of widget inside row
+*/
NK_API void nk_layout_row_dynamic(struct nk_context *ctx, float height, int cols);
-/* nk_layout_row_static - Sets current row layout to fill @cols number of widgets
- * in row with same @item_width horizontal size. Once called all subsequent widget
- * calls greater than @cols will allocate a new row with same layout.
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
- * @height holds row height to allocate from panel for widget height
- * @item_width holds width of each widget in row
- * @cols number of widget inside row */
+/*/// #### nk_layout_row_static
+/// Sets current row layout to fill @cols number of widgets
+/// in row with same @item_width horizontal size. Once called all subsequent widget
+/// calls greater than @cols will allocate a new row with same layout.
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_layout_row_static(struct nk_context *ctx, float height, int item_width, int cols);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
+/// __height__ | Holds height of each widget in row or zero for auto layouting
+/// __width__ | Holds pixel width of each widget in the row
+/// __columns__ | Number of widget inside row
+*/
NK_API void nk_layout_row_static(struct nk_context *ctx, float height, int item_width, int cols);
-/* nk_layout_row_begin - Starts a new dynamic or fixed row with given height and columns.
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
- * @fmt either `NK_DYNAMIC` for window ratio or `NK_STATIC` for fixed size columns
- * @row_height holds height of each widget in row or zero for auto layouting
- * @cols number of widget inside row */
+/*/// #### nk_layout_row_begin
+/// Starts a new dynamic or fixed row with given height and columns.
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_layout_row_begin(struct nk_context *ctx, enum nk_layout_format fmt, float row_height, int cols);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
+/// __fmt__ | either `NK_DYNAMIC` for window ratio or `NK_STATIC` for fixed size columns
+/// __height__ | holds height of each widget in row or zero for auto layouting
+/// __columns__ | Number of widget inside row
+*/
NK_API void nk_layout_row_begin(struct nk_context *ctx, enum nk_layout_format fmt, float row_height, int cols);
-/* nk_layout_row_push - Specifies either window ratio or width of a single column
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct after call `nk_layout_row_begin`
- * @value either a window ratio or fixed width depending on @fmt in previous `nk_layout_row_begin` call */
+/*/// #### nk_layout_row_push
+/// Specifies either window ratio or width of a single column
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_layout_row_push(struct nk_context*, float value);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
+/// __value__ | either a window ratio or fixed width depending on @fmt in previous `nk_layout_row_begin` call
+*/
NK_API void nk_layout_row_push(struct nk_context*, float value);
-/* nk_layout_row_end - finished previously started row
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct after call `nk_layout_row_begin` */
+/*/// #### nk_layout_row_end
+/// Finished previously started row
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_layout_row_end(struct nk_context*);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
+*/
NK_API void nk_layout_row_end(struct nk_context*);
-/* nk_layout_row - specifies row columns in array as either window ratio or size
- * Parameters:
- * @ctx must point to an previously initialized `nk_context`
- * @fmt either `NK_DYNAMIC` for window ratio or `NK_STATIC` for fixed size columns
- * @row_height holds height of each widget in row or zero for auto layouting
- * @cols number of widget inside row */
+/*/// #### nk_layout_row
+/// Specifies row columns in array as either window ratio or size
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_layout_row(struct nk_context*, enum nk_layout_format, float height, int cols, const float *ratio);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
+/// __fmt__ | Either `NK_DYNAMIC` for window ratio or `NK_STATIC` for fixed size columns
+/// __height__ | Holds height of each widget in row or zero for auto layouting
+/// __columns__ | Number of widget inside row
+*/
NK_API void nk_layout_row(struct nk_context*, enum nk_layout_format, float height, int cols, const float *ratio);
-/* nk_layout_row_template_begin - Begins the row template declaration
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct
- * @row_height holds height of each widget in row or zero for auto layouting */
+/*/// #### nk_layout_row_template_begin
+/// Begins the row template declaration
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_layout_row_template_begin(struct nk_context*, float row_height);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
+/// __height__ | Holds height of each widget in row or zero for auto layouting
+*/
NK_API void nk_layout_row_template_begin(struct nk_context*, float row_height);
-/* nk_layout_row_template_push_dynamic - adds a dynamic column that dynamically grows and can go to zero if not enough space
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct after call `nk_layout_row_template_begin` */
+/*/// #### nk_layout_row_template_push_dynamic
+/// Adds a dynamic column that dynamically grows and can go to zero if not enough space
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_layout_row_template_push_dynamic(struct nk_context*);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
+/// __height__ | Holds height of each widget in row or zero for auto layouting
+*/
NK_API void nk_layout_row_template_push_dynamic(struct nk_context*);
-/* nk_layout_row_template_push_variable - adds a variable column that dynamically grows but does not shrink below specified pixel width
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct after call `nk_layout_row_template_begin`
- * @min_width holds the minimum pixel width the next column must be */
+/*/// #### nk_layout_row_template_push_variable
+/// Adds a variable column that dynamically grows but does not shrink below specified pixel width
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_layout_row_template_push_variable(struct nk_context*, float min_width);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
+/// __width__ | Holds the minimum pixel width the next column must always be
+*/
NK_API void nk_layout_row_template_push_variable(struct nk_context*, float min_width);
-/* nk_layout_row_template_push_static - adds a static column that does not grow and will always have the same size
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct after call `nk_layout_row_template_begin`
- * @width holds the absolulte pixel width value the next column must be */
+/*/// #### nk_layout_row_template_push_static
+/// Adds a static column that does not grow and will always have the same size
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_layout_row_template_push_static(struct nk_context*, float width);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
+/// __width__ | Holds the absolute pixel width value the next column must be
+*/
NK_API void nk_layout_row_template_push_static(struct nk_context*, float width);
-/* nk_layout_row_template_end - marks the end of the row template
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct after call `nk_layout_row_template_begin` */
+/*/// #### nk_layout_row_template_end
+/// Marks the end of the row template
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_layout_row_template_end(struct nk_context*);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
+*/
NK_API void nk_layout_row_template_end(struct nk_context*);
-/* nk_layout_space_begin - begins a new layouting space that allows to specify each widgets position and size.
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct
- * @fmt either `NK_DYNAMIC` for window ratio or `NK_STATIC` for fixed size columns
- * @row_height holds height of each widget in row or zero for auto layouting
- * @widget_count number of widgets inside row */
+/*/// #### nk_layout_space_begin
+/// Begins a new layouting space that allows to specify each widgets position and size.
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_layout_space_begin(struct nk_context*, enum nk_layout_format, float height, int widget_count);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
+/// __fmt__ | Either `NK_DYNAMIC` for window ratio or `NK_STATIC` for fixed size columns
+/// __height__ | Holds height of each widget in row or zero for auto layouting
+/// __columns__ | Number of widgets inside row
+*/
NK_API void nk_layout_space_begin(struct nk_context*, enum nk_layout_format, float height, int widget_count);
-/* nk_layout_space_push - pushes position and size of the next widget in own coordiante space either as pixel or ratio
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin`
- * @bounds position and size in laoyut space local coordinates */
-NK_API void nk_layout_space_push(struct nk_context*, struct nk_rect);
-/* nk_layout_space_end - marks the end of the layout space
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin` */
+/*/// #### nk_layout_space_push
+/// Pushes position and size of the next widget in own coordinate space either as pixel or ratio
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_layout_space_push(struct nk_context *ctx, struct nk_rect bounds);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin`
+/// __bounds__ | Position and size in laoyut space local coordinates
+*/
+NK_API void nk_layout_space_push(struct nk_context*, struct nk_rect bounds);
+/*/// #### nk_layout_space_end
+/// Marks the end of the layout space
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_layout_space_end(struct nk_context*);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin`
+*/
NK_API void nk_layout_space_end(struct nk_context*);
-/* nk_layout_space_bounds - returns total space allocated for `nk_layout_space`
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin` */
+/*/// #### nk_layout_space_bounds
+/// Utility function to calculate total space allocated for `nk_layout_space`
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// struct nk_rect nk_layout_space_bounds(struct nk_context*);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin`
+///
+/// Returns `nk_rect` holding the total space allocated
+*/
NK_API struct nk_rect nk_layout_space_bounds(struct nk_context*);
-/* nk_layout_space_to_screen - convertes vector from nk_layout_space coordiant space into screen space
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin`
- * @vec position to convert from layout space into screen coordinate space */
+/*/// #### nk_layout_space_to_screen
+/// Converts vector from nk_layout_space coordinate space into screen space
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// struct nk_vec2 nk_layout_space_to_screen(struct nk_context*, struct nk_vec2);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin`
+/// __vec__ | Position to convert from layout space into screen coordinate space
+///
+/// Returns transformed `nk_vec2` in screen space coordinates
+*/
NK_API struct nk_vec2 nk_layout_space_to_screen(struct nk_context*, struct nk_vec2);
-/* nk_layout_space_to_screen - convertes vector from layout space into screen space
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin`
- * @vec position to convert from screen space into layout coordinate space */
+/*/// #### nk_layout_space_to_local
+/// Converts vector from layout space into screen space
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// struct nk_vec2 nk_layout_space_to_local(struct nk_context*, struct nk_vec2);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin`
+/// __vec__ | Position to convert from screen space into layout coordinate space
+///
+/// Returns transformed `nk_vec2` in layout space coordinates
+*/
NK_API struct nk_vec2 nk_layout_space_to_local(struct nk_context*, struct nk_vec2);
-/* nk_layout_space_rect_to_screen - convertes rectangle from screen space into layout space
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin`
- * @bounds rectangle to convert from layout space into screen space */
+/*/// #### nk_layout_space_rect_to_screen
+/// Converts rectangle from screen space into layout space
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// struct nk_rect nk_layout_space_rect_to_screen(struct nk_context*, struct nk_rect);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin`
+/// __bounds__ | Rectangle to convert from layout space into screen space
+///
+/// Returns transformed `nk_rect` in screen space coordinates
+*/
NK_API struct nk_rect nk_layout_space_rect_to_screen(struct nk_context*, struct nk_rect);
-/* nk_layout_space_rect_to_local - convertes rectangle from layout space into screen space
- * Parameters:
- * @ctx must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin`
- * @bounds rectangle to convert from screen space into layout space */
+/*/// #### nk_layout_space_rect_to_local
+/// Converts rectangle from layout space into screen space
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// struct nk_rect nk_layout_space_rect_to_local(struct nk_context*, struct nk_rect);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin`
+/// __bounds__ | Rectangle to convert from layout space into screen space
+///
+/// Returns transformed `nk_rect` in layout space coordinates
+*/
NK_API struct nk_rect nk_layout_space_rect_to_local(struct nk_context*, struct nk_rect);
/* =============================================================================
*
* GROUP
*
- * ============================================================================= */
+ * =============================================================================
+/// ### Groups
+/// Groups are basically windows inside windows. They allow to subdivide space
+/// in a window to layout widgets as a group. Almost all more complex widget
+/// layouting requirements can be solved using groups and basic layouting
+/// fuctionality. Groups just like windows are identified by an unique name and
+/// internally keep track of scrollbar offsets by default. However additional
+/// versions are provided to directly manage the scrollbar.
+///
+/// #### Usage
+/// To create a group you have to call one of the three `nk_group_begin_xxx`
+/// functions to start group declarations and `nk_group_end` at the end. Furthermore it
+/// is required to check the return value of `nk_group_begin_xxx` and only process
+/// widgets inside the window if the value is not 0.
+/// Nesting groups is possible and even encouraged since many layouting schemes
+/// can only be achieved by nesting. Groups, unlike windows, need `nk_group_end`
+/// to be only called if the corosponding `nk_group_begin_xxx` call does not return 0:
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// if (nk_group_begin_xxx(ctx, ...) {
+/// // [... widgets ...]
+/// nk_group_end(ctx);
+/// }
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// In the grand concept groups can be called after starting a window
+/// with `nk_begin_xxx` and before calling `nk_end`:
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// struct nk_context ctx;
+/// nk_init_xxx(&ctx, ...);
+/// while (1) {
+/// // Input
+/// Event evt;
+/// nk_input_begin(&ctx);
+/// while (GetEvent(&evt)) {
+/// if (evt.type == MOUSE_MOVE)
+/// nk_input_motion(&ctx, evt.motion.x, evt.motion.y);
+/// else if (evt.type == [...]) {
+/// nk_input_xxx(...);
+/// }
+/// }
+/// nk_input_end(&ctx);
+/// //
+/// // Window
+/// if (nk_begin_xxx(...) {
+/// // [...widgets...]
+/// nk_layout_row_dynamic(...);
+/// if (nk_group_begin_xxx(ctx, ...) {
+/// //[... widgets ...]
+/// nk_group_end(ctx);
+/// }
+/// }
+/// nk_end(ctx);
+/// //
+/// // Draw
+/// const struct nk_command *cmd = 0;
+/// nk_foreach(cmd, &ctx) {
+/// switch (cmd->type) {
+/// case NK_COMMAND_LINE:
+/// your_draw_line_function(...)
+/// break;
+/// case NK_COMMAND_RECT
+/// your_draw_rect_function(...)
+/// break;
+/// case ...:
+/// // [...]
+/// }
+/// nk_clear(&ctx);
+/// }
+/// nk_free(&ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+/// #### Reference
+/// Function | Description
+/// --------------------------------|-------------------------------------------
+/// nk_group_begin | Start a new group with internal scrollbar handling
+/// nk_group_begin_titled | Start a new group with separeted name and title and internal scrollbar handling
+/// nk_group_end | Ends a group. Should only be called if nk_group_begin returned non-zero
+/// nk_group_scrolled_offset_begin | Start a new group with manual separated handling of scrollbar x- and y-offset
+/// nk_group_scrolled_begin | Start a new group with manual scrollbar handling
+/// nk_group_scrolled_end | Ends a group with manual scrollbar handling. Should only be called if nk_group_begin returned non-zero
+/// nk_group_get_scroll | Gets the scroll offset for the given group
+/// nk_group_set_scroll | Sets the scroll offset for the given group
+*/
+/*/// #### nk_group_begin
+/// Starts a new widget group. Requires a previous layouting function to specify a pos/size.
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// int nk_group_begin(struct nk_context*, const char *title, nk_flags);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __title__ | Must be an unique identifier for this group that is also used for the group header
+/// __flags__ | Window flags defined in the nk_panel_flags section with a number of different group behaviors
+///
+/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise
+*/
NK_API int nk_group_begin(struct nk_context*, const char *title, nk_flags);
-NK_API int nk_group_scrolled_offset_begin(struct nk_context*, nk_uint *x_offset, nk_uint *y_offset, const char*, nk_flags);
-NK_API int nk_group_scrolled_begin(struct nk_context*, struct nk_scroll*, const char *title, nk_flags);
-NK_API void nk_group_scrolled_end(struct nk_context*);
+/*/// #### nk_group_begin_titled
+/// Starts a new widget group. Requires a previous layouting function to specify a pos/size.
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// int nk_group_begin_titled(struct nk_context*, const char *name, const char *title, nk_flags);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __id__ | Must be an unique identifier for this group
+/// __title__ | Group header title
+/// __flags__ | Window flags defined in the nk_panel_flags section with a number of different group behaviors
+///
+/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise
+*/
+NK_API int nk_group_begin_titled(struct nk_context*, const char *name, const char *title, nk_flags);
+/*/// #### nk_group_end
+/// Ends a widget group
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_group_end(struct nk_context*);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+*/
NK_API void nk_group_end(struct nk_context*);
+/*/// #### nk_group_scrolled_offset_begin
+/// starts a new widget group. requires a previous layouting function to specify
+/// a size. Does not keep track of scrollbar.
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// int nk_group_scrolled_offset_begin(struct nk_context*, nk_uint *x_offset, nk_uint *y_offset, const char *title, nk_flags flags);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __x_offset__| Scrollbar x-offset to offset all widgets inside the group horizontally.
+/// __y_offset__| Scrollbar y-offset to offset all widgets inside the group vertically
+/// __title__ | Window unique group title used to both identify and display in the group header
+/// __flags__ | Window flags from the nk_panel_flags section
+///
+/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise
+*/
+NK_API int nk_group_scrolled_offset_begin(struct nk_context*, nk_uint *x_offset, nk_uint *y_offset, const char *title, nk_flags flags);
+/*/// #### nk_group_scrolled_begin
+/// Starts a new widget group. requires a previous
+/// layouting function to specify a size. Does not keep track of scrollbar.
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// int nk_group_scrolled_begin(struct nk_context*, struct nk_scroll *off, const char *title, nk_flags);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __off__ | Both x- and y- scroll offset. Allows for manual scrollbar control
+/// __title__ | Window unique group title used to both identify and display in the group header
+/// __flags__ | Window flags from nk_panel_flags section
+///
+/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise
+*/
+NK_API int nk_group_scrolled_begin(struct nk_context*, struct nk_scroll *off, const char *title, nk_flags);
+/*/// #### nk_group_scrolled_end
+/// Ends a widget group after calling nk_group_scrolled_offset_begin or nk_group_scrolled_begin.
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_group_scrolled_end(struct nk_context*);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+*/
+NK_API void nk_group_scrolled_end(struct nk_context*);
+/*/// #### nk_group_get_scroll
+/// Gets the scroll position of the given group.
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_group_get_scroll(struct nk_context*, const char *id, nk_uint *x_offset, nk_uint *y_offset);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// -------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __id__ | The id of the group to get the scroll position of
+/// __x_offset__ | A pointer to the x offset output (or NULL to ignore)
+/// __y_offset__ | A pointer to the y offset output (or NULL to ignore)
+*/
+NK_API void nk_group_get_scroll(struct nk_context*, const char *id, nk_uint *x_offset, nk_uint *y_offset);
+/*/// #### nk_group_set_scroll
+/// Sets the scroll position of the given group.
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_group_set_scroll(struct nk_context*, const char *id, nk_uint x_offset, nk_uint y_offset);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// -------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __id__ | The id of the group to scroll
+/// __x_offset__ | The x offset to scroll to
+/// __y_offset__ | The y offset to scroll to
+*/
+NK_API void nk_group_set_scroll(struct nk_context*, const char *id, nk_uint x_offset, nk_uint y_offset);
+/* =============================================================================
+ *
+ * TREE
+ *
+ * =============================================================================
+/// ### Tree
+/// Trees represent two different concept. First the concept of a collapsable
+/// UI section that can be either in a hidden or visibile state. They allow the UI
+/// user to selectively minimize the current set of visible UI to comprehend.
+/// The second concept are tree widgets for visual UI representation of trees.
+///
+/// Trees thereby can be nested for tree representations and multiple nested
+/// collapsable UI sections. All trees are started by calling of the
+/// `nk_tree_xxx_push_tree` functions and ended by calling one of the
+/// `nk_tree_xxx_pop_xxx()` functions. Each starting functions takes a title label
+/// and optionally an image to be displayed and the initial collapse state from
+/// the nk_collapse_states section.
+///
+/// The runtime state of the tree is either stored outside the library by the caller
+/// or inside which requires a unique ID. The unique ID can either be generated
+/// automatically from `__FILE__` and `__LINE__` with function `nk_tree_push`,
+/// by `__FILE__` and a user provided ID generated for example by loop index with
+/// function `nk_tree_push_id` or completely provided from outside by user with
+/// function `nk_tree_push_hashed`.
+///
+/// #### Usage
+/// To create a tree you have to call one of the seven `nk_tree_xxx_push_xxx`
+/// functions to start a collapsable UI section and `nk_tree_xxx_pop` to mark the
+/// end.
+/// Each starting function will either return `false(0)` if the tree is collapsed
+/// or hidden and therefore does not need to be filled with content or `true(1)`
+/// if visible and required to be filled.
+///
+/// !!! Note
+/// The tree header does not require and layouting function and instead
+/// calculates a auto height based on the currently used font size
+///
+/// The tree ending functions only need to be called if the tree content is
+/// actually visible. So make sure the tree push function is guarded by `if`
+/// and the pop call is only taken if the tree is visible.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// if (nk_tree_push(ctx, NK_TREE_TAB, "Tree", NK_MINIMIZED)) {
+/// nk_layout_row_dynamic(...);
+/// nk_widget(...);
+/// nk_tree_pop(ctx);
+/// }
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// #### Reference
+/// Function | Description
+/// ----------------------------|-------------------------------------------
+/// nk_tree_push | Start a collapsable UI section with internal state management
+/// nk_tree_push_id | Start a collapsable UI section with internal state management callable in a look
+/// nk_tree_push_hashed | Start a collapsable UI section with internal state management with full control over internal unique ID use to store state
+/// nk_tree_image_push | Start a collapsable UI section with image and label header
+/// nk_tree_image_push_id | Start a collapsable UI section with image and label header and internal state management callable in a look
+/// nk_tree_image_push_hashed | Start a collapsable UI section with image and label header and internal state management with full control over internal unique ID use to store state
+/// nk_tree_pop | Ends a collapsable UI section
+//
+/// nk_tree_state_push | Start a collapsable UI section with external state management
+/// nk_tree_state_image_push | Start a collapsable UI section with image and label header and external state management
+/// nk_tree_state_pop | Ends a collapsabale UI section
+///
+/// #### nk_tree_type
+/// Flag | Description
+/// ----------------|----------------------------------------
+/// NK_TREE_NODE | Highlighted tree header to mark a collapsable UI section
+/// NK_TREE_TAB | Non-highighted tree header closer to tree representations
+*/
+/*/// #### nk_tree_push
+/// Starts a collapsable UI section with internal state management
+/// !!! WARNING
+/// To keep track of the runtime tree collapsable state this function uses
+/// defines `__FILE__` and `__LINE__` to generate a unique ID. If you want
+/// to call this function in a loop please use `nk_tree_push_id` or
+/// `nk_tree_push_hashed` instead.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// #define nk_tree_push(ctx, type, title, state)
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __type__ | Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node
+/// __title__ | Label printed in the tree header
+/// __state__ | Initial tree state value out of nk_collapse_states
+///
+/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise
+*/
+#define nk_tree_push(ctx, type, title, state) nk_tree_push_hashed(ctx, type, title, state, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),__LINE__)
+/*/// #### nk_tree_push_id
+/// Starts a collapsable UI section with internal state management callable in a look
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// #define nk_tree_push_id(ctx, type, title, state, id)
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __type__ | Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node
+/// __title__ | Label printed in the tree header
+/// __state__ | Initial tree state value out of nk_collapse_states
+/// __id__ | Loop counter index if this function is called in a loop
+///
+/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise
+*/
+#define nk_tree_push_id(ctx, type, title, state, id) nk_tree_push_hashed(ctx, type, title, state, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),id)
+/*/// #### nk_tree_push_hashed
+/// Start a collapsable UI section with internal state management with full
+/// control over internal unique ID used to store state
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// int nk_tree_push_hashed(struct nk_context*, enum nk_tree_type, const char *title, enum nk_collapse_states initial_state, const char *hash, int len,int seed);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __type__ | Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node
+/// __title__ | Label printed in the tree header
+/// __state__ | Initial tree state value out of nk_collapse_states
+/// __hash__ | Memory block or string to generate the ID from
+/// __len__ | Size of passed memory block or string in __hash__
+/// __seed__ | Seeding value if this function is called in a loop or default to `0`
+///
+/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise
+*/
+NK_API int nk_tree_push_hashed(struct nk_context*, enum nk_tree_type, const char *title, enum nk_collapse_states initial_state, const char *hash, int len,int seed);
+/*/// #### nk_tree_image_push
+/// Start a collapsable UI section with image and label header
+/// !!! WARNING
+/// To keep track of the runtime tree collapsable state this function uses
+/// defines `__FILE__` and `__LINE__` to generate a unique ID. If you want
+/// to call this function in a loop please use `nk_tree_image_push_id` or
+/// `nk_tree_image_push_hashed` instead.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// #define nk_tree_image_push(ctx, type, img, title, state)
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+//
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __type__ | Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node
+/// __img__ | Image to display inside the header on the left of the label
+/// __title__ | Label printed in the tree header
+/// __state__ | Initial tree state value out of nk_collapse_states
+///
+/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise
+*/
+#define nk_tree_image_push(ctx, type, img, title, state) nk_tree_image_push_hashed(ctx, type, img, title, state, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),__LINE__)
+/*/// #### nk_tree_image_push_id
+/// Start a collapsable UI section with image and label header and internal state
+/// management callable in a look
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// #define nk_tree_image_push_id(ctx, type, img, title, state, id)
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __type__ | Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node
+/// __img__ | Image to display inside the header on the left of the label
+/// __title__ | Label printed in the tree header
+/// __state__ | Initial tree state value out of nk_collapse_states
+/// __id__ | Loop counter index if this function is called in a loop
+///
+/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise
+*/
+#define nk_tree_image_push_id(ctx, type, img, title, state, id) nk_tree_image_push_hashed(ctx, type, img, title, state, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),id)
+/*/// #### nk_tree_image_push_hashed
+/// Start a collapsable UI section with internal state management with full
+/// control over internal unique ID used to store state
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// int nk_tree_image_push_hashed(struct nk_context*, enum nk_tree_type, struct nk_image, const char *title, enum nk_collapse_states initial_state, const char *hash, int len,int seed);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct
+/// __type__ | Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node
+/// __img__ | Image to display inside the header on the left of the label
+/// __title__ | Label printed in the tree header
+/// __state__ | Initial tree state value out of nk_collapse_states
+/// __hash__ | Memory block or string to generate the ID from
+/// __len__ | Size of passed memory block or string in __hash__
+/// __seed__ | Seeding value if this function is called in a loop or default to `0`
+///
+/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise
+*/
+NK_API int nk_tree_image_push_hashed(struct nk_context*, enum nk_tree_type, struct nk_image, const char *title, enum nk_collapse_states initial_state, const char *hash, int len,int seed);
+/*/// #### nk_tree_pop
+/// Ends a collapsabale UI section
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_tree_pop(struct nk_context*);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after calling `nk_tree_xxx_push_xxx`
+*/
+NK_API void nk_tree_pop(struct nk_context*);
+/*/// #### nk_tree_state_push
+/// Start a collapsable UI section with external state management
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// int nk_tree_state_push(struct nk_context*, enum nk_tree_type, const char *title, enum nk_collapse_states *state);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after calling `nk_tree_xxx_push_xxx`
+/// __type__ | Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node
+/// __title__ | Label printed in the tree header
+/// __state__ | Persistent state to update
+///
+/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise
+*/
+NK_API int nk_tree_state_push(struct nk_context*, enum nk_tree_type, const char *title, enum nk_collapse_states *state);
+/*/// #### nk_tree_state_image_push
+/// Start a collapsable UI section with image and label header and external state management
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// int nk_tree_state_image_push(struct nk_context*, enum nk_tree_type, struct nk_image, const char *title, enum nk_collapse_states *state);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after calling `nk_tree_xxx_push_xxx`
+/// __img__ | Image to display inside the header on the left of the label
+/// __type__ | Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node
+/// __title__ | Label printed in the tree header
+/// __state__ | Persistent state to update
+///
+/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise
+*/
+NK_API int nk_tree_state_image_push(struct nk_context*, enum nk_tree_type, struct nk_image, const char *title, enum nk_collapse_states *state);
+/*/// #### nk_tree_state_pop
+/// Ends a collapsabale UI section
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_tree_state_pop(struct nk_context*);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// ------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after calling `nk_tree_xxx_push_xxx`
+*/
+NK_API void nk_tree_state_pop(struct nk_context*);
+
+#define nk_tree_element_push(ctx, type, title, state, sel) nk_tree_element_push_hashed(ctx, type, title, state, sel, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),__LINE__)
+#define nk_tree_element_push_id(ctx, type, title, state, sel, id) nk_tree_element_push_hashed(ctx, type, title, state, sel, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),id)
+NK_API int nk_tree_element_push_hashed(struct nk_context*, enum nk_tree_type, const char *title, enum nk_collapse_states initial_state, int *selected, const char *hash, int len, int seed);
+NK_API int nk_tree_element_image_push_hashed(struct nk_context*, enum nk_tree_type, struct nk_image, const char *title, enum nk_collapse_states initial_state, int *selected, const char *hash, int len,int seed);
+NK_API void nk_tree_element_pop(struct nk_context*);
+
/* =============================================================================
*
* LIST VIEW
@@ -1808,21 +3039,6 @@ struct nk_list_view {
};
NK_API int nk_list_view_begin(struct nk_context*, struct nk_list_view *out, const char *id, nk_flags, int row_height, int row_count);
NK_API void nk_list_view_end(struct nk_list_view*);
-/* =============================================================================
- *
- * TREE
- *
- * ============================================================================= */
-#define nk_tree_push(ctx, type, title, state) nk_tree_push_hashed(ctx, type, title, state, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),__LINE__)
-#define nk_tree_push_id(ctx, type, title, state, id) nk_tree_push_hashed(ctx, type, title, state, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),id)
-NK_API int nk_tree_push_hashed(struct nk_context*, enum nk_tree_type, const char *title, enum nk_collapse_states initial_state, const char *hash, int len,int seed);
-#define nk_tree_image_push(ctx, type, img, title, state) nk_tree_image_push_hashed(ctx, type, img, title, state, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),__LINE__)
-#define nk_tree_image_push_id(ctx, type, img, title, state, id) nk_tree_image_push_hashed(ctx, type, img, title, state, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),id)
-NK_API int nk_tree_image_push_hashed(struct nk_context*, enum nk_tree_type, struct nk_image, const char *title, enum nk_collapse_states initial_state, const char *hash, int len,int seed);
-NK_API void nk_tree_pop(struct nk_context*);
-NK_API int nk_tree_state_push(struct nk_context*, enum nk_tree_type, const char *title, enum nk_collapse_states *state);
-NK_API int nk_tree_state_image_push(struct nk_context*, enum nk_tree_type, struct nk_image, const char *title, enum nk_collapse_states *state);
-NK_API void nk_tree_state_pop(struct nk_context*);
/* =============================================================================
*
* WIDGET
@@ -1881,11 +3097,16 @@ NK_API void nk_label_colored(struct nk_context*, const char*, nk_flags align, st
NK_API void nk_label_wrap(struct nk_context*, const char*);
NK_API void nk_label_colored_wrap(struct nk_context*, const char*, struct nk_color);
NK_API void nk_image(struct nk_context*, struct nk_image);
+NK_API void nk_image_color(struct nk_context*, struct nk_image, struct nk_color);
#ifdef NK_INCLUDE_STANDARD_VARARGS
-NK_API void nk_labelf(struct nk_context*, nk_flags, const char*, ...);
-NK_API void nk_labelf_colored(struct nk_context*, nk_flags align, struct nk_color, const char*,...);
-NK_API void nk_labelf_wrap(struct nk_context*, const char*,...);
-NK_API void nk_labelf_colored_wrap(struct nk_context*, struct nk_color, const char*,...);
+NK_API void nk_labelf(struct nk_context*, nk_flags, NK_PRINTF_FORMAT_STRING const char*, ...) NK_PRINTF_VARARG_FUNC(3);
+NK_API void nk_labelf_colored(struct nk_context*, nk_flags, struct nk_color, NK_PRINTF_FORMAT_STRING const char*,...) NK_PRINTF_VARARG_FUNC(4);
+NK_API void nk_labelf_wrap(struct nk_context*, NK_PRINTF_FORMAT_STRING const char*,...) NK_PRINTF_VARARG_FUNC(2);
+NK_API void nk_labelf_colored_wrap(struct nk_context*, struct nk_color, NK_PRINTF_FORMAT_STRING const char*,...) NK_PRINTF_VARARG_FUNC(3);
+NK_API void nk_labelfv(struct nk_context*, nk_flags, NK_PRINTF_FORMAT_STRING const char*, va_list) NK_PRINTF_VALIST_FUNC(3);
+NK_API void nk_labelfv_colored(struct nk_context*, nk_flags, struct nk_color, NK_PRINTF_FORMAT_STRING const char*, va_list) NK_PRINTF_VALIST_FUNC(4);
+NK_API void nk_labelfv_wrap(struct nk_context*, NK_PRINTF_FORMAT_STRING const char*, va_list) NK_PRINTF_VALIST_FUNC(2);
+NK_API void nk_labelfv_colored_wrap(struct nk_context*, struct nk_color, NK_PRINTF_FORMAT_STRING const char*, va_list) NK_PRINTF_VALIST_FUNC(3);
NK_API void nk_value_bool(struct nk_context*, const char *prefix, int);
NK_API void nk_value_int(struct nk_context*, const char *prefix, int);
NK_API void nk_value_uint(struct nk_context*, const char *prefix, unsigned int);
@@ -1950,10 +3171,16 @@ NK_API int nk_selectable_label(struct nk_context*, const char*, nk_flags align,
NK_API int nk_selectable_text(struct nk_context*, const char*, int, nk_flags align, int *value);
NK_API int nk_selectable_image_label(struct nk_context*,struct nk_image, const char*, nk_flags align, int *value);
NK_API int nk_selectable_image_text(struct nk_context*,struct nk_image, const char*, int, nk_flags align, int *value);
+NK_API int nk_selectable_symbol_label(struct nk_context*,enum nk_symbol_type, const char*, nk_flags align, int *value);
+NK_API int nk_selectable_symbol_text(struct nk_context*,enum nk_symbol_type, const char*, int, nk_flags align, int *value);
+
NK_API int nk_select_label(struct nk_context*, const char*, nk_flags align, int value);
NK_API int nk_select_text(struct nk_context*, const char*, int, nk_flags align, int value);
NK_API int nk_select_image_label(struct nk_context*, struct nk_image,const char*, nk_flags align, int value);
NK_API int nk_select_image_text(struct nk_context*, struct nk_image,const char*, int, nk_flags align, int value);
+NK_API int nk_select_symbol_label(struct nk_context*,enum nk_symbol_type, const char*, nk_flags align, int value);
+NK_API int nk_select_symbol_text(struct nk_context*,enum nk_symbol_type, const char*, int, nk_flags align, int value);
+
/* =============================================================================
*
* SLIDER
@@ -1976,18 +3203,215 @@ NK_API nk_size nk_prog(struct nk_context*, nk_size cur, nk_size max, int modifya
* COLOR PICKER
*
* ============================================================================= */
-NK_API struct nk_color nk_color_picker(struct nk_context*, struct nk_color, enum nk_color_format);
-NK_API int nk_color_pick(struct nk_context*, struct nk_color*, enum nk_color_format);
+NK_API struct nk_colorf nk_color_picker(struct nk_context*, struct nk_colorf, enum nk_color_format);
+NK_API int nk_color_pick(struct nk_context*, struct nk_colorf*, enum nk_color_format);
/* =============================================================================
*
* PROPERTIES
*
- * ============================================================================= */
+ * =============================================================================
+/// ### Properties
+/// Properties are the main value modification widgets in Nuklear. Changing a value
+/// can be achieved by dragging, adding/removing incremental steps on button click
+/// or by directly typing a number.
+///
+/// #### Usage
+/// Each property requires a unique name for identifaction that is also used for
+/// displaying a label. If you want to use the same name multiple times make sure
+/// add a '#' before your name. The '#' will not be shown but will generate a
+/// unique ID. Each propery also takes in a minimum and maximum value. If you want
+/// to make use of the complete number range of a type just use the provided
+/// type limits from `limits.h`. For example `INT_MIN` and `INT_MAX` for
+/// `nk_property_int` and `nk_propertyi`. In additional each property takes in
+/// a increment value that will be added or subtracted if either the increment
+/// decrement button is clicked. Finally there is a value for increment per pixel
+/// dragged that is added or subtracted from the value.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// int value = 0;
+/// struct nk_context ctx;
+/// nk_init_xxx(&ctx, ...);
+/// while (1) {
+/// // Input
+/// Event evt;
+/// nk_input_begin(&ctx);
+/// while (GetEvent(&evt)) {
+/// if (evt.type == MOUSE_MOVE)
+/// nk_input_motion(&ctx, evt.motion.x, evt.motion.y);
+/// else if (evt.type == [...]) {
+/// nk_input_xxx(...);
+/// }
+/// }
+/// nk_input_end(&ctx);
+/// //
+/// // Window
+/// if (nk_begin_xxx(...) {
+/// // Property
+/// nk_layout_row_dynamic(...);
+/// nk_property_int(ctx, "ID", INT_MIN, &value, INT_MAX, 1, 1);
+/// }
+/// nk_end(ctx);
+/// //
+/// // Draw
+/// const struct nk_command *cmd = 0;
+/// nk_foreach(cmd, &ctx) {
+/// switch (cmd->type) {
+/// case NK_COMMAND_LINE:
+/// your_draw_line_function(...)
+/// break;
+/// case NK_COMMAND_RECT
+/// your_draw_rect_function(...)
+/// break;
+/// case ...:
+/// // [...]
+/// }
+/// nk_clear(&ctx);
+/// }
+/// nk_free(&ctx);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// #### Reference
+/// Function | Description
+/// --------------------|-------------------------------------------
+/// nk_property_int | Integer property directly modifing a passed in value
+/// nk_property_float | Float property directly modifing a passed in value
+/// nk_property_double | Double property directly modifing a passed in value
+/// nk_propertyi | Integer property returning the modified int value
+/// nk_propertyf | Float property returning the modified float value
+/// nk_propertyd | Double property returning the modified double value
+///
+*/
+/*/// #### nk_property_int
+/// Integer property directly modifing a passed in value
+/// !!! WARNING
+/// To generate a unique property ID using the same label make sure to insert
+/// a `#` at the beginning. It will not be shown but guarantees correct behavior.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_property_int(struct nk_context *ctx, const char *name, int min, int *val, int max, int step, float inc_per_pixel);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// --------------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after calling a layouting function
+/// __name__ | String used both as a label as well as a unique identifier
+/// __min__ | Minimum value not allowed to be underflown
+/// __val__ | Integer pointer to be modified
+/// __max__ | Maximum value not allowed to be overflown
+/// __step__ | Increment added and subtracted on increment and decrement button
+/// __inc_per_pixel__ | Value per pixel added or subtracted on dragging
+*/
NK_API void nk_property_int(struct nk_context*, const char *name, int min, int *val, int max, int step, float inc_per_pixel);
+/*/// #### nk_property_float
+/// Float property directly modifing a passed in value
+/// !!! WARNING
+/// To generate a unique property ID using the same label make sure to insert
+/// a `#` at the beginning. It will not be shown but guarantees correct behavior.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_property_float(struct nk_context *ctx, const char *name, float min, float *val, float max, float step, float inc_per_pixel);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// --------------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after calling a layouting function
+/// __name__ | String used both as a label as well as a unique identifier
+/// __min__ | Minimum value not allowed to be underflown
+/// __val__ | Float pointer to be modified
+/// __max__ | Maximum value not allowed to be overflown
+/// __step__ | Increment added and subtracted on increment and decrement button
+/// __inc_per_pixel__ | Value per pixel added or subtracted on dragging
+*/
NK_API void nk_property_float(struct nk_context*, const char *name, float min, float *val, float max, float step, float inc_per_pixel);
+/*/// #### nk_property_double
+/// Double property directly modifing a passed in value
+/// !!! WARNING
+/// To generate a unique property ID using the same label make sure to insert
+/// a `#` at the beginning. It will not be shown but guarantees correct behavior.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// void nk_property_double(struct nk_context *ctx, const char *name, double min, double *val, double max, double step, double inc_per_pixel);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// --------------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after calling a layouting function
+/// __name__ | String used both as a label as well as a unique identifier
+/// __min__ | Minimum value not allowed to be underflown
+/// __val__ | Double pointer to be modified
+/// __max__ | Maximum value not allowed to be overflown
+/// __step__ | Increment added and subtracted on increment and decrement button
+/// __inc_per_pixel__ | Value per pixel added or subtracted on dragging
+*/
NK_API void nk_property_double(struct nk_context*, const char *name, double min, double *val, double max, double step, float inc_per_pixel);
+/*/// #### nk_propertyi
+/// Integer property modifing a passed in value and returning the new value
+/// !!! WARNING
+/// To generate a unique property ID using the same label make sure to insert
+/// a `#` at the beginning. It will not be shown but guarantees correct behavior.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// int nk_propertyi(struct nk_context *ctx, const char *name, int min, int val, int max, int step, float inc_per_pixel);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// --------------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after calling a layouting function
+/// __name__ | String used both as a label as well as a unique identifier
+/// __min__ | Minimum value not allowed to be underflown
+/// __val__ | Current integer value to be modified and returned
+/// __max__ | Maximum value not allowed to be overflown
+/// __step__ | Increment added and subtracted on increment and decrement button
+/// __inc_per_pixel__ | Value per pixel added or subtracted on dragging
+///
+/// Returns the new modified integer value
+*/
NK_API int nk_propertyi(struct nk_context*, const char *name, int min, int val, int max, int step, float inc_per_pixel);
+/*/// #### nk_propertyf
+/// Float property modifing a passed in value and returning the new value
+/// !!! WARNING
+/// To generate a unique property ID using the same label make sure to insert
+/// a `#` at the beginning. It will not be shown but guarantees correct behavior.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// float nk_propertyf(struct nk_context *ctx, const char *name, float min, float val, float max, float step, float inc_per_pixel);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// --------------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after calling a layouting function
+/// __name__ | String used both as a label as well as a unique identifier
+/// __min__ | Minimum value not allowed to be underflown
+/// __val__ | Current float value to be modified and returned
+/// __max__ | Maximum value not allowed to be overflown
+/// __step__ | Increment added and subtracted on increment and decrement button
+/// __inc_per_pixel__ | Value per pixel added or subtracted on dragging
+///
+/// Returns the new modified float value
+*/
NK_API float nk_propertyf(struct nk_context*, const char *name, float min, float val, float max, float step, float inc_per_pixel);
+/*/// #### nk_propertyd
+/// Float property modifing a passed in value and returning the new value
+/// !!! WARNING
+/// To generate a unique property ID using the same label make sure to insert
+/// a `#` at the beginning. It will not be shown but guarantees correct behavior.
+///
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
+/// float nk_propertyd(struct nk_context *ctx, const char *name, double min, double val, double max, double step, double inc_per_pixel);
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+///
+/// Parameter | Description
+/// --------------------|-----------------------------------------------------------
+/// __ctx__ | Must point to an previously initialized `nk_context` struct after calling a layouting function
+/// __name__ | String used both as a label as well as a unique identifier
+/// __min__ | Minimum value not allowed to be underflown
+/// __val__ | Current double value to be modified and returned
+/// __max__ | Maximum value not allowed to be overflown
+/// __step__ | Increment added and subtracted on increment and decrement button
+/// __inc_per_pixel__ | Value per pixel added or subtracted on dragging
+///
+/// Returns the new modified double value
+*/
NK_API double nk_propertyd(struct nk_context*, const char *name, double min, double val, double max, double step, float inc_per_pixel);
/* =============================================================================
*
@@ -2049,6 +3473,8 @@ NK_API void nk_plot_function(struct nk_context*, enum nk_chart_type, void *userd
NK_API int nk_popup_begin(struct nk_context*, enum nk_popup_type, const char*, nk_flags, struct nk_rect bounds);
NK_API void nk_popup_close(struct nk_context*);
NK_API void nk_popup_end(struct nk_context*);
+NK_API void nk_popup_get_scroll(struct nk_context*, nk_uint *offset_x, nk_uint *offset_y);
+NK_API void nk_popup_set_scroll(struct nk_context*, nk_uint offset_x, nk_uint offset_y);
/* =============================================================================
*
* COMBOBOX
@@ -2104,7 +3530,11 @@ NK_API void nk_contextual_end(struct nk_context*);
*
* ============================================================================= */
NK_API void nk_tooltip(struct nk_context*, const char*);
-NK_API int nk_tooltip_begin(struct nk_context*, float width);
+#ifdef NK_INCLUDE_STANDARD_VARARGS
+NK_API void nk_tooltipf(struct nk_context*, NK_PRINTF_FORMAT_STRING const char*, ...) NK_PRINTF_VARARG_FUNC(2);
+NK_API void nk_tooltipfv(struct nk_context*, NK_PRINTF_FORMAT_STRING const char*, va_list) NK_PRINTF_VALIST_FUNC(2);
+#endif
+NK_API int nk_tooltip_begin(struct nk_context*, float width);
NK_API void nk_tooltip_end(struct nk_context*);
/* =============================================================================
*
@@ -2208,6 +3638,7 @@ NK_API struct nk_color nk_rgb_iv(const int *rgb);
NK_API struct nk_color nk_rgb_bv(const nk_byte* rgb);
NK_API struct nk_color nk_rgb_f(float r, float g, float b);
NK_API struct nk_color nk_rgb_fv(const float *rgb);
+NK_API struct nk_color nk_rgb_cf(struct nk_colorf c);
NK_API struct nk_color nk_rgb_hex(const char *rgb);
NK_API struct nk_color nk_rgba(int r, int g, int b, int a);
@@ -2216,8 +3647,14 @@ NK_API struct nk_color nk_rgba_iv(const int *rgba);
NK_API struct nk_color nk_rgba_bv(const nk_byte *rgba);
NK_API struct nk_color nk_rgba_f(float r, float g, float b, float a);
NK_API struct nk_color nk_rgba_fv(const float *rgba);
+NK_API struct nk_color nk_rgba_cf(struct nk_colorf c);
NK_API struct nk_color nk_rgba_hex(const char *rgb);
+NK_API struct nk_colorf nk_hsva_colorf(float h, float s, float v, float a);
+NK_API struct nk_colorf nk_hsva_colorfv(float *c);
+NK_API void nk_colorf_hsva_f(float *out_h, float *out_s, float *out_v, float *out_a, struct nk_colorf in);
+NK_API void nk_colorf_hsva_fv(float *hsva, struct nk_colorf in);
+
NK_API struct nk_color nk_hsv(int h, int s, int v);
NK_API struct nk_color nk_hsv_iv(const int *hsv);
NK_API struct nk_color nk_hsv_bv(const nk_byte *hsv);
@@ -2233,6 +3670,7 @@ NK_API struct nk_color nk_hsva_fv(const float *hsva);
/* color (conversion nuklear --> user) */
NK_API void nk_color_f(float *r, float *g, float *b, float *a, struct nk_color);
NK_API void nk_color_fv(float *rgba_out, struct nk_color);
+NK_API struct nk_colorf nk_color_cf(struct nk_color);
NK_API void nk_color_d(double *r, double *g, double *b, double *a, struct nk_color);
NK_API void nk_color_dv(double *rgba_out, struct nk_color);
@@ -2321,7 +3759,7 @@ NK_API const char* nk_utf_at(const char *buffer, int length, int index, nk_rune
different ways to use the font atlas. The first two will use your font
handling scheme and only requires essential data to run nuklear. The next
slightly more advanced features is font handling with vertex buffer output.
- Finally the most complex API wise is using nuklears font baking API.
+ Finally the most complex API wise is using nuklear's font baking API.
1.) Using your own implementation without vertex buffer output
--------------------------------------------------------------
@@ -2394,7 +3832,7 @@ NK_API const char* nk_utf_at(const char *buffer, int length, int index, nk_rune
------------------------------------
The final approach if you do not have a font handling functionality or don't
want to use it in this library is by using the optional font baker.
- The font baker API's can be used to create a font plus font atlas texture
+ The font baker APIs can be used to create a font plus font atlas texture
and can be used with or without the vertex buffer output.
It still uses the `nk_user_font` struct and the two different approaches
@@ -2409,7 +3847,7 @@ NK_API const char* nk_utf_at(const char *buffer, int length, int index, nk_rune
memory is temporary and therefore can be freed directly after the baking process
is over or permanent you can call `nk_font_atlas_init`.
- After successfull intializing the font baker you can add Truetype(.ttf) fonts from
+ After successfully initializing the font baker you can add Truetype(.ttf) fonts from
different sources like memory or from file by calling one of the `nk_font_atlas_add_xxx`.
functions. Adding font will permanently store each font, font config and ttf memory block(!)
inside the font atlas and allows to reuse the font atlas. If you don't want to reuse
@@ -2417,7 +3855,7 @@ NK_API const char* nk_utf_at(const char *buffer, int length, int index, nk_rune
`nk_font_atlas_cleanup` after the baking process is over (after calling nk_font_atlas_end).
As soon as you added all fonts you wanted you can now start the baking process
- for every selected glyphes to image by calling `nk_font_atlas_bake`.
+ for every selected glyph to image by calling `nk_font_atlas_bake`.
The baking process returns image memory, width and height which can be used to
either create your own image object or upload it to any graphics library.
No matter which case you finally have to call `nk_font_atlas_end` which
@@ -2451,7 +3889,7 @@ NK_API const char* nk_utf_at(const char *buffer, int length, int index, nk_rune
I would suggest reading some of my examples `example/` to get a grip on how
to use the font atlas. There are a number of details I left out. For example
how to merge fonts, configure a font with `nk_font_config` to use other languages,
- use another texture coodinate format and a lot more:
+ use another texture coordinate format and a lot more:
struct nk_font_config cfg = nk_font_config(font_pixel_height);
cfg.merge_mode = nk_false or nk_true;
@@ -2466,7 +3904,7 @@ typedef void(*nk_query_font_glyph_f)(nk_handle handle, float font_height,
struct nk_user_font_glyph *glyph,
nk_rune codepoint, nk_rune next_codepoint);
-#ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT
+#if defined(NK_INCLUDE_VERTEX_BUFFER_OUTPUT) || defined(NK_INCLUDE_SOFTWARE_FONT)
struct nk_user_font_glyph {
struct nk_vec2 uv[2];
/* texture coordinates */
@@ -2500,6 +3938,7 @@ enum nk_font_coord_type {
NK_COORD_PIXEL /* texture coordinates inside font glyphs are in absolute pixel */
};
+struct nk_font;
struct nk_baked_font {
float height;
/* height of the font */
@@ -2545,6 +3984,8 @@ struct nk_font_config {
/* font to setup in the baking process: NOTE: not needed for font atlas */
nk_rune fallback_glyph;
/* fallback glyph to use if a given rune is not found */
+ struct nk_font_config *n;
+ struct nk_font_config *p;
};
struct nk_font_glyph {
@@ -2786,7 +4227,7 @@ NK_API int nk_str_len_char(struct nk_str*);
* First of is the most basic way of just providing a simple char array with
* string length. This method is probably the easiest way of handling simple
* user text input. Main upside is complete control over memory while the biggest
- * downside in comparsion with the other two approaches is missing undo/redo.
+ * downside in comparison with the other two approaches is missing undo/redo.
*
* For UIs that require undo/redo the second way was created. It is based on
* a fixed size nk_text_edit struct, which has an internal undo/redo stack.
@@ -2933,8 +4374,8 @@ NK_API void nk_textedit_redo(struct nk_text_edit*);
but also returns the state of the widget space. If your widget is not seen and does
not have to be updated it is '0' and you can just return. If it only has
to be drawn the state will be `NK_WIDGET_ROM` otherwise you can do both
- update and draw your widget. The reason for seperating is to only draw and
- update what is actually neccessary which is crucial for performance.
+ update and draw your widget. The reason for separating is to only draw and
+ update what is actually necessary which is crucial for performance.
*/
enum nk_command_type {
NK_COMMAND_NOP,
@@ -3227,7 +4668,11 @@ NK_API int nk_input_is_key_down(const struct nk_input*, enum nk_keys);
In fact it is probably more powerful than needed but allows even more crazy
things than this library provides by default.
*/
+#ifdef NK_UINT_DRAW_INDEX
+typedef nk_uint nk_draw_index;
+#else
typedef nk_ushort nk_draw_index;
+#endif
enum nk_draw_list_stroke {
NK_STROKE_OPEN = nk_false,
/* build up path has no connection back to the beginning */
@@ -3317,14 +4762,12 @@ struct nk_draw_list {
/* draw list */
NK_API void nk_draw_list_init(struct nk_draw_list*);
NK_API void nk_draw_list_setup(struct nk_draw_list*, const struct nk_convert_config*, struct nk_buffer *cmds, struct nk_buffer *vertices, struct nk_buffer *elements, enum nk_anti_aliasing line_aa,enum nk_anti_aliasing shape_aa);
-NK_API void nk_draw_list_clear(struct nk_draw_list*);
/* drawing */
#define nk_draw_list_foreach(cmd, can, b) for((cmd)=nk__draw_list_begin(can, b); (cmd)!=0; (cmd)=nk__draw_list_next(cmd, b, can))
NK_API const struct nk_draw_command* nk__draw_list_begin(const struct nk_draw_list*, const struct nk_buffer*);
NK_API const struct nk_draw_command* nk__draw_list_next(const struct nk_draw_command*, const struct nk_buffer*, const struct nk_draw_list*);
NK_API const struct nk_draw_command* nk__draw_list_end(const struct nk_draw_list*, const struct nk_buffer*);
-NK_API void nk_draw_list_clear(struct nk_draw_list *list);
/* path */
NK_API void nk_draw_list_path_clear(struct nk_draw_list*);
@@ -3813,6 +5256,7 @@ NK_API struct nk_style_item nk_style_item_hide(void);
#endif
enum nk_panel_type {
+ NK_PANEL_NONE = 0,
NK_PANEL_WINDOW = NK_FLAG(0),
NK_PANEL_GROUP = NK_FLAG(1),
NK_PANEL_POPUP = NK_FLAG(2),
@@ -4241,16 +5685,13 @@ template struct nk_alignof{struct Big {T x; char c;}; enum {
#define NK_ALIGNOF(t) ((char*)(&((struct {char c; t _h;}*)0)->_h) - (char*)0)
#endif
-#endif /* NK_H_ */
-/*
- * ==============================================================
- *
- * IMPLEMENTATION
- *
- * ===============================================================
- */
+#endif /* NK_NUKLEAR_H_ */
+
#ifdef NK_IMPLEMENTATION
+#ifndef NK_INTERNAL_H
+#define NK_INTERNAL_H
+
#ifndef NK_POOL_DEFAULT_CAPACITY
#define NK_POOL_DEFAULT_CAPACITY 16
#endif
@@ -4270,9 +5711,6 @@ template struct nk_alignof{struct Big {T x; char c;}; enum {
#ifdef NK_INCLUDE_STANDARD_IO
#include /* fopen, fclose,... */
#endif
-#ifdef NK_INCLUDE_STANDARD_VARARGS
-#include /* valist, va_start, va_end, ... */
-#endif
#ifndef NK_ASSERT
#include
#define NK_ASSERT(expr) assert(expr)
@@ -4354,13 +5792,244 @@ NK_GLOBAL const struct nk_color nk_white = {255,255,255,255};
NK_GLOBAL const struct nk_color nk_black = {0,0,0,255};
NK_GLOBAL const struct nk_color nk_yellow = {255,255,0,255};
-/*
- * ==============================================================
+/* widget */
+#define nk_widget_state_reset(s)\
+ if ((*(s)) & NK_WIDGET_STATE_MODIFIED)\
+ (*(s)) = NK_WIDGET_STATE_INACTIVE|NK_WIDGET_STATE_MODIFIED;\
+ else (*(s)) = NK_WIDGET_STATE_INACTIVE;
+
+/* math */
+NK_LIB float nk_inv_sqrt(float n);
+NK_LIB float nk_sqrt(float x);
+NK_LIB float nk_sin(float x);
+NK_LIB float nk_cos(float x);
+NK_LIB nk_uint nk_round_up_pow2(nk_uint v);
+NK_LIB struct nk_rect nk_shrink_rect(struct nk_rect r, float amount);
+NK_LIB struct nk_rect nk_pad_rect(struct nk_rect r, struct nk_vec2 pad);
+NK_LIB void nk_unify(struct nk_rect *clip, const struct nk_rect *a, float x0, float y0, float x1, float y1);
+NK_LIB double nk_pow(double x, int n);
+NK_LIB int nk_ifloord(double x);
+NK_LIB int nk_ifloorf(float x);
+NK_LIB int nk_iceilf(float x);
+NK_LIB int nk_log10(double n);
+
+/* util */
+enum {NK_DO_NOT_STOP_ON_NEW_LINE, NK_STOP_ON_NEW_LINE};
+NK_LIB int nk_is_lower(int c);
+NK_LIB int nk_is_upper(int c);
+NK_LIB int nk_to_upper(int c);
+NK_LIB int nk_to_lower(int c);
+NK_LIB void* nk_memcopy(void *dst, const void *src, nk_size n);
+NK_LIB void nk_memset(void *ptr, int c0, nk_size size);
+NK_LIB void nk_zero(void *ptr, nk_size size);
+NK_LIB char *nk_itoa(char *s, long n);
+NK_LIB int nk_string_float_limit(char *string, int prec);
+NK_LIB char *nk_dtoa(char *s, double n);
+NK_LIB int nk_text_clamp(const struct nk_user_font *font, const char *text, int text_len, float space, int *glyphs, float *text_width, nk_rune *sep_list, int sep_count);
+NK_LIB struct nk_vec2 nk_text_calculate_text_bounds(const struct nk_user_font *font, const char *begin, int byte_len, float row_height, const char **remaining, struct nk_vec2 *out_offset, int *glyphs, int op);
+#ifdef NK_INCLUDE_STANDARD_VARARGS
+NK_LIB int nk_strfmt(char *buf, int buf_size, const char *fmt, va_list args);
+#endif
+#ifdef NK_INCLUDE_STANDARD_IO
+NK_LIB char *nk_file_load(const char* path, nk_size* siz, struct nk_allocator *alloc);
+#endif
+
+/* buffer */
+#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
+NK_LIB void* nk_malloc(nk_handle unused, void *old,nk_size size);
+NK_LIB void nk_mfree(nk_handle unused, void *ptr);
+#endif
+NK_LIB void* nk_buffer_align(void *unaligned, nk_size align, nk_size *alignment, enum nk_buffer_allocation_type type);
+NK_LIB void* nk_buffer_alloc(struct nk_buffer *b, enum nk_buffer_allocation_type type, nk_size size, nk_size align);
+NK_LIB void* nk_buffer_realloc(struct nk_buffer *b, nk_size capacity, nk_size *size);
+
+/* draw */
+NK_LIB void nk_command_buffer_init(struct nk_command_buffer *cb, struct nk_buffer *b, enum nk_command_clipping clip);
+NK_LIB void nk_command_buffer_reset(struct nk_command_buffer *b);
+NK_LIB void* nk_command_buffer_push(struct nk_command_buffer* b, enum nk_command_type t, nk_size size);
+NK_LIB void nk_draw_symbol(struct nk_command_buffer *out, enum nk_symbol_type type, struct nk_rect content, struct nk_color background, struct nk_color foreground, float border_width, const struct nk_user_font *font);
+
+/* buffering */
+NK_LIB void nk_start_buffer(struct nk_context *ctx, struct nk_command_buffer *b);
+NK_LIB void nk_start(struct nk_context *ctx, struct nk_window *win);
+NK_LIB void nk_start_popup(struct nk_context *ctx, struct nk_window *win);
+NK_LIB void nk_finish_popup(struct nk_context *ctx, struct nk_window*);
+NK_LIB void nk_finish_buffer(struct nk_context *ctx, struct nk_command_buffer *b);
+NK_LIB void nk_finish(struct nk_context *ctx, struct nk_window *w);
+NK_LIB void nk_build(struct nk_context *ctx);
+
+/* text editor */
+NK_LIB void nk_textedit_clear_state(struct nk_text_edit *state, enum nk_text_edit_type type, nk_plugin_filter filter);
+NK_LIB void nk_textedit_click(struct nk_text_edit *state, float x, float y, const struct nk_user_font *font, float row_height);
+NK_LIB void nk_textedit_drag(struct nk_text_edit *state, float x, float y, const struct nk_user_font *font, float row_height);
+NK_LIB void nk_textedit_key(struct nk_text_edit *state, enum nk_keys key, int shift_mod, const struct nk_user_font *font, float row_height);
+
+/* window */
+enum nk_window_insert_location {
+ NK_INSERT_BACK, /* inserts window into the back of list (front of screen) */
+ NK_INSERT_FRONT /* inserts window into the front of list (back of screen) */
+};
+NK_LIB void *nk_create_window(struct nk_context *ctx);
+NK_LIB void nk_remove_window(struct nk_context*, struct nk_window*);
+NK_LIB void nk_free_window(struct nk_context *ctx, struct nk_window *win);
+NK_LIB struct nk_window *nk_find_window(struct nk_context *ctx, nk_hash hash, const char *name);
+NK_LIB void nk_insert_window(struct nk_context *ctx, struct nk_window *win, enum nk_window_insert_location loc);
+
+/* pool */
+NK_LIB void nk_pool_init(struct nk_pool *pool, struct nk_allocator *alloc, unsigned int capacity);
+NK_LIB void nk_pool_free(struct nk_pool *pool);
+NK_LIB void nk_pool_init_fixed(struct nk_pool *pool, void *memory, nk_size size);
+NK_LIB struct nk_page_element *nk_pool_alloc(struct nk_pool *pool);
+
+/* page-element */
+NK_LIB struct nk_page_element* nk_create_page_element(struct nk_context *ctx);
+NK_LIB void nk_link_page_element_into_freelist(struct nk_context *ctx, struct nk_page_element *elem);
+NK_LIB void nk_free_page_element(struct nk_context *ctx, struct nk_page_element *elem);
+
+/* table */
+NK_LIB struct nk_table* nk_create_table(struct nk_context *ctx);
+NK_LIB void nk_remove_table(struct nk_window *win, struct nk_table *tbl);
+NK_LIB void nk_free_table(struct nk_context *ctx, struct nk_table *tbl);
+NK_LIB void nk_push_table(struct nk_window *win, struct nk_table *tbl);
+NK_LIB nk_uint *nk_add_value(struct nk_context *ctx, struct nk_window *win, nk_hash name, nk_uint value);
+NK_LIB nk_uint *nk_find_value(struct nk_window *win, nk_hash name);
+
+/* panel */
+NK_LIB void *nk_create_panel(struct nk_context *ctx);
+NK_LIB void nk_free_panel(struct nk_context*, struct nk_panel *pan);
+NK_LIB int nk_panel_has_header(nk_flags flags, const char *title);
+NK_LIB struct nk_vec2 nk_panel_get_padding(const struct nk_style *style, enum nk_panel_type type);
+NK_LIB float nk_panel_get_border(const struct nk_style *style, nk_flags flags, enum nk_panel_type type);
+NK_LIB struct nk_color nk_panel_get_border_color(const struct nk_style *style, enum nk_panel_type type);
+NK_LIB int nk_panel_is_sub(enum nk_panel_type type);
+NK_LIB int nk_panel_is_nonblock(enum nk_panel_type type);
+NK_LIB int nk_panel_begin(struct nk_context *ctx, const char *title, enum nk_panel_type panel_type);
+NK_LIB void nk_panel_end(struct nk_context *ctx);
+
+/* layout */
+NK_LIB float nk_layout_row_calculate_usable_space(const struct nk_style *style, enum nk_panel_type type, float total_space, int columns);
+NK_LIB void nk_panel_layout(const struct nk_context *ctx, struct nk_window *win, float height, int cols);
+NK_LIB void nk_row_layout(struct nk_context *ctx, enum nk_layout_format fmt, float height, int cols, int width);
+NK_LIB void nk_panel_alloc_row(const struct nk_context *ctx, struct nk_window *win);
+NK_LIB void nk_layout_widget_space(struct nk_rect *bounds, const struct nk_context *ctx, struct nk_window *win, int modify);
+NK_LIB void nk_panel_alloc_space(struct nk_rect *bounds, const struct nk_context *ctx);
+NK_LIB void nk_layout_peek(struct nk_rect *bounds, struct nk_context *ctx);
+
+/* popup */
+NK_LIB int nk_nonblock_begin(struct nk_context *ctx, nk_flags flags, struct nk_rect body, struct nk_rect header, enum nk_panel_type panel_type);
+
+/* text */
+struct nk_text {
+ struct nk_vec2 padding;
+ struct nk_color background;
+ struct nk_color text;
+};
+NK_LIB void nk_widget_text(struct nk_command_buffer *o, struct nk_rect b, const char *string, int len, const struct nk_text *t, nk_flags a, const struct nk_user_font *f);
+NK_LIB void nk_widget_text_wrap(struct nk_command_buffer *o, struct nk_rect b, const char *string, int len, const struct nk_text *t, const struct nk_user_font *f);
+
+/* button */
+NK_LIB int nk_button_behavior(nk_flags *state, struct nk_rect r, const struct nk_input *i, enum nk_button_behavior behavior);
+NK_LIB const struct nk_style_item* nk_draw_button(struct nk_command_buffer *out, const struct nk_rect *bounds, nk_flags state, const struct nk_style_button *style);
+NK_LIB int nk_do_button(nk_flags *state, struct nk_command_buffer *out, struct nk_rect r, const struct nk_style_button *style, const struct nk_input *in, enum nk_button_behavior behavior, struct nk_rect *content);
+NK_LIB void nk_draw_button_text(struct nk_command_buffer *out, const struct nk_rect *bounds, const struct nk_rect *content, nk_flags state, const struct nk_style_button *style, const char *txt, int len, nk_flags text_alignment, const struct nk_user_font *font);
+NK_LIB int nk_do_button_text(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, const char *string, int len, nk_flags align, enum nk_button_behavior behavior, const struct nk_style_button *style, const struct nk_input *in, const struct nk_user_font *font);
+NK_LIB void nk_draw_button_symbol(struct nk_command_buffer *out, const struct nk_rect *bounds, const struct nk_rect *content, nk_flags state, const struct nk_style_button *style, enum nk_symbol_type type, const struct nk_user_font *font);
+NK_LIB int nk_do_button_symbol(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, enum nk_symbol_type symbol, enum nk_button_behavior behavior, const struct nk_style_button *style, const struct nk_input *in, const struct nk_user_font *font);
+NK_LIB void nk_draw_button_image(struct nk_command_buffer *out, const struct nk_rect *bounds, const struct nk_rect *content, nk_flags state, const struct nk_style_button *style, const struct nk_image *img);
+NK_LIB int nk_do_button_image(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, struct nk_image img, enum nk_button_behavior b, const struct nk_style_button *style, const struct nk_input *in);
+NK_LIB void nk_draw_button_text_symbol(struct nk_command_buffer *out, const struct nk_rect *bounds, const struct nk_rect *label, const struct nk_rect *symbol, nk_flags state, const struct nk_style_button *style, const char *str, int len, enum nk_symbol_type type, const struct nk_user_font *font);
+NK_LIB int nk_do_button_text_symbol(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, enum nk_symbol_type symbol, const char *str, int len, nk_flags align, enum nk_button_behavior behavior, const struct nk_style_button *style, const struct nk_user_font *font, const struct nk_input *in);
+NK_LIB void nk_draw_button_text_image(struct nk_command_buffer *out, const struct nk_rect *bounds, const struct nk_rect *label, const struct nk_rect *image, nk_flags state, const struct nk_style_button *style, const char *str, int len, const struct nk_user_font *font, const struct nk_image *img);
+NK_LIB int nk_do_button_text_image(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, struct nk_image img, const char* str, int len, nk_flags align, enum nk_button_behavior behavior, const struct nk_style_button *style, const struct nk_user_font *font, const struct nk_input *in);
+
+/* toggle */
+enum nk_toggle_type {
+ NK_TOGGLE_CHECK,
+ NK_TOGGLE_OPTION
+};
+NK_LIB int nk_toggle_behavior(const struct nk_input *in, struct nk_rect select, nk_flags *state, int active);
+NK_LIB void nk_draw_checkbox(struct nk_command_buffer *out, nk_flags state, const struct nk_style_toggle *style, int active, const struct nk_rect *label, const struct nk_rect *selector, const struct nk_rect *cursors, const char *string, int len, const struct nk_user_font *font);
+NK_LIB void nk_draw_option(struct nk_command_buffer *out, nk_flags state, const struct nk_style_toggle *style, int active, const struct nk_rect *label, const struct nk_rect *selector, const struct nk_rect *cursors, const char *string, int len, const struct nk_user_font *font);
+NK_LIB int nk_do_toggle(nk_flags *state, struct nk_command_buffer *out, struct nk_rect r, int *active, const char *str, int len, enum nk_toggle_type type, const struct nk_style_toggle *style, const struct nk_input *in, const struct nk_user_font *font);
+
+/* progress */
+NK_LIB nk_size nk_progress_behavior(nk_flags *state, struct nk_input *in, struct nk_rect r, struct nk_rect cursor, nk_size max, nk_size value, int modifiable);
+NK_LIB void nk_draw_progress(struct nk_command_buffer *out, nk_flags state, const struct nk_style_progress *style, const struct nk_rect *bounds, const struct nk_rect *scursor, nk_size value, nk_size max);
+NK_LIB nk_size nk_do_progress(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, nk_size value, nk_size max, int modifiable, const struct nk_style_progress *style, struct nk_input *in);
+
+/* slider */
+NK_LIB float nk_slider_behavior(nk_flags *state, struct nk_rect *logical_cursor, struct nk_rect *visual_cursor, struct nk_input *in, struct nk_rect bounds, float slider_min, float slider_max, float slider_value, float slider_step, float slider_steps);
+NK_LIB void nk_draw_slider(struct nk_command_buffer *out, nk_flags state, const struct nk_style_slider *style, const struct nk_rect *bounds, const struct nk_rect *visual_cursor, float min, float value, float max);
+NK_LIB float nk_do_slider(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, float min, float val, float max, float step, const struct nk_style_slider *style, struct nk_input *in, const struct nk_user_font *font);
+
+/* scrollbar */
+NK_LIB float nk_scrollbar_behavior(nk_flags *state, struct nk_input *in, int has_scrolling, const struct nk_rect *scroll, const struct nk_rect *cursor, const struct nk_rect *empty0, const struct nk_rect *empty1, float scroll_offset, float target, float scroll_step, enum nk_orientation o);
+NK_LIB void nk_draw_scrollbar(struct nk_command_buffer *out, nk_flags state, const struct nk_style_scrollbar *style, const struct nk_rect *bounds, const struct nk_rect *scroll);
+NK_LIB float nk_do_scrollbarv(nk_flags *state, struct nk_command_buffer *out, struct nk_rect scroll, int has_scrolling, float offset, float target, float step, float button_pixel_inc, const struct nk_style_scrollbar *style, struct nk_input *in, const struct nk_user_font *font);
+NK_LIB float nk_do_scrollbarh(nk_flags *state, struct nk_command_buffer *out, struct nk_rect scroll, int has_scrolling, float offset, float target, float step, float button_pixel_inc, const struct nk_style_scrollbar *style, struct nk_input *in, const struct nk_user_font *font);
+
+/* selectable */
+NK_LIB void nk_draw_selectable(struct nk_command_buffer *out, nk_flags state, const struct nk_style_selectable *style, int active, const struct nk_rect *bounds, const struct nk_rect *icon, const struct nk_image *img, enum nk_symbol_type sym, const char *string, int len, nk_flags align, const struct nk_user_font *font);
+NK_LIB int nk_do_selectable(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, const char *str, int len, nk_flags align, int *value, const struct nk_style_selectable *style, const struct nk_input *in, const struct nk_user_font *font);
+NK_LIB int nk_do_selectable_image(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, const char *str, int len, nk_flags align, int *value, const struct nk_image *img, const struct nk_style_selectable *style, const struct nk_input *in, const struct nk_user_font *font);
+
+/* edit */
+NK_LIB void nk_edit_draw_text(struct nk_command_buffer *out, const struct nk_style_edit *style, float pos_x, float pos_y, float x_offset, const char *text, int byte_len, float row_height, const struct nk_user_font *font, struct nk_color background, struct nk_color foreground, int is_selected);
+NK_LIB nk_flags nk_do_edit(nk_flags *state, struct nk_command_buffer *out, struct nk_rect bounds, nk_flags flags, nk_plugin_filter filter, struct nk_text_edit *edit, const struct nk_style_edit *style, struct nk_input *in, const struct nk_user_font *font);
+
+/* color-picker */
+NK_LIB int nk_color_picker_behavior(nk_flags *state, const struct nk_rect *bounds, const struct nk_rect *matrix, const struct nk_rect *hue_bar, const struct nk_rect *alpha_bar, struct nk_colorf *color, const struct nk_input *in);
+NK_LIB void nk_draw_color_picker(struct nk_command_buffer *o, const struct nk_rect *matrix, const struct nk_rect *hue_bar, const struct nk_rect *alpha_bar, struct nk_colorf col);
+NK_LIB int nk_do_color_picker(nk_flags *state, struct nk_command_buffer *out, struct nk_colorf *col, enum nk_color_format fmt, struct nk_rect bounds, struct nk_vec2 padding, const struct nk_input *in, const struct nk_user_font *font);
+
+/* property */
+enum nk_property_status {
+ NK_PROPERTY_DEFAULT,
+ NK_PROPERTY_EDIT,
+ NK_PROPERTY_DRAG
+};
+enum nk_property_filter {
+ NK_FILTER_INT,
+ NK_FILTER_FLOAT
+};
+enum nk_property_kind {
+ NK_PROPERTY_INT,
+ NK_PROPERTY_FLOAT,
+ NK_PROPERTY_DOUBLE
+};
+union nk_property {
+ int i;
+ float f;
+ double d;
+};
+struct nk_property_variant {
+ enum nk_property_kind kind;
+ union nk_property value;
+ union nk_property min_value;
+ union nk_property max_value;
+ union nk_property step;
+};
+NK_LIB struct nk_property_variant nk_property_variant_int(int value, int min_value, int max_value, int step);
+NK_LIB struct nk_property_variant nk_property_variant_float(float value, float min_value, float max_value, float step);
+NK_LIB struct nk_property_variant nk_property_variant_double(double value, double min_value, double max_value, double step);
+
+NK_LIB void nk_drag_behavior(nk_flags *state, const struct nk_input *in, struct nk_rect drag, struct nk_property_variant *variant, float inc_per_pixel);
+NK_LIB void nk_property_behavior(nk_flags *ws, const struct nk_input *in, struct nk_rect property, struct nk_rect label, struct nk_rect edit, struct nk_rect empty, int *state, struct nk_property_variant *variant, float inc_per_pixel);
+NK_LIB void nk_draw_property(struct nk_command_buffer *out, const struct nk_style_property *style, const struct nk_rect *bounds, const struct nk_rect *label, nk_flags state, const char *name, int len, const struct nk_user_font *font);
+NK_LIB void nk_do_property(nk_flags *ws, struct nk_command_buffer *out, struct nk_rect property, const char *name, struct nk_property_variant *variant, float inc_per_pixel, char *buffer, int *len, int *state, int *cursor, int *select_begin, int *select_end, const struct nk_style_property *style, enum nk_property_filter filter, struct nk_input *in, const struct nk_user_font *font, struct nk_text_edit *text_edit, enum nk_button_behavior behavior);
+NK_LIB void nk_property(struct nk_context *ctx, const char *name, struct nk_property_variant *variant, float inc_per_pixel, const enum nk_property_filter filter);
+
+#endif
+
+
+
+
+
+/* ===============================================================
*
- * MATH
+ * MATH
*
- * ===============================================================
- */
+ * ===============================================================*/
/* Since nuklear is supposed to work on all systems providing floating point
math without any dependencies I also had to implement my own math functions
for sqrt, sin and cos. Since the actual highly accurate implementations for
@@ -4371,7 +6040,7 @@ NK_GLOBAL const struct nk_color nk_yellow = {255,255,0,255};
----
For square root nuklear uses the famous fast inverse square root:
https://en.wikipedia.org/wiki/Fast_inverse_square_root with
- slightly tweaked magic constant. While on todays hardware it is
+ slightly tweaked magic constant. While on today's hardware it is
probably not faster it is still fast and accurate enough for
nuklear's use cases. IMPORTANT: this requires float format IEEE 754
@@ -4382,32 +6051,30 @@ NK_GLOBAL const struct nk_color nk_yellow = {255,255,0,255};
approximate exactly that range is that nuklear only needs sine and
cosine to generate circles which only requires that exact range.
In addition I used Remez instead of Taylor for additional precision:
- www.lolengine.net/blog/2011/12/21/better-function-approximatations.
+ www.lolengine.net/blog/2011/12/21/better-function-approximations.
The tool I used to generate constants for both sine and cosine
(it can actually approximate a lot more functions) can be
found here: www.lolengine.net/wiki/oss/lolremez
*/
-NK_INTERN float
-nk_inv_sqrt(float number)
+NK_LIB float
+nk_inv_sqrt(float n)
{
float x2;
const float threehalfs = 1.5f;
union {nk_uint i; float f;} conv = {0};
- conv.f = number;
- x2 = number * 0.5f;
+ conv.f = n;
+ x2 = n * 0.5f;
conv.i = 0x5f375A84 - (conv.i >> 1);
conv.f = conv.f * (threehalfs - (x2 * conv.f * conv.f));
return conv.f;
}
-
-NK_INTERN float
+NK_LIB float
nk_sqrt(float x)
{
return x * nk_inv_sqrt(x);
}
-
-NK_INTERN float
+NK_LIB float
nk_sin(float x)
{
NK_STORAGE const float a0 = +1.91059300966915117e-31f;
@@ -4420,22 +6087,23 @@ nk_sin(float x)
NK_STORAGE const float a7 = +1.38235642404333740e-4f;
return a0 + x*(a1 + x*(a2 + x*(a3 + x*(a4 + x*(a5 + x*(a6 + x*a7))))));
}
-
-NK_INTERN float
+NK_LIB float
nk_cos(float x)
{
- NK_STORAGE const float a0 = +1.00238601909309722f;
- NK_STORAGE const float a1 = -3.81919947353040024e-2f;
- NK_STORAGE const float a2 = -3.94382342128062756e-1f;
- NK_STORAGE const float a3 = -1.18134036025221444e-1f;
- NK_STORAGE const float a4 = +1.07123798512170878e-1f;
- NK_STORAGE const float a5 = -1.86637164165180873e-2f;
- NK_STORAGE const float a6 = +9.90140908664079833e-4f;
- NK_STORAGE const float a7 = -5.23022132118824778e-14f;
- return a0 + x*(a1 + x*(a2 + x*(a3 + x*(a4 + x*(a5 + x*(a6 + x*a7))))));
-}
-
-NK_INTERN nk_uint
+ /* New implementation. Also generated using lolremez. */
+ /* Old version significantly deviated from expected results. */
+ NK_STORAGE const float a0 = 9.9995999154986614e-1f;
+ NK_STORAGE const float a1 = 1.2548995793001028e-3f;
+ NK_STORAGE const float a2 = -5.0648546280678015e-1f;
+ NK_STORAGE const float a3 = 1.2942246466519995e-2f;
+ NK_STORAGE const float a4 = 2.8668384702547972e-2f;
+ NK_STORAGE const float a5 = 7.3726485210586547e-3f;
+ NK_STORAGE const float a6 = -3.8510875386947414e-3f;
+ NK_STORAGE const float a7 = 4.7196604604366623e-4f;
+ NK_STORAGE const float a8 = -1.8776444013090451e-5f;
+ return a0 + x*(a1 + x*(a2 + x*(a3 + x*(a4 + x*(a5 + x*(a6 + x*(a7 + x*a8)))))));
+}
+NK_LIB nk_uint
nk_round_up_pow2(nk_uint v)
{
v--;
@@ -4447,13 +6115,66 @@ nk_round_up_pow2(nk_uint v)
v++;
return v;
}
+NK_LIB double
+nk_pow(double x, int n)
+{
+ /* check the sign of n */
+ double r = 1;
+ int plus = n >= 0;
+ n = (plus) ? n : -n;
+ while (n > 0) {
+ if ((n & 1) == 1)
+ r *= x;
+ n /= 2;
+ x *= x;
+ }
+ return plus ? r : 1.0 / r;
+}
+NK_LIB int
+nk_ifloord(double x)
+{
+ x = (double)((int)x - ((x < 0.0) ? 1 : 0));
+ return (int)x;
+}
+NK_LIB int
+nk_ifloorf(float x)
+{
+ x = (float)((int)x - ((x < 0.0f) ? 1 : 0));
+ return (int)x;
+}
+NK_LIB int
+nk_iceilf(float x)
+{
+ if (x >= 0) {
+ int i = (int)x;
+ return (x > i) ? i+1: i;
+ } else {
+ int t = (int)x;
+ float r = x - (float)t;
+ return (r > 0.0f) ? t+1: t;
+ }
+}
+NK_LIB int
+nk_log10(double n)
+{
+ int neg;
+ int ret;
+ int exp = 0;
+ neg = (n < 0) ? 1 : 0;
+ ret = (neg) ? (int)-n : (int)n;
+ while ((ret / 10) > 0) {
+ ret /= 10;
+ exp++;
+ }
+ if (neg) exp = -exp;
+ return exp;
+}
NK_API struct nk_rect
nk_get_null_rect(void)
{
return nk_null_rect;
}
-
NK_API struct nk_rect
nk_rect(float x, float y, float w, float h)
{
@@ -4462,7 +6183,6 @@ nk_rect(float x, float y, float w, float h)
r.w = w; r.h = h;
return r;
}
-
NK_API struct nk_rect
nk_recti(int x, int y, int w, int h)
{
@@ -4473,25 +6193,21 @@ nk_recti(int x, int y, int w, int h)
r.h = (float)h;
return r;
}
-
NK_API struct nk_rect
nk_recta(struct nk_vec2 pos, struct nk_vec2 size)
{
return nk_rect(pos.x, pos.y, size.x, size.y);
}
-
NK_API struct nk_rect
nk_rectv(const float *r)
{
return nk_rect(r[0], r[1], r[2], r[3]);
}
-
NK_API struct nk_rect
nk_rectiv(const int *r)
{
return nk_recti(r[0], r[1], r[2], r[3]);
}
-
NK_API struct nk_vec2
nk_rect_pos(struct nk_rect r)
{
@@ -4499,7 +6215,6 @@ nk_rect_pos(struct nk_rect r)
ret.x = r.x; ret.y = r.y;
return ret;
}
-
NK_API struct nk_vec2
nk_rect_size(struct nk_rect r)
{
@@ -4507,8 +6222,7 @@ nk_rect_size(struct nk_rect r)
ret.x = r.w; ret.y = r.h;
return ret;
}
-
-NK_INTERN struct nk_rect
+NK_LIB struct nk_rect
nk_shrink_rect(struct nk_rect r, float amount)
{
struct nk_rect res;
@@ -4520,8 +6234,7 @@ nk_shrink_rect(struct nk_rect r, float amount)
res.h = r.h - 2 * amount;
return res;
}
-
-NK_INTERN struct nk_rect
+NK_LIB struct nk_rect
nk_pad_rect(struct nk_rect r, struct nk_vec2 pad)
{
r.w = NK_MAX(r.w, 2 * pad.x);
@@ -4531,7 +6244,6 @@ nk_pad_rect(struct nk_rect r, struct nk_vec2 pad)
r.h -= 2 * pad.y;
return r;
}
-
NK_API struct nk_vec2
nk_vec2(float x, float y)
{
@@ -4539,7 +6251,6 @@ nk_vec2(float x, float y)
ret.x = x; ret.y = y;
return ret;
}
-
NK_API struct nk_vec2
nk_vec2i(int x, int y)
{
@@ -4548,34 +6259,84 @@ nk_vec2i(int x, int y)
ret.y = (float)y;
return ret;
}
-
NK_API struct nk_vec2
nk_vec2v(const float *v)
{
return nk_vec2(v[0], v[1]);
}
-
NK_API struct nk_vec2
nk_vec2iv(const int *v)
{
return nk_vec2i(v[0], v[1]);
}
+NK_LIB void
+nk_unify(struct nk_rect *clip, const struct nk_rect *a, float x0, float y0,
+ float x1, float y1)
+{
+ NK_ASSERT(a);
+ NK_ASSERT(clip);
+ clip->x = NK_MAX(a->x, x0);
+ clip->y = NK_MAX(a->y, y0);
+ clip->w = NK_MIN(a->x + a->w, x1) - clip->x;
+ clip->h = NK_MIN(a->y + a->h, y1) - clip->y;
+ clip->w = NK_MAX(0, clip->w);
+ clip->h = NK_MAX(0, clip->h);
+}
-/*
- * ==============================================================
+NK_API void
+nk_triangle_from_direction(struct nk_vec2 *result, struct nk_rect r,
+ float pad_x, float pad_y, enum nk_heading direction)
+{
+ float w_half, h_half;
+ NK_ASSERT(result);
+
+ r.w = NK_MAX(2 * pad_x, r.w);
+ r.h = NK_MAX(2 * pad_y, r.h);
+ r.w = r.w - 2 * pad_x;
+ r.h = r.h - 2 * pad_y;
+
+ r.x = r.x + pad_x;
+ r.y = r.y + pad_y;
+
+ w_half = r.w / 2.0f;
+ h_half = r.h / 2.0f;
+
+ if (direction == NK_UP) {
+ result[0] = nk_vec2(r.x + w_half, r.y);
+ result[1] = nk_vec2(r.x + r.w, r.y + r.h);
+ result[2] = nk_vec2(r.x, r.y + r.h);
+ } else if (direction == NK_RIGHT) {
+ result[0] = nk_vec2(r.x, r.y);
+ result[1] = nk_vec2(r.x + r.w, r.y + h_half);
+ result[2] = nk_vec2(r.x, r.y + r.h);
+ } else if (direction == NK_DOWN) {
+ result[0] = nk_vec2(r.x, r.y);
+ result[1] = nk_vec2(r.x + r.w, r.y);
+ result[2] = nk_vec2(r.x + w_half, r.y + r.h);
+ } else {
+ result[0] = nk_vec2(r.x, r.y + h_half);
+ result[1] = nk_vec2(r.x + r.w, r.y);
+ result[2] = nk_vec2(r.x + r.w, r.y + r.h);
+ }
+}
+
+
+
+
+
+/* ===============================================================
*
- * UTIL
+ * UTIL
*
- * ===============================================================
- */
+ * ===============================================================*/
NK_INTERN int nk_str_match_here(const char *regexp, const char *text);
NK_INTERN int nk_str_match_star(int c, const char *regexp, const char *text);
-NK_INTERN int nk_is_lower(int c) {return (c >= 'a' && c <= 'z') || (c >= 0xE0 && c <= 0xFF);}
-NK_INTERN int nk_is_upper(int c){return (c >= 'A' && c <= 'Z') || (c >= 0xC0 && c <= 0xDF);}
-NK_INTERN int nk_to_upper(int c) {return (c >= 'a' && c <= 'z') ? (c - ('a' - 'A')) : c;}
-NK_INTERN int nk_to_lower(int c) {return (c >= 'A' && c <= 'Z') ? (c - ('a' + 'A')) : c;}
+NK_LIB int nk_is_lower(int c) {return (c >= 'a' && c <= 'z') || (c >= 0xE0 && c <= 0xFF);}
+NK_LIB int nk_is_upper(int c){return (c >= 'A' && c <= 'Z') || (c >= 0xC0 && c <= 0xDF);}
+NK_LIB int nk_to_upper(int c) {return (c >= 'a' && c <= 'z') ? (c - ('a' - 'A')) : c;}
+NK_LIB int nk_to_lower(int c) {return (c >= 'A' && c <= 'Z') ? (c - ('a' + 'A')) : c;}
-NK_INTERN void*
+NK_LIB void*
nk_memcopy(void *dst0, const void *src0, nk_size length)
{
nk_ptr t;
@@ -4631,8 +6392,7 @@ nk_memcopy(void *dst0, const void *src0, nk_size length)
done:
return (dst0);
}
-
-NK_INTERN void
+NK_LIB void
nk_memset(void *ptr, int c0, nk_size size)
{
#define nk_word unsigned
@@ -4683,14 +6443,12 @@ nk_memset(void *ptr, int c0, nk_size size)
#undef nk_wsize
#undef nk_wmask
}
-
-NK_INTERN void
+NK_LIB void
nk_zero(void *ptr, nk_size size)
{
NK_ASSERT(ptr);
NK_MEMSET(ptr, 0, size);
}
-
NK_API int
nk_strlen(const char *str)
{
@@ -4699,7 +6457,6 @@ nk_strlen(const char *str)
while (str && *str++ != '\0') siz++;
return siz;
}
-
NK_API int
nk_strtoi(const char *str, const char **endptr)
{
@@ -4724,7 +6481,6 @@ nk_strtoi(const char *str, const char **endptr)
*endptr = p;
return neg*value;
}
-
NK_API double
nk_strtod(const char *str, const char **endptr)
{
@@ -4782,7 +6538,6 @@ nk_strtod(const char *str, const char **endptr)
*endptr = p;
return number;
}
-
NK_API float
nk_strtof(const char *str, const char **endptr)
{
@@ -4792,7 +6547,6 @@ nk_strtof(const char *str, const char **endptr)
float_value = (float)double_value;
return float_value;
}
-
NK_API int
nk_stricmp(const char *s1, const char *s2)
{
@@ -4815,7 +6569,6 @@ nk_stricmp(const char *s1, const char *s2)
} while (c1);
return 0;
}
-
NK_API int
nk_stricmpn(const char *s1, const char *s2, int n)
{
@@ -4841,7 +6594,6 @@ nk_stricmpn(const char *s1, const char *s2, int n)
} while (c1);
return 0;
}
-
NK_INTERN int
nk_str_match_here(const char *regexp, const char *text)
{
@@ -4855,7 +6607,6 @@ nk_str_match_here(const char *regexp, const char *text)
return nk_str_match_here(regexp+1, text+1);
return 0;
}
-
NK_INTERN int
nk_str_match_star(int c, const char *regexp, const char *text)
{
@@ -4865,7 +6616,6 @@ nk_str_match_star(int c, const char *regexp, const char *text)
} while (*text != '\0' && (*text++ == c || c == '.'));
return 0;
}
-
NK_API int
nk_strfilter(const char *text, const char *regexp)
{
@@ -4883,16 +6633,14 @@ nk_strfilter(const char *text, const char *regexp)
} while (*text++ != '\0');
return 0;
}
-
NK_API int
nk_strmatch_fuzzy_text(const char *str, int str_len,
const char *pattern, int *out_score)
{
/* Returns true if each character in pattern is found sequentially within str
- * if found then outScore is also set. Score value has no intrinsic meaning.
+ * if found then out_score is also set. Score value has no intrinsic meaning.
* Range varies with pattern. Can only compare scores with same search pattern. */
- /* ------- scores --------- */
/* bonus for adjacent matches */
#define NK_ADJACENCY_BONUS 5
/* bonus if match occurs after a separator */
@@ -5006,12 +6754,12 @@ nk_strmatch_fuzzy_text(const char *str, int str_len,
*out_score = score;
return nk_true;
}
-
NK_API int
nk_strmatch_fuzzy_string(char const *str, char const *pattern, int *out_score)
-{return nk_strmatch_fuzzy_text(str, nk_strlen(str), pattern, out_score);}
-
-NK_INTERN int
+{
+ return nk_strmatch_fuzzy_text(str, nk_strlen(str), pattern, out_score);
+}
+NK_LIB int
nk_string_float_limit(char *string, int prec)
{
int dot = 0;
@@ -5031,69 +6779,8 @@ nk_string_float_limit(char *string, int prec)
}
return (int)(c - string);
}
-
-NK_INTERN double
-nk_pow(double x, int n)
-{
- /* check the sign of n */
- double r = 1;
- int plus = n >= 0;
- n = (plus) ? n : -n;
- while (n > 0) {
- if ((n & 1) == 1)
- r *= x;
- n /= 2;
- x *= x;
- }
- return plus ? r : 1.0 / r;
-}
-
-NK_INTERN int
-nk_ifloord(double x)
-{
- x = (double)((int)x - ((x < 0.0) ? 1 : 0));
- return (int)x;
-}
-
-NK_INTERN int
-nk_ifloorf(float x)
-{
- x = (float)((int)x - ((x < 0.0f) ? 1 : 0));
- return (int)x;
-}
-
-NK_INTERN int
-nk_iceilf(float x)
-{
- if (x >= 0) {
- int i = (int)x;
- return i;
- } else {
- int t = (int)x;
- float r = x - (float)t;
- return (r > 0.0f) ? t+1: t;
- }
-}
-
-NK_INTERN int
-nk_log10(double n)
-{
- int neg;
- int ret;
- int exp = 0;
-
- neg = (n < 0) ? 1 : 0;
- ret = (neg) ? (int)-n : (int)n;
- while ((ret / 10) > 0) {
- ret /= 10;
- exp++;
- }
- if (neg) exp = -exp;
- return exp;
-}
-
-NK_INTERN void
-nk_strrev_ascii(char *s)
+NK_INTERN void
+nk_strrev_ascii(char *s)
{
int len = nk_strlen(s);
int end = len / 2;
@@ -5105,8 +6792,7 @@ nk_strrev_ascii(char *s)
s[len -1 - i] = t;
}
}
-
-NK_INTERN char*
+NK_LIB char*
nk_itoa(char *s, long n)
{
long i = 0;
@@ -5130,8 +6816,7 @@ nk_itoa(char *s, long n)
nk_strrev_ascii(s);
return s;
}
-
-NK_INTERN char*
+NK_LIB char*
nk_dtoa(char *s, double n)
{
int useExp = 0;
@@ -5209,10 +6894,9 @@ nk_dtoa(char *s, double n)
*(c) = '\0';
return s;
}
-
#ifdef NK_INCLUDE_STANDARD_VARARGS
#ifndef NK_INCLUDE_STANDARD_IO
-static int
+NK_INTERN int
nk_vsnprintf(char *buf, int buf_size, const char *fmt, va_list args)
{
enum nk_arg_type {
@@ -5531,8 +7215,7 @@ nk_vsnprintf(char *buf, int buf_size, const char *fmt, va_list args)
return result;
}
#endif
-
-NK_INTERN int
+NK_LIB int
nk_strfmt(char *buf, int buf_size, const char *fmt, va_list args)
{
int result = -1;
@@ -5549,29 +7232,34 @@ nk_strfmt(char *buf, int buf_size, const char *fmt, va_list args)
return result;
}
#endif
-
NK_API nk_hash
nk_murmur_hash(const void * key, int len, nk_hash seed)
{
/* 32-Bit MurmurHash3: https://code.google.com/p/smhasher/wiki/MurmurHash3*/
#define NK_ROTL(x,r) ((x) << (r) | ((x) >> (32 - r)))
- union {const nk_uint *i; const nk_byte *b;} conv = {0};
+
+ nk_uint h1 = seed;
+ nk_uint k1;
const nk_byte *data = (const nk_byte*)key;
+ const nk_byte *keyptr = data;
+ nk_byte *k1ptr;
+ const int bsize = sizeof(k1);
const int nblocks = len/4;
- nk_uint h1 = seed;
+
const nk_uint c1 = 0xcc9e2d51;
const nk_uint c2 = 0x1b873593;
const nk_byte *tail;
- const nk_uint *blocks;
- nk_uint k1;
int i;
/* body */
if (!key) return 0;
- conv.b = (data + nblocks*4);
- blocks = (const nk_uint*)conv.i;
- for (i = -nblocks; i; ++i) {
- k1 = blocks[i];
+ for (i = 0; i < nblocks; ++i, keyptr += bsize) {
+ k1ptr = (nk_byte*)&k1;
+ k1ptr[0] = keyptr[0];
+ k1ptr[1] = keyptr[1];
+ k1ptr[2] = keyptr[2];
+ k1ptr[3] = keyptr[3];
+
k1 *= c1;
k1 = NK_ROTL(k1,15);
k1 *= c2;
@@ -5585,14 +7273,15 @@ nk_murmur_hash(const void * key, int len, nk_hash seed)
tail = (const nk_byte*)(data + nblocks*4);
k1 = 0;
switch (len & 3) {
- case 3: k1 ^= (nk_uint)(tail[2] << 16);
- case 2: k1 ^= (nk_uint)(tail[1] << 8u);
- case 1: k1 ^= tail[0];
+ case 3: k1 ^= (nk_uint)(tail[2] << 16); /* fallthrough */
+ case 2: k1 ^= (nk_uint)(tail[1] << 8u); /* fallthrough */
+ case 1: k1 ^= tail[0];
k1 *= c1;
k1 = NK_ROTL(k1,15);
k1 *= c2;
h1 ^= k1;
- default: break;
+ break;
+ default: break;
}
/* finalization */
@@ -5607,9 +7296,8 @@ nk_murmur_hash(const void * key, int len, nk_hash seed)
#undef NK_ROTL
return h1;
}
-
#ifdef NK_INCLUDE_STANDARD_IO
-NK_INTERN char*
+NK_LIB char*
nk_file_load(const char* path, nk_size* siz, struct nk_allocator *alloc)
{
char *buf;
@@ -5638,19 +7326,129 @@ nk_file_load(const char* path, nk_size* siz, struct nk_allocator *alloc)
fclose(fd);
return 0;
}
- *siz = (nk_size)fread(buf, *siz, 1, fd);
+ *siz = (nk_size)fread(buf, 1,*siz, fd);
fclose(fd);
return buf;
}
#endif
+NK_LIB int
+nk_text_clamp(const struct nk_user_font *font, const char *text,
+ int text_len, float space, int *glyphs, float *text_width,
+ nk_rune *sep_list, int sep_count)
+{
+ int i = 0;
+ int glyph_len = 0;
+ float last_width = 0;
+ nk_rune unicode = 0;
+ float width = 0;
+ int len = 0;
+ int g = 0;
+ float s;
-/*
- * ==============================================================
+ int sep_len = 0;
+ int sep_g = 0;
+ float sep_width = 0;
+ sep_count = NK_MAX(sep_count,0);
+
+ glyph_len = nk_utf_decode(text, &unicode, text_len);
+ while (glyph_len && (width < space) && (len < text_len)) {
+ len += glyph_len;
+ s = font->width(font->userdata, font->height, text, len);
+ for (i = 0; i < sep_count; ++i) {
+ if (unicode != sep_list[i]) continue;
+ sep_width = last_width = width;
+ sep_g = g+1;
+ sep_len = len;
+ break;
+ }
+ if (i == sep_count){
+ last_width = sep_width = width;
+ sep_g = g+1;
+ }
+ width = s;
+ glyph_len = nk_utf_decode(&text[len], &unicode, text_len - len);
+ g++;
+ }
+ if (len >= text_len) {
+ *glyphs = g;
+ *text_width = last_width;
+ return len;
+ } else {
+ *glyphs = sep_g;
+ *text_width = sep_width;
+ return (!sep_len) ? len: sep_len;
+ }
+}
+NK_LIB struct nk_vec2
+nk_text_calculate_text_bounds(const struct nk_user_font *font,
+ const char *begin, int byte_len, float row_height, const char **remaining,
+ struct nk_vec2 *out_offset, int *glyphs, int op)
+{
+ float line_height = row_height;
+ struct nk_vec2 text_size = nk_vec2(0,0);
+ float line_width = 0.0f;
+
+ float glyph_width;
+ int glyph_len = 0;
+ nk_rune unicode = 0;
+ int text_len = 0;
+ if (!begin || byte_len <= 0 || !font)
+ return nk_vec2(0,row_height);
+
+ glyph_len = nk_utf_decode(begin, &unicode, byte_len);
+ if (!glyph_len) return text_size;
+ glyph_width = font->width(font->userdata, font->height, begin, glyph_len);
+
+ *glyphs = 0;
+ while ((text_len < byte_len) && glyph_len) {
+ if (unicode == '\n') {
+ text_size.x = NK_MAX(text_size.x, line_width);
+ text_size.y += line_height;
+ line_width = 0;
+ *glyphs+=1;
+ if (op == NK_STOP_ON_NEW_LINE)
+ break;
+
+ text_len++;
+ glyph_len = nk_utf_decode(begin + text_len, &unicode, byte_len-text_len);
+ continue;
+ }
+
+ if (unicode == '\r') {
+ text_len++;
+ *glyphs+=1;
+ glyph_len = nk_utf_decode(begin + text_len, &unicode, byte_len-text_len);
+ continue;
+ }
+
+ *glyphs = *glyphs + 1;
+ text_len += glyph_len;
+ line_width += (float)glyph_width;
+ glyph_len = nk_utf_decode(begin + text_len, &unicode, byte_len-text_len);
+ glyph_width = font->width(font->userdata, font->height, begin+text_len, glyph_len);
+ continue;
+ }
+
+ if (text_size.x < line_width)
+ text_size.x = line_width;
+ if (out_offset)
+ *out_offset = nk_vec2(line_width, text_size.y + line_height);
+ if (line_width > 0 || text_size.y == 0.0f)
+ text_size.y += line_height;
+ if (remaining)
+ *remaining = begin+text_len;
+ return text_size;
+}
+
+
+
+
+
+/* ==============================================================
*
* COLOR
*
- * ===============================================================
- */
+ * ===============================================================*/
NK_INTERN int
nk_parse_hex(const char *p, int length)
{
@@ -5667,7 +7465,6 @@ nk_parse_hex(const char *p, int length)
}
return i;
}
-
NK_API struct nk_color
nk_rgba(int r, int g, int b, int a)
{
@@ -5678,7 +7475,6 @@ nk_rgba(int r, int g, int b, int a)
ret.a = (nk_byte)NK_CLAMP(0, a, 255);
return ret;
}
-
NK_API struct nk_color
nk_rgb_hex(const char *rgb)
{
@@ -5691,7 +7487,6 @@ nk_rgb_hex(const char *rgb)
col.a = 255;
return col;
}
-
NK_API struct nk_color
nk_rgba_hex(const char *rgb)
{
@@ -5704,7 +7499,6 @@ nk_rgba_hex(const char *rgb)
col.a = (nk_byte)nk_parse_hex(c+6, 2);
return col;
}
-
NK_API void
nk_color_hex_rgba(char *output, struct nk_color col)
{
@@ -5720,7 +7514,6 @@ nk_color_hex_rgba(char *output, struct nk_color col)
output[8] = '\0';
#undef NK_TO_HEX
}
-
NK_API void
nk_color_hex_rgb(char *output, struct nk_color col)
{
@@ -5734,19 +7527,16 @@ nk_color_hex_rgb(char *output, struct nk_color col)
output[6] = '\0';
#undef NK_TO_HEX
}
-
NK_API struct nk_color
nk_rgba_iv(const int *c)
{
return nk_rgba(c[0], c[1], c[2], c[3]);
}
-
NK_API struct nk_color
nk_rgba_bv(const nk_byte *c)
{
return nk_rgba(c[0], c[1], c[2], c[3]);
}
-
NK_API struct nk_color
nk_rgb(int r, int g, int b)
{
@@ -5757,19 +7547,16 @@ nk_rgb(int r, int g, int b)
ret.a = (nk_byte)255;
return ret;
}
-
NK_API struct nk_color
nk_rgb_iv(const int *c)
{
return nk_rgb(c[0], c[1], c[2]);
}
-
NK_API struct nk_color
nk_rgb_bv(const nk_byte* c)
{
return nk_rgb(c[0], c[1], c[2]);
}
-
NK_API struct nk_color
nk_rgba_u32(nk_uint in)
{
@@ -5780,7 +7567,6 @@ nk_rgba_u32(nk_uint in)
ret.a = (nk_byte)((in >> 24) & 0xFF);
return ret;
}
-
NK_API struct nk_color
nk_rgba_f(float r, float g, float b, float a)
{
@@ -5791,13 +7577,16 @@ nk_rgba_f(float r, float g, float b, float a)
ret.a = (nk_byte)(NK_SATURATE(a) * 255.0f);
return ret;
}
-
NK_API struct nk_color
nk_rgba_fv(const float *c)
{
return nk_rgba_f(c[0], c[1], c[2], c[3]);
}
-
+NK_API struct nk_color
+nk_rgba_cf(struct nk_colorf c)
+{
+ return nk_rgba_f(c.r, c.g, c.b, c.a);
+}
NK_API struct nk_color
nk_rgb_f(float r, float g, float b)
{
@@ -5808,43 +7597,41 @@ nk_rgb_f(float r, float g, float b)
ret.a = 255;
return ret;
}
-
NK_API struct nk_color
nk_rgb_fv(const float *c)
{
return nk_rgb_f(c[0], c[1], c[2]);
}
-
+NK_API struct nk_color
+nk_rgb_cf(struct nk_colorf c)
+{
+ return nk_rgb_f(c.r, c.g, c.b);
+}
NK_API struct nk_color
nk_hsv(int h, int s, int v)
{
return nk_hsva(h, s, v, 255);
}
-
NK_API struct nk_color
nk_hsv_iv(const int *c)
{
return nk_hsv(c[0], c[1], c[2]);
}
-
NK_API struct nk_color
nk_hsv_bv(const nk_byte *c)
{
return nk_hsv(c[0], c[1], c[2]);
}
-
NK_API struct nk_color
nk_hsv_f(float h, float s, float v)
{
return nk_hsva_f(h, s, v, 1.0f);
}
-
NK_API struct nk_color
nk_hsv_fv(const float *c)
{
return nk_hsv_f(c[0], c[1], c[2]);
}
-
NK_API struct nk_color
nk_hsva(int h, int s, int v, int a)
{
@@ -5854,31 +7641,26 @@ nk_hsva(int h, int s, int v, int a)
float af = ((float)NK_CLAMP(0, a, 255)) / 255.0f;
return nk_hsva_f(hf, sf, vf, af);
}
-
NK_API struct nk_color
nk_hsva_iv(const int *c)
{
return nk_hsva(c[0], c[1], c[2], c[3]);
}
-
NK_API struct nk_color
nk_hsva_bv(const nk_byte *c)
{
return nk_hsva(c[0], c[1], c[2], c[3]);
}
-
-NK_API struct nk_color
-nk_hsva_f(float h, float s, float v, float a)
+NK_API struct nk_colorf
+nk_hsva_colorf(float h, float s, float v, float a)
{
- struct nk_colorf out = {0,0,0,0};
- float p, q, t, f;
int i;
-
+ float p, q, t, f;
+ struct nk_colorf out = {0,0,0,0};
if (s <= 0.0f) {
- out.r = v; out.g = v; out.b = v;
- return nk_rgb_f(out.r, out.g, out.b);
+ out.r = v; out.g = v; out.b = v; out.a = a;
+ return out;
}
-
h = h / (60.0f/360.0f);
i = (int)h;
f = h - (float)i;
@@ -5892,17 +7674,26 @@ nk_hsva_f(float h, float s, float v, float a)
case 2: out.r = p; out.g = v; out.b = t; break;
case 3: out.r = p; out.g = q; out.b = v; break;
case 4: out.r = t; out.g = p; out.b = v; break;
- case 5: out.r = v; out.g = p; out.b = q; break;
- }
- return nk_rgba_f(out.r, out.g, out.b, a);
+ case 5: out.r = v; out.g = p; out.b = q; break;}
+ out.a = a;
+ return out;
+}
+NK_API struct nk_colorf
+nk_hsva_colorfv(float *c)
+{
+ return nk_hsva_colorf(c[0], c[1], c[2], c[3]);
+}
+NK_API struct nk_color
+nk_hsva_f(float h, float s, float v, float a)
+{
+ struct nk_colorf c = nk_hsva_colorf(h, s, v, a);
+ return nk_rgba_f(c.r, c.g, c.b, c.a);
}
-
NK_API struct nk_color
nk_hsva_fv(const float *c)
{
return nk_hsva_f(c[0], c[1], c[2], c[3]);
}
-
NK_API nk_uint
nk_color_u32(struct nk_color in)
{
@@ -5912,7 +7703,6 @@ nk_color_u32(struct nk_color in)
out |= ((nk_uint)in.a << 24);
return out;
}
-
NK_API void
nk_color_f(float *r, float *g, float *b, float *a, struct nk_color in)
{
@@ -5922,13 +7712,18 @@ nk_color_f(float *r, float *g, float *b, float *a, struct nk_color in)
*b = (float)in.b * s;
*a = (float)in.a * s;
}
-
NK_API void
nk_color_fv(float *c, struct nk_color in)
{
nk_color_f(&c[0], &c[1], &c[2], &c[3], in);
}
-
+NK_API struct nk_colorf
+nk_color_cf(struct nk_color in)
+{
+ struct nk_colorf o;
+ nk_color_f(&o.r, &o.g, &o.b, &o.a, in);
+ return o;
+}
NK_API void
nk_color_d(double *r, double *g, double *b, double *a, struct nk_color in)
{
@@ -5938,57 +7733,62 @@ nk_color_d(double *r, double *g, double *b, double *a, struct nk_color in)
*b = (double)in.b * s;
*a = (double)in.a * s;
}
-
NK_API void
nk_color_dv(double *c, struct nk_color in)
{
nk_color_d(&c[0], &c[1], &c[2], &c[3], in);
}
-
NK_API void
nk_color_hsv_f(float *out_h, float *out_s, float *out_v, struct nk_color in)
{
float a;
nk_color_hsva_f(out_h, out_s, out_v, &a, in);
}
-
NK_API void
nk_color_hsv_fv(float *out, struct nk_color in)
{
float a;
nk_color_hsva_f(&out[0], &out[1], &out[2], &a, in);
}
-
NK_API void
-nk_color_hsva_f(float *out_h, float *out_s,
- float *out_v, float *out_a, struct nk_color in)
+nk_colorf_hsva_f(float *out_h, float *out_s,
+ float *out_v, float *out_a, struct nk_colorf in)
{
float chroma;
float K = 0.0f;
- float r,g,b,a;
-
- nk_color_f(&r,&g,&b,&a, in);
- if (g < b) {
- const float t = g; g = b; b = t;
+ if (in.g < in.b) {
+ const float t = in.g; in.g = in.b; in.b = t;
K = -1.f;
}
- if (r < g) {
- const float t = r; r = g; g = t;
+ if (in.r < in.g) {
+ const float t = in.r; in.r = in.g; in.g = t;
K = -2.f/6.0f - K;
}
- chroma = r - ((g < b) ? g: b);
- *out_h = NK_ABS(K + (g - b)/(6.0f * chroma + 1e-20f));
- *out_s = chroma / (r + 1e-20f);
- *out_v = r;
- *out_a = (float)in.a / 255.0f;
-}
+ chroma = in.r - ((in.g < in.b) ? in.g: in.b);
+ *out_h = NK_ABS(K + (in.g - in.b)/(6.0f * chroma + 1e-20f));
+ *out_s = chroma / (in.r + 1e-20f);
+ *out_v = in.r;
+ *out_a = in.a;
+}
+NK_API void
+nk_colorf_hsva_fv(float *hsva, struct nk_colorf in)
+{
+ nk_colorf_hsva_f(&hsva[0], &hsva[1], &hsva[2], &hsva[3], in);
+}
+NK_API void
+nk_color_hsva_f(float *out_h, float *out_s,
+ float *out_v, float *out_a, struct nk_color in)
+{
+ struct nk_colorf col;
+ nk_color_f(&col.r,&col.g,&col.b,&col.a, in);
+ nk_colorf_hsva_f(out_h, out_s, out_v, out_a, col);
+}
NK_API void
nk_color_hsva_fv(float *out, struct nk_color in)
{
nk_color_hsva_f(&out[0], &out[1], &out[2], &out[3], in);
}
-
NK_API void
nk_color_hsva_i(int *out_h, int *out_s, int *out_v,
int *out_a, struct nk_color in)
@@ -6000,13 +7800,11 @@ nk_color_hsva_i(int *out_h, int *out_s, int *out_v,
*out_v = (nk_byte)(v * 255.0f);
*out_a = (nk_byte)(a * 255.0f);
}
-
NK_API void
nk_color_hsva_iv(int *out, struct nk_color in)
{
nk_color_hsva_i(&out[0], &out[1], &out[2], &out[3], in);
}
-
NK_API void
nk_color_hsva_bv(nk_byte *out, struct nk_color in)
{
@@ -6017,7 +7815,6 @@ nk_color_hsva_bv(nk_byte *out, struct nk_color in)
out[2] = (nk_byte)tmp[2];
out[3] = (nk_byte)tmp[3];
}
-
NK_API void
nk_color_hsva_b(nk_byte *h, nk_byte *s, nk_byte *v, nk_byte *a, struct nk_color in)
{
@@ -6028,14 +7825,12 @@ nk_color_hsva_b(nk_byte *h, nk_byte *s, nk_byte *v, nk_byte *a, struct nk_color
*v = (nk_byte)tmp[2];
*a = (nk_byte)tmp[3];
}
-
NK_API void
nk_color_hsv_i(int *out_h, int *out_s, int *out_v, struct nk_color in)
{
int a;
nk_color_hsva_i(out_h, out_s, out_v, &a, in);
}
-
NK_API void
nk_color_hsv_b(nk_byte *out_h, nk_byte *out_s, nk_byte *out_v, struct nk_color in)
{
@@ -6045,13 +7840,11 @@ nk_color_hsv_b(nk_byte *out_h, nk_byte *out_s, nk_byte *out_v, struct nk_color i
*out_s = (nk_byte)tmp[1];
*out_v = (nk_byte)tmp[2];
}
-
NK_API void
nk_color_hsv_iv(int *out, struct nk_color in)
{
nk_color_hsv_i(&out[0], &out[1], &out[2], in);
}
-
NK_API void
nk_color_hsv_bv(nk_byte *out, struct nk_color in)
{
@@ -6061,407 +7854,127 @@ nk_color_hsv_bv(nk_byte *out, struct nk_color in)
out[1] = (nk_byte)tmp[1];
out[2] = (nk_byte)tmp[2];
}
-/*
- * ==============================================================
+
+
+
+
+
+/* ===============================================================
*
- * IMAGE
+ * UTF-8
*
- * ===============================================================
- */
-NK_API nk_handle
-nk_handle_ptr(void *ptr)
-{
- nk_handle handle = {0};
- handle.ptr = ptr;
- return handle;
-}
+ * ===============================================================*/
+NK_GLOBAL const nk_byte nk_utfbyte[NK_UTF_SIZE+1] = {0x80, 0, 0xC0, 0xE0, 0xF0};
+NK_GLOBAL const nk_byte nk_utfmask[NK_UTF_SIZE+1] = {0xC0, 0x80, 0xE0, 0xF0, 0xF8};
+NK_GLOBAL const nk_uint nk_utfmin[NK_UTF_SIZE+1] = {0, 0, 0x80, 0x800, 0x10000};
+NK_GLOBAL const nk_uint nk_utfmax[NK_UTF_SIZE+1] = {0x10FFFF, 0x7F, 0x7FF, 0xFFFF, 0x10FFFF};
-NK_API nk_handle
-nk_handle_id(int id)
+NK_INTERN int
+nk_utf_validate(nk_rune *u, int i)
{
- nk_handle handle;
- nk_zero_struct(handle);
- handle.id = id;
- return handle;
+ NK_ASSERT(u);
+ if (!u) return 0;
+ if (!NK_BETWEEN(*u, nk_utfmin[i], nk_utfmax[i]) ||
+ NK_BETWEEN(*u, 0xD800, 0xDFFF))
+ *u = NK_UTF_INVALID;
+ for (i = 1; *u > nk_utfmax[i]; ++i);
+ return i;
}
-
-NK_API struct nk_image
-nk_subimage_ptr(void *ptr, unsigned short w, unsigned short h, struct nk_rect r)
+NK_INTERN nk_rune
+nk_utf_decode_byte(char c, int *i)
{
- struct nk_image s;
- nk_zero(&s, sizeof(s));
- s.handle.ptr = ptr;
- s.w = w; s.h = h;
- s.region[0] = (unsigned short)r.x;
- s.region[1] = (unsigned short)r.y;
- s.region[2] = (unsigned short)r.w;
- s.region[3] = (unsigned short)r.h;
- return s;
+ NK_ASSERT(i);
+ if (!i) return 0;
+ for(*i = 0; *i < (int)NK_LEN(nk_utfmask); ++(*i)) {
+ if (((nk_byte)c & nk_utfmask[*i]) == nk_utfbyte[*i])
+ return (nk_byte)(c & ~nk_utfmask[*i]);
+ }
+ return 0;
}
-
-NK_API struct nk_image
-nk_subimage_id(int id, unsigned short w, unsigned short h, struct nk_rect r)
+NK_API int
+nk_utf_decode(const char *c, nk_rune *u, int clen)
{
- struct nk_image s;
- nk_zero(&s, sizeof(s));
- s.handle.id = id;
- s.w = w; s.h = h;
- s.region[0] = (unsigned short)r.x;
- s.region[1] = (unsigned short)r.y;
- s.region[2] = (unsigned short)r.w;
- s.region[3] = (unsigned short)r.h;
- return s;
-}
+ int i, j, len, type=0;
+ nk_rune udecoded;
-NK_API struct nk_image
-nk_subimage_handle(nk_handle handle, unsigned short w, unsigned short h,
- struct nk_rect r)
-{
- struct nk_image s;
- nk_zero(&s, sizeof(s));
- s.handle = handle;
- s.w = w; s.h = h;
- s.region[0] = (unsigned short)r.x;
- s.region[1] = (unsigned short)r.y;
- s.region[2] = (unsigned short)r.w;
- s.region[3] = (unsigned short)r.h;
- return s;
-}
+ NK_ASSERT(c);
+ NK_ASSERT(u);
-NK_API struct nk_image
-nk_image_handle(nk_handle handle)
-{
- struct nk_image s;
- nk_zero(&s, sizeof(s));
- s.handle = handle;
- s.w = 0; s.h = 0;
- s.region[0] = 0;
- s.region[1] = 0;
- s.region[2] = 0;
- s.region[3] = 0;
- return s;
-}
+ if (!c || !u) return 0;
+ if (!clen) return 0;
+ *u = NK_UTF_INVALID;
-NK_API struct nk_image
-nk_image_ptr(void *ptr)
-{
- struct nk_image s;
- nk_zero(&s, sizeof(s));
- NK_ASSERT(ptr);
- s.handle.ptr = ptr;
- s.w = 0; s.h = 0;
- s.region[0] = 0;
- s.region[1] = 0;
- s.region[2] = 0;
- s.region[3] = 0;
- return s;
-}
+ udecoded = nk_utf_decode_byte(c[0], &len);
+ if (!NK_BETWEEN(len, 1, NK_UTF_SIZE))
+ return 1;
-NK_API struct nk_image
-nk_image_id(int id)
+ for (i = 1, j = 1; i < clen && j < len; ++i, ++j) {
+ udecoded = (udecoded << 6) | nk_utf_decode_byte(c[i], &type);
+ if (type != 0)
+ return j;
+ }
+ if (j < len)
+ return 0;
+ *u = udecoded;
+ nk_utf_validate(u, len);
+ return len;
+}
+NK_INTERN char
+nk_utf_encode_byte(nk_rune u, int i)
{
- struct nk_image s;
- nk_zero(&s, sizeof(s));
- s.handle.id = id;
- s.w = 0; s.h = 0;
- s.region[0] = 0;
- s.region[1] = 0;
- s.region[2] = 0;
- s.region[3] = 0;
- return s;
+ return (char)((nk_utfbyte[i]) | ((nk_byte)u & ~nk_utfmask[i]));
}
-
NK_API int
-nk_image_is_subimage(const struct nk_image* img)
+nk_utf_encode(nk_rune u, char *c, int clen)
{
- NK_ASSERT(img);
- return !(img->w == 0 && img->h == 0);
-}
+ int len, i;
+ len = nk_utf_validate(&u, 0);
+ if (clen < len || !len || len > NK_UTF_SIZE)
+ return 0;
-NK_INTERN void
-nk_unify(struct nk_rect *clip, const struct nk_rect *a, float x0, float y0,
- float x1, float y1)
-{
- NK_ASSERT(a);
- NK_ASSERT(clip);
- clip->x = NK_MAX(a->x, x0);
- clip->y = NK_MAX(a->y, y0);
- clip->w = NK_MIN(a->x + a->w, x1) - clip->x;
- clip->h = NK_MIN(a->y + a->h, y1) - clip->y;
- clip->w = NK_MAX(0, clip->w);
- clip->h = NK_MAX(0, clip->h);
+ for (i = len - 1; i != 0; --i) {
+ c[i] = nk_utf_encode_byte(u, 0);
+ u >>= 6;
+ }
+ c[0] = nk_utf_encode_byte(u, len);
+ return len;
}
-
-NK_API void
-nk_triangle_from_direction(struct nk_vec2 *result, struct nk_rect r,
- float pad_x, float pad_y, enum nk_heading direction)
+NK_API int
+nk_utf_len(const char *str, int len)
{
- float w_half, h_half;
- NK_ASSERT(result);
-
- r.w = NK_MAX(2 * pad_x, r.w);
- r.h = NK_MAX(2 * pad_y, r.h);
- r.w = r.w - 2 * pad_x;
- r.h = r.h - 2 * pad_y;
-
- r.x = r.x + pad_x;
- r.y = r.y + pad_y;
+ const char *text;
+ int glyphs = 0;
+ int text_len;
+ int glyph_len;
+ int src_len = 0;
+ nk_rune unicode;
- w_half = r.w / 2.0f;
- h_half = r.h / 2.0f;
+ NK_ASSERT(str);
+ if (!str || !len) return 0;
- if (direction == NK_UP) {
- result[0] = nk_vec2(r.x + w_half, r.y);
- result[1] = nk_vec2(r.x + r.w, r.y + r.h);
- result[2] = nk_vec2(r.x, r.y + r.h);
- } else if (direction == NK_RIGHT) {
- result[0] = nk_vec2(r.x, r.y);
- result[1] = nk_vec2(r.x + r.w, r.y + h_half);
- result[2] = nk_vec2(r.x, r.y + r.h);
- } else if (direction == NK_DOWN) {
- result[0] = nk_vec2(r.x, r.y);
- result[1] = nk_vec2(r.x + r.w, r.y);
- result[2] = nk_vec2(r.x + w_half, r.y + r.h);
- } else {
- result[0] = nk_vec2(r.x, r.y + h_half);
- result[1] = nk_vec2(r.x + r.w, r.y);
- result[2] = nk_vec2(r.x + r.w, r.y + r.h);
+ text = str;
+ text_len = len;
+ glyph_len = nk_utf_decode(text, &unicode, text_len);
+ while (glyph_len && src_len < len) {
+ glyphs++;
+ src_len = src_len + glyph_len;
+ glyph_len = nk_utf_decode(text + src_len, &unicode, text_len - src_len);
}
+ return glyphs;
}
-
-NK_INTERN int
-nk_text_clamp(const struct nk_user_font *font, const char *text,
- int text_len, float space, int *glyphs, float *text_width,
- nk_rune *sep_list, int sep_count)
+NK_API const char*
+nk_utf_at(const char *buffer, int length, int index,
+ nk_rune *unicode, int *len)
{
int i = 0;
+ int src_len = 0;
int glyph_len = 0;
- float last_width = 0;
- nk_rune unicode = 0;
- float width = 0;
- int len = 0;
- int g = 0;
- float s;
+ const char *text;
+ int text_len;
- int sep_len = 0;
- int sep_g = 0;
- float sep_width = 0;
- sep_count = NK_MAX(sep_count,0);
-
- glyph_len = nk_utf_decode(text, &unicode, text_len);
- while (glyph_len && (width < space) && (len < text_len)) {
- len += glyph_len;
- s = font->width(font->userdata, font->height, text, len);
- for (i = 0; i < sep_count; ++i) {
- if (unicode != sep_list[i]) continue;
- sep_width = last_width = width;
- sep_g = g+1;
- sep_len = len;
- break;
- }
- if (i == sep_count){
- last_width = sep_width = width;
- sep_g = g+1;
- }
- width = s;
- glyph_len = nk_utf_decode(&text[len], &unicode, text_len - len);
- g++;
- }
- if (len >= text_len) {
- *glyphs = g;
- *text_width = last_width;
- return len;
- } else {
- *glyphs = sep_g;
- *text_width = sep_width;
- return (!sep_len) ? len: sep_len;
- }
-}
-
-enum {NK_DO_NOT_STOP_ON_NEW_LINE, NK_STOP_ON_NEW_LINE};
-NK_INTERN struct nk_vec2
-nk_text_calculate_text_bounds(const struct nk_user_font *font,
- const char *begin, int byte_len, float row_height, const char **remaining,
- struct nk_vec2 *out_offset, int *glyphs, int op)
-{
- float line_height = row_height;
- struct nk_vec2 text_size = nk_vec2(0,0);
- float line_width = 0.0f;
-
- float glyph_width;
- int glyph_len = 0;
- nk_rune unicode = 0;
- int text_len = 0;
- if (!begin || byte_len <= 0 || !font)
- return nk_vec2(0,row_height);
-
- glyph_len = nk_utf_decode(begin, &unicode, byte_len);
- if (!glyph_len) return text_size;
- glyph_width = font->width(font->userdata, font->height, begin, glyph_len);
-
- *glyphs = 0;
- while ((text_len < byte_len) && glyph_len) {
- if (unicode == '\n') {
- text_size.x = NK_MAX(text_size.x, line_width);
- text_size.y += line_height;
- line_width = 0;
- *glyphs+=1;
- if (op == NK_STOP_ON_NEW_LINE)
- break;
-
- text_len++;
- glyph_len = nk_utf_decode(begin + text_len, &unicode, byte_len-text_len);
- continue;
- }
-
- if (unicode == '\r') {
- text_len++;
- *glyphs+=1;
- glyph_len = nk_utf_decode(begin + text_len, &unicode, byte_len-text_len);
- continue;
- }
-
- *glyphs = *glyphs + 1;
- text_len += glyph_len;
- line_width += (float)glyph_width;
- glyph_len = nk_utf_decode(begin + text_len, &unicode, byte_len-text_len);
- glyph_width = font->width(font->userdata, font->height, begin+text_len, glyph_len);
- continue;
- }
-
- if (text_size.x < line_width)
- text_size.x = line_width;
- if (out_offset)
- *out_offset = nk_vec2(line_width, text_size.y + line_height);
- if (line_width > 0 || text_size.y == 0.0f)
- text_size.y += line_height;
- if (remaining)
- *remaining = begin+text_len;
- return text_size;
-}
-
-/* ==============================================================
- *
- * UTF-8
- *
- * ===============================================================*/
-NK_GLOBAL const nk_byte nk_utfbyte[NK_UTF_SIZE+1] = {0x80, 0, 0xC0, 0xE0, 0xF0};
-NK_GLOBAL const nk_byte nk_utfmask[NK_UTF_SIZE+1] = {0xC0, 0x80, 0xE0, 0xF0, 0xF8};
-NK_GLOBAL const nk_uint nk_utfmin[NK_UTF_SIZE+1] = {0, 0, 0x80, 0x800, 0x10000};
-NK_GLOBAL const nk_uint nk_utfmax[NK_UTF_SIZE+1] = {0x10FFFF, 0x7F, 0x7FF, 0xFFFF, 0x10FFFF};
-
-NK_INTERN int
-nk_utf_validate(nk_rune *u, int i)
-{
- NK_ASSERT(u);
- if (!u) return 0;
- if (!NK_BETWEEN(*u, nk_utfmin[i], nk_utfmax[i]) ||
- NK_BETWEEN(*u, 0xD800, 0xDFFF))
- *u = NK_UTF_INVALID;
- for (i = 1; *u > nk_utfmax[i]; ++i);
- return i;
-}
-
-NK_INTERN nk_rune
-nk_utf_decode_byte(char c, int *i)
-{
- NK_ASSERT(i);
- if (!i) return 0;
- for(*i = 0; *i < (int)NK_LEN(nk_utfmask); ++(*i)) {
- if (((nk_byte)c & nk_utfmask[*i]) == nk_utfbyte[*i])
- return (nk_byte)(c & ~nk_utfmask[*i]);
- }
- return 0;
-}
-
-NK_API int
-nk_utf_decode(const char *c, nk_rune *u, int clen)
-{
- int i, j, len, type=0;
- nk_rune udecoded;
-
- NK_ASSERT(c);
- NK_ASSERT(u);
-
- if (!c || !u) return 0;
- if (!clen) return 0;
- *u = NK_UTF_INVALID;
-
- udecoded = nk_utf_decode_byte(c[0], &len);
- if (!NK_BETWEEN(len, 1, NK_UTF_SIZE))
- return 1;
-
- for (i = 1, j = 1; i < clen && j < len; ++i, ++j) {
- udecoded = (udecoded << 6) | nk_utf_decode_byte(c[i], &type);
- if (type != 0)
- return j;
- }
- if (j < len)
- return 0;
- *u = udecoded;
- nk_utf_validate(u, len);
- return len;
-}
-
-NK_INTERN char
-nk_utf_encode_byte(nk_rune u, int i)
-{
- return (char)((nk_utfbyte[i]) | ((nk_byte)u & ~nk_utfmask[i]));
-}
-
-NK_API int
-nk_utf_encode(nk_rune u, char *c, int clen)
-{
- int len, i;
- len = nk_utf_validate(&u, 0);
- if (clen < len || !len || len > NK_UTF_SIZE)
- return 0;
-
- for (i = len - 1; i != 0; --i) {
- c[i] = nk_utf_encode_byte(u, 0);
- u >>= 6;
- }
- c[0] = nk_utf_encode_byte(u, len);
- return len;
-}
-
-NK_API int
-nk_utf_len(const char *str, int len)
-{
- const char *text;
- int glyphs = 0;
- int text_len;
- int glyph_len;
- int src_len = 0;
- nk_rune unicode;
-
- NK_ASSERT(str);
- if (!str || !len) return 0;
-
- text = str;
- text_len = len;
- glyph_len = nk_utf_decode(text, &unicode, text_len);
- while (glyph_len && src_len < len) {
- glyphs++;
- src_len = src_len + glyph_len;
- glyph_len = nk_utf_decode(text + src_len, &unicode, text_len - src_len);
- }
- return glyphs;
-}
-
-NK_API const char*
-nk_utf_at(const char *buffer, int length, int index,
- nk_rune *unicode, int *len)
-{
- int i = 0;
- int src_len = 0;
- int glyph_len = 0;
- const char *text;
- int text_len;
-
- NK_ASSERT(buffer);
- NK_ASSERT(unicode);
- NK_ASSERT(len);
+ NK_ASSERT(buffer);
+ NK_ASSERT(unicode);
+ NK_ASSERT(len);
if (!buffer || !unicode || !len) return 0;
if (index < 0) {
@@ -6487,17 +8000,29 @@ nk_utf_at(const char *buffer, int length, int index,
return buffer + src_len;
}
+
+
+
+
/* ==============================================================
*
* BUFFER
*
* ===============================================================*/
#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
-NK_INTERN void* nk_malloc(nk_handle unused, void *old,nk_size size)
-{NK_UNUSED(unused); NK_UNUSED(old); return malloc(size);}
-NK_INTERN void nk_mfree(nk_handle unused, void *ptr)
-{NK_UNUSED(unused); free(ptr);}
-
+NK_LIB void*
+nk_malloc(nk_handle unused, void *old,nk_size size)
+{
+ NK_UNUSED(unused);
+ NK_UNUSED(old);
+ return malloc(size);
+}
+NK_LIB void
+nk_mfree(nk_handle unused, void *ptr)
+{
+ NK_UNUSED(unused);
+ free(ptr);
+}
NK_API void
nk_buffer_init_default(struct nk_buffer *buffer)
{
@@ -6526,7 +8051,6 @@ nk_buffer_init(struct nk_buffer *b, const struct nk_allocator *a,
b->grow_factor = 2.0f;
b->pool = *a;
}
-
NK_API void
nk_buffer_init_fixed(struct nk_buffer *b, void *m, nk_size size)
{
@@ -6541,9 +8065,9 @@ nk_buffer_init_fixed(struct nk_buffer *b, void *m, nk_size size)
b->memory.size = size;
b->size = size;
}
-
-NK_INTERN void*
-nk_buffer_align(void *unaligned, nk_size align, nk_size *alignment,
+NK_LIB void*
+nk_buffer_align(void *unaligned,
+ nk_size align, nk_size *alignment,
enum nk_buffer_allocation_type type)
{
void *memory = 0;
@@ -6571,8 +8095,7 @@ nk_buffer_align(void *unaligned, nk_size align, nk_size *alignment,
}
return memory;
}
-
-NK_INTERN void*
+NK_LIB void*
nk_buffer_realloc(struct nk_buffer *b, nk_size capacity, nk_size *size)
{
void *temp;
@@ -6610,8 +8133,7 @@ nk_buffer_realloc(struct nk_buffer *b, nk_size capacity, nk_size *size)
}
return temp;
}
-
-NK_INTERN void*
+NK_LIB void*
nk_buffer_alloc(struct nk_buffer *b, enum nk_buffer_allocation_type type,
nk_size size, nk_size align)
{
@@ -6663,7 +8185,6 @@ nk_buffer_alloc(struct nk_buffer *b, enum nk_buffer_allocation_type type,
b->calls++;
return memory;
}
-
NK_API void
nk_buffer_push(struct nk_buffer *b, enum nk_buffer_allocation_type type,
const void *memory, nk_size size, nk_size align)
@@ -6672,7 +8193,6 @@ nk_buffer_push(struct nk_buffer *b, enum nk_buffer_allocation_type type,
if (!mem) return;
NK_MEMCPY(mem, memory, size);
}
-
NK_API void
nk_buffer_mark(struct nk_buffer *buffer, enum nk_buffer_allocation_type type)
{
@@ -6683,7 +8203,6 @@ nk_buffer_mark(struct nk_buffer *buffer, enum nk_buffer_allocation_type type)
buffer->marker[type].offset = buffer->size;
else buffer->marker[type].offset = buffer->allocated;
}
-
NK_API void
nk_buffer_reset(struct nk_buffer *buffer, enum nk_buffer_allocation_type type)
{
@@ -6705,7 +8224,6 @@ nk_buffer_reset(struct nk_buffer *buffer, enum nk_buffer_allocation_type type)
buffer->marker[type].active = nk_false;
}
}
-
NK_API void
nk_buffer_clear(struct nk_buffer *b)
{
@@ -6716,7 +8234,6 @@ nk_buffer_clear(struct nk_buffer *b)
b->calls = 0;
b->needed = 0;
}
-
NK_API void
nk_buffer_free(struct nk_buffer *b)
{
@@ -6727,7 +8244,6 @@ nk_buffer_free(struct nk_buffer *b)
NK_ASSERT(b->pool.free);
b->pool.free(b->pool.userdata, b->memory.ptr);
}
-
NK_API void
nk_buffer_info(struct nk_memory_status *s, struct nk_buffer *b)
{
@@ -6740,7 +8256,6 @@ nk_buffer_info(struct nk_memory_status *s, struct nk_buffer *b)
s->memory = b->memory.ptr;
s->calls = b->calls;
}
-
NK_API void*
nk_buffer_memory(struct nk_buffer *buffer)
{
@@ -6748,7 +8263,6 @@ nk_buffer_memory(struct nk_buffer *buffer)
if (!buffer) return 0;
return buffer->memory.ptr;
}
-
NK_API const void*
nk_buffer_memory_const(const struct nk_buffer *buffer)
{
@@ -6756,7 +8270,6 @@ nk_buffer_memory_const(const struct nk_buffer *buffer)
if (!buffer) return 0;
return buffer->memory.ptr;
}
-
NK_API nk_size
nk_buffer_total(struct nk_buffer *buffer)
{
@@ -6765,13 +8278,15 @@ nk_buffer_total(struct nk_buffer *buffer)
return buffer->memory.size;
}
-/*
- * ==============================================================
+
+
+
+
+/* ===============================================================
*
- * STRING
+ * STRING
*
- * ===============================================================
- */
+ * ===============================================================*/
#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
NK_API void
nk_str_init_default(struct nk_str *str)
@@ -6791,14 +8306,12 @@ nk_str_init(struct nk_str *str, const struct nk_allocator *alloc, nk_size size)
nk_buffer_init(&str->buffer, alloc, size);
str->len = 0;
}
-
NK_API void
nk_str_init_fixed(struct nk_str *str, void *memory, nk_size size)
{
nk_buffer_init_fixed(&str->buffer, memory, size);
str->len = 0;
}
-
NK_API int
nk_str_append_text_char(struct nk_str *s, const char *str, int len)
{
@@ -6812,13 +8325,11 @@ nk_str_append_text_char(struct nk_str *s, const char *str, int len)
s->len += nk_utf_len(str, len);
return len;
}
-
NK_API int
nk_str_append_str_char(struct nk_str *s, const char *str)
{
return nk_str_append_text_char(s, str, nk_strlen(str));
}
-
NK_API int
nk_str_append_text_utf8(struct nk_str *str, const char *text, int len)
{
@@ -6831,7 +8342,6 @@ nk_str_append_text_utf8(struct nk_str *str, const char *text, int len)
nk_str_append_text_char(str, text, byte_len);
return len;
}
-
NK_API int
nk_str_append_str_utf8(struct nk_str *str, const char *text)
{
@@ -6851,7 +8361,6 @@ nk_str_append_str_utf8(struct nk_str *str, const char *text)
nk_str_append_text_char(str, text, byte_len);
return runes;
}
-
NK_API int
nk_str_append_text_runes(struct nk_str *str, const nk_rune *text, int len)
{
@@ -6868,7 +8377,6 @@ nk_str_append_text_runes(struct nk_str *str, const nk_rune *text, int len)
}
return len;
}
-
NK_API int
nk_str_append_str_runes(struct nk_str *str, const nk_rune *runes)
{
@@ -6884,7 +8392,6 @@ nk_str_append_str_runes(struct nk_str *str, const nk_rune *runes)
}
return i;
}
-
NK_API int
nk_str_insert_at_char(struct nk_str *s, int pos, const char *str, int len)
{
@@ -6920,7 +8427,6 @@ nk_str_insert_at_char(struct nk_str *s, int pos, const char *str, int len)
s->len = nk_utf_len((char *)s->buffer.memory.ptr, (int)s->buffer.allocated);
return 1;
}
-
NK_API int
nk_str_insert_at_rune(struct nk_str *str, int pos, const char *cstr, int len)
{
@@ -6940,19 +8446,16 @@ nk_str_insert_at_rune(struct nk_str *str, int pos, const char *cstr, int len)
if (!begin) return 0;
return nk_str_insert_at_char(str, (int)(begin - buffer), cstr, len);
}
-
NK_API int
nk_str_insert_text_char(struct nk_str *str, int pos, const char *text, int len)
{
return nk_str_insert_text_utf8(str, pos, text, len);
}
-
NK_API int
nk_str_insert_str_char(struct nk_str *str, int pos, const char *text)
{
return nk_str_insert_text_utf8(str, pos, text, nk_strlen(text));
}
-
NK_API int
nk_str_insert_text_utf8(struct nk_str *str, int pos, const char *text, int len)
{
@@ -6968,7 +8471,6 @@ nk_str_insert_text_utf8(struct nk_str *str, int pos, const char *text, int len)
nk_str_insert_at_rune(str, pos, text, byte_len);
return len;
}
-
NK_API int
nk_str_insert_str_utf8(struct nk_str *str, int pos, const char *text)
{
@@ -6988,7 +8490,6 @@ nk_str_insert_str_utf8(struct nk_str *str, int pos, const char *text)
nk_str_insert_at_rune(str, pos, text, byte_len);
return runes;
}
-
NK_API int
nk_str_insert_text_runes(struct nk_str *str, int pos, const nk_rune *runes, int len)
{
@@ -7005,7 +8506,6 @@ nk_str_insert_text_runes(struct nk_str *str, int pos, const nk_rune *runes, int
}
return len;
}
-
NK_API int
nk_str_insert_str_runes(struct nk_str *str, int pos, const nk_rune *runes)
{
@@ -7021,7 +8521,6 @@ nk_str_insert_str_runes(struct nk_str *str, int pos, const nk_rune *runes)
}
return i;
}
-
NK_API void
nk_str_remove_chars(struct nk_str *s, int len)
{
@@ -7032,7 +8531,6 @@ nk_str_remove_chars(struct nk_str *s, int len)
s->buffer.allocated -= (nk_size)len;
s->len = nk_utf_len((char *)s->buffer.memory.ptr, (int)s->buffer.allocated);
}
-
NK_API void
nk_str_remove_runes(struct nk_str *str, int len)
{
@@ -7054,7 +8552,6 @@ nk_str_remove_runes(struct nk_str *str, int len)
end = (const char*)str->buffer.memory.ptr + str->buffer.allocated;
nk_str_remove_chars(str, (int)(end-begin)+1);
}
-
NK_API void
nk_str_delete_chars(struct nk_str *s, int pos, int len)
{
@@ -7072,7 +8569,6 @@ nk_str_delete_chars(struct nk_str *s, int pos, int len)
} else nk_str_remove_chars(s, len);
s->len = nk_utf_len((char *)s->buffer.memory.ptr, (int)s->buffer.allocated);
}
-
NK_API void
nk_str_delete_runes(struct nk_str *s, int pos, int len)
{
@@ -7097,7 +8593,6 @@ nk_str_delete_runes(struct nk_str *s, int pos, int len)
if (!end) return;
nk_str_delete_chars(s, (int)(begin - temp), (int)(end - begin));
}
-
NK_API char*
nk_str_at_char(struct nk_str *s, int pos)
{
@@ -7105,7 +8600,6 @@ nk_str_at_char(struct nk_str *s, int pos)
if (!s || pos > (int)s->buffer.allocated) return 0;
return nk_ptr_add(char, s->buffer.memory.ptr, pos);
}
-
NK_API char*
nk_str_at_rune(struct nk_str *str, int pos, nk_rune *unicode, int *len)
{
@@ -7142,7 +8636,6 @@ nk_str_at_rune(struct nk_str *str, int pos, nk_rune *unicode, int *len)
if (i != pos) return 0;
return text + src_len;
}
-
NK_API const char*
nk_str_at_char_const(const struct nk_str *s, int pos)
{
@@ -7150,7 +8643,6 @@ nk_str_at_char_const(const struct nk_str *s, int pos)
if (!s || pos > (int)s->buffer.allocated) return 0;
return nk_ptr_add(char, s->buffer.memory.ptr, pos);
}
-
NK_API const char*
nk_str_at_const(const struct nk_str *str, int pos, nk_rune *unicode, int *len)
{
@@ -7187,7 +8679,6 @@ nk_str_at_const(const struct nk_str *str, int pos, nk_rune *unicode, int *len)
if (i != pos) return 0;
return text + src_len;
}
-
NK_API nk_rune
nk_str_rune_at(const struct nk_str *str, int pos)
{
@@ -7196,7 +8687,6 @@ nk_str_rune_at(const struct nk_str *str, int pos)
nk_str_at_const(str, pos, &unicode, &len);
return unicode;
}
-
NK_API char*
nk_str_get(struct nk_str *s)
{
@@ -7204,7 +8694,6 @@ nk_str_get(struct nk_str *s)
if (!s || !s->len || !s->buffer.allocated) return 0;
return (char*)s->buffer.memory.ptr;
}
-
NK_API const char*
nk_str_get_const(const struct nk_str *s)
{
@@ -7212,7 +8701,6 @@ nk_str_get_const(const struct nk_str *s)
if (!s || !s->len || !s->buffer.allocated) return 0;
return (const char*)s->buffer.memory.ptr;
}
-
NK_API int
nk_str_len(struct nk_str *s)
{
@@ -7220,7 +8708,6 @@ nk_str_len(struct nk_str *s)
if (!s || !s->len || !s->buffer.allocated) return 0;
return s->len;
}
-
NK_API int
nk_str_len_char(struct nk_str *s)
{
@@ -7228,7 +8715,6 @@ nk_str_len_char(struct nk_str *s)
if (!s || !s->len || !s->buffer.allocated) return 0;
return (int)s->buffer.allocated;
}
-
NK_API void
nk_str_clear(struct nk_str *str)
{
@@ -7236,7 +8722,6 @@ nk_str_clear(struct nk_str *str)
nk_buffer_clear(&str->buffer);
str->len = 0;
}
-
NK_API void
nk_str_free(struct nk_str *str)
{
@@ -7245,42 +8730,42 @@ nk_str_free(struct nk_str *str)
str->len = 0;
}
-/*
- * ==============================================================
+
+
+
+
+/* ==============================================================
*
- * Command buffer
+ * DRAW
*
- * ===============================================================
-*/
-NK_INTERN void
-nk_command_buffer_init(struct nk_command_buffer *cmdbuf,
- struct nk_buffer *buffer, enum nk_command_clipping clip)
+ * ===============================================================*/
+NK_LIB void
+nk_command_buffer_init(struct nk_command_buffer *cb,
+ struct nk_buffer *b, enum nk_command_clipping clip)
{
- NK_ASSERT(cmdbuf);
- NK_ASSERT(buffer);
- if (!cmdbuf || !buffer) return;
- cmdbuf->base = buffer;
- cmdbuf->use_clipping = clip;
- cmdbuf->begin = buffer->allocated;
- cmdbuf->end = buffer->allocated;
- cmdbuf->last = buffer->allocated;
+ NK_ASSERT(cb);
+ NK_ASSERT(b);
+ if (!cb || !b) return;
+ cb->base = b;
+ cb->use_clipping = (int)clip;
+ cb->begin = b->allocated;
+ cb->end = b->allocated;
+ cb->last = b->allocated;
}
-
-NK_INTERN void
-nk_command_buffer_reset(struct nk_command_buffer *buffer)
+NK_LIB void
+nk_command_buffer_reset(struct nk_command_buffer *b)
{
- NK_ASSERT(buffer);
- if (!buffer) return;
- buffer->begin = 0;
- buffer->end = 0;
- buffer->last = 0;
- buffer->clip = nk_null_rect;
+ NK_ASSERT(b);
+ if (!b) return;
+ b->begin = 0;
+ b->end = 0;
+ b->last = 0;
+ b->clip = nk_null_rect;
#ifdef NK_INCLUDE_COMMAND_USERDATA
- buffer->userdata.ptr = 0;
+ b->userdata.ptr = 0;
#endif
}
-
-NK_INTERN void*
+NK_LIB void*
nk_command_buffer_push(struct nk_command_buffer* b,
enum nk_command_type t, nk_size size)
{
@@ -7313,7 +8798,6 @@ nk_command_buffer_push(struct nk_command_buffer* b,
b->end = cmd->next;
return cmd;
}
-
NK_API void
nk_push_scissor(struct nk_command_buffer *b, struct nk_rect r)
{
@@ -7334,7 +8818,6 @@ nk_push_scissor(struct nk_command_buffer *b, struct nk_rect r)
cmd->w = (unsigned short)NK_MAX(0, r.w);
cmd->h = (unsigned short)NK_MAX(0, r.h);
}
-
NK_API void
nk_stroke_line(struct nk_command_buffer *b, float x0, float y0,
float x1, float y1, float line_thickness, struct nk_color c)
@@ -7352,7 +8835,6 @@ nk_stroke_line(struct nk_command_buffer *b, float x0, float y0,
cmd->end.y = (short)y1;
cmd->color = c;
}
-
NK_API void
nk_stroke_curve(struct nk_command_buffer *b, float ax, float ay,
float ctrl0x, float ctrl0y, float ctrl1x, float ctrl1y,
@@ -7376,7 +8858,6 @@ nk_stroke_curve(struct nk_command_buffer *b, float ax, float ay,
cmd->end.y = (short)by;
cmd->color = col;
}
-
NK_API void
nk_stroke_rect(struct nk_command_buffer *b, struct nk_rect rect,
float rounding, float line_thickness, struct nk_color c)
@@ -7400,7 +8881,6 @@ nk_stroke_rect(struct nk_command_buffer *b, struct nk_rect rect,
cmd->h = (unsigned short)NK_MAX(0, rect.h);
cmd->color = c;
}
-
NK_API void
nk_fill_rect(struct nk_command_buffer *b, struct nk_rect rect,
float rounding, struct nk_color c)
@@ -7424,7 +8904,6 @@ nk_fill_rect(struct nk_command_buffer *b, struct nk_rect rect,
cmd->h = (unsigned short)NK_MAX(0, rect.h);
cmd->color = c;
}
-
NK_API void
nk_fill_rect_multi_color(struct nk_command_buffer *b, struct nk_rect rect,
struct nk_color left, struct nk_color top, struct nk_color right,
@@ -7451,7 +8930,6 @@ nk_fill_rect_multi_color(struct nk_command_buffer *b, struct nk_rect rect,
cmd->right = right;
cmd->bottom = bottom;
}
-
NK_API void
nk_stroke_circle(struct nk_command_buffer *b, struct nk_rect r,
float line_thickness, struct nk_color c)
@@ -7474,7 +8952,6 @@ nk_stroke_circle(struct nk_command_buffer *b, struct nk_rect r,
cmd->h = (unsigned short)NK_MAX(r.h, 0);
cmd->color = c;
}
-
NK_API void
nk_fill_circle(struct nk_command_buffer *b, struct nk_rect r, struct nk_color c)
{
@@ -7496,7 +8973,6 @@ nk_fill_circle(struct nk_command_buffer *b, struct nk_rect r, struct nk_color c)
cmd->h = (unsigned short)NK_MAX(r.h, 0);
cmd->color = c;
}
-
NK_API void
nk_stroke_arc(struct nk_command_buffer *b, float cx, float cy, float radius,
float a_min, float a_max, float line_thickness, struct nk_color c)
@@ -7514,7 +8990,6 @@ nk_stroke_arc(struct nk_command_buffer *b, float cx, float cy, float radius,
cmd->a[1] = a_max;
cmd->color = c;
}
-
NK_API void
nk_fill_arc(struct nk_command_buffer *b, float cx, float cy, float radius,
float a_min, float a_max, struct nk_color c)
@@ -7532,7 +9007,6 @@ nk_fill_arc(struct nk_command_buffer *b, float cx, float cy, float radius,
cmd->a[1] = a_max;
cmd->color = c;
}
-
NK_API void
nk_stroke_triangle(struct nk_command_buffer *b, float x0, float y0, float x1,
float y1, float x2, float y2, float line_thickness, struct nk_color c)
@@ -7560,7 +9034,6 @@ nk_stroke_triangle(struct nk_command_buffer *b, float x0, float y0, float x1,
cmd->c.y = (short)y2;
cmd->color = c;
}
-
NK_API void
nk_fill_triangle(struct nk_command_buffer *b, float x0, float y0, float x1,
float y1, float x2, float y2, struct nk_color c)
@@ -7588,7 +9061,6 @@ nk_fill_triangle(struct nk_command_buffer *b, float x0, float y0, float x1,
cmd->c.y = (short)y2;
cmd->color = c;
}
-
NK_API void
nk_stroke_polygon(struct nk_command_buffer *b, float *points, int point_count,
float line_thickness, struct nk_color col)
@@ -7610,7 +9082,6 @@ nk_stroke_polygon(struct nk_command_buffer *b, float *points, int point_count,
cmd->points[i].y = (short)points[i*2+1];
}
}
-
NK_API void
nk_fill_polygon(struct nk_command_buffer *b, float *points, int point_count,
struct nk_color col)
@@ -7632,7 +9103,6 @@ nk_fill_polygon(struct nk_command_buffer *b, float *points, int point_count,
cmd->points[i].y = (short)points[i*2+1];
}
}
-
NK_API void
nk_stroke_polyline(struct nk_command_buffer *b, float *points, int point_count,
float line_thickness, struct nk_color col)
@@ -7654,7 +9124,6 @@ nk_stroke_polyline(struct nk_command_buffer *b, float *points, int point_count,
cmd->points[i].y = (short)points[i*2+1];
}
}
-
NK_API void
nk_draw_image(struct nk_command_buffer *b, struct nk_rect r,
const struct nk_image *img, struct nk_color col)
@@ -7678,7 +9147,6 @@ nk_draw_image(struct nk_command_buffer *b, struct nk_rect r,
cmd->img = *img;
cmd->col = col;
}
-
NK_API void
nk_push_custom(struct nk_command_buffer *b, struct nk_rect r,
nk_command_custom_callback cb, nk_handle usr)
@@ -7702,7 +9170,6 @@ nk_push_custom(struct nk_command_buffer *b, struct nk_rect r,
cmd->callback_data = usr;
cmd->callback = cb;
}
-
NK_API void
nk_draw_text(struct nk_command_buffer *b, struct nk_rect r,
const char *string, int length, const struct nk_user_font *font,
@@ -7745,9 +9212,13 @@ nk_draw_text(struct nk_command_buffer *b, struct nk_rect r,
cmd->string[length] = '\0';
}
-/* ==============================================================
+
+
+
+
+/* ===============================================================
*
- * DRAW LIST
+ * VERTEX
*
* ===============================================================*/
#ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT
@@ -7764,7 +9235,6 @@ nk_draw_list_init(struct nk_draw_list *list)
list->circle_vtx[i].y = (float)NK_SIN(a);
}
}
-
NK_API void
nk_draw_list_setup(struct nk_draw_list *canvas, const struct nk_convert_config *config,
struct nk_buffer *cmds, struct nk_buffer *vertices, struct nk_buffer *elements,
@@ -7785,8 +9255,14 @@ nk_draw_list_setup(struct nk_draw_list *canvas, const struct nk_convert_config *
canvas->line_AA = line_aa;
canvas->shape_AA = shape_aa;
canvas->clip_rect = nk_null_rect;
-}
+ canvas->cmd_offset = 0;
+ canvas->element_count = 0;
+ canvas->vertex_count = 0;
+ canvas->cmd_offset = 0;
+ canvas->cmd_count = 0;
+ canvas->path_count = 0;
+}
NK_API const struct nk_draw_command*
nk__draw_list_begin(const struct nk_draw_list *canvas, const struct nk_buffer *buffer)
{
@@ -7803,7 +9279,6 @@ nk__draw_list_begin(const struct nk_draw_list *canvas, const struct nk_buffer *b
cmd = nk_ptr_add(const struct nk_draw_command, memory, offset);
return cmd;
}
-
NK_API const struct nk_draw_command*
nk__draw_list_end(const struct nk_draw_list *canvas, const struct nk_buffer *buffer)
{
@@ -7824,7 +9299,6 @@ nk__draw_list_end(const struct nk_draw_list *canvas, const struct nk_buffer *buf
end -= (canvas->cmd_count-1);
return end;
}
-
NK_API const struct nk_draw_command*
nk__draw_list_next(const struct nk_draw_command *cmd,
const struct nk_buffer *buffer, const struct nk_draw_list *canvas)
@@ -7839,29 +9313,6 @@ nk__draw_list_next(const struct nk_draw_command *cmd,
if (cmd <= end) return 0;
return (cmd-1);
}
-
-NK_API void
-nk_draw_list_clear(struct nk_draw_list *list)
-{
- NK_ASSERT(list);
- if (!list) return;
- if (list->buffer)
- nk_buffer_clear(list->buffer);
- if (list->vertices)
- nk_buffer_clear(list->vertices);
- if (list->elements)
- nk_buffer_clear(list->elements);
-
- list->element_count = 0;
- list->vertex_count = 0;
- list->cmd_offset = 0;
- list->cmd_count = 0;
- list->path_count = 0;
- list->vertices = 0;
- list->elements = 0;
- list->clip_rect = nk_null_rect;
-}
-
NK_INTERN struct nk_vec2*
nk_draw_list_alloc_path(struct nk_draw_list *list, int count)
{
@@ -7880,7 +9331,6 @@ nk_draw_list_alloc_path(struct nk_draw_list *list, int count)
list->path_count += (unsigned int)count;
return points;
}
-
NK_INTERN struct nk_vec2
nk_draw_list_path_last(struct nk_draw_list *list)
{
@@ -7892,7 +9342,6 @@ nk_draw_list_path_last(struct nk_draw_list *list)
point += (list->path_count-1);
return *point;
}
-
NK_INTERN struct nk_draw_command*
nk_draw_list_push_command(struct nk_draw_list *list, struct nk_rect clip,
nk_handle texture)
@@ -7924,7 +9373,6 @@ nk_draw_list_push_command(struct nk_draw_list *list, struct nk_rect clip,
list->clip_rect = clip;
return cmd;
}
-
NK_INTERN struct nk_draw_command*
nk_draw_list_command_last(struct nk_draw_list *list)
{
@@ -7938,7 +9386,6 @@ nk_draw_list_command_last(struct nk_draw_list *list)
cmd = nk_ptr_add(struct nk_draw_command, memory, size - list->cmd_offset);
return (cmd - (list->cmd_count-1));
}
-
NK_INTERN void
nk_draw_list_add_clip(struct nk_draw_list *list, struct nk_rect rect)
{
@@ -7953,7 +9400,6 @@ nk_draw_list_add_clip(struct nk_draw_list *list, struct nk_rect rect)
nk_draw_list_push_command(list, rect, prev->texture);
}
}
-
NK_INTERN void
nk_draw_list_push_image(struct nk_draw_list *list, nk_handle texture)
{
@@ -7963,13 +9409,18 @@ nk_draw_list_push_image(struct nk_draw_list *list, nk_handle texture)
nk_draw_list_push_command(list, nk_null_rect, texture);
} else {
struct nk_draw_command *prev = nk_draw_list_command_last(list);
- if (prev->elem_count == 0)
+ if (prev->elem_count == 0) {
prev->texture = texture;
- else if (prev->texture.id != texture.id)
- nk_draw_list_push_command(list, prev->clip_rect, texture);
+ #ifdef NK_INCLUDE_COMMAND_USERDATA
+ prev->userdata = list->userdata;
+ #endif
+ } else if (prev->texture.id != texture.id
+ #ifdef NK_INCLUDE_COMMAND_USERDATA
+ || prev->userdata.id != list->userdata.id
+ #endif
+ ) nk_draw_list_push_command(list, prev->clip_rect, texture);
}
}
-
#ifdef NK_INCLUDE_COMMAND_USERDATA
NK_API void
nk_draw_list_push_userdata(struct nk_draw_list *list, nk_handle userdata)
@@ -7977,7 +9428,6 @@ nk_draw_list_push_userdata(struct nk_draw_list *list, nk_handle userdata)
list->userdata = userdata;
}
#endif
-
NK_INTERN void*
nk_draw_list_alloc_vertices(struct nk_draw_list *list, nk_size count)
{
@@ -7988,9 +9438,20 @@ nk_draw_list_alloc_vertices(struct nk_draw_list *list, nk_size count)
list->config.vertex_size*count, list->config.vertex_alignment);
if (!vtx) return 0;
list->vertex_count += (unsigned int)count;
+
+ /* This assert triggers because your are drawing a lot of stuff and nuklear
+ * defined `nk_draw_index` as `nk_ushort` to safe space be default.
+ *
+ * So you reached the maximum number of indicies or rather vertexes.
+ * To solve this issue please change typdef `nk_draw_index` to `nk_uint`
+ * and don't forget to specify the new element size in your drawing
+ * backend (OpenGL, DirectX, ...). For example in OpenGL for `glDrawElements`
+ * instead of specifing `GL_UNSIGNED_SHORT` you have to define `GL_UNSIGNED_INT`.
+ * Sorry for the inconvenience. */
+ if(sizeof(nk_draw_index)==2) NK_ASSERT((list->vertex_count < NK_USHORT_MAX &&
+ "To many verticies for 16-bit vertex indicies. Please read comment above on how to solve this problem"));
return vtx;
}
-
NK_INTERN nk_draw_index*
nk_draw_list_alloc_elements(struct nk_draw_list *list, nk_size count)
{
@@ -8009,7 +9470,6 @@ nk_draw_list_alloc_elements(struct nk_draw_list *list, nk_size count)
cmd->elem_count += (unsigned int)count;
return ids;
}
-
NK_INTERN int
nk_draw_vertex_layout_element_is_end_of_layout(
const struct nk_draw_vertex_layout_element *element)
@@ -8017,78 +9477,81 @@ nk_draw_vertex_layout_element_is_end_of_layout(
return (element->attribute == NK_VERTEX_ATTRIBUTE_COUNT ||
element->format == NK_FORMAT_COUNT);
}
-
NK_INTERN void
-nk_draw_vertex_color(void *attribute, const float *values,
+nk_draw_vertex_color(void *attr, const float *vals,
enum nk_draw_vertex_layout_format format)
{
/* if this triggers you tried to provide a value format for a color */
+ float val[4];
NK_ASSERT(format >= NK_FORMAT_COLOR_BEGIN);
NK_ASSERT(format <= NK_FORMAT_COLOR_END);
if (format < NK_FORMAT_COLOR_BEGIN || format > NK_FORMAT_COLOR_END) return;
+ val[0] = NK_SATURATE(vals[0]);
+ val[1] = NK_SATURATE(vals[1]);
+ val[2] = NK_SATURATE(vals[2]);
+ val[3] = NK_SATURATE(vals[3]);
+
switch (format) {
default: NK_ASSERT(0 && "Invalid vertex layout color format"); break;
case NK_FORMAT_R8G8B8A8:
case NK_FORMAT_R8G8B8: {
- struct nk_color col = nk_rgba_fv(values);
- NK_MEMCPY(attribute, &col.r, sizeof(col));
+ struct nk_color col = nk_rgba_fv(val);
+ NK_MEMCPY(attr, &col.r, sizeof(col));
} break;
case NK_FORMAT_B8G8R8A8: {
- struct nk_color col = nk_rgba_fv(values);
+ struct nk_color col = nk_rgba_fv(val);
struct nk_color bgra = nk_rgba(col.b, col.g, col.r, col.a);
- NK_MEMCPY(attribute, &bgra, sizeof(bgra));
+ NK_MEMCPY(attr, &bgra, sizeof(bgra));
} break;
case NK_FORMAT_R16G15B16: {
nk_ushort col[3];
- col[0] = (nk_ushort)NK_CLAMP(NK_USHORT_MIN, values[0] * NK_USHORT_MAX, NK_USHORT_MAX);
- col[1] = (nk_ushort)NK_CLAMP(NK_USHORT_MIN, values[1] * NK_USHORT_MAX, NK_USHORT_MAX);
- col[2] = (nk_ushort)NK_CLAMP(NK_USHORT_MIN, values[2] * NK_USHORT_MAX, NK_USHORT_MAX);
- NK_MEMCPY(attribute, col, sizeof(col));
+ col[0] = (nk_ushort)(val[0]*(float)NK_USHORT_MAX);
+ col[1] = (nk_ushort)(val[1]*(float)NK_USHORT_MAX);
+ col[2] = (nk_ushort)(val[2]*(float)NK_USHORT_MAX);
+ NK_MEMCPY(attr, col, sizeof(col));
} break;
case NK_FORMAT_R16G15B16A16: {
nk_ushort col[4];
- col[0] = (nk_ushort)NK_CLAMP(NK_USHORT_MIN, values[0] * NK_USHORT_MAX, NK_USHORT_MAX);
- col[1] = (nk_ushort)NK_CLAMP(NK_USHORT_MIN, values[1] * NK_USHORT_MAX, NK_USHORT_MAX);
- col[2] = (nk_ushort)NK_CLAMP(NK_USHORT_MIN, values[2] * NK_USHORT_MAX, NK_USHORT_MAX);
- col[3] = (nk_ushort)NK_CLAMP(NK_USHORT_MIN, values[3] * NK_USHORT_MAX, NK_USHORT_MAX);
- NK_MEMCPY(attribute, col, sizeof(col));
+ col[0] = (nk_ushort)(val[0]*(float)NK_USHORT_MAX);
+ col[1] = (nk_ushort)(val[1]*(float)NK_USHORT_MAX);
+ col[2] = (nk_ushort)(val[2]*(float)NK_USHORT_MAX);
+ col[3] = (nk_ushort)(val[3]*(float)NK_USHORT_MAX);
+ NK_MEMCPY(attr, col, sizeof(col));
} break;
case NK_FORMAT_R32G32B32: {
nk_uint col[3];
- col[0] = (nk_uint)NK_CLAMP(NK_UINT_MIN, values[0] * NK_UINT_MAX, NK_UINT_MAX);
- col[1] = (nk_uint)NK_CLAMP(NK_UINT_MIN, values[1] * NK_UINT_MAX, NK_UINT_MAX);
- col[2] = (nk_uint)NK_CLAMP(NK_UINT_MIN, values[2] * NK_UINT_MAX, NK_UINT_MAX);
- NK_MEMCPY(attribute, col, sizeof(col));
+ col[0] = (nk_uint)(val[0]*(float)NK_UINT_MAX);
+ col[1] = (nk_uint)(val[1]*(float)NK_UINT_MAX);
+ col[2] = (nk_uint)(val[2]*(float)NK_UINT_MAX);
+ NK_MEMCPY(attr, col, sizeof(col));
} break;
case NK_FORMAT_R32G32B32A32: {
nk_uint col[4];
- col[0] = (nk_uint)NK_CLAMP(NK_UINT_MIN, values[0] * NK_UINT_MAX, NK_UINT_MAX);
- col[1] = (nk_uint)NK_CLAMP(NK_UINT_MIN, values[1] * NK_UINT_MAX, NK_UINT_MAX);
- col[2] = (nk_uint)NK_CLAMP(NK_UINT_MIN, values[2] * NK_UINT_MAX, NK_UINT_MAX);
- col[3] = (nk_uint)NK_CLAMP(NK_UINT_MIN, values[3] * NK_UINT_MAX, NK_UINT_MAX);
- NK_MEMCPY(attribute, col, sizeof(col));
+ col[0] = (nk_uint)(val[0]*(float)NK_UINT_MAX);
+ col[1] = (nk_uint)(val[1]*(float)NK_UINT_MAX);
+ col[2] = (nk_uint)(val[2]*(float)NK_UINT_MAX);
+ col[3] = (nk_uint)(val[3]*(float)NK_UINT_MAX);
+ NK_MEMCPY(attr, col, sizeof(col));
} break;
case NK_FORMAT_R32G32B32A32_FLOAT:
- NK_MEMCPY(attribute, values, sizeof(float)*4);
+ NK_MEMCPY(attr, val, sizeof(float)*4);
break;
case NK_FORMAT_R32G32B32A32_DOUBLE: {
double col[4];
- col[0] = (double)NK_SATURATE(values[0]);
- col[1] = (double)NK_SATURATE(values[1]);
- col[2] = (double)NK_SATURATE(values[2]);
- col[3] = (double)NK_SATURATE(values[3]);
- NK_MEMCPY(attribute, col, sizeof(col));
+ col[0] = (double)val[0];
+ col[1] = (double)val[1];
+ col[2] = (double)val[2];
+ col[3] = (double)val[3];
+ NK_MEMCPY(attr, col, sizeof(col));
} break;
case NK_FORMAT_RGB32:
case NK_FORMAT_RGBA32: {
- struct nk_color col = nk_rgba_fv(values);
+ struct nk_color col = nk_rgba_fv(val);
nk_uint color = nk_color_u32(col);
- NK_MEMCPY(attribute, &color, sizeof(color));
- } break;
- }
+ NK_MEMCPY(attr, &color, sizeof(color));
+ } break; }
}
-
NK_INTERN void
nk_draw_vertex_element(void *dst, const float *values, int value_count,
enum nk_draw_vertex_layout_format format)
@@ -8102,32 +9565,32 @@ nk_draw_vertex_element(void *dst, const float *values, int value_count,
switch (format) {
default: NK_ASSERT(0 && "invalid vertex layout format"); break;
case NK_FORMAT_SCHAR: {
- char value = (char)NK_CLAMP(NK_SCHAR_MIN, values[value_index], NK_SCHAR_MAX);
+ char value = (char)NK_CLAMP((float)NK_SCHAR_MIN, values[value_index], (float)NK_SCHAR_MAX);
NK_MEMCPY(attribute, &value, sizeof(value));
attribute = (void*)((char*)attribute + sizeof(char));
} break;
case NK_FORMAT_SSHORT: {
- nk_short value = (nk_short)NK_CLAMP(NK_SSHORT_MIN, values[value_index], NK_SSHORT_MAX);
+ nk_short value = (nk_short)NK_CLAMP((float)NK_SSHORT_MIN, values[value_index], (float)NK_SSHORT_MAX);
NK_MEMCPY(attribute, &value, sizeof(value));
attribute = (void*)((char*)attribute + sizeof(value));
} break;
case NK_FORMAT_SINT: {
- nk_int value = (nk_int)NK_CLAMP(NK_SINT_MIN, values[value_index], NK_SINT_MAX);
+ nk_int value = (nk_int)NK_CLAMP((float)NK_SINT_MIN, values[value_index], (float)NK_SINT_MAX);
NK_MEMCPY(attribute, &value, sizeof(value));
attribute = (void*)((char*)attribute + sizeof(nk_int));
} break;
case NK_FORMAT_UCHAR: {
- unsigned char value = (unsigned char)NK_CLAMP(NK_UCHAR_MIN, values[value_index], NK_UCHAR_MAX);
+ unsigned char value = (unsigned char)NK_CLAMP((float)NK_UCHAR_MIN, values[value_index], (float)NK_UCHAR_MAX);
NK_MEMCPY(attribute, &value, sizeof(value));
attribute = (void*)((char*)attribute + sizeof(unsigned char));
} break;
case NK_FORMAT_USHORT: {
- nk_ushort value = (nk_ushort)NK_CLAMP(NK_USHORT_MIN, values[value_index], NK_USHORT_MAX);
+ nk_ushort value = (nk_ushort)NK_CLAMP((float)NK_USHORT_MIN, values[value_index], (float)NK_USHORT_MAX);
NK_MEMCPY(attribute, &value, sizeof(value));
attribute = (void*)((char*)attribute + sizeof(value));
} break;
case NK_FORMAT_UINT: {
- nk_uint value = (nk_uint)NK_CLAMP(NK_UINT_MIN, values[value_index], NK_UINT_MAX);
+ nk_uint value = (nk_uint)NK_CLAMP((float)NK_UINT_MIN, values[value_index], (float)NK_UINT_MAX);
NK_MEMCPY(attribute, &value, sizeof(value));
attribute = (void*)((char*)attribute + sizeof(nk_uint));
} break;
@@ -8143,7 +9606,6 @@ nk_draw_vertex_element(void *dst, const float *values, int value_count,
}
}
}
-
NK_INTERN void*
nk_draw_vertex(void *dst, const struct nk_convert_config *config,
struct nk_vec2 pos, struct nk_vec2 uv, struct nk_colorf color)
@@ -8154,7 +9616,7 @@ nk_draw_vertex(void *dst, const struct nk_convert_config *config,
void *address = (void*)((char*)dst + elem_iter->offset);
switch (elem_iter->attribute) {
case NK_VERTEX_ATTRIBUTE_COUNT:
- default: NK_ASSERT(0 && "wrong element attribute");
+ default: NK_ASSERT(0 && "wrong element attribute"); break;
case NK_VERTEX_POSITION: nk_draw_vertex_element(address, &pos.x, 2, elem_iter->format); break;
case NK_VERTEX_TEXCOORD: nk_draw_vertex_element(address, &uv.x, 2, elem_iter->format); break;
case NK_VERTEX_COLOR: nk_draw_vertex_color(address, &color.r, elem_iter->format); break;
@@ -8163,7 +9625,6 @@ nk_draw_vertex(void *dst, const struct nk_convert_config *config,
}
return result;
}
-
NK_API void
nk_draw_list_stroke_poly_line(struct nk_draw_list *list, const struct nk_vec2 *points,
const unsigned int points_count, struct nk_color color, enum nk_draw_list_stroke closed,
@@ -8216,7 +9677,6 @@ nk_draw_list_stroke_poly_line(struct nk_draw_list *list, const struct nk_vec2 *p
nk_buffer_mark(list->vertices, NK_BUFFER_FRONT);
size = pnt_size * ((thick_line) ? 5 : 3) * points_count;
normals = (struct nk_vec2*) nk_buffer_alloc(list->vertices, NK_BUFFER_FRONT, size, pnt_align);
- NK_ASSERT(normals);
if (!normals) return;
temp = normals + points_count;
@@ -8405,7 +9865,6 @@ nk_draw_list_stroke_poly_line(struct nk_draw_list *list, const struct nk_vec2 *p
}
}
}
-
NK_API void
nk_draw_list_fill_poly_convex(struct nk_draw_list *list,
const struct nk_vec2 *points, const unsigned int points_count,
@@ -8454,7 +9913,6 @@ nk_draw_list_fill_poly_convex(struct nk_draw_list *list,
nk_buffer_mark(list->vertices, NK_BUFFER_FRONT);
size = pnt_size * points_count;
normals = (struct nk_vec2*) nk_buffer_alloc(list->vertices, NK_BUFFER_FRONT, size, pnt_align);
- NK_ASSERT(normals);
if (!normals) return;
vtx = (void*)((nk_byte*)list->vertices->memory.ptr + vertex_offset);
@@ -8531,7 +9989,6 @@ nk_draw_list_fill_poly_convex(struct nk_draw_list *list,
}
}
}
-
NK_API void
nk_draw_list_path_clear(struct nk_draw_list *list)
{
@@ -8541,7 +9998,6 @@ nk_draw_list_path_clear(struct nk_draw_list *list)
list->path_count = 0;
list->path_offset = 0;
}
-
NK_API void
nk_draw_list_path_line_to(struct nk_draw_list *list, struct nk_vec2 pos)
{
@@ -8560,7 +10016,6 @@ nk_draw_list_path_line_to(struct nk_draw_list *list, struct nk_vec2 pos)
if (!points) return;
points[0] = pos;
}
-
NK_API void
nk_draw_list_path_arc_to_fast(struct nk_draw_list *list, struct nk_vec2 center,
float radius, int a_min, int a_max)
@@ -8577,7 +10032,6 @@ nk_draw_list_path_arc_to_fast(struct nk_draw_list *list, struct nk_vec2 center,
}
}
}
-
NK_API void
nk_draw_list_path_arc_to(struct nk_draw_list *list, struct nk_vec2 center,
float radius, float a_min, float a_max, unsigned int segments)
@@ -8586,14 +10040,43 @@ nk_draw_list_path_arc_to(struct nk_draw_list *list, struct nk_vec2 center,
NK_ASSERT(list);
if (!list) return;
if (radius == 0.0f) return;
- for (i = 0; i <= segments; ++i) {
- const float a = a_min + ((float)i / ((float)segments) * (a_max - a_min));
- const float x = center.x + (float)NK_COS(a) * radius;
- const float y = center.y + (float)NK_SIN(a) * radius;
+
+ /* This algorithm for arc drawing relies on these two trigonometric identities[1]:
+ sin(a + b) = sin(a) * cos(b) + cos(a) * sin(b)
+ cos(a + b) = cos(a) * cos(b) - sin(a) * sin(b)
+
+ Two coordinates (x, y) of a point on a circle centered on
+ the origin can be written in polar form as:
+ x = r * cos(a)
+ y = r * sin(a)
+ where r is the radius of the circle,
+ a is the angle between (x, y) and the origin.
+
+ This allows us to rotate the coordinates around the
+ origin by an angle b using the following transformation:
+ x' = r * cos(a + b) = x * cos(b) - y * sin(b)
+ y' = r * sin(a + b) = y * cos(b) + x * sin(b)
+
+ [1] https://en.wikipedia.org/wiki/List_of_trigonometric_identities#Angle_sum_and_difference_identities
+ */
+ {const float d_angle = (a_max - a_min) / (float)segments;
+ const float sin_d = (float)NK_SIN(d_angle);
+ const float cos_d = (float)NK_COS(d_angle);
+
+ float cx = (float)NK_COS(a_min) * radius;
+ float cy = (float)NK_SIN(a_min) * radius;
+ for(i = 0; i <= segments; ++i) {
+ float new_cx, new_cy;
+ const float x = center.x + cx;
+ const float y = center.y + cy;
nk_draw_list_path_line_to(list, nk_vec2(x, y));
- }
-}
+ new_cx = cx * cos_d - cy * sin_d;
+ new_cy = cy * cos_d + cx * sin_d;
+ cx = new_cx;
+ cy = new_cy;
+ }}
+}
NK_API void
nk_draw_list_path_rect_to(struct nk_draw_list *list, struct nk_vec2 a,
struct nk_vec2 b, float rounding)
@@ -8617,7 +10100,6 @@ nk_draw_list_path_rect_to(struct nk_draw_list *list, struct nk_vec2 a,
nk_draw_list_path_arc_to_fast(list, nk_vec2(a.x + r, b.y - r), r, 3, 6);
}
}
-
NK_API void
nk_draw_list_path_curve_to(struct nk_draw_list *list, struct nk_vec2 p2,
struct nk_vec2 p3, struct nk_vec2 p4, unsigned int num_segments)
@@ -8645,7 +10127,6 @@ nk_draw_list_path_curve_to(struct nk_draw_list *list, struct nk_vec2 p2,
nk_draw_list_path_line_to(list, nk_vec2(x,y));
}
}
-
NK_API void
nk_draw_list_path_fill(struct nk_draw_list *list, struct nk_color color)
{
@@ -8656,7 +10137,6 @@ nk_draw_list_path_fill(struct nk_draw_list *list, struct nk_color color)
nk_draw_list_fill_poly_convex(list, points, list->path_count, color, list->config.shape_AA);
nk_draw_list_path_clear(list);
}
-
NK_API void
nk_draw_list_path_stroke(struct nk_draw_list *list, struct nk_color color,
enum nk_draw_list_stroke closed, float thickness)
@@ -8669,7 +10149,6 @@ nk_draw_list_path_stroke(struct nk_draw_list *list, struct nk_color color,
closed, thickness, list->config.line_AA);
nk_draw_list_path_clear(list);
}
-
NK_API void
nk_draw_list_stroke_line(struct nk_draw_list *list, struct nk_vec2 a,
struct nk_vec2 b, struct nk_color col, float thickness)
@@ -8685,7 +10164,6 @@ nk_draw_list_stroke_line(struct nk_draw_list *list, struct nk_vec2 a,
}
nk_draw_list_path_stroke(list, col, NK_STROKE_OPEN, thickness);
}
-
NK_API void
nk_draw_list_fill_rect(struct nk_draw_list *list, struct nk_rect rect,
struct nk_color col, float rounding)
@@ -8701,7 +10179,6 @@ nk_draw_list_fill_rect(struct nk_draw_list *list, struct nk_rect rect,
nk_vec2(rect.x + rect.w, rect.y + rect.h), rounding);
} nk_draw_list_path_fill(list, col);
}
-
NK_API void
nk_draw_list_stroke_rect(struct nk_draw_list *list, struct nk_rect rect,
struct nk_color col, float rounding, float thickness)
@@ -8716,7 +10193,6 @@ nk_draw_list_stroke_rect(struct nk_draw_list *list, struct nk_rect rect,
nk_vec2(rect.x + rect.w, rect.y + rect.h), rounding);
} nk_draw_list_path_stroke(list, col, NK_STROKE_CLOSED, thickness);
}
-
NK_API void
nk_draw_list_fill_rect_multi_color(struct nk_draw_list *list, struct nk_rect rect,
struct nk_color left, struct nk_color top, struct nk_color right,
@@ -8751,7 +10227,6 @@ nk_draw_list_fill_rect_multi_color(struct nk_draw_list *list, struct nk_rect rec
vtx = nk_draw_vertex(vtx, &list->config, nk_vec2(rect.x + rect.w, rect.y + rect.h), list->config.null.uv, col_right);
vtx = nk_draw_vertex(vtx, &list->config, nk_vec2(rect.x, rect.y + rect.h), list->config.null.uv, col_bottom);
}
-
NK_API void
nk_draw_list_fill_triangle(struct nk_draw_list *list, struct nk_vec2 a,
struct nk_vec2 b, struct nk_vec2 c, struct nk_color col)
@@ -8763,7 +10238,6 @@ nk_draw_list_fill_triangle(struct nk_draw_list *list, struct nk_vec2 a,
nk_draw_list_path_line_to(list, c);
nk_draw_list_path_fill(list, col);
}
-
NK_API void
nk_draw_list_stroke_triangle(struct nk_draw_list *list, struct nk_vec2 a,
struct nk_vec2 b, struct nk_vec2 c, struct nk_color col, float thickness)
@@ -8775,7 +10249,6 @@ nk_draw_list_stroke_triangle(struct nk_draw_list *list, struct nk_vec2 a,
nk_draw_list_path_line_to(list, c);
nk_draw_list_path_stroke(list, col, NK_STROKE_CLOSED, thickness);
}
-
NK_API void
nk_draw_list_fill_circle(struct nk_draw_list *list, struct nk_vec2 center,
float radius, struct nk_color col, unsigned int segs)
@@ -8787,7 +10260,6 @@ nk_draw_list_fill_circle(struct nk_draw_list *list, struct nk_vec2 center,
nk_draw_list_path_arc_to(list, center, radius, 0.0f, a_max, segs);
nk_draw_list_path_fill(list, col);
}
-
NK_API void
nk_draw_list_stroke_circle(struct nk_draw_list *list, struct nk_vec2 center,
float radius, struct nk_color col, unsigned int segs, float thickness)
@@ -8799,7 +10271,6 @@ nk_draw_list_stroke_circle(struct nk_draw_list *list, struct nk_vec2 center,
nk_draw_list_path_arc_to(list, center, radius, 0.0f, a_max, segs);
nk_draw_list_path_stroke(list, col, NK_STROKE_CLOSED, thickness);
}
-
NK_API void
nk_draw_list_stroke_curve(struct nk_draw_list *list, struct nk_vec2 p0,
struct nk_vec2 cp0, struct nk_vec2 cp1, struct nk_vec2 p1,
@@ -8811,7 +10282,6 @@ nk_draw_list_stroke_curve(struct nk_draw_list *list, struct nk_vec2 p0,
nk_draw_list_path_curve_to(list, cp0, cp1, p1, segments);
nk_draw_list_path_stroke(list, col, NK_STROKE_OPEN, thickness);
}
-
NK_INTERN void
nk_draw_list_push_rect_uv(struct nk_draw_list *list, struct nk_vec2 a,
struct nk_vec2 c, struct nk_vec2 uva, struct nk_vec2 uvc,
@@ -8849,7 +10319,6 @@ nk_draw_list_push_rect_uv(struct nk_draw_list *list, struct nk_vec2 a,
vtx = nk_draw_vertex(vtx, &list->config, c, uvc, col);
vtx = nk_draw_vertex(vtx, &list->config, d, uvd, col);
}
-
NK_API void
nk_draw_list_add_image(struct nk_draw_list *list, struct nk_image texture,
struct nk_rect rect, struct nk_color color)
@@ -8871,7 +10340,6 @@ nk_draw_list_add_image(struct nk_draw_list *list, struct nk_image texture,
nk_vec2(rect.x + rect.w, rect.y + rect.h),
nk_vec2(0.0f, 0.0f), nk_vec2(1.0f, 1.0f),color);
}
-
NK_API void
nk_draw_list_add_text(struct nk_draw_list *list, const struct nk_user_font *font,
struct nk_rect rect, const char *text, int len, float font_height,
@@ -8922,7 +10390,6 @@ nk_draw_list_add_text(struct nk_draw_list *list, const struct nk_user_font *font
unicode = next;
}
}
-
NK_API nk_flags
nk_convert(struct nk_context *ctx, struct nk_buffer *cmds,
struct nk_buffer *vertices, struct nk_buffer *elements,
@@ -9068,26 +10535,26 @@ nk_convert(struct nk_context *ctx, struct nk_buffer *cmds,
NK_API const struct nk_draw_command*
nk__draw_begin(const struct nk_context *ctx,
const struct nk_buffer *buffer)
-{return nk__draw_list_begin(&ctx->draw_list, buffer);}
-
+{
+ return nk__draw_list_begin(&ctx->draw_list, buffer);
+}
NK_API const struct nk_draw_command*
nk__draw_end(const struct nk_context *ctx, const struct nk_buffer *buffer)
-{return nk__draw_list_end(&ctx->draw_list, buffer);}
-
+{
+ return nk__draw_list_end(&ctx->draw_list, buffer);
+}
NK_API const struct nk_draw_command*
nk__draw_next(const struct nk_draw_command *cmd,
const struct nk_buffer *buffer, const struct nk_context *ctx)
-{return nk__draw_list_next(cmd, buffer, &ctx->draw_list);}
-
+{
+ return nk__draw_list_next(cmd, buffer, &ctx->draw_list);
+}
#endif
-/*
- * ==============================================================
- *
- * FONT HANDLING
- *
- * ===============================================================
- */
+
+
+
+
#ifdef NK_INCLUDE_FONT_BAKING
/* -------------------------------------------------------------
*
@@ -9159,7 +10626,6 @@ nk_rp_setup_allow_out_of_mem(struct nk_rp_context *context, int allow_out_of_mem
context->align = (context->width + context->num_nodes-1) / context->num_nodes;
}
}
-
NK_INTERN void
nk_rp_init_target(struct nk_rp_context *context, int width, int height,
struct nk_rp_node *nodes, int num_nodes)
@@ -9189,7 +10655,6 @@ nk_rp_init_target(struct nk_rp_context *context, int width, int height,
context->extra[1].y = 65535;
context->extra[1].next = 0;
}
-
/* find minimum y position if it starts at x1 */
NK_INTERN int
nk_rp__skyline_find_min_y(struct nk_rp_context *c, struct nk_rp_node *first,
@@ -9234,7 +10699,6 @@ nk_rp__skyline_find_min_y(struct nk_rp_context *c, struct nk_rp_node *first,
*pwaste = waste_area;
return min_y;
}
-
NK_INTERN struct nk_rp__findresult
nk_rp__skyline_find_best_pos(struct nk_rp_context *c, int width, int height)
{
@@ -9330,7 +10794,6 @@ nk_rp__skyline_find_best_pos(struct nk_rp_context *c, int width, int height)
fr.y = best_y;
return fr;
}
-
NK_INTERN struct nk_rp__findresult
nk_rp__skyline_pack_rectangle(struct nk_rp_context *context, int width, int height)
{
@@ -9383,7 +10846,6 @@ nk_rp__skyline_pack_rectangle(struct nk_rp_context *context, int width, int heig
cur->x = (nk_rp_coord) (res.x + width);
return res;
}
-
NK_INTERN int
nk_rect_height_compare(const void *a, const void *b)
{
@@ -9395,7 +10857,6 @@ nk_rect_height_compare(const void *a, const void *b)
return 1;
return (p->w > q->w) ? -1 : (p->w < q->w);
}
-
NK_INTERN int
nk_rect_original_order(const void *a, const void *b)
{
@@ -9403,7 +10864,6 @@ nk_rect_original_order(const void *a, const void *b)
const struct nk_rp_rect *q = (const struct nk_rp_rect *) b;
return (p->was_packed < q->was_packed) ? -1 : (p->was_packed > q->was_packed);
}
-
NK_INTERN void
nk_rp_qsort(struct nk_rp_rect *array, unsigned int len, int(*cmp)(const void*,const void*))
{
@@ -9433,7 +10893,6 @@ nk_rp_qsort(struct nk_rp_rect *array, unsigned int len, int(*cmp)(const void*,co
}
#undef NK_MAX_SORT_STACK
}
-
NK_INTERN void
nk_rp_pack_rects(struct nk_rp_context *context, struct nk_rp_rect *rects, int num_rects)
{
@@ -9656,7 +11115,6 @@ nk_tt__find_table(const nk_byte *data, nk_uint fontstart, const char *tag)
}
return 0;
}
-
NK_INTERN int
nk_tt_InitFont(struct nk_tt_fontinfo *info, const unsigned char *data2, int fontstart)
{
@@ -9713,7 +11171,6 @@ nk_tt_InitFont(struct nk_tt_fontinfo *info, const unsigned char *data2, int font
info->indexToLocFormat = nk_ttUSHORT(data+info->head + 50);
return 1;
}
-
NK_INTERN int
nk_tt_FindGlyphIndex(const struct nk_tt_fontinfo *info, int unicode_codepoint)
{
@@ -9807,7 +11264,6 @@ nk_tt_FindGlyphIndex(const struct nk_tt_fontinfo *info, int unicode_codepoint)
NK_ASSERT(0);
return 0;
}
-
NK_INTERN void
nk_tt_setvertex(struct nk_tt_vertex *v, nk_byte type, nk_int x, nk_int y, nk_int cx, nk_int cy)
{
@@ -9817,7 +11273,6 @@ nk_tt_setvertex(struct nk_tt_vertex *v, nk_byte type, nk_int x, nk_int y, nk_int
v->cx = (nk_short) cx;
v->cy = (nk_short) cy;
}
-
NK_INTERN int
nk_tt__GetGlyfOffset(const struct nk_tt_fontinfo *info, int glyph_index)
{
@@ -9834,7 +11289,6 @@ nk_tt__GetGlyfOffset(const struct nk_tt_fontinfo *info, int glyph_index)
}
return g1==g2 ? -1 : g1; /* if length is 0, return -1 */
}
-
NK_INTERN int
nk_tt_GetGlyphBox(const struct nk_tt_fontinfo *info, int glyph_index,
int *x0, int *y0, int *x1, int *y1)
@@ -9848,9 +11302,8 @@ nk_tt_GetGlyphBox(const struct nk_tt_fontinfo *info, int glyph_index,
if (y1) *y1 = nk_ttSHORT(info->data + g + 8);
return 1;
}
-
NK_INTERN int
-stbtt__close_shape(struct nk_tt_vertex *vertices, int num_vertices, int was_off,
+nk_tt__close_shape(struct nk_tt_vertex *vertices, int num_vertices, int was_off,
int start_off, nk_int sx, nk_int sy, nk_int scx, nk_int scy, nk_int cx, nk_int cy)
{
if (start_off) {
@@ -9865,7 +11318,6 @@ stbtt__close_shape(struct nk_tt_vertex *vertices, int num_vertices, int was_off,
}
return num_vertices;
}
-
NK_INTERN int
nk_tt_GetGlyphShape(const struct nk_tt_fontinfo *info, struct nk_allocator *alloc,
int glyph_index, struct nk_tt_vertex **pvertices)
@@ -9956,7 +11408,7 @@ nk_tt_GetGlyphShape(const struct nk_tt_fontinfo *info, struct nk_allocator *allo
if (next_move == i) {
if (i != 0)
- num_vertices = stbtt__close_shape(vertices, num_vertices, was_off, start_off, sx,sy,scx,scy,cx,cy);
+ num_vertices = nk_tt__close_shape(vertices, num_vertices, was_off, start_off, sx,sy,scx,scy,cx,cy);
/* now start the new one */
start_off = !(flags & 1);
@@ -9999,7 +11451,7 @@ nk_tt_GetGlyphShape(const struct nk_tt_fontinfo *info, struct nk_allocator *allo
}
}
}
- num_vertices = stbtt__close_shape(vertices, num_vertices, was_off, start_off, sx,sy,scx,scy,cx,cy);
+ num_vertices = nk_tt__close_shape(vertices, num_vertices, was_off, start_off, sx,sy,scx,scy,cx,cy);
} else if (numberOfContours == -1) {
/* Compound shapes. */
int more = 1;
@@ -10089,7 +11541,6 @@ nk_tt_GetGlyphShape(const struct nk_tt_fontinfo *info, struct nk_allocator *allo
*pvertices = vertices;
return num_vertices;
}
-
NK_INTERN void
nk_tt_GetGlyphHMetrics(const struct nk_tt_fontinfo *info, int glyph_index,
int *advanceWidth, int *leftSideBearing)
@@ -10107,7 +11558,6 @@ nk_tt_GetGlyphHMetrics(const struct nk_tt_fontinfo *info, int glyph_index,
*leftSideBearing = nk_ttSHORT(info->data + info->hmtx + 4*numOfLongHorMetrics + 2*(glyph_index - numOfLongHorMetrics));
}
}
-
NK_INTERN void
nk_tt_GetFontVMetrics(const struct nk_tt_fontinfo *info,
int *ascent, int *descent, int *lineGap)
@@ -10116,14 +11566,12 @@ nk_tt_GetFontVMetrics(const struct nk_tt_fontinfo *info,
if (descent) *descent = nk_ttSHORT(info->data+info->hhea + 6);
if (lineGap) *lineGap = nk_ttSHORT(info->data+info->hhea + 8);
}
-
NK_INTERN float
nk_tt_ScaleForPixelHeight(const struct nk_tt_fontinfo *info, float height)
{
int fheight = nk_ttSHORT(info->data + info->hhea + 4) - nk_ttSHORT(info->data + info->hhea + 6);
return (float) height / (float)fheight;
}
-
NK_INTERN float
nk_tt_ScaleForMappingEmToPixels(const struct nk_tt_fontinfo *info, float pixels)
{
@@ -10154,7 +11602,6 @@ nk_tt_GetGlyphBitmapBoxSubpixel(const struct nk_tt_fontinfo *font,
if (iy1) *iy1 = nk_iceilf ((float)-y0 * scale_y + shift_y);
}
}
-
NK_INTERN void
nk_tt_GetGlyphBitmapBox(const struct nk_tt_fontinfo *font, int glyph,
float scale_x, float scale_y, int *ix0, int *iy0, int *ix1, int *iy1)
@@ -10187,14 +11634,12 @@ nk_tt__hheap_alloc(struct nk_tt__hheap *hh, nk_size size)
return (char *) (hh->head) + size * (nk_size)hh->num_remaining_in_head_chunk;
}
}
-
NK_INTERN void
nk_tt__hheap_free(struct nk_tt__hheap *hh, void *p)
{
*(void **) p = hh->first_free;
hh->first_free = p;
}
-
NK_INTERN void
nk_tt__hheap_cleanup(struct nk_tt__hheap *hh)
{
@@ -10205,7 +11650,6 @@ nk_tt__hheap_cleanup(struct nk_tt__hheap *hh)
c = n;
}
}
-
NK_INTERN struct nk_tt__active_edge*
nk_tt__new_active(struct nk_tt__hheap *hh, struct nk_tt__edge *e,
int off_x, float start_point)
@@ -10225,7 +11669,6 @@ nk_tt__new_active(struct nk_tt__hheap *hh, struct nk_tt__edge *e,
z->next = 0;
return z;
}
-
NK_INTERN void
nk_tt__handle_clipped_edge(float *scanline, int x, struct nk_tt__active_edge *e,
float x0, float y0, float x1, float y1)
@@ -10259,7 +11702,6 @@ nk_tt__handle_clipped_edge(float *scanline, int x, struct nk_tt__active_edge *e,
scanline[x] += (float)e->direction * (float)(y1-y0) * (1.0f-((x0-(float)x)+(x1-(float)x))/2.0f);
}
}
-
NK_INTERN void
nk_tt__fill_active_edges_new(float *scanline, float *scanline_fill, int len,
struct nk_tt__active_edge *e, float y_top)
@@ -10420,12 +11862,11 @@ nk_tt__fill_active_edges_new(float *scanline, float *scanline_fill, int len,
e = e->next;
}
}
-
-/* directly AA rasterize edges w/o supersampling */
NK_INTERN void
nk_tt__rasterize_sorted_edges(struct nk_tt__bitmap *result, struct nk_tt__edge *e,
int n, int vsubsample, int off_x, int off_y, struct nk_allocator *alloc)
{
+ /* directly AA rasterize edges w/o supersampling */
struct nk_tt__hheap hh;
struct nk_tt__active_edge *active = 0;
int y,j=0, i;
@@ -10512,12 +11953,11 @@ nk_tt__rasterize_sorted_edges(struct nk_tt__bitmap *result, struct nk_tt__edge *
if (scanline != scanline_data)
alloc->free(alloc->userdata, scanline);
}
-
-#define NK_TT__COMPARE(a,b) ((a)->y0 < (b)->y0)
NK_INTERN void
nk_tt__sort_edges_ins_sort(struct nk_tt__edge *p, int n)
{
int i,j;
+ #define NK_TT__COMPARE(a,b) ((a)->y0 < (b)->y0)
for (i=1; i < n; ++i) {
struct nk_tt__edge t = p[i], *a = &t;
j = i;
@@ -10532,7 +11972,6 @@ nk_tt__sort_edges_ins_sort(struct nk_tt__edge *p, int n)
p[j] = t;
}
}
-
NK_INTERN void
nk_tt__sort_edges_quicksort(struct nk_tt__edge *p, int n)
{
@@ -10600,14 +12039,12 @@ nk_tt__sort_edges_quicksort(struct nk_tt__edge *p, int n)
}
}
}
-
NK_INTERN void
nk_tt__sort_edges(struct nk_tt__edge *p, int n)
{
nk_tt__sort_edges_quicksort(p, n);
nk_tt__sort_edges_ins_sort(p, n);
}
-
NK_INTERN void
nk_tt__rasterize(struct nk_tt__bitmap *result, struct nk_tt__point *pts,
int *wcount, int windings, float scale_x, float scale_y,
@@ -10657,13 +12094,12 @@ nk_tt__rasterize(struct nk_tt__bitmap *result, struct nk_tt__point *pts,
}
/* now sort the edges by their highest point (should snap to integer, and then by x) */
- /*STBTT_sort(e, n, sizeof(e[0]), stbtt__edge_compare); */
+ /*STBTT_sort(e, n, sizeof(e[0]), nk_tt__edge_compare); */
nk_tt__sort_edges(e, n);
/* now, traverse the scanlines and find the intersections on each scanline, use xor winding rule */
nk_tt__rasterize_sorted_edges(result, e, n, vsubsample, off_x, off_y, alloc);
alloc->free(alloc->userdata, e);
}
-
NK_INTERN void
nk_tt__add_point(struct nk_tt__point *points, int n, float x, float y)
{
@@ -10671,7 +12107,6 @@ nk_tt__add_point(struct nk_tt__point *points, int n, float x, float y)
points[n].x = x;
points[n].y = y;
}
-
NK_INTERN int
nk_tt__tesselate_curve(struct nk_tt__point *points, int *num_points,
float x0, float y0, float x1, float y1, float x2, float y2,
@@ -10700,13 +12135,12 @@ nk_tt__tesselate_curve(struct nk_tt__point *points, int *num_points,
}
return 1;
}
-
-/* returns number of contours */
NK_INTERN struct nk_tt__point*
nk_tt_FlattenCurves(struct nk_tt_vertex *vertices, int num_verts,
float objspace_flatness, int **contour_lengths, int *num_contours,
struct nk_allocator *alloc)
{
+ /* returns number of contours */
struct nk_tt__point *points=0;
int num_points=0;
float objspace_flatness_squared = objspace_flatness * objspace_flatness;
@@ -10779,7 +12213,6 @@ nk_tt_FlattenCurves(struct nk_tt_vertex *vertices, int num_verts,
*num_contours = 0;
return 0;
}
-
NK_INTERN void
nk_tt_Rasterize(struct nk_tt__bitmap *result, float flatness_in_pixels,
struct nk_tt_vertex *vertices, int num_verts,
@@ -10799,7 +12232,6 @@ nk_tt_Rasterize(struct nk_tt__bitmap *result, float flatness_in_pixels,
alloc->free(alloc->userdata, windings);
}
}
-
NK_INTERN void
nk_tt_MakeGlyphBitmapSubpixel(const struct nk_tt_fontinfo *info, unsigned char *output,
int out_w, int out_h, int out_stride, float scale_x, float scale_y,
@@ -10857,14 +12289,12 @@ nk_tt_PackBegin(struct nk_tt_pack_context *spc, unsigned char *pixels,
NK_MEMSET(pixels, 0, (nk_size)(pw*ph)); /* background of 0 around pixels */
return 1;
}
-
NK_INTERN void
nk_tt_PackEnd(struct nk_tt_pack_context *spc, struct nk_allocator *alloc)
{
alloc->free(alloc->userdata, spc->nodes);
alloc->free(alloc->userdata, spc->pack_info);
}
-
NK_INTERN void
nk_tt_PackSetOversampling(struct nk_tt_pack_context *spc,
unsigned int h_oversample, unsigned int v_oversample)
@@ -10876,7 +12306,6 @@ nk_tt_PackSetOversampling(struct nk_tt_pack_context *spc,
if (v_oversample <= NK_TT_MAX_OVERSAMPLE)
spc->v_oversample = v_oversample;
}
-
NK_INTERN void
nk_tt__h_prefilter(unsigned char *pixels, int w, int h, int stride_in_bytes,
int kernel_width)
@@ -10940,7 +12369,6 @@ nk_tt__h_prefilter(unsigned char *pixels, int w, int h, int stride_in_bytes,
pixels += stride_in_bytes;
}
}
-
NK_INTERN void
nk_tt__v_prefilter(unsigned char *pixels, int w, int h, int stride_in_bytes,
int kernel_width)
@@ -11004,7 +12432,6 @@ nk_tt__v_prefilter(unsigned char *pixels, int w, int h, int stride_in_bytes,
pixels += 1;
}
}
-
NK_INTERN float
nk_tt__oversample_shift(int oversample)
{
@@ -11017,13 +12444,12 @@ nk_tt__oversample_shift(int oversample)
/* direction to counter this. */
return (float)-(oversample - 1) / (2.0f * (float)oversample);
}
-
-/* rects array must be big enough to accommodate all characters in the given ranges */
NK_INTERN int
nk_tt_PackFontRangesGatherRects(struct nk_tt_pack_context *spc,
struct nk_tt_fontinfo *info, struct nk_tt_pack_range *ranges,
int num_ranges, struct nk_rp_rect *rects)
{
+ /* rects array must be big enough to accommodate all characters in the given ranges */
int i,j,k;
k = 0;
@@ -11049,7 +12475,6 @@ nk_tt_PackFontRangesGatherRects(struct nk_tt_pack_context *spc,
}
return k;
}
-
NK_INTERN int
nk_tt_PackFontRangesRenderIntoRects(struct nk_tt_pack_context *spc,
struct nk_tt_fontinfo *info, struct nk_tt_pack_range *ranges,
@@ -11133,7 +12558,6 @@ nk_tt_PackFontRangesRenderIntoRects(struct nk_tt_pack_context *spc,
spc->v_oversample = (unsigned int)old_v_over;
return return_value;
}
-
NK_INTERN void
nk_tt_GetPackedQuad(struct nk_tt_packedchar *chardata, int pw, int ph,
int char_index, float *xpos, float *ypos, struct nk_tt_aligned_quad *q,
@@ -11201,7 +12625,6 @@ nk_range_count(const nk_rune *range)
while (*(iter++) != 0);
return (iter == range) ? 0 : (int)((iter - range)/2);
}
-
NK_INTERN int
nk_range_glyph_count(const nk_rune *range, int count)
{
@@ -11217,14 +12640,12 @@ nk_range_glyph_count(const nk_rune *range, int count)
}
return total_glyphs;
}
-
NK_API const nk_rune*
nk_font_default_glyph_ranges(void)
{
NK_STORAGE const nk_rune ranges[] = {0x0020, 0x00FF, 0};
return ranges;
}
-
NK_API const nk_rune*
nk_font_chinese_glyph_ranges(void)
{
@@ -11238,7 +12659,6 @@ nk_font_chinese_glyph_ranges(void)
};
return ranges;
}
-
NK_API const nk_rune*
nk_font_cyrillic_glyph_ranges(void)
{
@@ -11251,7 +12671,6 @@ nk_font_cyrillic_glyph_ranges(void)
};
return ranges;
}
-
NK_API const nk_rune*
nk_font_korean_glyph_ranges(void)
{
@@ -11263,14 +12682,13 @@ nk_font_korean_glyph_ranges(void)
};
return ranges;
}
-
NK_INTERN void
nk_font_baker_memory(nk_size *temp, int *glyph_count,
struct nk_font_config *config_list, int count)
{
int range_count = 0;
int total_range_count = 0;
- struct nk_font_config *iter;
+ struct nk_font_config *iter, *i;
NK_ASSERT(config_list);
NK_ASSERT(glyph_count);
@@ -11279,16 +12697,15 @@ nk_font_baker_memory(nk_size *temp, int *glyph_count,
*glyph_count = 0;
return;
}
-
*glyph_count = 0;
- if (!config_list->range)
- config_list->range = nk_font_default_glyph_ranges();
for (iter = config_list; iter; iter = iter->next) {
- range_count = nk_range_count(iter->range);
- total_range_count += range_count;
- *glyph_count += nk_range_glyph_count(iter->range, range_count);
+ i = iter;
+ do {if (!i->range) iter->range = nk_font_default_glyph_ranges();
+ range_count = nk_range_count(i->range);
+ total_range_count += range_count;
+ *glyph_count += nk_range_glyph_count(i->range, range_count);
+ } while ((i = i->n) != iter);
}
-
*temp = (nk_size)*glyph_count * sizeof(struct nk_rp_rect);
*temp += (nk_size)total_range_count * sizeof(struct nk_tt_pack_range);
*temp += (nk_size)*glyph_count * sizeof(struct nk_tt_packedchar);
@@ -11297,7 +12714,6 @@ nk_font_baker_memory(nk_size *temp, int *glyph_count,
*temp += nk_rect_align + nk_range_align + nk_char_align;
*temp += nk_build_align + nk_baker_align;
}
-
NK_INTERN struct nk_font_baker*
nk_font_baker(void *memory, int glyph_count, int count, struct nk_allocator *alloc)
{
@@ -11312,7 +12728,6 @@ nk_font_baker(void *memory, int glyph_count, int count, struct nk_allocator *all
baker->alloc = *alloc;
return baker;
}
-
NK_INTERN int
nk_font_bake_pack(struct nk_font_baker *baker,
nk_size *image_memory, int *width, int *height, struct nk_recti *custom,
@@ -11320,7 +12735,7 @@ nk_font_bake_pack(struct nk_font_baker *baker,
struct nk_allocator *alloc)
{
NK_STORAGE const nk_size max_height = 1024 * 32;
- const struct nk_font_config *config_iter;
+ const struct nk_font_config *config_iter, *it;
int total_glyph_count = 0;
int total_range_count = 0;
int range_count = 0;
@@ -11335,18 +12750,19 @@ nk_font_bake_pack(struct nk_font_baker *baker,
if (!image_memory || !width || !height || !config_list || !count) return nk_false;
for (config_iter = config_list; config_iter; config_iter = config_iter->next) {
- range_count = nk_range_count(config_iter->range);
- total_range_count += range_count;
- total_glyph_count += nk_range_glyph_count(config_iter->range, range_count);
+ it = config_iter;
+ do {range_count = nk_range_count(it->range);
+ total_range_count += range_count;
+ total_glyph_count += nk_range_glyph_count(it->range, range_count);
+ } while ((it = it->n) != config_iter);
}
-
/* setup font baker from temporary memory */
for (config_iter = config_list; config_iter; config_iter = config_iter->next) {
- const struct nk_font_config *cfg = config_iter;
- if (!nk_tt_InitFont(&baker->build[i++].info, (const unsigned char*)cfg->ttf_blob, 0))
+ it = config_iter;
+ do {if (!nk_tt_InitFont(&baker->build[i++].info, (const unsigned char*)it->ttf_blob, 0))
return nk_false;
+ } while ((it = it->n) != config_iter);
}
-
*height = 0;
*width = (total_glyph_count > 1000) ? 1024 : 512;
nk_tt_PackBegin(&baker->spc, 0, (int)*width, (int)max_height, 0, 1, alloc);
@@ -11360,8 +12776,8 @@ nk_font_bake_pack(struct nk_font_baker *baker,
/* pack custom user data first so it will be in the upper left corner*/
struct nk_rp_rect custom_space;
nk_zero(&custom_space, sizeof(custom_space));
- custom_space.w = (nk_rp_coord)((custom->w * 2) + 1);
- custom_space.h = (nk_rp_coord)(custom->h + 1);
+ custom_space.w = (nk_rp_coord)(custom->w);
+ custom_space.h = (nk_rp_coord)(custom->h);
nk_tt_PackSetOversampling(&baker->spc, 1, 1);
nk_rp_pack_rects((struct nk_rp_context*)baker->spc.pack_info, &custom_space, 1);
@@ -11375,47 +12791,48 @@ nk_font_bake_pack(struct nk_font_baker *baker,
/* first font pass: pack all glyphs */
for (input_i = 0, config_iter = config_list; input_i < count && config_iter;
- input_i++, config_iter = config_iter->next)
- {
- int n = 0;
- int glyph_count;
- const nk_rune *in_range;
- const struct nk_font_config *cfg = config_iter;
- struct nk_font_bake_data *tmp = &baker->build[input_i];
-
- /* count glyphs + ranges in current font */
- glyph_count = 0; range_count = 0;
- for (in_range = cfg->range; in_range[0] && in_range[1]; in_range += 2) {
- glyph_count += (int)(in_range[1] - in_range[0]) + 1;
- range_count++;
- }
+ config_iter = config_iter->next) {
+ it = config_iter;
+ do {int n = 0;
+ int glyph_count;
+ const nk_rune *in_range;
+ const struct nk_font_config *cfg = it;
+ struct nk_font_bake_data *tmp = &baker->build[input_i++];
+
+ /* count glyphs + ranges in current font */
+ glyph_count = 0; range_count = 0;
+ for (in_range = cfg->range; in_range[0] && in_range[1]; in_range += 2) {
+ glyph_count += (int)(in_range[1] - in_range[0]) + 1;
+ range_count++;
+ }
- /* setup ranges */
- tmp->ranges = baker->ranges + range_n;
- tmp->range_count = (nk_rune)range_count;
- range_n += range_count;
- for (i = 0; i < range_count; ++i) {
- in_range = &cfg->range[i * 2];
- tmp->ranges[i].font_size = cfg->size;
- tmp->ranges[i].first_unicode_codepoint_in_range = (int)in_range[0];
- tmp->ranges[i].num_chars = (int)(in_range[1]- in_range[0]) + 1;
- tmp->ranges[i].chardata_for_range = baker->packed_chars + char_n;
- char_n += tmp->ranges[i].num_chars;
- }
+ /* setup ranges */
+ tmp->ranges = baker->ranges + range_n;
+ tmp->range_count = (nk_rune)range_count;
+ range_n += range_count;
+ for (i = 0; i < range_count; ++i) {
+ in_range = &cfg->range[i * 2];
+ tmp->ranges[i].font_size = cfg->size;
+ tmp->ranges[i].first_unicode_codepoint_in_range = (int)in_range[0];
+ tmp->ranges[i].num_chars = (int)(in_range[1]- in_range[0]) + 1;
+ tmp->ranges[i].chardata_for_range = baker->packed_chars + char_n;
+ char_n += tmp->ranges[i].num_chars;
+ }
- /* pack */
- tmp->rects = baker->rects + rect_n;
- rect_n += glyph_count;
- nk_tt_PackSetOversampling(&baker->spc, cfg->oversample_h, cfg->oversample_v);
- n = nk_tt_PackFontRangesGatherRects(&baker->spc, &tmp->info,
- tmp->ranges, (int)tmp->range_count, tmp->rects);
- nk_rp_pack_rects((struct nk_rp_context*)baker->spc.pack_info, tmp->rects, (int)n);
-
- /* texture height */
- for (i = 0; i < n; ++i) {
- if (tmp->rects[i].was_packed)
- *height = NK_MAX(*height, tmp->rects[i].y + tmp->rects[i].h);
- }
+ /* pack */
+ tmp->rects = baker->rects + rect_n;
+ rect_n += glyph_count;
+ nk_tt_PackSetOversampling(&baker->spc, cfg->oversample_h, cfg->oversample_v);
+ n = nk_tt_PackFontRangesGatherRects(&baker->spc, &tmp->info,
+ tmp->ranges, (int)tmp->range_count, tmp->rects);
+ nk_rp_pack_rects((struct nk_rp_context*)baker->spc.pack_info, tmp->rects, (int)n);
+
+ /* texture height */
+ for (i = 0; i < n; ++i) {
+ if (tmp->rects[i].was_packed)
+ *height = NK_MAX(*height, tmp->rects[i].y + tmp->rects[i].h);
+ }
+ } while ((it = it->n) != config_iter);
}
NK_ASSERT(rect_n == total_glyph_count);
NK_ASSERT(char_n == total_glyph_count);
@@ -11425,7 +12842,6 @@ nk_font_bake_pack(struct nk_font_baker *baker,
*image_memory = (nk_size)(*width) * (nk_size)(*height);
return nk_true;
}
-
NK_INTERN void
nk_font_bake(struct nk_font_baker *baker, void *image_memory, int width, int height,
struct nk_font_glyph *glyphs, int glyphs_count,
@@ -11434,6 +12850,7 @@ nk_font_bake(struct nk_font_baker *baker, void *image_memory, int width, int hei
int input_i = 0;
nk_rune glyph_n = 0;
const struct nk_font_config *config_iter;
+ const struct nk_font_config *it;
NK_ASSERT(image_memory);
NK_ASSERT(width);
@@ -11451,91 +12868,93 @@ nk_font_bake(struct nk_font_baker *baker, void *image_memory, int width, int hei
baker->spc.pixels = (unsigned char*)image_memory;
baker->spc.height = (int)height;
for (input_i = 0, config_iter = config_list; input_i < font_count && config_iter;
- ++input_i, config_iter = config_iter->next)
- {
- const struct nk_font_config *cfg = config_iter;
- struct nk_font_bake_data *tmp = &baker->build[input_i];
- nk_tt_PackSetOversampling(&baker->spc, cfg->oversample_h, cfg->oversample_v);
- nk_tt_PackFontRangesRenderIntoRects(&baker->spc, &tmp->info, tmp->ranges,
- (int)tmp->range_count, tmp->rects, &baker->alloc);
- }
- nk_tt_PackEnd(&baker->spc, &baker->alloc);
+ config_iter = config_iter->next) {
+ it = config_iter;
+ do {const struct nk_font_config *cfg = it;
+ struct nk_font_bake_data *tmp = &baker->build[input_i++];
+ nk_tt_PackSetOversampling(&baker->spc, cfg->oversample_h, cfg->oversample_v);
+ nk_tt_PackFontRangesRenderIntoRects(&baker->spc, &tmp->info, tmp->ranges,
+ (int)tmp->range_count, tmp->rects, &baker->alloc);
+ } while ((it = it->n) != config_iter);
+ } nk_tt_PackEnd(&baker->spc, &baker->alloc);
/* third pass: setup font and glyphs */
for (input_i = 0, config_iter = config_list; input_i < font_count && config_iter;
- ++input_i, config_iter = config_iter->next)
- {
- nk_size i = 0;
- int char_idx = 0;
- nk_rune glyph_count = 0;
- const struct nk_font_config *cfg = config_iter;
- struct nk_font_bake_data *tmp = &baker->build[input_i];
- struct nk_baked_font *dst_font = cfg->font;
-
- float font_scale = nk_tt_ScaleForPixelHeight(&tmp->info, cfg->size);
- int unscaled_ascent, unscaled_descent, unscaled_line_gap;
- nk_tt_GetFontVMetrics(&tmp->info, &unscaled_ascent, &unscaled_descent,
- &unscaled_line_gap);
-
- /* fill baked font */
- if (!cfg->merge_mode) {
- dst_font->ranges = cfg->range;
- dst_font->height = cfg->size;
- dst_font->ascent = ((float)unscaled_ascent * font_scale);
- dst_font->descent = ((float)unscaled_descent * font_scale);
- dst_font->glyph_offset = glyph_n;
- }
+ config_iter = config_iter->next) {
+ it = config_iter;
+ do {nk_size i = 0;
+ int char_idx = 0;
+ nk_rune glyph_count = 0;
+ const struct nk_font_config *cfg = it;
+ struct nk_font_bake_data *tmp = &baker->build[input_i++];
+ struct nk_baked_font *dst_font = cfg->font;
+
+ float font_scale = nk_tt_ScaleForPixelHeight(&tmp->info, cfg->size);
+ int unscaled_ascent, unscaled_descent, unscaled_line_gap;
+ nk_tt_GetFontVMetrics(&tmp->info, &unscaled_ascent, &unscaled_descent,
+ &unscaled_line_gap);
+
+ /* fill baked font */
+ if (!cfg->merge_mode) {
+ dst_font->ranges = cfg->range;
+ dst_font->height = cfg->size;
+ dst_font->ascent = ((float)unscaled_ascent * font_scale);
+ dst_font->descent = ((float)unscaled_descent * font_scale);
+ dst_font->glyph_offset = glyph_n;
+ // Need to zero this, or it will carry over from a previous
+ // bake, and cause a segfault when accessing glyphs[].
+ dst_font->glyph_count = 0;
+ }
- /* fill own baked font glyph array */
- for (i = 0; i < tmp->range_count; ++i)
- {
- struct nk_tt_pack_range *range = &tmp->ranges[i];
- for (char_idx = 0; char_idx < range->num_chars; char_idx++)
- {
- nk_rune codepoint = 0;
- float dummy_x = 0, dummy_y = 0;
- struct nk_tt_aligned_quad q;
- struct nk_font_glyph *glyph;
-
- /* query glyph bounds from stb_truetype */
- const struct nk_tt_packedchar *pc = &range->chardata_for_range[char_idx];
- if (!pc->x0 && !pc->x1 && !pc->y0 && !pc->y1) continue;
- codepoint = (nk_rune)(range->first_unicode_codepoint_in_range + char_idx);
- nk_tt_GetPackedQuad(range->chardata_for_range, (int)width,
- (int)height, char_idx, &dummy_x, &dummy_y, &q, 0);
-
- /* fill own glyph type with data */
- glyph = &glyphs[dst_font->glyph_offset + (unsigned int)glyph_count];
- glyph->codepoint = codepoint;
- glyph->x0 = q.x0; glyph->y0 = q.y0;
- glyph->x1 = q.x1; glyph->y1 = q.y1;
- glyph->y0 += (dst_font->ascent + 0.5f);
- glyph->y1 += (dst_font->ascent + 0.5f);
- glyph->w = glyph->x1 - glyph->x0 + 0.5f;
- glyph->h = glyph->y1 - glyph->y0;
-
- if (cfg->coord_type == NK_COORD_PIXEL) {
- glyph->u0 = q.s0 * (float)width;
- glyph->v0 = q.t0 * (float)height;
- glyph->u1 = q.s1 * (float)width;
- glyph->v1 = q.t1 * (float)height;
- } else {
- glyph->u0 = q.s0;
- glyph->v0 = q.t0;
- glyph->u1 = q.s1;
- glyph->v1 = q.t1;
+ /* fill own baked font glyph array */
+ for (i = 0; i < tmp->range_count; ++i) {
+ struct nk_tt_pack_range *range = &tmp->ranges[i];
+ for (char_idx = 0; char_idx < range->num_chars; char_idx++)
+ {
+ nk_rune codepoint = 0;
+ float dummy_x = 0, dummy_y = 0;
+ struct nk_tt_aligned_quad q;
+ struct nk_font_glyph *glyph;
+
+ /* query glyph bounds from stb_truetype */
+ const struct nk_tt_packedchar *pc = &range->chardata_for_range[char_idx];
+ if (!pc->x0 && !pc->x1 && !pc->y0 && !pc->y1) continue;
+ codepoint = (nk_rune)(range->first_unicode_codepoint_in_range + char_idx);
+ nk_tt_GetPackedQuad(range->chardata_for_range, (int)width,
+ (int)height, char_idx, &dummy_x, &dummy_y, &q, 0);
+
+ /* fill own glyph type with data */
+ glyph = &glyphs[dst_font->glyph_offset + dst_font->glyph_count + (unsigned int)glyph_count];
+ glyph->codepoint = codepoint;
+ glyph->x0 = q.x0; glyph->y0 = q.y0;
+ glyph->x1 = q.x1; glyph->y1 = q.y1;
+ glyph->y0 += (dst_font->ascent + 0.5f);
+ glyph->y1 += (dst_font->ascent + 0.5f);
+ glyph->w = glyph->x1 - glyph->x0 + 0.5f;
+ glyph->h = glyph->y1 - glyph->y0;
+
+ if (cfg->coord_type == NK_COORD_PIXEL) {
+ glyph->u0 = q.s0 * (float)width;
+ glyph->v0 = q.t0 * (float)height;
+ glyph->u1 = q.s1 * (float)width;
+ glyph->v1 = q.t1 * (float)height;
+ } else {
+ glyph->u0 = q.s0;
+ glyph->v0 = q.t0;
+ glyph->u1 = q.s1;
+ glyph->v1 = q.t1;
+ }
+ glyph->xadvance = (pc->xadvance + cfg->spacing.x);
+ if (cfg->pixel_snap)
+ glyph->xadvance = (float)(int)(glyph->xadvance + 0.5f);
+ glyph_count++;
}
- glyph->xadvance = (pc->xadvance + cfg->spacing.x);
- if (cfg->pixel_snap)
- glyph->xadvance = (float)(int)(glyph->xadvance + 0.5f);
- glyph_count++;
}
- }
- dst_font->glyph_count = glyph_count;
- glyph_n += dst_font->glyph_count;
+ dst_font->glyph_count += glyph_count;
+ glyph_n += glyph_count;
+ } while ((it = it->n) != config_iter);
}
}
-
NK_INTERN void
nk_font_bake_custom_data(void *img_memory, int img_width, int img_height,
struct nk_recti img_dst, const char *texture_data_mask, int tex_width,
@@ -11564,7 +12983,6 @@ nk_font_bake_custom_data(void *img_memory, int img_width, int img_height,
}
}
}
-
NK_INTERN void
nk_font_bake_convert(void *out_memory, int img_width, int img_height,
const void *in_memory)
@@ -11622,7 +13040,6 @@ nk_font_text_width(nk_handle handle, float height, const char *text, int len)
}
return text_width;
}
-
#ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT
NK_INTERN void
nk_font_query_font_glyph(nk_handle handle, float height,
@@ -11651,7 +13068,6 @@ nk_font_query_font_glyph(nk_handle handle, float height,
glyph->uv[1] = nk_vec2(g->u1, g->v1);
}
#endif
-
NK_API const struct nk_font_glyph*
nk_font_find_glyph(struct nk_font *font, nk_rune unicode)
{
@@ -11659,6 +13075,7 @@ nk_font_find_glyph(struct nk_font *font, nk_rune unicode)
int count;
int total_glyphs = 0;
const struct nk_font_glyph *glyph = 0;
+ const struct nk_font_config *iter = 0;
NK_ASSERT(font);
NK_ASSERT(font->glyphs);
@@ -11666,18 +13083,19 @@ nk_font_find_glyph(struct nk_font *font, nk_rune unicode)
if (!font || !font->glyphs) return 0;
glyph = font->fallback;
- count = nk_range_count(font->info.ranges);
- for (i = 0; i < count; ++i) {
- nk_rune f = font->info.ranges[(i*2)+0];
- nk_rune t = font->info.ranges[(i*2)+1];
- int diff = (int)((t - f) + 1);
- if (unicode >= f && unicode <= t)
- return &font->glyphs[((nk_rune)total_glyphs + (unicode - f))];
- total_glyphs += diff;
- }
+ iter = font->config;
+ do {count = nk_range_count(iter->range);
+ for (i = 0; i < count; ++i) {
+ nk_rune f = iter->range[(i*2)+0];
+ nk_rune t = iter->range[(i*2)+1];
+ int diff = (int)((t - f) + 1);
+ if (unicode >= f && unicode <= t)
+ return &font->glyphs[((nk_rune)total_glyphs + (unicode - f))];
+ total_glyphs += diff;
+ }
+ } while ((iter = iter->n) != font->config);
return glyph;
}
-
NK_INTERN void
nk_font_init(struct nk_font *font, float pixel_height,
nk_rune fallback_codepoint, struct nk_font_glyph *glyphs,
@@ -11717,17 +13135,16 @@ nk_font_init(struct nk_font *font, float pixel_height,
* MIT license (see License.txt in http://www.upperbounds.net/download/ProggyClean.ttf.zip)
* Download and more information at http://upperbounds.net
*-----------------------------------------------------------------------------*/
-#ifdef NK_INCLUDE_DEFAULT_FONT
-
- #ifdef __clang__
+#ifdef __clang__
#pragma clang diagnostic push
-
#pragma clang diagnostic ignored "-Woverlength-strings"
#elif defined(__GNUC__) || defined(__GNUG__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Woverlength-strings"
#endif
+#ifdef NK_INCLUDE_DEFAULT_FONT
+
NK_GLOBAL const char nk_proggy_clean_ttf_compressed_data_base85[11980+1] =
"7])#######hV0qs'/###[),##/l:$#Q6>##5[n42>c-TH`->>#/e>11NNV=Bv(*:.F?uu#(gRU.o0XGH`$vhLG1hxt9?W`#,5LsCp#-i>.r$<$6pD>Lb';9Crc6tgXmKVeU2cD4Eo3R/"
"2*>]b(MC;$jPfY.;h^`IWM9)4kMYD4lVu`4m`:&5niUA5@(A5BA1]PBB:xlBCC=2CDLXMCEUtiCf&0g2'tN?PGT4CPGT4CPGT4CPGT4CPGT4CPGT4CPGT4CP"
"GT4CPGT4CPGT4CPGT4CPGT4CPGT4CP-qekC`.9kEg^+F$kwViFJTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5o,^<-28ZI'O?;xp"
"O?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xp;7q-#lLYI:xvD=#";
+
#endif /* NK_INCLUDE_DEFAULT_FONT */
#define NK_CURSOR_DATA_W 90
@@ -11856,28 +13274,26 @@ NK_GLOBAL const char nk_custom_cursor_data[NK_CURSOR_DATA_W * NK_CURSOR_DATA_H +
#pragma GCC diagnostic pop
#endif
-NK_INTERN unsigned int
-nk_decompress_length(unsigned char *input)
-{
- return (unsigned int)((input[8] << 24) + (input[9] << 16) + (input[10] << 8) + input[11]);
-}
-
NK_GLOBAL unsigned char *nk__barrier;
NK_GLOBAL unsigned char *nk__barrier2;
NK_GLOBAL unsigned char *nk__barrier3;
NK_GLOBAL unsigned char *nk__barrier4;
NK_GLOBAL unsigned char *nk__dout;
-NK_INTERN void
-nk__match(unsigned char *data, unsigned int length)
-{
+NK_INTERN unsigned int
+nk_decompress_length(unsigned char *input)
+{
+ return (unsigned int)((input[8] << 24) + (input[9] << 16) + (input[10] << 8) + input[11]);
+}
+NK_INTERN void
+nk__match(unsigned char *data, unsigned int length)
+{
/* INVERSE of memmove... write each byte before copying the next...*/
NK_ASSERT (nk__dout + length <= nk__barrier);
if (nk__dout + length > nk__barrier) { nk__dout += length; return; }
if (data < nk__barrier4) { nk__dout = nk__barrier+1; return; }
while (length--) *nk__dout++ = *data++;
}
-
NK_INTERN void
nk__lit(unsigned char *data, unsigned int length)
{
@@ -11887,14 +13303,13 @@ nk__lit(unsigned char *data, unsigned int length)
NK_MEMCPY(nk__dout, data, length);
nk__dout += length;
}
-
-#define nk__in2(x) ((i[x] << 8) + i[(x)+1])
-#define nk__in3(x) ((i[x] << 16) + nk__in2((x)+1))
-#define nk__in4(x) ((i[x] << 24) + nk__in3((x)+1))
-
NK_INTERN unsigned char*
nk_decompress_token(unsigned char *i)
{
+ #define nk__in2(x) ((i[x] << 8) + i[(x)+1])
+ #define nk__in3(x) ((i[x] << 16) + nk__in2((x)+1))
+ #define nk__in4(x) ((i[x] << 24) + nk__in3((x)+1))
+
if (*i >= 0x20) { /* use fewer if's for cases that expand small */
if (*i >= 0x80) nk__match(nk__dout-i[1]-1, (unsigned int)i[0] - 0x80 + 1), i += 2;
else if (*i >= 0x40) nk__match(nk__dout-(nk__in2(0) - 0x4000 + 1), (unsigned int)i[2]+1), i += 3;
@@ -11909,7 +13324,6 @@ nk_decompress_token(unsigned char *i)
}
return i;
}
-
NK_INTERN unsigned int
nk_adler32(unsigned int adler32, unsigned char *buffer, unsigned int buflen)
{
@@ -11940,7 +13354,6 @@ nk_adler32(unsigned int adler32, unsigned char *buffer, unsigned int buflen)
}
return (unsigned int)(s2 << 16) + (unsigned int)s1;
}
-
NK_INTERN unsigned int
nk_decompress(unsigned char *output, unsigned char *i, unsigned int length)
{
@@ -11975,11 +13388,11 @@ nk_decompress(unsigned char *output, unsigned char *i, unsigned int length)
return 0;
}
}
-
NK_INTERN unsigned int
nk_decode_85_byte(char c)
-{ return (unsigned int)((c >= '\\') ? c-36 : c-35); }
-
+{
+ return (unsigned int)((c >= '\\') ? c-36 : c-35);
+}
NK_INTERN void
nk_decode_85(unsigned char* dst, const unsigned char* src)
{
@@ -12026,9 +13439,9 @@ nk_font_config(float pixel_height)
cfg.merge_mode = 0;
cfg.fallback_glyph = '?';
cfg.font = 0;
+ cfg.n = 0;
return cfg;
}
-
#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
NK_API void
nk_font_atlas_init_default(struct nk_font_atlas *atlas)
@@ -12044,7 +13457,6 @@ nk_font_atlas_init_default(struct nk_font_atlas *atlas)
atlas->permanent.free = nk_mfree;
}
#endif
-
NK_API void
nk_font_atlas_init(struct nk_font_atlas *atlas, struct nk_allocator *alloc)
{
@@ -12055,7 +13467,6 @@ nk_font_atlas_init(struct nk_font_atlas *atlas, struct nk_allocator *alloc)
atlas->permanent = *alloc;
atlas->temporary = *alloc;
}
-
NK_API void
nk_font_atlas_init_custom(struct nk_font_atlas *atlas,
struct nk_allocator *permanent, struct nk_allocator *temporary)
@@ -12068,7 +13479,6 @@ nk_font_atlas_init_custom(struct nk_font_atlas *atlas,
atlas->permanent = *permanent;
atlas->temporary = *temporary;
}
-
NK_API void
nk_font_atlas_begin(struct nk_font_atlas *atlas)
{
@@ -12086,7 +13496,6 @@ nk_font_atlas_begin(struct nk_font_atlas *atlas)
atlas->pixel = 0;
}
}
-
NK_API struct nk_font*
nk_font_atlas_add(struct nk_font_atlas *atlas, const struct nk_font_config *config)
{
@@ -12109,43 +13518,57 @@ nk_font_atlas_add(struct nk_font_atlas *atlas, const struct nk_font_config *conf
!atlas->temporary.alloc || !atlas->temporary.free)
return 0;
- /* allocate and insert font config into list */
+ /* allocate font config */
cfg = (struct nk_font_config*)
atlas->permanent.alloc(atlas->permanent.userdata,0, sizeof(struct nk_font_config));
NK_MEMCPY(cfg, config, sizeof(*config));
- if (!atlas->config) {
- atlas->config = cfg;
- cfg->next = 0;
- } else {
- cfg->next = atlas->config;
- atlas->config = cfg;
- }
+ cfg->n = cfg;
+ cfg->p = cfg;
- /* allocate new font */
if (!config->merge_mode) {
+ /* insert font config into list */
+ if (!atlas->config) {
+ atlas->config = cfg;
+ cfg->next = 0;
+ } else {
+ struct nk_font_config *i = atlas->config;
+ while (i->next) i = i->next;
+ i->next = cfg;
+ cfg->next = 0;
+ }
+ /* allocate new font */
font = (struct nk_font*)
atlas->permanent.alloc(atlas->permanent.userdata,0, sizeof(struct nk_font));
NK_ASSERT(font);
+ nk_zero(font, sizeof(*font));
if (!font) return 0;
font->config = cfg;
- } else {
- NK_ASSERT(atlas->font_num);
- font = atlas->fonts;
- font->config = cfg;
- }
- /* insert font into list */
- if (!config->merge_mode) {
+ /* insert font into list */
if (!atlas->fonts) {
atlas->fonts = font;
font->next = 0;
} else {
- font->next = atlas->fonts;
- atlas->fonts = font;
+ struct nk_font *i = atlas->fonts;
+ while (i->next) i = i->next;
+ i->next = font;
+ font->next = 0;
}
cfg->font = &font->info;
- }
+ } else {
+ /* extend previously added font */
+ struct nk_font *f = 0;
+ struct nk_font_config *c = 0;
+ NK_ASSERT(atlas->font_num);
+ f = atlas->fonts;
+ c = f->config;
+ cfg->font = &f->info;
+ cfg->n = c;
+ cfg->p = c->p;
+ c->p->n = cfg;
+ c->p = cfg;
+ }
/* create own copy of .TTF font blob */
if (!config->ttf_data_owned_by_atlas) {
cfg->ttf_blob = atlas->permanent.alloc(atlas->permanent.userdata,0, cfg->ttf_size);
@@ -12160,7 +13583,6 @@ nk_font_atlas_add(struct nk_font_atlas *atlas, const struct nk_font_config *conf
atlas->font_num++;
return font;
}
-
NK_API struct nk_font*
nk_font_atlas_add_from_memory(struct nk_font_atlas *atlas, void *memory,
nk_size size, float height, const struct nk_font_config *config)
@@ -12185,7 +13607,6 @@ nk_font_atlas_add_from_memory(struct nk_font_atlas *atlas, void *memory,
cfg.ttf_data_owned_by_atlas = 0;
return nk_font_atlas_add(atlas, &cfg);
}
-
#ifdef NK_INCLUDE_STANDARD_IO
NK_API struct nk_font*
nk_font_atlas_add_from_file(struct nk_font_atlas *atlas, const char *file_path,
@@ -12213,7 +13634,6 @@ nk_font_atlas_add_from_file(struct nk_font_atlas *atlas, const char *file_path,
return nk_font_atlas_add(atlas, &cfg);
}
#endif
-
NK_API struct nk_font*
nk_font_atlas_add_compressed(struct nk_font_atlas *atlas,
void *compressed_data, nk_size compressed_size, float height,
@@ -12249,7 +13669,6 @@ nk_font_atlas_add_compressed(struct nk_font_atlas *atlas,
cfg.ttf_data_owned_by_atlas = 1;
return nk_font_atlas_add(atlas, &cfg);
}
-
NK_API struct nk_font*
nk_font_atlas_add_compressed_base85(struct nk_font_atlas *atlas,
const char *data_base85, float height, const struct nk_font_config *config)
@@ -12294,7 +13713,6 @@ nk_font_atlas_add_default(struct nk_font_atlas *atlas,
nk_proggy_clean_ttf_compressed_data_base85, pixel_height, config);
}
#endif
-
NK_API const void*
nk_font_atlas_bake(struct nk_font_atlas *atlas, int *width, int *height,
enum nk_font_atlas_format fmt)
@@ -12382,7 +13800,7 @@ nk_font_atlas_bake(struct nk_font_atlas *atlas, int *width, int *height,
/* initialize each cursor */
{NK_STORAGE const struct nk_vec2 nk_cursor_data[NK_CURSOR_COUNT][3] = {
- /* Pos ----- Size ------- Offset --*/
+ /* Pos Size Offset */
{{ 0, 3}, {12,19}, { 0, 0}},
{{13, 0}, { 7,16}, { 4, 8}},
{{31, 0}, {23,23}, {11,11}},
@@ -12419,7 +13837,6 @@ nk_font_atlas_bake(struct nk_font_atlas *atlas, int *width, int *height,
}
return 0;
}
-
NK_API void
nk_font_atlas_end(struct nk_font_atlas *atlas, nk_handle texture,
struct nk_draw_null_texture *null)
@@ -12455,7 +13872,6 @@ nk_font_atlas_end(struct nk_font_atlas *atlas, nk_handle texture,
atlas->custom.w = 0;
atlas->custom.h = 0;
}
-
NK_API void
nk_font_atlas_cleanup(struct nk_font_atlas *atlas)
{
@@ -12464,19 +13880,20 @@ nk_font_atlas_cleanup(struct nk_font_atlas *atlas)
NK_ASSERT(atlas->temporary.free);
NK_ASSERT(atlas->permanent.alloc);
NK_ASSERT(atlas->permanent.free);
-
if (!atlas || !atlas->permanent.alloc || !atlas->permanent.free) return;
if (atlas->config) {
- struct nk_font_config *iter, *next;
- for (iter = atlas->config; iter; iter = next) {
- next = iter->next;
+ struct nk_font_config *iter;
+ for (iter = atlas->config; iter; iter = iter->next) {
+ struct nk_font_config *i;
+ for (i = iter->n; i != iter; i = i->n) {
+ atlas->permanent.free(atlas->permanent.userdata, i->ttf_blob);
+ i->ttf_blob = 0;
+ }
atlas->permanent.free(atlas->permanent.userdata, iter->ttf_blob);
- atlas->permanent.free(atlas->permanent.userdata, iter);
+ iter->ttf_blob = 0;
}
- atlas->config = 0;
}
}
-
NK_API void
nk_font_atlas_clear(struct nk_font_atlas *atlas)
{
@@ -12487,7 +13904,23 @@ nk_font_atlas_clear(struct nk_font_atlas *atlas)
NK_ASSERT(atlas->permanent.free);
if (!atlas || !atlas->permanent.alloc || !atlas->permanent.free) return;
- nk_font_atlas_cleanup(atlas);
+ if (atlas->config) {
+ struct nk_font_config *iter, *next;
+ for (iter = atlas->config; iter; iter = next) {
+ struct nk_font_config *i, *n;
+ for (i = iter->n; i != iter; i = n) {
+ n = i->n;
+ if (i->ttf_blob)
+ atlas->permanent.free(atlas->permanent.userdata, i->ttf_blob);
+ atlas->permanent.free(atlas->permanent.userdata, i);
+ }
+ next = iter->next;
+ if (i->ttf_blob)
+ atlas->permanent.free(atlas->permanent.userdata, iter->ttf_blob);
+ atlas->permanent.free(atlas->permanent.userdata, iter);
+ }
+ atlas->config = 0;
+ }
if (atlas->fonts) {
struct nk_font *iter, *next;
for (iter = atlas->fonts; iter; iter = next) {
@@ -12501,7 +13934,12 @@ nk_font_atlas_clear(struct nk_font_atlas *atlas)
nk_zero_struct(*atlas);
}
#endif
-/* ==============================================================
+
+
+
+
+
+/* ===============================================================
*
* INPUT
*
@@ -12526,7 +13964,6 @@ nk_input_begin(struct nk_context *ctx)
for (i = 0; i < NK_KEY_MAX; i++)
in->keyboard.keys[i].clicked = 0;
}
-
NK_API void
nk_input_end(struct nk_context *ctx)
{
@@ -12542,7 +13979,6 @@ nk_input_end(struct nk_context *ctx)
in->mouse.grab = 0;
}
}
-
NK_API void
nk_input_motion(struct nk_context *ctx, int x, int y)
{
@@ -12555,7 +13991,6 @@ nk_input_motion(struct nk_context *ctx, int x, int y)
in->mouse.delta.x = in->mouse.pos.x - in->mouse.prev.x;
in->mouse.delta.y = in->mouse.pos.y - in->mouse.prev.y;
}
-
NK_API void
nk_input_key(struct nk_context *ctx, enum nk_keys key, int down)
{
@@ -12563,11 +13998,14 @@ nk_input_key(struct nk_context *ctx, enum nk_keys key, int down)
NK_ASSERT(ctx);
if (!ctx) return;
in = &ctx->input;
+#ifdef NK_KEYSTATE_BASED_INPUT
if (in->keyboard.keys[key].down != down)
in->keyboard.keys[key].clicked++;
+#else
+ in->keyboard.keys[key].clicked++;
+#endif
in->keyboard.keys[key].down = down;
}
-
NK_API void
nk_input_button(struct nk_context *ctx, enum nk_buttons id, int x, int y, int down)
{
@@ -12584,7 +14022,6 @@ nk_input_button(struct nk_context *ctx, enum nk_buttons id, int x, int y, int do
btn->down = down;
btn->clicked++;
}
-
NK_API void
nk_input_scroll(struct nk_context *ctx, struct nk_vec2 val)
{
@@ -12593,7 +14030,6 @@ nk_input_scroll(struct nk_context *ctx, struct nk_vec2 val)
ctx->input.mouse.scroll_delta.x += val.x;
ctx->input.mouse.scroll_delta.y += val.y;
}
-
NK_API void
nk_input_glyph(struct nk_context *ctx, const nk_glyph glyph)
{
@@ -12612,7 +14048,6 @@ nk_input_glyph(struct nk_context *ctx, const nk_glyph glyph)
in->keyboard.text_len += len;
}
}
-
NK_API void
nk_input_char(struct nk_context *ctx, char c)
{
@@ -12622,7 +14057,6 @@ nk_input_char(struct nk_context *ctx, char c)
glyph[0] = c;
nk_input_glyph(ctx, glyph);
}
-
NK_API void
nk_input_unicode(struct nk_context *ctx, nk_rune unicode)
{
@@ -12632,7 +14066,6 @@ nk_input_unicode(struct nk_context *ctx, nk_rune unicode)
nk_utf_encode(unicode, rune, NK_UTF_SIZE);
nk_input_glyph(ctx, rune);
}
-
NK_API int
nk_input_has_mouse_click(const struct nk_input *i, enum nk_buttons id)
{
@@ -12641,7 +14074,6 @@ nk_input_has_mouse_click(const struct nk_input *i, enum nk_buttons id)
btn = &i->mouse.buttons[id];
return (btn->clicked && btn->down == nk_false) ? nk_true : nk_false;
}
-
NK_API int
nk_input_has_mouse_click_in_rect(const struct nk_input *i, enum nk_buttons id,
struct nk_rect b)
@@ -12653,7 +14085,6 @@ nk_input_has_mouse_click_in_rect(const struct nk_input *i, enum nk_buttons id,
return nk_false;
return nk_true;
}
-
NK_API int
nk_input_has_mouse_click_down_in_rect(const struct nk_input *i, enum nk_buttons id,
struct nk_rect b, int down)
@@ -12663,7 +14094,6 @@ nk_input_has_mouse_click_down_in_rect(const struct nk_input *i, enum nk_buttons
btn = &i->mouse.buttons[id];
return nk_input_has_mouse_click_in_rect(i, id, b) && (btn->down == down);
}
-
NK_API int
nk_input_is_mouse_click_in_rect(const struct nk_input *i, enum nk_buttons id,
struct nk_rect b)
@@ -12674,7 +14104,6 @@ nk_input_is_mouse_click_in_rect(const struct nk_input *i, enum nk_buttons id,
return (nk_input_has_mouse_click_down_in_rect(i, id, b, nk_false) &&
btn->clicked) ? nk_true : nk_false;
}
-
NK_API int
nk_input_is_mouse_click_down_in_rect(const struct nk_input *i, enum nk_buttons id,
struct nk_rect b, int down)
@@ -12685,7 +14114,6 @@ nk_input_is_mouse_click_down_in_rect(const struct nk_input *i, enum nk_buttons i
return (nk_input_has_mouse_click_down_in_rect(i, id, b, down) &&
btn->clicked) ? nk_true : nk_false;
}
-
NK_API int
nk_input_any_mouse_click_in_rect(const struct nk_input *in, struct nk_rect b)
{
@@ -12694,21 +14122,18 @@ nk_input_any_mouse_click_in_rect(const struct nk_input *in, struct nk_rect b)
down = down || nk_input_is_mouse_click_in_rect(in, (enum nk_buttons)i, b);
return down;
}
-
NK_API int
nk_input_is_mouse_hovering_rect(const struct nk_input *i, struct nk_rect rect)
{
if (!i) return nk_false;
return NK_INBOX(i->mouse.pos.x, i->mouse.pos.y, rect.x, rect.y, rect.w, rect.h);
}
-
NK_API int
nk_input_is_mouse_prev_hovering_rect(const struct nk_input *i, struct nk_rect rect)
{
if (!i) return nk_false;
return NK_INBOX(i->mouse.prev.x, i->mouse.prev.y, rect.x, rect.y, rect.w, rect.h);
}
-
NK_API int
nk_input_mouse_clicked(const struct nk_input *i, enum nk_buttons id, struct nk_rect rect)
{
@@ -12716,14 +14141,12 @@ nk_input_mouse_clicked(const struct nk_input *i, enum nk_buttons id, struct nk_r
if (!nk_input_is_mouse_hovering_rect(i, rect)) return nk_false;
return nk_input_is_mouse_click_in_rect(i, id, rect);
}
-
NK_API int
nk_input_is_mouse_down(const struct nk_input *i, enum nk_buttons id)
{
if (!i) return nk_false;
return i->mouse.buttons[id].down;
}
-
NK_API int
nk_input_is_mouse_pressed(const struct nk_input *i, enum nk_buttons id)
{
@@ -12734,14 +14157,12 @@ nk_input_is_mouse_pressed(const struct nk_input *i, enum nk_buttons id)
return nk_true;
return nk_false;
}
-
NK_API int
nk_input_is_mouse_released(const struct nk_input *i, enum nk_buttons id)
{
if (!i) return nk_false;
return (!i->mouse.buttons[id].down && i->mouse.buttons[id].clicked);
}
-
NK_API int
nk_input_is_key_pressed(const struct nk_input *i, enum nk_keys key)
{
@@ -12752,7 +14173,6 @@ nk_input_is_key_pressed(const struct nk_input *i, enum nk_keys key)
return nk_true;
return nk_false;
}
-
NK_API int
nk_input_is_key_released(const struct nk_input *i, enum nk_keys key)
{
@@ -12763,7 +14183,6 @@ nk_input_is_key_released(const struct nk_input *i, enum nk_keys key)
return nk_true;
return nk_false;
}
-
NK_API int
nk_input_is_key_down(const struct nk_input *i, enum nk_keys key)
{
@@ -12774,5095 +14193,5039 @@ nk_input_is_key_down(const struct nk_input *i, enum nk_keys key)
return nk_false;
}
-/*
- * ==============================================================
+
+
+
+
+/* ===============================================================
*
- * TEXT EDITOR
+ * STYLE
*
- * ===============================================================
- */
-/* stb_textedit.h - v1.8 - public domain - Sean Barrett */
-struct nk_text_find {
- float x,y; /* position of n'th character */
- float height; /* height of line */
- int first_char, length; /* first char of row, and length */
- int prev_first; /*_ first char of previous row */
-};
+ * ===============================================================*/
+NK_API void nk_style_default(struct nk_context *ctx){nk_style_from_table(ctx, 0);}
+#define NK_COLOR_MAP(NK_COLOR)\
+ NK_COLOR(NK_COLOR_TEXT, 175,175,175,255) \
+ NK_COLOR(NK_COLOR_WINDOW, 45, 45, 45, 255) \
+ NK_COLOR(NK_COLOR_HEADER, 40, 40, 40, 255) \
+ NK_COLOR(NK_COLOR_BORDER, 65, 65, 65, 255) \
+ NK_COLOR(NK_COLOR_BUTTON, 50, 50, 50, 255) \
+ NK_COLOR(NK_COLOR_BUTTON_HOVER, 40, 40, 40, 255) \
+ NK_COLOR(NK_COLOR_BUTTON_ACTIVE, 35, 35, 35, 255) \
+ NK_COLOR(NK_COLOR_TOGGLE, 100,100,100,255) \
+ NK_COLOR(NK_COLOR_TOGGLE_HOVER, 120,120,120,255) \
+ NK_COLOR(NK_COLOR_TOGGLE_CURSOR, 45, 45, 45, 255) \
+ NK_COLOR(NK_COLOR_SELECT, 45, 45, 45, 255) \
+ NK_COLOR(NK_COLOR_SELECT_ACTIVE, 35, 35, 35,255) \
+ NK_COLOR(NK_COLOR_SLIDER, 38, 38, 38, 255) \
+ NK_COLOR(NK_COLOR_SLIDER_CURSOR, 100,100,100,255) \
+ NK_COLOR(NK_COLOR_SLIDER_CURSOR_HOVER, 120,120,120,255) \
+ NK_COLOR(NK_COLOR_SLIDER_CURSOR_ACTIVE, 150,150,150,255) \
+ NK_COLOR(NK_COLOR_PROPERTY, 38, 38, 38, 255) \
+ NK_COLOR(NK_COLOR_EDIT, 38, 38, 38, 255) \
+ NK_COLOR(NK_COLOR_EDIT_CURSOR, 175,175,175,255) \
+ NK_COLOR(NK_COLOR_COMBO, 45, 45, 45, 255) \
+ NK_COLOR(NK_COLOR_CHART, 120,120,120,255) \
+ NK_COLOR(NK_COLOR_CHART_COLOR, 45, 45, 45, 255) \
+ NK_COLOR(NK_COLOR_CHART_COLOR_HIGHLIGHT, 255, 0, 0, 255) \
+ NK_COLOR(NK_COLOR_SCROLLBAR, 40, 40, 40, 255) \
+ NK_COLOR(NK_COLOR_SCROLLBAR_CURSOR, 100,100,100,255) \
+ NK_COLOR(NK_COLOR_SCROLLBAR_CURSOR_HOVER, 120,120,120,255) \
+ NK_COLOR(NK_COLOR_SCROLLBAR_CURSOR_ACTIVE, 150,150,150,255) \
+ NK_COLOR(NK_COLOR_TAB_HEADER, 40, 40, 40,255)
-struct nk_text_edit_row {
- float x0,x1;
- /* starting x location, end x location (allows for align=right, etc) */
- float baseline_y_delta;
- /* position of baseline relative to previous row's baseline*/
- float ymin,ymax;
- /* height of row above and below baseline */
- int num_chars;
+NK_GLOBAL const struct nk_color
+nk_default_color_style[NK_COLOR_COUNT] = {
+#define NK_COLOR(a,b,c,d,e) {b,c,d,e},
+ NK_COLOR_MAP(NK_COLOR)
+#undef NK_COLOR
+};
+NK_GLOBAL const char *nk_color_names[NK_COLOR_COUNT] = {
+#define NK_COLOR(a,b,c,d,e) #a,
+ NK_COLOR_MAP(NK_COLOR)
+#undef NK_COLOR
};
-/* forward declarations */
-NK_INTERN void nk_textedit_makeundo_delete(struct nk_text_edit*, int, int);
-NK_INTERN void nk_textedit_makeundo_insert(struct nk_text_edit*, int, int);
-NK_INTERN void nk_textedit_makeundo_replace(struct nk_text_edit*, int, int, int);
-#define NK_TEXT_HAS_SELECTION(s) ((s)->select_start != (s)->select_end)
-
-NK_INTERN float
-nk_textedit_get_width(const struct nk_text_edit *edit, int line_start, int char_id,
- const struct nk_user_font *font)
+NK_API const char*
+nk_style_get_color_by_name(enum nk_style_colors c)
{
- int len = 0;
- nk_rune unicode = 0;
- const char *str = nk_str_at_const(&edit->string, line_start + char_id, &unicode, &len);
- return font->width(font->userdata, font->height, str, len);
+ return nk_color_names[c];
}
-
-NK_INTERN void
-nk_textedit_layout_row(struct nk_text_edit_row *r, struct nk_text_edit *edit,
- int line_start_id, float row_height, const struct nk_user_font *font)
+NK_API struct nk_style_item
+nk_style_item_image(struct nk_image img)
{
- int l;
- int glyphs = 0;
- nk_rune unicode;
- const char *remaining;
- int len = nk_str_len_char(&edit->string);
- const char *end = nk_str_get_const(&edit->string) + len;
- const char *text = nk_str_at_const(&edit->string, line_start_id, &unicode, &l);
- const struct nk_vec2 size = nk_text_calculate_text_bounds(font,
- text, (int)(end - text), row_height, &remaining, 0, &glyphs, NK_STOP_ON_NEW_LINE);
-
- r->x0 = 0.0f;
- r->x1 = size.x;
- r->baseline_y_delta = size.y;
- r->ymin = 0.0f;
- r->ymax = size.y;
- r->num_chars = glyphs;
+ struct nk_style_item i;
+ i.type = NK_STYLE_ITEM_IMAGE;
+ i.data.image = img;
+ return i;
}
-
-NK_INTERN int
-nk_textedit_locate_coord(struct nk_text_edit *edit, float x, float y,
- const struct nk_user_font *font, float row_height)
+NK_API struct nk_style_item
+nk_style_item_color(struct nk_color col)
{
- struct nk_text_edit_row r;
- int n = edit->string.len;
- float base_y = 0, prev_x;
- int i=0, k;
+ struct nk_style_item i;
+ i.type = NK_STYLE_ITEM_COLOR;
+ i.data.color = col;
+ return i;
+}
+NK_API struct nk_style_item
+nk_style_item_hide(void)
+{
+ struct nk_style_item i;
+ i.type = NK_STYLE_ITEM_COLOR;
+ i.data.color = nk_rgba(0,0,0,0);
+ return i;
+}
+NK_API void
+nk_style_from_table(struct nk_context *ctx, const struct nk_color *table)
+{
+ struct nk_style *style;
+ struct nk_style_text *text;
+ struct nk_style_button *button;
+ struct nk_style_toggle *toggle;
+ struct nk_style_selectable *select;
+ struct nk_style_slider *slider;
+ struct nk_style_progress *prog;
+ struct nk_style_scrollbar *scroll;
+ struct nk_style_edit *edit;
+ struct nk_style_property *property;
+ struct nk_style_combo *combo;
+ struct nk_style_chart *chart;
+ struct nk_style_tab *tab;
+ struct nk_style_window *win;
- r.x0 = r.x1 = 0;
- r.ymin = r.ymax = 0;
- r.num_chars = 0;
+ NK_ASSERT(ctx);
+ if (!ctx) return;
+ style = &ctx->style;
+ table = (!table) ? nk_default_color_style: table;
- /* search rows to find one that straddles 'y' */
- while (i < n) {
- nk_textedit_layout_row(&r, edit, i, row_height, font);
- if (r.num_chars <= 0)
- return n;
+ /* default text */
+ text = &style->text;
+ text->color = table[NK_COLOR_TEXT];
+ text->padding = nk_vec2(0,0);
- if (i==0 && y < base_y + r.ymin)
- return 0;
+ /* default button */
+ button = &style->button;
+ nk_zero_struct(*button);
+ button->normal = nk_style_item_color(table[NK_COLOR_BUTTON]);
+ button->hover = nk_style_item_color(table[NK_COLOR_BUTTON_HOVER]);
+ button->active = nk_style_item_color(table[NK_COLOR_BUTTON_ACTIVE]);
+ button->border_color = table[NK_COLOR_BORDER];
+ button->text_background = table[NK_COLOR_BUTTON];
+ button->text_normal = table[NK_COLOR_TEXT];
+ button->text_hover = table[NK_COLOR_TEXT];
+ button->text_active = table[NK_COLOR_TEXT];
+ button->padding = nk_vec2(2.0f,2.0f);
+ button->image_padding = nk_vec2(0.0f,0.0f);
+ button->touch_padding = nk_vec2(0.0f, 0.0f);
+ button->userdata = nk_handle_ptr(0);
+ button->text_alignment = NK_TEXT_CENTERED;
+ button->border = 1.0f;
+ button->rounding = 4.0f;
+ button->draw_begin = 0;
+ button->draw_end = 0;
- if (y < base_y + r.ymax)
- break;
+ /* contextual button */
+ button = &style->contextual_button;
+ nk_zero_struct(*button);
+ button->normal = nk_style_item_color(table[NK_COLOR_WINDOW]);
+ button->hover = nk_style_item_color(table[NK_COLOR_BUTTON_HOVER]);
+ button->active = nk_style_item_color(table[NK_COLOR_BUTTON_ACTIVE]);
+ button->border_color = table[NK_COLOR_WINDOW];
+ button->text_background = table[NK_COLOR_WINDOW];
+ button->text_normal = table[NK_COLOR_TEXT];
+ button->text_hover = table[NK_COLOR_TEXT];
+ button->text_active = table[NK_COLOR_TEXT];
+ button->padding = nk_vec2(2.0f,2.0f);
+ button->touch_padding = nk_vec2(0.0f,0.0f);
+ button->userdata = nk_handle_ptr(0);
+ button->text_alignment = NK_TEXT_CENTERED;
+ button->border = 0.0f;
+ button->rounding = 0.0f;
+ button->draw_begin = 0;
+ button->draw_end = 0;
- i += r.num_chars;
- base_y += r.baseline_y_delta;
- }
-
- /* below all text, return 'after' last character */
- if (i >= n)
- return n;
-
- /* check if it's before the beginning of the line */
- if (x < r.x0)
- return i;
-
- /* check if it's before the end of the line */
- if (x < r.x1) {
- /* search characters in row for one that straddles 'x' */
- k = i;
- prev_x = r.x0;
- for (i=0; i < r.num_chars; ++i) {
- float w = nk_textedit_get_width(edit, k, i, font);
- if (x < prev_x+w) {
- if (x < prev_x+w/2)
- return k+i;
- else return k+i+1;
- }
- prev_x += w;
- }
- /* shouldn't happen, but if it does, fall through to end-of-line case */
- }
+ /* menu button */
+ button = &style->menu_button;
+ nk_zero_struct(*button);
+ button->normal = nk_style_item_color(table[NK_COLOR_WINDOW]);
+ button->hover = nk_style_item_color(table[NK_COLOR_WINDOW]);
+ button->active = nk_style_item_color(table[NK_COLOR_WINDOW]);
+ button->border_color = table[NK_COLOR_WINDOW];
+ button->text_background = table[NK_COLOR_WINDOW];
+ button->text_normal = table[NK_COLOR_TEXT];
+ button->text_hover = table[NK_COLOR_TEXT];
+ button->text_active = table[NK_COLOR_TEXT];
+ button->padding = nk_vec2(2.0f,2.0f);
+ button->touch_padding = nk_vec2(0.0f,0.0f);
+ button->userdata = nk_handle_ptr(0);
+ button->text_alignment = NK_TEXT_CENTERED;
+ button->border = 0.0f;
+ button->rounding = 1.0f;
+ button->draw_begin = 0;
+ button->draw_end = 0;
- /* if the last character is a newline, return that.
- * otherwise return 'after' the last character */
- if (nk_str_rune_at(&edit->string, i+r.num_chars-1) == '\n')
- return i+r.num_chars-1;
- else return i+r.num_chars;
-}
+ /* checkbox toggle */
+ toggle = &style->checkbox;
+ nk_zero_struct(*toggle);
+ toggle->normal = nk_style_item_color(table[NK_COLOR_TOGGLE]);
+ toggle->hover = nk_style_item_color(table[NK_COLOR_TOGGLE_HOVER]);
+ toggle->active = nk_style_item_color(table[NK_COLOR_TOGGLE_HOVER]);
+ toggle->cursor_normal = nk_style_item_color(table[NK_COLOR_TOGGLE_CURSOR]);
+ toggle->cursor_hover = nk_style_item_color(table[NK_COLOR_TOGGLE_CURSOR]);
+ toggle->userdata = nk_handle_ptr(0);
+ toggle->text_background = table[NK_COLOR_WINDOW];
+ toggle->text_normal = table[NK_COLOR_TEXT];
+ toggle->text_hover = table[NK_COLOR_TEXT];
+ toggle->text_active = table[NK_COLOR_TEXT];
+ toggle->padding = nk_vec2(2.0f, 2.0f);
+ toggle->touch_padding = nk_vec2(0,0);
+ toggle->border_color = nk_rgba(0,0,0,0);
+ toggle->border = 0.0f;
+ toggle->spacing = 4;
-NK_INTERN void
-nk_textedit_click(struct nk_text_edit *state, float x, float y,
- const struct nk_user_font *font, float row_height)
-{
- /* API click: on mouse down, move the cursor to the clicked location,
- * and reset the selection */
- state->cursor = nk_textedit_locate_coord(state, x, y, font, row_height);
- state->select_start = state->cursor;
- state->select_end = state->cursor;
- state->has_preferred_x = 0;
-}
+ /* option toggle */
+ toggle = &style->option;
+ nk_zero_struct(*toggle);
+ toggle->normal = nk_style_item_color(table[NK_COLOR_TOGGLE]);
+ toggle->hover = nk_style_item_color(table[NK_COLOR_TOGGLE_HOVER]);
+ toggle->active = nk_style_item_color(table[NK_COLOR_TOGGLE_HOVER]);
+ toggle->cursor_normal = nk_style_item_color(table[NK_COLOR_TOGGLE_CURSOR]);
+ toggle->cursor_hover = nk_style_item_color(table[NK_COLOR_TOGGLE_CURSOR]);
+ toggle->userdata = nk_handle_ptr(0);
+ toggle->text_background = table[NK_COLOR_WINDOW];
+ toggle->text_normal = table[NK_COLOR_TEXT];
+ toggle->text_hover = table[NK_COLOR_TEXT];
+ toggle->text_active = table[NK_COLOR_TEXT];
+ toggle->padding = nk_vec2(3.0f, 3.0f);
+ toggle->touch_padding = nk_vec2(0,0);
+ toggle->border_color = nk_rgba(0,0,0,0);
+ toggle->border = 0.0f;
+ toggle->spacing = 4;
-NK_INTERN void
-nk_textedit_drag(struct nk_text_edit *state, float x, float y,
- const struct nk_user_font *font, float row_height)
-{
- /* API drag: on mouse drag, move the cursor and selection endpoint
- * to the clicked location */
- int p = nk_textedit_locate_coord(state, x, y, font, row_height);
- if (state->select_start == state->select_end)
- state->select_start = state->cursor;
- state->cursor = state->select_end = p;
-}
+ /* selectable */
+ select = &style->selectable;
+ nk_zero_struct(*select);
+ select->normal = nk_style_item_color(table[NK_COLOR_SELECT]);
+ select->hover = nk_style_item_color(table[NK_COLOR_SELECT]);
+ select->pressed = nk_style_item_color(table[NK_COLOR_SELECT]);
+ select->normal_active = nk_style_item_color(table[NK_COLOR_SELECT_ACTIVE]);
+ select->hover_active = nk_style_item_color(table[NK_COLOR_SELECT_ACTIVE]);
+ select->pressed_active = nk_style_item_color(table[NK_COLOR_SELECT_ACTIVE]);
+ select->text_normal = table[NK_COLOR_TEXT];
+ select->text_hover = table[NK_COLOR_TEXT];
+ select->text_pressed = table[NK_COLOR_TEXT];
+ select->text_normal_active = table[NK_COLOR_TEXT];
+ select->text_hover_active = table[NK_COLOR_TEXT];
+ select->text_pressed_active = table[NK_COLOR_TEXT];
+ select->padding = nk_vec2(2.0f,2.0f);
+ select->image_padding = nk_vec2(2.0f,2.0f);
+ select->touch_padding = nk_vec2(0,0);
+ select->userdata = nk_handle_ptr(0);
+ select->rounding = 0.0f;
+ select->draw_begin = 0;
+ select->draw_end = 0;
-NK_INTERN void
-nk_textedit_find_charpos(struct nk_text_find *find, struct nk_text_edit *state,
- int n, int single_line, const struct nk_user_font *font, float row_height)
-{
- /* find the x/y location of a character, and remember info about the previous
- * row in case we get a move-up event (for page up, we'll have to rescan) */
- struct nk_text_edit_row r;
- int prev_start = 0;
- int z = state->string.len;
- int i=0, first;
+ /* slider */
+ slider = &style->slider;
+ nk_zero_struct(*slider);
+ slider->normal = nk_style_item_hide();
+ slider->hover = nk_style_item_hide();
+ slider->active = nk_style_item_hide();
+ slider->bar_normal = table[NK_COLOR_SLIDER];
+ slider->bar_hover = table[NK_COLOR_SLIDER];
+ slider->bar_active = table[NK_COLOR_SLIDER];
+ slider->bar_filled = table[NK_COLOR_SLIDER_CURSOR];
+ slider->cursor_normal = nk_style_item_color(table[NK_COLOR_SLIDER_CURSOR]);
+ slider->cursor_hover = nk_style_item_color(table[NK_COLOR_SLIDER_CURSOR_HOVER]);
+ slider->cursor_active = nk_style_item_color(table[NK_COLOR_SLIDER_CURSOR_ACTIVE]);
+ slider->inc_symbol = NK_SYMBOL_TRIANGLE_RIGHT;
+ slider->dec_symbol = NK_SYMBOL_TRIANGLE_LEFT;
+ slider->cursor_size = nk_vec2(16,16);
+ slider->padding = nk_vec2(2,2);
+ slider->spacing = nk_vec2(2,2);
+ slider->userdata = nk_handle_ptr(0);
+ slider->show_buttons = nk_false;
+ slider->bar_height = 8;
+ slider->rounding = 0;
+ slider->draw_begin = 0;
+ slider->draw_end = 0;
- nk_zero_struct(r);
- if (n == z) {
- /* if it's at the end, then find the last line -- simpler than trying to
- explicitly handle this case in the regular code */
- nk_textedit_layout_row(&r, state, 0, row_height, font);
- if (single_line) {
- find->first_char = 0;
- find->length = z;
- } else {
- while (i < z) {
- prev_start = i;
- i += r.num_chars;
- nk_textedit_layout_row(&r, state, i, row_height, font);
- }
+ /* slider buttons */
+ button = &style->slider.inc_button;
+ button->normal = nk_style_item_color(nk_rgb(40,40,40));
+ button->hover = nk_style_item_color(nk_rgb(42,42,42));
+ button->active = nk_style_item_color(nk_rgb(44,44,44));
+ button->border_color = nk_rgb(65,65,65);
+ button->text_background = nk_rgb(40,40,40);
+ button->text_normal = nk_rgb(175,175,175);
+ button->text_hover = nk_rgb(175,175,175);
+ button->text_active = nk_rgb(175,175,175);
+ button->padding = nk_vec2(8.0f,8.0f);
+ button->touch_padding = nk_vec2(0.0f,0.0f);
+ button->userdata = nk_handle_ptr(0);
+ button->text_alignment = NK_TEXT_CENTERED;
+ button->border = 1.0f;
+ button->rounding = 0.0f;
+ button->draw_begin = 0;
+ button->draw_end = 0;
+ style->slider.dec_button = style->slider.inc_button;
- find->first_char = i;
- find->length = r.num_chars;
- }
- find->x = r.x1;
- find->y = r.ymin;
- find->height = r.ymax - r.ymin;
- find->prev_first = prev_start;
- return;
- }
+ /* progressbar */
+ prog = &style->progress;
+ nk_zero_struct(*prog);
+ prog->normal = nk_style_item_color(table[NK_COLOR_SLIDER]);
+ prog->hover = nk_style_item_color(table[NK_COLOR_SLIDER]);
+ prog->active = nk_style_item_color(table[NK_COLOR_SLIDER]);
+ prog->cursor_normal = nk_style_item_color(table[NK_COLOR_SLIDER_CURSOR]);
+ prog->cursor_hover = nk_style_item_color(table[NK_COLOR_SLIDER_CURSOR_HOVER]);
+ prog->cursor_active = nk_style_item_color(table[NK_COLOR_SLIDER_CURSOR_ACTIVE]);
+ prog->border_color = nk_rgba(0,0,0,0);
+ prog->cursor_border_color = nk_rgba(0,0,0,0);
+ prog->userdata = nk_handle_ptr(0);
+ prog->padding = nk_vec2(4,4);
+ prog->rounding = 0;
+ prog->border = 0;
+ prog->cursor_rounding = 0;
+ prog->cursor_border = 0;
+ prog->draw_begin = 0;
+ prog->draw_end = 0;
- /* search rows to find the one that straddles character n */
- find->y = 0;
+ /* scrollbars */
+ scroll = &style->scrollh;
+ nk_zero_struct(*scroll);
+ scroll->normal = nk_style_item_color(table[NK_COLOR_SCROLLBAR]);
+ scroll->hover = nk_style_item_color(table[NK_COLOR_SCROLLBAR]);
+ scroll->active = nk_style_item_color(table[NK_COLOR_SCROLLBAR]);
+ scroll->cursor_normal = nk_style_item_color(table[NK_COLOR_SCROLLBAR_CURSOR]);
+ scroll->cursor_hover = nk_style_item_color(table[NK_COLOR_SCROLLBAR_CURSOR_HOVER]);
+ scroll->cursor_active = nk_style_item_color(table[NK_COLOR_SCROLLBAR_CURSOR_ACTIVE]);
+ scroll->dec_symbol = NK_SYMBOL_CIRCLE_SOLID;
+ scroll->inc_symbol = NK_SYMBOL_CIRCLE_SOLID;
+ scroll->userdata = nk_handle_ptr(0);
+ scroll->border_color = table[NK_COLOR_SCROLLBAR];
+ scroll->cursor_border_color = table[NK_COLOR_SCROLLBAR];
+ scroll->padding = nk_vec2(0,0);
+ scroll->show_buttons = nk_false;
+ scroll->border = 0;
+ scroll->rounding = 0;
+ scroll->border_cursor = 0;
+ scroll->rounding_cursor = 0;
+ scroll->draw_begin = 0;
+ scroll->draw_end = 0;
+ style->scrollv = style->scrollh;
- for(;;) {
- nk_textedit_layout_row(&r, state, i, row_height, font);
- if (n < i + r.num_chars) break;
- prev_start = i;
- i += r.num_chars;
- find->y += r.baseline_y_delta;
- }
+ /* scrollbars buttons */
+ button = &style->scrollh.inc_button;
+ button->normal = nk_style_item_color(nk_rgb(40,40,40));
+ button->hover = nk_style_item_color(nk_rgb(42,42,42));
+ button->active = nk_style_item_color(nk_rgb(44,44,44));
+ button->border_color = nk_rgb(65,65,65);
+ button->text_background = nk_rgb(40,40,40);
+ button->text_normal = nk_rgb(175,175,175);
+ button->text_hover = nk_rgb(175,175,175);
+ button->text_active = nk_rgb(175,175,175);
+ button->padding = nk_vec2(4.0f,4.0f);
+ button->touch_padding = nk_vec2(0.0f,0.0f);
+ button->userdata = nk_handle_ptr(0);
+ button->text_alignment = NK_TEXT_CENTERED;
+ button->border = 1.0f;
+ button->rounding = 0.0f;
+ button->draw_begin = 0;
+ button->draw_end = 0;
+ style->scrollh.dec_button = style->scrollh.inc_button;
+ style->scrollv.inc_button = style->scrollh.inc_button;
+ style->scrollv.dec_button = style->scrollh.inc_button;
- find->first_char = first = i;
- find->length = r.num_chars;
- find->height = r.ymax - r.ymin;
- find->prev_first = prev_start;
+ /* edit */
+ edit = &style->edit;
+ nk_zero_struct(*edit);
+ edit->normal = nk_style_item_color(table[NK_COLOR_EDIT]);
+ edit->hover = nk_style_item_color(table[NK_COLOR_EDIT]);
+ edit->active = nk_style_item_color(table[NK_COLOR_EDIT]);
+ edit->cursor_normal = table[NK_COLOR_TEXT];
+ edit->cursor_hover = table[NK_COLOR_TEXT];
+ edit->cursor_text_normal= table[NK_COLOR_EDIT];
+ edit->cursor_text_hover = table[NK_COLOR_EDIT];
+ edit->border_color = table[NK_COLOR_BORDER];
+ edit->text_normal = table[NK_COLOR_TEXT];
+ edit->text_hover = table[NK_COLOR_TEXT];
+ edit->text_active = table[NK_COLOR_TEXT];
+ edit->selected_normal = table[NK_COLOR_TEXT];
+ edit->selected_hover = table[NK_COLOR_TEXT];
+ edit->selected_text_normal = table[NK_COLOR_EDIT];
+ edit->selected_text_hover = table[NK_COLOR_EDIT];
+ edit->scrollbar_size = nk_vec2(10,10);
+ edit->scrollbar = style->scrollv;
+ edit->padding = nk_vec2(4,4);
+ edit->row_padding = 2;
+ edit->cursor_size = 4;
+ edit->border = 1;
+ edit->rounding = 0;
- /* now scan to find xpos */
- find->x = r.x0;
- for (i=0; first+i < n; ++i)
- find->x += nk_textedit_get_width(state, first, i, font);
-}
+ /* property */
+ property = &style->property;
+ nk_zero_struct(*property);
+ property->normal = nk_style_item_color(table[NK_COLOR_PROPERTY]);
+ property->hover = nk_style_item_color(table[NK_COLOR_PROPERTY]);
+ property->active = nk_style_item_color(table[NK_COLOR_PROPERTY]);
+ property->border_color = table[NK_COLOR_BORDER];
+ property->label_normal = table[NK_COLOR_TEXT];
+ property->label_hover = table[NK_COLOR_TEXT];
+ property->label_active = table[NK_COLOR_TEXT];
+ property->sym_left = NK_SYMBOL_TRIANGLE_LEFT;
+ property->sym_right = NK_SYMBOL_TRIANGLE_RIGHT;
+ property->userdata = nk_handle_ptr(0);
+ property->padding = nk_vec2(4,4);
+ property->border = 1;
+ property->rounding = 10;
+ property->draw_begin = 0;
+ property->draw_end = 0;
-NK_INTERN void
-nk_textedit_clamp(struct nk_text_edit *state)
-{
- /* make the selection/cursor state valid if client altered the string */
- int n = state->string.len;
- if (NK_TEXT_HAS_SELECTION(state)) {
- if (state->select_start > n) state->select_start = n;
- if (state->select_end > n) state->select_end = n;
- /* if clamping forced them to be equal, move the cursor to match */
- if (state->select_start == state->select_end)
- state->cursor = state->select_start;
- }
- if (state->cursor > n) state->cursor = n;
-}
+ /* property buttons */
+ button = &style->property.dec_button;
+ nk_zero_struct(*button);
+ button->normal = nk_style_item_color(table[NK_COLOR_PROPERTY]);
+ button->hover = nk_style_item_color(table[NK_COLOR_PROPERTY]);
+ button->active = nk_style_item_color(table[NK_COLOR_PROPERTY]);
+ button->border_color = nk_rgba(0,0,0,0);
+ button->text_background = table[NK_COLOR_PROPERTY];
+ button->text_normal = table[NK_COLOR_TEXT];
+ button->text_hover = table[NK_COLOR_TEXT];
+ button->text_active = table[NK_COLOR_TEXT];
+ button->padding = nk_vec2(0.0f,0.0f);
+ button->touch_padding = nk_vec2(0.0f,0.0f);
+ button->userdata = nk_handle_ptr(0);
+ button->text_alignment = NK_TEXT_CENTERED;
+ button->border = 0.0f;
+ button->rounding = 0.0f;
+ button->draw_begin = 0;
+ button->draw_end = 0;
+ style->property.inc_button = style->property.dec_button;
-NK_API void
-nk_textedit_delete(struct nk_text_edit *state, int where, int len)
-{
- /* delete characters while updating undo */
- nk_textedit_makeundo_delete(state, where, len);
- nk_str_delete_runes(&state->string, where, len);
- state->has_preferred_x = 0;
-}
+ /* property edit */
+ edit = &style->property.edit;
+ nk_zero_struct(*edit);
+ edit->normal = nk_style_item_color(table[NK_COLOR_PROPERTY]);
+ edit->hover = nk_style_item_color(table[NK_COLOR_PROPERTY]);
+ edit->active = nk_style_item_color(table[NK_COLOR_PROPERTY]);
+ edit->border_color = nk_rgba(0,0,0,0);
+ edit->cursor_normal = table[NK_COLOR_TEXT];
+ edit->cursor_hover = table[NK_COLOR_TEXT];
+ edit->cursor_text_normal= table[NK_COLOR_EDIT];
+ edit->cursor_text_hover = table[NK_COLOR_EDIT];
+ edit->text_normal = table[NK_COLOR_TEXT];
+ edit->text_hover = table[NK_COLOR_TEXT];
+ edit->text_active = table[NK_COLOR_TEXT];
+ edit->selected_normal = table[NK_COLOR_TEXT];
+ edit->selected_hover = table[NK_COLOR_TEXT];
+ edit->selected_text_normal = table[NK_COLOR_EDIT];
+ edit->selected_text_hover = table[NK_COLOR_EDIT];
+ edit->padding = nk_vec2(0,0);
+ edit->cursor_size = 8;
+ edit->border = 0;
+ edit->rounding = 0;
-NK_API void
-nk_textedit_delete_selection(struct nk_text_edit *state)
-{
- /* delete the section */
- nk_textedit_clamp(state);
- if (NK_TEXT_HAS_SELECTION(state)) {
- if (state->select_start < state->select_end) {
- nk_textedit_delete(state, state->select_start,
- state->select_end - state->select_start);
- state->select_end = state->cursor = state->select_start;
- } else {
- nk_textedit_delete(state, state->select_end,
- state->select_start - state->select_end);
- state->select_start = state->cursor = state->select_end;
- }
- state->has_preferred_x = 0;
- }
-}
+ /* chart */
+ chart = &style->chart;
+ nk_zero_struct(*chart);
+ chart->background = nk_style_item_color(table[NK_COLOR_CHART]);
+ chart->border_color = table[NK_COLOR_BORDER];
+ chart->selected_color = table[NK_COLOR_CHART_COLOR_HIGHLIGHT];
+ chart->color = table[NK_COLOR_CHART_COLOR];
+ chart->padding = nk_vec2(4,4);
+ chart->border = 0;
+ chart->rounding = 0;
-NK_INTERN void
-nk_textedit_sortselection(struct nk_text_edit *state)
-{
- /* canonicalize the selection so start <= end */
- if (state->select_end < state->select_start) {
- int temp = state->select_end;
- state->select_end = state->select_start;
- state->select_start = temp;
- }
-}
+ /* combo */
+ combo = &style->combo;
+ combo->normal = nk_style_item_color(table[NK_COLOR_COMBO]);
+ combo->hover = nk_style_item_color(table[NK_COLOR_COMBO]);
+ combo->active = nk_style_item_color(table[NK_COLOR_COMBO]);
+ combo->border_color = table[NK_COLOR_BORDER];
+ combo->label_normal = table[NK_COLOR_TEXT];
+ combo->label_hover = table[NK_COLOR_TEXT];
+ combo->label_active = table[NK_COLOR_TEXT];
+ combo->sym_normal = NK_SYMBOL_TRIANGLE_DOWN;
+ combo->sym_hover = NK_SYMBOL_TRIANGLE_DOWN;
+ combo->sym_active = NK_SYMBOL_TRIANGLE_DOWN;
+ combo->content_padding = nk_vec2(4,4);
+ combo->button_padding = nk_vec2(0,4);
+ combo->spacing = nk_vec2(4,0);
+ combo->border = 1;
+ combo->rounding = 0;
-NK_INTERN void
-nk_textedit_move_to_first(struct nk_text_edit *state)
-{
- /* move cursor to first character of selection */
- if (NK_TEXT_HAS_SELECTION(state)) {
- nk_textedit_sortselection(state);
- state->cursor = state->select_start;
- state->select_end = state->select_start;
- state->has_preferred_x = 0;
- }
-}
+ /* combo button */
+ button = &style->combo.button;
+ nk_zero_struct(*button);
+ button->normal = nk_style_item_color(table[NK_COLOR_COMBO]);
+ button->hover = nk_style_item_color(table[NK_COLOR_COMBO]);
+ button->active = nk_style_item_color(table[NK_COLOR_COMBO]);
+ button->border_color = nk_rgba(0,0,0,0);
+ button->text_background = table[NK_COLOR_COMBO];
+ button->text_normal = table[NK_COLOR_TEXT];
+ button->text_hover = table[NK_COLOR_TEXT];
+ button->text_active = table[NK_COLOR_TEXT];
+ button->padding = nk_vec2(2.0f,2.0f);
+ button->touch_padding = nk_vec2(0.0f,0.0f);
+ button->userdata = nk_handle_ptr(0);
+ button->text_alignment = NK_TEXT_CENTERED;
+ button->border = 0.0f;
+ button->rounding = 0.0f;
+ button->draw_begin = 0;
+ button->draw_end = 0;
-NK_INTERN void
-nk_textedit_move_to_last(struct nk_text_edit *state)
-{
- /* move cursor to last character of selection */
- if (NK_TEXT_HAS_SELECTION(state)) {
- nk_textedit_sortselection(state);
- nk_textedit_clamp(state);
- state->cursor = state->select_end;
- state->select_start = state->select_end;
- state->has_preferred_x = 0;
- }
-}
+ /* tab */
+ tab = &style->tab;
+ tab->background = nk_style_item_color(table[NK_COLOR_TAB_HEADER]);
+ tab->border_color = table[NK_COLOR_BORDER];
+ tab->text = table[NK_COLOR_TEXT];
+ tab->sym_minimize = NK_SYMBOL_TRIANGLE_RIGHT;
+ tab->sym_maximize = NK_SYMBOL_TRIANGLE_DOWN;
+ tab->padding = nk_vec2(4,4);
+ tab->spacing = nk_vec2(4,4);
+ tab->indent = 10.0f;
+ tab->border = 1;
+ tab->rounding = 0;
-NK_INTERN int
-nk_is_word_boundary( struct nk_text_edit *state, int idx)
-{
- int len;
- nk_rune c;
- if (idx <= 0) return 1;
- if (!nk_str_at_rune(&state->string, idx, &c, &len)) return 1;
- return (c == ' ' || c == '\t' ||c == 0x3000 || c == ',' || c == ';' ||
- c == '(' || c == ')' || c == '{' || c == '}' || c == '[' || c == ']' ||
- c == '|');
-}
+ /* tab button */
+ button = &style->tab.tab_minimize_button;
+ nk_zero_struct(*button);
+ button->normal = nk_style_item_color(table[NK_COLOR_TAB_HEADER]);
+ button->hover = nk_style_item_color(table[NK_COLOR_TAB_HEADER]);
+ button->active = nk_style_item_color(table[NK_COLOR_TAB_HEADER]);
+ button->border_color = nk_rgba(0,0,0,0);
+ button->text_background = table[NK_COLOR_TAB_HEADER];
+ button->text_normal = table[NK_COLOR_TEXT];
+ button->text_hover = table[NK_COLOR_TEXT];
+ button->text_active = table[NK_COLOR_TEXT];
+ button->padding = nk_vec2(2.0f,2.0f);
+ button->touch_padding = nk_vec2(0.0f,0.0f);
+ button->userdata = nk_handle_ptr(0);
+ button->text_alignment = NK_TEXT_CENTERED;
+ button->border = 0.0f;
+ button->rounding = 0.0f;
+ button->draw_begin = 0;
+ button->draw_end = 0;
+ style->tab.tab_maximize_button =*button;
-NK_INTERN int
-nk_textedit_move_to_word_previous(struct nk_text_edit *state)
-{
- int c = state->cursor - 1;
- while( c >= 0 && !nk_is_word_boundary(state, c))
- --c;
+ /* node button */
+ button = &style->tab.node_minimize_button;
+ nk_zero_struct(*button);
+ button->normal = nk_style_item_color(table[NK_COLOR_WINDOW]);
+ button->hover = nk_style_item_color(table[NK_COLOR_WINDOW]);
+ button->active = nk_style_item_color(table[NK_COLOR_WINDOW]);
+ button->border_color = nk_rgba(0,0,0,0);
+ button->text_background = table[NK_COLOR_TAB_HEADER];
+ button->text_normal = table[NK_COLOR_TEXT];
+ button->text_hover = table[NK_COLOR_TEXT];
+ button->text_active = table[NK_COLOR_TEXT];
+ button->padding = nk_vec2(2.0f,2.0f);
+ button->touch_padding = nk_vec2(0.0f,0.0f);
+ button->userdata = nk_handle_ptr(0);
+ button->text_alignment = NK_TEXT_CENTERED;
+ button->border = 0.0f;
+ button->rounding = 0.0f;
+ button->draw_begin = 0;
+ button->draw_end = 0;
+ style->tab.node_maximize_button =*button;
- if( c < 0 )
- c = 0;
+ /* window header */
+ win = &style->window;
+ win->header.align = NK_HEADER_RIGHT;
+ win->header.close_symbol = NK_SYMBOL_X;
+ win->header.minimize_symbol = NK_SYMBOL_MINUS;
+ win->header.maximize_symbol = NK_SYMBOL_PLUS;
+ win->header.normal = nk_style_item_color(table[NK_COLOR_HEADER]);
+ win->header.hover = nk_style_item_color(table[NK_COLOR_HEADER]);
+ win->header.active = nk_style_item_color(table[NK_COLOR_HEADER]);
+ win->header.label_normal = table[NK_COLOR_TEXT];
+ win->header.label_hover = table[NK_COLOR_TEXT];
+ win->header.label_active = table[NK_COLOR_TEXT];
+ win->header.label_padding = nk_vec2(4,4);
+ win->header.padding = nk_vec2(4,4);
+ win->header.spacing = nk_vec2(0,0);
- return c;
-}
+ /* window header close button */
+ button = &style->window.header.close_button;
+ nk_zero_struct(*button);
+ button->normal = nk_style_item_color(table[NK_COLOR_HEADER]);
+ button->hover = nk_style_item_color(table[NK_COLOR_HEADER]);
+ button->active = nk_style_item_color(table[NK_COLOR_HEADER]);
+ button->border_color = nk_rgba(0,0,0,0);
+ button->text_background = table[NK_COLOR_HEADER];
+ button->text_normal = table[NK_COLOR_TEXT];
+ button->text_hover = table[NK_COLOR_TEXT];
+ button->text_active = table[NK_COLOR_TEXT];
+ button->padding = nk_vec2(0.0f,0.0f);
+ button->touch_padding = nk_vec2(0.0f,0.0f);
+ button->userdata = nk_handle_ptr(0);
+ button->text_alignment = NK_TEXT_CENTERED;
+ button->border = 0.0f;
+ button->rounding = 0.0f;
+ button->draw_begin = 0;
+ button->draw_end = 0;
-NK_INTERN int
-nk_textedit_move_to_word_next(struct nk_text_edit *state)
-{
- const int len = state->string.len;
- int c = state->cursor+1;
- while( c < len && !nk_is_word_boundary(state, c))
- ++c;
+ /* window header minimize button */
+ button = &style->window.header.minimize_button;
+ nk_zero_struct(*button);
+ button->normal = nk_style_item_color(table[NK_COLOR_HEADER]);
+ button->hover = nk_style_item_color(table[NK_COLOR_HEADER]);
+ button->active = nk_style_item_color(table[NK_COLOR_HEADER]);
+ button->border_color = nk_rgba(0,0,0,0);
+ button->text_background = table[NK_COLOR_HEADER];
+ button->text_normal = table[NK_COLOR_TEXT];
+ button->text_hover = table[NK_COLOR_TEXT];
+ button->text_active = table[NK_COLOR_TEXT];
+ button->padding = nk_vec2(0.0f,0.0f);
+ button->touch_padding = nk_vec2(0.0f,0.0f);
+ button->userdata = nk_handle_ptr(0);
+ button->text_alignment = NK_TEXT_CENTERED;
+ button->border = 0.0f;
+ button->rounding = 0.0f;
+ button->draw_begin = 0;
+ button->draw_end = 0;
- if( c > len )
- c = len;
+ /* window */
+ win->background = table[NK_COLOR_WINDOW];
+ win->fixed_background = nk_style_item_color(table[NK_COLOR_WINDOW]);
+ win->border_color = table[NK_COLOR_BORDER];
+ win->popup_border_color = table[NK_COLOR_BORDER];
+ win->combo_border_color = table[NK_COLOR_BORDER];
+ win->contextual_border_color = table[NK_COLOR_BORDER];
+ win->menu_border_color = table[NK_COLOR_BORDER];
+ win->group_border_color = table[NK_COLOR_BORDER];
+ win->tooltip_border_color = table[NK_COLOR_BORDER];
+ win->scaler = nk_style_item_color(table[NK_COLOR_TEXT]);
- return c;
-}
+ win->rounding = 0.0f;
+ win->spacing = nk_vec2(4,4);
+ win->scrollbar_size = nk_vec2(10,10);
+ win->min_size = nk_vec2(64,64);
-NK_INTERN void
-nk_textedit_prep_selection_at_cursor(struct nk_text_edit *state)
-{
- /* update selection and cursor to match each other */
- if (!NK_TEXT_HAS_SELECTION(state))
- state->select_start = state->select_end = state->cursor;
- else state->cursor = state->select_end;
-}
+ win->combo_border = 1.0f;
+ win->contextual_border = 1.0f;
+ win->menu_border = 1.0f;
+ win->group_border = 1.0f;
+ win->tooltip_border = 1.0f;
+ win->popup_border = 1.0f;
+ win->border = 2.0f;
+ win->min_row_height_padding = 8;
-NK_API int
-nk_textedit_cut(struct nk_text_edit *state)
-{
- /* API cut: delete selection */
- if (state->mode == NK_TEXT_EDIT_MODE_VIEW)
- return 0;
- if (NK_TEXT_HAS_SELECTION(state)) {
- nk_textedit_delete_selection(state); /* implicitly clamps */
- state->has_preferred_x = 0;
- return 1;
- }
- return 0;
+ win->padding = nk_vec2(4,4);
+ win->group_padding = nk_vec2(4,4);
+ win->popup_padding = nk_vec2(4,4);
+ win->combo_padding = nk_vec2(4,4);
+ win->contextual_padding = nk_vec2(4,4);
+ win->menu_padding = nk_vec2(4,4);
+ win->tooltip_padding = nk_vec2(4,4);
}
+NK_API void
+nk_style_set_font(struct nk_context *ctx, const struct nk_user_font *font)
+{
+ struct nk_style *style;
+ NK_ASSERT(ctx);
+ if (!ctx) return;
+ style = &ctx->style;
+ style->font = font;
+ ctx->stacks.fonts.head = 0;
+ if (ctx->current)
+ nk_layout_reset_min_row_height(ctx);
+}
NK_API int
-nk_textedit_paste(struct nk_text_edit *state, char const *ctext, int len)
+nk_style_push_font(struct nk_context *ctx, const struct nk_user_font *font)
{
- /* API paste: replace existing selection with passed-in text */
- int glyphs;
- const char *text = (const char *) ctext;
- if (state->mode == NK_TEXT_EDIT_MODE_VIEW) return 0;
+ struct nk_config_stack_user_font *font_stack;
+ struct nk_config_stack_user_font_element *element;
- /* if there's a selection, the paste should delete it */
- nk_textedit_clamp(state);
- nk_textedit_delete_selection(state);
+ NK_ASSERT(ctx);
+ if (!ctx) return 0;
- /* try to insert the characters */
- glyphs = nk_utf_len(ctext, len);
- if (nk_str_insert_text_char(&state->string, state->cursor, text, len)) {
- nk_textedit_makeundo_insert(state, state->cursor, glyphs);
- state->cursor += len;
- state->has_preferred_x = 0;
- return 1;
- }
- /* remove the undo since we didn't actually insert the characters */
- if (state->undo.undo_point)
- --state->undo.undo_point;
- return 0;
-}
+ font_stack = &ctx->stacks.fonts;
+ NK_ASSERT(font_stack->head < (int)NK_LEN(font_stack->elements));
+ if (font_stack->head >= (int)NK_LEN(font_stack->elements))
+ return 0;
-NK_API void
-nk_textedit_text(struct nk_text_edit *state, const char *text, int total_len)
+ element = &font_stack->elements[font_stack->head++];
+ element->address = &ctx->style.font;
+ element->old_value = ctx->style.font;
+ ctx->style.font = font;
+ return 1;
+}
+NK_API int
+nk_style_pop_font(struct nk_context *ctx)
{
- nk_rune unicode;
- int glyph_len;
- int text_len = 0;
+ struct nk_config_stack_user_font *font_stack;
+ struct nk_config_stack_user_font_element *element;
- NK_ASSERT(state);
- NK_ASSERT(text);
- if (!text || !total_len || state->mode == NK_TEXT_EDIT_MODE_VIEW) return;
+ NK_ASSERT(ctx);
+ if (!ctx) return 0;
- glyph_len = nk_utf_decode(text, &unicode, total_len);
- while ((text_len < total_len) && glyph_len)
- {
- /* don't insert a backward delete, just process the event */
- if (unicode == 127) goto next;
- /* can't add newline in single-line mode */
- if (unicode == '\n' && state->single_line) goto next;
- /* filter incoming text */
- if (state->filter && !state->filter(state, unicode)) goto next;
+ font_stack = &ctx->stacks.fonts;
+ NK_ASSERT(font_stack->head > 0);
+ if (font_stack->head < 1)
+ return 0;
- if (!NK_TEXT_HAS_SELECTION(state) &&
- state->cursor < state->string.len)
- {
- if (state->mode == NK_TEXT_EDIT_MODE_REPLACE) {
- nk_textedit_makeundo_replace(state, state->cursor, 1, 1);
- nk_str_delete_runes(&state->string, state->cursor, 1);
- }
- if (nk_str_insert_text_utf8(&state->string, state->cursor,
- text+text_len, 1))
- {
- ++state->cursor;
- state->has_preferred_x = 0;
- }
- } else {
- nk_textedit_delete_selection(state); /* implicitly clamps */
- if (nk_str_insert_text_utf8(&state->string, state->cursor,
- text+text_len, 1))
- {
- nk_textedit_makeundo_insert(state, state->cursor, 1);
- ++state->cursor;
- state->has_preferred_x = 0;
- }
- }
- next:
- text_len += glyph_len;
- glyph_len = nk_utf_decode(text + text_len, &unicode, total_len-text_len);
- }
+ element = &font_stack->elements[--font_stack->head];
+ *element->address = element->old_value;
+ return 1;
+}
+#define NK_STYLE_PUSH_IMPLEMENATION(prefix, type, stack) \
+nk_style_push_##type(struct nk_context *ctx, prefix##_##type *address, prefix##_##type value)\
+{\
+ struct nk_config_stack_##type * type_stack;\
+ struct nk_config_stack_##type##_element *element;\
+ NK_ASSERT(ctx);\
+ if (!ctx) return 0;\
+ type_stack = &ctx->stacks.stack;\
+ NK_ASSERT(type_stack->head < (int)NK_LEN(type_stack->elements));\
+ if (type_stack->head >= (int)NK_LEN(type_stack->elements))\
+ return 0;\
+ element = &type_stack->elements[type_stack->head++];\
+ element->address = address;\
+ element->old_value = *address;\
+ *address = value;\
+ return 1;\
+}
+#define NK_STYLE_POP_IMPLEMENATION(type, stack) \
+nk_style_pop_##type(struct nk_context *ctx)\
+{\
+ struct nk_config_stack_##type *type_stack;\
+ struct nk_config_stack_##type##_element *element;\
+ NK_ASSERT(ctx);\
+ if (!ctx) return 0;\
+ type_stack = &ctx->stacks.stack;\
+ NK_ASSERT(type_stack->head > 0);\
+ if (type_stack->head < 1)\
+ return 0;\
+ element = &type_stack->elements[--type_stack->head];\
+ *element->address = element->old_value;\
+ return 1;\
}
+NK_API int NK_STYLE_PUSH_IMPLEMENATION(struct nk, style_item, style_items)
+NK_API int NK_STYLE_PUSH_IMPLEMENATION(nk,float, floats)
+NK_API int NK_STYLE_PUSH_IMPLEMENATION(struct nk, vec2, vectors)
+NK_API int NK_STYLE_PUSH_IMPLEMENATION(nk,flags, flags)
+NK_API int NK_STYLE_PUSH_IMPLEMENATION(struct nk,color, colors)
-NK_INTERN void
-nk_textedit_key(struct nk_text_edit *state, enum nk_keys key, int shift_mod,
- const struct nk_user_font *font, float row_height)
-{
-retry:
- switch (key)
- {
- case NK_KEY_NONE:
- case NK_KEY_CTRL:
- case NK_KEY_ENTER:
- case NK_KEY_SHIFT:
- case NK_KEY_TAB:
- case NK_KEY_COPY:
- case NK_KEY_CUT:
- case NK_KEY_PASTE:
- case NK_KEY_MAX:
- default: break;
- case NK_KEY_TEXT_UNDO:
- nk_textedit_undo(state);
- state->has_preferred_x = 0;
- break;
+NK_API int NK_STYLE_POP_IMPLEMENATION(style_item, style_items)
+NK_API int NK_STYLE_POP_IMPLEMENATION(float,floats)
+NK_API int NK_STYLE_POP_IMPLEMENATION(vec2, vectors)
+NK_API int NK_STYLE_POP_IMPLEMENATION(flags,flags)
+NK_API int NK_STYLE_POP_IMPLEMENATION(color,colors)
- case NK_KEY_TEXT_REDO:
- nk_textedit_redo(state);
- state->has_preferred_x = 0;
- break;
+NK_API int
+nk_style_set_cursor(struct nk_context *ctx, enum nk_style_cursor c)
+{
+ struct nk_style *style;
+ NK_ASSERT(ctx);
+ if (!ctx) return 0;
+ style = &ctx->style;
+ if (style->cursors[c]) {
+ style->cursor_active = style->cursors[c];
+ return 1;
+ }
+ return 0;
+}
+NK_API void
+nk_style_show_cursor(struct nk_context *ctx)
+{
+ ctx->style.cursor_visible = nk_true;
+}
+NK_API void
+nk_style_hide_cursor(struct nk_context *ctx)
+{
+ ctx->style.cursor_visible = nk_false;
+}
+NK_API void
+nk_style_load_cursor(struct nk_context *ctx, enum nk_style_cursor cursor,
+ const struct nk_cursor *c)
+{
+ struct nk_style *style;
+ NK_ASSERT(ctx);
+ if (!ctx) return;
+ style = &ctx->style;
+ style->cursors[cursor] = c;
+}
+NK_API void
+nk_style_load_all_cursors(struct nk_context *ctx, struct nk_cursor *cursors)
+{
+ int i = 0;
+ struct nk_style *style;
+ NK_ASSERT(ctx);
+ if (!ctx) return;
+ style = &ctx->style;
+ for (i = 0; i < NK_CURSOR_COUNT; ++i)
+ style->cursors[i] = &cursors[i];
+ style->cursor_visible = nk_true;
+}
- case NK_KEY_TEXT_SELECT_ALL:
- nk_textedit_select_all(state);
- state->has_preferred_x = 0;
- break;
- case NK_KEY_TEXT_INSERT_MODE:
- if (state->mode == NK_TEXT_EDIT_MODE_VIEW)
- state->mode = NK_TEXT_EDIT_MODE_INSERT;
- break;
- case NK_KEY_TEXT_REPLACE_MODE:
- if (state->mode == NK_TEXT_EDIT_MODE_VIEW)
- state->mode = NK_TEXT_EDIT_MODE_REPLACE;
- break;
- case NK_KEY_TEXT_RESET_MODE:
- if (state->mode == NK_TEXT_EDIT_MODE_INSERT ||
- state->mode == NK_TEXT_EDIT_MODE_REPLACE)
- state->mode = NK_TEXT_EDIT_MODE_VIEW;
- break;
- case NK_KEY_LEFT:
- if (shift_mod) {
- nk_textedit_clamp(state);
- nk_textedit_prep_selection_at_cursor(state);
- /* move selection left */
- if (state->select_end > 0)
- --state->select_end;
- state->cursor = state->select_end;
- state->has_preferred_x = 0;
- } else {
- /* if currently there's a selection,
- * move cursor to start of selection */
- if (NK_TEXT_HAS_SELECTION(state))
- nk_textedit_move_to_first(state);
- else if (state->cursor > 0)
- --state->cursor;
- state->has_preferred_x = 0;
- } break;
- case NK_KEY_RIGHT:
- if (shift_mod) {
- nk_textedit_prep_selection_at_cursor(state);
- /* move selection right */
- ++state->select_end;
- nk_textedit_clamp(state);
- state->cursor = state->select_end;
- state->has_preferred_x = 0;
- } else {
- /* if currently there's a selection,
- * move cursor to end of selection */
- if (NK_TEXT_HAS_SELECTION(state))
- nk_textedit_move_to_last(state);
- else ++state->cursor;
- nk_textedit_clamp(state);
- state->has_preferred_x = 0;
- } break;
- case NK_KEY_TEXT_WORD_LEFT:
- if (shift_mod) {
- if( !NK_TEXT_HAS_SELECTION( state ) )
- nk_textedit_prep_selection_at_cursor(state);
- state->cursor = nk_textedit_move_to_word_previous(state);
- state->select_end = state->cursor;
- nk_textedit_clamp(state );
- } else {
- if (NK_TEXT_HAS_SELECTION(state))
- nk_textedit_move_to_first(state);
- else {
- state->cursor = nk_textedit_move_to_word_previous(state);
- nk_textedit_clamp(state );
- }
- } break;
+/* ==============================================================
+ *
+ * CONTEXT
+ *
+ * ===============================================================*/
+NK_INTERN void
+nk_setup(struct nk_context *ctx, const struct nk_user_font *font)
+{
+ NK_ASSERT(ctx);
+ if (!ctx) return;
+ nk_zero_struct(*ctx);
+ nk_style_default(ctx);
+ ctx->seq = 1;
+ if (font) ctx->style.font = font;
+#ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT
+ nk_draw_list_init(&ctx->draw_list);
+#endif
+}
+#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
+NK_API int
+nk_init_default(struct nk_context *ctx, const struct nk_user_font *font)
+{
+ struct nk_allocator alloc;
+ alloc.userdata.ptr = 0;
+ alloc.alloc = nk_malloc;
+ alloc.free = nk_mfree;
+ return nk_init(ctx, &alloc, font);
+}
+#endif
+NK_API int
+nk_init_fixed(struct nk_context *ctx, void *memory, nk_size size,
+ const struct nk_user_font *font)
+{
+ NK_ASSERT(memory);
+ if (!memory) return 0;
+ nk_setup(ctx, font);
+ nk_buffer_init_fixed(&ctx->memory, memory, size);
+ ctx->use_pool = nk_false;
+ return 1;
+}
+NK_API int
+nk_init_custom(struct nk_context *ctx, struct nk_buffer *cmds,
+ struct nk_buffer *pool, const struct nk_user_font *font)
+{
+ NK_ASSERT(cmds);
+ NK_ASSERT(pool);
+ if (!cmds || !pool) return 0;
- case NK_KEY_TEXT_WORD_RIGHT:
- if (shift_mod) {
- if( !NK_TEXT_HAS_SELECTION( state ) )
- nk_textedit_prep_selection_at_cursor(state);
- state->cursor = nk_textedit_move_to_word_next(state);
- state->select_end = state->cursor;
- nk_textedit_clamp(state);
- } else {
- if (NK_TEXT_HAS_SELECTION(state))
- nk_textedit_move_to_last(state);
- else {
- state->cursor = nk_textedit_move_to_word_next(state);
- nk_textedit_clamp(state );
- }
- } break;
-
- case NK_KEY_DOWN: {
- struct nk_text_find find;
- struct nk_text_edit_row row;
- int i, sel = shift_mod;
-
- if (state->single_line) {
- /* on windows, up&down in single-line behave like left&right */
- key = NK_KEY_RIGHT;
- goto retry;
- }
-
- if (sel)
- nk_textedit_prep_selection_at_cursor(state);
- else if (NK_TEXT_HAS_SELECTION(state))
- nk_textedit_move_to_last(state);
+ nk_setup(ctx, font);
+ ctx->memory = *cmds;
+ if (pool->type == NK_BUFFER_FIXED) {
+ /* take memory from buffer and alloc fixed pool */
+ nk_pool_init_fixed(&ctx->pool, pool->memory.ptr, pool->memory.size);
+ } else {
+ /* create dynamic pool from buffer allocator */
+ struct nk_allocator *alloc = &pool->pool;
+ nk_pool_init(&ctx->pool, alloc, NK_POOL_DEFAULT_CAPACITY);
+ }
+ ctx->use_pool = nk_true;
+ return 1;
+}
+NK_API int
+nk_init(struct nk_context *ctx, struct nk_allocator *alloc,
+ const struct nk_user_font *font)
+{
+ NK_ASSERT(alloc);
+ if (!alloc) return 0;
+ nk_setup(ctx, font);
+ nk_buffer_init(&ctx->memory, alloc, NK_DEFAULT_COMMAND_BUFFER_SIZE);
+ nk_pool_init(&ctx->pool, alloc, NK_POOL_DEFAULT_CAPACITY);
+ ctx->use_pool = nk_true;
+ return 1;
+}
+#ifdef NK_INCLUDE_COMMAND_USERDATA
+NK_API void
+nk_set_user_data(struct nk_context *ctx, nk_handle handle)
+{
+ if (!ctx) return;
+ ctx->userdata = handle;
+ if (ctx->current)
+ ctx->current->buffer.userdata = handle;
+}
+#endif
+NK_API void
+nk_free(struct nk_context *ctx)
+{
+ NK_ASSERT(ctx);
+ if (!ctx) return;
+ nk_buffer_free(&ctx->memory);
+ if (ctx->use_pool)
+ nk_pool_free(&ctx->pool);
- /* compute current position of cursor point */
- nk_textedit_clamp(state);
- nk_textedit_find_charpos(&find, state, state->cursor, state->single_line,
- font, row_height);
+ nk_zero(&ctx->input, sizeof(ctx->input));
+ nk_zero(&ctx->style, sizeof(ctx->style));
+ nk_zero(&ctx->memory, sizeof(ctx->memory));
- /* now find character position down a row */
- if (find.length)
- {
- float x;
- float goal_x = state->has_preferred_x ? state->preferred_x : find.x;
- int start = find.first_char + find.length;
+ ctx->seq = 0;
+ ctx->build = 0;
+ ctx->begin = 0;
+ ctx->end = 0;
+ ctx->active = 0;
+ ctx->current = 0;
+ ctx->freelist = 0;
+ ctx->count = 0;
+}
+NK_API void
+nk_clear(struct nk_context *ctx)
+{
+ struct nk_window *iter;
+ struct nk_window *next;
+ NK_ASSERT(ctx);
- state->cursor = start;
- nk_textedit_layout_row(&row, state, state->cursor, row_height, font);
- x = row.x0;
+ if (!ctx) return;
+ if (ctx->use_pool)
+ nk_buffer_clear(&ctx->memory);
+ else nk_buffer_reset(&ctx->memory, NK_BUFFER_FRONT);
- for (i=0; i < row.num_chars && x < row.x1; ++i) {
- float dx = nk_textedit_get_width(state, start, i, font);
- x += dx;
- if (x > goal_x)
- break;
- ++state->cursor;
- }
- nk_textedit_clamp(state);
+ ctx->build = 0;
+ ctx->memory.calls = 0;
+ ctx->last_widget_state = 0;
+ ctx->style.cursor_active = ctx->style.cursors[NK_CURSOR_ARROW];
+ NK_MEMSET(&ctx->overlay, 0, sizeof(ctx->overlay));
- state->has_preferred_x = 1;
- state->preferred_x = goal_x;
- if (sel)
- state->select_end = state->cursor;
+ /* garbage collector */
+ iter = ctx->begin;
+ while (iter) {
+ /* make sure valid minimized windows do not get removed */
+ if ((iter->flags & NK_WINDOW_MINIMIZED) &&
+ !(iter->flags & NK_WINDOW_CLOSED) &&
+ iter->seq == ctx->seq) {
+ iter = iter->next;
+ continue;
}
- } break;
+ /* remove hotness from hidden or closed windows*/
+ if (((iter->flags & NK_WINDOW_HIDDEN) ||
+ (iter->flags & NK_WINDOW_CLOSED)) &&
+ iter == ctx->active) {
+ ctx->active = iter->prev;
+ ctx->end = iter->prev;
+ if (!ctx->end)
+ ctx->begin = 0;
+ if (ctx->active)
+ ctx->active->flags &= ~(unsigned)NK_WINDOW_ROM;
+ }
+ /* free unused popup windows */
+ if (iter->popup.win && iter->popup.win->seq != ctx->seq) {
+ nk_free_window(ctx, iter->popup.win);
+ iter->popup.win = 0;
+ }
+ /* remove unused window state tables */
+ {struct nk_table *n, *it = iter->tables;
+ while (it) {
+ n = it->next;
+ if (it->seq != ctx->seq) {
+ nk_remove_table(iter, it);
+ nk_zero(it, sizeof(union nk_page_data));
+ nk_free_table(ctx, it);
+ if (it == iter->tables)
+ iter->tables = n;
+ } it = n;
+ }}
+ /* window itself is not used anymore so free */
+ if (iter->seq != ctx->seq || iter->flags & NK_WINDOW_CLOSED) {
+ next = iter->next;
+ nk_remove_window(ctx, iter);
+ nk_free_window(ctx, iter);
+ iter = next;
+ } else iter = iter->next;
+ }
+ ctx->seq++;
+}
+NK_LIB void
+nk_start_buffer(struct nk_context *ctx, struct nk_command_buffer *buffer)
+{
+ NK_ASSERT(ctx);
+ NK_ASSERT(buffer);
+ if (!ctx || !buffer) return;
+ buffer->begin = ctx->memory.allocated;
+ buffer->end = buffer->begin;
+ buffer->last = buffer->begin;
+ buffer->clip = nk_null_rect;
+}
+NK_LIB void
+nk_start(struct nk_context *ctx, struct nk_window *win)
+{
+ NK_ASSERT(ctx);
+ NK_ASSERT(win);
+ nk_start_buffer(ctx, &win->buffer);
+}
+NK_LIB void
+nk_start_popup(struct nk_context *ctx, struct nk_window *win)
+{
+ struct nk_popup_buffer *buf;
+ NK_ASSERT(ctx);
+ NK_ASSERT(win);
+ if (!ctx || !win) return;
- case NK_KEY_UP: {
- struct nk_text_find find;
- struct nk_text_edit_row row;
- int i, sel = shift_mod;
+ /* save buffer fill state for popup */
+ buf = &win->popup.buf;
+ buf->begin = win->buffer.end;
+ buf->end = win->buffer.end;
+ buf->parent = win->buffer.last;
+ buf->last = buf->begin;
+ buf->active = nk_true;
+}
+NK_LIB void
+nk_finish_popup(struct nk_context *ctx, struct nk_window *win)
+{
+ struct nk_popup_buffer *buf;
+ NK_ASSERT(ctx);
+ NK_ASSERT(win);
+ if (!ctx || !win) return;
- if (state->single_line) {
- /* on windows, up&down become left&right */
- key = NK_KEY_LEFT;
- goto retry;
- }
+ buf = &win->popup.buf;
+ buf->last = win->buffer.last;
+ buf->end = win->buffer.end;
+}
+NK_LIB void
+nk_finish_buffer(struct nk_context *ctx, struct nk_command_buffer *buffer)
+{
+ NK_ASSERT(ctx);
+ NK_ASSERT(buffer);
+ if (!ctx || !buffer) return;
+ buffer->end = ctx->memory.allocated;
+}
+NK_LIB void
+nk_finish(struct nk_context *ctx, struct nk_window *win)
+{
+ struct nk_popup_buffer *buf;
+ struct nk_command *parent_last;
+ void *memory;
- if (sel)
- nk_textedit_prep_selection_at_cursor(state);
- else if (NK_TEXT_HAS_SELECTION(state))
- nk_textedit_move_to_first(state);
+ NK_ASSERT(ctx);
+ NK_ASSERT(win);
+ if (!ctx || !win) return;
+ nk_finish_buffer(ctx, &win->buffer);
+ if (!win->popup.buf.active) return;
- /* compute current position of cursor point */
- nk_textedit_clamp(state);
- nk_textedit_find_charpos(&find, state, state->cursor, state->single_line,
- font, row_height);
+ buf = &win->popup.buf;
+ memory = ctx->memory.memory.ptr;
+ parent_last = nk_ptr_add(struct nk_command, memory, buf->parent);
+ parent_last->next = buf->end;
+}
+NK_LIB void
+nk_build(struct nk_context *ctx)
+{
+ struct nk_window *it = 0;
+ struct nk_command *cmd = 0;
+ nk_byte *buffer = 0;
- /* can only go up if there's a previous row */
- if (find.prev_first != find.first_char) {
- /* now find character position up a row */
- float x;
- float goal_x = state->has_preferred_x ? state->preferred_x : find.x;
+ /* draw cursor overlay */
+ if (!ctx->style.cursor_active)
+ ctx->style.cursor_active = ctx->style.cursors[NK_CURSOR_ARROW];
+ if (ctx->style.cursor_active && !ctx->input.mouse.grabbed && ctx->style.cursor_visible) {
+ struct nk_rect mouse_bounds;
+ const struct nk_cursor *cursor = ctx->style.cursor_active;
+ nk_command_buffer_init(&ctx->overlay, &ctx->memory, NK_CLIPPING_OFF);
+ nk_start_buffer(ctx, &ctx->overlay);
- state->cursor = find.prev_first;
- nk_textedit_layout_row(&row, state, state->cursor, row_height, font);
- x = row.x0;
+ mouse_bounds.x = ctx->input.mouse.pos.x - cursor->offset.x;
+ mouse_bounds.y = ctx->input.mouse.pos.y - cursor->offset.y;
+ mouse_bounds.w = cursor->size.x;
+ mouse_bounds.h = cursor->size.y;
- for (i=0; i < row.num_chars && x < row.x1; ++i) {
- float dx = nk_textedit_get_width(state, find.prev_first, i, font);
- x += dx;
- if (x > goal_x)
- break;
- ++state->cursor;
- }
- nk_textedit_clamp(state);
-
- state->has_preferred_x = 1;
- state->preferred_x = goal_x;
- if (sel) state->select_end = state->cursor;
- }
- } break;
-
- case NK_KEY_DEL:
- if (state->mode == NK_TEXT_EDIT_MODE_VIEW)
- break;
- if (NK_TEXT_HAS_SELECTION(state))
- nk_textedit_delete_selection(state);
- else {
- int n = state->string.len;
- if (state->cursor < n)
- nk_textedit_delete(state, state->cursor, 1);
- }
- state->has_preferred_x = 0;
- break;
-
- case NK_KEY_BACKSPACE:
- if (state->mode == NK_TEXT_EDIT_MODE_VIEW)
- break;
- if (NK_TEXT_HAS_SELECTION(state))
- nk_textedit_delete_selection(state);
- else {
- nk_textedit_clamp(state);
- if (state->cursor > 0) {
- nk_textedit_delete(state, state->cursor-1, 1);
- --state->cursor;
- }
- }
- state->has_preferred_x = 0;
- break;
-
- case NK_KEY_TEXT_START:
- if (shift_mod) {
- nk_textedit_prep_selection_at_cursor(state);
- state->cursor = state->select_end = 0;
- state->has_preferred_x = 0;
- } else {
- state->cursor = state->select_start = state->select_end = 0;
- state->has_preferred_x = 0;
- }
- break;
-
- case NK_KEY_TEXT_END:
- if (shift_mod) {
- nk_textedit_prep_selection_at_cursor(state);
- state->cursor = state->select_end = state->string.len;
- state->has_preferred_x = 0;
- } else {
- state->cursor = state->string.len;
- state->select_start = state->select_end = 0;
- state->has_preferred_x = 0;
- }
- break;
+ nk_draw_image(&ctx->overlay, mouse_bounds, &cursor->img, nk_white);
+ nk_finish_buffer(ctx, &ctx->overlay);
+ }
+ /* build one big draw command list out of all window buffers */
+ it = ctx->begin;
+ buffer = (nk_byte*)ctx->memory.memory.ptr;
+ while (it != 0) {
+ struct nk_window *next = it->next;
+ if (it->buffer.last == it->buffer.begin || (it->flags & NK_WINDOW_HIDDEN)||
+ it->seq != ctx->seq)
+ goto cont;
- case NK_KEY_TEXT_LINE_START: {
- if (shift_mod) {
- struct nk_text_find find;
- nk_textedit_clamp(state);
- nk_textedit_prep_selection_at_cursor(state);
- if (state->string.len && state->cursor == state->string.len)
- --state->cursor;
- nk_textedit_find_charpos(&find, state,state->cursor, state->single_line,
- font, row_height);
- state->cursor = state->select_end = find.first_char;
- state->has_preferred_x = 0;
- } else {
- struct nk_text_find find;
- if (state->string.len && state->cursor == state->string.len)
- --state->cursor;
- nk_textedit_clamp(state);
- nk_textedit_move_to_first(state);
- nk_textedit_find_charpos(&find, state, state->cursor, state->single_line,
- font, row_height);
- state->cursor = find.first_char;
- state->has_preferred_x = 0;
- }
- } break;
+ cmd = nk_ptr_add(struct nk_command, buffer, it->buffer.last);
+ while (next && ((next->buffer.last == next->buffer.begin) ||
+ (next->flags & NK_WINDOW_HIDDEN) || next->seq != ctx->seq))
+ next = next->next; /* skip empty command buffers */
- case NK_KEY_TEXT_LINE_END: {
- if (shift_mod) {
- struct nk_text_find find;
- nk_textedit_clamp(state);
- nk_textedit_prep_selection_at_cursor(state);
- nk_textedit_find_charpos(&find, state, state->cursor, state->single_line,
- font, row_height);
- state->has_preferred_x = 0;
- state->cursor = find.first_char + find.length;
- if (find.length > 0 && nk_str_rune_at(&state->string, state->cursor-1) == '\n')
- --state->cursor;
- state->select_end = state->cursor;
- } else {
- struct nk_text_find find;
- nk_textedit_clamp(state);
- nk_textedit_move_to_first(state);
- nk_textedit_find_charpos(&find, state, state->cursor, state->single_line,
- font, row_height);
+ if (next) cmd->next = next->buffer.begin;
+ cont: it = next;
+ }
+ /* append all popup draw commands into lists */
+ it = ctx->begin;
+ while (it != 0) {
+ struct nk_window *next = it->next;
+ struct nk_popup_buffer *buf;
+ if (!it->popup.buf.active)
+ goto skip;
- state->has_preferred_x = 0;
- state->cursor = find.first_char + find.length;
- if (find.length > 0 && nk_str_rune_at(&state->string, state->cursor-1) == '\n')
- --state->cursor;
- }} break;
+ buf = &it->popup.buf;
+ cmd->next = buf->begin;
+ cmd = nk_ptr_add(struct nk_command, buffer, buf->last);
+ buf->active = nk_false;
+ skip: it = next;
+ }
+ if (cmd) {
+ /* append overlay commands */
+ if (ctx->overlay.end != ctx->overlay.begin)
+ cmd->next = ctx->overlay.begin;
+ else cmd->next = ctx->memory.allocated;
}
}
-
-NK_INTERN void
-nk_textedit_flush_redo(struct nk_text_undo_state *state)
+NK_API const struct nk_command*
+nk__begin(struct nk_context *ctx)
{
- state->redo_point = NK_TEXTEDIT_UNDOSTATECOUNT;
- state->redo_char_point = NK_TEXTEDIT_UNDOCHARCOUNT;
-}
+ struct nk_window *iter;
+ nk_byte *buffer;
+ NK_ASSERT(ctx);
+ if (!ctx) return 0;
+ if (!ctx->count) return 0;
-NK_INTERN void
-nk_textedit_discard_undo(struct nk_text_undo_state *state)
-{
- /* discard the oldest entry in the undo list */
- if (state->undo_point > 0) {
- /* if the 0th undo state has characters, clean those up */
- if (state->undo_rec[0].char_storage >= 0) {
- int n = state->undo_rec[0].insert_length, i;
- /* delete n characters from all other records */
- state->undo_char_point = (short)(state->undo_char_point - n);
- NK_MEMCPY(state->undo_char, state->undo_char + n,
- (nk_size)state->undo_char_point*sizeof(nk_rune));
- for (i=0; i < state->undo_point; ++i) {
- if (state->undo_rec[i].char_storage >= 0)
- state->undo_rec[i].char_storage = (short)
- (state->undo_rec[i].char_storage - n);
- }
- }
- --state->undo_point;
- NK_MEMCPY(state->undo_rec, state->undo_rec+1,
- (nk_size)((nk_size)state->undo_point * sizeof(state->undo_rec[0])));
+ buffer = (nk_byte*)ctx->memory.memory.ptr;
+ if (!ctx->build) {
+ nk_build(ctx);
+ ctx->build = nk_true;
}
+ iter = ctx->begin;
+ while (iter && ((iter->buffer.begin == iter->buffer.end) ||
+ (iter->flags & NK_WINDOW_HIDDEN) || iter->seq != ctx->seq))
+ iter = iter->next;
+ if (!iter) return 0;
+ return nk_ptr_add_const(struct nk_command, buffer, iter->buffer.begin);
}
-NK_INTERN void
-nk_textedit_discard_redo(struct nk_text_undo_state *state)
+NK_API const struct nk_command*
+nk__next(struct nk_context *ctx, const struct nk_command *cmd)
{
-/* discard the oldest entry in the redo list--it's bad if this
- ever happens, but because undo & redo have to store the actual
- characters in different cases, the redo character buffer can
- fill up even though the undo buffer didn't */
- nk_size num;
- int k = NK_TEXTEDIT_UNDOSTATECOUNT-1;
- if (state->redo_point <= k) {
- /* if the k'th undo state has characters, clean those up */
- if (state->undo_rec[k].char_storage >= 0) {
- int n = state->undo_rec[k].insert_length, i;
- /* delete n characters from all other records */
- state->redo_char_point = (short)(state->redo_char_point + n);
- num = (nk_size)(NK_TEXTEDIT_UNDOCHARCOUNT - state->redo_char_point);
- NK_MEMCPY(state->undo_char + state->redo_char_point,
- state->undo_char + state->redo_char_point-n, num * sizeof(char));
- for (i = state->redo_point; i < k; ++i) {
- if (state->undo_rec[i].char_storage >= 0) {
- state->undo_rec[i].char_storage = (short)
- (state->undo_rec[i].char_storage + n);
- }
- }
- }
- ++state->redo_point;
- num = (nk_size)(NK_TEXTEDIT_UNDOSTATECOUNT - state->redo_point);
- if (num) NK_MEMCPY(state->undo_rec + state->redo_point-1,
- state->undo_rec + state->redo_point, num * sizeof(state->undo_rec[0]));
- }
+ nk_byte *buffer;
+ const struct nk_command *next;
+ NK_ASSERT(ctx);
+ if (!ctx || !cmd || !ctx->count) return 0;
+ if (cmd->next >= ctx->memory.allocated) return 0;
+ buffer = (nk_byte*)ctx->memory.memory.ptr;
+ next = nk_ptr_add_const(struct nk_command, buffer, cmd->next);
+ return next;
}
-NK_INTERN struct nk_text_undo_record*
-nk_textedit_create_undo_record(struct nk_text_undo_state *state, int numchars)
-{
- /* any time we create a new undo record, we discard redo*/
- nk_textedit_flush_redo(state);
-
- /* if we have no free records, we have to make room,
- * by sliding the existing records down */
- if (state->undo_point == NK_TEXTEDIT_UNDOSTATECOUNT)
- nk_textedit_discard_undo(state);
-
- /* if the characters to store won't possibly fit in the buffer,
- * we can't undo */
- if (numchars > NK_TEXTEDIT_UNDOCHARCOUNT) {
- state->undo_point = 0;
- state->undo_char_point = 0;
- return 0;
- }
- /* if we don't have enough free characters in the buffer,
- * we have to make room */
- while (state->undo_char_point + numchars > NK_TEXTEDIT_UNDOCHARCOUNT)
- nk_textedit_discard_undo(state);
- return &state->undo_rec[state->undo_point++];
-}
-NK_INTERN nk_rune*
-nk_textedit_createundo(struct nk_text_undo_state *state, int pos,
- int insert_len, int delete_len)
-{
- struct nk_text_undo_record *r = nk_textedit_create_undo_record(state, insert_len);
- if (r == 0)
- return 0;
- r->where = pos;
- r->insert_length = (short) insert_len;
- r->delete_length = (short) delete_len;
- if (insert_len == 0) {
- r->char_storage = -1;
- return 0;
- } else {
- r->char_storage = state->undo_char_point;
- state->undo_char_point = (short)(state->undo_char_point + insert_len);
- return &state->undo_char[r->char_storage];
- }
-}
-NK_API void
-nk_textedit_undo(struct nk_text_edit *state)
-{
- struct nk_text_undo_state *s = &state->undo;
- struct nk_text_undo_record u, *r;
- if (s->undo_point == 0)
- return;
+/* ===============================================================
+ *
+ * POOL
+ *
+ * ===============================================================*/
+NK_LIB void
+nk_pool_init(struct nk_pool *pool, struct nk_allocator *alloc,
+ unsigned int capacity)
+{
+ nk_zero(pool, sizeof(*pool));
+ pool->alloc = *alloc;
+ pool->capacity = capacity;
+ pool->type = NK_BUFFER_DYNAMIC;
+ pool->pages = 0;
+}
+NK_LIB void
+nk_pool_free(struct nk_pool *pool)
+{
+ struct nk_page *iter = pool->pages;
+ if (!pool) return;
+ if (pool->type == NK_BUFFER_FIXED) return;
+ while (iter) {
+ struct nk_page *next = iter->next;
+ pool->alloc.free(pool->alloc.userdata, iter);
+ iter = next;
+ }
+}
+NK_LIB void
+nk_pool_init_fixed(struct nk_pool *pool, void *memory, nk_size size)
+{
+ nk_zero(pool, sizeof(*pool));
+ NK_ASSERT(size >= sizeof(struct nk_page));
+ if (size < sizeof(struct nk_page)) return;
+ pool->capacity = (unsigned)(size - sizeof(struct nk_page)) / sizeof(struct nk_page_element);
+ pool->pages = (struct nk_page*)memory;
+ pool->type = NK_BUFFER_FIXED;
+ pool->size = size;
+}
+NK_LIB struct nk_page_element*
+nk_pool_alloc(struct nk_pool *pool)
+{
+ if (!pool->pages || pool->pages->size >= pool->capacity) {
+ /* allocate new page */
+ struct nk_page *page;
+ if (pool->type == NK_BUFFER_FIXED) {
+ NK_ASSERT(pool->pages);
+ if (!pool->pages) return 0;
+ NK_ASSERT(pool->pages->size < pool->capacity);
+ return 0;
+ } else {
+ nk_size size = sizeof(struct nk_page);
+ size += NK_POOL_DEFAULT_CAPACITY * sizeof(union nk_page_data);
+ page = (struct nk_page*)pool->alloc.alloc(pool->alloc.userdata,0, size);
+ page->next = pool->pages;
+ pool->pages = page;
+ page->size = 0;
+ }
+ } return &pool->pages->win[pool->pages->size++];
+}
- /* we need to do two things: apply the undo record, and create a redo record */
- u = s->undo_rec[s->undo_point-1];
- r = &s->undo_rec[s->redo_point-1];
- r->char_storage = -1;
- r->insert_length = u.delete_length;
- r->delete_length = u.insert_length;
- r->where = u.where;
- if (u.delete_length)
- {
- /* if the undo record says to delete characters, then the redo record will
- need to re-insert the characters that get deleted, so we need to store
- them.
- there are three cases:
- - there's enough room to store the characters
- - characters stored for *redoing* don't leave room for redo
- - characters stored for *undoing* don't leave room for redo
- if the last is true, we have to bail */
- if (s->undo_char_point + u.delete_length >= NK_TEXTEDIT_UNDOCHARCOUNT) {
- /* the undo records take up too much character space; there's no space
- * to store the redo characters */
- r->insert_length = 0;
- } else {
- int i;
- /* there's definitely room to store the characters eventually */
- while (s->undo_char_point + u.delete_length > s->redo_char_point) {
- /* there's currently not enough room, so discard a redo record */
- nk_textedit_discard_redo(s);
- /* should never happen: */
- if (s->redo_point == NK_TEXTEDIT_UNDOSTATECOUNT)
- return;
- }
- r = &s->undo_rec[s->redo_point-1];
- r->char_storage = (short)(s->redo_char_point - u.delete_length);
- s->redo_char_point = (short)(s->redo_char_point - u.delete_length);
- /* now save the characters */
- for (i=0; i < u.delete_length; ++i)
- s->undo_char[r->char_storage + i] =
- nk_str_rune_at(&state->string, u.where + i);
- }
- /* now we can carry out the deletion */
- nk_str_delete_runes(&state->string, u.where, u.delete_length);
+/* ===============================================================
+ *
+ * PAGE ELEMENT
+ *
+ * ===============================================================*/
+NK_LIB struct nk_page_element*
+nk_create_page_element(struct nk_context *ctx)
+{
+ struct nk_page_element *elem;
+ if (ctx->freelist) {
+ /* unlink page element from free list */
+ elem = ctx->freelist;
+ ctx->freelist = elem->next;
+ } else if (ctx->use_pool) {
+ /* allocate page element from memory pool */
+ elem = nk_pool_alloc(&ctx->pool);
+ NK_ASSERT(elem);
+ if (!elem) return 0;
+ } else {
+ /* allocate new page element from back of fixed size memory buffer */
+ NK_STORAGE const nk_size size = sizeof(struct nk_page_element);
+ NK_STORAGE const nk_size align = NK_ALIGNOF(struct nk_page_element);
+ elem = (struct nk_page_element*)nk_buffer_alloc(&ctx->memory, NK_BUFFER_BACK, size, align);
+ NK_ASSERT(elem);
+ if (!elem) return 0;
}
-
- /* check type of recorded action: */
- if (u.insert_length) {
- /* easy case: was a deletion, so we need to insert n characters */
- nk_str_insert_text_runes(&state->string, u.where,
- &s->undo_char[u.char_storage], u.insert_length);
- s->undo_char_point = (short)(s->undo_char_point - u.insert_length);
+ nk_zero_struct(*elem);
+ elem->next = 0;
+ elem->prev = 0;
+ return elem;
+}
+NK_LIB void
+nk_link_page_element_into_freelist(struct nk_context *ctx,
+ struct nk_page_element *elem)
+{
+ /* link table into freelist */
+ if (!ctx->freelist) {
+ ctx->freelist = elem;
+ } else {
+ elem->next = ctx->freelist;
+ ctx->freelist = elem;
}
- state->cursor = (short)(u.where + u.insert_length);
-
- s->undo_point--;
- s->redo_point--;
}
-
-NK_API void
-nk_textedit_redo(struct nk_text_edit *state)
+NK_LIB void
+nk_free_page_element(struct nk_context *ctx, struct nk_page_element *elem)
{
- struct nk_text_undo_state *s = &state->undo;
- struct nk_text_undo_record *u, r;
- if (s->redo_point == NK_TEXTEDIT_UNDOSTATECOUNT)
+ /* we have a pool so just add to free list */
+ if (ctx->use_pool) {
+ nk_link_page_element_into_freelist(ctx, elem);
return;
+ }
+ /* if possible remove last element from back of fixed memory buffer */
+ {void *elem_end = (void*)(elem + 1);
+ void *buffer_end = (nk_byte*)ctx->memory.memory.ptr + ctx->memory.size;
+ if (elem_end == buffer_end)
+ ctx->memory.size -= sizeof(struct nk_page_element);
+ else nk_link_page_element_into_freelist(ctx, elem);}
+}
- /* we need to do two things: apply the redo record, and create an undo record */
- u = &s->undo_rec[s->undo_point];
- r = s->undo_rec[s->redo_point];
-
- /* we KNOW there must be room for the undo record, because the redo record
- was derived from an undo record */
- u->delete_length = r.insert_length;
- u->insert_length = r.delete_length;
- u->where = r.where;
- u->char_storage = -1;
-
- if (r.delete_length) {
- /* the redo record requires us to delete characters, so the undo record
- needs to store the characters */
- if (s->undo_char_point + u->insert_length > s->redo_char_point) {
- u->insert_length = 0;
- u->delete_length = 0;
- } else {
- int i;
- u->char_storage = s->undo_char_point;
- s->undo_char_point = (short)(s->undo_char_point + u->insert_length);
- /* now save the characters */
- for (i=0; i < u->insert_length; ++i) {
- s->undo_char[u->char_storage + i] =
- nk_str_rune_at(&state->string, u->where + i);
- }
- }
- nk_str_delete_runes(&state->string, r.where, r.delete_length);
- }
- if (r.insert_length) {
- /* easy case: need to insert n characters */
- nk_str_insert_text_runes(&state->string, r.where,
- &s->undo_char[r.char_storage], r.insert_length);
- }
- state->cursor = r.where + r.insert_length;
- s->undo_point++;
- s->redo_point++;
-}
-NK_INTERN void
-nk_textedit_makeundo_insert(struct nk_text_edit *state, int where, int length)
+/* ===============================================================
+ *
+ * TABLE
+ *
+ * ===============================================================*/
+NK_LIB struct nk_table*
+nk_create_table(struct nk_context *ctx)
{
- nk_textedit_createundo(&state->undo, where, 0, length);
+ struct nk_page_element *elem;
+ elem = nk_create_page_element(ctx);
+ if (!elem) return 0;
+ nk_zero_struct(*elem);
+ return &elem->data.tbl;
}
-
-NK_INTERN void
-nk_textedit_makeundo_delete(struct nk_text_edit *state, int where, int length)
+NK_LIB void
+nk_free_table(struct nk_context *ctx, struct nk_table *tbl)
{
- int i;
- nk_rune *p = nk_textedit_createundo(&state->undo, where, length, 0);
- if (p) {
- for (i=0; i < length; ++i)
- p[i] = nk_str_rune_at(&state->string, where+i);
- }
+ union nk_page_data *pd = NK_CONTAINER_OF(tbl, union nk_page_data, tbl);
+ struct nk_page_element *pe = NK_CONTAINER_OF(pd, struct nk_page_element, data);
+ nk_free_page_element(ctx, pe);
}
-
-NK_INTERN void
-nk_textedit_makeundo_replace(struct nk_text_edit *state, int where,
- int old_length, int new_length)
+NK_LIB void
+nk_push_table(struct nk_window *win, struct nk_table *tbl)
{
- int i;
- nk_rune *p = nk_textedit_createundo(&state->undo, where, old_length, new_length);
- if (p) {
- for (i=0; i < old_length; ++i)
- p[i] = nk_str_rune_at(&state->string, where+i);
+ if (!win->tables) {
+ win->tables = tbl;
+ tbl->next = 0;
+ tbl->prev = 0;
+ tbl->size = 0;
+ win->table_count = 1;
+ return;
}
+ win->tables->prev = tbl;
+ tbl->next = win->tables;
+ tbl->prev = 0;
+ tbl->size = 0;
+ win->tables = tbl;
+ win->table_count++;
}
-
-NK_INTERN void
-nk_textedit_clear_state(struct nk_text_edit *state, enum nk_text_edit_type type,
- nk_plugin_filter filter)
+NK_LIB void
+nk_remove_table(struct nk_window *win, struct nk_table *tbl)
{
- /* reset the state to default */
- state->undo.undo_point = 0;
- state->undo.undo_char_point = 0;
- state->undo.redo_point = NK_TEXTEDIT_UNDOSTATECOUNT;
- state->undo.redo_char_point = NK_TEXTEDIT_UNDOCHARCOUNT;
- state->select_end = state->select_start = 0;
- state->cursor = 0;
- state->has_preferred_x = 0;
- state->preferred_x = 0;
- state->cursor_at_end_of_line = 0;
- state->initialized = 1;
- state->single_line = (unsigned char)(type == NK_TEXT_EDIT_SINGLE_LINE);
- state->mode = NK_TEXT_EDIT_MODE_VIEW;
- state->filter = filter;
- state->scrollbar = nk_vec2(0,0);
+ if (win->tables == tbl)
+ win->tables = tbl->next;
+ if (tbl->next)
+ tbl->next->prev = tbl->prev;
+ if (tbl->prev)
+ tbl->prev->next = tbl->next;
+ tbl->next = 0;
+ tbl->prev = 0;
}
-
-NK_API void
-nk_textedit_init_fixed(struct nk_text_edit *state, void *memory, nk_size size)
+NK_LIB nk_uint*
+nk_add_value(struct nk_context *ctx, struct nk_window *win,
+ nk_hash name, nk_uint value)
{
- NK_ASSERT(state);
- NK_ASSERT(memory);
- if (!state || !memory || !size) return;
- NK_MEMSET(state, 0, sizeof(struct nk_text_edit));
- nk_textedit_clear_state(state, NK_TEXT_EDIT_SINGLE_LINE, 0);
- nk_str_init_fixed(&state->string, memory, size);
+ NK_ASSERT(ctx);
+ NK_ASSERT(win);
+ if (!win || !ctx) return 0;
+ if (!win->tables || win->tables->size >= NK_VALUE_PAGE_CAPACITY) {
+ struct nk_table *tbl = nk_create_table(ctx);
+ NK_ASSERT(tbl);
+ if (!tbl) return 0;
+ nk_push_table(win, tbl);
+ }
+ win->tables->seq = win->seq;
+ win->tables->keys[win->tables->size] = name;
+ win->tables->values[win->tables->size] = value;
+ return &win->tables->values[win->tables->size++];
}
-
-NK_API void
-nk_textedit_init(struct nk_text_edit *state, struct nk_allocator *alloc, nk_size size)
+NK_LIB nk_uint*
+nk_find_value(struct nk_window *win, nk_hash name)
{
- NK_ASSERT(state);
- NK_ASSERT(alloc);
- if (!state || !alloc) return;
- NK_MEMSET(state, 0, sizeof(struct nk_text_edit));
- nk_textedit_clear_state(state, NK_TEXT_EDIT_SINGLE_LINE, 0);
- nk_str_init(&state->string, alloc, size);
+ struct nk_table *iter = win->tables;
+ while (iter) {
+ unsigned int i = 0;
+ unsigned int size = iter->size;
+ for (i = 0; i < size; ++i) {
+ if (iter->keys[i] == name) {
+ iter->seq = win->seq;
+ return &iter->values[i];
+ }
+ } size = NK_VALUE_PAGE_CAPACITY;
+ iter = iter->next;
+ }
+ return 0;
}
-#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
-NK_API void
-nk_textedit_init_default(struct nk_text_edit *state)
-{
- NK_ASSERT(state);
- if (!state) return;
- NK_MEMSET(state, 0, sizeof(struct nk_text_edit));
- nk_textedit_clear_state(state, NK_TEXT_EDIT_SINGLE_LINE, 0);
- nk_str_init_default(&state->string);
-}
-#endif
-NK_API void
-nk_textedit_select_all(struct nk_text_edit *state)
-{
- NK_ASSERT(state);
- state->select_start = 0;
- state->select_end = state->string.len;
-}
-NK_API void
-nk_textedit_free(struct nk_text_edit *state)
-{
- NK_ASSERT(state);
- if (!state) return;
- nk_str_free(&state->string);
-}
+
/* ===============================================================
*
- * TEXT WIDGET
+ * PANEL
*
* ===============================================================*/
-#define nk_widget_state_reset(s)\
- if ((*(s)) & NK_WIDGET_STATE_MODIFIED)\
- (*(s)) = NK_WIDGET_STATE_INACTIVE|NK_WIDGET_STATE_MODIFIED;\
- else (*(s)) = NK_WIDGET_STATE_INACTIVE;
-
-struct nk_text {
- struct nk_vec2 padding;
- struct nk_color background;
- struct nk_color text;
-};
-
-NK_INTERN void
-nk_widget_text(struct nk_command_buffer *o, struct nk_rect b,
- const char *string, int len, const struct nk_text *t,
- nk_flags a, const struct nk_user_font *f)
+NK_LIB void*
+nk_create_panel(struct nk_context *ctx)
{
- struct nk_rect label;
- float text_width;
-
- NK_ASSERT(o);
- NK_ASSERT(t);
- if (!o || !t) return;
-
- b.h = NK_MAX(b.h, 2 * t->padding.y);
- label.x = 0; label.w = 0;
- label.y = b.y + t->padding.y;
- label.h = NK_MIN(f->height, b.h - 2 * t->padding.y);
-
- text_width = f->width(f->userdata, f->height, (const char*)string, len);
- text_width += (2.0f * t->padding.x);
-
- /* align in x-axis */
- if (a & NK_TEXT_ALIGN_LEFT) {
- label.x = b.x + t->padding.x;
- label.w = NK_MAX(0, b.w - 2 * t->padding.x);
- } else if (a & NK_TEXT_ALIGN_CENTERED) {
- label.w = NK_MAX(1, 2 * t->padding.x + (float)text_width);
- label.x = (b.x + t->padding.x + ((b.w - 2 * t->padding.x) - label.w) / 2);
- label.x = NK_MAX(b.x + t->padding.x, label.x);
- label.w = NK_MIN(b.x + b.w, label.x + label.w);
- if (label.w >= label.x) label.w -= label.x;
- } else if (a & NK_TEXT_ALIGN_RIGHT) {
- label.x = NK_MAX(b.x + t->padding.x, (b.x + b.w) - (2 * t->padding.x + (float)text_width));
- label.w = (float)text_width + 2 * t->padding.x;
- } else return;
-
- /* align in y-axis */
- if (a & NK_TEXT_ALIGN_MIDDLE) {
- label.y = b.y + b.h/2.0f - (float)f->height/2.0f;
- label.h = NK_MAX(b.h/2.0f, b.h - (b.h/2.0f + f->height/2.0f));
- } else if (a & NK_TEXT_ALIGN_BOTTOM) {
- label.y = b.y + b.h - f->height;
- label.h = f->height;
- }
- nk_draw_text(o, label, (const char*)string,
- len, f, t->background, t->text);
+ struct nk_page_element *elem;
+ elem = nk_create_page_element(ctx);
+ if (!elem) return 0;
+ nk_zero_struct(*elem);
+ return &elem->data.pan;
}
-
-NK_INTERN void
-nk_widget_text_wrap(struct nk_command_buffer *o, struct nk_rect b,
- const char *string, int len, const struct nk_text *t,
- const struct nk_user_font *f)
+NK_LIB void
+nk_free_panel(struct nk_context *ctx, struct nk_panel *pan)
{
- float width;
- int glyphs = 0;
- int fitting = 0;
- int done = 0;
- struct nk_rect line;
- struct nk_text text;
- NK_INTERN nk_rune seperator[] = {' '};
-
- NK_ASSERT(o);
- NK_ASSERT(t);
- if (!o || !t) return;
-
- text.padding = nk_vec2(0,0);
- text.background = t->background;
- text.text = t->text;
-
- b.w = NK_MAX(b.w, 2 * t->padding.x);
- b.h = NK_MAX(b.h, 2 * t->padding.y);
- b.h = b.h - 2 * t->padding.y;
-
- line.x = b.x + t->padding.x;
- line.y = b.y + t->padding.y;
- line.w = b.w - 2 * t->padding.x;
- line.h = 2 * t->padding.y + f->height;
-
- fitting = nk_text_clamp(f, string, len, line.w, &glyphs, &width, seperator,NK_LEN(seperator));
- while (done < len) {
- if (!fitting || line.y + line.h >= (b.y + b.h)) break;
- nk_widget_text(o, line, &string[done], fitting, &text, NK_TEXT_LEFT, f);
- done += fitting;
- line.y += f->height + 2 * t->padding.y;
- fitting = nk_text_clamp(f, &string[done], len - done, line.w, &glyphs, &width, seperator,NK_LEN(seperator));
- }
+ union nk_page_data *pd = NK_CONTAINER_OF(pan, union nk_page_data, pan);
+ struct nk_page_element *pe = NK_CONTAINER_OF(pd, struct nk_page_element, data);
+ nk_free_page_element(ctx, pe);
}
-
-/* ===============================================================
- *
- * BUTTON
- *
- * ===============================================================*/
-NK_INTERN void
-nk_draw_symbol(struct nk_command_buffer *out, enum nk_symbol_type type,
- struct nk_rect content, struct nk_color background, struct nk_color foreground,
- float border_width, const struct nk_user_font *font)
+NK_LIB int
+nk_panel_has_header(nk_flags flags, const char *title)
+{
+ int active = 0;
+ active = (flags & (NK_WINDOW_CLOSABLE|NK_WINDOW_MINIMIZABLE));
+ active = active || (flags & NK_WINDOW_TITLE);
+ active = active && !(flags & NK_WINDOW_HIDDEN) && title;
+ return active;
+}
+NK_LIB struct nk_vec2
+nk_panel_get_padding(const struct nk_style *style, enum nk_panel_type type)
{
switch (type) {
- case NK_SYMBOL_X:
- case NK_SYMBOL_UNDERSCORE:
- case NK_SYMBOL_PLUS:
- case NK_SYMBOL_MINUS: {
- /* single character text symbol */
- const char *X = (type == NK_SYMBOL_X) ? "x":
- (type == NK_SYMBOL_UNDERSCORE) ? "_":
- (type == NK_SYMBOL_PLUS) ? "+": "-";
- struct nk_text text;
- text.padding = nk_vec2(0,0);
- text.background = background;
- text.text = foreground;
- nk_widget_text(out, content, X, 1, &text, NK_TEXT_CENTERED, font);
- } break;
- case NK_SYMBOL_CIRCLE_SOLID:
- case NK_SYMBOL_CIRCLE_OUTLINE:
- case NK_SYMBOL_RECT_SOLID:
- case NK_SYMBOL_RECT_OUTLINE: {
- /* simple empty/filled shapes */
- if (type == NK_SYMBOL_RECT_SOLID || type == NK_SYMBOL_RECT_OUTLINE) {
- nk_fill_rect(out, content, 0, foreground);
- if (type == NK_SYMBOL_RECT_OUTLINE)
- nk_fill_rect(out, nk_shrink_rect(content, border_width), 0, background);
- } else {
- nk_fill_circle(out, content, foreground);
- if (type == NK_SYMBOL_CIRCLE_OUTLINE)
- nk_fill_circle(out, nk_shrink_rect(content, 1), background);
- }
- } break;
- case NK_SYMBOL_TRIANGLE_UP:
- case NK_SYMBOL_TRIANGLE_DOWN:
- case NK_SYMBOL_TRIANGLE_LEFT:
- case NK_SYMBOL_TRIANGLE_RIGHT: {
- enum nk_heading heading;
- struct nk_vec2 points[3];
- heading = (type == NK_SYMBOL_TRIANGLE_RIGHT) ? NK_RIGHT :
- (type == NK_SYMBOL_TRIANGLE_LEFT) ? NK_LEFT:
- (type == NK_SYMBOL_TRIANGLE_UP) ? NK_UP: NK_DOWN;
- nk_triangle_from_direction(points, content, 0, 0, heading);
- nk_fill_triangle(out, points[0].x, points[0].y, points[1].x, points[1].y,
- points[2].x, points[2].y, foreground);
- } break;
default:
- case NK_SYMBOL_NONE:
- case NK_SYMBOL_MAX: break;
- }
-}
-
-NK_INTERN int
-nk_button_behavior(nk_flags *state, struct nk_rect r,
- const struct nk_input *i, enum nk_button_behavior behavior)
-{
- int ret = 0;
- nk_widget_state_reset(state);
- if (!i) return 0;
- if (nk_input_is_mouse_hovering_rect(i, r)) {
- *state = NK_WIDGET_STATE_HOVERED;
- if (nk_input_is_mouse_down(i, NK_BUTTON_LEFT))
- *state = NK_WIDGET_STATE_ACTIVE;
- if (nk_input_has_mouse_click_in_rect(i, NK_BUTTON_LEFT, r)) {
- ret = (behavior != NK_BUTTON_DEFAULT) ?
- nk_input_is_mouse_down(i, NK_BUTTON_LEFT):
-#ifdef NK_BUTTON_TRIGGER_ON_RELEASE
- nk_input_is_mouse_released(i, NK_BUTTON_LEFT);
-#else
- nk_input_is_mouse_pressed(i, NK_BUTTON_LEFT);
-#endif
- }
- }
- if (*state & NK_WIDGET_STATE_HOVER && !nk_input_is_mouse_prev_hovering_rect(i, r))
- *state |= NK_WIDGET_STATE_ENTERED;
- else if (nk_input_is_mouse_prev_hovering_rect(i, r))
- *state |= NK_WIDGET_STATE_LEFT;
- return ret;
+ case NK_PANEL_WINDOW: return style->window.padding;
+ case NK_PANEL_GROUP: return style->window.group_padding;
+ case NK_PANEL_POPUP: return style->window.popup_padding;
+ case NK_PANEL_CONTEXTUAL: return style->window.contextual_padding;
+ case NK_PANEL_COMBO: return style->window.combo_padding;
+ case NK_PANEL_MENU: return style->window.menu_padding;
+ case NK_PANEL_TOOLTIP: return style->window.menu_padding;}
}
-
-NK_INTERN const struct nk_style_item*
-nk_draw_button(struct nk_command_buffer *out,
- const struct nk_rect *bounds, nk_flags state,
- const struct nk_style_button *style)
+NK_LIB float
+nk_panel_get_border(const struct nk_style *style, nk_flags flags,
+ enum nk_panel_type type)
{
- const struct nk_style_item *background;
- if (state & NK_WIDGET_STATE_HOVER)
- background = &style->hover;
- else if (state & NK_WIDGET_STATE_ACTIVED)
- background = &style->active;
- else background = &style->normal;
-
- if (background->type == NK_STYLE_ITEM_IMAGE) {
- nk_draw_image(out, *bounds, &background->data.image, nk_white);
- } else {
- nk_fill_rect(out, *bounds, style->rounding, background->data.color);
- nk_stroke_rect(out, *bounds, style->rounding, style->border, style->border_color);
- }
- return background;
+ if (flags & NK_WINDOW_BORDER) {
+ switch (type) {
+ default:
+ case NK_PANEL_WINDOW: return style->window.border;
+ case NK_PANEL_GROUP: return style->window.group_border;
+ case NK_PANEL_POPUP: return style->window.popup_border;
+ case NK_PANEL_CONTEXTUAL: return style->window.contextual_border;
+ case NK_PANEL_COMBO: return style->window.combo_border;
+ case NK_PANEL_MENU: return style->window.menu_border;
+ case NK_PANEL_TOOLTIP: return style->window.menu_border;
+ }} else return 0;
}
-
-NK_INTERN int
-nk_do_button(nk_flags *state, struct nk_command_buffer *out, struct nk_rect r,
- const struct nk_style_button *style, const struct nk_input *in,
- enum nk_button_behavior behavior, struct nk_rect *content)
+NK_LIB struct nk_color
+nk_panel_get_border_color(const struct nk_style *style, enum nk_panel_type type)
{
- struct nk_rect bounds;
- NK_ASSERT(style);
- NK_ASSERT(state);
- NK_ASSERT(out);
- if (!out || !style)
- return nk_false;
-
- /* calculate button content space */
- content->x = r.x + style->padding.x + style->border + style->rounding;
- content->y = r.y + style->padding.y + style->border + style->rounding;
- content->w = r.w - (2 * style->padding.x + style->border + style->rounding*2);
- content->h = r.h - (2 * style->padding.y + style->border + style->rounding*2);
-
- /* execute button behavior */
- bounds.x = r.x - style->touch_padding.x;
- bounds.y = r.y - style->touch_padding.y;
- bounds.w = r.w + 2 * style->touch_padding.x;
- bounds.h = r.h + 2 * style->touch_padding.y;
- return nk_button_behavior(state, bounds, in, behavior);
+ switch (type) {
+ default:
+ case NK_PANEL_WINDOW: return style->window.border_color;
+ case NK_PANEL_GROUP: return style->window.group_border_color;
+ case NK_PANEL_POPUP: return style->window.popup_border_color;
+ case NK_PANEL_CONTEXTUAL: return style->window.contextual_border_color;
+ case NK_PANEL_COMBO: return style->window.combo_border_color;
+ case NK_PANEL_MENU: return style->window.menu_border_color;
+ case NK_PANEL_TOOLTIP: return style->window.menu_border_color;}
}
-
-NK_INTERN void
-nk_draw_button_text(struct nk_command_buffer *out,
- const struct nk_rect *bounds, const struct nk_rect *content, nk_flags state,
- const struct nk_style_button *style, const char *txt, int len,
- nk_flags text_alignment, const struct nk_user_font *font)
+NK_LIB int
+nk_panel_is_sub(enum nk_panel_type type)
{
- struct nk_text text;
- const struct nk_style_item *background;
- background = nk_draw_button(out, bounds, state, style);
-
- /* select correct colors/images */
- if (background->type == NK_STYLE_ITEM_COLOR)
- text.background = background->data.color;
- else text.background = style->text_background;
- if (state & NK_WIDGET_STATE_HOVER)
- text.text = style->text_hover;
- else if (state & NK_WIDGET_STATE_ACTIVED)
- text.text = style->text_active;
- else text.text = style->text_normal;
-
- text.padding = nk_vec2(0,0);
- nk_widget_text(out, *content, txt, len, &text, text_alignment, font);
+ return (type & NK_PANEL_SET_SUB)?1:0;
}
-
-NK_INTERN int
-nk_do_button_text(nk_flags *state,
- struct nk_command_buffer *out, struct nk_rect bounds,
- const char *string, int len, nk_flags align, enum nk_button_behavior behavior,
- const struct nk_style_button *style, const struct nk_input *in,
- const struct nk_user_font *font)
+NK_LIB int
+nk_panel_is_nonblock(enum nk_panel_type type)
{
- struct nk_rect content;
- int ret = nk_false;
-
- NK_ASSERT(state);
- NK_ASSERT(style);
- NK_ASSERT(out);
- NK_ASSERT(string);
- NK_ASSERT(font);
- if (!out || !style || !font || !string)
- return nk_false;
-
- ret = nk_do_button(state, out, bounds, style, in, behavior, &content);
- if (style->draw_begin) style->draw_begin(out, style->userdata);
- nk_draw_button_text(out, &bounds, &content, *state, style, string, len, align, font);
- if (style->draw_end) style->draw_end(out, style->userdata);
- return ret;
+ return (type & NK_PANEL_SET_NONBLOCK)?1:0;
}
-
-NK_INTERN void
-nk_draw_button_symbol(struct nk_command_buffer *out,
- const struct nk_rect *bounds, const struct nk_rect *content,
- nk_flags state, const struct nk_style_button *style,
- enum nk_symbol_type type, const struct nk_user_font *font)
+NK_LIB int
+nk_panel_begin(struct nk_context *ctx, const char *title, enum nk_panel_type panel_type)
{
- struct nk_color sym, bg;
- const struct nk_style_item *background;
+ struct nk_input *in;
+ struct nk_window *win;
+ struct nk_panel *layout;
+ struct nk_command_buffer *out;
+ const struct nk_style *style;
+ const struct nk_user_font *font;
- /* select correct colors/images */
- background = nk_draw_button(out, bounds, state, style);
- if (background->type == NK_STYLE_ITEM_COLOR)
- bg = background->data.color;
- else bg = style->text_background;
+ struct nk_vec2 scrollbar_size;
+ struct nk_vec2 panel_padding;
- if (state & NK_WIDGET_STATE_HOVER)
- sym = style->text_hover;
- else if (state & NK_WIDGET_STATE_ACTIVED)
- sym = style->text_active;
- else sym = style->text_normal;
- nk_draw_symbol(out, type, *content, bg, sym, 1, font);
-}
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout) return 0;
+ nk_zero(ctx->current->layout, sizeof(*ctx->current->layout));
+ if ((ctx->current->flags & NK_WINDOW_HIDDEN) || (ctx->current->flags & NK_WINDOW_CLOSED)) {
+ nk_zero(ctx->current->layout, sizeof(struct nk_panel));
+ ctx->current->layout->type = panel_type;
+ return 0;
+ }
+ /* pull state into local stack */
+ style = &ctx->style;
+ font = style->font;
+ win = ctx->current;
+ layout = win->layout;
+ out = &win->buffer;
+ in = (win->flags & NK_WINDOW_NO_INPUT) ? 0: &ctx->input;
+#ifdef NK_INCLUDE_COMMAND_USERDATA
+ win->buffer.userdata = ctx->userdata;
+#endif
+ /* pull style configuration into local stack */
+ scrollbar_size = style->window.scrollbar_size;
+ panel_padding = nk_panel_get_padding(style, panel_type);
-NK_INTERN int
-nk_do_button_symbol(nk_flags *state,
- struct nk_command_buffer *out, struct nk_rect bounds,
- enum nk_symbol_type symbol, enum nk_button_behavior behavior,
- const struct nk_style_button *style, const struct nk_input *in,
- const struct nk_user_font *font)
-{
- int ret;
- struct nk_rect content;
+ /* window movement */
+ if ((win->flags & NK_WINDOW_MOVABLE) && !(win->flags & NK_WINDOW_ROM)) {
+ int left_mouse_down;
+ int left_mouse_clicked;
+ int left_mouse_click_in_cursor;
- NK_ASSERT(state);
- NK_ASSERT(style);
- NK_ASSERT(font);
- NK_ASSERT(out);
- if (!out || !style || !font || !state)
- return nk_false;
+ /* calculate draggable window space */
+ struct nk_rect header;
+ header.x = win->bounds.x;
+ header.y = win->bounds.y;
+ header.w = win->bounds.w;
+ if (nk_panel_has_header(win->flags, title)) {
+ header.h = font->height + 2.0f * style->window.header.padding.y;
+ header.h += 2.0f * style->window.header.label_padding.y;
+ } else header.h = panel_padding.y;
- ret = nk_do_button(state, out, bounds, style, in, behavior, &content);
- if (style->draw_begin) style->draw_begin(out, style->userdata);
- nk_draw_button_symbol(out, &bounds, &content, *state, style, symbol, font);
- if (style->draw_end) style->draw_end(out, style->userdata);
- return ret;
-}
+ /* window movement by dragging */
+ left_mouse_down = in->mouse.buttons[NK_BUTTON_LEFT].down;
+ left_mouse_clicked = (int)in->mouse.buttons[NK_BUTTON_LEFT].clicked;
+ left_mouse_click_in_cursor = nk_input_has_mouse_click_down_in_rect(in,
+ NK_BUTTON_LEFT, header, nk_true);
+ if (left_mouse_down && left_mouse_click_in_cursor && !left_mouse_clicked) {
+ win->bounds.x = win->bounds.x + in->mouse.delta.x;
+ win->bounds.y = win->bounds.y + in->mouse.delta.y;
+ in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.x += in->mouse.delta.x;
+ in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.y += in->mouse.delta.y;
+ ctx->style.cursor_active = ctx->style.cursors[NK_CURSOR_MOVE];
+ }
+ }
-NK_INTERN void
-nk_draw_button_image(struct nk_command_buffer *out,
- const struct nk_rect *bounds, const struct nk_rect *content,
- nk_flags state, const struct nk_style_button *style, const struct nk_image *img)
-{
- nk_draw_button(out, bounds, state, style);
- nk_draw_image(out, *content, img, nk_white);
-}
+ /* setup panel */
+ layout->type = panel_type;
+ layout->flags = win->flags;
+ layout->bounds = win->bounds;
+ layout->bounds.x += panel_padding.x;
+ layout->bounds.w -= 2*panel_padding.x;
+ if (win->flags & NK_WINDOW_BORDER) {
+ layout->border = nk_panel_get_border(style, win->flags, panel_type);
+ layout->bounds = nk_shrink_rect(layout->bounds, layout->border);
+ } else layout->border = 0;
+ layout->at_y = layout->bounds.y;
+ layout->at_x = layout->bounds.x;
+ layout->max_x = 0;
+ layout->header_height = 0;
+ layout->footer_height = 0;
+ nk_layout_reset_min_row_height(ctx);
+ layout->row.index = 0;
+ layout->row.columns = 0;
+ layout->row.ratio = 0;
+ layout->row.item_width = 0;
+ layout->row.tree_depth = 0;
+ layout->row.height = panel_padding.y;
+ layout->has_scrolling = nk_true;
+ if (!(win->flags & NK_WINDOW_NO_SCROLLBAR))
+ layout->bounds.w -= scrollbar_size.x;
+ if (!nk_panel_is_nonblock(panel_type)) {
+ layout->footer_height = 0;
+ if (!(win->flags & NK_WINDOW_NO_SCROLLBAR) || win->flags & NK_WINDOW_SCALABLE)
+ layout->footer_height = scrollbar_size.y;
+ layout->bounds.h -= layout->footer_height;
+ }
-NK_INTERN int
-nk_do_button_image(nk_flags *state,
- struct nk_command_buffer *out, struct nk_rect bounds,
- struct nk_image img, enum nk_button_behavior b,
- const struct nk_style_button *style, const struct nk_input *in)
-{
- int ret;
- struct nk_rect content;
+ /* panel header */
+ if (nk_panel_has_header(win->flags, title))
+ {
+ struct nk_text text;
+ struct nk_rect header;
+ const struct nk_style_item *background = 0;
- NK_ASSERT(state);
- NK_ASSERT(style);
- NK_ASSERT(out);
- if (!out || !style || !state)
- return nk_false;
+ /* calculate header bounds */
+ header.x = win->bounds.x;
+ header.y = win->bounds.y;
+ header.w = win->bounds.w;
+ header.h = font->height + 2.0f * style->window.header.padding.y;
+ header.h += (2.0f * style->window.header.label_padding.y);
- ret = nk_do_button(state, out, bounds, style, in, b, &content);
- content.x += style->image_padding.x;
- content.y += style->image_padding.y;
- content.w -= 2 * style->image_padding.x;
- content.h -= 2 * style->image_padding.y;
+ /* shrink panel by header */
+ layout->header_height = header.h;
+ layout->bounds.y += header.h;
+ layout->bounds.h -= header.h;
+ layout->at_y += header.h;
- if (style->draw_begin) style->draw_begin(out, style->userdata);
- nk_draw_button_image(out, &bounds, &content, *state, style, &img);
- if (style->draw_end) style->draw_end(out, style->userdata);
- return ret;
-}
+ /* select correct header background and text color */
+ if (ctx->active == win) {
+ background = &style->window.header.active;
+ text.text = style->window.header.label_active;
+ } else if (nk_input_is_mouse_hovering_rect(&ctx->input, header)) {
+ background = &style->window.header.hover;
+ text.text = style->window.header.label_hover;
+ } else {
+ background = &style->window.header.normal;
+ text.text = style->window.header.label_normal;
+ }
-NK_INTERN void
-nk_draw_button_text_symbol(struct nk_command_buffer *out,
- const struct nk_rect *bounds, const struct nk_rect *label,
- const struct nk_rect *symbol, nk_flags state, const struct nk_style_button *style,
- const char *str, int len, enum nk_symbol_type type,
- const struct nk_user_font *font)
-{
- struct nk_color sym;
- struct nk_text text;
- const struct nk_style_item *background;
+ /* draw header background */
+ header.h += 1.0f;
+ if (background->type == NK_STYLE_ITEM_IMAGE) {
+ text.background = nk_rgba(0,0,0,0);
+ nk_draw_image(&win->buffer, header, &background->data.image, nk_white);
+ } else {
+ text.background = background->data.color;
+ nk_fill_rect(out, header, 0, background->data.color);
+ }
- /* select correct background colors/images */
- background = nk_draw_button(out, bounds, state, style);
- if (background->type == NK_STYLE_ITEM_COLOR)
- text.background = background->data.color;
- else text.background = style->text_background;
+ /* window close button */
+ {struct nk_rect button;
+ button.y = header.y + style->window.header.padding.y;
+ button.h = header.h - 2 * style->window.header.padding.y;
+ button.w = button.h;
+ if (win->flags & NK_WINDOW_CLOSABLE) {
+ nk_flags ws = 0;
+ if (style->window.header.align == NK_HEADER_RIGHT) {
+ button.x = (header.w + header.x) - (button.w + style->window.header.padding.x);
+ header.w -= button.w + style->window.header.spacing.x + style->window.header.padding.x;
+ } else {
+ button.x = header.x + style->window.header.padding.x;
+ header.x += button.w + style->window.header.spacing.x + style->window.header.padding.x;
+ }
- /* select correct text colors */
- if (state & NK_WIDGET_STATE_HOVER) {
- sym = style->text_hover;
- text.text = style->text_hover;
- } else if (state & NK_WIDGET_STATE_ACTIVED) {
- sym = style->text_active;
- text.text = style->text_active;
- } else {
- sym = style->text_normal;
- text.text = style->text_normal;
- }
+ if (nk_do_button_symbol(&ws, &win->buffer, button,
+ style->window.header.close_symbol, NK_BUTTON_DEFAULT,
+ &style->window.header.close_button, in, style->font) && !(win->flags & NK_WINDOW_ROM))
+ {
+ layout->flags |= NK_WINDOW_HIDDEN;
+ layout->flags &= (nk_flags)~NK_WINDOW_MINIMIZED;
+ }
+ }
- text.padding = nk_vec2(0,0);
- nk_draw_symbol(out, type, *symbol, style->text_background, sym, 0, font);
- nk_widget_text(out, *label, str, len, &text, NK_TEXT_CENTERED, font);
-}
+ /* window minimize button */
+ if (win->flags & NK_WINDOW_MINIMIZABLE) {
+ nk_flags ws = 0;
+ if (style->window.header.align == NK_HEADER_RIGHT) {
+ button.x = (header.w + header.x) - button.w;
+ if (!(win->flags & NK_WINDOW_CLOSABLE)) {
+ button.x -= style->window.header.padding.x;
+ header.w -= style->window.header.padding.x;
+ }
+ header.w -= button.w + style->window.header.spacing.x;
+ } else {
+ button.x = header.x;
+ header.x += button.w + style->window.header.spacing.x + style->window.header.padding.x;
+ }
+ if (nk_do_button_symbol(&ws, &win->buffer, button, (layout->flags & NK_WINDOW_MINIMIZED)?
+ style->window.header.maximize_symbol: style->window.header.minimize_symbol,
+ NK_BUTTON_DEFAULT, &style->window.header.minimize_button, in, style->font) && !(win->flags & NK_WINDOW_ROM))
+ layout->flags = (layout->flags & NK_WINDOW_MINIMIZED) ?
+ layout->flags & (nk_flags)~NK_WINDOW_MINIMIZED:
+ layout->flags | NK_WINDOW_MINIMIZED;
+ }}
-NK_INTERN int
-nk_do_button_text_symbol(nk_flags *state,
- struct nk_command_buffer *out, struct nk_rect bounds,
- enum nk_symbol_type symbol, const char *str, int len, nk_flags align,
- enum nk_button_behavior behavior, const struct nk_style_button *style,
- const struct nk_user_font *font, const struct nk_input *in)
-{
- int ret;
- struct nk_rect tri = {0,0,0,0};
- struct nk_rect content;
+ {/* window header title */
+ int text_len = nk_strlen(title);
+ struct nk_rect label = {0,0,0,0};
+ float t = font->width(font->userdata, font->height, title, text_len);
+ text.padding = nk_vec2(0,0);
- NK_ASSERT(style);
- NK_ASSERT(out);
- NK_ASSERT(font);
- if (!out || !style || !font)
- return nk_false;
+ label.x = header.x + style->window.header.padding.x;
+ label.x += style->window.header.label_padding.x;
+ label.y = header.y + style->window.header.label_padding.y;
+ label.h = font->height + 2 * style->window.header.label_padding.y;
+ label.w = t + 2 * style->window.header.spacing.x;
+ label.w = NK_CLAMP(0, label.w, header.x + header.w - label.x);
+ nk_widget_text(out, label,(const char*)title, text_len, &text, NK_TEXT_LEFT, font);}
+ }
- ret = nk_do_button(state, out, bounds, style, in, behavior, &content);
- tri.y = content.y + (content.h/2) - font->height/2;
- tri.w = font->height; tri.h = font->height;
- if (align & NK_TEXT_ALIGN_LEFT) {
- tri.x = (content.x + content.w) - (2 * style->padding.x + tri.w);
- tri.x = NK_MAX(tri.x, 0);
- } else tri.x = content.x + 2 * style->padding.x;
+ /* draw window background */
+ if (!(layout->flags & NK_WINDOW_MINIMIZED) && !(layout->flags & NK_WINDOW_DYNAMIC)) {
+ struct nk_rect body;
+ body.x = win->bounds.x;
+ body.w = win->bounds.w;
+ body.y = (win->bounds.y + layout->header_height);
+ body.h = (win->bounds.h - layout->header_height);
+ if (style->window.fixed_background.type == NK_STYLE_ITEM_IMAGE)
+ nk_draw_image(out, body, &style->window.fixed_background.data.image, nk_white);
+ else nk_fill_rect(out, body, 0, style->window.fixed_background.data.color);
+ }
- /* draw button */
- if (style->draw_begin) style->draw_begin(out, style->userdata);
- nk_draw_button_text_symbol(out, &bounds, &content, &tri,
- *state, style, str, len, symbol, font);
- if (style->draw_end) style->draw_end(out, style->userdata);
- return ret;
+ /* set clipping rectangle */
+ {struct nk_rect clip;
+ layout->clip = layout->bounds;
+ nk_unify(&clip, &win->buffer.clip, layout->clip.x, layout->clip.y,
+ layout->clip.x + layout->clip.w, layout->clip.y + layout->clip.h);
+ nk_push_scissor(out, clip);
+ layout->clip = clip;}
+ return !(layout->flags & NK_WINDOW_HIDDEN) && !(layout->flags & NK_WINDOW_MINIMIZED);
}
-
-NK_INTERN void
-nk_draw_button_text_image(struct nk_command_buffer *out,
- const struct nk_rect *bounds, const struct nk_rect *label,
- const struct nk_rect *image, nk_flags state, const struct nk_style_button *style,
- const char *str, int len, const struct nk_user_font *font,
- const struct nk_image *img)
+NK_LIB void
+nk_panel_end(struct nk_context *ctx)
{
- struct nk_text text;
- const struct nk_style_item *background;
- background = nk_draw_button(out, bounds, state, style);
-
- /* select correct colors */
- if (background->type == NK_STYLE_ITEM_COLOR)
- text.background = background->data.color;
- else text.background = style->text_background;
- if (state & NK_WIDGET_STATE_HOVER)
- text.text = style->text_hover;
- else if (state & NK_WIDGET_STATE_ACTIVED)
- text.text = style->text_active;
- else text.text = style->text_normal;
+ struct nk_input *in;
+ struct nk_window *window;
+ struct nk_panel *layout;
+ const struct nk_style *style;
+ struct nk_command_buffer *out;
- text.padding = nk_vec2(0,0);
- nk_widget_text(out, *label, str, len, &text, NK_TEXT_CENTERED, font);
- nk_draw_image(out, *image, img, nk_white);
-}
+ struct nk_vec2 scrollbar_size;
+ struct nk_vec2 panel_padding;
-NK_INTERN int
-nk_do_button_text_image(nk_flags *state,
- struct nk_command_buffer *out, struct nk_rect bounds,
- struct nk_image img, const char* str, int len, nk_flags align,
- enum nk_button_behavior behavior, const struct nk_style_button *style,
- const struct nk_user_font *font, const struct nk_input *in)
-{
- int ret;
- struct nk_rect icon;
- struct nk_rect content;
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout)
+ return;
- NK_ASSERT(style);
- NK_ASSERT(state);
- NK_ASSERT(font);
- NK_ASSERT(out);
- if (!out || !font || !style || !str)
- return nk_false;
+ window = ctx->current;
+ layout = window->layout;
+ style = &ctx->style;
+ out = &window->buffer;
+ in = (layout->flags & NK_WINDOW_ROM || layout->flags & NK_WINDOW_NO_INPUT) ? 0 :&ctx->input;
+ if (!nk_panel_is_sub(layout->type))
+ nk_push_scissor(out, nk_null_rect);
- ret = nk_do_button(state, out, bounds, style, in, behavior, &content);
- icon.y = bounds.y + style->padding.y;
- icon.w = icon.h = bounds.h - 2 * style->padding.y;
- if (align & NK_TEXT_ALIGN_LEFT) {
- icon.x = (bounds.x + bounds.w) - (2 * style->padding.x + icon.w);
- icon.x = NK_MAX(icon.x, 0);
- } else icon.x = bounds.x + 2 * style->padding.x;
+ /* cache configuration data */
+ scrollbar_size = style->window.scrollbar_size;
+ panel_padding = nk_panel_get_padding(style, layout->type);
- icon.x += style->image_padding.x;
- icon.y += style->image_padding.y;
- icon.w -= 2 * style->image_padding.x;
- icon.h -= 2 * style->image_padding.y;
+ /* update the current cursor Y-position to point over the last added widget */
+ layout->at_y += layout->row.height;
- if (style->draw_begin) style->draw_begin(out, style->userdata);
- nk_draw_button_text_image(out, &bounds, &content, &icon, *state, style, str, len, font, &img);
- if (style->draw_end) style->draw_end(out, style->userdata);
- return ret;
-}
+ /* dynamic panels */
+ if (layout->flags & NK_WINDOW_DYNAMIC && !(layout->flags & NK_WINDOW_MINIMIZED))
+ {
+ /* update panel height to fit dynamic growth */
+ struct nk_rect empty_space;
+ if (layout->at_y < (layout->bounds.y + layout->bounds.h))
+ layout->bounds.h = layout->at_y - layout->bounds.y;
-/* ===============================================================
- *
- * TOGGLE
- *
- * ===============================================================*/
-enum nk_toggle_type {
- NK_TOGGLE_CHECK,
- NK_TOGGLE_OPTION
-};
+ /* fill top empty space */
+ empty_space.x = window->bounds.x;
+ empty_space.y = layout->bounds.y;
+ empty_space.h = panel_padding.y;
+ empty_space.w = window->bounds.w;
+ nk_fill_rect(out, empty_space, 0, style->window.background);
-NK_INTERN int
-nk_toggle_behavior(const struct nk_input *in, struct nk_rect select,
- nk_flags *state, int active)
-{
- nk_widget_state_reset(state);
- if (nk_button_behavior(state, select, in, NK_BUTTON_DEFAULT)) {
- *state = NK_WIDGET_STATE_ACTIVE;
- active = !active;
- }
- if (*state & NK_WIDGET_STATE_HOVER && !nk_input_is_mouse_prev_hovering_rect(in, select))
- *state |= NK_WIDGET_STATE_ENTERED;
- else if (nk_input_is_mouse_prev_hovering_rect(in, select))
- *state |= NK_WIDGET_STATE_LEFT;
- return active;
-}
+ /* fill left empty space */
+ empty_space.x = window->bounds.x;
+ empty_space.y = layout->bounds.y;
+ empty_space.w = panel_padding.x + layout->border;
+ empty_space.h = layout->bounds.h;
+ nk_fill_rect(out, empty_space, 0, style->window.background);
-NK_INTERN void
-nk_draw_checkbox(struct nk_command_buffer *out,
- nk_flags state, const struct nk_style_toggle *style, int active,
- const struct nk_rect *label, const struct nk_rect *selector,
- const struct nk_rect *cursors, const char *string, int len,
- const struct nk_user_font *font)
-{
- const struct nk_style_item *background;
- const struct nk_style_item *cursor;
- struct nk_text text;
+ /* fill right empty space */
+ empty_space.x = layout->bounds.x + layout->bounds.w;
+ empty_space.y = layout->bounds.y;
+ empty_space.w = panel_padding.x + layout->border;
+ empty_space.h = layout->bounds.h;
+ if (*layout->offset_y == 0 && !(layout->flags & NK_WINDOW_NO_SCROLLBAR))
+ empty_space.w += scrollbar_size.x;
+ nk_fill_rect(out, empty_space, 0, style->window.background);
- /* select correct colors/images */
- if (state & NK_WIDGET_STATE_HOVER) {
- background = &style->hover;
- cursor = &style->cursor_hover;
- text.text = style->text_hover;
- } else if (state & NK_WIDGET_STATE_ACTIVED) {
- background = &style->hover;
- cursor = &style->cursor_hover;
- text.text = style->text_active;
- } else {
- background = &style->normal;
- cursor = &style->cursor_normal;
- text.text = style->text_normal;
+ /* fill bottom empty space */
+ if (layout->footer_height > 0) {
+ empty_space.x = window->bounds.x;
+ empty_space.y = layout->bounds.y + layout->bounds.h;
+ empty_space.w = window->bounds.w;
+ empty_space.h = layout->footer_height;
+ nk_fill_rect(out, empty_space, 0, style->window.background);
+ }
}
- /* draw background and cursor */
- if (background->type == NK_STYLE_ITEM_COLOR) {
- nk_fill_rect(out, *selector, 0, style->border_color);
- nk_fill_rect(out, nk_shrink_rect(*selector, style->border), 0, background->data.color);
- } else nk_draw_image(out, *selector, &background->data.image, nk_white);
- if (active) {
- if (cursor->type == NK_STYLE_ITEM_IMAGE)
- nk_draw_image(out, *cursors, &cursor->data.image, nk_white);
- else nk_fill_rect(out, *cursors, 0, cursor->data.color);
- }
+ /* scrollbars */
+ if (!(layout->flags & NK_WINDOW_NO_SCROLLBAR) &&
+ !(layout->flags & NK_WINDOW_MINIMIZED) &&
+ window->scrollbar_hiding_timer < NK_SCROLLBAR_HIDING_TIMEOUT)
+ {
+ struct nk_rect scroll;
+ int scroll_has_scrolling;
+ float scroll_target;
+ float scroll_offset;
+ float scroll_step;
+ float scroll_inc;
- text.padding.x = 0;
- text.padding.y = 0;
- text.background = style->text_background;
- nk_widget_text(out, *label, string, len, &text, NK_TEXT_LEFT, font);
-}
+ /* mouse wheel scrolling */
+ if (nk_panel_is_sub(layout->type))
+ {
+ /* sub-window mouse wheel scrolling */
+ struct nk_window *root_window = window;
+ struct nk_panel *root_panel = window->layout;
+ while (root_panel->parent)
+ root_panel = root_panel->parent;
+ while (root_window->parent)
+ root_window = root_window->parent;
-NK_INTERN void
-nk_draw_option(struct nk_command_buffer *out,
- nk_flags state, const struct nk_style_toggle *style, int active,
- const struct nk_rect *label, const struct nk_rect *selector,
- const struct nk_rect *cursors, const char *string, int len,
- const struct nk_user_font *font)
-{
- const struct nk_style_item *background;
- const struct nk_style_item *cursor;
- struct nk_text text;
+ /* only allow scrolling if parent window is active */
+ scroll_has_scrolling = 0;
+ if ((root_window == ctx->active) && layout->has_scrolling) {
+ /* and panel is being hovered and inside clip rect*/
+ if (nk_input_is_mouse_hovering_rect(in, layout->bounds) &&
+ NK_INTERSECT(layout->bounds.x, layout->bounds.y, layout->bounds.w, layout->bounds.h,
+ root_panel->clip.x, root_panel->clip.y, root_panel->clip.w, root_panel->clip.h))
+ {
+ /* deactivate all parent scrolling */
+ root_panel = window->layout;
+ while (root_panel->parent) {
+ root_panel->has_scrolling = nk_false;
+ root_panel = root_panel->parent;
+ }
+ root_panel->has_scrolling = nk_false;
+ scroll_has_scrolling = nk_true;
+ }
+ }
+ } else if (!nk_panel_is_sub(layout->type)) {
+ /* window mouse wheel scrolling */
+ scroll_has_scrolling = (window == ctx->active) && layout->has_scrolling;
+ if (in && (in->mouse.scroll_delta.y > 0 || in->mouse.scroll_delta.x > 0) && scroll_has_scrolling)
+ window->scrolled = nk_true;
+ else window->scrolled = nk_false;
+ } else scroll_has_scrolling = nk_false;
- /* select correct colors/images */
- if (state & NK_WIDGET_STATE_HOVER) {
- background = &style->hover;
- cursor = &style->cursor_hover;
- text.text = style->text_hover;
- } else if (state & NK_WIDGET_STATE_ACTIVED) {
- background = &style->hover;
- cursor = &style->cursor_hover;
- text.text = style->text_active;
- } else {
- background = &style->normal;
- cursor = &style->cursor_normal;
- text.text = style->text_normal;
- }
+ {
+ /* vertical scrollbar */
+ nk_flags state = 0;
+ scroll.x = layout->bounds.x + layout->bounds.w + panel_padding.x;
+ scroll.y = layout->bounds.y;
+ scroll.w = scrollbar_size.x;
+ scroll.h = layout->bounds.h;
- /* draw background and cursor */
- if (background->type == NK_STYLE_ITEM_COLOR) {
- nk_fill_circle(out, *selector, style->border_color);
- nk_fill_circle(out, nk_shrink_rect(*selector, style->border), background->data.color);
- } else nk_draw_image(out, *selector, &background->data.image, nk_white);
- if (active) {
- if (cursor->type == NK_STYLE_ITEM_IMAGE)
- nk_draw_image(out, *cursors, &cursor->data.image, nk_white);
- else nk_fill_circle(out, *cursors, cursor->data.color);
+ scroll_offset = (float)*layout->offset_y;
+ scroll_step = scroll.h * 0.10f;
+ scroll_inc = scroll.h * 0.01f;
+ scroll_target = (float)(int)(layout->at_y - scroll.y);
+ scroll_offset = nk_do_scrollbarv(&state, out, scroll, scroll_has_scrolling,
+ scroll_offset, scroll_target, scroll_step, scroll_inc,
+ &ctx->style.scrollv, in, style->font);
+ *layout->offset_y = (nk_uint)scroll_offset;
+ if (in && scroll_has_scrolling)
+ in->mouse.scroll_delta.y = 0;
+ }
+ {
+ /* horizontal scrollbar */
+ nk_flags state = 0;
+ scroll.x = layout->bounds.x;
+ scroll.y = layout->bounds.y + layout->bounds.h;
+ scroll.w = layout->bounds.w;
+ scroll.h = scrollbar_size.y;
+
+ scroll_offset = (float)*layout->offset_x;
+ scroll_target = (float)(int)(layout->max_x - scroll.x);
+ scroll_step = layout->max_x * 0.05f;
+ scroll_inc = layout->max_x * 0.005f;
+ scroll_offset = nk_do_scrollbarh(&state, out, scroll, scroll_has_scrolling,
+ scroll_offset, scroll_target, scroll_step, scroll_inc,
+ &ctx->style.scrollh, in, style->font);
+ *layout->offset_x = (nk_uint)scroll_offset;
+ }
}
- text.padding.x = 0;
- text.padding.y = 0;
- text.background = style->text_background;
- nk_widget_text(out, *label, string, len, &text, NK_TEXT_LEFT, font);
-}
-
-NK_INTERN int
-nk_do_toggle(nk_flags *state,
- struct nk_command_buffer *out, struct nk_rect r,
- int *active, const char *str, int len, enum nk_toggle_type type,
- const struct nk_style_toggle *style, const struct nk_input *in,
- const struct nk_user_font *font)
-{
- int was_active;
- struct nk_rect bounds;
- struct nk_rect select;
- struct nk_rect cursor;
- struct nk_rect label;
-
- NK_ASSERT(style);
- NK_ASSERT(out);
- NK_ASSERT(font);
- if (!out || !style || !font || !active)
- return 0;
+ /* hide scroll if no user input */
+ if (window->flags & NK_WINDOW_SCROLL_AUTO_HIDE) {
+ int has_input = ctx->input.mouse.delta.x != 0 || ctx->input.mouse.delta.y != 0 || ctx->input.mouse.scroll_delta.y != 0;
+ int is_window_hovered = nk_window_is_hovered(ctx);
+ int any_item_active = (ctx->last_widget_state & NK_WIDGET_STATE_MODIFIED);
+ if ((!has_input && is_window_hovered) || (!is_window_hovered && !any_item_active))
+ window->scrollbar_hiding_timer += ctx->delta_time_seconds;
+ else window->scrollbar_hiding_timer = 0;
+ } else window->scrollbar_hiding_timer = 0;
- r.w = NK_MAX(r.w, font->height + 2 * style->padding.x);
- r.h = NK_MAX(r.h, font->height + 2 * style->padding.y);
+ /* window border */
+ if (layout->flags & NK_WINDOW_BORDER)
+ {
+ struct nk_color border_color = nk_panel_get_border_color(style, layout->type);
+ const float padding_y = (layout->flags & NK_WINDOW_MINIMIZED)
+ ? (style->window.border + window->bounds.y + layout->header_height)
+ : ((layout->flags & NK_WINDOW_DYNAMIC)
+ ? (layout->bounds.y + layout->bounds.h + layout->footer_height)
+ : (window->bounds.y + window->bounds.h));
+ struct nk_rect b = window->bounds;
+ b.h = padding_y - window->bounds.y;
+ nk_stroke_rect(out, b, 0, layout->border, border_color);
+ }
- /* add additional touch padding for touch screen devices */
- bounds.x = r.x - style->touch_padding.x;
- bounds.y = r.y - style->touch_padding.y;
- bounds.w = r.w + 2 * style->touch_padding.x;
- bounds.h = r.h + 2 * style->touch_padding.y;
+ /* scaler */
+ if ((layout->flags & NK_WINDOW_SCALABLE) && in && !(layout->flags & NK_WINDOW_MINIMIZED))
+ {
+ /* calculate scaler bounds */
+ struct nk_rect scaler;
+ scaler.w = scrollbar_size.x;
+ scaler.h = scrollbar_size.y;
+ scaler.y = layout->bounds.y + layout->bounds.h;
+ if (layout->flags & NK_WINDOW_SCALE_LEFT)
+ scaler.x = layout->bounds.x - panel_padding.x * 0.5f;
+ else scaler.x = layout->bounds.x + layout->bounds.w + panel_padding.x;
+ if (layout->flags & NK_WINDOW_NO_SCROLLBAR)
+ scaler.x -= scaler.w;
- /* calculate the selector space */
- select.w = font->height;
- select.h = select.w;
- select.y = r.y + r.h/2.0f - select.h/2.0f;
- select.x = r.x;
+ /* draw scaler */
+ {const struct nk_style_item *item = &style->window.scaler;
+ if (item->type == NK_STYLE_ITEM_IMAGE)
+ nk_draw_image(out, scaler, &item->data.image, nk_white);
+ else {
+ if (layout->flags & NK_WINDOW_SCALE_LEFT) {
+ nk_fill_triangle(out, scaler.x, scaler.y, scaler.x,
+ scaler.y + scaler.h, scaler.x + scaler.w,
+ scaler.y + scaler.h, item->data.color);
+ } else {
+ nk_fill_triangle(out, scaler.x + scaler.w, scaler.y, scaler.x + scaler.w,
+ scaler.y + scaler.h, scaler.x, scaler.y + scaler.h, item->data.color);
+ }
+ }}
- /* calculate the bounds of the cursor inside the selector */
- cursor.x = select.x + style->padding.x + style->border;
- cursor.y = select.y + style->padding.y + style->border;
- cursor.w = select.w - (2 * style->padding.x + 2 * style->border);
- cursor.h = select.h - (2 * style->padding.y + 2 * style->border);
+ /* do window scaling */
+ if (!(window->flags & NK_WINDOW_ROM)) {
+ struct nk_vec2 window_size = style->window.min_size;
+ int left_mouse_down = in->mouse.buttons[NK_BUTTON_LEFT].down;
+ int left_mouse_click_in_scaler = nk_input_has_mouse_click_down_in_rect(in,
+ NK_BUTTON_LEFT, scaler, nk_true);
- /* label behind the selector */
- label.x = select.x + select.w + style->spacing;
- label.y = select.y;
- label.w = NK_MAX(r.x + r.w, label.x) - label.x;
- label.h = select.w;
+ if (left_mouse_down && left_mouse_click_in_scaler) {
+ float delta_x = in->mouse.delta.x;
+ if (layout->flags & NK_WINDOW_SCALE_LEFT) {
+ delta_x = -delta_x;
+ window->bounds.x += in->mouse.delta.x;
+ }
+ /* dragging in x-direction */
+ if (window->bounds.w + delta_x >= window_size.x) {
+ if ((delta_x < 0) || (delta_x > 0 && in->mouse.pos.x >= scaler.x)) {
+ window->bounds.w = window->bounds.w + delta_x;
+ scaler.x += in->mouse.delta.x;
+ }
+ }
+ /* dragging in y-direction (only possible if static window) */
+ if (!(layout->flags & NK_WINDOW_DYNAMIC)) {
+ if (window_size.y < window->bounds.h + in->mouse.delta.y) {
+ if ((in->mouse.delta.y < 0) || (in->mouse.delta.y > 0 && in->mouse.pos.y >= scaler.y)) {
+ window->bounds.h = window->bounds.h + in->mouse.delta.y;
+ scaler.y += in->mouse.delta.y;
+ }
+ }
+ }
+ ctx->style.cursor_active = ctx->style.cursors[NK_CURSOR_RESIZE_TOP_RIGHT_DOWN_LEFT];
+ in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.x = scaler.x + scaler.w/2.0f;
+ in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.y = scaler.y + scaler.h/2.0f;
+ }
+ }
+ }
+ if (!nk_panel_is_sub(layout->type)) {
+ /* window is hidden so clear command buffer */
+ if (layout->flags & NK_WINDOW_HIDDEN)
+ nk_command_buffer_reset(&window->buffer);
+ /* window is visible and not tab */
+ else nk_finish(ctx, window);
+ }
- /* update selector */
- was_active = *active;
- *active = nk_toggle_behavior(in, bounds, state, *active);
+ /* NK_WINDOW_REMOVE_ROM flag was set so remove NK_WINDOW_ROM */
+ if (layout->flags & NK_WINDOW_REMOVE_ROM) {
+ layout->flags &= ~(nk_flags)NK_WINDOW_ROM;
+ layout->flags &= ~(nk_flags)NK_WINDOW_REMOVE_ROM;
+ }
+ window->flags = layout->flags;
- /* draw selector */
- if (style->draw_begin)
- style->draw_begin(out, style->userdata);
- if (type == NK_TOGGLE_CHECK) {
- nk_draw_checkbox(out, *state, style, *active, &label, &select, &cursor, str, len, font);
+ /* property garbage collector */
+ if (window->property.active && window->property.old != window->property.seq &&
+ window->property.active == window->property.prev) {
+ nk_zero(&window->property, sizeof(window->property));
} else {
- nk_draw_option(out, *state, style, *active, &label, &select, &cursor, str, len, font);
+ window->property.old = window->property.seq;
+ window->property.prev = window->property.active;
+ window->property.seq = 0;
}
- if (style->draw_end)
- style->draw_end(out, style->userdata);
- return (was_active != *active);
+ /* edit garbage collector */
+ if (window->edit.active && window->edit.old != window->edit.seq &&
+ window->edit.active == window->edit.prev) {
+ nk_zero(&window->edit, sizeof(window->edit));
+ } else {
+ window->edit.old = window->edit.seq;
+ window->edit.prev = window->edit.active;
+ window->edit.seq = 0;
+ }
+ /* contextual garbage collector */
+ if (window->popup.active_con && window->popup.con_old != window->popup.con_count) {
+ window->popup.con_count = 0;
+ window->popup.con_old = 0;
+ window->popup.active_con = 0;
+ } else {
+ window->popup.con_old = window->popup.con_count;
+ window->popup.con_count = 0;
+ }
+ window->popup.combo_count = 0;
+ /* helper to make sure you have a 'nk_tree_push' for every 'nk_tree_pop' */
+ NK_ASSERT(!layout->row.tree_depth);
}
+
+
+
+
/* ===============================================================
*
- * SELECTABLE
+ * WINDOW
*
* ===============================================================*/
-NK_INTERN void
-nk_draw_selectable(struct nk_command_buffer *out,
- nk_flags state, const struct nk_style_selectable *style, int active,
- const struct nk_rect *bounds, const struct nk_rect *icon, const struct nk_image *img,
- const char *string, int len, nk_flags align, const struct nk_user_font *font)
+NK_LIB void*
+nk_create_window(struct nk_context *ctx)
{
- const struct nk_style_item *background;
- struct nk_text text;
- text.padding = style->padding;
-
- /* select correct colors/images */
- if (!active) {
- if (state & NK_WIDGET_STATE_ACTIVED) {
- background = &style->pressed;
- text.text = style->text_pressed;
- } else if (state & NK_WIDGET_STATE_HOVER) {
- background = &style->hover;
- text.text = style->text_hover;
- } else {
- background = &style->normal;
- text.text = style->text_normal;
- }
- } else {
- if (state & NK_WIDGET_STATE_ACTIVED) {
- background = &style->pressed_active;
- text.text = style->text_pressed_active;
- } else if (state & NK_WIDGET_STATE_HOVER) {
- background = &style->hover_active;
- text.text = style->text_hover_active;
- } else {
- background = &style->normal_active;
- text.text = style->text_normal_active;
- }
+ struct nk_page_element *elem;
+ elem = nk_create_page_element(ctx);
+ if (!elem) return 0;
+ elem->data.win.seq = ctx->seq;
+ return &elem->data.win;
+}
+NK_LIB void
+nk_free_window(struct nk_context *ctx, struct nk_window *win)
+{
+ /* unlink windows from list */
+ struct nk_table *it = win->tables;
+ if (win->popup.win) {
+ nk_free_window(ctx, win->popup.win);
+ win->popup.win = 0;
}
+ win->next = 0;
+ win->prev = 0;
-
- /* draw selectable background and text */
- if (background->type == NK_STYLE_ITEM_IMAGE) {
- nk_draw_image(out, *bounds, &background->data.image, nk_white);
- text.background = nk_rgba(0,0,0,0);
- } else {
- nk_fill_rect(out, *bounds, style->rounding, background->data.color);
- text.background = background->data.color;
+ while (it) {
+ /*free window state tables */
+ struct nk_table *n = it->next;
+ nk_remove_table(win, it);
+ nk_free_table(ctx, it);
+ if (it == win->tables)
+ win->tables = n;
+ it = n;
}
- if (img && icon) nk_draw_image(out, *icon, img, nk_white);
- nk_widget_text(out, *bounds, string, len, &text, align, font);
-}
-NK_INTERN int
-nk_do_selectable(nk_flags *state, struct nk_command_buffer *out,
- struct nk_rect bounds, const char *str, int len, nk_flags align, int *value,
- const struct nk_style_selectable *style, const struct nk_input *in,
- const struct nk_user_font *font)
+ /* link windows into freelist */
+ {union nk_page_data *pd = NK_CONTAINER_OF(win, union nk_page_data, win);
+ struct nk_page_element *pe = NK_CONTAINER_OF(pd, struct nk_page_element, data);
+ nk_free_page_element(ctx, pe);}
+}
+NK_LIB struct nk_window*
+nk_find_window(struct nk_context *ctx, nk_hash hash, const char *name)
{
- int old_value;
- struct nk_rect touch;
-
- NK_ASSERT(state);
- NK_ASSERT(out);
- NK_ASSERT(str);
- NK_ASSERT(len);
- NK_ASSERT(value);
- NK_ASSERT(style);
- NK_ASSERT(font);
-
- if (!state || !out || !str || !len || !value || !style || !font) return 0;
- old_value = *value;
-
- /* remove padding */
- touch.x = bounds.x - style->touch_padding.x;
- touch.y = bounds.y - style->touch_padding.y;
- touch.w = bounds.w + style->touch_padding.x * 2;
- touch.h = bounds.h + style->touch_padding.y * 2;
-
- /* update button */
- if (nk_button_behavior(state, touch, in, NK_BUTTON_DEFAULT))
- *value = !(*value);
-
- /* draw selectable */
- if (style->draw_begin) style->draw_begin(out, style->userdata);
- nk_draw_selectable(out, *state, style, *value, &bounds, 0,0, str, len, align, font);
- if (style->draw_end) style->draw_end(out, style->userdata);
- return old_value != *value;
+ struct nk_window *iter;
+ iter = ctx->begin;
+ while (iter) {
+ NK_ASSERT(iter != iter->next);
+ if (iter->name == hash) {
+ int max_len = nk_strlen(iter->name_string);
+ if (!nk_stricmpn(iter->name_string, name, max_len))
+ return iter;
+ }
+ iter = iter->next;
+ }
+ return 0;
}
-
-NK_INTERN int
-nk_do_selectable_image(nk_flags *state, struct nk_command_buffer *out,
- struct nk_rect bounds, const char *str, int len, nk_flags align, int *value,
- const struct nk_image *img, const struct nk_style_selectable *style,
- const struct nk_input *in, const struct nk_user_font *font)
+NK_LIB void
+nk_insert_window(struct nk_context *ctx, struct nk_window *win,
+ enum nk_window_insert_location loc)
{
- int old_value;
- struct nk_rect touch;
- struct nk_rect icon;
-
- NK_ASSERT(state);
- NK_ASSERT(out);
- NK_ASSERT(str);
- NK_ASSERT(len);
- NK_ASSERT(value);
- NK_ASSERT(style);
- NK_ASSERT(font);
-
- if (!state || !out || !str || !len || !value || !style || !font) return 0;
- old_value = *value;
-
- /* toggle behavior */
- touch.x = bounds.x - style->touch_padding.x;
- touch.y = bounds.y - style->touch_padding.y;
- touch.w = bounds.w + style->touch_padding.x * 2;
- touch.h = bounds.h + style->touch_padding.y * 2;
- if (nk_button_behavior(state, touch, in, NK_BUTTON_DEFAULT))
- *value = !(*value);
-
- icon.y = bounds.y + style->padding.y;
- icon.w = icon.h = bounds.h - 2 * style->padding.y;
- if (align & NK_TEXT_ALIGN_LEFT) {
- icon.x = (bounds.x + bounds.w) - (2 * style->padding.x + icon.w);
- icon.x = NK_MAX(icon.x, 0);
- } else icon.x = bounds.x + 2 * style->padding.x;
+ const struct nk_window *iter;
+ NK_ASSERT(ctx);
+ NK_ASSERT(win);
+ if (!win || !ctx) return;
- icon.x += style->image_padding.x;
- icon.y += style->image_padding.y;
- icon.w -= 2 * style->image_padding.x;
- icon.h -= 2 * style->image_padding.y;
+ iter = ctx->begin;
+ while (iter) {
+ NK_ASSERT(iter != iter->next);
+ NK_ASSERT(iter != win);
+ if (iter == win) return;
+ iter = iter->next;
+ }
- /* draw selectable */
- if (style->draw_begin) style->draw_begin(out, style->userdata);
- nk_draw_selectable(out, *state, style, *value, &bounds, &icon, img, str, len, align, font);
- if (style->draw_end) style->draw_end(out, style->userdata);
- return old_value != *value;
+ if (!ctx->begin) {
+ win->next = 0;
+ win->prev = 0;
+ ctx->begin = win;
+ ctx->end = win;
+ ctx->count = 1;
+ return;
+ }
+ if (loc == NK_INSERT_BACK) {
+ struct nk_window *end;
+ end = ctx->end;
+ end->flags |= NK_WINDOW_ROM;
+ end->next = win;
+ win->prev = ctx->end;
+ win->next = 0;
+ ctx->end = win;
+ ctx->active = ctx->end;
+ ctx->end->flags &= ~(nk_flags)NK_WINDOW_ROM;
+ } else {
+ /*ctx->end->flags |= NK_WINDOW_ROM;*/
+ ctx->begin->prev = win;
+ win->next = ctx->begin;
+ win->prev = 0;
+ ctx->begin = win;
+ ctx->begin->flags &= ~(nk_flags)NK_WINDOW_ROM;
+ }
+ ctx->count++;
}
-
-
-/* ===============================================================
- *
- * SLIDER
- *
- * ===============================================================*/
-NK_INTERN float
-nk_slider_behavior(nk_flags *state, struct nk_rect *logical_cursor,
- struct nk_rect *visual_cursor, struct nk_input *in,
- struct nk_rect bounds, float slider_min, float slider_max, float slider_value,
- float slider_step, float slider_steps)
+NK_LIB void
+nk_remove_window(struct nk_context *ctx, struct nk_window *win)
{
- int left_mouse_down;
- int left_mouse_click_in_cursor;
-
- /* check if visual cursor is being dragged */
- nk_widget_state_reset(state);
- left_mouse_down = in && in->mouse.buttons[NK_BUTTON_LEFT].down;
- left_mouse_click_in_cursor = in && nk_input_has_mouse_click_down_in_rect(in,
- NK_BUTTON_LEFT, *visual_cursor, nk_true);
-
- if (left_mouse_down && left_mouse_click_in_cursor)
- {
- float ratio = 0;
- const float d = in->mouse.pos.x - (visual_cursor->x+visual_cursor->w*0.5f);
- const float pxstep = bounds.w / slider_steps;
-
- /* only update value if the next slider step is reached */
- *state = NK_WIDGET_STATE_ACTIVE;
- if (NK_ABS(d) >= pxstep) {
- const float steps = (float)((int)(NK_ABS(d) / pxstep));
- slider_value += (d > 0) ? (slider_step*steps) : -(slider_step*steps);
- slider_value = NK_CLAMP(slider_min, slider_value, slider_max);
- ratio = (slider_value - slider_min)/slider_step;
- logical_cursor->x = bounds.x + (logical_cursor->w * ratio);
- in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.x = logical_cursor->x;
+ if (win == ctx->begin || win == ctx->end) {
+ if (win == ctx->begin) {
+ ctx->begin = win->next;
+ if (win->next)
+ win->next->prev = 0;
}
+ if (win == ctx->end) {
+ ctx->end = win->prev;
+ if (win->prev)
+ win->prev->next = 0;
+ }
+ } else {
+ if (win->next)
+ win->next->prev = win->prev;
+ if (win->prev)
+ win->prev->next = win->next;
}
-
- /* slider widget state */
- if (nk_input_is_mouse_hovering_rect(in, bounds))
- *state = NK_WIDGET_STATE_HOVERED;
- if (*state & NK_WIDGET_STATE_HOVER &&
- !nk_input_is_mouse_prev_hovering_rect(in, bounds))
- *state |= NK_WIDGET_STATE_ENTERED;
- else if (nk_input_is_mouse_prev_hovering_rect(in, bounds))
- *state |= NK_WIDGET_STATE_LEFT;
- return slider_value;
+ if (win == ctx->active || !ctx->active) {
+ ctx->active = ctx->end;
+ if (ctx->end)
+ ctx->end->flags &= ~(nk_flags)NK_WINDOW_ROM;
+ }
+ win->next = 0;
+ win->prev = 0;
+ ctx->count--;
}
-
-NK_INTERN void
-nk_draw_slider(struct nk_command_buffer *out, nk_flags state,
- const struct nk_style_slider *style, const struct nk_rect *bounds,
- const struct nk_rect *visual_cursor, float min, float value, float max)
+NK_API int
+nk_begin(struct nk_context *ctx, const char *title,
+ struct nk_rect bounds, nk_flags flags)
{
- struct nk_rect fill;
- struct nk_rect bar;
- const struct nk_style_item *background;
-
- /* select correct slider images/colors */
- struct nk_color bar_color;
- const struct nk_style_item *cursor;
+ return nk_begin_titled(ctx, title, title, bounds, flags);
+}
+NK_API int
+nk_begin_titled(struct nk_context *ctx, const char *name, const char *title,
+ struct nk_rect bounds, nk_flags flags)
+{
+ struct nk_window *win;
+ struct nk_style *style;
+ nk_hash name_hash;
+ int name_len;
+ int ret = 0;
- NK_UNUSED(min);
- NK_UNUSED(max);
- NK_UNUSED(value);
+ NK_ASSERT(ctx);
+ NK_ASSERT(name);
+ NK_ASSERT(title);
+ NK_ASSERT(ctx->style.font && ctx->style.font->width && "if this triggers you forgot to add a font");
+ NK_ASSERT(!ctx->current && "if this triggers you missed a `nk_end` call");
+ if (!ctx || ctx->current || !title || !name)
+ return 0;
- if (state & NK_WIDGET_STATE_ACTIVED) {
- background = &style->active;
- bar_color = style->bar_active;
- cursor = &style->cursor_active;
- } else if (state & NK_WIDGET_STATE_HOVER) {
- background = &style->hover;
- bar_color = style->bar_hover;
- cursor = &style->cursor_hover;
- } else {
- background = &style->normal;
- bar_color = style->bar_normal;
- cursor = &style->cursor_normal;
- }
+ /* find or create window */
+ style = &ctx->style;
+ name_len = (int)nk_strlen(name);
+ name_hash = nk_murmur_hash(name, (int)name_len, NK_WINDOW_TITLE);
+ win = nk_find_window(ctx, name_hash, name);
+ if (!win) {
+ /* create new window */
+ nk_size name_length = (nk_size)name_len;
+ win = (struct nk_window*)nk_create_window(ctx);
+ NK_ASSERT(win);
+ if (!win) return 0;
- /* calculate slider background bar */
- bar.x = bounds->x;
- bar.y = (visual_cursor->y + visual_cursor->h/2) - bounds->h/12;
- bar.w = bounds->w;
- bar.h = bounds->h/6;
+ if (flags & NK_WINDOW_BACKGROUND)
+ nk_insert_window(ctx, win, NK_INSERT_FRONT);
+ else nk_insert_window(ctx, win, NK_INSERT_BACK);
+ nk_command_buffer_init(&win->buffer, &ctx->memory, NK_CLIPPING_ON);
- /* filled background bar style */
- fill.w = (visual_cursor->x + (visual_cursor->w/2.0f)) - bar.x;
- fill.x = bar.x;
- fill.y = bar.y;
- fill.h = bar.h;
-
- /* draw background */
- if (background->type == NK_STYLE_ITEM_IMAGE) {
- nk_draw_image(out, *bounds, &background->data.image, nk_white);
+ win->flags = flags;
+ win->bounds = bounds;
+ win->name = name_hash;
+ name_length = NK_MIN(name_length, NK_WINDOW_MAX_NAME-1);
+ NK_MEMCPY(win->name_string, name, name_length);
+ win->name_string[name_length] = 0;
+ win->popup.win = 0;
+ if (!ctx->active)
+ ctx->active = win;
} else {
- nk_fill_rect(out, *bounds, style->rounding, background->data.color);
- nk_stroke_rect(out, *bounds, style->rounding, style->border, style->border_color);
+ /* update window */
+ win->flags &= ~(nk_flags)(NK_WINDOW_PRIVATE-1);
+ win->flags |= flags;
+ if (!(win->flags & (NK_WINDOW_MOVABLE | NK_WINDOW_SCALABLE)))
+ win->bounds = bounds;
+ /* If this assert triggers you either:
+ *
+ * I.) Have more than one window with the same name or
+ * II.) You forgot to actually draw the window.
+ * More specific you did not call `nk_clear` (nk_clear will be
+ * automatically called for you if you are using one of the
+ * provided demo backends). */
+ NK_ASSERT(win->seq != ctx->seq);
+ win->seq = ctx->seq;
+ if (!ctx->active && !(win->flags & NK_WINDOW_HIDDEN)) {
+ ctx->active = win;
+ ctx->end = win;
+ }
}
-
- /* draw slider bar */
- nk_fill_rect(out, bar, style->rounding, bar_color);
- nk_fill_rect(out, fill, style->rounding, style->bar_filled);
-
- /* draw cursor */
- if (cursor->type == NK_STYLE_ITEM_IMAGE)
- nk_draw_image(out, *visual_cursor, &cursor->data.image, nk_white);
- else nk_fill_circle(out, *visual_cursor, cursor->data.color);
-}
-
-NK_INTERN float
-nk_do_slider(nk_flags *state,
- struct nk_command_buffer *out, struct nk_rect bounds,
- float min, float val, float max, float step,
- const struct nk_style_slider *style, struct nk_input *in,
- const struct nk_user_font *font)
-{
- float slider_range;
- float slider_min;
- float slider_max;
- float slider_value;
- float slider_steps;
- float cursor_offset;
-
- struct nk_rect visual_cursor;
- struct nk_rect logical_cursor;
-
- NK_ASSERT(style);
- NK_ASSERT(out);
- if (!out || !style)
+ if (win->flags & NK_WINDOW_HIDDEN) {
+ ctx->current = win;
+ win->layout = 0;
return 0;
+ } else nk_start(ctx, win);
- /* remove padding from slider bounds */
- bounds.x = bounds.x + style->padding.x;
- bounds.y = bounds.y + style->padding.y;
- bounds.h = NK_MAX(bounds.h, 2*style->padding.y);
- bounds.w = NK_MAX(bounds.w, 2*style->padding.x + style->cursor_size.x);
- bounds.w -= 2 * style->padding.x;
- bounds.h -= 2 * style->padding.y;
-
- /* optional buttons */
- if (style->show_buttons) {
- nk_flags ws;
- struct nk_rect button;
- button.y = bounds.y;
- button.w = bounds.h;
- button.h = bounds.h;
+ /* window overlapping */
+ if (!(win->flags & NK_WINDOW_HIDDEN) && !(win->flags & NK_WINDOW_NO_INPUT))
+ {
+ int inpanel, ishovered;
+ struct nk_window *iter = win;
+ float h = ctx->style.font->height + 2.0f * style->window.header.padding.y +
+ (2.0f * style->window.header.label_padding.y);
+ struct nk_rect win_bounds = (!(win->flags & NK_WINDOW_MINIMIZED))?
+ win->bounds: nk_rect(win->bounds.x, win->bounds.y, win->bounds.w, h);
- /* decrement button */
- button.x = bounds.x;
- if (nk_do_button_symbol(&ws, out, button, style->dec_symbol, NK_BUTTON_DEFAULT,
- &style->dec_button, in, font))
- val -= step;
+ /* activate window if hovered and no other window is overlapping this window */
+ inpanel = nk_input_has_mouse_click_down_in_rect(&ctx->input, NK_BUTTON_LEFT, win_bounds, nk_true);
+ inpanel = inpanel && ctx->input.mouse.buttons[NK_BUTTON_LEFT].clicked;
+ ishovered = nk_input_is_mouse_hovering_rect(&ctx->input, win_bounds);
+ if ((win != ctx->active) && ishovered && !ctx->input.mouse.buttons[NK_BUTTON_LEFT].down) {
+ iter = win->next;
+ while (iter) {
+ struct nk_rect iter_bounds = (!(iter->flags & NK_WINDOW_MINIMIZED))?
+ iter->bounds: nk_rect(iter->bounds.x, iter->bounds.y, iter->bounds.w, h);
+ if (NK_INTERSECT(win_bounds.x, win_bounds.y, win_bounds.w, win_bounds.h,
+ iter_bounds.x, iter_bounds.y, iter_bounds.w, iter_bounds.h) &&
+ (!(iter->flags & NK_WINDOW_HIDDEN)))
+ break;
- /* increment button */
- button.x = (bounds.x + bounds.w) - button.w;
- if (nk_do_button_symbol(&ws, out, button, style->inc_symbol, NK_BUTTON_DEFAULT,
- &style->inc_button, in, font))
- val += step;
+ if (iter->popup.win && iter->popup.active && !(iter->flags & NK_WINDOW_HIDDEN) &&
+ NK_INTERSECT(win->bounds.x, win_bounds.y, win_bounds.w, win_bounds.h,
+ iter->popup.win->bounds.x, iter->popup.win->bounds.y,
+ iter->popup.win->bounds.w, iter->popup.win->bounds.h))
+ break;
+ iter = iter->next;
+ }
+ }
- bounds.x = bounds.x + button.w + style->spacing.x;
- bounds.w = bounds.w - (2*button.w + 2*style->spacing.x);
+ /* activate window if clicked */
+ if (iter && inpanel && (win != ctx->end)) {
+ iter = win->next;
+ while (iter) {
+ /* try to find a panel with higher priority in the same position */
+ struct nk_rect iter_bounds = (!(iter->flags & NK_WINDOW_MINIMIZED))?
+ iter->bounds: nk_rect(iter->bounds.x, iter->bounds.y, iter->bounds.w, h);
+ if (NK_INBOX(ctx->input.mouse.pos.x, ctx->input.mouse.pos.y,
+ iter_bounds.x, iter_bounds.y, iter_bounds.w, iter_bounds.h) &&
+ !(iter->flags & NK_WINDOW_HIDDEN))
+ break;
+ if (iter->popup.win && iter->popup.active && !(iter->flags & NK_WINDOW_HIDDEN) &&
+ NK_INTERSECT(win_bounds.x, win_bounds.y, win_bounds.w, win_bounds.h,
+ iter->popup.win->bounds.x, iter->popup.win->bounds.y,
+ iter->popup.win->bounds.w, iter->popup.win->bounds.h))
+ break;
+ iter = iter->next;
+ }
+ }
+ if (iter && !(win->flags & NK_WINDOW_ROM) && (win->flags & NK_WINDOW_BACKGROUND)) {
+ win->flags |= (nk_flags)NK_WINDOW_ROM;
+ iter->flags &= ~(nk_flags)NK_WINDOW_ROM;
+ ctx->active = iter;
+ if (!(iter->flags & NK_WINDOW_BACKGROUND)) {
+ /* current window is active in that position so transfer to top
+ * at the highest priority in stack */
+ nk_remove_window(ctx, iter);
+ nk_insert_window(ctx, iter, NK_INSERT_BACK);
+ }
+ } else {
+ if (!iter && ctx->end != win) {
+ if (!(win->flags & NK_WINDOW_BACKGROUND)) {
+ /* current window is active in that position so transfer to top
+ * at the highest priority in stack */
+ nk_remove_window(ctx, win);
+ nk_insert_window(ctx, win, NK_INSERT_BACK);
+ }
+ win->flags &= ~(nk_flags)NK_WINDOW_ROM;
+ ctx->active = win;
+ }
+ if (ctx->end != win && !(win->flags & NK_WINDOW_BACKGROUND))
+ win->flags |= NK_WINDOW_ROM;
+ }
}
-
- /* remove one cursor size to support visual cursor */
- bounds.x += style->cursor_size.x*0.5f;
- bounds.w -= style->cursor_size.x;
-
- /* make sure the provided values are correct */
- slider_max = NK_MAX(min, max);
- slider_min = NK_MIN(min, max);
- slider_value = NK_CLAMP(slider_min, val, slider_max);
- slider_range = slider_max - slider_min;
- slider_steps = slider_range / step;
- cursor_offset = (slider_value - slider_min) / step;
-
- /* calculate cursor
- Basically you have two cursors. One for visual representation and interaction
- and one for updating the actual cursor value. */
- logical_cursor.h = bounds.h;
- logical_cursor.w = bounds.w / slider_steps;
- logical_cursor.x = bounds.x + (logical_cursor.w * cursor_offset);
- logical_cursor.y = bounds.y;
-
- visual_cursor.h = style->cursor_size.y;
- visual_cursor.w = style->cursor_size.x;
- visual_cursor.y = (bounds.y + bounds.h*0.5f) - visual_cursor.h*0.5f;
- visual_cursor.x = logical_cursor.x - visual_cursor.w*0.5f;
-
- slider_value = nk_slider_behavior(state, &logical_cursor, &visual_cursor,
- in, bounds, slider_min, slider_max, slider_value, step, slider_steps);
- visual_cursor.x = logical_cursor.x - visual_cursor.w*0.5f;
-
- /* draw slider */
- if (style->draw_begin) style->draw_begin(out, style->userdata);
- nk_draw_slider(out, *state, style, &bounds, &visual_cursor, slider_min, slider_value, slider_max);
- if (style->draw_end) style->draw_end(out, style->userdata);
- return slider_value;
+ win->layout = (struct nk_panel*)nk_create_panel(ctx);
+ ctx->current = win;
+ ret = nk_panel_begin(ctx, title, NK_PANEL_WINDOW);
+ win->layout->offset_x = &win->scrollbar.x;
+ win->layout->offset_y = &win->scrollbar.y;
+ return ret;
}
-
-/* ===============================================================
- *
- * PROGRESSBAR
- *
- * ===============================================================*/
-NK_INTERN nk_size
-nk_progress_behavior(nk_flags *state, const struct nk_input *in,
- struct nk_rect r, nk_size max, nk_size value, int modifiable)
+NK_API void
+nk_end(struct nk_context *ctx)
{
- nk_widget_state_reset(state);
- if (in && modifiable && nk_input_is_mouse_hovering_rect(in, r)) {
- int left_mouse_down = in->mouse.buttons[NK_BUTTON_LEFT].down;
- int left_mouse_click_in_cursor = nk_input_has_mouse_click_down_in_rect(in,
- NK_BUTTON_LEFT, r, nk_true);
+ struct nk_panel *layout;
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current && "if this triggers you forgot to call `nk_begin`");
+ if (!ctx || !ctx->current)
+ return;
- if (left_mouse_down && left_mouse_click_in_cursor) {
- float ratio = NK_MAX(0, (float)(in->mouse.pos.x - r.x)) / (float)r.w;
- value = (nk_size)NK_MAX(0,((float)max * ratio));
- *state = NK_WIDGET_STATE_ACTIVE;
- } else *state = NK_WIDGET_STATE_HOVERED;
+ layout = ctx->current->layout;
+ if (!layout || (layout->type == NK_PANEL_WINDOW && (ctx->current->flags & NK_WINDOW_HIDDEN))) {
+ ctx->current = 0;
+ return;
}
-
- /* set progressbar widget state */
- if (*state & NK_WIDGET_STATE_HOVER && !nk_input_is_mouse_prev_hovering_rect(in, r))
- *state |= NK_WIDGET_STATE_ENTERED;
- else if (nk_input_is_mouse_prev_hovering_rect(in, r))
- *state |= NK_WIDGET_STATE_LEFT;
-
- if (!max) return value;
- value = NK_MIN(value, max);
- return value;
+ nk_panel_end(ctx);
+ nk_free_panel(ctx, ctx->current->layout);
+ ctx->current = 0;
}
-
-NK_INTERN void
-nk_draw_progress(struct nk_command_buffer *out, nk_flags state,
- const struct nk_style_progress *style, const struct nk_rect *bounds,
- const struct nk_rect *scursor, nk_size value, nk_size max)
+NK_API struct nk_rect
+nk_window_get_bounds(const struct nk_context *ctx)
{
- const struct nk_style_item *background;
- const struct nk_style_item *cursor;
-
- NK_UNUSED(max);
- NK_UNUSED(value);
-
- /* select correct colors/images to draw */
- if (state & NK_WIDGET_STATE_ACTIVED) {
- background = &style->active;
- cursor = &style->cursor_active;
- } else if (state & NK_WIDGET_STATE_HOVER){
- background = &style->hover;
- cursor = &style->cursor_hover;
- } else {
- background = &style->normal;
- cursor = &style->cursor_normal;
- }
-
- /* draw background */
- if (background->type == NK_STYLE_ITEM_COLOR) {
- nk_fill_rect(out, *bounds, style->rounding, background->data.color);
- nk_stroke_rect(out, *bounds, style->rounding, style->border, style->border_color);
- } else nk_draw_image(out, *bounds, &background->data.image, nk_white);
-
- /* draw cursor */
- if (background->type == NK_STYLE_ITEM_COLOR) {
- nk_fill_rect(out, *scursor, style->rounding, cursor->data.color);
- nk_stroke_rect(out, *scursor, style->rounding, style->border, style->border_color);
- } else nk_draw_image(out, *scursor, &cursor->data.image, nk_white);
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ if (!ctx || !ctx->current) return nk_rect(0,0,0,0);
+ return ctx->current->bounds;
}
-
-NK_INTERN nk_size
-nk_do_progress(nk_flags *state,
- struct nk_command_buffer *out, struct nk_rect bounds,
- nk_size value, nk_size max, int modifiable,
- const struct nk_style_progress *style, const struct nk_input *in)
+NK_API struct nk_vec2
+nk_window_get_position(const struct nk_context *ctx)
{
- float prog_scale;
- nk_size prog_value;
- struct nk_rect cursor;
-
- NK_ASSERT(style);
- NK_ASSERT(out);
- if (!out || !style) return 0;
-
- /* calculate progressbar cursor */
- cursor.w = NK_MAX(bounds.w, 2 * style->padding.x + 2 * style->border);
- cursor.h = NK_MAX(bounds.h, 2 * style->padding.y + 2 * style->border);
- cursor = nk_pad_rect(bounds, nk_vec2(style->padding.x + style->border, style->padding.y + style->border));
- prog_scale = (float)value / (float)max;
- cursor.w = (bounds.w - 2) * prog_scale;
-
- /* update progressbar */
- prog_value = NK_MIN(value, max);
- prog_value = nk_progress_behavior(state, in, bounds, max, prog_value, modifiable);
-
- /* draw progressbar */
- if (style->draw_begin) style->draw_begin(out, style->userdata);
- nk_draw_progress(out, *state, style, &bounds, &cursor, value, max);
- if (style->draw_end) style->draw_end(out, style->userdata);
- return prog_value;
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ if (!ctx || !ctx->current) return nk_vec2(0,0);
+ return nk_vec2(ctx->current->bounds.x, ctx->current->bounds.y);
}
-
-/* ===============================================================
- *
- * SCROLLBAR
- *
- * ===============================================================*/
-NK_INTERN float
-nk_scrollbar_behavior(nk_flags *state, struct nk_input *in,
- int has_scrolling, const struct nk_rect *scroll,
- const struct nk_rect *cursor, const struct nk_rect *empty0,
- const struct nk_rect *empty1, float scroll_offset,
- float target, float scroll_step, enum nk_orientation o)
+NK_API struct nk_vec2
+nk_window_get_size(const struct nk_context *ctx)
{
- nk_flags ws = 0;
- int left_mouse_down;
- int left_mouse_click_in_cursor;
- float scroll_delta;
-
- nk_widget_state_reset(state);
- if (!in) return scroll_offset;
-
- left_mouse_down = in->mouse.buttons[NK_BUTTON_LEFT].down;
- left_mouse_click_in_cursor = nk_input_has_mouse_click_down_in_rect(in,
- NK_BUTTON_LEFT, *cursor, nk_true);
- if (nk_input_is_mouse_hovering_rect(in, *scroll))
- *state = NK_WIDGET_STATE_HOVERED;
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ if (!ctx || !ctx->current) return nk_vec2(0,0);
+ return nk_vec2(ctx->current->bounds.w, ctx->current->bounds.h);
+}
+NK_API float
+nk_window_get_width(const struct nk_context *ctx)
+{
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ if (!ctx || !ctx->current) return 0;
+ return ctx->current->bounds.w;
+}
+NK_API float
+nk_window_get_height(const struct nk_context *ctx)
+{
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ if (!ctx || !ctx->current) return 0;
+ return ctx->current->bounds.h;
+}
+NK_API struct nk_rect
+nk_window_get_content_region(struct nk_context *ctx)
+{
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ if (!ctx || !ctx->current) return nk_rect(0,0,0,0);
+ return ctx->current->layout->clip;
+}
+NK_API struct nk_vec2
+nk_window_get_content_region_min(struct nk_context *ctx)
+{
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current) return nk_vec2(0,0);
+ return nk_vec2(ctx->current->layout->clip.x, ctx->current->layout->clip.y);
+}
+NK_API struct nk_vec2
+nk_window_get_content_region_max(struct nk_context *ctx)
+{
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current) return nk_vec2(0,0);
+ return nk_vec2(ctx->current->layout->clip.x + ctx->current->layout->clip.w,
+ ctx->current->layout->clip.y + ctx->current->layout->clip.h);
+}
+NK_API struct nk_vec2
+nk_window_get_content_region_size(struct nk_context *ctx)
+{
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current) return nk_vec2(0,0);
+ return nk_vec2(ctx->current->layout->clip.w, ctx->current->layout->clip.h);
+}
+NK_API struct nk_command_buffer*
+nk_window_get_canvas(struct nk_context *ctx)
+{
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current) return 0;
+ return &ctx->current->buffer;
+}
+NK_API struct nk_panel*
+nk_window_get_panel(struct nk_context *ctx)
+{
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ if (!ctx || !ctx->current) return 0;
+ return ctx->current->layout;
+}
+NK_API void
+nk_window_get_scroll(struct nk_context *ctx, nk_uint *offset_x, nk_uint *offset_y)
+{
+ struct nk_window *win;
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ if (!ctx || !ctx->current)
+ return ;
+ win = ctx->current;
+ if (offset_x)
+ *offset_x = win->scrollbar.x;
+ if (offset_y)
+ *offset_y = win->scrollbar.y;
+}
+NK_API int
+nk_window_has_focus(const struct nk_context *ctx)
+{
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current) return 0;
+ return ctx->current == ctx->active;
+}
+NK_API int
+nk_window_is_hovered(struct nk_context *ctx)
+{
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ if (!ctx || !ctx->current) return 0;
+ if(ctx->current->flags & NK_WINDOW_HIDDEN)
+ return 0;
+ return nk_input_is_mouse_hovering_rect(&ctx->input, ctx->current->bounds);
+}
+NK_API int
+nk_window_is_any_hovered(struct nk_context *ctx)
+{
+ struct nk_window *iter;
+ NK_ASSERT(ctx);
+ if (!ctx) return 0;
+ iter = ctx->begin;
+ while (iter) {
+ /* check if window is being hovered */
+ if(!(iter->flags & NK_WINDOW_HIDDEN)) {
+ /* check if window popup is being hovered */
+ if (iter->popup.active && iter->popup.win && nk_input_is_mouse_hovering_rect(&ctx->input, iter->popup.win->bounds))
+ return 1;
- scroll_delta = (o == NK_VERTICAL) ? in->mouse.scroll_delta.y: in->mouse.scroll_delta.x;
- if (left_mouse_down && left_mouse_click_in_cursor) {
- /* update cursor by mouse dragging */
- float pixel, delta;
- *state = NK_WIDGET_STATE_ACTIVE;
- if (o == NK_VERTICAL) {
- float cursor_y;
- pixel = in->mouse.delta.y;
- delta = (pixel / scroll->h) * target;
- scroll_offset = NK_CLAMP(0, scroll_offset + delta, target - scroll->h);
- cursor_y = scroll->y + ((scroll_offset/target) * scroll->h);
- in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.y = cursor_y + cursor->h/2.0f;
- } else {
- float cursor_x;
- pixel = in->mouse.delta.x;
- delta = (pixel / scroll->w) * target;
- scroll_offset = NK_CLAMP(0, scroll_offset + delta, target - scroll->w);
- cursor_x = scroll->x + ((scroll_offset/target) * scroll->w);
- in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.x = cursor_x + cursor->w/2.0f;
- }
- } else if ((nk_input_is_key_pressed(in, NK_KEY_SCROLL_UP) && o == NK_VERTICAL && has_scrolling)||
- nk_button_behavior(&ws, *empty0, in, NK_BUTTON_DEFAULT)) {
- /* scroll page up by click on empty space or shortcut */
- if (o == NK_VERTICAL)
- scroll_offset = NK_MAX(0, scroll_offset - scroll->h);
- else scroll_offset = NK_MAX(0, scroll_offset - scroll->w);
- } else if ((nk_input_is_key_pressed(in, NK_KEY_SCROLL_DOWN) && o == NK_VERTICAL && has_scrolling) ||
- nk_button_behavior(&ws, *empty1, in, NK_BUTTON_DEFAULT)) {
- /* scroll page down by click on empty space or shortcut */
- if (o == NK_VERTICAL)
- scroll_offset = NK_MIN(scroll_offset + scroll->h, target - scroll->h);
- else scroll_offset = NK_MIN(scroll_offset + scroll->w, target - scroll->w);
- } else if (has_scrolling) {
- if ((scroll_delta < 0 || (scroll_delta > 0))) {
- /* update cursor by mouse scrolling */
- scroll_offset = scroll_offset + scroll_step * (-scroll_delta);
- if (o == NK_VERTICAL)
- scroll_offset = NK_CLAMP(0, scroll_offset, target - scroll->h);
- else scroll_offset = NK_CLAMP(0, scroll_offset, target - scroll->w);
- } else if (nk_input_is_key_pressed(in, NK_KEY_SCROLL_START)) {
- /* update cursor to the beginning */
- if (o == NK_VERTICAL) scroll_offset = 0;
- } else if (nk_input_is_key_pressed(in, NK_KEY_SCROLL_END)) {
- /* update cursor to the end */
- if (o == NK_VERTICAL) scroll_offset = target - scroll->h;
+ if (iter->flags & NK_WINDOW_MINIMIZED) {
+ struct nk_rect header = iter->bounds;
+ header.h = ctx->style.font->height + 2 * ctx->style.window.header.padding.y;
+ if (nk_input_is_mouse_hovering_rect(&ctx->input, header))
+ return 1;
+ } else if (nk_input_is_mouse_hovering_rect(&ctx->input, iter->bounds)) {
+ return 1;
+ }
}
+ iter = iter->next;
}
- if (*state & NK_WIDGET_STATE_HOVER && !nk_input_is_mouse_prev_hovering_rect(in, *scroll))
- *state |= NK_WIDGET_STATE_ENTERED;
- else if (nk_input_is_mouse_prev_hovering_rect(in, *scroll))
- *state |= NK_WIDGET_STATE_LEFT;
- return scroll_offset;
+ return 0;
+}
+NK_API int
+nk_item_is_any_active(struct nk_context *ctx)
+{
+ int any_hovered = nk_window_is_any_hovered(ctx);
+ int any_active = (ctx->last_widget_state & NK_WIDGET_STATE_MODIFIED);
+ return any_hovered || any_active;
}
+NK_API int
+nk_window_is_collapsed(struct nk_context *ctx, const char *name)
+{
+ int title_len;
+ nk_hash title_hash;
+ struct nk_window *win;
+ NK_ASSERT(ctx);
+ if (!ctx) return 0;
-NK_INTERN void
-nk_draw_scrollbar(struct nk_command_buffer *out, nk_flags state,
- const struct nk_style_scrollbar *style, const struct nk_rect *bounds,
- const struct nk_rect *scroll)
+ title_len = (int)nk_strlen(name);
+ title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE);
+ win = nk_find_window(ctx, title_hash, name);
+ if (!win) return 0;
+ return win->flags & NK_WINDOW_MINIMIZED;
+}
+NK_API int
+nk_window_is_closed(struct nk_context *ctx, const char *name)
{
- const struct nk_style_item *background;
- const struct nk_style_item *cursor;
+ int title_len;
+ nk_hash title_hash;
+ struct nk_window *win;
+ NK_ASSERT(ctx);
+ if (!ctx) return 1;
- /* select correct colors/images to draw */
- if (state & NK_WIDGET_STATE_ACTIVED) {
- background = &style->active;
- cursor = &style->cursor_active;
- } else if (state & NK_WIDGET_STATE_HOVER) {
- background = &style->hover;
- cursor = &style->cursor_hover;
- } else {
- background = &style->normal;
- cursor = &style->cursor_normal;
- }
+ title_len = (int)nk_strlen(name);
+ title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE);
+ win = nk_find_window(ctx, title_hash, name);
+ if (!win) return 1;
+ return (win->flags & NK_WINDOW_CLOSED);
+}
+NK_API int
+nk_window_is_hidden(struct nk_context *ctx, const char *name)
+{
+ int title_len;
+ nk_hash title_hash;
+ struct nk_window *win;
+ NK_ASSERT(ctx);
+ if (!ctx) return 1;
- /* draw background */
- if (background->type == NK_STYLE_ITEM_COLOR) {
- nk_fill_rect(out, *bounds, style->rounding, background->data.color);
- nk_stroke_rect(out, *bounds, style->rounding, style->border, style->border_color);
- } else {
- nk_draw_image(out, *bounds, &background->data.image, nk_white);
- }
+ title_len = (int)nk_strlen(name);
+ title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE);
+ win = nk_find_window(ctx, title_hash, name);
+ if (!win) return 1;
+ return (win->flags & NK_WINDOW_HIDDEN);
+}
+NK_API int
+nk_window_is_active(struct nk_context *ctx, const char *name)
+{
+ int title_len;
+ nk_hash title_hash;
+ struct nk_window *win;
+ NK_ASSERT(ctx);
+ if (!ctx) return 0;
- /* draw cursor */
- if (background->type == NK_STYLE_ITEM_COLOR) {
- nk_fill_rect(out, *scroll, style->rounding_cursor, cursor->data.color);
- nk_stroke_rect(out, *scroll, style->rounding_cursor, style->border_cursor, style->cursor_border_color);
- } else nk_draw_image(out, *scroll, &cursor->data.image, nk_white);
+ title_len = (int)nk_strlen(name);
+ title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE);
+ win = nk_find_window(ctx, title_hash, name);
+ if (!win) return 0;
+ return win == ctx->active;
+}
+NK_API struct nk_window*
+nk_window_find(struct nk_context *ctx, const char *name)
+{
+ int title_len;
+ nk_hash title_hash;
+ title_len = (int)nk_strlen(name);
+ title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE);
+ return nk_find_window(ctx, title_hash, name);
}
+NK_API void
+nk_window_close(struct nk_context *ctx, const char *name)
+{
+ struct nk_window *win;
+ NK_ASSERT(ctx);
+ if (!ctx) return;
+ win = nk_window_find(ctx, name);
+ if (!win) return;
+ NK_ASSERT(ctx->current != win && "You cannot close a currently active window");
+ if (ctx->current == win) return;
+ win->flags |= NK_WINDOW_HIDDEN;
+ win->flags |= NK_WINDOW_CLOSED;
+}
+NK_API void
+nk_window_set_bounds(struct nk_context *ctx,
+ const char *name, struct nk_rect bounds)
+{
+ struct nk_window *win;
+ NK_ASSERT(ctx);
+ if (!ctx) return;
+ win = nk_window_find(ctx, name);
+ if (!win) return;
+ NK_ASSERT(ctx->current != win && "You cannot update a currently in procecss window");
+ win->bounds = bounds;
+}
+NK_API void
+nk_window_set_position(struct nk_context *ctx,
+ const char *name, struct nk_vec2 pos)
+{
+ struct nk_window *win = nk_window_find(ctx, name);
+ if (!win) return;
+ win->bounds.x = pos.x;
+ win->bounds.y = pos.y;
+}
+NK_API void
+nk_window_set_size(struct nk_context *ctx,
+ const char *name, struct nk_vec2 size)
+{
+ struct nk_window *win = nk_window_find(ctx, name);
+ if (!win) return;
+ win->bounds.w = size.x;
+ win->bounds.h = size.y;
+}
+NK_API void
+nk_window_set_scroll(struct nk_context *ctx, nk_uint offset_x, nk_uint offset_y)
+{
+ struct nk_window *win;
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ if (!ctx || !ctx->current)
+ return;
+ win = ctx->current;
+ win->scrollbar.x = offset_x;
+ win->scrollbar.y = offset_y;
+}
+NK_API void
+nk_window_collapse(struct nk_context *ctx, const char *name,
+ enum nk_collapse_states c)
+{
+ int title_len;
+ nk_hash title_hash;
+ struct nk_window *win;
+ NK_ASSERT(ctx);
+ if (!ctx) return;
-NK_INTERN float
-nk_do_scrollbarv(nk_flags *state,
- struct nk_command_buffer *out, struct nk_rect scroll, int has_scrolling,
- float offset, float target, float step, float button_pixel_inc,
- const struct nk_style_scrollbar *style, struct nk_input *in,
- const struct nk_user_font *font)
+ title_len = (int)nk_strlen(name);
+ title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE);
+ win = nk_find_window(ctx, title_hash, name);
+ if (!win) return;
+ if (c == NK_MINIMIZED)
+ win->flags |= NK_WINDOW_MINIMIZED;
+ else win->flags &= ~(nk_flags)NK_WINDOW_MINIMIZED;
+}
+NK_API void
+nk_window_collapse_if(struct nk_context *ctx, const char *name,
+ enum nk_collapse_states c, int cond)
{
- struct nk_rect empty_north;
- struct nk_rect empty_south;
- struct nk_rect cursor;
+ NK_ASSERT(ctx);
+ if (!ctx || !cond) return;
+ nk_window_collapse(ctx, name, c);
+}
+NK_API void
+nk_window_show(struct nk_context *ctx, const char *name, enum nk_show_states s)
+{
+ int title_len;
+ nk_hash title_hash;
+ struct nk_window *win;
+ NK_ASSERT(ctx);
+ if (!ctx) return;
- float scroll_step;
- float scroll_offset;
- float scroll_off;
- float scroll_ratio;
+ title_len = (int)nk_strlen(name);
+ title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE);
+ win = nk_find_window(ctx, title_hash, name);
+ if (!win) return;
+ if (s == NK_HIDDEN) {
+ win->flags |= NK_WINDOW_HIDDEN;
+ } else win->flags &= ~(nk_flags)NK_WINDOW_HIDDEN;
+}
+NK_API void
+nk_window_show_if(struct nk_context *ctx, const char *name,
+ enum nk_show_states s, int cond)
+{
+ NK_ASSERT(ctx);
+ if (!ctx || !cond) return;
+ nk_window_show(ctx, name, s);
+}
- NK_ASSERT(out);
- NK_ASSERT(style);
- NK_ASSERT(state);
- if (!out || !style) return 0;
+NK_API void
+nk_window_set_focus(struct nk_context *ctx, const char *name)
+{
+ int title_len;
+ nk_hash title_hash;
+ struct nk_window *win;
+ NK_ASSERT(ctx);
+ if (!ctx) return;
- scroll.w = NK_MAX(scroll.w, 1);
- scroll.h = NK_MAX(scroll.h, 0);
- if (target <= scroll.h) return 0;
+ title_len = (int)nk_strlen(name);
+ title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE);
+ win = nk_find_window(ctx, title_hash, name);
+ if (win && ctx->end != win) {
+ nk_remove_window(ctx, win);
+ nk_insert_window(ctx, win, NK_INSERT_BACK);
+ }
+ ctx->active = win;
+}
- /* optional scrollbar buttons */
- if (style->show_buttons) {
- nk_flags ws;
- float scroll_h;
- struct nk_rect button;
- button.x = scroll.x;
- button.w = scroll.w;
- button.h = scroll.w;
- scroll_h = NK_MAX(scroll.h - 2 * button.h,0);
- scroll_step = NK_MIN(step, button_pixel_inc);
- /* decrement button */
- button.y = scroll.y;
- if (nk_do_button_symbol(&ws, out, button, style->dec_symbol,
- NK_BUTTON_REPEATER, &style->dec_button, in, font))
- offset = offset - scroll_step;
+/* ===============================================================
+ *
+ * POPUP
+ *
+ * ===============================================================*/
+NK_API int
+nk_popup_begin(struct nk_context *ctx, enum nk_popup_type type,
+ const char *title, nk_flags flags, struct nk_rect rect)
+{
+ struct nk_window *popup;
+ struct nk_window *win;
+ struct nk_panel *panel;
- /* increment button */
- button.y = scroll.y + scroll.h - button.h;
- if (nk_do_button_symbol(&ws, out, button, style->inc_symbol,
- NK_BUTTON_REPEATER, &style->inc_button, in, font))
- offset = offset + scroll_step;
+ int title_len;
+ nk_hash title_hash;
+ nk_size allocated;
- scroll.y = scroll.y + button.h;
- scroll.h = scroll_h;
- }
+ NK_ASSERT(ctx);
+ NK_ASSERT(title);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout)
+ return 0;
- /* calculate scrollbar constants */
- scroll_step = NK_MIN(step, scroll.h);
- scroll_offset = NK_CLAMP(0, offset, target - scroll.h);
- scroll_ratio = scroll.h / target;
- scroll_off = scroll_offset / target;
+ win = ctx->current;
+ panel = win->layout;
+ NK_ASSERT(!(panel->type & NK_PANEL_SET_POPUP) && "popups are not allowed to have popups");
+ (void)panel;
+ title_len = (int)nk_strlen(title);
+ title_hash = nk_murmur_hash(title, (int)title_len, NK_PANEL_POPUP);
- /* calculate scrollbar cursor bounds */
- cursor.h = NK_MAX((scroll_ratio * scroll.h) - (2*style->border + 2*style->padding.y), 0);
- cursor.y = scroll.y + (scroll_off * scroll.h) + style->border + style->padding.y;
- cursor.w = scroll.w - (2 * style->border + 2 * style->padding.x);
- cursor.x = scroll.x + style->border + style->padding.x;
+ popup = win->popup.win;
+ if (!popup) {
+ popup = (struct nk_window*)nk_create_window(ctx);
+ popup->parent = win;
+ win->popup.win = popup;
+ win->popup.active = 0;
+ win->popup.type = NK_PANEL_POPUP;
+ }
- /* calculate empty space around cursor */
- empty_north.x = scroll.x;
- empty_north.y = scroll.y;
- empty_north.w = scroll.w;
- empty_north.h = NK_MAX(cursor.y - scroll.y, 0);
+ /* make sure we have correct popup */
+ if (win->popup.name != title_hash) {
+ if (!win->popup.active) {
+ nk_zero(popup, sizeof(*popup));
+ win->popup.name = title_hash;
+ win->popup.active = 1;
+ win->popup.type = NK_PANEL_POPUP;
+ } else return 0;
+ }
- empty_south.x = scroll.x;
- empty_south.y = cursor.y + cursor.h;
- empty_south.w = scroll.w;
- empty_south.h = NK_MAX((scroll.y + scroll.h) - (cursor.y + cursor.h), 0);
+ /* popup position is local to window */
+ ctx->current = popup;
+ rect.x += win->layout->clip.x;
+ rect.y += win->layout->clip.y;
- /* update scrollbar */
- scroll_offset = nk_scrollbar_behavior(state, in, has_scrolling, &scroll, &cursor,
- &empty_north, &empty_south, scroll_offset, target, scroll_step, NK_VERTICAL);
- scroll_off = scroll_offset / target;
- cursor.y = scroll.y + (scroll_off * scroll.h) + style->border_cursor + style->padding.y;
+ /* setup popup data */
+ popup->parent = win;
+ popup->bounds = rect;
+ popup->seq = ctx->seq;
+ popup->layout = (struct nk_panel*)nk_create_panel(ctx);
+ popup->flags = flags;
+ popup->flags |= NK_WINDOW_BORDER;
+ if (type == NK_POPUP_DYNAMIC)
+ popup->flags |= NK_WINDOW_DYNAMIC;
- /* draw scrollbar */
- if (style->draw_begin) style->draw_begin(out, style->userdata);
- nk_draw_scrollbar(out, *state, style, &scroll, &cursor);
- if (style->draw_end) style->draw_end(out, style->userdata);
- return scroll_offset;
-}
+ popup->buffer = win->buffer;
+ nk_start_popup(ctx, win);
+ allocated = ctx->memory.allocated;
+ nk_push_scissor(&popup->buffer, nk_null_rect);
-NK_INTERN float
-nk_do_scrollbarh(nk_flags *state,
- struct nk_command_buffer *out, struct nk_rect scroll, int has_scrolling,
- float offset, float target, float step, float button_pixel_inc,
- const struct nk_style_scrollbar *style, struct nk_input *in,
- const struct nk_user_font *font)
+ if (nk_panel_begin(ctx, title, NK_PANEL_POPUP)) {
+ /* popup is running therefore invalidate parent panels */
+ struct nk_panel *root;
+ root = win->layout;
+ while (root) {
+ root->flags |= NK_WINDOW_ROM;
+ root->flags &= ~(nk_flags)NK_WINDOW_REMOVE_ROM;
+ root = root->parent;
+ }
+ win->popup.active = 1;
+ popup->layout->offset_x = &popup->scrollbar.x;
+ popup->layout->offset_y = &popup->scrollbar.y;
+ popup->layout->parent = win->layout;
+ return 1;
+ } else {
+ /* popup was closed/is invalid so cleanup */
+ struct nk_panel *root;
+ root = win->layout;
+ while (root) {
+ root->flags |= NK_WINDOW_REMOVE_ROM;
+ root = root->parent;
+ }
+ win->popup.buf.active = 0;
+ win->popup.active = 0;
+ ctx->memory.allocated = allocated;
+ ctx->current = win;
+ nk_free_panel(ctx, popup->layout);
+ popup->layout = 0;
+ return 0;
+ }
+}
+NK_LIB int
+nk_nonblock_begin(struct nk_context *ctx,
+ nk_flags flags, struct nk_rect body, struct nk_rect header,
+ enum nk_panel_type panel_type)
{
- struct nk_rect cursor;
- struct nk_rect empty_west;
- struct nk_rect empty_east;
+ struct nk_window *popup;
+ struct nk_window *win;
+ struct nk_panel *panel;
+ int is_active = nk_true;
- float scroll_step;
- float scroll_offset;
- float scroll_off;
- float scroll_ratio;
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout)
+ return 0;
- NK_ASSERT(out);
- NK_ASSERT(style);
- if (!out || !style) return 0;
+ /* popups cannot have popups */
+ win = ctx->current;
+ panel = win->layout;
+ NK_ASSERT(!(panel->type & NK_PANEL_SET_POPUP));
+ (void)panel;
+ popup = win->popup.win;
+ if (!popup) {
+ /* create window for nonblocking popup */
+ popup = (struct nk_window*)nk_create_window(ctx);
+ popup->parent = win;
+ win->popup.win = popup;
+ win->popup.type = panel_type;
+ nk_command_buffer_init(&popup->buffer, &ctx->memory, NK_CLIPPING_ON);
+ } else {
+ /* close the popup if user pressed outside or in the header */
+ int pressed, in_body, in_header;
+#ifdef NK_BUTTON_TRIGGER_ON_RELEASE
+ pressed = nk_input_is_mouse_released(&ctx->input, NK_BUTTON_LEFT);
+#else
+ pressed = nk_input_is_mouse_pressed(&ctx->input, NK_BUTTON_LEFT);
+#endif
+ in_body = nk_input_is_mouse_hovering_rect(&ctx->input, body);
+ in_header = nk_input_is_mouse_hovering_rect(&ctx->input, header);
+ if (pressed && (!in_body || in_header))
+ is_active = nk_false;
+ }
+ win->popup.header = header;
- /* scrollbar background */
- scroll.h = NK_MAX(scroll.h, 1);
- scroll.w = NK_MAX(scroll.w, 2 * scroll.h);
- if (target <= scroll.w) return 0;
+ if (!is_active) {
+ /* remove read only mode from all parent panels */
+ struct nk_panel *root = win->layout;
+ while (root) {
+ root->flags |= NK_WINDOW_REMOVE_ROM;
+ root = root->parent;
+ }
+ return is_active;
+ }
+ popup->bounds = body;
+ popup->parent = win;
+ popup->layout = (struct nk_panel*)nk_create_panel(ctx);
+ popup->flags = flags;
+ popup->flags |= NK_WINDOW_BORDER;
+ popup->flags |= NK_WINDOW_DYNAMIC;
+ popup->seq = ctx->seq;
+ win->popup.active = 1;
+ NK_ASSERT(popup->layout);
- /* optional scrollbar buttons */
- if (style->show_buttons) {
- nk_flags ws;
- float scroll_w;
- struct nk_rect button;
- button.y = scroll.y;
- button.w = scroll.h;
- button.h = scroll.h;
+ nk_start_popup(ctx, win);
+ popup->buffer = win->buffer;
+ nk_push_scissor(&popup->buffer, nk_null_rect);
+ ctx->current = popup;
- scroll_w = scroll.w - 2 * button.w;
- scroll_step = NK_MIN(step, button_pixel_inc);
+ nk_panel_begin(ctx, 0, panel_type);
+ win->buffer = popup->buffer;
+ popup->layout->parent = win->layout;
+ popup->layout->offset_x = &popup->scrollbar.x;
+ popup->layout->offset_y = &popup->scrollbar.y;
- /* decrement button */
- button.x = scroll.x;
- if (nk_do_button_symbol(&ws, out, button, style->dec_symbol,
- NK_BUTTON_REPEATER, &style->dec_button, in, font))
- offset = offset - scroll_step;
+ /* set read only mode to all parent panels */
+ {struct nk_panel *root;
+ root = win->layout;
+ while (root) {
+ root->flags |= NK_WINDOW_ROM;
+ root = root->parent;
+ }}
+ return is_active;
+}
+NK_API void
+nk_popup_close(struct nk_context *ctx)
+{
+ struct nk_window *popup;
+ NK_ASSERT(ctx);
+ if (!ctx || !ctx->current) return;
- /* increment button */
- button.x = scroll.x + scroll.w - button.w;
- if (nk_do_button_symbol(&ws, out, button, style->inc_symbol,
- NK_BUTTON_REPEATER, &style->inc_button, in, font))
- offset = offset + scroll_step;
+ popup = ctx->current;
+ NK_ASSERT(popup->parent);
+ NK_ASSERT(popup->layout->type & NK_PANEL_SET_POPUP);
+ popup->flags |= NK_WINDOW_HIDDEN;
+}
+NK_API void
+nk_popup_end(struct nk_context *ctx)
+{
+ struct nk_window *win;
+ struct nk_window *popup;
- scroll.x = scroll.x + button.w;
- scroll.w = scroll_w;
- }
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout)
+ return;
- /* calculate scrollbar constants */
- scroll_step = NK_MIN(step, scroll.w);
- scroll_offset = NK_CLAMP(0, offset, target - scroll.w);
- scroll_ratio = scroll.w / target;
- scroll_off = scroll_offset / target;
+ popup = ctx->current;
+ if (!popup->parent) return;
+ win = popup->parent;
+ if (popup->flags & NK_WINDOW_HIDDEN) {
+ struct nk_panel *root;
+ root = win->layout;
+ while (root) {
+ root->flags |= NK_WINDOW_REMOVE_ROM;
+ root = root->parent;
+ }
+ win->popup.active = 0;
+ }
+ nk_push_scissor(&popup->buffer, nk_null_rect);
+ nk_end(ctx);
- /* calculate cursor bounds */
- cursor.w = (scroll_ratio * scroll.w) - (2*style->border + 2*style->padding.x);
- cursor.x = scroll.x + (scroll_off * scroll.w) + style->border + style->padding.x;
- cursor.h = scroll.h - (2 * style->border + 2 * style->padding.y);
- cursor.y = scroll.y + style->border + style->padding.y;
+ win->buffer = popup->buffer;
+ nk_finish_popup(ctx, win);
+ ctx->current = win;
+ nk_push_scissor(&win->buffer, win->layout->clip);
+}
+NK_API void
+nk_popup_get_scroll(struct nk_context *ctx, nk_uint *offset_x, nk_uint *offset_y)
+{
+ struct nk_window *popup;
- /* calculate empty space around cursor */
- empty_west.x = scroll.x;
- empty_west.y = scroll.y;
- empty_west.w = cursor.x - scroll.x;
- empty_west.h = scroll.h;
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout)
+ return;
- empty_east.x = cursor.x + cursor.w;
- empty_east.y = scroll.y;
- empty_east.w = (scroll.x + scroll.w) - (cursor.x + cursor.w);
- empty_east.h = scroll.h;
+ popup = ctx->current;
+ if (offset_x)
+ *offset_x = popup->scrollbar.x;
+ if (offset_y)
+ *offset_y = popup->scrollbar.y;
+}
+NK_API void
+nk_popup_set_scroll(struct nk_context *ctx, nk_uint offset_x, nk_uint offset_y)
+{
+ struct nk_window *popup;
- /* update scrollbar */
- scroll_offset = nk_scrollbar_behavior(state, in, has_scrolling, &scroll, &cursor,
- &empty_west, &empty_east, scroll_offset, target, scroll_step, NK_HORIZONTAL);
- scroll_off = scroll_offset / target;
- cursor.x = scroll.x + (scroll_off * scroll.w);
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout)
+ return;
- /* draw scrollbar */
- if (style->draw_begin) style->draw_begin(out, style->userdata);
- nk_draw_scrollbar(out, *state, style, &scroll, &cursor);
- if (style->draw_end) style->draw_end(out, style->userdata);
- return scroll_offset;
+ popup = ctx->current;
+ popup->scrollbar.x = offset_x;
+ popup->scrollbar.y = offset_y;
}
-/* ===============================================================
+
+
+
+/* ==============================================================
*
- * FILTER
+ * CONTEXTUAL
*
* ===============================================================*/
-NK_API int nk_filter_default(const struct nk_text_edit *box, nk_rune unicode)
-{(void)unicode;NK_UNUSED(box);return nk_true;}
-
NK_API int
-nk_filter_ascii(const struct nk_text_edit *box, nk_rune unicode)
+nk_contextual_begin(struct nk_context *ctx, nk_flags flags, struct nk_vec2 size,
+ struct nk_rect trigger_bounds)
{
- NK_UNUSED(box);
- if (unicode > 128) return nk_false;
- else return nk_true;
-}
+ struct nk_window *win;
+ struct nk_window *popup;
+ struct nk_rect body;
+
+ NK_STORAGE const struct nk_rect null_rect = {-1,-1,0,0};
+ int is_clicked = 0;
+ int is_open = 0;
+ int ret = 0;
+
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout)
+ return 0;
+
+ win = ctx->current;
+ ++win->popup.con_count;
+ if (ctx->current != ctx->active)
+ return 0;
+
+ /* check if currently active contextual is active */
+ popup = win->popup.win;
+ is_open = (popup && win->popup.type == NK_PANEL_CONTEXTUAL);
+ is_clicked = nk_input_mouse_clicked(&ctx->input, NK_BUTTON_RIGHT, trigger_bounds);
+ if (win->popup.active_con && win->popup.con_count != win->popup.active_con)
+ return 0;
+ if (!is_open && win->popup.active_con)
+ win->popup.active_con = 0;
+ if ((!is_open && !is_clicked))
+ return 0;
+
+ /* calculate contextual position on click */
+ win->popup.active_con = win->popup.con_count;
+ if (is_clicked) {
+ body.x = ctx->input.mouse.pos.x;
+ body.y = ctx->input.mouse.pos.y;
+ } else {
+ body.x = popup->bounds.x;
+ body.y = popup->bounds.y;
+ }
+ body.w = size.x;
+ body.h = size.y;
+ /* start nonblocking contextual popup */
+ ret = nk_nonblock_begin(ctx, flags|NK_WINDOW_NO_SCROLLBAR, body,
+ null_rect, NK_PANEL_CONTEXTUAL);
+ if (ret) win->popup.type = NK_PANEL_CONTEXTUAL;
+ else {
+ win->popup.active_con = 0;
+ win->popup.type = NK_PANEL_NONE;
+ if (win->popup.win)
+ win->popup.win->flags = 0;
+ }
+ return ret;
+}
NK_API int
-nk_filter_float(const struct nk_text_edit *box, nk_rune unicode)
+nk_contextual_item_text(struct nk_context *ctx, const char *text, int len,
+ nk_flags alignment)
{
- NK_UNUSED(box);
- if ((unicode < '0' || unicode > '9') && unicode != '.' && unicode != '-')
- return nk_false;
- else return nk_true;
-}
+ struct nk_window *win;
+ const struct nk_input *in;
+ const struct nk_style *style;
+
+ struct nk_rect bounds;
+ enum nk_widget_layout_states state;
+
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout)
+ return 0;
+
+ win = ctx->current;
+ style = &ctx->style;
+ state = nk_widget_fitting(&bounds, ctx, style->contextual_button.padding);
+ if (!state) return nk_false;
+ in = (state == NK_WIDGET_ROM || win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+ if (nk_do_button_text(&ctx->last_widget_state, &win->buffer, bounds,
+ text, len, alignment, NK_BUTTON_DEFAULT, &style->contextual_button, in, style->font)) {
+ nk_contextual_close(ctx);
+ return nk_true;
+ }
+ return nk_false;
+}
NK_API int
-nk_filter_decimal(const struct nk_text_edit *box, nk_rune unicode)
+nk_contextual_item_label(struct nk_context *ctx, const char *label, nk_flags align)
{
- NK_UNUSED(box);
- if ((unicode < '0' || unicode > '9') && unicode != '-')
- return nk_false;
- else return nk_true;
+ return nk_contextual_item_text(ctx, label, nk_strlen(label), align);
}
-
NK_API int
-nk_filter_hex(const struct nk_text_edit *box, nk_rune unicode)
+nk_contextual_item_image_text(struct nk_context *ctx, struct nk_image img,
+ const char *text, int len, nk_flags align)
{
- NK_UNUSED(box);
- if ((unicode < '0' || unicode > '9') &&
- (unicode < 'a' || unicode > 'f') &&
- (unicode < 'A' || unicode > 'F'))
- return nk_false;
- else return nk_true;
-}
+ struct nk_window *win;
+ const struct nk_input *in;
+ const struct nk_style *style;
+
+ struct nk_rect bounds;
+ enum nk_widget_layout_states state;
+
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout)
+ return 0;
+
+ win = ctx->current;
+ style = &ctx->style;
+ state = nk_widget_fitting(&bounds, ctx, style->contextual_button.padding);
+ if (!state) return nk_false;
+ in = (state == NK_WIDGET_ROM || win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+ if (nk_do_button_text_image(&ctx->last_widget_state, &win->buffer, bounds,
+ img, text, len, align, NK_BUTTON_DEFAULT, &style->contextual_button, style->font, in)){
+ nk_contextual_close(ctx);
+ return nk_true;
+ }
+ return nk_false;
+}
NK_API int
-nk_filter_oct(const struct nk_text_edit *box, nk_rune unicode)
+nk_contextual_item_image_label(struct nk_context *ctx, struct nk_image img,
+ const char *label, nk_flags align)
{
- NK_UNUSED(box);
- if (unicode < '0' || unicode > '7')
- return nk_false;
- else return nk_true;
+ return nk_contextual_item_image_text(ctx, img, label, nk_strlen(label), align);
}
+NK_API int
+nk_contextual_item_symbol_text(struct nk_context *ctx, enum nk_symbol_type symbol,
+ const char *text, int len, nk_flags align)
+{
+ struct nk_window *win;
+ const struct nk_input *in;
+ const struct nk_style *style;
+
+ struct nk_rect bounds;
+ enum nk_widget_layout_states state;
+
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout)
+ return 0;
+ win = ctx->current;
+ style = &ctx->style;
+ state = nk_widget_fitting(&bounds, ctx, style->contextual_button.padding);
+ if (!state) return nk_false;
+
+ in = (state == NK_WIDGET_ROM || win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+ if (nk_do_button_text_symbol(&ctx->last_widget_state, &win->buffer, bounds,
+ symbol, text, len, align, NK_BUTTON_DEFAULT, &style->contextual_button, style->font, in)) {
+ nk_contextual_close(ctx);
+ return nk_true;
+ }
+ return nk_false;
+}
NK_API int
-nk_filter_binary(const struct nk_text_edit *box, nk_rune unicode)
+nk_contextual_item_symbol_label(struct nk_context *ctx, enum nk_symbol_type symbol,
+ const char *text, nk_flags align)
{
- NK_UNUSED(box);
- if (unicode != '0' && unicode != '1')
- return nk_false;
- else return nk_true;
+ return nk_contextual_item_symbol_text(ctx, symbol, text, nk_strlen(text), align);
+}
+NK_API void
+nk_contextual_close(struct nk_context *ctx)
+{
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout) return;
+ nk_popup_close(ctx);
+}
+NK_API void
+nk_contextual_end(struct nk_context *ctx)
+{
+ struct nk_window *popup;
+ struct nk_panel *panel;
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ if (!ctx || !ctx->current) return;
+
+ popup = ctx->current;
+ panel = popup->layout;
+ NK_ASSERT(popup->parent);
+ NK_ASSERT(panel->type & NK_PANEL_SET_POPUP);
+ if (panel->flags & NK_WINDOW_DYNAMIC) {
+ /* Close behavior
+ This is a bit of a hack solution since we do not know before we end our popup
+ how big it will be. We therefore do not directly know when a
+ click outside the non-blocking popup must close it at that direct frame.
+ Instead it will be closed in the next frame.*/
+ struct nk_rect body = {0,0,0,0};
+ if (panel->at_y < (panel->bounds.y + panel->bounds.h)) {
+ struct nk_vec2 padding = nk_panel_get_padding(&ctx->style, panel->type);
+ body = panel->bounds;
+ body.y = (panel->at_y + panel->footer_height + panel->border + padding.y + panel->row.height);
+ body.h = (panel->bounds.y + panel->bounds.h) - body.y;
+ }
+ {int pressed = nk_input_is_mouse_pressed(&ctx->input, NK_BUTTON_LEFT);
+ int in_body = nk_input_is_mouse_hovering_rect(&ctx->input, body);
+ if (pressed && in_body)
+ popup->flags |= NK_WINDOW_HIDDEN;
+ }
+ }
+ if (popup->flags & NK_WINDOW_HIDDEN)
+ popup->seq = 0;
+ nk_popup_end(ctx);
+ return;
}
+
+
+
+
/* ===============================================================
*
- * EDIT
+ * MENU
*
* ===============================================================*/
-NK_INTERN void
-nk_edit_draw_text(struct nk_command_buffer *out,
- const struct nk_style_edit *style, float pos_x, float pos_y,
- float x_offset, const char *text, int byte_len, float row_height,
- const struct nk_user_font *font, struct nk_color background,
- struct nk_color foreground, int is_selected)
+NK_API void
+nk_menubar_begin(struct nk_context *ctx)
{
- NK_ASSERT(out);
- NK_ASSERT(font);
- NK_ASSERT(style);
- if (!text || !byte_len || !out || !style) return;
+ struct nk_panel *layout;
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout)
+ return;
- {int glyph_len = 0;
- nk_rune unicode = 0;
- int text_len = 0;
- float line_width = 0;
- float glyph_width;
- const char *line = text;
- float line_offset = 0;
- int line_count = 0;
+ layout = ctx->current->layout;
+ NK_ASSERT(layout->at_y == layout->bounds.y);
+ /* if this assert triggers you allocated space between nk_begin and nk_menubar_begin.
+ If you want a menubar the first nuklear function after `nk_begin` has to be a
+ `nk_menubar_begin` call. Inside the menubar you then have to allocate space for
+ widgets (also supports multiple rows).
+ Example:
+ if (nk_begin(...)) {
+ nk_menubar_begin(...);
+ nk_layout_xxxx(...);
+ nk_button(...);
+ nk_layout_xxxx(...);
+ nk_button(...);
+ nk_menubar_end(...);
+ }
+ nk_end(...);
+ */
+ if (layout->flags & NK_WINDOW_HIDDEN || layout->flags & NK_WINDOW_MINIMIZED)
+ return;
- struct nk_text txt;
- txt.padding = nk_vec2(0,0);
- txt.background = background;
- txt.text = foreground;
+ layout->menu.x = layout->at_x;
+ layout->menu.y = layout->at_y + layout->row.height;
+ layout->menu.w = layout->bounds.w;
+ layout->menu.offset.x = *layout->offset_x;
+ layout->menu.offset.y = *layout->offset_y;
+ *layout->offset_y = 0;
+}
+NK_API void
+nk_menubar_end(struct nk_context *ctx)
+{
+ struct nk_window *win;
+ struct nk_panel *layout;
+ struct nk_command_buffer *out;
- glyph_len = nk_utf_decode(text+text_len, &unicode, byte_len-text_len);
- if (!glyph_len) return;
- while ((text_len < byte_len) && glyph_len)
- {
- if (unicode == '\n') {
- /* new line sepeator so draw previous line */
- struct nk_rect label;
- label.y = pos_y + line_offset;
- label.h = row_height;
- label.w = line_width;
- label.x = pos_x;
- if (!line_count)
- label.x += x_offset;
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout)
+ return;
- if (is_selected) /* selection needs to draw different background color */
- nk_fill_rect(out, label, 0, background);
- nk_widget_text(out, label, line, (int)((text + text_len) - line),
- &txt, NK_TEXT_CENTERED, font);
+ win = ctx->current;
+ out = &win->buffer;
+ layout = win->layout;
+ if (layout->flags & NK_WINDOW_HIDDEN || layout->flags & NK_WINDOW_MINIMIZED)
+ return;
- text_len++;
- line_count++;
- line_width = 0;
- line = text + text_len;
- line_offset += row_height;
- glyph_len = nk_utf_decode(text + text_len, &unicode, (int)(byte_len-text_len));
- continue;
- }
- if (unicode == '\r') {
- text_len++;
- glyph_len = nk_utf_decode(text + text_len, &unicode, byte_len-text_len);
- continue;
- }
- glyph_width = font->width(font->userdata, font->height, text+text_len, glyph_len);
- line_width += (float)glyph_width;
- text_len += glyph_len;
- glyph_len = nk_utf_decode(text + text_len, &unicode, byte_len-text_len);
- continue;
- }
- if (line_width > 0) {
- /* draw last line */
- struct nk_rect label;
- label.y = pos_y + line_offset;
- label.h = row_height;
- label.w = line_width;
- label.x = pos_x;
- if (!line_count)
- label.x += x_offset;
+ layout->menu.h = layout->at_y - layout->menu.y;
+ layout->bounds.y += layout->menu.h + ctx->style.window.spacing.y + layout->row.height;
+ layout->bounds.h -= layout->menu.h + ctx->style.window.spacing.y + layout->row.height;
- if (is_selected)
- nk_fill_rect(out, label, 0, background);
- nk_widget_text(out, label, line, (int)((text + text_len) - line),
- &txt, NK_TEXT_LEFT, font);
- }}
-}
+ *layout->offset_x = layout->menu.offset.x;
+ *layout->offset_y = layout->menu.offset.y;
+ layout->at_y = layout->bounds.y - layout->row.height;
-NK_INTERN nk_flags
-nk_do_edit(nk_flags *state, struct nk_command_buffer *out,
- struct nk_rect bounds, nk_flags flags, nk_plugin_filter filter,
- struct nk_text_edit *edit, const struct nk_style_edit *style,
- struct nk_input *in, const struct nk_user_font *font)
+ layout->clip.y = layout->bounds.y;
+ layout->clip.h = layout->bounds.h;
+ nk_push_scissor(out, layout->clip);
+}
+NK_INTERN int
+nk_menu_begin(struct nk_context *ctx, struct nk_window *win,
+ const char *id, int is_clicked, struct nk_rect header, struct nk_vec2 size)
{
- struct nk_rect area;
- nk_flags ret = 0;
- float row_height;
- char prev_state = 0;
- char is_hovered = 0;
- char select_all = 0;
- char cursor_follow = 0;
- struct nk_rect old_clip;
- struct nk_rect clip;
-
- NK_ASSERT(state);
- NK_ASSERT(out);
- NK_ASSERT(style);
- if (!state || !out || !style)
- return ret;
+ int is_open = 0;
+ int is_active = 0;
+ struct nk_rect body;
+ struct nk_window *popup;
+ nk_hash hash = nk_murmur_hash(id, (int)nk_strlen(id), NK_PANEL_MENU);
- /* visible text area calculation */
- area.x = bounds.x + style->padding.x + style->border;
- area.y = bounds.y + style->padding.y + style->border;
- area.w = bounds.w - (2.0f * style->padding.x + 2 * style->border);
- area.h = bounds.h - (2.0f * style->padding.y + 2 * style->border);
- if (flags & NK_EDIT_MULTILINE)
- area.w = NK_MAX(0, area.w - style->scrollbar_size.x);
- row_height = (flags & NK_EDIT_MULTILINE)? font->height + style->row_padding: area.h;
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout)
+ return 0;
- /* calculate clipping rectangle */
- old_clip = out->clip;
- nk_unify(&clip, &old_clip, area.x, area.y, area.x + area.w, area.y + area.h);
+ body.x = header.x;
+ body.w = size.x;
+ body.y = header.y + header.h;
+ body.h = size.y;
- /* update edit state */
- prev_state = (char)edit->active;
- is_hovered = (char)nk_input_is_mouse_hovering_rect(in, bounds);
- if (in && in->mouse.buttons[NK_BUTTON_LEFT].clicked && in->mouse.buttons[NK_BUTTON_LEFT].down) {
- edit->active = NK_INBOX(in->mouse.pos.x, in->mouse.pos.y,
- bounds.x, bounds.y, bounds.w, bounds.h);
- }
+ popup = win->popup.win;
+ is_open = popup ? nk_true : nk_false;
+ is_active = (popup && (win->popup.name == hash) && win->popup.type == NK_PANEL_MENU);
+ if ((is_clicked && is_open && !is_active) || (is_open && !is_active) ||
+ (!is_open && !is_active && !is_clicked)) return 0;
+ if (!nk_nonblock_begin(ctx, NK_WINDOW_NO_SCROLLBAR, body, header, NK_PANEL_MENU))
+ return 0;
- /* (de)activate text editor */
- if (!prev_state && edit->active) {
- const enum nk_text_edit_type type = (flags & NK_EDIT_MULTILINE) ?
- NK_TEXT_EDIT_MULTI_LINE: NK_TEXT_EDIT_SINGLE_LINE;
- nk_textedit_clear_state(edit, type, filter);
- if (flags & NK_EDIT_ALWAYS_INSERT_MODE)
- edit->mode = NK_TEXT_EDIT_MODE_INSERT;
- if (flags & NK_EDIT_AUTO_SELECT)
- select_all = nk_true;
- if (flags & NK_EDIT_GOTO_END_ON_ACTIVATE) {
- edit->cursor = edit->string.len;
- in = 0;
- }
- } else if (!edit->active) edit->mode = NK_TEXT_EDIT_MODE_VIEW;
- if (flags & NK_EDIT_READ_ONLY)
- edit->mode = NK_TEXT_EDIT_MODE_VIEW;
+ win->popup.type = NK_PANEL_MENU;
+ win->popup.name = hash;
+ return 1;
+}
+NK_API int
+nk_menu_begin_text(struct nk_context *ctx, const char *title, int len,
+ nk_flags align, struct nk_vec2 size)
+{
+ struct nk_window *win;
+ const struct nk_input *in;
+ struct nk_rect header;
+ int is_clicked = nk_false;
+ nk_flags state;
- ret = (edit->active) ? NK_EDIT_ACTIVE: NK_EDIT_INACTIVE;
- if (prev_state != edit->active)
- ret |= (edit->active) ? NK_EDIT_ACTIVATED: NK_EDIT_DEACTIVATED;
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout)
+ return 0;
- /* handle user input */
- if (edit->active && in)
- {
- int shift_mod = in->keyboard.keys[NK_KEY_SHIFT].down;
- const float mouse_x = (in->mouse.pos.x - area.x) + edit->scrollbar.x;
- const float mouse_y = (in->mouse.pos.y - area.y) + edit->scrollbar.y;
+ win = ctx->current;
+ state = nk_widget(&header, ctx);
+ if (!state) return 0;
+ in = (state == NK_WIDGET_ROM || win->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+ if (nk_do_button_text(&ctx->last_widget_state, &win->buffer, header,
+ title, len, align, NK_BUTTON_DEFAULT, &ctx->style.menu_button, in, ctx->style.font))
+ is_clicked = nk_true;
+ return nk_menu_begin(ctx, win, title, is_clicked, header, size);
+}
+NK_API int nk_menu_begin_label(struct nk_context *ctx,
+ const char *text, nk_flags align, struct nk_vec2 size)
+{
+ return nk_menu_begin_text(ctx, text, nk_strlen(text), align, size);
+}
+NK_API int
+nk_menu_begin_image(struct nk_context *ctx, const char *id, struct nk_image img,
+ struct nk_vec2 size)
+{
+ struct nk_window *win;
+ struct nk_rect header;
+ const struct nk_input *in;
+ int is_clicked = nk_false;
+ nk_flags state;
- /* mouse click handler */
- is_hovered = (char)nk_input_is_mouse_hovering_rect(in, area);
- if (select_all) {
- nk_textedit_select_all(edit);
- } else if (is_hovered && in->mouse.buttons[NK_BUTTON_LEFT].down &&
- in->mouse.buttons[NK_BUTTON_LEFT].clicked) {
- nk_textedit_click(edit, mouse_x, mouse_y, font, row_height);
- } else if (is_hovered && in->mouse.buttons[NK_BUTTON_LEFT].down &&
- (in->mouse.delta.x != 0.0f || in->mouse.delta.y != 0.0f)) {
- nk_textedit_drag(edit, mouse_x, mouse_y, font, row_height);
- cursor_follow = nk_true;
- } else if (is_hovered && in->mouse.buttons[NK_BUTTON_RIGHT].clicked &&
- in->mouse.buttons[NK_BUTTON_RIGHT].down) {
- nk_textedit_key(edit, NK_KEY_TEXT_WORD_LEFT, nk_false, font, row_height);
- nk_textedit_key(edit, NK_KEY_TEXT_WORD_RIGHT, nk_true, font, row_height);
- cursor_follow = nk_true;
- }
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout)
+ return 0;
- {int i; /* keyboard input */
- int old_mode = edit->mode;
- for (i = 0; i < NK_KEY_MAX; ++i) {
- if (i == NK_KEY_ENTER || i == NK_KEY_TAB) continue; /* special case */
- if (nk_input_is_key_pressed(in, (enum nk_keys)i)) {
- nk_textedit_key(edit, (enum nk_keys)i, shift_mod, font, row_height);
- cursor_follow = nk_true;
- }
- }
- if (old_mode != edit->mode) {
- in->keyboard.text_len = 0;
- }}
+ win = ctx->current;
+ state = nk_widget(&header, ctx);
+ if (!state) return 0;
+ in = (state == NK_WIDGET_ROM || win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+ if (nk_do_button_image(&ctx->last_widget_state, &win->buffer, header,
+ img, NK_BUTTON_DEFAULT, &ctx->style.menu_button, in))
+ is_clicked = nk_true;
+ return nk_menu_begin(ctx, win, id, is_clicked, header, size);
+}
+NK_API int
+nk_menu_begin_symbol(struct nk_context *ctx, const char *id,
+ enum nk_symbol_type sym, struct nk_vec2 size)
+{
+ struct nk_window *win;
+ const struct nk_input *in;
+ struct nk_rect header;
+ int is_clicked = nk_false;
+ nk_flags state;
- /* text input */
- edit->filter = filter;
- if (in->keyboard.text_len) {
- nk_textedit_text(edit, in->keyboard.text, in->keyboard.text_len);
- cursor_follow = nk_true;
- in->keyboard.text_len = 0;
- }
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout)
+ return 0;
- /* enter key handler */
- if (nk_input_is_key_pressed(in, NK_KEY_ENTER)) {
- cursor_follow = nk_true;
- if (flags & NK_EDIT_CTRL_ENTER_NEWLINE && shift_mod)
- nk_textedit_text(edit, "\n", 1);
- else if (flags & NK_EDIT_SIG_ENTER)
- ret |= NK_EDIT_COMMITED;
- else nk_textedit_text(edit, "\n", 1);
- }
+ win = ctx->current;
+ state = nk_widget(&header, ctx);
+ if (!state) return 0;
+ in = (state == NK_WIDGET_ROM || win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+ if (nk_do_button_symbol(&ctx->last_widget_state, &win->buffer, header,
+ sym, NK_BUTTON_DEFAULT, &ctx->style.menu_button, in, ctx->style.font))
+ is_clicked = nk_true;
+ return nk_menu_begin(ctx, win, id, is_clicked, header, size);
+}
+NK_API int
+nk_menu_begin_image_text(struct nk_context *ctx, const char *title, int len,
+ nk_flags align, struct nk_image img, struct nk_vec2 size)
+{
+ struct nk_window *win;
+ struct nk_rect header;
+ const struct nk_input *in;
+ int is_clicked = nk_false;
+ nk_flags state;
- /* cut & copy handler */
- {int copy= nk_input_is_key_pressed(in, NK_KEY_COPY);
- int cut = nk_input_is_key_pressed(in, NK_KEY_CUT);
- if ((copy || cut) && (flags & NK_EDIT_CLIPBOARD))
- {
- int glyph_len;
- nk_rune unicode;
- const char *text;
- int b = edit->select_start;
- int e = edit->select_end;
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout)
+ return 0;
- int begin = NK_MIN(b, e);
- int end = NK_MAX(b, e);
- text = nk_str_at_const(&edit->string, begin, &unicode, &glyph_len);
- if (edit->clip.copy)
- edit->clip.copy(edit->clip.userdata, text, end - begin);
- if (cut && !(flags & NK_EDIT_READ_ONLY)){
- nk_textedit_cut(edit);
- cursor_follow = nk_true;
- }
- }}
+ win = ctx->current;
+ state = nk_widget(&header, ctx);
+ if (!state) return 0;
+ in = (state == NK_WIDGET_ROM || win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+ if (nk_do_button_text_image(&ctx->last_widget_state, &win->buffer,
+ header, img, title, len, align, NK_BUTTON_DEFAULT, &ctx->style.menu_button,
+ ctx->style.font, in))
+ is_clicked = nk_true;
+ return nk_menu_begin(ctx, win, title, is_clicked, header, size);
+}
+NK_API int
+nk_menu_begin_image_label(struct nk_context *ctx,
+ const char *title, nk_flags align, struct nk_image img, struct nk_vec2 size)
+{
+ return nk_menu_begin_image_text(ctx, title, nk_strlen(title), align, img, size);
+}
+NK_API int
+nk_menu_begin_symbol_text(struct nk_context *ctx, const char *title, int len,
+ nk_flags align, enum nk_symbol_type sym, struct nk_vec2 size)
+{
+ struct nk_window *win;
+ struct nk_rect header;
+ const struct nk_input *in;
+ int is_clicked = nk_false;
+ nk_flags state;
- /* paste handler */
- {int paste = nk_input_is_key_pressed(in, NK_KEY_PASTE);
- if (paste && (flags & NK_EDIT_CLIPBOARD) && edit->clip.paste) {
- edit->clip.paste(edit->clip.userdata, edit);
- cursor_follow = nk_true;
- }}
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout)
+ return 0;
- /* tab handler */
- {int tab = nk_input_is_key_pressed(in, NK_KEY_TAB);
- if (tab && (flags & NK_EDIT_ALLOW_TAB)) {
- nk_textedit_text(edit, " ", 4);
- cursor_follow = nk_true;
- }}
- }
+ win = ctx->current;
+ state = nk_widget(&header, ctx);
+ if (!state) return 0;
- /* set widget state */
- if (edit->active)
- *state = NK_WIDGET_STATE_ACTIVE;
- else nk_widget_state_reset(state);
+ in = (state == NK_WIDGET_ROM || win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+ if (nk_do_button_text_symbol(&ctx->last_widget_state, &win->buffer,
+ header, sym, title, len, align, NK_BUTTON_DEFAULT, &ctx->style.menu_button,
+ ctx->style.font, in)) is_clicked = nk_true;
+ return nk_menu_begin(ctx, win, title, is_clicked, header, size);
+}
+NK_API int
+nk_menu_begin_symbol_label(struct nk_context *ctx,
+ const char *title, nk_flags align, enum nk_symbol_type sym, struct nk_vec2 size )
+{
+ return nk_menu_begin_symbol_text(ctx, title, nk_strlen(title), align,sym,size);
+}
+NK_API int
+nk_menu_item_text(struct nk_context *ctx, const char *title, int len, nk_flags align)
+{
+ return nk_contextual_item_text(ctx, title, len, align);
+}
+NK_API int
+nk_menu_item_label(struct nk_context *ctx, const char *label, nk_flags align)
+{
+ return nk_contextual_item_label(ctx, label, align);
+}
+NK_API int
+nk_menu_item_image_label(struct nk_context *ctx, struct nk_image img,
+ const char *label, nk_flags align)
+{
+ return nk_contextual_item_image_label(ctx, img, label, align);
+}
+NK_API int
+nk_menu_item_image_text(struct nk_context *ctx, struct nk_image img,
+ const char *text, int len, nk_flags align)
+{
+ return nk_contextual_item_image_text(ctx, img, text, len, align);
+}
+NK_API int nk_menu_item_symbol_text(struct nk_context *ctx, enum nk_symbol_type sym,
+ const char *text, int len, nk_flags align)
+{
+ return nk_contextual_item_symbol_text(ctx, sym, text, len, align);
+}
+NK_API int nk_menu_item_symbol_label(struct nk_context *ctx, enum nk_symbol_type sym,
+ const char *label, nk_flags align)
+{
+ return nk_contextual_item_symbol_label(ctx, sym, label, align);
+}
+NK_API void nk_menu_close(struct nk_context *ctx)
+{
+ nk_contextual_close(ctx);
+}
+NK_API void
+nk_menu_end(struct nk_context *ctx)
+{
+ nk_contextual_end(ctx);
+}
- if (is_hovered)
- *state |= NK_WIDGET_STATE_HOVERED;
- /* DRAW EDIT */
- {const char *text = nk_str_get_const(&edit->string);
- int len = nk_str_len_char(&edit->string);
- {/* select background colors/images */
- const struct nk_style_item *background;
- if (*state & NK_WIDGET_STATE_ACTIVED)
- background = &style->active;
- else if (*state & NK_WIDGET_STATE_HOVER)
- background = &style->hover;
- else background = &style->normal;
- /* draw background frame */
- if (background->type == NK_STYLE_ITEM_COLOR) {
- nk_stroke_rect(out, bounds, style->rounding, style->border, style->border_color);
- nk_fill_rect(out, bounds, style->rounding, background->data.color);
- } else nk_draw_image(out, bounds, &background->data.image, nk_white);}
- area.w = NK_MAX(0, area.w - style->cursor_size);
- if (edit->active)
- {
- int total_lines = 1;
- struct nk_vec2 text_size = nk_vec2(0,0);
+/* ===============================================================
+ *
+ * LAYOUT
+ *
+ * ===============================================================*/
+NK_API void
+nk_layout_set_min_row_height(struct nk_context *ctx, float height)
+{
+ struct nk_window *win;
+ struct nk_panel *layout;
- /* text pointer positions */
- const char *cursor_ptr = 0;
- const char *select_begin_ptr = 0;
- const char *select_end_ptr = 0;
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout)
+ return;
- /* 2D pixel positions */
- struct nk_vec2 cursor_pos = nk_vec2(0,0);
- struct nk_vec2 selection_offset_start = nk_vec2(0,0);
- struct nk_vec2 selection_offset_end = nk_vec2(0,0);
+ win = ctx->current;
+ layout = win->layout;
+ layout->row.min_height = height;
+}
+NK_API void
+nk_layout_reset_min_row_height(struct nk_context *ctx)
+{
+ struct nk_window *win;
+ struct nk_panel *layout;
- int selection_begin = NK_MIN(edit->select_start, edit->select_end);
- int selection_end = NK_MAX(edit->select_start, edit->select_end);
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout)
+ return;
- /* calculate total line count + total space + cursor/selection position */
- float line_width = 0.0f;
- if (text && len)
- {
- /* utf8 encoding */
- float glyph_width;
- int glyph_len = 0;
- nk_rune unicode = 0;
- int text_len = 0;
- int glyphs = 0;
- int row_begin = 0;
+ win = ctx->current;
+ layout = win->layout;
+ layout->row.min_height = ctx->style.font->height;
+ layout->row.min_height += ctx->style.text.padding.y*2;
+ layout->row.min_height += ctx->style.window.min_row_height_padding*2;
+}
+NK_LIB float
+nk_layout_row_calculate_usable_space(const struct nk_style *style, enum nk_panel_type type,
+ float total_space, int columns)
+{
+ float panel_padding;
+ float panel_spacing;
+ float panel_space;
- glyph_len = nk_utf_decode(text, &unicode, len);
- glyph_width = font->width(font->userdata, font->height, text, glyph_len);
- line_width = 0;
+ struct nk_vec2 spacing;
+ struct nk_vec2 padding;
- /* iterate all lines */
- while ((text_len < len) && glyph_len)
- {
- /* set cursor 2D position and line */
- if (!cursor_ptr && glyphs == edit->cursor)
- {
- int glyph_offset;
- struct nk_vec2 out_offset;
- struct nk_vec2 row_size;
- const char *remaining;
+ spacing = style->window.spacing;
+ padding = nk_panel_get_padding(style, type);
- /* calculate 2d position */
- cursor_pos.y = (float)(total_lines-1) * row_height;
- row_size = nk_text_calculate_text_bounds(font, text+row_begin,
- text_len-row_begin, row_height, &remaining,
- &out_offset, &glyph_offset, NK_STOP_ON_NEW_LINE);
- cursor_pos.x = row_size.x;
- cursor_ptr = text + text_len;
- }
+ /* calculate the usable panel space */
+ panel_padding = 2 * padding.x;
+ panel_spacing = (float)NK_MAX(columns - 1, 0) * spacing.x;
+ panel_space = total_space - panel_padding - panel_spacing;
+ return panel_space;
+}
+NK_LIB void
+nk_panel_layout(const struct nk_context *ctx, struct nk_window *win,
+ float height, int cols)
+{
+ struct nk_panel *layout;
+ const struct nk_style *style;
+ struct nk_command_buffer *out;
- /* set start selection 2D position and line */
- if (!select_begin_ptr && edit->select_start != edit->select_end &&
- glyphs == selection_begin)
- {
- int glyph_offset;
- struct nk_vec2 out_offset;
- struct nk_vec2 row_size;
- const char *remaining;
+ struct nk_vec2 item_spacing;
+ struct nk_color color;
- /* calculate 2d position */
- selection_offset_start.y = (float)(NK_MAX(total_lines-1,0)) * row_height;
- row_size = nk_text_calculate_text_bounds(font, text+row_begin,
- text_len-row_begin, row_height, &remaining,
- &out_offset, &glyph_offset, NK_STOP_ON_NEW_LINE);
- selection_offset_start.x = row_size.x;
- select_begin_ptr = text + text_len;
- }
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout)
+ return;
- /* set end selection 2D position and line */
- if (!select_end_ptr && edit->select_start != edit->select_end &&
- glyphs == selection_end)
- {
- int glyph_offset;
- struct nk_vec2 out_offset;
- struct nk_vec2 row_size;
- const char *remaining;
+ /* prefetch some configuration data */
+ layout = win->layout;
+ style = &ctx->style;
+ out = &win->buffer;
+ color = style->window.background;
+ item_spacing = style->window.spacing;
- /* calculate 2d position */
- selection_offset_end.y = (float)(total_lines-1) * row_height;
- row_size = nk_text_calculate_text_bounds(font, text+row_begin,
- text_len-row_begin, row_height, &remaining,
- &out_offset, &glyph_offset, NK_STOP_ON_NEW_LINE);
- selection_offset_end.x = row_size.x;
- select_end_ptr = text + text_len;
- }
- if (unicode == '\n') {
- text_size.x = NK_MAX(text_size.x, line_width);
- total_lines++;
- line_width = 0;
- text_len++;
- glyphs++;
- row_begin = text_len;
- glyph_len = nk_utf_decode(text + text_len, &unicode, len-text_len);
- glyph_width = font->width(font->userdata, font->height, text+text_len, glyph_len);
- continue;
- }
+ /* if one of these triggers you forgot to add an `if` condition around either
+ a window, group, popup, combobox or contextual menu `begin` and `end` block.
+ Example:
+ if (nk_begin(...) {...} nk_end(...); or
+ if (nk_group_begin(...) { nk_group_end(...);} */
+ NK_ASSERT(!(layout->flags & NK_WINDOW_MINIMIZED));
+ NK_ASSERT(!(layout->flags & NK_WINDOW_HIDDEN));
+ NK_ASSERT(!(layout->flags & NK_WINDOW_CLOSED));
- glyphs++;
- text_len += glyph_len;
- line_width += (float)glyph_width;
+ /* update the current row and set the current row layout */
+ layout->row.index = 0;
+ layout->at_y += layout->row.height;
+ layout->row.columns = cols;
+ if (height == 0.0f)
+ layout->row.height = NK_MAX(height, layout->row.min_height) + item_spacing.y;
+ else layout->row.height = height + item_spacing.y;
- glyph_len = nk_utf_decode(text + text_len, &unicode, len-text_len);
- glyph_width = font->width(font->userdata, font->height,
- text+text_len, glyph_len);
- continue;
- }
- text_size.y = (float)total_lines * row_height;
+ layout->row.item_offset = 0;
+ if (layout->flags & NK_WINDOW_DYNAMIC) {
+ /* draw background for dynamic panels */
+ struct nk_rect background;
+ background.x = win->bounds.x;
+ background.w = win->bounds.w;
+ background.y = layout->at_y - 1.0f;
+ background.h = layout->row.height + 1.0f;
+ nk_fill_rect(out, background, 0, color);
+ }
+}
+NK_LIB void
+nk_row_layout(struct nk_context *ctx, enum nk_layout_format fmt,
+ float height, int cols, int width)
+{
+ /* update the current row and set the current row layout */
+ struct nk_window *win;
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout)
+ return;
- /* handle case when cursor is at end of text buffer */
- if (!cursor_ptr && edit->cursor == edit->string.len) {
- cursor_pos.x = line_width;
- cursor_pos.y = text_size.y - row_height;
- }
- }
- {
- /* scrollbar */
- if (cursor_follow)
- {
- /* update scrollbar to follow cursor */
- if (!(flags & NK_EDIT_NO_HORIZONTAL_SCROLL)) {
- /* horizontal scroll */
- const float scroll_increment = area.w * 0.25f;
- if (cursor_pos.x < edit->scrollbar.x)
- edit->scrollbar.x = (float)(int)NK_MAX(0.0f, cursor_pos.x - scroll_increment);
- if (cursor_pos.x >= edit->scrollbar.x + area.w)
- edit->scrollbar.x = (float)(int)NK_MAX(0.0f, cursor_pos.x);
- } else edit->scrollbar.x = 0;
+ win = ctx->current;
+ nk_panel_layout(ctx, win, height, cols);
+ if (fmt == NK_DYNAMIC)
+ win->layout->row.type = NK_LAYOUT_DYNAMIC_FIXED;
+ else win->layout->row.type = NK_LAYOUT_STATIC_FIXED;
- if (flags & NK_EDIT_MULTILINE) {
- /* vertical scroll */
- if (cursor_pos.y < edit->scrollbar.y)
- edit->scrollbar.y = NK_MAX(0.0f, cursor_pos.y - row_height);
- if (cursor_pos.y >= edit->scrollbar.y + area.h)
- edit->scrollbar.y = edit->scrollbar.y + row_height;
- } else edit->scrollbar.y = 0;
- }
+ win->layout->row.ratio = 0;
+ win->layout->row.filled = 0;
+ win->layout->row.item_offset = 0;
+ win->layout->row.item_width = (float)width;
+}
+NK_API float
+nk_layout_ratio_from_pixel(struct nk_context *ctx, float pixel_width)
+{
+ struct nk_window *win;
+ NK_ASSERT(ctx);
+ NK_ASSERT(pixel_width);
+ if (!ctx || !ctx->current || !ctx->current->layout) return 0;
+ win = ctx->current;
+ return NK_CLAMP(0.0f, pixel_width/win->bounds.x, 1.0f);
+}
+NK_API void
+nk_layout_row_dynamic(struct nk_context *ctx, float height, int cols)
+{
+ nk_row_layout(ctx, NK_DYNAMIC, height, cols, 0);
+}
+NK_API void
+nk_layout_row_static(struct nk_context *ctx, float height, int item_width, int cols)
+{
+ nk_row_layout(ctx, NK_STATIC, height, cols, item_width);
+}
+NK_API void
+nk_layout_row_begin(struct nk_context *ctx, enum nk_layout_format fmt,
+ float row_height, int cols)
+{
+ struct nk_window *win;
+ struct nk_panel *layout;
- /* scrollbar widget */
- if (flags & NK_EDIT_MULTILINE)
- {
- nk_flags ws;
- struct nk_rect scroll;
- float scroll_target;
- float scroll_offset;
- float scroll_step;
- float scroll_inc;
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout)
+ return;
- scroll = area;
- scroll.x = (bounds.x + bounds.w - style->border) - style->scrollbar_size.x;
- scroll.w = style->scrollbar_size.x;
+ win = ctx->current;
+ layout = win->layout;
+ nk_panel_layout(ctx, win, row_height, cols);
+ if (fmt == NK_DYNAMIC)
+ layout->row.type = NK_LAYOUT_DYNAMIC_ROW;
+ else layout->row.type = NK_LAYOUT_STATIC_ROW;
- scroll_offset = edit->scrollbar.y;
- scroll_step = scroll.h * 0.10f;
- scroll_inc = scroll.h * 0.01f;
- scroll_target = text_size.y;
- edit->scrollbar.y = nk_do_scrollbarv(&ws, out, scroll, 0,
- scroll_offset, scroll_target, scroll_step, scroll_inc,
- &style->scrollbar, in, font);
- }
- }
-
- /* draw text */
- {struct nk_color background_color;
- struct nk_color text_color;
- struct nk_color sel_background_color;
- struct nk_color sel_text_color;
- struct nk_color cursor_color;
- struct nk_color cursor_text_color;
- const struct nk_style_item *background;
- nk_push_scissor(out, clip);
-
- /* select correct colors to draw */
- if (*state & NK_WIDGET_STATE_ACTIVED) {
- background = &style->active;
- text_color = style->text_active;
- sel_text_color = style->selected_text_hover;
- sel_background_color = style->selected_hover;
- cursor_color = style->cursor_hover;
- cursor_text_color = style->cursor_text_hover;
- } else if (*state & NK_WIDGET_STATE_HOVER) {
- background = &style->hover;
- text_color = style->text_hover;
- sel_text_color = style->selected_text_hover;
- sel_background_color = style->selected_hover;
- cursor_text_color = style->cursor_text_hover;
- cursor_color = style->cursor_hover;
- } else {
- background = &style->normal;
- text_color = style->text_normal;
- sel_text_color = style->selected_text_normal;
- sel_background_color = style->selected_normal;
- cursor_color = style->cursor_normal;
- cursor_text_color = style->cursor_text_normal;
- }
- if (background->type == NK_STYLE_ITEM_IMAGE)
- background_color = nk_rgba(0,0,0,0);
- else background_color = background->data.color;
+ layout->row.ratio = 0;
+ layout->row.filled = 0;
+ layout->row.item_width = 0;
+ layout->row.item_offset = 0;
+ layout->row.columns = cols;
+}
+NK_API void
+nk_layout_row_push(struct nk_context *ctx, float ratio_or_width)
+{
+ struct nk_window *win;
+ struct nk_panel *layout;
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout)
+ return;
- if (edit->select_start == edit->select_end) {
- /* no selection so just draw the complete text */
- const char *begin = nk_str_get_const(&edit->string);
- int l = nk_str_len_char(&edit->string);
- nk_edit_draw_text(out, style, area.x - edit->scrollbar.x,
- area.y - edit->scrollbar.y, 0, begin, l, row_height, font,
- background_color, text_color, nk_false);
- } else {
- /* edit has selection so draw 1-3 text chunks */
- if (edit->select_start != edit->select_end && selection_begin > 0){
- /* draw unselected text before selection */
- const char *begin = nk_str_get_const(&edit->string);
- NK_ASSERT(select_begin_ptr);
- nk_edit_draw_text(out, style, area.x - edit->scrollbar.x,
- area.y - edit->scrollbar.y, 0, begin, (int)(select_begin_ptr - begin),
- row_height, font, background_color, text_color, nk_false);
- }
- if (edit->select_start != edit->select_end) {
- /* draw selected text */
- NK_ASSERT(select_begin_ptr);
- if (!select_end_ptr) {
- const char *begin = nk_str_get_const(&edit->string);
- select_end_ptr = begin + nk_str_len_char(&edit->string);
- }
- nk_edit_draw_text(out, style,
- area.x - edit->scrollbar.x,
- area.y + selection_offset_start.y - edit->scrollbar.y,
- selection_offset_start.x,
- select_begin_ptr, (int)(select_end_ptr - select_begin_ptr),
- row_height, font, sel_background_color, sel_text_color, nk_true);
- }
- if ((edit->select_start != edit->select_end &&
- selection_end < edit->string.len))
- {
- /* draw unselected text after selected text */
- const char *begin = select_end_ptr;
- const char *end = nk_str_get_const(&edit->string) +
- nk_str_len_char(&edit->string);
- NK_ASSERT(select_end_ptr);
- nk_edit_draw_text(out, style,
- area.x - edit->scrollbar.x,
- area.y + selection_offset_end.y - edit->scrollbar.y,
- selection_offset_end.x,
- begin, (int)(end - begin), row_height, font,
- background_color, text_color, nk_true);
- }
- }
+ win = ctx->current;
+ layout = win->layout;
+ NK_ASSERT(layout->row.type == NK_LAYOUT_STATIC_ROW || layout->row.type == NK_LAYOUT_DYNAMIC_ROW);
+ if (layout->row.type != NK_LAYOUT_STATIC_ROW && layout->row.type != NK_LAYOUT_DYNAMIC_ROW)
+ return;
- /* cursor */
- if (edit->select_start == edit->select_end)
- {
- if (edit->cursor >= nk_str_len(&edit->string) ||
- (cursor_ptr && *cursor_ptr == '\n')) {
- /* draw cursor at end of line */
- struct nk_rect cursor;
- cursor.w = style->cursor_size;
- cursor.h = font->height;
- cursor.x = area.x + cursor_pos.x - edit->scrollbar.x;
- cursor.y = area.y + cursor_pos.y + row_height/2.0f - cursor.h/2.0f;
- cursor.y -= edit->scrollbar.y;
- nk_fill_rect(out, cursor, 0, cursor_color);
- } else {
- /* draw cursor inside text */
- int glyph_len;
- struct nk_rect label;
- struct nk_text txt;
+ if (layout->row.type == NK_LAYOUT_DYNAMIC_ROW) {
+ float ratio = ratio_or_width;
+ if ((ratio + layout->row.filled) > 1.0f) return;
+ if (ratio > 0.0f)
+ layout->row.item_width = NK_SATURATE(ratio);
+ else layout->row.item_width = 1.0f - layout->row.filled;
+ } else layout->row.item_width = ratio_or_width;
+}
+NK_API void
+nk_layout_row_end(struct nk_context *ctx)
+{
+ struct nk_window *win;
+ struct nk_panel *layout;
- nk_rune unicode;
- NK_ASSERT(cursor_ptr);
- glyph_len = nk_utf_decode(cursor_ptr, &unicode, 4);
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout)
+ return;
- label.x = area.x + cursor_pos.x - edit->scrollbar.x;
- label.y = area.y + cursor_pos.y - edit->scrollbar.y;
- label.w = font->width(font->userdata, font->height, cursor_ptr, glyph_len);
- label.h = row_height;
+ win = ctx->current;
+ layout = win->layout;
+ NK_ASSERT(layout->row.type == NK_LAYOUT_STATIC_ROW || layout->row.type == NK_LAYOUT_DYNAMIC_ROW);
+ if (layout->row.type != NK_LAYOUT_STATIC_ROW && layout->row.type != NK_LAYOUT_DYNAMIC_ROW)
+ return;
+ layout->row.item_width = 0;
+ layout->row.item_offset = 0;
+}
+NK_API void
+nk_layout_row(struct nk_context *ctx, enum nk_layout_format fmt,
+ float height, int cols, const float *ratio)
+{
+ int i;
+ int n_undef = 0;
+ struct nk_window *win;
+ struct nk_panel *layout;
- txt.padding = nk_vec2(0,0);
- txt.background = cursor_color;;
- txt.text = cursor_text_color;
- nk_fill_rect(out, label, 0, cursor_color);
- nk_widget_text(out, label, cursor_ptr, glyph_len, &txt, NK_TEXT_LEFT, font);
- }
- }}
- } else {
- /* not active so just draw text */
- int l = nk_str_len_char(&edit->string);
- const char *begin = nk_str_get_const(&edit->string);
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout)
+ return;
- const struct nk_style_item *background;
- struct nk_color background_color;
- struct nk_color text_color;
- nk_push_scissor(out, clip);
- if (*state & NK_WIDGET_STATE_ACTIVED) {
- background = &style->active;
- text_color = style->text_active;
- } else if (*state & NK_WIDGET_STATE_HOVER) {
- background = &style->hover;
- text_color = style->text_hover;
- } else {
- background = &style->normal;
- text_color = style->text_normal;
+ win = ctx->current;
+ layout = win->layout;
+ nk_panel_layout(ctx, win, height, cols);
+ if (fmt == NK_DYNAMIC) {
+ /* calculate width of undefined widget ratios */
+ float r = 0;
+ layout->row.ratio = ratio;
+ for (i = 0; i < cols; ++i) {
+ if (ratio[i] < 0.0f)
+ n_undef++;
+ else r += ratio[i];
}
- if (background->type == NK_STYLE_ITEM_IMAGE)
- background_color = nk_rgba(0,0,0,0);
- else background_color = background->data.color;
- nk_edit_draw_text(out, style, area.x - edit->scrollbar.x,
- area.y - edit->scrollbar.y, 0, begin, l, row_height, font,
- background_color, text_color, nk_false);
+ r = NK_SATURATE(1.0f - r);
+ layout->row.type = NK_LAYOUT_DYNAMIC;
+ layout->row.item_width = (r > 0 && n_undef > 0) ? (r / (float)n_undef):0;
+ } else {
+ layout->row.ratio = ratio;
+ layout->row.type = NK_LAYOUT_STATIC;
+ layout->row.item_width = 0;
+ layout->row.item_offset = 0;
}
- nk_push_scissor(out, old_clip);}
- return ret;
+ layout->row.item_offset = 0;
+ layout->row.filled = 0;
}
+NK_API void
+nk_layout_row_template_begin(struct nk_context *ctx, float height)
+{
+ struct nk_window *win;
+ struct nk_panel *layout;
-/* ===============================================================
- *
- * PROPERTY
- *
- * ===============================================================*/
-enum nk_property_status {
- NK_PROPERTY_DEFAULT,
- NK_PROPERTY_EDIT,
- NK_PROPERTY_DRAG
-};
-enum nk_property_filter {
- NK_FILTER_INT,
- NK_FILTER_FLOAT
-};
-enum nk_property_kind {
- NK_PROPERTY_INT,
- NK_PROPERTY_FLOAT,
- NK_PROPERTY_DOUBLE
-};
-union nk_property {
- int i;
- float f;
- double d;
-};
-struct nk_property_variant {
- enum nk_property_kind kind;
- union nk_property value;
- union nk_property min_value;
- union nk_property max_value;
- union nk_property step;
-};
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout)
+ return;
-NK_INTERN void
-nk_drag_behavior(nk_flags *state, const struct nk_input *in,
- struct nk_rect drag, struct nk_property_variant *variant,
- float inc_per_pixel)
+ win = ctx->current;
+ layout = win->layout;
+ nk_panel_layout(ctx, win, height, 1);
+ layout->row.type = NK_LAYOUT_TEMPLATE;
+ layout->row.columns = 0;
+ layout->row.ratio = 0;
+ layout->row.item_width = 0;
+ layout->row.item_height = 0;
+ layout->row.item_offset = 0;
+ layout->row.filled = 0;
+ layout->row.item.x = 0;
+ layout->row.item.y = 0;
+ layout->row.item.w = 0;
+ layout->row.item.h = 0;
+}
+NK_API void
+nk_layout_row_template_push_dynamic(struct nk_context *ctx)
{
- int left_mouse_down = in && in->mouse.buttons[NK_BUTTON_LEFT].down;
- int left_mouse_click_in_cursor = in &&
- nk_input_has_mouse_click_down_in_rect(in, NK_BUTTON_LEFT, drag, nk_true);
+ struct nk_window *win;
+ struct nk_panel *layout;
- nk_widget_state_reset(state);
- if (nk_input_is_mouse_hovering_rect(in, drag))
- *state = NK_WIDGET_STATE_HOVERED;
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout)
+ return;
- if (left_mouse_down && left_mouse_click_in_cursor) {
- float delta, pixels;
- pixels = in->mouse.delta.x;
- delta = pixels * inc_per_pixel;
- switch (variant->kind) {
- default: break;
- case NK_PROPERTY_INT:
- variant->value.i = variant->value.i + (int)delta;
- variant->value.i = NK_CLAMP(variant->min_value.i, variant->value.i, variant->max_value.i);
- break;
- case NK_PROPERTY_FLOAT:
- variant->value.f = variant->value.f + (float)delta;
- variant->value.f = NK_CLAMP(variant->min_value.f, variant->value.f, variant->max_value.f);
- break;
- case NK_PROPERTY_DOUBLE:
- variant->value.d = variant->value.d + (double)delta;
- variant->value.d = NK_CLAMP(variant->min_value.d, variant->value.d, variant->max_value.d);
- break;
- }
- *state = NK_WIDGET_STATE_ACTIVE;
- }
- if (*state & NK_WIDGET_STATE_HOVER && !nk_input_is_mouse_prev_hovering_rect(in, drag))
- *state |= NK_WIDGET_STATE_ENTERED;
- else if (nk_input_is_mouse_prev_hovering_rect(in, drag))
- *state |= NK_WIDGET_STATE_LEFT;
+ win = ctx->current;
+ layout = win->layout;
+ NK_ASSERT(layout->row.type == NK_LAYOUT_TEMPLATE);
+ NK_ASSERT(layout->row.columns < NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS);
+ if (layout->row.type != NK_LAYOUT_TEMPLATE) return;
+ if (layout->row.columns >= NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS) return;
+ layout->row.templates[layout->row.columns++] = -1.0f;
}
-
-NK_INTERN void
-nk_property_behavior(nk_flags *ws, const struct nk_input *in,
- struct nk_rect property, struct nk_rect label, struct nk_rect edit,
- struct nk_rect empty, int *state, struct nk_property_variant *variant,
- float inc_per_pixel)
+NK_API void
+nk_layout_row_template_push_variable(struct nk_context *ctx, float min_width)
{
- if (in && *state == NK_PROPERTY_DEFAULT) {
- if (nk_button_behavior(ws, edit, in, NK_BUTTON_DEFAULT))
- *state = NK_PROPERTY_EDIT;
- else if (nk_input_is_mouse_click_down_in_rect(in, NK_BUTTON_LEFT, label, nk_true))
- *state = NK_PROPERTY_DRAG;
- else if (nk_input_is_mouse_click_down_in_rect(in, NK_BUTTON_LEFT, empty, nk_true))
- *state = NK_PROPERTY_DRAG;
- }
- if (*state == NK_PROPERTY_DRAG) {
- nk_drag_behavior(ws, in, property, variant, inc_per_pixel);
- if (!(*ws & NK_WIDGET_STATE_ACTIVED)) *state = NK_PROPERTY_DEFAULT;
- }
+ struct nk_window *win;
+ struct nk_panel *layout;
+
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout)
+ return;
+
+ win = ctx->current;
+ layout = win->layout;
+ NK_ASSERT(layout->row.type == NK_LAYOUT_TEMPLATE);
+ NK_ASSERT(layout->row.columns < NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS);
+ if (layout->row.type != NK_LAYOUT_TEMPLATE) return;
+ if (layout->row.columns >= NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS) return;
+ layout->row.templates[layout->row.columns++] = -min_width;
}
+NK_API void
+nk_layout_row_template_push_static(struct nk_context *ctx, float width)
+{
+ struct nk_window *win;
+ struct nk_panel *layout;
-NK_INTERN void
-nk_draw_property(struct nk_command_buffer *out, const struct nk_style_property *style,
- const struct nk_rect *bounds, const struct nk_rect *label, nk_flags state,
- const char *name, int len, const struct nk_user_font *font)
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout)
+ return;
+
+ win = ctx->current;
+ layout = win->layout;
+ NK_ASSERT(layout->row.type == NK_LAYOUT_TEMPLATE);
+ NK_ASSERT(layout->row.columns < NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS);
+ if (layout->row.type != NK_LAYOUT_TEMPLATE) return;
+ if (layout->row.columns >= NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS) return;
+ layout->row.templates[layout->row.columns++] = width;
+}
+NK_API void
+nk_layout_row_template_end(struct nk_context *ctx)
{
- struct nk_text text;
- const struct nk_style_item *background;
+ struct nk_window *win;
+ struct nk_panel *layout;
- /* select correct background and text color */
- if (state & NK_WIDGET_STATE_ACTIVED) {
- background = &style->active;
- text.text = style->label_active;
- } else if (state & NK_WIDGET_STATE_HOVER) {
- background = &style->hover;
- text.text = style->label_hover;
- } else {
- background = &style->normal;
- text.text = style->label_normal;
- }
+ int i = 0;
+ int variable_count = 0;
+ int min_variable_count = 0;
+ float min_fixed_width = 0.0f;
+ float total_fixed_width = 0.0f;
+ float max_variable_width = 0.0f;
- /* draw background */
- if (background->type == NK_STYLE_ITEM_IMAGE) {
- nk_draw_image(out, *bounds, &background->data.image, nk_white);
- text.background = nk_rgba(0,0,0,0);
- } else {
- text.background = background->data.color;
- nk_fill_rect(out, *bounds, style->rounding, background->data.color);
- nk_stroke_rect(out, *bounds, style->rounding, style->border, background->data.color);
- }
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout)
+ return;
- /* draw label */
- text.padding = nk_vec2(0,0);
- nk_widget_text(out, *label, name, len, &text, NK_TEXT_CENTERED, font);
+ win = ctx->current;
+ layout = win->layout;
+ NK_ASSERT(layout->row.type == NK_LAYOUT_TEMPLATE);
+ if (layout->row.type != NK_LAYOUT_TEMPLATE) return;
+ for (i = 0; i < layout->row.columns; ++i) {
+ float width = layout->row.templates[i];
+ if (width >= 0.0f) {
+ total_fixed_width += width;
+ min_fixed_width += width;
+ } else if (width < -1.0f) {
+ width = -width;
+ total_fixed_width += width;
+ max_variable_width = NK_MAX(max_variable_width, width);
+ variable_count++;
+ } else {
+ min_variable_count++;
+ variable_count++;
+ }
+ }
+ if (variable_count) {
+ float space = nk_layout_row_calculate_usable_space(&ctx->style, layout->type,
+ layout->bounds.w, layout->row.columns);
+ float var_width = (NK_MAX(space-min_fixed_width,0.0f)) / (float)variable_count;
+ int enough_space = var_width >= max_variable_width;
+ if (!enough_space)
+ var_width = (NK_MAX(space-total_fixed_width,0)) / (float)min_variable_count;
+ for (i = 0; i < layout->row.columns; ++i) {
+ float *width = &layout->row.templates[i];
+ *width = (*width >= 0.0f)? *width: (*width < -1.0f && !enough_space)? -(*width): var_width;
+ }
+ }
}
-
-NK_INTERN void
-nk_do_property(nk_flags *ws,
- struct nk_command_buffer *out, struct nk_rect property,
- const char *name, struct nk_property_variant *variant,
- float inc_per_pixel, char *buffer, int *len,
- int *state, int *cursor, int *select_begin, int *select_end,
- const struct nk_style_property *style,
- enum nk_property_filter filter, struct nk_input *in,
- const struct nk_user_font *font, struct nk_text_edit *text_edit,
- enum nk_button_behavior behavior)
+NK_API void
+nk_layout_space_begin(struct nk_context *ctx, enum nk_layout_format fmt,
+ float height, int widget_count)
{
- const nk_plugin_filter filters[] = {
- nk_filter_decimal,
- nk_filter_float
- };
- int active, old;
- int num_len, name_len;
- char string[NK_MAX_NUMBER_BUFFER];
- float size;
-
- char *dst = 0;
- int *length;
+ struct nk_window *win;
+ struct nk_panel *layout;
- struct nk_rect left;
- struct nk_rect right;
- struct nk_rect label;
- struct nk_rect edit;
- struct nk_rect empty;
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout)
+ return;
- /* left decrement button */
- left.h = font->height/2;
- left.w = left.h;
- left.x = property.x + style->border + style->padding.x;
- left.y = property.y + style->border + property.h/2.0f - left.h/2;
+ win = ctx->current;
+ layout = win->layout;
+ nk_panel_layout(ctx, win, height, widget_count);
+ if (fmt == NK_STATIC)
+ layout->row.type = NK_LAYOUT_STATIC_FREE;
+ else layout->row.type = NK_LAYOUT_DYNAMIC_FREE;
- /* text label */
- name_len = nk_strlen(name);
- size = font->width(font->userdata, font->height, name, name_len);
- label.x = left.x + left.w + style->padding.x;
- label.w = (float)size + 2 * style->padding.x;
- label.y = property.y + style->border + style->padding.y;
- label.h = property.h - (2 * style->border + 2 * style->padding.y);
+ layout->row.ratio = 0;
+ layout->row.filled = 0;
+ layout->row.item_width = 0;
+ layout->row.item_offset = 0;
+}
+NK_API void
+nk_layout_space_end(struct nk_context *ctx)
+{
+ struct nk_window *win;
+ struct nk_panel *layout;
- /* right increment button */
- right.y = left.y;
- right.w = left.w;
- right.h = left.h;
- right.x = property.x + property.w - (right.w + style->padding.x);
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout)
+ return;
- /* edit */
- if (*state == NK_PROPERTY_EDIT) {
- size = font->width(font->userdata, font->height, buffer, *len);
- size += style->edit.cursor_size;
- length = len;
- dst = buffer;
- } else {
- switch (variant->kind) {
- default: break;
- case NK_PROPERTY_INT:
- nk_itoa(string, variant->value.i);
- num_len = nk_strlen(string);
- break;
- case NK_PROPERTY_FLOAT:
- nk_dtoa(string, (double)variant->value.f);
- num_len = nk_string_float_limit(string, NK_MAX_FLOAT_PRECISION);
- break;
- case NK_PROPERTY_DOUBLE:
- nk_dtoa(string, variant->value.d);
- num_len = nk_string_float_limit(string, NK_MAX_FLOAT_PRECISION);
- break;
- }
- size = font->width(font->userdata, font->height, string, num_len);
- dst = string;
- length = &num_len;
- }
+ win = ctx->current;
+ layout = win->layout;
+ layout->row.item_width = 0;
+ layout->row.item_height = 0;
+ layout->row.item_offset = 0;
+ nk_zero(&layout->row.item, sizeof(layout->row.item));
+}
+NK_API void
+nk_layout_space_push(struct nk_context *ctx, struct nk_rect rect)
+{
+ struct nk_window *win;
+ struct nk_panel *layout;
- edit.w = (float)size + 2 * style->padding.x;
- edit.w = NK_MIN(edit.w, right.x - (label.x + label.w));
- edit.x = right.x - (edit.w + style->padding.x);
- edit.y = property.y + style->border;
- edit.h = property.h - (2 * style->border);
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout)
+ return;
- /* empty left space activator */
- empty.w = edit.x - (label.x + label.w);
- empty.x = label.x + label.w;
- empty.y = property.y;
- empty.h = property.h;
+ win = ctx->current;
+ layout = win->layout;
+ layout->row.item = rect;
+}
+NK_API struct nk_rect
+nk_layout_space_bounds(struct nk_context *ctx)
+{
+ struct nk_rect ret;
+ struct nk_window *win;
+ struct nk_panel *layout;
- /* update property */
- old = (*state == NK_PROPERTY_EDIT);
- nk_property_behavior(ws, in, property, label, edit, empty, state, variant, inc_per_pixel);
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ win = ctx->current;
+ layout = win->layout;
- /* draw property */
- if (style->draw_begin) style->draw_begin(out, style->userdata);
- nk_draw_property(out, style, &property, &label, *ws, name, name_len, font);
- if (style->draw_end) style->draw_end(out, style->userdata);
+ ret.x = layout->clip.x;
+ ret.y = layout->clip.y;
+ ret.w = layout->clip.w;
+ ret.h = layout->row.height;
+ return ret;
+}
+NK_API struct nk_rect
+nk_layout_widget_bounds(struct nk_context *ctx)
+{
+ struct nk_rect ret;
+ struct nk_window *win;
+ struct nk_panel *layout;
- /* execute right button */
- if (nk_do_button_symbol(ws, out, left, style->sym_left, behavior, &style->dec_button, in, font)) {
- switch (variant->kind) {
- default: break;
- case NK_PROPERTY_INT:
- variant->value.i = NK_CLAMP(variant->min_value.i, variant->value.i - variant->step.i, variant->max_value.i); break;
- case NK_PROPERTY_FLOAT:
- variant->value.f = NK_CLAMP(variant->min_value.f, variant->value.f - variant->step.f, variant->max_value.f); break;
- case NK_PROPERTY_DOUBLE:
- variant->value.d = NK_CLAMP(variant->min_value.d, variant->value.d - variant->step.d, variant->max_value.d); break;
- }
- }
- /* execute left button */
- if (nk_do_button_symbol(ws, out, right, style->sym_right, behavior, &style->inc_button, in, font)) {
- switch (variant->kind) {
- default: break;
- case NK_PROPERTY_INT:
- variant->value.i = NK_CLAMP(variant->min_value.i, variant->value.i + variant->step.i, variant->max_value.i); break;
- case NK_PROPERTY_FLOAT:
- variant->value.f = NK_CLAMP(variant->min_value.f, variant->value.f + variant->step.f, variant->max_value.f); break;
- case NK_PROPERTY_DOUBLE:
- variant->value.d = NK_CLAMP(variant->min_value.d, variant->value.d + variant->step.d, variant->max_value.d); break;
- }
- }
- if (old != NK_PROPERTY_EDIT && (*state == NK_PROPERTY_EDIT)) {
- /* property has been activated so setup buffer */
- NK_MEMCPY(buffer, dst, (nk_size)*length);
- *cursor = nk_utf_len(buffer, *length);
- *len = *length;
- length = len;
- dst = buffer;
- active = 0;
- } else active = (*state == NK_PROPERTY_EDIT);
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ win = ctx->current;
+ layout = win->layout;
- /* execute and run text edit field */
- nk_textedit_clear_state(text_edit, NK_TEXT_EDIT_SINGLE_LINE, filters[filter]);
- text_edit->active = (unsigned char)active;
- text_edit->string.len = *length;
- text_edit->cursor = NK_CLAMP(0, *cursor, *length);
- text_edit->select_start = NK_CLAMP(0,*select_begin, *length);
- text_edit->select_end = NK_CLAMP(0,*select_end, *length);
- text_edit->string.buffer.allocated = (nk_size)*length;
- text_edit->string.buffer.memory.size = NK_MAX_NUMBER_BUFFER;
- text_edit->string.buffer.memory.ptr = dst;
- text_edit->string.buffer.size = NK_MAX_NUMBER_BUFFER;
- text_edit->mode = NK_TEXT_EDIT_MODE_INSERT;
- nk_do_edit(ws, out, edit, NK_EDIT_FIELD|NK_EDIT_AUTO_SELECT,
- filters[filter], text_edit, &style->edit, (*state == NK_PROPERTY_EDIT) ? in: 0, font);
+ ret.x = layout->at_x;
+ ret.y = layout->at_y;
+ ret.w = layout->bounds.w - NK_MAX(layout->at_x - layout->bounds.x,0);
+ ret.h = layout->row.height;
+ return ret;
+}
+NK_API struct nk_vec2
+nk_layout_space_to_screen(struct nk_context *ctx, struct nk_vec2 ret)
+{
+ struct nk_window *win;
+ struct nk_panel *layout;
- *length = text_edit->string.len;
- *cursor = text_edit->cursor;
- *select_begin = text_edit->select_start;
- *select_end = text_edit->select_end;
- if (text_edit->active && nk_input_is_key_pressed(in, NK_KEY_ENTER))
- text_edit->active = nk_false;
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ win = ctx->current;
+ layout = win->layout;
- if (active && !text_edit->active) {
- /* property is now not active so convert edit text to value*/
- *state = NK_PROPERTY_DEFAULT;
- buffer[*len] = '\0';
- switch (variant->kind) {
- default: break;
- case NK_PROPERTY_INT:
- variant->value.i = nk_strtoi(buffer, 0);
- variant->value.i = NK_CLAMP(variant->min_value.i, variant->value.i, variant->max_value.i);
- break;
- case NK_PROPERTY_FLOAT:
- nk_string_float_limit(buffer, NK_MAX_FLOAT_PRECISION);
- variant->value.f = nk_strtof(buffer, 0);
- variant->value.f = NK_CLAMP(variant->min_value.f, variant->value.f, variant->max_value.f);
- break;
- case NK_PROPERTY_DOUBLE:
- nk_string_float_limit(buffer, NK_MAX_FLOAT_PRECISION);
- variant->value.d = nk_strtod(buffer, 0);
- variant->value.d = NK_CLAMP(variant->min_value.d, variant->value.d, variant->max_value.d);
- break;
- }
- }
+ ret.x += layout->at_x - (float)*layout->offset_x;
+ ret.y += layout->at_y - (float)*layout->offset_y;
+ return ret;
}
-/* ===============================================================
- *
- * COLOR PICKER
- *
- * ===============================================================*/
-NK_INTERN int
-nk_color_picker_behavior(nk_flags *state,
- const struct nk_rect *bounds, const struct nk_rect *matrix,
- const struct nk_rect *hue_bar, const struct nk_rect *alpha_bar,
- struct nk_color *color, const struct nk_input *in)
+NK_API struct nk_vec2
+nk_layout_space_to_local(struct nk_context *ctx, struct nk_vec2 ret)
{
- float hsva[4];
- int value_changed = 0;
- int hsv_changed = 0;
+ struct nk_window *win;
+ struct nk_panel *layout;
- NK_ASSERT(state);
- NK_ASSERT(matrix);
- NK_ASSERT(hue_bar);
- NK_ASSERT(color);
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ win = ctx->current;
+ layout = win->layout;
- /* color matrix */
- nk_color_hsva_fv(hsva, *color);
- if (nk_button_behavior(state, *matrix, in, NK_BUTTON_REPEATER)) {
- hsva[1] = NK_SATURATE((in->mouse.pos.x - matrix->x) / (matrix->w-1));
- hsva[2] = 1.0f - NK_SATURATE((in->mouse.pos.y - matrix->y) / (matrix->h-1));
- value_changed = hsv_changed = 1;
- }
+ ret.x += -layout->at_x + (float)*layout->offset_x;
+ ret.y += -layout->at_y + (float)*layout->offset_y;
+ return ret;
+}
+NK_API struct nk_rect
+nk_layout_space_rect_to_screen(struct nk_context *ctx, struct nk_rect ret)
+{
+ struct nk_window *win;
+ struct nk_panel *layout;
- /* hue bar */
- if (nk_button_behavior(state, *hue_bar, in, NK_BUTTON_REPEATER)) {
- hsva[0] = NK_SATURATE((in->mouse.pos.y - hue_bar->y) / (hue_bar->h-1));
- value_changed = hsv_changed = 1;
- }
-
- /* alpha bar */
- if (alpha_bar) {
- if (nk_button_behavior(state, *alpha_bar, in, NK_BUTTON_REPEATER)) {
- hsva[3] = 1.0f - NK_SATURATE((in->mouse.pos.y - alpha_bar->y) / (alpha_bar->h-1));
- value_changed = 1;
- }
- }
- nk_widget_state_reset(state);
- if (hsv_changed) {
- *color = nk_hsva_fv(hsva);
- *state = NK_WIDGET_STATE_ACTIVE;
- }
- if (value_changed) {
- color->a = (nk_byte)(hsva[3] * 255.0f);
- *state = NK_WIDGET_STATE_ACTIVE;
- }
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ win = ctx->current;
+ layout = win->layout;
- /* set color picker widget state */
- if (nk_input_is_mouse_hovering_rect(in, *bounds))
- *state = NK_WIDGET_STATE_HOVERED;
- if (*state & NK_WIDGET_STATE_HOVER && !nk_input_is_mouse_prev_hovering_rect(in, *bounds))
- *state |= NK_WIDGET_STATE_ENTERED;
- else if (nk_input_is_mouse_prev_hovering_rect(in, *bounds))
- *state |= NK_WIDGET_STATE_LEFT;
- return value_changed;
+ ret.x += layout->at_x - (float)*layout->offset_x;
+ ret.y += layout->at_y - (float)*layout->offset_y;
+ return ret;
}
+NK_API struct nk_rect
+nk_layout_space_rect_to_local(struct nk_context *ctx, struct nk_rect ret)
+{
+ struct nk_window *win;
+ struct nk_panel *layout;
-NK_INTERN void
-nk_draw_color_picker(struct nk_command_buffer *o, const struct nk_rect *matrix,
- const struct nk_rect *hue_bar, const struct nk_rect *alpha_bar,
- struct nk_color color)
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ win = ctx->current;
+ layout = win->layout;
+
+ ret.x += -layout->at_x + (float)*layout->offset_x;
+ ret.y += -layout->at_y + (float)*layout->offset_y;
+ return ret;
+}
+NK_LIB void
+nk_panel_alloc_row(const struct nk_context *ctx, struct nk_window *win)
{
- NK_STORAGE const struct nk_color black = {0,0,0,255};
- NK_STORAGE const struct nk_color white = {255, 255, 255, 255};
- NK_STORAGE const struct nk_color black_trans = {0,0,0,0};
+ struct nk_panel *layout = win->layout;
+ struct nk_vec2 spacing = ctx->style.window.spacing;
+ const float row_height = layout->row.height - spacing.y;
+ nk_panel_layout(ctx, win, row_height, layout->row.columns);
+}
+NK_LIB void
+nk_layout_widget_space(struct nk_rect *bounds, const struct nk_context *ctx,
+ struct nk_window *win, int modify)
+{
+ struct nk_panel *layout;
+ const struct nk_style *style;
- const float crosshair_size = 7.0f;
- struct nk_color temp;
- float hsva[4];
- float line_y;
- int i;
+ struct nk_vec2 spacing;
+ struct nk_vec2 padding;
- NK_ASSERT(o);
- NK_ASSERT(matrix);
- NK_ASSERT(hue_bar);
+ float item_offset = 0;
+ float item_width = 0;
+ float item_spacing = 0;
+ float panel_space = 0;
- /* draw hue bar */
- nk_color_hsv_fv(hsva, color);
- for (i = 0; i < 6; ++i) {
- NK_GLOBAL const struct nk_color hue_colors[] = {
- {255, 0, 0, 255},
- {255,255,0,255},
- {0,255,0,255},
- {0, 255,255,255},
- {0,0,255,255},
- {255, 0, 255, 255},
- {255, 0, 0, 255}
- };
- nk_fill_rect_multi_color(o,
- nk_rect(hue_bar->x, hue_bar->y + (float)i * (hue_bar->h/6.0f) + 0.5f,
- hue_bar->w, (hue_bar->h/6.0f) + 0.5f), hue_colors[i], hue_colors[i],
- hue_colors[i+1], hue_colors[i+1]);
- }
- line_y = (float)(int)(hue_bar->y + hsva[0] * matrix->h + 0.5f);
- nk_stroke_line(o, hue_bar->x-1, line_y, hue_bar->x + hue_bar->w + 2,
- line_y, 1, nk_rgb(255,255,255));
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout)
+ return;
- /* draw alpha bar */
- if (alpha_bar) {
- float alpha = NK_SATURATE((float)color.a/255.0f);
- line_y = (float)(int)(alpha_bar->y + (1.0f - alpha) * matrix->h + 0.5f);
+ win = ctx->current;
+ layout = win->layout;
+ style = &ctx->style;
+ NK_ASSERT(bounds);
- nk_fill_rect_multi_color(o, *alpha_bar, white, white, black, black);
- nk_stroke_line(o, alpha_bar->x-1, line_y, alpha_bar->x + alpha_bar->w + 2,
- line_y, 1, nk_rgb(255,255,255));
+ spacing = style->window.spacing;
+ padding = nk_panel_get_padding(style, layout->type);
+ panel_space = nk_layout_row_calculate_usable_space(&ctx->style, layout->type,
+ layout->bounds.w, layout->row.columns);
+
+ #define NK_FRAC(x) (x - (int)x) /* will be used to remove fookin gaps */
+ /* calculate the width of one item inside the current layout space */
+ switch (layout->row.type) {
+ case NK_LAYOUT_DYNAMIC_FIXED: {
+ /* scaling fixed size widgets item width */
+ float w = NK_MAX(1.0f,panel_space) / (float)layout->row.columns;
+ item_offset = (float)layout->row.index * w;
+ item_width = w + NK_FRAC(item_offset);
+ item_spacing = (float)layout->row.index * spacing.x;
+ } break;
+ case NK_LAYOUT_DYNAMIC_ROW: {
+ /* scaling single ratio widget width */
+ float w = layout->row.item_width * panel_space;
+ item_offset = layout->row.item_offset;
+ item_width = w + NK_FRAC(item_offset);
+ item_spacing = 0;
+
+ if (modify) {
+ layout->row.item_offset += w + spacing.x;
+ layout->row.filled += layout->row.item_width;
+ layout->row.index = 0;
+ }
+ } break;
+ case NK_LAYOUT_DYNAMIC_FREE: {
+ /* panel width depended free widget placing */
+ bounds->x = layout->at_x + (layout->bounds.w * layout->row.item.x);
+ bounds->x -= (float)*layout->offset_x;
+ bounds->y = layout->at_y + (layout->row.height * layout->row.item.y);
+ bounds->y -= (float)*layout->offset_y;
+ bounds->w = layout->bounds.w * layout->row.item.w + NK_FRAC(bounds->x);
+ bounds->h = layout->row.height * layout->row.item.h + NK_FRAC(bounds->y);
+ return;
}
+ case NK_LAYOUT_DYNAMIC: {
+ /* scaling arrays of panel width ratios for every widget */
+ float ratio, w;
+ NK_ASSERT(layout->row.ratio);
+ ratio = (layout->row.ratio[layout->row.index] < 0) ?
+ layout->row.item_width : layout->row.ratio[layout->row.index];
- /* draw color matrix */
- temp = nk_hsv_f(hsva[0], 1.0f, 1.0f);
- nk_fill_rect_multi_color(o, *matrix, white, temp, temp, white);
- nk_fill_rect_multi_color(o, *matrix, black_trans, black_trans, black, black);
+ w = (ratio * panel_space);
+ item_spacing = (float)layout->row.index * spacing.x;
+ item_offset = layout->row.item_offset;
+ item_width = w + NK_FRAC(item_offset);
- /* draw cross-hair */
- {struct nk_vec2 p; float S = hsva[1]; float V = hsva[2];
- p.x = (float)(int)(matrix->x + S * matrix->w);
- p.y = (float)(int)(matrix->y + (1.0f - V) * matrix->h);
- nk_stroke_line(o, p.x - crosshair_size, p.y, p.x-2, p.y, 1.0f, white);
- nk_stroke_line(o, p.x + crosshair_size + 1, p.y, p.x+3, p.y, 1.0f, white);
- nk_stroke_line(o, p.x, p.y + crosshair_size + 1, p.x, p.y+3, 1.0f, white);
- nk_stroke_line(o, p.x, p.y - crosshair_size, p.x, p.y-2, 1.0f, white);}
-}
+ if (modify) {
+ layout->row.item_offset += w;
+ layout->row.filled += ratio;
+ }
+ } break;
+ case NK_LAYOUT_STATIC_FIXED: {
+ /* non-scaling fixed widgets item width */
+ item_width = layout->row.item_width;
+ item_offset = (float)layout->row.index * item_width;
+ item_spacing = (float)layout->row.index * spacing.x;
+ } break;
+ case NK_LAYOUT_STATIC_ROW: {
+ /* scaling single ratio widget width */
+ item_width = layout->row.item_width;
+ item_offset = layout->row.item_offset;
+ item_spacing = (float)layout->row.index * spacing.x;
+ if (modify) layout->row.item_offset += item_width;
+ } break;
+ case NK_LAYOUT_STATIC_FREE: {
+ /* free widget placing */
+ bounds->x = layout->at_x + layout->row.item.x;
+ bounds->w = layout->row.item.w;
+ if (((bounds->x + bounds->w) > layout->max_x) && modify)
+ layout->max_x = (bounds->x + bounds->w);
+ bounds->x -= (float)*layout->offset_x;
+ bounds->y = layout->at_y + layout->row.item.y;
+ bounds->y -= (float)*layout->offset_y;
+ bounds->h = layout->row.item.h;
+ return;
+ }
+ case NK_LAYOUT_STATIC: {
+ /* non-scaling array of panel pixel width for every widget */
+ item_spacing = (float)layout->row.index * spacing.x;
+ item_width = layout->row.ratio[layout->row.index];
+ item_offset = layout->row.item_offset;
+ if (modify) layout->row.item_offset += item_width;
+ } break;
+ case NK_LAYOUT_TEMPLATE: {
+ /* stretchy row layout with combined dynamic/static widget width*/
+ float w;
+ NK_ASSERT(layout->row.index < layout->row.columns);
+ NK_ASSERT(layout->row.index < NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS);
+ w = layout->row.templates[layout->row.index];
+ item_offset = layout->row.item_offset;
+ item_width = w + NK_FRAC(item_offset);
+ item_spacing = (float)layout->row.index * spacing.x;
+ if (modify) layout->row.item_offset += w;
+ } break;
+ #undef NK_FRAC
+ default: NK_ASSERT(0); break;
+ };
-NK_INTERN int
-nk_do_color_picker(nk_flags *state,
- struct nk_command_buffer *out, struct nk_color *color,
- enum nk_color_format fmt, struct nk_rect bounds,
- struct nk_vec2 padding, const struct nk_input *in,
- const struct nk_user_font *font)
+ /* set the bounds of the newly allocated widget */
+ bounds->w = item_width;
+ bounds->h = layout->row.height - spacing.y;
+ bounds->y = layout->at_y - (float)*layout->offset_y;
+ bounds->x = layout->at_x + item_offset + item_spacing + padding.x;
+ if (((bounds->x + bounds->w) > layout->max_x) && modify)
+ layout->max_x = bounds->x + bounds->w;
+ bounds->x -= (float)*layout->offset_x;
+}
+NK_LIB void
+nk_panel_alloc_space(struct nk_rect *bounds, const struct nk_context *ctx)
{
- int ret = 0;
- struct nk_rect matrix;
- struct nk_rect hue_bar;
- struct nk_rect alpha_bar;
- float bar_w;
+ struct nk_window *win;
+ struct nk_panel *layout;
- NK_ASSERT(out);
- NK_ASSERT(color);
- NK_ASSERT(state);
- NK_ASSERT(font);
- if (!out || !color || !state || !font)
- return ret;
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout)
+ return;
- bar_w = font->height;
- bounds.x += padding.x;
- bounds.y += padding.x;
- bounds.w -= 2 * padding.x;
- bounds.h -= 2 * padding.y;
+ /* check if the end of the row has been hit and begin new row if so */
+ win = ctx->current;
+ layout = win->layout;
+ if (layout->row.index >= layout->row.columns)
+ nk_panel_alloc_row(ctx, win);
- matrix.x = bounds.x;
- matrix.y = bounds.y;
- matrix.h = bounds.h;
- matrix.w = bounds.w - (3 * padding.x + 2 * bar_w);
-
- hue_bar.w = bar_w;
- hue_bar.y = bounds.y;
- hue_bar.h = matrix.h;
- hue_bar.x = matrix.x + matrix.w + padding.x;
-
- alpha_bar.x = hue_bar.x + hue_bar.w + padding.x;
- alpha_bar.y = bounds.y;
- alpha_bar.w = bar_w;
- alpha_bar.h = matrix.h;
-
- ret = nk_color_picker_behavior(state, &bounds, &matrix, &hue_bar,
- (fmt == NK_RGBA) ? &alpha_bar:0, color, in);
- nk_draw_color_picker(out, &matrix, &hue_bar, (fmt == NK_RGBA) ? &alpha_bar:0, *color);
- return ret;
-}
-
-/* ==============================================================
- *
- * STYLE
- *
- * ===============================================================*/
-NK_API void nk_style_default(struct nk_context *ctx){nk_style_from_table(ctx, 0);}
-#define NK_COLOR_MAP(NK_COLOR)\
- NK_COLOR(NK_COLOR_TEXT, 175,175,175,255) \
- NK_COLOR(NK_COLOR_WINDOW, 45, 45, 45, 255) \
- NK_COLOR(NK_COLOR_HEADER, 40, 40, 40, 255) \
- NK_COLOR(NK_COLOR_BORDER, 65, 65, 65, 255) \
- NK_COLOR(NK_COLOR_BUTTON, 50, 50, 50, 255) \
- NK_COLOR(NK_COLOR_BUTTON_HOVER, 40, 40, 40, 255) \
- NK_COLOR(NK_COLOR_BUTTON_ACTIVE, 35, 35, 35, 255) \
- NK_COLOR(NK_COLOR_TOGGLE, 100,100,100,255) \
- NK_COLOR(NK_COLOR_TOGGLE_HOVER, 120,120,120,255) \
- NK_COLOR(NK_COLOR_TOGGLE_CURSOR, 45, 45, 45, 255) \
- NK_COLOR(NK_COLOR_SELECT, 45, 45, 45, 255) \
- NK_COLOR(NK_COLOR_SELECT_ACTIVE, 35, 35, 35,255) \
- NK_COLOR(NK_COLOR_SLIDER, 38, 38, 38, 255) \
- NK_COLOR(NK_COLOR_SLIDER_CURSOR, 100,100,100,255) \
- NK_COLOR(NK_COLOR_SLIDER_CURSOR_HOVER, 120,120,120,255) \
- NK_COLOR(NK_COLOR_SLIDER_CURSOR_ACTIVE, 150,150,150,255) \
- NK_COLOR(NK_COLOR_PROPERTY, 38, 38, 38, 255) \
- NK_COLOR(NK_COLOR_EDIT, 38, 38, 38, 255) \
- NK_COLOR(NK_COLOR_EDIT_CURSOR, 175,175,175,255) \
- NK_COLOR(NK_COLOR_COMBO, 45, 45, 45, 255) \
- NK_COLOR(NK_COLOR_CHART, 120,120,120,255) \
- NK_COLOR(NK_COLOR_CHART_COLOR, 45, 45, 45, 255) \
- NK_COLOR(NK_COLOR_CHART_COLOR_HIGHLIGHT,255, 0, 0, 255) \
- NK_COLOR(NK_COLOR_SCROLLBAR, 40, 40, 40, 255) \
- NK_COLOR(NK_COLOR_SCROLLBAR_CURSOR, 100,100,100,255) \
- NK_COLOR(NK_COLOR_SCROLLBAR_CURSOR_HOVER,120,120,120,255) \
- NK_COLOR(NK_COLOR_SCROLLBAR_CURSOR_ACTIVE,150,150,150,255) \
- NK_COLOR(NK_COLOR_TAB_HEADER, 40, 40, 40,255)
-
-NK_GLOBAL const struct nk_color
-nk_default_color_style[NK_COLOR_COUNT] = {
-#define NK_COLOR(a,b,c,d,e) {b,c,d,e},
- NK_COLOR_MAP(NK_COLOR)
-#undef NK_COLOR
-};
-
-NK_GLOBAL const char *nk_color_names[NK_COLOR_COUNT] = {
-#define NK_COLOR(a,b,c,d,e) #a,
- NK_COLOR_MAP(NK_COLOR)
-#undef NK_COLOR
-};
-
-NK_API const char *nk_style_get_color_by_name(enum nk_style_colors c)
-{return nk_color_names[c];}
-
-NK_API struct nk_style_item nk_style_item_image(struct nk_image img)
-{struct nk_style_item i; i.type = NK_STYLE_ITEM_IMAGE; i.data.image = img; return i;}
-
-NK_API struct nk_style_item nk_style_item_color(struct nk_color col)
-{struct nk_style_item i; i.type = NK_STYLE_ITEM_COLOR; i.data.color = col; return i;}
-
-NK_API struct nk_style_item nk_style_item_hide(void)
-{struct nk_style_item i; i.type = NK_STYLE_ITEM_COLOR; i.data.color = nk_rgba(0,0,0,0); return i;}
-
-NK_API void
-nk_style_from_table(struct nk_context *ctx, const struct nk_color *table)
-{
- struct nk_style *style;
- struct nk_style_text *text;
- struct nk_style_button *button;
- struct nk_style_toggle *toggle;
- struct nk_style_selectable *select;
- struct nk_style_slider *slider;
- struct nk_style_progress *prog;
- struct nk_style_scrollbar *scroll;
- struct nk_style_edit *edit;
- struct nk_style_property *property;
- struct nk_style_combo *combo;
- struct nk_style_chart *chart;
- struct nk_style_tab *tab;
- struct nk_style_window *win;
+ /* calculate widget position and size */
+ nk_layout_widget_space(bounds, ctx, win, nk_true);
+ layout->row.index++;
+}
+NK_LIB void
+nk_layout_peek(struct nk_rect *bounds, struct nk_context *ctx)
+{
+ float y;
+ int index;
+ struct nk_window *win;
+ struct nk_panel *layout;
NK_ASSERT(ctx);
- if (!ctx) return;
- style = &ctx->style;
- table = (!table) ? nk_default_color_style: table;
-
- /* default text */
- text = &style->text;
- text->color = table[NK_COLOR_TEXT];
- text->padding = nk_vec2(0,0);
-
- /* default button */
- button = &style->button;
- nk_zero_struct(*button);
- button->normal = nk_style_item_color(table[NK_COLOR_BUTTON]);
- button->hover = nk_style_item_color(table[NK_COLOR_BUTTON_HOVER]);
- button->active = nk_style_item_color(table[NK_COLOR_BUTTON_ACTIVE]);
- button->border_color = table[NK_COLOR_BORDER];
- button->text_background = table[NK_COLOR_BUTTON];
- button->text_normal = table[NK_COLOR_TEXT];
- button->text_hover = table[NK_COLOR_TEXT];
- button->text_active = table[NK_COLOR_TEXT];
- button->padding = nk_vec2(2.0f,2.0f);
- button->image_padding = nk_vec2(0.0f,0.0f);
- button->touch_padding = nk_vec2(0.0f, 0.0f);
- button->userdata = nk_handle_ptr(0);
- button->text_alignment = NK_TEXT_CENTERED;
- button->border = 1.0f;
- button->rounding = 4.0f;
- button->draw_begin = 0;
- button->draw_end = 0;
-
- /* contextual button */
- button = &style->contextual_button;
- nk_zero_struct(*button);
- button->normal = nk_style_item_color(table[NK_COLOR_WINDOW]);
- button->hover = nk_style_item_color(table[NK_COLOR_BUTTON_HOVER]);
- button->active = nk_style_item_color(table[NK_COLOR_BUTTON_ACTIVE]);
- button->border_color = table[NK_COLOR_WINDOW];
- button->text_background = table[NK_COLOR_WINDOW];
- button->text_normal = table[NK_COLOR_TEXT];
- button->text_hover = table[NK_COLOR_TEXT];
- button->text_active = table[NK_COLOR_TEXT];
- button->padding = nk_vec2(2.0f,2.0f);
- button->touch_padding = nk_vec2(0.0f,0.0f);
- button->userdata = nk_handle_ptr(0);
- button->text_alignment = NK_TEXT_CENTERED;
- button->border = 0.0f;
- button->rounding = 0.0f;
- button->draw_begin = 0;
- button->draw_end = 0;
-
- /* menu button */
- button = &style->menu_button;
- nk_zero_struct(*button);
- button->normal = nk_style_item_color(table[NK_COLOR_WINDOW]);
- button->hover = nk_style_item_color(table[NK_COLOR_WINDOW]);
- button->active = nk_style_item_color(table[NK_COLOR_WINDOW]);
- button->border_color = table[NK_COLOR_WINDOW];
- button->text_background = table[NK_COLOR_WINDOW];
- button->text_normal = table[NK_COLOR_TEXT];
- button->text_hover = table[NK_COLOR_TEXT];
- button->text_active = table[NK_COLOR_TEXT];
- button->padding = nk_vec2(2.0f,2.0f);
- button->touch_padding = nk_vec2(0.0f,0.0f);
- button->userdata = nk_handle_ptr(0);
- button->text_alignment = NK_TEXT_CENTERED;
- button->border = 0.0f;
- button->rounding = 1.0f;
- button->draw_begin = 0;
- button->draw_end = 0;
-
- /* checkbox toggle */
- toggle = &style->checkbox;
- nk_zero_struct(*toggle);
- toggle->normal = nk_style_item_color(table[NK_COLOR_TOGGLE]);
- toggle->hover = nk_style_item_color(table[NK_COLOR_TOGGLE_HOVER]);
- toggle->active = nk_style_item_color(table[NK_COLOR_TOGGLE_HOVER]);
- toggle->cursor_normal = nk_style_item_color(table[NK_COLOR_TOGGLE_CURSOR]);
- toggle->cursor_hover = nk_style_item_color(table[NK_COLOR_TOGGLE_CURSOR]);
- toggle->userdata = nk_handle_ptr(0);
- toggle->text_background = table[NK_COLOR_WINDOW];
- toggle->text_normal = table[NK_COLOR_TEXT];
- toggle->text_hover = table[NK_COLOR_TEXT];
- toggle->text_active = table[NK_COLOR_TEXT];
- toggle->padding = nk_vec2(2.0f, 2.0f);
- toggle->touch_padding = nk_vec2(0,0);
- toggle->border_color = nk_rgba(0,0,0,0);
- toggle->border = 0.0f;
- toggle->spacing = 4;
-
- /* option toggle */
- toggle = &style->option;
- nk_zero_struct(*toggle);
- toggle->normal = nk_style_item_color(table[NK_COLOR_TOGGLE]);
- toggle->hover = nk_style_item_color(table[NK_COLOR_TOGGLE_HOVER]);
- toggle->active = nk_style_item_color(table[NK_COLOR_TOGGLE_HOVER]);
- toggle->cursor_normal = nk_style_item_color(table[NK_COLOR_TOGGLE_CURSOR]);
- toggle->cursor_hover = nk_style_item_color(table[NK_COLOR_TOGGLE_CURSOR]);
- toggle->userdata = nk_handle_ptr(0);
- toggle->text_background = table[NK_COLOR_WINDOW];
- toggle->text_normal = table[NK_COLOR_TEXT];
- toggle->text_hover = table[NK_COLOR_TEXT];
- toggle->text_active = table[NK_COLOR_TEXT];
- toggle->padding = nk_vec2(3.0f, 3.0f);
- toggle->touch_padding = nk_vec2(0,0);
- toggle->border_color = nk_rgba(0,0,0,0);
- toggle->border = 0.0f;
- toggle->spacing = 4;
-
- /* selectable */
- select = &style->selectable;
- nk_zero_struct(*select);
- select->normal = nk_style_item_color(table[NK_COLOR_SELECT]);
- select->hover = nk_style_item_color(table[NK_COLOR_SELECT]);
- select->pressed = nk_style_item_color(table[NK_COLOR_SELECT]);
- select->normal_active = nk_style_item_color(table[NK_COLOR_SELECT_ACTIVE]);
- select->hover_active = nk_style_item_color(table[NK_COLOR_SELECT_ACTIVE]);
- select->pressed_active = nk_style_item_color(table[NK_COLOR_SELECT_ACTIVE]);
- select->text_normal = table[NK_COLOR_TEXT];
- select->text_hover = table[NK_COLOR_TEXT];
- select->text_pressed = table[NK_COLOR_TEXT];
- select->text_normal_active = table[NK_COLOR_TEXT];
- select->text_hover_active = table[NK_COLOR_TEXT];
- select->text_pressed_active = table[NK_COLOR_TEXT];
- select->padding = nk_vec2(2.0f,2.0f);
- select->touch_padding = nk_vec2(0,0);
- select->userdata = nk_handle_ptr(0);
- select->rounding = 0.0f;
- select->draw_begin = 0;
- select->draw_end = 0;
-
- /* slider */
- slider = &style->slider;
- nk_zero_struct(*slider);
- slider->normal = nk_style_item_hide();
- slider->hover = nk_style_item_hide();
- slider->active = nk_style_item_hide();
- slider->bar_normal = table[NK_COLOR_SLIDER];
- slider->bar_hover = table[NK_COLOR_SLIDER];
- slider->bar_active = table[NK_COLOR_SLIDER];
- slider->bar_filled = table[NK_COLOR_SLIDER_CURSOR];
- slider->cursor_normal = nk_style_item_color(table[NK_COLOR_SLIDER_CURSOR]);
- slider->cursor_hover = nk_style_item_color(table[NK_COLOR_SLIDER_CURSOR_HOVER]);
- slider->cursor_active = nk_style_item_color(table[NK_COLOR_SLIDER_CURSOR_ACTIVE]);
- slider->inc_symbol = NK_SYMBOL_TRIANGLE_RIGHT;
- slider->dec_symbol = NK_SYMBOL_TRIANGLE_LEFT;
- slider->cursor_size = nk_vec2(16,16);
- slider->padding = nk_vec2(2,2);
- slider->spacing = nk_vec2(2,2);
- slider->userdata = nk_handle_ptr(0);
- slider->show_buttons = nk_false;
- slider->bar_height = 8;
- slider->rounding = 0;
- slider->draw_begin = 0;
- slider->draw_end = 0;
-
- /* slider buttons */
- button = &style->slider.inc_button;
- button->normal = nk_style_item_color(nk_rgb(40,40,40));
- button->hover = nk_style_item_color(nk_rgb(42,42,42));
- button->active = nk_style_item_color(nk_rgb(44,44,44));
- button->border_color = nk_rgb(65,65,65);
- button->text_background = nk_rgb(40,40,40);
- button->text_normal = nk_rgb(175,175,175);
- button->text_hover = nk_rgb(175,175,175);
- button->text_active = nk_rgb(175,175,175);
- button->padding = nk_vec2(8.0f,8.0f);
- button->touch_padding = nk_vec2(0.0f,0.0f);
- button->userdata = nk_handle_ptr(0);
- button->text_alignment = NK_TEXT_CENTERED;
- button->border = 1.0f;
- button->rounding = 0.0f;
- button->draw_begin = 0;
- button->draw_end = 0;
- style->slider.dec_button = style->slider.inc_button;
-
- /* progressbar */
- prog = &style->progress;
- nk_zero_struct(*prog);
- prog->normal = nk_style_item_color(table[NK_COLOR_SLIDER]);
- prog->hover = nk_style_item_color(table[NK_COLOR_SLIDER]);
- prog->active = nk_style_item_color(table[NK_COLOR_SLIDER]);
- prog->cursor_normal = nk_style_item_color(table[NK_COLOR_SLIDER_CURSOR]);
- prog->cursor_hover = nk_style_item_color(table[NK_COLOR_SLIDER_CURSOR_HOVER]);
- prog->cursor_active = nk_style_item_color(table[NK_COLOR_SLIDER_CURSOR_ACTIVE]);
- prog->border_color = nk_rgba(0,0,0,0);
- prog->cursor_border_color = nk_rgba(0,0,0,0);
- prog->userdata = nk_handle_ptr(0);
- prog->padding = nk_vec2(4,4);
- prog->rounding = 0;
- prog->border = 0;
- prog->cursor_rounding = 0;
- prog->cursor_border = 0;
- prog->draw_begin = 0;
- prog->draw_end = 0;
-
- /* scrollbars */
- scroll = &style->scrollh;
- nk_zero_struct(*scroll);
- scroll->normal = nk_style_item_color(table[NK_COLOR_SCROLLBAR]);
- scroll->hover = nk_style_item_color(table[NK_COLOR_SCROLLBAR]);
- scroll->active = nk_style_item_color(table[NK_COLOR_SCROLLBAR]);
- scroll->cursor_normal = nk_style_item_color(table[NK_COLOR_SCROLLBAR_CURSOR]);
- scroll->cursor_hover = nk_style_item_color(table[NK_COLOR_SCROLLBAR_CURSOR_HOVER]);
- scroll->cursor_active = nk_style_item_color(table[NK_COLOR_SCROLLBAR_CURSOR_ACTIVE]);
- scroll->dec_symbol = NK_SYMBOL_CIRCLE_SOLID;
- scroll->inc_symbol = NK_SYMBOL_CIRCLE_SOLID;
- scroll->userdata = nk_handle_ptr(0);
- scroll->border_color = table[NK_COLOR_SCROLLBAR];
- scroll->cursor_border_color = table[NK_COLOR_SCROLLBAR];
- scroll->padding = nk_vec2(0,0);
- scroll->show_buttons = nk_false;
- scroll->border = 0;
- scroll->rounding = 0;
- scroll->border_cursor = 0;
- scroll->rounding_cursor = 0;
- scroll->draw_begin = 0;
- scroll->draw_end = 0;
- style->scrollv = style->scrollh;
-
- /* scrollbars buttons */
- button = &style->scrollh.inc_button;
- button->normal = nk_style_item_color(nk_rgb(40,40,40));
- button->hover = nk_style_item_color(nk_rgb(42,42,42));
- button->active = nk_style_item_color(nk_rgb(44,44,44));
- button->border_color = nk_rgb(65,65,65);
- button->text_background = nk_rgb(40,40,40);
- button->text_normal = nk_rgb(175,175,175);
- button->text_hover = nk_rgb(175,175,175);
- button->text_active = nk_rgb(175,175,175);
- button->padding = nk_vec2(4.0f,4.0f);
- button->touch_padding = nk_vec2(0.0f,0.0f);
- button->userdata = nk_handle_ptr(0);
- button->text_alignment = NK_TEXT_CENTERED;
- button->border = 1.0f;
- button->rounding = 0.0f;
- button->draw_begin = 0;
- button->draw_end = 0;
- style->scrollh.dec_button = style->scrollh.inc_button;
- style->scrollv.inc_button = style->scrollh.inc_button;
- style->scrollv.dec_button = style->scrollh.inc_button;
-
- /* edit */
- edit = &style->edit;
- nk_zero_struct(*edit);
- edit->normal = nk_style_item_color(table[NK_COLOR_EDIT]);
- edit->hover = nk_style_item_color(table[NK_COLOR_EDIT]);
- edit->active = nk_style_item_color(table[NK_COLOR_EDIT]);
- edit->cursor_normal = table[NK_COLOR_TEXT];
- edit->cursor_hover = table[NK_COLOR_TEXT];
- edit->cursor_text_normal= table[NK_COLOR_EDIT];
- edit->cursor_text_hover = table[NK_COLOR_EDIT];
- edit->border_color = table[NK_COLOR_BORDER];
- edit->text_normal = table[NK_COLOR_TEXT];
- edit->text_hover = table[NK_COLOR_TEXT];
- edit->text_active = table[NK_COLOR_TEXT];
- edit->selected_normal = table[NK_COLOR_TEXT];
- edit->selected_hover = table[NK_COLOR_TEXT];
- edit->selected_text_normal = table[NK_COLOR_EDIT];
- edit->selected_text_hover = table[NK_COLOR_EDIT];
- edit->scrollbar_size = nk_vec2(10,10);
- edit->scrollbar = style->scrollv;
- edit->padding = nk_vec2(4,4);
- edit->row_padding = 2;
- edit->cursor_size = 4;
- edit->border = 1;
- edit->rounding = 0;
-
- /* property */
- property = &style->property;
- nk_zero_struct(*property);
- property->normal = nk_style_item_color(table[NK_COLOR_PROPERTY]);
- property->hover = nk_style_item_color(table[NK_COLOR_PROPERTY]);
- property->active = nk_style_item_color(table[NK_COLOR_PROPERTY]);
- property->border_color = table[NK_COLOR_BORDER];
- property->label_normal = table[NK_COLOR_TEXT];
- property->label_hover = table[NK_COLOR_TEXT];
- property->label_active = table[NK_COLOR_TEXT];
- property->sym_left = NK_SYMBOL_TRIANGLE_LEFT;
- property->sym_right = NK_SYMBOL_TRIANGLE_RIGHT;
- property->userdata = nk_handle_ptr(0);
- property->padding = nk_vec2(4,4);
- property->border = 1;
- property->rounding = 10;
- property->draw_begin = 0;
- property->draw_end = 0;
-
- /* property buttons */
- button = &style->property.dec_button;
- nk_zero_struct(*button);
- button->normal = nk_style_item_color(table[NK_COLOR_PROPERTY]);
- button->hover = nk_style_item_color(table[NK_COLOR_PROPERTY]);
- button->active = nk_style_item_color(table[NK_COLOR_PROPERTY]);
- button->border_color = nk_rgba(0,0,0,0);
- button->text_background = table[NK_COLOR_PROPERTY];
- button->text_normal = table[NK_COLOR_TEXT];
- button->text_hover = table[NK_COLOR_TEXT];
- button->text_active = table[NK_COLOR_TEXT];
- button->padding = nk_vec2(0.0f,0.0f);
- button->touch_padding = nk_vec2(0.0f,0.0f);
- button->userdata = nk_handle_ptr(0);
- button->text_alignment = NK_TEXT_CENTERED;
- button->border = 0.0f;
- button->rounding = 0.0f;
- button->draw_begin = 0;
- button->draw_end = 0;
- style->property.inc_button = style->property.dec_button;
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout)
+ return;
- /* property edit */
- edit = &style->property.edit;
- nk_zero_struct(*edit);
- edit->normal = nk_style_item_color(table[NK_COLOR_PROPERTY]);
- edit->hover = nk_style_item_color(table[NK_COLOR_PROPERTY]);
- edit->active = nk_style_item_color(table[NK_COLOR_PROPERTY]);
- edit->border_color = nk_rgba(0,0,0,0);
- edit->cursor_normal = table[NK_COLOR_TEXT];
- edit->cursor_hover = table[NK_COLOR_TEXT];
- edit->cursor_text_normal= table[NK_COLOR_EDIT];
- edit->cursor_text_hover = table[NK_COLOR_EDIT];
- edit->text_normal = table[NK_COLOR_TEXT];
- edit->text_hover = table[NK_COLOR_TEXT];
- edit->text_active = table[NK_COLOR_TEXT];
- edit->selected_normal = table[NK_COLOR_TEXT];
- edit->selected_hover = table[NK_COLOR_TEXT];
- edit->selected_text_normal = table[NK_COLOR_EDIT];
- edit->selected_text_hover = table[NK_COLOR_EDIT];
- edit->padding = nk_vec2(0,0);
- edit->cursor_size = 8;
- edit->border = 0;
- edit->rounding = 0;
+ win = ctx->current;
+ layout = win->layout;
+ y = layout->at_y;
+ index = layout->row.index;
+ if (layout->row.index >= layout->row.columns) {
+ layout->at_y += layout->row.height;
+ layout->row.index = 0;
+ }
+ nk_layout_widget_space(bounds, ctx, win, nk_false);
+ if (!layout->row.index) {
+ bounds->x -= layout->row.item_offset;
+ }
+ layout->at_y = y;
+ layout->row.index = index;
+}
- /* chart */
- chart = &style->chart;
- nk_zero_struct(*chart);
- chart->background = nk_style_item_color(table[NK_COLOR_CHART]);
- chart->border_color = table[NK_COLOR_BORDER];
- chart->selected_color = table[NK_COLOR_CHART_COLOR_HIGHLIGHT];
- chart->color = table[NK_COLOR_CHART_COLOR];
- chart->padding = nk_vec2(4,4);
- chart->border = 0;
- chart->rounding = 0;
- /* combo */
- combo = &style->combo;
- combo->normal = nk_style_item_color(table[NK_COLOR_COMBO]);
- combo->hover = nk_style_item_color(table[NK_COLOR_COMBO]);
- combo->active = nk_style_item_color(table[NK_COLOR_COMBO]);
- combo->border_color = table[NK_COLOR_BORDER];
- combo->label_normal = table[NK_COLOR_TEXT];
- combo->label_hover = table[NK_COLOR_TEXT];
- combo->label_active = table[NK_COLOR_TEXT];
- combo->sym_normal = NK_SYMBOL_TRIANGLE_DOWN;
- combo->sym_hover = NK_SYMBOL_TRIANGLE_DOWN;
- combo->sym_active = NK_SYMBOL_TRIANGLE_DOWN;
- combo->content_padding = nk_vec2(4,4);
- combo->button_padding = nk_vec2(0,4);
- combo->spacing = nk_vec2(4,0);
- combo->border = 1;
- combo->rounding = 0;
- /* combo button */
- button = &style->combo.button;
- nk_zero_struct(*button);
- button->normal = nk_style_item_color(table[NK_COLOR_COMBO]);
- button->hover = nk_style_item_color(table[NK_COLOR_COMBO]);
- button->active = nk_style_item_color(table[NK_COLOR_COMBO]);
- button->border_color = nk_rgba(0,0,0,0);
- button->text_background = table[NK_COLOR_COMBO];
- button->text_normal = table[NK_COLOR_TEXT];
- button->text_hover = table[NK_COLOR_TEXT];
- button->text_active = table[NK_COLOR_TEXT];
- button->padding = nk_vec2(2.0f,2.0f);
- button->touch_padding = nk_vec2(0.0f,0.0f);
- button->userdata = nk_handle_ptr(0);
- button->text_alignment = NK_TEXT_CENTERED;
- button->border = 0.0f;
- button->rounding = 0.0f;
- button->draw_begin = 0;
- button->draw_end = 0;
- /* tab */
- tab = &style->tab;
- tab->background = nk_style_item_color(table[NK_COLOR_TAB_HEADER]);
- tab->border_color = table[NK_COLOR_BORDER];
- tab->text = table[NK_COLOR_TEXT];
- tab->sym_minimize = NK_SYMBOL_TRIANGLE_RIGHT;
- tab->sym_maximize = NK_SYMBOL_TRIANGLE_DOWN;
- tab->padding = nk_vec2(4,4);
- tab->spacing = nk_vec2(4,4);
- tab->indent = 10.0f;
- tab->border = 1;
- tab->rounding = 0;
- /* tab button */
- button = &style->tab.tab_minimize_button;
- nk_zero_struct(*button);
- button->normal = nk_style_item_color(table[NK_COLOR_TAB_HEADER]);
- button->hover = nk_style_item_color(table[NK_COLOR_TAB_HEADER]);
- button->active = nk_style_item_color(table[NK_COLOR_TAB_HEADER]);
- button->border_color = nk_rgba(0,0,0,0);
- button->text_background = table[NK_COLOR_TAB_HEADER];
- button->text_normal = table[NK_COLOR_TEXT];
- button->text_hover = table[NK_COLOR_TEXT];
- button->text_active = table[NK_COLOR_TEXT];
- button->padding = nk_vec2(2.0f,2.0f);
- button->touch_padding = nk_vec2(0.0f,0.0f);
- button->userdata = nk_handle_ptr(0);
- button->text_alignment = NK_TEXT_CENTERED;
- button->border = 0.0f;
- button->rounding = 0.0f;
- button->draw_begin = 0;
- button->draw_end = 0;
- style->tab.tab_maximize_button =*button;
+/* ===============================================================
+ *
+ * TREE
+ *
+ * ===============================================================*/
+NK_INTERN int
+nk_tree_state_base(struct nk_context *ctx, enum nk_tree_type type,
+ struct nk_image *img, const char *title, enum nk_collapse_states *state)
+{
+ struct nk_window *win;
+ struct nk_panel *layout;
+ const struct nk_style *style;
+ struct nk_command_buffer *out;
+ const struct nk_input *in;
+ const struct nk_style_button *button;
+ enum nk_symbol_type symbol;
+ float row_height;
- /* node button */
- button = &style->tab.node_minimize_button;
- nk_zero_struct(*button);
- button->normal = nk_style_item_color(table[NK_COLOR_WINDOW]);
- button->hover = nk_style_item_color(table[NK_COLOR_WINDOW]);
- button->active = nk_style_item_color(table[NK_COLOR_WINDOW]);
- button->border_color = nk_rgba(0,0,0,0);
- button->text_background = table[NK_COLOR_TAB_HEADER];
- button->text_normal = table[NK_COLOR_TEXT];
- button->text_hover = table[NK_COLOR_TEXT];
- button->text_active = table[NK_COLOR_TEXT];
- button->padding = nk_vec2(2.0f,2.0f);
- button->touch_padding = nk_vec2(0.0f,0.0f);
- button->userdata = nk_handle_ptr(0);
- button->text_alignment = NK_TEXT_CENTERED;
- button->border = 0.0f;
- button->rounding = 0.0f;
- button->draw_begin = 0;
- button->draw_end = 0;
- style->tab.node_maximize_button =*button;
+ struct nk_vec2 item_spacing;
+ struct nk_rect header = {0,0,0,0};
+ struct nk_rect sym = {0,0,0,0};
+ struct nk_text text;
- /* window header */
- win = &style->window;
- win->header.align = NK_HEADER_RIGHT;
- win->header.close_symbol = NK_SYMBOL_X;
- win->header.minimize_symbol = NK_SYMBOL_MINUS;
- win->header.maximize_symbol = NK_SYMBOL_PLUS;
- win->header.normal = nk_style_item_color(table[NK_COLOR_HEADER]);
- win->header.hover = nk_style_item_color(table[NK_COLOR_HEADER]);
- win->header.active = nk_style_item_color(table[NK_COLOR_HEADER]);
- win->header.label_normal = table[NK_COLOR_TEXT];
- win->header.label_hover = table[NK_COLOR_TEXT];
- win->header.label_active = table[NK_COLOR_TEXT];
- win->header.label_padding = nk_vec2(4,4);
- win->header.padding = nk_vec2(4,4);
- win->header.spacing = nk_vec2(0,0);
+ nk_flags ws = 0;
+ enum nk_widget_layout_states widget_state;
- /* window header close button */
- button = &style->window.header.close_button;
- nk_zero_struct(*button);
- button->normal = nk_style_item_color(table[NK_COLOR_HEADER]);
- button->hover = nk_style_item_color(table[NK_COLOR_HEADER]);
- button->active = nk_style_item_color(table[NK_COLOR_HEADER]);
- button->border_color = nk_rgba(0,0,0,0);
- button->text_background = table[NK_COLOR_HEADER];
- button->text_normal = table[NK_COLOR_TEXT];
- button->text_hover = table[NK_COLOR_TEXT];
- button->text_active = table[NK_COLOR_TEXT];
- button->padding = nk_vec2(0.0f,0.0f);
- button->touch_padding = nk_vec2(0.0f,0.0f);
- button->userdata = nk_handle_ptr(0);
- button->text_alignment = NK_TEXT_CENTERED;
- button->border = 0.0f;
- button->rounding = 0.0f;
- button->draw_begin = 0;
- button->draw_end = 0;
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout)
+ return 0;
- /* window header minimize button */
- button = &style->window.header.minimize_button;
- nk_zero_struct(*button);
- button->normal = nk_style_item_color(table[NK_COLOR_HEADER]);
- button->hover = nk_style_item_color(table[NK_COLOR_HEADER]);
- button->active = nk_style_item_color(table[NK_COLOR_HEADER]);
- button->border_color = nk_rgba(0,0,0,0);
- button->text_background = table[NK_COLOR_HEADER];
- button->text_normal = table[NK_COLOR_TEXT];
- button->text_hover = table[NK_COLOR_TEXT];
- button->text_active = table[NK_COLOR_TEXT];
- button->padding = nk_vec2(0.0f,0.0f);
- button->touch_padding = nk_vec2(0.0f,0.0f);
- button->userdata = nk_handle_ptr(0);
- button->text_alignment = NK_TEXT_CENTERED;
- button->border = 0.0f;
- button->rounding = 0.0f;
- button->draw_begin = 0;
- button->draw_end = 0;
+ /* cache some data */
+ win = ctx->current;
+ layout = win->layout;
+ out = &win->buffer;
+ style = &ctx->style;
+ item_spacing = style->window.spacing;
- /* window */
- win->background = table[NK_COLOR_WINDOW];
- win->fixed_background = nk_style_item_color(table[NK_COLOR_WINDOW]);
- win->border_color = table[NK_COLOR_BORDER];
- win->popup_border_color = table[NK_COLOR_BORDER];
- win->combo_border_color = table[NK_COLOR_BORDER];
- win->contextual_border_color = table[NK_COLOR_BORDER];
- win->menu_border_color = table[NK_COLOR_BORDER];
- win->group_border_color = table[NK_COLOR_BORDER];
- win->tooltip_border_color = table[NK_COLOR_BORDER];
- win->scaler = nk_style_item_color(table[NK_COLOR_TEXT]);
+ /* calculate header bounds and draw background */
+ row_height = style->font->height + 2 * style->tab.padding.y;
+ nk_layout_set_min_row_height(ctx, row_height);
+ nk_layout_row_dynamic(ctx, row_height, 1);
+ nk_layout_reset_min_row_height(ctx);
- win->rounding = 0.0f;
- win->spacing = nk_vec2(4,4);
- win->scrollbar_size = nk_vec2(10,10);
- win->min_size = nk_vec2(64,64);
+ widget_state = nk_widget(&header, ctx);
+ if (type == NK_TREE_TAB) {
+ const struct nk_style_item *background = &style->tab.background;
+ if (background->type == NK_STYLE_ITEM_IMAGE) {
+ nk_draw_image(out, header, &background->data.image, nk_white);
+ text.background = nk_rgba(0,0,0,0);
+ } else {
+ text.background = background->data.color;
+ nk_fill_rect(out, header, 0, style->tab.border_color);
+ nk_fill_rect(out, nk_shrink_rect(header, style->tab.border),
+ style->tab.rounding, background->data.color);
+ }
+ } else text.background = style->window.background;
- win->combo_border = 1.0f;
- win->contextual_border = 1.0f;
- win->menu_border = 1.0f;
- win->group_border = 1.0f;
- win->tooltip_border = 1.0f;
- win->popup_border = 1.0f;
- win->border = 2.0f;
- win->min_row_height_padding = 8;
+ /* update node state */
+ in = (!(layout->flags & NK_WINDOW_ROM)) ? &ctx->input: 0;
+ in = (in && widget_state == NK_WIDGET_VALID) ? &ctx->input : 0;
+ if (nk_button_behavior(&ws, header, in, NK_BUTTON_DEFAULT))
+ *state = (*state == NK_MAXIMIZED) ? NK_MINIMIZED : NK_MAXIMIZED;
+
+ /* select correct button style */
+ if (*state == NK_MAXIMIZED) {
+ symbol = style->tab.sym_maximize;
+ if (type == NK_TREE_TAB)
+ button = &style->tab.tab_maximize_button;
+ else button = &style->tab.node_maximize_button;
+ } else {
+ symbol = style->tab.sym_minimize;
+ if (type == NK_TREE_TAB)
+ button = &style->tab.tab_minimize_button;
+ else button = &style->tab.node_minimize_button;
+ }
+
+ {/* draw triangle button */
+ sym.w = sym.h = style->font->height;
+ sym.y = header.y + style->tab.padding.y;
+ sym.x = header.x + style->tab.padding.x;
+ nk_do_button_symbol(&ws, &win->buffer, sym, symbol, NK_BUTTON_DEFAULT,
+ button, 0, style->font);
+
+ if (img) {
+ /* draw optional image icon */
+ sym.x = sym.x + sym.w + 4 * item_spacing.x;
+ nk_draw_image(&win->buffer, sym, img, nk_white);
+ sym.w = style->font->height + style->tab.spacing.x;}
+ }
- win->padding = nk_vec2(4,4);
- win->group_padding = nk_vec2(4,4);
- win->popup_padding = nk_vec2(4,4);
- win->combo_padding = nk_vec2(4,4);
- win->contextual_padding = nk_vec2(4,4);
- win->menu_padding = nk_vec2(4,4);
- win->tooltip_padding = nk_vec2(4,4);
-}
+ {/* draw label */
+ struct nk_rect label;
+ header.w = NK_MAX(header.w, sym.w + item_spacing.x);
+ label.x = sym.x + sym.w + item_spacing.x;
+ label.y = sym.y;
+ label.w = header.w - (sym.w + item_spacing.y + style->tab.indent);
+ label.h = style->font->height;
+ text.text = style->tab.text;
+ text.padding = nk_vec2(0,0);
+ nk_widget_text(out, label, title, nk_strlen(title), &text,
+ NK_TEXT_LEFT, style->font);}
-NK_API void
-nk_style_set_font(struct nk_context *ctx, const struct nk_user_font *font)
+ /* increase x-axis cursor widget position pointer */
+ if (*state == NK_MAXIMIZED) {
+ layout->at_x = header.x + (float)*layout->offset_x + style->tab.indent;
+ layout->bounds.w = NK_MAX(layout->bounds.w, style->tab.indent);
+ layout->bounds.w -= (style->tab.indent + style->window.padding.x);
+ layout->row.tree_depth++;
+ return nk_true;
+ } else return nk_false;
+}
+NK_INTERN int
+nk_tree_base(struct nk_context *ctx, enum nk_tree_type type,
+ struct nk_image *img, const char *title, enum nk_collapse_states initial_state,
+ const char *hash, int len, int line)
{
- struct nk_style *style;
- NK_ASSERT(ctx);
+ struct nk_window *win = ctx->current;
+ int title_len = 0;
+ nk_hash tree_hash = 0;
+ nk_uint *state = 0;
- if (!ctx) return;
- style = &ctx->style;
- style->font = font;
- ctx->stacks.fonts.head = 0;
- if (ctx->current)
- nk_layout_reset_min_row_height(ctx);
+ /* retrieve tree state from internal widget state tables */
+ if (!hash) {
+ title_len = (int)nk_strlen(title);
+ tree_hash = nk_murmur_hash(title, (int)title_len, (nk_hash)line);
+ } else tree_hash = nk_murmur_hash(hash, len, (nk_hash)line);
+ state = nk_find_value(win, tree_hash);
+ if (!state) {
+ state = nk_add_value(ctx, win, tree_hash, 0);
+ *state = initial_state;
+ }
+ return nk_tree_state_base(ctx, type, img, title, (enum nk_collapse_states*)state);
}
-
NK_API int
-nk_style_push_font(struct nk_context *ctx, const struct nk_user_font *font)
+nk_tree_state_push(struct nk_context *ctx, enum nk_tree_type type,
+ const char *title, enum nk_collapse_states *state)
{
- struct nk_config_stack_user_font *font_stack;
- struct nk_config_stack_user_font_element *element;
+ return nk_tree_state_base(ctx, type, 0, title, state);
+}
+NK_API int
+nk_tree_state_image_push(struct nk_context *ctx, enum nk_tree_type type,
+ struct nk_image img, const char *title, enum nk_collapse_states *state)
+{
+ return nk_tree_state_base(ctx, type, &img, title, state);
+}
+NK_API void
+nk_tree_state_pop(struct nk_context *ctx)
+{
+ struct nk_window *win = 0;
+ struct nk_panel *layout = 0;
NK_ASSERT(ctx);
- if (!ctx) return 0;
-
- font_stack = &ctx->stacks.fonts;
- NK_ASSERT(font_stack->head < (int)NK_LEN(font_stack->elements));
- if (font_stack->head >= (int)NK_LEN(font_stack->elements))
- return 0;
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout)
+ return;
- element = &font_stack->elements[font_stack->head++];
- element->address = &ctx->style.font;
- element->old_value = ctx->style.font;
- ctx->style.font = font;
- return 1;
+ win = ctx->current;
+ layout = win->layout;
+ layout->at_x -= ctx->style.tab.indent + ctx->style.window.padding.x;
+ layout->bounds.w += ctx->style.tab.indent + ctx->style.window.padding.x;
+ NK_ASSERT(layout->row.tree_depth);
+ layout->row.tree_depth--;
}
-
NK_API int
-nk_style_pop_font(struct nk_context *ctx)
+nk_tree_push_hashed(struct nk_context *ctx, enum nk_tree_type type,
+ const char *title, enum nk_collapse_states initial_state,
+ const char *hash, int len, int line)
{
- struct nk_config_stack_user_font *font_stack;
- struct nk_config_stack_user_font_element *element;
+ return nk_tree_base(ctx, type, 0, title, initial_state, hash, len, line);
+}
+NK_API int
+nk_tree_image_push_hashed(struct nk_context *ctx, enum nk_tree_type type,
+ struct nk_image img, const char *title, enum nk_collapse_states initial_state,
+ const char *hash, int len,int seed)
+{
+ return nk_tree_base(ctx, type, &img, title, initial_state, hash, len, seed);
+}
+NK_API void
+nk_tree_pop(struct nk_context *ctx)
+{
+ nk_tree_state_pop(ctx);
+}
+NK_INTERN int
+nk_tree_element_image_push_hashed_base(struct nk_context *ctx, enum nk_tree_type type,
+ struct nk_image *img, const char *title, int title_len,
+ enum nk_collapse_states *state, int *selected)
+{
+ struct nk_window *win;
+ struct nk_panel *layout;
+ const struct nk_style *style;
+ struct nk_command_buffer *out;
+ const struct nk_input *in;
+ const struct nk_style_button *button;
+ enum nk_symbol_type symbol;
+ float row_height;
+ struct nk_vec2 padding;
- NK_ASSERT(ctx);
- if (!ctx) return 0;
+ int text_len;
+ float text_width;
- font_stack = &ctx->stacks.fonts;
- NK_ASSERT(font_stack->head > 0);
- if (font_stack->head < 1)
+ struct nk_vec2 item_spacing;
+ struct nk_rect header = {0,0,0,0};
+ struct nk_rect sym = {0,0,0,0};
+ struct nk_text text;
+
+ nk_flags ws = 0;
+ enum nk_widget_layout_states widget_state;
+
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout)
return 0;
- element = &font_stack->elements[--font_stack->head];
- *element->address = element->old_value;
- return 1;
-}
+ /* cache some data */
+ win = ctx->current;
+ layout = win->layout;
+ out = &win->buffer;
+ style = &ctx->style;
+ item_spacing = style->window.spacing;
+ padding = style->selectable.padding;
-#define NK_STYLE_PUSH_IMPLEMENATION(prefix, type, stack) \
-nk_style_push_##type(struct nk_context *ctx, prefix##_##type *address, prefix##_##type value)\
-{\
- struct nk_config_stack_##type * type_stack;\
- struct nk_config_stack_##type##_element *element;\
- NK_ASSERT(ctx);\
- if (!ctx) return 0;\
- type_stack = &ctx->stacks.stack;\
- NK_ASSERT(type_stack->head < (int)NK_LEN(type_stack->elements));\
- if (type_stack->head >= (int)NK_LEN(type_stack->elements))\
- return 0;\
- element = &type_stack->elements[type_stack->head++];\
- element->address = address;\
- element->old_value = *address;\
- *address = value;\
- return 1;\
-}
+ /* calculate header bounds and draw background */
+ row_height = style->font->height + 2 * style->tab.padding.y;
+ nk_layout_set_min_row_height(ctx, row_height);
+ nk_layout_row_dynamic(ctx, row_height, 1);
+ nk_layout_reset_min_row_height(ctx);
-#define NK_STYLE_POP_IMPLEMENATION(type, stack) \
-nk_style_pop_##type(struct nk_context *ctx)\
-{\
- struct nk_config_stack_##type *type_stack;\
- struct nk_config_stack_##type##_element *element;\
- NK_ASSERT(ctx);\
- if (!ctx) return 0;\
- type_stack = &ctx->stacks.stack;\
- NK_ASSERT(type_stack->head > 0);\
- if (type_stack->head < 1)\
- return 0;\
- element = &type_stack->elements[--type_stack->head];\
- *element->address = element->old_value;\
- return 1;\
-}
+ widget_state = nk_widget(&header, ctx);
+ if (type == NK_TREE_TAB) {
+ const struct nk_style_item *background = &style->tab.background;
+ if (background->type == NK_STYLE_ITEM_IMAGE) {
+ nk_draw_image(out, header, &background->data.image, nk_white);
+ text.background = nk_rgba(0,0,0,0);
+ } else {
+ text.background = background->data.color;
+ nk_fill_rect(out, header, 0, style->tab.border_color);
+ nk_fill_rect(out, nk_shrink_rect(header, style->tab.border),
+ style->tab.rounding, background->data.color);
+ }
+ } else text.background = style->window.background;
-NK_API int NK_STYLE_PUSH_IMPLEMENATION(struct nk, style_item, style_items)
-NK_API int NK_STYLE_PUSH_IMPLEMENATION(nk,float, floats)
-NK_API int NK_STYLE_PUSH_IMPLEMENATION(struct nk, vec2, vectors)
-NK_API int NK_STYLE_PUSH_IMPLEMENATION(nk,flags, flags)
-NK_API int NK_STYLE_PUSH_IMPLEMENATION(struct nk,color, colors)
+ in = (!(layout->flags & NK_WINDOW_ROM)) ? &ctx->input: 0;
+ in = (in && widget_state == NK_WIDGET_VALID) ? &ctx->input : 0;
-NK_API int NK_STYLE_POP_IMPLEMENATION(style_item, style_items)
-NK_API int NK_STYLE_POP_IMPLEMENATION(float,floats)
-NK_API int NK_STYLE_POP_IMPLEMENATION(vec2, vectors)
-NK_API int NK_STYLE_POP_IMPLEMENATION(flags,flags)
-NK_API int NK_STYLE_POP_IMPLEMENATION(color,colors)
+ /* select correct button style */
+ if (*state == NK_MAXIMIZED) {
+ symbol = style->tab.sym_maximize;
+ if (type == NK_TREE_TAB)
+ button = &style->tab.tab_maximize_button;
+ else button = &style->tab.node_maximize_button;
+ } else {
+ symbol = style->tab.sym_minimize;
+ if (type == NK_TREE_TAB)
+ button = &style->tab.tab_minimize_button;
+ else button = &style->tab.node_minimize_button;
+ }
+ {/* draw triangle button */
+ sym.w = sym.h = style->font->height;
+ sym.y = header.y + style->tab.padding.y;
+ sym.x = header.x + style->tab.padding.x;
+ if (nk_do_button_symbol(&ws, &win->buffer, sym, symbol, NK_BUTTON_DEFAULT, button, in, style->font))
+ *state = (*state == NK_MAXIMIZED) ? NK_MINIMIZED : NK_MAXIMIZED;}
+
+ /* draw label */
+ {nk_flags dummy = 0;
+ struct nk_rect label;
+ /* calculate size of the text and tooltip */
+ text_len = nk_strlen(title);
+ text_width = style->font->width(style->font->userdata, style->font->height, title, text_len);
+ text_width += (4 * padding.x);
+
+ header.w = NK_MAX(header.w, sym.w + item_spacing.x);
+ label.x = sym.x + sym.w + item_spacing.x;
+ label.y = sym.y;
+ label.w = NK_MIN(header.w - (sym.w + item_spacing.y + style->tab.indent), text_width);
+ label.h = style->font->height;
+
+ if (img) {
+ nk_do_selectable_image(&dummy, &win->buffer, label, title, title_len, NK_TEXT_LEFT,
+ selected, img, &style->selectable, in, style->font);
+ } else nk_do_selectable(&dummy, &win->buffer, label, title, title_len, NK_TEXT_LEFT,
+ selected, &style->selectable, in, style->font);
+ }
+ /* increase x-axis cursor widget position pointer */
+ if (*state == NK_MAXIMIZED) {
+ layout->at_x = header.x + (float)*layout->offset_x + style->tab.indent;
+ layout->bounds.w = NK_MAX(layout->bounds.w, style->tab.indent);
+ layout->bounds.w -= (style->tab.indent + style->window.padding.x);
+ layout->row.tree_depth++;
+ return nk_true;
+ } else return nk_false;
+}
+NK_INTERN int
+nk_tree_element_base(struct nk_context *ctx, enum nk_tree_type type,
+ struct nk_image *img, const char *title, enum nk_collapse_states initial_state,
+ int *selected, const char *hash, int len, int line)
+{
+ struct nk_window *win = ctx->current;
+ int title_len = 0;
+ nk_hash tree_hash = 0;
+ nk_uint *state = 0;
+ /* retrieve tree state from internal widget state tables */
+ if (!hash) {
+ title_len = (int)nk_strlen(title);
+ tree_hash = nk_murmur_hash(title, (int)title_len, (nk_hash)line);
+ } else tree_hash = nk_murmur_hash(hash, len, (nk_hash)line);
+ state = nk_find_value(win, tree_hash);
+ if (!state) {
+ state = nk_add_value(ctx, win, tree_hash, 0);
+ *state = initial_state;
+ } return nk_tree_element_image_push_hashed_base(ctx, type, img, title,
+ nk_strlen(title), (enum nk_collapse_states*)state, selected);
+}
NK_API int
-nk_style_set_cursor(struct nk_context *ctx, enum nk_style_cursor c)
+nk_tree_element_push_hashed(struct nk_context *ctx, enum nk_tree_type type,
+ const char *title, enum nk_collapse_states initial_state,
+ int *selected, const char *hash, int len, int seed)
{
- struct nk_style *style;
- NK_ASSERT(ctx);
- if (!ctx) return 0;
- style = &ctx->style;
- if (style->cursors[c]) {
- style->cursor_active = style->cursors[c];
- return 1;
- }
- return 0;
+ return nk_tree_element_base(ctx, type, 0, title, initial_state, selected, hash, len, seed);
}
-
-NK_API void
-nk_style_show_cursor(struct nk_context *ctx)
+NK_API int
+nk_tree_element_image_push_hashed(struct nk_context *ctx, enum nk_tree_type type,
+ struct nk_image img, const char *title, enum nk_collapse_states initial_state,
+ int *selected, const char *hash, int len,int seed)
{
- ctx->style.cursor_visible = nk_true;
+ return nk_tree_element_base(ctx, type, &img, title, initial_state, selected, hash, len, seed);
}
-
NK_API void
-nk_style_hide_cursor(struct nk_context *ctx)
+nk_tree_element_pop(struct nk_context *ctx)
{
- ctx->style.cursor_visible = nk_false;
+ nk_tree_state_pop(ctx);
}
-NK_API void
-nk_style_load_cursor(struct nk_context *ctx, enum nk_style_cursor cursor,
- const struct nk_cursor *c)
-{
- struct nk_style *style;
- NK_ASSERT(ctx);
- if (!ctx) return;
- style = &ctx->style;
- style->cursors[cursor] = c;
-}
-NK_API void
-nk_style_load_all_cursors(struct nk_context *ctx, struct nk_cursor *cursors)
-{
- int i = 0;
- struct nk_style *style;
- NK_ASSERT(ctx);
- if (!ctx) return;
- style = &ctx->style;
- for (i = 0; i < NK_CURSOR_COUNT; ++i)
- style->cursors[i] = &cursors[i];
- style->cursor_visible = nk_true;
-}
+
+
/* ===============================================================
*
- * POOL
+ * GROUP
*
* ===============================================================*/
-NK_INTERN void
-nk_pool_init(struct nk_pool *pool, struct nk_allocator *alloc,
- unsigned int capacity)
+NK_API int
+nk_group_scrolled_offset_begin(struct nk_context *ctx,
+ nk_uint *x_offset, nk_uint *y_offset, const char *title, nk_flags flags)
{
- nk_zero(pool, sizeof(*pool));
- pool->alloc = *alloc;
- pool->capacity = capacity;
- pool->type = NK_BUFFER_DYNAMIC;
- pool->pages = 0;
-}
+ struct nk_rect bounds;
+ struct nk_window panel;
+ struct nk_window *win;
-NK_INTERN void
-nk_pool_free(struct nk_pool *pool)
-{
- struct nk_page *iter = pool->pages;
- if (!pool) return;
- if (pool->type == NK_BUFFER_FIXED) return;
- while (iter) {
- struct nk_page *next = iter->next;
- pool->alloc.free(pool->alloc.userdata, iter);
- iter = next;
- }
-}
+ win = ctx->current;
+ nk_panel_alloc_space(&bounds, ctx);
+ {const struct nk_rect *c = &win->layout->clip;
+ if (!NK_INTERSECT(c->x, c->y, c->w, c->h, bounds.x, bounds.y, bounds.w, bounds.h) &&
+ !(flags & NK_WINDOW_MOVABLE)) {
+ return 0;
+ }}
+ if (win->flags & NK_WINDOW_ROM)
+ flags |= NK_WINDOW_ROM;
-NK_INTERN void
-nk_pool_init_fixed(struct nk_pool *pool, void *memory, nk_size size)
-{
- nk_zero(pool, sizeof(*pool));
- NK_ASSERT(size >= sizeof(struct nk_page));
- if (size < sizeof(struct nk_page)) return;
- pool->capacity = (unsigned)(size - sizeof(struct nk_page)) / sizeof(struct nk_page_element);
- pool->pages = (struct nk_page*)memory;
- pool->type = NK_BUFFER_FIXED;
- pool->size = size;
-}
+ /* initialize a fake window to create the panel from */
+ nk_zero(&panel, sizeof(panel));
+ panel.bounds = bounds;
+ panel.flags = flags;
+ panel.scrollbar.x = *x_offset;
+ panel.scrollbar.y = *y_offset;
+ panel.buffer = win->buffer;
+ panel.layout = (struct nk_panel*)nk_create_panel(ctx);
+ ctx->current = &panel;
+ nk_panel_begin(ctx, (flags & NK_WINDOW_TITLE) ? title: 0, NK_PANEL_GROUP);
-NK_INTERN struct nk_page_element*
-nk_pool_alloc(struct nk_pool *pool)
-{
- if (!pool->pages || pool->pages->size >= pool->capacity) {
- /* allocate new page */
- struct nk_page *page;
- if (pool->type == NK_BUFFER_FIXED) {
- if (!pool->pages) {
- NK_ASSERT(pool->pages);
- return 0;
- }
- NK_ASSERT(pool->pages->size < pool->capacity);
- return 0;
- } else {
- nk_size size = sizeof(struct nk_page);
- size += NK_POOL_DEFAULT_CAPACITY * sizeof(union nk_page_data);
- page = (struct nk_page*)pool->alloc.alloc(pool->alloc.userdata,0, size);
- page->next = pool->pages;
- pool->pages = page;
- page->size = 0;
- }
+ win->buffer = panel.buffer;
+ win->buffer.clip = panel.layout->clip;
+ panel.layout->offset_x = x_offset;
+ panel.layout->offset_y = y_offset;
+ panel.layout->parent = win->layout;
+ win->layout = panel.layout;
+
+ ctx->current = win;
+ if ((panel.layout->flags & NK_WINDOW_CLOSED) ||
+ (panel.layout->flags & NK_WINDOW_MINIMIZED))
+ {
+ nk_flags f = panel.layout->flags;
+ nk_group_scrolled_end(ctx);
+ if (f & NK_WINDOW_CLOSED)
+ return NK_WINDOW_CLOSED;
+ if (f & NK_WINDOW_MINIMIZED)
+ return NK_WINDOW_MINIMIZED;
}
- return &pool->pages->win[pool->pages->size++];
+ return 1;
}
+NK_API void
+nk_group_scrolled_end(struct nk_context *ctx)
+{
+ struct nk_window *win;
+ struct nk_panel *parent;
+ struct nk_panel *g;
-/* ===============================================================
- *
- * CONTEXT
- *
- * ===============================================================*/
-NK_INTERN void* nk_create_window(struct nk_context *ctx);
-NK_INTERN void nk_remove_window(struct nk_context*, struct nk_window*);
-NK_INTERN void nk_free_window(struct nk_context *ctx, struct nk_window *win);
-NK_INTERN void nk_free_table(struct nk_context *ctx, struct nk_table *tbl);
-NK_INTERN void nk_remove_table(struct nk_window *win, struct nk_table *tbl);
-NK_INTERN void* nk_create_panel(struct nk_context *ctx);
-NK_INTERN void nk_free_panel(struct nk_context*, struct nk_panel *pan);
+ struct nk_rect clip;
+ struct nk_window pan;
+ struct nk_vec2 panel_padding;
-NK_INTERN void
-nk_setup(struct nk_context *ctx, const struct nk_user_font *font)
-{
NK_ASSERT(ctx);
- if (!ctx) return;
- nk_zero_struct(*ctx);
- nk_style_default(ctx);
- ctx->seq = 1;
- if (font) ctx->style.font = font;
-#ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT
- nk_draw_list_init(&ctx->draw_list);
-#endif
-}
+ NK_ASSERT(ctx->current);
+ if (!ctx || !ctx->current)
+ return;
-#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
+ /* make sure nk_group_begin was called correctly */
+ NK_ASSERT(ctx->current);
+ win = ctx->current;
+ NK_ASSERT(win->layout);
+ g = win->layout;
+ NK_ASSERT(g->parent);
+ parent = g->parent;
+
+ /* dummy window */
+ nk_zero_struct(pan);
+ panel_padding = nk_panel_get_padding(&ctx->style, NK_PANEL_GROUP);
+ pan.bounds.y = g->bounds.y - (g->header_height + g->menu.h);
+ pan.bounds.x = g->bounds.x - panel_padding.x;
+ pan.bounds.w = g->bounds.w + 2 * panel_padding.x;
+ pan.bounds.h = g->bounds.h + g->header_height + g->menu.h;
+ if (g->flags & NK_WINDOW_BORDER) {
+ pan.bounds.x -= g->border;
+ pan.bounds.y -= g->border;
+ pan.bounds.w += 2*g->border;
+ pan.bounds.h += 2*g->border;
+ }
+ if (!(g->flags & NK_WINDOW_NO_SCROLLBAR)) {
+ pan.bounds.w += ctx->style.window.scrollbar_size.x;
+ pan.bounds.h += ctx->style.window.scrollbar_size.y;
+ }
+ pan.scrollbar.x = *g->offset_x;
+ pan.scrollbar.y = *g->offset_y;
+ pan.flags = g->flags;
+ pan.buffer = win->buffer;
+ pan.layout = g;
+ pan.parent = win;
+ ctx->current = &pan;
+
+ /* make sure group has correct clipping rectangle */
+ nk_unify(&clip, &parent->clip, pan.bounds.x, pan.bounds.y,
+ pan.bounds.x + pan.bounds.w, pan.bounds.y + pan.bounds.h + panel_padding.x);
+ nk_push_scissor(&pan.buffer, clip);
+ nk_end(ctx);
+
+ win->buffer = pan.buffer;
+ nk_push_scissor(&win->buffer, parent->clip);
+ ctx->current = win;
+ win->layout = parent;
+ g->bounds = pan.bounds;
+ return;
+}
NK_API int
-nk_init_default(struct nk_context *ctx, const struct nk_user_font *font)
+nk_group_scrolled_begin(struct nk_context *ctx,
+ struct nk_scroll *scroll, const char *title, nk_flags flags)
{
- struct nk_allocator alloc;
- alloc.userdata.ptr = 0;
- alloc.alloc = nk_malloc;
- alloc.free = nk_mfree;
- return nk_init(ctx, &alloc, font);
+ return nk_group_scrolled_offset_begin(ctx, &scroll->x, &scroll->y, title, flags);
}
-#endif
-
NK_API int
-nk_init_fixed(struct nk_context *ctx, void *memory, nk_size size,
- const struct nk_user_font *font)
+nk_group_begin_titled(struct nk_context *ctx, const char *id,
+ const char *title, nk_flags flags)
{
- NK_ASSERT(memory);
- if (!memory) return 0;
- nk_setup(ctx, font);
- nk_buffer_init_fixed(&ctx->memory, memory, size);
- ctx->use_pool = nk_false;
- return 1;
-}
+ int id_len;
+ nk_hash id_hash;
+ struct nk_window *win;
+ nk_uint *x_offset;
+ nk_uint *y_offset;
+
+ NK_ASSERT(ctx);
+ NK_ASSERT(id);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout || !id)
+ return 0;
-NK_API int
-nk_init_custom(struct nk_context *ctx, struct nk_buffer *cmds,
- struct nk_buffer *pool, const struct nk_user_font *font)
-{
- NK_ASSERT(cmds);
- NK_ASSERT(pool);
- if (!cmds || !pool) return 0;
+ /* find persistent group scrollbar value */
+ win = ctx->current;
+ id_len = (int)nk_strlen(id);
+ id_hash = nk_murmur_hash(id, (int)id_len, NK_PANEL_GROUP);
+ x_offset = nk_find_value(win, id_hash);
+ if (!x_offset) {
+ x_offset = nk_add_value(ctx, win, id_hash, 0);
+ y_offset = nk_add_value(ctx, win, id_hash+1, 0);
- nk_setup(ctx, font);
- ctx->memory = *cmds;
- if (pool->type == NK_BUFFER_FIXED) {
- /* take memory from buffer and alloc fixed pool */
- nk_pool_init_fixed(&ctx->pool, pool->memory.ptr, pool->memory.size);
- } else {
- /* create dynamic pool from buffer allocator */
- struct nk_allocator *alloc = &pool->pool;
- nk_pool_init(&ctx->pool, alloc, NK_POOL_DEFAULT_CAPACITY);
- }
- ctx->use_pool = nk_true;
- return 1;
+ NK_ASSERT(x_offset);
+ NK_ASSERT(y_offset);
+ if (!x_offset || !y_offset) return 0;
+ *x_offset = *y_offset = 0;
+ } else y_offset = nk_find_value(win, id_hash+1);
+ return nk_group_scrolled_offset_begin(ctx, x_offset, y_offset, title, flags);
}
-
NK_API int
-nk_init(struct nk_context *ctx, struct nk_allocator *alloc,
- const struct nk_user_font *font)
+nk_group_begin(struct nk_context *ctx, const char *title, nk_flags flags)
{
- NK_ASSERT(alloc);
- if (!alloc) return 0;
- nk_setup(ctx, font);
- nk_buffer_init(&ctx->memory, alloc, NK_DEFAULT_COMMAND_BUFFER_SIZE);
- nk_pool_init(&ctx->pool, alloc, NK_POOL_DEFAULT_CAPACITY);
- ctx->use_pool = nk_true;
- return 1;
+ return nk_group_begin_titled(ctx, title, title, flags);
}
-
-#ifdef NK_INCLUDE_COMMAND_USERDATA
NK_API void
-nk_set_user_data(struct nk_context *ctx, nk_handle handle)
+nk_group_end(struct nk_context *ctx)
{
- if (!ctx) return;
- ctx->userdata = handle;
- if (ctx->current)
- ctx->current->buffer.userdata = handle;
+ nk_group_scrolled_end(ctx);
}
-#endif
-
NK_API void
-nk_free(struct nk_context *ctx)
+nk_group_get_scroll(struct nk_context *ctx, const char *id, nk_uint *x_offset, nk_uint *y_offset)
{
- NK_ASSERT(ctx);
- if (!ctx) return;
- nk_buffer_free(&ctx->memory);
- if (ctx->use_pool)
- nk_pool_free(&ctx->pool);
+ int id_len;
+ nk_hash id_hash;
+ struct nk_window *win;
+ nk_uint *x_offset_ptr;
+ nk_uint *y_offset_ptr;
- nk_zero(&ctx->input, sizeof(ctx->input));
- nk_zero(&ctx->style, sizeof(ctx->style));
- nk_zero(&ctx->memory, sizeof(ctx->memory));
+ NK_ASSERT(ctx);
+ NK_ASSERT(id);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout || !id)
+ return;
- ctx->seq = 0;
- ctx->build = 0;
- ctx->begin = 0;
- ctx->end = 0;
- ctx->active = 0;
- ctx->current = 0;
- ctx->freelist = 0;
- ctx->count = 0;
+ /* find persistent group scrollbar value */
+ win = ctx->current;
+ id_len = (int)nk_strlen(id);
+ id_hash = nk_murmur_hash(id, (int)id_len, NK_PANEL_GROUP);
+ x_offset_ptr = nk_find_value(win, id_hash);
+ if (!x_offset_ptr) {
+ x_offset_ptr = nk_add_value(ctx, win, id_hash, 0);
+ y_offset_ptr = nk_add_value(ctx, win, id_hash+1, 0);
+
+ NK_ASSERT(x_offset_ptr);
+ NK_ASSERT(y_offset_ptr);
+ if (!x_offset_ptr || !y_offset_ptr) return;
+ *x_offset_ptr = *y_offset_ptr = 0;
+ } else y_offset_ptr = nk_find_value(win, id_hash+1);
+ if (x_offset)
+ *x_offset = *x_offset_ptr;
+ if (y_offset)
+ *y_offset = *y_offset_ptr;
}
-
NK_API void
-nk_clear(struct nk_context *ctx)
+nk_group_set_scroll(struct nk_context *ctx, const char *id, nk_uint x_offset, nk_uint y_offset)
{
- struct nk_window *iter;
- struct nk_window *next;
+ int id_len;
+ nk_hash id_hash;
+ struct nk_window *win;
+ nk_uint *x_offset_ptr;
+ nk_uint *y_offset_ptr;
+
NK_ASSERT(ctx);
+ NK_ASSERT(id);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout || !id)
+ return;
- if (!ctx) return;
- if (ctx->use_pool)
- nk_buffer_clear(&ctx->memory);
- else nk_buffer_reset(&ctx->memory, NK_BUFFER_FRONT);
+ /* find persistent group scrollbar value */
+ win = ctx->current;
+ id_len = (int)nk_strlen(id);
+ id_hash = nk_murmur_hash(id, (int)id_len, NK_PANEL_GROUP);
+ x_offset_ptr = nk_find_value(win, id_hash);
+ if (!x_offset_ptr) {
+ x_offset_ptr = nk_add_value(ctx, win, id_hash, 0);
+ y_offset_ptr = nk_add_value(ctx, win, id_hash+1, 0);
- ctx->build = 0;
- ctx->memory.calls = 0;
- ctx->last_widget_state = 0;
- ctx->style.cursor_active = ctx->style.cursors[NK_CURSOR_ARROW];
- NK_MEMSET(&ctx->overlay, 0, sizeof(ctx->overlay));
-#ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT
- nk_draw_list_clear(&ctx->draw_list);
-#endif
+ NK_ASSERT(x_offset_ptr);
+ NK_ASSERT(y_offset_ptr);
+ if (!x_offset_ptr || !y_offset_ptr) return;
+ *x_offset_ptr = *y_offset_ptr = 0;
+ } else y_offset_ptr = nk_find_value(win, id_hash+1);
+ *x_offset_ptr = x_offset;
+ *y_offset_ptr = y_offset;
+}
- /* garbage collector */
- iter = ctx->begin;
- while (iter) {
- /* make sure minimized windows do not get removed */
- if ((iter->flags & NK_WINDOW_MINIMIZED) &&
- !(iter->flags & NK_WINDOW_CLOSED)) {
- iter = iter->next;
- continue;
- }
- /* remove hotness from hidden or closed windows*/
- if (((iter->flags & NK_WINDOW_HIDDEN) ||
- (iter->flags & NK_WINDOW_CLOSED)) &&
- iter == ctx->active)
- ctx->active = iter->next;
- /* free unused popup windows */
- if (iter->popup.win && iter->popup.win->seq != ctx->seq) {
- nk_free_window(ctx, iter->popup.win);
- iter->popup.win = 0;
- }
- /* remove unused window state tables */
- {struct nk_table *n, *it = iter->tables;
- while (it) {
- n = it->next;
- if (it->seq != ctx->seq) {
- nk_remove_table(iter, it);
- nk_zero(it, sizeof(union nk_page_data));
- nk_free_table(ctx, it);
- if (it == iter->tables)
- iter->tables = n;
- }
- it = n;
- }}
- /* window itself is not used anymore so free */
- if (iter->seq != ctx->seq || iter->flags & NK_WINDOW_CLOSED) {
- next = iter->next;
- nk_remove_window(ctx, iter);
- nk_free_window(ctx, iter);
- iter = next;
- } else iter = iter->next;
- }
- ctx->seq++;
-}
-/* ----------------------------------------------------------------
+
+/* ===============================================================
*
- * BUFFERING
+ * LIST VIEW
*
- * ---------------------------------------------------------------*/
-NK_INTERN void
-nk_start_buffer(struct nk_context *ctx, struct nk_command_buffer *buffer)
+ * ===============================================================*/
+NK_API int
+nk_list_view_begin(struct nk_context *ctx, struct nk_list_view *view,
+ const char *title, nk_flags flags, int row_height, int row_count)
{
+ int title_len;
+ nk_hash title_hash;
+ nk_uint *x_offset;
+ nk_uint *y_offset;
+
+ int result;
+ struct nk_window *win;
+ struct nk_panel *layout;
+ const struct nk_style *style;
+ struct nk_vec2 item_spacing;
+
NK_ASSERT(ctx);
- NK_ASSERT(buffer);
- if (!ctx || !buffer) return;
- buffer->begin = ctx->memory.allocated;
- buffer->end = buffer->begin;
- buffer->last = buffer->begin;
- buffer->clip = nk_null_rect;
+ NK_ASSERT(view);
+ NK_ASSERT(title);
+ if (!ctx || !view || !title) return 0;
+
+ win = ctx->current;
+ style = &ctx->style;
+ item_spacing = style->window.spacing;
+ row_height += NK_MAX(0, (int)item_spacing.y);
+
+ /* find persistent list view scrollbar offset */
+ title_len = (int)nk_strlen(title);
+ title_hash = nk_murmur_hash(title, (int)title_len, NK_PANEL_GROUP);
+ x_offset = nk_find_value(win, title_hash);
+ if (!x_offset) {
+ x_offset = nk_add_value(ctx, win, title_hash, 0);
+ y_offset = nk_add_value(ctx, win, title_hash+1, 0);
+
+ NK_ASSERT(x_offset);
+ NK_ASSERT(y_offset);
+ if (!x_offset || !y_offset) return 0;
+ *x_offset = *y_offset = 0;
+ } else y_offset = nk_find_value(win, title_hash+1);
+ view->scroll_value = *y_offset;
+ view->scroll_pointer = y_offset;
+
+ *y_offset = 0;
+ result = nk_group_scrolled_offset_begin(ctx, x_offset, y_offset, title, flags);
+ win = ctx->current;
+ layout = win->layout;
+
+ view->total_height = row_height * NK_MAX(row_count,1);
+ view->begin = (int)NK_MAX(((float)view->scroll_value / (float)row_height), 0.0f);
+ view->count = (int)NK_MAX(nk_iceilf((layout->clip.h)/(float)row_height),0);
+ view->count = NK_MIN(view->count, row_count - view->begin);
+ view->end = view->begin + view->count;
+ view->ctx = ctx;
+ return result;
}
+NK_API void
+nk_list_view_end(struct nk_list_view *view)
+{
+ struct nk_context *ctx;
+ struct nk_window *win;
+ struct nk_panel *layout;
-NK_INTERN void
-nk_start(struct nk_context *ctx, struct nk_window *win)
+ NK_ASSERT(view);
+ NK_ASSERT(view->ctx);
+ NK_ASSERT(view->scroll_pointer);
+ if (!view || !view->ctx) return;
+
+ ctx = view->ctx;
+ win = ctx->current;
+ layout = win->layout;
+ layout->at_y = layout->bounds.y + (float)view->total_height;
+ *view->scroll_pointer = *view->scroll_pointer + view->scroll_value;
+ nk_group_end(view->ctx);
+}
+
+
+
+
+
+/* ===============================================================
+ *
+ * WIDGET
+ *
+ * ===============================================================*/
+NK_API struct nk_rect
+nk_widget_bounds(struct nk_context *ctx)
{
+ struct nk_rect bounds;
NK_ASSERT(ctx);
- NK_ASSERT(win);
- nk_start_buffer(ctx, &win->buffer);
+ NK_ASSERT(ctx->current);
+ if (!ctx || !ctx->current)
+ return nk_rect(0,0,0,0);
+ nk_layout_peek(&bounds, ctx);
+ return bounds;
}
-
-NK_INTERN void
-nk_start_popup(struct nk_context *ctx, struct nk_window *win)
+NK_API struct nk_vec2
+nk_widget_position(struct nk_context *ctx)
{
- struct nk_popup_buffer *buf;
+ struct nk_rect bounds;
NK_ASSERT(ctx);
- NK_ASSERT(win);
- if (!ctx || !win) return;
+ NK_ASSERT(ctx->current);
+ if (!ctx || !ctx->current)
+ return nk_vec2(0,0);
- /* save buffer fill state for popup */
- buf = &win->popup.buf;
- buf->begin = win->buffer.end;
- buf->end = win->buffer.end;
- buf->parent = win->buffer.last;
- buf->last = buf->begin;
- buf->active = nk_true;
+ nk_layout_peek(&bounds, ctx);
+ return nk_vec2(bounds.x, bounds.y);
}
-
-NK_INTERN void
-nk_finish_popup(struct nk_context *ctx, struct nk_window *win)
+NK_API struct nk_vec2
+nk_widget_size(struct nk_context *ctx)
{
- struct nk_popup_buffer *buf;
+ struct nk_rect bounds;
NK_ASSERT(ctx);
- NK_ASSERT(win);
- if (!ctx || !win) return;
+ NK_ASSERT(ctx->current);
+ if (!ctx || !ctx->current)
+ return nk_vec2(0,0);
- buf = &win->popup.buf;
- buf->last = win->buffer.last;
- buf->end = win->buffer.end;
+ nk_layout_peek(&bounds, ctx);
+ return nk_vec2(bounds.w, bounds.h);
}
-
-NK_INTERN void
-nk_finish_buffer(struct nk_context *ctx, struct nk_command_buffer *buffer)
+NK_API float
+nk_widget_width(struct nk_context *ctx)
{
+ struct nk_rect bounds;
NK_ASSERT(ctx);
- NK_ASSERT(buffer);
- if (!ctx || !buffer) return;
- buffer->end = ctx->memory.allocated;
-}
+ NK_ASSERT(ctx->current);
+ if (!ctx || !ctx->current)
+ return 0;
-NK_INTERN void
-nk_finish(struct nk_context *ctx, struct nk_window *win)
+ nk_layout_peek(&bounds, ctx);
+ return bounds.w;
+}
+NK_API float
+nk_widget_height(struct nk_context *ctx)
{
- struct nk_popup_buffer *buf;
- struct nk_command *parent_last;
- void *memory;
-
+ struct nk_rect bounds;
NK_ASSERT(ctx);
- NK_ASSERT(win);
- if (!ctx || !win) return;
- nk_finish_buffer(ctx, &win->buffer);
- if (!win->popup.buf.active) return;
+ NK_ASSERT(ctx->current);
+ if (!ctx || !ctx->current)
+ return 0;
- buf = &win->popup.buf;
- memory = ctx->memory.memory.ptr;
- parent_last = nk_ptr_add(struct nk_command, memory, buf->parent);
- parent_last->next = buf->end;
+ nk_layout_peek(&bounds, ctx);
+ return bounds.h;
}
-
-NK_INTERN void
-nk_build(struct nk_context *ctx)
+NK_API int
+nk_widget_is_hovered(struct nk_context *ctx)
{
- struct nk_window *iter = 0;
- struct nk_command *cmd = 0;
- nk_byte *buffer = 0;
-
- /* draw cursor overlay */
- if (!ctx->style.cursor_active)
- ctx->style.cursor_active = ctx->style.cursors[NK_CURSOR_ARROW];
- if (ctx->style.cursor_active && !ctx->input.mouse.grabbed && ctx->style.cursor_visible) {
- struct nk_rect mouse_bounds;
- const struct nk_cursor *cursor = ctx->style.cursor_active;
- nk_command_buffer_init(&ctx->overlay, &ctx->memory, NK_CLIPPING_OFF);
- nk_start_buffer(ctx, &ctx->overlay);
-
- mouse_bounds.x = ctx->input.mouse.pos.x - cursor->offset.x;
- mouse_bounds.y = ctx->input.mouse.pos.y - cursor->offset.y;
- mouse_bounds.w = cursor->size.x;
- mouse_bounds.h = cursor->size.y;
-
- nk_draw_image(&ctx->overlay, mouse_bounds, &cursor->img, nk_white);
- nk_finish_buffer(ctx, &ctx->overlay);
- }
- /* build one big draw command list out of all window buffers */
- iter = ctx->begin;
- buffer = (nk_byte*)ctx->memory.memory.ptr;
- while (iter != 0) {
- struct nk_window *next = iter->next;
- if (iter->buffer.last == iter->buffer.begin || (iter->flags & NK_WINDOW_HIDDEN)||
- iter->seq != ctx->seq)
- goto cont;
-
- cmd = nk_ptr_add(struct nk_command, buffer, iter->buffer.last);
- while (next && ((next->buffer.last == next->buffer.begin) ||
- (next->flags & NK_WINDOW_HIDDEN)))
- next = next->next; /* skip empty command buffers */
+ struct nk_rect c, v;
+ struct nk_rect bounds;
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ if (!ctx || !ctx->current || ctx->active != ctx->current)
+ return 0;
- if (next) cmd->next = next->buffer.begin;
- cont: iter = next;
- }
- /* append all popup draw commands into lists */
- iter = ctx->begin;
- while (iter != 0) {
- struct nk_window *next = iter->next;
- struct nk_popup_buffer *buf;
- if (!iter->popup.buf.active)
- goto skip;
+ c = ctx->current->layout->clip;
+ c.x = (float)((int)c.x);
+ c.y = (float)((int)c.y);
+ c.w = (float)((int)c.w);
+ c.h = (float)((int)c.h);
- buf = &iter->popup.buf;
- cmd->next = buf->begin;
- cmd = nk_ptr_add(struct nk_command, buffer, buf->last);
- buf->active = nk_false;
- skip: iter = next;
- }
- /* append overlay commands */
- if (cmd) {
- if (ctx->overlay.end != ctx->overlay.begin)
- cmd->next = ctx->overlay.begin;
- else cmd->next = ctx->memory.allocated;
- }
+ nk_layout_peek(&bounds, ctx);
+ nk_unify(&v, &c, bounds.x, bounds.y, bounds.x + bounds.w, bounds.y + bounds.h);
+ if (!NK_INTERSECT(c.x, c.y, c.w, c.h, bounds.x, bounds.y, bounds.w, bounds.h))
+ return 0;
+ return nk_input_is_mouse_hovering_rect(&ctx->input, bounds);
}
-
-NK_API const struct nk_command*
-nk__begin(struct nk_context *ctx)
+NK_API int
+nk_widget_is_mouse_clicked(struct nk_context *ctx, enum nk_buttons btn)
{
- struct nk_window *iter;
- nk_byte *buffer;
+ struct nk_rect c, v;
+ struct nk_rect bounds;
NK_ASSERT(ctx);
- if (!ctx) return 0;
- if (!ctx->count) return 0;
+ NK_ASSERT(ctx->current);
+ if (!ctx || !ctx->current || ctx->active != ctx->current)
+ return 0;
- buffer = (nk_byte*)ctx->memory.memory.ptr;
- if (!ctx->build) {
- nk_build(ctx);
- ctx->build = nk_true;
- }
- iter = ctx->begin;
- while (iter && ((iter->buffer.begin == iter->buffer.end) || (iter->flags & NK_WINDOW_HIDDEN)))
- iter = iter->next;
- if (!iter) return 0;
- return nk_ptr_add_const(struct nk_command, buffer, iter->buffer.begin);
-}
+ c = ctx->current->layout->clip;
+ c.x = (float)((int)c.x);
+ c.y = (float)((int)c.y);
+ c.w = (float)((int)c.w);
+ c.h = (float)((int)c.h);
-NK_API const struct nk_command*
-nk__next(struct nk_context *ctx, const struct nk_command *cmd)
+ nk_layout_peek(&bounds, ctx);
+ nk_unify(&v, &c, bounds.x, bounds.y, bounds.x + bounds.w, bounds.y + bounds.h);
+ if (!NK_INTERSECT(c.x, c.y, c.w, c.h, bounds.x, bounds.y, bounds.w, bounds.h))
+ return 0;
+ return nk_input_mouse_clicked(&ctx->input, btn, bounds);
+}
+NK_API int
+nk_widget_has_mouse_click_down(struct nk_context *ctx, enum nk_buttons btn, int down)
{
- nk_byte *buffer;
- const struct nk_command *next;
+ struct nk_rect c, v;
+ struct nk_rect bounds;
NK_ASSERT(ctx);
- if (!ctx || !cmd || !ctx->count) return 0;
- if (cmd->next >= ctx->memory.allocated) return 0;
- buffer = (nk_byte*)ctx->memory.memory.ptr;
- next = nk_ptr_add_const(struct nk_command, buffer, cmd->next);
- return next;
-}
+ NK_ASSERT(ctx->current);
+ if (!ctx || !ctx->current || ctx->active != ctx->current)
+ return 0;
-/* ----------------------------------------------------------------
- *
- * PANEL
- *
- * ---------------------------------------------------------------*/
-static int
-nk_panel_has_header(nk_flags flags, const char *title)
-{
- int active = 0;
- active = (flags & (NK_WINDOW_CLOSABLE|NK_WINDOW_MINIMIZABLE));
- active = active || (flags & NK_WINDOW_TITLE);
- active = active && !(flags & NK_WINDOW_HIDDEN) && title;
- return active;
-}
+ c = ctx->current->layout->clip;
+ c.x = (float)((int)c.x);
+ c.y = (float)((int)c.y);
+ c.w = (float)((int)c.w);
+ c.h = (float)((int)c.h);
-NK_INTERN struct nk_vec2
-nk_panel_get_padding(const struct nk_style *style, enum nk_panel_type type)
-{
- switch (type) {
- default:
- case NK_PANEL_WINDOW: return style->window.padding;
- case NK_PANEL_GROUP: return style->window.group_padding;
- case NK_PANEL_POPUP: return style->window.popup_padding;
- case NK_PANEL_CONTEXTUAL: return style->window.contextual_padding;
- case NK_PANEL_COMBO: return style->window.combo_padding;
- case NK_PANEL_MENU: return style->window.menu_padding;
- case NK_PANEL_TOOLTIP: return style->window.menu_padding;
- }
+ nk_layout_peek(&bounds, ctx);
+ nk_unify(&v, &c, bounds.x, bounds.y, bounds.x + bounds.w, bounds.y + bounds.h);
+ if (!NK_INTERSECT(c.x, c.y, c.w, c.h, bounds.x, bounds.y, bounds.w, bounds.h))
+ return 0;
+ return nk_input_has_mouse_click_down_in_rect(&ctx->input, btn, bounds, down);
}
-
-NK_INTERN float
-nk_panel_get_border(const struct nk_style *style, nk_flags flags,
- enum nk_panel_type type)
+NK_API enum nk_widget_layout_states
+nk_widget(struct nk_rect *bounds, const struct nk_context *ctx)
{
- if (flags & NK_WINDOW_BORDER) {
- switch (type) {
- default:
- case NK_PANEL_WINDOW: return style->window.border;
- case NK_PANEL_GROUP: return style->window.group_border;
- case NK_PANEL_POPUP: return style->window.popup_border;
- case NK_PANEL_CONTEXTUAL: return style->window.contextual_border;
- case NK_PANEL_COMBO: return style->window.combo_border;
- case NK_PANEL_MENU: return style->window.menu_border;
- case NK_PANEL_TOOLTIP: return style->window.menu_border;
- }} else return 0;
-}
+ struct nk_rect c, v;
+ struct nk_window *win;
+ struct nk_panel *layout;
+ const struct nk_input *in;
-NK_INTERN struct nk_color
-nk_panel_get_border_color(const struct nk_style *style, enum nk_panel_type type)
-{
- switch (type) {
- default:
- case NK_PANEL_WINDOW: return style->window.border_color;
- case NK_PANEL_GROUP: return style->window.group_border_color;
- case NK_PANEL_POPUP: return style->window.popup_border_color;
- case NK_PANEL_CONTEXTUAL: return style->window.contextual_border_color;
- case NK_PANEL_COMBO: return style->window.combo_border_color;
- case NK_PANEL_MENU: return style->window.menu_border_color;
- case NK_PANEL_TOOLTIP: return style->window.menu_border_color;
- }
-}
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout)
+ return NK_WIDGET_INVALID;
+
+ /* allocate space and check if the widget needs to be updated and drawn */
+ nk_panel_alloc_space(bounds, ctx);
+ win = ctx->current;
+ layout = win->layout;
+ in = &ctx->input;
+ c = layout->clip;
+
+ /* if one of these triggers you forgot to add an `if` condition around either
+ a window, group, popup, combobox or contextual menu `begin` and `end` block.
+ Example:
+ if (nk_begin(...) {...} nk_end(...); or
+ if (nk_group_begin(...) { nk_group_end(...);} */
+ NK_ASSERT(!(layout->flags & NK_WINDOW_MINIMIZED));
+ NK_ASSERT(!(layout->flags & NK_WINDOW_HIDDEN));
+ NK_ASSERT(!(layout->flags & NK_WINDOW_CLOSED));
+
+ /* need to convert to int here to remove floating point errors */
+ bounds->x = (float)((int)bounds->x);
+ bounds->y = (float)((int)bounds->y);
+ bounds->w = (float)((int)bounds->w);
+ bounds->h = (float)((int)bounds->h);
-NK_INTERN int
-nk_panel_is_sub(enum nk_panel_type type)
-{
- return (type & NK_PANEL_SET_SUB)?1:0;
-}
+ c.x = (float)((int)c.x);
+ c.y = (float)((int)c.y);
+ c.w = (float)((int)c.w);
+ c.h = (float)((int)c.h);
-NK_INTERN int
-nk_panel_is_nonblock(enum nk_panel_type type)
-{
- return (type & NK_PANEL_SET_NONBLOCK)?1:0;
+ nk_unify(&v, &c, bounds->x, bounds->y, bounds->x + bounds->w, bounds->y + bounds->h);
+ if (!NK_INTERSECT(c.x, c.y, c.w, c.h, bounds->x, bounds->y, bounds->w, bounds->h))
+ return NK_WIDGET_INVALID;
+ if (!NK_INBOX(in->mouse.pos.x, in->mouse.pos.y, v.x, v.y, v.w, v.h))
+ return NK_WIDGET_ROM;
+ return NK_WIDGET_VALID;
}
-
-NK_INTERN int
-nk_panel_begin(struct nk_context *ctx, const char *title, enum nk_panel_type panel_type)
+NK_API enum nk_widget_layout_states
+nk_widget_fitting(struct nk_rect *bounds, struct nk_context *ctx,
+ struct nk_vec2 item_padding)
{
- struct nk_input *in;
+ /* update the bounds to stand without padding */
struct nk_window *win;
+ struct nk_style *style;
struct nk_panel *layout;
- struct nk_command_buffer *out;
- const struct nk_style *style;
- const struct nk_user_font *font;
-
- struct nk_vec2 scrollbar_size;
+ enum nk_widget_layout_states state;
struct nk_vec2 panel_padding;
NK_ASSERT(ctx);
NK_ASSERT(ctx->current);
NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout) return 0;
- nk_zero(ctx->current->layout, sizeof(*ctx->current->layout));
- if ((ctx->current->flags & NK_WINDOW_HIDDEN) || (ctx->current->flags & NK_WINDOW_CLOSED)) {
- nk_zero(ctx->current->layout, sizeof(struct nk_panel));
- ctx->current->layout->type = panel_type;
- return 0;
- }
- /* pull state into local stack */
- style = &ctx->style;
- font = style->font;
+ if (!ctx || !ctx->current || !ctx->current->layout)
+ return NK_WIDGET_INVALID;
+
win = ctx->current;
+ style = &ctx->style;
layout = win->layout;
- out = &win->buffer;
- in = (win->flags & NK_WINDOW_NO_INPUT) ? 0: &ctx->input;
-#ifdef NK_INCLUDE_COMMAND_USERDATA
- win->buffer.userdata = ctx->userdata;
-#endif
- /* pull style configuration into local stack */
- scrollbar_size = style->window.scrollbar_size;
- panel_padding = nk_panel_get_padding(style, panel_type);
-
- /* window movement */
- if ((win->flags & NK_WINDOW_MOVABLE) && !(win->flags & NK_WINDOW_ROM)) {
- int left_mouse_down;
- int left_mouse_click_in_cursor;
-
- /* calculate draggable window space */
- struct nk_rect header;
- header.x = win->bounds.x;
- header.y = win->bounds.y;
- header.w = win->bounds.w;
- if (nk_panel_has_header(win->flags, title)) {
- header.h = font->height + 2.0f * style->window.header.padding.y;
- header.h += 2.0f * style->window.header.label_padding.y;
- } else header.h = panel_padding.y;
-
- /* window movement by dragging */
- left_mouse_down = in->mouse.buttons[NK_BUTTON_LEFT].down;
- left_mouse_click_in_cursor = nk_input_has_mouse_click_down_in_rect(in,
- NK_BUTTON_LEFT, header, nk_true);
- if (left_mouse_down && left_mouse_click_in_cursor) {
- win->bounds.x = win->bounds.x + in->mouse.delta.x;
- win->bounds.y = win->bounds.y + in->mouse.delta.y;
- in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.x += in->mouse.delta.x;
- in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.y += in->mouse.delta.y;
- ctx->style.cursor_active = ctx->style.cursors[NK_CURSOR_MOVE];
- }
- }
-
- /* setup panel */
- layout->type = panel_type;
- layout->flags = win->flags;
- layout->bounds = win->bounds;
- layout->bounds.x += panel_padding.x;
- layout->bounds.w -= 2*panel_padding.x;
- if (win->flags & NK_WINDOW_BORDER) {
- layout->border = nk_panel_get_border(style, win->flags, panel_type);
- layout->bounds = nk_shrink_rect(layout->bounds, layout->border);
- } else layout->border = 0;
- layout->at_y = layout->bounds.y;
- layout->at_x = layout->bounds.x;
- layout->max_x = 0;
- layout->header_height = 0;
- layout->footer_height = 0;
- nk_layout_reset_min_row_height(ctx);
- layout->row.index = 0;
- layout->row.columns = 0;
- layout->row.ratio = 0;
- layout->row.item_width = 0;
- layout->row.tree_depth = 0;
- layout->row.height = panel_padding.y;
- layout->has_scrolling = nk_true;
- if (!(win->flags & NK_WINDOW_NO_SCROLLBAR))
- layout->bounds.w -= scrollbar_size.x;
- if (!nk_panel_is_nonblock(panel_type)) {
- layout->footer_height = 0;
- if (!(win->flags & NK_WINDOW_NO_SCROLLBAR) || win->flags & NK_WINDOW_SCALABLE)
- layout->footer_height = scrollbar_size.y;
- layout->bounds.h -= layout->footer_height;
- }
-
- /* panel header */
- if (nk_panel_has_header(win->flags, title))
- {
- struct nk_text text;
- struct nk_rect header;
- const struct nk_style_item *background = 0;
-
- /* calculate header bounds */
- header.x = win->bounds.x;
- header.y = win->bounds.y;
- header.w = win->bounds.w;
- header.h = font->height + 2.0f * style->window.header.padding.y;
- header.h += (2.0f * style->window.header.label_padding.y);
-
- /* shrink panel by header */
- layout->header_height = header.h;
- layout->bounds.y += header.h;
- layout->bounds.h -= header.h;
- layout->at_y += header.h;
-
- /* select correct header background and text color */
- if (ctx->active == win) {
- background = &style->window.header.active;
- text.text = style->window.header.label_active;
- } else if (nk_input_is_mouse_hovering_rect(&ctx->input, header)) {
- background = &style->window.header.hover;
- text.text = style->window.header.label_hover;
- } else {
- background = &style->window.header.normal;
- text.text = style->window.header.label_normal;
- }
-
- /* draw header background */
- header.h += 1.0f;
- if (background->type == NK_STYLE_ITEM_IMAGE) {
- text.background = nk_rgba(0,0,0,0);
- nk_draw_image(&win->buffer, header, &background->data.image, nk_white);
- } else {
- text.background = background->data.color;
- nk_fill_rect(out, header, 0, background->data.color);
- }
-
- /* window close button */
- {struct nk_rect button;
- button.y = header.y + style->window.header.padding.y;
- button.h = header.h - 2 * style->window.header.padding.y;
- button.w = button.h;
- if (win->flags & NK_WINDOW_CLOSABLE) {
- nk_flags ws = 0;
- if (style->window.header.align == NK_HEADER_RIGHT) {
- button.x = (header.w + header.x) - (button.w + style->window.header.padding.x);
- header.w -= button.w + style->window.header.spacing.x + style->window.header.padding.x;
- } else {
- button.x = header.x + style->window.header.padding.x;
- header.x += button.w + style->window.header.spacing.x + style->window.header.padding.x;
- }
-
- if (nk_do_button_symbol(&ws, &win->buffer, button,
- style->window.header.close_symbol, NK_BUTTON_DEFAULT,
- &style->window.header.close_button, in, style->font) && !(win->flags & NK_WINDOW_ROM))
- {
- layout->flags |= NK_WINDOW_HIDDEN;
- layout->flags &= (nk_flags)~NK_WINDOW_MINIMIZED;
- }
- }
-
- /* window minimize button */
- if (win->flags & NK_WINDOW_MINIMIZABLE) {
- nk_flags ws = 0;
- if (style->window.header.align == NK_HEADER_RIGHT) {
- button.x = (header.w + header.x) - button.w;
- if (!(win->flags & NK_WINDOW_CLOSABLE)) {
- button.x -= style->window.header.padding.x;
- header.w -= style->window.header.padding.x;
- }
- header.w -= button.w + style->window.header.spacing.x;
- } else {
- button.x = header.x;
- header.x += button.w + style->window.header.spacing.x + style->window.header.padding.x;
- }
- if (nk_do_button_symbol(&ws, &win->buffer, button, (layout->flags & NK_WINDOW_MINIMIZED)?
- style->window.header.maximize_symbol: style->window.header.minimize_symbol,
- NK_BUTTON_DEFAULT, &style->window.header.minimize_button, in, style->font) && !(win->flags & NK_WINDOW_ROM))
- layout->flags = (layout->flags & NK_WINDOW_MINIMIZED) ?
- layout->flags & (nk_flags)~NK_WINDOW_MINIMIZED:
- layout->flags | NK_WINDOW_MINIMIZED;
- }}
-
- {/* window header title */
- int text_len = nk_strlen(title);
- struct nk_rect label = {0,0,0,0};
- float t = font->width(font->userdata, font->height, title, text_len);
- text.padding = nk_vec2(0,0);
-
- label.x = header.x + style->window.header.padding.x;
- label.x += style->window.header.label_padding.x;
- label.y = header.y + style->window.header.label_padding.y;
- label.h = font->height + 2 * style->window.header.label_padding.y;
- label.w = t + 2 * style->window.header.spacing.x;
- label.w = NK_CLAMP(0, label.w, header.x + header.w - label.x);
- nk_widget_text(out, label,(const char*)title, text_len, &text, NK_TEXT_LEFT, font);}
- }
-
- /* draw window background */
- if (!(layout->flags & NK_WINDOW_MINIMIZED) && !(layout->flags & NK_WINDOW_DYNAMIC)) {
- struct nk_rect body;
- body.x = win->bounds.x;
- body.w = win->bounds.w;
- body.y = (win->bounds.y + layout->header_height);
- body.h = (win->bounds.h - layout->header_height);
- if (style->window.fixed_background.type == NK_STYLE_ITEM_IMAGE)
- nk_draw_image(out, body, &style->window.fixed_background.data.image, nk_white);
- else nk_fill_rect(out, body, 0, style->window.fixed_background.data.color);
- }
+ state = nk_widget(bounds, ctx);
- /* set clipping rectangle */
- {struct nk_rect clip;
- layout->clip = layout->bounds;
- nk_unify(&clip, &win->buffer.clip, layout->clip.x, layout->clip.y,
- layout->clip.x + layout->clip.w, layout->clip.y + layout->clip.h);
- nk_push_scissor(out, clip);
- layout->clip = clip;}
- return !(layout->flags & NK_WINDOW_HIDDEN) && !(layout->flags & NK_WINDOW_MINIMIZED);
-}
+ panel_padding = nk_panel_get_padding(style, layout->type);
+ if (layout->row.index == 1) {
+ bounds->w += panel_padding.x;
+ bounds->x -= panel_padding.x;
+ } else bounds->x -= item_padding.x;
-NK_INTERN void
-nk_panel_end(struct nk_context *ctx)
+ if (layout->row.index == layout->row.columns)
+ bounds->w += panel_padding.x;
+ else bounds->w += item_padding.x;
+ return state;
+}
+NK_API void
+nk_spacing(struct nk_context *ctx, int cols)
{
- struct nk_input *in;
- struct nk_window *window;
+ struct nk_window *win;
struct nk_panel *layout;
- const struct nk_style *style;
- struct nk_command_buffer *out;
-
- struct nk_vec2 scrollbar_size;
- struct nk_vec2 panel_padding;
+ struct nk_rect none;
+ int i, index, rows;
NK_ASSERT(ctx);
NK_ASSERT(ctx->current);
@@ -17870,4773 +19233,5327 @@ nk_panel_end(struct nk_context *ctx)
if (!ctx || !ctx->current || !ctx->current->layout)
return;
- window = ctx->current;
- layout = window->layout;
- style = &ctx->style;
- out = &window->buffer;
- in = (layout->flags & NK_WINDOW_ROM || layout->flags & NK_WINDOW_NO_INPUT) ? 0 :&ctx->input;
- if (!nk_panel_is_sub(layout->type))
- nk_push_scissor(out, nk_null_rect);
-
- /* cache configuration data */
- scrollbar_size = style->window.scrollbar_size;
- panel_padding = nk_panel_get_padding(style, layout->type);
+ /* spacing over row boundaries */
+ win = ctx->current;
+ layout = win->layout;
+ index = (layout->row.index + cols) % layout->row.columns;
+ rows = (layout->row.index + cols) / layout->row.columns;
+ if (rows) {
+ for (i = 0; i < rows; ++i)
+ nk_panel_alloc_row(ctx, win);
+ cols = index;
+ }
+ /* non table layout need to allocate space */
+ if (layout->row.type != NK_LAYOUT_DYNAMIC_FIXED &&
+ layout->row.type != NK_LAYOUT_STATIC_FIXED) {
+ for (i = 0; i < cols; ++i)
+ nk_panel_alloc_space(&none, ctx);
+ } layout->row.index = index;
+}
- /* update the current cursor Y-position to point over the last added widget */
- layout->at_y += layout->row.height;
- /* dynamic panels */
- if (layout->flags & NK_WINDOW_DYNAMIC && !(layout->flags & NK_WINDOW_MINIMIZED))
- {
- /* update panel height to fit dynamic growth */
- struct nk_rect empty_space;
- if (layout->at_y < (layout->bounds.y + layout->bounds.h))
- layout->bounds.h = layout->at_y - layout->bounds.y;
- /* fill top empty space */
- empty_space.x = window->bounds.x;
- empty_space.y = layout->bounds.y;
- empty_space.h = panel_padding.y;
- empty_space.w = window->bounds.w;
- nk_fill_rect(out, empty_space, 0, style->window.background);
- /* fill left empty space */
- empty_space.x = window->bounds.x;
- empty_space.y = layout->bounds.y;
- empty_space.w = panel_padding.x + layout->border;
- empty_space.h = layout->bounds.h;
- nk_fill_rect(out, empty_space, 0, style->window.background);
- /* fill right empty space */
- empty_space.x = layout->bounds.x + layout->bounds.w - layout->border;
- empty_space.y = layout->bounds.y;
- empty_space.w = panel_padding.x + layout->border;
- empty_space.h = layout->bounds.h;
- if (*layout->offset_y == 0 && !(layout->flags & NK_WINDOW_NO_SCROLLBAR))
- empty_space.w += scrollbar_size.x;
- nk_fill_rect(out, empty_space, 0, style->window.background);
+/* ===============================================================
+ *
+ * TEXT
+ *
+ * ===============================================================*/
+NK_LIB void
+nk_widget_text(struct nk_command_buffer *o, struct nk_rect b,
+ const char *string, int len, const struct nk_text *t,
+ nk_flags a, const struct nk_user_font *f)
+{
+ struct nk_rect label;
+ float text_width;
- /* fill bottom empty space */
- if (*layout->offset_x != 0 && !(layout->flags & NK_WINDOW_NO_SCROLLBAR)) {
- empty_space.x = window->bounds.x;
- empty_space.y = layout->bounds.y + layout->bounds.h;
- empty_space.w = window->bounds.w;
- empty_space.h = scrollbar_size.y;
- nk_fill_rect(out, empty_space, 0, style->window.background);
- }
- }
+ NK_ASSERT(o);
+ NK_ASSERT(t);
+ if (!o || !t) return;
- /* scrollbars */
- if (!(layout->flags & NK_WINDOW_NO_SCROLLBAR) &&
- !(layout->flags & NK_WINDOW_MINIMIZED) &&
- window->scrollbar_hiding_timer < NK_SCROLLBAR_HIDING_TIMEOUT)
- {
- struct nk_rect scroll;
- int scroll_has_scrolling;
- float scroll_target;
- float scroll_offset;
- float scroll_step;
- float scroll_inc;
+ b.h = NK_MAX(b.h, 2 * t->padding.y);
+ label.x = 0; label.w = 0;
+ label.y = b.y + t->padding.y;
+ label.h = NK_MIN(f->height, b.h - 2 * t->padding.y);
- /* mouse wheel scrolling */
- if (nk_panel_is_sub(layout->type))
- {
- /* sub-window mouse wheel scrolling */
- struct nk_window *root_window = window;
- struct nk_panel *root_panel = window->layout;
- while (root_panel->parent)
- root_panel = root_panel->parent;
- while (root_window->parent)
- root_window = root_window->parent;
+ text_width = f->width(f->userdata, f->height, (const char*)string, len);
+ text_width += (2.0f * t->padding.x);
- /* only allow scrolling if parent window is active */
- scroll_has_scrolling = 0;
- if ((root_window == ctx->active) && layout->has_scrolling) {
- /* and panel is being hovered and inside clip rect*/
- if (nk_input_is_mouse_hovering_rect(in, layout->bounds) &&
- NK_INTERSECT(layout->bounds.x, layout->bounds.y, layout->bounds.w, layout->bounds.h,
- root_panel->clip.x, root_panel->clip.y, root_panel->clip.w, root_panel->clip.h))
- {
- /* deactivate all parent scrolling */
- root_panel = window->layout;
- while (root_panel->parent) {
- root_panel->has_scrolling = nk_false;
- root_panel = root_panel->parent;
- }
- root_panel->has_scrolling = nk_false;
- scroll_has_scrolling = nk_true;
- }
- }
- } else if (!nk_panel_is_sub(layout->type)) {
- /* window mouse wheel scrolling */
- scroll_has_scrolling = (window == ctx->active) && layout->has_scrolling;
- if (in && (in->mouse.scroll_delta.y > 0 || in->mouse.scroll_delta.x > 0) && scroll_has_scrolling)
- window->scrolled = nk_true;
- else window->scrolled = nk_false;
- } else scroll_has_scrolling = nk_false;
+ /* align in x-axis */
+ if (a & NK_TEXT_ALIGN_LEFT) {
+ label.x = b.x + t->padding.x;
+ label.w = NK_MAX(0, b.w - 2 * t->padding.x);
+ } else if (a & NK_TEXT_ALIGN_CENTERED) {
+ label.w = NK_MAX(1, 2 * t->padding.x + (float)text_width);
+ label.x = (b.x + t->padding.x + ((b.w - 2 * t->padding.x) - label.w) / 2);
+ label.x = NK_MAX(b.x + t->padding.x, label.x);
+ label.w = NK_MIN(b.x + b.w, label.x + label.w);
+ if (label.w >= label.x) label.w -= label.x;
+ } else if (a & NK_TEXT_ALIGN_RIGHT) {
+ label.x = NK_MAX(b.x + t->padding.x, (b.x + b.w) - (2 * t->padding.x + (float)text_width));
+ label.w = (float)text_width + 2 * t->padding.x;
+ } else return;
- {
- /* vertical scrollbar */
- nk_flags state = 0;
- scroll.x = layout->bounds.x + layout->bounds.w + panel_padding.x;
- scroll.y = layout->bounds.y;
- scroll.w = scrollbar_size.x;
- scroll.h = layout->bounds.h;
+ /* align in y-axis */
+ if (a & NK_TEXT_ALIGN_MIDDLE) {
+ label.y = b.y + b.h/2.0f - (float)f->height/2.0f;
+ label.h = NK_MAX(b.h/2.0f, b.h - (b.h/2.0f + f->height/2.0f));
+ } else if (a & NK_TEXT_ALIGN_BOTTOM) {
+ label.y = b.y + b.h - f->height;
+ label.h = f->height;
+ }
+ nk_draw_text(o, label, (const char*)string, len, f, t->background, t->text);
+}
+NK_LIB void
+nk_widget_text_wrap(struct nk_command_buffer *o, struct nk_rect b,
+ const char *string, int len, const struct nk_text *t,
+ const struct nk_user_font *f)
+{
+ float width;
+ int glyphs = 0;
+ int fitting = 0;
+ int done = 0;
+ struct nk_rect line;
+ struct nk_text text;
+ NK_INTERN nk_rune seperator[] = {' '};
- scroll_offset = (float)*layout->offset_y;
- scroll_step = scroll.h * 0.10f;
- scroll_inc = scroll.h * 0.01f;
- scroll_target = (float)(int)(layout->at_y - scroll.y);
- scroll_offset = nk_do_scrollbarv(&state, out, scroll, scroll_has_scrolling,
- scroll_offset, scroll_target, scroll_step, scroll_inc,
- &ctx->style.scrollv, in, style->font);
- *layout->offset_y = (nk_uint)scroll_offset;
- if (in && scroll_has_scrolling)
- in->mouse.scroll_delta.y = 0;
- }
- {
- /* horizontal scrollbar */
- nk_flags state = 0;
- scroll.x = layout->bounds.x;
- scroll.y = layout->bounds.y + layout->bounds.h;
- scroll.w = layout->bounds.w;
- scroll.h = scrollbar_size.y;
+ NK_ASSERT(o);
+ NK_ASSERT(t);
+ if (!o || !t) return;
- scroll_offset = (float)*layout->offset_x;
- scroll_target = (float)(int)(layout->max_x - scroll.x);
- scroll_step = layout->max_x * 0.05f;
- scroll_inc = layout->max_x * 0.005f;
- scroll_offset = nk_do_scrollbarh(&state, out, scroll, scroll_has_scrolling,
- scroll_offset, scroll_target, scroll_step, scroll_inc,
- &ctx->style.scrollh, in, style->font);
- *layout->offset_x = (nk_uint)scroll_offset;
- }
- }
+ text.padding = nk_vec2(0,0);
+ text.background = t->background;
+ text.text = t->text;
- /* hide scroll if no user input */
- if (window->flags & NK_WINDOW_SCROLL_AUTO_HIDE) {
- int has_input = ctx->input.mouse.delta.x != 0 || ctx->input.mouse.delta.y != 0 || ctx->input.mouse.scroll_delta.y != 0;
- int is_window_hovered = nk_window_is_hovered(ctx);
- int any_item_active = (ctx->last_widget_state & NK_WIDGET_STATE_MODIFIED);
- if ((!has_input && is_window_hovered) || (!is_window_hovered && !any_item_active))
- window->scrollbar_hiding_timer += ctx->delta_time_seconds;
- else window->scrollbar_hiding_timer = 0;
- } else window->scrollbar_hiding_timer = 0;
+ b.w = NK_MAX(b.w, 2 * t->padding.x);
+ b.h = NK_MAX(b.h, 2 * t->padding.y);
+ b.h = b.h - 2 * t->padding.y;
- /* window border */
- if (layout->flags & NK_WINDOW_BORDER)
- {
- struct nk_color border_color = nk_panel_get_border_color(style, layout->type);
- const float padding_y = (layout->flags & NK_WINDOW_MINIMIZED) ?
- style->window.border + window->bounds.y + layout->header_height:
- (layout->flags & NK_WINDOW_DYNAMIC)?
- layout->bounds.y + layout->bounds.h + layout->footer_height:
- window->bounds.y + window->bounds.h;
+ line.x = b.x + t->padding.x;
+ line.y = b.y + t->padding.y;
+ line.w = b.w - 2 * t->padding.x;
+ line.h = 2 * t->padding.y + f->height;
- /* draw border top */
- nk_stroke_line(out,window->bounds.x,window->bounds.y,
- window->bounds.x + window->bounds.w, window->bounds.y,
- layout->border, border_color);
+ fitting = nk_text_clamp(f, string, len, line.w, &glyphs, &width, seperator,NK_LEN(seperator));
+ while (done < len) {
+ if (!fitting || line.y + line.h >= (b.y + b.h)) break;
+ nk_widget_text(o, line, &string[done], fitting, &text, NK_TEXT_LEFT, f);
+ done += fitting;
+ line.y += f->height + 2 * t->padding.y;
+ fitting = nk_text_clamp(f, &string[done], len - done, line.w, &glyphs, &width, seperator,NK_LEN(seperator));
+ }
+}
+NK_API void
+nk_text_colored(struct nk_context *ctx, const char *str, int len,
+ nk_flags alignment, struct nk_color color)
+{
+ struct nk_window *win;
+ const struct nk_style *style;
- /* draw bottom border */
- nk_stroke_line(out, window->bounds.x, padding_y,
- window->bounds.x + window->bounds.w, padding_y, layout->border, border_color);
+ struct nk_vec2 item_padding;
+ struct nk_rect bounds;
+ struct nk_text text;
- /* draw left border */
- nk_stroke_line(out, window->bounds.x + layout->border*0.5f,
- window->bounds.y, window->bounds.x + layout->border*0.5f,
- padding_y, layout->border, border_color);
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout) return;
- /* draw right border */
- nk_stroke_line(out, window->bounds.x + window->bounds.w - layout->border*0.5f,
- window->bounds.y, window->bounds.x + window->bounds.w - layout->border*0.5f,
- padding_y, layout->border, border_color);
- }
+ win = ctx->current;
+ style = &ctx->style;
+ nk_panel_alloc_space(&bounds, ctx);
+ item_padding = style->text.padding;
- /* scaler */
- if ((layout->flags & NK_WINDOW_SCALABLE) && in && !(layout->flags & NK_WINDOW_MINIMIZED))
- {
- /* calculate scaler bounds */
- struct nk_rect scaler;
- scaler.w = scrollbar_size.x;
- scaler.h = scrollbar_size.y;
- scaler.y = layout->bounds.y + layout->bounds.h;
- if (layout->flags & NK_WINDOW_SCALE_LEFT)
- scaler.x = layout->bounds.x - panel_padding.x * 0.5f;
- else scaler.x = layout->bounds.x + layout->bounds.w + panel_padding.x;
- if (layout->flags & NK_WINDOW_NO_SCROLLBAR)
- scaler.x -= scaler.w;
+ text.padding.x = item_padding.x;
+ text.padding.y = item_padding.y;
+ text.background = style->window.background;
+ text.text = color;
+ nk_widget_text(&win->buffer, bounds, str, len, &text, alignment, style->font);
+}
+NK_API void
+nk_text_wrap_colored(struct nk_context *ctx, const char *str,
+ int len, struct nk_color color)
+{
+ struct nk_window *win;
+ const struct nk_style *style;
- /* draw scaler */
- {const struct nk_style_item *item = &style->window.scaler;
- if (item->type == NK_STYLE_ITEM_IMAGE)
- nk_draw_image(out, scaler, &item->data.image, nk_white);
- else {
- if (layout->flags & NK_WINDOW_SCALE_LEFT) {
- nk_fill_triangle(out, scaler.x, scaler.y, scaler.x,
- scaler.y + scaler.h, scaler.x + scaler.w,
- scaler.y + scaler.h, item->data.color);
- } else {
- nk_fill_triangle(out, scaler.x + scaler.w, scaler.y, scaler.x + scaler.w,
- scaler.y + scaler.h, scaler.x, scaler.y + scaler.h, item->data.color);
- }
- }}
+ struct nk_vec2 item_padding;
+ struct nk_rect bounds;
+ struct nk_text text;
- /* do window scaling */
- if (!(window->flags & NK_WINDOW_ROM)) {
- struct nk_vec2 window_size = style->window.min_size;
- int left_mouse_down = in->mouse.buttons[NK_BUTTON_LEFT].down;
- int left_mouse_click_in_scaler = nk_input_has_mouse_click_down_in_rect(in,
- NK_BUTTON_LEFT, scaler, nk_true);
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout) return;
- if (left_mouse_down && left_mouse_click_in_scaler) {
- float delta_x = in->mouse.delta.x;
- if (layout->flags & NK_WINDOW_SCALE_LEFT) {
- delta_x = -delta_x;
- window->bounds.x += in->mouse.delta.x;
- }
- /* dragging in x-direction */
- if (window->bounds.w + delta_x >= window_size.x) {
- if ((delta_x < 0) || (delta_x > 0 && in->mouse.pos.x >= scaler.x)) {
- window->bounds.w = window->bounds.w + delta_x;
- scaler.x += in->mouse.delta.x;
- }
- }
- /* dragging in y-direction (only possible if static window) */
- if (!(layout->flags & NK_WINDOW_DYNAMIC)) {
- if (window_size.y < window->bounds.h + in->mouse.delta.y) {
- if ((in->mouse.delta.y < 0) || (in->mouse.delta.y > 0 && in->mouse.pos.y >= scaler.y)) {
- window->bounds.h = window->bounds.h + in->mouse.delta.y;
- scaler.y += in->mouse.delta.y;
- }
- }
- }
- ctx->style.cursor_active = ctx->style.cursors[NK_CURSOR_RESIZE_TOP_RIGHT_DOWN_LEFT];
- in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.x = scaler.x + scaler.w/2.0f;
- in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.y = scaler.y + scaler.h/2.0f;
- }
- }
- }
- if (!nk_panel_is_sub(layout->type)) {
- /* window is hidden so clear command buffer */
- if (layout->flags & NK_WINDOW_HIDDEN)
- nk_command_buffer_reset(&window->buffer);
- /* window is visible and not tab */
- else nk_finish(ctx, window);
- }
+ win = ctx->current;
+ style = &ctx->style;
+ nk_panel_alloc_space(&bounds, ctx);
+ item_padding = style->text.padding;
- /* NK_WINDOW_REMOVE_ROM flag was set so remove NK_WINDOW_ROM */
- if (layout->flags & NK_WINDOW_REMOVE_ROM) {
- layout->flags &= ~(nk_flags)NK_WINDOW_ROM;
- layout->flags &= ~(nk_flags)NK_WINDOW_REMOVE_ROM;
- }
- window->flags = layout->flags;
+ text.padding.x = item_padding.x;
+ text.padding.y = item_padding.y;
+ text.background = style->window.background;
+ text.text = color;
+ nk_widget_text_wrap(&win->buffer, bounds, str, len, &text, style->font);
+}
+#ifdef NK_INCLUDE_STANDARD_VARARGS
+NK_API void
+nk_labelf_colored(struct nk_context *ctx, nk_flags flags,
+ struct nk_color color, const char *fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ nk_labelfv_colored(ctx, flags, color, fmt, args);
+ va_end(args);
+}
+NK_API void
+nk_labelf_colored_wrap(struct nk_context *ctx, struct nk_color color,
+ const char *fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ nk_labelfv_colored_wrap(ctx, color, fmt, args);
+ va_end(args);
+}
+NK_API void
+nk_labelf(struct nk_context *ctx, nk_flags flags, const char *fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ nk_labelfv(ctx, flags, fmt, args);
+ va_end(args);
+}
+NK_API void
+nk_labelf_wrap(struct nk_context *ctx, const char *fmt,...)
+{
+ va_list args;
+ va_start(args, fmt);
+ nk_labelfv_wrap(ctx, fmt, args);
+ va_end(args);
+}
+NK_API void
+nk_labelfv_colored(struct nk_context *ctx, nk_flags flags,
+ struct nk_color color, const char *fmt, va_list args)
+{
+ char buf[256];
+ nk_strfmt(buf, NK_LEN(buf), fmt, args);
+ nk_label_colored(ctx, buf, flags, color);
+}
- /* property garbage collector */
- if (window->property.active && window->property.old != window->property.seq &&
- window->property.active == window->property.prev) {
- nk_zero(&window->property, sizeof(window->property));
- } else {
- window->property.old = window->property.seq;
- window->property.prev = window->property.active;
- window->property.seq = 0;
- }
- /* edit garbage collector */
- if (window->edit.active && window->edit.old != window->edit.seq &&
- window->edit.active == window->edit.prev) {
- nk_zero(&window->edit, sizeof(window->edit));
- } else {
- window->edit.old = window->edit.seq;
- window->edit.prev = window->edit.active;
- window->edit.seq = 0;
- }
- /* contextual garbage collector */
- if (window->popup.active_con && window->popup.con_old != window->popup.con_count) {
- window->popup.con_count = 0;
- window->popup.con_old = 0;
- window->popup.active_con = 0;
- } else {
- window->popup.con_old = window->popup.con_count;
- window->popup.con_count = 0;
- }
- window->popup.combo_count = 0;
- /* helper to make sure you have a 'nk_tree_push' for every 'nk_tree_pop' */
- NK_ASSERT(!layout->row.tree_depth);
+NK_API void
+nk_labelfv_colored_wrap(struct nk_context *ctx, struct nk_color color,
+ const char *fmt, va_list args)
+{
+ char buf[256];
+ nk_strfmt(buf, NK_LEN(buf), fmt, args);
+ nk_label_colored_wrap(ctx, buf, color);
}
-/* ----------------------------------------------------------------
- *
- * PAGE ELEMENT
- *
- * ---------------------------------------------------------------*/
-NK_INTERN struct nk_page_element*
-nk_create_page_element(struct nk_context *ctx)
+NK_API void
+nk_labelfv(struct nk_context *ctx, nk_flags flags, const char *fmt, va_list args)
{
- struct nk_page_element *elem;
- if (ctx->freelist) {
- /* unlink page element from free list */
- elem = ctx->freelist;
- ctx->freelist = elem->next;
- } else if (ctx->use_pool) {
- /* allocate page element from memory pool */
- elem = nk_pool_alloc(&ctx->pool);
- NK_ASSERT(elem);
- if (!elem) return 0;
- } else {
- /* allocate new page element from back of fixed size memory buffer */
- NK_STORAGE const nk_size size = sizeof(struct nk_page_element);
- NK_STORAGE const nk_size align = NK_ALIGNOF(struct nk_page_element);
- elem = (struct nk_page_element*)nk_buffer_alloc(&ctx->memory, NK_BUFFER_BACK, size, align);
- NK_ASSERT(elem);
- if (!elem) return 0;
- }
- nk_zero_struct(*elem);
- elem->next = 0;
- elem->prev = 0;
- return elem;
+ char buf[256];
+ nk_strfmt(buf, NK_LEN(buf), fmt, args);
+ nk_label(ctx, buf, flags);
}
-NK_INTERN void
-nk_link_page_element_into_freelist(struct nk_context *ctx,
- struct nk_page_element *elem)
+NK_API void
+nk_labelfv_wrap(struct nk_context *ctx, const char *fmt, va_list args)
{
- /* link table into freelist */
- if (!ctx->freelist) {
- ctx->freelist = elem;
- } else {
- elem->next = ctx->freelist;
- ctx->freelist = elem;
- }
+ char buf[256];
+ nk_strfmt(buf, NK_LEN(buf), fmt, args);
+ nk_label_wrap(ctx, buf);
}
-NK_INTERN void
-nk_free_page_element(struct nk_context *ctx, struct nk_page_element *elem)
+NK_API void
+nk_value_bool(struct nk_context *ctx, const char *prefix, int value)
{
- /* we have a pool so just add to free list */
- if (ctx->use_pool) {
- nk_link_page_element_into_freelist(ctx, elem);
- return;
- }
- /* if possible remove last element from back of fixed memory buffer */
- {void *elem_end = (void*)(elem + 1);
- void *buffer_end = (nk_byte*)ctx->memory.memory.ptr + ctx->memory.size;
- if (elem_end == buffer_end)
- ctx->memory.size -= sizeof(struct nk_page_element);
- else nk_link_page_element_into_freelist(ctx, elem);}
+ nk_labelf(ctx, NK_TEXT_LEFT, "%s: %s", prefix, ((value) ? "true": "false"));
+}
+NK_API void
+nk_value_int(struct nk_context *ctx, const char *prefix, int value)
+{
+ nk_labelf(ctx, NK_TEXT_LEFT, "%s: %d", prefix, value);
+}
+NK_API void
+nk_value_uint(struct nk_context *ctx, const char *prefix, unsigned int value)
+{
+ nk_labelf(ctx, NK_TEXT_LEFT, "%s: %u", prefix, value);
+}
+NK_API void
+nk_value_float(struct nk_context *ctx, const char *prefix, float value)
+{
+ double double_value = (double)value;
+ nk_labelf(ctx, NK_TEXT_LEFT, "%s: %.3f", prefix, double_value);
+}
+NK_API void
+nk_value_color_byte(struct nk_context *ctx, const char *p, struct nk_color c)
+{
+ nk_labelf(ctx, NK_TEXT_LEFT, "%s: (%d, %d, %d, %d)", p, c.r, c.g, c.b, c.a);
}
-
-/* ----------------------------------------------------------------
- *
- * PANEL
- *
- * ---------------------------------------------------------------*/
-NK_INTERN void*
-nk_create_panel(struct nk_context *ctx)
+NK_API void
+nk_value_color_float(struct nk_context *ctx, const char *p, struct nk_color color)
{
- struct nk_page_element *elem;
- elem = nk_create_page_element(ctx);
- if (!elem) return 0;
- nk_zero_struct(*elem);
- return &elem->data.pan;
+ double c[4]; nk_color_dv(c, color);
+ nk_labelf(ctx, NK_TEXT_LEFT, "%s: (%.2f, %.2f, %.2f, %.2f)",
+ p, c[0], c[1], c[2], c[3]);
}
-
-NK_INTERN void
-nk_free_panel(struct nk_context *ctx, struct nk_panel *pan)
+NK_API void
+nk_value_color_hex(struct nk_context *ctx, const char *prefix, struct nk_color color)
{
- union nk_page_data *pd = NK_CONTAINER_OF(pan, union nk_page_data, pan);
- struct nk_page_element *pe = NK_CONTAINER_OF(pd, struct nk_page_element, data);
- nk_free_page_element(ctx, pe);
+ char hex[16];
+ nk_color_hex_rgba(hex, color);
+ nk_labelf(ctx, NK_TEXT_LEFT, "%s: %s", prefix, hex);
}
-
-/* ----------------------------------------------------------------
- *
- * TABLES
- *
- * ---------------------------------------------------------------*/
-NK_INTERN struct nk_table*
-nk_create_table(struct nk_context *ctx)
+#endif
+NK_API void
+nk_text(struct nk_context *ctx, const char *str, int len, nk_flags alignment)
{
- struct nk_page_element *elem;
- elem = nk_create_page_element(ctx);
- if (!elem) return 0;
- nk_zero_struct(*elem);
- return &elem->data.tbl;
+ NK_ASSERT(ctx);
+ if (!ctx) return;
+ nk_text_colored(ctx, str, len, alignment, ctx->style.text.color);
}
-
-NK_INTERN void
-nk_free_table(struct nk_context *ctx, struct nk_table *tbl)
+NK_API void
+nk_text_wrap(struct nk_context *ctx, const char *str, int len)
{
- union nk_page_data *pd = NK_CONTAINER_OF(tbl, union nk_page_data, tbl);
- struct nk_page_element *pe = NK_CONTAINER_OF(pd, struct nk_page_element, data);
- nk_free_page_element(ctx, pe);
+ NK_ASSERT(ctx);
+ if (!ctx) return;
+ nk_text_wrap_colored(ctx, str, len, ctx->style.text.color);
}
-
-NK_INTERN void
-nk_push_table(struct nk_window *win, struct nk_table *tbl)
+NK_API void
+nk_label(struct nk_context *ctx, const char *str, nk_flags alignment)
{
- if (!win->tables) {
- win->tables = tbl;
- tbl->next = 0;
- tbl->prev = 0;
- tbl->size = 0;
- win->table_count = 1;
- return;
- }
- win->tables->prev = tbl;
- tbl->next = win->tables;
- tbl->prev = 0;
- tbl->size = 0;
- win->tables = tbl;
- win->table_count++;
+ nk_text(ctx, str, nk_strlen(str), alignment);
}
-
-NK_INTERN void
-nk_remove_table(struct nk_window *win, struct nk_table *tbl)
+NK_API void
+nk_label_colored(struct nk_context *ctx, const char *str, nk_flags align,
+ struct nk_color color)
{
- if (win->tables == tbl)
- win->tables = tbl->next;
- if (tbl->next)
- tbl->next->prev = tbl->prev;
- if (tbl->prev)
- tbl->prev->next = tbl->next;
- tbl->next = 0;
- tbl->prev = 0;
+ nk_text_colored(ctx, str, nk_strlen(str), align, color);
}
-
-NK_INTERN nk_uint*
-nk_add_value(struct nk_context *ctx, struct nk_window *win,
- nk_hash name, nk_uint value)
+NK_API void
+nk_label_wrap(struct nk_context *ctx, const char *str)
{
- NK_ASSERT(ctx);
- NK_ASSERT(win);
- if (!win || !ctx) return 0;
- if (!win->tables || win->tables->size >= NK_VALUE_PAGE_CAPACITY) {
- struct nk_table *tbl = nk_create_table(ctx);
- NK_ASSERT(tbl);
- if (!tbl) return 0;
- nk_push_table(win, tbl);
- }
- win->tables->seq = win->seq;
- win->tables->keys[win->tables->size] = name;
- win->tables->values[win->tables->size] = value;
- return &win->tables->values[win->tables->size++];
+ nk_text_wrap(ctx, str, nk_strlen(str));
}
-
-NK_INTERN nk_uint*
-nk_find_value(struct nk_window *win, nk_hash name)
+NK_API void
+nk_label_colored_wrap(struct nk_context *ctx, const char *str, struct nk_color color)
{
- struct nk_table *iter = win->tables;
- while (iter) {
- unsigned int i = 0;
- unsigned int size = iter->size;
- for (i = 0; i < size; ++i) {
- if (iter->keys[i] == name) {
- iter->seq = win->seq;
- return &iter->values[i];
- }
- } size = NK_VALUE_PAGE_CAPACITY;
- iter = iter->next;
- }
- return 0;
+ nk_text_wrap_colored(ctx, str, nk_strlen(str), color);
}
-/* ----------------------------------------------------------------
+
+
+
+
+/* ===============================================================
*
- * WINDOW
+ * IMAGE
*
- * ---------------------------------------------------------------*/
-NK_INTERN void*
-nk_create_window(struct nk_context *ctx)
+ * ===============================================================*/
+NK_API nk_handle
+nk_handle_ptr(void *ptr)
{
- struct nk_page_element *elem;
- elem = nk_create_page_element(ctx);
- if (!elem) return 0;
- elem->data.win.seq = ctx->seq;
- return &elem->data.win;
+ nk_handle handle = {0};
+ handle.ptr = ptr;
+ return handle;
}
-
-NK_INTERN void
-nk_free_window(struct nk_context *ctx, struct nk_window *win)
+NK_API nk_handle
+nk_handle_id(int id)
{
- /* unlink windows from list */
- struct nk_table *it = win->tables;
- if (win->popup.win) {
- nk_free_window(ctx, win->popup.win);
- win->popup.win = 0;
- }
- win->next = 0;
- win->prev = 0;
-
- while (it) {
- /*free window state tables */
- struct nk_table *n = it->next;
- nk_remove_table(win, it);
- nk_free_table(ctx, it);
- if (it == win->tables)
- win->tables = n;
- it = n;
- }
-
- /* link windows into freelist */
- {union nk_page_data *pd = NK_CONTAINER_OF(win, union nk_page_data, win);
- struct nk_page_element *pe = NK_CONTAINER_OF(pd, struct nk_page_element, data);
- nk_free_page_element(ctx, pe);}
+ nk_handle handle;
+ nk_zero_struct(handle);
+ handle.id = id;
+ return handle;
}
-
-NK_INTERN struct nk_window*
-nk_find_window(struct nk_context *ctx, nk_hash hash, const char *name)
+NK_API struct nk_image
+nk_subimage_ptr(void *ptr, unsigned short w, unsigned short h, struct nk_rect r)
{
- struct nk_window *iter;
- iter = ctx->begin;
- while (iter) {
- NK_ASSERT(iter != iter->next);
- if (iter->name == hash) {
- int max_len = nk_strlen(iter->name_string);
- if (!nk_stricmpn(iter->name_string, name, max_len))
- return iter;
- }
- iter = iter->next;
- }
- return 0;
+ struct nk_image s;
+ nk_zero(&s, sizeof(s));
+ s.handle.ptr = ptr;
+ s.w = w; s.h = h;
+ s.region[0] = (unsigned short)r.x;
+ s.region[1] = (unsigned short)r.y;
+ s.region[2] = (unsigned short)r.w;
+ s.region[3] = (unsigned short)r.h;
+ return s;
}
-
-enum nk_window_insert_location {
- NK_INSERT_BACK, /* inserts window into the back of list (front of screen) */
- NK_INSERT_FRONT /* inserts window into the front of list (back of screen) */
-};
-NK_INTERN void
-nk_insert_window(struct nk_context *ctx, struct nk_window *win,
- enum nk_window_insert_location loc)
+NK_API struct nk_image
+nk_subimage_id(int id, unsigned short w, unsigned short h, struct nk_rect r)
{
- const struct nk_window *iter;
- NK_ASSERT(ctx);
- NK_ASSERT(win);
- if (!win || !ctx) return;
-
- iter = ctx->begin;
- while (iter) {
- NK_ASSERT(iter != iter->next);
- NK_ASSERT(iter != win);
- if (iter == win) return;
- iter = iter->next;
- }
-
- if (!ctx->begin) {
- win->next = 0;
- win->prev = 0;
- ctx->begin = win;
- ctx->end = win;
- ctx->count = 1;
- return;
- }
- if (loc == NK_INSERT_BACK) {
- struct nk_window *end;
- end = ctx->end;
- end->flags |= NK_WINDOW_ROM;
- end->next = win;
- win->prev = ctx->end;
- win->next = 0;
- ctx->end = win;
- ctx->active = ctx->end;
- ctx->end->flags &= ~(nk_flags)NK_WINDOW_ROM;
- } else {
- ctx->end->flags |= NK_WINDOW_ROM;
- ctx->begin->prev = win;
- win->next = ctx->begin;
- win->prev = 0;
- ctx->begin = win;
- ctx->begin->flags &= ~(nk_flags)NK_WINDOW_ROM;
- }
- ctx->count++;
+ struct nk_image s;
+ nk_zero(&s, sizeof(s));
+ s.handle.id = id;
+ s.w = w; s.h = h;
+ s.region[0] = (unsigned short)r.x;
+ s.region[1] = (unsigned short)r.y;
+ s.region[2] = (unsigned short)r.w;
+ s.region[3] = (unsigned short)r.h;
+ return s;
}
-
-NK_INTERN void
-nk_remove_window(struct nk_context *ctx, struct nk_window *win)
+NK_API struct nk_image
+nk_subimage_handle(nk_handle handle, unsigned short w, unsigned short h,
+ struct nk_rect r)
{
- if (win == ctx->begin || win == ctx->end) {
- if (win == ctx->begin) {
- ctx->begin = win->next;
- if (win->next)
- win->next->prev = 0;
- }
- if (win == ctx->end) {
- ctx->end = win->prev;
- if (win->prev)
- win->prev->next = 0;
- }
- } else {
- if (win->next)
- win->next->prev = win->prev;
- if (win->prev)
- win->prev->next = win->next;
- }
- if (win == ctx->active || !ctx->active) {
- ctx->active = ctx->end;
- if (ctx->end)
- ctx->end->flags &= ~(nk_flags)NK_WINDOW_ROM;
- }
- win->next = 0;
- win->prev = 0;
- ctx->count--;
+ struct nk_image s;
+ nk_zero(&s, sizeof(s));
+ s.handle = handle;
+ s.w = w; s.h = h;
+ s.region[0] = (unsigned short)r.x;
+ s.region[1] = (unsigned short)r.y;
+ s.region[2] = (unsigned short)r.w;
+ s.region[3] = (unsigned short)r.h;
+ return s;
+}
+NK_API struct nk_image
+nk_image_handle(nk_handle handle)
+{
+ struct nk_image s;
+ nk_zero(&s, sizeof(s));
+ s.handle = handle;
+ s.w = 0; s.h = 0;
+ s.region[0] = 0;
+ s.region[1] = 0;
+ s.region[2] = 0;
+ s.region[3] = 0;
+ return s;
+}
+NK_API struct nk_image
+nk_image_ptr(void *ptr)
+{
+ struct nk_image s;
+ nk_zero(&s, sizeof(s));
+ NK_ASSERT(ptr);
+ s.handle.ptr = ptr;
+ s.w = 0; s.h = 0;
+ s.region[0] = 0;
+ s.region[1] = 0;
+ s.region[2] = 0;
+ s.region[3] = 0;
+ return s;
+}
+NK_API struct nk_image
+nk_image_id(int id)
+{
+ struct nk_image s;
+ nk_zero(&s, sizeof(s));
+ s.handle.id = id;
+ s.w = 0; s.h = 0;
+ s.region[0] = 0;
+ s.region[1] = 0;
+ s.region[2] = 0;
+ s.region[3] = 0;
+ return s;
}
-
NK_API int
-nk_begin(struct nk_context *ctx, const char *title,
- struct nk_rect bounds, nk_flags flags)
+nk_image_is_subimage(const struct nk_image* img)
{
- return nk_begin_titled(ctx, title, title, bounds, flags);
+ NK_ASSERT(img);
+ return !(img->w == 0 && img->h == 0);
}
+NK_API void
+nk_image(struct nk_context *ctx, struct nk_image img)
+{
+ struct nk_window *win;
+ struct nk_rect bounds;
-NK_API int
-nk_begin_titled(struct nk_context *ctx, const char *name, const char *title,
- struct nk_rect bounds, nk_flags flags)
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout) return;
+
+ win = ctx->current;
+ if (!nk_widget(&bounds, ctx)) return;
+ nk_draw_image(&win->buffer, bounds, &img, nk_white);
+}
+NK_API void
+nk_image_color(struct nk_context *ctx, struct nk_image img, struct nk_color col)
{
struct nk_window *win;
- struct nk_style *style;
- nk_hash title_hash;
- int title_len;
- int ret = 0;
+ struct nk_rect bounds;
NK_ASSERT(ctx);
- NK_ASSERT(name);
- NK_ASSERT(title);
- NK_ASSERT(ctx->style.font && ctx->style.font->width && "if this triggers you forgot to add a font");
- NK_ASSERT(!ctx->current && "if this triggers you missed a `nk_end` call");
- if (!ctx || ctx->current || !title || !name)
- return 0;
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout) return;
- /* find or create window */
- style = &ctx->style;
- title_len = (int)nk_strlen(name);
- title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE);
- win = nk_find_window(ctx, title_hash, name);
- if (!win) {
- /* create new window */
- nk_size name_length = (nk_size)nk_strlen(name);
- win = (struct nk_window*)nk_create_window(ctx);
- NK_ASSERT(win);
- if (!win) return 0;
+ win = ctx->current;
+ if (!nk_widget(&bounds, ctx)) return;
+ nk_draw_image(&win->buffer, bounds, &img, col);
+}
- if (flags & NK_WINDOW_BACKGROUND)
- nk_insert_window(ctx, win, NK_INSERT_FRONT);
- else nk_insert_window(ctx, win, NK_INSERT_BACK);
- nk_command_buffer_init(&win->buffer, &ctx->memory, NK_CLIPPING_ON);
- win->flags = flags;
- win->bounds = bounds;
- win->name = title_hash;
- name_length = NK_MIN(name_length, NK_WINDOW_MAX_NAME-1);
- NK_MEMCPY(win->name_string, name, name_length);
- win->name_string[name_length] = 0;
- win->popup.win = 0;
- if (!ctx->active)
- ctx->active = win;
- } else {
- /* update window */
- win->flags &= ~(nk_flags)(NK_WINDOW_PRIVATE-1);
- win->flags |= flags;
- if (!(win->flags & (NK_WINDOW_MOVABLE | NK_WINDOW_SCALABLE)))
- win->bounds = bounds;
- /* If this assert triggers you either:
- *
- * I.) Have more than one window with the same name or
- * II.) You forgot to actually draw the window.
- * More specific you did not call `nk_clear` (nk_clear will be
- * automatically called for you if you are using one of the
- * provided demo backends). */
- NK_ASSERT(win->seq != ctx->seq);
- win->seq = ctx->seq;
- if (!ctx->active && !(win->flags & NK_WINDOW_HIDDEN))
- ctx->active = win;
+
+
+
+/* ==============================================================
+ *
+ * BUTTON
+ *
+ * ===============================================================*/
+NK_LIB void
+nk_draw_symbol(struct nk_command_buffer *out, enum nk_symbol_type type,
+ struct nk_rect content, struct nk_color background, struct nk_color foreground,
+ float border_width, const struct nk_user_font *font)
+{
+ switch (type) {
+ case NK_SYMBOL_X:
+ case NK_SYMBOL_UNDERSCORE:
+ case NK_SYMBOL_PLUS:
+ case NK_SYMBOL_MINUS: {
+ /* single character text symbol */
+ const char *X = (type == NK_SYMBOL_X) ? "x":
+ (type == NK_SYMBOL_UNDERSCORE) ? "_":
+ (type == NK_SYMBOL_PLUS) ? "+": "-";
+ struct nk_text text;
+ text.padding = nk_vec2(0,0);
+ text.background = background;
+ text.text = foreground;
+ nk_widget_text(out, content, X, 1, &text, NK_TEXT_CENTERED, font);
+ } break;
+ case NK_SYMBOL_CIRCLE_SOLID:
+ case NK_SYMBOL_CIRCLE_OUTLINE:
+ case NK_SYMBOL_RECT_SOLID:
+ case NK_SYMBOL_RECT_OUTLINE: {
+ /* simple empty/filled shapes */
+ if (type == NK_SYMBOL_RECT_SOLID || type == NK_SYMBOL_RECT_OUTLINE) {
+ nk_fill_rect(out, content, 0, foreground);
+ if (type == NK_SYMBOL_RECT_OUTLINE)
+ nk_fill_rect(out, nk_shrink_rect(content, border_width), 0, background);
+ } else {
+ nk_fill_circle(out, content, foreground);
+ if (type == NK_SYMBOL_CIRCLE_OUTLINE)
+ nk_fill_circle(out, nk_shrink_rect(content, 1), background);
+ }
+ } break;
+ case NK_SYMBOL_TRIANGLE_UP:
+ case NK_SYMBOL_TRIANGLE_DOWN:
+ case NK_SYMBOL_TRIANGLE_LEFT:
+ case NK_SYMBOL_TRIANGLE_RIGHT: {
+ enum nk_heading heading;
+ struct nk_vec2 points[3];
+ heading = (type == NK_SYMBOL_TRIANGLE_RIGHT) ? NK_RIGHT :
+ (type == NK_SYMBOL_TRIANGLE_LEFT) ? NK_LEFT:
+ (type == NK_SYMBOL_TRIANGLE_UP) ? NK_UP: NK_DOWN;
+ nk_triangle_from_direction(points, content, 0, 0, heading);
+ nk_fill_triangle(out, points[0].x, points[0].y, points[1].x, points[1].y,
+ points[2].x, points[2].y, foreground);
+ } break;
+ default:
+ case NK_SYMBOL_NONE:
+ case NK_SYMBOL_MAX: break;
}
- if (win->flags & NK_WINDOW_HIDDEN) {
- ctx->current = win;
- win->layout = 0;
- return 0;
+}
+NK_LIB int
+nk_button_behavior(nk_flags *state, struct nk_rect r,
+ const struct nk_input *i, enum nk_button_behavior behavior)
+{
+ int ret = 0;
+ nk_widget_state_reset(state);
+ if (!i) return 0;
+ if (nk_input_is_mouse_hovering_rect(i, r)) {
+ *state = NK_WIDGET_STATE_HOVERED;
+ if (nk_input_is_mouse_down(i, NK_BUTTON_LEFT))
+ *state = NK_WIDGET_STATE_ACTIVE;
+ if (nk_input_has_mouse_click_in_rect(i, NK_BUTTON_LEFT, r)) {
+ ret = (behavior != NK_BUTTON_DEFAULT) ?
+ nk_input_is_mouse_down(i, NK_BUTTON_LEFT):
+#ifdef NK_BUTTON_TRIGGER_ON_RELEASE
+ nk_input_is_mouse_released(i, NK_BUTTON_LEFT);
+#else
+ nk_input_is_mouse_pressed(i, NK_BUTTON_LEFT);
+#endif
+ }
+ }
+ if (*state & NK_WIDGET_STATE_HOVER && !nk_input_is_mouse_prev_hovering_rect(i, r))
+ *state |= NK_WIDGET_STATE_ENTERED;
+ else if (nk_input_is_mouse_prev_hovering_rect(i, r))
+ *state |= NK_WIDGET_STATE_LEFT;
+ return ret;
+}
+NK_LIB const struct nk_style_item*
+nk_draw_button(struct nk_command_buffer *out,
+ const struct nk_rect *bounds, nk_flags state,
+ const struct nk_style_button *style)
+{
+ const struct nk_style_item *background;
+ if (state & NK_WIDGET_STATE_HOVER)
+ background = &style->hover;
+ else if (state & NK_WIDGET_STATE_ACTIVED)
+ background = &style->active;
+ else background = &style->normal;
+
+ if (background->type == NK_STYLE_ITEM_IMAGE) {
+ nk_draw_image(out, *bounds, &background->data.image, nk_white);
+ } else {
+ nk_fill_rect(out, *bounds, style->rounding, background->data.color);
+ nk_stroke_rect(out, *bounds, style->rounding, style->border, style->border_color);
}
+ return background;
+}
+NK_LIB int
+nk_do_button(nk_flags *state, struct nk_command_buffer *out, struct nk_rect r,
+ const struct nk_style_button *style, const struct nk_input *in,
+ enum nk_button_behavior behavior, struct nk_rect *content)
+{
+ struct nk_rect bounds;
+ NK_ASSERT(style);
+ NK_ASSERT(state);
+ NK_ASSERT(out);
+ if (!out || !style)
+ return nk_false;
- /* window overlapping */
- if (!(win->flags & NK_WINDOW_HIDDEN) && !(win->flags & NK_WINDOW_NO_INPUT))
- {
- int inpanel, ishovered;
- const struct nk_window *iter = win;
- float h = ctx->style.font->height + 2.0f * style->window.header.padding.y +
- (2.0f * style->window.header.label_padding.y);
- struct nk_rect win_bounds = (!(win->flags & NK_WINDOW_MINIMIZED))?
- win->bounds: nk_rect(win->bounds.x, win->bounds.y, win->bounds.w, h);
+ /* calculate button content space */
+ content->x = r.x + style->padding.x + style->border + style->rounding;
+ content->y = r.y + style->padding.y + style->border + style->rounding;
+ content->w = r.w - (2 * style->padding.x + style->border + style->rounding*2);
+ content->h = r.h - (2 * style->padding.y + style->border + style->rounding*2);
- /* activate window if hovered and no other window is overlapping this window */
- nk_start(ctx, win);
- inpanel = nk_input_has_mouse_click_down_in_rect(&ctx->input, NK_BUTTON_LEFT, win_bounds, nk_true);
- inpanel = inpanel && ctx->input.mouse.buttons[NK_BUTTON_LEFT].clicked;
- ishovered = nk_input_is_mouse_hovering_rect(&ctx->input, win_bounds);
- if ((win != ctx->active) && ishovered && !ctx->input.mouse.buttons[NK_BUTTON_LEFT].down) {
- iter = win->next;
- while (iter) {
- struct nk_rect iter_bounds = (!(iter->flags & NK_WINDOW_MINIMIZED))?
- iter->bounds: nk_rect(iter->bounds.x, iter->bounds.y, iter->bounds.w, h);
- if (NK_INTERSECT(win_bounds.x, win_bounds.y, win_bounds.w, win_bounds.h,
- iter_bounds.x, iter_bounds.y, iter_bounds.w, iter_bounds.h) &&
- (!(iter->flags & NK_WINDOW_HIDDEN) || !(iter->flags & NK_WINDOW_BACKGROUND)))
- break;
+ /* execute button behavior */
+ bounds.x = r.x - style->touch_padding.x;
+ bounds.y = r.y - style->touch_padding.y;
+ bounds.w = r.w + 2 * style->touch_padding.x;
+ bounds.h = r.h + 2 * style->touch_padding.y;
+ return nk_button_behavior(state, bounds, in, behavior);
+}
+NK_LIB void
+nk_draw_button_text(struct nk_command_buffer *out,
+ const struct nk_rect *bounds, const struct nk_rect *content, nk_flags state,
+ const struct nk_style_button *style, const char *txt, int len,
+ nk_flags text_alignment, const struct nk_user_font *font)
+{
+ struct nk_text text;
+ const struct nk_style_item *background;
+ background = nk_draw_button(out, bounds, state, style);
- if (iter->popup.win && iter->popup.active && !(iter->flags & NK_WINDOW_HIDDEN) &&
- NK_INTERSECT(win->bounds.x, win_bounds.y, win_bounds.w, win_bounds.h,
- iter->popup.win->bounds.x, iter->popup.win->bounds.y,
- iter->popup.win->bounds.w, iter->popup.win->bounds.h))
- break;
- iter = iter->next;
- }
- }
+ /* select correct colors/images */
+ if (background->type == NK_STYLE_ITEM_COLOR)
+ text.background = background->data.color;
+ else text.background = style->text_background;
+ if (state & NK_WIDGET_STATE_HOVER)
+ text.text = style->text_hover;
+ else if (state & NK_WIDGET_STATE_ACTIVED)
+ text.text = style->text_active;
+ else text.text = style->text_normal;
- /* activate window if clicked */
- if (iter && inpanel && (win != ctx->end) && !(iter->flags & NK_WINDOW_BACKGROUND)) {
- iter = win->next;
- while (iter) {
- /* try to find a panel with higher priority in the same position */
- struct nk_rect iter_bounds = (!(iter->flags & NK_WINDOW_MINIMIZED))?
- iter->bounds: nk_rect(iter->bounds.x, iter->bounds.y, iter->bounds.w, h);
- if (NK_INBOX(ctx->input.mouse.pos.x, ctx->input.mouse.pos.y,
- iter_bounds.x, iter_bounds.y, iter_bounds.w, iter_bounds.h) &&
- !(iter->flags & NK_WINDOW_HIDDEN))
- break;
- if (iter->popup.win && iter->popup.active && !(iter->flags & NK_WINDOW_HIDDEN) &&
- NK_INTERSECT(win_bounds.x, win_bounds.y, win_bounds.w, win_bounds.h,
- iter->popup.win->bounds.x, iter->popup.win->bounds.y,
- iter->popup.win->bounds.w, iter->popup.win->bounds.h))
- break;
- iter = iter->next;
- }
- }
+ text.padding = nk_vec2(0,0);
+ nk_widget_text(out, *content, txt, len, &text, text_alignment, font);
+}
+NK_LIB int
+nk_do_button_text(nk_flags *state,
+ struct nk_command_buffer *out, struct nk_rect bounds,
+ const char *string, int len, nk_flags align, enum nk_button_behavior behavior,
+ const struct nk_style_button *style, const struct nk_input *in,
+ const struct nk_user_font *font)
+{
+ struct nk_rect content;
+ int ret = nk_false;
- if (!iter && ctx->end != win) {
- if (!(win->flags & NK_WINDOW_BACKGROUND)) {
- /* current window is active in that position so transfer to top
- * at the highest priority in stack */
- nk_remove_window(ctx, win);
- nk_insert_window(ctx, win, NK_INSERT_BACK);
- }
- win->flags &= ~(nk_flags)NK_WINDOW_ROM;
- ctx->active = win;
- }
- if (ctx->end != win && !(win->flags & NK_WINDOW_BACKGROUND))
- win->flags |= NK_WINDOW_ROM;
- }
+ NK_ASSERT(state);
+ NK_ASSERT(style);
+ NK_ASSERT(out);
+ NK_ASSERT(string);
+ NK_ASSERT(font);
+ if (!out || !style || !font || !string)
+ return nk_false;
- win->layout = (struct nk_panel*)nk_create_panel(ctx);
- ctx->current = win;
- ret = nk_panel_begin(ctx, title, NK_PANEL_WINDOW);
- win->layout->offset_x = &win->scrollbar.x;
- win->layout->offset_y = &win->scrollbar.y;
+ ret = nk_do_button(state, out, bounds, style, in, behavior, &content);
+ if (style->draw_begin) style->draw_begin(out, style->userdata);
+ nk_draw_button_text(out, &bounds, &content, *state, style, string, len, align, font);
+ if (style->draw_end) style->draw_end(out, style->userdata);
return ret;
}
-
-NK_API void
-nk_end(struct nk_context *ctx)
+NK_LIB void
+nk_draw_button_symbol(struct nk_command_buffer *out,
+ const struct nk_rect *bounds, const struct nk_rect *content,
+ nk_flags state, const struct nk_style_button *style,
+ enum nk_symbol_type type, const struct nk_user_font *font)
{
- struct nk_panel *layout;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current && "if this triggers you forgot to call `nk_begin`");
- if (!ctx || !ctx->current)
- return;
+ struct nk_color sym, bg;
+ const struct nk_style_item *background;
- layout = ctx->current->layout;
- if (!layout || (layout->type == NK_PANEL_WINDOW && (ctx->current->flags & NK_WINDOW_HIDDEN))) {
- ctx->current = 0;
- return;
- }
- nk_panel_end(ctx);
- nk_free_panel(ctx, ctx->current->layout);
- ctx->current = 0;
+ /* select correct colors/images */
+ background = nk_draw_button(out, bounds, state, style);
+ if (background->type == NK_STYLE_ITEM_COLOR)
+ bg = background->data.color;
+ else bg = style->text_background;
+
+ if (state & NK_WIDGET_STATE_HOVER)
+ sym = style->text_hover;
+ else if (state & NK_WIDGET_STATE_ACTIVED)
+ sym = style->text_active;
+ else sym = style->text_normal;
+ nk_draw_symbol(out, type, *content, bg, sym, 1, font);
}
+NK_LIB int
+nk_do_button_symbol(nk_flags *state,
+ struct nk_command_buffer *out, struct nk_rect bounds,
+ enum nk_symbol_type symbol, enum nk_button_behavior behavior,
+ const struct nk_style_button *style, const struct nk_input *in,
+ const struct nk_user_font *font)
+{
+ int ret;
+ struct nk_rect content;
-NK_API struct nk_rect
-nk_window_get_bounds(const struct nk_context *ctx)
+ NK_ASSERT(state);
+ NK_ASSERT(style);
+ NK_ASSERT(font);
+ NK_ASSERT(out);
+ if (!out || !style || !font || !state)
+ return nk_false;
+
+ ret = nk_do_button(state, out, bounds, style, in, behavior, &content);
+ if (style->draw_begin) style->draw_begin(out, style->userdata);
+ nk_draw_button_symbol(out, &bounds, &content, *state, style, symbol, font);
+ if (style->draw_end) style->draw_end(out, style->userdata);
+ return ret;
+}
+NK_LIB void
+nk_draw_button_image(struct nk_command_buffer *out,
+ const struct nk_rect *bounds, const struct nk_rect *content,
+ nk_flags state, const struct nk_style_button *style, const struct nk_image *img)
{
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current) return nk_rect(0,0,0,0);
- return ctx->current->bounds;
+ nk_draw_button(out, bounds, state, style);
+ nk_draw_image(out, *content, img, nk_white);
}
+NK_LIB int
+nk_do_button_image(nk_flags *state,
+ struct nk_command_buffer *out, struct nk_rect bounds,
+ struct nk_image img, enum nk_button_behavior b,
+ const struct nk_style_button *style, const struct nk_input *in)
+{
+ int ret;
+ struct nk_rect content;
-NK_API struct nk_vec2
-nk_window_get_position(const struct nk_context *ctx)
+ NK_ASSERT(state);
+ NK_ASSERT(style);
+ NK_ASSERT(out);
+ if (!out || !style || !state)
+ return nk_false;
+
+ ret = nk_do_button(state, out, bounds, style, in, b, &content);
+ content.x += style->image_padding.x;
+ content.y += style->image_padding.y;
+ content.w -= 2 * style->image_padding.x;
+ content.h -= 2 * style->image_padding.y;
+
+ if (style->draw_begin) style->draw_begin(out, style->userdata);
+ nk_draw_button_image(out, &bounds, &content, *state, style, &img);
+ if (style->draw_end) style->draw_end(out, style->userdata);
+ return ret;
+}
+NK_LIB void
+nk_draw_button_text_symbol(struct nk_command_buffer *out,
+ const struct nk_rect *bounds, const struct nk_rect *label,
+ const struct nk_rect *symbol, nk_flags state, const struct nk_style_button *style,
+ const char *str, int len, enum nk_symbol_type type,
+ const struct nk_user_font *font)
{
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current) return nk_vec2(0,0);
- return nk_vec2(ctx->current->bounds.x, ctx->current->bounds.y);
+ struct nk_color sym;
+ struct nk_text text;
+ const struct nk_style_item *background;
+
+ /* select correct background colors/images */
+ background = nk_draw_button(out, bounds, state, style);
+ if (background->type == NK_STYLE_ITEM_COLOR)
+ text.background = background->data.color;
+ else text.background = style->text_background;
+
+ /* select correct text colors */
+ if (state & NK_WIDGET_STATE_HOVER) {
+ sym = style->text_hover;
+ text.text = style->text_hover;
+ } else if (state & NK_WIDGET_STATE_ACTIVED) {
+ sym = style->text_active;
+ text.text = style->text_active;
+ } else {
+ sym = style->text_normal;
+ text.text = style->text_normal;
+ }
+
+ text.padding = nk_vec2(0,0);
+ nk_draw_symbol(out, type, *symbol, style->text_background, sym, 0, font);
+ nk_widget_text(out, *label, str, len, &text, NK_TEXT_CENTERED, font);
}
-
-NK_API struct nk_vec2
-nk_window_get_size(const struct nk_context *ctx)
+NK_LIB int
+nk_do_button_text_symbol(nk_flags *state,
+ struct nk_command_buffer *out, struct nk_rect bounds,
+ enum nk_symbol_type symbol, const char *str, int len, nk_flags align,
+ enum nk_button_behavior behavior, const struct nk_style_button *style,
+ const struct nk_user_font *font, const struct nk_input *in)
{
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current) return nk_vec2(0,0);
- return nk_vec2(ctx->current->bounds.w, ctx->current->bounds.h);
-}
+ int ret;
+ struct nk_rect tri = {0,0,0,0};
+ struct nk_rect content;
-NK_API float
-nk_window_get_width(const struct nk_context *ctx)
-{
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current) return 0;
- return ctx->current->bounds.w;
-}
+ NK_ASSERT(style);
+ NK_ASSERT(out);
+ NK_ASSERT(font);
+ if (!out || !style || !font)
+ return nk_false;
-NK_API float
-nk_window_get_height(const struct nk_context *ctx)
-{
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current) return 0;
- return ctx->current->bounds.h;
-}
+ ret = nk_do_button(state, out, bounds, style, in, behavior, &content);
+ tri.y = content.y + (content.h/2) - font->height/2;
+ tri.w = font->height; tri.h = font->height;
+ if (align & NK_TEXT_ALIGN_LEFT) {
+ tri.x = (content.x + content.w) - (2 * style->padding.x + tri.w);
+ tri.x = NK_MAX(tri.x, 0);
+ } else tri.x = content.x + 2 * style->padding.x;
-NK_API struct nk_rect
-nk_window_get_content_region(struct nk_context *ctx)
-{
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current) return nk_rect(0,0,0,0);
- return ctx->current->layout->clip;
+ /* draw button */
+ if (style->draw_begin) style->draw_begin(out, style->userdata);
+ nk_draw_button_text_symbol(out, &bounds, &content, &tri,
+ *state, style, str, len, symbol, font);
+ if (style->draw_end) style->draw_end(out, style->userdata);
+ return ret;
}
-
-NK_API struct nk_vec2
-nk_window_get_content_region_min(struct nk_context *ctx)
+NK_LIB void
+nk_draw_button_text_image(struct nk_command_buffer *out,
+ const struct nk_rect *bounds, const struct nk_rect *label,
+ const struct nk_rect *image, nk_flags state, const struct nk_style_button *style,
+ const char *str, int len, const struct nk_user_font *font,
+ const struct nk_image *img)
{
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current) return nk_vec2(0,0);
- return nk_vec2(ctx->current->layout->clip.x, ctx->current->layout->clip.y);
-}
+ struct nk_text text;
+ const struct nk_style_item *background;
+ background = nk_draw_button(out, bounds, state, style);
-NK_API struct nk_vec2
-nk_window_get_content_region_max(struct nk_context *ctx)
-{
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current) return nk_vec2(0,0);
- return nk_vec2(ctx->current->layout->clip.x + ctx->current->layout->clip.w,
- ctx->current->layout->clip.y + ctx->current->layout->clip.h);
-}
+ /* select correct colors */
+ if (background->type == NK_STYLE_ITEM_COLOR)
+ text.background = background->data.color;
+ else text.background = style->text_background;
+ if (state & NK_WIDGET_STATE_HOVER)
+ text.text = style->text_hover;
+ else if (state & NK_WIDGET_STATE_ACTIVED)
+ text.text = style->text_active;
+ else text.text = style->text_normal;
-NK_API struct nk_vec2
-nk_window_get_content_region_size(struct nk_context *ctx)
-{
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current) return nk_vec2(0,0);
- return nk_vec2(ctx->current->layout->clip.w, ctx->current->layout->clip.h);
+ text.padding = nk_vec2(0,0);
+ nk_widget_text(out, *label, str, len, &text, NK_TEXT_CENTERED, font);
+ nk_draw_image(out, *image, img, nk_white);
}
-
-NK_API struct nk_command_buffer*
-nk_window_get_canvas(struct nk_context *ctx)
+NK_LIB int
+nk_do_button_text_image(nk_flags *state,
+ struct nk_command_buffer *out, struct nk_rect bounds,
+ struct nk_image img, const char* str, int len, nk_flags align,
+ enum nk_button_behavior behavior, const struct nk_style_button *style,
+ const struct nk_user_font *font, const struct nk_input *in)
{
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current) return 0;
- return &ctx->current->buffer;
-}
+ int ret;
+ struct nk_rect icon;
+ struct nk_rect content;
-NK_API struct nk_panel*
-nk_window_get_panel(struct nk_context *ctx)
-{
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current) return 0;
- return ctx->current->layout;
-}
+ NK_ASSERT(style);
+ NK_ASSERT(state);
+ NK_ASSERT(font);
+ NK_ASSERT(out);
+ if (!out || !font || !style || !str)
+ return nk_false;
-NK_API int
-nk_window_has_focus(const struct nk_context *ctx)
-{
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current) return 0;
- return ctx->current == ctx->active;
-}
+ ret = nk_do_button(state, out, bounds, style, in, behavior, &content);
+ icon.y = bounds.y + style->padding.y;
+ icon.w = icon.h = bounds.h - 2 * style->padding.y;
+ if (align & NK_TEXT_ALIGN_LEFT) {
+ icon.x = (bounds.x + bounds.w) - (2 * style->padding.x + icon.w);
+ icon.x = NK_MAX(icon.x, 0);
+ } else icon.x = bounds.x + 2 * style->padding.x;
-NK_API int
-nk_window_is_hovered(struct nk_context *ctx)
-{
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current) return 0;
- return nk_input_is_mouse_hovering_rect(&ctx->input, ctx->current->bounds);
-}
+ icon.x += style->image_padding.x;
+ icon.y += style->image_padding.y;
+ icon.w -= 2 * style->image_padding.x;
+ icon.h -= 2 * style->image_padding.y;
-NK_API int
-nk_window_is_any_hovered(struct nk_context *ctx)
+ if (style->draw_begin) style->draw_begin(out, style->userdata);
+ nk_draw_button_text_image(out, &bounds, &content, &icon, *state, style, str, len, font, &img);
+ if (style->draw_end) style->draw_end(out, style->userdata);
+ return ret;
+}
+NK_API void
+nk_button_set_behavior(struct nk_context *ctx, enum nk_button_behavior behavior)
{
- struct nk_window *iter;
NK_ASSERT(ctx);
- if (!ctx) return 0;
- iter = ctx->begin;
- while (iter) {
- /* check if window is being hovered */
- if (iter->flags & NK_WINDOW_MINIMIZED) {
- struct nk_rect header = iter->bounds;
- header.h = ctx->style.font->height + 2 * ctx->style.window.header.padding.y;
- if (nk_input_is_mouse_hovering_rect(&ctx->input, header))
- return 1;
- } else if (nk_input_is_mouse_hovering_rect(&ctx->input, iter->bounds)) {
- return 1;
- }
- /* check if window popup is being hovered */
- if (iter->popup.active && iter->popup.win && nk_input_is_mouse_hovering_rect(&ctx->input, iter->popup.win->bounds))
- return 1;
- iter = iter->next;
- }
- return 0;
+ if (!ctx) return;
+ ctx->button_behavior = behavior;
}
-
NK_API int
-nk_item_is_any_active(struct nk_context *ctx)
+nk_button_push_behavior(struct nk_context *ctx, enum nk_button_behavior behavior)
{
- int any_hovered = nk_window_is_any_hovered(ctx);
- int any_active = (ctx->last_widget_state & NK_WIDGET_STATE_MODIFIED);
- return any_hovered || any_active;
-}
+ struct nk_config_stack_button_behavior *button_stack;
+ struct nk_config_stack_button_behavior_element *element;
-NK_API int
-nk_window_is_collapsed(struct nk_context *ctx, const char *name)
-{
- int title_len;
- nk_hash title_hash;
- struct nk_window *win;
NK_ASSERT(ctx);
if (!ctx) return 0;
- title_len = (int)nk_strlen(name);
- title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE);
- win = nk_find_window(ctx, title_hash, name);
- if (!win) return 0;
- return win->flags & NK_WINDOW_MINIMIZED;
-}
-
-NK_API int
-nk_window_is_closed(struct nk_context *ctx, const char *name)
-{
- int title_len;
- nk_hash title_hash;
- struct nk_window *win;
- NK_ASSERT(ctx);
- if (!ctx) return 1;
+ button_stack = &ctx->stacks.button_behaviors;
+ NK_ASSERT(button_stack->head < (int)NK_LEN(button_stack->elements));
+ if (button_stack->head >= (int)NK_LEN(button_stack->elements))
+ return 0;
- title_len = (int)nk_strlen(name);
- title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE);
- win = nk_find_window(ctx, title_hash, name);
- if (!win) return 1;
- return (win->flags & NK_WINDOW_CLOSED);
+ element = &button_stack->elements[button_stack->head++];
+ element->address = &ctx->button_behavior;
+ element->old_value = ctx->button_behavior;
+ ctx->button_behavior = behavior;
+ return 1;
}
-
NK_API int
-nk_window_is_hidden(struct nk_context *ctx, const char *name)
+nk_button_pop_behavior(struct nk_context *ctx)
{
- int title_len;
- nk_hash title_hash;
- struct nk_window *win;
+ struct nk_config_stack_button_behavior *button_stack;
+ struct nk_config_stack_button_behavior_element *element;
+
NK_ASSERT(ctx);
- if (!ctx) return 1;
+ if (!ctx) return 0;
- title_len = (int)nk_strlen(name);
- title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE);
- win = nk_find_window(ctx, title_hash, name);
- if (!win) return 1;
- return (win->flags & NK_WINDOW_HIDDEN);
-}
+ button_stack = &ctx->stacks.button_behaviors;
+ NK_ASSERT(button_stack->head > 0);
+ if (button_stack->head < 1)
+ return 0;
+ element = &button_stack->elements[--button_stack->head];
+ *element->address = element->old_value;
+ return 1;
+}
NK_API int
-nk_window_is_active(struct nk_context *ctx, const char *name)
+nk_button_text_styled(struct nk_context *ctx,
+ const struct nk_style_button *style, const char *title, int len)
{
- int title_len;
- nk_hash title_hash;
struct nk_window *win;
+ struct nk_panel *layout;
+ const struct nk_input *in;
+
+ struct nk_rect bounds;
+ enum nk_widget_layout_states state;
+
NK_ASSERT(ctx);
- if (!ctx) return 0;
+ NK_ASSERT(style);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!style || !ctx || !ctx->current || !ctx->current->layout) return 0;
- title_len = (int)nk_strlen(name);
- title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE);
- win = nk_find_window(ctx, title_hash, name);
- if (!win) return 0;
- return win == ctx->active;
-}
+ win = ctx->current;
+ layout = win->layout;
+ state = nk_widget(&bounds, ctx);
-NK_API struct nk_window*
-nk_window_find(struct nk_context *ctx, const char *name)
-{
- int title_len;
- nk_hash title_hash;
- title_len = (int)nk_strlen(name);
- title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE);
- return nk_find_window(ctx, title_hash, name);
+ if (!state) return 0;
+ in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+ return nk_do_button_text(&ctx->last_widget_state, &win->buffer, bounds,
+ title, len, style->text_alignment, ctx->button_behavior,
+ style, in, ctx->style.font);
}
-
-NK_API void
-nk_window_close(struct nk_context *ctx, const char *name)
+NK_API int
+nk_button_text(struct nk_context *ctx, const char *title, int len)
{
- struct nk_window *win;
NK_ASSERT(ctx);
- if (!ctx) return;
- win = nk_window_find(ctx, name);
- if (!win) return;
- NK_ASSERT(ctx->current != win && "You cannot close a currently active window");
- if (ctx->current == win) return;
- win->flags |= NK_WINDOW_HIDDEN;
- win->flags |= NK_WINDOW_CLOSED;
-}
-
-NK_API void
-nk_window_set_bounds(struct nk_context *ctx, struct nk_rect bounds)
-{
- NK_ASSERT(ctx); NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current) return;
- ctx->current->bounds = bounds;
+ if (!ctx) return 0;
+ return nk_button_text_styled(ctx, &ctx->style.button, title, len);
}
-
-NK_API void
-nk_window_set_position(struct nk_context *ctx, struct nk_vec2 pos)
+NK_API int nk_button_label_styled(struct nk_context *ctx,
+ const struct nk_style_button *style, const char *title)
{
- NK_ASSERT(ctx); NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current) return;
- ctx->current->bounds.x = pos.x;
- ctx->current->bounds.y = pos.y;
+ return nk_button_text_styled(ctx, style, title, nk_strlen(title));
}
-
-NK_API void
-nk_window_set_size(struct nk_context *ctx, struct nk_vec2 size)
+NK_API int nk_button_label(struct nk_context *ctx, const char *title)
{
- NK_ASSERT(ctx); NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current) return;
- ctx->current->bounds.w = size.x;
- ctx->current->bounds.h = size.y;
+ return nk_button_text(ctx, title, nk_strlen(title));
}
-
-NK_API void
-nk_window_collapse(struct nk_context *ctx, const char *name,
- enum nk_collapse_states c)
+NK_API int
+nk_button_color(struct nk_context *ctx, struct nk_color color)
{
- int title_len;
- nk_hash title_hash;
struct nk_window *win;
- NK_ASSERT(ctx);
- if (!ctx) return;
+ struct nk_panel *layout;
+ const struct nk_input *in;
+ struct nk_style_button button;
- title_len = (int)nk_strlen(name);
- title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE);
- win = nk_find_window(ctx, title_hash, name);
- if (!win) return;
- if (c == NK_MINIMIZED)
- win->flags |= NK_WINDOW_MINIMIZED;
- else win->flags &= ~(nk_flags)NK_WINDOW_MINIMIZED;
-}
+ int ret = 0;
+ struct nk_rect bounds;
+ struct nk_rect content;
+ enum nk_widget_layout_states state;
-NK_API void
-nk_window_collapse_if(struct nk_context *ctx, const char *name,
- enum nk_collapse_states c, int cond)
-{
NK_ASSERT(ctx);
- if (!ctx || !cond) return;
- nk_window_collapse(ctx, name, c);
-}
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout)
+ return 0;
-NK_API void
-nk_window_show(struct nk_context *ctx, const char *name, enum nk_show_states s)
-{
- int title_len;
- nk_hash title_hash;
- struct nk_window *win;
- NK_ASSERT(ctx);
- if (!ctx) return;
+ win = ctx->current;
+ layout = win->layout;
- title_len = (int)nk_strlen(name);
- title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE);
- win = nk_find_window(ctx, title_hash, name);
- if (!win) return;
- if (s == NK_HIDDEN) {
- win->flags |= NK_WINDOW_HIDDEN;
- } else win->flags &= ~(nk_flags)NK_WINDOW_HIDDEN;
-}
+ state = nk_widget(&bounds, ctx);
+ if (!state) return 0;
+ in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
-NK_API void
-nk_window_show_if(struct nk_context *ctx, const char *name,
- enum nk_show_states s, int cond)
-{
- NK_ASSERT(ctx);
- if (!ctx || !cond) return;
- nk_window_show(ctx, name, s);
+ button = ctx->style.button;
+ button.normal = nk_style_item_color(color);
+ button.hover = nk_style_item_color(color);
+ button.active = nk_style_item_color(color);
+ ret = nk_do_button(&ctx->last_widget_state, &win->buffer, bounds,
+ &button, in, ctx->button_behavior, &content);
+ nk_draw_button(&win->buffer, &bounds, ctx->last_widget_state, &button);
+ return ret;
}
-
-NK_API void
-nk_window_set_focus(struct nk_context *ctx, const char *name)
+NK_API int
+nk_button_symbol_styled(struct nk_context *ctx,
+ const struct nk_style_button *style, enum nk_symbol_type symbol)
{
- int title_len;
- nk_hash title_hash;
struct nk_window *win;
- NK_ASSERT(ctx);
- if (!ctx) return;
+ struct nk_panel *layout;
+ const struct nk_input *in;
- title_len = (int)nk_strlen(name);
- title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE);
- win = nk_find_window(ctx, title_hash, name);
- if (win && ctx->end != win) {
- nk_remove_window(ctx, win);
- nk_insert_window(ctx, win, NK_INSERT_BACK);
- }
- ctx->active = win;
-}
+ struct nk_rect bounds;
+ enum nk_widget_layout_states state;
-/*----------------------------------------------------------------
- *
- * MENUBAR
- *
- * --------------------------------------------------------------*/
-NK_API void
-nk_menubar_begin(struct nk_context *ctx)
-{
- struct nk_panel *layout;
NK_ASSERT(ctx);
NK_ASSERT(ctx->current);
NK_ASSERT(ctx->current->layout);
if (!ctx || !ctx->current || !ctx->current->layout)
- return;
-
- layout = ctx->current->layout;
- NK_ASSERT(layout->at_y == layout->bounds.y);
- /* if this assert triggers you allocated space between nk_begin and nk_menubar_begin.
- If you want a menubar the first nuklear function after `nk_begin` has to be a
- `nk_menubar_begin` call. Inside the menubar you then have to allocate space for
- widgets (also supports multiple rows).
- Example:
- if (nk_begin(...)) {
- nk_menubar_begin(...);
- nk_layout_xxxx(...);
- nk_button(...);
- nk_layout_xxxx(...);
- nk_button(...);
- nk_menubar_end(...);
- }
- nk_end(...);
- */
- if (layout->flags & NK_WINDOW_HIDDEN || layout->flags & NK_WINDOW_MINIMIZED)
- return;
+ return 0;
- layout->menu.x = layout->at_x;
- layout->menu.y = layout->at_y + layout->row.height;
- layout->menu.w = layout->bounds.w;
- layout->menu.offset.x = *layout->offset_x;
- layout->menu.offset.y = *layout->offset_y;
- *layout->offset_y = 0;
+ win = ctx->current;
+ layout = win->layout;
+ state = nk_widget(&bounds, ctx);
+ if (!state) return 0;
+ in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+ return nk_do_button_symbol(&ctx->last_widget_state, &win->buffer, bounds,
+ symbol, ctx->button_behavior, style, in, ctx->style.font);
}
-
-NK_API void
-nk_menubar_end(struct nk_context *ctx)
+NK_API int
+nk_button_symbol(struct nk_context *ctx, enum nk_symbol_type symbol)
+{
+ NK_ASSERT(ctx);
+ if (!ctx) return 0;
+ return nk_button_symbol_styled(ctx, &ctx->style.button, symbol);
+}
+NK_API int
+nk_button_image_styled(struct nk_context *ctx, const struct nk_style_button *style,
+ struct nk_image img)
{
struct nk_window *win;
struct nk_panel *layout;
- struct nk_command_buffer *out;
+ const struct nk_input *in;
+
+ struct nk_rect bounds;
+ enum nk_widget_layout_states state;
NK_ASSERT(ctx);
NK_ASSERT(ctx->current);
NK_ASSERT(ctx->current->layout);
if (!ctx || !ctx->current || !ctx->current->layout)
- return;
+ return 0;
win = ctx->current;
- out = &win->buffer;
layout = win->layout;
- if (layout->flags & NK_WINDOW_HIDDEN || layout->flags & NK_WINDOW_MINIMIZED)
- return;
-
- layout->menu.h = layout->at_y - layout->menu.y;
- layout->bounds.y += layout->menu.h + ctx->style.window.spacing.y + layout->row.height;
- layout->bounds.h -= layout->menu.h + ctx->style.window.spacing.y + layout->row.height;
- *layout->offset_x = layout->menu.offset.x;
- *layout->offset_y = layout->menu.offset.y;
- layout->at_y = layout->bounds.y - layout->row.height;
-
- layout->clip.y = layout->bounds.y;
- layout->clip.h = layout->bounds.h;
- nk_push_scissor(out, layout->clip);
+ state = nk_widget(&bounds, ctx);
+ if (!state) return 0;
+ in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+ return nk_do_button_image(&ctx->last_widget_state, &win->buffer, bounds,
+ img, ctx->button_behavior, style, in);
}
-/* -------------------------------------------------------------
- *
- * LAYOUT
- *
- * --------------------------------------------------------------*/
-NK_API void
-nk_layout_set_min_row_height(struct nk_context *ctx, float height)
+NK_API int
+nk_button_image(struct nk_context *ctx, struct nk_image img)
+{
+ NK_ASSERT(ctx);
+ if (!ctx) return 0;
+ return nk_button_image_styled(ctx, &ctx->style.button, img);
+}
+NK_API int
+nk_button_symbol_text_styled(struct nk_context *ctx,
+ const struct nk_style_button *style, enum nk_symbol_type symbol,
+ const char *text, int len, nk_flags align)
{
struct nk_window *win;
struct nk_panel *layout;
+ const struct nk_input *in;
+
+ struct nk_rect bounds;
+ enum nk_widget_layout_states state;
NK_ASSERT(ctx);
NK_ASSERT(ctx->current);
NK_ASSERT(ctx->current->layout);
if (!ctx || !ctx->current || !ctx->current->layout)
- return;
+ return 0;
win = ctx->current;
layout = win->layout;
- layout->row.min_height = height;
-}
-NK_API void
-nk_layout_reset_min_row_height(struct nk_context *ctx)
+ state = nk_widget(&bounds, ctx);
+ if (!state) return 0;
+ in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+ return nk_do_button_text_symbol(&ctx->last_widget_state, &win->buffer, bounds,
+ symbol, text, len, align, ctx->button_behavior,
+ style, ctx->style.font, in);
+}
+NK_API int
+nk_button_symbol_text(struct nk_context *ctx, enum nk_symbol_type symbol,
+ const char* text, int len, nk_flags align)
+{
+ NK_ASSERT(ctx);
+ if (!ctx) return 0;
+ return nk_button_symbol_text_styled(ctx, &ctx->style.button, symbol, text, len, align);
+}
+NK_API int nk_button_symbol_label(struct nk_context *ctx, enum nk_symbol_type symbol,
+ const char *label, nk_flags align)
+{
+ return nk_button_symbol_text(ctx, symbol, label, nk_strlen(label), align);
+}
+NK_API int nk_button_symbol_label_styled(struct nk_context *ctx,
+ const struct nk_style_button *style, enum nk_symbol_type symbol,
+ const char *title, nk_flags align)
+{
+ return nk_button_symbol_text_styled(ctx, style, symbol, title, nk_strlen(title), align);
+}
+NK_API int
+nk_button_image_text_styled(struct nk_context *ctx,
+ const struct nk_style_button *style, struct nk_image img, const char *text,
+ int len, nk_flags align)
{
struct nk_window *win;
struct nk_panel *layout;
+ const struct nk_input *in;
+
+ struct nk_rect bounds;
+ enum nk_widget_layout_states state;
NK_ASSERT(ctx);
NK_ASSERT(ctx->current);
NK_ASSERT(ctx->current->layout);
if (!ctx || !ctx->current || !ctx->current->layout)
- return;
+ return 0;
win = ctx->current;
layout = win->layout;
- layout->row.min_height = ctx->style.font->height;
- layout->row.min_height += ctx->style.text.padding.y*2;
- layout->row.min_height += ctx->style.window.min_row_height_padding*2;
-}
-NK_INTERN float
-nk_layout_row_calculate_usable_space(const struct nk_style *style, enum nk_panel_type type,
- float total_space, int columns)
+ state = nk_widget(&bounds, ctx);
+ if (!state) return 0;
+ in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+ return nk_do_button_text_image(&ctx->last_widget_state, &win->buffer,
+ bounds, img, text, len, align, ctx->button_behavior,
+ style, ctx->style.font, in);
+}
+NK_API int
+nk_button_image_text(struct nk_context *ctx, struct nk_image img,
+ const char *text, int len, nk_flags align)
{
- float panel_padding;
- float panel_spacing;
- float panel_space;
+ return nk_button_image_text_styled(ctx, &ctx->style.button,img, text, len, align);
+}
+NK_API int nk_button_image_label(struct nk_context *ctx, struct nk_image img,
+ const char *label, nk_flags align)
+{
+ return nk_button_image_text(ctx, img, label, nk_strlen(label), align);
+}
+NK_API int nk_button_image_label_styled(struct nk_context *ctx,
+ const struct nk_style_button *style, struct nk_image img,
+ const char *label, nk_flags text_alignment)
+{
+ return nk_button_image_text_styled(ctx, style, img, label, nk_strlen(label), text_alignment);
+}
- struct nk_vec2 spacing;
- struct nk_vec2 padding;
- spacing = style->window.spacing;
- padding = nk_panel_get_padding(style, type);
- /* calculate the usable panel space */
- panel_padding = 2 * padding.x;
- panel_spacing = (float)NK_MAX(columns - 1, 0) * spacing.x;
- panel_space = total_space - panel_padding - panel_spacing;
- return panel_space;
-}
-NK_INTERN void
-nk_panel_layout(const struct nk_context *ctx, struct nk_window *win,
- float height, int cols)
-{
- struct nk_panel *layout;
- const struct nk_style *style;
- struct nk_command_buffer *out;
- struct nk_vec2 item_spacing;
- struct nk_color color;
+/* ===============================================================
+ *
+ * TOGGLE
+ *
+ * ===============================================================*/
+NK_LIB int
+nk_toggle_behavior(const struct nk_input *in, struct nk_rect select,
+ nk_flags *state, int active)
+{
+ nk_widget_state_reset(state);
+ if (nk_button_behavior(state, select, in, NK_BUTTON_DEFAULT)) {
+ *state = NK_WIDGET_STATE_ACTIVE;
+ active = !active;
+ }
+ if (*state & NK_WIDGET_STATE_HOVER && !nk_input_is_mouse_prev_hovering_rect(in, select))
+ *state |= NK_WIDGET_STATE_ENTERED;
+ else if (nk_input_is_mouse_prev_hovering_rect(in, select))
+ *state |= NK_WIDGET_STATE_LEFT;
+ return active;
+}
+NK_LIB void
+nk_draw_checkbox(struct nk_command_buffer *out,
+ nk_flags state, const struct nk_style_toggle *style, int active,
+ const struct nk_rect *label, const struct nk_rect *selector,
+ const struct nk_rect *cursors, const char *string, int len,
+ const struct nk_user_font *font)
+{
+ const struct nk_style_item *background;
+ const struct nk_style_item *cursor;
+ struct nk_text text;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
+ /* select correct colors/images */
+ if (state & NK_WIDGET_STATE_HOVER) {
+ background = &style->hover;
+ cursor = &style->cursor_hover;
+ text.text = style->text_hover;
+ } else if (state & NK_WIDGET_STATE_ACTIVED) {
+ background = &style->hover;
+ cursor = &style->cursor_hover;
+ text.text = style->text_active;
+ } else {
+ background = &style->normal;
+ cursor = &style->cursor_normal;
+ text.text = style->text_normal;
+ }
- /* prefetch some configuration data */
- layout = win->layout;
- style = &ctx->style;
- out = &win->buffer;
- color = style->window.background;
- item_spacing = style->window.spacing;
+ /* draw background and cursor */
+ if (background->type == NK_STYLE_ITEM_COLOR) {
+ nk_fill_rect(out, *selector, 0, style->border_color);
+ nk_fill_rect(out, nk_shrink_rect(*selector, style->border), 0, background->data.color);
+ } else nk_draw_image(out, *selector, &background->data.image, nk_white);
+ if (active) {
+ if (cursor->type == NK_STYLE_ITEM_IMAGE)
+ nk_draw_image(out, *cursors, &cursor->data.image, nk_white);
+ else nk_fill_rect(out, *cursors, 0, cursor->data.color);
+ }
- /* if one of these triggers you forgot to add an `if` condition around either
- a window, group, popup, combobox or contextual menu `begin` and `end` block.
- Example:
- if (nk_begin(...) {...} nk_end(...); or
- if (nk_group_begin(...) { nk_group_end(...);} */
- NK_ASSERT(!(layout->flags & NK_WINDOW_MINIMIZED));
- NK_ASSERT(!(layout->flags & NK_WINDOW_HIDDEN));
- NK_ASSERT(!(layout->flags & NK_WINDOW_CLOSED));
+ text.padding.x = 0;
+ text.padding.y = 0;
+ text.background = style->text_background;
+ nk_widget_text(out, *label, string, len, &text, NK_TEXT_LEFT, font);
+}
+NK_LIB void
+nk_draw_option(struct nk_command_buffer *out,
+ nk_flags state, const struct nk_style_toggle *style, int active,
+ const struct nk_rect *label, const struct nk_rect *selector,
+ const struct nk_rect *cursors, const char *string, int len,
+ const struct nk_user_font *font)
+{
+ const struct nk_style_item *background;
+ const struct nk_style_item *cursor;
+ struct nk_text text;
- /* update the current row and set the current row layout */
- layout->row.index = 0;
- layout->at_y += layout->row.height;
- layout->row.columns = cols;
- if (height == 0.0f)
- layout->row.height = NK_MAX(height, layout->row.min_height) + item_spacing.y;
- else layout->row.height = height + item_spacing.y;
+ /* select correct colors/images */
+ if (state & NK_WIDGET_STATE_HOVER) {
+ background = &style->hover;
+ cursor = &style->cursor_hover;
+ text.text = style->text_hover;
+ } else if (state & NK_WIDGET_STATE_ACTIVED) {
+ background = &style->hover;
+ cursor = &style->cursor_hover;
+ text.text = style->text_active;
+ } else {
+ background = &style->normal;
+ cursor = &style->cursor_normal;
+ text.text = style->text_normal;
+ }
- layout->row.item_offset = 0;
- if (layout->flags & NK_WINDOW_DYNAMIC) {
- /* draw background for dynamic panels */
- struct nk_rect background;
- background.x = win->bounds.x;
- background.w = win->bounds.w;
- background.y = layout->at_y - 1.0f;
- background.h = layout->row.height + 1.0f;
- nk_fill_rect(out, background, 0, color);
+ /* draw background and cursor */
+ if (background->type == NK_STYLE_ITEM_COLOR) {
+ nk_fill_circle(out, *selector, style->border_color);
+ nk_fill_circle(out, nk_shrink_rect(*selector, style->border), background->data.color);
+ } else nk_draw_image(out, *selector, &background->data.image, nk_white);
+ if (active) {
+ if (cursor->type == NK_STYLE_ITEM_IMAGE)
+ nk_draw_image(out, *cursors, &cursor->data.image, nk_white);
+ else nk_fill_circle(out, *cursors, cursor->data.color);
}
-}
-NK_INTERN void
-nk_row_layout(struct nk_context *ctx, enum nk_layout_format fmt,
- float height, int cols, int width)
+ text.padding.x = 0;
+ text.padding.y = 0;
+ text.background = style->text_background;
+ nk_widget_text(out, *label, string, len, &text, NK_TEXT_LEFT, font);
+}
+NK_LIB int
+nk_do_toggle(nk_flags *state,
+ struct nk_command_buffer *out, struct nk_rect r,
+ int *active, const char *str, int len, enum nk_toggle_type type,
+ const struct nk_style_toggle *style, const struct nk_input *in,
+ const struct nk_user_font *font)
{
- /* update the current row and set the current row layout */
- struct nk_window *win;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
+ int was_active;
+ struct nk_rect bounds;
+ struct nk_rect select;
+ struct nk_rect cursor;
+ struct nk_rect label;
+
+ NK_ASSERT(style);
+ NK_ASSERT(out);
+ NK_ASSERT(font);
+ if (!out || !style || !font || !active)
+ return 0;
+
+ r.w = NK_MAX(r.w, font->height + 2 * style->padding.x);
+ r.h = NK_MAX(r.h, font->height + 2 * style->padding.y);
- win = ctx->current;
- nk_panel_layout(ctx, win, height, cols);
- if (fmt == NK_DYNAMIC)
- win->layout->row.type = NK_LAYOUT_DYNAMIC_FIXED;
- else win->layout->row.type = NK_LAYOUT_STATIC_FIXED;
+ /* add additional touch padding for touch screen devices */
+ bounds.x = r.x - style->touch_padding.x;
+ bounds.y = r.y - style->touch_padding.y;
+ bounds.w = r.w + 2 * style->touch_padding.x;
+ bounds.h = r.h + 2 * style->touch_padding.y;
- win->layout->row.ratio = 0;
- win->layout->row.filled = 0;
- win->layout->row.item_offset = 0;
- win->layout->row.item_width = (float)width;
-}
+ /* calculate the selector space */
+ select.w = font->height;
+ select.h = select.w;
+ select.y = r.y + r.h/2.0f - select.h/2.0f;
+ select.x = r.x;
-NK_API float
-nk_layout_ratio_from_pixel(struct nk_context *ctx, float pixel_width)
-{
- struct nk_window *win;
- NK_ASSERT(ctx);
- NK_ASSERT(pixel_width);
- if (!ctx || !ctx->current || !ctx->current->layout) return 0;
- win = ctx->current;
- return NK_CLAMP(0.0f, pixel_width/win->bounds.x, 1.0f);
-}
+ /* calculate the bounds of the cursor inside the selector */
+ cursor.x = select.x + style->padding.x + style->border;
+ cursor.y = select.y + style->padding.y + style->border;
+ cursor.w = select.w - (2 * style->padding.x + 2 * style->border);
+ cursor.h = select.h - (2 * style->padding.y + 2 * style->border);
-NK_API void
-nk_layout_row_dynamic(struct nk_context *ctx, float height, int cols)
-{
- nk_row_layout(ctx, NK_DYNAMIC, height, cols, 0);
-}
+ /* label behind the selector */
+ label.x = select.x + select.w + style->spacing;
+ label.y = select.y;
+ label.w = NK_MAX(r.x + r.w, label.x) - label.x;
+ label.h = select.w;
-NK_API void
-nk_layout_row_static(struct nk_context *ctx, float height, int item_width, int cols)
-{
- nk_row_layout(ctx, NK_STATIC, height, cols, item_width);
-}
+ /* update selector */
+ was_active = *active;
+ *active = nk_toggle_behavior(in, bounds, state, *active);
-NK_API void
-nk_layout_row_begin(struct nk_context *ctx, enum nk_layout_format fmt,
- float row_height, int cols)
+ /* draw selector */
+ if (style->draw_begin)
+ style->draw_begin(out, style->userdata);
+ if (type == NK_TOGGLE_CHECK) {
+ nk_draw_checkbox(out, *state, style, *active, &label, &select, &cursor, str, len, font);
+ } else {
+ nk_draw_option(out, *state, style, *active, &label, &select, &cursor, str, len, font);
+ }
+ if (style->draw_end)
+ style->draw_end(out, style->userdata);
+ return (was_active != *active);
+}
+/*----------------------------------------------------------------
+ *
+ * CHECKBOX
+ *
+ * --------------------------------------------------------------*/
+NK_API int
+nk_check_text(struct nk_context *ctx, const char *text, int len, int active)
{
struct nk_window *win;
struct nk_panel *layout;
+ const struct nk_input *in;
+ const struct nk_style *style;
+
+ struct nk_rect bounds;
+ enum nk_widget_layout_states state;
NK_ASSERT(ctx);
NK_ASSERT(ctx->current);
NK_ASSERT(ctx->current->layout);
if (!ctx || !ctx->current || !ctx->current->layout)
- return;
+ return active;
win = ctx->current;
+ style = &ctx->style;
layout = win->layout;
- nk_panel_layout(ctx, win, row_height, cols);
- if (fmt == NK_DYNAMIC)
- layout->row.type = NK_LAYOUT_DYNAMIC_ROW;
- else layout->row.type = NK_LAYOUT_STATIC_ROW;
- layout->row.ratio = 0;
- layout->row.filled = 0;
- layout->row.item_width = 0;
- layout->row.item_offset = 0;
- layout->row.columns = cols;
+ state = nk_widget(&bounds, ctx);
+ if (!state) return active;
+ in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+ nk_do_toggle(&ctx->last_widget_state, &win->buffer, bounds, &active,
+ text, len, NK_TOGGLE_CHECK, &style->checkbox, in, style->font);
+ return active;
}
-
-NK_API void
-nk_layout_row_push(struct nk_context *ctx, float ratio_or_width)
+NK_API unsigned int
+nk_check_flags_text(struct nk_context *ctx, const char *text, int len,
+ unsigned int flags, unsigned int value)
{
- struct nk_window *win;
- struct nk_panel *layout;
-
+ int old_active;
NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
-
- win = ctx->current;
- layout = win->layout;
- NK_ASSERT(layout->row.type == NK_LAYOUT_STATIC_ROW || layout->row.type == NK_LAYOUT_DYNAMIC_ROW);
- if (layout->row.type != NK_LAYOUT_STATIC_ROW && layout->row.type != NK_LAYOUT_DYNAMIC_ROW)
- return;
-
- if (layout->row.type == NK_LAYOUT_DYNAMIC_ROW) {
- float ratio = ratio_or_width;
- if ((ratio + layout->row.filled) > 1.0f) return;
- if (ratio > 0.0f)
- layout->row.item_width = NK_SATURATE(ratio);
- else layout->row.item_width = 1.0f - layout->row.filled;
- } else layout->row.item_width = ratio_or_width;
+ NK_ASSERT(text);
+ if (!ctx || !text) return flags;
+ old_active = (int)((flags & value) & value);
+ if (nk_check_text(ctx, text, len, old_active))
+ flags |= value;
+ else flags &= ~value;
+ return flags;
}
-
-NK_API void
-nk_layout_row_end(struct nk_context *ctx)
+NK_API int
+nk_checkbox_text(struct nk_context *ctx, const char *text, int len, int *active)
{
- struct nk_window *win;
- struct nk_panel *layout;
-
+ int old_val;
NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
-
- win = ctx->current;
- layout = win->layout;
- NK_ASSERT(layout->row.type == NK_LAYOUT_STATIC_ROW || layout->row.type == NK_LAYOUT_DYNAMIC_ROW);
- if (layout->row.type != NK_LAYOUT_STATIC_ROW && layout->row.type != NK_LAYOUT_DYNAMIC_ROW)
- return;
- layout->row.item_width = 0;
- layout->row.item_offset = 0;
+ NK_ASSERT(text);
+ NK_ASSERT(active);
+ if (!ctx || !text || !active) return 0;
+ old_val = *active;
+ *active = nk_check_text(ctx, text, len, *active);
+ return old_val != *active;
}
-
-NK_API void
-nk_layout_row(struct nk_context *ctx, enum nk_layout_format fmt,
- float height, int cols, const float *ratio)
+NK_API int
+nk_checkbox_flags_text(struct nk_context *ctx, const char *text, int len,
+ unsigned int *flags, unsigned int value)
{
- int i;
- int n_undef = 0;
- struct nk_window *win;
- struct nk_panel *layout;
-
+ int active;
NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
+ NK_ASSERT(text);
+ NK_ASSERT(flags);
+ if (!ctx || !text || !flags) return 0;
- win = ctx->current;
- layout = win->layout;
- nk_panel_layout(ctx, win, height, cols);
- if (fmt == NK_DYNAMIC) {
- /* calculate width of undefined widget ratios */
- float r = 0;
- layout->row.ratio = ratio;
- for (i = 0; i < cols; ++i) {
- if (ratio[i] < 0.0f)
- n_undef++;
- else r += ratio[i];
- }
- r = NK_SATURATE(1.0f - r);
- layout->row.type = NK_LAYOUT_DYNAMIC;
- layout->row.item_width = (r > 0 && n_undef > 0) ? (r / (float)n_undef):0;
- } else {
- layout->row.ratio = ratio;
- layout->row.type = NK_LAYOUT_STATIC;
- layout->row.item_width = 0;
- layout->row.item_offset = 0;
+ active = (int)((*flags & value) & value);
+ if (nk_checkbox_text(ctx, text, len, &active)) {
+ if (active) *flags |= value;
+ else *flags &= ~value;
+ return 1;
}
- layout->row.item_offset = 0;
- layout->row.filled = 0;
+ return 0;
}
-
-NK_API void
-nk_layout_row_template_begin(struct nk_context *ctx, float height)
+NK_API int nk_check_label(struct nk_context *ctx, const char *label, int active)
{
- struct nk_window *win;
- struct nk_panel *layout;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
-
- win = ctx->current;
- layout = win->layout;
- nk_panel_layout(ctx, win, height, 1);
- layout->row.type = NK_LAYOUT_TEMPLATE;
- layout->row.columns = 0;
- layout->row.ratio = 0;
- layout->row.item_width = 0;
- layout->row.item_height = 0;
- layout->row.item_offset = 0;
- layout->row.filled = 0;
- layout->row.item.x = 0;
- layout->row.item.y = 0;
- layout->row.item.w = 0;
- layout->row.item.h = 0;
+ return nk_check_text(ctx, label, nk_strlen(label), active);
}
-
-NK_API void
-nk_layout_row_template_push_dynamic(struct nk_context *ctx)
+NK_API unsigned int nk_check_flags_label(struct nk_context *ctx, const char *label,
+ unsigned int flags, unsigned int value)
+{
+ return nk_check_flags_text(ctx, label, nk_strlen(label), flags, value);
+}
+NK_API int nk_checkbox_label(struct nk_context *ctx, const char *label, int *active)
+{
+ return nk_checkbox_text(ctx, label, nk_strlen(label), active);
+}
+NK_API int nk_checkbox_flags_label(struct nk_context *ctx, const char *label,
+ unsigned int *flags, unsigned int value)
+{
+ return nk_checkbox_flags_text(ctx, label, nk_strlen(label), flags, value);
+}
+/*----------------------------------------------------------------
+ *
+ * OPTION
+ *
+ * --------------------------------------------------------------*/
+NK_API int
+nk_option_text(struct nk_context *ctx, const char *text, int len, int is_active)
{
struct nk_window *win;
struct nk_panel *layout;
+ const struct nk_input *in;
+ const struct nk_style *style;
+
+ struct nk_rect bounds;
+ enum nk_widget_layout_states state;
NK_ASSERT(ctx);
NK_ASSERT(ctx->current);
NK_ASSERT(ctx->current->layout);
if (!ctx || !ctx->current || !ctx->current->layout)
- return;
+ return is_active;
win = ctx->current;
+ style = &ctx->style;
layout = win->layout;
- NK_ASSERT(layout->row.type == NK_LAYOUT_TEMPLATE);
- NK_ASSERT(layout->row.columns < NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS);
- if (layout->row.type != NK_LAYOUT_TEMPLATE) return;
- if (layout->row.columns >= NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS) return;
- layout->row.templates[layout->row.columns++] = -1.0f;
-}
-NK_API void
-nk_layout_row_template_push_variable(struct nk_context *ctx, float min_width)
+ state = nk_widget(&bounds, ctx);
+ if (!state) return (int)state;
+ in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+ nk_do_toggle(&ctx->last_widget_state, &win->buffer, bounds, &is_active,
+ text, len, NK_TOGGLE_OPTION, &style->option, in, style->font);
+ return is_active;
+}
+NK_API int
+nk_radio_text(struct nk_context *ctx, const char *text, int len, int *active)
{
- struct nk_window *win;
- struct nk_panel *layout;
-
+ int old_value;
NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
-
- win = ctx->current;
- layout = win->layout;
- NK_ASSERT(layout->row.type == NK_LAYOUT_TEMPLATE);
- NK_ASSERT(layout->row.columns < NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS);
- if (layout->row.type != NK_LAYOUT_TEMPLATE) return;
- if (layout->row.columns >= NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS) return;
- layout->row.templates[layout->row.columns++] = -min_width;
+ NK_ASSERT(text);
+ NK_ASSERT(active);
+ if (!ctx || !text || !active) return 0;
+ old_value = *active;
+ *active = nk_option_text(ctx, text, len, old_value);
+ return old_value != *active;
}
-
-NK_API void
-nk_layout_row_template_push_static(struct nk_context *ctx, float width)
+NK_API int
+nk_option_label(struct nk_context *ctx, const char *label, int active)
{
- struct nk_window *win;
- struct nk_panel *layout;
+ return nk_option_text(ctx, label, nk_strlen(label), active);
+}
+NK_API int
+nk_radio_label(struct nk_context *ctx, const char *label, int *active)
+{
+ return nk_radio_text(ctx, label, nk_strlen(label), active);
+}
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
- win = ctx->current;
- layout = win->layout;
- NK_ASSERT(layout->row.type == NK_LAYOUT_TEMPLATE);
- NK_ASSERT(layout->row.columns < NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS);
- if (layout->row.type != NK_LAYOUT_TEMPLATE) return;
- if (layout->row.columns >= NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS) return;
- layout->row.templates[layout->row.columns++] = width;
-}
-NK_API void
-nk_layout_row_template_end(struct nk_context *ctx)
-{
- struct nk_window *win;
- struct nk_panel *layout;
- int i = 0;
- int variable_count = 0;
- int min_variable_count = 0;
- float min_fixed_width = 0.0f;
- float total_fixed_width = 0.0f;
- float max_variable_width = 0.0f;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
+/* ===============================================================
+ *
+ * SELECTABLE
+ *
+ * ===============================================================*/
+NK_LIB void
+nk_draw_selectable(struct nk_command_buffer *out,
+ nk_flags state, const struct nk_style_selectable *style, int active,
+ const struct nk_rect *bounds,
+ const struct nk_rect *icon, const struct nk_image *img, enum nk_symbol_type sym,
+ const char *string, int len, nk_flags align, const struct nk_user_font *font)
+{
+ const struct nk_style_item *background;
+ struct nk_text text;
+ text.padding = style->padding;
- win = ctx->current;
- layout = win->layout;
- NK_ASSERT(layout->row.type == NK_LAYOUT_TEMPLATE);
- if (layout->row.type != NK_LAYOUT_TEMPLATE) return;
- for (i = 0; i < layout->row.columns; ++i) {
- float width = layout->row.templates[i];
- if (width >= 0.0f) {
- total_fixed_width += width;
- min_fixed_width += width;
- } else if (width < -1.0f) {
- width = -width;
- total_fixed_width += width;
- max_variable_width = NK_MAX(max_variable_width, width);
- variable_count++;
+ /* select correct colors/images */
+ if (!active) {
+ if (state & NK_WIDGET_STATE_ACTIVED) {
+ background = &style->pressed;
+ text.text = style->text_pressed;
+ } else if (state & NK_WIDGET_STATE_HOVER) {
+ background = &style->hover;
+ text.text = style->text_hover;
} else {
- min_variable_count++;
- variable_count++;
+ background = &style->normal;
+ text.text = style->text_normal;
}
- }
- if (variable_count) {
- float space = nk_layout_row_calculate_usable_space(&ctx->style, layout->type,
- layout->bounds.w, layout->row.columns);
- float var_width = (NK_MAX(space-min_fixed_width,0.0f)) / (float)variable_count;
- int enough_space = var_width >= max_variable_width;
- if (!enough_space)
- var_width = (NK_MAX(space-total_fixed_width,0)) / (float)min_variable_count;
- for (i = 0; i < layout->row.columns; ++i) {
- float *width = &layout->row.templates[i];
- *width = (*width >= 0.0f)? *width: (*width < -1.0f && !enough_space)? -(*width): var_width;
+ } else {
+ if (state & NK_WIDGET_STATE_ACTIVED) {
+ background = &style->pressed_active;
+ text.text = style->text_pressed_active;
+ } else if (state & NK_WIDGET_STATE_HOVER) {
+ background = &style->hover_active;
+ text.text = style->text_hover_active;
+ } else {
+ background = &style->normal_active;
+ text.text = style->text_normal_active;
}
}
+ /* draw selectable background and text */
+ if (background->type == NK_STYLE_ITEM_IMAGE) {
+ nk_draw_image(out, *bounds, &background->data.image, nk_white);
+ text.background = nk_rgba(0,0,0,0);
+ } else {
+ nk_fill_rect(out, *bounds, style->rounding, background->data.color);
+ text.background = background->data.color;
+ }
+ if (icon) {
+ if (img) nk_draw_image(out, *icon, img, nk_white);
+ else nk_draw_symbol(out, sym, *icon, text.background, text.text, 1, font);
+ }
+ nk_widget_text(out, *bounds, string, len, &text, align, font);
}
+NK_LIB int
+nk_do_selectable(nk_flags *state, struct nk_command_buffer *out,
+ struct nk_rect bounds, const char *str, int len, nk_flags align, int *value,
+ const struct nk_style_selectable *style, const struct nk_input *in,
+ const struct nk_user_font *font)
+{
+ int old_value;
+ struct nk_rect touch;
-NK_API void
-nk_layout_space_begin(struct nk_context *ctx, enum nk_layout_format fmt,
- float height, int widget_count)
+ NK_ASSERT(state);
+ NK_ASSERT(out);
+ NK_ASSERT(str);
+ NK_ASSERT(len);
+ NK_ASSERT(value);
+ NK_ASSERT(style);
+ NK_ASSERT(font);
+
+ if (!state || !out || !str || !len || !value || !style || !font) return 0;
+ old_value = *value;
+
+ /* remove padding */
+ touch.x = bounds.x - style->touch_padding.x;
+ touch.y = bounds.y - style->touch_padding.y;
+ touch.w = bounds.w + style->touch_padding.x * 2;
+ touch.h = bounds.h + style->touch_padding.y * 2;
+
+ /* update button */
+ if (nk_button_behavior(state, touch, in, NK_BUTTON_DEFAULT))
+ *value = !(*value);
+
+ /* draw selectable */
+ if (style->draw_begin) style->draw_begin(out, style->userdata);
+ nk_draw_selectable(out, *state, style, *value, &bounds, 0,0,NK_SYMBOL_NONE, str, len, align, font);
+ if (style->draw_end) style->draw_end(out, style->userdata);
+ return old_value != *value;
+}
+NK_LIB int
+nk_do_selectable_image(nk_flags *state, struct nk_command_buffer *out,
+ struct nk_rect bounds, const char *str, int len, nk_flags align, int *value,
+ const struct nk_image *img, const struct nk_style_selectable *style,
+ const struct nk_input *in, const struct nk_user_font *font)
{
- struct nk_window *win;
- struct nk_panel *layout;
+ int old_value;
+ struct nk_rect touch;
+ struct nk_rect icon;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
+ NK_ASSERT(state);
+ NK_ASSERT(out);
+ NK_ASSERT(str);
+ NK_ASSERT(len);
+ NK_ASSERT(value);
+ NK_ASSERT(style);
+ NK_ASSERT(font);
+
+ if (!state || !out || !str || !len || !value || !style || !font) return 0;
+ old_value = *value;
+
+ /* toggle behavior */
+ touch.x = bounds.x - style->touch_padding.x;
+ touch.y = bounds.y - style->touch_padding.y;
+ touch.w = bounds.w + style->touch_padding.x * 2;
+ touch.h = bounds.h + style->touch_padding.y * 2;
+ if (nk_button_behavior(state, touch, in, NK_BUTTON_DEFAULT))
+ *value = !(*value);
+
+ icon.y = bounds.y + style->padding.y;
+ icon.w = icon.h = bounds.h - 2 * style->padding.y;
+ if (align & NK_TEXT_ALIGN_LEFT) {
+ icon.x = (bounds.x + bounds.w) - (2 * style->padding.x + icon.w);
+ icon.x = NK_MAX(icon.x, 0);
+ } else icon.x = bounds.x + 2 * style->padding.x;
+
+ icon.x += style->image_padding.x;
+ icon.y += style->image_padding.y;
+ icon.w -= 2 * style->image_padding.x;
+ icon.h -= 2 * style->image_padding.y;
+
+ /* draw selectable */
+ if (style->draw_begin) style->draw_begin(out, style->userdata);
+ nk_draw_selectable(out, *state, style, *value, &bounds, &icon, img, NK_SYMBOL_NONE, str, len, align, font);
+ if (style->draw_end) style->draw_end(out, style->userdata);
+ return old_value != *value;
+}
+NK_LIB int
+nk_do_selectable_symbol(nk_flags *state, struct nk_command_buffer *out,
+ struct nk_rect bounds, const char *str, int len, nk_flags align, int *value,
+ enum nk_symbol_type sym, const struct nk_style_selectable *style,
+ const struct nk_input *in, const struct nk_user_font *font)
+{
+ int old_value;
+ struct nk_rect touch;
+ struct nk_rect icon;
+
+ NK_ASSERT(state);
+ NK_ASSERT(out);
+ NK_ASSERT(str);
+ NK_ASSERT(len);
+ NK_ASSERT(value);
+ NK_ASSERT(style);
+ NK_ASSERT(font);
- win = ctx->current;
- layout = win->layout;
- nk_panel_layout(ctx, win, height, widget_count);
- if (fmt == NK_STATIC)
- layout->row.type = NK_LAYOUT_STATIC_FREE;
- else layout->row.type = NK_LAYOUT_DYNAMIC_FREE;
+ if (!state || !out || !str || !len || !value || !style || !font) return 0;
+ old_value = *value;
- layout->row.ratio = 0;
- layout->row.filled = 0;
- layout->row.item_width = 0;
- layout->row.item_offset = 0;
-}
+ /* toggle behavior */
+ touch.x = bounds.x - style->touch_padding.x;
+ touch.y = bounds.y - style->touch_padding.y;
+ touch.w = bounds.w + style->touch_padding.x * 2;
+ touch.h = bounds.h + style->touch_padding.y * 2;
+ if (nk_button_behavior(state, touch, in, NK_BUTTON_DEFAULT))
+ *value = !(*value);
-NK_API void
-nk_layout_space_end(struct nk_context *ctx)
-{
- struct nk_window *win;
- struct nk_panel *layout;
+ icon.y = bounds.y + style->padding.y;
+ icon.w = icon.h = bounds.h - 2 * style->padding.y;
+ if (align & NK_TEXT_ALIGN_LEFT) {
+ icon.x = (bounds.x + bounds.w) - (2 * style->padding.x + icon.w);
+ icon.x = NK_MAX(icon.x, 0);
+ } else icon.x = bounds.x + 2 * style->padding.x;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
+ icon.x += style->image_padding.x;
+ icon.y += style->image_padding.y;
+ icon.w -= 2 * style->image_padding.x;
+ icon.h -= 2 * style->image_padding.y;
- win = ctx->current;
- layout = win->layout;
- layout->row.item_width = 0;
- layout->row.item_height = 0;
- layout->row.item_offset = 0;
- nk_zero(&layout->row.item, sizeof(layout->row.item));
+ /* draw selectable */
+ if (style->draw_begin) style->draw_begin(out, style->userdata);
+ nk_draw_selectable(out, *state, style, *value, &bounds, &icon, 0, sym, str, len, align, font);
+ if (style->draw_end) style->draw_end(out, style->userdata);
+ return old_value != *value;
}
-NK_API void
-nk_layout_space_push(struct nk_context *ctx, struct nk_rect rect)
+NK_API int
+nk_selectable_text(struct nk_context *ctx, const char *str, int len,
+ nk_flags align, int *value)
{
struct nk_window *win;
struct nk_panel *layout;
+ const struct nk_input *in;
+ const struct nk_style *style;
+
+ enum nk_widget_layout_states state;
+ struct nk_rect bounds;
NK_ASSERT(ctx);
+ NK_ASSERT(value);
NK_ASSERT(ctx->current);
NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
+ if (!ctx || !ctx->current || !ctx->current->layout || !value)
+ return 0;
win = ctx->current;
layout = win->layout;
- layout->row.item = rect;
-}
+ style = &ctx->style;
-NK_API struct nk_rect
-nk_layout_space_bounds(struct nk_context *ctx)
+ state = nk_widget(&bounds, ctx);
+ if (!state) return 0;
+ in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+ return nk_do_selectable(&ctx->last_widget_state, &win->buffer, bounds,
+ str, len, align, value, &style->selectable, in, style->font);
+}
+NK_API int
+nk_selectable_image_text(struct nk_context *ctx, struct nk_image img,
+ const char *str, int len, nk_flags align, int *value)
{
- struct nk_rect ret;
struct nk_window *win;
struct nk_panel *layout;
+ const struct nk_input *in;
+ const struct nk_style *style;
+
+ enum nk_widget_layout_states state;
+ struct nk_rect bounds;
NK_ASSERT(ctx);
+ NK_ASSERT(value);
NK_ASSERT(ctx->current);
NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout || !value)
+ return 0;
+
win = ctx->current;
layout = win->layout;
+ style = &ctx->style;
- ret.x = layout->clip.x;
- ret.y = layout->clip.y;
- ret.w = layout->clip.w;
- ret.h = layout->row.height;
- return ret;
+ state = nk_widget(&bounds, ctx);
+ if (!state) return 0;
+ in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+ return nk_do_selectable_image(&ctx->last_widget_state, &win->buffer, bounds,
+ str, len, align, value, &img, &style->selectable, in, style->font);
}
-
-NK_API struct nk_rect
-nk_layout_widget_bounds(struct nk_context *ctx)
+NK_API int
+nk_selectable_symbol_text(struct nk_context *ctx, enum nk_symbol_type sym,
+ const char *str, int len, nk_flags align, int *value)
{
- struct nk_rect ret;
struct nk_window *win;
struct nk_panel *layout;
+ const struct nk_input *in;
+ const struct nk_style *style;
+
+ enum nk_widget_layout_states state;
+ struct nk_rect bounds;
NK_ASSERT(ctx);
+ NK_ASSERT(value);
NK_ASSERT(ctx->current);
NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout || !value)
+ return 0;
+
win = ctx->current;
layout = win->layout;
+ style = &ctx->style;
- ret.x = layout->at_x;
- ret.y = layout->at_y;
- ret.w = layout->bounds.w - NK_MAX(layout->at_x - layout->bounds.x,0);
- ret.h = layout->row.height;
- return ret;
+ state = nk_widget(&bounds, ctx);
+ if (!state) return 0;
+ in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+ return nk_do_selectable_symbol(&ctx->last_widget_state, &win->buffer, bounds,
+ str, len, align, value, sym, &style->selectable, in, style->font);
}
-
-NK_API struct nk_vec2
-nk_layout_space_to_screen(struct nk_context *ctx, struct nk_vec2 ret)
+NK_API int
+nk_selectable_symbol_label(struct nk_context *ctx, enum nk_symbol_type sym,
+ const char *title, nk_flags align, int *value)
{
- struct nk_window *win;
- struct nk_panel *layout;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- win = ctx->current;
- layout = win->layout;
-
- ret.x += layout->at_x - (float)*layout->offset_x;
- ret.y += layout->at_y - (float)*layout->offset_y;
- return ret;
+ return nk_selectable_symbol_text(ctx, sym, title, nk_strlen(title), align, value);
}
-
-NK_API struct nk_vec2
-nk_layout_space_to_local(struct nk_context *ctx, struct nk_vec2 ret)
+NK_API int nk_select_text(struct nk_context *ctx, const char *str, int len,
+ nk_flags align, int value)
{
- struct nk_window *win;
- struct nk_panel *layout;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- win = ctx->current;
- layout = win->layout;
-
- ret.x += -layout->at_x + (float)*layout->offset_x;
- ret.y += -layout->at_y + (float)*layout->offset_y;
- return ret;
+ nk_selectable_text(ctx, str, len, align, &value);return value;
}
-
-NK_API struct nk_rect
-nk_layout_space_rect_to_screen(struct nk_context *ctx, struct nk_rect ret)
+NK_API int nk_selectable_label(struct nk_context *ctx, const char *str, nk_flags align, int *value)
{
- struct nk_window *win;
- struct nk_panel *layout;
+ return nk_selectable_text(ctx, str, nk_strlen(str), align, value);
+}
+NK_API int nk_selectable_image_label(struct nk_context *ctx,struct nk_image img,
+ const char *str, nk_flags align, int *value)
+{
+ return nk_selectable_image_text(ctx, img, str, nk_strlen(str), align, value);
+}
+NK_API int nk_select_label(struct nk_context *ctx, const char *str, nk_flags align, int value)
+{
+ nk_selectable_text(ctx, str, nk_strlen(str), align, &value);return value;
+}
+NK_API int nk_select_image_label(struct nk_context *ctx, struct nk_image img,
+ const char *str, nk_flags align, int value)
+{
+ nk_selectable_image_text(ctx, img, str, nk_strlen(str), align, &value);return value;
+}
+NK_API int nk_select_image_text(struct nk_context *ctx, struct nk_image img,
+ const char *str, int len, nk_flags align, int value)
+{
+ nk_selectable_image_text(ctx, img, str, len, align, &value);return value;
+}
+NK_API int
+nk_select_symbol_text(struct nk_context *ctx, enum nk_symbol_type sym,
+ const char *title, int title_len, nk_flags align, int value)
+{
+ nk_selectable_symbol_text(ctx, sym, title, title_len, align, &value);return value;
+}
+NK_API int
+nk_select_symbol_label(struct nk_context *ctx, enum nk_symbol_type sym,
+ const char *title, nk_flags align, int value)
+{
+ return nk_select_symbol_text(ctx, sym, title, nk_strlen(title), align, value);
+}
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- win = ctx->current;
- layout = win->layout;
- ret.x += layout->at_x - (float)*layout->offset_x;
- ret.y += layout->at_y - (float)*layout->offset_y;
- return ret;
-}
-NK_API struct nk_rect
-nk_layout_space_rect_to_local(struct nk_context *ctx, struct nk_rect ret)
+
+
+/* ===============================================================
+ *
+ * SLIDER
+ *
+ * ===============================================================*/
+NK_LIB float
+nk_slider_behavior(nk_flags *state, struct nk_rect *logical_cursor,
+ struct nk_rect *visual_cursor, struct nk_input *in,
+ struct nk_rect bounds, float slider_min, float slider_max, float slider_value,
+ float slider_step, float slider_steps)
{
- struct nk_window *win;
- struct nk_panel *layout;
+ int left_mouse_down;
+ int left_mouse_click_in_cursor;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- win = ctx->current;
- layout = win->layout;
+ /* check if visual cursor is being dragged */
+ nk_widget_state_reset(state);
+ left_mouse_down = in && in->mouse.buttons[NK_BUTTON_LEFT].down;
+ left_mouse_click_in_cursor = in && nk_input_has_mouse_click_down_in_rect(in,
+ NK_BUTTON_LEFT, *visual_cursor, nk_true);
- ret.x += -layout->at_x + (float)*layout->offset_x;
- ret.y += -layout->at_y + (float)*layout->offset_y;
- return ret;
-}
+ if (left_mouse_down && left_mouse_click_in_cursor) {
+ float ratio = 0;
+ const float d = in->mouse.pos.x - (visual_cursor->x+visual_cursor->w*0.5f);
+ const float pxstep = bounds.w / slider_steps;
-NK_INTERN void
-nk_panel_alloc_row(const struct nk_context *ctx, struct nk_window *win)
-{
- struct nk_panel *layout = win->layout;
- struct nk_vec2 spacing = ctx->style.window.spacing;
- const float row_height = layout->row.height - spacing.y;
- nk_panel_layout(ctx, win, row_height, layout->row.columns);
+ /* only update value if the next slider step is reached */
+ *state = NK_WIDGET_STATE_ACTIVE;
+ if (NK_ABS(d) >= pxstep) {
+ const float steps = (float)((int)(NK_ABS(d) / pxstep));
+ slider_value += (d > 0) ? (slider_step*steps) : -(slider_step*steps);
+ slider_value = NK_CLAMP(slider_min, slider_value, slider_max);
+ ratio = (slider_value - slider_min)/slider_step;
+ logical_cursor->x = bounds.x + (logical_cursor->w * ratio);
+ in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.x = logical_cursor->x;
+ }
+ }
+
+ /* slider widget state */
+ if (nk_input_is_mouse_hovering_rect(in, bounds))
+ *state = NK_WIDGET_STATE_HOVERED;
+ if (*state & NK_WIDGET_STATE_HOVER &&
+ !nk_input_is_mouse_prev_hovering_rect(in, bounds))
+ *state |= NK_WIDGET_STATE_ENTERED;
+ else if (nk_input_is_mouse_prev_hovering_rect(in, bounds))
+ *state |= NK_WIDGET_STATE_LEFT;
+ return slider_value;
}
-
-NK_INTERN void
-nk_layout_widget_space(struct nk_rect *bounds, const struct nk_context *ctx,
- struct nk_window *win, int modify)
+NK_LIB void
+nk_draw_slider(struct nk_command_buffer *out, nk_flags state,
+ const struct nk_style_slider *style, const struct nk_rect *bounds,
+ const struct nk_rect *visual_cursor, float min, float value, float max)
{
- struct nk_panel *layout;
- const struct nk_style *style;
+ struct nk_rect fill;
+ struct nk_rect bar;
+ const struct nk_style_item *background;
- struct nk_vec2 spacing;
- struct nk_vec2 padding;
+ /* select correct slider images/colors */
+ struct nk_color bar_color;
+ const struct nk_style_item *cursor;
- float item_offset = 0;
- float item_width = 0;
- float item_spacing = 0;
- float panel_space = 0;
+ NK_UNUSED(min);
+ NK_UNUSED(max);
+ NK_UNUSED(value);
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
+ if (state & NK_WIDGET_STATE_ACTIVED) {
+ background = &style->active;
+ bar_color = style->bar_active;
+ cursor = &style->cursor_active;
+ } else if (state & NK_WIDGET_STATE_HOVER) {
+ background = &style->hover;
+ bar_color = style->bar_hover;
+ cursor = &style->cursor_hover;
+ } else {
+ background = &style->normal;
+ bar_color = style->bar_normal;
+ cursor = &style->cursor_normal;
+ }
+ /* calculate slider background bar */
+ bar.x = bounds->x;
+ bar.y = (visual_cursor->y + visual_cursor->h/2) - bounds->h/12;
+ bar.w = bounds->w;
+ bar.h = bounds->h/6;
- win = ctx->current;
- layout = win->layout;
- style = &ctx->style;
- NK_ASSERT(bounds);
+ /* filled background bar style */
+ fill.w = (visual_cursor->x + (visual_cursor->w/2.0f)) - bar.x;
+ fill.x = bar.x;
+ fill.y = bar.y;
+ fill.h = bar.h;
- spacing = style->window.spacing;
- padding = nk_panel_get_padding(style, layout->type);
- panel_space = nk_layout_row_calculate_usable_space(&ctx->style, layout->type,
- layout->bounds.w, layout->row.columns);
+ /* draw background */
+ if (background->type == NK_STYLE_ITEM_IMAGE) {
+ nk_draw_image(out, *bounds, &background->data.image, nk_white);
+ } else {
+ nk_fill_rect(out, *bounds, style->rounding, background->data.color);
+ nk_stroke_rect(out, *bounds, style->rounding, style->border, style->border_color);
+ }
- /* calculate the width of one item inside the current layout space */
- switch (layout->row.type) {
- case NK_LAYOUT_DYNAMIC_FIXED: {
- /* scaling fixed size widgets item width */
- item_width = NK_MAX(1.0f,panel_space-1.0f) / (float)layout->row.columns;
- item_offset = (float)layout->row.index * item_width;
- item_spacing = (float)layout->row.index * spacing.x;
- } break;
- case NK_LAYOUT_DYNAMIC_ROW: {
- /* scaling single ratio widget width */
- item_width = layout->row.item_width * panel_space;
- item_offset = layout->row.item_offset;
- item_spacing = 0;
+ /* draw slider bar */
+ nk_fill_rect(out, bar, style->rounding, bar_color);
+ nk_fill_rect(out, fill, style->rounding, style->bar_filled);
- if (modify) {
- layout->row.item_offset += item_width + spacing.x;
- layout->row.filled += layout->row.item_width;
- layout->row.index = 0;
- }
- } break;
- case NK_LAYOUT_DYNAMIC_FREE: {
- /* panel width depended free widget placing */
- bounds->x = layout->at_x + (layout->bounds.w * layout->row.item.x);
- bounds->x -= (float)*layout->offset_x;
- bounds->y = layout->at_y + (layout->row.height * layout->row.item.y);
- bounds->y -= (float)*layout->offset_y;
- bounds->w = layout->bounds.w * layout->row.item.w;
- bounds->h = layout->row.height * layout->row.item.h;
- return;
- } break;
- case NK_LAYOUT_DYNAMIC: {
- /* scaling arrays of panel width ratios for every widget */
- float ratio;
- NK_ASSERT(layout->row.ratio);
- ratio = (layout->row.ratio[layout->row.index] < 0) ?
- layout->row.item_width : layout->row.ratio[layout->row.index];
+ /* draw cursor */
+ if (cursor->type == NK_STYLE_ITEM_IMAGE)
+ nk_draw_image(out, *visual_cursor, &cursor->data.image, nk_white);
+ else nk_fill_circle(out, *visual_cursor, cursor->data.color);
+}
+NK_LIB float
+nk_do_slider(nk_flags *state,
+ struct nk_command_buffer *out, struct nk_rect bounds,
+ float min, float val, float max, float step,
+ const struct nk_style_slider *style, struct nk_input *in,
+ const struct nk_user_font *font)
+{
+ float slider_range;
+ float slider_min;
+ float slider_max;
+ float slider_value;
+ float slider_steps;
+ float cursor_offset;
- item_spacing = (float)layout->row.index * spacing.x;
- item_width = (ratio * panel_space);
- item_offset = layout->row.item_offset;
+ struct nk_rect visual_cursor;
+ struct nk_rect logical_cursor;
- if (modify) {
- layout->row.item_offset += item_width;
- layout->row.filled += ratio;
- }
- } break;
- case NK_LAYOUT_STATIC_FIXED: {
- /* non-scaling fixed widgets item width */
- item_width = layout->row.item_width;
- item_offset = (float)layout->row.index * item_width;
- item_spacing = (float)layout->row.index * spacing.x;
- } break;
- case NK_LAYOUT_STATIC_ROW: {
- /* scaling single ratio widget width */
- item_width = layout->row.item_width;
- item_offset = layout->row.item_offset;
- item_spacing = (float)layout->row.index * spacing.x;
- if (modify) layout->row.item_offset += item_width;
- } break;
- case NK_LAYOUT_STATIC_FREE: {
- /* free widget placing */
- bounds->x = layout->at_x + layout->row.item.x;
- bounds->w = layout->row.item.w;
- if (((bounds->x + bounds->w) > layout->max_x) && modify)
- layout->max_x = (bounds->x + bounds->w);
- bounds->x -= (float)*layout->offset_x;
- bounds->y = layout->at_y + layout->row.item.y;
- bounds->y -= (float)*layout->offset_y;
- bounds->h = layout->row.item.h;
- return;
- } break;
- case NK_LAYOUT_STATIC: {
- /* non-scaling array of panel pixel width for every widget */
- item_spacing = (float)layout->row.index * spacing.x;
- item_width = layout->row.ratio[layout->row.index];
- item_offset = layout->row.item_offset;
- if (modify) layout->row.item_offset += item_width;
- } break;
- case NK_LAYOUT_TEMPLATE: {
- /* stretchy row layout with combined dynamic/static widget width*/
- NK_ASSERT(layout->row.index < layout->row.columns);
- NK_ASSERT(layout->row.index < NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS);
- item_width = layout->row.templates[layout->row.index];
- item_offset = layout->row.item_offset;
- item_spacing = (float)layout->row.index * spacing.x;
- if (modify) layout->row.item_offset += item_width;
- } break;
- default: NK_ASSERT(0); break;
- };
+ NK_ASSERT(style);
+ NK_ASSERT(out);
+ if (!out || !style)
+ return 0;
- /* set the bounds of the newly allocated widget */
- bounds->w = item_width;
- bounds->h = layout->row.height - spacing.y;
- bounds->y = layout->at_y - (float)*layout->offset_y;
- bounds->x = layout->at_x + item_offset + item_spacing + padding.x;
- if (((bounds->x + bounds->w) > layout->max_x) && modify)
- layout->max_x = bounds->x + bounds->w;
- bounds->x -= (float)*layout->offset_x;
-}
+ /* remove padding from slider bounds */
+ bounds.x = bounds.x + style->padding.x;
+ bounds.y = bounds.y + style->padding.y;
+ bounds.h = NK_MAX(bounds.h, 2*style->padding.y);
+ bounds.w = NK_MAX(bounds.w, 2*style->padding.x + style->cursor_size.x);
+ bounds.w -= 2 * style->padding.x;
+ bounds.h -= 2 * style->padding.y;
-NK_INTERN void
-nk_panel_alloc_space(struct nk_rect *bounds, const struct nk_context *ctx)
-{
- struct nk_window *win;
- struct nk_panel *layout;
+ /* optional buttons */
+ if (style->show_buttons) {
+ nk_flags ws;
+ struct nk_rect button;
+ button.y = bounds.y;
+ button.w = bounds.h;
+ button.h = bounds.h;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
+ /* decrement button */
+ button.x = bounds.x;
+ if (nk_do_button_symbol(&ws, out, button, style->dec_symbol, NK_BUTTON_DEFAULT,
+ &style->dec_button, in, font))
+ val -= step;
- /* check if the end of the row has been hit and begin new row if so */
- win = ctx->current;
- layout = win->layout;
- if (layout->row.index >= layout->row.columns)
- nk_panel_alloc_row(ctx, win);
+ /* increment button */
+ button.x = (bounds.x + bounds.w) - button.w;
+ if (nk_do_button_symbol(&ws, out, button, style->inc_symbol, NK_BUTTON_DEFAULT,
+ &style->inc_button, in, font))
+ val += step;
- /* calculate widget position and size */
- nk_layout_widget_space(bounds, ctx, win, nk_true);
- layout->row.index++;
-}
+ bounds.x = bounds.x + button.w + style->spacing.x;
+ bounds.w = bounds.w - (2*button.w + 2*style->spacing.x);
+ }
-NK_INTERN void
-nk_layout_peek(struct nk_rect *bounds, struct nk_context *ctx)
-{
- float y;
- int index;
- struct nk_window *win;
- struct nk_panel *layout;
+ /* remove one cursor size to support visual cursor */
+ bounds.x += style->cursor_size.x*0.5f;
+ bounds.w -= style->cursor_size.x;
+
+ /* make sure the provided values are correct */
+ slider_max = NK_MAX(min, max);
+ slider_min = NK_MIN(min, max);
+ slider_value = NK_CLAMP(slider_min, val, slider_max);
+ slider_range = slider_max - slider_min;
+ slider_steps = slider_range / step;
+ cursor_offset = (slider_value - slider_min) / step;
+
+ /* calculate cursor
+ Basically you have two cursors. One for visual representation and interaction
+ and one for updating the actual cursor value. */
+ logical_cursor.h = bounds.h;
+ logical_cursor.w = bounds.w / slider_steps;
+ logical_cursor.x = bounds.x + (logical_cursor.w * cursor_offset);
+ logical_cursor.y = bounds.y;
+
+ visual_cursor.h = style->cursor_size.y;
+ visual_cursor.w = style->cursor_size.x;
+ visual_cursor.y = (bounds.y + bounds.h*0.5f) - visual_cursor.h*0.5f;
+ visual_cursor.x = logical_cursor.x - visual_cursor.w*0.5f;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
+ slider_value = nk_slider_behavior(state, &logical_cursor, &visual_cursor,
+ in, bounds, slider_min, slider_max, slider_value, step, slider_steps);
+ visual_cursor.x = logical_cursor.x - visual_cursor.w*0.5f;
- win = ctx->current;
- layout = win->layout;
- y = layout->at_y;
- index = layout->row.index;
- if (layout->row.index >= layout->row.columns) {
- layout->at_y += layout->row.height;
- layout->row.index = 0;
- }
- nk_layout_widget_space(bounds, ctx, win, nk_false);
- layout->at_y = y;
- layout->row.index = index;
+ /* draw slider */
+ if (style->draw_begin) style->draw_begin(out, style->userdata);
+ nk_draw_slider(out, *state, style, &bounds, &visual_cursor, slider_min, slider_value, slider_max);
+ if (style->draw_end) style->draw_end(out, style->userdata);
+ return slider_value;
}
-
-NK_INTERN int
-nk_tree_state_base(struct nk_context *ctx, enum nk_tree_type type,
- struct nk_image *img, const char *title, enum nk_collapse_states *state)
+NK_API int
+nk_slider_float(struct nk_context *ctx, float min_value, float *value, float max_value,
+ float value_step)
{
struct nk_window *win;
struct nk_panel *layout;
+ struct nk_input *in;
const struct nk_style *style;
- struct nk_command_buffer *out;
- const struct nk_input *in;
- const struct nk_style_button *button;
- enum nk_symbol_type symbol;
- float row_height;
-
- struct nk_vec2 item_spacing;
- struct nk_rect header = {0,0,0,0};
- struct nk_rect sym = {0,0,0,0};
- struct nk_text text;
- nk_flags ws = 0;
- enum nk_widget_layout_states widget_state;
+ int ret = 0;
+ float old_value;
+ struct nk_rect bounds;
+ enum nk_widget_layout_states state;
NK_ASSERT(ctx);
NK_ASSERT(ctx->current);
NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return 0;
+ NK_ASSERT(value);
+ if (!ctx || !ctx->current || !ctx->current->layout || !value)
+ return ret;
- /* cache some data */
win = ctx->current;
- layout = win->layout;
- out = &win->buffer;
style = &ctx->style;
- item_spacing = style->window.spacing;
-
- /* calculate header bounds and draw background */
- row_height = style->font->height + 2 * style->tab.padding.y;
- nk_layout_set_min_row_height(ctx, row_height);
- nk_layout_row_dynamic(ctx, row_height, 1);
- nk_layout_reset_min_row_height(ctx);
-
- widget_state = nk_widget(&header, ctx);
- if (type == NK_TREE_TAB) {
- const struct nk_style_item *background = &style->tab.background;
- if (background->type == NK_STYLE_ITEM_IMAGE) {
- nk_draw_image(out, header, &background->data.image, nk_white);
- text.background = nk_rgba(0,0,0,0);
- } else {
- text.background = background->data.color;
- nk_fill_rect(out, header, 0, style->tab.border_color);
- nk_fill_rect(out, nk_shrink_rect(header, style->tab.border),
- style->tab.rounding, background->data.color);
- }
- } else text.background = style->window.background;
+ layout = win->layout;
- /* update node state */
- in = (!(layout->flags & NK_WINDOW_ROM)) ? &ctx->input: 0;
- in = (in && widget_state == NK_WIDGET_VALID) ? &ctx->input : 0;
- if (nk_button_behavior(&ws, header, in, NK_BUTTON_DEFAULT))
- *state = (*state == NK_MAXIMIZED) ? NK_MINIMIZED : NK_MAXIMIZED;
+ state = nk_widget(&bounds, ctx);
+ if (!state) return ret;
+ in = (/*state == NK_WIDGET_ROM || */ layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
- /* select correct button style */
- if (*state == NK_MAXIMIZED) {
- symbol = style->tab.sym_maximize;
- if (type == NK_TREE_TAB)
- button = &style->tab.tab_maximize_button;
- else button = &style->tab.node_maximize_button;
- } else {
- symbol = style->tab.sym_minimize;
- if (type == NK_TREE_TAB)
- button = &style->tab.tab_minimize_button;
- else button = &style->tab.node_minimize_button;
- }
+ old_value = *value;
+ *value = nk_do_slider(&ctx->last_widget_state, &win->buffer, bounds, min_value,
+ old_value, max_value, value_step, &style->slider, in, style->font);
+ return (old_value > *value || old_value < *value);
+}
+NK_API float
+nk_slide_float(struct nk_context *ctx, float min, float val, float max, float step)
+{
+ nk_slider_float(ctx, min, &val, max, step); return val;
+}
+NK_API int
+nk_slide_int(struct nk_context *ctx, int min, int val, int max, int step)
+{
+ float value = (float)val;
+ nk_slider_float(ctx, (float)min, &value, (float)max, (float)step);
+ return (int)value;
+}
+NK_API int
+nk_slider_int(struct nk_context *ctx, int min, int *val, int max, int step)
+{
+ int ret;
+ float value = (float)*val;
+ ret = nk_slider_float(ctx, (float)min, &value, (float)max, (float)step);
+ *val = (int)value;
+ return ret;
+}
- {/* draw triangle button */
- sym.w = sym.h = style->font->height;
- sym.y = header.y + style->tab.padding.y;
- sym.x = header.x + style->tab.padding.x;
- nk_do_button_symbol(&ws, &win->buffer, sym, symbol, NK_BUTTON_DEFAULT,
- button, 0, style->font);
- if (img) {
- /* draw optional image icon */
- sym.x = sym.x + sym.w + 4 * item_spacing.x;
- nk_draw_image(&win->buffer, sym, img, nk_white);
- sym.w = style->font->height + style->tab.spacing.x;}
- }
- {/* draw label */
- struct nk_rect label;
- header.w = NK_MAX(header.w, sym.w + item_spacing.x);
- label.x = sym.x + sym.w + item_spacing.x;
- label.y = sym.y;
- label.w = header.w - (sym.w + item_spacing.y + style->tab.indent);
- label.h = style->font->height;
- text.text = style->tab.text;
- text.padding = nk_vec2(0,0);
- nk_widget_text(out, label, title, nk_strlen(title), &text,
- NK_TEXT_LEFT, style->font);}
- /* increase x-axis cursor widget position pointer */
- if (*state == NK_MAXIMIZED) {
- layout->at_x = header.x + (float)*layout->offset_x + style->tab.indent;
- layout->bounds.w = NK_MAX(layout->bounds.w, style->tab.indent);
- layout->bounds.w -= (style->tab.indent + style->window.padding.x);
- layout->row.tree_depth++;
- return nk_true;
- } else return nk_false;
-}
-NK_INTERN int
-nk_tree_base(struct nk_context *ctx, enum nk_tree_type type,
- struct nk_image *img, const char *title, enum nk_collapse_states initial_state,
- const char *hash, int len, int line)
+/* ===============================================================
+ *
+ * PROGRESS
+ *
+ * ===============================================================*/
+NK_LIB nk_size
+nk_progress_behavior(nk_flags *state, struct nk_input *in,
+ struct nk_rect r, struct nk_rect cursor, nk_size max, nk_size value, int modifiable)
{
- struct nk_window *win = ctx->current;
- int title_len = 0;
- nk_hash tree_hash = 0;
- nk_uint *state = 0;
+ int left_mouse_down = 0;
+ int left_mouse_click_in_cursor = 0;
- /* retrieve tree state from internal widget state tables */
- if (!hash) {
- title_len = (int)nk_strlen(title);
- tree_hash = nk_murmur_hash(title, (int)title_len, (nk_hash)line);
- } else tree_hash = nk_murmur_hash(hash, len, (nk_hash)line);
- state = nk_find_value(win, tree_hash);
- if (!state) {
- state = nk_add_value(ctx, win, tree_hash, 0);
- *state = initial_state;
+ nk_widget_state_reset(state);
+ if (!in || !modifiable) return value;
+ left_mouse_down = in && in->mouse.buttons[NK_BUTTON_LEFT].down;
+ left_mouse_click_in_cursor = in && nk_input_has_mouse_click_down_in_rect(in,
+ NK_BUTTON_LEFT, cursor, nk_true);
+ if (nk_input_is_mouse_hovering_rect(in, r))
+ *state = NK_WIDGET_STATE_HOVERED;
+
+ if (in && left_mouse_down && left_mouse_click_in_cursor) {
+ if (left_mouse_down && left_mouse_click_in_cursor) {
+ float ratio = NK_MAX(0, (float)(in->mouse.pos.x - cursor.x)) / (float)cursor.w;
+ value = (nk_size)NK_CLAMP(0, (float)max * ratio, (float)max);
+ in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.x = cursor.x + cursor.w/2.0f;
+ *state |= NK_WIDGET_STATE_ACTIVE;
+ }
}
- return nk_tree_state_base(ctx, type, img, title, (enum nk_collapse_states*)state);
+ /* set progressbar widget state */
+ if (*state & NK_WIDGET_STATE_HOVER && !nk_input_is_mouse_prev_hovering_rect(in, r))
+ *state |= NK_WIDGET_STATE_ENTERED;
+ else if (nk_input_is_mouse_prev_hovering_rect(in, r))
+ *state |= NK_WIDGET_STATE_LEFT;
+ return value;
}
+NK_LIB void
+nk_draw_progress(struct nk_command_buffer *out, nk_flags state,
+ const struct nk_style_progress *style, const struct nk_rect *bounds,
+ const struct nk_rect *scursor, nk_size value, nk_size max)
+{
+ const struct nk_style_item *background;
+ const struct nk_style_item *cursor;
-NK_API int
-nk_tree_state_push(struct nk_context *ctx, enum nk_tree_type type,
- const char *title, enum nk_collapse_states *state)
-{return nk_tree_state_base(ctx, type, 0, title, state);}
+ NK_UNUSED(max);
+ NK_UNUSED(value);
-NK_API int
-nk_tree_state_image_push(struct nk_context *ctx, enum nk_tree_type type,
- struct nk_image img, const char *title, enum nk_collapse_states *state)
-{return nk_tree_state_base(ctx, type, &img, title, state);}
+ /* select correct colors/images to draw */
+ if (state & NK_WIDGET_STATE_ACTIVED) {
+ background = &style->active;
+ cursor = &style->cursor_active;
+ } else if (state & NK_WIDGET_STATE_HOVER){
+ background = &style->hover;
+ cursor = &style->cursor_hover;
+ } else {
+ background = &style->normal;
+ cursor = &style->cursor_normal;
+ }
-NK_API void
-nk_tree_state_pop(struct nk_context *ctx)
+ /* draw background */
+ if (background->type == NK_STYLE_ITEM_COLOR) {
+ nk_fill_rect(out, *bounds, style->rounding, background->data.color);
+ nk_stroke_rect(out, *bounds, style->rounding, style->border, style->border_color);
+ } else nk_draw_image(out, *bounds, &background->data.image, nk_white);
+
+ /* draw cursor */
+ if (cursor->type == NK_STYLE_ITEM_COLOR) {
+ nk_fill_rect(out, *scursor, style->rounding, cursor->data.color);
+ nk_stroke_rect(out, *scursor, style->rounding, style->border, style->border_color);
+ } else nk_draw_image(out, *scursor, &cursor->data.image, nk_white);
+}
+NK_LIB nk_size
+nk_do_progress(nk_flags *state,
+ struct nk_command_buffer *out, struct nk_rect bounds,
+ nk_size value, nk_size max, int modifiable,
+ const struct nk_style_progress *style, struct nk_input *in)
{
- struct nk_window *win = 0;
- struct nk_panel *layout = 0;
+ float prog_scale;
+ nk_size prog_value;
+ struct nk_rect cursor;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
+ NK_ASSERT(style);
+ NK_ASSERT(out);
+ if (!out || !style) return 0;
- win = ctx->current;
- layout = win->layout;
- layout->at_x -= ctx->style.tab.indent + ctx->style.window.padding.x;
- layout->bounds.w += ctx->style.tab.indent + ctx->style.window.padding.x;
- NK_ASSERT(layout->row.tree_depth);
- layout->row.tree_depth--;
-}
+ /* calculate progressbar cursor */
+ cursor.w = NK_MAX(bounds.w, 2 * style->padding.x + 2 * style->border);
+ cursor.h = NK_MAX(bounds.h, 2 * style->padding.y + 2 * style->border);
+ cursor = nk_pad_rect(bounds, nk_vec2(style->padding.x + style->border, style->padding.y + style->border));
+ prog_scale = (float)value / (float)max;
-NK_API int
-nk_tree_push_hashed(struct nk_context *ctx, enum nk_tree_type type,
- const char *title, enum nk_collapse_states initial_state,
- const char *hash, int len, int line)
-{return nk_tree_base(ctx, type, 0, title, initial_state, hash, len, line);}
+ /* update progressbar */
+ prog_value = NK_MIN(value, max);
+ prog_value = nk_progress_behavior(state, in, bounds, cursor,max, prog_value, modifiable);
+ cursor.w = cursor.w * prog_scale;
+ /* draw progressbar */
+ if (style->draw_begin) style->draw_begin(out, style->userdata);
+ nk_draw_progress(out, *state, style, &bounds, &cursor, value, max);
+ if (style->draw_end) style->draw_end(out, style->userdata);
+ return prog_value;
+}
NK_API int
-nk_tree_image_push_hashed(struct nk_context *ctx, enum nk_tree_type type,
- struct nk_image img, const char *title, enum nk_collapse_states initial_state,
- const char *hash, int len,int seed)
-{return nk_tree_base(ctx, type, &img, title, initial_state, hash, len, seed);}
-
-NK_API void
-nk_tree_pop(struct nk_context *ctx)
-{nk_tree_state_pop(ctx);}
-
-/*----------------------------------------------------------------
- *
- * WIDGETS
- *
- * --------------------------------------------------------------*/
-NK_API struct nk_rect
-nk_widget_bounds(struct nk_context *ctx)
+nk_progress(struct nk_context *ctx, nk_size *cur, nk_size max, int is_modifyable)
{
- struct nk_rect bounds;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current)
- return nk_rect(0,0,0,0);
- nk_layout_peek(&bounds, ctx);
- return bounds;
-}
+ struct nk_window *win;
+ struct nk_panel *layout;
+ const struct nk_style *style;
+ struct nk_input *in;
-NK_API struct nk_vec2
-nk_widget_position(struct nk_context *ctx)
-{
struct nk_rect bounds;
+ enum nk_widget_layout_states state;
+ nk_size old_value;
+
NK_ASSERT(ctx);
+ NK_ASSERT(cur);
NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current)
- return nk_vec2(0,0);
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout || !cur)
+ return 0;
- nk_layout_peek(&bounds, ctx);
- return nk_vec2(bounds.x, bounds.y);
-}
+ win = ctx->current;
+ style = &ctx->style;
+ layout = win->layout;
+ state = nk_widget(&bounds, ctx);
+ if (!state) return 0;
-NK_API struct nk_vec2
-nk_widget_size(struct nk_context *ctx)
+ in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+ old_value = *cur;
+ *cur = nk_do_progress(&ctx->last_widget_state, &win->buffer, bounds,
+ *cur, max, is_modifyable, &style->progress, in);
+ return (*cur != old_value);
+}
+NK_API nk_size
+nk_prog(struct nk_context *ctx, nk_size cur, nk_size max, int modifyable)
{
- struct nk_rect bounds;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current)
- return nk_vec2(0,0);
-
- nk_layout_peek(&bounds, ctx);
- return nk_vec2(bounds.w, bounds.h);
+ nk_progress(ctx, &cur, max, modifyable);
+ return cur;
}
-NK_API float
-nk_widget_width(struct nk_context *ctx)
-{
- struct nk_rect bounds;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current)
- return 0;
- nk_layout_peek(&bounds, ctx);
- return bounds.w;
-}
-NK_API float
-nk_widget_height(struct nk_context *ctx)
-{
- struct nk_rect bounds;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current)
- return 0;
- nk_layout_peek(&bounds, ctx);
- return bounds.h;
-}
-NK_API int
-nk_widget_is_hovered(struct nk_context *ctx)
+/* ===============================================================
+ *
+ * SCROLLBAR
+ *
+ * ===============================================================*/
+NK_LIB float
+nk_scrollbar_behavior(nk_flags *state, struct nk_input *in,
+ int has_scrolling, const struct nk_rect *scroll,
+ const struct nk_rect *cursor, const struct nk_rect *empty0,
+ const struct nk_rect *empty1, float scroll_offset,
+ float target, float scroll_step, enum nk_orientation o)
{
- struct nk_rect c, v;
- struct nk_rect bounds;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current || ctx->active != ctx->current)
- return 0;
+ nk_flags ws = 0;
+ int left_mouse_down;
+ int left_mouse_clicked;
+ int left_mouse_click_in_cursor;
+ float scroll_delta;
- c = ctx->current->layout->clip;
- c.x = (float)((int)c.x);
- c.y = (float)((int)c.y);
- c.w = (float)((int)c.w);
- c.h = (float)((int)c.h);
+ nk_widget_state_reset(state);
+ if (!in) return scroll_offset;
- nk_layout_peek(&bounds, ctx);
- nk_unify(&v, &c, bounds.x, bounds.y, bounds.x + bounds.w, bounds.y + bounds.h);
- if (!NK_INTERSECT(c.x, c.y, c.w, c.h, bounds.x, bounds.y, bounds.w, bounds.h))
- return 0;
- return nk_input_is_mouse_hovering_rect(&ctx->input, bounds);
-}
+ left_mouse_down = in->mouse.buttons[NK_BUTTON_LEFT].down;
+ left_mouse_clicked = in->mouse.buttons[NK_BUTTON_LEFT].clicked;
+ left_mouse_click_in_cursor = nk_input_has_mouse_click_down_in_rect(in,
+ NK_BUTTON_LEFT, *cursor, nk_true);
+ if (nk_input_is_mouse_hovering_rect(in, *scroll))
+ *state = NK_WIDGET_STATE_HOVERED;
-NK_API int
-nk_widget_is_mouse_clicked(struct nk_context *ctx, enum nk_buttons btn)
+ scroll_delta = (o == NK_VERTICAL) ? in->mouse.scroll_delta.y: in->mouse.scroll_delta.x;
+ if (left_mouse_down && left_mouse_click_in_cursor && !left_mouse_clicked) {
+ /* update cursor by mouse dragging */
+ float pixel, delta;
+ *state = NK_WIDGET_STATE_ACTIVE;
+ if (o == NK_VERTICAL) {
+ float cursor_y;
+ pixel = in->mouse.delta.y;
+ delta = (pixel / scroll->h) * target;
+ scroll_offset = NK_CLAMP(0, scroll_offset + delta, target - scroll->h);
+ cursor_y = scroll->y + ((scroll_offset/target) * scroll->h);
+ in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.y = cursor_y + cursor->h/2.0f;
+ } else {
+ float cursor_x;
+ pixel = in->mouse.delta.x;
+ delta = (pixel / scroll->w) * target;
+ scroll_offset = NK_CLAMP(0, scroll_offset + delta, target - scroll->w);
+ cursor_x = scroll->x + ((scroll_offset/target) * scroll->w);
+ in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.x = cursor_x + cursor->w/2.0f;
+ }
+ } else if ((nk_input_is_key_pressed(in, NK_KEY_SCROLL_UP) && o == NK_VERTICAL && has_scrolling)||
+ nk_button_behavior(&ws, *empty0, in, NK_BUTTON_DEFAULT)) {
+ /* scroll page up by click on empty space or shortcut */
+ if (o == NK_VERTICAL)
+ scroll_offset = NK_MAX(0, scroll_offset - scroll->h);
+ else scroll_offset = NK_MAX(0, scroll_offset - scroll->w);
+ } else if ((nk_input_is_key_pressed(in, NK_KEY_SCROLL_DOWN) && o == NK_VERTICAL && has_scrolling) ||
+ nk_button_behavior(&ws, *empty1, in, NK_BUTTON_DEFAULT)) {
+ /* scroll page down by click on empty space or shortcut */
+ if (o == NK_VERTICAL)
+ scroll_offset = NK_MIN(scroll_offset + scroll->h, target - scroll->h);
+ else scroll_offset = NK_MIN(scroll_offset + scroll->w, target - scroll->w);
+ } else if (has_scrolling) {
+ if ((scroll_delta < 0 || (scroll_delta > 0))) {
+ /* update cursor by mouse scrolling */
+ scroll_offset = scroll_offset + scroll_step * (-scroll_delta);
+ if (o == NK_VERTICAL)
+ scroll_offset = NK_CLAMP(0, scroll_offset, target - scroll->h);
+ else scroll_offset = NK_CLAMP(0, scroll_offset, target - scroll->w);
+ } else if (nk_input_is_key_pressed(in, NK_KEY_SCROLL_START)) {
+ /* update cursor to the beginning */
+ if (o == NK_VERTICAL) scroll_offset = 0;
+ } else if (nk_input_is_key_pressed(in, NK_KEY_SCROLL_END)) {
+ /* update cursor to the end */
+ if (o == NK_VERTICAL) scroll_offset = target - scroll->h;
+ }
+ }
+ if (*state & NK_WIDGET_STATE_HOVER && !nk_input_is_mouse_prev_hovering_rect(in, *scroll))
+ *state |= NK_WIDGET_STATE_ENTERED;
+ else if (nk_input_is_mouse_prev_hovering_rect(in, *scroll))
+ *state |= NK_WIDGET_STATE_LEFT;
+ return scroll_offset;
+}
+NK_LIB void
+nk_draw_scrollbar(struct nk_command_buffer *out, nk_flags state,
+ const struct nk_style_scrollbar *style, const struct nk_rect *bounds,
+ const struct nk_rect *scroll)
{
- struct nk_rect c, v;
- struct nk_rect bounds;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current || ctx->active != ctx->current)
- return 0;
+ const struct nk_style_item *background;
+ const struct nk_style_item *cursor;
- c = ctx->current->layout->clip;
- c.x = (float)((int)c.x);
- c.y = (float)((int)c.y);
- c.w = (float)((int)c.w);
- c.h = (float)((int)c.h);
+ /* select correct colors/images to draw */
+ if (state & NK_WIDGET_STATE_ACTIVED) {
+ background = &style->active;
+ cursor = &style->cursor_active;
+ } else if (state & NK_WIDGET_STATE_HOVER) {
+ background = &style->hover;
+ cursor = &style->cursor_hover;
+ } else {
+ background = &style->normal;
+ cursor = &style->cursor_normal;
+ }
- nk_layout_peek(&bounds, ctx);
- nk_unify(&v, &c, bounds.x, bounds.y, bounds.x + bounds.w, bounds.y + bounds.h);
- if (!NK_INTERSECT(c.x, c.y, c.w, c.h, bounds.x, bounds.y, bounds.w, bounds.h))
- return 0;
- return nk_input_mouse_clicked(&ctx->input, btn, bounds);
-}
+ /* draw background */
+ if (background->type == NK_STYLE_ITEM_COLOR) {
+ nk_fill_rect(out, *bounds, style->rounding, background->data.color);
+ nk_stroke_rect(out, *bounds, style->rounding, style->border, style->border_color);
+ } else {
+ nk_draw_image(out, *bounds, &background->data.image, nk_white);
+ }
-NK_API int
-nk_widget_has_mouse_click_down(struct nk_context *ctx, enum nk_buttons btn, int down)
+ /* draw cursor */
+ if (cursor->type == NK_STYLE_ITEM_COLOR) {
+ nk_fill_rect(out, *scroll, style->rounding_cursor, cursor->data.color);
+ nk_stroke_rect(out, *scroll, style->rounding_cursor, style->border_cursor, style->cursor_border_color);
+ } else nk_draw_image(out, *scroll, &cursor->data.image, nk_white);
+}
+NK_LIB float
+nk_do_scrollbarv(nk_flags *state,
+ struct nk_command_buffer *out, struct nk_rect scroll, int has_scrolling,
+ float offset, float target, float step, float button_pixel_inc,
+ const struct nk_style_scrollbar *style, struct nk_input *in,
+ const struct nk_user_font *font)
{
- struct nk_rect c, v;
- struct nk_rect bounds;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current || ctx->active != ctx->current)
- return 0;
+ struct nk_rect empty_north;
+ struct nk_rect empty_south;
+ struct nk_rect cursor;
+
+ float scroll_step;
+ float scroll_offset;
+ float scroll_off;
+ float scroll_ratio;
- c = ctx->current->layout->clip;
- c.x = (float)((int)c.x);
- c.y = (float)((int)c.y);
- c.w = (float)((int)c.w);
- c.h = (float)((int)c.h);
+ NK_ASSERT(out);
+ NK_ASSERT(style);
+ NK_ASSERT(state);
+ if (!out || !style) return 0;
- nk_layout_peek(&bounds, ctx);
- nk_unify(&v, &c, bounds.x, bounds.y, bounds.x + bounds.w, bounds.y + bounds.h);
- if (!NK_INTERSECT(c.x, c.y, c.w, c.h, bounds.x, bounds.y, bounds.w, bounds.h))
- return 0;
- return nk_input_has_mouse_click_down_in_rect(&ctx->input, btn, bounds, down);
-}
+ scroll.w = NK_MAX(scroll.w, 1);
+ scroll.h = NK_MAX(scroll.h, 0);
+ if (target <= scroll.h) return 0;
-NK_API enum nk_widget_layout_states
-nk_widget(struct nk_rect *bounds, const struct nk_context *ctx)
-{
- struct nk_rect c, v;
- struct nk_window *win;
- struct nk_panel *layout;
- const struct nk_input *in;
+ /* optional scrollbar buttons */
+ if (style->show_buttons) {
+ nk_flags ws;
+ float scroll_h;
+ struct nk_rect button;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return NK_WIDGET_INVALID;
+ button.x = scroll.x;
+ button.w = scroll.w;
+ button.h = scroll.w;
- /* allocate space and check if the widget needs to be updated and drawn */
- nk_panel_alloc_space(bounds, ctx);
- win = ctx->current;
- layout = win->layout;
- in = &ctx->input;
- c = layout->clip;
+ scroll_h = NK_MAX(scroll.h - 2 * button.h,0);
+ scroll_step = NK_MIN(step, button_pixel_inc);
- /* if one of these triggers you forgot to add an `if` condition around either
- a window, group, popup, combobox or contextual menu `begin` and `end` block.
- Example:
- if (nk_begin(...) {...} nk_end(...); or
- if (nk_group_begin(...) { nk_group_end(...);} */
- NK_ASSERT(!(layout->flags & NK_WINDOW_MINIMIZED));
- NK_ASSERT(!(layout->flags & NK_WINDOW_HIDDEN));
- NK_ASSERT(!(layout->flags & NK_WINDOW_CLOSED));
+ /* decrement button */
+ button.y = scroll.y;
+ if (nk_do_button_symbol(&ws, out, button, style->dec_symbol,
+ NK_BUTTON_REPEATER, &style->dec_button, in, font))
+ offset = offset - scroll_step;
- /* need to convert to int here to remove floating point errors */
- bounds->x = (float)((int)bounds->x);
- bounds->y = (float)((int)bounds->y);
- bounds->w = (float)((int)bounds->w);
- bounds->h = (float)((int)bounds->h);
+ /* increment button */
+ button.y = scroll.y + scroll.h - button.h;
+ if (nk_do_button_symbol(&ws, out, button, style->inc_symbol,
+ NK_BUTTON_REPEATER, &style->inc_button, in, font))
+ offset = offset + scroll_step;
- c.x = (float)((int)c.x);
- c.y = (float)((int)c.y);
- c.w = (float)((int)c.w);
- c.h = (float)((int)c.h);
+ scroll.y = scroll.y + button.h;
+ scroll.h = scroll_h;
+ }
- nk_unify(&v, &c, bounds->x, bounds->y, bounds->x + bounds->w, bounds->y + bounds->h);
- if (!NK_INTERSECT(c.x, c.y, c.w, c.h, bounds->x, bounds->y, bounds->w, bounds->h))
- return NK_WIDGET_INVALID;
- if (!NK_INBOX(in->mouse.pos.x, in->mouse.pos.y, v.x, v.y, v.w, v.h))
- return NK_WIDGET_ROM;
- return NK_WIDGET_VALID;
-}
+ /* calculate scrollbar constants */
+ scroll_step = NK_MIN(step, scroll.h);
+ scroll_offset = NK_CLAMP(0, offset, target - scroll.h);
+ scroll_ratio = scroll.h / target;
+ scroll_off = scroll_offset / target;
-NK_API enum nk_widget_layout_states
-nk_widget_fitting(struct nk_rect *bounds, struct nk_context *ctx,
- struct nk_vec2 item_padding)
-{
- /* update the bounds to stand without padding */
- struct nk_window *win;
- struct nk_style *style;
- struct nk_panel *layout;
- enum nk_widget_layout_states state;
- struct nk_vec2 panel_padding;
+ /* calculate scrollbar cursor bounds */
+ cursor.h = NK_MAX((scroll_ratio * scroll.h) - (2*style->border + 2*style->padding.y), 0);
+ cursor.y = scroll.y + (scroll_off * scroll.h) + style->border + style->padding.y;
+ cursor.w = scroll.w - (2 * style->border + 2 * style->padding.x);
+ cursor.x = scroll.x + style->border + style->padding.x;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return NK_WIDGET_INVALID;
+ /* calculate empty space around cursor */
+ empty_north.x = scroll.x;
+ empty_north.y = scroll.y;
+ empty_north.w = scroll.w;
+ empty_north.h = NK_MAX(cursor.y - scroll.y, 0);
- win = ctx->current;
- style = &ctx->style;
- layout = win->layout;
- state = nk_widget(bounds, ctx);
+ empty_south.x = scroll.x;
+ empty_south.y = cursor.y + cursor.h;
+ empty_south.w = scroll.w;
+ empty_south.h = NK_MAX((scroll.y + scroll.h) - (cursor.y + cursor.h), 0);
- panel_padding = nk_panel_get_padding(style, layout->type);
- if (layout->row.index == 1) {
- bounds->w += panel_padding.x;
- bounds->x -= panel_padding.x;
- } else bounds->x -= item_padding.x;
+ /* update scrollbar */
+ scroll_offset = nk_scrollbar_behavior(state, in, has_scrolling, &scroll, &cursor,
+ &empty_north, &empty_south, scroll_offset, target, scroll_step, NK_VERTICAL);
+ scroll_off = scroll_offset / target;
+ cursor.y = scroll.y + (scroll_off * scroll.h) + style->border_cursor + style->padding.y;
- if (layout->row.index == layout->row.columns)
- bounds->w += panel_padding.x;
- else bounds->w += item_padding.x;
- return state;
+ /* draw scrollbar */
+ if (style->draw_begin) style->draw_begin(out, style->userdata);
+ nk_draw_scrollbar(out, *state, style, &scroll, &cursor);
+ if (style->draw_end) style->draw_end(out, style->userdata);
+ return scroll_offset;
}
-
-/*----------------------------------------------------------------
- *
- * MISC
- *
- * --------------------------------------------------------------*/
-NK_API void
-nk_spacing(struct nk_context *ctx, int cols)
+NK_LIB float
+nk_do_scrollbarh(nk_flags *state,
+ struct nk_command_buffer *out, struct nk_rect scroll, int has_scrolling,
+ float offset, float target, float step, float button_pixel_inc,
+ const struct nk_style_scrollbar *style, struct nk_input *in,
+ const struct nk_user_font *font)
{
- struct nk_window *win;
- struct nk_panel *layout;
- struct nk_rect none;
- int i, index, rows;
+ struct nk_rect cursor;
+ struct nk_rect empty_west;
+ struct nk_rect empty_east;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
+ float scroll_step;
+ float scroll_offset;
+ float scroll_off;
+ float scroll_ratio;
- /* spacing over row boundaries */
- win = ctx->current;
- layout = win->layout;
- index = (layout->row.index + cols) % layout->row.columns;
- rows = (layout->row.index + cols) / layout->row.columns;
- if (rows) {
- for (i = 0; i < rows; ++i)
- nk_panel_alloc_row(ctx, win);
- cols = index;
- }
- /* non table layout need to allocate space */
- if (layout->row.type != NK_LAYOUT_DYNAMIC_FIXED &&
- layout->row.type != NK_LAYOUT_STATIC_FIXED) {
- for (i = 0; i < cols; ++i)
- nk_panel_alloc_space(&none, ctx);
- }
- layout->row.index = index;
-}
+ NK_ASSERT(out);
+ NK_ASSERT(style);
+ if (!out || !style) return 0;
-/*----------------------------------------------------------------
- *
- * TEXT
- *
- * --------------------------------------------------------------*/
-NK_API void
-nk_text_colored(struct nk_context *ctx, const char *str, int len,
- nk_flags alignment, struct nk_color color)
-{
- struct nk_window *win;
- const struct nk_style *style;
+ /* scrollbar background */
+ scroll.h = NK_MAX(scroll.h, 1);
+ scroll.w = NK_MAX(scroll.w, 2 * scroll.h);
+ if (target <= scroll.w) return 0;
- struct nk_vec2 item_padding;
- struct nk_rect bounds;
- struct nk_text text;
+ /* optional scrollbar buttons */
+ if (style->show_buttons) {
+ nk_flags ws;
+ float scroll_w;
+ struct nk_rect button;
+ button.y = scroll.y;
+ button.w = scroll.h;
+ button.h = scroll.h;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout) return;
+ scroll_w = scroll.w - 2 * button.w;
+ scroll_step = NK_MIN(step, button_pixel_inc);
- win = ctx->current;
- style = &ctx->style;
- nk_panel_alloc_space(&bounds, ctx);
- item_padding = style->text.padding;
+ /* decrement button */
+ button.x = scroll.x;
+ if (nk_do_button_symbol(&ws, out, button, style->dec_symbol,
+ NK_BUTTON_REPEATER, &style->dec_button, in, font))
+ offset = offset - scroll_step;
- text.padding.x = item_padding.x;
- text.padding.y = item_padding.y;
- text.background = style->window.background;
- text.text = color;
- nk_widget_text(&win->buffer, bounds, str, len, &text, alignment, style->font);
-}
+ /* increment button */
+ button.x = scroll.x + scroll.w - button.w;
+ if (nk_do_button_symbol(&ws, out, button, style->inc_symbol,
+ NK_BUTTON_REPEATER, &style->inc_button, in, font))
+ offset = offset + scroll_step;
-NK_API void
-nk_text_wrap_colored(struct nk_context *ctx, const char *str,
- int len, struct nk_color color)
-{
- struct nk_window *win;
- const struct nk_style *style;
+ scroll.x = scroll.x + button.w;
+ scroll.w = scroll_w;
+ }
- struct nk_vec2 item_padding;
- struct nk_rect bounds;
- struct nk_text text;
+ /* calculate scrollbar constants */
+ scroll_step = NK_MIN(step, scroll.w);
+ scroll_offset = NK_CLAMP(0, offset, target - scroll.w);
+ scroll_ratio = scroll.w / target;
+ scroll_off = scroll_offset / target;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout) return;
+ /* calculate cursor bounds */
+ cursor.w = (scroll_ratio * scroll.w) - (2*style->border + 2*style->padding.x);
+ cursor.x = scroll.x + (scroll_off * scroll.w) + style->border + style->padding.x;
+ cursor.h = scroll.h - (2 * style->border + 2 * style->padding.y);
+ cursor.y = scroll.y + style->border + style->padding.y;
- win = ctx->current;
- style = &ctx->style;
- nk_panel_alloc_space(&bounds, ctx);
- item_padding = style->text.padding;
+ /* calculate empty space around cursor */
+ empty_west.x = scroll.x;
+ empty_west.y = scroll.y;
+ empty_west.w = cursor.x - scroll.x;
+ empty_west.h = scroll.h;
- text.padding.x = item_padding.x;
- text.padding.y = item_padding.y;
- text.background = style->window.background;
- text.text = color;
- nk_widget_text_wrap(&win->buffer, bounds, str, len, &text, style->font);
-}
+ empty_east.x = cursor.x + cursor.w;
+ empty_east.y = scroll.y;
+ empty_east.w = (scroll.x + scroll.w) - (cursor.x + cursor.w);
+ empty_east.h = scroll.h;
-#ifdef NK_INCLUDE_STANDARD_VARARGS
-NK_API void
-nk_labelf_colored(struct nk_context *ctx, nk_flags flags,
- struct nk_color color, const char *fmt, ...)
-{
- char buf[256];
- va_list args;
- va_start(args, fmt);
- nk_strfmt(buf, NK_LEN(buf), fmt, args);
- nk_label_colored(ctx, buf, flags, color);
- va_end(args);
-}
+ /* update scrollbar */
+ scroll_offset = nk_scrollbar_behavior(state, in, has_scrolling, &scroll, &cursor,
+ &empty_west, &empty_east, scroll_offset, target, scroll_step, NK_HORIZONTAL);
+ scroll_off = scroll_offset / target;
+ cursor.x = scroll.x + (scroll_off * scroll.w);
-NK_API void
-nk_labelf_colored_wrap(struct nk_context *ctx, struct nk_color color,
- const char *fmt, ...)
-{
- char buf[256];
- va_list args;
- va_start(args, fmt);
- nk_strfmt(buf, NK_LEN(buf), fmt, args);
- nk_label_colored_wrap(ctx, buf, color);
- va_end(args);
+ /* draw scrollbar */
+ if (style->draw_begin) style->draw_begin(out, style->userdata);
+ nk_draw_scrollbar(out, *state, style, &scroll, &cursor);
+ if (style->draw_end) style->draw_end(out, style->userdata);
+ return scroll_offset;
}
-NK_API void
-nk_labelf(struct nk_context *ctx, nk_flags flags, const char *fmt, ...)
-{
- char buf[256];
- va_list args;
- va_start(args, fmt);
- nk_strfmt(buf, NK_LEN(buf), fmt, args);
- nk_label(ctx, buf, flags);
- va_end(args);
-}
-NK_API void
-nk_labelf_wrap(struct nk_context *ctx, const char *fmt,...)
-{
- char buf[256];
- va_list args;
- va_start(args, fmt);
- nk_strfmt(buf, NK_LEN(buf), fmt, args);
- nk_label_wrap(ctx, buf);
- va_end(args);
-}
-NK_API void
-nk_value_bool(struct nk_context *ctx, const char *prefix, int value)
-{nk_labelf(ctx, NK_TEXT_LEFT, "%s: %s", prefix, ((value) ? "true": "false"));}
-NK_API void
-nk_value_int(struct nk_context *ctx, const char *prefix, int value)
-{nk_labelf(ctx, NK_TEXT_LEFT, "%s: %d", prefix, value);}
-NK_API void
-nk_value_uint(struct nk_context *ctx, const char *prefix, unsigned int value)
-{nk_labelf(ctx, NK_TEXT_LEFT, "%s: %u", prefix, value);}
+/* ===============================================================
+ *
+ * TEXT EDITOR
+ *
+ * ===============================================================*/
+/* stb_textedit.h - v1.8 - public domain - Sean Barrett */
+struct nk_text_find {
+ float x,y; /* position of n'th character */
+ float height; /* height of line */
+ int first_char, length; /* first char of row, and length */
+ int prev_first; /*_ first char of previous row */
+};
-NK_API void
-nk_value_float(struct nk_context *ctx, const char *prefix, float value)
-{
- double double_value = (double)value;
- nk_labelf(ctx, NK_TEXT_LEFT, "%s: %.3f", prefix, double_value);
-}
+struct nk_text_edit_row {
+ float x0,x1;
+ /* starting x location, end x location (allows for align=right, etc) */
+ float baseline_y_delta;
+ /* position of baseline relative to previous row's baseline*/
+ float ymin,ymax;
+ /* height of row above and below baseline */
+ int num_chars;
+};
-NK_API void
-nk_value_color_byte(struct nk_context *ctx, const char *p, struct nk_color c)
-{nk_labelf(ctx, NK_TEXT_LEFT, "%s: (%d, %d, %d, %d)", p, c.r, c.g, c.b, c.a);}
+/* forward declarations */
+NK_INTERN void nk_textedit_makeundo_delete(struct nk_text_edit*, int, int);
+NK_INTERN void nk_textedit_makeundo_insert(struct nk_text_edit*, int, int);
+NK_INTERN void nk_textedit_makeundo_replace(struct nk_text_edit*, int, int, int);
+#define NK_TEXT_HAS_SELECTION(s) ((s)->select_start != (s)->select_end)
-NK_API void
-nk_value_color_float(struct nk_context *ctx, const char *p, struct nk_color color)
+NK_INTERN float
+nk_textedit_get_width(const struct nk_text_edit *edit, int line_start, int char_id,
+ const struct nk_user_font *font)
{
- double c[4]; nk_color_dv(c, color);
- nk_labelf(ctx, NK_TEXT_LEFT, "%s: (%.2f, %.2f, %.2f, %.2f)",
- p, c[0], c[1], c[2], c[3]);
+ int len = 0;
+ nk_rune unicode = 0;
+ const char *str = nk_str_at_const(&edit->string, line_start + char_id, &unicode, &len);
+ return font->width(font->userdata, font->height, str, len);
}
-
-NK_API void
-nk_value_color_hex(struct nk_context *ctx, const char *prefix, struct nk_color color)
+NK_INTERN void
+nk_textedit_layout_row(struct nk_text_edit_row *r, struct nk_text_edit *edit,
+ int line_start_id, float row_height, const struct nk_user_font *font)
{
- char hex[16];
- nk_color_hex_rgba(hex, color);
- nk_labelf(ctx, NK_TEXT_LEFT, "%s: %s", prefix, hex);
-}
-#endif
+ int l;
+ int glyphs = 0;
+ nk_rune unicode;
+ const char *remaining;
+ int len = nk_str_len_char(&edit->string);
+ const char *end = nk_str_get_const(&edit->string) + len;
+ const char *text = nk_str_at_const(&edit->string, line_start_id, &unicode, &l);
+ const struct nk_vec2 size = nk_text_calculate_text_bounds(font,
+ text, (int)(end - text), row_height, &remaining, 0, &glyphs, NK_STOP_ON_NEW_LINE);
-NK_API void
-nk_text(struct nk_context *ctx, const char *str, int len, nk_flags alignment)
-{
- NK_ASSERT(ctx);
- if (!ctx) return;
- nk_text_colored(ctx, str, len, alignment, ctx->style.text.color);
+ r->x0 = 0.0f;
+ r->x1 = size.x;
+ r->baseline_y_delta = size.y;
+ r->ymin = 0.0f;
+ r->ymax = size.y;
+ r->num_chars = glyphs;
}
-
-NK_API void
-nk_text_wrap(struct nk_context *ctx, const char *str, int len)
+NK_INTERN int
+nk_textedit_locate_coord(struct nk_text_edit *edit, float x, float y,
+ const struct nk_user_font *font, float row_height)
{
- NK_ASSERT(ctx);
- if (!ctx) return;
- nk_text_wrap_colored(ctx, str, len, ctx->style.text.color);
-}
+ struct nk_text_edit_row r;
+ int n = edit->string.len;
+ float base_y = 0, prev_x;
+ int i=0, k;
-NK_API void
-nk_label(struct nk_context *ctx, const char *str, nk_flags alignment)
-{nk_text(ctx, str, nk_strlen(str), alignment);}
+ r.x0 = r.x1 = 0;
+ r.ymin = r.ymax = 0;
+ r.num_chars = 0;
-NK_API void
-nk_label_colored(struct nk_context *ctx, const char *str, nk_flags align,
- struct nk_color color)
-{nk_text_colored(ctx, str, nk_strlen(str), align, color);}
+ /* search rows to find one that straddles 'y' */
+ while (i < n) {
+ nk_textedit_layout_row(&r, edit, i, row_height, font);
+ if (r.num_chars <= 0)
+ return n;
-NK_API void
-nk_label_wrap(struct nk_context *ctx, const char *str)
-{nk_text_wrap(ctx, str, nk_strlen(str));}
+ if (i==0 && y < base_y + r.ymin)
+ return 0;
-NK_API void
-nk_label_colored_wrap(struct nk_context *ctx, const char *str, struct nk_color color)
-{nk_text_wrap_colored(ctx, str, nk_strlen(str), color);}
+ if (y < base_y + r.ymax)
+ break;
-NK_API void
-nk_image(struct nk_context *ctx, struct nk_image img)
-{
- struct nk_window *win;
- struct nk_rect bounds;
+ i += r.num_chars;
+ base_y += r.baseline_y_delta;
+ }
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout) return;
+ /* below all text, return 'after' last character */
+ if (i >= n)
+ return n;
- win = ctx->current;
- if (!nk_widget(&bounds, ctx)) return;
- nk_draw_image(&win->buffer, bounds, &img, nk_white);
-}
+ /* check if it's before the beginning of the line */
+ if (x < r.x0)
+ return i;
-/*----------------------------------------------------------------
- *
- * BUTTON
- *
- * --------------------------------------------------------------*/
-NK_API void
-nk_button_set_behavior(struct nk_context *ctx, enum nk_button_behavior behavior)
+ /* check if it's before the end of the line */
+ if (x < r.x1) {
+ /* search characters in row for one that straddles 'x' */
+ k = i;
+ prev_x = r.x0;
+ for (i=0; i < r.num_chars; ++i) {
+ float w = nk_textedit_get_width(edit, k, i, font);
+ if (x < prev_x+w) {
+ if (x < prev_x+w/2)
+ return k+i;
+ else return k+i+1;
+ }
+ prev_x += w;
+ }
+ /* shouldn't happen, but if it does, fall through to end-of-line case */
+ }
+
+ /* if the last character is a newline, return that.
+ * otherwise return 'after' the last character */
+ if (nk_str_rune_at(&edit->string, i+r.num_chars-1) == '\n')
+ return i+r.num_chars-1;
+ else return i+r.num_chars;
+}
+NK_LIB void
+nk_textedit_click(struct nk_text_edit *state, float x, float y,
+ const struct nk_user_font *font, float row_height)
+{
+ /* API click: on mouse down, move the cursor to the clicked location,
+ * and reset the selection */
+ state->cursor = nk_textedit_locate_coord(state, x, y, font, row_height);
+ state->select_start = state->cursor;
+ state->select_end = state->cursor;
+ state->has_preferred_x = 0;
+}
+NK_LIB void
+nk_textedit_drag(struct nk_text_edit *state, float x, float y,
+ const struct nk_user_font *font, float row_height)
{
- NK_ASSERT(ctx);
- if (!ctx) return;
- ctx->button_behavior = behavior;
+ /* API drag: on mouse drag, move the cursor and selection endpoint
+ * to the clicked location */
+ int p = nk_textedit_locate_coord(state, x, y, font, row_height);
+ if (state->select_start == state->select_end)
+ state->select_start = state->cursor;
+ state->cursor = state->select_end = p;
}
-
-NK_API int
-nk_button_push_behavior(struct nk_context *ctx, enum nk_button_behavior behavior)
+NK_INTERN void
+nk_textedit_find_charpos(struct nk_text_find *find, struct nk_text_edit *state,
+ int n, int single_line, const struct nk_user_font *font, float row_height)
{
- struct nk_config_stack_button_behavior *button_stack;
- struct nk_config_stack_button_behavior_element *element;
-
- NK_ASSERT(ctx);
- if (!ctx) return 0;
+ /* find the x/y location of a character, and remember info about the previous
+ * row in case we get a move-up event (for page up, we'll have to rescan) */
+ struct nk_text_edit_row r;
+ int prev_start = 0;
+ int z = state->string.len;
+ int i=0, first;
- button_stack = &ctx->stacks.button_behaviors;
- NK_ASSERT(button_stack->head < (int)NK_LEN(button_stack->elements));
- if (button_stack->head >= (int)NK_LEN(button_stack->elements))
- return 0;
+ nk_zero_struct(r);
+ if (n == z) {
+ /* if it's at the end, then find the last line -- simpler than trying to
+ explicitly handle this case in the regular code */
+ nk_textedit_layout_row(&r, state, 0, row_height, font);
+ if (single_line) {
+ find->first_char = 0;
+ find->length = z;
+ } else {
+ while (i < z) {
+ prev_start = i;
+ i += r.num_chars;
+ nk_textedit_layout_row(&r, state, i, row_height, font);
+ }
- element = &button_stack->elements[button_stack->head++];
- element->address = &ctx->button_behavior;
- element->old_value = ctx->button_behavior;
- ctx->button_behavior = behavior;
- return 1;
-}
+ find->first_char = i;
+ find->length = r.num_chars;
+ }
+ find->x = r.x1;
+ find->y = r.ymin;
+ find->height = r.ymax - r.ymin;
+ find->prev_first = prev_start;
+ return;
+ }
-NK_API int
-nk_button_pop_behavior(struct nk_context *ctx)
-{
- struct nk_config_stack_button_behavior *button_stack;
- struct nk_config_stack_button_behavior_element *element;
+ /* search rows to find the one that straddles character n */
+ find->y = 0;
- NK_ASSERT(ctx);
- if (!ctx) return 0;
+ for(;;) {
+ nk_textedit_layout_row(&r, state, i, row_height, font);
+ if (n < i + r.num_chars) break;
+ prev_start = i;
+ i += r.num_chars;
+ find->y += r.baseline_y_delta;
+ }
- button_stack = &ctx->stacks.button_behaviors;
- NK_ASSERT(button_stack->head > 0);
- if (button_stack->head < 1)
- return 0;
+ find->first_char = first = i;
+ find->length = r.num_chars;
+ find->height = r.ymax - r.ymin;
+ find->prev_first = prev_start;
- element = &button_stack->elements[--button_stack->head];
- *element->address = element->old_value;
- return 1;
+ /* now scan to find xpos */
+ find->x = r.x0;
+ for (i=0; first+i < n; ++i)
+ find->x += nk_textedit_get_width(state, first, i, font);
}
-
-NK_API int
-nk_button_text_styled(struct nk_context *ctx,
- const struct nk_style_button *style, const char *title, int len)
+NK_INTERN void
+nk_textedit_clamp(struct nk_text_edit *state)
{
- struct nk_window *win;
- struct nk_panel *layout;
- const struct nk_input *in;
-
- struct nk_rect bounds;
- enum nk_widget_layout_states state;
-
- NK_ASSERT(ctx);
- NK_ASSERT(style);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!style || !ctx || !ctx->current || !ctx->current->layout) return 0;
-
- win = ctx->current;
- layout = win->layout;
- state = nk_widget(&bounds, ctx);
-
- if (!state) return 0;
- in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
- return nk_do_button_text(&ctx->last_widget_state, &win->buffer, bounds,
- title, len, style->text_alignment, ctx->button_behavior,
- style, in, ctx->style.font);
+ /* make the selection/cursor state valid if client altered the string */
+ int n = state->string.len;
+ if (NK_TEXT_HAS_SELECTION(state)) {
+ if (state->select_start > n) state->select_start = n;
+ if (state->select_end > n) state->select_end = n;
+ /* if clamping forced them to be equal, move the cursor to match */
+ if (state->select_start == state->select_end)
+ state->cursor = state->select_start;
+ }
+ if (state->cursor > n) state->cursor = n;
}
-
-NK_API int
-nk_button_text(struct nk_context *ctx, const char *title, int len)
+NK_API void
+nk_textedit_delete(struct nk_text_edit *state, int where, int len)
{
- NK_ASSERT(ctx);
- if (!ctx) return 0;
- return nk_button_text_styled(ctx, &ctx->style.button, title, len);
+ /* delete characters while updating undo */
+ nk_textedit_makeundo_delete(state, where, len);
+ nk_str_delete_runes(&state->string, where, len);
+ state->has_preferred_x = 0;
}
-
-NK_API int nk_button_label_styled(struct nk_context *ctx,
- const struct nk_style_button *style, const char *title)
-{return nk_button_text_styled(ctx, style, title, nk_strlen(title));}
-
-NK_API int nk_button_label(struct nk_context *ctx, const char *title)
-{return nk_button_text(ctx, title, nk_strlen(title));}
-
-NK_API int
-nk_button_color(struct nk_context *ctx, struct nk_color color)
+NK_API void
+nk_textedit_delete_selection(struct nk_text_edit *state)
{
- struct nk_window *win;
- struct nk_panel *layout;
- const struct nk_input *in;
- struct nk_style_button button;
-
- int ret = 0;
- struct nk_rect bounds;
- struct nk_rect content;
- enum nk_widget_layout_states state;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return 0;
-
- win = ctx->current;
- layout = win->layout;
-
- state = nk_widget(&bounds, ctx);
- if (!state) return 0;
- in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
-
- button = ctx->style.button;
- button.normal = nk_style_item_color(color);
- button.hover = nk_style_item_color(color);
- button.active = nk_style_item_color(color);
- ret = nk_do_button(&ctx->last_widget_state, &win->buffer, bounds,
- &button, in, ctx->button_behavior, &content);
- nk_draw_button(&win->buffer, &bounds, ctx->last_widget_state, &button);
- return ret;
+ /* delete the section */
+ nk_textedit_clamp(state);
+ if (NK_TEXT_HAS_SELECTION(state)) {
+ if (state->select_start < state->select_end) {
+ nk_textedit_delete(state, state->select_start,
+ state->select_end - state->select_start);
+ state->select_end = state->cursor = state->select_start;
+ } else {
+ nk_textedit_delete(state, state->select_end,
+ state->select_start - state->select_end);
+ state->select_start = state->cursor = state->select_end;
+ }
+ state->has_preferred_x = 0;
+ }
}
-
-NK_API int
-nk_button_symbol_styled(struct nk_context *ctx,
- const struct nk_style_button *style, enum nk_symbol_type symbol)
+NK_INTERN void
+nk_textedit_sortselection(struct nk_text_edit *state)
{
- struct nk_window *win;
- struct nk_panel *layout;
- const struct nk_input *in;
-
- struct nk_rect bounds;
- enum nk_widget_layout_states state;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return 0;
-
- win = ctx->current;
- layout = win->layout;
- state = nk_widget(&bounds, ctx);
- if (!state) return 0;
- in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
- return nk_do_button_symbol(&ctx->last_widget_state, &win->buffer, bounds,
- symbol, ctx->button_behavior, style, in, ctx->style.font);
+ /* canonicalize the selection so start <= end */
+ if (state->select_end < state->select_start) {
+ int temp = state->select_end;
+ state->select_end = state->select_start;
+ state->select_start = temp;
+ }
+}
+NK_INTERN void
+nk_textedit_move_to_first(struct nk_text_edit *state)
+{
+ /* move cursor to first character of selection */
+ if (NK_TEXT_HAS_SELECTION(state)) {
+ nk_textedit_sortselection(state);
+ state->cursor = state->select_start;
+ state->select_end = state->select_start;
+ state->has_preferred_x = 0;
+ }
+}
+NK_INTERN void
+nk_textedit_move_to_last(struct nk_text_edit *state)
+{
+ /* move cursor to last character of selection */
+ if (NK_TEXT_HAS_SELECTION(state)) {
+ nk_textedit_sortselection(state);
+ nk_textedit_clamp(state);
+ state->cursor = state->select_end;
+ state->select_start = state->select_end;
+ state->has_preferred_x = 0;
+ }
}
-
-NK_API int
-nk_button_symbol(struct nk_context *ctx, enum nk_symbol_type symbol)
+NK_INTERN int
+nk_is_word_boundary( struct nk_text_edit *state, int idx)
{
- NK_ASSERT(ctx);
- if (!ctx) return 0;
- return nk_button_symbol_styled(ctx, &ctx->style.button, symbol);
+ int len;
+ nk_rune c;
+ if (idx <= 0) return 1;
+ if (!nk_str_at_rune(&state->string, idx, &c, &len)) return 1;
+ return (c == ' ' || c == '\t' ||c == 0x3000 || c == ',' || c == ';' ||
+ c == '(' || c == ')' || c == '{' || c == '}' || c == '[' || c == ']' ||
+ c == '|');
}
-
-NK_API int
-nk_button_image_styled(struct nk_context *ctx, const struct nk_style_button *style,
- struct nk_image img)
+NK_INTERN int
+nk_textedit_move_to_word_previous(struct nk_text_edit *state)
{
- struct nk_window *win;
- struct nk_panel *layout;
- const struct nk_input *in;
+ int c = state->cursor - 1;
+ while( c >= 0 && !nk_is_word_boundary(state, c))
+ --c;
- struct nk_rect bounds;
- enum nk_widget_layout_states state;
+ if( c < 0 )
+ c = 0;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return 0;
+ return c;
+}
+NK_INTERN int
+nk_textedit_move_to_word_next(struct nk_text_edit *state)
+{
+ const int len = state->string.len;
+ int c = state->cursor+1;
+ while( c < len && !nk_is_word_boundary(state, c))
+ ++c;
- win = ctx->current;
- layout = win->layout;
+ if( c > len )
+ c = len;
- state = nk_widget(&bounds, ctx);
- if (!state) return 0;
- in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
- return nk_do_button_image(&ctx->last_widget_state, &win->buffer, bounds,
- img, ctx->button_behavior, style, in);
+ return c;
}
-
-NK_API int
-nk_button_image(struct nk_context *ctx, struct nk_image img)
+NK_INTERN void
+nk_textedit_prep_selection_at_cursor(struct nk_text_edit *state)
{
- NK_ASSERT(ctx);
- if (!ctx) return 0;
- return nk_button_image_styled(ctx, &ctx->style.button, img);
+ /* update selection and cursor to match each other */
+ if (!NK_TEXT_HAS_SELECTION(state))
+ state->select_start = state->select_end = state->cursor;
+ else state->cursor = state->select_end;
}
-
NK_API int
-nk_button_symbol_text_styled(struct nk_context *ctx,
- const struct nk_style_button *style, enum nk_symbol_type symbol,
- const char *text, int len, nk_flags align)
+nk_textedit_cut(struct nk_text_edit *state)
{
- struct nk_window *win;
- struct nk_panel *layout;
- const struct nk_input *in;
-
- struct nk_rect bounds;
- enum nk_widget_layout_states state;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
+ /* API cut: delete selection */
+ if (state->mode == NK_TEXT_EDIT_MODE_VIEW)
return 0;
-
- win = ctx->current;
- layout = win->layout;
-
- state = nk_widget(&bounds, ctx);
- if (!state) return 0;
- in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
- return nk_do_button_text_symbol(&ctx->last_widget_state, &win->buffer, bounds,
- symbol, text, len, align, ctx->button_behavior,
- style, ctx->style.font, in);
+ if (NK_TEXT_HAS_SELECTION(state)) {
+ nk_textedit_delete_selection(state); /* implicitly clamps */
+ state->has_preferred_x = 0;
+ return 1;
+ }
+ return 0;
}
-
NK_API int
-nk_button_symbol_text(struct nk_context *ctx, enum nk_symbol_type symbol,
- const char* text, int len, nk_flags align)
+nk_textedit_paste(struct nk_text_edit *state, char const *ctext, int len)
{
- NK_ASSERT(ctx);
- if (!ctx) return 0;
- return nk_button_symbol_text_styled(ctx, &ctx->style.button, symbol, text, len, align);
+ /* API paste: replace existing selection with passed-in text */
+ int glyphs;
+ const char *text = (const char *) ctext;
+ if (state->mode == NK_TEXT_EDIT_MODE_VIEW) return 0;
+
+ /* if there's a selection, the paste should delete it */
+ nk_textedit_clamp(state);
+ nk_textedit_delete_selection(state);
+
+ /* try to insert the characters */
+ glyphs = nk_utf_len(ctext, len);
+ if (nk_str_insert_text_char(&state->string, state->cursor, text, len)) {
+ nk_textedit_makeundo_insert(state, state->cursor, glyphs);
+ state->cursor += len;
+ state->has_preferred_x = 0;
+ return 1;
+ }
+ /* remove the undo since we didn't actually insert the characters */
+ if (state->undo.undo_point)
+ --state->undo.undo_point;
+ return 0;
}
+NK_API void
+nk_textedit_text(struct nk_text_edit *state, const char *text, int total_len)
+{
+ nk_rune unicode;
+ int glyph_len;
+ int text_len = 0;
-NK_API int nk_button_symbol_label(struct nk_context *ctx, enum nk_symbol_type symbol,
- const char *label, nk_flags align)
-{return nk_button_symbol_text(ctx, symbol, label, nk_strlen(label), align);}
+ NK_ASSERT(state);
+ NK_ASSERT(text);
+ if (!text || !total_len || state->mode == NK_TEXT_EDIT_MODE_VIEW) return;
-NK_API int nk_button_symbol_label_styled(struct nk_context *ctx,
- const struct nk_style_button *style, enum nk_symbol_type symbol,
- const char *title, nk_flags align)
-{return nk_button_symbol_text_styled(ctx, style, symbol, title, nk_strlen(title), align);}
+ glyph_len = nk_utf_decode(text, &unicode, total_len);
+ while ((text_len < total_len) && glyph_len)
+ {
+ /* don't insert a backward delete, just process the event */
+ if (unicode == 127) goto next;
+ /* can't add newline in single-line mode */
+ if (unicode == '\n' && state->single_line) goto next;
+ /* filter incoming text */
+ if (state->filter && !state->filter(state, unicode)) goto next;
-NK_API int
-nk_button_image_text_styled(struct nk_context *ctx,
- const struct nk_style_button *style, struct nk_image img, const char *text,
- int len, nk_flags align)
+ if (!NK_TEXT_HAS_SELECTION(state) &&
+ state->cursor < state->string.len)
+ {
+ if (state->mode == NK_TEXT_EDIT_MODE_REPLACE) {
+ nk_textedit_makeundo_replace(state, state->cursor, 1, 1);
+ nk_str_delete_runes(&state->string, state->cursor, 1);
+ }
+ if (nk_str_insert_text_utf8(&state->string, state->cursor,
+ text+text_len, 1))
+ {
+ ++state->cursor;
+ state->has_preferred_x = 0;
+ }
+ } else {
+ nk_textedit_delete_selection(state); /* implicitly clamps */
+ if (nk_str_insert_text_utf8(&state->string, state->cursor,
+ text+text_len, 1))
+ {
+ nk_textedit_makeundo_insert(state, state->cursor, 1);
+ ++state->cursor;
+ state->has_preferred_x = 0;
+ }
+ }
+ next:
+ text_len += glyph_len;
+ glyph_len = nk_utf_decode(text + text_len, &unicode, total_len-text_len);
+ }
+}
+NK_LIB void
+nk_textedit_key(struct nk_text_edit *state, enum nk_keys key, int shift_mod,
+ const struct nk_user_font *font, float row_height)
{
- struct nk_window *win;
- struct nk_panel *layout;
- const struct nk_input *in;
+retry:
+ switch (key)
+ {
+ case NK_KEY_NONE:
+ case NK_KEY_CTRL:
+ case NK_KEY_ENTER:
+ case NK_KEY_SHIFT:
+ case NK_KEY_TAB:
+ case NK_KEY_COPY:
+ case NK_KEY_CUT:
+ case NK_KEY_PASTE:
+ case NK_KEY_MAX:
+ default: break;
+ case NK_KEY_TEXT_UNDO:
+ nk_textedit_undo(state);
+ state->has_preferred_x = 0;
+ break;
- struct nk_rect bounds;
- enum nk_widget_layout_states state;
+ case NK_KEY_TEXT_REDO:
+ nk_textedit_redo(state);
+ state->has_preferred_x = 0;
+ break;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return 0;
+ case NK_KEY_TEXT_SELECT_ALL:
+ nk_textedit_select_all(state);
+ state->has_preferred_x = 0;
+ break;
- win = ctx->current;
- layout = win->layout;
+ case NK_KEY_TEXT_INSERT_MODE:
+ if (state->mode == NK_TEXT_EDIT_MODE_VIEW)
+ state->mode = NK_TEXT_EDIT_MODE_INSERT;
+ break;
+ case NK_KEY_TEXT_REPLACE_MODE:
+ if (state->mode == NK_TEXT_EDIT_MODE_VIEW)
+ state->mode = NK_TEXT_EDIT_MODE_REPLACE;
+ break;
+ case NK_KEY_TEXT_RESET_MODE:
+ if (state->mode == NK_TEXT_EDIT_MODE_INSERT ||
+ state->mode == NK_TEXT_EDIT_MODE_REPLACE)
+ state->mode = NK_TEXT_EDIT_MODE_VIEW;
+ break;
+
+ case NK_KEY_LEFT:
+ if (shift_mod) {
+ nk_textedit_clamp(state);
+ nk_textedit_prep_selection_at_cursor(state);
+ /* move selection left */
+ if (state->select_end > 0)
+ --state->select_end;
+ state->cursor = state->select_end;
+ state->has_preferred_x = 0;
+ } else {
+ /* if currently there's a selection,
+ * move cursor to start of selection */
+ if (NK_TEXT_HAS_SELECTION(state))
+ nk_textedit_move_to_first(state);
+ else if (state->cursor > 0)
+ --state->cursor;
+ state->has_preferred_x = 0;
+ } break;
- state = nk_widget(&bounds, ctx);
- if (!state) return 0;
- in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
- return nk_do_button_text_image(&ctx->last_widget_state, &win->buffer,
- bounds, img, text, len, align, ctx->button_behavior,
- style, ctx->style.font, in);
-}
+ case NK_KEY_RIGHT:
+ if (shift_mod) {
+ nk_textedit_prep_selection_at_cursor(state);
+ /* move selection right */
+ ++state->select_end;
+ nk_textedit_clamp(state);
+ state->cursor = state->select_end;
+ state->has_preferred_x = 0;
+ } else {
+ /* if currently there's a selection,
+ * move cursor to end of selection */
+ if (NK_TEXT_HAS_SELECTION(state))
+ nk_textedit_move_to_last(state);
+ else ++state->cursor;
+ nk_textedit_clamp(state);
+ state->has_preferred_x = 0;
+ } break;
-NK_API int
-nk_button_image_text(struct nk_context *ctx, struct nk_image img,
- const char *text, int len, nk_flags align)
-{return nk_button_image_text_styled(ctx, &ctx->style.button,img, text, len, align);}
+ case NK_KEY_TEXT_WORD_LEFT:
+ if (shift_mod) {
+ if( !NK_TEXT_HAS_SELECTION( state ) )
+ nk_textedit_prep_selection_at_cursor(state);
+ state->cursor = nk_textedit_move_to_word_previous(state);
+ state->select_end = state->cursor;
+ nk_textedit_clamp(state );
+ } else {
+ if (NK_TEXT_HAS_SELECTION(state))
+ nk_textedit_move_to_first(state);
+ else {
+ state->cursor = nk_textedit_move_to_word_previous(state);
+ nk_textedit_clamp(state );
+ }
+ } break;
+ case NK_KEY_TEXT_WORD_RIGHT:
+ if (shift_mod) {
+ if( !NK_TEXT_HAS_SELECTION( state ) )
+ nk_textedit_prep_selection_at_cursor(state);
+ state->cursor = nk_textedit_move_to_word_next(state);
+ state->select_end = state->cursor;
+ nk_textedit_clamp(state);
+ } else {
+ if (NK_TEXT_HAS_SELECTION(state))
+ nk_textedit_move_to_last(state);
+ else {
+ state->cursor = nk_textedit_move_to_word_next(state);
+ nk_textedit_clamp(state );
+ }
+ } break;
-NK_API int nk_button_image_label(struct nk_context *ctx, struct nk_image img,
- const char *label, nk_flags align)
-{return nk_button_image_text(ctx, img, label, nk_strlen(label), align);}
+ case NK_KEY_DOWN: {
+ struct nk_text_find find;
+ struct nk_text_edit_row row;
+ int i, sel = shift_mod;
-NK_API int nk_button_image_label_styled(struct nk_context *ctx,
- const struct nk_style_button *style, struct nk_image img,
- const char *label, nk_flags text_alignment)
-{return nk_button_image_text_styled(ctx, style, img, label, nk_strlen(label), text_alignment);}
+ if (state->single_line) {
+ /* on windows, up&down in single-line behave like left&right */
+ key = NK_KEY_RIGHT;
+ goto retry;
+ }
-/*----------------------------------------------------------------
- *
- * SELECTABLE
- *
- * --------------------------------------------------------------*/
-NK_API int
-nk_selectable_text(struct nk_context *ctx, const char *str, int len,
- nk_flags align, int *value)
-{
- struct nk_window *win;
- struct nk_panel *layout;
- const struct nk_input *in;
- const struct nk_style *style;
+ if (sel)
+ nk_textedit_prep_selection_at_cursor(state);
+ else if (NK_TEXT_HAS_SELECTION(state))
+ nk_textedit_move_to_last(state);
- enum nk_widget_layout_states state;
- struct nk_rect bounds;
+ /* compute current position of cursor point */
+ nk_textedit_clamp(state);
+ nk_textedit_find_charpos(&find, state, state->cursor, state->single_line,
+ font, row_height);
- NK_ASSERT(ctx);
- NK_ASSERT(value);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout || !value)
- return 0;
+ /* now find character position down a row */
+ if (find.length)
+ {
+ float x;
+ float goal_x = state->has_preferred_x ? state->preferred_x : find.x;
+ int start = find.first_char + find.length;
- win = ctx->current;
- layout = win->layout;
- style = &ctx->style;
+ state->cursor = start;
+ nk_textedit_layout_row(&row, state, state->cursor, row_height, font);
+ x = row.x0;
- state = nk_widget(&bounds, ctx);
- if (!state) return 0;
- in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
- return nk_do_selectable(&ctx->last_widget_state, &win->buffer, bounds,
- str, len, align, value, &style->selectable, in, style->font);
-}
+ for (i=0; i < row.num_chars && x < row.x1; ++i) {
+ float dx = nk_textedit_get_width(state, start, i, font);
+ x += dx;
+ if (x > goal_x)
+ break;
+ ++state->cursor;
+ }
+ nk_textedit_clamp(state);
-NK_API int
-nk_selectable_image_text(struct nk_context *ctx, struct nk_image img,
- const char *str, int len, nk_flags align, int *value)
-{
- struct nk_window *win;
- struct nk_panel *layout;
- const struct nk_input *in;
- const struct nk_style *style;
+ state->has_preferred_x = 1;
+ state->preferred_x = goal_x;
+ if (sel)
+ state->select_end = state->cursor;
+ }
+ } break;
- enum nk_widget_layout_states state;
- struct nk_rect bounds;
+ case NK_KEY_UP: {
+ struct nk_text_find find;
+ struct nk_text_edit_row row;
+ int i, sel = shift_mod;
- NK_ASSERT(ctx);
- NK_ASSERT(value);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout || !value)
- return 0;
+ if (state->single_line) {
+ /* on windows, up&down become left&right */
+ key = NK_KEY_LEFT;
+ goto retry;
+ }
- win = ctx->current;
- layout = win->layout;
- style = &ctx->style;
+ if (sel)
+ nk_textedit_prep_selection_at_cursor(state);
+ else if (NK_TEXT_HAS_SELECTION(state))
+ nk_textedit_move_to_first(state);
- state = nk_widget(&bounds, ctx);
- if (!state) return 0;
- in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
- return nk_do_selectable_image(&ctx->last_widget_state, &win->buffer, bounds,
- str, len, align, value, &img, &style->selectable, in, style->font);
-}
+ /* compute current position of cursor point */
+ nk_textedit_clamp(state);
+ nk_textedit_find_charpos(&find, state, state->cursor, state->single_line,
+ font, row_height);
-NK_API int nk_select_text(struct nk_context *ctx, const char *str, int len,
- nk_flags align, int value)
-{nk_selectable_text(ctx, str, len, align, &value);return value;}
+ /* can only go up if there's a previous row */
+ if (find.prev_first != find.first_char) {
+ /* now find character position up a row */
+ float x;
+ float goal_x = state->has_preferred_x ? state->preferred_x : find.x;
-NK_API int nk_selectable_label(struct nk_context *ctx, const char *str, nk_flags align, int *value)
-{return nk_selectable_text(ctx, str, nk_strlen(str), align, value);}
+ state->cursor = find.prev_first;
+ nk_textedit_layout_row(&row, state, state->cursor, row_height, font);
+ x = row.x0;
-NK_API int nk_selectable_image_label(struct nk_context *ctx,struct nk_image img,
- const char *str, nk_flags align, int *value)
-{return nk_selectable_image_text(ctx, img, str, nk_strlen(str), align, value);}
+ for (i=0; i < row.num_chars && x < row.x1; ++i) {
+ float dx = nk_textedit_get_width(state, find.prev_first, i, font);
+ x += dx;
+ if (x > goal_x)
+ break;
+ ++state->cursor;
+ }
+ nk_textedit_clamp(state);
-NK_API int nk_select_label(struct nk_context *ctx, const char *str, nk_flags align, int value)
-{nk_selectable_text(ctx, str, nk_strlen(str), align, &value);return value;}
+ state->has_preferred_x = 1;
+ state->preferred_x = goal_x;
+ if (sel) state->select_end = state->cursor;
+ }
+ } break;
-NK_API int nk_select_image_label(struct nk_context *ctx, struct nk_image img,
- const char *str, nk_flags align, int value)
-{nk_selectable_image_text(ctx, img, str, nk_strlen(str), align, &value);return value;}
+ case NK_KEY_DEL:
+ if (state->mode == NK_TEXT_EDIT_MODE_VIEW)
+ break;
+ if (NK_TEXT_HAS_SELECTION(state))
+ nk_textedit_delete_selection(state);
+ else {
+ int n = state->string.len;
+ if (state->cursor < n)
+ nk_textedit_delete(state, state->cursor, 1);
+ }
+ state->has_preferred_x = 0;
+ break;
-NK_API int nk_select_image_text(struct nk_context *ctx, struct nk_image img,
- const char *str, int len, nk_flags align, int value)
-{nk_selectable_image_text(ctx, img, str, len, align, &value);return value;}
+ case NK_KEY_BACKSPACE:
+ if (state->mode == NK_TEXT_EDIT_MODE_VIEW)
+ break;
+ if (NK_TEXT_HAS_SELECTION(state))
+ nk_textedit_delete_selection(state);
+ else {
+ nk_textedit_clamp(state);
+ if (state->cursor > 0) {
+ nk_textedit_delete(state, state->cursor-1, 1);
+ --state->cursor;
+ }
+ }
+ state->has_preferred_x = 0;
+ break;
-/*----------------------------------------------------------------
- *
- * CHECKBOX
- *
- * --------------------------------------------------------------*/
-NK_API int
-nk_check_text(struct nk_context *ctx, const char *text, int len, int active)
-{
- struct nk_window *win;
- struct nk_panel *layout;
- const struct nk_input *in;
- const struct nk_style *style;
+ case NK_KEY_TEXT_START:
+ if (shift_mod) {
+ nk_textedit_prep_selection_at_cursor(state);
+ state->cursor = state->select_end = 0;
+ state->has_preferred_x = 0;
+ } else {
+ state->cursor = state->select_start = state->select_end = 0;
+ state->has_preferred_x = 0;
+ }
+ break;
- struct nk_rect bounds;
- enum nk_widget_layout_states state;
+ case NK_KEY_TEXT_END:
+ if (shift_mod) {
+ nk_textedit_prep_selection_at_cursor(state);
+ state->cursor = state->select_end = state->string.len;
+ state->has_preferred_x = 0;
+ } else {
+ state->cursor = state->string.len;
+ state->select_start = state->select_end = 0;
+ state->has_preferred_x = 0;
+ }
+ break;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return active;
+ case NK_KEY_TEXT_LINE_START: {
+ if (shift_mod) {
+ struct nk_text_find find;
+ nk_textedit_clamp(state);
+ nk_textedit_prep_selection_at_cursor(state);
+ if (state->string.len && state->cursor == state->string.len)
+ --state->cursor;
+ nk_textedit_find_charpos(&find, state,state->cursor, state->single_line,
+ font, row_height);
+ state->cursor = state->select_end = find.first_char;
+ state->has_preferred_x = 0;
+ } else {
+ struct nk_text_find find;
+ if (state->string.len && state->cursor == state->string.len)
+ --state->cursor;
+ nk_textedit_clamp(state);
+ nk_textedit_move_to_first(state);
+ nk_textedit_find_charpos(&find, state, state->cursor, state->single_line,
+ font, row_height);
+ state->cursor = find.first_char;
+ state->has_preferred_x = 0;
+ }
+ } break;
- win = ctx->current;
- style = &ctx->style;
- layout = win->layout;
+ case NK_KEY_TEXT_LINE_END: {
+ if (shift_mod) {
+ struct nk_text_find find;
+ nk_textedit_clamp(state);
+ nk_textedit_prep_selection_at_cursor(state);
+ nk_textedit_find_charpos(&find, state, state->cursor, state->single_line,
+ font, row_height);
+ state->has_preferred_x = 0;
+ state->cursor = find.first_char + find.length;
+ if (find.length > 0 && nk_str_rune_at(&state->string, state->cursor-1) == '\n')
+ --state->cursor;
+ state->select_end = state->cursor;
+ } else {
+ struct nk_text_find find;
+ nk_textedit_clamp(state);
+ nk_textedit_move_to_first(state);
+ nk_textedit_find_charpos(&find, state, state->cursor, state->single_line,
+ font, row_height);
- state = nk_widget(&bounds, ctx);
- if (!state) return active;
- in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
- nk_do_toggle(&ctx->last_widget_state, &win->buffer, bounds, &active,
- text, len, NK_TOGGLE_CHECK, &style->checkbox, in, style->font);
- return active;
+ state->has_preferred_x = 0;
+ state->cursor = find.first_char + find.length;
+ if (find.length > 0 && nk_str_rune_at(&state->string, state->cursor-1) == '\n')
+ --state->cursor;
+ }} break;
+ }
}
-
-NK_API unsigned int
-nk_check_flags_text(struct nk_context *ctx, const char *text, int len,
- unsigned int flags, unsigned int value)
+NK_INTERN void
+nk_textedit_flush_redo(struct nk_text_undo_state *state)
{
- int old_active;
- NK_ASSERT(ctx);
- NK_ASSERT(text);
- if (!ctx || !text) return flags;
- old_active = (int)((flags & value) & value);
- if (nk_check_text(ctx, text, len, old_active))
- flags |= value;
- else flags &= ~value;
- return flags;
+ state->redo_point = NK_TEXTEDIT_UNDOSTATECOUNT;
+ state->redo_char_point = NK_TEXTEDIT_UNDOCHARCOUNT;
}
-
-NK_API int
-nk_checkbox_text(struct nk_context *ctx, const char *text, int len, int *active)
+NK_INTERN void
+nk_textedit_discard_undo(struct nk_text_undo_state *state)
{
- int old_val;
- NK_ASSERT(ctx);
- NK_ASSERT(text);
- NK_ASSERT(active);
- if (!ctx || !text || !active) return 0;
- old_val = *active;
- *active = nk_check_text(ctx, text, len, *active);
- return old_val != *active;
+ /* discard the oldest entry in the undo list */
+ if (state->undo_point > 0) {
+ /* if the 0th undo state has characters, clean those up */
+ if (state->undo_rec[0].char_storage >= 0) {
+ int n = state->undo_rec[0].insert_length, i;
+ /* delete n characters from all other records */
+ state->undo_char_point = (short)(state->undo_char_point - n);
+ NK_MEMCPY(state->undo_char, state->undo_char + n,
+ (nk_size)state->undo_char_point*sizeof(nk_rune));
+ for (i=0; i < state->undo_point; ++i) {
+ if (state->undo_rec[i].char_storage >= 0)
+ state->undo_rec[i].char_storage = (short)
+ (state->undo_rec[i].char_storage - n);
+ }
+ }
+ --state->undo_point;
+ NK_MEMCPY(state->undo_rec, state->undo_rec+1,
+ (nk_size)((nk_size)state->undo_point * sizeof(state->undo_rec[0])));
+ }
}
-
-NK_API int
-nk_checkbox_flags_text(struct nk_context *ctx, const char *text, int len,
- unsigned int *flags, unsigned int value)
+NK_INTERN void
+nk_textedit_discard_redo(struct nk_text_undo_state *state)
{
- int active;
- NK_ASSERT(ctx);
- NK_ASSERT(text);
- NK_ASSERT(flags);
- if (!ctx || !text || !flags) return 0;
-
- active = (int)((*flags & value) & value);
- if (nk_checkbox_text(ctx, text, len, &active)) {
- if (active) *flags |= value;
- else *flags &= ~value;
- return 1;
+/* discard the oldest entry in the redo list--it's bad if this
+ ever happens, but because undo & redo have to store the actual
+ characters in different cases, the redo character buffer can
+ fill up even though the undo buffer didn't */
+ nk_size num;
+ int k = NK_TEXTEDIT_UNDOSTATECOUNT-1;
+ if (state->redo_point <= k) {
+ /* if the k'th undo state has characters, clean those up */
+ if (state->undo_rec[k].char_storage >= 0) {
+ int n = state->undo_rec[k].insert_length, i;
+ /* delete n characters from all other records */
+ state->redo_char_point = (short)(state->redo_char_point + n);
+ num = (nk_size)(NK_TEXTEDIT_UNDOCHARCOUNT - state->redo_char_point);
+ NK_MEMCPY(state->undo_char + state->redo_char_point,
+ state->undo_char + state->redo_char_point-n, num * sizeof(char));
+ for (i = state->redo_point; i < k; ++i) {
+ if (state->undo_rec[i].char_storage >= 0) {
+ state->undo_rec[i].char_storage = (short)
+ (state->undo_rec[i].char_storage + n);
+ }
+ }
+ }
+ ++state->redo_point;
+ num = (nk_size)(NK_TEXTEDIT_UNDOSTATECOUNT - state->redo_point);
+ if (num) NK_MEMCPY(state->undo_rec + state->redo_point-1,
+ state->undo_rec + state->redo_point, num * sizeof(state->undo_rec[0]));
}
- return 0;
}
+NK_INTERN struct nk_text_undo_record*
+nk_textedit_create_undo_record(struct nk_text_undo_state *state, int numchars)
+{
+ /* any time we create a new undo record, we discard redo*/
+ nk_textedit_flush_redo(state);
-NK_API int nk_check_label(struct nk_context *ctx, const char *label, int active)
-{return nk_check_text(ctx, label, nk_strlen(label), active);}
+ /* if we have no free records, we have to make room,
+ * by sliding the existing records down */
+ if (state->undo_point == NK_TEXTEDIT_UNDOSTATECOUNT)
+ nk_textedit_discard_undo(state);
-NK_API unsigned int nk_check_flags_label(struct nk_context *ctx, const char *label,
- unsigned int flags, unsigned int value)
-{return nk_check_flags_text(ctx, label, nk_strlen(label), flags, value);}
+ /* if the characters to store won't possibly fit in the buffer,
+ * we can't undo */
+ if (numchars > NK_TEXTEDIT_UNDOCHARCOUNT) {
+ state->undo_point = 0;
+ state->undo_char_point = 0;
+ return 0;
+ }
-NK_API int nk_checkbox_label(struct nk_context *ctx, const char *label, int *active)
-{return nk_checkbox_text(ctx, label, nk_strlen(label), active);}
+ /* if we don't have enough free characters in the buffer,
+ * we have to make room */
+ while (state->undo_char_point + numchars > NK_TEXTEDIT_UNDOCHARCOUNT)
+ nk_textedit_discard_undo(state);
+ return &state->undo_rec[state->undo_point++];
+}
+NK_INTERN nk_rune*
+nk_textedit_createundo(struct nk_text_undo_state *state, int pos,
+ int insert_len, int delete_len)
+{
+ struct nk_text_undo_record *r = nk_textedit_create_undo_record(state, insert_len);
+ if (r == 0)
+ return 0;
-NK_API int nk_checkbox_flags_label(struct nk_context *ctx, const char *label,
- unsigned int *flags, unsigned int value)
-{return nk_checkbox_flags_text(ctx, label, nk_strlen(label), flags, value);}
+ r->where = pos;
+ r->insert_length = (short) insert_len;
+ r->delete_length = (short) delete_len;
-/*----------------------------------------------------------------
- *
- * OPTION
- *
- * --------------------------------------------------------------*/
-NK_API int
-nk_option_text(struct nk_context *ctx, const char *text, int len, int is_active)
+ if (insert_len == 0) {
+ r->char_storage = -1;
+ return 0;
+ } else {
+ r->char_storage = state->undo_char_point;
+ state->undo_char_point = (short)(state->undo_char_point + insert_len);
+ return &state->undo_char[r->char_storage];
+ }
+}
+NK_API void
+nk_textedit_undo(struct nk_text_edit *state)
{
- struct nk_window *win;
- struct nk_panel *layout;
- const struct nk_input *in;
- const struct nk_style *style;
+ struct nk_text_undo_state *s = &state->undo;
+ struct nk_text_undo_record u, *r;
+ if (s->undo_point == 0)
+ return;
+
+ /* we need to do two things: apply the undo record, and create a redo record */
+ u = s->undo_rec[s->undo_point-1];
+ r = &s->undo_rec[s->redo_point-1];
+ r->char_storage = -1;
+
+ r->insert_length = u.delete_length;
+ r->delete_length = u.insert_length;
+ r->where = u.where;
+
+ if (u.delete_length)
+ {
+ /* if the undo record says to delete characters, then the redo record will
+ need to re-insert the characters that get deleted, so we need to store
+ them.
+ there are three cases:
+ - there's enough room to store the characters
+ - characters stored for *redoing* don't leave room for redo
+ - characters stored for *undoing* don't leave room for redo
+ if the last is true, we have to bail */
+ if (s->undo_char_point + u.delete_length >= NK_TEXTEDIT_UNDOCHARCOUNT) {
+ /* the undo records take up too much character space; there's no space
+ * to store the redo characters */
+ r->insert_length = 0;
+ } else {
+ int i;
+ /* there's definitely room to store the characters eventually */
+ while (s->undo_char_point + u.delete_length > s->redo_char_point) {
+ /* there's currently not enough room, so discard a redo record */
+ nk_textedit_discard_redo(s);
+ /* should never happen: */
+ if (s->redo_point == NK_TEXTEDIT_UNDOSTATECOUNT)
+ return;
+ }
- struct nk_rect bounds;
- enum nk_widget_layout_states state;
+ r = &s->undo_rec[s->redo_point-1];
+ r->char_storage = (short)(s->redo_char_point - u.delete_length);
+ s->redo_char_point = (short)(s->redo_char_point - u.delete_length);
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return is_active;
+ /* now save the characters */
+ for (i=0; i < u.delete_length; ++i)
+ s->undo_char[r->char_storage + i] =
+ nk_str_rune_at(&state->string, u.where + i);
+ }
+ /* now we can carry out the deletion */
+ nk_str_delete_runes(&state->string, u.where, u.delete_length);
+ }
- win = ctx->current;
- style = &ctx->style;
- layout = win->layout;
+ /* check type of recorded action: */
+ if (u.insert_length) {
+ /* easy case: was a deletion, so we need to insert n characters */
+ nk_str_insert_text_runes(&state->string, u.where,
+ &s->undo_char[u.char_storage], u.insert_length);
+ s->undo_char_point = (short)(s->undo_char_point - u.insert_length);
+ }
+ state->cursor = (short)(u.where + u.insert_length);
- state = nk_widget(&bounds, ctx);
- if (!state) return state;
- in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
- nk_do_toggle(&ctx->last_widget_state, &win->buffer, bounds, &is_active,
- text, len, NK_TOGGLE_OPTION, &style->option, in, style->font);
- return is_active;
+ s->undo_point--;
+ s->redo_point--;
}
-
-NK_API int
-nk_radio_text(struct nk_context *ctx, const char *text, int len, int *active)
+NK_API void
+nk_textedit_redo(struct nk_text_edit *state)
{
- int old_value;
- NK_ASSERT(ctx);
- NK_ASSERT(text);
- NK_ASSERT(active);
- if (!ctx || !text || !active) return 0;
- old_value = *active;
- *active = nk_option_text(ctx, text, len, old_value);
- return old_value != *active;
-}
-
-NK_API int
-nk_option_label(struct nk_context *ctx, const char *label, int active)
-{return nk_option_text(ctx, label, nk_strlen(label), active);}
-
-NK_API int
-nk_radio_label(struct nk_context *ctx, const char *label, int *active)
-{return nk_radio_text(ctx, label, nk_strlen(label), active);}
+ struct nk_text_undo_state *s = &state->undo;
+ struct nk_text_undo_record *u, r;
+ if (s->redo_point == NK_TEXTEDIT_UNDOSTATECOUNT)
+ return;
-/*----------------------------------------------------------------
- *
- * SLIDER
- *
- * --------------------------------------------------------------*/
-NK_API int
-nk_slider_float(struct nk_context *ctx, float min_value, float *value, float max_value,
- float value_step)
-{
- struct nk_window *win;
- struct nk_panel *layout;
- struct nk_input *in;
- const struct nk_style *style;
+ /* we need to do two things: apply the redo record, and create an undo record */
+ u = &s->undo_rec[s->undo_point];
+ r = s->undo_rec[s->redo_point];
- int ret = 0;
- float old_value;
- struct nk_rect bounds;
- enum nk_widget_layout_states state;
+ /* we KNOW there must be room for the undo record, because the redo record
+ was derived from an undo record */
+ u->delete_length = r.insert_length;
+ u->insert_length = r.delete_length;
+ u->where = r.where;
+ u->char_storage = -1;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- NK_ASSERT(value);
- if (!ctx || !ctx->current || !ctx->current->layout || !value)
- return ret;
+ if (r.delete_length) {
+ /* the redo record requires us to delete characters, so the undo record
+ needs to store the characters */
+ if (s->undo_char_point + u->insert_length > s->redo_char_point) {
+ u->insert_length = 0;
+ u->delete_length = 0;
+ } else {
+ int i;
+ u->char_storage = s->undo_char_point;
+ s->undo_char_point = (short)(s->undo_char_point + u->insert_length);
- win = ctx->current;
- style = &ctx->style;
- layout = win->layout;
+ /* now save the characters */
+ for (i=0; i < u->insert_length; ++i) {
+ s->undo_char[u->char_storage + i] =
+ nk_str_rune_at(&state->string, u->where + i);
+ }
+ }
+ nk_str_delete_runes(&state->string, r.where, r.delete_length);
+ }
- state = nk_widget(&bounds, ctx);
- if (!state) return ret;
- in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+ if (r.insert_length) {
+ /* easy case: need to insert n characters */
+ nk_str_insert_text_runes(&state->string, r.where,
+ &s->undo_char[r.char_storage], r.insert_length);
+ }
+ state->cursor = r.where + r.insert_length;
- old_value = *value;
- *value = nk_do_slider(&ctx->last_widget_state, &win->buffer, bounds, min_value,
- old_value, max_value, value_step, &style->slider, in, style->font);
- return (old_value > *value || old_value < *value);
+ s->undo_point++;
+ s->redo_point++;
}
-
-NK_API float
-nk_slide_float(struct nk_context *ctx, float min, float val, float max, float step)
+NK_INTERN void
+nk_textedit_makeundo_insert(struct nk_text_edit *state, int where, int length)
{
- nk_slider_float(ctx, min, &val, max, step); return val;
+ nk_textedit_createundo(&state->undo, where, 0, length);
}
-
-NK_API int
-nk_slide_int(struct nk_context *ctx, int min, int val, int max, int step)
+NK_INTERN void
+nk_textedit_makeundo_delete(struct nk_text_edit *state, int where, int length)
{
- float value = (float)val;
- nk_slider_float(ctx, (float)min, &value, (float)max, (float)step);
- return (int)value;
+ int i;
+ nk_rune *p = nk_textedit_createundo(&state->undo, where, length, 0);
+ if (p) {
+ for (i=0; i < length; ++i)
+ p[i] = nk_str_rune_at(&state->string, where+i);
+ }
}
-
-NK_API int
-nk_slider_int(struct nk_context *ctx, int min, int *val, int max, int step)
+NK_INTERN void
+nk_textedit_makeundo_replace(struct nk_text_edit *state, int where,
+ int old_length, int new_length)
{
- int ret;
- float value = (float)*val;
- ret = nk_slider_float(ctx, (float)min, &value, (float)max, (float)step);
- *val = (int)value;
- return ret;
+ int i;
+ nk_rune *p = nk_textedit_createundo(&state->undo, where, old_length, new_length);
+ if (p) {
+ for (i=0; i < old_length; ++i)
+ p[i] = nk_str_rune_at(&state->string, where+i);
+ }
}
-
-/*----------------------------------------------------------------
- *
- * PROGRESSBAR
- *
- * --------------------------------------------------------------*/
-NK_API int
-nk_progress(struct nk_context *ctx, nk_size *cur, nk_size max, int is_modifyable)
+NK_LIB void
+nk_textedit_clear_state(struct nk_text_edit *state, enum nk_text_edit_type type,
+ nk_plugin_filter filter)
{
- struct nk_window *win;
- struct nk_panel *layout;
- const struct nk_style *style;
- const struct nk_input *in;
-
- struct nk_rect bounds;
- enum nk_widget_layout_states state;
- nk_size old_value;
-
- NK_ASSERT(ctx);
- NK_ASSERT(cur);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout || !cur)
- return 0;
-
- win = ctx->current;
- style = &ctx->style;
- layout = win->layout;
- state = nk_widget(&bounds, ctx);
- if (!state) return 0;
-
- in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
- old_value = *cur;
- *cur = nk_do_progress(&ctx->last_widget_state, &win->buffer, bounds,
- *cur, max, is_modifyable, &style->progress, in);
- return (*cur != old_value);
+ /* reset the state to default */
+ state->undo.undo_point = 0;
+ state->undo.undo_char_point = 0;
+ state->undo.redo_point = NK_TEXTEDIT_UNDOSTATECOUNT;
+ state->undo.redo_char_point = NK_TEXTEDIT_UNDOCHARCOUNT;
+ state->select_end = state->select_start = 0;
+ state->cursor = 0;
+ state->has_preferred_x = 0;
+ state->preferred_x = 0;
+ state->cursor_at_end_of_line = 0;
+ state->initialized = 1;
+ state->single_line = (unsigned char)(type == NK_TEXT_EDIT_SINGLE_LINE);
+ state->mode = NK_TEXT_EDIT_MODE_VIEW;
+ state->filter = filter;
+ state->scrollbar = nk_vec2(0,0);
}
-
-NK_API nk_size nk_prog(struct nk_context *ctx, nk_size cur, nk_size max, int modifyable)
-{nk_progress(ctx, &cur, max, modifyable);return cur;}
-
-/*----------------------------------------------------------------
- *
- * EDIT
- *
- * --------------------------------------------------------------*/
NK_API void
-nk_edit_focus(struct nk_context *ctx, nk_flags flags)
+nk_textedit_init_fixed(struct nk_text_edit *state, void *memory, nk_size size)
+{
+ NK_ASSERT(state);
+ NK_ASSERT(memory);
+ if (!state || !memory || !size) return;
+ NK_MEMSET(state, 0, sizeof(struct nk_text_edit));
+ nk_textedit_clear_state(state, NK_TEXT_EDIT_SINGLE_LINE, 0);
+ nk_str_init_fixed(&state->string, memory, size);
+}
+NK_API void
+nk_textedit_init(struct nk_text_edit *state, struct nk_allocator *alloc, nk_size size)
+{
+ NK_ASSERT(state);
+ NK_ASSERT(alloc);
+ if (!state || !alloc) return;
+ NK_MEMSET(state, 0, sizeof(struct nk_text_edit));
+ nk_textedit_clear_state(state, NK_TEXT_EDIT_SINGLE_LINE, 0);
+ nk_str_init(&state->string, alloc, size);
+}
+#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
+NK_API void
+nk_textedit_init_default(struct nk_text_edit *state)
+{
+ NK_ASSERT(state);
+ if (!state) return;
+ NK_MEMSET(state, 0, sizeof(struct nk_text_edit));
+ nk_textedit_clear_state(state, NK_TEXT_EDIT_SINGLE_LINE, 0);
+ nk_str_init_default(&state->string);
+}
+#endif
+NK_API void
+nk_textedit_select_all(struct nk_text_edit *state)
{
- nk_hash hash;
- struct nk_window *win;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current) return;
-
- win = ctx->current;
- hash = win->edit.seq;
- win->edit.active = nk_true;
- win->edit.name = hash;
- if (flags & NK_EDIT_ALWAYS_INSERT_MODE)
- win->edit.mode = NK_TEXT_EDIT_MODE_INSERT;
+ NK_ASSERT(state);
+ state->select_start = 0;
+ state->select_end = state->string.len;
}
-
NK_API void
-nk_edit_unfocus(struct nk_context *ctx)
+nk_textedit_free(struct nk_text_edit *state)
{
- struct nk_window *win;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current) return;
-
- win = ctx->current;
- win->edit.active = nk_false;
- win->edit.name = 0;
+ NK_ASSERT(state);
+ if (!state) return;
+ nk_str_free(&state->string);
}
-NK_API nk_flags
-nk_edit_string(struct nk_context *ctx, nk_flags flags,
- char *memory, int *len, int max, nk_plugin_filter filter)
-{
- nk_hash hash;
- nk_flags state;
- struct nk_text_edit *edit;
- struct nk_window *win;
-
- NK_ASSERT(ctx);
- NK_ASSERT(memory);
- NK_ASSERT(len);
- if (!ctx || !memory || !len)
- return 0;
- filter = (!filter) ? nk_filter_default: filter;
- win = ctx->current;
- hash = win->edit.seq;
- edit = &ctx->text_edit;
- nk_textedit_clear_state(&ctx->text_edit, (flags & NK_EDIT_MULTILINE)?
- NK_TEXT_EDIT_MULTI_LINE: NK_TEXT_EDIT_SINGLE_LINE, filter);
- if (win->edit.active && hash == win->edit.name) {
- if (flags & NK_EDIT_NO_CURSOR)
- edit->cursor = nk_utf_len(memory, *len);
- else edit->cursor = win->edit.cursor;
- if (!(flags & NK_EDIT_SELECTABLE)) {
- edit->select_start = win->edit.cursor;
- edit->select_end = win->edit.cursor;
- } else {
- edit->select_start = win->edit.sel_start;
- edit->select_end = win->edit.sel_end;
- }
- edit->mode = win->edit.mode;
- edit->scrollbar.x = (float)win->edit.scrollbar.x;
- edit->scrollbar.y = (float)win->edit.scrollbar.y;
- edit->active = nk_true;
- } else edit->active = nk_false;
- max = NK_MAX(1, max);
- *len = NK_MIN(*len, max-1);
- nk_str_init_fixed(&edit->string, memory, (nk_size)max);
- edit->string.buffer.allocated = (nk_size)*len;
- edit->string.len = nk_utf_len(memory, *len);
- state = nk_edit_buffer(ctx, flags, edit, filter);
- *len = (int)edit->string.buffer.allocated;
- if (edit->active) {
- win->edit.cursor = edit->cursor;
- win->edit.sel_start = edit->select_start;
- win->edit.sel_end = edit->select_end;
- win->edit.mode = edit->mode;
- win->edit.scrollbar.x = (nk_ushort)edit->scrollbar.x;
- win->edit.scrollbar.y = (nk_ushort)edit->scrollbar.y;
- }
- return state;
+/* ===============================================================
+ *
+ * FILTER
+ *
+ * ===============================================================*/
+NK_API int
+nk_filter_default(const struct nk_text_edit *box, nk_rune unicode)
+{
+ NK_UNUSED(unicode);
+ NK_UNUSED(box);
+ return nk_true;
}
-
-NK_API nk_flags
-nk_edit_buffer(struct nk_context *ctx, nk_flags flags,
- struct nk_text_edit *edit, nk_plugin_filter filter)
+NK_API int
+nk_filter_ascii(const struct nk_text_edit *box, nk_rune unicode)
{
- struct nk_window *win;
- struct nk_style *style;
- struct nk_input *in;
-
- enum nk_widget_layout_states state;
- struct nk_rect bounds;
-
- nk_flags ret_flags = 0;
- unsigned char prev_state;
- nk_hash hash;
-
- /* make sure correct values */
- NK_ASSERT(ctx);
- NK_ASSERT(edit);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return 0;
-
- win = ctx->current;
- style = &ctx->style;
- state = nk_widget(&bounds, ctx);
- if (!state) return state;
- in = (win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
-
- /* check if edit is currently hot item */
- hash = win->edit.seq++;
- if (win->edit.active && hash == win->edit.name) {
- if (flags & NK_EDIT_NO_CURSOR)
- edit->cursor = edit->string.len;
- if (!(flags & NK_EDIT_SELECTABLE)) {
- edit->select_start = edit->cursor;
- edit->select_end = edit->cursor;
- }
- if (flags & NK_EDIT_CLIPBOARD)
- edit->clip = ctx->clip;
- }
-
- filter = (!filter) ? nk_filter_default: filter;
- prev_state = (unsigned char)edit->active;
- in = (flags & NK_EDIT_READ_ONLY) ? 0: in;
- ret_flags = nk_do_edit(&ctx->last_widget_state, &win->buffer, bounds, flags,
- filter, edit, &style->edit, in, style->font);
-
- if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER)
- ctx->style.cursor_active = ctx->style.cursors[NK_CURSOR_TEXT];
- if (edit->active && prev_state != edit->active) {
- /* current edit is now hot */
- win->edit.active = nk_true;
- win->edit.name = hash;
- } else if (prev_state && !edit->active) {
- /* current edit is now cold */
- win->edit.active = nk_false;
- }
- return ret_flags;
+ NK_UNUSED(box);
+ if (unicode > 128) return nk_false;
+ else return nk_true;
}
-
-NK_API nk_flags
-nk_edit_string_zero_terminated(struct nk_context *ctx, nk_flags flags,
- char *buffer, int max, nk_plugin_filter filter)
+NK_API int
+nk_filter_float(const struct nk_text_edit *box, nk_rune unicode)
{
- nk_flags result;
- int len = nk_strlen(buffer);
- result = nk_edit_string(ctx, flags, buffer, &len, max, filter);
- buffer[NK_MIN(NK_MAX(max-1,0), len)] = '\0';
- return result;
+ NK_UNUSED(box);
+ if ((unicode < '0' || unicode > '9') && unicode != '.' && unicode != '-')
+ return nk_false;
+ else return nk_true;
+}
+NK_API int
+nk_filter_decimal(const struct nk_text_edit *box, nk_rune unicode)
+{
+ NK_UNUSED(box);
+ if ((unicode < '0' || unicode > '9') && unicode != '-')
+ return nk_false;
+ else return nk_true;
+}
+NK_API int
+nk_filter_hex(const struct nk_text_edit *box, nk_rune unicode)
+{
+ NK_UNUSED(box);
+ if ((unicode < '0' || unicode > '9') &&
+ (unicode < 'a' || unicode > 'f') &&
+ (unicode < 'A' || unicode > 'F'))
+ return nk_false;
+ else return nk_true;
+}
+NK_API int
+nk_filter_oct(const struct nk_text_edit *box, nk_rune unicode)
+{
+ NK_UNUSED(box);
+ if (unicode < '0' || unicode > '7')
+ return nk_false;
+ else return nk_true;
+}
+NK_API int
+nk_filter_binary(const struct nk_text_edit *box, nk_rune unicode)
+{
+ NK_UNUSED(box);
+ if (unicode != '0' && unicode != '1')
+ return nk_false;
+ else return nk_true;
}
-/*----------------------------------------------------------------
+/* ===============================================================
*
- * PROPERTY
+ * EDIT
*
- * --------------------------------------------------------------*/
-NK_INTERN struct nk_property_variant
-nk_property_variant_int(int value, int min_value, int max_value, int step)
+ * ===============================================================*/
+NK_LIB void
+nk_edit_draw_text(struct nk_command_buffer *out,
+ const struct nk_style_edit *style, float pos_x, float pos_y,
+ float x_offset, const char *text, int byte_len, float row_height,
+ const struct nk_user_font *font, struct nk_color background,
+ struct nk_color foreground, int is_selected)
{
- struct nk_property_variant result;
- result.kind = NK_PROPERTY_INT;
- result.value.i = value;
- result.min_value.i = min_value;
- result.max_value.i = max_value;
- result.step.i = step;
- return result;
-}
+ NK_ASSERT(out);
+ NK_ASSERT(font);
+ NK_ASSERT(style);
+ if (!text || !byte_len || !out || !style) return;
+
+ {int glyph_len = 0;
+ nk_rune unicode = 0;
+ int text_len = 0;
+ float line_width = 0;
+ float glyph_width;
+ const char *line = text;
+ float line_offset = 0;
+ int line_count = 0;
+
+ struct nk_text txt;
+ txt.padding = nk_vec2(0,0);
+ txt.background = background;
+ txt.text = foreground;
+
+ glyph_len = nk_utf_decode(text+text_len, &unicode, byte_len-text_len);
+ if (!glyph_len) return;
+ while ((text_len < byte_len) && glyph_len)
+ {
+ if (unicode == '\n') {
+ /* new line separator so draw previous line */
+ struct nk_rect label;
+ label.y = pos_y + line_offset;
+ label.h = row_height;
+ label.w = line_width;
+ label.x = pos_x;
+ if (!line_count)
+ label.x += x_offset;
-NK_INTERN struct nk_property_variant
-nk_property_variant_float(float value, float min_value, float max_value, float step)
-{
- struct nk_property_variant result;
- result.kind = NK_PROPERTY_FLOAT;
- result.value.f = value;
- result.min_value.f = min_value;
- result.max_value.f = max_value;
- result.step.f = step;
- return result;
-}
+ if (is_selected) /* selection needs to draw different background color */
+ nk_fill_rect(out, label, 0, background);
+ nk_widget_text(out, label, line, (int)((text + text_len) - line),
+ &txt, NK_TEXT_CENTERED, font);
-NK_INTERN struct nk_property_variant
-nk_property_variant_double(double value, double min_value, double max_value,
- double step)
-{
- struct nk_property_variant result;
- result.kind = NK_PROPERTY_DOUBLE;
- result.value.d = value;
- result.min_value.d = min_value;
- result.max_value.d = max_value;
- result.step.d = step;
- return result;
-}
+ text_len++;
+ line_count++;
+ line_width = 0;
+ line = text + text_len;
+ line_offset += row_height;
+ glyph_len = nk_utf_decode(text + text_len, &unicode, (int)(byte_len-text_len));
+ continue;
+ }
+ if (unicode == '\r') {
+ text_len++;
+ glyph_len = nk_utf_decode(text + text_len, &unicode, byte_len-text_len);
+ continue;
+ }
+ glyph_width = font->width(font->userdata, font->height, text+text_len, glyph_len);
+ line_width += (float)glyph_width;
+ text_len += glyph_len;
+ glyph_len = nk_utf_decode(text + text_len, &unicode, byte_len-text_len);
+ continue;
+ }
+ if (line_width > 0) {
+ /* draw last line */
+ struct nk_rect label;
+ label.y = pos_y + line_offset;
+ label.h = row_height;
+ label.w = line_width;
+ label.x = pos_x;
+ if (!line_count)
+ label.x += x_offset;
-NK_INTERN void
-nk_property(struct nk_context *ctx, const char *name, struct nk_property_variant *variant,
- float inc_per_pixel, const enum nk_property_filter filter)
+ if (is_selected)
+ nk_fill_rect(out, label, 0, background);
+ nk_widget_text(out, label, line, (int)((text + text_len) - line),
+ &txt, NK_TEXT_LEFT, font);
+ }}
+}
+NK_LIB nk_flags
+nk_do_edit(nk_flags *state, struct nk_command_buffer *out,
+ struct nk_rect bounds, nk_flags flags, nk_plugin_filter filter,
+ struct nk_text_edit *edit, const struct nk_style_edit *style,
+ struct nk_input *in, const struct nk_user_font *font)
{
- struct nk_window *win;
- struct nk_panel *layout;
- struct nk_input *in;
- const struct nk_style *style;
+ struct nk_rect area;
+ nk_flags ret = 0;
+ float row_height;
+ char prev_state = 0;
+ char is_hovered = 0;
+ char select_all = 0;
+ char cursor_follow = 0;
+ struct nk_rect old_clip;
+ struct nk_rect clip;
- struct nk_rect bounds;
- enum nk_widget_layout_states s;
+ NK_ASSERT(state);
+ NK_ASSERT(out);
+ NK_ASSERT(style);
+ if (!state || !out || !style)
+ return ret;
- int *state = 0;
- nk_hash hash = 0;
- char *buffer = 0;
- int *len = 0;
- int *cursor = 0;
- int *select_begin = 0;
- int *select_end = 0;
- int old_state;
+ /* visible text area calculation */
+ area.x = bounds.x + style->padding.x + style->border;
+ area.y = bounds.y + style->padding.y + style->border;
+ area.w = bounds.w - (2.0f * style->padding.x + 2 * style->border);
+ area.h = bounds.h - (2.0f * style->padding.y + 2 * style->border);
+ if (flags & NK_EDIT_MULTILINE)
+ area.w = NK_MAX(0, area.w - style->scrollbar_size.x);
+ row_height = (flags & NK_EDIT_MULTILINE)? font->height + style->row_padding: area.h;
- char dummy_buffer[NK_MAX_NUMBER_BUFFER];
- int dummy_state = NK_PROPERTY_DEFAULT;
- int dummy_length = 0;
- int dummy_cursor = 0;
- int dummy_select_begin = 0;
- int dummy_select_end = 0;
+ /* calculate clipping rectangle */
+ old_clip = out->clip;
+ nk_unify(&clip, &old_clip, area.x, area.y, area.x + area.w, area.y + area.h);
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
+ /* update edit state */
+ prev_state = (char)edit->active;
+ is_hovered = (char)nk_input_is_mouse_hovering_rect(in, bounds);
+ if (in && in->mouse.buttons[NK_BUTTON_LEFT].clicked && in->mouse.buttons[NK_BUTTON_LEFT].down) {
+ edit->active = NK_INBOX(in->mouse.pos.x, in->mouse.pos.y,
+ bounds.x, bounds.y, bounds.w, bounds.h);
+ }
- win = ctx->current;
- layout = win->layout;
- style = &ctx->style;
- s = nk_widget(&bounds, ctx);
- if (!s) return;
+ /* (de)activate text editor */
+ if (!prev_state && edit->active) {
+ const enum nk_text_edit_type type = (flags & NK_EDIT_MULTILINE) ?
+ NK_TEXT_EDIT_MULTI_LINE: NK_TEXT_EDIT_SINGLE_LINE;
+ nk_textedit_clear_state(edit, type, filter);
+ if (flags & NK_EDIT_AUTO_SELECT)
+ select_all = nk_true;
+ if (flags & NK_EDIT_GOTO_END_ON_ACTIVATE) {
+ edit->cursor = edit->string.len;
+ in = 0;
+ }
+ } else if (!edit->active) edit->mode = NK_TEXT_EDIT_MODE_VIEW;
+ if (flags & NK_EDIT_READ_ONLY)
+ edit->mode = NK_TEXT_EDIT_MODE_VIEW;
+ else if (flags & NK_EDIT_ALWAYS_INSERT_MODE)
+ edit->mode = NK_TEXT_EDIT_MODE_INSERT;
- /* calculate hash from name */
- if (name[0] == '#') {
- hash = nk_murmur_hash(name, (int)nk_strlen(name), win->property.seq++);
- name++; /* special number hash */
- } else hash = nk_murmur_hash(name, (int)nk_strlen(name), 42);
+ ret = (edit->active) ? NK_EDIT_ACTIVE: NK_EDIT_INACTIVE;
+ if (prev_state != edit->active)
+ ret |= (edit->active) ? NK_EDIT_ACTIVATED: NK_EDIT_DEACTIVATED;
- /* check if property is currently hot item */
- if (win->property.active && hash == win->property.name) {
- buffer = win->property.buffer;
- len = &win->property.length;
- cursor = &win->property.cursor;
- state = &win->property.state;
- select_begin = &win->property.select_start;
- select_end = &win->property.select_end;
- } else {
- buffer = dummy_buffer;
- len = &dummy_length;
- cursor = &dummy_cursor;
- state = &dummy_state;
- select_begin = &dummy_select_begin;
- select_end = &dummy_select_end;
- }
+ /* handle user input */
+ if (edit->active && in)
+ {
+ int shift_mod = in->keyboard.keys[NK_KEY_SHIFT].down;
+ const float mouse_x = (in->mouse.pos.x - area.x) + edit->scrollbar.x;
+ const float mouse_y = (in->mouse.pos.y - area.y) + edit->scrollbar.y;
- /* execute property widget */
- old_state = *state;
- ctx->text_edit.clip = ctx->clip;
- in = ((s == NK_WIDGET_ROM && !win->property.active) ||
- layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
- nk_do_property(&ctx->last_widget_state, &win->buffer, bounds, name,
- variant, inc_per_pixel, buffer, len, state, cursor, select_begin,
- select_end, &style->property, filter, in, style->font, &ctx->text_edit,
- ctx->button_behavior);
+ /* mouse click handler */
+ is_hovered = (char)nk_input_is_mouse_hovering_rect(in, area);
+ if (select_all) {
+ nk_textedit_select_all(edit);
+ } else if (is_hovered && in->mouse.buttons[NK_BUTTON_LEFT].down &&
+ in->mouse.buttons[NK_BUTTON_LEFT].clicked) {
+ nk_textedit_click(edit, mouse_x, mouse_y, font, row_height);
+ } else if (is_hovered && in->mouse.buttons[NK_BUTTON_LEFT].down &&
+ (in->mouse.delta.x != 0.0f || in->mouse.delta.y != 0.0f)) {
+ nk_textedit_drag(edit, mouse_x, mouse_y, font, row_height);
+ cursor_follow = nk_true;
+ } else if (is_hovered && in->mouse.buttons[NK_BUTTON_RIGHT].clicked &&
+ in->mouse.buttons[NK_BUTTON_RIGHT].down) {
+ nk_textedit_key(edit, NK_KEY_TEXT_WORD_LEFT, nk_false, font, row_height);
+ nk_textedit_key(edit, NK_KEY_TEXT_WORD_RIGHT, nk_true, font, row_height);
+ cursor_follow = nk_true;
+ }
- if (in && *state != NK_PROPERTY_DEFAULT && !win->property.active) {
- /* current property is now hot */
- win->property.active = 1;
- NK_MEMCPY(win->property.buffer, buffer, (nk_size)*len);
- win->property.length = *len;
- win->property.cursor = *cursor;
- win->property.state = *state;
- win->property.name = hash;
- win->property.select_start = *select_begin;
- win->property.select_end = *select_end;
- if (*state == NK_PROPERTY_DRAG) {
- ctx->input.mouse.grab = nk_true;
- ctx->input.mouse.grabbed = nk_true;
+ {int i; /* keyboard input */
+ int old_mode = edit->mode;
+ for (i = 0; i < NK_KEY_MAX; ++i) {
+ if (i == NK_KEY_ENTER || i == NK_KEY_TAB) continue; /* special case */
+ if (nk_input_is_key_pressed(in, (enum nk_keys)i)) {
+ nk_textedit_key(edit, (enum nk_keys)i, shift_mod, font, row_height);
+ cursor_follow = nk_true;
+ }
}
- }
- /* check if previously active property is now inactive */
- if (*state == NK_PROPERTY_DEFAULT && old_state != NK_PROPERTY_DEFAULT) {
- if (old_state == NK_PROPERTY_DRAG) {
- ctx->input.mouse.grab = nk_false;
- ctx->input.mouse.grabbed = nk_false;
- ctx->input.mouse.ungrab = nk_true;
+ if (old_mode != edit->mode) {
+ in->keyboard.text_len = 0;
+ }}
+
+ /* text input */
+ edit->filter = filter;
+ if (in->keyboard.text_len) {
+ nk_textedit_text(edit, in->keyboard.text, in->keyboard.text_len);
+ cursor_follow = nk_true;
+ in->keyboard.text_len = 0;
}
- win->property.select_start = 0;
- win->property.select_end = 0;
- win->property.active = 0;
- }
-}
-NK_API void
-nk_property_int(struct nk_context *ctx, const char *name,
- int min, int *val, int max, int step, float inc_per_pixel)
-{
- struct nk_property_variant variant;
- NK_ASSERT(ctx);
- NK_ASSERT(name);
- NK_ASSERT(val);
+ /* enter key handler */
+ if (nk_input_is_key_pressed(in, NK_KEY_ENTER)) {
+ cursor_follow = nk_true;
+ if (flags & NK_EDIT_CTRL_ENTER_NEWLINE && shift_mod)
+ nk_textedit_text(edit, "\n", 1);
+ else if (flags & NK_EDIT_SIG_ENTER)
+ ret |= NK_EDIT_COMMITED;
+ else nk_textedit_text(edit, "\n", 1);
+ }
- if (!ctx || !ctx->current || !name || !val) return;
- variant = nk_property_variant_int(*val, min, max, step);
- nk_property(ctx, name, &variant, inc_per_pixel, NK_FILTER_INT);
- *val = variant.value.i;
-}
+ /* cut & copy handler */
+ {int copy= nk_input_is_key_pressed(in, NK_KEY_COPY);
+ int cut = nk_input_is_key_pressed(in, NK_KEY_CUT);
+ if ((copy || cut) && (flags & NK_EDIT_CLIPBOARD))
+ {
+ int glyph_len;
+ nk_rune unicode;
+ const char *text;
+ int b = edit->select_start;
+ int e = edit->select_end;
-NK_API void
-nk_property_float(struct nk_context *ctx, const char *name,
- float min, float *val, float max, float step, float inc_per_pixel)
-{
- struct nk_property_variant variant;
- NK_ASSERT(ctx);
- NK_ASSERT(name);
- NK_ASSERT(val);
+ int begin = NK_MIN(b, e);
+ int end = NK_MAX(b, e);
+ text = nk_str_at_const(&edit->string, begin, &unicode, &glyph_len);
+ if (edit->clip.copy)
+ edit->clip.copy(edit->clip.userdata, text, end - begin);
+ if (cut && !(flags & NK_EDIT_READ_ONLY)){
+ nk_textedit_cut(edit);
+ cursor_follow = nk_true;
+ }
+ }}
- if (!ctx || !ctx->current || !name || !val) return;
- variant = nk_property_variant_float(*val, min, max, step);
- nk_property(ctx, name, &variant, inc_per_pixel, NK_FILTER_FLOAT);
- *val = variant.value.f;
-}
+ /* paste handler */
+ {int paste = nk_input_is_key_pressed(in, NK_KEY_PASTE);
+ if (paste && (flags & NK_EDIT_CLIPBOARD) && edit->clip.paste) {
+ edit->clip.paste(edit->clip.userdata, edit);
+ cursor_follow = nk_true;
+ }}
-NK_API void
-nk_property_double(struct nk_context *ctx, const char *name,
- double min, double *val, double max, double step, float inc_per_pixel)
-{
- struct nk_property_variant variant;
- NK_ASSERT(ctx);
- NK_ASSERT(name);
- NK_ASSERT(val);
+ /* tab handler */
+ {int tab = nk_input_is_key_pressed(in, NK_KEY_TAB);
+ if (tab && (flags & NK_EDIT_ALLOW_TAB)) {
+ nk_textedit_text(edit, " ", 4);
+ cursor_follow = nk_true;
+ }}
+ }
- if (!ctx || !ctx->current || !name || !val) return;
- variant = nk_property_variant_double(*val, min, max, step);
- nk_property(ctx, name, &variant, inc_per_pixel, NK_FILTER_FLOAT);
- *val = variant.value.d;
-}
+ /* set widget state */
+ if (edit->active)
+ *state = NK_WIDGET_STATE_ACTIVE;
+ else nk_widget_state_reset(state);
-NK_API int
-nk_propertyi(struct nk_context *ctx, const char *name, int min, int val,
- int max, int step, float inc_per_pixel)
-{
- struct nk_property_variant variant;
- NK_ASSERT(ctx);
- NK_ASSERT(name);
+ if (is_hovered)
+ *state |= NK_WIDGET_STATE_HOVERED;
- if (!ctx || !ctx->current || !name) return val;
- variant = nk_property_variant_int(val, min, max, step);
- nk_property(ctx, name, &variant, inc_per_pixel, NK_FILTER_INT);
- val = variant.value.i;
- return val;
-}
+ /* DRAW EDIT */
+ {const char *text = nk_str_get_const(&edit->string);
+ int len = nk_str_len_char(&edit->string);
-NK_API float
-nk_propertyf(struct nk_context *ctx, const char *name, float min,
- float val, float max, float step, float inc_per_pixel)
-{
- struct nk_property_variant variant;
- NK_ASSERT(ctx);
- NK_ASSERT(name);
+ {/* select background colors/images */
+ const struct nk_style_item *background;
+ if (*state & NK_WIDGET_STATE_ACTIVED)
+ background = &style->active;
+ else if (*state & NK_WIDGET_STATE_HOVER)
+ background = &style->hover;
+ else background = &style->normal;
- if (!ctx || !ctx->current || !name) return val;
- variant = nk_property_variant_float(val, min, max, step);
- nk_property(ctx, name, &variant, inc_per_pixel, NK_FILTER_FLOAT);
- val = variant.value.f;
- return val;
-}
+ /* draw background frame */
+ if (background->type == NK_STYLE_ITEM_COLOR) {
+ nk_stroke_rect(out, bounds, style->rounding, style->border, style->border_color);
+ nk_fill_rect(out, bounds, style->rounding, background->data.color);
+ } else nk_draw_image(out, bounds, &background->data.image, nk_white);}
-NK_API double
-nk_propertyd(struct nk_context *ctx, const char *name, double min,
- double val, double max, double step, float inc_per_pixel)
-{
- struct nk_property_variant variant;
- NK_ASSERT(ctx);
- NK_ASSERT(name);
+ area.w = NK_MAX(0, area.w - style->cursor_size);
+ if (edit->active)
+ {
+ int total_lines = 1;
+ struct nk_vec2 text_size = nk_vec2(0,0);
- if (!ctx || !ctx->current || !name) return val;
- variant = nk_property_variant_double(val, min, max, step);
- nk_property(ctx, name, &variant, inc_per_pixel, NK_FILTER_FLOAT);
- val = variant.value.d;
- return val;
-}
+ /* text pointer positions */
+ const char *cursor_ptr = 0;
+ const char *select_begin_ptr = 0;
+ const char *select_end_ptr = 0;
-/*----------------------------------------------------------------
- *
- * COLOR PICKER
- *
- * --------------------------------------------------------------*/
-NK_API int
-nk_color_pick(struct nk_context * ctx, struct nk_color *color,
- enum nk_color_format fmt)
-{
- struct nk_window *win;
- struct nk_panel *layout;
- const struct nk_style *config;
- const struct nk_input *in;
+ /* 2D pixel positions */
+ struct nk_vec2 cursor_pos = nk_vec2(0,0);
+ struct nk_vec2 selection_offset_start = nk_vec2(0,0);
+ struct nk_vec2 selection_offset_end = nk_vec2(0,0);
- enum nk_widget_layout_states state;
- struct nk_rect bounds;
+ int selection_begin = NK_MIN(edit->select_start, edit->select_end);
+ int selection_end = NK_MAX(edit->select_start, edit->select_end);
- NK_ASSERT(ctx);
- NK_ASSERT(color);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout || !color)
- return 0;
+ /* calculate total line count + total space + cursor/selection position */
+ float line_width = 0.0f;
+ if (text && len)
+ {
+ /* utf8 encoding */
+ float glyph_width;
+ int glyph_len = 0;
+ nk_rune unicode = 0;
+ int text_len = 0;
+ int glyphs = 0;
+ int row_begin = 0;
- win = ctx->current;
- config = &ctx->style;
- layout = win->layout;
- state = nk_widget(&bounds, ctx);
- if (!state) return 0;
- in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
- return nk_do_color_picker(&ctx->last_widget_state, &win->buffer, color, fmt, bounds,
- nk_vec2(0,0), in, config->font);
-}
+ glyph_len = nk_utf_decode(text, &unicode, len);
+ glyph_width = font->width(font->userdata, font->height, text, glyph_len);
+ line_width = 0;
-NK_API struct nk_color
-nk_color_picker(struct nk_context *ctx, struct nk_color color,
- enum nk_color_format fmt)
-{
- nk_color_pick(ctx, &color, fmt);
- return color;
-}
+ /* iterate all lines */
+ while ((text_len < len) && glyph_len)
+ {
+ /* set cursor 2D position and line */
+ if (!cursor_ptr && glyphs == edit->cursor)
+ {
+ int glyph_offset;
+ struct nk_vec2 out_offset;
+ struct nk_vec2 row_size;
+ const char *remaining;
-/* -------------------------------------------------------------
- *
- * CHART
- *
- * --------------------------------------------------------------*/
-NK_API int
-nk_chart_begin_colored(struct nk_context *ctx, enum nk_chart_type type,
- struct nk_color color, struct nk_color highlight,
- int count, float min_value, float max_value)
-{
- struct nk_window *win;
- struct nk_chart *chart;
- const struct nk_style *config;
- const struct nk_style_chart *style;
+ /* calculate 2d position */
+ cursor_pos.y = (float)(total_lines-1) * row_height;
+ row_size = nk_text_calculate_text_bounds(font, text+row_begin,
+ text_len-row_begin, row_height, &remaining,
+ &out_offset, &glyph_offset, NK_STOP_ON_NEW_LINE);
+ cursor_pos.x = row_size.x;
+ cursor_ptr = text + text_len;
+ }
- const struct nk_style_item *background;
- struct nk_rect bounds = {0, 0, 0, 0};
+ /* set start selection 2D position and line */
+ if (!select_begin_ptr && edit->select_start != edit->select_end &&
+ glyphs == selection_begin)
+ {
+ int glyph_offset;
+ struct nk_vec2 out_offset;
+ struct nk_vec2 row_size;
+ const char *remaining;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
+ /* calculate 2d position */
+ selection_offset_start.y = (float)(NK_MAX(total_lines-1,0)) * row_height;
+ row_size = nk_text_calculate_text_bounds(font, text+row_begin,
+ text_len-row_begin, row_height, &remaining,
+ &out_offset, &glyph_offset, NK_STOP_ON_NEW_LINE);
+ selection_offset_start.x = row_size.x;
+ select_begin_ptr = text + text_len;
+ }
- if (!ctx || !ctx->current || !ctx->current->layout) return 0;
- if (!nk_widget(&bounds, ctx)) {
- chart = &ctx->current->layout->chart;
- nk_zero(chart, sizeof(*chart));
- return 0;
- }
+ /* set end selection 2D position and line */
+ if (!select_end_ptr && edit->select_start != edit->select_end &&
+ glyphs == selection_end)
+ {
+ int glyph_offset;
+ struct nk_vec2 out_offset;
+ struct nk_vec2 row_size;
+ const char *remaining;
- win = ctx->current;
- config = &ctx->style;
- chart = &win->layout->chart;
- style = &config->chart;
+ /* calculate 2d position */
+ selection_offset_end.y = (float)(total_lines-1) * row_height;
+ row_size = nk_text_calculate_text_bounds(font, text+row_begin,
+ text_len-row_begin, row_height, &remaining,
+ &out_offset, &glyph_offset, NK_STOP_ON_NEW_LINE);
+ selection_offset_end.x = row_size.x;
+ select_end_ptr = text + text_len;
+ }
+ if (unicode == '\n') {
+ text_size.x = NK_MAX(text_size.x, line_width);
+ total_lines++;
+ line_width = 0;
+ text_len++;
+ glyphs++;
+ row_begin = text_len;
+ glyph_len = nk_utf_decode(text + text_len, &unicode, len-text_len);
+ glyph_width = font->width(font->userdata, font->height, text+text_len, glyph_len);
+ continue;
+ }
- /* setup basic generic chart */
- nk_zero(chart, sizeof(*chart));
- chart->x = bounds.x + style->padding.x;
- chart->y = bounds.y + style->padding.y;
- chart->w = bounds.w - 2 * style->padding.x;
- chart->h = bounds.h - 2 * style->padding.y;
- chart->w = NK_MAX(chart->w, 2 * style->padding.x);
- chart->h = NK_MAX(chart->h, 2 * style->padding.y);
+ glyphs++;
+ text_len += glyph_len;
+ line_width += (float)glyph_width;
- /* add first slot into chart */
- {struct nk_chart_slot *slot = &chart->slots[chart->slot++];
- slot->type = type;
- slot->count = count;
- slot->color = color;
- slot->highlight = highlight;
- slot->min = NK_MIN(min_value, max_value);
- slot->max = NK_MAX(min_value, max_value);
- slot->range = slot->max - slot->min;}
+ glyph_len = nk_utf_decode(text + text_len, &unicode, len-text_len);
+ glyph_width = font->width(font->userdata, font->height,
+ text+text_len, glyph_len);
+ continue;
+ }
+ text_size.y = (float)total_lines * row_height;
- /* draw chart background */
- background = &style->background;
- if (background->type == NK_STYLE_ITEM_IMAGE) {
- nk_draw_image(&win->buffer, bounds, &background->data.image, nk_white);
- } else {
- nk_fill_rect(&win->buffer, bounds, style->rounding, style->border_color);
- nk_fill_rect(&win->buffer, nk_shrink_rect(bounds, style->border),
- style->rounding, style->background.data.color);
- }
- return 1;
-}
+ /* handle case when cursor is at end of text buffer */
+ if (!cursor_ptr && edit->cursor == edit->string.len) {
+ cursor_pos.x = line_width;
+ cursor_pos.y = text_size.y - row_height;
+ }
+ }
+ {
+ /* scrollbar */
+ if (cursor_follow)
+ {
+ /* update scrollbar to follow cursor */
+ if (!(flags & NK_EDIT_NO_HORIZONTAL_SCROLL)) {
+ /* horizontal scroll */
+ const float scroll_increment = area.w * 0.25f;
+ if (cursor_pos.x < edit->scrollbar.x)
+ edit->scrollbar.x = (float)(int)NK_MAX(0.0f, cursor_pos.x - scroll_increment);
+ if (cursor_pos.x >= edit->scrollbar.x + area.w)
+ edit->scrollbar.x = (float)(int)NK_MAX(0.0f, edit->scrollbar.x + scroll_increment);
+ } else edit->scrollbar.x = 0;
-NK_API int
-nk_chart_begin(struct nk_context *ctx, const enum nk_chart_type type,
- int count, float min_value, float max_value)
-{return nk_chart_begin_colored(ctx, type, ctx->style.chart.color, ctx->style.chart.selected_color, count, min_value, max_value);}
+ if (flags & NK_EDIT_MULTILINE) {
+ /* vertical scroll */
+ if (cursor_pos.y < edit->scrollbar.y)
+ edit->scrollbar.y = NK_MAX(0.0f, cursor_pos.y - row_height);
+ if (cursor_pos.y >= edit->scrollbar.y + area.h)
+ edit->scrollbar.y = edit->scrollbar.y + row_height;
+ } else edit->scrollbar.y = 0;
+ }
-NK_API void
-nk_chart_add_slot_colored(struct nk_context *ctx, const enum nk_chart_type type,
- struct nk_color color, struct nk_color highlight,
- int count, float min_value, float max_value)
-{
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- NK_ASSERT(ctx->current->layout->chart.slot < NK_CHART_MAX_SLOT);
- if (!ctx || !ctx->current || !ctx->current->layout) return;
- if (ctx->current->layout->chart.slot >= NK_CHART_MAX_SLOT) return;
+ /* scrollbar widget */
+ if (flags & NK_EDIT_MULTILINE)
+ {
+ nk_flags ws;
+ struct nk_rect scroll;
+ float scroll_target;
+ float scroll_offset;
+ float scroll_step;
+ float scroll_inc;
- /* add another slot into the graph */
- {struct nk_chart *chart = &ctx->current->layout->chart;
- struct nk_chart_slot *slot = &chart->slots[chart->slot++];
- slot->type = type;
- slot->count = count;
- slot->color = color;
- slot->highlight = highlight;
- slot->min = NK_MIN(min_value, max_value);
- slot->max = NK_MAX(min_value, max_value);
- slot->range = slot->max - slot->min;}
-}
+ scroll = area;
+ scroll.x = (bounds.x + bounds.w - style->border) - style->scrollbar_size.x;
+ scroll.w = style->scrollbar_size.x;
-NK_API void
-nk_chart_add_slot(struct nk_context *ctx, const enum nk_chart_type type,
- int count, float min_value, float max_value)
-{nk_chart_add_slot_colored(ctx, type, ctx->style.chart.color, ctx->style.chart.selected_color, count, min_value, max_value);}
+ scroll_offset = edit->scrollbar.y;
+ scroll_step = scroll.h * 0.10f;
+ scroll_inc = scroll.h * 0.01f;
+ scroll_target = text_size.y;
+ edit->scrollbar.y = nk_do_scrollbarv(&ws, out, scroll, 0,
+ scroll_offset, scroll_target, scroll_step, scroll_inc,
+ &style->scrollbar, in, font);
+ }
+ }
-NK_INTERN nk_flags
-nk_chart_push_line(struct nk_context *ctx, struct nk_window *win,
- struct nk_chart *g, float value, int slot)
-{
- struct nk_panel *layout = win->layout;
- const struct nk_input *i = &ctx->input;
- struct nk_command_buffer *out = &win->buffer;
+ /* draw text */
+ {struct nk_color background_color;
+ struct nk_color text_color;
+ struct nk_color sel_background_color;
+ struct nk_color sel_text_color;
+ struct nk_color cursor_color;
+ struct nk_color cursor_text_color;
+ const struct nk_style_item *background;
+ nk_push_scissor(out, clip);
- nk_flags ret = 0;
- struct nk_vec2 cur;
- struct nk_rect bounds;
- struct nk_color color;
- float step;
- float range;
- float ratio;
+ /* select correct colors to draw */
+ if (*state & NK_WIDGET_STATE_ACTIVED) {
+ background = &style->active;
+ text_color = style->text_active;
+ sel_text_color = style->selected_text_hover;
+ sel_background_color = style->selected_hover;
+ cursor_color = style->cursor_hover;
+ cursor_text_color = style->cursor_text_hover;
+ } else if (*state & NK_WIDGET_STATE_HOVER) {
+ background = &style->hover;
+ text_color = style->text_hover;
+ sel_text_color = style->selected_text_hover;
+ sel_background_color = style->selected_hover;
+ cursor_text_color = style->cursor_text_hover;
+ cursor_color = style->cursor_hover;
+ } else {
+ background = &style->normal;
+ text_color = style->text_normal;
+ sel_text_color = style->selected_text_normal;
+ sel_background_color = style->selected_normal;
+ cursor_color = style->cursor_normal;
+ cursor_text_color = style->cursor_text_normal;
+ }
+ if (background->type == NK_STYLE_ITEM_IMAGE)
+ background_color = nk_rgba(0,0,0,0);
+ else background_color = background->data.color;
- NK_ASSERT(slot >= 0 && slot < NK_CHART_MAX_SLOT);
- step = g->w / (float)g->slots[slot].count;
- range = g->slots[slot].max - g->slots[slot].min;
- ratio = (value - g->slots[slot].min) / range;
- if (g->slots[slot].index == 0) {
- /* first data point does not have a connection */
- g->slots[slot].last.x = g->x;
- g->slots[slot].last.y = (g->y + g->h) - ratio * (float)g->h;
+ if (edit->select_start == edit->select_end) {
+ /* no selection so just draw the complete text */
+ const char *begin = nk_str_get_const(&edit->string);
+ int l = nk_str_len_char(&edit->string);
+ nk_edit_draw_text(out, style, area.x - edit->scrollbar.x,
+ area.y - edit->scrollbar.y, 0, begin, l, row_height, font,
+ background_color, text_color, nk_false);
+ } else {
+ /* edit has selection so draw 1-3 text chunks */
+ if (edit->select_start != edit->select_end && selection_begin > 0){
+ /* draw unselected text before selection */
+ const char *begin = nk_str_get_const(&edit->string);
+ NK_ASSERT(select_begin_ptr);
+ nk_edit_draw_text(out, style, area.x - edit->scrollbar.x,
+ area.y - edit->scrollbar.y, 0, begin, (int)(select_begin_ptr - begin),
+ row_height, font, background_color, text_color, nk_false);
+ }
+ if (edit->select_start != edit->select_end) {
+ /* draw selected text */
+ NK_ASSERT(select_begin_ptr);
+ if (!select_end_ptr) {
+ const char *begin = nk_str_get_const(&edit->string);
+ select_end_ptr = begin + nk_str_len_char(&edit->string);
+ }
+ nk_edit_draw_text(out, style,
+ area.x - edit->scrollbar.x,
+ area.y + selection_offset_start.y - edit->scrollbar.y,
+ selection_offset_start.x,
+ select_begin_ptr, (int)(select_end_ptr - select_begin_ptr),
+ row_height, font, sel_background_color, sel_text_color, nk_true);
+ }
+ if ((edit->select_start != edit->select_end &&
+ selection_end < edit->string.len))
+ {
+ /* draw unselected text after selected text */
+ const char *begin = select_end_ptr;
+ const char *end = nk_str_get_const(&edit->string) +
+ nk_str_len_char(&edit->string);
+ NK_ASSERT(select_end_ptr);
+ nk_edit_draw_text(out, style,
+ area.x - edit->scrollbar.x,
+ area.y + selection_offset_end.y - edit->scrollbar.y,
+ selection_offset_end.x,
+ begin, (int)(end - begin), row_height, font,
+ background_color, text_color, nk_true);
+ }
+ }
- bounds.x = g->slots[slot].last.x - 2;
- bounds.y = g->slots[slot].last.y - 2;
- bounds.w = bounds.h = 4;
+ /* cursor */
+ if (edit->select_start == edit->select_end)
+ {
+ if (edit->cursor >= nk_str_len(&edit->string) ||
+ (cursor_ptr && *cursor_ptr == '\n')) {
+ /* draw cursor at end of line */
+ struct nk_rect cursor;
+ cursor.w = style->cursor_size;
+ cursor.h = font->height;
+ cursor.x = area.x + cursor_pos.x - edit->scrollbar.x;
+ cursor.y = area.y + cursor_pos.y + row_height/2.0f - cursor.h/2.0f;
+ cursor.y -= edit->scrollbar.y;
+ nk_fill_rect(out, cursor, 0, cursor_color);
+ } else {
+ /* draw cursor inside text */
+ int glyph_len;
+ struct nk_rect label;
+ struct nk_text txt;
- color = g->slots[slot].color;
- if (!(layout->flags & NK_WINDOW_ROM) &&
- NK_INBOX(i->mouse.pos.x,i->mouse.pos.y, g->slots[slot].last.x-3, g->slots[slot].last.y-3, 6, 6)){
- ret = nk_input_is_mouse_hovering_rect(i, bounds) ? NK_CHART_HOVERING : 0;
- ret |= (i->mouse.buttons[NK_BUTTON_LEFT].down &&
- i->mouse.buttons[NK_BUTTON_LEFT].clicked) ? NK_CHART_CLICKED: 0;
- color = g->slots[slot].highlight;
- }
- nk_fill_rect(out, bounds, 0, color);
- g->slots[slot].index += 1;
- return ret;
- }
+ nk_rune unicode;
+ NK_ASSERT(cursor_ptr);
+ glyph_len = nk_utf_decode(cursor_ptr, &unicode, 4);
- /* draw a line between the last data point and the new one */
- color = g->slots[slot].color;
- cur.x = g->x + (float)(step * (float)g->slots[slot].index);
- cur.y = (g->y + g->h) - (ratio * (float)g->h);
- nk_stroke_line(out, g->slots[slot].last.x, g->slots[slot].last.y, cur.x, cur.y, 1.0f, color);
+ label.x = area.x + cursor_pos.x - edit->scrollbar.x;
+ label.y = area.y + cursor_pos.y - edit->scrollbar.y;
+ label.w = font->width(font->userdata, font->height, cursor_ptr, glyph_len);
+ label.h = row_height;
- bounds.x = cur.x - 3;
- bounds.y = cur.y - 3;
- bounds.w = bounds.h = 6;
+ txt.padding = nk_vec2(0,0);
+ txt.background = cursor_color;;
+ txt.text = cursor_text_color;
+ nk_fill_rect(out, label, 0, cursor_color);
+ nk_widget_text(out, label, cursor_ptr, glyph_len, &txt, NK_TEXT_LEFT, font);
+ }
+ }}
+ } else {
+ /* not active so just draw text */
+ int l = nk_str_len_char(&edit->string);
+ const char *begin = nk_str_get_const(&edit->string);
- /* user selection of current data point */
- if (!(layout->flags & NK_WINDOW_ROM)) {
- if (nk_input_is_mouse_hovering_rect(i, bounds)) {
- ret = NK_CHART_HOVERING;
- ret |= (!i->mouse.buttons[NK_BUTTON_LEFT].down &&
- i->mouse.buttons[NK_BUTTON_LEFT].clicked) ? NK_CHART_CLICKED: 0;
- color = g->slots[slot].highlight;
+ const struct nk_style_item *background;
+ struct nk_color background_color;
+ struct nk_color text_color;
+ nk_push_scissor(out, clip);
+ if (*state & NK_WIDGET_STATE_ACTIVED) {
+ background = &style->active;
+ text_color = style->text_active;
+ } else if (*state & NK_WIDGET_STATE_HOVER) {
+ background = &style->hover;
+ text_color = style->text_hover;
+ } else {
+ background = &style->normal;
+ text_color = style->text_normal;
}
+ if (background->type == NK_STYLE_ITEM_IMAGE)
+ background_color = nk_rgba(0,0,0,0);
+ else background_color = background->data.color;
+ nk_edit_draw_text(out, style, area.x - edit->scrollbar.x,
+ area.y - edit->scrollbar.y, 0, begin, l, row_height, font,
+ background_color, text_color, nk_false);
}
- nk_fill_rect(out, nk_rect(cur.x - 2, cur.y - 2, 4, 4), 0, color);
-
- /* save current data point position */
- g->slots[slot].last.x = cur.x;
- g->slots[slot].last.y = cur.y;
- g->slots[slot].index += 1;
+ nk_push_scissor(out, old_clip);}
return ret;
}
-
-NK_INTERN nk_flags
-nk_chart_push_column(const struct nk_context *ctx, struct nk_window *win,
- struct nk_chart *chart, float value, int slot)
+NK_API void
+nk_edit_focus(struct nk_context *ctx, nk_flags flags)
{
- struct nk_command_buffer *out = &win->buffer;
- const struct nk_input *in = &ctx->input;
- struct nk_panel *layout = win->layout;
-
- float ratio;
- nk_flags ret = 0;
- struct nk_color color;
- struct nk_rect item = {0,0,0,0};
-
- NK_ASSERT(slot >= 0 && slot < NK_CHART_MAX_SLOT);
- if (chart->slots[slot].index >= chart->slots[slot].count)
- return nk_false;
- if (chart->slots[slot].count) {
- float padding = (float)(chart->slots[slot].count-1);
- item.w = (chart->w - padding) / (float)(chart->slots[slot].count);
- }
+ nk_hash hash;
+ struct nk_window *win;
- /* calculate bounds of current bar chart entry */
- color = chart->slots[slot].color;;
- item.h = chart->h * NK_ABS((value/chart->slots[slot].range));
- if (value >= 0) {
- ratio = (value + NK_ABS(chart->slots[slot].min)) / NK_ABS(chart->slots[slot].range);
- item.y = (chart->y + chart->h) - chart->h * ratio;
- } else {
- ratio = (value - chart->slots[slot].max) / chart->slots[slot].range;
- item.y = chart->y + (chart->h * NK_ABS(ratio)) - item.h;
- }
- item.x = chart->x + ((float)chart->slots[slot].index * item.w);
- item.x = item.x + ((float)chart->slots[slot].index);
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ if (!ctx || !ctx->current) return;
- /* user chart bar selection */
- if (!(layout->flags & NK_WINDOW_ROM) &&
- NK_INBOX(in->mouse.pos.x,in->mouse.pos.y,item.x,item.y,item.w,item.h)) {
- ret = NK_CHART_HOVERING;
- ret |= (!in->mouse.buttons[NK_BUTTON_LEFT].down &&
- in->mouse.buttons[NK_BUTTON_LEFT].clicked) ? NK_CHART_CLICKED: 0;
- color = chart->slots[slot].highlight;
- }
- nk_fill_rect(out, item, 0, color);
- chart->slots[slot].index += 1;
- return ret;
+ win = ctx->current;
+ hash = win->edit.seq;
+ win->edit.active = nk_true;
+ win->edit.name = hash;
+ if (flags & NK_EDIT_ALWAYS_INSERT_MODE)
+ win->edit.mode = NK_TEXT_EDIT_MODE_INSERT;
}
+NK_API void
+nk_edit_unfocus(struct nk_context *ctx)
+{
+ struct nk_window *win;
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ if (!ctx || !ctx->current) return;
+ win = ctx->current;
+ win->edit.active = nk_false;
+ win->edit.name = 0;
+}
NK_API nk_flags
-nk_chart_push_slot(struct nk_context *ctx, float value, int slot)
+nk_edit_string(struct nk_context *ctx, nk_flags flags,
+ char *memory, int *len, int max, nk_plugin_filter filter)
{
- nk_flags flags;
+ nk_hash hash;
+ nk_flags state;
+ struct nk_text_edit *edit;
struct nk_window *win;
NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(slot >= 0 && slot < NK_CHART_MAX_SLOT);
- NK_ASSERT(slot < ctx->current->layout->chart.slot);
- if (!ctx || !ctx->current || slot >= NK_CHART_MAX_SLOT) return nk_false;
- if (slot >= ctx->current->layout->chart.slot) return nk_false;
+ NK_ASSERT(memory);
+ NK_ASSERT(len);
+ if (!ctx || !memory || !len)
+ return 0;
+ filter = (!filter) ? nk_filter_default: filter;
win = ctx->current;
- if (win->layout->chart.slot < slot) return nk_false;
- switch (win->layout->chart.slots[slot].type) {
- case NK_CHART_LINES:
- flags = nk_chart_push_line(ctx, win, &win->layout->chart, value, slot); break;
- case NK_CHART_COLUMN:
- flags = nk_chart_push_column(ctx, win, &win->layout->chart, value, slot); break;
- default:
- case NK_CHART_MAX:
- flags = 0;
- }
- return flags;
-}
+ hash = win->edit.seq;
+ edit = &ctx->text_edit;
+ nk_textedit_clear_state(&ctx->text_edit, (flags & NK_EDIT_MULTILINE)?
+ NK_TEXT_EDIT_MULTI_LINE: NK_TEXT_EDIT_SINGLE_LINE, filter);
-NK_API nk_flags
-nk_chart_push(struct nk_context *ctx, float value)
-{return nk_chart_push_slot(ctx, value, 0);}
+ if (win->edit.active && hash == win->edit.name) {
+ if (flags & NK_EDIT_NO_CURSOR)
+ edit->cursor = nk_utf_len(memory, *len);
+ else edit->cursor = win->edit.cursor;
+ if (!(flags & NK_EDIT_SELECTABLE)) {
+ edit->select_start = win->edit.cursor;
+ edit->select_end = win->edit.cursor;
+ } else {
+ edit->select_start = win->edit.sel_start;
+ edit->select_end = win->edit.sel_end;
+ }
+ edit->mode = win->edit.mode;
+ edit->scrollbar.x = (float)win->edit.scrollbar.x;
+ edit->scrollbar.y = (float)win->edit.scrollbar.y;
+ edit->active = nk_true;
+ } else edit->active = nk_false;
-NK_API void
-nk_chart_end(struct nk_context *ctx)
+ max = NK_MAX(1, max);
+ *len = NK_MIN(*len, max-1);
+ nk_str_init_fixed(&edit->string, memory, (nk_size)max);
+ edit->string.buffer.allocated = (nk_size)*len;
+ edit->string.len = nk_utf_len(memory, *len);
+ state = nk_edit_buffer(ctx, flags, edit, filter);
+ *len = (int)edit->string.buffer.allocated;
+
+ if (edit->active) {
+ win->edit.cursor = edit->cursor;
+ win->edit.sel_start = edit->select_start;
+ win->edit.sel_end = edit->select_end;
+ win->edit.mode = edit->mode;
+ win->edit.scrollbar.x = (nk_uint)edit->scrollbar.x;
+ win->edit.scrollbar.y = (nk_uint)edit->scrollbar.y;
+ } return state;
+}
+NK_API nk_flags
+nk_edit_buffer(struct nk_context *ctx, nk_flags flags,
+ struct nk_text_edit *edit, nk_plugin_filter filter)
{
struct nk_window *win;
- struct nk_chart *chart;
+ struct nk_style *style;
+ struct nk_input *in;
+
+ enum nk_widget_layout_states state;
+ struct nk_rect bounds;
+
+ nk_flags ret_flags = 0;
+ unsigned char prev_state;
+ nk_hash hash;
+ /* make sure correct values */
NK_ASSERT(ctx);
+ NK_ASSERT(edit);
NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current)
- return;
+ NK_ASSERT(ctx->current->layout);
+ if (!ctx || !ctx->current || !ctx->current->layout)
+ return 0;
+
+ win = ctx->current;
+ style = &ctx->style;
+ state = nk_widget(&bounds, ctx);
+ if (!state) return state;
+ in = (win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+
+ /* check if edit is currently hot item */
+ hash = win->edit.seq++;
+ if (win->edit.active && hash == win->edit.name) {
+ if (flags & NK_EDIT_NO_CURSOR)
+ edit->cursor = edit->string.len;
+ if (!(flags & NK_EDIT_SELECTABLE)) {
+ edit->select_start = edit->cursor;
+ edit->select_end = edit->cursor;
+ }
+ if (flags & NK_EDIT_CLIPBOARD)
+ edit->clip = ctx->clip;
+ edit->active = (unsigned char)win->edit.active;
+ } else edit->active = nk_false;
+ edit->mode = win->edit.mode;
+
+ filter = (!filter) ? nk_filter_default: filter;
+ prev_state = (unsigned char)edit->active;
+ in = (flags & NK_EDIT_READ_ONLY) ? 0: in;
+ ret_flags = nk_do_edit(&ctx->last_widget_state, &win->buffer, bounds, flags,
+ filter, edit, &style->edit, in, style->font);
- win = ctx->current;
- chart = &win->layout->chart;
- NK_MEMSET(chart, 0, sizeof(*chart));
- return;
+ if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER)
+ ctx->style.cursor_active = ctx->style.cursors[NK_CURSOR_TEXT];
+ if (edit->active && prev_state != edit->active) {
+ /* current edit is now hot */
+ win->edit.active = nk_true;
+ win->edit.name = hash;
+ } else if (prev_state && !edit->active) {
+ /* current edit is now cold */
+ win->edit.active = nk_false;
+ } return ret_flags;
}
-
-NK_API void
-nk_plot(struct nk_context *ctx, enum nk_chart_type type, const float *values,
- int count, int offset)
+NK_API nk_flags
+nk_edit_string_zero_terminated(struct nk_context *ctx, nk_flags flags,
+ char *buffer, int max, nk_plugin_filter filter)
{
- int i = 0;
- float min_value;
- float max_value;
-
- NK_ASSERT(ctx);
- NK_ASSERT(values);
- if (!ctx || !values || !count) return;
-
- min_value = values[offset];
- max_value = values[offset];
- for (i = 0; i < count; ++i) {
- min_value = NK_MIN(values[i + offset], min_value);
- max_value = NK_MAX(values[i + offset], max_value);
- }
-
- if (nk_chart_begin(ctx, type, count, min_value, max_value)) {
- for (i = 0; i < count; ++i)
- nk_chart_push(ctx, values[i + offset]);
- nk_chart_end(ctx);
- }
+ nk_flags result;
+ int len = nk_strlen(buffer);
+ result = nk_edit_string(ctx, flags, buffer, &len, max, filter);
+ buffer[NK_MIN(NK_MAX(max-1,0), len)] = '\0';
+ return result;
}
-NK_API void
-nk_plot_function(struct nk_context *ctx, enum nk_chart_type type, void *userdata,
- float(*value_getter)(void* user, int index), int count, int offset)
-{
- int i = 0;
- float min_value;
- float max_value;
- NK_ASSERT(ctx);
- NK_ASSERT(value_getter);
- if (!ctx || !value_getter || !count) return;
- max_value = min_value = value_getter(userdata, offset);
- for (i = 0; i < count; ++i) {
- float value = value_getter(userdata, i + offset);
- min_value = NK_MIN(value, min_value);
- max_value = NK_MAX(value, max_value);
- }
- if (nk_chart_begin(ctx, type, count, min_value, max_value)) {
- for (i = 0; i < count; ++i)
- nk_chart_push(ctx, value_getter(userdata, i + offset));
- nk_chart_end(ctx);
- }
-}
-/* -------------------------------------------------------------
+/* ===============================================================
*
- * GROUP
+ * PROPERTY
*
- * --------------------------------------------------------------*/
-NK_API int
-nk_group_scrolled_offset_begin(struct nk_context *ctx,
- nk_uint *x_offset, nk_uint *y_offset, const char *title, nk_flags flags)
+ * ===============================================================*/
+NK_LIB void
+nk_drag_behavior(nk_flags *state, const struct nk_input *in,
+ struct nk_rect drag, struct nk_property_variant *variant,
+ float inc_per_pixel)
{
- struct nk_rect bounds;
- struct nk_window panel;
- struct nk_window *win;
-
- win = ctx->current;
- nk_panel_alloc_space(&bounds, ctx);
- {const struct nk_rect *c = &win->layout->clip;
- if (!NK_INTERSECT(c->x, c->y, c->w, c->h, bounds.x, bounds.y, bounds.w, bounds.h) &&
- !(flags & NK_WINDOW_MOVABLE)) {
- return 0;
- }}
- if (win->flags & NK_WINDOW_ROM)
- flags |= NK_WINDOW_ROM;
-
- /* initialize a fake window to create the panel from */
- nk_zero(&panel, sizeof(panel));
- panel.bounds = bounds;
- panel.flags = flags;
- panel.scrollbar.x = *x_offset;
- panel.scrollbar.y = *y_offset;
- panel.buffer = win->buffer;
- panel.layout = (struct nk_panel*)nk_create_panel(ctx);
- ctx->current = &panel;
- nk_panel_begin(ctx, (flags & NK_WINDOW_TITLE) ? title: 0, NK_PANEL_GROUP);
+ int left_mouse_down = in && in->mouse.buttons[NK_BUTTON_LEFT].down;
+ int left_mouse_click_in_cursor = in &&
+ nk_input_has_mouse_click_down_in_rect(in, NK_BUTTON_LEFT, drag, nk_true);
- win->buffer = panel.buffer;
- win->buffer.clip = panel.layout->clip;
- panel.layout->offset_x = x_offset;
- panel.layout->offset_y = y_offset;
- panel.layout->parent = win->layout;
- win->layout = panel.layout;
+ nk_widget_state_reset(state);
+ if (nk_input_is_mouse_hovering_rect(in, drag))
+ *state = NK_WIDGET_STATE_HOVERED;
- ctx->current = win;
- if ((panel.layout->flags & NK_WINDOW_CLOSED) ||
- (panel.layout->flags & NK_WINDOW_MINIMIZED))
- {
- nk_flags f = panel.layout->flags;
- nk_group_scrolled_end(ctx);
- if (f & NK_WINDOW_CLOSED)
- return NK_WINDOW_CLOSED;
- if (f & NK_WINDOW_MINIMIZED)
- return NK_WINDOW_MINIMIZED;
+ if (left_mouse_down && left_mouse_click_in_cursor) {
+ float delta, pixels;
+ pixels = in->mouse.delta.x;
+ delta = pixels * inc_per_pixel;
+ switch (variant->kind) {
+ default: break;
+ case NK_PROPERTY_INT:
+ variant->value.i = variant->value.i + (int)delta;
+ variant->value.i = NK_CLAMP(variant->min_value.i, variant->value.i, variant->max_value.i);
+ break;
+ case NK_PROPERTY_FLOAT:
+ variant->value.f = variant->value.f + (float)delta;
+ variant->value.f = NK_CLAMP(variant->min_value.f, variant->value.f, variant->max_value.f);
+ break;
+ case NK_PROPERTY_DOUBLE:
+ variant->value.d = variant->value.d + (double)delta;
+ variant->value.d = NK_CLAMP(variant->min_value.d, variant->value.d, variant->max_value.d);
+ break;
+ }
+ *state = NK_WIDGET_STATE_ACTIVE;
}
- return 1;
+ if (*state & NK_WIDGET_STATE_HOVER && !nk_input_is_mouse_prev_hovering_rect(in, drag))
+ *state |= NK_WIDGET_STATE_ENTERED;
+ else if (nk_input_is_mouse_prev_hovering_rect(in, drag))
+ *state |= NK_WIDGET_STATE_LEFT;
}
-
-NK_API void
-nk_group_scrolled_end(struct nk_context *ctx)
+NK_LIB void
+nk_property_behavior(nk_flags *ws, const struct nk_input *in,
+ struct nk_rect property, struct nk_rect label, struct nk_rect edit,
+ struct nk_rect empty, int *state, struct nk_property_variant *variant,
+ float inc_per_pixel)
{
- struct nk_window *win;
- struct nk_panel *parent;
- struct nk_panel *g;
-
- struct nk_rect clip;
- struct nk_window pan;
- struct nk_vec2 panel_padding;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current)
- return;
-
- /* make sure nk_group_begin was called correctly */
- NK_ASSERT(ctx->current);
- win = ctx->current;
- NK_ASSERT(win->layout);
- g = win->layout;
- NK_ASSERT(g->parent);
- parent = g->parent;
-
- /* dummy window */
- nk_zero_struct(pan);
- panel_padding = nk_panel_get_padding(&ctx->style, NK_PANEL_GROUP);
- pan.bounds.y = g->bounds.y - (g->header_height + g->menu.h);
- pan.bounds.x = g->bounds.x - panel_padding.x;
- pan.bounds.w = g->bounds.w + 2 * panel_padding.x;
- pan.bounds.h = g->bounds.h + g->header_height + g->menu.h;
- if (g->flags & NK_WINDOW_BORDER) {
- pan.bounds.x -= g->border;
- pan.bounds.y -= g->border;
- pan.bounds.w += 2*g->border;
- pan.bounds.h += 2*g->border;
+ if (in && *state == NK_PROPERTY_DEFAULT) {
+ if (nk_button_behavior(ws, edit, in, NK_BUTTON_DEFAULT))
+ *state = NK_PROPERTY_EDIT;
+ else if (nk_input_is_mouse_click_down_in_rect(in, NK_BUTTON_LEFT, label, nk_true))
+ *state = NK_PROPERTY_DRAG;
+ else if (nk_input_is_mouse_click_down_in_rect(in, NK_BUTTON_LEFT, empty, nk_true))
+ *state = NK_PROPERTY_DRAG;
}
- if (!(g->flags & NK_WINDOW_NO_SCROLLBAR)) {
- pan.bounds.w += ctx->style.window.scrollbar_size.x;
- pan.bounds.h += ctx->style.window.scrollbar_size.y;
+ if (*state == NK_PROPERTY_DRAG) {
+ nk_drag_behavior(ws, in, property, variant, inc_per_pixel);
+ if (!(*ws & NK_WIDGET_STATE_ACTIVED)) *state = NK_PROPERTY_DEFAULT;
}
- pan.scrollbar.x = *g->offset_x;
- pan.scrollbar.y = *g->offset_y;
- pan.flags = g->flags;
- pan.buffer = win->buffer;
- pan.layout = g;
- pan.parent = win;
- ctx->current = &pan;
+}
+NK_LIB void
+nk_draw_property(struct nk_command_buffer *out, const struct nk_style_property *style,
+ const struct nk_rect *bounds, const struct nk_rect *label, nk_flags state,
+ const char *name, int len, const struct nk_user_font *font)
+{
+ struct nk_text text;
+ const struct nk_style_item *background;
- /* make sure group has correct clipping rectangle */
- nk_unify(&clip, &parent->clip, pan.bounds.x, pan.bounds.y,
- pan.bounds.x + pan.bounds.w, pan.bounds.y + pan.bounds.h + panel_padding.x);
- nk_push_scissor(&pan.buffer, clip);
- nk_end(ctx);
+ /* select correct background and text color */
+ if (state & NK_WIDGET_STATE_ACTIVED) {
+ background = &style->active;
+ text.text = style->label_active;
+ } else if (state & NK_WIDGET_STATE_HOVER) {
+ background = &style->hover;
+ text.text = style->label_hover;
+ } else {
+ background = &style->normal;
+ text.text = style->label_normal;
+ }
- win->buffer = pan.buffer;
- nk_push_scissor(&win->buffer, parent->clip);
- ctx->current = win;
- win->layout = parent;
- g->bounds = pan.bounds;
- return;
+ /* draw background */
+ if (background->type == NK_STYLE_ITEM_IMAGE) {
+ nk_draw_image(out, *bounds, &background->data.image, nk_white);
+ text.background = nk_rgba(0,0,0,0);
+ } else {
+ text.background = background->data.color;
+ nk_fill_rect(out, *bounds, style->rounding, background->data.color);
+ nk_stroke_rect(out, *bounds, style->rounding, style->border, background->data.color);
+ }
+
+ /* draw label */
+ text.padding = nk_vec2(0,0);
+ nk_widget_text(out, *label, name, len, &text, NK_TEXT_CENTERED, font);
}
+NK_LIB void
+nk_do_property(nk_flags *ws,
+ struct nk_command_buffer *out, struct nk_rect property,
+ const char *name, struct nk_property_variant *variant,
+ float inc_per_pixel, char *buffer, int *len,
+ int *state, int *cursor, int *select_begin, int *select_end,
+ const struct nk_style_property *style,
+ enum nk_property_filter filter, struct nk_input *in,
+ const struct nk_user_font *font, struct nk_text_edit *text_edit,
+ enum nk_button_behavior behavior)
+{
+ const nk_plugin_filter filters[] = {
+ nk_filter_decimal,
+ nk_filter_float
+ };
+ int active, old;
+ int num_len, name_len;
+ char string[NK_MAX_NUMBER_BUFFER];
+ float size;
-NK_API int
-nk_group_scrolled_begin(struct nk_context *ctx,
- struct nk_scroll *scroll, const char *title, nk_flags flags)
-{return nk_group_scrolled_offset_begin(ctx, &scroll->x, &scroll->y, title, flags);}
+ char *dst = 0;
+ int *length;
-NK_API int
-nk_group_begin(struct nk_context *ctx, const char *title, nk_flags flags)
-{
- int title_len;
- nk_hash title_hash;
- struct nk_window *win;
- nk_uint *x_offset;
- nk_uint *y_offset;
+ struct nk_rect left;
+ struct nk_rect right;
+ struct nk_rect label;
+ struct nk_rect edit;
+ struct nk_rect empty;
- NK_ASSERT(ctx);
- NK_ASSERT(title);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout || !title)
- return 0;
+ /* left decrement button */
+ left.h = font->height/2;
+ left.w = left.h;
+ left.x = property.x + style->border + style->padding.x;
+ left.y = property.y + style->border + property.h/2.0f - left.h/2;
- /* find persistent group scrollbar value */
- win = ctx->current;
- title_len = (int)nk_strlen(title);
- title_hash = nk_murmur_hash(title, (int)title_len, NK_PANEL_GROUP);
- x_offset = nk_find_value(win, title_hash);
- if (!x_offset) {
- x_offset = nk_add_value(ctx, win, title_hash, 0);
- y_offset = nk_add_value(ctx, win, title_hash+1, 0);
+ /* text label */
+ name_len = nk_strlen(name);
+ size = font->width(font->userdata, font->height, name, name_len);
+ label.x = left.x + left.w + style->padding.x;
+ label.w = (float)size + 2 * style->padding.x;
+ label.y = property.y + style->border + style->padding.y;
+ label.h = property.h - (2 * style->border + 2 * style->padding.y);
- NK_ASSERT(x_offset);
- NK_ASSERT(y_offset);
- if (!x_offset || !y_offset) return 0;
- *x_offset = *y_offset = 0;
- } else y_offset = nk_find_value(win, title_hash+1);
- return nk_group_scrolled_offset_begin(ctx, x_offset, y_offset, title, flags);
-}
+ /* right increment button */
+ right.y = left.y;
+ right.w = left.w;
+ right.h = left.h;
+ right.x = property.x + property.w - (right.w + style->padding.x);
-NK_API void
-nk_group_end(struct nk_context *ctx)
-{nk_group_scrolled_end(ctx);}
+ /* edit */
+ if (*state == NK_PROPERTY_EDIT) {
+ size = font->width(font->userdata, font->height, buffer, *len);
+ size += style->edit.cursor_size;
+ length = len;
+ dst = buffer;
+ } else {
+ switch (variant->kind) {
+ default: break;
+ case NK_PROPERTY_INT:
+ nk_itoa(string, variant->value.i);
+ num_len = nk_strlen(string);
+ break;
+ case NK_PROPERTY_FLOAT:
+ NK_DTOA(string, (double)variant->value.f);
+ num_len = nk_string_float_limit(string, NK_MAX_FLOAT_PRECISION);
+ break;
+ case NK_PROPERTY_DOUBLE:
+ NK_DTOA(string, variant->value.d);
+ num_len = nk_string_float_limit(string, NK_MAX_FLOAT_PRECISION);
+ break;
+ }
+ size = font->width(font->userdata, font->height, string, num_len);
+ dst = string;
+ length = &num_len;
+ }
-NK_API int
-nk_list_view_begin(struct nk_context *ctx, struct nk_list_view *view,
- const char *title, nk_flags flags, int row_height, int row_count)
-{
- int title_len;
- nk_hash title_hash;
- nk_uint *x_offset;
- nk_uint *y_offset;
+ edit.w = (float)size + 2 * style->padding.x;
+ edit.w = NK_MIN(edit.w, right.x - (label.x + label.w));
+ edit.x = right.x - (edit.w + style->padding.x);
+ edit.y = property.y + style->border;
+ edit.h = property.h - (2 * style->border);
- int result;
- struct nk_window *win;
- struct nk_panel *layout;
- const struct nk_style *style;
- struct nk_vec2 item_spacing;
+ /* empty left space activator */
+ empty.w = edit.x - (label.x + label.w);
+ empty.x = label.x + label.w;
+ empty.y = property.y;
+ empty.h = property.h;
- NK_ASSERT(ctx);
- NK_ASSERT(view);
- NK_ASSERT(title);
- if (!ctx || !view || !title) return 0;
+ /* update property */
+ old = (*state == NK_PROPERTY_EDIT);
+ nk_property_behavior(ws, in, property, label, edit, empty, state, variant, inc_per_pixel);
- win = ctx->current;
- style = &ctx->style;
- item_spacing = style->window.spacing;
- row_height += NK_MAX(0, (int)item_spacing.y);
+ /* draw property */
+ if (style->draw_begin) style->draw_begin(out, style->userdata);
+ nk_draw_property(out, style, &property, &label, *ws, name, name_len, font);
+ if (style->draw_end) style->draw_end(out, style->userdata);
- /* find persistent list view scrollbar offset */
- title_len = (int)nk_strlen(title);
- title_hash = nk_murmur_hash(title, (int)title_len, NK_PANEL_GROUP);
- x_offset = nk_find_value(win, title_hash);
- if (!x_offset) {
- x_offset = nk_add_value(ctx, win, title_hash, 0);
- y_offset = nk_add_value(ctx, win, title_hash+1, 0);
+ /* execute right button */
+ if (nk_do_button_symbol(ws, out, left, style->sym_left, behavior, &style->dec_button, in, font)) {
+ switch (variant->kind) {
+ default: break;
+ case NK_PROPERTY_INT:
+ variant->value.i = NK_CLAMP(variant->min_value.i, variant->value.i - variant->step.i, variant->max_value.i); break;
+ case NK_PROPERTY_FLOAT:
+ variant->value.f = NK_CLAMP(variant->min_value.f, variant->value.f - variant->step.f, variant->max_value.f); break;
+ case NK_PROPERTY_DOUBLE:
+ variant->value.d = NK_CLAMP(variant->min_value.d, variant->value.d - variant->step.d, variant->max_value.d); break;
+ }
+ }
+ /* execute left button */
+ if (nk_do_button_symbol(ws, out, right, style->sym_right, behavior, &style->inc_button, in, font)) {
+ switch (variant->kind) {
+ default: break;
+ case NK_PROPERTY_INT:
+ variant->value.i = NK_CLAMP(variant->min_value.i, variant->value.i + variant->step.i, variant->max_value.i); break;
+ case NK_PROPERTY_FLOAT:
+ variant->value.f = NK_CLAMP(variant->min_value.f, variant->value.f + variant->step.f, variant->max_value.f); break;
+ case NK_PROPERTY_DOUBLE:
+ variant->value.d = NK_CLAMP(variant->min_value.d, variant->value.d + variant->step.d, variant->max_value.d); break;
+ }
+ }
+ if (old != NK_PROPERTY_EDIT && (*state == NK_PROPERTY_EDIT)) {
+ /* property has been activated so setup buffer */
+ NK_MEMCPY(buffer, dst, (nk_size)*length);
+ *cursor = nk_utf_len(buffer, *length);
+ *len = *length;
+ length = len;
+ dst = buffer;
+ active = 0;
+ } else active = (*state == NK_PROPERTY_EDIT);
- NK_ASSERT(x_offset);
- NK_ASSERT(y_offset);
- if (!x_offset || !y_offset) return 0;
- *x_offset = *y_offset = 0;
- } else y_offset = nk_find_value(win, title_hash+1);
- view->scroll_value = *y_offset;
- view->scroll_pointer = y_offset;
+ /* execute and run text edit field */
+ nk_textedit_clear_state(text_edit, NK_TEXT_EDIT_SINGLE_LINE, filters[filter]);
+ text_edit->active = (unsigned char)active;
+ text_edit->string.len = *length;
+ text_edit->cursor = NK_CLAMP(0, *cursor, *length);
+ text_edit->select_start = NK_CLAMP(0,*select_begin, *length);
+ text_edit->select_end = NK_CLAMP(0,*select_end, *length);
+ text_edit->string.buffer.allocated = (nk_size)*length;
+ text_edit->string.buffer.memory.size = NK_MAX_NUMBER_BUFFER;
+ text_edit->string.buffer.memory.ptr = dst;
+ text_edit->string.buffer.size = NK_MAX_NUMBER_BUFFER;
+ text_edit->mode = NK_TEXT_EDIT_MODE_INSERT;
+ nk_do_edit(ws, out, edit, NK_EDIT_FIELD|NK_EDIT_AUTO_SELECT,
+ filters[filter], text_edit, &style->edit, (*state == NK_PROPERTY_EDIT) ? in: 0, font);
- *y_offset = 0;
- result = nk_group_scrolled_offset_begin(ctx, x_offset, y_offset, title, flags);
- win = ctx->current;
- layout = win->layout;
+ *length = text_edit->string.len;
+ *cursor = text_edit->cursor;
+ *select_begin = text_edit->select_start;
+ *select_end = text_edit->select_end;
+ if (text_edit->active && nk_input_is_key_pressed(in, NK_KEY_ENTER))
+ text_edit->active = nk_false;
- view->total_height = row_height * NK_MAX(row_count,1);
- view->begin = (int)NK_MAX(((float)view->scroll_value / (float)row_height), 0.0f);
- view->count = (int)NK_MAX(nk_iceilf((layout->clip.h)/(float)row_height), 0);
- view->end = view->begin + view->count;
- view->ctx = ctx;
+ if (active && !text_edit->active) {
+ /* property is now not active so convert edit text to value*/
+ *state = NK_PROPERTY_DEFAULT;
+ buffer[*len] = '\0';
+ switch (variant->kind) {
+ default: break;
+ case NK_PROPERTY_INT:
+ variant->value.i = nk_strtoi(buffer, 0);
+ variant->value.i = NK_CLAMP(variant->min_value.i, variant->value.i, variant->max_value.i);
+ break;
+ case NK_PROPERTY_FLOAT:
+ nk_string_float_limit(buffer, NK_MAX_FLOAT_PRECISION);
+ variant->value.f = nk_strtof(buffer, 0);
+ variant->value.f = NK_CLAMP(variant->min_value.f, variant->value.f, variant->max_value.f);
+ break;
+ case NK_PROPERTY_DOUBLE:
+ nk_string_float_limit(buffer, NK_MAX_FLOAT_PRECISION);
+ variant->value.d = nk_strtod(buffer, 0);
+ variant->value.d = NK_CLAMP(variant->min_value.d, variant->value.d, variant->max_value.d);
+ break;
+ }
+ }
+}
+NK_LIB struct nk_property_variant
+nk_property_variant_int(int value, int min_value, int max_value, int step)
+{
+ struct nk_property_variant result;
+ result.kind = NK_PROPERTY_INT;
+ result.value.i = value;
+ result.min_value.i = min_value;
+ result.max_value.i = max_value;
+ result.step.i = step;
+ return result;
+}
+NK_LIB struct nk_property_variant
+nk_property_variant_float(float value, float min_value, float max_value, float step)
+{
+ struct nk_property_variant result;
+ result.kind = NK_PROPERTY_FLOAT;
+ result.value.f = value;
+ result.min_value.f = min_value;
+ result.max_value.f = max_value;
+ result.step.f = step;
+ return result;
+}
+NK_LIB struct nk_property_variant
+nk_property_variant_double(double value, double min_value, double max_value,
+ double step)
+{
+ struct nk_property_variant result;
+ result.kind = NK_PROPERTY_DOUBLE;
+ result.value.d = value;
+ result.min_value.d = min_value;
+ result.max_value.d = max_value;
+ result.step.d = step;
return result;
}
-
-NK_API void
-nk_list_view_end(struct nk_list_view *view)
+NK_LIB void
+nk_property(struct nk_context *ctx, const char *name, struct nk_property_variant *variant,
+ float inc_per_pixel, const enum nk_property_filter filter)
{
- struct nk_context *ctx;
struct nk_window *win;
struct nk_panel *layout;
+ struct nk_input *in;
+ const struct nk_style *style;
- NK_ASSERT(view);
- NK_ASSERT(view->ctx);
- NK_ASSERT(view->scroll_pointer);
- if (!view || !view->ctx) return;
-
- ctx = view->ctx;
- win = ctx->current;
- layout = win->layout;
- layout->at_y = layout->bounds.y + (float)view->total_height;
- *view->scroll_pointer = *view->scroll_pointer + view->scroll_value;
- nk_group_end(view->ctx);
-}
+ struct nk_rect bounds;
+ enum nk_widget_layout_states s;
-/* --------------------------------------------------------------
- *
- * POPUP
- *
- * --------------------------------------------------------------*/
-NK_API int
-nk_popup_begin(struct nk_context *ctx, enum nk_popup_type type,
- const char *title, nk_flags flags, struct nk_rect rect)
-{
- struct nk_window *popup;
- struct nk_window *win;
- struct nk_panel *panel;
+ int *state = 0;
+ nk_hash hash = 0;
+ char *buffer = 0;
+ int *len = 0;
+ int *cursor = 0;
+ int *select_begin = 0;
+ int *select_end = 0;
+ int old_state;
- int title_len;
- nk_hash title_hash;
- nk_size allocated;
+ char dummy_buffer[NK_MAX_NUMBER_BUFFER];
+ int dummy_state = NK_PROPERTY_DEFAULT;
+ int dummy_length = 0;
+ int dummy_cursor = 0;
+ int dummy_select_begin = 0;
+ int dummy_select_end = 0;
NK_ASSERT(ctx);
- NK_ASSERT(title);
NK_ASSERT(ctx->current);
NK_ASSERT(ctx->current->layout);
if (!ctx || !ctx->current || !ctx->current->layout)
- return 0;
+ return;
win = ctx->current;
- panel = win->layout;
- NK_ASSERT(!(panel->type & NK_PANEL_SET_POPUP) && "popups are not allowed to have popups");
- (void)panel;
- title_len = (int)nk_strlen(title);
- title_hash = nk_murmur_hash(title, (int)title_len, NK_PANEL_POPUP);
+ layout = win->layout;
+ style = &ctx->style;
+ s = nk_widget(&bounds, ctx);
+ if (!s) return;
- popup = win->popup.win;
- if (!popup) {
- popup = (struct nk_window*)nk_create_window(ctx);
- popup->parent = win;
- win->popup.win = popup;
- win->popup.active = 0;
- win->popup.type = NK_PANEL_POPUP;
- }
+ /* calculate hash from name */
+ if (name[0] == '#') {
+ hash = nk_murmur_hash(name, (int)nk_strlen(name), win->property.seq++);
+ name++; /* special number hash */
+ } else hash = nk_murmur_hash(name, (int)nk_strlen(name), 42);
- /* make sure we have correct popup */
- if (win->popup.name != title_hash) {
- if (!win->popup.active) {
- nk_zero(popup, sizeof(*popup));
- win->popup.name = title_hash;
- win->popup.active = 1;
- win->popup.type = NK_PANEL_POPUP;
- } else return 0;
+ /* check if property is currently hot item */
+ if (win->property.active && hash == win->property.name) {
+ buffer = win->property.buffer;
+ len = &win->property.length;
+ cursor = &win->property.cursor;
+ state = &win->property.state;
+ select_begin = &win->property.select_start;
+ select_end = &win->property.select_end;
+ } else {
+ buffer = dummy_buffer;
+ len = &dummy_length;
+ cursor = &dummy_cursor;
+ state = &dummy_state;
+ select_begin = &dummy_select_begin;
+ select_end = &dummy_select_end;
}
- /* popup position is local to window */
- ctx->current = popup;
- rect.x += win->layout->clip.x;
- rect.y += win->layout->clip.y;
-
- /* setup popup data */
- popup->parent = win;
- popup->bounds = rect;
- popup->seq = ctx->seq;
- popup->layout = (struct nk_panel*)nk_create_panel(ctx);
- popup->flags = flags;
- popup->flags |= NK_WINDOW_BORDER;
- if (type == NK_POPUP_DYNAMIC)
- popup->flags |= NK_WINDOW_DYNAMIC;
-
- popup->buffer = win->buffer;
- nk_start_popup(ctx, win);
- allocated = ctx->memory.allocated;
- nk_push_scissor(&popup->buffer, nk_null_rect);
+ /* execute property widget */
+ old_state = *state;
+ ctx->text_edit.clip = ctx->clip;
+ in = ((s == NK_WIDGET_ROM && !win->property.active) ||
+ layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+ nk_do_property(&ctx->last_widget_state, &win->buffer, bounds, name,
+ variant, inc_per_pixel, buffer, len, state, cursor, select_begin,
+ select_end, &style->property, filter, in, style->font, &ctx->text_edit,
+ ctx->button_behavior);
- if (nk_panel_begin(ctx, title, NK_PANEL_POPUP)) {
- /* popup is running therefore invalidate parent panels */
- struct nk_panel *root;
- root = win->layout;
- while (root) {
- root->flags |= NK_WINDOW_ROM;
- root->flags &= ~(nk_flags)NK_WINDOW_REMOVE_ROM;
- root = root->parent;
+ if (in && *state != NK_PROPERTY_DEFAULT && !win->property.active) {
+ /* current property is now hot */
+ win->property.active = 1;
+ NK_MEMCPY(win->property.buffer, buffer, (nk_size)*len);
+ win->property.length = *len;
+ win->property.cursor = *cursor;
+ win->property.state = *state;
+ win->property.name = hash;
+ win->property.select_start = *select_begin;
+ win->property.select_end = *select_end;
+ if (*state == NK_PROPERTY_DRAG) {
+ ctx->input.mouse.grab = nk_true;
+ ctx->input.mouse.grabbed = nk_true;
}
- win->popup.active = 1;
- popup->layout->offset_x = &popup->scrollbar.x;
- popup->layout->offset_y = &popup->scrollbar.y;
- popup->layout->parent = win->layout;
- return 1;
- } else {
- /* popup was closed/is invalid so cleanup */
- struct nk_panel *root;
- root = win->layout;
- while (root) {
- root->flags |= NK_WINDOW_REMOVE_ROM;
- root = root->parent;
+ }
+ /* check if previously active property is now inactive */
+ if (*state == NK_PROPERTY_DEFAULT && old_state != NK_PROPERTY_DEFAULT) {
+ if (old_state == NK_PROPERTY_DRAG) {
+ ctx->input.mouse.grab = nk_false;
+ ctx->input.mouse.grabbed = nk_false;
+ ctx->input.mouse.ungrab = nk_true;
}
- win->popup.buf.active = 0;
- win->popup.active = 0;
- ctx->memory.allocated = allocated;
- ctx->current = win;
- nk_free_panel(ctx, popup->layout);
- popup->layout = 0;
- return 0;
+ win->property.select_start = 0;
+ win->property.select_end = 0;
+ win->property.active = 0;
}
}
+NK_API void
+nk_property_int(struct nk_context *ctx, const char *name,
+ int min, int *val, int max, int step, float inc_per_pixel)
+{
+ struct nk_property_variant variant;
+ NK_ASSERT(ctx);
+ NK_ASSERT(name);
+ NK_ASSERT(val);
+
+ if (!ctx || !ctx->current || !name || !val) return;
+ variant = nk_property_variant_int(*val, min, max, step);
+ nk_property(ctx, name, &variant, inc_per_pixel, NK_FILTER_INT);
+ *val = variant.value.i;
+}
+NK_API void
+nk_property_float(struct nk_context *ctx, const char *name,
+ float min, float *val, float max, float step, float inc_per_pixel)
+{
+ struct nk_property_variant variant;
+ NK_ASSERT(ctx);
+ NK_ASSERT(name);
+ NK_ASSERT(val);
+
+ if (!ctx || !ctx->current || !name || !val) return;
+ variant = nk_property_variant_float(*val, min, max, step);
+ nk_property(ctx, name, &variant, inc_per_pixel, NK_FILTER_FLOAT);
+ *val = variant.value.f;
+}
+NK_API void
+nk_property_double(struct nk_context *ctx, const char *name,
+ double min, double *val, double max, double step, float inc_per_pixel)
+{
+ struct nk_property_variant variant;
+ NK_ASSERT(ctx);
+ NK_ASSERT(name);
+ NK_ASSERT(val);
+
+ if (!ctx || !ctx->current || !name || !val) return;
+ variant = nk_property_variant_double(*val, min, max, step);
+ nk_property(ctx, name, &variant, inc_per_pixel, NK_FILTER_FLOAT);
+ *val = variant.value.d;
+}
+NK_API int
+nk_propertyi(struct nk_context *ctx, const char *name, int min, int val,
+ int max, int step, float inc_per_pixel)
+{
+ struct nk_property_variant variant;
+ NK_ASSERT(ctx);
+ NK_ASSERT(name);
+
+ if (!ctx || !ctx->current || !name) return val;
+ variant = nk_property_variant_int(val, min, max, step);
+ nk_property(ctx, name, &variant, inc_per_pixel, NK_FILTER_INT);
+ val = variant.value.i;
+ return val;
+}
+NK_API float
+nk_propertyf(struct nk_context *ctx, const char *name, float min,
+ float val, float max, float step, float inc_per_pixel)
+{
+ struct nk_property_variant variant;
+ NK_ASSERT(ctx);
+ NK_ASSERT(name);
+
+ if (!ctx || !ctx->current || !name) return val;
+ variant = nk_property_variant_float(val, min, max, step);
+ nk_property(ctx, name, &variant, inc_per_pixel, NK_FILTER_FLOAT);
+ val = variant.value.f;
+ return val;
+}
+NK_API double
+nk_propertyd(struct nk_context *ctx, const char *name, double min,
+ double val, double max, double step, float inc_per_pixel)
+{
+ struct nk_property_variant variant;
+ NK_ASSERT(ctx);
+ NK_ASSERT(name);
+
+ if (!ctx || !ctx->current || !name) return val;
+ variant = nk_property_variant_double(val, min, max, step);
+ nk_property(ctx, name, &variant, inc_per_pixel, NK_FILTER_FLOAT);
+ val = variant.value.d;
+ return val;
+}
-NK_INTERN int
-nk_nonblock_begin(struct nk_context *ctx,
- nk_flags flags, struct nk_rect body, struct nk_rect header,
- enum nk_panel_type panel_type)
+
+
+
+
+/* ==============================================================
+ *
+ * CHART
+ *
+ * ===============================================================*/
+NK_API int
+nk_chart_begin_colored(struct nk_context *ctx, enum nk_chart_type type,
+ struct nk_color color, struct nk_color highlight,
+ int count, float min_value, float max_value)
{
- struct nk_window *popup;
struct nk_window *win;
- struct nk_panel *panel;
- int is_active = nk_true;
+ struct nk_chart *chart;
+ const struct nk_style *config;
+ const struct nk_style_chart *style;
+
+ const struct nk_style_item *background;
+ struct nk_rect bounds = {0, 0, 0, 0};
NK_ASSERT(ctx);
NK_ASSERT(ctx->current);
NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
+
+ if (!ctx || !ctx->current || !ctx->current->layout) return 0;
+ if (!nk_widget(&bounds, ctx)) {
+ chart = &ctx->current->layout->chart;
+ nk_zero(chart, sizeof(*chart));
return 0;
+ }
- /* popups cannot have popups */
win = ctx->current;
- panel = win->layout;
- NK_ASSERT(!(panel->type & NK_PANEL_SET_POPUP));
- (void)panel;
- popup = win->popup.win;
- if (!popup) {
- /* create window for nonblocking popup */
- popup = (struct nk_window*)nk_create_window(ctx);
- popup->parent = win;
- win->popup.win = popup;
- win->popup.type = panel_type;
- nk_command_buffer_init(&popup->buffer, &ctx->memory, NK_CLIPPING_ON);
+ config = &ctx->style;
+ chart = &win->layout->chart;
+ style = &config->chart;
+
+ /* setup basic generic chart */
+ nk_zero(chart, sizeof(*chart));
+ chart->x = bounds.x + style->padding.x;
+ chart->y = bounds.y + style->padding.y;
+ chart->w = bounds.w - 2 * style->padding.x;
+ chart->h = bounds.h - 2 * style->padding.y;
+ chart->w = NK_MAX(chart->w, 2 * style->padding.x);
+ chart->h = NK_MAX(chart->h, 2 * style->padding.y);
+
+ /* add first slot into chart */
+ {struct nk_chart_slot *slot = &chart->slots[chart->slot++];
+ slot->type = type;
+ slot->count = count;
+ slot->color = color;
+ slot->highlight = highlight;
+ slot->min = NK_MIN(min_value, max_value);
+ slot->max = NK_MAX(min_value, max_value);
+ slot->range = slot->max - slot->min;}
+
+ /* draw chart background */
+ background = &style->background;
+ if (background->type == NK_STYLE_ITEM_IMAGE) {
+ nk_draw_image(&win->buffer, bounds, &background->data.image, nk_white);
} else {
- /* close the popup if user pressed outside or in the header */
- int pressed, in_body, in_header;
- pressed = nk_input_is_mouse_pressed(&ctx->input, NK_BUTTON_LEFT);
- in_body = nk_input_is_mouse_hovering_rect(&ctx->input, body);
- in_header = nk_input_is_mouse_hovering_rect(&ctx->input, header);
- if (pressed && (!in_body || in_header))
- is_active = nk_false;
+ nk_fill_rect(&win->buffer, bounds, style->rounding, style->border_color);
+ nk_fill_rect(&win->buffer, nk_shrink_rect(bounds, style->border),
+ style->rounding, style->background.data.color);
}
- win->popup.header = header;
+ return 1;
+}
+NK_API int
+nk_chart_begin(struct nk_context *ctx, const enum nk_chart_type type,
+ int count, float min_value, float max_value)
+{
+ return nk_chart_begin_colored(ctx, type, ctx->style.chart.color,
+ ctx->style.chart.selected_color, count, min_value, max_value);
+}
+NK_API void
+nk_chart_add_slot_colored(struct nk_context *ctx, const enum nk_chart_type type,
+ struct nk_color color, struct nk_color highlight,
+ int count, float min_value, float max_value)
+{
+ NK_ASSERT(ctx);
+ NK_ASSERT(ctx->current);
+ NK_ASSERT(ctx->current->layout);
+ NK_ASSERT(ctx->current->layout->chart.slot < NK_CHART_MAX_SLOT);
+ if (!ctx || !ctx->current || !ctx->current->layout) return;
+ if (ctx->current->layout->chart.slot >= NK_CHART_MAX_SLOT) return;
- if (!is_active) {
- /* remove read only mode from all parent panels */
- struct nk_panel *root = win->layout;
- while (root) {
- root->flags |= NK_WINDOW_REMOVE_ROM;
- root = root->parent;
+ /* add another slot into the graph */
+ {struct nk_chart *chart = &ctx->current->layout->chart;
+ struct nk_chart_slot *slot = &chart->slots[chart->slot++];
+ slot->type = type;
+ slot->count = count;
+ slot->color = color;
+ slot->highlight = highlight;
+ slot->min = NK_MIN(min_value, max_value);
+ slot->max = NK_MAX(min_value, max_value);
+ slot->range = slot->max - slot->min;}
+}
+NK_API void
+nk_chart_add_slot(struct nk_context *ctx, const enum nk_chart_type type,
+ int count, float min_value, float max_value)
+{
+ nk_chart_add_slot_colored(ctx, type, ctx->style.chart.color,
+ ctx->style.chart.selected_color, count, min_value, max_value);
+}
+NK_INTERN nk_flags
+nk_chart_push_line(struct nk_context *ctx, struct nk_window *win,
+ struct nk_chart *g, float value, int slot)
+{
+ struct nk_panel *layout = win->layout;
+ const struct nk_input *i = &ctx->input;
+ struct nk_command_buffer *out = &win->buffer;
+
+ nk_flags ret = 0;
+ struct nk_vec2 cur;
+ struct nk_rect bounds;
+ struct nk_color color;
+ float step;
+ float range;
+ float ratio;
+
+ NK_ASSERT(slot >= 0 && slot < NK_CHART_MAX_SLOT);
+ step = g->w / (float)g->slots[slot].count;
+ range = g->slots[slot].max - g->slots[slot].min;
+ ratio = (value - g->slots[slot].min) / range;
+
+ if (g->slots[slot].index == 0) {
+ /* first data point does not have a connection */
+ g->slots[slot].last.x = g->x;
+ g->slots[slot].last.y = (g->y + g->h) - ratio * (float)g->h;
+
+ bounds.x = g->slots[slot].last.x - 2;
+ bounds.y = g->slots[slot].last.y - 2;
+ bounds.w = bounds.h = 4;
+
+ color = g->slots[slot].color;
+ if (!(layout->flags & NK_WINDOW_ROM) &&
+ NK_INBOX(i->mouse.pos.x,i->mouse.pos.y, g->slots[slot].last.x-3, g->slots[slot].last.y-3, 6, 6)){
+ ret = nk_input_is_mouse_hovering_rect(i, bounds) ? NK_CHART_HOVERING : 0;
+ ret |= (i->mouse.buttons[NK_BUTTON_LEFT].down &&
+ i->mouse.buttons[NK_BUTTON_LEFT].clicked) ? NK_CHART_CLICKED: 0;
+ color = g->slots[slot].highlight;
}
- return is_active;
+ nk_fill_rect(out, bounds, 0, color);
+ g->slots[slot].index += 1;
+ return ret;
}
- popup->bounds = body;
- popup->parent = win;
- popup->layout = (struct nk_panel*)nk_create_panel(ctx);
- popup->flags = flags;
- popup->flags |= NK_WINDOW_BORDER;
- popup->flags |= NK_WINDOW_DYNAMIC;
- popup->seq = ctx->seq;
- win->popup.active = 1;
- NK_ASSERT(popup->layout);
+ /* draw a line between the last data point and the new one */
+ color = g->slots[slot].color;
+ cur.x = g->x + (float)(step * (float)g->slots[slot].index);
+ cur.y = (g->y + g->h) - (ratio * (float)g->h);
+ nk_stroke_line(out, g->slots[slot].last.x, g->slots[slot].last.y, cur.x, cur.y, 1.0f, color);
- nk_start_popup(ctx, win);
- popup->buffer = win->buffer;
- nk_push_scissor(&popup->buffer, nk_null_rect);
- ctx->current = popup;
+ bounds.x = cur.x - 3;
+ bounds.y = cur.y - 3;
+ bounds.w = bounds.h = 6;
- nk_panel_begin(ctx, 0, panel_type);
- win->buffer = popup->buffer;
- popup->layout->parent = win->layout;
- popup->layout->offset_x = &popup->scrollbar.x;
- popup->layout->offset_y = &popup->scrollbar.y;
+ /* user selection of current data point */
+ if (!(layout->flags & NK_WINDOW_ROM)) {
+ if (nk_input_is_mouse_hovering_rect(i, bounds)) {
+ ret = NK_CHART_HOVERING;
+ ret |= (!i->mouse.buttons[NK_BUTTON_LEFT].down &&
+ i->mouse.buttons[NK_BUTTON_LEFT].clicked) ? NK_CHART_CLICKED: 0;
+ color = g->slots[slot].highlight;
+ }
+ }
+ nk_fill_rect(out, nk_rect(cur.x - 2, cur.y - 2, 4, 4), 0, color);
- /* set read only mode to all parent panels */
- {struct nk_panel *root;
- root = win->layout;
- while (root) {
- root->flags |= NK_WINDOW_ROM;
- root = root->parent;
- }}
- return is_active;
+ /* save current data point position */
+ g->slots[slot].last.x = cur.x;
+ g->slots[slot].last.y = cur.y;
+ g->slots[slot].index += 1;
+ return ret;
}
-
-NK_API void
-nk_popup_close(struct nk_context *ctx)
+NK_INTERN nk_flags
+nk_chart_push_column(const struct nk_context *ctx, struct nk_window *win,
+ struct nk_chart *chart, float value, int slot)
{
- struct nk_window *popup;
- NK_ASSERT(ctx);
- if (!ctx || !ctx->current) return;
+ struct nk_command_buffer *out = &win->buffer;
+ const struct nk_input *in = &ctx->input;
+ struct nk_panel *layout = win->layout;
+
+ float ratio;
+ nk_flags ret = 0;
+ struct nk_color color;
+ struct nk_rect item = {0,0,0,0};
+
+ NK_ASSERT(slot >= 0 && slot < NK_CHART_MAX_SLOT);
+ if (chart->slots[slot].index >= chart->slots[slot].count)
+ return nk_false;
+ if (chart->slots[slot].count) {
+ float padding = (float)(chart->slots[slot].count-1);
+ item.w = (chart->w - padding) / (float)(chart->slots[slot].count);
+ }
+
+ /* calculate bounds of current bar chart entry */
+ color = chart->slots[slot].color;;
+ item.h = chart->h * NK_ABS((value/chart->slots[slot].range));
+ if (value >= 0) {
+ ratio = (value + NK_ABS(chart->slots[slot].min)) / NK_ABS(chart->slots[slot].range);
+ item.y = (chart->y + chart->h) - chart->h * ratio;
+ } else {
+ ratio = (value - chart->slots[slot].max) / chart->slots[slot].range;
+ item.y = chart->y + (chart->h * NK_ABS(ratio)) - item.h;
+ }
+ item.x = chart->x + ((float)chart->slots[slot].index * item.w);
+ item.x = item.x + ((float)chart->slots[slot].index);
- popup = ctx->current;
- NK_ASSERT(popup->parent);
- NK_ASSERT(popup->layout->type & NK_PANEL_SET_POPUP);
- popup->flags |= NK_WINDOW_HIDDEN;
+ /* user chart bar selection */
+ if (!(layout->flags & NK_WINDOW_ROM) &&
+ NK_INBOX(in->mouse.pos.x,in->mouse.pos.y,item.x,item.y,item.w,item.h)) {
+ ret = NK_CHART_HOVERING;
+ ret |= (!in->mouse.buttons[NK_BUTTON_LEFT].down &&
+ in->mouse.buttons[NK_BUTTON_LEFT].clicked) ? NK_CHART_CLICKED: 0;
+ color = chart->slots[slot].highlight;
+ }
+ nk_fill_rect(out, item, 0, color);
+ chart->slots[slot].index += 1;
+ return ret;
}
-
-NK_API void
-nk_popup_end(struct nk_context *ctx)
+NK_API nk_flags
+nk_chart_push_slot(struct nk_context *ctx, float value, int slot)
{
+ nk_flags flags;
struct nk_window *win;
- struct nk_window *popup;
NK_ASSERT(ctx);
NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
+ NK_ASSERT(slot >= 0 && slot < NK_CHART_MAX_SLOT);
+ NK_ASSERT(slot < ctx->current->layout->chart.slot);
+ if (!ctx || !ctx->current || slot >= NK_CHART_MAX_SLOT) return nk_false;
+ if (slot >= ctx->current->layout->chart.slot) return nk_false;
- popup = ctx->current;
- if (!popup->parent) return;
- win = popup->parent;
- if (popup->flags & NK_WINDOW_HIDDEN) {
- struct nk_panel *root;
- root = win->layout;
- while (root) {
- root->flags |= NK_WINDOW_REMOVE_ROM;
- root = root->parent;
- }
- win->popup.active = 0;
+ win = ctx->current;
+ if (win->layout->chart.slot < slot) return nk_false;
+ switch (win->layout->chart.slots[slot].type) {
+ case NK_CHART_LINES:
+ flags = nk_chart_push_line(ctx, win, &win->layout->chart, value, slot); break;
+ case NK_CHART_COLUMN:
+ flags = nk_chart_push_column(ctx, win, &win->layout->chart, value, slot); break;
+ default:
+ case NK_CHART_MAX:
+ flags = 0;
}
- nk_push_scissor(&popup->buffer, nk_null_rect);
- nk_end(ctx);
-
- win->buffer = popup->buffer;
- nk_finish_popup(ctx, win);
- ctx->current = win;
- nk_push_scissor(&win->buffer, win->layout->clip);
+ return flags;
}
-/* -------------------------------------------------------------
- *
- * TOOLTIP
- *
- * -------------------------------------------------------------- */
-NK_API int
-nk_tooltip_begin(struct nk_context *ctx, float width)
+NK_API nk_flags
+nk_chart_push(struct nk_context *ctx, float value)
+{
+ return nk_chart_push_slot(ctx, value, 0);
+}
+NK_API void
+nk_chart_end(struct nk_context *ctx)
{
struct nk_window *win;
- const struct nk_input *in;
- struct nk_rect bounds;
- int ret;
+ struct nk_chart *chart;
NK_ASSERT(ctx);
NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return 0;
+ if (!ctx || !ctx->current)
+ return;
- /* make sure that no nonblocking popup is currently active */
win = ctx->current;
- in = &ctx->input;
- if (win->popup.win && (win->popup.type & NK_PANEL_SET_NONBLOCK))
- return 0;
-
- bounds.w = width;
- bounds.h = nk_null_rect.h;
- bounds.x = (in->mouse.pos.x + 1) - win->layout->clip.x;
- bounds.y = (in->mouse.pos.y + 1) - win->layout->clip.y;
-
- ret = nk_popup_begin(ctx, NK_POPUP_DYNAMIC,
- "__##Tooltip##__", NK_WINDOW_NO_SCROLLBAR|NK_WINDOW_BORDER, bounds);
- if (ret) win->layout->flags &= ~(nk_flags)NK_WINDOW_ROM;
- win->popup.type = NK_PANEL_TOOLTIP;
- ctx->current->layout->type = NK_PANEL_TOOLTIP;
- return ret;
+ chart = &win->layout->chart;
+ NK_MEMSET(chart, 0, sizeof(*chart));
+ return;
}
-
NK_API void
-nk_tooltip_end(struct nk_context *ctx)
+nk_plot(struct nk_context *ctx, enum nk_chart_type type, const float *values,
+ int count, int offset)
{
+ int i = 0;
+ float min_value;
+ float max_value;
+
NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current) return;
- ctx->current->seq--;
- nk_popup_close(ctx);
- nk_popup_end(ctx);
-}
+ NK_ASSERT(values);
+ if (!ctx || !values || !count) return;
+
+ min_value = values[offset];
+ max_value = values[offset];
+ for (i = 0; i < count; ++i) {
+ min_value = NK_MIN(values[i + offset], min_value);
+ max_value = NK_MAX(values[i + offset], max_value);
+ }
+ if (nk_chart_begin(ctx, type, count, min_value, max_value)) {
+ for (i = 0; i < count; ++i)
+ nk_chart_push(ctx, values[i + offset]);
+ nk_chart_end(ctx);
+ }
+}
NK_API void
-nk_tooltip(struct nk_context *ctx, const char *text)
+nk_plot_function(struct nk_context *ctx, enum nk_chart_type type, void *userdata,
+ float(*value_getter)(void* user, int index), int count, int offset)
{
- const struct nk_style *style;
- struct nk_vec2 padding;
-
- int text_len;
- float text_width;
- float text_height;
+ int i = 0;
+ float min_value;
+ float max_value;
NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- NK_ASSERT(text);
- if (!ctx || !ctx->current || !ctx->current->layout || !text)
- return;
-
- /* fetch configuration data */
- style = &ctx->style;
- padding = style->window.padding;
+ NK_ASSERT(value_getter);
+ if (!ctx || !value_getter || !count) return;
- /* calculate size of the text and tooltip */
- text_len = nk_strlen(text);
- text_width = style->font->width(style->font->userdata,
- style->font->height, text, text_len);
- text_width += (4 * padding.x);
- text_height = (style->font->height + 2 * padding.y);
+ max_value = min_value = value_getter(userdata, offset);
+ for (i = 0; i < count; ++i) {
+ float value = value_getter(userdata, i + offset);
+ min_value = NK_MIN(value, min_value);
+ max_value = NK_MAX(value, max_value);
+ }
- /* execute tooltip and fill with text */
- if (nk_tooltip_begin(ctx, (float)text_width)) {
- nk_layout_row_dynamic(ctx, (float)text_height, 1);
- nk_text(ctx, text, text_len, NK_TEXT_LEFT);
- nk_tooltip_end(ctx);
+ if (nk_chart_begin(ctx, type, count, min_value, max_value)) {
+ for (i = 0; i < count; ++i)
+ nk_chart_push(ctx, value_getter(userdata, i + offset));
+ nk_chart_end(ctx);
}
}
-/* -------------------------------------------------------------
- *
- * CONTEXTUAL
- *
- * -------------------------------------------------------------- */
-NK_API int
-nk_contextual_begin(struct nk_context *ctx, nk_flags flags, struct nk_vec2 size,
- struct nk_rect trigger_bounds)
-{
- struct nk_window *win;
- struct nk_window *popup;
- struct nk_rect body;
- NK_STORAGE const struct nk_rect null_rect = {0,0,0,0};
- int is_clicked = 0;
- int is_active = 0;
- int is_open = 0;
- int ret = 0;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return 0;
- win = ctx->current;
- ++win->popup.con_count;
- /* check if currently active contextual is active */
- popup = win->popup.win;
- is_open = (popup && win->popup.type == NK_PANEL_CONTEXTUAL);
- is_clicked = nk_input_mouse_clicked(&ctx->input, NK_BUTTON_RIGHT, trigger_bounds);
- if (win->popup.active_con && win->popup.con_count != win->popup.active_con)
- return 0;
- if ((is_clicked && is_open && !is_active) || (!is_open && !is_active && !is_clicked))
- return 0;
- /* calculate contextual position on click */
- win->popup.active_con = win->popup.con_count;
- if (is_clicked) {
- body.x = ctx->input.mouse.pos.x;
- body.y = ctx->input.mouse.pos.y;
- } else {
- body.x = popup->bounds.x;
- body.y = popup->bounds.y;
- }
- body.w = size.x;
- body.h = size.y;
+/* ==============================================================
+ *
+ * COLOR PICKER
+ *
+ * ===============================================================*/
+NK_LIB int
+nk_color_picker_behavior(nk_flags *state,
+ const struct nk_rect *bounds, const struct nk_rect *matrix,
+ const struct nk_rect *hue_bar, const struct nk_rect *alpha_bar,
+ struct nk_colorf *color, const struct nk_input *in)
+{
+ float hsva[4];
+ int value_changed = 0;
+ int hsv_changed = 0;
- /* start nonblocking contextual popup */
- ret = nk_nonblock_begin(ctx, flags|NK_WINDOW_NO_SCROLLBAR, body,
- null_rect, NK_PANEL_CONTEXTUAL);
- if (ret) win->popup.type = NK_PANEL_CONTEXTUAL;
- else {
- win->popup.active_con = 0;
- if (win->popup.win)
- win->popup.win->flags = 0;
+ NK_ASSERT(state);
+ NK_ASSERT(matrix);
+ NK_ASSERT(hue_bar);
+ NK_ASSERT(color);
+
+ /* color matrix */
+ nk_colorf_hsva_fv(hsva, *color);
+ if (nk_button_behavior(state, *matrix, in, NK_BUTTON_REPEATER)) {
+ hsva[1] = NK_SATURATE((in->mouse.pos.x - matrix->x) / (matrix->w-1));
+ hsva[2] = 1.0f - NK_SATURATE((in->mouse.pos.y - matrix->y) / (matrix->h-1));
+ value_changed = hsv_changed = 1;
+ }
+ /* hue bar */
+ if (nk_button_behavior(state, *hue_bar, in, NK_BUTTON_REPEATER)) {
+ hsva[0] = NK_SATURATE((in->mouse.pos.y - hue_bar->y) / (hue_bar->h-1));
+ value_changed = hsv_changed = 1;
+ }
+ /* alpha bar */
+ if (alpha_bar) {
+ if (nk_button_behavior(state, *alpha_bar, in, NK_BUTTON_REPEATER)) {
+ hsva[3] = 1.0f - NK_SATURATE((in->mouse.pos.y - alpha_bar->y) / (alpha_bar->h-1));
+ value_changed = 1;
+ }
+ }
+ nk_widget_state_reset(state);
+ if (hsv_changed) {
+ *color = nk_hsva_colorfv(hsva);
+ *state = NK_WIDGET_STATE_ACTIVE;
+ }
+ if (value_changed) {
+ color->a = hsva[3];
+ *state = NK_WIDGET_STATE_ACTIVE;
}
- return ret;
+ /* set color picker widget state */
+ if (nk_input_is_mouse_hovering_rect(in, *bounds))
+ *state = NK_WIDGET_STATE_HOVERED;
+ if (*state & NK_WIDGET_STATE_HOVER && !nk_input_is_mouse_prev_hovering_rect(in, *bounds))
+ *state |= NK_WIDGET_STATE_ENTERED;
+ else if (nk_input_is_mouse_prev_hovering_rect(in, *bounds))
+ *state |= NK_WIDGET_STATE_LEFT;
+ return value_changed;
}
-
-NK_API int
-nk_contextual_item_text(struct nk_context *ctx, const char *text, int len,
- nk_flags alignment)
+NK_LIB void
+nk_draw_color_picker(struct nk_command_buffer *o, const struct nk_rect *matrix,
+ const struct nk_rect *hue_bar, const struct nk_rect *alpha_bar,
+ struct nk_colorf col)
{
- struct nk_window *win;
- const struct nk_input *in;
- const struct nk_style *style;
+ NK_STORAGE const struct nk_color black = {0,0,0,255};
+ NK_STORAGE const struct nk_color white = {255, 255, 255, 255};
+ NK_STORAGE const struct nk_color black_trans = {0,0,0,0};
- struct nk_rect bounds;
- enum nk_widget_layout_states state;
+ const float crosshair_size = 7.0f;
+ struct nk_color temp;
+ float hsva[4];
+ float line_y;
+ int i;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return 0;
+ NK_ASSERT(o);
+ NK_ASSERT(matrix);
+ NK_ASSERT(hue_bar);
- win = ctx->current;
- style = &ctx->style;
- state = nk_widget_fitting(&bounds, ctx, style->contextual_button.padding);
- if (!state) return nk_false;
+ /* draw hue bar */
+ nk_colorf_hsva_fv(hsva, col);
+ for (i = 0; i < 6; ++i) {
+ NK_GLOBAL const struct nk_color hue_colors[] = {
+ {255, 0, 0, 255}, {255,255,0,255}, {0,255,0,255}, {0, 255,255,255},
+ {0,0,255,255}, {255, 0, 255, 255}, {255, 0, 0, 255}
+ };
+ nk_fill_rect_multi_color(o,
+ nk_rect(hue_bar->x, hue_bar->y + (float)i * (hue_bar->h/6.0f) + 0.5f,
+ hue_bar->w, (hue_bar->h/6.0f) + 0.5f), hue_colors[i], hue_colors[i],
+ hue_colors[i+1], hue_colors[i+1]);
+ }
+ line_y = (float)(int)(hue_bar->y + hsva[0] * matrix->h + 0.5f);
+ nk_stroke_line(o, hue_bar->x-1, line_y, hue_bar->x + hue_bar->w + 2,
+ line_y, 1, nk_rgb(255,255,255));
- in = (state == NK_WIDGET_ROM || win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
- if (nk_do_button_text(&ctx->last_widget_state, &win->buffer, bounds,
- text, len, alignment, NK_BUTTON_DEFAULT, &style->contextual_button, in, style->font)) {
- nk_contextual_close(ctx);
- return nk_true;
+ /* draw alpha bar */
+ if (alpha_bar) {
+ float alpha = NK_SATURATE(col.a);
+ line_y = (float)(int)(alpha_bar->y + (1.0f - alpha) * matrix->h + 0.5f);
+
+ nk_fill_rect_multi_color(o, *alpha_bar, white, white, black, black);
+ nk_stroke_line(o, alpha_bar->x-1, line_y, alpha_bar->x + alpha_bar->w + 2,
+ line_y, 1, nk_rgb(255,255,255));
}
- return nk_false;
-}
-NK_API int nk_contextual_item_label(struct nk_context *ctx, const char *label, nk_flags align)
-{return nk_contextual_item_text(ctx, label, nk_strlen(label), align);}
+ /* draw color matrix */
+ temp = nk_hsv_f(hsva[0], 1.0f, 1.0f);
+ nk_fill_rect_multi_color(o, *matrix, white, temp, temp, white);
+ nk_fill_rect_multi_color(o, *matrix, black_trans, black_trans, black, black);
-NK_API int
-nk_contextual_item_image_text(struct nk_context *ctx, struct nk_image img,
- const char *text, int len, nk_flags align)
+ /* draw cross-hair */
+ {struct nk_vec2 p; float S = hsva[1]; float V = hsva[2];
+ p.x = (float)(int)(matrix->x + S * matrix->w);
+ p.y = (float)(int)(matrix->y + (1.0f - V) * matrix->h);
+ nk_stroke_line(o, p.x - crosshair_size, p.y, p.x-2, p.y, 1.0f, white);
+ nk_stroke_line(o, p.x + crosshair_size + 1, p.y, p.x+3, p.y, 1.0f, white);
+ nk_stroke_line(o, p.x, p.y + crosshair_size + 1, p.x, p.y+3, 1.0f, white);
+ nk_stroke_line(o, p.x, p.y - crosshair_size, p.x, p.y-2, 1.0f, white);}
+}
+NK_LIB int
+nk_do_color_picker(nk_flags *state,
+ struct nk_command_buffer *out, struct nk_colorf *col,
+ enum nk_color_format fmt, struct nk_rect bounds,
+ struct nk_vec2 padding, const struct nk_input *in,
+ const struct nk_user_font *font)
{
- struct nk_window *win;
- const struct nk_input *in;
- const struct nk_style *style;
+ int ret = 0;
+ struct nk_rect matrix;
+ struct nk_rect hue_bar;
+ struct nk_rect alpha_bar;
+ float bar_w;
- struct nk_rect bounds;
- enum nk_widget_layout_states state;
+ NK_ASSERT(out);
+ NK_ASSERT(col);
+ NK_ASSERT(state);
+ NK_ASSERT(font);
+ if (!out || !col || !state || !font)
+ return ret;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return 0;
+ bar_w = font->height;
+ bounds.x += padding.x;
+ bounds.y += padding.x;
+ bounds.w -= 2 * padding.x;
+ bounds.h -= 2 * padding.y;
- win = ctx->current;
- style = &ctx->style;
- state = nk_widget_fitting(&bounds, ctx, style->contextual_button.padding);
- if (!state) return nk_false;
+ matrix.x = bounds.x;
+ matrix.y = bounds.y;
+ matrix.h = bounds.h;
+ matrix.w = bounds.w - (3 * padding.x + 2 * bar_w);
- in = (state == NK_WIDGET_ROM || win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
- if (nk_do_button_text_image(&ctx->last_widget_state, &win->buffer, bounds,
- img, text, len, align, NK_BUTTON_DEFAULT, &style->contextual_button, style->font, in)){
- nk_contextual_close(ctx);
- return nk_true;
- }
- return nk_false;
-}
+ hue_bar.w = bar_w;
+ hue_bar.y = bounds.y;
+ hue_bar.h = matrix.h;
+ hue_bar.x = matrix.x + matrix.w + padding.x;
-NK_API int nk_contextual_item_image_label(struct nk_context *ctx, struct nk_image img,
- const char *label, nk_flags align)
-{return nk_contextual_item_image_text(ctx, img, label, nk_strlen(label), align);}
+ alpha_bar.x = hue_bar.x + hue_bar.w + padding.x;
+ alpha_bar.y = bounds.y;
+ alpha_bar.w = bar_w;
+ alpha_bar.h = matrix.h;
+ ret = nk_color_picker_behavior(state, &bounds, &matrix, &hue_bar,
+ (fmt == NK_RGBA) ? &alpha_bar:0, col, in);
+ nk_draw_color_picker(out, &matrix, &hue_bar, (fmt == NK_RGBA) ? &alpha_bar:0, *col);
+ return ret;
+}
NK_API int
-nk_contextual_item_symbol_text(struct nk_context *ctx, enum nk_symbol_type symbol,
- const char *text, int len, nk_flags align)
+nk_color_pick(struct nk_context * ctx, struct nk_colorf *color,
+ enum nk_color_format fmt)
{
struct nk_window *win;
+ struct nk_panel *layout;
+ const struct nk_style *config;
const struct nk_input *in;
- const struct nk_style *style;
- struct nk_rect bounds;
enum nk_widget_layout_states state;
+ struct nk_rect bounds;
NK_ASSERT(ctx);
+ NK_ASSERT(color);
NK_ASSERT(ctx->current);
NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
+ if (!ctx || !ctx->current || !ctx->current->layout || !color)
return 0;
win = ctx->current;
- style = &ctx->style;
- state = nk_widget_fitting(&bounds, ctx, style->contextual_button.padding);
- if (!state) return nk_false;
-
- in = (state == NK_WIDGET_ROM || win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
- if (nk_do_button_text_symbol(&ctx->last_widget_state, &win->buffer, bounds,
- symbol, text, len, align, NK_BUTTON_DEFAULT, &style->contextual_button, style->font, in)) {
- nk_contextual_close(ctx);
- return nk_true;
- }
- return nk_false;
+ config = &ctx->style;
+ layout = win->layout;
+ state = nk_widget(&bounds, ctx);
+ if (!state) return 0;
+ in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
+ return nk_do_color_picker(&ctx->last_widget_state, &win->buffer, color, fmt, bounds,
+ nk_vec2(0,0), in, config->font);
}
-
-NK_API int nk_contextual_item_symbol_label(struct nk_context *ctx, enum nk_symbol_type symbol,
- const char *text, nk_flags align)
-{return nk_contextual_item_symbol_text(ctx, symbol, text, nk_strlen(text), align);}
-
-NK_API void
-nk_contextual_close(struct nk_context *ctx)
+NK_API struct nk_colorf
+nk_color_picker(struct nk_context *ctx, struct nk_colorf color,
+ enum nk_color_format fmt)
{
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout) return;
- nk_popup_close(ctx);
+ nk_color_pick(ctx, &color, fmt);
+ return color;
}
-NK_API void
-nk_contextual_end(struct nk_context *ctx)
-{
- struct nk_window *popup;
- struct nk_panel *panel;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current) return;
- popup = ctx->current;
- panel = popup->layout;
- NK_ASSERT(popup->parent);
- NK_ASSERT(panel->type & NK_PANEL_SET_POPUP);
- if (panel->flags & NK_WINDOW_DYNAMIC) {
- /* Close behavior
- This is a bit of a hack solution since we do not know before we end our popup
- how big it will be. We therefore do not directly know when a
- click outside the non-blocking popup must close it at that direct frame.
- Instead it will be closed in the next frame.*/
- struct nk_rect body = {0,0,0,0};
- if (panel->at_y < (panel->bounds.y + panel->bounds.h)) {
- struct nk_vec2 padding = nk_panel_get_padding(&ctx->style, panel->type);
- body = panel->bounds;
- body.y = (panel->at_y + panel->footer_height + panel->border + padding.y + panel->row.height);
- body.h = (panel->bounds.y + panel->bounds.h) - body.y;
- }
- {int pressed = nk_input_is_mouse_pressed(&ctx->input, NK_BUTTON_LEFT);
- int in_body = nk_input_is_mouse_hovering_rect(&ctx->input, body);
- if (pressed && in_body)
- popup->flags |= NK_WINDOW_HIDDEN;
- }
- }
- if (popup->flags & NK_WINDOW_HIDDEN)
- popup->seq = 0;
- nk_popup_end(ctx);
- return;
-}
-/* -------------------------------------------------------------
+
+
+
+/* ==============================================================
*
* COMBO
*
- * --------------------------------------------------------------*/
+ * ===============================================================*/
NK_INTERN int
nk_combo_begin(struct nk_context *ctx, struct nk_window *win,
struct nk_vec2 size, int is_clicked, struct nk_rect header)
@@ -22671,7 +24588,6 @@ nk_combo_begin(struct nk_context *ctx, struct nk_window *win,
win->popup.name = hash;
return 1;
}
-
NK_API int
nk_combo_begin_text(struct nk_context *ctx, const char *selected, int len,
struct nk_vec2 size)
@@ -22761,10 +24677,11 @@ nk_combo_begin_text(struct nk_context *ctx, const char *selected, int len,
}
return nk_combo_begin(ctx, win, size, is_clicked, header);
}
-
-NK_API int nk_combo_begin_label(struct nk_context *ctx, const char *selected, struct nk_vec2 size)
-{return nk_combo_begin_text(ctx, selected, nk_strlen(selected), size);}
-
+NK_API int
+nk_combo_begin_label(struct nk_context *ctx, const char *selected, struct nk_vec2 size)
+{
+ return nk_combo_begin_text(ctx, selected, nk_strlen(selected), size);
+}
NK_API int
nk_combo_begin_color(struct nk_context *ctx, struct nk_color color, struct nk_vec2 size)
{
@@ -22842,7 +24759,6 @@ nk_combo_begin_color(struct nk_context *ctx, struct nk_color color, struct nk_ve
}
return nk_combo_begin(ctx, win, size, is_clicked, header);
}
-
NK_API int
nk_combo_begin_symbol(struct nk_context *ctx, enum nk_symbol_type symbol, struct nk_vec2 size)
{
@@ -22930,7 +24846,6 @@ nk_combo_begin_symbol(struct nk_context *ctx, enum nk_symbol_type symbol, struct
}
return nk_combo_begin(ctx, win, size, is_clicked, header);
}
-
NK_API int
nk_combo_begin_symbol_text(struct nk_context *ctx, const char *selected, int len,
enum nk_symbol_type symbol, struct nk_vec2 size)
@@ -23027,7 +24942,6 @@ nk_combo_begin_symbol_text(struct nk_context *ctx, const char *selected, int len
}
return nk_combo_begin(ctx, win, size, is_clicked, header);
}
-
NK_API int
nk_combo_begin_image(struct nk_context *ctx, struct nk_image img, struct nk_vec2 size)
{
@@ -23105,7 +25019,6 @@ nk_combo_begin_image(struct nk_context *ctx, struct nk_image img, struct nk_vec2
}
return nk_combo_begin(ctx, win, size, is_clicked, header);
}
-
NK_API int
nk_combo_begin_image_text(struct nk_context *ctx, const char *selected, int len,
struct nk_image img, struct nk_vec2 size)
@@ -23197,43 +25110,60 @@ nk_combo_begin_image_text(struct nk_context *ctx, const char *selected, int len,
}
return nk_combo_begin(ctx, win, size, is_clicked, header);
}
-
-NK_API int nk_combo_begin_symbol_label(struct nk_context *ctx,
+NK_API int
+nk_combo_begin_symbol_label(struct nk_context *ctx,
const char *selected, enum nk_symbol_type type, struct nk_vec2 size)
-{return nk_combo_begin_symbol_text(ctx, selected, nk_strlen(selected), type, size);}
-
-NK_API int nk_combo_begin_image_label(struct nk_context *ctx,
+{
+ return nk_combo_begin_symbol_text(ctx, selected, nk_strlen(selected), type, size);
+}
+NK_API int
+nk_combo_begin_image_label(struct nk_context *ctx,
const char *selected, struct nk_image img, struct nk_vec2 size)
-{return nk_combo_begin_image_text(ctx, selected, nk_strlen(selected), img, size);}
-
-NK_API int nk_combo_item_text(struct nk_context *ctx, const char *text, int len,nk_flags align)
-{return nk_contextual_item_text(ctx, text, len, align);}
-
-NK_API int nk_combo_item_label(struct nk_context *ctx, const char *label, nk_flags align)
-{return nk_contextual_item_label(ctx, label, align);}
-
-NK_API int nk_combo_item_image_text(struct nk_context *ctx, struct nk_image img, const char *text,
+{
+ return nk_combo_begin_image_text(ctx, selected, nk_strlen(selected), img, size);
+}
+NK_API int
+nk_combo_item_text(struct nk_context *ctx, const char *text, int len,nk_flags align)
+{
+ return nk_contextual_item_text(ctx, text, len, align);
+}
+NK_API int
+nk_combo_item_label(struct nk_context *ctx, const char *label, nk_flags align)
+{
+ return nk_contextual_item_label(ctx, label, align);
+}
+NK_API int
+nk_combo_item_image_text(struct nk_context *ctx, struct nk_image img, const char *text,
int len, nk_flags alignment)
-{return nk_contextual_item_image_text(ctx, img, text, len, alignment);}
-
-NK_API int nk_combo_item_image_label(struct nk_context *ctx, struct nk_image img,
+{
+ return nk_contextual_item_image_text(ctx, img, text, len, alignment);
+}
+NK_API int
+nk_combo_item_image_label(struct nk_context *ctx, struct nk_image img,
const char *text, nk_flags alignment)
-{return nk_contextual_item_image_label(ctx, img, text, alignment);}
-
-NK_API int nk_combo_item_symbol_text(struct nk_context *ctx, enum nk_symbol_type sym,
+{
+ return nk_contextual_item_image_label(ctx, img, text, alignment);
+}
+NK_API int
+nk_combo_item_symbol_text(struct nk_context *ctx, enum nk_symbol_type sym,
const char *text, int len, nk_flags alignment)
-{return nk_contextual_item_symbol_text(ctx, sym, text, len, alignment);}
-
-NK_API int nk_combo_item_symbol_label(struct nk_context *ctx, enum nk_symbol_type sym,
+{
+ return nk_contextual_item_symbol_text(ctx, sym, text, len, alignment);
+}
+NK_API int
+nk_combo_item_symbol_label(struct nk_context *ctx, enum nk_symbol_type sym,
const char *label, nk_flags alignment)
-{return nk_contextual_item_symbol_label(ctx, sym, label, alignment);}
-
+{
+ return nk_contextual_item_symbol_label(ctx, sym, label, alignment);
+}
NK_API void nk_combo_end(struct nk_context *ctx)
-{nk_contextual_end(ctx);}
-
+{
+ nk_contextual_end(ctx);
+}
NK_API void nk_combo_close(struct nk_context *ctx)
-{nk_contextual_close(ctx);}
-
+{
+ nk_contextual_close(ctx);
+}
NK_API int
nk_combo(struct nk_context *ctx, const char **items, int count,
int selected, int item_height, struct nk_vec2 size)
@@ -23264,7 +25194,6 @@ nk_combo(struct nk_context *ctx, const char **items, int count,
}
return selected;
}
-
NK_API int
nk_combo_separator(struct nk_context *ctx, const char *items_separated_by_separator,
int separator, int selected, int count, int item_height, struct nk_vec2 size)
@@ -23314,12 +25243,12 @@ nk_combo_separator(struct nk_context *ctx, const char *items_separated_by_separa
}
return selected;
}
-
NK_API int
nk_combo_string(struct nk_context *ctx, const char *items_separated_by_zeros,
int selected, int count, int item_height, struct nk_vec2 size)
-{return nk_combo_separator(ctx, items_separated_by_zeros, '\0', selected, count, item_height, size);}
-
+{
+ return nk_combo_separator(ctx, items_separated_by_zeros, '\0', selected, count, item_height, size);
+}
NK_API int
nk_combo_callback(struct nk_context *ctx, void(*item_getter)(void*, int, const char**),
void *userdata, int selected, int count, int item_height, struct nk_vec2 size)
@@ -23351,78 +25280,52 @@ nk_combo_callback(struct nk_context *ctx, void(*item_getter)(void*, int, const c
selected = i;
}
nk_combo_end(ctx);
- }
- return selected;
+ } return selected;
}
-
-NK_API void nk_combobox(struct nk_context *ctx, const char **items, int count,
+NK_API void
+nk_combobox(struct nk_context *ctx, const char **items, int count,
int *selected, int item_height, struct nk_vec2 size)
-{*selected = nk_combo(ctx, items, count, *selected, item_height, size);}
-
-NK_API void nk_combobox_string(struct nk_context *ctx, const char *items_separated_by_zeros,
+{
+ *selected = nk_combo(ctx, items, count, *selected, item_height, size);
+}
+NK_API void
+nk_combobox_string(struct nk_context *ctx, const char *items_separated_by_zeros,
int *selected, int count, int item_height, struct nk_vec2 size)
-{*selected = nk_combo_string(ctx, items_separated_by_zeros, *selected, count, item_height, size);}
-
-NK_API void nk_combobox_separator(struct nk_context *ctx, const char *items_separated_by_separator,
+{
+ *selected = nk_combo_string(ctx, items_separated_by_zeros, *selected, count, item_height, size);
+}
+NK_API void
+nk_combobox_separator(struct nk_context *ctx, const char *items_separated_by_separator,
int separator,int *selected, int count, int item_height, struct nk_vec2 size)
-{*selected = nk_combo_separator(ctx, items_separated_by_separator, separator,
- *selected, count, item_height, size);}
-
-NK_API void nk_combobox_callback(struct nk_context *ctx,
+{
+ *selected = nk_combo_separator(ctx, items_separated_by_separator, separator,
+ *selected, count, item_height, size);
+}
+NK_API void
+nk_combobox_callback(struct nk_context *ctx,
void(*item_getter)(void* data, int id, const char **out_text),
void *userdata, int *selected, int count, int item_height, struct nk_vec2 size)
-{*selected = nk_combo_callback(ctx, item_getter, userdata, *selected, count, item_height, size);}
-
-/*
- * -------------------------------------------------------------
- *
- * MENU
- *
- * --------------------------------------------------------------
- */
-NK_INTERN int
-nk_menu_begin(struct nk_context *ctx, struct nk_window *win,
- const char *id, int is_clicked, struct nk_rect header, struct nk_vec2 size)
{
- int is_open = 0;
- int is_active = 0;
- struct nk_rect body;
- struct nk_window *popup;
- nk_hash hash = nk_murmur_hash(id, (int)nk_strlen(id), NK_PANEL_MENU);
+ *selected = nk_combo_callback(ctx, item_getter, userdata, *selected, count, item_height, size);
+}
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return 0;
- body.x = header.x;
- body.w = size.x;
- body.y = header.y + header.h;
- body.h = size.y;
- popup = win->popup.win;
- is_open = popup ? nk_true : nk_false;
- is_active = (popup && (win->popup.name == hash) && win->popup.type == NK_PANEL_MENU);
- if ((is_clicked && is_open && !is_active) || (is_open && !is_active) ||
- (!is_open && !is_active && !is_clicked)) return 0;
- if (!nk_nonblock_begin(ctx, NK_WINDOW_NO_SCROLLBAR, body, header, NK_PANEL_MENU))
- return 0;
- win->popup.type = NK_PANEL_MENU;
- win->popup.name = hash;
- return 1;
-}
+/* ===============================================================
+ *
+ * TOOLTIP
+ *
+ * ===============================================================*/
NK_API int
-nk_menu_begin_text(struct nk_context *ctx, const char *title, int len,
- nk_flags align, struct nk_vec2 size)
+nk_tooltip_begin(struct nk_context *ctx, float width)
{
+ int x,y,w,h;
struct nk_window *win;
const struct nk_input *in;
- struct nk_rect header;
- int is_clicked = nk_false;
- nk_flags state;
+ struct nk_rect bounds;
+ int ret;
NK_ASSERT(ctx);
NK_ASSERT(ctx->current);
@@ -23430,161 +25333,451 @@ nk_menu_begin_text(struct nk_context *ctx, const char *title, int len,
if (!ctx || !ctx->current || !ctx->current->layout)
return 0;
+ /* make sure that no nonblocking popup is currently active */
win = ctx->current;
- state = nk_widget(&header, ctx);
- if (!state) return 0;
- in = (state == NK_WIDGET_ROM || win->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
- if (nk_do_button_text(&ctx->last_widget_state, &win->buffer, header,
- title, len, align, NK_BUTTON_DEFAULT, &ctx->style.menu_button, in, ctx->style.font))
- is_clicked = nk_true;
- return nk_menu_begin(ctx, win, title, is_clicked, header, size);
-}
-
-NK_API int nk_menu_begin_label(struct nk_context *ctx,
- const char *text, nk_flags align, struct nk_vec2 size)
-{return nk_menu_begin_text(ctx, text, nk_strlen(text), align, size);}
+ in = &ctx->input;
+ if (win->popup.win && (win->popup.type & NK_PANEL_SET_NONBLOCK))
+ return 0;
-NK_API int
-nk_menu_begin_image(struct nk_context *ctx, const char *id, struct nk_image img,
- struct nk_vec2 size)
-{
- struct nk_window *win;
- struct nk_rect header;
- const struct nk_input *in;
- int is_clicked = nk_false;
- nk_flags state;
+ w = nk_iceilf(width);
+ h = nk_iceilf(nk_null_rect.h);
+ x = nk_ifloorf(in->mouse.pos.x + 1) - (int)win->layout->clip.x;
+ y = nk_ifloorf(in->mouse.pos.y + 1) - (int)win->layout->clip.y;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return 0;
+ bounds.x = (float)x;
+ bounds.y = (float)y;
+ bounds.w = (float)w;
+ bounds.h = (float)h;
- win = ctx->current;
- state = nk_widget(&header, ctx);
- if (!state) return 0;
- in = (state == NK_WIDGET_ROM || win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
- if (nk_do_button_image(&ctx->last_widget_state, &win->buffer, header,
- img, NK_BUTTON_DEFAULT, &ctx->style.menu_button, in))
- is_clicked = nk_true;
- return nk_menu_begin(ctx, win, id, is_clicked, header, size);
+ ret = nk_popup_begin(ctx, NK_POPUP_DYNAMIC,
+ "__##Tooltip##__", NK_WINDOW_NO_SCROLLBAR|NK_WINDOW_BORDER, bounds);
+ if (ret) win->layout->flags &= ~(nk_flags)NK_WINDOW_ROM;
+ win->popup.type = NK_PANEL_TOOLTIP;
+ ctx->current->layout->type = NK_PANEL_TOOLTIP;
+ return ret;
}
-NK_API int
-nk_menu_begin_symbol(struct nk_context *ctx, const char *id,
- enum nk_symbol_type sym, struct nk_vec2 size)
+NK_API void
+nk_tooltip_end(struct nk_context *ctx)
{
- struct nk_window *win;
- const struct nk_input *in;
- struct nk_rect header;
- int is_clicked = nk_false;
- nk_flags state;
-
NK_ASSERT(ctx);
NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return 0;
-
- win = ctx->current;
- state = nk_widget(&header, ctx);
- if (!state) return 0;
- in = (state == NK_WIDGET_ROM || win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
- if (nk_do_button_symbol(&ctx->last_widget_state, &win->buffer, header,
- sym, NK_BUTTON_DEFAULT, &ctx->style.menu_button, in, ctx->style.font))
- is_clicked = nk_true;
- return nk_menu_begin(ctx, win, id, is_clicked, header, size);
+ if (!ctx || !ctx->current) return;
+ ctx->current->seq--;
+ nk_popup_close(ctx);
+ nk_popup_end(ctx);
}
-
-NK_API int
-nk_menu_begin_image_text(struct nk_context *ctx, const char *title, int len,
- nk_flags align, struct nk_image img, struct nk_vec2 size)
+NK_API void
+nk_tooltip(struct nk_context *ctx, const char *text)
{
- struct nk_window *win;
- struct nk_rect header;
- const struct nk_input *in;
- int is_clicked = nk_false;
- nk_flags state;
+ const struct nk_style *style;
+ struct nk_vec2 padding;
+
+ int text_len;
+ float text_width;
+ float text_height;
NK_ASSERT(ctx);
NK_ASSERT(ctx->current);
NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return 0;
+ NK_ASSERT(text);
+ if (!ctx || !ctx->current || !ctx->current->layout || !text)
+ return;
- win = ctx->current;
- state = nk_widget(&header, ctx);
- if (!state) return 0;
- in = (state == NK_WIDGET_ROM || win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
- if (nk_do_button_text_image(&ctx->last_widget_state, &win->buffer,
- header, img, title, len, align, NK_BUTTON_DEFAULT, &ctx->style.menu_button,
- ctx->style.font, in))
- is_clicked = nk_true;
- return nk_menu_begin(ctx, win, title, is_clicked, header, size);
-}
+ /* fetch configuration data */
+ style = &ctx->style;
+ padding = style->window.padding;
-NK_API int nk_menu_begin_image_label(struct nk_context *ctx,
- const char *title, nk_flags align, struct nk_image img, struct nk_vec2 size)
-{return nk_menu_begin_image_text(ctx, title, nk_strlen(title), align, img, size);}
+ /* calculate size of the text and tooltip */
+ text_len = nk_strlen(text);
+ text_width = style->font->width(style->font->userdata,
+ style->font->height, text, text_len);
+ text_width += (4 * padding.x);
+ text_height = (style->font->height + 2 * padding.y);
-NK_API int
-nk_menu_begin_symbol_text(struct nk_context *ctx, const char *title, int len,
- nk_flags align, enum nk_symbol_type sym, struct nk_vec2 size)
+ /* execute tooltip and fill with text */
+ if (nk_tooltip_begin(ctx, (float)text_width)) {
+ nk_layout_row_dynamic(ctx, (float)text_height, 1);
+ nk_text(ctx, text, text_len, NK_TEXT_LEFT);
+ nk_tooltip_end(ctx);
+ }
+}
+#ifdef NK_INCLUDE_STANDARD_VARARGS
+NK_API void
+nk_tooltipf(struct nk_context *ctx, const char *fmt, ...)
{
- struct nk_window *win;
- struct nk_rect header;
- const struct nk_input *in;
- int is_clicked = nk_false;
- nk_flags state;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return 0;
-
- win = ctx->current;
- state = nk_widget(&header, ctx);
- if (!state) return 0;
-
- in = (state == NK_WIDGET_ROM || win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
- if (nk_do_button_text_symbol(&ctx->last_widget_state, &win->buffer,
- header, sym, title, len, align, NK_BUTTON_DEFAULT, &ctx->style.menu_button,
- ctx->style.font, in)) is_clicked = nk_true;
- return nk_menu_begin(ctx, win, title, is_clicked, header, size);
+ va_list args;
+ va_start(args, fmt);
+ nk_tooltipfv(ctx, fmt, args);
+ va_end(args);
}
+NK_API void
+nk_tooltipfv(struct nk_context *ctx, const char *fmt, va_list args)
+{
+ char buf[256];
+ nk_strfmt(buf, NK_LEN(buf), fmt, args);
+ nk_tooltip(ctx, buf);
+}
+#endif
-NK_API int nk_menu_begin_symbol_label(struct nk_context *ctx,
- const char *title, nk_flags align, enum nk_symbol_type sym, struct nk_vec2 size )
-{return nk_menu_begin_symbol_text(ctx, title, nk_strlen(title), align,sym,size);}
-
-NK_API int nk_menu_item_text(struct nk_context *ctx, const char *title, int len, nk_flags align)
-{return nk_contextual_item_text(ctx, title, len, align);}
-
-NK_API int nk_menu_item_label(struct nk_context *ctx, const char *label, nk_flags align)
-{return nk_contextual_item_label(ctx, label, align);}
-
-NK_API int nk_menu_item_image_label(struct nk_context *ctx, struct nk_image img,
- const char *label, nk_flags align)
-{return nk_contextual_item_image_label(ctx, img, label, align);}
-
-NK_API int nk_menu_item_image_text(struct nk_context *ctx, struct nk_image img,
- const char *text, int len, nk_flags align)
-{return nk_contextual_item_image_text(ctx, img, text, len, align);}
-
-NK_API int nk_menu_item_symbol_text(struct nk_context *ctx, enum nk_symbol_type sym,
- const char *text, int len, nk_flags align)
-{return nk_contextual_item_symbol_text(ctx, sym, text, len, align);}
-NK_API int nk_menu_item_symbol_label(struct nk_context *ctx, enum nk_symbol_type sym,
- const char *label, nk_flags align)
-{return nk_contextual_item_symbol_label(ctx, sym, label, align);}
-NK_API void nk_menu_close(struct nk_context *ctx)
-{nk_contextual_close(ctx);}
+#endif /* NK_IMPLEMENTATION */
-NK_API void
-nk_menu_end(struct nk_context *ctx)
-{nk_contextual_end(ctx);}
+/*
+/// ## License
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~none
+/// ------------------------------------------------------------------------------
+/// This software is available under 2 licenses -- choose whichever you prefer.
+/// ------------------------------------------------------------------------------
+/// ALTERNATIVE A - MIT License
+/// Copyright (c) 2016-2018 Micha Mettke
+/// Permission is hereby granted, free of charge, to any person obtaining a copy of
+/// this software and associated documentation files (the "Software"), to deal in
+/// the Software without restriction, including without limitation the rights to
+/// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+/// of the Software, and to permit persons to whom the Software is furnished to do
+/// so, subject to the following conditions:
+/// The above copyright notice and this permission notice shall be included in all
+/// copies or substantial portions of the Software.
+/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+/// SOFTWARE.
+/// ------------------------------------------------------------------------------
+/// ALTERNATIVE B - Public Domain (www.unlicense.org)
+/// This is free and unencumbered software released into the public domain.
+/// Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
+/// software, either in source code form or as a compiled binary, for any purpose,
+/// commercial or non-commercial, and by any means.
+/// In jurisdictions that recognize copyright laws, the author or authors of this
+/// software dedicate any and all copyright interest in the software to the public
+/// domain. We make this dedication for the benefit of the public at large and to
+/// the detriment of our heirs and successors. We intend this dedication to be an
+/// overt act of relinquishment in perpetuity of all present and future rights to
+/// this software under copyright law.
+/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+/// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+/// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+/// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+/// ------------------------------------------------------------------------------
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+/// ## Changelog
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~none
+/// [date][x.yy.zz]-[description]
+/// -[date]: date on which the change has been pushed
+/// -[x.yy.zz]: Numerical version string representation. Each version number on the right
+/// resets back to zero if version on the left is incremented.
+/// - [x]: Major version with API and library breaking changes
+/// - [yy]: Minor version with non-breaking API and library changes
+/// - [zz]: Bug fix version with no direct changes to API
+///
+/// - 2019/09/20 (4.01.3) - Fixed a bug wherein combobox cannot be closed by clicking the header
+/// when NK_BUTTON_TRIGGER_ON_RELEASE is defined.
+/// - 2019/09/10 (4.01.2) - Fixed the nk_cos function, which deviated significantly.
+/// - 2019/09/08 (4.01.1) - Fixed a bug wherein re-baking of fonts caused a segmentation
+/// fault due to dst_font->glyph_count not being zeroed on subsequent
+/// bakes of the same set of fonts.
+/// - 2019/06/23 (4.01.0) - Added nk_***_get_scroll and nk_***_set_scroll for groups, windows, and popups.
+/// - 2019/06/12 (4.00.3) - Fix panel background drawing bug.
+/// - 2018/10/31 (4.00.2) - Added NK_KEYSTATE_BASED_INPUT to "fix" state based backends
+/// like GLFW without breaking key repeat behavior on event based.
+/// - 2018/04/01 (4.00.1) - Fixed calling `nk_convert` multiple time per single frame.
+/// - 2018/04/01 (4.00.0) - BREAKING CHANGE: nk_draw_list_clear no longer tries to
+/// clear provided buffers. So make sure to either free
+/// or clear each passed buffer after calling nk_convert.
+/// - 2018/02/23 (3.00.6) - Fixed slider dragging behavior.
+/// - 2018/01/31 (3.00.5) - Fixed overcalculation of cursor data in font baking process.
+/// - 2018/01/31 (3.00.4) - Removed name collision with stb_truetype.
+/// - 2018/01/28 (3.00.3) - Fixed panel window border drawing bug.
+/// - 2018/01/12 (3.00.2) - Added `nk_group_begin_titled` for separed group identifier and title.
+/// - 2018/01/07 (3.00.1) - Started to change documentation style.
+/// - 2018/01/05 (3.00.0) - BREAKING CHANGE: The previous color picker API was broken
+/// because of conversions between float and byte color representation.
+/// Color pickers now use floating point values to represent
+/// HSV values. To get back the old behavior I added some additional
+/// color conversion functions to cast between nk_color and
+/// nk_colorf.
+/// - 2017/12/23 (2.00.7) - Fixed small warning.
+/// - 2017/12/23 (2.00.7) - Fixed `nk_edit_buffer` behavior if activated to allow input.
+/// - 2017/12/23 (2.00.7) - Fixed modifyable progressbar dragging visuals and input behavior.
+/// - 2017/12/04 (2.00.6) - Added formated string tooltip widget.
+/// - 2017/11/18 (2.00.5) - Fixed window becoming hidden with flag `NK_WINDOW_NO_INPUT`.
+/// - 2017/11/15 (2.00.4) - Fixed font merging.
+/// - 2017/11/07 (2.00.3) - Fixed window size and position modifier functions.
+/// - 2017/09/14 (2.00.2) - Fixed `nk_edit_buffer` and `nk_edit_focus` behavior.
+/// - 2017/09/14 (2.00.1) - Fixed window closing behavior.
+/// - 2017/09/14 (2.00.0) - BREAKING CHANGE: Modifing window position and size funtions now
+/// require the name of the window and must happen outside the window
+/// building process (between function call nk_begin and nk_end).
+/// - 2017/09/11 (1.40.9) - Fixed window background flag if background window is declared last.
+/// - 2017/08/27 (1.40.8) - Fixed `nk_item_is_any_active` for hidden windows.
+/// - 2017/08/27 (1.40.7) - Fixed window background flag.
+/// - 2017/07/07 (1.40.6) - Fixed missing clipping rect check for hovering/clicked
+/// query for widgets.
+/// - 2017/07/07 (1.40.5) - Fixed drawing bug for vertex output for lines and stroked
+/// and filled rectangles.
+/// - 2017/07/07 (1.40.4) - Fixed bug in nk_convert trying to add windows that are in
+/// process of being destroyed.
+/// - 2017/07/07 (1.40.3) - Fixed table internal bug caused by storing table size in
+/// window instead of directly in table.
+/// - 2017/06/30 (1.40.2) - Removed unneeded semicolon in C++ NK_ALIGNOF macro.
+/// - 2017/06/30 (1.40.1) - Fixed drawing lines smaller or equal zero.
+/// - 2017/06/08 (1.40.0) - Removed the breaking part of last commit. Auto layout now only
+/// comes in effect if you pass in zero was row height argument.
+/// - 2017/06/08 (1.40.0) - BREAKING CHANGE: while not directly API breaking it will change
+/// how layouting works. From now there will be an internal minimum
+/// row height derived from font height. If you need a row smaller than
+/// that you can directly set it by `nk_layout_set_min_row_height` and
+/// reset the value back by calling `nk_layout_reset_min_row_height.
+/// - 2017/06/08 (1.39.1) - Fixed property text edit handling bug caused by past `nk_widget` fix.
+/// - 2017/06/08 (1.39.0) - Added function to retrieve window space without calling a `nk_layout_xxx` function.
+/// - 2017/06/06 (1.38.5) - Fixed `nk_convert` return flag for command buffer.
+/// - 2017/05/23 (1.38.4) - Fixed activation behavior for widgets partially clipped.
+/// - 2017/05/10 (1.38.3) - Fixed wrong min window size mouse scaling over boundries.
+/// - 2017/05/09 (1.38.2) - Fixed vertical scrollbar drawing with not enough space.
+/// - 2017/05/09 (1.38.1) - Fixed scaler dragging behavior if window size hits minimum size.
+/// - 2017/05/06 (1.38.0) - Added platform double-click support.
+/// - 2017/04/20 (1.37.1) - Fixed key repeat found inside glfw demo backends.
+/// - 2017/04/20 (1.37.0) - Extended properties with selection and clipboard support.
+/// - 2017/04/20 (1.36.2) - Fixed #405 overlapping rows with zero padding and spacing.
+/// - 2017/04/09 (1.36.1) - Fixed #403 with another widget float error.
+/// - 2017/04/09 (1.36.0) - Added window `NK_WINDOW_NO_INPUT` and `NK_WINDOW_NOT_INTERACTIVE` flags.
+/// - 2017/04/09 (1.35.3) - Fixed buffer heap corruption.
+/// - 2017/03/25 (1.35.2) - Fixed popup overlapping for `NK_WINDOW_BACKGROUND` windows.
+/// - 2017/03/25 (1.35.1) - Fixed windows closing behavior.
+/// - 2017/03/18 (1.35.0) - Added horizontal scroll requested in #377.
+/// - 2017/03/18 (1.34.3) - Fixed long window header titles.
+/// - 2017/03/04 (1.34.2) - Fixed text edit filtering.
+/// - 2017/03/04 (1.34.1) - Fixed group closable flag.
+/// - 2017/02/25 (1.34.0) - Added custom draw command for better language binding support.
+/// - 2017/01/24 (1.33.0) - Added programatic way of remove edit focus.
+/// - 2017/01/24 (1.32.3) - Fixed wrong define for basic type definitions for windows.
+/// - 2017/01/21 (1.32.2) - Fixed input capture from hidden or closed windows.
+/// - 2017/01/21 (1.32.1) - Fixed slider behavior and drawing.
+/// - 2017/01/13 (1.32.0) - Added flag to put scaler into the bottom left corner.
+/// - 2017/01/13 (1.31.0) - Added additional row layouting method to combine both
+/// dynamic and static widgets.
+/// - 2016/12/31 (1.30.0) - Extended scrollbar offset from 16-bit to 32-bit.
+/// - 2016/12/31 (1.29.2) - Fixed closing window bug of minimized windows.
+/// - 2016/12/03 (1.29.1) - Fixed wrapped text with no seperator and C89 error.
+/// - 2016/12/03 (1.29.0) - Changed text wrapping to process words not characters.
+/// - 2016/11/22 (1.28.6) - Fixed window minimized closing bug.
+/// - 2016/11/19 (1.28.5) - Fixed abstract combo box closing behavior.
+/// - 2016/11/19 (1.28.4) - Fixed tooltip flickering.
+/// - 2016/11/19 (1.28.3) - Fixed memory leak caused by popup repeated closing.
+/// - 2016/11/18 (1.28.2) - Fixed memory leak caused by popup panel allocation.
+/// - 2016/11/10 (1.28.1) - Fixed some warnings and C++ error.
+/// - 2016/11/10 (1.28.0) - Added additional `nk_button` versions which allows to directly
+/// pass in a style struct to change buttons visual.
+/// - 2016/11/10 (1.27.0) - Added additional `nk_tree` versions to support external state
+/// storage. Just like last the `nk_group` commit the main
+/// advantage is that you optionally can minimize nuklears runtime
+/// memory consumption or handle hash collisions.
+/// - 2016/11/09 (1.26.0) - Added additional `nk_group` version to support external scrollbar
+/// offset storage. Main advantage is that you can externalize
+/// the memory management for the offset. It could also be helpful
+/// if you have a hash collision in `nk_group_begin` but really
+/// want the name. In addition I added `nk_list_view` which allows
+/// to draw big lists inside a group without actually having to
+/// commit the whole list to nuklear (issue #269).
+/// - 2016/10/30 (1.25.1) - Fixed clipping rectangle bug inside `nk_draw_list`.
+/// - 2016/10/29 (1.25.0) - Pulled `nk_panel` memory management into nuklear and out of
+/// the hands of the user. From now on users don't have to care
+/// about panels unless they care about some information. If you
+/// still need the panel just call `nk_window_get_panel`.
+/// - 2016/10/21 (1.24.0) - Changed widget border drawing to stroked rectangle from filled
+/// rectangle for less overdraw and widget background transparency.
+/// - 2016/10/18 (1.23.0) - Added `nk_edit_focus` for manually edit widget focus control.
+/// - 2016/09/29 (1.22.7) - Fixed deduction of basic type in non `` compilation.
+/// - 2016/09/29 (1.22.6) - Fixed edit widget UTF-8 text cursor drawing bug.
+/// - 2016/09/28 (1.22.5) - Fixed edit widget UTF-8 text appending/inserting/removing.
+/// - 2016/09/28 (1.22.4) - Fixed drawing bug inside edit widgets which offset all text
+/// text in every edit widget if one of them is scrolled.
+/// - 2016/09/28 (1.22.3) - Fixed small bug in edit widgets if not active. The wrong
+/// text length is passed. It should have been in bytes but
+/// was passed as glyphes.
+/// - 2016/09/20 (1.22.2) - Fixed color button size calculation.
+/// - 2016/09/20 (1.22.1) - Fixed some `nk_vsnprintf` behavior bugs and removed ``
+/// again from `NK_INCLUDE_STANDARD_VARARGS`.
+/// - 2016/09/18 (1.22.0) - C89 does not support vsnprintf only C99 and newer as well
+/// as C++11 and newer. In addition to use vsnprintf you have
+/// to include . So just defining `NK_INCLUDE_STD_VAR_ARGS`
+/// is not enough. That behavior is now fixed. By default if
+/// both varargs as well as stdio is selected I try to use
+/// vsnprintf if not possible I will revert to vsprintf. If
+/// varargs but not stdio was defined I will use my own function.
+/// - 2016/09/15 (1.21.2) - Fixed panel `close` behavior for deeper panel levels.
+/// - 2016/09/15 (1.21.1) - Fixed C++ errors and wrong argument to `nk_panel_get_xxxx`.
+/// - 2016/09/13 (1.21.0) - !BREAKING! Fixed nonblocking popup behavior in menu, combo,
+/// and contextual which prevented closing in y-direction if
+/// popup did not reach max height.
+/// In addition the height parameter was changed into vec2
+/// for width and height to have more control over the popup size.
+/// - 2016/09/13 (1.20.3) - Cleaned up and extended type selection.
+/// - 2016/09/13 (1.20.2) - Fixed slider behavior hopefully for the last time. This time
+/// all calculation are correct so no more hackery.
+/// - 2016/09/13 (1.20.1) - Internal change to divide window/panel flags into panel flags and types.
+/// Suprisinly spend years in C and still happened to confuse types
+/// with flags. Probably something to take note.
+/// - 2016/09/08 (1.20.0) - Added additional helper function to make it easier to just
+/// take the produced buffers from `nk_convert` and unplug the
+/// iteration process from `nk_context`. So now you can
+/// just use the vertex,element and command buffer + two pointer
+/// inside the command buffer retrieved by calls `nk__draw_begin`
+/// and `nk__draw_end` and macro `nk_draw_foreach_bounded`.
+/// - 2016/09/08 (1.19.0) - Added additional asserts to make sure every `nk_xxx_begin` call
+/// for windows, popups, combobox, menu and contextual is guarded by
+/// `if` condition and does not produce false drawing output.
+/// - 2016/09/08 (1.18.0) - Changed confusing name for `NK_SYMBOL_RECT_FILLED`, `NK_SYMBOL_RECT`
+/// to hopefully easier to understand `NK_SYMBOL_RECT_FILLED` and
+/// `NK_SYMBOL_RECT_OUTLINE`.
+/// - 2016/09/08 (1.17.0) - Changed confusing name for `NK_SYMBOL_CIRLCE_FILLED`, `NK_SYMBOL_CIRCLE`
+/// to hopefully easier to understand `NK_SYMBOL_CIRCLE_FILLED` and
+/// `NK_SYMBOL_CIRCLE_OUTLINE`.
+/// - 2016/09/08 (1.16.0) - Added additional checks to select correct types if `NK_INCLUDE_FIXED_TYPES`
+/// is not defined by supporting the biggest compiler GCC, clang and MSVC.
+/// - 2016/09/07 (1.15.3) - Fixed `NK_INCLUDE_COMMAND_USERDATA` define to not cause an error.
+/// - 2016/09/04 (1.15.2) - Fixed wrong combobox height calculation.
+/// - 2016/09/03 (1.15.1) - Fixed gaps inside combo boxes in OpenGL.
+/// - 2016/09/02 (1.15.0) - Changed nuklear to not have any default vertex layout and
+/// instead made it user provided. The range of types to convert
+/// to is quite limited at the moment, but I would be more than
+/// happy to accept PRs to add additional.
+/// - 2016/08/30 (1.14.2) - Removed unused variables.
+/// - 2016/08/30 (1.14.1) - Fixed C++ build errors.
+/// - 2016/08/30 (1.14.0) - Removed mouse dragging from SDL demo since it does not work correctly.
+/// - 2016/08/30 (1.13.4) - Tweaked some default styling variables.
+/// - 2016/08/30 (1.13.3) - Hopefully fixed drawing bug in slider, in general I would
+/// refrain from using slider with a big number of steps.
+/// - 2016/08/30 (1.13.2) - Fixed close and minimize button which would fire even if the
+/// window was in Read Only Mode.
+/// - 2016/08/30 (1.13.1) - Fixed popup panel padding handling which was previously just
+/// a hack for combo box and menu.
+/// - 2016/08/30 (1.13.0) - Removed `NK_WINDOW_DYNAMIC` flag from public API since
+/// it is bugged and causes issues in window selection.
+/// - 2016/08/30 (1.12.0) - Removed scaler size. The size of the scaler is now
+/// determined by the scrollbar size.
+/// - 2016/08/30 (1.11.2) - Fixed some drawing bugs caused by changes from 1.11.0.
+/// - 2016/08/30 (1.11.1) - Fixed overlapping minimized window selection.
+/// - 2016/08/30 (1.11.0) - Removed some internal complexity and overly complex code
+/// handling panel padding and panel border.
+/// - 2016/08/29 (1.10.0) - Added additional height parameter to `nk_combobox_xxx`.
+/// - 2016/08/29 (1.10.0) - Fixed drawing bug in dynamic popups.
+/// - 2016/08/29 (1.10.0) - Added experimental mouse scrolling to popups, menus and comboboxes.
+/// - 2016/08/26 (1.10.0) - Added window name string prepresentation to account for
+/// hash collisions. Currently limited to `NK_WINDOW_MAX_NAME`
+/// which in term can be redefined if not big enough.
+/// - 2016/08/26 (1.10.0) - Added stacks for temporary style/UI changes in code.
+/// - 2016/08/25 (1.10.0) - Changed `nk_input_is_key_pressed` and 'nk_input_is_key_released'
+/// to account for key press and release happening in one frame.
+/// - 2016/08/25 (1.10.0) - Added additional nk_edit flag to directly jump to the end on activate.
+/// - 2016/08/17 (1.09.6) - Removed invalid check for value zero in `nk_propertyx`.
+/// - 2016/08/16 (1.09.5) - Fixed ROM mode for deeper levels of popup windows parents.
+/// - 2016/08/15 (1.09.4) - Editbox are now still active if enter was pressed with flag
+/// `NK_EDIT_SIG_ENTER`. Main reasoning is to be able to keep
+/// typing after commiting.
+/// - 2016/08/15 (1.09.4) - Removed redundant code.
+/// - 2016/08/15 (1.09.4) - Fixed negative numbers in `nk_strtoi` and remove unused variable.
+/// - 2016/08/15 (1.09.3) - Fixed `NK_WINDOW_BACKGROUND` flag behavior to select a background
+/// window only as selected by hovering and not by clicking.
+/// - 2016/08/14 (1.09.2) - Fixed a bug in font atlas which caused wrong loading
+/// of glyphes for font with multiple ranges.
+/// - 2016/08/12 (1.09.1) - Added additional function to check if window is currently
+/// hidden and therefore not visible.
+/// - 2016/08/12 (1.09.1) - nk_window_is_closed now queries the correct flag `NK_WINDOW_CLOSED`
+/// instead of the old flag `NK_WINDOW_HIDDEN`.
+/// - 2016/08/09 (1.09.0) - Added additional double version to nk_property and changed
+/// the underlying implementation to not cast to float and instead
+/// work directly on the given values.
+/// - 2016/08/09 (1.08.0) - Added additional define to overwrite library internal
+/// floating pointer number to string conversion for additional
+/// precision.
+/// - 2016/08/09 (1.08.0) - Added additional define to overwrite library internal
+/// string to floating point number conversion for additional
+/// precision.
+/// - 2016/08/08 (1.07.2) - Fixed compiling error without define `NK_INCLUDE_FIXED_TYPE`.
+/// - 2016/08/08 (1.07.1) - Fixed possible floating point error inside `nk_widget` leading
+/// to wrong wiget width calculation which results in widgets falsly
+/// becomming tagged as not inside window and cannot be accessed.
+/// - 2016/08/08 (1.07.0) - Nuklear now differentiates between hiding a window (NK_WINDOW_HIDDEN) and
+/// closing a window (NK_WINDOW_CLOSED). A window can be hidden/shown
+/// by using `nk_window_show` and closed by either clicking the close
+/// icon in a window or by calling `nk_window_close`. Only closed
+/// windows get removed at the end of the frame while hidden windows
+/// remain.
+/// - 2016/08/08 (1.06.0) - Added `nk_edit_string_zero_terminated` as a second option to
+/// `nk_edit_string` which takes, edits and outputs a '\0' terminated string.
+/// - 2016/08/08 (1.05.4) - Fixed scrollbar auto hiding behavior.
+/// - 2016/08/08 (1.05.3) - Fixed wrong panel padding selection in `nk_layout_widget_space`.
+/// - 2016/08/07 (1.05.2) - Fixed old bug in dynamic immediate mode layout API, calculating
+/// wrong item spacing and panel width.
+/// - 2016/08/07 (1.05.1) - Hopefully finally fixed combobox popup drawing bug.
+/// - 2016/08/07 (1.05.0) - Split varargs away from `NK_INCLUDE_STANDARD_IO` into own
+/// define `NK_INCLUDE_STANDARD_VARARGS` to allow more fine
+/// grained controlled over library includes.
+/// - 2016/08/06 (1.04.5) - Changed memset calls to `NK_MEMSET`.
+/// - 2016/08/04 (1.04.4) - Fixed fast window scaling behavior.
+/// - 2016/08/04 (1.04.3) - Fixed window scaling, movement bug which appears if you
+/// move/scale a window and another window is behind it.
+/// If you are fast enough then the window behind gets activated
+/// and the operation is blocked. I now require activating
+/// by hovering only if mouse is not pressed.
+/// - 2016/08/04 (1.04.2) - Fixed changing fonts.
+/// - 2016/08/03 (1.04.1) - Fixed `NK_WINDOW_BACKGROUND` behavior.
+/// - 2016/08/03 (1.04.0) - Added color parameter to `nk_draw_image`.
+/// - 2016/08/03 (1.04.0) - Added additional window padding style attributes for
+/// sub windows (combo, menu, ...).
+/// - 2016/08/03 (1.04.0) - Added functions to show/hide software cursor.
+/// - 2016/08/03 (1.04.0) - Added `NK_WINDOW_BACKGROUND` flag to force a window
+/// to be always in the background of the screen.
+/// - 2016/08/03 (1.03.2) - Removed invalid assert macro for NK_RGB color picker.
+/// - 2016/08/01 (1.03.1) - Added helper macros into header include guard.
+/// - 2016/07/29 (1.03.0) - Moved the window/table pool into the header part to
+/// simplify memory management by removing the need to
+/// allocate the pool.
+/// - 2016/07/29 (1.02.0) - Added auto scrollbar hiding window flag which if enabled
+/// will hide the window scrollbar after NK_SCROLLBAR_HIDING_TIMEOUT
+/// seconds without window interaction. To make it work
+/// you have to also set a delta time inside the `nk_context`.
+/// - 2016/07/25 (1.01.1) - Fixed small panel and panel border drawing bugs.
+/// - 2016/07/15 (1.01.0) - Added software cursor to `nk_style` and `nk_context`.
+/// - 2016/07/15 (1.01.0) - Added const correctness to `nk_buffer_push' data argument.
+/// - 2016/07/15 (1.01.0) - Removed internal font baking API and simplified
+/// font atlas memory management by converting pointer
+/// arrays for fonts and font configurations to lists.
+/// - 2016/07/15 (1.00.0) - Changed button API to use context dependend button
+/// behavior instead of passing it for every function call.
+/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+/// ## Gallery
+/// ![Figure [blue]: Feature overview with blue color styling](https://cloud.githubusercontent.com/assets/8057201/13538240/acd96876-e249-11e5-9547-5ac0b19667a0.png)
+/// ![Figure [red]: Feature overview with red color styling](https://cloud.githubusercontent.com/assets/8057201/13538243/b04acd4c-e249-11e5-8fd2-ad7744a5b446.png)
+/// ![Figure [widgets]: Widget overview](https://cloud.githubusercontent.com/assets/8057201/11282359/3325e3c6-8eff-11e5-86cb-cf02b0596087.png)
+/// ![Figure [blackwhite]: Black and white](https://cloud.githubusercontent.com/assets/8057201/11033668/59ab5d04-86e5-11e5-8091-c56f16411565.png)
+/// ![Figure [filexp]: File explorer](https://cloud.githubusercontent.com/assets/8057201/10718115/02a9ba08-7b6b-11e5-950f-adacdd637739.png)
+/// ![Figure [opengl]: OpenGL Editor](https://cloud.githubusercontent.com/assets/8057201/12779619/2a20d72c-ca69-11e5-95fe-4edecf820d5c.png)
+/// ![Figure [nodedit]: Node Editor](https://cloud.githubusercontent.com/assets/8057201/9976995/e81ac04a-5ef7-11e5-872b-acd54fbeee03.gif)
+/// ![Figure [skinning]: Using skinning in Nuklear](https://cloud.githubusercontent.com/assets/8057201/15991632/76494854-30b8-11e6-9555-a69840d0d50b.png)
+/// ![Figure [bf]: Heavy modified version](https://cloud.githubusercontent.com/assets/8057201/14902576/339926a8-0d9c-11e6-9fee-a8b73af04473.png)
+///
+/// ## Credits
+/// Developed by Micha Mettke and every direct or indirect github contributor.
+///
+/// Embeds [stb_texedit](https://github.com/nothings/stb/blob/master/stb_textedit.h), [stb_truetype](https://github.com/nothings/stb/blob/master/stb_truetype.h) and [stb_rectpack](https://github.com/nothings/stb/blob/master/stb_rect_pack.h) by Sean Barret (public domain)
+/// Uses [stddoc.c](https://github.com/r-lyeh/stddoc.c) from r-lyeh@github.com for documentation generation
+/// Embeds ProggyClean.ttf font by Tristan Grimmer (MIT license).
+///
+/// Big thank you to Omar Cornut (ocornut@github) for his [imgui library](https://github.com/ocornut/imgui) and
+/// giving me the inspiration for this library, Casey Muratori for handmade hero
+/// and his original immediate mode graphical user interface idea and Sean
+/// Barret for his amazing single header libraries which restored my faith
+/// in libraries and brought me to create some of my own. Finally Apoorva Joshi
+/// for his single header file packer.
+*/
-#endif
diff --git a/external/GLFW/deps/nuklear_glfw_gl2.h b/external/GLFW/deps/nuklear_glfw_gl2.h
index 965af5f..a959b14 100644
--- a/external/GLFW/deps/nuklear_glfw_gl2.h
+++ b/external/GLFW/deps/nuklear_glfw_gl2.h
@@ -75,6 +75,8 @@ static struct nk_glfw {
int text_len;
struct nk_vec2 scroll;
double last_button_click;
+ int is_double_click_down;
+ struct nk_vec2 double_click_pos;
} glfw;
NK_INTERN void
@@ -219,14 +221,16 @@ nk_glfw3_mouse_button_callback(GLFWwindow* window, int button, int action, int m
glfwGetCursorPos(window, &x, &y);
if (action == GLFW_PRESS) {
double dt = glfwGetTime() - glfw.last_button_click;
- if (dt > NK_GLFW_DOUBLE_CLICK_LO && dt < NK_GLFW_DOUBLE_CLICK_HI)
- nk_input_button(&glfw.ctx, NK_BUTTON_DOUBLE, (int)x, (int)y, nk_true);
+ if (dt > NK_GLFW_DOUBLE_CLICK_LO && dt < NK_GLFW_DOUBLE_CLICK_HI) {
+ glfw.is_double_click_down = nk_true;
+ glfw.double_click_pos = nk_vec2((float)x, (float)y);
+ }
glfw.last_button_click = glfwGetTime();
- } else nk_input_button(&glfw.ctx, NK_BUTTON_DOUBLE, (int)x, (int)y, nk_false);
+ } else glfw.is_double_click_down = nk_false;
}
NK_INTERN void
-nk_glfw3_clipbard_paste(nk_handle usr, struct nk_text_edit *edit)
+nk_glfw3_clipboard_paste(nk_handle usr, struct nk_text_edit *edit)
{
const char *text = glfwGetClipboardString(glfw.win);
if (text) nk_textedit_paste(edit, text, nk_strlen(text));
@@ -234,7 +238,7 @@ nk_glfw3_clipbard_paste(nk_handle usr, struct nk_text_edit *edit)
}
NK_INTERN void
-nk_glfw3_clipbard_copy(nk_handle usr, const char *text, int len)
+nk_glfw3_clipboard_copy(nk_handle usr, const char *text, int len)
{
char *str = 0;
(void)usr;
@@ -257,10 +261,14 @@ nk_glfw3_init(GLFWwindow *win, enum nk_glfw_init_state init_state)
glfwSetMouseButtonCallback(win, nk_glfw3_mouse_button_callback);
}
nk_init_default(&glfw.ctx, 0);
- glfw.ctx.clip.copy = nk_glfw3_clipbard_copy;
- glfw.ctx.clip.paste = nk_glfw3_clipbard_paste;
+ glfw.ctx.clip.copy = nk_glfw3_clipboard_copy;
+ glfw.ctx.clip.paste = nk_glfw3_clipboard_paste;
glfw.ctx.clip.userdata = nk_handle_ptr(0);
nk_buffer_init_default(&glfw.ogl.cmds);
+
+ glfw.is_double_click_down = nk_false;
+ glfw.double_click_pos = nk_vec2(0, 0);
+
return &glfw.ctx;
}
@@ -344,7 +352,7 @@ nk_glfw3_new_frame(void)
glfwGetCursorPos(win, &x, &y);
nk_input_motion(ctx, (int)x, (int)y);
if (ctx->input.mouse.grabbed) {
- glfwSetCursorPos(glfw.win, ctx->input.mouse.prev.x, ctx->input.mouse.prev.y);
+ glfwSetCursorPos(glfw.win, (double)ctx->input.mouse.prev.x, (double)ctx->input.mouse.prev.y);
ctx->input.mouse.pos.x = ctx->input.mouse.prev.x;
ctx->input.mouse.pos.y = ctx->input.mouse.prev.y;
}
@@ -352,6 +360,7 @@ nk_glfw3_new_frame(void)
nk_input_button(ctx, NK_BUTTON_LEFT, (int)x, (int)y, glfwGetMouseButton(win, GLFW_MOUSE_BUTTON_LEFT) == GLFW_PRESS);
nk_input_button(ctx, NK_BUTTON_MIDDLE, (int)x, (int)y, glfwGetMouseButton(win, GLFW_MOUSE_BUTTON_MIDDLE) == GLFW_PRESS);
nk_input_button(ctx, NK_BUTTON_RIGHT, (int)x, (int)y, glfwGetMouseButton(win, GLFW_MOUSE_BUTTON_RIGHT) == GLFW_PRESS);
+ nk_input_button(ctx, NK_BUTTON_DOUBLE, (int)glfw.double_click_pos.x, (int)glfw.double_click_pos.y, glfw.is_double_click_down);
nk_input_scroll(ctx, glfw.scroll);
nk_input_end(&glfw.ctx);
glfw.text_len = 0;
diff --git a/external/GLFW/deps/stb_image_write.h b/external/GLFW/deps/stb_image_write.h
index 4319c0d..e4b32ed 100644
--- a/external/GLFW/deps/stb_image_write.h
+++ b/external/GLFW/deps/stb_image_write.h
@@ -1,5 +1,5 @@
-/* stb_image_write - v1.02 - public domain - http://nothings.org/stb/stb_image_write.h
- writes out PNG/BMP/TGA images to C stdio - Sean Barrett 2010-2015
+/* stb_image_write - v1.16 - public domain - http://nothings.org/stb
+ writes out PNG/BMP/TGA/JPEG/HDR images to C stdio - Sean Barrett 2010-2015
no warranty implied; use at your own risk
Before #including,
@@ -12,41 +12,64 @@
ABOUT:
- This header file is a library for writing images to C stdio. It could be
- adapted to write to memory or a general streaming interface; let me know.
+ This header file is a library for writing images to C stdio or a callback.
The PNG output is not optimal; it is 20-50% larger than the file
- written by a decent optimizing implementation. This library is designed
- for source code compactness and simplicity, not optimal image file size
- or run-time performance.
+ written by a decent optimizing implementation; though providing a custom
+ zlib compress function (see STBIW_ZLIB_COMPRESS) can mitigate that.
+ This library is designed for source code compactness and simplicity,
+ not optimal image file size or run-time performance.
BUILDING:
You can #define STBIW_ASSERT(x) before the #include to avoid using assert.h.
You can #define STBIW_MALLOC(), STBIW_REALLOC(), and STBIW_FREE() to replace
malloc,realloc,free.
- You can define STBIW_MEMMOVE() to replace memmove()
+ You can #define STBIW_MEMMOVE() to replace memmove()
+ You can #define STBIW_ZLIB_COMPRESS to use a custom zlib-style compress function
+ for PNG compression (instead of the builtin one), it must have the following signature:
+ unsigned char * my_compress(unsigned char *data, int data_len, int *out_len, int quality);
+ The returned data will be freed with STBIW_FREE() (free() by default),
+ so it must be heap allocated with STBIW_MALLOC() (malloc() by default),
+
+UNICODE:
+
+ If compiling for Windows and you wish to use Unicode filenames, compile
+ with
+ #define STBIW_WINDOWS_UTF8
+ and pass utf8-encoded filenames. Call stbiw_convert_wchar_to_utf8 to convert
+ Windows wchar_t filenames to utf8.
USAGE:
- There are four functions, one for each image file format:
+ There are five functions, one for each image file format:
int stbi_write_png(char const *filename, int w, int h, int comp, const void *data, int stride_in_bytes);
int stbi_write_bmp(char const *filename, int w, int h, int comp, const void *data);
int stbi_write_tga(char const *filename, int w, int h, int comp, const void *data);
+ int stbi_write_jpg(char const *filename, int w, int h, int comp, const void *data, int quality);
int stbi_write_hdr(char const *filename, int w, int h, int comp, const float *data);
- There are also four equivalent functions that use an arbitrary write function. You are
+ void stbi_flip_vertically_on_write(int flag); // flag is non-zero to flip data vertically
+
+ There are also five equivalent functions that use an arbitrary write function. You are
expected to open/close your file-equivalent before and after calling these:
int stbi_write_png_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data, int stride_in_bytes);
int stbi_write_bmp_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data);
int stbi_write_tga_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data);
int stbi_write_hdr_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const float *data);
+ int stbi_write_jpg_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data, int quality);
where the callback is:
void stbi_write_func(void *context, void *data, int size);
+ You can configure it with these global variables:
+ int stbi_write_tga_with_rle; // defaults to true; set to 0 to disable RLE
+ int stbi_write_png_compression_level; // defaults to 8; set to higher for more compression
+ int stbi_write_force_png_filter; // defaults to -1; set to 0..5 to force a filter mode
+
+
You can define STBI_WRITE_NO_STDIO to disable the file variant of these
functions, so the library will not use stdio.h at all. However, this will
also disable HDR writing, because it requires stdio for formatted output.
@@ -73,6 +96,9 @@
writer, both because it is in BGR order and because it may have padding
at the end of the line.)
+ PNG allows you to set the deflate compression level by setting the global
+ variable 'stbi_write_png_compression_level' (it defaults to 8).
+
HDR expects linear float data. Since the format is always 32-bit rgb(e)
data, alpha (if provided) is discarded, and for monochrome data it is
replicated across all three channels.
@@ -80,20 +106,23 @@
TGA supports RLE or non-RLE compressed data. To use non-RLE-compressed
data, set the global variable 'stbi_write_tga_with_rle' to 0.
+ JPEG does ignore alpha channels in input data; quality is between 1 and 100.
+ Higher quality looks better but results in a bigger image.
+ JPEG baseline (no JPEG progressive).
+
CREDITS:
- PNG/BMP/TGA
- Sean Barrett
- HDR
- Baldur Karlsson
- TGA monochrome:
- Jean-Sebastien Guay
- misc enhancements:
- Tim Kelsey
- TGA RLE
- Alan Hickman
- initial file IO callback implementation
- Emmanuel Julien
+
+ Sean Barrett - PNG/BMP/TGA
+ Baldur Karlsson - HDR
+ Jean-Sebastien Guay - TGA monochrome
+ Tim Kelsey - misc enhancements
+ Alan Hickman - TGA RLE
+ Emmanuel Julien - initial file IO callback implementation
+ Jon Olick - original jo_jpeg.cpp code
+ Daniel Gibson - integrate JPEG, allow external zlib
+ Aarni Koskela - allow choosing PNG filter
+
bugfixes:
github:Chribba
Guillaume Chereau
@@ -103,27 +132,44 @@
Jonas Karlsson
Filip Wasil
Thatcher Ulrich
-
+ github:poppolopoppo
+ Patrick Boettcher
+ github:xeekworx
+ Cap Petschulat
+ Simon Rodriguez
+ Ivan Tikhonov
+ github:ignotion
+ Adam Schackart
+ Andrew Kensler
+
LICENSE
-This software is dual-licensed to the public domain and under the following
-license: you are granted a perpetual, irrevocable license to copy, modify,
-publish, and distribute this file as you see fit.
+ See end of file for license information.
*/
#ifndef INCLUDE_STB_IMAGE_WRITE_H
#define INCLUDE_STB_IMAGE_WRITE_H
-#ifdef __cplusplus
-extern "C" {
-#endif
+#include
+// if STB_IMAGE_WRITE_STATIC causes problems, try defining STBIWDEF to 'inline' or 'static inline'
+#ifndef STBIWDEF
#ifdef STB_IMAGE_WRITE_STATIC
-#define STBIWDEF static
+#define STBIWDEF static
+#else
+#ifdef __cplusplus
+#define STBIWDEF extern "C"
#else
-#define STBIWDEF extern
-extern int stbi_write_tga_with_rle;
+#define STBIWDEF extern
+#endif
+#endif
+#endif
+
+#ifndef STB_IMAGE_WRITE_STATIC // C++ forbids static forward declarations
+STBIWDEF int stbi_write_tga_with_rle;
+STBIWDEF int stbi_write_png_compression_level;
+STBIWDEF int stbi_write_force_png_filter;
#endif
#ifndef STBI_WRITE_NO_STDIO
@@ -131,6 +177,11 @@ STBIWDEF int stbi_write_png(char const *filename, int w, int h, int comp, const
STBIWDEF int stbi_write_bmp(char const *filename, int w, int h, int comp, const void *data);
STBIWDEF int stbi_write_tga(char const *filename, int w, int h, int comp, const void *data);
STBIWDEF int stbi_write_hdr(char const *filename, int w, int h, int comp, const float *data);
+STBIWDEF int stbi_write_jpg(char const *filename, int x, int y, int comp, const void *data, int quality);
+
+#ifdef STBIW_WINDOWS_UTF8
+STBIWDEF int stbiw_convert_wchar_to_utf8(char *buffer, size_t bufferlen, const wchar_t* input);
+#endif
#endif
typedef void stbi_write_func(void *context, void *data, int size);
@@ -139,10 +190,9 @@ STBIWDEF int stbi_write_png_to_func(stbi_write_func *func, void *context, int w,
STBIWDEF int stbi_write_bmp_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data);
STBIWDEF int stbi_write_tga_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data);
STBIWDEF int stbi_write_hdr_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const float *data);
+STBIWDEF int stbi_write_jpg_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data, int quality);
-#ifdef __cplusplus
-}
-#endif
+STBIWDEF void stbi_flip_vertically_on_write(int flip_boolean);
#endif//INCLUDE_STB_IMAGE_WRITE_H
@@ -197,10 +247,29 @@ STBIWDEF int stbi_write_hdr_to_func(stbi_write_func *func, void *context, int w,
#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
+#ifdef STB_IMAGE_WRITE_STATIC
+static int stbi_write_png_compression_level = 8;
+static int stbi_write_tga_with_rle = 1;
+static int stbi_write_force_png_filter = -1;
+#else
+int stbi_write_png_compression_level = 8;
+int stbi_write_tga_with_rle = 1;
+int stbi_write_force_png_filter = -1;
+#endif
+
+static int stbi__flip_vertically_on_write = 0;
+
+STBIWDEF void stbi_flip_vertically_on_write(int flag)
+{
+ stbi__flip_vertically_on_write = flag;
+}
+
typedef struct
{
stbi_write_func *func;
void *context;
+ unsigned char buffer[64];
+ int buf_used;
} stbi__write_context;
// initialize a callback-based context
@@ -217,9 +286,52 @@ static void stbi__stdio_write(void *context, void *data, int size)
fwrite(data,1,size,(FILE*) context);
}
+#if defined(_WIN32) && defined(STBIW_WINDOWS_UTF8)
+#ifdef __cplusplus
+#define STBIW_EXTERN extern "C"
+#else
+#define STBIW_EXTERN extern
+#endif
+STBIW_EXTERN __declspec(dllimport) int __stdcall MultiByteToWideChar(unsigned int cp, unsigned long flags, const char *str, int cbmb, wchar_t *widestr, int cchwide);
+STBIW_EXTERN __declspec(dllimport) int __stdcall WideCharToMultiByte(unsigned int cp, unsigned long flags, const wchar_t *widestr, int cchwide, char *str, int cbmb, const char *defchar, int *used_default);
+
+STBIWDEF int stbiw_convert_wchar_to_utf8(char *buffer, size_t bufferlen, const wchar_t* input)
+{
+ return WideCharToMultiByte(65001 /* UTF8 */, 0, input, -1, buffer, (int) bufferlen, NULL, NULL);
+}
+#endif
+
+static FILE *stbiw__fopen(char const *filename, char const *mode)
+{
+ FILE *f;
+#if defined(_WIN32) && defined(STBIW_WINDOWS_UTF8)
+ wchar_t wMode[64];
+ wchar_t wFilename[1024];
+ if (0 == MultiByteToWideChar(65001 /* UTF8 */, 0, filename, -1, wFilename, sizeof(wFilename)/sizeof(*wFilename)))
+ return 0;
+
+ if (0 == MultiByteToWideChar(65001 /* UTF8 */, 0, mode, -1, wMode, sizeof(wMode)/sizeof(*wMode)))
+ return 0;
+
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+ if (0 != _wfopen_s(&f, wFilename, wMode))
+ f = 0;
+#else
+ f = _wfopen(wFilename, wMode);
+#endif
+
+#elif defined(_MSC_VER) && _MSC_VER >= 1400
+ if (0 != fopen_s(&f, filename, mode))
+ f=0;
+#else
+ f = fopen(filename, mode);
+#endif
+ return f;
+}
+
static int stbi__start_write_file(stbi__write_context *s, const char *filename)
{
- FILE *f = fopen(filename, "wb");
+ FILE *f = stbiw__fopen(filename, "wb");
stbi__start_write_callbacks(s, stbi__stdio_write, (void *) f);
return f != NULL;
}
@@ -234,12 +346,6 @@ static void stbi__end_write_file(stbi__write_context *s)
typedef unsigned int stbiw_uint32;
typedef int stb_image_write_test[sizeof(stbiw_uint32)==4 ? 1 : -1];
-#ifdef STB_IMAGE_WRITE_STATIC
-static int stbi_write_tga_with_rle = 1;
-#else
-int stbi_write_tga_with_rle = 1;
-#endif
-
static void stbiw__writefv(stbi__write_context *s, const char *fmt, va_list v)
{
while (*fmt) {
@@ -277,11 +383,36 @@ static void stbiw__writef(stbi__write_context *s, const char *fmt, ...)
va_end(v);
}
+static void stbiw__write_flush(stbi__write_context *s)
+{
+ if (s->buf_used) {
+ s->func(s->context, &s->buffer, s->buf_used);
+ s->buf_used = 0;
+ }
+}
+
+static void stbiw__putc(stbi__write_context *s, unsigned char c)
+{
+ s->func(s->context, &c, 1);
+}
+
+static void stbiw__write1(stbi__write_context *s, unsigned char a)
+{
+ if ((size_t)s->buf_used + 1 > sizeof(s->buffer))
+ stbiw__write_flush(s);
+ s->buffer[s->buf_used++] = a;
+}
+
static void stbiw__write3(stbi__write_context *s, unsigned char a, unsigned char b, unsigned char c)
{
- unsigned char arr[3];
- arr[0] = a, arr[1] = b, arr[2] = c;
- s->func(s->context, arr, 3);
+ int n;
+ if ((size_t)s->buf_used + 3 > sizeof(s->buffer))
+ stbiw__write_flush(s);
+ n = s->buf_used;
+ s->buf_used = n+3;
+ s->buffer[n+0] = a;
+ s->buffer[n+1] = b;
+ s->buffer[n+2] = c;
}
static void stbiw__write_pixel(stbi__write_context *s, int rgb_dir, int comp, int write_alpha, int expand_mono, unsigned char *d)
@@ -290,17 +421,15 @@ static void stbiw__write_pixel(stbi__write_context *s, int rgb_dir, int comp, in
int k;
if (write_alpha < 0)
- s->func(s->context, &d[comp - 1], 1);
+ stbiw__write1(s, d[comp - 1]);
switch (comp) {
+ case 2: // 2 pixels = mono + alpha, alpha is written separately, so same as 1-channel case
case 1:
- s->func(s->context,d,1);
- break;
- case 2:
if (expand_mono)
stbiw__write3(s, d[0], d[0], d[0]); // monochrome bmp
else
- s->func(s->context, d, 1); // monochrome TGA
+ stbiw__write1(s, d[0]); // monochrome TGA
break;
case 4:
if (!write_alpha) {
@@ -316,7 +445,7 @@ static void stbiw__write_pixel(stbi__write_context *s, int rgb_dir, int comp, in
break;
}
if (write_alpha > 0)
- s->func(s->context, &d[comp - 1], 1);
+ stbiw__write1(s, d[comp - 1]);
}
static void stbiw__write_pixels(stbi__write_context *s, int rgb_dir, int vdir, int x, int y, int comp, void *data, int write_alpha, int scanline_pad, int expand_mono)
@@ -327,16 +456,21 @@ static void stbiw__write_pixels(stbi__write_context *s, int rgb_dir, int vdir, i
if (y <= 0)
return;
- if (vdir < 0)
- j_end = -1, j = y-1;
- else
- j_end = y, j = 0;
+ if (stbi__flip_vertically_on_write)
+ vdir *= -1;
+
+ if (vdir < 0) {
+ j_end = -1; j = y-1;
+ } else {
+ j_end = y; j = 0;
+ }
for (; j != j_end; j += vdir) {
for (i=0; i < x; ++i) {
unsigned char *d = (unsigned char *) data + (j*x+i)*comp;
stbiw__write_pixel(s, rgb_dir, comp, write_alpha, expand_mono, d);
}
+ stbiw__write_flush(s);
s->func(s->context, &zero, scanline_pad);
}
}
@@ -357,16 +491,27 @@ static int stbiw__outfile(stbi__write_context *s, int rgb_dir, int vdir, int x,
static int stbi_write_bmp_core(stbi__write_context *s, int x, int y, int comp, const void *data)
{
- int pad = (-x*3) & 3;
- return stbiw__outfile(s,-1,-1,x,y,comp,1,(void *) data,0,pad,
- "11 4 22 4" "4 44 22 444444",
- 'B', 'M', 14+40+(x*3+pad)*y, 0,0, 14+40, // file header
- 40, x,y, 1,24, 0,0,0,0,0,0); // bitmap header
+ if (comp != 4) {
+ // write RGB bitmap
+ int pad = (-x*3) & 3;
+ return stbiw__outfile(s,-1,-1,x,y,comp,1,(void *) data,0,pad,
+ "11 4 22 4" "4 44 22 444444",
+ 'B', 'M', 14+40+(x*3+pad)*y, 0,0, 14+40, // file header
+ 40, x,y, 1,24, 0,0,0,0,0,0); // bitmap header
+ } else {
+ // RGBA bitmaps need a v4 header
+ // use BI_BITFIELDS mode with 32bpp and alpha mask
+ // (straight BI_RGB with alpha mask doesn't work in most readers)
+ return stbiw__outfile(s,-1,-1,x,y,comp,1,(void *)data,1,0,
+ "11 4 22 4" "4 44 22 444444 4444 4 444 444 444 444",
+ 'B', 'M', 14+108+x*y*4, 0, 0, 14+108, // file header
+ 108, x,y, 1,32, 3,0,0,0,0,0, 0xff0000,0xff00,0xff,0xff000000u, 0, 0,0,0, 0,0,0, 0,0,0, 0,0,0); // bitmap V4 header
+ }
}
STBIWDEF int stbi_write_bmp_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data)
{
- stbi__write_context s;
+ stbi__write_context s = { 0 };
stbi__start_write_callbacks(&s, func, context);
return stbi_write_bmp_core(&s, x, y, comp, data);
}
@@ -374,7 +519,7 @@ STBIWDEF int stbi_write_bmp_to_func(stbi_write_func *func, void *context, int x,
#ifndef STBI_WRITE_NO_STDIO
STBIWDEF int stbi_write_bmp(char const *filename, int x, int y, int comp, const void *data)
{
- stbi__write_context s;
+ stbi__write_context s = { 0 };
if (stbi__start_write_file(&s,filename)) {
int r = stbi_write_bmp_core(&s, x, y, comp, data);
stbi__end_write_file(&s);
@@ -398,11 +543,21 @@ static int stbi_write_tga_core(stbi__write_context *s, int x, int y, int comp, v
"111 221 2222 11", 0, 0, format, 0, 0, 0, 0, 0, x, y, (colorbytes + has_alpha) * 8, has_alpha * 8);
} else {
int i,j,k;
+ int jend, jdir;
stbiw__writef(s, "111 221 2222 11", 0,0,format+8, 0,0,0, 0,0,x,y, (colorbytes + has_alpha) * 8, has_alpha * 8);
- for (j = y - 1; j >= 0; --j) {
- unsigned char *row = (unsigned char *) data + j * x * comp;
+ if (stbi__flip_vertically_on_write) {
+ j = 0;
+ jend = y;
+ jdir = 1;
+ } else {
+ j = y-1;
+ jend = -1;
+ jdir = -1;
+ }
+ for (; j != jend; j += jdir) {
+ unsigned char *row = (unsigned char *) data + j * x * comp;
int len;
for (i = 0; i < x; i += len) {
@@ -437,32 +592,33 @@ static int stbi_write_tga_core(stbi__write_context *s, int x, int y, int comp, v
if (diff) {
unsigned char header = STBIW_UCHAR(len - 1);
- s->func(s->context, &header, 1);
+ stbiw__write1(s, header);
for (k = 0; k < len; ++k) {
stbiw__write_pixel(s, -1, comp, has_alpha, 0, begin + k * comp);
}
} else {
unsigned char header = STBIW_UCHAR(len - 129);
- s->func(s->context, &header, 1);
+ stbiw__write1(s, header);
stbiw__write_pixel(s, -1, comp, has_alpha, 0, begin);
}
}
}
+ stbiw__write_flush(s);
}
return 1;
}
-int stbi_write_tga_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data)
+STBIWDEF int stbi_write_tga_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data)
{
- stbi__write_context s;
+ stbi__write_context s = { 0 };
stbi__start_write_callbacks(&s, func, context);
return stbi_write_tga_core(&s, x, y, comp, (void *) data);
}
#ifndef STBI_WRITE_NO_STDIO
-int stbi_write_tga(char const *filename, int x, int y, int comp, const void *data)
+STBIWDEF int stbi_write_tga(char const *filename, int x, int y, int comp, const void *data)
{
- stbi__write_context s;
+ stbi__write_context s = { 0 };
if (stbi__start_write_file(&s,filename)) {
int r = stbi_write_tga_core(&s, x, y, comp, (void *) data);
stbi__end_write_file(&s);
@@ -475,11 +631,12 @@ int stbi_write_tga(char const *filename, int x, int y, int comp, const void *dat
// *************************************************************************************************
// Radiance RGBE HDR writer
// by Baldur Karlsson
-#ifndef STBI_WRITE_NO_STDIO
#define stbiw__max(a, b) ((a) > (b) ? (a) : (b))
-void stbiw__linear_to_rgbe(unsigned char *rgbe, float *linear)
+#ifndef STBI_WRITE_NO_STDIO
+
+static void stbiw__linear_to_rgbe(unsigned char *rgbe, float *linear)
{
int exponent;
float maxcomp = stbiw__max(linear[0], stbiw__max(linear[1], linear[2]));
@@ -496,7 +653,7 @@ void stbiw__linear_to_rgbe(unsigned char *rgbe, float *linear)
}
}
-void stbiw__write_run_data(stbi__write_context *s, int length, unsigned char databyte)
+static void stbiw__write_run_data(stbi__write_context *s, int length, unsigned char databyte)
{
unsigned char lengthbyte = STBIW_UCHAR(length+128);
STBIW_ASSERT(length+128 <= 255);
@@ -504,7 +661,7 @@ void stbiw__write_run_data(stbi__write_context *s, int length, unsigned char dat
s->func(s->context, &databyte, 1);
}
-void stbiw__write_dump_data(stbi__write_context *s, int length, unsigned char *data)
+static void stbiw__write_dump_data(stbi__write_context *s, int length, unsigned char *data)
{
unsigned char lengthbyte = STBIW_UCHAR(length);
STBIW_ASSERT(length <= 128); // inconsistent with spec but consistent with official code
@@ -512,7 +669,7 @@ void stbiw__write_dump_data(stbi__write_context *s, int length, unsigned char *d
s->func(s->context, data, length);
}
-void stbiw__write_hdr_scanline(stbi__write_context *s, int width, int ncomp, unsigned char *scratch, float *scanline)
+static void stbiw__write_hdr_scanline(stbi__write_context *s, int width, int ncomp, unsigned char *scratch, float *scanline)
{
unsigned char scanlineheader[4] = { 2, 2, 0, 0 };
unsigned char rgbe[4];
@@ -613,26 +770,30 @@ static int stbi_write_hdr_core(stbi__write_context *s, int x, int y, int comp, f
char header[] = "#?RADIANCE\n# Written by stb_image_write.h\nFORMAT=32-bit_rle_rgbe\n";
s->func(s->context, header, sizeof(header)-1);
+#ifdef __STDC_LIB_EXT1__
+ len = sprintf_s(buffer, sizeof(buffer), "EXPOSURE= 1.0000000000000\n\n-Y %d +X %d\n", y, x);
+#else
len = sprintf(buffer, "EXPOSURE= 1.0000000000000\n\n-Y %d +X %d\n", y, x);
+#endif
s->func(s->context, buffer, len);
for(i=0; i < y; i++)
- stbiw__write_hdr_scanline(s, x, comp, scratch, data + comp*i*x);
+ stbiw__write_hdr_scanline(s, x, comp, scratch, data + comp*x*(stbi__flip_vertically_on_write ? y-1-i : i));
STBIW_FREE(scratch);
return 1;
}
}
-int stbi_write_hdr_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const float *data)
+STBIWDEF int stbi_write_hdr_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const float *data)
{
- stbi__write_context s;
+ stbi__write_context s = { 0 };
stbi__start_write_callbacks(&s, func, context);
return stbi_write_hdr_core(&s, x, y, comp, (float *) data);
}
-int stbi_write_hdr(char const *filename, int x, int y, int comp, const float *data)
+STBIWDEF int stbi_write_hdr(char const *filename, int x, int y, int comp, const float *data)
{
- stbi__write_context s;
+ stbi__write_context s = { 0 };
if (stbi__start_write_file(&s,filename)) {
int r = stbi_write_hdr_core(&s, x, y, comp, (float *) data);
stbi__end_write_file(&s);
@@ -648,8 +809,9 @@ int stbi_write_hdr(char const *filename, int x, int y, int comp, const float *da
// PNG writer
//
+#ifndef STBIW_ZLIB_COMPRESS
// stretchy buffer; stbiw__sbpush() == vector<>::push_back() -- stbiw__sbcount() == vector<>::size()
-#define stbiw__sbraw(a) ((int *) (a) - 2)
+#define stbiw__sbraw(a) ((int *) (void *) (a) - 2)
#define stbiw__sbm(a) stbiw__sbraw(a)[0]
#define stbiw__sbn(a) stbiw__sbraw(a)[1]
@@ -728,8 +890,14 @@ static unsigned int stbiw__zhash(unsigned char *data)
#define stbiw__ZHASH 16384
-unsigned char * stbi_zlib_compress(unsigned char *data, int data_len, int *out_len, int quality)
+#endif // STBIW_ZLIB_COMPRESS
+
+STBIWDEF unsigned char * stbi_zlib_compress(unsigned char *data, int data_len, int *out_len, int quality)
{
+#ifdef STBIW_ZLIB_COMPRESS
+ // user provided a zlib compress implementation, use that
+ return STBIW_ZLIB_COMPRESS(data, data_len, out_len, quality);
+#else // use builtin
static unsigned short lengthc[] = { 3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258, 259 };
static unsigned char lengtheb[]= { 0,0,0,0,0,0,0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0 };
static unsigned short distc[] = { 1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577, 32768 };
@@ -737,7 +905,9 @@ unsigned char * stbi_zlib_compress(unsigned char *data, int data_len, int *out_l
unsigned int bitbuf=0;
int i,j, bitcount=0;
unsigned char *out = NULL;
- unsigned char ***hash_table = (unsigned char***) STBIW_MALLOC(stbiw__ZHASH * sizeof(char**));
+ unsigned char ***hash_table = (unsigned char***) STBIW_MALLOC(stbiw__ZHASH * sizeof(unsigned char**));
+ if (hash_table == NULL)
+ return NULL;
if (quality < 5) quality = 5;
stbiw__sbpush(out, 0x78); // DEFLATE 32K window
@@ -758,7 +928,7 @@ unsigned char * stbi_zlib_compress(unsigned char *data, int data_len, int *out_l
for (j=0; j < n; ++j) {
if (hlist[j]-data > i-32768) { // if entry lies within window
int d = stbiw__zlib_countm(hlist[j], data+i, data_len-i);
- if (d >= best) best=d,bestloc=hlist[j];
+ if (d >= best) { best=d; bestloc=hlist[j]; }
}
}
// when hash table entry is too long, delete half the entries
@@ -811,14 +981,31 @@ unsigned char * stbi_zlib_compress(unsigned char *data, int data_len, int *out_l
(void) stbiw__sbfree(hash_table[i]);
STBIW_FREE(hash_table);
+ // store uncompressed instead if compression was worse
+ if (stbiw__sbn(out) > data_len + 2 + ((data_len+32766)/32767)*5) {
+ stbiw__sbn(out) = 2; // truncate to DEFLATE 32K window and FLEVEL = 1
+ for (j = 0; j < data_len;) {
+ int blocklen = data_len - j;
+ if (blocklen > 32767) blocklen = 32767;
+ stbiw__sbpush(out, data_len - j == blocklen); // BFINAL = ?, BTYPE = 0 -- no compression
+ stbiw__sbpush(out, STBIW_UCHAR(blocklen)); // LEN
+ stbiw__sbpush(out, STBIW_UCHAR(blocklen >> 8));
+ stbiw__sbpush(out, STBIW_UCHAR(~blocklen)); // NLEN
+ stbiw__sbpush(out, STBIW_UCHAR(~blocklen >> 8));
+ memcpy(out+stbiw__sbn(out), data+j, blocklen);
+ stbiw__sbn(out) += blocklen;
+ j += blocklen;
+ }
+ }
+
{
// compute adler32 on input
unsigned int s1=1, s2=0;
int blocklen = (int) (data_len % 5552);
j=0;
while (j < data_len) {
- for (i=0; i < blocklen; ++i) s1 += data[j+i], s2 += s1;
- s1 %= 65521, s2 %= 65521;
+ for (i=0; i < blocklen; ++i) { s1 += data[j+i]; s2 += s1; }
+ s1 %= 65521; s2 %= 65521;
j += blocklen;
blocklen = 5552;
}
@@ -831,10 +1018,14 @@ unsigned char * stbi_zlib_compress(unsigned char *data, int data_len, int *out_l
// make returned pointer freeable
STBIW_MEMMOVE(stbiw__sbraw(out), out, *out_len);
return (unsigned char *) stbiw__sbraw(out);
+#endif // STBIW_ZLIB_COMPRESS
}
static unsigned int stbiw__crc32(unsigned char *buffer, int len)
{
+#ifdef STBIW_CRC32
+ return STBIW_CRC32(buffer, len);
+#else
static unsigned int crc_table[256] =
{
0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,
@@ -876,6 +1067,7 @@ static unsigned int stbiw__crc32(unsigned char *buffer, int len)
for (i=0; i < len; ++i)
crc = (crc >> 8) ^ crc_table[buffer[i] ^ (crc & 0xff)];
return ~crc;
+#endif
}
#define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4)
@@ -896,61 +1088,92 @@ static unsigned char stbiw__paeth(int a, int b, int c)
return STBIW_UCHAR(c);
}
-unsigned char *stbi_write_png_to_mem(unsigned char *pixels, int stride_bytes, int x, int y, int n, int *out_len)
+// @OPTIMIZE: provide an option that always forces left-predict or paeth predict
+static void stbiw__encode_png_line(unsigned char *pixels, int stride_bytes, int width, int height, int y, int n, int filter_type, signed char *line_buffer)
+{
+ static int mapping[] = { 0,1,2,3,4 };
+ static int firstmap[] = { 0,1,0,5,6 };
+ int *mymap = (y != 0) ? mapping : firstmap;
+ int i;
+ int type = mymap[filter_type];
+ unsigned char *z = pixels + stride_bytes * (stbi__flip_vertically_on_write ? height-1-y : y);
+ int signed_stride = stbi__flip_vertically_on_write ? -stride_bytes : stride_bytes;
+
+ if (type==0) {
+ memcpy(line_buffer, z, width*n);
+ return;
+ }
+
+ // first loop isn't optimized since it's just one pixel
+ for (i = 0; i < n; ++i) {
+ switch (type) {
+ case 1: line_buffer[i] = z[i]; break;
+ case 2: line_buffer[i] = z[i] - z[i-signed_stride]; break;
+ case 3: line_buffer[i] = z[i] - (z[i-signed_stride]>>1); break;
+ case 4: line_buffer[i] = (signed char) (z[i] - stbiw__paeth(0,z[i-signed_stride],0)); break;
+ case 5: line_buffer[i] = z[i]; break;
+ case 6: line_buffer[i] = z[i]; break;
+ }
+ }
+ switch (type) {
+ case 1: for (i=n; i < width*n; ++i) line_buffer[i] = z[i] - z[i-n]; break;
+ case 2: for (i=n; i < width*n; ++i) line_buffer[i] = z[i] - z[i-signed_stride]; break;
+ case 3: for (i=n; i < width*n; ++i) line_buffer[i] = z[i] - ((z[i-n] + z[i-signed_stride])>>1); break;
+ case 4: for (i=n; i < width*n; ++i) line_buffer[i] = z[i] - stbiw__paeth(z[i-n], z[i-signed_stride], z[i-signed_stride-n]); break;
+ case 5: for (i=n; i < width*n; ++i) line_buffer[i] = z[i] - (z[i-n]>>1); break;
+ case 6: for (i=n; i < width*n; ++i) line_buffer[i] = z[i] - stbiw__paeth(z[i-n], 0,0); break;
+ }
+}
+
+STBIWDEF unsigned char *stbi_write_png_to_mem(const unsigned char *pixels, int stride_bytes, int x, int y, int n, int *out_len)
{
+ int force_filter = stbi_write_force_png_filter;
int ctype[5] = { -1, 0, 4, 2, 6 };
unsigned char sig[8] = { 137,80,78,71,13,10,26,10 };
unsigned char *out,*o, *filt, *zlib;
signed char *line_buffer;
- int i,j,k,p,zlen;
+ int j,zlen;
if (stride_bytes == 0)
stride_bytes = x * n;
+ if (force_filter >= 5) {
+ force_filter = -1;
+ }
+
filt = (unsigned char *) STBIW_MALLOC((x*n+1) * y); if (!filt) return 0;
line_buffer = (signed char *) STBIW_MALLOC(x * n); if (!line_buffer) { STBIW_FREE(filt); return 0; }
for (j=0; j < y; ++j) {
- static int mapping[] = { 0,1,2,3,4 };
- static int firstmap[] = { 0,1,0,5,6 };
- int *mymap = j ? mapping : firstmap;
- int best = 0, bestval = 0x7fffffff;
- for (p=0; p < 2; ++p) {
- for (k= p?best:0; k < 5; ++k) {
- int type = mymap[k],est=0;
- unsigned char *z = pixels + stride_bytes*j;
- for (i=0; i < n; ++i)
- switch (type) {
- case 0: line_buffer[i] = z[i]; break;
- case 1: line_buffer[i] = z[i]; break;
- case 2: line_buffer[i] = z[i] - z[i-stride_bytes]; break;
- case 3: line_buffer[i] = z[i] - (z[i-stride_bytes]>>1); break;
- case 4: line_buffer[i] = (signed char) (z[i] - stbiw__paeth(0,z[i-stride_bytes],0)); break;
- case 5: line_buffer[i] = z[i]; break;
- case 6: line_buffer[i] = z[i]; break;
- }
- for (i=n; i < x*n; ++i) {
- switch (type) {
- case 0: line_buffer[i] = z[i]; break;
- case 1: line_buffer[i] = z[i] - z[i-n]; break;
- case 2: line_buffer[i] = z[i] - z[i-stride_bytes]; break;
- case 3: line_buffer[i] = z[i] - ((z[i-n] + z[i-stride_bytes])>>1); break;
- case 4: line_buffer[i] = z[i] - stbiw__paeth(z[i-n], z[i-stride_bytes], z[i-stride_bytes-n]); break;
- case 5: line_buffer[i] = z[i] - (z[i-n]>>1); break;
- case 6: line_buffer[i] = z[i] - stbiw__paeth(z[i-n], 0,0); break;
- }
- }
- if (p) break;
- for (i=0; i < x*n; ++i)
+ int filter_type;
+ if (force_filter > -1) {
+ filter_type = force_filter;
+ stbiw__encode_png_line((unsigned char*)(pixels), stride_bytes, x, y, j, n, force_filter, line_buffer);
+ } else { // Estimate the best filter by running through all of them:
+ int best_filter = 0, best_filter_val = 0x7fffffff, est, i;
+ for (filter_type = 0; filter_type < 5; filter_type++) {
+ stbiw__encode_png_line((unsigned char*)(pixels), stride_bytes, x, y, j, n, filter_type, line_buffer);
+
+ // Estimate the entropy of the line using this filter; the less, the better.
+ est = 0;
+ for (i = 0; i < x*n; ++i) {
est += abs((signed char) line_buffer[i]);
- if (est < bestval) { bestval = est; best = k; }
+ }
+ if (est < best_filter_val) {
+ best_filter_val = est;
+ best_filter = filter_type;
+ }
+ }
+ if (filter_type != best_filter) { // If the last iteration already got us the best filter, don't redo it
+ stbiw__encode_png_line((unsigned char*)(pixels), stride_bytes, x, y, j, n, best_filter, line_buffer);
+ filter_type = best_filter;
}
}
- // when we get here, best contains the filter type, and line_buffer contains the data
- filt[j*(x*n+1)] = (unsigned char) best;
+ // when we get here, filter_type contains the filter type, and line_buffer contains the data
+ filt[j*(x*n+1)] = (unsigned char) filter_type;
STBIW_MEMMOVE(filt+j*(x*n+1)+1, line_buffer, x*n);
}
STBIW_FREE(line_buffer);
- zlib = stbi_zlib_compress(filt, y*( x*n+1), &zlen, 8); // increase 8 to get smaller but use more memory
+ zlib = stbi_zlib_compress(filt, y*( x*n+1), &zlen, stbi_write_png_compression_level);
STBIW_FREE(filt);
if (!zlib) return 0;
@@ -993,9 +1216,10 @@ STBIWDEF int stbi_write_png(char const *filename, int x, int y, int comp, const
{
FILE *f;
int len;
- unsigned char *png = stbi_write_png_to_mem((unsigned char *) data, stride_bytes, x, y, comp, &len);
+ unsigned char *png = stbi_write_png_to_mem((const unsigned char *) data, stride_bytes, x, y, comp, &len);
if (png == NULL) return 0;
- f = fopen(filename, "wb");
+
+ f = stbiw__fopen(filename, "wb");
if (!f) { STBIW_FREE(png); return 0; }
fwrite(png, 1, len, f);
fclose(f);
@@ -1007,16 +1231,426 @@ STBIWDEF int stbi_write_png(char const *filename, int x, int y, int comp, const
STBIWDEF int stbi_write_png_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data, int stride_bytes)
{
int len;
- unsigned char *png = stbi_write_png_to_mem((unsigned char *) data, stride_bytes, x, y, comp, &len);
+ unsigned char *png = stbi_write_png_to_mem((const unsigned char *) data, stride_bytes, x, y, comp, &len);
if (png == NULL) return 0;
func(context, png, len);
STBIW_FREE(png);
return 1;
}
+
+/* ***************************************************************************
+ *
+ * JPEG writer
+ *
+ * This is based on Jon Olick's jo_jpeg.cpp:
+ * public domain Simple, Minimalistic JPEG writer - http://www.jonolick.com/code.html
+ */
+
+static const unsigned char stbiw__jpg_ZigZag[] = { 0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,
+ 24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63 };
+
+static void stbiw__jpg_writeBits(stbi__write_context *s, int *bitBufP, int *bitCntP, const unsigned short *bs) {
+ int bitBuf = *bitBufP, bitCnt = *bitCntP;
+ bitCnt += bs[1];
+ bitBuf |= bs[0] << (24 - bitCnt);
+ while(bitCnt >= 8) {
+ unsigned char c = (bitBuf >> 16) & 255;
+ stbiw__putc(s, c);
+ if(c == 255) {
+ stbiw__putc(s, 0);
+ }
+ bitBuf <<= 8;
+ bitCnt -= 8;
+ }
+ *bitBufP = bitBuf;
+ *bitCntP = bitCnt;
+}
+
+static void stbiw__jpg_DCT(float *d0p, float *d1p, float *d2p, float *d3p, float *d4p, float *d5p, float *d6p, float *d7p) {
+ float d0 = *d0p, d1 = *d1p, d2 = *d2p, d3 = *d3p, d4 = *d4p, d5 = *d5p, d6 = *d6p, d7 = *d7p;
+ float z1, z2, z3, z4, z5, z11, z13;
+
+ float tmp0 = d0 + d7;
+ float tmp7 = d0 - d7;
+ float tmp1 = d1 + d6;
+ float tmp6 = d1 - d6;
+ float tmp2 = d2 + d5;
+ float tmp5 = d2 - d5;
+ float tmp3 = d3 + d4;
+ float tmp4 = d3 - d4;
+
+ // Even part
+ float tmp10 = tmp0 + tmp3; // phase 2
+ float tmp13 = tmp0 - tmp3;
+ float tmp11 = tmp1 + tmp2;
+ float tmp12 = tmp1 - tmp2;
+
+ d0 = tmp10 + tmp11; // phase 3
+ d4 = tmp10 - tmp11;
+
+ z1 = (tmp12 + tmp13) * 0.707106781f; // c4
+ d2 = tmp13 + z1; // phase 5
+ d6 = tmp13 - z1;
+
+ // Odd part
+ tmp10 = tmp4 + tmp5; // phase 2
+ tmp11 = tmp5 + tmp6;
+ tmp12 = tmp6 + tmp7;
+
+ // The rotator is modified from fig 4-8 to avoid extra negations.
+ z5 = (tmp10 - tmp12) * 0.382683433f; // c6
+ z2 = tmp10 * 0.541196100f + z5; // c2-c6
+ z4 = tmp12 * 1.306562965f + z5; // c2+c6
+ z3 = tmp11 * 0.707106781f; // c4
+
+ z11 = tmp7 + z3; // phase 5
+ z13 = tmp7 - z3;
+
+ *d5p = z13 + z2; // phase 6
+ *d3p = z13 - z2;
+ *d1p = z11 + z4;
+ *d7p = z11 - z4;
+
+ *d0p = d0; *d2p = d2; *d4p = d4; *d6p = d6;
+}
+
+static void stbiw__jpg_calcBits(int val, unsigned short bits[2]) {
+ int tmp1 = val < 0 ? -val : val;
+ val = val < 0 ? val-1 : val;
+ bits[1] = 1;
+ while(tmp1 >>= 1) {
+ ++bits[1];
+ }
+ bits[0] = val & ((1<0)&&(DU[end0pos]==0); --end0pos) {
+ }
+ // end0pos = first element in reverse order !=0
+ if(end0pos == 0) {
+ stbiw__jpg_writeBits(s, bitBuf, bitCnt, EOB);
+ return DU[0];
+ }
+ for(i = 1; i <= end0pos; ++i) {
+ int startpos = i;
+ int nrzeroes;
+ unsigned short bits[2];
+ for (; DU[i]==0 && i<=end0pos; ++i) {
+ }
+ nrzeroes = i-startpos;
+ if ( nrzeroes >= 16 ) {
+ int lng = nrzeroes>>4;
+ int nrmarker;
+ for (nrmarker=1; nrmarker <= lng; ++nrmarker)
+ stbiw__jpg_writeBits(s, bitBuf, bitCnt, M16zeroes);
+ nrzeroes &= 15;
+ }
+ stbiw__jpg_calcBits(DU[i], bits);
+ stbiw__jpg_writeBits(s, bitBuf, bitCnt, HTAC[(nrzeroes<<4)+bits[1]]);
+ stbiw__jpg_writeBits(s, bitBuf, bitCnt, bits);
+ }
+ if(end0pos != 63) {
+ stbiw__jpg_writeBits(s, bitBuf, bitCnt, EOB);
+ }
+ return DU[0];
+}
+
+static int stbi_write_jpg_core(stbi__write_context *s, int width, int height, int comp, const void* data, int quality) {
+ // Constants that don't pollute global namespace
+ static const unsigned char std_dc_luminance_nrcodes[] = {0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0};
+ static const unsigned char std_dc_luminance_values[] = {0,1,2,3,4,5,6,7,8,9,10,11};
+ static const unsigned char std_ac_luminance_nrcodes[] = {0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,0x7d};
+ static const unsigned char std_ac_luminance_values[] = {
+ 0x01,0x02,0x03,0x00,0x04,0x11,0x05,0x12,0x21,0x31,0x41,0x06,0x13,0x51,0x61,0x07,0x22,0x71,0x14,0x32,0x81,0x91,0xa1,0x08,
+ 0x23,0x42,0xb1,0xc1,0x15,0x52,0xd1,0xf0,0x24,0x33,0x62,0x72,0x82,0x09,0x0a,0x16,0x17,0x18,0x19,0x1a,0x25,0x26,0x27,0x28,
+ 0x29,0x2a,0x34,0x35,0x36,0x37,0x38,0x39,0x3a,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4a,0x53,0x54,0x55,0x56,0x57,0x58,0x59,
+ 0x5a,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0x83,0x84,0x85,0x86,0x87,0x88,0x89,
+ 0x8a,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9a,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xb2,0xb3,0xb4,0xb5,0xb6,
+ 0xb7,0xb8,0xb9,0xba,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xd2,0xd3,0xd4,0xd5,0xd6,0xd7,0xd8,0xd9,0xda,0xe1,0xe2,
+ 0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,0xe9,0xea,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,0xf9,0xfa
+ };
+ static const unsigned char std_dc_chrominance_nrcodes[] = {0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0};
+ static const unsigned char std_dc_chrominance_values[] = {0,1,2,3,4,5,6,7,8,9,10,11};
+ static const unsigned char std_ac_chrominance_nrcodes[] = {0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,0x77};
+ static const unsigned char std_ac_chrominance_values[] = {
+ 0x00,0x01,0x02,0x03,0x11,0x04,0x05,0x21,0x31,0x06,0x12,0x41,0x51,0x07,0x61,0x71,0x13,0x22,0x32,0x81,0x08,0x14,0x42,0x91,
+ 0xa1,0xb1,0xc1,0x09,0x23,0x33,0x52,0xf0,0x15,0x62,0x72,0xd1,0x0a,0x16,0x24,0x34,0xe1,0x25,0xf1,0x17,0x18,0x19,0x1a,0x26,
+ 0x27,0x28,0x29,0x2a,0x35,0x36,0x37,0x38,0x39,0x3a,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4a,0x53,0x54,0x55,0x56,0x57,0x58,
+ 0x59,0x5a,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0x82,0x83,0x84,0x85,0x86,0x87,
+ 0x88,0x89,0x8a,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99,0x9a,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xb2,0xb3,0xb4,
+ 0xb5,0xb6,0xb7,0xb8,0xb9,0xba,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xd2,0xd3,0xd4,0xd5,0xd6,0xd7,0xd8,0xd9,0xda,
+ 0xe2,0xe3,0xe4,0xe5,0xe6,0xe7,0xe8,0xe9,0xea,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7,0xf8,0xf9,0xfa
+ };
+ // Huffman tables
+ static const unsigned short YDC_HT[256][2] = { {0,2},{2,3},{3,3},{4,3},{5,3},{6,3},{14,4},{30,5},{62,6},{126,7},{254,8},{510,9}};
+ static const unsigned short UVDC_HT[256][2] = { {0,2},{1,2},{2,2},{6,3},{14,4},{30,5},{62,6},{126,7},{254,8},{510,9},{1022,10},{2046,11}};
+ static const unsigned short YAC_HT[256][2] = {
+ {10,4},{0,2},{1,2},{4,3},{11,4},{26,5},{120,7},{248,8},{1014,10},{65410,16},{65411,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
+ {12,4},{27,5},{121,7},{502,9},{2038,11},{65412,16},{65413,16},{65414,16},{65415,16},{65416,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
+ {28,5},{249,8},{1015,10},{4084,12},{65417,16},{65418,16},{65419,16},{65420,16},{65421,16},{65422,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
+ {58,6},{503,9},{4085,12},{65423,16},{65424,16},{65425,16},{65426,16},{65427,16},{65428,16},{65429,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
+ {59,6},{1016,10},{65430,16},{65431,16},{65432,16},{65433,16},{65434,16},{65435,16},{65436,16},{65437,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
+ {122,7},{2039,11},{65438,16},{65439,16},{65440,16},{65441,16},{65442,16},{65443,16},{65444,16},{65445,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
+ {123,7},{4086,12},{65446,16},{65447,16},{65448,16},{65449,16},{65450,16},{65451,16},{65452,16},{65453,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
+ {250,8},{4087,12},{65454,16},{65455,16},{65456,16},{65457,16},{65458,16},{65459,16},{65460,16},{65461,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
+ {504,9},{32704,15},{65462,16},{65463,16},{65464,16},{65465,16},{65466,16},{65467,16},{65468,16},{65469,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
+ {505,9},{65470,16},{65471,16},{65472,16},{65473,16},{65474,16},{65475,16},{65476,16},{65477,16},{65478,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
+ {506,9},{65479,16},{65480,16},{65481,16},{65482,16},{65483,16},{65484,16},{65485,16},{65486,16},{65487,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
+ {1017,10},{65488,16},{65489,16},{65490,16},{65491,16},{65492,16},{65493,16},{65494,16},{65495,16},{65496,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
+ {1018,10},{65497,16},{65498,16},{65499,16},{65500,16},{65501,16},{65502,16},{65503,16},{65504,16},{65505,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
+ {2040,11},{65506,16},{65507,16},{65508,16},{65509,16},{65510,16},{65511,16},{65512,16},{65513,16},{65514,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
+ {65515,16},{65516,16},{65517,16},{65518,16},{65519,16},{65520,16},{65521,16},{65522,16},{65523,16},{65524,16},{0,0},{0,0},{0,0},{0,0},{0,0},
+ {2041,11},{65525,16},{65526,16},{65527,16},{65528,16},{65529,16},{65530,16},{65531,16},{65532,16},{65533,16},{65534,16},{0,0},{0,0},{0,0},{0,0},{0,0}
+ };
+ static const unsigned short UVAC_HT[256][2] = {
+ {0,2},{1,2},{4,3},{10,4},{24,5},{25,5},{56,6},{120,7},{500,9},{1014,10},{4084,12},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
+ {11,4},{57,6},{246,8},{501,9},{2038,11},{4085,12},{65416,16},{65417,16},{65418,16},{65419,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
+ {26,5},{247,8},{1015,10},{4086,12},{32706,15},{65420,16},{65421,16},{65422,16},{65423,16},{65424,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
+ {27,5},{248,8},{1016,10},{4087,12},{65425,16},{65426,16},{65427,16},{65428,16},{65429,16},{65430,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
+ {58,6},{502,9},{65431,16},{65432,16},{65433,16},{65434,16},{65435,16},{65436,16},{65437,16},{65438,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
+ {59,6},{1017,10},{65439,16},{65440,16},{65441,16},{65442,16},{65443,16},{65444,16},{65445,16},{65446,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
+ {121,7},{2039,11},{65447,16},{65448,16},{65449,16},{65450,16},{65451,16},{65452,16},{65453,16},{65454,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
+ {122,7},{2040,11},{65455,16},{65456,16},{65457,16},{65458,16},{65459,16},{65460,16},{65461,16},{65462,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
+ {249,8},{65463,16},{65464,16},{65465,16},{65466,16},{65467,16},{65468,16},{65469,16},{65470,16},{65471,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
+ {503,9},{65472,16},{65473,16},{65474,16},{65475,16},{65476,16},{65477,16},{65478,16},{65479,16},{65480,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
+ {504,9},{65481,16},{65482,16},{65483,16},{65484,16},{65485,16},{65486,16},{65487,16},{65488,16},{65489,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
+ {505,9},{65490,16},{65491,16},{65492,16},{65493,16},{65494,16},{65495,16},{65496,16},{65497,16},{65498,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
+ {506,9},{65499,16},{65500,16},{65501,16},{65502,16},{65503,16},{65504,16},{65505,16},{65506,16},{65507,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
+ {2041,11},{65508,16},{65509,16},{65510,16},{65511,16},{65512,16},{65513,16},{65514,16},{65515,16},{65516,16},{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
+ {16352,14},{65517,16},{65518,16},{65519,16},{65520,16},{65521,16},{65522,16},{65523,16},{65524,16},{65525,16},{0,0},{0,0},{0,0},{0,0},{0,0},
+ {1018,10},{32707,15},{65526,16},{65527,16},{65528,16},{65529,16},{65530,16},{65531,16},{65532,16},{65533,16},{65534,16},{0,0},{0,0},{0,0},{0,0},{0,0}
+ };
+ static const int YQT[] = {16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,
+ 37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99};
+ static const int UVQT[] = {17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,
+ 99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99};
+ static const float aasf[] = { 1.0f * 2.828427125f, 1.387039845f * 2.828427125f, 1.306562965f * 2.828427125f, 1.175875602f * 2.828427125f,
+ 1.0f * 2.828427125f, 0.785694958f * 2.828427125f, 0.541196100f * 2.828427125f, 0.275899379f * 2.828427125f };
+
+ int row, col, i, k, subsample;
+ float fdtbl_Y[64], fdtbl_UV[64];
+ unsigned char YTable[64], UVTable[64];
+
+ if(!data || !width || !height || comp > 4 || comp < 1) {
+ return 0;
+ }
+
+ quality = quality ? quality : 90;
+ subsample = quality <= 90 ? 1 : 0;
+ quality = quality < 1 ? 1 : quality > 100 ? 100 : quality;
+ quality = quality < 50 ? 5000 / quality : 200 - quality * 2;
+
+ for(i = 0; i < 64; ++i) {
+ int uvti, yti = (YQT[i]*quality+50)/100;
+ YTable[stbiw__jpg_ZigZag[i]] = (unsigned char) (yti < 1 ? 1 : yti > 255 ? 255 : yti);
+ uvti = (UVQT[i]*quality+50)/100;
+ UVTable[stbiw__jpg_ZigZag[i]] = (unsigned char) (uvti < 1 ? 1 : uvti > 255 ? 255 : uvti);
+ }
+
+ for(row = 0, k = 0; row < 8; ++row) {
+ for(col = 0; col < 8; ++col, ++k) {
+ fdtbl_Y[k] = 1 / (YTable [stbiw__jpg_ZigZag[k]] * aasf[row] * aasf[col]);
+ fdtbl_UV[k] = 1 / (UVTable[stbiw__jpg_ZigZag[k]] * aasf[row] * aasf[col]);
+ }
+ }
+
+ // Write Headers
+ {
+ static const unsigned char head0[] = { 0xFF,0xD8,0xFF,0xE0,0,0x10,'J','F','I','F',0,1,1,0,0,1,0,1,0,0,0xFF,0xDB,0,0x84,0 };
+ static const unsigned char head2[] = { 0xFF,0xDA,0,0xC,3,1,0,2,0x11,3,0x11,0,0x3F,0 };
+ const unsigned char head1[] = { 0xFF,0xC0,0,0x11,8,(unsigned char)(height>>8),STBIW_UCHAR(height),(unsigned char)(width>>8),STBIW_UCHAR(width),
+ 3,1,(unsigned char)(subsample?0x22:0x11),0,2,0x11,1,3,0x11,1,0xFF,0xC4,0x01,0xA2,0 };
+ s->func(s->context, (void*)head0, sizeof(head0));
+ s->func(s->context, (void*)YTable, sizeof(YTable));
+ stbiw__putc(s, 1);
+ s->func(s->context, UVTable, sizeof(UVTable));
+ s->func(s->context, (void*)head1, sizeof(head1));
+ s->func(s->context, (void*)(std_dc_luminance_nrcodes+1), sizeof(std_dc_luminance_nrcodes)-1);
+ s->func(s->context, (void*)std_dc_luminance_values, sizeof(std_dc_luminance_values));
+ stbiw__putc(s, 0x10); // HTYACinfo
+ s->func(s->context, (void*)(std_ac_luminance_nrcodes+1), sizeof(std_ac_luminance_nrcodes)-1);
+ s->func(s->context, (void*)std_ac_luminance_values, sizeof(std_ac_luminance_values));
+ stbiw__putc(s, 1); // HTUDCinfo
+ s->func(s->context, (void*)(std_dc_chrominance_nrcodes+1), sizeof(std_dc_chrominance_nrcodes)-1);
+ s->func(s->context, (void*)std_dc_chrominance_values, sizeof(std_dc_chrominance_values));
+ stbiw__putc(s, 0x11); // HTUACinfo
+ s->func(s->context, (void*)(std_ac_chrominance_nrcodes+1), sizeof(std_ac_chrominance_nrcodes)-1);
+ s->func(s->context, (void*)std_ac_chrominance_values, sizeof(std_ac_chrominance_values));
+ s->func(s->context, (void*)head2, sizeof(head2));
+ }
+
+ // Encode 8x8 macroblocks
+ {
+ static const unsigned short fillBits[] = {0x7F, 7};
+ int DCY=0, DCU=0, DCV=0;
+ int bitBuf=0, bitCnt=0;
+ // comp == 2 is grey+alpha (alpha is ignored)
+ int ofsG = comp > 2 ? 1 : 0, ofsB = comp > 2 ? 2 : 0;
+ const unsigned char *dataR = (const unsigned char *)data;
+ const unsigned char *dataG = dataR + ofsG;
+ const unsigned char *dataB = dataR + ofsB;
+ int x, y, pos;
+ if(subsample) {
+ for(y = 0; y < height; y += 16) {
+ for(x = 0; x < width; x += 16) {
+ float Y[256], U[256], V[256];
+ for(row = y, pos = 0; row < y+16; ++row) {
+ // row >= height => use last input row
+ int clamped_row = (row < height) ? row : height - 1;
+ int base_p = (stbi__flip_vertically_on_write ? (height-1-clamped_row) : clamped_row)*width*comp;
+ for(col = x; col < x+16; ++col, ++pos) {
+ // if col >= width => use pixel from last input column
+ int p = base_p + ((col < width) ? col : (width-1))*comp;
+ float r = dataR[p], g = dataG[p], b = dataB[p];
+ Y[pos]= +0.29900f*r + 0.58700f*g + 0.11400f*b - 128;
+ U[pos]= -0.16874f*r - 0.33126f*g + 0.50000f*b;
+ V[pos]= +0.50000f*r - 0.41869f*g - 0.08131f*b;
+ }
+ }
+ DCY = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, Y+0, 16, fdtbl_Y, DCY, YDC_HT, YAC_HT);
+ DCY = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, Y+8, 16, fdtbl_Y, DCY, YDC_HT, YAC_HT);
+ DCY = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, Y+128, 16, fdtbl_Y, DCY, YDC_HT, YAC_HT);
+ DCY = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, Y+136, 16, fdtbl_Y, DCY, YDC_HT, YAC_HT);
+
+ // subsample U,V
+ {
+ float subU[64], subV[64];
+ int yy, xx;
+ for(yy = 0, pos = 0; yy < 8; ++yy) {
+ for(xx = 0; xx < 8; ++xx, ++pos) {
+ int j = yy*32+xx*2;
+ subU[pos] = (U[j+0] + U[j+1] + U[j+16] + U[j+17]) * 0.25f;
+ subV[pos] = (V[j+0] + V[j+1] + V[j+16] + V[j+17]) * 0.25f;
+ }
+ }
+ DCU = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, subU, 8, fdtbl_UV, DCU, UVDC_HT, UVAC_HT);
+ DCV = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, subV, 8, fdtbl_UV, DCV, UVDC_HT, UVAC_HT);
+ }
+ }
+ }
+ } else {
+ for(y = 0; y < height; y += 8) {
+ for(x = 0; x < width; x += 8) {
+ float Y[64], U[64], V[64];
+ for(row = y, pos = 0; row < y+8; ++row) {
+ // row >= height => use last input row
+ int clamped_row = (row < height) ? row : height - 1;
+ int base_p = (stbi__flip_vertically_on_write ? (height-1-clamped_row) : clamped_row)*width*comp;
+ for(col = x; col < x+8; ++col, ++pos) {
+ // if col >= width => use pixel from last input column
+ int p = base_p + ((col < width) ? col : (width-1))*comp;
+ float r = dataR[p], g = dataG[p], b = dataB[p];
+ Y[pos]= +0.29900f*r + 0.58700f*g + 0.11400f*b - 128;
+ U[pos]= -0.16874f*r - 0.33126f*g + 0.50000f*b;
+ V[pos]= +0.50000f*r - 0.41869f*g - 0.08131f*b;
+ }
+ }
+
+ DCY = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, Y, 8, fdtbl_Y, DCY, YDC_HT, YAC_HT);
+ DCU = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, U, 8, fdtbl_UV, DCU, UVDC_HT, UVAC_HT);
+ DCV = stbiw__jpg_processDU(s, &bitBuf, &bitCnt, V, 8, fdtbl_UV, DCV, UVDC_HT, UVAC_HT);
+ }
+ }
+ }
+
+ // Do the bit alignment of the EOI marker
+ stbiw__jpg_writeBits(s, &bitBuf, &bitCnt, fillBits);
+ }
+
+ // EOI
+ stbiw__putc(s, 0xFF);
+ stbiw__putc(s, 0xD9);
+
+ return 1;
+}
+
+STBIWDEF int stbi_write_jpg_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data, int quality)
+{
+ stbi__write_context s = { 0 };
+ stbi__start_write_callbacks(&s, func, context);
+ return stbi_write_jpg_core(&s, x, y, comp, (void *) data, quality);
+}
+
+
+#ifndef STBI_WRITE_NO_STDIO
+STBIWDEF int stbi_write_jpg(char const *filename, int x, int y, int comp, const void *data, int quality)
+{
+ stbi__write_context s = { 0 };
+ if (stbi__start_write_file(&s,filename)) {
+ int r = stbi_write_jpg_core(&s, x, y, comp, data, quality);
+ stbi__end_write_file(&s);
+ return r;
+ } else
+ return 0;
+}
+#endif
+
#endif // STB_IMAGE_WRITE_IMPLEMENTATION
/* Revision history
+ 1.16 (2021-07-11)
+ make Deflate code emit uncompressed blocks when it would otherwise expand
+ support writing BMPs with alpha channel
+ 1.15 (2020-07-13) unknown
+ 1.14 (2020-02-02) updated JPEG writer to downsample chroma channels
+ 1.13
+ 1.12
+ 1.11 (2019-08-11)
+
+ 1.10 (2019-02-07)
+ support utf8 filenames in Windows; fix warnings and platform ifdefs
+ 1.09 (2018-02-11)
+ fix typo in zlib quality API, improve STB_I_W_STATIC in C++
+ 1.08 (2018-01-29)
+ add stbi__flip_vertically_on_write, external zlib, zlib quality, choose PNG filter
+ 1.07 (2017-07-24)
+ doc fix
+ 1.06 (2017-07-23)
+ writing JPEG (using Jon Olick's code)
+ 1.05 ???
+ 1.04 (2017-03-03)
+ monochrome BMP expansion
+ 1.03 ???
1.02 (2016-04-02)
avoid allocating large structures on the stack
1.01 (2016-01-16)
@@ -1035,7 +1669,7 @@ STBIWDEF int stbi_write_png_to_func(stbi_write_func *func, void *context, int x,
add HDR output
fix monochrome BMP
0.95 (2014-08-17)
- add monochrome TGA output
+ add monochrome TGA output
0.94 (2014-05-31)
rename private functions to avoid conflicts with stb_image.h
0.93 (2014-05-27)
@@ -1046,3 +1680,45 @@ STBIWDEF int stbi_write_png_to_func(stbi_write_func *func, void *context, int x,
first public release
0.90 first internal release
*/
+
+/*
+------------------------------------------------------------------------------
+This software is available under 2 licenses -- choose whichever you prefer.
+------------------------------------------------------------------------------
+ALTERNATIVE A - MIT License
+Copyright (c) 2017 Sean Barrett
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+------------------------------------------------------------------------------
+ALTERNATIVE B - Public Domain (www.unlicense.org)
+This is free and unencumbered software released into the public domain.
+Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
+software, either in source code form or as a compiled binary, for any purpose,
+commercial or non-commercial, and by any means.
+In jurisdictions that recognize copyright laws, the author or authors of this
+software dedicate any and all copyright interest in the software to the public
+domain. We make this dedication for the benefit of the public at large and to
+the detriment of our heirs and successors. We intend this dedication to be an
+overt act of relinquishment in perpetuity of all present and future rights to
+this software under copyright law.
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+------------------------------------------------------------------------------
+*/
diff --git a/external/GLFW/deps/wayland/fractional-scale-v1.xml b/external/GLFW/deps/wayland/fractional-scale-v1.xml
new file mode 100644
index 0000000..350bfc0
--- /dev/null
+++ b/external/GLFW/deps/wayland/fractional-scale-v1.xml
@@ -0,0 +1,102 @@
+
+
+
+ Copyright © 2022 Kenny Levinsen
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice (including the next
+ paragraph) shall be included in all copies or substantial portions of the
+ Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+
+
+
+ This protocol allows a compositor to suggest for surfaces to render at
+ fractional scales.
+
+ A client can submit scaled content by utilizing wp_viewport. This is done by
+ creating a wp_viewport object for the surface and setting the destination
+ rectangle to the surface size before the scale factor is applied.
+
+ The buffer size is calculated by multiplying the surface size by the
+ intended scale.
+
+ The wl_surface buffer scale should remain set to 1.
+
+ If a surface has a surface-local size of 100 px by 50 px and wishes to
+ submit buffers with a scale of 1.5, then a buffer of 150px by 75 px should
+ be used and the wp_viewport destination rectangle should be 100 px by 50 px.
+
+ For toplevel surfaces, the size is rounded halfway away from zero. The
+ rounding algorithm for subsurface position and size is not defined.
+
+
+
+
+ A global interface for requesting surfaces to use fractional scales.
+
+
+
+
+ Informs the server that the client will not be using this protocol
+ object anymore. This does not affect any other objects,
+ wp_fractional_scale_v1 objects included.
+
+
+
+
+
+
+
+
+
+ Create an add-on object for the the wl_surface to let the compositor
+ request fractional scales. If the given wl_surface already has a
+ wp_fractional_scale_v1 object associated, the fractional_scale_exists
+ protocol error is raised.
+
+
+
+
+
+
+
+
+ An additional interface to a wl_surface object which allows the compositor
+ to inform the client of the preferred scale.
+
+
+
+
+ Destroy the fractional scale object. When this object is destroyed,
+ preferred_scale events will no longer be sent.
+
+
+
+
+
+ Notification of a new preferred scale for this surface that the
+ compositor suggests that the client should use.
+
+ The sent scale is the numerator of a fraction with a denominator of 120.
+
+
+
+
+
diff --git a/external/GLFW/deps/wayland/idle-inhibit-unstable-v1.xml b/external/GLFW/deps/wayland/idle-inhibit-unstable-v1.xml
new file mode 100644
index 0000000..9c06cdc
--- /dev/null
+++ b/external/GLFW/deps/wayland/idle-inhibit-unstable-v1.xml
@@ -0,0 +1,83 @@
+
+
+
+
+ Copyright © 2015 Samsung Electronics Co., Ltd
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice (including the next
+ paragraph) shall be included in all copies or substantial portions of the
+ Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+
+
+
+
+ This interface permits inhibiting the idle behavior such as screen
+ blanking, locking, and screensaving. The client binds the idle manager
+ globally, then creates idle-inhibitor objects for each surface.
+
+ Warning! The protocol described in this file is experimental and
+ backward incompatible changes may be made. Backward compatible changes
+ may be added together with the corresponding interface version bump.
+ Backward incompatible changes are done by bumping the version number in
+ the protocol and interface names and resetting the interface version.
+ Once the protocol is to be declared stable, the 'z' prefix and the
+ version number in the protocol and interface names are removed and the
+ interface version number is reset.
+
+
+
+
+ Destroy the inhibit manager.
+
+
+
+
+
+ Create a new inhibitor object associated with the given surface.
+
+
+
+
+
+
+
+
+
+ An idle inhibitor prevents the output that the associated surface is
+ visible on from being set to a state where it is not visually usable due
+ to lack of user interaction (e.g. blanked, dimmed, locked, set to power
+ save, etc.) Any screensaver processes are also blocked from displaying.
+
+ If the surface is destroyed, unmapped, becomes occluded, loses
+ visibility, or otherwise becomes not visually relevant for the user, the
+ idle inhibitor will not be honored by the compositor; if the surface
+ subsequently regains visibility the inhibitor takes effect once again.
+ Likewise, the inhibitor isn't honored if the system was already idled at
+ the time the inhibitor was established, although if the system later
+ de-idles and re-idles the inhibitor will take effect.
+
+
+
+
+ Remove the inhibitor effect from the associated wl_surface.
+
+
+
+
+
diff --git a/external/GLFW/deps/wayland/pointer-constraints-unstable-v1.xml b/external/GLFW/deps/wayland/pointer-constraints-unstable-v1.xml
new file mode 100644
index 0000000..efd64b6
--- /dev/null
+++ b/external/GLFW/deps/wayland/pointer-constraints-unstable-v1.xml
@@ -0,0 +1,339 @@
+
+
+
+
+ Copyright © 2014 Jonas Ådahl
+ Copyright © 2015 Red Hat Inc.
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice (including the next
+ paragraph) shall be included in all copies or substantial portions of the
+ Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+
+
+
+ This protocol specifies a set of interfaces used for adding constraints to
+ the motion of a pointer. Possible constraints include confining pointer
+ motions to a given region, or locking it to its current position.
+
+ In order to constrain the pointer, a client must first bind the global
+ interface "wp_pointer_constraints" which, if a compositor supports pointer
+ constraints, is exposed by the registry. Using the bound global object, the
+ client uses the request that corresponds to the type of constraint it wants
+ to make. See wp_pointer_constraints for more details.
+
+ Warning! The protocol described in this file is experimental and backward
+ incompatible changes may be made. Backward compatible changes may be added
+ together with the corresponding interface version bump. Backward
+ incompatible changes are done by bumping the version number in the protocol
+ and interface names and resetting the interface version. Once the protocol
+ is to be declared stable, the 'z' prefix and the version number in the
+ protocol and interface names are removed and the interface version number is
+ reset.
+
+
+
+
+ The global interface exposing pointer constraining functionality. It
+ exposes two requests: lock_pointer for locking the pointer to its
+ position, and confine_pointer for locking the pointer to a region.
+
+ The lock_pointer and confine_pointer requests create the objects
+ wp_locked_pointer and wp_confined_pointer respectively, and the client can
+ use these objects to interact with the lock.
+
+ For any surface, only one lock or confinement may be active across all
+ wl_pointer objects of the same seat. If a lock or confinement is requested
+ when another lock or confinement is active or requested on the same surface
+ and with any of the wl_pointer objects of the same seat, an
+ 'already_constrained' error will be raised.
+
+
+
+
+ These errors can be emitted in response to wp_pointer_constraints
+ requests.
+
+
+
+
+
+
+ These values represent different lifetime semantics. They are passed
+ as arguments to the factory requests to specify how the constraint
+ lifetimes should be managed.
+
+
+
+ A oneshot pointer constraint will never reactivate once it has been
+ deactivated. See the corresponding deactivation event
+ (wp_locked_pointer.unlocked and wp_confined_pointer.unconfined) for
+ details.
+
+
+
+
+ A persistent pointer constraint may again reactivate once it has
+ been deactivated. See the corresponding deactivation event
+ (wp_locked_pointer.unlocked and wp_confined_pointer.unconfined) for
+ details.
+
+
+
+
+
+
+ Used by the client to notify the server that it will no longer use this
+ pointer constraints object.
+
+
+
+
+
+ The lock_pointer request lets the client request to disable movements of
+ the virtual pointer (i.e. the cursor), effectively locking the pointer
+ to a position. This request may not take effect immediately; in the
+ future, when the compositor deems implementation-specific constraints
+ are satisfied, the pointer lock will be activated and the compositor
+ sends a locked event.
+
+ The protocol provides no guarantee that the constraints are ever
+ satisfied, and does not require the compositor to send an error if the
+ constraints cannot ever be satisfied. It is thus possible to request a
+ lock that will never activate.
+
+ There may not be another pointer constraint of any kind requested or
+ active on the surface for any of the wl_pointer objects of the seat of
+ the passed pointer when requesting a lock. If there is, an error will be
+ raised. See general pointer lock documentation for more details.
+
+ The intersection of the region passed with this request and the input
+ region of the surface is used to determine where the pointer must be
+ in order for the lock to activate. It is up to the compositor whether to
+ warp the pointer or require some kind of user interaction for the lock
+ to activate. If the region is null the surface input region is used.
+
+ A surface may receive pointer focus without the lock being activated.
+
+ The request creates a new object wp_locked_pointer which is used to
+ interact with the lock as well as receive updates about its state. See
+ the the description of wp_locked_pointer for further information.
+
+ Note that while a pointer is locked, the wl_pointer objects of the
+ corresponding seat will not emit any wl_pointer.motion events, but
+ relative motion events will still be emitted via wp_relative_pointer
+ objects of the same seat. wl_pointer.axis and wl_pointer.button events
+ are unaffected.
+
+
+
+
+
+
+
+
+
+
+ The confine_pointer request lets the client request to confine the
+ pointer cursor to a given region. This request may not take effect
+ immediately; in the future, when the compositor deems implementation-
+ specific constraints are satisfied, the pointer confinement will be
+ activated and the compositor sends a confined event.
+
+ The intersection of the region passed with this request and the input
+ region of the surface is used to determine where the pointer must be
+ in order for the confinement to activate. It is up to the compositor
+ whether to warp the pointer or require some kind of user interaction for
+ the confinement to activate. If the region is null the surface input
+ region is used.
+
+ The request will create a new object wp_confined_pointer which is used
+ to interact with the confinement as well as receive updates about its
+ state. See the the description of wp_confined_pointer for further
+ information.
+
+
+
+
+
+
+
+
+
+
+
+ The wp_locked_pointer interface represents a locked pointer state.
+
+ While the lock of this object is active, the wl_pointer objects of the
+ associated seat will not emit any wl_pointer.motion events.
+
+ This object will send the event 'locked' when the lock is activated.
+ Whenever the lock is activated, it is guaranteed that the locked surface
+ will already have received pointer focus and that the pointer will be
+ within the region passed to the request creating this object.
+
+ To unlock the pointer, send the destroy request. This will also destroy
+ the wp_locked_pointer object.
+
+ If the compositor decides to unlock the pointer the unlocked event is
+ sent. See wp_locked_pointer.unlock for details.
+
+ When unlocking, the compositor may warp the cursor position to the set
+ cursor position hint. If it does, it will not result in any relative
+ motion events emitted via wp_relative_pointer.
+
+ If the surface the lock was requested on is destroyed and the lock is not
+ yet activated, the wp_locked_pointer object is now defunct and must be
+ destroyed.
+
+
+
+
+ Destroy the locked pointer object. If applicable, the compositor will
+ unlock the pointer.
+
+
+
+
+
+ Set the cursor position hint relative to the top left corner of the
+ surface.
+
+ If the client is drawing its own cursor, it should update the position
+ hint to the position of its own cursor. A compositor may use this
+ information to warp the pointer upon unlock in order to avoid pointer
+ jumps.
+
+ The cursor position hint is double buffered. The new hint will only take
+ effect when the associated surface gets it pending state applied. See
+ wl_surface.commit for details.
+
+
+
+
+
+
+
+ Set a new region used to lock the pointer.
+
+ The new lock region is double-buffered. The new lock region will
+ only take effect when the associated surface gets its pending state
+ applied. See wl_surface.commit for details.
+
+ For details about the lock region, see wp_locked_pointer.
+
+
+
+
+
+
+ Notification that the pointer lock of the seat's pointer is activated.
+
+
+
+
+
+ Notification that the pointer lock of the seat's pointer is no longer
+ active. If this is a oneshot pointer lock (see
+ wp_pointer_constraints.lifetime) this object is now defunct and should
+ be destroyed. If this is a persistent pointer lock (see
+ wp_pointer_constraints.lifetime) this pointer lock may again
+ reactivate in the future.
+
+
+
+
+
+
+ The wp_confined_pointer interface represents a confined pointer state.
+
+ This object will send the event 'confined' when the confinement is
+ activated. Whenever the confinement is activated, it is guaranteed that
+ the surface the pointer is confined to will already have received pointer
+ focus and that the pointer will be within the region passed to the request
+ creating this object. It is up to the compositor to decide whether this
+ requires some user interaction and if the pointer will warp to within the
+ passed region if outside.
+
+ To unconfine the pointer, send the destroy request. This will also destroy
+ the wp_confined_pointer object.
+
+ If the compositor decides to unconfine the pointer the unconfined event is
+ sent. The wp_confined_pointer object is at this point defunct and should
+ be destroyed.
+
+
+
+
+ Destroy the confined pointer object. If applicable, the compositor will
+ unconfine the pointer.
+
+
+
+
+
+ Set a new region used to confine the pointer.
+
+ The new confine region is double-buffered. The new confine region will
+ only take effect when the associated surface gets its pending state
+ applied. See wl_surface.commit for details.
+
+ If the confinement is active when the new confinement region is applied
+ and the pointer ends up outside of newly applied region, the pointer may
+ warped to a position within the new confinement region. If warped, a
+ wl_pointer.motion event will be emitted, but no
+ wp_relative_pointer.relative_motion event.
+
+ The compositor may also, instead of using the new region, unconfine the
+ pointer.
+
+ For details about the confine region, see wp_confined_pointer.
+
+
+
+
+
+
+ Notification that the pointer confinement of the seat's pointer is
+ activated.
+
+
+
+
+
+ Notification that the pointer confinement of the seat's pointer is no
+ longer active. If this is a oneshot pointer confinement (see
+ wp_pointer_constraints.lifetime) this object is now defunct and should
+ be destroyed. If this is a persistent pointer confinement (see
+ wp_pointer_constraints.lifetime) this pointer confinement may again
+ reactivate in the future.
+
+
+
+
+
diff --git a/external/GLFW/deps/wayland/relative-pointer-unstable-v1.xml b/external/GLFW/deps/wayland/relative-pointer-unstable-v1.xml
new file mode 100644
index 0000000..ca6f81d
--- /dev/null
+++ b/external/GLFW/deps/wayland/relative-pointer-unstable-v1.xml
@@ -0,0 +1,136 @@
+
+
+
+
+ Copyright © 2014 Jonas Ådahl
+ Copyright © 2015 Red Hat Inc.
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice (including the next
+ paragraph) shall be included in all copies or substantial portions of the
+ Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+
+
+
+ This protocol specifies a set of interfaces used for making clients able to
+ receive relative pointer events not obstructed by barriers (such as the
+ monitor edge or other pointer barriers).
+
+ To start receiving relative pointer events, a client must first bind the
+ global interface "wp_relative_pointer_manager" which, if a compositor
+ supports relative pointer motion events, is exposed by the registry. After
+ having created the relative pointer manager proxy object, the client uses
+ it to create the actual relative pointer object using the
+ "get_relative_pointer" request given a wl_pointer. The relative pointer
+ motion events will then, when applicable, be transmitted via the proxy of
+ the newly created relative pointer object. See the documentation of the
+ relative pointer interface for more details.
+
+ Warning! The protocol described in this file is experimental and backward
+ incompatible changes may be made. Backward compatible changes may be added
+ together with the corresponding interface version bump. Backward
+ incompatible changes are done by bumping the version number in the protocol
+ and interface names and resetting the interface version. Once the protocol
+ is to be declared stable, the 'z' prefix and the version number in the
+ protocol and interface names are removed and the interface version number is
+ reset.
+
+
+
+
+ A global interface used for getting the relative pointer object for a
+ given pointer.
+
+
+
+
+ Used by the client to notify the server that it will no longer use this
+ relative pointer manager object.
+
+
+
+
+
+ Create a relative pointer interface given a wl_pointer object. See the
+ wp_relative_pointer interface for more details.
+
+
+
+
+
+
+
+
+ A wp_relative_pointer object is an extension to the wl_pointer interface
+ used for emitting relative pointer events. It shares the same focus as
+ wl_pointer objects of the same seat and will only emit events when it has
+ focus.
+
+
+
+
+
+
+
+
+ Relative x/y pointer motion from the pointer of the seat associated with
+ this object.
+
+ A relative motion is in the same dimension as regular wl_pointer motion
+ events, except they do not represent an absolute position. For example,
+ moving a pointer from (x, y) to (x', y') would have the equivalent
+ relative motion (x' - x, y' - y). If a pointer motion caused the
+ absolute pointer position to be clipped by for example the edge of the
+ monitor, the relative motion is unaffected by the clipping and will
+ represent the unclipped motion.
+
+ This event also contains non-accelerated motion deltas. The
+ non-accelerated delta is, when applicable, the regular pointer motion
+ delta as it was before having applied motion acceleration and other
+ transformations such as normalization.
+
+ Note that the non-accelerated delta does not represent 'raw' events as
+ they were read from some device. Pointer motion acceleration is device-
+ and configuration-specific and non-accelerated deltas and accelerated
+ deltas may have the same value on some devices.
+
+ Relative motions are not coupled to wl_pointer.motion events, and can be
+ sent in combination with such events, but also independently. There may
+ also be scenarios where wl_pointer.motion is sent, but there is no
+ relative motion. The order of an absolute and relative motion event
+ originating from the same physical motion is not guaranteed.
+
+ If the client needs button events or focus state, it can receive them
+ from a wl_pointer object of the same seat that the wp_relative_pointer
+ object is associated with.
+
+
+
+
+
+
+
+
+
+
+
diff --git a/external/GLFW/deps/wayland/viewporter.xml b/external/GLFW/deps/wayland/viewporter.xml
new file mode 100644
index 0000000..d1048d1
--- /dev/null
+++ b/external/GLFW/deps/wayland/viewporter.xml
@@ -0,0 +1,180 @@
+
+
+
+
+ Copyright © 2013-2016 Collabora, Ltd.
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice (including the next
+ paragraph) shall be included in all copies or substantial portions of the
+ Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+
+
+
+
+ The global interface exposing surface cropping and scaling
+ capabilities is used to instantiate an interface extension for a
+ wl_surface object. This extended interface will then allow
+ cropping and scaling the surface contents, effectively
+ disconnecting the direct relationship between the buffer and the
+ surface size.
+
+
+
+
+ Informs the server that the client will not be using this
+ protocol object anymore. This does not affect any other objects,
+ wp_viewport objects included.
+
+
+
+
+
+
+
+
+
+ Instantiate an interface extension for the given wl_surface to
+ crop and scale its content. If the given wl_surface already has
+ a wp_viewport object associated, the viewport_exists
+ protocol error is raised.
+
+
+
+
+
+
+
+
+ An additional interface to a wl_surface object, which allows the
+ client to specify the cropping and scaling of the surface
+ contents.
+
+ This interface works with two concepts: the source rectangle (src_x,
+ src_y, src_width, src_height), and the destination size (dst_width,
+ dst_height). The contents of the source rectangle are scaled to the
+ destination size, and content outside the source rectangle is ignored.
+ This state is double-buffered, and is applied on the next
+ wl_surface.commit.
+
+ The two parts of crop and scale state are independent: the source
+ rectangle, and the destination size. Initially both are unset, that
+ is, no scaling is applied. The whole of the current wl_buffer is
+ used as the source, and the surface size is as defined in
+ wl_surface.attach.
+
+ If the destination size is set, it causes the surface size to become
+ dst_width, dst_height. The source (rectangle) is scaled to exactly
+ this size. This overrides whatever the attached wl_buffer size is,
+ unless the wl_buffer is NULL. If the wl_buffer is NULL, the surface
+ has no content and therefore no size. Otherwise, the size is always
+ at least 1x1 in surface local coordinates.
+
+ If the source rectangle is set, it defines what area of the wl_buffer is
+ taken as the source. If the source rectangle is set and the destination
+ size is not set, then src_width and src_height must be integers, and the
+ surface size becomes the source rectangle size. This results in cropping
+ without scaling. If src_width or src_height are not integers and
+ destination size is not set, the bad_size protocol error is raised when
+ the surface state is applied.
+
+ The coordinate transformations from buffer pixel coordinates up to
+ the surface-local coordinates happen in the following order:
+ 1. buffer_transform (wl_surface.set_buffer_transform)
+ 2. buffer_scale (wl_surface.set_buffer_scale)
+ 3. crop and scale (wp_viewport.set*)
+ This means, that the source rectangle coordinates of crop and scale
+ are given in the coordinates after the buffer transform and scale,
+ i.e. in the coordinates that would be the surface-local coordinates
+ if the crop and scale was not applied.
+
+ If src_x or src_y are negative, the bad_value protocol error is raised.
+ Otherwise, if the source rectangle is partially or completely outside of
+ the non-NULL wl_buffer, then the out_of_buffer protocol error is raised
+ when the surface state is applied. A NULL wl_buffer does not raise the
+ out_of_buffer error.
+
+ If the wl_surface associated with the wp_viewport is destroyed,
+ all wp_viewport requests except 'destroy' raise the protocol error
+ no_surface.
+
+ If the wp_viewport object is destroyed, the crop and scale
+ state is removed from the wl_surface. The change will be applied
+ on the next wl_surface.commit.
+
+
+
+
+ The associated wl_surface's crop and scale state is removed.
+ The change is applied on the next wl_surface.commit.
+
+
+
+
+
+
+
+
+
+
+
+
+ Set the source rectangle of the associated wl_surface. See
+ wp_viewport for the description, and relation to the wl_buffer
+ size.
+
+ If all of x, y, width and height are -1.0, the source rectangle is
+ unset instead. Any other set of values where width or height are zero
+ or negative, or x or y are negative, raise the bad_value protocol
+ error.
+
+ The crop and scale state is double-buffered state, and will be
+ applied on the next wl_surface.commit.
+
+
+
+
+
+
+
+
+
+ Set the destination size of the associated wl_surface. See
+ wp_viewport for the description, and relation to the wl_buffer
+ size.
+
+ If width is -1 and height is -1, the destination size is unset
+ instead. Any other pair of values for width and height that
+ contains zero or negative values raises the bad_value protocol
+ error.
+
+ The crop and scale state is double-buffered state, and will be
+ applied on the next wl_surface.commit.
+
+
+
+
+
+
+
diff --git a/external/GLFW/deps/wayland/wayland.xml b/external/GLFW/deps/wayland/wayland.xml
new file mode 100644
index 0000000..10e039d
--- /dev/null
+++ b/external/GLFW/deps/wayland/wayland.xml
@@ -0,0 +1,3151 @@
+
+
+
+
+ Copyright © 2008-2011 Kristian Høgsberg
+ Copyright © 2010-2011 Intel Corporation
+ Copyright © 2012-2013 Collabora, Ltd.
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation files
+ (the "Software"), to deal in the Software without restriction,
+ including without limitation the rights to use, copy, modify, merge,
+ publish, distribute, sublicense, and/or sell copies of the Software,
+ and to permit persons to whom the Software is furnished to do so,
+ subject to the following conditions:
+
+ The above copyright notice and this permission notice (including the
+ next paragraph) shall be included in all copies or substantial
+ portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+
+
+
+
+ The core global object. This is a special singleton object. It
+ is used for internal Wayland protocol features.
+
+
+
+
+ The sync request asks the server to emit the 'done' event
+ on the returned wl_callback object. Since requests are
+ handled in-order and events are delivered in-order, this can
+ be used as a barrier to ensure all previous requests and the
+ resulting events have been handled.
+
+ The object returned by this request will be destroyed by the
+ compositor after the callback is fired and as such the client must not
+ attempt to use it after that point.
+
+ The callback_data passed in the callback is the event serial.
+
+
+
+
+
+
+ This request creates a registry object that allows the client
+ to list and bind the global objects available from the
+ compositor.
+
+ It should be noted that the server side resources consumed in
+ response to a get_registry request can only be released when the
+ client disconnects, not when the client side proxy is destroyed.
+ Therefore, clients should invoke get_registry as infrequently as
+ possible to avoid wasting memory.
+
+
+
+
+
+
+ The error event is sent out when a fatal (non-recoverable)
+ error has occurred. The object_id argument is the object
+ where the error occurred, most often in response to a request
+ to that object. The code identifies the error and is defined
+ by the object interface. As such, each interface defines its
+ own set of error codes. The message is a brief description
+ of the error, for (debugging) convenience.
+
+
+
+
+
+
+
+
+ These errors are global and can be emitted in response to any
+ server request.
+
+
+
+
+
+
+
+
+
+ This event is used internally by the object ID management
+ logic. When a client deletes an object that it had created,
+ the server will send this event to acknowledge that it has
+ seen the delete request. When the client receives this event,
+ it will know that it can safely reuse the object ID.
+
+
+
+
+
+
+
+ The singleton global registry object. The server has a number of
+ global objects that are available to all clients. These objects
+ typically represent an actual object in the server (for example,
+ an input device) or they are singleton objects that provide
+ extension functionality.
+
+ When a client creates a registry object, the registry object
+ will emit a global event for each global currently in the
+ registry. Globals come and go as a result of device or
+ monitor hotplugs, reconfiguration or other events, and the
+ registry will send out global and global_remove events to
+ keep the client up to date with the changes. To mark the end
+ of the initial burst of events, the client can use the
+ wl_display.sync request immediately after calling
+ wl_display.get_registry.
+
+ A client can bind to a global object by using the bind
+ request. This creates a client-side handle that lets the object
+ emit events to the client and lets the client invoke requests on
+ the object.
+
+
+
+
+ Binds a new, client-created object to the server using the
+ specified name as the identifier.
+
+
+
+
+
+
+
+ Notify the client of global objects.
+
+ The event notifies the client that a global object with
+ the given name is now available, and it implements the
+ given version of the given interface.
+
+
+
+
+
+
+
+
+ Notify the client of removed global objects.
+
+ This event notifies the client that the global identified
+ by name is no longer available. If the client bound to
+ the global using the bind request, the client should now
+ destroy that object.
+
+ The object remains valid and requests to the object will be
+ ignored until the client destroys it, to avoid races between
+ the global going away and a client sending a request to it.
+
+
+
+
+
+
+
+ Clients can handle the 'done' event to get notified when
+ the related request is done.
+
+ Note, because wl_callback objects are created from multiple independent
+ factory interfaces, the wl_callback interface is frozen at version 1.
+
+
+
+
+ Notify the client when the related request is done.
+
+
+
+
+
+
+
+ A compositor. This object is a singleton global. The
+ compositor is in charge of combining the contents of multiple
+ surfaces into one displayable output.
+
+
+
+
+ Ask the compositor to create a new surface.
+
+
+
+
+
+
+ Ask the compositor to create a new region.
+
+
+
+
+
+
+
+ The wl_shm_pool object encapsulates a piece of memory shared
+ between the compositor and client. Through the wl_shm_pool
+ object, the client can allocate shared memory wl_buffer objects.
+ All objects created through the same pool share the same
+ underlying mapped memory. Reusing the mapped memory avoids the
+ setup/teardown overhead and is useful when interactively resizing
+ a surface or for many small buffers.
+
+
+
+
+ Create a wl_buffer object from the pool.
+
+ The buffer is created offset bytes into the pool and has
+ width and height as specified. The stride argument specifies
+ the number of bytes from the beginning of one row to the beginning
+ of the next. The format is the pixel format of the buffer and
+ must be one of those advertised through the wl_shm.format event.
+
+ A buffer will keep a reference to the pool it was created from
+ so it is valid to destroy the pool immediately after creating
+ a buffer from it.
+
+
+
+
+
+
+
+
+
+
+
+ Destroy the shared memory pool.
+
+ The mmapped memory will be released when all
+ buffers that have been created from this pool
+ are gone.
+
+
+
+
+
+ This request will cause the server to remap the backing memory
+ for the pool from the file descriptor passed when the pool was
+ created, but using the new size. This request can only be
+ used to make the pool bigger.
+
+ This request only changes the amount of bytes that are mmapped
+ by the server and does not touch the file corresponding to the
+ file descriptor passed at creation time. It is the client's
+ responsibility to ensure that the file is at least as big as
+ the new pool size.
+
+
+
+
+
+
+
+ A singleton global object that provides support for shared
+ memory.
+
+ Clients can create wl_shm_pool objects using the create_pool
+ request.
+
+ On binding the wl_shm object one or more format events
+ are emitted to inform clients about the valid pixel formats
+ that can be used for buffers.
+
+
+
+
+ These errors can be emitted in response to wl_shm requests.
+
+
+
+
+
+
+
+
+ This describes the memory layout of an individual pixel.
+
+ All renderers should support argb8888 and xrgb8888 but any other
+ formats are optional and may not be supported by the particular
+ renderer in use.
+
+ The drm format codes match the macros defined in drm_fourcc.h, except
+ argb8888 and xrgb8888. The formats actually supported by the compositor
+ will be reported by the format event.
+
+ For all wl_shm formats and unless specified in another protocol
+ extension, pre-multiplied alpha is used for pixel values.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Create a new wl_shm_pool object.
+
+ The pool can be used to create shared memory based buffer
+ objects. The server will mmap size bytes of the passed file
+ descriptor, to use as backing memory for the pool.
+
+
+
+
+
+
+
+
+ Informs the client about a valid pixel format that
+ can be used for buffers. Known formats include
+ argb8888 and xrgb8888.
+
+
+
+
+
+
+
+ A buffer provides the content for a wl_surface. Buffers are
+ created through factory interfaces such as wl_shm, wp_linux_buffer_params
+ (from the linux-dmabuf protocol extension) or similar. It has a width and
+ a height and can be attached to a wl_surface, but the mechanism by which a
+ client provides and updates the contents is defined by the buffer factory
+ interface.
+
+ If the buffer uses a format that has an alpha channel, the alpha channel
+ is assumed to be premultiplied in the color channels unless otherwise
+ specified.
+
+ Note, because wl_buffer objects are created from multiple independent
+ factory interfaces, the wl_buffer interface is frozen at version 1.
+
+
+
+
+ Destroy a buffer. If and how you need to release the backing
+ storage is defined by the buffer factory interface.
+
+ For possible side-effects to a surface, see wl_surface.attach.
+
+
+
+
+
+ Sent when this wl_buffer is no longer used by the compositor.
+ The client is now free to reuse or destroy this buffer and its
+ backing storage.
+
+ If a client receives a release event before the frame callback
+ requested in the same wl_surface.commit that attaches this
+ wl_buffer to a surface, then the client is immediately free to
+ reuse the buffer and its backing storage, and does not need a
+ second buffer for the next surface content update. Typically
+ this is possible, when the compositor maintains a copy of the
+ wl_surface contents, e.g. as a GL texture. This is an important
+ optimization for GL(ES) compositors with wl_shm clients.
+
+
+
+
+
+
+ A wl_data_offer represents a piece of data offered for transfer
+ by another client (the source client). It is used by the
+ copy-and-paste and drag-and-drop mechanisms. The offer
+ describes the different mime types that the data can be
+ converted to and provides the mechanism for transferring the
+ data directly from the source client.
+
+
+
+
+
+
+
+
+
+
+
+ Indicate that the client can accept the given mime type, or
+ NULL for not accepted.
+
+ For objects of version 2 or older, this request is used by the
+ client to give feedback whether the client can receive the given
+ mime type, or NULL if none is accepted; the feedback does not
+ determine whether the drag-and-drop operation succeeds or not.
+
+ For objects of version 3 or newer, this request determines the
+ final result of the drag-and-drop operation. If the end result
+ is that no mime types were accepted, the drag-and-drop operation
+ will be cancelled and the corresponding drag source will receive
+ wl_data_source.cancelled. Clients may still use this event in
+ conjunction with wl_data_source.action for feedback.
+
+
+
+
+
+
+
+ To transfer the offered data, the client issues this request
+ and indicates the mime type it wants to receive. The transfer
+ happens through the passed file descriptor (typically created
+ with the pipe system call). The source client writes the data
+ in the mime type representation requested and then closes the
+ file descriptor.
+
+ The receiving client reads from the read end of the pipe until
+ EOF and then closes its end, at which point the transfer is
+ complete.
+
+ This request may happen multiple times for different mime types,
+ both before and after wl_data_device.drop. Drag-and-drop destination
+ clients may preemptively fetch data or examine it more closely to
+ determine acceptance.
+
+
+
+
+
+
+
+ Destroy the data offer.
+
+
+
+
+
+ Sent immediately after creating the wl_data_offer object. One
+ event per offered mime type.
+
+
+
+
+
+
+
+
+ Notifies the compositor that the drag destination successfully
+ finished the drag-and-drop operation.
+
+ Upon receiving this request, the compositor will emit
+ wl_data_source.dnd_finished on the drag source client.
+
+ It is a client error to perform other requests than
+ wl_data_offer.destroy after this one. It is also an error to perform
+ this request after a NULL mime type has been set in
+ wl_data_offer.accept or no action was received through
+ wl_data_offer.action.
+
+ If wl_data_offer.finish request is received for a non drag and drop
+ operation, the invalid_finish protocol error is raised.
+
+
+
+
+
+ Sets the actions that the destination side client supports for
+ this operation. This request may trigger the emission of
+ wl_data_source.action and wl_data_offer.action events if the compositor
+ needs to change the selected action.
+
+ This request can be called multiple times throughout the
+ drag-and-drop operation, typically in response to wl_data_device.enter
+ or wl_data_device.motion events.
+
+ This request determines the final result of the drag-and-drop
+ operation. If the end result is that no action is accepted,
+ the drag source will receive wl_data_source.cancelled.
+
+ The dnd_actions argument must contain only values expressed in the
+ wl_data_device_manager.dnd_actions enum, and the preferred_action
+ argument must only contain one of those values set, otherwise it
+ will result in a protocol error.
+
+ While managing an "ask" action, the destination drag-and-drop client
+ may perform further wl_data_offer.receive requests, and is expected
+ to perform one last wl_data_offer.set_actions request with a preferred
+ action other than "ask" (and optionally wl_data_offer.accept) before
+ requesting wl_data_offer.finish, in order to convey the action selected
+ by the user. If the preferred action is not in the
+ wl_data_offer.source_actions mask, an error will be raised.
+
+ If the "ask" action is dismissed (e.g. user cancellation), the client
+ is expected to perform wl_data_offer.destroy right away.
+
+ This request can only be made on drag-and-drop offers, a protocol error
+ will be raised otherwise.
+
+
+
+
+
+
+
+ This event indicates the actions offered by the data source. It
+ will be sent immediately after creating the wl_data_offer object,
+ or anytime the source side changes its offered actions through
+ wl_data_source.set_actions.
+
+
+
+
+
+
+ This event indicates the action selected by the compositor after
+ matching the source/destination side actions. Only one action (or
+ none) will be offered here.
+
+ This event can be emitted multiple times during the drag-and-drop
+ operation in response to destination side action changes through
+ wl_data_offer.set_actions.
+
+ This event will no longer be emitted after wl_data_device.drop
+ happened on the drag-and-drop destination, the client must
+ honor the last action received, or the last preferred one set
+ through wl_data_offer.set_actions when handling an "ask" action.
+
+ Compositors may also change the selected action on the fly, mainly
+ in response to keyboard modifier changes during the drag-and-drop
+ operation.
+
+ The most recent action received is always the valid one. Prior to
+ receiving wl_data_device.drop, the chosen action may change (e.g.
+ due to keyboard modifiers being pressed). At the time of receiving
+ wl_data_device.drop the drag-and-drop destination must honor the
+ last action received.
+
+ Action changes may still happen after wl_data_device.drop,
+ especially on "ask" actions, where the drag-and-drop destination
+ may choose another action afterwards. Action changes happening
+ at this stage are always the result of inter-client negotiation, the
+ compositor shall no longer be able to induce a different action.
+
+ Upon "ask" actions, it is expected that the drag-and-drop destination
+ may potentially choose a different action and/or mime type,
+ based on wl_data_offer.source_actions and finally chosen by the
+ user (e.g. popping up a menu with the available options). The
+ final wl_data_offer.set_actions and wl_data_offer.accept requests
+ must happen before the call to wl_data_offer.finish.
+
+
+
+
+
+
+
+ The wl_data_source object is the source side of a wl_data_offer.
+ It is created by the source client in a data transfer and
+ provides a way to describe the offered data and a way to respond
+ to requests to transfer the data.
+
+
+
+
+
+
+
+
+
+ This request adds a mime type to the set of mime types
+ advertised to targets. Can be called several times to offer
+ multiple types.
+
+
+
+
+
+
+ Destroy the data source.
+
+
+
+
+
+ Sent when a target accepts pointer_focus or motion events. If
+ a target does not accept any of the offered types, type is NULL.
+
+ Used for feedback during drag-and-drop.
+
+
+
+
+
+
+ Request for data from the client. Send the data as the
+ specified mime type over the passed file descriptor, then
+ close it.
+
+
+
+
+
+
+
+ This data source is no longer valid. There are several reasons why
+ this could happen:
+
+ - The data source has been replaced by another data source.
+ - The drag-and-drop operation was performed, but the drop destination
+ did not accept any of the mime types offered through
+ wl_data_source.target.
+ - The drag-and-drop operation was performed, but the drop destination
+ did not select any of the actions present in the mask offered through
+ wl_data_source.action.
+ - The drag-and-drop operation was performed but didn't happen over a
+ surface.
+ - The compositor cancelled the drag-and-drop operation (e.g. compositor
+ dependent timeouts to avoid stale drag-and-drop transfers).
+
+ The client should clean up and destroy this data source.
+
+ For objects of version 2 or older, wl_data_source.cancelled will
+ only be emitted if the data source was replaced by another data
+ source.
+
+
+
+
+
+
+
+ Sets the actions that the source side client supports for this
+ operation. This request may trigger wl_data_source.action and
+ wl_data_offer.action events if the compositor needs to change the
+ selected action.
+
+ The dnd_actions argument must contain only values expressed in the
+ wl_data_device_manager.dnd_actions enum, otherwise it will result
+ in a protocol error.
+
+ This request must be made once only, and can only be made on sources
+ used in drag-and-drop, so it must be performed before
+ wl_data_device.start_drag. Attempting to use the source other than
+ for drag-and-drop will raise a protocol error.
+
+
+
+
+
+
+ The user performed the drop action. This event does not indicate
+ acceptance, wl_data_source.cancelled may still be emitted afterwards
+ if the drop destination does not accept any mime type.
+
+ However, this event might however not be received if the compositor
+ cancelled the drag-and-drop operation before this event could happen.
+
+ Note that the data_source may still be used in the future and should
+ not be destroyed here.
+
+
+
+
+
+ The drop destination finished interoperating with this data
+ source, so the client is now free to destroy this data source and
+ free all associated data.
+
+ If the action used to perform the operation was "move", the
+ source can now delete the transferred data.
+
+
+
+
+
+ This event indicates the action selected by the compositor after
+ matching the source/destination side actions. Only one action (or
+ none) will be offered here.
+
+ This event can be emitted multiple times during the drag-and-drop
+ operation, mainly in response to destination side changes through
+ wl_data_offer.set_actions, and as the data device enters/leaves
+ surfaces.
+
+ It is only possible to receive this event after
+ wl_data_source.dnd_drop_performed if the drag-and-drop operation
+ ended in an "ask" action, in which case the final wl_data_source.action
+ event will happen immediately before wl_data_source.dnd_finished.
+
+ Compositors may also change the selected action on the fly, mainly
+ in response to keyboard modifier changes during the drag-and-drop
+ operation.
+
+ The most recent action received is always the valid one. The chosen
+ action may change alongside negotiation (e.g. an "ask" action can turn
+ into a "move" operation), so the effects of the final action must
+ always be applied in wl_data_offer.dnd_finished.
+
+ Clients can trigger cursor surface changes from this point, so
+ they reflect the current action.
+
+
+
+
+
+
+
+ There is one wl_data_device per seat which can be obtained
+ from the global wl_data_device_manager singleton.
+
+ A wl_data_device provides access to inter-client data transfer
+ mechanisms such as copy-and-paste and drag-and-drop.
+
+
+
+
+
+
+
+
+ This request asks the compositor to start a drag-and-drop
+ operation on behalf of the client.
+
+ The source argument is the data source that provides the data
+ for the eventual data transfer. If source is NULL, enter, leave
+ and motion events are sent only to the client that initiated the
+ drag and the client is expected to handle the data passing
+ internally. If source is destroyed, the drag-and-drop session will be
+ cancelled.
+
+ The origin surface is the surface where the drag originates and
+ the client must have an active implicit grab that matches the
+ serial.
+
+ The icon surface is an optional (can be NULL) surface that
+ provides an icon to be moved around with the cursor. Initially,
+ the top-left corner of the icon surface is placed at the cursor
+ hotspot, but subsequent wl_surface.attach request can move the
+ relative position. Attach requests must be confirmed with
+ wl_surface.commit as usual. The icon surface is given the role of
+ a drag-and-drop icon. If the icon surface already has another role,
+ it raises a protocol error.
+
+ The input region is ignored for wl_surfaces with the role of a
+ drag-and-drop icon.
+
+
+
+
+
+
+
+
+
+ This request asks the compositor to set the selection
+ to the data from the source on behalf of the client.
+
+ To unset the selection, set the source to NULL.
+
+
+
+
+
+
+
+ The data_offer event introduces a new wl_data_offer object,
+ which will subsequently be used in either the
+ data_device.enter event (for drag-and-drop) or the
+ data_device.selection event (for selections). Immediately
+ following the data_device.data_offer event, the new data_offer
+ object will send out data_offer.offer events to describe the
+ mime types it offers.
+
+
+
+
+
+
+ This event is sent when an active drag-and-drop pointer enters
+ a surface owned by the client. The position of the pointer at
+ enter time is provided by the x and y arguments, in surface-local
+ coordinates.
+
+
+
+
+
+
+
+
+
+
+ This event is sent when the drag-and-drop pointer leaves the
+ surface and the session ends. The client must destroy the
+ wl_data_offer introduced at enter time at this point.
+
+
+
+
+
+ This event is sent when the drag-and-drop pointer moves within
+ the currently focused surface. The new position of the pointer
+ is provided by the x and y arguments, in surface-local
+ coordinates.
+
+
+
+
+
+
+
+
+ The event is sent when a drag-and-drop operation is ended
+ because the implicit grab is removed.
+
+ The drag-and-drop destination is expected to honor the last action
+ received through wl_data_offer.action, if the resulting action is
+ "copy" or "move", the destination can still perform
+ wl_data_offer.receive requests, and is expected to end all
+ transfers with a wl_data_offer.finish request.
+
+ If the resulting action is "ask", the action will not be considered
+ final. The drag-and-drop destination is expected to perform one last
+ wl_data_offer.set_actions request, or wl_data_offer.destroy in order
+ to cancel the operation.
+
+
+
+
+
+ The selection event is sent out to notify the client of a new
+ wl_data_offer for the selection for this device. The
+ data_device.data_offer and the data_offer.offer events are
+ sent out immediately before this event to introduce the data
+ offer object. The selection event is sent to a client
+ immediately before receiving keyboard focus and when a new
+ selection is set while the client has keyboard focus. The
+ data_offer is valid until a new data_offer or NULL is received
+ or until the client loses keyboard focus. Switching surface with
+ keyboard focus within the same client doesn't mean a new selection
+ will be sent. The client must destroy the previous selection
+ data_offer, if any, upon receiving this event.
+
+
+
+
+
+
+
+
+ This request destroys the data device.
+
+
+
+
+
+
+ The wl_data_device_manager is a singleton global object that
+ provides access to inter-client data transfer mechanisms such as
+ copy-and-paste and drag-and-drop. These mechanisms are tied to
+ a wl_seat and this interface lets a client get a wl_data_device
+ corresponding to a wl_seat.
+
+ Depending on the version bound, the objects created from the bound
+ wl_data_device_manager object will have different requirements for
+ functioning properly. See wl_data_source.set_actions,
+ wl_data_offer.accept and wl_data_offer.finish for details.
+
+
+
+
+ Create a new data source.
+
+
+
+
+
+
+ Create a new data device for a given seat.
+
+
+
+
+
+
+
+
+
+ This is a bitmask of the available/preferred actions in a
+ drag-and-drop operation.
+
+ In the compositor, the selected action is a result of matching the
+ actions offered by the source and destination sides. "action" events
+ with a "none" action will be sent to both source and destination if
+ there is no match. All further checks will effectively happen on
+ (source actions ∩ destination actions).
+
+ In addition, compositors may also pick different actions in
+ reaction to key modifiers being pressed. One common design that
+ is used in major toolkits (and the behavior recommended for
+ compositors) is:
+
+ - If no modifiers are pressed, the first match (in bit order)
+ will be used.
+ - Pressing Shift selects "move", if enabled in the mask.
+ - Pressing Control selects "copy", if enabled in the mask.
+
+ Behavior beyond that is considered implementation-dependent.
+ Compositors may for example bind other modifiers (like Alt/Meta)
+ or drags initiated with other buttons than BTN_LEFT to specific
+ actions (e.g. "ask").
+
+
+
+
+
+
+
+
+
+
+ This interface is implemented by servers that provide
+ desktop-style user interfaces.
+
+ It allows clients to associate a wl_shell_surface with
+ a basic surface.
+
+ Note! This protocol is deprecated and not intended for production use.
+ For desktop-style user interfaces, use xdg_shell. Compositors and clients
+ should not implement this interface.
+
+
+
+
+
+
+
+
+ Create a shell surface for an existing surface. This gives
+ the wl_surface the role of a shell surface. If the wl_surface
+ already has another role, it raises a protocol error.
+
+ Only one shell surface can be associated with a given surface.
+
+
+
+
+
+
+
+
+ An interface that may be implemented by a wl_surface, for
+ implementations that provide a desktop-style user interface.
+
+ It provides requests to treat surfaces like toplevel, fullscreen
+ or popup windows, move, resize or maximize them, associate
+ metadata like title and class, etc.
+
+ On the server side the object is automatically destroyed when
+ the related wl_surface is destroyed. On the client side,
+ wl_shell_surface_destroy() must be called before destroying
+ the wl_surface object.
+
+
+
+
+ A client must respond to a ping event with a pong request or
+ the client may be deemed unresponsive.
+
+
+
+
+
+
+ Start a pointer-driven move of the surface.
+
+ This request must be used in response to a button press event.
+ The server may ignore move requests depending on the state of
+ the surface (e.g. fullscreen or maximized).
+
+
+
+
+
+
+
+ These values are used to indicate which edge of a surface
+ is being dragged in a resize operation. The server may
+ use this information to adapt its behavior, e.g. choose
+ an appropriate cursor image.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Start a pointer-driven resizing of the surface.
+
+ This request must be used in response to a button press event.
+ The server may ignore resize requests depending on the state of
+ the surface (e.g. fullscreen or maximized).
+
+
+
+
+
+
+
+
+ Map the surface as a toplevel surface.
+
+ A toplevel surface is not fullscreen, maximized or transient.
+
+
+
+
+
+ These flags specify details of the expected behaviour
+ of transient surfaces. Used in the set_transient request.
+
+
+
+
+
+
+ Map the surface relative to an existing surface.
+
+ The x and y arguments specify the location of the upper left
+ corner of the surface relative to the upper left corner of the
+ parent surface, in surface-local coordinates.
+
+ The flags argument controls details of the transient behaviour.
+
+
+
+
+
+
+
+
+
+ Hints to indicate to the compositor how to deal with a conflict
+ between the dimensions of the surface and the dimensions of the
+ output. The compositor is free to ignore this parameter.
+
+
+
+
+
+
+
+
+
+ Map the surface as a fullscreen surface.
+
+ If an output parameter is given then the surface will be made
+ fullscreen on that output. If the client does not specify the
+ output then the compositor will apply its policy - usually
+ choosing the output on which the surface has the biggest surface
+ area.
+
+ The client may specify a method to resolve a size conflict
+ between the output size and the surface size - this is provided
+ through the method parameter.
+
+ The framerate parameter is used only when the method is set
+ to "driver", to indicate the preferred framerate. A value of 0
+ indicates that the client does not care about framerate. The
+ framerate is specified in mHz, that is framerate of 60000 is 60Hz.
+
+ A method of "scale" or "driver" implies a scaling operation of
+ the surface, either via a direct scaling operation or a change of
+ the output mode. This will override any kind of output scaling, so
+ that mapping a surface with a buffer size equal to the mode can
+ fill the screen independent of buffer_scale.
+
+ A method of "fill" means we don't scale up the buffer, however
+ any output scale is applied. This means that you may run into
+ an edge case where the application maps a buffer with the same
+ size of the output mode but buffer_scale 1 (thus making a
+ surface larger than the output). In this case it is allowed to
+ downscale the results to fit the screen.
+
+ The compositor must reply to this request with a configure event
+ with the dimensions for the output on which the surface will
+ be made fullscreen.
+
+
+
+
+
+
+
+
+ Map the surface as a popup.
+
+ A popup surface is a transient surface with an added pointer
+ grab.
+
+ An existing implicit grab will be changed to owner-events mode,
+ and the popup grab will continue after the implicit grab ends
+ (i.e. releasing the mouse button does not cause the popup to
+ be unmapped).
+
+ The popup grab continues until the window is destroyed or a
+ mouse button is pressed in any other client's window. A click
+ in any of the client's surfaces is reported as normal, however,
+ clicks in other clients' surfaces will be discarded and trigger
+ the callback.
+
+ The x and y arguments specify the location of the upper left
+ corner of the surface relative to the upper left corner of the
+ parent surface, in surface-local coordinates.
+
+
+
+
+
+
+
+
+
+
+
+ Map the surface as a maximized surface.
+
+ If an output parameter is given then the surface will be
+ maximized on that output. If the client does not specify the
+ output then the compositor will apply its policy - usually
+ choosing the output on which the surface has the biggest surface
+ area.
+
+ The compositor will reply with a configure event telling
+ the expected new surface size. The operation is completed
+ on the next buffer attach to this surface.
+
+ A maximized surface typically fills the entire output it is
+ bound to, except for desktop elements such as panels. This is
+ the main difference between a maximized shell surface and a
+ fullscreen shell surface.
+
+ The details depend on the compositor implementation.
+
+
+
+
+
+
+ Set a short title for the surface.
+
+ This string may be used to identify the surface in a task bar,
+ window list, or other user interface elements provided by the
+ compositor.
+
+ The string must be encoded in UTF-8.
+
+
+
+
+
+
+ Set a class for the surface.
+
+ The surface class identifies the general class of applications
+ to which the surface belongs. A common convention is to use the
+ file name (or the full path if it is a non-standard location) of
+ the application's .desktop file as the class.
+
+
+
+
+
+
+ Ping a client to check if it is receiving events and sending
+ requests. A client is expected to reply with a pong request.
+
+
+
+
+
+
+ The configure event asks the client to resize its surface.
+
+ The size is a hint, in the sense that the client is free to
+ ignore it if it doesn't resize, pick a smaller size (to
+ satisfy aspect ratio or resize in steps of NxM pixels).
+
+ The edges parameter provides a hint about how the surface
+ was resized. The client may use this information to decide
+ how to adjust its content to the new size (e.g. a scrolling
+ area might adjust its content position to leave the viewable
+ content unmoved).
+
+ The client is free to dismiss all but the last configure
+ event it received.
+
+ The width and height arguments specify the size of the window
+ in surface-local coordinates.
+
+
+
+
+
+
+
+
+ The popup_done event is sent out when a popup grab is broken,
+ that is, when the user clicks a surface that doesn't belong
+ to the client owning the popup surface.
+
+
+
+
+
+
+ A surface is a rectangular area that may be displayed on zero
+ or more outputs, and shown any number of times at the compositor's
+ discretion. They can present wl_buffers, receive user input, and
+ define a local coordinate system.
+
+ The size of a surface (and relative positions on it) is described
+ in surface-local coordinates, which may differ from the buffer
+ coordinates of the pixel content, in case a buffer_transform
+ or a buffer_scale is used.
+
+ A surface without a "role" is fairly useless: a compositor does
+ not know where, when or how to present it. The role is the
+ purpose of a wl_surface. Examples of roles are a cursor for a
+ pointer (as set by wl_pointer.set_cursor), a drag icon
+ (wl_data_device.start_drag), a sub-surface
+ (wl_subcompositor.get_subsurface), and a window as defined by a
+ shell protocol (e.g. wl_shell.get_shell_surface).
+
+ A surface can have only one role at a time. Initially a
+ wl_surface does not have a role. Once a wl_surface is given a
+ role, it is set permanently for the whole lifetime of the
+ wl_surface object. Giving the current role again is allowed,
+ unless explicitly forbidden by the relevant interface
+ specification.
+
+ Surface roles are given by requests in other interfaces such as
+ wl_pointer.set_cursor. The request should explicitly mention
+ that this request gives a role to a wl_surface. Often, this
+ request also creates a new protocol object that represents the
+ role and adds additional functionality to wl_surface. When a
+ client wants to destroy a wl_surface, they must destroy this role
+ object before the wl_surface, otherwise a defunct_role_object error is
+ sent.
+
+ Destroying the role object does not remove the role from the
+ wl_surface, but it may stop the wl_surface from "playing the role".
+ For instance, if a wl_subsurface object is destroyed, the wl_surface
+ it was created for will be unmapped and forget its position and
+ z-order. It is allowed to create a wl_subsurface for the same
+ wl_surface again, but it is not allowed to use the wl_surface as
+ a cursor (cursor is a different role than sub-surface, and role
+ switching is not allowed).
+
+
+
+
+ These errors can be emitted in response to wl_surface requests.
+
+
+
+
+
+
+
+
+
+
+ Deletes the surface and invalidates its object ID.
+
+
+
+
+
+ Set a buffer as the content of this surface.
+
+ The new size of the surface is calculated based on the buffer
+ size transformed by the inverse buffer_transform and the
+ inverse buffer_scale. This means that at commit time the supplied
+ buffer size must be an integer multiple of the buffer_scale. If
+ that's not the case, an invalid_size error is sent.
+
+ The x and y arguments specify the location of the new pending
+ buffer's upper left corner, relative to the current buffer's upper
+ left corner, in surface-local coordinates. In other words, the
+ x and y, combined with the new surface size define in which
+ directions the surface's size changes. Setting anything other than 0
+ as x and y arguments is discouraged, and should instead be replaced
+ with using the separate wl_surface.offset request.
+
+ When the bound wl_surface version is 5 or higher, passing any
+ non-zero x or y is a protocol violation, and will result in an
+ 'invalid_offset' error being raised. The x and y arguments are ignored
+ and do not change the pending state. To achieve equivalent semantics,
+ use wl_surface.offset.
+
+ Surface contents are double-buffered state, see wl_surface.commit.
+
+ The initial surface contents are void; there is no content.
+ wl_surface.attach assigns the given wl_buffer as the pending
+ wl_buffer. wl_surface.commit makes the pending wl_buffer the new
+ surface contents, and the size of the surface becomes the size
+ calculated from the wl_buffer, as described above. After commit,
+ there is no pending buffer until the next attach.
+
+ Committing a pending wl_buffer allows the compositor to read the
+ pixels in the wl_buffer. The compositor may access the pixels at
+ any time after the wl_surface.commit request. When the compositor
+ will not access the pixels anymore, it will send the
+ wl_buffer.release event. Only after receiving wl_buffer.release,
+ the client may reuse the wl_buffer. A wl_buffer that has been
+ attached and then replaced by another attach instead of committed
+ will not receive a release event, and is not used by the
+ compositor.
+
+ If a pending wl_buffer has been committed to more than one wl_surface,
+ the delivery of wl_buffer.release events becomes undefined. A well
+ behaved client should not rely on wl_buffer.release events in this
+ case. Alternatively, a client could create multiple wl_buffer objects
+ from the same backing storage or use wp_linux_buffer_release.
+
+ Destroying the wl_buffer after wl_buffer.release does not change
+ the surface contents. Destroying the wl_buffer before wl_buffer.release
+ is allowed as long as the underlying buffer storage isn't re-used (this
+ can happen e.g. on client process termination). However, if the client
+ destroys the wl_buffer before receiving the wl_buffer.release event and
+ mutates the underlying buffer storage, the surface contents become
+ undefined immediately.
+
+ If wl_surface.attach is sent with a NULL wl_buffer, the
+ following wl_surface.commit will remove the surface content.
+
+
+
+
+
+
+
+
+ This request is used to describe the regions where the pending
+ buffer is different from the current surface contents, and where
+ the surface therefore needs to be repainted. The compositor
+ ignores the parts of the damage that fall outside of the surface.
+
+ Damage is double-buffered state, see wl_surface.commit.
+
+ The damage rectangle is specified in surface-local coordinates,
+ where x and y specify the upper left corner of the damage rectangle.
+
+ The initial value for pending damage is empty: no damage.
+ wl_surface.damage adds pending damage: the new pending damage
+ is the union of old pending damage and the given rectangle.
+
+ wl_surface.commit assigns pending damage as the current damage,
+ and clears pending damage. The server will clear the current
+ damage as it repaints the surface.
+
+ Note! New clients should not use this request. Instead damage can be
+ posted with wl_surface.damage_buffer which uses buffer coordinates
+ instead of surface coordinates.
+
+
+
+
+
+
+
+
+
+ Request a notification when it is a good time to start drawing a new
+ frame, by creating a frame callback. This is useful for throttling
+ redrawing operations, and driving animations.
+
+ When a client is animating on a wl_surface, it can use the 'frame'
+ request to get notified when it is a good time to draw and commit the
+ next frame of animation. If the client commits an update earlier than
+ that, it is likely that some updates will not make it to the display,
+ and the client is wasting resources by drawing too often.
+
+ The frame request will take effect on the next wl_surface.commit.
+ The notification will only be posted for one frame unless
+ requested again. For a wl_surface, the notifications are posted in
+ the order the frame requests were committed.
+
+ The server must send the notifications so that a client
+ will not send excessive updates, while still allowing
+ the highest possible update rate for clients that wait for the reply
+ before drawing again. The server should give some time for the client
+ to draw and commit after sending the frame callback events to let it
+ hit the next output refresh.
+
+ A server should avoid signaling the frame callbacks if the
+ surface is not visible in any way, e.g. the surface is off-screen,
+ or completely obscured by other opaque surfaces.
+
+ The object returned by this request will be destroyed by the
+ compositor after the callback is fired and as such the client must not
+ attempt to use it after that point.
+
+ The callback_data passed in the callback is the current time, in
+ milliseconds, with an undefined base.
+
+
+
+
+
+
+ This request sets the region of the surface that contains
+ opaque content.
+
+ The opaque region is an optimization hint for the compositor
+ that lets it optimize the redrawing of content behind opaque
+ regions. Setting an opaque region is not required for correct
+ behaviour, but marking transparent content as opaque will result
+ in repaint artifacts.
+
+ The opaque region is specified in surface-local coordinates.
+
+ The compositor ignores the parts of the opaque region that fall
+ outside of the surface.
+
+ Opaque region is double-buffered state, see wl_surface.commit.
+
+ wl_surface.set_opaque_region changes the pending opaque region.
+ wl_surface.commit copies the pending region to the current region.
+ Otherwise, the pending and current regions are never changed.
+
+ The initial value for an opaque region is empty. Setting the pending
+ opaque region has copy semantics, and the wl_region object can be
+ destroyed immediately. A NULL wl_region causes the pending opaque
+ region to be set to empty.
+
+
+
+
+
+
+ This request sets the region of the surface that can receive
+ pointer and touch events.
+
+ Input events happening outside of this region will try the next
+ surface in the server surface stack. The compositor ignores the
+ parts of the input region that fall outside of the surface.
+
+ The input region is specified in surface-local coordinates.
+
+ Input region is double-buffered state, see wl_surface.commit.
+
+ wl_surface.set_input_region changes the pending input region.
+ wl_surface.commit copies the pending region to the current region.
+ Otherwise the pending and current regions are never changed,
+ except cursor and icon surfaces are special cases, see
+ wl_pointer.set_cursor and wl_data_device.start_drag.
+
+ The initial value for an input region is infinite. That means the
+ whole surface will accept input. Setting the pending input region
+ has copy semantics, and the wl_region object can be destroyed
+ immediately. A NULL wl_region causes the input region to be set
+ to infinite.
+
+
+
+
+
+
+ Surface state (input, opaque, and damage regions, attached buffers,
+ etc.) is double-buffered. Protocol requests modify the pending state,
+ as opposed to the current state in use by the compositor. A commit
+ request atomically applies all pending state, replacing the current
+ state. After commit, the new pending state is as documented for each
+ related request.
+
+ On commit, a pending wl_buffer is applied first, and all other state
+ second. This means that all coordinates in double-buffered state are
+ relative to the new wl_buffer coming into use, except for
+ wl_surface.attach itself. If there is no pending wl_buffer, the
+ coordinates are relative to the current surface contents.
+
+ All requests that need a commit to become effective are documented
+ to affect double-buffered state.
+
+ Other interfaces may add further double-buffered surface state.
+
+
+
+
+
+ This is emitted whenever a surface's creation, movement, or resizing
+ results in some part of it being within the scanout region of an
+ output.
+
+ Note that a surface may be overlapping with zero or more outputs.
+
+
+
+
+
+
+ This is emitted whenever a surface's creation, movement, or resizing
+ results in it no longer having any part of it within the scanout region
+ of an output.
+
+ Clients should not use the number of outputs the surface is on for frame
+ throttling purposes. The surface might be hidden even if no leave event
+ has been sent, and the compositor might expect new surface content
+ updates even if no enter event has been sent. The frame event should be
+ used instead.
+
+
+
+
+
+
+
+
+ This request sets an optional transformation on how the compositor
+ interprets the contents of the buffer attached to the surface. The
+ accepted values for the transform parameter are the values for
+ wl_output.transform.
+
+ Buffer transform is double-buffered state, see wl_surface.commit.
+
+ A newly created surface has its buffer transformation set to normal.
+
+ wl_surface.set_buffer_transform changes the pending buffer
+ transformation. wl_surface.commit copies the pending buffer
+ transformation to the current one. Otherwise, the pending and current
+ values are never changed.
+
+ The purpose of this request is to allow clients to render content
+ according to the output transform, thus permitting the compositor to
+ use certain optimizations even if the display is rotated. Using
+ hardware overlays and scanning out a client buffer for fullscreen
+ surfaces are examples of such optimizations. Those optimizations are
+ highly dependent on the compositor implementation, so the use of this
+ request should be considered on a case-by-case basis.
+
+ Note that if the transform value includes 90 or 270 degree rotation,
+ the width of the buffer will become the surface height and the height
+ of the buffer will become the surface width.
+
+ If transform is not one of the values from the
+ wl_output.transform enum the invalid_transform protocol error
+ is raised.
+
+
+
+
+
+
+
+
+ This request sets an optional scaling factor on how the compositor
+ interprets the contents of the buffer attached to the window.
+
+ Buffer scale is double-buffered state, see wl_surface.commit.
+
+ A newly created surface has its buffer scale set to 1.
+
+ wl_surface.set_buffer_scale changes the pending buffer scale.
+ wl_surface.commit copies the pending buffer scale to the current one.
+ Otherwise, the pending and current values are never changed.
+
+ The purpose of this request is to allow clients to supply higher
+ resolution buffer data for use on high resolution outputs. It is
+ intended that you pick the same buffer scale as the scale of the
+ output that the surface is displayed on. This means the compositor
+ can avoid scaling when rendering the surface on that output.
+
+ Note that if the scale is larger than 1, then you have to attach
+ a buffer that is larger (by a factor of scale in each dimension)
+ than the desired surface size.
+
+ If scale is not positive the invalid_scale protocol error is
+ raised.
+
+
+
+
+
+
+
+ This request is used to describe the regions where the pending
+ buffer is different from the current surface contents, and where
+ the surface therefore needs to be repainted. The compositor
+ ignores the parts of the damage that fall outside of the surface.
+
+ Damage is double-buffered state, see wl_surface.commit.
+
+ The damage rectangle is specified in buffer coordinates,
+ where x and y specify the upper left corner of the damage rectangle.
+
+ The initial value for pending damage is empty: no damage.
+ wl_surface.damage_buffer adds pending damage: the new pending
+ damage is the union of old pending damage and the given rectangle.
+
+ wl_surface.commit assigns pending damage as the current damage,
+ and clears pending damage. The server will clear the current
+ damage as it repaints the surface.
+
+ This request differs from wl_surface.damage in only one way - it
+ takes damage in buffer coordinates instead of surface-local
+ coordinates. While this generally is more intuitive than surface
+ coordinates, it is especially desirable when using wp_viewport
+ or when a drawing library (like EGL) is unaware of buffer scale
+ and buffer transform.
+
+ Note: Because buffer transformation changes and damage requests may
+ be interleaved in the protocol stream, it is impossible to determine
+ the actual mapping between surface and buffer damage until
+ wl_surface.commit time. Therefore, compositors wishing to take both
+ kinds of damage into account will have to accumulate damage from the
+ two requests separately and only transform from one to the other
+ after receiving the wl_surface.commit.
+
+
+
+
+
+
+
+
+
+
+
+ The x and y arguments specify the location of the new pending
+ buffer's upper left corner, relative to the current buffer's upper
+ left corner, in surface-local coordinates. In other words, the
+ x and y, combined with the new surface size define in which
+ directions the surface's size changes.
+
+ Surface location offset is double-buffered state, see
+ wl_surface.commit.
+
+ This request is semantically equivalent to and the replaces the x and y
+ arguments in the wl_surface.attach request in wl_surface versions prior
+ to 5. See wl_surface.attach for details.
+
+
+
+
+
+
+
+
+
+ This event indicates the preferred buffer scale for this surface. It is
+ sent whenever the compositor's preference changes.
+
+ It is intended that scaling aware clients use this event to scale their
+ content and use wl_surface.set_buffer_scale to indicate the scale they
+ have rendered with. This allows clients to supply a higher detail
+ buffer.
+
+
+
+
+
+
+ This event indicates the preferred buffer transform for this surface.
+ It is sent whenever the compositor's preference changes.
+
+ It is intended that transform aware clients use this event to apply the
+ transform to their content and use wl_surface.set_buffer_transform to
+ indicate the transform they have rendered with.
+
+
+
+
+
+
+
+ A seat is a group of keyboards, pointer and touch devices. This
+ object is published as a global during start up, or when such a
+ device is hot plugged. A seat typically has a pointer and
+ maintains a keyboard focus and a pointer focus.
+
+
+
+
+ This is a bitmask of capabilities this seat has; if a member is
+ set, then it is present on the seat.
+
+
+
+
+
+
+
+
+ These errors can be emitted in response to wl_seat requests.
+
+
+
+
+
+
+ This is emitted whenever a seat gains or loses the pointer,
+ keyboard or touch capabilities. The argument is a capability
+ enum containing the complete set of capabilities this seat has.
+
+ When the pointer capability is added, a client may create a
+ wl_pointer object using the wl_seat.get_pointer request. This object
+ will receive pointer events until the capability is removed in the
+ future.
+
+ When the pointer capability is removed, a client should destroy the
+ wl_pointer objects associated with the seat where the capability was
+ removed, using the wl_pointer.release request. No further pointer
+ events will be received on these objects.
+
+ In some compositors, if a seat regains the pointer capability and a
+ client has a previously obtained wl_pointer object of version 4 or
+ less, that object may start sending pointer events again. This
+ behavior is considered a misinterpretation of the intended behavior
+ and must not be relied upon by the client. wl_pointer objects of
+ version 5 or later must not send events if created before the most
+ recent event notifying the client of an added pointer capability.
+
+ The above behavior also applies to wl_keyboard and wl_touch with the
+ keyboard and touch capabilities, respectively.
+
+
+
+
+
+
+ The ID provided will be initialized to the wl_pointer interface
+ for this seat.
+
+ This request only takes effect if the seat has the pointer
+ capability, or has had the pointer capability in the past.
+ It is a protocol violation to issue this request on a seat that has
+ never had the pointer capability. The missing_capability error will
+ be sent in this case.
+
+
+
+
+
+
+ The ID provided will be initialized to the wl_keyboard interface
+ for this seat.
+
+ This request only takes effect if the seat has the keyboard
+ capability, or has had the keyboard capability in the past.
+ It is a protocol violation to issue this request on a seat that has
+ never had the keyboard capability. The missing_capability error will
+ be sent in this case.
+
+
+
+
+
+
+ The ID provided will be initialized to the wl_touch interface
+ for this seat.
+
+ This request only takes effect if the seat has the touch
+ capability, or has had the touch capability in the past.
+ It is a protocol violation to issue this request on a seat that has
+ never had the touch capability. The missing_capability error will
+ be sent in this case.
+
+
+
+
+
+
+
+
+ In a multi-seat configuration the seat name can be used by clients to
+ help identify which physical devices the seat represents.
+
+ The seat name is a UTF-8 string with no convention defined for its
+ contents. Each name is unique among all wl_seat globals. The name is
+ only guaranteed to be unique for the current compositor instance.
+
+ The same seat names are used for all clients. Thus, the name can be
+ shared across processes to refer to a specific wl_seat global.
+
+ The name event is sent after binding to the seat global. This event is
+ only sent once per seat object, and the name does not change over the
+ lifetime of the wl_seat global.
+
+ Compositors may re-use the same seat name if the wl_seat global is
+ destroyed and re-created later.
+
+
+
+
+
+
+
+
+ Using this request a client can tell the server that it is not going to
+ use the seat object anymore.
+
+
+
+
+
+
+
+ The wl_pointer interface represents one or more input devices,
+ such as mice, which control the pointer location and pointer_focus
+ of a seat.
+
+ The wl_pointer interface generates motion, enter and leave
+ events for the surfaces that the pointer is located over,
+ and button and axis events for button presses, button releases
+ and scrolling.
+
+
+
+
+
+
+
+
+ Set the pointer surface, i.e., the surface that contains the
+ pointer image (cursor). This request gives the surface the role
+ of a cursor. If the surface already has another role, it raises
+ a protocol error.
+
+ The cursor actually changes only if the pointer
+ focus for this device is one of the requesting client's surfaces
+ or the surface parameter is the current pointer surface. If
+ there was a previous surface set with this request it is
+ replaced. If surface is NULL, the pointer image is hidden.
+
+ The parameters hotspot_x and hotspot_y define the position of
+ the pointer surface relative to the pointer location. Its
+ top-left corner is always at (x, y) - (hotspot_x, hotspot_y),
+ where (x, y) are the coordinates of the pointer location, in
+ surface-local coordinates.
+
+ On surface.attach requests to the pointer surface, hotspot_x
+ and hotspot_y are decremented by the x and y parameters
+ passed to the request. Attach must be confirmed by
+ wl_surface.commit as usual.
+
+ The hotspot can also be updated by passing the currently set
+ pointer surface to this request with new values for hotspot_x
+ and hotspot_y.
+
+ The input region is ignored for wl_surfaces with the role of
+ a cursor. When the use as a cursor ends, the wl_surface is
+ unmapped.
+
+ The serial parameter must match the latest wl_pointer.enter
+ serial number sent to the client. Otherwise the request will be
+ ignored.
+
+
+
+
+
+
+
+
+
+ Notification that this seat's pointer is focused on a certain
+ surface.
+
+ When a seat's focus enters a surface, the pointer image
+ is undefined and a client should respond to this event by setting
+ an appropriate pointer image with the set_cursor request.
+
+
+
+
+
+
+
+
+
+ Notification that this seat's pointer is no longer focused on
+ a certain surface.
+
+ The leave notification is sent before the enter notification
+ for the new focus.
+
+
+
+
+
+
+
+ Notification of pointer location change. The arguments
+ surface_x and surface_y are the location relative to the
+ focused surface.
+
+
+
+
+
+
+
+
+ Describes the physical state of a button that produced the button
+ event.
+
+
+
+
+
+
+
+ Mouse button click and release notifications.
+
+ The location of the click is given by the last motion or
+ enter event.
+ The time argument is a timestamp with millisecond
+ granularity, with an undefined base.
+
+ The button is a button code as defined in the Linux kernel's
+ linux/input-event-codes.h header file, e.g. BTN_LEFT.
+
+ Any 16-bit button code value is reserved for future additions to the
+ kernel's event code list. All other button codes above 0xFFFF are
+ currently undefined but may be used in future versions of this
+ protocol.
+
+
+
+
+
+
+
+
+
+ Describes the axis types of scroll events.
+
+
+
+
+
+
+
+ Scroll and other axis notifications.
+
+ For scroll events (vertical and horizontal scroll axes), the
+ value parameter is the length of a vector along the specified
+ axis in a coordinate space identical to those of motion events,
+ representing a relative movement along the specified axis.
+
+ For devices that support movements non-parallel to axes multiple
+ axis events will be emitted.
+
+ When applicable, for example for touch pads, the server can
+ choose to emit scroll events where the motion vector is
+ equivalent to a motion event vector.
+
+ When applicable, a client can transform its content relative to the
+ scroll distance.
+
+
+
+
+
+
+
+
+
+
+ Using this request a client can tell the server that it is not going to
+ use the pointer object anymore.
+
+ This request destroys the pointer proxy object, so clients must not call
+ wl_pointer_destroy() after using this request.
+
+
+
+
+
+
+
+ Indicates the end of a set of events that logically belong together.
+ A client is expected to accumulate the data in all events within the
+ frame before proceeding.
+
+ All wl_pointer events before a wl_pointer.frame event belong
+ logically together. For example, in a diagonal scroll motion the
+ compositor will send an optional wl_pointer.axis_source event, two
+ wl_pointer.axis events (horizontal and vertical) and finally a
+ wl_pointer.frame event. The client may use this information to
+ calculate a diagonal vector for scrolling.
+
+ When multiple wl_pointer.axis events occur within the same frame,
+ the motion vector is the combined motion of all events.
+ When a wl_pointer.axis and a wl_pointer.axis_stop event occur within
+ the same frame, this indicates that axis movement in one axis has
+ stopped but continues in the other axis.
+ When multiple wl_pointer.axis_stop events occur within the same
+ frame, this indicates that these axes stopped in the same instance.
+
+ A wl_pointer.frame event is sent for every logical event group,
+ even if the group only contains a single wl_pointer event.
+ Specifically, a client may get a sequence: motion, frame, button,
+ frame, axis, frame, axis_stop, frame.
+
+ The wl_pointer.enter and wl_pointer.leave events are logical events
+ generated by the compositor and not the hardware. These events are
+ also grouped by a wl_pointer.frame. When a pointer moves from one
+ surface to another, a compositor should group the
+ wl_pointer.leave event within the same wl_pointer.frame.
+ However, a client must not rely on wl_pointer.leave and
+ wl_pointer.enter being in the same wl_pointer.frame.
+ Compositor-specific policies may require the wl_pointer.leave and
+ wl_pointer.enter event being split across multiple wl_pointer.frame
+ groups.
+
+
+
+
+
+ Describes the source types for axis events. This indicates to the
+ client how an axis event was physically generated; a client may
+ adjust the user interface accordingly. For example, scroll events
+ from a "finger" source may be in a smooth coordinate space with
+ kinetic scrolling whereas a "wheel" source may be in discrete steps
+ of a number of lines.
+
+ The "continuous" axis source is a device generating events in a
+ continuous coordinate space, but using something other than a
+ finger. One example for this source is button-based scrolling where
+ the vertical motion of a device is converted to scroll events while
+ a button is held down.
+
+ The "wheel tilt" axis source indicates that the actual device is a
+ wheel but the scroll event is not caused by a rotation but a
+ (usually sideways) tilt of the wheel.
+
+
+
+
+
+
+
+
+
+ Source information for scroll and other axes.
+
+ This event does not occur on its own. It is sent before a
+ wl_pointer.frame event and carries the source information for
+ all events within that frame.
+
+ The source specifies how this event was generated. If the source is
+ wl_pointer.axis_source.finger, a wl_pointer.axis_stop event will be
+ sent when the user lifts the finger off the device.
+
+ If the source is wl_pointer.axis_source.wheel,
+ wl_pointer.axis_source.wheel_tilt or
+ wl_pointer.axis_source.continuous, a wl_pointer.axis_stop event may
+ or may not be sent. Whether a compositor sends an axis_stop event
+ for these sources is hardware-specific and implementation-dependent;
+ clients must not rely on receiving an axis_stop event for these
+ scroll sources and should treat scroll sequences from these scroll
+ sources as unterminated by default.
+
+ This event is optional. If the source is unknown for a particular
+ axis event sequence, no event is sent.
+ Only one wl_pointer.axis_source event is permitted per frame.
+
+ The order of wl_pointer.axis_discrete and wl_pointer.axis_source is
+ not guaranteed.
+
+
+
+
+
+
+ Stop notification for scroll and other axes.
+
+ For some wl_pointer.axis_source types, a wl_pointer.axis_stop event
+ is sent to notify a client that the axis sequence has terminated.
+ This enables the client to implement kinetic scrolling.
+ See the wl_pointer.axis_source documentation for information on when
+ this event may be generated.
+
+ Any wl_pointer.axis events with the same axis_source after this
+ event should be considered as the start of a new axis motion.
+
+ The timestamp is to be interpreted identical to the timestamp in the
+ wl_pointer.axis event. The timestamp value may be the same as a
+ preceding wl_pointer.axis event.
+
+
+
+
+
+
+
+ Discrete step information for scroll and other axes.
+
+ This event carries the axis value of the wl_pointer.axis event in
+ discrete steps (e.g. mouse wheel clicks).
+
+ This event is deprecated with wl_pointer version 8 - this event is not
+ sent to clients supporting version 8 or later.
+
+ This event does not occur on its own, it is coupled with a
+ wl_pointer.axis event that represents this axis value on a
+ continuous scale. The protocol guarantees that each axis_discrete
+ event is always followed by exactly one axis event with the same
+ axis number within the same wl_pointer.frame. Note that the protocol
+ allows for other events to occur between the axis_discrete and
+ its coupled axis event, including other axis_discrete or axis
+ events. A wl_pointer.frame must not contain more than one axis_discrete
+ event per axis type.
+
+ This event is optional; continuous scrolling devices
+ like two-finger scrolling on touchpads do not have discrete
+ steps and do not generate this event.
+
+ The discrete value carries the directional information. e.g. a value
+ of -2 is two steps towards the negative direction of this axis.
+
+ The axis number is identical to the axis number in the associated
+ axis event.
+
+ The order of wl_pointer.axis_discrete and wl_pointer.axis_source is
+ not guaranteed.
+
+
+
+
+
+
+
+ Discrete high-resolution scroll information.
+
+ This event carries high-resolution wheel scroll information,
+ with each multiple of 120 representing one logical scroll step
+ (a wheel detent). For example, an axis_value120 of 30 is one quarter of
+ a logical scroll step in the positive direction, a value120 of
+ -240 are two logical scroll steps in the negative direction within the
+ same hardware event.
+ Clients that rely on discrete scrolling should accumulate the
+ value120 to multiples of 120 before processing the event.
+
+ The value120 must not be zero.
+
+ This event replaces the wl_pointer.axis_discrete event in clients
+ supporting wl_pointer version 8 or later.
+
+ Where a wl_pointer.axis_source event occurs in the same
+ wl_pointer.frame, the axis source applies to this event.
+
+ The order of wl_pointer.axis_value120 and wl_pointer.axis_source is
+ not guaranteed.
+
+
+
+
+
+
+
+
+
+ This specifies the direction of the physical motion that caused a
+ wl_pointer.axis event, relative to the wl_pointer.axis direction.
+
+
+
+
+
+
+
+ Relative directional information of the entity causing the axis
+ motion.
+
+ For a wl_pointer.axis event, the wl_pointer.axis_relative_direction
+ event specifies the movement direction of the entity causing the
+ wl_pointer.axis event. For example:
+ - if a user's fingers on a touchpad move down and this
+ causes a wl_pointer.axis vertical_scroll down event, the physical
+ direction is 'identical'
+ - if a user's fingers on a touchpad move down and this causes a
+ wl_pointer.axis vertical_scroll up scroll up event ('natural
+ scrolling'), the physical direction is 'inverted'.
+
+ A client may use this information to adjust scroll motion of
+ components. Specifically, enabling natural scrolling causes the
+ content to change direction compared to traditional scrolling.
+ Some widgets like volume control sliders should usually match the
+ physical direction regardless of whether natural scrolling is
+ active. This event enables clients to match the scroll direction of
+ a widget to the physical direction.
+
+ This event does not occur on its own, it is coupled with a
+ wl_pointer.axis event that represents this axis value.
+ The protocol guarantees that each axis_relative_direction event is
+ always followed by exactly one axis event with the same
+ axis number within the same wl_pointer.frame. Note that the protocol
+ allows for other events to occur between the axis_relative_direction
+ and its coupled axis event.
+
+ The axis number is identical to the axis number in the associated
+ axis event.
+
+ The order of wl_pointer.axis_relative_direction,
+ wl_pointer.axis_discrete and wl_pointer.axis_source is not
+ guaranteed.
+
+
+
+
+
+
+
+
+ The wl_keyboard interface represents one or more keyboards
+ associated with a seat.
+
+
+
+
+ This specifies the format of the keymap provided to the
+ client with the wl_keyboard.keymap event.
+
+
+
+
+
+
+
+ This event provides a file descriptor to the client which can be
+ memory-mapped in read-only mode to provide a keyboard mapping
+ description.
+
+ From version 7 onwards, the fd must be mapped with MAP_PRIVATE by
+ the recipient, as MAP_SHARED may fail.
+
+
+
+
+
+
+
+
+ Notification that this seat's keyboard focus is on a certain
+ surface.
+
+ The compositor must send the wl_keyboard.modifiers event after this
+ event.
+
+
+
+
+
+
+
+
+ Notification that this seat's keyboard focus is no longer on
+ a certain surface.
+
+ The leave notification is sent before the enter notification
+ for the new focus.
+
+ After this event client must assume that all keys, including modifiers,
+ are lifted and also it must stop key repeating if there's some going on.
+
+
+
+
+
+
+
+ Describes the physical state of a key that produced the key event.
+
+
+
+
+
+
+
+ A key was pressed or released.
+ The time argument is a timestamp with millisecond
+ granularity, with an undefined base.
+
+ The key is a platform-specific key code that can be interpreted
+ by feeding it to the keyboard mapping (see the keymap event).
+
+ If this event produces a change in modifiers, then the resulting
+ wl_keyboard.modifiers event must be sent after this event.
+
+
+
+
+
+
+
+
+
+ Notifies clients that the modifier and/or group state has
+ changed, and it should update its local state.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Informs the client about the keyboard's repeat rate and delay.
+
+ This event is sent as soon as the wl_keyboard object has been created,
+ and is guaranteed to be received by the client before any key press
+ event.
+
+ Negative values for either rate or delay are illegal. A rate of zero
+ will disable any repeating (regardless of the value of delay).
+
+ This event can be sent later on as well with a new value if necessary,
+ so clients should continue listening for the event past the creation
+ of wl_keyboard.
+
+
+
+
+
+
+
+
+ The wl_touch interface represents a touchscreen
+ associated with a seat.
+
+ Touch interactions can consist of one or more contacts.
+ For each contact, a series of events is generated, starting
+ with a down event, followed by zero or more motion events,
+ and ending with an up event. Events relating to the same
+ contact point can be identified by the ID of the sequence.
+
+
+
+
+ A new touch point has appeared on the surface. This touch point is
+ assigned a unique ID. Future events from this touch point reference
+ this ID. The ID ceases to be valid after a touch up event and may be
+ reused in the future.
+
+
+
+
+
+
+
+
+
+
+
+ The touch point has disappeared. No further events will be sent for
+ this touch point and the touch point's ID is released and may be
+ reused in a future touch down event.
+
+
+
+
+
+
+
+
+ A touch point has changed coordinates.
+
+
+
+
+
+
+
+
+
+ Indicates the end of a set of events that logically belong together.
+ A client is expected to accumulate the data in all events within the
+ frame before proceeding.
+
+ A wl_touch.frame terminates at least one event but otherwise no
+ guarantee is provided about the set of events within a frame. A client
+ must assume that any state not updated in a frame is unchanged from the
+ previously known state.
+
+
+
+
+
+ Sent if the compositor decides the touch stream is a global
+ gesture. No further events are sent to the clients from that
+ particular gesture. Touch cancellation applies to all touch points
+ currently active on this client's surface. The client is
+ responsible for finalizing the touch points, future touch points on
+ this surface may reuse the touch point ID.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Sent when a touchpoint has changed its shape.
+
+ This event does not occur on its own. It is sent before a
+ wl_touch.frame event and carries the new shape information for
+ any previously reported, or new touch points of that frame.
+
+ Other events describing the touch point such as wl_touch.down,
+ wl_touch.motion or wl_touch.orientation may be sent within the
+ same wl_touch.frame. A client should treat these events as a single
+ logical touch point update. The order of wl_touch.shape,
+ wl_touch.orientation and wl_touch.motion is not guaranteed.
+ A wl_touch.down event is guaranteed to occur before the first
+ wl_touch.shape event for this touch ID but both events may occur within
+ the same wl_touch.frame.
+
+ A touchpoint shape is approximated by an ellipse through the major and
+ minor axis length. The major axis length describes the longer diameter
+ of the ellipse, while the minor axis length describes the shorter
+ diameter. Major and minor are orthogonal and both are specified in
+ surface-local coordinates. The center of the ellipse is always at the
+ touchpoint location as reported by wl_touch.down or wl_touch.move.
+
+ This event is only sent by the compositor if the touch device supports
+ shape reports. The client has to make reasonable assumptions about the
+ shape if it did not receive this event.
+
+
+
+
+
+
+
+
+ Sent when a touchpoint has changed its orientation.
+
+ This event does not occur on its own. It is sent before a
+ wl_touch.frame event and carries the new shape information for
+ any previously reported, or new touch points of that frame.
+
+ Other events describing the touch point such as wl_touch.down,
+ wl_touch.motion or wl_touch.shape may be sent within the
+ same wl_touch.frame. A client should treat these events as a single
+ logical touch point update. The order of wl_touch.shape,
+ wl_touch.orientation and wl_touch.motion is not guaranteed.
+ A wl_touch.down event is guaranteed to occur before the first
+ wl_touch.orientation event for this touch ID but both events may occur
+ within the same wl_touch.frame.
+
+ The orientation describes the clockwise angle of a touchpoint's major
+ axis to the positive surface y-axis and is normalized to the -180 to
+ +180 degree range. The granularity of orientation depends on the touch
+ device, some devices only support binary rotation values between 0 and
+ 90 degrees.
+
+ This event is only sent by the compositor if the touch device supports
+ orientation reports.
+
+
+
+
+
+
+
+
+ An output describes part of the compositor geometry. The
+ compositor works in the 'compositor coordinate system' and an
+ output corresponds to a rectangular area in that space that is
+ actually visible. This typically corresponds to a monitor that
+ displays part of the compositor space. This object is published
+ as global during start up, or when a monitor is hotplugged.
+
+
+
+
+ This enumeration describes how the physical
+ pixels on an output are laid out.
+
+
+
+
+
+
+
+
+
+
+
+ This describes the transform that a compositor will apply to a
+ surface to compensate for the rotation or mirroring of an
+ output device.
+
+ The flipped values correspond to an initial flip around a
+ vertical axis followed by rotation.
+
+ The purpose is mainly to allow clients to render accordingly and
+ tell the compositor, so that for fullscreen surfaces, the
+ compositor will still be able to scan out directly from client
+ surfaces.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The geometry event describes geometric properties of the output.
+ The event is sent when binding to the output object and whenever
+ any of the properties change.
+
+ The physical size can be set to zero if it doesn't make sense for this
+ output (e.g. for projectors or virtual outputs).
+
+ The geometry event will be followed by a done event (starting from
+ version 2).
+
+ Note: wl_output only advertises partial information about the output
+ position and identification. Some compositors, for instance those not
+ implementing a desktop-style output layout or those exposing virtual
+ outputs, might fake this information. Instead of using x and y, clients
+ should use xdg_output.logical_position. Instead of using make and model,
+ clients should use name and description.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ These flags describe properties of an output mode.
+ They are used in the flags bitfield of the mode event.
+
+
+
+
+
+
+
+ The mode event describes an available mode for the output.
+
+ The event is sent when binding to the output object and there
+ will always be one mode, the current mode. The event is sent
+ again if an output changes mode, for the mode that is now
+ current. In other words, the current mode is always the last
+ mode that was received with the current flag set.
+
+ Non-current modes are deprecated. A compositor can decide to only
+ advertise the current mode and never send other modes. Clients
+ should not rely on non-current modes.
+
+ The size of a mode is given in physical hardware units of
+ the output device. This is not necessarily the same as
+ the output size in the global compositor space. For instance,
+ the output may be scaled, as described in wl_output.scale,
+ or transformed, as described in wl_output.transform. Clients
+ willing to retrieve the output size in the global compositor
+ space should use xdg_output.logical_size instead.
+
+ The vertical refresh rate can be set to zero if it doesn't make
+ sense for this output (e.g. for virtual outputs).
+
+ The mode event will be followed by a done event (starting from
+ version 2).
+
+ Clients should not use the refresh rate to schedule frames. Instead,
+ they should use the wl_surface.frame event or the presentation-time
+ protocol.
+
+ Note: this information is not always meaningful for all outputs. Some
+ compositors, such as those exposing virtual outputs, might fake the
+ refresh rate or the size.
+
+
+
+
+
+
+
+
+
+
+
+ This event is sent after all other properties have been
+ sent after binding to the output object and after any
+ other property changes done after that. This allows
+ changes to the output properties to be seen as
+ atomic, even if they happen via multiple events.
+
+
+
+
+
+ This event contains scaling geometry information
+ that is not in the geometry event. It may be sent after
+ binding the output object or if the output scale changes
+ later. If it is not sent, the client should assume a
+ scale of 1.
+
+ A scale larger than 1 means that the compositor will
+ automatically scale surface buffers by this amount
+ when rendering. This is used for very high resolution
+ displays where applications rendering at the native
+ resolution would be too small to be legible.
+
+ It is intended that scaling aware clients track the
+ current output of a surface, and if it is on a scaled
+ output it should use wl_surface.set_buffer_scale with
+ the scale of the output. That way the compositor can
+ avoid scaling the surface, and the client can supply
+ a higher detail image.
+
+ The scale event will be followed by a done event.
+
+
+
+
+
+
+
+
+ Using this request a client can tell the server that it is not going to
+ use the output object anymore.
+
+
+
+
+
+
+
+ Many compositors will assign user-friendly names to their outputs, show
+ them to the user, allow the user to refer to an output, etc. The client
+ may wish to know this name as well to offer the user similar behaviors.
+
+ The name is a UTF-8 string with no convention defined for its contents.
+ Each name is unique among all wl_output globals. The name is only
+ guaranteed to be unique for the compositor instance.
+
+ The same output name is used for all clients for a given wl_output
+ global. Thus, the name can be shared across processes to refer to a
+ specific wl_output global.
+
+ The name is not guaranteed to be persistent across sessions, thus cannot
+ be used to reliably identify an output in e.g. configuration files.
+
+ Examples of names include 'HDMI-A-1', 'WL-1', 'X11-1', etc. However, do
+ not assume that the name is a reflection of an underlying DRM connector,
+ X11 connection, etc.
+
+ The name event is sent after binding the output object. This event is
+ only sent once per output object, and the name does not change over the
+ lifetime of the wl_output global.
+
+ Compositors may re-use the same output name if the wl_output global is
+ destroyed and re-created later. Compositors should avoid re-using the
+ same name if possible.
+
+ The name event will be followed by a done event.
+
+
+
+
+
+
+ Many compositors can produce human-readable descriptions of their
+ outputs. The client may wish to know this description as well, e.g. for
+ output selection purposes.
+
+ The description is a UTF-8 string with no convention defined for its
+ contents. The description is not guaranteed to be unique among all
+ wl_output globals. Examples might include 'Foocorp 11" Display' or
+ 'Virtual X11 output via :1'.
+
+ The description event is sent after binding the output object and
+ whenever the description changes. The description is optional, and may
+ not be sent at all.
+
+ The description event will be followed by a done event.
+
+
+
+
+
+
+
+ A region object describes an area.
+
+ Region objects are used to describe the opaque and input
+ regions of a surface.
+
+
+
+
+ Destroy the region. This will invalidate the object ID.
+
+
+
+
+
+ Add the specified rectangle to the region.
+
+
+
+
+
+
+
+
+
+ Subtract the specified rectangle from the region.
+
+
+
+
+
+
+
+
+
+
+ The global interface exposing sub-surface compositing capabilities.
+ A wl_surface, that has sub-surfaces associated, is called the
+ parent surface. Sub-surfaces can be arbitrarily nested and create
+ a tree of sub-surfaces.
+
+ The root surface in a tree of sub-surfaces is the main
+ surface. The main surface cannot be a sub-surface, because
+ sub-surfaces must always have a parent.
+
+ A main surface with its sub-surfaces forms a (compound) window.
+ For window management purposes, this set of wl_surface objects is
+ to be considered as a single window, and it should also behave as
+ such.
+
+ The aim of sub-surfaces is to offload some of the compositing work
+ within a window from clients to the compositor. A prime example is
+ a video player with decorations and video in separate wl_surface
+ objects. This should allow the compositor to pass YUV video buffer
+ processing to dedicated overlay hardware when possible.
+
+
+
+
+ Informs the server that the client will not be using this
+ protocol object anymore. This does not affect any other
+ objects, wl_subsurface objects included.
+
+
+
+
+
+
+
+
+
+
+ Create a sub-surface interface for the given surface, and
+ associate it with the given parent surface. This turns a
+ plain wl_surface into a sub-surface.
+
+ The to-be sub-surface must not already have another role, and it
+ must not have an existing wl_subsurface object. Otherwise the
+ bad_surface protocol error is raised.
+
+ Adding sub-surfaces to a parent is a double-buffered operation on the
+ parent (see wl_surface.commit). The effect of adding a sub-surface
+ becomes visible on the next time the state of the parent surface is
+ applied.
+
+ The parent surface must not be one of the child surface's descendants,
+ and the parent must be different from the child surface, otherwise the
+ bad_parent protocol error is raised.
+
+ This request modifies the behaviour of wl_surface.commit request on
+ the sub-surface, see the documentation on wl_subsurface interface.
+
+
+
+
+
+
+
+
+
+ An additional interface to a wl_surface object, which has been
+ made a sub-surface. A sub-surface has one parent surface. A
+ sub-surface's size and position are not limited to that of the parent.
+ Particularly, a sub-surface is not automatically clipped to its
+ parent's area.
+
+ A sub-surface becomes mapped, when a non-NULL wl_buffer is applied
+ and the parent surface is mapped. The order of which one happens
+ first is irrelevant. A sub-surface is hidden if the parent becomes
+ hidden, or if a NULL wl_buffer is applied. These rules apply
+ recursively through the tree of surfaces.
+
+ The behaviour of a wl_surface.commit request on a sub-surface
+ depends on the sub-surface's mode. The possible modes are
+ synchronized and desynchronized, see methods
+ wl_subsurface.set_sync and wl_subsurface.set_desync. Synchronized
+ mode caches the wl_surface state to be applied when the parent's
+ state gets applied, and desynchronized mode applies the pending
+ wl_surface state directly. A sub-surface is initially in the
+ synchronized mode.
+
+ Sub-surfaces also have another kind of state, which is managed by
+ wl_subsurface requests, as opposed to wl_surface requests. This
+ state includes the sub-surface position relative to the parent
+ surface (wl_subsurface.set_position), and the stacking order of
+ the parent and its sub-surfaces (wl_subsurface.place_above and
+ .place_below). This state is applied when the parent surface's
+ wl_surface state is applied, regardless of the sub-surface's mode.
+ As the exception, set_sync and set_desync are effective immediately.
+
+ The main surface can be thought to be always in desynchronized mode,
+ since it does not have a parent in the sub-surfaces sense.
+
+ Even if a sub-surface is in desynchronized mode, it will behave as
+ in synchronized mode, if its parent surface behaves as in
+ synchronized mode. This rule is applied recursively throughout the
+ tree of surfaces. This means, that one can set a sub-surface into
+ synchronized mode, and then assume that all its child and grand-child
+ sub-surfaces are synchronized, too, without explicitly setting them.
+
+ Destroying a sub-surface takes effect immediately. If you need to
+ synchronize the removal of a sub-surface to the parent surface update,
+ unmap the sub-surface first by attaching a NULL wl_buffer, update parent,
+ and then destroy the sub-surface.
+
+ If the parent wl_surface object is destroyed, the sub-surface is
+ unmapped.
+
+
+
+
+ The sub-surface interface is removed from the wl_surface object
+ that was turned into a sub-surface with a
+ wl_subcompositor.get_subsurface request. The wl_surface's association
+ to the parent is deleted. The wl_surface is unmapped immediately.
+
+
+
+
+
+
+
+
+
+ This schedules a sub-surface position change.
+ The sub-surface will be moved so that its origin (top left
+ corner pixel) will be at the location x, y of the parent surface
+ coordinate system. The coordinates are not restricted to the parent
+ surface area. Negative values are allowed.
+
+ The scheduled coordinates will take effect whenever the state of the
+ parent surface is applied. When this happens depends on whether the
+ parent surface is in synchronized mode or not. See
+ wl_subsurface.set_sync and wl_subsurface.set_desync for details.
+
+ If more than one set_position request is invoked by the client before
+ the commit of the parent surface, the position of a new request always
+ replaces the scheduled position from any previous request.
+
+ The initial position is 0, 0.
+
+
+
+
+
+
+
+ This sub-surface is taken from the stack, and put back just
+ above the reference surface, changing the z-order of the sub-surfaces.
+ The reference surface must be one of the sibling surfaces, or the
+ parent surface. Using any other surface, including this sub-surface,
+ will cause a protocol error.
+
+ The z-order is double-buffered. Requests are handled in order and
+ applied immediately to a pending state. The final pending state is
+ copied to the active state the next time the state of the parent
+ surface is applied. When this happens depends on whether the parent
+ surface is in synchronized mode or not. See wl_subsurface.set_sync and
+ wl_subsurface.set_desync for details.
+
+ A new sub-surface is initially added as the top-most in the stack
+ of its siblings and parent.
+
+
+
+
+
+
+ The sub-surface is placed just below the reference surface.
+ See wl_subsurface.place_above.
+
+
+
+
+
+
+ Change the commit behaviour of the sub-surface to synchronized
+ mode, also described as the parent dependent mode.
+
+ In synchronized mode, wl_surface.commit on a sub-surface will
+ accumulate the committed state in a cache, but the state will
+ not be applied and hence will not change the compositor output.
+ The cached state is applied to the sub-surface immediately after
+ the parent surface's state is applied. This ensures atomic
+ updates of the parent and all its synchronized sub-surfaces.
+ Applying the cached state will invalidate the cache, so further
+ parent surface commits do not (re-)apply old state.
+
+ See wl_subsurface for the recursive effect of this mode.
+
+
+
+
+
+ Change the commit behaviour of the sub-surface to desynchronized
+ mode, also described as independent or freely running mode.
+
+ In desynchronized mode, wl_surface.commit on a sub-surface will
+ apply the pending state directly, without caching, as happens
+ normally with a wl_surface. Calling wl_surface.commit on the
+ parent surface has no effect on the sub-surface's wl_surface
+ state. This mode allows a sub-surface to be updated on its own.
+
+ If cached state exists when wl_surface.commit is called in
+ desynchronized mode, the pending state is added to the cached
+ state, and applied as a whole. This invalidates the cache.
+
+ Note: even if a sub-surface is set to desynchronized, a parent
+ sub-surface may override it to behave as synchronized. For details,
+ see wl_subsurface.
+
+ If a surface's parent surface behaves as desynchronized, then
+ the cached state is applied on set_desync.
+
+
+
+
+
diff --git a/external/GLFW/deps/wayland/xdg-activation-v1.xml b/external/GLFW/deps/wayland/xdg-activation-v1.xml
new file mode 100644
index 0000000..9adcc27
--- /dev/null
+++ b/external/GLFW/deps/wayland/xdg-activation-v1.xml
@@ -0,0 +1,200 @@
+
+
+
+
+ Copyright © 2020 Aleix Pol Gonzalez <aleixpol@kde.org>
+ Copyright © 2020 Carlos Garnacho <carlosg@gnome.org>
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice (including the next
+ paragraph) shall be included in all copies or substantial portions of the
+ Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+
+
+
+ The way for a client to pass focus to another toplevel is as follows.
+
+ The client that intends to activate another toplevel uses the
+ xdg_activation_v1.get_activation_token request to get an activation token.
+ This token is then forwarded to the client, which is supposed to activate
+ one of its surfaces, through a separate band of communication.
+
+ One established way of doing this is through the XDG_ACTIVATION_TOKEN
+ environment variable of a newly launched child process. The child process
+ should unset the environment variable again right after reading it out in
+ order to avoid propagating it to other child processes.
+
+ Another established way exists for Applications implementing the D-Bus
+ interface org.freedesktop.Application, which should get their token under
+ activation-token on their platform_data.
+
+ In general activation tokens may be transferred across clients through
+ means not described in this protocol.
+
+ The client to be activated will then pass the token
+ it received to the xdg_activation_v1.activate request. The compositor can
+ then use this token to decide how to react to the activation request.
+
+ The token the activating client gets may be ineffective either already at
+ the time it receives it, for example if it was not focused, for focus
+ stealing prevention. The activating client will have no way to discover
+ the validity of the token, and may still forward it to the to be activated
+ client.
+
+ The created activation token may optionally get information attached to it
+ that can be used by the compositor to identify the application that we
+ intend to activate. This can for example be used to display a visual hint
+ about what application is being started.
+
+ Warning! The protocol described in this file is currently in the testing
+ phase. Backward compatible changes may be added together with the
+ corresponding interface version bump. Backward incompatible changes can
+ only be done by creating a new major version of the extension.
+
+
+
+
+ A global interface used for informing the compositor about applications
+ being activated or started, or for applications to request to be
+ activated.
+
+
+
+
+ Notify the compositor that the xdg_activation object will no longer be
+ used.
+
+ The child objects created via this interface are unaffected and should
+ be destroyed separately.
+
+
+
+
+
+ Creates an xdg_activation_token_v1 object that will provide
+ the initiating client with a unique token for this activation. This
+ token should be offered to the clients to be activated.
+
+
+
+
+
+
+
+ Requests surface activation. It's up to the compositor to display
+ this information as desired, for example by placing the surface above
+ the rest.
+
+ The compositor may know who requested this by checking the activation
+ token and might decide not to follow through with the activation if it's
+ considered unwanted.
+
+ Compositors can ignore unknown activation tokens when an invalid
+ token is passed.
+
+
+
+
+
+
+
+
+ An object for setting up a token and receiving a token handle that can
+ be passed as an activation token to another client.
+
+ The object is created using the xdg_activation_v1.get_activation_token
+ request. This object should then be populated with the app_id, surface
+ and serial information and committed. The compositor shall then issue a
+ done event with the token. In case the request's parameters are invalid,
+ the compositor will provide an invalid token.
+
+
+
+
+
+
+
+
+ Provides information about the seat and serial event that requested the
+ token.
+
+ The serial can come from an input or focus event. For instance, if a
+ click triggers the launch of a third-party client, the launcher client
+ should send a set_serial request with the serial and seat from the
+ wl_pointer.button event.
+
+ Some compositors might refuse to activate toplevels when the token
+ doesn't have a valid and recent enough event serial.
+
+ Must be sent before commit. This information is optional.
+
+
+
+
+
+
+
+ The requesting client can specify an app_id to associate the token
+ being created with it.
+
+ Must be sent before commit. This information is optional.
+
+
+
+
+
+
+ This request sets the surface requesting the activation. Note, this is
+ different from the surface that will be activated.
+
+ Some compositors might refuse to activate toplevels when the token
+ doesn't have a requesting surface.
+
+ Must be sent before commit. This information is optional.
+
+
+
+
+
+
+ Requests an activation token based on the different parameters that
+ have been offered through set_serial, set_surface and set_app_id.
+
+
+
+
+
+ The 'done' event contains the unique token of this activation request
+ and notifies that the provider is done.
+
+
+
+
+
+
+ Notify the compositor that the xdg_activation_token_v1 object will no
+ longer be used. The received token stays valid.
+
+
+
+
diff --git a/external/GLFW/deps/wayland/xdg-decoration-unstable-v1.xml b/external/GLFW/deps/wayland/xdg-decoration-unstable-v1.xml
new file mode 100644
index 0000000..e596775
--- /dev/null
+++ b/external/GLFW/deps/wayland/xdg-decoration-unstable-v1.xml
@@ -0,0 +1,156 @@
+
+
+
+ Copyright © 2018 Simon Ser
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice (including the next
+ paragraph) shall be included in all copies or substantial portions of the
+ Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+
+
+
+
+ This interface allows a compositor to announce support for server-side
+ decorations.
+
+ A window decoration is a set of window controls as deemed appropriate by
+ the party managing them, such as user interface components used to move,
+ resize and change a window's state.
+
+ A client can use this protocol to request being decorated by a supporting
+ compositor.
+
+ If compositor and client do not negotiate the use of a server-side
+ decoration using this protocol, clients continue to self-decorate as they
+ see fit.
+
+ Warning! The protocol described in this file is experimental and
+ backward incompatible changes may be made. Backward compatible changes
+ may be added together with the corresponding interface version bump.
+ Backward incompatible changes are done by bumping the version number in
+ the protocol and interface names and resetting the interface version.
+ Once the protocol is to be declared stable, the 'z' prefix and the
+ version number in the protocol and interface names are removed and the
+ interface version number is reset.
+
+
+
+
+ Destroy the decoration manager. This doesn't destroy objects created
+ with the manager.
+
+
+
+
+
+ Create a new decoration object associated with the given toplevel.
+
+ Creating an xdg_toplevel_decoration from an xdg_toplevel which has a
+ buffer attached or committed is a client error, and any attempts by a
+ client to attach or manipulate a buffer prior to the first
+ xdg_toplevel_decoration.configure event must also be treated as
+ errors.
+
+
+
+
+
+
+
+
+ The decoration object allows the compositor to toggle server-side window
+ decorations for a toplevel surface. The client can request to switch to
+ another mode.
+
+ The xdg_toplevel_decoration object must be destroyed before its
+ xdg_toplevel.
+
+
+
+
+
+
+
+
+
+
+ Switch back to a mode without any server-side decorations at the next
+ commit.
+
+
+
+
+
+ These values describe window decoration modes.
+
+
+
+
+
+
+
+ Set the toplevel surface decoration mode. This informs the compositor
+ that the client prefers the provided decoration mode.
+
+ After requesting a decoration mode, the compositor will respond by
+ emitting an xdg_surface.configure event. The client should then update
+ its content, drawing it without decorations if the received mode is
+ server-side decorations. The client must also acknowledge the configure
+ when committing the new content (see xdg_surface.ack_configure).
+
+ The compositor can decide not to use the client's mode and enforce a
+ different mode instead.
+
+ Clients whose decoration mode depend on the xdg_toplevel state may send
+ a set_mode request in response to an xdg_surface.configure event and wait
+ for the next xdg_surface.configure event to prevent unwanted state.
+ Such clients are responsible for preventing configure loops and must
+ make sure not to send multiple successive set_mode requests with the
+ same decoration mode.
+
+
+
+
+
+
+ Unset the toplevel surface decoration mode. This informs the compositor
+ that the client doesn't prefer a particular decoration mode.
+
+ This request has the same semantics as set_mode.
+
+
+
+
+
+ The configure event asks the client to change its decoration mode. The
+ configured state should not be applied immediately. Clients must send an
+ ack_configure in response to this event. See xdg_surface.configure and
+ xdg_surface.ack_configure for details.
+
+ A configure event can be sent at any time. The specified mode must be
+ obeyed by the client.
+
+
+
+
+
diff --git a/external/GLFW/deps/wayland/xdg-shell.xml b/external/GLFW/deps/wayland/xdg-shell.xml
new file mode 100644
index 0000000..777eaa7
--- /dev/null
+++ b/external/GLFW/deps/wayland/xdg-shell.xml
@@ -0,0 +1,1370 @@
+
+
+
+
+ Copyright © 2008-2013 Kristian Høgsberg
+ Copyright © 2013 Rafael Antognolli
+ Copyright © 2013 Jasper St. Pierre
+ Copyright © 2010-2013 Intel Corporation
+ Copyright © 2015-2017 Samsung Electronics Co., Ltd
+ Copyright © 2015-2017 Red Hat Inc.
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice (including the next
+ paragraph) shall be included in all copies or substantial portions of the
+ Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+
+
+
+
+ The xdg_wm_base interface is exposed as a global object enabling clients
+ to turn their wl_surfaces into windows in a desktop environment. It
+ defines the basic functionality needed for clients and the compositor to
+ create windows that can be dragged, resized, maximized, etc, as well as
+ creating transient windows such as popup menus.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Destroy this xdg_wm_base object.
+
+ Destroying a bound xdg_wm_base object while there are surfaces
+ still alive created by this xdg_wm_base object instance is illegal
+ and will result in a defunct_surfaces error.
+
+
+
+
+
+ Create a positioner object. A positioner object is used to position
+ surfaces relative to some parent surface. See the interface description
+ and xdg_surface.get_popup for details.
+
+
+
+
+
+
+ This creates an xdg_surface for the given surface. While xdg_surface
+ itself is not a role, the corresponding surface may only be assigned
+ a role extending xdg_surface, such as xdg_toplevel or xdg_popup. It is
+ illegal to create an xdg_surface for a wl_surface which already has an
+ assigned role and this will result in a role error.
+
+ This creates an xdg_surface for the given surface. An xdg_surface is
+ used as basis to define a role to a given surface, such as xdg_toplevel
+ or xdg_popup. It also manages functionality shared between xdg_surface
+ based surface roles.
+
+ See the documentation of xdg_surface for more details about what an
+ xdg_surface is and how it is used.
+
+
+
+
+
+
+
+ A client must respond to a ping event with a pong request or
+ the client may be deemed unresponsive. See xdg_wm_base.ping
+ and xdg_wm_base.error.unresponsive.
+
+
+
+
+
+
+ The ping event asks the client if it's still alive. Pass the
+ serial specified in the event back to the compositor by sending
+ a "pong" request back with the specified serial. See xdg_wm_base.pong.
+
+ Compositors can use this to determine if the client is still
+ alive. It's unspecified what will happen if the client doesn't
+ respond to the ping request, or in what timeframe. Clients should
+ try to respond in a reasonable amount of time. The “unresponsive”
+ error is provided for compositors that wish to disconnect unresponsive
+ clients.
+
+ A compositor is free to ping in any way it wants, but a client must
+ always respond to any xdg_wm_base object it created.
+
+
+
+
+
+
+
+ The xdg_positioner provides a collection of rules for the placement of a
+ child surface relative to a parent surface. Rules can be defined to ensure
+ the child surface remains within the visible area's borders, and to
+ specify how the child surface changes its position, such as sliding along
+ an axis, or flipping around a rectangle. These positioner-created rules are
+ constrained by the requirement that a child surface must intersect with or
+ be at least partially adjacent to its parent surface.
+
+ See the various requests for details about possible rules.
+
+ At the time of the request, the compositor makes a copy of the rules
+ specified by the xdg_positioner. Thus, after the request is complete the
+ xdg_positioner object can be destroyed or reused; further changes to the
+ object will have no effect on previous usages.
+
+ For an xdg_positioner object to be considered complete, it must have a
+ non-zero size set by set_size, and a non-zero anchor rectangle set by
+ set_anchor_rect. Passing an incomplete xdg_positioner object when
+ positioning a surface raises an invalid_positioner error.
+
+
+
+
+
+
+
+
+ Notify the compositor that the xdg_positioner will no longer be used.
+
+
+
+
+
+ Set the size of the surface that is to be positioned with the positioner
+ object. The size is in surface-local coordinates and corresponds to the
+ window geometry. See xdg_surface.set_window_geometry.
+
+ If a zero or negative size is set the invalid_input error is raised.
+
+
+
+
+
+
+
+ Specify the anchor rectangle within the parent surface that the child
+ surface will be placed relative to. The rectangle is relative to the
+ window geometry as defined by xdg_surface.set_window_geometry of the
+ parent surface.
+
+ When the xdg_positioner object is used to position a child surface, the
+ anchor rectangle may not extend outside the window geometry of the
+ positioned child's parent surface.
+
+ If a negative size is set the invalid_input error is raised.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines the anchor point for the anchor rectangle. The specified anchor
+ is used derive an anchor point that the child surface will be
+ positioned relative to. If a corner anchor is set (e.g. 'top_left' or
+ 'bottom_right'), the anchor point will be at the specified corner;
+ otherwise, the derived anchor point will be centered on the specified
+ edge, or in the center of the anchor rectangle if no edge is specified.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Defines in what direction a surface should be positioned, relative to
+ the anchor point of the parent surface. If a corner gravity is
+ specified (e.g. 'bottom_right' or 'top_left'), then the child surface
+ will be placed towards the specified gravity; otherwise, the child
+ surface will be centered over the anchor point on any axis that had no
+ gravity specified. If the gravity is not in the ‘gravity’ enum, an
+ invalid_input error is raised.
+
+
+
+
+
+
+ The constraint adjustment value define ways the compositor will adjust
+ the position of the surface, if the unadjusted position would result
+ in the surface being partly constrained.
+
+ Whether a surface is considered 'constrained' is left to the compositor
+ to determine. For example, the surface may be partly outside the
+ compositor's defined 'work area', thus necessitating the child surface's
+ position be adjusted until it is entirely inside the work area.
+
+ The adjustments can be combined, according to a defined precedence: 1)
+ Flip, 2) Slide, 3) Resize.
+
+
+
+ Don't alter the surface position even if it is constrained on some
+ axis, for example partially outside the edge of an output.
+
+
+
+
+ Slide the surface along the x axis until it is no longer constrained.
+
+ First try to slide towards the direction of the gravity on the x axis
+ until either the edge in the opposite direction of the gravity is
+ unconstrained or the edge in the direction of the gravity is
+ constrained.
+
+ Then try to slide towards the opposite direction of the gravity on the
+ x axis until either the edge in the direction of the gravity is
+ unconstrained or the edge in the opposite direction of the gravity is
+ constrained.
+
+
+
+
+ Slide the surface along the y axis until it is no longer constrained.
+
+ First try to slide towards the direction of the gravity on the y axis
+ until either the edge in the opposite direction of the gravity is
+ unconstrained or the edge in the direction of the gravity is
+ constrained.
+
+ Then try to slide towards the opposite direction of the gravity on the
+ y axis until either the edge in the direction of the gravity is
+ unconstrained or the edge in the opposite direction of the gravity is
+ constrained.
+
+
+
+
+ Invert the anchor and gravity on the x axis if the surface is
+ constrained on the x axis. For example, if the left edge of the
+ surface is constrained, the gravity is 'left' and the anchor is
+ 'left', change the gravity to 'right' and the anchor to 'right'.
+
+ If the adjusted position also ends up being constrained, the resulting
+ position of the flip_x adjustment will be the one before the
+ adjustment.
+
+
+
+
+ Invert the anchor and gravity on the y axis if the surface is
+ constrained on the y axis. For example, if the bottom edge of the
+ surface is constrained, the gravity is 'bottom' and the anchor is
+ 'bottom', change the gravity to 'top' and the anchor to 'top'.
+
+ The adjusted position is calculated given the original anchor
+ rectangle and offset, but with the new flipped anchor and gravity
+ values.
+
+ If the adjusted position also ends up being constrained, the resulting
+ position of the flip_y adjustment will be the one before the
+ adjustment.
+
+
+
+
+ Resize the surface horizontally so that it is completely
+ unconstrained.
+
+
+
+
+ Resize the surface vertically so that it is completely unconstrained.
+
+
+
+
+
+
+ Specify how the window should be positioned if the originally intended
+ position caused the surface to be constrained, meaning at least
+ partially outside positioning boundaries set by the compositor. The
+ adjustment is set by constructing a bitmask describing the adjustment to
+ be made when the surface is constrained on that axis.
+
+ If no bit for one axis is set, the compositor will assume that the child
+ surface should not change its position on that axis when constrained.
+
+ If more than one bit for one axis is set, the order of how adjustments
+ are applied is specified in the corresponding adjustment descriptions.
+
+ The default adjustment is none.
+
+
+
+
+
+
+ Specify the surface position offset relative to the position of the
+ anchor on the anchor rectangle and the anchor on the surface. For
+ example if the anchor of the anchor rectangle is at (x, y), the surface
+ has the gravity bottom|right, and the offset is (ox, oy), the calculated
+ surface position will be (x + ox, y + oy). The offset position of the
+ surface is the one used for constraint testing. See
+ set_constraint_adjustment.
+
+ An example use case is placing a popup menu on top of a user interface
+ element, while aligning the user interface element of the parent surface
+ with some user interface element placed somewhere in the popup surface.
+
+
+
+
+
+
+
+
+
+ When set reactive, the surface is reconstrained if the conditions used
+ for constraining changed, e.g. the parent window moved.
+
+ If the conditions changed and the popup was reconstrained, an
+ xdg_popup.configure event is sent with updated geometry, followed by an
+ xdg_surface.configure event.
+
+
+
+
+
+ Set the parent window geometry the compositor should use when
+ positioning the popup. The compositor may use this information to
+ determine the future state the popup should be constrained using. If
+ this doesn't match the dimension of the parent the popup is eventually
+ positioned against, the behavior is undefined.
+
+ The arguments are given in the surface-local coordinate space.
+
+
+
+
+
+
+
+ Set the serial of an xdg_surface.configure event this positioner will be
+ used in response to. The compositor may use this information together
+ with set_parent_size to determine what future state the popup should be
+ constrained using.
+
+
+
+
+
+
+
+ An interface that may be implemented by a wl_surface, for
+ implementations that provide a desktop-style user interface.
+
+ It provides a base set of functionality required to construct user
+ interface elements requiring management by the compositor, such as
+ toplevel windows, menus, etc. The types of functionality are split into
+ xdg_surface roles.
+
+ Creating an xdg_surface does not set the role for a wl_surface. In order
+ to map an xdg_surface, the client must create a role-specific object
+ using, e.g., get_toplevel, get_popup. The wl_surface for any given
+ xdg_surface can have at most one role, and may not be assigned any role
+ not based on xdg_surface.
+
+ A role must be assigned before any other requests are made to the
+ xdg_surface object.
+
+ The client must call wl_surface.commit on the corresponding wl_surface
+ for the xdg_surface state to take effect.
+
+ Creating an xdg_surface from a wl_surface which has a buffer attached or
+ committed is a client error, and any attempts by a client to attach or
+ manipulate a buffer prior to the first xdg_surface.configure call must
+ also be treated as errors.
+
+ After creating a role-specific object and setting it up, the client must
+ perform an initial commit without any buffer attached. The compositor
+ will reply with initial wl_surface state such as
+ wl_surface.preferred_buffer_scale followed by an xdg_surface.configure
+ event. The client must acknowledge it and is then allowed to attach a
+ buffer to map the surface.
+
+ Mapping an xdg_surface-based role surface is defined as making it
+ possible for the surface to be shown by the compositor. Note that
+ a mapped surface is not guaranteed to be visible once it is mapped.
+
+ For an xdg_surface to be mapped by the compositor, the following
+ conditions must be met:
+ (1) the client has assigned an xdg_surface-based role to the surface
+ (2) the client has set and committed the xdg_surface state and the
+ role-dependent state to the surface
+ (3) the client has committed a buffer to the surface
+
+ A newly-unmapped surface is considered to have met condition (1) out
+ of the 3 required conditions for mapping a surface if its role surface
+ has not been destroyed, i.e. the client must perform the initial commit
+ again before attaching a buffer.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Destroy the xdg_surface object. An xdg_surface must only be destroyed
+ after its role object has been destroyed, otherwise
+ a defunct_role_object error is raised.
+
+
+
+
+
+ This creates an xdg_toplevel object for the given xdg_surface and gives
+ the associated wl_surface the xdg_toplevel role.
+
+ See the documentation of xdg_toplevel for more details about what an
+ xdg_toplevel is and how it is used.
+
+
+
+
+
+
+ This creates an xdg_popup object for the given xdg_surface and gives
+ the associated wl_surface the xdg_popup role.
+
+ If null is passed as a parent, a parent surface must be specified using
+ some other protocol, before committing the initial state.
+
+ See the documentation of xdg_popup for more details about what an
+ xdg_popup is and how it is used.
+
+
+
+
+
+
+
+
+ The window geometry of a surface is its "visible bounds" from the
+ user's perspective. Client-side decorations often have invisible
+ portions like drop-shadows which should be ignored for the
+ purposes of aligning, placing and constraining windows.
+
+ The window geometry is double buffered, and will be applied at the
+ time wl_surface.commit of the corresponding wl_surface is called.
+
+ When maintaining a position, the compositor should treat the (x, y)
+ coordinate of the window geometry as the top left corner of the window.
+ A client changing the (x, y) window geometry coordinate should in
+ general not alter the position of the window.
+
+ Once the window geometry of the surface is set, it is not possible to
+ unset it, and it will remain the same until set_window_geometry is
+ called again, even if a new subsurface or buffer is attached.
+
+ If never set, the value is the full bounds of the surface,
+ including any subsurfaces. This updates dynamically on every
+ commit. This unset is meant for extremely simple clients.
+
+ The arguments are given in the surface-local coordinate space of
+ the wl_surface associated with this xdg_surface, and may extend outside
+ of the wl_surface itself to mark parts of the subsurface tree as part of
+ the window geometry.
+
+ When applied, the effective window geometry will be the set window
+ geometry clamped to the bounding rectangle of the combined
+ geometry of the surface of the xdg_surface and the associated
+ subsurfaces.
+
+ The effective geometry will not be recalculated unless a new call to
+ set_window_geometry is done and the new pending surface state is
+ subsequently applied.
+
+ The width and height of the effective window geometry must be
+ greater than zero. Setting an invalid size will raise an
+ invalid_size error.
+
+
+
+
+
+
+
+
+
+ When a configure event is received, if a client commits the
+ surface in response to the configure event, then the client
+ must make an ack_configure request sometime before the commit
+ request, passing along the serial of the configure event.
+
+ For instance, for toplevel surfaces the compositor might use this
+ information to move a surface to the top left only when the client has
+ drawn itself for the maximized or fullscreen state.
+
+ If the client receives multiple configure events before it
+ can respond to one, it only has to ack the last configure event.
+ Acking a configure event that was never sent raises an invalid_serial
+ error.
+
+ A client is not required to commit immediately after sending
+ an ack_configure request - it may even ack_configure several times
+ before its next surface commit.
+
+ A client may send multiple ack_configure requests before committing, but
+ only the last request sent before a commit indicates which configure
+ event the client really is responding to.
+
+ Sending an ack_configure request consumes the serial number sent with
+ the request, as well as serial numbers sent by all configure events
+ sent on this xdg_surface prior to the configure event referenced by
+ the committed serial.
+
+ It is an error to issue multiple ack_configure requests referencing a
+ serial from the same configure event, or to issue an ack_configure
+ request referencing a serial from a configure event issued before the
+ event identified by the last ack_configure request for the same
+ xdg_surface. Doing so will raise an invalid_serial error.
+
+
+
+
+
+
+ The configure event marks the end of a configure sequence. A configure
+ sequence is a set of one or more events configuring the state of the
+ xdg_surface, including the final xdg_surface.configure event.
+
+ Where applicable, xdg_surface surface roles will during a configure
+ sequence extend this event as a latched state sent as events before the
+ xdg_surface.configure event. Such events should be considered to make up
+ a set of atomically applied configuration states, where the
+ xdg_surface.configure commits the accumulated state.
+
+ Clients should arrange their surface for the new states, and then send
+ an ack_configure request with the serial sent in this configure event at
+ some point before committing the new surface.
+
+ If the client receives multiple configure events before it can respond
+ to one, it is free to discard all but the last event it received.
+
+
+
+
+
+
+
+
+ This interface defines an xdg_surface role which allows a surface to,
+ among other things, set window-like properties such as maximize,
+ fullscreen, and minimize, set application-specific metadata like title and
+ id, and well as trigger user interactive operations such as interactive
+ resize and move.
+
+ Unmapping an xdg_toplevel means that the surface cannot be shown
+ by the compositor until it is explicitly mapped again.
+ All active operations (e.g., move, resize) are canceled and all
+ attributes (e.g. title, state, stacking, ...) are discarded for
+ an xdg_toplevel surface when it is unmapped. The xdg_toplevel returns to
+ the state it had right after xdg_surface.get_toplevel. The client
+ can re-map the toplevel by perfoming a commit without any buffer
+ attached, waiting for a configure event and handling it as usual (see
+ xdg_surface description).
+
+ Attaching a null buffer to a toplevel unmaps the surface.
+
+
+
+
+ This request destroys the role surface and unmaps the surface;
+ see "Unmapping" behavior in interface section for details.
+
+
+
+
+
+
+
+
+
+
+
+ Set the "parent" of this surface. This surface should be stacked
+ above the parent surface and all other ancestor surfaces.
+
+ Parent surfaces should be set on dialogs, toolboxes, or other
+ "auxiliary" surfaces, so that the parent is raised when the dialog
+ is raised.
+
+ Setting a null parent for a child surface unsets its parent. Setting
+ a null parent for a surface which currently has no parent is a no-op.
+
+ Only mapped surfaces can have child surfaces. Setting a parent which
+ is not mapped is equivalent to setting a null parent. If a surface
+ becomes unmapped, its children's parent is set to the parent of
+ the now-unmapped surface. If the now-unmapped surface has no parent,
+ its children's parent is unset. If the now-unmapped surface becomes
+ mapped again, its parent-child relationship is not restored.
+
+ The parent toplevel must not be one of the child toplevel's
+ descendants, and the parent must be different from the child toplevel,
+ otherwise the invalid_parent protocol error is raised.
+
+
+
+
+
+
+ Set a short title for the surface.
+
+ This string may be used to identify the surface in a task bar,
+ window list, or other user interface elements provided by the
+ compositor.
+
+ The string must be encoded in UTF-8.
+
+
+
+
+
+
+ Set an application identifier for the surface.
+
+ The app ID identifies the general class of applications to which
+ the surface belongs. The compositor can use this to group multiple
+ surfaces together, or to determine how to launch a new application.
+
+ For D-Bus activatable applications, the app ID is used as the D-Bus
+ service name.
+
+ The compositor shell will try to group application surfaces together
+ by their app ID. As a best practice, it is suggested to select app
+ ID's that match the basename of the application's .desktop file.
+ For example, "org.freedesktop.FooViewer" where the .desktop file is
+ "org.freedesktop.FooViewer.desktop".
+
+ Like other properties, a set_app_id request can be sent after the
+ xdg_toplevel has been mapped to update the property.
+
+ See the desktop-entry specification [0] for more details on
+ application identifiers and how they relate to well-known D-Bus
+ names and .desktop files.
+
+ [0] https://standards.freedesktop.org/desktop-entry-spec/
+
+
+
+
+
+
+ Clients implementing client-side decorations might want to show
+ a context menu when right-clicking on the decorations, giving the
+ user a menu that they can use to maximize or minimize the window.
+
+ This request asks the compositor to pop up such a window menu at
+ the given position, relative to the local surface coordinates of
+ the parent surface. There are no guarantees as to what menu items
+ the window menu contains, or even if a window menu will be drawn
+ at all.
+
+ This request must be used in response to some sort of user action
+ like a button press, key press, or touch down event.
+
+
+
+
+
+
+
+
+
+ Start an interactive, user-driven move of the surface.
+
+ This request must be used in response to some sort of user action
+ like a button press, key press, or touch down event. The passed
+ serial is used to determine the type of interactive move (touch,
+ pointer, etc).
+
+ The server may ignore move requests depending on the state of
+ the surface (e.g. fullscreen or maximized), or if the passed serial
+ is no longer valid.
+
+ If triggered, the surface will lose the focus of the device
+ (wl_pointer, wl_touch, etc) used for the move. It is up to the
+ compositor to visually indicate that the move is taking place, such as
+ updating a pointer cursor, during the move. There is no guarantee
+ that the device focus will return when the move is completed.
+
+
+
+
+
+
+
+ These values are used to indicate which edge of a surface
+ is being dragged in a resize operation.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Start a user-driven, interactive resize of the surface.
+
+ This request must be used in response to some sort of user action
+ like a button press, key press, or touch down event. The passed
+ serial is used to determine the type of interactive resize (touch,
+ pointer, etc).
+
+ The server may ignore resize requests depending on the state of
+ the surface (e.g. fullscreen or maximized).
+
+ If triggered, the client will receive configure events with the
+ "resize" state enum value and the expected sizes. See the "resize"
+ enum value for more details about what is required. The client
+ must also acknowledge configure events using "ack_configure". After
+ the resize is completed, the client will receive another "configure"
+ event without the resize state.
+
+ If triggered, the surface also will lose the focus of the device
+ (wl_pointer, wl_touch, etc) used for the resize. It is up to the
+ compositor to visually indicate that the resize is taking place,
+ such as updating a pointer cursor, during the resize. There is no
+ guarantee that the device focus will return when the resize is
+ completed.
+
+ The edges parameter specifies how the surface should be resized, and
+ is one of the values of the resize_edge enum. Values not matching
+ a variant of the enum will cause the invalid_resize_edge protocol error.
+ The compositor may use this information to update the surface position
+ for example when dragging the top left corner. The compositor may also
+ use this information to adapt its behavior, e.g. choose an appropriate
+ cursor image.
+
+
+
+
+
+
+
+
+ The different state values used on the surface. This is designed for
+ state values like maximized, fullscreen. It is paired with the
+ configure event to ensure that both the client and the compositor
+ setting the state can be synchronized.
+
+ States set in this way are double-buffered. They will get applied on
+ the next commit.
+
+
+
+ The surface is maximized. The window geometry specified in the configure
+ event must be obeyed by the client, or the xdg_wm_base.invalid_surface_state
+ error is raised.
+
+ The client should draw without shadow or other
+ decoration outside of the window geometry.
+
+
+
+
+ The surface is fullscreen. The window geometry specified in the
+ configure event is a maximum; the client cannot resize beyond it. For
+ a surface to cover the whole fullscreened area, the geometry
+ dimensions must be obeyed by the client. For more details, see
+ xdg_toplevel.set_fullscreen.
+
+
+
+
+ The surface is being resized. The window geometry specified in the
+ configure event is a maximum; the client cannot resize beyond it.
+ Clients that have aspect ratio or cell sizing configuration can use
+ a smaller size, however.
+
+
+
+
+ Client window decorations should be painted as if the window is
+ active. Do not assume this means that the window actually has
+ keyboard or pointer focus.
+
+
+
+
+ The window is currently in a tiled layout and the left edge is
+ considered to be adjacent to another part of the tiling grid.
+
+
+
+
+ The window is currently in a tiled layout and the right edge is
+ considered to be adjacent to another part of the tiling grid.
+
+
+
+
+ The window is currently in a tiled layout and the top edge is
+ considered to be adjacent to another part of the tiling grid.
+
+
+
+
+ The window is currently in a tiled layout and the bottom edge is
+ considered to be adjacent to another part of the tiling grid.
+
+
+
+
+ The surface is currently not ordinarily being repainted; for
+ example because its content is occluded by another window, or its
+ outputs are switched off due to screen locking.
+
+
+
+
+
+
+ Set a maximum size for the window.
+
+ The client can specify a maximum size so that the compositor does
+ not try to configure the window beyond this size.
+
+ The width and height arguments are in window geometry coordinates.
+ See xdg_surface.set_window_geometry.
+
+ Values set in this way are double-buffered. They will get applied
+ on the next commit.
+
+ The compositor can use this information to allow or disallow
+ different states like maximize or fullscreen and draw accurate
+ animations.
+
+ Similarly, a tiling window manager may use this information to
+ place and resize client windows in a more effective way.
+
+ The client should not rely on the compositor to obey the maximum
+ size. The compositor may decide to ignore the values set by the
+ client and request a larger size.
+
+ If never set, or a value of zero in the request, means that the
+ client has no expected maximum size in the given dimension.
+ As a result, a client wishing to reset the maximum size
+ to an unspecified state can use zero for width and height in the
+ request.
+
+ Requesting a maximum size to be smaller than the minimum size of
+ a surface is illegal and will result in an invalid_size error.
+
+ The width and height must be greater than or equal to zero. Using
+ strictly negative values for width or height will result in a
+ invalid_size error.
+
+
+
+
+
+
+
+ Set a minimum size for the window.
+
+ The client can specify a minimum size so that the compositor does
+ not try to configure the window below this size.
+
+ The width and height arguments are in window geometry coordinates.
+ See xdg_surface.set_window_geometry.
+
+ Values set in this way are double-buffered. They will get applied
+ on the next commit.
+
+ The compositor can use this information to allow or disallow
+ different states like maximize or fullscreen and draw accurate
+ animations.
+
+ Similarly, a tiling window manager may use this information to
+ place and resize client windows in a more effective way.
+
+ The client should not rely on the compositor to obey the minimum
+ size. The compositor may decide to ignore the values set by the
+ client and request a smaller size.
+
+ If never set, or a value of zero in the request, means that the
+ client has no expected minimum size in the given dimension.
+ As a result, a client wishing to reset the minimum size
+ to an unspecified state can use zero for width and height in the
+ request.
+
+ Requesting a minimum size to be larger than the maximum size of
+ a surface is illegal and will result in an invalid_size error.
+
+ The width and height must be greater than or equal to zero. Using
+ strictly negative values for width and height will result in a
+ invalid_size error.
+
+
+
+
+
+
+
+ Maximize the surface.
+
+ After requesting that the surface should be maximized, the compositor
+ will respond by emitting a configure event. Whether this configure
+ actually sets the window maximized is subject to compositor policies.
+ The client must then update its content, drawing in the configured
+ state. The client must also acknowledge the configure when committing
+ the new content (see ack_configure).
+
+ It is up to the compositor to decide how and where to maximize the
+ surface, for example which output and what region of the screen should
+ be used.
+
+ If the surface was already maximized, the compositor will still emit
+ a configure event with the "maximized" state.
+
+ If the surface is in a fullscreen state, this request has no direct
+ effect. It may alter the state the surface is returned to when
+ unmaximized unless overridden by the compositor.
+
+
+
+
+
+ Unmaximize the surface.
+
+ After requesting that the surface should be unmaximized, the compositor
+ will respond by emitting a configure event. Whether this actually
+ un-maximizes the window is subject to compositor policies.
+ If available and applicable, the compositor will include the window
+ geometry dimensions the window had prior to being maximized in the
+ configure event. The client must then update its content, drawing it in
+ the configured state. The client must also acknowledge the configure
+ when committing the new content (see ack_configure).
+
+ It is up to the compositor to position the surface after it was
+ unmaximized; usually the position the surface had before maximizing, if
+ applicable.
+
+ If the surface was already not maximized, the compositor will still
+ emit a configure event without the "maximized" state.
+
+ If the surface is in a fullscreen state, this request has no direct
+ effect. It may alter the state the surface is returned to when
+ unmaximized unless overridden by the compositor.
+
+
+
+
+
+ Make the surface fullscreen.
+
+ After requesting that the surface should be fullscreened, the
+ compositor will respond by emitting a configure event. Whether the
+ client is actually put into a fullscreen state is subject to compositor
+ policies. The client must also acknowledge the configure when
+ committing the new content (see ack_configure).
+
+ The output passed by the request indicates the client's preference as
+ to which display it should be set fullscreen on. If this value is NULL,
+ it's up to the compositor to choose which display will be used to map
+ this surface.
+
+ If the surface doesn't cover the whole output, the compositor will
+ position the surface in the center of the output and compensate with
+ with border fill covering the rest of the output. The content of the
+ border fill is undefined, but should be assumed to be in some way that
+ attempts to blend into the surrounding area (e.g. solid black).
+
+ If the fullscreened surface is not opaque, the compositor must make
+ sure that other screen content not part of the same surface tree (made
+ up of subsurfaces, popups or similarly coupled surfaces) are not
+ visible below the fullscreened surface.
+
+
+
+
+
+
+ Make the surface no longer fullscreen.
+
+ After requesting that the surface should be unfullscreened, the
+ compositor will respond by emitting a configure event.
+ Whether this actually removes the fullscreen state of the client is
+ subject to compositor policies.
+
+ Making a surface unfullscreen sets states for the surface based on the following:
+ * the state(s) it may have had before becoming fullscreen
+ * any state(s) decided by the compositor
+ * any state(s) requested by the client while the surface was fullscreen
+
+ The compositor may include the previous window geometry dimensions in
+ the configure event, if applicable.
+
+ The client must also acknowledge the configure when committing the new
+ content (see ack_configure).
+
+
+
+
+
+ Request that the compositor minimize your surface. There is no
+ way to know if the surface is currently minimized, nor is there
+ any way to unset minimization on this surface.
+
+ If you are looking to throttle redrawing when minimized, please
+ instead use the wl_surface.frame event for this, as this will
+ also work with live previews on windows in Alt-Tab, Expose or
+ similar compositor features.
+
+
+
+
+
+ This configure event asks the client to resize its toplevel surface or
+ to change its state. The configured state should not be applied
+ immediately. See xdg_surface.configure for details.
+
+ The width and height arguments specify a hint to the window
+ about how its surface should be resized in window geometry
+ coordinates. See set_window_geometry.
+
+ If the width or height arguments are zero, it means the client
+ should decide its own window dimension. This may happen when the
+ compositor needs to configure the state of the surface but doesn't
+ have any information about any previous or expected dimension.
+
+ The states listed in the event specify how the width/height
+ arguments should be interpreted, and possibly how it should be
+ drawn.
+
+ Clients must send an ack_configure in response to this event. See
+ xdg_surface.configure and xdg_surface.ack_configure for details.
+
+
+
+
+
+
+
+
+ The close event is sent by the compositor when the user
+ wants the surface to be closed. This should be equivalent to
+ the user clicking the close button in client-side decorations,
+ if your application has any.
+
+ This is only a request that the user intends to close the
+ window. The client may choose to ignore this request, or show
+ a dialog to ask the user to save their data, etc.
+
+
+
+
+
+
+
+ The configure_bounds event may be sent prior to a xdg_toplevel.configure
+ event to communicate the bounds a window geometry size is recommended
+ to constrain to.
+
+ The passed width and height are in surface coordinate space. If width
+ and height are 0, it means bounds is unknown and equivalent to as if no
+ configure_bounds event was ever sent for this surface.
+
+ The bounds can for example correspond to the size of a monitor excluding
+ any panels or other shell components, so that a surface isn't created in
+ a way that it cannot fit.
+
+ The bounds may change at any point, and in such a case, a new
+ xdg_toplevel.configure_bounds will be sent, followed by
+ xdg_toplevel.configure and xdg_surface.configure.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This event advertises the capabilities supported by the compositor. If
+ a capability isn't supported, clients should hide or disable the UI
+ elements that expose this functionality. For instance, if the
+ compositor doesn't advertise support for minimized toplevels, a button
+ triggering the set_minimized request should not be displayed.
+
+ The compositor will ignore requests it doesn't support. For instance,
+ a compositor which doesn't advertise support for minimized will ignore
+ set_minimized requests.
+
+ Compositors must send this event once before the first
+ xdg_surface.configure event. When the capabilities change, compositors
+ must send this event again and then send an xdg_surface.configure
+ event.
+
+ The configured state should not be applied immediately. See
+ xdg_surface.configure for details.
+
+ The capabilities are sent as an array of 32-bit unsigned integers in
+ native endianness.
+
+
+
+
+
+
+
+ A popup surface is a short-lived, temporary surface. It can be used to
+ implement for example menus, popovers, tooltips and other similar user
+ interface concepts.
+
+ A popup can be made to take an explicit grab. See xdg_popup.grab for
+ details.
+
+ When the popup is dismissed, a popup_done event will be sent out, and at
+ the same time the surface will be unmapped. See the xdg_popup.popup_done
+ event for details.
+
+ Explicitly destroying the xdg_popup object will also dismiss the popup and
+ unmap the surface. Clients that want to dismiss the popup when another
+ surface of their own is clicked should dismiss the popup using the destroy
+ request.
+
+ A newly created xdg_popup will be stacked on top of all previously created
+ xdg_popup surfaces associated with the same xdg_toplevel.
+
+ The parent of an xdg_popup must be mapped (see the xdg_surface
+ description) before the xdg_popup itself.
+
+ The client must call wl_surface.commit on the corresponding wl_surface
+ for the xdg_popup state to take effect.
+
+
+
+
+
+
+
+
+ This destroys the popup. Explicitly destroying the xdg_popup
+ object will also dismiss the popup, and unmap the surface.
+
+ If this xdg_popup is not the "topmost" popup, the
+ xdg_wm_base.not_the_topmost_popup protocol error will be sent.
+
+
+
+
+
+ This request makes the created popup take an explicit grab. An explicit
+ grab will be dismissed when the user dismisses the popup, or when the
+ client destroys the xdg_popup. This can be done by the user clicking
+ outside the surface, using the keyboard, or even locking the screen
+ through closing the lid or a timeout.
+
+ If the compositor denies the grab, the popup will be immediately
+ dismissed.
+
+ This request must be used in response to some sort of user action like a
+ button press, key press, or touch down event. The serial number of the
+ event should be passed as 'serial'.
+
+ The parent of a grabbing popup must either be an xdg_toplevel surface or
+ another xdg_popup with an explicit grab. If the parent is another
+ xdg_popup it means that the popups are nested, with this popup now being
+ the topmost popup.
+
+ Nested popups must be destroyed in the reverse order they were created
+ in, e.g. the only popup you are allowed to destroy at all times is the
+ topmost one.
+
+ When compositors choose to dismiss a popup, they may dismiss every
+ nested grabbing popup as well. When a compositor dismisses popups, it
+ will follow the same dismissing order as required from the client.
+
+ If the topmost grabbing popup is destroyed, the grab will be returned to
+ the parent of the popup, if that parent previously had an explicit grab.
+
+ If the parent is a grabbing popup which has already been dismissed, this
+ popup will be immediately dismissed. If the parent is a popup that did
+ not take an explicit grab, an error will be raised.
+
+ During a popup grab, the client owning the grab will receive pointer
+ and touch events for all their surfaces as normal (similar to an
+ "owner-events" grab in X11 parlance), while the top most grabbing popup
+ will always have keyboard focus.
+
+
+
+
+
+
+
+ This event asks the popup surface to configure itself given the
+ configuration. The configured state should not be applied immediately.
+ See xdg_surface.configure for details.
+
+ The x and y arguments represent the position the popup was placed at
+ given the xdg_positioner rule, relative to the upper left corner of the
+ window geometry of the parent surface.
+
+ For version 2 or older, the configure event for an xdg_popup is only
+ ever sent once for the initial configuration. Starting with version 3,
+ it may be sent again if the popup is setup with an xdg_positioner with
+ set_reactive requested, or in response to xdg_popup.reposition requests.
+
+
+
+
+
+
+
+
+
+ The popup_done event is sent out when a popup is dismissed by the
+ compositor. The client should destroy the xdg_popup object at this
+ point.
+
+
+
+
+
+
+
+ Reposition an already-mapped popup. The popup will be placed given the
+ details in the passed xdg_positioner object, and a
+ xdg_popup.repositioned followed by xdg_popup.configure and
+ xdg_surface.configure will be emitted in response. Any parameters set
+ by the previous positioner will be discarded.
+
+ The passed token will be sent in the corresponding
+ xdg_popup.repositioned event. The new popup position will not take
+ effect until the corresponding configure event is acknowledged by the
+ client. See xdg_popup.repositioned for details. The token itself is
+ opaque, and has no other special meaning.
+
+ If multiple reposition requests are sent, the compositor may skip all
+ but the last one.
+
+ If the popup is repositioned in response to a configure event for its
+ parent, the client should send an xdg_positioner.set_parent_configure
+ and possibly an xdg_positioner.set_parent_size request to allow the
+ compositor to properly constrain the popup.
+
+ If the popup is repositioned together with a parent that is being
+ resized, but not in response to a configure event, the client should
+ send an xdg_positioner.set_parent_size request.
+
+
+
+
+
+
+
+ The repositioned event is sent as part of a popup configuration
+ sequence, together with xdg_popup.configure and lastly
+ xdg_surface.configure to notify the completion of a reposition request.
+
+ The repositioned event is to notify about the completion of a
+ xdg_popup.reposition request. The token argument is the token passed
+ in the xdg_popup.reposition request.
+
+ Immediately after this event is emitted, xdg_popup.configure and
+ xdg_surface.configure will be sent with the updated size and position,
+ as well as a new configure serial.
+
+ The client should optionally update the content of the popup, but must
+ acknowledge the new popup configuration for the new position to take
+ effect. See xdg_surface.ack_configure for details.
+
+
+
+
+
+
diff --git a/external/GLFW/docs/CMakeLists.txt b/external/GLFW/docs/CMakeLists.txt
index 20d85ae..ffa7768 100644
--- a/external/GLFW/docs/CMakeLists.txt
+++ b/external/GLFW/docs/CMakeLists.txt
@@ -1,34 +1,61 @@
-set(glfw_DOCS_SOURCES
+# Because of bugs and limitations in its Markdown support, only fairly recent
+# versions of Doxygen can produce acceptable output
+set(MINIMUM_DOXYGEN_VERSION 1.9.8)
+
+# NOTE: The order of this list determines the order of items in the Guides
+# (i.e. Pages) list in the generated documentation
+set(source_files
+ main.md
+ news.md
+ quick.md
+ moving.md
+ compile.md
+ build.md
+ intro.md
+ context.md
+ monitor.md
+ window.md
+ input.md
+ vulkan.md
+ compat.md
+ internal.md)
+
+set(extra_files DoxygenLayout.xml header.html footer.html extra.css spaces.svg)
+
+set(header_paths
"${GLFW_SOURCE_DIR}/include/GLFW/glfw3.h"
- "${GLFW_SOURCE_DIR}/include/GLFW/glfw3native.h"
- "${GLFW_SOURCE_DIR}/docs/main.dox"
- "${GLFW_SOURCE_DIR}/docs/news.dox"
- "${GLFW_SOURCE_DIR}/docs/moving.dox"
- "${GLFW_SOURCE_DIR}/docs/quick.dox"
- "${GLFW_SOURCE_DIR}/docs/compile.dox"
- "${GLFW_SOURCE_DIR}/docs/build.dox"
- "${GLFW_SOURCE_DIR}/docs/intro.dox"
- "${GLFW_SOURCE_DIR}/docs/context.dox"
- "${GLFW_SOURCE_DIR}/docs/monitor.dox"
- "${GLFW_SOURCE_DIR}/docs/window.dox"
- "${GLFW_SOURCE_DIR}/docs/input.dox"
- "${GLFW_SOURCE_DIR}/docs/vulkan.dox"
- "${GLFW_SOURCE_DIR}/docs/compat.dox")
-
-if (GLFW_DOCUMENT_INTERNALS)
- list(APPEND glfw_DOCS_SOURCES
- "${GLFW_SOURCE_DIR}/docs/internal.dox"
- "${GLFW_SOURCE_DIR}/src/internal.h")
-endif()
+ "${GLFW_SOURCE_DIR}/include/GLFW/glfw3native.h")
-foreach(arg ${glfw_DOCS_SOURCES})
- set(GLFW_DOCS_SOURCES "${GLFW_DOCS_SOURCES} \\\n\"${arg}\"")
+# Format the source list into a Doxyfile INPUT value that Doxygen can parse
+foreach(path IN LISTS header_paths)
+ string(APPEND GLFW_DOXYGEN_INPUT " \\\n\"${path}\"")
+endforeach()
+foreach(file IN LISTS source_files)
+ string(APPEND GLFW_DOXYGEN_INPUT " \\\n\"${CMAKE_CURRENT_SOURCE_DIR}/${file}\"")
endforeach()
-configure_file(Doxyfile.in Doxyfile @ONLY)
-
-add_custom_target(docs ALL "${DOXYGEN_EXECUTABLE}"
- WORKING_DIRECTORY "${GLFW_BINARY_DIR}/docs"
- COMMENT "Generating HTML documentation" VERBATIM)
+set(DOXYGEN_SKIP_DOT TRUE)
+find_package(Doxygen ${MINIMUM_DOXYGEN_VERSION} QUIET)
+
+if (NOT DOXYGEN_FOUND)
+ message(STATUS "Documentation generation requires Doxygen ${MINIMUM_DOXYGEN_VERSION} or later")
+else()
+ configure_file(Doxyfile.in Doxyfile @ONLY)
+ add_custom_command(OUTPUT "html/index.html"
+ COMMAND "${DOXYGEN_EXECUTABLE}"
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
+ MAIN_DEPENDENCY Doxyfile
+ DEPENDS ${header_paths} ${source_files} ${extra_files}
+ COMMENT "Generating HTML documentation"
+ VERBATIM)
+
+ add_custom_target(docs ALL SOURCES ${source_files} DEPENDS "html/index.html")
+ set_target_properties(docs PROPERTIES FOLDER "GLFW3")
+
+ if (GLFW_INSTALL)
+ install(DIRECTORY "${GLFW_BINARY_DIR}/docs/html"
+ DESTINATION "${CMAKE_INSTALL_DOCDIR}")
+ endif()
+endif()
diff --git a/external/GLFW/docs/CONTRIBUTING.md b/external/GLFW/docs/CONTRIBUTING.md
new file mode 100644
index 0000000..73ba01e
--- /dev/null
+++ b/external/GLFW/docs/CONTRIBUTING.md
@@ -0,0 +1,390 @@
+# Contribution Guide
+
+## Contents
+
+- [Asking a question](#asking-a-question)
+- [Reporting a bug](#reporting-a-bug)
+ - [Reporting a compile or link bug](#reporting-a-compile-or-link-bug)
+ - [Reporting a segfault or other crash bug](#reporting-a-segfault-or-other-crash-bug)
+ - [Reporting a context creation bug](#reporting-a-context-creation-bug)
+ - [Reporting a monitor or video mode bug](#reporting-a-monitor-or-video-mode-bug)
+ - [Reporting a window, input or event bug](#reporting-a-window-input-or-event-bug)
+ - [Reporting some other library bug](#reporting-some-other-library-bug)
+ - [Reporting a documentation bug](#reporting-a-documentation-bug)
+ - [Reporting a website bug](#reporting-a-website-bug)
+- [Requesting a feature](#requesting-a-feature)
+- [Contributing a bug fix](#contributing-a-bug-fix)
+- [Contributing a feature](#contributing-a-feature)
+
+
+## Asking a question
+
+Questions about how to use GLFW should be asked either in the [support
+section](https://discourse.glfw.org/c/support) of the forum, under the [Stack
+Overflow tag](https://stackoverflow.com/questions/tagged/glfw) or [Game
+Development tag](https://gamedev.stackexchange.com/questions/tagged/glfw) on
+Stack Exchange.
+
+Questions about the design or implementation of GLFW or about future plans
+should be asked in the [dev section](https://discourse.glfw.org/c/dev) of the
+forum. Please don't open a GitHub issue to discuss design questions without
+first checking with a maintainer.
+
+
+## Reporting a bug
+
+If GLFW is behaving unexpectedly at run-time, start by setting an [error
+callback](https://www.glfw.org/docs/latest/intro_guide.html#error_handling).
+GLFW will often tell you the cause of an error via this callback. If it
+doesn't, that might be a separate bug.
+
+If GLFW is crashing or triggering asserts, make sure that all your object
+handles and other pointers are valid.
+
+For bugs where it makes sense, a short, self contained example is absolutely
+invaluable. Just put it inline in the body text. Note that if the bug is
+reproducible with one of the test programs that come with GLFW, just mention
+that instead.
+
+__Don't worry about adding too much information__. Unimportant information can
+be abbreviated or removed later, but missing information can stall bug fixing,
+especially when your schedule doesn't align with that of the maintainer.
+
+__Please provide text as text, not as images__. This includes code, error
+messages and any other text. Text in images cannot be found by other users
+searching for the same problem and may have to be re-typed by maintainers when
+debugging.
+
+You don't need to manually indent your code or other text to quote it with
+GitHub Markdown; just surround it with triple backticks:
+
+ ```
+ Some quoted text.
+ ```
+
+You can also add syntax highlighting by appending the common file extension:
+
+ ```c
+ int five(void)
+ {
+ return 5;
+ }
+ ```
+
+There are issue labels for both platforms and GPU manufacturers, so there is no
+need to mention these in the subject line. If you do, it will be removed when
+the issue is labeled.
+
+If your bug is already reported, please add any new information you have, or if
+it already has everything, give it a :+1:.
+
+
+### Reporting a compile or link bug
+
+__Note:__ GLFW needs many system APIs to do its job, which on some platforms
+means linking to many system libraries. If you are using GLFW as a static
+library, that means your application needs to link to these in addition to GLFW.
+
+__Note:__ Check the [Compiling
+GLFW](https://www.glfw.org/docs/latest/compile.html) guide and or [Building
+applications](https://www.glfw.org/docs/latest/build.html) guide for before
+opening an issue of this kind. Most issues are caused by a missing package or
+linker flag.
+
+Always include the __operating system name and version__ (e.g. `Windows
+7 64-bit` or `Ubuntu 15.10`) and the __compiler name and version__ (e.g. `Visual
+C++ 2015 Update 2`). If you are using an official release of GLFW,
+include the __GLFW release version__ (e.g. `3.1.2`), otherwise include the
+__GLFW commit ID__ (e.g. `3795d78b14ef06008889cc422a1fb8d642597751`) from Git.
+
+Please also include the __complete build log__ from your compiler and linker,
+even if it's long. It can always be shortened later, if necessary.
+
+
+#### Quick template
+
+```
+OS and version:
+Compiler version:
+Release or commit:
+Build log:
+```
+
+
+### Reporting a segfault or other crash bug
+
+Always include the __operating system name and version__ (e.g. `Windows
+7 64-bit` or `Ubuntu 15.10`). If you are using an official release of GLFW,
+include the __GLFW release version__ (e.g. `3.1.2`), otherwise include the
+__GLFW commit ID__ (e.g. `3795d78b14ef06008889cc422a1fb8d642597751`) from Git.
+
+Please also include any __error messages__ provided to your application via the
+[error
+callback](https://www.glfw.org/docs/latest/intro_guide.html#error_handling) and
+the __full call stack__ of the crash, or if the crash does not occur in debug
+mode, mention that instead.
+
+
+#### Quick template
+
+```
+OS and version:
+Release or commit:
+Error messages:
+Call stack:
+```
+
+
+### Reporting a context creation bug
+
+__Note:__ Windows ships with graphics drivers that do not support OpenGL. If
+GLFW says that your machine lacks support for OpenGL, it very likely does.
+Install drivers from the computer manufacturer or graphics card manufacturer
+([Nvidia](https://www.geforce.com/drivers),
+[AMD](https://www.amd.com/en/support),
+[Intel](https://www-ssl.intel.com/content/www/us/en/support/detect.html)) to
+fix this.
+
+__Note:__ AMD only supports OpenGL ES on Windows via EGL. See the
+[GLFW\_CONTEXT\_CREATION\_API](https://www.glfw.org/docs/latest/window_guide.html#window_hints_ctx)
+hint for how to select EGL.
+
+Please verify that context creation also fails with the `glfwinfo` tool before
+reporting it as a bug. This tool is included in the GLFW source tree as
+`tests/glfwinfo.c` and is built along with the library. It has switches for all
+GLFW context and framebuffer hints. Run `glfwinfo -h` for a complete list.
+
+Always include the __operating system name and version__ (e.g. `Windows
+7 64-bit` or `Ubuntu 15.10`). If you are using an official release of GLFW,
+include the __GLFW release version__ (e.g. `3.1.2`), otherwise include the
+__GLFW commit ID__ (e.g. `3795d78b14ef06008889cc422a1fb8d642597751`) from Git.
+
+If you are running your program in a virtual machine, please mention this and
+include the __VM name and version__ (e.g. `VirtualBox 5.1`).
+
+Please also include the __GLFW version string__ (`3.2.0 X11 EGL clock_gettime
+/dev/js`), as described
+[here](https://www.glfw.org/docs/latest/intro.html#intro_version_string), the
+__GPU model and driver version__ (e.g. `GeForce GTX660 with 352.79`), and the
+__output of `glfwinfo`__ (with switches matching any hints you set in your
+code) when reporting this kind of bug. If this tool doesn't run on the machine,
+mention that instead.
+
+
+#### Quick template
+
+```
+OS and version:
+GPU and driver:
+Release or commit:
+Version string:
+glfwinfo output:
+```
+
+
+### Reporting a monitor or video mode bug
+
+__Note:__ On headless systems on some platforms, no monitors are reported. This
+causes glfwGetPrimaryMonitor to return `NULL`, which not all applications are
+prepared for.
+
+__Note:__ Some third-party tools report more video modes than are approved of
+by the OS. For safety and compatibility, GLFW only reports video modes the OS
+wants programs to use. This is not a bug.
+
+The `monitors` tool is included in the GLFW source tree as `tests/monitors.c`
+and is built along with the library. It lists all information GLFW provides
+about monitors it detects.
+
+Always include the __operating system name and version__ (e.g. `Windows
+7 64-bit` or `Ubuntu 15.10`). If you are using an official release of GLFW,
+include the __GLFW release version__ (e.g. `3.1.2`), otherwise include the
+__GLFW commit ID__ (e.g. `3795d78b14ef06008889cc422a1fb8d642597751`) from Git.
+
+If you are running your program in a virtual machine, please mention this and
+include the __VM name and version__ (e.g. `VirtualBox 5.1`).
+
+Please also include any __error messages__ provided to your application via the
+[error
+callback](https://www.glfw.org/docs/latest/intro_guide.html#error_handling) and
+the __output of `monitors`__ when reporting this kind of bug. If this tool
+doesn't run on the machine, mention this instead.
+
+
+#### Quick template
+
+```
+OS and version:
+Release or commit:
+Error messages:
+monitors output:
+```
+
+
+### Reporting a window, input or event bug
+
+__Note:__ The exact ordering of related window events will sometimes differ.
+
+__Note:__ Window moving and resizing (by the user) will block the main thread on
+some platforms. This is not a bug. Set a [refresh
+callback](https://www.glfw.org/docs/latest/window.html#window_refresh) if you
+want to keep the window contents updated during a move or size operation.
+
+The `events` tool is included in the GLFW source tree as `tests/events.c` and is
+built along with the library. It prints all information provided to every
+callback supported by GLFW as events occur. Each event is listed with the time
+and a unique number to make discussions about event logs easier. The tool has
+command-line options for creating multiple windows and full screen windows.
+
+Always include the __operating system name and version__ (e.g. `Windows
+7 64-bit` or `Ubuntu 15.10`). If you are using an official release of GLFW,
+include the __GLFW release version__ (e.g. `3.1.2`), otherwise include the
+__GLFW commit ID__ (e.g. `3795d78b14ef06008889cc422a1fb8d642597751`) from Git.
+
+If you are running your program in a virtual machine, please mention this and
+include the __VM name and version__ (e.g. `VirtualBox 5.1`).
+
+Please also include any __error messages__ provided to your application via the
+[error
+callback](https://www.glfw.org/docs/latest/intro_guide.html#error_handling) and
+if relevant, the __output of `events`__ when reporting this kind of bug. If
+this tool doesn't run on the machine, mention this instead.
+
+__X11:__ If possible, please include what desktop environment (e.g. GNOME,
+Unity, KDE) and/or window manager (e.g. Openbox, dwm, Window Maker) you are
+running. If the bug is related to keyboard input, please include any input
+method (e.g. ibus, SCIM) you are using.
+
+
+#### Quick template
+
+```
+OS and version:
+Release or commit:
+Error messages:
+events output:
+```
+
+
+### Reporting some other library bug
+
+Always include the __operating system name and version__ (e.g. `Windows
+7 64-bit` or `Ubuntu 15.10`). If you are using an official release of GLFW,
+include the __GLFW release version__ (e.g. `3.1.2`), otherwise include the
+__GLFW commit ID__ (e.g. `3795d78b14ef06008889cc422a1fb8d642597751`) from Git.
+
+Please also include any __error messages__ provided to your application via the
+[error
+callback](https://www.glfw.org/docs/latest/intro_guide.html#error_handling), if
+relevant.
+
+
+#### Quick template
+
+```
+OS and version:
+Release or commit:
+Error messages:
+```
+
+
+### Reporting a documentation bug
+
+If you found a bug in the documentation, including this file, then it's fine to
+just link to that web page or mention that source file. You don't need to match
+the source to the output or vice versa.
+
+
+### Reporting a website bug
+
+If the bug is in the documentation (anything under `/docs/`) then please see the
+section above. Bugs in the rest of the site are reported to the [website
+source repository](https://github.com/glfw/website/issues).
+
+
+## Requesting a feature
+
+Please explain why you need the feature and how you intend to use it. If you
+have a specific API design in mind, please add that as well. If you have or are
+planning to write code for the feature, see the section below.
+
+If there already is a request for the feature you need, add your specific use
+case unless it is already mentioned. If it is, give it a :+1:.
+
+
+## Contributing a bug fix
+
+__Note:__ You must have all necessary [intellectual
+property rights](https://en.wikipedia.org/wiki/Intellectual_property) to any
+code you contribute. If you did not write the code yourself, you must explain
+where it came from and under what license you received it. Even code using the
+same license as GLFW may not be copied without attribution.
+
+__There is no preferred patch size__. A one character fix is just as welcome as
+a thousand line one, if that is the appropriate size for the fix.
+
+In addition to the code, a complete bug fix includes:
+
+- Change log entry in `README.md`, describing the incorrect behavior
+- Credits entries in `CONTRIBUTORS.md` for all authors of the bug fix
+
+Bug fixes will not be rejected because they don't include all the above parts,
+but please keep in mind that maintainer time is finite and that there are many
+other bugs and features to work on.
+
+If the patch fixes a bug introduced after the last release, it should not get
+a change log entry.
+
+If you haven't already, read the excellent article [How to Write a Git Commit
+Message](https://chris.beams.io/posts/git-commit/).
+
+
+## Contributing a feature
+
+__Note:__ You must have all necessary rights to any code you contribute. If you
+did not write the code yourself, you must explain where it came from and under
+what license. Even code using the same license as GLFW may not be copied
+without attribution.
+
+__Note:__ If you haven't already implemented the feature, check first if there
+already is an open issue for it and if it's already being developed in an
+[experimental branch](https://github.com/glfw/glfw/branches/all).
+
+__There is no preferred patch size__. A one-character change is just as welcome
+as one adding a thousand lines, if that is the appropriate size for the
+feature.
+
+In addition to the code, a complete feature includes:
+
+- Change log entry in `README.md`, listing all new symbols
+- News page entry in `docs/news.md`, briefly describing the feature
+- Guide documentation, with minimal examples, in the relevant guide in the `docs` folder
+- Reference documentation, with all applicable tags
+- Cross-references and mentions in appropriate places
+- Credits entries in `CONTRIBUTORS.md` for all authors of the feature
+
+If the feature requires platform-specific code, at minimum stubs must be added
+for the new platform function to all supported and experimental platforms.
+
+If it adds a new callback, support for it must be added to `tests/event.c`.
+
+If it adds a new monitor property, support for it must be added to
+`tests/monitor.c`.
+
+If it adds a new OpenGL, OpenGL ES or Vulkan option or extension, support
+for it must be added to `tests/glfwinfo.c` and the behavior of the library when
+the extension is missing documented in `docs/compat.md`.
+
+If you haven't already, read the excellent article [How to Write a Git Commit
+Message](https://chris.beams.io/posts/git-commit/).
+
+Features will not be rejected because they don't include all the above parts,
+but please keep in mind that maintainer time is finite and that there are many
+other features and bugs to work on.
+
+Please also keep in mind that any part of the public API that has been included
+in a release cannot be changed until the next _major_ version. Features can be
+added and existing parts can sometimes be overloaded (in the general sense of
+doing more things, not in the C++ sense), but code written to the API of one
+minor release should both compile and run on subsequent minor releases.
+
diff --git a/external/GLFW/docs/Doxyfile.in b/external/GLFW/docs/Doxyfile.in
index c2069c5..27c4b3f 100644
--- a/external/GLFW/docs/Doxyfile.in
+++ b/external/GLFW/docs/Doxyfile.in
@@ -1,110 +1,151 @@
-# Doxyfile 1.8.3.1
+# Doxyfile 1.9.7
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project.
#
-# All text after a hash (#) is considered a comment and will be ignored.
+# All text after a double hash (##) is considered a comment and is placed in
+# front of the TAG it is preceding.
+#
+# All text after a single hash (#) is considered a comment and will be ignored.
# The format is:
-# TAG = value [value, ...]
-# For lists items can also be appended using:
-# TAG += value [value, ...]
-# Values that contain spaces should be placed between quotes (" ").
+# TAG = value [value, ...]
+# For lists, items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (\" \").
+#
+# Note:
+#
+# Use doxygen to compare the used configuration file with the template
+# configuration file:
+# doxygen -x [configFile]
+# Use doxygen to compare the used configuration file with the template
+# configuration file without replacing the environment variables or CMake type
+# replacement variables:
+# doxygen -x_noenv [configFile]
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
-# This tag specifies the encoding used for all characters in the config file
-# that follow. The default is UTF-8 which is also the encoding used for all
+# This tag specifies the encoding used for all characters in the configuration
+# file that follow. The default is UTF-8 which is also the encoding used for all
# text before the first occurrence of this tag. Doxygen uses libiconv (or the
# iconv built into libc) for the transcoding. See
-# http://www.gnu.org/software/libiconv for the list of possible encodings.
+# https://www.gnu.org/software/libiconv/ for the list of possible encodings.
+# The default value is: UTF-8.
DOXYFILE_ENCODING = UTF-8
-# The PROJECT_NAME tag is a single word (or sequence of words) that should
-# identify the project. Note that if you do not use Doxywizard you need
-# to put quotes around the project name if it contains spaces.
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
+# double-quotes, unless you are using Doxywizard) that should identify the
+# project for which the documentation is generated. This name is used in the
+# title of most generated pages and in a few other places.
+# The default value is: My Project.
PROJECT_NAME = "GLFW"
-# The PROJECT_NUMBER tag can be used to enter a project or revision number.
-# This could be handy for archiving the generated documentation or
-# if some version control system is used.
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
+# could be handy for archiving the generated documentation or if some version
+# control system is used.
-PROJECT_NUMBER = @GLFW_VERSION_FULL@
+PROJECT_NUMBER = @GLFW_VERSION@
# Using the PROJECT_BRIEF tag one can provide an optional one line description
-# for a project that appears at the top of each page and should give viewer
-# a quick idea about the purpose of the project. Keep the description short.
+# for a project that appears at the top of each page and should give viewer a
+# quick idea about the purpose of the project. Keep the description short.
PROJECT_BRIEF = "A multi-platform library for OpenGL, window and input"
-# With the PROJECT_LOGO tag one can specify an logo or icon that is
-# included in the documentation. The maximum height of the logo should not
-# exceed 55 pixels and the maximum width should not exceed 200 pixels.
-# Doxygen will copy the logo to the output directory.
+# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
+# in the documentation. The maximum height of the logo should not exceed 55
+# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
+# the logo to the output directory.
PROJECT_LOGO =
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
-# base path where the generated documentation will be put.
-# If a relative path is entered, it will be relative to the location
-# where doxygen was started. If left blank the current directory will be used.
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
+# into which the generated documentation will be written. If a relative path is
+# entered, it will be relative to the location where doxygen was started. If
+# left blank the current directory will be used.
OUTPUT_DIRECTORY = "@GLFW_BINARY_DIR@/docs"
-# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
-# 4096 sub-directories (in 2 levels) under the output directory of each output
-# format and will distribute the generated files over these directories.
-# Enabling this option can be useful when feeding doxygen a huge amount of
-# source files, where putting all generated files in the same directory would
-# otherwise cause performance problems for the file system.
+# If the CREATE_SUBDIRS tag is set to YES then doxygen will create up to 4096
+# sub-directories (in 2 levels) under the output directory of each output format
+# and will distribute the generated files over these directories. Enabling this
+# option can be useful when feeding doxygen a huge amount of source files, where
+# putting all generated files in the same directory would otherwise causes
+# performance problems for the file system. Adapt CREATE_SUBDIRS_LEVEL to
+# control the number of sub-directories.
+# The default value is: NO.
CREATE_SUBDIRS = NO
+# Controls the number of sub-directories that will be created when
+# CREATE_SUBDIRS tag is set to YES. Level 0 represents 16 directories, and every
+# level increment doubles the number of directories, resulting in 4096
+# directories at level 8 which is the default and also the maximum value. The
+# sub-directories are organized in 2 levels, the first level always has a fixed
+# number of 16 directories.
+# Minimum value: 0, maximum value: 8, default value: 8.
+# This tag requires that the tag CREATE_SUBDIRS is set to YES.
+
+CREATE_SUBDIRS_LEVEL = 8
+
+# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII
+# characters to appear in the names of generated files. If set to NO, non-ASCII
+# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode
+# U+3044.
+# The default value is: NO.
+
+ALLOW_UNICODE_NAMES = NO
+
# The OUTPUT_LANGUAGE tag is used to specify the language in which all
# documentation generated by doxygen is written. Doxygen will use this
# information to generate all constant output in the proper language.
-# The default language is English, other supported languages are:
-# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
-# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
-# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
-# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
-# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak,
-# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
+# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Bulgarian,
+# Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, English
+# (United States), Esperanto, Farsi (Persian), Finnish, French, German, Greek,
+# Hindi, Hungarian, Indonesian, Italian, Japanese, Japanese-en (Japanese with
+# English messages), Korean, Korean-en (Korean with English messages), Latvian,
+# Lithuanian, Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese,
+# Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish,
+# Swedish, Turkish, Ukrainian and Vietnamese.
+# The default value is: English.
OUTPUT_LANGUAGE = English
-# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
-# include brief member descriptions after the members that are listed in
-# the file and class documentation (similar to JavaDoc).
-# Set to NO to disable this.
+# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member
+# descriptions after the members that are listed in the file and class
+# documentation (similar to Javadoc). Set to NO to disable this.
+# The default value is: YES.
BRIEF_MEMBER_DESC = YES
-# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
-# the brief description of a member or function before the detailed description.
-# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief
+# description of a member or function before the detailed description
+#
+# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
# brief descriptions will be completely suppressed.
+# The default value is: YES.
REPEAT_BRIEF = NO
-# This tag implements a quasi-intelligent brief description abbreviator
-# that is used to form the text in various listings. Each string
-# in this list, if found as the leading text of the brief description, will be
-# stripped from the text and the result after processing the whole list, is
-# used as the annotated text. Otherwise, the brief description is used as-is.
-# If left blank, the following values are used ("$name" is automatically
-# replaced with the name of the entity): "The $name class" "The $name widget"
-# "The $name file" "is" "provides" "specifies" "contains"
-# "represents" "a" "an" "the"
+# This tag implements a quasi-intelligent brief description abbreviator that is
+# used to form the text in various listings. Each string in this list, if found
+# as the leading text of the brief description, will be stripped from the text
+# and the result, after processing the whole list, is used as the annotated
+# text. Otherwise, the brief description is used as-is. If left blank, the
+# following values are used ($name is automatically replaced with the name of
+# the entity):The $name class, The $name widget, The $name file, is, provides,
+# specifies, contains, represents, a, an and the.
ABBREVIATE_BRIEF =
# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
-# Doxygen will generate a detailed section even if there is only a brief
+# doxygen will generate a detailed section even if there is only a brief
# description.
+# The default value is: NO.
ALWAYS_DETAILED_SEC = YES
@@ -112,585 +153,843 @@ ALWAYS_DETAILED_SEC = YES
# inherited members of a class in the documentation of that class as if those
# members were ordinary class members. Constructors, destructors and assignment
# operators of the base classes will not be shown.
+# The default value is: NO.
INLINE_INHERITED_MEMB = NO
-# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
-# path before files name in the file list and in the header files. If set
-# to NO the shortest path that makes the file name unique will be used.
+# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path
+# before files name in the file list and in the header files. If set to NO the
+# shortest path that makes the file name unique will be used
+# The default value is: YES.
FULL_PATH_NAMES = NO
-# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
-# can be used to strip a user-defined part of the path. Stripping is
-# only done if one of the specified strings matches the left-hand part of
-# the path. The tag can be used to show relative paths in the file list.
-# If left blank the directory from which doxygen is run is used as the
-# path to strip. Note that you specify absolute paths here, but also
-# relative paths, which will be relative from the directory where doxygen is
-# started.
+# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
+# Stripping is only done if one of the specified strings matches the left-hand
+# part of the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the path to
+# strip.
+#
+# Note that you can specify absolute paths here, but also relative paths, which
+# will be relative from the directory where doxygen is started.
+# This tag requires that the tag FULL_PATH_NAMES is set to YES.
STRIP_FROM_PATH =
-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
-# the path mentioned in the documentation of a class, which tells
-# the reader which header file to include in order to use a class.
-# If left blank only the name of the header file containing the class
-# definition is used. Otherwise one should specify the include paths that
-# are normally passed to the compiler using the -I flag.
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
+# path mentioned in the documentation of a class, which tells the reader which
+# header file to include in order to use a class. If left blank only the name of
+# the header file containing the class definition is used. Otherwise one should
+# specify the list of include paths that are normally passed to the compiler
+# using the -I flag.
STRIP_FROM_INC_PATH =
-# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
-# (but less readable) file names. This can be useful if your file system
-# doesn't support long names like on DOS, Mac, or CD-ROM.
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
+# less readable) file names. This can be useful is your file systems doesn't
+# support long names like on DOS, Mac, or CD-ROM.
+# The default value is: NO.
SHORT_NAMES = NO
-# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
-# will interpret the first line (until the first dot) of a JavaDoc-style
-# comment as the brief description. If set to NO, the JavaDoc
-# comments will behave just like regular Qt-style comments
-# (thus requiring an explicit @brief command for a brief description.)
+# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
+# first line (until the first dot) of a Javadoc-style comment as the brief
+# description. If set to NO, the Javadoc-style will behave just like regular Qt-
+# style comments (thus requiring an explicit @brief command for a brief
+# description.)
+# The default value is: NO.
JAVADOC_AUTOBRIEF = NO
-# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
-# interpret the first line (until the first dot) of a Qt-style
-# comment as the brief description. If set to NO, the comments
-# will behave just like regular Qt-style comments (thus requiring
-# an explicit \brief command for a brief description.)
+# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line
+# such as
+# /***************
+# as being the beginning of a Javadoc-style comment "banner". If set to NO, the
+# Javadoc-style will behave just like regular comments and it will not be
+# interpreted by doxygen.
+# The default value is: NO.
+
+JAVADOC_BANNER = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
+# line (until the first dot) of a Qt-style comment as the brief description. If
+# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
+# requiring an explicit \brief command for a brief description.)
+# The default value is: NO.
QT_AUTOBRIEF = NO
-# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
-# treat a multi-line C++ special comment block (i.e. a block of //! or ///
-# comments) as a brief description. This used to be the default behaviour.
-# The new default is to treat a multi-line C++ comment block as a detailed
-# description. Set this tag to YES if you prefer the old behaviour instead.
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
+# multi-line C++ special comment block (i.e. a block of //! or /// comments) as
+# a brief description. This used to be the default behavior. The new default is
+# to treat a multi-line C++ comment block as a detailed description. Set this
+# tag to YES if you prefer the old behavior instead.
+#
+# Note that setting this tag to YES also means that rational rose comments are
+# not recognized any more.
+# The default value is: NO.
MULTILINE_CPP_IS_BRIEF = NO
-# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
-# member inherits the documentation from any documented member that it
-# re-implements.
+# By default Python docstrings are displayed as preformatted text and doxygen's
+# special commands cannot be used. By setting PYTHON_DOCSTRING to NO the
+# doxygen's special commands can be used and the contents of the docstring
+# documentation blocks is shown as doxygen documentation.
+# The default value is: YES.
+
+PYTHON_DOCSTRING = YES
+
+# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
+# documentation from any documented member that it re-implements.
+# The default value is: YES.
INHERIT_DOCS = YES
-# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
-# a new page for each member. If set to NO, the documentation of a member will
-# be part of the file/class/namespace that contains it.
+# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new
+# page for each member. If set to NO, the documentation of a member will be part
+# of the file/class/namespace that contains it.
+# The default value is: NO.
SEPARATE_MEMBER_PAGES = NO
-# The TAB_SIZE tag can be used to set the number of spaces in a tab.
-# Doxygen uses this value to replace tabs by spaces in code fragments.
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
+# uses this value to replace tabs by spaces in code fragments.
+# Minimum value: 1, maximum value: 16, default value: 4.
TAB_SIZE = 8
-# This tag can be used to specify a number of aliases that acts
-# as commands in the documentation. An alias has the form "name=value".
-# For example adding "sideeffect=\par Side Effects:\n" will allow you to
-# put the command \sideeffect (or @sideeffect) in the documentation, which
-# will result in a user-defined paragraph with heading "Side Effects:".
-# You can put \n's in the value part of an alias to insert newlines.
-
-ALIASES = "thread_safety=@par Thread safety\n" \
- "pointer_lifetime=@par Pointer lifetime\n" \
- "analysis=@par Analysis\n" \
- "reentrancy=@par Reentrancy\n" \
- "errors=@par Errors\n" \
- "glfw3=@par\n__GLFW 3:__" \
- "x11=__X11:__" \
- "wayland=__Wayland:__" \
- "win32=__Windows:__" \
- "macos=__macOS:__" \
- "linux=__Linux:__"
-
-# This tag can be used to specify a number of word-keyword mappings (TCL only).
-# A mapping has the form "name=value". For example adding
-# "class=itcl::class" will allow you to use the command class in the
-# itcl::class meaning.
-
-TCL_SUBST =
-
-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
-# sources only. Doxygen will then generate output that is more tailored for C.
-# For instance, some of the names that are used will be different. The list
-# of all members will be omitted, etc.
+# This tag can be used to specify a number of aliases that act as commands in
+# the documentation. An alias has the form:
+# name=value
+# For example adding
+# "sideeffect=@par Side Effects:^^"
+# will allow you to put the command \sideeffect (or @sideeffect) in the
+# documentation, which will result in a user-defined paragraph with heading
+# "Side Effects:". Note that you cannot put \n's in the value part of an alias
+# to insert newlines (in the resulting output). You can put ^^ in the value part
+# of an alias to insert a newline as if a physical newline was in the original
+# file. When you need a literal { or } or , in the value part of an alias you
+# have to escape them by means of a backslash (\), this can lead to conflicts
+# with the commands \{ and \} for these it is advised to use the version @{ and
+# @} or use a double escape (\\{ and \\})
+
+ALIASES = "thread_safety=@par Thread safety^^" \
+ "pointer_lifetime=@par Pointer lifetime^^" \
+ "analysis=@par Analysis^^" \
+ "reentrancy=@par Reentrancy^^" \
+ "errors=@par Errors^^" \
+ "callback_signature=@par Callback signature^^"
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
+# only. Doxygen will then generate output that is more tailored for C. For
+# instance, some of the names that are used will be different. The list of all
+# members will be omitted, etc.
+# The default value is: NO.
OPTIMIZE_OUTPUT_FOR_C = YES
-# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
-# sources only. Doxygen will then generate output that is more tailored for
-# Java. For instance, namespaces will be presented as packages, qualified
-# scopes will look different, etc.
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
+# Python sources only. Doxygen will then generate output that is more tailored
+# for that language. For instance, namespaces will be presented as packages,
+# qualified scopes will look different, etc.
+# The default value is: NO.
OPTIMIZE_OUTPUT_JAVA = NO
# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
-# sources only. Doxygen will then generate output that is more tailored for
-# Fortran.
+# sources. Doxygen will then generate output that is tailored for Fortran.
+# The default value is: NO.
OPTIMIZE_FOR_FORTRAN = NO
# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
-# sources. Doxygen will then generate output that is tailored for
-# VHDL.
+# sources. Doxygen will then generate output that is tailored for VHDL.
+# The default value is: NO.
OPTIMIZE_OUTPUT_VHDL = NO
+# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice
+# sources only. Doxygen will then generate output that is more tailored for that
+# language. For instance, namespaces will be presented as modules, types will be
+# separated into more groups, etc.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_SLICE = NO
+
# Doxygen selects the parser to use depending on the extension of the files it
# parses. With this tag you can assign which parser to use for a given
# extension. Doxygen has a built-in mapping, but you can override or extend it
-# using this tag. The format is ext=language, where ext is a file extension,
-# and language is one of the parsers supported by doxygen: IDL, Java,
-# Javascript, CSharp, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL, C,
-# C++. For instance to make doxygen treat .inc files as Fortran files (default
-# is PHP), and .f files as C (default is Fortran), use: inc=Fortran f=C. Note
-# that for custom extensions you also need to set FILE_PATTERNS otherwise the
-# files are not read by doxygen.
+# using this tag. The format is ext=language, where ext is a file extension, and
+# language is one of the parsers supported by doxygen: IDL, Java, JavaScript,
+# Csharp (C#), C, C++, Lex, D, PHP, md (Markdown), Objective-C, Python, Slice,
+# VHDL, Fortran (fixed format Fortran: FortranFixed, free formatted Fortran:
+# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser
+# tries to guess whether the code is fixed or free formatted code, this is the
+# default for Fortran type files). For instance to make doxygen treat .inc files
+# as Fortran files (default is PHP), and .f files as C (default is Fortran),
+# use: inc=Fortran f=C.
+#
+# Note: For files without extension you can use no_extension as a placeholder.
+#
+# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
+# the files are not read by doxygen. When specifying no_extension you should add
+# * to the FILE_PATTERNS.
+#
+# Note see also the list of default file extension mappings.
EXTENSION_MAPPING =
-# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all
-# comments according to the Markdown format, which allows for more readable
-# documentation. See http://daringfireball.net/projects/markdown/ for details.
-# The output of markdown processing is further processed by doxygen, so you
-# can mix doxygen, HTML, and XML commands with Markdown formatting.
-# Disable only in case of backward compatibilities issues.
+# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
+# according to the Markdown format, which allows for more readable
+# documentation. See https://daringfireball.net/projects/markdown/ for details.
+# The output of markdown processing is further processed by doxygen, so you can
+# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
+# case of backward compatibilities issues.
+# The default value is: YES.
MARKDOWN_SUPPORT = YES
-# When enabled doxygen tries to link words that correspond to documented classes,
-# or namespaces to their corresponding documentation. Such a link can be
-# prevented in individual cases by by putting a % sign in front of the word or
+# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up
+# to that level are automatically included in the table of contents, even if
+# they do not have an id attribute.
+# Note: This feature currently applies only to Markdown headings.
+# Minimum value: 0, maximum value: 99, default value: 5.
+# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.
+
+TOC_INCLUDE_HEADINGS = 5
+
+# The MARKDOWN_ID_STYLE tag can be used to specify the algorithm used to
+# generate identifiers for the Markdown headings. Note: Every identifier is
+# unique.
+# Possible values are: DOXYGEN Use a fixed 'autotoc_md' string followed by a
+# sequence number starting at 0. and GITHUB Use the lower case version of title
+# with any whitespace replaced by '-' and punctations characters removed..
+# The default value is: DOXYGEN.
+# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.
+
+MARKDOWN_ID_STYLE = DOXYGEN
+
+# When enabled doxygen tries to link words that correspond to documented
+# classes, or namespaces to their corresponding documentation. Such a link can
+# be prevented in individual cases by putting a % sign in front of the word or
# globally by setting AUTOLINK_SUPPORT to NO.
+# The default value is: YES.
AUTOLINK_SUPPORT = YES
# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
-# to include (a tag file for) the STL sources as input, then you should
-# set this tag to YES in order to let doxygen match functions declarations and
-# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
-# func(std::string) {}). This also makes the inheritance and collaboration
+# to include (a tag file for) the STL sources as input, then you should set this
+# tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string);
+# versus func(std::string) {}). This also make the inheritance and collaboration
# diagrams that involve STL classes more complete and accurate.
+# The default value is: NO.
BUILTIN_STL_SUPPORT = NO
# If you use Microsoft's C++/CLI language, you should set this option to YES to
# enable parsing support.
+# The default value is: NO.
CPP_CLI_SUPPORT = NO
-# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
-# Doxygen will parse them like normal C++ but will assume all classes use public
-# instead of private inheritance when no explicit protection keyword is present.
+# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
+# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen
+# will parse them like normal C++ but will assume all classes use public instead
+# of private inheritance when no explicit protection keyword is present.
+# The default value is: NO.
SIP_SUPPORT = NO
# For Microsoft's IDL there are propget and propput attributes to indicate
-# getter and setter methods for a property. Setting this option to YES (the
-# default) will make doxygen replace the get and set methods by a property in
-# the documentation. This will only work if the methods are indeed getting or
-# setting a simple type. If this is not the case, or you want to show the
-# methods anyway, you should set this option to NO.
+# getter and setter methods for a property. Setting this option to YES will make
+# doxygen to replace the get and set methods by a property in the documentation.
+# This will only work if the methods are indeed getting or setting a simple
+# type. If this is not the case, or you want to show the methods anyway, you
+# should set this option to NO.
+# The default value is: YES.
-IDL_PROPERTY_SUPPORT = NO
+IDL_PROPERTY_SUPPORT = YES
# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
-# tag is set to YES, then doxygen will reuse the documentation of the first
+# tag is set to YES then doxygen will reuse the documentation of the first
# member in the group (if any) for the other members of the group. By default
# all members of a group must be documented explicitly.
+# The default value is: NO.
DISTRIBUTE_GROUP_DOC = NO
-# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
-# the same type (for instance a group of public functions) to be put as a
-# subgroup of that type (e.g. under the Public Functions section). Set it to
-# NO to prevent subgrouping. Alternatively, this can be done per class using
-# the \nosubgrouping command.
+# If one adds a struct or class to a group and this option is enabled, then also
+# any nested class or struct is added to the same group. By default this option
+# is disabled and one has to add nested compounds explicitly via \ingroup.
+# The default value is: NO.
+
+GROUP_NESTED_COMPOUNDS = NO
+
+# Set the SUBGROUPING tag to YES to allow class member groups of the same type
+# (for instance a group of public functions) to be put as a subgroup of that
+# type (e.g. under the Public Functions section). Set it to NO to prevent
+# subgrouping. Alternatively, this can be done per class using the
+# \nosubgrouping command.
+# The default value is: YES.
SUBGROUPING = YES
-# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and
-# unions are shown inside the group in which they are included (e.g. using
-# @ingroup) instead of on a separate page (for HTML and Man pages) or
-# section (for LaTeX and RTF).
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
+# are shown inside the group in which they are included (e.g. using \ingroup)
+# instead of on a separate page (for HTML and Man pages) or section (for LaTeX
+# and RTF).
+#
+# Note that this feature does not work in combination with
+# SEPARATE_MEMBER_PAGES.
+# The default value is: NO.
INLINE_GROUPED_CLASSES = NO
-# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and
-# unions with only public data fields will be shown inline in the documentation
-# of the scope in which they are defined (i.e. file, namespace, or group
-# documentation), provided this scope is documented. If set to NO (the default),
-# structs, classes, and unions are shown on a separate page (for HTML and Man
-# pages) or section (for LaTeX and RTF).
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions
+# with only public data fields or simple typedef fields will be shown inline in
+# the documentation of the scope in which they are defined (i.e. file,
+# namespace, or group documentation), provided this scope is documented. If set
+# to NO, structs, classes, and unions are shown on a separate page (for HTML and
+# Man pages) or section (for LaTeX and RTF).
+# The default value is: NO.
INLINE_SIMPLE_STRUCTS = NO
-# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
-# is documented as struct, union, or enum with the name of the typedef. So
+# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
+# enum is documented as struct, union, or enum with the name of the typedef. So
# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
# with name TypeT. When disabled the typedef will appear as a member of a file,
-# namespace, or class. And the struct will be named TypeS. This can typically
-# be useful for C code in case the coding convention dictates that all compound
+# namespace, or class. And the struct will be named TypeS. This can typically be
+# useful for C code in case the coding convention dictates that all compound
# types are typedef'ed and only the typedef is referenced, never the tag name.
+# The default value is: NO.
TYPEDEF_HIDES_STRUCT = NO
-# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be
-# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given
-# their name and scope. Since this can be an expensive process and often the
-# same symbol appear multiple times in the code, doxygen keeps a cache of
-# pre-resolved symbols. If the cache is too small doxygen will become slower.
-# If the cache is too large, memory is wasted. The cache size is given by this
-# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0,
-# corresponding to a cache size of 2^16 = 65536 symbols.
+# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
+# cache is used to resolve symbols given their name and scope. Since this can be
+# an expensive process and often the same symbol appears multiple times in the
+# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
+# doxygen will become slower. If the cache is too large, memory is wasted. The
+# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
+# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
+# symbols. At the end of a run doxygen will report the cache usage and suggest
+# the optimal cache size from a speed point of view.
+# Minimum value: 0, maximum value: 9, default value: 0.
LOOKUP_CACHE_SIZE = 0
+# The NUM_PROC_THREADS specifies the number of threads doxygen is allowed to use
+# during processing. When set to 0 doxygen will based this on the number of
+# cores available in the system. You can set it explicitly to a value larger
+# than 0 to get more control over the balance between CPU load and processing
+# speed. At this moment only the input processing can be done using multiple
+# threads. Since this is still an experimental feature the default is set to 1,
+# which effectively disables parallel processing. Please report any issues you
+# encounter. Generating dot graphs in parallel is controlled by the
+# DOT_NUM_THREADS setting.
+# Minimum value: 0, maximum value: 32, default value: 1.
+
+NUM_PROC_THREADS = 1
+
+# If the TIMESTAMP tag is set different from NO then each generated page will
+# contain the date or date and time when the page was generated. Setting this to
+# NO can help when comparing the output of multiple runs.
+# Possible values are: YES, NO, DATETIME and DATE.
+# The default value is: NO.
+
+TIMESTAMP = NO
+
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
-# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
-# documentation are documented, even if no documentation was available.
-# Private class members and static file members will be hidden unless
-# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in
+# documentation are documented, even if no documentation was available. Private
+# class members and static file members will be hidden unless the
+# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
+# Note: This will also disable the warnings about undocumented members that are
+# normally produced when WARNINGS is set to YES.
+# The default value is: NO.
EXTRACT_ALL = YES
-# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
-# will be included in the documentation.
+# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will
+# be included in the documentation.
+# The default value is: NO.
EXTRACT_PRIVATE = NO
-# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal
+# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual
+# methods of a class will be included in the documentation.
+# The default value is: NO.
+
+EXTRACT_PRIV_VIRTUAL = NO
+
+# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal
# scope will be included in the documentation.
+# The default value is: NO.
EXTRACT_PACKAGE = NO
-# If the EXTRACT_STATIC tag is set to YES all static members of a file
-# will be included in the documentation.
+# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be
+# included in the documentation.
+# The default value is: NO.
EXTRACT_STATIC = NO
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
-# defined locally in source files will be included in the documentation.
-# If set to NO only classes defined in header files are included.
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined
+# locally in source files will be included in the documentation. If set to NO,
+# only classes defined in header files are included. Does not have any effect
+# for Java sources.
+# The default value is: YES.
EXTRACT_LOCAL_CLASSES = YES
-# This flag is only useful for Objective-C code. When set to YES local
-# methods, which are defined in the implementation section but not in
-# the interface are included in the documentation.
-# If set to NO (the default) only methods in the interface are included.
+# This flag is only useful for Objective-C code. If set to YES, local methods,
+# which are defined in the implementation section but not in the interface are
+# included in the documentation. If set to NO, only methods in the interface are
+# included.
+# The default value is: NO.
EXTRACT_LOCAL_METHODS = NO
# If this flag is set to YES, the members of anonymous namespaces will be
# extracted and appear in the documentation as a namespace called
-# 'anonymous_namespace{file}', where file will be replaced with the base
-# name of the file that contains the anonymous namespace. By default
-# anonymous namespaces are hidden.
+# 'anonymous_namespace{file}', where file will be replaced with the base name of
+# the file that contains the anonymous namespace. By default anonymous namespace
+# are hidden.
+# The default value is: NO.
EXTRACT_ANON_NSPACES = NO
-# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
-# undocumented members of documented classes, files or namespaces.
-# If set to NO (the default) these members will be included in the
-# various overviews, but no documentation section is generated.
-# This option has no effect if EXTRACT_ALL is enabled.
+# If this flag is set to YES, the name of an unnamed parameter in a declaration
+# will be determined by the corresponding definition. By default unnamed
+# parameters remain unnamed in the output.
+# The default value is: YES.
+
+RESOLVE_UNNAMED_PARAMS = YES
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
+# undocumented members inside documented classes or files. If set to NO these
+# members will be included in the various overviews, but no documentation
+# section is generated. This option has no effect if EXTRACT_ALL is enabled.
+# The default value is: NO.
HIDE_UNDOC_MEMBERS = NO
-# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
-# undocumented classes that are normally visible in the class hierarchy.
-# If set to NO (the default) these classes will be included in the various
-# overviews. This option has no effect if EXTRACT_ALL is enabled.
+# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy. If set
+# to NO, these classes will be included in the various overviews. This option
+# will also hide undocumented C++ concepts if enabled. This option has no effect
+# if EXTRACT_ALL is enabled.
+# The default value is: NO.
HIDE_UNDOC_CLASSES = NO
-# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
-# friend (class|struct|union) declarations.
-# If set to NO (the default) these declarations will be included in the
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
+# declarations. If set to NO, these declarations will be included in the
# documentation.
+# The default value is: NO.
HIDE_FRIEND_COMPOUNDS = NO
-# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
-# documentation blocks found inside the body of a function.
-# If set to NO (the default) these blocks will be appended to the
-# function's detailed documentation block.
+# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
+# documentation blocks found inside the body of a function. If set to NO, these
+# blocks will be appended to the function's detailed documentation block.
+# The default value is: NO.
HIDE_IN_BODY_DOCS = NO
-# The INTERNAL_DOCS tag determines if documentation
-# that is typed after a \internal command is included. If the tag is set
-# to NO (the default) then the documentation will be excluded.
-# Set it to YES to include the internal documentation.
+# The INTERNAL_DOCS tag determines if documentation that is typed after a
+# \internal command is included. If the tag is set to NO then the documentation
+# will be excluded. Set it to YES to include the internal documentation.
+# The default value is: NO.
INTERNAL_DOCS = NO
-# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
-# file names in lower-case letters. If set to YES upper-case letters are also
-# allowed. This is useful if you have classes or files whose names only differ
-# in case and if your file system supports case sensitive file names. Windows
-# and Mac users are advised to set this option to NO.
+# With the correct setting of option CASE_SENSE_NAMES doxygen will better be
+# able to match the capabilities of the underlying filesystem. In case the
+# filesystem is case sensitive (i.e. it supports files in the same directory
+# whose names only differ in casing), the option must be set to YES to properly
+# deal with such files in case they appear in the input. For filesystems that
+# are not case sensitive the option should be set to NO to properly deal with
+# output files written for symbols that only differ in casing, such as for two
+# classes, one named CLASS and the other named Class, and to also support
+# references to files without having to specify the exact matching casing. On
+# Windows (including Cygwin) and MacOS, users should typically set this option
+# to NO, whereas on Linux or other Unix flavors it should typically be set to
+# YES.
+# Possible values are: SYSTEM, NO and YES.
+# The default value is: SYSTEM.
+
+CASE_SENSE_NAMES = SYSTEM
+
+# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
+# their full class and namespace scopes in the documentation. If set to YES, the
+# scope will be hidden.
+# The default value is: NO.
-CASE_SENSE_NAMES = YES
+HIDE_SCOPE_NAMES = NO
-# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
-# will show members with their full class and namespace scopes in the
-# documentation. If set to YES the scope will be hidden.
+# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will
+# append additional text to a page's title, such as Class Reference. If set to
+# YES the compound reference will be hidden.
+# The default value is: NO.
-HIDE_SCOPE_NAMES = NO
+HIDE_COMPOUND_REFERENCE= NO
+
+# If the SHOW_HEADERFILE tag is set to YES then the documentation for a class
+# will show which file needs to be included to use the class.
+# The default value is: YES.
-# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
-# will put a list of the files that are included by a file in the documentation
-# of that file.
+SHOW_HEADERFILE = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
+# the files that are included by a file in the documentation of that file.
+# The default value is: YES.
SHOW_INCLUDE_FILES = NO
-# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
-# will list include files with double quotes in the documentation
-# rather than with sharp brackets.
+# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each
+# grouped member an include statement to the documentation, telling the reader
+# which file to include in order to use the member.
+# The default value is: NO.
+
+SHOW_GROUPED_MEMB_INC = NO
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include
+# files with double quotes in the documentation rather than with sharp brackets.
+# The default value is: NO.
FORCE_LOCAL_INCLUDES = NO
-# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
-# is inserted in the documentation for inline members.
+# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the
+# documentation for inline members.
+# The default value is: YES.
INLINE_INFO = YES
-# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
-# will sort the (detailed) documentation of file and class members
-# alphabetically by member name. If set to NO the members will appear in
-# declaration order.
+# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
+# (detailed) documentation of file and class members alphabetically by member
+# name. If set to NO, the members will appear in declaration order.
+# The default value is: YES.
SORT_MEMBER_DOCS = NO
-# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
-# brief documentation of file, namespace and class members alphabetically
-# by member name. If set to NO (the default) the members will appear in
-# declaration order.
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
+# descriptions of file, namespace and class members alphabetically by member
+# name. If set to NO, the members will appear in declaration order. Note that
+# this will also influence the order of the classes in the class list.
+# The default value is: NO.
SORT_BRIEF_DOCS = NO
-# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
-# will sort the (brief and detailed) documentation of class members so that
-# constructors and destructors are listed first. If set to NO (the default)
-# the constructors will appear in the respective orders defined by
-# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
-# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
-# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
+# (brief and detailed) documentation of class members so that constructors and
+# destructors are listed first. If set to NO the constructors will appear in the
+# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.
+# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief
+# member documentation.
+# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting
+# detailed member documentation.
+# The default value is: NO.
SORT_MEMBERS_CTORS_1ST = NO
-# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
-# hierarchy of group names into alphabetical order. If set to NO (the default)
-# the group names will appear in their defined order.
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
+# of group names into alphabetical order. If set to NO the group names will
+# appear in their defined order.
+# The default value is: NO.
SORT_GROUP_NAMES = YES
-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
-# sorted by fully-qualified names, including namespaces. If set to
-# NO (the default), the class list will be sorted only by class name,
-# not including the namespace part.
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by
+# fully-qualified names, including namespaces. If set to NO, the class list will
+# be sorted only by class name, not including the namespace part.
# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
-# Note: This option applies only to the class list, not to the
-# alphabetical list.
+# Note: This option applies only to the class list, not to the alphabetical
+# list.
+# The default value is: NO.
SORT_BY_SCOPE_NAME = NO
-# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to
-# do proper type resolution of all parameters of a function it will reject a
-# match between the prototype and the implementation of a member function even
-# if there is only one candidate or it is obvious which candidate to choose
-# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen
-# will still accept a match between prototype and implementation in such cases.
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
+# type resolution of all parameters of a function it will reject a match between
+# the prototype and the implementation of a member function even if there is
+# only one candidate or it is obvious which candidate to choose by doing a
+# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still
+# accept a match between prototype and implementation in such cases.
+# The default value is: NO.
STRICT_PROTO_MATCHING = NO
-# The GENERATE_TODOLIST tag can be used to enable (YES) or
-# disable (NO) the todo list. This list is created by putting \todo
-# commands in the documentation.
+# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo
+# list. This list is created by putting \todo commands in the documentation.
+# The default value is: YES.
GENERATE_TODOLIST = YES
-# The GENERATE_TESTLIST tag can be used to enable (YES) or
-# disable (NO) the test list. This list is created by putting \test
-# commands in the documentation.
+# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test
+# list. This list is created by putting \test commands in the documentation.
+# The default value is: YES.
GENERATE_TESTLIST = YES
-# The GENERATE_BUGLIST tag can be used to enable (YES) or
-# disable (NO) the bug list. This list is created by putting \bug
-# commands in the documentation.
+# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug
+# list. This list is created by putting \bug commands in the documentation.
+# The default value is: YES.
GENERATE_BUGLIST = YES
-# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
-# disable (NO) the deprecated list. This list is created by putting
-# \deprecated commands in the documentation.
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO)
+# the deprecated list. This list is created by putting \deprecated commands in
+# the documentation.
+# The default value is: YES.
GENERATE_DEPRECATEDLIST= YES
-# The ENABLED_SECTIONS tag can be used to enable conditional
-# documentation sections, marked by \if section-label ... \endif
-# and \cond section-label ... \endcond blocks.
+# The ENABLED_SECTIONS tag can be used to enable conditional documentation
+# sections, marked by \if ... \endif and \cond
+# ... \endcond blocks.
ENABLED_SECTIONS =
-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
-# the initial value of a variable or macro consists of for it to appear in
-# the documentation. If the initializer consists of more lines than specified
-# here it will be hidden. Use a value of 0 to hide initializers completely.
-# The appearance of the initializer of individual variables and macros in the
-# documentation can be controlled using \showinitializer or \hideinitializer
-# command in the documentation regardless of this setting.
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
+# initial value of a variable or macro / define can have for it to appear in the
+# documentation. If the initializer consists of more lines than specified here
+# it will be hidden. Use a value of 0 to hide initializers completely. The
+# appearance of the value of individual variables and macros / defines can be
+# controlled using \showinitializer or \hideinitializer command in the
+# documentation regardless of this setting.
+# Minimum value: 0, maximum value: 10000, default value: 30.
MAX_INITIALIZER_LINES = 30
-# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
-# at the bottom of the documentation of classes and structs. If set to YES the
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at
+# the bottom of the documentation of classes and structs. If set to YES, the
# list will mention the files that were used to generate the documentation.
+# The default value is: YES.
SHOW_USED_FILES = YES
-# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
-# This will remove the Files entry from the Quick Index and from the
-# Folder Tree View (if specified). The default is YES.
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
+# will remove the Files entry from the Quick Index and from the Folder Tree View
+# (if specified).
+# The default value is: YES.
SHOW_FILES = YES
-# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
-# Namespaces page.
-# This will remove the Namespaces entry from the Quick Index
-# and from the Folder Tree View (if specified). The default is YES.
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
+# page. This will remove the Namespaces entry from the Quick Index and from the
+# Folder Tree View (if specified).
+# The default value is: YES.
SHOW_NAMESPACES = NO
# The FILE_VERSION_FILTER tag can be used to specify a program or script that
# doxygen should invoke to get the current version for each file (typically from
# the version control system). Doxygen will invoke the program by executing (via
-# popen()) the command , where is the value of
-# the FILE_VERSION_FILTER tag, and is the name of an input file
-# provided by doxygen. Whatever the program writes to standard output
-# is used as the file version. See the manual for examples.
+# popen()) the command command input-file, where command is the value of the
+# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided
+# by doxygen. Whatever the program writes to standard output is used as the file
+# version. For an example see the documentation.
FILE_VERSION_FILTER =
# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
# by doxygen. The layout file controls the global structure of the generated
# output files in an output format independent way. To create the layout file
-# that represents doxygen's defaults, run doxygen with the -l option.
-# You can optionally specify a file name after the option, if omitted
-# DoxygenLayout.xml will be used as the name of the layout file.
+# that represents doxygen's defaults, run doxygen with the -l option. You can
+# optionally specify a file name after the option, if omitted DoxygenLayout.xml
+# will be used as the name of the layout file. See also section "Changing the
+# layout of pages" for information.
+#
+# Note that if you run doxygen from a directory containing a file called
+# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
+# tag is left empty.
-LAYOUT_FILE =
+LAYOUT_FILE = "@GLFW_SOURCE_DIR@/docs/DoxygenLayout.xml"
-# The CITE_BIB_FILES tag can be used to specify one or more bib files
-# containing the references data. This must be a list of .bib files. The
-# .bib extension is automatically appended if omitted. Using this command
-# requires the bibtex tool to be installed. See also
-# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style
-# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this
-# feature you need bibtex and perl available in the search path. Do not use
-# file names with spaces, bibtex cannot handle them.
+# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
+# the reference definitions. This must be a list of .bib files. The .bib
+# extension is automatically appended if omitted. This requires the bibtex tool
+# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info.
+# For LaTeX the style of the bibliography can be controlled using
+# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
+# search path. See also \cite for info how to create references.
CITE_BIB_FILES =
#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
+# Configuration options related to warning and progress messages
#---------------------------------------------------------------------------
-# The QUIET tag can be used to turn on/off the messages that are generated
-# by doxygen. Possible values are YES and NO. If left blank NO is used.
+# The QUIET tag can be used to turn on/off the messages that are generated to
+# standard output by doxygen. If QUIET is set to YES this implies that the
+# messages are off.
+# The default value is: NO.
QUIET = YES
# The WARNINGS tag can be used to turn on/off the warning messages that are
-# generated by doxygen. Possible values are YES and NO. If left blank
-# NO is used.
+# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES
+# this implies that the warnings are on.
+#
+# Tip: Turn warnings on while writing the documentation.
+# The default value is: YES.
WARNINGS = YES
-# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
-# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
-# automatically be disabled.
+# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate
+# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
+# will automatically be disabled.
+# The default value is: YES.
WARN_IF_UNDOCUMENTED = YES
-# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
-# potential errors in the documentation, such as not documenting some
-# parameters in a documented function, or documenting parameters that
-# don't exist or using markup commands wrongly.
+# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as documenting some parameters in
+# a documented function twice, or documenting parameters that don't exist or
+# using markup commands wrongly.
+# The default value is: YES.
WARN_IF_DOC_ERROR = YES
-# The WARN_NO_PARAMDOC option can be enabled to get warnings for
-# functions that are documented, but have no documentation for their parameters
-# or return value. If set to NO (the default) doxygen will only warn about
-# wrong or incomplete parameter documentation, but not about the absence of
-# documentation.
+# If WARN_IF_INCOMPLETE_DOC is set to YES, doxygen will warn about incomplete
+# function parameter documentation. If set to NO, doxygen will accept that some
+# parameters have no documentation without warning.
+# The default value is: YES.
+
+WARN_IF_INCOMPLETE_DOC = YES
+
+# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
+# are documented, but have no documentation for their parameters or return
+# value. If set to NO, doxygen will only warn about wrong parameter
+# documentation, but not about the absence of documentation. If EXTRACT_ALL is
+# set to YES then this flag will automatically be disabled. See also
+# WARN_IF_INCOMPLETE_DOC
+# The default value is: NO.
WARN_NO_PARAMDOC = YES
-# The WARN_FORMAT tag determines the format of the warning messages that
-# doxygen can produce. The string should contain the $file, $line, and $text
-# tags, which will be replaced by the file and line number from which the
-# warning originated and the warning text. Optionally the format may contain
-# $version, which will be replaced by the version of the file (if it could
-# be obtained via FILE_VERSION_FILTER)
+# If WARN_IF_UNDOC_ENUM_VAL option is set to YES, doxygen will warn about
+# undocumented enumeration values. If set to NO, doxygen will accept
+# undocumented enumeration values. If EXTRACT_ALL is set to YES then this flag
+# will automatically be disabled.
+# The default value is: NO.
+
+WARN_IF_UNDOC_ENUM_VAL = NO
+
+# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when
+# a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS
+# then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but
+# at the end of the doxygen process doxygen will return with a non-zero status.
+# If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS_PRINT then doxygen behaves
+# like FAIL_ON_WARNINGS but in case no WARN_LOGFILE is defined doxygen will not
+# write the warning messages in between other messages but write them at the end
+# of a run, in case a WARN_LOGFILE is defined the warning messages will be
+# besides being in the defined file also be shown at the end of a run, unless
+# the WARN_LOGFILE is defined as - i.e. standard output (stdout) in that case
+# the behavior will remain as with the setting FAIL_ON_WARNINGS.
+# Possible values are: NO, YES, FAIL_ON_WARNINGS and FAIL_ON_WARNINGS_PRINT.
+# The default value is: NO.
+
+WARN_AS_ERROR = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that doxygen
+# can produce. The string should contain the $file, $line, and $text tags, which
+# will be replaced by the file and line number from which the warning originated
+# and the warning text. Optionally the format may contain $version, which will
+# be replaced by the version of the file (if it could be obtained via
+# FILE_VERSION_FILTER)
+# See also: WARN_LINE_FORMAT
+# The default value is: $file:$line: $text.
WARN_FORMAT = "$file:$line: $text"
-# The WARN_LOGFILE tag can be used to specify a file to which warning
-# and error messages should be written. If left blank the output is written
-# to stderr.
+# In the $text part of the WARN_FORMAT command it is possible that a reference
+# to a more specific place is given. To make it easier to jump to this place
+# (outside of doxygen) the user can define a custom "cut" / "paste" string.
+# Example:
+# WARN_LINE_FORMAT = "'vi $file +$line'"
+# See also: WARN_FORMAT
+# The default value is: at line $line of file $file.
+
+WARN_LINE_FORMAT = "at line $line of file $file"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning and error
+# messages should be written. If left blank the output is written to standard
+# error (stderr). In case the file specified cannot be opened for writing the
+# warning and error messages are written to standard error. When as file - is
+# specified the warning and error messages are written to standard output
+# (stdout).
WARN_LOGFILE = "@GLFW_BINARY_DIR@/docs/warnings.txt"
#---------------------------------------------------------------------------
-# configuration options related to the input files
+# Configuration options related to the input files
#---------------------------------------------------------------------------
-# The INPUT tag can be used to specify the files and/or directories that contain
-# documented source files. You may enter file names like "myfile.cpp" or
-# directories like "/usr/src/myproject". Separate the files or directories
-# with spaces.
+# The INPUT tag is used to specify the files and/or directories that contain
+# documented source files. You may enter file names like myfile.cpp or
+# directories like /usr/src/myproject. Separate the files or directories with
+# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
+# Note: If this tag is empty the current directory is searched.
-INPUT = @GLFW_DOCS_SOURCES@
+INPUT = @GLFW_DOXYGEN_INPUT@
# This tag can be used to specify the character encoding of the source files
-# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
-# also the default input encoding. Doxygen uses libiconv (or the iconv built
-# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
-# the list of possible encodings.
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
+# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
+# documentation (see:
+# https://www.gnu.org/software/libiconv/) for the list of possible encodings.
+# See also: INPUT_FILE_ENCODING
+# The default value is: UTF-8.
INPUT_ENCODING = UTF-8
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses The INPUT_FILE_ENCODING tag can be used to specify
+# character encoding on a per file pattern basis. Doxygen will compare the file
+# name with each pattern and apply the encoding instead of the default
+# INPUT_ENCODING) if there is a match. The character encodings are a list of the
+# form: pattern=encoding (like *.php=ISO-8859-1). See cfg_input_encoding
+# "INPUT_ENCODING" for further information on supported encodings.
+
+INPUT_FILE_ENCODING =
+
# If the value of the INPUT tag contains directories, you can use the
-# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank the following patterns are tested:
-# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh
-# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py
-# *.f90 *.f *.for *.vhd *.vhdl
+# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
+# *.h) to filter out the source-files in the directories.
+#
+# Note that for custom extensions or not directly supported extensions you also
+# need to set EXTENSION_MAPPING for the extension otherwise the files are not
+# read by doxygen.
+#
+# Note the list of default checked file patterns might differ from the list of
+# default file extension mappings.
+#
+# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,
+# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,
+# *.hh, *.hxx, *.hpp, *.h++, *.l, *.cs, *.d, *.php, *.php4, *.php5, *.phtml,
+# *.inc, *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C
+# comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd,
+# *.vhdl, *.ucf, *.qsf and *.ice.
FILE_PATTERNS = *.h *.dox
-# The RECURSIVE tag can be used to turn specify whether or not subdirectories
-# should be searched for input files as well. Possible values are YES and NO.
-# If left blank NO is used.
+# The RECURSIVE tag can be used to specify whether or not subdirectories should
+# be searched for input files as well.
+# The default value is: NO.
RECURSIVE = NO
# The EXCLUDE tag can be used to specify files and/or directories that should be
# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
+#
# Note that relative paths are relative to the directory from which doxygen is
# run.
@@ -699,14 +998,16 @@ EXCLUDE =
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
# directories that are symbolic links (a Unix file system feature) are excluded
# from the input.
+# The default value is: NO.
EXCLUDE_SYMLINKS = NO
# If the value of the INPUT tag contains directories, you can use the
# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
-# certain files from those directories. Note that the wildcards are matched
-# against the file with absolute path, so to exclude all test directories
-# for example use the pattern */test/*
+# certain files from those directories.
+#
+# Note that the wildcards are matched against the file with absolute path, so to
+# exclude all test directories for example use the pattern */test/*
EXCLUDE_PATTERNS =
@@ -714,808 +1015,1233 @@ EXCLUDE_PATTERNS =
# (namespaces, classes, functions, etc.) that should be excluded from the
# output. The symbol name can be a fully qualified name, a word, or if the
# wildcard * is used, a substring. Examples: ANamespace, AClass,
-# AClass::ANamespace, ANamespace::*Test
+# ANamespace::AClass, ANamespace::*Test
EXCLUDE_SYMBOLS = APIENTRY GLFWAPI
-# The EXAMPLE_PATH tag can be used to specify one or more files or
-# directories that contain example code fragments that are included (see
-# the \include command).
+# The EXAMPLE_PATH tag can be used to specify one or more files or directories
+# that contain example code fragments that are included (see the \include
+# command).
EXAMPLE_PATH = "@GLFW_SOURCE_DIR@/examples"
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank all files are included.
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
+# *.h) to filter out the source-files in the directories. If left blank all
+# files are included.
EXAMPLE_PATTERNS =
# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
-# searched for input files to be used with the \include or \dontinclude
-# commands irrespective of the value of the RECURSIVE tag.
-# Possible values are YES and NO. If left blank NO is used.
+# searched for input files to be used with the \include or \dontinclude commands
+# irrespective of the value of the RECURSIVE tag.
+# The default value is: NO.
EXAMPLE_RECURSIVE = NO
-# The IMAGE_PATH tag can be used to specify one or more files or
-# directories that contain image that are included in the documentation (see
-# the \image command).
+# The IMAGE_PATH tag can be used to specify one or more files or directories
+# that contain images that are to be included in the documentation (see the
+# \image command).
IMAGE_PATH =
# The INPUT_FILTER tag can be used to specify a program that doxygen should
# invoke to filter for each input file. Doxygen will invoke the filter program
-# by executing (via popen()) the command , where
-# is the value of the INPUT_FILTER tag, and is the name of an
-# input file. Doxygen will then use the output that the filter program writes
-# to standard output.
-# If FILTER_PATTERNS is specified, this tag will be
-# ignored.
+# by executing (via popen()) the command:
+#
+#
+#
+# where is the value of the INPUT_FILTER tag, and is the
+# name of an input file. Doxygen will then use the output that the filter
+# program writes to standard output. If FILTER_PATTERNS is specified, this tag
+# will be ignored.
+#
+# Note that the filter must not add or remove lines; it is applied before the
+# code is scanned, but not when the output code is generated. If lines are added
+# or removed, the anchors will not be placed correctly.
+#
+# Note that doxygen will use the data processed and written to standard output
+# for further processing, therefore nothing else, like debug statements or used
+# commands (so in case of a Windows batch file always use @echo OFF), should be
+# written to standard output.
+#
+# Note that for custom extensions or not directly supported extensions you also
+# need to set EXTENSION_MAPPING for the extension otherwise the files are not
+# properly processed by doxygen.
INPUT_FILTER =
# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
-# basis.
-# Doxygen will compare the file name with each pattern and apply the
-# filter if there is a match.
-# The filters are a list of the form:
-# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
-# info on how filters are used. If FILTER_PATTERNS is empty or if
-# non of the patterns match the file name, INPUT_FILTER is applied.
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form: pattern=filter
+# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
+# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
+# patterns match the file name, INPUT_FILTER is applied.
+#
+# Note that for custom extensions or not directly supported extensions you also
+# need to set EXTENSION_MAPPING for the extension otherwise the files are not
+# properly processed by doxygen.
FILTER_PATTERNS =
# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
-# INPUT_FILTER) will be used to filter the input files when producing source
-# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+# INPUT_FILTER) will also be used to filter the input files that are used for
+# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
+# The default value is: NO.
FILTER_SOURCE_FILES = NO
# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
-# pattern. A pattern will override the setting for FILTER_PATTERN (if any)
-# and it is also possible to disable source filtering for a specific pattern
-# using *.ext= (so without naming a filter). This option only has effect when
-# FILTER_SOURCE_FILES is enabled.
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and
+# it is also possible to disable source filtering for a specific pattern using
+# *.ext= (so without naming a filter).
+# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
FILTER_SOURCE_PATTERNS =
-# If the USE_MD_FILE_AS_MAINPAGE tag refers to the name of a markdown file that
-# is part of the input, its contents will be placed on the main page (index.html).
-# This can be useful if you have a project on for instance GitHub and want reuse
-# the introduction page also for the doxygen output.
+# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
+# is part of the input, its contents will be placed on the main page
+# (index.html). This can be useful if you have a project on for instance GitHub
+# and want to reuse the introduction page also for the doxygen output.
USE_MDFILE_AS_MAINPAGE =
+# The Fortran standard specifies that for fixed formatted Fortran code all
+# characters from position 72 are to be considered as comment. A common
+# extension is to allow longer lines before the automatic comment starts. The
+# setting FORTRAN_COMMENT_AFTER will also make it possible that longer lines can
+# be processed before the automatic comment starts.
+# Minimum value: 7, maximum value: 10000, default value: 72.
+
+FORTRAN_COMMENT_AFTER = 72
+
#---------------------------------------------------------------------------
-# configuration options related to source browsing
+# Configuration options related to source browsing
#---------------------------------------------------------------------------
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will
-# be generated. Documented entities will be cross-referenced with these sources.
-# Note: To get rid of all source code in the generated output, make sure also
-# VERBATIM_HEADERS is set to NO.
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will be
+# generated. Documented entities will be cross-referenced with these sources.
+#
+# Note: To get rid of all source code in the generated output, make sure that
+# also VERBATIM_HEADERS is set to NO.
+# The default value is: NO.
SOURCE_BROWSER = NO
-# Setting the INLINE_SOURCES tag to YES will include the body
-# of functions and classes directly in the documentation.
+# Setting the INLINE_SOURCES tag to YES will include the body of functions,
+# classes and enums directly into the documentation.
+# The default value is: NO.
INLINE_SOURCES = NO
-# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
-# doxygen to hide any special comment blocks from generated source code
-# fragments. Normal C, C++ and Fortran comments will always remain visible.
+# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any
+# special comment blocks from generated source code fragments. Normal C, C++ and
+# Fortran comments will always remain visible.
+# The default value is: YES.
STRIP_CODE_COMMENTS = YES
-# If the REFERENCED_BY_RELATION tag is set to YES
-# then for each documented function all documented
-# functions referencing it will be listed.
+# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
+# entity all documented functions referencing it will be listed.
+# The default value is: NO.
REFERENCED_BY_RELATION = NO
-# If the REFERENCES_RELATION tag is set to YES
-# then for each documented function all documented entities
-# called/used by that function will be listed.
+# If the REFERENCES_RELATION tag is set to YES then for each documented function
+# all documented entities called/used by that function will be listed.
+# The default value is: NO.
REFERENCES_RELATION = NO
-# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
-# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
-# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
-# link to the source code.
-# Otherwise they will link to the documentation.
+# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
+# to YES then the hyperlinks from functions in REFERENCES_RELATION and
+# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will
+# link to the documentation.
+# The default value is: YES.
REFERENCES_LINK_SOURCE = YES
-# If the USE_HTAGS tag is set to YES then the references to source code
-# will point to the HTML generated by the htags(1) tool instead of doxygen
-# built-in source browser. The htags tool is part of GNU's global source
-# tagging system (see http://www.gnu.org/software/global/global.html). You
-# will need version 4.8.6 or higher.
+# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the
+# source code will show a tooltip with additional information such as prototype,
+# brief description and links to the definition and documentation. Since this
+# will make the HTML file larger and loading of large files a bit slower, you
+# can opt to disable this feature.
+# The default value is: YES.
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
+
+SOURCE_TOOLTIPS = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code will
+# point to the HTML generated by the htags(1) tool instead of doxygen built-in
+# source browser. The htags tool is part of GNU's global source tagging system
+# (see https://www.gnu.org/software/global/global.html). You will need version
+# 4.8.6 or higher.
+#
+# To use it do the following:
+# - Install the latest version of global
+# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file
+# - Make sure the INPUT points to the root of the source tree
+# - Run doxygen as normal
+#
+# Doxygen will invoke htags (and that will in turn invoke gtags), so these
+# tools must be available from the command line (i.e. in the search path).
+#
+# The result: instead of the source browser generated by doxygen, the links to
+# source code will now point to the output of htags.
+# The default value is: NO.
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
USE_HTAGS = NO
-# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
-# will generate a verbatim copy of the header file for each class for
-# which an include is specified. Set to NO to disable this.
+# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a
+# verbatim copy of the header file for each class for which an include is
+# specified. Set to NO to disable this.
+# See also: Section \class.
+# The default value is: YES.
VERBATIM_HEADERS = YES
#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
+# Configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
-# of all compounds will be generated. Enable this if the project
-# contains a lot of classes, structs, unions or interfaces.
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all
+# compounds will be generated. Enable this if the project contains a lot of
+# classes, structs, unions or interfaces.
+# The default value is: YES.
ALPHABETICAL_INDEX = YES
-# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
-# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
-# in which this list will be split (can be a number in the range [1..20])
-
-COLS_IN_ALPHA_INDEX = 5
-
-# In case all classes in a project start with a common prefix, all
-# classes will be put under the same header in the alphabetical index.
-# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
-# should be ignored while generating the index headers.
+# The IGNORE_PREFIX tag can be used to specify a prefix (or a list of prefixes)
+# that should be ignored while generating the index headers. The IGNORE_PREFIX
+# tag works for classes, function and member names. The entity will be placed in
+# the alphabetical list under the first letter of the entity name that remains
+# after removing the prefix.
+# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
IGNORE_PREFIX = glfw GLFW_
#---------------------------------------------------------------------------
-# configuration options related to the HTML output
+# Configuration options related to the HTML output
#---------------------------------------------------------------------------
-# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
-# generate HTML output.
+# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output
+# The default value is: YES.
GENERATE_HTML = YES
-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `html' will be used as the default path.
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: html.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_OUTPUT = html
-# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
-# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
-# doxygen will generate files with .html extension.
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
+# generated HTML page (for example: .htm, .php, .asp).
+# The default value is: .html.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_FILE_EXTENSION = .html
-# The HTML_HEADER tag can be used to specify a personal HTML header for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard header. Note that when using a custom header you are responsible
-# for the proper inclusion of any scripts and style sheets that doxygen
-# needs, which is dependent on the configuration options used.
-# It is advised to generate a default header using "doxygen -w html
-# header.html footer.html stylesheet.css YourConfigFile" and then modify
-# that header. Note that the header is subject to change so you typically
-# have to redo this when upgrading to a newer version of doxygen or when
-# changing the value of configuration settings such as GENERATE_TREEVIEW!
+# The HTML_HEADER tag can be used to specify a user-defined HTML header file for
+# each generated HTML page. If the tag is left blank doxygen will generate a
+# standard header.
+#
+# To get valid HTML the header file that includes any scripts and style sheets
+# that doxygen needs, which is dependent on the configuration options used (e.g.
+# the setting GENERATE_TREEVIEW). It is highly recommended to start with a
+# default header using
+# doxygen -w html new_header.html new_footer.html new_stylesheet.css
+# YourConfigFile
+# and then modify the file new_header.html. See also section "Doxygen usage"
+# for information on how to generate the default header that doxygen normally
+# uses.
+# Note: The header is subject to change so you typically have to regenerate the
+# default header when upgrading to a newer version of doxygen. For a description
+# of the possible markers and block names see the documentation.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_HEADER = "@GLFW_SOURCE_DIR@/docs/header.html"
-# The HTML_FOOTER tag can be used to specify a personal HTML footer for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard footer.
+# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
+# generated HTML page. If the tag is left blank doxygen will generate a standard
+# footer. See HTML_HEADER for more information on how to generate a default
+# footer and what special commands can be used inside the footer. See also
+# section "Doxygen usage" for information on how to generate the default footer
+# that doxygen normally uses.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_FOOTER = "@GLFW_SOURCE_DIR@/docs/footer.html"
-# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
-# style sheet that is used by each HTML page. It can be used to
-# fine-tune the look of the HTML output. If left blank doxygen will
-# generate a default style sheet. Note that it is recommended to use
-# HTML_EXTRA_STYLESHEET instead of this one, as it is more robust and this
-# tag will in the future become obsolete.
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
+# sheet that is used by each HTML page. It can be used to fine-tune the look of
+# the HTML output. If left blank doxygen will generate a default style sheet.
+# See also section "Doxygen usage" for information on how to generate the style
+# sheet that doxygen normally uses.
+# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as
+# it is more robust and this tag (HTML_STYLESHEET) will in the future become
+# obsolete.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_STYLESHEET =
-# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional
-# user-defined cascading style sheet that is included after the standard
-# style sheets created by doxygen. Using this option one can overrule
-# certain style aspects. This is preferred over using HTML_STYLESHEET
-# since it does not replace the standard style sheet and is therefor more
-# robust against future updates. Doxygen will copy the style sheet file to
-# the output directory.
+# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined
+# cascading style sheets that are included after the standard style sheets
+# created by doxygen. Using this option one can overrule certain style aspects.
+# This is preferred over using HTML_STYLESHEET since it does not replace the
+# standard style sheet and is therefore more robust against future updates.
+# Doxygen will copy the style sheet files to the output directory.
+# Note: The order of the extra style sheet files is of importance (e.g. the last
+# style sheet in the list overrules the setting of the previous ones in the
+# list).
+# Note: Since the styling of scrollbars can currently not be overruled in
+# Webkit/Chromium, the styling will be left out of the default doxygen.css if
+# one or more extra stylesheets have been specified. So if scrollbar
+# customization is desired it has to be added explicitly. For an example see the
+# documentation.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_EXTRA_STYLESHEET = "@GLFW_SOURCE_DIR@/docs/extra.css"
# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
# other source files which should be copied to the HTML output directory. Note
# that these files will be copied to the base HTML output directory. Use the
-# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
-# files. In the HTML_STYLESHEET file, use the file name only. Also note that
-# the files will be copied as-is; there are no commands or markers available.
+# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that the
+# files will be copied as-is; there are no commands or markers available.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_EXTRA_FILES = "@GLFW_SOURCE_DIR@/docs/spaces.svg"
-# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
-# Doxygen will adjust the colors in the style sheet and background images
-# according to this color. Hue is specified as an angle on a colorwheel,
-# see http://en.wikipedia.org/wiki/Hue for more information.
-# For instance the value 0 represents red, 60 is yellow, 120 is green,
-# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
-# The allowed range is 0 to 359.
+# The HTML_COLORSTYLE tag can be used to specify if the generated HTML output
+# should be rendered with a dark or light theme.
+# Possible values are: LIGHT always generate light mode output, DARK always
+# generate dark mode output, AUTO_LIGHT automatically set the mode according to
+# the user preference, use light mode if no preference is set (the default),
+# AUTO_DARK automatically set the mode according to the user preference, use
+# dark mode if no preference is set and TOGGLE allow to user to switch between
+# light and dark mode via a button.
+# The default value is: AUTO_LIGHT.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE = LIGHT
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
+# will adjust the colors in the style sheet and background images according to
+# this color. Hue is specified as an angle on a color-wheel, see
+# https://en.wikipedia.org/wiki/Hue for more information. For instance the value
+# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
+# purple, and 360 is red again.
+# Minimum value: 0, maximum value: 359, default value: 220.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_COLORSTYLE_HUE = 220
-# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
-# the colors in the HTML output. For a value of 0 the output will use
-# grayscales only. A value of 255 will produce the most vivid colors.
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
+# in the HTML output. For a value of 0 the output will use gray-scales only. A
+# value of 255 will produce the most vivid colors.
+# Minimum value: 0, maximum value: 255, default value: 100.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_COLORSTYLE_SAT = 100
-# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
-# the luminance component of the colors in the HTML output. Values below
-# 100 gradually make the output lighter, whereas values above 100 make
-# the output darker. The value divided by 100 is the actual gamma applied,
-# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
-# and 100 does not change the gamma.
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
+# luminance component of the colors in the HTML output. Values below 100
+# gradually make the output lighter, whereas values above 100 make the output
+# darker. The value divided by 100 is the actual gamma applied, so 80 represents
+# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not
+# change the gamma.
+# Minimum value: 40, maximum value: 240, default value: 80.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_COLORSTYLE_GAMMA = 80
-# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
-# page will contain the date and time when the page was generated. Setting
-# this to NO can help when comparing the output of multiple runs.
+# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML
+# documentation will contain a main index with vertical navigation menus that
+# are dynamically created via JavaScript. If disabled, the navigation index will
+# consists of multiple levels of tabs that are statically embedded in every HTML
+# page. Disable this option to support browsers that do not have JavaScript,
+# like the Qt help browser.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
-HTML_TIMESTAMP = YES
+HTML_DYNAMIC_MENUS = YES
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
# documentation will contain sections that can be hidden and shown after the
# page has loaded.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_DYNAMIC_SECTIONS = NO
-# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of
-# entries shown in the various tree structured indices initially; the user
-# can expand and collapse entries dynamically later on. Doxygen will expand
-# the tree to such a level that at most the specified number of entries are
-# visible (unless a fully collapsed tree already exceeds this amount).
-# So setting the number of entries 1 will produce a full collapsed tree by
-# default. 0 is a special value representing an infinite number of entries
-# and will result in a full expanded tree by default.
+# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
+# shown in the various tree structured indices initially; the user can expand
+# and collapse entries dynamically later on. Doxygen will expand the tree to
+# such a level that at most the specified number of entries are visible (unless
+# a fully collapsed tree already exceeds this amount). So setting the number of
+# entries 1 will produce a full collapsed tree by default. 0 is a special value
+# representing an infinite number of entries and will result in a full expanded
+# tree by default.
+# Minimum value: 0, maximum value: 9999, default value: 100.
+# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_INDEX_NUM_ENTRIES = 100
-# If the GENERATE_DOCSET tag is set to YES, additional index files
-# will be generated that can be used as input for Apple's Xcode 3
-# integrated development environment, introduced with OSX 10.5 (Leopard).
-# To create a documentation set, doxygen will generate a Makefile in the
-# HTML output directory. Running make will produce the docset in that
-# directory and running "make install" will install the docset in
-# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
-# it at startup.
-# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
-# for more information.
+# If the GENERATE_DOCSET tag is set to YES, additional index files will be
+# generated that can be used as input for Apple's Xcode 3 integrated development
+# environment (see:
+# https://developer.apple.com/xcode/), introduced with OSX 10.5 (Leopard). To
+# create a documentation set, doxygen will generate a Makefile in the HTML
+# output directory. Running make will produce the docset in that directory and
+# running make install will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
+# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy
+# genXcode/_index.html for more information.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_DOCSET = NO
-# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
-# feed. A documentation feed provides an umbrella under which multiple
-# documentation sets from a single provider (such as a company or product suite)
-# can be grouped.
+# This tag determines the name of the docset feed. A documentation feed provides
+# an umbrella under which multiple documentation sets from a single provider
+# (such as a company or product suite) can be grouped.
+# The default value is: Doxygen generated docs.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_FEEDNAME = "Doxygen generated docs"
-# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
-# should uniquely identify the documentation set bundle. This should be a
-# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
-# will append .docset to the name.
+# This tag determines the URL of the docset feed. A documentation feed provides
+# an umbrella under which multiple documentation sets from a single provider
+# (such as a company or product suite) can be grouped.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_FEEDURL =
+
+# This tag specifies a string that should uniquely identify the documentation
+# set bundle. This should be a reverse domain-name style string, e.g.
+# com.mycompany.MyDocSet. Doxygen will append .docset to the name.
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_BUNDLE_ID = org.doxygen.Project
-# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely
-# identify the documentation publisher. This should be a reverse domain-name
-# style string, e.g. com.mycompany.MyDocSet.documentation.
+# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify
+# the documentation publisher. This should be a reverse domain-name style
+# string, e.g. com.mycompany.MyDocSet.documentation.
+# The default value is: org.doxygen.Publisher.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_PUBLISHER_ID = org.doxygen.Publisher
-# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
+# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
+# The default value is: Publisher.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
DOCSET_PUBLISHER_NAME = Publisher
-# If the GENERATE_HTMLHELP tag is set to YES, additional index files
-# will be generated that can be used as input for tools like the
-# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
-# of the generated HTML documentation.
+# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
+# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
+# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
+# on Windows. In the beginning of 2021 Microsoft took the original page, with
+# a.o. the download links, offline the HTML help workshop was already many years
+# in maintenance mode). You can download the HTML help workshop from the web
+# archives at Installation executable (see:
+# http://web.archive.org/web/20160201063255/http://download.microsoft.com/downlo
+# ad/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe).
+#
+# The HTML Help Workshop contains a compiler that can convert all HTML output
+# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
+# files are now used as the Windows 98 help format, and will replace the old
+# Windows help format (.hlp) on all Windows platforms in the future. Compressed
+# HTML files also contain an index, a table of contents, and you can search for
+# words in the documentation. The HTML workshop also contains a viewer for
+# compressed HTML files.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_HTMLHELP = NO
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
-# be used to specify the file name of the resulting .chm file. You
-# can add a path in front of the file if the result should not be
+# The CHM_FILE tag can be used to specify the file name of the resulting .chm
+# file. You can add a path in front of the file if the result should not be
# written to the html output directory.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
CHM_FILE =
-# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
-# be used to specify the location (absolute path including file name) of
-# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
-# the HTML help compiler on the generated index.hhp.
+# The HHC_LOCATION tag can be used to specify the location (absolute path
+# including file name) of the HTML help compiler (hhc.exe). If non-empty,
+# doxygen will try to run the HTML help compiler on the generated index.hhp.
+# The file has to be specified with full path.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
HHC_LOCATION =
-# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
-# controls if a separate .chi index file is generated (YES) or that
-# it should be included in the master .chm file (NO).
+# The GENERATE_CHI flag controls if a separate .chi index file is generated
+# (YES) or that it should be included in the main .chm file (NO).
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
GENERATE_CHI = NO
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
-# is used to encode HtmlHelp index (hhk), content (hhc) and project file
-# content.
+# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc)
+# and project file content.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
CHM_INDEX_ENCODING =
-# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
-# controls whether a binary table of contents is generated (YES) or a
-# normal table of contents (NO) in the .chm file.
+# The BINARY_TOC flag controls whether a binary table of contents is generated
+# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it
+# enables the Previous and Next buttons.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
BINARY_TOC = NO
-# The TOC_EXPAND flag can be set to YES to add extra items for group members
-# to the contents of the HTML help documentation and to the tree view.
+# The TOC_EXPAND flag can be set to YES to add extra items for group members to
+# the table of contents of the HTML help documentation and to the tree view.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
TOC_EXPAND = NO
+# The SITEMAP_URL tag is used to specify the full URL of the place where the
+# generated documentation will be placed on the server by the user during the
+# deployment of the documentation. The generated sitemap is called sitemap.xml
+# and placed on the directory specified by HTML_OUTPUT. In case no SITEMAP_URL
+# is specified no sitemap is generated. For information about the sitemap
+# protocol see https://www.sitemaps.org
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+SITEMAP_URL =
+
# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
-# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
-# that can be used as input for Qt's qhelpgenerator to generate a
-# Qt Compressed Help (.qch) of the generated HTML documentation.
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
+# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
+# (.qch) of the generated HTML documentation.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_QHP = NO
-# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
-# be used to specify the file name of the resulting .qch file.
-# The path specified is relative to the HTML output folder.
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify
+# the file name of the resulting .qch file. The path specified is relative to
+# the HTML output folder.
+# This tag requires that the tag GENERATE_QHP is set to YES.
QCH_FILE =
-# The QHP_NAMESPACE tag specifies the namespace to use when generating
-# Qt Help Project output. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#namespace
+# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
+# Project output. For more information please see Qt Help Project / Namespace
+# (see:
+# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace).
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_NAMESPACE = org.doxygen.Project
-# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
-# Qt Help Project output. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#virtual-folders
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
+# Help Project output. For more information please see Qt Help Project / Virtual
+# Folders (see:
+# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders).
+# The default value is: doc.
+# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_VIRTUAL_FOLDER = doc
-# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
-# add. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#custom-filters
+# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
+# filter to add. For more information please see Qt Help Project / Custom
+# Filters (see:
+# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters).
+# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_CUST_FILTER_NAME =
-# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
-# custom filter to add. For more information please see
-#
-# Qt Help Project / Custom Filters .
+# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see Qt Help Project / Custom
+# Filters (see:
+# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters).
+# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_CUST_FILTER_ATTRS =
# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
-# project's
-# filter section matches.
-#
-# Qt Help Project / Filter Attributes .
+# project's filter section matches. Qt Help Project / Filter Attributes (see:
+# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes).
+# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_SECT_FILTER_ATTRS =
-# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
-# be used to specify the location of Qt's qhelpgenerator.
-# If non-empty doxygen will try to run qhelpgenerator on the generated
-# .qhp file.
+# The QHG_LOCATION tag can be used to specify the location (absolute path
+# including file name) of Qt's qhelpgenerator. If non-empty doxygen will try to
+# run qhelpgenerator on the generated .qhp file.
+# This tag requires that the tag GENERATE_QHP is set to YES.
QHG_LOCATION =
-# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
-# will be generated, which together with the HTML files, form an Eclipse help
-# plugin. To install this plugin and make it available under the help contents
-# menu in Eclipse, the contents of the directory containing the HTML and XML
-# files needs to be copied into the plugins directory of eclipse. The name of
-# the directory within the plugins directory should be the same as
-# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
-# the help appears.
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
+# generated, together with the HTML files, they form an Eclipse help plugin. To
+# install this plugin and make it available under the help contents menu in
+# Eclipse, the contents of the directory containing the HTML and XML files needs
+# to be copied into the plugins directory of eclipse. The name of the directory
+# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.
+# After copying Eclipse needs to be restarted before the help appears.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_ECLIPSEHELP = NO
-# A unique identifier for the eclipse help plugin. When installing the plugin
-# the directory name containing the HTML and XML files should also have
-# this name.
+# A unique identifier for the Eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have this
+# name. Each documentation set should have its own identifier.
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.
ECLIPSE_DOC_ID = org.doxygen.Project
-# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs)
-# at top of each HTML page. The value NO (the default) enables the index and
-# the value YES disables it. Since the tabs have the same information as the
-# navigation tree you can set this option to NO if you already set
-# GENERATE_TREEVIEW to YES.
+# If you want full control over the layout of the generated HTML pages it might
+# be necessary to disable the index and replace it with your own. The
+# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top
+# of each HTML page. A value of NO enables the index and the value YES disables
+# it. Since the tabs in the index contain the same information as the navigation
+# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
DISABLE_INDEX = NO
# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
-# structure should be generated to display hierarchical information.
-# If the tag value is set to YES, a side panel will be generated
-# containing a tree-like index structure (just like the one that
-# is generated for HTML Help). For this to work a browser that supports
-# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
-# Windows users are probably better off using the HTML help feature.
-# Since the tree basically has the same information as the tab index you
-# could consider to set DISABLE_INDEX to NO when enabling this option.
+# structure should be generated to display hierarchical information. If the tag
+# value is set to YES, a side panel will be generated containing a tree-like
+# index structure (just like the one that is generated for HTML Help). For this
+# to work a browser that supports JavaScript, DHTML, CSS and frames is required
+# (i.e. any modern browser). Windows users are probably better off using the
+# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can
+# further fine tune the look of the index (see "Fine-tuning the output"). As an
+# example, the default style sheet generated by doxygen has an example that
+# shows how to put an image at the root of the tree instead of the PROJECT_NAME.
+# Since the tree basically has the same information as the tab index, you could
+# consider setting DISABLE_INDEX to YES when enabling this option.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_TREEVIEW = NO
-# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values
-# (range [0,1..20]) that doxygen will group on one line in the generated HTML
-# documentation. Note that a value of 0 will completely suppress the enum
-# values from appearing in the overview section.
+# When both GENERATE_TREEVIEW and DISABLE_INDEX are set to YES, then the
+# FULL_SIDEBAR option determines if the side bar is limited to only the treeview
+# area (value NO) or if it should extend to the full height of the window (value
+# YES). Setting this to YES gives a layout similar to
+# https://docs.readthedocs.io with more room for contents, but less room for the
+# project logo, title, and description. If either GENERATE_TREEVIEW or
+# DISABLE_INDEX is set to NO, this option has no effect.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+FULL_SIDEBAR = NO
+
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
+# doxygen will group on one line in the generated HTML documentation.
+#
+# Note that a value of 0 will completely suppress the enum values from appearing
+# in the overview section.
+# Minimum value: 0, maximum value: 20, default value: 4.
+# This tag requires that the tag GENERATE_HTML is set to YES.
ENUM_VALUES_PER_LINE = 4
-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
-# used to set the initial width (in pixels) of the frame in which the tree
-# is shown.
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
+# to set the initial width (in pixels) of the frame in which the tree is shown.
+# Minimum value: 0, maximum value: 1500, default value: 250.
+# This tag requires that the tag GENERATE_HTML is set to YES.
-TREEVIEW_WIDTH = 300
+TREEVIEW_WIDTH = 250
-# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
-# links to external symbols imported via tag files in a separate window.
+# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to
+# external symbols imported via tag files in a separate window.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
EXT_LINKS_IN_WINDOW = NO
-# Use this tag to change the font size of Latex formulas included
-# as images in the HTML documentation. The default is 10. Note that
-# when you change the font size after a successful doxygen run you need
-# to manually remove any form_*.png images from the HTML output directory
-# to force them to be regenerated.
+# If the OBFUSCATE_EMAILS tag is set to YES, doxygen will obfuscate email
+# addresses.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+OBFUSCATE_EMAILS = YES
+
+# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg
+# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see
+# https://inkscape.org) to generate formulas as SVG images instead of PNGs for
+# the HTML output. These images will generally look nicer at scaled resolutions.
+# Possible values are: png (the default) and svg (looks nicer but requires the
+# pdf2svg or inkscape tool).
+# The default value is: png.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_FORMULA_FORMAT = png
+
+# Use this tag to change the font size of LaTeX formulas included as images in
+# the HTML documentation. When you change the font size after a successful
+# doxygen run you need to manually remove any form_*.png images from the HTML
+# output directory to force them to be regenerated.
+# Minimum value: 8, maximum value: 50, default value: 10.
+# This tag requires that the tag GENERATE_HTML is set to YES.
FORMULA_FONTSIZE = 10
-# Use the FORMULA_TRANPARENT tag to determine whether or not the images
-# generated for formulas are transparent PNGs. Transparent PNGs are
-# not supported properly for IE 6.0, but are supported on all modern browsers.
-# Note that when changing this option you need to delete any form_*.png files
-# in the HTML output before the changes have effect.
+# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands
+# to create new LaTeX commands to be used in formulas as building blocks. See
+# the section "Including formulas" for details.
-FORMULA_TRANSPARENT = YES
+FORMULA_MACROFILE =
-# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax
-# (see http://www.mathjax.org) which uses client side Javascript for the
-# rendering instead of using prerendered bitmaps. Use this if you do not
-# have LaTeX installed or if you want to formulas look prettier in the HTML
-# output. When enabled you may also need to install MathJax separately and
-# configure the path to it using the MATHJAX_RELPATH option.
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
+# https://www.mathjax.org) which uses client side JavaScript for the rendering
+# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX
+# installed or if you want to formulas look prettier in the HTML output. When
+# enabled you may also need to install MathJax separately and configure the path
+# to it using the MATHJAX_RELPATH option.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
USE_MATHJAX = NO
-# When MathJax is enabled you can set the default output format to be used for
-# thA MathJax output. Supported types are HTML-CSS, NativeMML (i.e. MathML) and
-# SVG. The default value is HTML-CSS, which is slower, but has the best
-# compatibility.
+# With MATHJAX_VERSION it is possible to specify the MathJax version to be used.
+# Note that the different versions of MathJax have different requirements with
+# regards to the different settings, so it is possible that also other MathJax
+# settings have to be changed when switching between the different MathJax
+# versions.
+# Possible values are: MathJax_2 and MathJax_3.
+# The default value is: MathJax_2.
+# This tag requires that the tag USE_MATHJAX is set to YES.
-MATHJAX_FORMAT = HTML-CSS
+MATHJAX_VERSION = MathJax_2
-# When MathJax is enabled you need to specify the location relative to the
-# HTML output directory using the MATHJAX_RELPATH option. The destination
-# directory should contain the MathJax.js script. For instance, if the mathjax
-# directory is located at the same level as the HTML output directory, then
-# MATHJAX_RELPATH should be ../mathjax. The default value points to
-# the MathJax Content Delivery Network so you can quickly see the result without
-# installing MathJax.
-# However, it is strongly recommended to install a local
-# copy of MathJax from http://www.mathjax.org before deployment.
+# When MathJax is enabled you can set the default output format to be used for
+# the MathJax output. For more details about the output format see MathJax
+# version 2 (see:
+# http://docs.mathjax.org/en/v2.7-latest/output.html) and MathJax version 3
+# (see:
+# http://docs.mathjax.org/en/latest/web/components/output.html).
+# Possible values are: HTML-CSS (which is slower, but has the best
+# compatibility. This is the name for Mathjax version 2, for MathJax version 3
+# this will be translated into chtml), NativeMML (i.e. MathML. Only supported
+# for NathJax 2. For MathJax version 3 chtml will be used instead.), chtml (This
+# is the name for Mathjax version 3, for MathJax version 2 this will be
+# translated into HTML-CSS) and SVG.
+# The default value is: HTML-CSS.
+# This tag requires that the tag USE_MATHJAX is set to YES.
-MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
+MATHJAX_FORMAT = HTML-CSS
-# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension
-# names that should be enabled during MathJax rendering.
+# When MathJax is enabled you need to specify the location relative to the HTML
+# output directory using the MATHJAX_RELPATH option. The destination directory
+# should contain the MathJax.js script. For instance, if the mathjax directory
+# is located at the same level as the HTML output directory, then
+# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
+# Content Delivery Network so you can quickly see the result without installing
+# MathJax. However, it is strongly recommended to install a local copy of
+# MathJax from https://www.mathjax.org before deployment. The default value is:
+# - in case of MathJax version 2: https://cdn.jsdelivr.net/npm/mathjax@2
+# - in case of MathJax version 3: https://cdn.jsdelivr.net/npm/mathjax@3
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_RELPATH =
+
+# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
+# extension names that should be enabled during MathJax rendering. For example
+# for MathJax version 2 (see
+# https://docs.mathjax.org/en/v2.7-latest/tex.html#tex-and-latex-extensions):
+# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
+# For example for MathJax version 3 (see
+# http://docs.mathjax.org/en/latest/input/tex/extensions/index.html):
+# MATHJAX_EXTENSIONS = ams
+# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_EXTENSIONS =
-# When the SEARCHENGINE tag is enabled doxygen will generate a search box
-# for the HTML output. The underlying search engine uses javascript
-# and DHTML and should work on any modern browser. Note that when using
-# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
-# (GENERATE_DOCSET) there is already a search function so this one should
-# typically be disabled. For large projects the javascript based search engine
-# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
+# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
+# of code that will be used on startup of the MathJax code. See the MathJax site
+# (see:
+# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. For an
+# example see the documentation.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_CODEFILE =
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
+# the HTML output. The underlying search engine uses javascript and DHTML and
+# should work on any modern browser. Note that when using HTML help
+# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)
+# there is already a search function so this one should typically be disabled.
+# For large projects the javascript based search engine can be slow, then
+# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to
+# search using the keyboard; to jump to the search box use + S
+# (what the is depends on the OS and browser, but it is typically
+# , /, or both). Inside the search box use the to jump into the search results window, the results can be navigated
+# using the . Press to select an item or to cancel
+# the search. The filter options can be selected when the cursor is inside the
+# search box by pressing +. Also here use the
+# to select a filter and or to activate or cancel the filter
+# option.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
SEARCHENGINE = YES
# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
-# implemented using a web server instead of a web client using Javascript.
-# There are two flavours of web server based search depending on the
-# EXTERNAL_SEARCH setting. When disabled, doxygen will generate a PHP script for
-# searching and an index file used by the script. When EXTERNAL_SEARCH is
-# enabled the indexing and searching needs to be provided by external tools.
-# See the manual for details.
+# implemented using a web server instead of a web client using JavaScript. There
+# are two flavors of web server based searching depending on the EXTERNAL_SEARCH
+# setting. When disabled, doxygen will generate a PHP script for searching and
+# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing
+# and searching needs to be provided by external tools. See the section
+# "External Indexing and Searching" for details.
+# The default value is: NO.
+# This tag requires that the tag SEARCHENGINE is set to YES.
SERVER_BASED_SEARCH = NO
-# When EXTERNAL_SEARCH is enabled doxygen will no longer generate the PHP
+# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP
# script for searching. Instead the search results are written to an XML file
# which needs to be processed by an external indexer. Doxygen will invoke an
-# external search engine pointed to by the SEARCHENGINE_URL option to obtain
-# the search results. Doxygen ships with an example indexer (doxyindexer) and
-# search engine (doxysearch.cgi) which are based on the open source search engine
-# library Xapian. See the manual for configuration details.
+# external search engine pointed to by the SEARCHENGINE_URL option to obtain the
+# search results.
+#
+# Doxygen ships with an example indexer (doxyindexer) and search engine
+# (doxysearch.cgi) which are based on the open source search engine library
+# Xapian (see:
+# https://xapian.org/).
+#
+# See the section "External Indexing and Searching" for details.
+# The default value is: NO.
+# This tag requires that the tag SEARCHENGINE is set to YES.
EXTERNAL_SEARCH = NO
# The SEARCHENGINE_URL should point to a search engine hosted by a web server
-# which will returned the search results when EXTERNAL_SEARCH is enabled.
-# Doxygen ships with an example search engine (doxysearch) which is based on
-# the open source search engine library Xapian. See the manual for configuration
+# which will return the search results when EXTERNAL_SEARCH is enabled.
+#
+# Doxygen ships with an example indexer (doxyindexer) and search engine
+# (doxysearch.cgi) which are based on the open source search engine library
+# Xapian (see:
+# https://xapian.org/). See the section "External Indexing and Searching" for
# details.
+# This tag requires that the tag SEARCHENGINE is set to YES.
SEARCHENGINE_URL =
# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
# search data is written to a file for indexing by an external tool. With the
# SEARCHDATA_FILE tag the name of this file can be specified.
+# The default file is: searchdata.xml.
+# This tag requires that the tag SEARCHENGINE is set to YES.
SEARCHDATA_FILE = searchdata.xml
-# When SERVER_BASED_SEARCH AND EXTERNAL_SEARCH are both enabled the
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the
# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
# projects and redirect the results back to the right project.
+# This tag requires that the tag SEARCHENGINE is set to YES.
EXTERNAL_SEARCH_ID =
# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
# projects other than the one defined by this configuration file, but that are
# all added to the same external search index. Each project needs to have a
-# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id
-# of to a relative location where the documentation can be found.
-# The format is: EXTRA_SEARCH_MAPPINGS = id1=loc1 id2=loc2 ...
+# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of
+# to a relative location where the documentation can be found. The format is:
+# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
+# This tag requires that the tag SEARCHENGINE is set to YES.
EXTRA_SEARCH_MAPPINGS =
#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
+# Configuration options related to the LaTeX output
#---------------------------------------------------------------------------
-# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
-# generate Latex output.
+# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output.
+# The default value is: YES.
GENERATE_LATEX = NO
-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `latex' will be used as the default path.
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: latex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_OUTPUT = latex
# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
-# invoked. If left blank `latex' will be used as the default command name.
-# Note that when enabling USE_PDFLATEX this option is only used for
-# generating bitmaps for formulas in the HTML output, but not in the
-# Makefile that is written to the output directory.
+# invoked.
+#
+# Note that when not enabling USE_PDFLATEX the default is latex when enabling
+# USE_PDFLATEX the default is pdflatex and when in the later case latex is
+# chosen this is overwritten by pdflatex. For specific output languages the
+# default can have been set differently, this depends on the implementation of
+# the output language.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_CMD_NAME =
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
+# index for LaTeX.
+# Note: This tag is used in the Makefile / make.bat.
+# See also: LATEX_MAKEINDEX_CMD for the part in the generated output file
+# (.tex).
+# The default file is: makeindex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
-LATEX_CMD_NAME = latex
+MAKEINDEX_CMD_NAME = makeindex
-# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
-# generate index for LaTeX. If left blank `makeindex' will be used as the
-# default command name.
+# The LATEX_MAKEINDEX_CMD tag can be used to specify the command name to
+# generate index for LaTeX. In case there is no backslash (\) as first character
+# it will be automatically added in the LaTeX code.
+# Note: This tag is used in the generated output file (.tex).
+# See also: MAKEINDEX_CMD_NAME for the part in the Makefile / make.bat.
+# The default value is: makeindex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
-MAKEINDEX_CMD_NAME = makeindex
+LATEX_MAKEINDEX_CMD = makeindex
-# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
-# LaTeX documents. This may be useful for small projects and may help to
-# save some trees in general.
+# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX
+# documents. This may be useful for small projects and may help to save some
+# trees in general.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
COMPACT_LATEX = NO
-# The PAPER_TYPE tag can be used to set the paper type that is used
-# by the printer. Possible values are: a4, letter, legal and
-# executive. If left blank a4wide will be used.
+# The PAPER_TYPE tag can be used to set the paper type that is used by the
+# printer.
+# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x
+# 14 inches) and executive (7.25 x 10.5 inches).
+# The default value is: a4.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
PAPER_TYPE = a4
-# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
-# packages that should be included in the LaTeX output.
+# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
+# that should be included in the LaTeX output. The package can be specified just
+# by its name or with the correct syntax as to be used with the LaTeX
+# \usepackage command. To get the times font for instance you can specify :
+# EXTRA_PACKAGES=times or EXTRA_PACKAGES={times}
+# To use the option intlimits with the amsmath package you can specify:
+# EXTRA_PACKAGES=[intlimits]{amsmath}
+# If left blank no extra packages will be included.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
EXTRA_PACKAGES =
-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
-# the generated latex document. The header should contain everything until
-# the first chapter. If it is left blank doxygen will generate a
-# standard header. Notice: only use this tag if you know what you are doing!
+# The LATEX_HEADER tag can be used to specify a user-defined LaTeX header for
+# the generated LaTeX document. The header should contain everything until the
+# first chapter. If it is left blank doxygen will generate a standard header. It
+# is highly recommended to start with a default header using
+# doxygen -w latex new_header.tex new_footer.tex new_stylesheet.sty
+# and then modify the file new_header.tex. See also section "Doxygen usage" for
+# information on how to generate the default header that doxygen normally uses.
+#
+# Note: Only use a user-defined header if you know what you are doing!
+# Note: The header is subject to change so you typically have to regenerate the
+# default header when upgrading to a newer version of doxygen. The following
+# commands have a special meaning inside the header (and footer): For a
+# description of the possible markers and block names see the documentation.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_HEADER =
-# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for
-# the generated latex document. The footer should contain everything after
-# the last chapter. If it is left blank doxygen will generate a
-# standard footer. Notice: only use this tag if you know what you are doing!
+# The LATEX_FOOTER tag can be used to specify a user-defined LaTeX footer for
+# the generated LaTeX document. The footer should contain everything after the
+# last chapter. If it is left blank doxygen will generate a standard footer. See
+# LATEX_HEADER for more information on how to generate a default footer and what
+# special commands can be used inside the footer. See also section "Doxygen
+# usage" for information on how to generate the default footer that doxygen
+# normally uses. Note: Only use a user-defined footer if you know what you are
+# doing!
+# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_FOOTER =
-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
-# is prepared for conversion to pdf (using ps2pdf). The pdf file will
-# contain links (just like the HTML output) instead of page references
-# This makes the output suitable for online browsing using a pdf viewer.
+# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined
+# LaTeX style sheets that are included after the standard style sheets created
+# by doxygen. Using this option one can overrule certain style aspects. Doxygen
+# will copy the style sheet files to the output directory.
+# Note: The order of the extra style sheet files is of importance (e.g. the last
+# style sheet in the list overrules the setting of the previous ones in the
+# list).
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_EXTRA_STYLESHEET =
+
+# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the LATEX_OUTPUT output
+# directory. Note that the files will be copied as-is; there are no commands or
+# markers available.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_EXTRA_FILES =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
+# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
+# contain links (just like the HTML output) instead of page references. This
+# makes the output suitable for online browsing using a PDF viewer.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
PDF_HYPERLINKS = YES
-# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
-# plain latex in the generated Makefile. Set this option to YES to get a
-# higher quality PDF documentation.
+# If the USE_PDFLATEX tag is set to YES, doxygen will use the engine as
+# specified with LATEX_CMD_NAME to generate the PDF file directly from the LaTeX
+# files. Set this option to YES, to get a higher quality PDF documentation.
+#
+# See also section LATEX_CMD_NAME for selecting the engine.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
USE_PDFLATEX = YES
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
-# command to the generated LaTeX files. This will instruct LaTeX to keep
-# running if errors occur, instead of asking the user for help.
-# This option is also used when generating formulas in HTML.
+# The LATEX_BATCHMODE tag ignals the behavior of LaTeX in case of an error.
+# Possible values are: NO same as ERROR_STOP, YES same as BATCH, BATCH In batch
+# mode nothing is printed on the terminal, errors are scrolled as if is
+# hit at every error; missing files that TeX tries to input or request from
+# keyboard input (\read on a not open input stream) cause the job to abort,
+# NON_STOP In nonstop mode the diagnostic message will appear on the terminal,
+# but there is no possibility of user interaction just like in batch mode,
+# SCROLL In scroll mode, TeX will stop only for missing files to input or if
+# keyboard input is necessary and ERROR_STOP In errorstop mode, TeX will stop at
+# each error, asking for user intervention.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_BATCHMODE = NO
-# If LATEX_HIDE_INDICES is set to YES then doxygen will not
-# include the index chapters (such as File Index, Compound Index, etc.)
-# in the output.
+# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the
+# index chapters (such as File Index, Compound Index, etc.) in the output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_HIDE_INDICES = NO
-# If LATEX_SOURCE_CODE is set to YES then doxygen will include
-# source code with syntax highlighting in the LaTeX output.
-# Note that which sources are shown also depends on other settings
-# such as SOURCE_BROWSER.
-
-LATEX_SOURCE_CODE = NO
-
# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
-# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See
-# http://en.wikipedia.org/wiki/BibTeX for more info.
+# bibliography, e.g. plainnat, or ieeetr. See
+# https://en.wikipedia.org/wiki/BibTeX and \cite for more info.
+# The default value is: plain.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_BIB_STYLE = plain
+# The LATEX_EMOJI_DIRECTORY tag is used to specify the (relative or absolute)
+# path from which the emoji images will be read. If a relative path is entered,
+# it will be relative to the LATEX_OUTPUT directory. If left blank the
+# LATEX_OUTPUT directory will be used.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_EMOJI_DIRECTORY =
+
#---------------------------------------------------------------------------
-# configuration options related to the RTF output
+# Configuration options related to the RTF output
#---------------------------------------------------------------------------
-# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
-# The RTF output is optimized for Word 97 and may not look very pretty with
-# other RTF readers or editors.
+# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The
+# RTF output is optimized for Word 97 and may not look too pretty with other RTF
+# readers/editors.
+# The default value is: NO.
GENERATE_RTF = NO
-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `rtf' will be used as the default path.
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: rtf.
+# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_OUTPUT = rtf
-# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
-# RTF documents. This may be useful for small projects and may help to
-# save some trees in general.
+# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF
+# documents. This may be useful for small projects and may help to save some
+# trees in general.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
COMPACT_RTF = NO
-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
-# will contain hyperlink fields. The RTF file will
-# contain links (just like the HTML output) instead of page references.
-# This makes the output suitable for online browsing using WORD or other
-# programs which support those fields.
-# Note: wordpad (write) and others do not support links.
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will
+# contain hyperlink fields. The RTF file will contain links (just like the HTML
+# output) instead of page references. This makes the output suitable for online
+# browsing using Word or some other Word compatible readers that support those
+# fields.
+#
+# Note: WordPad (write) and others do not support links.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_HYPERLINKS = NO
-# Load style sheet definitions from file. Syntax is similar to doxygen's
-# config file, i.e. a series of assignments. You only have to provide
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# configuration file, i.e. a series of assignments. You only have to provide
# replacements, missing definitions are set to their default value.
+#
+# See also section "Doxygen usage" for information on how to generate the
+# default style sheet that doxygen normally uses.
+# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_STYLESHEET_FILE =
-# Set optional variables used in the generation of an rtf document.
-# Syntax is similar to doxygen's config file.
+# Set optional variables used in the generation of an RTF document. Syntax is
+# similar to doxygen's configuration file. A template extensions file can be
+# generated using doxygen -e rtf extensionFile.
+# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
-# configuration options related to the man page output
+# Configuration options related to the man page output
#---------------------------------------------------------------------------
-# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
-# generate man pages
+# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for
+# classes and files.
+# The default value is: NO.
GENERATE_MAN = NO
-# The MAN_OUTPUT tag is used to specify where the man pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `man' will be used as the default path.
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it. A directory man3 will be created inside the directory specified by
+# MAN_OUTPUT.
+# The default directory is: man.
+# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_OUTPUT = man
-# The MAN_EXTENSION tag determines the extension that is added to
-# the generated man pages (default is the subroutine's section .3)
+# The MAN_EXTENSION tag determines the extension that is added to the generated
+# man pages. In case the manual section does not start with a number, the number
+# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is
+# optional.
+# The default value is: .3.
+# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_EXTENSION = .3
-# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
-# then it will generate one additional man file for each entity
-# documented in the real man page(s). These additional files
-# only source the real man page, but without them the man command
-# would be unable to find the correct page. The default is NO.
+# The MAN_SUBDIR tag determines the name of the directory created within
+# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by
+# MAN_EXTENSION with the initial . removed.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_SUBDIR =
+
+# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
+# will generate one additional man file for each entity documented in the real
+# man page(s). These additional files only source the real man page, but without
+# them the man command would be unable to find the correct page.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_MAN is set to YES.
MAN_LINKS = NO
#---------------------------------------------------------------------------
-# configuration options related to the XML output
+# Configuration options related to the XML output
#---------------------------------------------------------------------------
-# If the GENERATE_XML tag is set to YES Doxygen will
-# generate an XML file that captures the structure of
-# the code including all documentation.
+# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that
+# captures the structure of the code including all documentation.
+# The default value is: NO.
GENERATE_XML = NO
-# The XML_OUTPUT tag is used to specify where the XML pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `xml' will be used as the default path.
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: xml.
+# This tag requires that the tag GENERATE_XML is set to YES.
XML_OUTPUT = xml
-# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
-# dump the program listings (including syntax highlighting
-# and cross-referencing information) to the XML output. Note that
-# enabling this will significantly increase the size of the XML output.
+# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program
+# listings (including syntax highlighting and cross-referencing information) to
+# the XML output. Note that enabling this will significantly increase the size
+# of the XML output.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_XML is set to YES.
XML_PROGRAMLISTING = YES
+# If the XML_NS_MEMB_FILE_SCOPE tag is set to YES, doxygen will include
+# namespace members in file scope as well, matching the HTML output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_XML is set to YES.
+
+XML_NS_MEMB_FILE_SCOPE = NO
+
#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
+# Configuration options related to the DOCBOOK output
#---------------------------------------------------------------------------
-# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
-# generate an AutoGen Definitions (see autogen.sf.net) file
-# that captures the structure of the code including all
-# documentation. Note that this feature is still experimental
-# and incomplete at the moment.
+# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files
+# that can be used to generate PDF.
+# The default value is: NO.
+
+GENERATE_DOCBOOK = NO
+
+# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in
+# front of it.
+# The default directory is: docbook.
+# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
+
+DOCBOOK_OUTPUT = docbook
+
+#---------------------------------------------------------------------------
+# Configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an
+# AutoGen Definitions (see https://autogen.sourceforge.net/) file that captures
+# the structure of the code including all documentation. Note that this feature
+# is still experimental and incomplete at the moment.
+# The default value is: NO.
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
-# configuration options related to the Perl module output
+# Configuration options related to the Perl module output
#---------------------------------------------------------------------------
-# If the GENERATE_PERLMOD tag is set to YES Doxygen will
-# generate a Perl module file that captures the structure of
-# the code including all documentation. Note that this
-# feature is still experimental and incomplete at the
-# moment.
+# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module
+# file that captures the structure of the code including all documentation.
+#
+# Note that this feature is still experimental and incomplete at the moment.
+# The default value is: NO.
GENERATE_PERLMOD = NO
-# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
-# the necessary Makefile rules, Perl scripts and LaTeX code to be able
-# to generate PDF and DVI output from the Perl module output.
+# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary
+# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI
+# output from the Perl module output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
PERLMOD_LATEX = NO
-# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
-# nicely formatted so it can be parsed by a human reader.
-# This is useful
-# if you want to understand what is going on.
-# On the other hand, if this
-# tag is set to NO the size of the Perl module output will be much smaller
-# and Perl will parse it just the same.
+# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely
+# formatted so it can be parsed by a human reader. This is useful if you want to
+# understand what is going on. On the other hand, if this tag is set to NO, the
+# size of the Perl module output will be much smaller and Perl will parse it
+# just the same.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
PERLMOD_PRETTY = YES
-# The names of the make variables in the generated doxyrules.make file
-# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
-# This is useful so different doxyrules.make files included by the same
-# Makefile don't overwrite each other's variables.
+# The names of the make variables in the generated doxyrules.make file are
+# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful
+# so different doxyrules.make files included by the same Makefile don't
+# overwrite each other's variables.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
PERLMOD_MAKEVAR_PREFIX =
@@ -1523,57 +2249,65 @@ PERLMOD_MAKEVAR_PREFIX =
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
-# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
-# evaluate all C-preprocessor directives found in the sources and include
-# files.
+# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all
+# C-preprocessor directives found in the sources and include files.
+# The default value is: YES.
ENABLE_PREPROCESSING = YES
-# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
-# names in the source code. If set to NO (the default) only conditional
-# compilation will be performed. Macro expansion can be done in a controlled
-# way by setting EXPAND_ONLY_PREDEF to YES.
+# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names
+# in the source code. If set to NO, only conditional compilation will be
+# performed. Macro expansion can be done in a controlled way by setting
+# EXPAND_ONLY_PREDEF to YES.
+# The default value is: NO.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
MACRO_EXPANSION = YES
-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
-# then the macro expansion is limited to the macros specified with the
-# PREDEFINED and EXPAND_AS_DEFINED tags.
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
+# the macro expansion is limited to the macros specified with the PREDEFINED and
+# EXPAND_AS_DEFINED tags.
+# The default value is: NO.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
EXPAND_ONLY_PREDEF = YES
-# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
-# pointed to by INCLUDE_PATH will be searched when a #include is found.
+# If the SEARCH_INCLUDES tag is set to YES, the include files in the
+# INCLUDE_PATH will be searched if a #include is found.
+# The default value is: YES.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
SEARCH_INCLUDES = YES
# The INCLUDE_PATH tag can be used to specify one or more directories that
-# contain include files that are not input files but should be processed by
-# the preprocessor.
+# contain include files that are not input files but should be processed by the
+# preprocessor. Note that the INCLUDE_PATH is not recursive, so the setting of
+# RECURSIVE has no effect here.
+# This tag requires that the tag SEARCH_INCLUDES is set to YES.
INCLUDE_PATH =
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the
-# directories. If left blank, the patterns specified with FILE_PATTERNS will
-# be used.
+# directories. If left blank, the patterns specified with FILE_PATTERNS will be
+# used.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
INCLUDE_FILE_PATTERNS =
-# The PREDEFINED tag can be used to specify one or more macro names that
-# are defined before the preprocessor is started (similar to the -D option of
-# gcc). The argument of the tag is a list of macros of the form: name
-# or name=definition (no spaces). If the definition and the = are
-# omitted =1 is assumed. To prevent a macro definition from being
-# undefined via #undef or recursively expanded use the := operator
-# instead of the = operator.
+# The PREDEFINED tag can be used to specify one or more macro names that are
+# defined before the preprocessor is started (similar to the -D option of e.g.
+# gcc). The argument of the tag is a list of macros of the form: name or
+# name=definition (no spaces). If the definition and the "=" are omitted, "=1"
+# is assumed. To prevent a macro definition from being undefined via #undef or
+# recursively expanded use the := operator instead of the = operator.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
PREDEFINED = GLFWAPI= \
GLFW_EXPOSE_NATIVE_WIN32 \
GLFW_EXPOSE_NATIVE_WGL \
GLFW_EXPOSE_NATIVE_X11 \
GLFW_EXPOSE_NATIVE_WAYLAND \
- GLFW_EXPOSE_NATIVE_MIR \
GLFW_EXPOSE_NATIVE_GLX \
GLFW_EXPOSE_NATIVE_COCOA \
GLFW_EXPOSE_NATIVE_NSGL \
@@ -1581,282 +2315,417 @@ PREDEFINED = GLFWAPI= \
GLFW_EXPOSE_NATIVE_OSMESA \
VK_VERSION_1_0
-# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
-# this tag can be used to specify a list of macro names that should be expanded.
-# The macro definition that is found in the sources will be used.
-# Use the PREDEFINED tag if you want to use a different macro definition that
-# overrules the definition found in the source code.
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
+# tag can be used to specify a list of macro names that should be expanded. The
+# macro definition that is found in the sources will be used. Use the PREDEFINED
+# tag if you want to use a different macro definition that overrules the
+# definition found in the source code.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
EXPAND_AS_DEFINED =
-# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
-# doxygen's preprocessor will remove all references to function-like macros
-# that are alone on a line, have an all uppercase name, and do not end with a
-# semicolon, because these will confuse the parser if not removed.
+# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
+# remove all references to function-like macros that are alone on a line, have
+# an all uppercase name, and do not end with a semicolon. Such function macros
+# are typically used for boiler-plate code, and will confuse the parser if not
+# removed.
+# The default value is: YES.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
-# Configuration::additions related to external references
+# Configuration options related to external references
#---------------------------------------------------------------------------
-# The TAGFILES option can be used to specify one or more tagfiles. For each
-# tag file the location of the external documentation should be added. The
-# format of a tag file without this location is as follows:
-#
+# The TAGFILES tag can be used to specify one or more tag files. For each tag
+# file the location of the external documentation should be added. The format of
+# a tag file without this location is as follows:
# TAGFILES = file1 file2 ...
# Adding location for the tag files is done as follows:
-#
# TAGFILES = file1=loc1 "file2 = loc2" ...
-# where "loc1" and "loc2" can be relative or absolute paths
-# or URLs. Note that each tag file must have a unique name (where the name does
-# NOT include the path). If a tag file is not located in the directory in which
-# doxygen is run, you must also specify the path to the tagfile here.
+# where loc1 and loc2 can be relative or absolute paths or URLs. See the
+# section "Linking to external documentation" for more information about the use
+# of tag files.
+# Note: Each tag file must have a unique name (where the name does NOT include
+# the path). If a tag file is not located in the directory in which doxygen is
+# run, you must also specify the path to the tagfile here.
TAGFILES =
-# When a file name is specified after GENERATE_TAGFILE, doxygen will create
-# a tag file that is based on the input files it reads.
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
+# tag file that is based on the input files it reads. See section "Linking to
+# external documentation" for more information about the usage of tag files.
GENERATE_TAGFILE =
-# If the ALLEXTERNALS tag is set to YES all external classes will be listed
-# in the class index. If set to NO only the inherited external classes
-# will be listed.
+# If the ALLEXTERNALS tag is set to YES, all external class will be listed in
+# the class index. If set to NO, only the inherited external classes will be
+# listed.
+# The default value is: NO.
ALLEXTERNALS = NO
-# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
-# in the modules index. If set to NO, only the current project's groups will
-# be listed.
+# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will be
+# listed.
+# The default value is: YES.
EXTERNAL_GROUPS = YES
-# The PERL_PATH should be the absolute path and name of the perl script
-# interpreter (i.e. the result of `which perl').
+# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in
+# the related pages index. If set to NO, only the current project's pages will
+# be listed.
+# The default value is: YES.
-PERL_PATH = /usr/bin/perl
+EXTERNAL_PAGES = YES
#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
+# Configuration options related to diagram generator tools
#---------------------------------------------------------------------------
-# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
-# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
-# or super classes. Setting the tag to NO turns the diagrams off. Note that
-# this option also works with HAVE_DOT disabled, but it is recommended to
-# install and use dot, since it yields more powerful graphs.
-
-CLASS_DIAGRAMS = YES
-
-# You can define message sequence charts within doxygen comments using the \msc
-# command. Doxygen will then run the mscgen tool (see
-# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
-# documentation. The MSCGEN_PATH tag allows you to specify the directory where
-# the mscgen tool resides. If left empty the tool is assumed to be found in the
-# default search path.
-
-MSCGEN_PATH =
-
-# If set to YES, the inheritance and collaboration graphs will hide
-# inheritance and usage relations if the target is undocumented
-# or is not a class.
+# If set to YES the inheritance and collaboration graphs will hide inheritance
+# and usage relations if the target is undocumented or is not a class.
+# The default value is: YES.
HIDE_UNDOC_RELATIONS = YES
# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
-# available from the path. This tool is part of Graphviz, a graph visualization
-# toolkit from AT&T and Lucent Bell Labs. The other options in this section
-# have no effect if this option is set to NO (the default)
+# available from the path. This tool is part of Graphviz (see:
+# https://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
+# Bell Labs. The other options in this section have no effect if this option is
+# set to NO
+# The default value is: NO.
HAVE_DOT = NO
-# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
-# allowed to run in parallel. When set to 0 (the default) doxygen will
-# base this on the number of processors available in the system. You can set it
-# explicitly to a value larger than 0 to get control over the balance
-# between CPU load and processing speed.
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
+# to run in parallel. When set to 0 doxygen will base this on the number of
+# processors available in the system. You can set it explicitly to a value
+# larger than 0 to get control over the balance between CPU load and processing
+# speed.
+# Minimum value: 0, maximum value: 32, default value: 0.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_NUM_THREADS = 0
-# By default doxygen will use the Helvetica font for all dot files that
-# doxygen generates. When you want a differently looking font you can specify
-# the font name using DOT_FONTNAME. You need to make sure dot is able to find
-# the font, which can be done by putting it in a standard location or by setting
-# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the
-# directory containing the font.
+# DOT_COMMON_ATTR is common attributes for nodes, edges and labels of
+# subgraphs. When you want a differently looking font in the dot files that
+# doxygen generates you can specify fontname, fontcolor and fontsize attributes.
+# For details please see Node,
+# Edge and Graph Attributes specification You need to make sure dot is able
+# to find the font, which can be done by putting it in a standard location or by
+# setting the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the
+# directory containing the font. Default graphviz fontsize is 14.
+# The default value is: fontname=Helvetica,fontsize=10.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_COMMON_ATTR = "fontname=Helvetica,fontsize=10"
+
+# DOT_EDGE_ATTR is concatenated with DOT_COMMON_ATTR. For elegant style you can
+# add 'arrowhead=open, arrowtail=open, arrowsize=0.5'. Complete documentation about
+# arrows shapes.
+# The default value is: labelfontname=Helvetica,labelfontsize=10.
+# This tag requires that the tag HAVE_DOT is set to YES.
-DOT_FONTNAME = Helvetica
+DOT_EDGE_ATTR = "labelfontname=Helvetica,labelfontsize=10"
-# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
-# The default size is 10pt.
+# DOT_NODE_ATTR is concatenated with DOT_COMMON_ATTR. For view without boxes
+# around nodes set 'shape=plain' or 'shape=plaintext' Shapes specification
+# The default value is: shape=box,height=0.2,width=0.4.
+# This tag requires that the tag HAVE_DOT is set to YES.
-DOT_FONTSIZE = 10
+DOT_NODE_ATTR = "shape=box,height=0.2,width=0.4"
-# By default doxygen will tell dot to use the Helvetica font.
-# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to
-# set the path where dot can find it.
+# You can set the path where dot can find font specified with fontname in
+# DOT_COMMON_ATTR and others dot attributes.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_FONTPATH =
-# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect inheritance relations. Setting this tag to YES will force the
-# CLASS_DIAGRAMS tag to NO.
+# If the CLASS_GRAPH tag is set to YES or GRAPH or BUILTIN then doxygen will
+# generate a graph for each documented class showing the direct and indirect
+# inheritance relations. In case the CLASS_GRAPH tag is set to YES or GRAPH and
+# HAVE_DOT is enabled as well, then dot will be used to draw the graph. In case
+# the CLASS_GRAPH tag is set to YES and HAVE_DOT is disabled or if the
+# CLASS_GRAPH tag is set to BUILTIN, then the built-in generator will be used.
+# If the CLASS_GRAPH tag is set to TEXT the direct and indirect inheritance
+# relations will be shown as texts / links.
+# Possible values are: NO, YES, TEXT, GRAPH and BUILTIN.
+# The default value is: YES.
CLASS_GRAPH = YES
-# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect implementation dependencies (inheritance, containment, and
-# class references variables) of the class with other documented classes.
+# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a
+# graph for each documented class showing the direct and indirect implementation
+# dependencies (inheritance, containment, and class references variables) of the
+# class with other documented classes.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
COLLABORATION_GRAPH = YES
-# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for groups, showing the direct groups dependencies
+# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
+# groups, showing the direct groups dependencies. See also the chapter Grouping
+# in the manual.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
GROUP_GRAPHS = YES
-# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and
# collaboration diagrams in a style similar to the OMG's Unified Modeling
# Language.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
UML_LOOK = NO
-# If the UML_LOOK tag is enabled, the fields and methods are shown inside
-# the class node. If there are many fields or methods and many nodes the
-# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS
-# threshold limits the number of items for each type to make the size more
-# managable. Set this to 0 for no limit. Note that the threshold may be
-# exceeded by 50% before the limit is enforced.
+# If the UML_LOOK tag is enabled, the fields and methods are shown inside the
+# class node. If there are many fields or methods and many nodes the graph may
+# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the
+# number of items for each type to make the size more manageable. Set this to 0
+# for no limit. Note that the threshold may be exceeded by 50% before the limit
+# is enforced. So when you set the threshold to 10, up to 15 fields may appear,
+# but if the number exceeds 15, the total amount of fields shown is limited to
+# 10.
+# Minimum value: 0, maximum value: 100, default value: 10.
+# This tag requires that the tag UML_LOOK is set to YES.
UML_LIMIT_NUM_FIELDS = 10
-# If set to YES, the inheritance and collaboration graphs will show the
-# relations between templates and their instances.
+# If the DOT_UML_DETAILS tag is set to NO, doxygen will show attributes and
+# methods without types and arguments in the UML graphs. If the DOT_UML_DETAILS
+# tag is set to YES, doxygen will add type and arguments for attributes and
+# methods in the UML graphs. If the DOT_UML_DETAILS tag is set to NONE, doxygen
+# will not generate fields with class member information in the UML graphs. The
+# class diagrams will look similar to the default class diagrams but using UML
+# notation for the relationships.
+# Possible values are: NO, YES and NONE.
+# The default value is: NO.
+# This tag requires that the tag UML_LOOK is set to YES.
+
+DOT_UML_DETAILS = NO
+
+# The DOT_WRAP_THRESHOLD tag can be used to set the maximum number of characters
+# to display on a single line. If the actual line length exceeds this threshold
+# significantly it will wrapped across multiple lines. Some heuristics are apply
+# to avoid ugly line breaks.
+# Minimum value: 0, maximum value: 1000, default value: 17.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_WRAP_THRESHOLD = 17
+
+# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and
+# collaboration graphs will show the relations between templates and their
+# instances.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
TEMPLATE_RELATIONS = NO
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
-# tags are set to YES then doxygen will generate a graph for each documented
-# file showing the direct and indirect include dependencies of the file with
-# other documented files.
+# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
+# YES then doxygen will generate a graph for each documented file showing the
+# direct and indirect include dependencies of the file with other documented
+# files.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
INCLUDE_GRAPH = YES
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
-# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
-# documented header file showing the documented files that directly or
-# indirectly include this file.
+# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are
+# set to YES then doxygen will generate a graph for each documented file showing
+# the direct and indirect include dependencies of the file with other documented
+# files.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
INCLUDED_BY_GRAPH = YES
-# If the CALL_GRAPH and HAVE_DOT options are set to YES then
-# doxygen will generate a call dependency graph for every global function
-# or class method. Note that enabling this option will significantly increase
-# the time of a run. So in most cases it will be better to enable call graphs
-# for selected functions only using the \callgraph command.
+# If the CALL_GRAPH tag is set to YES then doxygen will generate a call
+# dependency graph for every global function or class method.
+#
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable call graphs for selected
+# functions only using the \callgraph command. Disabling a call graph can be
+# accomplished by means of the command \hidecallgraph.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
CALL_GRAPH = NO
-# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
-# doxygen will generate a caller dependency graph for every global function
-# or class method. Note that enabling this option will significantly increase
-# the time of a run. So in most cases it will be better to enable caller
-# graphs for selected functions only using the \callergraph command.
+# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller
+# dependency graph for every global function or class method.
+#
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable caller graphs for selected
+# functions only using the \callergraph command. Disabling a caller graph can be
+# accomplished by means of the command \hidecallergraph.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
CALLER_GRAPH = NO
-# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
-# will generate a graphical hierarchy of all classes instead of a textual one.
+# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical
+# hierarchy of all classes instead of a textual one.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
GRAPHICAL_HIERARCHY = YES
-# If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES
-# then doxygen will show the dependencies a directory has on other directories
-# in a graphical way. The dependency relations are determined by the #include
-# relations between the files in the directories.
+# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the
+# dependencies a directory has on other directories in a graphical way. The
+# dependency relations are determined by the #include relations between the
+# files in the directories.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
DIRECTORY_GRAPH = YES
+# The DIR_GRAPH_MAX_DEPTH tag can be used to limit the maximum number of levels
+# of child directories generated in directory dependency graphs by dot.
+# Minimum value: 1, maximum value: 25, default value: 1.
+# This tag requires that the tag DIRECTORY_GRAPH is set to YES.
+
+DIR_GRAPH_MAX_DEPTH = 1
+
# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
-# generated by dot. Possible values are svg, png, jpg, or gif.
-# If left blank png will be used. If you choose svg you need to set
-# HTML_FILE_EXTENSION to xhtml in order to make the SVG files
-# visible in IE 9+ (other browsers do not have this requirement).
+# generated by dot. For an explanation of the image formats see the section
+# output formats in the documentation of the dot tool (Graphviz (see:
+# https://www.graphviz.org/)).
+# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
+# to make the SVG files visible in IE 9+ (other browsers do not have this
+# requirement).
+# Possible values are: png, jpg, gif, svg, png:gd, png:gd:gd, png:cairo,
+# png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and
+# png:gdiplus:gdiplus.
+# The default value is: png.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_IMAGE_FORMAT = png
# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
# enable generation of interactive SVG images that allow zooming and panning.
-# Note that this requires a modern browser other than Internet Explorer.
-# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you
-# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files
-# visible. Older versions of IE do not have SVG support.
+#
+# Note that this requires a modern browser other than Internet Explorer. Tested
+# and working are Firefox, Chrome, Safari, and Opera.
+# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make
+# the SVG files visible. Older versions of IE do not have SVG support.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
INTERACTIVE_SVG = NO
-# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# The DOT_PATH tag can be used to specify the path where the dot tool can be
# found. If left blank, it is assumed the dot tool can be found in the path.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_PATH =
# The DOTFILE_DIRS tag can be used to specify one or more directories that
-# contain dot files that are included in the documentation (see the
-# \dotfile command).
+# contain dot files that are included in the documentation (see the \dotfile
+# command).
+# This tag requires that the tag HAVE_DOT is set to YES.
DOTFILE_DIRS =
-# The MSCFILE_DIRS tag can be used to specify one or more directories that
-# contain msc files that are included in the documentation (see the
-# \mscfile command).
+# You can include diagrams made with dia in doxygen documentation. Doxygen will
+# then run dia to produce the diagram and insert it in the documentation. The
+# DIA_PATH tag allows you to specify the directory where the dia binary resides.
+# If left empty dia is assumed to be found in the default search path.
-MSCFILE_DIRS =
+DIA_PATH =
-# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
-# nodes that will be shown in the graph. If the number of nodes in a graph
-# becomes larger than this value, doxygen will truncate the graph, which is
-# visualized by representing a node as a red box. Note that doxygen if the
-# number of direct children of the root node in a graph is already larger than
-# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
-# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+# The DIAFILE_DIRS tag can be used to specify one or more directories that
+# contain dia files that are included in the documentation (see the \diafile
+# command).
+
+DIAFILE_DIRS =
+
+# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the
+# path where java can find the plantuml.jar file or to the filename of jar file
+# to be used. If left blank, it is assumed PlantUML is not used or called during
+# a preprocessing step. Doxygen will generate a warning when it encounters a
+# \startuml command in this case and will not generate output for the diagram.
+
+PLANTUML_JAR_PATH =
+
+# When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a
+# configuration file for plantuml.
+
+PLANTUML_CFG_FILE =
+
+# When using plantuml, the specified paths are searched for files specified by
+# the !include statement in a plantuml block.
+
+PLANTUML_INCLUDE_PATH =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
+# that will be shown in the graph. If the number of nodes in a graph becomes
+# larger than this value, doxygen will truncate the graph, which is visualized
+# by representing a node as a red box. Note that doxygen if the number of direct
+# children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that
+# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+# Minimum value: 0, maximum value: 10000, default value: 50.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_GRAPH_MAX_NODES = 50
-# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
-# graphs generated by dot. A depth value of 3 means that only nodes reachable
-# from the root by following a path via at most 3 edges will be shown. Nodes
-# that lay further from the root node will be omitted. Note that setting this
-# option to 1 or 2 may greatly reduce the computation time needed for large
-# code bases. Also note that the size of a graph can be further restricted by
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs
+# generated by dot. A depth value of 3 means that only nodes reachable from the
+# root by following a path via at most 3 edges will be shown. Nodes that lay
+# further from the root node will be omitted. Note that setting this option to 1
+# or 2 may greatly reduce the computation time needed for large code bases. Also
+# note that the size of a graph can be further restricted by
# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+# Minimum value: 0, maximum value: 1000, default value: 0.
+# This tag requires that the tag HAVE_DOT is set to YES.
MAX_DOT_GRAPH_DEPTH = 0
-# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
-# background. This is disabled by default, because dot on Windows does not
-# seem to support this out of the box. Warning: Depending on the platform used,
-# enabling this option may lead to badly anti-aliased labels on the edges of
-# a graph (i.e. they become hard to read).
-
-DOT_TRANSPARENT = NO
-
-# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output
# files in one run (i.e. multiple -o and -T options on the command line). This
-# makes dot run faster, but since only newer versions of dot (>1.8.10)
-# support this, this feature is disabled by default.
+# makes dot run faster, but since only newer versions of dot (>1.8.10) support
+# this, this feature is disabled by default.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
DOT_MULTI_TARGETS = NO
-# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
-# generate a legend page explaining the meaning of the various boxes and
-# arrows in the dot generated graphs.
+# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page
+# explaining the meaning of the various boxes and arrows in the dot generated
+# graphs.
+# Note: This tag requires that UML_LOOK isn't set, i.e. the doxygen internal
+# graphical representation for inheritance and collaboration diagrams is used.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
GENERATE_LEGEND = YES
-# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
-# remove the intermediate dot files that are used to generate
-# the various graphs.
+# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate
+# files that are used to generate the various graphs.
+#
+# Note: This setting is not only used for dot files but also for msc temporary
+# files.
+# The default value is: YES.
DOT_CLEANUP = YES
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. If the MSCGEN_TOOL tag is left empty (the default), then doxygen will
+# use a built-in version of mscgen tool to produce the charts. Alternatively,
+# the MSCGEN_TOOL tag can also specify the name an external tool. For instance,
+# specifying prog as the value, doxygen will call the tool as prog -T
+# -o . The external tool should support
+# output file formats "png", "eps", "svg", and "ismap".
+
+MSCGEN_TOOL =
+
+# The MSCFILE_DIRS tag can be used to specify one or more directories that
+# contain msc files that are included in the documentation (see the \mscfile
+# command).
+
+MSCFILE_DIRS =
diff --git a/external/GLFW/docs/DoxygenLayout.xml b/external/GLFW/docs/DoxygenLayout.xml
index 7917f91..66cb87f 100644
--- a/external/GLFW/docs/DoxygenLayout.xml
+++ b/external/GLFW/docs/DoxygenLayout.xml
@@ -1,115 +1,21 @@
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
+
@@ -117,9 +23,7 @@
-
-
@@ -131,46 +35,26 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -178,7 +62,6 @@
-
diff --git a/external/GLFW/docs/SUPPORT.md b/external/GLFW/docs/SUPPORT.md
new file mode 100644
index 0000000..d9be56f
--- /dev/null
+++ b/external/GLFW/docs/SUPPORT.md
@@ -0,0 +1,13 @@
+# Support resources
+
+See the [latest documentation](https://www.glfw.org/docs/latest/) for tutorials,
+guides and the API reference.
+
+If you have questions about using GLFW, we have a
+[forum](https://discourse.glfw.org/).
+
+Bugs are reported to our [issue tracker](https://github.com/glfw/glfw/issues).
+Please check the [contribution
+guide](https://github.com/glfw/glfw/blob/master/docs/CONTRIBUTING.md) for
+information on what to include when reporting a bug.
+
diff --git a/external/GLFW/docs/build.md b/external/GLFW/docs/build.md
new file mode 100644
index 0000000..7b0f8bf
--- /dev/null
+++ b/external/GLFW/docs/build.md
@@ -0,0 +1,419 @@
+# Building applications {#build_guide}
+
+[TOC]
+
+This is about compiling and linking applications that use GLFW. For information on
+how to write such applications, start with the
+[introductory tutorial](@ref quick_guide). For information on how to compile
+the GLFW library itself, see @ref compile_guide.
+
+This is not a tutorial on compilation or linking. It assumes basic
+understanding of how to compile and link a C program as well as how to use the
+specific compiler of your chosen development environment. The compilation
+and linking process should be explained in your C programming material and in
+the documentation for your development environment.
+
+
+## Including the GLFW header file {#build_include}
+
+You should include the GLFW header in the source files where you use OpenGL or
+GLFW.
+
+```c
+#include
+```
+
+This header defines all the constants and declares all the types and function
+prototypes of the GLFW API. By default, it also includes the OpenGL header from
+your development environment. See [option macros](@ref build_macros) below for
+how to select OpenGL ES headers and more.
+
+The GLFW header also defines any platform-specific macros needed by your OpenGL
+header, so that it can be included without needing any window system headers.
+
+It does this only when needed, so if window system headers are included, the
+GLFW header does not try to redefine those symbols. The reverse is not true,
+i.e. `windows.h` cannot cope if any Win32 symbols have already been defined.
+
+In other words:
+
+ - Use the GLFW header to include OpenGL or OpenGL ES headers portably
+ - Do not include window system headers unless you will use those APIs directly
+ - If you do need such headers, include them before the GLFW header
+
+If you are using an OpenGL extension loading library such as [glad][], the
+extension loader header should be included before the GLFW one. GLFW attempts
+to detect any OpenGL or OpenGL ES header or extension loader header included
+before it and will then disable the inclusion of the default OpenGL header.
+Most extension loaders also define macros that disable similar headers below it.
+
+[glad]: https://github.com/Dav1dde/glad
+
+```c
+#include
+#include
+```
+
+Both of these mechanisms depend on the extension loader header defining a known
+macro. If yours doesn't or you don't know which one your users will pick, the
+@ref GLFW_INCLUDE_NONE macro will explicitly prevent the GLFW header from
+including the OpenGL header. This will also allow you to include the two
+headers in any order.
+
+```c
+#define GLFW_INCLUDE_NONE
+#include
+#include
+```
+
+
+### GLFW header option macros {#build_macros}
+
+These macros may be defined before the inclusion of the GLFW header and affect
+its behavior.
+
+@anchor GLFW_DLL
+__GLFW_DLL__ is required on Windows when using the GLFW DLL, to tell the
+compiler that the GLFW functions are defined in a DLL.
+
+The following macros control which OpenGL or OpenGL ES API header is included.
+Only one of these may be defined at a time.
+
+@note GLFW does not provide any of the API headers mentioned below. They are
+provided by your development environment or your OpenGL, OpenGL ES or Vulkan
+SDK, and most of them can be downloaded from the [Khronos Registry][registry].
+
+[registry]: https://www.khronos.org/registry/
+
+@anchor GLFW_INCLUDE_GLCOREARB
+__GLFW_INCLUDE_GLCOREARB__ makes the GLFW header include the modern
+`GL/glcorearb.h` header (`OpenGL/gl3.h` on macOS) instead of the regular OpenGL
+header.
+
+@anchor GLFW_INCLUDE_ES1
+__GLFW_INCLUDE_ES1__ makes the GLFW header include the OpenGL ES 1.x `GLES/gl.h`
+header instead of the regular OpenGL header.
+
+@anchor GLFW_INCLUDE_ES2
+__GLFW_INCLUDE_ES2__ makes the GLFW header include the OpenGL ES 2.0
+`GLES2/gl2.h` header instead of the regular OpenGL header.
+
+@anchor GLFW_INCLUDE_ES3
+__GLFW_INCLUDE_ES3__ makes the GLFW header include the OpenGL ES 3.0
+`GLES3/gl3.h` header instead of the regular OpenGL header.
+
+@anchor GLFW_INCLUDE_ES31
+__GLFW_INCLUDE_ES31__ makes the GLFW header include the OpenGL ES 3.1
+`GLES3/gl31.h` header instead of the regular OpenGL header.
+
+@anchor GLFW_INCLUDE_ES32
+__GLFW_INCLUDE_ES32__ makes the GLFW header include the OpenGL ES 3.2
+`GLES3/gl32.h` header instead of the regular OpenGL header.
+
+@anchor GLFW_INCLUDE_NONE
+__GLFW_INCLUDE_NONE__ makes the GLFW header not include any OpenGL or OpenGL ES
+API header. This is useful in combination with an extension loading library.
+
+If none of the above inclusion macros are defined, the standard OpenGL `GL/gl.h`
+header (`OpenGL/gl.h` on macOS) is included, unless GLFW detects the inclusion
+guards of any OpenGL, OpenGL ES or extension loader header it knows about.
+
+The following macros control the inclusion of additional API headers. Any
+number of these may be defined simultaneously, and/or together with one of the
+above macros.
+
+@anchor GLFW_INCLUDE_VULKAN
+__GLFW_INCLUDE_VULKAN__ makes the GLFW header include the Vulkan
+`vulkan/vulkan.h` header in addition to any selected OpenGL or OpenGL ES header.
+
+@anchor GLFW_INCLUDE_GLEXT
+__GLFW_INCLUDE_GLEXT__ makes the GLFW header include the appropriate extension
+header for the OpenGL or OpenGL ES header selected above after and in addition
+to that header.
+
+@anchor GLFW_INCLUDE_GLU
+__GLFW_INCLUDE_GLU__ makes the header include the GLU header in addition to the
+header selected above. This should only be used with the standard OpenGL header
+and only for compatibility with legacy code. GLU has been deprecated and should
+not be used in new code.
+
+@note None of these macros may be defined during the compilation of GLFW itself.
+If your build includes GLFW and you define any these in your build files, make
+sure they are not applied to the GLFW sources.
+
+
+## Link with the right libraries {#build_link}
+
+GLFW is essentially a wrapper of various platform-specific APIs and therefore
+needs to link against many different system libraries. If you are using GLFW as
+a shared library / dynamic library / DLL then it takes care of these links.
+However, if you are using GLFW as a static library then your executable will
+need to link against these libraries.
+
+On Windows and macOS, the list of system libraries is static and can be
+hard-coded into your build environment. See the section for your development
+environment below. On Linux and other Unix-like operating systems, the list
+varies but can be retrieved in various ways as described below.
+
+A good general introduction to linking is [Beginner's Guide to
+Linkers][linker_guide] by David Drysdale.
+
+[linker_guide]: https://www.lurklurk.org/linkers/linkers.html
+
+
+### With Visual C++ and GLFW binaries {#build_link_win32}
+
+If you are using a downloaded [binary
+archive](https://www.glfw.org/download.html), first make sure you have the
+archive matching the architecture you are building for (32-bit or 64-bit), or
+you will get link errors. Also make sure you are using the binaries for your
+version of Visual C++ or you may get other link errors.
+
+There are two version of the static GLFW library in the binary archive, because
+it needs to use the same base run-time library variant as the rest of your
+executable.
+
+One is named `glfw3.lib` and is for projects with the _Runtime Library_ project
+option set to _Multi-threaded DLL_ or _Multi-threaded Debug DLL_. The other is
+named `glfw3_mt.lib` and is for projects with _Runtime Library_ set to
+_Multi-threaded_ or _Multi-threaded Debug_. To use the static GLFW library you
+will need to add `path/to/glfw3.lib` or `path/to/glfw3_mt.lib` to the
+_Additional Dependencies_ project option.
+
+If you compiled a GLFW static library yourself then there will only be one,
+named `glfw3.lib`, and you have to make sure the run-time library variant
+matches.
+
+The DLL version of the GLFW library is named `glfw3.dll`, but you will be
+linking against the `glfw3dll.lib` link library. To use the DLL you will need
+to add `path/to/glfw3dll.lib` to the _Additional Dependencies_ project option.
+All of its dependencies are already listed there by default, but when building
+with the DLL version of GLFW, you also need to define the @ref GLFW_DLL. This
+can be done either in the _Preprocessor Definitions_ project option or by
+defining it in your source code before including the GLFW header.
+
+```c
+#define GLFW_DLL
+#include
+```
+
+All link-time dependencies for GLFW are already listed in the _Additional
+Dependencies_ option by default.
+
+
+### With MinGW-w64 and GLFW binaries {#build_link_mingw}
+
+This is intended for building a program from the command-line or by writing
+a makefile, on Windows with [MinGW-w64][] and GLFW binaries. These can be from
+a downloaded and extracted [binary archive](https://www.glfw.org/download.html)
+or by compiling GLFW yourself. The paths below assume a binary archive is used.
+
+If you are using a downloaded binary archive, first make sure you have the
+archive matching the architecture you are building for (32-bit or 64-bit) or you
+will get link errors.
+
+Note that the order of source files and libraries matter for GCC. Dependencies
+must be listed after the files that depend on them. Any source files that
+depend on GLFW must be listed before the GLFW library. GLFW in turn depends on
+`gdi32` and must be listed before it.
+
+[MinGW-w64]: https://www.mingw-w64.org/
+
+If you are using the static version of the GLFW library, which is named
+`libglfw3.a`, do:
+
+```sh
+gcc -o myprog myprog.c -I path/to/glfw/include path/to/glfw/lib-mingw-w64/libglfw3.a -lgdi32
+```
+
+If you are using the DLL version of the GLFW library, which is named
+`glfw3.dll`, you will need to use the `libglfw3dll.a` link library.
+
+```sh
+gcc -o myprog myprog.c -I path/to/glfw/include path/to/glfw/lib-mingw-w64/libglfw3dll.a -lgdi32
+```
+
+The resulting executable will need to find `glfw3.dll` to run, typically by
+keeping both files in the same directory.
+
+When you are building with the DLL version of GLFW, you will also need to define
+the @ref GLFW_DLL macro. This can be done in your source files, as long as it
+done before including the GLFW header:
+
+```c
+#define GLFW_DLL
+#include
+```
+
+It can also be done on the command-line:
+
+```sh
+gcc -o myprog myprog.c -D GLFW_DLL -I path/to/glfw/include path/to/glfw/lib-mingw-w64/libglfw3dll.a -lgdi32
+```
+
+
+### With CMake and GLFW source {#build_link_cmake_source}
+
+This section is about using CMake to compile and link GLFW along with your
+application. If you want to use an installed binary instead, see @ref
+build_link_cmake_package.
+
+With a few changes to your `CMakeLists.txt` you can have the GLFW source tree
+built along with your application.
+
+Add the root directory of the GLFW source tree to your project. This will add
+the `glfw` target to your project.
+
+```cmake
+add_subdirectory(path/to/glfw)
+```
+
+Once GLFW has been added, link your application against the `glfw` target.
+This adds the GLFW library and its link-time dependencies as it is currently
+configured, the include directory for the GLFW header and, when applicable, the
+@ref GLFW_DLL macro.
+
+```cmake
+target_link_libraries(myapp glfw)
+```
+
+Note that the `glfw` target does not depend on OpenGL, as GLFW loads any OpenGL,
+OpenGL ES or Vulkan libraries it needs at runtime. If your application calls
+OpenGL directly, instead of using a modern
+[extension loader library](@ref context_glext_auto), use the OpenGL CMake
+package.
+
+```cmake
+find_package(OpenGL REQUIRED)
+```
+
+If OpenGL is found, the `OpenGL::GL` target is added to your project, containing
+library and include directory paths. Link against this like any other library.
+
+```cmake
+target_link_libraries(myapp OpenGL::GL)
+```
+
+For a minimal example of a program and GLFW sources built with CMake, see the
+[GLFW CMake Starter][cmake_starter] on GitHub.
+
+[cmake_starter]: https://github.com/juliettef/GLFW-CMake-starter
+
+
+### With CMake and installed GLFW binaries {#build_link_cmake_package}
+
+This section is about using CMake to link GLFW after it has been built and
+installed. If you want to build it along with your application instead, see
+@ref build_link_cmake_source.
+
+With a few changes to your `CMakeLists.txt` you can locate the package and
+target files generated when GLFW is installed.
+
+```cmake
+find_package(glfw3 3.5 REQUIRED)
+```
+
+Once GLFW has been added to the project, link against it with the `glfw` target.
+This adds the GLFW library and its link-time dependencies, the include directory
+for the GLFW header and, when applicable, the @ref GLFW_DLL macro.
+
+```cmake
+target_link_libraries(myapp glfw)
+```
+
+Note that the `glfw` target does not depend on OpenGL, as GLFW loads any OpenGL,
+OpenGL ES or Vulkan libraries it needs at runtime. If your application calls
+OpenGL directly, instead of using a modern
+[extension loader library](@ref context_glext_auto), use the OpenGL CMake
+package.
+
+```cmake
+find_package(OpenGL REQUIRED)
+```
+
+If OpenGL is found, the `OpenGL::GL` target is added to your project, containing
+library and include directory paths. Link against this like any other library.
+
+```cmake
+target_link_libraries(myapp OpenGL::GL)
+```
+
+
+### With pkg-config and GLFW binaries on Unix {#build_link_pkgconfig}
+
+This is intended for building a program from the command-line or by writing
+a makefile, on macOS or any Unix-like system like Linux, FreeBSD and Cygwin.
+
+GLFW supports [pkg-config][], and the `glfw3.pc` pkg-config file is generated
+when the GLFW library is built and is installed along with it. A pkg-config
+file describes all necessary compile-time and link-time flags and dependencies
+needed to use a library. When they are updated or if they differ between
+systems, you will get the correct ones automatically.
+
+[pkg-config]: https://www.freedesktop.org/wiki/Software/pkg-config/
+
+A typical compile and link command-line when using the static version of the
+GLFW library may look like this:
+
+```sh
+cc $(pkg-config --cflags glfw3) -o myprog myprog.c $(pkg-config --static --libs glfw3)
+```
+
+If you are using the shared version of the GLFW library, omit the `--static`
+flag.
+
+```sh
+cc $(pkg-config --cflags glfw3) -o myprog myprog.c $(pkg-config --libs glfw3)
+```
+
+You can also use the `glfw3.pc` file without installing it first, by using the
+`PKG_CONFIG_PATH` environment variable.
+
+```sh
+env PKG_CONFIG_PATH=path/to/glfw/src cc $(pkg-config --cflags glfw3) -o myprog myprog.c $(pkg-config --libs glfw3)
+```
+
+The dependencies do not include OpenGL, as GLFW loads any OpenGL, OpenGL ES or
+Vulkan libraries it needs at runtime. If your application calls OpenGL
+directly, instead of using a modern
+[extension loader library](@ref context_glext_auto), you should add the `gl`
+pkg-config package.
+
+```sh
+cc $(pkg-config --cflags glfw3 gl) -o myprog myprog.c $(pkg-config --libs glfw3 gl)
+```
+
+
+### With Xcode on macOS {#build_link_xcode}
+
+If you are using the dynamic library version of GLFW, add it to the project
+dependencies.
+
+If you are using the static library version of GLFW, add it and the Cocoa,
+OpenGL, IOKit and QuartzCore frameworks to the project as dependencies. They
+can all be found in `/System/Library/Frameworks`.
+
+
+### With command-line or makefile on macOS {#build_link_osx}
+
+It is recommended that you use [pkg-config](@ref build_link_pkgconfig) when
+using installed GLFW binaries from the command line on macOS. That way you will
+get any new dependencies added automatically. If you still wish to build
+manually, you need to add the required frameworks and libraries to your
+command-line yourself using the `-l` and `-framework` switches.
+
+If you are using the dynamic GLFW library, which is named `libglfw.3.dylib`, do:
+
+```sh
+cc -o myprog myprog.c -lglfw -framework Cocoa -framework OpenGL -framework IOKit -framework QuartzCore
+```
+
+If you are using the static library, named `libglfw3.a`, substitute `-lglfw3`
+for `-lglfw`.
+
+Note that you do not add the `.framework` extension to a framework when linking
+against it from the command-line.
+
+@note Your machine may have `libGL.*.dylib` style OpenGL library, but that is
+for the X Window System and will not work with the macOS native version of GLFW.
+
diff --git a/external/GLFW/docs/compat.md b/external/GLFW/docs/compat.md
new file mode 100644
index 0000000..a97192b
--- /dev/null
+++ b/external/GLFW/docs/compat.md
@@ -0,0 +1,304 @@
+# Standards conformance {#compat_guide}
+
+[TOC]
+
+This guide describes the various API extensions used by this version of GLFW.
+It lists what are essentially implementation details, but which are nonetheless
+vital knowledge for developers intending to deploy their applications on a wide
+range of machines.
+
+The information in this guide is not a part of GLFW API, but merely
+preconditions for some parts of the library to function on a given machine. Any
+part of this information may change in future versions of GLFW and that will not
+be considered a breaking API change.
+
+
+## X11 extensions, protocols and IPC standards {#compat_x11}
+
+As GLFW uses Xlib directly, without any intervening toolkit library, it has sole
+responsibility for interacting well with the many and varied window managers in
+use on Unix-like systems. In order for applications and window managers to work
+well together, a number of standards and conventions have been developed that
+regulate behavior outside the scope of the X11 API; most importantly the
+[Inter-Client Communication Conventions Manual][ICCCM] (ICCCM) and [Extended
+Window Manager Hints][EWMH] (EWMH) standards.
+
+[ICCCM]: https://www.tronche.com/gui/x/icccm/
+[EWMH]: https://standards.freedesktop.org/wm-spec/wm-spec-latest.html
+
+GLFW uses the `_MOTIF_WM_HINTS` window property to support borderless windows.
+If the running window manager does not support this property, the
+`GLFW_DECORATED` hint will have no effect.
+
+GLFW uses the ICCCM `WM_DELETE_WINDOW` protocol to intercept the user
+attempting to close the GLFW window. If the running window manager does not
+support this protocol, the close callback will never be called.
+
+GLFW uses the EWMH `_NET_WM_PING` protocol, allowing the window manager notify
+the user when the application has stopped responding, i.e. when it has ceased to
+process events. If the running window manager does not support this protocol,
+the user will not be notified if the application locks up.
+
+GLFW uses the EWMH `_NET_WM_STATE_FULLSCREEN` window state to tell the window
+manager to make the GLFW window full screen. If the running window manager does
+not support this state, full screen windows may not work properly. GLFW has
+a fallback code path in case this state is unavailable, but every window manager
+behaves slightly differently in this regard.
+
+GLFW uses the EWMH `_NET_WM_BYPASS_COMPOSITOR` window property to tell a
+compositing window manager to un-redirect full screen GLFW windows. If the
+running window manager uses compositing but does not support this property then
+additional copying may be performed for each buffer swap of full screen windows.
+
+GLFW uses the [clipboard manager protocol][ClipboardManager] to keep the
+clipboard string availble for the user after the libary has been terminated. If
+there is no running clipboard manager and the clipboard contents has been set
+with @ref glfwSetClipboardString, the clipboard will be emptied when the library
+is terminated.
+
+[clipboardManager]: https://www.freedesktop.org/wiki/ClipboardManager/
+
+GLFW uses the [X drag-and-drop protocol][XDND] to provide file drop events. If
+the application originating the drag does not support this protocol, drag and
+drop will not work.
+
+[XDND]: https://www.freedesktop.org/wiki/Specifications/XDND/
+
+GLFW uses the XRandR 1.3 extension to provide multi-monitor support. If the
+running X server does not support this version of this extension, multi-monitor
+support will not function and only a single, desktop-spanning monitor will be
+reported.
+
+GLFW uses the XRandR 1.3 and Xf86vidmode extensions to provide gamma ramp
+support. If the running X server does not support either or both of these
+extensions, gamma ramp support will not function.
+
+GLFW uses the Xkb extension and detectable auto-repeat to provide keyboard
+input. If the running X server does not support this extension, a non-Xkb
+fallback path is used.
+
+GLFW uses the XInput2 extension to provide raw, non-accelerated mouse motion
+when the cursor is disabled. If the running X server does not support this
+extension, regular accelerated mouse motion will be used.
+
+GLFW uses both the XRender extension and the compositing manager to support
+transparent window framebuffers. If the running X server does not support this
+extension or there is no running compositing manager, the
+`GLFW_TRANSPARENT_FRAMEBUFFER` framebuffer hint will have no effect.
+
+GLFW uses both the Xcursor extension and the freedesktop cursor conventions to
+provide an expanded set of standard cursor shapes. If the running X server does
+not support this extension or the current cursor theme does not support the
+conventions, the `GLFW_RESIZE_NWSE_CURSOR`, `GLFW_RESIZE_NESW_CURSOR` and
+`GLFW_NOT_ALLOWED_CURSOR` shapes will not be available and other shapes may use
+legacy images.
+
+
+## Wayland protocols and IPC standards {#compat_wayland}
+
+As GLFW uses libwayland directly, without any intervening toolkit library, it
+has sole responsibility for interacting well with every compositor in use on
+Unix-like systems. Most of the features are provided by the core protocol,
+while cursor support is provided by the libwayland-cursor helper library, EGL
+integration by libwayland-egl, and keyboard handling by
+[libxkbcommon](https://xkbcommon.org/). In addition, GLFW uses some additional
+Wayland protocols to implement certain features if the compositor supports them.
+
+GLFW uses xkbcommon 0.5.0 to provide key and text input support. Earlier
+versions are not supported.
+
+GLFW uses the [xdg-shell][] protocol to provide better window management. This
+protocol is mandatory for GLFW to display a window.
+
+[xdg-shell]: https://wayland.app/protocols/xdg-shell
+
+GLFW uses the [relative-pointer-unstable-v1][] protocol alongside the
+[pointer-constraints-unstable-v1][] protocol to implement disabled cursor. If
+the running compositor does not support both of these protocols, disabling the
+cursor will have no effect.
+
+[relative-pointer-unstable-v1]: https://wayland.app/protocols/relative-pointer-unstable-v1
+[pointer-constraints-unstable-v1]: https://wayland.app/protocols/pointer-constraints-unstable-v1
+
+GLFW uses the [idle-inhibit-unstable-v1][] protocol to prohibit the screensaver
+from starting. If the running compositor does not support this protocol, the
+screensaver may start even for full screen windows.
+
+[idle-inhibit-unstable-v1]: https://wayland.app/protocols/idle-inhibit-unstable-v1
+
+GLFW uses the [libdecor][] library for window decorations, where available.
+This in turn provides good quality client-side decorations (drawn by the
+application) on desktop systems that do not support server-side decorations
+(drawn by the window manager). On systems that do not provide either libdecor
+or xdg-decoration, very basic window decorations are provided. These do not
+include the window title or any caption buttons.
+
+[libdecor]: https://gitlab.freedesktop.org/libdecor/libdecor
+
+GLFW uses the [xdg-decoration-unstable-v1][] protocol to request decorations to
+be drawn around its windows. This protocol is part of wayland-protocols 1.15,
+and mandatory at build time. If the running compositor does not support this
+protocol, a very simple frame will be drawn by GLFW itself, using the
+[viewporter][] protocol alongside subsurfaces. If the running compositor does
+not support these protocols either, no decorations will be drawn around windows.
+
+[xdg-decoration-unstable-v1]: https://wayland.app/protocols/xdg-decoration-unstable-v1
+[viewporter]: https://wayland.app/protocols/viewporter
+
+GLFW uses the [xdg-activation-v1][] protocol to implement window focus and
+attention requests. If the running compositor does not support this protocol,
+window focus and attention requests do nothing.
+
+[xdg-activation-v1]: https://wayland.app/protocols/xdg-activation-v1
+
+GLFW uses the [fractional-scale-v1][] protocol to implement fine-grained
+framebuffer scaling. If the running compositor does not support this protocol,
+the @ref GLFW_SCALE_FRAMEBUFFER window hint will only be able to scale the
+framebuffer by integer scales. This will typically be the smallest integer not
+less than the actual scale.
+
+[fractional-scale-v1]: https://wayland.app/protocols/fractional-scale-v1
+
+
+## GLX extensions {#compat_glx}
+
+The GLX API is the default API used to create OpenGL contexts on Unix-like
+systems using the X Window System.
+
+GLFW uses the GLX 1.3 `GLXFBConfig` functions to enumerate and select framebuffer pixel
+formats. If GLX 1.3 is not supported, @ref glfwInit will fail.
+
+GLFW uses the `GLX_MESA_swap_control,` `GLX_EXT_swap_control` and
+`GLX_SGI_swap_control` extensions to provide vertical retrace synchronization
+(or _vsync_), in that order of preference. When none of these extensions are
+available, calling @ref glfwSwapInterval will have no effect.
+
+GLFW uses the `GLX_ARB_multisample` extension to create contexts with
+multisampling anti-aliasing. Where this extension is unavailable, the
+`GLFW_SAMPLES` hint will have no effect.
+
+GLFW uses the `GLX_ARB_create_context` extension when available, even when
+creating OpenGL contexts of version 2.1 and below. Where this extension is
+unavailable, the `GLFW_CONTEXT_VERSION_MAJOR` and `GLFW_CONTEXT_VERSION_MINOR`
+hints will only be partially supported, the `GLFW_CONTEXT_DEBUG` hint will have
+no effect, and setting the `GLFW_OPENGL_PROFILE` or `GLFW_OPENGL_FORWARD_COMPAT`
+hints to `GLFW_TRUE` will cause @ref glfwCreateWindow to fail.
+
+GLFW uses the `GLX_ARB_create_context_profile` extension to provide support for
+context profiles. Where this extension is unavailable, setting the
+`GLFW_OPENGL_PROFILE` hint to anything but `GLFW_OPENGL_ANY_PROFILE`, or setting
+`GLFW_CLIENT_API` to anything but `GLFW_OPENGL_API` or `GLFW_NO_API` will cause
+@ref glfwCreateWindow to fail.
+
+GLFW uses the `GLX_ARB_context_flush_control` extension to provide control over
+whether a context is flushed when it is released (made non-current). Where this
+extension is unavailable, the `GLFW_CONTEXT_RELEASE_BEHAVIOR` hint will have no
+effect and the context will always be flushed when released.
+
+GLFW uses the `GLX_ARB_framebuffer_sRGB` and `GLX_EXT_framebuffer_sRGB`
+extensions to provide support for sRGB framebuffers. Where both of these
+extensions are unavailable, the `GLFW_SRGB_CAPABLE` hint will have no effect.
+
+
+## WGL extensions {#compat_wgl}
+
+The WGL API is used to create OpenGL contexts on Microsoft Windows and other
+implementations of the Win32 API, such as Wine.
+
+GLFW uses either the `WGL_EXT_extension_string` or the
+`WGL_ARB_extension_string` extension to check for the presence of all other WGL
+extensions listed below. If both are available, the EXT one is preferred. If
+neither is available, no other extensions are used and many GLFW features
+related to context creation will have no effect or cause errors when used.
+
+GLFW uses the `WGL_EXT_swap_control` extension to provide vertical retrace
+synchronization (or _vsync_). Where this extension is unavailable, calling @ref
+glfwSwapInterval will have no effect.
+
+GLFW uses the `WGL_ARB_pixel_format` and `WGL_ARB_multisample` extensions to
+create contexts with multisampling anti-aliasing. Where these extensions are
+unavailable, the `GLFW_SAMPLES` hint will have no effect.
+
+GLFW uses the `WGL_ARB_create_context` extension when available, even when
+creating OpenGL contexts of version 2.1 and below. Where this extension is
+unavailable, the `GLFW_CONTEXT_VERSION_MAJOR` and `GLFW_CONTEXT_VERSION_MINOR`
+hints will only be partially supported, the `GLFW_CONTEXT_DEBUG` hint will have
+no effect, and setting the `GLFW_OPENGL_PROFILE` or `GLFW_OPENGL_FORWARD_COMPAT`
+hints to `GLFW_TRUE` will cause @ref glfwCreateWindow to fail.
+
+GLFW uses the `WGL_ARB_create_context_profile` extension to provide support for
+context profiles. Where this extension is unavailable, setting the
+`GLFW_OPENGL_PROFILE` hint to anything but `GLFW_OPENGL_ANY_PROFILE` will cause
+@ref glfwCreateWindow to fail.
+
+GLFW uses the `WGL_ARB_context_flush_control` extension to provide control over
+whether a context is flushed when it is released (made non-current). Where this
+extension is unavailable, the `GLFW_CONTEXT_RELEASE_BEHAVIOR` hint will have no
+effect and the context will always be flushed when released.
+
+GLFW uses the `WGL_ARB_framebuffer_sRGB` and `WGL_EXT_framebuffer_sRGB`
+extensions to provide support for sRGB framebuffers. When both of these
+extensions are unavailable, the `GLFW_SRGB_CAPABLE` hint will have no effect.
+
+
+## OpenGL on macOS {#compat_osx}
+
+macOS (as of version 14) still provides OpenGL but it has been deprecated by
+Apple. While the API is still available, it is poorly maintained and frequently
+develops new issues. On modern systems, OpenGL is implemented on top of Metal
+and is not fully thread-safe.
+
+macOS does not support OpenGL stereo rendering. If the `GLFW_STEREO` hint is
+set to true, OpenGL context creation will always fail.
+
+macOS only supports OpenGL core profile contexts that are forward-compatible,
+but the `GLFW_OPENGL_FORWARD_COMPAT` hint is ignored since GLFW 3.4. Even if
+this hint is set to false (the default), a forward-compatible context will be
+returned if available.
+
+macOS does not support OpenGL debug contexts, no-error contexts or robustness.
+The `GLFW_CONTEXT_DEBUG`, `GLFW_CONTEXT_NO_ERROR` and `GLFW_CONTEXT_ROBUSTNESS`
+hints will be ignored and a context without these features will be returned.
+
+macOS does not flush OpenGL contexts when they are made non-current. The
+`GLFW_CONTEXT_RELEASE_BEHAVIOR` hint is ignored and the release behavior will
+always be the equivalent of `GLFW_RELEASE_BEHAVIOR_NONE`. If you need a context
+to be flushed, call `glFlush` before making it non-current.
+
+
+## Vulkan loader and API {#compat_vulkan}
+
+By default, GLFW uses the standard system-wide Vulkan loader to access the
+Vulkan API on all platforms except macOS. This is installed by both graphics
+drivers and Vulkan SDKs. If either the loader or at least one minimally
+functional ICD is missing, @ref glfwVulkanSupported will return `GLFW_FALSE` and
+all other Vulkan-related functions will fail with an @ref GLFW_API_UNAVAILABLE
+error.
+
+
+## Vulkan WSI extensions {#compat_wsi}
+
+The Vulkan WSI extensions are used to create Vulkan surfaces for GLFW windows on
+all supported platforms.
+
+GLFW uses the `VK_KHR_surface` and `VK_KHR_win32_surface` extensions to create
+surfaces on Microsoft Windows. If any of these extensions are not available,
+@ref glfwGetRequiredInstanceExtensions will return an empty list and window
+surface creation will fail.
+
+GLFW uses the `VK_KHR_surface` and either the `VK_MVK_macos_surface` or
+`VK_EXT_metal_surface` extensions to create surfaces on macOS. If any of these
+extensions are not available, @ref glfwGetRequiredInstanceExtensions will
+return an empty list and window surface creation will fail.
+
+GLFW uses the `VK_KHR_surface` and either the `VK_KHR_xlib_surface` or
+`VK_KHR_xcb_surface` extensions to create surfaces on X11. If `VK_KHR_surface`
+or both `VK_KHR_xlib_surface` and `VK_KHR_xcb_surface` are not available, @ref
+glfwGetRequiredInstanceExtensions will return an empty list and window surface
+creation will fail.
+
+GLFW uses the `VK_KHR_surface` and `VK_KHR_wayland_surface` extensions to create
+surfaces on Wayland. If any of these extensions are not available, @ref
+glfwGetRequiredInstanceExtensions will return an empty list and window surface
+creation will fail.
+
diff --git a/external/GLFW/docs/compile.md b/external/GLFW/docs/compile.md
new file mode 100644
index 0000000..3b10ea5
--- /dev/null
+++ b/external/GLFW/docs/compile.md
@@ -0,0 +1,371 @@
+# Compiling GLFW {#compile_guide}
+
+[TOC]
+
+This is about compiling the GLFW library itself. For information on how to
+build applications that use GLFW, see @ref build_guide.
+
+GLFW uses some C99 features and does not support Visual Studio 2012 and earlier.
+
+
+## Using CMake {#compile_cmake}
+
+GLFW behaves like most other libraries that use CMake so this guide mostly
+describes the standard configure, generate and compile sequence. If you are already
+familiar with this from other projects, you may want to focus on the @ref
+compile_deps and @ref compile_options sections for GLFW-specific information.
+
+GLFW uses [CMake](https://cmake.org/) to generate project files or makefiles
+for your chosen development environment. To compile GLFW, first generate these
+files with CMake and then use them to compile the GLFW library.
+
+If you are on Windows and macOS you can [download
+CMake](https://cmake.org/download/) from their site.
+
+If you are on a Unix-like system such as Linux, FreeBSD or Cygwin or have
+a package system like Fink, MacPorts or Homebrew, you can install its CMake
+package.
+
+CMake is a complex tool and this guide will only show a few of the possible ways
+to set up and compile GLFW. The CMake project has their own much more detailed
+[CMake user guide][cmake-guide] that includes everything in this guide not
+specific to GLFW. It may be a useful companion to this one.
+
+[cmake-guide]: https://cmake.org/cmake/help/latest/guide/user-interaction/
+
+
+### Installing dependencies {#compile_deps}
+
+The C/C++ development environments in Visual Studio, Xcode and MinGW-w64 come
+with all necessary dependencies for compiling GLFW, but on Unix-like systems
+like Linux and FreeBSD you will need a few extra packages.
+
+
+#### Dependencies for Wayland and X11 {#compile_deps_wayland}
+
+By default, both the Wayland and X11 backends are enabled on Linux and other Unix-like
+systems (except macOS). To disable one or both of these, set the @ref GLFW_BUILD_WAYLAND
+or @ref GLFW_BUILD_X11 CMake options in the next step when generating build files.
+
+To compile GLFW for both Wayland and X11, you need to have the X11, Wayland and xkbcommon
+development packages installed. On some systems a few other packages are also required.
+None of the development packages above are needed to build or run programs that use an
+already compiled GLFW library.
+
+On Debian and derivatives like Ubuntu and Linux Mint you will need the `libwayland-dev`
+and `libxkbcommon-dev` packages to compile for Wayland and the `xorg-dev` meta-package to
+compile for X11. These will pull in all other dependencies.
+
+```sh
+sudo apt install libwayland-dev libxkbcommon-dev xorg-dev
+```
+
+On Fedora and derivatives like Red Hat you will need the `wayland-devel` and
+`libxkbcommon-devel` packages to compile for Wayland and the `libXcursor-devel`,
+`libXi-devel`, `libXinerama-devel` and `libXrandr-devel` packages to compile for X11.
+These will pull in all other dependencies.
+
+```sh
+sudo dnf install wayland-devel libxkbcommon-devel libXcursor-devel libXi-devel libXinerama-devel libXrandr-devel
+```
+
+On FreeBSD you will need the `wayland`, `libxkbcommon` and `evdev-proto` packages to
+compile for Wayland. The X11 headers are installed along the end-user X11 packages, so if
+you have an X server running you should have the headers as well. If not, install the
+`xorgproto` package to compile for X11.
+
+```sh
+pkg install wayland libxkbcommon evdev-proto xorgproto
+```
+
+On Cygwin Wayland is not supported but you will need the `libXcursor-devel`,
+`libXi-devel`, `libXinerama-devel`, `libXrandr-devel` and `libXrender-devel` packages to
+compile for X11. These can be found in the Libs section of the GUI installer and will
+pull in all other dependencies.
+
+Once you have the required dependencies, move on to @ref compile_generate.
+
+
+### Generating build files with CMake {#compile_generate}
+
+Once you have all necessary dependencies it is time to generate the project
+files or makefiles for your development environment. CMake needs two paths for
+this:
+
+ - the path to the root directory of the GLFW source tree (not its `src`
+ subdirectory)
+ - the path to the directory where the generated build files and compiled
+ binaries will be placed
+
+If these are the same, it is called an in-tree build, otherwise it is called an
+out-of-tree build.
+
+Out-of-tree builds are recommended as they avoid cluttering up the source tree.
+They also allow you to have several build directories for different
+configurations all using the same source tree.
+
+A common pattern when building a single configuration is to have a build
+directory named `build` in the root of the source tree.
+
+
+#### Generating with the CMake GUI {#compile_generate_gui}
+
+Start the CMake GUI and set the paths to the source and build directories
+described above. Then press _Configure_ and _Generate_.
+
+If you wish change any CMake variables in the list, press _Configure_ and then
+_Generate_ to have the new values take effect. The variable list will be
+populated after the first configure step.
+
+By default, GLFW will use Wayland and X11 on Linux and other Unix-like systems other than
+macOS. To disable support for one or both of these, set the @ref GLFW_BUILD_WAYLAND
+and/or @ref GLFW_BUILD_X11 option in the GLFW section of the variable list, then apply the
+new value as described above.
+
+Once you have generated the project files or makefiles for your chosen
+development environment, move on to @ref compile_compile.
+
+
+#### Generating with command-line CMake {#compile_generate_cli}
+
+To make a build directory, pass the source and build directories to the `cmake`
+command. These can be relative or absolute paths. The build directory is
+created if it doesn't already exist.
+
+```sh
+cmake -S path/to/glfw -B path/to/build
+```
+
+It is common to name the build directory `build` and place it in the root of the
+source tree when only planning to build a single configuration.
+
+```sh
+cd path/to/glfw
+cmake -S . -B build
+```
+
+Without other flags these will generate Visual Studio project files on Windows
+and makefiles on other platforms. You can choose other targets using the `-G`
+flag.
+
+```sh
+cmake -S path/to/glfw -B path/to/build -G Xcode
+```
+
+By default, GLFW will use Wayland and X11 on Linux and other Unix-like systems other than
+macOS. To disable support for one or both of these, set the @ref GLFW_BUILD_WAYLAND
+and/or @ref GLFW_BUILD_X11 CMake option.
+
+```sh
+cmake -S path/to/glfw -B path/to/build -D GLFW_BUILD_X11=0
+```
+
+Once you have generated the project files or makefiles for your chosen
+development environment, move on to @ref compile_compile.
+
+
+### Compiling the library {#compile_compile}
+
+You should now have all required dependencies and the project files or makefiles
+necessary to compile GLFW. Go ahead and compile the actual GLFW library with
+these files as you would with any other project.
+
+With Visual Studio open `GLFW.sln` and use the Build menu. With Xcode open
+`GLFW.xcodeproj` and use the Project menu.
+
+With Linux, macOS and other forms of Unix, run `make`.
+
+```sh
+cd path/to/build
+make
+```
+
+With MinGW-w64, it is `mingw32-make`.
+
+```sh
+cd path/to/build
+mingw32-make
+```
+
+Any CMake build directory can also be built with the `cmake` command and the
+`--build` flag.
+
+```sh
+cmake --build path/to/build
+```
+
+This will run the platform specific build tool the directory was generated for.
+
+Once the GLFW library is compiled you are ready to build your application,
+linking it to the GLFW library. See @ref build_guide for more information.
+
+
+## CMake options {#compile_options}
+
+The CMake files for GLFW provide a number of options, although not all are
+available on all supported platforms. Some of these are de facto standards
+among projects using CMake and so have no `GLFW_` prefix.
+
+If you are using the GUI version of CMake, these are listed and can be changed
+from there. If you are using the command-line version of CMake you can use the
+`ccmake` ncurses GUI to set options. Some package systems like Ubuntu and other
+distributions based on Debian GNU/Linux have this tool in a separate
+`cmake-curses-gui` package.
+
+Finally, if you don't want to use any GUI, you can set options from the `cmake`
+command-line with the `-D` flag.
+
+```sh
+cmake -S path/to/glfw -B path/to/build -D BUILD_SHARED_LIBS=ON
+```
+
+
+### Shared CMake options {#compile_options_shared}
+
+@anchor BUILD_SHARED_LIBS
+__BUILD_SHARED_LIBS__ determines whether GLFW is built as a static library or as
+a DLL / shared library / dynamic library. This is disabled by default,
+producing a static GLFW library. This variable has no `GLFW_` prefix because it
+is defined by CMake. If you want to change the library only for GLFW when it is
+part of a larger project, see @ref GLFW_LIBRARY_TYPE.
+
+@anchor GLFW_LIBRARY_TYPE
+__GLFW_LIBRARY_TYPE__ allows you to override @ref BUILD_SHARED_LIBS only for
+GLFW, without affecting other libraries in a larger project. When set, the
+value of this option must be a valid CMake library type. Set it to `STATIC` to
+build GLFW as a static library, `SHARED` to build it as a shared library
+/ dynamic library / DLL, or `OBJECT` to make GLFW a CMake object library.
+
+@anchor GLFW_BUILD_EXAMPLES
+__GLFW_BUILD_EXAMPLES__ determines whether the GLFW examples are built
+along with the library. This is enabled by default unless GLFW is being built
+as a subproject of a larger CMake project.
+
+@anchor GLFW_BUILD_TESTS
+__GLFW_BUILD_TESTS__ determines whether the GLFW test programs are
+built along with the library. This is enabled by default unless GLFW is being
+built as a subproject of a larger CMake project.
+
+@anchor GLFW_BUILD_DOCS
+__GLFW_BUILD_DOCS__ determines whether the GLFW documentation is built along
+with the library. This is enabled by default if
+[Doxygen](https://www.doxygen.nl/) is found by CMake during configuration.
+
+
+### Win32 specific CMake options {#compile_options_win32}
+
+@anchor GLFW_BUILD_WIN32
+__GLFW_BUILD_WIN32__ determines whether to include support for Win32 when compiling the
+library. This option is only available when compiling for Windows. This is enabled by
+default.
+
+@anchor USE_MSVC_RUNTIME_LIBRARY_DLL
+__USE_MSVC_RUNTIME_LIBRARY_DLL__ determines whether to use the DLL version or the
+static library version of the Visual C++ runtime library. When enabled, the
+DLL version of the Visual C++ library is used. This is enabled by default.
+
+It is recommended to set the standard CMake variable [CMAKE_MSVC_RUNTIME_LIBRARY][]
+instead of this GLFW-specific option.
+
+[CMAKE_MSVC_RUNTIME_LIBRARY]: https://cmake.org/cmake/help/latest/variable/CMAKE_MSVC_RUNTIME_LIBRARY.html
+
+@anchor GLFW_USE_HYBRID_HPG
+__GLFW_USE_HYBRID_HPG__ determines whether to export the `NvOptimusEnablement` and
+`AmdPowerXpressRequestHighPerformance` symbols, which force the use of the
+high-performance GPU on Nvidia Optimus and AMD PowerXpress systems. These symbols
+need to be exported by the EXE to be detected by the driver, so the override
+will not work if GLFW is built as a DLL. This is disabled by default, letting
+the operating system and driver decide.
+
+
+### macOS specific CMake options {#compile_options_macos}
+
+@anchor GLFW_BUILD_COCOA
+__GLFW_BUILD_COCOA__ determines whether to include support for Cocoa when compiling the
+library. This option is only available when compiling for macOS. This is enabled by
+default.
+
+
+### Unix-like system specific CMake options {#compile_options_unix}
+
+@anchor GLFW_BUILD_WAYLAND
+__GLFW_BUILD_WAYLAND__ determines whether to include support for Wayland when compiling
+the library. This option is only available when compiling for Linux and other Unix-like
+systems other than macOS. This is enabled by default.
+
+@anchor GLFW_BUILD_X11
+__GLFW_BUILD_X11__ determines whether to include support for X11 when compiling the
+library. This option is only available when compiling for Linux and other Unix-like
+systems other than macOS. This is enabled by default.
+
+
+## Cross-compilation with CMake and MinGW-w64 {#compile_mingw_cross}
+
+Both Cygwin and many Linux distributions have MinGW-w64 packages. For example,
+Cygwin has the `mingw64-i686-gcc` and `mingw64-x86_64-gcc` packages for 32- and
+64-bit version of MinGW-w64, while Debian GNU/Linux and derivatives like Ubuntu
+have the `mingw-w64` package for both.
+
+GLFW has CMake toolchain files in the `CMake` subdirectory that set up
+cross-compilation of Windows binaries. To use these files you set the
+`CMAKE_TOOLCHAIN_FILE` CMake variable with the `-D` flag add an option when
+configuring and generating the build files.
+
+```sh
+cmake -S path/to/glfw -B path/to/build -D CMAKE_TOOLCHAIN_FILE=path/to/file
+```
+
+The exact toolchain file to use depends on the prefix used by the MinGW-w64
+binaries on your system. You can usually see this in the /usr directory. For
+example, both the Ubuntu and Cygwin MinGW-w64 packages have
+`/usr/x86_64-w64-mingw32` for the 64-bit compilers, so the correct invocation
+would be:
+
+```sh
+cmake -S path/to/glfw -B path/to/build -D CMAKE_TOOLCHAIN_FILE=CMake/x86_64-w64-mingw32.cmake
+```
+
+The path to the toolchain file is relative to the path to the GLFW source tree
+passed to the `-S` flag, not to the current directory.
+
+For more details see the [CMake toolchain guide][cmake-toolchains].
+
+[cmake-toolchains]: https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html
+
+
+## Compiling GLFW manually {#compile_manual}
+
+If you wish to compile GLFW without its CMake build environment then you will have to do
+at least some platform-detection yourself. There are preprocessor macros for
+enabling support for the platforms (window systems) available. There are also optional,
+platform-specific macros for various features.
+
+When building, GLFW will expect the necessary configuration macros to be defined
+on the command-line. The GLFW CMake files set these as private compile
+definitions on the GLFW target but if you compile the GLFW sources manually you
+will need to define them yourself.
+
+The window system is used to create windows, handle input, monitors, gamma ramps and
+clipboard. The options are:
+
+ - @b _GLFW_COCOA to use the Cocoa frameworks
+ - @b _GLFW_WIN32 to use the Win32 API
+ - @b _GLFW_WAYLAND to use the Wayland protocol
+ - @b _GLFW_X11 to use the X Window System
+
+The @b _GLFW_WAYLAND and @b _GLFW_X11 macros may be combined and produces a library that
+attempts to detect the appropriate platform at initialization.
+
+If you are building GLFW as a shared library / dynamic library / DLL then you
+must also define @b _GLFW_BUILD_DLL. Otherwise, you must not define it.
+
+If you are using a custom name for the Vulkan, EGL, GLX, OSMesa, OpenGL, GLESv1
+or GLESv2 library, you can override the default names by defining those you need
+of @b _GLFW_VULKAN_LIBRARY, @b _GLFW_EGL_LIBRARY, @b _GLFW_GLX_LIBRARY, @b
+_GLFW_OSMESA_LIBRARY, @b _GLFW_OPENGL_LIBRARY, @b _GLFW_GLESV1_LIBRARY and @b
+_GLFW_GLESV2_LIBRARY. Otherwise, GLFW will use the built-in default names.
+
+@note None of the @ref build_macros may be defined during the compilation of
+GLFW. If you define any of these in your build files, make sure they are not
+applied to the GLFW sources.
+
diff --git a/external/GLFW/docs/context.md b/external/GLFW/docs/context.md
new file mode 100644
index 0000000..bf70553
--- /dev/null
+++ b/external/GLFW/docs/context.md
@@ -0,0 +1,340 @@
+# Context guide {#context_guide}
+
+[TOC]
+
+This guide introduces the OpenGL and OpenGL ES context related functions of
+GLFW. For details on a specific function in this category, see the @ref
+context. There are also guides for the other areas of the GLFW API.
+
+ - @ref intro_guide
+ - @ref window_guide
+ - @ref vulkan_guide
+ - @ref monitor_guide
+ - @ref input_guide
+
+
+## Context objects {#context_object}
+
+A window object encapsulates both a top-level window and an OpenGL or OpenGL ES
+context. It is created with @ref glfwCreateWindow and destroyed with @ref
+glfwDestroyWindow or @ref glfwTerminate. See @ref window_creation for more
+information.
+
+As the window and context are inseparably linked, the window object also serves
+as the context handle.
+
+To test the creation of various kinds of contexts and see their properties, run
+the `glfwinfo` test program.
+
+@note Vulkan does not have a context and the Vulkan instance is created via the
+Vulkan API itself. If you will be using Vulkan to render to a window, disable
+context creation by setting the [GLFW_CLIENT_API](@ref GLFW_CLIENT_API_hint)
+hint to `GLFW_NO_API`. For more information, see the @ref vulkan_guide.
+
+
+### Context creation hints {#context_hints}
+
+There are a number of hints, specified using @ref glfwWindowHint, related to
+what kind of context is created. See
+[context related hints](@ref window_hints_ctx) in the window guide.
+
+
+### Context object sharing {#context_sharing}
+
+When creating a window and its OpenGL or OpenGL ES context with @ref
+glfwCreateWindow, you can specify another window whose context the new one
+should share its objects (textures, vertex and element buffers, etc.) with.
+
+```c
+GLFWwindow* second_window = glfwCreateWindow(640, 480, "Second Window", NULL, first_window);
+```
+
+Object sharing is implemented by the operating system and graphics driver. On
+platforms where it is possible to choose which types of objects are shared, GLFW
+requests that all types are shared.
+
+See the relevant chapter of the [OpenGL](https://www.opengl.org/registry/) or
+[OpenGL ES](https://www.khronos.org/opengles/) reference documents for more
+information. The name and number of this chapter unfortunately varies between
+versions and APIs, but has at times been named _Shared Objects and Multiple
+Contexts_.
+
+GLFW comes with a bare-bones object sharing example program called `sharing`.
+
+
+### Offscreen contexts {#context_offscreen}
+
+GLFW doesn't support creating contexts without an associated window. However,
+contexts with hidden windows can be created with the
+[GLFW_VISIBLE](@ref GLFW_VISIBLE_hint) window hint.
+
+```c
+glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
+
+GLFWwindow* offscreen_context = glfwCreateWindow(640, 480, "", NULL, NULL);
+```
+
+The window never needs to be shown and its context can be used as a plain
+offscreen context. Depending on the window manager, the size of a hidden
+window's framebuffer may not be usable or modifiable, so framebuffer
+objects are recommended for rendering with such contexts.
+
+You should still [process events](@ref events) as long as you have at least one
+window, even if none of them are visible.
+
+
+### Windows without contexts {#context_less}
+
+You can disable context creation by setting the
+[GLFW_CLIENT_API](@ref GLFW_CLIENT_API_hint) hint to `GLFW_NO_API`.
+
+Windows without contexts should not be passed to @ref glfwMakeContextCurrent or
+@ref glfwSwapBuffers. Doing this generates a @ref GLFW_NO_WINDOW_CONTEXT error.
+
+
+## Current context {#context_current}
+
+Before you can make OpenGL or OpenGL ES calls, you need to have a current
+context of the correct type. A context can only be current for a single thread
+at a time, and a thread can only have a single context current at a time.
+
+When moving a context between threads, you must make it non-current on the old
+thread before making it current on the new one.
+
+The context of a window is made current with @ref glfwMakeContextCurrent.
+
+```c
+glfwMakeContextCurrent(window);
+```
+
+The window of the current context is returned by @ref glfwGetCurrentContext.
+
+```c
+GLFWwindow* window = glfwGetCurrentContext();
+```
+
+The following GLFW functions require a context to be current. Calling any these
+functions without a current context will generate a @ref GLFW_NO_CURRENT_CONTEXT
+error.
+
+ - @ref glfwSwapInterval
+ - @ref glfwExtensionSupported
+ - @ref glfwGetProcAddress
+
+
+## Buffer swapping {#context_swap}
+
+See @ref buffer_swap in the window guide.
+
+
+## OpenGL and OpenGL ES extensions {#context_glext}
+
+One of the benefits of OpenGL and OpenGL ES is their extensibility.
+Hardware vendors may include extensions in their implementations that extend the
+API before that functionality is included in a new version of the OpenGL or
+OpenGL ES specification, and some extensions are never included and remain
+as extensions until they become obsolete.
+
+An extension is defined by:
+
+- An extension name (e.g. `GL_ARB_gl_spirv`)
+- New OpenGL tokens (e.g. `GL_SPIR_V_BINARY_ARB`)
+- New OpenGL functions (e.g. `glSpecializeShaderARB`)
+
+Note the `ARB` affix, which stands for Architecture Review Board and is used
+for official extensions. The extension above was created by the ARB, but there
+are many different affixes, like `NV` for Nvidia and `AMD` for, well, AMD. Any
+group may also use the generic `EXT` affix. Lists of extensions, together with
+their specifications, can be found at the
+[OpenGL Registry](https://www.opengl.org/registry/) and
+[OpenGL ES Registry](https://www.khronos.org/registry/gles/).
+
+
+### Loading extension with a loader library {#context_glext_auto}
+
+An extension loader library is the easiest and best way to access both OpenGL and
+OpenGL ES extensions and modern versions of the core OpenGL or OpenGL ES APIs.
+They will take care of all the details of declaring and loading everything you
+need. One such library is [glad](https://github.com/Dav1dde/glad) and there are
+several others.
+
+The following example will use glad but all extension loader libraries work
+similarly.
+
+First you need to generate the source files using the glad Python script. This
+example generates a loader for any version of OpenGL, which is the default for
+both GLFW and glad, but loaders for OpenGL ES, as well as loaders for specific
+API versions and extension sets can be generated. The generated files are
+written to the `output` directory.
+
+```sh
+python main.py --generator c --no-loader --out-path output
+```
+
+The `--no-loader` option is added because GLFW already provides a function for
+loading OpenGL and OpenGL ES function pointers, one that automatically uses the
+selected context creation API, and glad can call this instead of having to
+implement its own. There are several other command-line options as well. See
+the glad documentation for details.
+
+Add the generated `output/src/glad.c`, `output/include/glad/glad.h` and
+`output/include/KHR/khrplatform.h` files to your build. Then you need to
+include the glad header file, which will replace the OpenGL header of your
+development environment. By including the glad header before the GLFW header,
+it suppresses the development environment's OpenGL or OpenGL ES header.
+
+```c
+#include
+#include
+```
+
+Finally, you need to initialize glad once you have a suitable current context.
+
+```c
+window = glfwCreateWindow(640, 480, "My Window", NULL, NULL);
+if (!window)
+{
+ ...
+}
+
+glfwMakeContextCurrent(window);
+
+gladLoadGLLoader((GLADloadproc) glfwGetProcAddress);
+```
+
+Once glad has been loaded, you have access to all OpenGL core and extension
+functions supported by both the context you created and the glad loader you
+generated. After that, you are ready to start rendering.
+
+You can specify a minimum required OpenGL or OpenGL ES version with
+[context hints](@ref window_hints_ctx). If your needs are more complex, you can
+check the actual OpenGL or OpenGL ES version with
+[context attributes](@ref window_attribs_ctx), or you can check whether
+a specific version is supported by the current context with the
+`GLAD_GL_VERSION_x_x` booleans.
+
+```c
+if (GLAD_GL_VERSION_3_2)
+{
+ // Call OpenGL 3.2+ specific code
+}
+```
+
+To check whether a specific extension is supported, use the `GLAD_GL_xxx`
+booleans.
+
+```c
+if (GLAD_GL_ARB_gl_spirv)
+{
+ // Use GL_ARB_gl_spirv
+}
+```
+
+
+### Loading extensions manually {#context_glext_manual}
+
+__Do not use this technique__ unless it is absolutely necessary. An
+[extension loader library](@ref context_glext_auto) will save you a ton of
+tedious, repetitive, error prone work.
+
+To use a certain extension, you must first check whether the context supports
+that extension and then, if it introduces new functions, retrieve the pointers
+to those functions. GLFW provides @ref glfwExtensionSupported and @ref
+glfwGetProcAddress for manual loading of extensions and new API functions.
+
+This section will demonstrate manual loading of OpenGL extensions. The loading
+of OpenGL ES extensions is identical except for the name of the extension header.
+
+
+#### The glext.h header {#context_glext_header}
+
+The `glext.h` extension header is a continually updated file that defines the
+interfaces for all OpenGL extensions. The latest version of this can always be
+found at the [OpenGL Registry](https://www.opengl.org/registry/). There are also
+extension headers for the various versions of OpenGL ES at the
+[OpenGL ES Registry](https://www.khronos.org/registry/gles/). It it strongly
+recommended that you use your own copy of the extension header, as the one
+included in your development environment may be several years out of date and
+may not include the extensions you wish to use.
+
+The header defines function pointer types for all functions of all extensions it
+supports. These have names like `PFNGLSPECIALIZESHADERARBPROC` (for
+`glSpecializeShaderARB`), i.e. the name is made uppercase and `PFN` (pointer
+to function) and `PROC` (procedure) are added to the ends.
+
+To include the extension header, define @ref GLFW_INCLUDE_GLEXT before including
+the GLFW header.
+
+```c
+#define GLFW_INCLUDE_GLEXT
+#include
+```
+
+
+#### Checking for extensions {#context_glext_string}
+
+A given machine may not actually support the extension (it may have older
+drivers or a graphics card that lacks the necessary hardware features), so it
+is necessary to check at run-time whether the context supports the extension.
+This is done with @ref glfwExtensionSupported.
+
+```c
+if (glfwExtensionSupported("GL_ARB_gl_spirv"))
+{
+ // The extension is supported by the current context
+}
+```
+
+The argument is a null terminated ASCII string with the extension name. If the
+extension is supported, @ref glfwExtensionSupported returns `GLFW_TRUE`,
+otherwise it returns `GLFW_FALSE`.
+
+
+#### Fetching function pointers {#context_glext_proc}
+
+Many extensions, though not all, require the use of new OpenGL functions.
+These functions often do not have entry points in the client API libraries of
+your operating system, making it necessary to fetch them at run time. You can
+retrieve pointers to these functions with @ref glfwGetProcAddress.
+
+```c
+PFNGLSPECIALIZESHADERARBPROC pfnSpecializeShaderARB = glfwGetProcAddress("glSpecializeShaderARB");
+```
+
+In general, you should avoid giving the function pointer variables the (exact)
+same name as the function, as this may confuse your linker. Instead, you can
+use a different prefix, like above, or some other naming scheme.
+
+Now that all the pieces have been introduced, here is what they might look like
+when used together.
+
+```c
+#define GLFW_INCLUDE_GLEXT
+#include
+
+#define glSpecializeShaderARB pfnSpecializeShaderARB
+PFNGLSPECIALIZESHADERARBPROC pfnSpecializeShaderARB;
+
+// Flag indicating whether the extension is supported
+int has_ARB_gl_spirv = 0;
+
+void load_extensions(void)
+{
+ if (glfwExtensionSupported("GL_ARB_gl_spirv"))
+ {
+ pfnSpecializeShaderARB = (PFNGLSPECIALIZESHADERARBPROC)
+ glfwGetProcAddress("glSpecializeShaderARB");
+ has_ARB_gl_spirv = 1;
+ }
+}
+
+void some_function(void)
+{
+ if (has_ARB_gl_spirv)
+ {
+ // Now the extension function can be called as usual
+ glSpecializeShaderARB(...);
+ }
+}
+```
+
diff --git a/external/GLFW/docs/extra.css b/external/GLFW/docs/extra.css
index 42091cd..7eb7e9d 100644
--- a/external/GLFW/docs/extra.css
+++ b/external/GLFW/docs/extra.css
@@ -1 +1,2 @@
-.sm-dox,.sm-dox a,.sm-dox a:focus,.sm-dox a:active,.sm-dox a:hover,.sm-dox a.highlighted,.sm-dox ul a:hover{background:none;text-shadow:none}.sm-dox a span.sub-arrow{border-color:#f2f2f2 transparent transparent transparent}.sm-dox a span.sub-arrow:active,.sm-dox a span.sub-arrow:focus,.sm-dox a span.sub-arrow:hover,.sm-dox a:hover span.sub-arrow{border-color:#f60 transparent transparent transparent}.sm-dox ul a span.sub-arrow:active,.sm-dox ul a span.sub-arrow:focus,.sm-dox ul a span.sub-arrow:hover,.sm-dox ul a:hover span.sub-arrow{border-color:transparent transparent transparent #f60}.sm-dox ul a:hover{background:#666;text-shadow:none}.sm-dox ul.sm-nowrap a{color:#4d4d4d;text-shadow:none}#main-nav,#main-menu,#main-menu a,#main-menu a:visited,#main-menu a:hover,#main-menu li,.memdoc,dl.reflist dd,div.toc li,.ah,span.lineno,span.lineno a,span.lineno a:hover,.note code,.pre code,.post code,.invariant code,.warning code,.attention code,.deprecated code,.bug code,.todo code,.test code,.doxtable code{background:none}#titlearea,.footer,.contents,div.header,.memdoc,table.doxtable td,table.doxtable th,hr,.memSeparator{border:none}#main-menu a,#main-menu a:visited,#main-menu a:hover,#main-menu li,.reflist dt a.el,.levels span,.directory .levels span{text-shadow:none}.memdoc,dl.reflist dd{box-shadow:none}div.headertitle,.note code,.pre code,.post code,.invariant code,.warning code,.attention code,.deprecated code,.bug code,.todo code,.test code,table.doxtable code{padding:0}#nav-path,.directory .levels,span.lineno{display:none}html,#titlearea,.footer,tr.even,.directory tr.even,.doxtable tr:nth-child(even),.mdescLeft,.mdescRight,.memItemLeft,.memItemRight,code{background:#f2f2f2}body{color:#4d4d4d}h1,h2,h2.groupheader,h3,div.toc h3,h4,h5,h6,strong,em{color:#1a1a1a;border-bottom:none}h1{padding-top:.5em;font-size:180%}h2{padding-top:.5em;margin-bottom:0;font-size:140%}h3{padding-top:.5em;margin-bottom:0;font-size:110%}.glfwheader{font-size:16px;height:64px;max-width:920px;min-width:800px;padding:0 32px;margin:0 auto}#glfwhome{line-height:64px;padding-right:48px;color:#666;font-size:2.5em;background:url("http://www.glfw.org/css/arrow.png") no-repeat right}.glfwnavbar{list-style-type:none;margin:0 auto;float:right}#glfwhome,.glfwnavbar li{float:left}.glfwnavbar a,.glfwnavbar a:visited{line-height:64px;margin-left:2em;display:block;color:#666}#glfwhome,.glfwnavbar a,.glfwnavbar a:visited{transition:.35s ease}#titlearea,.footer{color:#666}address.footer{text-align:center;padding:2em;margin-top:3em}#top{background:#666}#main-nav{max-width:960px;min-width:800px;margin:0 auto;font-size:13px}#main-menu{max-width:920px;min-width:800px;margin:0 auto;font-size:13px}.memtitle{display:none}.memproto,.memname{font-weight:bold;text-shadow:none}#main-menu{height:36px;display:block;position:relative}#main-menu a,#main-menu a:visited,#main-menu a:hover,#main-menu li{color:#f2f2f2}#main-menu li ul.sm-nowrap li a{color:#4d4d4d}#main-menu li ul.sm-nowrap li a:hover{color:#f60}.contents{min-height:590px}div.contents,div.header{max-width:920px;margin:0 auto;padding:0 32px;background:#fff none}table.doxtable th,dl.reflist dt{background:linear-gradient(to bottom, #ffa733 0, #f60 100%);box-shadow:inset 0 0 32px #f60;text-shadow:0 -1px 1px #b34700;text-align:left;color:#fff}dl.reflist dt a.el{color:#f60;padding:.2em;border-radius:4px;background-color:#ffe0cc}div.toc{float:none;width:auto}div.toc h3{font-size:1.17em}div.toc ul{padding-left:1.5em}div.toc li{font-size:1em;padding-left:0;list-style-type:disc}div.toc,.memproto,div.qindex,div.ah{background:linear-gradient(to bottom, #f2f2f2 0, #e6e6e6 100%);box-shadow:inset 0 0 32px #e6e6e6;text-shadow:0 1px 1px #fff;color:#1a1a1a;border:2px solid #e6e6e6;border-radius:4px}.paramname{color:#803300}dl.reflist dt{border:2px solid #f60;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom:none}dl.reflist dd{border:2px solid #f60;border-bottom-right-radius:4px;border-bottom-left-radius:4px;border-top:none}table.doxtable{border-collapse:inherit;border-spacing:0;border:2px solid #f60;border-radius:4px}a,a:hover,a:visited,a:visited:hover,.contents a:visited,.el,a.el:visited,#glfwhome:hover,#main-menu a:hover,span.lineno a:hover{color:#f60;text-decoration:none}div.directory{border-collapse:inherit;border-spacing:0;border:2px solid #f60;border-radius:4px}hr,.memSeparator{height:2px;background:linear-gradient(to right, #f2f2f2 0, #d9d9d9 50%, #f2f2f2 100%)}dl.note,dl.pre,dl.post,dl.invariant{background:linear-gradient(to bottom, #ddfad1 0, #cbf7ba 100%);box-shadow:inset 0 0 32px #baf5a3;color:#1e5309;border:2px solid #afe599}dl.warning,dl.attention{background:linear-gradient(to bottom, #fae8d1 0, #f7ddba 100%);box-shadow:inset 0 0 32px #f5d1a3;color:#533309;border:2px solid #e5c499}dl.deprecated,dl.bug{background:linear-gradient(to bottom, #fad1e3 0, #f7bad6 100%);box-shadow:inset 0 0 32px #f5a3c8;color:#53092a;border:2px solid #e599bb}dl.todo,dl.test{background:linear-gradient(to bottom, #d1ecfa 0, #bae3f7 100%);box-shadow:inset 0 0 32px #a3daf5;color:#093a53;border:2px solid #99cce5}dl.note,dl.pre,dl.post,dl.invariant,dl.warning,dl.attention,dl.deprecated,dl.bug,dl.todo,dl.test{border-radius:4px;padding:1em;text-shadow:0 1px 1px #fff;margin:1em 0}.note a,.pre a,.post a,.invariant a,.warning a,.attention a,.deprecated a,.bug a,.todo a,.test a,.note a:visited,.pre a:visited,.post a:visited,.invariant a:visited,.warning a:visited,.attention a:visited,.deprecated a:visited,.bug a:visited,.todo a:visited,.test a:visited{color:inherit}div.line{line-height:inherit}div.fragment,pre.fragment{background:#f2f2f2;border-radius:4px;border:none;padding:1em;overflow:auto;border-left:4px solid #ccc;margin:1em 0}.lineno a,.lineno a:visited,.line,pre.fragment{color:#4d4d4d}span.preprocessor,span.comment{color:#007899}a.code,a.code:visited{color:#e64500}span.keyword,span.keywordtype,span.keywordflow{color:#404040;font-weight:bold}span.stringliteral{color:#360099}code{padding:.1em;border-radius:4px}
+.sm-dox,.sm-dox a,.sm-dox a:focus,.sm-dox a:active,.sm-dox a:hover,.sm-dox a.highlighted,.sm-dox ul a:hover{background:none;text-shadow:none}.sm-dox a span.sub-arrow{border-color:#f2f2f2 transparent transparent transparent}.sm-dox a span.sub-arrow:active,.sm-dox a span.sub-arrow:focus,.sm-dox a span.sub-arrow:hover,.sm-dox a:hover span.sub-arrow{border-color:#f60 transparent transparent transparent}.sm-dox ul a span.sub-arrow:active,.sm-dox ul a span.sub-arrow:focus,.sm-dox ul a span.sub-arrow:hover,.sm-dox ul a:hover span.sub-arrow{border-color:transparent transparent transparent #f60}.sm-dox ul a:hover{background:#666;text-shadow:none}.sm-dox ul.sm-nowrap a{color:#4d4d4d;text-shadow:none}#main-nav,#main-menu,#main-menu a,#main-menu a:visited,#main-menu a:hover,#main-menu li,.memdoc,dl.reflist dd,div.toc li,.ah,span.lineno,span.lineno a,span.lineno a:hover,.note code,.pre code,.post code,.invariant code,.warning code,.attention code,.deprecated code,.bug code,.todo code,.test code,.doxtable code,.markdownTable code{background:none}#titlearea,.footer,.contents,div.header,.memdoc,table.doxtable td,table.doxtable th,table.markdownTable td,table.markdownTable th,hr,.memSeparator{border:none}#main-menu a,#main-menu a:visited,#main-menu a:hover,#main-menu li,.reflist dt a.el,.levels span,.directory .levels span{text-shadow:none}.memdoc,dl.reflist dd{box-shadow:none}div.headertitle,.note code,.pre code,.post code,.invariant code,.warning code,.attention code,.deprecated code,.bug code,.todo code,.test code,table.doxtable code,table.markdownTable code{padding:0}#nav-path,.directory .levels,span.lineno{display:none}html,#titlearea,.footer,tr.even,.directory tr.even,.doxtable tr:nth-child(even),tr.markdownTableBody:nth-child(even),.mdescLeft,.mdescRight,.memItemLeft,.memItemRight,code,.markdownTableRowEven{background:#f2f2f2}body{color:#4d4d4d}div.title{font-size:170%;margin:1em 0 0.5em 0}h1,h2,h2.groupheader,h3,div.toc h3,h4,h5,h6,strong,em{color:#1a1a1a;border-bottom:none}h1{padding-top:0.5em;font-size:150%}h2{padding-top:0.5em;margin-bottom:0;font-size:130%}h3{padding-top:0.5em;margin-bottom:0;font-size:110%}.glfwheader{font-size:16px;min-height:64px;max-width:920px;padding:0 32px;margin:0 auto;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-start;align-items:center;align-content:stretch}#glfwhome{line-height:64px;padding-right:48px;color:#666;font-size:2.5em;background:url("https://www.glfw.org/css/arrow.png") no-repeat right}.glfwnavbar{list-style-type:none;margin:0 0 0 auto;float:right}#glfwhome,.glfwnavbar li{float:left}.glfwnavbar a,.glfwnavbar a:visited{line-height:64px;margin-left:2em;display:block;color:#666}.glfwnavbar{padding-left:0}#glfwhome,.glfwnavbar a,.glfwnavbar a:visited{transition:.35s ease}#titlearea,.footer{color:#666}address.footer{text-align:center;padding:2em;margin-top:3em}#top{background:#666}#main-nav{max-width:960px;margin:0 auto;font-size:13px}#main-menu{max-width:920px;margin:0 auto;font-size:13px}.memtitle{display:none}.memproto,.memname{font-weight:bold;text-shadow:none}#main-menu{min-height:36px;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-start;align-items:center;align-content:stretch}#main-menu a:focus{outline-style:none}#main-menu a,#main-menu a:visited,#main-menu a:hover,#main-menu li{color:#f2f2f2}#main-menu li ul.sm-nowrap li a{color:#4d4d4d}#main-menu li ul.sm-nowrap li a:hover{color:#f60}#main-menu>li:last-child{margin:0 0 0 auto}.contents{min-height:590px}div.contents,div.header{max-width:920px;margin:0 auto;padding:0 32px;background:#fff none}table.doxtable th,table.markdownTable th,dl.reflist dt{background:linear-gradient(to bottom, #ffa733 0%, #f60 100%);box-shadow:inset 0 0 32px #f60;text-shadow:0 -1px 1px #b34700;text-align:left;color:#fff}dl.reflist dt a.el{color:#f60;padding:.2em;border-radius:4px;background-color:#ffe0cc}div.toc{float:right;width:35%}@media screen and (max-width: 600px){div.toc{float:none;width:inherit;margin:0}}div.toc h3{font-size:1.17em}div.toc ul{padding-left:1.5em}div.toc li{font-size:1em;padding-left:0;list-style-type:disc}div.toc li.level2,div.toc li.level3{margin-left:0.5em}div.toc,.memproto,div.qindex,div.ah{background:linear-gradient(to bottom, #f2f2f2 0%, #e6e6e6 100%);box-shadow:inset 0 0 32px #e6e6e6;text-shadow:0 1px 1px #fff;color:#1a1a1a;border:2px solid #e6e6e6;border-radius:4px}.paramname{color:#803300}dl.reflist dt{border:2px solid #f60;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom:none}dl.reflist dd{border:2px solid #f60;border-bottom-right-radius:4px;border-bottom-left-radius:4px;border-top:none}table.doxtable,table.markdownTable{border-collapse:inherit;border-spacing:0;border:2px solid #f60;border-radius:4px}a,a:hover,a:visited,a:visited:hover,.contents a:visited,.el,a.el:visited,#glfwhome:hover,#main-menu a:hover,span.lineno a:hover{color:#f60;text-decoration:none}div.directory{border-collapse:inherit;border-spacing:0;border:2px solid #f60;border-radius:4px}hr,.memSeparator{height:2px;background:linear-gradient(to right, #f2f2f2 0%, #d9d9d9 50%, #f2f2f2 100%)}dl.note,dl.pre,dl.post,dl.invariant{background:linear-gradient(to bottom, #ddfad1 0%, #cbf7ba 100%);box-shadow:inset 0 0 32px #baf5a3;color:#1e5309;border:2px solid #afe699}dl.warning,dl.attention{background:linear-gradient(to bottom, #fae8d1 0%, #f7ddba 100%);box-shadow:inset 0 0 32px #f5d1a3;color:#533309;border:2px solid #e6c499}dl.deprecated,dl.bug{background:linear-gradient(to bottom, #fad1e3 0%, #f7bad6 100%);box-shadow:inset 0 0 32px #f5a3c8;color:#53092a;border:2px solid #e699bb}dl.todo,dl.test{background:linear-gradient(to bottom, #d1ecfa 0%, #bae3f7 100%);box-shadow:inset 0 0 32px #a3daf5;color:#093a53;border:2px solid #99cce6}dl.note,dl.pre,dl.post,dl.invariant,dl.warning,dl.attention,dl.deprecated,dl.bug,dl.todo,dl.test{border-radius:4px;padding:1em;text-shadow:0 1px 1px #fff;margin:1em 0}.note a,.pre a,.post a,.invariant a,.warning a,.attention a,.deprecated a,.bug a,.todo a,.test a,.note a:visited,.pre a:visited,.post a:visited,.invariant a:visited,.warning a:visited,.attention a:visited,.deprecated a:visited,.bug a:visited,.todo a:visited,.test a:visited{color:inherit}div.line{line-height:inherit}div.fragment,pre.fragment{background:#f2f2f2;border-radius:4px;border:none;padding:1em;overflow:auto;border-left:4px solid #ccc;margin:1em 0}.lineno a,.lineno a:visited,.line,pre.fragment{color:#4d4d4d}span.preprocessor,span.comment{color:#007899}a.code,a.code:visited{color:#e64500}span.keyword,span.keywordtype,span.keywordflow{color:#404040;font-weight:bold}span.stringliteral{color:#360099}code{padding:.1em;border-radius:4px}
+/*# sourceMappingURL=extra.css.map */
diff --git a/external/GLFW/docs/extra.css.map b/external/GLFW/docs/extra.css.map
new file mode 100644
index 0000000..d9a5d7d
--- /dev/null
+++ b/external/GLFW/docs/extra.css.map
@@ -0,0 +1,7 @@
+{
+"version": 3,
+"mappings": "AA8EA,2GAA4G,CAC3G,UAAU,CAAC,IAAI,CACf,WAAW,CAAC,IAAI,CAGjB,wBAAyB,CACxB,YAAY,CAAC,2CAAsD,CAGpE,4HAA6H,CAC5H,YAAY,CAAC,wCAAuD,CAGrE,wIAAyI,CACxI,YAAY,CAAC,wCAAuD,CAGrE,kBAAmB,CAClB,UAAU,CA9EgB,IAAa,CA+EvC,WAAW,CAAC,IAAI,CAGjB,sBAAuB,CACtB,KAAK,CAzFe,OAAa,CA0FjC,WAAW,CAAC,IAAI,CAGjB,4UAA6U,CAC5U,UAAU,CAAC,IAAI,CAGhB,kJAAmJ,CAClJ,MAAM,CAAC,IAAI,CAGZ,wHAAyH,CACxH,WAAW,CAAC,IAAI,CAGjB,qBAAsB,CACrB,UAAU,CAAC,IAAI,CAGhB,2LAA4L,CAC3L,OAAO,CAAC,CAAC,CAGV,wCAAyC,CACxC,OAAO,CAAC,IAAI,CAGb,iMAAkM,CACjM,UAAU,CApGW,OAA+B,CAuGrD,IAAK,CACJ,KAAK,CA1He,OAAa,CA6HlC,SAAU,CACN,SAAS,CAAE,IAAI,CACf,MAAM,CAAE,aAAa,CAGzB,qDAAsD,CACrD,KAAK,CApHU,OAAa,CAqH5B,aAAa,CAAC,IAAI,CAGnB,EAAG,CACF,WAAW,CAAC,KAAK,CACjB,SAAS,CAAC,IAAI,CAGf,EAAG,CACF,WAAW,CAAC,KAAK,CACjB,aAAa,CAAC,CAAC,CACf,SAAS,CAAC,IAAI,CAGf,EAAG,CACF,WAAW,CAAC,KAAK,CACjB,aAAa,CAAC,CAAC,CACf,SAAS,CAAC,IAAI,CAGf,WAAY,CACX,SAAS,CAAC,IAAI,CACd,UAAU,CAAC,IAAI,CACf,SAAS,CAAC,KAAK,CACf,OAAO,CAAC,MAAM,CACd,MAAM,CAAC,MAAM,CAEb,OAAO,CAAE,IAAI,CACb,cAAc,CAAE,GAAG,CACnB,SAAS,CAAE,IAAI,CACf,eAAe,CAAE,UAAU,CAC3B,WAAW,CAAE,MAAM,CACnB,aAAa,CAAE,OAAO,CAGvB,SAAU,CACT,WAAW,CAAC,IAAI,CAChB,aAAa,CAAC,IAAI,CAClB,KAAK,CApKqB,IAAa,CAqKvC,SAAS,CAAC,KAAK,CACf,UAAU,CAAC,yDAAyD,CAGrE,WAAY,CACX,eAAe,CAAC,IAAI,CACpB,MAAM,CAAC,UAAU,CACjB,KAAK,CAAC,KAAK,CAGZ,wBAAyB,CACxB,KAAK,CAAC,IAAI,CAGX,mCAAoC,CACnC,WAAW,CAAC,IAAI,CAChB,WAAW,CAAC,GAAG,CACf,OAAO,CAAC,KAAK,CACb,KAAK,CAvLqB,IAAa,CA0LxC,WAAY,CACX,YAAY,CAAE,CAAC,CAGhB,6CAA8C,CAC7C,UAAU,CAAC,SAAS,CAGrB,kBAAmB,CAClB,KAAK,CAnMqB,IAAa,CAsMxC,cAAe,CACd,UAAU,CAAC,MAAM,CACjB,OAAO,CAAC,GAAG,CACX,UAAU,CAAC,GAAG,CAGf,IAAK,CACJ,UAAU,CA7MgB,IAAa,CAgNxC,SAAU,CACT,SAAS,CAAC,KAAK,CACf,MAAM,CAAC,MAAM,CACb,SAAS,CAAC,IAAI,CAGf,UAAW,CACV,SAAS,CAAC,KAAK,CACf,MAAM,CAAC,MAAM,CACb,SAAS,CAAC,IAAI,CAGf,SAAU,CACT,OAAO,CAAC,IAAI,CAGb,kBAAmB,CAClB,WAAW,CAAC,IAAI,CAChB,WAAW,CAAC,IAAI,CAGjB,UAAW,CACV,UAAU,CAAC,IAAI,CACf,OAAO,CAAE,IAAI,CACb,cAAc,CAAE,GAAG,CACnB,SAAS,CAAE,IAAI,CACf,eAAe,CAAE,UAAU,CAC3B,WAAW,CAAE,MAAM,CACnB,aAAa,CAAE,OAAO,CAGvB,kBAAmB,CACf,aAAa,CAAE,IAAI,CAGvB,kEAAmE,CAClE,KAAK,CAxOgB,OAA+B,CA2OrD,+BAAgC,CAC/B,KAAK,CA9Pe,OAAa,CAiQlC,qCAAsC,CACrC,KAAK,CA9NoB,IAAsB,CAiOhD,wBAA2B,CAC1B,MAAM,CAAE,UAAU,CAGnB,SAAU,CACT,UAAU,CAAC,KAAK,CAGjB,uBAAwB,CACvB,SAAS,CAAC,KAAK,CACf,MAAM,CAAC,MAAM,CACb,OAAO,CAAC,MAAM,CACd,UAAU,CAAC,SAA8B,CAG1C,sDAAuD,CACtD,UAAU,CAAC,iDAAoF,CAC/F,UAAU,CAAC,mBAAuC,CAClD,WAAW,CAAC,kBAAgD,CAC5D,UAAU,CAAC,IAAI,CACf,KAAK,CAtPa,IAAe,CAyPlC,kBAAmB,CAClB,KAAK,CAzPoB,IAAsB,CA0P/C,OAAO,CAAC,IAAI,CACZ,aAAa,CAAC,GAAG,CACjB,gBAAgB,CAAC,OAAiC,CAGnD,OAAQ,CACP,KAAK,CAAC,KAAK,CACX,KAAK,CAAC,GAAG,CAGV,oCAAoC,CACnC,OAAQ,CACP,KAAK,CAAC,IAAI,CACV,KAAK,CAAC,OAAO,CACb,MAAM,CAAC,CAAC,EAIV,UAAW,CACV,SAAS,CAAC,MAAM,CAGjB,UAAW,CACV,YAAY,CAAC,KAAK,CAGnB,UAAW,CACV,SAAS,CAAC,GAAG,CACb,YAAY,CAAC,CAAC,CACd,eAAe,CAAC,IAAI,CAIjB,mCAAqB,CACjB,WAAW,CAAC,KAAK,CAIzB,mCAAoC,CACnC,UAAU,CAAC,oDAAgF,CAC3F,UAAU,CAAC,sBAAqC,CAChD,WAAW,CAAC,cAA8C,CAC1D,KAAK,CAzTU,OAAa,CA0T5B,MAAM,CAAC,iBAAgC,CACvC,aAAa,CAAC,GAAG,CAGlB,UAAW,CACV,KAAK,CAlSkB,OAAgC,CAqSxD,aAAc,CACb,MAAM,CAAC,cAA+B,CACtC,sBAAsB,CAAC,GAAG,CAC1B,uBAAuB,CAAC,GAAG,CAC3B,aAAa,CAAC,IAAI,CAGnB,aAAc,CACb,MAAM,CAAC,cAA+B,CACtC,0BAA0B,CAAC,GAAG,CAC9B,yBAAyB,CAAC,GAAG,CAC7B,UAAU,CAAC,IAAI,CAGhB,kCAAmC,CAClC,eAAe,CAAC,OAAO,CACvB,cAAc,CAAC,CAAC,CAChB,MAAM,CAAC,cAA+B,CACtC,aAAa,CAAC,GAAG,CAGlB,+HAAgI,CAC/H,KAAK,CAnUoB,IAAsB,CAoU/C,eAAe,CAAC,IAAI,CAGrB,aAAc,CACb,eAAe,CAAC,OAAO,CACvB,cAAc,CAAC,CAAC,CAChB,MAAM,CAAC,cAA+B,CACtC,aAAa,CAAC,GAAG,CAGlB,gBAAiB,CAChB,MAAM,CAAC,GAAG,CACV,UAAU,CAAC,gEAAiH,CAG7H,mCAAoC,CA3TnC,UAAU,CAAC,oDAAuE,CAClF,UAAU,CAAC,sBAAsC,CACjD,KAAK,CAAC,OAAwB,CAC9B,MAAM,CAAC,iBAAmD,CA4T3D,uBAAwB,CA/TvB,UAAU,CAAC,oDAAuE,CAClF,UAAU,CAAC,sBAAsC,CACjD,KAAK,CAAC,OAAwB,CAC9B,MAAM,CAAC,iBAAmD,CAgU3D,oBAAqB,CAnUpB,UAAU,CAAC,oDAAuE,CAClF,UAAU,CAAC,sBAAsC,CACjD,KAAK,CAAC,OAAwB,CAC9B,MAAM,CAAC,iBAAmD,CAoU3D,eAAgB,CAvUf,UAAU,CAAC,oDAAuE,CAClF,UAAU,CAAC,sBAAsC,CACjD,KAAK,CAAC,OAAwB,CAC9B,MAAM,CAAC,iBAAmD,CAwU3D,gGAAiG,CAChG,aAAa,CAAC,GAAG,CACjB,OAAO,CAAC,GAAG,CACX,WAAW,CAAC,cAAwB,CACpC,MAAM,CAAC,KAAK,CAGb,iRAAkR,CACjR,KAAK,CAAC,OAAO,CAGd,QAAS,CACR,WAAW,CAAC,OAAO,CAGpB,yBAA0B,CACzB,UAAU,CAAC,OAAa,CACxB,aAAa,CAAC,GAAG,CACjB,MAAM,CAAC,IAAI,CACX,OAAO,CAAC,GAAG,CACX,QAAQ,CAAC,IAAI,CACb,WAAW,CAAC,cAAuB,CACnC,MAAM,CAAC,KAAK,CAGb,8CAA+C,CAC9C,KAAK,CAjae,OAAa,CAoalC,8BAA+B,CAC9B,KAAK,CAAC,OAAiB,CAGxB,qBAAsB,CACrB,KAAK,CAAC,OAAgB,CAGvB,8CAA+C,CAC9C,KAAK,CAAC,OAA+B,CACrC,WAAW,CAAC,IAAI,CAGjB,kBAAmB,CAClB,KAAK,CAAC,OAAiB,CAGxB,IAAK,CACJ,OAAO,CAAC,IAAI,CACZ,aAAa,CAAC,GAAG",
+"sources": ["extra.scss"],
+"names": [],
+"file": "extra.css"
+}
diff --git a/external/GLFW/docs/extra.scss b/external/GLFW/docs/extra.scss
new file mode 100644
index 0000000..acf28e2
--- /dev/null
+++ b/external/GLFW/docs/extra.scss
@@ -0,0 +1,453 @@
+// NOTE: Please use this file to perform modifications on default style sheets.
+//
+// You need to install the official Sass CLI tool:
+// npm install -g sass
+//
+// Run this command to regenerate extra.css after you're finished with changes:
+// sass --style=compressed extra.scss extra.css
+//
+// Alternatively you can use online services to regenerate extra.css.
+
+
+// Default text color for page contents
+$default-text-color: hsl(0,0%,30%);
+
+// Page header, footer, table rows, inline codes and definition lists
+$header-footer-background-color: hsl(0,0%,95%);
+
+// Page header, footer links and navigation bar background
+$header-footer-link-color: hsl(0,0%,40%);
+
+// Doxygen navigation bar links
+$navbar-link-color: $header-footer-background-color;
+
+// Page content background color
+$content-background-color: hsl(0,0%,100%);
+
+// Bold, italic, h1, h2, ... and table of contents
+$heading-color: hsl(0,0%,10%);
+
+// Function, enum and macro definition separator
+$def-separator-color: $header-footer-background-color;
+
+// Base color hue
+$base-hue: 24;
+
+// Default color used for links
+$default-link-color: hsl($base-hue,100%,50%);
+
+// Doxygen navigation bar active tab
+$tab-text-color: hsl(0,0%,100%);
+$tab-background-color1: $default-link-color;
+$tab-background-color2: lighten(adjust-hue($tab-background-color1, 10), 10%);
+
+// Table borders
+$default-border-color: $default-link-color;
+
+// Table header
+$table-text-color: $tab-text-color;
+$table-background-color1: $tab-background-color1;
+$table-background-color2: $tab-background-color2;
+
+// Table of contents, data structure index and prototypes
+$toc-background-color1: hsl(0,0%,90%);
+$toc-background-color2: lighten($toc-background-color1, 5%);
+
+// Function prototype parameters color
+$prototype-param-color: darken($default-link-color, 25%);
+
+// Message box color: note, pre, post and invariant
+$box-note-color: hsl(103,80%,85%);
+
+// Message box color: warning and attention
+$box-warning-color: hsl(34,80%,85%);
+
+// Message box color: deprecated and bug
+$box-bug-color: hsl(333,80%,85%);
+
+// Message box color: todo and test
+$box-todo-color: hsl(200,80%,85%);
+
+// Message box helper function
+@mixin message-box($base-color){
+ background:linear-gradient(to bottom,lighten($base-color, 5%) 0%,$base-color 100%);
+ box-shadow:inset 0 0 32px darken($base-color, 5%);
+ color:darken($base-color, 67%);
+ border:2px solid desaturate(darken($base-color, 10%), 20%);
+}
+
+.sm-dox,.sm-dox a,.sm-dox a:focus,.sm-dox a:active,.sm-dox a:hover,.sm-dox a.highlighted,.sm-dox ul a:hover {
+ background:none;
+ text-shadow:none;
+}
+
+.sm-dox a span.sub-arrow {
+ border-color:$navbar-link-color transparent transparent transparent;
+}
+
+.sm-dox a span.sub-arrow:active,.sm-dox a span.sub-arrow:focus,.sm-dox a span.sub-arrow:hover,.sm-dox a:hover span.sub-arrow {
+ border-color:$default-link-color transparent transparent transparent;
+}
+
+.sm-dox ul a span.sub-arrow:active,.sm-dox ul a span.sub-arrow:focus,.sm-dox ul a span.sub-arrow:hover,.sm-dox ul a:hover span.sub-arrow {
+ border-color:transparent transparent transparent $default-link-color;
+}
+
+.sm-dox ul a:hover {
+ background:$header-footer-link-color;
+ text-shadow:none;
+}
+
+.sm-dox ul.sm-nowrap a {
+ color:$default-text-color;
+ text-shadow:none;
+}
+
+#main-nav,#main-menu,#main-menu a,#main-menu a:visited,#main-menu a:hover,#main-menu li,.memdoc,dl.reflist dd,div.toc li,.ah,span.lineno,span.lineno a,span.lineno a:hover,.note code,.pre code,.post code,.invariant code,.warning code,.attention code,.deprecated code,.bug code,.todo code,.test code,.doxtable code,.markdownTable code {
+ background:none;
+}
+
+#titlearea,.footer,.contents,div.header,.memdoc,table.doxtable td,table.doxtable th,table.markdownTable td,table.markdownTable th,hr,.memSeparator {
+ border:none;
+}
+
+#main-menu a,#main-menu a:visited,#main-menu a:hover,#main-menu li,.reflist dt a.el,.levels span,.directory .levels span {
+ text-shadow:none;
+}
+
+.memdoc,dl.reflist dd {
+ box-shadow:none;
+}
+
+div.headertitle,.note code,.pre code,.post code,.invariant code,.warning code,.attention code,.deprecated code,.bug code,.todo code,.test code,table.doxtable code,table.markdownTable code {
+ padding:0;
+}
+
+#nav-path,.directory .levels,span.lineno {
+ display:none;
+}
+
+html,#titlearea,.footer,tr.even,.directory tr.even,.doxtable tr:nth-child(even),tr.markdownTableBody:nth-child(even),.mdescLeft,.mdescRight,.memItemLeft,.memItemRight,code,.markdownTableRowEven {
+ background:$header-footer-background-color;
+}
+
+body {
+ color:$default-text-color;
+}
+
+div.title {
+ font-size: 170%;
+ margin: 1em 0 0.5em 0;
+}
+
+h1,h2,h2.groupheader,h3,div.toc h3,h4,h5,h6,strong,em {
+ color:$heading-color;
+ border-bottom:none;
+}
+
+h1 {
+ padding-top:0.5em;
+ font-size:150%;
+}
+
+h2 {
+ padding-top:0.5em;
+ margin-bottom:0;
+ font-size:130%;
+}
+
+h3 {
+ padding-top:0.5em;
+ margin-bottom:0;
+ font-size:110%;
+}
+
+.glfwheader {
+ font-size:16px;
+ min-height:64px;
+ max-width:920px;
+ padding:0 32px;
+ margin:0 auto;
+
+ display: flex;
+ flex-direction: row;
+ flex-wrap: wrap;
+ justify-content: flex-start;
+ align-items: center;
+ align-content: stretch;
+}
+
+#glfwhome {
+ line-height:64px;
+ padding-right:48px;
+ color:$header-footer-link-color;
+ font-size:2.5em;
+ background:url("https://www.glfw.org/css/arrow.png") no-repeat right;
+}
+
+.glfwnavbar {
+ list-style-type:none;
+ margin:0 0 0 auto;
+ float:right;
+}
+
+#glfwhome,.glfwnavbar li {
+ float:left;
+}
+
+.glfwnavbar a,.glfwnavbar a:visited {
+ line-height:64px;
+ margin-left:2em;
+ display:block;
+ color:$header-footer-link-color;
+}
+
+.glfwnavbar {
+ padding-left: 0;
+}
+
+#glfwhome,.glfwnavbar a,.glfwnavbar a:visited {
+ transition:.35s ease;
+}
+
+#titlearea,.footer {
+ color:$header-footer-link-color;
+}
+
+address.footer {
+ text-align:center;
+ padding:2em;
+ margin-top:3em;
+}
+
+#top {
+ background:$header-footer-link-color;
+}
+
+#main-nav {
+ max-width:960px;
+ margin:0 auto;
+ font-size:13px;
+}
+
+#main-menu {
+ max-width:920px;
+ margin:0 auto;
+ font-size:13px;
+}
+
+.memtitle {
+ display:none;
+}
+
+.memproto,.memname {
+ font-weight:bold;
+ text-shadow:none;
+}
+
+#main-menu {
+ min-height:36px;
+ display: flex;
+ flex-direction: row;
+ flex-wrap: wrap;
+ justify-content: flex-start;
+ align-items: center;
+ align-content: stretch;
+}
+
+#main-menu a:focus {
+ outline-style: none;
+}
+
+#main-menu a,#main-menu a:visited,#main-menu a:hover,#main-menu li {
+ color:$navbar-link-color;
+}
+
+#main-menu li ul.sm-nowrap li a {
+ color:$default-text-color;
+}
+
+#main-menu li ul.sm-nowrap li a:hover {
+ color:$default-link-color;
+}
+
+#main-menu > li:last-child {
+ margin: 0 0 0 auto;
+}
+
+.contents {
+ min-height:590px;
+}
+
+div.contents,div.header {
+ max-width:920px;
+ margin:0 auto;
+ padding:0 32px;
+ background:$content-background-color none;
+}
+
+table.doxtable th,table.markdownTable th,dl.reflist dt {
+ background:linear-gradient(to bottom,$table-background-color2 0%,$table-background-color1 100%);
+ box-shadow:inset 0 0 32px $table-background-color1;
+ text-shadow:0 -1px 1px darken($table-background-color1, 15%);
+ text-align:left;
+ color:$table-text-color;
+}
+
+dl.reflist dt a.el {
+ color:$default-link-color;
+ padding:.2em;
+ border-radius:4px;
+ background-color:lighten($default-link-color, 40%);
+}
+
+div.toc {
+ float:right;
+ width:35%;
+}
+
+@media screen and (max-width:600px) {
+ div.toc {
+ float:none;
+ width:inherit;
+ margin:0;
+ }
+}
+
+div.toc h3 {
+ font-size:1.17em;
+}
+
+div.toc ul {
+ padding-left:1.5em;
+}
+
+div.toc li {
+ font-size:1em;
+ padding-left:0;
+ list-style-type:disc;
+}
+
+div.toc {
+ li.level2, li.level3 {
+ margin-left:0.5em;
+ }
+}
+
+div.toc,.memproto,div.qindex,div.ah {
+ background:linear-gradient(to bottom,$toc-background-color2 0%,$toc-background-color1 100%);
+ box-shadow:inset 0 0 32px $toc-background-color1;
+ text-shadow:0 1px 1px lighten($toc-background-color2, 10%);
+ color:$heading-color;
+ border:2px solid $toc-background-color1;
+ border-radius:4px;
+}
+
+.paramname {
+ color:$prototype-param-color;
+}
+
+dl.reflist dt {
+ border:2px solid $default-border-color;
+ border-top-left-radius:4px;
+ border-top-right-radius:4px;
+ border-bottom:none;
+}
+
+dl.reflist dd {
+ border:2px solid $default-border-color;
+ border-bottom-right-radius:4px;
+ border-bottom-left-radius:4px;
+ border-top:none;
+}
+
+table.doxtable,table.markdownTable {
+ border-collapse:inherit;
+ border-spacing:0;
+ border:2px solid $default-border-color;
+ border-radius:4px;
+}
+
+a,a:hover,a:visited,a:visited:hover,.contents a:visited,.el,a.el:visited,#glfwhome:hover,#main-menu a:hover,span.lineno a:hover {
+ color:$default-link-color;
+ text-decoration:none;
+}
+
+div.directory {
+ border-collapse:inherit;
+ border-spacing:0;
+ border:2px solid $default-border-color;
+ border-radius:4px;
+}
+
+hr,.memSeparator {
+ height:2px;
+ background:linear-gradient(to right,$def-separator-color 0%,darken($def-separator-color, 10%) 50%,$def-separator-color 100%);
+}
+
+dl.note,dl.pre,dl.post,dl.invariant {
+ @include message-box($box-note-color);
+}
+
+dl.warning,dl.attention {
+ @include message-box($box-warning-color);
+}
+
+dl.deprecated,dl.bug {
+ @include message-box($box-bug-color);
+}
+
+dl.todo,dl.test {
+ @include message-box($box-todo-color);
+}
+
+dl.note,dl.pre,dl.post,dl.invariant,dl.warning,dl.attention,dl.deprecated,dl.bug,dl.todo,dl.test {
+ border-radius:4px;
+ padding:1em;
+ text-shadow:0 1px 1px hsl(0,0%,100%);
+ margin:1em 0;
+}
+
+.note a,.pre a,.post a,.invariant a,.warning a,.attention a,.deprecated a,.bug a,.todo a,.test a,.note a:visited,.pre a:visited,.post a:visited,.invariant a:visited,.warning a:visited,.attention a:visited,.deprecated a:visited,.bug a:visited,.todo a:visited,.test a:visited {
+ color:inherit;
+}
+
+div.line {
+ line-height:inherit;
+}
+
+div.fragment,pre.fragment {
+ background:hsl(0,0%,95%);
+ border-radius:4px;
+ border:none;
+ padding:1em;
+ overflow:auto;
+ border-left:4px solid hsl(0,0%,80%);
+ margin:1em 0;
+}
+
+.lineno a,.lineno a:visited,.line,pre.fragment {
+ color:$default-text-color;
+}
+
+span.preprocessor,span.comment {
+ color:hsl(193,100%,30%);
+}
+
+a.code,a.code:visited {
+ color:hsl(18,100%,45%);
+}
+
+span.keyword,span.keywordtype,span.keywordflow {
+ color:darken($default-text-color, 5%);
+ font-weight:bold;
+}
+
+span.stringliteral {
+ color:hsl(261,100%,30%);
+}
+
+code {
+ padding:.1em;
+ border-radius:4px;
+}
diff --git a/external/GLFW/docs/header.html b/external/GLFW/docs/header.html
index 16b09a7..4cefa3d 100644
--- a/external/GLFW/docs/header.html
+++ b/external/GLFW/docs/header.html
@@ -1,7 +1,8 @@
-
-
+
+
+
$projectname: $title
@@ -21,11 +22,11 @@
diff --git a/external/GLFW/docs/input.md b/external/GLFW/docs/input.md
new file mode 100644
index 0000000..3ef1aeb
--- /dev/null
+++ b/external/GLFW/docs/input.md
@@ -0,0 +1,1000 @@
+# Input guide {#input_guide}
+
+[TOC]
+
+This guide introduces the input related functions of GLFW. For details on
+a specific function in this category, see the @ref input. There are also guides
+for the other areas of GLFW.
+
+ - @ref intro_guide
+ - @ref window_guide
+ - @ref context_guide
+ - @ref vulkan_guide
+ - @ref monitor_guide
+
+GLFW provides many kinds of input. While some can only be polled, like time, or
+only received via callbacks, like scrolling, many provide both callbacks and
+polling. Callbacks are more work to use than polling but is less CPU intensive
+and guarantees that you do not miss state changes.
+
+All input callbacks receive a window handle. By using the
+[window user pointer](@ref window_userptr), you can access non-global structures
+or objects from your callbacks.
+
+To get a better feel for how the various events callbacks behave, run the
+`events` test program. It registers every callback supported by GLFW and prints
+out all arguments provided for every event, along with time and sequence
+information.
+
+
+## Event processing {#events}
+
+GLFW needs to poll the window system for events both to provide input to the
+application and to prove to the window system that the application hasn't locked
+up. Event processing is normally done each frame after
+[buffer swapping](@ref buffer_swap). Even when you have no windows, event
+polling needs to be done in order to receive monitor and joystick connection
+events.
+
+There are three functions for processing pending events. @ref glfwPollEvents,
+processes only those events that have already been received and then returns
+immediately.
+
+```c
+glfwPollEvents();
+```
+
+This is the best choice when rendering continuously, like most games do.
+
+If you only need to update the contents of the window when you receive new
+input, @ref glfwWaitEvents is a better choice.
+
+```c
+glfwWaitEvents();
+```
+
+It puts the thread to sleep until at least one event has been received and then
+processes all received events. This saves a great deal of CPU cycles and is
+useful for, for example, editing tools.
+
+If you want to wait for events but have UI elements or other tasks that need
+periodic updates, @ref glfwWaitEventsTimeout lets you specify a timeout.
+
+```c
+glfwWaitEventsTimeout(0.7);
+```
+
+It puts the thread to sleep until at least one event has been received, or until
+the specified number of seconds have elapsed. It then processes any received
+events.
+
+If the main thread is sleeping in @ref glfwWaitEvents, you can wake it from
+another thread by posting an empty event to the event queue with @ref
+glfwPostEmptyEvent.
+
+```c
+glfwPostEmptyEvent();
+```
+
+Do not assume that callbacks will _only_ be called in response to the above
+functions. While it is necessary to process events in one or more of the ways
+above, window systems that require GLFW to register callbacks of its own can
+pass events to GLFW in response to many window system function calls. GLFW will
+pass those events on to the application callbacks before returning.
+
+For example, on Windows the system function that @ref glfwSetWindowSize is
+implemented with will send window size events directly to the event callback
+that every window has and that GLFW implements for its windows. If you have set
+a [window size callback](@ref window_size) GLFW will call it in turn with the
+new size before everything returns back out of the @ref glfwSetWindowSize call.
+
+
+## Keyboard input {#input_keyboard}
+
+GLFW divides keyboard input into two categories; key events and character
+events. Key events relate to actual physical keyboard keys, whereas character
+events relate to the text that is generated by pressing some of them.
+
+Keys and characters do not map 1:1. A single key press may produce several
+characters, and a single character may require several keys to produce. This
+may not be the case on your machine, but your users are likely not all using the
+same keyboard layout, input method or even operating system as you.
+
+
+### Key input {#input_key}
+
+If you wish to be notified when a physical key is pressed or released or when it
+repeats, set a key callback.
+
+```c
+glfwSetKeyCallback(window, key_callback);
+```
+
+The callback function receives the [keyboard key](@ref keys), platform-specific
+scancode, key action and [modifier bits](@ref mods).
+
+```c
+void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
+{
+ if (key == GLFW_KEY_E && action == GLFW_PRESS)
+ activate_airship();
+}
+```
+
+The action is one of `GLFW_PRESS`, `GLFW_REPEAT` or `GLFW_RELEASE`. Events with
+`GLFW_PRESS` and `GLFW_RELEASE` actions are emitted for every key press. Most
+keys will also emit events with `GLFW_REPEAT` actions while a key is held down.
+
+Note that many keyboards have a limit on how many keys being simultaneous held
+down that they can detect. This limit is called
+[key rollover](https://en.wikipedia.org/wiki/Key_rollover).
+
+Key events with `GLFW_REPEAT` actions are intended for text input. They are
+emitted at the rate set in the user's keyboard settings. At most one key is
+repeated even if several keys are held down. `GLFW_REPEAT` actions should not
+be relied on to know which keys are being held down or to drive animation.
+Instead you should either save the state of relevant keys based on `GLFW_PRESS`
+and `GLFW_RELEASE` actions, or call @ref glfwGetKey, which provides basic cached
+key state.
+
+The key will be one of the existing [key tokens](@ref keys), or
+`GLFW_KEY_UNKNOWN` if GLFW lacks a token for it, for example _E-mail_ and _Play_
+keys.
+
+The scancode is unique for every key, regardless of whether it has a key token.
+Scancodes are platform-specific but consistent over time, so keys will have
+different scancodes depending on the platform but they are safe to save to disk.
+You can query the scancode for any [key token](@ref keys) supported on the
+current platform with @ref glfwGetKeyScancode.
+
+```c
+const int scancode = glfwGetKeyScancode(GLFW_KEY_X);
+set_key_mapping(scancode, swap_weapons);
+```
+
+The last reported state for every physical key with a [key token](@ref keys) is
+also saved in per-window state arrays that can be polled with @ref glfwGetKey.
+
+```c
+int state = glfwGetKey(window, GLFW_KEY_E);
+if (state == GLFW_PRESS)
+{
+ activate_airship();
+}
+```
+
+The returned state is one of `GLFW_PRESS` or `GLFW_RELEASE`.
+
+This function only returns cached key event state. It does not poll the
+system for the current state of the physical key. It also does not provide any
+key repeat information.
+
+@anchor GLFW_STICKY_KEYS
+Whenever you poll state, you risk missing the state change you are looking for.
+If a pressed key is released again before you poll its state, you will have
+missed the key press. The recommended solution for this is to use a
+key callback, but there is also the `GLFW_STICKY_KEYS` input mode.
+
+```c
+glfwSetInputMode(window, GLFW_STICKY_KEYS, GLFW_TRUE);
+```
+
+When sticky keys mode is enabled, the pollable state of a key will remain
+`GLFW_PRESS` until the state of that key is polled with @ref glfwGetKey. Once
+it has been polled, if a key release event had been processed in the meantime,
+the state will reset to `GLFW_RELEASE`, otherwise it will remain `GLFW_PRESS`.
+
+@anchor GLFW_LOCK_KEY_MODS
+If you wish to know what the state of the Caps Lock and Num Lock keys was when
+input events were generated, set the `GLFW_LOCK_KEY_MODS` input mode.
+
+```c
+glfwSetInputMode(window, GLFW_LOCK_KEY_MODS, GLFW_TRUE);
+```
+
+When this input mode is enabled, any callback that receives
+[modifier bits](@ref mods) will have the @ref GLFW_MOD_CAPS_LOCK bit set if Caps
+Lock was on when the event occurred and the @ref GLFW_MOD_NUM_LOCK bit set if
+Num Lock was on.
+
+The `GLFW_KEY_LAST` constant holds the highest value of any
+[key token](@ref keys).
+
+
+### Text input {#input_char}
+
+GLFW supports text input in the form of a stream of
+[Unicode code points](https://en.wikipedia.org/wiki/Unicode), as produced by the
+operating system text input system. Unlike key input, text input is affected by
+keyboard layouts and modifier keys and supports composing characters using
+[dead keys](https://en.wikipedia.org/wiki/Dead_key). Once received, you can
+encode the code points into UTF-8 or any other encoding you prefer.
+
+Because an `unsigned int` is 32 bits long on all platforms supported by GLFW,
+you can treat the code point argument as native endian UTF-32.
+
+If you wish to offer regular text input, set a character callback.
+
+```c
+glfwSetCharCallback(window, character_callback);
+```
+
+The callback function receives Unicode code points for key events that would
+have led to regular text input and generally behaves as a standard text field on
+that platform.
+
+```c
+void character_callback(GLFWwindow* window, unsigned int codepoint)
+{
+}
+```
+
+
+### Key names {#input_key_name}
+
+If you wish to refer to keys by name, you can query the keyboard layout
+dependent name of printable keys with @ref glfwGetKeyName.
+
+```c
+const char* key_name = glfwGetKeyName(GLFW_KEY_W, 0);
+show_tutorial_hint("Press %s to move forward", key_name);
+```
+
+This function can handle both [keys and scancodes](@ref input_key). If the
+specified key is `GLFW_KEY_UNKNOWN` then the scancode is used, otherwise it is
+ignored. This matches the behavior of the key callback, meaning the callback
+arguments can always be passed unmodified to this function.
+
+
+## Mouse input {#input_mouse}
+
+Mouse input comes in many forms, including mouse motion, button presses and
+scrolling offsets. The cursor appearance can also be changed, either to
+a custom image or a standard cursor shape from the system theme.
+
+
+### Cursor position {#cursor_pos}
+
+If you wish to be notified when the cursor moves over the window, set a cursor
+position callback.
+
+```c
+glfwSetCursorPosCallback(window, cursor_position_callback);
+```
+
+The callback functions receives the cursor position, measured in screen
+coordinates but relative to the top-left corner of the window content area. On
+platforms that provide it, the full sub-pixel cursor position is passed on.
+
+```c
+static void cursor_position_callback(GLFWwindow* window, double xpos, double ypos)
+{
+}
+```
+
+The cursor position is also saved per-window and can be polled with @ref
+glfwGetCursorPos.
+
+```c
+double xpos, ypos;
+glfwGetCursorPos(window, &xpos, &ypos);
+```
+
+
+### Cursor mode {#cursor_mode}
+
+@anchor GLFW_CURSOR
+The `GLFW_CURSOR` input mode provides several cursor modes for special forms of
+mouse motion input. By default, the cursor mode is `GLFW_CURSOR_NORMAL`,
+meaning the regular arrow cursor (or another cursor set with @ref glfwSetCursor)
+is used and cursor motion is not limited.
+
+If you wish to implement mouse motion based camera controls or other input
+schemes that require unlimited mouse movement, set the cursor mode to
+`GLFW_CURSOR_DISABLED`.
+
+```c
+glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED);
+```
+
+This will hide the cursor and lock it to the specified window. GLFW will then
+take care of all the details of cursor re-centering and offset calculation and
+providing the application with a virtual cursor position. This virtual position
+is provided normally via both the cursor position callback and through polling.
+
+@note You should not implement your own version of this functionality using
+other features of GLFW. It is not supported and will not work as robustly as
+`GLFW_CURSOR_DISABLED`.
+
+If you only wish the cursor to become hidden when it is over a window but still
+want it to behave normally, set the cursor mode to `GLFW_CURSOR_HIDDEN`.
+
+```c
+glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_HIDDEN);
+```
+
+This mode puts no limit on the motion of the cursor.
+
+If you wish the cursor to be visible but confined to the content area of the
+window, set the cursor mode to `GLFW_CURSOR_CAPTURED`.
+
+```c
+glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_CAPTURED);
+```
+
+The cursor will behave normally inside the content area but will not be able to
+leave unless the window loses focus.
+
+To exit out of either of these special modes, restore the `GLFW_CURSOR_NORMAL`
+cursor mode.
+
+```c
+glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_NORMAL);
+```
+
+If the cursor was disabled, this will move it back to its last visible position.
+
+
+@anchor GLFW_RAW_MOUSE_MOTION
+### Raw mouse motion {#raw_mouse_motion}
+
+When the cursor is disabled, raw (unscaled and unaccelerated) mouse motion can
+be enabled if available.
+
+Raw mouse motion is closer to the actual motion of the mouse across a surface.
+It is not affected by the scaling and acceleration applied to the motion of the
+desktop cursor. That processing is suitable for a cursor while raw motion is
+better for controlling for example a 3D camera. Because of this, raw mouse
+motion is only provided when the cursor is disabled.
+
+Call @ref glfwRawMouseMotionSupported to check if the current machine provides
+raw motion and set the `GLFW_RAW_MOUSE_MOTION` input mode to enable it. It is
+disabled by default.
+
+```c
+if (glfwRawMouseMotionSupported())
+ glfwSetInputMode(window, GLFW_RAW_MOUSE_MOTION, GLFW_TRUE);
+```
+
+If supported, raw mouse motion can be enabled or disabled per-window and at any
+time but it will only be provided when the cursor is disabled.
+
+
+### Cursor objects {#cursor_object}
+
+GLFW supports creating both custom and system theme cursor images, encapsulated
+as @ref GLFWcursor objects. They are created with @ref glfwCreateCursor or @ref
+glfwCreateStandardCursor and destroyed with @ref glfwDestroyCursor, or @ref
+glfwTerminate, if any remain.
+
+
+#### Custom cursor creation {#cursor_custom}
+
+A custom cursor is created with @ref glfwCreateCursor, which returns a handle to
+the created cursor object. For example, this creates a 16x16 white square
+cursor with the hot-spot in the upper-left corner:
+
+```c
+unsigned char pixels[16 * 16 * 4];
+memset(pixels, 0xff, sizeof(pixels));
+
+GLFWimage image;
+image.width = 16;
+image.height = 16;
+image.pixels = pixels;
+
+GLFWcursor* cursor = glfwCreateCursor(&image, 0, 0);
+```
+
+If cursor creation fails, `NULL` will be returned, so it is necessary to check
+the return value.
+
+The image data is 32-bit, little-endian, non-premultiplied RGBA, i.e. eight bits
+per channel with the red channel first. The pixels are arranged canonically as
+sequential rows, starting from the top-left corner.
+
+
+#### Standard cursor creation {#cursor_standard}
+
+A cursor with a [standard shape](@ref shapes) from the current system cursor
+theme can be created with @ref glfwCreateStandardCursor.
+
+```c
+GLFWcursor* url_cursor = glfwCreateStandardCursor(GLFW_POINTING_HAND_CURSOR);
+```
+
+These cursor objects behave in the exact same way as those created with @ref
+glfwCreateCursor except that the system cursor theme provides the actual image.
+
+A few of these shapes are not available everywhere. If a shape is unavailable,
+`NULL` is returned. See @ref glfwCreateStandardCursor for details.
+
+
+#### Cursor destruction {#cursor_destruction}
+
+When a cursor is no longer needed, destroy it with @ref glfwDestroyCursor.
+
+```c
+glfwDestroyCursor(cursor);
+```
+
+Cursor destruction always succeeds. If the cursor is current for any window,
+that window will revert to the default cursor. This does not affect the cursor
+mode. All remaining cursors are destroyed when @ref glfwTerminate is called.
+
+
+#### Cursor setting {#cursor_set}
+
+A cursor can be set as current for a window with @ref glfwSetCursor.
+
+```c
+glfwSetCursor(window, cursor);
+```
+
+Once set, the cursor image will be used as long as the system cursor is over the
+content area of the window and the [cursor mode](@ref cursor_mode) is set
+to `GLFW_CURSOR_NORMAL`.
+
+A single cursor may be set for any number of windows.
+
+To revert to the default cursor, set the cursor of that window to `NULL`.
+
+```c
+glfwSetCursor(window, NULL);
+```
+
+When a cursor is destroyed, any window that has it set will revert to the
+default cursor. This does not affect the cursor mode.
+
+
+### Cursor enter/leave events {#cursor_enter}
+
+If you wish to be notified when the cursor enters or leaves the content area of
+a window, set a cursor enter/leave callback.
+
+```c
+glfwSetCursorEnterCallback(window, cursor_enter_callback);
+```
+
+The callback function receives the new classification of the cursor.
+
+```c
+void cursor_enter_callback(GLFWwindow* window, int entered)
+{
+ if (entered)
+ {
+ // The cursor entered the content area of the window
+ }
+ else
+ {
+ // The cursor left the content area of the window
+ }
+}
+```
+
+You can query whether the cursor is currently inside the content area of the
+window with the [GLFW_HOVERED](@ref GLFW_HOVERED_attrib) window attribute.
+
+```c
+if (glfwGetWindowAttrib(window, GLFW_HOVERED))
+{
+ highlight_interface();
+}
+```
+
+
+### Mouse button input {#input_mouse_button}
+
+If you wish to be notified when a mouse button is pressed or released, set
+a mouse button callback.
+
+```c
+glfwSetMouseButtonCallback(window, mouse_button_callback);
+```
+
+@anchor GLFW_UNLIMITED_MOUSE_BUTTONS
+To handle all mouse buttons in the callback, instead of only ones with associated
+[button tokens](@ref buttons), set the @ref GLFW_UNLIMITED_MOUSE_BUTTONS
+input mode.
+
+```c
+glfwSetInputMode(window, GLFW_UNLIMITED_MOUSE_BUTTONS, GLFW_TRUE);
+```
+
+When this input mode is enabled, GLFW doesn't limit the reported mouse buttons
+to only those that have an associated button token, for compatibility with
+earlier versions of GLFW, which never reported any buttons over
+@ref GLFW_MOUSE_BUTTON_LAST, on which users could have relied on.
+
+The callback function receives the [mouse button](@ref buttons), button action
+and [modifier bits](@ref mods).
+
+```c
+void mouse_button_callback(GLFWwindow* window, int button, int action, int mods)
+{
+ if (button == GLFW_MOUSE_BUTTON_RIGHT && action == GLFW_PRESS)
+ popup_menu();
+}
+```
+
+The mouse button is an integer that can be one of the
+[mouse button tokens](@ref buttons) or, if the
+@ref GLFW_UNLIMITED_MOUSE_BUTTONS input mode is set, any other positive value.
+
+The action is one of `GLFW_PRESS` or `GLFW_RELEASE`.
+
+The last reported state for every [mouse button token](@ref buttons) is also
+saved in per-window state arrays that can be polled with @ref
+glfwGetMouseButton. This is not effected by the @ref GLFW_UNLIMITED_MOUSE_BUTTONS
+input mode.
+
+```c
+int state = glfwGetMouseButton(window, GLFW_MOUSE_BUTTON_LEFT);
+if (state == GLFW_PRESS)
+{
+ upgrade_cow();
+}
+```
+
+The returned state is one of `GLFW_PRESS` or `GLFW_RELEASE`.
+
+This function only returns cached mouse button event state. It does not poll
+the system for the current state of the mouse button.
+
+@anchor GLFW_STICKY_MOUSE_BUTTONS
+Whenever you poll state, you risk missing the state change you are looking for.
+If a pressed mouse button is released again before you poll its state, you will have
+missed the button press. The recommended solution for this is to use a
+mouse button callback, but there is also the `GLFW_STICKY_MOUSE_BUTTONS`
+input mode.
+
+```c
+glfwSetInputMode(window, GLFW_STICKY_MOUSE_BUTTONS, GLFW_TRUE);
+```
+
+When sticky mouse buttons mode is enabled, the pollable state of a mouse button
+will remain `GLFW_PRESS` until the state of that button is polled with @ref
+glfwGetMouseButton. Once it has been polled, if a mouse button release event
+had been processed in the meantime, the state will reset to `GLFW_RELEASE`,
+otherwise it will remain `GLFW_PRESS`.
+
+The `GLFW_MOUSE_BUTTON_LAST` constant holds the highest value of any
+[mouse button token](@ref buttons).
+
+
+### Scroll input {#scrolling}
+
+If you wish to be notified when the user scrolls, whether with a mouse wheel or
+touchpad gesture, set a scroll callback.
+
+```c
+glfwSetScrollCallback(window, scroll_callback);
+```
+
+The callback function receives two-dimensional scroll offsets.
+
+```c
+void scroll_callback(GLFWwindow* window, double xoffset, double yoffset)
+{
+}
+```
+
+A normal mouse wheel, being vertical, provides offsets along the Y-axis.
+
+
+## Joystick input {#joystick}
+
+The joystick functions expose connected joysticks and controllers, with both
+referred to as joysticks. It supports up to sixteen joysticks, ranging from
+`GLFW_JOYSTICK_1`, `GLFW_JOYSTICK_2` up to and including `GLFW_JOYSTICK_16` or
+`GLFW_JOYSTICK_LAST`. You can test whether a [joystick](@ref joysticks) is
+present with @ref glfwJoystickPresent.
+
+```c
+int present = glfwJoystickPresent(GLFW_JOYSTICK_1);
+```
+
+Each joystick has zero or more axes, zero or more buttons, zero or more hats,
+a human-readable name, a user pointer and an SDL compatible GUID.
+
+Detected joysticks are added to the beginning of the array. Once a joystick is
+detected, it keeps its assigned ID until it is disconnected or the library is
+terminated, so as joysticks are connected and disconnected, there may appear
+gaps in the IDs.
+
+Joystick axis, button and hat state is updated when polled and does not require
+a window to be created or events to be processed. However, if you want joystick
+connection and disconnection events reliably delivered to the
+[joystick callback](@ref joystick_event) then you must
+[process events](@ref events).
+
+To see all the properties of all connected joysticks in real-time, run the
+`joysticks` test program.
+
+
+### Joystick axis states {#joystick_axis}
+
+The positions of all axes of a joystick are returned by @ref
+glfwGetJoystickAxes. See the reference documentation for the lifetime of the
+returned array.
+
+```c
+int count;
+const float* axes = glfwGetJoystickAxes(GLFW_JOYSTICK_5, &count);
+```
+
+Each element in the returned array is a value between -1.0 and 1.0.
+
+
+### Joystick button states {#joystick_button}
+
+The states of all buttons of a joystick are returned by @ref
+glfwGetJoystickButtons. See the reference documentation for the lifetime of the
+returned array.
+
+```c
+int count;
+const unsigned char* buttons = glfwGetJoystickButtons(GLFW_JOYSTICK_3, &count);
+```
+
+Each element in the returned array is either `GLFW_PRESS` or `GLFW_RELEASE`.
+
+For backward compatibility with earlier versions that did not have @ref
+glfwGetJoystickHats, the button array by default also includes all hats. See
+the reference documentation for @ref glfwGetJoystickButtons for details.
+
+
+### Joystick hat states {#joystick_hat}
+
+The states of all hats are returned by @ref glfwGetJoystickHats. See the
+reference documentation for the lifetime of the returned array.
+
+```c
+int count;
+const unsigned char* hats = glfwGetJoystickHats(GLFW_JOYSTICK_7, &count);
+```
+
+Each element in the returned array is one of the following:
+
+Name | Value
+---- | -----
+`GLFW_HAT_CENTERED` | 0
+`GLFW_HAT_UP` | 1
+`GLFW_HAT_RIGHT` | 2
+`GLFW_HAT_DOWN` | 4
+`GLFW_HAT_LEFT` | 8
+`GLFW_HAT_RIGHT_UP` | `GLFW_HAT_RIGHT` \| `GLFW_HAT_UP`
+`GLFW_HAT_RIGHT_DOWN` | `GLFW_HAT_RIGHT` \| `GLFW_HAT_DOWN`
+`GLFW_HAT_LEFT_UP` | `GLFW_HAT_LEFT` \| `GLFW_HAT_UP`
+`GLFW_HAT_LEFT_DOWN` | `GLFW_HAT_LEFT` \| `GLFW_HAT_DOWN`
+
+The diagonal directions are bitwise combinations of the primary (up, right, down
+and left) directions and you can test for these individually by ANDing it with
+the corresponding direction.
+
+```c
+if (hats[2] & GLFW_HAT_RIGHT)
+{
+ // State of hat 2 could be right-up, right or right-down
+}
+```
+
+For backward compatibility with earlier versions that did not have @ref
+glfwGetJoystickHats, all hats are by default also included in the button array.
+See the reference documentation for @ref glfwGetJoystickButtons for details.
+
+
+### Joystick name {#joystick_name}
+
+The human-readable, UTF-8 encoded name of a joystick is returned by @ref
+glfwGetJoystickName. See the reference documentation for the lifetime of the
+returned string.
+
+```c
+const char* name = glfwGetJoystickName(GLFW_JOYSTICK_4);
+```
+
+Joystick names are not guaranteed to be unique. Two joysticks of the same model
+and make may have the same name. Only the [joystick ID](@ref joysticks) is
+guaranteed to be unique, and only until that joystick is disconnected.
+
+
+### Joystick user pointer {#joystick_userptr}
+
+Each joystick has a user pointer that can be set with @ref
+glfwSetJoystickUserPointer and queried with @ref glfwGetJoystickUserPointer.
+This can be used for any purpose you need and will not be modified by GLFW. The
+value will be kept until the joystick is disconnected or until the library is
+terminated.
+
+The initial value of the pointer is `NULL`.
+
+
+### Joystick configuration changes {#joystick_event}
+
+If you wish to be notified when a joystick is connected or disconnected, set
+a joystick callback.
+
+```c
+glfwSetJoystickCallback(joystick_callback);
+```
+
+The callback function receives the ID of the joystick that has been connected
+and disconnected and the event that occurred.
+
+```c
+void joystick_callback(int jid, int event)
+{
+ if (event == GLFW_CONNECTED)
+ {
+ // The joystick was connected
+ }
+ else if (event == GLFW_DISCONNECTED)
+ {
+ // The joystick was disconnected
+ }
+}
+```
+
+For joystick connection and disconnection events to be delivered on all
+platforms, you need to call one of the [event processing](@ref events)
+functions. Joystick disconnection may also be detected and the callback
+called by joystick functions. The function will then return whatever it
+returns for a disconnected joystick.
+
+Only @ref glfwGetJoystickName and @ref glfwGetJoystickUserPointer will return
+useful values for a disconnected joystick and only before the monitor callback
+returns.
+
+
+### Gamepad input {#gamepad}
+
+The joystick functions provide unlabeled axes, buttons and hats, with no
+indication of where they are located on the device. Their order may also vary
+between platforms even with the same device.
+
+To solve this problem the SDL community crowdsourced the
+[SDL_GameControllerDB][] project, a database of mappings from many different
+devices to an Xbox-like gamepad.
+
+[SDL_GameControllerDB]: https://github.com/gabomdq/SDL_GameControllerDB
+
+GLFW supports this mapping format and contains a copy of the mappings
+available at the time of release. See @ref gamepad_mapping for how to update
+this at runtime. Mappings will be assigned to joysticks automatically any time
+a joystick is connected or the mappings are updated.
+
+You can check whether a joystick is both present and has a gamepad mapping with
+@ref glfwJoystickIsGamepad.
+
+```c
+if (glfwJoystickIsGamepad(GLFW_JOYSTICK_2))
+{
+ // Use as gamepad
+}
+```
+
+If you are only interested in gamepad input you can use this function instead of
+@ref glfwJoystickPresent.
+
+You can query the human-readable name provided by the gamepad mapping with @ref
+glfwGetGamepadName. This may or may not be the same as the
+[joystick name](@ref joystick_name).
+
+```c
+const char* name = glfwGetGamepadName(GLFW_JOYSTICK_7);
+```
+
+To retrieve the gamepad state of a joystick, call @ref glfwGetGamepadState.
+
+```c
+GLFWgamepadstate state;
+
+if (glfwGetGamepadState(GLFW_JOYSTICK_3, &state))
+{
+ if (state.buttons[GLFW_GAMEPAD_BUTTON_A])
+ {
+ input_jump();
+ }
+
+ input_speed(state.axes[GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER]);
+}
+```
+
+The @ref GLFWgamepadstate struct has two arrays; one for button states and one
+for axis states. The values for each button and axis are the same as for the
+@ref glfwGetJoystickButtons and @ref glfwGetJoystickAxes functions, i.e.
+`GLFW_PRESS` or `GLFW_RELEASE` for buttons and -1.0 to 1.0 inclusive for axes.
+
+The sizes of the arrays and the positions within each array are fixed.
+
+The [button indices](@ref gamepad_buttons) are `GLFW_GAMEPAD_BUTTON_A`,
+`GLFW_GAMEPAD_BUTTON_B`, `GLFW_GAMEPAD_BUTTON_X`, `GLFW_GAMEPAD_BUTTON_Y`,
+`GLFW_GAMEPAD_BUTTON_LEFT_BUMPER`, `GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER`,
+`GLFW_GAMEPAD_BUTTON_BACK`, `GLFW_GAMEPAD_BUTTON_START`,
+`GLFW_GAMEPAD_BUTTON_GUIDE`, `GLFW_GAMEPAD_BUTTON_LEFT_THUMB`,
+`GLFW_GAMEPAD_BUTTON_RIGHT_THUMB`, `GLFW_GAMEPAD_BUTTON_DPAD_UP`,
+`GLFW_GAMEPAD_BUTTON_DPAD_RIGHT`, `GLFW_GAMEPAD_BUTTON_DPAD_DOWN` and
+`GLFW_GAMEPAD_BUTTON_DPAD_LEFT`.
+
+For those who prefer, there are also the `GLFW_GAMEPAD_BUTTON_CROSS`,
+`GLFW_GAMEPAD_BUTTON_CIRCLE`, `GLFW_GAMEPAD_BUTTON_SQUARE` and
+`GLFW_GAMEPAD_BUTTON_TRIANGLE` aliases for the A, B, X and Y button indices.
+
+The [axis indices](@ref gamepad_axes) are `GLFW_GAMEPAD_AXIS_LEFT_X`,
+`GLFW_GAMEPAD_AXIS_LEFT_Y`, `GLFW_GAMEPAD_AXIS_RIGHT_X`,
+`GLFW_GAMEPAD_AXIS_RIGHT_Y`, `GLFW_GAMEPAD_AXIS_LEFT_TRIGGER` and
+`GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER`.
+
+The `GLFW_GAMEPAD_BUTTON_LAST` and `GLFW_GAMEPAD_AXIS_LAST` constants equal
+the largest available index for each array.
+
+
+### Gamepad mappings {#gamepad_mapping}
+
+GLFW contains a copy of the mappings available in [SDL_GameControllerDB][] at
+the time of release. Newer ones can be added at runtime with @ref
+glfwUpdateGamepadMappings.
+
+```c
+const char* mappings = load_file_contents("game/data/gamecontrollerdb.txt");
+
+glfwUpdateGamepadMappings(mappings);
+```
+
+This function supports everything from single lines up to and including the
+unmodified contents of the whole `gamecontrollerdb.txt` file.
+
+If you are compiling GLFW from source with CMake you can update the built-in mappings by
+building the _update_mappings_ target. This runs the `GenerateMappings.cmake` CMake
+script, which downloads `gamecontrollerdb.txt` and regenerates the `mappings.h` header
+file.
+
+Below is a description of the mapping format. Please keep in mind that __this
+description is not authoritative__. The format is defined by the SDL and
+SDL_GameControllerDB projects and their documentation and code takes precedence.
+
+Each mapping is a single line of comma-separated values describing the GUID,
+name and layout of the gamepad. Lines that do not begin with a hexadecimal
+digit are ignored.
+
+The first value is always the gamepad GUID, a 32 character long hexadecimal
+string that typically identifies its make, model, revision and the type of
+connection to the computer. When this information is not available, the GUID is
+generated using the gamepad name. GLFW uses the SDL 2.0.5+ GUID format but can
+convert from the older formats.
+
+The second value is always the human-readable name of the gamepad.
+
+All subsequent values are in the form `:` and describe the layout
+of the mapping. These fields may not all be present and may occur in any order.
+
+The button fields are `a`, `b`, `x`, `y`, `back`, `start`, `guide`, `dpup`,
+`dpright`, `dpdown`, `dpleft`, `leftshoulder`, `rightshoulder`, `leftstick` and
+`rightstick`.
+
+The axis fields are `leftx`, `lefty`, `rightx`, `righty`, `lefttrigger` and
+`righttrigger`.
+
+The value of an axis or button field can be a joystick button, a joystick axis,
+a hat bitmask or empty. Joystick buttons are specified as `bN`, for example
+`b2` for the third button. Joystick axes are specified as `aN`, for example
+`a7` for the eighth button. Joystick hat bit masks are specified as `hN.N`, for
+example `h0.8` for left on the first hat. More than one bit may be set in the
+mask.
+
+Before an axis there may be a `+` or `-` range modifier, for example `+a3` for
+the positive half of the fourth axis. This restricts input to only the positive
+or negative halves of the joystick axis. After an axis or half-axis there may
+be the `~` inversion modifier, for example `a2~` or `-a7~`. This negates the
+values of the gamepad axis.
+
+The hat bit mask match the [hat states](@ref hat_state) in the joystick
+functions.
+
+There is also the special `platform` field that specifies which platform the
+mapping is valid for. Possible values are `Windows`, `Mac OS X` and `Linux`.
+
+Below is an example of what a gamepad mapping might look like. It is the
+one built into GLFW for Xbox controllers accessed via the XInput API on Windows.
+This example has been broken into several lines to fit on the page, but real
+gamepad mappings must be a single line.
+
+```
+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,
+```
+
+@note GLFW does not yet support the output range and modifiers `+` and `-` that
+were recently added to SDL. The input modifiers `+`, `-` and `~` are supported
+and described above.
+
+
+## Time input {#time}
+
+GLFW provides high-resolution time input, in seconds, with @ref glfwGetTime.
+
+```c
+double seconds = glfwGetTime();
+```
+
+It returns the number of seconds since the library was initialized with @ref
+glfwInit. The platform-specific time sources used typically have micro- or
+nanosecond resolution.
+
+You can modify the base time with @ref glfwSetTime.
+
+```c
+glfwSetTime(4.0);
+```
+
+This sets the time to the specified time, in seconds, and it continues to count
+from there.
+
+You can also access the raw timer used to implement the functions above,
+with @ref glfwGetTimerValue.
+
+```c
+uint64_t value = glfwGetTimerValue();
+```
+
+This value is in 1 / frequency seconds. The frequency of the raw
+timer varies depending on the operating system and hardware. You can query the
+frequency, in Hz, with @ref glfwGetTimerFrequency.
+
+```c
+uint64_t frequency = glfwGetTimerFrequency();
+```
+
+
+## Clipboard input and output {#clipboard}
+
+If the system clipboard contains a UTF-8 encoded string or if it can be
+converted to one, you can retrieve it with @ref glfwGetClipboardString. See the
+reference documentation for the lifetime of the returned string.
+
+```c
+const char* text = glfwGetClipboardString(NULL);
+if (text)
+{
+ insert_text(text);
+}
+```
+
+If the clipboard is empty or if its contents could not be converted, `NULL` is
+returned.
+
+The contents of the system clipboard can be set to a UTF-8 encoded string with
+@ref glfwSetClipboardString.
+
+```c
+glfwSetClipboardString(NULL, "A string with words in it");
+```
+
+
+## Path drop input {#path_drop}
+
+If you wish to receive the paths of files and/or directories dropped on
+a window, set a file drop callback.
+
+```c
+glfwSetDropCallback(window, drop_callback);
+```
+
+The callback function receives an array of paths encoded as UTF-8.
+
+```c
+void drop_callback(GLFWwindow* window, int count, const char** paths)
+{
+ int i;
+ for (i = 0; i < count; i++)
+ handle_dropped_file(paths[i]);
+}
+```
+
+The path array and its strings are only valid until the file drop callback
+returns, as they may have been generated specifically for that event. You need
+to make a deep copy of the array if you want to keep the paths.
+
diff --git a/external/GLFW/docs/internal.md b/external/GLFW/docs/internal.md
new file mode 100644
index 0000000..b658d77
--- /dev/null
+++ b/external/GLFW/docs/internal.md
@@ -0,0 +1,120 @@
+# Internal structure {#internals_guide}
+
+[TOC]
+
+There are several interfaces inside GLFW. Each interface has its own area of
+responsibility and its own naming conventions.
+
+
+## Public interface {#internals_public}
+
+The most well-known is the public interface, described in the glfw3.h header
+file. This is implemented in source files shared by all platforms and these
+files contain no platform-specific code. This code usually ends up calling the
+platform and internal interfaces to do the actual work.
+
+The public interface uses the OpenGL naming conventions except with GLFW and
+glfw instead of GL and gl. For struct members, where OpenGL sets no precedent,
+it use headless camel case.
+
+Examples: `glfwCreateWindow`, `GLFWwindow`, `GLFW_RED_BITS`
+
+
+## Native interface {#internals_native}
+
+The [native interface](@ref native) is a small set of publicly available
+but platform-specific functions, described in the glfw3native.h header file and
+used to gain access to the underlying window, context and (on some platforms)
+display handles used by the platform interface.
+
+The function names of the native interface are similar to those of the public
+interface, but embeds the name of the interface that the returned handle is
+from.
+
+Examples: `glfwGetX11Window`, `glfwGetWGLContext`
+
+
+## Internal interface {#internals_internal}
+
+The internal interface consists of utility functions used by all other
+interfaces. It is shared code implemented in the same shared source files as
+the public and event interfaces. The internal interface is described in the
+internal.h header file.
+
+The internal interface is in charge of GLFW's global data, which it stores in
+a `_GLFWlibrary` struct named `_glfw`.
+
+The internal interface uses the same style as the public interface, except all
+global names have a leading underscore.
+
+Examples: `_glfwIsValidContextConfig`, `_GLFWwindow`, `_glfw.monitorCount`
+
+
+## Platform interface {#internals_platform}
+
+The platform interface implements all platform-specific operations as a service
+to the public interface. This includes event processing. The platform
+interface is never directly called by application code and never directly calls
+application-provided callbacks. It is also prohibited from modifying the
+platform-independent part of the internal structs. Instead, it calls the event
+interface when events interesting to GLFW are received.
+
+The platform interface mostly mirrors those parts of the public interface that needs to
+perform platform-specific operations on some or all platforms.
+
+The window system bits of the platform API is called through the `_GLFWplatform` struct of
+function pointers, to allow runtime selection of platform. This includes the window and
+context creation, input and event processing, monitor and Vulkan surface creation parts of
+GLFW. This is located in the global `_glfw` struct.
+
+Examples: `_glfw.platform.createWindow`
+
+The timer, threading and module loading bits of the platform API are plain functions with
+a `_glfwPlatform` prefix, as these things are independent of what window system is being
+used.
+
+Examples: `_glfwPlatformGetTimerValue`
+
+The platform interface also defines structs that contain platform-specific
+global and per-object state. Their names mirror those of the internal
+interface, except that an interface-specific suffix is added.
+
+Examples: `_GLFWwindowX11`, `_GLFWcontextWGL`
+
+These structs are incorporated as members into the internal interface structs
+using special macros that name them after the specific interface used. This
+prevents shared code from accidentally using these members.
+
+Examples: `window->win32.handle`, `_glfw.x11.display`
+
+
+## Event interface {#internals_event}
+
+The event interface is implemented in the same shared source files as the public
+interface and is responsible for delivering the events it receives to the
+application, either via callbacks, via window state changes or both.
+
+The function names of the event interface use a `_glfwInput` prefix and the
+ObjectEvent pattern.
+
+Examples: `_glfwInputWindowFocus`, `_glfwInputCursorPos`
+
+
+## Static functions {#internals_static}
+
+Static functions may be used by any interface and have no prefixes or suffixes.
+These use headless camel case.
+
+Examples: `isValidElementForJoystick`
+
+
+## Configuration macros {#internals_config}
+
+GLFW uses a number of configuration macros to select at compile time which
+interfaces and code paths to use. They are defined in the GLFW CMake target.
+
+Configuration macros the same style as tokens in the public interface, except
+with a leading underscore.
+
+Examples: `_GLFW_WIN32`, `_GLFW_BUILD_DLL`
+
diff --git a/external/GLFW/docs/intro.md b/external/GLFW/docs/intro.md
new file mode 100644
index 0000000..e09989e
--- /dev/null
+++ b/external/GLFW/docs/intro.md
@@ -0,0 +1,637 @@
+# Introduction to the API {#intro_guide}
+
+[TOC]
+
+This guide introduces the basic concepts of GLFW and describes initialization,
+error handling and API guarantees and limitations. For a broad but shallow
+tutorial, see @ref quick_guide instead. For details on a specific function in
+this category, see the @ref init.
+
+There are also guides for the other areas of GLFW.
+
+ - @ref window_guide
+ - @ref context_guide
+ - @ref vulkan_guide
+ - @ref monitor_guide
+ - @ref input_guide
+
+
+## Initialization and termination {#intro_init}
+
+Before most GLFW functions may be called, the library must be initialized.
+This initialization checks what features are available on the machine,
+enumerates monitors, initializes the timer and performs any required
+platform-specific initialization.
+
+Only the following functions may be called before the library has been
+successfully initialized, and only from the main thread.
+
+ - @ref glfwGetVersion
+ - @ref glfwGetVersionString
+ - @ref glfwPlatformSupported
+ - @ref glfwGetError
+ - @ref glfwSetErrorCallback
+ - @ref glfwInitHint
+ - @ref glfwInitAllocator
+ - @ref glfwInitVulkanLoader
+ - @ref glfwInit
+ - @ref glfwTerminate
+
+Calling any other function before successful initialization will cause a @ref
+GLFW_NOT_INITIALIZED error.
+
+
+### Initializing GLFW {#intro_init_init}
+
+The library is initialized with @ref glfwInit, which returns `GLFW_FALSE` if an
+error occurred.
+
+```c
+if (!glfwInit())
+{
+ // Handle initialization failure
+}
+```
+
+If any part of initialization fails, any parts that succeeded are terminated as
+if @ref glfwTerminate had been called. The library only needs to be initialized
+once and additional calls to an already initialized library will return
+`GLFW_TRUE` immediately.
+
+Once the library has been successfully initialized, it should be terminated
+before the application exits. Modern systems are very good at freeing resources
+allocated by programs that exit, but GLFW sometimes has to change global system
+settings and these might not be restored without termination.
+
+__macOS:__ When the library is initialized the main menu and dock icon are created.
+These are not desirable for a command-line only program. The creation of the
+main menu and dock icon can be disabled with the @ref GLFW_COCOA_MENUBAR init
+hint.
+
+
+### Initialization hints {#init_hints}
+
+Initialization hints are set before @ref glfwInit and affect how the library
+behaves until termination. Hints are set with @ref glfwInitHint.
+
+```c
+glfwInitHint(GLFW_JOYSTICK_HAT_BUTTONS, GLFW_FALSE);
+```
+
+The values you set hints to are never reset by GLFW, but they only take effect
+during initialization. Once GLFW has been initialized, any values you set will
+be ignored until the library is terminated and initialized again.
+
+Some hints are platform specific. These may be set on any platform but they
+will only affect their specific platform. Other platforms will ignore them.
+Setting these hints requires no platform specific headers or functions.
+
+
+#### Shared init hints {#init_hints_shared}
+
+@anchor GLFW_PLATFORM
+__GLFW_PLATFORM__ specifies the platform to use for windowing and input.
+Possible values are `GLFW_ANY_PLATFORM`, `GLFW_PLATFORM_WIN32`,
+`GLFW_PLATFORM_COCOA`, `GLFW_PLATFORM_WAYLAND`, `GLFW_PLATFORM_X11` and
+`GLFW_PLATFORM_NULL`. The default value is `GLFW_ANY_PLATFORM`, which will
+choose any platform the library includes support for except for the Null
+backend.
+
+
+@anchor GLFW_JOYSTICK_HAT_BUTTONS
+__GLFW_JOYSTICK_HAT_BUTTONS__ specifies whether to also expose joystick hats as
+buttons, for compatibility with earlier versions of GLFW that did not have @ref
+glfwGetJoystickHats. Possible values are `GLFW_TRUE` and `GLFW_FALSE`.
+
+@anchor GLFW_ANGLE_PLATFORM_TYPE_hint
+__GLFW_ANGLE_PLATFORM_TYPE__ specifies the platform type (rendering backend) to
+request when using OpenGL ES and EGL via [ANGLE][]. If the requested platform
+type is unavailable, ANGLE will use its default. Possible values are one of
+`GLFW_ANGLE_PLATFORM_TYPE_NONE`, `GLFW_ANGLE_PLATFORM_TYPE_OPENGL`,
+`GLFW_ANGLE_PLATFORM_TYPE_OPENGLES`, `GLFW_ANGLE_PLATFORM_TYPE_D3D9`,
+`GLFW_ANGLE_PLATFORM_TYPE_D3D11`, `GLFW_ANGLE_PLATFORM_TYPE_VULKAN` and
+`GLFW_ANGLE_PLATFORM_TYPE_METAL`.
+
+[ANGLE]: https://chromium.googlesource.com/angle/angle/
+
+The ANGLE platform type is specified via the `EGL_ANGLE_platform_angle`
+extension. This extension is not used if this hint is
+`GLFW_ANGLE_PLATFORM_TYPE_NONE`, which is the default value.
+
+
+#### macOS specific init hints {#init_hints_osx}
+
+@anchor GLFW_COCOA_CHDIR_RESOURCES_hint
+__GLFW_COCOA_CHDIR_RESOURCES__ specifies whether to set the current directory to
+the application to the `Contents/Resources` subdirectory of the application's
+bundle, if present. Possible values are `GLFW_TRUE` and `GLFW_FALSE`. This is
+ignored on other platforms.
+
+@anchor GLFW_COCOA_MENUBAR_hint
+__GLFW_COCOA_MENUBAR__ specifies whether to create the menu bar and dock icon
+when GLFW is initialized. This applies whether the menu bar is created from
+a nib or manually by GLFW. Possible values are `GLFW_TRUE` and `GLFW_FALSE`.
+This is ignored on other platforms.
+
+
+#### Wayland specific init hints {#init_hints_wayland}
+
+@anchor GLFW_WAYLAND_LIBDECOR_hint
+__GLFW_WAYLAND_LIBDECOR__ specifies whether to use [libdecor][] for window
+decorations where available. Possible values are `GLFW_WAYLAND_PREFER_LIBDECOR`
+and `GLFW_WAYLAND_DISABLE_LIBDECOR`. This is ignored on other platforms.
+
+[libdecor]: https://gitlab.freedesktop.org/libdecor/libdecor
+
+
+#### X11 specific init hints {#init_hints_x11}
+
+@anchor GLFW_X11_XCB_VULKAN_SURFACE_hint
+__GLFW_X11_XCB_VULKAN_SURFACE__ specifies whether to prefer the
+`VK_KHR_xcb_surface` extension for creating Vulkan surfaces, or whether to use
+the `VK_KHR_xlib_surface` extension. Possible values are `GLFW_TRUE` and
+`GLFW_FALSE`. This is ignored on other platforms.
+
+
+#### Supported and default values {#init_hints_values}
+
+Initialization hint | Default value | Supported values
+-------------------------------- | ------------------------------- | ----------------
+@ref GLFW_PLATFORM | `GLFW_ANY_PLATFORM` | `GLFW_ANY_PLATFORM`, `GLFW_PLATFORM_WIN32`, `GLFW_PLATFORM_COCOA`, `GLFW_PLATFORM_WAYLAND`, `GLFW_PLATFORM_X11` or `GLFW_PLATFORM_NULL`
+@ref GLFW_JOYSTICK_HAT_BUTTONS | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
+@ref GLFW_ANGLE_PLATFORM_TYPE | `GLFW_ANGLE_PLATFORM_TYPE_NONE` | `GLFW_ANGLE_PLATFORM_TYPE_NONE`, `GLFW_ANGLE_PLATFORM_TYPE_OPENGL`, `GLFW_ANGLE_PLATFORM_TYPE_OPENGLES`, `GLFW_ANGLE_PLATFORM_TYPE_D3D9`, `GLFW_ANGLE_PLATFORM_TYPE_D3D11`, `GLFW_ANGLE_PLATFORM_TYPE_VULKAN` or `GLFW_ANGLE_PLATFORM_TYPE_METAL`
+@ref GLFW_COCOA_CHDIR_RESOURCES | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
+@ref GLFW_COCOA_MENUBAR | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
+@ref GLFW_WAYLAND_LIBDECOR | `GLFW_WAYLAND_PREFER_LIBDECOR` | `GLFW_WAYLAND_PREFER_LIBDECOR` or `GLFW_WAYLAND_DISABLE_LIBDECOR`
+@ref GLFW_X11_XCB_VULKAN_SURFACE | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
+
+
+### Runtime platform selection {#platform}
+
+GLFW can be compiled for more than one platform (window system) at once. This lets
+a single library binary support both Wayland and X11 on Linux and other Unix-like systems.
+
+You can control platform selection via the @ref GLFW_PLATFORM initialization hint. By
+default, this is set to @ref GLFW_ANY_PLATFORM, which will look for supported window
+systems in order of priority and select the first one it finds. It can also be set to any
+specific platform to have GLFW only look for that one.
+
+```c
+glfwInitHint(GLFW_PLATFORM, GLFW_PLATFORM_X11);
+```
+
+This mechanism also provides the Null platform, which is always supported but needs to be
+explicitly requested. This platform is effectively a stub, emulating a window system on
+a single 1080p monitor, but will not interact with any actual window system.
+
+```c
+glfwInitHint(GLFW_PLATFORM, GLFW_PLATFORM_NULL);
+```
+
+You can test whether a library binary was compiled with support for a specific platform
+with @ref glfwPlatformSupported.
+
+```c
+if (glfwPlatformSupported(GLFW_PLATFORM_WAYLAND))
+ glfwInitHint(GLFW_PLATFORM, GLFW_PLATFORM_WAYLAND);
+```
+
+Once GLFW has been initialized, you can query which platform was selected with @ref
+glfwGetPlatform.
+
+```c
+int platform = glfwGetPlatform();
+```
+
+If you are using any [native access functions](@ref native), especially on Linux and other
+Unix-like systems, then you may need to check that you are calling the ones matching the
+selected platform.
+
+
+### Custom heap memory allocator {#init_allocator}
+
+The heap memory allocator can be customized before initialization with @ref
+glfwInitAllocator.
+
+```c
+GLFWallocator allocator;
+allocator.allocate = my_malloc;
+allocator.reallocate = my_realloc;
+allocator.deallocate = my_free;
+allocator.user = NULL;
+
+glfwInitAllocator(&allocator);
+```
+
+The allocator will be made active at the beginning of initialization and will be used by
+GLFW until the library has been fully terminated. Any allocator set after initialization
+will be picked up only at the next initialization.
+
+The allocator will only be used for allocations that would have been made with
+the C standard library. Memory allocations that must be made with platform
+specific APIs will still use those.
+
+The allocation function must have a signature matching @ref GLFWallocatefun. It receives
+the desired size, in bytes, and the user pointer passed to @ref glfwInitAllocator and
+returns the address to the allocated memory block.
+
+```c
+void* my_malloc(size_t size, void* user)
+{
+ ...
+}
+```
+
+The documentation for @ref GLFWallocatefun also lists the requirements and limitations for
+an allocation function. If the active one does not meet all of these, GLFW may fail.
+
+The reallocation function must have a function signature matching @ref GLFWreallocatefun.
+It receives the memory block to be reallocated, the new desired size, in bytes, and the user
+pointer passed to @ref glfwInitAllocator and returns the address to the resized memory
+block.
+
+```c
+void* my_realloc(void* block, size_t size, void* user)
+{
+ ...
+}
+```
+
+The documentation for @ref GLFWreallocatefun also lists the requirements and limitations
+for a reallocation function. If the active one does not meet all of these, GLFW may fail.
+
+The deallocation function must have a function signature matching @ref GLFWdeallocatefun.
+It receives the memory block to be deallocated and the user pointer passed to @ref
+glfwInitAllocator.
+
+```c
+void my_free(void* block, void* user)
+{
+ ...
+}
+```
+
+The documentation for @ref GLFWdeallocatefun also lists the requirements and limitations
+for a deallocation function. If the active one does not meet all of these, GLFW may fail.
+
+
+### Terminating GLFW {#intro_init_terminate}
+
+Before your application exits, you should terminate the GLFW library if it has
+been initialized. This is done with @ref glfwTerminate.
+
+```c
+glfwTerminate();
+```
+
+This will destroy any remaining window, monitor and cursor objects, restore any
+modified gamma ramps, re-enable the screensaver if it had been disabled and free
+any other resources allocated by GLFW.
+
+Once the library is terminated, it is as if it had never been initialized, therefore
+you will need to initialize it again before being able to use GLFW. If the
+library was not initialized or had already been terminated, it returns
+immediately.
+
+
+## Error handling {#error_handling}
+
+Some GLFW functions have return values that indicate an error, but this is often
+not very helpful when trying to figure out what happened or why it occurred.
+Other functions have no return value reserved for errors, so error notification
+needs a separate channel. Finally, far from all GLFW functions have return
+values.
+
+The last [error code](@ref errors) for the calling thread can be queried at any
+time with @ref glfwGetError.
+
+```c
+int code = glfwGetError(NULL);
+
+if (code != GLFW_NO_ERROR)
+ handle_error(code);
+```
+
+If no error has occurred since the last call, @ref GLFW_NO_ERROR (zero) is
+returned. The error is cleared before the function returns.
+
+The error code indicates the general category of the error. Some error codes,
+such as @ref GLFW_NOT_INITIALIZED has only a single meaning, whereas others like
+@ref GLFW_PLATFORM_ERROR are used for many different errors.
+
+GLFW often has more information about an error than its general category. You
+can retrieve a UTF-8 encoded human-readable description along with the error
+code. If no error has occurred since the last call, the description is set to
+`NULL`.
+
+```c
+const char* description;
+int code = glfwGetError(&description);
+
+if (description)
+ display_error_message(code, description);
+```
+
+The retrieved description string is only valid until the next error occurs.
+This means you must make a copy of it if you want to keep it.
+
+You can also set an error callback, which will be called each time an error
+occurs. It is set with @ref glfwSetErrorCallback.
+
+```c
+glfwSetErrorCallback(error_callback);
+```
+
+The error callback receives the same error code and human-readable description
+returned by @ref glfwGetError.
+
+```c
+void error_callback(int code, const char* description)
+{
+ display_error_message(code, description);
+}
+```
+
+The error callback is called after the error is stored, so calling @ref
+glfwGetError from within the error callback returns the same values as the
+callback argument.
+
+The description string passed to the callback is only valid until the error
+callback returns. This means you must make a copy of it if you want to keep it.
+
+__Reported errors are never fatal.__ As long as GLFW was successfully
+initialized, it will remain initialized and in a safe state until terminated
+regardless of how many errors occur. If an error occurs during initialization
+that causes @ref glfwInit to fail, any part of the library that was initialized
+will be safely terminated.
+
+Do not rely on a currently invalid call to generate a specific error, as in the
+future that same call may generate a different error or become valid.
+
+
+## Coordinate systems {#coordinate_systems}
+
+GLFW has two primary coordinate systems: the _virtual screen_ and the window
+_content area_ or _content area_. Both use the same unit: _virtual screen
+coordinates_, or just _screen coordinates_, which don't necessarily correspond
+to pixels.
+
+
+
+Both the virtual screen and the content area coordinate systems have the X-axis
+pointing to the right and the Y-axis pointing down.
+
+Window and monitor positions are specified as the position of the upper-left
+corners of their content areas relative to the virtual screen, while cursor
+positions are specified relative to a window's content area.
+
+Because the origin of the window's content area coordinate system is also the
+point from which the window position is specified, you can translate content
+area coordinates to the virtual screen by adding the window position. The
+window frame, when present, extends out from the content area but does not
+affect the window position.
+
+Almost all positions and sizes in GLFW are measured in screen coordinates
+relative to one of the two origins above. This includes cursor positions,
+window positions and sizes, window frame sizes, monitor positions and video mode
+resolutions.
+
+Two exceptions are the [monitor physical size](@ref monitor_size), which is
+measured in millimetres, and [framebuffer size](@ref window_fbsize), which is
+measured in pixels.
+
+Pixels and screen coordinates may map 1:1 on your machine, but they won't on
+every other machine, for example on a Mac with a Retina display. The ratio
+between screen coordinates and pixels may also change at run-time depending on
+which monitor the window is currently considered to be on.
+
+
+## Guarantees and limitations {#guarantees_limitations}
+
+This section describes the conditions under which GLFW can be expected to
+function, barring bugs in the operating system or drivers. Use of GLFW outside
+these limits may work on some platforms, or on some machines, or some of the
+time, or on some versions of GLFW, but it may break at any time and this will
+not be considered a bug.
+
+
+### Pointer lifetimes {#lifetime}
+
+GLFW will never free any pointer you provide to it, and you must never free any
+pointer it provides to you.
+
+Many GLFW functions return pointers to dynamically allocated structures, strings
+or arrays, and some callbacks are provided with strings or arrays. These are
+always managed by GLFW and should never be freed by the application. The
+lifetime of these pointers is documented for each GLFW function and callback.
+If you need to keep this data, you must copy it before its lifetime expires.
+
+Many GLFW functions accept pointers to structures or strings allocated by the
+application. These are never freed by GLFW and are always the responsibility of
+the application. If GLFW needs to keep the data in these structures or strings,
+it is copied before the function returns.
+
+Pointer lifetimes are guaranteed not to be shortened in future minor or patch
+releases.
+
+
+### Reentrancy {#reentrancy}
+
+GLFW event processing and object destruction are not reentrant. This means that
+the following functions must not be called from any callback function:
+
+ - @ref glfwDestroyWindow
+ - @ref glfwDestroyCursor
+ - @ref glfwPollEvents
+ - @ref glfwWaitEvents
+ - @ref glfwWaitEventsTimeout
+ - @ref glfwTerminate
+
+These functions may be made reentrant in future minor or patch releases, but
+functions not on this list will not be made non-reentrant.
+
+
+### Thread safety {#thread_safety}
+
+Most GLFW functions must only be called from the main thread (the thread that
+calls main), but some may be called from any thread once the library has been
+initialized. Before initialization the whole library is thread-unsafe.
+
+The reference documentation for every GLFW function states whether it is limited
+to the main thread.
+
+Initialization, termination, event processing and the creation and
+destruction of windows, cursors and OpenGL and OpenGL ES contexts are all
+restricted to the main thread due to limitations of one or several platforms.
+
+Because event processing must be performed on the main thread, all callbacks
+except for the error callback will only be called on that thread. The error
+callback may be called on any thread, as any GLFW function may generate errors.
+
+The error code and description may be queried from any thread.
+
+ - @ref glfwGetError
+
+Empty events may be posted from any thread.
+
+ - @ref glfwPostEmptyEvent
+
+The window user pointer and close flag may be read and written from any thread,
+but this is not synchronized by GLFW.
+
+ - @ref glfwGetWindowUserPointer
+ - @ref glfwSetWindowUserPointer
+ - @ref glfwWindowShouldClose
+ - @ref glfwSetWindowShouldClose
+
+These functions for working with OpenGL and OpenGL ES contexts may be called
+from any thread, but the window object is not synchronized by GLFW.
+
+ - @ref glfwMakeContextCurrent
+ - @ref glfwGetCurrentContext
+ - @ref glfwSwapBuffers
+ - @ref glfwSwapInterval
+ - @ref glfwExtensionSupported
+ - @ref glfwGetProcAddress
+
+The raw timer functions may be called from any thread.
+
+ - @ref glfwGetTimerFrequency
+ - @ref glfwGetTimerValue
+
+The regular timer may be used from any thread, but reading and writing the timer
+offset is not synchronized by GLFW.
+
+ - @ref glfwGetTime
+ - @ref glfwSetTime
+
+Library version information may be queried from any thread.
+
+ - @ref glfwGetVersion
+ - @ref glfwGetVersionString
+
+Platform information may be queried from any thread.
+
+ - @ref glfwPlatformSupported
+ - @ref glfwGetPlatform
+
+All Vulkan related functions may be called from any thread.
+
+ - @ref glfwVulkanSupported
+ - @ref glfwGetRequiredInstanceExtensions
+ - @ref glfwGetInstanceProcAddress
+ - @ref glfwGetPhysicalDevicePresentationSupport
+ - @ref glfwCreateWindowSurface
+
+GLFW uses synchronization objects internally only to manage the per-thread
+context and error states. Additional synchronization is left to the
+application.
+
+Functions that may currently be called from any thread will always remain so,
+but functions that are currently limited to the main thread may be updated to
+allow calls from any thread in future releases.
+
+
+### Version compatibility {#compatibility}
+
+GLFW uses [Semantic Versioning](https://semver.org/). This guarantees source
+and binary backward compatibility with earlier minor versions of the API. This
+means that you can drop in a newer version of the library and existing programs
+will continue to compile and existing binaries will continue to run.
+
+Once a function or constant has been added, the signature of that function or
+value of that constant will remain unchanged until the next major version of
+GLFW. No compatibility of any kind is guaranteed between major versions.
+
+Undocumented behavior, i.e. behavior that is not described in the documentation,
+may change at any time until it is documented.
+
+If the reference documentation and the implementation differ, the reference
+documentation will almost always take precedence and the implementation will be
+fixed in the next release. The reference documentation will also take
+precedence over anything stated in a guide.
+
+
+### Event order {#event_order}
+
+The order of arrival of related events is not guaranteed to be consistent
+across platforms. The exception is synthetic key and mouse button release
+events, which are always delivered after the window defocus event.
+
+
+## Version management {#intro_version}
+
+GLFW provides mechanisms for identifying what version of GLFW your application
+was compiled against as well as what version it is currently running against.
+If you are loading GLFW dynamically (not just linking dynamically), you can use
+this to verify that the library binary is compatible with your application.
+
+
+### Compile-time version {#intro_version_compile}
+
+The compile-time version of GLFW is provided by the GLFW header with the
+`GLFW_VERSION_MAJOR`, `GLFW_VERSION_MINOR` and `GLFW_VERSION_REVISION` macros.
+
+```c
+printf("Compiled against GLFW %i.%i.%i\n",
+ GLFW_VERSION_MAJOR,
+ GLFW_VERSION_MINOR,
+ GLFW_VERSION_REVISION);
+```
+
+
+### Run-time version {#intro_version_runtime}
+
+The run-time version can be retrieved with @ref glfwGetVersion, a function that
+may be called regardless of whether GLFW is initialized.
+
+```c
+int major, minor, revision;
+glfwGetVersion(&major, &minor, &revision);
+
+printf("Running against GLFW %i.%i.%i\n", major, minor, revision);
+```
+
+
+### Version string {#intro_version_string}
+
+GLFW 3 also provides a compile-time generated version string that describes the
+version, platform, compiler and any platform-specific compile-time options.
+This is primarily intended for submitting bug reports, to allow developers to
+see which code paths are enabled in a binary.
+
+The version string is returned by @ref glfwGetVersionString, a function that may
+be called regardless of whether GLFW is initialized.
+
+__Do not use the version string__ to parse the GLFW library version. The @ref
+glfwGetVersion function already provides the version of the running library
+binary.
+
+__Do not use the version string__ to parse what platforms are supported. The @ref
+glfwPlatformSupported function lets you query platform support.
+
+__GLFW 3.4:__ The format of this string was changed to support the addition of
+[runtime platform selection](@ref platform).
+
+The format of the string is as follows:
+ - The version of GLFW
+ - For each supported platform:
+ - The name of the window system API
+ - The name of the window system specific context creation API, if applicable
+ - The names of the always supported context creation APIs EGL and OSMesa
+ - Any additional compile-time options, APIs and (on Windows) what compiler was used
+
+For example, compiling GLFW 3.5 with MinGW-64 as a DLL for Windows, may result
+in a version string like this:
+
+```c
+3.5.0 Win32 WGL Null EGL OSMesa MinGW-w64 DLL
+```
+
+Compiling GLFW as a static library for Linux, with both Wayland and X11 enabled, may
+result in a version string like this:
+
+```c
+3.5.0 Wayland X11 GLX Null EGL OSMesa monotonic
+```
+
diff --git a/external/GLFW/docs/main.md b/external/GLFW/docs/main.md
new file mode 100644
index 0000000..c70f735
--- /dev/null
+++ b/external/GLFW/docs/main.md
@@ -0,0 +1,38 @@
+# Introduction {#mainpage}
+
+GLFW is a free, Open Source, multi-platform library for OpenGL, OpenGL ES and
+Vulkan application development. It provides a simple, platform-independent API
+for creating windows, contexts and surfaces, reading input, handling events, etc.
+
+@ref news list new features, caveats and deprecations.
+
+@ref quick_guide is a guide for users new to GLFW. It takes you through how to
+write a small but complete program.
+
+There are guides for each section of the API:
+
+ - @ref intro_guide – initialization, error handling and high-level design
+ - @ref window_guide – creating and working with windows and framebuffers
+ - @ref context_guide – working with OpenGL and OpenGL ES contexts
+ - @ref vulkan_guide - working with Vulkan objects and extensions
+ - @ref monitor_guide – enumerating and working with monitors and video modes
+ - @ref input_guide – receiving events, polling and processing input
+
+Once you have written a program, see @ref compile_guide and @ref build_guide.
+
+The [reference documentation](modules.html) provides more detailed information
+about specific functions.
+
+@ref moving_guide explains what has changed and how to update existing code to
+use the new API.
+
+There is a section on @ref guarantees_limitations for pointer lifetimes,
+reentrancy, thread safety, event order and backward and forward compatibility.
+
+Finally, @ref compat_guide explains what APIs, standards and protocols GLFW uses
+and what happens when they are not present on a given machine.
+
+This documentation was generated with Doxygen. The sources for it are available
+in both the [source distribution](https://www.glfw.org/download.html) and
+[GitHub repository](https://github.com/glfw/glfw).
+
diff --git a/external/GLFW/docs/monitor.md b/external/GLFW/docs/monitor.md
new file mode 100644
index 0000000..8e01a8f
--- /dev/null
+++ b/external/GLFW/docs/monitor.md
@@ -0,0 +1,261 @@
+# Monitor guide {#monitor_guide}
+
+[TOC]
+
+This guide introduces the monitor related functions of GLFW. For details on
+a specific function in this category, see the @ref monitor. There are also
+guides for the other areas of GLFW.
+
+ - @ref intro_guide
+ - @ref window_guide
+ - @ref context_guide
+ - @ref vulkan_guide
+ - @ref input_guide
+
+
+## Monitor objects {#monitor_object}
+
+A monitor object represents a currently connected monitor and is represented as
+a pointer to the [opaque](https://en.wikipedia.org/wiki/Opaque_data_type) type
+@ref GLFWmonitor. Monitor objects cannot be created or destroyed by the
+application and retain their addresses until the monitors they represent are
+disconnected or until the library is [terminated](@ref intro_init_terminate).
+
+Each monitor has a current video mode, a list of supported video modes,
+a virtual position, a human-readable name, an estimated physical size and
+a gamma ramp. One of the monitors is the primary monitor.
+
+The virtual position of a monitor is in
+[screen coordinates](@ref coordinate_systems) and, together with the current
+video mode, describes the viewports that the connected monitors provide into the
+virtual desktop that spans them.
+
+To see how GLFW views your monitor setup and its available video modes, run the
+`monitors` test program.
+
+
+### Retrieving monitors {#monitor_monitors}
+
+The primary monitor is returned by @ref glfwGetPrimaryMonitor. It is the user's
+preferred monitor and is usually the one with global UI elements like task bar
+or menu bar.
+
+```c
+GLFWmonitor* primary = glfwGetPrimaryMonitor();
+```
+
+You can retrieve all currently connected monitors with @ref glfwGetMonitors.
+See the reference documentation for the lifetime of the returned array.
+
+```c
+int count;
+GLFWmonitor** monitors = glfwGetMonitors(&count);
+```
+
+The primary monitor is always the first monitor in the returned array, but other
+monitors may be moved to a different index when a monitor is connected or
+disconnected.
+
+
+### Monitor configuration changes {#monitor_event}
+
+If you wish to be notified when a monitor is connected or disconnected, set
+a monitor callback.
+
+```c
+glfwSetMonitorCallback(monitor_callback);
+```
+
+The callback function receives the handle for the monitor that has been
+connected or disconnected and the event that occurred.
+
+```c
+void monitor_callback(GLFWmonitor* monitor, int event)
+{
+ if (event == GLFW_CONNECTED)
+ {
+ // The monitor was connected
+ }
+ else if (event == GLFW_DISCONNECTED)
+ {
+ // The monitor was disconnected
+ }
+}
+```
+
+If a monitor is disconnected, all windows that are full screen on it will be
+switched to windowed mode before the callback is called. Only @ref
+glfwGetMonitorName and @ref glfwGetMonitorUserPointer will return useful values
+for a disconnected monitor and only before the monitor callback returns.
+
+
+## Monitor properties {#monitor_properties}
+
+Each monitor has a current video mode, a list of supported video modes,
+a virtual position, a content scale, a human-readable name, a user pointer, an
+estimated physical size and a gamma ramp.
+
+
+### Video modes {#monitor_modes}
+
+GLFW generally does a good job selecting a suitable video mode when you create
+a full screen window, change its video mode or make a windowed one full
+screen, but it is sometimes useful to know exactly which video modes are
+supported.
+
+Video modes are represented as @ref GLFWvidmode structures. You can get an
+array of the video modes supported by a monitor with @ref glfwGetVideoModes.
+See the reference documentation for the lifetime of the returned array.
+
+```c
+int count;
+GLFWvidmode* modes = glfwGetVideoModes(monitor, &count);
+```
+
+To get the current video mode of a monitor call @ref glfwGetVideoMode. See the
+reference documentation for the lifetime of the returned pointer.
+
+```c
+const GLFWvidmode* mode = glfwGetVideoMode(monitor);
+```
+
+The resolution of a video mode is specified in
+[screen coordinates](@ref coordinate_systems), not pixels.
+
+
+### Physical size {#monitor_size}
+
+The physical size of a monitor in millimetres, or an estimation of it, can be
+retrieved with @ref glfwGetMonitorPhysicalSize. This has no relation to its
+current _resolution_, i.e. the width and height of its current
+[video mode](@ref monitor_modes).
+
+```c
+int width_mm, height_mm;
+glfwGetMonitorPhysicalSize(monitor, &width_mm, &height_mm);
+```
+
+While this can be used to calculate the raw DPI of a monitor, this is often not
+useful. Instead, use the [monitor content scale](@ref monitor_scale) and
+[window content scale](@ref window_scale) to scale your content.
+
+
+### Content scale {#monitor_scale}
+
+The content scale for a monitor can be retrieved with @ref
+glfwGetMonitorContentScale.
+
+```c
+float xscale, yscale;
+glfwGetMonitorContentScale(monitor, &xscale, &yscale);
+```
+
+For more information on what the content scale is and how to use it, see
+[window content scale](@ref window_scale).
+
+
+### Virtual position {#monitor_pos}
+
+The position of the monitor on the virtual desktop, in
+[screen coordinates](@ref coordinate_systems), can be retrieved with @ref
+glfwGetMonitorPos.
+
+```c
+int xpos, ypos;
+glfwGetMonitorPos(monitor, &xpos, &ypos);
+```
+
+
+### Work area {#monitor_workarea}
+
+The area of a monitor not occupied by global task bars or menu bars is the work
+area. This is specified in [screen coordinates](@ref coordinate_systems) and
+can be retrieved with @ref glfwGetMonitorWorkarea.
+
+```c
+int xpos, ypos, width, height;
+glfwGetMonitorWorkarea(monitor, &xpos, &ypos, &width, &height);
+```
+
+
+### Human-readable name {#monitor_name}
+
+The human-readable, UTF-8 encoded name of a monitor is returned by @ref
+glfwGetMonitorName. See the reference documentation for the lifetime of the
+returned string.
+
+```c
+const char* name = glfwGetMonitorName(monitor);
+```
+
+Monitor names are not guaranteed to be unique. Two monitors of the same model
+and make may have the same name. Only the monitor handle is guaranteed to be
+unique, and only until that monitor is disconnected.
+
+
+### User pointer {#monitor_userptr}
+
+Each monitor has a user pointer that can be set with @ref
+glfwSetMonitorUserPointer and queried with @ref glfwGetMonitorUserPointer. This
+can be used for any purpose you need and will not be modified by GLFW. The
+value will be kept until the monitor is disconnected or until the library is
+terminated.
+
+The initial value of the pointer is `NULL`.
+
+
+### Gamma ramp {#monitor_gamma}
+
+The gamma ramp of a monitor can be set with @ref glfwSetGammaRamp, which accepts
+a monitor handle and a pointer to a @ref GLFWgammaramp structure.
+
+```c
+GLFWgammaramp ramp;
+unsigned short red[256], green[256], blue[256];
+
+ramp.size = 256;
+ramp.red = red;
+ramp.green = green;
+ramp.blue = blue;
+
+for (i = 0; i < ramp.size; i++)
+{
+ // Fill out gamma ramp arrays as desired
+}
+
+glfwSetGammaRamp(monitor, &ramp);
+```
+
+The gamma ramp data is copied before the function returns, so there is no need
+to keep it around once the ramp has been set.
+
+It is recommended that your gamma ramp have the same size as the current gamma
+ramp for that monitor.
+
+The current gamma ramp for a monitor is returned by @ref glfwGetGammaRamp. See
+the reference documentation for the lifetime of the returned structure.
+
+```c
+const GLFWgammaramp* ramp = glfwGetGammaRamp(monitor);
+```
+
+If you wish to set a regular gamma ramp, you can have GLFW calculate it for you
+from the desired exponent with @ref glfwSetGamma, which in turn calls @ref
+glfwSetGammaRamp with the resulting ramp.
+
+```c
+glfwSetGamma(monitor, 1.0);
+```
+
+To experiment with gamma correction via the @ref glfwSetGamma function, run the
+`gamma` test program.
+
+@note The software controlled gamma ramp is applied _in addition_ to the
+hardware gamma correction, which today is typically an approximation of sRGB
+gamma. This means that setting a perfectly linear ramp, or gamma 1.0, will
+produce the default (usually sRGB-like) behavior.
+
+@note __Wayland:__ An application cannot read or modify the monitor gamma ramp.
+The @ref glfwGetGammaRamp, @ref glfwSetGammaRamp and @ref glfwSetGamma functions
+emit @ref GLFW_FEATURE_UNAVAILABLE.
+
diff --git a/external/GLFW/docs/moving.md b/external/GLFW/docs/moving.md
new file mode 100644
index 0000000..7c1e2f5
--- /dev/null
+++ b/external/GLFW/docs/moving.md
@@ -0,0 +1,521 @@
+# Moving from GLFW 2 to 3 {#moving_guide}
+
+[TOC]
+
+This is a transition guide for moving from GLFW 2 to 3. It describes what has
+changed or been removed, but does _not_ include
+[new features](@ref news) unless they are required when moving an existing code
+base onto the new API. For example, the new multi-monitor functions are
+required to create full screen windows with GLFW 3.
+
+
+## Changed and removed features {#moving_removed}
+
+### Renamed library and header file {#moving_renamed_files}
+
+The GLFW 3 header is named @ref glfw3.h and moved to the `GLFW` directory, to
+avoid collisions with the headers of other major versions. Similarly, the GLFW
+3 library is named `glfw3,` except when it's installed as a shared library on
+Unix-like systems, where it uses the [soname][] `libglfw.so.3`.
+
+[soname]: https://en.wikipedia.org/wiki/soname
+
+__Old syntax__
+```c
+#include
+```
+
+__New syntax__
+```c
+#include
+```
+
+
+### Removal of threading functions {#moving_threads}
+
+The threading functions have been removed, including the per-thread sleep
+function. They were fairly primitive, under-used, poorly integrated and took
+time away from the focus of GLFW (i.e. context, input and window). There are
+better threading libraries available and native threading support is available
+in both [C++11][] and [C11][], both of which are gaining traction.
+
+[C++11]: https://en.cppreference.com/w/cpp/thread
+[C11]: https://en.cppreference.com/w/c/thread
+
+If you wish to use the C++11 or C11 facilities but your compiler doesn't yet
+support them, see the [TinyThread++][] and [TinyCThread][] projects created by
+the original author of GLFW. These libraries implement a usable subset of the
+threading APIs in C++11 and C11, and in fact some GLFW 3 test programs use
+TinyCThread.
+
+[TinyThread++]: https://gitorious.org/tinythread/tinythreadpp
+[TinyCThread]: https://github.com/tinycthread/tinycthread
+
+However, GLFW 3 has better support for _use from multiple threads_ than GLFW
+2 had. Contexts can be made current on any thread, although only a single
+thread at a time, and the documentation explicitly states which functions may be
+used from any thread and which must only be used from the main thread.
+
+__Removed functions__
+> `glfwSleep`, `glfwCreateThread`, `glfwDestroyThread`, `glfwWaitThread`,
+> `glfwGetThreadID`, `glfwCreateMutex`, `glfwDestroyMutex`, `glfwLockMutex`,
+> `glfwUnlockMutex`, `glfwCreateCond`, `glfwDestroyCond`, `glfwWaitCond`,
+> `glfwSignalCond`, `glfwBroadcastCond` and `glfwGetNumberOfProcessors`.
+
+__Removed types__
+> `GLFWthreadfun`
+
+
+### Removal of image and texture loading {#moving_image}
+
+The image and texture loading functions have been removed. They only supported
+the Targa image format, making them mostly useful for beginner level examples.
+To become of sufficiently high quality to warrant keeping them in GLFW 3, they
+would need not only to support other formats, but also modern extensions to
+OpenGL texturing. This would either add a number of external
+dependencies (libjpeg, libpng, etc.), or force GLFW to ship with inline versions
+of these libraries.
+
+As there already are libraries doing this, it is unnecessary both to duplicate
+the work and to tie the duplicate to GLFW. The resulting library would also be
+platform-independent, as both OpenGL and stdio are available wherever GLFW is.
+
+__Removed functions__
+> `glfwReadImage`, `glfwReadMemoryImage`, `glfwFreeImage`, `glfwLoadTexture2D`,
+> `glfwLoadMemoryTexture2D` and `glfwLoadTextureImage2D`.
+
+
+### Removal of GLFWCALL macro {#moving_stdcall}
+
+The `GLFWCALL` macro, which made callback functions use [\_\_stdcall][stdcall]
+on Windows, has been removed. GLFW is written in C, not Pascal. Removing this
+macro means there's one less thing for application programmers to remember, i.e.
+the requirement to mark all callback functions with `GLFWCALL`. It also
+simplifies the creation of DLLs and DLL link libraries, as there's no need to
+explicitly disable `@n` entry point suffixes.
+
+[stdcall]: https://msdn.microsoft.com/en-us/library/zxk0tw93.aspx
+
+__Old syntax__
+```c
+void GLFWCALL callback_function(...);
+```
+
+__New syntax__
+```c
+void callback_function(...);
+```
+
+
+### Window handle parameters {#moving_window_handles}
+
+Because GLFW 3 supports multiple windows, window handle parameters have been
+added to all window-related GLFW functions and callbacks. The handle of
+a newly created window is returned by @ref glfwCreateWindow (formerly
+`glfwOpenWindow`). Window handles are pointers to the
+[opaque][opaque-type] type @ref GLFWwindow.
+
+[opaque-type]: https://en.wikipedia.org/wiki/Opaque_data_type
+
+__Old syntax__
+```c
+glfwSetWindowTitle("New Window Title");
+```
+
+__New syntax__
+```c
+glfwSetWindowTitle(window, "New Window Title");
+```
+
+
+### Explicit monitor selection {#moving_monitor}
+
+GLFW 3 provides support for multiple monitors. To request a full screen mode window,
+instead of passing `GLFW_FULLSCREEN` you specify which monitor you wish the
+window to use. The @ref glfwGetPrimaryMonitor function returns the monitor that
+GLFW 2 would have selected, but there are many other
+[monitor functions](@ref monitor_guide). Monitor handles are pointers to the
+[opaque][opaque-type] type @ref GLFWmonitor.
+
+__Old basic full screen__
+```c
+glfwOpenWindow(640, 480, 8, 8, 8, 0, 24, 0, GLFW_FULLSCREEN);
+```
+
+__New basic full screen__
+```c
+window = glfwCreateWindow(640, 480, "My Window", glfwGetPrimaryMonitor(), NULL);
+```
+
+@note The framebuffer bit depth parameters of `glfwOpenWindow` have been turned
+into [window hints](@ref window_hints), but as they have been given
+[sane defaults](@ref window_hints_values) you rarely need to set these hints.
+
+
+### Removal of automatic event polling {#moving_autopoll}
+
+GLFW 3 does not automatically poll for events in @ref glfwSwapBuffers, meaning
+you need to call @ref glfwPollEvents or @ref glfwWaitEvents yourself. Unlike
+buffer swap, which acts on a single window, the event processing functions act
+on all windows at once.
+
+__Old basic main loop__
+```c
+while (...)
+{
+ // Process input
+ // Render output
+ glfwSwapBuffers();
+}
+```
+
+__New basic main loop__
+```c
+while (...)
+{
+ // Process input
+ // Render output
+ glfwSwapBuffers(window);
+ glfwPollEvents();
+}
+```
+
+
+### Explicit context management {#moving_context}
+
+Each GLFW 3 window has its own OpenGL context and only you, the application
+programmer, can know which context should be current on which thread at any
+given time. Therefore, GLFW 3 leaves that decision to you.
+
+This means that you need to call @ref glfwMakeContextCurrent after creating
+a window before you can call any OpenGL functions.
+
+
+### Separation of window and framebuffer sizes {#moving_hidpi}
+
+Window positions and sizes now use screen coordinates, which may not be the same
+as pixels on machines with high-DPI monitors. This is important as OpenGL uses
+pixels, not screen coordinates. For example, the rectangle specified with
+`glViewport` needs to use pixels. Therefore, framebuffer size functions have
+been added. You can retrieve the size of the framebuffer of a window with @ref
+glfwGetFramebufferSize function. A framebuffer size callback has also been
+added, which can be set with @ref glfwSetFramebufferSizeCallback.
+
+__Old basic viewport setup__
+```c
+glfwGetWindowSize(&width, &height);
+glViewport(0, 0, width, height);
+```
+
+__New basic viewport setup__
+```c
+glfwGetFramebufferSize(window, &width, &height);
+glViewport(0, 0, width, height);
+```
+
+
+### Window closing changes {#moving_window_close}
+
+The `GLFW_OPENED` window parameter has been removed. As long as the window has
+not been destroyed, whether through @ref glfwDestroyWindow or @ref
+glfwTerminate, the window is "open".
+
+A user attempting to close a window is now just an event like any other. Unlike
+GLFW 2, windows and contexts created with GLFW 3 will never be destroyed unless
+you choose them to be. Each window now has a close flag that is set to
+`GLFW_TRUE` when the user attempts to close that window. By default, nothing else
+happens and the window stays visible. It is then up to you to either destroy
+the window, take some other action or ignore the request.
+
+You can query the close flag at any time with @ref glfwWindowShouldClose and set
+it at any time with @ref glfwSetWindowShouldClose.
+
+__Old basic main loop__
+```c
+while (glfwGetWindowParam(GLFW_OPENED))
+{
+ ...
+}
+```
+
+__New basic main loop__
+```c
+while (!glfwWindowShouldClose(window))
+{
+ ...
+}
+```
+
+The close callback no longer returns a value. Instead, it is called after the
+close flag has been set, so it can optionally override its value, before
+event processing completes. You may however not call @ref glfwDestroyWindow
+from the close callback (or any other window related callback).
+
+__Old syntax__
+```c
+int GLFWCALL window_close_callback(void);
+```
+
+__New syntax__
+```c
+void window_close_callback(GLFWwindow* window);
+```
+
+@note GLFW never clears the close flag to `GLFW_FALSE`, meaning you can use it
+for other reasons to close the window as well, for example the user choosing
+Quit from an in-game menu.
+
+
+### Persistent window hints {#moving_hints}
+
+The `glfwOpenWindowHint` function has been renamed to @ref glfwWindowHint.
+
+Window hints are no longer reset to their default values on window creation, but
+instead retain their values until modified by @ref glfwWindowHint or @ref
+glfwDefaultWindowHints, or until the library is terminated and re-initialized.
+
+
+### Video mode enumeration {#moving_video_modes}
+
+Video mode enumeration is now per-monitor. The @ref glfwGetVideoModes function
+now returns all available modes for a specific monitor instead of requiring you
+to guess how large an array you need. The `glfwGetDesktopMode` function, which
+had poorly defined behavior, has been replaced by @ref glfwGetVideoMode, which
+returns the current mode of a monitor.
+
+
+### Removal of character actions {#moving_char_up}
+
+The action parameter of the [character callback](@ref GLFWcharfun) has been
+removed. This was an artefact of the origin of GLFW, i.e. being developed in
+English by a Swede. However, many keyboard layouts require more than one key to
+produce characters with diacritical marks. Even the Swedish keyboard layout
+requires this for uncommon cases like ü.
+
+__Old syntax__
+```c
+void GLFWCALL character_callback(int character, int action);
+```
+
+__New syntax__
+```c
+void character_callback(GLFWwindow* window, int character);
+```
+
+
+### Cursor position changes {#moving_cursorpos}
+
+The `glfwGetMousePos` function has been renamed to @ref glfwGetCursorPos,
+`glfwSetMousePos` to @ref glfwSetCursorPos and `glfwSetMousePosCallback` to @ref
+glfwSetCursorPosCallback.
+
+The cursor position is now `double` instead of `int`, both for the direct
+functions and for the callback. Some platforms can provide sub-pixel cursor
+movement and this data is now passed on to the application where available. On
+platforms where this is not provided, the decimal part is zero.
+
+GLFW 3 only allows you to position the cursor within a window using @ref
+glfwSetCursorPos (formerly `glfwSetMousePos`) when that window is active.
+Unless the window is active, the function fails silently.
+
+
+### Wheel position replaced by scroll offsets {#moving_wheel}
+
+The `glfwGetMouseWheel` function has been removed. Scrolling is the input of
+offsets and has no absolute position. The mouse wheel callback has been
+replaced by a [scroll callback](@ref GLFWscrollfun) that receives
+two-dimensional floating point scroll offsets. This allows you to receive
+precise scroll data from for example modern touchpads.
+
+__Old syntax__
+```c
+void GLFWCALL mouse_wheel_callback(int position);
+```
+
+__New syntax__
+```c
+void scroll_callback(GLFWwindow* window, double xoffset, double yoffset);
+```
+
+__Removed functions__
+> `glfwGetMouseWheel`
+
+
+### Key repeat action {#moving_repeat}
+
+The `GLFW_KEY_REPEAT` enable has been removed and key repeat is always enabled
+for both keys and characters. A new key action, `GLFW_REPEAT`, has been added
+to allow the [key callback](@ref GLFWkeyfun) to distinguish an initial key press
+from a repeat. Note that @ref glfwGetKey still returns only `GLFW_PRESS` or
+`GLFW_RELEASE`.
+
+
+### Physical key input {#moving_keys}
+
+GLFW 3 key tokens map to physical keys, unlike in GLFW 2 where they mapped to
+the values generated by the current keyboard layout. The tokens are named
+according to the values they would have in the standard US layout, but this
+is only a convenience, as most programmers are assumed to know that layout.
+This means that (for example) `GLFW_KEY_LEFT_BRACKET` is always a single key and
+is the same key in the same place regardless of what keyboard layouts the users
+of your program have.
+
+The key input facility was never meant for text input, although using it that
+way worked slightly better in GLFW 2. If you were using it to input text, you
+should be using the character callback instead, on both GLFW 2 and 3. This will
+give you the characters being input, as opposed to the keys being pressed.
+
+GLFW 3 has key tokens for all keys on a standard 105 key keyboard, so instead of
+having to remember whether to check for `a` or `A`, you now check for
+@ref GLFW_KEY_A.
+
+
+### Joystick function changes {#moving_joystick}
+
+The `glfwGetJoystickPos` function has been renamed to @ref glfwGetJoystickAxes.
+
+The `glfwGetJoystickParam` function and the `GLFW_PRESENT`, `GLFW_AXES` and
+`GLFW_BUTTONS` tokens have been replaced by the @ref glfwJoystickPresent
+function as well as axis and button counts returned by the @ref
+glfwGetJoystickAxes and @ref glfwGetJoystickButtons functions.
+
+
+### Win32 MBCS support {#moving_mbcs}
+
+The Win32 port of GLFW 3 will not compile in [MBCS mode][MBCS]. However,
+because the use of the Unicode version of the Win32 API doesn't affect the
+process as a whole, but only those windows created using it, it's perfectly
+possible to call MBCS functions from other parts of the same application.
+Therefore, even if an application using GLFW has MBCS mode code, there's no need
+for GLFW itself to support it.
+
+[MBCS]: https://msdn.microsoft.com/en-us/library/5z097dxa.aspx
+
+
+### Support for versions of Windows older than XP {#moving_windows}
+
+All explicit support for version of Windows older than XP has been removed.
+There is no code that actively prevents GLFW 3 from running on these earlier
+versions, but it uses Win32 functions that those versions lack.
+
+Windows XP was released in 2001, and by now (January 2015) it has not only
+replaced almost all earlier versions of Windows, but is itself rapidly being
+replaced by Windows 7 and 8. The MSDN library doesn't even provide
+documentation for version older than Windows 2000, making it difficult to
+maintain compatibility with these versions even if it was deemed worth the
+effort.
+
+The Win32 API has also not stood still, and GLFW 3 uses many functions only
+present on Windows XP or later. Even supporting an OS as new as XP (new
+from the perspective of GLFW 2, which still supports Windows 95) requires
+runtime checking for a number of functions that are present only on modern
+version of Windows.
+
+
+### Capture of system-wide hotkeys {#moving_syskeys}
+
+The ability to disable and capture system-wide hotkeys like Alt+Tab has been
+removed. Modern applications, whether they're games, scientific visualisations
+or something else, are nowadays expected to be good desktop citizens and allow
+these hotkeys to function even when running in full screen mode.
+
+
+### Automatic termination {#moving_terminate}
+
+GLFW 3 does not register @ref glfwTerminate with `atexit` at initialization,
+because `exit` calls registered functions from the calling thread and while it
+is permitted to call `exit` from any thread, @ref glfwTerminate must only be
+called from the main thread.
+
+To release all resources allocated by GLFW, you should call @ref glfwTerminate
+yourself, from the main thread, before the program terminates. Note that this
+destroys all windows not already destroyed with @ref glfwDestroyWindow,
+invalidating any window handles you may still have.
+
+
+### GLU header inclusion {#moving_glu}
+
+GLFW 3 does not by default include the GLU header and GLU itself has been
+deprecated by [Khronos][]. __New projects should not use GLU__, but if you need
+it for legacy code that has been moved to GLFW 3, you can request that the GLFW
+header includes it by defining @ref GLFW_INCLUDE_GLU before the inclusion of the
+GLFW header.
+
+[Khronos]: https://en.wikipedia.org/wiki/Khronos_Group
+
+__Old syntax__
+```c
+#include
+```
+
+__New syntax__
+```c
+#define GLFW_INCLUDE_GLU
+#include
+```
+
+There are many libraries that offer replacements for the functionality offered
+by GLU. For the matrix helper functions, see math libraries like [GLM][] (for
+C++), [linmath.h][] (for C) and others. For the tessellation functions, see for
+example [libtess2][].
+
+[GLM]: https://github.com/g-truc/glm
+[linmath.h]: https://github.com/datenwolf/linmath.h
+[libtess2]: https://github.com/memononen/libtess2
+
+
+## Name change tables {#moving_tables}
+
+
+### Renamed functions {#moving_renamed_functions}
+
+| GLFW 2 | GLFW 3 | Notes |
+| --------------------------- | ----------------------------- | ----- |
+| `glfwOpenWindow` | @ref glfwCreateWindow | All channel bit depths are now hints
+| `glfwCloseWindow` | @ref glfwDestroyWindow | |
+| `glfwOpenWindowHint` | @ref glfwWindowHint | Now accepts all `GLFW_*_BITS` tokens |
+| `glfwEnable` | @ref glfwSetInputMode | |
+| `glfwDisable` | @ref glfwSetInputMode | |
+| `glfwGetMousePos` | @ref glfwGetCursorPos | |
+| `glfwSetMousePos` | @ref glfwSetCursorPos | |
+| `glfwSetMousePosCallback` | @ref glfwSetCursorPosCallback | |
+| `glfwSetMouseWheelCallback` | @ref glfwSetScrollCallback | Accepts two-dimensional scroll offsets as doubles |
+| `glfwGetJoystickPos` | @ref glfwGetJoystickAxes | |
+| `glfwGetWindowParam` | @ref glfwGetWindowAttrib | |
+| `glfwGetGLVersion` | @ref glfwGetWindowAttrib | Use `GLFW_CONTEXT_VERSION_MAJOR`, `GLFW_CONTEXT_VERSION_MINOR` and `GLFW_CONTEXT_REVISION` |
+| `glfwGetDesktopMode` | @ref glfwGetVideoMode | Returns the current mode of a monitor |
+| `glfwGetJoystickParam` | @ref glfwJoystickPresent | The axis and button counts are provided by @ref glfwGetJoystickAxes and @ref glfwGetJoystickButtons |
+
+
+### Renamed types {#moving_renamed_types}
+
+| GLFW 2 | GLFW 3 | Notes |
+| ------------------- | --------------------- | |
+| `GLFWmousewheelfun` | @ref GLFWscrollfun | |
+| `GLFWmouseposfun` | @ref GLFWcursorposfun | |
+
+
+### Renamed tokens {#moving_renamed_tokens}
+
+| GLFW 2 | GLFW 3 | Notes |
+| --------------------------- | ---------------------------- | ----- |
+| `GLFW_OPENGL_VERSION_MAJOR` | `GLFW_CONTEXT_VERSION_MAJOR` | Renamed as it applies to OpenGL ES as well |
+| `GLFW_OPENGL_VERSION_MINOR` | `GLFW_CONTEXT_VERSION_MINOR` | Renamed as it applies to OpenGL ES as well |
+| `GLFW_FSAA_SAMPLES` | `GLFW_SAMPLES` | Renamed to match the OpenGL API |
+| `GLFW_ACTIVE` | `GLFW_FOCUSED` | Renamed to match the window focus callback |
+| `GLFW_WINDOW_NO_RESIZE` | `GLFW_RESIZABLE` | The default has been inverted |
+| `GLFW_MOUSE_CURSOR` | `GLFW_CURSOR` | Used with @ref glfwSetInputMode |
+| `GLFW_KEY_ESC` | `GLFW_KEY_ESCAPE` | |
+| `GLFW_KEY_DEL` | `GLFW_KEY_DELETE` | |
+| `GLFW_KEY_PAGEUP` | `GLFW_KEY_PAGE_UP` | |
+| `GLFW_KEY_PAGEDOWN` | `GLFW_KEY_PAGE_DOWN` | |
+| `GLFW_KEY_KP_NUM_LOCK` | `GLFW_KEY_NUM_LOCK` | |
+| `GLFW_KEY_LCTRL` | `GLFW_KEY_LEFT_CONTROL` | |
+| `GLFW_KEY_LSHIFT` | `GLFW_KEY_LEFT_SHIFT` | |
+| `GLFW_KEY_LALT` | `GLFW_KEY_LEFT_ALT` | |
+| `GLFW_KEY_LSUPER` | `GLFW_KEY_LEFT_SUPER` | |
+| `GLFW_KEY_RCTRL` | `GLFW_KEY_RIGHT_CONTROL` | |
+| `GLFW_KEY_RSHIFT` | `GLFW_KEY_RIGHT_SHIFT` | |
+| `GLFW_KEY_RALT` | `GLFW_KEY_RIGHT_ALT` | |
+| `GLFW_KEY_RSUPER` | `GLFW_KEY_RIGHT_SUPER` | |
+
diff --git a/external/GLFW/docs/news.md b/external/GLFW/docs/news.md
new file mode 100644
index 0000000..f752ce4
--- /dev/null
+++ b/external/GLFW/docs/news.md
@@ -0,0 +1,72 @@
+# Release notes for version 3.5 {#news}
+
+[TOC]
+
+
+## New features {#features}
+
+### Unlimited mouse buttons {#unlimited_mouse_buttons}
+
+GLFW now has an input mode which allows an unlimited number of mouse buttons to
+be reported by the mouse buttton callback, rather than just the associated
+[mouse button tokens](@ref buttons). This allows using mouse buttons with
+values over 8. For compatibility with older versions, the
+@ref GLFW_UNLIMITED_MOUSE_BUTTONS input mode needs to be set to make use of
+this.
+
+
+### EGLConfig native access function {#eglconfig}
+
+GLFW now provides the @ref glfwGetEGLConfig native access function for querying
+the `EGLConfig` of a window that has a `EGLSurface`.
+
+
+### GLXFBConfig native access function {#glxfbconfig}
+
+GLFW now provides the @ref glfwGetGLXFBConfig native access function for
+querying the `GLXFBConfig` of a window that has a `GLXWindow`.
+
+
+## Caveats {#caveats}
+
+## Deprecations {#deprecations}
+
+## Removals {#removals}
+
+### Windows XP and Vista support has been removed {#winxp_vista}
+
+Support for Windows XP and Vista has been removed. Windows XP has been out of extended
+support since 2014.
+
+
+### Original MinGW support has been removed {#original_mingw}
+
+Support for the now unmaintained original MinGW distribution has been removed.
+
+This does not apply to the much more capable [MinGW-w64](https://www.mingw-w64.org/),
+which remains fully supported. MinGW-w64 can build both 32- and 64-bit binaries, is
+actively maintained and available on many platforms.
+
+
+## New symbols {#new_symbols}
+
+### New functions {#new_functions}
+
+ - @ref glfwGetEGLConfig
+ - @ref glfwGetGLXFBConfig
+
+
+### New types {#new_types}
+
+### New constants {#new_constants}
+
+- @ref GLFW_UNLIMITED_MOUSE_BUTTONS
+
+## Release notes for earlier versions {#news_archive}
+
+- [Release notes for 3.4](https://www.glfw.org/docs/3.4/news.html)
+- [Release notes for 3.3](https://www.glfw.org/docs/3.3/news.html)
+- [Release notes for 3.2](https://www.glfw.org/docs/3.2/news.html)
+- [Release notes for 3.1](https://www.glfw.org/docs/3.1/news.html)
+- [Release notes for 3.0](https://www.glfw.org/docs/3.0/news.html)
+
diff --git a/external/GLFW/docs/quick.md b/external/GLFW/docs/quick.md
new file mode 100644
index 0000000..6f487fc
--- /dev/null
+++ b/external/GLFW/docs/quick.md
@@ -0,0 +1,365 @@
+# Getting started {#quick_guide}
+
+[TOC]
+
+This guide takes you through writing a small application using GLFW 3. The
+application will create a window and OpenGL context, render a rotating triangle
+and exit when the user closes the window or presses _Escape_. This guide will
+introduce a few of the most commonly used functions, but there are many more.
+
+This guide assumes no experience with earlier versions of GLFW. If you
+have used GLFW 2 in the past, read @ref moving_guide, as some functions
+behave differently in GLFW 3.
+
+
+## Step by step {#quick_steps}
+
+### Including the GLFW header {#quick_include}
+
+In the source files of your application where you use GLFW, you need to include
+its header file.
+
+```c
+#include
+```
+
+This header provides all the constants, types and function prototypes of the
+GLFW API.
+
+By default it also includes the OpenGL header from your development environment.
+On some platforms this header only supports older versions of OpenGL. The most
+extreme case is Windows, where it typically only supports OpenGL 1.2.
+
+Most programs will instead use an
+[extension loader library](@ref context_glext_auto) and include its header.
+This example uses files generated by [glad](https://gen.glad.sh/). The GLFW
+header can detect most such headers if they are included first and will then not
+include the one from your development environment.
+
+```c
+#include
+#include
+```
+
+To make sure there will be no header conflicts, you can define @ref
+GLFW_INCLUDE_NONE before the GLFW header to explicitly disable inclusion of the
+development environment header. This also allows the two headers to be included
+in any order.
+
+```c
+#define GLFW_INCLUDE_NONE
+#include
+#include
+```
+
+
+### Initializing and terminating GLFW {#quick_init_term}
+
+Before you can use most GLFW functions, the library must be initialized. On
+successful initialization, `GLFW_TRUE` is returned. If an error occurred,
+`GLFW_FALSE` is returned.
+
+```c
+if (!glfwInit())
+{
+ // Initialization failed
+}
+```
+
+Note that `GLFW_TRUE` and `GLFW_FALSE` are and will always be one and zero.
+
+When you are done using GLFW, typically just before the application exits, you
+need to terminate GLFW.
+
+```c
+glfwTerminate();
+```
+
+This destroys any remaining windows and releases any other resources allocated by
+GLFW. After this call, you must initialize GLFW again before using any GLFW
+functions that require it.
+
+
+### Setting an error callback {#quick_capture_error}
+
+Most events are reported through callbacks, whether it's a key being pressed,
+a GLFW window being moved, or an error occurring. Callbacks are C functions (or
+C++ static methods) that are called by GLFW with arguments describing the event.
+
+In case a GLFW function fails, an error is reported to the GLFW error callback.
+You can receive these reports with an error callback. This function must have
+the signature below but may do anything permitted in other callbacks.
+
+```c
+void error_callback(int error, const char* description)
+{
+ fprintf(stderr, "Error: %s\n", description);
+}
+```
+
+Callback functions must be set, so GLFW knows to call them. The function to set
+the error callback is one of the few GLFW functions that may be called before
+initialization, which lets you be notified of errors both during and after
+initialization.
+
+```c
+glfwSetErrorCallback(error_callback);
+```
+
+
+### Creating a window and context {#quick_create_window}
+
+The window and its OpenGL context are created with a single call to @ref
+glfwCreateWindow, which returns a handle to the created combined window and
+context object
+
+```c
+GLFWwindow* window = glfwCreateWindow(640, 480, "My Title", NULL, NULL);
+if (!window)
+{
+ // Window or OpenGL context creation failed
+}
+```
+
+This creates a 640 by 480 windowed mode window with an OpenGL context. If
+window or OpenGL context creation fails, `NULL` will be returned. You should
+always check the return value. While window creation rarely fails, context
+creation depends on properly installed drivers and may fail even on machines
+with the necessary hardware.
+
+By default, the OpenGL context GLFW creates may have any version. You can
+require a minimum OpenGL version by setting the `GLFW_CONTEXT_VERSION_MAJOR` and
+`GLFW_CONTEXT_VERSION_MINOR` hints _before_ creation. If the required minimum
+version is not supported on the machine, context (and window) creation fails.
+
+You can select the OpenGL profile by setting the `GLFW_OPENGL_PROFILE` hint.
+This program uses the core profile as that is the only profile macOS supports
+for OpenGL 3.x and 4.x.
+
+```c
+glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
+glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
+glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
+GLFWwindow* window = glfwCreateWindow(640, 480, "My Title", NULL, NULL);
+if (!window)
+{
+ // Window or context creation failed
+}
+```
+
+When a window and context is no longer needed, destroy it.
+
+```c
+glfwDestroyWindow(window);
+```
+
+Once this function is called, no more events will be delivered for that window
+and its handle becomes invalid.
+
+
+### Making the OpenGL context current {#quick_context_current}
+
+Before you can use the OpenGL API, you must have a current OpenGL context.
+
+```c
+glfwMakeContextCurrent(window);
+```
+
+The context will remain current until you make another context current or until
+the window owning the current context is destroyed.
+
+If you are using an [extension loader library](@ref context_glext_auto) to
+access modern OpenGL then this is when to initialize it, as the loader needs
+a current context to load from. This example uses
+[glad](https://github.com/Dav1dde/glad), but the same rule applies to all such
+libraries.
+
+```c
+gladLoadGL(glfwGetProcAddress);
+```
+
+
+### Checking the window close flag {#quick_window_close}
+
+Each window has a flag indicating whether the window should be closed.
+
+When the user attempts to close the window, either by pressing the close widget
+in the title bar or using a key combination like Alt+F4, this flag is set to 1.
+Note that __the window isn't actually closed__, so you are expected to monitor
+this flag and either destroy the window or give some kind of feedback to the
+user.
+
+```c
+while (!glfwWindowShouldClose(window))
+{
+ // Keep running
+}
+```
+
+You can be notified when the user is attempting to close the window by setting
+a close callback with @ref glfwSetWindowCloseCallback. The callback will be
+called immediately after the close flag has been set.
+
+You can also set it yourself with @ref glfwSetWindowShouldClose. This can be
+useful if you want to interpret other kinds of input as closing the window, like
+for example pressing the _Escape_ key.
+
+
+### Receiving input events {#quick_key_input}
+
+Each window has a large number of callbacks that can be set to receive all the
+various kinds of events. To receive key press and release events, create a key
+callback function.
+
+```c
+static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
+{
+ if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
+ glfwSetWindowShouldClose(window, GLFW_TRUE);
+}
+```
+
+The key callback, like other window related callbacks, are set per-window.
+
+```c
+glfwSetKeyCallback(window, key_callback);
+```
+
+In order for event callbacks to be called when events occur, you need to process
+events as described below.
+
+
+### Rendering with OpenGL {#quick_render}
+
+Once you have a current OpenGL context, you can use OpenGL normally. In this
+tutorial, a multicolored rotating triangle will be rendered. The framebuffer
+size needs to be retrieved for `glViewport`.
+
+```c
+int width, height;
+glfwGetFramebufferSize(window, &width, &height);
+glViewport(0, 0, width, height);
+```
+
+You can also set a framebuffer size callback using @ref
+glfwSetFramebufferSizeCallback and be notified when the size changes.
+
+The details of how to render with OpenGL is outside the scope of this tutorial,
+but there are many excellent resources for learning modern OpenGL. Here are
+a few of them:
+
+ - [Anton's OpenGL 4 Tutorials](https://antongerdelan.net/opengl/)
+ - [Learn OpenGL](https://learnopengl.com/)
+ - [Open.GL](https://open.gl/)
+
+These all happen to use GLFW, but OpenGL itself works the same whatever API you
+use to create the window and context.
+
+
+### Reading the timer {#quick_timer}
+
+To create smooth animation, a time source is needed. GLFW provides a timer that
+returns the number of seconds since initialization. The time source used is the
+most accurate on each platform and generally has micro- or nanosecond
+resolution.
+
+```c
+double time = glfwGetTime();
+```
+
+
+### Swapping buffers {#quick_swap_buffers}
+
+GLFW windows by default use double buffering. That means that each window has
+two rendering buffers; a front buffer and a back buffer. The front buffer is
+the one being displayed and the back buffer the one you render to.
+
+When the entire frame has been rendered, the buffers need to be swapped with one
+another, so the back buffer becomes the front buffer and vice versa.
+
+```c
+glfwSwapBuffers(window);
+```
+
+The swap interval indicates how many frames to wait until swapping the buffers,
+commonly known as _vsync_. By default, the swap interval is zero, meaning
+buffer swapping will occur immediately. On fast machines, many of those frames
+will never be seen, as the screen is still only updated typically 60-75 times
+per second, so this wastes a lot of CPU and GPU cycles.
+
+Also, because the buffers will be swapped in the middle the screen update,
+leading to [screen tearing](https://en.wikipedia.org/wiki/Screen_tearing).
+
+For these reasons, applications will typically want to set the swap interval to
+one. It can be set to higher values, but this is usually not recommended,
+because of the input latency it leads to.
+
+```c
+glfwSwapInterval(1);
+```
+
+This function acts on the current context and will fail unless a context is
+current.
+
+
+### Processing events {#quick_process_events}
+
+GLFW needs to communicate regularly with the window system both in order to
+receive events and to show that the application hasn't locked up. Event
+processing must be done regularly while you have visible windows and is normally
+done each frame after buffer swapping.
+
+There are two methods for processing pending events; polling and waiting. This
+example will use event polling, which processes only those events that have
+already been received and then returns immediately.
+
+```c
+glfwPollEvents();
+```
+
+This is the best choice when rendering continually, like most games do. If
+instead you only need to update your rendering once you have received new input,
+@ref glfwWaitEvents is a better choice. It waits until at least one event has
+been received, putting the thread to sleep in the meantime, and then processes
+all received events. This saves a great deal of CPU cycles and is useful for,
+for example, many kinds of editing tools.
+
+
+## Putting it together {#quick_example}
+
+Now that you know how to initialize GLFW, create a window and poll for
+keyboard input, it's possible to create a small program.
+
+This program creates a 640 by 480 windowed mode window and starts a loop that
+clears the screen, renders a triangle and processes events until the user either
+presses _Escape_ or closes the window.
+
+@snippet triangle-opengl.c code
+
+The program above can be found in the [source package][download] as
+`examples/triangle-opengl.c` and is compiled along with all other examples when
+you build GLFW. If you built GLFW from the source package then you already have
+this as `triangle-opengl.exe` on Windows, `triangle-opengl` on Linux or
+`triangle-opengl.app` on macOS.
+
+[download]: https://www.glfw.org/download.html
+
+This tutorial used only a few of the many functions GLFW provides. There are
+guides for each of the areas covered by GLFW. Each guide will introduce all the
+functions for that category.
+
+ - @ref intro_guide
+ - @ref window_guide
+ - @ref context_guide
+ - @ref monitor_guide
+ - @ref input_guide
+
+You can access reference documentation for any GLFW function by clicking it and
+the reference for each function links to related functions and guide sections.
+
+The tutorial ends here. Once you have written a program that uses GLFW, you
+will need to compile and link it. How to do that depends on the development
+environment you are using and is best explained by the documentation for that
+environment. To learn about the details that are specific to GLFW, see
+@ref build_guide.
+
diff --git a/external/GLFW/docs/spaces.svg b/external/GLFW/docs/spaces.svg
index 562fa8b..5b32646 100644
--- a/external/GLFW/docs/spaces.svg
+++ b/external/GLFW/docs/spaces.svg
@@ -13,7 +13,7 @@
height="327.98221"
id="svg2"
version="1.1"
- inkscape:version="0.48.4 r9939"
+ inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
sodipodi:docname="spaces.svg">
@@ -38,11 +38,11 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="2.5611424"
- inkscape:cx="344.24359"
- inkscape:cy="163.9911"
+ inkscape:zoom="1.8110012"
+ inkscape:cx="320.68941"
+ inkscape:cy="159.80509"
inkscape:document-units="px"
- inkscape:current-layer="svg2"
+ inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1920"
inkscape:window-height="1021"
@@ -475,18 +475,18 @@
inkscape:export-ydpi="109.89113" />
+ y="340.20465"
+ style="font-size:12px;line-height:1.25;font-family:sans-serif">
@@ -647,74 +647,6 @@
style="font-size:10px"
id="path3239" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -868,5 +800,78 @@
style="font-size:5px"
id="path3161" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/external/GLFW/docs/vulkan.md b/external/GLFW/docs/vulkan.md
new file mode 100644
index 0000000..48fa79f
--- /dev/null
+++ b/external/GLFW/docs/vulkan.md
@@ -0,0 +1,250 @@
+# Vulkan guide {#vulkan_guide}
+
+[TOC]
+
+This guide is intended to fill the gaps between the official [Vulkan
+resources](https://www.khronos.org/vulkan/) and the rest of the GLFW
+documentation and is not a replacement for either. It assumes some familiarity
+with Vulkan concepts like loaders, devices, queues and surfaces and leaves it to
+the Vulkan documentation to explain the details of Vulkan functions.
+
+To develop for Vulkan you should download the [LunarG Vulkan
+SDK](https://vulkan.lunarg.com/) for your platform. Apart from headers and link
+libraries, they also provide the validation layers necessary for development.
+
+The [Vulkan Tutorial](https://vulkan-tutorial.com/) has more information on how
+to use GLFW and Vulkan. The [Khronos Vulkan
+Samples](https://github.com/KhronosGroup/Vulkan-Samples) also use GLFW, although
+with a small framework in between.
+
+For details on a specific Vulkan support function, see the @ref vulkan. There
+are also guides for the other areas of the GLFW API.
+
+ - @ref intro_guide
+ - @ref window_guide
+ - @ref context_guide
+ - @ref monitor_guide
+ - @ref input_guide
+
+
+## Finding the Vulkan loader {#vulkan_loader}
+
+GLFW itself does not ever need to be linked against the Vulkan loader.
+
+By default, GLFW will load the Vulkan loader dynamically at runtime via its standard name:
+`vulkan-1.dll` on Windows, `libvulkan.so.1` on Linux and other Unix-like systems and
+`libvulkan.1.dylib` on macOS.
+
+__macOS:__ GLFW will also look up and search the `Frameworks` subdirectory of your
+application bundle.
+
+If your code is using a Vulkan loader with a different name or in a non-standard location
+you will need to direct GLFW to it. Pass your version of `vkGetInstanceProcAddr` to @ref
+glfwInitVulkanLoader before initializing GLFW and it will use that function for all Vulkan
+entry point retrieval. This prevents GLFW from dynamically loading the Vulkan loader.
+
+```c
+glfwInitVulkanLoader(vkGetInstanceProcAddr);
+```
+
+__macOS:__ To make your application be redistributable you will need to set up the application
+bundle according to the LunarG SDK documentation. This is explained in more detail in the
+[SDK documentation for macOS](https://vulkan.lunarg.com/doc/sdk/latest/mac/getting_started.html).
+
+
+## Including the Vulkan header file {#vulkan_include}
+
+To have GLFW include the Vulkan header, define @ref GLFW_INCLUDE_VULKAN before including
+the GLFW header.
+
+```c
+#define GLFW_INCLUDE_VULKAN
+#include
+```
+
+If you instead want to include the Vulkan header from a custom location or use
+your own custom Vulkan header then do this before the GLFW header.
+
+```c
+#include
+#include
+```
+
+Unless a Vulkan header is included, either by the GLFW header or above it, the following
+GLFW functions will not be declared, as depend on Vulkan types.
+
+ - @ref glfwInitVulkanLoader
+ - @ref glfwGetInstanceProcAddress
+ - @ref glfwGetPhysicalDevicePresentationSupport
+ - @ref glfwCreateWindowSurface
+
+The `VK_USE_PLATFORM_*_KHR` macros do not need to be defined for the Vulkan part
+of GLFW to work. Define them only if you are using these extensions directly.
+
+
+## Querying for Vulkan support {#vulkan_support}
+
+If you are linking directly against the Vulkan loader then you can skip this
+section. The canonical desktop loader library exports all Vulkan core and
+Khronos extension functions, allowing them to be called directly.
+
+If you are loading the Vulkan loader dynamically instead of linking directly
+against it, you can check for the availability of a loader and ICD with @ref
+glfwVulkanSupported.
+
+```c
+if (glfwVulkanSupported())
+{
+ // Vulkan is available, at least for compute
+}
+```
+
+This function returns `GLFW_TRUE` if the Vulkan loader and any minimally
+functional ICD was found.
+
+If one or both were not found, calling any other Vulkan related GLFW function
+will generate a @ref GLFW_API_UNAVAILABLE error.
+
+
+### Querying Vulkan function pointers {#vulkan_proc}
+
+To load any Vulkan core or extension function from the found loader, call @ref
+glfwGetInstanceProcAddress. To load functions needed for instance creation,
+pass `NULL` as the instance.
+
+```c
+PFN_vkCreateInstance pfnCreateInstance = (PFN_vkCreateInstance)
+ glfwGetInstanceProcAddress(NULL, "vkCreateInstance");
+```
+
+Once you have created an instance, you can load from it all other Vulkan core
+functions and functions from any instance extensions you enabled.
+
+```c
+PFN_vkCreateDevice pfnCreateDevice = (PFN_vkCreateDevice)
+ glfwGetInstanceProcAddress(instance, "vkCreateDevice");
+```
+
+This function in turn calls `vkGetInstanceProcAddr`. If that fails, the
+function falls back to a platform-specific query of the Vulkan loader (i.e.
+`dlsym` or `GetProcAddress`). If that also fails, the function returns `NULL`.
+For more information about `vkGetInstanceProcAddr`, see the Vulkan
+documentation.
+
+Vulkan also provides `vkGetDeviceProcAddr` for loading device-specific versions
+of Vulkan function. This function can be retrieved from an instance with @ref
+glfwGetInstanceProcAddress.
+
+```c
+PFN_vkGetDeviceProcAddr pfnGetDeviceProcAddr = (PFN_vkGetDeviceProcAddr)
+ glfwGetInstanceProcAddress(instance, "vkGetDeviceProcAddr");
+```
+
+Device-specific functions may execute a little faster, due to not having to
+dispatch internally based on the device passed to them. For more information
+about `vkGetDeviceProcAddr`, see the Vulkan documentation.
+
+
+## Querying required Vulkan extensions {#vulkan_ext}
+
+To do anything useful with Vulkan you need to create an instance. If you want
+to use Vulkan to render to a window, you must enable the instance extensions
+GLFW requires to create Vulkan surfaces.
+
+To query the instance extensions required, call @ref
+glfwGetRequiredInstanceExtensions.
+
+```c
+uint32_t count;
+const char** extensions = glfwGetRequiredInstanceExtensions(&count);
+```
+
+These extensions must all be enabled when creating instances that are going to
+be passed to @ref glfwGetPhysicalDevicePresentationSupport and @ref
+glfwCreateWindowSurface. The set of extensions will vary depending on platform
+and may also vary depending on graphics drivers and other factors.
+
+If it fails it will return `NULL` and GLFW will not be able to create Vulkan
+window surfaces. You can still use Vulkan for off-screen rendering and compute
+work.
+
+If successful the returned array will always include `VK_KHR_surface`, so if
+you don't require any additional extensions you can pass this list directly to
+the `VkInstanceCreateInfo` struct.
+
+```c
+VkInstanceCreateInfo ici;
+
+memset(&ici, 0, sizeof(ici));
+ici.enabledExtensionCount = count;
+ici.ppEnabledExtensionNames = extensions;
+...
+```
+
+Additional extensions may be required by future versions of GLFW. You should
+check whether any extensions you wish to enable are already in the returned
+array, as it is an error to specify an extension more than once in the
+`VkInstanceCreateInfo` struct.
+
+__macOS:__ MoltenVK is (as of July 2022) not yet a fully conformant implementation
+of Vulkan. As of Vulkan SDK 1.3.216.0, this means you must also enable the
+`VK_KHR_portability_enumeration` instance extension and set the
+`VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR` bit in the instance creation
+info flags for MoltenVK to show up in the list of physical devices. For more
+information, see the Vulkan and MoltenVK documentation.
+
+
+## Querying for Vulkan presentation support {#vulkan_present}
+
+Not every queue family of every Vulkan device can present images to surfaces.
+To check whether a specific queue family of a physical device supports image
+presentation without first having to create a window and surface, call @ref
+glfwGetPhysicalDevicePresentationSupport.
+
+```c
+if (glfwGetPhysicalDevicePresentationSupport(instance, physical_device, queue_family_index))
+{
+ // Queue family supports image presentation
+}
+```
+
+The `VK_KHR_surface` extension additionally provides the
+`vkGetPhysicalDeviceSurfaceSupportKHR` function, which performs the same test on
+an existing Vulkan surface.
+
+
+## Creating the window {#vulkan_window}
+
+Unless you will be using OpenGL or OpenGL ES with the same window as Vulkan,
+there is no need to create a context. You can disable context creation with the
+[GLFW_CLIENT_API](@ref GLFW_CLIENT_API_hint) hint.
+
+```c
+glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
+GLFWwindow* window = glfwCreateWindow(640, 480, "Window Title", NULL, NULL);
+```
+
+See @ref context_less for more information.
+
+
+## Creating a Vulkan window surface {#vulkan_surface}
+
+You can create a Vulkan surface (as defined by the `VK_KHR_surface` extension)
+for a GLFW window with @ref glfwCreateWindowSurface.
+
+```c
+VkSurfaceKHR surface;
+VkResult err = glfwCreateWindowSurface(instance, window, NULL, &surface);
+if (err)
+{
+ // Window surface creation failed
+}
+```
+
+If an OpenGL or OpenGL ES context was created on the window, the context has
+ownership of the presentation on the window and a Vulkan surface cannot be
+created.
+
+It is your responsibility to destroy the surface. GLFW does not destroy it for
+you. Call `vkDestroySurfaceKHR` function from the same extension to destroy it.
+
diff --git a/external/GLFW/docs/window.md b/external/GLFW/docs/window.md
new file mode 100644
index 0000000..2140f09
--- /dev/null
+++ b/external/GLFW/docs/window.md
@@ -0,0 +1,1542 @@
+# Window guide {#window_guide}
+
+[TOC]
+
+This guide introduces the window related functions of GLFW. For details on
+a specific function in this category, see the @ref window. There are also
+guides for the other areas of GLFW.
+
+ - @ref intro_guide
+ - @ref context_guide
+ - @ref vulkan_guide
+ - @ref monitor_guide
+ - @ref input_guide
+
+
+## Window objects {#window_object}
+
+The @ref GLFWwindow object encapsulates both a window and a context. They are
+created with @ref glfwCreateWindow and destroyed with @ref glfwDestroyWindow, or
+@ref glfwTerminate, if any remain. As the window and context are inseparably
+linked, the object pointer is used as both a context and window handle.
+
+To see the event stream provided to the various window related callbacks, run
+the `events` test program.
+
+
+### Window creation {#window_creation}
+
+A window and its OpenGL or OpenGL ES context are created with @ref
+glfwCreateWindow, which returns a handle to the created window object. For
+example, this creates a 640 by 480 windowed mode window:
+
+```c
+GLFWwindow* window = glfwCreateWindow(640, 480, "My Title", NULL, NULL);
+```
+
+If window creation fails, `NULL` will be returned, so it is necessary to check
+the return value.
+
+The window handle is passed to all window related functions and is provided to
+along with all input events, so event handlers can tell which window received
+the event.
+
+
+#### Full screen windows {#window_full_screen}
+
+To create a full screen window, you need to specify which monitor the window
+should use. In most cases, the user's primary monitor is a good choice.
+For more information about retrieving monitors, see @ref monitor_monitors.
+
+```c
+GLFWwindow* window = glfwCreateWindow(640, 480, "My Title", glfwGetPrimaryMonitor(), NULL);
+```
+
+Full screen windows cover the entire display area of a monitor, have no border
+or decorations.
+
+Windowed mode windows can be made full screen by setting a monitor with @ref
+glfwSetWindowMonitor, and full screen ones can be made windowed by unsetting it
+with the same function.
+
+Each field of the @ref GLFWvidmode structure corresponds to a function parameter
+or window hint and combine to form the _desired video mode_ for that window.
+The supported video mode most closely matching the desired video mode will be
+set for the chosen monitor as long as the window has input focus. For more
+information about retrieving video modes, see @ref monitor_modes.
+
+Video mode field | Corresponds to
+---------------- | --------------
+GLFWvidmode.width | `width` parameter of @ref glfwCreateWindow
+GLFWvidmode.height | `height` parameter of @ref glfwCreateWindow
+GLFWvidmode.redBits | @ref GLFW_RED_BITS hint
+GLFWvidmode.greenBits | @ref GLFW_GREEN_BITS hint
+GLFWvidmode.blueBits | @ref GLFW_BLUE_BITS hint
+GLFWvidmode.refreshRate | @ref GLFW_REFRESH_RATE hint
+
+Once you have a full screen window, you can change its resolution, refresh rate
+and monitor with @ref glfwSetWindowMonitor. If you only need change its
+resolution you can also call @ref glfwSetWindowSize. In all cases, the new
+video mode will be selected the same way as the video mode chosen by @ref
+glfwCreateWindow. If the window has an OpenGL or OpenGL ES context, it will be
+unaffected.
+
+By default, the original video mode of the monitor will be restored and the
+window iconified if it loses input focus, to allow the user to switch back to
+the desktop. This behavior can be disabled with the
+[GLFW_AUTO_ICONIFY](@ref GLFW_AUTO_ICONIFY_hint) window hint, for example if you
+wish to simultaneously cover multiple monitors with full screen windows.
+
+If a monitor is disconnected, all windows that are full screen on that monitor
+will be switched to windowed mode. See @ref monitor_event for more information.
+
+
+#### "Windowed full screen" windows {#window_windowed_full_screen}
+
+If the closest match for the desired video mode is the current one, the video
+mode will not be changed, making window creation faster and application
+switching much smoother. This is sometimes called _windowed full screen_ or
+_borderless full screen_ window and counts as a full screen window. To create
+such a window, request the current video mode.
+
+```c
+const GLFWvidmode* mode = glfwGetVideoMode(monitor);
+
+glfwWindowHint(GLFW_RED_BITS, mode->redBits);
+glfwWindowHint(GLFW_GREEN_BITS, mode->greenBits);
+glfwWindowHint(GLFW_BLUE_BITS, mode->blueBits);
+glfwWindowHint(GLFW_REFRESH_RATE, mode->refreshRate);
+
+GLFWwindow* window = glfwCreateWindow(mode->width, mode->height, "My Title", monitor, NULL);
+```
+
+This also works for windowed mode windows that are made full screen.
+
+```c
+const GLFWvidmode* mode = glfwGetVideoMode(monitor);
+
+glfwSetWindowMonitor(window, monitor, 0, 0, mode->width, mode->height, mode->refreshRate);
+```
+
+Note that @ref glfwGetVideoMode returns the _current_ video mode of a monitor,
+so if you already have a full screen window on that monitor that you want to
+make windowed full screen, you need to have saved the desktop resolution before.
+
+
+### Window destruction {#window_destruction}
+
+When a window is no longer needed, destroy it with @ref glfwDestroyWindow.
+
+```c
+glfwDestroyWindow(window);
+```
+
+Window destruction always succeeds. Before the actual destruction, all
+callbacks are removed so no further events will be delivered for the window.
+All windows remaining when @ref glfwTerminate is called are destroyed as well.
+
+When a full screen window is destroyed, the original video mode of its monitor
+is restored, but the gamma ramp is left untouched.
+
+
+### Window creation hints {#window_hints}
+
+There are a number of hints that can be set before the creation of a window and
+context. Some affect the window itself, others affect the framebuffer or
+context. These hints are set to their default values each time the library is
+initialized with @ref glfwInit. Integer value hints can be set individually
+with @ref glfwWindowHint and string value hints with @ref glfwWindowHintString.
+You can reset all at once to their defaults with @ref glfwDefaultWindowHints.
+
+Some hints are platform specific. These are always valid to set on any
+platform but they will only affect their specific platform. Other platforms
+will ignore them. Setting these hints requires no platform specific headers or
+calls.
+
+@note Window hints need to be set before the creation of the window and context
+you wish to have the specified attributes. They function as additional
+arguments to @ref glfwCreateWindow.
+
+
+#### Hard and soft constraints {#window_hints_hard}
+
+Some window hints are hard constraints. These must match the available
+capabilities _exactly_ for window and context creation to succeed. Hints
+that are not hard constraints are matched as closely as possible, but the
+resulting context and framebuffer may differ from what these hints requested.
+
+The following hints are always hard constraints:
+- @ref GLFW_STEREO
+- @ref GLFW_DOUBLEBUFFER
+- [GLFW_CLIENT_API](@ref GLFW_CLIENT_API_hint)
+- [GLFW_CONTEXT_CREATION_API](@ref GLFW_CONTEXT_CREATION_API_hint)
+
+The following additional hints are hard constraints when requesting an OpenGL
+context, but are ignored when requesting an OpenGL ES context:
+- [GLFW_OPENGL_FORWARD_COMPAT](@ref GLFW_OPENGL_FORWARD_COMPAT_hint)
+- [GLFW_OPENGL_PROFILE](@ref GLFW_OPENGL_PROFILE_hint)
+
+
+#### Window related hints {#window_hints_wnd}
+
+@anchor GLFW_RESIZABLE_hint
+__GLFW_RESIZABLE__ specifies whether the windowed mode window will be resizable
+_by the user_. The window will still be resizable using the @ref
+glfwSetWindowSize function. Possible values are `GLFW_TRUE` and `GLFW_FALSE`.
+This hint is ignored for full screen and undecorated windows.
+
+@anchor GLFW_VISIBLE_hint
+__GLFW_VISIBLE__ specifies whether the windowed mode window will be initially
+visible. Possible values are `GLFW_TRUE` and `GLFW_FALSE`. This hint is
+ignored for full screen windows.
+
+@anchor GLFW_DECORATED_hint
+__GLFW_DECORATED__ specifies whether the windowed mode window will have window
+decorations such as a border, a close widget, etc. An undecorated window will
+not be resizable by the user but will still allow the user to generate close
+events on some platforms. Possible values are `GLFW_TRUE` and `GLFW_FALSE`.
+This hint is ignored for full screen windows.
+
+@anchor GLFW_FOCUSED_hint
+__GLFW_FOCUSED__ specifies whether the windowed mode window will be given input
+focus when created. Possible values are `GLFW_TRUE` and `GLFW_FALSE`. This
+hint is ignored for full screen and initially hidden windows.
+
+@anchor GLFW_AUTO_ICONIFY_hint
+__GLFW_AUTO_ICONIFY__ specifies whether the full screen window will
+automatically iconify and restore the previous video mode on input focus loss.
+Possible values are `GLFW_TRUE` and `GLFW_FALSE`. This hint is ignored for
+windowed mode windows.
+
+@anchor GLFW_FLOATING_hint
+__GLFW_FLOATING__ specifies whether the windowed mode window will be floating
+above other regular windows, also called topmost or always-on-top. This is
+intended primarily for debugging purposes and cannot be used to implement proper
+full screen windows. Possible values are `GLFW_TRUE` and `GLFW_FALSE`. This
+hint is ignored for full screen windows.
+
+@anchor GLFW_MAXIMIZED_hint
+__GLFW_MAXIMIZED__ specifies whether the windowed mode window will be maximized
+when created. Possible values are `GLFW_TRUE` and `GLFW_FALSE`. This hint is
+ignored for full screen windows.
+
+@anchor GLFW_CENTER_CURSOR_hint
+__GLFW_CENTER_CURSOR__ specifies whether the cursor should be centered over
+newly created full screen windows. Possible values are `GLFW_TRUE` and
+`GLFW_FALSE`. This hint is ignored for windowed mode windows.
+
+@anchor GLFW_TRANSPARENT_FRAMEBUFFER_hint
+__GLFW_TRANSPARENT_FRAMEBUFFER__ specifies whether the window framebuffer will
+be transparent. If enabled and supported by the system, the window framebuffer
+alpha channel will be used to combine the framebuffer with the background. This
+does not affect window decorations. Possible values are `GLFW_TRUE` and
+`GLFW_FALSE`.
+
+@anchor GLFW_FOCUS_ON_SHOW_hint
+__GLFW_FOCUS_ON_SHOW__ specifies whether the window will be given input
+focus when @ref glfwShowWindow is called. Possible values are `GLFW_TRUE` and
+`GLFW_FALSE`.
+
+@anchor GLFW_SCALE_TO_MONITOR
+__GLFW_SCALE_TO_MONITOR__ specified whether the window content area should be
+resized based on [content scale](@ref window_scale) changes. This can be
+because of a global user settings change or because the window was moved to
+a monitor with different scale settings.
+
+This hint only has an effect on platforms where screen coordinates and pixels
+always map 1:1, such as Windows and X11. On platforms like macOS the resolution
+of the framebuffer can change independently of the window size.
+
+@anchor GLFW_SCALE_FRAMEBUFFER_hint
+@anchor GLFW_COCOA_RETINA_FRAMEBUFFER_hint
+__GLFW_SCALE_FRAMEBUFFER__ specifies whether the framebuffer should be resized
+based on [content scale](@ref window_scale) changes. This can be
+because of a global user settings change or because the window was moved to
+a monitor with different scale settings.
+
+This hint only has an effect on platforms where screen coordinates can be scaled
+relative to pixel coordinates, such as macOS and Wayland. On platforms like
+Windows and X11 the framebuffer and window content area sizes always map 1:1.
+
+This is the new name, introduced in GLFW 3.4. The older
+`GLFW_COCOA_RETINA_FRAMEBUFFER` name is also available for compatibility. Both
+names modify the same hint value.
+
+@anchor GLFW_MOUSE_PASSTHROUGH_hint
+__GLFW_MOUSE_PASSTHROUGH__ specifies whether the window is transparent to mouse
+input, letting any mouse events pass through to whatever window is behind it.
+This is only supported for undecorated windows. Decorated windows with this
+enabled will behave differently between platforms. Possible values are
+`GLFW_TRUE` and `GLFW_FALSE`.
+
+@anchor GLFW_POSITION_X
+@anchor GLFW_POSITION_Y
+__GLFW_POSITION_X__ and __GLFW_POSITION_Y__ specify the desired initial position
+of the window. The window manager may modify or ignore these coordinates. If
+either or both of these hints are set to `GLFW_ANY_POSITION` then the window
+manager will position the window where it thinks the user will prefer it.
+Possible values are any valid screen coordinates and `GLFW_ANY_POSITION`.
+
+
+#### Framebuffer related hints {#window_hints_fb}
+
+@anchor GLFW_RED_BITS
+@anchor GLFW_GREEN_BITS
+@anchor GLFW_BLUE_BITS
+@anchor GLFW_ALPHA_BITS
+@anchor GLFW_DEPTH_BITS
+@anchor GLFW_STENCIL_BITS
+__GLFW_RED_BITS__, __GLFW_GREEN_BITS__, __GLFW_BLUE_BITS__, __GLFW_ALPHA_BITS__,
+__GLFW_DEPTH_BITS__ and __GLFW_STENCIL_BITS__ specify the desired bit depths of
+the various components of the default framebuffer. A value of `GLFW_DONT_CARE`
+means the application has no preference.
+
+@anchor GLFW_ACCUM_RED_BITS
+@anchor GLFW_ACCUM_GREEN_BITS
+@anchor GLFW_ACCUM_BLUE_BITS
+@anchor GLFW_ACCUM_ALPHA_BITS
+__GLFW_ACCUM_RED_BITS__, __GLFW_ACCUM_GREEN_BITS__, __GLFW_ACCUM_BLUE_BITS__ and
+__GLFW_ACCUM_ALPHA_BITS__ specify the desired bit depths of the various
+components of the accumulation buffer. A value of `GLFW_DONT_CARE` means the
+application has no preference.
+
+Accumulation buffers are a legacy OpenGL feature and should not be used in new
+code.
+
+@anchor GLFW_AUX_BUFFERS
+__GLFW_AUX_BUFFERS__ specifies the desired number of auxiliary buffers. A value
+of `GLFW_DONT_CARE` means the application has no preference.
+
+Auxiliary buffers are a legacy OpenGL feature and should not be used in new
+code.
+
+@anchor GLFW_STEREO
+__GLFW_STEREO__ specifies whether to use OpenGL stereoscopic rendering.
+Possible values are `GLFW_TRUE` and `GLFW_FALSE`. This is a hard constraint.
+
+@anchor GLFW_SAMPLES
+__GLFW_SAMPLES__ specifies the desired number of samples to use for
+multisampling. Zero disables multisampling. A value of `GLFW_DONT_CARE` means
+the application has no preference.
+
+@anchor GLFW_SRGB_CAPABLE
+__GLFW_SRGB_CAPABLE__ specifies whether the framebuffer should be sRGB capable.
+Possible values are `GLFW_TRUE` and `GLFW_FALSE`.
+
+@note __OpenGL:__ If enabled and supported by the system, the
+`GL_FRAMEBUFFER_SRGB` enable will control sRGB rendering. By default, sRGB
+rendering will be disabled.
+
+@note __OpenGL ES:__ If enabled and supported by the system, the context will
+always have sRGB rendering enabled.
+
+@anchor GLFW_DOUBLEBUFFER
+@anchor GLFW_DOUBLEBUFFER_hint
+__GLFW_DOUBLEBUFFER__ specifies whether the framebuffer should be double
+buffered. You nearly always want to use double buffering. This is a hard
+constraint. Possible values are `GLFW_TRUE` and `GLFW_FALSE`.
+
+
+#### Monitor related hints {#window_hints_mtr}
+
+@anchor GLFW_REFRESH_RATE
+__GLFW_REFRESH_RATE__ specifies the desired refresh rate for full screen
+windows. A value of `GLFW_DONT_CARE` means the highest available refresh rate
+will be used. This hint is ignored for windowed mode windows.
+
+
+#### Context related hints {#window_hints_ctx}
+
+@anchor GLFW_CLIENT_API_hint
+__GLFW_CLIENT_API__ specifies which client API to create the context for.
+Possible values are `GLFW_OPENGL_API`, `GLFW_OPENGL_ES_API` and `GLFW_NO_API`.
+This is a hard constraint.
+
+@anchor GLFW_CONTEXT_CREATION_API_hint
+__GLFW_CONTEXT_CREATION_API__ specifies which context creation API to use to
+create the context. Possible values are `GLFW_NATIVE_CONTEXT_API`,
+`GLFW_EGL_CONTEXT_API` and `GLFW_OSMESA_CONTEXT_API`. This is a hard
+constraint. If no client API is requested, this hint is ignored.
+
+An [extension loader library](@ref context_glext_auto) that assumes it knows
+which API was used to create the current context may fail if you change this
+hint. This can be resolved by having it load functions via @ref
+glfwGetProcAddress.
+
+@note __Wayland:__ The EGL API _is_ the native context creation API, so this hint
+will have no effect.
+
+@note __X11:__ On some Linux systems, creating contexts via both the native and EGL
+APIs in a single process will cause the application to segfault. Stick to one
+API or the other on Linux for now.
+
+@note __OSMesa:__ As its name implies, an OpenGL context created with OSMesa
+does not update the window contents when its buffers are swapped. Use OpenGL
+functions or the OSMesa native access functions @ref glfwGetOSMesaColorBuffer
+and @ref glfwGetOSMesaDepthBuffer to retrieve the framebuffer contents.
+
+@anchor GLFW_CONTEXT_VERSION_MAJOR_hint
+@anchor GLFW_CONTEXT_VERSION_MINOR_hint
+__GLFW_CONTEXT_VERSION_MAJOR__ and __GLFW_CONTEXT_VERSION_MINOR__ specify the
+client API version that the created context must be compatible with. The exact
+behavior of these hints depend on the requested client API.
+
+While there is no way to ask the driver for a context of the highest supported
+version, GLFW will attempt to provide this when you ask for a version 1.0
+context, which is the default for these hints.
+
+Do not confuse these hints with @ref GLFW_VERSION_MAJOR and @ref
+GLFW_VERSION_MINOR, which provide the API version of the GLFW header.
+
+@note __OpenGL:__ These hints are not hard constraints, but creation will fail
+if the OpenGL version of the created context is less than the one requested. It
+is therefore perfectly safe to use the default of version 1.0 for legacy code
+and you will still get backwards-compatible contexts of version 3.0 and above
+when available.
+
+@note __OpenGL ES:__ These hints are not hard constraints, but creation will
+fail if the OpenGL ES version of the created context is less than the one
+requested. Additionally, OpenGL ES 1.x cannot be returned if 2.0 or later was
+requested, and vice versa. This is because OpenGL ES 3.x is backward compatible
+with 2.0, but OpenGL ES 2.0 is not backward compatible with 1.x.
+
+@note __macOS:__ The OS only supports core profile contexts for OpenGL versions 3.2
+and later. Before creating an OpenGL context of version 3.2 or later you must
+set the [GLFW_OPENGL_PROFILE](@ref GLFW_OPENGL_PROFILE_hint) hint accordingly.
+OpenGL 3.0 and 3.1 contexts are not supported at all on macOS.
+
+@anchor GLFW_OPENGL_FORWARD_COMPAT_hint
+__GLFW_OPENGL_FORWARD_COMPAT__ specifies whether the OpenGL context should be
+forward-compatible, i.e. one where all functionality deprecated in the requested
+version of OpenGL is removed. This must only be used if the requested OpenGL
+version is 3.0 or above. If OpenGL ES is requested, this hint is ignored.
+
+Forward-compatibility is described in detail in the
+[OpenGL Reference Manual](https://www.opengl.org/registry/).
+
+@anchor GLFW_CONTEXT_DEBUG_hint
+@anchor GLFW_OPENGL_DEBUG_CONTEXT_hint
+__GLFW_CONTEXT_DEBUG__ specifies whether the context should be created in debug
+mode, which may provide additional error and diagnostic reporting functionality.
+Possible values are `GLFW_TRUE` and `GLFW_FALSE`.
+
+Debug contexts for OpenGL and OpenGL ES are described in detail by the
+[GL_KHR_debug][] extension.
+
+[GL_KHR_debug]: https://www.khronos.org/registry/OpenGL/extensions/KHR/KHR_debug.txt
+
+@note `GLFW_CONTEXT_DEBUG` is the new name introduced in GLFW 3.4. The older
+`GLFW_OPENGL_DEBUG_CONTEXT` name is also available for compatibility.
+
+@anchor GLFW_OPENGL_PROFILE_hint
+__GLFW_OPENGL_PROFILE__ specifies which OpenGL profile to create the context
+for. Possible values are one of `GLFW_OPENGL_CORE_PROFILE` or
+`GLFW_OPENGL_COMPAT_PROFILE`, or `GLFW_OPENGL_ANY_PROFILE` to not request
+a specific profile. If requesting an OpenGL version below 3.2,
+`GLFW_OPENGL_ANY_PROFILE` must be used. If OpenGL ES is requested, this hint
+is ignored.
+
+OpenGL profiles are described in detail in the
+[OpenGL Reference Manual](https://www.opengl.org/registry/).
+
+@anchor GLFW_CONTEXT_ROBUSTNESS_hint
+__GLFW_CONTEXT_ROBUSTNESS__ specifies the robustness strategy to be used by the
+context. This can be one of `GLFW_NO_RESET_NOTIFICATION` or
+`GLFW_LOSE_CONTEXT_ON_RESET`, or `GLFW_NO_ROBUSTNESS` to not request
+a robustness strategy.
+
+@anchor GLFW_CONTEXT_RELEASE_BEHAVIOR_hint
+__GLFW_CONTEXT_RELEASE_BEHAVIOR__ specifies the release behavior to be
+used by the context. Possible values are one of `GLFW_ANY_RELEASE_BEHAVIOR`,
+`GLFW_RELEASE_BEHAVIOR_FLUSH` or `GLFW_RELEASE_BEHAVIOR_NONE`. If the
+behavior is `GLFW_ANY_RELEASE_BEHAVIOR`, the default behavior of the context
+creation API will be used. If the behavior is `GLFW_RELEASE_BEHAVIOR_FLUSH`,
+the pipeline will be flushed whenever the context is released from being the
+current one. If the behavior is `GLFW_RELEASE_BEHAVIOR_NONE`, the pipeline will
+not be flushed on release.
+
+Context release behaviors are described in detail by the
+[GL_KHR_context_flush_control][] extension.
+
+[GL_KHR_context_flush_control]: https://www.opengl.org/registry/specs/KHR/context_flush_control.txt
+
+@anchor GLFW_CONTEXT_NO_ERROR_hint
+__GLFW_CONTEXT_NO_ERROR__ specifies whether errors should be generated by the
+context. Possible values are `GLFW_TRUE` and `GLFW_FALSE`. If enabled,
+situations that would have generated errors instead cause undefined behavior.
+
+The no error mode for OpenGL and OpenGL ES is described in detail by the
+[GL_KHR_no_error][] extension.
+
+[GL_KHR_no_error]: https://www.opengl.org/registry/specs/KHR/no_error.txt
+
+
+#### Win32 specific hints {#window_hints_win32}
+
+@anchor GLFW_WIN32_KEYBOARD_MENU_hint
+__GLFW_WIN32_KEYBOARD_MENU__ specifies whether to allow access to the window
+menu via the Alt+Space and Alt-and-then-Space keyboard shortcuts. This is
+ignored on other platforms.
+
+@anchor GLFW_WIN32_SHOWDEFAULT_hint
+__GLFW_WIN32_SHOWDEFAULT__ specifies whether to show the window the way
+specified in the program's `STARTUPINFO` when it is shown for the first time.
+This is the same information as the `Run` option in the shortcut properties
+window. If this information was not specified when the program was started,
+GLFW behaves as if this hint was set to `GLFW_FALSE`. Possible values are
+`GLFW_TRUE` and `GLFW_FALSE`. This is ignored on other platforms.
+
+
+#### macOS specific hints {#window_hints_osx}
+
+@anchor GLFW_COCOA_FRAME_NAME_hint
+__GLFW_COCOA_FRAME_NAME__ specifies the UTF-8 encoded name to use for autosaving
+the window frame, or if empty disables frame autosaving for the window. This is
+ignored on other platforms. This is set with @ref glfwWindowHintString.
+
+@anchor GLFW_COCOA_GRAPHICS_SWITCHING_hint
+__GLFW_COCOA_GRAPHICS_SWITCHING__ specifies whether to in Automatic Graphics
+Switching, i.e. to allow the system to choose the integrated GPU for the OpenGL
+context and move it between GPUs if necessary or whether to force it to always
+run on the discrete GPU. This only affects systems with both integrated and
+discrete GPUs. Possible values are `GLFW_TRUE` and `GLFW_FALSE`. This is
+ignored on other platforms.
+
+Simpler programs and tools may want to enable this to save power, while games
+and other applications performing advanced rendering will want to leave it
+disabled.
+
+A bundled application that wishes to participate in Automatic Graphics Switching
+should also declare this in its `Info.plist` by setting the
+`NSSupportsAutomaticGraphicsSwitching` key to `true`.
+
+
+#### Wayland specific window hints {#window_hints_wayland}
+
+@anchor GLFW_WAYLAND_APP_ID_hint
+__GLFW_WAYLAND_APP_ID__ specifies the Wayland app_id for a window, used
+by window managers to identify types of windows. This is set with
+@ref glfwWindowHintString.
+
+
+#### X11 specific window hints {#window_hints_x11}
+
+@anchor GLFW_X11_CLASS_NAME_hint
+@anchor GLFW_X11_INSTANCE_NAME_hint
+__GLFW_X11_CLASS_NAME__ and __GLFW_X11_INSTANCE_NAME__ specifies the desired
+ASCII encoded class and instance parts of the ICCCM `WM_CLASS` window property. Both
+hints need to be set to something other than an empty string for them to take effect.
+These are set with @ref glfwWindowHintString.
+
+
+#### Supported and default values {#window_hints_values}
+
+Window hint | Default value | Supported values
+----------------------------- | --------------------------- | ----------------
+GLFW_RESIZABLE | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
+GLFW_VISIBLE | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
+GLFW_DECORATED | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
+GLFW_FOCUSED | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
+GLFW_AUTO_ICONIFY | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
+GLFW_FLOATING | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE`
+GLFW_MAXIMIZED | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE`
+GLFW_CENTER_CURSOR | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
+GLFW_TRANSPARENT_FRAMEBUFFER | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE`
+GLFW_FOCUS_ON_SHOW | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
+GLFW_SCALE_TO_MONITOR | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE`
+GLFW_SCALE_FRAMEBUFFER | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
+GLFW_MOUSE_PASSTHROUGH | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE`
+GLFW_POSITION_X | `GLFW_ANY_POSITION` | Any valid screen x-coordinate or `GLFW_ANY_POSITION`
+GLFW_POSITION_Y | `GLFW_ANY_POSITION` | Any valid screen y-coordinate or `GLFW_ANY_POSITION`
+GLFW_RED_BITS | 8 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
+GLFW_GREEN_BITS | 8 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
+GLFW_BLUE_BITS | 8 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
+GLFW_ALPHA_BITS | 8 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
+GLFW_DEPTH_BITS | 24 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
+GLFW_STENCIL_BITS | 8 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
+GLFW_ACCUM_RED_BITS | 0 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
+GLFW_ACCUM_GREEN_BITS | 0 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
+GLFW_ACCUM_BLUE_BITS | 0 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
+GLFW_ACCUM_ALPHA_BITS | 0 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
+GLFW_AUX_BUFFERS | 0 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
+GLFW_SAMPLES | 0 | 0 to `INT_MAX` or `GLFW_DONT_CARE`
+GLFW_REFRESH_RATE | `GLFW_DONT_CARE` | 0 to `INT_MAX` or `GLFW_DONT_CARE`
+GLFW_STEREO | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE`
+GLFW_SRGB_CAPABLE | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE`
+GLFW_DOUBLEBUFFER | `GLFW_TRUE` | `GLFW_TRUE` or `GLFW_FALSE`
+GLFW_CLIENT_API | `GLFW_OPENGL_API` | `GLFW_OPENGL_API`, `GLFW_OPENGL_ES_API` or `GLFW_NO_API`
+GLFW_CONTEXT_CREATION_API | `GLFW_NATIVE_CONTEXT_API` | `GLFW_NATIVE_CONTEXT_API`, `GLFW_EGL_CONTEXT_API` or `GLFW_OSMESA_CONTEXT_API`
+GLFW_CONTEXT_VERSION_MAJOR | 1 | Any valid major version number of the chosen client API
+GLFW_CONTEXT_VERSION_MINOR | 0 | Any valid minor version number of the chosen client API
+GLFW_CONTEXT_ROBUSTNESS | `GLFW_NO_ROBUSTNESS` | `GLFW_NO_ROBUSTNESS`, `GLFW_NO_RESET_NOTIFICATION` or `GLFW_LOSE_CONTEXT_ON_RESET`
+GLFW_CONTEXT_RELEASE_BEHAVIOR | `GLFW_ANY_RELEASE_BEHAVIOR` | `GLFW_ANY_RELEASE_BEHAVIOR`, `GLFW_RELEASE_BEHAVIOR_FLUSH` or `GLFW_RELEASE_BEHAVIOR_NONE`
+GLFW_OPENGL_FORWARD_COMPAT | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE`
+GLFW_CONTEXT_DEBUG | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE`
+GLFW_OPENGL_PROFILE | `GLFW_OPENGL_ANY_PROFILE` | `GLFW_OPENGL_ANY_PROFILE`, `GLFW_OPENGL_COMPAT_PROFILE` or `GLFW_OPENGL_CORE_PROFILE`
+GLFW_WIN32_KEYBOARD_MENU | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE`
+GLFW_WIN32_SHOWDEFAULT | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE`
+GLFW_COCOA_FRAME_NAME | `""` | A UTF-8 encoded frame autosave name
+GLFW_COCOA_GRAPHICS_SWITCHING | `GLFW_FALSE` | `GLFW_TRUE` or `GLFW_FALSE`
+GLFW_WAYLAND_APP_ID | `""` | An ASCII encoded Wayland `app_id` name
+GLFW_X11_CLASS_NAME | `""` | An ASCII encoded `WM_CLASS` class name
+GLFW_X11_INSTANCE_NAME | `""` | An ASCII encoded `WM_CLASS` instance name
+
+
+## Window event processing {#window_events}
+
+See @ref events.
+
+
+## Window properties and events {#window_properties}
+
+### User pointer {#window_userptr}
+
+Each window has a user pointer that can be set with @ref
+glfwSetWindowUserPointer and queried with @ref glfwGetWindowUserPointer. This
+can be used for any purpose you need and will not be modified by GLFW throughout
+the life-time of the window.
+
+The initial value of the pointer is `NULL`.
+
+
+### Window closing and close flag {#window_close}
+
+When the user attempts to close the window, for example by clicking the close
+widget or using a key chord like Alt+F4, the _close flag_ of the window is set.
+The window is however not actually destroyed and, unless you watch for this
+state change, nothing further happens.
+
+The current state of the close flag is returned by @ref glfwWindowShouldClose
+and can be set or cleared directly with @ref glfwSetWindowShouldClose. A common
+pattern is to use the close flag as a main loop condition.
+
+```c
+while (!glfwWindowShouldClose(window))
+{
+ render(window);
+
+ glfwSwapBuffers(window);
+ glfwPollEvents();
+}
+```
+
+If you wish to be notified when the user attempts to close a window, set a close
+callback.
+
+```c
+glfwSetWindowCloseCallback(window, window_close_callback);
+```
+
+The callback function is called directly _after_ the close flag has been set.
+It can be used for example to filter close requests and clear the close flag
+again unless certain conditions are met.
+
+```c
+void window_close_callback(GLFWwindow* window)
+{
+ if (!time_to_close)
+ glfwSetWindowShouldClose(window, GLFW_FALSE);
+}
+```
+
+
+### Window size {#window_size}
+
+The size of a window can be changed with @ref glfwSetWindowSize. For windowed
+mode windows, this sets the size, in
+[screen coordinates](@ref coordinate_systems) of the _content area_ or _content
+area_ of the window. The window system may impose limits on window size.
+
+```c
+glfwSetWindowSize(window, 640, 480);
+```
+
+For full screen windows, the specified size becomes the new resolution of the
+window's desired video mode. The video mode most closely matching the new
+desired video mode is set immediately. The window is resized to fit the
+resolution of the set video mode.
+
+If you wish to be notified when a window is resized, whether by the user, the
+system or your own code, set a size callback.
+
+```c
+glfwSetWindowSizeCallback(window, window_size_callback);
+```
+
+The callback function receives the new size, in screen coordinates, of the
+content area of the window when the window is resized.
+
+```c
+void window_size_callback(GLFWwindow* window, int width, int height)
+{
+}
+```
+
+There is also @ref glfwGetWindowSize for directly retrieving the current size of
+a window.
+
+```c
+int width, height;
+glfwGetWindowSize(window, &width, &height);
+```
+
+@note Do not pass the window size to `glViewport` or other pixel-based OpenGL
+calls. The window size is in screen coordinates, not pixels. Use the
+[framebuffer size](@ref window_fbsize), which is in pixels, for pixel-based
+calls.
+
+The above functions work with the size of the content area, but decorated
+windows typically have title bars and window frames around this rectangle. You
+can retrieve the extents of these with @ref glfwGetWindowFrameSize.
+
+```c
+int left, top, right, bottom;
+glfwGetWindowFrameSize(window, &left, &top, &right, &bottom);
+```
+
+The returned values are the distances, in screen coordinates, from the edges of
+the content area to the corresponding edges of the full window. As they are
+distances and not coordinates, they are always zero or positive.
+
+
+### Framebuffer size {#window_fbsize}
+
+While the size of a window is measured in screen coordinates, OpenGL works with
+pixels. The size you pass into `glViewport`, for example, should be in pixels.
+On some machines screen coordinates and pixels are the same, but on others they
+will not be. There is a second set of functions to retrieve the size, in
+pixels, of the framebuffer of a window.
+
+If you wish to be notified when the framebuffer of a window is resized, whether
+by the user or the system, set a size callback.
+
+```c
+glfwSetFramebufferSizeCallback(window, framebuffer_size_callback);
+```
+
+The callback function receives the new size of the framebuffer when it is
+resized, which can for example be used to update the OpenGL viewport.
+
+```c
+void framebuffer_size_callback(GLFWwindow* window, int width, int height)
+{
+ glViewport(0, 0, width, height);
+}
+```
+
+There is also @ref glfwGetFramebufferSize for directly retrieving the current
+size of the framebuffer of a window.
+
+```c
+int width, height;
+glfwGetFramebufferSize(window, &width, &height);
+glViewport(0, 0, width, height);
+```
+
+The size of a framebuffer may change independently of the size of a window, for
+example if the window is dragged between a regular monitor and a high-DPI one.
+
+
+### Window content scale {#window_scale}
+
+The content scale for a window can be retrieved with @ref
+glfwGetWindowContentScale.
+
+```c
+float xscale, yscale;
+glfwGetWindowContentScale(window, &xscale, &yscale);
+```
+
+The content scale can be thought of as the ratio between the current DPI and the
+platform's default DPI. It is intended to be a scaling factor to apply to the
+pixel dimensions of text and other UI elements. If the dimensions scaled by
+this factor looks appropriate on your machine then it should appear at
+a reasonable size on other machines with different DPI and scaling settings.
+
+This relies on the DPI and scaling settings on both machines being appropriate.
+
+The content scale may depend on both the monitor resolution and pixel density
+and on user settings like DPI or a scaling percentage. It may be very different
+from the raw DPI calculated from the physical size and current resolution.
+
+On systems where each monitors can have its own content scale, the window
+content scale will depend on which monitor or monitors the system considers the
+window to be "on".
+
+If you wish to be notified when the content scale of a window changes, whether
+because of a system setting change or because it was moved to a monitor with
+a different scale, set a content scale callback.
+
+```c
+glfwSetWindowContentScaleCallback(window, window_content_scale_callback);
+```
+
+The callback function receives the new content scale of the window.
+
+```c
+void window_content_scale_callback(GLFWwindow* window, float xscale, float yscale)
+{
+ set_interface_scale(xscale, yscale);
+}
+```
+
+On platforms where pixels and screen coordinates always map 1:1, the window
+will need to be resized to appear the same size when it is moved to a monitor
+with a different content scale. To have this done automatically both when the
+window is created and when its content scale later changes, set the @ref
+GLFW_SCALE_TO_MONITOR window hint.
+
+On platforms where pixels do not necessarily equal screen coordinates, the
+framebuffer will instead need to be sized to provide a full resolution image
+for the window. When the window moves between monitors with different content
+scales, the window size will remain the same but the framebuffer size will
+change. This is done automatically by default. To disable this resizing, set
+the @ref GLFW_SCALE_FRAMEBUFFER window hint.
+
+Both of these hints also apply when the window is created. Every window starts
+out with a content scale of one. A window with one or both of these hints set
+will adapt to the appropriate scale in the process of being created, set up and
+shown.
+
+
+### Window size limits {#window_sizelimits}
+
+The minimum and maximum size of the content area of a windowed mode window can
+be enforced with @ref glfwSetWindowSizeLimits. The user may resize the window
+to any size and aspect ratio within the specified limits, unless the aspect
+ratio is also set.
+
+```c
+glfwSetWindowSizeLimits(window, 200, 200, 400, 400);
+```
+
+To specify only a minimum size or only a maximum one, set the other pair to
+`GLFW_DONT_CARE`.
+
+```c
+glfwSetWindowSizeLimits(window, 640, 480, GLFW_DONT_CARE, GLFW_DONT_CARE);
+```
+
+To disable size limits for a window, set them all to `GLFW_DONT_CARE`.
+
+The aspect ratio of the content area of a windowed mode window can be enforced
+with @ref glfwSetWindowAspectRatio. The user may resize the window freely
+unless size limits are also set, but the size will be constrained to maintain
+the aspect ratio.
+
+```c
+glfwSetWindowAspectRatio(window, 16, 9);
+```
+
+The aspect ratio is specified as a numerator and denominator, corresponding to
+the width and height, respectively. If you want a window to maintain its
+current aspect ratio, use its current size as the ratio.
+
+```c
+int width, height;
+glfwGetWindowSize(window, &width, &height);
+glfwSetWindowAspectRatio(window, width, height);
+```
+
+To disable the aspect ratio limit for a window, set both terms to
+`GLFW_DONT_CARE`.
+
+You can have both size limits and aspect ratio set for a window, but the results
+are undefined if they conflict.
+
+
+### Window position {#window_pos}
+
+By default, the window manager chooses the position of new windowed mode
+windows, based on its size and which monitor the user appears to be working on.
+This is most often the right choice. If you need to create a window at
+a specific position, you can set the desired position with the @ref
+GLFW_POSITION_X and @ref GLFW_POSITION_Y window hints.
+
+```c
+glfwWindowHint(GLFW_POSITION_X, 70);
+glfwWindowHint(GLFW_POSITION_Y, 83);
+```
+
+To restore the previous behavior, set these hints to `GLFW_ANY_POSITION`.
+
+The position of a windowed mode window can be changed with @ref
+glfwSetWindowPos. This moves the window so that the upper-left corner of its
+content area has the specified [screen coordinates](@ref coordinate_systems).
+The window system may put limitations on window placement.
+
+```c
+glfwSetWindowPos(window, 100, 100);
+```
+
+If you wish to be notified when a window is moved, whether by the user, the
+system or your own code, set a position callback.
+
+```c
+glfwSetWindowPosCallback(window, window_pos_callback);
+```
+
+The callback function receives the new position, in screen coordinates, of the
+upper-left corner of the content area when the window is moved.
+
+```c
+void window_pos_callback(GLFWwindow* window, int xpos, int ypos)
+{
+}
+```
+
+There is also @ref glfwGetWindowPos for directly retrieving the current position
+of the content area of the window.
+
+```c
+int xpos, ypos;
+glfwGetWindowPos(window, &xpos, &ypos);
+```
+
+@note __Wayland:__ An applications cannot know the positions of its windows or
+whether one has been moved. The @ref GLFW_POSITION_X and @ref GLFW_POSITION_Y
+window hints are ignored. The @ref glfwGetWindowPos and @ref glfwSetWindowPos
+functions emit @ref GLFW_FEATURE_UNAVAILABLE. The window position callback will
+not be called.
+
+
+### Window title {#window_title}
+
+All GLFW windows have a title, although undecorated or full screen windows may
+not display it or only display it in a task bar or similar interface. You can
+set a new UTF-8 encoded window title with @ref glfwSetWindowTitle.
+
+```c
+glfwSetWindowTitle(window, "My Window");
+```
+
+The specified string is copied before the function returns, so there is no need
+to keep it around.
+
+As long as your source file is encoded as UTF-8, you can use any Unicode
+characters directly in the source.
+
+```c
+glfwSetWindowTitle(window, "ラストエグザイル");
+```
+
+If you are using C++11 or C11, you can use a UTF-8 string literal.
+
+```c
+glfwSetWindowTitle(window, u8"This is always a UTF-8 string");
+```
+
+The current window title can be queried with @ref glfwGetWindowTitle.
+
+```c
+const char* title = glfwGetWindowTitle(window);
+```
+
+### Window icon {#window_icon}
+
+Decorated windows have icons on some platforms. You can set this icon by
+specifying a list of candidate images with @ref glfwSetWindowIcon.
+
+```c
+GLFWimage images[2];
+images[0] = load_icon("my_icon.png");
+images[1] = load_icon("my_icon_small.png");
+
+glfwSetWindowIcon(window, 2, images);
+```
+
+The image data is 32-bit, little-endian, non-premultiplied RGBA, i.e. eight bits
+per channel with the red channel first. The pixels are arranged canonically as
+sequential rows, starting from the top-left corner.
+
+To revert to the default window icon, pass in an empty image array.
+
+```c
+glfwSetWindowIcon(window, 0, NULL);
+```
+
+
+### Window monitor {#window_monitor}
+
+Full screen windows are associated with a specific monitor. You can get the
+handle for this monitor with @ref glfwGetWindowMonitor.
+
+```c
+GLFWmonitor* monitor = glfwGetWindowMonitor(window);
+```
+
+This monitor handle is one of those returned by @ref glfwGetMonitors.
+
+For windowed mode windows, this function returns `NULL`. This is how to tell
+full screen windows from windowed mode windows.
+
+You can move windows between monitors or between full screen and windowed mode
+with @ref glfwSetWindowMonitor. When making a window full screen on the same or
+on a different monitor, specify the desired monitor, resolution and refresh
+rate. The position arguments are ignored.
+
+```c
+const GLFWvidmode* mode = glfwGetVideoMode(monitor);
+
+glfwSetWindowMonitor(window, monitor, 0, 0, mode->width, mode->height, mode->refreshRate);
+```
+
+When making the window windowed, specify the desired position and size. The
+refresh rate argument is ignored.
+
+```c
+glfwSetWindowMonitor(window, NULL, xpos, ypos, width, height, 0);
+```
+
+This restores any previous window settings such as whether it is decorated,
+floating, resizable, has size or aspect ratio limits, etc.. To restore a window
+that was originally windowed to its original size and position, save these
+before making it full screen and then pass them in as above.
+
+
+### Window iconification {#window_iconify}
+
+Windows can be iconified (i.e. minimized) with @ref glfwIconifyWindow.
+
+```c
+glfwIconifyWindow(window);
+```
+
+When a full screen window is iconified, the original video mode of its monitor
+is restored until the user or application restores the window.
+
+Iconified windows can be restored with @ref glfwRestoreWindow. This function
+also restores windows from maximization.
+
+```c
+glfwRestoreWindow(window);
+```
+
+When a full screen window is restored, the desired video mode is restored to its
+monitor as well.
+
+If you wish to be notified when a window is iconified or restored, whether by
+the user, system or your own code, set an iconify callback.
+
+```c
+glfwSetWindowIconifyCallback(window, window_iconify_callback);
+```
+
+The callback function receives changes in the iconification state of the window.
+
+```c
+void window_iconify_callback(GLFWwindow* window, int iconified)
+{
+ if (iconified)
+ {
+ // The window was iconified
+ }
+ else
+ {
+ // The window was restored
+ }
+}
+```
+
+You can also get the current iconification state with @ref glfwGetWindowAttrib.
+
+```c
+int iconified = glfwGetWindowAttrib(window, GLFW_ICONIFIED);
+```
+
+@note __Wayland:__ An application cannot know if any of its windows have been
+iconified or restore one from iconification. The @ref glfwRestoreWindow
+function can only restore windows from maximization and the iconify callback
+will not be called. The [GLFW_ICONIFIED](@ref GLFW_ICONIFIED_attrib) attribute
+will be false. The @ref glfwIconifyWindow function works normally.
+
+
+### Window maximization {#window_maximize}
+
+Windows can be maximized (i.e. zoomed) with @ref glfwMaximizeWindow.
+
+```c
+glfwMaximizeWindow(window);
+```
+
+Full screen windows cannot be maximized and passing a full screen window to this
+function does nothing.
+
+Maximized windows can be restored with @ref glfwRestoreWindow. This function
+also restores windows from iconification.
+
+```c
+glfwRestoreWindow(window);
+```
+
+If you wish to be notified when a window is maximized or restored, whether by
+the user, system or your own code, set a maximize callback.
+
+```c
+glfwSetWindowMaximizeCallback(window, window_maximize_callback);
+```
+
+The callback function receives changes in the maximization state of the window.
+
+```c
+void window_maximize_callback(GLFWwindow* window, int maximized)
+{
+ if (maximized)
+ {
+ // The window was maximized
+ }
+ else
+ {
+ // The window was restored
+ }
+}
+```
+
+You can also get the current maximization state with @ref glfwGetWindowAttrib.
+
+```c
+int maximized = glfwGetWindowAttrib(window, GLFW_MAXIMIZED);
+```
+
+By default, newly created windows are not maximized. You can change this
+behavior by setting the [GLFW_MAXIMIZED](@ref GLFW_MAXIMIZED_hint) window hint
+before creating the window.
+
+```c
+glfwWindowHint(GLFW_MAXIMIZED, GLFW_TRUE);
+```
+
+
+### Window visibility {#window_hide}
+
+Windowed mode windows can be hidden with @ref glfwHideWindow.
+
+```c
+glfwHideWindow(window);
+```
+
+This makes the window completely invisible to the user, including removing it
+from the task bar, dock or window list. Full screen windows cannot be hidden
+and calling @ref glfwHideWindow on a full screen window does nothing.
+
+Hidden windows can be shown with @ref glfwShowWindow.
+
+```c
+glfwShowWindow(window);
+```
+
+By default, this function will also set the input focus to that window. Set
+the [GLFW_FOCUS_ON_SHOW](@ref GLFW_FOCUS_ON_SHOW_hint) window hint to change
+this behavior for all newly created windows, or change the behavior for an
+existing window with @ref glfwSetWindowAttrib.
+
+You can also get the current visibility state with @ref glfwGetWindowAttrib.
+
+```c
+int visible = glfwGetWindowAttrib(window, GLFW_VISIBLE);
+```
+
+By default, newly created windows are visible. You can change this behavior by
+setting the [GLFW_VISIBLE](@ref GLFW_VISIBLE_hint) window hint before creating
+the window.
+
+```c
+glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
+```
+
+Windows created hidden are completely invisible to the user until shown. This
+can be useful if you need to set up your window further before showing it, for
+example moving it to a specific location.
+
+
+### Window input focus {#window_focus}
+
+Windows can be given input focus and brought to the front with @ref
+glfwFocusWindow.
+
+```c
+glfwFocusWindow(window);
+```
+
+Keep in mind that it can be very disruptive to the user when a window is forced
+to the top. For a less disruptive way of getting the user's attention, see
+[attention requests](@ref window_attention).
+
+If you wish to be notified when a window gains or loses input focus, whether by
+the user, system or your own code, set a focus callback.
+
+```c
+glfwSetWindowFocusCallback(window, window_focus_callback);
+```
+
+The callback function receives changes in the input focus state of the window.
+
+```c
+void window_focus_callback(GLFWwindow* window, int focused)
+{
+ if (focused)
+ {
+ // The window gained input focus
+ }
+ else
+ {
+ // The window lost input focus
+ }
+}
+```
+
+You can also get the current input focus state with @ref glfwGetWindowAttrib.
+
+```c
+int focused = glfwGetWindowAttrib(window, GLFW_FOCUSED);
+```
+
+By default, newly created windows are given input focus. You can change this
+behavior by setting the [GLFW_FOCUSED](@ref GLFW_FOCUSED_hint) window hint
+before creating the window.
+
+```c
+glfwWindowHint(GLFW_FOCUSED, GLFW_FALSE);
+```
+
+
+### Window attention request {#window_attention}
+
+If you wish to notify the user of an event without interrupting, you can request
+attention with @ref glfwRequestWindowAttention.
+
+```c
+glfwRequestWindowAttention(window);
+```
+
+The system will highlight the specified window, or on platforms where this is
+not supported, the application as a whole. Once the user has given it
+attention, the system will automatically end the request.
+
+
+### Window damage and refresh {#window_refresh}
+
+If you wish to be notified when the contents of a window is damaged and needs
+to be refreshed, set a window refresh callback.
+
+```c
+glfwSetWindowRefreshCallback(m_handle, window_refresh_callback);
+```
+
+The callback function is called when the contents of the window needs to be
+refreshed.
+
+```c
+void window_refresh_callback(GLFWwindow* window)
+{
+ draw_editor_ui(window);
+ glfwSwapBuffers(window);
+}
+```
+
+@note On compositing window systems such as Aero, Compiz or Aqua, where the
+window contents are saved off-screen, this callback might only be called when
+the window or framebuffer is resized.
+
+
+### Window transparency {#window_transparency}
+
+GLFW supports two kinds of transparency for windows; framebuffer transparency
+and whole window transparency. A single window may not use both methods. The
+results of doing this are undefined.
+
+Both methods require the platform to support it and not every version of every
+platform GLFW supports does this, so there are mechanisms to check whether the
+window really is transparent.
+
+Window framebuffers can be made transparent on a per-pixel per-frame basis with
+the [GLFW_TRANSPARENT_FRAMEBUFFER](@ref GLFW_TRANSPARENT_FRAMEBUFFER_hint)
+window hint.
+
+```c
+glfwWindowHint(GLFW_TRANSPARENT_FRAMEBUFFER, GLFW_TRUE);
+```
+
+If supported by the system, the window content area will be composited with the
+background using the framebuffer per-pixel alpha channel. This requires desktop
+compositing to be enabled on the system. It does not affect window decorations.
+
+You can check whether the window framebuffer was successfully made transparent
+with the
+[GLFW_TRANSPARENT_FRAMEBUFFER](@ref GLFW_TRANSPARENT_FRAMEBUFFER_attrib)
+window attribute.
+
+```c
+if (glfwGetWindowAttrib(window, GLFW_TRANSPARENT_FRAMEBUFFER))
+{
+ // window framebuffer is currently transparent
+}
+```
+
+GLFW comes with an example that enabled framebuffer transparency called `gears`.
+
+The opacity of the whole window, including any decorations, can be set with @ref
+glfwSetWindowOpacity.
+
+```c
+glfwSetWindowOpacity(window, 0.5f);
+```
+
+The opacity (or alpha) value is a positive finite number between zero and one,
+where 0 (zero) is fully transparent and 1 (one) is fully opaque. The initial
+opacity value for newly created windows is 1.
+
+The current opacity of a window can be queried with @ref glfwGetWindowOpacity.
+
+```c
+float opacity = glfwGetWindowOpacity(window);
+```
+
+If the system does not support whole window transparency, this function always
+returns one.
+
+GLFW comes with a test program that lets you control whole window transparency
+at run-time called `window`.
+
+If you want to use either of these transparency methods to display a temporary
+overlay like for example a notification, the @ref GLFW_FLOATING and @ref
+GLFW_MOUSE_PASSTHROUGH window hints and attributes may be useful.
+
+
+### Window attributes {#window_attribs}
+
+Windows have a number of attributes that can be returned using @ref
+glfwGetWindowAttrib. Some reflect state that may change as a result of user
+interaction, (e.g. whether it has input focus), while others reflect inherent
+properties of the window (e.g. what kind of border it has). Some are related to
+the window and others to its OpenGL or OpenGL ES context.
+
+```c
+if (glfwGetWindowAttrib(window, GLFW_FOCUSED))
+{
+ // window has input focus
+}
+```
+
+The [GLFW_DECORATED](@ref GLFW_DECORATED_attrib),
+[GLFW_RESIZABLE](@ref GLFW_RESIZABLE_attrib),
+[GLFW_FLOATING](@ref GLFW_FLOATING_attrib),
+[GLFW_AUTO_ICONIFY](@ref GLFW_AUTO_ICONIFY_attrib) and
+[GLFW_FOCUS_ON_SHOW](@ref GLFW_FOCUS_ON_SHOW_attrib) window attributes can be
+changed with @ref glfwSetWindowAttrib.
+
+```c
+glfwSetWindowAttrib(window, GLFW_RESIZABLE, GLFW_FALSE);
+```
+
+
+
+#### Window related attributes {#window_attribs_wnd}
+
+@anchor GLFW_FOCUSED_attrib
+__GLFW_FOCUSED__ indicates whether the specified window has input focus. See
+@ref window_focus for details.
+
+@anchor GLFW_ICONIFIED_attrib
+__GLFW_ICONIFIED__ indicates whether the specified window is iconified.
+See @ref window_iconify for details.
+
+@anchor GLFW_MAXIMIZED_attrib
+__GLFW_MAXIMIZED__ indicates whether the specified window is maximized. See
+@ref window_maximize for details.
+
+@anchor GLFW_HOVERED_attrib
+__GLFW_HOVERED__ indicates whether the cursor is currently directly over the
+content area of the window, with no other windows between. See @ref
+cursor_enter for details.
+
+@anchor GLFW_VISIBLE_attrib
+__GLFW_VISIBLE__ indicates whether the specified window is visible. See @ref
+window_hide for details.
+
+@anchor GLFW_RESIZABLE_attrib
+__GLFW_RESIZABLE__ indicates whether the specified window is resizable _by the
+user_. This can be set before creation with the
+[GLFW_RESIZABLE](@ref GLFW_RESIZABLE_hint) window hint or after with @ref
+glfwSetWindowAttrib.
+
+@anchor GLFW_DECORATED_attrib
+__GLFW_DECORATED__ indicates whether the specified window has decorations such
+as a border, a close widget, etc. This can be set before creation with the
+[GLFW_DECORATED](@ref GLFW_DECORATED_hint) window hint or after with @ref
+glfwSetWindowAttrib.
+
+@anchor GLFW_AUTO_ICONIFY_attrib
+__GLFW_AUTO_ICONIFY__ indicates whether the specified full screen window is
+iconified on focus loss, a close widget, etc. This can be set before creation
+with the [GLFW_AUTO_ICONIFY](@ref GLFW_AUTO_ICONIFY_hint) window hint or after
+with @ref glfwSetWindowAttrib.
+
+@anchor GLFW_FLOATING_attrib
+__GLFW_FLOATING__ indicates whether the specified window is floating, also
+called topmost or always-on-top. This can be set before creation with the
+[GLFW_FLOATING](@ref GLFW_FLOATING_hint) window hint or after with @ref
+glfwSetWindowAttrib.
+
+@anchor GLFW_TRANSPARENT_FRAMEBUFFER_attrib
+__GLFW_TRANSPARENT_FRAMEBUFFER__ indicates whether the specified window has
+a transparent framebuffer, i.e. the window contents is composited with the
+background using the window framebuffer alpha channel. See @ref
+window_transparency for details.
+
+@anchor GLFW_FOCUS_ON_SHOW_attrib
+__GLFW_FOCUS_ON_SHOW__ specifies whether the window will be given input
+focus when @ref glfwShowWindow is called. This can be set before creation
+with the [GLFW_FOCUS_ON_SHOW](@ref GLFW_FOCUS_ON_SHOW_hint) window hint or
+after with @ref glfwSetWindowAttrib.
+
+@anchor GLFW_MOUSE_PASSTHROUGH_attrib
+__GLFW_MOUSE_PASSTHROUGH__ specifies whether the window is transparent to mouse
+input, letting any mouse events pass through to whatever window is behind it.
+This can be set before creation with the
+[GLFW_MOUSE_PASSTHROUGH](@ref GLFW_MOUSE_PASSTHROUGH_hint) window hint or after
+with @ref glfwSetWindowAttrib. This is only supported for undecorated windows.
+Decorated windows with this enabled will behave differently between platforms.
+
+
+#### Context related attributes {#window_attribs_ctx}
+
+@anchor GLFW_CLIENT_API_attrib
+__GLFW_CLIENT_API__ indicates the client API provided by the window's context;
+either `GLFW_OPENGL_API`, `GLFW_OPENGL_ES_API` or `GLFW_NO_API`.
+
+@anchor GLFW_CONTEXT_CREATION_API_attrib
+__GLFW_CONTEXT_CREATION_API__ indicates the context creation API used to create
+the window's context; either `GLFW_NATIVE_CONTEXT_API`, `GLFW_EGL_CONTEXT_API`
+or `GLFW_OSMESA_CONTEXT_API`.
+
+@anchor GLFW_CONTEXT_VERSION_MAJOR_attrib
+@anchor GLFW_CONTEXT_VERSION_MINOR_attrib
+@anchor GLFW_CONTEXT_REVISION_attrib
+__GLFW_CONTEXT_VERSION_MAJOR__, __GLFW_CONTEXT_VERSION_MINOR__ and
+__GLFW_CONTEXT_REVISION__ indicate the client API version of the window's
+context.
+
+@note Do not confuse these attributes with `GLFW_VERSION_MAJOR`,
+`GLFW_VERSION_MINOR` and `GLFW_VERSION_REVISION` which provide the API version
+of the GLFW header.
+
+@anchor GLFW_OPENGL_FORWARD_COMPAT_attrib
+__GLFW_OPENGL_FORWARD_COMPAT__ is `GLFW_TRUE` if the window's context is an
+OpenGL forward-compatible one, or `GLFW_FALSE` otherwise.
+
+@anchor GLFW_CONTEXT_DEBUG_attrib
+@anchor GLFW_OPENGL_DEBUG_CONTEXT_attrib
+__GLFW_CONTEXT_DEBUG__ is `GLFW_TRUE` if the window's context is in debug
+mode, or `GLFW_FALSE` otherwise.
+
+This is the new name, introduced in GLFW 3.4. The older
+`GLFW_OPENGL_DEBUG_CONTEXT` name is also available for compatibility.
+
+@anchor GLFW_OPENGL_PROFILE_attrib
+__GLFW_OPENGL_PROFILE__ indicates the OpenGL profile used by the context. This
+is `GLFW_OPENGL_CORE_PROFILE` or `GLFW_OPENGL_COMPAT_PROFILE` if the context
+uses a known profile, or `GLFW_OPENGL_ANY_PROFILE` if the OpenGL profile is
+unknown or the context is an OpenGL ES context. Note that the returned profile
+may not match the profile bits of the context flags, as GLFW will try other
+means of detecting the profile when no bits are set.
+
+@anchor GLFW_CONTEXT_RELEASE_BEHAVIOR_attrib
+__GLFW_CONTEXT_RELEASE_BEHAVIOR__ indicates the release used by the context.
+Possible values are one of `GLFW_ANY_RELEASE_BEHAVIOR`,
+`GLFW_RELEASE_BEHAVIOR_FLUSH` or `GLFW_RELEASE_BEHAVIOR_NONE`. If the
+behavior is `GLFW_ANY_RELEASE_BEHAVIOR`, the default behavior of the context
+creation API will be used. If the behavior is `GLFW_RELEASE_BEHAVIOR_FLUSH`,
+the pipeline will be flushed whenever the context is released from being the
+current one. If the behavior is `GLFW_RELEASE_BEHAVIOR_NONE`, the pipeline will
+not be flushed on release.
+
+@anchor GLFW_CONTEXT_NO_ERROR_attrib
+__GLFW_CONTEXT_NO_ERROR__ indicates whether errors are generated by the context.
+Possible values are `GLFW_TRUE` and `GLFW_FALSE`. If enabled, situations that
+would have generated errors instead cause undefined behavior.
+
+@anchor GLFW_CONTEXT_ROBUSTNESS_attrib
+__GLFW_CONTEXT_ROBUSTNESS__ indicates the robustness strategy used by the
+context. This is `GLFW_LOSE_CONTEXT_ON_RESET` or `GLFW_NO_RESET_NOTIFICATION`
+if the window's context supports robustness, or `GLFW_NO_ROBUSTNESS` otherwise.
+
+
+#### Framebuffer related attributes {#window_attribs_fb}
+
+GLFW does not expose most attributes of the default framebuffer (i.e. the
+framebuffer attached to the window) as these can be queried directly with either
+OpenGL, OpenGL ES or Vulkan. The one exception is
+[GLFW_DOUBLEBUFFER](@ref GLFW_DOUBLEBUFFER_attrib), as this is not provided by
+OpenGL ES.
+
+If you are using version 3.0 or later of OpenGL or OpenGL ES, the
+`glGetFramebufferAttachmentParameteriv` function can be used to retrieve the
+number of bits for the red, green, blue, alpha, depth and stencil buffer
+channels. Otherwise, the `glGetIntegerv` function can be used.
+
+The number of MSAA samples are always retrieved with `glGetIntegerv`. For
+contexts supporting framebuffer objects, the number of samples of the currently
+bound framebuffer is returned.
+
+Attribute | glGetIntegerv | glGetFramebufferAttachmentParameteriv
+------------ | ----------------- | -------------------------------------
+Red bits | `GL_RED_BITS` | `GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE`
+Green bits | `GL_GREEN_BITS` | `GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE`
+Blue bits | `GL_BLUE_BITS` | `GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE`
+Alpha bits | `GL_ALPHA_BITS` | `GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE`
+Depth bits | `GL_DEPTH_BITS` | `GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE`
+Stencil bits | `GL_STENCIL_BITS` | `GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE`
+MSAA samples | `GL_SAMPLES` | _Not provided by this function_
+
+When calling `glGetFramebufferAttachmentParameteriv`, the red, green, blue and
+alpha sizes are queried from the `GL_BACK_LEFT`, while the depth and stencil
+sizes are queried from the `GL_DEPTH` and `GL_STENCIL` attachments,
+respectively.
+
+@anchor GLFW_DOUBLEBUFFER_attrib
+__GLFW_DOUBLEBUFFER__ indicates whether the specified window is double-buffered
+when rendering with OpenGL or OpenGL ES. This can be set before creation with
+the [GLFW_DOUBLEBUFFER](@ref GLFW_DOUBLEBUFFER_hint) window hint.
+
+
+## Buffer swapping {#buffer_swap}
+
+GLFW windows are by default double buffered. That means that you have two
+rendering buffers; a front buffer and a back buffer. The front buffer is
+the one being displayed and the back buffer the one you render to.
+
+When the entire frame has been rendered, it is time to swap the back and the
+front buffers in order to display what has been rendered and begin rendering
+a new frame. This is done with @ref glfwSwapBuffers.
+
+```c
+glfwSwapBuffers(window);
+```
+
+Sometimes it can be useful to select when the buffer swap will occur. With the
+function @ref glfwSwapInterval it is possible to select the minimum number of
+monitor refreshes the driver should wait from the time @ref glfwSwapBuffers was
+called before swapping the buffers:
+
+```c
+glfwSwapInterval(1);
+```
+
+If the interval is zero, the swap will take place immediately when @ref
+glfwSwapBuffers is called without waiting for a refresh. Otherwise at least
+interval retraces will pass between each buffer swap. Using a swap interval of
+zero can be useful for benchmarking purposes, when it is not desirable to
+measure the time it takes to wait for the vertical retrace. However, a swap
+interval of one lets you avoid tearing.
+
+Note that this may not work on all machines, as some drivers have
+user-controlled settings that override any swap interval the application
+requests.
+
+A context that supports either the `WGL_EXT_swap_control_tear` or the
+`GLX_EXT_swap_control_tear` extension also accepts _negative_ swap intervals,
+which allows the driver to swap immediately even if a frame arrives a little bit
+late. This trades the risk of visible tears for greater framerate stability.
+You can check for these extensions with @ref glfwExtensionSupported.
+
diff --git a/external/GLFW/examples/CMakeLists.txt b/external/GLFW/examples/CMakeLists.txt
index f7a2ebe..e7a0379 100644
--- a/external/GLFW/examples/CMakeLists.txt
+++ b/external/GLFW/examples/CMakeLists.txt
@@ -1,59 +1,63 @@
link_libraries(glfw)
-include_directories(${glfw_INCLUDE_DIRS} "${GLFW_SOURCE_DIR}/deps")
+include_directories("${GLFW_SOURCE_DIR}/deps")
if (MATH_LIBRARY)
link_libraries("${MATH_LIBRARY}")
endif()
-if (MSVC)
+# Workaround for the MS CRT deprecating parts of the standard library
+if (MSVC OR CMAKE_C_SIMULATE_ID STREQUAL "MSVC")
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif()
-if (GLFW_USE_OSMESA)
- add_definitions(-DUSE_NATIVE_OSMESA)
-endif()
-
if (WIN32)
set(ICON glfw.rc)
elseif (APPLE)
set(ICON glfw.icns)
- set_source_files_properties(glfw.icns PROPERTIES
- MACOSX_PACKAGE_LOCATION "Resources")
endif()
-set(GLAD "${GLFW_SOURCE_DIR}/deps/glad/glad.h"
- "${GLFW_SOURCE_DIR}/deps/glad.c")
+set(GLAD_GL "${GLFW_SOURCE_DIR}/deps/glad/gl.h")
+set(GLAD_GLES2 "${GLFW_SOURCE_DIR}/deps/glad/gles2.h")
set(GETOPT "${GLFW_SOURCE_DIR}/deps/getopt.h"
"${GLFW_SOURCE_DIR}/deps/getopt.c")
set(TINYCTHREAD "${GLFW_SOURCE_DIR}/deps/tinycthread.h"
"${GLFW_SOURCE_DIR}/deps/tinycthread.c")
-add_executable(boing WIN32 MACOSX_BUNDLE boing.c ${ICON} ${GLAD})
-add_executable(gears WIN32 MACOSX_BUNDLE gears.c ${ICON} ${GLAD})
-add_executable(heightmap WIN32 MACOSX_BUNDLE heightmap.c ${ICON} ${GLAD})
-add_executable(offscreen offscreen.c ${ICON} ${GLAD})
-add_executable(particles WIN32 MACOSX_BUNDLE particles.c ${ICON} ${TINYCTHREAD} ${GETOPT} ${GLAD})
-add_executable(simple WIN32 MACOSX_BUNDLE simple.c ${ICON} ${GLAD})
-add_executable(splitview WIN32 MACOSX_BUNDLE splitview.c ${ICON} ${GLAD})
-add_executable(wave WIN32 MACOSX_BUNDLE wave.c ${ICON} ${GLAD})
+add_executable(boing WIN32 MACOSX_BUNDLE boing.c ${ICON} ${GLAD_GL})
+add_executable(gears WIN32 MACOSX_BUNDLE gears.c ${ICON} ${GLAD_GL})
+add_executable(heightmap WIN32 MACOSX_BUNDLE heightmap.c ${ICON} ${GLAD_GL})
+add_executable(offscreen offscreen.c ${ICON} ${GLAD_GL})
+add_executable(particles WIN32 MACOSX_BUNDLE particles.c ${ICON} ${TINYCTHREAD} ${GETOPT} ${GLAD_GL})
+add_executable(sharing WIN32 MACOSX_BUNDLE sharing.c ${ICON} ${GLAD_GL})
+add_executable(splitview WIN32 MACOSX_BUNDLE splitview.c ${ICON} ${GLAD_GL})
+add_executable(triangle-opengl WIN32 MACOSX_BUNDLE triangle-opengl.c ${ICON} ${GLAD_GL})
+add_executable(triangle-opengles WIN32 MACOSX_BUNDLE triangle-opengles.c ${ICON} ${GLAD_GLES2})
+add_executable(wave WIN32 MACOSX_BUNDLE wave.c ${ICON} ${GLAD_GL})
+add_executable(windows WIN32 MACOSX_BUNDLE windows.c ${ICON} ${GLAD_GL})
-target_link_libraries(particles "${CMAKE_THREAD_LIBS_INIT}")
+target_link_libraries(particles Threads::Threads)
if (RT_LIBRARY)
target_link_libraries(particles "${RT_LIBRARY}")
endif()
-set(WINDOWS_BINARIES boing gears heightmap particles simple splitview wave)
+set(GUI_ONLY_BINARIES boing gears heightmap particles sharing splitview
+ triangle-opengl triangle-opengles wave windows)
set(CONSOLE_BINARIES offscreen)
-set_target_properties(${WINDOWS_BINARIES} ${CONSOLE_BINARIES} PROPERTIES
+set_target_properties(${GUI_ONLY_BINARIES} ${CONSOLE_BINARIES} PROPERTIES
+ C_STANDARD 99
FOLDER "GLFW3/Examples")
if (MSVC)
- # Tell MSVC to use main instead of WinMain for Windows subsystem executables
- set_target_properties(${WINDOWS_BINARIES} PROPERTIES
+ # Tell MSVC to use main instead of WinMain
+ set_target_properties(${GUI_ONLY_BINARIES} PROPERTIES
LINK_FLAGS "/ENTRY:mainCRTStartup")
+elseif (CMAKE_C_SIMULATE_ID STREQUAL "MSVC")
+ # Tell Clang using MS CRT to use main instead of WinMain
+ set_target_properties(${GUI_ONLY_BINARIES} PROPERTIES
+ LINK_FLAGS "-Wl,/entry:mainCRTStartup")
endif()
if (APPLE)
@@ -61,15 +65,19 @@ if (APPLE)
set_target_properties(gears PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Gears")
set_target_properties(heightmap PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Heightmap")
set_target_properties(particles PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Particles")
- set_target_properties(simple PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Simple")
+ set_target_properties(sharing PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Sharing")
+ set_target_properties(triangle-opengl PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "OpenGL Triangle")
+ set_target_properties(triangle-opengles PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "OpenGL ES Triangle")
set_target_properties(splitview PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "SplitView")
set_target_properties(wave PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Wave")
+ set_target_properties(windows PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Windows")
- set_target_properties(${WINDOWS_BINARIES} PROPERTIES
- RESOURCE glfw.icns
+ set_source_files_properties(glfw.icns PROPERTIES
+ MACOSX_PACKAGE_LOCATION "Resources")
+ set_target_properties(${GUI_ONLY_BINARIES} PROPERTIES
MACOSX_BUNDLE_SHORT_VERSION_STRING ${GLFW_VERSION}
- MACOSX_BUNDLE_LONG_VERSION_STRING ${GLFW_VERSION_FULL}
+ MACOSX_BUNDLE_LONG_VERSION_STRING ${GLFW_VERSION}
MACOSX_BUNDLE_ICON_FILE glfw.icns
- MACOSX_BUNDLE_INFO_PLIST "${GLFW_SOURCE_DIR}/CMake/MacOSXBundleInfo.plist.in")
+ MACOSX_BUNDLE_INFO_PLIST "${GLFW_SOURCE_DIR}/CMake/Info.plist.in")
endif()
diff --git a/external/GLFW/examples/boing.c b/external/GLFW/examples/boing.c
index 45c867f..ec118a3 100644
--- a/external/GLFW/examples/boing.c
+++ b/external/GLFW/examples/boing.c
@@ -36,7 +36,9 @@
#include
#include
-#include
+#define GLAD_GL_IMPLEMENTATION
+#include
+#define GLFW_INCLUDE_NONE
#include
#include
@@ -165,7 +167,7 @@ void CrossProduct( vertex_t a, vertex_t b, vertex_t c, vertex_t *n )
v2 = c.y - a.y;
v3 = c.z - a.z;
- n->x = u2 * v3 - v2 * v3;
+ n->x = u2 * v3 - v2 * u3;
n->y = u3 * v1 - v3 * u1;
n->z = u1 * v2 - v1 * u2;
}
@@ -302,7 +304,7 @@ void cursor_position_callback( GLFWwindow* window, double x, double y )
* The Boing ball is sphere in which each facet is a rectangle.
* Facet colors alternate between red and white.
* The ball is built by stacking latitudinal circles. Each circle is composed
- * of a widely-separated set of points, so that each facet is noticably large.
+ * of a widely-separated set of points, so that each facet is noticeably large.
*****************************************************************************/
void DrawBoingBall( void )
{
@@ -446,7 +448,7 @@ void DrawBoingBallBand( GLfloat long_lo,
static int colorToggle = 0;
/*
- * Iterate thru the points of a latitude circle.
+ * Iterate through the points of a latitude circle.
* A latitude circle is a 2D set of X,Z points.
*/
for ( lat_deg = 0;
@@ -642,7 +644,7 @@ int main( void )
glfwSetCursorPosCallback(window, cursor_position_callback);
glfwMakeContextCurrent(window);
- gladLoadGLLoader((GLADloadproc) glfwGetProcAddress);
+ gladLoadGL(glfwGetProcAddress);
glfwSwapInterval( 1 );
glfwGetFramebufferSize(window, &width, &height);
diff --git a/external/GLFW/examples/gears.c b/external/GLFW/examples/gears.c
index f14b300..3d63013 100644
--- a/external/GLFW/examples/gears.c
+++ b/external/GLFW/examples/gears.c
@@ -31,7 +31,9 @@
#include
#include
-#include
+#define GLAD_GL_IMPLEMENTATION
+#include
+#define GLFW_INCLUDE_NONE
#include
/**
@@ -312,7 +314,7 @@ int main(int argc, char *argv[])
}
glfwWindowHint(GLFW_DEPTH_BITS, 16);
- glfwWindowHint(GLFW_TRANSPARENT, GLFW_TRUE);
+ glfwWindowHint(GLFW_TRANSPARENT_FRAMEBUFFER, GLFW_TRUE);
window = glfwCreateWindow( 300, 300, "Gears", NULL, NULL );
if (!window)
@@ -327,7 +329,7 @@ int main(int argc, char *argv[])
glfwSetKeyCallback(window, key);
glfwMakeContextCurrent(window);
- gladLoadGLLoader((GLADloadproc) glfwGetProcAddress);
+ gladLoadGL(glfwGetProcAddress);
glfwSwapInterval( 1 );
glfwGetFramebufferSize(window, &width, &height);
diff --git a/external/GLFW/examples/heightmap.c b/external/GLFW/examples/heightmap.c
index b57815e..ad5d47c 100644
--- a/external/GLFW/examples/heightmap.c
+++ b/external/GLFW/examples/heightmap.c
@@ -29,7 +29,9 @@
#include
#include
-#include
+#define GLAD_GL_IMPLEMENTATION
+#include
+#define GLFW_INCLUDE_NONE
#include
/* Map height updates */
@@ -291,12 +293,12 @@ static void generate_heightmap__circle(float* center_x, float* center_y,
{
float sign;
/* random value for element in between [0-1.0] */
- *center_x = (MAP_SIZE * rand()) / (1.0f * RAND_MAX);
- *center_y = (MAP_SIZE * rand()) / (1.0f * RAND_MAX);
- *size = (MAX_CIRCLE_SIZE * rand()) / (1.0f * RAND_MAX);
- sign = (1.0f * rand()) / (1.0f * RAND_MAX);
+ *center_x = (MAP_SIZE * rand()) / (float) RAND_MAX;
+ *center_y = (MAP_SIZE * rand()) / (float) RAND_MAX;
+ *size = (MAX_CIRCLE_SIZE * rand()) / (float) RAND_MAX;
+ sign = (1.0f * rand()) / (float) RAND_MAX;
sign = (sign < DISPLACEMENT_SIGN_LIMIT) ? -1.0f : 1.0f;
- *displacement = (sign * (MAX_DISPLACEMENT * rand())) / (1.0f * RAND_MAX);
+ *displacement = (sign * (MAX_DISPLACEMENT * rand())) / (float) RAND_MAX;
}
/* Run the specified number of iterations of the generation process for the
@@ -432,7 +434,7 @@ int main(int argc, char** argv)
glfwSetKeyCallback(window, key_callback);
glfwMakeContextCurrent(window);
- gladLoadGLLoader((GLADloadproc) glfwGetProcAddress);
+ gladLoadGL(glfwGetProcAddress);
/* Prepare opengl resources for rendering */
shader_program = make_shader_program(vertex_shader_text, fragment_shader_text);
diff --git a/external/GLFW/examples/offscreen.c b/external/GLFW/examples/offscreen.c
index b19de0d..e285286 100644
--- a/external/GLFW/examples/offscreen.c
+++ b/external/GLFW/examples/offscreen.c
@@ -23,14 +23,11 @@
//
//========================================================================
-#include
+#define GLAD_GL_IMPLEMENTATION
+#include
+#define GLFW_INCLUDE_NONE
#include
-#if USE_NATIVE_OSMESA
- #define GLFW_EXPOSE_NATIVE_OSMESA
- #include
-#endif
-
#include "linmath.h"
#include
@@ -104,7 +101,7 @@ int main(void)
}
glfwMakeContextCurrent(window);
- gladLoadGLLoader((GLADloadproc) glfwGetProcAddress);
+ gladLoadGL(glfwGetProcAddress);
// NOTE: OpenGL error checks have been omitted for brevity
@@ -147,13 +144,10 @@ int main(void)
glUseProgram(program);
glUniformMatrix4fv(mvp_location, 1, GL_FALSE, (const GLfloat*) mvp);
glDrawArrays(GL_TRIANGLES, 0, 3);
+ glFinish();
-#if USE_NATIVE_OSMESA
- glfwGetOSMesaColorBuffer(window, &width, &height, NULL, (void**) &buffer);
-#else
buffer = calloc(4, width * height);
glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
-#endif
// Write image Y-flipped because OpenGL
stbi_write_png("offscreen.png",
@@ -161,11 +155,7 @@ int main(void)
buffer + (width * 4 * (height - 1)),
-width * 4);
-#if USE_NATIVE_OSMESA
- // Here is where there's nothing
-#else
free(buffer);
-#endif
glfwDestroyWindow(window);
diff --git a/external/GLFW/examples/particles.c b/external/GLFW/examples/particles.c
index 488289a..baafe82 100644
--- a/external/GLFW/examples/particles.c
+++ b/external/GLFW/examples/particles.c
@@ -39,7 +39,9 @@
#include
#include
-#include
+#define GLAD_GL_IMPLEMENTATION
+#include
+#define GLFW_INCLUDE_NONE
#include
// Define tokens for GL_EXT_separate_specular_color if not already defined
@@ -443,7 +445,7 @@ static void draw_particles(GLFWwindow* window, double t, float dt)
}
// Set up vertex arrays. We use interleaved arrays, which is easier to
- // handle (in most situations) and it gives a linear memeory access
+ // handle (in most situations) and it gives a linear memory access
// access pattern (which may give better performance in some
// situations). GL_T2F_C4UB_V3F means: 2 floats for texture coords,
// 4 ubytes for color and 3 floats for vertex coord (in that order).
@@ -653,7 +655,7 @@ static void draw_fountain(void)
//========================================================================
-// Recursive function for building variable tesselated floor
+// Recursive function for building variable tessellated floor
//========================================================================
static void tessellate_floor(float x1, float y1, float x2, float y2, int depth)
@@ -720,7 +722,7 @@ static void draw_floor(void)
glMaterialfv(GL_FRONT, GL_SPECULAR, floor_specular);
glMaterialf(GL_FRONT, GL_SHININESS, floor_shininess);
- // Draw floor as a bunch of triangle strips (high tesselation
+ // Draw floor as a bunch of triangle strips (high tessellation
// improves lighting)
glNormal3f(0.f, 0.f, 1.f);
glBegin(GL_QUADS);
@@ -994,7 +996,7 @@ int main(int argc, char** argv)
glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED);
glfwMakeContextCurrent(window);
- gladLoadGLLoader((GLADloadproc) glfwGetProcAddress);
+ gladLoadGL(glfwGetProcAddress);
glfwSwapInterval(1);
glfwSetFramebufferSizeCallback(window, resize_callback);
diff --git a/external/GLFW/examples/sharing.c b/external/GLFW/examples/sharing.c
new file mode 100644
index 0000000..502f9ee
--- /dev/null
+++ b/external/GLFW/examples/sharing.c
@@ -0,0 +1,234 @@
+//========================================================================
+// Context sharing example
+// Copyright (c) Camilla Löwy
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would
+// be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such, and must not
+// be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source
+// distribution.
+//
+//========================================================================
+
+#define GLAD_GL_IMPLEMENTATION
+#include
+#define GLFW_INCLUDE_NONE
+#include
+
+#include
+#include
+
+#include "linmath.h"
+
+static const char* vertex_shader_text =
+"#version 110\n"
+"uniform mat4 MVP;\n"
+"attribute vec2 vPos;\n"
+"varying vec2 texcoord;\n"
+"void main()\n"
+"{\n"
+" gl_Position = MVP * vec4(vPos, 0.0, 1.0);\n"
+" texcoord = vPos;\n"
+"}\n";
+
+static const char* fragment_shader_text =
+"#version 110\n"
+"uniform sampler2D texture;\n"
+"uniform vec3 color;\n"
+"varying vec2 texcoord;\n"
+"void main()\n"
+"{\n"
+" gl_FragColor = vec4(color * texture2D(texture, texcoord).rgb, 1.0);\n"
+"}\n";
+
+static const vec2 vertices[4] =
+{
+ { 0.f, 0.f },
+ { 1.f, 0.f },
+ { 1.f, 1.f },
+ { 0.f, 1.f }
+};
+
+static void error_callback(int error, const char* description)
+{
+ fprintf(stderr, "Error: %s\n", description);
+}
+
+static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
+{
+ if (action == GLFW_PRESS && key == GLFW_KEY_ESCAPE)
+ glfwSetWindowShouldClose(window, GLFW_TRUE);
+}
+
+int main(int argc, char** argv)
+{
+ GLFWwindow* windows[2];
+ GLuint texture, program, vertex_buffer;
+ GLint mvp_location, vpos_location, color_location, texture_location;
+
+ glfwSetErrorCallback(error_callback);
+
+ if (!glfwInit())
+ exit(EXIT_FAILURE);
+
+ glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2);
+ glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
+
+ windows[0] = glfwCreateWindow(400, 400, "First", NULL, NULL);
+ if (!windows[0])
+ {
+ glfwTerminate();
+ exit(EXIT_FAILURE);
+ }
+
+ glfwSetKeyCallback(windows[0], key_callback);
+
+ glfwMakeContextCurrent(windows[0]);
+
+ // Only enable vsync for the first of the windows to be swapped to
+ // avoid waiting out the interval for each window
+ glfwSwapInterval(1);
+
+ // The contexts are created with the same APIs so the function
+ // pointers should be re-usable between them
+ gladLoadGL(glfwGetProcAddress);
+
+ // Create the OpenGL objects inside the first context, created above
+ // All objects will be shared with the second context, created below
+ {
+ int x, y;
+ char pixels[16 * 16];
+ GLuint vertex_shader, fragment_shader;
+
+ glGenTextures(1, &texture);
+ glBindTexture(GL_TEXTURE_2D, texture);
+
+ srand((unsigned int) glfwGetTimerValue());
+
+ for (y = 0; y < 16; y++)
+ {
+ for (x = 0; x < 16; x++)
+ pixels[y * 16 + x] = rand() % 256;
+ }
+
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, 16, 16, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, pixels);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+
+ vertex_shader = glCreateShader(GL_VERTEX_SHADER);
+ glShaderSource(vertex_shader, 1, &vertex_shader_text, NULL);
+ glCompileShader(vertex_shader);
+
+ fragment_shader = glCreateShader(GL_FRAGMENT_SHADER);
+ glShaderSource(fragment_shader, 1, &fragment_shader_text, NULL);
+ glCompileShader(fragment_shader);
+
+ program = glCreateProgram();
+ glAttachShader(program, vertex_shader);
+ glAttachShader(program, fragment_shader);
+ glLinkProgram(program);
+
+ mvp_location = glGetUniformLocation(program, "MVP");
+ color_location = glGetUniformLocation(program, "color");
+ texture_location = glGetUniformLocation(program, "texture");
+ vpos_location = glGetAttribLocation(program, "vPos");
+
+ glGenBuffers(1, &vertex_buffer);
+ glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer);
+ glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
+ }
+
+ glUseProgram(program);
+ glUniform1i(texture_location, 0);
+
+ glEnable(GL_TEXTURE_2D);
+ glBindTexture(GL_TEXTURE_2D, texture);
+
+ glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer);
+ glEnableVertexAttribArray(vpos_location);
+ glVertexAttribPointer(vpos_location, 2, GL_FLOAT, GL_FALSE,
+ sizeof(vertices[0]), (void*) 0);
+
+ windows[1] = glfwCreateWindow(400, 400, "Second", NULL, windows[0]);
+ if (!windows[1])
+ {
+ glfwTerminate();
+ exit(EXIT_FAILURE);
+ }
+
+ // Place the second window to the right of the first
+ {
+ int xpos, ypos, left, right, width;
+
+ glfwGetWindowSize(windows[0], &width, NULL);
+ glfwGetWindowFrameSize(windows[0], &left, NULL, &right, NULL);
+ glfwGetWindowPos(windows[0], &xpos, &ypos);
+
+ glfwSetWindowPos(windows[1], xpos + width + left + right, ypos);
+ }
+
+ glfwSetKeyCallback(windows[1], key_callback);
+
+ glfwMakeContextCurrent(windows[1]);
+
+ // While objects are shared, the global context state is not and will
+ // need to be set up for each context
+
+ glUseProgram(program);
+
+ glEnable(GL_TEXTURE_2D);
+ glBindTexture(GL_TEXTURE_2D, texture);
+
+ glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer);
+ glEnableVertexAttribArray(vpos_location);
+ glVertexAttribPointer(vpos_location, 2, GL_FLOAT, GL_FALSE,
+ sizeof(vertices[0]), (void*) 0);
+
+ while (!glfwWindowShouldClose(windows[0]) &&
+ !glfwWindowShouldClose(windows[1]))
+ {
+ int i;
+ const vec3 colors[2] =
+ {
+ { 0.8f, 0.4f, 1.f },
+ { 0.3f, 0.4f, 1.f }
+ };
+
+ for (i = 0; i < 2; i++)
+ {
+ int width, height;
+ mat4x4 mvp;
+
+ glfwGetFramebufferSize(windows[i], &width, &height);
+ glfwMakeContextCurrent(windows[i]);
+
+ glViewport(0, 0, width, height);
+
+ mat4x4_ortho(mvp, 0.f, 1.f, 0.f, 1.f, 0.f, 1.f);
+ glUniformMatrix4fv(mvp_location, 1, GL_FALSE, (const GLfloat*) mvp);
+ glUniform3fv(color_location, 1, colors[i]);
+ glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
+
+ glfwSwapBuffers(windows[i]);
+ }
+
+ glfwWaitEvents();
+ }
+
+ glfwTerminate();
+ exit(EXIT_SUCCESS);
+}
+
diff --git a/external/GLFW/examples/splitview.c b/external/GLFW/examples/splitview.c
index 12f837d..990df12 100644
--- a/external/GLFW/examples/splitview.c
+++ b/external/GLFW/examples/splitview.c
@@ -2,15 +2,17 @@
// This is an example program for the GLFW library
//
// The program uses a "split window" view, rendering four views of the
-// same scene in one window (e.g. uesful for 3D modelling software). This
-// demo uses scissors to separete the four different rendering areas from
+// same scene in one window (e.g. useful for 3D modelling software). This
+// demo uses scissors to separate the four different rendering areas from
// each other.
//
// (If the code seems a little bit strange here and there, it may be
// because I am not a friend of orthogonal projections)
//========================================================================
-#include
+#define GLAD_GL_IMPLEMENTATION
+#include
+#define GLFW_INCLUDE_NONE
#include
#if defined(_MSC_VER)
@@ -513,7 +515,7 @@ int main(void)
// Enable vsync
glfwMakeContextCurrent(window);
- gladLoadGLLoader((GLADloadproc) glfwGetProcAddress);
+ gladLoadGL(glfwGetProcAddress);
glfwSwapInterval(1);
if (GLAD_GL_ARB_multisample || GLAD_GL_VERSION_1_3)
diff --git a/external/GLFW/examples/triangle-opengl.c b/external/GLFW/examples/triangle-opengl.c
new file mode 100644
index 0000000..ff9e7d3
--- /dev/null
+++ b/external/GLFW/examples/triangle-opengl.c
@@ -0,0 +1,171 @@
+//========================================================================
+// OpenGL triangle example
+// Copyright (c) Camilla Löwy
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would
+// be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such, and must not
+// be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source
+// distribution.
+//
+//========================================================================
+//! [code]
+
+#define GLAD_GL_IMPLEMENTATION
+#include
+#define GLFW_INCLUDE_NONE
+#include
+
+#include "linmath.h"
+
+#include
+#include
+#include
+
+typedef struct Vertex
+{
+ vec2 pos;
+ vec3 col;
+} Vertex;
+
+static const Vertex vertices[3] =
+{
+ { { -0.6f, -0.4f }, { 1.f, 0.f, 0.f } },
+ { { 0.6f, -0.4f }, { 0.f, 1.f, 0.f } },
+ { { 0.f, 0.6f }, { 0.f, 0.f, 1.f } }
+};
+
+static const char* vertex_shader_text =
+"#version 330\n"
+"uniform mat4 MVP;\n"
+"in vec3 vCol;\n"
+"in vec2 vPos;\n"
+"out vec3 color;\n"
+"void main()\n"
+"{\n"
+" gl_Position = MVP * vec4(vPos, 0.0, 1.0);\n"
+" color = vCol;\n"
+"}\n";
+
+static const char* fragment_shader_text =
+"#version 330\n"
+"in vec3 color;\n"
+"out vec4 fragment;\n"
+"void main()\n"
+"{\n"
+" fragment = vec4(color, 1.0);\n"
+"}\n";
+
+static void error_callback(int error, const char* description)
+{
+ fprintf(stderr, "Error: %s\n", description);
+}
+
+static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
+{
+ if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
+ glfwSetWindowShouldClose(window, GLFW_TRUE);
+}
+
+int main(void)
+{
+ glfwSetErrorCallback(error_callback);
+
+ if (!glfwInit())
+ exit(EXIT_FAILURE);
+
+ glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
+ glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
+ glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
+
+ GLFWwindow* window = glfwCreateWindow(640, 480, "OpenGL Triangle", NULL, NULL);
+ if (!window)
+ {
+ glfwTerminate();
+ exit(EXIT_FAILURE);
+ }
+
+ glfwSetKeyCallback(window, key_callback);
+
+ glfwMakeContextCurrent(window);
+ gladLoadGL(glfwGetProcAddress);
+ glfwSwapInterval(1);
+
+ // NOTE: OpenGL error checks have been omitted for brevity
+
+ GLuint vertex_buffer;
+ glGenBuffers(1, &vertex_buffer);
+ glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer);
+ glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
+
+ const GLuint vertex_shader = glCreateShader(GL_VERTEX_SHADER);
+ glShaderSource(vertex_shader, 1, &vertex_shader_text, NULL);
+ glCompileShader(vertex_shader);
+
+ const GLuint fragment_shader = glCreateShader(GL_FRAGMENT_SHADER);
+ glShaderSource(fragment_shader, 1, &fragment_shader_text, NULL);
+ glCompileShader(fragment_shader);
+
+ const GLuint program = glCreateProgram();
+ glAttachShader(program, vertex_shader);
+ glAttachShader(program, fragment_shader);
+ glLinkProgram(program);
+
+ const GLint mvp_location = glGetUniformLocation(program, "MVP");
+ const GLint vpos_location = glGetAttribLocation(program, "vPos");
+ const GLint vcol_location = glGetAttribLocation(program, "vCol");
+
+ GLuint vertex_array;
+ glGenVertexArrays(1, &vertex_array);
+ glBindVertexArray(vertex_array);
+ glEnableVertexAttribArray(vpos_location);
+ glVertexAttribPointer(vpos_location, 2, GL_FLOAT, GL_FALSE,
+ sizeof(Vertex), (void*) offsetof(Vertex, pos));
+ glEnableVertexAttribArray(vcol_location);
+ glVertexAttribPointer(vcol_location, 3, GL_FLOAT, GL_FALSE,
+ sizeof(Vertex), (void*) offsetof(Vertex, col));
+
+ while (!glfwWindowShouldClose(window))
+ {
+ int width, height;
+ glfwGetFramebufferSize(window, &width, &height);
+ const float ratio = width / (float) height;
+
+ glViewport(0, 0, width, height);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ mat4x4 m, p, mvp;
+ mat4x4_identity(m);
+ mat4x4_rotate_Z(m, m, (float) glfwGetTime());
+ mat4x4_ortho(p, -ratio, ratio, -1.f, 1.f, 1.f, -1.f);
+ mat4x4_mul(mvp, p, m);
+
+ glUseProgram(program);
+ glUniformMatrix4fv(mvp_location, 1, GL_FALSE, (const GLfloat*) &mvp);
+ glBindVertexArray(vertex_array);
+ glDrawArrays(GL_TRIANGLES, 0, 3);
+
+ glfwSwapBuffers(window);
+ glfwPollEvents();
+ }
+
+ glfwDestroyWindow(window);
+
+ glfwTerminate();
+ exit(EXIT_SUCCESS);
+}
+
+//! [code]
diff --git a/external/GLFW/examples/triangle-opengles.c b/external/GLFW/examples/triangle-opengles.c
new file mode 100644
index 0000000..03eb026
--- /dev/null
+++ b/external/GLFW/examples/triangle-opengles.c
@@ -0,0 +1,170 @@
+//========================================================================
+// OpenGL ES 2.0 triangle example
+// Copyright (c) Camilla Löwy
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would
+// be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such, and must not
+// be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source
+// distribution.
+//
+//========================================================================
+
+#define GLAD_GLES2_IMPLEMENTATION
+#include
+#define GLFW_INCLUDE_NONE
+#include
+
+#include "linmath.h"
+
+#include
+#include
+#include
+
+typedef struct Vertex
+{
+ vec2 pos;
+ vec3 col;
+} Vertex;
+
+static const Vertex vertices[3] =
+{
+ { { -0.6f, -0.4f }, { 1.f, 0.f, 0.f } },
+ { { 0.6f, -0.4f }, { 0.f, 1.f, 0.f } },
+ { { 0.f, 0.6f }, { 0.f, 0.f, 1.f } }
+};
+
+static const char* vertex_shader_text =
+"#version 100\n"
+"precision mediump float;\n"
+"uniform mat4 MVP;\n"
+"attribute vec3 vCol;\n"
+"attribute vec2 vPos;\n"
+"varying vec3 color;\n"
+"void main()\n"
+"{\n"
+" gl_Position = MVP * vec4(vPos, 0.0, 1.0);\n"
+" color = vCol;\n"
+"}\n";
+
+static const char* fragment_shader_text =
+"#version 100\n"
+"precision mediump float;\n"
+"varying vec3 color;\n"
+"void main()\n"
+"{\n"
+" gl_FragColor = vec4(color, 1.0);\n"
+"}\n";
+
+static void error_callback(int error, const char* description)
+{
+ fprintf(stderr, "GLFW Error: %s\n", description);
+}
+
+static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
+{
+ if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
+ glfwSetWindowShouldClose(window, GLFW_TRUE);
+}
+
+int main(void)
+{
+ glfwSetErrorCallback(error_callback);
+
+ if (!glfwInit())
+ exit(EXIT_FAILURE);
+
+ glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_ES_API);
+ glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2);
+ glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
+ glfwWindowHint(GLFW_CONTEXT_CREATION_API, GLFW_EGL_CONTEXT_API);
+
+ GLFWwindow* window = glfwCreateWindow(640, 480, "OpenGL ES 2.0 Triangle (EGL)", NULL, NULL);
+ if (!window)
+ {
+ glfwWindowHint(GLFW_CONTEXT_CREATION_API, GLFW_NATIVE_CONTEXT_API);
+ window = glfwCreateWindow(640, 480, "OpenGL ES 2.0 Triangle", NULL, NULL);
+ if (!window)
+ {
+ glfwTerminate();
+ exit(EXIT_FAILURE);
+ }
+ }
+
+ glfwSetKeyCallback(window, key_callback);
+
+ glfwMakeContextCurrent(window);
+ gladLoadGLES2(glfwGetProcAddress);
+ glfwSwapInterval(1);
+
+ GLuint vertex_buffer;
+ glGenBuffers(1, &vertex_buffer);
+ glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer);
+ glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
+
+ const GLuint vertex_shader = glCreateShader(GL_VERTEX_SHADER);
+ glShaderSource(vertex_shader, 1, &vertex_shader_text, NULL);
+ glCompileShader(vertex_shader);
+
+ const GLuint fragment_shader = glCreateShader(GL_FRAGMENT_SHADER);
+ glShaderSource(fragment_shader, 1, &fragment_shader_text, NULL);
+ glCompileShader(fragment_shader);
+
+ const GLuint program = glCreateProgram();
+ glAttachShader(program, vertex_shader);
+ glAttachShader(program, fragment_shader);
+ glLinkProgram(program);
+
+ const GLint mvp_location = glGetUniformLocation(program, "MVP");
+ const GLint vpos_location = glGetAttribLocation(program, "vPos");
+ const GLint vcol_location = glGetAttribLocation(program, "vCol");
+
+ glEnableVertexAttribArray(vpos_location);
+ glEnableVertexAttribArray(vcol_location);
+ glVertexAttribPointer(vpos_location, 2, GL_FLOAT, GL_FALSE,
+ sizeof(Vertex), (void*) offsetof(Vertex, pos));
+ glVertexAttribPointer(vcol_location, 3, GL_FLOAT, GL_FALSE,
+ sizeof(Vertex), (void*) offsetof(Vertex, col));
+
+ while (!glfwWindowShouldClose(window))
+ {
+ int width, height;
+ glfwGetFramebufferSize(window, &width, &height);
+ const float ratio = width / (float) height;
+
+ glViewport(0, 0, width, height);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ mat4x4 m, p, mvp;
+ mat4x4_identity(m);
+ mat4x4_rotate_Z(m, m, (float) glfwGetTime());
+ mat4x4_ortho(p, -ratio, ratio, -1.f, 1.f, 1.f, -1.f);
+ mat4x4_mul(mvp, p, m);
+
+ glUseProgram(program);
+ glUniformMatrix4fv(mvp_location, 1, GL_FALSE, (const GLfloat*) &mvp);
+ glDrawArrays(GL_TRIANGLES, 0, 3);
+
+ glfwSwapBuffers(window);
+ glfwPollEvents();
+ }
+
+ glfwDestroyWindow(window);
+
+ glfwTerminate();
+ exit(EXIT_SUCCESS);
+}
+
diff --git a/external/GLFW/examples/wave.c b/external/GLFW/examples/wave.c
index f5af379..d7ead49 100644
--- a/external/GLFW/examples/wave.c
+++ b/external/GLFW/examples/wave.c
@@ -17,7 +17,9 @@
#include
#include
-#include
+#define GLAD_GL_IMPLEMENTATION
+#include
+#define GLFW_INCLUDE_NONE
#include
#include
@@ -412,7 +414,7 @@ int main(int argc, char* argv[])
glfwSetScrollCallback(window, scroll_callback);
glfwMakeContextCurrent(window);
- gladLoadGLLoader((GLADloadproc) glfwGetProcAddress);
+ gladLoadGL(glfwGetProcAddress);
glfwSwapInterval(1);
glfwGetFramebufferSize(window, &width, &height);
@@ -455,6 +457,7 @@ int main(int argc, char* argv[])
glfwPollEvents();
}
+ glfwTerminate();
exit(EXIT_SUCCESS);
}
diff --git a/external/GLFW/examples/windows.c b/external/GLFW/examples/windows.c
new file mode 100644
index 0000000..1589ffb
--- /dev/null
+++ b/external/GLFW/examples/windows.c
@@ -0,0 +1,106 @@
+//========================================================================
+// Simple multi-window example
+// Copyright (c) Camilla Löwy
+//
+// This software is provided 'as-is', without any express or implied
+// warranty. In no event will the authors be held liable for any damages
+// arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it
+// freely, subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented; you must not
+// claim that you wrote the original software. If you use this software
+// in a product, an acknowledgment in the product documentation would
+// be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such, and must not
+// be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source
+// distribution.
+//
+//========================================================================
+
+#define GLAD_GL_IMPLEMENTATION
+#include
+#define GLFW_INCLUDE_NONE
+#include
+
+#include
+#include
+
+int main(int argc, char** argv)
+{
+ int xpos, ypos, height;
+ const char* description;
+ GLFWwindow* windows[4];
+
+ if (!glfwInit())
+ {
+ glfwGetError(&description);
+ printf("Error: %s\n", description);
+ exit(EXIT_FAILURE);
+ }
+
+ glfwWindowHint(GLFW_DECORATED, GLFW_FALSE);
+
+ glfwGetMonitorWorkarea(glfwGetPrimaryMonitor(), &xpos, &ypos, NULL, &height);
+
+ for (int i = 0; i < 4; i++)
+ {
+ const int size = height / 5;
+ const struct
+ {
+ float r, g, b;
+ } colors[] =
+ {
+ { 0.95f, 0.32f, 0.11f },
+ { 0.50f, 0.80f, 0.16f },
+ { 0.f, 0.68f, 0.94f },
+ { 0.98f, 0.74f, 0.04f }
+ };
+
+ if (i > 0)
+ glfwWindowHint(GLFW_FOCUS_ON_SHOW, GLFW_FALSE);
+
+ glfwWindowHint(GLFW_POSITION_X, xpos + size * (1 + (i & 1)));
+ glfwWindowHint(GLFW_POSITION_Y, ypos + size * (1 + (i >> 1)));
+
+ windows[i] = glfwCreateWindow(size, size, "Multi-Window Example", NULL, NULL);
+ if (!windows[i])
+ {
+ glfwGetError(&description);
+ printf("Error: %s\n", description);
+ glfwTerminate();
+ exit(EXIT_FAILURE);
+ }
+
+ glfwSetInputMode(windows[i], GLFW_STICKY_KEYS, GLFW_TRUE);
+
+ glfwMakeContextCurrent(windows[i]);
+ gladLoadGL(glfwGetProcAddress);
+ glClearColor(colors[i].r, colors[i].g, colors[i].b, 1.f);
+ }
+
+ for (;;)
+ {
+ for (int i = 0; i < 4; i++)
+ {
+ glfwMakeContextCurrent(windows[i]);
+ glClear(GL_COLOR_BUFFER_BIT);
+ glfwSwapBuffers(windows[i]);
+
+ if (glfwWindowShouldClose(windows[i]) ||
+ glfwGetKey(windows[i], GLFW_KEY_ESCAPE))
+ {
+ glfwTerminate();
+ exit(EXIT_SUCCESS);
+ }
+ }
+
+ glfwWaitEvents();
+ }
+}
+
diff --git a/external/GLFW/include/GLFW/glfw3.h b/external/GLFW/include/GLFW/glfw3.h
index 8e6bc42..3ce1c01 100644
--- a/external/GLFW/include/GLFW/glfw3.h
+++ b/external/GLFW/include/GLFW/glfw3.h
@@ -1,9 +1,9 @@
/*************************************************************************
- * GLFW 3.3 - www.glfw.org
+ * GLFW 3.5 - www.glfw.org
* A library for OpenGL, window and input
*------------------------------------------------------------------------
* Copyright (c) 2002-2006 Marcus Geelnard
- * Copyright (c) 2006-2016 Camilla Löwy
+ * Copyright (c) 2006-2019 Camilla Löwy
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
@@ -52,7 +52,7 @@ extern "C" {
* This is the reference documentation for OpenGL and OpenGL ES context related
* functions. For more task-oriented information, see the @ref context_guide.
*/
-/*! @defgroup vulkan Vulkan reference
+/*! @defgroup vulkan Vulkan support reference
* @brief Functions and types related to Vulkan.
*
* This is the reference documentation for Vulkan related functions and types.
@@ -96,11 +96,30 @@ extern "C" {
#define _WIN32
#endif /* _WIN32 */
+/* Include because most Windows GLU headers need wchar_t and
+ * the macOS OpenGL header blocks the definition of ptrdiff_t by glext.h.
+ * Include it unconditionally to avoid surprising side-effects.
+ */
+#include
+
+/* Include because it is needed by Vulkan and related functions.
+ * Include it unconditionally to avoid surprising side-effects.
+ */
+#include
+
+#if defined(GLFW_INCLUDE_VULKAN)
+ #include
+#endif /* Vulkan header */
+
+/* The Vulkan header may have indirectly included windows.h (because of
+ * VK_USE_PLATFORM_WIN32_KHR) so we offer our replacement symbols after it.
+ */
+
/* It is customary to use APIENTRY for OpenGL function pointer declarations on
* all platforms. Additionally, the Windows OpenGL header needs APIENTRY.
*/
-#ifndef APIENTRY
- #ifdef _WIN32
+#if !defined(APIENTRY)
+ #if defined(_WIN32)
#define APIENTRY __stdcall
#else
#define APIENTRY
@@ -122,17 +141,6 @@ extern "C" {
#define GLFW_CALLBACK_DEFINED
#endif /* CALLBACK */
-/* Include because most Windows GLU headers need wchar_t and
- * the macOS OpenGL header blocks the definition of ptrdiff_t by glext.h.
- * Include it unconditionally to avoid surprising side-effects.
- */
-#include
-
-/* Include because it is needed by Vulkan and related functions.
- * Include it unconditionally to avoid surprising side-effects.
- */
-#include
-
/* Include the chosen OpenGL or OpenGL ES headers.
*/
#if defined(GLFW_INCLUDE_ES1)
@@ -182,10 +190,44 @@ extern "C" {
#else /*__APPLE__*/
#include
+ #if defined(GLFW_INCLUDE_GLEXT)
+ #include
+ #endif
+
+ #endif /*__APPLE__*/
+
+#elif defined(GLFW_INCLUDE_GLU)
+
+ #if defined(__APPLE__)
+
+ #if defined(GLFW_INCLUDE_GLU)
+ #include
+ #endif
+
+ #else /*__APPLE__*/
+
+ #if defined(GLFW_INCLUDE_GLU)
+ #include
+ #endif
#endif /*__APPLE__*/
-#elif !defined(GLFW_INCLUDE_NONE)
+#elif !defined(GLFW_INCLUDE_NONE) && \
+ !defined(__gl_h_) && \
+ !defined(__gles1_gl_h_) && \
+ !defined(__gles2_gl2_h_) && \
+ !defined(__gles2_gl3_h_) && \
+ !defined(__gles2_gl31_h_) && \
+ !defined(__gles2_gl32_h_) && \
+ !defined(__gl_glcorearb_h_) && \
+ !defined(__gl2_h_) /*legacy*/ && \
+ !defined(__gl3_h_) /*legacy*/ && \
+ !defined(__gl31_h_) /*legacy*/ && \
+ !defined(__gl32_h_) /*legacy*/ && \
+ !defined(__glcorearb_h_) /*legacy*/ && \
+ !defined(__GL_H__) /*non-standard*/ && \
+ !defined(__gltypes_h_) /*non-standard*/ && \
+ !defined(__glee_h_) /*non-standard*/
#if defined(__APPLE__)
@@ -193,9 +235,6 @@ extern "C" {
#define GL_GLEXT_LEGACY
#endif
#include
- #if defined(GLFW_INCLUDE_GLU)
- #include
- #endif
#else /*__APPLE__*/
@@ -203,18 +242,11 @@ extern "C" {
#if defined(GLFW_INCLUDE_GLEXT)
#include
#endif
- #if defined(GLFW_INCLUDE_GLU)
- #include
- #endif
#endif /*__APPLE__*/
#endif /* OpenGL and OpenGL ES headers */
-#if defined(GLFW_INCLUDE_VULKAN)
- #include
-#endif /* Vulkan header */
-
#if defined(GLFW_DLL) && defined(_GLFW_BUILD_DLL)
/* GLFW_DLL must be defined by applications that are linking against the DLL
* version of the GLFW library. _GLFW_BUILD_DLL is defined by the GLFW
@@ -230,13 +262,12 @@ extern "C" {
/* We are building GLFW as a Win32 DLL */
#define GLFWAPI __declspec(dllexport)
#elif defined(_WIN32) && defined(GLFW_DLL)
- /* We are calling GLFW as a Win32 DLL */
+ /* We are calling a GLFW Win32 DLL */
#define GLFWAPI __declspec(dllimport)
#elif defined(__GNUC__) && defined(_GLFW_BUILD_DLL)
- /* We are building GLFW as a shared / dynamic library */
+ /* We are building GLFW as a Unix shared library */
#define GLFWAPI __attribute__((visibility("default")))
#else
- /* We are building or calling GLFW as a static library */
#define GLFWAPI
#endif
@@ -247,45 +278,47 @@ extern "C" {
/*! @name GLFW version macros
* @{ */
-/*! @brief The major version number of the GLFW library.
+/*! @brief The major version number of the GLFW header.
*
- * This is incremented when the API is changed in non-compatible ways.
+ * The major version number of the GLFW header. This is incremented when the
+ * API is changed in non-compatible ways.
* @ingroup init
*/
#define GLFW_VERSION_MAJOR 3
-/*! @brief The minor version number of the GLFW library.
+/*! @brief The minor version number of the GLFW header.
*
- * This is incremented when features are added to the API but it remains
- * backward-compatible.
+ * The minor version number of the GLFW header. This is incremented when
+ * features are added to the API but it remains backward-compatible.
* @ingroup init
*/
-#define GLFW_VERSION_MINOR 3
-/*! @brief The revision number of the GLFW library.
+#define GLFW_VERSION_MINOR 5
+/*! @brief The revision number of the GLFW header.
*
- * This is incremented when a bug fix release is made that does not contain any
- * API changes.
+ * The revision number of the GLFW header. This is incremented when a bug fix
+ * release is made that does not contain any API changes.
* @ingroup init
*/
#define GLFW_VERSION_REVISION 0
/*! @} */
-/*! @name Boolean values
- * @{ */
/*! @brief One.
*
- * One. Seriously. You don't _need_ to use this symbol in your code. It's
- * semantic sugar for the number 1. You can also use `1` or `true` or `_True`
- * or `GL_TRUE` or whatever you want.
+ * This is only semantic sugar for the number 1. You can instead use `1` or
+ * `true` or `_True` or `GL_TRUE` or `VK_TRUE` or anything else that is equal
+ * to one.
+ *
+ * @ingroup init
*/
#define GLFW_TRUE 1
/*! @brief Zero.
*
- * Zero. Seriously. You don't _need_ to use this symbol in your code. It's
- * semantic sugar for the number 0. You can also use `0` or `false` or
- * `_False` or `GL_FALSE` or whatever you want.
+ * This is only semantic sugar for the number 0. You can instead use `0` or
+ * `false` or `_False` or `GL_FALSE` or `VK_FALSE` or anything else that is
+ * equal to zero.
+ *
+ * @ingroup init
*/
#define GLFW_FALSE 0
-/*! @} */
/*! @name Key and button actions
* @{ */
@@ -313,6 +346,7 @@ extern "C" {
/*! @} */
/*! @defgroup hat_state Joystick hat states
+ * @brief Joystick hat states.
*
* See [joystick hat input](@ref joystick_hat) for how these are used.
*
@@ -327,10 +361,15 @@ extern "C" {
#define GLFW_HAT_RIGHT_DOWN (GLFW_HAT_RIGHT | GLFW_HAT_DOWN)
#define GLFW_HAT_LEFT_UP (GLFW_HAT_LEFT | GLFW_HAT_UP)
#define GLFW_HAT_LEFT_DOWN (GLFW_HAT_LEFT | GLFW_HAT_DOWN)
+
+/*! @ingroup input
+ */
+#define GLFW_KEY_UNKNOWN -1
+
/*! @} */
-/*! @defgroup keys Keyboard keys
- * @brief Keyboard key IDs.
+/*! @defgroup keys Keyboard key tokens
+ * @brief Keyboard key tokens.
*
* See [key input](@ref input_key) for how these are used.
*
@@ -340,7 +379,7 @@ extern "C" {
*
* The naming of the key codes follow these rules:
* - The US keyboard layout is used
- * - Names of printable alpha-numeric characters are used (e.g. "A", "R",
+ * - Names of printable alphanumeric characters are used (e.g. "A", "R",
* "3", etc.)
* - For non-alphanumeric characters, Unicode:ish names are used (e.g.
* "COMMA", "LEFT_SQUARE_BRACKET", etc.). Note that some names do not
@@ -353,9 +392,6 @@ extern "C" {
* @{
*/
-/* The unknown key */
-#define GLFW_KEY_UNKNOWN -1
-
/* Printable keys */
#define GLFW_KEY_SPACE 32
#define GLFW_KEY_APOSTROPHE 39 /* ' */
@@ -493,17 +529,37 @@ extern "C" {
* @{ */
/*! @brief If this bit is set one or more Shift keys were held down.
+ *
+ * If this bit is set one or more Shift keys were held down.
*/
#define GLFW_MOD_SHIFT 0x0001
/*! @brief If this bit is set one or more Control keys were held down.
+ *
+ * If this bit is set one or more Control keys were held down.
*/
#define GLFW_MOD_CONTROL 0x0002
/*! @brief If this bit is set one or more Alt keys were held down.
+ *
+ * If this bit is set one or more Alt keys were held down.
*/
#define GLFW_MOD_ALT 0x0004
/*! @brief If this bit is set one or more Super keys were held down.
+ *
+ * If this bit is set one or more Super keys were held down.
*/
#define GLFW_MOD_SUPER 0x0008
+/*! @brief If this bit is set the Caps Lock key is enabled.
+ *
+ * If this bit is set the Caps Lock key is enabled and the @ref
+ * GLFW_LOCK_KEY_MODS input mode is set.
+ */
+#define GLFW_MOD_CAPS_LOCK 0x0010
+/*! @brief If this bit is set the Num Lock key is enabled.
+ *
+ * If this bit is set the Num Lock key is enabled and the @ref
+ * GLFW_LOCK_KEY_MODS input mode is set.
+ */
+#define GLFW_MOD_NUM_LOCK 0x0020
/*! @} */
@@ -665,7 +721,7 @@ extern "C" {
* GLFW could not find support for the requested API on the system.
*
* @analysis The installed graphics driver does not support the requested
- * API, or does not support it via the chosen context creation backend.
+ * API, or does not support it via the chosen context creation API.
* Below are a few examples.
*
* @par
@@ -731,6 +787,66 @@ extern "C" {
* @analysis Application programmer error. Fix the offending call.
*/
#define GLFW_NO_WINDOW_CONTEXT 0x0001000A
+/*! @brief The specified cursor shape is not available.
+ *
+ * The specified standard cursor shape is not available, either because the
+ * current platform cursor theme does not provide it or because it is not
+ * available on the platform.
+ *
+ * @analysis Platform or system settings limitation. Pick another
+ * [standard cursor shape](@ref shapes) or create a
+ * [custom cursor](@ref cursor_custom).
+ */
+#define GLFW_CURSOR_UNAVAILABLE 0x0001000B
+/*! @brief The requested feature is not provided by the platform.
+ *
+ * The requested feature is not provided by the platform, so GLFW is unable to
+ * implement it. The documentation for each function notes if it could emit
+ * this error.
+ *
+ * @analysis Platform or platform version limitation. The error can be ignored
+ * unless the feature is critical to the application.
+ *
+ * @par
+ * A function call that emits this error has no effect other than the error and
+ * updating any existing out parameters.
+ */
+#define GLFW_FEATURE_UNAVAILABLE 0x0001000C
+/*! @brief The requested feature is not implemented for the platform.
+ *
+ * The requested feature has not yet been implemented in GLFW for this platform.
+ *
+ * @analysis An incomplete implementation of GLFW for this platform, hopefully
+ * fixed in a future release. The error can be ignored unless the feature is
+ * critical to the application.
+ *
+ * @par
+ * A function call that emits this error has no effect other than the error and
+ * updating any existing out parameters.
+ */
+#define GLFW_FEATURE_UNIMPLEMENTED 0x0001000D
+/*! @brief Platform unavailable or no matching platform was found.
+ *
+ * If emitted during initialization, no matching platform was found. If the @ref
+ * GLFW_PLATFORM init hint was set to `GLFW_ANY_PLATFORM`, GLFW could not detect any of
+ * the platforms supported by this library binary, except for the Null platform. If the
+ * init hint was set to a specific platform, it is either not supported by this library
+ * binary or GLFW was not able to detect it.
+ *
+ * If emitted by a native access function, GLFW was initialized for a different platform
+ * than the function is for.
+ *
+ * @analysis Failure to detect any platform usually only happens on non-macOS Unix
+ * systems, either when no window system is running or the program was run from
+ * a terminal that does not have the necessary environment variables. Fall back to
+ * a different platform if possible or notify the user that no usable platform was
+ * detected.
+ *
+ * Failure to detect a specific platform may have the same cause as above or be because
+ * support for that platform was not compiled in. Call @ref glfwPlatformSupported to
+ * check whether a specific platform is supported by a library binary.
+ */
+#define GLFW_PLATFORM_UNAVAILABLE 0x0001000E
/*! @} */
/*! @addtogroup window
@@ -789,10 +905,41 @@ extern "C" {
#define GLFW_CENTER_CURSOR 0x00020009
/*! @brief Window framebuffer transparency hint and attribute
*
- * Window framebuffer transparency [window hint](@ref GLFW_TRANSPARENT_hint)
- * and [window attribute](@ref GLFW_TRANSPARENT_attrib).
+ * Window framebuffer transparency
+ * [window hint](@ref GLFW_TRANSPARENT_FRAMEBUFFER_hint) and
+ * [window attribute](@ref GLFW_TRANSPARENT_FRAMEBUFFER_attrib).
+ */
+#define GLFW_TRANSPARENT_FRAMEBUFFER 0x0002000A
+/*! @brief Mouse cursor hover window attribute.
+ *
+ * Mouse cursor hover [window attribute](@ref GLFW_HOVERED_attrib).
*/
-#define GLFW_TRANSPARENT 0x0002000A
+#define GLFW_HOVERED 0x0002000B
+/*! @brief Input focus on calling show window hint and attribute
+ *
+ * Input focus [window hint](@ref GLFW_FOCUS_ON_SHOW_hint) or
+ * [window attribute](@ref GLFW_FOCUS_ON_SHOW_attrib).
+ */
+#define GLFW_FOCUS_ON_SHOW 0x0002000C
+
+/*! @brief Mouse input transparency window hint and attribute
+ *
+ * Mouse input transparency [window hint](@ref GLFW_MOUSE_PASSTHROUGH_hint) or
+ * [window attribute](@ref GLFW_MOUSE_PASSTHROUGH_attrib).
+ */
+#define GLFW_MOUSE_PASSTHROUGH 0x0002000D
+
+/*! @brief Initial position x-coordinate window hint.
+ *
+ * Initial position x-coordinate [window hint](@ref GLFW_POSITION_X).
+ */
+#define GLFW_POSITION_X 0x0002000E
+
+/*! @brief Initial position y-coordinate window hint.
+ *
+ * Initial position y-coordinate [window hint](@ref GLFW_POSITION_Y).
+ */
+#define GLFW_POSITION_Y 0x0002000F
/*! @brief Framebuffer bit depth hint.
*
@@ -869,9 +1016,10 @@ extern "C" {
* Monitor refresh rate [hint](@ref GLFW_REFRESH_RATE).
*/
#define GLFW_REFRESH_RATE 0x0002100F
-/*! @brief Framebuffer double buffering hint.
+/*! @brief Framebuffer double buffering hint and attribute.
*
- * Framebuffer double buffering [hint](@ref GLFW_DOUBLEBUFFER).
+ * Framebuffer double buffering [hint](@ref GLFW_DOUBLEBUFFER_hint) and
+ * [attribute](@ref GLFW_DOUBLEBUFFER_attrib).
*/
#define GLFW_DOUBLEBUFFER 0x00021010
@@ -883,68 +1031,110 @@ extern "C" {
#define GLFW_CLIENT_API 0x00022001
/*! @brief Context client API major version hint and attribute.
*
- * Context client API major version [hint](@ref GLFW_CLIENT_API_hint) and
- * [attribute](@ref GLFW_CLIENT_API_attrib).
+ * Context client API major version [hint](@ref GLFW_CONTEXT_VERSION_MAJOR_hint)
+ * and [attribute](@ref GLFW_CONTEXT_VERSION_MAJOR_attrib).
*/
#define GLFW_CONTEXT_VERSION_MAJOR 0x00022002
/*! @brief Context client API minor version hint and attribute.
*
- * Context client API minor version [hint](@ref GLFW_CLIENT_API_hint) and
- * [attribute](@ref GLFW_CLIENT_API_attrib).
+ * Context client API minor version [hint](@ref GLFW_CONTEXT_VERSION_MINOR_hint)
+ * and [attribute](@ref GLFW_CONTEXT_VERSION_MINOR_attrib).
*/
#define GLFW_CONTEXT_VERSION_MINOR 0x00022003
-/*! @brief Context client API revision number hint and attribute.
+/*! @brief Context client API revision number attribute.
*
- * Context client API revision number [hint](@ref GLFW_CLIENT_API_hint) and
- * [attribute](@ref GLFW_CLIENT_API_attrib).
+ * Context client API revision number
+ * [attribute](@ref GLFW_CONTEXT_REVISION_attrib).
*/
#define GLFW_CONTEXT_REVISION 0x00022004
/*! @brief Context robustness hint and attribute.
*
- * Context client API revision number [hint](@ref GLFW_CLIENT_API_hint) and
- * [attribute](@ref GLFW_CLIENT_API_attrib).
+ * Context client API revision number [hint](@ref GLFW_CONTEXT_ROBUSTNESS_hint)
+ * and [attribute](@ref GLFW_CONTEXT_ROBUSTNESS_attrib).
*/
#define GLFW_CONTEXT_ROBUSTNESS 0x00022005
/*! @brief OpenGL forward-compatibility hint and attribute.
*
- * OpenGL forward-compatibility [hint](@ref GLFW_CLIENT_API_hint) and
- * [attribute](@ref GLFW_CLIENT_API_attrib).
+ * OpenGL forward-compatibility [hint](@ref GLFW_OPENGL_FORWARD_COMPAT_hint)
+ * and [attribute](@ref GLFW_OPENGL_FORWARD_COMPAT_attrib).
*/
#define GLFW_OPENGL_FORWARD_COMPAT 0x00022006
-/*! @brief OpenGL debug context hint and attribute.
+/*! @brief Debug mode context hint and attribute.
*
- * OpenGL debug context [hint](@ref GLFW_CLIENT_API_hint) and
- * [attribute](@ref GLFW_CLIENT_API_attrib).
+ * Debug mode context [hint](@ref GLFW_CONTEXT_DEBUG_hint) and
+ * [attribute](@ref GLFW_CONTEXT_DEBUG_attrib).
+ */
+#define GLFW_CONTEXT_DEBUG 0x00022007
+/*! @brief Legacy name for compatibility.
+ *
+ * This is an alias for compatibility with earlier versions.
*/
-#define GLFW_OPENGL_DEBUG_CONTEXT 0x00022007
+#define GLFW_OPENGL_DEBUG_CONTEXT GLFW_CONTEXT_DEBUG
/*! @brief OpenGL profile hint and attribute.
*
- * OpenGL profile [hint](@ref GLFW_CLIENT_API_hint) and
- * [attribute](@ref GLFW_CLIENT_API_attrib).
+ * OpenGL profile [hint](@ref GLFW_OPENGL_PROFILE_hint) and
+ * [attribute](@ref GLFW_OPENGL_PROFILE_attrib).
*/
#define GLFW_OPENGL_PROFILE 0x00022008
/*! @brief Context flush-on-release hint and attribute.
*
- * Context flush-on-release [hint](@ref GLFW_CLIENT_API_hint) and
- * [attribute](@ref GLFW_CLIENT_API_attrib).
+ * Context flush-on-release [hint](@ref GLFW_CONTEXT_RELEASE_BEHAVIOR_hint) and
+ * [attribute](@ref GLFW_CONTEXT_RELEASE_BEHAVIOR_attrib).
*/
#define GLFW_CONTEXT_RELEASE_BEHAVIOR 0x00022009
/*! @brief Context error suppression hint and attribute.
*
- * Context error suppression [hint](@ref GLFW_CLIENT_API_hint) and
- * [attribute](@ref GLFW_CLIENT_API_attrib).
+ * Context error suppression [hint](@ref GLFW_CONTEXT_NO_ERROR_hint) and
+ * [attribute](@ref GLFW_CONTEXT_NO_ERROR_attrib).
*/
#define GLFW_CONTEXT_NO_ERROR 0x0002200A
/*! @brief Context creation API hint and attribute.
*
- * Context creation API [hint](@ref GLFW_CLIENT_API_hint) and
- * [attribute](@ref GLFW_CLIENT_API_attrib).
+ * Context creation API [hint](@ref GLFW_CONTEXT_CREATION_API_hint) and
+ * [attribute](@ref GLFW_CONTEXT_CREATION_API_attrib).
*/
#define GLFW_CONTEXT_CREATION_API 0x0002200B
-
+/*! @brief Window content area scaling window
+ * [window hint](@ref GLFW_SCALE_TO_MONITOR).
+ */
+#define GLFW_SCALE_TO_MONITOR 0x0002200C
+/*! @brief Window framebuffer scaling
+ * [window hint](@ref GLFW_SCALE_FRAMEBUFFER_hint).
+ */
+#define GLFW_SCALE_FRAMEBUFFER 0x0002200D
+/*! @brief Legacy name for compatibility.
+ *
+ * This is an alias for the
+ * [GLFW_SCALE_FRAMEBUFFER](@ref GLFW_SCALE_FRAMEBUFFER_hint) window hint for
+ * compatibility with earlier versions.
+ */
#define GLFW_COCOA_RETINA_FRAMEBUFFER 0x00023001
-#define GLFW_COCOA_FRAME_AUTOSAVE 0x00023002
+/*! @brief macOS specific
+ * [window hint](@ref GLFW_COCOA_FRAME_NAME_hint).
+ */
+#define GLFW_COCOA_FRAME_NAME 0x00023002
+/*! @brief macOS specific
+ * [window hint](@ref GLFW_COCOA_GRAPHICS_SWITCHING_hint).
+ */
#define GLFW_COCOA_GRAPHICS_SWITCHING 0x00023003
+/*! @brief X11 specific
+ * [window hint](@ref GLFW_X11_CLASS_NAME_hint).
+ */
+#define GLFW_X11_CLASS_NAME 0x00024001
+/*! @brief X11 specific
+ * [window hint](@ref GLFW_X11_CLASS_NAME_hint).
+ */
+#define GLFW_X11_INSTANCE_NAME 0x00024002
+#define GLFW_WIN32_KEYBOARD_MENU 0x00025001
+/*! @brief Win32 specific [window hint](@ref GLFW_WIN32_SHOWDEFAULT_hint).
+ */
+#define GLFW_WIN32_SHOWDEFAULT 0x00025002
+/*! @brief Wayland specific
+ * [window hint](@ref GLFW_WAYLAND_APP_ID_hint).
+ *
+ * Allows specification of the Wayland app_id.
+ */
+#define GLFW_WAYLAND_APP_ID 0x00026001
/*! @} */
#define GLFW_NO_API 0
@@ -959,13 +1149,17 @@ extern "C" {
#define GLFW_OPENGL_CORE_PROFILE 0x00032001
#define GLFW_OPENGL_COMPAT_PROFILE 0x00032002
-#define GLFW_CURSOR 0x00033001
-#define GLFW_STICKY_KEYS 0x00033002
-#define GLFW_STICKY_MOUSE_BUTTONS 0x00033003
+#define GLFW_CURSOR 0x00033001
+#define GLFW_STICKY_KEYS 0x00033002
+#define GLFW_STICKY_MOUSE_BUTTONS 0x00033003
+#define GLFW_LOCK_KEY_MODS 0x00033004
+#define GLFW_RAW_MOUSE_MOTION 0x00033005
+#define GLFW_UNLIMITED_MOUSE_BUTTONS 0x00033006
#define GLFW_CURSOR_NORMAL 0x00034001
#define GLFW_CURSOR_HIDDEN 0x00034002
#define GLFW_CURSOR_DISABLED 0x00034003
+#define GLFW_CURSOR_CAPTURED 0x00034004
#define GLFW_ANY_RELEASE_BEHAVIOR 0
#define GLFW_RELEASE_BEHAVIOR_FLUSH 0x00035001
@@ -975,17 +1169,31 @@ extern "C" {
#define GLFW_EGL_CONTEXT_API 0x00036002
#define GLFW_OSMESA_CONTEXT_API 0x00036003
+#define GLFW_ANGLE_PLATFORM_TYPE_NONE 0x00037001
+#define GLFW_ANGLE_PLATFORM_TYPE_OPENGL 0x00037002
+#define GLFW_ANGLE_PLATFORM_TYPE_OPENGLES 0x00037003
+#define GLFW_ANGLE_PLATFORM_TYPE_D3D9 0x00037004
+#define GLFW_ANGLE_PLATFORM_TYPE_D3D11 0x00037005
+#define GLFW_ANGLE_PLATFORM_TYPE_VULKAN 0x00037007
+#define GLFW_ANGLE_PLATFORM_TYPE_METAL 0x00037008
+
+#define GLFW_WAYLAND_PREFER_LIBDECOR 0x00038001
+#define GLFW_WAYLAND_DISABLE_LIBDECOR 0x00038002
+
+#define GLFW_ANY_POSITION 0x80000000
+
/*! @defgroup shapes Standard cursor shapes
* @brief Standard system cursor shapes.
*
- * See [standard cursor creation](@ref cursor_standard) for how these are used.
+ * These are the [standard cursor shapes](@ref cursor_standard) that can be
+ * requested from the platform (window system).
*
* @ingroup input
* @{ */
/*! @brief The regular arrow cursor shape.
*
- * The regular arrow cursor.
+ * The regular arrow cursor shape.
*/
#define GLFW_ARROW_CURSOR 0x00036001
/*! @brief The text input I-beam cursor shape.
@@ -993,26 +1201,91 @@ extern "C" {
* The text input I-beam cursor shape.
*/
#define GLFW_IBEAM_CURSOR 0x00036002
-/*! @brief The crosshair shape.
+/*! @brief The crosshair cursor shape.
*
- * The crosshair shape.
+ * The crosshair cursor shape.
*/
#define GLFW_CROSSHAIR_CURSOR 0x00036003
-/*! @brief The hand shape.
+/*! @brief The pointing hand cursor shape.
+ *
+ * The pointing hand cursor shape.
+ */
+#define GLFW_POINTING_HAND_CURSOR 0x00036004
+/*! @brief The horizontal resize/move arrow shape.
+ *
+ * The horizontal resize/move arrow shape. This is usually a horizontal
+ * double-headed arrow.
+ */
+#define GLFW_RESIZE_EW_CURSOR 0x00036005
+/*! @brief The vertical resize/move arrow shape.
+ *
+ * The vertical resize/move shape. This is usually a vertical double-headed
+ * arrow.
+ */
+#define GLFW_RESIZE_NS_CURSOR 0x00036006
+/*! @brief The top-left to bottom-right diagonal resize/move arrow shape.
+ *
+ * The top-left to bottom-right diagonal resize/move shape. This is usually
+ * a diagonal double-headed arrow.
+ *
+ * @note __macOS:__ This shape is provided by a private system API and may fail
+ * with @ref GLFW_CURSOR_UNAVAILABLE in the future.
+ *
+ * @note __Wayland:__ This shape is provided by a newer standard not supported by
+ * all cursor themes.
+ *
+ * @note __X11:__ This shape is provided by a newer standard not supported by all
+ * cursor themes.
+ */
+#define GLFW_RESIZE_NWSE_CURSOR 0x00036007
+/*! @brief The top-right to bottom-left diagonal resize/move arrow shape.
*
- * The hand shape.
+ * The top-right to bottom-left diagonal resize/move shape. This is usually
+ * a diagonal double-headed arrow.
+ *
+ * @note __macOS:__ This shape is provided by a private system API and may fail
+ * with @ref GLFW_CURSOR_UNAVAILABLE in the future.
+ *
+ * @note __Wayland:__ This shape is provided by a newer standard not supported by
+ * all cursor themes.
+ *
+ * @note __X11:__ This shape is provided by a newer standard not supported by all
+ * cursor themes.
+ */
+#define GLFW_RESIZE_NESW_CURSOR 0x00036008
+/*! @brief The omni-directional resize/move cursor shape.
+ *
+ * The omni-directional resize cursor/move shape. This is usually either
+ * a combined horizontal and vertical double-headed arrow or a grabbing hand.
+ */
+#define GLFW_RESIZE_ALL_CURSOR 0x00036009
+/*! @brief The operation-not-allowed shape.
+ *
+ * The operation-not-allowed shape. This is usually a circle with a diagonal
+ * line through it.
+ *
+ * @note __Wayland:__ This shape is provided by a newer standard not supported by
+ * all cursor themes.
+ *
+ * @note __X11:__ This shape is provided by a newer standard not supported by all
+ * cursor themes.
+ */
+#define GLFW_NOT_ALLOWED_CURSOR 0x0003600A
+/*! @brief Legacy name for compatibility.
+ *
+ * This is an alias for compatibility with earlier versions.
*/
-#define GLFW_HAND_CURSOR 0x00036004
-/*! @brief The horizontal resize arrow shape.
+#define GLFW_HRESIZE_CURSOR GLFW_RESIZE_EW_CURSOR
+/*! @brief Legacy name for compatibility.
*
- * The horizontal resize arrow shape.
+ * This is an alias for compatibility with earlier versions.
*/
-#define GLFW_HRESIZE_CURSOR 0x00036005
-/*! @brief The vertical resize arrow shape.
+#define GLFW_VRESIZE_CURSOR GLFW_RESIZE_NS_CURSOR
+/*! @brief Legacy name for compatibility.
*
- * The vertical resize arrow shape.
+ * This is an alias for compatibility with earlier versions.
*/
-#define GLFW_VRESIZE_CURSOR 0x00036006
+#define GLFW_HAND_CURSOR GLFW_POINTING_HAND_CURSOR
/*! @} */
#define GLFW_CONNECTED 0x00040001
@@ -1020,13 +1293,55 @@ extern "C" {
/*! @addtogroup init
* @{ */
+/*! @brief Joystick hat buttons init hint.
+ *
+ * Joystick hat buttons [init hint](@ref GLFW_JOYSTICK_HAT_BUTTONS).
+ */
#define GLFW_JOYSTICK_HAT_BUTTONS 0x00050001
-
+/*! @brief ANGLE rendering backend init hint.
+ *
+ * ANGLE rendering backend [init hint](@ref GLFW_ANGLE_PLATFORM_TYPE_hint).
+ */
+#define GLFW_ANGLE_PLATFORM_TYPE 0x00050002
+/*! @brief Platform selection init hint.
+ *
+ * Platform selection [init hint](@ref GLFW_PLATFORM).
+ */
+#define GLFW_PLATFORM 0x00050003
+/*! @brief macOS specific init hint.
+ *
+ * macOS specific [init hint](@ref GLFW_COCOA_CHDIR_RESOURCES_hint).
+ */
#define GLFW_COCOA_CHDIR_RESOURCES 0x00051001
+/*! @brief macOS specific init hint.
+ *
+ * macOS specific [init hint](@ref GLFW_COCOA_MENUBAR_hint).
+ */
#define GLFW_COCOA_MENUBAR 0x00051002
+/*! @brief X11 specific init hint.
+ *
+ * X11 specific [init hint](@ref GLFW_X11_XCB_VULKAN_SURFACE_hint).
+ */
+#define GLFW_X11_XCB_VULKAN_SURFACE 0x00052001
+/*! @brief Wayland specific init hint.
+ *
+ * Wayland specific [init hint](@ref GLFW_WAYLAND_LIBDECOR_hint).
+ */
+#define GLFW_WAYLAND_LIBDECOR 0x00053001
+/*! @} */
-#define GLFW_X11_WM_CLASS_NAME 0x00052001
-#define GLFW_X11_WM_CLASS_CLASS 0x00052002
+/*! @addtogroup init
+ * @{ */
+/*! @brief Hint value that enables automatic platform selection.
+ *
+ * Hint value for @ref GLFW_PLATFORM that enables automatic platform selection.
+ */
+#define GLFW_ANY_PLATFORM 0x00060000
+#define GLFW_PLATFORM_WIN32 0x00060001
+#define GLFW_PLATFORM_COCOA 0x00060002
+#define GLFW_PLATFORM_WAYLAND 0x00060003
+#define GLFW_PLATFORM_X11 0x00060004
+#define GLFW_PLATFORM_NULL 0x00060005
/*! @} */
#define GLFW_DONT_CARE -1
@@ -1045,7 +1360,7 @@ extern "C" {
* @sa @ref glfwGetProcAddress
*
* @since Added in version 3.0.
-
+ *
* @ingroup context
*/
typedef void (*GLFWglproc)(void);
@@ -1096,17 +1411,176 @@ typedef struct GLFWwindow GLFWwindow;
*
* @since Added in version 3.1.
*
- * @ingroup cursor
+ * @ingroup input
*/
typedef struct GLFWcursor GLFWcursor;
-/*! @brief The function signature for error callbacks.
+/*! @brief The function pointer type for memory allocation callbacks.
+ *
+ * This is the function pointer type for memory allocation callbacks. A memory
+ * allocation callback function has the following signature:
+ * @code
+ * void* function_name(size_t size, void* user)
+ * @endcode
+ *
+ * This function must return either a memory block at least `size` bytes long,
+ * or `NULL` if allocation failed. Note that not all parts of GLFW handle allocation
+ * failures gracefully yet.
+ *
+ * This function must support being called during @ref glfwInit but before the library is
+ * flagged as initialized, as well as during @ref glfwTerminate after the library is no
+ * longer flagged as initialized.
+ *
+ * Any memory allocated via this function will be deallocated via the same allocator
+ * during library termination or earlier.
+ *
+ * Any memory allocated via this function must be suitably aligned for any object type.
+ * If you are using C99 or earlier, this alignment is platform-dependent but will be the
+ * same as what `malloc` provides. If you are using C11 or later, this is the value of
+ * `alignof(max_align_t)`.
+ *
+ * The size will always be greater than zero. Allocations of size zero are filtered out
+ * before reaching the custom allocator.
+ *
+ * If this function returns `NULL`, GLFW will emit @ref GLFW_OUT_OF_MEMORY.
+ *
+ * This function must not call any GLFW function.
+ *
+ * @param[in] size The minimum size, in bytes, of the memory block.
+ * @param[in] user The user-defined pointer from the allocator.
+ * @return The address of the newly allocated memory block, or `NULL` if an
+ * error occurred.
+ *
+ * @pointer_lifetime The returned memory block must be valid at least until it
+ * is deallocated.
+ *
+ * @reentrancy This function should not call any GLFW function.
+ *
+ * @thread_safety This function must support being called from any thread that calls GLFW
+ * functions.
+ *
+ * @sa @ref init_allocator
+ * @sa @ref GLFWallocator
+ *
+ * @since Added in version 3.4.
+ *
+ * @ingroup init
+ */
+typedef void* (* GLFWallocatefun)(size_t size, void* user);
+
+/*! @brief The function pointer type for memory reallocation callbacks.
+ *
+ * This is the function pointer type for memory reallocation callbacks.
+ * A memory reallocation callback function has the following signature:
+ * @code
+ * void* function_name(void* block, size_t size, void* user)
+ * @endcode
+ *
+ * This function must return a memory block at least `size` bytes long, or
+ * `NULL` if allocation failed. Note that not all parts of GLFW handle allocation
+ * failures gracefully yet.
+ *
+ * This function must support being called during @ref glfwInit but before the library is
+ * flagged as initialized, as well as during @ref glfwTerminate after the library is no
+ * longer flagged as initialized.
+ *
+ * Any memory allocated via this function will be deallocated via the same allocator
+ * during library termination or earlier.
+ *
+ * Any memory allocated via this function must be suitably aligned for any object type.
+ * If you are using C99 or earlier, this alignment is platform-dependent but will be the
+ * same as what `realloc` provides. If you are using C11 or later, this is the value of
+ * `alignof(max_align_t)`.
+ *
+ * The block address will never be `NULL` and the size will always be greater than zero.
+ * Reallocations of a block to size zero are converted into deallocations before reaching
+ * the custom allocator. Reallocations of `NULL` to a non-zero size are converted into
+ * regular allocations before reaching the custom allocator.
+ *
+ * If this function returns `NULL`, GLFW will emit @ref GLFW_OUT_OF_MEMORY.
+ *
+ * This function must not call any GLFW function.
+ *
+ * @param[in] block The address of the memory block to reallocate.
+ * @param[in] size The new minimum size, in bytes, of the memory block.
+ * @param[in] user The user-defined pointer from the allocator.
+ * @return The address of the newly allocated or resized memory block, or
+ * `NULL` if an error occurred.
+ *
+ * @pointer_lifetime The returned memory block must be valid at least until it
+ * is deallocated.
+ *
+ * @reentrancy This function should not call any GLFW function.
+ *
+ * @thread_safety This function must support being called from any thread that calls GLFW
+ * functions.
+ *
+ * @sa @ref init_allocator
+ * @sa @ref GLFWallocator
+ *
+ * @since Added in version 3.4.
+ *
+ * @ingroup init
+ */
+typedef void* (* GLFWreallocatefun)(void* block, size_t size, void* user);
+
+/*! @brief The function pointer type for memory deallocation callbacks.
+ *
+ * This is the function pointer type for memory deallocation callbacks.
+ * A memory deallocation callback function has the following signature:
+ * @code
+ * void function_name(void* block, void* user)
+ * @endcode
+ *
+ * This function may deallocate the specified memory block. This memory block
+ * will have been allocated with the same allocator.
+ *
+ * This function must support being called during @ref glfwInit but before the library is
+ * flagged as initialized, as well as during @ref glfwTerminate after the library is no
+ * longer flagged as initialized.
+ *
+ * The block address will never be `NULL`. Deallocations of `NULL` are filtered out
+ * before reaching the custom allocator.
+ *
+ * If this function returns `NULL`, GLFW will emit @ref GLFW_OUT_OF_MEMORY.
+ *
+ * This function must not call any GLFW function.
+ *
+ * @param[in] block The address of the memory block to deallocate.
+ * @param[in] user The user-defined pointer from the allocator.
+ *
+ * @pointer_lifetime The specified memory block will not be accessed by GLFW
+ * after this function is called.
+ *
+ * @reentrancy This function should not call any GLFW function.
+ *
+ * @thread_safety This function must support being called from any thread that calls GLFW
+ * functions.
+ *
+ * @sa @ref init_allocator
+ * @sa @ref GLFWallocator
+ *
+ * @since Added in version 3.4.
+ *
+ * @ingroup init
+ */
+typedef void (* GLFWdeallocatefun)(void* block, void* user);
+
+/*! @brief The function pointer type for error callbacks.
*
- * This is the function signature for error callback functions.
+ * This is the function pointer type for error callbacks. An error callback
+ * function has the following signature:
+ * @code
+ * void callback_name(int error_code, const char* description)
+ * @endcode
*
- * @param[in] error An [error code](@ref errors).
+ * @param[in] error_code An [error code](@ref errors). Future releases may add
+ * more error codes.
* @param[in] description A UTF-8 encoded string describing the error.
*
+ * @pointer_lifetime The error description string is valid until the callback
+ * function returns.
+ *
* @sa @ref error_handling
* @sa @ref glfwSetErrorCallback
*
@@ -1114,17 +1588,21 @@ typedef struct GLFWcursor GLFWcursor;
*
* @ingroup init
*/
-typedef void (* GLFWerrorfun)(int,const char*);
+typedef void (* GLFWerrorfun)(int error_code, const char* description);
-/*! @brief The function signature for window position callbacks.
+/*! @brief The function pointer type for window position callbacks.
*
- * This is the function signature for window position callback functions.
+ * This is the function pointer type for window position callbacks. A window
+ * position callback function has the following signature:
+ * @code
+ * void callback_name(GLFWwindow* window, int xpos, int ypos)
+ * @endcode
*
* @param[in] window The window that was moved.
* @param[in] xpos The new x-coordinate, in screen coordinates, of the
- * upper-left corner of the client area of the window.
+ * upper-left corner of the content area of the window.
* @param[in] ypos The new y-coordinate, in screen coordinates, of the
- * upper-left corner of the client area of the window.
+ * upper-left corner of the content area of the window.
*
* @sa @ref window_pos
* @sa @ref glfwSetWindowPosCallback
@@ -1133,11 +1611,15 @@ typedef void (* GLFWerrorfun)(int,const char*);
*
* @ingroup window
*/
-typedef void (* GLFWwindowposfun)(GLFWwindow*,int,int);
+typedef void (* GLFWwindowposfun)(GLFWwindow* window, int xpos, int ypos);
-/*! @brief The function signature for window resize callbacks.
+/*! @brief The function pointer type for window size callbacks.
*
- * This is the function signature for window size callback functions.
+ * This is the function pointer type for window size callbacks. A window size
+ * callback function has the following signature:
+ * @code
+ * void callback_name(GLFWwindow* window, int width, int height)
+ * @endcode
*
* @param[in] window The window that was resized.
* @param[in] width The new width, in screen coordinates, of the window.
@@ -1147,15 +1629,19 @@ typedef void (* GLFWwindowposfun)(GLFWwindow*,int,int);
* @sa @ref glfwSetWindowSizeCallback
*
* @since Added in version 1.0.
- * @glfw3 Added window handle parameter.
+ * __GLFW 3:__ Added window handle parameter.
*
* @ingroup window
*/
-typedef void (* GLFWwindowsizefun)(GLFWwindow*,int,int);
+typedef void (* GLFWwindowsizefun)(GLFWwindow* window, int width, int height);
-/*! @brief The function signature for window close callbacks.
+/*! @brief The function pointer type for window close callbacks.
*
- * This is the function signature for window close callback functions.
+ * This is the function pointer type for window close callbacks. A window
+ * close callback function has the following signature:
+ * @code
+ * void function_name(GLFWwindow* window)
+ * @endcode
*
* @param[in] window The window that the user attempted to close.
*
@@ -1163,15 +1649,19 @@ typedef void (* GLFWwindowsizefun)(GLFWwindow*,int,int);
* @sa @ref glfwSetWindowCloseCallback
*
* @since Added in version 2.5.
- * @glfw3 Added window handle parameter.
+ * __GLFW 3:__ Added window handle parameter.
*
* @ingroup window
*/
-typedef void (* GLFWwindowclosefun)(GLFWwindow*);
+typedef void (* GLFWwindowclosefun)(GLFWwindow* window);
-/*! @brief The function signature for window content refresh callbacks.
+/*! @brief The function pointer type for window content refresh callbacks.
*
- * This is the function signature for window refresh callback functions.
+ * This is the function pointer type for window content refresh callbacks.
+ * A window content refresh callback function has the following signature:
+ * @code
+ * void function_name(GLFWwindow* window);
+ * @endcode
*
* @param[in] window The window whose content needs to be refreshed.
*
@@ -1179,15 +1669,19 @@ typedef void (* GLFWwindowclosefun)(GLFWwindow*);
* @sa @ref glfwSetWindowRefreshCallback
*
* @since Added in version 2.5.
- * @glfw3 Added window handle parameter.
+ * __GLFW 3:__ Added window handle parameter.
*
* @ingroup window
*/
-typedef void (* GLFWwindowrefreshfun)(GLFWwindow*);
+typedef void (* GLFWwindowrefreshfun)(GLFWwindow* window);
-/*! @brief The function signature for window focus/defocus callbacks.
+/*! @brief The function pointer type for window focus callbacks.
*
- * This is the function signature for window focus callback functions.
+ * This is the function pointer type for window focus callbacks. A window
+ * focus callback function has the following signature:
+ * @code
+ * void function_name(GLFWwindow* window, int focused)
+ * @endcode
*
* @param[in] window The window that gained or lost input focus.
* @param[in] focused `GLFW_TRUE` if the window was given input focus, or
@@ -1200,12 +1694,15 @@ typedef void (* GLFWwindowrefreshfun)(GLFWwindow*);
*
* @ingroup window
*/
-typedef void (* GLFWwindowfocusfun)(GLFWwindow*,int);
+typedef void (* GLFWwindowfocusfun)(GLFWwindow* window, int focused);
-/*! @brief The function signature for window iconify/restore callbacks.
+/*! @brief The function pointer type for window iconify callbacks.
*
- * This is the function signature for window iconify/restore callback
- * functions.
+ * This is the function pointer type for window iconify callbacks. A window
+ * iconify callback function has the following signature:
+ * @code
+ * void function_name(GLFWwindow* window, int iconified)
+ * @endcode
*
* @param[in] window The window that was iconified or restored.
* @param[in] iconified `GLFW_TRUE` if the window was iconified, or
@@ -1218,15 +1715,18 @@ typedef void (* GLFWwindowfocusfun)(GLFWwindow*,int);
*
* @ingroup window
*/
-typedef void (* GLFWwindowiconifyfun)(GLFWwindow*,int);
+typedef void (* GLFWwindowiconifyfun)(GLFWwindow* window, int iconified);
-/*! @brief The function signature for window maximize/restore callbacks.
- *
- * This is the function signature for window maximize/restore callback
- * functions.
+/*! @brief The function pointer type for window maximize callbacks.
+ *
+ * This is the function pointer type for window maximize callbacks. A window
+ * maximize callback function has the following signature:
+ * @code
+ * void function_name(GLFWwindow* window, int maximized)
+ * @endcode
*
* @param[in] window The window that was maximized or restored.
- * @param[in] iconified `GLFW_TRUE` if the window was maximized, or
+ * @param[in] maximized `GLFW_TRUE` if the window was maximized, or
* `GLFW_FALSE` if it was restored.
*
* @sa @ref window_maximize
@@ -1236,12 +1736,15 @@ typedef void (* GLFWwindowiconifyfun)(GLFWwindow*,int);
*
* @ingroup window
*/
-typedef void (* GLFWwindowmaximizefun)(GLFWwindow*,int);
+typedef void (* GLFWwindowmaximizefun)(GLFWwindow* window, int maximized);
-/*! @brief The function signature for framebuffer resize callbacks.
+/*! @brief The function pointer type for framebuffer size callbacks.
*
- * This is the function signature for framebuffer resize callback
- * functions.
+ * This is the function pointer type for framebuffer size callbacks.
+ * A framebuffer size callback function has the following signature:
+ * @code
+ * void function_name(GLFWwindow* window, int width, int height)
+ * @endcode
*
* @param[in] window The window whose framebuffer was resized.
* @param[in] width The new width, in pixels, of the framebuffer.
@@ -1254,16 +1757,42 @@ typedef void (* GLFWwindowmaximizefun)(GLFWwindow*,int);
*
* @ingroup window
*/
-typedef void (* GLFWframebuffersizefun)(GLFWwindow*,int,int);
+typedef void (* GLFWframebuffersizefun)(GLFWwindow* window, int width, int height);
+
+/*! @brief The function pointer type for window content scale callbacks.
+ *
+ * This is the function pointer type for window content scale callbacks.
+ * A window content scale callback function has the following signature:
+ * @code
+ * void function_name(GLFWwindow* window, float xscale, float yscale)
+ * @endcode
+ *
+ * @param[in] window The window whose content scale changed.
+ * @param[in] xscale The new x-axis content scale of the window.
+ * @param[in] yscale The new y-axis content scale of the window.
+ *
+ * @sa @ref window_scale
+ * @sa @ref glfwSetWindowContentScaleCallback
+ *
+ * @since Added in version 3.3.
+ *
+ * @ingroup window
+ */
+typedef void (* GLFWwindowcontentscalefun)(GLFWwindow* window, float xscale, float yscale);
-/*! @brief The function signature for mouse button callbacks.
+/*! @brief The function pointer type for mouse button callbacks.
*
- * This is the function signature for mouse button callback functions.
+ * This is the function pointer type for mouse button callback functions.
+ * A mouse button callback function has the following signature:
+ * @code
+ * void function_name(GLFWwindow* window, int button, int action, int mods)
+ * @endcode
*
* @param[in] window The window that received the event.
* @param[in] button The [mouse button](@ref buttons) that was pressed or
* released.
- * @param[in] action One of `GLFW_PRESS` or `GLFW_RELEASE`.
+ * @param[in] action One of `GLFW_PRESS` or `GLFW_RELEASE`. Future releases
+ * may add more actions.
* @param[in] mods Bit field describing which [modifier keys](@ref mods) were
* held down.
*
@@ -1271,21 +1800,25 @@ typedef void (* GLFWframebuffersizefun)(GLFWwindow*,int,int);
* @sa @ref glfwSetMouseButtonCallback
*
* @since Added in version 1.0.
- * @glfw3 Added window handle and modifier mask parameters.
+ * __GLFW 3:__ Added window handle and modifier mask parameters.
*
* @ingroup input
*/
-typedef void (* GLFWmousebuttonfun)(GLFWwindow*,int,int,int);
+typedef void (* GLFWmousebuttonfun)(GLFWwindow* window, int button, int action, int mods);
-/*! @brief The function signature for cursor position callbacks.
+/*! @brief The function pointer type for cursor position callbacks.
*
- * This is the function signature for cursor position callback functions.
+ * This is the function pointer type for cursor position callbacks. A cursor
+ * position callback function has the following signature:
+ * @code
+ * void function_name(GLFWwindow* window, double xpos, double ypos);
+ * @endcode
*
* @param[in] window The window that received the event.
* @param[in] xpos The new cursor x-coordinate, relative to the left edge of
- * the client area.
+ * the content area.
* @param[in] ypos The new cursor y-coordinate, relative to the top edge of the
- * client area.
+ * content area.
*
* @sa @ref cursor_pos
* @sa @ref glfwSetCursorPosCallback
@@ -1294,14 +1827,18 @@ typedef void (* GLFWmousebuttonfun)(GLFWwindow*,int,int,int);
*
* @ingroup input
*/
-typedef void (* GLFWcursorposfun)(GLFWwindow*,double,double);
+typedef void (* GLFWcursorposfun)(GLFWwindow* window, double xpos, double ypos);
-/*! @brief The function signature for cursor enter/leave callbacks.
+/*! @brief The function pointer type for cursor enter/leave callbacks.
*
- * This is the function signature for cursor enter/leave callback functions.
+ * This is the function pointer type for cursor enter/leave callbacks.
+ * A cursor enter/leave callback function has the following signature:
+ * @code
+ * void function_name(GLFWwindow* window, int entered)
+ * @endcode
*
* @param[in] window The window that received the event.
- * @param[in] entered `GLFW_TRUE` if the cursor entered the window's client
+ * @param[in] entered `GLFW_TRUE` if the cursor entered the window's content
* area, or `GLFW_FALSE` if it left it.
*
* @sa @ref cursor_enter
@@ -1311,11 +1848,15 @@ typedef void (* GLFWcursorposfun)(GLFWwindow*,double,double);
*
* @ingroup input
*/
-typedef void (* GLFWcursorenterfun)(GLFWwindow*,int);
+typedef void (* GLFWcursorenterfun)(GLFWwindow* window, int entered);
-/*! @brief The function signature for scroll callbacks.
+/*! @brief The function pointer type for scroll callbacks.
*
- * This is the function signature for scroll callback functions.
+ * This is the function pointer type for scroll callbacks. A scroll callback
+ * function has the following signature:
+ * @code
+ * void function_name(GLFWwindow* window, double xoffset, double yoffset)
+ * @endcode
*
* @param[in] window The window that received the event.
* @param[in] xoffset The scroll offset along the x-axis.
@@ -1328,16 +1869,21 @@ typedef void (* GLFWcursorenterfun)(GLFWwindow*,int);
*
* @ingroup input
*/
-typedef void (* GLFWscrollfun)(GLFWwindow*,double,double);
+typedef void (* GLFWscrollfun)(GLFWwindow* window, double xoffset, double yoffset);
-/*! @brief The function signature for keyboard key callbacks.
+/*! @brief The function pointer type for keyboard key callbacks.
*
- * This is the function signature for keyboard key callback functions.
+ * This is the function pointer type for keyboard key callbacks. A keyboard
+ * key callback function has the following signature:
+ * @code
+ * void function_name(GLFWwindow* window, int key, int scancode, int action, int mods)
+ * @endcode
*
* @param[in] window The window that received the event.
* @param[in] key The [keyboard key](@ref keys) that was pressed or released.
- * @param[in] scancode The system-specific scancode of the key.
- * @param[in] action `GLFW_PRESS`, `GLFW_RELEASE` or `GLFW_REPEAT`.
+ * @param[in] scancode The platform-specific scancode of the key.
+ * @param[in] action `GLFW_PRESS`, `GLFW_RELEASE` or `GLFW_REPEAT`. Future
+ * releases may add more actions.
* @param[in] mods Bit field describing which [modifier keys](@ref mods) were
* held down.
*
@@ -1345,15 +1891,19 @@ typedef void (* GLFWscrollfun)(GLFWwindow*,double,double);
* @sa @ref glfwSetKeyCallback
*
* @since Added in version 1.0.
- * @glfw3 Added window handle, scancode and modifier mask parameters.
+ * __GLFW 3:__ Added window handle, scancode and modifier mask parameters.
*
* @ingroup input
*/
-typedef void (* GLFWkeyfun)(GLFWwindow*,int,int,int,int);
+typedef void (* GLFWkeyfun)(GLFWwindow* window, int key, int scancode, int action, int mods);
-/*! @brief The function signature for Unicode character callbacks.
+/*! @brief The function pointer type for Unicode character callbacks.
*
- * This is the function signature for Unicode character callback functions.
+ * This is the function pointer type for Unicode character callbacks.
+ * A Unicode character callback function has the following signature:
+ * @code
+ * void function_name(GLFWwindow* window, unsigned int codepoint)
+ * @endcode
*
* @param[in] window The window that received the event.
* @param[in] codepoint The Unicode code point of the character.
@@ -1362,18 +1912,22 @@ typedef void (* GLFWkeyfun)(GLFWwindow*,int,int,int,int);
* @sa @ref glfwSetCharCallback
*
* @since Added in version 2.4.
- * @glfw3 Added window handle parameter.
+ * __GLFW 3:__ Added window handle parameter.
*
* @ingroup input
*/
-typedef void (* GLFWcharfun)(GLFWwindow*,unsigned int);
+typedef void (* GLFWcharfun)(GLFWwindow* window, unsigned int codepoint);
-/*! @brief The function signature for Unicode character with modifiers
+/*! @brief The function pointer type for Unicode character with modifiers
* callbacks.
*
- * This is the function signature for Unicode character with modifiers callback
- * functions. It is called for each input character, regardless of what
- * modifier keys are held down.
+ * This is the function pointer type for Unicode character with modifiers
+ * callbacks. It is called for each input character, regardless of what
+ * modifier keys are held down. A Unicode character with modifiers callback
+ * function has the following signature:
+ * @code
+ * void function_name(GLFWwindow* window, unsigned int codepoint, int mods)
+ * @endcode
*
* @param[in] window The window that received the event.
* @param[in] codepoint The Unicode code point of the character.
@@ -1383,20 +1937,29 @@ typedef void (* GLFWcharfun)(GLFWwindow*,unsigned int);
* @sa @ref input_char
* @sa @ref glfwSetCharModsCallback
*
+ * @deprecated Scheduled for removal in version 4.0.
+ *
* @since Added in version 3.1.
*
* @ingroup input
*/
-typedef void (* GLFWcharmodsfun)(GLFWwindow*,unsigned int,int);
+typedef void (* GLFWcharmodsfun)(GLFWwindow* window, unsigned int codepoint, int mods);
-/*! @brief The function signature for file drop callbacks.
+/*! @brief The function pointer type for path drop callbacks.
*
- * This is the function signature for file drop callbacks.
+ * This is the function pointer type for path drop callbacks. A path drop
+ * callback function has the following signature:
+ * @code
+ * void function_name(GLFWwindow* window, int path_count, const char* paths[])
+ * @endcode
*
* @param[in] window The window that received the event.
- * @param[in] count The number of dropped files.
+ * @param[in] path_count The number of dropped paths.
* @param[in] paths The UTF-8 encoded file and/or directory path names.
*
+ * @pointer_lifetime The path array and its strings are valid until the
+ * callback function returns.
+ *
* @sa @ref path_drop
* @sa @ref glfwSetDropCallback
*
@@ -1404,14 +1967,19 @@ typedef void (* GLFWcharmodsfun)(GLFWwindow*,unsigned int,int);
*
* @ingroup input
*/
-typedef void (* GLFWdropfun)(GLFWwindow*,int,const char**);
+typedef void (* GLFWdropfun)(GLFWwindow* window, int path_count, const char* paths[]);
-/*! @brief The function signature for monitor configuration callbacks.
+/*! @brief The function pointer type for monitor configuration callbacks.
*
- * This is the function signature for monitor configuration callback functions.
+ * This is the function pointer type for monitor configuration callbacks.
+ * A monitor callback function has the following signature:
+ * @code
+ * void function_name(GLFWmonitor* monitor, int event)
+ * @endcode
*
* @param[in] monitor The monitor that was connected or disconnected.
- * @param[in] event One of `GLFW_CONNECTED` or `GLFW_DISCONNECTED`.
+ * @param[in] event One of `GLFW_CONNECTED` or `GLFW_DISCONNECTED`. Future
+ * releases may add more events.
*
* @sa @ref monitor_event
* @sa @ref glfwSetMonitorCallback
@@ -1420,15 +1988,19 @@ typedef void (* GLFWdropfun)(GLFWwindow*,int,const char**);
*
* @ingroup monitor
*/
-typedef void (* GLFWmonitorfun)(GLFWmonitor*,int);
+typedef void (* GLFWmonitorfun)(GLFWmonitor* monitor, int event);
-/*! @brief The function signature for joystick configuration callbacks.
+/*! @brief The function pointer type for joystick configuration callbacks.
*
- * This is the function signature for joystick configuration callback
- * functions.
+ * This is the function pointer type for joystick configuration callbacks.
+ * A joystick configuration callback function has the following signature:
+ * @code
+ * void function_name(int jid, int event)
+ * @endcode
*
* @param[in] jid The joystick that was connected or disconnected.
- * @param[in] event One of `GLFW_CONNECTED` or `GLFW_DISCONNECTED`.
+ * @param[in] event One of `GLFW_CONNECTED` or `GLFW_DISCONNECTED`. Future
+ * releases may add more events.
*
* @sa @ref joystick_event
* @sa @ref glfwSetJoystickCallback
@@ -1437,7 +2009,7 @@ typedef void (* GLFWmonitorfun)(GLFWmonitor*,int);
*
* @ingroup input
*/
-typedef void (* GLFWjoystickfun)(int,int);
+typedef void (* GLFWjoystickfun)(int jid, int event);
/*! @brief Video mode type.
*
@@ -1448,7 +2020,7 @@ typedef void (* GLFWjoystickfun)(int,int);
* @sa @ref glfwGetVideoModes
*
* @since Added in version 1.0.
- * @glfw3 Added refresh rate member.
+ * __GLFW 3:__ Added refresh rate member.
*
* @ingroup monitor
*/
@@ -1511,7 +2083,9 @@ typedef struct GLFWgammaramp
* @sa @ref window_icon
*
* @since Added in version 2.1.
- * @glfw3 Removed format and bytes-per-pixel members.
+ * __GLFW 3:__ Removed format and bytes-per-pixel members.
+ *
+ * @ingroup window
*/
typedef struct GLFWimage
{
@@ -1534,6 +2108,8 @@ typedef struct GLFWimage
* @sa @ref glfwGetGamepadState
*
* @since Added in version 3.3.
+ *
+ * @ingroup input
*/
typedef struct GLFWgamepadstate
{
@@ -1547,6 +2123,38 @@ typedef struct GLFWgamepadstate
float axes[6];
} GLFWgamepadstate;
+/*! @brief Custom heap memory allocator.
+ *
+ * This describes a custom heap memory allocator for GLFW. To set an allocator, pass it
+ * to @ref glfwInitAllocator before initializing the library.
+ *
+ * @sa @ref init_allocator
+ * @sa @ref glfwInitAllocator
+ *
+ * @since Added in version 3.4.
+ *
+ * @ingroup init
+ */
+typedef struct GLFWallocator
+{
+ /*! The memory allocation function. See @ref GLFWallocatefun for details about
+ * allocation function.
+ */
+ GLFWallocatefun allocate;
+ /*! The memory reallocation function. See @ref GLFWreallocatefun for details about
+ * reallocation function.
+ */
+ GLFWreallocatefun reallocate;
+ /*! The memory deallocation function. See @ref GLFWdeallocatefun for details about
+ * deallocation function.
+ */
+ GLFWdeallocatefun deallocate;
+ /*! The user pointer for this custom allocator. This value will be passed to the
+ * allocator functions.
+ */
+ void* user;
+} GLFWallocator;
+
/*************************************************************************
* GLFW API functions
@@ -1565,19 +2173,45 @@ typedef struct GLFWgamepadstate
* Additional calls to this function after successful initialization but before
* termination will return `GLFW_TRUE` immediately.
*
+ * The @ref GLFW_PLATFORM init hint controls which platforms are considered during
+ * initialization. This also depends on which platforms the library was compiled to
+ * support.
+ *
* @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if an
* [error](@ref error_handling) occurred.
*
- * @errors Possible errors include @ref GLFW_PLATFORM_ERROR.
+ * @errors Possible errors include @ref GLFW_PLATFORM_UNAVAILABLE and @ref
+ * GLFW_PLATFORM_ERROR.
*
- * @remark @macos This function will change the current directory of the
+ * @remark __macOS:__ This function will change the current directory of the
* application to the `Contents/Resources` subdirectory of the application's
* bundle, if present. This can be disabled with the @ref
* GLFW_COCOA_CHDIR_RESOURCES init hint.
*
+ * @remark __macOS:__ This function will create the main menu and dock icon for the
+ * application. If GLFW finds a `MainMenu.nib` it is loaded and assumed to
+ * contain a menu bar. Otherwise a minimal menu bar is created manually with
+ * common commands like Hide, Quit and About. The About entry opens a minimal
+ * about dialog with information from the application's bundle. The menu bar
+ * and dock icon can be disabled entirely with the @ref GLFW_COCOA_MENUBAR init
+ * hint.
+ *
+ * @remark __Wayland, X11:__ If the library was compiled with support for both
+ * Wayland and X11, and the @ref GLFW_PLATFORM init hint is set to
+ * `GLFW_ANY_PLATFORM`, the `XDG_SESSION_TYPE` environment variable affects
+ * which platform is picked. If the environment variable is not set, or is set
+ * to something other than `wayland` or `x11`, the regular detection mechanism
+ * will be used instead.
+ *
+ * @remark __X11:__ This function will set the `LC_CTYPE` category of the
+ * application locale according to the current environment if that category is
+ * still "C". This is because the "C" locale breaks Unicode text input.
+ *
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref intro_init
+ * @sa @ref glfwInitHint
+ * @sa @ref glfwInitAllocator
* @sa @ref glfwTerminate
*
* @since Added in version 1.0.
@@ -1598,6 +2232,8 @@ GLFWAPI int glfwInit(void);
* call this function, as it is called by @ref glfwInit before it returns
* failure.
*
+ * This function has no effect if GLFW is not initialized.
+ *
* @errors Possible errors include @ref GLFW_PLATFORM_ERROR.
*
* @remark This function may be called before @ref glfwInit.
@@ -1620,8 +2256,7 @@ GLFWAPI void glfwTerminate(void);
/*! @brief Sets the specified init hint to the desired value.
*
- * This function sets hints for the next initialization of GLFW. Only integer
- * type hints can be set with this function.
+ * This function sets hints for the next initialization of GLFW.
*
* The values you set hints to are never reset by GLFW, but they only take
* effect during initialization. Once GLFW has been initialized, any values
@@ -1630,7 +2265,7 @@ GLFWAPI void glfwTerminate(void);
*
* Some hints are platform specific. These may be set on any platform but they
* will only affect their specific platform. Other platforms will ignore them.
- * Setting these hints requires no platform specific headers or functions.
+ * Setting these hints requires no platform specific headers or functions.
*
* @param[in] hint The [init hint](@ref init_hints) to set.
* @param[in] value The new value of the init hint.
@@ -1644,7 +2279,6 @@ GLFWAPI void glfwTerminate(void);
*
* @sa init_hints
* @sa glfwInit
- * @sa glfwInitHintString
*
* @since Added in version 3.3.
*
@@ -1652,39 +2286,84 @@ GLFWAPI void glfwTerminate(void);
*/
GLFWAPI void glfwInitHint(int hint, int value);
-/*! @brief Sets the specified init hint to the desired value.
+/*! @brief Sets the init allocator to the desired value.
*
- * This function sets hints for the next initialization of GLFW. Only string
- * type hints can be set with this function.
+ * To use the default allocator, call this function with a `NULL` argument.
*
- * The values you set hints to are never reset by GLFW, but they only take
- * effect during initialization. Once GLFW has been initialized, any values
- * you set will be ignored until the library is terminated and initialized
- * again.
+ * If you specify an allocator struct, every member must be a valid function
+ * pointer. If any member is `NULL`, this function will emit @ref
+ * GLFW_INVALID_VALUE and the init allocator will be unchanged.
*
- * Some hints are platform specific. These may be set on any platform but they
- * will only affect their specific platform. Other platforms will ignore them.
- * Setting these hints requires no platform specific headers or functions.
+ * The functions in the allocator must fulfil a number of requirements. See the
+ * documentation for @ref GLFWallocatefun, @ref GLFWreallocatefun and @ref
+ * GLFWdeallocatefun for details.
*
- * @param[in] hint The [init hint](@ref init_hints) to set.
- * @param[in] value The new value of the init hint.
+ * @param[in] allocator The allocator to use at the next initialization, or
+ * `NULL` to use the default one.
*
- * @errors Possible errors include @ref GLFW_INVALID_ENUM and @ref
- * GLFW_INVALID_VALUE.
+ * @errors Possible errors include @ref GLFW_INVALID_VALUE.
*
- * @remarks This function may be called before @ref glfwInit.
+ * @pointer_lifetime The specified allocator is copied before this function
+ * returns.
*
* @thread_safety This function must only be called from the main thread.
*
- * @sa init_hints
- * @sa glfwInit
- * @sa glfwInitHint
+ * @sa @ref init_allocator
+ * @sa @ref glfwInit
*
- * @since Added in version 3.3.
+ * @since Added in version 3.4.
*
* @ingroup init
*/
-GLFWAPI void glfwInitHintString(int hint, const char* value);
+GLFWAPI void glfwInitAllocator(const GLFWallocator* allocator);
+
+#if defined(VK_VERSION_1_0)
+
+/*! @brief Sets the desired Vulkan `vkGetInstanceProcAddr` function.
+ *
+ * This function sets the `vkGetInstanceProcAddr` function that GLFW will use for all
+ * Vulkan related entry point queries.
+ *
+ * This feature is mostly useful on macOS, if your copy of the Vulkan loader is in
+ * a location where GLFW cannot find it through dynamic loading, or if you are still
+ * using the static library version of the loader.
+ *
+ * If set to `NULL`, GLFW will try to load the Vulkan loader dynamically by its standard
+ * name and get this function from there. This is the default behavior.
+ *
+ * The standard name of the loader is `vulkan-1.dll` on Windows, `libvulkan.so.1` on
+ * Linux and other Unix-like systems and `libvulkan.1.dylib` on macOS. If your code is
+ * also loading it via these names then you probably don't need to use this function.
+ *
+ * The function address you set is never reset by GLFW, but it only takes effect during
+ * initialization. Once GLFW has been initialized, any updates will be ignored until the
+ * library is terminated and initialized again.
+ *
+ * @param[in] loader The address of the function to use, or `NULL`.
+ *
+ * @par Loader function signature
+ * @code
+ * PFN_vkVoidFunction vkGetInstanceProcAddr(VkInstance instance, const char* name)
+ * @endcode
+ * For more information about this function, see the
+ * [Vulkan Registry](https://www.khronos.org/registry/vulkan/).
+ *
+ * @errors None.
+ *
+ * @remark This function may be called before @ref glfwInit.
+ *
+ * @thread_safety This function must only be called from the main thread.
+ *
+ * @sa @ref vulkan_loader
+ * @sa @ref glfwInit
+ *
+ * @since Added in version 3.4.
+ *
+ * @ingroup init
+ */
+GLFWAPI void glfwInitVulkanLoader(PFN_vkGetInstanceProcAddr loader);
+
+#endif /*VK_VERSION_1_0*/
/*! @brief Retrieves the version of the GLFW library.
*
@@ -1716,15 +2395,18 @@ GLFWAPI void glfwGetVersion(int* major, int* minor, int* rev);
/*! @brief Returns a string describing the compile-time configuration.
*
* This function returns the compile-time generated
- * [version string](@ref intro_version_string) of the GLFW library binary. It
- * describes the version, platform, compiler and any platform-specific
- * compile-time options. It should not be confused with the OpenGL or OpenGL
- * ES version string, queried with `glGetString`.
+ * [version string](@ref intro_version_string) of the GLFW library binary. It describes
+ * the version, platforms, compiler and any platform or operating system specific
+ * compile-time options. It should not be confused with the OpenGL or OpenGL ES version
+ * string, queried with `glGetString`.
*
* __Do not use the version string__ to parse the GLFW library version. The
* @ref glfwGetVersion function provides the version of the running library
* binary in numerical format.
*
+ * __Do not use the version string__ to parse what platforms are supported. The @ref
+ * glfwPlatformSupported function lets you query platform support.
+ *
* @return The ASCII encoded GLFW version string.
*
* @errors None.
@@ -1795,10 +2477,17 @@ GLFWAPI int glfwGetError(const char** description);
* Once set, the error callback remains set even after the library has been
* terminated.
*
- * @param[in] cbfun The new callback, or `NULL` to remove the currently set
+ * @param[in] callback The new callback, or `NULL` to remove the currently set
* callback.
* @return The previously set callback, or `NULL` if no callback was set.
*
+ * @callback_signature
+ * @code
+ * void callback_name(int error_code, const char* description)
+ * @endcode
+ * For more information about the callback parameters, see the
+ * [callback pointer type](@ref GLFWerrorfun).
+ *
* @errors None.
*
* @remark This function may be called before @ref glfwInit.
@@ -1812,7 +2501,52 @@ GLFWAPI int glfwGetError(const char** description);
*
* @ingroup init
*/
-GLFWAPI GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun cbfun);
+GLFWAPI GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun callback);
+
+/*! @brief Returns the currently selected platform.
+ *
+ * This function returns the platform that was selected during initialization. The
+ * returned value will be one of `GLFW_PLATFORM_WIN32`, `GLFW_PLATFORM_COCOA`,
+ * `GLFW_PLATFORM_WAYLAND`, `GLFW_PLATFORM_X11` or `GLFW_PLATFORM_NULL`.
+ *
+ * @return The currently selected platform, or zero if an error occurred.
+ *
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
+ *
+ * @thread_safety This function may be called from any thread.
+ *
+ * @sa @ref platform
+ * @sa @ref glfwPlatformSupported
+ *
+ * @since Added in version 3.4.
+ *
+ * @ingroup init
+ */
+GLFWAPI int glfwGetPlatform(void);
+
+/*! @brief Returns whether the library includes support for the specified platform.
+ *
+ * This function returns whether the library was compiled with support for the specified
+ * platform. The platform must be one of `GLFW_PLATFORM_WIN32`, `GLFW_PLATFORM_COCOA`,
+ * `GLFW_PLATFORM_WAYLAND`, `GLFW_PLATFORM_X11` or `GLFW_PLATFORM_NULL`.
+ *
+ * @param[in] platform The platform to query.
+ * @return `GLFW_TRUE` if the platform is supported, or `GLFW_FALSE` otherwise.
+ *
+ * @errors Possible errors include @ref GLFW_INVALID_ENUM.
+ *
+ * @remark This function may be called before @ref glfwInit.
+ *
+ * @thread_safety This function may be called from any thread.
+ *
+ * @sa @ref platform
+ * @sa @ref glfwGetPlatform
+ *
+ * @since Added in version 3.4.
+ *
+ * @ingroup init
+ */
+GLFWAPI int glfwPlatformSupported(int platform);
/*! @brief Returns the currently connected monitors.
*
@@ -1892,15 +2626,47 @@ GLFWAPI GLFWmonitor* glfwGetPrimaryMonitor(void);
*/
GLFWAPI void glfwGetMonitorPos(GLFWmonitor* monitor, int* xpos, int* ypos);
+/*! @brief Retrieves the work area of the monitor.
+ *
+ * This function returns the position, in screen coordinates, of the upper-left
+ * corner of the work area of the specified monitor along with the work area
+ * size in screen coordinates. The work area is defined as the area of the
+ * monitor not occluded by the window system task bar where present. If no
+ * task bar exists then the work area is the monitor resolution in screen
+ * coordinates.
+ *
+ * Any or all of the position and size arguments may be `NULL`. If an error
+ * occurs, all non-`NULL` position and size arguments will be set to zero.
+ *
+ * @param[in] monitor The monitor to query.
+ * @param[out] xpos Where to store the monitor x-coordinate, or `NULL`.
+ * @param[out] ypos Where to store the monitor y-coordinate, or `NULL`.
+ * @param[out] width Where to store the monitor width, or `NULL`.
+ * @param[out] height Where to store the monitor height, or `NULL`.
+ *
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
+ * GLFW_PLATFORM_ERROR.
+ *
+ * @thread_safety This function must only be called from the main thread.
+ *
+ * @sa @ref monitor_workarea
+ *
+ * @since Added in version 3.3.
+ *
+ * @ingroup monitor
+ */
+GLFWAPI void glfwGetMonitorWorkarea(GLFWmonitor* monitor, int* xpos, int* ypos, int* width, int* height);
+
/*! @brief Returns the physical size of the monitor.
*
* This function returns the size, in millimetres, of the display area of the
* specified monitor.
*
- * Some systems do not provide accurate monitor size information, either
- * because the monitor
- * [EDID](https://en.wikipedia.org/wiki/Extended_display_identification_data)
- * data is incorrect or because the driver does not report it accurately.
+ * Some platforms do not provide accurate monitor size information, either
+ * because the monitor [EDID][] data is incorrect or because the driver does
+ * not report it accurately.
+ *
+ * [EDID]: https://en.wikipedia.org/wiki/Extended_display_identification_data
*
* Any or all of the size arguments may be `NULL`. If an error occurs, all
* non-`NULL` size arguments will be set to zero.
@@ -1913,8 +2679,8 @@ GLFWAPI void glfwGetMonitorPos(GLFWmonitor* monitor, int* xpos, int* ypos);
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
- * @remark @win32 calculates the returned physical size from the
- * current resolution and system DPI instead of querying the monitor EDID data.
+ * @remark __Win32:__ On Windows 8 and earlier the physical size is calculated from
+ * the current resolution and system DPI instead of querying the monitor EDID data.
*
* @thread_safety This function must only be called from the main thread.
*
@@ -1926,6 +2692,41 @@ GLFWAPI void glfwGetMonitorPos(GLFWmonitor* monitor, int* xpos, int* ypos);
*/
GLFWAPI void glfwGetMonitorPhysicalSize(GLFWmonitor* monitor, int* widthMM, int* heightMM);
+/*! @brief Retrieves the content scale for the specified monitor.
+ *
+ * This function retrieves the content scale for the specified monitor. The
+ * content scale is the ratio between the current DPI and the platform's
+ * default DPI. This is especially important for text and any UI elements. If
+ * the pixel dimensions of your UI scaled by this look appropriate on your
+ * machine then it should appear at a reasonable size on other machines
+ * regardless of their DPI and scaling settings. This relies on the system DPI
+ * and scaling settings being somewhat correct.
+ *
+ * The content scale may depend on both the monitor resolution and pixel
+ * density and on user settings. It may be very different from the raw DPI
+ * calculated from the physical size and current resolution.
+ *
+ * @param[in] monitor The monitor to query.
+ * @param[out] xscale Where to store the x-axis content scale, or `NULL`.
+ * @param[out] yscale Where to store the y-axis content scale, or `NULL`.
+ *
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
+ * GLFW_PLATFORM_ERROR.
+ *
+ * @remark __Wayland:__ Fractional scaling information is not yet available for
+ * monitors, so this function only returns integer content scales.
+ *
+ * @thread_safety This function must only be called from the main thread.
+ *
+ * @sa @ref monitor_scale
+ * @sa @ref glfwGetWindowContentScale
+ *
+ * @since Added in version 3.3.
+ *
+ * @ingroup monitor
+ */
+GLFWAPI void glfwGetMonitorContentScale(GLFWmonitor* monitor, float* xscale, float* yscale);
+
/*! @brief Returns the name of the specified monitor.
*
* This function returns a human-readable name, encoded as UTF-8, of the
@@ -1952,17 +2753,74 @@ GLFWAPI void glfwGetMonitorPhysicalSize(GLFWmonitor* monitor, int* widthMM, int*
*/
GLFWAPI const char* glfwGetMonitorName(GLFWmonitor* monitor);
+/*! @brief Sets the user pointer of the specified monitor.
+ *
+ * This function sets the user-defined pointer of the specified monitor. The
+ * current value is retained until the monitor is disconnected. The initial
+ * value is `NULL`.
+ *
+ * This function may be called from the monitor callback, even for a monitor
+ * that is being disconnected.
+ *
+ * @param[in] monitor The monitor whose pointer to set.
+ * @param[in] pointer The new value.
+ *
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
+ *
+ * @thread_safety This function may be called from any thread. Access is not
+ * synchronized.
+ *
+ * @sa @ref monitor_userptr
+ * @sa @ref glfwGetMonitorUserPointer
+ *
+ * @since Added in version 3.3.
+ *
+ * @ingroup monitor
+ */
+GLFWAPI void glfwSetMonitorUserPointer(GLFWmonitor* monitor, void* pointer);
+
+/*! @brief Returns the user pointer of the specified monitor.
+ *
+ * This function returns the current value of the user-defined pointer of the
+ * specified monitor. The initial value is `NULL`.
+ *
+ * This function may be called from the monitor callback, even for a monitor
+ * that is being disconnected.
+ *
+ * @param[in] monitor The monitor whose pointer to return.
+ *
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
+ *
+ * @thread_safety This function may be called from any thread. Access is not
+ * synchronized.
+ *
+ * @sa @ref monitor_userptr
+ * @sa @ref glfwSetMonitorUserPointer
+ *
+ * @since Added in version 3.3.
+ *
+ * @ingroup monitor
+ */
+GLFWAPI void* glfwGetMonitorUserPointer(GLFWmonitor* monitor);
+
/*! @brief Sets the monitor configuration callback.
*
* This function sets the monitor configuration callback, or removes the
* currently set callback. This is called when a monitor is connected to or
* disconnected from the system.
*
- * @param[in] cbfun The new callback, or `NULL` to remove the currently set
+ * @param[in] callback The new callback, or `NULL` to remove the currently set
* callback.
* @return The previously set callback, or `NULL` if no callback was set or the
* library had not been [initialized](@ref intro_init).
*
+ * @callback_signature
+ * @code
+ * void function_name(GLFWmonitor* monitor, int event)
+ * @endcode
+ * For more information about the callback parameters, see the
+ * [function pointer type](@ref GLFWmonitorfun).
+ *
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function must only be called from the main thread.
@@ -1973,14 +2831,15 @@ GLFWAPI const char* glfwGetMonitorName(GLFWmonitor* monitor);
*
* @ingroup monitor
*/
-GLFWAPI GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun cbfun);
+GLFWAPI GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun callback);
/*! @brief Returns the available video modes for the specified monitor.
*
* This function returns an array of all video modes supported by the specified
* monitor. The returned array is sorted in ascending order, first by color
- * bit depth (the sum of all channel depths) and then by resolution area (the
- * product of width and height).
+ * bit depth (the sum of all channel depths), then by resolution area (the
+ * product of width and height), then resolution width and finally by refresh
+ * rate.
*
* @param[in] monitor The monitor to query.
* @param[out] count Where to store the number of video modes in the returned
@@ -2002,7 +2861,7 @@ GLFWAPI GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun cbfun);
* @sa @ref glfwGetVideoMode
*
* @since Added in version 1.0.
- * @glfw3 Changed to return an array of modes for a specific monitor.
+ * __GLFW 3:__ Changed to return an array of modes for a specific monitor.
*
* @ingroup monitor
*/
@@ -2038,9 +2897,9 @@ GLFWAPI const GLFWvidmode* glfwGetVideoMode(GLFWmonitor* monitor);
/*! @brief Generates a gamma ramp and sets it for the specified monitor.
*
- * This function generates a 256-element gamma ramp from the specified exponent
- * and then calls @ref glfwSetGammaRamp with it. The value must be a finite
- * number greater than zero.
+ * This function generates an appropriately sized gamma ramp from the specified
+ * exponent and then calls @ref glfwSetGammaRamp with it. The value must be
+ * a finite number greater than zero.
*
* The software controlled gamma ramp is applied _in addition_ to the hardware
* gamma correction, which today is usually an approximation of sRGB gamma.
@@ -2053,11 +2912,11 @@ GLFWAPI const GLFWvidmode* glfwGetVideoMode(GLFWmonitor* monitor);
* @param[in] monitor The monitor whose gamma ramp to set.
* @param[in] gamma The desired exponent.
*
- * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
- * GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR.
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref GLFW_INVALID_VALUE,
+ * @ref GLFW_PLATFORM_ERROR and @ref GLFW_FEATURE_UNAVAILABLE (see remarks).
*
- * @remark @wayland Gamma handling is currently unavailable, this function will
- * always emit @ref GLFW_PLATFORM_ERROR.
+ * @remark __Wayland:__ Monitor gamma is a privileged protocol, so this function
+ * cannot be implemented and emits @ref GLFW_FEATURE_UNAVAILABLE.
*
* @thread_safety This function must only be called from the main thread.
*
@@ -2077,11 +2936,12 @@ GLFWAPI void glfwSetGamma(GLFWmonitor* monitor, float gamma);
* @return The current gamma ramp, or `NULL` if an
* [error](@ref error_handling) occurred.
*
- * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
- * GLFW_PLATFORM_ERROR.
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref GLFW_PLATFORM_ERROR
+ * and @ref GLFW_FEATURE_UNAVAILABLE (see remarks).
*
- * @remark @wayland Gamma handling is currently unavailable, this function will
- * always return `NULL` and emit @ref GLFW_PLATFORM_ERROR.
+ * @remark __Wayland:__ Monitor gamma is a privileged protocol, so this function
+ * cannot be implemented and emits @ref GLFW_FEATURE_UNAVAILABLE while
+ * returning `NULL`.
*
* @pointer_lifetime The returned structure and its arrays are allocated and
* freed by GLFW. You should not free them yourself. They are valid until the
@@ -2115,16 +2975,16 @@ GLFWAPI const GLFWgammaramp* glfwGetGammaRamp(GLFWmonitor* monitor);
* @param[in] monitor The monitor whose gamma ramp to set.
* @param[in] ramp The gamma ramp to use.
*
- * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
- * GLFW_PLATFORM_ERROR.
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref GLFW_PLATFORM_ERROR
+ * and @ref GLFW_FEATURE_UNAVAILABLE (see remarks).
*
- * @remark Gamma ramp sizes other than 256 are not supported by all platforms
- * or graphics hardware.
+ * @remark The size of the specified gamma ramp should match the size of the
+ * current ramp for that monitor.
*
- * @remark @win32 The gamma ramp size must be 256.
+ * @remark __Win32:__ The gamma ramp size must be 256.
*
- * @remark @wayland Gamma handling is currently unavailable, this function will
- * always emit @ref GLFW_PLATFORM_ERROR.
+ * @remark __Wayland:__ Monitor gamma is a privileged protocol, so this function
+ * cannot be implemented and emits @ref GLFW_FEATURE_UNAVAILABLE.
*
* @pointer_lifetime The specified gamma ramp is copied before this function
* returns.
@@ -2150,6 +3010,7 @@ GLFWAPI void glfwSetGammaRamp(GLFWmonitor* monitor, const GLFWgammaramp* ramp);
*
* @sa @ref window_hints
* @sa @ref glfwWindowHint
+ * @sa @ref glfwWindowHintString
*
* @since Added in version 3.0.
*
@@ -2160,14 +3021,20 @@ GLFWAPI void glfwDefaultWindowHints(void);
/*! @brief Sets the specified window hint to the desired value.
*
* This function sets hints for the next call to @ref glfwCreateWindow. The
- * hints, once set, retain their values until changed by a call to @ref
- * glfwWindowHint or @ref glfwDefaultWindowHints, or until the library is
- * terminated.
+ * hints, once set, retain their values until changed by a call to this
+ * function or @ref glfwDefaultWindowHints, or until the library is terminated.
+ *
+ * Only integer value hints can be set with this function. String value hints
+ * are set with @ref glfwWindowHintString.
*
* This function does not check whether the specified hint values are valid.
* If you set hints to invalid values this will instead be reported by the next
* call to @ref glfwCreateWindow.
*
+ * Some hints are platform specific. These may be set on any platform but they
+ * will only affect their specific platform. Other platforms will ignore them.
+ * Setting these hints requires no platform specific headers or functions.
+ *
* @param[in] hint The [window hint](@ref window_hints) to set.
* @param[in] value The new value of the window hint.
*
@@ -2177,6 +3044,7 @@ GLFWAPI void glfwDefaultWindowHints(void);
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_hints
+ * @sa @ref glfwWindowHintString
* @sa @ref glfwDefaultWindowHints
*
* @since Added in version 3.0. Replaces `glfwOpenWindowHint`.
@@ -2185,6 +3053,44 @@ GLFWAPI void glfwDefaultWindowHints(void);
*/
GLFWAPI void glfwWindowHint(int hint, int value);
+/*! @brief Sets the specified window hint to the desired value.
+ *
+ * This function sets hints for the next call to @ref glfwCreateWindow. The
+ * hints, once set, retain their values until changed by a call to this
+ * function or @ref glfwDefaultWindowHints, or until the library is terminated.
+ *
+ * Only string type hints can be set with this function. Integer value hints
+ * are set with @ref glfwWindowHint.
+ *
+ * This function does not check whether the specified hint values are valid.
+ * If you set hints to invalid values this will instead be reported by the next
+ * call to @ref glfwCreateWindow.
+ *
+ * Some hints are platform specific. These may be set on any platform but they
+ * will only affect their specific platform. Other platforms will ignore them.
+ * Setting these hints requires no platform specific headers or functions.
+ *
+ * @param[in] hint The [window hint](@ref window_hints) to set.
+ * @param[in] value The new value of the window hint.
+ *
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
+ * GLFW_INVALID_ENUM.
+ *
+ * @pointer_lifetime The specified string is copied before this function
+ * returns.
+ *
+ * @thread_safety This function must only be called from the main thread.
+ *
+ * @sa @ref window_hints
+ * @sa @ref glfwWindowHint
+ * @sa @ref glfwDefaultWindowHints
+ *
+ * @since Added in version 3.3.
+ *
+ * @ingroup window
+ */
+GLFWAPI void glfwWindowHintString(int hint, const char* value);
+
/*! @brief Creates a window and its associated context.
*
* This function creates a window and its associated OpenGL or OpenGL ES
@@ -2221,10 +3127,10 @@ GLFWAPI void glfwWindowHint(int hint, int value);
* OpenGL or OpenGL ES context.
*
* By default, newly created windows use the placement recommended by the
- * window system. To create the window at a specific position, make it
- * initially invisible using the [GLFW_VISIBLE](@ref GLFW_VISIBLE_hint) window
- * hint, set its [position](@ref window_pos) and then [show](@ref window_hide)
- * it.
+ * window system. To create the window at a specific position, set the @ref
+ * GLFW_POSITION_X and @ref GLFW_POSITION_Y window hints before creation. To
+ * restore the default behavior, set either or both hints back to
+ * `GLFW_ANY_POSITION`.
*
* As long as at least one full screen window is not iconified, the screensaver
* is prohibited from starting.
@@ -2250,81 +3156,73 @@ GLFWAPI void glfwWindowHint(int hint, int value);
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
* GLFW_INVALID_ENUM, @ref GLFW_INVALID_VALUE, @ref GLFW_API_UNAVAILABLE, @ref
- * GLFW_VERSION_UNAVAILABLE, @ref GLFW_FORMAT_UNAVAILABLE and @ref
- * GLFW_PLATFORM_ERROR.
+ * GLFW_VERSION_UNAVAILABLE, @ref GLFW_FORMAT_UNAVAILABLE, @ref
+ * GLFW_NO_WINDOW_CONTEXT and @ref GLFW_PLATFORM_ERROR.
*
- * @remark @win32 Window creation will fail if the Microsoft GDI software
+ * @remark __Win32:__ Window creation will fail if the Microsoft GDI software
* OpenGL implementation is the only one available.
*
- * @remark @win32 If the executable has an icon resource named `GLFW_ICON,` it
+ * @remark __Win32:__ If the executable has an icon resource named `GLFW_ICON,` it
* will be set as the initial icon for the window. If no such icon is present,
- * the `IDI_WINLOGO` icon will be used instead. To set a different icon, see
- * @ref glfwSetWindowIcon.
+ * the `IDI_APPLICATION` icon will be used instead. To set a different icon,
+ * see @ref glfwSetWindowIcon.
*
- * @remark @win32 The context to share resources with must not be current on
+ * @remark __Win32:__ The context to share resources with must not be current on
* any other thread.
*
- * @remark @macos The OS only supports forward-compatible core profile contexts
- * for OpenGL versions 3.2 and later. Before creating an OpenGL context of
- * version 3.2 or later you must set the
- * [GLFW_OPENGL_FORWARD_COMPAT](@ref GLFW_OPENGL_FORWARD_COMPAT_hint) and
- * [GLFW_OPENGL_PROFILE](@ref GLFW_OPENGL_PROFILE_hint) hints accordingly.
- * OpenGL 3.0 and 3.1 contexts are not supported at all on macOS.
+ * @remark __macOS:__ The OS only supports core profile contexts for OpenGL
+ * versions 3.2 and later. Before creating an OpenGL context of version 3.2 or
+ * later you must set the [GLFW_OPENGL_PROFILE](@ref GLFW_OPENGL_PROFILE_hint)
+ * hint accordingly. OpenGL 3.0 and 3.1 contexts are not supported at all
+ * on macOS.
*
- * @remark @macos The GLFW window has no icon, as it is not a document
+ * @remark __macOS:__ The GLFW window has no icon, as it is not a document
* window, but the dock icon will be the same as the application bundle's icon.
* For more information on bundles, see the
- * [Bundle Programming Guide](https://developer.apple.com/library/mac/documentation/CoreFoundation/Conceptual/CFBundles/)
- * in the Mac Developer Library.
- *
- * @remark @macos The first time a window is created the menu bar is created.
- * If GLFW finds a `MainMenu.nib` it is loaded and assumed to contain a menu
- * bar. Otherwise a minimal menu bar is created manually with common commands
- * like Hide, Quit and About. The About entry opens a minimal about dialog
- * with information from the application's bundle. Menu bar creation can be
- * disabled entirely with the @ref GLFW_COCOA_MENUBAR init hint.
- *
- * @remark @macos On OS X 10.10 and later the window frame will not be rendered
- * at full resolution on Retina displays unless the
- * [GLFW_COCOA_RETINA_FRAMEBUFFER](@ref GLFW_COCOA_RETINA_FRAMEBUFFER_hint)
+ * [Bundle Programming Guide][bundle-guide] in the Mac Developer Library.
+ *
+ * [bundle-guide]: https://developer.apple.com/library/mac/documentation/CoreFoundation/Conceptual/CFBundles/
+ *
+ * @remark __macOS:__ The window frame will not be rendered at full resolution
+ * on Retina displays unless the
+ * [GLFW_SCALE_FRAMEBUFFER](@ref GLFW_SCALE_FRAMEBUFFER_hint)
* hint is `GLFW_TRUE` and the `NSHighResolutionCapable` key is enabled in the
* application bundle's `Info.plist`. For more information, see
- * [High Resolution Guidelines for OS X](https://developer.apple.com/library/mac/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Explained/Explained.html)
- * in the Mac Developer Library. The GLFW test and example programs use
- * a custom `Info.plist` template for this, which can be found as
- * `CMake/MacOSXBundleInfo.plist.in` in the source tree.
+ * [High Resolution Guidelines for OS X][hidpi-guide] in the Mac Developer
+ * Library. The GLFW test and example programs use a custom `Info.plist`
+ * template for this, which can be found as `CMake/Info.plist.in` in the source
+ * tree.
+ *
+ * [hidpi-guide]: https://developer.apple.com/library/mac/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Explained/Explained.html
*
- * @remark @macos When activating frame autosaving with
- * [GLFW_COCOA_FRAME_AUTOSAVE](@ref GLFW_COCOA_FRAME_AUTOSAVE_hint), the
- * specified window size may be overriden by a previously saved size and
- * position.
+ * @remark __macOS:__ When activating frame autosaving with
+ * [GLFW_COCOA_FRAME_NAME](@ref GLFW_COCOA_FRAME_NAME_hint), the specified
+ * window size and position may be overridden by previously saved values.
*
- * @remark @x11 Some window managers will not respect the placement of
+ * @remark __Wayland:__ GLFW uses [libdecor][] where available to create its window
+ * decorations. This in turn uses server-side XDG decorations where available
+ * and provides high quality client-side decorations on compositors like GNOME.
+ * If both XDG decorations and libdecor are unavailable, GLFW falls back to
+ * a very simple set of window decorations that only support moving, resizing
+ * and the window manager's right-click menu.
+ *
+ * [libdecor]: https://gitlab.freedesktop.org/libdecor/libdecor
+ *
+ * @remark __X11:__ Some window managers will not respect the placement of
* initially hidden windows.
*
- * @remark @x11 Due to the asynchronous nature of X11, it may take a moment for
+ * @remark __X11:__ Due to the asynchronous nature of X11, it may take a moment for
* a window to reach its requested state. This means you may not be able to
* query the final size, position or other attributes directly after window
* creation.
*
- * @remark @x11 The name and class of the `WM_CLASS` window property will by
- * default be set to the window title passed to this function. Set the @ref
- * GLFW_X11_WM_CLASS_NAME and @ref GLFW_X11_WM_CLASS_CLASS init hints before
- * initialization to override this.
- *
- * @remark @wayland The window frame is currently unimplemented, as if
- * [GLFW_DECORATED](@ref GLFW_DECORATED_hint) was always set to `GLFW_FALSE`.
- * A compositor can still emit close, resize or maximize events, using for
- * example a keybind mechanism.
- *
- * @remark @wayland A full screen window will not attempt to change the mode,
- * no matter what the requested size or refresh rate.
- *
- * @remark @wayland The wl_shell protocol does not support window
- * icons, the window will inherit the one defined in the application's
- * desktop file, so this function emits @ref GLFW_PLATFORM_ERROR.
- *
- * @remark @wayland Screensaver inhibition is currently unimplemented.
+ * @remark __X11:__ The class part of the `WM_CLASS` window property will by
+ * default be set to the window title passed to this function. The instance
+ * part will use the contents of the `RESOURCE_NAME` environment variable, if
+ * present and not empty, or fall back to the window title. Set the
+ * [GLFW_X11_CLASS_NAME](@ref GLFW_X11_CLASS_NAME_hint) and
+ * [GLFW_X11_INSTANCE_NAME](@ref GLFW_X11_INSTANCE_NAME_hint) window hints to
+ * override this.
*
* @thread_safety This function must only be called from the main thread.
*
@@ -2400,13 +3298,45 @@ GLFWAPI int glfwWindowShouldClose(GLFWwindow* window);
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
- * @sa @ref window_close
+ * @sa @ref window_close
+ *
+ * @since Added in version 3.0.
+ *
+ * @ingroup window
+ */
+GLFWAPI void glfwSetWindowShouldClose(GLFWwindow* window, int value);
+
+/*! @brief Returns the title of the specified window.
+ *
+ * This function returns the window title, encoded as UTF-8, of the specified
+ * window. This is the title set previously by @ref glfwCreateWindow
+ * or @ref glfwSetWindowTitle.
+ *
+ * @param[in] window The window to query.
+ * @return The UTF-8 encoded window title, or `NULL` if an
+ * [error](@ref error_handling) occurred.
+ *
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
+ *
+ * @remark The returned title is currently a copy of the title last set by @ref
+ * glfwCreateWindow or @ref glfwSetWindowTitle. It does not include any
+ * additional text which may be appended by the platform or another program.
+ *
+ * @pointer_lifetime The returned string is allocated and freed by GLFW. You
+ * should not free it yourself. It is valid until the next call to @ref
+ * glfwGetWindowTitle or @ref glfwSetWindowTitle, or until the library is
+ * terminated.
+ *
+ * @thread_safety This function must only be called from the main thread.
*
- * @since Added in version 3.0.
+ * @sa @ref window_title
+ * @sa @ref glfwSetWindowTitle
+ *
+ * @since Added in version 3.4.
*
* @ingroup window
*/
-GLFWAPI void glfwSetWindowShouldClose(GLFWwindow* window, int value);
+GLFWAPI const char* glfwGetWindowTitle(GLFWwindow* window);
/*! @brief Sets the title of the specified window.
*
@@ -2419,15 +3349,16 @@ GLFWAPI void glfwSetWindowShouldClose(GLFWwindow* window, int value);
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
- * @remark @macos The window title will not be updated until the next time you
+ * @remark __macOS:__ The window title will not be updated until the next time you
* process events.
*
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_title
+ * @sa @ref glfwGetWindowTitle
*
* @since Added in version 1.0.
- * @glfw3 Added window handle parameter.
+ * __GLFW 3:__ Added window handle parameter.
*
* @ingroup window
*/
@@ -2454,21 +3385,23 @@ GLFWAPI void glfwSetWindowTitle(GLFWwindow* window, const char* title);
* @param[in] images The images to create the icon from. This is ignored if
* count is zero.
*
- * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
- * GLFW_PLATFORM_ERROR.
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
+ * GLFW_INVALID_VALUE, @ref GLFW_PLATFORM_ERROR and @ref
+ * GLFW_FEATURE_UNAVAILABLE (see remarks).
*
* @pointer_lifetime The specified image data is copied before this function
* returns.
*
- * @remark @macos The GLFW window has no icon, as it is not a document
- * window, so this function does nothing. The dock icon will be the same as
+ * @remark __macOS:__ Regular windows do not have icons on macOS. This function
+ * will emit @ref GLFW_FEATURE_UNAVAILABLE. The dock icon will be the same as
* the application bundle's icon. For more information on bundles, see the
- * [Bundle Programming Guide](https://developer.apple.com/library/mac/documentation/CoreFoundation/Conceptual/CFBundles/)
- * in the Mac Developer Library.
+ * [Bundle Programming Guide][bundle-guide] in the Mac Developer Library.
+ *
+ * [bundle-guide]: https://developer.apple.com/library/mac/documentation/CoreFoundation/Conceptual/CFBundles/
*
- * @remark @wayland The wl_shell protocol does not support icons, the window
- * will inherit the one defined in the application's desktop file, so this
- * function emits @ref GLFW_PLATFORM_ERROR.
+ * @remark __Wayland:__ There is no existing protocol to change an icon, the
+ * window will thus inherit the one defined in the application's desktop file.
+ * This function will emit @ref GLFW_FEATURE_UNAVAILABLE.
*
* @thread_safety This function must only be called from the main thread.
*
@@ -2480,26 +3413,26 @@ GLFWAPI void glfwSetWindowTitle(GLFWwindow* window, const char* title);
*/
GLFWAPI void glfwSetWindowIcon(GLFWwindow* window, int count, const GLFWimage* images);
-/*! @brief Retrieves the position of the client area of the specified window.
+/*! @brief Retrieves the position of the content area of the specified window.
*
* This function retrieves the position, in screen coordinates, of the
- * upper-left corner of the client area of the specified window.
+ * upper-left corner of the content area of the specified window.
*
* Any or all of the position arguments may be `NULL`. If an error occurs, all
* non-`NULL` position arguments will be set to zero.
*
* @param[in] window The window to query.
* @param[out] xpos Where to store the x-coordinate of the upper-left corner of
- * the client area, or `NULL`.
+ * the content area, or `NULL`.
* @param[out] ypos Where to store the y-coordinate of the upper-left corner of
- * the client area, or `NULL`.
+ * the content area, or `NULL`.
*
- * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
- * GLFW_PLATFORM_ERROR.
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
+ * GLFW_PLATFORM_ERROR and @ref GLFW_FEATURE_UNAVAILABLE (see remarks).
*
- * @remark @wayland There is no way for an application to retrieve the global
- * position of its windows, this function will always emit @ref
- * GLFW_PLATFORM_ERROR.
+ * @remark __Wayland:__ Window positions are not currently part of any common
+ * Wayland protocol, so this function cannot be implemented and will emit @ref
+ * GLFW_FEATURE_UNAVAILABLE.
*
* @thread_safety This function must only be called from the main thread.
*
@@ -2512,10 +3445,10 @@ GLFWAPI void glfwSetWindowIcon(GLFWwindow* window, int count, const GLFWimage* i
*/
GLFWAPI void glfwGetWindowPos(GLFWwindow* window, int* xpos, int* ypos);
-/*! @brief Sets the position of the client area of the specified window.
+/*! @brief Sets the position of the content area of the specified window.
*
* This function sets the position, in screen coordinates, of the upper-left
- * corner of the client area of the specified windowed mode window. If the
+ * corner of the content area of the specified windowed mode window. If the
* window is a full screen window, this function does nothing.
*
* __Do not use this function__ to move an already visible window unless you
@@ -2525,15 +3458,15 @@ GLFWAPI void glfwGetWindowPos(GLFWwindow* window, int* xpos, int* ypos);
* cannot and should not override these limits.
*
* @param[in] window The window to query.
- * @param[in] xpos The x-coordinate of the upper-left corner of the client area.
- * @param[in] ypos The y-coordinate of the upper-left corner of the client area.
+ * @param[in] xpos The x-coordinate of the upper-left corner of the content area.
+ * @param[in] ypos The y-coordinate of the upper-left corner of the content area.
*
- * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
- * GLFW_PLATFORM_ERROR.
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
+ * GLFW_PLATFORM_ERROR and @ref GLFW_FEATURE_UNAVAILABLE (see remarks).
*
- * @remark @wayland There is no way for an application to set the global
- * position of its windows, this function will always emit @ref
- * GLFW_PLATFORM_ERROR.
+ * @remark __Wayland:__ Window positions are not currently part of any common
+ * Wayland protocol, so this function cannot be implemented and will emit @ref
+ * GLFW_FEATURE_UNAVAILABLE.
*
* @thread_safety This function must only be called from the main thread.
*
@@ -2541,15 +3474,15 @@ GLFWAPI void glfwGetWindowPos(GLFWwindow* window, int* xpos, int* ypos);
* @sa @ref glfwGetWindowPos
*
* @since Added in version 1.0.
- * @glfw3 Added window handle parameter.
+ * __GLFW 3:__ Added window handle parameter.
*
* @ingroup window
*/
GLFWAPI void glfwSetWindowPos(GLFWwindow* window, int xpos, int ypos);
-/*! @brief Retrieves the size of the client area of the specified window.
+/*! @brief Retrieves the size of the content area of the specified window.
*
- * This function retrieves the size, in screen coordinates, of the client area
+ * This function retrieves the size, in screen coordinates, of the content area
* of the specified window. If you wish to retrieve the size of the
* framebuffer of the window in pixels, see @ref glfwGetFramebufferSize.
*
@@ -2558,9 +3491,9 @@ GLFWAPI void glfwSetWindowPos(GLFWwindow* window, int xpos, int ypos);
*
* @param[in] window The window whose size to retrieve.
* @param[out] width Where to store the width, in screen coordinates, of the
- * client area, or `NULL`.
+ * content area, or `NULL`.
* @param[out] height Where to store the height, in screen coordinates, of the
- * client area, or `NULL`.
+ * content area, or `NULL`.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
@@ -2571,7 +3504,7 @@ GLFWAPI void glfwSetWindowPos(GLFWwindow* window, int xpos, int ypos);
* @sa @ref glfwSetWindowSize
*
* @since Added in version 1.0.
- * @glfw3 Added window handle parameter.
+ * __GLFW 3:__ Added window handle parameter.
*
* @ingroup window
*/
@@ -2579,7 +3512,7 @@ GLFWAPI void glfwGetWindowSize(GLFWwindow* window, int* width, int* height);
/*! @brief Sets the size limits of the specified window.
*
- * This function sets the size limits of the client area of the specified
+ * This function sets the size limits of the content area of the specified
* window. If the window is full screen, the size limits only take effect
* once it is made windowed. If the window is not resizable, this function
* does nothing.
@@ -2591,14 +3524,14 @@ GLFWAPI void glfwGetWindowSize(GLFWwindow* window, int* width, int* height);
* dimensions and all must be greater than or equal to zero.
*
* @param[in] window The window to set limits for.
- * @param[in] minwidth The minimum width, in screen coordinates, of the client
+ * @param[in] minwidth The minimum width, in screen coordinates, of the content
* area, or `GLFW_DONT_CARE`.
* @param[in] minheight The minimum height, in screen coordinates, of the
- * client area, or `GLFW_DONT_CARE`.
- * @param[in] maxwidth The maximum width, in screen coordinates, of the client
+ * content area, or `GLFW_DONT_CARE`.
+ * @param[in] maxwidth The maximum width, in screen coordinates, of the content
* area, or `GLFW_DONT_CARE`.
* @param[in] maxheight The maximum height, in screen coordinates, of the
- * client area, or `GLFW_DONT_CARE`.
+ * content area, or `GLFW_DONT_CARE`.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
* GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR.
@@ -2606,7 +3539,7 @@ GLFWAPI void glfwGetWindowSize(GLFWwindow* window, int* width, int* height);
* @remark If you set size limits and an aspect ratio that conflict, the
* results are undefined.
*
- * @remark @wayland The size limits will not be applied until the window is
+ * @remark __Wayland:__ The size limits will not be applied until the window is
* actually resized, either by the user or by the compositor.
*
* @thread_safety This function must only be called from the main thread.
@@ -2622,7 +3555,7 @@ GLFWAPI void glfwSetWindowSizeLimits(GLFWwindow* window, int minwidth, int minhe
/*! @brief Sets the aspect ratio of the specified window.
*
- * This function sets the required aspect ratio of the client area of the
+ * This function sets the required aspect ratio of the content area of the
* specified window. If the window is full screen, the aspect ratio only takes
* effect once it is made windowed. If the window is not resizable, this
* function does nothing.
@@ -2649,7 +3582,7 @@ GLFWAPI void glfwSetWindowSizeLimits(GLFWwindow* window, int minwidth, int minhe
* @remark If you set size limits and an aspect ratio that conflict, the
* results are undefined.
*
- * @remark @wayland The aspect ratio will not be applied until the window is
+ * @remark __Wayland:__ The aspect ratio will not be applied until the window is
* actually resized, either by the user or by the compositor.
*
* @thread_safety This function must only be called from the main thread.
@@ -2663,9 +3596,9 @@ GLFWAPI void glfwSetWindowSizeLimits(GLFWwindow* window, int minwidth, int minhe
*/
GLFWAPI void glfwSetWindowAspectRatio(GLFWwindow* window, int numer, int denom);
-/*! @brief Sets the size of the client area of the specified window.
+/*! @brief Sets the size of the content area of the specified window.
*
- * This function sets the size, in screen coordinates, of the client area of
+ * This function sets the size, in screen coordinates, of the content area of
* the specified window.
*
* For full screen windows, this function updates the resolution of its desired
@@ -2681,16 +3614,13 @@ GLFWAPI void glfwSetWindowAspectRatio(GLFWwindow* window, int numer, int denom);
*
* @param[in] window The window to resize.
* @param[in] width The desired width, in screen coordinates, of the window
- * client area.
+ * content area.
* @param[in] height The desired height, in screen coordinates, of the window
- * client area.
+ * content area.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
- * @remark @wayland A full screen window will not attempt to change the mode,
- * no matter what the requested size.
- *
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_size
@@ -2698,7 +3628,7 @@ GLFWAPI void glfwSetWindowAspectRatio(GLFWwindow* window, int numer, int denom);
* @sa @ref glfwSetWindowMonitor
*
* @since Added in version 1.0.
- * @glfw3 Added window handle parameter.
+ * __GLFW 3:__ Added window handle parameter.
*
* @ingroup window
*/
@@ -2760,10 +3690,6 @@ GLFWAPI void glfwGetFramebufferSize(GLFWwindow* window, int* width, int* height)
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
- * @remark @wayland The window frame is currently unimplemented, as if
- * [GLFW_DECORATED](@ref GLFW_DECORATED_hint) was always set to `GLFW_FALSE`,
- * so the returned values will always be zero.
- *
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_size
@@ -2774,23 +3700,113 @@ GLFWAPI void glfwGetFramebufferSize(GLFWwindow* window, int* width, int* height)
*/
GLFWAPI void glfwGetWindowFrameSize(GLFWwindow* window, int* left, int* top, int* right, int* bottom);
+/*! @brief Retrieves the content scale for the specified window.
+ *
+ * This function retrieves the content scale for the specified window. The
+ * content scale is the ratio between the current DPI and the platform's
+ * default DPI. This is especially important for text and any UI elements. If
+ * the pixel dimensions of your UI scaled by this look appropriate on your
+ * machine then it should appear at a reasonable size on other machines
+ * regardless of their DPI and scaling settings. This relies on the system DPI
+ * and scaling settings being somewhat correct.
+ *
+ * On platforms where each monitors can have its own content scale, the window
+ * content scale will depend on which monitor the system considers the window
+ * to be on.
+ *
+ * @param[in] window The window to query.
+ * @param[out] xscale Where to store the x-axis content scale, or `NULL`.
+ * @param[out] yscale Where to store the y-axis content scale, or `NULL`.
+ *
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
+ * GLFW_PLATFORM_ERROR.
+ *
+ * @thread_safety This function must only be called from the main thread.
+ *
+ * @sa @ref window_scale
+ * @sa @ref glfwSetWindowContentScaleCallback
+ * @sa @ref glfwGetMonitorContentScale
+ *
+ * @since Added in version 3.3.
+ *
+ * @ingroup window
+ */
+GLFWAPI void glfwGetWindowContentScale(GLFWwindow* window, float* xscale, float* yscale);
+
+/*! @brief Returns the opacity of the whole window.
+ *
+ * This function returns the opacity of the window, including any decorations.
+ *
+ * The opacity (or alpha) value is a positive finite number between zero and
+ * one, where zero is fully transparent and one is fully opaque. If the system
+ * does not support whole window transparency, this function always returns one.
+ *
+ * The initial opacity value for newly created windows is one.
+ *
+ * @param[in] window The window to query.
+ * @return The opacity value of the specified window.
+ *
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
+ * GLFW_PLATFORM_ERROR.
+ *
+ * @thread_safety This function must only be called from the main thread.
+ *
+ * @sa @ref window_transparency
+ * @sa @ref glfwSetWindowOpacity
+ *
+ * @since Added in version 3.3.
+ *
+ * @ingroup window
+ */
+GLFWAPI float glfwGetWindowOpacity(GLFWwindow* window);
+
+/*! @brief Sets the opacity of the whole window.
+ *
+ * This function sets the opacity of the window, including any decorations.
+ *
+ * The opacity (or alpha) value is a positive finite number between zero and
+ * one, where zero is fully transparent and one is fully opaque.
+ *
+ * The initial opacity value for newly created windows is one.
+ *
+ * A window created with framebuffer transparency may not use whole window
+ * transparency. The results of doing this are undefined.
+ *
+ * @param[in] window The window to set the opacity for.
+ * @param[in] opacity The desired opacity of the specified window.
+ *
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
+ * GLFW_PLATFORM_ERROR and @ref GLFW_FEATURE_UNAVAILABLE (see remarks).
+ *
+ * @remark __Wayland:__ There is no way to set an opacity factor for a window.
+ * This function will emit @ref GLFW_FEATURE_UNAVAILABLE.
+ *
+ * @thread_safety This function must only be called from the main thread.
+ *
+ * @sa @ref window_transparency
+ * @sa @ref glfwGetWindowOpacity
+ *
+ * @since Added in version 3.3.
+ *
+ * @ingroup window
+ */
+GLFWAPI void glfwSetWindowOpacity(GLFWwindow* window, float opacity);
+
/*! @brief Iconifies the specified window.
*
* This function iconifies (minimizes) the specified window if it was
* previously restored. If the window is already iconified, this function does
* nothing.
*
- * If the specified window is a full screen window, the original monitor
- * resolution is restored until the window is restored.
+ * If the specified window is a full screen window, GLFW restores the original
+ * video mode of the monitor. The window's desired video mode is set again
+ * when the window is restored.
*
* @param[in] window The window to iconify.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
- * @remark @wayland There is no concept of iconification in wl_shell, this
- * function will always emit @ref GLFW_PLATFORM_ERROR.
- *
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_iconify
@@ -2798,7 +3814,7 @@ GLFWAPI void glfwGetWindowFrameSize(GLFWwindow* window, int* left, int* top, int
* @sa @ref glfwMaximizeWindow
*
* @since Added in version 2.1.
- * @glfw3 Added window handle parameter.
+ * __GLFW 3:__ Added window handle parameter.
*
* @ingroup window
*/
@@ -2810,14 +3826,18 @@ GLFWAPI void glfwIconifyWindow(GLFWwindow* window);
* (minimized) or maximized. If the window is already restored, this function
* does nothing.
*
- * If the specified window is a full screen window, the resolution chosen for
- * the window is restored on the selected monitor.
+ * If the specified window is an iconified full screen window, its desired
+ * video mode is set again for its monitor when the window is restored.
*
* @param[in] window The window to restore.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
+ * @remark __Wayland:__ Restoring a window from maximization is not currently
+ * part of any common Wayland protocol, so this function can only restore
+ * windows from maximization.
+ *
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_iconify
@@ -2825,7 +3845,7 @@ GLFWAPI void glfwIconifyWindow(GLFWwindow* window);
* @sa @ref glfwMaximizeWindow
*
* @since Added in version 2.1.
- * @glfw3 Added window handle parameter.
+ * __GLFW 3:__ Added window handle parameter.
*
* @ingroup window
*/
@@ -2862,11 +3882,21 @@ GLFWAPI void glfwMaximizeWindow(GLFWwindow* window);
* hidden. If the window is already visible or is in full screen mode, this
* function does nothing.
*
+ * By default, windowed mode windows are focused when shown
+ * Set the [GLFW_FOCUS_ON_SHOW](@ref GLFW_FOCUS_ON_SHOW_hint) window hint
+ * to change this behavior for all newly created windows, or change the
+ * behavior for an existing window with @ref glfwSetWindowAttrib.
+ *
* @param[in] window The window to make visible.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
+ * @remark __Wayland:__ Because Wayland wants every frame of the desktop to be
+ * complete, this function does not immediately make the window visible.
+ * Instead it will become visible the next time the window framebuffer is
+ * updated after this call.
+ *
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_hide
@@ -2909,6 +3939,10 @@ GLFWAPI void glfwHideWindow(GLFWwindow* window);
* initially created. Set the [GLFW_FOCUSED](@ref GLFW_FOCUSED_hint) to
* disable this behavior.
*
+ * Also by default, windowed mode windows are focused when shown
+ * with @ref glfwShowWindow. Set the
+ * [GLFW_FOCUS_ON_SHOW](@ref GLFW_FOCUS_ON_SHOW_hint) to disable this behavior.
+ *
* __Do not use this function__ to steal focus from other applications unless
* you are certain that is what the user wants. Focus stealing can be
* extremely disruptive.
@@ -2921,8 +3955,8 @@ GLFWAPI void glfwHideWindow(GLFWwindow* window);
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
- * @remark @wayland It is not possible for an application to bring its windows
- * to front, this function will always emit @ref GLFW_PLATFORM_ERROR.
+ * @remark __Wayland:__ The compositor will likely ignore focus requests unless
+ * another window created by the same application already has input focus.
*
* @thread_safety This function must only be called from the main thread.
*
@@ -2949,7 +3983,7 @@ GLFWAPI void glfwFocusWindow(GLFWwindow* window);
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
- * @remark @macos Attention is requested to the application as a whole, not the
+ * @remark __macOS:__ Attention is requested to the application as a whole, not the
* specific window.
*
* @thread_safety This function must only be called from the main thread.
@@ -2994,7 +4028,7 @@ GLFWAPI GLFWmonitor* glfwGetWindowMonitor(GLFWwindow* window);
* The window position is ignored when setting a monitor.
*
* When the monitor is `NULL`, the position, width and height are used to
- * place the window client area. The refresh rate is ignored when no monitor
+ * place the window content area. The refresh rate is ignored when no monitor
* is specified.
*
* If you only wish to update the resolution of a full screen window or the
@@ -3007,12 +4041,12 @@ GLFWAPI GLFWmonitor* glfwGetWindowMonitor(GLFWwindow* window);
* @param[in] window The window whose monitor, size or video mode to set.
* @param[in] monitor The desired monitor, or `NULL` to set windowed mode.
* @param[in] xpos The desired x-coordinate of the upper-left corner of the
- * client area.
+ * content area.
* @param[in] ypos The desired y-coordinate of the upper-left corner of the
- * client area.
- * @param[in] width The desired with, in screen coordinates, of the client area
- * or video mode.
- * @param[in] height The desired height, in screen coordinates, of the client
+ * content area.
+ * @param[in] width The desired with, in screen coordinates, of the content
+ * area or video mode.
+ * @param[in] height The desired height, in screen coordinates, of the content
* area or video mode.
* @param[in] refreshRate The desired refresh rate, in Hz, of the video mode,
* or `GLFW_DONT_CARE`.
@@ -3024,11 +4058,8 @@ GLFWAPI GLFWmonitor* glfwGetWindowMonitor(GLFWwindow* window);
* affected by any resizing or mode switching, although you may need to update
* your viewport if the framebuffer size has changed.
*
- * @remark @wayland The desired window position is ignored, as there is no way
- * for an application to set this property.
- *
- * @remark @wayland Setting the window to full screen will not attempt to
- * change the mode, no matter what the requested size or refresh rate.
+ * @remark __Wayland:__ Window positions are not currently part of any common
+ * Wayland protocol. The window position arguments are ignored.
*
* @thread_safety This function must only be called from the main thread.
*
@@ -3065,6 +4096,10 @@ GLFWAPI void glfwSetWindowMonitor(GLFWwindow* window, GLFWmonitor* monitor, int
* errors. However, this function should not fail as long as it is passed
* valid arguments and the library has been [initialized](@ref intro_init).
*
+ * @remark __Wayland:__ Checking whether a window is iconified is not currently
+ * part of any common Wayland protocol, so the @ref GLFW_ICONIFIED attribute
+ * cannot be implemented and is always `GLFW_FALSE`.
+ *
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_attribs
@@ -3083,8 +4118,10 @@ GLFWAPI int glfwGetWindowAttrib(GLFWwindow* window, int attrib);
*
* The supported attributes are [GLFW_DECORATED](@ref GLFW_DECORATED_attrib),
* [GLFW_RESIZABLE](@ref GLFW_RESIZABLE_attrib),
- * [GLFW_FLOATING](@ref GLFW_FLOATING_attrib) and
- * [GLFW_AUTO_ICONIFY](@ref GLFW_AUTO_ICONIFY_attrib).
+ * [GLFW_FLOATING](@ref GLFW_FLOATING_attrib),
+ * [GLFW_AUTO_ICONIFY](@ref GLFW_AUTO_ICONIFY_attrib) and
+ * [GLFW_FOCUS_ON_SHOW](@ref GLFW_FOCUS_ON_SHOW_attrib).
+ * [GLFW_MOUSE_PASSTHROUGH](@ref GLFW_MOUSE_PASSTHROUGH_attrib)
*
* Some of these attributes are ignored for full screen windows. The new
* value will take effect if the window is later made windowed.
@@ -3097,11 +4134,15 @@ GLFWAPI int glfwGetWindowAttrib(GLFWwindow* window, int attrib);
* @param[in] value `GLFW_TRUE` or `GLFW_FALSE`.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
- * GLFW_INVALID_ENUM, @ref GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR.
+ * GLFW_INVALID_ENUM, @ref GLFW_INVALID_VALUE, @ref GLFW_PLATFORM_ERROR and @ref
+ * GLFW_FEATURE_UNAVAILABLE (see remarks).
*
* @remark Calling @ref glfwGetWindowAttrib will always return the latest
* value, even if that value is ignored by the current mode of the window.
*
+ * @remark __Wayland:__ The [GLFW_FLOATING](@ref GLFW_FLOATING_attrib) window attribute is
+ * not supported. Setting this will emit @ref GLFW_FEATURE_UNAVAILABLE.
+ *
* @thread_safety This function must only be called from the main thread.
*
* @sa @ref window_attribs
@@ -3160,19 +4201,27 @@ GLFWAPI void* glfwGetWindowUserPointer(GLFWwindow* window);
/*! @brief Sets the position callback for the specified window.
*
* This function sets the position callback of the specified window, which is
- * called when the window is moved. The callback is provided with the screen
- * position of the upper-left corner of the client area of the window.
+ * called when the window is moved. The callback is provided with the
+ * position, in screen coordinates, of the upper-left corner of the content
+ * area of the window.
*
* @param[in] window The window whose callback to set.
- * @param[in] cbfun The new callback, or `NULL` to remove the currently set
+ * @param[in] callback The new callback, or `NULL` to remove the currently set
* callback.
* @return The previously set callback, or `NULL` if no callback was set or the
* library had not been [initialized](@ref intro_init).
*
+ * @callback_signature
+ * @code
+ * void function_name(GLFWwindow* window, int xpos, int ypos)
+ * @endcode
+ * For more information about the callback parameters, see the
+ * [function pointer type](@ref GLFWwindowposfun).
+ *
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
- * @remark @wayland This callback will never be called, as there is no way for
- * an application to know its global position.
+ * @remark __Wayland:__ This callback will not be called. The Wayland protocol
+ * provides no way to be notified of when a window is moved.
*
* @thread_safety This function must only be called from the main thread.
*
@@ -3182,20 +4231,27 @@ GLFWAPI void* glfwGetWindowUserPointer(GLFWwindow* window);
*
* @ingroup window
*/
-GLFWAPI GLFWwindowposfun glfwSetWindowPosCallback(GLFWwindow* window, GLFWwindowposfun cbfun);
+GLFWAPI GLFWwindowposfun glfwSetWindowPosCallback(GLFWwindow* window, GLFWwindowposfun callback);
/*! @brief Sets the size callback for the specified window.
*
* This function sets the size callback of the specified window, which is
* called when the window is resized. The callback is provided with the size,
- * in screen coordinates, of the client area of the window.
+ * in screen coordinates, of the content area of the window.
*
* @param[in] window The window whose callback to set.
- * @param[in] cbfun The new callback, or `NULL` to remove the currently set
+ * @param[in] callback The new callback, or `NULL` to remove the currently set
* callback.
* @return The previously set callback, or `NULL` if no callback was set or the
* library had not been [initialized](@ref intro_init).
*
+ * @callback_signature
+ * @code
+ * void function_name(GLFWwindow* window, int width, int height)
+ * @endcode
+ * For more information about the callback parameters, see the
+ * [function pointer type](@ref GLFWwindowsizefun).
+ *
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function must only be called from the main thread.
@@ -3203,11 +4259,11 @@ GLFWAPI GLFWwindowposfun glfwSetWindowPosCallback(GLFWwindow* window, GLFWwindow
* @sa @ref window_size
*
* @since Added in version 1.0.
- * @glfw3 Added window handle parameter and return value.
+ * __GLFW 3:__ Added window handle parameter and return value.
*
* @ingroup window
*/
-GLFWAPI GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow* window, GLFWwindowsizefun cbfun);
+GLFWAPI GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow* window, GLFWwindowsizefun callback);
/*! @brief Sets the close callback for the specified window.
*
@@ -3221,14 +4277,21 @@ GLFWAPI GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow* window, GLFWwind
* The close callback is not triggered by @ref glfwDestroyWindow.
*
* @param[in] window The window whose callback to set.
- * @param[in] cbfun The new callback, or `NULL` to remove the currently set
+ * @param[in] callback The new callback, or `NULL` to remove the currently set
* callback.
* @return The previously set callback, or `NULL` if no callback was set or the
* library had not been [initialized](@ref intro_init).
*
+ * @callback_signature
+ * @code
+ * void function_name(GLFWwindow* window)
+ * @endcode
+ * For more information about the callback parameters, see the
+ * [function pointer type](@ref GLFWwindowclosefun).
+ *
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
- * @remark @macos Selecting Quit from the application menu will trigger the
+ * @remark __macOS:__ Selecting Quit from the application menu will trigger the
* close callback for all windows.
*
* @thread_safety This function must only be called from the main thread.
@@ -3236,16 +4299,16 @@ GLFWAPI GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow* window, GLFWwind
* @sa @ref window_close
*
* @since Added in version 2.5.
- * @glfw3 Added window handle parameter and return value.
+ * __GLFW 3:__ Added window handle parameter and return value.
*
* @ingroup window
*/
-GLFWAPI GLFWwindowclosefun glfwSetWindowCloseCallback(GLFWwindow* window, GLFWwindowclosefun cbfun);
+GLFWAPI GLFWwindowclosefun glfwSetWindowCloseCallback(GLFWwindow* window, GLFWwindowclosefun callback);
/*! @brief Sets the refresh callback for the specified window.
*
* This function sets the refresh callback of the specified window, which is
- * called when the client area of the window needs to be redrawn, for example
+ * called when the content area of the window needs to be redrawn, for example
* if the window has been exposed after having been covered by another window.
*
* On compositing window systems such as Aero, Compiz, Aqua or Wayland, where
@@ -3253,11 +4316,18 @@ GLFWAPI GLFWwindowclosefun glfwSetWindowCloseCallback(GLFWwindow* window, GLFWwi
* very infrequently or never at all.
*
* @param[in] window The window whose callback to set.
- * @param[in] cbfun The new callback, or `NULL` to remove the currently set
+ * @param[in] callback The new callback, or `NULL` to remove the currently set
* callback.
* @return The previously set callback, or `NULL` if no callback was set or the
* library had not been [initialized](@ref intro_init).
*
+ * @callback_signature
+ * @code
+ * void function_name(GLFWwindow* window);
+ * @endcode
+ * For more information about the callback parameters, see the
+ * [function pointer type](@ref GLFWwindowrefreshfun).
+ *
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function must only be called from the main thread.
@@ -3265,11 +4335,11 @@ GLFWAPI GLFWwindowclosefun glfwSetWindowCloseCallback(GLFWwindow* window, GLFWwi
* @sa @ref window_refresh
*
* @since Added in version 2.5.
- * @glfw3 Added window handle parameter and return value.
+ * __GLFW 3:__ Added window handle parameter and return value.
*
* @ingroup window
*/
-GLFWAPI GLFWwindowrefreshfun glfwSetWindowRefreshCallback(GLFWwindow* window, GLFWwindowrefreshfun cbfun);
+GLFWAPI GLFWwindowrefreshfun glfwSetWindowRefreshCallback(GLFWwindow* window, GLFWwindowrefreshfun callback);
/*! @brief Sets the focus callback for the specified window.
*
@@ -3282,11 +4352,18 @@ GLFWAPI GLFWwindowrefreshfun glfwSetWindowRefreshCallback(GLFWwindow* window, GL
* and @ref glfwSetMouseButtonCallback.
*
* @param[in] window The window whose callback to set.
- * @param[in] cbfun The new callback, or `NULL` to remove the currently set
+ * @param[in] callback The new callback, or `NULL` to remove the currently set
* callback.
* @return The previously set callback, or `NULL` if no callback was set or the
* library had not been [initialized](@ref intro_init).
*
+ * @callback_signature
+ * @code
+ * void function_name(GLFWwindow* window, int focused)
+ * @endcode
+ * For more information about the callback parameters, see the
+ * [function pointer type](@ref GLFWwindowfocusfun).
+ *
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function must only be called from the main thread.
@@ -3297,7 +4374,7 @@ GLFWAPI GLFWwindowrefreshfun glfwSetWindowRefreshCallback(GLFWwindow* window, GL
*
* @ingroup window
*/
-GLFWAPI GLFWwindowfocusfun glfwSetWindowFocusCallback(GLFWwindow* window, GLFWwindowfocusfun cbfun);
+GLFWAPI GLFWwindowfocusfun glfwSetWindowFocusCallback(GLFWwindow* window, GLFWwindowfocusfun callback);
/*! @brief Sets the iconify callback for the specified window.
*
@@ -3305,15 +4382,23 @@ GLFWAPI GLFWwindowfocusfun glfwSetWindowFocusCallback(GLFWwindow* window, GLFWwi
* is called when the window is iconified or restored.
*
* @param[in] window The window whose callback to set.
- * @param[in] cbfun The new callback, or `NULL` to remove the currently set
+ * @param[in] callback The new callback, or `NULL` to remove the currently set
* callback.
* @return The previously set callback, or `NULL` if no callback was set or the
* library had not been [initialized](@ref intro_init).
*
+ * @callback_signature
+ * @code
+ * void function_name(GLFWwindow* window, int iconified)
+ * @endcode
+ * For more information about the callback parameters, see the
+ * [function pointer type](@ref GLFWwindowiconifyfun).
+ *
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
- * @remark @wayland The wl_shell protocol has no concept of iconification,
- * this callback will never be called.
+ * @remark __Wayland:__ This callback will not be called. The Wayland protocol
+ * provides no way to be notified of when a window is iconified, and no way to
+ * check whether a window is currently iconified.
*
* @thread_safety This function must only be called from the main thread.
*
@@ -3323,7 +4408,7 @@ GLFWAPI GLFWwindowfocusfun glfwSetWindowFocusCallback(GLFWwindow* window, GLFWwi
*
* @ingroup window
*/
-GLFWAPI GLFWwindowiconifyfun glfwSetWindowIconifyCallback(GLFWwindow* window, GLFWwindowiconifyfun cbfun);
+GLFWAPI GLFWwindowiconifyfun glfwSetWindowIconifyCallback(GLFWwindow* window, GLFWwindowiconifyfun callback);
/*! @brief Sets the maximize callback for the specified window.
*
@@ -3331,11 +4416,18 @@ GLFWAPI GLFWwindowiconifyfun glfwSetWindowIconifyCallback(GLFWwindow* window, GL
* is called when the window is maximized or restored.
*
* @param[in] window The window whose callback to set.
- * @param[in] cbfun The new callback, or `NULL` to remove the currently set
+ * @param[in] callback The new callback, or `NULL` to remove the currently set
* callback.
* @return The previously set callback, or `NULL` if no callback was set or the
* library had not been [initialized](@ref intro_init).
*
+ * @callback_signature
+ * @code
+ * void function_name(GLFWwindow* window, int maximized)
+ * @endcode
+ * For more information about the callback parameters, see the
+ * [function pointer type](@ref GLFWwindowmaximizefun).
+ *
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function must only be called from the main thread.
@@ -3346,7 +4438,7 @@ GLFWAPI GLFWwindowiconifyfun glfwSetWindowIconifyCallback(GLFWwindow* window, GL
*
* @ingroup window
*/
-GLFWAPI GLFWwindowmaximizefun glfwSetWindowMaximizeCallback(GLFWwindow* window, GLFWwindowmaximizefun cbfun);
+GLFWAPI GLFWwindowmaximizefun glfwSetWindowMaximizeCallback(GLFWwindow* window, GLFWwindowmaximizefun callback);
/*! @brief Sets the framebuffer resize callback for the specified window.
*
@@ -3354,11 +4446,18 @@ GLFWAPI GLFWwindowmaximizefun glfwSetWindowMaximizeCallback(GLFWwindow* window,
* which is called when the framebuffer of the specified window is resized.
*
* @param[in] window The window whose callback to set.
- * @param[in] cbfun The new callback, or `NULL` to remove the currently set
+ * @param[in] callback The new callback, or `NULL` to remove the currently set
* callback.
* @return The previously set callback, or `NULL` if no callback was set or the
* library had not been [initialized](@ref intro_init).
*
+ * @callback_signature
+ * @code
+ * void function_name(GLFWwindow* window, int width, int height)
+ * @endcode
+ * For more information about the callback parameters, see the
+ * [function pointer type](@ref GLFWframebuffersizefun).
+ *
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function must only be called from the main thread.
@@ -3369,7 +4468,38 @@ GLFWAPI GLFWwindowmaximizefun glfwSetWindowMaximizeCallback(GLFWwindow* window,
*
* @ingroup window
*/
-GLFWAPI GLFWframebuffersizefun glfwSetFramebufferSizeCallback(GLFWwindow* window, GLFWframebuffersizefun cbfun);
+GLFWAPI GLFWframebuffersizefun glfwSetFramebufferSizeCallback(GLFWwindow* window, GLFWframebuffersizefun callback);
+
+/*! @brief Sets the window content scale callback for the specified window.
+ *
+ * This function sets the window content scale callback of the specified window,
+ * which is called when the content scale of the specified window changes.
+ *
+ * @param[in] window The window whose callback to set.
+ * @param[in] callback The new callback, or `NULL` to remove the currently set
+ * callback.
+ * @return The previously set callback, or `NULL` if no callback was set or the
+ * library had not been [initialized](@ref intro_init).
+ *
+ * @callback_signature
+ * @code
+ * void function_name(GLFWwindow* window, float xscale, float yscale)
+ * @endcode
+ * For more information about the callback parameters, see the
+ * [function pointer type](@ref GLFWwindowcontentscalefun).
+ *
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
+ *
+ * @thread_safety This function must only be called from the main thread.
+ *
+ * @sa @ref window_scale
+ * @sa @ref glfwGetWindowContentScale
+ *
+ * @since Added in version 3.3.
+ *
+ * @ingroup window
+ */
+GLFWAPI GLFWwindowcontentscalefun glfwSetWindowContentScaleCallback(GLFWwindow* window, GLFWwindowcontentscalefun callback);
/*! @brief Processes all pending events.
*
@@ -3435,10 +4565,6 @@ GLFWAPI void glfwPollEvents(void);
* GLFW will pass those events on to the application callbacks before
* returning.
*
- * If no windows exist, this function returns immediately. For synchronization
- * of threads in applications that do not create windows, use your threading
- * library of choice.
- *
* Event processing is not required for joystick input to work.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
@@ -3486,14 +4612,13 @@ GLFWAPI void glfwWaitEvents(void);
* GLFW will pass those events on to the application callbacks before
* returning.
*
- * If no windows exist, this function returns immediately. For synchronization
- * of threads in applications that do not create windows, use your threading
- * library of choice.
- *
* Event processing is not required for joystick input to work.
*
* @param[in] timeout The maximum amount of time, in seconds, to wait.
*
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
+ * GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR.
+ *
* @reentrancy This function must not be called from a callback.
*
* @thread_safety This function must only be called from the main thread.
@@ -3513,10 +4638,6 @@ GLFWAPI void glfwWaitEventsTimeout(double timeout);
* This function posts an empty event from the current thread to the event
* queue, causing @ref glfwWaitEvents or @ref glfwWaitEventsTimeout to return.
*
- * If no windows exist, this function returns immediately. For synchronization
- * of threads in applications that do not create windows, use your threading
- * library of choice.
- *
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
@@ -3535,12 +4656,14 @@ GLFWAPI void glfwPostEmptyEvent(void);
/*! @brief Returns the value of an input option for the specified window.
*
* This function returns the value of an input option for the specified window.
- * The mode must be one of @ref GLFW_CURSOR, @ref GLFW_STICKY_KEYS or
- * @ref GLFW_STICKY_MOUSE_BUTTONS.
+ * The mode must be one of @ref GLFW_CURSOR, @ref GLFW_STICKY_KEYS,
+ * @ref GLFW_STICKY_MOUSE_BUTTONS, @ref GLFW_LOCK_KEY_MODS or
+ * @ref GLFW_RAW_MOUSE_MOTION.
*
* @param[in] window The window to query.
- * @param[in] mode One of `GLFW_CURSOR`, `GLFW_STICKY_KEYS` or
- * `GLFW_STICKY_MOUSE_BUTTONS`.
+ * @param[in] mode One of `GLFW_CURSOR`, `GLFW_STICKY_KEYS`,
+ * `GLFW_STICKY_MOUSE_BUTTONS`, `GLFW_LOCK_KEY_MODS` or
+ * `GLFW_RAW_MOUSE_MOTION`.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_INVALID_ENUM.
@@ -3558,17 +4681,20 @@ GLFWAPI int glfwGetInputMode(GLFWwindow* window, int mode);
/*! @brief Sets an input option for the specified window.
*
* This function sets an input mode option for the specified window. The mode
- * must be one of @ref GLFW_CURSOR, @ref GLFW_STICKY_KEYS or
- * @ref GLFW_STICKY_MOUSE_BUTTONS.
+ * must be one of @ref GLFW_CURSOR, @ref GLFW_STICKY_KEYS,
+ * @ref GLFW_STICKY_MOUSE_BUTTONS, @ref GLFW_LOCK_KEY_MODS
+ * @ref GLFW_RAW_MOUSE_MOTION, or @ref GLFW_UNLIMITED_MOUSE_BUTTONS.
*
* If the mode is `GLFW_CURSOR`, the value must be one of the following cursor
* modes:
* - `GLFW_CURSOR_NORMAL` makes the cursor visible and behaving normally.
- * - `GLFW_CURSOR_HIDDEN` makes the cursor invisible when it is over the client
- * area of the window but does not restrict the cursor from leaving.
+ * - `GLFW_CURSOR_HIDDEN` makes the cursor invisible when it is over the
+ * content area of the window but does not restrict the cursor from leaving.
* - `GLFW_CURSOR_DISABLED` hides and grabs the cursor, providing virtual
* and unlimited cursor movement. This is useful for implementing for
* example 3D camera controls.
+ * - `GLFW_CURSOR_CAPTURED` makes the cursor visible and confines it to the
+ * content area of the window.
*
* If the mode is `GLFW_STICKY_KEYS`, the value must be either `GLFW_TRUE` to
* enable sticky keys, or `GLFW_FALSE` to disable it. If sticky keys are
@@ -3585,13 +4711,32 @@ GLFWAPI int glfwGetInputMode(GLFWwindow* window, int mode);
* you are only interested in whether mouse buttons have been pressed but not
* when or in which order.
*
+ * If the mode is `GLFW_LOCK_KEY_MODS`, the value must be either `GLFW_TRUE` to
+ * enable lock key modifier bits, or `GLFW_FALSE` to disable them. If enabled,
+ * callbacks that receive modifier bits will also have the @ref
+ * GLFW_MOD_CAPS_LOCK bit set when the event was generated with Caps Lock on,
+ * and the @ref GLFW_MOD_NUM_LOCK bit when Num Lock was on.
+ *
+ * If the mode is `GLFW_RAW_MOUSE_MOTION`, the value must be either `GLFW_TRUE`
+ * to enable raw (unscaled and unaccelerated) mouse motion when the cursor is
+ * disabled, or `GLFW_FALSE` to disable it. If raw motion is not supported,
+ * attempting to set this will emit @ref GLFW_FEATURE_UNAVAILABLE. Call @ref
+ * glfwRawMouseMotionSupported to check for support.
+ *
+ * If the mode is `GLFW_UNLIMITED_MOUSE_BUTTONS`, the value must be either
+ * `GLFW_TRUE` to disable the mouse button limit when calling the mouse button
+ * callback, or `GLFW_FALSE` to limit the mouse buttons sent to the callback
+ * to the mouse button token values up to `GLFW_MOUSE_BUTTON_LAST`.
+ *
* @param[in] window The window whose input mode to set.
- * @param[in] mode One of `GLFW_CURSOR`, `GLFW_STICKY_KEYS` or
- * `GLFW_STICKY_MOUSE_BUTTONS`.
+ * @param[in] mode One of `GLFW_CURSOR`, `GLFW_STICKY_KEYS`,
+ * `GLFW_STICKY_MOUSE_BUTTONS`, `GLFW_LOCK_KEY_MODS` or
+ * `GLFW_RAW_MOUSE_MOTION`.
* @param[in] value The new value of the specified input mode.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
- * GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
+ * GLFW_INVALID_ENUM, @ref GLFW_PLATFORM_ERROR and @ref
+ * GLFW_FEATURE_UNAVAILABLE (see above).
*
* @thread_safety This function must only be called from the main thread.
*
@@ -3603,6 +4748,35 @@ GLFWAPI int glfwGetInputMode(GLFWwindow* window, int mode);
*/
GLFWAPI void glfwSetInputMode(GLFWwindow* window, int mode, int value);
+/*! @brief Returns whether raw mouse motion is supported.
+ *
+ * This function returns whether raw mouse motion is supported on the current
+ * system. This status does not change after GLFW has been initialized so you
+ * only need to check this once. If you attempt to enable raw motion on
+ * a system that does not support it, @ref GLFW_PLATFORM_ERROR will be emitted.
+ *
+ * Raw mouse motion is closer to the actual motion of the mouse across
+ * a surface. It is not affected by the scaling and acceleration applied to
+ * the motion of the desktop cursor. That processing is suitable for a cursor
+ * while raw motion is better for controlling for example a 3D camera. Because
+ * of this, raw mouse motion is only provided when the cursor is disabled.
+ *
+ * @return `GLFW_TRUE` if raw mouse motion is supported on the current machine,
+ * or `GLFW_FALSE` otherwise.
+ *
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
+ *
+ * @thread_safety This function must only be called from the main thread.
+ *
+ * @sa @ref raw_mouse_motion
+ * @sa @ref glfwSetInputMode
+ *
+ * @since Added in version 3.3.
+ *
+ * @ingroup input
+ */
+GLFWAPI int glfwRawMouseMotionSupported(void);
+
/*! @brief Returns the layout-specific name of the specified printable key.
*
* This function returns the name of the specified printable key, encoded as
@@ -3652,12 +4826,14 @@ GLFWAPI void glfwSetInputMode(GLFWwindow* window, int mode, int value);
* @param[in] scancode The scancode of the key to query.
* @return The UTF-8 encoded, layout-specific name of the key, or `NULL`.
*
- * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
- * GLFW_PLATFORM_ERROR.
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
+ * GLFW_INVALID_VALUE, @ref GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
+ *
+ * @remark The contents of the returned string may change when a keyboard
+ * layout change event is received.
*
* @pointer_lifetime The returned string is allocated and freed by GLFW. You
- * should not free it yourself. It is valid until the next call to @ref
- * glfwGetKeyName, or until the library is terminated.
+ * should not free it yourself. It is valid until the library is terminated.
*
* @thread_safety This function must only be called from the main thread.
*
@@ -3673,15 +4849,18 @@ GLFWAPI const char* glfwGetKeyName(int key, int scancode);
*
* This function returns the platform-specific scancode of the specified key.
*
- * If the key is `GLFW_KEY_UNKNOWN` or does not exist on the keyboard this
- * method will return `-1`.
+ * If the specified [key token](@ref keys) corresponds to a physical key not
+ * supported on the current platform then this method will return `-1`.
+ * Calling this function with anything other than a key token will return `-1`
+ * and generate a @ref GLFW_INVALID_ENUM error.
*
- * @param[in] key Any [named key](@ref keys).
- * @return The platform-specific scancode for the key, or `-1` if an
- * [error](@ref error_handling) occurred.
+ * @param[in] key Any [key token](@ref keys).
+ * @return The platform-specific scancode for the key, or `-1` if the key is
+ * not supported on the current platform or an [error](@ref error_handling)
+ * occurred.
*
- * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
- * GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
+ * GLFW_INVALID_ENUM.
*
* @thread_safety This function may be called from any thread.
*
@@ -3698,8 +4877,7 @@ GLFWAPI int glfwGetKeyScancode(int key);
*
* This function returns the last state reported for the specified key to the
* specified window. The returned state is one of `GLFW_PRESS` or
- * `GLFW_RELEASE`. The higher-level action `GLFW_REPEAT` is only reported to
- * the key callback.
+ * `GLFW_RELEASE`. The action `GLFW_REPEAT` is only reported to the key callback.
*
* If the @ref GLFW_STICKY_KEYS input mode is enabled, this function returns
* `GLFW_PRESS` the first time you call it for a key that was pressed, even if
@@ -3727,7 +4905,7 @@ GLFWAPI int glfwGetKeyScancode(int key);
* @sa @ref input_key
*
* @since Added in version 1.0.
- * @glfw3 Added window handle parameter.
+ * __GLFW 3:__ Added window handle parameter.
*
* @ingroup input
*/
@@ -3741,11 +4919,14 @@ GLFWAPI int glfwGetKey(GLFWwindow* window, int key);
* `GLFW_RELEASE`.
*
* If the @ref GLFW_STICKY_MOUSE_BUTTONS input mode is enabled, this function
- * `GLFW_PRESS` the first time you call it for a mouse button that was pressed,
- * even if that mouse button has already been released.
+ * returns `GLFW_PRESS` the first time you call it for a mouse button that was
+ * pressed, even if that mouse button has already been released.
+ *
+ * The @ref GLFW_UNLIMITED_MOUSE_BUTTONS input mode does not effect the
+ * limit on buttons which can be polled with this function.
*
* @param[in] window The desired window.
- * @param[in] button The desired [mouse button](@ref buttons).
+ * @param[in] button The desired [mouse button token](@ref buttons).
* @return One of `GLFW_PRESS` or `GLFW_RELEASE`.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
@@ -3756,17 +4937,17 @@ GLFWAPI int glfwGetKey(GLFWwindow* window, int key);
* @sa @ref input_mouse_button
*
* @since Added in version 1.0.
- * @glfw3 Added window handle parameter.
+ * __GLFW 3:__ Added window handle parameter.
*
* @ingroup input
*/
GLFWAPI int glfwGetMouseButton(GLFWwindow* window, int button);
-/*! @brief Retrieves the position of the cursor relative to the client area of
+/*! @brief Retrieves the position of the cursor relative to the content area of
* the window.
*
* This function returns the position of the cursor, in screen coordinates,
- * relative to the upper-left corner of the client area of the specified
+ * relative to the upper-left corner of the content area of the specified
* window.
*
* If the cursor is disabled (with `GLFW_CURSOR_DISABLED`) then the cursor
@@ -3782,9 +4963,9 @@ GLFWAPI int glfwGetMouseButton(GLFWwindow* window, int button);
*
* @param[in] window The desired window.
* @param[out] xpos Where to store the cursor x-coordinate, relative to the
- * left edge of the client area, or `NULL`.
+ * left edge of the content area, or `NULL`.
* @param[out] ypos Where to store the cursor y-coordinate, relative to the to
- * top edge of the client area, or `NULL`.
+ * top edge of the content area, or `NULL`.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
@@ -3800,11 +4981,11 @@ GLFWAPI int glfwGetMouseButton(GLFWwindow* window, int button);
*/
GLFWAPI void glfwGetCursorPos(GLFWwindow* window, double* xpos, double* ypos);
-/*! @brief Sets the position of the cursor, relative to the client area of the
+/*! @brief Sets the position of the cursor, relative to the content area of the
* window.
*
* This function sets the position, in screen coordinates, of the cursor
- * relative to the upper-left corner of the client area of the specified
+ * relative to the upper-left corner of the content area of the specified
* window. The window must have input focus. If the window does not have
* input focus when this function is called, it fails silently.
*
@@ -3819,15 +5000,15 @@ GLFWAPI void glfwGetCursorPos(GLFWwindow* window, double* xpos, double* ypos);
*
* @param[in] window The desired window.
* @param[in] xpos The desired x-coordinate, relative to the left edge of the
- * client area.
+ * content area.
* @param[in] ypos The desired y-coordinate, relative to the top edge of the
- * client area.
+ * content area.
*
- * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
- * GLFW_PLATFORM_ERROR.
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
+ * GLFW_PLATFORM_ERROR and @ref GLFW_FEATURE_UNAVAILABLE (see remarks).
*
- * @remark @wayland This function will only work when the cursor mode is
- * `GLFW_CURSOR_DISABLED`, otherwise it will do nothing.
+ * @remark __Wayland:__ This function will only work when the cursor mode is
+ * `GLFW_CURSOR_DISABLED`, otherwise it will emit @ref GLFW_FEATURE_UNAVAILABLE.
*
* @thread_safety This function must only be called from the main thread.
*
@@ -3860,8 +5041,8 @@ GLFWAPI void glfwSetCursorPos(GLFWwindow* window, double xpos, double ypos);
* @return The handle of the created cursor, or `NULL` if an
* [error](@ref error_handling) occurred.
*
- * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
- * GLFW_PLATFORM_ERROR.
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
+ * GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR.
*
* @pointer_lifetime The specified image data is copied before this function
* returns.
@@ -3880,19 +5061,44 @@ GLFWAPI GLFWcursor* glfwCreateCursor(const GLFWimage* image, int xhot, int yhot)
/*! @brief Creates a cursor with a standard shape.
*
- * Returns a cursor with a [standard shape](@ref shapes), that can be set for
- * a window with @ref glfwSetCursor.
+ * Returns a cursor with a standard shape, that can be set for a window with
+ * @ref glfwSetCursor. The images for these cursors come from the system
+ * cursor theme and their exact appearance will vary between platforms.
+ *
+ * Most of these shapes are guaranteed to exist on every supported platform but
+ * a few may not be present. See the table below for details.
+ *
+ * Cursor shape | Windows | macOS | X11 | Wayland
+ * ------------------------------ | ------- | ----- | ------ | -------
+ * @ref GLFW_ARROW_CURSOR | Yes | Yes | Yes | Yes
+ * @ref GLFW_IBEAM_CURSOR | Yes | Yes | Yes | Yes
+ * @ref GLFW_CROSSHAIR_CURSOR | Yes | Yes | Yes | Yes
+ * @ref GLFW_POINTING_HAND_CURSOR | Yes | Yes | Yes | Yes
+ * @ref GLFW_RESIZE_EW_CURSOR | Yes | Yes | Yes | Yes
+ * @ref GLFW_RESIZE_NS_CURSOR | Yes | Yes | Yes | Yes
+ * @ref GLFW_RESIZE_NWSE_CURSOR | Yes | Yes1 | Maybe2 | Maybe2
+ * @ref GLFW_RESIZE_NESW_CURSOR | Yes | Yes1 | Maybe2 | Maybe2
+ * @ref GLFW_RESIZE_ALL_CURSOR | Yes | Yes | Yes | Yes
+ * @ref GLFW_NOT_ALLOWED_CURSOR | Yes | Yes | Maybe2 | Maybe2
+ *
+ * 1) This uses a private system API and may fail in the future.
+ *
+ * 2) This uses a newer standard that not all cursor themes support.
+ *
+ * If the requested shape is not available, this function emits a @ref
+ * GLFW_CURSOR_UNAVAILABLE error and returns `NULL`.
*
* @param[in] shape One of the [standard shapes](@ref shapes).
* @return A new cursor ready to use or `NULL` if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
- * GLFW_INVALID_ENUM and @ref GLFW_PLATFORM_ERROR.
+ * GLFW_INVALID_ENUM, @ref GLFW_CURSOR_UNAVAILABLE and @ref
+ * GLFW_PLATFORM_ERROR.
*
* @thread_safety This function must only be called from the main thread.
*
- * @sa @ref cursor_object
+ * @sa @ref cursor_standard
* @sa @ref glfwCreateCursor
*
* @since Added in version 3.1.
@@ -3931,7 +5137,7 @@ GLFWAPI void glfwDestroyCursor(GLFWcursor* cursor);
/*! @brief Sets the cursor for the window.
*
* This function sets the cursor image to be used when the cursor is over the
- * client area of the specified window. The set cursor will only be visible
+ * content area of the specified window. The set cursor will only be visible
* when the [cursor mode](@ref cursor_mode) of the window is
* `GLFW_CURSOR_NORMAL`.
*
@@ -3966,9 +5172,9 @@ GLFWAPI void glfwSetCursor(GLFWwindow* window, GLFWcursor* cursor);
* [character callback](@ref glfwSetCharCallback) instead.
*
* When a window loses input focus, it will generate synthetic key release
- * events for all pressed keys. You can tell these events from user-generated
- * events by the fact that the synthetic ones are generated after the focus
- * loss event has been processed, i.e. after the
+ * events for all pressed keys with associated key tokens. You can tell these
+ * events from user-generated events by the fact that the synthetic ones are
+ * generated after the focus loss event has been processed, i.e. after the
* [window focus callback](@ref glfwSetWindowFocusCallback) has been called.
*
* The scancode of a key is specific to that platform or sometimes even to that
@@ -3980,11 +5186,18 @@ GLFWAPI void glfwSetCursor(GLFWwindow* window, GLFWcursor* cursor);
* scancode may be zero.
*
* @param[in] window The window whose callback to set.
- * @param[in] cbfun The new key callback, or `NULL` to remove the currently
+ * @param[in] callback The new key callback, or `NULL` to remove the currently
* set callback.
* @return The previously set callback, or `NULL` if no callback was set or the
* library had not been [initialized](@ref intro_init).
*
+ * @callback_signature
+ * @code
+ * void function_name(GLFWwindow* window, int key, int scancode, int action, int mods)
+ * @endcode
+ * For more information about the callback parameters, see the
+ * [function pointer type](@ref GLFWkeyfun).
+ *
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function must only be called from the main thread.
@@ -3992,11 +5205,11 @@ GLFWAPI void glfwSetCursor(GLFWwindow* window, GLFWcursor* cursor);
* @sa @ref input_key
*
* @since Added in version 1.0.
- * @glfw3 Added window handle parameter and return value.
+ * __GLFW 3:__ Added window handle parameter and return value.
*
* @ingroup input
*/
-GLFWAPI GLFWkeyfun glfwSetKeyCallback(GLFWwindow* window, GLFWkeyfun cbfun);
+GLFWAPI GLFWkeyfun glfwSetKeyCallback(GLFWwindow* window, GLFWkeyfun callback);
/*! @brief Sets the Unicode character callback.
*
@@ -4013,16 +5226,21 @@ GLFWAPI GLFWkeyfun glfwSetKeyCallback(GLFWwindow* window, GLFWkeyfun cbfun);
* The character callback behaves as system text input normally does and will
* not be called if modifier keys are held down that would prevent normal text
* input on that platform, for example a Super (Command) key on macOS or Alt key
- * on Windows. There is a
- * [character with modifiers callback](@ref glfwSetCharModsCallback) that
- * receives these events.
+ * on Windows.
*
* @param[in] window The window whose callback to set.
- * @param[in] cbfun The new callback, or `NULL` to remove the currently set
+ * @param[in] callback The new callback, or `NULL` to remove the currently set
* callback.
* @return The previously set callback, or `NULL` if no callback was set or the
* library had not been [initialized](@ref intro_init).
*
+ * @callback_signature
+ * @code
+ * void function_name(GLFWwindow* window, unsigned int codepoint)
+ * @endcode
+ * For more information about the callback parameters, see the
+ * [function pointer type](@ref GLFWcharfun).
+ *
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function must only be called from the main thread.
@@ -4030,11 +5248,11 @@ GLFWAPI GLFWkeyfun glfwSetKeyCallback(GLFWwindow* window, GLFWkeyfun cbfun);
* @sa @ref input_char
*
* @since Added in version 2.4.
- * @glfw3 Added window handle parameter and return value.
+ * __GLFW 3:__ Added window handle parameter and return value.
*
* @ingroup input
*/
-GLFWAPI GLFWcharfun glfwSetCharCallback(GLFWwindow* window, GLFWcharfun cbfun);
+GLFWAPI GLFWcharfun glfwSetCharCallback(GLFWwindow* window, GLFWcharfun callback);
/*! @brief Sets the Unicode character with modifiers callback.
*
@@ -4052,11 +5270,20 @@ GLFWAPI GLFWcharfun glfwSetCharCallback(GLFWwindow* window, GLFWcharfun cbfun);
* [key callback](@ref glfwSetKeyCallback) instead.
*
* @param[in] window The window whose callback to set.
- * @param[in] cbfun The new callback, or `NULL` to remove the currently set
+ * @param[in] callback The new callback, or `NULL` to remove the currently set
* callback.
* @return The previously set callback, or `NULL` if no callback was set or an
* [error](@ref error_handling) occurred.
*
+ * @callback_signature
+ * @code
+ * void function_name(GLFWwindow* window, unsigned int codepoint, int mods)
+ * @endcode
+ * For more information about the callback parameters, see the
+ * [function pointer type](@ref GLFWcharmodsfun).
+ *
+ * @deprecated Scheduled for removal in version 4.0.
+ *
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function must only be called from the main thread.
@@ -4067,7 +5294,7 @@ GLFWAPI GLFWcharfun glfwSetCharCallback(GLFWwindow* window, GLFWcharfun cbfun);
*
* @ingroup input
*/
-GLFWAPI GLFWcharmodsfun glfwSetCharModsCallback(GLFWwindow* window, GLFWcharmodsfun cbfun);
+GLFWAPI GLFWcharmodsfun glfwSetCharModsCallback(GLFWwindow* window, GLFWcharmodsfun callback);
/*! @brief Sets the mouse button callback.
*
@@ -4075,17 +5302,29 @@ GLFWAPI GLFWcharmodsfun glfwSetCharModsCallback(GLFWwindow* window, GLFWcharmods
* is called when a mouse button is pressed or released.
*
* When a window loses input focus, it will generate synthetic mouse button
- * release events for all pressed mouse buttons. You can tell these events
- * from user-generated events by the fact that the synthetic ones are generated
- * after the focus loss event has been processed, i.e. after the
- * [window focus callback](@ref glfwSetWindowFocusCallback) has been called.
+ * release events for all pressed mouse buttons with associated button tokens.
+ * You can tell these events from user-generated events by the fact that the
+ * synthetic ones are generated after the focus loss event has been processed,
+ * i.e. after the [window focus callback](@ref glfwSetWindowFocusCallback) has
+ * been called.
+ *
+ * The reported `button` value can be higher than `GLFW_MOUSE_BUTTON_LAST` if
+ * the button does not have an associated [button token](@ref buttons) and the
+ * @ref GLFW_UNLIMITED_MOUSE_BUTTONS input mode is set.
*
* @param[in] window The window whose callback to set.
- * @param[in] cbfun The new callback, or `NULL` to remove the currently set
+ * @param[in] callback The new callback, or `NULL` to remove the currently set
* callback.
* @return The previously set callback, or `NULL` if no callback was set or the
* library had not been [initialized](@ref intro_init).
*
+ * @callback_signature
+ * @code
+ * void function_name(GLFWwindow* window, int button, int action, int mods)
+ * @endcode
+ * For more information about the callback parameters, see the
+ * [function pointer type](@ref GLFWmousebuttonfun).
+ *
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function must only be called from the main thread.
@@ -4093,25 +5332,32 @@ GLFWAPI GLFWcharmodsfun glfwSetCharModsCallback(GLFWwindow* window, GLFWcharmods
* @sa @ref input_mouse_button
*
* @since Added in version 1.0.
- * @glfw3 Added window handle parameter and return value.
+ * __GLFW 3:__ Added window handle parameter and return value.
*
* @ingroup input
*/
-GLFWAPI GLFWmousebuttonfun glfwSetMouseButtonCallback(GLFWwindow* window, GLFWmousebuttonfun cbfun);
+GLFWAPI GLFWmousebuttonfun glfwSetMouseButtonCallback(GLFWwindow* window, GLFWmousebuttonfun callback);
/*! @brief Sets the cursor position callback.
*
* This function sets the cursor position callback of the specified window,
* which is called when the cursor is moved. The callback is provided with the
* position, in screen coordinates, relative to the upper-left corner of the
- * client area of the window.
+ * content area of the window.
*
* @param[in] window The window whose callback to set.
- * @param[in] cbfun The new callback, or `NULL` to remove the currently set
+ * @param[in] callback The new callback, or `NULL` to remove the currently set
* callback.
* @return The previously set callback, or `NULL` if no callback was set or the
* library had not been [initialized](@ref intro_init).
*
+ * @callback_signature
+ * @code
+ * void function_name(GLFWwindow* window, double xpos, double ypos);
+ * @endcode
+ * For more information about the callback parameters, see the
+ * [function pointer type](@ref GLFWcursorposfun).
+ *
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function must only be called from the main thread.
@@ -4122,20 +5368,27 @@ GLFWAPI GLFWmousebuttonfun glfwSetMouseButtonCallback(GLFWwindow* window, GLFWmo
*
* @ingroup input
*/
-GLFWAPI GLFWcursorposfun glfwSetCursorPosCallback(GLFWwindow* window, GLFWcursorposfun cbfun);
+GLFWAPI GLFWcursorposfun glfwSetCursorPosCallback(GLFWwindow* window, GLFWcursorposfun callback);
-/*! @brief Sets the cursor enter/exit callback.
+/*! @brief Sets the cursor enter/leave callback.
*
* This function sets the cursor boundary crossing callback of the specified
- * window, which is called when the cursor enters or leaves the client area of
+ * window, which is called when the cursor enters or leaves the content area of
* the window.
*
* @param[in] window The window whose callback to set.
- * @param[in] cbfun The new callback, or `NULL` to remove the currently set
+ * @param[in] callback The new callback, or `NULL` to remove the currently set
* callback.
* @return The previously set callback, or `NULL` if no callback was set or the
* library had not been [initialized](@ref intro_init).
*
+ * @callback_signature
+ * @code
+ * void function_name(GLFWwindow* window, int entered)
+ * @endcode
+ * For more information about the callback parameters, see the
+ * [function pointer type](@ref GLFWcursorenterfun).
+ *
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function must only be called from the main thread.
@@ -4146,7 +5399,7 @@ GLFWAPI GLFWcursorposfun glfwSetCursorPosCallback(GLFWwindow* window, GLFWcursor
*
* @ingroup input
*/
-GLFWAPI GLFWcursorenterfun glfwSetCursorEnterCallback(GLFWwindow* window, GLFWcursorenterfun cbfun);
+GLFWAPI GLFWcursorenterfun glfwSetCursorEnterCallback(GLFWwindow* window, GLFWcursorenterfun callback);
/*! @brief Sets the scroll callback.
*
@@ -4158,11 +5411,18 @@ GLFWAPI GLFWcursorenterfun glfwSetCursorEnterCallback(GLFWwindow* window, GLFWcu
* wheel or a touchpad scrolling area.
*
* @param[in] window The window whose callback to set.
- * @param[in] cbfun The new scroll callback, or `NULL` to remove the currently
- * set callback.
+ * @param[in] callback The new scroll callback, or `NULL` to remove the
+ * currently set callback.
* @return The previously set callback, or `NULL` if no callback was set or the
* library had not been [initialized](@ref intro_init).
*
+ * @callback_signature
+ * @code
+ * void function_name(GLFWwindow* window, double xoffset, double yoffset)
+ * @endcode
+ * For more information about the callback parameters, see the
+ * [function pointer type](@ref GLFWscrollfun).
+ *
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function must only be called from the main thread.
@@ -4173,12 +5433,12 @@ GLFWAPI GLFWcursorenterfun glfwSetCursorEnterCallback(GLFWwindow* window, GLFWcu
*
* @ingroup input
*/
-GLFWAPI GLFWscrollfun glfwSetScrollCallback(GLFWwindow* window, GLFWscrollfun cbfun);
+GLFWAPI GLFWscrollfun glfwSetScrollCallback(GLFWwindow* window, GLFWscrollfun callback);
-/*! @brief Sets the file drop callback.
+/*! @brief Sets the path drop callback.
*
- * This function sets the file drop callback of the specified window, which is
- * called when one or more dragged files are dropped on the window.
+ * This function sets the path drop callback of the specified window, which is
+ * called when one or more dragged paths are dropped on the window.
*
* Because the path array and its strings may have been generated specifically
* for that event, they are not guaranteed to be valid after the callback has
@@ -4186,14 +5446,19 @@ GLFWAPI GLFWscrollfun glfwSetScrollCallback(GLFWwindow* window, GLFWscrollfun cb
* make a deep copy.
*
* @param[in] window The window whose callback to set.
- * @param[in] cbfun The new file drop callback, or `NULL` to remove the
+ * @param[in] callback The new file drop callback, or `NULL` to remove the
* currently set callback.
* @return The previously set callback, or `NULL` if no callback was set or the
* library had not been [initialized](@ref intro_init).
*
- * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
+ * @callback_signature
+ * @code
+ * void function_name(GLFWwindow* window, int path_count, const char* paths[])
+ * @endcode
+ * For more information about the callback parameters, see the
+ * [function pointer type](@ref GLFWdropfun).
*
- * @remark @wayland File drop is currently unimplemented.
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function must only be called from the main thread.
*
@@ -4203,7 +5468,7 @@ GLFWAPI GLFWscrollfun glfwSetScrollCallback(GLFWwindow* window, GLFWscrollfun cb
*
* @ingroup input
*/
-GLFWAPI GLFWdropfun glfwSetDropCallback(GLFWwindow* window, GLFWdropfun cbfun);
+GLFWAPI GLFWdropfun glfwSetDropCallback(GLFWwindow* window, GLFWdropfun callback);
/*! @brief Returns whether the specified joystick is present.
*
@@ -4297,7 +5562,7 @@ GLFWAPI const float* glfwGetJoystickAxes(int jid, int* count);
* @sa @ref joystick_button
*
* @since Added in version 2.2.
- * @glfw3 Changed to return a dynamic array.
+ * __GLFW 3:__ Changed to return a dynamic array.
*
* @ingroup input
*/
@@ -4309,7 +5574,7 @@ GLFWAPI const unsigned char* glfwGetJoystickButtons(int jid, int* count);
* Each element in the array is one of the following values:
*
* Name | Value
- * --------------------- | --------------------------------
+ * ---- | -----
* `GLFW_HAT_CENTERED` | 0
* `GLFW_HAT_UP` | 1
* `GLFW_HAT_RIGHT` | 2
@@ -4325,10 +5590,10 @@ GLFWAPI const unsigned char* glfwGetJoystickButtons(int jid, int* count);
* it with the corresponding direction.
*
* @code
- * if (hats[2] & GLFW_HAT_RIGHT)
- * {
- * // State of hat 2 could be right-up, right or right-down
- * }
+ * if (hats[2] & GLFW_HAT_RIGHT)
+ * {
+ * // State of hat 2 could be right-up, right or right-down
+ * }
* @endcode
*
* If the specified joystick is not present this function will return `NULL`
@@ -4391,7 +5656,7 @@ GLFWAPI const unsigned char* glfwGetJoystickHats(int jid, int* count);
*/
GLFWAPI const char* glfwGetJoystickName(int jid);
-/*! @brief Returns the SDL comaptible GUID of the specified joystick.
+/*! @brief Returns the SDL compatible GUID of the specified joystick.
*
* This function returns the SDL compatible GUID, as a UTF-8 encoded
* hexadecimal string, of the specified joystick. The returned string is
@@ -4432,6 +5697,56 @@ GLFWAPI const char* glfwGetJoystickName(int jid);
*/
GLFWAPI const char* glfwGetJoystickGUID(int jid);
+/*! @brief Sets the user pointer of the specified joystick.
+ *
+ * This function sets the user-defined pointer of the specified joystick. The
+ * current value is retained until the joystick is disconnected. The initial
+ * value is `NULL`.
+ *
+ * This function may be called from the joystick callback, even for a joystick
+ * that is being disconnected.
+ *
+ * @param[in] jid The joystick whose pointer to set.
+ * @param[in] pointer The new value.
+ *
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
+ *
+ * @thread_safety This function may be called from any thread. Access is not
+ * synchronized.
+ *
+ * @sa @ref joystick_userptr
+ * @sa @ref glfwGetJoystickUserPointer
+ *
+ * @since Added in version 3.3.
+ *
+ * @ingroup input
+ */
+GLFWAPI void glfwSetJoystickUserPointer(int jid, void* pointer);
+
+/*! @brief Returns the user pointer of the specified joystick.
+ *
+ * This function returns the current value of the user-defined pointer of the
+ * specified joystick. The initial value is `NULL`.
+ *
+ * This function may be called from the joystick callback, even for a joystick
+ * that is being disconnected.
+ *
+ * @param[in] jid The joystick whose pointer to return.
+ *
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
+ *
+ * @thread_safety This function may be called from any thread. Access is not
+ * synchronized.
+ *
+ * @sa @ref joystick_userptr
+ * @sa @ref glfwSetJoystickUserPointer
+ *
+ * @since Added in version 3.3.
+ *
+ * @ingroup input
+ */
+GLFWAPI void* glfwGetJoystickUserPointer(int jid);
+
/*! @brief Returns whether the specified joystick has a gamepad mapping.
*
* This function returns whether the specified joystick is both present and has
@@ -4472,11 +5787,18 @@ GLFWAPI int glfwJoystickIsGamepad(int jid);
* called by joystick functions. The function will then return whatever it
* returns if the joystick is not present.
*
- * @param[in] cbfun The new callback, or `NULL` to remove the currently set
+ * @param[in] callback The new callback, or `NULL` to remove the currently set
* callback.
* @return The previously set callback, or `NULL` if no callback was set or the
* library had not been [initialized](@ref intro_init).
*
+ * @callback_signature
+ * @code
+ * void function_name(int jid, int event)
+ * @endcode
+ * For more information about the callback parameters, see the
+ * [function pointer type](@ref GLFWjoystickfun).
+ *
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function must only be called from the main thread.
@@ -4487,7 +5809,7 @@ GLFWAPI int glfwJoystickIsGamepad(int jid);
*
* @ingroup input
*/
-GLFWAPI GLFWjoystickfun glfwSetJoystickCallback(GLFWjoystickfun cbfun);
+GLFWAPI GLFWjoystickfun glfwSetJoystickCallback(GLFWjoystickfun callback);
/*! @brief Adds the specified SDL_GameControllerDB gamepad mappings.
*
@@ -4538,6 +5860,8 @@ GLFWAPI int glfwUpdateGamepadMappings(const char* string);
* joystick is not present, does not have a mapping or an
* [error](@ref error_handling) occurred.
*
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref GLFW_INVALID_ENUM.
+ *
* @pointer_lifetime The returned string is allocated and freed by GLFW. You
* should not free it yourself. It is valid until the specified joystick is
* disconnected, the gamepad mappings are updated or the library is terminated.
@@ -4555,7 +5879,7 @@ GLFWAPI const char* glfwGetGamepadName(int jid);
/*! @brief Retrieves the state of the specified joystick remapped as a gamepad.
*
- * This function retrives the state of the specified joystick remapped to
+ * This function retrieves the state of the specified joystick remapped to
* an Xbox-like gamepad.
*
* If the specified joystick is not present or does not have a gamepad mapping
@@ -4568,7 +5892,7 @@ GLFWAPI const char* glfwGetGamepadName(int jid);
*
* Not all devices have all the buttons or axes provided by @ref
* GLFWgamepadstate. Unavailable buttons and axes will always report
- * `GLFW_RELEASE` and 1.0 respectively.
+ * `GLFW_RELEASE` and 0.0 respectively.
*
* @param[in] jid The [joystick](@ref joysticks) to query.
* @param[out] state The gamepad input state of the joystick.
@@ -4579,6 +5903,8 @@ GLFWAPI const char* glfwGetGamepadName(int jid);
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_INVALID_ENUM.
*
+ * @thread_safety This function must only be called from the main thread.
+ *
* @sa @ref gamepad
* @sa @ref glfwUpdateGamepadMappings
* @sa @ref glfwJoystickIsGamepad
@@ -4594,13 +5920,16 @@ GLFWAPI int glfwGetGamepadState(int jid, GLFWgamepadstate* state);
* This function sets the system clipboard to the specified, UTF-8 encoded
* string.
*
- * @param[in] window The window that will own the clipboard contents.
+ * @param[in] window Deprecated. Any valid window or `NULL`.
* @param[in] string A UTF-8 encoded string.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*
- * @remark @wayland Clipboard is currently unimplemented.
+ * @remark __Win32:__ The clipboard on Windows has a single global lock for reading and
+ * writing. GLFW tries to acquire it a few times, which is almost always enough. If it
+ * cannot acquire the lock then this function emits @ref GLFW_PLATFORM_ERROR and returns.
+ * It is safe to try this multiple times.
*
* @pointer_lifetime The specified string is copied before this function
* returns.
@@ -4623,14 +5952,17 @@ GLFWAPI void glfwSetClipboardString(GLFWwindow* window, const char* string);
* if its contents cannot be converted, `NULL` is returned and a @ref
* GLFW_FORMAT_UNAVAILABLE error is generated.
*
- * @param[in] window The window that will request the clipboard contents.
+ * @param[in] window Deprecated. Any valid window or `NULL`.
* @return The contents of the clipboard as a UTF-8 encoded string, or `NULL`
* if an [error](@ref error_handling) occurred.
*
- * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
- * GLFW_PLATFORM_ERROR.
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
+ * GLFW_FORMAT_UNAVAILABLE and @ref GLFW_PLATFORM_ERROR.
*
- * @remark @wayland Clipboard is currently unimplemented.
+ * @remark __Win32:__ The clipboard on Windows has a single global lock for reading and
+ * writing. GLFW tries to acquire it a few times, which is almost always enough. If it
+ * cannot acquire the lock then this function emits @ref GLFW_PLATFORM_ERROR and returns.
+ * It is safe to try this multiple times.
*
* @pointer_lifetime The returned string is allocated and freed by GLFW. You
* should not free it yourself. It is valid until the next call to @ref
@@ -4648,23 +5980,26 @@ GLFWAPI void glfwSetClipboardString(GLFWwindow* window, const char* string);
*/
GLFWAPI const char* glfwGetClipboardString(GLFWwindow* window);
-/*! @brief Returns the value of the GLFW timer.
+/*! @brief Returns the GLFW time.
+ *
+ * This function returns the current GLFW time, in seconds. Unless the time
+ * has been set using @ref glfwSetTime it measures time elapsed since GLFW was
+ * initialized.
*
- * This function returns the value of the GLFW timer. Unless the timer has
- * been set using @ref glfwSetTime, the timer measures time elapsed since GLFW
- * was initialized.
+ * This function and @ref glfwSetTime are helper functions on top of @ref
+ * glfwGetTimerFrequency and @ref glfwGetTimerValue.
*
* The resolution of the timer is system dependent, but is usually on the order
* of a few micro- or nanoseconds. It uses the highest-resolution monotonic
- * time source on each supported platform.
+ * time source on each operating system.
*
- * @return The current value, in seconds, or zero if an
+ * @return The current time, in seconds, or zero if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
* @thread_safety This function may be called from any thread. Reading and
- * writing of the internal timer offset is not atomic, so it needs to be
+ * writing of the internal base time is not atomic, so it needs to be
* externally synchronized with calls to @ref glfwSetTime.
*
* @sa @ref time
@@ -4675,23 +6010,26 @@ GLFWAPI const char* glfwGetClipboardString(GLFWwindow* window);
*/
GLFWAPI double glfwGetTime(void);
-/*! @brief Sets the GLFW timer.
+/*! @brief Sets the GLFW time.
*
- * This function sets the value of the GLFW timer. It then continues to count
- * up from that value. The value must be a positive finite number less than
- * or equal to 18446744073.0, which is approximately 584.5 years.
+ * This function sets the current GLFW time, in seconds. The value must be
+ * a positive finite number less than or equal to 18446744073.0, which is
+ * approximately 584.5 years.
+ *
+ * This function and @ref glfwGetTime are helper functions on top of @ref
+ * glfwGetTimerFrequency and @ref glfwGetTimerValue.
*
* @param[in] time The new value, in seconds.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_INVALID_VALUE.
*
- * @remark The upper limit of the timer is calculated as
+ * @remark The upper limit of GLFW time is calculated as
* floor((264 - 1) / 109 ) and is due to implementations
* storing nanoseconds in 64 bits. The limit may be increased in the future.
*
* @thread_safety This function may be called from any thread. Reading and
- * writing of the internal timer offset is not atomic, so it needs to be
+ * writing of the internal base time is not atomic, so it needs to be
* externally synchronized with calls to @ref glfwGetTime.
*
* @sa @ref time
@@ -4708,7 +6046,7 @@ GLFWAPI void glfwSetTime(double time);
* 1 / frequency seconds. To get the frequency, call @ref
* glfwGetTimerFrequency.
*
- * @return The value of the timer, or zero if an
+ * @return The value of the timer, or zero if an
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
@@ -4748,9 +6086,15 @@ GLFWAPI uint64_t glfwGetTimerFrequency(void);
* thread.
*
* This function makes the OpenGL or OpenGL ES context of the specified window
- * current on the calling thread. A context can only be made current on
- * a single thread at a time and each thread can have only a single current
- * context at a time.
+ * current on the calling thread. It can also detach the current context from
+ * the calling thread without making a new one current by passing in `NULL`.
+ *
+ * A context must only be made current on a single thread at a time and each
+ * thread can have only a single current context at a time. Making a context
+ * current detaches any previously current context on the calling thread.
+ *
+ * When moving a context between threads, you must detach it (make it
+ * non-current) on the old thread before making it current on the new one.
*
* By default, making a context non-current implicitly forces a pipeline flush.
* On machines that support `GL_KHR_context_flush_control`, you can control
@@ -4765,6 +6109,10 @@ GLFWAPI uint64_t glfwGetTimerFrequency(void);
* @param[in] window The window whose context to make current, or `NULL` to
* detach the current context.
*
+ * @remarks If the previously current context was created via a different
+ * context creation API than the one passed to this function, GLFW will still
+ * detach the previous one from its API before making the new one current.
+ *
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
* GLFW_NO_WINDOW_CONTEXT and @ref GLFW_PLATFORM_ERROR.
*
@@ -4828,7 +6176,7 @@ GLFWAPI GLFWwindow* glfwGetCurrentContext(void);
* @sa @ref glfwSwapInterval
*
* @since Added in version 1.0.
- * @glfw3 Added window handle parameter.
+ * __GLFW 3:__ Added window handle parameter.
*
* @ingroup window
*/
@@ -4842,12 +6190,11 @@ GLFWAPI void glfwSwapBuffers(GLFWwindow* window);
* is sometimes called _vertical synchronization_, _vertical retrace
* synchronization_ or just _vsync_.
*
- * Contexts that support either of the `WGL_EXT_swap_control_tear` and
- * `GLX_EXT_swap_control_tear` extensions also accept negative swap intervals,
- * which allow the driver to swap even if a frame arrives a little bit late.
- * You can check for the presence of these extensions using @ref
- * glfwExtensionSupported. For more information about swap tearing, see the
- * extension specifications.
+ * A context that supports either of the `WGL_EXT_swap_control_tear` and
+ * `GLX_EXT_swap_control_tear` extensions also accepts _negative_ swap
+ * intervals, which allows the driver to swap immediately even if a frame
+ * arrives a little bit late. You can check for these extensions with @ref
+ * glfwExtensionSupported.
*
* A context must be current on the calling thread. Calling this function
* without a current context will cause a @ref GLFW_NO_CURRENT_CONTEXT error.
@@ -4862,7 +6209,7 @@ GLFWAPI void glfwSwapBuffers(GLFWwindow* window);
* GLFW_NO_CURRENT_CONTEXT and @ref GLFW_PLATFORM_ERROR.
*
* @remark This function is not called during context creation, leaving the
- * swap interval set to whatever is the default on that platform. This is done
+ * swap interval set to whatever is the default for that API. This is done
* because some swap interval extensions used by GLFW do not allow the swap
* interval to be reset to zero once it has been set to a non-zero value.
*
@@ -4966,13 +6313,11 @@ GLFWAPI GLFWglproc glfwGetProcAddress(const char* procname);
* This function returns whether the Vulkan loader and any minimally functional
* ICD have been found.
*
- * The availability of a Vulkan loader and even an ICD does not by itself
- * guarantee that surface creation or even instance creation is possible.
- * For example, on Fermi systems Nvidia will install an ICD that provides no
- * actual Vulkan support. Call @ref glfwGetRequiredInstanceExtensions to check
- * whether the extensions necessary for Vulkan surface creation are available
- * and @ref glfwGetPhysicalDevicePresentationSupport to check whether a queue
- * family of a physical device supports image presentation.
+ * The availability of a Vulkan loader and even an ICD does not by itself guarantee that
+ * surface creation or even instance creation is possible. Call @ref
+ * glfwGetRequiredInstanceExtensions to check whether the extensions necessary for Vulkan
+ * surface creation are available and @ref glfwGetPhysicalDevicePresentationSupport to
+ * check whether a queue family of a physical device supports image presentation.
*
* @return `GLFW_TRUE` if Vulkan is minimally available, or `GLFW_FALSE`
* otherwise.
@@ -4993,7 +6338,7 @@ GLFWAPI int glfwVulkanSupported(void);
*
* This function returns an array of names of Vulkan instance extensions required
* by GLFW for creating Vulkan surfaces for GLFW windows. If successful, the
- * list will always contains `VK_KHR_surface`, so if you don't require any
+ * list will always contain `VK_KHR_surface`, so if you don't require any
* additional extensions you can pass this list directly to the
* `VkInstanceCreateInfo` struct.
*
@@ -5018,9 +6363,6 @@ GLFWAPI int glfwVulkanSupported(void);
* returned array, as it is an error to specify an extension more than once in
* the `VkInstanceCreateInfo` struct.
*
- * @remark @macos This function currently only supports the
- * `VK_MVK_macos_surface` extension from MoltenVK.
- *
* @pointer_lifetime The returned array is allocated and freed by GLFW. You
* should not free it yourself. It is guaranteed to be valid only until the
* library is terminated.
@@ -5101,8 +6443,8 @@ GLFWAPI GLFWvkproc glfwGetInstanceProcAddress(VkInstance instance, const char* p
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
* GLFW_API_UNAVAILABLE and @ref GLFW_PLATFORM_ERROR.
*
- * @remark @macos This function currently always returns `GLFW_TRUE`, as the
- * `VK_MVK_macos_surface` extension does not provide
+ * @remark __macOS:__ This function currently always returns `GLFW_TRUE`, as the
+ * `VK_MVK_macos_surface` and `VK_EXT_metal_surface` extensions do not provide
* a `vkGetPhysicalDevice*PresentationSupport` type function.
*
* @thread_safety This function may be called from any thread. For
@@ -5132,6 +6474,11 @@ GLFWAPI int glfwGetPhysicalDevicePresentationSupport(VkInstance instance, VkPhys
* glfwGetRequiredInstanceExtensions to check what instance extensions are
* required.
*
+ * The window surface cannot be shared with another API so the window must
+ * have been created with the [client api hint](@ref GLFW_CLIENT_API_attrib)
+ * set to `GLFW_NO_API` otherwise it generates a @ref GLFW_INVALID_VALUE error
+ * and returns `VK_ERROR_NATIVE_WINDOW_IN_USE_KHR`.
+ *
* The window surface must be destroyed before the specified Vulkan instance.
* It is the responsibility of the caller to destroy the window surface. GLFW
* does not destroy it for you. Call `vkDestroySurfaceKHR` to destroy the
@@ -5147,19 +6494,28 @@ GLFWAPI int glfwGetPhysicalDevicePresentationSupport(VkInstance instance, VkPhys
* [error](@ref error_handling) occurred.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
- * GLFW_API_UNAVAILABLE and @ref GLFW_PLATFORM_ERROR.
+ * GLFW_API_UNAVAILABLE, @ref GLFW_PLATFORM_ERROR and @ref GLFW_INVALID_VALUE
*
* @remark If an error occurs before the creation call is made, GLFW returns
* the Vulkan error code most appropriate for the error. Appropriate use of
* @ref glfwVulkanSupported and @ref glfwGetRequiredInstanceExtensions should
* eliminate almost all occurrences of these errors.
*
- * @remark @macos This function currently only supports the
- * `VK_MVK_macos_surface` extension from MoltenVK.
+ * @remark __macOS:__ GLFW prefers the `VK_EXT_metal_surface` extension, with the
+ * `VK_MVK_macos_surface` extension as a fallback. The name of the selected
+ * extension, if any, is included in the array returned by @ref
+ * glfwGetRequiredInstanceExtensions.
*
- * @remark @macos This function creates and sets a `CAMetalLayer` instance for
+ * @remark __macOS:__ This function creates and sets a `CAMetalLayer` instance for
* the window content view, which is required for MoltenVK to function.
*
+ * @remark __X11:__ By default GLFW prefers the `VK_KHR_xcb_surface` extension,
+ * with the `VK_KHR_xlib_surface` extension as a fallback. You can make
+ * `VK_KHR_xlib_surface` the preferred extension by setting the
+ * [GLFW_X11_XCB_VULKAN_SURFACE](@ref GLFW_X11_XCB_VULKAN_SURFACE_hint) init
+ * hint. The name of the selected extension, if any, is included in the array
+ * returned by @ref glfwGetRequiredInstanceExtensions.
+ *
* @thread_safety This function may be called from any thread. For
* synchronization details of Vulkan objects, see the Vulkan specification.
*
@@ -5196,6 +6552,7 @@ GLFWAPI VkResult glfwCreateWindowSurface(VkInstance instance, GLFWwindow* window
*/
#ifndef GLAPIENTRY
#define GLAPIENTRY APIENTRY
+ #define GLFW_GLAPIENTRY_DEFINED
#endif
/* -------------------- END SYSTEM/COMPILER SPECIFIC --------------------- */
diff --git a/external/GLFW/include/GLFW/glfw3native.h b/external/GLFW/include/GLFW/glfw3native.h
index 4372cb7..8db2cfa 100644
--- a/external/GLFW/include/GLFW/glfw3native.h
+++ b/external/GLFW/include/GLFW/glfw3native.h
@@ -1,9 +1,9 @@
/*************************************************************************
- * GLFW 3.3 - www.glfw.org
+ * GLFW 3.5 - www.glfw.org
* A library for OpenGL, window and input
*------------------------------------------------------------------------
* Copyright (c) 2002-2006 Marcus Geelnard
- * Copyright (c) 2006-2016 Camilla Löwy
+ * Copyright (c) 2006-2018 Camilla Löwy
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
@@ -62,7 +62,6 @@ extern "C" {
* * `GLFW_EXPOSE_NATIVE_COCOA`
* * `GLFW_EXPOSE_NATIVE_X11`
* * `GLFW_EXPOSE_NATIVE_WAYLAND`
- * * `GLFW_EXPOSE_NATIVE_MIR`
*
* The available context API macros are:
* * `GLFW_EXPOSE_NATIVE_WGL`
@@ -75,6 +74,16 @@ extern "C" {
* and which platform-specific headers to include. It is then up your (by
* definition platform-specific) code to handle which of these should be
* defined.
+ *
+ * If you do not want the platform-specific headers to be included, define
+ * `GLFW_NATIVE_INCLUDE_NONE` before including the @ref glfw3native.h header.
+ *
+ * @code
+ * #define GLFW_EXPOSE_NATIVE_WIN32
+ * #define GLFW_EXPOSE_NATIVE_WGL
+ * #define GLFW_NATIVE_INCLUDE_NONE
+ * #include
+ * @endcode
*/
@@ -82,46 +91,71 @@ extern "C" {
* System headers and types
*************************************************************************/
-#if defined(GLFW_EXPOSE_NATIVE_WIN32)
- // This is a workaround for the fact that glfw3.h needs to export APIENTRY (for
- // example to allow applications to correctly declare a GL_ARB_debug_output
- // callback) but windows.h assumes no one will define APIENTRY before it does
- #if defined(GLFW_APIENTRY_DEFINED)
- #undef APIENTRY
- #undef GLFW_APIENTRY_DEFINED
+#if !defined(GLFW_NATIVE_INCLUDE_NONE)
+
+ #if defined(GLFW_EXPOSE_NATIVE_WIN32) || defined(GLFW_EXPOSE_NATIVE_WGL)
+ /* This is a workaround for the fact that glfw3.h needs to export APIENTRY (for
+ * example to allow applications to correctly declare a GL_KHR_debug callback)
+ * but windows.h assumes no one will define APIENTRY before it does
+ */
+ #if defined(GLFW_APIENTRY_DEFINED)
+ #undef APIENTRY
+ #undef GLFW_APIENTRY_DEFINED
+ #endif
+ #include
#endif
- #include
-#elif defined(GLFW_EXPOSE_NATIVE_COCOA)
- #include
- #if defined(__OBJC__)
- #import
- #else
- typedef void* id;
+
+ #if defined(GLFW_EXPOSE_NATIVE_COCOA) || defined(GLFW_EXPOSE_NATIVE_NSGL)
+ #if defined(__OBJC__)
+ #import
+ #else
+ #include
+ #include
+ #endif
#endif
-#elif defined(GLFW_EXPOSE_NATIVE_X11)
- #include
- #include
-#elif defined(GLFW_EXPOSE_NATIVE_WAYLAND)
- #include
-#elif defined(GLFW_EXPOSE_NATIVE_MIR)
- #include
-#endif
-#if defined(GLFW_EXPOSE_NATIVE_WGL)
- /* WGL is declared by windows.h */
-#endif
-#if defined(GLFW_EXPOSE_NATIVE_NSGL)
- /* NSGL is declared by Cocoa.h */
-#endif
-#if defined(GLFW_EXPOSE_NATIVE_GLX)
- #include
-#endif
-#if defined(GLFW_EXPOSE_NATIVE_EGL)
- #include
-#endif
-#if defined(GLFW_EXPOSE_NATIVE_OSMESA)
- #include
-#endif
+ #if defined(GLFW_EXPOSE_NATIVE_X11) || defined(GLFW_EXPOSE_NATIVE_GLX)
+ #include
+ #include
+ #endif
+
+ #if defined(GLFW_EXPOSE_NATIVE_WAYLAND)
+ #include
+ #endif
+
+ #if defined(GLFW_EXPOSE_NATIVE_WGL)
+ /* WGL is declared by windows.h */
+ #endif
+ #if defined(GLFW_EXPOSE_NATIVE_NSGL)
+ /* NSGL is declared by Cocoa.h */
+ #endif
+ #if defined(GLFW_EXPOSE_NATIVE_GLX)
+ /* This is a workaround for the fact that glfw3.h defines GLAPIENTRY because by
+ * default it also acts as an OpenGL header
+ * However, glx.h will include gl.h, which will define it unconditionally
+ */
+ #if defined(GLFW_GLAPIENTRY_DEFINED)
+ #undef GLAPIENTRY
+ #undef GLFW_GLAPIENTRY_DEFINED
+ #endif
+ #include
+ #endif
+ #if defined(GLFW_EXPOSE_NATIVE_EGL)
+ #include
+ #endif
+ #if defined(GLFW_EXPOSE_NATIVE_OSMESA)
+ /* This is a workaround for the fact that glfw3.h defines GLAPIENTRY because by
+ * default it also acts as an OpenGL header
+ * However, osmesa.h will include gl.h, which will define it unconditionally
+ */
+ #if defined(GLFW_GLAPIENTRY_DEFINED)
+ #undef GLAPIENTRY
+ #undef GLFW_GLAPIENTRY_DEFINED
+ #endif
+ #include
+ #endif
+
+#endif /*GLFW_NATIVE_INCLUDE_NONE*/
/*************************************************************************
@@ -135,6 +169,9 @@ extern "C" {
* of the specified monitor, or `NULL` if an [error](@ref error_handling)
* occurred.
*
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
+ * GLFW_PLATFORM_UNAVAILABLE.
+ *
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
@@ -150,6 +187,9 @@ GLFWAPI const char* glfwGetWin32Adapter(GLFWmonitor* monitor);
* `\\.\DISPLAY1\Monitor0`) of the specified monitor, or `NULL` if an
* [error](@ref error_handling) occurred.
*
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
+ * GLFW_PLATFORM_UNAVAILABLE.
+ *
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
@@ -164,6 +204,17 @@ GLFWAPI const char* glfwGetWin32Monitor(GLFWmonitor* monitor);
* @return The `HWND` of the specified window, or `NULL` if an
* [error](@ref error_handling) occurred.
*
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
+ * GLFW_PLATFORM_UNAVAILABLE.
+ *
+ * @remark The `HDC` associated with the window can be queried with the
+ * [GetDC](https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getdc)
+ * function.
+ * @code
+ * HDC dc = GetDC(glfwGetWin32Window(window));
+ * @endcode
+ * This DC is private and does not need to be released.
+ *
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
@@ -180,6 +231,17 @@ GLFWAPI HWND glfwGetWin32Window(GLFWwindow* window);
* @return The `HGLRC` of the specified window, or `NULL` if an
* [error](@ref error_handling) occurred.
*
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
+ * GLFW_PLATFORM_UNAVAILABLE and @ref GLFW_NO_WINDOW_CONTEXT.
+ *
+ * @remark The `HDC` associated with the window can be queried with the
+ * [GetDC](https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getdc)
+ * function.
+ * @code
+ * HDC dc = GetDC(glfwGetWin32Window(window));
+ * @endcode
+ * This DC is private and does not need to be released.
+ *
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
@@ -196,6 +258,9 @@ GLFWAPI HGLRC glfwGetWGLContext(GLFWwindow* window);
* @return The `CGDirectDisplayID` of the specified monitor, or
* `kCGNullDirectDisplay` if an [error](@ref error_handling) occurred.
*
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
+ * GLFW_PLATFORM_UNAVAILABLE.
+ *
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
@@ -210,6 +275,9 @@ GLFWAPI CGDirectDisplayID glfwGetCocoaMonitor(GLFWmonitor* monitor);
* @return The `NSWindow` of the specified window, or `nil` if an
* [error](@ref error_handling) occurred.
*
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
+ * GLFW_PLATFORM_UNAVAILABLE.
+ *
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
@@ -218,6 +286,23 @@ GLFWAPI CGDirectDisplayID glfwGetCocoaMonitor(GLFWmonitor* monitor);
* @ingroup native
*/
GLFWAPI id glfwGetCocoaWindow(GLFWwindow* window);
+
+/*! @brief Returns the `NSView` of the specified window.
+ *
+ * @return The `NSView` of the specified window, or `nil` if an
+ * [error](@ref error_handling) occurred.
+ *
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
+ * GLFW_PLATFORM_UNAVAILABLE.
+ *
+ * @thread_safety This function may be called from any thread. Access is not
+ * synchronized.
+ *
+ * @since Added in version 3.4.
+ *
+ * @ingroup native
+ */
+GLFWAPI id glfwGetCocoaView(GLFWwindow* window);
#endif
#if defined(GLFW_EXPOSE_NATIVE_NSGL)
@@ -226,6 +311,9 @@ GLFWAPI id glfwGetCocoaWindow(GLFWwindow* window);
* @return The `NSOpenGLContext` of the specified window, or `nil` if an
* [error](@ref error_handling) occurred.
*
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
+ * GLFW_PLATFORM_UNAVAILABLE and @ref GLFW_NO_WINDOW_CONTEXT.
+ *
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
@@ -242,6 +330,9 @@ GLFWAPI id glfwGetNSGLContext(GLFWwindow* window);
* @return The `Display` used by GLFW, or `NULL` if an
* [error](@ref error_handling) occurred.
*
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
+ * GLFW_PLATFORM_UNAVAILABLE.
+ *
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
@@ -256,6 +347,9 @@ GLFWAPI Display* glfwGetX11Display(void);
* @return The `RRCrtc` of the specified monitor, or `None` if an
* [error](@ref error_handling) occurred.
*
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
+ * GLFW_PLATFORM_UNAVAILABLE.
+ *
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
@@ -270,6 +364,9 @@ GLFWAPI RRCrtc glfwGetX11Adapter(GLFWmonitor* monitor);
* @return The `RROutput` of the specified monitor, or `None` if an
* [error](@ref error_handling) occurred.
*
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
+ * GLFW_PLATFORM_UNAVAILABLE.
+ *
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
@@ -284,6 +381,9 @@ GLFWAPI RROutput glfwGetX11Monitor(GLFWmonitor* monitor);
* @return The `Window` of the specified window, or `None` if an
* [error](@ref error_handling) occurred.
*
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
+ * GLFW_PLATFORM_UNAVAILABLE.
+ *
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
@@ -297,8 +397,8 @@ GLFWAPI Window glfwGetX11Window(GLFWwindow* window);
*
* @param[in] string A UTF-8 encoded string.
*
- * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
- * GLFW_PLATFORM_ERROR.
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
+ * GLFW_PLATFORM_UNAVAILABLE and @ref GLFW_PLATFORM_ERROR.
*
* @pointer_lifetime The specified string is copied before this function
* returns.
@@ -323,8 +423,8 @@ GLFWAPI void glfwSetX11SelectionString(const char* string);
* @return The contents of the selection as a UTF-8 encoded string, or `NULL`
* if an [error](@ref error_handling) occurred.
*
- * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
- * GLFW_PLATFORM_ERROR.
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
+ * GLFW_PLATFORM_UNAVAILABLE and @ref GLFW_PLATFORM_ERROR.
*
* @pointer_lifetime The returned string is allocated and freed by GLFW. You
* should not free it yourself. It is valid until the next call to @ref
@@ -350,6 +450,9 @@ GLFWAPI const char* glfwGetX11SelectionString(void);
* @return The `GLXContext` of the specified window, or `NULL` if an
* [error](@ref error_handling) occurred.
*
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
+ * GLFW_NO_WINDOW_CONTEXT and @ref GLFW_PLATFORM_UNAVAILABLE.
+ *
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
@@ -364,6 +467,9 @@ GLFWAPI GLXContext glfwGetGLXContext(GLFWwindow* window);
* @return The `GLXWindow` of the specified window, or `None` if an
* [error](@ref error_handling) occurred.
*
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
+ * GLFW_NO_WINDOW_CONTEXT and @ref GLFW_PLATFORM_UNAVAILABLE.
+ *
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
@@ -372,6 +478,29 @@ GLFWAPI GLXContext glfwGetGLXContext(GLFWwindow* window);
* @ingroup native
*/
GLFWAPI GLXWindow glfwGetGLXWindow(GLFWwindow* window);
+
+/*! @brief Retrieves the `GLXFBConfig` of the specified window's `GLXWindow`.
+ *
+ * @param[in] window The window whose `GLXWindow` to query.
+ * @param[out] config The `GLXFBConfig` of the window `GLXWindow`, if available.
+ * @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if an
+ * [error](@ref error_handling) occurred.
+ *
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref
+ * GLFW_NO_WINDOW_CONTEXT and @ref GLFW_PLATFORM_UNAVAILABLE.
+ *
+ * @remark `GLXFBConfig` is an opaque type. Unlike other GLFW functions, the
+ * @p config out parameter is not cleared on error, as core GLX does not define
+ * any invalid value.
+ *
+ * @thread_safety This function may be called from any thread. Access is not
+ * synchronized.
+ *
+ * @since Added in version 3.5
+ *
+ * @ingroup native
+ */
+GLFWAPI int glfwGetGLXFBConfig(GLFWwindow* window, GLXFBConfig* config);
#endif
#if defined(GLFW_EXPOSE_NATIVE_WAYLAND)
@@ -380,6 +509,9 @@ GLFWAPI GLXWindow glfwGetGLXWindow(GLFWwindow* window);
* @return The `struct wl_display*` used by GLFW, or `NULL` if an
* [error](@ref error_handling) occurred.
*
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
+ * GLFW_PLATFORM_UNAVAILABLE.
+ *
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
@@ -394,6 +526,9 @@ GLFWAPI struct wl_display* glfwGetWaylandDisplay(void);
* @return The `struct wl_output*` of the specified monitor, or `NULL` if an
* [error](@ref error_handling) occurred.
*
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
+ * GLFW_PLATFORM_UNAVAILABLE.
+ *
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
@@ -408,6 +543,9 @@ GLFWAPI struct wl_output* glfwGetWaylandMonitor(GLFWmonitor* monitor);
* @return The main `struct wl_surface*` of the specified window, or `NULL` if
* an [error](@ref error_handling) occurred.
*
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
+ * GLFW_PLATFORM_UNAVAILABLE.
+ *
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
@@ -418,55 +556,33 @@ GLFWAPI struct wl_output* glfwGetWaylandMonitor(GLFWmonitor* monitor);
GLFWAPI struct wl_surface* glfwGetWaylandWindow(GLFWwindow* window);
#endif
-#if defined(GLFW_EXPOSE_NATIVE_MIR)
-/*! @brief Returns the `MirConnection*` used by GLFW.
+#if defined(GLFW_EXPOSE_NATIVE_EGL)
+/*! @brief Returns the `EGLDisplay` used by GLFW.
*
- * @return The `MirConnection*` used by GLFW, or `NULL` if an
+ * @return The `EGLDisplay` used by GLFW, or `EGL_NO_DISPLAY` if an
* [error](@ref error_handling) occurred.
*
- * @thread_safety This function may be called from any thread. Access is not
- * synchronized.
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED.
*
- * @since Added in version 3.2.
- *
- * @ingroup native
- */
-GLFWAPI MirConnection* glfwGetMirDisplay(void);
-
-/*! @brief Returns the Mir output ID of the specified monitor.
- *
- * @return The Mir output ID of the specified monitor, or zero if an
- * [error](@ref error_handling) occurred.
+ * @remark Because EGL is initialized on demand, this function will return
+ * `EGL_NO_DISPLAY` until the first context has been created via EGL.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
- * @since Added in version 3.2.
+ * @since Added in version 3.0.
*
* @ingroup native
*/
-GLFWAPI int glfwGetMirMonitor(GLFWmonitor* monitor);
+GLFWAPI EGLDisplay glfwGetEGLDisplay(void);
-/*! @brief Returns the `MirWindow*` of the specified window.
+/*! @brief Returns the `EGLContext` of the specified window.
*
- * @return The `MirWindow*` of the specified window, or `NULL` if an
+ * @return The `EGLContext` of the specified window, or `EGL_NO_CONTEXT` if an
* [error](@ref error_handling) occurred.
*
- * @thread_safety This function may be called from any thread. Access is not
- * synchronized.
- *
- * @since Added in version 3.2.
- *
- * @ingroup native
- */
-GLFWAPI MirWindow* glfwGetMirWindow(GLFWwindow* window);
-#endif
-
-#if defined(GLFW_EXPOSE_NATIVE_EGL)
-/*! @brief Returns the `EGLDisplay` used by GLFW.
- *
- * @return The `EGLDisplay` used by GLFW, or `EGL_NO_DISPLAY` if an
- * [error](@ref error_handling) occurred.
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
+ * GLFW_NO_WINDOW_CONTEXT.
*
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
@@ -475,13 +591,16 @@ GLFWAPI MirWindow* glfwGetMirWindow(GLFWwindow* window);
*
* @ingroup native
*/
-GLFWAPI EGLDisplay glfwGetEGLDisplay(void);
+GLFWAPI EGLContext glfwGetEGLContext(GLFWwindow* window);
-/*! @brief Returns the `EGLContext` of the specified window.
+/*! @brief Returns the `EGLSurface` of the specified window.
*
- * @return The `EGLContext` of the specified window, or `EGL_NO_CONTEXT` if an
+ * @return The `EGLSurface` of the specified window, or `EGL_NO_SURFACE` if an
* [error](@ref error_handling) occurred.
*
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
+ * GLFW_NO_WINDOW_CONTEXT.
+ *
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
@@ -489,21 +608,30 @@ GLFWAPI EGLDisplay glfwGetEGLDisplay(void);
*
* @ingroup native
*/
-GLFWAPI EGLContext glfwGetEGLContext(GLFWwindow* window);
+GLFWAPI EGLSurface glfwGetEGLSurface(GLFWwindow* window);
-/*! @brief Returns the `EGLSurface` of the specified window.
+/*! @brief Retrieves the `EGLConfig` of the specified window's `EGLSurface`.
*
- * @return The `EGLSurface` of the specified window, or `EGL_NO_SURFACE` if an
+ * @param[in] window The window whose `EGLSurface` to query.
+ * @param[out] config The `EGLConfig` of the window `EGLSurface`, if available.
+ * @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if an
* [error](@ref error_handling) occurred.
*
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
+ * GLFW_NO_WINDOW_CONTEXT.
+ *
+ * @remark `EGLConfig` is an opaque type. Unlike other GLFW functions, the @p
+ * config out parameter is not cleared on error, as core EGL does not define
+ * any invalid value.
+ *
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
- * @since Added in version 3.0.
+ * @since Added in version 3.5.
*
* @ingroup native
*/
-GLFWAPI EGLSurface glfwGetEGLSurface(GLFWwindow* window);
+GLFWAPI int glfwGetEGLConfig(GLFWwindow* window, EGLConfig* config);
#endif
#if defined(GLFW_EXPOSE_NATIVE_OSMESA)
@@ -519,6 +647,9 @@ GLFWAPI EGLSurface glfwGetEGLSurface(GLFWwindow* window);
* @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if an
* [error](@ref error_handling) occurred.
*
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
+ * GLFW_NO_WINDOW_CONTEXT.
+ *
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
@@ -540,6 +671,9 @@ GLFWAPI int glfwGetOSMesaColorBuffer(GLFWwindow* window, int* width, int* height
* @return `GLFW_TRUE` if successful, or `GLFW_FALSE` if an
* [error](@ref error_handling) occurred.
*
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
+ * GLFW_NO_WINDOW_CONTEXT.
+ *
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
@@ -554,6 +688,9 @@ GLFWAPI int glfwGetOSMesaDepthBuffer(GLFWwindow* window, int* width, int* height
* @return The `OSMesaContext` of the specified window, or `NULL` if an
* [error](@ref error_handling) occurred.
*
+ * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
+ * GLFW_NO_WINDOW_CONTEXT.
+ *
* @thread_safety This function may be called from any thread. Access is not
* synchronized.
*
diff --git a/external/GLFW/src/CMakeLists.txt b/external/GLFW/src/CMakeLists.txt
index b14512c..2cbe8a7 100644
--- a/external/GLFW/src/CMakeLists.txt
+++ b/external/GLFW/src/CMakeLists.txt
@@ -1,118 +1,274 @@
-set(common_HEADERS internal.h mappings.h
- "${GLFW_BINARY_DIR}/src/glfw_config.h"
- "${GLFW_SOURCE_DIR}/include/GLFW/glfw3.h"
- "${GLFW_SOURCE_DIR}/include/GLFW/glfw3native.h")
-set(common_SOURCES context.c init.c input.c monitor.c vulkan.c window.c)
-
-if (_GLFW_COCOA)
- set(glfw_HEADERS ${common_HEADERS} cocoa_platform.h cocoa_joystick.h
- posix_thread.h nsgl_context.h egl_context.h osmesa_context.h)
- set(glfw_SOURCES ${common_SOURCES} cocoa_init.m cocoa_joystick.m
- cocoa_monitor.m cocoa_window.m cocoa_time.c posix_thread.c
- nsgl_context.m egl_context.c osmesa_context.c)
-elseif (_GLFW_WIN32)
- set(glfw_HEADERS ${common_HEADERS} win32_platform.h win32_joystick.h
- wgl_context.h egl_context.h osmesa_context.h)
- set(glfw_SOURCES ${common_SOURCES} win32_init.c win32_joystick.c
- win32_monitor.c win32_time.c win32_thread.c win32_window.c
- wgl_context.c egl_context.c osmesa_context.c)
-elseif (_GLFW_X11)
- set(glfw_HEADERS ${common_HEADERS} x11_platform.h xkb_unicode.h posix_time.h
- posix_thread.h glx_context.h egl_context.h osmesa_context.h)
- set(glfw_SOURCES ${common_SOURCES} x11_init.c x11_monitor.c x11_window.c
- xkb_unicode.c posix_time.c posix_thread.c glx_context.c
- egl_context.c osmesa_context.c)
-
- if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
- set(glfw_HEADERS ${glfw_HEADERS} linux_joystick.h)
- set(glfw_SOURCES ${glfw_SOURCES} linux_joystick.c)
- else()
- set(glfw_HEADERS ${glfw_HEADERS} null_joystick.h)
- set(glfw_SOURCES ${glfw_SOURCES} null_joystick.c)
- endif()
-elseif (_GLFW_WAYLAND)
- set(glfw_HEADERS ${common_HEADERS} wl_platform.h linux_joystick.h
- posix_time.h posix_thread.h xkb_unicode.h egl_context.h
- osmesa_context.h)
- set(glfw_SOURCES ${common_SOURCES} wl_init.c wl_monitor.c wl_window.c
- linux_joystick.c posix_time.c posix_thread.c xkb_unicode.c
- egl_context.c osmesa_context.c)
-
- ecm_add_wayland_client_protocol(glfw_SOURCES
- PROTOCOL
- "${WAYLAND_PROTOCOLS_PKGDATADIR}/unstable/relative-pointer/relative-pointer-unstable-v1.xml"
- BASENAME relative-pointer-unstable-v1)
- ecm_add_wayland_client_protocol(glfw_SOURCES
- PROTOCOL
- "${WAYLAND_PROTOCOLS_PKGDATADIR}/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml"
- BASENAME pointer-constraints-unstable-v1)
-elseif (_GLFW_MIR)
- set(glfw_HEADERS ${common_HEADERS} mir_platform.h linux_joystick.h
- posix_time.h posix_thread.h xkb_unicode.h egl_context.h
- osmesa_context.h)
- set(glfw_SOURCES ${common_SOURCES} mir_init.c mir_monitor.c mir_window.c
- linux_joystick.c posix_time.c posix_thread.c xkb_unicode.c
- egl_context.c osmesa_context.c)
-elseif (_GLFW_OSMESA)
- set(glfw_HEADERS ${common_HEADERS} null_platform.h null_joystick.h
- posix_time.h posix_thread.h osmesa_context.h)
- set(glfw_SOURCES ${common_SOURCES} null_init.c null_monitor.c null_window.c
- null_joystick.c posix_time.c posix_thread.c osmesa_context.c)
-endif()
+add_library(glfw ${GLFW_LIBRARY_TYPE}
+ "${GLFW_SOURCE_DIR}/include/GLFW/glfw3.h"
+ "${GLFW_SOURCE_DIR}/include/GLFW/glfw3native.h"
+ internal.h platform.h mappings.h
+ context.c init.c input.c monitor.c platform.c vulkan.c window.c
+ egl_context.c osmesa_context.c null_platform.h null_joystick.h
+ null_init.c null_monitor.c null_window.c null_joystick.c)
+# The time, thread and module code is shared between all backends on a given OS,
+# including the null backend, which still needs those bits to be functional
if (APPLE)
- # For some reason, CMake doesn't know about .m
- set_source_files_properties(${glfw_SOURCES} PROPERTIES LANGUAGE C)
+ target_sources(glfw PRIVATE cocoa_time.h cocoa_time.c posix_thread.h
+ posix_module.c posix_thread.c)
+elseif (WIN32)
+ target_sources(glfw PRIVATE win32_time.h win32_thread.h win32_module.c
+ win32_time.c win32_thread.c)
+else()
+ target_sources(glfw PRIVATE posix_time.h posix_thread.h posix_module.c
+ posix_time.c posix_thread.c)
endif()
-# Make GCC and Clang warn about declarations that VS 2010 and 2012 won't accept
-# for all source files that VS will build
-if (${CMAKE_C_COMPILER_ID} STREQUAL GNU OR ${CMAKE_C_COMPILER_ID} STREQUAL Clang)
- if (WIN32)
- set(windows_SOURCES ${glfw_SOURCES})
- else()
- set(windows_SOURCES ${common_SOURCES})
+add_custom_target(update_mappings
+ COMMAND "${CMAKE_COMMAND}" -P "${GLFW_SOURCE_DIR}/CMake/GenerateMappings.cmake" mappings.h.in mappings.h
+ WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
+ COMMENT "Updating gamepad mappings from upstream repository"
+ SOURCES mappings.h.in "${GLFW_SOURCE_DIR}/CMake/GenerateMappings.cmake"
+ VERBATIM)
+
+set_target_properties(update_mappings PROPERTIES FOLDER "GLFW3")
+
+if (GLFW_BUILD_COCOA)
+ enable_language(OBJC)
+ target_compile_definitions(glfw PRIVATE _GLFW_COCOA)
+ target_sources(glfw PRIVATE cocoa_platform.h cocoa_joystick.h cocoa_init.m
+ cocoa_joystick.m cocoa_monitor.m cocoa_window.m
+ nsgl_context.m)
+endif()
+
+if (GLFW_BUILD_WIN32)
+ target_compile_definitions(glfw PRIVATE _GLFW_WIN32)
+ target_sources(glfw PRIVATE win32_platform.h win32_joystick.h win32_init.c
+ win32_joystick.c win32_monitor.c win32_window.c
+ wgl_context.c)
+endif()
+
+if (GLFW_BUILD_X11)
+ target_compile_definitions(glfw PRIVATE _GLFW_X11)
+ target_sources(glfw PRIVATE x11_platform.h xkb_unicode.h x11_init.c
+ x11_monitor.c x11_window.c xkb_unicode.c
+ glx_context.c)
+endif()
+
+if (GLFW_BUILD_WAYLAND)
+ target_compile_definitions(glfw PRIVATE _GLFW_WAYLAND)
+ target_sources(glfw PRIVATE wl_platform.h wl_init.c
+ wl_monitor.c wl_window.c)
+endif()
+
+if (GLFW_BUILD_X11 OR GLFW_BUILD_WAYLAND)
+ if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ target_sources(glfw PRIVATE linux_joystick.h linux_joystick.c)
+ endif()
+ target_sources(glfw PRIVATE posix_poll.h posix_poll.c)
+endif()
+
+if (GLFW_BUILD_WAYLAND)
+ include(CheckIncludeFiles)
+ include(CheckFunctionExists)
+ check_function_exists(memfd_create HAVE_MEMFD_CREATE)
+ if (HAVE_MEMFD_CREATE)
+ target_compile_definitions(glfw PRIVATE HAVE_MEMFD_CREATE)
+ endif()
+
+ find_program(WAYLAND_SCANNER_EXECUTABLE NAMES wayland-scanner)
+ if (NOT WAYLAND_SCANNER_EXECUTABLE)
+ message(FATAL_ERROR "Failed to find wayland-scanner")
endif()
- set_source_files_properties(${windows_SOURCES} PROPERTIES
- COMPILE_FLAGS -Wdeclaration-after-statement)
+
+ macro(generate_wayland_protocol protocol_file)
+ set(protocol_path "${GLFW_SOURCE_DIR}/deps/wayland/${protocol_file}")
+
+ string(REGEX REPLACE "\\.xml$" "-client-protocol.h" header_file ${protocol_file})
+ string(REGEX REPLACE "\\.xml$" "-client-protocol-code.h" code_file ${protocol_file})
+
+ add_custom_command(OUTPUT ${header_file}
+ COMMAND "${WAYLAND_SCANNER_EXECUTABLE}" client-header "${protocol_path}" ${header_file}
+ DEPENDS "${protocol_path}"
+ VERBATIM)
+
+ add_custom_command(OUTPUT ${code_file}
+ COMMAND "${WAYLAND_SCANNER_EXECUTABLE}" private-code "${protocol_path}" ${code_file}
+ DEPENDS "${protocol_path}"
+ VERBATIM)
+
+ target_sources(glfw PRIVATE ${header_file} ${code_file})
+ endmacro()
+
+ generate_wayland_protocol("wayland.xml")
+ generate_wayland_protocol("viewporter.xml")
+ generate_wayland_protocol("xdg-shell.xml")
+ generate_wayland_protocol("idle-inhibit-unstable-v1.xml")
+ generate_wayland_protocol("pointer-constraints-unstable-v1.xml")
+ generate_wayland_protocol("relative-pointer-unstable-v1.xml")
+ generate_wayland_protocol("fractional-scale-v1.xml")
+ generate_wayland_protocol("xdg-activation-v1.xml")
+ generate_wayland_protocol("xdg-decoration-unstable-v1.xml")
endif()
-add_library(glfw ${glfw_SOURCES} ${glfw_HEADERS})
+if (WIN32 AND GLFW_BUILD_SHARED_LIBRARY)
+ configure_file(glfw.rc.in glfw.rc @ONLY)
+ target_sources(glfw PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/glfw.rc")
+endif()
+
+if (UNIX AND GLFW_BUILD_SHARED_LIBRARY)
+ # On Unix-like systems, shared libraries can use the soname system.
+ set(GLFW_LIB_NAME glfw)
+else()
+ set(GLFW_LIB_NAME glfw3)
+endif()
+set(GLFW_LIB_NAME_SUFFIX "")
+
set_target_properties(glfw PROPERTIES
OUTPUT_NAME ${GLFW_LIB_NAME}
- VERSION ${GLFW_VERSION}
+ VERSION ${GLFW_VERSION_MAJOR}.${GLFW_VERSION_MINOR}
SOVERSION ${GLFW_VERSION_MAJOR}
POSITION_INDEPENDENT_CODE ON
+ C_STANDARD 99
+ C_EXTENSIONS OFF
+ DEFINE_SYMBOL _GLFW_BUILD_DLL
FOLDER "GLFW3")
-target_compile_definitions(glfw PRIVATE
- _GLFW_USE_CONFIG_H
- $<$:_XOPEN_SOURCE=600>)
target_include_directories(glfw PUBLIC
"$"
- "$/include>")
+ "$")
target_include_directories(glfw PRIVATE
"${GLFW_SOURCE_DIR}/src"
- "${GLFW_BINARY_DIR}/src"
- ${glfw_INCLUDE_DIRS})
-
-# HACK: When building on MinGW, WINVER and UNICODE need to be defined before
-# the inclusion of stddef.h (by glfw3.h), which is itself included before
-# win32_platform.h. We define them here until a saner solution can be found
-# NOTE: MinGW-w64 and Visual C++ do /not/ need this hack.
-target_compile_definitions(glfw PRIVATE
- "$<$:UNICODE;WINVER=0x0501>")
-
-# Enable a reasonable set of warnings (no, -Wextra is not reasonable)
-target_compile_options(glfw PRIVATE
- "$<$:-Wall>"
- "$<$:-Wall>")
-
-if (BUILD_SHARED_LIBS)
+ "${GLFW_BINARY_DIR}/src")
+target_link_libraries(glfw PRIVATE Threads::Threads)
+
+if (GLFW_BUILD_WIN32)
+ list(APPEND glfw_PKG_LIBS "-lgdi32")
+endif()
+
+if (GLFW_BUILD_COCOA)
+ target_link_libraries(glfw PRIVATE "-framework Cocoa"
+ "-framework IOKit"
+ "-framework CoreFoundation"
+ "-framework QuartzCore")
+
+ set(glfw_PKG_DEPS "")
+ set(glfw_PKG_LIBS "-framework Cocoa -framework IOKit -framework CoreFoundation -framework QuartzCore")
+endif()
+
+if (GLFW_BUILD_WAYLAND)
+ include(FindPkgConfig)
+
+ pkg_check_modules(Wayland REQUIRED
+ wayland-client>=0.2.7
+ wayland-cursor>=0.2.7
+ wayland-egl>=0.2.7
+ xkbcommon>=0.5.0)
+
+ target_include_directories(glfw PRIVATE ${Wayland_INCLUDE_DIRS})
+
+ if (NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ find_package(EpollShim)
+ if (EPOLLSHIM_FOUND)
+ target_include_directories(glfw PRIVATE ${EPOLLSHIM_INCLUDE_DIRS})
+ target_link_libraries(glfw PRIVATE ${EPOLLSHIM_LIBRARIES})
+ endif()
+ endif()
+endif()
+
+if (GLFW_BUILD_X11)
+ find_package(X11 REQUIRED)
+ target_include_directories(glfw PRIVATE "${X11_X11_INCLUDE_PATH}")
+
+ # Check for XRandR (modern resolution switching and gamma control)
+ if (NOT X11_Xrandr_INCLUDE_PATH)
+ message(FATAL_ERROR "RandR headers not found; install libxrandr development package")
+ endif()
+ target_include_directories(glfw PRIVATE "${X11_Xrandr_INCLUDE_PATH}")
+
+ # Check for Xinerama (legacy multi-monitor support)
+ if (NOT X11_Xinerama_INCLUDE_PATH)
+ message(FATAL_ERROR "Xinerama headers not found; install libxinerama development package")
+ endif()
+ target_include_directories(glfw PRIVATE "${X11_Xinerama_INCLUDE_PATH}")
+
+ # Check for Xkb (X keyboard extension)
+ if (NOT X11_Xkb_INCLUDE_PATH)
+ message(FATAL_ERROR "XKB headers not found; install X11 development package")
+ endif()
+ target_include_directories(glfw PRIVATE "${X11_Xkb_INCLUDE_PATH}")
+
+ # Check for Xcursor (cursor creation from RGBA images)
+ if (NOT X11_Xcursor_INCLUDE_PATH)
+ message(FATAL_ERROR "Xcursor headers not found; install libxcursor development package")
+ endif()
+ target_include_directories(glfw PRIVATE "${X11_Xcursor_INCLUDE_PATH}")
+
+ # Check for XInput (modern HID input)
+ if (NOT X11_Xi_INCLUDE_PATH)
+ message(FATAL_ERROR "XInput headers not found; install libxi development package")
+ endif()
+ target_include_directories(glfw PRIVATE "${X11_Xi_INCLUDE_PATH}")
+
+ # Check for X Shape (custom window input shape)
+ if (NOT X11_Xshape_INCLUDE_PATH)
+ message(FATAL_ERROR "X Shape headers not found; install libxext development package")
+ endif()
+ target_include_directories(glfw PRIVATE "${X11_Xshape_INCLUDE_PATH}")
+endif()
+
+if (UNIX AND NOT APPLE)
+ find_library(RT_LIBRARY rt)
+ mark_as_advanced(RT_LIBRARY)
+ if (RT_LIBRARY)
+ target_link_libraries(glfw PRIVATE "${RT_LIBRARY}")
+ list(APPEND glfw_PKG_LIBS "-lrt")
+ endif()
+
+ find_library(MATH_LIBRARY m)
+ mark_as_advanced(MATH_LIBRARY)
+ if (MATH_LIBRARY)
+ target_link_libraries(glfw PRIVATE "${MATH_LIBRARY}")
+ list(APPEND glfw_PKG_LIBS "-lm")
+ endif()
+
+ if (CMAKE_DL_LIBS)
+ target_link_libraries(glfw PRIVATE "${CMAKE_DL_LIBS}")
+ list(APPEND glfw_PKG_LIBS "-l${CMAKE_DL_LIBS}")
+ endif()
+endif()
+
+if (WIN32)
+ if (GLFW_USE_HYBRID_HPG)
+ target_compile_definitions(glfw PRIVATE _GLFW_USE_HYBRID_HPG)
+ endif()
+endif()
+
+# Enable a reasonable set of warnings
+# NOTE: The order matters here, Clang-CL matches both MSVC and Clang
+if (MSVC)
+ target_compile_options(glfw PRIVATE "/W3")
+elseif (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR
+ CMAKE_C_COMPILER_ID STREQUAL "Clang" OR
+ CMAKE_C_COMPILER_ID STREQUAL "AppleClang")
+
+ target_compile_options(glfw PRIVATE "-Wall")
+endif()
+
+if (GLFW_BUILD_WIN32)
+ target_compile_definitions(glfw PRIVATE UNICODE _UNICODE)
+endif()
+
+# Workaround for the MS CRT deprecating parts of the standard library
+if (MSVC OR CMAKE_C_SIMULATE_ID STREQUAL "MSVC")
+ target_compile_definitions(glfw PRIVATE _CRT_SECURE_NO_WARNINGS)
+endif()
+
+# Workaround for -std=c99 on Linux disabling _DEFAULT_SOURCE (POSIX 2008 and more)
+if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ target_compile_definitions(glfw PRIVATE _DEFAULT_SOURCE)
+endif()
+
+if (GLFW_BUILD_SHARED_LIBRARY)
if (WIN32)
if (MINGW)
- # Remove the lib prefix on the DLL (but not the import library
+ # Remove the lib prefix on the DLL (but not the import library)
set_target_properties(glfw PROPERTIES PREFIX "")
# Add a suffix to the import library to avoid naming conflicts
@@ -121,32 +277,65 @@ if (BUILD_SHARED_LIBS)
# Add a suffix to the import library to avoid naming conflicts
set_target_properties(glfw PROPERTIES IMPORT_SUFFIX "dll.lib")
endif()
- elseif (APPLE)
- # Add -fno-common to work around a bug in Apple's GCC
- target_compile_options(glfw PRIVATE "-fno-common")
+ set (GLFW_LIB_NAME_SUFFIX "dll")
- set_target_properties(glfw PROPERTIES
- INSTALL_NAME_DIR "lib${LIB_SUFFIX}")
- elseif (UNIX)
+ target_compile_definitions(glfw INTERFACE GLFW_DLL)
+ endif()
+
+ if (MINGW)
+ # Enable link-time exploit mitigation features enabled by default on MSVC
+ include(CheckCCompilerFlag)
+ include(CMakePushCheckState)
+
+ # Compatibility with data execution prevention (DEP)
+ cmake_push_check_state()
+ set(CMAKE_REQUIRED_FLAGS "-Wl,--nxcompat")
+ check_c_compiler_flag("" _GLFW_HAS_DEP)
+ if (_GLFW_HAS_DEP)
+ target_link_libraries(glfw PRIVATE "-Wl,--nxcompat")
+ endif()
+ cmake_pop_check_state()
+
+ # Compatibility with address space layout randomization (ASLR)
+ cmake_push_check_state()
+ set(CMAKE_REQUIRED_FLAGS "-Wl,--dynamicbase")
+ check_c_compiler_flag("" _GLFW_HAS_ASLR)
+ if (_GLFW_HAS_ASLR)
+ target_link_libraries(glfw PRIVATE "-Wl,--dynamicbase")
+ endif()
+ cmake_pop_check_state()
+
+ # Compatibility with 64-bit address space layout randomization (ASLR)
+ cmake_push_check_state()
+ set(CMAKE_REQUIRED_FLAGS "-Wl,--high-entropy-va")
+ check_c_compiler_flag("" _GLFW_HAS_64ASLR)
+ if (_GLFW_HAS_64ASLR)
+ target_link_libraries(glfw PRIVATE "-Wl,--high-entropy-va")
+ endif()
+ cmake_pop_check_state()
+ endif()
+
+ if (UNIX)
# Hide symbols not explicitly tagged for export from the shared library
target_compile_options(glfw PRIVATE "-fvisibility=hidden")
endif()
-
- target_compile_definitions(glfw INTERFACE GLFW_DLL)
- target_link_libraries(glfw PRIVATE ${glfw_LIBRARIES})
-else()
- target_link_libraries(glfw INTERFACE ${glfw_LIBRARIES})
endif()
-if (MSVC)
- target_compile_definitions(glfw PRIVATE _CRT_SECURE_NO_WARNINGS)
-endif()
+list(JOIN glfw_PKG_DEPS " " deps)
+list(JOIN glfw_PKG_LIBS " " libs)
+
+set(GLFW_PKG_CONFIG_REQUIRES_PRIVATE "${deps}" CACHE INTERNAL
+ "GLFW pkg-config Requires.private")
+set(GLFW_PKG_CONFIG_LIBS_PRIVATE "${libs}" CACHE INTERNAL
+ "GLFW pkg-config Libs.private")
+
+configure_file("${GLFW_SOURCE_DIR}/CMake/glfw3.pc.in" glfw3.pc @ONLY)
if (GLFW_INSTALL)
install(TARGETS glfw
EXPORT glfwTargets
- RUNTIME DESTINATION "bin"
- ARCHIVE DESTINATION "lib${LIB_SUFFIX}"
- LIBRARY DESTINATION "lib${LIB_SUFFIX}")
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
endif()
diff --git a/external/GLFW/src/cocoa_init.m b/external/GLFW/src/cocoa_init.m
index 01a746b..15dc4ec 100644
--- a/external/GLFW/src/cocoa_init.m
+++ b/external/GLFW/src/cocoa_init.m
@@ -1,7 +1,7 @@
//========================================================================
-// GLFW 3.3 macOS - www.glfw.org
+// GLFW 3.5 macOS - www.glfw.org
//------------------------------------------------------------------------
-// Copyright (c) 2009-2016 Camilla Löwy
+// Copyright (c) 2009-2019 Camilla Löwy
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
@@ -25,8 +25,13 @@
//========================================================================
#include "internal.h"
+
+#if defined(_GLFW_COCOA)
+
#include // For MAXPATHLEN
+// Needed for _NSGetProgname
+#include
// Change to our application bundle's resources directory, if present
//
@@ -64,12 +69,114 @@ static void changeToResourcesDirectory(void)
chdir(resourcesPath);
}
+// Set up the menu bar (manually)
+// This is nasty, nasty stuff -- calls to undocumented semi-private APIs that
+// could go away at any moment, lots of stuff that really should be
+// localize(d|able), etc. Add a nib to save us this horror.
+//
+static void createMenuBar(void)
+{
+ NSString* appName = nil;
+ NSDictionary* bundleInfo = [[NSBundle mainBundle] infoDictionary];
+ NSString* nameKeys[] =
+ {
+ @"CFBundleDisplayName",
+ @"CFBundleName",
+ @"CFBundleExecutable",
+ };
+
+ // Try to figure out what the calling application is called
+
+ for (size_t i = 0; i < sizeof(nameKeys) / sizeof(nameKeys[0]); i++)
+ {
+ id name = bundleInfo[nameKeys[i]];
+ if (name &&
+ [name isKindOfClass:[NSString class]] &&
+ ![name isEqualToString:@""])
+ {
+ appName = name;
+ break;
+ }
+ }
+
+ if (!appName)
+ {
+ char** progname = _NSGetProgname();
+ if (progname && *progname)
+ appName = @(*progname);
+ else
+ appName = @"GLFW Application";
+ }
+
+ NSMenu* bar = [[NSMenu alloc] init];
+ [NSApp setMainMenu:bar];
+
+ NSMenuItem* appMenuItem =
+ [bar addItemWithTitle:@"" action:NULL keyEquivalent:@""];
+ NSMenu* appMenu = [[NSMenu alloc] init];
+ [appMenuItem setSubmenu:appMenu];
+
+ [appMenu addItemWithTitle:[NSString stringWithFormat:@"About %@", appName]
+ action:@selector(orderFrontStandardAboutPanel:)
+ keyEquivalent:@""];
+ [appMenu addItem:[NSMenuItem separatorItem]];
+ NSMenu* servicesMenu = [[NSMenu alloc] init];
+ [NSApp setServicesMenu:servicesMenu];
+ [[appMenu addItemWithTitle:@"Services"
+ action:NULL
+ keyEquivalent:@""] setSubmenu:servicesMenu];
+ [servicesMenu release];
+ [appMenu addItem:[NSMenuItem separatorItem]];
+ [appMenu addItemWithTitle:[NSString stringWithFormat:@"Hide %@", appName]
+ action:@selector(hide:)
+ keyEquivalent:@"h"];
+ [[appMenu addItemWithTitle:@"Hide Others"
+ action:@selector(hideOtherApplications:)
+ keyEquivalent:@"h"]
+ setKeyEquivalentModifierMask:NSEventModifierFlagOption | NSEventModifierFlagCommand];
+ [appMenu addItemWithTitle:@"Show All"
+ action:@selector(unhideAllApplications:)
+ keyEquivalent:@""];
+ [appMenu addItem:[NSMenuItem separatorItem]];
+ [appMenu addItemWithTitle:[NSString stringWithFormat:@"Quit %@", appName]
+ action:@selector(terminate:)
+ keyEquivalent:@"q"];
+
+ NSMenuItem* windowMenuItem =
+ [bar addItemWithTitle:@"" action:NULL keyEquivalent:@""];
+ [bar release];
+ NSMenu* windowMenu = [[NSMenu alloc] initWithTitle:@"Window"];
+ [NSApp setWindowsMenu:windowMenu];
+ [windowMenuItem setSubmenu:windowMenu];
+
+ [windowMenu addItemWithTitle:@"Minimize"
+ action:@selector(performMiniaturize:)
+ keyEquivalent:@"m"];
+ [windowMenu addItemWithTitle:@"Zoom"
+ action:@selector(performZoom:)
+ keyEquivalent:@""];
+ [windowMenu addItem:[NSMenuItem separatorItem]];
+ [windowMenu addItemWithTitle:@"Bring All to Front"
+ action:@selector(arrangeInFront:)
+ keyEquivalent:@""];
+
+ // TODO: Make this appear at the bottom of the menu (for consistency)
+ [windowMenu addItem:[NSMenuItem separatorItem]];
+ [[windowMenu addItemWithTitle:@"Enter Full Screen"
+ action:@selector(toggleFullScreen:)
+ keyEquivalent:@"f"]
+ setKeyEquivalentModifierMask:NSEventModifierFlagControl | NSEventModifierFlagCommand];
+
+ // Prior to Snow Leopard, we need to use this oddly-named semi-private API
+ // to get the application menu working properly.
+ SEL setAppleMenuSelector = NSSelectorFromString(@"setAppleMenu:");
+ [NSApp performSelector:setAppleMenuSelector withObject:appMenu];
+}
+
// Create key code translation tables
//
static void createKeyTables(void)
{
- int scancode;
-
memset(_glfw.ns.keycodes, -1, sizeof(_glfw.ns.keycodes));
memset(_glfw.ns.scancodes, -1, sizeof(_glfw.ns.scancodes));
@@ -142,7 +249,7 @@ static void createKeyTables(void)
_glfw.ns.keycodes[0x6D] = GLFW_KEY_F10;
_glfw.ns.keycodes[0x67] = GLFW_KEY_F11;
_glfw.ns.keycodes[0x6F] = GLFW_KEY_F12;
- _glfw.ns.keycodes[0x69] = GLFW_KEY_F13;
+ _glfw.ns.keycodes[0x69] = GLFW_KEY_PRINT_SCREEN;
_glfw.ns.keycodes[0x6B] = GLFW_KEY_F14;
_glfw.ns.keycodes[0x71] = GLFW_KEY_F15;
_glfw.ns.keycodes[0x6A] = GLFW_KEY_F16;
@@ -188,7 +295,7 @@ static void createKeyTables(void)
_glfw.ns.keycodes[0x43] = GLFW_KEY_KP_MULTIPLY;
_glfw.ns.keycodes[0x4E] = GLFW_KEY_KP_SUBTRACT;
- for (scancode = 0; scancode < 256; scancode++)
+ for (int scancode = 0; scancode < 256; scancode++)
{
// Store the reverse translation for faster key name lookup
if (_glfw.ns.keycodes[scancode] >= 0)
@@ -198,7 +305,7 @@ static void createKeyTables(void)
// Retrieve Unicode data for the current keyboard layout
//
-static GLFWbool updateUnicodeDataNS(void)
+static GLFWbool updateUnicodeData(void)
{
if (_glfw.ns.inputSource)
{
@@ -268,36 +375,245 @@ static GLFWbool initializeTIS(void)
_glfw.ns.tis.kPropertyUnicodeKeyLayoutData =
*kPropertyUnicodeKeyLayoutData;
- return updateUnicodeDataNS();
+ return updateUnicodeData();
}
-@interface GLFWLayoutListener : NSObject
+@interface GLFWHelper : NSObject
@end
-@implementation GLFWLayoutListener
+@implementation GLFWHelper
- (void)selectedKeyboardInputSourceChanged:(NSObject* )object
{
- updateUnicodeDataNS();
+ updateUnicodeData();
}
+- (void)doNothing:(id)object
+{
+}
+
+@end // GLFWHelper
+
+@interface GLFWApplicationDelegate : NSObject
@end
+@implementation GLFWApplicationDelegate
+
+- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender
+{
+ for (_GLFWwindow* window = _glfw.windowListHead; window; window = window->next)
+ _glfwInputWindowCloseRequest(window);
+
+ return NSTerminateCancel;
+}
+
+- (void)applicationDidChangeScreenParameters:(NSNotification *) notification
+{
+ for (_GLFWwindow* window = _glfw.windowListHead; window; window = window->next)
+ {
+ if (window->context.client != GLFW_NO_API)
+ [window->context.nsgl.object update];
+ }
+
+ _glfwPollMonitorsCocoa();
+}
+
+- (void)applicationWillFinishLaunching:(NSNotification *)notification
+{
+ if (_glfw.hints.init.ns.menubar)
+ {
+ // Menu bar setup must go between sharedApplication and finishLaunching
+ // in order to properly emulate the behavior of NSApplicationMain
+
+ if ([[NSBundle mainBundle] pathForResource:@"MainMenu" ofType:@"nib"])
+ {
+ [[NSBundle mainBundle] loadNibNamed:@"MainMenu"
+ owner:NSApp
+ topLevelObjects:&_glfw.ns.nibObjects];
+ }
+ else
+ createMenuBar();
+ }
+}
+
+- (void)applicationDidFinishLaunching:(NSNotification *)notification
+{
+ _glfwPostEmptyEventCocoa();
+ [NSApp stop:nil];
+}
+
+- (void)applicationDidHide:(NSNotification *)notification
+{
+ for (int i = 0; i < _glfw.monitorCount; i++)
+ _glfwRestoreVideoModeCocoa(_glfw.monitors[i]);
+}
+
+@end // GLFWApplicationDelegate
+
+
+//////////////////////////////////////////////////////////////////////////
+////// GLFW internal API //////
+//////////////////////////////////////////////////////////////////////////
+
+void* _glfwLoadLocalVulkanLoaderCocoa(void)
+{
+ CFBundleRef bundle = CFBundleGetMainBundle();
+ if (!bundle)
+ return NULL;
+
+ CFURLRef frameworksUrl = CFBundleCopyPrivateFrameworksURL(bundle);
+ if (!frameworksUrl)
+ return NULL;
+
+ CFURLRef loaderUrl = CFURLCreateCopyAppendingPathComponent(
+ kCFAllocatorDefault, frameworksUrl, CFSTR("libvulkan.1.dylib"), false);
+ if (!loaderUrl)
+ {
+ CFRelease(frameworksUrl);
+ return NULL;
+ }
+
+ char path[PATH_MAX];
+ void* handle = NULL;
+
+ if (CFURLGetFileSystemRepresentation(loaderUrl, true, (UInt8*) path, sizeof(path) - 1))
+ handle = _glfwPlatformLoadModule(path);
+
+ CFRelease(loaderUrl);
+ CFRelease(frameworksUrl);
+ return handle;
+}
+
//////////////////////////////////////////////////////////////////////////
////// GLFW platform API //////
//////////////////////////////////////////////////////////////////////////
-int _glfwPlatformInit(void)
+GLFWbool _glfwConnectCocoa(int platformID, _GLFWplatform* platform)
+{
+ const _GLFWplatform cocoa =
+ {
+ .platformID = GLFW_PLATFORM_COCOA,
+ .init = _glfwInitCocoa,
+ .terminate = _glfwTerminateCocoa,
+ .getCursorPos = _glfwGetCursorPosCocoa,
+ .setCursorPos = _glfwSetCursorPosCocoa,
+ .setCursorMode = _glfwSetCursorModeCocoa,
+ .setRawMouseMotion = _glfwSetRawMouseMotionCocoa,
+ .rawMouseMotionSupported = _glfwRawMouseMotionSupportedCocoa,
+ .createCursor = _glfwCreateCursorCocoa,
+ .createStandardCursor = _glfwCreateStandardCursorCocoa,
+ .destroyCursor = _glfwDestroyCursorCocoa,
+ .setCursor = _glfwSetCursorCocoa,
+ .getScancodeName = _glfwGetScancodeNameCocoa,
+ .getKeyScancode = _glfwGetKeyScancodeCocoa,
+ .setClipboardString = _glfwSetClipboardStringCocoa,
+ .getClipboardString = _glfwGetClipboardStringCocoa,
+ .initJoysticks = _glfwInitJoysticksCocoa,
+ .terminateJoysticks = _glfwTerminateJoysticksCocoa,
+ .pollJoystick = _glfwPollJoystickCocoa,
+ .getMappingName = _glfwGetMappingNameCocoa,
+ .updateGamepadGUID = _glfwUpdateGamepadGUIDCocoa,
+ .freeMonitor = _glfwFreeMonitorCocoa,
+ .getMonitorPos = _glfwGetMonitorPosCocoa,
+ .getMonitorContentScale = _glfwGetMonitorContentScaleCocoa,
+ .getMonitorWorkarea = _glfwGetMonitorWorkareaCocoa,
+ .getVideoModes = _glfwGetVideoModesCocoa,
+ .getVideoMode = _glfwGetVideoModeCocoa,
+ .getGammaRamp = _glfwGetGammaRampCocoa,
+ .setGammaRamp = _glfwSetGammaRampCocoa,
+ .createWindow = _glfwCreateWindowCocoa,
+ .destroyWindow = _glfwDestroyWindowCocoa,
+ .setWindowTitle = _glfwSetWindowTitleCocoa,
+ .setWindowIcon = _glfwSetWindowIconCocoa,
+ .getWindowPos = _glfwGetWindowPosCocoa,
+ .setWindowPos = _glfwSetWindowPosCocoa,
+ .getWindowSize = _glfwGetWindowSizeCocoa,
+ .setWindowSize = _glfwSetWindowSizeCocoa,
+ .setWindowSizeLimits = _glfwSetWindowSizeLimitsCocoa,
+ .setWindowAspectRatio = _glfwSetWindowAspectRatioCocoa,
+ .getFramebufferSize = _glfwGetFramebufferSizeCocoa,
+ .getWindowFrameSize = _glfwGetWindowFrameSizeCocoa,
+ .getWindowContentScale = _glfwGetWindowContentScaleCocoa,
+ .iconifyWindow = _glfwIconifyWindowCocoa,
+ .restoreWindow = _glfwRestoreWindowCocoa,
+ .maximizeWindow = _glfwMaximizeWindowCocoa,
+ .showWindow = _glfwShowWindowCocoa,
+ .hideWindow = _glfwHideWindowCocoa,
+ .requestWindowAttention = _glfwRequestWindowAttentionCocoa,
+ .focusWindow = _glfwFocusWindowCocoa,
+ .setWindowMonitor = _glfwSetWindowMonitorCocoa,
+ .windowFocused = _glfwWindowFocusedCocoa,
+ .windowIconified = _glfwWindowIconifiedCocoa,
+ .windowVisible = _glfwWindowVisibleCocoa,
+ .windowMaximized = _glfwWindowMaximizedCocoa,
+ .windowHovered = _glfwWindowHoveredCocoa,
+ .framebufferTransparent = _glfwFramebufferTransparentCocoa,
+ .getWindowOpacity = _glfwGetWindowOpacityCocoa,
+ .setWindowResizable = _glfwSetWindowResizableCocoa,
+ .setWindowDecorated = _glfwSetWindowDecoratedCocoa,
+ .setWindowFloating = _glfwSetWindowFloatingCocoa,
+ .setWindowOpacity = _glfwSetWindowOpacityCocoa,
+ .setWindowMousePassthrough = _glfwSetWindowMousePassthroughCocoa,
+ .pollEvents = _glfwPollEventsCocoa,
+ .waitEvents = _glfwWaitEventsCocoa,
+ .waitEventsTimeout = _glfwWaitEventsTimeoutCocoa,
+ .postEmptyEvent = _glfwPostEmptyEventCocoa,
+ .getEGLPlatform = _glfwGetEGLPlatformCocoa,
+ .getEGLNativeDisplay = _glfwGetEGLNativeDisplayCocoa,
+ .getEGLNativeWindow = _glfwGetEGLNativeWindowCocoa,
+ .getRequiredInstanceExtensions = _glfwGetRequiredInstanceExtensionsCocoa,
+ .getPhysicalDevicePresentationSupport = _glfwGetPhysicalDevicePresentationSupportCocoa,
+ .createWindowSurface = _glfwCreateWindowSurfaceCocoa
+ };
+
+ *platform = cocoa;
+ return GLFW_TRUE;
+}
+
+int _glfwInitCocoa(void)
{
- _glfw.ns.autoreleasePool = [[NSAutoreleasePool alloc] init];
+ @autoreleasepool {
+
+ _glfw.ns.helper = [[GLFWHelper alloc] init];
+
+ [NSThread detachNewThreadSelector:@selector(doNothing:)
+ toTarget:_glfw.ns.helper
+ withObject:nil];
+
+ [NSApplication sharedApplication];
+
+ _glfw.ns.delegate = [[GLFWApplicationDelegate alloc] init];
+ if (_glfw.ns.delegate == nil)
+ {
+ _glfwInputError(GLFW_PLATFORM_ERROR,
+ "Cocoa: Failed to create application delegate");
+ return GLFW_FALSE;
+ }
+
+ [NSApp setDelegate:_glfw.ns.delegate];
+
+ NSEvent* (^block)(NSEvent*) = ^ NSEvent* (NSEvent* event)
+ {
+ if ([event modifierFlags] & NSEventModifierFlagCommand)
+ [[NSApp keyWindow] sendEvent:event];
+
+ return event;
+ };
+
+ _glfw.ns.keyUpMonitor =
+ [NSEvent addLocalMonitorForEventsMatchingMask:NSEventMaskKeyUp
+ handler:block];
if (_glfw.hints.init.ns.chdir)
changeToResourcesDirectory();
- _glfw.ns.listener = [[GLFWLayoutListener alloc] init];
+ // Press and Hold prevents some keys from emitting repeated characters
+ NSDictionary* defaults = @{@"ApplePressAndHoldEnabled":@NO};
+ [[NSUserDefaults standardUserDefaults] registerDefaults:defaults];
+
[[NSNotificationCenter defaultCenter]
- addObserver:_glfw.ns.listener
+ addObserver:_glfw.ns.helper
selector:@selector(selectedKeyboardInputSourceChanged:)
name:NSTextInputContextKeyboardSelectionDidChangeNotification
object:nil];
@@ -313,15 +629,24 @@ int _glfwPlatformInit(void)
if (!initializeTIS())
return GLFW_FALSE;
- _glfwInitTimerNS();
- _glfwInitJoysticksNS();
+ _glfwPollMonitorsCocoa();
+
+ if (![[NSRunningApplication currentApplication] isFinishedLaunching])
+ [NSApp run];
+
+ // In case we are unbundled, make us a proper UI application
+ if (_glfw.hints.init.ns.menubar)
+ [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
- _glfwPollMonitorsNS();
return GLFW_TRUE;
+
+ } // autoreleasepool
}
-void _glfwPlatformTerminate(void)
+void _glfwTerminateCocoa(void)
{
+ @autoreleasepool {
+
if (_glfw.ns.inputSource)
{
CFRelease(_glfw.ns.inputSource);
@@ -342,33 +667,29 @@ void _glfwPlatformTerminate(void)
_glfw.ns.delegate = nil;
}
- if (_glfw.ns.listener)
+ if (_glfw.ns.helper)
{
[[NSNotificationCenter defaultCenter]
- removeObserver:_glfw.ns.listener
+ removeObserver:_glfw.ns.helper
name:NSTextInputContextKeyboardSelectionDidChangeNotification
object:nil];
[[NSNotificationCenter defaultCenter]
- removeObserver:_glfw.ns.listener];
- [_glfw.ns.listener release];
- _glfw.ns.listener = nil;
+ removeObserver:_glfw.ns.helper];
+ [_glfw.ns.helper release];
+ _glfw.ns.helper = nil;
}
- free(_glfw.ns.clipboardString);
+ if (_glfw.ns.keyUpMonitor)
+ [NSEvent removeMonitor:_glfw.ns.keyUpMonitor];
+
+ _glfw_free(_glfw.ns.clipboardString);
_glfwTerminateNSGL();
- _glfwTerminateJoysticksNS();
+ _glfwTerminateEGL();
+ _glfwTerminateOSMesa();
- [_glfw.ns.autoreleasePool release];
- _glfw.ns.autoreleasePool = nil;
+ } // autoreleasepool
}
-const char* _glfwPlatformGetVersionString(void)
-{
- return _GLFW_VERSION_NUMBER " Cocoa NSGL"
-#if defined(_GLFW_BUILD_DLL)
- " dynamic"
-#endif
- ;
-}
+#endif // _GLFW_COCOA
diff --git a/external/GLFW/src/cocoa_joystick.h b/external/GLFW/src/cocoa_joystick.h
index d18d032..c3a58e2 100644
--- a/external/GLFW/src/cocoa_joystick.h
+++ b/external/GLFW/src/cocoa_joystick.h
@@ -1,7 +1,7 @@
//========================================================================
-// GLFW 3.3 Cocoa - www.glfw.org
+// GLFW 3.5 Cocoa - www.glfw.org
//------------------------------------------------------------------------
-// Copyright (c) 2006-2016 Camilla Löwy
+// Copyright (c) 2006-2017 Camilla Löwy
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
@@ -26,13 +26,10 @@
#include
#include
-#include
#include
-#define _GLFW_PLATFORM_JOYSTICK_STATE _GLFWjoystickNS ns
-#define _GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE
-
-#define _GLFW_PLATFORM_MAPPING_NAME "Mac OS X"
+#define GLFW_COCOA_JOYSTICK_STATE _GLFWjoystickNS ns;
+#define GLFW_COCOA_LIBRARY_JOYSTICK_STATE
// Cocoa-specific per-joystick data
//
@@ -44,7 +41,9 @@ typedef struct _GLFWjoystickNS
CFMutableArrayRef hats;
} _GLFWjoystickNS;
-
-void _glfwInitJoysticksNS(void);
-void _glfwTerminateJoysticksNS(void);
+GLFWbool _glfwInitJoysticksCocoa(void);
+void _glfwTerminateJoysticksCocoa(void);
+GLFWbool _glfwPollJoystickCocoa(_GLFWjoystick* js, int mode);
+const char* _glfwGetMappingNameCocoa(void);
+void _glfwUpdateGamepadGUIDCocoa(char* guid);
diff --git a/external/GLFW/src/cocoa_joystick.m b/external/GLFW/src/cocoa_joystick.m
index 3a5751e..bb86ad2 100644
--- a/external/GLFW/src/cocoa_joystick.m
+++ b/external/GLFW/src/cocoa_joystick.m
@@ -1,7 +1,7 @@
//========================================================================
-// GLFW 3.3 Cocoa - www.glfw.org
+// GLFW 3.5 Cocoa - www.glfw.org
//------------------------------------------------------------------------
-// Copyright (c) 2009-2016 Camilla Löwy
+// Copyright (c) 2009-2019 Camilla Löwy
// Copyright (c) 2012 Torsten Walluhn
//
// This software is provided 'as-is', without any express or implied
@@ -27,6 +27,8 @@
#include "internal.h"
+#if defined(_GLFW_COCOA)
+
#include
#include