ship glfw
|
@ -0,0 +1,48 @@
|
||||||
|
# Usage:
|
||||||
|
# cmake -P GenerateMappings.cmake <path/to/mappings.h.in> <path/to/mappings.h>
|
||||||
|
|
||||||
|
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}")
|
||||||
|
set(target_path "${CMAKE_ARGV4}")
|
||||||
|
|
||||||
|
if (NOT EXISTS "${template_path}")
|
||||||
|
message(FATAL_ERROR "Failed to find template file ${template_path}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
file(DOWNLOAD "${source_url}" "${source_path}"
|
||||||
|
STATUS download_status
|
||||||
|
TLS_VERIFY on)
|
||||||
|
|
||||||
|
list(GET download_status 0 status_code)
|
||||||
|
list(GET download_status 1 status_message)
|
||||||
|
|
||||||
|
if (status_code)
|
||||||
|
message(FATAL_ERROR "Failed to download ${source_url}: ${status_message}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
file(STRINGS "${source_path}" lines)
|
||||||
|
foreach(line ${lines})
|
||||||
|
if (line MATCHES "^[0-9a-fA-F]")
|
||||||
|
if (line MATCHES "platform:Windows")
|
||||||
|
if (GLFW_WIN32_MAPPINGS)
|
||||||
|
set(GLFW_WIN32_MAPPINGS "${GLFW_WIN32_MAPPINGS}\n")
|
||||||
|
endif()
|
||||||
|
set(GLFW_WIN32_MAPPINGS "${GLFW_WIN32_MAPPINGS}\"${line}\",")
|
||||||
|
elseif (line MATCHES "platform:Mac OS X")
|
||||||
|
if (GLFW_COCOA_MAPPINGS)
|
||||||
|
set(GLFW_COCOA_MAPPINGS "${GLFW_COCOA_MAPPINGS}\n")
|
||||||
|
endif()
|
||||||
|
set(GLFW_COCOA_MAPPINGS "${GLFW_COCOA_MAPPINGS}\"${line}\",")
|
||||||
|
elseif (line MATCHES "platform:Linux")
|
||||||
|
if (GLFW_LINUX_MAPPINGS)
|
||||||
|
set(GLFW_LINUX_MAPPINGS "${GLFW_LINUX_MAPPINGS}\n")
|
||||||
|
endif()
|
||||||
|
set(GLFW_LINUX_MAPPINGS "${GLFW_LINUX_MAPPINGS}\"${line}\",")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
configure_file("${template_path}" "${target_path}" @ONLY NEWLINE_STYLE UNIX)
|
||||||
|
file(REMOVE "${source_path}")
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
|
<string>English</string>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
|
||||||
|
<key>CFBundleGetInfoString</key>
|
||||||
|
<string>${MACOSX_BUNDLE_INFO_STRING}</string>
|
||||||
|
<key>CFBundleIconFile</key>
|
||||||
|
<string>${MACOSX_BUNDLE_ICON_FILE}</string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
|
||||||
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
|
<string>6.0</string>
|
||||||
|
<key>CFBundleLongVersionString</key>
|
||||||
|
<string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string>
|
||||||
|
<key>CFBundleName</key>
|
||||||
|
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>APPL</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
|
||||||
|
<key>CFBundleSignature</key>
|
||||||
|
<string>????</string>
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
|
||||||
|
<key>CSResourcesFileMapped</key>
|
||||||
|
<true/>
|
||||||
|
<key>LSRequiresCarbon</key>
|
||||||
|
<true/>
|
||||||
|
<key>NSHumanReadableCopyright</key>
|
||||||
|
<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
|
||||||
|
<key>NSHighResolutionCapable</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
|
@ -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)
|
|
@ -0,0 +1,13 @@
|
||||||
|
# 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")
|
||||||
|
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
|
||||||
|
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)
|
|
@ -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)
|
|
@ -0,0 +1,18 @@
|
||||||
|
# Try to find OSMesa on a Unix system
|
||||||
|
#
|
||||||
|
# This will define:
|
||||||
|
#
|
||||||
|
# OSMESA_LIBRARIES - Link these to use OSMesa
|
||||||
|
# OSMESA_INCLUDE_DIR - Include directory for OSMesa
|
||||||
|
#
|
||||||
|
# Copyright (c) 2014 Brandon Schaefer <brandon.schaefer@canonical.com>
|
||||||
|
|
||||||
|
if (NOT WIN32)
|
||||||
|
|
||||||
|
find_package (PkgConfig)
|
||||||
|
pkg_check_modules (PKG_OSMESA QUIET osmesa)
|
||||||
|
|
||||||
|
set (OSMESA_INCLUDE_DIR ${PKG_OSMESA_INCLUDE_DIRS})
|
||||||
|
set (OSMESA_LIBRARIES ${PKG_OSMESA_LIBRARIES})
|
||||||
|
|
||||||
|
endif ()
|
|
@ -0,0 +1,26 @@
|
||||||
|
find_package(PkgConfig)
|
||||||
|
|
||||||
|
pkg_check_modules(WaylandProtocols QUIET wayland-protocols>=${WaylandProtocols_FIND_VERSION})
|
||||||
|
|
||||||
|
execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=pkgdatadir wayland-protocols
|
||||||
|
OUTPUT_VARIABLE WaylandProtocols_PKGDATADIR
|
||||||
|
RESULT_VARIABLE _pkgconfig_failed)
|
||||||
|
if (_pkgconfig_failed)
|
||||||
|
message(FATAL_ERROR "Missing wayland-protocols pkgdatadir")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
string(REGEX REPLACE "[\r\n]" "" WaylandProtocols_PKGDATADIR "${WaylandProtocols_PKGDATADIR}")
|
||||||
|
|
||||||
|
find_package_handle_standard_args(WaylandProtocols
|
||||||
|
FOUND_VAR
|
||||||
|
WaylandProtocols_FOUND
|
||||||
|
REQUIRED_VARS
|
||||||
|
WaylandProtocols_PKGDATADIR
|
||||||
|
VERSION_VAR
|
||||||
|
WaylandProtocols_VERSION
|
||||||
|
HANDLE_COMPONENTS
|
||||||
|
)
|
||||||
|
|
||||||
|
set(WAYLAND_PROTOCOLS_FOUND ${WaylandProtocols_FOUND})
|
||||||
|
set(WAYLAND_PROTOCOLS_PKGDATADIR ${WaylandProtocols_PKGDATADIR})
|
||||||
|
set(WAYLAND_PROTOCOLS_VERSION ${WaylandProtocols_VERSION})
|
|
@ -0,0 +1,34 @@
|
||||||
|
# - Try to find XKBCommon
|
||||||
|
# Once done, this will define
|
||||||
|
#
|
||||||
|
# XKBCOMMON_FOUND - System has XKBCommon
|
||||||
|
# XKBCOMMON_INCLUDE_DIRS - The XKBCommon include directories
|
||||||
|
# XKBCOMMON_LIBRARIES - The libraries needed to use XKBCommon
|
||||||
|
# XKBCOMMON_DEFINITIONS - Compiler switches required for using XKBCommon
|
||||||
|
|
||||||
|
find_package(PkgConfig)
|
||||||
|
pkg_check_modules(PC_XKBCOMMON QUIET xkbcommon)
|
||||||
|
set(XKBCOMMON_DEFINITIONS ${PC_XKBCOMMON_CFLAGS_OTHER})
|
||||||
|
|
||||||
|
find_path(XKBCOMMON_INCLUDE_DIR
|
||||||
|
NAMES xkbcommon/xkbcommon.h
|
||||||
|
HINTS ${PC_XKBCOMMON_INCLUDE_DIR} ${PC_XKBCOMMON_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
find_library(XKBCOMMON_LIBRARY
|
||||||
|
NAMES xkbcommon
|
||||||
|
HINTS ${PC_XKBCOMMON_LIBRARY} ${PC_XKBCOMMON_LIBRARY_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
set(XKBCOMMON_LIBRARIES ${XKBCOMMON_LIBRARY})
|
||||||
|
set(XKBCOMMON_LIBRARY_DIRS ${XKBCOMMON_LIBRARY_DIRS})
|
||||||
|
set(XKBCOMMON_INCLUDE_DIRS ${XKBCOMMON_INCLUDE_DIR})
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(XKBCommon DEFAULT_MSG
|
||||||
|
XKBCOMMON_LIBRARY
|
||||||
|
XKBCOMMON_INCLUDE_DIR
|
||||||
|
)
|
||||||
|
|
||||||
|
mark_as_advanced(XKBCOMMON_LIBRARY XKBCOMMON_INCLUDE_DIR)
|
||||||
|
|
|
@ -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)
|
|
@ -0,0 +1,13 @@
|
||||||
|
# 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")
|
||||||
|
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
|
||||||
|
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)
|
|
@ -0,0 +1,385 @@
|
||||||
|
cmake_minimum_required(VERSION 3.0...3.20 FATAL_ERROR)
|
||||||
|
|
||||||
|
project(GLFW VERSION 3.3.8 LANGUAGES C)
|
||||||
|
|
||||||
|
set(CMAKE_LEGACY_CYGWIN_WIN32 OFF)
|
||||||
|
|
||||||
|
if (POLICY CMP0054)
|
||||||
|
cmake_policy(SET CMP0054 NEW)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (POLICY CMP0069)
|
||||||
|
cmake_policy(SET CMP0069 NEW)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (POLICY CMP0077)
|
||||||
|
cmake_policy(SET CMP0077 NEW)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||||
|
|
||||||
|
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_DOCS "Build the GLFW documentation" ON)
|
||||||
|
option(GLFW_INSTALL "Generate installation target" ON)
|
||||||
|
option(GLFW_VULKAN_STATIC "Assume the Vulkan loader is linked with the application" OFF)
|
||||||
|
|
||||||
|
include(GNUInstallDirs)
|
||||||
|
include(CMakeDependentOption)
|
||||||
|
|
||||||
|
cmake_dependent_option(GLFW_USE_OSMESA "Use OSMesa for offscreen context creation" OFF
|
||||||
|
"UNIX" OFF)
|
||||||
|
cmake_dependent_option(GLFW_USE_HYBRID_HPG "Force use of high-performance GPU on hybrid systems" OFF
|
||||||
|
"WIN32" OFF)
|
||||||
|
cmake_dependent_option(GLFW_USE_WAYLAND "Use Wayland for window creation" OFF
|
||||||
|
"UNIX;NOT APPLE" OFF)
|
||||||
|
cmake_dependent_option(USE_MSVC_RUNTIME_LIBRARY_DLL "Use MSVC runtime library DLL" ON
|
||||||
|
"MSVC" OFF)
|
||||||
|
|
||||||
|
if (BUILD_SHARED_LIBS)
|
||||||
|
set(_GLFW_BUILD_DLL 1)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
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)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (GLFW_VULKAN_STATIC)
|
||||||
|
if (BUILD_SHARED_LIBS)
|
||||||
|
# If you absolutely must do this, remove this line and add the Vulkan
|
||||||
|
# loader static library via the CMAKE_SHARED_LINKER_FLAGS
|
||||||
|
message(FATAL_ERROR "You are trying to link the Vulkan loader static library into the GLFW shared library")
|
||||||
|
endif()
|
||||||
|
set(_GLFW_VULKAN_STATIC 1)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
list(APPEND CMAKE_MODULE_PATH "${GLFW_SOURCE_DIR}/CMake/modules")
|
||||||
|
|
||||||
|
find_package(Threads REQUIRED)
|
||||||
|
|
||||||
|
if (GLFW_BUILD_DOCS)
|
||||||
|
set(DOXYGEN_SKIP_DOT TRUE)
|
||||||
|
find_package(Doxygen)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#--------------------------------------------------------------------
|
||||||
|
# Apply Microsoft C runtime library option
|
||||||
|
# This is here because it also applies to tests and examples
|
||||||
|
#--------------------------------------------------------------------
|
||||||
|
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 headers not found; install DirectX 9 SDK")
|
||||||
|
endif()
|
||||||
|
# Workaround for VS 2008 not shipping with stdint.h
|
||||||
|
list(APPEND glfw_INCLUDE_DIRS "${GLFW_SOURCE_DIR}/deps/vs2008")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (MSVC AND NOT USE_MSVC_RUNTIME_LIBRARY_DLL)
|
||||||
|
if (CMAKE_VERSION VERSION_LESS 3.15)
|
||||||
|
foreach (flag CMAKE_C_FLAGS
|
||||||
|
CMAKE_C_FLAGS_DEBUG
|
||||||
|
CMAKE_C_FLAGS_RELEASE
|
||||||
|
CMAKE_C_FLAGS_MINSIZEREL
|
||||||
|
CMAKE_C_FLAGS_RELWITHDEBINFO)
|
||||||
|
|
||||||
|
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()
|
||||||
|
else()
|
||||||
|
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||||
|
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()
|
||||||
|
|
||||||
|
# Clear flags again to avoid breaking later tests
|
||||||
|
set(CMAKE_REQUIRED_FLAGS)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#--------------------------------------------------------------------
|
||||||
|
# Detect and select backend APIs
|
||||||
|
#--------------------------------------------------------------------
|
||||||
|
if (GLFW_USE_WAYLAND)
|
||||||
|
set(_GLFW_WAYLAND 1)
|
||||||
|
message(STATUS "Using Wayland 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()
|
||||||
|
|
||||||
|
#--------------------------------------------------------------------
|
||||||
|
# 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}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#--------------------------------------------------------------------
|
||||||
|
# Use Win32 for window creation
|
||||||
|
#--------------------------------------------------------------------
|
||||||
|
if (_GLFW_WIN32)
|
||||||
|
|
||||||
|
list(APPEND glfw_PKG_LIBS "-lgdi32")
|
||||||
|
|
||||||
|
if (GLFW_USE_HYBRID_HPG)
|
||||||
|
set(_GLFW_USE_HYBRID_HPG 1)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#--------------------------------------------------------------------
|
||||||
|
# Use X11 for window creation
|
||||||
|
#--------------------------------------------------------------------
|
||||||
|
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_INCLUDE_PATH)
|
||||||
|
message(FATAL_ERROR "RandR headers not found; install libxrandr development package")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# 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()
|
||||||
|
|
||||||
|
# Check for Xkb (X keyboard extension)
|
||||||
|
if (NOT X11_Xkb_INCLUDE_PATH)
|
||||||
|
message(FATAL_ERROR "XKB headers not found; install X11 development package")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# 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()
|
||||||
|
|
||||||
|
# Check for XInput (modern HID input)
|
||||||
|
if (NOT X11_Xi_INCLUDE_PATH)
|
||||||
|
message(FATAL_ERROR "XInput headers not found; install libxi development package")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
list(APPEND glfw_INCLUDE_DIRS "${X11_Xrandr_INCLUDE_PATH}"
|
||||||
|
"${X11_Xinerama_INCLUDE_PATH}"
|
||||||
|
"${X11_Xkb_INCLUDE_PATH}"
|
||||||
|
"${X11_Xcursor_INCLUDE_PATH}"
|
||||||
|
"${X11_Xi_INCLUDE_PATH}")
|
||||||
|
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 Client Cursor Egl)
|
||||||
|
find_package(WaylandScanner REQUIRED)
|
||||||
|
find_package(WaylandProtocols 1.15 REQUIRED)
|
||||||
|
|
||||||
|
list(APPEND glfw_PKG_DEPS "wayland-client")
|
||||||
|
|
||||||
|
list(APPEND glfw_INCLUDE_DIRS "${Wayland_INCLUDE_DIRS}")
|
||||||
|
list(APPEND glfw_LIBRARIES "${Wayland_LIBRARIES}" "${CMAKE_THREAD_LIBS_INIT}")
|
||||||
|
|
||||||
|
find_package(XKBCommon REQUIRED)
|
||||||
|
list(APPEND glfw_INCLUDE_DIRS "${XKBCOMMON_INCLUDE_DIRS}")
|
||||||
|
|
||||||
|
include(CheckIncludeFiles)
|
||||||
|
include(CheckFunctionExists)
|
||||||
|
check_function_exists(memfd_create HAVE_MEMFD_CREATE)
|
||||||
|
|
||||||
|
if (NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
|
find_package(EpollShim)
|
||||||
|
if (EPOLLSHIM_FOUND)
|
||||||
|
list(APPEND glfw_INCLUDE_DIRS "${EPOLLSHIM_INCLUDE_DIRS}")
|
||||||
|
list(APPEND glfw_LIBRARIES "${EPOLLSHIM_LIBRARIES}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#--------------------------------------------------------------------
|
||||||
|
# Use OSMesa for offscreen context creation
|
||||||
|
#--------------------------------------------------------------------
|
||||||
|
if (_GLFW_OSMESA)
|
||||||
|
find_package(OSMesa REQUIRED)
|
||||||
|
list(APPEND glfw_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#--------------------------------------------------------------------
|
||||||
|
# Use Cocoa for window creation and NSOpenGL for context creation
|
||||||
|
#--------------------------------------------------------------------
|
||||||
|
if (_GLFW_COCOA)
|
||||||
|
|
||||||
|
list(APPEND glfw_LIBRARIES
|
||||||
|
"-framework Cocoa"
|
||||||
|
"-framework IOKit"
|
||||||
|
"-framework CoreFoundation")
|
||||||
|
|
||||||
|
set(glfw_PKG_DEPS "")
|
||||||
|
set(glfw_PKG_LIBS "-framework Cocoa -framework IOKit -framework CoreFoundation")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#--------------------------------------------------------------------
|
||||||
|
# Add the Vulkan loader as a dependency if necessary
|
||||||
|
#--------------------------------------------------------------------
|
||||||
|
if (GLFW_VULKAN_STATIC)
|
||||||
|
list(APPEND glfw_PKG_DEPS "vulkan")
|
||||||
|
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 "${CMAKE_INSTALL_LIBDIR}/cmake/glfw3")
|
||||||
|
|
||||||
|
configure_package_config_file(src/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}
|
||||||
|
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
|
||||||
|
#--------------------------------------------------------------------
|
||||||
|
add_subdirectory(src)
|
||||||
|
|
||||||
|
if (GLFW_BUILD_EXAMPLES)
|
||||||
|
add_subdirectory(examples)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (GLFW_BUILD_TESTS)
|
||||||
|
add_subdirectory(tests)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (DOXYGEN_FOUND AND GLFW_BUILD_DOCS)
|
||||||
|
add_subdirectory(docs)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#--------------------------------------------------------------------
|
||||||
|
# Install files other than the library
|
||||||
|
# The library is installed by src/CMakeLists.txt
|
||||||
|
#--------------------------------------------------------------------
|
||||||
|
if (GLFW_INSTALL)
|
||||||
|
install(DIRECTORY include/GLFW DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||||
|
FILES_MATCHING PATTERN glfw3.h PATTERN glfw3native.h)
|
||||||
|
|
||||||
|
install(FILES "${GLFW_BINARY_DIR}/src/glfw3Config.cmake"
|
||||||
|
"${GLFW_BINARY_DIR}/src/glfw3ConfigVersion.cmake"
|
||||||
|
DESTINATION "${GLFW_CONFIG_PATH}")
|
||||||
|
|
||||||
|
install(EXPORT glfwTargets FILE glfw3Targets.cmake
|
||||||
|
EXPORT_LINK_INTERFACE_LIBRARIES
|
||||||
|
DESTINATION "${GLFW_CONFIG_PATH}")
|
||||||
|
install(FILES "${GLFW_BINARY_DIR}/src/glfw3.pc"
|
||||||
|
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
|
||||||
|
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()
|
||||||
|
|
|
@ -0,0 +1,250 @@
|
||||||
|
# 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
|
||||||
|
- ashishgamedev
|
||||||
|
- David Avedissian
|
||||||
|
- Keith Bauer
|
||||||
|
- John Bartholomew
|
||||||
|
- Coşku Baş
|
||||||
|
- Niklas Behrens
|
||||||
|
- Andrew Belt
|
||||||
|
- Nevyn Bengtsson
|
||||||
|
- Niklas Bergström
|
||||||
|
- Denis Bernard
|
||||||
|
- BiBi
|
||||||
|
- Doug Binks
|
||||||
|
- blanco
|
||||||
|
- Waris Boonyasiriwat
|
||||||
|
- Kyle Brenneman
|
||||||
|
- Rok Breulj
|
||||||
|
- TheBrokenRail
|
||||||
|
- Kai Burjack
|
||||||
|
- Martin Capitanio
|
||||||
|
- Nicolas Caramelli
|
||||||
|
- David Carlier
|
||||||
|
- Arturo Castro
|
||||||
|
- Chi-kwan Chan
|
||||||
|
- TheChocolateOre
|
||||||
|
- Joseph Chua
|
||||||
|
- Ian Clarkson
|
||||||
|
- Michał Cichoń
|
||||||
|
- Lambert Clara
|
||||||
|
- Anna Clarke
|
||||||
|
- Josh Codd
|
||||||
|
- Yaron Cohen-Tal
|
||||||
|
- Omar Cornut
|
||||||
|
- Andrew Corrigan
|
||||||
|
- Bailey Cosier
|
||||||
|
- Noel Cower
|
||||||
|
- CuriouserThing
|
||||||
|
- Jason Daly
|
||||||
|
- danhambleton
|
||||||
|
- Jarrod Davis
|
||||||
|
- Olivier Delannoy
|
||||||
|
- Paul R. Deppe
|
||||||
|
- Michael Dickens
|
||||||
|
- Роман Донченко
|
||||||
|
- Mario Dorn
|
||||||
|
- Wolfgang Draxinger
|
||||||
|
- Jonathan Dummer
|
||||||
|
- Ralph Eastwood
|
||||||
|
- Fredrik Ehnbom
|
||||||
|
- Robin Eklind
|
||||||
|
- Jan Ekström
|
||||||
|
- Siavash Eliasi
|
||||||
|
- TheExileFox
|
||||||
|
- Nikita Fediuchin
|
||||||
|
- Felipe Ferreira
|
||||||
|
- Michael Fogleman
|
||||||
|
- Jason Francis
|
||||||
|
- Gerald Franz
|
||||||
|
- Mário Freitas
|
||||||
|
- GeO4d
|
||||||
|
- Marcus Geelnard
|
||||||
|
- ghuser404
|
||||||
|
- Charles Giessen
|
||||||
|
- Ryan C. Gordon
|
||||||
|
- Stephen Gowen
|
||||||
|
- Kovid Goyal
|
||||||
|
- Kevin Grandemange
|
||||||
|
- Eloi Marín Gratacós
|
||||||
|
- Stefan Gustavson
|
||||||
|
- Andrew Gutekanst
|
||||||
|
- Stephen Gutekanst
|
||||||
|
- Jonathan Hale
|
||||||
|
- hdf89shfdfs
|
||||||
|
- Sylvain Hellegouarch
|
||||||
|
- Matthew Henry
|
||||||
|
- heromyth
|
||||||
|
- Lucas Hinderberger
|
||||||
|
- Paul Holden
|
||||||
|
- Hajime Hoshi
|
||||||
|
- Warren Hu
|
||||||
|
- Charles Huber
|
||||||
|
- Brent Huisman
|
||||||
|
- illustris
|
||||||
|
- InKryption
|
||||||
|
- IntellectualKitty
|
||||||
|
- Aaron Jacobs
|
||||||
|
- JannikGM
|
||||||
|
- Erik S. V. Jansson
|
||||||
|
- jjYBdx4IL
|
||||||
|
- Toni Jovanoski
|
||||||
|
- Arseny Kapoulkine
|
||||||
|
- Cem Karan
|
||||||
|
- Osman Keskin
|
||||||
|
- Koray Kilinc
|
||||||
|
- Josh Kilmer
|
||||||
|
- Byunghoon Kim
|
||||||
|
- Cameron King
|
||||||
|
- Peter Knut
|
||||||
|
- Christoph Kubisch
|
||||||
|
- Yuri Kunde Schlesner
|
||||||
|
- Rokas Kupstys
|
||||||
|
- Konstantin Käfer
|
||||||
|
- Eric Larson
|
||||||
|
- Francis Lecavalier
|
||||||
|
- Jong Won Lee
|
||||||
|
- Robin Leffmann
|
||||||
|
- Glenn Lewis
|
||||||
|
- Shane Liesegang
|
||||||
|
- Anders Lindqvist
|
||||||
|
- Leon Linhart
|
||||||
|
- Marco Lizza
|
||||||
|
- Eyal Lotem
|
||||||
|
- Aaron Loucks
|
||||||
|
- Luflosi
|
||||||
|
- lukect
|
||||||
|
- Tristam MacDonald
|
||||||
|
- Hans Mackowiak
|
||||||
|
- Дмитри Малышев
|
||||||
|
- Zbigniew Mandziejewicz
|
||||||
|
- Adam Marcus
|
||||||
|
- Célestin Marot
|
||||||
|
- Kyle McDonald
|
||||||
|
- David V. McKay
|
||||||
|
- David Medlock
|
||||||
|
- Bryce Mehring
|
||||||
|
- Jonathan Mercier
|
||||||
|
- Marcel Metz
|
||||||
|
- Liam Middlebrook
|
||||||
|
- Ave Milia
|
||||||
|
- Jonathan Miller
|
||||||
|
- Kenneth Miller
|
||||||
|
- Bruce Mitchener
|
||||||
|
- Jack Moffitt
|
||||||
|
- Ravi Mohan
|
||||||
|
- Jeff Molofee
|
||||||
|
- Alexander Monakov
|
||||||
|
- Pierre Morel
|
||||||
|
- Jon Morton
|
||||||
|
- Pierre Moulon
|
||||||
|
- Martins Mozeiko
|
||||||
|
- James Murphy
|
||||||
|
- Julian Møller
|
||||||
|
- ndogxj
|
||||||
|
- F. Nedelec
|
||||||
|
- Kristian Nielsen
|
||||||
|
- Joel Niemelä
|
||||||
|
- Kamil Nowakowski
|
||||||
|
- onox
|
||||||
|
- Denis Ovod
|
||||||
|
- Ozzy
|
||||||
|
- Andri Pálsson
|
||||||
|
- Peoro
|
||||||
|
- Braden Pellett
|
||||||
|
- Christopher Pelloux
|
||||||
|
- 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
|
||||||
|
- Alexandre Pretyman
|
||||||
|
- Pablo Prietz
|
||||||
|
- przemekmirek
|
||||||
|
- pthom
|
||||||
|
- Martin Pulec
|
||||||
|
- Guillaume Racicot
|
||||||
|
- Philip Rideout
|
||||||
|
- Eddie Ringle
|
||||||
|
- Max Risuhin
|
||||||
|
- Jorge Rodriguez
|
||||||
|
- Luca Rood
|
||||||
|
- Ed Ropple
|
||||||
|
- Aleksey Rybalkin
|
||||||
|
- Mikko Rytkönen
|
||||||
|
- Riku Salminen
|
||||||
|
- Brandon Schaefer
|
||||||
|
- Sebastian Schuberth
|
||||||
|
- Christian Sdunek
|
||||||
|
- Matt Sealey
|
||||||
|
- Steve Sexton
|
||||||
|
- Arkady Shapkin
|
||||||
|
- Ali Sherief
|
||||||
|
- Yoshiki Shibukawa
|
||||||
|
- Dmitri Shuralyov
|
||||||
|
- Joao da Silva
|
||||||
|
- Daniel Sieger
|
||||||
|
- Daniel Skorupski
|
||||||
|
- Slemmie
|
||||||
|
- 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
|
||||||
|
- Sergey Tikhomirov
|
||||||
|
- Arthur Tombs
|
||||||
|
- TronicLabs
|
||||||
|
- Ioannis Tsakpinis
|
||||||
|
- Samuli Tuomola
|
||||||
|
- Matthew Turner
|
||||||
|
- urraka
|
||||||
|
- Elias Vanderstuyft
|
||||||
|
- Stef Velzel
|
||||||
|
- Jari Vetoniemi
|
||||||
|
- Ricardo Vieira
|
||||||
|
- Nicholas Vitovitch
|
||||||
|
- Simon Voordouw
|
||||||
|
- Corentin Wallez
|
||||||
|
- Torsten Walluhn
|
||||||
|
- Patrick Walton
|
||||||
|
- Xo Wang
|
||||||
|
- Jay Weisskopf
|
||||||
|
- Frank Wille
|
||||||
|
- Richard A. Wilkes
|
||||||
|
- Tatsuya Yatagawa
|
||||||
|
- Ryogo Yoshimura
|
||||||
|
- Rácz Zalán
|
||||||
|
- 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
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
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
|
||||||
|
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.
|
||||||
|
|
|
@ -0,0 +1,211 @@
|
||||||
|
# GLFW
|
||||||
|
|
||||||
|
[![Build status](https://github.com/glfw/glfw/actions/workflows/build.yml/badge.svg)](https://github.com/glfw/glfw/actions)
|
||||||
|
[![Build status](https://ci.appveyor.com/api/projects/status/0kf0ct9831i5l6sp/branch/master?svg=true)](https://ci.appveyor.com/project/elmindreda/glfw)
|
||||||
|
[![Coverity Scan](https://scan.coverity.com/projects/4884/badge.svg)](https://scan.coverity.com/projects/glfw-glfw)
|
||||||
|
|
||||||
|
## Introduction
|
||||||
|
|
||||||
|
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. On
|
||||||
|
Linux both X11 and Wayland are supported.
|
||||||
|
|
||||||
|
GLFW is licensed under the [zlib/libpng
|
||||||
|
license](https://www.glfw.org/license.html).
|
||||||
|
|
||||||
|
You can [download](https://www.glfw.org/download.html) the latest stable release
|
||||||
|
as source or Windows binaries, or fetch the `latest` branch from GitHub. Each
|
||||||
|
release starting with 3.0 also has a corresponding [annotated
|
||||||
|
tag](https://github.com/glfw/glfw/releases) with source and binary archives.
|
||||||
|
|
||||||
|
The [documentation](https://www.glfw.org/docs/latest/) is available online and is
|
||||||
|
included in all source and binary archives. See the [release
|
||||||
|
notes](https://www.glfw.org/docs/latest/news.html) for new features, caveats and
|
||||||
|
deprecations in the latest release. For more details see the [version
|
||||||
|
history](https://www.glfw.org/changelog.html).
|
||||||
|
|
||||||
|
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](https://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](https://www.glfw.org/docs/latest/moving.html) for moving to the GLFW
|
||||||
|
3 API.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
|
||||||
|
## Compiling GLFW
|
||||||
|
|
||||||
|
GLFW itself requires only the headers and libraries for your OS and 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](https://www.glfw.org/download.html)
|
||||||
|
available for all supported compilers.
|
||||||
|
|
||||||
|
See the [compilation guide](https://www.glfw.org/docs/latest/compile.html) for
|
||||||
|
more information about how to compile GLFW yourself.
|
||||||
|
|
||||||
|
|
||||||
|
## Using GLFW
|
||||||
|
|
||||||
|
See the [documentation](https://www.glfw.org/docs/latest/) for tutorials, 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.
|
||||||
|
|
||||||
|
|
||||||
|
## System requirements
|
||||||
|
|
||||||
|
GLFW supports Windows XP and later and macOS 10.8 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](https://www.glfw.org/docs/latest/compat.html)
|
||||||
|
in the documentation for more information.
|
||||||
|
|
||||||
|
|
||||||
|
## Dependencies
|
||||||
|
|
||||||
|
GLFW itself depends only on the headers and libraries for your window system.
|
||||||
|
|
||||||
|
The (experimental) Wayland backend also depends on the `extra-cmake-modules`
|
||||||
|
package, which is used to generate Wayland protocol headers.
|
||||||
|
|
||||||
|
The examples and test programs depend on a number of tiny libraries. These are
|
||||||
|
located in the `deps/` directory.
|
||||||
|
|
||||||
|
- [getopt\_port](https://github.com/kimgr/getopt_port/) for examples
|
||||||
|
with command-line options
|
||||||
|
- [TinyCThread](https://github.com/tinycthread/tinycthread) for threaded
|
||||||
|
examples
|
||||||
|
- [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/Immediate-Mode-UI/Nuklear) for test and example UI
|
||||||
|
- [stb\_image\_write](https://github.com/nothings/stb) for writing images to disk
|
||||||
|
|
||||||
|
The documentation is generated with [Doxygen](https://doxygen.org/) if CMake can
|
||||||
|
find that tool.
|
||||||
|
|
||||||
|
|
||||||
|
## 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/docs/CONTRIBUTING.md) for
|
||||||
|
information on what to include when reporting a bug.
|
||||||
|
|
||||||
|
|
||||||
|
## Changelog
|
||||||
|
|
||||||
|
- Added `GLFW_NATIVE_INCLUDE_NONE` for disabling inclusion of native headers (#1348)
|
||||||
|
- Bugfix: `glfwMakeContextCurrent` would access TLS slot before initialization
|
||||||
|
- Bugfix: `glfwSetGammaRamp` could emit `GLFW_INVALID_VALUE` before initialization
|
||||||
|
- Bugfix: `glfwGetJoystickUserPointer` returned `NULL` during disconnection (#2092)
|
||||||
|
- [Win32] Bugfix: `Alt+PrtSc` would emit `GLFW_KEY_UNKNOWN` and a different
|
||||||
|
scancode than `PrtSc` (#1993)
|
||||||
|
- [Win32] Bugfix: `GLFW_KEY_PAUSE` scancode from `glfwGetKeyScancode` did not
|
||||||
|
match event scancode (#1993)
|
||||||
|
- [Win32] Bugfix: Instance-local operations used executable instance (#469,#1296,#1395)
|
||||||
|
- [Win32] Bugfix: The OSMesa library was not unloaded on termination
|
||||||
|
- [Win32] Bugfix: Right shift emitted `GLFW_KEY_UNKNOWN` when using a CJK IME (#2050)
|
||||||
|
- [Cocoa] Disabled macOS fullscreen when `GLFW_RESIZABLE` is false
|
||||||
|
- [Cocoa] Bugfix: A connected Apple AirPlay would emit a useless error (#1791)
|
||||||
|
- [Cocoa] Bugfix: The EGL and OSMesa libraries were not unloaded on termination
|
||||||
|
- [Cocoa] Bugfix: `GLFW_MAXIMIZED` was always true when `GLFW_RESIZABLE` was false
|
||||||
|
- [Cocoa] Bugfix: Changing `GLFW_DECORATED` in macOS fullscreen would abort
|
||||||
|
application (#1886)
|
||||||
|
- [Cocoa] Bugfix: Setting a monitor from macOS fullscreen would abort
|
||||||
|
application (#2110)
|
||||||
|
- [Cocoa] Bugfix: The Vulkan loader was not loaded from the `Frameworks` bundle
|
||||||
|
subdirectory (#2113,#2120)
|
||||||
|
- [X11] Bugfix: The OSMesa libray was not unloaded on termination
|
||||||
|
- [X11] Bugfix: A malformed response during selection transfer could cause a segfault
|
||||||
|
- [X11] Bugfix: Some calls would reset Xlib to the default error handler (#2108)
|
||||||
|
- [Wayland] Added support for file path drop events (#2040)
|
||||||
|
- [Wayland] Added support for more human-readable monitor names where available
|
||||||
|
- [Wayland] Removed support for the deprecated wl\_shell protocol
|
||||||
|
- [Wayland] Bugfix: `glfwSetClipboardString` would fail if set to result of
|
||||||
|
`glfwGetClipboardString`
|
||||||
|
- [Wayland] Bugfix: Data source creation error would cause double free at termination
|
||||||
|
- [Wayland] Bugfix: Partial writes of clipboard string would cause beginning to repeat
|
||||||
|
- [Wayland] Bugfix: Some errors would cause clipboard string transfer to hang
|
||||||
|
- [Wayland] Bugfix: Drag and drop data was misinterpreted as clipboard string
|
||||||
|
- [Wayland] Bugfix: MIME type matching was not performed for clipboard string
|
||||||
|
- [Wayland] Bugfix: The OSMesa library was not unloaded on termination
|
||||||
|
- [Wayland] Bugfix: `glfwCreateWindow` could emit `GLFW_PLATFORM_ERROR`
|
||||||
|
- [Wayland] Bugfix: Lock key modifier bits were only set when lock keys were pressed
|
||||||
|
- [Wayland] Bugfix: A window leaving full screen mode would be iconified (#1995)
|
||||||
|
- [Wayland] Bugfix: A window leaving full screen mode ignored its desired size
|
||||||
|
- [Wayland] Bugfix: `glfwSetWindowMonitor` did not update windowed mode size
|
||||||
|
- [Wayland] Bugfix: `glfwRestoreWindow` would make a full screen window windowed
|
||||||
|
- [Wayland] Bugfix: A window maximized or restored by the user would enter an
|
||||||
|
inconsistent state
|
||||||
|
- [Wayland] Bugfix: Window maximization events were not emitted
|
||||||
|
- [Wayland] Bugfix: `glfwRestoreWindow` assumed it was always in windowed mode
|
||||||
|
- [Wayland] Bugfix: `glfwSetWindowSize` would resize a full screen window
|
||||||
|
- [Wayland] Bugfix: A window content scale event would be emitted every time
|
||||||
|
the window resized
|
||||||
|
- [Wayland] Bugfix: If `glfwInit` failed it would close stdin
|
||||||
|
- [Wayland] Bugfix: Manual resizing with fallback decorations behaved erratically
|
||||||
|
(#1991,#2115,#2127)
|
||||||
|
- [Wayland] Bugfix: Size limits included frame size for fallback decorations
|
||||||
|
- [Wayland] Bugfix: Updating `GLFW_DECORATED` had no effect on server-side
|
||||||
|
decorations
|
||||||
|
- [Wayland] Bugfix: A monitor would be reported as connected again if its scale
|
||||||
|
changed
|
||||||
|
- [Wayland] Bugfix: `glfwTerminate` would segfault if any monitor had changed
|
||||||
|
scale
|
||||||
|
- [Wayland] Bugfix: Window content scale events were not emitted when monitor
|
||||||
|
scale changed
|
||||||
|
- [Wayland] Bugfix: `glfwSetWindowAspectRatio` reported an error instead of
|
||||||
|
applying the specified ratio
|
||||||
|
- [Wayland] Bugfix: `GLFW_MAXIMIZED` window hint had no effect
|
||||||
|
- [Wayland] Bugfix: `glfwRestoreWindow` had no effect before first show
|
||||||
|
- [Wayland] Bugfix: Hiding and then showing a window caused program abort on
|
||||||
|
wlroots compositors (#1268)
|
||||||
|
- [Wayland] Bugfix: `GLFW_DECORATED` was ignored when showing a window with XDG
|
||||||
|
decorations
|
||||||
|
|
||||||
|
|
||||||
|
## Contact
|
||||||
|
|
||||||
|
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](https://discourse.glfw.org/), and the `#glfw` IRC channel on
|
||||||
|
[Libera.Chat](https://libera.chat/).
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
|
||||||
|
if (NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
|
||||||
|
message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
file(READ "@CMAKE_CURRENT_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()
|
||||||
|
|
|
@ -0,0 +1,230 @@
|
||||||
|
/* Copyright (c) 2012, Kim Gräsman
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* * Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
* * Neither the name of Kim Gräsman nor the names of contributors may be used
|
||||||
|
* to endorse or promote products derived from this software without specific
|
||||||
|
* prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL KIM GRÄSMAN BE LIABLE FOR ANY DIRECT,
|
||||||
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "getopt.h"
|
||||||
|
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
const int no_argument = 0;
|
||||||
|
const int required_argument = 1;
|
||||||
|
const int optional_argument = 2;
|
||||||
|
|
||||||
|
char* optarg;
|
||||||
|
int optopt;
|
||||||
|
/* The variable optind [...] shall be initialized to 1 by the system. */
|
||||||
|
int optind = 1;
|
||||||
|
int opterr;
|
||||||
|
|
||||||
|
static char* optcursor = NULL;
|
||||||
|
|
||||||
|
/* Implemented based on [1] and [2] for optional arguments.
|
||||||
|
optopt is handled FreeBSD-style, per [3].
|
||||||
|
Other GNU and FreeBSD extensions are purely accidental.
|
||||||
|
|
||||||
|
[1] http://pubs.opengroup.org/onlinepubs/000095399/functions/getopt.html
|
||||||
|
[2] http://www.kernel.org/doc/man-pages/online/pages/man3/getopt.3.html
|
||||||
|
[3] http://www.freebsd.org/cgi/man.cgi?query=getopt&sektion=3&manpath=FreeBSD+9.0-RELEASE
|
||||||
|
*/
|
||||||
|
int getopt(int argc, char* const argv[], const char* optstring) {
|
||||||
|
int optchar = -1;
|
||||||
|
const char* optdecl = NULL;
|
||||||
|
|
||||||
|
optarg = NULL;
|
||||||
|
opterr = 0;
|
||||||
|
optopt = 0;
|
||||||
|
|
||||||
|
/* Unspecified, but we need it to avoid overrunning the argv bounds. */
|
||||||
|
if (optind >= argc)
|
||||||
|
goto no_more_optchars;
|
||||||
|
|
||||||
|
/* If, when getopt() is called argv[optind] is a null pointer, getopt()
|
||||||
|
shall return -1 without changing optind. */
|
||||||
|
if (argv[optind] == NULL)
|
||||||
|
goto no_more_optchars;
|
||||||
|
|
||||||
|
/* If, when getopt() is called *argv[optind] is not the character '-',
|
||||||
|
getopt() shall return -1 without changing optind. */
|
||||||
|
if (*argv[optind] != '-')
|
||||||
|
goto no_more_optchars;
|
||||||
|
|
||||||
|
/* If, when getopt() is called argv[optind] points to the string "-",
|
||||||
|
getopt() shall return -1 without changing optind. */
|
||||||
|
if (strcmp(argv[optind], "-") == 0)
|
||||||
|
goto no_more_optchars;
|
||||||
|
|
||||||
|
/* If, when getopt() is called argv[optind] points to the string "--",
|
||||||
|
getopt() shall return -1 after incrementing optind. */
|
||||||
|
if (strcmp(argv[optind], "--") == 0) {
|
||||||
|
++optind;
|
||||||
|
goto no_more_optchars;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (optcursor == NULL || *optcursor == '\0')
|
||||||
|
optcursor = argv[optind] + 1;
|
||||||
|
|
||||||
|
optchar = *optcursor;
|
||||||
|
|
||||||
|
/* FreeBSD: The variable optopt saves the last known option character
|
||||||
|
returned by getopt(). */
|
||||||
|
optopt = optchar;
|
||||||
|
|
||||||
|
/* The getopt() function shall return the next option character (if one is
|
||||||
|
found) from argv that matches a character in optstring, if there is
|
||||||
|
one that matches. */
|
||||||
|
optdecl = strchr(optstring, optchar);
|
||||||
|
if (optdecl) {
|
||||||
|
/* [I]f a character is followed by a colon, the option takes an
|
||||||
|
argument. */
|
||||||
|
if (optdecl[1] == ':') {
|
||||||
|
optarg = ++optcursor;
|
||||||
|
if (*optarg == '\0') {
|
||||||
|
/* GNU extension: Two colons mean an option takes an
|
||||||
|
optional arg; if there is text in the current argv-element
|
||||||
|
(i.e., in the same word as the option name itself, for example,
|
||||||
|
"-oarg"), then it is returned in optarg, otherwise optarg is set
|
||||||
|
to zero. */
|
||||||
|
if (optdecl[2] != ':') {
|
||||||
|
/* If the option was the last character in the string pointed to by
|
||||||
|
an element of argv, then optarg shall contain the next element
|
||||||
|
of argv, and optind shall be incremented by 2. If the resulting
|
||||||
|
value of optind is greater than argc, this indicates a missing
|
||||||
|
option-argument, and getopt() shall return an error indication.
|
||||||
|
|
||||||
|
Otherwise, optarg shall point to the string following the
|
||||||
|
option character in that element of argv, and optind shall be
|
||||||
|
incremented by 1.
|
||||||
|
*/
|
||||||
|
if (++optind < argc) {
|
||||||
|
optarg = argv[optind];
|
||||||
|
} else {
|
||||||
|
/* If it detects a missing option-argument, it shall return the
|
||||||
|
colon character ( ':' ) if the first character of optstring
|
||||||
|
was a colon, or a question-mark character ( '?' ) otherwise.
|
||||||
|
*/
|
||||||
|
optarg = NULL;
|
||||||
|
optchar = (optstring[0] == ':') ? ':' : '?';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
optarg = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
optcursor = NULL;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
/* If getopt() encounters an option character that is not contained in
|
||||||
|
optstring, it shall return the question-mark ( '?' ) character. */
|
||||||
|
optchar = '?';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (optcursor == NULL || *++optcursor == '\0')
|
||||||
|
++optind;
|
||||||
|
|
||||||
|
return optchar;
|
||||||
|
|
||||||
|
no_more_optchars:
|
||||||
|
optcursor = NULL;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Implementation based on [1].
|
||||||
|
|
||||||
|
[1] http://www.kernel.org/doc/man-pages/online/pages/man3/getopt.3.html
|
||||||
|
*/
|
||||||
|
int getopt_long(int argc, char* const argv[], const char* optstring,
|
||||||
|
const struct option* longopts, int* longindex) {
|
||||||
|
const struct option* o = longopts;
|
||||||
|
const struct option* match = NULL;
|
||||||
|
int num_matches = 0;
|
||||||
|
size_t argument_name_length = 0;
|
||||||
|
const char* current_argument = NULL;
|
||||||
|
int retval = -1;
|
||||||
|
|
||||||
|
optarg = NULL;
|
||||||
|
optopt = 0;
|
||||||
|
|
||||||
|
if (optind >= argc)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
if (strlen(argv[optind]) < 3 || strncmp(argv[optind], "--", 2) != 0)
|
||||||
|
return getopt(argc, argv, optstring);
|
||||||
|
|
||||||
|
/* It's an option; starts with -- and is longer than two chars. */
|
||||||
|
current_argument = argv[optind] + 2;
|
||||||
|
argument_name_length = strcspn(current_argument, "=");
|
||||||
|
for (; o->name; ++o) {
|
||||||
|
if (strncmp(o->name, current_argument, argument_name_length) == 0) {
|
||||||
|
match = o;
|
||||||
|
++num_matches;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (num_matches == 1) {
|
||||||
|
/* If longindex is not NULL, it points to a variable which is set to the
|
||||||
|
index of the long option relative to longopts. */
|
||||||
|
if (longindex)
|
||||||
|
*longindex = (int) (match - longopts);
|
||||||
|
|
||||||
|
/* If flag is NULL, then getopt_long() shall return val.
|
||||||
|
Otherwise, getopt_long() returns 0, and flag shall point to a variable
|
||||||
|
which shall be set to val if the option is found, but left unchanged if
|
||||||
|
the option is not found. */
|
||||||
|
if (match->flag)
|
||||||
|
*(match->flag) = match->val;
|
||||||
|
|
||||||
|
retval = match->flag ? 0 : match->val;
|
||||||
|
|
||||||
|
if (match->has_arg != no_argument) {
|
||||||
|
optarg = strchr(argv[optind], '=');
|
||||||
|
if (optarg != NULL)
|
||||||
|
++optarg;
|
||||||
|
|
||||||
|
if (match->has_arg == required_argument) {
|
||||||
|
/* Only scan the next argv for required arguments. Behavior is not
|
||||||
|
specified, but has been observed with Ubuntu and Mac OSX. */
|
||||||
|
if (optarg == NULL && ++optind < argc) {
|
||||||
|
optarg = argv[optind];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (optarg == NULL)
|
||||||
|
retval = ':';
|
||||||
|
}
|
||||||
|
} else if (strchr(argv[optind], '=')) {
|
||||||
|
/* An argument was provided to a non-argument option.
|
||||||
|
I haven't seen this specified explicitly, but both GNU and BSD-based
|
||||||
|
implementations show this behavior.
|
||||||
|
*/
|
||||||
|
retval = '?';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
/* Unknown option or ambiguous match. */
|
||||||
|
retval = '?';
|
||||||
|
}
|
||||||
|
|
||||||
|
++optind;
|
||||||
|
return retval;
|
||||||
|
}
|
|
@ -0,0 +1,57 @@
|
||||||
|
/* Copyright (c) 2012, Kim Gräsman
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
* * Redistributions of source code must retain the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer.
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
* * Neither the name of Kim Gräsman nor the names of contributors may be used
|
||||||
|
* to endorse or promote products derived from this software without specific
|
||||||
|
* prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL KIM GRÄSMAN BE LIABLE FOR ANY DIRECT,
|
||||||
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef INCLUDED_GETOPT_PORT_H
|
||||||
|
#define INCLUDED_GETOPT_PORT_H
|
||||||
|
|
||||||
|
#if defined(__cplusplus)
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
extern const int no_argument;
|
||||||
|
extern const int required_argument;
|
||||||
|
extern const int optional_argument;
|
||||||
|
|
||||||
|
extern char* optarg;
|
||||||
|
extern int optind, opterr, optopt;
|
||||||
|
|
||||||
|
struct option {
|
||||||
|
const char* name;
|
||||||
|
int has_arg;
|
||||||
|
int* flag;
|
||||||
|
int val;
|
||||||
|
};
|
||||||
|
|
||||||
|
int getopt(int argc, char* const argv[], const char* optstring);
|
||||||
|
|
||||||
|
int getopt_long(int argc, char* const argv[],
|
||||||
|
const char* optstring, const struct option* longopts, int* longindex);
|
||||||
|
|
||||||
|
#if defined(__cplusplus)
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // INCLUDED_GETOPT_PORT_H
|
|
@ -0,0 +1,282 @@
|
||||||
|
#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 <KHR/khrplatform.h>
|
||||||
|
* 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_APIENTRY
|
||||||
|
* KHRONOS_APIATTRIBUTES
|
||||||
|
*
|
||||||
|
* These may be used in function prototypes as:
|
||||||
|
*
|
||||||
|
* KHRONOS_APICALL void KHRONOS_APIENTRY funcname(
|
||||||
|
* int arg1,
|
||||||
|
* int arg2) KHRONOS_APIATTRIBUTES;
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*-------------------------------------------------------------------------
|
||||||
|
* Definition of KHRONOS_APICALL
|
||||||
|
*-------------------------------------------------------------------------
|
||||||
|
* This precedes the return type of the function in the function prototype.
|
||||||
|
*/
|
||||||
|
#if defined(_WIN32) && !defined(__SCITECH_SNAP__)
|
||||||
|
# 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_APIENTRY
|
||||||
|
*-------------------------------------------------------------------------
|
||||||
|
* 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_APIENTRY __stdcall
|
||||||
|
#else
|
||||||
|
# define KHRONOS_APIENTRY
|
||||||
|
#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 <stdint.h>
|
||||||
|
*/
|
||||||
|
#include <stdint.h>
|
||||||
|
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 <inttypes.h>
|
||||||
|
*/
|
||||||
|
#include <inttypes.h>
|
||||||
|
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 <stdint.h>
|
||||||
|
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_ */
|
|
@ -0,0 +1,84 @@
|
||||||
|
/* */
|
||||||
|
/* 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 <stddef.h>
|
||||||
|
#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 <stdint.h>
|
||||||
|
#endif
|
||||||
|
#endif /* !defined(VK_NO_STDINT_H) */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
} /* extern "C" */
|
||||||
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,733 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <glad/vulkan.h>
|
||||||
|
|
||||||
|
#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
|
|
@ -0,0 +1,574 @@
|
||||||
|
#ifndef LINMATH_H
|
||||||
|
#define LINMATH_H
|
||||||
|
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#define inline __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) \
|
||||||
|
{ \
|
||||||
|
int i; \
|
||||||
|
for(i=0; i<n; ++i) \
|
||||||
|
r[i] = a[i] + b[i]; \
|
||||||
|
} \
|
||||||
|
static inline void vec##n##_sub(vec##n r, vec##n const a, vec##n const b) \
|
||||||
|
{ \
|
||||||
|
int i; \
|
||||||
|
for(i=0; i<n; ++i) \
|
||||||
|
r[i] = a[i] - b[i]; \
|
||||||
|
} \
|
||||||
|
static inline void vec##n##_scale(vec##n r, vec##n const v, float const s) \
|
||||||
|
{ \
|
||||||
|
int i; \
|
||||||
|
for(i=0; i<n; ++i) \
|
||||||
|
r[i] = v[i] * s; \
|
||||||
|
} \
|
||||||
|
static inline float vec##n##_mul_inner(vec##n const a, vec##n const b) \
|
||||||
|
{ \
|
||||||
|
float p = 0.; \
|
||||||
|
int i; \
|
||||||
|
for(i=0; i<n; ++i) \
|
||||||
|
p += b[i]*a[i]; \
|
||||||
|
return p; \
|
||||||
|
} \
|
||||||
|
static inline float vec##n##_len(vec##n const v) \
|
||||||
|
{ \
|
||||||
|
return (float) sqrt(vec##n##_mul_inner(v,v)); \
|
||||||
|
} \
|
||||||
|
static inline void vec##n##_norm(vec##n r, vec##n const v) \
|
||||||
|
{ \
|
||||||
|
float k = 1.f / vec##n##_len(v); \
|
||||||
|
vec##n##_scale(r, v, k); \
|
||||||
|
}
|
||||||
|
|
||||||
|
LINMATH_H_DEFINE_VEC(2)
|
||||||
|
LINMATH_H_DEFINE_VEC(3)
|
||||||
|
LINMATH_H_DEFINE_VEC(4)
|
||||||
|
|
||||||
|
static inline void vec3_mul_cross(vec3 r, vec3 const a, vec3 const b)
|
||||||
|
{
|
||||||
|
r[0] = a[1]*b[2] - a[2]*b[1];
|
||||||
|
r[1] = a[2]*b[0] - a[0]*b[2];
|
||||||
|
r[2] = a[0]*b[1] - a[1]*b[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void vec3_reflect(vec3 r, vec3 const v, vec3 const n)
|
||||||
|
{
|
||||||
|
float p = 2.f*vec3_mul_inner(v, n);
|
||||||
|
int i;
|
||||||
|
for(i=0;i<3;++i)
|
||||||
|
r[i] = v[i] - p*n[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void vec4_mul_cross(vec4 r, vec4 a, vec4 b)
|
||||||
|
{
|
||||||
|
r[0] = a[1]*b[2] - a[2]*b[1];
|
||||||
|
r[1] = a[2]*b[0] - a[0]*b[2];
|
||||||
|
r[2] = a[0]*b[1] - a[1]*b[0];
|
||||||
|
r[3] = 1.f;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void vec4_reflect(vec4 r, vec4 v, vec4 n)
|
||||||
|
{
|
||||||
|
float p = 2.f*vec4_mul_inner(v, n);
|
||||||
|
int i;
|
||||||
|
for(i=0;i<4;++i)
|
||||||
|
r[i] = v[i] - p*n[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
typedef vec4 mat4x4[4];
|
||||||
|
static inline void mat4x4_identity(mat4x4 M)
|
||||||
|
{
|
||||||
|
int i, j;
|
||||||
|
for(i=0; i<4; ++i)
|
||||||
|
for(j=0; j<4; ++j)
|
||||||
|
M[i][j] = i==j ? 1.f : 0.f;
|
||||||
|
}
|
||||||
|
static inline void mat4x4_dup(mat4x4 M, mat4x4 N)
|
||||||
|
{
|
||||||
|
int i, j;
|
||||||
|
for(i=0; i<4; ++i)
|
||||||
|
for(j=0; j<4; ++j)
|
||||||
|
M[i][j] = N[i][j];
|
||||||
|
}
|
||||||
|
static inline void mat4x4_row(vec4 r, mat4x4 M, int i)
|
||||||
|
{
|
||||||
|
int k;
|
||||||
|
for(k=0; k<4; ++k)
|
||||||
|
r[k] = M[k][i];
|
||||||
|
}
|
||||||
|
static inline void mat4x4_col(vec4 r, mat4x4 M, int i)
|
||||||
|
{
|
||||||
|
int k;
|
||||||
|
for(k=0; k<4; ++k)
|
||||||
|
r[k] = M[i][k];
|
||||||
|
}
|
||||||
|
static inline void mat4x4_transpose(mat4x4 M, mat4x4 N)
|
||||||
|
{
|
||||||
|
int i, j;
|
||||||
|
for(j=0; j<4; ++j)
|
||||||
|
for(i=0; i<4; ++i)
|
||||||
|
M[i][j] = N[j][i];
|
||||||
|
}
|
||||||
|
static inline void mat4x4_add(mat4x4 M, mat4x4 a, mat4x4 b)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
for(i=0; i<4; ++i)
|
||||||
|
vec4_add(M[i], a[i], b[i]);
|
||||||
|
}
|
||||||
|
static inline void mat4x4_sub(mat4x4 M, mat4x4 a, mat4x4 b)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
for(i=0; i<4; ++i)
|
||||||
|
vec4_sub(M[i], a[i], b[i]);
|
||||||
|
}
|
||||||
|
static inline void mat4x4_scale(mat4x4 M, mat4x4 a, float k)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
for(i=0; i<4; ++i)
|
||||||
|
vec4_scale(M[i], a[i], k);
|
||||||
|
}
|
||||||
|
static inline void mat4x4_scale_aniso(mat4x4 M, mat4x4 a, float x, float y, float z)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
vec4_scale(M[0], a[0], x);
|
||||||
|
vec4_scale(M[1], a[1], y);
|
||||||
|
vec4_scale(M[2], a[2], z);
|
||||||
|
for(i = 0; i < 4; ++i) {
|
||||||
|
M[3][i] = a[3][i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static inline void mat4x4_mul(mat4x4 M, mat4x4 a, mat4x4 b)
|
||||||
|
{
|
||||||
|
mat4x4 temp;
|
||||||
|
int k, r, c;
|
||||||
|
for(c=0; c<4; ++c) for(r=0; r<4; ++r) {
|
||||||
|
temp[c][r] = 0.f;
|
||||||
|
for(k=0; k<4; ++k)
|
||||||
|
temp[c][r] += a[k][r] * b[c][k];
|
||||||
|
}
|
||||||
|
mat4x4_dup(M, temp);
|
||||||
|
}
|
||||||
|
static inline void mat4x4_mul_vec4(vec4 r, mat4x4 M, vec4 v)
|
||||||
|
{
|
||||||
|
int i, j;
|
||||||
|
for(j=0; j<4; ++j) {
|
||||||
|
r[j] = 0.f;
|
||||||
|
for(i=0; i<4; ++i)
|
||||||
|
r[j] += M[i][j] * v[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static inline void mat4x4_translate(mat4x4 T, float x, float y, float z)
|
||||||
|
{
|
||||||
|
mat4x4_identity(T);
|
||||||
|
T[3][0] = x;
|
||||||
|
T[3][1] = y;
|
||||||
|
T[3][2] = z;
|
||||||
|
}
|
||||||
|
static inline void mat4x4_translate_in_place(mat4x4 M, float x, float y, float z)
|
||||||
|
{
|
||||||
|
vec4 t = {x, y, z, 0};
|
||||||
|
vec4 r;
|
||||||
|
int i;
|
||||||
|
for (i = 0; i < 4; ++i) {
|
||||||
|
mat4x4_row(r, M, i);
|
||||||
|
M[3][i] += vec4_mul_inner(r, t);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static inline void mat4x4_from_vec3_mul_outer(mat4x4 M, vec3 a, vec3 b)
|
||||||
|
{
|
||||||
|
int i, j;
|
||||||
|
for(i=0; i<4; ++i) for(j=0; j<4; ++j)
|
||||||
|
M[i][j] = i<3 && j<3 ? a[i] * b[j] : 0.f;
|
||||||
|
}
|
||||||
|
static inline void mat4x4_rotate(mat4x4 R, mat4x4 M, float x, float y, float z, float angle)
|
||||||
|
{
|
||||||
|
float s = sinf(angle);
|
||||||
|
float c = cosf(angle);
|
||||||
|
vec3 u = {x, y, z};
|
||||||
|
|
||||||
|
if(vec3_len(u) > 1e-4) {
|
||||||
|
mat4x4 T, C, S = {{0}};
|
||||||
|
|
||||||
|
vec3_norm(u, u);
|
||||||
|
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_scale(S, S, s);
|
||||||
|
|
||||||
|
mat4x4_identity(C);
|
||||||
|
mat4x4_sub(C, C, T);
|
||||||
|
|
||||||
|
mat4x4_scale(C, C, c);
|
||||||
|
|
||||||
|
mat4x4_add(T, T, C);
|
||||||
|
mat4x4_add(T, T, S);
|
||||||
|
|
||||||
|
T[3][3] = 1.;
|
||||||
|
mat4x4_mul(R, M, T);
|
||||||
|
} else {
|
||||||
|
mat4x4_dup(R, M);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static inline void mat4x4_rotate_X(mat4x4 Q, mat4x4 M, float angle)
|
||||||
|
{
|
||||||
|
float s = sinf(angle);
|
||||||
|
float c = cosf(angle);
|
||||||
|
mat4x4 R = {
|
||||||
|
{1.f, 0.f, 0.f, 0.f},
|
||||||
|
{0.f, c, s, 0.f},
|
||||||
|
{0.f, -s, c, 0.f},
|
||||||
|
{0.f, 0.f, 0.f, 1.f}
|
||||||
|
};
|
||||||
|
mat4x4_mul(Q, M, R);
|
||||||
|
}
|
||||||
|
static inline void mat4x4_rotate_Y(mat4x4 Q, mat4x4 M, float angle)
|
||||||
|
{
|
||||||
|
float s = sinf(angle);
|
||||||
|
float c = cosf(angle);
|
||||||
|
mat4x4 R = {
|
||||||
|
{ c, 0.f, -s, 0.f},
|
||||||
|
{ 0.f, 1.f, 0.f, 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)
|
||||||
|
{
|
||||||
|
float s = sinf(angle);
|
||||||
|
float c = cosf(angle);
|
||||||
|
mat4x4 R = {
|
||||||
|
{ c, s, 0.f, 0.f},
|
||||||
|
{ -s, c, 0.f, 0.f},
|
||||||
|
{ 0.f, 0.f, 1.f, 0.f},
|
||||||
|
{ 0.f, 0.f, 0.f, 1.f}
|
||||||
|
};
|
||||||
|
mat4x4_mul(Q, M, R);
|
||||||
|
}
|
||||||
|
static inline void mat4x4_invert(mat4x4 T, mat4x4 M)
|
||||||
|
{
|
||||||
|
float idet;
|
||||||
|
float s[6];
|
||||||
|
float c[6];
|
||||||
|
s[0] = M[0][0]*M[1][1] - M[1][0]*M[0][1];
|
||||||
|
s[1] = M[0][0]*M[1][2] - M[1][0]*M[0][2];
|
||||||
|
s[2] = M[0][0]*M[1][3] - M[1][0]*M[0][3];
|
||||||
|
s[3] = M[0][1]*M[1][2] - M[1][1]*M[0][2];
|
||||||
|
s[4] = M[0][1]*M[1][3] - M[1][1]*M[0][3];
|
||||||
|
s[5] = M[0][2]*M[1][3] - M[1][2]*M[0][3];
|
||||||
|
|
||||||
|
c[0] = M[2][0]*M[3][1] - M[3][0]*M[2][1];
|
||||||
|
c[1] = M[2][0]*M[3][2] - M[3][0]*M[2][2];
|
||||||
|
c[2] = M[2][0]*M[3][3] - M[3][0]*M[2][3];
|
||||||
|
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] );
|
||||||
|
|
||||||
|
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;
|
||||||
|
T[0][3] = (-M[2][1] * s[5] + M[2][2] * s[4] - M[2][3] * s[3]) * idet;
|
||||||
|
|
||||||
|
T[1][0] = (-M[1][0] * c[5] + M[1][2] * c[2] - M[1][3] * c[1]) * idet;
|
||||||
|
T[1][1] = ( M[0][0] * c[5] - M[0][2] * c[2] + M[0][3] * c[1]) * idet;
|
||||||
|
T[1][2] = (-M[3][0] * s[5] + M[3][2] * s[2] - M[3][3] * s[1]) * idet;
|
||||||
|
T[1][3] = ( M[2][0] * s[5] - M[2][2] * s[2] + M[2][3] * s[1]) * idet;
|
||||||
|
|
||||||
|
T[2][0] = ( M[1][0] * c[4] - M[1][1] * c[2] + M[1][3] * c[0]) * idet;
|
||||||
|
T[2][1] = (-M[0][0] * c[4] + M[0][1] * c[2] - M[0][3] * c[0]) * idet;
|
||||||
|
T[2][2] = ( M[3][0] * s[4] - M[3][1] * s[2] + M[3][3] * s[0]) * idet;
|
||||||
|
T[2][3] = (-M[2][0] * s[4] + M[2][1] * s[2] - M[2][3] * s[0]) * idet;
|
||||||
|
|
||||||
|
T[3][0] = (-M[1][0] * c[3] + M[1][1] * c[1] - M[1][2] * c[0]) * idet;
|
||||||
|
T[3][1] = ( M[0][0] * c[3] - M[0][1] * c[1] + M[0][2] * c[0]) * idet;
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
float s = 1.;
|
||||||
|
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]);
|
||||||
|
|
||||||
|
s = vec3_mul_inner(R[1], R[2]);
|
||||||
|
vec3_scale(h, R[2], s);
|
||||||
|
vec3_sub(R[1], R[1], h);
|
||||||
|
vec3_norm(R[1], R[1]);
|
||||||
|
|
||||||
|
s = vec3_mul_inner(R[0], R[1]);
|
||||||
|
vec3_scale(h, R[1], s);
|
||||||
|
vec3_sub(R[0], R[0], h);
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
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;
|
||||||
|
|
||||||
|
M[2][0] = (r+l)/(r-l);
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
M[0][0] = 2.f/(r-l);
|
||||||
|
M[0][1] = M[0][2] = M[0][3] = 0.f;
|
||||||
|
|
||||||
|
M[1][1] = 2.f/(t-b);
|
||||||
|
M[1][0] = M[1][2] = M[1][3] = 0.f;
|
||||||
|
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
/* 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);
|
||||||
|
|
||||||
|
m[0][0] = a / aspect;
|
||||||
|
m[0][1] = 0.f;
|
||||||
|
m[0][2] = 0.f;
|
||||||
|
m[0][3] = 0.f;
|
||||||
|
|
||||||
|
m[1][0] = 0.f;
|
||||||
|
m[1][1] = a;
|
||||||
|
m[1][2] = 0.f;
|
||||||
|
m[1][3] = 0.f;
|
||||||
|
|
||||||
|
m[2][0] = 0.f;
|
||||||
|
m[2][1] = 0.f;
|
||||||
|
m[2][2] = -((f + n) / (f - n));
|
||||||
|
m[2][3] = -1.f;
|
||||||
|
|
||||||
|
m[3][0] = 0.f;
|
||||||
|
m[3][1] = 0.f;
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
/* Adapted from Android's OpenGL Matrix.java. */
|
||||||
|
/* See the OpenGL GLUT documentation for gluLookAt for a description */
|
||||||
|
/* of the algorithm. We implement it in a straightforward way: */
|
||||||
|
|
||||||
|
/* 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 s;
|
||||||
|
vec3 t;
|
||||||
|
|
||||||
|
vec3_sub(f, center, eye);
|
||||||
|
vec3_norm(f, f);
|
||||||
|
|
||||||
|
vec3_mul_cross(s, f, up);
|
||||||
|
vec3_norm(s, s);
|
||||||
|
|
||||||
|
vec3_mul_cross(t, s, f);
|
||||||
|
|
||||||
|
m[0][0] = s[0];
|
||||||
|
m[0][1] = t[0];
|
||||||
|
m[0][2] = -f[0];
|
||||||
|
m[0][3] = 0.f;
|
||||||
|
|
||||||
|
m[1][0] = s[1];
|
||||||
|
m[1][1] = t[1];
|
||||||
|
m[1][2] = -f[1];
|
||||||
|
m[1][3] = 0.f;
|
||||||
|
|
||||||
|
m[2][0] = s[2];
|
||||||
|
m[2][1] = t[2];
|
||||||
|
m[2][2] = -f[2];
|
||||||
|
m[2][3] = 0.f;
|
||||||
|
|
||||||
|
m[3][0] = 0.f;
|
||||||
|
m[3][1] = 0.f;
|
||||||
|
m[3][2] = 0.f;
|
||||||
|
m[3][3] = 1.f;
|
||||||
|
|
||||||
|
mat4x4_translate_in_place(m, -eye[0], -eye[1], -eye[2]);
|
||||||
|
}
|
||||||
|
|
||||||
|
typedef float quat[4];
|
||||||
|
static inline 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)
|
||||||
|
{
|
||||||
|
vec3 w;
|
||||||
|
vec3_mul_cross(r, p, q);
|
||||||
|
vec3_scale(w, p, q[3]);
|
||||||
|
vec3_add(r, r, w);
|
||||||
|
vec3_scale(w, q, p[3]);
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
#define quat_norm vec4_norm
|
||||||
|
static inline void quat_mul_vec3(vec3 r, quat q, vec3 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 u = {q[0], q[1], q[2]};
|
||||||
|
|
||||||
|
vec3_mul_cross(t, t, v);
|
||||||
|
vec3_scale(t, t, 2);
|
||||||
|
|
||||||
|
vec3_mul_cross(u, u, 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)
|
||||||
|
{
|
||||||
|
float a = q[3];
|
||||||
|
float b = q[0];
|
||||||
|
float c = q[1];
|
||||||
|
float d = q[2];
|
||||||
|
float a2 = a*a;
|
||||||
|
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);
|
||||||
|
M[0][3] = 0.f;
|
||||||
|
|
||||||
|
M[1][0] = 2*(b*c - a*d);
|
||||||
|
M[1][1] = a2 - b2 + c2 - d2;
|
||||||
|
M[1][2] = 2.f*(c*d + a*b);
|
||||||
|
M[1][3] = 0.f;
|
||||||
|
|
||||||
|
M[2][0] = 2.f*(b*d + a*c);
|
||||||
|
M[2][1] = 2.f*(c*d - a*b);
|
||||||
|
M[2][2] = a2 - b2 - c2 + d2;
|
||||||
|
M[2][3] = 0.f;
|
||||||
|
|
||||||
|
M[3][0] = M[3][1] = M[3][2] = 0.f;
|
||||||
|
M[3][3] = 1.f;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void mat4x4o_mul_quat(mat4x4 R, mat4x4 M, quat q)
|
||||||
|
{
|
||||||
|
/* XXX: The way this is written only works for othogonal 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;
|
||||||
|
}
|
||||||
|
static inline void quat_from_mat4x4(quat q, mat4x4 M)
|
||||||
|
{
|
||||||
|
float r=0.f;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
int perm[] = { 0, 1, 2, 0, 1 };
|
||||||
|
int *p = perm;
|
||||||
|
|
||||||
|
for(i = 0; i<3; i++) {
|
||||||
|
float m = M[i][i];
|
||||||
|
if( m < r )
|
||||||
|
continue;
|
||||||
|
m = r;
|
||||||
|
p = &perm[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
r = (float) sqrt(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;
|
||||||
|
q[1] = q[2] = q[3] = 0.f;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
q[0] = r/2.f;
|
||||||
|
q[1] = (M[p[0]][p[1]] - M[p[1]][p[0]])/(2.f*r);
|
||||||
|
q[2] = (M[p[2]][p[0]] - M[p[0]][p[2]])/(2.f*r);
|
||||||
|
q[3] = (M[p[2]][p[1]] - M[p[1]][p[2]])/(2.f*r);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,117 @@
|
||||||
|
/**
|
||||||
|
* This file has no copyright assigned and is placed in the Public Domain.
|
||||||
|
* This file is part of the mingw-w64 runtime package.
|
||||||
|
* No warranty is given; refer to the file DISCLAIMER within this package.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS)
|
||||||
|
#define NONAMELESSUNION 1
|
||||||
|
#endif
|
||||||
|
#if defined(NONAMELESSSTRUCT) && \
|
||||||
|
!defined(NONAMELESSUNION)
|
||||||
|
#define NONAMELESSUNION 1
|
||||||
|
#endif
|
||||||
|
#if defined(NONAMELESSUNION) && \
|
||||||
|
!defined(NONAMELESSSTRUCT)
|
||||||
|
#define NONAMELESSSTRUCT 1
|
||||||
|
#endif
|
||||||
|
#if !defined(__GNU_EXTENSION)
|
||||||
|
#if defined(__GNUC__) || defined(__GNUG__)
|
||||||
|
#define __GNU_EXTENSION __extension__
|
||||||
|
#else
|
||||||
|
#define __GNU_EXTENSION
|
||||||
|
#endif
|
||||||
|
#endif /* __extension__ */
|
||||||
|
|
||||||
|
#ifndef __ANONYMOUS_DEFINED
|
||||||
|
#define __ANONYMOUS_DEFINED
|
||||||
|
#if defined(__GNUC__) || defined(__GNUG__)
|
||||||
|
#define _ANONYMOUS_UNION __extension__
|
||||||
|
#define _ANONYMOUS_STRUCT __extension__
|
||||||
|
#else
|
||||||
|
#define _ANONYMOUS_UNION
|
||||||
|
#define _ANONYMOUS_STRUCT
|
||||||
|
#endif
|
||||||
|
#ifndef NONAMELESSUNION
|
||||||
|
#define _UNION_NAME(x)
|
||||||
|
#define _STRUCT_NAME(x)
|
||||||
|
#else /* NONAMELESSUNION */
|
||||||
|
#define _UNION_NAME(x) x
|
||||||
|
#define _STRUCT_NAME(x) x
|
||||||
|
#endif
|
||||||
|
#endif /* __ANONYMOUS_DEFINED */
|
||||||
|
|
||||||
|
#ifndef DUMMYUNIONNAME
|
||||||
|
# ifdef NONAMELESSUNION
|
||||||
|
# define DUMMYUNIONNAME u
|
||||||
|
# define DUMMYUNIONNAME1 u1 /* Wine uses this variant */
|
||||||
|
# define DUMMYUNIONNAME2 u2
|
||||||
|
# define DUMMYUNIONNAME3 u3
|
||||||
|
# define DUMMYUNIONNAME4 u4
|
||||||
|
# define DUMMYUNIONNAME5 u5
|
||||||
|
# define DUMMYUNIONNAME6 u6
|
||||||
|
# define DUMMYUNIONNAME7 u7
|
||||||
|
# define DUMMYUNIONNAME8 u8
|
||||||
|
# define DUMMYUNIONNAME9 u9
|
||||||
|
# else /* NONAMELESSUNION */
|
||||||
|
# define DUMMYUNIONNAME
|
||||||
|
# define DUMMYUNIONNAME1 /* Wine uses this variant */
|
||||||
|
# define DUMMYUNIONNAME2
|
||||||
|
# define DUMMYUNIONNAME3
|
||||||
|
# define DUMMYUNIONNAME4
|
||||||
|
# define DUMMYUNIONNAME5
|
||||||
|
# define DUMMYUNIONNAME6
|
||||||
|
# define DUMMYUNIONNAME7
|
||||||
|
# define DUMMYUNIONNAME8
|
||||||
|
# define DUMMYUNIONNAME9
|
||||||
|
# endif
|
||||||
|
#endif /* DUMMYUNIONNAME */
|
||||||
|
|
||||||
|
#if !defined(DUMMYUNIONNAME1) /* MinGW does not define this one */
|
||||||
|
# ifdef NONAMELESSUNION
|
||||||
|
# define DUMMYUNIONNAME1 u1 /* Wine uses this variant */
|
||||||
|
# else
|
||||||
|
# define DUMMYUNIONNAME1 /* Wine uses this variant */
|
||||||
|
# endif
|
||||||
|
#endif /* DUMMYUNIONNAME1 */
|
||||||
|
|
||||||
|
#ifndef DUMMYSTRUCTNAME
|
||||||
|
# ifdef NONAMELESSUNION
|
||||||
|
# define DUMMYSTRUCTNAME s
|
||||||
|
# define DUMMYSTRUCTNAME1 s1 /* Wine uses this variant */
|
||||||
|
# define DUMMYSTRUCTNAME2 s2
|
||||||
|
# define DUMMYSTRUCTNAME3 s3
|
||||||
|
# define DUMMYSTRUCTNAME4 s4
|
||||||
|
# define DUMMYSTRUCTNAME5 s5
|
||||||
|
# else
|
||||||
|
# define DUMMYSTRUCTNAME
|
||||||
|
# define DUMMYSTRUCTNAME1 /* Wine uses this variant */
|
||||||
|
# define DUMMYSTRUCTNAME2
|
||||||
|
# define DUMMYSTRUCTNAME3
|
||||||
|
# define DUMMYSTRUCTNAME4
|
||||||
|
# define DUMMYSTRUCTNAME5
|
||||||
|
# endif
|
||||||
|
#endif /* DUMMYSTRUCTNAME */
|
||||||
|
|
||||||
|
/* These are for compatibility with the Wine source tree */
|
||||||
|
|
||||||
|
#ifndef WINELIB_NAME_AW
|
||||||
|
# ifdef __MINGW_NAME_AW
|
||||||
|
# define WINELIB_NAME_AW __MINGW_NAME_AW
|
||||||
|
# else
|
||||||
|
# ifdef UNICODE
|
||||||
|
# define WINELIB_NAME_AW(func) func##W
|
||||||
|
# else
|
||||||
|
# define WINELIB_NAME_AW(func) func##A
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
#endif /* WINELIB_NAME_AW */
|
||||||
|
|
||||||
|
#ifndef DECL_WINELIB_TYPE_AW
|
||||||
|
# ifdef __MINGW_TYPEDEF_AW
|
||||||
|
# define DECL_WINELIB_TYPE_AW __MINGW_TYPEDEF_AW
|
||||||
|
# else
|
||||||
|
# define DECL_WINELIB_TYPE_AW(type) typedef WINELIB_NAME_AW(type) type;
|
||||||
|
# endif
|
||||||
|
#endif /* DECL_WINELIB_TYPE_AW */
|
||||||
|
|
|
@ -0,0 +1,239 @@
|
||||||
|
/*
|
||||||
|
* The Wine project - Xinput Joystick Library
|
||||||
|
* Copyright 2008 Andrew Fenn
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __WINE_XINPUT_H
|
||||||
|
#define __WINE_XINPUT_H
|
||||||
|
|
||||||
|
#include <windef.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Bitmasks for the joysticks buttons, determines what has
|
||||||
|
* been pressed on the joystick, these need to be mapped
|
||||||
|
* to whatever device you're using instead of an xbox 360
|
||||||
|
* joystick
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define XINPUT_GAMEPAD_DPAD_UP 0x0001
|
||||||
|
#define XINPUT_GAMEPAD_DPAD_DOWN 0x0002
|
||||||
|
#define XINPUT_GAMEPAD_DPAD_LEFT 0x0004
|
||||||
|
#define XINPUT_GAMEPAD_DPAD_RIGHT 0x0008
|
||||||
|
#define XINPUT_GAMEPAD_START 0x0010
|
||||||
|
#define XINPUT_GAMEPAD_BACK 0x0020
|
||||||
|
#define XINPUT_GAMEPAD_LEFT_THUMB 0x0040
|
||||||
|
#define XINPUT_GAMEPAD_RIGHT_THUMB 0x0080
|
||||||
|
#define XINPUT_GAMEPAD_LEFT_SHOULDER 0x0100
|
||||||
|
#define XINPUT_GAMEPAD_RIGHT_SHOULDER 0x0200
|
||||||
|
#define XINPUT_GAMEPAD_A 0x1000
|
||||||
|
#define XINPUT_GAMEPAD_B 0x2000
|
||||||
|
#define XINPUT_GAMEPAD_X 0x4000
|
||||||
|
#define XINPUT_GAMEPAD_Y 0x8000
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Defines the flags used to determine if the user is pushing
|
||||||
|
* down on a button, not holding a button, etc
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define XINPUT_KEYSTROKE_KEYDOWN 0x0001
|
||||||
|
#define XINPUT_KEYSTROKE_KEYUP 0x0002
|
||||||
|
#define XINPUT_KEYSTROKE_REPEAT 0x0004
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Defines the codes which are returned by XInputGetKeystroke
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define VK_PAD_A 0x5800
|
||||||
|
#define VK_PAD_B 0x5801
|
||||||
|
#define VK_PAD_X 0x5802
|
||||||
|
#define VK_PAD_Y 0x5803
|
||||||
|
#define VK_PAD_RSHOULDER 0x5804
|
||||||
|
#define VK_PAD_LSHOULDER 0x5805
|
||||||
|
#define VK_PAD_LTRIGGER 0x5806
|
||||||
|
#define VK_PAD_RTRIGGER 0x5807
|
||||||
|
#define VK_PAD_DPAD_UP 0x5810
|
||||||
|
#define VK_PAD_DPAD_DOWN 0x5811
|
||||||
|
#define VK_PAD_DPAD_LEFT 0x5812
|
||||||
|
#define VK_PAD_DPAD_RIGHT 0x5813
|
||||||
|
#define VK_PAD_START 0x5814
|
||||||
|
#define VK_PAD_BACK 0x5815
|
||||||
|
#define VK_PAD_LTHUMB_PRESS 0x5816
|
||||||
|
#define VK_PAD_RTHUMB_PRESS 0x5817
|
||||||
|
#define VK_PAD_LTHUMB_UP 0x5820
|
||||||
|
#define VK_PAD_LTHUMB_DOWN 0x5821
|
||||||
|
#define VK_PAD_LTHUMB_RIGHT 0x5822
|
||||||
|
#define VK_PAD_LTHUMB_LEFT 0x5823
|
||||||
|
#define VK_PAD_LTHUMB_UPLEFT 0x5824
|
||||||
|
#define VK_PAD_LTHUMB_UPRIGHT 0x5825
|
||||||
|
#define VK_PAD_LTHUMB_DOWNRIGHT 0x5826
|
||||||
|
#define VK_PAD_LTHUMB_DOWNLEFT 0x5827
|
||||||
|
#define VK_PAD_RTHUMB_UP 0x5830
|
||||||
|
#define VK_PAD_RTHUMB_DOWN 0x5831
|
||||||
|
#define VK_PAD_RTHUMB_RIGHT 0x5832
|
||||||
|
#define VK_PAD_RTHUMB_LEFT 0x5833
|
||||||
|
#define VK_PAD_RTHUMB_UPLEFT 0x5834
|
||||||
|
#define VK_PAD_RTHUMB_UPRIGHT 0x5835
|
||||||
|
#define VK_PAD_RTHUMB_DOWNRIGHT 0x5836
|
||||||
|
#define VK_PAD_RTHUMB_DOWNLEFT 0x5837
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Deadzones are for analogue joystick controls on the joypad
|
||||||
|
* which determine when input should be assumed to be in the
|
||||||
|
* middle of the pad. This is a threshold to stop a joypad
|
||||||
|
* controlling the game when the player isn't touching the
|
||||||
|
* controls.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define XINPUT_GAMEPAD_LEFT_THUMB_DEADZONE 7849
|
||||||
|
#define XINPUT_GAMEPAD_RIGHT_THUMB_DEADZONE 8689
|
||||||
|
#define XINPUT_GAMEPAD_TRIGGER_THRESHOLD 30
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Defines what type of abilities the type of joystick has
|
||||||
|
* DEVTYPE_GAMEPAD is available for all joysticks, however
|
||||||
|
* there may be more specific identifiers for other joysticks
|
||||||
|
* which are being used.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define XINPUT_DEVTYPE_GAMEPAD 0x01
|
||||||
|
#define XINPUT_DEVSUBTYPE_GAMEPAD 0x01
|
||||||
|
#define XINPUT_DEVSUBTYPE_WHEEL 0x02
|
||||||
|
#define XINPUT_DEVSUBTYPE_ARCADE_STICK 0x03
|
||||||
|
#define XINPUT_DEVSUBTYPE_FLIGHT_SICK 0x04
|
||||||
|
#define XINPUT_DEVSUBTYPE_DANCE_PAD 0x05
|
||||||
|
#define XINPUT_DEVSUBTYPE_GUITAR 0x06
|
||||||
|
#define XINPUT_DEVSUBTYPE_DRUM_KIT 0x08
|
||||||
|
|
||||||
|
/*
|
||||||
|
* These are used with the XInputGetCapabilities function to
|
||||||
|
* determine the abilities to the joystick which has been
|
||||||
|
* plugged in.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define XINPUT_CAPS_VOICE_SUPPORTED 0x0004
|
||||||
|
#define XINPUT_FLAG_GAMEPAD 0x00000001
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Defines the status of the battery if one is used in the
|
||||||
|
* attached joystick. The first two define if the joystick
|
||||||
|
* supports a battery. Disconnected means that the joystick
|
||||||
|
* isn't connected. Wired shows that the joystick is a wired
|
||||||
|
* joystick.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define BATTERY_DEVTYPE_GAMEPAD 0x00
|
||||||
|
#define BATTERY_DEVTYPE_HEADSET 0x01
|
||||||
|
#define BATTERY_TYPE_DISCONNECTED 0x00
|
||||||
|
#define BATTERY_TYPE_WIRED 0x01
|
||||||
|
#define BATTERY_TYPE_ALKALINE 0x02
|
||||||
|
#define BATTERY_TYPE_NIMH 0x03
|
||||||
|
#define BATTERY_TYPE_UNKNOWN 0xFF
|
||||||
|
#define BATTERY_LEVEL_EMPTY 0x00
|
||||||
|
#define BATTERY_LEVEL_LOW 0x01
|
||||||
|
#define BATTERY_LEVEL_MEDIUM 0x02
|
||||||
|
#define BATTERY_LEVEL_FULL 0x03
|
||||||
|
|
||||||
|
/*
|
||||||
|
* How many joysticks can be used with this library. Games that
|
||||||
|
* use the xinput library will not go over this number.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define XUSER_MAX_COUNT 4
|
||||||
|
#define XUSER_INDEX_ANY 0x000000FF
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Defines the structure of an xbox 360 joystick.
|
||||||
|
*/
|
||||||
|
|
||||||
|
typedef struct _XINPUT_GAMEPAD {
|
||||||
|
WORD wButtons;
|
||||||
|
BYTE bLeftTrigger;
|
||||||
|
BYTE bRightTrigger;
|
||||||
|
SHORT sThumbLX;
|
||||||
|
SHORT sThumbLY;
|
||||||
|
SHORT sThumbRX;
|
||||||
|
SHORT sThumbRY;
|
||||||
|
} XINPUT_GAMEPAD, *PXINPUT_GAMEPAD;
|
||||||
|
|
||||||
|
typedef struct _XINPUT_STATE {
|
||||||
|
DWORD dwPacketNumber;
|
||||||
|
XINPUT_GAMEPAD Gamepad;
|
||||||
|
} XINPUT_STATE, *PXINPUT_STATE;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Defines the structure of how much vibration is set on both the
|
||||||
|
* right and left motors in a joystick. If you're not using a 360
|
||||||
|
* joystick you will have to map these to your device.
|
||||||
|
*/
|
||||||
|
|
||||||
|
typedef struct _XINPUT_VIBRATION {
|
||||||
|
WORD wLeftMotorSpeed;
|
||||||
|
WORD wRightMotorSpeed;
|
||||||
|
} XINPUT_VIBRATION, *PXINPUT_VIBRATION;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Defines the structure for what kind of abilities the joystick has
|
||||||
|
* such abilities are things such as if the joystick has the ability
|
||||||
|
* to send and receive audio, if the joystick is in fact a driving
|
||||||
|
* wheel or perhaps if the joystick is some kind of dance pad or
|
||||||
|
* guitar.
|
||||||
|
*/
|
||||||
|
|
||||||
|
typedef struct _XINPUT_CAPABILITIES {
|
||||||
|
BYTE Type;
|
||||||
|
BYTE SubType;
|
||||||
|
WORD Flags;
|
||||||
|
XINPUT_GAMEPAD Gamepad;
|
||||||
|
XINPUT_VIBRATION Vibration;
|
||||||
|
} XINPUT_CAPABILITIES, *PXINPUT_CAPABILITIES;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Defines the structure for a joystick input event which is
|
||||||
|
* retrieved using the function XInputGetKeystroke
|
||||||
|
*/
|
||||||
|
typedef struct _XINPUT_KEYSTROKE {
|
||||||
|
WORD VirtualKey;
|
||||||
|
WCHAR Unicode;
|
||||||
|
WORD Flags;
|
||||||
|
BYTE UserIndex;
|
||||||
|
BYTE HidCode;
|
||||||
|
} XINPUT_KEYSTROKE, *PXINPUT_KEYSTROKE;
|
||||||
|
|
||||||
|
typedef struct _XINPUT_BATTERY_INFORMATION
|
||||||
|
{
|
||||||
|
BYTE BatteryType;
|
||||||
|
BYTE BatteryLevel;
|
||||||
|
} XINPUT_BATTERY_INFORMATION, *PXINPUT_BATTERY_INFORMATION;
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void WINAPI XInputEnable(WINBOOL);
|
||||||
|
DWORD WINAPI XInputSetState(DWORD, XINPUT_VIBRATION*);
|
||||||
|
DWORD WINAPI XInputGetState(DWORD, XINPUT_STATE*);
|
||||||
|
DWORD WINAPI XInputGetKeystroke(DWORD, DWORD, PXINPUT_KEYSTROKE);
|
||||||
|
DWORD WINAPI XInputGetCapabilities(DWORD, DWORD, XINPUT_CAPABILITIES*);
|
||||||
|
DWORD WINAPI XInputGetDSoundAudioDeviceGuids(DWORD, GUID*, GUID*);
|
||||||
|
DWORD WINAPI XInputGetBatteryInformation(DWORD, BYTE, XINPUT_BATTERY_INFORMATION*);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __WINE_XINPUT_H */
|
|
@ -0,0 +1,381 @@
|
||||||
|
/*
|
||||||
|
* Nuklear - v1.32.0 - public domain
|
||||||
|
* no warrenty implied; use at your own risk.
|
||||||
|
* authored from 2015-2017 by Micha Mettke
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
* ==============================================================
|
||||||
|
*
|
||||||
|
* API
|
||||||
|
*
|
||||||
|
* ===============================================================
|
||||||
|
*/
|
||||||
|
#ifndef NK_GLFW_GL2_H_
|
||||||
|
#define NK_GLFW_GL2_H_
|
||||||
|
|
||||||
|
#include <GLFW/glfw3.h>
|
||||||
|
|
||||||
|
enum nk_glfw_init_state{
|
||||||
|
NK_GLFW3_DEFAULT = 0,
|
||||||
|
NK_GLFW3_INSTALL_CALLBACKS
|
||||||
|
};
|
||||||
|
NK_API struct nk_context* nk_glfw3_init(GLFWwindow *win, enum nk_glfw_init_state);
|
||||||
|
NK_API void nk_glfw3_font_stash_begin(struct nk_font_atlas **atlas);
|
||||||
|
NK_API void nk_glfw3_font_stash_end(void);
|
||||||
|
|
||||||
|
NK_API void nk_glfw3_new_frame(void);
|
||||||
|
NK_API void nk_glfw3_render(enum nk_anti_aliasing);
|
||||||
|
NK_API void nk_glfw3_shutdown(void);
|
||||||
|
|
||||||
|
NK_API void nk_glfw3_char_callback(GLFWwindow *win, unsigned int codepoint);
|
||||||
|
NK_API void nk_gflw3_scroll_callback(GLFWwindow *win, double xoff, double yoff);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ==============================================================
|
||||||
|
*
|
||||||
|
* IMPLEMENTATION
|
||||||
|
*
|
||||||
|
* ===============================================================
|
||||||
|
*/
|
||||||
|
#ifdef NK_GLFW_GL2_IMPLEMENTATION
|
||||||
|
|
||||||
|
#ifndef NK_GLFW_TEXT_MAX
|
||||||
|
#define NK_GLFW_TEXT_MAX 256
|
||||||
|
#endif
|
||||||
|
#ifndef NK_GLFW_DOUBLE_CLICK_LO
|
||||||
|
#define NK_GLFW_DOUBLE_CLICK_LO 0.02
|
||||||
|
#endif
|
||||||
|
#ifndef NK_GLFW_DOUBLE_CLICK_HI
|
||||||
|
#define NK_GLFW_DOUBLE_CLICK_HI 0.2
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct nk_glfw_device {
|
||||||
|
struct nk_buffer cmds;
|
||||||
|
struct nk_draw_null_texture null;
|
||||||
|
GLuint font_tex;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct nk_glfw_vertex {
|
||||||
|
float position[2];
|
||||||
|
float uv[2];
|
||||||
|
nk_byte col[4];
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct nk_glfw {
|
||||||
|
GLFWwindow *win;
|
||||||
|
int width, height;
|
||||||
|
int display_width, display_height;
|
||||||
|
struct nk_glfw_device ogl;
|
||||||
|
struct nk_context ctx;
|
||||||
|
struct nk_font_atlas atlas;
|
||||||
|
struct nk_vec2 fb_scale;
|
||||||
|
unsigned int text[NK_GLFW_TEXT_MAX];
|
||||||
|
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
|
||||||
|
nk_glfw3_device_upload_atlas(const void *image, int width, int height)
|
||||||
|
{
|
||||||
|
struct nk_glfw_device *dev = &glfw.ogl;
|
||||||
|
glGenTextures(1, &dev->font_tex);
|
||||||
|
glBindTexture(GL_TEXTURE_2D, dev->font_tex);
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||||
|
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, (GLsizei)width, (GLsizei)height, 0,
|
||||||
|
GL_RGBA, GL_UNSIGNED_BYTE, image);
|
||||||
|
}
|
||||||
|
|
||||||
|
NK_API void
|
||||||
|
nk_glfw3_render(enum nk_anti_aliasing AA)
|
||||||
|
{
|
||||||
|
/* setup global state */
|
||||||
|
struct nk_glfw_device *dev = &glfw.ogl;
|
||||||
|
glPushAttrib(GL_ENABLE_BIT|GL_COLOR_BUFFER_BIT|GL_TRANSFORM_BIT);
|
||||||
|
glDisable(GL_CULL_FACE);
|
||||||
|
glDisable(GL_DEPTH_TEST);
|
||||||
|
glEnable(GL_SCISSOR_TEST);
|
||||||
|
glEnable(GL_BLEND);
|
||||||
|
glEnable(GL_TEXTURE_2D);
|
||||||
|
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
|
|
||||||
|
/* setup viewport/project */
|
||||||
|
glViewport(0,0,(GLsizei)glfw.display_width,(GLsizei)glfw.display_height);
|
||||||
|
glMatrixMode(GL_PROJECTION);
|
||||||
|
glPushMatrix();
|
||||||
|
glLoadIdentity();
|
||||||
|
glOrtho(0.0f, glfw.width, glfw.height, 0.0f, -1.0f, 1.0f);
|
||||||
|
glMatrixMode(GL_MODELVIEW);
|
||||||
|
glPushMatrix();
|
||||||
|
glLoadIdentity();
|
||||||
|
|
||||||
|
glEnableClientState(GL_VERTEX_ARRAY);
|
||||||
|
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||||
|
glEnableClientState(GL_COLOR_ARRAY);
|
||||||
|
{
|
||||||
|
GLsizei vs = sizeof(struct nk_glfw_vertex);
|
||||||
|
size_t vp = offsetof(struct nk_glfw_vertex, position);
|
||||||
|
size_t vt = offsetof(struct nk_glfw_vertex, uv);
|
||||||
|
size_t vc = offsetof(struct nk_glfw_vertex, col);
|
||||||
|
|
||||||
|
/* convert from command queue into draw list and draw to screen */
|
||||||
|
const struct nk_draw_command *cmd;
|
||||||
|
const nk_draw_index *offset = NULL;
|
||||||
|
struct nk_buffer vbuf, ebuf;
|
||||||
|
|
||||||
|
/* fill convert configuration */
|
||||||
|
struct nk_convert_config config;
|
||||||
|
static const struct nk_draw_vertex_layout_element vertex_layout[] = {
|
||||||
|
{NK_VERTEX_POSITION, NK_FORMAT_FLOAT, NK_OFFSETOF(struct nk_glfw_vertex, position)},
|
||||||
|
{NK_VERTEX_TEXCOORD, NK_FORMAT_FLOAT, NK_OFFSETOF(struct nk_glfw_vertex, uv)},
|
||||||
|
{NK_VERTEX_COLOR, NK_FORMAT_R8G8B8A8, NK_OFFSETOF(struct nk_glfw_vertex, col)},
|
||||||
|
{NK_VERTEX_LAYOUT_END}
|
||||||
|
};
|
||||||
|
NK_MEMSET(&config, 0, sizeof(config));
|
||||||
|
config.vertex_layout = vertex_layout;
|
||||||
|
config.vertex_size = sizeof(struct nk_glfw_vertex);
|
||||||
|
config.vertex_alignment = NK_ALIGNOF(struct nk_glfw_vertex);
|
||||||
|
config.null = dev->null;
|
||||||
|
config.circle_segment_count = 22;
|
||||||
|
config.curve_segment_count = 22;
|
||||||
|
config.arc_segment_count = 22;
|
||||||
|
config.global_alpha = 1.0f;
|
||||||
|
config.shape_AA = AA;
|
||||||
|
config.line_AA = AA;
|
||||||
|
|
||||||
|
/* convert shapes into vertexes */
|
||||||
|
nk_buffer_init_default(&vbuf);
|
||||||
|
nk_buffer_init_default(&ebuf);
|
||||||
|
nk_convert(&glfw.ctx, &dev->cmds, &vbuf, &ebuf, &config);
|
||||||
|
|
||||||
|
/* setup vertex buffer pointer */
|
||||||
|
{const void *vertices = nk_buffer_memory_const(&vbuf);
|
||||||
|
glVertexPointer(2, GL_FLOAT, vs, (const void*)((const nk_byte*)vertices + vp));
|
||||||
|
glTexCoordPointer(2, GL_FLOAT, vs, (const void*)((const nk_byte*)vertices + vt));
|
||||||
|
glColorPointer(4, GL_UNSIGNED_BYTE, vs, (const void*)((const nk_byte*)vertices + vc));}
|
||||||
|
|
||||||
|
/* iterate over and execute each draw command */
|
||||||
|
offset = (const nk_draw_index*)nk_buffer_memory_const(&ebuf);
|
||||||
|
nk_draw_foreach(cmd, &glfw.ctx, &dev->cmds)
|
||||||
|
{
|
||||||
|
if (!cmd->elem_count) continue;
|
||||||
|
glBindTexture(GL_TEXTURE_2D, (GLuint)cmd->texture.id);
|
||||||
|
glScissor(
|
||||||
|
(GLint)(cmd->clip_rect.x * glfw.fb_scale.x),
|
||||||
|
(GLint)((glfw.height - (GLint)(cmd->clip_rect.y + cmd->clip_rect.h)) * glfw.fb_scale.y),
|
||||||
|
(GLint)(cmd->clip_rect.w * glfw.fb_scale.x),
|
||||||
|
(GLint)(cmd->clip_rect.h * glfw.fb_scale.y));
|
||||||
|
glDrawElements(GL_TRIANGLES, (GLsizei)cmd->elem_count, GL_UNSIGNED_SHORT, offset);
|
||||||
|
offset += cmd->elem_count;
|
||||||
|
}
|
||||||
|
nk_clear(&glfw.ctx);
|
||||||
|
nk_buffer_free(&vbuf);
|
||||||
|
nk_buffer_free(&ebuf);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* default OpenGL state */
|
||||||
|
glDisableClientState(GL_VERTEX_ARRAY);
|
||||||
|
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||||
|
glDisableClientState(GL_COLOR_ARRAY);
|
||||||
|
|
||||||
|
glDisable(GL_CULL_FACE);
|
||||||
|
glDisable(GL_DEPTH_TEST);
|
||||||
|
glDisable(GL_SCISSOR_TEST);
|
||||||
|
glDisable(GL_BLEND);
|
||||||
|
glDisable(GL_TEXTURE_2D);
|
||||||
|
|
||||||
|
glBindTexture(GL_TEXTURE_2D, 0);
|
||||||
|
glMatrixMode(GL_MODELVIEW);
|
||||||
|
glPopMatrix();
|
||||||
|
glMatrixMode(GL_PROJECTION);
|
||||||
|
glPopMatrix();
|
||||||
|
glPopAttrib();
|
||||||
|
}
|
||||||
|
|
||||||
|
NK_API void
|
||||||
|
nk_glfw3_char_callback(GLFWwindow *win, unsigned int codepoint)
|
||||||
|
{
|
||||||
|
(void)win;
|
||||||
|
if (glfw.text_len < NK_GLFW_TEXT_MAX)
|
||||||
|
glfw.text[glfw.text_len++] = codepoint;
|
||||||
|
}
|
||||||
|
|
||||||
|
NK_API void
|
||||||
|
nk_gflw3_scroll_callback(GLFWwindow *win, double xoff, double yoff)
|
||||||
|
{
|
||||||
|
(void)win; (void)xoff;
|
||||||
|
glfw.scroll.x += (float)xoff;
|
||||||
|
glfw.scroll.y += (float)yoff;
|
||||||
|
}
|
||||||
|
|
||||||
|
NK_API void
|
||||||
|
nk_glfw3_mouse_button_callback(GLFWwindow* window, int button, int action, int mods)
|
||||||
|
{
|
||||||
|
double x, y;
|
||||||
|
if (button != GLFW_MOUSE_BUTTON_LEFT) return;
|
||||||
|
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) {
|
||||||
|
glfw.is_double_click_down = nk_true;
|
||||||
|
glfw.double_click_pos = nk_vec2((float)x, (float)y);
|
||||||
|
}
|
||||||
|
glfw.last_button_click = glfwGetTime();
|
||||||
|
} else glfw.is_double_click_down = nk_false;
|
||||||
|
}
|
||||||
|
|
||||||
|
NK_INTERN void
|
||||||
|
nk_glfw3_clipbard_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));
|
||||||
|
(void)usr;
|
||||||
|
}
|
||||||
|
|
||||||
|
NK_INTERN void
|
||||||
|
nk_glfw3_clipbard_copy(nk_handle usr, const char *text, int len)
|
||||||
|
{
|
||||||
|
char *str = 0;
|
||||||
|
(void)usr;
|
||||||
|
if (!len) return;
|
||||||
|
str = (char*)malloc((size_t)len+1);
|
||||||
|
if (!str) return;
|
||||||
|
NK_MEMCPY(str, text, (size_t)len);
|
||||||
|
str[len] = '\0';
|
||||||
|
glfwSetClipboardString(glfw.win, str);
|
||||||
|
free(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
NK_API struct nk_context*
|
||||||
|
nk_glfw3_init(GLFWwindow *win, enum nk_glfw_init_state init_state)
|
||||||
|
{
|
||||||
|
glfw.win = win;
|
||||||
|
if (init_state == NK_GLFW3_INSTALL_CALLBACKS) {
|
||||||
|
glfwSetScrollCallback(win, nk_gflw3_scroll_callback);
|
||||||
|
glfwSetCharCallback(win, nk_glfw3_char_callback);
|
||||||
|
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.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;
|
||||||
|
}
|
||||||
|
|
||||||
|
NK_API void
|
||||||
|
nk_glfw3_font_stash_begin(struct nk_font_atlas **atlas)
|
||||||
|
{
|
||||||
|
nk_font_atlas_init_default(&glfw.atlas);
|
||||||
|
nk_font_atlas_begin(&glfw.atlas);
|
||||||
|
*atlas = &glfw.atlas;
|
||||||
|
}
|
||||||
|
|
||||||
|
NK_API void
|
||||||
|
nk_glfw3_font_stash_end(void)
|
||||||
|
{
|
||||||
|
const void *image; int w, h;
|
||||||
|
image = nk_font_atlas_bake(&glfw.atlas, &w, &h, NK_FONT_ATLAS_RGBA32);
|
||||||
|
nk_glfw3_device_upload_atlas(image, w, h);
|
||||||
|
nk_font_atlas_end(&glfw.atlas, nk_handle_id((int)glfw.ogl.font_tex), &glfw.ogl.null);
|
||||||
|
if (glfw.atlas.default_font)
|
||||||
|
nk_style_set_font(&glfw.ctx, &glfw.atlas.default_font->handle);
|
||||||
|
}
|
||||||
|
|
||||||
|
NK_API void
|
||||||
|
nk_glfw3_new_frame(void)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
double x, y;
|
||||||
|
struct nk_context *ctx = &glfw.ctx;
|
||||||
|
struct GLFWwindow *win = glfw.win;
|
||||||
|
|
||||||
|
glfwGetWindowSize(win, &glfw.width, &glfw.height);
|
||||||
|
glfwGetFramebufferSize(win, &glfw.display_width, &glfw.display_height);
|
||||||
|
glfw.fb_scale.x = (float)glfw.display_width/(float)glfw.width;
|
||||||
|
glfw.fb_scale.y = (float)glfw.display_height/(float)glfw.height;
|
||||||
|
|
||||||
|
nk_input_begin(ctx);
|
||||||
|
for (i = 0; i < glfw.text_len; ++i)
|
||||||
|
nk_input_unicode(ctx, glfw.text[i]);
|
||||||
|
|
||||||
|
/* optional grabbing behavior */
|
||||||
|
if (ctx->input.mouse.grab)
|
||||||
|
glfwSetInputMode(glfw.win, GLFW_CURSOR, GLFW_CURSOR_HIDDEN);
|
||||||
|
else if (ctx->input.mouse.ungrab)
|
||||||
|
glfwSetInputMode(glfw.win, GLFW_CURSOR, GLFW_CURSOR_NORMAL);
|
||||||
|
|
||||||
|
nk_input_key(ctx, NK_KEY_DEL, glfwGetKey(win, GLFW_KEY_DELETE) == GLFW_PRESS);
|
||||||
|
nk_input_key(ctx, NK_KEY_ENTER, glfwGetKey(win, GLFW_KEY_ENTER) == GLFW_PRESS);
|
||||||
|
nk_input_key(ctx, NK_KEY_TAB, glfwGetKey(win, GLFW_KEY_TAB) == GLFW_PRESS);
|
||||||
|
nk_input_key(ctx, NK_KEY_BACKSPACE, glfwGetKey(win, GLFW_KEY_BACKSPACE) == GLFW_PRESS);
|
||||||
|
nk_input_key(ctx, NK_KEY_UP, glfwGetKey(win, GLFW_KEY_UP) == GLFW_PRESS);
|
||||||
|
nk_input_key(ctx, NK_KEY_DOWN, glfwGetKey(win, GLFW_KEY_DOWN) == GLFW_PRESS);
|
||||||
|
nk_input_key(ctx, NK_KEY_TEXT_START, glfwGetKey(win, GLFW_KEY_HOME) == GLFW_PRESS);
|
||||||
|
nk_input_key(ctx, NK_KEY_TEXT_END, glfwGetKey(win, GLFW_KEY_END) == GLFW_PRESS);
|
||||||
|
nk_input_key(ctx, NK_KEY_SCROLL_START, glfwGetKey(win, GLFW_KEY_HOME) == GLFW_PRESS);
|
||||||
|
nk_input_key(ctx, NK_KEY_SCROLL_END, glfwGetKey(win, GLFW_KEY_END) == GLFW_PRESS);
|
||||||
|
nk_input_key(ctx, NK_KEY_SCROLL_DOWN, glfwGetKey(win, GLFW_KEY_PAGE_DOWN) == GLFW_PRESS);
|
||||||
|
nk_input_key(ctx, NK_KEY_SCROLL_UP, glfwGetKey(win, GLFW_KEY_PAGE_UP) == GLFW_PRESS);
|
||||||
|
nk_input_key(ctx, NK_KEY_SHIFT, glfwGetKey(win, GLFW_KEY_LEFT_SHIFT) == GLFW_PRESS||
|
||||||
|
glfwGetKey(win, GLFW_KEY_RIGHT_SHIFT) == GLFW_PRESS);
|
||||||
|
|
||||||
|
if (glfwGetKey(win, GLFW_KEY_LEFT_CONTROL) == GLFW_PRESS ||
|
||||||
|
glfwGetKey(win, GLFW_KEY_RIGHT_CONTROL) == GLFW_PRESS) {
|
||||||
|
nk_input_key(ctx, NK_KEY_COPY, glfwGetKey(win, GLFW_KEY_C) == GLFW_PRESS);
|
||||||
|
nk_input_key(ctx, NK_KEY_PASTE, glfwGetKey(win, GLFW_KEY_V) == GLFW_PRESS);
|
||||||
|
nk_input_key(ctx, NK_KEY_CUT, glfwGetKey(win, GLFW_KEY_X) == GLFW_PRESS);
|
||||||
|
nk_input_key(ctx, NK_KEY_TEXT_UNDO, glfwGetKey(win, GLFW_KEY_Z) == GLFW_PRESS);
|
||||||
|
nk_input_key(ctx, NK_KEY_TEXT_REDO, glfwGetKey(win, GLFW_KEY_R) == GLFW_PRESS);
|
||||||
|
nk_input_key(ctx, NK_KEY_TEXT_WORD_LEFT, glfwGetKey(win, GLFW_KEY_LEFT) == GLFW_PRESS);
|
||||||
|
nk_input_key(ctx, NK_KEY_TEXT_WORD_RIGHT, glfwGetKey(win, GLFW_KEY_RIGHT) == GLFW_PRESS);
|
||||||
|
nk_input_key(ctx, NK_KEY_TEXT_LINE_START, glfwGetKey(win, GLFW_KEY_B) == GLFW_PRESS);
|
||||||
|
nk_input_key(ctx, NK_KEY_TEXT_LINE_END, glfwGetKey(win, GLFW_KEY_E) == GLFW_PRESS);
|
||||||
|
} else {
|
||||||
|
nk_input_key(ctx, NK_KEY_LEFT, glfwGetKey(win, GLFW_KEY_LEFT) == GLFW_PRESS);
|
||||||
|
nk_input_key(ctx, NK_KEY_RIGHT, glfwGetKey(win, GLFW_KEY_RIGHT) == GLFW_PRESS);
|
||||||
|
nk_input_key(ctx, NK_KEY_COPY, 0);
|
||||||
|
nk_input_key(ctx, NK_KEY_PASTE, 0);
|
||||||
|
nk_input_key(ctx, NK_KEY_CUT, 0);
|
||||||
|
nk_input_key(ctx, NK_KEY_SHIFT, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
glfwGetCursorPos(win, &x, &y);
|
||||||
|
nk_input_motion(ctx, (int)x, (int)y);
|
||||||
|
if (ctx->input.mouse.grabbed) {
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
glfw.scroll = nk_vec2(0,0);
|
||||||
|
}
|
||||||
|
|
||||||
|
NK_API
|
||||||
|
void nk_glfw3_shutdown(void)
|
||||||
|
{
|
||||||
|
struct nk_glfw_device *dev = &glfw.ogl;
|
||||||
|
nk_font_atlas_clear(&glfw.atlas);
|
||||||
|
nk_free(&glfw.ctx);
|
||||||
|
glDeleteTextures(1, &dev->font_tex);
|
||||||
|
nk_buffer_free(&dev->cmds);
|
||||||
|
NK_MEMSET(&glfw, 0, sizeof(glfw));
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,594 @@
|
||||||
|
/* -*- mode: c; tab-width: 2; indent-tabs-mode: nil; -*-
|
||||||
|
Copyright (c) 2012 Marcus Geelnard
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* 2013-01-06 Camilla Löwy <elmindreda@glfw.org>
|
||||||
|
*
|
||||||
|
* Added casts from time_t to DWORD to avoid warnings on VC++.
|
||||||
|
* Fixed time retrieval on POSIX systems.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "tinycthread.h"
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
/* Platform specific includes */
|
||||||
|
#if defined(_TTHREAD_POSIX_)
|
||||||
|
#include <signal.h>
|
||||||
|
#include <sched.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#elif defined(_TTHREAD_WIN32_)
|
||||||
|
#include <process.h>
|
||||||
|
#include <sys/timeb.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Standard, good-to-have defines */
|
||||||
|
#ifndef NULL
|
||||||
|
#define NULL (void*)0
|
||||||
|
#endif
|
||||||
|
#ifndef TRUE
|
||||||
|
#define TRUE 1
|
||||||
|
#endif
|
||||||
|
#ifndef FALSE
|
||||||
|
#define FALSE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int mtx_init(mtx_t *mtx, int type)
|
||||||
|
{
|
||||||
|
#if defined(_TTHREAD_WIN32_)
|
||||||
|
mtx->mAlreadyLocked = FALSE;
|
||||||
|
mtx->mRecursive = type & mtx_recursive;
|
||||||
|
InitializeCriticalSection(&mtx->mHandle);
|
||||||
|
return thrd_success;
|
||||||
|
#else
|
||||||
|
int ret;
|
||||||
|
pthread_mutexattr_t attr;
|
||||||
|
pthread_mutexattr_init(&attr);
|
||||||
|
if (type & mtx_recursive)
|
||||||
|
{
|
||||||
|
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
|
||||||
|
}
|
||||||
|
ret = pthread_mutex_init(mtx, &attr);
|
||||||
|
pthread_mutexattr_destroy(&attr);
|
||||||
|
return ret == 0 ? thrd_success : thrd_error;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void mtx_destroy(mtx_t *mtx)
|
||||||
|
{
|
||||||
|
#if defined(_TTHREAD_WIN32_)
|
||||||
|
DeleteCriticalSection(&mtx->mHandle);
|
||||||
|
#else
|
||||||
|
pthread_mutex_destroy(mtx);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
int mtx_lock(mtx_t *mtx)
|
||||||
|
{
|
||||||
|
#if defined(_TTHREAD_WIN32_)
|
||||||
|
EnterCriticalSection(&mtx->mHandle);
|
||||||
|
if (!mtx->mRecursive)
|
||||||
|
{
|
||||||
|
while(mtx->mAlreadyLocked) Sleep(1000); /* Simulate deadlock... */
|
||||||
|
mtx->mAlreadyLocked = TRUE;
|
||||||
|
}
|
||||||
|
return thrd_success;
|
||||||
|
#else
|
||||||
|
return pthread_mutex_lock(mtx) == 0 ? thrd_success : thrd_error;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
int mtx_timedlock(mtx_t *mtx, const struct timespec *ts)
|
||||||
|
{
|
||||||
|
/* FIXME! */
|
||||||
|
(void)mtx;
|
||||||
|
(void)ts;
|
||||||
|
return thrd_error;
|
||||||
|
}
|
||||||
|
|
||||||
|
int mtx_trylock(mtx_t *mtx)
|
||||||
|
{
|
||||||
|
#if defined(_TTHREAD_WIN32_)
|
||||||
|
int ret = TryEnterCriticalSection(&mtx->mHandle) ? thrd_success : thrd_busy;
|
||||||
|
if ((!mtx->mRecursive) && (ret == thrd_success) && mtx->mAlreadyLocked)
|
||||||
|
{
|
||||||
|
LeaveCriticalSection(&mtx->mHandle);
|
||||||
|
ret = thrd_busy;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
#else
|
||||||
|
return (pthread_mutex_trylock(mtx) == 0) ? thrd_success : thrd_busy;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
int mtx_unlock(mtx_t *mtx)
|
||||||
|
{
|
||||||
|
#if defined(_TTHREAD_WIN32_)
|
||||||
|
mtx->mAlreadyLocked = FALSE;
|
||||||
|
LeaveCriticalSection(&mtx->mHandle);
|
||||||
|
return thrd_success;
|
||||||
|
#else
|
||||||
|
return pthread_mutex_unlock(mtx) == 0 ? thrd_success : thrd_error;;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(_TTHREAD_WIN32_)
|
||||||
|
#define _CONDITION_EVENT_ONE 0
|
||||||
|
#define _CONDITION_EVENT_ALL 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int cnd_init(cnd_t *cond)
|
||||||
|
{
|
||||||
|
#if defined(_TTHREAD_WIN32_)
|
||||||
|
cond->mWaitersCount = 0;
|
||||||
|
|
||||||
|
/* Init critical section */
|
||||||
|
InitializeCriticalSection(&cond->mWaitersCountLock);
|
||||||
|
|
||||||
|
/* Init events */
|
||||||
|
cond->mEvents[_CONDITION_EVENT_ONE] = CreateEvent(NULL, FALSE, FALSE, NULL);
|
||||||
|
if (cond->mEvents[_CONDITION_EVENT_ONE] == NULL)
|
||||||
|
{
|
||||||
|
cond->mEvents[_CONDITION_EVENT_ALL] = NULL;
|
||||||
|
return thrd_error;
|
||||||
|
}
|
||||||
|
cond->mEvents[_CONDITION_EVENT_ALL] = CreateEvent(NULL, TRUE, FALSE, NULL);
|
||||||
|
if (cond->mEvents[_CONDITION_EVENT_ALL] == NULL)
|
||||||
|
{
|
||||||
|
CloseHandle(cond->mEvents[_CONDITION_EVENT_ONE]);
|
||||||
|
cond->mEvents[_CONDITION_EVENT_ONE] = NULL;
|
||||||
|
return thrd_error;
|
||||||
|
}
|
||||||
|
|
||||||
|
return thrd_success;
|
||||||
|
#else
|
||||||
|
return pthread_cond_init(cond, NULL) == 0 ? thrd_success : thrd_error;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void cnd_destroy(cnd_t *cond)
|
||||||
|
{
|
||||||
|
#if defined(_TTHREAD_WIN32_)
|
||||||
|
if (cond->mEvents[_CONDITION_EVENT_ONE] != NULL)
|
||||||
|
{
|
||||||
|
CloseHandle(cond->mEvents[_CONDITION_EVENT_ONE]);
|
||||||
|
}
|
||||||
|
if (cond->mEvents[_CONDITION_EVENT_ALL] != NULL)
|
||||||
|
{
|
||||||
|
CloseHandle(cond->mEvents[_CONDITION_EVENT_ALL]);
|
||||||
|
}
|
||||||
|
DeleteCriticalSection(&cond->mWaitersCountLock);
|
||||||
|
#else
|
||||||
|
pthread_cond_destroy(cond);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
int cnd_signal(cnd_t *cond)
|
||||||
|
{
|
||||||
|
#if defined(_TTHREAD_WIN32_)
|
||||||
|
int haveWaiters;
|
||||||
|
|
||||||
|
/* Are there any waiters? */
|
||||||
|
EnterCriticalSection(&cond->mWaitersCountLock);
|
||||||
|
haveWaiters = (cond->mWaitersCount > 0);
|
||||||
|
LeaveCriticalSection(&cond->mWaitersCountLock);
|
||||||
|
|
||||||
|
/* If we have any waiting threads, send them a signal */
|
||||||
|
if(haveWaiters)
|
||||||
|
{
|
||||||
|
if (SetEvent(cond->mEvents[_CONDITION_EVENT_ONE]) == 0)
|
||||||
|
{
|
||||||
|
return thrd_error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return thrd_success;
|
||||||
|
#else
|
||||||
|
return pthread_cond_signal(cond) == 0 ? thrd_success : thrd_error;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
int cnd_broadcast(cnd_t *cond)
|
||||||
|
{
|
||||||
|
#if defined(_TTHREAD_WIN32_)
|
||||||
|
int haveWaiters;
|
||||||
|
|
||||||
|
/* Are there any waiters? */
|
||||||
|
EnterCriticalSection(&cond->mWaitersCountLock);
|
||||||
|
haveWaiters = (cond->mWaitersCount > 0);
|
||||||
|
LeaveCriticalSection(&cond->mWaitersCountLock);
|
||||||
|
|
||||||
|
/* If we have any waiting threads, send them a signal */
|
||||||
|
if(haveWaiters)
|
||||||
|
{
|
||||||
|
if (SetEvent(cond->mEvents[_CONDITION_EVENT_ALL]) == 0)
|
||||||
|
{
|
||||||
|
return thrd_error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return thrd_success;
|
||||||
|
#else
|
||||||
|
return pthread_cond_signal(cond) == 0 ? thrd_success : thrd_error;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(_TTHREAD_WIN32_)
|
||||||
|
static int _cnd_timedwait_win32(cnd_t *cond, mtx_t *mtx, DWORD timeout)
|
||||||
|
{
|
||||||
|
int result, lastWaiter;
|
||||||
|
|
||||||
|
/* Increment number of waiters */
|
||||||
|
EnterCriticalSection(&cond->mWaitersCountLock);
|
||||||
|
++ cond->mWaitersCount;
|
||||||
|
LeaveCriticalSection(&cond->mWaitersCountLock);
|
||||||
|
|
||||||
|
/* Release the mutex while waiting for the condition (will decrease
|
||||||
|
the number of waiters when done)... */
|
||||||
|
mtx_unlock(mtx);
|
||||||
|
|
||||||
|
/* Wait for either event to become signaled due to cnd_signal() or
|
||||||
|
cnd_broadcast() being called */
|
||||||
|
result = WaitForMultipleObjects(2, cond->mEvents, FALSE, timeout);
|
||||||
|
if (result == WAIT_TIMEOUT)
|
||||||
|
{
|
||||||
|
return thrd_timeout;
|
||||||
|
}
|
||||||
|
else if (result == (int)WAIT_FAILED)
|
||||||
|
{
|
||||||
|
return thrd_error;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Check if we are the last waiter */
|
||||||
|
EnterCriticalSection(&cond->mWaitersCountLock);
|
||||||
|
-- cond->mWaitersCount;
|
||||||
|
lastWaiter = (result == (WAIT_OBJECT_0 + _CONDITION_EVENT_ALL)) &&
|
||||||
|
(cond->mWaitersCount == 0);
|
||||||
|
LeaveCriticalSection(&cond->mWaitersCountLock);
|
||||||
|
|
||||||
|
/* If we are the last waiter to be notified to stop waiting, reset the event */
|
||||||
|
if (lastWaiter)
|
||||||
|
{
|
||||||
|
if (ResetEvent(cond->mEvents[_CONDITION_EVENT_ALL]) == 0)
|
||||||
|
{
|
||||||
|
return thrd_error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Re-acquire the mutex */
|
||||||
|
mtx_lock(mtx);
|
||||||
|
|
||||||
|
return thrd_success;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int cnd_wait(cnd_t *cond, mtx_t *mtx)
|
||||||
|
{
|
||||||
|
#if defined(_TTHREAD_WIN32_)
|
||||||
|
return _cnd_timedwait_win32(cond, mtx, INFINITE);
|
||||||
|
#else
|
||||||
|
return pthread_cond_wait(cond, mtx) == 0 ? thrd_success : thrd_error;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
int cnd_timedwait(cnd_t *cond, mtx_t *mtx, const struct timespec *ts)
|
||||||
|
{
|
||||||
|
#if defined(_TTHREAD_WIN32_)
|
||||||
|
struct timespec now;
|
||||||
|
if (clock_gettime(CLOCK_REALTIME, &now) == 0)
|
||||||
|
{
|
||||||
|
DWORD delta = (DWORD) ((ts->tv_sec - now.tv_sec) * 1000 +
|
||||||
|
(ts->tv_nsec - now.tv_nsec + 500000) / 1000000);
|
||||||
|
return _cnd_timedwait_win32(cond, mtx, delta);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return thrd_error;
|
||||||
|
#else
|
||||||
|
int ret;
|
||||||
|
ret = pthread_cond_timedwait(cond, mtx, ts);
|
||||||
|
if (ret == ETIMEDOUT)
|
||||||
|
{
|
||||||
|
return thrd_timeout;
|
||||||
|
}
|
||||||
|
return ret == 0 ? thrd_success : thrd_error;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** Information to pass to the new thread (what to run). */
|
||||||
|
typedef struct {
|
||||||
|
thrd_start_t mFunction; /**< Pointer to the function to be executed. */
|
||||||
|
void * mArg; /**< Function argument for the thread function. */
|
||||||
|
} _thread_start_info;
|
||||||
|
|
||||||
|
/* Thread wrapper function. */
|
||||||
|
#if defined(_TTHREAD_WIN32_)
|
||||||
|
static unsigned WINAPI _thrd_wrapper_function(void * aArg)
|
||||||
|
#elif defined(_TTHREAD_POSIX_)
|
||||||
|
static void * _thrd_wrapper_function(void * aArg)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
thrd_start_t fun;
|
||||||
|
void *arg;
|
||||||
|
int res;
|
||||||
|
#if defined(_TTHREAD_POSIX_)
|
||||||
|
void *pres;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Get thread startup information */
|
||||||
|
_thread_start_info *ti = (_thread_start_info *) aArg;
|
||||||
|
fun = ti->mFunction;
|
||||||
|
arg = ti->mArg;
|
||||||
|
|
||||||
|
/* The thread is responsible for freeing the startup information */
|
||||||
|
free((void *)ti);
|
||||||
|
|
||||||
|
/* Call the actual client thread function */
|
||||||
|
res = fun(arg);
|
||||||
|
|
||||||
|
#if defined(_TTHREAD_WIN32_)
|
||||||
|
return res;
|
||||||
|
#else
|
||||||
|
pres = malloc(sizeof(int));
|
||||||
|
if (pres != NULL)
|
||||||
|
{
|
||||||
|
*(int*)pres = res;
|
||||||
|
}
|
||||||
|
return pres;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
int thrd_create(thrd_t *thr, thrd_start_t func, void *arg)
|
||||||
|
{
|
||||||
|
/* Fill out the thread startup information (passed to the thread wrapper,
|
||||||
|
which will eventually free it) */
|
||||||
|
_thread_start_info* ti = (_thread_start_info*)malloc(sizeof(_thread_start_info));
|
||||||
|
if (ti == NULL)
|
||||||
|
{
|
||||||
|
return thrd_nomem;
|
||||||
|
}
|
||||||
|
ti->mFunction = func;
|
||||||
|
ti->mArg = arg;
|
||||||
|
|
||||||
|
/* Create the thread */
|
||||||
|
#if defined(_TTHREAD_WIN32_)
|
||||||
|
*thr = (HANDLE)_beginthreadex(NULL, 0, _thrd_wrapper_function, (void *)ti, 0, NULL);
|
||||||
|
#elif defined(_TTHREAD_POSIX_)
|
||||||
|
if(pthread_create(thr, NULL, _thrd_wrapper_function, (void *)ti) != 0)
|
||||||
|
{
|
||||||
|
*thr = 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Did we fail to create the thread? */
|
||||||
|
if(!*thr)
|
||||||
|
{
|
||||||
|
free(ti);
|
||||||
|
return thrd_error;
|
||||||
|
}
|
||||||
|
|
||||||
|
return thrd_success;
|
||||||
|
}
|
||||||
|
|
||||||
|
thrd_t thrd_current(void)
|
||||||
|
{
|
||||||
|
#if defined(_TTHREAD_WIN32_)
|
||||||
|
return GetCurrentThread();
|
||||||
|
#else
|
||||||
|
return pthread_self();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
int thrd_detach(thrd_t thr)
|
||||||
|
{
|
||||||
|
/* FIXME! */
|
||||||
|
(void)thr;
|
||||||
|
return thrd_error;
|
||||||
|
}
|
||||||
|
|
||||||
|
int thrd_equal(thrd_t thr0, thrd_t thr1)
|
||||||
|
{
|
||||||
|
#if defined(_TTHREAD_WIN32_)
|
||||||
|
return thr0 == thr1;
|
||||||
|
#else
|
||||||
|
return pthread_equal(thr0, thr1);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void thrd_exit(int res)
|
||||||
|
{
|
||||||
|
#if defined(_TTHREAD_WIN32_)
|
||||||
|
ExitThread(res);
|
||||||
|
#else
|
||||||
|
void *pres = malloc(sizeof(int));
|
||||||
|
if (pres != NULL)
|
||||||
|
{
|
||||||
|
*(int*)pres = res;
|
||||||
|
}
|
||||||
|
pthread_exit(pres);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
int thrd_join(thrd_t thr, int *res)
|
||||||
|
{
|
||||||
|
#if defined(_TTHREAD_WIN32_)
|
||||||
|
if (WaitForSingleObject(thr, INFINITE) == WAIT_FAILED)
|
||||||
|
{
|
||||||
|
return thrd_error;
|
||||||
|
}
|
||||||
|
if (res != NULL)
|
||||||
|
{
|
||||||
|
DWORD dwRes;
|
||||||
|
GetExitCodeThread(thr, &dwRes);
|
||||||
|
*res = dwRes;
|
||||||
|
}
|
||||||
|
#elif defined(_TTHREAD_POSIX_)
|
||||||
|
void *pres;
|
||||||
|
int ires = 0;
|
||||||
|
if (pthread_join(thr, &pres) != 0)
|
||||||
|
{
|
||||||
|
return thrd_error;
|
||||||
|
}
|
||||||
|
if (pres != NULL)
|
||||||
|
{
|
||||||
|
ires = *(int*)pres;
|
||||||
|
free(pres);
|
||||||
|
}
|
||||||
|
if (res != NULL)
|
||||||
|
{
|
||||||
|
*res = ires;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return thrd_success;
|
||||||
|
}
|
||||||
|
|
||||||
|
int thrd_sleep(const struct timespec *time_point, struct timespec *remaining)
|
||||||
|
{
|
||||||
|
struct timespec now;
|
||||||
|
#if defined(_TTHREAD_WIN32_)
|
||||||
|
DWORD delta;
|
||||||
|
#else
|
||||||
|
long delta;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Get the current time */
|
||||||
|
if (clock_gettime(CLOCK_REALTIME, &now) != 0)
|
||||||
|
return -2; // FIXME: Some specific error code?
|
||||||
|
|
||||||
|
#if defined(_TTHREAD_WIN32_)
|
||||||
|
/* Delta in milliseconds */
|
||||||
|
delta = (DWORD) ((time_point->tv_sec - now.tv_sec) * 1000 +
|
||||||
|
(time_point->tv_nsec - now.tv_nsec + 500000) / 1000000);
|
||||||
|
if (delta > 0)
|
||||||
|
{
|
||||||
|
Sleep(delta);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
/* Delta in microseconds */
|
||||||
|
delta = (time_point->tv_sec - now.tv_sec) * 1000000L +
|
||||||
|
(time_point->tv_nsec - now.tv_nsec + 500L) / 1000L;
|
||||||
|
|
||||||
|
/* On some systems, the usleep argument must be < 1000000 */
|
||||||
|
while (delta > 999999L)
|
||||||
|
{
|
||||||
|
usleep(999999);
|
||||||
|
delta -= 999999L;
|
||||||
|
}
|
||||||
|
if (delta > 0L)
|
||||||
|
{
|
||||||
|
usleep((useconds_t)delta);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* We don't support waking up prematurely (yet) */
|
||||||
|
if (remaining)
|
||||||
|
{
|
||||||
|
remaining->tv_sec = 0;
|
||||||
|
remaining->tv_nsec = 0;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void thrd_yield(void)
|
||||||
|
{
|
||||||
|
#if defined(_TTHREAD_WIN32_)
|
||||||
|
Sleep(0);
|
||||||
|
#else
|
||||||
|
sched_yield();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
int tss_create(tss_t *key, tss_dtor_t dtor)
|
||||||
|
{
|
||||||
|
#if defined(_TTHREAD_WIN32_)
|
||||||
|
/* FIXME: The destructor function is not supported yet... */
|
||||||
|
if (dtor != NULL)
|
||||||
|
{
|
||||||
|
return thrd_error;
|
||||||
|
}
|
||||||
|
*key = TlsAlloc();
|
||||||
|
if (*key == TLS_OUT_OF_INDEXES)
|
||||||
|
{
|
||||||
|
return thrd_error;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
if (pthread_key_create(key, dtor) != 0)
|
||||||
|
{
|
||||||
|
return thrd_error;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return thrd_success;
|
||||||
|
}
|
||||||
|
|
||||||
|
void tss_delete(tss_t key)
|
||||||
|
{
|
||||||
|
#if defined(_TTHREAD_WIN32_)
|
||||||
|
TlsFree(key);
|
||||||
|
#else
|
||||||
|
pthread_key_delete(key);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void *tss_get(tss_t key)
|
||||||
|
{
|
||||||
|
#if defined(_TTHREAD_WIN32_)
|
||||||
|
return TlsGetValue(key);
|
||||||
|
#else
|
||||||
|
return pthread_getspecific(key);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
int tss_set(tss_t key, void *val)
|
||||||
|
{
|
||||||
|
#if defined(_TTHREAD_WIN32_)
|
||||||
|
if (TlsSetValue(key, val) == 0)
|
||||||
|
{
|
||||||
|
return thrd_error;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
if (pthread_setspecific(key, val) != 0)
|
||||||
|
{
|
||||||
|
return thrd_error;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return thrd_success;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(_TTHREAD_EMULATE_CLOCK_GETTIME_)
|
||||||
|
int _tthread_clock_gettime(clockid_t clk_id, struct timespec *ts)
|
||||||
|
{
|
||||||
|
#if defined(_TTHREAD_WIN32_)
|
||||||
|
struct _timeb tb;
|
||||||
|
_ftime(&tb);
|
||||||
|
ts->tv_sec = (time_t)tb.time;
|
||||||
|
ts->tv_nsec = 1000000L * (long)tb.millitm;
|
||||||
|
#else
|
||||||
|
struct timeval tv;
|
||||||
|
gettimeofday(&tv, NULL);
|
||||||
|
ts->tv_sec = (time_t)tv.tv_sec;
|
||||||
|
ts->tv_nsec = 1000L * (long)tv.tv_usec;
|
||||||
|
#endif
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif // _TTHREAD_EMULATE_CLOCK_GETTIME_
|
||||||
|
|
|
@ -0,0 +1,443 @@
|
||||||
|
/* -*- mode: c; tab-width: 2; indent-tabs-mode: nil; -*-
|
||||||
|
Copyright (c) 2012 Marcus Geelnard
|
||||||
|
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _TINYCTHREAD_H_
|
||||||
|
#define _TINYCTHREAD_H_
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* @mainpage TinyCThread API Reference
|
||||||
|
*
|
||||||
|
* @section intro_sec Introduction
|
||||||
|
* TinyCThread is a minimal, portable implementation of basic threading
|
||||||
|
* classes for C.
|
||||||
|
*
|
||||||
|
* They closely mimic the functionality and naming of the C11 standard, and
|
||||||
|
* should be easily replaceable with the corresponding standard variants.
|
||||||
|
*
|
||||||
|
* @section port_sec Portability
|
||||||
|
* The Win32 variant uses the native Win32 API for implementing the thread
|
||||||
|
* classes, while for other systems, the POSIX threads API (pthread) is used.
|
||||||
|
*
|
||||||
|
* @section misc_sec Miscellaneous
|
||||||
|
* The following special keywords are available: #_Thread_local.
|
||||||
|
*
|
||||||
|
* For more detailed information, browse the different sections of this
|
||||||
|
* documentation. A good place to start is:
|
||||||
|
* tinycthread.h.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Which platform are we on? */
|
||||||
|
#if !defined(_TTHREAD_PLATFORM_DEFINED_)
|
||||||
|
#if defined(_WIN32) || defined(__WIN32__) || defined(__WINDOWS__)
|
||||||
|
#define _TTHREAD_WIN32_
|
||||||
|
#else
|
||||||
|
#define _TTHREAD_POSIX_
|
||||||
|
#endif
|
||||||
|
#define _TTHREAD_PLATFORM_DEFINED_
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Activate some POSIX functionality (e.g. clock_gettime and recursive mutexes) */
|
||||||
|
#if defined(_TTHREAD_POSIX_)
|
||||||
|
#undef _FEATURES_H
|
||||||
|
#if !defined(_GNU_SOURCE)
|
||||||
|
#define _GNU_SOURCE
|
||||||
|
#endif
|
||||||
|
#if !defined(_POSIX_C_SOURCE) || ((_POSIX_C_SOURCE - 0) < 199309L)
|
||||||
|
#undef _POSIX_C_SOURCE
|
||||||
|
#define _POSIX_C_SOURCE 199309L
|
||||||
|
#endif
|
||||||
|
#if !defined(_XOPEN_SOURCE) || ((_XOPEN_SOURCE - 0) < 500)
|
||||||
|
#undef _XOPEN_SOURCE
|
||||||
|
#define _XOPEN_SOURCE 500
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Generic includes */
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
|
/* Platform specific includes */
|
||||||
|
#if defined(_TTHREAD_POSIX_)
|
||||||
|
#include <sys/time.h>
|
||||||
|
#include <pthread.h>
|
||||||
|
#elif defined(_TTHREAD_WIN32_)
|
||||||
|
#ifndef WIN32_LEAN_AND_MEAN
|
||||||
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
#define __UNDEF_LEAN_AND_MEAN
|
||||||
|
#endif
|
||||||
|
#include <windows.h>
|
||||||
|
#ifdef __UNDEF_LEAN_AND_MEAN
|
||||||
|
#undef WIN32_LEAN_AND_MEAN
|
||||||
|
#undef __UNDEF_LEAN_AND_MEAN
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Workaround for missing TIME_UTC: If time.h doesn't provide TIME_UTC,
|
||||||
|
it's quite likely that libc does not support it either. Hence, fall back to
|
||||||
|
the only other supported time specifier: CLOCK_REALTIME (and if that fails,
|
||||||
|
we're probably emulating clock_gettime anyway, so anything goes). */
|
||||||
|
#ifndef TIME_UTC
|
||||||
|
#ifdef CLOCK_REALTIME
|
||||||
|
#define TIME_UTC CLOCK_REALTIME
|
||||||
|
#else
|
||||||
|
#define TIME_UTC 0
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Workaround for missing clock_gettime (most Windows compilers, afaik) */
|
||||||
|
#if defined(_TTHREAD_WIN32_) || defined(__APPLE_CC__)
|
||||||
|
#define _TTHREAD_EMULATE_CLOCK_GETTIME_
|
||||||
|
/* Emulate struct timespec */
|
||||||
|
#if defined(_TTHREAD_WIN32_)
|
||||||
|
struct _ttherad_timespec {
|
||||||
|
time_t tv_sec;
|
||||||
|
long tv_nsec;
|
||||||
|
};
|
||||||
|
#define timespec _ttherad_timespec
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Emulate clockid_t */
|
||||||
|
typedef int _tthread_clockid_t;
|
||||||
|
#define clockid_t _tthread_clockid_t
|
||||||
|
|
||||||
|
/* Emulate clock_gettime */
|
||||||
|
int _tthread_clock_gettime(clockid_t clk_id, struct timespec *ts);
|
||||||
|
#define clock_gettime _tthread_clock_gettime
|
||||||
|
#ifndef CLOCK_REALTIME
|
||||||
|
#define CLOCK_REALTIME 0
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/** TinyCThread version (major number). */
|
||||||
|
#define TINYCTHREAD_VERSION_MAJOR 1
|
||||||
|
/** TinyCThread version (minor number). */
|
||||||
|
#define TINYCTHREAD_VERSION_MINOR 1
|
||||||
|
/** TinyCThread version (full version). */
|
||||||
|
#define TINYCTHREAD_VERSION (TINYCTHREAD_VERSION_MAJOR * 100 + TINYCTHREAD_VERSION_MINOR)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @def _Thread_local
|
||||||
|
* Thread local storage keyword.
|
||||||
|
* A variable that is declared with the @c _Thread_local keyword makes the
|
||||||
|
* value of the variable local to each thread (known as thread-local storage,
|
||||||
|
* or TLS). Example usage:
|
||||||
|
* @code
|
||||||
|
* // This variable is local to each thread.
|
||||||
|
* _Thread_local int variable;
|
||||||
|
* @endcode
|
||||||
|
* @note The @c _Thread_local keyword is a macro that maps to the corresponding
|
||||||
|
* compiler directive (e.g. @c __declspec(thread)).
|
||||||
|
* @note This directive is currently not supported on Mac OS X (it will give
|
||||||
|
* a compiler error), since compile-time TLS is not supported in the Mac OS X
|
||||||
|
* executable format. Also, some older versions of MinGW (before GCC 4.x) do
|
||||||
|
* not support this directive.
|
||||||
|
* @hideinitializer
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* FIXME: Check for a PROPER value of __STDC_VERSION__ to know if we have C11 */
|
||||||
|
#if !(defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201102L)) && !defined(_Thread_local)
|
||||||
|
#if defined(__GNUC__) || defined(__INTEL_COMPILER) || defined(__SUNPRO_CC) || defined(__IBMCPP__)
|
||||||
|
#define _Thread_local __thread
|
||||||
|
#else
|
||||||
|
#define _Thread_local __declspec(thread)
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Macros */
|
||||||
|
#define TSS_DTOR_ITERATIONS 0
|
||||||
|
|
||||||
|
/* Function return values */
|
||||||
|
#define thrd_error 0 /**< The requested operation failed */
|
||||||
|
#define thrd_success 1 /**< The requested operation succeeded */
|
||||||
|
#define thrd_timeout 2 /**< The time specified in the call was reached without acquiring the requested resource */
|
||||||
|
#define thrd_busy 3 /**< The requested operation failed because a tesource requested by a test and return function is already in use */
|
||||||
|
#define thrd_nomem 4 /**< The requested operation failed because it was unable to allocate memory */
|
||||||
|
|
||||||
|
/* Mutex types */
|
||||||
|
#define mtx_plain 1
|
||||||
|
#define mtx_timed 2
|
||||||
|
#define mtx_try 4
|
||||||
|
#define mtx_recursive 8
|
||||||
|
|
||||||
|
/* Mutex */
|
||||||
|
#if defined(_TTHREAD_WIN32_)
|
||||||
|
typedef struct {
|
||||||
|
CRITICAL_SECTION mHandle; /* Critical section handle */
|
||||||
|
int mAlreadyLocked; /* TRUE if the mutex is already locked */
|
||||||
|
int mRecursive; /* TRUE if the mutex is recursive */
|
||||||
|
} mtx_t;
|
||||||
|
#else
|
||||||
|
typedef pthread_mutex_t mtx_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/** Create a mutex object.
|
||||||
|
* @param mtx A mutex object.
|
||||||
|
* @param type Bit-mask that must have one of the following six values:
|
||||||
|
* @li @c mtx_plain for a simple non-recursive mutex
|
||||||
|
* @li @c mtx_timed for a non-recursive mutex that supports timeout
|
||||||
|
* @li @c mtx_try for a non-recursive mutex that supports test and return
|
||||||
|
* @li @c mtx_plain | @c mtx_recursive (same as @c mtx_plain, but recursive)
|
||||||
|
* @li @c mtx_timed | @c mtx_recursive (same as @c mtx_timed, but recursive)
|
||||||
|
* @li @c mtx_try | @c mtx_recursive (same as @c mtx_try, but recursive)
|
||||||
|
* @return @ref thrd_success on success, or @ref thrd_error if the request could
|
||||||
|
* not be honored.
|
||||||
|
*/
|
||||||
|
int mtx_init(mtx_t *mtx, int type);
|
||||||
|
|
||||||
|
/** Release any resources used by the given mutex.
|
||||||
|
* @param mtx A mutex object.
|
||||||
|
*/
|
||||||
|
void mtx_destroy(mtx_t *mtx);
|
||||||
|
|
||||||
|
/** Lock the given mutex.
|
||||||
|
* Blocks until the given mutex can be locked. If the mutex is non-recursive, and
|
||||||
|
* the calling thread already has a lock on the mutex, this call will block
|
||||||
|
* forever.
|
||||||
|
* @param mtx A mutex object.
|
||||||
|
* @return @ref thrd_success on success, or @ref thrd_error if the request could
|
||||||
|
* not be honored.
|
||||||
|
*/
|
||||||
|
int mtx_lock(mtx_t *mtx);
|
||||||
|
|
||||||
|
/** NOT YET IMPLEMENTED.
|
||||||
|
*/
|
||||||
|
int mtx_timedlock(mtx_t *mtx, const struct timespec *ts);
|
||||||
|
|
||||||
|
/** Try to lock the given mutex.
|
||||||
|
* The specified mutex shall support either test and return or timeout. If the
|
||||||
|
* mutex is already locked, the function returns without blocking.
|
||||||
|
* @param mtx A mutex object.
|
||||||
|
* @return @ref thrd_success on success, or @ref thrd_busy if the resource
|
||||||
|
* requested is already in use, or @ref thrd_error if the request could not be
|
||||||
|
* honored.
|
||||||
|
*/
|
||||||
|
int mtx_trylock(mtx_t *mtx);
|
||||||
|
|
||||||
|
/** Unlock the given mutex.
|
||||||
|
* @param mtx A mutex object.
|
||||||
|
* @return @ref thrd_success on success, or @ref thrd_error if the request could
|
||||||
|
* not be honored.
|
||||||
|
*/
|
||||||
|
int mtx_unlock(mtx_t *mtx);
|
||||||
|
|
||||||
|
/* Condition variable */
|
||||||
|
#if defined(_TTHREAD_WIN32_)
|
||||||
|
typedef struct {
|
||||||
|
HANDLE mEvents[2]; /* Signal and broadcast event HANDLEs. */
|
||||||
|
unsigned int mWaitersCount; /* Count of the number of waiters. */
|
||||||
|
CRITICAL_SECTION mWaitersCountLock; /* Serialize access to mWaitersCount. */
|
||||||
|
} cnd_t;
|
||||||
|
#else
|
||||||
|
typedef pthread_cond_t cnd_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/** Create a condition variable object.
|
||||||
|
* @param cond A condition variable object.
|
||||||
|
* @return @ref thrd_success on success, or @ref thrd_error if the request could
|
||||||
|
* not be honored.
|
||||||
|
*/
|
||||||
|
int cnd_init(cnd_t *cond);
|
||||||
|
|
||||||
|
/** Release any resources used by the given condition variable.
|
||||||
|
* @param cond A condition variable object.
|
||||||
|
*/
|
||||||
|
void cnd_destroy(cnd_t *cond);
|
||||||
|
|
||||||
|
/** Signal a condition variable.
|
||||||
|
* Unblocks one of the threads that are blocked on the given condition variable
|
||||||
|
* at the time of the call. If no threads are blocked on the condition variable
|
||||||
|
* at the time of the call, the function does nothing and return success.
|
||||||
|
* @param cond A condition variable object.
|
||||||
|
* @return @ref thrd_success on success, or @ref thrd_error if the request could
|
||||||
|
* not be honored.
|
||||||
|
*/
|
||||||
|
int cnd_signal(cnd_t *cond);
|
||||||
|
|
||||||
|
/** Broadcast a condition variable.
|
||||||
|
* Unblocks all of the threads that are blocked on the given condition variable
|
||||||
|
* at the time of the call. If no threads are blocked on the condition variable
|
||||||
|
* at the time of the call, the function does nothing and return success.
|
||||||
|
* @param cond A condition variable object.
|
||||||
|
* @return @ref thrd_success on success, or @ref thrd_error if the request could
|
||||||
|
* not be honored.
|
||||||
|
*/
|
||||||
|
int cnd_broadcast(cnd_t *cond);
|
||||||
|
|
||||||
|
/** Wait for a condition variable to become signaled.
|
||||||
|
* The function atomically unlocks the given mutex and endeavors to block until
|
||||||
|
* the given condition variable is signaled by a call to cnd_signal or to
|
||||||
|
* cnd_broadcast. When the calling thread becomes unblocked it locks the mutex
|
||||||
|
* before it returns.
|
||||||
|
* @param cond A condition variable object.
|
||||||
|
* @param mtx A mutex object.
|
||||||
|
* @return @ref thrd_success on success, or @ref thrd_error if the request could
|
||||||
|
* not be honored.
|
||||||
|
*/
|
||||||
|
int cnd_wait(cnd_t *cond, mtx_t *mtx);
|
||||||
|
|
||||||
|
/** Wait for a condition variable to become signaled.
|
||||||
|
* The function atomically unlocks the given mutex and endeavors to block until
|
||||||
|
* the given condition variable is signaled by a call to cnd_signal or to
|
||||||
|
* cnd_broadcast, or until after the specified time. When the calling thread
|
||||||
|
* becomes unblocked it locks the mutex before it returns.
|
||||||
|
* @param cond A condition variable object.
|
||||||
|
* @param mtx A mutex object.
|
||||||
|
* @param xt A point in time at which the request will time out (absolute time).
|
||||||
|
* @return @ref thrd_success upon success, or @ref thrd_timeout if the time
|
||||||
|
* specified in the call was reached without acquiring the requested resource, or
|
||||||
|
* @ref thrd_error if the request could not be honored.
|
||||||
|
*/
|
||||||
|
int cnd_timedwait(cnd_t *cond, mtx_t *mtx, const struct timespec *ts);
|
||||||
|
|
||||||
|
/* Thread */
|
||||||
|
#if defined(_TTHREAD_WIN32_)
|
||||||
|
typedef HANDLE thrd_t;
|
||||||
|
#else
|
||||||
|
typedef pthread_t thrd_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/** Thread start function.
|
||||||
|
* Any thread that is started with the @ref thrd_create() function must be
|
||||||
|
* started through a function of this type.
|
||||||
|
* @param arg The thread argument (the @c arg argument of the corresponding
|
||||||
|
* @ref thrd_create() call).
|
||||||
|
* @return The thread return value, which can be obtained by another thread
|
||||||
|
* by using the @ref thrd_join() function.
|
||||||
|
*/
|
||||||
|
typedef int (*thrd_start_t)(void *arg);
|
||||||
|
|
||||||
|
/** Create a new thread.
|
||||||
|
* @param thr Identifier of the newly created thread.
|
||||||
|
* @param func A function pointer to the function that will be executed in
|
||||||
|
* the new thread.
|
||||||
|
* @param arg An argument to the thread function.
|
||||||
|
* @return @ref thrd_success on success, or @ref thrd_nomem if no memory could
|
||||||
|
* be allocated for the thread requested, or @ref thrd_error if the request
|
||||||
|
* could not be honored.
|
||||||
|
* @note A thread’s identifier may be reused for a different thread once the
|
||||||
|
* original thread has exited and either been detached or joined to another
|
||||||
|
* thread.
|
||||||
|
*/
|
||||||
|
int thrd_create(thrd_t *thr, thrd_start_t func, void *arg);
|
||||||
|
|
||||||
|
/** Identify the calling thread.
|
||||||
|
* @return The identifier of the calling thread.
|
||||||
|
*/
|
||||||
|
thrd_t thrd_current(void);
|
||||||
|
|
||||||
|
/** NOT YET IMPLEMENTED.
|
||||||
|
*/
|
||||||
|
int thrd_detach(thrd_t thr);
|
||||||
|
|
||||||
|
/** Compare two thread identifiers.
|
||||||
|
* The function determines if two thread identifiers refer to the same thread.
|
||||||
|
* @return Zero if the two thread identifiers refer to different threads.
|
||||||
|
* Otherwise a nonzero value is returned.
|
||||||
|
*/
|
||||||
|
int thrd_equal(thrd_t thr0, thrd_t thr1);
|
||||||
|
|
||||||
|
/** Terminate execution of the calling thread.
|
||||||
|
* @param res Result code of the calling thread.
|
||||||
|
*/
|
||||||
|
void thrd_exit(int res);
|
||||||
|
|
||||||
|
/** Wait for a thread to terminate.
|
||||||
|
* The function joins the given thread with the current thread by blocking
|
||||||
|
* until the other thread has terminated.
|
||||||
|
* @param thr The thread to join with.
|
||||||
|
* @param res If this pointer is not NULL, the function will store the result
|
||||||
|
* code of the given thread in the integer pointed to by @c res.
|
||||||
|
* @return @ref thrd_success on success, or @ref thrd_error if the request could
|
||||||
|
* not be honored.
|
||||||
|
*/
|
||||||
|
int thrd_join(thrd_t thr, int *res);
|
||||||
|
|
||||||
|
/** Put the calling thread to sleep.
|
||||||
|
* Suspend execution of the calling thread.
|
||||||
|
* @param time_point A point in time at which the thread will resume (absolute time).
|
||||||
|
* @param remaining If non-NULL, this parameter will hold the remaining time until
|
||||||
|
* time_point upon return. This will typically be zero, but if
|
||||||
|
* the thread was woken up by a signal that is not ignored before
|
||||||
|
* time_point was reached @c remaining will hold a positive
|
||||||
|
* time.
|
||||||
|
* @return 0 (zero) on successful sleep, or -1 if an interrupt occurred.
|
||||||
|
*/
|
||||||
|
int thrd_sleep(const struct timespec *time_point, struct timespec *remaining);
|
||||||
|
|
||||||
|
/** Yield execution to another thread.
|
||||||
|
* Permit other threads to run, even if the current thread would ordinarily
|
||||||
|
* continue to run.
|
||||||
|
*/
|
||||||
|
void thrd_yield(void);
|
||||||
|
|
||||||
|
/* Thread local storage */
|
||||||
|
#if defined(_TTHREAD_WIN32_)
|
||||||
|
typedef DWORD tss_t;
|
||||||
|
#else
|
||||||
|
typedef pthread_key_t tss_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/** Destructor function for a thread-specific storage.
|
||||||
|
* @param val The value of the destructed thread-specific storage.
|
||||||
|
*/
|
||||||
|
typedef void (*tss_dtor_t)(void *val);
|
||||||
|
|
||||||
|
/** Create a thread-specific storage.
|
||||||
|
* @param key The unique key identifier that will be set if the function is
|
||||||
|
* successful.
|
||||||
|
* @param dtor Destructor function. This can be NULL.
|
||||||
|
* @return @ref thrd_success on success, or @ref thrd_error if the request could
|
||||||
|
* not be honored.
|
||||||
|
* @note The destructor function is not supported under Windows. If @c dtor is
|
||||||
|
* not NULL when calling this function under Windows, the function will fail
|
||||||
|
* and return @ref thrd_error.
|
||||||
|
*/
|
||||||
|
int tss_create(tss_t *key, tss_dtor_t dtor);
|
||||||
|
|
||||||
|
/** Delete a thread-specific storage.
|
||||||
|
* The function releases any resources used by the given thread-specific
|
||||||
|
* storage.
|
||||||
|
* @param key The key that shall be deleted.
|
||||||
|
*/
|
||||||
|
void tss_delete(tss_t key);
|
||||||
|
|
||||||
|
/** Get the value for a thread-specific storage.
|
||||||
|
* @param key The thread-specific storage identifier.
|
||||||
|
* @return The value for the current thread held in the given thread-specific
|
||||||
|
* storage.
|
||||||
|
*/
|
||||||
|
void *tss_get(tss_t key);
|
||||||
|
|
||||||
|
/** Set the value for a thread-specific storage.
|
||||||
|
* @param key The thread-specific storage identifier.
|
||||||
|
* @param val The value of the thread-specific storage to set for the current
|
||||||
|
* thread.
|
||||||
|
* @return @ref thrd_success on success, or @ref thrd_error if the request could
|
||||||
|
* not be honored.
|
||||||
|
*/
|
||||||
|
int tss_set(tss_t key, void *val);
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* _TINYTHREAD_H_ */
|
||||||
|
|
|
@ -0,0 +1,247 @@
|
||||||
|
// ISO C9x compliant stdint.h for Microsoft Visual Studio
|
||||||
|
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
|
||||||
|
//
|
||||||
|
// Copyright (c) 2006-2008 Alexander Chemeris
|
||||||
|
//
|
||||||
|
// Redistribution and use in source and binary forms, with or without
|
||||||
|
// modification, are permitted provided that the following conditions are met:
|
||||||
|
//
|
||||||
|
// 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
// this list of conditions and the following disclaimer.
|
||||||
|
//
|
||||||
|
// 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
// notice, this list of conditions and the following disclaimer in the
|
||||||
|
// documentation and/or other materials provided with the distribution.
|
||||||
|
//
|
||||||
|
// 3. The name of the author may be used to endorse or promote products
|
||||||
|
// derived from this software without specific prior written permission.
|
||||||
|
//
|
||||||
|
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||||
|
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||||
|
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||||
|
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
|
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||||
|
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
//
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef _MSC_VER // [
|
||||||
|
#error "Use this header only with Microsoft Visual C++ compilers!"
|
||||||
|
#endif // _MSC_VER ]
|
||||||
|
|
||||||
|
#ifndef _MSC_STDINT_H_ // [
|
||||||
|
#define _MSC_STDINT_H_
|
||||||
|
|
||||||
|
#if _MSC_VER > 1000
|
||||||
|
#pragma once
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <limits.h>
|
||||||
|
|
||||||
|
// For Visual Studio 6 in C++ mode and for many Visual Studio versions when
|
||||||
|
// compiling for ARM we should wrap <wchar.h> include with 'extern "C++" {}'
|
||||||
|
// or compiler give many errors like this:
|
||||||
|
// error C2733: second C linkage of overloaded function 'wmemchr' not allowed
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
# include <wchar.h>
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Define _W64 macros to mark types changing their size, like intptr_t.
|
||||||
|
#ifndef _W64
|
||||||
|
# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300
|
||||||
|
# define _W64 __w64
|
||||||
|
# else
|
||||||
|
# define _W64
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
// 7.18.1 Integer types
|
||||||
|
|
||||||
|
// 7.18.1.1 Exact-width integer types
|
||||||
|
|
||||||
|
// Visual Studio 6 and Embedded Visual C++ 4 doesn't
|
||||||
|
// realize that, e.g. char has the same size as __int8
|
||||||
|
// so we give up on __intX for them.
|
||||||
|
#if (_MSC_VER < 1300)
|
||||||
|
typedef signed char int8_t;
|
||||||
|
typedef signed short int16_t;
|
||||||
|
typedef signed int int32_t;
|
||||||
|
typedef unsigned char uint8_t;
|
||||||
|
typedef unsigned short uint16_t;
|
||||||
|
typedef unsigned int uint32_t;
|
||||||
|
#else
|
||||||
|
typedef signed __int8 int8_t;
|
||||||
|
typedef signed __int16 int16_t;
|
||||||
|
typedef signed __int32 int32_t;
|
||||||
|
typedef unsigned __int8 uint8_t;
|
||||||
|
typedef unsigned __int16 uint16_t;
|
||||||
|
typedef unsigned __int32 uint32_t;
|
||||||
|
#endif
|
||||||
|
typedef signed __int64 int64_t;
|
||||||
|
typedef unsigned __int64 uint64_t;
|
||||||
|
|
||||||
|
|
||||||
|
// 7.18.1.2 Minimum-width integer types
|
||||||
|
typedef int8_t int_least8_t;
|
||||||
|
typedef int16_t int_least16_t;
|
||||||
|
typedef int32_t int_least32_t;
|
||||||
|
typedef int64_t int_least64_t;
|
||||||
|
typedef uint8_t uint_least8_t;
|
||||||
|
typedef uint16_t uint_least16_t;
|
||||||
|
typedef uint32_t uint_least32_t;
|
||||||
|
typedef uint64_t uint_least64_t;
|
||||||
|
|
||||||
|
// 7.18.1.3 Fastest minimum-width integer types
|
||||||
|
typedef int8_t int_fast8_t;
|
||||||
|
typedef int16_t int_fast16_t;
|
||||||
|
typedef int32_t int_fast32_t;
|
||||||
|
typedef int64_t int_fast64_t;
|
||||||
|
typedef uint8_t uint_fast8_t;
|
||||||
|
typedef uint16_t uint_fast16_t;
|
||||||
|
typedef uint32_t uint_fast32_t;
|
||||||
|
typedef uint64_t uint_fast64_t;
|
||||||
|
|
||||||
|
// 7.18.1.4 Integer types capable of holding object pointers
|
||||||
|
#ifdef _WIN64 // [
|
||||||
|
typedef signed __int64 intptr_t;
|
||||||
|
typedef unsigned __int64 uintptr_t;
|
||||||
|
#else // _WIN64 ][
|
||||||
|
typedef _W64 signed int intptr_t;
|
||||||
|
typedef _W64 unsigned int uintptr_t;
|
||||||
|
#endif // _WIN64 ]
|
||||||
|
|
||||||
|
// 7.18.1.5 Greatest-width integer types
|
||||||
|
typedef int64_t intmax_t;
|
||||||
|
typedef uint64_t uintmax_t;
|
||||||
|
|
||||||
|
|
||||||
|
// 7.18.2 Limits of specified-width integer types
|
||||||
|
|
||||||
|
#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259
|
||||||
|
|
||||||
|
// 7.18.2.1 Limits of exact-width integer types
|
||||||
|
#define INT8_MIN ((int8_t)_I8_MIN)
|
||||||
|
#define INT8_MAX _I8_MAX
|
||||||
|
#define INT16_MIN ((int16_t)_I16_MIN)
|
||||||
|
#define INT16_MAX _I16_MAX
|
||||||
|
#define INT32_MIN ((int32_t)_I32_MIN)
|
||||||
|
#define INT32_MAX _I32_MAX
|
||||||
|
#define INT64_MIN ((int64_t)_I64_MIN)
|
||||||
|
#define INT64_MAX _I64_MAX
|
||||||
|
#define UINT8_MAX _UI8_MAX
|
||||||
|
#define UINT16_MAX _UI16_MAX
|
||||||
|
#define UINT32_MAX _UI32_MAX
|
||||||
|
#define UINT64_MAX _UI64_MAX
|
||||||
|
|
||||||
|
// 7.18.2.2 Limits of minimum-width integer types
|
||||||
|
#define INT_LEAST8_MIN INT8_MIN
|
||||||
|
#define INT_LEAST8_MAX INT8_MAX
|
||||||
|
#define INT_LEAST16_MIN INT16_MIN
|
||||||
|
#define INT_LEAST16_MAX INT16_MAX
|
||||||
|
#define INT_LEAST32_MIN INT32_MIN
|
||||||
|
#define INT_LEAST32_MAX INT32_MAX
|
||||||
|
#define INT_LEAST64_MIN INT64_MIN
|
||||||
|
#define INT_LEAST64_MAX INT64_MAX
|
||||||
|
#define UINT_LEAST8_MAX UINT8_MAX
|
||||||
|
#define UINT_LEAST16_MAX UINT16_MAX
|
||||||
|
#define UINT_LEAST32_MAX UINT32_MAX
|
||||||
|
#define UINT_LEAST64_MAX UINT64_MAX
|
||||||
|
|
||||||
|
// 7.18.2.3 Limits of fastest minimum-width integer types
|
||||||
|
#define INT_FAST8_MIN INT8_MIN
|
||||||
|
#define INT_FAST8_MAX INT8_MAX
|
||||||
|
#define INT_FAST16_MIN INT16_MIN
|
||||||
|
#define INT_FAST16_MAX INT16_MAX
|
||||||
|
#define INT_FAST32_MIN INT32_MIN
|
||||||
|
#define INT_FAST32_MAX INT32_MAX
|
||||||
|
#define INT_FAST64_MIN INT64_MIN
|
||||||
|
#define INT_FAST64_MAX INT64_MAX
|
||||||
|
#define UINT_FAST8_MAX UINT8_MAX
|
||||||
|
#define UINT_FAST16_MAX UINT16_MAX
|
||||||
|
#define UINT_FAST32_MAX UINT32_MAX
|
||||||
|
#define UINT_FAST64_MAX UINT64_MAX
|
||||||
|
|
||||||
|
// 7.18.2.4 Limits of integer types capable of holding object pointers
|
||||||
|
#ifdef _WIN64 // [
|
||||||
|
# define INTPTR_MIN INT64_MIN
|
||||||
|
# define INTPTR_MAX INT64_MAX
|
||||||
|
# define UINTPTR_MAX UINT64_MAX
|
||||||
|
#else // _WIN64 ][
|
||||||
|
# define INTPTR_MIN INT32_MIN
|
||||||
|
# define INTPTR_MAX INT32_MAX
|
||||||
|
# define UINTPTR_MAX UINT32_MAX
|
||||||
|
#endif // _WIN64 ]
|
||||||
|
|
||||||
|
// 7.18.2.5 Limits of greatest-width integer types
|
||||||
|
#define INTMAX_MIN INT64_MIN
|
||||||
|
#define INTMAX_MAX INT64_MAX
|
||||||
|
#define UINTMAX_MAX UINT64_MAX
|
||||||
|
|
||||||
|
// 7.18.3 Limits of other integer types
|
||||||
|
|
||||||
|
#ifdef _WIN64 // [
|
||||||
|
# define PTRDIFF_MIN _I64_MIN
|
||||||
|
# define PTRDIFF_MAX _I64_MAX
|
||||||
|
#else // _WIN64 ][
|
||||||
|
# define PTRDIFF_MIN _I32_MIN
|
||||||
|
# define PTRDIFF_MAX _I32_MAX
|
||||||
|
#endif // _WIN64 ]
|
||||||
|
|
||||||
|
#define SIG_ATOMIC_MIN INT_MIN
|
||||||
|
#define SIG_ATOMIC_MAX INT_MAX
|
||||||
|
|
||||||
|
#ifndef SIZE_MAX // [
|
||||||
|
# ifdef _WIN64 // [
|
||||||
|
# define SIZE_MAX _UI64_MAX
|
||||||
|
# else // _WIN64 ][
|
||||||
|
# define SIZE_MAX _UI32_MAX
|
||||||
|
# endif // _WIN64 ]
|
||||||
|
#endif // SIZE_MAX ]
|
||||||
|
|
||||||
|
// WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h>
|
||||||
|
#ifndef WCHAR_MIN // [
|
||||||
|
# define WCHAR_MIN 0
|
||||||
|
#endif // WCHAR_MIN ]
|
||||||
|
#ifndef WCHAR_MAX // [
|
||||||
|
# define WCHAR_MAX _UI16_MAX
|
||||||
|
#endif // WCHAR_MAX ]
|
||||||
|
|
||||||
|
#define WINT_MIN 0
|
||||||
|
#define WINT_MAX _UI16_MAX
|
||||||
|
|
||||||
|
#endif // __STDC_LIMIT_MACROS ]
|
||||||
|
|
||||||
|
|
||||||
|
// 7.18.4 Limits of other integer types
|
||||||
|
|
||||||
|
#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260
|
||||||
|
|
||||||
|
// 7.18.4.1 Macros for minimum-width integer constants
|
||||||
|
|
||||||
|
#define INT8_C(val) val##i8
|
||||||
|
#define INT16_C(val) val##i16
|
||||||
|
#define INT32_C(val) val##i32
|
||||||
|
#define INT64_C(val) val##i64
|
||||||
|
|
||||||
|
#define UINT8_C(val) val##ui8
|
||||||
|
#define UINT16_C(val) val##ui16
|
||||||
|
#define UINT32_C(val) val##ui32
|
||||||
|
#define UINT64_C(val) val##ui64
|
||||||
|
|
||||||
|
// 7.18.4.2 Macros for greatest-width integer constants
|
||||||
|
#define INTMAX_C INT64_C
|
||||||
|
#define UINTMAX_C UINT64_C
|
||||||
|
|
||||||
|
#endif // __STDC_CONSTANT_MACROS ]
|
||||||
|
|
||||||
|
|
||||||
|
#endif // _MSC_STDINT_H_ ]
|
|
@ -0,0 +1,34 @@
|
||||||
|
|
||||||
|
# NOTE: The order of this list determines the order of items in the Guides
|
||||||
|
# (i.e. Pages) list in the generated documentation
|
||||||
|
set(GLFW_DOXYGEN_SOURCES
|
||||||
|
"include/GLFW/glfw3.h"
|
||||||
|
"include/GLFW/glfw3native.h"
|
||||||
|
"docs/main.dox"
|
||||||
|
"docs/news.dox"
|
||||||
|
"docs/quick.dox"
|
||||||
|
"docs/moving.dox"
|
||||||
|
"docs/compile.dox"
|
||||||
|
"docs/build.dox"
|
||||||
|
"docs/intro.dox"
|
||||||
|
"docs/context.dox"
|
||||||
|
"docs/monitor.dox"
|
||||||
|
"docs/window.dox"
|
||||||
|
"docs/input.dox"
|
||||||
|
"docs/vulkan.dox"
|
||||||
|
"docs/compat.dox"
|
||||||
|
"docs/internal.dox")
|
||||||
|
|
||||||
|
# Format the source list into a Doxyfile INPUT value that Doxygen can parse
|
||||||
|
foreach(path IN LISTS GLFW_DOXYGEN_SOURCES)
|
||||||
|
set(GLFW_DOXYGEN_INPUT "${GLFW_DOXYGEN_INPUT} \\\n\"${GLFW_SOURCE_DIR}/${path}\"")
|
||||||
|
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_target_properties(docs PROPERTIES FOLDER "GLFW3")
|
||||||
|
|
|
@ -0,0 +1,391 @@
|
||||||
|
# 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 or in the IRC channel `#glfw` on
|
||||||
|
[Libera.Chat](https://libera.chat/).
|
||||||
|
|
||||||
|
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 or in the IRC channel. 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 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, briefly describing the feature
|
||||||
|
- Guide documentation, with minimal examples, in the relevant guide
|
||||||
|
- Reference documentation, with all applicable tags
|
||||||
|
- Cross-references and mentions in appropriate places
|
||||||
|
- Credits entries 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.dox`.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
|
@ -0,0 +1,71 @@
|
||||||
|
<doxygenlayout version="1.0">
|
||||||
|
<!-- Generated by doxygen 1.8.14 -->
|
||||||
|
<!-- Navigation index tabs for HTML output -->
|
||||||
|
<navindex>
|
||||||
|
<tab type="mainpage" visible="yes" title="Introduction"/>
|
||||||
|
<tab type="user" url="quick_guide.html" title="Tutorial"/>
|
||||||
|
<tab type="pages" visible="yes" title="Guides" intro=""/>
|
||||||
|
<tab type="modules" visible="yes" title="Reference" intro=""/>
|
||||||
|
<tab type="filelist" visible="yes" title="Files"/>
|
||||||
|
</navindex>
|
||||||
|
|
||||||
|
<!-- Layout definition for a file page -->
|
||||||
|
<file>
|
||||||
|
<detaileddescription title="Description"/>
|
||||||
|
<includes visible="$SHOW_INCLUDE_FILES"/>
|
||||||
|
<sourcelink visible="yes"/>
|
||||||
|
<memberdecl>
|
||||||
|
<constantgroups visible="yes" title=""/>
|
||||||
|
<defines title=""/>
|
||||||
|
<typedefs title=""/>
|
||||||
|
<enums title=""/>
|
||||||
|
<functions title=""/>
|
||||||
|
<variables title=""/>
|
||||||
|
<membergroups visible="yes"/>
|
||||||
|
</memberdecl>
|
||||||
|
<memberdef>
|
||||||
|
<defines title=""/>
|
||||||
|
<typedefs title=""/>
|
||||||
|
<enums title=""/>
|
||||||
|
<functions title=""/>
|
||||||
|
<variables title=""/>
|
||||||
|
</memberdef>
|
||||||
|
<authorsection/>
|
||||||
|
</file>
|
||||||
|
|
||||||
|
<!-- Layout definition for a group page -->
|
||||||
|
<group>
|
||||||
|
<detaileddescription title="Description"/>
|
||||||
|
<memberdecl>
|
||||||
|
<nestedgroups visible="yes" title=""/>
|
||||||
|
<dirs visible="yes" title=""/>
|
||||||
|
<files visible="yes" title=""/>
|
||||||
|
<defines title=""/>
|
||||||
|
<typedefs title=""/>
|
||||||
|
<enums title=""/>
|
||||||
|
<enumvalues title=""/>
|
||||||
|
<functions title=""/>
|
||||||
|
<variables title=""/>
|
||||||
|
</memberdecl>
|
||||||
|
<memberdef>
|
||||||
|
<pagedocs/>
|
||||||
|
<defines title=""/>
|
||||||
|
<typedefs title=""/>
|
||||||
|
<enums title=""/>
|
||||||
|
<enumvalues title=""/>
|
||||||
|
<functions title=""/>
|
||||||
|
<variables title=""/>
|
||||||
|
</memberdef>
|
||||||
|
<authorsection visible="yes"/>
|
||||||
|
</group>
|
||||||
|
|
||||||
|
<!-- Layout definition for a directory page -->
|
||||||
|
<directory>
|
||||||
|
<briefdescription visible="yes"/>
|
||||||
|
<memberdecl>
|
||||||
|
<dirs visible="yes"/>
|
||||||
|
<files visible="yes"/>
|
||||||
|
</memberdecl>
|
||||||
|
<detaileddescription title=""/>
|
||||||
|
</directory>
|
||||||
|
</doxygenlayout>
|
|
@ -0,0 +1,14 @@
|
||||||
|
# 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/), and the `#glfw` IRC channel on
|
||||||
|
[Libera.Chat](https://libera.chat/).
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
|
@ -0,0 +1,348 @@
|
||||||
|
/*!
|
||||||
|
|
||||||
|
@page build_guide Building applications
|
||||||
|
|
||||||
|
@tableofcontents
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
|
||||||
|
@section build_include Including the GLFW header file
|
||||||
|
|
||||||
|
You should include the GLFW header in the source files where you use OpenGL or
|
||||||
|
GLFW.
|
||||||
|
|
||||||
|
@code
|
||||||
|
#include <GLFW/glfw3.h>
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
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](https://github.com/Dav1dde/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.
|
||||||
|
|
||||||
|
@code
|
||||||
|
#include <glad/gl.h>
|
||||||
|
#include <GLFW/glfw3.h>
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
@code
|
||||||
|
#define GLFW_INCLUDE_NONE
|
||||||
|
#include <GLFW/glfw3.h>
|
||||||
|
#include <glad/gl.h>
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
|
||||||
|
@subsection build_macros GLFW header option 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](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.
|
||||||
|
|
||||||
|
|
||||||
|
@section build_link Link with the right libraries
|
||||||
|
|
||||||
|
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](https://www.lurklurk.org/linkers/linkers.html) by
|
||||||
|
David Drysdale.
|
||||||
|
|
||||||
|
|
||||||
|
@subsection build_link_win32 With MinGW or Visual C++ on Windows
|
||||||
|
|
||||||
|
The static version of the GLFW library is named `glfw3`. When using this
|
||||||
|
version, it is also necessary to link with some libraries that GLFW uses.
|
||||||
|
|
||||||
|
When using MinGW to link an application with the static version of GLFW, you
|
||||||
|
must also explicitly link with `gdi32`. Other toolchains including MinGW-w64
|
||||||
|
include it in the set of default libraries along with other dependencies like
|
||||||
|
`user32` and `kernel32`.
|
||||||
|
|
||||||
|
The link library for the GLFW DLL is named `glfw3dll`. When compiling an
|
||||||
|
application that uses the DLL version of GLFW, you need to define the @ref
|
||||||
|
GLFW_DLL macro _before_ any inclusion of the GLFW header. This can be done
|
||||||
|
either with a compiler switch or by defining it in your source code.
|
||||||
|
|
||||||
|
|
||||||
|
@subsection build_link_cmake_source With CMake and GLFW 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.
|
||||||
|
|
||||||
|
When including GLFW as part of your build, you probably don't want to build the
|
||||||
|
GLFW tests, examples and documentation. To disable these, set the corresponding
|
||||||
|
cache variables before adding the GLFW source tree.
|
||||||
|
|
||||||
|
@code
|
||||||
|
set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
|
||||||
|
set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
|
||||||
|
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
Add the root directory of the GLFW source tree to your project. This will add
|
||||||
|
the `glfw` target to your project.
|
||||||
|
|
||||||
|
@code{.cmake}
|
||||||
|
add_subdirectory(path/to/glfw)
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
@code{.cmake}
|
||||||
|
target_link_libraries(myapp glfw)
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
@code{.cmake}
|
||||||
|
find_package(OpenGL REQUIRED)
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
@code{.cmake}
|
||||||
|
target_link_libraries(myapp OpenGL::GL)
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
For a minimal example of a program and GLFW sources built with CMake, see the
|
||||||
|
[GLFW CMake Starter](https://github.com/juliettef/GLFW-CMake-starter) on GitHub.
|
||||||
|
|
||||||
|
|
||||||
|
@subsection build_link_cmake_package With CMake and installed GLFW binaries
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
@code{.cmake}
|
||||||
|
find_package(glfw3 3.3 REQUIRED)
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
@code{.cmake}
|
||||||
|
target_link_libraries(myapp glfw)
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
@code{.cmake}
|
||||||
|
find_package(OpenGL REQUIRED)
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
@code{.cmake}
|
||||||
|
target_link_libraries(myapp OpenGL::GL)
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
|
||||||
|
@subsection build_link_pkgconfig With makefiles and pkg-config on Unix
|
||||||
|
|
||||||
|
GLFW supports [pkg-config](https://www.freedesktop.org/wiki/Software/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.
|
||||||
|
|
||||||
|
A typical compile and link command-line when using the static version of the
|
||||||
|
GLFW library may look like this:
|
||||||
|
|
||||||
|
@code{.sh}
|
||||||
|
cc $(pkg-config --cflags glfw3) -o myprog myprog.c $(pkg-config --static --libs glfw3)
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
If you are using the shared version of the GLFW library, omit the `--static`
|
||||||
|
flag.
|
||||||
|
|
||||||
|
@code{.sh}
|
||||||
|
cc $(pkg-config --cflags glfw3) -o myprog myprog.c $(pkg-config --libs glfw3)
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
You can also use the `glfw3.pc` file without installing it first, by using the
|
||||||
|
`PKG_CONFIG_PATH` environment variable.
|
||||||
|
|
||||||
|
@code{.sh}
|
||||||
|
env PKG_CONFIG_PATH=path/to/glfw/src cc $(pkg-config --cflags glfw3) -o myprog myprog.c $(pkg-config --libs glfw3)
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
@code{.sh}
|
||||||
|
cc $(pkg-config --cflags glfw3 gl) -o myprog myprog.c $(pkg-config --libs glfw3 gl)
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
|
||||||
|
@subsection build_link_xcode With Xcode on macOS
|
||||||
|
|
||||||
|
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 and IOKit frameworks to the project as dependencies. They can all be
|
||||||
|
found in `/System/Library/Frameworks`.
|
||||||
|
|
||||||
|
|
||||||
|
@subsection build_link_osx With command-line on macOS
|
||||||
|
|
||||||
|
It is recommended that you use [pkg-config](@ref build_link_pkgconfig) when
|
||||||
|
building 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:
|
||||||
|
|
||||||
|
@code{.sh}
|
||||||
|
cc -o myprog myprog.c -lglfw -framework Cocoa -framework OpenGL -framework IOKit
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
*/
|
|
@ -0,0 +1,281 @@
|
||||||
|
/*!
|
||||||
|
|
||||||
|
@page compat_guide Standards conformance
|
||||||
|
|
||||||
|
@tableofcontents
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
|
||||||
|
@section compat_x11 X11 extensions, protocols and IPC standards
|
||||||
|
|
||||||
|
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](https://www.tronche.com/gui/x/icccm/)
|
||||||
|
(ICCCM) and
|
||||||
|
[Extended Window Manager Hints](https://standards.freedesktop.org/wm-spec/wm-spec-latest.html)
|
||||||
|
(EWMH) standards.
|
||||||
|
|
||||||
|
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](https://www.freedesktop.org/wiki/ClipboardManager/)
|
||||||
|
to push a clipboard string (i.e. selection) owned by a GLFW window about to be
|
||||||
|
destroyed to the clipboard manager. If there is no running clipboard manager,
|
||||||
|
the clipboard string will be unavailable once the window has been destroyed.
|
||||||
|
|
||||||
|
GLFW uses the
|
||||||
|
[X drag-and-drop protocol](https://www.freedesktop.org/wiki/Specifications/XDND/)
|
||||||
|
to provide file drop events. If the application originating the drag does not
|
||||||
|
support this protocol, drag and drop will not work.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
|
||||||
|
@section compat_wayland Wayland protocols and IPC standards
|
||||||
|
|
||||||
|
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 protocols
|
||||||
|
from wayland-protocols to provide additional features if the compositor
|
||||||
|
supports them.
|
||||||
|
|
||||||
|
GLFW uses xkbcommon 0.5.0 to provide compose key support. When it has been
|
||||||
|
built against an older xkbcommon, the compose key will be disabled even if it
|
||||||
|
has been configured in the compositor.
|
||||||
|
|
||||||
|
GLFW uses the [xdg-shell
|
||||||
|
protocol](https://cgit.freedesktop.org/wayland/wayland-protocols/tree/stable/xdg-shell/xdg-shell.xml)
|
||||||
|
to provide better window management. This protocol is part of
|
||||||
|
wayland-protocols 1.12, and mandatory at build time.
|
||||||
|
|
||||||
|
GLFW uses the [relative pointer
|
||||||
|
protocol](https://cgit.freedesktop.org/wayland/wayland-protocols/tree/unstable/relative-pointer/relative-pointer-unstable-v1.xml)
|
||||||
|
alongside the [pointer constraints
|
||||||
|
protocol](https://cgit.freedesktop.org/wayland/wayland-protocols/tree/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml)
|
||||||
|
to implement disabled cursor. These two protocols are part of
|
||||||
|
wayland-protocols 1.1, and mandatory at build time. If the running compositor
|
||||||
|
does not support both of these protocols, disabling the cursor will have no
|
||||||
|
effect.
|
||||||
|
|
||||||
|
GLFW uses the [idle inhibit
|
||||||
|
protocol](https://cgit.freedesktop.org/wayland/wayland-protocols/tree/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml)
|
||||||
|
to prohibit the screensaver from starting. This protocol is part of
|
||||||
|
wayland-protocols 1.6, and mandatory at build time. If the running compositor
|
||||||
|
does not support this protocol, the screensaver may start even for full screen
|
||||||
|
windows.
|
||||||
|
|
||||||
|
GLFW uses the [xdg-decoration
|
||||||
|
protocol](https://cgit.freedesktop.org/wayland/wayland-protocols/tree/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml)
|
||||||
|
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](https://cgit.freedesktop.org/wayland/wayland-protocols/tree/stable/viewporter/viewporter.xml)
|
||||||
|
alongside
|
||||||
|
[subsurfaces](https://cgit.freedesktop.org/wayland/wayland/tree/protocol/wayland.xml#n2598).
|
||||||
|
This protocol is part of wayland-protocols 1.4, and mandatory at build time.
|
||||||
|
If the running compositor does not support this protocol either, no decorations
|
||||||
|
will be drawn around windows.
|
||||||
|
|
||||||
|
|
||||||
|
@section compat_glx GLX extensions
|
||||||
|
|
||||||
|
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. Where none of these extension 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_OPENGL_DEBUG_CONTEXT` 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.
|
||||||
|
|
||||||
|
|
||||||
|
@section compat_wgl WGL extensions
|
||||||
|
|
||||||
|
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_OPENGL_DEBUG_CONTEXT` 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. Where both of these
|
||||||
|
extension are unavailable, the `GLFW_SRGB_CAPABLE` hint will have no effect.
|
||||||
|
|
||||||
|
|
||||||
|
@section compat_osx OpenGL on macOS
|
||||||
|
|
||||||
|
Support for OpenGL 3.2 and above was introduced with OS X 10.7 and even then
|
||||||
|
only forward-compatible, core profile contexts are supported. Support for
|
||||||
|
OpenGL 4.1 was introduced with OS X 10.9, also limited to forward-compatible,
|
||||||
|
core profile contexts. There is also still no mechanism for requesting debug
|
||||||
|
contexts or no-error contexts. Versions of Mac OS X earlier than 10.7 support
|
||||||
|
at most OpenGL version 2.1.
|
||||||
|
|
||||||
|
Because of this, on OS X 10.7 and later, the `GLFW_CONTEXT_VERSION_MAJOR` and
|
||||||
|
`GLFW_CONTEXT_VERSION_MINOR` hints will cause @ref glfwCreateWindow to fail if
|
||||||
|
given version 3.0 or 3.1. The `GLFW_OPENGL_FORWARD_COMPAT` hint must be set to
|
||||||
|
`GLFW_TRUE` and the `GLFW_OPENGL_PROFILE` hint must be set to
|
||||||
|
`GLFW_OPENGL_CORE_PROFILE` when creating OpenGL 3.2 and later contexts. The
|
||||||
|
`GLFW_OPENGL_DEBUG_CONTEXT` and `GLFW_CONTEXT_NO_ERROR` hints are ignored.
|
||||||
|
|
||||||
|
Also, on Mac OS X 10.6 and below, the `GLFW_CONTEXT_VERSION_MAJOR` and
|
||||||
|
`GLFW_CONTEXT_VERSION_MINOR` hints will fail if given a version above 2.1,
|
||||||
|
setting the `GLFW_OPENGL_PROFILE` or `GLFW_OPENGL_FORWARD_COMPAT` hints to
|
||||||
|
a non-default value will cause @ref glfwCreateWindow to fail and the
|
||||||
|
`GLFW_OPENGL_DEBUG_CONTEXT` hint is ignored.
|
||||||
|
|
||||||
|
|
||||||
|
@section compat_vulkan Vulkan loader and API
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
|
||||||
|
@section compat_wsi Vulkan WSI extensions
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
*/
|
|
@ -0,0 +1,367 @@
|
||||||
|
/*!
|
||||||
|
|
||||||
|
@page compile_guide Compiling GLFW
|
||||||
|
|
||||||
|
@tableofcontents
|
||||||
|
|
||||||
|
This is about compiling the GLFW library itself. For information on how to
|
||||||
|
build applications that use GLFW, see @ref build_guide.
|
||||||
|
|
||||||
|
|
||||||
|
@section compile_cmake Using CMake
|
||||||
|
|
||||||
|
@note GLFW behaves like most other libraries that use CMake so this guide mostly
|
||||||
|
describes the basic configure/generate/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](https://cmake.org/cmake/help/latest/guide/user-interaction/)
|
||||||
|
that includes everything in this guide not specific to GLFW. It may be a useful
|
||||||
|
companion to this one.
|
||||||
|
|
||||||
|
|
||||||
|
@subsection compile_deps Installing dependencies
|
||||||
|
|
||||||
|
The C/C++ development environments in Visual Studio, Xcode and MinGW come with
|
||||||
|
all necessary dependencies for compiling GLFW, but on Unix-like systems like
|
||||||
|
Linux and FreeBSD you will need a few extra packages.
|
||||||
|
|
||||||
|
|
||||||
|
@subsubsection compile_deps_x11 Dependencies for X11 on Unix-like systems
|
||||||
|
|
||||||
|
To compile GLFW for X11, you need to have the X11 development packages
|
||||||
|
installed. They are not needed to build or run programs that use GLFW.
|
||||||
|
|
||||||
|
On Debian and derivates like Ubuntu and Linux Mint the `xorg-dev` meta-package
|
||||||
|
pulls in the development packages for all of X11.
|
||||||
|
|
||||||
|
@code{.sh}
|
||||||
|
sudo apt install xorg-dev
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
On Fedora and derivatives like Red Hat the X11 extension packages
|
||||||
|
`libXcursor-devel`, `libXi-devel`, `libXinerama-devel` and `libXrandr-devel`
|
||||||
|
required by GLFW pull in all its other dependencies.
|
||||||
|
|
||||||
|
@code{.sh}
|
||||||
|
sudo dnf install libXcursor-devel libXi-devel libXinerama-devel libXrandr-devel
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
On FreeBSD 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.
|
||||||
|
|
||||||
|
@code{.sh}
|
||||||
|
pkg install xorgproto
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
On Cygwin the `libXcursor-devel`, `libXi-devel`, `libXinerama-devel`,
|
||||||
|
`libXrandr-devel` and `libXrender-devel` packages in the Libs section of the GUI
|
||||||
|
installer will install all the headers and other development related files GLFW
|
||||||
|
requires for X11.
|
||||||
|
|
||||||
|
Once you have the required depdendencies, move on to @ref compile_generate.
|
||||||
|
|
||||||
|
|
||||||
|
@subsubsection compile_deps_wayland Dependencies for Wayland on Unix-like systems
|
||||||
|
|
||||||
|
To compile GLFW for Wayland, you need to have the Wayland and xkbcommon
|
||||||
|
development packages installed. They are not needed to build or run programs
|
||||||
|
that use GLFW.
|
||||||
|
|
||||||
|
On Debian and derivates like Ubuntu and Linux Mint you will need the `libwayland-dev`,
|
||||||
|
`libxkbcommon-dev`, `wayland-protocols` and `extra-cmake-modules` packages.
|
||||||
|
|
||||||
|
@code{.sh}
|
||||||
|
sudo apt install libwayland-dev libxkbcommon-dev wayland-protocols extra-cmake-modules
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
On Fedora and derivatives like Red Hat you will need the `wayland-devel`,
|
||||||
|
`libxkbcommon-devel`, `wayland-protocols-devel` and `extra-cmake-modules` packages.
|
||||||
|
|
||||||
|
@code{.sh}
|
||||||
|
sudo dnf install wayland-devel libxkbcommon-devel wayland-protocols-devel extra-cmake-modules
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
On FreeBSD you will need the `wayland`, `libxkbcommon`, `wayland-protocols` and
|
||||||
|
`kf5-extra-cmake-modules` packages.
|
||||||
|
|
||||||
|
@code{.sh}
|
||||||
|
pkg install wayland libxkbcommon wayland-protocols kf5-extra-cmake-modules
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
Once you have the required depdendencies, move on to @ref compile_generate.
|
||||||
|
|
||||||
|
|
||||||
|
@subsection compile_generate Generating build files with CMake
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
|
||||||
|
@subsubsection compile_generate_gui Generating files with the CMake 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 X11 on Linux and other Unix-like systems other
|
||||||
|
than macOS. To use Wayland instead, set the `GLFW_USE_WAYLAND` 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.
|
||||||
|
|
||||||
|
|
||||||
|
@subsubsection compile_generate_cli Generating files with the CMake command-line tool
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
@code{.sh}
|
||||||
|
cmake -S path/to/glfw -B path/to/build
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
@code{.sh}
|
||||||
|
cd path/to/glfw
|
||||||
|
cmake -S . -B build
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
@code{.sh}
|
||||||
|
cmake -S path/to/glfw -B path/to/build -G Xcode
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
By default GLFW will use X11 on Linux and other Unix-like systems other
|
||||||
|
than macOS. To use Wayland instead, set the `GLFW_USE_WAYLAND` CMake option.
|
||||||
|
|
||||||
|
@code{.sh}
|
||||||
|
cmake -S path/to/glfw -B path/to/build -D GLFW_USE_WAYLAND=1
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
Once you have generated the project files or makefiles for your chosen
|
||||||
|
development environment, move on to @ref compile_compile.
|
||||||
|
|
||||||
|
|
||||||
|
@subsection compile_compile Compiling the library
|
||||||
|
|
||||||
|
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`.
|
||||||
|
|
||||||
|
@code{.sh}
|
||||||
|
cd path/to/build
|
||||||
|
make
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
With MinGW, it is `mingw32-make`.
|
||||||
|
|
||||||
|
@code{.sh}
|
||||||
|
cd path/to/build
|
||||||
|
mingw32-make
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
Any CMake build directory can also be built with the `cmake` command and the
|
||||||
|
`--build` flag.
|
||||||
|
|
||||||
|
@code{.sh}
|
||||||
|
cmake --build path/to/build
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
|
||||||
|
@section compile_options CMake 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.
|
||||||
|
|
||||||
|
@code{.sh}
|
||||||
|
cmake -S path/to/glfw -B path/to/build -D BUILD_SHARED_LIBS=ON
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
|
||||||
|
@subsection compile_options_shared Shared CMake options
|
||||||
|
|
||||||
|
@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.
|
||||||
|
|
||||||
|
@anchor GLFW_BUILD_EXAMPLES
|
||||||
|
__GLFW_BUILD_EXAMPLES__ determines whether the GLFW examples are built
|
||||||
|
along with the library.
|
||||||
|
|
||||||
|
@anchor GLFW_BUILD_TESTS
|
||||||
|
__GLFW_BUILD_TESTS__ determines whether the GLFW test programs are
|
||||||
|
built along with the library.
|
||||||
|
|
||||||
|
@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.
|
||||||
|
|
||||||
|
@anchor GLFW_VULKAN_STATIC
|
||||||
|
__GLFW_VULKAN_STATIC__ determines whether to use the Vulkan loader linked
|
||||||
|
directly with the application. This is disabled by default.
|
||||||
|
|
||||||
|
|
||||||
|
@subsection compile_options_win32 Windows specific CMake options
|
||||||
|
|
||||||
|
@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.
|
||||||
|
|
||||||
|
On CMake 3.15 and later you can set the standard CMake
|
||||||
|
[CMAKE_MSVC_RUNTIME_LIBRARY](https://cmake.org/cmake/help/latest/variable/CMAKE_MSVC_RUNTIME_LIBRARY.html)
|
||||||
|
variable instead of this GLFW-specific option.
|
||||||
|
|
||||||
|
@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.
|
||||||
|
|
||||||
|
|
||||||
|
@subsection compile_options_wayland Wayland specific CMake options
|
||||||
|
|
||||||
|
@anchor GLFW_USE_WAYLAND
|
||||||
|
__GLFW_USE_WAYLAND__ determines whether to compile the library for Wayland.
|
||||||
|
This option is only available on Linux and other Unix-like systems other than
|
||||||
|
macOS. This is disabled by default.
|
||||||
|
|
||||||
|
|
||||||
|
@section compile_mingw_cross Cross-compilation with CMake and MinGW
|
||||||
|
|
||||||
|
Both Cygwin and many Linux distributions have MinGW or 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.
|
||||||
|
|
||||||
|
@code{.sh}
|
||||||
|
cmake -S path/to/glfw -B path/to/build -D CMAKE_TOOLCHAIN_FILE=path/to/file
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
The exact toolchain file to use depends on the prefix used by the MinGW or
|
||||||
|
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:
|
||||||
|
|
||||||
|
@code{.sh}
|
||||||
|
cmake -S path/to/glfw -B path/to/build -D CMAKE_TOOLCHAIN_FILE=CMake/x86_64-w64-mingw32.cmake
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
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](https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html).
|
||||||
|
|
||||||
|
|
||||||
|
@section compile_manual Compiling GLFW manually
|
||||||
|
|
||||||
|
If you wish to compile GLFW without its CMake build environment then you will
|
||||||
|
have to do at least some of the platform detection yourself. GLFW needs
|
||||||
|
a configuration macro to be defined in order to know what window system it is
|
||||||
|
being compiled for and also has optional, platform-specific ones for various
|
||||||
|
features.
|
||||||
|
|
||||||
|
When building with CMake, the `glfw_config.h` configuration header is generated
|
||||||
|
based on the current platform and CMake options. The GLFW CMake environment
|
||||||
|
defines @b GLFW_USE_CONFIG_H, which causes this header to be included by
|
||||||
|
`internal.h`. Without this macro, GLFW will expect the necessary configuration
|
||||||
|
macros to be defined on the command-line.
|
||||||
|
|
||||||
|
The window creation API 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_X11 to use the X Window System
|
||||||
|
- @b _GLFW_WAYLAND to use the Wayland API (experimental and incomplete)
|
||||||
|
- @b _GLFW_OSMESA to use the OSMesa API (headless and non-interactive)
|
||||||
|
|
||||||
|
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 linking the Vulkan loader directly with your application then you
|
||||||
|
must also define @b _GLFW_VULKAN_STATIC. Otherwise, GLFW will attempt to use the
|
||||||
|
external version.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
*/
|
|
@ -0,0 +1,346 @@
|
||||||
|
/*!
|
||||||
|
|
||||||
|
@page context_guide Context guide
|
||||||
|
|
||||||
|
@tableofcontents
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
|
||||||
|
@section context_object Context objects
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
|
||||||
|
@subsection context_hints Context creation 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.
|
||||||
|
|
||||||
|
|
||||||
|
@subsection context_sharing Context object 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.
|
||||||
|
|
||||||
|
@code
|
||||||
|
GLFWwindow* second_window = glfwCreateWindow(640, 480, "Second Window", NULL, first_window);
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
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 barebones object sharing example program called `sharing`.
|
||||||
|
|
||||||
|
|
||||||
|
@subsection context_offscreen Offscreen contexts
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
@code
|
||||||
|
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
|
||||||
|
|
||||||
|
GLFWwindow* offscreen_context = glfwCreateWindow(640, 480, "", NULL, NULL);
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
@macos The first time a window is created the menu bar is created. This is not
|
||||||
|
desirable for example when writing a command-line only application. Menu bar
|
||||||
|
creation can be disabled with the @ref GLFW_COCOA_MENUBAR init hint.
|
||||||
|
|
||||||
|
|
||||||
|
@subsection context_less Windows without contexts
|
||||||
|
|
||||||
|
You can disable context creation by setting the
|
||||||
|
[GLFW_CLIENT_API](@ref GLFW_CLIENT_API_hint) hint to `GLFW_NO_API`. Windows
|
||||||
|
without contexts must not be passed to @ref glfwMakeContextCurrent or @ref
|
||||||
|
glfwSwapBuffers.
|
||||||
|
|
||||||
|
|
||||||
|
@section context_current Current context
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
@code
|
||||||
|
glfwMakeContextCurrent(window);
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
The window of the current context is returned by @ref glfwGetCurrentContext.
|
||||||
|
|
||||||
|
@code
|
||||||
|
GLFWwindow* window = glfwGetCurrentContext();
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
|
||||||
|
@section context_swap Buffer swapping
|
||||||
|
|
||||||
|
See @ref buffer_swap in the window guide.
|
||||||
|
|
||||||
|
|
||||||
|
@section context_glext OpenGL and OpenGL ES extensions
|
||||||
|
|
||||||
|
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/).
|
||||||
|
|
||||||
|
|
||||||
|
@subsection context_glext_auto Loading extension with a loader library
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
@code{.sh}
|
||||||
|
python main.py --generator c --no-loader --out-path output
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
@code
|
||||||
|
#include <glad/glad.h>
|
||||||
|
#include <GLFW/glfw3.h>
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
Finally you need to initialize glad once you have a suitable current context.
|
||||||
|
|
||||||
|
@code
|
||||||
|
window = glfwCreateWindow(640, 480, "My Window", NULL, NULL);
|
||||||
|
if (!window)
|
||||||
|
{
|
||||||
|
...
|
||||||
|
}
|
||||||
|
|
||||||
|
glfwMakeContextCurrent(window);
|
||||||
|
|
||||||
|
gladLoadGLLoader((GLADloadproc) glfwGetProcAddress);
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
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 and 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.
|
||||||
|
|
||||||
|
@code
|
||||||
|
if (GLAD_GL_VERSION_3_2)
|
||||||
|
{
|
||||||
|
// Call OpenGL 3.2+ specific code
|
||||||
|
}
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
To check whether a specific extension is supported, use the `GLAD_GL_xxx`
|
||||||
|
booleans.
|
||||||
|
|
||||||
|
@code
|
||||||
|
if (GLAD_GL_ARB_gl_spirv)
|
||||||
|
{
|
||||||
|
// Use GL_ARB_gl_spirv
|
||||||
|
}
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
|
||||||
|
@subsection context_glext_manual Loading extensions manually
|
||||||
|
|
||||||
|
__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.
|
||||||
|
|
||||||
|
|
||||||
|
@subsubsection context_glext_header The glext.h 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.
|
||||||
|
|
||||||
|
@code
|
||||||
|
#define GLFW_INCLUDE_GLEXT
|
||||||
|
#include <GLFW/glfw3.h>
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
|
||||||
|
@subsubsection context_glext_string Checking for extensions
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
@code
|
||||||
|
if (glfwExtensionSupported("GL_ARB_gl_spirv"))
|
||||||
|
{
|
||||||
|
// The extension is supported by the current context
|
||||||
|
}
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
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`.
|
||||||
|
|
||||||
|
|
||||||
|
@subsubsection context_glext_proc Fetching function pointers
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
@code
|
||||||
|
PFNGLSPECIALIZESHADERARBPROC pfnSpecializeShaderARB = glfwGetProcAddress("glSpecializeShaderARB");
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
@code
|
||||||
|
#define GLFW_INCLUDE_GLEXT
|
||||||
|
#include <GLFW/glfw3.h>
|
||||||
|
|
||||||
|
#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(...);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@endcode
|
||||||
|
|
||||||
|
*/
|
|
@ -0,0 +1 @@
|
||||||
|
{"version":3,"sourceRoot":"","sources":["extra.scss"],"names":[],"mappings":"AA8EA,4GACI,gBACA,iBAGJ,yBACC,yDAGD,6HACC,sDAGD,yIACC,sDAGD,mBACI,WA9EuB,KA+EvB,iBAGJ,uBACC,MAzFoB,QA0FjB,iBAGJ,6UACC,gBAGD,mJACC,YAGD,yHACC,iBAGD,sBACC,gBAGD,4LACC,UAGD,yCACC,aAGD,kMACC,WAnHgC,QAsHjC,KACC,MA1HoB,QA6HrB,sDACC,MA/Ge,QAgHf,mBAGD,GACE,iBACA,eAGF,GACE,iBACA,gBACA,eAGF,GACE,iBACA,gBACA,eAGF,YACC,eACA,gBACA,gBACA,eACA,cAEA,aACA,mBACA,eACA,2BACA,mBACA,sBAGD,UACC,iBACA,mBACA,MA/J0B,KAgK1B,gBACA,qEAGD,YACC,qBACA,kBACA,YAGD,yBACC,WAGD,oCACC,iBACA,gBACA,cACA,MAlL0B,KAqL3B,YACC,eAGD,8CACC,qBAGD,mBACC,MA9L0B,KAiM3B,eACC,kBACA,YACA,eAGD,KACC,WAxM0B,KA2M3B,UACC,gBACA,cACA,eAGD,WACC,gBACA,cACA,eAGD,UACI,aAGJ,mBACI,iBACA,iBAGJ,WACC,gBACA,aACA,mBACA,eACA,2BACA,mBACA,sBAGD,mEACC,MA9OgC,QAiPjC,gCACC,MArPoB,QAwPrB,sCACC,MAjOoB,KAoOrB,yBACC,kBAGD,UACC,iBAGD,wBACC,gBACA,cACA,eACA,qBAGD,uDACC,gEACA,+BACA,+BACA,gBACA,MArPgB,KAwPjB,mBACC,MA5PoB,KA6PpB,aACA,kBACA,yBAGD,QACC,WACA,WAGD,WACC,iBAGD,WACC,mBAGD,WACC,cACA,eACA,qBAGD,oCACC,gEACA,kCACA,2BACA,MAlSe,QAmSf,yBACA,kBAGD,WACC,MA3QuB,QA8QxB,cACC,sBACA,2BACA,4BACA,mBAGD,cACC,sBACA,+BACA,8BACA,gBAGD,mCACC,wBACA,iBACA,sBACA,kBAGD,gIACC,MAxToB,KAyTpB,qBAGD,cACC,wBACA,iBACA,sBACA,kBAGD,iBACC,WACA,4EAGD,oCApSC,gEACA,kCACA,cACA,yBAqSD,wBAxSC,gEACA,kCACA,cACA,yBAySD,qBA5SC,gEACA,kCACA,cACA,yBA6SD,gBAhTC,gEACA,kCACA,cACA,yBAiTD,iGACC,kBACA,YACA,2BACA,aAGD,kRACC,cAGD,SACC,oBAGD,0BACC,mBACA,kBACA,YACA,YACA,cACA,2BACA,aAGD,+CACC,MA1YoB,QA6YrB,+BACC,cAGD,sBACC,cAGD,+CACC,cACA,iBAGD,mBACC,cAGD,KACC,aACA","file":"extra.css"}
|
|
@ -0,0 +1,430 @@
|
||||||
|
// 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
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:180%;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
padding-top:0.5em;
|
||||||
|
margin-bottom:0;
|
||||||
|
font-size:140%;
|
||||||
|
}
|
||||||
|
|
||||||
|
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,#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: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,$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;
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
<address class="footer">
|
||||||
|
<p>
|
||||||
|
Last update on $date for $projectname $projectnumber
|
||||||
|
</p>
|
||||||
|
</address>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,34 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen $doxygenversion"/>
|
||||||
|
<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
|
||||||
|
<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
|
||||||
|
<link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="$relpath^jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="$relpath^dynsections.js"></script>
|
||||||
|
$treeview
|
||||||
|
$search
|
||||||
|
$mathjax
|
||||||
|
<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
|
||||||
|
$extrastylesheet
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
|
||||||
|
<!--BEGIN TITLEAREA-->
|
||||||
|
<div id="titlearea">
|
||||||
|
<div class="glfwheader">
|
||||||
|
<a href="https://www.glfw.org/" id="glfwhome">GLFW</a>
|
||||||
|
<ul class="glfwnavbar">
|
||||||
|
<li><a href="https://www.glfw.org/documentation.html">Documentation</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/download.html">Download</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/community.html">Community</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--END TITLEAREA-->
|
||||||
|
<!-- end header part -->
|
After Width: | Height: | Size: 676 B |
After Width: | Height: | Size: 147 B |
|
@ -0,0 +1,74 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.9.4"/>
|
||||||
|
<title>GLFW: build.dox File Reference</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="extra.css" rel="stylesheet" type="text/css"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<div class="glfwheader">
|
||||||
|
<a href="https://www.glfw.org/" id="glfwhome">GLFW</a>
|
||||||
|
<ul class="glfwnavbar">
|
||||||
|
<li><a href="https://www.glfw.org/documentation.html">Documentation</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/download.html">Download</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/community.html">Community</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.9.4 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src="menudata.js"></script>
|
||||||
|
<script type="text/javascript" src="menu.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
$(function() {
|
||||||
|
initMenu('',true,false,'search.php','Search');
|
||||||
|
$(document).ready(function() { init_search(); });
|
||||||
|
});
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<div id="main-nav"></div>
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div><!-- top -->
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle"><div class="title">build.dox File Reference</div></div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
</div><!-- contents -->
|
||||||
|
<address class="footer">
|
||||||
|
<p>
|
||||||
|
Last update on Fri Jul 22 2022 for GLFW 3.3.8
|
||||||
|
</p>
|
||||||
|
</address>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,192 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.9.4"/>
|
||||||
|
<title>GLFW: Building applications</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="extra.css" rel="stylesheet" type="text/css"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<div class="glfwheader">
|
||||||
|
<a href="https://www.glfw.org/" id="glfwhome">GLFW</a>
|
||||||
|
<ul class="glfwnavbar">
|
||||||
|
<li><a href="https://www.glfw.org/documentation.html">Documentation</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/download.html">Download</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/community.html">Community</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.9.4 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src="menudata.js"></script>
|
||||||
|
<script type="text/javascript" src="menu.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
$(function() {
|
||||||
|
initMenu('',true,false,'search.php','Search');
|
||||||
|
$(document).ready(function() { init_search(); });
|
||||||
|
});
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<div id="main-nav"></div>
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div><!-- top -->
|
||||||
|
<div><div class="header">
|
||||||
|
<div class="headertitle"><div class="title">Building applications </div></div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<div class="toc"><h3>Table of Contents</h3>
|
||||||
|
<ul><li class="level1"><a href="#build_include">Including the GLFW header file</a><ul><li class="level2"><a href="#build_macros">GLFW header option macros</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li class="level1"><a href="#build_link">Link with the right libraries</a><ul><li class="level2"><a href="#build_link_win32">With MinGW or Visual C++ on Windows</a></li>
|
||||||
|
<li class="level2"><a href="#build_link_cmake_source">With CMake and GLFW source</a></li>
|
||||||
|
<li class="level2"><a href="#build_link_cmake_package">With CMake and installed GLFW binaries</a></li>
|
||||||
|
<li class="level2"><a href="#build_link_pkgconfig">With makefiles and pkg-config on Unix</a></li>
|
||||||
|
<li class="level2"><a href="#build_link_xcode">With Xcode on macOS</a></li>
|
||||||
|
<li class="level2"><a href="#build_link_osx">With command-line on macOS</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="textblock"><p >This is about compiling and linking applications that use GLFW. For information on how to write such applications, start with the <a class="el" href="quick_guide.html">introductory tutorial</a>. For information on how to compile the GLFW library itself, see <a class="el" href="compile_guide.html">Compiling GLFW</a>.</p>
|
||||||
|
<p >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.</p>
|
||||||
|
<h1><a class="anchor" id="build_include"></a>
|
||||||
|
Including the GLFW header file</h1>
|
||||||
|
<p >You should include the GLFW header in the source files where you use OpenGL or GLFW.</p>
|
||||||
|
<div class="fragment"><div class="line"><span class="preprocessor">#include <<a class="code" href="glfw3_8h.html">GLFW/glfw3.h</a>></span></div>
|
||||||
|
<div class="ttc" id="aglfw3_8h_html"><div class="ttname"><a href="glfw3_8h.html">glfw3.h</a></div><div class="ttdoc">The header of the GLFW 3 API.</div></div>
|
||||||
|
</div><!-- fragment --><p >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 <a class="el" href="build_guide.html#build_macros">option macros</a> below for how to select OpenGL ES headers and more.</p>
|
||||||
|
<p >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.</p>
|
||||||
|
<p >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. <code>windows.h</code> cannot cope if any Win32 symbols have already been defined.</p>
|
||||||
|
<p >In other words:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Use the GLFW header to include OpenGL or OpenGL ES headers portably</li>
|
||||||
|
<li>Do not include window system headers unless you will use those APIs directly</li>
|
||||||
|
<li>If you do need such headers, include them before the GLFW header</li>
|
||||||
|
</ul>
|
||||||
|
<p >If you are using an OpenGL extension loading library such as <a href="https://github.com/Dav1dde/glad">glad</a>, 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.</p>
|
||||||
|
<div class="fragment"><div class="line"><span class="preprocessor">#include <glad/gl.h></span></div>
|
||||||
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="glfw3_8h.html">GLFW/glfw3.h</a>></span></div>
|
||||||
|
</div><!-- fragment --><p >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 <a class="el" href="build_guide.html#GLFW_INCLUDE_NONE">GLFW_INCLUDE_NONE</a> 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.</p>
|
||||||
|
<div class="fragment"><div class="line"><span class="preprocessor">#define GLFW_INCLUDE_NONE</span></div>
|
||||||
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="glfw3_8h.html">GLFW/glfw3.h</a>></span></div>
|
||||||
|
<div class="line"><span class="preprocessor">#include <glad/gl.h></span></div>
|
||||||
|
</div><!-- fragment --><h2><a class="anchor" id="build_macros"></a>
|
||||||
|
GLFW header option macros</h2>
|
||||||
|
<p >These macros may be defined before the inclusion of the GLFW header and affect its behavior.</p>
|
||||||
|
<p ><a class="anchor" id="GLFW_DLL"></a><b>GLFW_DLL</b> is required on Windows when using the GLFW DLL, to tell the compiler that the GLFW functions are defined in a DLL.</p>
|
||||||
|
<p >The following macros control which OpenGL or OpenGL ES API header is included. Only one of these may be defined at a time.</p>
|
||||||
|
<dl class="section note"><dt>Note</dt><dd>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 <a href="https://www.khronos.org/registry/">Khronos Registry</a>.</dd></dl>
|
||||||
|
<p><a class="anchor" id="GLFW_INCLUDE_GLCOREARB"></a><b>GLFW_INCLUDE_GLCOREARB</b> makes the GLFW header include the modern <code>GL/glcorearb.h</code> header (<code>OpenGL/gl3.h</code> on macOS) instead of the regular OpenGL header.</p>
|
||||||
|
<p ><a class="anchor" id="GLFW_INCLUDE_ES1"></a><b>GLFW_INCLUDE_ES1</b> makes the GLFW header include the OpenGL ES 1.x <code>GLES/gl.h</code> header instead of the regular OpenGL header.</p>
|
||||||
|
<p ><a class="anchor" id="GLFW_INCLUDE_ES2"></a><b>GLFW_INCLUDE_ES2</b> makes the GLFW header include the OpenGL ES 2.0 <code>GLES2/gl2.h</code> header instead of the regular OpenGL header.</p>
|
||||||
|
<p ><a class="anchor" id="GLFW_INCLUDE_ES3"></a><b>GLFW_INCLUDE_ES3</b> makes the GLFW header include the OpenGL ES 3.0 <code>GLES3/gl3.h</code> header instead of the regular OpenGL header.</p>
|
||||||
|
<p ><a class="anchor" id="GLFW_INCLUDE_ES31"></a><b>GLFW_INCLUDE_ES31</b> makes the GLFW header include the OpenGL ES 3.1 <code>GLES3/gl31.h</code> header instead of the regular OpenGL header.</p>
|
||||||
|
<p ><a class="anchor" id="GLFW_INCLUDE_ES32"></a><b>GLFW_INCLUDE_ES32</b> makes the GLFW header include the OpenGL ES 3.2 <code>GLES3/gl32.h</code> header instead of the regular OpenGL header.</p>
|
||||||
|
<p ><a class="anchor" id="GLFW_INCLUDE_NONE"></a><b>GLFW_INCLUDE_NONE</b> makes the GLFW header not include any OpenGL or OpenGL ES API header. This is useful in combination with an extension loading library.</p>
|
||||||
|
<p >If none of the above inclusion macros are defined, the standard OpenGL <code>GL/gl.h</code> header (<code>OpenGL/gl.h</code> on macOS) is included, unless GLFW detects the inclusion guards of any OpenGL, OpenGL ES or extension loader header it knows about.</p>
|
||||||
|
<p >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.</p>
|
||||||
|
<p ><a class="anchor" id="GLFW_INCLUDE_VULKAN"></a><b>GLFW_INCLUDE_VULKAN</b> makes the GLFW header include the Vulkan <code>vulkan/vulkan.h</code> header in addition to any selected OpenGL or OpenGL ES header.</p>
|
||||||
|
<p ><a class="anchor" id="GLFW_INCLUDE_GLEXT"></a><b>GLFW_INCLUDE_GLEXT</b> 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.</p>
|
||||||
|
<p ><a class="anchor" id="GLFW_INCLUDE_GLU"></a><b>GLFW_INCLUDE_GLU</b> 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.</p>
|
||||||
|
<dl class="section note"><dt>Note</dt><dd>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.</dd></dl>
|
||||||
|
<h1><a class="anchor" id="build_link"></a>
|
||||||
|
Link with the right libraries</h1>
|
||||||
|
<p >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.</p>
|
||||||
|
<p >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.</p>
|
||||||
|
<p >A good general introduction to linking is <a href="https://www.lurklurk.org/linkers/linkers.html">Beginner's Guide to Linkers</a> by David Drysdale.</p>
|
||||||
|
<h2><a class="anchor" id="build_link_win32"></a>
|
||||||
|
With MinGW or Visual C++ on Windows</h2>
|
||||||
|
<p >The static version of the GLFW library is named <code>glfw3</code>. When using this version, it is also necessary to link with some libraries that GLFW uses.</p>
|
||||||
|
<p >When using MinGW to link an application with the static version of GLFW, you must also explicitly link with <code>gdi32</code>. Other toolchains including MinGW-w64 include it in the set of default libraries along with other dependencies like <code>user32</code> and <code>kernel32</code>.</p>
|
||||||
|
<p >The link library for the GLFW DLL is named <code>glfw3dll</code>. When compiling an application that uses the DLL version of GLFW, you need to define the <a class="el" href="build_guide.html#GLFW_DLL">GLFW_DLL</a> macro <em>before</em> any inclusion of the GLFW header. This can be done either with a compiler switch or by defining it in your source code.</p>
|
||||||
|
<h2><a class="anchor" id="build_link_cmake_source"></a>
|
||||||
|
With CMake and GLFW source</h2>
|
||||||
|
<p >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 <a class="el" href="build_guide.html#build_link_cmake_package">With CMake and installed GLFW binaries</a>.</p>
|
||||||
|
<p >With a few changes to your <code>CMakeLists.txt</code> you can have the GLFW source tree built along with your application.</p>
|
||||||
|
<p >When including GLFW as part of your build, you probably don't want to build the GLFW tests, examples and documentation. To disable these, set the corresponding cache variables before adding the GLFW source tree.</p>
|
||||||
|
<div class="fragment"><div class="line">set(GLFW_BUILD_DOCS OFF CACHE BOOL <span class="stringliteral">""</span> FORCE)</div>
|
||||||
|
<div class="line">set(GLFW_BUILD_TESTS OFF CACHE BOOL <span class="stringliteral">""</span> FORCE)</div>
|
||||||
|
<div class="line">set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL <span class="stringliteral">""</span> FORCE)</div>
|
||||||
|
</div><!-- fragment --><p >Add the root directory of the GLFW source tree to your project. This will add the <code>glfw</code> target to your project.</p>
|
||||||
|
<div class="fragment"><div class="line">add_subdirectory(path/to/glfw)</div>
|
||||||
|
</div><!-- fragment --><p >Once GLFW has been added, link your application against the <code>glfw</code> 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 <a class="el" href="build_guide.html#GLFW_DLL">GLFW_DLL</a> macro.</p>
|
||||||
|
<div class="fragment"><div class="line">target_link_libraries(myapp glfw)</div>
|
||||||
|
</div><!-- fragment --><p >Note that the <code>glfw</code> 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 <a class="el" href="context_guide.html#context_glext_auto">extension loader library</a>, use the OpenGL CMake package.</p>
|
||||||
|
<div class="fragment"><div class="line">find_package(OpenGL REQUIRED)</div>
|
||||||
|
</div><!-- fragment --><p >If OpenGL is found, the <code>OpenGL::GL</code> target is added to your project, containing library and include directory paths. Link against this like any other library.</p>
|
||||||
|
<div class="fragment"><div class="line">target_link_libraries(myapp OpenGL::GL)</div>
|
||||||
|
</div><!-- fragment --><p >For a minimal example of a program and GLFW sources built with CMake, see the <a href="https://github.com/juliettef/GLFW-CMake-starter">GLFW CMake Starter</a> on GitHub.</p>
|
||||||
|
<h2><a class="anchor" id="build_link_cmake_package"></a>
|
||||||
|
With CMake and installed GLFW binaries</h2>
|
||||||
|
<p >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 <a class="el" href="build_guide.html#build_link_cmake_source">With CMake and GLFW source</a>.</p>
|
||||||
|
<p >With a few changes to your <code>CMakeLists.txt</code> you can locate the package and target files generated when GLFW is installed.</p>
|
||||||
|
<div class="fragment"><div class="line">find_package(glfw3 3.3 REQUIRED)</div>
|
||||||
|
</div><!-- fragment --><p >Once GLFW has been added to the project, link against it with the <code>glfw</code> target. This adds the GLFW library and its link-time dependencies, the include directory for the GLFW header and, when applicable, the <a class="el" href="build_guide.html#GLFW_DLL">GLFW_DLL</a> macro.</p>
|
||||||
|
<div class="fragment"><div class="line">target_link_libraries(myapp glfw)</div>
|
||||||
|
</div><!-- fragment --><p >Note that the <code>glfw</code> 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 <a class="el" href="context_guide.html#context_glext_auto">extension loader library</a>, use the OpenGL CMake package.</p>
|
||||||
|
<div class="fragment"><div class="line">find_package(OpenGL REQUIRED)</div>
|
||||||
|
</div><!-- fragment --><p >If OpenGL is found, the <code>OpenGL::GL</code> target is added to your project, containing library and include directory paths. Link against this like any other library.</p>
|
||||||
|
<div class="fragment"><div class="line">target_link_libraries(myapp OpenGL::GL)</div>
|
||||||
|
</div><!-- fragment --><h2><a class="anchor" id="build_link_pkgconfig"></a>
|
||||||
|
With makefiles and pkg-config on Unix</h2>
|
||||||
|
<p >GLFW supports <a href="https://www.freedesktop.org/wiki/Software/pkg-config/">pkg-config</a>, and the <code>glfw3.pc</code> 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.</p>
|
||||||
|
<p >A typical compile and link command-line when using the static version of the GLFW library may look like this:</p>
|
||||||
|
<div class="fragment"><div class="line">cc $(pkg-config --cflags glfw3) -o myprog myprog.c $(pkg-config --static --libs glfw3)</div>
|
||||||
|
</div><!-- fragment --><p >If you are using the shared version of the GLFW library, omit the <code>--static</code> flag.</p>
|
||||||
|
<div class="fragment"><div class="line">cc $(pkg-config --cflags glfw3) -o myprog myprog.c $(pkg-config --libs glfw3)</div>
|
||||||
|
</div><!-- fragment --><p >You can also use the <code>glfw3.pc</code> file without installing it first, by using the <code>PKG_CONFIG_PATH</code> environment variable.</p>
|
||||||
|
<div class="fragment"><div class="line">env PKG_CONFIG_PATH=path/to/glfw/src cc $(pkg-config --cflags glfw3) -o myprog myprog.c $(pkg-config --libs glfw3)</div>
|
||||||
|
</div><!-- fragment --><p >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 <a class="el" href="context_guide.html#context_glext_auto">extension loader library</a>, you should add the <code>gl</code> pkg-config package.</p>
|
||||||
|
<div class="fragment"><div class="line">cc $(pkg-config --cflags glfw3 gl) -o myprog myprog.c $(pkg-config --libs glfw3 gl)</div>
|
||||||
|
</div><!-- fragment --><h2><a class="anchor" id="build_link_xcode"></a>
|
||||||
|
With Xcode on macOS</h2>
|
||||||
|
<p >If you are using the dynamic library version of GLFW, add it to the project dependencies.</p>
|
||||||
|
<p >If you are using the static library version of GLFW, add it and the Cocoa, OpenGL and IOKit frameworks to the project as dependencies. They can all be found in <code>/System/Library/Frameworks</code>.</p>
|
||||||
|
<h2><a class="anchor" id="build_link_osx"></a>
|
||||||
|
With command-line on macOS</h2>
|
||||||
|
<p >It is recommended that you use <a class="el" href="build_guide.html#build_link_pkgconfig">pkg-config</a> when building 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 <code>-l</code> and <code>-framework</code> switches.</p>
|
||||||
|
<p >If you are using the dynamic GLFW library, which is named <code>libglfw.3.dylib</code>, do:</p>
|
||||||
|
<div class="fragment"><div class="line">cc -o myprog myprog.c -lglfw -framework Cocoa -framework OpenGL -framework IOKit</div>
|
||||||
|
</div><!-- fragment --><p >If you are using the static library, named <code>libglfw3.a</code>, substitute <code>-lglfw3</code> for <code>-lglfw</code>.</p>
|
||||||
|
<p >Note that you do not add the <code>.framework</code> extension to a framework when linking against it from the command-line.</p>
|
||||||
|
<dl class="section note"><dt>Note</dt><dd>Your machine may have <code>libGL.*.dylib</code> style OpenGL library, but that is for the X Window System and will not work with the macOS native version of GLFW. </dd></dl>
|
||||||
|
</div></div><!-- contents -->
|
||||||
|
</div><!-- PageDoc -->
|
||||||
|
<address class="footer">
|
||||||
|
<p>
|
||||||
|
Last update on Fri Jul 22 2022 for GLFW 3.3.8
|
||||||
|
</p>
|
||||||
|
</address>
|
||||||
|
</body>
|
||||||
|
</html>
|
After Width: | Height: | Size: 132 B |
|
@ -0,0 +1,74 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.9.4"/>
|
||||||
|
<title>GLFW: compat.dox File Reference</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="extra.css" rel="stylesheet" type="text/css"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<div class="glfwheader">
|
||||||
|
<a href="https://www.glfw.org/" id="glfwhome">GLFW</a>
|
||||||
|
<ul class="glfwnavbar">
|
||||||
|
<li><a href="https://www.glfw.org/documentation.html">Documentation</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/download.html">Download</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/community.html">Community</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.9.4 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src="menudata.js"></script>
|
||||||
|
<script type="text/javascript" src="menu.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
$(function() {
|
||||||
|
initMenu('',true,false,'search.php','Search');
|
||||||
|
$(document).ready(function() { init_search(); });
|
||||||
|
});
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<div id="main-nav"></div>
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div><!-- top -->
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle"><div class="title">compat.dox File Reference</div></div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
</div><!-- contents -->
|
||||||
|
<address class="footer">
|
||||||
|
<p>
|
||||||
|
Last update on Fri Jul 22 2022 for GLFW 3.3.8
|
||||||
|
</p>
|
||||||
|
</address>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,145 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.9.4"/>
|
||||||
|
<title>GLFW: Standards conformance</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="extra.css" rel="stylesheet" type="text/css"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<div class="glfwheader">
|
||||||
|
<a href="https://www.glfw.org/" id="glfwhome">GLFW</a>
|
||||||
|
<ul class="glfwnavbar">
|
||||||
|
<li><a href="https://www.glfw.org/documentation.html">Documentation</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/download.html">Download</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/community.html">Community</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.9.4 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src="menudata.js"></script>
|
||||||
|
<script type="text/javascript" src="menu.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
$(function() {
|
||||||
|
initMenu('',true,false,'search.php','Search');
|
||||||
|
$(document).ready(function() { init_search(); });
|
||||||
|
});
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<div id="main-nav"></div>
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div><!-- top -->
|
||||||
|
<div><div class="header">
|
||||||
|
<div class="headertitle"><div class="title">Standards conformance </div></div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<div class="toc"><h3>Table of Contents</h3>
|
||||||
|
<ul><li class="level1"><a href="#compat_x11">X11 extensions, protocols and IPC standards</a></li>
|
||||||
|
<li class="level1"><a href="#compat_wayland">Wayland protocols and IPC standards</a></li>
|
||||||
|
<li class="level1"><a href="#compat_glx">GLX extensions</a></li>
|
||||||
|
<li class="level1"><a href="#compat_wgl">WGL extensions</a></li>
|
||||||
|
<li class="level1"><a href="#compat_osx">OpenGL on macOS</a></li>
|
||||||
|
<li class="level1"><a href="#compat_vulkan">Vulkan loader and API</a></li>
|
||||||
|
<li class="level1"><a href="#compat_wsi">Vulkan WSI extensions</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="textblock"><p >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.</p>
|
||||||
|
<p >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.</p>
|
||||||
|
<h1><a class="anchor" id="compat_x11"></a>
|
||||||
|
X11 extensions, protocols and IPC standards</h1>
|
||||||
|
<p >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 <a href="https://www.tronche.com/gui/x/icccm/">Inter-Client Communication Conventions Manual</a> (ICCCM) and <a href="https://standards.freedesktop.org/wm-spec/wm-spec-latest.html">Extended Window Manager Hints</a> (EWMH) standards.</p>
|
||||||
|
<p >GLFW uses the <code>_MOTIF_WM_HINTS</code> window property to support borderless windows. If the running window manager does not support this property, the <code>GLFW_DECORATED</code> hint will have no effect.</p>
|
||||||
|
<p >GLFW uses the ICCCM <code>WM_DELETE_WINDOW</code> 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.</p>
|
||||||
|
<p >GLFW uses the EWMH <code>_NET_WM_PING</code> 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.</p>
|
||||||
|
<p >GLFW uses the EWMH <code>_NET_WM_STATE_FULLSCREEN</code> 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.</p>
|
||||||
|
<p >GLFW uses the EWMH <code>_NET_WM_BYPASS_COMPOSITOR</code> 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.</p>
|
||||||
|
<p >GLFW uses the <a href="https://www.freedesktop.org/wiki/ClipboardManager/">clipboard manager protocol</a> to push a clipboard string (i.e. selection) owned by a GLFW window about to be destroyed to the clipboard manager. If there is no running clipboard manager, the clipboard string will be unavailable once the window has been destroyed.</p>
|
||||||
|
<p >GLFW uses the <a href="https://www.freedesktop.org/wiki/Specifications/XDND/">X drag-and-drop protocol</a> to provide file drop events. If the application originating the drag does not support this protocol, drag and drop will not work.</p>
|
||||||
|
<p >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.</p>
|
||||||
|
<p >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.</p>
|
||||||
|
<p >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.</p>
|
||||||
|
<p >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.</p>
|
||||||
|
<p >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 <code>GLFW_TRANSPARENT_FRAMEBUFFER</code> framebuffer hint will have no effect.</p>
|
||||||
|
<h1><a class="anchor" id="compat_wayland"></a>
|
||||||
|
Wayland protocols and IPC standards</h1>
|
||||||
|
<p >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 <a href="https://xkbcommon.org/">libxkbcommon</a>. In addition, GLFW uses some protocols from wayland-protocols to provide additional features if the compositor supports them.</p>
|
||||||
|
<p >GLFW uses xkbcommon 0.5.0 to provide compose key support. When it has been built against an older xkbcommon, the compose key will be disabled even if it has been configured in the compositor.</p>
|
||||||
|
<p >GLFW uses the <a href="https://cgit.freedesktop.org/wayland/wayland-protocols/tree/stable/xdg-shell/xdg-shell.xml">xdg-shell protocol</a> to provide better window management. This protocol is part of wayland-protocols 1.12, and mandatory at build time.</p>
|
||||||
|
<p >GLFW uses the <a href="https://cgit.freedesktop.org/wayland/wayland-protocols/tree/unstable/relative-pointer/relative-pointer-unstable-v1.xml">relative pointer protocol</a> alongside the <a href="https://cgit.freedesktop.org/wayland/wayland-protocols/tree/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml">pointer constraints protocol</a> to implement disabled cursor. These two protocols are part of wayland-protocols 1.1, and mandatory at build time. If the running compositor does not support both of these protocols, disabling the cursor will have no effect.</p>
|
||||||
|
<p >GLFW uses the <a href="https://cgit.freedesktop.org/wayland/wayland-protocols/tree/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml">idle inhibit protocol</a> to prohibit the screensaver from starting. This protocol is part of wayland-protocols 1.6, and mandatory at build time. If the running compositor does not support this protocol, the screensaver may start even for full screen windows.</p>
|
||||||
|
<p >GLFW uses the <a href="https://cgit.freedesktop.org/wayland/wayland-protocols/tree/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml">xdg-decoration protocol</a> 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 <a href="https://cgit.freedesktop.org/wayland/wayland-protocols/tree/stable/viewporter/viewporter.xml">viewporter protocol</a> alongside <a href="https://cgit.freedesktop.org/wayland/wayland/tree/protocol/wayland.xml#n2598">subsurfaces</a>. This protocol is part of wayland-protocols 1.4, and mandatory at build time. If the running compositor does not support this protocol either, no decorations will be drawn around windows.</p>
|
||||||
|
<h1><a class="anchor" id="compat_glx"></a>
|
||||||
|
GLX extensions</h1>
|
||||||
|
<p >The GLX API is the default API used to create OpenGL contexts on Unix-like systems using the X Window System.</p>
|
||||||
|
<p >GLFW uses the GLX 1.3 <code>GLXFBConfig</code> functions to enumerate and select framebuffer pixel formats. If GLX 1.3 is not supported, <a class="el" href="group__init.html#ga317aac130a235ab08c6db0834907d85e">glfwInit</a> will fail.</p>
|
||||||
|
<p >GLFW uses the <code>GLX_MESA_swap_control,</code> <code>GLX_EXT_swap_control</code> and <code>GLX_SGI_swap_control</code> extensions to provide vertical retrace synchronization (or <em>vsync</em>), in that order of preference. Where none of these extension are available, calling <a class="el" href="group__context.html#ga6d4e0cdf151b5e579bd67f13202994ed">glfwSwapInterval</a> will have no effect.</p>
|
||||||
|
<p >GLFW uses the <code>GLX_ARB_multisample</code> extension to create contexts with multisampling anti-aliasing. Where this extension is unavailable, the <code>GLFW_SAMPLES</code> hint will have no effect.</p>
|
||||||
|
<p >GLFW uses the <code>GLX_ARB_create_context</code> extension when available, even when creating OpenGL contexts of version 2.1 and below. Where this extension is unavailable, the <code>GLFW_CONTEXT_VERSION_MAJOR</code> and <code>GLFW_CONTEXT_VERSION_MINOR</code> hints will only be partially supported, the <code>GLFW_OPENGL_DEBUG_CONTEXT</code> hint will have no effect, and setting the <code>GLFW_OPENGL_PROFILE</code> or <code>GLFW_OPENGL_FORWARD_COMPAT</code> hints to <code>GLFW_TRUE</code> will cause <a class="el" href="group__window.html#ga3555a418df92ad53f917597fe2f64aeb">glfwCreateWindow</a> to fail.</p>
|
||||||
|
<p >GLFW uses the <code>GLX_ARB_create_context_profile</code> extension to provide support for context profiles. Where this extension is unavailable, setting the <code>GLFW_OPENGL_PROFILE</code> hint to anything but <code>GLFW_OPENGL_ANY_PROFILE</code>, or setting <code>GLFW_CLIENT_API</code> to anything but <code>GLFW_OPENGL_API</code> or <code>GLFW_NO_API</code> will cause <a class="el" href="group__window.html#ga3555a418df92ad53f917597fe2f64aeb">glfwCreateWindow</a> to fail.</p>
|
||||||
|
<p >GLFW uses the <code>GLX_ARB_context_flush_control</code> extension to provide control over whether a context is flushed when it is released (made non-current). Where this extension is unavailable, the <code>GLFW_CONTEXT_RELEASE_BEHAVIOR</code> hint will have no effect and the context will always be flushed when released.</p>
|
||||||
|
<p >GLFW uses the <code>GLX_ARB_framebuffer_sRGB</code> and <code>GLX_EXT_framebuffer_sRGB</code> extensions to provide support for sRGB framebuffers. Where both of these extensions are unavailable, the <code>GLFW_SRGB_CAPABLE</code> hint will have no effect.</p>
|
||||||
|
<h1><a class="anchor" id="compat_wgl"></a>
|
||||||
|
WGL extensions</h1>
|
||||||
|
<p >The WGL API is used to create OpenGL contexts on Microsoft Windows and other implementations of the Win32 API, such as Wine.</p>
|
||||||
|
<p >GLFW uses either the <code>WGL_EXT_extension_string</code> or the <code>WGL_ARB_extension_string</code> 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.</p>
|
||||||
|
<p >GLFW uses the <code>WGL_EXT_swap_control</code> extension to provide vertical retrace synchronization (or <em>vsync</em>). Where this extension is unavailable, calling <a class="el" href="group__context.html#ga6d4e0cdf151b5e579bd67f13202994ed">glfwSwapInterval</a> will have no effect.</p>
|
||||||
|
<p >GLFW uses the <code>WGL_ARB_pixel_format</code> and <code>WGL_ARB_multisample</code> extensions to create contexts with multisampling anti-aliasing. Where these extensions are unavailable, the <code>GLFW_SAMPLES</code> hint will have no effect.</p>
|
||||||
|
<p >GLFW uses the <code>WGL_ARB_create_context</code> extension when available, even when creating OpenGL contexts of version 2.1 and below. Where this extension is unavailable, the <code>GLFW_CONTEXT_VERSION_MAJOR</code> and <code>GLFW_CONTEXT_VERSION_MINOR</code> hints will only be partially supported, the <code>GLFW_OPENGL_DEBUG_CONTEXT</code> hint will have no effect, and setting the <code>GLFW_OPENGL_PROFILE</code> or <code>GLFW_OPENGL_FORWARD_COMPAT</code> hints to <code>GLFW_TRUE</code> will cause <a class="el" href="group__window.html#ga3555a418df92ad53f917597fe2f64aeb">glfwCreateWindow</a> to fail.</p>
|
||||||
|
<p >GLFW uses the <code>WGL_ARB_create_context_profile</code> extension to provide support for context profiles. Where this extension is unavailable, setting the <code>GLFW_OPENGL_PROFILE</code> hint to anything but <code>GLFW_OPENGL_ANY_PROFILE</code> will cause <a class="el" href="group__window.html#ga3555a418df92ad53f917597fe2f64aeb">glfwCreateWindow</a> to fail.</p>
|
||||||
|
<p >GLFW uses the <code>WGL_ARB_context_flush_control</code> extension to provide control over whether a context is flushed when it is released (made non-current). Where this extension is unavailable, the <code>GLFW_CONTEXT_RELEASE_BEHAVIOR</code> hint will have no effect and the context will always be flushed when released.</p>
|
||||||
|
<p >GLFW uses the <code>WGL_ARB_framebuffer_sRGB</code> and <code>WGL_EXT_framebuffer_sRGB</code> extensions to provide support for sRGB framebuffers. Where both of these extension are unavailable, the <code>GLFW_SRGB_CAPABLE</code> hint will have no effect.</p>
|
||||||
|
<h1><a class="anchor" id="compat_osx"></a>
|
||||||
|
OpenGL on macOS</h1>
|
||||||
|
<p >Support for OpenGL 3.2 and above was introduced with OS X 10.7 and even then only forward-compatible, core profile contexts are supported. Support for OpenGL 4.1 was introduced with OS X 10.9, also limited to forward-compatible, core profile contexts. There is also still no mechanism for requesting debug contexts or no-error contexts. Versions of Mac OS X earlier than 10.7 support at most OpenGL version 2.1.</p>
|
||||||
|
<p >Because of this, on OS X 10.7 and later, the <code>GLFW_CONTEXT_VERSION_MAJOR</code> and <code>GLFW_CONTEXT_VERSION_MINOR</code> hints will cause <a class="el" href="group__window.html#ga3555a418df92ad53f917597fe2f64aeb">glfwCreateWindow</a> to fail if given version 3.0 or 3.1. The <code>GLFW_OPENGL_FORWARD_COMPAT</code> hint must be set to <code>GLFW_TRUE</code> and the <code>GLFW_OPENGL_PROFILE</code> hint must be set to <code>GLFW_OPENGL_CORE_PROFILE</code> when creating OpenGL 3.2 and later contexts. The <code>GLFW_OPENGL_DEBUG_CONTEXT</code> and <code>GLFW_CONTEXT_NO_ERROR</code> hints are ignored.</p>
|
||||||
|
<p >Also, on Mac OS X 10.6 and below, the <code>GLFW_CONTEXT_VERSION_MAJOR</code> and <code>GLFW_CONTEXT_VERSION_MINOR</code> hints will fail if given a version above 2.1, setting the <code>GLFW_OPENGL_PROFILE</code> or <code>GLFW_OPENGL_FORWARD_COMPAT</code> hints to a non-default value will cause <a class="el" href="group__window.html#ga3555a418df92ad53f917597fe2f64aeb">glfwCreateWindow</a> to fail and the <code>GLFW_OPENGL_DEBUG_CONTEXT</code> hint is ignored.</p>
|
||||||
|
<h1><a class="anchor" id="compat_vulkan"></a>
|
||||||
|
Vulkan loader and API</h1>
|
||||||
|
<p >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, <a class="el" href="group__vulkan.html#ga2e7f30931e02464b5bc8d0d4b6f9fe2b">glfwVulkanSupported</a> will return <code>GLFW_FALSE</code> and all other Vulkan-related functions will fail with an <a class="el" href="group__errors.html#ga56882b290db23261cc6c053c40c2d08e">GLFW_API_UNAVAILABLE</a> error.</p>
|
||||||
|
<h1><a class="anchor" id="compat_wsi"></a>
|
||||||
|
Vulkan WSI extensions</h1>
|
||||||
|
<p >The Vulkan WSI extensions are used to create Vulkan surfaces for GLFW windows on all supported platforms.</p>
|
||||||
|
<p >GLFW uses the <code>VK_KHR_surface</code> and <code>VK_KHR_win32_surface</code> extensions to create surfaces on Microsoft Windows. If any of these extensions are not available, <a class="el" href="group__vulkan.html#ga99ad342d82f4a3421e2864978cb6d1d6">glfwGetRequiredInstanceExtensions</a> will return an empty list and window surface creation will fail.</p>
|
||||||
|
<p >GLFW uses the <code>VK_KHR_surface</code> and either the <code>VK_MVK_macos_surface</code> or <code>VK_EXT_metal_surface</code> extensions to create surfaces on macOS. If any of these extensions are not available, <a class="el" href="group__vulkan.html#ga99ad342d82f4a3421e2864978cb6d1d6">glfwGetRequiredInstanceExtensions</a> will return an empty list and window surface creation will fail.</p>
|
||||||
|
<p >GLFW uses the <code>VK_KHR_surface</code> and either the <code>VK_KHR_xlib_surface</code> or <code>VK_KHR_xcb_surface</code> extensions to create surfaces on X11. If <code>VK_KHR_surface</code> or both <code>VK_KHR_xlib_surface</code> and <code>VK_KHR_xcb_surface</code> are not available, <a class="el" href="group__vulkan.html#ga99ad342d82f4a3421e2864978cb6d1d6">glfwGetRequiredInstanceExtensions</a> will return an empty list and window surface creation will fail.</p>
|
||||||
|
<p >GLFW uses the <code>VK_KHR_surface</code> and <code>VK_KHR_wayland_surface</code> extensions to create surfaces on Wayland. If any of these extensions are not available, <a class="el" href="group__vulkan.html#ga99ad342d82f4a3421e2864978cb6d1d6">glfwGetRequiredInstanceExtensions</a> will return an empty list and window surface creation will fail. </p>
|
||||||
|
</div></div><!-- contents -->
|
||||||
|
</div><!-- PageDoc -->
|
||||||
|
<address class="footer">
|
||||||
|
<p>
|
||||||
|
Last update on Fri Jul 22 2022 for GLFW 3.3.8
|
||||||
|
</p>
|
||||||
|
</address>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,74 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.9.4"/>
|
||||||
|
<title>GLFW: compile.dox File Reference</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="extra.css" rel="stylesheet" type="text/css"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<div class="glfwheader">
|
||||||
|
<a href="https://www.glfw.org/" id="glfwhome">GLFW</a>
|
||||||
|
<ul class="glfwnavbar">
|
||||||
|
<li><a href="https://www.glfw.org/documentation.html">Documentation</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/download.html">Download</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/community.html">Community</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.9.4 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src="menudata.js"></script>
|
||||||
|
<script type="text/javascript" src="menu.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
$(function() {
|
||||||
|
initMenu('',true,false,'search.php','Search');
|
||||||
|
$(document).ready(function() { init_search(); });
|
||||||
|
});
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<div id="main-nav"></div>
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div><!-- top -->
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle"><div class="title">compile.dox File Reference</div></div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
</div><!-- contents -->
|
||||||
|
<address class="footer">
|
||||||
|
<p>
|
||||||
|
Last update on Fri Jul 22 2022 for GLFW 3.3.8
|
||||||
|
</p>
|
||||||
|
</address>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,216 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.9.4"/>
|
||||||
|
<title>GLFW: Compiling GLFW</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="extra.css" rel="stylesheet" type="text/css"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<div class="glfwheader">
|
||||||
|
<a href="https://www.glfw.org/" id="glfwhome">GLFW</a>
|
||||||
|
<ul class="glfwnavbar">
|
||||||
|
<li><a href="https://www.glfw.org/documentation.html">Documentation</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/download.html">Download</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/community.html">Community</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.9.4 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src="menudata.js"></script>
|
||||||
|
<script type="text/javascript" src="menu.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
$(function() {
|
||||||
|
initMenu('',true,false,'search.php','Search');
|
||||||
|
$(document).ready(function() { init_search(); });
|
||||||
|
});
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<div id="main-nav"></div>
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div><!-- top -->
|
||||||
|
<div><div class="header">
|
||||||
|
<div class="headertitle"><div class="title">Compiling GLFW </div></div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<div class="toc"><h3>Table of Contents</h3>
|
||||||
|
<ul><li class="level1"><a href="#compile_cmake">Using CMake</a><ul><li class="level2"><a href="#compile_deps">Installing dependencies</a><ul><li class="level3"><a href="#compile_deps_x11">Dependencies for X11 on Unix-like systems</a></li>
|
||||||
|
<li class="level3"><a href="#compile_deps_wayland">Dependencies for Wayland on Unix-like systems</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li class="level2"><a href="#compile_generate">Generating build files with CMake</a><ul><li class="level3"><a href="#compile_generate_gui">Generating files with the CMake GUI</a></li>
|
||||||
|
<li class="level3"><a href="#compile_generate_cli">Generating files with the CMake command-line tool</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li class="level2"><a href="#compile_compile">Compiling the library</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li class="level1"><a href="#compile_options">CMake options</a><ul><li class="level2"><a href="#compile_options_shared">Shared CMake options</a></li>
|
||||||
|
<li class="level2"><a href="#compile_options_win32">Windows specific CMake options</a></li>
|
||||||
|
<li class="level2"><a href="#compile_options_wayland">Wayland specific CMake options</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li class="level1"><a href="#compile_mingw_cross">Cross-compilation with CMake and MinGW</a></li>
|
||||||
|
<li class="level1"><a href="#compile_manual">Compiling GLFW manually</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="textblock"><p >This is about compiling the GLFW library itself. For information on how to build applications that use GLFW, see <a class="el" href="build_guide.html">Building applications</a>.</p>
|
||||||
|
<h1><a class="anchor" id="compile_cmake"></a>
|
||||||
|
Using CMake</h1>
|
||||||
|
<dl class="section note"><dt>Note</dt><dd>GLFW behaves like most other libraries that use CMake so this guide mostly describes the basic configure/generate/compile sequence. If you are already familiar with this from other projects, you may want to focus on the <a class="el" href="compile_guide.html#compile_deps">Installing dependencies</a> and <a class="el" href="compile_guide.html#compile_options">CMake options</a> sections for GLFW-specific information.</dd></dl>
|
||||||
|
<p>GLFW uses <a href="https://cmake.org/">CMake</a> 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.</p>
|
||||||
|
<p >If you are on Windows and macOS you can <a href="https://cmake.org/download/">download CMake</a> from their site.</p>
|
||||||
|
<p >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.</p>
|
||||||
|
<p >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 <a href="https://cmake.org/cmake/help/latest/guide/user-interaction/">CMake user guide</a> that includes everything in this guide not specific to GLFW. It may be a useful companion to this one.</p>
|
||||||
|
<h2><a class="anchor" id="compile_deps"></a>
|
||||||
|
Installing dependencies</h2>
|
||||||
|
<p >The C/C++ development environments in Visual Studio, Xcode and MinGW come with all necessary dependencies for compiling GLFW, but on Unix-like systems like Linux and FreeBSD you will need a few extra packages.</p>
|
||||||
|
<h3><a class="anchor" id="compile_deps_x11"></a>
|
||||||
|
Dependencies for X11 on Unix-like systems</h3>
|
||||||
|
<p >To compile GLFW for X11, you need to have the X11 development packages installed. They are not needed to build or run programs that use GLFW.</p>
|
||||||
|
<p >On Debian and derivates like Ubuntu and Linux Mint the <code>xorg-dev</code> meta-package pulls in the development packages for all of X11.</p>
|
||||||
|
<div class="fragment"><div class="line">sudo apt install xorg-dev</div>
|
||||||
|
</div><!-- fragment --><p >On Fedora and derivatives like Red Hat the X11 extension packages <code>libXcursor-devel</code>, <code>libXi-devel</code>, <code>libXinerama-devel</code> and <code>libXrandr-devel</code> required by GLFW pull in all its other dependencies.</p>
|
||||||
|
<div class="fragment"><div class="line">sudo dnf install libXcursor-devel libXi-devel libXinerama-devel libXrandr-devel</div>
|
||||||
|
</div><!-- fragment --><p >On FreeBSD 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 <code>xorgproto</code> package.</p>
|
||||||
|
<div class="fragment"><div class="line">pkg install xorgproto</div>
|
||||||
|
</div><!-- fragment --><p >On Cygwin the <code>libXcursor-devel</code>, <code>libXi-devel</code>, <code>libXinerama-devel</code>, <code>libXrandr-devel</code> and <code>libXrender-devel</code> packages in the Libs section of the GUI installer will install all the headers and other development related files GLFW requires for X11.</p>
|
||||||
|
<p >Once you have the required depdendencies, move on to <a class="el" href="compile_guide.html#compile_generate">Generating build files with CMake</a>.</p>
|
||||||
|
<h3><a class="anchor" id="compile_deps_wayland"></a>
|
||||||
|
Dependencies for Wayland on Unix-like systems</h3>
|
||||||
|
<p >To compile GLFW for Wayland, you need to have the Wayland and xkbcommon development packages installed. They are not needed to build or run programs that use GLFW.</p>
|
||||||
|
<p >On Debian and derivates like Ubuntu and Linux Mint you will need the <code>libwayland-dev</code>, <code>libxkbcommon-dev</code>, <code>wayland-protocols</code> and <code>extra-cmake-modules</code> packages.</p>
|
||||||
|
<div class="fragment"><div class="line">sudo apt install libwayland-dev libxkbcommon-dev wayland-protocols extra-cmake-modules</div>
|
||||||
|
</div><!-- fragment --><p >On Fedora and derivatives like Red Hat you will need the <code>wayland-devel</code>, <code>libxkbcommon-devel</code>, <code>wayland-protocols-devel</code> and <code>extra-cmake-modules</code> packages.</p>
|
||||||
|
<div class="fragment"><div class="line">sudo dnf install wayland-devel libxkbcommon-devel wayland-protocols-devel extra-cmake-modules</div>
|
||||||
|
</div><!-- fragment --><p >On FreeBSD you will need the <code>wayland</code>, <code>libxkbcommon</code>, <code>wayland-protocols</code> and <code>kf5-extra-cmake-modules</code> packages.</p>
|
||||||
|
<div class="fragment"><div class="line">pkg install wayland libxkbcommon wayland-protocols kf5-extra-cmake-modules</div>
|
||||||
|
</div><!-- fragment --><p >Once you have the required depdendencies, move on to <a class="el" href="compile_guide.html#compile_generate">Generating build files with CMake</a>.</p>
|
||||||
|
<h2><a class="anchor" id="compile_generate"></a>
|
||||||
|
Generating build files with CMake</h2>
|
||||||
|
<p >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:</p>
|
||||||
|
<ul>
|
||||||
|
<li>the path to the root directory of the GLFW source tree (not its <code>src</code> subdirectory)</li>
|
||||||
|
<li>the path to the directory where the generated build files and compiled binaries will be placed</li>
|
||||||
|
</ul>
|
||||||
|
<p >If these are the same, it is called an in-tree build, otherwise it is called an out-of-tree build.</p>
|
||||||
|
<p >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.</p>
|
||||||
|
<p >A common pattern when building a single configuration is to have a build directory named <code>build</code> in the root of the source tree.</p>
|
||||||
|
<h3><a class="anchor" id="compile_generate_gui"></a>
|
||||||
|
Generating files with the CMake GUI</h3>
|
||||||
|
<p >Start the CMake GUI and set the paths to the source and build directories described above. Then press <em>Configure</em> and <em>Generate</em>.</p>
|
||||||
|
<p >If you wish change any CMake variables in the list, press <em>Configure</em> and then <em>Generate</em> to have the new values take effect. The variable list will be populated after the first configure step.</p>
|
||||||
|
<p >By default GLFW will use X11 on Linux and other Unix-like systems other than macOS. To use Wayland instead, set the <code>GLFW_USE_WAYLAND</code> option in the GLFW section of the variable list, then apply the new value as described above.</p>
|
||||||
|
<p >Once you have generated the project files or makefiles for your chosen development environment, move on to <a class="el" href="compile_guide.html#compile_compile">Compiling the library</a>.</p>
|
||||||
|
<h3><a class="anchor" id="compile_generate_cli"></a>
|
||||||
|
Generating files with the CMake command-line tool</h3>
|
||||||
|
<p >To make a build directory, pass the source and build directories to the <code>cmake</code> command. These can be relative or absolute paths. The build directory is created if it doesn't already exist.</p>
|
||||||
|
<div class="fragment"><div class="line">cmake -S path/to/glfw -B path/to/build</div>
|
||||||
|
</div><!-- fragment --><p >It is common to name the build directory <code>build</code> and place it in the root of the source tree when only planning to build a single configuration.</p>
|
||||||
|
<div class="fragment"><div class="line">cd path/to/glfw</div>
|
||||||
|
<div class="line">cmake -S . -B build</div>
|
||||||
|
</div><!-- fragment --><p >Without other flags these will generate Visual Studio project files on Windows and makefiles on other platforms. You can choose other targets using the <code>-G</code> flag.</p>
|
||||||
|
<div class="fragment"><div class="line">cmake -S path/to/glfw -B path/to/build -G Xcode</div>
|
||||||
|
</div><!-- fragment --><p >By default GLFW will use X11 on Linux and other Unix-like systems other than macOS. To use Wayland instead, set the <code>GLFW_USE_WAYLAND</code> CMake option.</p>
|
||||||
|
<div class="fragment"><div class="line">cmake -S path/to/glfw -B path/to/build -D GLFW_USE_WAYLAND=1</div>
|
||||||
|
</div><!-- fragment --><p >Once you have generated the project files or makefiles for your chosen development environment, move on to <a class="el" href="compile_guide.html#compile_compile">Compiling the library</a>.</p>
|
||||||
|
<h2><a class="anchor" id="compile_compile"></a>
|
||||||
|
Compiling the library</h2>
|
||||||
|
<p >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.</p>
|
||||||
|
<p >With Visual Studio open <code>GLFW.sln</code> and use the Build menu. With Xcode open <code>GLFW.xcodeproj</code> and use the Project menu.</p>
|
||||||
|
<p >With Linux, macOS and other forms of Unix, run <code>make</code>.</p>
|
||||||
|
<div class="fragment"><div class="line">cd path/to/build</div>
|
||||||
|
<div class="line">make</div>
|
||||||
|
</div><!-- fragment --><p >With MinGW, it is <code>mingw32-make</code>.</p>
|
||||||
|
<div class="fragment"><div class="line">cd path/to/build</div>
|
||||||
|
<div class="line">mingw32-make</div>
|
||||||
|
</div><!-- fragment --><p >Any CMake build directory can also be built with the <code>cmake</code> command and the <code>--build</code> flag.</p>
|
||||||
|
<div class="fragment"><div class="line">cmake --build path/to/build</div>
|
||||||
|
</div><!-- fragment --><p >This will run the platform specific build tool the directory was generated for.</p>
|
||||||
|
<p >Once the GLFW library is compiled you are ready to build your application, linking it to the GLFW library. See <a class="el" href="build_guide.html">Building applications</a> for more information.</p>
|
||||||
|
<h1><a class="anchor" id="compile_options"></a>
|
||||||
|
CMake options</h1>
|
||||||
|
<p >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 <code>GLFW_</code> prefix.</p>
|
||||||
|
<p >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 <code>ccmake</code> ncurses GUI to set options. Some package systems like Ubuntu and other distributions based on Debian GNU/Linux have this tool in a separate <code>cmake-curses-gui</code> package.</p>
|
||||||
|
<p >Finally, if you don't want to use any GUI, you can set options from the <code>cmake</code> command-line with the <code>-D</code> flag.</p>
|
||||||
|
<div class="fragment"><div class="line">cmake -S path/to/glfw -B path/to/build -D BUILD_SHARED_LIBS=ON</div>
|
||||||
|
</div><!-- fragment --><h2><a class="anchor" id="compile_options_shared"></a>
|
||||||
|
Shared CMake options</h2>
|
||||||
|
<p ><a class="anchor" id="BUILD_SHARED_LIBS"></a><b>BUILD_SHARED_LIBS</b> 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.</p>
|
||||||
|
<p ><a class="anchor" id="GLFW_BUILD_EXAMPLES"></a><b>GLFW_BUILD_EXAMPLES</b> determines whether the GLFW examples are built along with the library.</p>
|
||||||
|
<p ><a class="anchor" id="GLFW_BUILD_TESTS"></a><b>GLFW_BUILD_TESTS</b> determines whether the GLFW test programs are built along with the library.</p>
|
||||||
|
<p ><a class="anchor" id="GLFW_BUILD_DOCS"></a><b>GLFW_BUILD_DOCS</b> determines whether the GLFW documentation is built along with the library. This is enabled by default if <a href="https://www.doxygen.nl/">Doxygen</a> is found by CMake during configuration.</p>
|
||||||
|
<p ><a class="anchor" id="GLFW_VULKAN_STATIC"></a><b>GLFW_VULKAN_STATIC</b> determines whether to use the Vulkan loader linked directly with the application. This is disabled by default.</p>
|
||||||
|
<h2><a class="anchor" id="compile_options_win32"></a>
|
||||||
|
Windows specific CMake options</h2>
|
||||||
|
<p ><a class="anchor" id="USE_MSVC_RUNTIME_LIBRARY_DLL"></a><b>USE_MSVC_RUNTIME_LIBRARY_DLL</b> 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.</p>
|
||||||
|
<p >On CMake 3.15 and later you can set the standard CMake <a href="https://cmake.org/cmake/help/latest/variable/CMAKE_MSVC_RUNTIME_LIBRARY.html">CMAKE_MSVC_RUNTIME_LIBRARY</a> variable instead of this GLFW-specific option.</p>
|
||||||
|
<p ><a class="anchor" id="GLFW_USE_HYBRID_HPG"></a><b>GLFW_USE_HYBRID_HPG</b> determines whether to export the <code>NvOptimusEnablement</code> and <code>AmdPowerXpressRequestHighPerformance</code> 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.</p>
|
||||||
|
<h2><a class="anchor" id="compile_options_wayland"></a>
|
||||||
|
Wayland specific CMake options</h2>
|
||||||
|
<p ><a class="anchor" id="GLFW_USE_WAYLAND"></a><b>GLFW_USE_WAYLAND</b> determines whether to compile the library for Wayland. This option is only available on Linux and other Unix-like systems other than macOS. This is disabled by default.</p>
|
||||||
|
<h1><a class="anchor" id="compile_mingw_cross"></a>
|
||||||
|
Cross-compilation with CMake and MinGW</h1>
|
||||||
|
<p >Both Cygwin and many Linux distributions have MinGW or MinGW-w64 packages. For example, Cygwin has the <code>mingw64-i686-gcc</code> and <code>mingw64-x86_64-gcc</code> packages for 32- and 64-bit version of MinGW-w64, while Debian GNU/Linux and derivatives like Ubuntu have the <code>mingw-w64</code> package for both.</p>
|
||||||
|
<p >GLFW has CMake toolchain files in the <code>CMake</code> subdirectory that set up cross-compilation of Windows binaries. To use these files you set the <code>CMAKE_TOOLCHAIN_FILE</code> CMake variable with the <code>-D</code> flag add an option when configuring and generating the build files.</p>
|
||||||
|
<div class="fragment"><div class="line">cmake -S path/to/glfw -B path/to/build -D CMAKE_TOOLCHAIN_FILE=path/to/file</div>
|
||||||
|
</div><!-- fragment --><p >The exact toolchain file to use depends on the prefix used by the MinGW or 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 <code>/usr/x86_64-w64-mingw32</code> for the 64-bit compilers, so the correct invocation would be:</p>
|
||||||
|
<div class="fragment"><div class="line">cmake -S path/to/glfw -B path/to/build -D CMAKE_TOOLCHAIN_FILE=CMake/x86_64-w64-mingw32.cmake</div>
|
||||||
|
</div><!-- fragment --><p >The path to the toolchain file is relative to the path to the GLFW source tree passed to the <code>-S</code> flag, not to the current directory.</p>
|
||||||
|
<p >For more details see the <a href="https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html">CMake toolchain guide</a>.</p>
|
||||||
|
<h1><a class="anchor" id="compile_manual"></a>
|
||||||
|
Compiling GLFW manually</h1>
|
||||||
|
<p >If you wish to compile GLFW without its CMake build environment then you will have to do at least some of the platform detection yourself. GLFW needs a configuration macro to be defined in order to know what window system it is being compiled for and also has optional, platform-specific ones for various features.</p>
|
||||||
|
<p >When building with CMake, the <code>glfw_config.h</code> configuration header is generated based on the current platform and CMake options. The GLFW CMake environment defines <b>GLFW_USE_CONFIG_H</b>, which causes this header to be included by <code>internal.h</code>. Without this macro, GLFW will expect the necessary configuration macros to be defined on the command-line.</p>
|
||||||
|
<p >The window creation API is used to create windows, handle input, monitors, gamma ramps and clipboard. The options are:</p>
|
||||||
|
<ul>
|
||||||
|
<li><b>_GLFW_COCOA</b> to use the Cocoa frameworks</li>
|
||||||
|
<li><b>_GLFW_WIN32</b> to use the Win32 API</li>
|
||||||
|
<li><b>_GLFW_X11</b> to use the X Window System</li>
|
||||||
|
<li><b>_GLFW_WAYLAND</b> to use the Wayland API (experimental and incomplete)</li>
|
||||||
|
<li><b>_GLFW_OSMESA</b> to use the OSMesa API (headless and non-interactive)</li>
|
||||||
|
</ul>
|
||||||
|
<p >If you are building GLFW as a shared library / dynamic library / DLL then you must also define <b>_GLFW_BUILD_DLL</b>. Otherwise, you must not define it.</p>
|
||||||
|
<p >If you are linking the Vulkan loader directly with your application then you must also define <b>_GLFW_VULKAN_STATIC</b>. Otherwise, GLFW will attempt to use the external version.</p>
|
||||||
|
<p >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>, <b>_GLFW_EGL_LIBRARY</b>, <b>_GLFW_GLX_LIBRARY</b>, <b>_GLFW_OSMESA_LIBRARY</b>, <b>_GLFW_OPENGL_LIBRARY</b>, <b>_GLFW_GLESV1_LIBRARY</b> and <b>_GLFW_GLESV2_LIBRARY</b>. Otherwise, GLFW will use the built-in default names.</p>
|
||||||
|
<dl class="section note"><dt>Note</dt><dd>None of the <a class="el" href="build_guide.html#build_macros">GLFW header option macros</a> 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. </dd></dl>
|
||||||
|
</div></div><!-- contents -->
|
||||||
|
</div><!-- PageDoc -->
|
||||||
|
<address class="footer">
|
||||||
|
<p>
|
||||||
|
Last update on Fri Jul 22 2022 for GLFW 3.3.8
|
||||||
|
</p>
|
||||||
|
</address>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,74 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.9.4"/>
|
||||||
|
<title>GLFW: context.dox File Reference</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="extra.css" rel="stylesheet" type="text/css"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<div class="glfwheader">
|
||||||
|
<a href="https://www.glfw.org/" id="glfwhome">GLFW</a>
|
||||||
|
<ul class="glfwnavbar">
|
||||||
|
<li><a href="https://www.glfw.org/documentation.html">Documentation</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/download.html">Download</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/community.html">Community</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.9.4 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src="menudata.js"></script>
|
||||||
|
<script type="text/javascript" src="menu.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
$(function() {
|
||||||
|
initMenu('',true,false,'search.php','Search');
|
||||||
|
$(document).ready(function() { init_search(); });
|
||||||
|
});
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<div id="main-nav"></div>
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div><!-- top -->
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle"><div class="title">context.dox File Reference</div></div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
</div><!-- contents -->
|
||||||
|
<address class="footer">
|
||||||
|
<p>
|
||||||
|
Last update on Fri Jul 22 2022 for GLFW 3.3.8
|
||||||
|
</p>
|
||||||
|
</address>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,251 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.9.4"/>
|
||||||
|
<title>GLFW: Context guide</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="extra.css" rel="stylesheet" type="text/css"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<div class="glfwheader">
|
||||||
|
<a href="https://www.glfw.org/" id="glfwhome">GLFW</a>
|
||||||
|
<ul class="glfwnavbar">
|
||||||
|
<li><a href="https://www.glfw.org/documentation.html">Documentation</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/download.html">Download</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/community.html">Community</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.9.4 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src="menudata.js"></script>
|
||||||
|
<script type="text/javascript" src="menu.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
$(function() {
|
||||||
|
initMenu('',true,false,'search.php','Search');
|
||||||
|
$(document).ready(function() { init_search(); });
|
||||||
|
});
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<div id="main-nav"></div>
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div><!-- top -->
|
||||||
|
<div><div class="header">
|
||||||
|
<div class="headertitle"><div class="title">Context guide </div></div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<div class="toc"><h3>Table of Contents</h3>
|
||||||
|
<ul><li class="level1"><a href="#context_object">Context objects</a><ul><li class="level2"><a href="#context_hints">Context creation hints</a></li>
|
||||||
|
<li class="level2"><a href="#context_sharing">Context object sharing</a></li>
|
||||||
|
<li class="level2"><a href="#context_offscreen">Offscreen contexts</a></li>
|
||||||
|
<li class="level2"><a href="#context_less">Windows without contexts</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li class="level1"><a href="#context_current">Current context</a></li>
|
||||||
|
<li class="level1"><a href="#context_swap">Buffer swapping</a></li>
|
||||||
|
<li class="level1"><a href="#context_glext">OpenGL and OpenGL ES extensions</a><ul><li class="level2"><a href="#context_glext_auto">Loading extension with a loader library</a></li>
|
||||||
|
<li class="level2"><a href="#context_glext_manual">Loading extensions manually</a><ul><li class="level3"><a href="#context_glext_header">The glext.h header</a></li>
|
||||||
|
<li class="level3"><a href="#context_glext_string">Checking for extensions</a></li>
|
||||||
|
<li class="level3"><a href="#context_glext_proc">Fetching function pointers</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="textblock"><p >This guide introduces the OpenGL and OpenGL ES context related functions of GLFW. For details on a specific function in this category, see the <a class="el" href="group__context.html">Context reference</a>. There are also guides for the other areas of the GLFW API.</p>
|
||||||
|
<ul>
|
||||||
|
<li><a class="el" href="intro_guide.html">Introduction to the API</a></li>
|
||||||
|
<li><a class="el" href="window_guide.html">Window guide</a></li>
|
||||||
|
<li><a class="el" href="vulkan_guide.html">Vulkan guide</a></li>
|
||||||
|
<li><a class="el" href="monitor_guide.html">Monitor guide</a></li>
|
||||||
|
<li><a class="el" href="input_guide.html">Input guide</a></li>
|
||||||
|
</ul>
|
||||||
|
<h1><a class="anchor" id="context_object"></a>
|
||||||
|
Context objects</h1>
|
||||||
|
<p >A window object encapsulates both a top-level window and an OpenGL or OpenGL ES context. It is created with <a class="el" href="group__window.html#ga3555a418df92ad53f917597fe2f64aeb">glfwCreateWindow</a> and destroyed with <a class="el" href="group__window.html#gacdf43e51376051d2c091662e9fe3d7b2">glfwDestroyWindow</a> or <a class="el" href="group__init.html#gaaae48c0a18607ea4a4ba951d939f0901">glfwTerminate</a>. See <a class="el" href="window_guide.html#window_creation">Window creation</a> for more information.</p>
|
||||||
|
<p >As the window and context are inseparably linked, the window object also serves as the context handle.</p>
|
||||||
|
<p >To test the creation of various kinds of contexts and see their properties, run the <code>glfwinfo</code> test program.</p>
|
||||||
|
<dl class="section note"><dt>Note</dt><dd>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 <a class="el" href="window_guide.html#GLFW_CLIENT_API_hint">GLFW_CLIENT_API</a> hint to <code>GLFW_NO_API</code>. For more information, see the <a class="el" href="vulkan_guide.html">Vulkan guide</a>.</dd></dl>
|
||||||
|
<h2><a class="anchor" id="context_hints"></a>
|
||||||
|
Context creation hints</h2>
|
||||||
|
<p >There are a number of hints, specified using <a class="el" href="group__window.html#ga7d9c8c62384b1e2821c4dc48952d2033">glfwWindowHint</a>, related to what kind of context is created. See <a class="el" href="window_guide.html#window_hints_ctx">context related hints</a> in the window guide.</p>
|
||||||
|
<h2><a class="anchor" id="context_sharing"></a>
|
||||||
|
Context object sharing</h2>
|
||||||
|
<p >When creating a window and its OpenGL or OpenGL ES context with <a class="el" href="group__window.html#ga3555a418df92ad53f917597fe2f64aeb">glfwCreateWindow</a>, you can specify another window whose context the new one should share its objects (textures, vertex and element buffers, etc.) with.</p>
|
||||||
|
<div class="fragment"><div class="line"><a class="code hl_typedef" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a>* second_window = <a class="code hl_function" href="group__window.html#ga3555a418df92ad53f917597fe2f64aeb">glfwCreateWindow</a>(640, 480, <span class="stringliteral">"Second Window"</span>, NULL, first_window);</div>
|
||||||
|
<div class="ttc" id="agroup__window_html_ga3555a418df92ad53f917597fe2f64aeb"><div class="ttname"><a href="group__window.html#ga3555a418df92ad53f917597fe2f64aeb">glfwCreateWindow</a></div><div class="ttdeci">GLFWwindow * glfwCreateWindow(int width, int height, const char *title, GLFWmonitor *monitor, GLFWwindow *share)</div><div class="ttdoc">Creates a window and its associated context.</div></div>
|
||||||
|
<div class="ttc" id="agroup__window_html_ga3c96d80d363e67d13a41b5d1821f3242"><div class="ttname"><a href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a></div><div class="ttdeci">struct GLFWwindow GLFWwindow</div><div class="ttdoc">Opaque window object.</div><div class="ttdef"><b>Definition:</b> glfw3.h:1185</div></div>
|
||||||
|
</div><!-- fragment --><p >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.</p>
|
||||||
|
<p >See the relevant chapter of the <a href="https://www.opengl.org/registry/">OpenGL</a> or <a href="https://www.khronos.org/opengles/">OpenGL ES</a> reference documents for more information. The name and number of this chapter unfortunately varies between versions and APIs, but has at times been named <em>Shared Objects and Multiple Contexts</em>.</p>
|
||||||
|
<p >GLFW comes with a barebones object sharing example program called <code>sharing</code>.</p>
|
||||||
|
<h2><a class="anchor" id="context_offscreen"></a>
|
||||||
|
Offscreen contexts</h2>
|
||||||
|
<p >GLFW doesn't support creating contexts without an associated window. However, contexts with hidden windows can be created with the <a class="el" href="window_guide.html#GLFW_VISIBLE_hint">GLFW_VISIBLE</a> window hint.</p>
|
||||||
|
<div class="fragment"><div class="line"><a class="code hl_function" href="group__window.html#ga7d9c8c62384b1e2821c4dc48952d2033">glfwWindowHint</a>(<a class="code hl_define" href="group__window.html#gafb3cdc45297e06d8f1eb13adc69ca6c4">GLFW_VISIBLE</a>, <a class="code hl_define" href="group__init.html#gac877fe3b627d21ef3a0a23e0a73ba8c5">GLFW_FALSE</a>);</div>
|
||||||
|
<div class="line"> </div>
|
||||||
|
<div class="line"><a class="code hl_typedef" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a>* offscreen_context = <a class="code hl_function" href="group__window.html#ga3555a418df92ad53f917597fe2f64aeb">glfwCreateWindow</a>(640, 480, <span class="stringliteral">""</span>, NULL, NULL);</div>
|
||||||
|
<div class="ttc" id="agroup__init_html_gac877fe3b627d21ef3a0a23e0a73ba8c5"><div class="ttname"><a href="group__init.html#gac877fe3b627d21ef3a0a23e0a73ba8c5">GLFW_FALSE</a></div><div class="ttdeci">#define GLFW_FALSE</div><div class="ttdoc">Zero.</div><div class="ttdef"><b>Definition:</b> glfw3.h:321</div></div>
|
||||||
|
<div class="ttc" id="agroup__window_html_ga7d9c8c62384b1e2821c4dc48952d2033"><div class="ttname"><a href="group__window.html#ga7d9c8c62384b1e2821c4dc48952d2033">glfwWindowHint</a></div><div class="ttdeci">void glfwWindowHint(int hint, int value)</div><div class="ttdoc">Sets the specified window hint to the desired value.</div></div>
|
||||||
|
<div class="ttc" id="agroup__window_html_gafb3cdc45297e06d8f1eb13adc69ca6c4"><div class="ttname"><a href="group__window.html#gafb3cdc45297e06d8f1eb13adc69ca6c4">GLFW_VISIBLE</a></div><div class="ttdeci">#define GLFW_VISIBLE</div><div class="ttdoc">Window visibility window hint and attribute.</div><div class="ttdef"><b>Definition:</b> glfw3.h:814</div></div>
|
||||||
|
</div><!-- fragment --><p >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.</p>
|
||||||
|
<p >You should still <a class="el" href="input_guide.html#events">process events</a> as long as you have at least one window, even if none of them are visible.</p>
|
||||||
|
<p ><b>macOS:</b> The first time a window is created the menu bar is created. This is not desirable for example when writing a command-line only application. Menu bar creation can be disabled with the <a class="el" href="group__init.html#ga71e0b4ce2f2696a84a9b8c5e12dc70cf">GLFW_COCOA_MENUBAR</a> init hint.</p>
|
||||||
|
<h2><a class="anchor" id="context_less"></a>
|
||||||
|
Windows without contexts</h2>
|
||||||
|
<p >You can disable context creation by setting the <a class="el" href="window_guide.html#GLFW_CLIENT_API_hint">GLFW_CLIENT_API</a> hint to <code>GLFW_NO_API</code>. Windows without contexts must not be passed to <a class="el" href="group__context.html#ga1c04dc242268f827290fe40aa1c91157">glfwMakeContextCurrent</a> or <a class="el" href="group__window.html#ga15a5a1ee5b3c2ca6b15ca209a12efd14">glfwSwapBuffers</a>.</p>
|
||||||
|
<h1><a class="anchor" id="context_current"></a>
|
||||||
|
Current context</h1>
|
||||||
|
<p >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.</p>
|
||||||
|
<p >When moving a context between threads, you must make it non-current on the old thread before making it current on the new one.</p>
|
||||||
|
<p >The context of a window is made current with <a class="el" href="group__context.html#ga1c04dc242268f827290fe40aa1c91157">glfwMakeContextCurrent</a>.</p>
|
||||||
|
<div class="fragment"><div class="line"><a class="code hl_function" href="group__context.html#ga1c04dc242268f827290fe40aa1c91157">glfwMakeContextCurrent</a>(window);</div>
|
||||||
|
<div class="ttc" id="agroup__context_html_ga1c04dc242268f827290fe40aa1c91157"><div class="ttname"><a href="group__context.html#ga1c04dc242268f827290fe40aa1c91157">glfwMakeContextCurrent</a></div><div class="ttdeci">void glfwMakeContextCurrent(GLFWwindow *window)</div><div class="ttdoc">Makes the context of the specified window current for the calling thread.</div></div>
|
||||||
|
</div><!-- fragment --><p >The window of the current context is returned by <a class="el" href="group__context.html#gad94e80185397a6cf5fe2ab30567af71c">glfwGetCurrentContext</a>.</p>
|
||||||
|
<div class="fragment"><div class="line"><a class="code hl_typedef" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a>* window = <a class="code hl_function" href="group__context.html#gad94e80185397a6cf5fe2ab30567af71c">glfwGetCurrentContext</a>();</div>
|
||||||
|
<div class="ttc" id="agroup__context_html_gad94e80185397a6cf5fe2ab30567af71c"><div class="ttname"><a href="group__context.html#gad94e80185397a6cf5fe2ab30567af71c">glfwGetCurrentContext</a></div><div class="ttdeci">GLFWwindow * glfwGetCurrentContext(void)</div><div class="ttdoc">Returns the window whose context is current on the calling thread.</div></div>
|
||||||
|
</div><!-- fragment --><p >The following GLFW functions require a context to be current. Calling any these functions without a current context will generate a <a class="el" href="group__errors.html#gaa8290386e9528ccb9e42a3a4e16fc0d0">GLFW_NO_CURRENT_CONTEXT</a> error.</p>
|
||||||
|
<ul>
|
||||||
|
<li><a class="el" href="group__context.html#ga6d4e0cdf151b5e579bd67f13202994ed">glfwSwapInterval</a></li>
|
||||||
|
<li><a class="el" href="group__context.html#ga87425065c011cef1ebd6aac75e059dfa">glfwExtensionSupported</a></li>
|
||||||
|
<li><a class="el" href="group__context.html#ga35f1837e6f666781842483937612f163">glfwGetProcAddress</a></li>
|
||||||
|
</ul>
|
||||||
|
<h1><a class="anchor" id="context_swap"></a>
|
||||||
|
Buffer swapping</h1>
|
||||||
|
<p >See <a class="el" href="window_guide.html#buffer_swap">Buffer swapping</a> in the window guide.</p>
|
||||||
|
<h1><a class="anchor" id="context_glext"></a>
|
||||||
|
OpenGL and OpenGL ES extensions</h1>
|
||||||
|
<p >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.</p>
|
||||||
|
<p >An extension is defined by:</p>
|
||||||
|
<ul>
|
||||||
|
<li>An extension name (e.g. <code>GL_ARB_gl_spirv</code>)</li>
|
||||||
|
<li>New OpenGL tokens (e.g. <code>GL_SPIR_V_BINARY_ARB</code>)</li>
|
||||||
|
<li>New OpenGL functions (e.g. <code>glSpecializeShaderARB</code>)</li>
|
||||||
|
</ul>
|
||||||
|
<p >Note the <code>ARB</code> 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 <code>NV</code> for Nvidia and <code>AMD</code> for, well, AMD. Any group may also use the generic <code>EXT</code> affix. Lists of extensions, together with their specifications, can be found at the <a href="https://www.opengl.org/registry/">OpenGL Registry</a> and <a href="https://www.khronos.org/registry/gles/">OpenGL ES Registry</a>.</p>
|
||||||
|
<h2><a class="anchor" id="context_glext_auto"></a>
|
||||||
|
Loading extension with a loader library</h2>
|
||||||
|
<p >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 <a href="https://github.com/Dav1dde/glad">glad</a> and there are several others.</p>
|
||||||
|
<p >The following example will use glad but all extension loader libraries work similarly.</p>
|
||||||
|
<p >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 <code>output</code> directory.</p>
|
||||||
|
<div class="fragment"><div class="line">python main.py --generator c --no-loader --out-path output</div>
|
||||||
|
</div><!-- fragment --><p >The <code>--no-loader</code> 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.</p>
|
||||||
|
<p >Add the generated <code>output/src/glad.c</code>, <code>output/include/glad/glad.h</code> and <code>output/include/KHR/khrplatform.h</code> 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.</p>
|
||||||
|
<div class="fragment"><div class="line"><span class="preprocessor">#include <glad/glad.h></span></div>
|
||||||
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="glfw3_8h.html">GLFW/glfw3.h</a>></span></div>
|
||||||
|
<div class="ttc" id="aglfw3_8h_html"><div class="ttname"><a href="glfw3_8h.html">glfw3.h</a></div><div class="ttdoc">The header of the GLFW 3 API.</div></div>
|
||||||
|
</div><!-- fragment --><p >Finally you need to initialize glad once you have a suitable current context.</p>
|
||||||
|
<div class="fragment"><div class="line">window = <a class="code hl_function" href="group__window.html#ga3555a418df92ad53f917597fe2f64aeb">glfwCreateWindow</a>(640, 480, <span class="stringliteral">"My Window"</span>, NULL, NULL);</div>
|
||||||
|
<div class="line"><span class="keywordflow">if</span> (!window)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> ...</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"> </div>
|
||||||
|
<div class="line"><a class="code hl_function" href="group__context.html#ga1c04dc242268f827290fe40aa1c91157">glfwMakeContextCurrent</a>(window);</div>
|
||||||
|
<div class="line"> </div>
|
||||||
|
<div class="line">gladLoadGLLoader((GLADloadproc) <a class="code hl_function" href="group__context.html#ga35f1837e6f666781842483937612f163">glfwGetProcAddress</a>);</div>
|
||||||
|
<div class="ttc" id="agroup__context_html_ga35f1837e6f666781842483937612f163"><div class="ttname"><a href="group__context.html#ga35f1837e6f666781842483937612f163">glfwGetProcAddress</a></div><div class="ttdeci">GLFWglproc glfwGetProcAddress(const char *procname)</div><div class="ttdoc">Returns the address of the specified function for the current context.</div></div>
|
||||||
|
</div><!-- fragment --><p >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 and you are ready to start rendering.</p>
|
||||||
|
<p >You can specify a minimum required OpenGL or OpenGL ES version with <a class="el" href="window_guide.html#window_hints_ctx">context hints</a>. If your needs are more complex, you can check the actual OpenGL or OpenGL ES version with <a class="el" href="window_guide.html#window_attribs_ctx">context attributes</a>, or you can check whether a specific version is supported by the current context with the <code>GLAD_GL_VERSION_x_x</code> booleans.</p>
|
||||||
|
<div class="fragment"><div class="line"><span class="keywordflow">if</span> (GLAD_GL_VERSION_3_2)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> <span class="comment">// Call OpenGL 3.2+ specific code</span></div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
</div><!-- fragment --><p >To check whether a specific extension is supported, use the <code>GLAD_GL_xxx</code> booleans.</p>
|
||||||
|
<div class="fragment"><div class="line"><span class="keywordflow">if</span> (GLAD_GL_ARB_gl_spirv)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> <span class="comment">// Use GL_ARB_gl_spirv</span></div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
</div><!-- fragment --><h2><a class="anchor" id="context_glext_manual"></a>
|
||||||
|
Loading extensions manually</h2>
|
||||||
|
<p ><b>Do not use this technique</b> unless it is absolutely necessary. An <a class="el" href="context_guide.html#context_glext_auto">extension loader library</a> will save you a ton of tedious, repetitive, error prone work.</p>
|
||||||
|
<p >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 <a class="el" href="group__context.html#ga87425065c011cef1ebd6aac75e059dfa">glfwExtensionSupported</a> and <a class="el" href="group__context.html#ga35f1837e6f666781842483937612f163">glfwGetProcAddress</a> for manual loading of extensions and new API functions.</p>
|
||||||
|
<p >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.</p>
|
||||||
|
<h3><a class="anchor" id="context_glext_header"></a>
|
||||||
|
The glext.h header</h3>
|
||||||
|
<p >The <code>glext.h</code> 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 <a href="https://www.opengl.org/registry/">OpenGL Registry</a>. There are also extension headers for the various versions of OpenGL ES at the <a href="https://www.khronos.org/registry/gles/">OpenGL ES Registry</a>. 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.</p>
|
||||||
|
<p >The header defines function pointer types for all functions of all extensions it supports. These have names like <code>PFNGLSPECIALIZESHADERARBPROC</code> (for <code>glSpecializeShaderARB</code>), i.e. the name is made uppercase and <code>PFN</code> (pointer to function) and <code>PROC</code> (procedure) are added to the ends.</p>
|
||||||
|
<p >To include the extension header, define <a class="el" href="build_guide.html#GLFW_INCLUDE_GLEXT">GLFW_INCLUDE_GLEXT</a> before including the GLFW header.</p>
|
||||||
|
<div class="fragment"><div class="line"><span class="preprocessor">#define GLFW_INCLUDE_GLEXT</span></div>
|
||||||
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="glfw3_8h.html">GLFW/glfw3.h</a>></span></div>
|
||||||
|
</div><!-- fragment --><h3><a class="anchor" id="context_glext_string"></a>
|
||||||
|
Checking for extensions</h3>
|
||||||
|
<p >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 <a class="el" href="group__context.html#ga87425065c011cef1ebd6aac75e059dfa">glfwExtensionSupported</a>.</p>
|
||||||
|
<div class="fragment"><div class="line"><span class="keywordflow">if</span> (<a class="code hl_function" href="group__context.html#ga87425065c011cef1ebd6aac75e059dfa">glfwExtensionSupported</a>(<span class="stringliteral">"GL_ARB_gl_spirv"</span>))</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> <span class="comment">// The extension is supported by the current context</span></div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="ttc" id="agroup__context_html_ga87425065c011cef1ebd6aac75e059dfa"><div class="ttname"><a href="group__context.html#ga87425065c011cef1ebd6aac75e059dfa">glfwExtensionSupported</a></div><div class="ttdeci">int glfwExtensionSupported(const char *extension)</div><div class="ttdoc">Returns whether the specified extension is available.</div></div>
|
||||||
|
</div><!-- fragment --><p >The argument is a null terminated ASCII string with the extension name. If the extension is supported, <a class="el" href="group__context.html#ga87425065c011cef1ebd6aac75e059dfa">glfwExtensionSupported</a> returns <code>GLFW_TRUE</code>, otherwise it returns <code>GLFW_FALSE</code>.</p>
|
||||||
|
<h3><a class="anchor" id="context_glext_proc"></a>
|
||||||
|
Fetching function pointers</h3>
|
||||||
|
<p >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 <a class="el" href="group__context.html#ga35f1837e6f666781842483937612f163">glfwGetProcAddress</a>.</p>
|
||||||
|
<div class="fragment"><div class="line">PFNGLSPECIALIZESHADERARBPROC pfnSpecializeShaderARB = <a class="code hl_function" href="group__context.html#ga35f1837e6f666781842483937612f163">glfwGetProcAddress</a>(<span class="stringliteral">"glSpecializeShaderARB"</span>);</div>
|
||||||
|
</div><!-- fragment --><p >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.</p>
|
||||||
|
<p >Now that all the pieces have been introduced, here is what they might look like when used together.</p>
|
||||||
|
<div class="fragment"><div class="line"><span class="preprocessor">#define GLFW_INCLUDE_GLEXT</span></div>
|
||||||
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="glfw3_8h.html">GLFW/glfw3.h</a>></span></div>
|
||||||
|
<div class="line"> </div>
|
||||||
|
<div class="line"><span class="preprocessor">#define glSpecializeShaderARB pfnSpecializeShaderARB</span></div>
|
||||||
|
<div class="line">PFNGLSPECIALIZESHADERARBPROC pfnSpecializeShaderARB;</div>
|
||||||
|
<div class="line"> </div>
|
||||||
|
<div class="line"><span class="comment">// Flag indicating whether the extension is supported</span></div>
|
||||||
|
<div class="line"><span class="keywordtype">int</span> has_ARB_gl_spirv = 0;</div>
|
||||||
|
<div class="line"> </div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> load_extensions(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> <span class="keywordflow">if</span> (<a class="code hl_function" href="group__context.html#ga87425065c011cef1ebd6aac75e059dfa">glfwExtensionSupported</a>(<span class="stringliteral">"GL_ARB_gl_spirv"</span>))</div>
|
||||||
|
<div class="line"> {</div>
|
||||||
|
<div class="line"> pfnSpecializeShaderARB = (PFNGLSPECIALIZESHADERARBPROC)</div>
|
||||||
|
<div class="line"> <a class="code hl_function" href="group__context.html#ga35f1837e6f666781842483937612f163">glfwGetProcAddress</a>(<span class="stringliteral">"glSpecializeShaderARB"</span>);</div>
|
||||||
|
<div class="line"> has_ARB_gl_spirv = 1;</div>
|
||||||
|
<div class="line"> }</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="line"> </div>
|
||||||
|
<div class="line"><span class="keywordtype">void</span> some_function(<span class="keywordtype">void</span>)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> <span class="keywordflow">if</span> (has_ARB_gl_spirv)</div>
|
||||||
|
<div class="line"> {</div>
|
||||||
|
<div class="line"> <span class="comment">// Now the extension function can be called as usual</span></div>
|
||||||
|
<div class="line"> glSpecializeShaderARB(...);</div>
|
||||||
|
<div class="line"> }</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
</div><!-- fragment --> </div></div><!-- contents -->
|
||||||
|
</div><!-- PageDoc -->
|
||||||
|
<address class="footer">
|
||||||
|
<p>
|
||||||
|
Last update on Fri Jul 22 2022 for GLFW 3.3.8
|
||||||
|
</p>
|
||||||
|
</address>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,81 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.9.4"/>
|
||||||
|
<title>GLFW: Deprecated List</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="extra.css" rel="stylesheet" type="text/css"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<div class="glfwheader">
|
||||||
|
<a href="https://www.glfw.org/" id="glfwhome">GLFW</a>
|
||||||
|
<ul class="glfwnavbar">
|
||||||
|
<li><a href="https://www.glfw.org/documentation.html">Documentation</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/download.html">Download</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/community.html">Community</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.9.4 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src="menudata.js"></script>
|
||||||
|
<script type="text/javascript" src="menu.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
$(function() {
|
||||||
|
initMenu('',true,false,'search.php','Search');
|
||||||
|
$(document).ready(function() { init_search(); });
|
||||||
|
});
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<div id="main-nav"></div>
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div><!-- top -->
|
||||||
|
<div><div class="header">
|
||||||
|
<div class="headertitle"><div class="title">Deprecated List </div></div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<div class="textblock"><dl class="reflist">
|
||||||
|
<dt>Global <a class="el" href="group__input.html#gac3cf64f90b6219c05ac7b7822d5a4b8f">GLFWcharmodsfun</a> )(GLFWwindow *window, unsigned int codepoint, int mods)</dt>
|
||||||
|
<dd><a class="anchor" id="_deprecated000001"></a>Scheduled for removal in version 4.0. </dd>
|
||||||
|
<dt>Global <a class="el" href="group__input.html#ga0b7f4ad13c2b17435ff13b6dcfb4e43c">glfwSetCharModsCallback</a> (GLFWwindow *window, GLFWcharmodsfun callback)</dt>
|
||||||
|
<dd><a class="anchor" id="_deprecated000002"></a>Scheduled for removal in version 4.0.</dd>
|
||||||
|
</dl>
|
||||||
|
</div></div><!-- contents -->
|
||||||
|
</div><!-- PageDoc -->
|
||||||
|
<address class="footer">
|
||||||
|
<p>
|
||||||
|
Last update on Fri Jul 22 2022 for GLFW 3.3.8
|
||||||
|
</p>
|
||||||
|
</address>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,88 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.9.4"/>
|
||||||
|
<title>GLFW: GLFW Directory Reference</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="extra.css" rel="stylesheet" type="text/css"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<div class="glfwheader">
|
||||||
|
<a href="https://www.glfw.org/" id="glfwhome">GLFW</a>
|
||||||
|
<ul class="glfwnavbar">
|
||||||
|
<li><a href="https://www.glfw.org/documentation.html">Documentation</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/download.html">Download</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/community.html">Community</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.9.4 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src="menudata.js"></script>
|
||||||
|
<script type="text/javascript" src="menu.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
$(function() {
|
||||||
|
initMenu('',true,false,'search.php','Search');
|
||||||
|
$(document).ready(function() { init_search(); });
|
||||||
|
});
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<div id="main-nav"></div>
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="nav-path" class="navpath">
|
||||||
|
<ul>
|
||||||
|
<li class="navelem"><a class="el" href="dir_4351554941a2744586042c1cf3cf139a.html">glfw-3.3.8</a></li><li class="navelem"><a class="el" href="dir_f6ba4c3dca55a8d4e7d63c8235e0ad43.html">include</a></li><li class="navelem"><a class="el" href="dir_1dfd43b3952c5bc1ba15d15b12afff7b.html">GLFW</a></li> </ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle"><div class="title">GLFW Directory Reference</div></div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<table class="memberdecls">
|
||||||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="files" name="files"></a>
|
||||||
|
Files</h2></td></tr>
|
||||||
|
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><a class="el" href="glfw3_8h.html">glfw3.h</a> <a href="glfw3_8h_source.html">[code]</a></td></tr>
|
||||||
|
<tr class="memdesc:glfw3_8h"><td class="mdescLeft"> </td><td class="mdescRight">The header of the GLFW 3 API. <br /></td></tr>
|
||||||
|
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><a class="el" href="glfw3native_8h.html">glfw3native.h</a> <a href="glfw3native_8h_source.html">[code]</a></td></tr>
|
||||||
|
<tr class="memdesc:glfw3native_8h"><td class="mdescLeft"> </td><td class="mdescRight">The header of the native access functions. <br /></td></tr>
|
||||||
|
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
</table>
|
||||||
|
</div><!-- contents -->
|
||||||
|
<address class="footer">
|
||||||
|
<p>
|
||||||
|
Last update on Fri Jul 22 2022 for GLFW 3.3.8
|
||||||
|
</p>
|
||||||
|
</address>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,86 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.9.4"/>
|
||||||
|
<title>GLFW: glfw-3.3.8 Directory Reference</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="extra.css" rel="stylesheet" type="text/css"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<div class="glfwheader">
|
||||||
|
<a href="https://www.glfw.org/" id="glfwhome">GLFW</a>
|
||||||
|
<ul class="glfwnavbar">
|
||||||
|
<li><a href="https://www.glfw.org/documentation.html">Documentation</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/download.html">Download</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/community.html">Community</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.9.4 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src="menudata.js"></script>
|
||||||
|
<script type="text/javascript" src="menu.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
$(function() {
|
||||||
|
initMenu('',true,false,'search.php','Search');
|
||||||
|
$(document).ready(function() { init_search(); });
|
||||||
|
});
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<div id="main-nav"></div>
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="nav-path" class="navpath">
|
||||||
|
<ul>
|
||||||
|
<li class="navelem"><a class="el" href="dir_4351554941a2744586042c1cf3cf139a.html">glfw-3.3.8</a></li> </ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle"><div class="title">glfw-3.3.8 Directory Reference</div></div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<table class="memberdecls">
|
||||||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="subdirs" name="subdirs"></a>
|
||||||
|
Directories</h2></td></tr>
|
||||||
|
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">directory  </td><td class="memItemRight" valign="bottom"><a class="el" href="dir_fda32cf7bec00275262cb8799a618f76.html">docs</a></td></tr>
|
||||||
|
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">directory  </td><td class="memItemRight" valign="bottom"><a class="el" href="dir_f6ba4c3dca55a8d4e7d63c8235e0ad43.html">include</a></td></tr>
|
||||||
|
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
</table>
|
||||||
|
</div><!-- contents -->
|
||||||
|
<address class="footer">
|
||||||
|
<p>
|
||||||
|
Last update on Fri Jul 22 2022 for GLFW 3.3.8
|
||||||
|
</p>
|
||||||
|
</address>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,84 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.9.4"/>
|
||||||
|
<title>GLFW: include Directory Reference</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="extra.css" rel="stylesheet" type="text/css"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<div class="glfwheader">
|
||||||
|
<a href="https://www.glfw.org/" id="glfwhome">GLFW</a>
|
||||||
|
<ul class="glfwnavbar">
|
||||||
|
<li><a href="https://www.glfw.org/documentation.html">Documentation</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/download.html">Download</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/community.html">Community</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.9.4 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src="menudata.js"></script>
|
||||||
|
<script type="text/javascript" src="menu.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
$(function() {
|
||||||
|
initMenu('',true,false,'search.php','Search');
|
||||||
|
$(document).ready(function() { init_search(); });
|
||||||
|
});
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<div id="main-nav"></div>
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="nav-path" class="navpath">
|
||||||
|
<ul>
|
||||||
|
<li class="navelem"><a class="el" href="dir_4351554941a2744586042c1cf3cf139a.html">glfw-3.3.8</a></li><li class="navelem"><a class="el" href="dir_f6ba4c3dca55a8d4e7d63c8235e0ad43.html">include</a></li> </ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle"><div class="title">include Directory Reference</div></div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<table class="memberdecls">
|
||||||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="subdirs" name="subdirs"></a>
|
||||||
|
Directories</h2></td></tr>
|
||||||
|
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">directory  </td><td class="memItemRight" valign="bottom"><a class="el" href="dir_1dfd43b3952c5bc1ba15d15b12afff7b.html">GLFW</a></td></tr>
|
||||||
|
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
</table>
|
||||||
|
</div><!-- contents -->
|
||||||
|
<address class="footer">
|
||||||
|
<p>
|
||||||
|
Last update on Fri Jul 22 2022 for GLFW 3.3.8
|
||||||
|
</p>
|
||||||
|
</address>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,78 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.9.4"/>
|
||||||
|
<title>GLFW: docs Directory Reference</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="extra.css" rel="stylesheet" type="text/css"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<div class="glfwheader">
|
||||||
|
<a href="https://www.glfw.org/" id="glfwhome">GLFW</a>
|
||||||
|
<ul class="glfwnavbar">
|
||||||
|
<li><a href="https://www.glfw.org/documentation.html">Documentation</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/download.html">Download</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/community.html">Community</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.9.4 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src="menudata.js"></script>
|
||||||
|
<script type="text/javascript" src="menu.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
$(function() {
|
||||||
|
initMenu('',true,false,'search.php','Search');
|
||||||
|
$(document).ready(function() { init_search(); });
|
||||||
|
});
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<div id="main-nav"></div>
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="nav-path" class="navpath">
|
||||||
|
<ul>
|
||||||
|
<li class="navelem"><a class="el" href="dir_4351554941a2744586042c1cf3cf139a.html">glfw-3.3.8</a></li><li class="navelem"><a class="el" href="dir_fda32cf7bec00275262cb8799a618f76.html">docs</a></li> </ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle"><div class="title">docs Directory Reference</div></div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
</div><!-- contents -->
|
||||||
|
<address class="footer">
|
||||||
|
<p>
|
||||||
|
Last update on Fri Jul 22 2022 for GLFW 3.3.8
|
||||||
|
</p>
|
||||||
|
</address>
|
||||||
|
</body>
|
||||||
|
</html>
|
After Width: | Height: | Size: 746 B |
After Width: | Height: | Size: 15 KiB |
|
@ -0,0 +1,121 @@
|
||||||
|
/*
|
||||||
|
@licstart The following is the entire license notice for the JavaScript code in this file.
|
||||||
|
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (C) 1997-2020 by Dimitri van Heesch
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
@licend The above is the entire license notice for the JavaScript code in this file
|
||||||
|
*/
|
||||||
|
function toggleVisibility(linkObj)
|
||||||
|
{
|
||||||
|
var base = $(linkObj).attr('id');
|
||||||
|
var summary = $('#'+base+'-summary');
|
||||||
|
var content = $('#'+base+'-content');
|
||||||
|
var trigger = $('#'+base+'-trigger');
|
||||||
|
var src=$(trigger).attr('src');
|
||||||
|
if (content.is(':visible')===true) {
|
||||||
|
content.hide();
|
||||||
|
summary.show();
|
||||||
|
$(linkObj).addClass('closed').removeClass('opened');
|
||||||
|
$(trigger).attr('src',src.substring(0,src.length-8)+'closed.png');
|
||||||
|
} else {
|
||||||
|
content.show();
|
||||||
|
summary.hide();
|
||||||
|
$(linkObj).removeClass('closed').addClass('opened');
|
||||||
|
$(trigger).attr('src',src.substring(0,src.length-10)+'open.png');
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateStripes()
|
||||||
|
{
|
||||||
|
$('table.directory tr').
|
||||||
|
removeClass('even').filter(':visible:even').addClass('even');
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleLevel(level)
|
||||||
|
{
|
||||||
|
$('table.directory tr').each(function() {
|
||||||
|
var l = this.id.split('_').length-1;
|
||||||
|
var i = $('#img'+this.id.substring(3));
|
||||||
|
var a = $('#arr'+this.id.substring(3));
|
||||||
|
if (l<level+1) {
|
||||||
|
i.removeClass('iconfopen iconfclosed').addClass('iconfopen');
|
||||||
|
a.html('▼');
|
||||||
|
$(this).show();
|
||||||
|
} else if (l==level+1) {
|
||||||
|
i.removeClass('iconfclosed iconfopen').addClass('iconfclosed');
|
||||||
|
a.html('►');
|
||||||
|
$(this).show();
|
||||||
|
} else {
|
||||||
|
$(this).hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
updateStripes();
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleFolder(id)
|
||||||
|
{
|
||||||
|
// the clicked row
|
||||||
|
var currentRow = $('#row_'+id);
|
||||||
|
|
||||||
|
// all rows after the clicked row
|
||||||
|
var rows = currentRow.nextAll("tr");
|
||||||
|
|
||||||
|
var re = new RegExp('^row_'+id+'\\d+_$', "i"); //only one sub
|
||||||
|
|
||||||
|
// only match elements AFTER this one (can't hide elements before)
|
||||||
|
var childRows = rows.filter(function() { return this.id.match(re); });
|
||||||
|
|
||||||
|
// first row is visible we are HIDING
|
||||||
|
if (childRows.filter(':first').is(':visible')===true) {
|
||||||
|
// replace down arrow by right arrow for current row
|
||||||
|
var currentRowSpans = currentRow.find("span");
|
||||||
|
currentRowSpans.filter(".iconfopen").removeClass("iconfopen").addClass("iconfclosed");
|
||||||
|
currentRowSpans.filter(".arrow").html('►');
|
||||||
|
rows.filter("[id^=row_"+id+"]").hide(); // hide all children
|
||||||
|
} else { // we are SHOWING
|
||||||
|
// replace right arrow by down arrow for current row
|
||||||
|
var currentRowSpans = currentRow.find("span");
|
||||||
|
currentRowSpans.filter(".iconfclosed").removeClass("iconfclosed").addClass("iconfopen");
|
||||||
|
currentRowSpans.filter(".arrow").html('▼');
|
||||||
|
// replace down arrows by right arrows for child rows
|
||||||
|
var childRowsSpans = childRows.find("span");
|
||||||
|
childRowsSpans.filter(".iconfopen").removeClass("iconfopen").addClass("iconfclosed");
|
||||||
|
childRowsSpans.filter(".arrow").html('►');
|
||||||
|
childRows.show(); //show all children
|
||||||
|
}
|
||||||
|
updateStripes();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function toggleInherit(id)
|
||||||
|
{
|
||||||
|
var rows = $('tr.inherit.'+id);
|
||||||
|
var img = $('tr.inherit_header.'+id+' img');
|
||||||
|
var src = $(img).attr('src');
|
||||||
|
if (rows.filter(':first').is(':visible')===true) {
|
||||||
|
rows.css('display','none');
|
||||||
|
$(img).attr('src',src.substring(0,src.length-8)+'closed.png');
|
||||||
|
} else {
|
||||||
|
rows.css('display','table-row'); // using show() causes jump in firefox
|
||||||
|
$(img).attr('src',src.substring(0,src.length-10)+'open.png');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* @license-end */
|
|
@ -0,0 +1,84 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.9.4"/>
|
||||||
|
<title>GLFW: Files</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="extra.css" rel="stylesheet" type="text/css"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<div class="glfwheader">
|
||||||
|
<a href="https://www.glfw.org/" id="glfwhome">GLFW</a>
|
||||||
|
<ul class="glfwnavbar">
|
||||||
|
<li><a href="https://www.glfw.org/documentation.html">Documentation</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/download.html">Download</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/community.html">Community</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.9.4 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src="menudata.js"></script>
|
||||||
|
<script type="text/javascript" src="menu.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
$(function() {
|
||||||
|
initMenu('',true,false,'search.php','Search');
|
||||||
|
$(document).ready(function() { init_search(); });
|
||||||
|
});
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<div id="main-nav"></div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle"><div class="title">Files</div></div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<div class="textblock">Here is a list of all files with brief descriptions:</div><div class="directory">
|
||||||
|
<div class="levels">[detail level <span onclick="javascript:toggleLevel(1);">1</span><span onclick="javascript:toggleLevel(2);">2</span><span onclick="javascript:toggleLevel(3);">3</span><span onclick="javascript:toggleLevel(4);">4</span>]</div><table class="directory">
|
||||||
|
<tr id="row_0_" class="even"><td class="entry"><span style="width:0px;display:inline-block;"> </span><span id="arr_0_" class="arrow" onclick="toggleFolder('0_')">▼</span><span id="img_0_" class="iconfopen" onclick="toggleFolder('0_')"> </span><a class="el" href="dir_4351554941a2744586042c1cf3cf139a.html" target="_self">glfw-3.3.8</a></td><td class="desc"></td></tr>
|
||||||
|
<tr id="row_0_0_"><td class="entry"><span style="width:32px;display:inline-block;"> </span><span class="iconfclosed"></span><a class="el" href="dir_fda32cf7bec00275262cb8799a618f76.html" target="_self">docs</a></td><td class="desc"></td></tr>
|
||||||
|
<tr id="row_0_1_" class="even"><td class="entry"><span style="width:16px;display:inline-block;"> </span><span id="arr_0_1_" class="arrow" onclick="toggleFolder('0_1_')">▼</span><span id="img_0_1_" class="iconfopen" onclick="toggleFolder('0_1_')"> </span><a class="el" href="dir_f6ba4c3dca55a8d4e7d63c8235e0ad43.html" target="_self">include</a></td><td class="desc"></td></tr>
|
||||||
|
<tr id="row_0_1_0_"><td class="entry"><span style="width:32px;display:inline-block;"> </span><span id="arr_0_1_0_" class="arrow" onclick="toggleFolder('0_1_0_')">▼</span><span id="img_0_1_0_" class="iconfopen" onclick="toggleFolder('0_1_0_')"> </span><a class="el" href="dir_1dfd43b3952c5bc1ba15d15b12afff7b.html" target="_self">GLFW</a></td><td class="desc"></td></tr>
|
||||||
|
<tr id="row_0_1_0_0_" class="even"><td class="entry"><span style="width:64px;display:inline-block;"> </span><a href="glfw3_8h_source.html"><span class="icondoc"></span></a><a class="el" href="glfw3_8h.html" target="_self">glfw3.h</a></td><td class="desc">The header of the GLFW 3 API </td></tr>
|
||||||
|
<tr id="row_0_1_0_1_"><td class="entry"><span style="width:64px;display:inline-block;"> </span><a href="glfw3native_8h_source.html"><span class="icondoc"></span></a><a class="el" href="glfw3native_8h.html" target="_self">glfw3native.h</a></td><td class="desc">The header of the native access functions </td></tr>
|
||||||
|
</table>
|
||||||
|
</div><!-- directory -->
|
||||||
|
</div><!-- contents -->
|
||||||
|
<address class="footer">
|
||||||
|
<p>
|
||||||
|
Last update on Fri Jul 22 2022 for GLFW 3.3.8
|
||||||
|
</p>
|
||||||
|
</address>
|
||||||
|
</body>
|
||||||
|
</html>
|
After Width: | Height: | Size: 616 B |
After Width: | Height: | Size: 597 B |
|
@ -0,0 +1,160 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.9.4"/>
|
||||||
|
<title>GLFW: glfw3native.h File Reference</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="extra.css" rel="stylesheet" type="text/css"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<div class="glfwheader">
|
||||||
|
<a href="https://www.glfw.org/" id="glfwhome">GLFW</a>
|
||||||
|
<ul class="glfwnavbar">
|
||||||
|
<li><a href="https://www.glfw.org/documentation.html">Documentation</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/download.html">Download</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/community.html">Community</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.9.4 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src="menudata.js"></script>
|
||||||
|
<script type="text/javascript" src="menu.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
$(function() {
|
||||||
|
initMenu('',true,false,'search.php','Search');
|
||||||
|
$(document).ready(function() { init_search(); });
|
||||||
|
});
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<div id="main-nav"></div>
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="nav-path" class="navpath">
|
||||||
|
<ul>
|
||||||
|
<li class="navelem"><a class="el" href="dir_4351554941a2744586042c1cf3cf139a.html">glfw-3.3.8</a></li><li class="navelem"><a class="el" href="dir_f6ba4c3dca55a8d4e7d63c8235e0ad43.html">include</a></li><li class="navelem"><a class="el" href="dir_1dfd43b3952c5bc1ba15d15b12afff7b.html">GLFW</a></li> </ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div class="header">
|
||||||
|
<div class="summary">
|
||||||
|
<a href="#func-members">Functions</a> </div>
|
||||||
|
<div class="headertitle"><div class="title">glfw3native.h File Reference</div></div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<a name="details" id="details"></a><h2 class="groupheader">Description</h2>
|
||||||
|
<div class="textblock"><p >This is the header file of the native access functions. See <a class="el" href="group__native.html">Native access</a> for more information. </p>
|
||||||
|
</div>
|
||||||
|
<p><a href="glfw3native_8h_source.html">Go to the source code of this file.</a></p>
|
||||||
|
<table class="memberdecls">
|
||||||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
|
||||||
|
Functions</h2></td></tr>
|
||||||
|
<tr class="memitem:gad4d3e9242536c0ba6be88a98f4c73a41"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#gad4d3e9242536c0ba6be88a98f4c73a41">glfwGetWin32Adapter</a> (<a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> *monitor)</td></tr>
|
||||||
|
<tr class="memdesc:gad4d3e9242536c0ba6be88a98f4c73a41"><td class="mdescLeft"> </td><td class="mdescRight">Returns the adapter device name of the specified monitor. <a href="group__native.html#gad4d3e9242536c0ba6be88a98f4c73a41">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:gad4d3e9242536c0ba6be88a98f4c73a41"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gac845f7dbe4c1d7fdd682a3c6fdae6766"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#gac845f7dbe4c1d7fdd682a3c6fdae6766">glfwGetWin32Monitor</a> (<a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> *monitor)</td></tr>
|
||||||
|
<tr class="memdesc:gac845f7dbe4c1d7fdd682a3c6fdae6766"><td class="mdescLeft"> </td><td class="mdescRight">Returns the display device name of the specified monitor. <a href="group__native.html#gac845f7dbe4c1d7fdd682a3c6fdae6766">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:gac845f7dbe4c1d7fdd682a3c6fdae6766"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gafe5079aa79038b0079fc09d5f0a8e667"><td class="memItemLeft" align="right" valign="top">HWND </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#gafe5079aa79038b0079fc09d5f0a8e667">glfwGetWin32Window</a> (<a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> *window)</td></tr>
|
||||||
|
<tr class="memdesc:gafe5079aa79038b0079fc09d5f0a8e667"><td class="mdescLeft"> </td><td class="mdescRight">Returns the <code>HWND</code> of the specified window. <a href="group__native.html#gafe5079aa79038b0079fc09d5f0a8e667">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:gafe5079aa79038b0079fc09d5f0a8e667"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gadc4010d91d9cc1134d040eeb1202a143"><td class="memItemLeft" align="right" valign="top">HGLRC </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#gadc4010d91d9cc1134d040eeb1202a143">glfwGetWGLContext</a> (<a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> *window)</td></tr>
|
||||||
|
<tr class="memdesc:gadc4010d91d9cc1134d040eeb1202a143"><td class="mdescLeft"> </td><td class="mdescRight">Returns the <code>HGLRC</code> of the specified window. <a href="group__native.html#gadc4010d91d9cc1134d040eeb1202a143">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:gadc4010d91d9cc1134d040eeb1202a143"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gaf22f429aec4b1aab316142d66d9be3e6"><td class="memItemLeft" align="right" valign="top">CGDirectDisplayID </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#gaf22f429aec4b1aab316142d66d9be3e6">glfwGetCocoaMonitor</a> (<a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> *monitor)</td></tr>
|
||||||
|
<tr class="memdesc:gaf22f429aec4b1aab316142d66d9be3e6"><td class="mdescLeft"> </td><td class="mdescRight">Returns the <code>CGDirectDisplayID</code> of the specified monitor. <a href="group__native.html#gaf22f429aec4b1aab316142d66d9be3e6">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:gaf22f429aec4b1aab316142d66d9be3e6"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gac3ed9d495d0c2bb9652de5a50c648715"><td class="memItemLeft" align="right" valign="top">id </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#gac3ed9d495d0c2bb9652de5a50c648715">glfwGetCocoaWindow</a> (<a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> *window)</td></tr>
|
||||||
|
<tr class="memdesc:gac3ed9d495d0c2bb9652de5a50c648715"><td class="mdescLeft"> </td><td class="mdescRight">Returns the <code>NSWindow</code> of the specified window. <a href="group__native.html#gac3ed9d495d0c2bb9652de5a50c648715">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:gac3ed9d495d0c2bb9652de5a50c648715"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga559e002e3cd63c979881770cd4dc63bc"><td class="memItemLeft" align="right" valign="top">id </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#ga559e002e3cd63c979881770cd4dc63bc">glfwGetNSGLContext</a> (<a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> *window)</td></tr>
|
||||||
|
<tr class="memdesc:ga559e002e3cd63c979881770cd4dc63bc"><td class="mdescLeft"> </td><td class="mdescRight">Returns the <code>NSOpenGLContext</code> of the specified window. <a href="group__native.html#ga559e002e3cd63c979881770cd4dc63bc">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga559e002e3cd63c979881770cd4dc63bc"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga6e7822385cc8a1cc3b18f60352830189"><td class="memItemLeft" align="right" valign="top">Display * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#ga6e7822385cc8a1cc3b18f60352830189">glfwGetX11Display</a> (void)</td></tr>
|
||||||
|
<tr class="memdesc:ga6e7822385cc8a1cc3b18f60352830189"><td class="mdescLeft"> </td><td class="mdescRight">Returns the <code>Display</code> used by GLFW. <a href="group__native.html#ga6e7822385cc8a1cc3b18f60352830189">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga6e7822385cc8a1cc3b18f60352830189"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga088fbfa80f50569402b41be71ad66e40"><td class="memItemLeft" align="right" valign="top">RRCrtc </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#ga088fbfa80f50569402b41be71ad66e40">glfwGetX11Adapter</a> (<a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> *monitor)</td></tr>
|
||||||
|
<tr class="memdesc:ga088fbfa80f50569402b41be71ad66e40"><td class="mdescLeft"> </td><td class="mdescRight">Returns the <code>RRCrtc</code> of the specified monitor. <a href="group__native.html#ga088fbfa80f50569402b41be71ad66e40">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga088fbfa80f50569402b41be71ad66e40"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gab2f8cc043905e9fa9b12bfdbbcfe874c"><td class="memItemLeft" align="right" valign="top">RROutput </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#gab2f8cc043905e9fa9b12bfdbbcfe874c">glfwGetX11Monitor</a> (<a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> *monitor)</td></tr>
|
||||||
|
<tr class="memdesc:gab2f8cc043905e9fa9b12bfdbbcfe874c"><td class="mdescLeft"> </td><td class="mdescRight">Returns the <code>RROutput</code> of the specified monitor. <a href="group__native.html#gab2f8cc043905e9fa9b12bfdbbcfe874c">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:gab2f8cc043905e9fa9b12bfdbbcfe874c"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga90ca676322740842db446999a1b1f21d"><td class="memItemLeft" align="right" valign="top">Window </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#ga90ca676322740842db446999a1b1f21d">glfwGetX11Window</a> (<a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> *window)</td></tr>
|
||||||
|
<tr class="memdesc:ga90ca676322740842db446999a1b1f21d"><td class="mdescLeft"> </td><td class="mdescRight">Returns the <code>Window</code> of the specified window. <a href="group__native.html#ga90ca676322740842db446999a1b1f21d">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga90ca676322740842db446999a1b1f21d"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga55f879ab02d93367f966186b6f0133f7"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#ga55f879ab02d93367f966186b6f0133f7">glfwSetX11SelectionString</a> (const char *string)</td></tr>
|
||||||
|
<tr class="memdesc:ga55f879ab02d93367f966186b6f0133f7"><td class="mdescLeft"> </td><td class="mdescRight">Sets the current primary selection to the specified string. <a href="group__native.html#ga55f879ab02d93367f966186b6f0133f7">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga55f879ab02d93367f966186b6f0133f7"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gae084ef64dc0db140b455b1427256d3f7"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#gae084ef64dc0db140b455b1427256d3f7">glfwGetX11SelectionString</a> (void)</td></tr>
|
||||||
|
<tr class="memdesc:gae084ef64dc0db140b455b1427256d3f7"><td class="mdescLeft"> </td><td class="mdescRight">Returns the contents of the current primary selection as a string. <a href="group__native.html#gae084ef64dc0db140b455b1427256d3f7">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:gae084ef64dc0db140b455b1427256d3f7"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga62d884114b0abfcdc2930e89f20867e2"><td class="memItemLeft" align="right" valign="top">GLXContext </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#ga62d884114b0abfcdc2930e89f20867e2">glfwGetGLXContext</a> (<a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> *window)</td></tr>
|
||||||
|
<tr class="memdesc:ga62d884114b0abfcdc2930e89f20867e2"><td class="mdescLeft"> </td><td class="mdescRight">Returns the <code>GLXContext</code> of the specified window. <a href="group__native.html#ga62d884114b0abfcdc2930e89f20867e2">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga62d884114b0abfcdc2930e89f20867e2"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga1ed27b8766e859a21381e8f8ce18d049"><td class="memItemLeft" align="right" valign="top">GLXWindow </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#ga1ed27b8766e859a21381e8f8ce18d049">glfwGetGLXWindow</a> (<a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> *window)</td></tr>
|
||||||
|
<tr class="memdesc:ga1ed27b8766e859a21381e8f8ce18d049"><td class="mdescLeft"> </td><td class="mdescRight">Returns the <code>GLXWindow</code> of the specified window. <a href="group__native.html#ga1ed27b8766e859a21381e8f8ce18d049">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga1ed27b8766e859a21381e8f8ce18d049"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gacbe11f93ce20621de82989bbba94e62a"><td class="memItemLeft" align="right" valign="top">struct wl_display * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#gacbe11f93ce20621de82989bbba94e62a">glfwGetWaylandDisplay</a> (void)</td></tr>
|
||||||
|
<tr class="memdesc:gacbe11f93ce20621de82989bbba94e62a"><td class="mdescLeft"> </td><td class="mdescRight">Returns the <code>struct wl_display*</code> used by GLFW. <a href="group__native.html#gacbe11f93ce20621de82989bbba94e62a">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:gacbe11f93ce20621de82989bbba94e62a"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga4f16066bd4c59e2f99418adfcb43dd16"><td class="memItemLeft" align="right" valign="top">struct wl_output * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#ga4f16066bd4c59e2f99418adfcb43dd16">glfwGetWaylandMonitor</a> (<a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> *monitor)</td></tr>
|
||||||
|
<tr class="memdesc:ga4f16066bd4c59e2f99418adfcb43dd16"><td class="mdescLeft"> </td><td class="mdescRight">Returns the <code>struct wl_output*</code> of the specified monitor. <a href="group__native.html#ga4f16066bd4c59e2f99418adfcb43dd16">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga4f16066bd4c59e2f99418adfcb43dd16"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga5c597f2841229d9626f0811cca41ceb3"><td class="memItemLeft" align="right" valign="top">struct wl_surface * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#ga5c597f2841229d9626f0811cca41ceb3">glfwGetWaylandWindow</a> (<a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> *window)</td></tr>
|
||||||
|
<tr class="memdesc:ga5c597f2841229d9626f0811cca41ceb3"><td class="mdescLeft"> </td><td class="mdescRight">Returns the main <code>struct wl_surface*</code> of the specified window. <a href="group__native.html#ga5c597f2841229d9626f0811cca41ceb3">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga5c597f2841229d9626f0811cca41ceb3"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga1cd8d973f47aacb5532d368147cc3138"><td class="memItemLeft" align="right" valign="top">EGLDisplay </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#ga1cd8d973f47aacb5532d368147cc3138">glfwGetEGLDisplay</a> (void)</td></tr>
|
||||||
|
<tr class="memdesc:ga1cd8d973f47aacb5532d368147cc3138"><td class="mdescLeft"> </td><td class="mdescRight">Returns the <code>EGLDisplay</code> used by GLFW. <a href="group__native.html#ga1cd8d973f47aacb5532d368147cc3138">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga1cd8d973f47aacb5532d368147cc3138"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga671c5072becd085f4ab5771a9c8efcf1"><td class="memItemLeft" align="right" valign="top">EGLContext </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#ga671c5072becd085f4ab5771a9c8efcf1">glfwGetEGLContext</a> (<a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> *window)</td></tr>
|
||||||
|
<tr class="memdesc:ga671c5072becd085f4ab5771a9c8efcf1"><td class="mdescLeft"> </td><td class="mdescRight">Returns the <code>EGLContext</code> of the specified window. <a href="group__native.html#ga671c5072becd085f4ab5771a9c8efcf1">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga671c5072becd085f4ab5771a9c8efcf1"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga2199b36117a6a695fec8441d8052eee6"><td class="memItemLeft" align="right" valign="top">EGLSurface </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#ga2199b36117a6a695fec8441d8052eee6">glfwGetEGLSurface</a> (<a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> *window)</td></tr>
|
||||||
|
<tr class="memdesc:ga2199b36117a6a695fec8441d8052eee6"><td class="mdescLeft"> </td><td class="mdescRight">Returns the <code>EGLSurface</code> of the specified window. <a href="group__native.html#ga2199b36117a6a695fec8441d8052eee6">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga2199b36117a6a695fec8441d8052eee6"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga3b36e3e3dcf308b776427b6bd73cc132"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#ga3b36e3e3dcf308b776427b6bd73cc132">glfwGetOSMesaColorBuffer</a> (<a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> *window, int *width, int *height, int *format, void **buffer)</td></tr>
|
||||||
|
<tr class="memdesc:ga3b36e3e3dcf308b776427b6bd73cc132"><td class="mdescLeft"> </td><td class="mdescRight">Retrieves the color buffer associated with the specified window. <a href="group__native.html#ga3b36e3e3dcf308b776427b6bd73cc132">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga3b36e3e3dcf308b776427b6bd73cc132"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga6b64039ffc88a7a2f57f0956c0c75d53"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#ga6b64039ffc88a7a2f57f0956c0c75d53">glfwGetOSMesaDepthBuffer</a> (<a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> *window, int *width, int *height, int *bytesPerValue, void **buffer)</td></tr>
|
||||||
|
<tr class="memdesc:ga6b64039ffc88a7a2f57f0956c0c75d53"><td class="mdescLeft"> </td><td class="mdescRight">Retrieves the depth buffer associated with the specified window. <a href="group__native.html#ga6b64039ffc88a7a2f57f0956c0c75d53">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga6b64039ffc88a7a2f57f0956c0c75d53"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga9e47700080094eb569cb053afaa88773"><td class="memItemLeft" align="right" valign="top">OSMesaContext </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#ga9e47700080094eb569cb053afaa88773">glfwGetOSMesaContext</a> (<a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> *window)</td></tr>
|
||||||
|
<tr class="memdesc:ga9e47700080094eb569cb053afaa88773"><td class="mdescLeft"> </td><td class="mdescRight">Returns the <code>OSMesaContext</code> of the specified window. <a href="group__native.html#ga9e47700080094eb569cb053afaa88773">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga9e47700080094eb569cb053afaa88773"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
</table>
|
||||||
|
</div><!-- contents -->
|
||||||
|
<address class="footer">
|
||||||
|
<p>
|
||||||
|
Last update on Fri Jul 22 2022 for GLFW 3.3.8
|
||||||
|
</p>
|
||||||
|
</address>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,285 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.9.4"/>
|
||||||
|
<title>GLFW: glfw3native.h Source File</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="extra.css" rel="stylesheet" type="text/css"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<div class="glfwheader">
|
||||||
|
<a href="https://www.glfw.org/" id="glfwhome">GLFW</a>
|
||||||
|
<ul class="glfwnavbar">
|
||||||
|
<li><a href="https://www.glfw.org/documentation.html">Documentation</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/download.html">Download</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/community.html">Community</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.9.4 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src="menudata.js"></script>
|
||||||
|
<script type="text/javascript" src="menu.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
$(function() {
|
||||||
|
initMenu('',true,false,'search.php','Search');
|
||||||
|
$(document).ready(function() { init_search(); });
|
||||||
|
});
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<div id="main-nav"></div>
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="nav-path" class="navpath">
|
||||||
|
<ul>
|
||||||
|
<li class="navelem"><a class="el" href="dir_4351554941a2744586042c1cf3cf139a.html">glfw-3.3.8</a></li><li class="navelem"><a class="el" href="dir_f6ba4c3dca55a8d4e7d63c8235e0ad43.html">include</a></li><li class="navelem"><a class="el" href="dir_1dfd43b3952c5bc1ba15d15b12afff7b.html">GLFW</a></li> </ul>
|
||||||
|
</div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle"><div class="title">glfw3native.h</div></div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<a href="glfw3native_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">/*************************************************************************</span></div>
|
||||||
|
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment"> * GLFW 3.3 - www.glfw.org</span></div>
|
||||||
|
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment"> * A library for OpenGL, window and input</span></div>
|
||||||
|
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment"> *------------------------------------------------------------------------</span></div>
|
||||||
|
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment"> * Copyright (c) 2002-2006 Marcus Geelnard</span></div>
|
||||||
|
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="comment"> * Copyright (c) 2006-2018 Camilla Löwy <elmindreda@glfw.org></span></div>
|
||||||
|
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="comment"> *</span></div>
|
||||||
|
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="comment"> * This software is provided 'as-is', without any express or implied</span></div>
|
||||||
|
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="comment"> * warranty. In no event will the authors be held liable for any damages</span></div>
|
||||||
|
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="comment"> * arising from the use of this software.</span></div>
|
||||||
|
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="comment"> *</span></div>
|
||||||
|
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="comment"> * Permission is granted to anyone to use this software for any purpose,</span></div>
|
||||||
|
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="comment"> * including commercial applications, and to alter it and redistribute it</span></div>
|
||||||
|
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="comment"> * freely, subject to the following restrictions:</span></div>
|
||||||
|
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="comment"> *</span></div>
|
||||||
|
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="comment"> * 1. The origin of this software must not be misrepresented; you must not</span></div>
|
||||||
|
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="comment"> * claim that you wrote the original software. If you use this software</span></div>
|
||||||
|
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="comment"> * in a product, an acknowledgment in the product documentation would</span></div>
|
||||||
|
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="comment"> * be appreciated but is not required.</span></div>
|
||||||
|
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="comment"> *</span></div>
|
||||||
|
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="comment"> * 2. Altered source versions must be plainly marked as such, and must not</span></div>
|
||||||
|
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="comment"> * be misrepresented as being the original software.</span></div>
|
||||||
|
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="comment"> *</span></div>
|
||||||
|
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="comment"> * 3. This notice may not be removed or altered from any source</span></div>
|
||||||
|
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="comment"> * distribution.</span></div>
|
||||||
|
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="comment"> *</span></div>
|
||||||
|
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="comment"> *************************************************************************/</span></div>
|
||||||
|
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> </div>
|
||||||
|
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span><span class="preprocessor">#ifndef _glfw3_native_h_</span></div>
|
||||||
|
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span><span class="preprocessor">#define _glfw3_native_h_</span></div>
|
||||||
|
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> </div>
|
||||||
|
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span><span class="preprocessor">#ifdef __cplusplus</span></div>
|
||||||
|
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> {</div>
|
||||||
|
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span><span class="preprocessor">#endif</span></div>
|
||||||
|
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> </div>
|
||||||
|
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> </div>
|
||||||
|
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span><span class="comment">/*************************************************************************</span></div>
|
||||||
|
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span><span class="comment"> * Doxygen documentation</span></div>
|
||||||
|
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span><span class="comment"> *************************************************************************/</span></div>
|
||||||
|
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> </div>
|
||||||
|
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span><span class="comment">/*************************************************************************</span></div>
|
||||||
|
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span><span class="comment"> * System headers and types</span></div>
|
||||||
|
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span><span class="comment"> *************************************************************************/</span></div>
|
||||||
|
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> </div>
|
||||||
|
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span><span class="preprocessor">#if !defined(GLFW_NATIVE_INCLUDE_NONE)</span></div>
|
||||||
|
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> </div>
|
||||||
|
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span><span class="preprocessor"> #if defined(GLFW_EXPOSE_NATIVE_WIN32) || defined(GLFW_EXPOSE_NATIVE_WGL)</span></div>
|
||||||
|
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> <span class="comment">/* This is a workaround for the fact that glfw3.h needs to export APIENTRY (for</span></div>
|
||||||
|
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span><span class="comment"> * example to allow applications to correctly declare a GL_KHR_debug callback)</span></div>
|
||||||
|
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span><span class="comment"> * but windows.h assumes no one will define APIENTRY before it does</span></div>
|
||||||
|
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span><span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span><span class="preprocessor"> #if defined(GLFW_APIENTRY_DEFINED)</span></div>
|
||||||
|
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span><span class="preprocessor"> #undef APIENTRY</span></div>
|
||||||
|
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span><span class="preprocessor"> #undef GLFW_APIENTRY_DEFINED</span></div>
|
||||||
|
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span><span class="preprocessor"> #endif</span></div>
|
||||||
|
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span><span class="preprocessor"> #include <windows.h></span></div>
|
||||||
|
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span><span class="preprocessor"> #elif defined(GLFW_EXPOSE_NATIVE_COCOA) || defined(GLFW_EXPOSE_NATIVE_NSGL)</span></div>
|
||||||
|
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span><span class="preprocessor"> #if defined(__OBJC__)</span></div>
|
||||||
|
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span><span class="preprocessor"> #import <Cocoa/Cocoa.h></span></div>
|
||||||
|
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span><span class="preprocessor"> #else</span></div>
|
||||||
|
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span><span class="preprocessor"> #include <ApplicationServices/ApplicationServices.h></span></div>
|
||||||
|
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span><span class="preprocessor"> #include <objc/objc.h></span></div>
|
||||||
|
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span><span class="preprocessor"> #endif</span></div>
|
||||||
|
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span><span class="preprocessor"> #elif defined(GLFW_EXPOSE_NATIVE_X11) || defined(GLFW_EXPOSE_NATIVE_GLX)</span></div>
|
||||||
|
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span><span class="preprocessor"> #include <X11/Xlib.h></span></div>
|
||||||
|
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span><span class="preprocessor"> #include <X11/extensions/Xrandr.h></span></div>
|
||||||
|
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span><span class="preprocessor"> #elif defined(GLFW_EXPOSE_NATIVE_WAYLAND)</span></div>
|
||||||
|
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span><span class="preprocessor"> #include <wayland-client.h></span></div>
|
||||||
|
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span><span class="preprocessor"> #endif</span></div>
|
||||||
|
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> </div>
|
||||||
|
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span><span class="preprocessor"> #if defined(GLFW_EXPOSE_NATIVE_WGL)</span></div>
|
||||||
|
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> <span class="comment">/* WGL is declared by windows.h */</span></div>
|
||||||
|
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span><span class="preprocessor"> #endif</span></div>
|
||||||
|
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span><span class="preprocessor"> #if defined(GLFW_EXPOSE_NATIVE_NSGL)</span></div>
|
||||||
|
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> <span class="comment">/* NSGL is declared by Cocoa.h */</span></div>
|
||||||
|
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span><span class="preprocessor"> #endif</span></div>
|
||||||
|
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span><span class="preprocessor"> #if defined(GLFW_EXPOSE_NATIVE_GLX)</span></div>
|
||||||
|
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> <span class="comment">/* This is a workaround for the fact that glfw3.h defines GLAPIENTRY because by</span></div>
|
||||||
|
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span><span class="comment"> * default it also acts as an OpenGL header</span></div>
|
||||||
|
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span><span class="comment"> * However, glx.h will include gl.h, which will define it unconditionally</span></div>
|
||||||
|
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span><span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span><span class="preprocessor"> #if defined(GLFW_GLAPIENTRY_DEFINED)</span></div>
|
||||||
|
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span><span class="preprocessor"> #undef GLAPIENTRY</span></div>
|
||||||
|
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span><span class="preprocessor"> #undef GLFW_GLAPIENTRY_DEFINED</span></div>
|
||||||
|
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span><span class="preprocessor"> #endif</span></div>
|
||||||
|
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span><span class="preprocessor"> #include <GL/glx.h></span></div>
|
||||||
|
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span><span class="preprocessor"> #endif</span></div>
|
||||||
|
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span><span class="preprocessor"> #if defined(GLFW_EXPOSE_NATIVE_EGL)</span></div>
|
||||||
|
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span><span class="preprocessor"> #include <EGL/egl.h></span></div>
|
||||||
|
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span><span class="preprocessor"> #endif</span></div>
|
||||||
|
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span><span class="preprocessor"> #if defined(GLFW_EXPOSE_NATIVE_OSMESA)</span></div>
|
||||||
|
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> <span class="comment">/* This is a workaround for the fact that glfw3.h defines GLAPIENTRY because by</span></div>
|
||||||
|
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span><span class="comment"> * default it also acts as an OpenGL header</span></div>
|
||||||
|
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span><span class="comment"> * However, osmesa.h will include gl.h, which will define it unconditionally</span></div>
|
||||||
|
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span><span class="comment"> */</span></div>
|
||||||
|
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span><span class="preprocessor"> #if defined(GLFW_GLAPIENTRY_DEFINED)</span></div>
|
||||||
|
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span><span class="preprocessor"> #undef GLAPIENTRY</span></div>
|
||||||
|
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span><span class="preprocessor"> #undef GLFW_GLAPIENTRY_DEFINED</span></div>
|
||||||
|
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span><span class="preprocessor"> #endif</span></div>
|
||||||
|
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span><span class="preprocessor"> #include <GL/osmesa.h></span></div>
|
||||||
|
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span><span class="preprocessor"> #endif</span></div>
|
||||||
|
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> </div>
|
||||||
|
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span><span class="preprocessor">#endif </span><span class="comment">/*GLFW_NATIVE_INCLUDE_NONE*/</span><span class="preprocessor"></span></div>
|
||||||
|
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> </div>
|
||||||
|
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> </div>
|
||||||
|
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span><span class="comment">/*************************************************************************</span></div>
|
||||||
|
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span><span class="comment"> * Functions</span></div>
|
||||||
|
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span><span class="comment"> *************************************************************************/</span></div>
|
||||||
|
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> </div>
|
||||||
|
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span><span class="preprocessor">#if defined(GLFW_EXPOSE_NATIVE_WIN32)</span></div>
|
||||||
|
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"><a class="line" href="group__native.html#gad4d3e9242536c0ba6be88a98f4c73a41"> 175</a></span>GLFWAPI <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code hl_function" href="group__native.html#gad4d3e9242536c0ba6be88a98f4c73a41">glfwGetWin32Adapter</a>(<a class="code hl_typedef" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a>* monitor);</div>
|
||||||
|
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span> </div>
|
||||||
|
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"><a class="line" href="group__native.html#gac845f7dbe4c1d7fdd682a3c6fdae6766"> 192</a></span>GLFWAPI <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code hl_function" href="group__native.html#gac845f7dbe4c1d7fdd682a3c6fdae6766">glfwGetWin32Monitor</a>(<a class="code hl_typedef" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a>* monitor);</div>
|
||||||
|
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span> </div>
|
||||||
|
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno"><a class="line" href="group__native.html#gafe5079aa79038b0079fc09d5f0a8e667"> 216</a></span>GLFWAPI HWND <a class="code hl_function" href="group__native.html#gafe5079aa79038b0079fc09d5f0a8e667">glfwGetWin32Window</a>(<a class="code hl_typedef" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a>* window);</div>
|
||||||
|
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno"> 217</span><span class="preprocessor">#endif</span></div>
|
||||||
|
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno"> 218</span> </div>
|
||||||
|
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno"> 219</span><span class="preprocessor">#if defined(GLFW_EXPOSE_NATIVE_WGL)</span></div>
|
||||||
|
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno"><a class="line" href="group__native.html#gadc4010d91d9cc1134d040eeb1202a143"> 243</a></span>GLFWAPI HGLRC <a class="code hl_function" href="group__native.html#gadc4010d91d9cc1134d040eeb1202a143">glfwGetWGLContext</a>(<a class="code hl_typedef" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a>* window);</div>
|
||||||
|
<div class="line"><a id="l00244" name="l00244"></a><span class="lineno"> 244</span><span class="preprocessor">#endif</span></div>
|
||||||
|
<div class="line"><a id="l00245" name="l00245"></a><span class="lineno"> 245</span> </div>
|
||||||
|
<div class="line"><a id="l00246" name="l00246"></a><span class="lineno"> 246</span><span class="preprocessor">#if defined(GLFW_EXPOSE_NATIVE_COCOA)</span></div>
|
||||||
|
<div class="line"><a id="l00261" name="l00261"></a><span class="lineno"><a class="line" href="group__native.html#gaf22f429aec4b1aab316142d66d9be3e6"> 261</a></span>GLFWAPI CGDirectDisplayID <a class="code hl_function" href="group__native.html#gaf22f429aec4b1aab316142d66d9be3e6">glfwGetCocoaMonitor</a>(<a class="code hl_typedef" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a>* monitor);</div>
|
||||||
|
<div class="line"><a id="l00262" name="l00262"></a><span class="lineno"> 262</span> </div>
|
||||||
|
<div class="line"><a id="l00277" name="l00277"></a><span class="lineno"><a class="line" href="group__native.html#gac3ed9d495d0c2bb9652de5a50c648715"> 277</a></span>GLFWAPI <span class="keywordtype">id</span> <a class="code hl_function" href="group__native.html#gac3ed9d495d0c2bb9652de5a50c648715">glfwGetCocoaWindow</a>(<a class="code hl_typedef" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a>* window);</div>
|
||||||
|
<div class="line"><a id="l00278" name="l00278"></a><span class="lineno"> 278</span><span class="preprocessor">#endif</span></div>
|
||||||
|
<div class="line"><a id="l00279" name="l00279"></a><span class="lineno"> 279</span> </div>
|
||||||
|
<div class="line"><a id="l00280" name="l00280"></a><span class="lineno"> 280</span><span class="preprocessor">#if defined(GLFW_EXPOSE_NATIVE_NSGL)</span></div>
|
||||||
|
<div class="line"><a id="l00296" name="l00296"></a><span class="lineno"><a class="line" href="group__native.html#ga559e002e3cd63c979881770cd4dc63bc"> 296</a></span>GLFWAPI <span class="keywordtype">id</span> <a class="code hl_function" href="group__native.html#ga559e002e3cd63c979881770cd4dc63bc">glfwGetNSGLContext</a>(<a class="code hl_typedef" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a>* window);</div>
|
||||||
|
<div class="line"><a id="l00297" name="l00297"></a><span class="lineno"> 297</span><span class="preprocessor">#endif</span></div>
|
||||||
|
<div class="line"><a id="l00298" name="l00298"></a><span class="lineno"> 298</span> </div>
|
||||||
|
<div class="line"><a id="l00299" name="l00299"></a><span class="lineno"> 299</span><span class="preprocessor">#if defined(GLFW_EXPOSE_NATIVE_X11)</span></div>
|
||||||
|
<div class="line"><a id="l00314" name="l00314"></a><span class="lineno"><a class="line" href="group__native.html#ga6e7822385cc8a1cc3b18f60352830189"> 314</a></span>GLFWAPI Display* <a class="code hl_function" href="group__native.html#ga6e7822385cc8a1cc3b18f60352830189">glfwGetX11Display</a>(<span class="keywordtype">void</span>);</div>
|
||||||
|
<div class="line"><a id="l00315" name="l00315"></a><span class="lineno"> 315</span> </div>
|
||||||
|
<div class="line"><a id="l00330" name="l00330"></a><span class="lineno"><a class="line" href="group__native.html#ga088fbfa80f50569402b41be71ad66e40"> 330</a></span>GLFWAPI RRCrtc <a class="code hl_function" href="group__native.html#ga088fbfa80f50569402b41be71ad66e40">glfwGetX11Adapter</a>(<a class="code hl_typedef" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a>* monitor);</div>
|
||||||
|
<div class="line"><a id="l00331" name="l00331"></a><span class="lineno"> 331</span> </div>
|
||||||
|
<div class="line"><a id="l00346" name="l00346"></a><span class="lineno"><a class="line" href="group__native.html#gab2f8cc043905e9fa9b12bfdbbcfe874c"> 346</a></span>GLFWAPI RROutput <a class="code hl_function" href="group__native.html#gab2f8cc043905e9fa9b12bfdbbcfe874c">glfwGetX11Monitor</a>(<a class="code hl_typedef" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a>* monitor);</div>
|
||||||
|
<div class="line"><a id="l00347" name="l00347"></a><span class="lineno"> 347</span> </div>
|
||||||
|
<div class="line"><a id="l00362" name="l00362"></a><span class="lineno"><a class="line" href="group__native.html#ga90ca676322740842db446999a1b1f21d"> 362</a></span>GLFWAPI Window <a class="code hl_function" href="group__native.html#ga90ca676322740842db446999a1b1f21d">glfwGetX11Window</a>(<a class="code hl_typedef" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a>* window);</div>
|
||||||
|
<div class="line"><a id="l00363" name="l00363"></a><span class="lineno"> 363</span> </div>
|
||||||
|
<div class="line"><a id="l00384" name="l00384"></a><span class="lineno"><a class="line" href="group__native.html#ga55f879ab02d93367f966186b6f0133f7"> 384</a></span>GLFWAPI <span class="keywordtype">void</span> <a class="code hl_function" href="group__native.html#ga55f879ab02d93367f966186b6f0133f7">glfwSetX11SelectionString</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* <span class="keywordtype">string</span>);</div>
|
||||||
|
<div class="line"><a id="l00385" name="l00385"></a><span class="lineno"> 385</span> </div>
|
||||||
|
<div class="line"><a id="l00412" name="l00412"></a><span class="lineno"><a class="line" href="group__native.html#gae084ef64dc0db140b455b1427256d3f7"> 412</a></span>GLFWAPI <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code hl_function" href="group__native.html#gae084ef64dc0db140b455b1427256d3f7">glfwGetX11SelectionString</a>(<span class="keywordtype">void</span>);</div>
|
||||||
|
<div class="line"><a id="l00413" name="l00413"></a><span class="lineno"> 413</span><span class="preprocessor">#endif</span></div>
|
||||||
|
<div class="line"><a id="l00414" name="l00414"></a><span class="lineno"> 414</span> </div>
|
||||||
|
<div class="line"><a id="l00415" name="l00415"></a><span class="lineno"> 415</span><span class="preprocessor">#if defined(GLFW_EXPOSE_NATIVE_GLX)</span></div>
|
||||||
|
<div class="line"><a id="l00431" name="l00431"></a><span class="lineno"><a class="line" href="group__native.html#ga62d884114b0abfcdc2930e89f20867e2"> 431</a></span>GLFWAPI GLXContext <a class="code hl_function" href="group__native.html#ga62d884114b0abfcdc2930e89f20867e2">glfwGetGLXContext</a>(<a class="code hl_typedef" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a>* window);</div>
|
||||||
|
<div class="line"><a id="l00432" name="l00432"></a><span class="lineno"> 432</span> </div>
|
||||||
|
<div class="line"><a id="l00448" name="l00448"></a><span class="lineno"><a class="line" href="group__native.html#ga1ed27b8766e859a21381e8f8ce18d049"> 448</a></span>GLFWAPI GLXWindow <a class="code hl_function" href="group__native.html#ga1ed27b8766e859a21381e8f8ce18d049">glfwGetGLXWindow</a>(<a class="code hl_typedef" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a>* window);</div>
|
||||||
|
<div class="line"><a id="l00449" name="l00449"></a><span class="lineno"> 449</span><span class="preprocessor">#endif</span></div>
|
||||||
|
<div class="line"><a id="l00450" name="l00450"></a><span class="lineno"> 450</span> </div>
|
||||||
|
<div class="line"><a id="l00451" name="l00451"></a><span class="lineno"> 451</span><span class="preprocessor">#if defined(GLFW_EXPOSE_NATIVE_WAYLAND)</span></div>
|
||||||
|
<div class="line"><a id="l00466" name="l00466"></a><span class="lineno"><a class="line" href="group__native.html#gacbe11f93ce20621de82989bbba94e62a"> 466</a></span>GLFWAPI <span class="keyword">struct </span>wl_display* <a class="code hl_function" href="group__native.html#gacbe11f93ce20621de82989bbba94e62a">glfwGetWaylandDisplay</a>(<span class="keywordtype">void</span>);</div>
|
||||||
|
<div class="line"><a id="l00467" name="l00467"></a><span class="lineno"> 467</span> </div>
|
||||||
|
<div class="line"><a id="l00482" name="l00482"></a><span class="lineno"><a class="line" href="group__native.html#ga4f16066bd4c59e2f99418adfcb43dd16"> 482</a></span>GLFWAPI <span class="keyword">struct </span>wl_output* <a class="code hl_function" href="group__native.html#ga4f16066bd4c59e2f99418adfcb43dd16">glfwGetWaylandMonitor</a>(<a class="code hl_typedef" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a>* monitor);</div>
|
||||||
|
<div class="line"><a id="l00483" name="l00483"></a><span class="lineno"> 483</span> </div>
|
||||||
|
<div class="line"><a id="l00498" name="l00498"></a><span class="lineno"><a class="line" href="group__native.html#ga5c597f2841229d9626f0811cca41ceb3"> 498</a></span>GLFWAPI <span class="keyword">struct </span>wl_surface* <a class="code hl_function" href="group__native.html#ga5c597f2841229d9626f0811cca41ceb3">glfwGetWaylandWindow</a>(<a class="code hl_typedef" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a>* window);</div>
|
||||||
|
<div class="line"><a id="l00499" name="l00499"></a><span class="lineno"> 499</span><span class="preprocessor">#endif</span></div>
|
||||||
|
<div class="line"><a id="l00500" name="l00500"></a><span class="lineno"> 500</span> </div>
|
||||||
|
<div class="line"><a id="l00501" name="l00501"></a><span class="lineno"> 501</span><span class="preprocessor">#if defined(GLFW_EXPOSE_NATIVE_EGL)</span></div>
|
||||||
|
<div class="line"><a id="l00519" name="l00519"></a><span class="lineno"><a class="line" href="group__native.html#ga1cd8d973f47aacb5532d368147cc3138"> 519</a></span>GLFWAPI EGLDisplay <a class="code hl_function" href="group__native.html#ga1cd8d973f47aacb5532d368147cc3138">glfwGetEGLDisplay</a>(<span class="keywordtype">void</span>);</div>
|
||||||
|
<div class="line"><a id="l00520" name="l00520"></a><span class="lineno"> 520</span> </div>
|
||||||
|
<div class="line"><a id="l00536" name="l00536"></a><span class="lineno"><a class="line" href="group__native.html#ga671c5072becd085f4ab5771a9c8efcf1"> 536</a></span>GLFWAPI EGLContext <a class="code hl_function" href="group__native.html#ga671c5072becd085f4ab5771a9c8efcf1">glfwGetEGLContext</a>(<a class="code hl_typedef" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a>* window);</div>
|
||||||
|
<div class="line"><a id="l00537" name="l00537"></a><span class="lineno"> 537</span> </div>
|
||||||
|
<div class="line"><a id="l00553" name="l00553"></a><span class="lineno"><a class="line" href="group__native.html#ga2199b36117a6a695fec8441d8052eee6"> 553</a></span>GLFWAPI EGLSurface <a class="code hl_function" href="group__native.html#ga2199b36117a6a695fec8441d8052eee6">glfwGetEGLSurface</a>(<a class="code hl_typedef" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a>* window);</div>
|
||||||
|
<div class="line"><a id="l00554" name="l00554"></a><span class="lineno"> 554</span><span class="preprocessor">#endif</span></div>
|
||||||
|
<div class="line"><a id="l00555" name="l00555"></a><span class="lineno"> 555</span> </div>
|
||||||
|
<div class="line"><a id="l00556" name="l00556"></a><span class="lineno"> 556</span><span class="preprocessor">#if defined(GLFW_EXPOSE_NATIVE_OSMESA)</span></div>
|
||||||
|
<div class="line"><a id="l00579" name="l00579"></a><span class="lineno"><a class="line" href="group__native.html#ga3b36e3e3dcf308b776427b6bd73cc132"> 579</a></span>GLFWAPI <span class="keywordtype">int</span> <a class="code hl_function" href="group__native.html#ga3b36e3e3dcf308b776427b6bd73cc132">glfwGetOSMesaColorBuffer</a>(<a class="code hl_typedef" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a>* window, <span class="keywordtype">int</span>* width, <span class="keywordtype">int</span>* height, <span class="keywordtype">int</span>* format, <span class="keywordtype">void</span>** buffer);</div>
|
||||||
|
<div class="line"><a id="l00580" name="l00580"></a><span class="lineno"> 580</span> </div>
|
||||||
|
<div class="line"><a id="l00603" name="l00603"></a><span class="lineno"><a class="line" href="group__native.html#ga6b64039ffc88a7a2f57f0956c0c75d53"> 603</a></span>GLFWAPI <span class="keywordtype">int</span> <a class="code hl_function" href="group__native.html#ga6b64039ffc88a7a2f57f0956c0c75d53">glfwGetOSMesaDepthBuffer</a>(<a class="code hl_typedef" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a>* window, <span class="keywordtype">int</span>* width, <span class="keywordtype">int</span>* height, <span class="keywordtype">int</span>* bytesPerValue, <span class="keywordtype">void</span>** buffer);</div>
|
||||||
|
<div class="line"><a id="l00604" name="l00604"></a><span class="lineno"> 604</span> </div>
|
||||||
|
<div class="line"><a id="l00620" name="l00620"></a><span class="lineno"><a class="line" href="group__native.html#ga9e47700080094eb569cb053afaa88773"> 620</a></span>GLFWAPI OSMesaContext <a class="code hl_function" href="group__native.html#ga9e47700080094eb569cb053afaa88773">glfwGetOSMesaContext</a>(<a class="code hl_typedef" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a>* window);</div>
|
||||||
|
<div class="line"><a id="l00621" name="l00621"></a><span class="lineno"> 621</span><span class="preprocessor">#endif</span></div>
|
||||||
|
<div class="line"><a id="l00622" name="l00622"></a><span class="lineno"> 622</span> </div>
|
||||||
|
<div class="line"><a id="l00623" name="l00623"></a><span class="lineno"> 623</span><span class="preprocessor">#ifdef __cplusplus</span></div>
|
||||||
|
<div class="line"><a id="l00624" name="l00624"></a><span class="lineno"> 624</span>}</div>
|
||||||
|
<div class="line"><a id="l00625" name="l00625"></a><span class="lineno"> 625</span><span class="preprocessor">#endif</span></div>
|
||||||
|
<div class="line"><a id="l00626" name="l00626"></a><span class="lineno"> 626</span> </div>
|
||||||
|
<div class="line"><a id="l00627" name="l00627"></a><span class="lineno"> 627</span><span class="preprocessor">#endif </span><span class="comment">/* _glfw3_native_h_ */</span><span class="preprocessor"></span></div>
|
||||||
|
<div class="line"><a id="l00628" name="l00628"></a><span class="lineno"> 628</span> </div>
|
||||||
|
<div class="ttc" id="agroup__monitor_html_ga8d9efd1cde9426692c73fe40437d0ae3"><div class="ttname"><a href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a></div><div class="ttdeci">struct GLFWmonitor GLFWmonitor</div><div class="ttdoc">Opaque monitor object.</div><div class="ttdef"><b>Definition:</b> glfw3.h:1173</div></div>
|
||||||
|
<div class="ttc" id="agroup__native_html_ga088fbfa80f50569402b41be71ad66e40"><div class="ttname"><a href="group__native.html#ga088fbfa80f50569402b41be71ad66e40">glfwGetX11Adapter</a></div><div class="ttdeci">RRCrtc glfwGetX11Adapter(GLFWmonitor *monitor)</div><div class="ttdoc">Returns the RRCrtc of the specified monitor.</div></div>
|
||||||
|
<div class="ttc" id="agroup__native_html_ga1cd8d973f47aacb5532d368147cc3138"><div class="ttname"><a href="group__native.html#ga1cd8d973f47aacb5532d368147cc3138">glfwGetEGLDisplay</a></div><div class="ttdeci">EGLDisplay glfwGetEGLDisplay(void)</div><div class="ttdoc">Returns the EGLDisplay used by GLFW.</div></div>
|
||||||
|
<div class="ttc" id="agroup__native_html_ga1ed27b8766e859a21381e8f8ce18d049"><div class="ttname"><a href="group__native.html#ga1ed27b8766e859a21381e8f8ce18d049">glfwGetGLXWindow</a></div><div class="ttdeci">GLXWindow glfwGetGLXWindow(GLFWwindow *window)</div><div class="ttdoc">Returns the GLXWindow of the specified window.</div></div>
|
||||||
|
<div class="ttc" id="agroup__native_html_ga2199b36117a6a695fec8441d8052eee6"><div class="ttname"><a href="group__native.html#ga2199b36117a6a695fec8441d8052eee6">glfwGetEGLSurface</a></div><div class="ttdeci">EGLSurface glfwGetEGLSurface(GLFWwindow *window)</div><div class="ttdoc">Returns the EGLSurface of the specified window.</div></div>
|
||||||
|
<div class="ttc" id="agroup__native_html_ga3b36e3e3dcf308b776427b6bd73cc132"><div class="ttname"><a href="group__native.html#ga3b36e3e3dcf308b776427b6bd73cc132">glfwGetOSMesaColorBuffer</a></div><div class="ttdeci">int glfwGetOSMesaColorBuffer(GLFWwindow *window, int *width, int *height, int *format, void **buffer)</div><div class="ttdoc">Retrieves the color buffer associated with the specified window.</div></div>
|
||||||
|
<div class="ttc" id="agroup__native_html_ga4f16066bd4c59e2f99418adfcb43dd16"><div class="ttname"><a href="group__native.html#ga4f16066bd4c59e2f99418adfcb43dd16">glfwGetWaylandMonitor</a></div><div class="ttdeci">struct wl_output * glfwGetWaylandMonitor(GLFWmonitor *monitor)</div><div class="ttdoc">Returns the struct wl_output* of the specified monitor.</div></div>
|
||||||
|
<div class="ttc" id="agroup__native_html_ga559e002e3cd63c979881770cd4dc63bc"><div class="ttname"><a href="group__native.html#ga559e002e3cd63c979881770cd4dc63bc">glfwGetNSGLContext</a></div><div class="ttdeci">id glfwGetNSGLContext(GLFWwindow *window)</div><div class="ttdoc">Returns the NSOpenGLContext of the specified window.</div></div>
|
||||||
|
<div class="ttc" id="agroup__native_html_ga55f879ab02d93367f966186b6f0133f7"><div class="ttname"><a href="group__native.html#ga55f879ab02d93367f966186b6f0133f7">glfwSetX11SelectionString</a></div><div class="ttdeci">void glfwSetX11SelectionString(const char *string)</div><div class="ttdoc">Sets the current primary selection to the specified string.</div></div>
|
||||||
|
<div class="ttc" id="agroup__native_html_ga5c597f2841229d9626f0811cca41ceb3"><div class="ttname"><a href="group__native.html#ga5c597f2841229d9626f0811cca41ceb3">glfwGetWaylandWindow</a></div><div class="ttdeci">struct wl_surface * glfwGetWaylandWindow(GLFWwindow *window)</div><div class="ttdoc">Returns the main struct wl_surface* of the specified window.</div></div>
|
||||||
|
<div class="ttc" id="agroup__native_html_ga62d884114b0abfcdc2930e89f20867e2"><div class="ttname"><a href="group__native.html#ga62d884114b0abfcdc2930e89f20867e2">glfwGetGLXContext</a></div><div class="ttdeci">GLXContext glfwGetGLXContext(GLFWwindow *window)</div><div class="ttdoc">Returns the GLXContext of the specified window.</div></div>
|
||||||
|
<div class="ttc" id="agroup__native_html_ga671c5072becd085f4ab5771a9c8efcf1"><div class="ttname"><a href="group__native.html#ga671c5072becd085f4ab5771a9c8efcf1">glfwGetEGLContext</a></div><div class="ttdeci">EGLContext glfwGetEGLContext(GLFWwindow *window)</div><div class="ttdoc">Returns the EGLContext of the specified window.</div></div>
|
||||||
|
<div class="ttc" id="agroup__native_html_ga6b64039ffc88a7a2f57f0956c0c75d53"><div class="ttname"><a href="group__native.html#ga6b64039ffc88a7a2f57f0956c0c75d53">glfwGetOSMesaDepthBuffer</a></div><div class="ttdeci">int glfwGetOSMesaDepthBuffer(GLFWwindow *window, int *width, int *height, int *bytesPerValue, void **buffer)</div><div class="ttdoc">Retrieves the depth buffer associated with the specified window.</div></div>
|
||||||
|
<div class="ttc" id="agroup__native_html_ga6e7822385cc8a1cc3b18f60352830189"><div class="ttname"><a href="group__native.html#ga6e7822385cc8a1cc3b18f60352830189">glfwGetX11Display</a></div><div class="ttdeci">Display * glfwGetX11Display(void)</div><div class="ttdoc">Returns the Display used by GLFW.</div></div>
|
||||||
|
<div class="ttc" id="agroup__native_html_ga90ca676322740842db446999a1b1f21d"><div class="ttname"><a href="group__native.html#ga90ca676322740842db446999a1b1f21d">glfwGetX11Window</a></div><div class="ttdeci">Window glfwGetX11Window(GLFWwindow *window)</div><div class="ttdoc">Returns the Window of the specified window.</div></div>
|
||||||
|
<div class="ttc" id="agroup__native_html_ga9e47700080094eb569cb053afaa88773"><div class="ttname"><a href="group__native.html#ga9e47700080094eb569cb053afaa88773">glfwGetOSMesaContext</a></div><div class="ttdeci">OSMesaContext glfwGetOSMesaContext(GLFWwindow *window)</div><div class="ttdoc">Returns the OSMesaContext of the specified window.</div></div>
|
||||||
|
<div class="ttc" id="agroup__native_html_gab2f8cc043905e9fa9b12bfdbbcfe874c"><div class="ttname"><a href="group__native.html#gab2f8cc043905e9fa9b12bfdbbcfe874c">glfwGetX11Monitor</a></div><div class="ttdeci">RROutput glfwGetX11Monitor(GLFWmonitor *monitor)</div><div class="ttdoc">Returns the RROutput of the specified monitor.</div></div>
|
||||||
|
<div class="ttc" id="agroup__native_html_gac3ed9d495d0c2bb9652de5a50c648715"><div class="ttname"><a href="group__native.html#gac3ed9d495d0c2bb9652de5a50c648715">glfwGetCocoaWindow</a></div><div class="ttdeci">id glfwGetCocoaWindow(GLFWwindow *window)</div><div class="ttdoc">Returns the NSWindow of the specified window.</div></div>
|
||||||
|
<div class="ttc" id="agroup__native_html_gac845f7dbe4c1d7fdd682a3c6fdae6766"><div class="ttname"><a href="group__native.html#gac845f7dbe4c1d7fdd682a3c6fdae6766">glfwGetWin32Monitor</a></div><div class="ttdeci">const char * glfwGetWin32Monitor(GLFWmonitor *monitor)</div><div class="ttdoc">Returns the display device name of the specified monitor.</div></div>
|
||||||
|
<div class="ttc" id="agroup__native_html_gacbe11f93ce20621de82989bbba94e62a"><div class="ttname"><a href="group__native.html#gacbe11f93ce20621de82989bbba94e62a">glfwGetWaylandDisplay</a></div><div class="ttdeci">struct wl_display * glfwGetWaylandDisplay(void)</div><div class="ttdoc">Returns the struct wl_display* used by GLFW.</div></div>
|
||||||
|
<div class="ttc" id="agroup__native_html_gad4d3e9242536c0ba6be88a98f4c73a41"><div class="ttname"><a href="group__native.html#gad4d3e9242536c0ba6be88a98f4c73a41">glfwGetWin32Adapter</a></div><div class="ttdeci">const char * glfwGetWin32Adapter(GLFWmonitor *monitor)</div><div class="ttdoc">Returns the adapter device name of the specified monitor.</div></div>
|
||||||
|
<div class="ttc" id="agroup__native_html_gadc4010d91d9cc1134d040eeb1202a143"><div class="ttname"><a href="group__native.html#gadc4010d91d9cc1134d040eeb1202a143">glfwGetWGLContext</a></div><div class="ttdeci">HGLRC glfwGetWGLContext(GLFWwindow *window)</div><div class="ttdoc">Returns the HGLRC of the specified window.</div></div>
|
||||||
|
<div class="ttc" id="agroup__native_html_gae084ef64dc0db140b455b1427256d3f7"><div class="ttname"><a href="group__native.html#gae084ef64dc0db140b455b1427256d3f7">glfwGetX11SelectionString</a></div><div class="ttdeci">const char * glfwGetX11SelectionString(void)</div><div class="ttdoc">Returns the contents of the current primary selection as a string.</div></div>
|
||||||
|
<div class="ttc" id="agroup__native_html_gaf22f429aec4b1aab316142d66d9be3e6"><div class="ttname"><a href="group__native.html#gaf22f429aec4b1aab316142d66d9be3e6">glfwGetCocoaMonitor</a></div><div class="ttdeci">CGDirectDisplayID glfwGetCocoaMonitor(GLFWmonitor *monitor)</div><div class="ttdoc">Returns the CGDirectDisplayID of the specified monitor.</div></div>
|
||||||
|
<div class="ttc" id="agroup__native_html_gafe5079aa79038b0079fc09d5f0a8e667"><div class="ttname"><a href="group__native.html#gafe5079aa79038b0079fc09d5f0a8e667">glfwGetWin32Window</a></div><div class="ttdeci">HWND glfwGetWin32Window(GLFWwindow *window)</div><div class="ttdoc">Returns the HWND of the specified window.</div></div>
|
||||||
|
<div class="ttc" id="agroup__window_html_ga3c96d80d363e67d13a41b5d1821f3242"><div class="ttname"><a href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a></div><div class="ttdeci">struct GLFWwindow GLFWwindow</div><div class="ttdoc">Opaque window object.</div><div class="ttdef"><b>Definition:</b> glfw3.h:1185</div></div>
|
||||||
|
</div><!-- fragment --></div><!-- contents -->
|
||||||
|
<address class="footer">
|
||||||
|
<p>
|
||||||
|
Last update on Fri Jul 22 2022 for GLFW 3.3.8
|
||||||
|
</p>
|
||||||
|
</address>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,275 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.9.4"/>
|
||||||
|
<title>GLFW: Mouse buttons</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="extra.css" rel="stylesheet" type="text/css"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<div class="glfwheader">
|
||||||
|
<a href="https://www.glfw.org/" id="glfwhome">GLFW</a>
|
||||||
|
<ul class="glfwnavbar">
|
||||||
|
<li><a href="https://www.glfw.org/documentation.html">Documentation</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/download.html">Download</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/community.html">Community</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.9.4 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src="menudata.js"></script>
|
||||||
|
<script type="text/javascript" src="menu.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
$(function() {
|
||||||
|
initMenu('',true,false,'search.php','Search');
|
||||||
|
$(document).ready(function() { init_search(); });
|
||||||
|
});
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<div id="main-nav"></div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="header">
|
||||||
|
<div class="summary">
|
||||||
|
<a href="#define-members">Macros</a> </div>
|
||||||
|
<div class="headertitle"><div class="title">Mouse buttons<div class="ingroups"><a class="el" href="group__input.html">Input reference</a></div></div></div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<a name="details" id="details"></a><h2 class="groupheader">Description</h2>
|
||||||
|
<p >See <a class="el" href="input_guide.html#input_mouse_button">mouse button input</a> for how these are used. </p>
|
||||||
|
<table class="memberdecls">
|
||||||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
|
||||||
|
Macros</h2></td></tr>
|
||||||
|
<tr class="memitem:ga181a6e875251fd8671654eff00f9112e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__buttons.html#ga181a6e875251fd8671654eff00f9112e">GLFW_MOUSE_BUTTON_1</a>   0</td></tr>
|
||||||
|
<tr class="separator:ga181a6e875251fd8671654eff00f9112e"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga604b39b92c88ce9bd332e97fc3f4156c"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__buttons.html#ga604b39b92c88ce9bd332e97fc3f4156c">GLFW_MOUSE_BUTTON_2</a>   1</td></tr>
|
||||||
|
<tr class="separator:ga604b39b92c88ce9bd332e97fc3f4156c"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga0130d505563d0236a6f85545f19e1721"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__buttons.html#ga0130d505563d0236a6f85545f19e1721">GLFW_MOUSE_BUTTON_3</a>   2</td></tr>
|
||||||
|
<tr class="separator:ga0130d505563d0236a6f85545f19e1721"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga53f4097bb01d5521c7d9513418c91ca9"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__buttons.html#ga53f4097bb01d5521c7d9513418c91ca9">GLFW_MOUSE_BUTTON_4</a>   3</td></tr>
|
||||||
|
<tr class="separator:ga53f4097bb01d5521c7d9513418c91ca9"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gaf08c4ddecb051d3d9667db1d5e417c9c"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__buttons.html#gaf08c4ddecb051d3d9667db1d5e417c9c">GLFW_MOUSE_BUTTON_5</a>   4</td></tr>
|
||||||
|
<tr class="separator:gaf08c4ddecb051d3d9667db1d5e417c9c"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gae8513e06aab8aa393b595f22c6d8257a"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__buttons.html#gae8513e06aab8aa393b595f22c6d8257a">GLFW_MOUSE_BUTTON_6</a>   5</td></tr>
|
||||||
|
<tr class="separator:gae8513e06aab8aa393b595f22c6d8257a"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga8b02a1ab55dde45b3a3883d54ffd7dc7"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__buttons.html#ga8b02a1ab55dde45b3a3883d54ffd7dc7">GLFW_MOUSE_BUTTON_7</a>   6</td></tr>
|
||||||
|
<tr class="separator:ga8b02a1ab55dde45b3a3883d54ffd7dc7"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga35d5c4263e0dc0d0a4731ca6c562f32c"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__buttons.html#ga35d5c4263e0dc0d0a4731ca6c562f32c">GLFW_MOUSE_BUTTON_8</a>   7</td></tr>
|
||||||
|
<tr class="separator:ga35d5c4263e0dc0d0a4731ca6c562f32c"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gab1fd86a4518a9141ec7bcde2e15a2fdf"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__buttons.html#gab1fd86a4518a9141ec7bcde2e15a2fdf">GLFW_MOUSE_BUTTON_LAST</a>   <a class="el" href="group__buttons.html#ga35d5c4263e0dc0d0a4731ca6c562f32c">GLFW_MOUSE_BUTTON_8</a></td></tr>
|
||||||
|
<tr class="separator:gab1fd86a4518a9141ec7bcde2e15a2fdf"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gaf37100431dcd5082d48f95ee8bc8cd56"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__buttons.html#gaf37100431dcd5082d48f95ee8bc8cd56">GLFW_MOUSE_BUTTON_LEFT</a>   <a class="el" href="group__buttons.html#ga181a6e875251fd8671654eff00f9112e">GLFW_MOUSE_BUTTON_1</a></td></tr>
|
||||||
|
<tr class="separator:gaf37100431dcd5082d48f95ee8bc8cd56"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga3e2f2cf3c4942df73cc094247d275e74"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__buttons.html#ga3e2f2cf3c4942df73cc094247d275e74">GLFW_MOUSE_BUTTON_RIGHT</a>   <a class="el" href="group__buttons.html#ga604b39b92c88ce9bd332e97fc3f4156c">GLFW_MOUSE_BUTTON_2</a></td></tr>
|
||||||
|
<tr class="separator:ga3e2f2cf3c4942df73cc094247d275e74"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga34a4d2a701434f763fd93a2ff842b95a"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__buttons.html#ga34a4d2a701434f763fd93a2ff842b95a">GLFW_MOUSE_BUTTON_MIDDLE</a>   <a class="el" href="group__buttons.html#ga0130d505563d0236a6f85545f19e1721">GLFW_MOUSE_BUTTON_3</a></td></tr>
|
||||||
|
<tr class="separator:ga34a4d2a701434f763fd93a2ff842b95a"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
</table>
|
||||||
|
<h2 class="groupheader">Macro Definition Documentation</h2>
|
||||||
|
<a id="ga181a6e875251fd8671654eff00f9112e" name="ga181a6e875251fd8671654eff00f9112e"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga181a6e875251fd8671654eff00f9112e">◆ </a></span>GLFW_MOUSE_BUTTON_1</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_MOUSE_BUTTON_1   0</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga604b39b92c88ce9bd332e97fc3f4156c" name="ga604b39b92c88ce9bd332e97fc3f4156c"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga604b39b92c88ce9bd332e97fc3f4156c">◆ </a></span>GLFW_MOUSE_BUTTON_2</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_MOUSE_BUTTON_2   1</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga0130d505563d0236a6f85545f19e1721" name="ga0130d505563d0236a6f85545f19e1721"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga0130d505563d0236a6f85545f19e1721">◆ </a></span>GLFW_MOUSE_BUTTON_3</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_MOUSE_BUTTON_3   2</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga53f4097bb01d5521c7d9513418c91ca9" name="ga53f4097bb01d5521c7d9513418c91ca9"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga53f4097bb01d5521c7d9513418c91ca9">◆ </a></span>GLFW_MOUSE_BUTTON_4</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_MOUSE_BUTTON_4   3</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gaf08c4ddecb051d3d9667db1d5e417c9c" name="gaf08c4ddecb051d3d9667db1d5e417c9c"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gaf08c4ddecb051d3d9667db1d5e417c9c">◆ </a></span>GLFW_MOUSE_BUTTON_5</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_MOUSE_BUTTON_5   4</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gae8513e06aab8aa393b595f22c6d8257a" name="gae8513e06aab8aa393b595f22c6d8257a"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gae8513e06aab8aa393b595f22c6d8257a">◆ </a></span>GLFW_MOUSE_BUTTON_6</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_MOUSE_BUTTON_6   5</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga8b02a1ab55dde45b3a3883d54ffd7dc7" name="ga8b02a1ab55dde45b3a3883d54ffd7dc7"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga8b02a1ab55dde45b3a3883d54ffd7dc7">◆ </a></span>GLFW_MOUSE_BUTTON_7</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_MOUSE_BUTTON_7   6</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga35d5c4263e0dc0d0a4731ca6c562f32c" name="ga35d5c4263e0dc0d0a4731ca6c562f32c"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga35d5c4263e0dc0d0a4731ca6c562f32c">◆ </a></span>GLFW_MOUSE_BUTTON_8</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_MOUSE_BUTTON_8   7</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gab1fd86a4518a9141ec7bcde2e15a2fdf" name="gab1fd86a4518a9141ec7bcde2e15a2fdf"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gab1fd86a4518a9141ec7bcde2e15a2fdf">◆ </a></span>GLFW_MOUSE_BUTTON_LAST</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_MOUSE_BUTTON_LAST   <a class="el" href="group__buttons.html#ga35d5c4263e0dc0d0a4731ca6c562f32c">GLFW_MOUSE_BUTTON_8</a></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gaf37100431dcd5082d48f95ee8bc8cd56" name="gaf37100431dcd5082d48f95ee8bc8cd56"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gaf37100431dcd5082d48f95ee8bc8cd56">◆ </a></span>GLFW_MOUSE_BUTTON_LEFT</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_MOUSE_BUTTON_LEFT   <a class="el" href="group__buttons.html#ga181a6e875251fd8671654eff00f9112e">GLFW_MOUSE_BUTTON_1</a></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga3e2f2cf3c4942df73cc094247d275e74" name="ga3e2f2cf3c4942df73cc094247d275e74"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga3e2f2cf3c4942df73cc094247d275e74">◆ </a></span>GLFW_MOUSE_BUTTON_RIGHT</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_MOUSE_BUTTON_RIGHT   <a class="el" href="group__buttons.html#ga604b39b92c88ce9bd332e97fc3f4156c">GLFW_MOUSE_BUTTON_2</a></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga34a4d2a701434f763fd93a2ff842b95a" name="ga34a4d2a701434f763fd93a2ff842b95a"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga34a4d2a701434f763fd93a2ff842b95a">◆ </a></span>GLFW_MOUSE_BUTTON_MIDDLE</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_MOUSE_BUTTON_MIDDLE   <a class="el" href="group__buttons.html#ga0130d505563d0236a6f85545f19e1721">GLFW_MOUSE_BUTTON_3</a></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div><!-- contents -->
|
||||||
|
<address class="footer">
|
||||||
|
<p>
|
||||||
|
Last update on Fri Jul 22 2022 for GLFW 3.3.8
|
||||||
|
</p>
|
||||||
|
</address>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,295 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.9.4"/>
|
||||||
|
<title>GLFW: Context reference</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="extra.css" rel="stylesheet" type="text/css"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<div class="glfwheader">
|
||||||
|
<a href="https://www.glfw.org/" id="glfwhome">GLFW</a>
|
||||||
|
<ul class="glfwnavbar">
|
||||||
|
<li><a href="https://www.glfw.org/documentation.html">Documentation</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/download.html">Download</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/community.html">Community</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.9.4 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src="menudata.js"></script>
|
||||||
|
<script type="text/javascript" src="menu.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
$(function() {
|
||||||
|
initMenu('',true,false,'search.php','Search');
|
||||||
|
$(document).ready(function() { init_search(); });
|
||||||
|
});
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<div id="main-nav"></div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="header">
|
||||||
|
<div class="summary">
|
||||||
|
<a href="#typedef-members">Typedefs</a> |
|
||||||
|
<a href="#func-members">Functions</a> </div>
|
||||||
|
<div class="headertitle"><div class="title">Context reference</div></div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<a name="details" id="details"></a><h2 class="groupheader">Description</h2>
|
||||||
|
<p >This is the reference documentation for OpenGL and OpenGL ES context related functions. For more task-oriented information, see the <a class="el" href="context_guide.html">Context guide</a>. </p>
|
||||||
|
<table class="memberdecls">
|
||||||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="typedef-members" name="typedef-members"></a>
|
||||||
|
Typedefs</h2></td></tr>
|
||||||
|
<tr class="memitem:ga3d47c2d2fbe0be9c505d0e04e91a133c"><td class="memItemLeft" align="right" valign="top">typedef void(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__context.html#ga3d47c2d2fbe0be9c505d0e04e91a133c">GLFWglproc</a>) (void)</td></tr>
|
||||||
|
<tr class="memdesc:ga3d47c2d2fbe0be9c505d0e04e91a133c"><td class="mdescLeft"> </td><td class="mdescRight">Client API function pointer type. <a href="group__context.html#ga3d47c2d2fbe0be9c505d0e04e91a133c">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga3d47c2d2fbe0be9c505d0e04e91a133c"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
</table><table class="memberdecls">
|
||||||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
|
||||||
|
Functions</h2></td></tr>
|
||||||
|
<tr class="memitem:ga1c04dc242268f827290fe40aa1c91157"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__context.html#ga1c04dc242268f827290fe40aa1c91157">glfwMakeContextCurrent</a> (<a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> *window)</td></tr>
|
||||||
|
<tr class="memdesc:ga1c04dc242268f827290fe40aa1c91157"><td class="mdescLeft"> </td><td class="mdescRight">Makes the context of the specified window current for the calling thread. <a href="group__context.html#ga1c04dc242268f827290fe40aa1c91157">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga1c04dc242268f827290fe40aa1c91157"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gad94e80185397a6cf5fe2ab30567af71c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__context.html#gad94e80185397a6cf5fe2ab30567af71c">glfwGetCurrentContext</a> (void)</td></tr>
|
||||||
|
<tr class="memdesc:gad94e80185397a6cf5fe2ab30567af71c"><td class="mdescLeft"> </td><td class="mdescRight">Returns the window whose context is current on the calling thread. <a href="group__context.html#gad94e80185397a6cf5fe2ab30567af71c">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:gad94e80185397a6cf5fe2ab30567af71c"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga6d4e0cdf151b5e579bd67f13202994ed"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__context.html#ga6d4e0cdf151b5e579bd67f13202994ed">glfwSwapInterval</a> (int interval)</td></tr>
|
||||||
|
<tr class="memdesc:ga6d4e0cdf151b5e579bd67f13202994ed"><td class="mdescLeft"> </td><td class="mdescRight">Sets the swap interval for the current context. <a href="group__context.html#ga6d4e0cdf151b5e579bd67f13202994ed">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga6d4e0cdf151b5e579bd67f13202994ed"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga87425065c011cef1ebd6aac75e059dfa"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__context.html#ga87425065c011cef1ebd6aac75e059dfa">glfwExtensionSupported</a> (const char *extension)</td></tr>
|
||||||
|
<tr class="memdesc:ga87425065c011cef1ebd6aac75e059dfa"><td class="mdescLeft"> </td><td class="mdescRight">Returns whether the specified extension is available. <a href="group__context.html#ga87425065c011cef1ebd6aac75e059dfa">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga87425065c011cef1ebd6aac75e059dfa"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga35f1837e6f666781842483937612f163"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__context.html#ga3d47c2d2fbe0be9c505d0e04e91a133c">GLFWglproc</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__context.html#ga35f1837e6f666781842483937612f163">glfwGetProcAddress</a> (const char *procname)</td></tr>
|
||||||
|
<tr class="memdesc:ga35f1837e6f666781842483937612f163"><td class="mdescLeft"> </td><td class="mdescRight">Returns the address of the specified function for the current context. <a href="group__context.html#ga35f1837e6f666781842483937612f163">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga35f1837e6f666781842483937612f163"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
</table>
|
||||||
|
<h2 class="groupheader">Typedef Documentation</h2>
|
||||||
|
<a id="ga3d47c2d2fbe0be9c505d0e04e91a133c" name="ga3d47c2d2fbe0be9c505d0e04e91a133c"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga3d47c2d2fbe0be9c505d0e04e91a133c">◆ </a></span>GLFWglproc</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">typedef void(* GLFWglproc) (void)</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >Generic function pointer used for returning client API function pointers without forcing a cast from a regular pointer.</p>
|
||||||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="context_guide.html#context_glext">OpenGL and OpenGL ES extensions</a> </dd>
|
||||||
|
<dd>
|
||||||
|
<a class="el" href="group__context.html#ga35f1837e6f666781842483937612f163">glfwGetProcAddress</a></dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.0. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<h2 class="groupheader">Function Documentation</h2>
|
||||||
|
<a id="ga1c04dc242268f827290fe40aa1c91157" name="ga1c04dc242268f827290fe40aa1c91157"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga1c04dc242268f827290fe40aa1c91157">◆ </a></span>glfwMakeContextCurrent()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">void glfwMakeContextCurrent </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype"><a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> * </td>
|
||||||
|
<td class="paramname"><em>window</em></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >This function makes the OpenGL or OpenGL ES context of the specified window current on the calling thread. 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.</p>
|
||||||
|
<p >When moving a context between threads, you must make it non-current on the old thread before making it current on the new one.</p>
|
||||||
|
<p >By default, making a context non-current implicitly forces a pipeline flush. On machines that support <code>GL_KHR_context_flush_control</code>, you can control whether a context performs this flush by setting the <a class="el" href="window_guide.html#GLFW_CONTEXT_RELEASE_BEHAVIOR_hint">GLFW_CONTEXT_RELEASE_BEHAVIOR</a> hint.</p>
|
||||||
|
<p >The specified window must have an OpenGL or OpenGL ES context. Specifying a window without a context will generate a <a class="el" href="group__errors.html#gacff24d2757da752ae4c80bf452356487">GLFW_NO_WINDOW_CONTEXT</a> error.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramdir">[in]</td><td class="paramname">window</td><td>The window whose context to make current, or <code>NULL</code> to detach the current context.</td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a>, <a class="el" href="group__errors.html#gacff24d2757da752ae4c80bf452356487">GLFW_NO_WINDOW_CONTEXT</a> and <a class="el" href="group__errors.html#gad44162d78100ea5e87cdd38426b8c7a1">GLFW_PLATFORM_ERROR</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function may be called from any thread.</dd></dl>
|
||||||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="context_guide.html#context_current">Current context</a> </dd>
|
||||||
|
<dd>
|
||||||
|
<a class="el" href="group__context.html#gad94e80185397a6cf5fe2ab30567af71c">glfwGetCurrentContext</a></dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.0. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gad94e80185397a6cf5fe2ab30567af71c" name="gad94e80185397a6cf5fe2ab30567af71c"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gad94e80185397a6cf5fe2ab30567af71c">◆ </a></span>glfwGetCurrentContext()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname"><a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> * glfwGetCurrentContext </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">void </td>
|
||||||
|
<td class="paramname"></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >This function returns the window whose OpenGL or OpenGL ES context is current on the calling thread.</p>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>The window whose context is current, or <code>NULL</code> if no window's context is current.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function may be called from any thread.</dd></dl>
|
||||||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="context_guide.html#context_current">Current context</a> </dd>
|
||||||
|
<dd>
|
||||||
|
<a class="el" href="group__context.html#ga1c04dc242268f827290fe40aa1c91157">glfwMakeContextCurrent</a></dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.0. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga6d4e0cdf151b5e579bd67f13202994ed" name="ga6d4e0cdf151b5e579bd67f13202994ed"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga6d4e0cdf151b5e579bd67f13202994ed">◆ </a></span>glfwSwapInterval()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">void glfwSwapInterval </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">int </td>
|
||||||
|
<td class="paramname"><em>interval</em></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >This function sets the swap interval for the current OpenGL or OpenGL ES context, i.e. the number of screen updates to wait from the time <a class="el" href="group__window.html#ga15a5a1ee5b3c2ca6b15ca209a12efd14">glfwSwapBuffers</a> was called before swapping the buffers and returning. This is sometimes called <em>vertical synchronization</em>, <em>vertical retrace synchronization</em> or just <em>vsync</em>.</p>
|
||||||
|
<p >A context that supports either of the <code>WGL_EXT_swap_control_tear</code> and <code>GLX_EXT_swap_control_tear</code> extensions also accepts <em>negative</em> 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 <a class="el" href="group__context.html#ga87425065c011cef1ebd6aac75e059dfa">glfwExtensionSupported</a>.</p>
|
||||||
|
<p >A context must be current on the calling thread. Calling this function without a current context will cause a <a class="el" href="group__errors.html#gaa8290386e9528ccb9e42a3a4e16fc0d0">GLFW_NO_CURRENT_CONTEXT</a> error.</p>
|
||||||
|
<p >This function does not apply to Vulkan. If you are rendering with Vulkan, see the present mode of your swapchain instead.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramdir">[in]</td><td class="paramname">interval</td><td>The minimum number of screen updates to wait for until the buffers are swapped by <a class="el" href="group__window.html#ga15a5a1ee5b3c2ca6b15ca209a12efd14">glfwSwapBuffers</a>.</td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a>, <a class="el" href="group__errors.html#gaa8290386e9528ccb9e42a3a4e16fc0d0">GLFW_NO_CURRENT_CONTEXT</a> and <a class="el" href="group__errors.html#gad44162d78100ea5e87cdd38426b8c7a1">GLFW_PLATFORM_ERROR</a>.</dd></dl>
|
||||||
|
<dl class="section remark"><dt>Remarks</dt><dd>This function is not called during context creation, leaving the swap interval set to whatever is the default on that platform. 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.</dd>
|
||||||
|
<dd>
|
||||||
|
Some GPU drivers do not honor the requested swap interval, either because of a user setting that overrides the application's request or due to bugs in the driver.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function may be called from any thread.</dd></dl>
|
||||||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="window_guide.html#buffer_swap">Buffer swapping</a> </dd>
|
||||||
|
<dd>
|
||||||
|
<a class="el" href="group__window.html#ga15a5a1ee5b3c2ca6b15ca209a12efd14">glfwSwapBuffers</a></dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 1.0. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga87425065c011cef1ebd6aac75e059dfa" name="ga87425065c011cef1ebd6aac75e059dfa"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga87425065c011cef1ebd6aac75e059dfa">◆ </a></span>glfwExtensionSupported()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">int glfwExtensionSupported </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">const char * </td>
|
||||||
|
<td class="paramname"><em>extension</em></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >This function returns whether the specified <a class="el" href="context_guide.html#context_glext">API extension</a> is supported by the current OpenGL or OpenGL ES context. It searches both for client API extension and context creation API extensions.</p>
|
||||||
|
<p >A context must be current on the calling thread. Calling this function without a current context will cause a <a class="el" href="group__errors.html#gaa8290386e9528ccb9e42a3a4e16fc0d0">GLFW_NO_CURRENT_CONTEXT</a> error.</p>
|
||||||
|
<p >As this functions retrieves and searches one or more extension strings each call, it is recommended that you cache its results if it is going to be used frequently. The extension strings will not change during the lifetime of a context, so there is no danger in doing this.</p>
|
||||||
|
<p >This function does not apply to Vulkan. If you are using Vulkan, see <a class="el" href="group__vulkan.html#ga99ad342d82f4a3421e2864978cb6d1d6">glfwGetRequiredInstanceExtensions</a>, <code>vkEnumerateInstanceExtensionProperties</code> and <code>vkEnumerateDeviceExtensionProperties</code> instead.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramdir">[in]</td><td class="paramname">extension</td><td>The ASCII encoded name of the extension. </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd><code>GLFW_TRUE</code> if the extension is available, or <code>GLFW_FALSE</code> otherwise.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a>, <a class="el" href="group__errors.html#gaa8290386e9528ccb9e42a3a4e16fc0d0">GLFW_NO_CURRENT_CONTEXT</a>, <a class="el" href="group__errors.html#gaaf2ef9aa8202c2b82ac2d921e554c687">GLFW_INVALID_VALUE</a> and <a class="el" href="group__errors.html#gad44162d78100ea5e87cdd38426b8c7a1">GLFW_PLATFORM_ERROR</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function may be called from any thread.</dd></dl>
|
||||||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="context_guide.html#context_glext">OpenGL and OpenGL ES extensions</a> </dd>
|
||||||
|
<dd>
|
||||||
|
<a class="el" href="group__context.html#ga35f1837e6f666781842483937612f163">glfwGetProcAddress</a></dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 1.0. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga35f1837e6f666781842483937612f163" name="ga35f1837e6f666781842483937612f163"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga35f1837e6f666781842483937612f163">◆ </a></span>glfwGetProcAddress()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname"><a class="el" href="group__context.html#ga3d47c2d2fbe0be9c505d0e04e91a133c">GLFWglproc</a> glfwGetProcAddress </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">const char * </td>
|
||||||
|
<td class="paramname"><em>procname</em></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >This function returns the address of the specified OpenGL or OpenGL ES <a class="el" href="context_guide.html#context_glext">core or extension function</a>, if it is supported by the current context.</p>
|
||||||
|
<p >A context must be current on the calling thread. Calling this function without a current context will cause a <a class="el" href="group__errors.html#gaa8290386e9528ccb9e42a3a4e16fc0d0">GLFW_NO_CURRENT_CONTEXT</a> error.</p>
|
||||||
|
<p >This function does not apply to Vulkan. If you are rendering with Vulkan, see <a class="el" href="group__vulkan.html#gadf228fac94c5fd8f12423ec9af9ff1e9">glfwGetInstanceProcAddress</a>, <code>vkGetInstanceProcAddr</code> and <code>vkGetDeviceProcAddr</code> instead.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramdir">[in]</td><td class="paramname">procname</td><td>The ASCII encoded name of the function. </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>The address of the function, or <code>NULL</code> if an <a class="el" href="intro_guide.html#error_handling">error</a> occurred.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a>, <a class="el" href="group__errors.html#gaa8290386e9528ccb9e42a3a4e16fc0d0">GLFW_NO_CURRENT_CONTEXT</a> and <a class="el" href="group__errors.html#gad44162d78100ea5e87cdd38426b8c7a1">GLFW_PLATFORM_ERROR</a>.</dd></dl>
|
||||||
|
<dl class="section remark"><dt>Remarks</dt><dd>The address of a given function is not guaranteed to be the same between contexts.</dd>
|
||||||
|
<dd>
|
||||||
|
This function may return a non-<code>NULL</code> address despite the associated version or extension not being available. Always check the context version or extension string first.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Pointer lifetime</dt><dd>The returned function pointer is valid until the context is destroyed or the library is terminated.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function may be called from any thread.</dd></dl>
|
||||||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="context_guide.html#context_glext">OpenGL and OpenGL ES extensions</a> </dd>
|
||||||
|
<dd>
|
||||||
|
<a class="el" href="group__context.html#ga87425065c011cef1ebd6aac75e059dfa">glfwExtensionSupported</a></dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 1.0. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div><!-- contents -->
|
||||||
|
<address class="footer">
|
||||||
|
<p>
|
||||||
|
Last update on Fri Jul 22 2022 for GLFW 3.3.8
|
||||||
|
</p>
|
||||||
|
</address>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,297 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.9.4"/>
|
||||||
|
<title>GLFW: Error codes</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="extra.css" rel="stylesheet" type="text/css"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<div class="glfwheader">
|
||||||
|
<a href="https://www.glfw.org/" id="glfwhome">GLFW</a>
|
||||||
|
<ul class="glfwnavbar">
|
||||||
|
<li><a href="https://www.glfw.org/documentation.html">Documentation</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/download.html">Download</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/community.html">Community</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.9.4 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src="menudata.js"></script>
|
||||||
|
<script type="text/javascript" src="menu.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
$(function() {
|
||||||
|
initMenu('',true,false,'search.php','Search');
|
||||||
|
$(document).ready(function() { init_search(); });
|
||||||
|
});
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<div id="main-nav"></div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="header">
|
||||||
|
<div class="summary">
|
||||||
|
<a href="#define-members">Macros</a> </div>
|
||||||
|
<div class="headertitle"><div class="title">Error codes<div class="ingroups"><a class="el" href="group__init.html">Initialization, version and error reference</a></div></div></div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<a name="details" id="details"></a><h2 class="groupheader">Description</h2>
|
||||||
|
<p >See <a class="el" href="intro_guide.html#error_handling">error handling</a> for how these are used. </p>
|
||||||
|
<table class="memberdecls">
|
||||||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
|
||||||
|
Macros</h2></td></tr>
|
||||||
|
<tr class="memitem:gafa30deee5db4d69c4c93d116ed87dbf4"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__errors.html#gafa30deee5db4d69c4c93d116ed87dbf4">GLFW_NO_ERROR</a>   0</td></tr>
|
||||||
|
<tr class="memdesc:gafa30deee5db4d69c4c93d116ed87dbf4"><td class="mdescLeft"> </td><td class="mdescRight">No error has occurred. <a href="group__errors.html#gafa30deee5db4d69c4c93d116ed87dbf4">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:gafa30deee5db4d69c4c93d116ed87dbf4"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga2374ee02c177f12e1fa76ff3ed15e14a"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a>   0x00010001</td></tr>
|
||||||
|
<tr class="memdesc:ga2374ee02c177f12e1fa76ff3ed15e14a"><td class="mdescLeft"> </td><td class="mdescRight">GLFW has not been initialized. <a href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga2374ee02c177f12e1fa76ff3ed15e14a"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gaa8290386e9528ccb9e42a3a4e16fc0d0"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__errors.html#gaa8290386e9528ccb9e42a3a4e16fc0d0">GLFW_NO_CURRENT_CONTEXT</a>   0x00010002</td></tr>
|
||||||
|
<tr class="memdesc:gaa8290386e9528ccb9e42a3a4e16fc0d0"><td class="mdescLeft"> </td><td class="mdescRight">No context is current for this thread. <a href="group__errors.html#gaa8290386e9528ccb9e42a3a4e16fc0d0">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:gaa8290386e9528ccb9e42a3a4e16fc0d0"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga76f6bb9c4eea73db675f096b404593ce"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__errors.html#ga76f6bb9c4eea73db675f096b404593ce">GLFW_INVALID_ENUM</a>   0x00010003</td></tr>
|
||||||
|
<tr class="memdesc:ga76f6bb9c4eea73db675f096b404593ce"><td class="mdescLeft"> </td><td class="mdescRight">One of the arguments to the function was an invalid enum value. <a href="group__errors.html#ga76f6bb9c4eea73db675f096b404593ce">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga76f6bb9c4eea73db675f096b404593ce"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gaaf2ef9aa8202c2b82ac2d921e554c687"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__errors.html#gaaf2ef9aa8202c2b82ac2d921e554c687">GLFW_INVALID_VALUE</a>   0x00010004</td></tr>
|
||||||
|
<tr class="memdesc:gaaf2ef9aa8202c2b82ac2d921e554c687"><td class="mdescLeft"> </td><td class="mdescRight">One of the arguments to the function was an invalid value. <a href="group__errors.html#gaaf2ef9aa8202c2b82ac2d921e554c687">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:gaaf2ef9aa8202c2b82ac2d921e554c687"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga9023953a2bcb98c2906afd071d21ee7f"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__errors.html#ga9023953a2bcb98c2906afd071d21ee7f">GLFW_OUT_OF_MEMORY</a>   0x00010005</td></tr>
|
||||||
|
<tr class="memdesc:ga9023953a2bcb98c2906afd071d21ee7f"><td class="mdescLeft"> </td><td class="mdescRight">A memory allocation failed. <a href="group__errors.html#ga9023953a2bcb98c2906afd071d21ee7f">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga9023953a2bcb98c2906afd071d21ee7f"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga56882b290db23261cc6c053c40c2d08e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__errors.html#ga56882b290db23261cc6c053c40c2d08e">GLFW_API_UNAVAILABLE</a>   0x00010006</td></tr>
|
||||||
|
<tr class="memdesc:ga56882b290db23261cc6c053c40c2d08e"><td class="mdescLeft"> </td><td class="mdescRight">GLFW could not find support for the requested API on the system. <a href="group__errors.html#ga56882b290db23261cc6c053c40c2d08e">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga56882b290db23261cc6c053c40c2d08e"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gad16c5565b4a69f9c2a9ac2c0dbc89462"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__errors.html#gad16c5565b4a69f9c2a9ac2c0dbc89462">GLFW_VERSION_UNAVAILABLE</a>   0x00010007</td></tr>
|
||||||
|
<tr class="memdesc:gad16c5565b4a69f9c2a9ac2c0dbc89462"><td class="mdescLeft"> </td><td class="mdescRight">The requested OpenGL or OpenGL ES version is not available. <a href="group__errors.html#gad16c5565b4a69f9c2a9ac2c0dbc89462">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:gad16c5565b4a69f9c2a9ac2c0dbc89462"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gad44162d78100ea5e87cdd38426b8c7a1"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__errors.html#gad44162d78100ea5e87cdd38426b8c7a1">GLFW_PLATFORM_ERROR</a>   0x00010008</td></tr>
|
||||||
|
<tr class="memdesc:gad44162d78100ea5e87cdd38426b8c7a1"><td class="mdescLeft"> </td><td class="mdescRight">A platform-specific error occurred that does not match any of the more specific categories. <a href="group__errors.html#gad44162d78100ea5e87cdd38426b8c7a1">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:gad44162d78100ea5e87cdd38426b8c7a1"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga196e125ef261d94184e2b55c05762f14"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__errors.html#ga196e125ef261d94184e2b55c05762f14">GLFW_FORMAT_UNAVAILABLE</a>   0x00010009</td></tr>
|
||||||
|
<tr class="memdesc:ga196e125ef261d94184e2b55c05762f14"><td class="mdescLeft"> </td><td class="mdescRight">The requested format is not supported or available. <a href="group__errors.html#ga196e125ef261d94184e2b55c05762f14">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga196e125ef261d94184e2b55c05762f14"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gacff24d2757da752ae4c80bf452356487"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__errors.html#gacff24d2757da752ae4c80bf452356487">GLFW_NO_WINDOW_CONTEXT</a>   0x0001000A</td></tr>
|
||||||
|
<tr class="memdesc:gacff24d2757da752ae4c80bf452356487"><td class="mdescLeft"> </td><td class="mdescRight">The specified window does not have an OpenGL or OpenGL ES context. <a href="group__errors.html#gacff24d2757da752ae4c80bf452356487">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:gacff24d2757da752ae4c80bf452356487"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
</table>
|
||||||
|
<h2 class="groupheader">Macro Definition Documentation</h2>
|
||||||
|
<a id="gafa30deee5db4d69c4c93d116ed87dbf4" name="gafa30deee5db4d69c4c93d116ed87dbf4"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gafa30deee5db4d69c4c93d116ed87dbf4">◆ </a></span>GLFW_NO_ERROR</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_NO_ERROR   0</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >No error has occurred.</p>
|
||||||
|
<dl class="section user"><dt>Analysis</dt><dd>Yay. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga2374ee02c177f12e1fa76ff3ed15e14a" name="ga2374ee02c177f12e1fa76ff3ed15e14a"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga2374ee02c177f12e1fa76ff3ed15e14a">◆ </a></span>GLFW_NOT_INITIALIZED</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_NOT_INITIALIZED   0x00010001</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >This occurs if a GLFW function was called that must not be called unless the library is <a class="el" href="intro_guide.html#intro_init">initialized</a>.</p>
|
||||||
|
<dl class="section user"><dt>Analysis</dt><dd>Application programmer error. Initialize GLFW before calling any function that requires initialization. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gaa8290386e9528ccb9e42a3a4e16fc0d0" name="gaa8290386e9528ccb9e42a3a4e16fc0d0"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gaa8290386e9528ccb9e42a3a4e16fc0d0">◆ </a></span>GLFW_NO_CURRENT_CONTEXT</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_NO_CURRENT_CONTEXT   0x00010002</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >This occurs if a GLFW function was called that needs and operates on the current OpenGL or OpenGL ES context but no context is current on the calling thread. One such function is <a class="el" href="group__context.html#ga6d4e0cdf151b5e579bd67f13202994ed">glfwSwapInterval</a>.</p>
|
||||||
|
<dl class="section user"><dt>Analysis</dt><dd>Application programmer error. Ensure a context is current before calling functions that require a current context. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga76f6bb9c4eea73db675f096b404593ce" name="ga76f6bb9c4eea73db675f096b404593ce"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga76f6bb9c4eea73db675f096b404593ce">◆ </a></span>GLFW_INVALID_ENUM</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_INVALID_ENUM   0x00010003</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >One of the arguments to the function was an invalid enum value, for example requesting <a class="el" href="window_guide.html#GLFW_RED_BITS">GLFW_RED_BITS</a> with <a class="el" href="group__window.html#gacccb29947ea4b16860ebef42c2cb9337">glfwGetWindowAttrib</a>.</p>
|
||||||
|
<dl class="section user"><dt>Analysis</dt><dd>Application programmer error. Fix the offending call. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gaaf2ef9aa8202c2b82ac2d921e554c687" name="gaaf2ef9aa8202c2b82ac2d921e554c687"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gaaf2ef9aa8202c2b82ac2d921e554c687">◆ </a></span>GLFW_INVALID_VALUE</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_INVALID_VALUE   0x00010004</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >One of the arguments to the function was an invalid value, for example requesting a non-existent OpenGL or OpenGL ES version like 2.7.</p>
|
||||||
|
<p >Requesting a valid but unavailable OpenGL or OpenGL ES version will instead result in a <a class="el" href="group__errors.html#gad16c5565b4a69f9c2a9ac2c0dbc89462">GLFW_VERSION_UNAVAILABLE</a> error.</p>
|
||||||
|
<dl class="section user"><dt>Analysis</dt><dd>Application programmer error. Fix the offending call. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga9023953a2bcb98c2906afd071d21ee7f" name="ga9023953a2bcb98c2906afd071d21ee7f"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga9023953a2bcb98c2906afd071d21ee7f">◆ </a></span>GLFW_OUT_OF_MEMORY</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_OUT_OF_MEMORY   0x00010005</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >A memory allocation failed.</p>
|
||||||
|
<dl class="section user"><dt>Analysis</dt><dd>A bug in GLFW or the underlying operating system. Report the bug to our <a href="https://github.com/glfw/glfw/issues">issue tracker</a>. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga56882b290db23261cc6c053c40c2d08e" name="ga56882b290db23261cc6c053c40c2d08e"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga56882b290db23261cc6c053c40c2d08e">◆ </a></span>GLFW_API_UNAVAILABLE</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_API_UNAVAILABLE   0x00010006</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >GLFW could not find support for the requested API on the system.</p>
|
||||||
|
<dl class="section user"><dt>Analysis</dt><dd>The installed graphics driver does not support the requested API, or does not support it via the chosen context creation backend. Below are a few examples.</dd></dl>
|
||||||
|
<dl class="section user"><dt></dt><dd>Some pre-installed Windows graphics drivers do not support OpenGL. AMD only supports OpenGL ES via EGL, while Nvidia and Intel only support it via a WGL or GLX extension. macOS does not provide OpenGL ES at all. The Mesa EGL, OpenGL and OpenGL ES libraries do not interface with the Nvidia binary driver. Older graphics drivers do not support Vulkan. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gad16c5565b4a69f9c2a9ac2c0dbc89462" name="gad16c5565b4a69f9c2a9ac2c0dbc89462"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gad16c5565b4a69f9c2a9ac2c0dbc89462">◆ </a></span>GLFW_VERSION_UNAVAILABLE</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_VERSION_UNAVAILABLE   0x00010007</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >The requested OpenGL or OpenGL ES version (including any requested context or framebuffer hints) is not available on this machine.</p>
|
||||||
|
<dl class="section user"><dt>Analysis</dt><dd>The machine does not support your requirements. If your application is sufficiently flexible, downgrade your requirements and try again. Otherwise, inform the user that their machine does not match your requirements.</dd></dl>
|
||||||
|
<dl class="section user"><dt></dt><dd>Future invalid OpenGL and OpenGL ES versions, for example OpenGL 4.8 if 5.0 comes out before the 4.x series gets that far, also fail with this error and not <a class="el" href="group__errors.html#gaaf2ef9aa8202c2b82ac2d921e554c687">GLFW_INVALID_VALUE</a>, because GLFW cannot know what future versions will exist. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gad44162d78100ea5e87cdd38426b8c7a1" name="gad44162d78100ea5e87cdd38426b8c7a1"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gad44162d78100ea5e87cdd38426b8c7a1">◆ </a></span>GLFW_PLATFORM_ERROR</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_PLATFORM_ERROR   0x00010008</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >A platform-specific error occurred that does not match any of the more specific categories.</p>
|
||||||
|
<dl class="section user"><dt>Analysis</dt><dd>A bug or configuration error in GLFW, the underlying operating system or its drivers, or a lack of required resources. Report the issue to our <a href="https://github.com/glfw/glfw/issues">issue tracker</a>. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga196e125ef261d94184e2b55c05762f14" name="ga196e125ef261d94184e2b55c05762f14"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga196e125ef261d94184e2b55c05762f14">◆ </a></span>GLFW_FORMAT_UNAVAILABLE</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_FORMAT_UNAVAILABLE   0x00010009</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >If emitted during window creation, the requested pixel format is not supported.</p>
|
||||||
|
<p >If emitted when querying the clipboard, the contents of the clipboard could not be converted to the requested format.</p>
|
||||||
|
<dl class="section user"><dt>Analysis</dt><dd>If emitted during window creation, one or more <a class="el" href="window_guide.html#window_hints_hard">hard constraints</a> did not match any of the available pixel formats. If your application is sufficiently flexible, downgrade your requirements and try again. Otherwise, inform the user that their machine does not match your requirements.</dd></dl>
|
||||||
|
<dl class="section user"><dt></dt><dd>If emitted when querying the clipboard, ignore the error or report it to the user, as appropriate. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gacff24d2757da752ae4c80bf452356487" name="gacff24d2757da752ae4c80bf452356487"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gacff24d2757da752ae4c80bf452356487">◆ </a></span>GLFW_NO_WINDOW_CONTEXT</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_NO_WINDOW_CONTEXT   0x0001000A</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >A window that does not have an OpenGL or OpenGL ES context was passed to a function that requires it to have one.</p>
|
||||||
|
<dl class="section user"><dt>Analysis</dt><dd>Application programmer error. Fix the offending call. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div><!-- contents -->
|
||||||
|
<address class="footer">
|
||||||
|
<p>
|
||||||
|
Last update on Fri Jul 22 2022 for GLFW 3.3.8
|
||||||
|
</p>
|
||||||
|
</address>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,195 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.9.4"/>
|
||||||
|
<title>GLFW: Gamepad axes</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="extra.css" rel="stylesheet" type="text/css"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<div class="glfwheader">
|
||||||
|
<a href="https://www.glfw.org/" id="glfwhome">GLFW</a>
|
||||||
|
<ul class="glfwnavbar">
|
||||||
|
<li><a href="https://www.glfw.org/documentation.html">Documentation</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/download.html">Download</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/community.html">Community</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.9.4 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src="menudata.js"></script>
|
||||||
|
<script type="text/javascript" src="menu.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
$(function() {
|
||||||
|
initMenu('',true,false,'search.php','Search');
|
||||||
|
$(document).ready(function() { init_search(); });
|
||||||
|
});
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<div id="main-nav"></div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="header">
|
||||||
|
<div class="summary">
|
||||||
|
<a href="#define-members">Macros</a> </div>
|
||||||
|
<div class="headertitle"><div class="title">Gamepad axes<div class="ingroups"><a class="el" href="group__input.html">Input reference</a></div></div></div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<a name="details" id="details"></a><h2 class="groupheader">Description</h2>
|
||||||
|
<p >See <a class="el" href="input_guide.html#gamepad">Gamepad input</a> for how these are used. </p>
|
||||||
|
<table class="memberdecls">
|
||||||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
|
||||||
|
Macros</h2></td></tr>
|
||||||
|
<tr class="memitem:ga544e396d092036a7d80c1e5f233f7a38"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__gamepad__axes.html#ga544e396d092036a7d80c1e5f233f7a38">GLFW_GAMEPAD_AXIS_LEFT_X</a>   0</td></tr>
|
||||||
|
<tr class="separator:ga544e396d092036a7d80c1e5f233f7a38"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga64dcf2c6e9be50b7c556ff7671996dd5"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__gamepad__axes.html#ga64dcf2c6e9be50b7c556ff7671996dd5">GLFW_GAMEPAD_AXIS_LEFT_Y</a>   1</td></tr>
|
||||||
|
<tr class="separator:ga64dcf2c6e9be50b7c556ff7671996dd5"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gabd6785106cd3c5a044a6e49a395ee2fc"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__gamepad__axes.html#gabd6785106cd3c5a044a6e49a395ee2fc">GLFW_GAMEPAD_AXIS_RIGHT_X</a>   2</td></tr>
|
||||||
|
<tr class="separator:gabd6785106cd3c5a044a6e49a395ee2fc"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga1cc20566d44d521b7183681a8e88e2e4"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__gamepad__axes.html#ga1cc20566d44d521b7183681a8e88e2e4">GLFW_GAMEPAD_AXIS_RIGHT_Y</a>   3</td></tr>
|
||||||
|
<tr class="separator:ga1cc20566d44d521b7183681a8e88e2e4"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga6d79561dd8907c37354426242901b86e"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__gamepad__axes.html#ga6d79561dd8907c37354426242901b86e">GLFW_GAMEPAD_AXIS_LEFT_TRIGGER</a>   4</td></tr>
|
||||||
|
<tr class="separator:ga6d79561dd8907c37354426242901b86e"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga121a7d5d20589a423cd1634dd6ee6eab"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__gamepad__axes.html#ga121a7d5d20589a423cd1634dd6ee6eab">GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER</a>   5</td></tr>
|
||||||
|
<tr class="separator:ga121a7d5d20589a423cd1634dd6ee6eab"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga0818fd9433e1359692b7443293e5ac86"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__gamepad__axes.html#ga0818fd9433e1359692b7443293e5ac86">GLFW_GAMEPAD_AXIS_LAST</a>   <a class="el" href="group__gamepad__axes.html#ga121a7d5d20589a423cd1634dd6ee6eab">GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER</a></td></tr>
|
||||||
|
<tr class="separator:ga0818fd9433e1359692b7443293e5ac86"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
</table>
|
||||||
|
<h2 class="groupheader">Macro Definition Documentation</h2>
|
||||||
|
<a id="ga544e396d092036a7d80c1e5f233f7a38" name="ga544e396d092036a7d80c1e5f233f7a38"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga544e396d092036a7d80c1e5f233f7a38">◆ </a></span>GLFW_GAMEPAD_AXIS_LEFT_X</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_GAMEPAD_AXIS_LEFT_X   0</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga64dcf2c6e9be50b7c556ff7671996dd5" name="ga64dcf2c6e9be50b7c556ff7671996dd5"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga64dcf2c6e9be50b7c556ff7671996dd5">◆ </a></span>GLFW_GAMEPAD_AXIS_LEFT_Y</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_GAMEPAD_AXIS_LEFT_Y   1</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gabd6785106cd3c5a044a6e49a395ee2fc" name="gabd6785106cd3c5a044a6e49a395ee2fc"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gabd6785106cd3c5a044a6e49a395ee2fc">◆ </a></span>GLFW_GAMEPAD_AXIS_RIGHT_X</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_GAMEPAD_AXIS_RIGHT_X   2</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga1cc20566d44d521b7183681a8e88e2e4" name="ga1cc20566d44d521b7183681a8e88e2e4"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga1cc20566d44d521b7183681a8e88e2e4">◆ </a></span>GLFW_GAMEPAD_AXIS_RIGHT_Y</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_GAMEPAD_AXIS_RIGHT_Y   3</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga6d79561dd8907c37354426242901b86e" name="ga6d79561dd8907c37354426242901b86e"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga6d79561dd8907c37354426242901b86e">◆ </a></span>GLFW_GAMEPAD_AXIS_LEFT_TRIGGER</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_GAMEPAD_AXIS_LEFT_TRIGGER   4</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga121a7d5d20589a423cd1634dd6ee6eab" name="ga121a7d5d20589a423cd1634dd6ee6eab"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga121a7d5d20589a423cd1634dd6ee6eab">◆ </a></span>GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER   5</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga0818fd9433e1359692b7443293e5ac86" name="ga0818fd9433e1359692b7443293e5ac86"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga0818fd9433e1359692b7443293e5ac86">◆ </a></span>GLFW_GAMEPAD_AXIS_LAST</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_GAMEPAD_AXIS_LAST   <a class="el" href="group__gamepad__axes.html#ga121a7d5d20589a423cd1634dd6ee6eab">GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER</a></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div><!-- contents -->
|
||||||
|
<address class="footer">
|
||||||
|
<p>
|
||||||
|
Last update on Fri Jul 22 2022 for GLFW 3.3.8
|
||||||
|
</p>
|
||||||
|
</address>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,403 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.9.4"/>
|
||||||
|
<title>GLFW: Gamepad buttons</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="extra.css" rel="stylesheet" type="text/css"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<div class="glfwheader">
|
||||||
|
<a href="https://www.glfw.org/" id="glfwhome">GLFW</a>
|
||||||
|
<ul class="glfwnavbar">
|
||||||
|
<li><a href="https://www.glfw.org/documentation.html">Documentation</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/download.html">Download</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/community.html">Community</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.9.4 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src="menudata.js"></script>
|
||||||
|
<script type="text/javascript" src="menu.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
$(function() {
|
||||||
|
initMenu('',true,false,'search.php','Search');
|
||||||
|
$(document).ready(function() { init_search(); });
|
||||||
|
});
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<div id="main-nav"></div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="header">
|
||||||
|
<div class="summary">
|
||||||
|
<a href="#define-members">Macros</a> </div>
|
||||||
|
<div class="headertitle"><div class="title">Gamepad buttons<div class="ingroups"><a class="el" href="group__input.html">Input reference</a></div></div></div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<a name="details" id="details"></a><h2 class="groupheader">Description</h2>
|
||||||
|
<p >See <a class="el" href="input_guide.html#gamepad">Gamepad input</a> for how these are used. </p>
|
||||||
|
<table class="memberdecls">
|
||||||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
|
||||||
|
Macros</h2></td></tr>
|
||||||
|
<tr class="memitem:gae055a12fbf4b48b5954c8e1cd129b810"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__gamepad__buttons.html#gae055a12fbf4b48b5954c8e1cd129b810">GLFW_GAMEPAD_BUTTON_A</a>   0</td></tr>
|
||||||
|
<tr class="separator:gae055a12fbf4b48b5954c8e1cd129b810"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga2228a6512fd5950cdb51ba07846546fa"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__gamepad__buttons.html#ga2228a6512fd5950cdb51ba07846546fa">GLFW_GAMEPAD_BUTTON_B</a>   1</td></tr>
|
||||||
|
<tr class="separator:ga2228a6512fd5950cdb51ba07846546fa"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga52cc94785cf3fe9a12e246539259887c"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__gamepad__buttons.html#ga52cc94785cf3fe9a12e246539259887c">GLFW_GAMEPAD_BUTTON_X</a>   2</td></tr>
|
||||||
|
<tr class="separator:ga52cc94785cf3fe9a12e246539259887c"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gafc931248bda494b530cbe057f386a5ed"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__gamepad__buttons.html#gafc931248bda494b530cbe057f386a5ed">GLFW_GAMEPAD_BUTTON_Y</a>   3</td></tr>
|
||||||
|
<tr class="separator:gafc931248bda494b530cbe057f386a5ed"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga17d67b4f39a39d6b813bd1567a3507c3"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__gamepad__buttons.html#ga17d67b4f39a39d6b813bd1567a3507c3">GLFW_GAMEPAD_BUTTON_LEFT_BUMPER</a>   4</td></tr>
|
||||||
|
<tr class="separator:ga17d67b4f39a39d6b813bd1567a3507c3"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gadfbc9ea9bf3aae896b79fa49fdc85c7f"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__gamepad__buttons.html#gadfbc9ea9bf3aae896b79fa49fdc85c7f">GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER</a>   5</td></tr>
|
||||||
|
<tr class="separator:gadfbc9ea9bf3aae896b79fa49fdc85c7f"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gabc7c0264ce778835b516a472b47f6caf"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__gamepad__buttons.html#gabc7c0264ce778835b516a472b47f6caf">GLFW_GAMEPAD_BUTTON_BACK</a>   6</td></tr>
|
||||||
|
<tr class="separator:gabc7c0264ce778835b516a472b47f6caf"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga04606949dd9139434b8a1bedf4ac1021"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__gamepad__buttons.html#ga04606949dd9139434b8a1bedf4ac1021">GLFW_GAMEPAD_BUTTON_START</a>   7</td></tr>
|
||||||
|
<tr class="separator:ga04606949dd9139434b8a1bedf4ac1021"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga7fa48c32e5b2f5db2f080aa0b8b573dc"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__gamepad__buttons.html#ga7fa48c32e5b2f5db2f080aa0b8b573dc">GLFW_GAMEPAD_BUTTON_GUIDE</a>   8</td></tr>
|
||||||
|
<tr class="separator:ga7fa48c32e5b2f5db2f080aa0b8b573dc"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga3e089787327454f7bfca7364d6ca206a"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__gamepad__buttons.html#ga3e089787327454f7bfca7364d6ca206a">GLFW_GAMEPAD_BUTTON_LEFT_THUMB</a>   9</td></tr>
|
||||||
|
<tr class="separator:ga3e089787327454f7bfca7364d6ca206a"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga1c003f52b5aebb45272475b48953b21a"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__gamepad__buttons.html#ga1c003f52b5aebb45272475b48953b21a">GLFW_GAMEPAD_BUTTON_RIGHT_THUMB</a>   10</td></tr>
|
||||||
|
<tr class="separator:ga1c003f52b5aebb45272475b48953b21a"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga4f1ed6f974a47bc8930d4874a283476a"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__gamepad__buttons.html#ga4f1ed6f974a47bc8930d4874a283476a">GLFW_GAMEPAD_BUTTON_DPAD_UP</a>   11</td></tr>
|
||||||
|
<tr class="separator:ga4f1ed6f974a47bc8930d4874a283476a"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gae2a780d2a8c79e0b77c0b7b601ca57c6"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__gamepad__buttons.html#gae2a780d2a8c79e0b77c0b7b601ca57c6">GLFW_GAMEPAD_BUTTON_DPAD_RIGHT</a>   12</td></tr>
|
||||||
|
<tr class="separator:gae2a780d2a8c79e0b77c0b7b601ca57c6"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga8f2b731b97d80f90f11967a83207665c"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__gamepad__buttons.html#ga8f2b731b97d80f90f11967a83207665c">GLFW_GAMEPAD_BUTTON_DPAD_DOWN</a>   13</td></tr>
|
||||||
|
<tr class="separator:ga8f2b731b97d80f90f11967a83207665c"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gaf0697e0e8607b2ebe1c93b0c6befe301"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__gamepad__buttons.html#gaf0697e0e8607b2ebe1c93b0c6befe301">GLFW_GAMEPAD_BUTTON_DPAD_LEFT</a>   14</td></tr>
|
||||||
|
<tr class="separator:gaf0697e0e8607b2ebe1c93b0c6befe301"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga5cc98882f4f81dacf761639a567f61eb"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__gamepad__buttons.html#ga5cc98882f4f81dacf761639a567f61eb">GLFW_GAMEPAD_BUTTON_LAST</a>   <a class="el" href="group__gamepad__buttons.html#gaf0697e0e8607b2ebe1c93b0c6befe301">GLFW_GAMEPAD_BUTTON_DPAD_LEFT</a></td></tr>
|
||||||
|
<tr class="separator:ga5cc98882f4f81dacf761639a567f61eb"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gaf08d0df26527c9305253422bd98ed63a"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__gamepad__buttons.html#gaf08d0df26527c9305253422bd98ed63a">GLFW_GAMEPAD_BUTTON_CROSS</a>   <a class="el" href="group__gamepad__buttons.html#gae055a12fbf4b48b5954c8e1cd129b810">GLFW_GAMEPAD_BUTTON_A</a></td></tr>
|
||||||
|
<tr class="separator:gaf08d0df26527c9305253422bd98ed63a"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gaaef094b3dacbf15f272b274516839b82"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__gamepad__buttons.html#gaaef094b3dacbf15f272b274516839b82">GLFW_GAMEPAD_BUTTON_CIRCLE</a>   <a class="el" href="group__gamepad__buttons.html#ga2228a6512fd5950cdb51ba07846546fa">GLFW_GAMEPAD_BUTTON_B</a></td></tr>
|
||||||
|
<tr class="separator:gaaef094b3dacbf15f272b274516839b82"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gafc7821e87d77d41ed2cd3e1f726ec35f"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__gamepad__buttons.html#gafc7821e87d77d41ed2cd3e1f726ec35f">GLFW_GAMEPAD_BUTTON_SQUARE</a>   <a class="el" href="group__gamepad__buttons.html#ga52cc94785cf3fe9a12e246539259887c">GLFW_GAMEPAD_BUTTON_X</a></td></tr>
|
||||||
|
<tr class="separator:gafc7821e87d77d41ed2cd3e1f726ec35f"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga3a7ef6bcb768a08cd3bf142f7f09f802"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__gamepad__buttons.html#ga3a7ef6bcb768a08cd3bf142f7f09f802">GLFW_GAMEPAD_BUTTON_TRIANGLE</a>   <a class="el" href="group__gamepad__buttons.html#gafc931248bda494b530cbe057f386a5ed">GLFW_GAMEPAD_BUTTON_Y</a></td></tr>
|
||||||
|
<tr class="separator:ga3a7ef6bcb768a08cd3bf142f7f09f802"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
</table>
|
||||||
|
<h2 class="groupheader">Macro Definition Documentation</h2>
|
||||||
|
<a id="gae055a12fbf4b48b5954c8e1cd129b810" name="gae055a12fbf4b48b5954c8e1cd129b810"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gae055a12fbf4b48b5954c8e1cd129b810">◆ </a></span>GLFW_GAMEPAD_BUTTON_A</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_GAMEPAD_BUTTON_A   0</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga2228a6512fd5950cdb51ba07846546fa" name="ga2228a6512fd5950cdb51ba07846546fa"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga2228a6512fd5950cdb51ba07846546fa">◆ </a></span>GLFW_GAMEPAD_BUTTON_B</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_GAMEPAD_BUTTON_B   1</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga52cc94785cf3fe9a12e246539259887c" name="ga52cc94785cf3fe9a12e246539259887c"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga52cc94785cf3fe9a12e246539259887c">◆ </a></span>GLFW_GAMEPAD_BUTTON_X</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_GAMEPAD_BUTTON_X   2</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gafc931248bda494b530cbe057f386a5ed" name="gafc931248bda494b530cbe057f386a5ed"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gafc931248bda494b530cbe057f386a5ed">◆ </a></span>GLFW_GAMEPAD_BUTTON_Y</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_GAMEPAD_BUTTON_Y   3</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga17d67b4f39a39d6b813bd1567a3507c3" name="ga17d67b4f39a39d6b813bd1567a3507c3"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga17d67b4f39a39d6b813bd1567a3507c3">◆ </a></span>GLFW_GAMEPAD_BUTTON_LEFT_BUMPER</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_GAMEPAD_BUTTON_LEFT_BUMPER   4</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gadfbc9ea9bf3aae896b79fa49fdc85c7f" name="gadfbc9ea9bf3aae896b79fa49fdc85c7f"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gadfbc9ea9bf3aae896b79fa49fdc85c7f">◆ </a></span>GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER   5</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gabc7c0264ce778835b516a472b47f6caf" name="gabc7c0264ce778835b516a472b47f6caf"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gabc7c0264ce778835b516a472b47f6caf">◆ </a></span>GLFW_GAMEPAD_BUTTON_BACK</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_GAMEPAD_BUTTON_BACK   6</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga04606949dd9139434b8a1bedf4ac1021" name="ga04606949dd9139434b8a1bedf4ac1021"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga04606949dd9139434b8a1bedf4ac1021">◆ </a></span>GLFW_GAMEPAD_BUTTON_START</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_GAMEPAD_BUTTON_START   7</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga7fa48c32e5b2f5db2f080aa0b8b573dc" name="ga7fa48c32e5b2f5db2f080aa0b8b573dc"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga7fa48c32e5b2f5db2f080aa0b8b573dc">◆ </a></span>GLFW_GAMEPAD_BUTTON_GUIDE</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_GAMEPAD_BUTTON_GUIDE   8</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga3e089787327454f7bfca7364d6ca206a" name="ga3e089787327454f7bfca7364d6ca206a"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga3e089787327454f7bfca7364d6ca206a">◆ </a></span>GLFW_GAMEPAD_BUTTON_LEFT_THUMB</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_GAMEPAD_BUTTON_LEFT_THUMB   9</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga1c003f52b5aebb45272475b48953b21a" name="ga1c003f52b5aebb45272475b48953b21a"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga1c003f52b5aebb45272475b48953b21a">◆ </a></span>GLFW_GAMEPAD_BUTTON_RIGHT_THUMB</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_GAMEPAD_BUTTON_RIGHT_THUMB   10</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga4f1ed6f974a47bc8930d4874a283476a" name="ga4f1ed6f974a47bc8930d4874a283476a"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga4f1ed6f974a47bc8930d4874a283476a">◆ </a></span>GLFW_GAMEPAD_BUTTON_DPAD_UP</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_GAMEPAD_BUTTON_DPAD_UP   11</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gae2a780d2a8c79e0b77c0b7b601ca57c6" name="gae2a780d2a8c79e0b77c0b7b601ca57c6"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gae2a780d2a8c79e0b77c0b7b601ca57c6">◆ </a></span>GLFW_GAMEPAD_BUTTON_DPAD_RIGHT</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_GAMEPAD_BUTTON_DPAD_RIGHT   12</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga8f2b731b97d80f90f11967a83207665c" name="ga8f2b731b97d80f90f11967a83207665c"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga8f2b731b97d80f90f11967a83207665c">◆ </a></span>GLFW_GAMEPAD_BUTTON_DPAD_DOWN</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_GAMEPAD_BUTTON_DPAD_DOWN   13</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gaf0697e0e8607b2ebe1c93b0c6befe301" name="gaf0697e0e8607b2ebe1c93b0c6befe301"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gaf0697e0e8607b2ebe1c93b0c6befe301">◆ </a></span>GLFW_GAMEPAD_BUTTON_DPAD_LEFT</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_GAMEPAD_BUTTON_DPAD_LEFT   14</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga5cc98882f4f81dacf761639a567f61eb" name="ga5cc98882f4f81dacf761639a567f61eb"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga5cc98882f4f81dacf761639a567f61eb">◆ </a></span>GLFW_GAMEPAD_BUTTON_LAST</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_GAMEPAD_BUTTON_LAST   <a class="el" href="group__gamepad__buttons.html#gaf0697e0e8607b2ebe1c93b0c6befe301">GLFW_GAMEPAD_BUTTON_DPAD_LEFT</a></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gaf08d0df26527c9305253422bd98ed63a" name="gaf08d0df26527c9305253422bd98ed63a"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gaf08d0df26527c9305253422bd98ed63a">◆ </a></span>GLFW_GAMEPAD_BUTTON_CROSS</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_GAMEPAD_BUTTON_CROSS   <a class="el" href="group__gamepad__buttons.html#gae055a12fbf4b48b5954c8e1cd129b810">GLFW_GAMEPAD_BUTTON_A</a></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gaaef094b3dacbf15f272b274516839b82" name="gaaef094b3dacbf15f272b274516839b82"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gaaef094b3dacbf15f272b274516839b82">◆ </a></span>GLFW_GAMEPAD_BUTTON_CIRCLE</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_GAMEPAD_BUTTON_CIRCLE   <a class="el" href="group__gamepad__buttons.html#ga2228a6512fd5950cdb51ba07846546fa">GLFW_GAMEPAD_BUTTON_B</a></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gafc7821e87d77d41ed2cd3e1f726ec35f" name="gafc7821e87d77d41ed2cd3e1f726ec35f"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gafc7821e87d77d41ed2cd3e1f726ec35f">◆ </a></span>GLFW_GAMEPAD_BUTTON_SQUARE</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_GAMEPAD_BUTTON_SQUARE   <a class="el" href="group__gamepad__buttons.html#ga52cc94785cf3fe9a12e246539259887c">GLFW_GAMEPAD_BUTTON_X</a></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga3a7ef6bcb768a08cd3bf142f7f09f802" name="ga3a7ef6bcb768a08cd3bf142f7f09f802"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga3a7ef6bcb768a08cd3bf142f7f09f802">◆ </a></span>GLFW_GAMEPAD_BUTTON_TRIANGLE</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_GAMEPAD_BUTTON_TRIANGLE   <a class="el" href="group__gamepad__buttons.html#gafc931248bda494b530cbe057f386a5ed">GLFW_GAMEPAD_BUTTON_Y</a></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div><!-- contents -->
|
||||||
|
<address class="footer">
|
||||||
|
<p>
|
||||||
|
Last update on Fri Jul 22 2022 for GLFW 3.3.8
|
||||||
|
</p>
|
||||||
|
</address>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,227 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.9.4"/>
|
||||||
|
<title>GLFW: Joystick hat states</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="extra.css" rel="stylesheet" type="text/css"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<div class="glfwheader">
|
||||||
|
<a href="https://www.glfw.org/" id="glfwhome">GLFW</a>
|
||||||
|
<ul class="glfwnavbar">
|
||||||
|
<li><a href="https://www.glfw.org/documentation.html">Documentation</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/download.html">Download</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/community.html">Community</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.9.4 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src="menudata.js"></script>
|
||||||
|
<script type="text/javascript" src="menu.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
$(function() {
|
||||||
|
initMenu('',true,false,'search.php','Search');
|
||||||
|
$(document).ready(function() { init_search(); });
|
||||||
|
});
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<div id="main-nav"></div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="header">
|
||||||
|
<div class="summary">
|
||||||
|
<a href="#define-members">Macros</a> </div>
|
||||||
|
<div class="headertitle"><div class="title">Joystick hat states<div class="ingroups"><a class="el" href="group__input.html">Input reference</a></div></div></div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<a name="details" id="details"></a><h2 class="groupheader">Description</h2>
|
||||||
|
<p >See <a class="el" href="input_guide.html#joystick_hat">joystick hat input</a> for how these are used. </p>
|
||||||
|
<table class="memberdecls">
|
||||||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
|
||||||
|
Macros</h2></td></tr>
|
||||||
|
<tr class="memitem:gae2c0bcb7aec609e4736437554f6638fd"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hat__state.html#gae2c0bcb7aec609e4736437554f6638fd">GLFW_HAT_CENTERED</a>   0</td></tr>
|
||||||
|
<tr class="separator:gae2c0bcb7aec609e4736437554f6638fd"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga8c9720c76cd1b912738159ed74c85b36"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hat__state.html#ga8c9720c76cd1b912738159ed74c85b36">GLFW_HAT_UP</a>   1</td></tr>
|
||||||
|
<tr class="separator:ga8c9720c76cd1b912738159ed74c85b36"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga252586e3bbde75f4b0e07ad3124867f5"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hat__state.html#ga252586e3bbde75f4b0e07ad3124867f5">GLFW_HAT_RIGHT</a>   2</td></tr>
|
||||||
|
<tr class="separator:ga252586e3bbde75f4b0e07ad3124867f5"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gad60d1fd0dc85c18f2642cbae96d3deff"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hat__state.html#gad60d1fd0dc85c18f2642cbae96d3deff">GLFW_HAT_DOWN</a>   4</td></tr>
|
||||||
|
<tr class="separator:gad60d1fd0dc85c18f2642cbae96d3deff"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gac775f4b3154fdf5db93eb432ba546dff"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hat__state.html#gac775f4b3154fdf5db93eb432ba546dff">GLFW_HAT_LEFT</a>   8</td></tr>
|
||||||
|
<tr class="separator:gac775f4b3154fdf5db93eb432ba546dff"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga94aea0ae241a8b902883536c592ee693"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hat__state.html#ga94aea0ae241a8b902883536c592ee693">GLFW_HAT_RIGHT_UP</a>   (<a class="el" href="group__hat__state.html#ga252586e3bbde75f4b0e07ad3124867f5">GLFW_HAT_RIGHT</a> | <a class="el" href="group__hat__state.html#ga8c9720c76cd1b912738159ed74c85b36">GLFW_HAT_UP</a>)</td></tr>
|
||||||
|
<tr class="separator:ga94aea0ae241a8b902883536c592ee693"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gad7f0e4f52fd68d734863aaeadab3a3f5"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hat__state.html#gad7f0e4f52fd68d734863aaeadab3a3f5">GLFW_HAT_RIGHT_DOWN</a>   (<a class="el" href="group__hat__state.html#ga252586e3bbde75f4b0e07ad3124867f5">GLFW_HAT_RIGHT</a> | <a class="el" href="group__hat__state.html#gad60d1fd0dc85c18f2642cbae96d3deff">GLFW_HAT_DOWN</a>)</td></tr>
|
||||||
|
<tr class="separator:gad7f0e4f52fd68d734863aaeadab3a3f5"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga638f0e20dc5de90de21a33564e8ce129"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hat__state.html#ga638f0e20dc5de90de21a33564e8ce129">GLFW_HAT_LEFT_UP</a>   (<a class="el" href="group__hat__state.html#gac775f4b3154fdf5db93eb432ba546dff">GLFW_HAT_LEFT</a> | <a class="el" href="group__hat__state.html#ga8c9720c76cd1b912738159ed74c85b36">GLFW_HAT_UP</a>)</td></tr>
|
||||||
|
<tr class="separator:ga638f0e20dc5de90de21a33564e8ce129"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga76c02baf1ea345fcbe3e8ff176a73e19"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__hat__state.html#ga76c02baf1ea345fcbe3e8ff176a73e19">GLFW_HAT_LEFT_DOWN</a>   (<a class="el" href="group__hat__state.html#gac775f4b3154fdf5db93eb432ba546dff">GLFW_HAT_LEFT</a> | <a class="el" href="group__hat__state.html#gad60d1fd0dc85c18f2642cbae96d3deff">GLFW_HAT_DOWN</a>)</td></tr>
|
||||||
|
<tr class="separator:ga76c02baf1ea345fcbe3e8ff176a73e19"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
</table>
|
||||||
|
<h2 class="groupheader">Macro Definition Documentation</h2>
|
||||||
|
<a id="gae2c0bcb7aec609e4736437554f6638fd" name="gae2c0bcb7aec609e4736437554f6638fd"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gae2c0bcb7aec609e4736437554f6638fd">◆ </a></span>GLFW_HAT_CENTERED</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_HAT_CENTERED   0</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga8c9720c76cd1b912738159ed74c85b36" name="ga8c9720c76cd1b912738159ed74c85b36"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga8c9720c76cd1b912738159ed74c85b36">◆ </a></span>GLFW_HAT_UP</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_HAT_UP   1</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga252586e3bbde75f4b0e07ad3124867f5" name="ga252586e3bbde75f4b0e07ad3124867f5"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga252586e3bbde75f4b0e07ad3124867f5">◆ </a></span>GLFW_HAT_RIGHT</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_HAT_RIGHT   2</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gad60d1fd0dc85c18f2642cbae96d3deff" name="gad60d1fd0dc85c18f2642cbae96d3deff"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gad60d1fd0dc85c18f2642cbae96d3deff">◆ </a></span>GLFW_HAT_DOWN</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_HAT_DOWN   4</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gac775f4b3154fdf5db93eb432ba546dff" name="gac775f4b3154fdf5db93eb432ba546dff"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gac775f4b3154fdf5db93eb432ba546dff">◆ </a></span>GLFW_HAT_LEFT</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_HAT_LEFT   8</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga94aea0ae241a8b902883536c592ee693" name="ga94aea0ae241a8b902883536c592ee693"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga94aea0ae241a8b902883536c592ee693">◆ </a></span>GLFW_HAT_RIGHT_UP</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_HAT_RIGHT_UP   (<a class="el" href="group__hat__state.html#ga252586e3bbde75f4b0e07ad3124867f5">GLFW_HAT_RIGHT</a> | <a class="el" href="group__hat__state.html#ga8c9720c76cd1b912738159ed74c85b36">GLFW_HAT_UP</a>)</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gad7f0e4f52fd68d734863aaeadab3a3f5" name="gad7f0e4f52fd68d734863aaeadab3a3f5"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gad7f0e4f52fd68d734863aaeadab3a3f5">◆ </a></span>GLFW_HAT_RIGHT_DOWN</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_HAT_RIGHT_DOWN   (<a class="el" href="group__hat__state.html#ga252586e3bbde75f4b0e07ad3124867f5">GLFW_HAT_RIGHT</a> | <a class="el" href="group__hat__state.html#gad60d1fd0dc85c18f2642cbae96d3deff">GLFW_HAT_DOWN</a>)</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga638f0e20dc5de90de21a33564e8ce129" name="ga638f0e20dc5de90de21a33564e8ce129"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga638f0e20dc5de90de21a33564e8ce129">◆ </a></span>GLFW_HAT_LEFT_UP</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_HAT_LEFT_UP   (<a class="el" href="group__hat__state.html#gac775f4b3154fdf5db93eb432ba546dff">GLFW_HAT_LEFT</a> | <a class="el" href="group__hat__state.html#ga8c9720c76cd1b912738159ed74c85b36">GLFW_HAT_UP</a>)</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga76c02baf1ea345fcbe3e8ff176a73e19" name="ga76c02baf1ea345fcbe3e8ff176a73e19"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga76c02baf1ea345fcbe3e8ff176a73e19">◆ </a></span>GLFW_HAT_LEFT_DOWN</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_HAT_LEFT_DOWN   (<a class="el" href="group__hat__state.html#gac775f4b3154fdf5db93eb432ba546dff">GLFW_HAT_LEFT</a> | <a class="el" href="group__hat__state.html#gad60d1fd0dc85c18f2642cbae96d3deff">GLFW_HAT_DOWN</a>)</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div><!-- contents -->
|
||||||
|
<address class="footer">
|
||||||
|
<p>
|
||||||
|
Last update on Fri Jul 22 2022 for GLFW 3.3.8
|
||||||
|
</p>
|
||||||
|
</address>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,545 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.9.4"/>
|
||||||
|
<title>GLFW: Initialization, version and error reference</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="extra.css" rel="stylesheet" type="text/css"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<div class="glfwheader">
|
||||||
|
<a href="https://www.glfw.org/" id="glfwhome">GLFW</a>
|
||||||
|
<ul class="glfwnavbar">
|
||||||
|
<li><a href="https://www.glfw.org/documentation.html">Documentation</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/download.html">Download</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/community.html">Community</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.9.4 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src="menudata.js"></script>
|
||||||
|
<script type="text/javascript" src="menu.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
$(function() {
|
||||||
|
initMenu('',true,false,'search.php','Search');
|
||||||
|
$(document).ready(function() { init_search(); });
|
||||||
|
});
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<div id="main-nav"></div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="header">
|
||||||
|
<div class="summary">
|
||||||
|
<a href="#groups">Modules</a> |
|
||||||
|
<a href="#define-members">Macros</a> |
|
||||||
|
<a href="#typedef-members">Typedefs</a> |
|
||||||
|
<a href="#func-members">Functions</a> </div>
|
||||||
|
<div class="headertitle"><div class="title">Initialization, version and error reference</div></div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<a name="details" id="details"></a><h2 class="groupheader">Description</h2>
|
||||||
|
<p >This is the reference documentation for initialization and termination of the library, version management and error handling. For more task-oriented information, see the <a class="el" href="intro_guide.html">Introduction to the API</a>. </p>
|
||||||
|
<table class="memberdecls">
|
||||||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="groups" name="groups"></a>
|
||||||
|
Modules</h2></td></tr>
|
||||||
|
<tr class="memitem:group__errors"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__errors.html">Error codes</a></td></tr>
|
||||||
|
<tr class="memdesc:group__errors"><td class="mdescLeft"> </td><td class="mdescRight">Error codes. <br /></td></tr>
|
||||||
|
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
</table><table class="memberdecls">
|
||||||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
|
||||||
|
Macros</h2></td></tr>
|
||||||
|
<tr class="memitem:ga2744fbb29b5631bb28802dbe0cf36eba"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__init.html#ga2744fbb29b5631bb28802dbe0cf36eba">GLFW_TRUE</a>   1</td></tr>
|
||||||
|
<tr class="memdesc:ga2744fbb29b5631bb28802dbe0cf36eba"><td class="mdescLeft"> </td><td class="mdescRight">One. <a href="group__init.html#ga2744fbb29b5631bb28802dbe0cf36eba">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga2744fbb29b5631bb28802dbe0cf36eba"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gac877fe3b627d21ef3a0a23e0a73ba8c5"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__init.html#gac877fe3b627d21ef3a0a23e0a73ba8c5">GLFW_FALSE</a>   0</td></tr>
|
||||||
|
<tr class="memdesc:gac877fe3b627d21ef3a0a23e0a73ba8c5"><td class="mdescLeft"> </td><td class="mdescRight">Zero. <a href="group__init.html#gac877fe3b627d21ef3a0a23e0a73ba8c5">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:gac877fe3b627d21ef3a0a23e0a73ba8c5"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gab9c0534709fda03ec8959201da3a9a18"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__init.html#gab9c0534709fda03ec8959201da3a9a18">GLFW_JOYSTICK_HAT_BUTTONS</a>   0x00050001</td></tr>
|
||||||
|
<tr class="memdesc:gab9c0534709fda03ec8959201da3a9a18"><td class="mdescLeft"> </td><td class="mdescRight">Joystick hat buttons init hint. <a href="group__init.html#gab9c0534709fda03ec8959201da3a9a18">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:gab9c0534709fda03ec8959201da3a9a18"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gab937983147a3158d45f88fad7129d9f2"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__init.html#gab937983147a3158d45f88fad7129d9f2">GLFW_COCOA_CHDIR_RESOURCES</a>   0x00051001</td></tr>
|
||||||
|
<tr class="memdesc:gab937983147a3158d45f88fad7129d9f2"><td class="mdescLeft"> </td><td class="mdescRight">macOS specific init hint. <a href="group__init.html#gab937983147a3158d45f88fad7129d9f2">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:gab937983147a3158d45f88fad7129d9f2"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga71e0b4ce2f2696a84a9b8c5e12dc70cf"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__init.html#ga71e0b4ce2f2696a84a9b8c5e12dc70cf">GLFW_COCOA_MENUBAR</a>   0x00051002</td></tr>
|
||||||
|
<tr class="memdesc:ga71e0b4ce2f2696a84a9b8c5e12dc70cf"><td class="mdescLeft"> </td><td class="mdescRight">macOS specific init hint. <a href="group__init.html#ga71e0b4ce2f2696a84a9b8c5e12dc70cf">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga71e0b4ce2f2696a84a9b8c5e12dc70cf"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
</table><table class="memberdecls">
|
||||||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="typedef-members" name="typedef-members"></a>
|
||||||
|
Typedefs</h2></td></tr>
|
||||||
|
<tr class="memitem:ga8184701785c096b3862a75cda1bf44a3"><td class="memItemLeft" align="right" valign="top">typedef void(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__init.html#ga8184701785c096b3862a75cda1bf44a3">GLFWerrorfun</a>) (int error_code, const char *description)</td></tr>
|
||||||
|
<tr class="memdesc:ga8184701785c096b3862a75cda1bf44a3"><td class="mdescLeft"> </td><td class="mdescRight">The function pointer type for error callbacks. <a href="group__init.html#ga8184701785c096b3862a75cda1bf44a3">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga8184701785c096b3862a75cda1bf44a3"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
</table><table class="memberdecls">
|
||||||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
|
||||||
|
Functions</h2></td></tr>
|
||||||
|
<tr class="memitem:ga317aac130a235ab08c6db0834907d85e"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__init.html#ga317aac130a235ab08c6db0834907d85e">glfwInit</a> (void)</td></tr>
|
||||||
|
<tr class="memdesc:ga317aac130a235ab08c6db0834907d85e"><td class="mdescLeft"> </td><td class="mdescRight">Initializes the GLFW library. <a href="group__init.html#ga317aac130a235ab08c6db0834907d85e">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga317aac130a235ab08c6db0834907d85e"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gaaae48c0a18607ea4a4ba951d939f0901"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__init.html#gaaae48c0a18607ea4a4ba951d939f0901">glfwTerminate</a> (void)</td></tr>
|
||||||
|
<tr class="memdesc:gaaae48c0a18607ea4a4ba951d939f0901"><td class="mdescLeft"> </td><td class="mdescRight">Terminates the GLFW library. <a href="group__init.html#gaaae48c0a18607ea4a4ba951d939f0901">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:gaaae48c0a18607ea4a4ba951d939f0901"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga110fd1d3f0412822b4f1908c026f724a"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__init.html#ga110fd1d3f0412822b4f1908c026f724a">glfwInitHint</a> (int hint, int value)</td></tr>
|
||||||
|
<tr class="memdesc:ga110fd1d3f0412822b4f1908c026f724a"><td class="mdescLeft"> </td><td class="mdescRight">Sets the specified init hint to the desired value. <a href="group__init.html#ga110fd1d3f0412822b4f1908c026f724a">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga110fd1d3f0412822b4f1908c026f724a"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga9f8ffaacf3c269cc48eafbf8b9b71197"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__init.html#ga9f8ffaacf3c269cc48eafbf8b9b71197">glfwGetVersion</a> (int *major, int *minor, int *rev)</td></tr>
|
||||||
|
<tr class="memdesc:ga9f8ffaacf3c269cc48eafbf8b9b71197"><td class="mdescLeft"> </td><td class="mdescRight">Retrieves the version of the GLFW library. <a href="group__init.html#ga9f8ffaacf3c269cc48eafbf8b9b71197">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga9f8ffaacf3c269cc48eafbf8b9b71197"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga026abd003c8e6501981ab1662062f1c0"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__init.html#ga026abd003c8e6501981ab1662062f1c0">glfwGetVersionString</a> (void)</td></tr>
|
||||||
|
<tr class="memdesc:ga026abd003c8e6501981ab1662062f1c0"><td class="mdescLeft"> </td><td class="mdescRight">Returns a string describing the compile-time configuration. <a href="group__init.html#ga026abd003c8e6501981ab1662062f1c0">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga026abd003c8e6501981ab1662062f1c0"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga944986b4ec0b928d488141f92982aa18"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__init.html#ga944986b4ec0b928d488141f92982aa18">glfwGetError</a> (const char **description)</td></tr>
|
||||||
|
<tr class="memdesc:ga944986b4ec0b928d488141f92982aa18"><td class="mdescLeft"> </td><td class="mdescRight">Returns and clears the last error for the calling thread. <a href="group__init.html#ga944986b4ec0b928d488141f92982aa18">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga944986b4ec0b928d488141f92982aa18"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gaff45816610d53f0b83656092a4034f40"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__init.html#ga8184701785c096b3862a75cda1bf44a3">GLFWerrorfun</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__init.html#gaff45816610d53f0b83656092a4034f40">glfwSetErrorCallback</a> (<a class="el" href="group__init.html#ga8184701785c096b3862a75cda1bf44a3">GLFWerrorfun</a> callback)</td></tr>
|
||||||
|
<tr class="memdesc:gaff45816610d53f0b83656092a4034f40"><td class="mdescLeft"> </td><td class="mdescRight">Sets the error callback. <a href="group__init.html#gaff45816610d53f0b83656092a4034f40">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:gaff45816610d53f0b83656092a4034f40"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
</table>
|
||||||
|
<h2 class="groupheader">Macro Definition Documentation</h2>
|
||||||
|
<a id="ga6337d9ea43b22fc529b2bba066b4a576" name="ga6337d9ea43b22fc529b2bba066b4a576"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga6337d9ea43b22fc529b2bba066b4a576">◆ </a></span>GLFW_VERSION_MAJOR</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_VERSION_MAJOR   3</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >The major version number of the GLFW header. This is incremented when the API is changed in non-compatible ways. </p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gaf80d40f0aea7088ff337606e9c48f7a3" name="gaf80d40f0aea7088ff337606e9c48f7a3"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gaf80d40f0aea7088ff337606e9c48f7a3">◆ </a></span>GLFW_VERSION_MINOR</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_VERSION_MINOR   3</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >The minor version number of the GLFW header. This is incremented when features are added to the API but it remains backward-compatible. </p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gab72ae2e2035d9ea461abc3495eac0502" name="gab72ae2e2035d9ea461abc3495eac0502"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gab72ae2e2035d9ea461abc3495eac0502">◆ </a></span>GLFW_VERSION_REVISION</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_VERSION_REVISION   8</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >The revision number of the GLFW header. This is incremented when a bug fix release is made that does not contain any API changes. </p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga2744fbb29b5631bb28802dbe0cf36eba" name="ga2744fbb29b5631bb28802dbe0cf36eba"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga2744fbb29b5631bb28802dbe0cf36eba">◆ </a></span>GLFW_TRUE</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_TRUE   1</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >This is only semantic sugar for the number 1. You can instead use <code>1</code> or <code>true</code> or <code>_True</code> or <code>GL_TRUE</code> or <code>VK_TRUE</code> or anything else that is equal to one. </p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gac877fe3b627d21ef3a0a23e0a73ba8c5" name="gac877fe3b627d21ef3a0a23e0a73ba8c5"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gac877fe3b627d21ef3a0a23e0a73ba8c5">◆ </a></span>GLFW_FALSE</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_FALSE   0</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >This is only semantic sugar for the number 0. You can instead use <code>0</code> or <code>false</code> or <code>_False</code> or <code>GL_FALSE</code> or <code>VK_FALSE</code> or anything else that is equal to zero. </p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gab9c0534709fda03ec8959201da3a9a18" name="gab9c0534709fda03ec8959201da3a9a18"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gab9c0534709fda03ec8959201da3a9a18">◆ </a></span>GLFW_JOYSTICK_HAT_BUTTONS</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_JOYSTICK_HAT_BUTTONS   0x00050001</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >Joystick hat buttons <a class="el" href="intro_guide.html#GLFW_JOYSTICK_HAT_BUTTONS">init hint</a>. </p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gab937983147a3158d45f88fad7129d9f2" name="gab937983147a3158d45f88fad7129d9f2"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gab937983147a3158d45f88fad7129d9f2">◆ </a></span>GLFW_COCOA_CHDIR_RESOURCES</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_COCOA_CHDIR_RESOURCES   0x00051001</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >macOS specific <a class="el" href="intro_guide.html#GLFW_COCOA_CHDIR_RESOURCES_hint">init hint</a>. </p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga71e0b4ce2f2696a84a9b8c5e12dc70cf" name="ga71e0b4ce2f2696a84a9b8c5e12dc70cf"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga71e0b4ce2f2696a84a9b8c5e12dc70cf">◆ </a></span>GLFW_COCOA_MENUBAR</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_COCOA_MENUBAR   0x00051002</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >macOS specific <a class="el" href="intro_guide.html#GLFW_COCOA_MENUBAR_hint">init hint</a>. </p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<h2 class="groupheader">Typedef Documentation</h2>
|
||||||
|
<a id="ga8184701785c096b3862a75cda1bf44a3" name="ga8184701785c096b3862a75cda1bf44a3"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga8184701785c096b3862a75cda1bf44a3">◆ </a></span>GLFWerrorfun</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">typedef void(* GLFWerrorfun) (int error_code, const char *description)</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >This is the function pointer type for error callbacks. An error callback function has the following signature: </p><div class="fragment"><div class="line"><span class="keywordtype">void</span> callback_name(<span class="keywordtype">int</span> error_code, <span class="keyword">const</span> <span class="keywordtype">char</span>* description)</div>
|
||||||
|
</div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramdir">[in]</td><td class="paramname">error_code</td><td>An <a class="el" href="group__errors.html">error code</a>. Future releases may add more error codes. </td></tr>
|
||||||
|
<tr><td class="paramdir">[in]</td><td class="paramname">description</td><td>A UTF-8 encoded string describing the error.</td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section user"><dt>Pointer lifetime</dt><dd>The error description string is valid until the callback function returns.</dd></dl>
|
||||||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="intro_guide.html#error_handling">Error handling</a> </dd>
|
||||||
|
<dd>
|
||||||
|
<a class="el" href="group__init.html#gaff45816610d53f0b83656092a4034f40">glfwSetErrorCallback</a></dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.0. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<h2 class="groupheader">Function Documentation</h2>
|
||||||
|
<a id="ga317aac130a235ab08c6db0834907d85e" name="ga317aac130a235ab08c6db0834907d85e"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga317aac130a235ab08c6db0834907d85e">◆ </a></span>glfwInit()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">int glfwInit </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">void </td>
|
||||||
|
<td class="paramname"></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >This function initializes the GLFW library. Before most GLFW functions can be used, GLFW must be initialized, and before an application terminates GLFW should be terminated in order to free any resources allocated during or after initialization.</p>
|
||||||
|
<p >If this function fails, it calls <a class="el" href="group__init.html#gaaae48c0a18607ea4a4ba951d939f0901">glfwTerminate</a> before returning. If it succeeds, you should call <a class="el" href="group__init.html#gaaae48c0a18607ea4a4ba951d939f0901">glfwTerminate</a> before the application exits.</p>
|
||||||
|
<p >Additional calls to this function after successful initialization but before termination will return <code>GLFW_TRUE</code> immediately.</p>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd><code>GLFW_TRUE</code> if successful, or <code>GLFW_FALSE</code> if an <a class="el" href="intro_guide.html#error_handling">error</a> occurred.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#gad44162d78100ea5e87cdd38426b8c7a1">GLFW_PLATFORM_ERROR</a>.</dd></dl>
|
||||||
|
<dl class="section remark"><dt>Remarks</dt><dd><b>macOS:</b> This function will change the current directory of the application to the <code>Contents/Resources</code> subdirectory of the application's bundle, if present. This can be disabled with the <a class="el" href="group__init.html#gab937983147a3158d45f88fad7129d9f2">GLFW_COCOA_CHDIR_RESOURCES</a> init hint.</dd>
|
||||||
|
<dd>
|
||||||
|
<b>X11:</b> This function will set the <code>LC_CTYPE</code> 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.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function must only be called from the main thread.</dd></dl>
|
||||||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="intro_guide.html#intro_init">Initialization and termination</a> </dd>
|
||||||
|
<dd>
|
||||||
|
<a class="el" href="group__init.html#gaaae48c0a18607ea4a4ba951d939f0901">glfwTerminate</a></dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 1.0. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gaaae48c0a18607ea4a4ba951d939f0901" name="gaaae48c0a18607ea4a4ba951d939f0901"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gaaae48c0a18607ea4a4ba951d939f0901">◆ </a></span>glfwTerminate()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">void glfwTerminate </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">void </td>
|
||||||
|
<td class="paramname"></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >This function destroys all remaining windows and cursors, restores any modified gamma ramps and frees any other allocated resources. Once this function is called, you must again call <a class="el" href="group__init.html#ga317aac130a235ab08c6db0834907d85e">glfwInit</a> successfully before you will be able to use most GLFW functions.</p>
|
||||||
|
<p >If GLFW has been successfully initialized, this function should be called before the application exits. If initialization fails, there is no need to call this function, as it is called by <a class="el" href="group__init.html#ga317aac130a235ab08c6db0834907d85e">glfwInit</a> before it returns failure.</p>
|
||||||
|
<p >This function has no effect if GLFW is not initialized.</p>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#gad44162d78100ea5e87cdd38426b8c7a1">GLFW_PLATFORM_ERROR</a>.</dd></dl>
|
||||||
|
<dl class="section remark"><dt>Remarks</dt><dd>This function may be called before <a class="el" href="group__init.html#ga317aac130a235ab08c6db0834907d85e">glfwInit</a>.</dd></dl>
|
||||||
|
<dl class="section warning"><dt>Warning</dt><dd>The contexts of any remaining windows must not be current on any other thread when this function is called.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Reentrancy</dt><dd>This function must not be called from a callback.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function must only be called from the main thread.</dd></dl>
|
||||||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="intro_guide.html#intro_init">Initialization and termination</a> </dd>
|
||||||
|
<dd>
|
||||||
|
<a class="el" href="group__init.html#ga317aac130a235ab08c6db0834907d85e">glfwInit</a></dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 1.0. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga110fd1d3f0412822b4f1908c026f724a" name="ga110fd1d3f0412822b4f1908c026f724a"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga110fd1d3f0412822b4f1908c026f724a">◆ </a></span>glfwInitHint()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">void glfwInitHint </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">int </td>
|
||||||
|
<td class="paramname"><em>hint</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">int </td>
|
||||||
|
<td class="paramname"><em>value</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >This function sets hints for the next initialization of GLFW.</p>
|
||||||
|
<p >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.</p>
|
||||||
|
<p >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.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramdir">[in]</td><td class="paramname">hint</td><td>The <a class="el" href="intro_guide.html#init_hints">init hint</a> to set. </td></tr>
|
||||||
|
<tr><td class="paramdir">[in]</td><td class="paramname">value</td><td>The new value of the init hint.</td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#ga76f6bb9c4eea73db675f096b404593ce">GLFW_INVALID_ENUM</a> and <a class="el" href="group__errors.html#gaaf2ef9aa8202c2b82ac2d921e554c687">GLFW_INVALID_VALUE</a>.</dd></dl>
|
||||||
|
<dl class="section remark"><dt>Remarks</dt><dd>This function may be called before <a class="el" href="group__init.html#ga317aac130a235ab08c6db0834907d85e">glfwInit</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function must only be called from the main thread.</dd></dl>
|
||||||
|
<dl class="section see"><dt>See also</dt><dd>init_hints </dd>
|
||||||
|
<dd>
|
||||||
|
<a class="el" href="group__init.html#ga317aac130a235ab08c6db0834907d85e" title="Initializes the GLFW library.">glfwInit</a></dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.3. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga9f8ffaacf3c269cc48eafbf8b9b71197" name="ga9f8ffaacf3c269cc48eafbf8b9b71197"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga9f8ffaacf3c269cc48eafbf8b9b71197">◆ </a></span>glfwGetVersion()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">void glfwGetVersion </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">int * </td>
|
||||||
|
<td class="paramname"><em>major</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">int * </td>
|
||||||
|
<td class="paramname"><em>minor</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">int * </td>
|
||||||
|
<td class="paramname"><em>rev</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >This function retrieves the major, minor and revision numbers of the GLFW library. It is intended for when you are using GLFW as a shared library and want to ensure that you are using the minimum required version.</p>
|
||||||
|
<p >Any or all of the version arguments may be <code>NULL</code>.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramdir">[out]</td><td class="paramname">major</td><td>Where to store the major version number, or <code>NULL</code>. </td></tr>
|
||||||
|
<tr><td class="paramdir">[out]</td><td class="paramname">minor</td><td>Where to store the minor version number, or <code>NULL</code>. </td></tr>
|
||||||
|
<tr><td class="paramdir">[out]</td><td class="paramname">rev</td><td>Where to store the revision number, or <code>NULL</code>.</td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>None.</dd></dl>
|
||||||
|
<dl class="section remark"><dt>Remarks</dt><dd>This function may be called before <a class="el" href="group__init.html#ga317aac130a235ab08c6db0834907d85e">glfwInit</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function may be called from any thread.</dd></dl>
|
||||||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="intro_guide.html#intro_version">Version management</a> </dd>
|
||||||
|
<dd>
|
||||||
|
<a class="el" href="group__init.html#ga026abd003c8e6501981ab1662062f1c0">glfwGetVersionString</a></dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 1.0. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga026abd003c8e6501981ab1662062f1c0" name="ga026abd003c8e6501981ab1662062f1c0"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga026abd003c8e6501981ab1662062f1c0">◆ </a></span>glfwGetVersionString()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">const char * glfwGetVersionString </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">void </td>
|
||||||
|
<td class="paramname"></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >This function returns the compile-time generated <a class="el" href="intro_guide.html#intro_version_string">version string</a> 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 <code>glGetString</code>.</p>
|
||||||
|
<p ><b>Do not use the version string</b> to parse the GLFW library version. The <a class="el" href="group__init.html#ga9f8ffaacf3c269cc48eafbf8b9b71197">glfwGetVersion</a> function provides the version of the running library binary in numerical format.</p>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>The ASCII encoded GLFW version string.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>None.</dd></dl>
|
||||||
|
<dl class="section remark"><dt>Remarks</dt><dd>This function may be called before <a class="el" href="group__init.html#ga317aac130a235ab08c6db0834907d85e">glfwInit</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Pointer lifetime</dt><dd>The returned string is static and compile-time generated.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function may be called from any thread.</dd></dl>
|
||||||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="intro_guide.html#intro_version">Version management</a> </dd>
|
||||||
|
<dd>
|
||||||
|
<a class="el" href="group__init.html#ga9f8ffaacf3c269cc48eafbf8b9b71197">glfwGetVersion</a></dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.0. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga944986b4ec0b928d488141f92982aa18" name="ga944986b4ec0b928d488141f92982aa18"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga944986b4ec0b928d488141f92982aa18">◆ </a></span>glfwGetError()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">int glfwGetError </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">const char ** </td>
|
||||||
|
<td class="paramname"><em>description</em></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >This function returns and clears the <a class="el" href="group__errors.html">error code</a> of the last error that occurred on the calling thread, and optionally a UTF-8 encoded human-readable description of it. If no error has occurred since the last call, it returns <a class="el" href="group__errors.html#gafa30deee5db4d69c4c93d116ed87dbf4">GLFW_NO_ERROR</a> (zero) and the description pointer is set to <code>NULL</code>.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramdir">[in]</td><td class="paramname">description</td><td>Where to store the error description pointer, or <code>NULL</code>. </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>The last error code for the calling thread, or <a class="el" href="group__errors.html#gafa30deee5db4d69c4c93d116ed87dbf4">GLFW_NO_ERROR</a> (zero).</dd></dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>None.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Pointer lifetime</dt><dd>The returned string is allocated and freed by GLFW. You should not free it yourself. It is guaranteed to be valid only until the next error occurs or the library is terminated.</dd></dl>
|
||||||
|
<dl class="section remark"><dt>Remarks</dt><dd>This function may be called before <a class="el" href="group__init.html#ga317aac130a235ab08c6db0834907d85e">glfwInit</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function may be called from any thread.</dd></dl>
|
||||||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="intro_guide.html#error_handling">Error handling</a> </dd>
|
||||||
|
<dd>
|
||||||
|
<a class="el" href="group__init.html#gaff45816610d53f0b83656092a4034f40">glfwSetErrorCallback</a></dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.3. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gaff45816610d53f0b83656092a4034f40" name="gaff45816610d53f0b83656092a4034f40"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gaff45816610d53f0b83656092a4034f40">◆ </a></span>glfwSetErrorCallback()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname"><a class="el" href="group__init.html#ga8184701785c096b3862a75cda1bf44a3">GLFWerrorfun</a> glfwSetErrorCallback </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype"><a class="el" href="group__init.html#ga8184701785c096b3862a75cda1bf44a3">GLFWerrorfun</a> </td>
|
||||||
|
<td class="paramname"><em>callback</em></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >This function sets the error callback, which is called with an error code and a human-readable description each time a GLFW error occurs.</p>
|
||||||
|
<p >The error code is set before the callback is called. Calling <a class="el" href="group__init.html#ga944986b4ec0b928d488141f92982aa18">glfwGetError</a> from the error callback will return the same value as the error code argument.</p>
|
||||||
|
<p >The error callback is called on the thread where the error occurred. If you are using GLFW from multiple threads, your error callback needs to be written accordingly.</p>
|
||||||
|
<p >Because the description string may have been generated specifically for that error, it is not guaranteed to be valid after the callback has returned. If you wish to use it after the callback returns, you need to make a copy.</p>
|
||||||
|
<p >Once set, the error callback remains set even after the library has been terminated.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramdir">[in]</td><td class="paramname">callback</td><td>The new callback, or <code>NULL</code> to remove the currently set callback. </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>The previously set callback, or <code>NULL</code> if no callback was set.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Callback signature</dt><dd><div class="fragment"><div class="line"><span class="keywordtype">void</span> callback_name(<span class="keywordtype">int</span> error_code, <span class="keyword">const</span> <span class="keywordtype">char</span>* description)</div>
|
||||||
|
</div><!-- fragment --> For more information about the callback parameters, see the <a class="el" href="group__init.html#ga8184701785c096b3862a75cda1bf44a3">callback pointer type</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>None.</dd></dl>
|
||||||
|
<dl class="section remark"><dt>Remarks</dt><dd>This function may be called before <a class="el" href="group__init.html#ga317aac130a235ab08c6db0834907d85e">glfwInit</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function must only be called from the main thread.</dd></dl>
|
||||||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="intro_guide.html#error_handling">Error handling</a> </dd>
|
||||||
|
<dd>
|
||||||
|
<a class="el" href="group__init.html#ga944986b4ec0b928d488141f92982aa18">glfwGetError</a></dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.0. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div><!-- contents -->
|
||||||
|
<address class="footer">
|
||||||
|
<p>
|
||||||
|
Last update on Fri Jul 22 2022 for GLFW 3.3.8
|
||||||
|
</p>
|
||||||
|
</address>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,355 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.9.4"/>
|
||||||
|
<title>GLFW: Joysticks</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="extra.css" rel="stylesheet" type="text/css"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<div class="glfwheader">
|
||||||
|
<a href="https://www.glfw.org/" id="glfwhome">GLFW</a>
|
||||||
|
<ul class="glfwnavbar">
|
||||||
|
<li><a href="https://www.glfw.org/documentation.html">Documentation</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/download.html">Download</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/community.html">Community</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.9.4 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src="menudata.js"></script>
|
||||||
|
<script type="text/javascript" src="menu.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
$(function() {
|
||||||
|
initMenu('',true,false,'search.php','Search');
|
||||||
|
$(document).ready(function() { init_search(); });
|
||||||
|
});
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<div id="main-nav"></div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="header">
|
||||||
|
<div class="summary">
|
||||||
|
<a href="#define-members">Macros</a> </div>
|
||||||
|
<div class="headertitle"><div class="title">Joysticks<div class="ingroups"><a class="el" href="group__input.html">Input reference</a></div></div></div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<a name="details" id="details"></a><h2 class="groupheader">Description</h2>
|
||||||
|
<p >See <a class="el" href="input_guide.html#joystick">joystick input</a> for how these are used. </p>
|
||||||
|
<table class="memberdecls">
|
||||||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
|
||||||
|
Macros</h2></td></tr>
|
||||||
|
<tr class="memitem:ga34a0443d059e9f22272cd4669073f73d"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__joysticks.html#ga34a0443d059e9f22272cd4669073f73d">GLFW_JOYSTICK_1</a>   0</td></tr>
|
||||||
|
<tr class="separator:ga34a0443d059e9f22272cd4669073f73d"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga6eab65ec88e65e0850ef8413504cb50c"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__joysticks.html#ga6eab65ec88e65e0850ef8413504cb50c">GLFW_JOYSTICK_2</a>   1</td></tr>
|
||||||
|
<tr class="separator:ga6eab65ec88e65e0850ef8413504cb50c"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gae6f3eedfeb42424c2f5e3161efb0b654"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__joysticks.html#gae6f3eedfeb42424c2f5e3161efb0b654">GLFW_JOYSTICK_3</a>   2</td></tr>
|
||||||
|
<tr class="separator:gae6f3eedfeb42424c2f5e3161efb0b654"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga97ddbcad02b7f48d74fad4ddb08fff59"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__joysticks.html#ga97ddbcad02b7f48d74fad4ddb08fff59">GLFW_JOYSTICK_4</a>   3</td></tr>
|
||||||
|
<tr class="separator:ga97ddbcad02b7f48d74fad4ddb08fff59"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gae43281bc66d3fa5089fb50c3e7a28695"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__joysticks.html#gae43281bc66d3fa5089fb50c3e7a28695">GLFW_JOYSTICK_5</a>   4</td></tr>
|
||||||
|
<tr class="separator:gae43281bc66d3fa5089fb50c3e7a28695"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga74771620aa53bd68a487186dea66fd77"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__joysticks.html#ga74771620aa53bd68a487186dea66fd77">GLFW_JOYSTICK_6</a>   5</td></tr>
|
||||||
|
<tr class="separator:ga74771620aa53bd68a487186dea66fd77"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga20a9f4f3aaefed9ea5e66072fc588b87"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__joysticks.html#ga20a9f4f3aaefed9ea5e66072fc588b87">GLFW_JOYSTICK_7</a>   6</td></tr>
|
||||||
|
<tr class="separator:ga20a9f4f3aaefed9ea5e66072fc588b87"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga21a934c940bcf25db0e4c8fe9b364bdb"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__joysticks.html#ga21a934c940bcf25db0e4c8fe9b364bdb">GLFW_JOYSTICK_8</a>   7</td></tr>
|
||||||
|
<tr class="separator:ga21a934c940bcf25db0e4c8fe9b364bdb"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga87689d47df0ba6f9f5fcbbcaf7b3cecf"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__joysticks.html#ga87689d47df0ba6f9f5fcbbcaf7b3cecf">GLFW_JOYSTICK_9</a>   8</td></tr>
|
||||||
|
<tr class="separator:ga87689d47df0ba6f9f5fcbbcaf7b3cecf"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gaef55389ee605d6dfc31aef6fe98c54ec"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__joysticks.html#gaef55389ee605d6dfc31aef6fe98c54ec">GLFW_JOYSTICK_10</a>   9</td></tr>
|
||||||
|
<tr class="separator:gaef55389ee605d6dfc31aef6fe98c54ec"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gae7d26e3df447c2c14a569fcc18516af4"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__joysticks.html#gae7d26e3df447c2c14a569fcc18516af4">GLFW_JOYSTICK_11</a>   10</td></tr>
|
||||||
|
<tr class="separator:gae7d26e3df447c2c14a569fcc18516af4"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gab91bbf5b7ca6be8d3ac5c4d89ff48ac7"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__joysticks.html#gab91bbf5b7ca6be8d3ac5c4d89ff48ac7">GLFW_JOYSTICK_12</a>   11</td></tr>
|
||||||
|
<tr class="separator:gab91bbf5b7ca6be8d3ac5c4d89ff48ac7"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga5c84fb4e49bf661d7d7c78eb4018c508"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__joysticks.html#ga5c84fb4e49bf661d7d7c78eb4018c508">GLFW_JOYSTICK_13</a>   12</td></tr>
|
||||||
|
<tr class="separator:ga5c84fb4e49bf661d7d7c78eb4018c508"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga89540873278ae5a42b3e70d64164dc74"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__joysticks.html#ga89540873278ae5a42b3e70d64164dc74">GLFW_JOYSTICK_14</a>   13</td></tr>
|
||||||
|
<tr class="separator:ga89540873278ae5a42b3e70d64164dc74"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga7b02ab70daf7a78bcc942d5d4cc1dcf9"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__joysticks.html#ga7b02ab70daf7a78bcc942d5d4cc1dcf9">GLFW_JOYSTICK_15</a>   14</td></tr>
|
||||||
|
<tr class="separator:ga7b02ab70daf7a78bcc942d5d4cc1dcf9"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga453edeeabf350827646b6857df4f80ce"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__joysticks.html#ga453edeeabf350827646b6857df4f80ce">GLFW_JOYSTICK_16</a>   15</td></tr>
|
||||||
|
<tr class="separator:ga453edeeabf350827646b6857df4f80ce"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga9ca13ebf24c331dd98df17d84a4b72c9"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__joysticks.html#ga9ca13ebf24c331dd98df17d84a4b72c9">GLFW_JOYSTICK_LAST</a>   <a class="el" href="group__joysticks.html#ga453edeeabf350827646b6857df4f80ce">GLFW_JOYSTICK_16</a></td></tr>
|
||||||
|
<tr class="separator:ga9ca13ebf24c331dd98df17d84a4b72c9"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
</table>
|
||||||
|
<h2 class="groupheader">Macro Definition Documentation</h2>
|
||||||
|
<a id="ga34a0443d059e9f22272cd4669073f73d" name="ga34a0443d059e9f22272cd4669073f73d"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga34a0443d059e9f22272cd4669073f73d">◆ </a></span>GLFW_JOYSTICK_1</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_JOYSTICK_1   0</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga6eab65ec88e65e0850ef8413504cb50c" name="ga6eab65ec88e65e0850ef8413504cb50c"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga6eab65ec88e65e0850ef8413504cb50c">◆ </a></span>GLFW_JOYSTICK_2</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_JOYSTICK_2   1</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gae6f3eedfeb42424c2f5e3161efb0b654" name="gae6f3eedfeb42424c2f5e3161efb0b654"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gae6f3eedfeb42424c2f5e3161efb0b654">◆ </a></span>GLFW_JOYSTICK_3</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_JOYSTICK_3   2</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga97ddbcad02b7f48d74fad4ddb08fff59" name="ga97ddbcad02b7f48d74fad4ddb08fff59"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga97ddbcad02b7f48d74fad4ddb08fff59">◆ </a></span>GLFW_JOYSTICK_4</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_JOYSTICK_4   3</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gae43281bc66d3fa5089fb50c3e7a28695" name="gae43281bc66d3fa5089fb50c3e7a28695"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gae43281bc66d3fa5089fb50c3e7a28695">◆ </a></span>GLFW_JOYSTICK_5</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_JOYSTICK_5   4</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga74771620aa53bd68a487186dea66fd77" name="ga74771620aa53bd68a487186dea66fd77"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga74771620aa53bd68a487186dea66fd77">◆ </a></span>GLFW_JOYSTICK_6</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_JOYSTICK_6   5</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga20a9f4f3aaefed9ea5e66072fc588b87" name="ga20a9f4f3aaefed9ea5e66072fc588b87"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga20a9f4f3aaefed9ea5e66072fc588b87">◆ </a></span>GLFW_JOYSTICK_7</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_JOYSTICK_7   6</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga21a934c940bcf25db0e4c8fe9b364bdb" name="ga21a934c940bcf25db0e4c8fe9b364bdb"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga21a934c940bcf25db0e4c8fe9b364bdb">◆ </a></span>GLFW_JOYSTICK_8</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_JOYSTICK_8   7</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga87689d47df0ba6f9f5fcbbcaf7b3cecf" name="ga87689d47df0ba6f9f5fcbbcaf7b3cecf"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga87689d47df0ba6f9f5fcbbcaf7b3cecf">◆ </a></span>GLFW_JOYSTICK_9</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_JOYSTICK_9   8</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gaef55389ee605d6dfc31aef6fe98c54ec" name="gaef55389ee605d6dfc31aef6fe98c54ec"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gaef55389ee605d6dfc31aef6fe98c54ec">◆ </a></span>GLFW_JOYSTICK_10</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_JOYSTICK_10   9</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gae7d26e3df447c2c14a569fcc18516af4" name="gae7d26e3df447c2c14a569fcc18516af4"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gae7d26e3df447c2c14a569fcc18516af4">◆ </a></span>GLFW_JOYSTICK_11</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_JOYSTICK_11   10</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gab91bbf5b7ca6be8d3ac5c4d89ff48ac7" name="gab91bbf5b7ca6be8d3ac5c4d89ff48ac7"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gab91bbf5b7ca6be8d3ac5c4d89ff48ac7">◆ </a></span>GLFW_JOYSTICK_12</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_JOYSTICK_12   11</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga5c84fb4e49bf661d7d7c78eb4018c508" name="ga5c84fb4e49bf661d7d7c78eb4018c508"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga5c84fb4e49bf661d7d7c78eb4018c508">◆ </a></span>GLFW_JOYSTICK_13</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_JOYSTICK_13   12</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga89540873278ae5a42b3e70d64164dc74" name="ga89540873278ae5a42b3e70d64164dc74"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga89540873278ae5a42b3e70d64164dc74">◆ </a></span>GLFW_JOYSTICK_14</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_JOYSTICK_14   13</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga7b02ab70daf7a78bcc942d5d4cc1dcf9" name="ga7b02ab70daf7a78bcc942d5d4cc1dcf9"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga7b02ab70daf7a78bcc942d5d4cc1dcf9">◆ </a></span>GLFW_JOYSTICK_15</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_JOYSTICK_15   14</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga453edeeabf350827646b6857df4f80ce" name="ga453edeeabf350827646b6857df4f80ce"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga453edeeabf350827646b6857df4f80ce">◆ </a></span>GLFW_JOYSTICK_16</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_JOYSTICK_16   15</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga9ca13ebf24c331dd98df17d84a4b72c9" name="ga9ca13ebf24c331dd98df17d84a4b72c9"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga9ca13ebf24c331dd98df17d84a4b72c9">◆ </a></span>GLFW_JOYSTICK_LAST</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_JOYSTICK_LAST   <a class="el" href="group__joysticks.html#ga453edeeabf350827646b6857df4f80ce">GLFW_JOYSTICK_16</a></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div><!-- contents -->
|
||||||
|
<address class="footer">
|
||||||
|
<p>
|
||||||
|
Last update on Fri Jul 22 2022 for GLFW 3.3.8
|
||||||
|
</p>
|
||||||
|
</address>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,191 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.9.4"/>
|
||||||
|
<title>GLFW: Modifier key flags</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="extra.css" rel="stylesheet" type="text/css"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<div class="glfwheader">
|
||||||
|
<a href="https://www.glfw.org/" id="glfwhome">GLFW</a>
|
||||||
|
<ul class="glfwnavbar">
|
||||||
|
<li><a href="https://www.glfw.org/documentation.html">Documentation</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/download.html">Download</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/community.html">Community</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.9.4 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src="menudata.js"></script>
|
||||||
|
<script type="text/javascript" src="menu.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
$(function() {
|
||||||
|
initMenu('',true,false,'search.php','Search');
|
||||||
|
$(document).ready(function() { init_search(); });
|
||||||
|
});
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<div id="main-nav"></div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="header">
|
||||||
|
<div class="summary">
|
||||||
|
<a href="#define-members">Macros</a> </div>
|
||||||
|
<div class="headertitle"><div class="title">Modifier key flags<div class="ingroups"><a class="el" href="group__input.html">Input reference</a></div></div></div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<a name="details" id="details"></a><h2 class="groupheader">Description</h2>
|
||||||
|
<p >See <a class="el" href="input_guide.html#input_key">key input</a> for how these are used. </p>
|
||||||
|
<table class="memberdecls">
|
||||||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
|
||||||
|
Macros</h2></td></tr>
|
||||||
|
<tr class="memitem:ga14994d3196c290aaa347248e51740274"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__mods.html#ga14994d3196c290aaa347248e51740274">GLFW_MOD_SHIFT</a>   0x0001</td></tr>
|
||||||
|
<tr class="memdesc:ga14994d3196c290aaa347248e51740274"><td class="mdescLeft"> </td><td class="mdescRight">If this bit is set one or more Shift keys were held down. <a href="group__mods.html#ga14994d3196c290aaa347248e51740274">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga14994d3196c290aaa347248e51740274"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga6ed94871c3208eefd85713fa929d45aa"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__mods.html#ga6ed94871c3208eefd85713fa929d45aa">GLFW_MOD_CONTROL</a>   0x0002</td></tr>
|
||||||
|
<tr class="memdesc:ga6ed94871c3208eefd85713fa929d45aa"><td class="mdescLeft"> </td><td class="mdescRight">If this bit is set one or more Control keys were held down. <a href="group__mods.html#ga6ed94871c3208eefd85713fa929d45aa">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga6ed94871c3208eefd85713fa929d45aa"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gad2acd5633463c29e07008687ea73c0f4"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__mods.html#gad2acd5633463c29e07008687ea73c0f4">GLFW_MOD_ALT</a>   0x0004</td></tr>
|
||||||
|
<tr class="memdesc:gad2acd5633463c29e07008687ea73c0f4"><td class="mdescLeft"> </td><td class="mdescRight">If this bit is set one or more Alt keys were held down. <a href="group__mods.html#gad2acd5633463c29e07008687ea73c0f4">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:gad2acd5633463c29e07008687ea73c0f4"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga6b64ba10ea0227cf6f42efd0a220aba1"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__mods.html#ga6b64ba10ea0227cf6f42efd0a220aba1">GLFW_MOD_SUPER</a>   0x0008</td></tr>
|
||||||
|
<tr class="memdesc:ga6b64ba10ea0227cf6f42efd0a220aba1"><td class="mdescLeft"> </td><td class="mdescRight">If this bit is set one or more Super keys were held down. <a href="group__mods.html#ga6b64ba10ea0227cf6f42efd0a220aba1">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga6b64ba10ea0227cf6f42efd0a220aba1"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gaefeef8fcf825a6e43e241b337897200f"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__mods.html#gaefeef8fcf825a6e43e241b337897200f">GLFW_MOD_CAPS_LOCK</a>   0x0010</td></tr>
|
||||||
|
<tr class="memdesc:gaefeef8fcf825a6e43e241b337897200f"><td class="mdescLeft"> </td><td class="mdescRight">If this bit is set the Caps Lock key is enabled. <a href="group__mods.html#gaefeef8fcf825a6e43e241b337897200f">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:gaefeef8fcf825a6e43e241b337897200f"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga64e020b8a42af8376e944baf61feecbe"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__mods.html#ga64e020b8a42af8376e944baf61feecbe">GLFW_MOD_NUM_LOCK</a>   0x0020</td></tr>
|
||||||
|
<tr class="memdesc:ga64e020b8a42af8376e944baf61feecbe"><td class="mdescLeft"> </td><td class="mdescRight">If this bit is set the Num Lock key is enabled. <a href="group__mods.html#ga64e020b8a42af8376e944baf61feecbe">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga64e020b8a42af8376e944baf61feecbe"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
</table>
|
||||||
|
<h2 class="groupheader">Macro Definition Documentation</h2>
|
||||||
|
<a id="ga14994d3196c290aaa347248e51740274" name="ga14994d3196c290aaa347248e51740274"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga14994d3196c290aaa347248e51740274">◆ </a></span>GLFW_MOD_SHIFT</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_MOD_SHIFT   0x0001</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >If this bit is set one or more Shift keys were held down. </p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga6ed94871c3208eefd85713fa929d45aa" name="ga6ed94871c3208eefd85713fa929d45aa"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga6ed94871c3208eefd85713fa929d45aa">◆ </a></span>GLFW_MOD_CONTROL</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_MOD_CONTROL   0x0002</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >If this bit is set one or more Control keys were held down. </p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gad2acd5633463c29e07008687ea73c0f4" name="gad2acd5633463c29e07008687ea73c0f4"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gad2acd5633463c29e07008687ea73c0f4">◆ </a></span>GLFW_MOD_ALT</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_MOD_ALT   0x0004</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >If this bit is set one or more Alt keys were held down. </p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga6b64ba10ea0227cf6f42efd0a220aba1" name="ga6b64ba10ea0227cf6f42efd0a220aba1"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga6b64ba10ea0227cf6f42efd0a220aba1">◆ </a></span>GLFW_MOD_SUPER</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_MOD_SUPER   0x0008</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >If this bit is set one or more Super keys were held down. </p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gaefeef8fcf825a6e43e241b337897200f" name="gaefeef8fcf825a6e43e241b337897200f"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gaefeef8fcf825a6e43e241b337897200f">◆ </a></span>GLFW_MOD_CAPS_LOCK</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_MOD_CAPS_LOCK   0x0010</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >If this bit is set the Caps Lock key is enabled and the <a class="el" href="input_guide.html#GLFW_LOCK_KEY_MODS">GLFW_LOCK_KEY_MODS</a> input mode is set. </p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga64e020b8a42af8376e944baf61feecbe" name="ga64e020b8a42af8376e944baf61feecbe"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga64e020b8a42af8376e944baf61feecbe">◆ </a></span>GLFW_MOD_NUM_LOCK</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_MOD_NUM_LOCK   0x0020</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >If this bit is set the Num Lock key is enabled and the <a class="el" href="input_guide.html#GLFW_LOCK_KEY_MODS">GLFW_LOCK_KEY_MODS</a> input mode is set. </p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div><!-- contents -->
|
||||||
|
<address class="footer">
|
||||||
|
<p>
|
||||||
|
Last update on Fri Jul 22 2022 for GLFW 3.3.8
|
||||||
|
</p>
|
||||||
|
</address>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,841 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.9.4"/>
|
||||||
|
<title>GLFW: Monitor reference</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="extra.css" rel="stylesheet" type="text/css"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<div class="glfwheader">
|
||||||
|
<a href="https://www.glfw.org/" id="glfwhome">GLFW</a>
|
||||||
|
<ul class="glfwnavbar">
|
||||||
|
<li><a href="https://www.glfw.org/documentation.html">Documentation</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/download.html">Download</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/community.html">Community</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.9.4 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src="menudata.js"></script>
|
||||||
|
<script type="text/javascript" src="menu.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
$(function() {
|
||||||
|
initMenu('',true,false,'search.php','Search');
|
||||||
|
$(document).ready(function() { init_search(); });
|
||||||
|
});
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<div id="main-nav"></div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="header">
|
||||||
|
<div class="summary">
|
||||||
|
<a href="#typedef-members">Typedefs</a> |
|
||||||
|
<a href="#func-members">Functions</a> </div>
|
||||||
|
<div class="headertitle"><div class="title">Monitor reference</div></div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<a name="details" id="details"></a><h2 class="groupheader">Description</h2>
|
||||||
|
<p >This is the reference documentation for monitor related functions and types. For more task-oriented information, see the <a class="el" href="monitor_guide.html">Monitor guide</a>. </p>
|
||||||
|
<table class="memberdecls">
|
||||||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="typedef-members" name="typedef-members"></a>
|
||||||
|
Typedefs</h2></td></tr>
|
||||||
|
<tr class="memitem:ga8d9efd1cde9426692c73fe40437d0ae3"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a></td></tr>
|
||||||
|
<tr class="memdesc:ga8d9efd1cde9426692c73fe40437d0ae3"><td class="mdescLeft"> </td><td class="mdescRight">Opaque monitor object. <a href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga8d9efd1cde9426692c73fe40437d0ae3"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gaabe16caca8dea952504dfdebdf4cd249"><td class="memItemLeft" align="right" valign="top">typedef void(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__monitor.html#gaabe16caca8dea952504dfdebdf4cd249">GLFWmonitorfun</a>) (<a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> *monitor, int event)</td></tr>
|
||||||
|
<tr class="memdesc:gaabe16caca8dea952504dfdebdf4cd249"><td class="mdescLeft"> </td><td class="mdescRight">The function pointer type for monitor configuration callbacks. <a href="group__monitor.html#gaabe16caca8dea952504dfdebdf4cd249">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:gaabe16caca8dea952504dfdebdf4cd249"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga902c2816ac9b34b757282daab59b2565"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structGLFWvidmode.html">GLFWvidmode</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__monitor.html#ga902c2816ac9b34b757282daab59b2565">GLFWvidmode</a></td></tr>
|
||||||
|
<tr class="memdesc:ga902c2816ac9b34b757282daab59b2565"><td class="mdescLeft"> </td><td class="mdescRight">Video mode type. <a href="group__monitor.html#ga902c2816ac9b34b757282daab59b2565">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga902c2816ac9b34b757282daab59b2565"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga939cf093cb0af0498b7b54dc2e181404"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structGLFWgammaramp.html">GLFWgammaramp</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__monitor.html#ga939cf093cb0af0498b7b54dc2e181404">GLFWgammaramp</a></td></tr>
|
||||||
|
<tr class="memdesc:ga939cf093cb0af0498b7b54dc2e181404"><td class="mdescLeft"> </td><td class="mdescRight">Gamma ramp. <a href="group__monitor.html#ga939cf093cb0af0498b7b54dc2e181404">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga939cf093cb0af0498b7b54dc2e181404"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
</table><table class="memberdecls">
|
||||||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
|
||||||
|
Functions</h2></td></tr>
|
||||||
|
<tr class="memitem:ga70b1156d5d24e9928f145d6c864369d2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> ** </td><td class="memItemRight" valign="bottom"><a class="el" href="group__monitor.html#ga70b1156d5d24e9928f145d6c864369d2">glfwGetMonitors</a> (int *count)</td></tr>
|
||||||
|
<tr class="memdesc:ga70b1156d5d24e9928f145d6c864369d2"><td class="mdescLeft"> </td><td class="mdescRight">Returns the currently connected monitors. <a href="group__monitor.html#ga70b1156d5d24e9928f145d6c864369d2">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga70b1156d5d24e9928f145d6c864369d2"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gac3adb24947eb709e1874028272e5dfc5"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__monitor.html#gac3adb24947eb709e1874028272e5dfc5">glfwGetPrimaryMonitor</a> (void)</td></tr>
|
||||||
|
<tr class="memdesc:gac3adb24947eb709e1874028272e5dfc5"><td class="mdescLeft"> </td><td class="mdescRight">Returns the primary monitor. <a href="group__monitor.html#gac3adb24947eb709e1874028272e5dfc5">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:gac3adb24947eb709e1874028272e5dfc5"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga102f54e7acc9149edbcf0997152df8c9"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__monitor.html#ga102f54e7acc9149edbcf0997152df8c9">glfwGetMonitorPos</a> (<a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> *monitor, int *xpos, int *ypos)</td></tr>
|
||||||
|
<tr class="memdesc:ga102f54e7acc9149edbcf0997152df8c9"><td class="mdescLeft"> </td><td class="mdescRight">Returns the position of the monitor's viewport on the virtual screen. <a href="group__monitor.html#ga102f54e7acc9149edbcf0997152df8c9">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga102f54e7acc9149edbcf0997152df8c9"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga7387a3bdb64bfe8ebf2b9e54f5b6c9d0"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__monitor.html#ga7387a3bdb64bfe8ebf2b9e54f5b6c9d0">glfwGetMonitorWorkarea</a> (<a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> *monitor, int *xpos, int *ypos, int *width, int *height)</td></tr>
|
||||||
|
<tr class="memdesc:ga7387a3bdb64bfe8ebf2b9e54f5b6c9d0"><td class="mdescLeft"> </td><td class="mdescRight">Retrieves the work area of the monitor. <a href="group__monitor.html#ga7387a3bdb64bfe8ebf2b9e54f5b6c9d0">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga7387a3bdb64bfe8ebf2b9e54f5b6c9d0"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga7d8bffc6c55539286a6bd20d32a8d7ea"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__monitor.html#ga7d8bffc6c55539286a6bd20d32a8d7ea">glfwGetMonitorPhysicalSize</a> (<a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> *monitor, int *widthMM, int *heightMM)</td></tr>
|
||||||
|
<tr class="memdesc:ga7d8bffc6c55539286a6bd20d32a8d7ea"><td class="mdescLeft"> </td><td class="mdescRight">Returns the physical size of the monitor. <a href="group__monitor.html#ga7d8bffc6c55539286a6bd20d32a8d7ea">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga7d8bffc6c55539286a6bd20d32a8d7ea"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gad3152e84465fa620b601265ebfcdb21b"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__monitor.html#gad3152e84465fa620b601265ebfcdb21b">glfwGetMonitorContentScale</a> (<a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> *monitor, float *xscale, float *yscale)</td></tr>
|
||||||
|
<tr class="memdesc:gad3152e84465fa620b601265ebfcdb21b"><td class="mdescLeft"> </td><td class="mdescRight">Retrieves the content scale for the specified monitor. <a href="group__monitor.html#gad3152e84465fa620b601265ebfcdb21b">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:gad3152e84465fa620b601265ebfcdb21b"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga7af83e13489d90379588fb331b9e4b68"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__monitor.html#ga7af83e13489d90379588fb331b9e4b68">glfwGetMonitorName</a> (<a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> *monitor)</td></tr>
|
||||||
|
<tr class="memdesc:ga7af83e13489d90379588fb331b9e4b68"><td class="mdescLeft"> </td><td class="mdescRight">Returns the name of the specified monitor. <a href="group__monitor.html#ga7af83e13489d90379588fb331b9e4b68">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga7af83e13489d90379588fb331b9e4b68"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga702750e24313a686d3637297b6e85fda"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__monitor.html#ga702750e24313a686d3637297b6e85fda">glfwSetMonitorUserPointer</a> (<a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> *monitor, void *pointer)</td></tr>
|
||||||
|
<tr class="memdesc:ga702750e24313a686d3637297b6e85fda"><td class="mdescLeft"> </td><td class="mdescRight">Sets the user pointer of the specified monitor. <a href="group__monitor.html#ga702750e24313a686d3637297b6e85fda">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga702750e24313a686d3637297b6e85fda"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga1adbfbfb8cd58b23cfee82e574fbbdc5"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__monitor.html#ga1adbfbfb8cd58b23cfee82e574fbbdc5">glfwGetMonitorUserPointer</a> (<a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> *monitor)</td></tr>
|
||||||
|
<tr class="memdesc:ga1adbfbfb8cd58b23cfee82e574fbbdc5"><td class="mdescLeft"> </td><td class="mdescRight">Returns the user pointer of the specified monitor. <a href="group__monitor.html#ga1adbfbfb8cd58b23cfee82e574fbbdc5">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga1adbfbfb8cd58b23cfee82e574fbbdc5"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gab39df645587c8518192aa746c2fb06c3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__monitor.html#gaabe16caca8dea952504dfdebdf4cd249">GLFWmonitorfun</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__monitor.html#gab39df645587c8518192aa746c2fb06c3">glfwSetMonitorCallback</a> (<a class="el" href="group__monitor.html#gaabe16caca8dea952504dfdebdf4cd249">GLFWmonitorfun</a> callback)</td></tr>
|
||||||
|
<tr class="memdesc:gab39df645587c8518192aa746c2fb06c3"><td class="mdescLeft"> </td><td class="mdescRight">Sets the monitor configuration callback. <a href="group__monitor.html#gab39df645587c8518192aa746c2fb06c3">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:gab39df645587c8518192aa746c2fb06c3"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gad2e24d2843cb7d6c26202cddd530fc1b"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structGLFWvidmode.html">GLFWvidmode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__monitor.html#gad2e24d2843cb7d6c26202cddd530fc1b">glfwGetVideoModes</a> (<a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> *monitor, int *count)</td></tr>
|
||||||
|
<tr class="memdesc:gad2e24d2843cb7d6c26202cddd530fc1b"><td class="mdescLeft"> </td><td class="mdescRight">Returns the available video modes for the specified monitor. <a href="group__monitor.html#gad2e24d2843cb7d6c26202cddd530fc1b">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:gad2e24d2843cb7d6c26202cddd530fc1b"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gaba376fa7e76634b4788bddc505d6c9d5"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structGLFWvidmode.html">GLFWvidmode</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__monitor.html#gaba376fa7e76634b4788bddc505d6c9d5">glfwGetVideoMode</a> (<a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> *monitor)</td></tr>
|
||||||
|
<tr class="memdesc:gaba376fa7e76634b4788bddc505d6c9d5"><td class="mdescLeft"> </td><td class="mdescRight">Returns the current mode of the specified monitor. <a href="group__monitor.html#gaba376fa7e76634b4788bddc505d6c9d5">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:gaba376fa7e76634b4788bddc505d6c9d5"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga6ac582625c990220785ddd34efa3169a"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__monitor.html#ga6ac582625c990220785ddd34efa3169a">glfwSetGamma</a> (<a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> *monitor, float gamma)</td></tr>
|
||||||
|
<tr class="memdesc:ga6ac582625c990220785ddd34efa3169a"><td class="mdescLeft"> </td><td class="mdescRight">Generates a gamma ramp and sets it for the specified monitor. <a href="group__monitor.html#ga6ac582625c990220785ddd34efa3169a">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga6ac582625c990220785ddd34efa3169a"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga76ba90debcf0062b5c4b73052b24f96f"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="structGLFWgammaramp.html">GLFWgammaramp</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__monitor.html#ga76ba90debcf0062b5c4b73052b24f96f">glfwGetGammaRamp</a> (<a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> *monitor)</td></tr>
|
||||||
|
<tr class="memdesc:ga76ba90debcf0062b5c4b73052b24f96f"><td class="mdescLeft"> </td><td class="mdescRight">Returns the current gamma ramp for the specified monitor. <a href="group__monitor.html#ga76ba90debcf0062b5c4b73052b24f96f">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga76ba90debcf0062b5c4b73052b24f96f"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga583f0ffd0d29613d8cd172b996bbf0dd"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__monitor.html#ga583f0ffd0d29613d8cd172b996bbf0dd">glfwSetGammaRamp</a> (<a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> *monitor, const <a class="el" href="structGLFWgammaramp.html">GLFWgammaramp</a> *ramp)</td></tr>
|
||||||
|
<tr class="memdesc:ga583f0ffd0d29613d8cd172b996bbf0dd"><td class="mdescLeft"> </td><td class="mdescRight">Sets the current gamma ramp for the specified monitor. <a href="group__monitor.html#ga583f0ffd0d29613d8cd172b996bbf0dd">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga583f0ffd0d29613d8cd172b996bbf0dd"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
</table>
|
||||||
|
<h2 class="groupheader">Typedef Documentation</h2>
|
||||||
|
<a id="ga8d9efd1cde9426692c73fe40437d0ae3" name="ga8d9efd1cde9426692c73fe40437d0ae3"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga8d9efd1cde9426692c73fe40437d0ae3">◆ </a></span>GLFWmonitor</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">typedef struct <a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> <a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >Opaque monitor object.</p>
|
||||||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="monitor_guide.html#monitor_object">Monitor objects</a></dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.0. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gaabe16caca8dea952504dfdebdf4cd249" name="gaabe16caca8dea952504dfdebdf4cd249"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gaabe16caca8dea952504dfdebdf4cd249">◆ </a></span>GLFWmonitorfun</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">typedef void(* GLFWmonitorfun) (<a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> *monitor, int event)</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >This is the function pointer type for monitor configuration callbacks. A monitor callback function has the following signature: </p><div class="fragment"><div class="line"><span class="keywordtype">void</span> function_name(<a class="code hl_typedef" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a>* monitor, <span class="keywordtype">int</span> event)</div>
|
||||||
|
<div class="ttc" id="agroup__monitor_html_ga8d9efd1cde9426692c73fe40437d0ae3"><div class="ttname"><a href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a></div><div class="ttdeci">struct GLFWmonitor GLFWmonitor</div><div class="ttdoc">Opaque monitor object.</div><div class="ttdef"><b>Definition:</b> glfw3.h:1173</div></div>
|
||||||
|
</div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramdir">[in]</td><td class="paramname">monitor</td><td>The monitor that was connected or disconnected. </td></tr>
|
||||||
|
<tr><td class="paramdir">[in]</td><td class="paramname">event</td><td>One of <code>GLFW_CONNECTED</code> or <code>GLFW_DISCONNECTED</code>. Future releases may add more events.</td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="monitor_guide.html#monitor_event">Monitor configuration changes</a> </dd>
|
||||||
|
<dd>
|
||||||
|
<a class="el" href="group__monitor.html#gab39df645587c8518192aa746c2fb06c3">glfwSetMonitorCallback</a></dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.0. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga902c2816ac9b34b757282daab59b2565" name="ga902c2816ac9b34b757282daab59b2565"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga902c2816ac9b34b757282daab59b2565">◆ </a></span>GLFWvidmode</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">typedef struct <a class="el" href="structGLFWvidmode.html">GLFWvidmode</a> <a class="el" href="structGLFWvidmode.html">GLFWvidmode</a></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >This describes a single video mode.</p>
|
||||||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="monitor_guide.html#monitor_modes">Video modes</a> </dd>
|
||||||
|
<dd>
|
||||||
|
<a class="el" href="group__monitor.html#gaba376fa7e76634b4788bddc505d6c9d5">glfwGetVideoMode</a> </dd>
|
||||||
|
<dd>
|
||||||
|
<a class="el" href="group__monitor.html#gad2e24d2843cb7d6c26202cddd530fc1b">glfwGetVideoModes</a></dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 1.0. <b>GLFW 3:</b> Added refresh rate member. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga939cf093cb0af0498b7b54dc2e181404" name="ga939cf093cb0af0498b7b54dc2e181404"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga939cf093cb0af0498b7b54dc2e181404">◆ </a></span>GLFWgammaramp</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">typedef struct <a class="el" href="structGLFWgammaramp.html">GLFWgammaramp</a> <a class="el" href="structGLFWgammaramp.html">GLFWgammaramp</a></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >This describes the gamma ramp for a monitor.</p>
|
||||||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="monitor_guide.html#monitor_gamma">Gamma ramp</a> </dd>
|
||||||
|
<dd>
|
||||||
|
<a class="el" href="group__monitor.html#ga76ba90debcf0062b5c4b73052b24f96f">glfwGetGammaRamp</a> </dd>
|
||||||
|
<dd>
|
||||||
|
<a class="el" href="group__monitor.html#ga583f0ffd0d29613d8cd172b996bbf0dd">glfwSetGammaRamp</a></dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.0. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<h2 class="groupheader">Function Documentation</h2>
|
||||||
|
<a id="ga70b1156d5d24e9928f145d6c864369d2" name="ga70b1156d5d24e9928f145d6c864369d2"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga70b1156d5d24e9928f145d6c864369d2">◆ </a></span>glfwGetMonitors()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname"><a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> ** glfwGetMonitors </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">int * </td>
|
||||||
|
<td class="paramname"><em>count</em></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >This function returns an array of handles for all currently connected monitors. The primary monitor is always first in the returned array. If no monitors were found, this function returns <code>NULL</code>.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramdir">[out]</td><td class="paramname">count</td><td>Where to store the number of monitors in the returned array. This is set to zero if an error occurred. </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>An array of monitor handles, or <code>NULL</code> if no monitors were found or if an <a class="el" href="intro_guide.html#error_handling">error</a> occurred.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Pointer lifetime</dt><dd>The returned array is allocated and freed by GLFW. You should not free it yourself. It is guaranteed to be valid only until the monitor configuration changes or the library is terminated.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function must only be called from the main thread.</dd></dl>
|
||||||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="monitor_guide.html#monitor_monitors">Retrieving monitors</a> </dd>
|
||||||
|
<dd>
|
||||||
|
<a class="el" href="monitor_guide.html#monitor_event">Monitor configuration changes</a> </dd>
|
||||||
|
<dd>
|
||||||
|
<a class="el" href="group__monitor.html#gac3adb24947eb709e1874028272e5dfc5">glfwGetPrimaryMonitor</a></dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.0. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gac3adb24947eb709e1874028272e5dfc5" name="gac3adb24947eb709e1874028272e5dfc5"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gac3adb24947eb709e1874028272e5dfc5">◆ </a></span>glfwGetPrimaryMonitor()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname"><a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> * glfwGetPrimaryMonitor </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">void </td>
|
||||||
|
<td class="paramname"></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >This function returns the primary monitor. This is usually the monitor where elements like the task bar or global menu bar are located.</p>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>The primary monitor, or <code>NULL</code> if no monitors were found or if an <a class="el" href="intro_guide.html#error_handling">error</a> occurred.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function must only be called from the main thread.</dd></dl>
|
||||||
|
<dl class="section remark"><dt>Remarks</dt><dd>The primary monitor is always first in the array returned by <a class="el" href="group__monitor.html#ga70b1156d5d24e9928f145d6c864369d2">glfwGetMonitors</a>.</dd></dl>
|
||||||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="monitor_guide.html#monitor_monitors">Retrieving monitors</a> </dd>
|
||||||
|
<dd>
|
||||||
|
<a class="el" href="group__monitor.html#ga70b1156d5d24e9928f145d6c864369d2">glfwGetMonitors</a></dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.0. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga102f54e7acc9149edbcf0997152df8c9" name="ga102f54e7acc9149edbcf0997152df8c9"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga102f54e7acc9149edbcf0997152df8c9">◆ </a></span>glfwGetMonitorPos()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">void glfwGetMonitorPos </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype"><a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> * </td>
|
||||||
|
<td class="paramname"><em>monitor</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">int * </td>
|
||||||
|
<td class="paramname"><em>xpos</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">int * </td>
|
||||||
|
<td class="paramname"><em>ypos</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >This function returns the position, in screen coordinates, of the upper-left corner of the specified monitor.</p>
|
||||||
|
<p >Any or all of the position arguments may be <code>NULL</code>. If an error occurs, all non-<code>NULL</code> position arguments will be set to zero.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramdir">[in]</td><td class="paramname">monitor</td><td>The monitor to query. </td></tr>
|
||||||
|
<tr><td class="paramdir">[out]</td><td class="paramname">xpos</td><td>Where to store the monitor x-coordinate, or <code>NULL</code>. </td></tr>
|
||||||
|
<tr><td class="paramdir">[out]</td><td class="paramname">ypos</td><td>Where to store the monitor y-coordinate, or <code>NULL</code>.</td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a> and <a class="el" href="group__errors.html#gad44162d78100ea5e87cdd38426b8c7a1">GLFW_PLATFORM_ERROR</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function must only be called from the main thread.</dd></dl>
|
||||||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="monitor_guide.html#monitor_properties">Monitor properties</a></dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.0. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga7387a3bdb64bfe8ebf2b9e54f5b6c9d0" name="ga7387a3bdb64bfe8ebf2b9e54f5b6c9d0"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga7387a3bdb64bfe8ebf2b9e54f5b6c9d0">◆ </a></span>glfwGetMonitorWorkarea()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">void glfwGetMonitorWorkarea </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype"><a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> * </td>
|
||||||
|
<td class="paramname"><em>monitor</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">int * </td>
|
||||||
|
<td class="paramname"><em>xpos</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">int * </td>
|
||||||
|
<td class="paramname"><em>ypos</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">int * </td>
|
||||||
|
<td class="paramname"><em>width</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">int * </td>
|
||||||
|
<td class="paramname"><em>height</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >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 operating system task bar where present. If no task bar exists then the work area is the monitor resolution in screen coordinates.</p>
|
||||||
|
<p >Any or all of the position and size arguments may be <code>NULL</code>. If an error occurs, all non-<code>NULL</code> position and size arguments will be set to zero.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramdir">[in]</td><td class="paramname">monitor</td><td>The monitor to query. </td></tr>
|
||||||
|
<tr><td class="paramdir">[out]</td><td class="paramname">xpos</td><td>Where to store the monitor x-coordinate, or <code>NULL</code>. </td></tr>
|
||||||
|
<tr><td class="paramdir">[out]</td><td class="paramname">ypos</td><td>Where to store the monitor y-coordinate, or <code>NULL</code>. </td></tr>
|
||||||
|
<tr><td class="paramdir">[out]</td><td class="paramname">width</td><td>Where to store the monitor width, or <code>NULL</code>. </td></tr>
|
||||||
|
<tr><td class="paramdir">[out]</td><td class="paramname">height</td><td>Where to store the monitor height, or <code>NULL</code>.</td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a> and <a class="el" href="group__errors.html#gad44162d78100ea5e87cdd38426b8c7a1">GLFW_PLATFORM_ERROR</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function must only be called from the main thread.</dd></dl>
|
||||||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="monitor_guide.html#monitor_workarea">Work area</a></dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.3. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga7d8bffc6c55539286a6bd20d32a8d7ea" name="ga7d8bffc6c55539286a6bd20d32a8d7ea"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga7d8bffc6c55539286a6bd20d32a8d7ea">◆ </a></span>glfwGetMonitorPhysicalSize()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">void glfwGetMonitorPhysicalSize </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype"><a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> * </td>
|
||||||
|
<td class="paramname"><em>monitor</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">int * </td>
|
||||||
|
<td class="paramname"><em>widthMM</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">int * </td>
|
||||||
|
<td class="paramname"><em>heightMM</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >This function returns the size, in millimetres, of the display area of the specified monitor.</p>
|
||||||
|
<p >Some systems do not provide accurate monitor size information, either because the monitor <a href="https://en.wikipedia.org/wiki/Extended_display_identification_data">EDID</a> data is incorrect or because the driver does not report it accurately.</p>
|
||||||
|
<p >Any or all of the size arguments may be <code>NULL</code>. If an error occurs, all non-<code>NULL</code> size arguments will be set to zero.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramdir">[in]</td><td class="paramname">monitor</td><td>The monitor to query. </td></tr>
|
||||||
|
<tr><td class="paramdir">[out]</td><td class="paramname">widthMM</td><td>Where to store the width, in millimetres, of the monitor's display area, or <code>NULL</code>. </td></tr>
|
||||||
|
<tr><td class="paramdir">[out]</td><td class="paramname">heightMM</td><td>Where to store the height, in millimetres, of the monitor's display area, or <code>NULL</code>.</td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a>.</dd></dl>
|
||||||
|
<dl class="section remark"><dt>Remarks</dt><dd><b>Windows:</b> On Windows 8 and earlier the physical size is calculated from the current resolution and system DPI instead of querying the monitor EDID data.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function must only be called from the main thread.</dd></dl>
|
||||||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="monitor_guide.html#monitor_properties">Monitor properties</a></dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.0. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gad3152e84465fa620b601265ebfcdb21b" name="gad3152e84465fa620b601265ebfcdb21b"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gad3152e84465fa620b601265ebfcdb21b">◆ </a></span>glfwGetMonitorContentScale()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">void glfwGetMonitorContentScale </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype"><a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> * </td>
|
||||||
|
<td class="paramname"><em>monitor</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">float * </td>
|
||||||
|
<td class="paramname"><em>xscale</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">float * </td>
|
||||||
|
<td class="paramname"><em>yscale</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >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.</p>
|
||||||
|
<p >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.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramdir">[in]</td><td class="paramname">monitor</td><td>The monitor to query. </td></tr>
|
||||||
|
<tr><td class="paramdir">[out]</td><td class="paramname">xscale</td><td>Where to store the x-axis content scale, or <code>NULL</code>. </td></tr>
|
||||||
|
<tr><td class="paramdir">[out]</td><td class="paramname">yscale</td><td>Where to store the y-axis content scale, or <code>NULL</code>.</td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a> and <a class="el" href="group__errors.html#gad44162d78100ea5e87cdd38426b8c7a1">GLFW_PLATFORM_ERROR</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function must only be called from the main thread.</dd></dl>
|
||||||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="monitor_guide.html#monitor_scale">Content scale</a> </dd>
|
||||||
|
<dd>
|
||||||
|
<a class="el" href="group__window.html#gaf5d31de9c19c4f994facea64d2b3106c">glfwGetWindowContentScale</a></dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.3. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga7af83e13489d90379588fb331b9e4b68" name="ga7af83e13489d90379588fb331b9e4b68"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga7af83e13489d90379588fb331b9e4b68">◆ </a></span>glfwGetMonitorName()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">const char * glfwGetMonitorName </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype"><a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> * </td>
|
||||||
|
<td class="paramname"><em>monitor</em></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >This function returns a human-readable name, encoded as UTF-8, of the specified monitor. The name typically reflects the make and model of the monitor and is not guaranteed to be unique among the connected monitors.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramdir">[in]</td><td class="paramname">monitor</td><td>The monitor to query. </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>The UTF-8 encoded name of the monitor, or <code>NULL</code> if an <a class="el" href="intro_guide.html#error_handling">error</a> occurred.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Pointer lifetime</dt><dd>The returned string is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified monitor is disconnected or the library is terminated.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function must only be called from the main thread.</dd></dl>
|
||||||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="monitor_guide.html#monitor_properties">Monitor properties</a></dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.0. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga702750e24313a686d3637297b6e85fda" name="ga702750e24313a686d3637297b6e85fda"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga702750e24313a686d3637297b6e85fda">◆ </a></span>glfwSetMonitorUserPointer()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">void glfwSetMonitorUserPointer </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype"><a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> * </td>
|
||||||
|
<td class="paramname"><em>monitor</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">void * </td>
|
||||||
|
<td class="paramname"><em>pointer</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >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 <code>NULL</code>.</p>
|
||||||
|
<p >This function may be called from the monitor callback, even for a monitor that is being disconnected.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramdir">[in]</td><td class="paramname">monitor</td><td>The monitor whose pointer to set. </td></tr>
|
||||||
|
<tr><td class="paramdir">[in]</td><td class="paramname">pointer</td><td>The new value.</td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function may be called from any thread. Access is not synchronized.</dd></dl>
|
||||||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="monitor_guide.html#monitor_userptr">User pointer</a> </dd>
|
||||||
|
<dd>
|
||||||
|
<a class="el" href="group__monitor.html#ga1adbfbfb8cd58b23cfee82e574fbbdc5">glfwGetMonitorUserPointer</a></dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.3. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga1adbfbfb8cd58b23cfee82e574fbbdc5" name="ga1adbfbfb8cd58b23cfee82e574fbbdc5"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga1adbfbfb8cd58b23cfee82e574fbbdc5">◆ </a></span>glfwGetMonitorUserPointer()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">void * glfwGetMonitorUserPointer </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype"><a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> * </td>
|
||||||
|
<td class="paramname"><em>monitor</em></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >This function returns the current value of the user-defined pointer of the specified monitor. The initial value is <code>NULL</code>.</p>
|
||||||
|
<p >This function may be called from the monitor callback, even for a monitor that is being disconnected.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramdir">[in]</td><td class="paramname">monitor</td><td>The monitor whose pointer to return.</td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function may be called from any thread. Access is not synchronized.</dd></dl>
|
||||||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="monitor_guide.html#monitor_userptr">User pointer</a> </dd>
|
||||||
|
<dd>
|
||||||
|
<a class="el" href="group__monitor.html#ga702750e24313a686d3637297b6e85fda">glfwSetMonitorUserPointer</a></dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.3. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gab39df645587c8518192aa746c2fb06c3" name="gab39df645587c8518192aa746c2fb06c3"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gab39df645587c8518192aa746c2fb06c3">◆ </a></span>glfwSetMonitorCallback()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname"><a class="el" href="group__monitor.html#gaabe16caca8dea952504dfdebdf4cd249">GLFWmonitorfun</a> glfwSetMonitorCallback </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype"><a class="el" href="group__monitor.html#gaabe16caca8dea952504dfdebdf4cd249">GLFWmonitorfun</a> </td>
|
||||||
|
<td class="paramname"><em>callback</em></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >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.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramdir">[in]</td><td class="paramname">callback</td><td>The new callback, or <code>NULL</code> to remove the currently set callback. </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>The previously set callback, or <code>NULL</code> if no callback was set or the library had not been <a class="el" href="intro_guide.html#intro_init">initialized</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Callback signature</dt><dd><div class="fragment"><div class="line"><span class="keywordtype">void</span> function_name(<a class="code hl_typedef" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a>* monitor, <span class="keywordtype">int</span> event)</div>
|
||||||
|
</div><!-- fragment --> For more information about the callback parameters, see the <a class="el" href="group__monitor.html#gaabe16caca8dea952504dfdebdf4cd249">function pointer type</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function must only be called from the main thread.</dd></dl>
|
||||||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="monitor_guide.html#monitor_event">Monitor configuration changes</a></dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.0. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gad2e24d2843cb7d6c26202cddd530fc1b" name="gad2e24d2843cb7d6c26202cddd530fc1b"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gad2e24d2843cb7d6c26202cddd530fc1b">◆ </a></span>glfwGetVideoModes()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">const <a class="el" href="structGLFWvidmode.html">GLFWvidmode</a> * glfwGetVideoModes </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype"><a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> * </td>
|
||||||
|
<td class="paramname"><em>monitor</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">int * </td>
|
||||||
|
<td class="paramname"><em>count</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >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), then by resolution area (the product of width and height), then resolution width and finally by refresh rate.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramdir">[in]</td><td class="paramname">monitor</td><td>The monitor to query. </td></tr>
|
||||||
|
<tr><td class="paramdir">[out]</td><td class="paramname">count</td><td>Where to store the number of video modes in the returned array. This is set to zero if an error occurred. </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>An array of video modes, or <code>NULL</code> if an <a class="el" href="intro_guide.html#error_handling">error</a> occurred.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a> and <a class="el" href="group__errors.html#gad44162d78100ea5e87cdd38426b8c7a1">GLFW_PLATFORM_ERROR</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Pointer lifetime</dt><dd>The returned array is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified monitor is disconnected, this function is called again for that monitor or the library is terminated.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function must only be called from the main thread.</dd></dl>
|
||||||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="monitor_guide.html#monitor_modes">Video modes</a> </dd>
|
||||||
|
<dd>
|
||||||
|
<a class="el" href="group__monitor.html#gaba376fa7e76634b4788bddc505d6c9d5">glfwGetVideoMode</a></dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 1.0. <b>GLFW 3:</b> Changed to return an array of modes for a specific monitor. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gaba376fa7e76634b4788bddc505d6c9d5" name="gaba376fa7e76634b4788bddc505d6c9d5"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gaba376fa7e76634b4788bddc505d6c9d5">◆ </a></span>glfwGetVideoMode()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">const <a class="el" href="structGLFWvidmode.html">GLFWvidmode</a> * glfwGetVideoMode </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype"><a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> * </td>
|
||||||
|
<td class="paramname"><em>monitor</em></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >This function returns the current video mode of the specified monitor. If you have created a full screen window for that monitor, the return value will depend on whether that window is iconified.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramdir">[in]</td><td class="paramname">monitor</td><td>The monitor to query. </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>The current mode of the monitor, or <code>NULL</code> if an <a class="el" href="intro_guide.html#error_handling">error</a> occurred.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a> and <a class="el" href="group__errors.html#gad44162d78100ea5e87cdd38426b8c7a1">GLFW_PLATFORM_ERROR</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Pointer lifetime</dt><dd>The returned array is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified monitor is disconnected or the library is terminated.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function must only be called from the main thread.</dd></dl>
|
||||||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="monitor_guide.html#monitor_modes">Video modes</a> </dd>
|
||||||
|
<dd>
|
||||||
|
<a class="el" href="group__monitor.html#gad2e24d2843cb7d6c26202cddd530fc1b">glfwGetVideoModes</a></dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.0. Replaces <code>glfwGetDesktopMode</code>. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga6ac582625c990220785ddd34efa3169a" name="ga6ac582625c990220785ddd34efa3169a"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga6ac582625c990220785ddd34efa3169a">◆ </a></span>glfwSetGamma()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">void glfwSetGamma </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype"><a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> * </td>
|
||||||
|
<td class="paramname"><em>monitor</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">float </td>
|
||||||
|
<td class="paramname"><em>gamma</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >This function generates an appropriately sized gamma ramp from the specified exponent and then calls <a class="el" href="group__monitor.html#ga583f0ffd0d29613d8cd172b996bbf0dd">glfwSetGammaRamp</a> with it. The value must be a finite number greater than zero.</p>
|
||||||
|
<p >The software controlled gamma ramp is applied <em>in addition</em> to the hardware gamma correction, which today is usually 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.</p>
|
||||||
|
<p >For gamma correct rendering with OpenGL or OpenGL ES, see the <a class="el" href="window_guide.html#GLFW_SRGB_CAPABLE">GLFW_SRGB_CAPABLE</a> hint.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramdir">[in]</td><td class="paramname">monitor</td><td>The monitor whose gamma ramp to set. </td></tr>
|
||||||
|
<tr><td class="paramdir">[in]</td><td class="paramname">gamma</td><td>The desired exponent.</td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a>, <a class="el" href="group__errors.html#gaaf2ef9aa8202c2b82ac2d921e554c687">GLFW_INVALID_VALUE</a> and <a class="el" href="group__errors.html#gad44162d78100ea5e87cdd38426b8c7a1">GLFW_PLATFORM_ERROR</a>.</dd></dl>
|
||||||
|
<dl class="section remark"><dt>Remarks</dt><dd><b>Wayland:</b> Gamma handling is a privileged protocol, this function will thus never be implemented and emits <a class="el" href="group__errors.html#gad44162d78100ea5e87cdd38426b8c7a1">GLFW_PLATFORM_ERROR</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function must only be called from the main thread.</dd></dl>
|
||||||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="monitor_guide.html#monitor_gamma">Gamma ramp</a></dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.0. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga76ba90debcf0062b5c4b73052b24f96f" name="ga76ba90debcf0062b5c4b73052b24f96f"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga76ba90debcf0062b5c4b73052b24f96f">◆ </a></span>glfwGetGammaRamp()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">const <a class="el" href="structGLFWgammaramp.html">GLFWgammaramp</a> * glfwGetGammaRamp </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype"><a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> * </td>
|
||||||
|
<td class="paramname"><em>monitor</em></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >This function returns the current gamma ramp of the specified monitor.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramdir">[in]</td><td class="paramname">monitor</td><td>The monitor to query. </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>The current gamma ramp, or <code>NULL</code> if an <a class="el" href="intro_guide.html#error_handling">error</a> occurred.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a> and <a class="el" href="group__errors.html#gad44162d78100ea5e87cdd38426b8c7a1">GLFW_PLATFORM_ERROR</a>.</dd></dl>
|
||||||
|
<dl class="section remark"><dt>Remarks</dt><dd><b>Wayland:</b> Gamma handling is a privileged protocol, this function will thus never be implemented and emits <a class="el" href="group__errors.html#gad44162d78100ea5e87cdd38426b8c7a1">GLFW_PLATFORM_ERROR</a> while returning <code>NULL</code>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Pointer lifetime</dt><dd>The returned structure and its arrays are allocated and freed by GLFW. You should not free them yourself. They are valid until the specified monitor is disconnected, this function is called again for that monitor or the library is terminated.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function must only be called from the main thread.</dd></dl>
|
||||||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="monitor_guide.html#monitor_gamma">Gamma ramp</a></dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.0. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga583f0ffd0d29613d8cd172b996bbf0dd" name="ga583f0ffd0d29613d8cd172b996bbf0dd"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga583f0ffd0d29613d8cd172b996bbf0dd">◆ </a></span>glfwSetGammaRamp()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">void glfwSetGammaRamp </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype"><a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> * </td>
|
||||||
|
<td class="paramname"><em>monitor</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">const <a class="el" href="structGLFWgammaramp.html">GLFWgammaramp</a> * </td>
|
||||||
|
<td class="paramname"><em>ramp</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >This function sets the current gamma ramp for the specified monitor. The original gamma ramp for that monitor is saved by GLFW the first time this function is called and is restored by <a class="el" href="group__init.html#gaaae48c0a18607ea4a4ba951d939f0901">glfwTerminate</a>.</p>
|
||||||
|
<p >The software controlled gamma ramp is applied <em>in addition</em> to the hardware gamma correction, which today is usually 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.</p>
|
||||||
|
<p >For gamma correct rendering with OpenGL or OpenGL ES, see the <a class="el" href="window_guide.html#GLFW_SRGB_CAPABLE">GLFW_SRGB_CAPABLE</a> hint.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramdir">[in]</td><td class="paramname">monitor</td><td>The monitor whose gamma ramp to set. </td></tr>
|
||||||
|
<tr><td class="paramdir">[in]</td><td class="paramname">ramp</td><td>The gamma ramp to use.</td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a> and <a class="el" href="group__errors.html#gad44162d78100ea5e87cdd38426b8c7a1">GLFW_PLATFORM_ERROR</a>.</dd></dl>
|
||||||
|
<dl class="section remark"><dt>Remarks</dt><dd>The size of the specified gamma ramp should match the size of the current ramp for that monitor.</dd>
|
||||||
|
<dd>
|
||||||
|
<b>Windows:</b> The gamma ramp size must be 256.</dd>
|
||||||
|
<dd>
|
||||||
|
<b>Wayland:</b> Gamma handling is a privileged protocol, this function will thus never be implemented and emits <a class="el" href="group__errors.html#gad44162d78100ea5e87cdd38426b8c7a1">GLFW_PLATFORM_ERROR</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Pointer lifetime</dt><dd>The specified gamma ramp is copied before this function returns.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function must only be called from the main thread.</dd></dl>
|
||||||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="monitor_guide.html#monitor_gamma">Gamma ramp</a></dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.0. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div><!-- contents -->
|
||||||
|
<address class="footer">
|
||||||
|
<p>
|
||||||
|
Last update on Fri Jul 22 2022 for GLFW 3.3.8
|
||||||
|
</p>
|
||||||
|
</address>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,805 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.9.4"/>
|
||||||
|
<title>GLFW: Native access</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="extra.css" rel="stylesheet" type="text/css"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<div class="glfwheader">
|
||||||
|
<a href="https://www.glfw.org/" id="glfwhome">GLFW</a>
|
||||||
|
<ul class="glfwnavbar">
|
||||||
|
<li><a href="https://www.glfw.org/documentation.html">Documentation</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/download.html">Download</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/community.html">Community</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.9.4 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src="menudata.js"></script>
|
||||||
|
<script type="text/javascript" src="menu.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
$(function() {
|
||||||
|
initMenu('',true,false,'search.php','Search');
|
||||||
|
$(document).ready(function() { init_search(); });
|
||||||
|
});
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<div id="main-nav"></div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="header">
|
||||||
|
<div class="summary">
|
||||||
|
<a href="#func-members">Functions</a> </div>
|
||||||
|
<div class="headertitle"><div class="title">Native access</div></div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<a name="details" id="details"></a><h2 class="groupheader">Description</h2>
|
||||||
|
<p ><b>By using the native access functions you assert that you know what you're doing and how to fix problems caused by using them. If you don't, you shouldn't be using them.</b></p>
|
||||||
|
<p >Before the inclusion of <a class="el" href="glfw3native_8h.html">glfw3native.h</a>, you may define zero or more window system API macro and zero or more context creation API macros.</p>
|
||||||
|
<p >The chosen backends must match those the library was compiled for. Failure to do this will cause a link-time error.</p>
|
||||||
|
<p >The available window API macros are:</p><ul>
|
||||||
|
<li><code>GLFW_EXPOSE_NATIVE_WIN32</code></li>
|
||||||
|
<li><code>GLFW_EXPOSE_NATIVE_COCOA</code></li>
|
||||||
|
<li><code>GLFW_EXPOSE_NATIVE_X11</code></li>
|
||||||
|
<li><code>GLFW_EXPOSE_NATIVE_WAYLAND</code></li>
|
||||||
|
</ul>
|
||||||
|
<p >The available context API macros are:</p><ul>
|
||||||
|
<li><code>GLFW_EXPOSE_NATIVE_WGL</code></li>
|
||||||
|
<li><code>GLFW_EXPOSE_NATIVE_NSGL</code></li>
|
||||||
|
<li><code>GLFW_EXPOSE_NATIVE_GLX</code></li>
|
||||||
|
<li><code>GLFW_EXPOSE_NATIVE_EGL</code></li>
|
||||||
|
<li><code>GLFW_EXPOSE_NATIVE_OSMESA</code></li>
|
||||||
|
</ul>
|
||||||
|
<p >These macros select which of the native access functions that are declared 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.</p>
|
||||||
|
<p >If you do not want the platform-specific headers to be included, define <code>GLFW_NATIVE_INCLUDE_NONE</code> before including the <a class="el" href="glfw3native_8h.html">glfw3native.h</a> header.</p>
|
||||||
|
<div class="fragment"><div class="line"><span class="preprocessor">#define GLFW_EXPOSE_NATIVE_WIN32</span></div>
|
||||||
|
<div class="line"><span class="preprocessor">#define GLFW_EXPOSE_NATIVE_WGL</span></div>
|
||||||
|
<div class="line"><span class="preprocessor">#define GLFW_NATIVE_INCLUDE_NONE</span></div>
|
||||||
|
<div class="line"><span class="preprocessor">#include <<a class="code" href="glfw3native_8h.html">GLFW/glfw3native.h</a>></span></div>
|
||||||
|
<div class="ttc" id="aglfw3native_8h_html"><div class="ttname"><a href="glfw3native_8h.html">glfw3native.h</a></div><div class="ttdoc">The header of the native access functions.</div></div>
|
||||||
|
</div><!-- fragment --> <table class="memberdecls">
|
||||||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
|
||||||
|
Functions</h2></td></tr>
|
||||||
|
<tr class="memitem:gad4d3e9242536c0ba6be88a98f4c73a41"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#gad4d3e9242536c0ba6be88a98f4c73a41">glfwGetWin32Adapter</a> (<a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> *monitor)</td></tr>
|
||||||
|
<tr class="memdesc:gad4d3e9242536c0ba6be88a98f4c73a41"><td class="mdescLeft"> </td><td class="mdescRight">Returns the adapter device name of the specified monitor. <a href="group__native.html#gad4d3e9242536c0ba6be88a98f4c73a41">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:gad4d3e9242536c0ba6be88a98f4c73a41"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gac845f7dbe4c1d7fdd682a3c6fdae6766"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#gac845f7dbe4c1d7fdd682a3c6fdae6766">glfwGetWin32Monitor</a> (<a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> *monitor)</td></tr>
|
||||||
|
<tr class="memdesc:gac845f7dbe4c1d7fdd682a3c6fdae6766"><td class="mdescLeft"> </td><td class="mdescRight">Returns the display device name of the specified monitor. <a href="group__native.html#gac845f7dbe4c1d7fdd682a3c6fdae6766">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:gac845f7dbe4c1d7fdd682a3c6fdae6766"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gafe5079aa79038b0079fc09d5f0a8e667"><td class="memItemLeft" align="right" valign="top">HWND </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#gafe5079aa79038b0079fc09d5f0a8e667">glfwGetWin32Window</a> (<a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> *window)</td></tr>
|
||||||
|
<tr class="memdesc:gafe5079aa79038b0079fc09d5f0a8e667"><td class="mdescLeft"> </td><td class="mdescRight">Returns the <code>HWND</code> of the specified window. <a href="group__native.html#gafe5079aa79038b0079fc09d5f0a8e667">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:gafe5079aa79038b0079fc09d5f0a8e667"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gadc4010d91d9cc1134d040eeb1202a143"><td class="memItemLeft" align="right" valign="top">HGLRC </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#gadc4010d91d9cc1134d040eeb1202a143">glfwGetWGLContext</a> (<a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> *window)</td></tr>
|
||||||
|
<tr class="memdesc:gadc4010d91d9cc1134d040eeb1202a143"><td class="mdescLeft"> </td><td class="mdescRight">Returns the <code>HGLRC</code> of the specified window. <a href="group__native.html#gadc4010d91d9cc1134d040eeb1202a143">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:gadc4010d91d9cc1134d040eeb1202a143"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gaf22f429aec4b1aab316142d66d9be3e6"><td class="memItemLeft" align="right" valign="top">CGDirectDisplayID </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#gaf22f429aec4b1aab316142d66d9be3e6">glfwGetCocoaMonitor</a> (<a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> *monitor)</td></tr>
|
||||||
|
<tr class="memdesc:gaf22f429aec4b1aab316142d66d9be3e6"><td class="mdescLeft"> </td><td class="mdescRight">Returns the <code>CGDirectDisplayID</code> of the specified monitor. <a href="group__native.html#gaf22f429aec4b1aab316142d66d9be3e6">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:gaf22f429aec4b1aab316142d66d9be3e6"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gac3ed9d495d0c2bb9652de5a50c648715"><td class="memItemLeft" align="right" valign="top">id </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#gac3ed9d495d0c2bb9652de5a50c648715">glfwGetCocoaWindow</a> (<a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> *window)</td></tr>
|
||||||
|
<tr class="memdesc:gac3ed9d495d0c2bb9652de5a50c648715"><td class="mdescLeft"> </td><td class="mdescRight">Returns the <code>NSWindow</code> of the specified window. <a href="group__native.html#gac3ed9d495d0c2bb9652de5a50c648715">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:gac3ed9d495d0c2bb9652de5a50c648715"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga559e002e3cd63c979881770cd4dc63bc"><td class="memItemLeft" align="right" valign="top">id </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#ga559e002e3cd63c979881770cd4dc63bc">glfwGetNSGLContext</a> (<a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> *window)</td></tr>
|
||||||
|
<tr class="memdesc:ga559e002e3cd63c979881770cd4dc63bc"><td class="mdescLeft"> </td><td class="mdescRight">Returns the <code>NSOpenGLContext</code> of the specified window. <a href="group__native.html#ga559e002e3cd63c979881770cd4dc63bc">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga559e002e3cd63c979881770cd4dc63bc"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga6e7822385cc8a1cc3b18f60352830189"><td class="memItemLeft" align="right" valign="top">Display * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#ga6e7822385cc8a1cc3b18f60352830189">glfwGetX11Display</a> (void)</td></tr>
|
||||||
|
<tr class="memdesc:ga6e7822385cc8a1cc3b18f60352830189"><td class="mdescLeft"> </td><td class="mdescRight">Returns the <code>Display</code> used by GLFW. <a href="group__native.html#ga6e7822385cc8a1cc3b18f60352830189">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga6e7822385cc8a1cc3b18f60352830189"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga088fbfa80f50569402b41be71ad66e40"><td class="memItemLeft" align="right" valign="top">RRCrtc </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#ga088fbfa80f50569402b41be71ad66e40">glfwGetX11Adapter</a> (<a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> *monitor)</td></tr>
|
||||||
|
<tr class="memdesc:ga088fbfa80f50569402b41be71ad66e40"><td class="mdescLeft"> </td><td class="mdescRight">Returns the <code>RRCrtc</code> of the specified monitor. <a href="group__native.html#ga088fbfa80f50569402b41be71ad66e40">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga088fbfa80f50569402b41be71ad66e40"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gab2f8cc043905e9fa9b12bfdbbcfe874c"><td class="memItemLeft" align="right" valign="top">RROutput </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#gab2f8cc043905e9fa9b12bfdbbcfe874c">glfwGetX11Monitor</a> (<a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> *monitor)</td></tr>
|
||||||
|
<tr class="memdesc:gab2f8cc043905e9fa9b12bfdbbcfe874c"><td class="mdescLeft"> </td><td class="mdescRight">Returns the <code>RROutput</code> of the specified monitor. <a href="group__native.html#gab2f8cc043905e9fa9b12bfdbbcfe874c">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:gab2f8cc043905e9fa9b12bfdbbcfe874c"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga90ca676322740842db446999a1b1f21d"><td class="memItemLeft" align="right" valign="top">Window </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#ga90ca676322740842db446999a1b1f21d">glfwGetX11Window</a> (<a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> *window)</td></tr>
|
||||||
|
<tr class="memdesc:ga90ca676322740842db446999a1b1f21d"><td class="mdescLeft"> </td><td class="mdescRight">Returns the <code>Window</code> of the specified window. <a href="group__native.html#ga90ca676322740842db446999a1b1f21d">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga90ca676322740842db446999a1b1f21d"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga55f879ab02d93367f966186b6f0133f7"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#ga55f879ab02d93367f966186b6f0133f7">glfwSetX11SelectionString</a> (const char *string)</td></tr>
|
||||||
|
<tr class="memdesc:ga55f879ab02d93367f966186b6f0133f7"><td class="mdescLeft"> </td><td class="mdescRight">Sets the current primary selection to the specified string. <a href="group__native.html#ga55f879ab02d93367f966186b6f0133f7">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga55f879ab02d93367f966186b6f0133f7"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gae084ef64dc0db140b455b1427256d3f7"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#gae084ef64dc0db140b455b1427256d3f7">glfwGetX11SelectionString</a> (void)</td></tr>
|
||||||
|
<tr class="memdesc:gae084ef64dc0db140b455b1427256d3f7"><td class="mdescLeft"> </td><td class="mdescRight">Returns the contents of the current primary selection as a string. <a href="group__native.html#gae084ef64dc0db140b455b1427256d3f7">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:gae084ef64dc0db140b455b1427256d3f7"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga62d884114b0abfcdc2930e89f20867e2"><td class="memItemLeft" align="right" valign="top">GLXContext </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#ga62d884114b0abfcdc2930e89f20867e2">glfwGetGLXContext</a> (<a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> *window)</td></tr>
|
||||||
|
<tr class="memdesc:ga62d884114b0abfcdc2930e89f20867e2"><td class="mdescLeft"> </td><td class="mdescRight">Returns the <code>GLXContext</code> of the specified window. <a href="group__native.html#ga62d884114b0abfcdc2930e89f20867e2">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga62d884114b0abfcdc2930e89f20867e2"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga1ed27b8766e859a21381e8f8ce18d049"><td class="memItemLeft" align="right" valign="top">GLXWindow </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#ga1ed27b8766e859a21381e8f8ce18d049">glfwGetGLXWindow</a> (<a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> *window)</td></tr>
|
||||||
|
<tr class="memdesc:ga1ed27b8766e859a21381e8f8ce18d049"><td class="mdescLeft"> </td><td class="mdescRight">Returns the <code>GLXWindow</code> of the specified window. <a href="group__native.html#ga1ed27b8766e859a21381e8f8ce18d049">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga1ed27b8766e859a21381e8f8ce18d049"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gacbe11f93ce20621de82989bbba94e62a"><td class="memItemLeft" align="right" valign="top">struct wl_display * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#gacbe11f93ce20621de82989bbba94e62a">glfwGetWaylandDisplay</a> (void)</td></tr>
|
||||||
|
<tr class="memdesc:gacbe11f93ce20621de82989bbba94e62a"><td class="mdescLeft"> </td><td class="mdescRight">Returns the <code>struct wl_display*</code> used by GLFW. <a href="group__native.html#gacbe11f93ce20621de82989bbba94e62a">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:gacbe11f93ce20621de82989bbba94e62a"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga4f16066bd4c59e2f99418adfcb43dd16"><td class="memItemLeft" align="right" valign="top">struct wl_output * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#ga4f16066bd4c59e2f99418adfcb43dd16">glfwGetWaylandMonitor</a> (<a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> *monitor)</td></tr>
|
||||||
|
<tr class="memdesc:ga4f16066bd4c59e2f99418adfcb43dd16"><td class="mdescLeft"> </td><td class="mdescRight">Returns the <code>struct wl_output*</code> of the specified monitor. <a href="group__native.html#ga4f16066bd4c59e2f99418adfcb43dd16">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga4f16066bd4c59e2f99418adfcb43dd16"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga5c597f2841229d9626f0811cca41ceb3"><td class="memItemLeft" align="right" valign="top">struct wl_surface * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#ga5c597f2841229d9626f0811cca41ceb3">glfwGetWaylandWindow</a> (<a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> *window)</td></tr>
|
||||||
|
<tr class="memdesc:ga5c597f2841229d9626f0811cca41ceb3"><td class="mdescLeft"> </td><td class="mdescRight">Returns the main <code>struct wl_surface*</code> of the specified window. <a href="group__native.html#ga5c597f2841229d9626f0811cca41ceb3">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga5c597f2841229d9626f0811cca41ceb3"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga1cd8d973f47aacb5532d368147cc3138"><td class="memItemLeft" align="right" valign="top">EGLDisplay </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#ga1cd8d973f47aacb5532d368147cc3138">glfwGetEGLDisplay</a> (void)</td></tr>
|
||||||
|
<tr class="memdesc:ga1cd8d973f47aacb5532d368147cc3138"><td class="mdescLeft"> </td><td class="mdescRight">Returns the <code>EGLDisplay</code> used by GLFW. <a href="group__native.html#ga1cd8d973f47aacb5532d368147cc3138">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga1cd8d973f47aacb5532d368147cc3138"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga671c5072becd085f4ab5771a9c8efcf1"><td class="memItemLeft" align="right" valign="top">EGLContext </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#ga671c5072becd085f4ab5771a9c8efcf1">glfwGetEGLContext</a> (<a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> *window)</td></tr>
|
||||||
|
<tr class="memdesc:ga671c5072becd085f4ab5771a9c8efcf1"><td class="mdescLeft"> </td><td class="mdescRight">Returns the <code>EGLContext</code> of the specified window. <a href="group__native.html#ga671c5072becd085f4ab5771a9c8efcf1">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga671c5072becd085f4ab5771a9c8efcf1"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga2199b36117a6a695fec8441d8052eee6"><td class="memItemLeft" align="right" valign="top">EGLSurface </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#ga2199b36117a6a695fec8441d8052eee6">glfwGetEGLSurface</a> (<a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> *window)</td></tr>
|
||||||
|
<tr class="memdesc:ga2199b36117a6a695fec8441d8052eee6"><td class="mdescLeft"> </td><td class="mdescRight">Returns the <code>EGLSurface</code> of the specified window. <a href="group__native.html#ga2199b36117a6a695fec8441d8052eee6">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga2199b36117a6a695fec8441d8052eee6"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga3b36e3e3dcf308b776427b6bd73cc132"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#ga3b36e3e3dcf308b776427b6bd73cc132">glfwGetOSMesaColorBuffer</a> (<a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> *window, int *width, int *height, int *format, void **buffer)</td></tr>
|
||||||
|
<tr class="memdesc:ga3b36e3e3dcf308b776427b6bd73cc132"><td class="mdescLeft"> </td><td class="mdescRight">Retrieves the color buffer associated with the specified window. <a href="group__native.html#ga3b36e3e3dcf308b776427b6bd73cc132">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga3b36e3e3dcf308b776427b6bd73cc132"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga6b64039ffc88a7a2f57f0956c0c75d53"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#ga6b64039ffc88a7a2f57f0956c0c75d53">glfwGetOSMesaDepthBuffer</a> (<a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> *window, int *width, int *height, int *bytesPerValue, void **buffer)</td></tr>
|
||||||
|
<tr class="memdesc:ga6b64039ffc88a7a2f57f0956c0c75d53"><td class="mdescLeft"> </td><td class="mdescRight">Retrieves the depth buffer associated with the specified window. <a href="group__native.html#ga6b64039ffc88a7a2f57f0956c0c75d53">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga6b64039ffc88a7a2f57f0956c0c75d53"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga9e47700080094eb569cb053afaa88773"><td class="memItemLeft" align="right" valign="top">OSMesaContext </td><td class="memItemRight" valign="bottom"><a class="el" href="group__native.html#ga9e47700080094eb569cb053afaa88773">glfwGetOSMesaContext</a> (<a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> *window)</td></tr>
|
||||||
|
<tr class="memdesc:ga9e47700080094eb569cb053afaa88773"><td class="mdescLeft"> </td><td class="mdescRight">Returns the <code>OSMesaContext</code> of the specified window. <a href="group__native.html#ga9e47700080094eb569cb053afaa88773">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga9e47700080094eb569cb053afaa88773"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
</table>
|
||||||
|
<h2 class="groupheader">Function Documentation</h2>
|
||||||
|
<a id="gad4d3e9242536c0ba6be88a98f4c73a41" name="gad4d3e9242536c0ba6be88a98f4c73a41"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gad4d3e9242536c0ba6be88a98f4c73a41">◆ </a></span>glfwGetWin32Adapter()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">const char * glfwGetWin32Adapter </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype"><a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> * </td>
|
||||||
|
<td class="paramname"><em>monitor</em></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>The UTF-8 encoded adapter device name (for example <code>\\.\DISPLAY1</code>) of the specified monitor, or <code>NULL</code> if an <a class="el" href="intro_guide.html#error_handling">error</a> occurred.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function may be called from any thread. Access is not synchronized.</dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.1. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gac845f7dbe4c1d7fdd682a3c6fdae6766" name="gac845f7dbe4c1d7fdd682a3c6fdae6766"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gac845f7dbe4c1d7fdd682a3c6fdae6766">◆ </a></span>glfwGetWin32Monitor()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">const char * glfwGetWin32Monitor </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype"><a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> * </td>
|
||||||
|
<td class="paramname"><em>monitor</em></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>The UTF-8 encoded display device name (for example <code>\\.\DISPLAY1\Monitor0</code>) of the specified monitor, or <code>NULL</code> if an <a class="el" href="intro_guide.html#error_handling">error</a> occurred.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function may be called from any thread. Access is not synchronized.</dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.1. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gafe5079aa79038b0079fc09d5f0a8e667" name="gafe5079aa79038b0079fc09d5f0a8e667"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gafe5079aa79038b0079fc09d5f0a8e667">◆ </a></span>glfwGetWin32Window()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">HWND glfwGetWin32Window </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype"><a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> * </td>
|
||||||
|
<td class="paramname"><em>window</em></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>The <code>HWND</code> of the specified window, or <code>NULL</code> if an <a class="el" href="intro_guide.html#error_handling">error</a> occurred.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a>.</dd></dl>
|
||||||
|
<dl class="section remark"><dt>Remarks</dt><dd>The <code>HDC</code> associated with the window can be queried with the <a href="https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getdc">GetDC</a> function. <div class="fragment"><div class="line">HDC dc = GetDC(<a class="code hl_function" href="group__native.html#gafe5079aa79038b0079fc09d5f0a8e667">glfwGetWin32Window</a>(window));</div>
|
||||||
|
<div class="ttc" id="agroup__native_html_gafe5079aa79038b0079fc09d5f0a8e667"><div class="ttname"><a href="group__native.html#gafe5079aa79038b0079fc09d5f0a8e667">glfwGetWin32Window</a></div><div class="ttdeci">HWND glfwGetWin32Window(GLFWwindow *window)</div><div class="ttdoc">Returns the HWND of the specified window.</div></div>
|
||||||
|
</div><!-- fragment --> This DC is private and does not need to be released.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function may be called from any thread. Access is not synchronized.</dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.0. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gadc4010d91d9cc1134d040eeb1202a143" name="gadc4010d91d9cc1134d040eeb1202a143"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gadc4010d91d9cc1134d040eeb1202a143">◆ </a></span>glfwGetWGLContext()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">HGLRC glfwGetWGLContext </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype"><a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> * </td>
|
||||||
|
<td class="paramname"><em>window</em></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>The <code>HGLRC</code> of the specified window, or <code>NULL</code> if an <a class="el" href="intro_guide.html#error_handling">error</a> occurred.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#gacff24d2757da752ae4c80bf452356487">GLFW_NO_WINDOW_CONTEXT</a> and <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a>.</dd></dl>
|
||||||
|
<dl class="section remark"><dt>Remarks</dt><dd>The <code>HDC</code> associated with the window can be queried with the <a href="https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getdc">GetDC</a> function. <div class="fragment"><div class="line">HDC dc = GetDC(<a class="code hl_function" href="group__native.html#gafe5079aa79038b0079fc09d5f0a8e667">glfwGetWin32Window</a>(window));</div>
|
||||||
|
</div><!-- fragment --> This DC is private and does not need to be released.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function may be called from any thread. Access is not synchronized.</dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.0. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gaf22f429aec4b1aab316142d66d9be3e6" name="gaf22f429aec4b1aab316142d66d9be3e6"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gaf22f429aec4b1aab316142d66d9be3e6">◆ </a></span>glfwGetCocoaMonitor()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">CGDirectDisplayID glfwGetCocoaMonitor </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype"><a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> * </td>
|
||||||
|
<td class="paramname"><em>monitor</em></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>The <code>CGDirectDisplayID</code> of the specified monitor, or <code>kCGNullDirectDisplay</code> if an <a class="el" href="intro_guide.html#error_handling">error</a> occurred.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function may be called from any thread. Access is not synchronized.</dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.1. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gac3ed9d495d0c2bb9652de5a50c648715" name="gac3ed9d495d0c2bb9652de5a50c648715"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gac3ed9d495d0c2bb9652de5a50c648715">◆ </a></span>glfwGetCocoaWindow()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">id glfwGetCocoaWindow </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype"><a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> * </td>
|
||||||
|
<td class="paramname"><em>window</em></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>The <code>NSWindow</code> of the specified window, or <code>nil</code> if an <a class="el" href="intro_guide.html#error_handling">error</a> occurred.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function may be called from any thread. Access is not synchronized.</dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.0. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga559e002e3cd63c979881770cd4dc63bc" name="ga559e002e3cd63c979881770cd4dc63bc"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga559e002e3cd63c979881770cd4dc63bc">◆ </a></span>glfwGetNSGLContext()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">id glfwGetNSGLContext </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype"><a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> * </td>
|
||||||
|
<td class="paramname"><em>window</em></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>The <code>NSOpenGLContext</code> of the specified window, or <code>nil</code> if an <a class="el" href="intro_guide.html#error_handling">error</a> occurred.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#gacff24d2757da752ae4c80bf452356487">GLFW_NO_WINDOW_CONTEXT</a> and <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function may be called from any thread. Access is not synchronized.</dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.0. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga6e7822385cc8a1cc3b18f60352830189" name="ga6e7822385cc8a1cc3b18f60352830189"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga6e7822385cc8a1cc3b18f60352830189">◆ </a></span>glfwGetX11Display()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">Display * glfwGetX11Display </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">void </td>
|
||||||
|
<td class="paramname"></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>The <code>Display</code> used by GLFW, or <code>NULL</code> if an <a class="el" href="intro_guide.html#error_handling">error</a> occurred.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function may be called from any thread. Access is not synchronized.</dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.0. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga088fbfa80f50569402b41be71ad66e40" name="ga088fbfa80f50569402b41be71ad66e40"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga088fbfa80f50569402b41be71ad66e40">◆ </a></span>glfwGetX11Adapter()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">RRCrtc glfwGetX11Adapter </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype"><a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> * </td>
|
||||||
|
<td class="paramname"><em>monitor</em></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>The <code>RRCrtc</code> of the specified monitor, or <code>None</code> if an <a class="el" href="intro_guide.html#error_handling">error</a> occurred.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function may be called from any thread. Access is not synchronized.</dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.1. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gab2f8cc043905e9fa9b12bfdbbcfe874c" name="gab2f8cc043905e9fa9b12bfdbbcfe874c"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gab2f8cc043905e9fa9b12bfdbbcfe874c">◆ </a></span>glfwGetX11Monitor()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">RROutput glfwGetX11Monitor </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype"><a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> * </td>
|
||||||
|
<td class="paramname"><em>monitor</em></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>The <code>RROutput</code> of the specified monitor, or <code>None</code> if an <a class="el" href="intro_guide.html#error_handling">error</a> occurred.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function may be called from any thread. Access is not synchronized.</dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.1. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga90ca676322740842db446999a1b1f21d" name="ga90ca676322740842db446999a1b1f21d"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga90ca676322740842db446999a1b1f21d">◆ </a></span>glfwGetX11Window()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">Window glfwGetX11Window </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype"><a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> * </td>
|
||||||
|
<td class="paramname"><em>window</em></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>The <code>Window</code> of the specified window, or <code>None</code> if an <a class="el" href="intro_guide.html#error_handling">error</a> occurred.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function may be called from any thread. Access is not synchronized.</dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.0. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga55f879ab02d93367f966186b6f0133f7" name="ga55f879ab02d93367f966186b6f0133f7"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga55f879ab02d93367f966186b6f0133f7">◆ </a></span>glfwSetX11SelectionString()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">void glfwSetX11SelectionString </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">const char * </td>
|
||||||
|
<td class="paramname"><em>string</em></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramdir">[in]</td><td class="paramname">string</td><td>A UTF-8 encoded string.</td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a> and <a class="el" href="group__errors.html#gad44162d78100ea5e87cdd38426b8c7a1">GLFW_PLATFORM_ERROR</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Pointer lifetime</dt><dd>The specified string is copied before this function returns.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function must only be called from the main thread.</dd></dl>
|
||||||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="input_guide.html#clipboard">Clipboard input and output</a> </dd>
|
||||||
|
<dd>
|
||||||
|
<a class="el" href="group__native.html#gae084ef64dc0db140b455b1427256d3f7" title="Returns the contents of the current primary selection as a string.">glfwGetX11SelectionString</a> </dd>
|
||||||
|
<dd>
|
||||||
|
<a class="el" href="group__input.html#gaba1f022c5eb07dfac421df34cdcd31dd" title="Sets the clipboard to the specified string.">glfwSetClipboardString</a></dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.3. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gae084ef64dc0db140b455b1427256d3f7" name="gae084ef64dc0db140b455b1427256d3f7"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gae084ef64dc0db140b455b1427256d3f7">◆ </a></span>glfwGetX11SelectionString()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">const char * glfwGetX11SelectionString </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">void </td>
|
||||||
|
<td class="paramname"></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >If the selection is empty or if its contents cannot be converted, <code>NULL</code> is returned and a <a class="el" href="group__errors.html#ga196e125ef261d94184e2b55c05762f14">GLFW_FORMAT_UNAVAILABLE</a> error is generated.</p>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>The contents of the selection as a UTF-8 encoded string, or <code>NULL</code> if an <a class="el" href="intro_guide.html#error_handling">error</a> occurred.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a> and <a class="el" href="group__errors.html#gad44162d78100ea5e87cdd38426b8c7a1">GLFW_PLATFORM_ERROR</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Pointer lifetime</dt><dd>The returned string is allocated and freed by GLFW. You should not free it yourself. It is valid until the next call to <a class="el" href="group__native.html#gae084ef64dc0db140b455b1427256d3f7">glfwGetX11SelectionString</a> or <a class="el" href="group__native.html#ga55f879ab02d93367f966186b6f0133f7">glfwSetX11SelectionString</a>, or until the library is terminated.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function must only be called from the main thread.</dd></dl>
|
||||||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="input_guide.html#clipboard">Clipboard input and output</a> </dd>
|
||||||
|
<dd>
|
||||||
|
<a class="el" href="group__native.html#ga55f879ab02d93367f966186b6f0133f7" title="Sets the current primary selection to the specified string.">glfwSetX11SelectionString</a> </dd>
|
||||||
|
<dd>
|
||||||
|
<a class="el" href="group__input.html#ga71a5b20808ea92193d65c21b82580355" title="Returns the contents of the clipboard as a string.">glfwGetClipboardString</a></dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.3. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga62d884114b0abfcdc2930e89f20867e2" name="ga62d884114b0abfcdc2930e89f20867e2"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga62d884114b0abfcdc2930e89f20867e2">◆ </a></span>glfwGetGLXContext()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">GLXContext glfwGetGLXContext </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype"><a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> * </td>
|
||||||
|
<td class="paramname"><em>window</em></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>The <code>GLXContext</code> of the specified window, or <code>NULL</code> if an <a class="el" href="intro_guide.html#error_handling">error</a> occurred.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#gacff24d2757da752ae4c80bf452356487">GLFW_NO_WINDOW_CONTEXT</a> and <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function may be called from any thread. Access is not synchronized.</dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.0. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga1ed27b8766e859a21381e8f8ce18d049" name="ga1ed27b8766e859a21381e8f8ce18d049"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga1ed27b8766e859a21381e8f8ce18d049">◆ </a></span>glfwGetGLXWindow()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">GLXWindow glfwGetGLXWindow </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype"><a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> * </td>
|
||||||
|
<td class="paramname"><em>window</em></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>The <code>GLXWindow</code> of the specified window, or <code>None</code> if an <a class="el" href="intro_guide.html#error_handling">error</a> occurred.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#gacff24d2757da752ae4c80bf452356487">GLFW_NO_WINDOW_CONTEXT</a> and <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function may be called from any thread. Access is not synchronized.</dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.2. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gacbe11f93ce20621de82989bbba94e62a" name="gacbe11f93ce20621de82989bbba94e62a"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gacbe11f93ce20621de82989bbba94e62a">◆ </a></span>glfwGetWaylandDisplay()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">struct wl_display * glfwGetWaylandDisplay </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">void </td>
|
||||||
|
<td class="paramname"></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>The <code>struct wl_display*</code> used by GLFW, or <code>NULL</code> if an <a class="el" href="intro_guide.html#error_handling">error</a> occurred.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function may be called from any thread. Access is not synchronized.</dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.2. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga4f16066bd4c59e2f99418adfcb43dd16" name="ga4f16066bd4c59e2f99418adfcb43dd16"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga4f16066bd4c59e2f99418adfcb43dd16">◆ </a></span>glfwGetWaylandMonitor()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">struct wl_output * glfwGetWaylandMonitor </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype"><a class="el" href="group__monitor.html#ga8d9efd1cde9426692c73fe40437d0ae3">GLFWmonitor</a> * </td>
|
||||||
|
<td class="paramname"><em>monitor</em></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>The <code>struct wl_output*</code> of the specified monitor, or <code>NULL</code> if an <a class="el" href="intro_guide.html#error_handling">error</a> occurred.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function may be called from any thread. Access is not synchronized.</dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.2. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga5c597f2841229d9626f0811cca41ceb3" name="ga5c597f2841229d9626f0811cca41ceb3"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga5c597f2841229d9626f0811cca41ceb3">◆ </a></span>glfwGetWaylandWindow()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">struct wl_surface * glfwGetWaylandWindow </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype"><a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> * </td>
|
||||||
|
<td class="paramname"><em>window</em></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>The main <code>struct wl_surface*</code> of the specified window, or <code>NULL</code> if an <a class="el" href="intro_guide.html#error_handling">error</a> occurred.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function may be called from any thread. Access is not synchronized.</dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.2. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga1cd8d973f47aacb5532d368147cc3138" name="ga1cd8d973f47aacb5532d368147cc3138"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga1cd8d973f47aacb5532d368147cc3138">◆ </a></span>glfwGetEGLDisplay()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">EGLDisplay glfwGetEGLDisplay </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">void </td>
|
||||||
|
<td class="paramname"></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>The <code>EGLDisplay</code> used by GLFW, or <code>EGL_NO_DISPLAY</code> if an <a class="el" href="intro_guide.html#error_handling">error</a> occurred.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a>.</dd></dl>
|
||||||
|
<dl class="section remark"><dt>Remarks</dt><dd>Because EGL is initialized on demand, this function will return <code>EGL_NO_DISPLAY</code> until the first context has been created via EGL.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function may be called from any thread. Access is not synchronized.</dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.0. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga671c5072becd085f4ab5771a9c8efcf1" name="ga671c5072becd085f4ab5771a9c8efcf1"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga671c5072becd085f4ab5771a9c8efcf1">◆ </a></span>glfwGetEGLContext()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">EGLContext glfwGetEGLContext </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype"><a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> * </td>
|
||||||
|
<td class="paramname"><em>window</em></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>The <code>EGLContext</code> of the specified window, or <code>EGL_NO_CONTEXT</code> if an <a class="el" href="intro_guide.html#error_handling">error</a> occurred.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#gacff24d2757da752ae4c80bf452356487">GLFW_NO_WINDOW_CONTEXT</a> and <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function may be called from any thread. Access is not synchronized.</dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.0. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga2199b36117a6a695fec8441d8052eee6" name="ga2199b36117a6a695fec8441d8052eee6"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga2199b36117a6a695fec8441d8052eee6">◆ </a></span>glfwGetEGLSurface()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">EGLSurface glfwGetEGLSurface </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype"><a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> * </td>
|
||||||
|
<td class="paramname"><em>window</em></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>The <code>EGLSurface</code> of the specified window, or <code>EGL_NO_SURFACE</code> if an <a class="el" href="intro_guide.html#error_handling">error</a> occurred.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#gacff24d2757da752ae4c80bf452356487">GLFW_NO_WINDOW_CONTEXT</a> and <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function may be called from any thread. Access is not synchronized.</dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.0. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga3b36e3e3dcf308b776427b6bd73cc132" name="ga3b36e3e3dcf308b776427b6bd73cc132"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga3b36e3e3dcf308b776427b6bd73cc132">◆ </a></span>glfwGetOSMesaColorBuffer()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">int glfwGetOSMesaColorBuffer </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype"><a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> * </td>
|
||||||
|
<td class="paramname"><em>window</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">int * </td>
|
||||||
|
<td class="paramname"><em>width</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">int * </td>
|
||||||
|
<td class="paramname"><em>height</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">int * </td>
|
||||||
|
<td class="paramname"><em>format</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">void ** </td>
|
||||||
|
<td class="paramname"><em>buffer</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramdir">[in]</td><td class="paramname">window</td><td>The window whose color buffer to retrieve. </td></tr>
|
||||||
|
<tr><td class="paramdir">[out]</td><td class="paramname">width</td><td>Where to store the width of the color buffer, or <code>NULL</code>. </td></tr>
|
||||||
|
<tr><td class="paramdir">[out]</td><td class="paramname">height</td><td>Where to store the height of the color buffer, or <code>NULL</code>. </td></tr>
|
||||||
|
<tr><td class="paramdir">[out]</td><td class="paramname">format</td><td>Where to store the OSMesa pixel format of the color buffer, or <code>NULL</code>. </td></tr>
|
||||||
|
<tr><td class="paramdir">[out]</td><td class="paramname">buffer</td><td>Where to store the address of the color buffer, or <code>NULL</code>. </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd><code>GLFW_TRUE</code> if successful, or <code>GLFW_FALSE</code> if an <a class="el" href="intro_guide.html#error_handling">error</a> occurred.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#gacff24d2757da752ae4c80bf452356487">GLFW_NO_WINDOW_CONTEXT</a> and <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function may be called from any thread. Access is not synchronized.</dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.3. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga6b64039ffc88a7a2f57f0956c0c75d53" name="ga6b64039ffc88a7a2f57f0956c0c75d53"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga6b64039ffc88a7a2f57f0956c0c75d53">◆ </a></span>glfwGetOSMesaDepthBuffer()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">int glfwGetOSMesaDepthBuffer </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype"><a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> * </td>
|
||||||
|
<td class="paramname"><em>window</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">int * </td>
|
||||||
|
<td class="paramname"><em>width</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">int * </td>
|
||||||
|
<td class="paramname"><em>height</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">int * </td>
|
||||||
|
<td class="paramname"><em>bytesPerValue</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">void ** </td>
|
||||||
|
<td class="paramname"><em>buffer</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramdir">[in]</td><td class="paramname">window</td><td>The window whose depth buffer to retrieve. </td></tr>
|
||||||
|
<tr><td class="paramdir">[out]</td><td class="paramname">width</td><td>Where to store the width of the depth buffer, or <code>NULL</code>. </td></tr>
|
||||||
|
<tr><td class="paramdir">[out]</td><td class="paramname">height</td><td>Where to store the height of the depth buffer, or <code>NULL</code>. </td></tr>
|
||||||
|
<tr><td class="paramdir">[out]</td><td class="paramname">bytesPerValue</td><td>Where to store the number of bytes per depth buffer element, or <code>NULL</code>. </td></tr>
|
||||||
|
<tr><td class="paramdir">[out]</td><td class="paramname">buffer</td><td>Where to store the address of the depth buffer, or <code>NULL</code>. </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd><code>GLFW_TRUE</code> if successful, or <code>GLFW_FALSE</code> if an <a class="el" href="intro_guide.html#error_handling">error</a> occurred.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#gacff24d2757da752ae4c80bf452356487">GLFW_NO_WINDOW_CONTEXT</a> and <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function may be called from any thread. Access is not synchronized.</dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.3. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga9e47700080094eb569cb053afaa88773" name="ga9e47700080094eb569cb053afaa88773"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga9e47700080094eb569cb053afaa88773">◆ </a></span>glfwGetOSMesaContext()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">OSMesaContext glfwGetOSMesaContext </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype"><a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> * </td>
|
||||||
|
<td class="paramname"><em>window</em></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>The <code>OSMesaContext</code> of the specified window, or <code>NULL</code> if an <a class="el" href="intro_guide.html#error_handling">error</a> occurred.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#gacff24d2757da752ae4c80bf452356487">GLFW_NO_WINDOW_CONTEXT</a> and <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function may be called from any thread. Access is not synchronized.</dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.3. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div><!-- contents -->
|
||||||
|
<address class="footer">
|
||||||
|
<p>
|
||||||
|
Last update on Fri Jul 22 2022 for GLFW 3.3.8
|
||||||
|
</p>
|
||||||
|
</address>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,191 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.9.4"/>
|
||||||
|
<title>GLFW: Standard cursor shapes</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="extra.css" rel="stylesheet" type="text/css"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<div class="glfwheader">
|
||||||
|
<a href="https://www.glfw.org/" id="glfwhome">GLFW</a>
|
||||||
|
<ul class="glfwnavbar">
|
||||||
|
<li><a href="https://www.glfw.org/documentation.html">Documentation</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/download.html">Download</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/community.html">Community</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.9.4 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src="menudata.js"></script>
|
||||||
|
<script type="text/javascript" src="menu.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
$(function() {
|
||||||
|
initMenu('',true,false,'search.php','Search');
|
||||||
|
$(document).ready(function() { init_search(); });
|
||||||
|
});
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<div id="main-nav"></div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="header">
|
||||||
|
<div class="summary">
|
||||||
|
<a href="#define-members">Macros</a> </div>
|
||||||
|
<div class="headertitle"><div class="title">Standard cursor shapes<div class="ingroups"><a class="el" href="group__input.html">Input reference</a></div></div></div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<a name="details" id="details"></a><h2 class="groupheader">Description</h2>
|
||||||
|
<p >See <a class="el" href="input_guide.html#cursor_standard">standard cursor creation</a> for how these are used. </p>
|
||||||
|
<table class="memberdecls">
|
||||||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
|
||||||
|
Macros</h2></td></tr>
|
||||||
|
<tr class="memitem:ga8ab0e717245b85506cb0eaefdea39d0a"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__shapes.html#ga8ab0e717245b85506cb0eaefdea39d0a">GLFW_ARROW_CURSOR</a>   0x00036001</td></tr>
|
||||||
|
<tr class="memdesc:ga8ab0e717245b85506cb0eaefdea39d0a"><td class="mdescLeft"> </td><td class="mdescRight">The regular arrow cursor shape. <a href="group__shapes.html#ga8ab0e717245b85506cb0eaefdea39d0a">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga8ab0e717245b85506cb0eaefdea39d0a"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga36185f4375eaada1b04e431244774c86"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__shapes.html#ga36185f4375eaada1b04e431244774c86">GLFW_IBEAM_CURSOR</a>   0x00036002</td></tr>
|
||||||
|
<tr class="memdesc:ga36185f4375eaada1b04e431244774c86"><td class="mdescLeft"> </td><td class="mdescRight">The text input I-beam cursor shape. <a href="group__shapes.html#ga36185f4375eaada1b04e431244774c86">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga36185f4375eaada1b04e431244774c86"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga8af88c0ea05ab9e8f9ac1530e8873c22"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__shapes.html#ga8af88c0ea05ab9e8f9ac1530e8873c22">GLFW_CROSSHAIR_CURSOR</a>   0x00036003</td></tr>
|
||||||
|
<tr class="memdesc:ga8af88c0ea05ab9e8f9ac1530e8873c22"><td class="mdescLeft"> </td><td class="mdescRight">The crosshair shape. <a href="group__shapes.html#ga8af88c0ea05ab9e8f9ac1530e8873c22">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga8af88c0ea05ab9e8f9ac1530e8873c22"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga1db35e20849e0837c82e3dc1fd797263"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__shapes.html#ga1db35e20849e0837c82e3dc1fd797263">GLFW_HAND_CURSOR</a>   0x00036004</td></tr>
|
||||||
|
<tr class="memdesc:ga1db35e20849e0837c82e3dc1fd797263"><td class="mdescLeft"> </td><td class="mdescRight">The hand shape. <a href="group__shapes.html#ga1db35e20849e0837c82e3dc1fd797263">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga1db35e20849e0837c82e3dc1fd797263"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gabb3eb0109f11bb808fc34659177ca962"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__shapes.html#gabb3eb0109f11bb808fc34659177ca962">GLFW_HRESIZE_CURSOR</a>   0x00036005</td></tr>
|
||||||
|
<tr class="memdesc:gabb3eb0109f11bb808fc34659177ca962"><td class="mdescLeft"> </td><td class="mdescRight">The horizontal resize arrow shape. <a href="group__shapes.html#gabb3eb0109f11bb808fc34659177ca962">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:gabb3eb0109f11bb808fc34659177ca962"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gaf024f0e1ff8366fb2b5c260509a1fce5"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="group__shapes.html#gaf024f0e1ff8366fb2b5c260509a1fce5">GLFW_VRESIZE_CURSOR</a>   0x00036006</td></tr>
|
||||||
|
<tr class="memdesc:gaf024f0e1ff8366fb2b5c260509a1fce5"><td class="mdescLeft"> </td><td class="mdescRight">The vertical resize arrow shape. <a href="group__shapes.html#gaf024f0e1ff8366fb2b5c260509a1fce5">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:gaf024f0e1ff8366fb2b5c260509a1fce5"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
</table>
|
||||||
|
<h2 class="groupheader">Macro Definition Documentation</h2>
|
||||||
|
<a id="ga8ab0e717245b85506cb0eaefdea39d0a" name="ga8ab0e717245b85506cb0eaefdea39d0a"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga8ab0e717245b85506cb0eaefdea39d0a">◆ </a></span>GLFW_ARROW_CURSOR</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_ARROW_CURSOR   0x00036001</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >The regular arrow cursor. </p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga36185f4375eaada1b04e431244774c86" name="ga36185f4375eaada1b04e431244774c86"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga36185f4375eaada1b04e431244774c86">◆ </a></span>GLFW_IBEAM_CURSOR</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_IBEAM_CURSOR   0x00036002</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >The text input I-beam cursor shape. </p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga8af88c0ea05ab9e8f9ac1530e8873c22" name="ga8af88c0ea05ab9e8f9ac1530e8873c22"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga8af88c0ea05ab9e8f9ac1530e8873c22">◆ </a></span>GLFW_CROSSHAIR_CURSOR</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_CROSSHAIR_CURSOR   0x00036003</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >The crosshair shape. </p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga1db35e20849e0837c82e3dc1fd797263" name="ga1db35e20849e0837c82e3dc1fd797263"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga1db35e20849e0837c82e3dc1fd797263">◆ </a></span>GLFW_HAND_CURSOR</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_HAND_CURSOR   0x00036004</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >The hand shape. </p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gabb3eb0109f11bb808fc34659177ca962" name="gabb3eb0109f11bb808fc34659177ca962"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gabb3eb0109f11bb808fc34659177ca962">◆ </a></span>GLFW_HRESIZE_CURSOR</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_HRESIZE_CURSOR   0x00036005</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >The horizontal resize arrow shape. </p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gaf024f0e1ff8366fb2b5c260509a1fce5" name="gaf024f0e1ff8366fb2b5c260509a1fce5"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gaf024f0e1ff8366fb2b5c260509a1fce5">◆ </a></span>GLFW_VRESIZE_CURSOR</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">#define GLFW_VRESIZE_CURSOR   0x00036006</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >The vertical resize arrow shape. </p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div><!-- contents -->
|
||||||
|
<address class="footer">
|
||||||
|
<p>
|
||||||
|
Last update on Fri Jul 22 2022 for GLFW 3.3.8
|
||||||
|
</p>
|
||||||
|
</address>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,352 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.9.4"/>
|
||||||
|
<title>GLFW: Vulkan support reference</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="extra.css" rel="stylesheet" type="text/css"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<div class="glfwheader">
|
||||||
|
<a href="https://www.glfw.org/" id="glfwhome">GLFW</a>
|
||||||
|
<ul class="glfwnavbar">
|
||||||
|
<li><a href="https://www.glfw.org/documentation.html">Documentation</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/download.html">Download</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/community.html">Community</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.9.4 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src="menudata.js"></script>
|
||||||
|
<script type="text/javascript" src="menu.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
$(function() {
|
||||||
|
initMenu('',true,false,'search.php','Search');
|
||||||
|
$(document).ready(function() { init_search(); });
|
||||||
|
});
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<div id="main-nav"></div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="header">
|
||||||
|
<div class="summary">
|
||||||
|
<a href="#typedef-members">Typedefs</a> |
|
||||||
|
<a href="#func-members">Functions</a> </div>
|
||||||
|
<div class="headertitle"><div class="title">Vulkan support reference</div></div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<a name="details" id="details"></a><h2 class="groupheader">Description</h2>
|
||||||
|
<p >This is the reference documentation for Vulkan related functions and types. For more task-oriented information, see the <a class="el" href="vulkan_guide.html">Vulkan guide</a>. </p>
|
||||||
|
<table class="memberdecls">
|
||||||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="typedef-members" name="typedef-members"></a>
|
||||||
|
Typedefs</h2></td></tr>
|
||||||
|
<tr class="memitem:ga70c01918dc9d233a4fbe0681a43018af"><td class="memItemLeft" align="right" valign="top">typedef void(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__vulkan.html#ga70c01918dc9d233a4fbe0681a43018af">GLFWvkproc</a>) (void)</td></tr>
|
||||||
|
<tr class="memdesc:ga70c01918dc9d233a4fbe0681a43018af"><td class="mdescLeft"> </td><td class="mdescRight">Vulkan API function pointer type. <a href="group__vulkan.html#ga70c01918dc9d233a4fbe0681a43018af">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga70c01918dc9d233a4fbe0681a43018af"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
</table><table class="memberdecls">
|
||||||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
|
||||||
|
Functions</h2></td></tr>
|
||||||
|
<tr class="memitem:ga2e7f30931e02464b5bc8d0d4b6f9fe2b"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__vulkan.html#ga2e7f30931e02464b5bc8d0d4b6f9fe2b">glfwVulkanSupported</a> (void)</td></tr>
|
||||||
|
<tr class="memdesc:ga2e7f30931e02464b5bc8d0d4b6f9fe2b"><td class="mdescLeft"> </td><td class="mdescRight">Returns whether the Vulkan loader and an ICD have been found. <a href="group__vulkan.html#ga2e7f30931e02464b5bc8d0d4b6f9fe2b">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga2e7f30931e02464b5bc8d0d4b6f9fe2b"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga99ad342d82f4a3421e2864978cb6d1d6"><td class="memItemLeft" align="right" valign="top">const char ** </td><td class="memItemRight" valign="bottom"><a class="el" href="group__vulkan.html#ga99ad342d82f4a3421e2864978cb6d1d6">glfwGetRequiredInstanceExtensions</a> (uint32_t *count)</td></tr>
|
||||||
|
<tr class="memdesc:ga99ad342d82f4a3421e2864978cb6d1d6"><td class="mdescLeft"> </td><td class="mdescRight">Returns the Vulkan instance extensions required by GLFW. <a href="group__vulkan.html#ga99ad342d82f4a3421e2864978cb6d1d6">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga99ad342d82f4a3421e2864978cb6d1d6"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gadf228fac94c5fd8f12423ec9af9ff1e9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__vulkan.html#ga70c01918dc9d233a4fbe0681a43018af">GLFWvkproc</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__vulkan.html#gadf228fac94c5fd8f12423ec9af9ff1e9">glfwGetInstanceProcAddress</a> (VkInstance instance, const char *procname)</td></tr>
|
||||||
|
<tr class="memdesc:gadf228fac94c5fd8f12423ec9af9ff1e9"><td class="mdescLeft"> </td><td class="mdescRight">Returns the address of the specified Vulkan instance function. <a href="group__vulkan.html#gadf228fac94c5fd8f12423ec9af9ff1e9">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:gadf228fac94c5fd8f12423ec9af9ff1e9"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:gaff3823355cdd7e2f3f9f4d9ea9518d92"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__vulkan.html#gaff3823355cdd7e2f3f9f4d9ea9518d92">glfwGetPhysicalDevicePresentationSupport</a> (VkInstance instance, VkPhysicalDevice device, uint32_t queuefamily)</td></tr>
|
||||||
|
<tr class="memdesc:gaff3823355cdd7e2f3f9f4d9ea9518d92"><td class="mdescLeft"> </td><td class="mdescRight">Returns whether the specified queue family can present images. <a href="group__vulkan.html#gaff3823355cdd7e2f3f9f4d9ea9518d92">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:gaff3823355cdd7e2f3f9f4d9ea9518d92"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
<tr class="memitem:ga1a24536bec3f80b08ead18e28e6ae965"><td class="memItemLeft" align="right" valign="top">VkResult </td><td class="memItemRight" valign="bottom"><a class="el" href="group__vulkan.html#ga1a24536bec3f80b08ead18e28e6ae965">glfwCreateWindowSurface</a> (VkInstance instance, <a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> *window, const VkAllocationCallbacks *allocator, VkSurfaceKHR *surface)</td></tr>
|
||||||
|
<tr class="memdesc:ga1a24536bec3f80b08ead18e28e6ae965"><td class="mdescLeft"> </td><td class="mdescRight">Creates a Vulkan surface for the specified window. <a href="group__vulkan.html#ga1a24536bec3f80b08ead18e28e6ae965">More...</a><br /></td></tr>
|
||||||
|
<tr class="separator:ga1a24536bec3f80b08ead18e28e6ae965"><td class="memSeparator" colspan="2"> </td></tr>
|
||||||
|
</table>
|
||||||
|
<h2 class="groupheader">Typedef Documentation</h2>
|
||||||
|
<a id="ga70c01918dc9d233a4fbe0681a43018af" name="ga70c01918dc9d233a4fbe0681a43018af"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga70c01918dc9d233a4fbe0681a43018af">◆ </a></span>GLFWvkproc</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">typedef void(* GLFWvkproc) (void)</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >Generic function pointer used for returning Vulkan API function pointers without forcing a cast from a regular pointer.</p>
|
||||||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="vulkan_guide.html#vulkan_proc">Querying Vulkan function pointers</a> </dd>
|
||||||
|
<dd>
|
||||||
|
<a class="el" href="group__vulkan.html#gadf228fac94c5fd8f12423ec9af9ff1e9">glfwGetInstanceProcAddress</a></dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.2. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<h2 class="groupheader">Function Documentation</h2>
|
||||||
|
<a id="ga2e7f30931e02464b5bc8d0d4b6f9fe2b" name="ga2e7f30931e02464b5bc8d0d4b6f9fe2b"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga2e7f30931e02464b5bc8d0d4b6f9fe2b">◆ </a></span>glfwVulkanSupported()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">int glfwVulkanSupported </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">void </td>
|
||||||
|
<td class="paramname"></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >This function returns whether the Vulkan loader and any minimally functional ICD have been found.</p>
|
||||||
|
<p >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 <a class="el" href="group__vulkan.html#ga99ad342d82f4a3421e2864978cb6d1d6">glfwGetRequiredInstanceExtensions</a> to check whether the extensions necessary for Vulkan surface creation are available and <a class="el" href="group__vulkan.html#gaff3823355cdd7e2f3f9f4d9ea9518d92">glfwGetPhysicalDevicePresentationSupport</a> to check whether a queue family of a physical device supports image presentation.</p>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd><code>GLFW_TRUE</code> if Vulkan is minimally available, or <code>GLFW_FALSE</code> otherwise.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function may be called from any thread.</dd></dl>
|
||||||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="vulkan_guide.html#vulkan_support">Querying for Vulkan support</a></dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.2. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga99ad342d82f4a3421e2864978cb6d1d6" name="ga99ad342d82f4a3421e2864978cb6d1d6"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga99ad342d82f4a3421e2864978cb6d1d6">◆ </a></span>glfwGetRequiredInstanceExtensions()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">const char ** glfwGetRequiredInstanceExtensions </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">uint32_t * </td>
|
||||||
|
<td class="paramname"><em>count</em></td><td>)</td>
|
||||||
|
<td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >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 contain <code>VK_KHR_surface</code>, so if you don't require any additional extensions you can pass this list directly to the <code>VkInstanceCreateInfo</code> struct.</p>
|
||||||
|
<p >If Vulkan is not available on the machine, this function returns <code>NULL</code> and generates a <a class="el" href="group__errors.html#ga56882b290db23261cc6c053c40c2d08e">GLFW_API_UNAVAILABLE</a> error. Call <a class="el" href="group__vulkan.html#ga2e7f30931e02464b5bc8d0d4b6f9fe2b">glfwVulkanSupported</a> to check whether Vulkan is at least minimally available.</p>
|
||||||
|
<p >If Vulkan is available but no set of extensions allowing window surface creation was found, this function returns <code>NULL</code>. You may still use Vulkan for off-screen rendering and compute work.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramdir">[out]</td><td class="paramname">count</td><td>Where to store the number of extensions in the returned array. This is set to zero if an error occurred. </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>An array of ASCII encoded extension names, or <code>NULL</code> if an <a class="el" href="intro_guide.html#error_handling">error</a> occurred.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a> and <a class="el" href="group__errors.html#ga56882b290db23261cc6c053c40c2d08e">GLFW_API_UNAVAILABLE</a>.</dd></dl>
|
||||||
|
<dl class="section remark"><dt>Remarks</dt><dd>Additional extensions may be required by future versions of GLFW. You should check if 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 <code>VkInstanceCreateInfo</code> struct.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Pointer lifetime</dt><dd>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.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function may be called from any thread.</dd></dl>
|
||||||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="vulkan_guide.html#vulkan_ext">Querying required Vulkan extensions</a> </dd>
|
||||||
|
<dd>
|
||||||
|
<a class="el" href="group__vulkan.html#ga1a24536bec3f80b08ead18e28e6ae965">glfwCreateWindowSurface</a></dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.2. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gadf228fac94c5fd8f12423ec9af9ff1e9" name="gadf228fac94c5fd8f12423ec9af9ff1e9"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gadf228fac94c5fd8f12423ec9af9ff1e9">◆ </a></span>glfwGetInstanceProcAddress()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname"><a class="el" href="group__vulkan.html#ga70c01918dc9d233a4fbe0681a43018af">GLFWvkproc</a> glfwGetInstanceProcAddress </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">VkInstance </td>
|
||||||
|
<td class="paramname"><em>instance</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">const char * </td>
|
||||||
|
<td class="paramname"><em>procname</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >This function returns the address of the specified Vulkan core or extension function for the specified instance. If instance is set to <code>NULL</code> it can return any function exported from the Vulkan loader, including at least the following functions:</p>
|
||||||
|
<ul>
|
||||||
|
<li><code>vkEnumerateInstanceExtensionProperties</code></li>
|
||||||
|
<li><code>vkEnumerateInstanceLayerProperties</code></li>
|
||||||
|
<li><code>vkCreateInstance</code></li>
|
||||||
|
<li><code>vkGetInstanceProcAddr</code></li>
|
||||||
|
</ul>
|
||||||
|
<p >If Vulkan is not available on the machine, this function returns <code>NULL</code> and generates a <a class="el" href="group__errors.html#ga56882b290db23261cc6c053c40c2d08e">GLFW_API_UNAVAILABLE</a> error. Call <a class="el" href="group__vulkan.html#ga2e7f30931e02464b5bc8d0d4b6f9fe2b">glfwVulkanSupported</a> to check whether Vulkan is at least minimally available.</p>
|
||||||
|
<p >This function is equivalent to calling <code>vkGetInstanceProcAddr</code> with a platform-specific query of the Vulkan loader as a fallback.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramdir">[in]</td><td class="paramname">instance</td><td>The Vulkan instance to query, or <code>NULL</code> to retrieve functions related to instance creation. </td></tr>
|
||||||
|
<tr><td class="paramdir">[in]</td><td class="paramname">procname</td><td>The ASCII encoded name of the function. </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd>The address of the function, or <code>NULL</code> if an <a class="el" href="intro_guide.html#error_handling">error</a> occurred.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a> and <a class="el" href="group__errors.html#ga56882b290db23261cc6c053c40c2d08e">GLFW_API_UNAVAILABLE</a>.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Pointer lifetime</dt><dd>The returned function pointer is valid until the library is terminated.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function may be called from any thread.</dd></dl>
|
||||||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="vulkan_guide.html#vulkan_proc">Querying Vulkan function pointers</a></dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.2. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="gaff3823355cdd7e2f3f9f4d9ea9518d92" name="gaff3823355cdd7e2f3f9f4d9ea9518d92"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#gaff3823355cdd7e2f3f9f4d9ea9518d92">◆ </a></span>glfwGetPhysicalDevicePresentationSupport()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">int glfwGetPhysicalDevicePresentationSupport </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">VkInstance </td>
|
||||||
|
<td class="paramname"><em>instance</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">VkPhysicalDevice </td>
|
||||||
|
<td class="paramname"><em>device</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">uint32_t </td>
|
||||||
|
<td class="paramname"><em>queuefamily</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >This function returns whether the specified queue family of the specified physical device supports presentation to the platform GLFW was built for.</p>
|
||||||
|
<p >If Vulkan or the required window surface creation instance extensions are not available on the machine, or if the specified instance was not created with the required extensions, this function returns <code>GLFW_FALSE</code> and generates a <a class="el" href="group__errors.html#ga56882b290db23261cc6c053c40c2d08e">GLFW_API_UNAVAILABLE</a> error. Call <a class="el" href="group__vulkan.html#ga2e7f30931e02464b5bc8d0d4b6f9fe2b">glfwVulkanSupported</a> to check whether Vulkan is at least minimally available and <a class="el" href="group__vulkan.html#ga99ad342d82f4a3421e2864978cb6d1d6">glfwGetRequiredInstanceExtensions</a> to check what instance extensions are required.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramdir">[in]</td><td class="paramname">instance</td><td>The instance that the physical device belongs to. </td></tr>
|
||||||
|
<tr><td class="paramdir">[in]</td><td class="paramname">device</td><td>The physical device that the queue family belongs to. </td></tr>
|
||||||
|
<tr><td class="paramdir">[in]</td><td class="paramname">queuefamily</td><td>The index of the queue family to query. </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd><code>GLFW_TRUE</code> if the queue family supports presentation, or <code>GLFW_FALSE</code> otherwise.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a>, <a class="el" href="group__errors.html#ga56882b290db23261cc6c053c40c2d08e">GLFW_API_UNAVAILABLE</a> and <a class="el" href="group__errors.html#gad44162d78100ea5e87cdd38426b8c7a1">GLFW_PLATFORM_ERROR</a>.</dd></dl>
|
||||||
|
<dl class="section remark"><dt>Remarks</dt><dd><b>macOS:</b> This function currently always returns <code>GLFW_TRUE</code>, as the <code>VK_MVK_macos_surface</code> and <code>VK_EXT_metal_surface</code> extensions do not provide a <code>vkGetPhysicalDevice*PresentationSupport</code> type function.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function may be called from any thread. For synchronization details of Vulkan objects, see the Vulkan specification.</dd></dl>
|
||||||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="vulkan_guide.html#vulkan_present">Querying for Vulkan presentation support</a></dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.2. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<a id="ga1a24536bec3f80b08ead18e28e6ae965" name="ga1a24536bec3f80b08ead18e28e6ae965"></a>
|
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#ga1a24536bec3f80b08ead18e28e6ae965">◆ </a></span>glfwCreateWindowSurface()</h2>
|
||||||
|
|
||||||
|
<div class="memitem">
|
||||||
|
<div class="memproto">
|
||||||
|
<table class="memname">
|
||||||
|
<tr>
|
||||||
|
<td class="memname">VkResult glfwCreateWindowSurface </td>
|
||||||
|
<td>(</td>
|
||||||
|
<td class="paramtype">VkInstance </td>
|
||||||
|
<td class="paramname"><em>instance</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype"><a class="el" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a> * </td>
|
||||||
|
<td class="paramname"><em>window</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">const VkAllocationCallbacks * </td>
|
||||||
|
<td class="paramname"><em>allocator</em>, </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="paramkey"></td>
|
||||||
|
<td></td>
|
||||||
|
<td class="paramtype">VkSurfaceKHR * </td>
|
||||||
|
<td class="paramname"><em>surface</em> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td>)</td>
|
||||||
|
<td></td><td></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div><div class="memdoc">
|
||||||
|
<p >This function creates a Vulkan surface for the specified window.</p>
|
||||||
|
<p >If the Vulkan loader or at least one minimally functional ICD were not found, this function returns <code>VK_ERROR_INITIALIZATION_FAILED</code> and generates a <a class="el" href="group__errors.html#ga56882b290db23261cc6c053c40c2d08e">GLFW_API_UNAVAILABLE</a> error. Call <a class="el" href="group__vulkan.html#ga2e7f30931e02464b5bc8d0d4b6f9fe2b">glfwVulkanSupported</a> to check whether Vulkan is at least minimally available.</p>
|
||||||
|
<p >If the required window surface creation instance extensions are not available or if the specified instance was not created with these extensions enabled, this function returns <code>VK_ERROR_EXTENSION_NOT_PRESENT</code> and generates a <a class="el" href="group__errors.html#ga56882b290db23261cc6c053c40c2d08e">GLFW_API_UNAVAILABLE</a> error. Call <a class="el" href="group__vulkan.html#ga99ad342d82f4a3421e2864978cb6d1d6">glfwGetRequiredInstanceExtensions</a> to check what instance extensions are required.</p>
|
||||||
|
<p >The window surface cannot be shared with another API so the window must have been created with the <a class="el" href="window_guide.html#GLFW_CLIENT_API_attrib">client api hint</a> set to <code>GLFW_NO_API</code> otherwise it generates a <a class="el" href="group__errors.html#gaaf2ef9aa8202c2b82ac2d921e554c687">GLFW_INVALID_VALUE</a> error and returns <code>VK_ERROR_NATIVE_WINDOW_IN_USE_KHR</code>.</p>
|
||||||
|
<p >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 <code>vkDestroySurfaceKHR</code> to destroy the surface.</p>
|
||||||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||||||
|
<table class="params">
|
||||||
|
<tr><td class="paramdir">[in]</td><td class="paramname">instance</td><td>The Vulkan instance to create the surface in. </td></tr>
|
||||||
|
<tr><td class="paramdir">[in]</td><td class="paramname">window</td><td>The window to create the surface for. </td></tr>
|
||||||
|
<tr><td class="paramdir">[in]</td><td class="paramname">allocator</td><td>The allocator to use, or <code>NULL</code> to use the default allocator. </td></tr>
|
||||||
|
<tr><td class="paramdir">[out]</td><td class="paramname">surface</td><td>Where to store the handle of the surface. This is set to <code>VK_NULL_HANDLE</code> if an error occurred. </td></tr>
|
||||||
|
</table>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="section return"><dt>Returns</dt><dd><code>VK_SUCCESS</code> if successful, or a Vulkan error code if an <a class="el" href="intro_guide.html#error_handling">error</a> occurred.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Errors</dt><dd>Possible errors include <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a>, <a class="el" href="group__errors.html#ga56882b290db23261cc6c053c40c2d08e">GLFW_API_UNAVAILABLE</a>, <a class="el" href="group__errors.html#gad44162d78100ea5e87cdd38426b8c7a1">GLFW_PLATFORM_ERROR</a> and <a class="el" href="group__errors.html#gaaf2ef9aa8202c2b82ac2d921e554c687">GLFW_INVALID_VALUE</a></dd></dl>
|
||||||
|
<dl class="section remark"><dt>Remarks</dt><dd>If an error occurs before the creation call is made, GLFW returns the Vulkan error code most appropriate for the error. Appropriate use of <a class="el" href="group__vulkan.html#ga2e7f30931e02464b5bc8d0d4b6f9fe2b">glfwVulkanSupported</a> and <a class="el" href="group__vulkan.html#ga99ad342d82f4a3421e2864978cb6d1d6">glfwGetRequiredInstanceExtensions</a> should eliminate almost all occurrences of these errors.</dd>
|
||||||
|
<dd>
|
||||||
|
<b>macOS:</b> GLFW prefers the <code>VK_EXT_metal_surface</code> extension, with the <code>VK_MVK_macos_surface</code> extension as a fallback. The name of the selected extension, if any, is included in the array returned by <a class="el" href="group__vulkan.html#ga99ad342d82f4a3421e2864978cb6d1d6">glfwGetRequiredInstanceExtensions</a>.</dd>
|
||||||
|
<dd>
|
||||||
|
<b>macOS:</b> This function creates and sets a <code>CAMetalLayer</code> instance for the window content view, which is required for MoltenVK to function.</dd></dl>
|
||||||
|
<dl class="section user"><dt>Thread safety</dt><dd>This function may be called from any thread. For synchronization details of Vulkan objects, see the Vulkan specification.</dd></dl>
|
||||||
|
<dl class="section see"><dt>See also</dt><dd><a class="el" href="vulkan_guide.html#vulkan_surface">Creating a Vulkan window surface</a> </dd>
|
||||||
|
<dd>
|
||||||
|
<a class="el" href="group__vulkan.html#ga99ad342d82f4a3421e2864978cb6d1d6">glfwGetRequiredInstanceExtensions</a></dd></dl>
|
||||||
|
<dl class="section since"><dt>Since</dt><dd>Added in version 3.2. </dd></dl>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div><!-- contents -->
|
||||||
|
<address class="footer">
|
||||||
|
<p>
|
||||||
|
Last update on Fri Jul 22 2022 for GLFW 3.3.8
|
||||||
|
</p>
|
||||||
|
</address>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,93 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.9.4"/>
|
||||||
|
<title>GLFW: Main Page</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="extra.css" rel="stylesheet" type="text/css"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<div class="glfwheader">
|
||||||
|
<a href="https://www.glfw.org/" id="glfwhome">GLFW</a>
|
||||||
|
<ul class="glfwnavbar">
|
||||||
|
<li><a href="https://www.glfw.org/documentation.html">Documentation</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/download.html">Download</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/community.html">Community</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.9.4 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src="menudata.js"></script>
|
||||||
|
<script type="text/javascript" src="menu.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
$(function() {
|
||||||
|
initMenu('',true,false,'search.php','Search');
|
||||||
|
$(document).ready(function() { init_search(); });
|
||||||
|
});
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<div id="main-nav"></div>
|
||||||
|
</div><!-- top -->
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div><div class="contents">
|
||||||
|
<div class="textblock"><h1><a class="anchor" id="main_intro"></a>
|
||||||
|
Introduction</h1>
|
||||||
|
<p >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.</p>
|
||||||
|
<p ><a class="el" href="news.html#news_33">Release notes for version 3.3</a> list new features, caveats and deprecations.</p>
|
||||||
|
<p ><a class="el" href="quick_guide.html">Getting started</a> is a guide for users new to GLFW. It takes you through how to write a small but complete program.</p>
|
||||||
|
<p >There are guides for each section of the API:</p>
|
||||||
|
<ul>
|
||||||
|
<li><a class="el" href="intro_guide.html">Introduction to the API</a> – initialization, error handling and high-level design</li>
|
||||||
|
<li><a class="el" href="window_guide.html">Window guide</a> – creating and working with windows and framebuffers</li>
|
||||||
|
<li><a class="el" href="context_guide.html">Context guide</a> – working with OpenGL and OpenGL ES contexts</li>
|
||||||
|
<li><a class="el" href="vulkan_guide.html">Vulkan guide</a> - working with Vulkan objects and extensions</li>
|
||||||
|
<li><a class="el" href="monitor_guide.html">Monitor guide</a> – enumerating and working with monitors and video modes</li>
|
||||||
|
<li><a class="el" href="input_guide.html">Input guide</a> – receiving events, polling and processing input</li>
|
||||||
|
</ul>
|
||||||
|
<p >Once you have written a program, see <a class="el" href="compile_guide.html">Compiling GLFW</a> and <a class="el" href="build_guide.html">Building applications</a>.</p>
|
||||||
|
<p >The <a href="modules.html">reference documentation</a> provides more detailed information about specific functions.</p>
|
||||||
|
<p ><a class="el" href="moving_guide.html">Moving from GLFW 2 to 3</a> explains what has changed and how to update existing code to use the new API.</p>
|
||||||
|
<p >There is a section on <a class="el" href="intro_guide.html#guarantees_limitations">Guarantees and limitations</a> for pointer lifetimes, reentrancy, thread safety, event order and backward and forward compatibility.</p>
|
||||||
|
<p >The <a href="https://www.glfw.org/faq.html">FAQ</a> answers many common questions about the design, implementation and use of GLFW.</p>
|
||||||
|
<p >Finally, <a class="el" href="compat_guide.html">Standards conformance</a> explains what APIs, standards and protocols GLFW uses and what happens when they are not present on a given machine.</p>
|
||||||
|
<p >This documentation was generated with Doxygen. The sources for it are available in both the <a href="https://www.glfw.org/download.html">source distribution</a> and <a href="https://github.com/glfw/glfw">GitHub repository</a>. </p>
|
||||||
|
</div></div><!-- PageDoc -->
|
||||||
|
</div><!-- contents -->
|
||||||
|
<address class="footer">
|
||||||
|
<p>
|
||||||
|
Last update on Fri Jul 22 2022 for GLFW 3.3.8
|
||||||
|
</p>
|
||||||
|
</address>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,74 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.9.4"/>
|
||||||
|
<title>GLFW: input.dox File Reference</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="extra.css" rel="stylesheet" type="text/css"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<div class="glfwheader">
|
||||||
|
<a href="https://www.glfw.org/" id="glfwhome">GLFW</a>
|
||||||
|
<ul class="glfwnavbar">
|
||||||
|
<li><a href="https://www.glfw.org/documentation.html">Documentation</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/download.html">Download</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/community.html">Community</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.9.4 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src="menudata.js"></script>
|
||||||
|
<script type="text/javascript" src="menu.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
$(function() {
|
||||||
|
initMenu('',true,false,'search.php','Search');
|
||||||
|
$(document).ready(function() { init_search(); });
|
||||||
|
});
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<div id="main-nav"></div>
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div><!-- top -->
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle"><div class="title">input.dox File Reference</div></div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
</div><!-- contents -->
|
||||||
|
<address class="footer">
|
||||||
|
<p>
|
||||||
|
Last update on Fri Jul 22 2022 for GLFW 3.3.8
|
||||||
|
</p>
|
||||||
|
</address>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,562 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.9.4"/>
|
||||||
|
<title>GLFW: Input guide</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="extra.css" rel="stylesheet" type="text/css"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<div class="glfwheader">
|
||||||
|
<a href="https://www.glfw.org/" id="glfwhome">GLFW</a>
|
||||||
|
<ul class="glfwnavbar">
|
||||||
|
<li><a href="https://www.glfw.org/documentation.html">Documentation</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/download.html">Download</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/community.html">Community</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.9.4 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src="menudata.js"></script>
|
||||||
|
<script type="text/javascript" src="menu.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
$(function() {
|
||||||
|
initMenu('',true,false,'search.php','Search');
|
||||||
|
$(document).ready(function() { init_search(); });
|
||||||
|
});
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<div id="main-nav"></div>
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div><!-- top -->
|
||||||
|
<div><div class="header">
|
||||||
|
<div class="headertitle"><div class="title">Input guide </div></div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<div class="toc"><h3>Table of Contents</h3>
|
||||||
|
<ul><li class="level1"><a href="#events">Event processing</a></li>
|
||||||
|
<li class="level1"><a href="#input_keyboard">Keyboard input</a><ul><li class="level2"><a href="#input_key">Key input</a></li>
|
||||||
|
<li class="level2"><a href="#input_char">Text input</a></li>
|
||||||
|
<li class="level2"><a href="#input_key_name">Key names</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li class="level1"><a href="#input_mouse">Mouse input</a><ul><li class="level2"><a href="#cursor_pos">Cursor position</a></li>
|
||||||
|
<li class="level2"><a href="#cursor_mode">Cursor mode</a></li>
|
||||||
|
<li class="level2"><a href="#raw_mouse_motion">Raw mouse motion</a></li>
|
||||||
|
<li class="level2"><a href="#cursor_object">Cursor objects</a><ul><li class="level3"><a href="#cursor_custom">Custom cursor creation</a></li>
|
||||||
|
<li class="level3"><a href="#cursor_standard">Standard cursor creation</a></li>
|
||||||
|
<li class="level3"><a href="#cursor_destruction">Cursor destruction</a></li>
|
||||||
|
<li class="level3"><a href="#cursor_set">Cursor setting</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li class="level2"><a href="#cursor_enter">Cursor enter/leave events</a></li>
|
||||||
|
<li class="level2"><a href="#input_mouse_button">Mouse button input</a></li>
|
||||||
|
<li class="level2"><a href="#scrolling">Scroll input</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li class="level1"><a href="#joystick">Joystick input</a><ul><li class="level2"><a href="#joystick_axis">Joystick axis states</a></li>
|
||||||
|
<li class="level2"><a href="#joystick_button">Joystick button states</a></li>
|
||||||
|
<li class="level2"><a href="#joystick_hat">Joystick hat states</a></li>
|
||||||
|
<li class="level2"><a href="#joystick_name">Joystick name</a></li>
|
||||||
|
<li class="level2"><a href="#joystick_userptr">Joystick user pointer</a></li>
|
||||||
|
<li class="level2"><a href="#joystick_event">Joystick configuration changes</a></li>
|
||||||
|
<li class="level2"><a href="#gamepad">Gamepad input</a></li>
|
||||||
|
<li class="level2"><a href="#gamepad_mapping">Gamepad mappings</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li class="level1"><a href="#time">Time input</a></li>
|
||||||
|
<li class="level1"><a href="#clipboard">Clipboard input and output</a></li>
|
||||||
|
<li class="level1"><a href="#path_drop">Path drop input</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="textblock"><p >This guide introduces the input related functions of GLFW. For details on a specific function in this category, see the <a class="el" href="group__input.html">Input reference</a>. There are also guides for the other areas of GLFW.</p>
|
||||||
|
<ul>
|
||||||
|
<li><a class="el" href="intro_guide.html">Introduction to the API</a></li>
|
||||||
|
<li><a class="el" href="window_guide.html">Window guide</a></li>
|
||||||
|
<li><a class="el" href="context_guide.html">Context guide</a></li>
|
||||||
|
<li><a class="el" href="vulkan_guide.html">Vulkan guide</a></li>
|
||||||
|
<li><a class="el" href="monitor_guide.html">Monitor guide</a></li>
|
||||||
|
</ul>
|
||||||
|
<p >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.</p>
|
||||||
|
<p >All input callbacks receive a window handle. By using the <a class="el" href="window_guide.html#window_userptr">window user pointer</a>, you can access non-global structures or objects from your callbacks.</p>
|
||||||
|
<p >To get a better feel for how the various events callbacks behave, run the <code>events</code> test program. It register every callback supported by GLFW and prints out all arguments provided for every event, along with time and sequence information.</p>
|
||||||
|
<h1><a class="anchor" id="events"></a>
|
||||||
|
Event processing</h1>
|
||||||
|
<p >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 <a class="el" href="window_guide.html#buffer_swap">buffer swapping</a>. Even when you have no windows, event polling needs to be done in order to receive monitor and joystick connection events.</p>
|
||||||
|
<p >There are three functions for processing pending events. <a class="el" href="group__window.html#ga37bd57223967b4211d60ca1a0bf3c832">glfwPollEvents</a>, processes only those events that have already been received and then returns immediately.</p>
|
||||||
|
<div class="fragment"><div class="line"><a class="code hl_function" href="group__window.html#ga37bd57223967b4211d60ca1a0bf3c832">glfwPollEvents</a>();</div>
|
||||||
|
<div class="ttc" id="agroup__window_html_ga37bd57223967b4211d60ca1a0bf3c832"><div class="ttname"><a href="group__window.html#ga37bd57223967b4211d60ca1a0bf3c832">glfwPollEvents</a></div><div class="ttdeci">void glfwPollEvents(void)</div><div class="ttdoc">Processes all pending events.</div></div>
|
||||||
|
</div><!-- fragment --><p >This is the best choice when rendering continuously, like most games do.</p>
|
||||||
|
<p >If you only need to update the contents of the window when you receive new input, <a class="el" href="group__window.html#ga554e37d781f0a997656c26b2c56c835e">glfwWaitEvents</a> is a better choice.</p>
|
||||||
|
<div class="fragment"><div class="line"><a class="code hl_function" href="group__window.html#ga554e37d781f0a997656c26b2c56c835e">glfwWaitEvents</a>();</div>
|
||||||
|
<div class="ttc" id="agroup__window_html_ga554e37d781f0a997656c26b2c56c835e"><div class="ttname"><a href="group__window.html#ga554e37d781f0a997656c26b2c56c835e">glfwWaitEvents</a></div><div class="ttdeci">void glfwWaitEvents(void)</div><div class="ttdoc">Waits until events are queued and processes them.</div></div>
|
||||||
|
</div><!-- fragment --><p >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.</p>
|
||||||
|
<p >If you want to wait for events but have UI elements or other tasks that need periodic updates, <a class="el" href="group__window.html#ga605a178db92f1a7f1a925563ef3ea2cf">glfwWaitEventsTimeout</a> lets you specify a timeout.</p>
|
||||||
|
<div class="fragment"><div class="line"><a class="code hl_function" href="group__window.html#ga605a178db92f1a7f1a925563ef3ea2cf">glfwWaitEventsTimeout</a>(0.7);</div>
|
||||||
|
<div class="ttc" id="agroup__window_html_ga605a178db92f1a7f1a925563ef3ea2cf"><div class="ttname"><a href="group__window.html#ga605a178db92f1a7f1a925563ef3ea2cf">glfwWaitEventsTimeout</a></div><div class="ttdeci">void glfwWaitEventsTimeout(double timeout)</div><div class="ttdoc">Waits with timeout until events are queued and processes them.</div></div>
|
||||||
|
</div><!-- fragment --><p >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.</p>
|
||||||
|
<p >If the main thread is sleeping in <a class="el" href="group__window.html#ga554e37d781f0a997656c26b2c56c835e">glfwWaitEvents</a>, you can wake it from another thread by posting an empty event to the event queue with <a class="el" href="group__window.html#gab5997a25187e9fd5c6f2ecbbc8dfd7e9">glfwPostEmptyEvent</a>.</p>
|
||||||
|
<div class="fragment"><div class="line"><a class="code hl_function" href="group__window.html#gab5997a25187e9fd5c6f2ecbbc8dfd7e9">glfwPostEmptyEvent</a>();</div>
|
||||||
|
<div class="ttc" id="agroup__window_html_gab5997a25187e9fd5c6f2ecbbc8dfd7e9"><div class="ttname"><a href="group__window.html#gab5997a25187e9fd5c6f2ecbbc8dfd7e9">glfwPostEmptyEvent</a></div><div class="ttdeci">void glfwPostEmptyEvent(void)</div><div class="ttdoc">Posts an empty event to the event queue.</div></div>
|
||||||
|
</div><!-- fragment --><p >Do not assume that callbacks will <em>only</em> 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.</p>
|
||||||
|
<p >For example, on Windows the system function that <a class="el" href="group__window.html#ga371911f12c74c504dd8d47d832d095cb">glfwSetWindowSize</a> 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 <a class="el" href="window_guide.html#window_size">window size callback</a> GLFW will call it in turn with the new size before everything returns back out of the <a class="el" href="group__window.html#ga371911f12c74c504dd8d47d832d095cb">glfwSetWindowSize</a> call.</p>
|
||||||
|
<h1><a class="anchor" id="input_keyboard"></a>
|
||||||
|
Keyboard input</h1>
|
||||||
|
<p >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 Unicode code points generated by pressing some of them.</p>
|
||||||
|
<p >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.</p>
|
||||||
|
<h2><a class="anchor" id="input_key"></a>
|
||||||
|
Key input</h2>
|
||||||
|
<p >If you wish to be notified when a physical key is pressed or released or when it repeats, set a key callback.</p>
|
||||||
|
<div class="fragment"><div class="line"><a class="code hl_function" href="group__input.html#ga1caf18159767e761185e49a3be019f8d">glfwSetKeyCallback</a>(window, key_callback);</div>
|
||||||
|
<div class="ttc" id="agroup__input_html_ga1caf18159767e761185e49a3be019f8d"><div class="ttname"><a href="group__input.html#ga1caf18159767e761185e49a3be019f8d">glfwSetKeyCallback</a></div><div class="ttdeci">GLFWkeyfun glfwSetKeyCallback(GLFWwindow *window, GLFWkeyfun callback)</div><div class="ttdoc">Sets the key callback.</div></div>
|
||||||
|
</div><!-- fragment --><p >The callback function receives the <a class="el" href="group__keys.html">keyboard key</a>, platform-specific scancode, key action and <a class="el" href="group__mods.html">modifier bits</a>.</p>
|
||||||
|
<div class="fragment"><div class="line"><span class="keywordtype">void</span> key_callback(<a class="code hl_typedef" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a>* window, <span class="keywordtype">int</span> key, <span class="keywordtype">int</span> scancode, <span class="keywordtype">int</span> action, <span class="keywordtype">int</span> mods)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> <span class="keywordflow">if</span> (key == <a class="code hl_define" href="group__keys.html#gabf48fcc3afbe69349df432b470c96ef2">GLFW_KEY_E</a> && action == <a class="code hl_define" href="group__input.html#ga2485743d0b59df3791c45951c4195265">GLFW_PRESS</a>)</div>
|
||||||
|
<div class="line"> activate_airship();</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="ttc" id="agroup__input_html_ga2485743d0b59df3791c45951c4195265"><div class="ttname"><a href="group__input.html#ga2485743d0b59df3791c45951c4195265">GLFW_PRESS</a></div><div class="ttdeci">#define GLFW_PRESS</div><div class="ttdoc">The key or mouse button was pressed.</div><div class="ttdef"><b>Definition:</b> glfw3.h:338</div></div>
|
||||||
|
<div class="ttc" id="agroup__keys_html_gabf48fcc3afbe69349df432b470c96ef2"><div class="ttname"><a href="group__keys.html#gabf48fcc3afbe69349df432b470c96ef2">GLFW_KEY_E</a></div><div class="ttdeci">#define GLFW_KEY_E</div><div class="ttdef"><b>Definition:</b> glfw3.h:416</div></div>
|
||||||
|
<div class="ttc" id="agroup__window_html_ga3c96d80d363e67d13a41b5d1821f3242"><div class="ttname"><a href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a></div><div class="ttdeci">struct GLFWwindow GLFWwindow</div><div class="ttdoc">Opaque window object.</div><div class="ttdef"><b>Definition:</b> glfw3.h:1185</div></div>
|
||||||
|
</div><!-- fragment --><p >The action is one of <code>GLFW_PRESS</code>, <code>GLFW_REPEAT</code> or <code>GLFW_RELEASE</code>. Events with <code>GLFW_PRESS</code> and <code>GLFW_RELEASE</code> actions are emitted for every key press. Most keys will also emit events with <code>GLFW_REPEAT</code> actions while a key is held down.</p>
|
||||||
|
<p >Key events with <code>GLFW_REPEAT</code> 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. <code>GLFW_REPEAT</code> 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 <code>GLFW_PRESS</code> and <code>GLFW_RELEASE</code> actions, or call <a class="el" href="group__input.html#gadd341da06bc8d418b4dc3a3518af9ad2">glfwGetKey</a>, which provides basic cached key state.</p>
|
||||||
|
<p >The key will be one of the existing <a class="el" href="group__keys.html">key tokens</a>, or <code>GLFW_KEY_UNKNOWN</code> if GLFW lacks a token for it, for example <em>E-mail</em> and <em>Play</em> keys.</p>
|
||||||
|
<p >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 <a class="el" href="group__keys.html">named key</a> on the current platform with <a class="el" href="group__input.html#ga67ddd1b7dcbbaff03e4a76c0ea67103a">glfwGetKeyScancode</a>.</p>
|
||||||
|
<div class="fragment"><div class="line"><span class="keyword">const</span> <span class="keywordtype">int</span> scancode = <a class="code hl_function" href="group__input.html#ga67ddd1b7dcbbaff03e4a76c0ea67103a">glfwGetKeyScancode</a>(<a class="code hl_define" href="group__keys.html#gac1c42c0bf4192cea713c55598b06b744">GLFW_KEY_X</a>);</div>
|
||||||
|
<div class="line">set_key_mapping(scancode, swap_weapons);</div>
|
||||||
|
<div class="ttc" id="agroup__input_html_ga67ddd1b7dcbbaff03e4a76c0ea67103a"><div class="ttname"><a href="group__input.html#ga67ddd1b7dcbbaff03e4a76c0ea67103a">glfwGetKeyScancode</a></div><div class="ttdeci">int glfwGetKeyScancode(int key)</div><div class="ttdoc">Returns the platform-specific scancode of the specified key.</div></div>
|
||||||
|
<div class="ttc" id="agroup__keys_html_gac1c42c0bf4192cea713c55598b06b744"><div class="ttname"><a href="group__keys.html#gac1c42c0bf4192cea713c55598b06b744">GLFW_KEY_X</a></div><div class="ttdeci">#define GLFW_KEY_X</div><div class="ttdef"><b>Definition:</b> glfw3.h:435</div></div>
|
||||||
|
</div><!-- fragment --><p >The last reported state for every <a class="el" href="group__keys.html">named key</a> is also saved in per-window state arrays that can be polled with <a class="el" href="group__input.html#gadd341da06bc8d418b4dc3a3518af9ad2">glfwGetKey</a>.</p>
|
||||||
|
<div class="fragment"><div class="line"><span class="keywordtype">int</span> state = <a class="code hl_function" href="group__input.html#gadd341da06bc8d418b4dc3a3518af9ad2">glfwGetKey</a>(window, <a class="code hl_define" href="group__keys.html#gabf48fcc3afbe69349df432b470c96ef2">GLFW_KEY_E</a>);</div>
|
||||||
|
<div class="line"><span class="keywordflow">if</span> (state == <a class="code hl_define" href="group__input.html#ga2485743d0b59df3791c45951c4195265">GLFW_PRESS</a>)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> activate_airship();</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="ttc" id="agroup__input_html_gadd341da06bc8d418b4dc3a3518af9ad2"><div class="ttname"><a href="group__input.html#gadd341da06bc8d418b4dc3a3518af9ad2">glfwGetKey</a></div><div class="ttdeci">int glfwGetKey(GLFWwindow *window, int key)</div><div class="ttdoc">Returns the last reported state of a keyboard key for the specified window.</div></div>
|
||||||
|
</div><!-- fragment --><p >The returned state is one of <code>GLFW_PRESS</code> or <code>GLFW_RELEASE</code>.</p>
|
||||||
|
<p >This function only returns cached key event state. It does not poll the system for the current physical state of the key.</p>
|
||||||
|
<p ><a class="anchor" id="GLFW_STICKY_KEYS"></a>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 <code>GLFW_STICKY_KEYS</code> input mode.</p>
|
||||||
|
<div class="fragment"><div class="line"><a class="code hl_function" href="group__input.html#gaa92336e173da9c8834558b54ee80563b">glfwSetInputMode</a>(window, <a class="code hl_define" href="glfw3_8h.html#ae3bbe2315b7691ab088159eb6c9110fc">GLFW_STICKY_KEYS</a>, <a class="code hl_define" href="group__init.html#ga2744fbb29b5631bb28802dbe0cf36eba">GLFW_TRUE</a>);</div>
|
||||||
|
<div class="ttc" id="aglfw3_8h_html_ae3bbe2315b7691ab088159eb6c9110fc"><div class="ttname"><a href="glfw3_8h.html#ae3bbe2315b7691ab088159eb6c9110fc">GLFW_STICKY_KEYS</a></div><div class="ttdeci">#define GLFW_STICKY_KEYS</div><div class="ttdef"><b>Definition:</b> glfw3.h:1049</div></div>
|
||||||
|
<div class="ttc" id="agroup__init_html_ga2744fbb29b5631bb28802dbe0cf36eba"><div class="ttname"><a href="group__init.html#ga2744fbb29b5631bb28802dbe0cf36eba">GLFW_TRUE</a></div><div class="ttdeci">#define GLFW_TRUE</div><div class="ttdoc">One.</div><div class="ttdef"><b>Definition:</b> glfw3.h:312</div></div>
|
||||||
|
<div class="ttc" id="agroup__input_html_gaa92336e173da9c8834558b54ee80563b"><div class="ttname"><a href="group__input.html#gaa92336e173da9c8834558b54ee80563b">glfwSetInputMode</a></div><div class="ttdeci">void glfwSetInputMode(GLFWwindow *window, int mode, int value)</div><div class="ttdoc">Sets an input option for the specified window.</div></div>
|
||||||
|
</div><!-- fragment --><p >When sticky keys mode is enabled, the pollable state of a key will remain <code>GLFW_PRESS</code> until the state of that key is polled with <a class="el" href="group__input.html#gadd341da06bc8d418b4dc3a3518af9ad2">glfwGetKey</a>. Once it has been polled, if a key release event had been processed in the meantime, the state will reset to <code>GLFW_RELEASE</code>, otherwise it will remain <code>GLFW_PRESS</code>.</p>
|
||||||
|
<p ><a class="anchor" id="GLFW_LOCK_KEY_MODS"></a>If you wish to know what the state of the Caps Lock and Num Lock keys was when input events were generated, set the <code>GLFW_LOCK_KEY_MODS</code> input mode.</p>
|
||||||
|
<div class="fragment"><div class="line"><a class="code hl_function" href="group__input.html#gaa92336e173da9c8834558b54ee80563b">glfwSetInputMode</a>(window, <a class="code hl_define" href="glfw3_8h.html#a07b84de0b52143e1958f88a7d9105947">GLFW_LOCK_KEY_MODS</a>, <a class="code hl_define" href="group__init.html#ga2744fbb29b5631bb28802dbe0cf36eba">GLFW_TRUE</a>);</div>
|
||||||
|
<div class="ttc" id="aglfw3_8h_html_a07b84de0b52143e1958f88a7d9105947"><div class="ttname"><a href="glfw3_8h.html#a07b84de0b52143e1958f88a7d9105947">GLFW_LOCK_KEY_MODS</a></div><div class="ttdeci">#define GLFW_LOCK_KEY_MODS</div><div class="ttdef"><b>Definition:</b> glfw3.h:1051</div></div>
|
||||||
|
</div><!-- fragment --><p >When this input mode is enabled, any callback that receives <a class="el" href="group__mods.html">modifier bits</a> will have the <a class="el" href="group__mods.html#gaefeef8fcf825a6e43e241b337897200f">GLFW_MOD_CAPS_LOCK</a> bit set if Caps Lock was on when the event occurred and the <a class="el" href="group__mods.html#ga64e020b8a42af8376e944baf61feecbe">GLFW_MOD_NUM_LOCK</a> bit set if Num Lock was on.</p>
|
||||||
|
<p >The <code>GLFW_KEY_LAST</code> constant holds the highest value of any <a class="el" href="group__keys.html">named key</a>.</p>
|
||||||
|
<h2><a class="anchor" id="input_char"></a>
|
||||||
|
Text input</h2>
|
||||||
|
<p >GLFW supports text input in the form of a stream of <a href="https://en.wikipedia.org/wiki/Unicode">Unicode code points</a>, as produced by the operating system text input system. Unlike key input, text input obeys keyboard layouts and modifier keys and supports composing characters using <a href="https://en.wikipedia.org/wiki/Dead_key">dead keys</a>. Once received, you can encode the code points into UTF-8 or any other encoding you prefer.</p>
|
||||||
|
<p >Because an <code>unsigned int</code> is 32 bits long on all platforms supported by GLFW, you can treat the code point argument as native endian UTF-32.</p>
|
||||||
|
<p >If you wish to offer regular text input, set a character callback.</p>
|
||||||
|
<div class="fragment"><div class="line"><a class="code hl_function" href="group__input.html#gab25c4a220fd8f5717718dbc487828996">glfwSetCharCallback</a>(window, character_callback);</div>
|
||||||
|
<div class="ttc" id="agroup__input_html_gab25c4a220fd8f5717718dbc487828996"><div class="ttname"><a href="group__input.html#gab25c4a220fd8f5717718dbc487828996">glfwSetCharCallback</a></div><div class="ttdeci">GLFWcharfun glfwSetCharCallback(GLFWwindow *window, GLFWcharfun callback)</div><div class="ttdoc">Sets the Unicode character callback.</div></div>
|
||||||
|
</div><!-- fragment --><p >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.</p>
|
||||||
|
<div class="fragment"><div class="line"><span class="keywordtype">void</span> character_callback(<a class="code hl_typedef" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a>* window, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> codepoint)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
</div><!-- fragment --><h2><a class="anchor" id="input_key_name"></a>
|
||||||
|
Key names</h2>
|
||||||
|
<p >If you wish to refer to keys by name, you can query the keyboard layout dependent name of printable keys with <a class="el" href="group__input.html#gaeaed62e69c3bd62b7ff8f7b19913ce4f">glfwGetKeyName</a>.</p>
|
||||||
|
<div class="fragment"><div class="line"><span class="keyword">const</span> <span class="keywordtype">char</span>* key_name = <a class="code hl_function" href="group__input.html#gaeaed62e69c3bd62b7ff8f7b19913ce4f">glfwGetKeyName</a>(<a class="code hl_define" href="group__keys.html#gaa06a712e6202661fc03da5bdb7b6e545">GLFW_KEY_W</a>, 0);</div>
|
||||||
|
<div class="line">show_tutorial_hint(<span class="stringliteral">"Press %s to move forward"</span>, key_name);</div>
|
||||||
|
<div class="ttc" id="agroup__input_html_gaeaed62e69c3bd62b7ff8f7b19913ce4f"><div class="ttname"><a href="group__input.html#gaeaed62e69c3bd62b7ff8f7b19913ce4f">glfwGetKeyName</a></div><div class="ttdeci">const char * glfwGetKeyName(int key, int scancode)</div><div class="ttdoc">Returns the layout-specific name of the specified printable key.</div></div>
|
||||||
|
<div class="ttc" id="agroup__keys_html_gaa06a712e6202661fc03da5bdb7b6e545"><div class="ttname"><a href="group__keys.html#gaa06a712e6202661fc03da5bdb7b6e545">GLFW_KEY_W</a></div><div class="ttdeci">#define GLFW_KEY_W</div><div class="ttdef"><b>Definition:</b> glfw3.h:434</div></div>
|
||||||
|
</div><!-- fragment --><p >This function can handle both <a class="el" href="input_guide.html#input_key">keys and scancodes</a>. If the specified key is <code>GLFW_KEY_UNKNOWN</code> 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.</p>
|
||||||
|
<h1><a class="anchor" id="input_mouse"></a>
|
||||||
|
Mouse input</h1>
|
||||||
|
<p >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.</p>
|
||||||
|
<h2><a class="anchor" id="cursor_pos"></a>
|
||||||
|
Cursor position</h2>
|
||||||
|
<p >If you wish to be notified when the cursor moves over the window, set a cursor position callback.</p>
|
||||||
|
<div class="fragment"><div class="line"><a class="code hl_function" href="group__input.html#gac1f879ab7435d54d4d79bb469fe225d7">glfwSetCursorPosCallback</a>(window, cursor_position_callback);</div>
|
||||||
|
<div class="ttc" id="agroup__input_html_gac1f879ab7435d54d4d79bb469fe225d7"><div class="ttname"><a href="group__input.html#gac1f879ab7435d54d4d79bb469fe225d7">glfwSetCursorPosCallback</a></div><div class="ttdeci">GLFWcursorposfun glfwSetCursorPosCallback(GLFWwindow *window, GLFWcursorposfun callback)</div><div class="ttdoc">Sets the cursor position callback.</div></div>
|
||||||
|
</div><!-- fragment --><p >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.</p>
|
||||||
|
<div class="fragment"><div class="line"><span class="keyword">static</span> <span class="keywordtype">void</span> cursor_position_callback(<a class="code hl_typedef" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a>* window, <span class="keywordtype">double</span> xpos, <span class="keywordtype">double</span> ypos)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
</div><!-- fragment --><p >The cursor position is also saved per-window and can be polled with <a class="el" href="group__input.html#ga01d37b6c40133676b9cea60ca1d7c0cc">glfwGetCursorPos</a>.</p>
|
||||||
|
<div class="fragment"><div class="line"><span class="keywordtype">double</span> xpos, ypos;</div>
|
||||||
|
<div class="line"><a class="code hl_function" href="group__input.html#ga01d37b6c40133676b9cea60ca1d7c0cc">glfwGetCursorPos</a>(window, &xpos, &ypos);</div>
|
||||||
|
<div class="ttc" id="agroup__input_html_ga01d37b6c40133676b9cea60ca1d7c0cc"><div class="ttname"><a href="group__input.html#ga01d37b6c40133676b9cea60ca1d7c0cc">glfwGetCursorPos</a></div><div class="ttdeci">void glfwGetCursorPos(GLFWwindow *window, double *xpos, double *ypos)</div><div class="ttdoc">Retrieves the position of the cursor relative to the content area of the window.</div></div>
|
||||||
|
</div><!-- fragment --><h2><a class="anchor" id="cursor_mode"></a>
|
||||||
|
Cursor mode</h2>
|
||||||
|
<p ><a class="anchor" id="GLFW_CURSOR"></a>The <code>GLFW_CURSOR</code> input mode provides several cursor modes for special forms of mouse motion input. By default, the cursor mode is <code>GLFW_CURSOR_NORMAL</code>, meaning the regular arrow cursor (or another cursor set with <a class="el" href="group__input.html#gad3b4f38c8d5dae036bc8fa959e18343e">glfwSetCursor</a>) is used and cursor motion is not limited.</p>
|
||||||
|
<p >If you wish to implement mouse motion based camera controls or other input schemes that require unlimited mouse movement, set the cursor mode to <code>GLFW_CURSOR_DISABLED</code>.</p>
|
||||||
|
<div class="fragment"><div class="line"><a class="code hl_function" href="group__input.html#gaa92336e173da9c8834558b54ee80563b">glfwSetInputMode</a>(window, <a class="code hl_define" href="glfw3_8h.html#aade31da5b884a84a7625c6b059b9132c">GLFW_CURSOR</a>, <a class="code hl_define" href="glfw3_8h.html#a2315b99a329ce53e6a13a9d46fd5ca88">GLFW_CURSOR_DISABLED</a>);</div>
|
||||||
|
<div class="ttc" id="aglfw3_8h_html_a2315b99a329ce53e6a13a9d46fd5ca88"><div class="ttname"><a href="glfw3_8h.html#a2315b99a329ce53e6a13a9d46fd5ca88">GLFW_CURSOR_DISABLED</a></div><div class="ttdeci">#define GLFW_CURSOR_DISABLED</div><div class="ttdef"><b>Definition:</b> glfw3.h:1056</div></div>
|
||||||
|
<div class="ttc" id="aglfw3_8h_html_aade31da5b884a84a7625c6b059b9132c"><div class="ttname"><a href="glfw3_8h.html#aade31da5b884a84a7625c6b059b9132c">GLFW_CURSOR</a></div><div class="ttdeci">#define GLFW_CURSOR</div><div class="ttdef"><b>Definition:</b> glfw3.h:1048</div></div>
|
||||||
|
</div><!-- fragment --><p >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.</p>
|
||||||
|
<dl class="section note"><dt>Note</dt><dd>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 <code>GLFW_CURSOR_DISABLED</code>.</dd></dl>
|
||||||
|
<p>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 <code>GLFW_CURSOR_HIDDEN</code>.</p>
|
||||||
|
<div class="fragment"><div class="line"><a class="code hl_function" href="group__input.html#gaa92336e173da9c8834558b54ee80563b">glfwSetInputMode</a>(window, <a class="code hl_define" href="glfw3_8h.html#aade31da5b884a84a7625c6b059b9132c">GLFW_CURSOR</a>, <a class="code hl_define" href="glfw3_8h.html#ac4d5cb9d78de8573349c58763d53bf11">GLFW_CURSOR_HIDDEN</a>);</div>
|
||||||
|
<div class="ttc" id="aglfw3_8h_html_ac4d5cb9d78de8573349c58763d53bf11"><div class="ttname"><a href="glfw3_8h.html#ac4d5cb9d78de8573349c58763d53bf11">GLFW_CURSOR_HIDDEN</a></div><div class="ttdeci">#define GLFW_CURSOR_HIDDEN</div><div class="ttdef"><b>Definition:</b> glfw3.h:1055</div></div>
|
||||||
|
</div><!-- fragment --><p >This mode puts no limit on the motion of the cursor.</p>
|
||||||
|
<p >To exit out of either of these special modes, restore the <code>GLFW_CURSOR_NORMAL</code> cursor mode.</p>
|
||||||
|
<div class="fragment"><div class="line"><a class="code hl_function" href="group__input.html#gaa92336e173da9c8834558b54ee80563b">glfwSetInputMode</a>(window, <a class="code hl_define" href="glfw3_8h.html#aade31da5b884a84a7625c6b059b9132c">GLFW_CURSOR</a>, <a class="code hl_define" href="glfw3_8h.html#ae04dd25c8577e19fa8c97368561f6c68">GLFW_CURSOR_NORMAL</a>);</div>
|
||||||
|
<div class="ttc" id="aglfw3_8h_html_ae04dd25c8577e19fa8c97368561f6c68"><div class="ttname"><a href="glfw3_8h.html#ae04dd25c8577e19fa8c97368561f6c68">GLFW_CURSOR_NORMAL</a></div><div class="ttdeci">#define GLFW_CURSOR_NORMAL</div><div class="ttdef"><b>Definition:</b> glfw3.h:1054</div></div>
|
||||||
|
</div><!-- fragment --><p ><a class="anchor" id="GLFW_RAW_MOUSE_MOTION"></a></p>
|
||||||
|
<h2><a class="anchor" id="raw_mouse_motion"></a>
|
||||||
|
Raw mouse motion</h2>
|
||||||
|
<p >When the cursor is disabled, raw (unscaled and unaccelerated) mouse motion can be enabled if available.</p>
|
||||||
|
<p >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.</p>
|
||||||
|
<p >Call <a class="el" href="group__input.html#gae4ee0dbd0d256183e1ea4026d897e1c2">glfwRawMouseMotionSupported</a> to check if the current machine provides raw motion and set the <code>GLFW_RAW_MOUSE_MOTION</code> input mode to enable it. It is disabled by default.</p>
|
||||||
|
<div class="fragment"><div class="line"><span class="keywordflow">if</span> (<a class="code hl_function" href="group__input.html#gae4ee0dbd0d256183e1ea4026d897e1c2">glfwRawMouseMotionSupported</a>())</div>
|
||||||
|
<div class="line"> <a class="code hl_function" href="group__input.html#gaa92336e173da9c8834558b54ee80563b">glfwSetInputMode</a>(window, <a class="code hl_define" href="glfw3_8h.html#aeeda1be76a44a1fc97c1282e06281fbb">GLFW_RAW_MOUSE_MOTION</a>, <a class="code hl_define" href="group__init.html#ga2744fbb29b5631bb28802dbe0cf36eba">GLFW_TRUE</a>);</div>
|
||||||
|
<div class="ttc" id="aglfw3_8h_html_aeeda1be76a44a1fc97c1282e06281fbb"><div class="ttname"><a href="glfw3_8h.html#aeeda1be76a44a1fc97c1282e06281fbb">GLFW_RAW_MOUSE_MOTION</a></div><div class="ttdeci">#define GLFW_RAW_MOUSE_MOTION</div><div class="ttdef"><b>Definition:</b> glfw3.h:1052</div></div>
|
||||||
|
<div class="ttc" id="agroup__input_html_gae4ee0dbd0d256183e1ea4026d897e1c2"><div class="ttname"><a href="group__input.html#gae4ee0dbd0d256183e1ea4026d897e1c2">glfwRawMouseMotionSupported</a></div><div class="ttdeci">int glfwRawMouseMotionSupported(void)</div><div class="ttdoc">Returns whether raw mouse motion is supported.</div></div>
|
||||||
|
</div><!-- fragment --><p >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.</p>
|
||||||
|
<h2><a class="anchor" id="cursor_object"></a>
|
||||||
|
Cursor objects</h2>
|
||||||
|
<p >GLFW supports creating both custom and system theme cursor images, encapsulated as <a class="el" href="group__input.html#ga89261ae18c75e863aaf2656ecdd238f4">GLFWcursor</a> objects. They are created with <a class="el" href="group__input.html#ga556f604f73af156c0db0e97c081373c3">glfwCreateCursor</a> or <a class="el" href="group__input.html#gaf2fb2eb2c9dd842d1cef8a34e3c6403e">glfwCreateStandardCursor</a> and destroyed with <a class="el" href="group__input.html#ga81b952cd1764274d0db7fb3c5a79ba6a">glfwDestroyCursor</a>, or <a class="el" href="group__init.html#gaaae48c0a18607ea4a4ba951d939f0901">glfwTerminate</a>, if any remain.</p>
|
||||||
|
<h3><a class="anchor" id="cursor_custom"></a>
|
||||||
|
Custom cursor creation</h3>
|
||||||
|
<p >A custom cursor is created with <a class="el" href="group__input.html#ga556f604f73af156c0db0e97c081373c3">glfwCreateCursor</a>, 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:</p>
|
||||||
|
<div class="fragment"><div class="line"><span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> pixels[16 * 16 * 4];</div>
|
||||||
|
<div class="line">memset(pixels, 0xff, <span class="keyword">sizeof</span>(pixels));</div>
|
||||||
|
<div class="line"> </div>
|
||||||
|
<div class="line"><a class="code hl_struct" href="structGLFWimage.html">GLFWimage</a> image;</div>
|
||||||
|
<div class="line">image.<a class="code hl_variable" href="structGLFWimage.html#af6a71cc999fe6d3aea31dd7e9687d835">width</a> = 16;</div>
|
||||||
|
<div class="line">image.<a class="code hl_variable" href="structGLFWimage.html#a0b7d95368f0c80d5e5c9875057c7dbec">height</a> = 16;</div>
|
||||||
|
<div class="line">image.<a class="code hl_variable" href="structGLFWimage.html#a0c532a5c2bb715555279b7817daba0fb">pixels</a> = pixels;</div>
|
||||||
|
<div class="line"> </div>
|
||||||
|
<div class="line"><a class="code hl_typedef" href="group__input.html#ga89261ae18c75e863aaf2656ecdd238f4">GLFWcursor</a>* cursor = <a class="code hl_function" href="group__input.html#ga556f604f73af156c0db0e97c081373c3">glfwCreateCursor</a>(&image, 0, 0);</div>
|
||||||
|
<div class="ttc" id="agroup__input_html_ga556f604f73af156c0db0e97c081373c3"><div class="ttname"><a href="group__input.html#ga556f604f73af156c0db0e97c081373c3">glfwCreateCursor</a></div><div class="ttdeci">GLFWcursor * glfwCreateCursor(const GLFWimage *image, int xhot, int yhot)</div><div class="ttdoc">Creates a custom cursor.</div></div>
|
||||||
|
<div class="ttc" id="agroup__input_html_ga89261ae18c75e863aaf2656ecdd238f4"><div class="ttname"><a href="group__input.html#ga89261ae18c75e863aaf2656ecdd238f4">GLFWcursor</a></div><div class="ttdeci">struct GLFWcursor GLFWcursor</div><div class="ttdoc">Opaque cursor object.</div><div class="ttdef"><b>Definition:</b> glfw3.h:1197</div></div>
|
||||||
|
<div class="ttc" id="astructGLFWimage_html"><div class="ttname"><a href="structGLFWimage.html">GLFWimage</a></div><div class="ttdoc">Image data.</div><div class="ttdef"><b>Definition:</b> glfw3.h:1721</div></div>
|
||||||
|
<div class="ttc" id="astructGLFWimage_html_a0b7d95368f0c80d5e5c9875057c7dbec"><div class="ttname"><a href="structGLFWimage.html#a0b7d95368f0c80d5e5c9875057c7dbec">GLFWimage::height</a></div><div class="ttdeci">int height</div><div class="ttdef"><b>Definition:</b> glfw3.h:1727</div></div>
|
||||||
|
<div class="ttc" id="astructGLFWimage_html_a0c532a5c2bb715555279b7817daba0fb"><div class="ttname"><a href="structGLFWimage.html#a0c532a5c2bb715555279b7817daba0fb">GLFWimage::pixels</a></div><div class="ttdeci">unsigned char * pixels</div><div class="ttdef"><b>Definition:</b> glfw3.h:1730</div></div>
|
||||||
|
<div class="ttc" id="astructGLFWimage_html_af6a71cc999fe6d3aea31dd7e9687d835"><div class="ttname"><a href="structGLFWimage.html#af6a71cc999fe6d3aea31dd7e9687d835">GLFWimage::width</a></div><div class="ttdeci">int width</div><div class="ttdef"><b>Definition:</b> glfw3.h:1724</div></div>
|
||||||
|
</div><!-- fragment --><p >If cursor creation fails, <code>NULL</code> will be returned, so it is necessary to check the return value.</p>
|
||||||
|
<p >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.</p>
|
||||||
|
<h3><a class="anchor" id="cursor_standard"></a>
|
||||||
|
Standard cursor creation</h3>
|
||||||
|
<p >A cursor with a <a class="el" href="group__shapes.html">standard shape</a> from the current system cursor theme can be can be created with <a class="el" href="group__input.html#gaf2fb2eb2c9dd842d1cef8a34e3c6403e">glfwCreateStandardCursor</a>.</p>
|
||||||
|
<div class="fragment"><div class="line"><a class="code hl_typedef" href="group__input.html#ga89261ae18c75e863aaf2656ecdd238f4">GLFWcursor</a>* cursor = <a class="code hl_function" href="group__input.html#gaf2fb2eb2c9dd842d1cef8a34e3c6403e">glfwCreateStandardCursor</a>(<a class="code hl_define" href="group__shapes.html#gabb3eb0109f11bb808fc34659177ca962">GLFW_HRESIZE_CURSOR</a>);</div>
|
||||||
|
<div class="ttc" id="agroup__input_html_gaf2fb2eb2c9dd842d1cef8a34e3c6403e"><div class="ttname"><a href="group__input.html#gaf2fb2eb2c9dd842d1cef8a34e3c6403e">glfwCreateStandardCursor</a></div><div class="ttdeci">GLFWcursor * glfwCreateStandardCursor(int shape)</div><div class="ttdoc">Creates a cursor with a standard shape.</div></div>
|
||||||
|
<div class="ttc" id="agroup__shapes_html_gabb3eb0109f11bb808fc34659177ca962"><div class="ttname"><a href="group__shapes.html#gabb3eb0109f11bb808fc34659177ca962">GLFW_HRESIZE_CURSOR</a></div><div class="ttdeci">#define GLFW_HRESIZE_CURSOR</div><div class="ttdoc">The horizontal resize arrow shape.</div><div class="ttdef"><b>Definition:</b> glfw3.h:1098</div></div>
|
||||||
|
</div><!-- fragment --><p >These cursor objects behave in the exact same way as those created with <a class="el" href="group__input.html#ga556f604f73af156c0db0e97c081373c3">glfwCreateCursor</a> except that the system cursor theme provides the actual image.</p>
|
||||||
|
<h3><a class="anchor" id="cursor_destruction"></a>
|
||||||
|
Cursor destruction</h3>
|
||||||
|
<p >When a cursor is no longer needed, destroy it with <a class="el" href="group__input.html#ga81b952cd1764274d0db7fb3c5a79ba6a">glfwDestroyCursor</a>.</p>
|
||||||
|
<div class="fragment"><div class="line"><a class="code hl_function" href="group__input.html#ga81b952cd1764274d0db7fb3c5a79ba6a">glfwDestroyCursor</a>(cursor);</div>
|
||||||
|
<div class="ttc" id="agroup__input_html_ga81b952cd1764274d0db7fb3c5a79ba6a"><div class="ttname"><a href="group__input.html#ga81b952cd1764274d0db7fb3c5a79ba6a">glfwDestroyCursor</a></div><div class="ttdeci">void glfwDestroyCursor(GLFWcursor *cursor)</div><div class="ttdoc">Destroys a cursor.</div></div>
|
||||||
|
</div><!-- fragment --><p >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 <a class="el" href="group__init.html#gaaae48c0a18607ea4a4ba951d939f0901">glfwTerminate</a> is called.</p>
|
||||||
|
<h3><a class="anchor" id="cursor_set"></a>
|
||||||
|
Cursor setting</h3>
|
||||||
|
<p >A cursor can be set as current for a window with <a class="el" href="group__input.html#gad3b4f38c8d5dae036bc8fa959e18343e">glfwSetCursor</a>.</p>
|
||||||
|
<div class="fragment"><div class="line"><a class="code hl_function" href="group__input.html#gad3b4f38c8d5dae036bc8fa959e18343e">glfwSetCursor</a>(window, cursor);</div>
|
||||||
|
<div class="ttc" id="agroup__input_html_gad3b4f38c8d5dae036bc8fa959e18343e"><div class="ttname"><a href="group__input.html#gad3b4f38c8d5dae036bc8fa959e18343e">glfwSetCursor</a></div><div class="ttdeci">void glfwSetCursor(GLFWwindow *window, GLFWcursor *cursor)</div><div class="ttdoc">Sets the cursor for the window.</div></div>
|
||||||
|
</div><!-- fragment --><p >Once set, the cursor image will be used as long as the system cursor is over the content area of the window and the <a class="el" href="input_guide.html#cursor_mode">cursor mode</a> is set to <code>GLFW_CURSOR_NORMAL</code>.</p>
|
||||||
|
<p >A single cursor may be set for any number of windows.</p>
|
||||||
|
<p >To revert to the default cursor, set the cursor of that window to <code>NULL</code>.</p>
|
||||||
|
<div class="fragment"><div class="line"><a class="code hl_function" href="group__input.html#gad3b4f38c8d5dae036bc8fa959e18343e">glfwSetCursor</a>(window, NULL);</div>
|
||||||
|
</div><!-- fragment --><p >When a cursor is destroyed, any window that has it set will revert to the default cursor. This does not affect the cursor mode.</p>
|
||||||
|
<h2><a class="anchor" id="cursor_enter"></a>
|
||||||
|
Cursor enter/leave events</h2>
|
||||||
|
<p >If you wish to be notified when the cursor enters or leaves the content area of a window, set a cursor enter/leave callback.</p>
|
||||||
|
<div class="fragment"><div class="line"><a class="code hl_function" href="group__input.html#gad27f8ad0142c038a281466c0966817d8">glfwSetCursorEnterCallback</a>(window, cursor_enter_callback);</div>
|
||||||
|
<div class="ttc" id="agroup__input_html_gad27f8ad0142c038a281466c0966817d8"><div class="ttname"><a href="group__input.html#gad27f8ad0142c038a281466c0966817d8">glfwSetCursorEnterCallback</a></div><div class="ttdeci">GLFWcursorenterfun glfwSetCursorEnterCallback(GLFWwindow *window, GLFWcursorenterfun callback)</div><div class="ttdoc">Sets the cursor enter/leave callback.</div></div>
|
||||||
|
</div><!-- fragment --><p >The callback function receives the new classification of the cursor.</p>
|
||||||
|
<div class="fragment"><div class="line"><span class="keywordtype">void</span> cursor_enter_callback(<a class="code hl_typedef" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a>* window, <span class="keywordtype">int</span> entered)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> <span class="keywordflow">if</span> (entered)</div>
|
||||||
|
<div class="line"> {</div>
|
||||||
|
<div class="line"> <span class="comment">// The cursor entered the content area of the window</span></div>
|
||||||
|
<div class="line"> }</div>
|
||||||
|
<div class="line"> <span class="keywordflow">else</span></div>
|
||||||
|
<div class="line"> {</div>
|
||||||
|
<div class="line"> <span class="comment">// The cursor left the content area of the window</span></div>
|
||||||
|
<div class="line"> }</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
</div><!-- fragment --><p >You can query whether the cursor is currently inside the content area of the window with the <a class="el" href="window_guide.html#GLFW_HOVERED_attrib">GLFW_HOVERED</a> window attribute.</p>
|
||||||
|
<div class="fragment"><div class="line"><span class="keywordflow">if</span> (<a class="code hl_function" href="group__window.html#gacccb29947ea4b16860ebef42c2cb9337">glfwGetWindowAttrib</a>(window, <a class="code hl_define" href="group__window.html#ga8665c71c6fa3d22425c6a0e8a3f89d8a">GLFW_HOVERED</a>))</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> highlight_interface();</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="ttc" id="agroup__window_html_ga8665c71c6fa3d22425c6a0e8a3f89d8a"><div class="ttname"><a href="group__window.html#ga8665c71c6fa3d22425c6a0e8a3f89d8a">GLFW_HOVERED</a></div><div class="ttdeci">#define GLFW_HOVERED</div><div class="ttdoc">Mouse cursor hover window attribute.</div><div class="ttdef"><b>Definition:</b> glfw3.h:855</div></div>
|
||||||
|
<div class="ttc" id="agroup__window_html_gacccb29947ea4b16860ebef42c2cb9337"><div class="ttname"><a href="group__window.html#gacccb29947ea4b16860ebef42c2cb9337">glfwGetWindowAttrib</a></div><div class="ttdeci">int glfwGetWindowAttrib(GLFWwindow *window, int attrib)</div><div class="ttdoc">Returns an attribute of the specified window.</div></div>
|
||||||
|
</div><!-- fragment --><h2><a class="anchor" id="input_mouse_button"></a>
|
||||||
|
Mouse button input</h2>
|
||||||
|
<p >If you wish to be notified when a mouse button is pressed or released, set a mouse button callback.</p>
|
||||||
|
<div class="fragment"><div class="line"><a class="code hl_function" href="group__input.html#ga6ab84420974d812bee700e45284a723c">glfwSetMouseButtonCallback</a>(window, mouse_button_callback);</div>
|
||||||
|
<div class="ttc" id="agroup__input_html_ga6ab84420974d812bee700e45284a723c"><div class="ttname"><a href="group__input.html#ga6ab84420974d812bee700e45284a723c">glfwSetMouseButtonCallback</a></div><div class="ttdeci">GLFWmousebuttonfun glfwSetMouseButtonCallback(GLFWwindow *window, GLFWmousebuttonfun callback)</div><div class="ttdoc">Sets the mouse button callback.</div></div>
|
||||||
|
</div><!-- fragment --><p >The callback function receives the <a class="el" href="group__buttons.html">mouse button</a>, button action and <a class="el" href="group__mods.html">modifier bits</a>.</p>
|
||||||
|
<div class="fragment"><div class="line"><span class="keywordtype">void</span> mouse_button_callback(<a class="code hl_typedef" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a>* window, <span class="keywordtype">int</span> button, <span class="keywordtype">int</span> action, <span class="keywordtype">int</span> mods)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> <span class="keywordflow">if</span> (button == <a class="code hl_define" href="group__buttons.html#ga3e2f2cf3c4942df73cc094247d275e74">GLFW_MOUSE_BUTTON_RIGHT</a> && action == <a class="code hl_define" href="group__input.html#ga2485743d0b59df3791c45951c4195265">GLFW_PRESS</a>)</div>
|
||||||
|
<div class="line"> popup_menu();</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="ttc" id="agroup__buttons_html_ga3e2f2cf3c4942df73cc094247d275e74"><div class="ttname"><a href="group__buttons.html#ga3e2f2cf3c4942df73cc094247d275e74">GLFW_MOUSE_BUTTON_RIGHT</a></div><div class="ttdeci">#define GLFW_MOUSE_BUTTON_RIGHT</div><div class="ttdef"><b>Definition:</b> glfw3.h:581</div></div>
|
||||||
|
</div><!-- fragment --><p >The action is one of <code>GLFW_PRESS</code> or <code>GLFW_RELEASE</code>.</p>
|
||||||
|
<p >Mouse button states for <a class="el" href="group__buttons.html">named buttons</a> are also saved in per-window state arrays that can be polled with <a class="el" href="group__input.html#gac1473feacb5996c01a7a5a33b5066704">glfwGetMouseButton</a>.</p>
|
||||||
|
<div class="fragment"><div class="line"><span class="keywordtype">int</span> state = <a class="code hl_function" href="group__input.html#gac1473feacb5996c01a7a5a33b5066704">glfwGetMouseButton</a>(window, <a class="code hl_define" href="group__buttons.html#gaf37100431dcd5082d48f95ee8bc8cd56">GLFW_MOUSE_BUTTON_LEFT</a>);</div>
|
||||||
|
<div class="line"><span class="keywordflow">if</span> (state == <a class="code hl_define" href="group__input.html#ga2485743d0b59df3791c45951c4195265">GLFW_PRESS</a>)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> upgrade_cow();</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="ttc" id="agroup__buttons_html_gaf37100431dcd5082d48f95ee8bc8cd56"><div class="ttname"><a href="group__buttons.html#gaf37100431dcd5082d48f95ee8bc8cd56">GLFW_MOUSE_BUTTON_LEFT</a></div><div class="ttdeci">#define GLFW_MOUSE_BUTTON_LEFT</div><div class="ttdef"><b>Definition:</b> glfw3.h:580</div></div>
|
||||||
|
<div class="ttc" id="agroup__input_html_gac1473feacb5996c01a7a5a33b5066704"><div class="ttname"><a href="group__input.html#gac1473feacb5996c01a7a5a33b5066704">glfwGetMouseButton</a></div><div class="ttdeci">int glfwGetMouseButton(GLFWwindow *window, int button)</div><div class="ttdoc">Returns the last reported state of a mouse button for the specified window.</div></div>
|
||||||
|
</div><!-- fragment --><p >The returned state is one of <code>GLFW_PRESS</code> or <code>GLFW_RELEASE</code>.</p>
|
||||||
|
<p >This function only returns cached mouse button event state. It does not poll the system for the current state of the mouse button.</p>
|
||||||
|
<p ><a class="anchor" id="GLFW_STICKY_MOUSE_BUTTONS"></a>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 <code>GLFW_STICKY_MOUSE_BUTTONS</code> input mode.</p>
|
||||||
|
<div class="fragment"><div class="line"><a class="code hl_function" href="group__input.html#gaa92336e173da9c8834558b54ee80563b">glfwSetInputMode</a>(window, <a class="code hl_define" href="glfw3_8h.html#a4d7ce8ce71030c3b04e2b78145bc59d1">GLFW_STICKY_MOUSE_BUTTONS</a>, <a class="code hl_define" href="group__init.html#ga2744fbb29b5631bb28802dbe0cf36eba">GLFW_TRUE</a>);</div>
|
||||||
|
<div class="ttc" id="aglfw3_8h_html_a4d7ce8ce71030c3b04e2b78145bc59d1"><div class="ttname"><a href="glfw3_8h.html#a4d7ce8ce71030c3b04e2b78145bc59d1">GLFW_STICKY_MOUSE_BUTTONS</a></div><div class="ttdeci">#define GLFW_STICKY_MOUSE_BUTTONS</div><div class="ttdef"><b>Definition:</b> glfw3.h:1050</div></div>
|
||||||
|
</div><!-- fragment --><p >When sticky mouse buttons mode is enabled, the pollable state of a mouse button will remain <code>GLFW_PRESS</code> until the state of that button is polled with <a class="el" href="group__input.html#gac1473feacb5996c01a7a5a33b5066704">glfwGetMouseButton</a>. Once it has been polled, if a mouse button release event had been processed in the meantime, the state will reset to <code>GLFW_RELEASE</code>, otherwise it will remain <code>GLFW_PRESS</code>.</p>
|
||||||
|
<p >The <code>GLFW_MOUSE_BUTTON_LAST</code> constant holds the highest value of any <a class="el" href="group__buttons.html">named button</a>.</p>
|
||||||
|
<h2><a class="anchor" id="scrolling"></a>
|
||||||
|
Scroll input</h2>
|
||||||
|
<p >If you wish to be notified when the user scrolls, whether with a mouse wheel or touchpad gesture, set a scroll callback.</p>
|
||||||
|
<div class="fragment"><div class="line"><a class="code hl_function" href="group__input.html#ga571e45a030ae4061f746ed56cb76aede">glfwSetScrollCallback</a>(window, scroll_callback);</div>
|
||||||
|
<div class="ttc" id="agroup__input_html_ga571e45a030ae4061f746ed56cb76aede"><div class="ttname"><a href="group__input.html#ga571e45a030ae4061f746ed56cb76aede">glfwSetScrollCallback</a></div><div class="ttdeci">GLFWscrollfun glfwSetScrollCallback(GLFWwindow *window, GLFWscrollfun callback)</div><div class="ttdoc">Sets the scroll callback.</div></div>
|
||||||
|
</div><!-- fragment --><p >The callback function receives two-dimensional scroll offsets.</p>
|
||||||
|
<div class="fragment"><div class="line"><span class="keywordtype">void</span> scroll_callback(<a class="code hl_typedef" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a>* window, <span class="keywordtype">double</span> xoffset, <span class="keywordtype">double</span> yoffset)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
</div><!-- fragment --><p >A normal mouse wheel, being vertical, provides offsets along the Y-axis.</p>
|
||||||
|
<h1><a class="anchor" id="joystick"></a>
|
||||||
|
Joystick input</h1>
|
||||||
|
<p >The joystick functions expose connected joysticks and controllers, with both referred to as joysticks. It supports up to sixteen joysticks, ranging from <code>GLFW_JOYSTICK_1</code>, <code>GLFW_JOYSTICK_2</code> up to and including <code>GLFW_JOYSTICK_16</code> or <code>GLFW_JOYSTICK_LAST</code>. You can test whether a <a class="el" href="group__joysticks.html">joystick</a> is present with <a class="el" href="group__input.html#gaed0966cee139d815317f9ffcba64c9f1">glfwJoystickPresent</a>.</p>
|
||||||
|
<div class="fragment"><div class="line"><span class="keywordtype">int</span> present = <a class="code hl_function" href="group__input.html#gaed0966cee139d815317f9ffcba64c9f1">glfwJoystickPresent</a>(<a class="code hl_define" href="group__joysticks.html#ga34a0443d059e9f22272cd4669073f73d">GLFW_JOYSTICK_1</a>);</div>
|
||||||
|
<div class="ttc" id="agroup__input_html_gaed0966cee139d815317f9ffcba64c9f1"><div class="ttname"><a href="group__input.html#gaed0966cee139d815317f9ffcba64c9f1">glfwJoystickPresent</a></div><div class="ttdeci">int glfwJoystickPresent(int jid)</div><div class="ttdoc">Returns whether the specified joystick is present.</div></div>
|
||||||
|
<div class="ttc" id="agroup__joysticks_html_ga34a0443d059e9f22272cd4669073f73d"><div class="ttname"><a href="group__joysticks.html#ga34a0443d059e9f22272cd4669073f73d">GLFW_JOYSTICK_1</a></div><div class="ttdeci">#define GLFW_JOYSTICK_1</div><div class="ttdef"><b>Definition:</b> glfw3.h:592</div></div>
|
||||||
|
</div><!-- fragment --><p >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.</p>
|
||||||
|
<p >When GLFW is initialized, 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.</p>
|
||||||
|
<p >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 <a class="el" href="input_guide.html#joystick_event">joystick callback</a> then you must <a class="el" href="input_guide.html#events">process events</a>.</p>
|
||||||
|
<p >To see all the properties of all connected joysticks in real-time, run the <code>joysticks</code> test program.</p>
|
||||||
|
<h2><a class="anchor" id="joystick_axis"></a>
|
||||||
|
Joystick axis states</h2>
|
||||||
|
<p >The positions of all axes of a joystick are returned by <a class="el" href="group__input.html#gaeb1c0191d3140a233a682987c61eb408">glfwGetJoystickAxes</a>. See the reference documentation for the lifetime of the returned array.</p>
|
||||||
|
<div class="fragment"><div class="line"><span class="keywordtype">int</span> count;</div>
|
||||||
|
<div class="line"><span class="keyword">const</span> <span class="keywordtype">float</span>* axes = <a class="code hl_function" href="group__input.html#gaeb1c0191d3140a233a682987c61eb408">glfwGetJoystickAxes</a>(<a class="code hl_define" href="group__joysticks.html#gae43281bc66d3fa5089fb50c3e7a28695">GLFW_JOYSTICK_5</a>, &count);</div>
|
||||||
|
<div class="ttc" id="agroup__input_html_gaeb1c0191d3140a233a682987c61eb408"><div class="ttname"><a href="group__input.html#gaeb1c0191d3140a233a682987c61eb408">glfwGetJoystickAxes</a></div><div class="ttdeci">const float * glfwGetJoystickAxes(int jid, int *count)</div><div class="ttdoc">Returns the values of all axes of the specified joystick.</div></div>
|
||||||
|
<div class="ttc" id="agroup__joysticks_html_gae43281bc66d3fa5089fb50c3e7a28695"><div class="ttname"><a href="group__joysticks.html#gae43281bc66d3fa5089fb50c3e7a28695">GLFW_JOYSTICK_5</a></div><div class="ttdeci">#define GLFW_JOYSTICK_5</div><div class="ttdef"><b>Definition:</b> glfw3.h:596</div></div>
|
||||||
|
</div><!-- fragment --><p >Each element in the returned array is a value between -1.0 and 1.0.</p>
|
||||||
|
<h2><a class="anchor" id="joystick_button"></a>
|
||||||
|
Joystick button states</h2>
|
||||||
|
<p >The states of all buttons of a joystick are returned by <a class="el" href="group__input.html#ga5ffe34739d3dc97efe432ed2d81d9938">glfwGetJoystickButtons</a>. See the reference documentation for the lifetime of the returned array.</p>
|
||||||
|
<div class="fragment"><div class="line"><span class="keywordtype">int</span> count;</div>
|
||||||
|
<div class="line"><span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>* buttons = <a class="code hl_function" href="group__input.html#ga5ffe34739d3dc97efe432ed2d81d9938">glfwGetJoystickButtons</a>(<a class="code hl_define" href="group__joysticks.html#gae6f3eedfeb42424c2f5e3161efb0b654">GLFW_JOYSTICK_3</a>, &count);</div>
|
||||||
|
<div class="ttc" id="agroup__input_html_ga5ffe34739d3dc97efe432ed2d81d9938"><div class="ttname"><a href="group__input.html#ga5ffe34739d3dc97efe432ed2d81d9938">glfwGetJoystickButtons</a></div><div class="ttdeci">const unsigned char * glfwGetJoystickButtons(int jid, int *count)</div><div class="ttdoc">Returns the state of all buttons of the specified joystick.</div></div>
|
||||||
|
<div class="ttc" id="agroup__joysticks_html_gae6f3eedfeb42424c2f5e3161efb0b654"><div class="ttname"><a href="group__joysticks.html#gae6f3eedfeb42424c2f5e3161efb0b654">GLFW_JOYSTICK_3</a></div><div class="ttdeci">#define GLFW_JOYSTICK_3</div><div class="ttdef"><b>Definition:</b> glfw3.h:594</div></div>
|
||||||
|
</div><!-- fragment --><p >Each element in the returned array is either <code>GLFW_PRESS</code> or <code>GLFW_RELEASE</code>.</p>
|
||||||
|
<p >For backward compatibility with earlier versions that did not have <a class="el" href="group__input.html#ga06e660841b3e79c54da4f54a932c5a2c">glfwGetJoystickHats</a>, the button array by default also includes all hats. See the reference documentation for <a class="el" href="group__input.html#ga5ffe34739d3dc97efe432ed2d81d9938">glfwGetJoystickButtons</a> for details.</p>
|
||||||
|
<h2><a class="anchor" id="joystick_hat"></a>
|
||||||
|
Joystick hat states</h2>
|
||||||
|
<p >The states of all hats are returned by <a class="el" href="group__input.html#ga06e660841b3e79c54da4f54a932c5a2c">glfwGetJoystickHats</a>. See the reference documentation for the lifetime of the returned array.</p>
|
||||||
|
<div class="fragment"><div class="line"><span class="keywordtype">int</span> count;</div>
|
||||||
|
<div class="line"><span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>* hats = <a class="code hl_function" href="group__input.html#ga06e660841b3e79c54da4f54a932c5a2c">glfwGetJoystickHats</a>(<a class="code hl_define" href="group__joysticks.html#ga20a9f4f3aaefed9ea5e66072fc588b87">GLFW_JOYSTICK_7</a>, &count);</div>
|
||||||
|
<div class="ttc" id="agroup__input_html_ga06e660841b3e79c54da4f54a932c5a2c"><div class="ttname"><a href="group__input.html#ga06e660841b3e79c54da4f54a932c5a2c">glfwGetJoystickHats</a></div><div class="ttdeci">const unsigned char * glfwGetJoystickHats(int jid, int *count)</div><div class="ttdoc">Returns the state of all hats of the specified joystick.</div></div>
|
||||||
|
<div class="ttc" id="agroup__joysticks_html_ga20a9f4f3aaefed9ea5e66072fc588b87"><div class="ttname"><a href="group__joysticks.html#ga20a9f4f3aaefed9ea5e66072fc588b87">GLFW_JOYSTICK_7</a></div><div class="ttdeci">#define GLFW_JOYSTICK_7</div><div class="ttdef"><b>Definition:</b> glfw3.h:598</div></div>
|
||||||
|
</div><!-- fragment --><p >Each element in the returned array is one of the following:</p>
|
||||||
|
<table class="markdownTable">
|
||||||
|
<tr class="markdownTableHead">
|
||||||
|
<th class="markdownTableHeadNone">Name </th><th class="markdownTableHeadNone">Value </th></tr>
|
||||||
|
<tr class="markdownTableRowOdd">
|
||||||
|
<td class="markdownTableBodyNone"><code>GLFW_HAT_CENTERED</code> </td><td class="markdownTableBodyNone">0 </td></tr>
|
||||||
|
<tr class="markdownTableRowEven">
|
||||||
|
<td class="markdownTableBodyNone"><code>GLFW_HAT_UP</code> </td><td class="markdownTableBodyNone">1 </td></tr>
|
||||||
|
<tr class="markdownTableRowOdd">
|
||||||
|
<td class="markdownTableBodyNone"><code>GLFW_HAT_RIGHT</code> </td><td class="markdownTableBodyNone">2 </td></tr>
|
||||||
|
<tr class="markdownTableRowEven">
|
||||||
|
<td class="markdownTableBodyNone"><code>GLFW_HAT_DOWN</code> </td><td class="markdownTableBodyNone">4 </td></tr>
|
||||||
|
<tr class="markdownTableRowOdd">
|
||||||
|
<td class="markdownTableBodyNone"><code>GLFW_HAT_LEFT</code> </td><td class="markdownTableBodyNone">8 </td></tr>
|
||||||
|
<tr class="markdownTableRowEven">
|
||||||
|
<td class="markdownTableBodyNone"><code>GLFW_HAT_RIGHT_UP</code> </td><td class="markdownTableBodyNone"><code>GLFW_HAT_RIGHT</code> | <code>GLFW_HAT_UP</code> </td></tr>
|
||||||
|
<tr class="markdownTableRowOdd">
|
||||||
|
<td class="markdownTableBodyNone"><code>GLFW_HAT_RIGHT_DOWN</code> </td><td class="markdownTableBodyNone"><code>GLFW_HAT_RIGHT</code> | <code>GLFW_HAT_DOWN</code> </td></tr>
|
||||||
|
<tr class="markdownTableRowEven">
|
||||||
|
<td class="markdownTableBodyNone"><code>GLFW_HAT_LEFT_UP</code> </td><td class="markdownTableBodyNone"><code>GLFW_HAT_LEFT</code> | <code>GLFW_HAT_UP</code> </td></tr>
|
||||||
|
<tr class="markdownTableRowOdd">
|
||||||
|
<td class="markdownTableBodyNone"><code>GLFW_HAT_LEFT_DOWN</code> </td><td class="markdownTableBodyNone"><code>GLFW_HAT_LEFT</code> | <code>GLFW_HAT_DOWN</code> </td></tr>
|
||||||
|
</table>
|
||||||
|
<p >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.</p>
|
||||||
|
<div class="fragment"><div class="line"><span class="keywordflow">if</span> (hats[2] & <a class="code hl_define" href="group__hat__state.html#ga252586e3bbde75f4b0e07ad3124867f5">GLFW_HAT_RIGHT</a>)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> <span class="comment">// State of hat 2 could be right-up, right or right-down</span></div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="ttc" id="agroup__hat__state_html_ga252586e3bbde75f4b0e07ad3124867f5"><div class="ttname"><a href="group__hat__state.html#ga252586e3bbde75f4b0e07ad3124867f5">GLFW_HAT_RIGHT</a></div><div class="ttdeci">#define GLFW_HAT_RIGHT</div><div class="ttdef"><b>Definition:</b> glfw3.h:357</div></div>
|
||||||
|
</div><!-- fragment --><p >For backward compatibility with earlier versions that did not have <a class="el" href="group__input.html#ga06e660841b3e79c54da4f54a932c5a2c">glfwGetJoystickHats</a>, all hats are by default also included in the button array. See the reference documentation for <a class="el" href="group__input.html#ga5ffe34739d3dc97efe432ed2d81d9938">glfwGetJoystickButtons</a> for details.</p>
|
||||||
|
<h2><a class="anchor" id="joystick_name"></a>
|
||||||
|
Joystick name</h2>
|
||||||
|
<p >The human-readable, UTF-8 encoded name of a joystick is returned by <a class="el" href="group__input.html#gac6a8e769e18e0bcfa9097793fc2c3978">glfwGetJoystickName</a>. See the reference documentation for the lifetime of the returned string.</p>
|
||||||
|
<div class="fragment"><div class="line"><span class="keyword">const</span> <span class="keywordtype">char</span>* name = <a class="code hl_function" href="group__input.html#gac6a8e769e18e0bcfa9097793fc2c3978">glfwGetJoystickName</a>(<a class="code hl_define" href="group__joysticks.html#ga97ddbcad02b7f48d74fad4ddb08fff59">GLFW_JOYSTICK_4</a>);</div>
|
||||||
|
<div class="ttc" id="agroup__input_html_gac6a8e769e18e0bcfa9097793fc2c3978"><div class="ttname"><a href="group__input.html#gac6a8e769e18e0bcfa9097793fc2c3978">glfwGetJoystickName</a></div><div class="ttdeci">const char * glfwGetJoystickName(int jid)</div><div class="ttdoc">Returns the name of the specified joystick.</div></div>
|
||||||
|
<div class="ttc" id="agroup__joysticks_html_ga97ddbcad02b7f48d74fad4ddb08fff59"><div class="ttname"><a href="group__joysticks.html#ga97ddbcad02b7f48d74fad4ddb08fff59">GLFW_JOYSTICK_4</a></div><div class="ttdeci">#define GLFW_JOYSTICK_4</div><div class="ttdef"><b>Definition:</b> glfw3.h:595</div></div>
|
||||||
|
</div><!-- fragment --><p >Joystick names are not guaranteed to be unique. Two joysticks of the same model and make may have the same name. Only the <a class="el" href="group__joysticks.html">joystick ID</a> is guaranteed to be unique, and only until that joystick is disconnected.</p>
|
||||||
|
<h2><a class="anchor" id="joystick_userptr"></a>
|
||||||
|
Joystick user pointer</h2>
|
||||||
|
<p >Each joystick has a user pointer that can be set with <a class="el" href="group__input.html#ga6b2f72d64d636b48a727b437cbb7489e">glfwSetJoystickUserPointer</a> and queried with <a class="el" href="group__input.html#ga18cefd7265d1fa04f3fd38a6746db5f3">glfwGetJoystickUserPointer</a>. 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.</p>
|
||||||
|
<p >The initial value of the pointer is <code>NULL</code>.</p>
|
||||||
|
<h2><a class="anchor" id="joystick_event"></a>
|
||||||
|
Joystick configuration changes</h2>
|
||||||
|
<p >If you wish to be notified when a joystick is connected or disconnected, set a joystick callback.</p>
|
||||||
|
<div class="fragment"><div class="line"><a class="code hl_function" href="group__input.html#ga2f60a0e5b7bd8d1b7344dc0a7cb32b4c">glfwSetJoystickCallback</a>(joystick_callback);</div>
|
||||||
|
<div class="ttc" id="agroup__input_html_ga2f60a0e5b7bd8d1b7344dc0a7cb32b4c"><div class="ttname"><a href="group__input.html#ga2f60a0e5b7bd8d1b7344dc0a7cb32b4c">glfwSetJoystickCallback</a></div><div class="ttdeci">GLFWjoystickfun glfwSetJoystickCallback(GLFWjoystickfun callback)</div><div class="ttdoc">Sets the joystick configuration callback.</div></div>
|
||||||
|
</div><!-- fragment --><p >The callback function receives the ID of the joystick that has been connected and disconnected and the event that occurred.</p>
|
||||||
|
<div class="fragment"><div class="line"><span class="keywordtype">void</span> joystick_callback(<span class="keywordtype">int</span> jid, <span class="keywordtype">int</span> event)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> <span class="keywordflow">if</span> (event == <a class="code hl_define" href="glfw3_8h.html#abe11513fd1ffbee5bb9b173f06028b9e">GLFW_CONNECTED</a>)</div>
|
||||||
|
<div class="line"> {</div>
|
||||||
|
<div class="line"> <span class="comment">// The joystick was connected</span></div>
|
||||||
|
<div class="line"> }</div>
|
||||||
|
<div class="line"> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (event == <a class="code hl_define" href="glfw3_8h.html#aab64b25921ef21d89252d6f0a71bfc32">GLFW_DISCONNECTED</a>)</div>
|
||||||
|
<div class="line"> {</div>
|
||||||
|
<div class="line"> <span class="comment">// The joystick was disconnected</span></div>
|
||||||
|
<div class="line"> }</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="ttc" id="aglfw3_8h_html_aab64b25921ef21d89252d6f0a71bfc32"><div class="ttname"><a href="glfw3_8h.html#aab64b25921ef21d89252d6f0a71bfc32">GLFW_DISCONNECTED</a></div><div class="ttdeci">#define GLFW_DISCONNECTED</div><div class="ttdef"><b>Definition:</b> glfw3.h:1107</div></div>
|
||||||
|
<div class="ttc" id="aglfw3_8h_html_abe11513fd1ffbee5bb9b173f06028b9e"><div class="ttname"><a href="glfw3_8h.html#abe11513fd1ffbee5bb9b173f06028b9e">GLFW_CONNECTED</a></div><div class="ttdeci">#define GLFW_CONNECTED</div><div class="ttdef"><b>Definition:</b> glfw3.h:1106</div></div>
|
||||||
|
</div><!-- fragment --><p >For joystick connection and disconnection events to be delivered on all platforms, you need to call one of the <a class="el" href="input_guide.html#events">event processing</a> 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.</p>
|
||||||
|
<p >Only <a class="el" href="group__input.html#gac6a8e769e18e0bcfa9097793fc2c3978">glfwGetJoystickName</a> and <a class="el" href="group__input.html#ga18cefd7265d1fa04f3fd38a6746db5f3">glfwGetJoystickUserPointer</a> will return useful values for a disconnected joystick and only before the monitor callback returns.</p>
|
||||||
|
<h2><a class="anchor" id="gamepad"></a>
|
||||||
|
Gamepad input</h2>
|
||||||
|
<p >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.</p>
|
||||||
|
<p >To solve this problem the SDL community crowdsourced the <a href="https://github.com/gabomdq/SDL_GameControllerDB">SDL_GameControllerDB</a> project, a database of mappings from many different devices to an Xbox-like gamepad.</p>
|
||||||
|
<p >GLFW supports this mapping format and contains a copy of the mappings available at the time of release. See <a class="el" href="input_guide.html#gamepad_mapping">Gamepad mappings</a> 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.</p>
|
||||||
|
<p >You can check whether a joystick is both present and has a gamepad mapping with <a class="el" href="group__input.html#gad0f676860f329d80f7e47e9f06a96f00">glfwJoystickIsGamepad</a>.</p>
|
||||||
|
<div class="fragment"><div class="line"><span class="keywordflow">if</span> (<a class="code hl_function" href="group__input.html#gad0f676860f329d80f7e47e9f06a96f00">glfwJoystickIsGamepad</a>(<a class="code hl_define" href="group__joysticks.html#ga6eab65ec88e65e0850ef8413504cb50c">GLFW_JOYSTICK_2</a>))</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> <span class="comment">// Use as gamepad</span></div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="ttc" id="agroup__input_html_gad0f676860f329d80f7e47e9f06a96f00"><div class="ttname"><a href="group__input.html#gad0f676860f329d80f7e47e9f06a96f00">glfwJoystickIsGamepad</a></div><div class="ttdeci">int glfwJoystickIsGamepad(int jid)</div><div class="ttdoc">Returns whether the specified joystick has a gamepad mapping.</div></div>
|
||||||
|
<div class="ttc" id="agroup__joysticks_html_ga6eab65ec88e65e0850ef8413504cb50c"><div class="ttname"><a href="group__joysticks.html#ga6eab65ec88e65e0850ef8413504cb50c">GLFW_JOYSTICK_2</a></div><div class="ttdeci">#define GLFW_JOYSTICK_2</div><div class="ttdef"><b>Definition:</b> glfw3.h:593</div></div>
|
||||||
|
</div><!-- fragment --><p >If you are only interested in gamepad input you can use this function instead of <a class="el" href="group__input.html#gaed0966cee139d815317f9ffcba64c9f1">glfwJoystickPresent</a>.</p>
|
||||||
|
<p >You can query the human-readable name provided by the gamepad mapping with <a class="el" href="group__input.html#ga8aea73a1a25cc6c0486a617019f56728">glfwGetGamepadName</a>. This may or may not be the same as the <a class="el" href="input_guide.html#joystick_name">joystick name</a>.</p>
|
||||||
|
<div class="fragment"><div class="line"><span class="keyword">const</span> <span class="keywordtype">char</span>* name = <a class="code hl_function" href="group__input.html#ga8aea73a1a25cc6c0486a617019f56728">glfwGetGamepadName</a>(<a class="code hl_define" href="group__joysticks.html#ga20a9f4f3aaefed9ea5e66072fc588b87">GLFW_JOYSTICK_7</a>);</div>
|
||||||
|
<div class="ttc" id="agroup__input_html_ga8aea73a1a25cc6c0486a617019f56728"><div class="ttname"><a href="group__input.html#ga8aea73a1a25cc6c0486a617019f56728">glfwGetGamepadName</a></div><div class="ttdeci">const char * glfwGetGamepadName(int jid)</div><div class="ttdoc">Returns the human-readable gamepad name for the specified joystick.</div></div>
|
||||||
|
</div><!-- fragment --><p >To retrieve the gamepad state of a joystick, call <a class="el" href="group__input.html#gadccddea8bce6113fa459de379ddaf051">glfwGetGamepadState</a>.</p>
|
||||||
|
<div class="fragment"><div class="line"><a class="code hl_struct" href="structGLFWgamepadstate.html">GLFWgamepadstate</a> state;</div>
|
||||||
|
<div class="line"> </div>
|
||||||
|
<div class="line"><span class="keywordflow">if</span> (<a class="code hl_function" href="group__input.html#gadccddea8bce6113fa459de379ddaf051">glfwGetGamepadState</a>(<a class="code hl_define" href="group__joysticks.html#gae6f3eedfeb42424c2f5e3161efb0b654">GLFW_JOYSTICK_3</a>, &state))</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> <span class="keywordflow">if</span> (state.<a class="code hl_variable" href="structGLFWgamepadstate.html#a27e9896b51c65df15fba2c7139bfdb9a">buttons</a>[<a class="code hl_define" href="group__gamepad__buttons.html#gae055a12fbf4b48b5954c8e1cd129b810">GLFW_GAMEPAD_BUTTON_A</a>])</div>
|
||||||
|
<div class="line"> {</div>
|
||||||
|
<div class="line"> input_jump();</div>
|
||||||
|
<div class="line"> }</div>
|
||||||
|
<div class="line"> </div>
|
||||||
|
<div class="line"> input_speed(state.<a class="code hl_variable" href="structGLFWgamepadstate.html#a8b2c8939b1d31458de5359998375c189">axes</a>[<a class="code hl_define" href="group__gamepad__axes.html#ga121a7d5d20589a423cd1634dd6ee6eab">GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER</a>]);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="ttc" id="agroup__gamepad__axes_html_ga121a7d5d20589a423cd1634dd6ee6eab"><div class="ttname"><a href="group__gamepad__axes.html#ga121a7d5d20589a423cd1634dd6ee6eab">GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER</a></div><div class="ttdeci">#define GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER</div><div class="ttdef"><b>Definition:</b> glfw3.h:653</div></div>
|
||||||
|
<div class="ttc" id="agroup__gamepad__buttons_html_gae055a12fbf4b48b5954c8e1cd129b810"><div class="ttname"><a href="group__gamepad__buttons.html#gae055a12fbf4b48b5954c8e1cd129b810">GLFW_GAMEPAD_BUTTON_A</a></div><div class="ttdeci">#define GLFW_GAMEPAD_BUTTON_A</div><div class="ttdef"><b>Definition:</b> glfw3.h:618</div></div>
|
||||||
|
<div class="ttc" id="agroup__input_html_gadccddea8bce6113fa459de379ddaf051"><div class="ttname"><a href="group__input.html#gadccddea8bce6113fa459de379ddaf051">glfwGetGamepadState</a></div><div class="ttdeci">int glfwGetGamepadState(int jid, GLFWgamepadstate *state)</div><div class="ttdoc">Retrieves the state of the specified joystick remapped as a gamepad.</div></div>
|
||||||
|
<div class="ttc" id="astructGLFWgamepadstate_html"><div class="ttname"><a href="structGLFWgamepadstate.html">GLFWgamepadstate</a></div><div class="ttdoc">Gamepad input state.</div><div class="ttdef"><b>Definition:</b> glfw3.h:1745</div></div>
|
||||||
|
<div class="ttc" id="astructGLFWgamepadstate_html_a27e9896b51c65df15fba2c7139bfdb9a"><div class="ttname"><a href="structGLFWgamepadstate.html#a27e9896b51c65df15fba2c7139bfdb9a">GLFWgamepadstate::buttons</a></div><div class="ttdeci">unsigned char buttons[15]</div><div class="ttdef"><b>Definition:</b> glfw3.h:1749</div></div>
|
||||||
|
<div class="ttc" id="astructGLFWgamepadstate_html_a8b2c8939b1d31458de5359998375c189"><div class="ttname"><a href="structGLFWgamepadstate.html#a8b2c8939b1d31458de5359998375c189">GLFWgamepadstate::axes</a></div><div class="ttdeci">float axes[6]</div><div class="ttdef"><b>Definition:</b> glfw3.h:1753</div></div>
|
||||||
|
</div><!-- fragment --><p >The <a class="el" href="structGLFWgamepadstate.html">GLFWgamepadstate</a> 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 <a class="el" href="group__input.html#ga5ffe34739d3dc97efe432ed2d81d9938">glfwGetJoystickButtons</a> and <a class="el" href="group__input.html#gaeb1c0191d3140a233a682987c61eb408">glfwGetJoystickAxes</a> functions, i.e. <code>GLFW_PRESS</code> or <code>GLFW_RELEASE</code> for buttons and -1.0 to 1.0 inclusive for axes.</p>
|
||||||
|
<p >The sizes of the arrays and the positions within each array are fixed.</p>
|
||||||
|
<p >The <a class="el" href="group__gamepad__buttons.html">button indices</a> are <code>GLFW_GAMEPAD_BUTTON_A</code>, <code>GLFW_GAMEPAD_BUTTON_B</code>, <code>GLFW_GAMEPAD_BUTTON_X</code>, <code>GLFW_GAMEPAD_BUTTON_Y</code>, <code>GLFW_GAMEPAD_BUTTON_LEFT_BUMPER</code>, <code>GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER</code>, <code>GLFW_GAMEPAD_BUTTON_BACK</code>, <code>GLFW_GAMEPAD_BUTTON_START</code>, <code>GLFW_GAMEPAD_BUTTON_GUIDE</code>, <code>GLFW_GAMEPAD_BUTTON_LEFT_THUMB</code>, <code>GLFW_GAMEPAD_BUTTON_RIGHT_THUMB</code>, <code>GLFW_GAMEPAD_BUTTON_DPAD_UP</code>, <code>GLFW_GAMEPAD_BUTTON_DPAD_RIGHT</code>, <code>GLFW_GAMEPAD_BUTTON_DPAD_DOWN</code> and <code>GLFW_GAMEPAD_BUTTON_DPAD_LEFT</code>.</p>
|
||||||
|
<p >For those who prefer, there are also the <code>GLFW_GAMEPAD_BUTTON_CROSS</code>, <code>GLFW_GAMEPAD_BUTTON_CIRCLE</code>, <code>GLFW_GAMEPAD_BUTTON_SQUARE</code> and <code>GLFW_GAMEPAD_BUTTON_TRIANGLE</code> aliases for the A, B, X and Y button indices.</p>
|
||||||
|
<p >The <a class="el" href="group__gamepad__axes.html">axis indices</a> are <code>GLFW_GAMEPAD_AXIS_LEFT_X</code>, <code>GLFW_GAMEPAD_AXIS_LEFT_Y</code>, <code>GLFW_GAMEPAD_AXIS_RIGHT_X</code>, <code>GLFW_GAMEPAD_AXIS_RIGHT_Y</code>, <code>GLFW_GAMEPAD_AXIS_LEFT_TRIGGER</code> and <code>GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER</code>.</p>
|
||||||
|
<p >The <code>GLFW_GAMEPAD_BUTTON_LAST</code> and <code>GLFW_GAMEPAD_AXIS_LAST</code> constants equal the largest available index for each array.</p>
|
||||||
|
<h2><a class="anchor" id="gamepad_mapping"></a>
|
||||||
|
Gamepad mappings</h2>
|
||||||
|
<p >GLFW contains a copy of the mappings available in <a href="https://github.com/gabomdq/SDL_GameControllerDB">SDL_GameControllerDB</a> at the time of release. Newer ones can be added at runtime with <a class="el" href="group__input.html#gaed5104612f2fa8e66aa6e846652ad00f">glfwUpdateGamepadMappings</a>.</p>
|
||||||
|
<div class="fragment"><div class="line"><span class="keyword">const</span> <span class="keywordtype">char</span>* mappings = load_file_contents(<span class="stringliteral">"game/data/gamecontrollerdb.txt"</span>);</div>
|
||||||
|
<div class="line"> </div>
|
||||||
|
<div class="line"><a class="code hl_function" href="group__input.html#gaed5104612f2fa8e66aa6e846652ad00f">glfwUpdateGamepadMappings</a>(mappings);</div>
|
||||||
|
<div class="ttc" id="agroup__input_html_gaed5104612f2fa8e66aa6e846652ad00f"><div class="ttname"><a href="group__input.html#gaed5104612f2fa8e66aa6e846652ad00f">glfwUpdateGamepadMappings</a></div><div class="ttdeci">int glfwUpdateGamepadMappings(const char *string)</div><div class="ttdoc">Adds the specified SDL_GameControllerDB gamepad mappings.</div></div>
|
||||||
|
</div><!-- fragment --><p >This function supports everything from single lines up to and including the unmodified contents of the whole <code>gamecontrollerdb.txt</code> file.</p>
|
||||||
|
<p >If you are compiling GLFW from source with CMake you can update the built-in mappings by building the <em>update_mappings</em> target. This runs the <code>GenerateMappings.cmake</code> CMake script, which downloads <code>gamecontrollerdb.txt</code> and regenerates the <code>mappings.h</code> header file.</p>
|
||||||
|
<p >Below is a description of the mapping format. Please keep in mind that <b>this description is not authoritative</b>. The format is defined by the SDL and SDL_GameControllerDB projects and their documentation and code takes precedence.</p>
|
||||||
|
<p >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.</p>
|
||||||
|
<p >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.</p>
|
||||||
|
<p >The second value is always the human-readable name of the gamepad.</p>
|
||||||
|
<p >All subsequent values are in the form <code><field>:<value></code> and describe the layout of the mapping. These fields may not all be present and may occur in any order.</p>
|
||||||
|
<p >The button fields are <code>a</code>, <code>b</code>, <code>x</code>, <code>y</code>, <code>back</code>, <code>start</code>, <code>guide</code>, <code>dpup</code>, <code>dpright</code>, <code>dpdown</code>, <code>dpleft</code>, <code>leftshoulder</code>, <code>rightshoulder</code>, <code>leftstick</code> and <code>rightstick</code>.</p>
|
||||||
|
<p >The axis fields are <code>leftx</code>, <code>lefty</code>, <code>rightx</code>, <code>righty</code>, <code>lefttrigger</code> and <code>righttrigger</code>.</p>
|
||||||
|
<p >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 <code>bN</code>, for example <code>b2</code> for the third button. Joystick axes are specified as <code>aN</code>, for example <code>a7</code> for the eighth button. Joystick hat bit masks are specified as <code>hN.N</code>, for example <code>h0.8</code> for left on the first hat. More than one bit may be set in the mask.</p>
|
||||||
|
<p >Before an axis there may be a <code>+</code> or <code>-</code> range modifier, for example <code>+a3</code> 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 <code>~</code> inversion modifier, for example <code>a2~</code> or <code>-a7~</code>. This negates the values of the gamepad axis.</p>
|
||||||
|
<p >The hat bit mask match the <a class="el" href="group__hat__state.html">hat states</a> in the joystick functions.</p>
|
||||||
|
<p >There is also the special <code>platform</code> field that specifies which platform the mapping is valid for. Possible values are <code>Windows</code>, <code>Mac OS X</code> and <code>Linux</code>.</p>
|
||||||
|
<p >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.</p>
|
||||||
|
<div class="fragment"><div class="line">78696e70757401000000000000000000,XInput Gamepad (GLFW),platform:Windows,a:b0,</div>
|
||||||
|
<div class="line">b:b1,x:b2,y:b3,leftshoulder:b4,rightshoulder:b5,back:b6,start:b7,leftstick:b8,</div>
|
||||||
|
<div class="line">rightstick:b9,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,</div>
|
||||||
|
<div class="line">righttrigger:a5,dpup:h0.1,dpright:h0.2,dpdown:h0.4,dpleft:h0.8,</div>
|
||||||
|
</div><!-- fragment --><dl class="section note"><dt>Note</dt><dd>GLFW does not yet support the output range and modifiers <code>+</code> and <code>-</code> that were recently added to SDL. The input modifiers <code>+</code>, <code>-</code> and <code>~</code> are supported and described above.</dd></dl>
|
||||||
|
<h1><a class="anchor" id="time"></a>
|
||||||
|
Time input</h1>
|
||||||
|
<p >GLFW provides high-resolution time input, in seconds, with <a class="el" href="group__input.html#gaa6cf4e7a77158a3b8fd00328b1720a4a">glfwGetTime</a>.</p>
|
||||||
|
<div class="fragment"><div class="line"><span class="keywordtype">double</span> seconds = <a class="code hl_function" href="group__input.html#gaa6cf4e7a77158a3b8fd00328b1720a4a">glfwGetTime</a>();</div>
|
||||||
|
<div class="ttc" id="agroup__input_html_gaa6cf4e7a77158a3b8fd00328b1720a4a"><div class="ttname"><a href="group__input.html#gaa6cf4e7a77158a3b8fd00328b1720a4a">glfwGetTime</a></div><div class="ttdeci">double glfwGetTime(void)</div><div class="ttdoc">Returns the GLFW time.</div></div>
|
||||||
|
</div><!-- fragment --><p >It returns the number of seconds since the library was initialized with <a class="el" href="group__init.html#ga317aac130a235ab08c6db0834907d85e">glfwInit</a>. The platform-specific time sources used typically have micro- or nanosecond resolution.</p>
|
||||||
|
<p >You can modify the base time with <a class="el" href="group__input.html#gaf59589ef6e8b8c8b5ad184b25afd4dc0">glfwSetTime</a>.</p>
|
||||||
|
<div class="fragment"><div class="line"><a class="code hl_function" href="group__input.html#gaf59589ef6e8b8c8b5ad184b25afd4dc0">glfwSetTime</a>(4.0);</div>
|
||||||
|
<div class="ttc" id="agroup__input_html_gaf59589ef6e8b8c8b5ad184b25afd4dc0"><div class="ttname"><a href="group__input.html#gaf59589ef6e8b8c8b5ad184b25afd4dc0">glfwSetTime</a></div><div class="ttdeci">void glfwSetTime(double time)</div><div class="ttdoc">Sets the GLFW time.</div></div>
|
||||||
|
</div><!-- fragment --><p >This sets the time to the specified time, in seconds, and it continues to count from there.</p>
|
||||||
|
<p >You can also access the raw timer used to implement the functions above, with <a class="el" href="group__input.html#ga09b2bd37d328e0b9456c7ec575cc26aa">glfwGetTimerValue</a>.</p>
|
||||||
|
<div class="fragment"><div class="line">uint64_t value = <a class="code hl_function" href="group__input.html#ga09b2bd37d328e0b9456c7ec575cc26aa">glfwGetTimerValue</a>();</div>
|
||||||
|
<div class="ttc" id="agroup__input_html_ga09b2bd37d328e0b9456c7ec575cc26aa"><div class="ttname"><a href="group__input.html#ga09b2bd37d328e0b9456c7ec575cc26aa">glfwGetTimerValue</a></div><div class="ttdeci">uint64_t glfwGetTimerValue(void)</div><div class="ttdoc">Returns the current value of the raw timer.</div></div>
|
||||||
|
</div><!-- fragment --><p >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 <a class="el" href="group__input.html#ga3289ee876572f6e91f06df3a24824443">glfwGetTimerFrequency</a>.</p>
|
||||||
|
<div class="fragment"><div class="line">uint64_t frequency = <a class="code hl_function" href="group__input.html#ga3289ee876572f6e91f06df3a24824443">glfwGetTimerFrequency</a>();</div>
|
||||||
|
<div class="ttc" id="agroup__input_html_ga3289ee876572f6e91f06df3a24824443"><div class="ttname"><a href="group__input.html#ga3289ee876572f6e91f06df3a24824443">glfwGetTimerFrequency</a></div><div class="ttdeci">uint64_t glfwGetTimerFrequency(void)</div><div class="ttdoc">Returns the frequency, in Hz, of the raw timer.</div></div>
|
||||||
|
</div><!-- fragment --><h1><a class="anchor" id="clipboard"></a>
|
||||||
|
Clipboard input and output</h1>
|
||||||
|
<p >If the system clipboard contains a UTF-8 encoded string or if it can be converted to one, you can retrieve it with <a class="el" href="group__input.html#ga71a5b20808ea92193d65c21b82580355">glfwGetClipboardString</a>. See the reference documentation for the lifetime of the returned string.</p>
|
||||||
|
<div class="fragment"><div class="line"><span class="keyword">const</span> <span class="keywordtype">char</span>* text = <a class="code hl_function" href="group__input.html#ga71a5b20808ea92193d65c21b82580355">glfwGetClipboardString</a>(NULL);</div>
|
||||||
|
<div class="line"><span class="keywordflow">if</span> (text)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> insert_text(text);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="ttc" id="agroup__input_html_ga71a5b20808ea92193d65c21b82580355"><div class="ttname"><a href="group__input.html#ga71a5b20808ea92193d65c21b82580355">glfwGetClipboardString</a></div><div class="ttdeci">const char * glfwGetClipboardString(GLFWwindow *window)</div><div class="ttdoc">Returns the contents of the clipboard as a string.</div></div>
|
||||||
|
</div><!-- fragment --><p >If the clipboard is empty or if its contents could not be converted, <code>NULL</code> is returned.</p>
|
||||||
|
<p >The contents of the system clipboard can be set to a UTF-8 encoded string with <a class="el" href="group__input.html#gaba1f022c5eb07dfac421df34cdcd31dd">glfwSetClipboardString</a>.</p>
|
||||||
|
<div class="fragment"><div class="line"><a class="code hl_function" href="group__input.html#gaba1f022c5eb07dfac421df34cdcd31dd">glfwSetClipboardString</a>(NULL, <span class="stringliteral">"A string with words in it"</span>);</div>
|
||||||
|
<div class="ttc" id="agroup__input_html_gaba1f022c5eb07dfac421df34cdcd31dd"><div class="ttname"><a href="group__input.html#gaba1f022c5eb07dfac421df34cdcd31dd">glfwSetClipboardString</a></div><div class="ttdeci">void glfwSetClipboardString(GLFWwindow *window, const char *string)</div><div class="ttdoc">Sets the clipboard to the specified string.</div></div>
|
||||||
|
</div><!-- fragment --><h1><a class="anchor" id="path_drop"></a>
|
||||||
|
Path drop input</h1>
|
||||||
|
<p >If you wish to receive the paths of files and/or directories dropped on a window, set a file drop callback.</p>
|
||||||
|
<div class="fragment"><div class="line"><a class="code hl_function" href="group__input.html#gab773f0ee0a07cff77a210cea40bc1f6b">glfwSetDropCallback</a>(window, drop_callback);</div>
|
||||||
|
<div class="ttc" id="agroup__input_html_gab773f0ee0a07cff77a210cea40bc1f6b"><div class="ttname"><a href="group__input.html#gab773f0ee0a07cff77a210cea40bc1f6b">glfwSetDropCallback</a></div><div class="ttdeci">GLFWdropfun glfwSetDropCallback(GLFWwindow *window, GLFWdropfun callback)</div><div class="ttdoc">Sets the path drop callback.</div></div>
|
||||||
|
</div><!-- fragment --><p >The callback function receives an array of paths encoded as UTF-8.</p>
|
||||||
|
<div class="fragment"><div class="line"><span class="keywordtype">void</span> drop_callback(<a class="code hl_typedef" href="group__window.html#ga3c96d80d363e67d13a41b5d1821f3242">GLFWwindow</a>* window, <span class="keywordtype">int</span> count, <span class="keyword">const</span> <span class="keywordtype">char</span>** paths)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> <span class="keywordtype">int</span> i;</div>
|
||||||
|
<div class="line"> <span class="keywordflow">for</span> (i = 0; i < count; i++)</div>
|
||||||
|
<div class="line"> handle_dropped_file(paths[i]);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
</div><!-- fragment --><p >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. </p>
|
||||||
|
</div></div><!-- contents -->
|
||||||
|
</div><!-- PageDoc -->
|
||||||
|
<address class="footer">
|
||||||
|
<p>
|
||||||
|
Last update on Fri Jul 22 2022 for GLFW 3.3.8
|
||||||
|
</p>
|
||||||
|
</address>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,74 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.9.4"/>
|
||||||
|
<title>GLFW: internal.dox File Reference</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="extra.css" rel="stylesheet" type="text/css"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<div class="glfwheader">
|
||||||
|
<a href="https://www.glfw.org/" id="glfwhome">GLFW</a>
|
||||||
|
<ul class="glfwnavbar">
|
||||||
|
<li><a href="https://www.glfw.org/documentation.html">Documentation</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/download.html">Download</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/community.html">Community</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.9.4 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src="menudata.js"></script>
|
||||||
|
<script type="text/javascript" src="menu.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
$(function() {
|
||||||
|
initMenu('',true,false,'search.php','Search');
|
||||||
|
$(document).ready(function() { init_search(); });
|
||||||
|
});
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<div id="main-nav"></div>
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div><!-- top -->
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle"><div class="title">internal.dox File Reference</div></div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
</div><!-- contents -->
|
||||||
|
<address class="footer">
|
||||||
|
<p>
|
||||||
|
Last update on Fri Jul 22 2022 for GLFW 3.3.8
|
||||||
|
</p>
|
||||||
|
</address>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,125 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.9.4"/>
|
||||||
|
<title>GLFW: Internal structure</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="extra.css" rel="stylesheet" type="text/css"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<div class="glfwheader">
|
||||||
|
<a href="https://www.glfw.org/" id="glfwhome">GLFW</a>
|
||||||
|
<ul class="glfwnavbar">
|
||||||
|
<li><a href="https://www.glfw.org/documentation.html">Documentation</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/download.html">Download</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/community.html">Community</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.9.4 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src="menudata.js"></script>
|
||||||
|
<script type="text/javascript" src="menu.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
$(function() {
|
||||||
|
initMenu('',true,false,'search.php','Search');
|
||||||
|
$(document).ready(function() { init_search(); });
|
||||||
|
});
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<div id="main-nav"></div>
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div><!-- top -->
|
||||||
|
<div><div class="header">
|
||||||
|
<div class="headertitle"><div class="title">Internal structure </div></div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<div class="toc"><h3>Table of Contents</h3>
|
||||||
|
<ul><li class="level1"><a href="#internals_public">Public interface</a></li>
|
||||||
|
<li class="level1"><a href="#internals_native">Native interface</a></li>
|
||||||
|
<li class="level1"><a href="#internals_internal">Internal interface</a></li>
|
||||||
|
<li class="level1"><a href="#internals_platform">Platform interface</a></li>
|
||||||
|
<li class="level1"><a href="#internals_event">Event interface</a></li>
|
||||||
|
<li class="level1"><a href="#internals_static">Static functions</a></li>
|
||||||
|
<li class="level1"><a href="#internals_config">Configuration macros</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="textblock"><p >There are several interfaces inside GLFW. Each interface has its own area of responsibility and its own naming conventions.</p>
|
||||||
|
<h1><a class="anchor" id="internals_public"></a>
|
||||||
|
Public interface</h1>
|
||||||
|
<p >The most well-known is the public interface, described in the <a class="el" href="glfw3_8h.html" title="The header of the GLFW 3 API.">glfw3.h</a> 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.</p>
|
||||||
|
<p >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.</p>
|
||||||
|
<p >Examples: <code>glfwCreateWindow</code>, <code>GLFWwindow</code>, <code>GLFW_RED_BITS</code></p>
|
||||||
|
<h1><a class="anchor" id="internals_native"></a>
|
||||||
|
Native interface</h1>
|
||||||
|
<p >The <a class="el" href="group__native.html">native interface</a> is a small set of publicly available but platform-specific functions, described in the <a class="el" href="glfw3native_8h.html" title="The header of the native access functions.">glfw3native.h</a> header file and used to gain access to the underlying window, context and (on some platforms) display handles used by the platform interface.</p>
|
||||||
|
<p >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.</p>
|
||||||
|
<p >Examples: <code>glfwGetX11Window</code>, <code>glfwGetWGLContext</code></p>
|
||||||
|
<h1><a class="anchor" id="internals_internal"></a>
|
||||||
|
Internal interface</h1>
|
||||||
|
<p >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.</p>
|
||||||
|
<p >The internal interface is in charge of GLFW's global data, which it stores in a <code>_GLFWlibrary</code> struct named <code>_glfw</code>.</p>
|
||||||
|
<p >The internal interface uses the same style as the public interface, except all global names have a leading underscore.</p>
|
||||||
|
<p >Examples: <code>_glfwIsValidContextConfig</code>, <code>_GLFWwindow</code>, <code>_glfw.monitorCount</code></p>
|
||||||
|
<h1><a class="anchor" id="internals_platform"></a>
|
||||||
|
Platform interface</h1>
|
||||||
|
<p >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.</p>
|
||||||
|
<p >The platform interface mirrors those parts of the public interface that needs to perform platform-specific operations on some or all platforms. The are also named the same except that the glfw function prefix is replaced by _glfwPlatform.</p>
|
||||||
|
<p >Examples: <code>_glfwPlatformCreateWindow</code></p>
|
||||||
|
<p >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.</p>
|
||||||
|
<p >Examples: <code>_GLFWwindowX11</code>, <code>_GLFWcontextWGL</code></p>
|
||||||
|
<p >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.</p>
|
||||||
|
<p >Examples: <code>window->win32.handle</code>, <code>_glfw.x11.display</code></p>
|
||||||
|
<h1><a class="anchor" id="internals_event"></a>
|
||||||
|
Event interface</h1>
|
||||||
|
<p >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.</p>
|
||||||
|
<p >The function names of the event interface use a <code>_glfwInput</code> prefix and the ObjectEvent pattern.</p>
|
||||||
|
<p >Examples: <code>_glfwInputWindowFocus</code>, <code>_glfwInputCursorPos</code></p>
|
||||||
|
<h1><a class="anchor" id="internals_static"></a>
|
||||||
|
Static functions</h1>
|
||||||
|
<p >Static functions may be used by any interface and have no prefixes or suffixes. These use headless camel case.</p>
|
||||||
|
<p >Examples: <code>isValidElementForJoystick</code></p>
|
||||||
|
<h1><a class="anchor" id="internals_config"></a>
|
||||||
|
Configuration macros</h1>
|
||||||
|
<p >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_config.h header file, which is generated from the <code>glfw_config.h.in</code> file by CMake.</p>
|
||||||
|
<p >Configuration macros the same style as tokens in the public interface, except with a leading underscore.</p>
|
||||||
|
<p >Examples: <code>_GLFW_WIN32</code>, <code>_GLFW_BUILD_DLL</code> </p>
|
||||||
|
</div></div><!-- contents -->
|
||||||
|
</div><!-- PageDoc -->
|
||||||
|
<address class="footer">
|
||||||
|
<p>
|
||||||
|
Last update on Fri Jul 22 2022 for GLFW 3.3.8
|
||||||
|
</p>
|
||||||
|
</address>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,74 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.9.4"/>
|
||||||
|
<title>GLFW: intro.dox File Reference</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="extra.css" rel="stylesheet" type="text/css"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<div class="glfwheader">
|
||||||
|
<a href="https://www.glfw.org/" id="glfwhome">GLFW</a>
|
||||||
|
<ul class="glfwnavbar">
|
||||||
|
<li><a href="https://www.glfw.org/documentation.html">Documentation</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/download.html">Download</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/community.html">Community</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.9.4 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src="menudata.js"></script>
|
||||||
|
<script type="text/javascript" src="menu.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
$(function() {
|
||||||
|
initMenu('',true,false,'search.php','Search');
|
||||||
|
$(document).ready(function() { init_search(); });
|
||||||
|
});
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<div id="main-nav"></div>
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div><!-- top -->
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle"><div class="title">intro.dox File Reference</div></div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
</div><!-- contents -->
|
||||||
|
<address class="footer">
|
||||||
|
<p>
|
||||||
|
Last update on Fri Jul 22 2022 for GLFW 3.3.8
|
||||||
|
</p>
|
||||||
|
</address>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,329 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.9.4"/>
|
||||||
|
<title>GLFW: Introduction to the API</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="extra.css" rel="stylesheet" type="text/css"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<div class="glfwheader">
|
||||||
|
<a href="https://www.glfw.org/" id="glfwhome">GLFW</a>
|
||||||
|
<ul class="glfwnavbar">
|
||||||
|
<li><a href="https://www.glfw.org/documentation.html">Documentation</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/download.html">Download</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/community.html">Community</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.9.4 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src="menudata.js"></script>
|
||||||
|
<script type="text/javascript" src="menu.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
$(function() {
|
||||||
|
initMenu('',true,false,'search.php','Search');
|
||||||
|
$(document).ready(function() { init_search(); });
|
||||||
|
});
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<div id="main-nav"></div>
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div><!-- top -->
|
||||||
|
<div><div class="header">
|
||||||
|
<div class="headertitle"><div class="title">Introduction to the API </div></div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
<div class="toc"><h3>Table of Contents</h3>
|
||||||
|
<ul><li class="level1"><a href="#intro_init">Initialization and termination</a><ul><li class="level2"><a href="#intro_init_init">Initializing GLFW</a></li>
|
||||||
|
<li class="level2"><a href="#init_hints">Initialization hints</a><ul><li class="level3"><a href="#init_hints_shared">Shared init hints</a></li>
|
||||||
|
<li class="level3"><a href="#init_hints_osx">macOS specific init hints</a></li>
|
||||||
|
<li class="level3"><a href="#init_hints_values">Supported and default values</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li class="level2"><a href="#intro_init_terminate">Terminating GLFW</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li class="level1"><a href="#error_handling">Error handling</a></li>
|
||||||
|
<li class="level1"><a href="#coordinate_systems">Coordinate systems</a></li>
|
||||||
|
<li class="level1"><a href="#guarantees_limitations">Guarantees and limitations</a><ul><li class="level2"><a href="#lifetime">Pointer lifetimes</a></li>
|
||||||
|
<li class="level2"><a href="#reentrancy">Reentrancy</a></li>
|
||||||
|
<li class="level2"><a href="#thread_safety">Thread safety</a></li>
|
||||||
|
<li class="level2"><a href="#compatibility">Version compatibility</a></li>
|
||||||
|
<li class="level2"><a href="#event_order">Event order</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li class="level1"><a href="#intro_version">Version management</a><ul><li class="level2"><a href="#intro_version_compile">Compile-time version</a></li>
|
||||||
|
<li class="level2"><a href="#intro_version_runtime">Run-time version</a></li>
|
||||||
|
<li class="level2"><a href="#intro_version_string">Version string</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="textblock"><p >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 <a class="el" href="quick_guide.html">Getting started</a> instead. For details on a specific function in this category, see the <a class="el" href="group__init.html">Initialization, version and error reference</a>.</p>
|
||||||
|
<p >There are also guides for the other areas of GLFW.</p>
|
||||||
|
<ul>
|
||||||
|
<li><a class="el" href="window_guide.html">Window guide</a></li>
|
||||||
|
<li><a class="el" href="context_guide.html">Context guide</a></li>
|
||||||
|
<li><a class="el" href="vulkan_guide.html">Vulkan guide</a></li>
|
||||||
|
<li><a class="el" href="monitor_guide.html">Monitor guide</a></li>
|
||||||
|
<li><a class="el" href="input_guide.html">Input guide</a></li>
|
||||||
|
</ul>
|
||||||
|
<h1><a class="anchor" id="intro_init"></a>
|
||||||
|
Initialization and termination</h1>
|
||||||
|
<p >Before most GLFW functions may be called, the library must be initialized. This initialization checks what features are available on the machine, enumerates monitors and joysticks, initializes the timer and performs any required platform-specific initialization.</p>
|
||||||
|
<p >Only the following functions may be called before the library has been successfully initialized, and only from the main thread.</p>
|
||||||
|
<ul>
|
||||||
|
<li><a class="el" href="group__init.html#ga9f8ffaacf3c269cc48eafbf8b9b71197">glfwGetVersion</a></li>
|
||||||
|
<li><a class="el" href="group__init.html#ga026abd003c8e6501981ab1662062f1c0">glfwGetVersionString</a></li>
|
||||||
|
<li><a class="el" href="group__init.html#ga944986b4ec0b928d488141f92982aa18">glfwGetError</a></li>
|
||||||
|
<li><a class="el" href="group__init.html#gaff45816610d53f0b83656092a4034f40">glfwSetErrorCallback</a></li>
|
||||||
|
<li><a class="el" href="group__init.html#ga110fd1d3f0412822b4f1908c026f724a">glfwInitHint</a></li>
|
||||||
|
<li><a class="el" href="group__init.html#ga317aac130a235ab08c6db0834907d85e">glfwInit</a></li>
|
||||||
|
<li><a class="el" href="group__init.html#gaaae48c0a18607ea4a4ba951d939f0901">glfwTerminate</a></li>
|
||||||
|
</ul>
|
||||||
|
<p >Calling any other function before successful initialization will cause a <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a> error.</p>
|
||||||
|
<h2><a class="anchor" id="intro_init_init"></a>
|
||||||
|
Initializing GLFW</h2>
|
||||||
|
<p >The library is initialized with <a class="el" href="group__init.html#ga317aac130a235ab08c6db0834907d85e">glfwInit</a>, which returns <code>GLFW_FALSE</code> if an error occurred.</p>
|
||||||
|
<div class="fragment"><div class="line"><span class="keywordflow">if</span> (!<a class="code hl_function" href="group__init.html#ga317aac130a235ab08c6db0834907d85e">glfwInit</a>())</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> <span class="comment">// Handle initialization failure</span></div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
<div class="ttc" id="agroup__init_html_ga317aac130a235ab08c6db0834907d85e"><div class="ttname"><a href="group__init.html#ga317aac130a235ab08c6db0834907d85e">glfwInit</a></div><div class="ttdeci">int glfwInit(void)</div><div class="ttdoc">Initializes the GLFW library.</div></div>
|
||||||
|
</div><!-- fragment --><p >If any part of initialization fails, any parts that succeeded are terminated as if <a class="el" href="group__init.html#gaaae48c0a18607ea4a4ba951d939f0901">glfwTerminate</a> had been called. The library only needs to be initialized once and additional calls to an already initialized library will return <code>GLFW_TRUE</code> immediately.</p>
|
||||||
|
<p >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.</p>
|
||||||
|
<h2><a class="anchor" id="init_hints"></a>
|
||||||
|
Initialization hints</h2>
|
||||||
|
<p >Initialization hints are set before <a class="el" href="group__init.html#ga317aac130a235ab08c6db0834907d85e">glfwInit</a> and affect how the library behaves until termination. Hints are set with <a class="el" href="group__init.html#ga110fd1d3f0412822b4f1908c026f724a">glfwInitHint</a>.</p>
|
||||||
|
<div class="fragment"><div class="line"><a class="code hl_function" href="group__init.html#ga110fd1d3f0412822b4f1908c026f724a">glfwInitHint</a>(<a class="code hl_define" href="group__init.html#gab9c0534709fda03ec8959201da3a9a18">GLFW_JOYSTICK_HAT_BUTTONS</a>, <a class="code hl_define" href="group__init.html#gac877fe3b627d21ef3a0a23e0a73ba8c5">GLFW_FALSE</a>);</div>
|
||||||
|
<div class="ttc" id="agroup__init_html_ga110fd1d3f0412822b4f1908c026f724a"><div class="ttname"><a href="group__init.html#ga110fd1d3f0412822b4f1908c026f724a">glfwInitHint</a></div><div class="ttdeci">void glfwInitHint(int hint, int value)</div><div class="ttdoc">Sets the specified init hint to the desired value.</div></div>
|
||||||
|
<div class="ttc" id="agroup__init_html_gab9c0534709fda03ec8959201da3a9a18"><div class="ttname"><a href="group__init.html#gab9c0534709fda03ec8959201da3a9a18">GLFW_JOYSTICK_HAT_BUTTONS</a></div><div class="ttdeci">#define GLFW_JOYSTICK_HAT_BUTTONS</div><div class="ttdoc">Joystick hat buttons init hint.</div><div class="ttdef"><b>Definition:</b> glfw3.h:1115</div></div>
|
||||||
|
<div class="ttc" id="agroup__init_html_gac877fe3b627d21ef3a0a23e0a73ba8c5"><div class="ttname"><a href="group__init.html#gac877fe3b627d21ef3a0a23e0a73ba8c5">GLFW_FALSE</a></div><div class="ttdeci">#define GLFW_FALSE</div><div class="ttdoc">Zero.</div><div class="ttdef"><b>Definition:</b> glfw3.h:321</div></div>
|
||||||
|
</div><!-- fragment --><p >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.</p>
|
||||||
|
<p >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.</p>
|
||||||
|
<h3><a class="anchor" id="init_hints_shared"></a>
|
||||||
|
Shared init hints</h3>
|
||||||
|
<p ><a class="anchor" id="GLFW_JOYSTICK_HAT_BUTTONS"></a><b>GLFW_JOYSTICK_HAT_BUTTONS</b> specifies whether to also expose joystick hats as buttons, for compatibility with earlier versions of GLFW that did not have <a class="el" href="group__input.html#ga06e660841b3e79c54da4f54a932c5a2c">glfwGetJoystickHats</a>. Possible values are <code>GLFW_TRUE</code> and <code>GLFW_FALSE</code>.</p>
|
||||||
|
<h3><a class="anchor" id="init_hints_osx"></a>
|
||||||
|
macOS specific init hints</h3>
|
||||||
|
<p ><a class="anchor" id="GLFW_COCOA_CHDIR_RESOURCES_hint"></a><b>GLFW_COCOA_CHDIR_RESOURCES</b> specifies whether to set the current directory to the application to the <code>Contents/Resources</code> subdirectory of the application's bundle, if present. Set this with <a class="el" href="group__init.html#ga110fd1d3f0412822b4f1908c026f724a">glfwInitHint</a>.</p>
|
||||||
|
<p ><a class="anchor" id="GLFW_COCOA_MENUBAR_hint"></a><b>GLFW_COCOA_MENUBAR</b> specifies whether to create a basic menu bar, either from a nib or manually, when the first window is created, which is when AppKit is initialized. Set this with <a class="el" href="group__init.html#ga110fd1d3f0412822b4f1908c026f724a">glfwInitHint</a>.</p>
|
||||||
|
<h3><a class="anchor" id="init_hints_values"></a>
|
||||||
|
Supported and default values</h3>
|
||||||
|
<table class="markdownTable">
|
||||||
|
<tr class="markdownTableHead">
|
||||||
|
<th class="markdownTableHeadNone">Initialization hint </th><th class="markdownTableHeadNone">Default value </th><th class="markdownTableHeadNone">Supported values </th></tr>
|
||||||
|
<tr class="markdownTableRowOdd">
|
||||||
|
<td class="markdownTableBodyNone"><a class="el" href="intro_guide.html#GLFW_JOYSTICK_HAT_BUTTONS">GLFW_JOYSTICK_HAT_BUTTONS</a> </td><td class="markdownTableBodyNone"><code>GLFW_TRUE</code> </td><td class="markdownTableBodyNone"><code>GLFW_TRUE</code> or <code>GLFW_FALSE</code> </td></tr>
|
||||||
|
<tr class="markdownTableRowEven">
|
||||||
|
<td class="markdownTableBodyNone"><a class="el" href="group__init.html#gab937983147a3158d45f88fad7129d9f2">GLFW_COCOA_CHDIR_RESOURCES</a> </td><td class="markdownTableBodyNone"><code>GLFW_TRUE</code> </td><td class="markdownTableBodyNone"><code>GLFW_TRUE</code> or <code>GLFW_FALSE</code> </td></tr>
|
||||||
|
<tr class="markdownTableRowOdd">
|
||||||
|
<td class="markdownTableBodyNone"><a class="el" href="group__init.html#ga71e0b4ce2f2696a84a9b8c5e12dc70cf">GLFW_COCOA_MENUBAR</a> </td><td class="markdownTableBodyNone"><code>GLFW_TRUE</code> </td><td class="markdownTableBodyNone"><code>GLFW_TRUE</code> or <code>GLFW_FALSE</code> </td></tr>
|
||||||
|
</table>
|
||||||
|
<h2><a class="anchor" id="intro_init_terminate"></a>
|
||||||
|
Terminating GLFW</h2>
|
||||||
|
<p >Before your application exits, you should terminate the GLFW library if it has been initialized. This is done with <a class="el" href="group__init.html#gaaae48c0a18607ea4a4ba951d939f0901">glfwTerminate</a>.</p>
|
||||||
|
<div class="fragment"><div class="line"><a class="code hl_function" href="group__init.html#gaaae48c0a18607ea4a4ba951d939f0901">glfwTerminate</a>();</div>
|
||||||
|
<div class="ttc" id="agroup__init_html_gaaae48c0a18607ea4a4ba951d939f0901"><div class="ttname"><a href="group__init.html#gaaae48c0a18607ea4a4ba951d939f0901">glfwTerminate</a></div><div class="ttdeci">void glfwTerminate(void)</div><div class="ttdoc">Terminates the GLFW library.</div></div>
|
||||||
|
</div><!-- fragment --><p >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.</p>
|
||||||
|
<p >Once the library is terminated, it is as if it had never been initialized and 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 return immediately.</p>
|
||||||
|
<h1><a class="anchor" id="error_handling"></a>
|
||||||
|
Error handling</h1>
|
||||||
|
<p >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.</p>
|
||||||
|
<p >The last <a class="el" href="group__errors.html">error code</a> for the calling thread can be queried at any time with <a class="el" href="group__init.html#ga944986b4ec0b928d488141f92982aa18">glfwGetError</a>.</p>
|
||||||
|
<div class="fragment"><div class="line"><span class="keywordtype">int</span> code = <a class="code hl_function" href="group__init.html#ga944986b4ec0b928d488141f92982aa18">glfwGetError</a>(NULL);</div>
|
||||||
|
<div class="line"> </div>
|
||||||
|
<div class="line"><span class="keywordflow">if</span> (code != <a class="code hl_define" href="group__errors.html#gafa30deee5db4d69c4c93d116ed87dbf4">GLFW_NO_ERROR</a>)</div>
|
||||||
|
<div class="line"> handle_error(code);</div>
|
||||||
|
<div class="ttc" id="agroup__errors_html_gafa30deee5db4d69c4c93d116ed87dbf4"><div class="ttname"><a href="group__errors.html#gafa30deee5db4d69c4c93d116ed87dbf4">GLFW_NO_ERROR</a></div><div class="ttdeci">#define GLFW_NO_ERROR</div><div class="ttdoc">No error has occurred.</div><div class="ttdef"><b>Definition:</b> glfw3.h:670</div></div>
|
||||||
|
<div class="ttc" id="agroup__init_html_ga944986b4ec0b928d488141f92982aa18"><div class="ttname"><a href="group__init.html#ga944986b4ec0b928d488141f92982aa18">glfwGetError</a></div><div class="ttdeci">int glfwGetError(const char **description)</div><div class="ttdoc">Returns and clears the last error for the calling thread.</div></div>
|
||||||
|
</div><!-- fragment --><p >If no error has occurred since the last call, <a class="el" href="group__errors.html#gafa30deee5db4d69c4c93d116ed87dbf4">GLFW_NO_ERROR</a> (zero) is returned. The error is cleared before the function returns.</p>
|
||||||
|
<p >The error code indicates the general category of the error. Some error codes, such as <a class="el" href="group__errors.html#ga2374ee02c177f12e1fa76ff3ed15e14a">GLFW_NOT_INITIALIZED</a> has only a single meaning, whereas others like <a class="el" href="group__errors.html#gad44162d78100ea5e87cdd38426b8c7a1">GLFW_PLATFORM_ERROR</a> are used for many different errors.</p>
|
||||||
|
<p >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 <code>NULL</code>.</p>
|
||||||
|
<div class="fragment"><div class="line"><span class="keyword">const</span> <span class="keywordtype">char</span>* description;</div>
|
||||||
|
<div class="line"><span class="keywordtype">int</span> code = <a class="code hl_function" href="group__init.html#ga944986b4ec0b928d488141f92982aa18">glfwGetError</a>(&description);</div>
|
||||||
|
<div class="line"> </div>
|
||||||
|
<div class="line"><span class="keywordflow">if</span> (description)</div>
|
||||||
|
<div class="line"> display_error_message(code, description);</div>
|
||||||
|
</div><!-- fragment --><p >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.</p>
|
||||||
|
<p >You can also set an error callback, which will be called each time an error occurs. It is set with <a class="el" href="group__init.html#gaff45816610d53f0b83656092a4034f40">glfwSetErrorCallback</a>.</p>
|
||||||
|
<div class="fragment"><div class="line"><a class="code hl_function" href="group__init.html#gaff45816610d53f0b83656092a4034f40">glfwSetErrorCallback</a>(error_callback);</div>
|
||||||
|
<div class="ttc" id="agroup__init_html_gaff45816610d53f0b83656092a4034f40"><div class="ttname"><a href="group__init.html#gaff45816610d53f0b83656092a4034f40">glfwSetErrorCallback</a></div><div class="ttdeci">GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun callback)</div><div class="ttdoc">Sets the error callback.</div></div>
|
||||||
|
</div><!-- fragment --><p >The error callback receives the same error code and human-readable description returned by <a class="el" href="group__init.html#ga944986b4ec0b928d488141f92982aa18">glfwGetError</a>.</p>
|
||||||
|
<div class="fragment"><div class="line"><span class="keywordtype">void</span> error_callback(<span class="keywordtype">int</span> code, <span class="keyword">const</span> <span class="keywordtype">char</span>* description)</div>
|
||||||
|
<div class="line">{</div>
|
||||||
|
<div class="line"> display_error_message(code, description);</div>
|
||||||
|
<div class="line">}</div>
|
||||||
|
</div><!-- fragment --><p >The error callback is called after the error is stored, so calling <a class="el" href="group__init.html#ga944986b4ec0b928d488141f92982aa18">glfwGetError</a> from within the error callback returns the same values as the callback argument.</p>
|
||||||
|
<p >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.</p>
|
||||||
|
<p ><b>Reported errors are never fatal.</b> 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 <a class="el" href="group__init.html#ga317aac130a235ab08c6db0834907d85e">glfwInit</a> to fail, any part of the library that was initialized will be safely terminated.</p>
|
||||||
|
<p >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.</p>
|
||||||
|
<h1><a class="anchor" id="coordinate_systems"></a>
|
||||||
|
Coordinate systems</h1>
|
||||||
|
<p >GLFW has two primary coordinate systems: the <em>virtual screen</em> and the window <em>content area</em> or <em>content area</em>. Both use the same unit: <em>virtual screen coordinates</em>, or just <em>screen coordinates</em>, which don't necessarily correspond to pixels.</p>
|
||||||
|
<p ><img src="spaces.svg" alt="" style="pointer-events: none;" width="90%" class="inline"/></p>
|
||||||
|
<p >Both the virtual screen and the content area coordinate systems have the X-axis pointing to the right and the Y-axis pointing down.</p>
|
||||||
|
<p >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.</p>
|
||||||
|
<p >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.</p>
|
||||||
|
<p >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.</p>
|
||||||
|
<p >Two exceptions are the <a class="el" href="monitor_guide.html#monitor_size">monitor physical size</a>, which is measured in millimetres, and <a class="el" href="window_guide.html#window_fbsize">framebuffer size</a>, which is measured in pixels.</p>
|
||||||
|
<p >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.</p>
|
||||||
|
<h1><a class="anchor" id="guarantees_limitations"></a>
|
||||||
|
Guarantees and limitations</h1>
|
||||||
|
<p >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 of 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.</p>
|
||||||
|
<h2><a class="anchor" id="lifetime"></a>
|
||||||
|
Pointer lifetimes</h2>
|
||||||
|
<p >GLFW will never free any pointer you provide to it and you must never free any pointer it provides to you.</p>
|
||||||
|
<p >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.</p>
|
||||||
|
<p >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.</p>
|
||||||
|
<p >Pointer lifetimes are guaranteed not to be shortened in future minor or patch releases.</p>
|
||||||
|
<h2><a class="anchor" id="reentrancy"></a>
|
||||||
|
Reentrancy</h2>
|
||||||
|
<p >GLFW event processing and object destruction are not reentrant. This means that the following functions must not be called from any callback function:</p>
|
||||||
|
<ul>
|
||||||
|
<li><a class="el" href="group__window.html#gacdf43e51376051d2c091662e9fe3d7b2">glfwDestroyWindow</a></li>
|
||||||
|
<li><a class="el" href="group__input.html#ga81b952cd1764274d0db7fb3c5a79ba6a">glfwDestroyCursor</a></li>
|
||||||
|
<li><a class="el" href="group__window.html#ga37bd57223967b4211d60ca1a0bf3c832">glfwPollEvents</a></li>
|
||||||
|
<li><a class="el" href="group__window.html#ga554e37d781f0a997656c26b2c56c835e">glfwWaitEvents</a></li>
|
||||||
|
<li><a class="el" href="group__window.html#ga605a178db92f1a7f1a925563ef3ea2cf">glfwWaitEventsTimeout</a></li>
|
||||||
|
<li><a class="el" href="group__init.html#gaaae48c0a18607ea4a4ba951d939f0901">glfwTerminate</a></li>
|
||||||
|
</ul>
|
||||||
|
<p >These functions may be made reentrant in future minor or patch releases, but functions not on this list will not be made non-reentrant.</p>
|
||||||
|
<h2><a class="anchor" id="thread_safety"></a>
|
||||||
|
Thread safety</h2>
|
||||||
|
<p >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.</p>
|
||||||
|
<p >The reference documentation for every GLFW function states whether it is limited to the main thread.</p>
|
||||||
|
<p >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.</p>
|
||||||
|
<p >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.</p>
|
||||||
|
<p >The error code and description may be queried from any thread.</p>
|
||||||
|
<ul>
|
||||||
|
<li><a class="el" href="group__init.html#ga944986b4ec0b928d488141f92982aa18">glfwGetError</a></li>
|
||||||
|
</ul>
|
||||||
|
<p >Empty events may be posted from any thread.</p>
|
||||||
|
<ul>
|
||||||
|
<li><a class="el" href="group__window.html#gab5997a25187e9fd5c6f2ecbbc8dfd7e9">glfwPostEmptyEvent</a></li>
|
||||||
|
</ul>
|
||||||
|
<p >The window user pointer and close flag may be read and written from any thread, but this is not synchronized by GLFW.</p>
|
||||||
|
<ul>
|
||||||
|
<li><a class="el" href="group__window.html#gae77a4add0d2023ca21ff1443ced01653">glfwGetWindowUserPointer</a></li>
|
||||||
|
<li><a class="el" href="group__window.html#ga3d2fc6026e690ab31a13f78bc9fd3651">glfwSetWindowUserPointer</a></li>
|
||||||
|
<li><a class="el" href="group__window.html#ga24e02fbfefbb81fc45320989f8140ab5">glfwWindowShouldClose</a></li>
|
||||||
|
<li><a class="el" href="group__window.html#ga49c449dde2a6f87d996f4daaa09d6708">glfwSetWindowShouldClose</a></li>
|
||||||
|
</ul>
|
||||||
|
<p >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.</p>
|
||||||
|
<ul>
|
||||||
|
<li><a class="el" href="group__context.html#ga1c04dc242268f827290fe40aa1c91157">glfwMakeContextCurrent</a></li>
|
||||||
|
<li><a class="el" href="group__context.html#gad94e80185397a6cf5fe2ab30567af71c">glfwGetCurrentContext</a></li>
|
||||||
|
<li><a class="el" href="group__window.html#ga15a5a1ee5b3c2ca6b15ca209a12efd14">glfwSwapBuffers</a></li>
|
||||||
|
<li><a class="el" href="group__context.html#ga6d4e0cdf151b5e579bd67f13202994ed">glfwSwapInterval</a></li>
|
||||||
|
<li><a class="el" href="group__context.html#ga87425065c011cef1ebd6aac75e059dfa">glfwExtensionSupported</a></li>
|
||||||
|
<li><a class="el" href="group__context.html#ga35f1837e6f666781842483937612f163">glfwGetProcAddress</a></li>
|
||||||
|
</ul>
|
||||||
|
<p >The raw timer functions may be called from any thread.</p>
|
||||||
|
<ul>
|
||||||
|
<li><a class="el" href="group__input.html#ga3289ee876572f6e91f06df3a24824443">glfwGetTimerFrequency</a></li>
|
||||||
|
<li><a class="el" href="group__input.html#ga09b2bd37d328e0b9456c7ec575cc26aa">glfwGetTimerValue</a></li>
|
||||||
|
</ul>
|
||||||
|
<p >The regular timer may be used from any thread, but reading and writing the timer offset is not synchronized by GLFW.</p>
|
||||||
|
<ul>
|
||||||
|
<li><a class="el" href="group__input.html#gaa6cf4e7a77158a3b8fd00328b1720a4a">glfwGetTime</a></li>
|
||||||
|
<li><a class="el" href="group__input.html#gaf59589ef6e8b8c8b5ad184b25afd4dc0">glfwSetTime</a></li>
|
||||||
|
</ul>
|
||||||
|
<p >Library version information may be queried from any thread.</p>
|
||||||
|
<ul>
|
||||||
|
<li><a class="el" href="group__init.html#ga9f8ffaacf3c269cc48eafbf8b9b71197">glfwGetVersion</a></li>
|
||||||
|
<li><a class="el" href="group__init.html#ga026abd003c8e6501981ab1662062f1c0">glfwGetVersionString</a></li>
|
||||||
|
</ul>
|
||||||
|
<p >All Vulkan related functions may be called from any thread.</p>
|
||||||
|
<ul>
|
||||||
|
<li><a class="el" href="group__vulkan.html#ga2e7f30931e02464b5bc8d0d4b6f9fe2b">glfwVulkanSupported</a></li>
|
||||||
|
<li><a class="el" href="group__vulkan.html#ga99ad342d82f4a3421e2864978cb6d1d6">glfwGetRequiredInstanceExtensions</a></li>
|
||||||
|
<li><a class="el" href="group__vulkan.html#gadf228fac94c5fd8f12423ec9af9ff1e9">glfwGetInstanceProcAddress</a></li>
|
||||||
|
<li><a class="el" href="group__vulkan.html#gaff3823355cdd7e2f3f9f4d9ea9518d92">glfwGetPhysicalDevicePresentationSupport</a></li>
|
||||||
|
<li><a class="el" href="group__vulkan.html#ga1a24536bec3f80b08ead18e28e6ae965">glfwCreateWindowSurface</a></li>
|
||||||
|
</ul>
|
||||||
|
<p >GLFW uses synchronization objects internally only to manage the per-thread context and error states. Additional synchronization is left to the application.</p>
|
||||||
|
<p >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.</p>
|
||||||
|
<h2><a class="anchor" id="compatibility"></a>
|
||||||
|
Version compatibility</h2>
|
||||||
|
<p >GLFW uses <a href="https://semver.org/">Semantic Versioning</a>. 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.</p>
|
||||||
|
<p >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.</p>
|
||||||
|
<p >Undocumented behavior, i.e. behavior that is not described in the documentation, may change at any time until it is documented.</p>
|
||||||
|
<p >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.</p>
|
||||||
|
<h2><a class="anchor" id="event_order"></a>
|
||||||
|
Event order</h2>
|
||||||
|
<p >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.</p>
|
||||||
|
<h1><a class="anchor" id="intro_version"></a>
|
||||||
|
Version management</h1>
|
||||||
|
<p >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.</p>
|
||||||
|
<h2><a class="anchor" id="intro_version_compile"></a>
|
||||||
|
Compile-time version</h2>
|
||||||
|
<p >The compile-time version of GLFW is provided by the GLFW header with the <code>GLFW_VERSION_MAJOR</code>, <code>GLFW_VERSION_MINOR</code> and <code>GLFW_VERSION_REVISION</code> macros.</p>
|
||||||
|
<div class="fragment"><div class="line">printf(<span class="stringliteral">"Compiled against GLFW %i.%i.%i\n"</span>,</div>
|
||||||
|
<div class="line"> <a class="code hl_define" href="group__init.html#ga6337d9ea43b22fc529b2bba066b4a576">GLFW_VERSION_MAJOR</a>,</div>
|
||||||
|
<div class="line"> <a class="code hl_define" href="group__init.html#gaf80d40f0aea7088ff337606e9c48f7a3">GLFW_VERSION_MINOR</a>,</div>
|
||||||
|
<div class="line"> <a class="code hl_define" href="group__init.html#gab72ae2e2035d9ea461abc3495eac0502">GLFW_VERSION_REVISION</a>);</div>
|
||||||
|
<div class="ttc" id="agroup__init_html_ga6337d9ea43b22fc529b2bba066b4a576"><div class="ttname"><a href="group__init.html#ga6337d9ea43b22fc529b2bba066b4a576">GLFW_VERSION_MAJOR</a></div><div class="ttdeci">#define GLFW_VERSION_MAJOR</div><div class="ttdoc">The major version number of the GLFW header.</div><div class="ttdef"><b>Definition:</b> glfw3.h:287</div></div>
|
||||||
|
<div class="ttc" id="agroup__init_html_gab72ae2e2035d9ea461abc3495eac0502"><div class="ttname"><a href="group__init.html#gab72ae2e2035d9ea461abc3495eac0502">GLFW_VERSION_REVISION</a></div><div class="ttdeci">#define GLFW_VERSION_REVISION</div><div class="ttdoc">The revision number of the GLFW header.</div><div class="ttdef"><b>Definition:</b> glfw3.h:301</div></div>
|
||||||
|
<div class="ttc" id="agroup__init_html_gaf80d40f0aea7088ff337606e9c48f7a3"><div class="ttname"><a href="group__init.html#gaf80d40f0aea7088ff337606e9c48f7a3">GLFW_VERSION_MINOR</a></div><div class="ttdeci">#define GLFW_VERSION_MINOR</div><div class="ttdoc">The minor version number of the GLFW header.</div><div class="ttdef"><b>Definition:</b> glfw3.h:294</div></div>
|
||||||
|
</div><!-- fragment --><h2><a class="anchor" id="intro_version_runtime"></a>
|
||||||
|
Run-time version</h2>
|
||||||
|
<p >The run-time version can be retrieved with <a class="el" href="group__init.html#ga9f8ffaacf3c269cc48eafbf8b9b71197">glfwGetVersion</a>, a function that may be called regardless of whether GLFW is initialized.</p>
|
||||||
|
<div class="fragment"><div class="line"><span class="keywordtype">int</span> major, minor, revision;</div>
|
||||||
|
<div class="line"><a class="code hl_function" href="group__init.html#ga9f8ffaacf3c269cc48eafbf8b9b71197">glfwGetVersion</a>(&major, &minor, &revision);</div>
|
||||||
|
<div class="line"> </div>
|
||||||
|
<div class="line">printf(<span class="stringliteral">"Running against GLFW %i.%i.%i\n"</span>, major, minor, revision);</div>
|
||||||
|
<div class="ttc" id="agroup__init_html_ga9f8ffaacf3c269cc48eafbf8b9b71197"><div class="ttname"><a href="group__init.html#ga9f8ffaacf3c269cc48eafbf8b9b71197">glfwGetVersion</a></div><div class="ttdeci">void glfwGetVersion(int *major, int *minor, int *rev)</div><div class="ttdoc">Retrieves the version of the GLFW library.</div></div>
|
||||||
|
</div><!-- fragment --><h2><a class="anchor" id="intro_version_string"></a>
|
||||||
|
Version string</h2>
|
||||||
|
<p >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.</p>
|
||||||
|
<p >The version string is returned by <a class="el" href="group__init.html#ga026abd003c8e6501981ab1662062f1c0">glfwGetVersionString</a>, a function that may be called regardless of whether GLFW is initialized.</p>
|
||||||
|
<p ><b>Do not use the version string</b> to parse the GLFW library version. The <a class="el" href="group__init.html#ga9f8ffaacf3c269cc48eafbf8b9b71197">glfwGetVersion</a> function already provides the version of the running library binary.</p>
|
||||||
|
<p >The format of the string is as follows:</p><ul>
|
||||||
|
<li>The version of GLFW</li>
|
||||||
|
<li>The name of the window system API</li>
|
||||||
|
<li>The name of the context creation API</li>
|
||||||
|
<li>Any additional options or APIs</li>
|
||||||
|
</ul>
|
||||||
|
<p >For example, when compiling GLFW 3.0 with MinGW using the Win32 and WGL back ends, the version string may look something like this:</p>
|
||||||
|
<div class="fragment"><div class="line">3.0.0 Win32 WGL MinGW</div>
|
||||||
|
</div><!-- fragment --> </div></div><!-- contents -->
|
||||||
|
</div><!-- PageDoc -->
|
||||||
|
<address class="footer">
|
||||||
|
<p>
|
||||||
|
Last update on Fri Jul 22 2022 for GLFW 3.3.8
|
||||||
|
</p>
|
||||||
|
</address>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,74 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
|
<meta name="generator" content="Doxygen 1.9.4"/>
|
||||||
|
<title>GLFW: main.dox File Reference</title>
|
||||||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||||||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||||
|
<script type="text/javascript" src="search/search.js"></script>
|
||||||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="extra.css" rel="stylesheet" type="text/css"/>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<div id="titlearea">
|
||||||
|
<div class="glfwheader">
|
||||||
|
<a href="https://www.glfw.org/" id="glfwhome">GLFW</a>
|
||||||
|
<ul class="glfwnavbar">
|
||||||
|
<li><a href="https://www.glfw.org/documentation.html">Documentation</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/download.html">Download</a></li>
|
||||||
|
<li><a href="https://www.glfw.org/community.html">Community</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end header part -->
|
||||||
|
<!-- Generated by Doxygen 1.9.4 -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src="menudata.js"></script>
|
||||||
|
<script type="text/javascript" src="menu.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||||
|
$(function() {
|
||||||
|
initMenu('',true,false,'search.php','Search');
|
||||||
|
$(document).ready(function() { init_search(); });
|
||||||
|
});
|
||||||
|
/* @license-end */
|
||||||
|
</script>
|
||||||
|
<div id="main-nav"></div>
|
||||||
|
<!-- window showing the filter options -->
|
||||||
|
<div id="MSearchSelectWindow"
|
||||||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- iframe showing the search results (closed by default) -->
|
||||||
|
<div id="MSearchResultsWindow">
|
||||||
|
<iframe src="javascript:void(0)" frameborder="0"
|
||||||
|
name="MSearchResults" id="MSearchResults">
|
||||||
|
</iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div><!-- top -->
|
||||||
|
<div class="header">
|
||||||
|
<div class="headertitle"><div class="title">main.dox File Reference</div></div>
|
||||||
|
</div><!--header-->
|
||||||
|
<div class="contents">
|
||||||
|
</div><!-- contents -->
|
||||||
|
<address class="footer">
|
||||||
|
<p>
|
||||||
|
Last update on Fri Jul 22 2022 for GLFW 3.3.8
|
||||||
|
</p>
|
||||||
|
</address>
|
||||||
|
</body>
|
||||||
|
</html>
|